@netless/appliance-plugin 1.1.34-beta.3 → 1.1.35-beta.0
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/READMA.zh-CN.md +33 -1
- package/README.md +32 -0
- package/cdn/cdn.js +1 -1
- package/cdn/fullWorker-BShzOf.js +486 -0
- package/cdn/subWorker-DofGU2.js +486 -0
- package/dist/appliance-plugin.js +1 -1
- package/dist/appliance-plugin.mjs +1 -1
- package/dist/assets/fullWorker-BLBp1QlT.js +593 -0
- package/dist/assets/subWorker-CA5sK8hX.js +593 -0
- package/dist/{bridge-Bb-MjyNY.mjs → bridge-D6IerdOk.mjs} +6 -6
- package/dist/{bridge-m2Uim0rf.js → bridge-s6K3XU2g.js} +1 -1
- package/dist/bridge.js +1 -1
- package/dist/bridge.mjs +1 -1
- package/dist/core/autoShape/index.d.ts +12 -0
- package/dist/core/autoShape/mapper.d.ts +3 -0
- package/dist/core/autoShape/recognizer.d.ts +8 -0
- package/dist/core/autoShape/registry.d.ts +2 -0
- package/dist/core/autoShape/templates.d.ts +2 -0
- package/dist/core/autoShape/types.d.ts +78 -0
- package/dist/core/mainEngine.d.ts +9 -0
- package/dist/core/tools/pencil.d.ts +3 -0
- package/dist/core/types.d.ts +7 -0
- package/dist/fullWorker.js +147 -147
- package/dist/index-328yD4vj.js +1 -0
- package/dist/{index-B5p02yLM.mjs → index-4k563Sm-.mjs} +3076 -2293
- package/dist/index-C89lvDjQ.js +1 -0
- package/dist/{index-C-ITXa9_.js → index-CBE_U7Gn.js} +3 -3
- package/dist/{index-BAEfMWKR.mjs → index-CPmHcL9u.mjs} +1041 -1013
- package/dist/{index-BbVM6AMN.mjs → index-D-IWIyEl.mjs} +260 -253
- package/dist/{index-D9CYiyfx.mjs → index-D1p6YXf0.mjs} +3014 -2238
- package/dist/{index-HS0sRcOj.js → index-DDL0Hq_X.js} +3 -3
- package/dist/{index-on8Dtynb.mjs → index-DR2km5D4.mjs} +215 -208
- package/dist/index-DXx1-O0K.js +1 -0
- package/dist/index-DbLWM-6h.js +1 -0
- package/dist/{index-O6ldDna3.mjs → index-IQRiGPX7.mjs} +1041 -1013
- package/dist/plugin/multi/containerManager.d.ts +7 -0
- package/dist/plugin/types.d.ts +24 -0
- package/dist/subWorker.js +147 -147
- package/dist/svgToImageLoader-B3gIDAQo.js +1 -0
- package/dist/svgToImageLoader-DZz5bAo4.mjs +22 -0
- package/package.json +11 -5
- package/cdn/fullWorker-cY8Uuj.js +0 -486
- package/cdn/subWorker-BleGf3.js +0 -486
- package/dist/assets/fullWorker-BuSPsz-_.js +0 -593
- package/dist/assets/subWorker-B0NfJ2Bk.js +0 -593
- package/dist/index-BVYBjZU_.js +0 -1
- package/dist/index-D696FwsD.js +0 -1
- package/dist/index-DTeRhVER.js +0 -1
- package/dist/index-DnT8RFOT.js +0 -1
- package/dist/svgToImageLoader-DPRAAhwW.js +0 -1
- package/dist/svgToImageLoader-mXH53h-l.mjs +0 -18
|
@@ -0,0 +1,486 @@
|
|
|
1
|
+
var _excluded=["toolsType"],_excluded2=["callback"],_excluded3=["render"],_excluded4=["render"];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 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 _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 _superPropSet(t,e,o,r,p,f){return _set(_getPrototypeOf(f?t.prototype:t),e,o,r,p);}function set(e,r,t,o){return set="undefined"!=typeof Reflect&&Reflect.set?Reflect.set:function(e,r,t,o){var f,i=_superPropBase(e,r);if(i){if((f=Object.getOwnPropertyDescriptor(i,r)).set)return f.set.call(o,t),!0;if(!f.writable)return!1;}if(f=Object.getOwnPropertyDescriptor(o,r)){if(!f.writable)return!1;f.value=t,Object.defineProperty(o,r,f);}else _defineProperty(o,r,t);return!0;},set(e,r,t,o);}function _set(e,r,t,o,f){if(!set(e,r,t,o||e)&&f)throw new TypeError("failed to set property");return t;}function _wrapNativeSuper(t){var r="function"==typeof Map?new Map():void 0;return _wrapNativeSuper=function _wrapNativeSuper(t){if(null===t||!_isNativeFunction(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,Wrapper);}function Wrapper(){return _construct(t,arguments,_getPrototypeOf(this).constructor);}return Wrapper.prototype=Object.create(t.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(Wrapper,t);},_wrapNativeSuper(t);}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 _isNativeFunction(t){try{return-1!==Function.toString.call(t).indexOf("[native code]");}catch(n){return"function"==typeof t;}}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 _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 _toArray(r){return _arrayWithHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableRest();}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 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 _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 _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 _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 _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 _n8=0,F=function F(){};return{s:F,n:function n(){return _n8>=r.length?{done:!0}:{done:!1,value:r[_n8++]};},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 _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 _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 _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 _y=Object.defineProperty;var t1=function t1(i,e,t){return e in i?_y(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;};var dt=function dt(i,e,t){return t1(i,_typeof(e)!="symbol"?e+"":e,t);};var Ne=/******/function(i){var e={};function t(r){if(e[r])return e[r].exports;var n=e[r]={/******/i:r,/******/l:!1,/******/exports:{}/******/};return i[r].call(n.exports,n,n.exports,t),n.l=!0,n.exports;}return t.m=i,t.c=e,t.d=function(r,n,s){t.o(r,n)||Object.defineProperty(r,n,{enumerable:!0,get:s});},t.r=function(r){(typeof Symbol==="undefined"?"undefined":_typeof(Symbol))<"u"&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0});},t.t=function(r,n){if(n&1&&(r=t(r)),n&8||n&4&&_typeof(r)=="object"&&r&&r.__esModule)return r;var s=/* @__PURE__ */Object.create(null);if(t.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:r}),n&2&&typeof r!="string")for(var c in r)t.d(s,c,function(l){return r[l];}.bind(null,c));return s;},t.n=function(r){var n=r&&r.__esModule?(/******/function(){return r["default"];}):(/******/function(){return r;});return t.d(n,"a",n),n;},t.o=function(r,n){return Object.prototype.hasOwnProperty.call(r,n);},t.p="/js/",t(t.s=0);}([/* 0 *//***/function(i,e,t){t.r(e),t.d(e,"version",function(){return et;}),t.d(e,"helpers",function(){return z;}),t.d(e,"createElement",function(){return $;}),t.d(e,"isSpriteNode",function(){return B;}),t.d(e,"registerNode",function(){return N;});var r=t(12);t.d(e,"ENV",function(){return r.ENV;});var n=t(68);t.d(e,"requestAnimationFrame",function(){return n.requestAnimationFrame;}),t.d(e,"cancelAnimationFrame",function(){return n.cancelAnimationFrame;});var s=t(70);t.d(e,"Node",function(){return s["default"];});var c=t(217);t.d(e,"Cloud",function(){return c["default"];});var l=t(219);t.d(e,"Block",function(){return l["default"];});var f=t(224);t.d(e,"Sprite",function(){return f["default"];});var u=t(226);t.d(e,"Path",function(){return u["default"];});var v=t(229);t.d(e,"Rect",function(){return v["default"];});var h=t(231);t.d(e,"Triangle",function(){return h["default"];});var y=t(236);t.d(e,"Parallel",function(){return y["default"];});var T=t(238);t.d(e,"Regular",function(){return T["default"];});var O=t(240);t.d(e,"Star",function(){return O["default"];});var I=t(242);t.d(e,"Ellipse",function(){return I["default"];});var P=t(244);t.d(e,"Arc",function(){return P["default"];});var w=t(246);t.d(e,"Ring",function(){return w["default"];});var d=t(232);t.d(e,"Polyline",function(){return d["default"];});var m=t(248);t.d(e,"Label",function(){return m["default"];});var p=t(250);t.d(e,"Group",function(){return p["default"];});var S=t(286);t.d(e,"Layer",function(){return S["default"];});var E=t(287);t.d(e,"SpriteSvg",function(){return E["default"];});var R=t(289);t.d(e,"LayerWorker",function(){return R["default"];});var D=t(290);t.d(e,"Scene",function(){return D["default"];});var U=t(213),M=t(221);t.d(e,"Color",function(){return M.Color;}),t.d(e,"Gradient",function(){return M.Gradient;});var W=t(72);t(1).glMatrix.setMatrixArrayType(Array);var $=U["default"].createElement,B=U["default"].isSpriteNode,N=U["default"].registerNode,z={parseColor:M.parseColor,sizeToPixel:W.sizeToPixel,toArray:W.toArray,toString:W.toString,toNumber:W.toNumber};var J;J="3.8.3";var et=J;},/* 1 *//***/function(i,e,t){t.r(e);var r=t(2);t.d(e,"glMatrix",function(){return r;});var n=t(3);t.d(e,"mat2",function(){return n;});var s=t(4);t.d(e,"mat2d",function(){return s;});var c=t(5);t.d(e,"mat3",function(){return c;});var l=t(6);t.d(e,"mat4",function(){return l;});var f=t(7);t.d(e,"quat",function(){return f;});var u=t(10);t.d(e,"quat2",function(){return u;});var v=t(11);t.d(e,"vec2",function(){return v;});var h=t(8);t.d(e,"vec3",function(){return h;});var y=t(9);t.d(e,"vec4",function(){return y;});},/* 2 *//***/function(i,e,t){t.r(e),t.d(e,"EPSILON",function(){return r;}),t.d(e,"ARRAY_TYPE",function(){return n;}),t.d(e,"RANDOM",function(){return s;}),t.d(e,"setMatrixArrayType",function(){return c;}),t.d(e,"toRadian",function(){return f;}),t.d(e,"equals",function(){return u;});var r=1e-6,n=(typeof Float32Array==="undefined"?"undefined":_typeof(Float32Array))<"u"?Float32Array:Array,s=Math.random;function c(v){n=v;}var l=Math.PI/180;function f(v){return v*l;}function u(v,h){return Math.abs(v-h)<=r*Math.max(1,Math.abs(v),Math.abs(h));}Math.hypot||(Math.hypot=function(){for(var v=0,h=arguments.length;h--;)v+=arguments[h]*arguments[h];return Math.sqrt(v);});},/* 3 *//***/function(i,e,t){t.r(e),t.d(e,"create",function(){return n;}),t.d(e,"clone",function(){return s;}),t.d(e,"copy",function(){return c;}),t.d(e,"identity",function(){return l;}),t.d(e,"fromValues",function(){return f;}),t.d(e,"set",function(){return u;}),t.d(e,"transpose",function(){return v;}),t.d(e,"invert",function(){return h;}),t.d(e,"adjoint",function(){return y;}),t.d(e,"determinant",function(){return T;}),t.d(e,"multiply",function(){return O;}),t.d(e,"rotate",function(){return I;}),t.d(e,"scale",function(){return P;}),t.d(e,"fromRotation",function(){return w;}),t.d(e,"fromScaling",function(){return d;}),t.d(e,"str",function(){return m;}),t.d(e,"frob",function(){return p;}),t.d(e,"LDU",function(){return S;}),t.d(e,"add",function(){return E;}),t.d(e,"subtract",function(){return R;}),t.d(e,"exactEquals",function(){return D;}),t.d(e,"equals",function(){return U;}),t.d(e,"multiplyScalar",function(){return M;}),t.d(e,"multiplyScalarAndAdd",function(){return W;}),t.d(e,"mul",function(){return $;}),t.d(e,"sub",function(){return B;});var r=t(2);function n(){var N=new r.ARRAY_TYPE(4);return r.ARRAY_TYPE!=Float32Array&&(N[1]=0,N[2]=0),N[0]=1,N[3]=1,N;}function s(N){var z=new r.ARRAY_TYPE(4);return z[0]=N[0],z[1]=N[1],z[2]=N[2],z[3]=N[3],z;}function c(N,z){return N[0]=z[0],N[1]=z[1],N[2]=z[2],N[3]=z[3],N;}function l(N){return N[0]=1,N[1]=0,N[2]=0,N[3]=1,N;}function f(N,z,J,et){var at=new r.ARRAY_TYPE(4);return at[0]=N,at[1]=z,at[2]=J,at[3]=et,at;}function u(N,z,J,et,at){return N[0]=z,N[1]=J,N[2]=et,N[3]=at,N;}function v(N,z){if(N===z){var J=z[1];N[1]=z[2],N[2]=J;}else N[0]=z[0],N[1]=z[2],N[2]=z[1],N[3]=z[3];return N;}function h(N,z){var J=z[0],et=z[1],at=z[2],ct=z[3],V=J*ct-at*et;return V?(V=1/V,N[0]=ct*V,N[1]=-et*V,N[2]=-at*V,N[3]=J*V,N):null;}function y(N,z){var J=z[0];return N[0]=z[3],N[1]=-z[1],N[2]=-z[2],N[3]=J,N;}function T(N){return N[0]*N[3]-N[2]*N[1];}function O(N,z,J){var et=z[0],at=z[1],ct=z[2],V=z[3],Q=J[0],ft=J[1],mt=J[2],yt=J[3];return N[0]=et*Q+ct*ft,N[1]=at*Q+V*ft,N[2]=et*mt+ct*yt,N[3]=at*mt+V*yt,N;}function I(N,z,J){var et=z[0],at=z[1],ct=z[2],V=z[3],Q=Math.sin(J),ft=Math.cos(J);return N[0]=et*ft+ct*Q,N[1]=at*ft+V*Q,N[2]=et*-Q+ct*ft,N[3]=at*-Q+V*ft,N;}function P(N,z,J){var et=z[0],at=z[1],ct=z[2],V=z[3],Q=J[0],ft=J[1];return N[0]=et*Q,N[1]=at*Q,N[2]=ct*ft,N[3]=V*ft,N;}function w(N,z){var J=Math.sin(z),et=Math.cos(z);return N[0]=et,N[1]=J,N[2]=-J,N[3]=et,N;}function d(N,z){return N[0]=z[0],N[1]=0,N[2]=0,N[3]=z[1],N;}function m(N){return"mat2("+N[0]+", "+N[1]+", "+N[2]+", "+N[3]+")";}function p(N){return Math.hypot(N[0],N[1],N[2],N[3]);}function S(N,z,J,et){return N[2]=et[2]/et[0],J[0]=et[0],J[1]=et[1],J[3]=et[3]-N[2]*J[1],[N,z,J];}function E(N,z,J){return N[0]=z[0]+J[0],N[1]=z[1]+J[1],N[2]=z[2]+J[2],N[3]=z[3]+J[3],N;}function R(N,z,J){return N[0]=z[0]-J[0],N[1]=z[1]-J[1],N[2]=z[2]-J[2],N[3]=z[3]-J[3],N;}function D(N,z){return N[0]===z[0]&&N[1]===z[1]&&N[2]===z[2]&&N[3]===z[3];}function U(N,z){var J=N[0],et=N[1],at=N[2],ct=N[3],V=z[0],Q=z[1],ft=z[2],mt=z[3];return Math.abs(J-V)<=r.EPSILON*Math.max(1,Math.abs(J),Math.abs(V))&&Math.abs(et-Q)<=r.EPSILON*Math.max(1,Math.abs(et),Math.abs(Q))&&Math.abs(at-ft)<=r.EPSILON*Math.max(1,Math.abs(at),Math.abs(ft))&&Math.abs(ct-mt)<=r.EPSILON*Math.max(1,Math.abs(ct),Math.abs(mt));}function M(N,z,J){return N[0]=z[0]*J,N[1]=z[1]*J,N[2]=z[2]*J,N[3]=z[3]*J,N;}function W(N,z,J,et){return N[0]=z[0]+J[0]*et,N[1]=z[1]+J[1]*et,N[2]=z[2]+J[2]*et,N[3]=z[3]+J[3]*et,N;}var $=O,B=R;},/* 4 *//***/function(i,e,t){t.r(e),t.d(e,"create",function(){return n;}),t.d(e,"clone",function(){return s;}),t.d(e,"copy",function(){return c;}),t.d(e,"identity",function(){return l;}),t.d(e,"fromValues",function(){return f;}),t.d(e,"set",function(){return u;}),t.d(e,"invert",function(){return v;}),t.d(e,"determinant",function(){return h;}),t.d(e,"multiply",function(){return y;}),t.d(e,"rotate",function(){return T;}),t.d(e,"scale",function(){return O;}),t.d(e,"translate",function(){return I;}),t.d(e,"fromRotation",function(){return P;}),t.d(e,"fromScaling",function(){return w;}),t.d(e,"fromTranslation",function(){return d;}),t.d(e,"str",function(){return m;}),t.d(e,"frob",function(){return p;}),t.d(e,"add",function(){return S;}),t.d(e,"subtract",function(){return E;}),t.d(e,"multiplyScalar",function(){return R;}),t.d(e,"multiplyScalarAndAdd",function(){return D;}),t.d(e,"exactEquals",function(){return U;}),t.d(e,"equals",function(){return M;}),t.d(e,"mul",function(){return W;}),t.d(e,"sub",function(){return $;});var r=t(2);function n(){var B=new r.ARRAY_TYPE(6);return r.ARRAY_TYPE!=Float32Array&&(B[1]=0,B[2]=0,B[4]=0,B[5]=0),B[0]=1,B[3]=1,B;}function s(B){var N=new r.ARRAY_TYPE(6);return N[0]=B[0],N[1]=B[1],N[2]=B[2],N[3]=B[3],N[4]=B[4],N[5]=B[5],N;}function c(B,N){return B[0]=N[0],B[1]=N[1],B[2]=N[2],B[3]=N[3],B[4]=N[4],B[5]=N[5],B;}function l(B){return B[0]=1,B[1]=0,B[2]=0,B[3]=1,B[4]=0,B[5]=0,B;}function f(B,N,z,J,et,at){var ct=new r.ARRAY_TYPE(6);return ct[0]=B,ct[1]=N,ct[2]=z,ct[3]=J,ct[4]=et,ct[5]=at,ct;}function u(B,N,z,J,et,at,ct){return B[0]=N,B[1]=z,B[2]=J,B[3]=et,B[4]=at,B[5]=ct,B;}function v(B,N){var z=N[0],J=N[1],et=N[2],at=N[3],ct=N[4],V=N[5],Q=z*at-J*et;return Q?(Q=1/Q,B[0]=at*Q,B[1]=-J*Q,B[2]=-et*Q,B[3]=z*Q,B[4]=(et*V-at*ct)*Q,B[5]=(J*ct-z*V)*Q,B):null;}function h(B){return B[0]*B[3]-B[1]*B[2];}function y(B,N,z){var J=N[0],et=N[1],at=N[2],ct=N[3],V=N[4],Q=N[5],ft=z[0],mt=z[1],yt=z[2],At=z[3],ht=z[4],Nt=z[5];return B[0]=J*ft+at*mt,B[1]=et*ft+ct*mt,B[2]=J*yt+at*At,B[3]=et*yt+ct*At,B[4]=J*ht+at*Nt+V,B[5]=et*ht+ct*Nt+Q,B;}function T(B,N,z){var J=N[0],et=N[1],at=N[2],ct=N[3],V=N[4],Q=N[5],ft=Math.sin(z),mt=Math.cos(z);return B[0]=J*mt+at*ft,B[1]=et*mt+ct*ft,B[2]=J*-ft+at*mt,B[3]=et*-ft+ct*mt,B[4]=V,B[5]=Q,B;}function O(B,N,z){var J=N[0],et=N[1],at=N[2],ct=N[3],V=N[4],Q=N[5],ft=z[0],mt=z[1];return B[0]=J*ft,B[1]=et*ft,B[2]=at*mt,B[3]=ct*mt,B[4]=V,B[5]=Q,B;}function I(B,N,z){var J=N[0],et=N[1],at=N[2],ct=N[3],V=N[4],Q=N[5],ft=z[0],mt=z[1];return B[0]=J,B[1]=et,B[2]=at,B[3]=ct,B[4]=J*ft+at*mt+V,B[5]=et*ft+ct*mt+Q,B;}function P(B,N){var z=Math.sin(N),J=Math.cos(N);return B[0]=J,B[1]=z,B[2]=-z,B[3]=J,B[4]=0,B[5]=0,B;}function w(B,N){return B[0]=N[0],B[1]=0,B[2]=0,B[3]=N[1],B[4]=0,B[5]=0,B;}function d(B,N){return B[0]=1,B[1]=0,B[2]=0,B[3]=1,B[4]=N[0],B[5]=N[1],B;}function m(B){return"mat2d("+B[0]+", "+B[1]+", "+B[2]+", "+B[3]+", "+B[4]+", "+B[5]+")";}function p(B){return Math.hypot(B[0],B[1],B[2],B[3],B[4],B[5],1);}function S(B,N,z){return B[0]=N[0]+z[0],B[1]=N[1]+z[1],B[2]=N[2]+z[2],B[3]=N[3]+z[3],B[4]=N[4]+z[4],B[5]=N[5]+z[5],B;}function E(B,N,z){return B[0]=N[0]-z[0],B[1]=N[1]-z[1],B[2]=N[2]-z[2],B[3]=N[3]-z[3],B[4]=N[4]-z[4],B[5]=N[5]-z[5],B;}function R(B,N,z){return B[0]=N[0]*z,B[1]=N[1]*z,B[2]=N[2]*z,B[3]=N[3]*z,B[4]=N[4]*z,B[5]=N[5]*z,B;}function D(B,N,z,J){return B[0]=N[0]+z[0]*J,B[1]=N[1]+z[1]*J,B[2]=N[2]+z[2]*J,B[3]=N[3]+z[3]*J,B[4]=N[4]+z[4]*J,B[5]=N[5]+z[5]*J,B;}function U(B,N){return B[0]===N[0]&&B[1]===N[1]&&B[2]===N[2]&&B[3]===N[3]&&B[4]===N[4]&&B[5]===N[5];}function M(B,N){var z=B[0],J=B[1],et=B[2],at=B[3],ct=B[4],V=B[5],Q=N[0],ft=N[1],mt=N[2],yt=N[3],At=N[4],ht=N[5];return Math.abs(z-Q)<=r.EPSILON*Math.max(1,Math.abs(z),Math.abs(Q))&&Math.abs(J-ft)<=r.EPSILON*Math.max(1,Math.abs(J),Math.abs(ft))&&Math.abs(et-mt)<=r.EPSILON*Math.max(1,Math.abs(et),Math.abs(mt))&&Math.abs(at-yt)<=r.EPSILON*Math.max(1,Math.abs(at),Math.abs(yt))&&Math.abs(ct-At)<=r.EPSILON*Math.max(1,Math.abs(ct),Math.abs(At))&&Math.abs(V-ht)<=r.EPSILON*Math.max(1,Math.abs(V),Math.abs(ht));}var W=y,$=E;},/* 5 *//***/function(i,e,t){t.r(e),t.d(e,"create",function(){return n;}),t.d(e,"fromMat4",function(){return s;}),t.d(e,"clone",function(){return c;}),t.d(e,"copy",function(){return l;}),t.d(e,"fromValues",function(){return f;}),t.d(e,"set",function(){return u;}),t.d(e,"identity",function(){return v;}),t.d(e,"transpose",function(){return h;}),t.d(e,"invert",function(){return y;}),t.d(e,"adjoint",function(){return T;}),t.d(e,"determinant",function(){return O;}),t.d(e,"multiply",function(){return I;}),t.d(e,"translate",function(){return P;}),t.d(e,"rotate",function(){return w;}),t.d(e,"scale",function(){return d;}),t.d(e,"fromTranslation",function(){return m;}),t.d(e,"fromRotation",function(){return p;}),t.d(e,"fromScaling",function(){return S;}),t.d(e,"fromMat2d",function(){return E;}),t.d(e,"fromQuat",function(){return R;}),t.d(e,"normalFromMat4",function(){return D;}),t.d(e,"projection",function(){return U;}),t.d(e,"str",function(){return M;}),t.d(e,"frob",function(){return W;}),t.d(e,"add",function(){return $;}),t.d(e,"subtract",function(){return B;}),t.d(e,"multiplyScalar",function(){return N;}),t.d(e,"multiplyScalarAndAdd",function(){return z;}),t.d(e,"exactEquals",function(){return J;}),t.d(e,"equals",function(){return et;}),t.d(e,"mul",function(){return at;}),t.d(e,"sub",function(){return ct;});var r=t(2);function n(){var V=new r.ARRAY_TYPE(9);return r.ARRAY_TYPE!=Float32Array&&(V[1]=0,V[2]=0,V[3]=0,V[5]=0,V[6]=0,V[7]=0),V[0]=1,V[4]=1,V[8]=1,V;}function s(V,Q){return V[0]=Q[0],V[1]=Q[1],V[2]=Q[2],V[3]=Q[4],V[4]=Q[5],V[5]=Q[6],V[6]=Q[8],V[7]=Q[9],V[8]=Q[10],V;}function c(V){var Q=new r.ARRAY_TYPE(9);return Q[0]=V[0],Q[1]=V[1],Q[2]=V[2],Q[3]=V[3],Q[4]=V[4],Q[5]=V[5],Q[6]=V[6],Q[7]=V[7],Q[8]=V[8],Q;}function l(V,Q){return V[0]=Q[0],V[1]=Q[1],V[2]=Q[2],V[3]=Q[3],V[4]=Q[4],V[5]=Q[5],V[6]=Q[6],V[7]=Q[7],V[8]=Q[8],V;}function f(V,Q,ft,mt,yt,At,ht,Nt,Bt){var G=new r.ARRAY_TYPE(9);return G[0]=V,G[1]=Q,G[2]=ft,G[3]=mt,G[4]=yt,G[5]=At,G[6]=ht,G[7]=Nt,G[8]=Bt,G;}function u(V,Q,ft,mt,yt,At,ht,Nt,Bt,G){return V[0]=Q,V[1]=ft,V[2]=mt,V[3]=yt,V[4]=At,V[5]=ht,V[6]=Nt,V[7]=Bt,V[8]=G,V;}function v(V){return V[0]=1,V[1]=0,V[2]=0,V[3]=0,V[4]=1,V[5]=0,V[6]=0,V[7]=0,V[8]=1,V;}function h(V,Q){if(V===Q){var ft=Q[1],mt=Q[2],yt=Q[5];V[1]=Q[3],V[2]=Q[6],V[3]=ft,V[5]=Q[7],V[6]=mt,V[7]=yt;}else V[0]=Q[0],V[1]=Q[3],V[2]=Q[6],V[3]=Q[1],V[4]=Q[4],V[5]=Q[7],V[6]=Q[2],V[7]=Q[5],V[8]=Q[8];return V;}function y(V,Q){var ft=Q[0],mt=Q[1],yt=Q[2],At=Q[3],ht=Q[4],Nt=Q[5],Bt=Q[6],G=Q[7],k=Q[8],rt=k*ht-Nt*G,nt=-k*At+Nt*Bt,Y=G*At-ht*Bt,Z=ft*rt+mt*nt+yt*Y;return Z?(Z=1/Z,V[0]=rt*Z,V[1]=(-k*mt+yt*G)*Z,V[2]=(Nt*mt-yt*ht)*Z,V[3]=nt*Z,V[4]=(k*ft-yt*Bt)*Z,V[5]=(-Nt*ft+yt*At)*Z,V[6]=Y*Z,V[7]=(-G*ft+mt*Bt)*Z,V[8]=(ht*ft-mt*At)*Z,V):null;}function T(V,Q){var ft=Q[0],mt=Q[1],yt=Q[2],At=Q[3],ht=Q[4],Nt=Q[5],Bt=Q[6],G=Q[7],k=Q[8];return V[0]=ht*k-Nt*G,V[1]=yt*G-mt*k,V[2]=mt*Nt-yt*ht,V[3]=Nt*Bt-At*k,V[4]=ft*k-yt*Bt,V[5]=yt*At-ft*Nt,V[6]=At*G-ht*Bt,V[7]=mt*Bt-ft*G,V[8]=ft*ht-mt*At,V;}function O(V){var Q=V[0],ft=V[1],mt=V[2],yt=V[3],At=V[4],ht=V[5],Nt=V[6],Bt=V[7],G=V[8];return Q*(G*At-ht*Bt)+ft*(-G*yt+ht*Nt)+mt*(Bt*yt-At*Nt);}function I(V,Q,ft){var mt=Q[0],yt=Q[1],At=Q[2],ht=Q[3],Nt=Q[4],Bt=Q[5],G=Q[6],k=Q[7],rt=Q[8],nt=ft[0],Y=ft[1],Z=ft[2],C=ft[3],L=ft[4],X=ft[5],K=ft[6],q=ft[7],it=ft[8];return V[0]=nt*mt+Y*ht+Z*G,V[1]=nt*yt+Y*Nt+Z*k,V[2]=nt*At+Y*Bt+Z*rt,V[3]=C*mt+L*ht+X*G,V[4]=C*yt+L*Nt+X*k,V[5]=C*At+L*Bt+X*rt,V[6]=K*mt+q*ht+it*G,V[7]=K*yt+q*Nt+it*k,V[8]=K*At+q*Bt+it*rt,V;}function P(V,Q,ft){var mt=Q[0],yt=Q[1],At=Q[2],ht=Q[3],Nt=Q[4],Bt=Q[5],G=Q[6],k=Q[7],rt=Q[8],nt=ft[0],Y=ft[1];return V[0]=mt,V[1]=yt,V[2]=At,V[3]=ht,V[4]=Nt,V[5]=Bt,V[6]=nt*mt+Y*ht+G,V[7]=nt*yt+Y*Nt+k,V[8]=nt*At+Y*Bt+rt,V;}function w(V,Q,ft){var mt=Q[0],yt=Q[1],At=Q[2],ht=Q[3],Nt=Q[4],Bt=Q[5],G=Q[6],k=Q[7],rt=Q[8],nt=Math.sin(ft),Y=Math.cos(ft);return V[0]=Y*mt+nt*ht,V[1]=Y*yt+nt*Nt,V[2]=Y*At+nt*Bt,V[3]=Y*ht-nt*mt,V[4]=Y*Nt-nt*yt,V[5]=Y*Bt-nt*At,V[6]=G,V[7]=k,V[8]=rt,V;}function d(V,Q,ft){var mt=ft[0],yt=ft[1];return V[0]=mt*Q[0],V[1]=mt*Q[1],V[2]=mt*Q[2],V[3]=yt*Q[3],V[4]=yt*Q[4],V[5]=yt*Q[5],V[6]=Q[6],V[7]=Q[7],V[8]=Q[8],V;}function m(V,Q){return V[0]=1,V[1]=0,V[2]=0,V[3]=0,V[4]=1,V[5]=0,V[6]=Q[0],V[7]=Q[1],V[8]=1,V;}function p(V,Q){var ft=Math.sin(Q),mt=Math.cos(Q);return V[0]=mt,V[1]=ft,V[2]=0,V[3]=-ft,V[4]=mt,V[5]=0,V[6]=0,V[7]=0,V[8]=1,V;}function S(V,Q){return V[0]=Q[0],V[1]=0,V[2]=0,V[3]=0,V[4]=Q[1],V[5]=0,V[6]=0,V[7]=0,V[8]=1,V;}function E(V,Q){return V[0]=Q[0],V[1]=Q[1],V[2]=0,V[3]=Q[2],V[4]=Q[3],V[5]=0,V[6]=Q[4],V[7]=Q[5],V[8]=1,V;}function R(V,Q){var ft=Q[0],mt=Q[1],yt=Q[2],At=Q[3],ht=ft+ft,Nt=mt+mt,Bt=yt+yt,G=ft*ht,k=mt*ht,rt=mt*Nt,nt=yt*ht,Y=yt*Nt,Z=yt*Bt,C=At*ht,L=At*Nt,X=At*Bt;return V[0]=1-rt-Z,V[3]=k-X,V[6]=nt+L,V[1]=k+X,V[4]=1-G-Z,V[7]=Y-C,V[2]=nt-L,V[5]=Y+C,V[8]=1-G-rt,V;}function D(V,Q){var ft=Q[0],mt=Q[1],yt=Q[2],At=Q[3],ht=Q[4],Nt=Q[5],Bt=Q[6],G=Q[7],k=Q[8],rt=Q[9],nt=Q[10],Y=Q[11],Z=Q[12],C=Q[13],L=Q[14],X=Q[15],K=ft*Nt-mt*ht,q=ft*Bt-yt*ht,it=ft*G-At*ht,ut=mt*Bt-yt*Nt,St=mt*G-At*Nt,Ct=yt*G-At*Bt,Et=k*C-rt*Z,bt=k*L-nt*Z,wt=k*X-Y*Z,Ot=rt*L-nt*C,Lt=rt*X-Y*C,Yt=nt*X-Y*L,zt=K*Yt-q*Lt+it*Ot+ut*wt-St*bt+Ct*Et;return zt?(zt=1/zt,V[0]=(Nt*Yt-Bt*Lt+G*Ot)*zt,V[1]=(Bt*wt-ht*Yt-G*bt)*zt,V[2]=(ht*Lt-Nt*wt+G*Et)*zt,V[3]=(yt*Lt-mt*Yt-At*Ot)*zt,V[4]=(ft*Yt-yt*wt+At*bt)*zt,V[5]=(mt*wt-ft*Lt-At*Et)*zt,V[6]=(C*Ct-L*St+X*ut)*zt,V[7]=(L*it-Z*Ct-X*q)*zt,V[8]=(Z*St-C*it+X*K)*zt,V):null;}function U(V,Q,ft){return V[0]=2/Q,V[1]=0,V[2]=0,V[3]=0,V[4]=-2/ft,V[5]=0,V[6]=-1,V[7]=1,V[8]=1,V;}function M(V){return"mat3("+V[0]+", "+V[1]+", "+V[2]+", "+V[3]+", "+V[4]+", "+V[5]+", "+V[6]+", "+V[7]+", "+V[8]+")";}function W(V){return Math.hypot(V[0],V[1],V[2],V[3],V[4],V[5],V[6],V[7],V[8]);}function $(V,Q,ft){return V[0]=Q[0]+ft[0],V[1]=Q[1]+ft[1],V[2]=Q[2]+ft[2],V[3]=Q[3]+ft[3],V[4]=Q[4]+ft[4],V[5]=Q[5]+ft[5],V[6]=Q[6]+ft[6],V[7]=Q[7]+ft[7],V[8]=Q[8]+ft[8],V;}function B(V,Q,ft){return V[0]=Q[0]-ft[0],V[1]=Q[1]-ft[1],V[2]=Q[2]-ft[2],V[3]=Q[3]-ft[3],V[4]=Q[4]-ft[4],V[5]=Q[5]-ft[5],V[6]=Q[6]-ft[6],V[7]=Q[7]-ft[7],V[8]=Q[8]-ft[8],V;}function N(V,Q,ft){return V[0]=Q[0]*ft,V[1]=Q[1]*ft,V[2]=Q[2]*ft,V[3]=Q[3]*ft,V[4]=Q[4]*ft,V[5]=Q[5]*ft,V[6]=Q[6]*ft,V[7]=Q[7]*ft,V[8]=Q[8]*ft,V;}function z(V,Q,ft,mt){return V[0]=Q[0]+ft[0]*mt,V[1]=Q[1]+ft[1]*mt,V[2]=Q[2]+ft[2]*mt,V[3]=Q[3]+ft[3]*mt,V[4]=Q[4]+ft[4]*mt,V[5]=Q[5]+ft[5]*mt,V[6]=Q[6]+ft[6]*mt,V[7]=Q[7]+ft[7]*mt,V[8]=Q[8]+ft[8]*mt,V;}function J(V,Q){return V[0]===Q[0]&&V[1]===Q[1]&&V[2]===Q[2]&&V[3]===Q[3]&&V[4]===Q[4]&&V[5]===Q[5]&&V[6]===Q[6]&&V[7]===Q[7]&&V[8]===Q[8];}function et(V,Q){var ft=V[0],mt=V[1],yt=V[2],At=V[3],ht=V[4],Nt=V[5],Bt=V[6],G=V[7],k=V[8],rt=Q[0],nt=Q[1],Y=Q[2],Z=Q[3],C=Q[4],L=Q[5],X=Q[6],K=Q[7],q=Q[8];return Math.abs(ft-rt)<=r.EPSILON*Math.max(1,Math.abs(ft),Math.abs(rt))&&Math.abs(mt-nt)<=r.EPSILON*Math.max(1,Math.abs(mt),Math.abs(nt))&&Math.abs(yt-Y)<=r.EPSILON*Math.max(1,Math.abs(yt),Math.abs(Y))&&Math.abs(At-Z)<=r.EPSILON*Math.max(1,Math.abs(At),Math.abs(Z))&&Math.abs(ht-C)<=r.EPSILON*Math.max(1,Math.abs(ht),Math.abs(C))&&Math.abs(Nt-L)<=r.EPSILON*Math.max(1,Math.abs(Nt),Math.abs(L))&&Math.abs(Bt-X)<=r.EPSILON*Math.max(1,Math.abs(Bt),Math.abs(X))&&Math.abs(G-K)<=r.EPSILON*Math.max(1,Math.abs(G),Math.abs(K))&&Math.abs(k-q)<=r.EPSILON*Math.max(1,Math.abs(k),Math.abs(q));}var at=I,ct=B;},/* 6 *//***/function(i,e,t){t.r(e),t.d(e,"create",function(){return n;}),t.d(e,"clone",function(){return s;}),t.d(e,"copy",function(){return c;}),t.d(e,"fromValues",function(){return l;}),t.d(e,"set",function(){return f;}),t.d(e,"identity",function(){return u;}),t.d(e,"transpose",function(){return v;}),t.d(e,"invert",function(){return h;}),t.d(e,"adjoint",function(){return y;}),t.d(e,"determinant",function(){return T;}),t.d(e,"multiply",function(){return O;}),t.d(e,"translate",function(){return I;}),t.d(e,"scale",function(){return P;}),t.d(e,"rotate",function(){return w;}),t.d(e,"rotateX",function(){return d;}),t.d(e,"rotateY",function(){return m;}),t.d(e,"rotateZ",function(){return p;}),t.d(e,"fromTranslation",function(){return S;}),t.d(e,"fromScaling",function(){return E;}),t.d(e,"fromRotation",function(){return R;}),t.d(e,"fromXRotation",function(){return D;}),t.d(e,"fromYRotation",function(){return U;}),t.d(e,"fromZRotation",function(){return M;}),t.d(e,"fromRotationTranslation",function(){return W;}),t.d(e,"fromQuat2",function(){return $;}),t.d(e,"getTranslation",function(){return B;}),t.d(e,"getScaling",function(){return N;}),t.d(e,"getRotation",function(){return z;}),t.d(e,"fromRotationTranslationScale",function(){return J;}),t.d(e,"fromRotationTranslationScaleOrigin",function(){return et;}),t.d(e,"fromQuat",function(){return at;}),t.d(e,"frustum",function(){return ct;}),t.d(e,"perspective",function(){return V;}),t.d(e,"perspectiveFromFieldOfView",function(){return Q;}),t.d(e,"ortho",function(){return ft;}),t.d(e,"lookAt",function(){return mt;}),t.d(e,"targetTo",function(){return yt;}),t.d(e,"str",function(){return At;}),t.d(e,"frob",function(){return ht;}),t.d(e,"add",function(){return Nt;}),t.d(e,"subtract",function(){return Bt;}),t.d(e,"multiplyScalar",function(){return G;}),t.d(e,"multiplyScalarAndAdd",function(){return k;}),t.d(e,"exactEquals",function(){return rt;}),t.d(e,"equals",function(){return nt;}),t.d(e,"mul",function(){return Y;}),t.d(e,"sub",function(){return Z;});var r=t(2);function n(){var C=new r.ARRAY_TYPE(16);return r.ARRAY_TYPE!=Float32Array&&(C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[6]=0,C[7]=0,C[8]=0,C[9]=0,C[11]=0,C[12]=0,C[13]=0,C[14]=0),C[0]=1,C[5]=1,C[10]=1,C[15]=1,C;}function s(C){var L=new r.ARRAY_TYPE(16);return L[0]=C[0],L[1]=C[1],L[2]=C[2],L[3]=C[3],L[4]=C[4],L[5]=C[5],L[6]=C[6],L[7]=C[7],L[8]=C[8],L[9]=C[9],L[10]=C[10],L[11]=C[11],L[12]=C[12],L[13]=C[13],L[14]=C[14],L[15]=C[15],L;}function c(C,L){return C[0]=L[0],C[1]=L[1],C[2]=L[2],C[3]=L[3],C[4]=L[4],C[5]=L[5],C[6]=L[6],C[7]=L[7],C[8]=L[8],C[9]=L[9],C[10]=L[10],C[11]=L[11],C[12]=L[12],C[13]=L[13],C[14]=L[14],C[15]=L[15],C;}function l(C,L,X,K,q,it,ut,St,Ct,Et,bt,wt,Ot,Lt,Yt,zt){var Wt=new r.ARRAY_TYPE(16);return Wt[0]=C,Wt[1]=L,Wt[2]=X,Wt[3]=K,Wt[4]=q,Wt[5]=it,Wt[6]=ut,Wt[7]=St,Wt[8]=Ct,Wt[9]=Et,Wt[10]=bt,Wt[11]=wt,Wt[12]=Ot,Wt[13]=Lt,Wt[14]=Yt,Wt[15]=zt,Wt;}function f(C,L,X,K,q,it,ut,St,Ct,Et,bt,wt,Ot,Lt,Yt,zt,Wt){return C[0]=L,C[1]=X,C[2]=K,C[3]=q,C[4]=it,C[5]=ut,C[6]=St,C[7]=Ct,C[8]=Et,C[9]=bt,C[10]=wt,C[11]=Ot,C[12]=Lt,C[13]=Yt,C[14]=zt,C[15]=Wt,C;}function u(C){return C[0]=1,C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=1,C[6]=0,C[7]=0,C[8]=0,C[9]=0,C[10]=1,C[11]=0,C[12]=0,C[13]=0,C[14]=0,C[15]=1,C;}function v(C,L){if(C===L){var X=L[1],K=L[2],q=L[3],it=L[6],ut=L[7],St=L[11];C[1]=L[4],C[2]=L[8],C[3]=L[12],C[4]=X,C[6]=L[9],C[7]=L[13],C[8]=K,C[9]=it,C[11]=L[14],C[12]=q,C[13]=ut,C[14]=St;}else C[0]=L[0],C[1]=L[4],C[2]=L[8],C[3]=L[12],C[4]=L[1],C[5]=L[5],C[6]=L[9],C[7]=L[13],C[8]=L[2],C[9]=L[6],C[10]=L[10],C[11]=L[14],C[12]=L[3],C[13]=L[7],C[14]=L[11],C[15]=L[15];return C;}function h(C,L){var X=L[0],K=L[1],q=L[2],it=L[3],ut=L[4],St=L[5],Ct=L[6],Et=L[7],bt=L[8],wt=L[9],Ot=L[10],Lt=L[11],Yt=L[12],zt=L[13],Wt=L[14],Qt=L[15],ue=X*St-K*ut,ie=X*Ct-q*ut,ne=X*Et-it*ut,ae=K*Ct-q*St,se=K*Et-it*St,We=q*Et-it*Ct,Fe=bt*zt-wt*Yt,$e=bt*Wt-Ot*Yt,Xe=bt*Qt-Lt*Yt,Ge=wt*Wt-Ot*zt,ke=wt*Qt-Lt*zt,Je=Ot*Qt-Lt*Wt,we=ue*Je-ie*ke+ne*Ge+ae*Xe-se*$e+We*Fe;return we?(we=1/we,C[0]=(St*Je-Ct*ke+Et*Ge)*we,C[1]=(q*ke-K*Je-it*Ge)*we,C[2]=(zt*We-Wt*se+Qt*ae)*we,C[3]=(Ot*se-wt*We-Lt*ae)*we,C[4]=(Ct*Xe-ut*Je-Et*$e)*we,C[5]=(X*Je-q*Xe+it*$e)*we,C[6]=(Wt*ne-Yt*We-Qt*ie)*we,C[7]=(bt*We-Ot*ne+Lt*ie)*we,C[8]=(ut*ke-St*Xe+Et*Fe)*we,C[9]=(K*Xe-X*ke-it*Fe)*we,C[10]=(Yt*se-zt*ne+Qt*ue)*we,C[11]=(wt*ne-bt*se-Lt*ue)*we,C[12]=(St*$e-ut*Ge-Ct*Fe)*we,C[13]=(X*Ge-K*$e+q*Fe)*we,C[14]=(zt*ie-Yt*ae-Wt*ue)*we,C[15]=(bt*ae-wt*ie+Ot*ue)*we,C):null;}function y(C,L){var X=L[0],K=L[1],q=L[2],it=L[3],ut=L[4],St=L[5],Ct=L[6],Et=L[7],bt=L[8],wt=L[9],Ot=L[10],Lt=L[11],Yt=L[12],zt=L[13],Wt=L[14],Qt=L[15];return C[0]=St*(Ot*Qt-Lt*Wt)-wt*(Ct*Qt-Et*Wt)+zt*(Ct*Lt-Et*Ot),C[1]=-(K*(Ot*Qt-Lt*Wt)-wt*(q*Qt-it*Wt)+zt*(q*Lt-it*Ot)),C[2]=K*(Ct*Qt-Et*Wt)-St*(q*Qt-it*Wt)+zt*(q*Et-it*Ct),C[3]=-(K*(Ct*Lt-Et*Ot)-St*(q*Lt-it*Ot)+wt*(q*Et-it*Ct)),C[4]=-(ut*(Ot*Qt-Lt*Wt)-bt*(Ct*Qt-Et*Wt)+Yt*(Ct*Lt-Et*Ot)),C[5]=X*(Ot*Qt-Lt*Wt)-bt*(q*Qt-it*Wt)+Yt*(q*Lt-it*Ot),C[6]=-(X*(Ct*Qt-Et*Wt)-ut*(q*Qt-it*Wt)+Yt*(q*Et-it*Ct)),C[7]=X*(Ct*Lt-Et*Ot)-ut*(q*Lt-it*Ot)+bt*(q*Et-it*Ct),C[8]=ut*(wt*Qt-Lt*zt)-bt*(St*Qt-Et*zt)+Yt*(St*Lt-Et*wt),C[9]=-(X*(wt*Qt-Lt*zt)-bt*(K*Qt-it*zt)+Yt*(K*Lt-it*wt)),C[10]=X*(St*Qt-Et*zt)-ut*(K*Qt-it*zt)+Yt*(K*Et-it*St),C[11]=-(X*(St*Lt-Et*wt)-ut*(K*Lt-it*wt)+bt*(K*Et-it*St)),C[12]=-(ut*(wt*Wt-Ot*zt)-bt*(St*Wt-Ct*zt)+Yt*(St*Ot-Ct*wt)),C[13]=X*(wt*Wt-Ot*zt)-bt*(K*Wt-q*zt)+Yt*(K*Ot-q*wt),C[14]=-(X*(St*Wt-Ct*zt)-ut*(K*Wt-q*zt)+Yt*(K*Ct-q*St)),C[15]=X*(St*Ot-Ct*wt)-ut*(K*Ot-q*wt)+bt*(K*Ct-q*St),C;}function T(C){var L=C[0],X=C[1],K=C[2],q=C[3],it=C[4],ut=C[5],St=C[6],Ct=C[7],Et=C[8],bt=C[9],wt=C[10],Ot=C[11],Lt=C[12],Yt=C[13],zt=C[14],Wt=C[15],Qt=L*ut-X*it,ue=L*St-K*it,ie=L*Ct-q*it,ne=X*St-K*ut,ae=X*Ct-q*ut,se=K*Ct-q*St,We=Et*Yt-bt*Lt,Fe=Et*zt-wt*Lt,$e=Et*Wt-Ot*Lt,Xe=bt*zt-wt*Yt,Ge=bt*Wt-Ot*Yt,ke=wt*Wt-Ot*zt;return Qt*ke-ue*Ge+ie*Xe+ne*$e-ae*Fe+se*We;}function O(C,L,X){var K=L[0],q=L[1],it=L[2],ut=L[3],St=L[4],Ct=L[5],Et=L[6],bt=L[7],wt=L[8],Ot=L[9],Lt=L[10],Yt=L[11],zt=L[12],Wt=L[13],Qt=L[14],ue=L[15],ie=X[0],ne=X[1],ae=X[2],se=X[3];return C[0]=ie*K+ne*St+ae*wt+se*zt,C[1]=ie*q+ne*Ct+ae*Ot+se*Wt,C[2]=ie*it+ne*Et+ae*Lt+se*Qt,C[3]=ie*ut+ne*bt+ae*Yt+se*ue,ie=X[4],ne=X[5],ae=X[6],se=X[7],C[4]=ie*K+ne*St+ae*wt+se*zt,C[5]=ie*q+ne*Ct+ae*Ot+se*Wt,C[6]=ie*it+ne*Et+ae*Lt+se*Qt,C[7]=ie*ut+ne*bt+ae*Yt+se*ue,ie=X[8],ne=X[9],ae=X[10],se=X[11],C[8]=ie*K+ne*St+ae*wt+se*zt,C[9]=ie*q+ne*Ct+ae*Ot+se*Wt,C[10]=ie*it+ne*Et+ae*Lt+se*Qt,C[11]=ie*ut+ne*bt+ae*Yt+se*ue,ie=X[12],ne=X[13],ae=X[14],se=X[15],C[12]=ie*K+ne*St+ae*wt+se*zt,C[13]=ie*q+ne*Ct+ae*Ot+se*Wt,C[14]=ie*it+ne*Et+ae*Lt+se*Qt,C[15]=ie*ut+ne*bt+ae*Yt+se*ue,C;}function I(C,L,X){var K=X[0],q=X[1],it=X[2],ut,St,Ct,Et,bt,wt,Ot,Lt,Yt,zt,Wt,Qt;return L===C?(C[12]=L[0]*K+L[4]*q+L[8]*it+L[12],C[13]=L[1]*K+L[5]*q+L[9]*it+L[13],C[14]=L[2]*K+L[6]*q+L[10]*it+L[14],C[15]=L[3]*K+L[7]*q+L[11]*it+L[15]):(ut=L[0],St=L[1],Ct=L[2],Et=L[3],bt=L[4],wt=L[5],Ot=L[6],Lt=L[7],Yt=L[8],zt=L[9],Wt=L[10],Qt=L[11],C[0]=ut,C[1]=St,C[2]=Ct,C[3]=Et,C[4]=bt,C[5]=wt,C[6]=Ot,C[7]=Lt,C[8]=Yt,C[9]=zt,C[10]=Wt,C[11]=Qt,C[12]=ut*K+bt*q+Yt*it+L[12],C[13]=St*K+wt*q+zt*it+L[13],C[14]=Ct*K+Ot*q+Wt*it+L[14],C[15]=Et*K+Lt*q+Qt*it+L[15]),C;}function P(C,L,X){var K=X[0],q=X[1],it=X[2];return C[0]=L[0]*K,C[1]=L[1]*K,C[2]=L[2]*K,C[3]=L[3]*K,C[4]=L[4]*q,C[5]=L[5]*q,C[6]=L[6]*q,C[7]=L[7]*q,C[8]=L[8]*it,C[9]=L[9]*it,C[10]=L[10]*it,C[11]=L[11]*it,C[12]=L[12],C[13]=L[13],C[14]=L[14],C[15]=L[15],C;}function w(C,L,X,K){var q=K[0],it=K[1],ut=K[2],St=Math.hypot(q,it,ut),Ct,Et,bt,wt,Ot,Lt,Yt,zt,Wt,Qt,ue,ie,ne,ae,se,We,Fe,$e,Xe,Ge,ke,Je,we,ur;return St<r.EPSILON?null:(St=1/St,q*=St,it*=St,ut*=St,Ct=Math.sin(X),Et=Math.cos(X),bt=1-Et,wt=L[0],Ot=L[1],Lt=L[2],Yt=L[3],zt=L[4],Wt=L[5],Qt=L[6],ue=L[7],ie=L[8],ne=L[9],ae=L[10],se=L[11],We=q*q*bt+Et,Fe=it*q*bt+ut*Ct,$e=ut*q*bt-it*Ct,Xe=q*it*bt-ut*Ct,Ge=it*it*bt+Et,ke=ut*it*bt+q*Ct,Je=q*ut*bt+it*Ct,we=it*ut*bt-q*Ct,ur=ut*ut*bt+Et,C[0]=wt*We+zt*Fe+ie*$e,C[1]=Ot*We+Wt*Fe+ne*$e,C[2]=Lt*We+Qt*Fe+ae*$e,C[3]=Yt*We+ue*Fe+se*$e,C[4]=wt*Xe+zt*Ge+ie*ke,C[5]=Ot*Xe+Wt*Ge+ne*ke,C[6]=Lt*Xe+Qt*Ge+ae*ke,C[7]=Yt*Xe+ue*Ge+se*ke,C[8]=wt*Je+zt*we+ie*ur,C[9]=Ot*Je+Wt*we+ne*ur,C[10]=Lt*Je+Qt*we+ae*ur,C[11]=Yt*Je+ue*we+se*ur,L!==C&&(C[12]=L[12],C[13]=L[13],C[14]=L[14],C[15]=L[15]),C);}function d(C,L,X){var K=Math.sin(X),q=Math.cos(X),it=L[4],ut=L[5],St=L[6],Ct=L[7],Et=L[8],bt=L[9],wt=L[10],Ot=L[11];return L!==C&&(C[0]=L[0],C[1]=L[1],C[2]=L[2],C[3]=L[3],C[12]=L[12],C[13]=L[13],C[14]=L[14],C[15]=L[15]),C[4]=it*q+Et*K,C[5]=ut*q+bt*K,C[6]=St*q+wt*K,C[7]=Ct*q+Ot*K,C[8]=Et*q-it*K,C[9]=bt*q-ut*K,C[10]=wt*q-St*K,C[11]=Ot*q-Ct*K,C;}function m(C,L,X){var K=Math.sin(X),q=Math.cos(X),it=L[0],ut=L[1],St=L[2],Ct=L[3],Et=L[8],bt=L[9],wt=L[10],Ot=L[11];return L!==C&&(C[4]=L[4],C[5]=L[5],C[6]=L[6],C[7]=L[7],C[12]=L[12],C[13]=L[13],C[14]=L[14],C[15]=L[15]),C[0]=it*q-Et*K,C[1]=ut*q-bt*K,C[2]=St*q-wt*K,C[3]=Ct*q-Ot*K,C[8]=it*K+Et*q,C[9]=ut*K+bt*q,C[10]=St*K+wt*q,C[11]=Ct*K+Ot*q,C;}function p(C,L,X){var K=Math.sin(X),q=Math.cos(X),it=L[0],ut=L[1],St=L[2],Ct=L[3],Et=L[4],bt=L[5],wt=L[6],Ot=L[7];return L!==C&&(C[8]=L[8],C[9]=L[9],C[10]=L[10],C[11]=L[11],C[12]=L[12],C[13]=L[13],C[14]=L[14],C[15]=L[15]),C[0]=it*q+Et*K,C[1]=ut*q+bt*K,C[2]=St*q+wt*K,C[3]=Ct*q+Ot*K,C[4]=Et*q-it*K,C[5]=bt*q-ut*K,C[6]=wt*q-St*K,C[7]=Ot*q-Ct*K,C;}function S(C,L){return C[0]=1,C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=1,C[6]=0,C[7]=0,C[8]=0,C[9]=0,C[10]=1,C[11]=0,C[12]=L[0],C[13]=L[1],C[14]=L[2],C[15]=1,C;}function E(C,L){return C[0]=L[0],C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=L[1],C[6]=0,C[7]=0,C[8]=0,C[9]=0,C[10]=L[2],C[11]=0,C[12]=0,C[13]=0,C[14]=0,C[15]=1,C;}function R(C,L,X){var K=X[0],q=X[1],it=X[2],ut=Math.hypot(K,q,it),St,Ct,Et;return ut<r.EPSILON?null:(ut=1/ut,K*=ut,q*=ut,it*=ut,St=Math.sin(L),Ct=Math.cos(L),Et=1-Ct,C[0]=K*K*Et+Ct,C[1]=q*K*Et+it*St,C[2]=it*K*Et-q*St,C[3]=0,C[4]=K*q*Et-it*St,C[5]=q*q*Et+Ct,C[6]=it*q*Et+K*St,C[7]=0,C[8]=K*it*Et+q*St,C[9]=q*it*Et-K*St,C[10]=it*it*Et+Ct,C[11]=0,C[12]=0,C[13]=0,C[14]=0,C[15]=1,C);}function D(C,L){var X=Math.sin(L),K=Math.cos(L);return C[0]=1,C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=K,C[6]=X,C[7]=0,C[8]=0,C[9]=-X,C[10]=K,C[11]=0,C[12]=0,C[13]=0,C[14]=0,C[15]=1,C;}function U(C,L){var X=Math.sin(L),K=Math.cos(L);return C[0]=K,C[1]=0,C[2]=-X,C[3]=0,C[4]=0,C[5]=1,C[6]=0,C[7]=0,C[8]=X,C[9]=0,C[10]=K,C[11]=0,C[12]=0,C[13]=0,C[14]=0,C[15]=1,C;}function M(C,L){var X=Math.sin(L),K=Math.cos(L);return C[0]=K,C[1]=X,C[2]=0,C[3]=0,C[4]=-X,C[5]=K,C[6]=0,C[7]=0,C[8]=0,C[9]=0,C[10]=1,C[11]=0,C[12]=0,C[13]=0,C[14]=0,C[15]=1,C;}function W(C,L,X){var K=L[0],q=L[1],it=L[2],ut=L[3],St=K+K,Ct=q+q,Et=it+it,bt=K*St,wt=K*Ct,Ot=K*Et,Lt=q*Ct,Yt=q*Et,zt=it*Et,Wt=ut*St,Qt=ut*Ct,ue=ut*Et;return C[0]=1-(Lt+zt),C[1]=wt+ue,C[2]=Ot-Qt,C[3]=0,C[4]=wt-ue,C[5]=1-(bt+zt),C[6]=Yt+Wt,C[7]=0,C[8]=Ot+Qt,C[9]=Yt-Wt,C[10]=1-(bt+Lt),C[11]=0,C[12]=X[0],C[13]=X[1],C[14]=X[2],C[15]=1,C;}function $(C,L){var X=new r.ARRAY_TYPE(3),K=-L[0],q=-L[1],it=-L[2],ut=L[3],St=L[4],Ct=L[5],Et=L[6],bt=L[7],wt=K*K+q*q+it*it+ut*ut;return wt>0?(X[0]=(St*ut+bt*K+Ct*it-Et*q)*2/wt,X[1]=(Ct*ut+bt*q+Et*K-St*it)*2/wt,X[2]=(Et*ut+bt*it+St*q-Ct*K)*2/wt):(X[0]=(St*ut+bt*K+Ct*it-Et*q)*2,X[1]=(Ct*ut+bt*q+Et*K-St*it)*2,X[2]=(Et*ut+bt*it+St*q-Ct*K)*2),W(C,L,X),C;}function B(C,L){return C[0]=L[12],C[1]=L[13],C[2]=L[14],C;}function N(C,L){var X=L[0],K=L[1],q=L[2],it=L[4],ut=L[5],St=L[6],Ct=L[8],Et=L[9],bt=L[10];return C[0]=Math.hypot(X,K,q),C[1]=Math.hypot(it,ut,St),C[2]=Math.hypot(Ct,Et,bt),C;}function z(C,L){var X=new r.ARRAY_TYPE(3);N(X,L);var K=1/X[0],q=1/X[1],it=1/X[2],ut=L[0]*K,St=L[1]*q,Ct=L[2]*it,Et=L[4]*K,bt=L[5]*q,wt=L[6]*it,Ot=L[8]*K,Lt=L[9]*q,Yt=L[10]*it,zt=ut+bt+Yt,Wt=0;return zt>0?(Wt=Math.sqrt(zt+1)*2,C[3]=0.25*Wt,C[0]=(wt-Lt)/Wt,C[1]=(Ot-Ct)/Wt,C[2]=(St-Et)/Wt):ut>bt&&ut>Yt?(Wt=Math.sqrt(1+ut-bt-Yt)*2,C[3]=(wt-Lt)/Wt,C[0]=0.25*Wt,C[1]=(St+Et)/Wt,C[2]=(Ot+Ct)/Wt):bt>Yt?(Wt=Math.sqrt(1+bt-ut-Yt)*2,C[3]=(Ot-Ct)/Wt,C[0]=(St+Et)/Wt,C[1]=0.25*Wt,C[2]=(wt+Lt)/Wt):(Wt=Math.sqrt(1+Yt-ut-bt)*2,C[3]=(St-Et)/Wt,C[0]=(Ot+Ct)/Wt,C[1]=(wt+Lt)/Wt,C[2]=0.25*Wt),C;}function J(C,L,X,K){var q=L[0],it=L[1],ut=L[2],St=L[3],Ct=q+q,Et=it+it,bt=ut+ut,wt=q*Ct,Ot=q*Et,Lt=q*bt,Yt=it*Et,zt=it*bt,Wt=ut*bt,Qt=St*Ct,ue=St*Et,ie=St*bt,ne=K[0],ae=K[1],se=K[2];return C[0]=(1-(Yt+Wt))*ne,C[1]=(Ot+ie)*ne,C[2]=(Lt-ue)*ne,C[3]=0,C[4]=(Ot-ie)*ae,C[5]=(1-(wt+Wt))*ae,C[6]=(zt+Qt)*ae,C[7]=0,C[8]=(Lt+ue)*se,C[9]=(zt-Qt)*se,C[10]=(1-(wt+Yt))*se,C[11]=0,C[12]=X[0],C[13]=X[1],C[14]=X[2],C[15]=1,C;}function et(C,L,X,K,q){var it=L[0],ut=L[1],St=L[2],Ct=L[3],Et=it+it,bt=ut+ut,wt=St+St,Ot=it*Et,Lt=it*bt,Yt=it*wt,zt=ut*bt,Wt=ut*wt,Qt=St*wt,ue=Ct*Et,ie=Ct*bt,ne=Ct*wt,ae=K[0],se=K[1],We=K[2],Fe=q[0],$e=q[1],Xe=q[2],Ge=(1-(zt+Qt))*ae,ke=(Lt+ne)*ae,Je=(Yt-ie)*ae,we=(Lt-ne)*se,ur=(1-(Ot+Qt))*se,rn=(Wt+ue)*se,Kr=(Yt+ie)*We,Hn=(Wt-ue)*We,Vn=(1-(Ot+zt))*We;return C[0]=Ge,C[1]=ke,C[2]=Je,C[3]=0,C[4]=we,C[5]=ur,C[6]=rn,C[7]=0,C[8]=Kr,C[9]=Hn,C[10]=Vn,C[11]=0,C[12]=X[0]+Fe-(Ge*Fe+we*$e+Kr*Xe),C[13]=X[1]+$e-(ke*Fe+ur*$e+Hn*Xe),C[14]=X[2]+Xe-(Je*Fe+rn*$e+Vn*Xe),C[15]=1,C;}function at(C,L){var X=L[0],K=L[1],q=L[2],it=L[3],ut=X+X,St=K+K,Ct=q+q,Et=X*ut,bt=K*ut,wt=K*St,Ot=q*ut,Lt=q*St,Yt=q*Ct,zt=it*ut,Wt=it*St,Qt=it*Ct;return C[0]=1-wt-Yt,C[1]=bt+Qt,C[2]=Ot-Wt,C[3]=0,C[4]=bt-Qt,C[5]=1-Et-Yt,C[6]=Lt+zt,C[7]=0,C[8]=Ot+Wt,C[9]=Lt-zt,C[10]=1-Et-wt,C[11]=0,C[12]=0,C[13]=0,C[14]=0,C[15]=1,C;}function ct(C,L,X,K,q,it,ut){var St=1/(X-L),Ct=1/(q-K),Et=1/(it-ut);return C[0]=it*2*St,C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=it*2*Ct,C[6]=0,C[7]=0,C[8]=(X+L)*St,C[9]=(q+K)*Ct,C[10]=(ut+it)*Et,C[11]=-1,C[12]=0,C[13]=0,C[14]=ut*it*2*Et,C[15]=0,C;}function V(C,L,X,K,q){var it=1/Math.tan(L/2),ut;return C[0]=it/X,C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=it,C[6]=0,C[7]=0,C[8]=0,C[9]=0,C[11]=-1,C[12]=0,C[13]=0,C[15]=0,q!=null&&q!==1/0?(ut=1/(K-q),C[10]=(q+K)*ut,C[14]=2*q*K*ut):(C[10]=-1,C[14]=-2*K),C;}function Q(C,L,X,K){var q=Math.tan(L.upDegrees*Math.PI/180),it=Math.tan(L.downDegrees*Math.PI/180),ut=Math.tan(L.leftDegrees*Math.PI/180),St=Math.tan(L.rightDegrees*Math.PI/180),Ct=2/(ut+St),Et=2/(q+it);return C[0]=Ct,C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=Et,C[6]=0,C[7]=0,C[8]=-((ut-St)*Ct*0.5),C[9]=(q-it)*Et*0.5,C[10]=K/(X-K),C[11]=-1,C[12]=0,C[13]=0,C[14]=K*X/(X-K),C[15]=0,C;}function ft(C,L,X,K,q,it,ut){var St=1/(L-X),Ct=1/(K-q),Et=1/(it-ut);return C[0]=-2*St,C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=-2*Ct,C[6]=0,C[7]=0,C[8]=0,C[9]=0,C[10]=2*Et,C[11]=0,C[12]=(L+X)*St,C[13]=(q+K)*Ct,C[14]=(ut+it)*Et,C[15]=1,C;}function mt(C,L,X,K){var q,it,ut,St,Ct,Et,bt,wt,Ot,Lt,Yt=L[0],zt=L[1],Wt=L[2],Qt=K[0],ue=K[1],ie=K[2],ne=X[0],ae=X[1],se=X[2];return Math.abs(Yt-ne)<r.EPSILON&&Math.abs(zt-ae)<r.EPSILON&&Math.abs(Wt-se)<r.EPSILON?u(C):(bt=Yt-ne,wt=zt-ae,Ot=Wt-se,Lt=1/Math.hypot(bt,wt,Ot),bt*=Lt,wt*=Lt,Ot*=Lt,q=ue*Ot-ie*wt,it=ie*bt-Qt*Ot,ut=Qt*wt-ue*bt,Lt=Math.hypot(q,it,ut),Lt?(Lt=1/Lt,q*=Lt,it*=Lt,ut*=Lt):(q=0,it=0,ut=0),St=wt*ut-Ot*it,Ct=Ot*q-bt*ut,Et=bt*it-wt*q,Lt=Math.hypot(St,Ct,Et),Lt?(Lt=1/Lt,St*=Lt,Ct*=Lt,Et*=Lt):(St=0,Ct=0,Et=0),C[0]=q,C[1]=St,C[2]=bt,C[3]=0,C[4]=it,C[5]=Ct,C[6]=wt,C[7]=0,C[8]=ut,C[9]=Et,C[10]=Ot,C[11]=0,C[12]=-(q*Yt+it*zt+ut*Wt),C[13]=-(St*Yt+Ct*zt+Et*Wt),C[14]=-(bt*Yt+wt*zt+Ot*Wt),C[15]=1,C);}function yt(C,L,X,K){var q=L[0],it=L[1],ut=L[2],St=K[0],Ct=K[1],Et=K[2],bt=q-X[0],wt=it-X[1],Ot=ut-X[2],Lt=bt*bt+wt*wt+Ot*Ot;Lt>0&&(Lt=1/Math.sqrt(Lt),bt*=Lt,wt*=Lt,Ot*=Lt);var Yt=Ct*Ot-Et*wt,zt=Et*bt-St*Ot,Wt=St*wt-Ct*bt;return Lt=Yt*Yt+zt*zt+Wt*Wt,Lt>0&&(Lt=1/Math.sqrt(Lt),Yt*=Lt,zt*=Lt,Wt*=Lt),C[0]=Yt,C[1]=zt,C[2]=Wt,C[3]=0,C[4]=wt*Wt-Ot*zt,C[5]=Ot*Yt-bt*Wt,C[6]=bt*zt-wt*Yt,C[7]=0,C[8]=bt,C[9]=wt,C[10]=Ot,C[11]=0,C[12]=q,C[13]=it,C[14]=ut,C[15]=1,C;}function At(C){return"mat4("+C[0]+", "+C[1]+", "+C[2]+", "+C[3]+", "+C[4]+", "+C[5]+", "+C[6]+", "+C[7]+", "+C[8]+", "+C[9]+", "+C[10]+", "+C[11]+", "+C[12]+", "+C[13]+", "+C[14]+", "+C[15]+")";}function ht(C){return Math.hypot(C[0],C[1],C[2],C[3],C[4],C[5],C[6],C[7],C[8],C[9],C[10],C[11],C[12],C[13],C[14],C[15]);}function Nt(C,L,X){return C[0]=L[0]+X[0],C[1]=L[1]+X[1],C[2]=L[2]+X[2],C[3]=L[3]+X[3],C[4]=L[4]+X[4],C[5]=L[5]+X[5],C[6]=L[6]+X[6],C[7]=L[7]+X[7],C[8]=L[8]+X[8],C[9]=L[9]+X[9],C[10]=L[10]+X[10],C[11]=L[11]+X[11],C[12]=L[12]+X[12],C[13]=L[13]+X[13],C[14]=L[14]+X[14],C[15]=L[15]+X[15],C;}function Bt(C,L,X){return C[0]=L[0]-X[0],C[1]=L[1]-X[1],C[2]=L[2]-X[2],C[3]=L[3]-X[3],C[4]=L[4]-X[4],C[5]=L[5]-X[5],C[6]=L[6]-X[6],C[7]=L[7]-X[7],C[8]=L[8]-X[8],C[9]=L[9]-X[9],C[10]=L[10]-X[10],C[11]=L[11]-X[11],C[12]=L[12]-X[12],C[13]=L[13]-X[13],C[14]=L[14]-X[14],C[15]=L[15]-X[15],C;}function G(C,L,X){return C[0]=L[0]*X,C[1]=L[1]*X,C[2]=L[2]*X,C[3]=L[3]*X,C[4]=L[4]*X,C[5]=L[5]*X,C[6]=L[6]*X,C[7]=L[7]*X,C[8]=L[8]*X,C[9]=L[9]*X,C[10]=L[10]*X,C[11]=L[11]*X,C[12]=L[12]*X,C[13]=L[13]*X,C[14]=L[14]*X,C[15]=L[15]*X,C;}function k(C,L,X,K){return C[0]=L[0]+X[0]*K,C[1]=L[1]+X[1]*K,C[2]=L[2]+X[2]*K,C[3]=L[3]+X[3]*K,C[4]=L[4]+X[4]*K,C[5]=L[5]+X[5]*K,C[6]=L[6]+X[6]*K,C[7]=L[7]+X[7]*K,C[8]=L[8]+X[8]*K,C[9]=L[9]+X[9]*K,C[10]=L[10]+X[10]*K,C[11]=L[11]+X[11]*K,C[12]=L[12]+X[12]*K,C[13]=L[13]+X[13]*K,C[14]=L[14]+X[14]*K,C[15]=L[15]+X[15]*K,C;}function rt(C,L){return C[0]===L[0]&&C[1]===L[1]&&C[2]===L[2]&&C[3]===L[3]&&C[4]===L[4]&&C[5]===L[5]&&C[6]===L[6]&&C[7]===L[7]&&C[8]===L[8]&&C[9]===L[9]&&C[10]===L[10]&&C[11]===L[11]&&C[12]===L[12]&&C[13]===L[13]&&C[14]===L[14]&&C[15]===L[15];}function nt(C,L){var X=C[0],K=C[1],q=C[2],it=C[3],ut=C[4],St=C[5],Ct=C[6],Et=C[7],bt=C[8],wt=C[9],Ot=C[10],Lt=C[11],Yt=C[12],zt=C[13],Wt=C[14],Qt=C[15],ue=L[0],ie=L[1],ne=L[2],ae=L[3],se=L[4],We=L[5],Fe=L[6],$e=L[7],Xe=L[8],Ge=L[9],ke=L[10],Je=L[11],we=L[12],ur=L[13],rn=L[14],Kr=L[15];return Math.abs(X-ue)<=r.EPSILON*Math.max(1,Math.abs(X),Math.abs(ue))&&Math.abs(K-ie)<=r.EPSILON*Math.max(1,Math.abs(K),Math.abs(ie))&&Math.abs(q-ne)<=r.EPSILON*Math.max(1,Math.abs(q),Math.abs(ne))&&Math.abs(it-ae)<=r.EPSILON*Math.max(1,Math.abs(it),Math.abs(ae))&&Math.abs(ut-se)<=r.EPSILON*Math.max(1,Math.abs(ut),Math.abs(se))&&Math.abs(St-We)<=r.EPSILON*Math.max(1,Math.abs(St),Math.abs(We))&&Math.abs(Ct-Fe)<=r.EPSILON*Math.max(1,Math.abs(Ct),Math.abs(Fe))&&Math.abs(Et-$e)<=r.EPSILON*Math.max(1,Math.abs(Et),Math.abs($e))&&Math.abs(bt-Xe)<=r.EPSILON*Math.max(1,Math.abs(bt),Math.abs(Xe))&&Math.abs(wt-Ge)<=r.EPSILON*Math.max(1,Math.abs(wt),Math.abs(Ge))&&Math.abs(Ot-ke)<=r.EPSILON*Math.max(1,Math.abs(Ot),Math.abs(ke))&&Math.abs(Lt-Je)<=r.EPSILON*Math.max(1,Math.abs(Lt),Math.abs(Je))&&Math.abs(Yt-we)<=r.EPSILON*Math.max(1,Math.abs(Yt),Math.abs(we))&&Math.abs(zt-ur)<=r.EPSILON*Math.max(1,Math.abs(zt),Math.abs(ur))&&Math.abs(Wt-rn)<=r.EPSILON*Math.max(1,Math.abs(Wt),Math.abs(rn))&&Math.abs(Qt-Kr)<=r.EPSILON*Math.max(1,Math.abs(Qt),Math.abs(Kr));}var Y=O,Z=Bt;},/* 7 *//***/function(i,e,t){t.r(e),t.d(e,"create",function(){return l;}),t.d(e,"identity",function(){return f;}),t.d(e,"setAxisAngle",function(){return u;}),t.d(e,"getAxisAngle",function(){return v;}),t.d(e,"getAngle",function(){return h;}),t.d(e,"multiply",function(){return y;}),t.d(e,"rotateX",function(){return T;}),t.d(e,"rotateY",function(){return O;}),t.d(e,"rotateZ",function(){return I;}),t.d(e,"calculateW",function(){return P;}),t.d(e,"exp",function(){return w;}),t.d(e,"ln",function(){return d;}),t.d(e,"pow",function(){return m;}),t.d(e,"slerp",function(){return p;}),t.d(e,"random",function(){return S;}),t.d(e,"invert",function(){return E;}),t.d(e,"conjugate",function(){return R;}),t.d(e,"fromMat3",function(){return D;}),t.d(e,"fromEuler",function(){return U;}),t.d(e,"str",function(){return M;}),t.d(e,"clone",function(){return W;}),t.d(e,"fromValues",function(){return $;}),t.d(e,"copy",function(){return B;}),t.d(e,"set",function(){return N;}),t.d(e,"add",function(){return z;}),t.d(e,"mul",function(){return J;}),t.d(e,"scale",function(){return et;}),t.d(e,"dot",function(){return at;}),t.d(e,"lerp",function(){return ct;}),t.d(e,"length",function(){return V;}),t.d(e,"len",function(){return Q;}),t.d(e,"squaredLength",function(){return ft;}),t.d(e,"sqrLen",function(){return mt;}),t.d(e,"normalize",function(){return yt;}),t.d(e,"exactEquals",function(){return At;}),t.d(e,"equals",function(){return ht;}),t.d(e,"rotationTo",function(){return Nt;}),t.d(e,"sqlerp",function(){return Bt;}),t.d(e,"setAxes",function(){return G;});var r=t(2),n=t(5),s=t(8),c=t(9);function l(){var k=new r.ARRAY_TYPE(4);return r.ARRAY_TYPE!=Float32Array&&(k[0]=0,k[1]=0,k[2]=0),k[3]=1,k;}function f(k){return k[0]=0,k[1]=0,k[2]=0,k[3]=1,k;}function u(k,rt,nt){nt=nt*0.5;var Y=Math.sin(nt);return k[0]=Y*rt[0],k[1]=Y*rt[1],k[2]=Y*rt[2],k[3]=Math.cos(nt),k;}function v(k,rt){var nt=Math.acos(rt[3])*2,Y=Math.sin(nt/2);return Y>r.EPSILON?(k[0]=rt[0]/Y,k[1]=rt[1]/Y,k[2]=rt[2]/Y):(k[0]=1,k[1]=0,k[2]=0),nt;}function h(k,rt){var nt=at(k,rt);return Math.acos(2*nt*nt-1);}function y(k,rt,nt){var Y=rt[0],Z=rt[1],C=rt[2],L=rt[3],X=nt[0],K=nt[1],q=nt[2],it=nt[3];return k[0]=Y*it+L*X+Z*q-C*K,k[1]=Z*it+L*K+C*X-Y*q,k[2]=C*it+L*q+Y*K-Z*X,k[3]=L*it-Y*X-Z*K-C*q,k;}function T(k,rt,nt){nt*=0.5;var Y=rt[0],Z=rt[1],C=rt[2],L=rt[3],X=Math.sin(nt),K=Math.cos(nt);return k[0]=Y*K+L*X,k[1]=Z*K+C*X,k[2]=C*K-Z*X,k[3]=L*K-Y*X,k;}function O(k,rt,nt){nt*=0.5;var Y=rt[0],Z=rt[1],C=rt[2],L=rt[3],X=Math.sin(nt),K=Math.cos(nt);return k[0]=Y*K-C*X,k[1]=Z*K+L*X,k[2]=C*K+Y*X,k[3]=L*K-Z*X,k;}function I(k,rt,nt){nt*=0.5;var Y=rt[0],Z=rt[1],C=rt[2],L=rt[3],X=Math.sin(nt),K=Math.cos(nt);return k[0]=Y*K+Z*X,k[1]=Z*K-Y*X,k[2]=C*K+L*X,k[3]=L*K-C*X,k;}function P(k,rt){var nt=rt[0],Y=rt[1],Z=rt[2];return k[0]=nt,k[1]=Y,k[2]=Z,k[3]=Math.sqrt(Math.abs(1-nt*nt-Y*Y-Z*Z)),k;}function w(k,rt){var nt=rt[0],Y=rt[1],Z=rt[2],C=rt[3],L=Math.sqrt(nt*nt+Y*Y+Z*Z),X=Math.exp(C),K=L>0?X*Math.sin(L)/L:0;return k[0]=nt*K,k[1]=Y*K,k[2]=Z*K,k[3]=X*Math.cos(L),k;}function d(k,rt){var nt=rt[0],Y=rt[1],Z=rt[2],C=rt[3],L=Math.sqrt(nt*nt+Y*Y+Z*Z),X=L>0?Math.atan2(L,C)/L:0;return k[0]=nt*X,k[1]=Y*X,k[2]=Z*X,k[3]=0.5*Math.log(nt*nt+Y*Y+Z*Z+C*C),k;}function m(k,rt,nt){return d(k,rt),et(k,k,nt),w(k,k),k;}function p(k,rt,nt,Y){var Z=rt[0],C=rt[1],L=rt[2],X=rt[3],K=nt[0],q=nt[1],it=nt[2],ut=nt[3],St,Ct,Et,bt,wt;return Ct=Z*K+C*q+L*it+X*ut,Ct<0&&(Ct=-Ct,K=-K,q=-q,it=-it,ut=-ut),1-Ct>r.EPSILON?(St=Math.acos(Ct),Et=Math.sin(St),bt=Math.sin((1-Y)*St)/Et,wt=Math.sin(Y*St)/Et):(bt=1-Y,wt=Y),k[0]=bt*Z+wt*K,k[1]=bt*C+wt*q,k[2]=bt*L+wt*it,k[3]=bt*X+wt*ut,k;}function S(k){var rt=r.RANDOM(),nt=r.RANDOM(),Y=r.RANDOM(),Z=Math.sqrt(1-rt),C=Math.sqrt(rt);return k[0]=Z*Math.sin(2*Math.PI*nt),k[1]=Z*Math.cos(2*Math.PI*nt),k[2]=C*Math.sin(2*Math.PI*Y),k[3]=C*Math.cos(2*Math.PI*Y),k;}function E(k,rt){var nt=rt[0],Y=rt[1],Z=rt[2],C=rt[3],L=nt*nt+Y*Y+Z*Z+C*C,X=L?1/L:0;return k[0]=-nt*X,k[1]=-Y*X,k[2]=-Z*X,k[3]=C*X,k;}function R(k,rt){return k[0]=-rt[0],k[1]=-rt[1],k[2]=-rt[2],k[3]=rt[3],k;}function D(k,rt){var nt=rt[0]+rt[4]+rt[8],Y;if(nt>0)Y=Math.sqrt(nt+1),k[3]=0.5*Y,Y=0.5/Y,k[0]=(rt[5]-rt[7])*Y,k[1]=(rt[6]-rt[2])*Y,k[2]=(rt[1]-rt[3])*Y;else{var Z=0;rt[4]>rt[0]&&(Z=1),rt[8]>rt[Z*3+Z]&&(Z=2);var C=(Z+1)%3,L=(Z+2)%3;Y=Math.sqrt(rt[Z*3+Z]-rt[C*3+C]-rt[L*3+L]+1),k[Z]=0.5*Y,Y=0.5/Y,k[3]=(rt[C*3+L]-rt[L*3+C])*Y,k[C]=(rt[C*3+Z]+rt[Z*3+C])*Y,k[L]=(rt[L*3+Z]+rt[Z*3+L])*Y;}return k;}function U(k,rt,nt,Y){var Z=0.5*Math.PI/180;rt*=Z,nt*=Z,Y*=Z;var C=Math.sin(rt),L=Math.cos(rt),X=Math.sin(nt),K=Math.cos(nt),q=Math.sin(Y),it=Math.cos(Y);return k[0]=C*K*it-L*X*q,k[1]=L*X*it+C*K*q,k[2]=L*K*q-C*X*it,k[3]=L*K*it+C*X*q,k;}function M(k){return"quat("+k[0]+", "+k[1]+", "+k[2]+", "+k[3]+")";}var W=c.clone,$=c.fromValues,B=c.copy,N=c.set,z=c.add,J=y,et=c.scale,at=c.dot,ct=c.lerp,V=c.length,Q=V,ft=c.squaredLength,mt=ft,yt=c.normalize,At=c.exactEquals,ht=c.equals,Nt=function(){var k=s.create(),rt=s.fromValues(1,0,0),nt=s.fromValues(0,1,0);return function(Y,Z,C){var L=s.dot(Z,C);return L<-0.999999?(s.cross(k,rt,Z),s.len(k)<1e-6&&s.cross(k,nt,Z),s.normalize(k,k),u(Y,k,Math.PI),Y):L>0.999999?(Y[0]=0,Y[1]=0,Y[2]=0,Y[3]=1,Y):(s.cross(k,Z,C),Y[0]=k[0],Y[1]=k[1],Y[2]=k[2],Y[3]=1+L,yt(Y,Y));};}(),Bt=function(){var k=l(),rt=l();return function(nt,Y,Z,C,L,X){return p(k,Y,L,X),p(rt,Z,C,X),p(nt,k,rt,2*X*(1-X)),nt;};}(),G=function(){var k=n.create();return function(rt,nt,Y,Z){return k[0]=Y[0],k[3]=Y[1],k[6]=Y[2],k[1]=Z[0],k[4]=Z[1],k[7]=Z[2],k[2]=-nt[0],k[5]=-nt[1],k[8]=-nt[2],yt(rt,D(rt,k));};}();},/* 8 *//***/function(i,e,t){t.r(e),t.d(e,"create",function(){return n;}),t.d(e,"clone",function(){return s;}),t.d(e,"length",function(){return c;}),t.d(e,"fromValues",function(){return l;}),t.d(e,"copy",function(){return f;}),t.d(e,"set",function(){return u;}),t.d(e,"add",function(){return v;}),t.d(e,"subtract",function(){return h;}),t.d(e,"multiply",function(){return y;}),t.d(e,"divide",function(){return T;}),t.d(e,"ceil",function(){return O;}),t.d(e,"floor",function(){return I;}),t.d(e,"min",function(){return P;}),t.d(e,"max",function(){return w;}),t.d(e,"round",function(){return d;}),t.d(e,"scale",function(){return m;}),t.d(e,"scaleAndAdd",function(){return p;}),t.d(e,"distance",function(){return S;}),t.d(e,"squaredDistance",function(){return E;}),t.d(e,"squaredLength",function(){return R;}),t.d(e,"negate",function(){return D;}),t.d(e,"inverse",function(){return U;}),t.d(e,"normalize",function(){return M;}),t.d(e,"dot",function(){return W;}),t.d(e,"cross",function(){return $;}),t.d(e,"lerp",function(){return B;}),t.d(e,"hermite",function(){return N;}),t.d(e,"bezier",function(){return z;}),t.d(e,"random",function(){return J;}),t.d(e,"transformMat4",function(){return et;}),t.d(e,"transformMat3",function(){return at;}),t.d(e,"transformQuat",function(){return ct;}),t.d(e,"rotateX",function(){return V;}),t.d(e,"rotateY",function(){return Q;}),t.d(e,"rotateZ",function(){return ft;}),t.d(e,"angle",function(){return mt;}),t.d(e,"zero",function(){return yt;}),t.d(e,"str",function(){return At;}),t.d(e,"exactEquals",function(){return ht;}),t.d(e,"equals",function(){return Nt;}),t.d(e,"sub",function(){return Bt;}),t.d(e,"mul",function(){return G;}),t.d(e,"div",function(){return k;}),t.d(e,"dist",function(){return rt;}),t.d(e,"sqrDist",function(){return nt;}),t.d(e,"len",function(){return Y;}),t.d(e,"sqrLen",function(){return Z;}),t.d(e,"forEach",function(){return C;});var r=t(2);function n(){var L=new r.ARRAY_TYPE(3);return r.ARRAY_TYPE!=Float32Array&&(L[0]=0,L[1]=0,L[2]=0),L;}function s(L){var X=new r.ARRAY_TYPE(3);return X[0]=L[0],X[1]=L[1],X[2]=L[2],X;}function c(L){var X=L[0],K=L[1],q=L[2];return Math.hypot(X,K,q);}function l(L,X,K){var q=new r.ARRAY_TYPE(3);return q[0]=L,q[1]=X,q[2]=K,q;}function f(L,X){return L[0]=X[0],L[1]=X[1],L[2]=X[2],L;}function u(L,X,K,q){return L[0]=X,L[1]=K,L[2]=q,L;}function v(L,X,K){return L[0]=X[0]+K[0],L[1]=X[1]+K[1],L[2]=X[2]+K[2],L;}function h(L,X,K){return L[0]=X[0]-K[0],L[1]=X[1]-K[1],L[2]=X[2]-K[2],L;}function y(L,X,K){return L[0]=X[0]*K[0],L[1]=X[1]*K[1],L[2]=X[2]*K[2],L;}function T(L,X,K){return L[0]=X[0]/K[0],L[1]=X[1]/K[1],L[2]=X[2]/K[2],L;}function O(L,X){return L[0]=Math.ceil(X[0]),L[1]=Math.ceil(X[1]),L[2]=Math.ceil(X[2]),L;}function I(L,X){return L[0]=Math.floor(X[0]),L[1]=Math.floor(X[1]),L[2]=Math.floor(X[2]),L;}function P(L,X,K){return L[0]=Math.min(X[0],K[0]),L[1]=Math.min(X[1],K[1]),L[2]=Math.min(X[2],K[2]),L;}function w(L,X,K){return L[0]=Math.max(X[0],K[0]),L[1]=Math.max(X[1],K[1]),L[2]=Math.max(X[2],K[2]),L;}function d(L,X){return L[0]=Math.round(X[0]),L[1]=Math.round(X[1]),L[2]=Math.round(X[2]),L;}function m(L,X,K){return L[0]=X[0]*K,L[1]=X[1]*K,L[2]=X[2]*K,L;}function p(L,X,K,q){return L[0]=X[0]+K[0]*q,L[1]=X[1]+K[1]*q,L[2]=X[2]+K[2]*q,L;}function S(L,X){var K=X[0]-L[0],q=X[1]-L[1],it=X[2]-L[2];return Math.hypot(K,q,it);}function E(L,X){var K=X[0]-L[0],q=X[1]-L[1],it=X[2]-L[2];return K*K+q*q+it*it;}function R(L){var X=L[0],K=L[1],q=L[2];return X*X+K*K+q*q;}function D(L,X){return L[0]=-X[0],L[1]=-X[1],L[2]=-X[2],L;}function U(L,X){return L[0]=1/X[0],L[1]=1/X[1],L[2]=1/X[2],L;}function M(L,X){var K=X[0],q=X[1],it=X[2],ut=K*K+q*q+it*it;return ut>0&&(ut=1/Math.sqrt(ut)),L[0]=X[0]*ut,L[1]=X[1]*ut,L[2]=X[2]*ut,L;}function W(L,X){return L[0]*X[0]+L[1]*X[1]+L[2]*X[2];}function $(L,X,K){var q=X[0],it=X[1],ut=X[2],St=K[0],Ct=K[1],Et=K[2];return L[0]=it*Et-ut*Ct,L[1]=ut*St-q*Et,L[2]=q*Ct-it*St,L;}function B(L,X,K,q){var it=X[0],ut=X[1],St=X[2];return L[0]=it+q*(K[0]-it),L[1]=ut+q*(K[1]-ut),L[2]=St+q*(K[2]-St),L;}function N(L,X,K,q,it,ut){var St=ut*ut,Ct=St*(2*ut-3)+1,Et=St*(ut-2)+ut,bt=St*(ut-1),wt=St*(3-2*ut);return L[0]=X[0]*Ct+K[0]*Et+q[0]*bt+it[0]*wt,L[1]=X[1]*Ct+K[1]*Et+q[1]*bt+it[1]*wt,L[2]=X[2]*Ct+K[2]*Et+q[2]*bt+it[2]*wt,L;}function z(L,X,K,q,it,ut){var St=1-ut,Ct=St*St,Et=ut*ut,bt=Ct*St,wt=3*ut*Ct,Ot=3*Et*St,Lt=Et*ut;return L[0]=X[0]*bt+K[0]*wt+q[0]*Ot+it[0]*Lt,L[1]=X[1]*bt+K[1]*wt+q[1]*Ot+it[1]*Lt,L[2]=X[2]*bt+K[2]*wt+q[2]*Ot+it[2]*Lt,L;}function J(L,X){X=X||1;var K=r.RANDOM()*2*Math.PI,q=r.RANDOM()*2-1,it=Math.sqrt(1-q*q)*X;return L[0]=Math.cos(K)*it,L[1]=Math.sin(K)*it,L[2]=q*X,L;}function et(L,X,K){var q=X[0],it=X[1],ut=X[2],St=K[3]*q+K[7]*it+K[11]*ut+K[15];return St=St||1,L[0]=(K[0]*q+K[4]*it+K[8]*ut+K[12])/St,L[1]=(K[1]*q+K[5]*it+K[9]*ut+K[13])/St,L[2]=(K[2]*q+K[6]*it+K[10]*ut+K[14])/St,L;}function at(L,X,K){var q=X[0],it=X[1],ut=X[2];return L[0]=q*K[0]+it*K[3]+ut*K[6],L[1]=q*K[1]+it*K[4]+ut*K[7],L[2]=q*K[2]+it*K[5]+ut*K[8],L;}function ct(L,X,K){var q=K[0],it=K[1],ut=K[2],St=K[3],Ct=X[0],Et=X[1],bt=X[2],wt=it*bt-ut*Et,Ot=ut*Ct-q*bt,Lt=q*Et-it*Ct,Yt=it*Lt-ut*Ot,zt=ut*wt-q*Lt,Wt=q*Ot-it*wt,Qt=St*2;return wt*=Qt,Ot*=Qt,Lt*=Qt,Yt*=2,zt*=2,Wt*=2,L[0]=Ct+wt+Yt,L[1]=Et+Ot+zt,L[2]=bt+Lt+Wt,L;}function V(L,X,K,q){var it=[],ut=[];return it[0]=X[0]-K[0],it[1]=X[1]-K[1],it[2]=X[2]-K[2],ut[0]=it[0],ut[1]=it[1]*Math.cos(q)-it[2]*Math.sin(q),ut[2]=it[1]*Math.sin(q)+it[2]*Math.cos(q),L[0]=ut[0]+K[0],L[1]=ut[1]+K[1],L[2]=ut[2]+K[2],L;}function Q(L,X,K,q){var it=[],ut=[];return it[0]=X[0]-K[0],it[1]=X[1]-K[1],it[2]=X[2]-K[2],ut[0]=it[2]*Math.sin(q)+it[0]*Math.cos(q),ut[1]=it[1],ut[2]=it[2]*Math.cos(q)-it[0]*Math.sin(q),L[0]=ut[0]+K[0],L[1]=ut[1]+K[1],L[2]=ut[2]+K[2],L;}function ft(L,X,K,q){var it=[],ut=[];return it[0]=X[0]-K[0],it[1]=X[1]-K[1],it[2]=X[2]-K[2],ut[0]=it[0]*Math.cos(q)-it[1]*Math.sin(q),ut[1]=it[0]*Math.sin(q)+it[1]*Math.cos(q),ut[2]=it[2],L[0]=ut[0]+K[0],L[1]=ut[1]+K[1],L[2]=ut[2]+K[2],L;}function mt(L,X){var K=L[0],q=L[1],it=L[2],ut=X[0],St=X[1],Ct=X[2],Et=Math.sqrt(K*K+q*q+it*it),bt=Math.sqrt(ut*ut+St*St+Ct*Ct),wt=Et*bt,Ot=wt&&W(L,X)/wt;return Math.acos(Math.min(Math.max(Ot,-1),1));}function yt(L){return L[0]=0,L[1]=0,L[2]=0,L;}function At(L){return"vec3("+L[0]+", "+L[1]+", "+L[2]+")";}function ht(L,X){return L[0]===X[0]&&L[1]===X[1]&&L[2]===X[2];}function Nt(L,X){var K=L[0],q=L[1],it=L[2],ut=X[0],St=X[1],Ct=X[2];return Math.abs(K-ut)<=r.EPSILON*Math.max(1,Math.abs(K),Math.abs(ut))&&Math.abs(q-St)<=r.EPSILON*Math.max(1,Math.abs(q),Math.abs(St))&&Math.abs(it-Ct)<=r.EPSILON*Math.max(1,Math.abs(it),Math.abs(Ct));}var Bt=h,G=y,k=T,rt=S,nt=E,Y=c,Z=R,C=function(){var L=n();return function(X,K,q,it,ut,St){var Ct,Et;for(K||(K=3),q||(q=0),it?Et=Math.min(it*K+q,X.length):Et=X.length,Ct=q;Ct<Et;Ct+=K)L[0]=X[Ct],L[1]=X[Ct+1],L[2]=X[Ct+2],ut(L,L,St),X[Ct]=L[0],X[Ct+1]=L[1],X[Ct+2]=L[2];return X;};}();},/* 9 *//***/function(i,e,t){t.r(e),t.d(e,"create",function(){return n;}),t.d(e,"clone",function(){return s;}),t.d(e,"fromValues",function(){return c;}),t.d(e,"copy",function(){return l;}),t.d(e,"set",function(){return f;}),t.d(e,"add",function(){return u;}),t.d(e,"subtract",function(){return v;}),t.d(e,"multiply",function(){return h;}),t.d(e,"divide",function(){return y;}),t.d(e,"ceil",function(){return T;}),t.d(e,"floor",function(){return O;}),t.d(e,"min",function(){return I;}),t.d(e,"max",function(){return P;}),t.d(e,"round",function(){return w;}),t.d(e,"scale",function(){return d;}),t.d(e,"scaleAndAdd",function(){return m;}),t.d(e,"distance",function(){return p;}),t.d(e,"squaredDistance",function(){return S;}),t.d(e,"length",function(){return E;}),t.d(e,"squaredLength",function(){return R;}),t.d(e,"negate",function(){return D;}),t.d(e,"inverse",function(){return U;}),t.d(e,"normalize",function(){return M;}),t.d(e,"dot",function(){return W;}),t.d(e,"cross",function(){return $;}),t.d(e,"lerp",function(){return B;}),t.d(e,"random",function(){return N;}),t.d(e,"transformMat4",function(){return z;}),t.d(e,"transformQuat",function(){return J;}),t.d(e,"zero",function(){return et;}),t.d(e,"str",function(){return at;}),t.d(e,"exactEquals",function(){return ct;}),t.d(e,"equals",function(){return V;}),t.d(e,"sub",function(){return Q;}),t.d(e,"mul",function(){return ft;}),t.d(e,"div",function(){return mt;}),t.d(e,"dist",function(){return yt;}),t.d(e,"sqrDist",function(){return At;}),t.d(e,"len",function(){return ht;}),t.d(e,"sqrLen",function(){return Nt;}),t.d(e,"forEach",function(){return Bt;});var r=t(2);function n(){var G=new r.ARRAY_TYPE(4);return r.ARRAY_TYPE!=Float32Array&&(G[0]=0,G[1]=0,G[2]=0,G[3]=0),G;}function s(G){var k=new r.ARRAY_TYPE(4);return k[0]=G[0],k[1]=G[1],k[2]=G[2],k[3]=G[3],k;}function c(G,k,rt,nt){var Y=new r.ARRAY_TYPE(4);return Y[0]=G,Y[1]=k,Y[2]=rt,Y[3]=nt,Y;}function l(G,k){return G[0]=k[0],G[1]=k[1],G[2]=k[2],G[3]=k[3],G;}function f(G,k,rt,nt,Y){return G[0]=k,G[1]=rt,G[2]=nt,G[3]=Y,G;}function u(G,k,rt){return G[0]=k[0]+rt[0],G[1]=k[1]+rt[1],G[2]=k[2]+rt[2],G[3]=k[3]+rt[3],G;}function v(G,k,rt){return G[0]=k[0]-rt[0],G[1]=k[1]-rt[1],G[2]=k[2]-rt[2],G[3]=k[3]-rt[3],G;}function h(G,k,rt){return G[0]=k[0]*rt[0],G[1]=k[1]*rt[1],G[2]=k[2]*rt[2],G[3]=k[3]*rt[3],G;}function y(G,k,rt){return G[0]=k[0]/rt[0],G[1]=k[1]/rt[1],G[2]=k[2]/rt[2],G[3]=k[3]/rt[3],G;}function T(G,k){return G[0]=Math.ceil(k[0]),G[1]=Math.ceil(k[1]),G[2]=Math.ceil(k[2]),G[3]=Math.ceil(k[3]),G;}function O(G,k){return G[0]=Math.floor(k[0]),G[1]=Math.floor(k[1]),G[2]=Math.floor(k[2]),G[3]=Math.floor(k[3]),G;}function I(G,k,rt){return G[0]=Math.min(k[0],rt[0]),G[1]=Math.min(k[1],rt[1]),G[2]=Math.min(k[2],rt[2]),G[3]=Math.min(k[3],rt[3]),G;}function P(G,k,rt){return G[0]=Math.max(k[0],rt[0]),G[1]=Math.max(k[1],rt[1]),G[2]=Math.max(k[2],rt[2]),G[3]=Math.max(k[3],rt[3]),G;}function w(G,k){return G[0]=Math.round(k[0]),G[1]=Math.round(k[1]),G[2]=Math.round(k[2]),G[3]=Math.round(k[3]),G;}function d(G,k,rt){return G[0]=k[0]*rt,G[1]=k[1]*rt,G[2]=k[2]*rt,G[3]=k[3]*rt,G;}function m(G,k,rt,nt){return G[0]=k[0]+rt[0]*nt,G[1]=k[1]+rt[1]*nt,G[2]=k[2]+rt[2]*nt,G[3]=k[3]+rt[3]*nt,G;}function p(G,k){var rt=k[0]-G[0],nt=k[1]-G[1],Y=k[2]-G[2],Z=k[3]-G[3];return Math.hypot(rt,nt,Y,Z);}function S(G,k){var rt=k[0]-G[0],nt=k[1]-G[1],Y=k[2]-G[2],Z=k[3]-G[3];return rt*rt+nt*nt+Y*Y+Z*Z;}function E(G){var k=G[0],rt=G[1],nt=G[2],Y=G[3];return Math.hypot(k,rt,nt,Y);}function R(G){var k=G[0],rt=G[1],nt=G[2],Y=G[3];return k*k+rt*rt+nt*nt+Y*Y;}function D(G,k){return G[0]=-k[0],G[1]=-k[1],G[2]=-k[2],G[3]=-k[3],G;}function U(G,k){return G[0]=1/k[0],G[1]=1/k[1],G[2]=1/k[2],G[3]=1/k[3],G;}function M(G,k){var rt=k[0],nt=k[1],Y=k[2],Z=k[3],C=rt*rt+nt*nt+Y*Y+Z*Z;return C>0&&(C=1/Math.sqrt(C)),G[0]=rt*C,G[1]=nt*C,G[2]=Y*C,G[3]=Z*C,G;}function W(G,k){return G[0]*k[0]+G[1]*k[1]+G[2]*k[2]+G[3]*k[3];}function $(G,k,rt,nt){var Y=rt[0]*nt[1]-rt[1]*nt[0],Z=rt[0]*nt[2]-rt[2]*nt[0],C=rt[0]*nt[3]-rt[3]*nt[0],L=rt[1]*nt[2]-rt[2]*nt[1],X=rt[1]*nt[3]-rt[3]*nt[1],K=rt[2]*nt[3]-rt[3]*nt[2],q=k[0],it=k[1],ut=k[2],St=k[3];return G[0]=it*K-ut*X+St*L,G[1]=-(q*K)+ut*C-St*Z,G[2]=q*X-it*C+St*Y,G[3]=-(q*L)+it*Z-ut*Y,G;}function B(G,k,rt,nt){var Y=k[0],Z=k[1],C=k[2],L=k[3];return G[0]=Y+nt*(rt[0]-Y),G[1]=Z+nt*(rt[1]-Z),G[2]=C+nt*(rt[2]-C),G[3]=L+nt*(rt[3]-L),G;}function N(G,k){k=k||1;var rt,nt,Y,Z,C,L;do rt=r.RANDOM()*2-1,nt=r.RANDOM()*2-1,C=rt*rt+nt*nt;while(C>=1);do Y=r.RANDOM()*2-1,Z=r.RANDOM()*2-1,L=Y*Y+Z*Z;while(L>=1);var X=Math.sqrt((1-C)/L);return G[0]=k*rt,G[1]=k*nt,G[2]=k*Y*X,G[3]=k*Z*X,G;}function z(G,k,rt){var nt=k[0],Y=k[1],Z=k[2],C=k[3];return G[0]=rt[0]*nt+rt[4]*Y+rt[8]*Z+rt[12]*C,G[1]=rt[1]*nt+rt[5]*Y+rt[9]*Z+rt[13]*C,G[2]=rt[2]*nt+rt[6]*Y+rt[10]*Z+rt[14]*C,G[3]=rt[3]*nt+rt[7]*Y+rt[11]*Z+rt[15]*C,G;}function J(G,k,rt){var nt=k[0],Y=k[1],Z=k[2],C=rt[0],L=rt[1],X=rt[2],K=rt[3],q=K*nt+L*Z-X*Y,it=K*Y+X*nt-C*Z,ut=K*Z+C*Y-L*nt,St=-C*nt-L*Y-X*Z;return G[0]=q*K+St*-C+it*-X-ut*-L,G[1]=it*K+St*-L+ut*-C-q*-X,G[2]=ut*K+St*-X+q*-L-it*-C,G[3]=k[3],G;}function et(G){return G[0]=0,G[1]=0,G[2]=0,G[3]=0,G;}function at(G){return"vec4("+G[0]+", "+G[1]+", "+G[2]+", "+G[3]+")";}function ct(G,k){return G[0]===k[0]&&G[1]===k[1]&&G[2]===k[2]&&G[3]===k[3];}function V(G,k){var rt=G[0],nt=G[1],Y=G[2],Z=G[3],C=k[0],L=k[1],X=k[2],K=k[3];return Math.abs(rt-C)<=r.EPSILON*Math.max(1,Math.abs(rt),Math.abs(C))&&Math.abs(nt-L)<=r.EPSILON*Math.max(1,Math.abs(nt),Math.abs(L))&&Math.abs(Y-X)<=r.EPSILON*Math.max(1,Math.abs(Y),Math.abs(X))&&Math.abs(Z-K)<=r.EPSILON*Math.max(1,Math.abs(Z),Math.abs(K));}var Q=v,ft=h,mt=y,yt=p,At=S,ht=E,Nt=R,Bt=function(){var G=n();return function(k,rt,nt,Y,Z,C){var L,X;for(rt||(rt=4),nt||(nt=0),Y?X=Math.min(Y*rt+nt,k.length):X=k.length,L=nt;L<X;L+=rt)G[0]=k[L],G[1]=k[L+1],G[2]=k[L+2],G[3]=k[L+3],Z(G,G,C),k[L]=G[0],k[L+1]=G[1],k[L+2]=G[2],k[L+3]=G[3];return k;};}();},/* 10 *//***/function(i,e,t){t.r(e),t.d(e,"create",function(){return c;}),t.d(e,"clone",function(){return l;}),t.d(e,"fromValues",function(){return f;}),t.d(e,"fromRotationTranslationValues",function(){return u;}),t.d(e,"fromRotationTranslation",function(){return v;}),t.d(e,"fromTranslation",function(){return h;}),t.d(e,"fromRotation",function(){return y;}),t.d(e,"fromMat4",function(){return T;}),t.d(e,"copy",function(){return O;}),t.d(e,"identity",function(){return I;}),t.d(e,"set",function(){return P;}),t.d(e,"getReal",function(){return w;}),t.d(e,"getDual",function(){return d;}),t.d(e,"setReal",function(){return m;}),t.d(e,"setDual",function(){return p;}),t.d(e,"getTranslation",function(){return S;}),t.d(e,"translate",function(){return E;}),t.d(e,"rotateX",function(){return R;}),t.d(e,"rotateY",function(){return D;}),t.d(e,"rotateZ",function(){return U;}),t.d(e,"rotateByQuatAppend",function(){return M;}),t.d(e,"rotateByQuatPrepend",function(){return W;}),t.d(e,"rotateAroundAxis",function(){return $;}),t.d(e,"add",function(){return B;}),t.d(e,"multiply",function(){return N;}),t.d(e,"mul",function(){return z;}),t.d(e,"scale",function(){return J;}),t.d(e,"dot",function(){return et;}),t.d(e,"lerp",function(){return at;}),t.d(e,"invert",function(){return ct;}),t.d(e,"conjugate",function(){return V;}),t.d(e,"length",function(){return Q;}),t.d(e,"len",function(){return ft;}),t.d(e,"squaredLength",function(){return mt;}),t.d(e,"sqrLen",function(){return yt;}),t.d(e,"normalize",function(){return At;}),t.d(e,"str",function(){return ht;}),t.d(e,"exactEquals",function(){return Nt;}),t.d(e,"equals",function(){return Bt;});var r=t(2),n=t(7),s=t(6);function c(){var G=new r.ARRAY_TYPE(8);return r.ARRAY_TYPE!=Float32Array&&(G[0]=0,G[1]=0,G[2]=0,G[4]=0,G[5]=0,G[6]=0,G[7]=0),G[3]=1,G;}function l(G){var k=new r.ARRAY_TYPE(8);return k[0]=G[0],k[1]=G[1],k[2]=G[2],k[3]=G[3],k[4]=G[4],k[5]=G[5],k[6]=G[6],k[7]=G[7],k;}function f(G,k,rt,nt,Y,Z,C,L){var X=new r.ARRAY_TYPE(8);return X[0]=G,X[1]=k,X[2]=rt,X[3]=nt,X[4]=Y,X[5]=Z,X[6]=C,X[7]=L,X;}function u(G,k,rt,nt,Y,Z,C){var L=new r.ARRAY_TYPE(8);L[0]=G,L[1]=k,L[2]=rt,L[3]=nt;var X=Y*0.5,K=Z*0.5,q=C*0.5;return L[4]=X*nt+K*rt-q*k,L[5]=K*nt+q*G-X*rt,L[6]=q*nt+X*k-K*G,L[7]=-X*G-K*k-q*rt,L;}function v(G,k,rt){var nt=rt[0]*0.5,Y=rt[1]*0.5,Z=rt[2]*0.5,C=k[0],L=k[1],X=k[2],K=k[3];return G[0]=C,G[1]=L,G[2]=X,G[3]=K,G[4]=nt*K+Y*X-Z*L,G[5]=Y*K+Z*C-nt*X,G[6]=Z*K+nt*L-Y*C,G[7]=-nt*C-Y*L-Z*X,G;}function h(G,k){return G[0]=0,G[1]=0,G[2]=0,G[3]=1,G[4]=k[0]*0.5,G[5]=k[1]*0.5,G[6]=k[2]*0.5,G[7]=0,G;}function y(G,k){return G[0]=k[0],G[1]=k[1],G[2]=k[2],G[3]=k[3],G[4]=0,G[5]=0,G[6]=0,G[7]=0,G;}function T(G,k){var rt=n.create();s.getRotation(rt,k);var nt=new r.ARRAY_TYPE(3);return s.getTranslation(nt,k),v(G,rt,nt),G;}function O(G,k){return G[0]=k[0],G[1]=k[1],G[2]=k[2],G[3]=k[3],G[4]=k[4],G[5]=k[5],G[6]=k[6],G[7]=k[7],G;}function I(G){return G[0]=0,G[1]=0,G[2]=0,G[3]=1,G[4]=0,G[5]=0,G[6]=0,G[7]=0,G;}function P(G,k,rt,nt,Y,Z,C,L,X){return G[0]=k,G[1]=rt,G[2]=nt,G[3]=Y,G[4]=Z,G[5]=C,G[6]=L,G[7]=X,G;}var w=n.copy;function d(G,k){return G[0]=k[4],G[1]=k[5],G[2]=k[6],G[3]=k[7],G;}var m=n.copy;function p(G,k){return G[4]=k[0],G[5]=k[1],G[6]=k[2],G[7]=k[3],G;}function S(G,k){var rt=k[4],nt=k[5],Y=k[6],Z=k[7],C=-k[0],L=-k[1],X=-k[2],K=k[3];return G[0]=(rt*K+Z*C+nt*X-Y*L)*2,G[1]=(nt*K+Z*L+Y*C-rt*X)*2,G[2]=(Y*K+Z*X+rt*L-nt*C)*2,G;}function E(G,k,rt){var nt=k[0],Y=k[1],Z=k[2],C=k[3],L=rt[0]*0.5,X=rt[1]*0.5,K=rt[2]*0.5,q=k[4],it=k[5],ut=k[6],St=k[7];return G[0]=nt,G[1]=Y,G[2]=Z,G[3]=C,G[4]=C*L+Y*K-Z*X+q,G[5]=C*X+Z*L-nt*K+it,G[6]=C*K+nt*X-Y*L+ut,G[7]=-nt*L-Y*X-Z*K+St,G;}function R(G,k,rt){var nt=-k[0],Y=-k[1],Z=-k[2],C=k[3],L=k[4],X=k[5],K=k[6],q=k[7],it=L*C+q*nt+X*Z-K*Y,ut=X*C+q*Y+K*nt-L*Z,St=K*C+q*Z+L*Y-X*nt,Ct=q*C-L*nt-X*Y-K*Z;return n.rotateX(G,k,rt),nt=G[0],Y=G[1],Z=G[2],C=G[3],G[4]=it*C+Ct*nt+ut*Z-St*Y,G[5]=ut*C+Ct*Y+St*nt-it*Z,G[6]=St*C+Ct*Z+it*Y-ut*nt,G[7]=Ct*C-it*nt-ut*Y-St*Z,G;}function D(G,k,rt){var nt=-k[0],Y=-k[1],Z=-k[2],C=k[3],L=k[4],X=k[5],K=k[6],q=k[7],it=L*C+q*nt+X*Z-K*Y,ut=X*C+q*Y+K*nt-L*Z,St=K*C+q*Z+L*Y-X*nt,Ct=q*C-L*nt-X*Y-K*Z;return n.rotateY(G,k,rt),nt=G[0],Y=G[1],Z=G[2],C=G[3],G[4]=it*C+Ct*nt+ut*Z-St*Y,G[5]=ut*C+Ct*Y+St*nt-it*Z,G[6]=St*C+Ct*Z+it*Y-ut*nt,G[7]=Ct*C-it*nt-ut*Y-St*Z,G;}function U(G,k,rt){var nt=-k[0],Y=-k[1],Z=-k[2],C=k[3],L=k[4],X=k[5],K=k[6],q=k[7],it=L*C+q*nt+X*Z-K*Y,ut=X*C+q*Y+K*nt-L*Z,St=K*C+q*Z+L*Y-X*nt,Ct=q*C-L*nt-X*Y-K*Z;return n.rotateZ(G,k,rt),nt=G[0],Y=G[1],Z=G[2],C=G[3],G[4]=it*C+Ct*nt+ut*Z-St*Y,G[5]=ut*C+Ct*Y+St*nt-it*Z,G[6]=St*C+Ct*Z+it*Y-ut*nt,G[7]=Ct*C-it*nt-ut*Y-St*Z,G;}function M(G,k,rt){var nt=rt[0],Y=rt[1],Z=rt[2],C=rt[3],L=k[0],X=k[1],K=k[2],q=k[3];return G[0]=L*C+q*nt+X*Z-K*Y,G[1]=X*C+q*Y+K*nt-L*Z,G[2]=K*C+q*Z+L*Y-X*nt,G[3]=q*C-L*nt-X*Y-K*Z,L=k[4],X=k[5],K=k[6],q=k[7],G[4]=L*C+q*nt+X*Z-K*Y,G[5]=X*C+q*Y+K*nt-L*Z,G[6]=K*C+q*Z+L*Y-X*nt,G[7]=q*C-L*nt-X*Y-K*Z,G;}function W(G,k,rt){var nt=k[0],Y=k[1],Z=k[2],C=k[3],L=rt[0],X=rt[1],K=rt[2],q=rt[3];return G[0]=nt*q+C*L+Y*K-Z*X,G[1]=Y*q+C*X+Z*L-nt*K,G[2]=Z*q+C*K+nt*X-Y*L,G[3]=C*q-nt*L-Y*X-Z*K,L=rt[4],X=rt[5],K=rt[6],q=rt[7],G[4]=nt*q+C*L+Y*K-Z*X,G[5]=Y*q+C*X+Z*L-nt*K,G[6]=Z*q+C*K+nt*X-Y*L,G[7]=C*q-nt*L-Y*X-Z*K,G;}function $(G,k,rt,nt){if(Math.abs(nt)<r.EPSILON)return O(G,k);var Y=Math.hypot(rt[0],rt[1],rt[2]);nt=nt*0.5;var Z=Math.sin(nt),C=Z*rt[0]/Y,L=Z*rt[1]/Y,X=Z*rt[2]/Y,K=Math.cos(nt),q=k[0],it=k[1],ut=k[2],St=k[3];G[0]=q*K+St*C+it*X-ut*L,G[1]=it*K+St*L+ut*C-q*X,G[2]=ut*K+St*X+q*L-it*C,G[3]=St*K-q*C-it*L-ut*X;var Ct=k[4],Et=k[5],bt=k[6],wt=k[7];return G[4]=Ct*K+wt*C+Et*X-bt*L,G[5]=Et*K+wt*L+bt*C-Ct*X,G[6]=bt*K+wt*X+Ct*L-Et*C,G[7]=wt*K-Ct*C-Et*L-bt*X,G;}function B(G,k,rt){return G[0]=k[0]+rt[0],G[1]=k[1]+rt[1],G[2]=k[2]+rt[2],G[3]=k[3]+rt[3],G[4]=k[4]+rt[4],G[5]=k[5]+rt[5],G[6]=k[6]+rt[6],G[7]=k[7]+rt[7],G;}function N(G,k,rt){var nt=k[0],Y=k[1],Z=k[2],C=k[3],L=rt[4],X=rt[5],K=rt[6],q=rt[7],it=k[4],ut=k[5],St=k[6],Ct=k[7],Et=rt[0],bt=rt[1],wt=rt[2],Ot=rt[3];return G[0]=nt*Ot+C*Et+Y*wt-Z*bt,G[1]=Y*Ot+C*bt+Z*Et-nt*wt,G[2]=Z*Ot+C*wt+nt*bt-Y*Et,G[3]=C*Ot-nt*Et-Y*bt-Z*wt,G[4]=nt*q+C*L+Y*K-Z*X+it*Ot+Ct*Et+ut*wt-St*bt,G[5]=Y*q+C*X+Z*L-nt*K+ut*Ot+Ct*bt+St*Et-it*wt,G[6]=Z*q+C*K+nt*X-Y*L+St*Ot+Ct*wt+it*bt-ut*Et,G[7]=C*q-nt*L-Y*X-Z*K+Ct*Ot-it*Et-ut*bt-St*wt,G;}var z=N;function J(G,k,rt){return G[0]=k[0]*rt,G[1]=k[1]*rt,G[2]=k[2]*rt,G[3]=k[3]*rt,G[4]=k[4]*rt,G[5]=k[5]*rt,G[6]=k[6]*rt,G[7]=k[7]*rt,G;}var et=n.dot;function at(G,k,rt,nt){var Y=1-nt;return et(k,rt)<0&&(nt=-nt),G[0]=k[0]*Y+rt[0]*nt,G[1]=k[1]*Y+rt[1]*nt,G[2]=k[2]*Y+rt[2]*nt,G[3]=k[3]*Y+rt[3]*nt,G[4]=k[4]*Y+rt[4]*nt,G[5]=k[5]*Y+rt[5]*nt,G[6]=k[6]*Y+rt[6]*nt,G[7]=k[7]*Y+rt[7]*nt,G;}function ct(G,k){var rt=mt(k);return G[0]=-k[0]/rt,G[1]=-k[1]/rt,G[2]=-k[2]/rt,G[3]=k[3]/rt,G[4]=-k[4]/rt,G[5]=-k[5]/rt,G[6]=-k[6]/rt,G[7]=k[7]/rt,G;}function V(G,k){return G[0]=-k[0],G[1]=-k[1],G[2]=-k[2],G[3]=k[3],G[4]=-k[4],G[5]=-k[5],G[6]=-k[6],G[7]=k[7],G;}var Q=n.length,ft=Q,mt=n.squaredLength,yt=mt;function At(G,k){var rt=mt(k);if(rt>0){rt=Math.sqrt(rt);var nt=k[0]/rt,Y=k[1]/rt,Z=k[2]/rt,C=k[3]/rt,L=k[4],X=k[5],K=k[6],q=k[7],it=nt*L+Y*X+Z*K+C*q;G[0]=nt,G[1]=Y,G[2]=Z,G[3]=C,G[4]=(L-nt*it)/rt,G[5]=(X-Y*it)/rt,G[6]=(K-Z*it)/rt,G[7]=(q-C*it)/rt;}return G;}function ht(G){return"quat2("+G[0]+", "+G[1]+", "+G[2]+", "+G[3]+", "+G[4]+", "+G[5]+", "+G[6]+", "+G[7]+")";}function Nt(G,k){return G[0]===k[0]&&G[1]===k[1]&&G[2]===k[2]&&G[3]===k[3]&&G[4]===k[4]&&G[5]===k[5]&&G[6]===k[6]&&G[7]===k[7];}function Bt(G,k){var rt=G[0],nt=G[1],Y=G[2],Z=G[3],C=G[4],L=G[5],X=G[6],K=G[7],q=k[0],it=k[1],ut=k[2],St=k[3],Ct=k[4],Et=k[5],bt=k[6],wt=k[7];return Math.abs(rt-q)<=r.EPSILON*Math.max(1,Math.abs(rt),Math.abs(q))&&Math.abs(nt-it)<=r.EPSILON*Math.max(1,Math.abs(nt),Math.abs(it))&&Math.abs(Y-ut)<=r.EPSILON*Math.max(1,Math.abs(Y),Math.abs(ut))&&Math.abs(Z-St)<=r.EPSILON*Math.max(1,Math.abs(Z),Math.abs(St))&&Math.abs(C-Ct)<=r.EPSILON*Math.max(1,Math.abs(C),Math.abs(Ct))&&Math.abs(L-Et)<=r.EPSILON*Math.max(1,Math.abs(L),Math.abs(Et))&&Math.abs(X-bt)<=r.EPSILON*Math.max(1,Math.abs(X),Math.abs(bt))&&Math.abs(K-wt)<=r.EPSILON*Math.max(1,Math.abs(K),Math.abs(wt));}},/* 11 *//***/function(i,e,t){t.r(e),t.d(e,"create",function(){return n;}),t.d(e,"clone",function(){return s;}),t.d(e,"fromValues",function(){return c;}),t.d(e,"copy",function(){return l;}),t.d(e,"set",function(){return f;}),t.d(e,"add",function(){return u;}),t.d(e,"subtract",function(){return v;}),t.d(e,"multiply",function(){return h;}),t.d(e,"divide",function(){return y;}),t.d(e,"ceil",function(){return T;}),t.d(e,"floor",function(){return O;}),t.d(e,"min",function(){return I;}),t.d(e,"max",function(){return P;}),t.d(e,"round",function(){return w;}),t.d(e,"scale",function(){return d;}),t.d(e,"scaleAndAdd",function(){return m;}),t.d(e,"distance",function(){return p;}),t.d(e,"squaredDistance",function(){return S;}),t.d(e,"length",function(){return E;}),t.d(e,"squaredLength",function(){return R;}),t.d(e,"negate",function(){return D;}),t.d(e,"inverse",function(){return U;}),t.d(e,"normalize",function(){return M;}),t.d(e,"dot",function(){return W;}),t.d(e,"cross",function(){return $;}),t.d(e,"lerp",function(){return B;}),t.d(e,"random",function(){return N;}),t.d(e,"transformMat2",function(){return z;}),t.d(e,"transformMat2d",function(){return J;}),t.d(e,"transformMat3",function(){return et;}),t.d(e,"transformMat4",function(){return at;}),t.d(e,"rotate",function(){return ct;}),t.d(e,"angle",function(){return V;}),t.d(e,"zero",function(){return Q;}),t.d(e,"str",function(){return ft;}),t.d(e,"exactEquals",function(){return mt;}),t.d(e,"equals",function(){return yt;}),t.d(e,"len",function(){return At;}),t.d(e,"sub",function(){return ht;}),t.d(e,"mul",function(){return Nt;}),t.d(e,"div",function(){return Bt;}),t.d(e,"dist",function(){return G;}),t.d(e,"sqrDist",function(){return k;}),t.d(e,"sqrLen",function(){return rt;}),t.d(e,"forEach",function(){return nt;});var r=t(2);function n(){var Y=new r.ARRAY_TYPE(2);return r.ARRAY_TYPE!=Float32Array&&(Y[0]=0,Y[1]=0),Y;}function s(Y){var Z=new r.ARRAY_TYPE(2);return Z[0]=Y[0],Z[1]=Y[1],Z;}function c(Y,Z){var C=new r.ARRAY_TYPE(2);return C[0]=Y,C[1]=Z,C;}function l(Y,Z){return Y[0]=Z[0],Y[1]=Z[1],Y;}function f(Y,Z,C){return Y[0]=Z,Y[1]=C,Y;}function u(Y,Z,C){return Y[0]=Z[0]+C[0],Y[1]=Z[1]+C[1],Y;}function v(Y,Z,C){return Y[0]=Z[0]-C[0],Y[1]=Z[1]-C[1],Y;}function h(Y,Z,C){return Y[0]=Z[0]*C[0],Y[1]=Z[1]*C[1],Y;}function y(Y,Z,C){return Y[0]=Z[0]/C[0],Y[1]=Z[1]/C[1],Y;}function T(Y,Z){return Y[0]=Math.ceil(Z[0]),Y[1]=Math.ceil(Z[1]),Y;}function O(Y,Z){return Y[0]=Math.floor(Z[0]),Y[1]=Math.floor(Z[1]),Y;}function I(Y,Z,C){return Y[0]=Math.min(Z[0],C[0]),Y[1]=Math.min(Z[1],C[1]),Y;}function P(Y,Z,C){return Y[0]=Math.max(Z[0],C[0]),Y[1]=Math.max(Z[1],C[1]),Y;}function w(Y,Z){return Y[0]=Math.round(Z[0]),Y[1]=Math.round(Z[1]),Y;}function d(Y,Z,C){return Y[0]=Z[0]*C,Y[1]=Z[1]*C,Y;}function m(Y,Z,C,L){return Y[0]=Z[0]+C[0]*L,Y[1]=Z[1]+C[1]*L,Y;}function p(Y,Z){var C=Z[0]-Y[0],L=Z[1]-Y[1];return Math.hypot(C,L);}function S(Y,Z){var C=Z[0]-Y[0],L=Z[1]-Y[1];return C*C+L*L;}function E(Y){var Z=Y[0],C=Y[1];return Math.hypot(Z,C);}function R(Y){var Z=Y[0],C=Y[1];return Z*Z+C*C;}function D(Y,Z){return Y[0]=-Z[0],Y[1]=-Z[1],Y;}function U(Y,Z){return Y[0]=1/Z[0],Y[1]=1/Z[1],Y;}function M(Y,Z){var C=Z[0],L=Z[1],X=C*C+L*L;return X>0&&(X=1/Math.sqrt(X)),Y[0]=Z[0]*X,Y[1]=Z[1]*X,Y;}function W(Y,Z){return Y[0]*Z[0]+Y[1]*Z[1];}function $(Y,Z,C){var L=Z[0]*C[1]-Z[1]*C[0];return Y[0]=Y[1]=0,Y[2]=L,Y;}function B(Y,Z,C,L){var X=Z[0],K=Z[1];return Y[0]=X+L*(C[0]-X),Y[1]=K+L*(C[1]-K),Y;}function N(Y,Z){Z=Z||1;var C=r.RANDOM()*2*Math.PI;return Y[0]=Math.cos(C)*Z,Y[1]=Math.sin(C)*Z,Y;}function z(Y,Z,C){var L=Z[0],X=Z[1];return Y[0]=C[0]*L+C[2]*X,Y[1]=C[1]*L+C[3]*X,Y;}function J(Y,Z,C){var L=Z[0],X=Z[1];return Y[0]=C[0]*L+C[2]*X+C[4],Y[1]=C[1]*L+C[3]*X+C[5],Y;}function et(Y,Z,C){var L=Z[0],X=Z[1];return Y[0]=C[0]*L+C[3]*X+C[6],Y[1]=C[1]*L+C[4]*X+C[7],Y;}function at(Y,Z,C){var L=Z[0],X=Z[1];return Y[0]=C[0]*L+C[4]*X+C[12],Y[1]=C[1]*L+C[5]*X+C[13],Y;}function ct(Y,Z,C,L){var X=Z[0]-C[0],K=Z[1]-C[1],q=Math.sin(L),it=Math.cos(L);return Y[0]=X*it-K*q+C[0],Y[1]=X*q+K*it+C[1],Y;}function V(Y,Z){var C=Y[0],L=Y[1],X=Z[0],K=Z[1],q=Math.sqrt(C*C+L*L)*Math.sqrt(X*X+K*K),it=q&&(C*X+L*K)/q;return Math.acos(Math.min(Math.max(it,-1),1));}function Q(Y){return Y[0]=0,Y[1]=0,Y;}function ft(Y){return"vec2("+Y[0]+", "+Y[1]+")";}function mt(Y,Z){return Y[0]===Z[0]&&Y[1]===Z[1];}function yt(Y,Z){var C=Y[0],L=Y[1],X=Z[0],K=Z[1];return Math.abs(C-X)<=r.EPSILON*Math.max(1,Math.abs(C),Math.abs(X))&&Math.abs(L-K)<=r.EPSILON*Math.max(1,Math.abs(L),Math.abs(K));}var At=E,ht=v,Nt=h,Bt=y,G=p,k=S,rt=R,nt=function(){var Y=n();return function(Z,C,L,X,K,q){var it,ut;for(C||(C=2),L||(L=0),X?ut=Math.min(X*C+L,Z.length):ut=Z.length,it=L;it<ut;it+=C)Y[0]=Z[it],Y[1]=Z[it+1],K(Y,Y,q),Z[it]=Y[0],Z[it+1]=Y[1];return Z;};}();},/* 12 *//***/function(i,e,t){t.r(e);var r=t(13);t.d(e,"Renderer",function(){return r["default"];});var n=t(40);t.d(e,"Figure2D",function(){return n["default"];});var s=t(56);t.d(e,"Mesh2D",function(){return s["default"];});var c=t(29);t.d(e,"MeshCloud",function(){return c["default"];});var l=t(23);t.d(e,"parseFont",function(){return l["default"];});var f=t(31);t.d(e,"parseColor",function(){return f["default"];});var u=t(21);t.d(e,"ENV",function(){return u["default"];}),t(1).glMatrix.setMatrixArrayType(Array);},/* 13 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return U;});var r=t(14),n=t(1),s=t(20),c=t(27),l=t(25),f=t(40),u=t(56),v=t(29),h=t(59),y=t(21),T=t(63);t(1).glMatrix.setMatrixArrayType(Array);var O={autoUpdate:!1,// premultipliedAlpha: true,
|
|
2
|
+
preserveDrawingBuffer:!1,// depth: false,
|
|
3
|
+
// antialias: false,
|
|
4
|
+
bufferSize:1500},I="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",P="precision mediump float;\nvarying vec3 vTextureCoord;\nuniform sampler2D u_texSampler;\nvoid main() {\n gl_FragColor = texture2D(u_texSampler, vTextureCoord.xy);\n}\n",w=Symbol("glRenderer"),d=Symbol("canvasRenderer"),m=Symbol("options"),p=Symbol("globalTransform"),S=Symbol("applyGlobalTransform"),E=Symbol("canvas");function R(M){var W=M.gl,$=M.fbo;$&&W.bindFramebuffer(W.FRAMEBUFFER,$),M._draw(),$&&W.bindFramebuffer(W.FRAMEBUFFER,null);}function D(M,W,$,B){var N=M.createTexture(W.canvas),z=[[[0,0],[$,0],[$,B],[0,B],[0,0]]];z.closed=!0;var J=new u["default"]({contours:z});J.setTexture(N),M.setMeshData([J.meshData]),R(M),N["delete"](),W.clearRect(0,0,$,B),delete W._filter;}var U=/*#__PURE__*/function(){function U(W){var $=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,U);var B=$.contextType;if(B||(typeof WebGL2RenderingContext=="function"?B="webgl2":typeof WebGLRenderingContext=="function"?B="webgl":B="2d"),!W.getContext){var N=W;W={getContext:function getContext(){return N;},width:$.width,height:$.height},N.canvas=W,B="2d";}if(this[E]=W,B!=="webgl"&&B!=="webgl2"&&B!=="2d")throw new Error("Unknown context type ".concat(B));if($.contextType=B,this[m]=Object.assign({},O,$),B==="webgl"||B==="webgl2"){B==="webgl2"&&(this[m].webgl2=!0);var _N=new r["default"](W,this[m]);B==="webgl2"&&!_N.isWebGL2&&($.contextType="webgl"),Object(T.createShaders)(_N),Object(T.applyShader)(_N),Object(T.createCloudShaders)(_N);var z=_N.gl;z.clearColor(0,0,0,0),z.blendFuncSeparate(z.SRC_ALPHA,z.ONE_MINUS_SRC_ALPHA,z.ONE,z.ONE_MINUS_SRC_ALPHA),this[w]=_N;}else this[d]=new s["default"](W,this[m]);this[p]=[1,0,0,0,1,0,0,0,1],this.updateResolution();}return _createClass(U,[{key:"canvas",get:function get(){return this[E];}},{key:"canvasRenderer",get:function get(){return this[d];}},{key:"glRenderer",get:function get(){return this[w];}},{key:"isWebGL2",get:function get(){return this[w]&&this[w].isWebGL2;}},{key:"options",get:function get(){return this[m];}},{key:"globalTransformMatrix",get:function get(){var W=this[p];return[W[0],W[1],W[3],W[4],W[6],W[7]];}},{key:"viewMatrix",get:function get(){return this[p];}},{key:S,value:function value(){var W=this[w]||this[d];if(this[w]){var _this$canvas=this.canvas,$=_this$canvas.width,B=_this$canvas.height;W.uniforms.viewMatrix=this.viewMatrix,W.uniforms.projectionMatrix=this.projectionMatrix,W.uniforms.u_resolution=[$,B];}}},{key:"updateResolution",value:function updateResolution(){var _this$canvas2=this.canvas,W=_this$canvas2.width,$=_this$canvas2.height,B=[// translation
|
|
5
|
+
1,0,0,0,1,0,-W/2,-$/2,1],N=[// scale
|
|
6
|
+
2/W,0,0,0,-2/$,0,0,0,1],z=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),N,B);this.projectionMatrix=z,this[w]&&this[w].gl.viewport(0,0,W,$);}},{key:"createTexture",value:function createTexture(W,$){return(this[w]||this[d]).createTexture(W,$);}/* async */},{key:"loadTexture",value:function loadTexture(W){var _ref=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref$useImageBitmap=_ref.useImageBitmap,$=_ref$useImageBitmap===void 0?!1:_ref$useImageBitmap;return(this[w]||this[d]).loadTexture(W,{useImageBitmap:$});}},{key:"createText",value:function createText(W){var _ref2=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref2$font=_ref2.font,$=_ref2$font===void 0?"16px arial":_ref2$font,_ref2$fillColor=_ref2.fillColor,B=_ref2$fillColor===void 0?null:_ref2$fillColor,_ref2$strokeColor=_ref2.strokeColor,N=_ref2$strokeColor===void 0?null:_ref2$strokeColor,_ref2$strokeWidth=_ref2.strokeWidth,z=_ref2$strokeWidth===void 0?1:_ref2$strokeWidth;if(this[w]){var J=y["default"].createText(W,{font:$,fillColor:B,strokeColor:N,strokeWidth:z});return{image:this.createTexture(J.image),rect:J.rect};}return{_img:{font:$,fillColor:B,strokeColor:N,strokeWidth:z,text:W}};}},{key:"createProgram",value:function createProgram(){var _ref3=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},W=_ref3.vertex,$=_ref3.fragment,B=_ref3.options;if(this[w]){var N=this[w].compileSync($,W);return N._attribOpts=B,N;}throw new Error("Context 2D cannot create webgl program.");}},{key:"createPassProgram",value:function createPassProgram(){var _ref4=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref4$vertex=_ref4.vertex,W=_ref4$vertex===void 0?I:_ref4$vertex,_ref4$fragment=_ref4.fragment,$=_ref4$fragment===void 0?P:_ref4$fragment,B=_ref4.options;return this.createProgram({vertex:W,fragment:$,options:B});}},{key:"useProgram",value:function useProgram(W){var $=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(this[w]){var B=Object.assign({},W._attribOpts,$);return this[w].useProgram(W,B);}throw new Error("Context 2D cannot use webgl program.");}},{key:"deleteTexture",value:function deleteTexture(W){return(this[w]||this[d]).deleteTexture(W);}},{key:"clear",value:function clear(){var _this$d;if(this[w]){var $=this[w].gl;$.clear($.COLOR_BUFFER_BIT);}else(_this$d=this[d]).clear.apply(_this$d,arguments);}},{key:"drawMeshCloud",value:function drawMeshCloud(W){var _ref5=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref5$clear=_ref5.clear,$=_ref5$clear===void 0?!1:_ref5$clear,_ref5$program=_ref5.program,B=_ref5$program===void 0?null:_ref5$program;var N=this[w]||this[d],z=B||W.program;if(this[w]){var J=N.gl;if($&&J.clear(J.COLOR_BUFFER_BIT),z)N.program!==z&&this.useProgram(z,{a_color:{type:"UNSIGNED_BYTE",normalize:!0},a_fillCloudColor:{type:"UNSIGNED_BYTE",normalize:!0},a_strokeCloudColor:{type:"UNSIGNED_BYTE",normalize:!0},a_frameIndex:{type:"UNSIGNED_BYTE",normalize:!1}});else{var et=W.mesh.meshData,at=!!et.uniforms.u_texSampler,ct=!!et.uniforms.u_filterFlag,V=!!et.uniforms.u_radialGradientVector,Q=W.hasCloudColor,ft=W.hasCloudFilter,mt=!!et.uniforms.u_clipSampler;Object(T.applyCloudShader)(N,{hasTexture:at,hasFilter:ct,hasGradient:V,hasCloudColor:Q,hasCloudFilter:ft,hasClipPath:mt});}this[S](),N.setMeshData([W.meshData]),W.beforeRender&&W.beforeRender(J,W),R(N),W.afterRender&&W.afterRender(J,W);}else N.setTransform(this.globalTransformMatrix),N.drawMeshCloud(W,{clear:$,hook:!1});}},{key:"drawMeshes",value:function drawMeshes(W){var _this=this;var _ref6=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref6$clear=_ref6.clear,$=_ref6$clear===void 0?!1:_ref6$clear,_ref6$program=_ref6.program,B=_ref6$program===void 0?null:_ref6$program;var N=this[w]||this[d];if(this[w]){var z=N.fbo,J=Object(c["default"])(this,W,B==null),et=N.gl;$&&et.clear(et.COLOR_BUFFER_BIT);var at=!Object(h.isUnitTransform)(this.globalTransformMatrix);this._drawCalls=0;var _iterator2=_createForOfIteratorHelper(J),_step2;try{var _loop=function _loop(){var ct=_step2.value;_this._drawCalls++;var V=B||ct.program;if(ct instanceof v["default"])_this.drawMeshCloud(ct,{clear:$,program:V});else{var _this$canvas3=_this.canvas,Q=_this$canvas3.width,ft=_this$canvas3.height;if(ct.beforeRender&&ct.beforeRender(et,ct),ct.pass.length&&((!_this.fbo||_this.fbo.width!==Q||_this.fbo.height!==ft)&&(_this.fbo={width:Q,height:ft,target:N.createFBO(),buffer:N.createFBO(),swap:function swap(){var _ref7=[this.buffer,this.target];this.target=_ref7[0];this.buffer=_ref7[1];}}),N.bindFBO(_this.fbo.target)),!V&&ct.filterCanvas){Object(T.applyShader)(N,{hasTexture:!0});var mt=_this.filterContext;mt||(mt=y["default"].createCanvas(Q,ft).getContext("2d"),_this.filterContext=mt);var yt=W[ct.packIndex],At=yt.filter,ht=W[ct.packIndex+1],Nt=W[ct.packIndex-1];(!Nt||!Nt.filterCanvas||Nt.filter!==At)&&(!ht||!ht.filterCanvas||ht.filter!==At)?(at?(mt.save(),Object(l.drawMesh2D)(yt,mt,!1),mt.restore(),Object(l.applyFilter)(mt,At)):Object(l.drawMesh2D)(yt,mt,!0),_this[S](),D(N,mt,Q,ft)):(at&&mt.save(),Object(l.drawMesh2D)(yt,mt,!1),at&&mt.restore(),(!ht||!ht.filterCanvas||yt.filter!==ht.filter)&&(Object(l.applyFilter)(mt,At),_this[S](),D(N,mt,Q,ft)));}else{if(V)N.program!==V&&_this.useProgram(V,{a_color:{type:"UNSIGNED_BYTE",normalize:!0}});else{var _mt=!!ct.uniforms.u_texSampler,_yt=!!ct.uniforms.u_filterFlag,_At=!!ct.uniforms.u_radialGradientVector,_ht=!!ct.uniforms.u_clipSampler;Object(T.applyShader)(N,{hasTexture:_mt,hasFilter:_yt,hasGradient:_At,hasClipPath:_ht});}ct.filterCanvas&&console.warn("User program ignored some filter effects."),_this[S](),N.setMeshData([ct]),R(N);}if(ct.pass.length){var _mt2=ct.pass.length;ct.pass.forEach(function(yt,At){yt.blend=ct.enableBlend,yt.setTexture(N.fbo.texture),At===_mt2-1?N.bindFBO(z):(_this.fbo.swap(),N.bindFBO(_this.fbo.target)),yt.program?N.useProgram(yt.program):(_this.defaultPassProgram=_this.defaultPassProgram||_this.createPassProgram(),N.useProgram(_this.defaultPassProgram)),N.setMeshData([yt.meshData]),et.clear(et.COLOR_BUFFER_BIT),R(N);});}ct.afterRender&&ct.afterRender(et,ct);}};for(_iterator2.s();!(_step2=_iterator2.n()).done;){_loop();}}catch(err){_iterator2.e(err);}finally{_iterator2.f();}}else N.setTransform(this.globalTransformMatrix),N.drawMeshes(W,{clear:$});}},{key:"drawImage",value:function drawImage(W){for(var _len=arguments.length,$=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){$[_key-1]=arguments[_key];}var B=$.length;if(B<2)throw new TypeError("Failed to execute 'drawImage' on 'Renderer': 3 arguments required, but only ".concat($.length+1," present."));if(B!==2&&B!==4&&B!==8)throw new TypeError("Failed to execute 'drawImage' on 'Renderer': Valid arities are: [3, 5, 9], but ".concat($.length+1," arguments provided."));var N=null,z=null;B===2?N=[$[0],$[1],W.width,W.height]:B===4?N=$:B===8&&(z=$.slice(0,4),N=$.slice(4));var J=this.createTexture(W),_this$canvas4=this.canvas,et=_this$canvas4.width,at=_this$canvas4.height,ct=new f["default"]();ct.rect(N[0],N[1],et,at);var V=new u["default"](ct,{width:et,height:at});V.setTexture(J,{rect:N,srcRect:z}),this.drawMeshes([V]),this.deleteTexture(J);}},{key:"setGlobalTransform",value:function setGlobalTransform(){return this[p]=[arguments.length<=0?undefined:arguments[0],arguments.length<=1?undefined:arguments[1],0,arguments.length<=2?undefined:arguments[2],arguments.length<=3?undefined:arguments[3],0,arguments.length<=4?undefined:arguments[4],arguments.length<=5?undefined:arguments[5],1],this;}},{key:"globalTransform",value:function globalTransform(){var $=this[p];for(var _len2=arguments.length,W=new Array(_len2),_key2=0;_key2<_len2;_key2++){W[_key2]=arguments[_key2];}return this[p]=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),$,W),this;}},{key:"globalTranslate",value:function globalTranslate(W,$){var B=n.mat3.create();return B=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),B,[W,$]),this.globalTransform.apply(this,_toConsumableArray(B));}},{key:"globalRotate",value:function globalRotate(W){var _ref8=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[0,0],_ref9=_slicedToArray(_ref8,2),$=_ref9[0],B=_ref9[1];var N=n.mat3.create();return N=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),N,[$,B]),N=n.mat3.rotate(Array.of(0,0,0,0,0,0,0,0,0),N,W),N=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),N,[-$,-B]),this.globalTransform.apply(this,_toConsumableArray(N));}},{key:"globalScale",value:function globalScale(W){var $=arguments.length>1&&arguments[1]!==undefined?arguments[1]:W;var _ref0=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref1=_slicedToArray(_ref0,2),B=_ref1[0],N=_ref1[1];var z=n.mat3.create();return z=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),z,[B,N]),z=n.mat3.scale(Array.of(0,0,0,0,0,0,0,0,0),z,[W,$]),z=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),z,[-B,-N]),this.globalTransform.apply(this,_toConsumableArray(z));}},{key:"globalSkew",value:function globalSkew(W){var $=arguments.length>1&&arguments[1]!==undefined?arguments[1]:W;var _ref10=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref11=_slicedToArray(_ref10,2),B=_ref11[0],N=_ref11[1];var z=n.mat3.create();return z=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),z,[B,N]),z=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),z,n.mat3.fromValues(1,Math.tan($),Math.tan(W),1,0,0)),z=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),z,[-B,-N]),this.globalTransform.apply(this,_toConsumableArray(z));}},{key:"transformPoint",value:function transformPoint(W,$,B){var N=this.globalTransformMatrix;B&&(N=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),N,B));var z=W*N[0]+$*N[2]+N[4],J=W*N[1]+$*N[3]+N[5];return[z,J];}}]);}();},/* 14 *//***/function(i,e,t){t.r(e);var r=t(15);t(1).glMatrix.setMatrixArrayType(Array),e["default"]=r["default"];},/* 15 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return T;});var r=t(16),n=t(17),s=t(18),c=t(19);t(1).glMatrix.setMatrixArrayType(Array);function l(O,I,P){return I in O?Object.defineProperty(O,I,{value:P,enumerable:!0,configurable:!0,writable:!0}):O[I]=P,O;}var f={};function u(O){var I=arguments.length>1&&arguments[1]!==undefined?arguments[1]:3;var P=[],w=O.length;for(var d=0;d<w;d++)d%I<2&&P.push(0.5*(O[d]+1));return P;}function v(O,I){var P=I._buffers;Object.values(P).forEach(function(w){O.deleteBuffer(w);}),I._buffers={};}function h(O,I,P){return O.activeTexture(O.TEXTURE0+P),Array.isArray(I._img)?O.bindTexture(O.TEXTURE_CUBE_MAP,I):O.bindTexture(O.TEXTURE_2D,I),I;}var y={"int":"1i",ivec2:"2i",ivec3:"3i",ivec4:"4i","float":"1f",vec2:"2f",vec3:"3f",vec4:"4f",mat2:"Matrix2fv",mat3:"Matrix3fv",mat4:"Matrix4fv",sampler1D:"sampler1D",sampler2D:"sampler2D",sampler3D:"sampler3D",samplerCube:"samplerCube",sampler1DShadow:"sampler1DShadow",sampler2DShadow:"sampler2DShadow",sampler2DRect:"sampler2DRect",sampler2DRectShadow:"sampler2DRectShadow"};var T=/*#__PURE__*/function(){function T(I){var P=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,T);this.options=Object.assign({},T.defaultOptions,P),this.canvas=I;var w;this.options.webgl2&&(w=I.getContext("webgl2",this.options)),w==null&&(w=Object(r.setupWebGL)(I,this.options),this.aia_ext=w.getExtension("ANGLE_instanced_arrays")),this.gl=w,w.viewport(0,0,I.width,I.height),w.clearColor(0,0,0,0),w.blendFuncSeparate(w.SRC_ALPHA,w.ONE_MINUS_SRC_ALPHA,w.ONE,w.ONE_MINUS_SRC_ALPHA),this.programs=[],this._events={};}return _createClass(T,[{key:"program",get:function get(){var I=this.gl;return I.getParameter(I.CURRENT_PROGRAM);}// WebGLRenderingContext.uniform[1234][fi][v]()
|
|
7
|
+
// WebGLRenderingContext.uniformMatrix[234]fv()
|
|
8
|
+
},{key:"_declareUniform",value:function _declareUniform(I,P){var w=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"1f";var d=this.gl,m=d.getUniformLocation(I,P);var p;var S=this;if(/^sampler/.test(w)){var E=I._samplerMap,R=I._bindTextures;Object.defineProperty(I.uniforms,P,{get:function get(){return p;},set:function set(D){p=D;var U=E[P]!=null?E[P]:R.length;R[U]=D,h(d,D,U),E[P]||(E[P]=U,d.uniform1i(m,U)),S.options.autoUpdate&&S.update();},configurable:!1,enumerable:!0});}else{var _E2=w.indexOf("Matrix")===0,_R=!_E2&&/v$/.test(w),D=d["uniform".concat(w)].bind(d);Object.defineProperty(I.uniforms,P,{get:function get(){return p;},set:function set(U){p=U,typeof U=="number"&&(U=[U]),_E2?D(m,!1,U):_R?D(m,U):D.apply(void 0,[m].concat(_toConsumableArray(U))),S.options.autoUpdate&&S.update();},configurable:!1,enumerable:!0});}}},{key:"_draw",value:function _draw(){var _this2=this;var I=this.program;I.meshData.forEach(function(P,w){var d=P.positions,m=P.cells,p=P.instanceCount,S=P.cellsCount,E=P.attributes,R=P.uniforms,D=P.textureCoord,U=P.enableBlend,M=_this2.gl;var W=P.mode!=null?P.mode:M.TRIANGLES;typeof W=="string"&&(W=M[W]),U?M.enable(M.BLEND):M.disable(M.BLEND),M.bindBuffer(M.ARRAY_BUFFER,I._buffers.verticesBuffer),M.bufferData(M.ARRAY_BUFFER,d,M.STATIC_DRAW),m&&(M.bindBuffer(M.ELEMENT_ARRAY_BUFFER,I._buffers.cellsBuffer),M.bufferData(M.ELEMENT_ARRAY_BUFFER,m,M.STATIC_DRAW));var $=[];E&&Object.values(E).forEach(function(_ref12){var N=_ref12.name,z=_ref12.data,J=_ref12.divisor;if(M.bindBuffer(M.ARRAY_BUFFER,I._buffers[N]),M.bufferData(M.ARRAY_BUFFER,z,M.STATIC_DRAW),J!=null){var et=M.getAttribLocation(I,N);et>=0&&(M.enableVertexAttribArray(et),$.push(et),M.vertexAttribDivisor?M.vertexAttribDivisor(et,J):_this2.aia_ext&&_this2.aia_ext.vertexAttribDivisorANGLE(et,J));}}),R&&Object.entries(R).forEach(function(_ref13){var _ref14=_slicedToArray(_ref13,2),N=_ref14[0],z=_ref14[1];_this2.uniforms[N]=z;});var B;if(!m){var N=I._dimension;B=d.length/N;}if(I._enableTextures&&I._buffers.texCoordBuffer){var _N2=D||u(d,I._dimension);M.bindBuffer(M.ARRAY_BUFFER,I._buffers.texCoordBuffer),M.bufferData(M.ARRAY_BUFFER,T.FLOAT(_N2),M.STATIC_DRAW);}p!=null?(m?M.drawElementsInstanced?M.drawElementsInstanced(W,S,M.UNSIGNED_SHORT,0,p):_this2.aia_ext&&_this2.aia_ext.drawElementsInstancedANGLE(W,S,M.UNSIGNED_SHORT,0,p):M.drawArraysInstanced?M.drawArraysInstanced(W,0,B,p):_this2.aia_ext.drawArraysInstancedANGLE(W,0,B,p),$.forEach(function(N){M.vertexAttribDivisor?M.vertexAttribDivisor(N,null):_this2.aia_ext&&_this2.aia_ext.vertexAttribDivisorANGLE(N,null);})):m?M.drawElements(W,S,M.UNSIGNED_SHORT,0):M.drawArrays(W,0,B);});}},{key:"isWebGL2",get:function get(){return(typeof WebGL2RenderingContext==="undefined"?"undefined":_typeof(WebGL2RenderingContext))<"u"&&this.gl instanceof WebGL2RenderingContext;}},{key:"enableTextures",get:function get(){return this.program&&this.program._enableTextures;}},{key:"uniforms",get:function get(){var I=this.program;if(!I||!I.uniforms)throw Error("No avaliable program.");return I.uniforms;}},{key:"deleteProgram",value:function deleteProgram(I){var P=this.gl;this.program===I&&(this.startRender=!1,this._renderFrameID&&(cancelAnimationFrame(this._renderFrameID),delete this._renderFrameID),P.useProgram(null));var w=this.programs.indexOf(I);w>=0&&this.programs.splice(w,1),v(P,I),P.deleteProgram(I);}/**
|
|
9
|
+
[{
|
|
10
|
+
positions: ...
|
|
11
|
+
cells: ...
|
|
12
|
+
textureCoord: ...
|
|
13
|
+
attributes: {name: {data:..., normalize: true}},
|
|
14
|
+
uniforms: ...
|
|
15
|
+
}]
|
|
16
|
+
*/},{key:"setMeshData",value:function setMeshData(I){var _this3=this;Array.isArray(I)||(I=[I]);var P=this.program;P.meshData=I.map(function(_ref15){var w=_ref15.mode,d=_ref15.positions,m=_ref15.instanceCount,p=_ref15.cells,S=_ref15.cellsCount,E=_ref15.attributes,R=_ref15.uniforms,D=_ref15.textureCoord,U=_ref15.enableBlend;var M={positions:T.FLOAT(d),uniforms:R,enableBlend:!!U,textureCoord:T.FLOAT(D)};if(p&&(M.cells=T.USHORT(p),M.cellsCount=S||M.cells.length),w!=null&&(M.mode=w),m!=null){if(!_this3.isWebGL2&&!_this3.aia_ext)throw new Error("Cannot use instanceCount in this rendering context, use webgl2 context instead.");M.instanceCount=m;}if(E){var W={};Object.entries(E).forEach(function(_ref16){var _ref17=_slicedToArray(_ref16,2),$=_ref17[0],B=_ref17[1];if(!P._attribute[$])P._attribute[$]="ignored";else if(P._attribute[$]!=="ignored"){var _P$_attribute$$=P._attribute[$],N=_P$_attribute$$.name,z=_P$_attribute$$.type;var J=B.data||B;if(Array.isArray(J)&&(J=T[z](J)),W[$]={name:N,data:J},B.divisor!=null){if(!_this3.isWebGL2&&!_this3.aia_ext)throw new Error("Cannot use divisor in this rendering context, use webgl2 context instead.");W[$].divisor=B.divisor;}}}),M.attributes=W;}return M;}),this.options.autoUpdate&&this.update();}},{key:"createProgram",value:function createProgram(I,P){var _this4=this;var w=/^\s*uniform\s+sampler/mg.test(I);I==null&&(I=s["default"]),P==null&&(P=w?c["default"]:n["default"]);var d=this.gl,m=Object(r.createProgram)(d,P,I);m.shaderText={vertexShader:P,fragmentShader:I},m._buffers={},m._attribute={},m.uniforms={},m._samplerMap={},m._bindTextures=[];var p=new RegExp("(?:attribute|in) vec(\\d) ".concat(this.options.vertexPosition),"im");var S=P.match(p);S&&(m._dimension=Number(S[1]));var E=new RegExp("(?:attribute|in) vec(\\d) ".concat(this.options.vertexTextureCoord),"im");S=P.match(E),S&&(m._texCoordSize=Number(S[1]));var R=/^\s*(?:attribute|in) (\w+?)(\d*) (\w+)/gim;if(S=P.match(R),S)for(var M=0;M<S.length;M++){var W=/^\s*(?:attribute|in) (\w+?)(\d*) (\w+)/im,$=S[M].match(W);if($&&$[3]!==this.options.vertexPosition&&$[3]!==this.options.vertexTextureCoord){var _$=_slicedToArray($,4),B=_$[1],N=_$[2],z=_$[3];B==="mat"&&(N=Math.pow(N,2)),m._buffers[z]=d.createBuffer(),m._attribute[z]={name:z,type:B,size:Number(N)||1};}}var D=/^\s*uniform\s+(\w+)\s+(\w+)(\[\d+\])?/mg;S=P.match(D)||[],S=S.concat(I.match(D)||[]),S.forEach(function(M){var W=M.match(/^\s*uniform\s+(\w+)\s+(\w+)(\[\d+\])?/);var _W$slice=W.slice(1),_W$slice2=_slicedToArray(_W$slice,3),$=_W$slice2[0],B=_W$slice2[1],N=_W$slice2[2];$=y[$],N=!!N,$.indexOf("Matrix")!==0&&N&&($+="v"),_this4._declareUniform(m,B,$);}),m._buffers.verticesBuffer=d.createBuffer(),m._buffers.cellsBuffer=d.createBuffer();var U=d.getAttribLocation(m,this.options.vertexTextureCoord);return m._enableTextures=U>=0,m._enableTextures&&(m._buffers.texCoordBuffer=d.createBuffer()),this.programs.push(m),m;}},{key:"useProgram",value:function useProgram(I){var P=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};this.startRender=!1,this._renderFrameID&&(cancelAnimationFrame(this._renderFrameID),delete this._renderFrameID);var w=this.gl;w.useProgram(I);var d=I._dimension;w.bindBuffer(w.ARRAY_BUFFER,I._buffers.verticesBuffer);var m=w.getAttribLocation(I,this.options.vertexPosition);if(w.vertexAttribPointer(m,d,w.FLOAT,!1,0,0),w.enableVertexAttribArray(m),I._enableTextures){w.bindBuffer(w.ARRAY_BUFFER,I._buffers.texCoordBuffer);var p=w.getAttribLocation(I,this.options.vertexTextureCoord);w.vertexAttribPointer(p,I._texCoordSize||2,w.FLOAT,!1,0,0),w.enableVertexAttribArray(p);}if(Object.entries(I._attribute).forEach(function(_ref18){var _ref19=_slicedToArray(_ref18,2),p=_ref19[0],S=_ref19[1];if(S!=="ignored"){var E=S.size,R=P[p]||{},D=!!R.normalize;var U=R.type||"FLOAT";var M=R.key||p;U==="UBYTE"&&(U="UNSIGNED_BYTE"),U==="USHORT"&&(U="UNSIGNED_SHORT"),S.type=U,M&&M!==p&&(I._attribute[M]=S),w.bindBuffer(w.ARRAY_BUFFER,I._buffers[p]);var W=w.getAttribLocation(I,p);W>=0&&(w.vertexAttribPointer(W,E,w[U],D,0,0),w.enableVertexAttribArray(W));}}),!I.meshData){var _p2=[[-1,-1,0,1].slice(0,d),[1,-1,0,1].slice(0,d),[1,1,0,1].slice(0,d),[-1,1,0,1].slice(0,d)],S=[[0,1,3],[3,1,2]];this.setMeshData({positions:_p2,cells:S});}return I;}},{key:"compileSync",value:function compileSync(I,P){I=I||s["default"];var w={};function d(E){E=E.replace(/^\s*/mg,"");var R=[],D=E.match(/^#pragma\s+include\s+.*/mg);if(D){for(var U=0;U<D.length;U++){var W=D[U].match(/(?:<|")(.*)(?:>|")/);if(W){var $=W[0].indexOf("<")===0?"lib":"link";var B=W[1];if(B==="graph"&&(B="graphics"),w[B])R.push("/* included ".concat(B," */"));else if(w[B]=!0,$==="lib"){var N=d(f[B]);R.push(N);}else if($==="link")throw new Error("Cannot load external links synchronously. Use compile instead of compileSync.");}}R.forEach(function(U){E=E.replace(/^#pragma\s+include\s+.*/m,U);});}return E;}var m=d(I),p=P?d(P):null;return this.createProgram(m,p);}},{key:"compile",value:function(){var _compile=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(I,P){var w,d,_d2,m,p,_t2;return _regenerator().w(function(_context2){while(1)switch(_context2.n){case 0:_d2=function _d4(){_d2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(E){var R,D,U,W,$,B,N,_N3;return _regenerator().w(function(_context){while(1)switch(_context.n){case 0:E=E.replace(/^\s*/mg,"");R=[],D=E.match(/^#pragma\s+include\s+.*/mg);if(!D){_context.n=9;break;}U=0;case 1:if(!(U<D.length)){_context.n=8;break;}W=D[U].match(/(?:<|")(.*)(?:>|")/);if(!W){_context.n=7;break;}$=W[0].indexOf("<")===0?"lib":"link";B=W[1];if(!(B==="graph"&&(B="graphics"),w[B])){_context.n=2;break;}R.push("/* included ".concat(B," */"));_context.n=7;break;case 2:if(!(w[B]=!0,$==="lib")){_context.n=4;break;}_context.n=3;return d(f[B]);case 3:N=_context.v;R.push(N);_context.n=7;break;case 4:if(!($==="link")){_context.n=7;break;}_context.n=5;return T.fetchShader(B);case 5:_N3=_context.v;_context.n=6;return d(_N3);case 6:_N3=_context.v;R.push(_N3);case 7:U++;_context.n=1;break;case 8:R.forEach(function(U){E=E.replace(/^#pragma\s+include\s+.*/m,U);});case 9:return _context.a(2,E);}},_callee);}));return _d2.apply(this,arguments);};d=function _d3(_x4){return _d2.apply(this,arguments);};I=I||s["default"];w={};_context2.n=1;return d(I);case 1:m=_context2.v;if(!P){_context2.n=3;break;}_context2.n=2;return d(P);case 2:_t2=_context2.v;_context2.n=4;break;case 3:_t2=null;case 4:p=_t2;return _context2.a(2,this.createProgram(m,p));}},_callee2,this);}));function compile(_x2,_x3){return _compile.apply(this,arguments);}return compile;}()},{key:"load",value:function(){var _load=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(I){var P,_args3=arguments,_t3;return _regenerator().w(function(_context3){while(1)switch(_context3.n){case 0:P=_args3.length>1&&_args3[1]!==undefined?_args3[1]:null;_context3.n=1;return T.fetchShader(I);case 1:I=_context3.v;_t3=P;if(!_t3){_context3.n=3;break;}_context3.n=2;return T.fetchShader(P);case 2:P=_context3.v;case 3:return _context3.a(2,this.compile(I,P));}},_callee3,this);}));function load(_x5){return _load.apply(this,arguments);}return load;}()},{key:"createTexture",value:function createTexture(){var _this5=this;var I=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var _ref20=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref20$wrapS=_ref20.wrapS,P=_ref20$wrapS===void 0?this.gl.CLAMP_TO_EDGE:_ref20$wrapS,_ref20$wrapT=_ref20.wrapT,w=_ref20$wrapT===void 0?this.gl.CLAMP_TO_EDGE:_ref20$wrapT,_ref20$minFilter=_ref20.minFilter,d=_ref20$minFilter===void 0?this.gl.LINEAR:_ref20$minFilter,_ref20$magFilter=_ref20.magFilter,m=_ref20$magFilter===void 0?this.gl.LINEAR:_ref20$magFilter;var p=this.gl,S=Array.isArray(I)?p.TEXTURE_CUBE_MAP:p.TEXTURE_2D;this._max_texture_image_units=this._max_texture_image_units||p.getParameter(p.MAX_COMBINED_TEXTURE_IMAGE_UNITS),p.activeTexture(p.TEXTURE0+this._max_texture_image_units-1);var E=p.createTexture();p.bindTexture(S,E),p.pixelStorei(p.UNPACK_FLIP_Y_WEBGL,!0);var _this$canvas5=this.canvas,R=_this$canvas5.width,D=_this$canvas5.height;if(I){if(S===p.TEXTURE_CUBE_MAP)for(var U=0;U<6;U++)p.texImage2D(p.TEXTURE_CUBE_MAP_POSITIVE_X+U,0,p.RGBA,p.RGBA,p.UNSIGNED_BYTE,I[U]);else p.texImage2D(S,0,p.RGBA,p.RGBA,p.UNSIGNED_BYTE,I);}else if(S===p.TEXTURE_CUBE_MAP)for(var _U=0;_U<6;_U++)this.gl.texImage2D(this.gl.TEXTURE_CUBE_MAP_POSITIVE_X+_U,0,p.RGBA,R,D,0,p.RGBA,p.UNSIGNED_BYTE,null);else p.texImage2D(S,0,p.RGBA,R,D,0,p.RGBA,p.UNSIGNED_BYTE,null);return p.texParameteri(S,p.TEXTURE_MIN_FILTER,d),p.texParameteri(S,p.TEXTURE_MAG_FILTER,m),p.texParameteri(S,p.TEXTURE_WRAP_S,P),p.texParameteri(S,p.TEXTURE_WRAP_T,w),S===p.TEXTURE_CUBE_MAP&&(I.width=I[0].width,I.height=I[0].height),p.bindTexture(S,null),E._img=I||{width:R,height:D},E["delete"]=function(){_this5.deleteTexture(E);},E;}},{key:"deleteTexture",value:function deleteTexture(I){var P=I._img;this.gl.deleteTexture(I),typeof P.close=="function"&&P.close();}},{key:"loadTexture",value:function(){var _loadTexture=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(I){var _ref21,_ref21$useImageBitmap,P,w,_args4=arguments;return _regenerator().w(function(_context4){while(1)switch(_context4.n){case 0:_ref21=_args4.length>1&&_args4[1]!==undefined?_args4[1]:{},_ref21$useImageBitmap=_ref21.useImageBitmap,P=_ref21$useImageBitmap===void 0?!0:_ref21$useImageBitmap;_context4.n=1;return T.loadImage(I,{useImageBitmap:P});case 1:w=_context4.v;return _context4.a(2,this.createTexture(w));}},_callee4,this);}));function loadTexture(_x6){return _loadTexture.apply(this,arguments);}return loadTexture;}()},{key:"createFBO",value:function createFBO(){var _ref22=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref22$color=_ref22.color,I=_ref22$color===void 0?1:_ref22$color,_ref22$blend=_ref22.blend,P=_ref22$blend===void 0?!1:_ref22$blend,_ref22$depth=_ref22.depth,w=_ref22$depth===void 0?this.options.depth!==!1:_ref22$depth,_ref22$stencil=_ref22.stencil,d=_ref22$stencil===void 0?!!this.options.stencil:_ref22$stencil;var m=this.gl,p=m.createFramebuffer();m.bindFramebuffer(m.FRAMEBUFFER,p);var S=[];for(var D=0;D<I;D++){var U=this.createTexture();m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0+D,m.TEXTURE_2D,U,0/* level */),S.push(U);}p.textures=S,p.texture=S[0],p.blend=P;var _this$canvas6=this.canvas,E=_this$canvas6.width,R=_this$canvas6.height;return w&&!d&&(p.depthBuffer=m.createRenderbuffer(),m.bindRenderbuffer(m.RENDERBUFFER,p.depthBuffer),m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_COMPONENT16,E,R),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_ATTACHMENT,m.RENDERBUFFER,p.depthBuffer)),d&&!w&&(p.stencilBuffer=m.createRenderbuffer(),m.bindRenderbuffer(m.RENDERBUFFER,p.stencilBuffer),m.renderbufferStorage(m.RENDERBUFFER,m.STENCIL_INDEX8,E,R),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.STENCIL_ATTACHMENT,m.RENDERBUFFER,p.stencilBuffer)),w&&d&&(p.depthStencilBuffer=m.createRenderbuffer(),m.bindRenderbuffer(m.RENDERBUFFER,p.depthStencilBuffer),m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_STENCIL,E,R),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,p.depthStencilBuffer)),m.bindFramebuffer(m.FRAMEBUFFER,null),p;}},{key:"bindFBO",value:function bindFBO(){var I=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;this.fbo=I;}},{key:"render",value:function render(){var _ref23=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref23$clearBuffer=_ref23.clearBuffer,I=_ref23$clearBuffer===void 0?!0:_ref23$clearBuffer;this.startRender=!0;var P=this.gl;var w=this.program;w||(w=this.createProgram(),this.useProgram(w)),this.fbo&&P.bindFramebuffer(P.FRAMEBUFFER,this.fbo);var d=this.options.depth;d&&P.enable(P.DEPTH_TEST),this.gl.clear(this.gl.COLOR_BUFFER_BIT|(d?this.gl.DEPTH_BUFFER_BIT:0)|(this.options.stencil?this.gl.STENCIL_BUFFER_BIT:0));var m=this._renderFrameID;this._draw(),this.fbo&&P.bindFramebuffer(P.FRAMEBUFFER,null),this._renderFrameID===m&&(this._renderFrameID=null);}},{key:"update",value:function update(){this.startRender&&this._renderFrameID==null&&(this._renderFrameID=requestAnimationFrame(this.render.bind(this)));}}],[{key:"addLibs",value:function addLibs(){var I=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};Object.assign(f,I);}},{key:"FLOAT",value:function FLOAT(I,P){return Object(r.pointsToBuffer)(I,Float32Array,P);}},{key:"UNSIGNED_BYTE",value:function UNSIGNED_BYTE(I,P){return Object(r.pointsToBuffer)(I,Uint8Array,P);}},{key:"UNSIGNED_SHORT",value:function UNSIGNED_SHORT(I,P){return Object(r.pointsToBuffer)(I,Uint16Array,P);}},{key:"BYTE",value:function BYTE(I,P){return Object(r.pointsToBuffer)(I,Int8Array,P);}},{key:"SHORT",value:function SHORT(I,P){return Object(r.pointsToBuffer)(I,Int16Array,P);}}]);}();l(T,"defaultOptions",{preserveDrawingBuffer:!0,autoUpdate:!0,vertexPosition:"a_vertexPosition",vertexTextureCoord:"a_vertexTextureCoord",webgl2:!1}),l(T,"UBYTE",T.UNSIGNED_BYTE),l(T,"USHORT",T.UNSIGNED_SHORT),l(T,"fetchShader",r.fetchShader),l(T,"loadImage",r.loadImage);},/* 16 *//***/function(i,e,t){t.r(e),t.d(e,"setupWebGL",function(){return n;}),t.d(e,"createProgram",function(){return s;}),t.d(e,"pointsToBuffer",function(){return c;}),t.d(e,"loadImage",function(){return f;}),t.d(e,"fetchShader",function(){return v;}),t(1).glMatrix.setMatrixArrayType(Array);function r(h,y){var T=["webgl","experimental-webgl","webkit-3d","moz-webgl"];var O=null;for(var I=0;I<T.length;++I){try{O=h.getContext(T[I],y);}catch(_unused){}if(O)break;}return O;}function n(h,y){var T=r(h,y);if(!T)throw new Error("Sorry, your browser doesn't support WebGL.");return T;}function s(h,y,T){var O=h.createShader(h.VERTEX_SHADER);if(h.shaderSource(O,y),h.compileShader(O),!h.getShaderParameter(O,h.COMPILE_STATUS)){var _w2="Vertex shader failed to compile. The error log is:".concat(h.getShaderInfoLog(O));throw new Error(_w2);}var I=h.createShader(h.FRAGMENT_SHADER);if(h.shaderSource(I,T),h.compileShader(I),!h.getShaderParameter(I,h.COMPILE_STATUS)){var _w3="Fragment shader failed to compile. The error log is:".concat(h.getShaderInfoLog(I));throw new Error(_w3);}var P=h.createProgram();if(h.attachShader(P,O),h.attachShader(P,I),h.linkProgram(P),!h.getProgramParameter(P,h.LINK_STATUS)){var _w4="Shader program failed to link. The error log is:".concat(h.getProgramInfoLog(P));throw new Error(_w4);}return h.deleteShader(O),h.deleteShader(I),P;}function c(h){var y=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Float32Array;var T=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;if(T&&!(T instanceof y))throw new TypeError("Wrong buffer type.");if(h==null||h instanceof y)return h;if(h[0]==null||h[0].length==null)return T?(T.set(h,0),T):new y(h);var O=h[0].length,I=h.length;T||(T=new y(O*I));var P=0;for(var _w5=0;_w5<I;_w5++)for(var _d5=0;_d5<O;_d5++)T[P++]=h[_w5][_d5];return T;}var l={};function f(h){var _ref24=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref24$useImageBitmap=_ref24.useImageBitmap,y=_ref24$useImageBitmap===void 0?!0:_ref24$useImageBitmap,_ref24$alias=_ref24.alias,T=_ref24$alias===void 0?null:_ref24$alias;if(!l[h]){if(typeof Image=="function"){var O=new Image();typeof h=="string"&&!((typeof location==="undefined"?"undefined":_typeof(location))=="object"&&/^file:/.test(location.href))&&!/^data:/.test(h)&&(O.crossOrigin="anonymous"),l[h]=new Promise(function(I){O.onload=function(){y&&typeof createImageBitmap=="function"?createImageBitmap(O,{imageOrientation:"flipY"}).then(function(P){l[h]=P,T&&(l[T]=P),I(P);}):(l[h]=O,T&&(l[T]=O),I(O));},O.src=h;}),T&&(l[T]=l[h]);}else if(typeof fetch=="function")return fetch(h,{method:"GET",mode:"cors",cache:"default"}).then(function(O){return O.blob();}).then(function(O){return createImageBitmap(O,{imageOrientation:"flipY"}).then(function(I){return l[h]=I,T&&(l[T]=I),I;});});}return l[h];}var u={};function v(_x7){return _v2.apply(this,arguments);}function _v2(){_v2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(h){var y,T;return _regenerator().w(function(_context5){while(1)switch(_context5.n){case 0:if(!u[h]){_context5.n=1;break;}return _context5.a(2,u[h]);case 1:_context5.n=2;return fetch(h);case 2:y=_context5.v;if(!(y.status>=200&&y.status<300)){_context5.n=4;break;}_context5.n=3;return y.text();case 3:T=_context5.v;return _context5.a(2,(u[h]=T,T));case 4:throw new Error("Shader loaded error.");case 5:return _context5.a(2);}},_callee5);}));return _v2.apply(this,arguments);}},/* 17 *//***/function(i,e,t){t.r(e),e["default"]="attribute vec3 a_vertexPosition;\n\nvoid main() {\n gl_PointSize = 1.0;\n gl_Position = vec4(a_vertexPosition, 1);\n}";},/* 18 *//***/function(i,e,t){t.r(e),e["default"]="#ifdef GL_ES\nprecision mediump float;\n#endif\n\nvoid main() {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 0.1);\n}";},/* 19 *//***/function(i,e,t){t.r(e),e["default"]="attribute vec4 a_vertexPosition;\nattribute vec2 a_vertexTextureCoord;\nvarying vec2 vTextureCoord;\n\nvoid main() {\n gl_PointSize = 1.0;\n gl_Position = a_vertexPosition;\n vTextureCoord = a_vertexTextureCoord;\n}";},/* 20 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return c;});var r=t(21),n=t(25);t(1).glMatrix.setMatrixArrayType(Array);var s=Symbol("transform");var c=/*#__PURE__*/function(){function c(f,u){_classCallCheck(this,c);this.context=f.getContext("2d"),this.options=u,this[s]=[1,0,0,1,0,0];}return _createClass(c,[{key:"createTexture",value:function createTexture(f){return{_img:f};}},{key:"loadTexture",value:function(){var _loadTexture2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(f){var u;return _regenerator().w(function(_context6){while(1)switch(_context6.n){case 0:_context6.n=1;return r["default"].loadImage(f,{useImageBitmap:!1});case 1:u=_context6.v;return _context6.a(2,this.createTexture(u));}},_callee6,this);}));function loadTexture(_x8){return _loadTexture2.apply(this,arguments);}return loadTexture;}()},{key:"deleteTexture",value:function deleteTexture(f){return f;}},{key:"clear",value:function clear(f,u,v,h){var y=this.context;f=f||0,u=u||0,v=v||y.canvas.width-f,h=h||y.canvas.height-u,y.clearRect(f,u,v,h);}},{key:"drawMeshCloud",value:function drawMeshCloud(f){var _ref25=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref25$clear=_ref25.clear,u=_ref25$clear===void 0?!1:_ref25$clear;var v=[];for(var h=0;h<f.amount;h++){var y=f.getTransform(h);var T=f.getTextureFrame(h);T&&(T=T._img);var O=f.getFilter(h),_f$getCloudRGBA=f.getCloudRGBA(h),I=_f$getCloudRGBA.fill,P=_f$getCloudRGBA.stroke;v.push({mesh:f.mesh,_cloudOptions:[I,P,T,y,O]});}f.beforeRender&&f.beforeRender(this.context,f),this.drawMeshes(v,{clear:u,hook:!1}),f.afterRender&&f.afterRender(this.context,f);}},{key:"drawMeshes",value:function drawMeshes(f){var _this6=this;var _ref26=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref26$clear=_ref26.clear,u=_ref26$clear===void 0?!1:_ref26$clear,_ref26$hook=_ref26.hook,v=_ref26$hook===void 0?!0:_ref26$hook;var h=this.context;u&&h.clearRect(0,0,h.canvas.width,h.canvas.height);var y=null;var _h$canvas=h.canvas,T=_h$canvas.width,O=_h$canvas.height,I=f.length;f.forEach(function(P,w){var _P$_cloudOptions,_this6$filterBuffer;var d,m,p,S,E;v&&P.beforeRender&&P.beforeRender(h,P),P._cloudOptions&&(_P$_cloudOptions=_slicedToArray(P._cloudOptions,5),d=_P$_cloudOptions[0],m=_P$_cloudOptions[1],p=_P$_cloudOptions[2],S=_P$_cloudOptions[3],E=_P$_cloudOptions[4],P=P.mesh);var R=P.filter;if(E&&(R=R?"".concat(R," ").concat(E):E),R&&!_this6.filterBuffer&&_this6.filterBuffer!==!1){var D=r["default"].createCanvas(T,O);D?_this6.filterBuffer=D.getContext("2d"):_this6.filterBuffer=!1;}y&&y!==R&&(Object(n.applyFilter)(_this6.filterBuffer,y),h.drawImage(_this6.filterBuffer.canvas,0,0,T,O),_this6.filterBuffer.clearRect(0,0,T,O),y=null),R&&_this6.filterBuffer?(_this6.filterBuffer.save(),(_this6$filterBuffer=_this6.filterBuffer).transform.apply(_this6$filterBuffer,_toConsumableArray(_this6[s])),Object(n.drawMesh2D)(P,_this6.filterBuffer,!1,d,m,p,S),_this6.filterBuffer.restore(),w===I-1?(Object(n.applyFilter)(_this6.filterBuffer,R),h.drawImage(_this6.filterBuffer.canvas,0,0,T,O),_this6.filterBuffer.clearRect(0,0,T,O)):y=R):(h.save(),h.transform.apply(h,_toConsumableArray(_this6[s])),Object(n.drawMesh2D)(P,h,!1,d,m,p,S),h.restore()),v&&P.afterRender&&P.afterRender(h,P);});}},{key:"setTransform",value:function setTransform(f){this[s]=f;}}]);}();},/* 21 *//***/function(i,e,t){t.r(e),function(r){var n=t(14),s=t(23),c=t(24);t(1).glMatrix.setMatrixArrayType(Array);var l={};function f(T,O){var I=T.style,P=T.variant,w=T.weight,d=T.stretch,m=T.size,p=T.pxLineHeight,S=T.family;return d==="normal"?"".concat(I," ").concat(P," ").concat(w," ").concat(m*O,"px/").concat(p*O,"px ").concat(S):"".concat(I," ").concat(P," ").concat(w," ").concat(d," ").concat(m*O,"px/").concat(p*O,"px ").concat(S);}function u(T,_ref27){var O=_ref27.font,I=_ref27.fillColor,P=_ref27.strokeColor,w=_ref27.strokeWidth,_ref27$ratio=_ref27.ratio,d=_ref27$ratio===void 0?1:_ref27$ratio,m=_ref27.textCanvas,_ref27$cachable=_ref27.cachable,p=_ref27$cachable===void 0?!1:_ref27$cachable;var S;if(p){S=[T,O,String(I),String(P),String(w)].join("###");var J=l[S];if(J)return J;}m||(m=h(1,1));var E=m.getContext("2d");E.save(),E.font=O;var _E$measureText=E.measureText(T),R=_E$measureText.width;E.restore();var D=Object(s["default"])(O),U=Math.max(D.pxLineHeight,D.pxHeight*1.13);/italic|oblique/.test(O)&&(R+=U*Math.tan(15*Math.PI/180)),!I&&!P&&(I="#000");var M=E.canvas,W=Math.ceil(R),$=Math.ceil(U);M.width=Math.round(W*d),M.height=Math.round($*d),E.save(),E.font=f(D,d),E.textAlign="center",E.textBaseline="middle";var B=M.height*0.5+D.pxHeight*0.05*d,N=M.width*0.5;if(I){if(Array.isArray(I))I=Object(c["default"])(I);else if(I.vector){var _J;var _I2=I,et=_I2.vector,at=_I2.colors;et.length===6?_J=E.createRadialGradient.apply(E,_toConsumableArray(et)):_J=E.createLinearGradient.apply(E,_toConsumableArray(et)),at.forEach(function(_ref28){var ct=_ref28.offset,V=_ref28.color;_J.addColorStop(ct,V);}),I=_J;}E.fillStyle=I,E.fillText(T,N,B);}if(P){if(E.lineWidth=w*d,Array.isArray(P))P=Object(c["default"])(P);else if(P.vector){var _J2;var _P2=P,_et=_P2.vector,_at=_P2.colors;_et.length===6?_J2=E.createRadialGradient.apply(E,_toConsumableArray(_et)):_J2=E.createLinearGradient.apply(E,_toConsumableArray(_et)),_at.forEach(function(_ref29){var ct=_ref29.offset,V=_ref29.color;_J2.addColorStop(ct,V);}),P=_J2;}E.strokeStyle=P,E.strokeText(T,N,B);}E.restore();var z={image:m,rect:[0,0,W,$]};return p&&(l[S]=z),z;}var v=!1;if((typeof navigator==="undefined"?"undefined":_typeof(navigator))=="object"&&typeof navigator.userAgent=="string"){var T=navigator.userAgent.toLowerCase().match(/chrome\/(\d+)/);T&&(v=Number(T[1])<70);}function h(T,O){var I=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var P=I.offscreen||!v&&I.offscreen!==!1;var w;return _typeof(r)<"u"&&typeof r.createCanvas=="function"?w=r.createCanvas(T,O,I):P&&typeof OffscreenCanvas=="function"?w=new OffscreenCanvas(T,O):(w=document.createElement("canvas"),w.width=T,w.height=O),w;}var y={createCanvas:h,createText:u,loadImage:n["default"].loadImage};e["default"]=y;}.call(this,t(22));},/* 22 *//***/function(i,e){var t;t=/* @__PURE__ */function(){return this;}();try{t=t||new Function("return this")();}catch(_unused2){(typeof window==="undefined"?"undefined":_typeof(window))=="object"&&(t=window);}i.exports=t;},/* 23 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return I;}),t(1).glMatrix.setMatrixArrayType(Array);function r(P,w){if(typeof P=="string"){var p=P.trim().match(/^([\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin|%)$/);p?P={size:parseFloat(p[1]),unit:p[2]}:P={size:parseInt(P,10),unit:"px"};}var _P3=P,d=_P3.size,m=_P3.unit;if(m==="pt")d/=0.75;else if(m==="pc")d*=16;else if(m==="in")d*=96;else if(m==="cm")d*=37.79527559055118;else if(m==="mm")d*=3.7795275590551185;else if(m==="em"||m==="rem"||m==="ex"){if(!w&&typeof getComputedStyle=="function"&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _p3=getComputedStyle(document.documentElement).fontSize;w=r(_p3,16);}d*=w,m==="ex"&&(d/=2);}else if(m==="q")d*=0.9448818897637796;else if(m==="vw"||m==="vh"){if((typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _p4=m==="vw"?document.documentElement.clientWidth:document.documentElement.clientHeight;d*=_p4/100;}}else if((m==="vmax"||m==="vmin")&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _p5=document.documentElement.clientWidth,S=document.documentElement.clientHeight;m==="vmax"?d*=Math.max(_p5,S)/100:d*=Math.min(_p5,S)/100;}return d;}var n="bold|bolder|lighter|[1-9]00",s="italic|oblique",c="small-caps",l="ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded",f="px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin|%",u="'([^']+)'|\"([^\"]+)\"|([\\w-]|[\u4E00-\u9FA5])+",v=new RegExp("(".concat(n,") +"),"i"),h=new RegExp("(".concat(s,") +"),"i"),y=new RegExp("(".concat(c,") +"),"i"),T=new RegExp("(".concat(l,") +"),"i"),O=new RegExp("([\\d\\.]+)("+f+")(?:\\/([\\d\\.]+)("+f+"))? *((?:"+u+")( *, *(?:"+u+"))*)");function I(P,w){var d=O.exec(P);if(!d)return;var m=parseFloat(d[3]),p={weight:"normal",style:"normal",stretch:"normal",variant:"normal",size:parseFloat(d[1]),unit:d[2],lineHeight:Number.isFinite(m)?m:void 0,lineHeightUnit:d[4],family:d[5].replace(/ *, */g,",")},S=P.substring(0,d.index),E=v.exec(S),R=h.exec(S),D=y.exec(S),U=T.exec(S);return E&&(p.weight=E[1]),R&&(p.style=R[1]),D&&(p.variant=D[1]),U&&(p.stretch=U[1]),p.pxHeight=r({size:p.size,unit:p.unit},w),p.pxLineHeight=r({size:p.lineHeight||p.size,unit:p.lineHeightUnit||p.unit},w),p;}},/* 24 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return r;}),t(1).glMatrix.setMatrixArrayType(Array);function r(n){return"rgba(".concat(n.map(function(s,c){return c<3?Math.round(s*255):s;}).join(),")");}},/* 25 *//***/function(i,e,t){t.r(e),t.d(e,"applyFilter",function(){return l;}),t.d(e,"drawMesh2D",function(){return u;});var r=t(1),n=t(24),s=t(23),c=t(26);t(1).glMatrix.setMatrixArrayType(Array);function l(v,h){var y=v.canvas;v.save(),v.filter=h,v.drawImage(y,0,0,y.width,y.height),v.restore();}function f(v,h){var y=/rgba\((\d+),(\d+),(\d+),(\d+)\)/;v=v.match(y).slice(1,5).map(Number),h=h.match(y).slice(1,5).map(Number);var T=[],O=h[3];for(var I=0;I<4;I++)T[I]=Object(c.mix)(v[I],h[I],O);return"rgba(".concat(T.join(),")");}function u(v,h){var y=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var T=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;var O=arguments.length>4&&arguments[4]!==undefined?arguments[4]:null;var I=arguments.length>5&&arguments[5]!==undefined?arguments[5]:null;var P=arguments.length>6&&arguments[6]!==undefined?arguments[6]:null;h.save();var w=!1,d=!1;if(h.globalAlpha=v.getOpacity(),v._updateMatrix&&v.transformScale/v.contours.scale>1.5&&v.accurate(v.transformScale),v.lineWidth){var S=v.gradient&&v.gradient.stroke;if(S){var _S2=S,E=_S2.vector,R=_S2.colors;if(E.length===6)S=h.createRadialGradient.apply(h,_toConsumableArray(E));else if(E.length===4)S=h.createLinearGradient.apply(h,_toConsumableArray(E));else if(E.length===3)S=h.createCircularGradient.apply(h,_toConsumableArray(E));else throw new TypeError("Invalid vector dimension.");R.forEach(function(_ref30){var D=_ref30.offset,U=_ref30.color;var M=Object(n["default"])(U);O&&(M=f(M,O)),S.addColorStop(D,M);}),h.strokeStyle=S,w=!0;}else v.strokeStyle&&(O?h.strokeStyle=f(v.strokeStyle,O):h.strokeStyle=v.strokeStyle,w=!0);}w&&(h.lineWidth=v.lineWidth,h.lineJoin=v.lineJoin,h.lineCap=v.lineCap,h.miterLimit=v.miterLimit,v.lineDash&&(h.setLineDash(v.lineDash),v.lineDashOffset&&(h.lineDashOffset=v.lineDashOffset)));var m=v.gradient&&v.gradient.fill;if(m){var _m2=m,_S3=_m2.vector,_E3=_m2.colors;if(_S3.length===6)m=h.createRadialGradient.apply(h,_toConsumableArray(_S3));else if(_S3.length===4)m=h.createLinearGradient.apply(h,_toConsumableArray(_S3));else if(_S3.length===3)m=h.createCircularGradient.apply(h,_toConsumableArray(_S3));else throw new TypeError("Invalid vector dimension.");_E3.forEach(function(_ref31){var R=_ref31.offset,D=_ref31.color;var U=Object(n["default"])(D);O&&(U=f(U,O)),m.addColorStop(R,U);}),h.fillStyle=m,d=!0;}else v.fillStyle&&(T?h.fillStyle=f(v.fillStyle,T):h.fillStyle=v.fillStyle,d=!0);if(P&&h.transform.apply(h,_toConsumableArray(P)),h.transform.apply(h,_toConsumableArray(v.transformMatrix)),v.clipPath){var _S4=v.clipPath,_E4=new Path2D(_S4);h.clip(_E4);}var p=v.contours.length;if(v.contours.forEach(function(S,E){var R=S.length,D=R>1&&r.vec2.equals(S[0],S[R-1]),U=E===p-1&&v.texture;if(S&&R>0){if(d||w||U){h.beginPath(),h.moveTo.apply(h,_toConsumableArray(S[0]));for(var M=1;M<R;M++)M===R-1&&D?h.closePath():h.lineTo.apply(h,_toConsumableArray(S[M]));}if(d&&h.fill(v.fillRule),U){h.save(),h.clip();var _v$texture=v.texture,_M=_v$texture.image,W=_v$texture.options;if(I&&(_M=I),W.repeat&&console.warn("Context 2D not supported image repeat yet."),_M.font){W.scale&&console.warn("Context 2D not supported text scale yet."),W.srcRect&&console.warn("Context 2D not supported text srcRect yet.");var _M2=_M,$=_M2.font,B=_M2.fillColor,N=_M2.strokeColor,z=_M2.strokeWidth,J=_M2.text;!B&&!N&&(B="#000"),Array.isArray(B)&&(B=Object(n["default"])(B)),Array.isArray(N)&&(N=Object(n["default"])(N)),h.font=$;var _h$measureText=h.measureText(J),et=_h$measureText.width,at=Object(s["default"])($),ct=Math.max(at.pxLineHeight,at.pxHeight*1.13);h.textAlign="center",h.textBaseline="middle";var V=W.rect,Q=V[0]+ct*0.5+at.pxHeight*0.06,ft=V[1]+et*0.5;V[2]!=null&&h.scale(V[2]/et,V[3]/ct),B&&(h.fillStyle=B,h.fillText(J,ft,Q)),N&&(h.lineWidth=z,h.strokeStyle=N,h.strokeText(J,ft,Q));}else{var _$2=W.rect;var _B=W.srcRect;W.scale&&(_$2=[0,0,h.canvas.width,h.canvas.height]),W.rotated&&_$2&&(_$2=[-_$2[1],_$2[0],_$2[3],_$2[2]]),_B&&(_$2=_$2||[0,0,_B[2],_B[3]]),W.rotated&&(h.translate(0,_$2?_$2[2]:_M.width),h.rotate(-0.5*Math.PI)),_B?h.drawImage.apply(h,[_M].concat(_toConsumableArray(_B),_toConsumableArray(_$2))):_$2?h.drawImage.apply(h,[_M].concat(_toConsumableArray(_$2))):h.drawImage(_M,0,0);}h.restore();}w&&h.stroke();}}),h.restore(),y){var _S5=v.filter;_S5&&l(h,_S5);}}},/* 26 *//***/function(i,e,t){t.r(e),t.d(e,"clamp",function(){return r;}),t.d(e,"mix",function(){return n;}),t.d(e,"transformPoint",function(){return s;}),t(1).glMatrix.setMatrixArrayType(Array);function r(c,l,f){var _ref32;return l>f&&(_ref32=[f,l],l=_ref32[0],f=_ref32[1],_ref32),c<l?l:c>f?f:c;}function n(c,l,f){return c*(1-f)+l*f;}function s(c,l){var _c2=_slicedToArray(c,2),f=_c2[0],u=_c2[1];return[f*l[0]+u*l[2]+l[4],f*l[1]+u*l[3]+l[5]];}},/* 27 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return f;});var r=t(28),n=t(29);t(1).glMatrix.setMatrixArrayType(Array);function s(u,v,h){var y=u.uniforms||{},T=v.uniforms||{};if(y.u_texSampler&&T.u_texSampler&&y.u_texSampler!==T.u_texSampler)return!1;var O=Object.keys(y),I=Object.keys(T),P=O.indexOf("u_texSampler"),w=I.indexOf("u_texSampler");if(P>=0&&O.splice(P,1),w>=0&&I.splice(w,1),O.length!==I.length)return!1;var d=O.every(function(m){var p=y[m],S=T[m];if(p===S)return!0;if(p.length&&S.length&&p.length===S.length){for(var E=0;E<p.length;E++)if(p[E]!==S[E])return!1;return!0;}return!1;});if(d){if(y.u_texSampler&&!T.u_texSampler)v.setTexture(y.u_texSampler,{hidden:!0});else if(!y.u_texSampler&&T.u_texSampler)for(var m=0;m<h.length;m++)h[m].setTexture(T.u_texSampler,{hidden:!0});}return d;}var c={};function l(u,v){if(u.length){var h=Object(r["default"])(u,c);return h.enableBlend=v,u[0].filterCanvas&&(h.filterCanvas=!0),h.packIndex=u[0].packIndex,h.packLength=u.length,h.beforeRender=u[0].beforeRender,h.pass=u[0].pass,h.afterRender=u[u.length-1].afterRender,u.length=0,h;}}function f(u,v){var h=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;return/*#__PURE__*/_regenerator().m(function _callee7(){var y,T,O,I,P,_w6,_d6,p,m,_p6,S,_t4,_t5,_t6,_t7;return _regenerator().w(function(_context7){while(1)switch(_context7.n){case 0:y=[],T=u.options.bufferSize;O=0,I=!1;P=0;case 1:if(!(P<v.length)){_context7.n=11;break;}_w6=v[P];if(!(_w6 instanceof n["default"])){_context7.n=4;break;}_t4=y.length;if(!_t4){_context7.n=2;break;}_context7.n=2;return l(y,I);case 2:O=0;I=!1;_context7.n=3;return _w6;case 3:_context7.n=10;break;case 4:_d6=_w6.meshData;if(_d6.clipPath&&!_d6.uniforms.u_clipSampler){p=u.createTexture(_d6.clipPath);_d6.uniforms.u_clipSampler=p;}m=0;if(!((!h||!_w6.canIgnore())&&_d6&&_d6.positions.length)){_context7.n=9;break;}_w6.packIndex=P;_p6=_w6.filterCanvas;if(!(m=_d6.positions.length,_p6||O+m>T)){_context7.n=6;break;}_t5=y.length;if(!_t5){_context7.n=5;break;}_context7.n=5;return l(y,I);case 5:O=0;I=!1;_context7.n=8;break;case 6:if(!O){_context7.n=8;break;}S=y[y.length-1];_t6=S&&(S.filterCanvas||S.afterRender||_w6.beforeRender||S.pass.length||_w6.pass.length||S.program!==_w6.program||!s(S,_w6,y));if(!_t6){_context7.n=8;break;}_context7.n=7;return l(y,I);case 7:O=0;I=!1;case 8:y.push(_w6),I=I||_w6.enableBlend,O+=m;case 9:_t7=P===v.length-1&&y.length;if(!_t7){_context7.n=10;break;}_context7.n=10;return l(y,I);case 10:P++;_context7.n=1;break;case 11:return _context7.a(2);}},_callee7);})();}},/* 28 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return s;}),t(1).glMatrix.setMatrixArrayType(Array);var r={UNSIGNED_BYTE:Uint8Array,UNSIGNED_SHORT:Uint16Array,BYTE:Int8Array,SHORT:Int16Array,FLOAT:Float32Array};function n(c,l){var f=0,u=0,v=0,h=0,y=0,T=0,O=0;var I=c[0].program;for(var P=0;P<c.length;P++){var _w7=c[P].meshData;if(_w7){O+=_w7.positions.length;var _d7=_w7.positions[0].length;f+=_w7.positions.length*_d7,u+=_w7.cells.length*3,T+=_w7.attributes.a_color.length*4;var m=_w7.textureCoord;m&&(v+=m.length*m[0].length);var p=_w7.attributes.a_sourceRect;p&&(h+=p.length*4);var S=_w7.attributes.a_clipUV;S&&(y+=S.length*2);}}if((!l.positions||l.positions.length<f)&&(l.positions=new Float32Array(f)),(!l.cells||l.cells.length<u)&&(l.cells=new Uint16Array(u)),v&&(!l.textureCoord||l.textureCoord.length<v)&&(l.textureCoord=new Float32Array(v)),(!l.a_color||l.a_color.length<T)&&(l.a_color=new Uint8Array(T)),h&&(!l.a_sourceRect||l.a_sourceRect.length<h)&&(l.a_sourceRect=new Float32Array(h)),y&&(!l.a_clipUV||l.a_clipUV.length<y)&&(l.a_clipUV=new Float32Array(y)),I){var _P4=Object.entries(I._attribute),_w8=I._attribOpts||{};for(var _d8=0;_d8<_P4.length;_d8++){var _P4$_d=_slicedToArray(_P4[_d8],2),_m3=_P4$_d[0],_p7=_P4$_d[1];if(_m3!=="a_color"&&_m3!=="a_sourceRect"&&_p7!=="ignored"){var _S6=_w8[_m3]?_w8[_m3].type:"FLOAT",E=r[_S6],R=_p7.size*O;(!l[_m3]||l[_m3].length<R)&&(l[_m3]=new E(R));}}}return l;}function s(c,l){var f=[],u=[],v=[],h=[],y=[],T=[],O=0,I=0;var P=c[0]?c[0].uniforms||{}:{},w=c[0]?c[0].program:null;l&&(n(c,l),u=l.cells,f=l.positions,v=l.textureCoord,h=l.a_color,y=l.a_sourceRect,T=l.a_clipUV);var d=!1,m=!1;var p={};for(var E=0;E<c.length;E++){var R=c[E];if(R){var _f2,_h2,_y2,_T2,_v3;if(R.meshData&&(R=R.meshData),l){var U=R.positions;for(var M=0;M<U.length;M++){var W=U[M],$=3*(O+M);for(var B=0;B<W.length;B++)f[$+B]=W[B];}}else(_f2=f).push.apply(_f2,_toConsumableArray(R.positions));var D=R.cells;for(var _U2=0;_U2<D.length;_U2++){var _M3=D[_U2];if(l){var _W=3*(I+_U2);u[_W]=_M3[0]+O,u[_W+1]=_M3[1]+O,u[_W+2]=_M3[2]+O;}else u.push([_M3[0]+O,_M3[1]+O,_M3[2]+O]);}if(l){var _U3=R.attributes.a_color;for(var _M4=0;_M4<_U3.length;_M4++){var _W2=_U3[_M4],_$3=4*(O+_M4);h[_$3]=_W2[0],h[_$3+1]=_W2[1],h[_$3+2]=_W2[2],h[_$3+3]=_W2[3];}}else(_h2=h).push.apply(_h2,_toConsumableArray(R.attributes.a_color));if(R.attributes.a_sourceRect)if(d=!0,l){var _U4=R.attributes.a_sourceRect;for(var _M5=0;_M5<_U4.length;_M5++){var _W3=_U4[_M5],_$4=4*(O+_M5);y[_$4]=_W3[0],y[_$4+1]=_W3[1],y[_$4+2]=_W3[2],y[_$4+3]=_W3[3];}}else(_y2=y).push.apply(_y2,_toConsumableArray(R.attributes.a_sourceRect));if(R.attributes.a_clipUV)if(m=!0,l){var _U5=R.attributes.a_clipUV;for(var _M6=0;_M6<_U5.length;_M6++){var _W4=_U5[_M6],_$5=2*(O+_M6);T[_$5]=_W4[0],T[_$5+1]=_W4[1];}}else(_T2=T).push.apply(_T2,_toConsumableArray(R.attributes.a_clipUV));if(R.textureCoord)if(l){var _U6=R.textureCoord;for(var _M7=0;_M7<_U6.length;_M7++){var _W5=_U6[_M7],_$6=3*(O+_M7);for(var _B2=0;_B2<_W5.length;_B2++)v[_$6+_B2]=_W5[_B2];}}else(_v3=v).push.apply(_v3,_toConsumableArray(R.textureCoord));if(w){var _U7=Object.entries(w._attribute);for(var _M8=0;_M8<_U7.length;_M8++){var _p$_W;var _U7$_M=_slicedToArray(_U7[_M8],2),_W6=_U7$_M[0],_$7=_U7$_M[1];if(_W6!=="a_color"&&_W6!=="a_sourceRect"&&_$7!=="ignored")if(p[_W6]=[],l){p[_W6]=l[_W6];var _B3=R.attributes[_W6],N=_B3[0].length;for(var z=0;z<_B3.length;z++){var J=_B3[z],et=N*(O+z);for(var at=0;at<J.length;at++)p[_W6][et+at]=J[at];}}else(_p$_W=p[_W6]).push.apply(_p$_W,_toConsumableArray(R.attributes[_W6]));}}O+=R.positions.length,I+=R.cells.length;}}p.a_color=h,d&&y&&y.length>0&&(p.a_sourceRect=y);var S={positions:f,cells:u,attributes:p,uniforms:P,cellsCount:I*3,program:w};return v&&v.length&&(S.textureCoord=v),m&&T.length>0&&(p.a_clipUV=T),S;}},/* 29 *//***/function(i,e,t){t.r(e);var r=t(1),n=t(30),s=t(26),c=t(31);t(1).glMatrix.setMatrixArrayType(Array);function l(p,S){var E=Object.keys(p);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(p);S&&(R=R.filter(function(D){return Object.getOwnPropertyDescriptor(p,D).enumerable;})),E.push.apply(E,R);}return E;}function f(p){for(var S=1;S<arguments.length;S++){var E=arguments[S]!=null?arguments[S]:{};S%2?l(Object(E),!0).forEach(function(R){u(p,R,E[R]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(E)):l(Object(E)).forEach(function(R){Object.defineProperty(p,R,Object.getOwnPropertyDescriptor(E,R));});}return p;}function u(p,S,E){return S in p?Object.defineProperty(p,S,{value:E,enumerable:!0,configurable:!0,writable:!0}):p[S]=E,p;}var v=Symbol("mesh"),h=Symbol("count"),y=Symbol("blend"),T=Symbol("filter"),O=Symbol("textures"),I=Symbol("textureOptions"),P=Symbol("cloudColor"),w=Symbol("cloudFilter"),d=Symbol("buffer");function m(p){var S=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var E=new Float32Array(3*p),R=new Float32Array(3*p),D=new Float32Array(4*p),U=new Float32Array(4*p),M=new Float32Array(4*p),W=new Float32Array(4*p),$=new Float32Array(4*p),B=new Uint8Array(p),N=new Uint8Array(4*p),z=new Uint8Array(4*p);return S&&(E.set(S.transform0,0),R.set(S.transform1,0),D.set(S.color0,0),U.set(S.color1,0),M.set(S.color2,0),W.set(S.color3,0),$.set(S.color4,0),B.set(S.frameIndex,0),N.set(S.fillColor,0),z.set(S.strokeColor,0)),{bufferSize:p,transform0:E,transform1:R,color0:D,color1:U,color2:M,color3:W,color4:$,frameIndex:B,fillColor:N,strokeColor:z};}e["default"]=/*#__PURE__*/function(){function _class(p){var S=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;var _ref33=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},_ref33$buffer=_ref33.buffer,E=_ref33$buffer===void 0?1e3:_ref33$buffer;_classCallCheck(this,_class);E=Math.max(E,S),this[h]=S,this[v]=p,this[d]=m(E),this[O]=[],this[T]=[],this[P]=!1,this[w]=!1,this[y]=!1,this.initBuffer();}return _createClass(_class,[{key:"initBuffer",value:function initBuffer(){var p=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var S=this[h];for(var E=p;E<S;E++)this[d].transform0.set([1,0,0],E*3),this[d].transform1.set([0,1,0],E*3),this[d].frameIndex.set([-1],E),this[d].fillColor.set([0,0,0,0],E*4),this[d].strokeColor.set([0,0,0,0],E*4),this.setColorTransform(E,null);}},{key:"bufferSize",get:function get(){return this[d].bufferSize;}},{key:"mesh",get:function get(){return this[v];},set:function set(p){this[v]=p,this[O]&&this.setTextureFrames(this[O],this[I]);}},{key:"hasCloudColor",get:function get(){return this[P];}},{key:"hasCloudFilter",get:function get(){return this[w];}},{key:"_getFilter",value:function _getFilter(p){return this[T][p]=this[T][p]||[],this[T][p];}},{key:"getFilter",value:function getFilter(p){return this._getFilter(p).join(" ");}},{key:"enableBlend",get:function get(){return this[v].enableBlend||this[y];}},{key:"canIgnore",value:function canIgnore(){return this[v].canIgnore();}},{key:"delete",value:function _delete(p){if(p>=this[h]||p<0)throw new Error("Out of range.");var _this$d2=this[d],S=_this$d2.transform0,E=_this$d2.transform1,R=_this$d2.color0,D=_this$d2.color1,U=_this$d2.color2,M=_this$d2.color3,W=_this$d2.color4,$=_this$d2.frameIndex,B=_this$d2.fillColor,N=_this$d2.strokeColor;S.set(S.subarray(3*(p+1)),3*p),E.set(E.subarray(3*(p+1)),3*p),R.set(R.subarray(4*(p+1)),4*p),D.set(D.subarray(4*(p+1)),4*p),U.set(U.subarray(4*(p+1)),4*p),M.set(M.subarray(4*(p+1)),4*p),W.set(W.subarray(4*(p+1)),4*p),$.set($.subarray(p+1),p),B.set(B.subarray(4*(p+1)),4*p),N.set(N.subarray(4*(p+1)),4*p);for(var z in this[T])z===p?delete this[T][z]:z>p&&(this[T][z-1]=this[T][z],delete this[T][z]);this[h]--;}},{key:"setColorTransform",value:function setColorTransform(p,S){if(p>=this[h]||p<0)throw new Error("Out of range.");p*=4;var _this$d3=this[d],E=_this$d3.color0,R=_this$d3.color1,D=_this$d3.color2,U=_this$d3.color3,M=_this$d3.color4;return S!=null?(E.set([S[0],S[5],S[10],S[15]],p),R.set([S[1],S[6],S[11],S[16]],p),D.set([S[2],S[7],S[12],S[17]],p),U.set([S[3],S[8],S[13],S[18]],p),M.set([S[4],S[9],S[14],S[19]],p),this[y]=this[y]||S[18]<1,this[w]=!0):(E.set([1,0,0,0],p),R.set([0,1,0,0],p),D.set([0,0,1,0],p),U.set([0,0,0,1],p),M.set([0,0,0,0],p)),this;}},{key:"getColorTransform",value:function getColorTransform(p){if(p>=this[h]||p<0)throw new Error("Out of range.");p*=4;var _this$d4=this[d],S=_this$d4.color0,E=_this$d4.color1,R=_this$d4.color2,D=_this$d4.color3,U=_this$d4.color4;return[S[p],E[p],R[p],D[p],U[p],S[p+1],E[p+1],R[p+1],D[p+1],U[p+1],S[p+2],E[p+2],R[p+2],D[p+2],U[p+2],S[p+3],E[p+3],R[p+3],D[p+3],U[p+3]];}},{key:"transformColor",value:function transformColor(p,S){var E=this.getColorTransform(p);return E=Object(n.multiply)(E,S),this.setColorTransform(p,E),this;}},{key:"setFillColor",value:function setFillColor(p,S){if(p>=this[h]||p<0)throw new Error("Out of range.");typeof S=="string"&&(S=Object(c["default"])(S)),S[3]>0&&(this[P]=!0),this[d].fillColor.set(S.map(function(E){return Math.round(255*E);}),4*p);}},{key:"setStrokeColor",value:function setStrokeColor(p,S){if(p>=this[h]||p<0)throw new Error("Out of range.");typeof S=="string"&&(S=Object(c["default"])(S)),S[3]>0&&(this[P]=!0),this[d].strokeColor.set(S.map(function(E){return Math.round(255*E);}),4*p);}},{key:"getCloudRGBA",value:function getCloudRGBA(p){if(p>=this[h]||p<0)throw new Error("Out of range.");p*=4;var _this$d5=this[d],S=_this$d5.fillColor,E=_this$d5.strokeColor,R=[S[p],S[p+1],S[p+2],S[p+3]],D=[E[p],E[p+1],E[p+2],E[p+3]];return R[3]/=255,D[3]/=255,{fill:"rgba(".concat(R.join(),")"),stroke:"rgba(".concat(D.join(),")")};}},{key:"grayscale",value:function grayscale(p,S){this.transformColor(p,Object(n.grayscale)(S)),this._getFilter(p).push("grayscale(".concat(100*S,"%)"));}},{key:"brightness",value:function brightness(p,S){this.transformColor(p,Object(n.brightness)(S)),this._getFilter(p).push("brightness(".concat(100*S,"%)"));}},{key:"saturate",value:function saturate(p,S){this.transformColor(p,Object(n.saturate)(S)),this._getFilter(p).push("saturate(".concat(100*S,"%)"));}},{key:"contrast",value:function contrast(p,S){this.transformColor(p,Object(n.contrast)(S)),this._getFilter(p).push("contrast(".concat(100*S,"%)"));}},{key:"invert",value:function invert(p,S){this.transformColor(p,Object(n.invert)(S)),this._getFilter(p).push("invert(".concat(100*S,"%)"));}},{key:"sepia",value:function sepia(p,S){this.transformColor(p,Object(n.sepia)(S)),this._getFilter(p).push("sepia(".concat(100*S,"%)"));}},{key:"opacity",value:function opacity(p,S){this.transformColor(p,Object(n.opacity)(S)),this._getFilter(p).push("opacity(".concat(100*S,"%)"));}},{key:"hueRotate",value:function hueRotate(p,S){this.transformColor(p,Object(n.hueRotate)(S)),this._getFilter(p).push("hue-rotate(".concat(S,"deg)"));}},{key:"setTransform",value:function setTransform(p,S){if(p>=this[h]||p<0)throw new Error("Out of range.");p*=3,S==null&&(S=[1,0,0,1,0,0]);var _this$d6=this[d],E=_this$d6.transform0,R=_this$d6.transform1;return E.set([S[0],S[2],S[4]],p),R.set([S[1],S[3],S[5]],p),this;}},{key:"getTransform",value:function getTransform(p){if(p>=this[h]||p<0)throw new Error("Out of range.");p*=3;var _this$d7=this[d],S=_this$d7.transform0,E=_this$d7.transform1;return[S[p],E[p],S[p+1],E[p+1],S[p+2],E[p+2]];}},{key:"getTextureFrame",value:function getTextureFrame(p){return this[O][this[d].frameIndex[p]];}},{key:"setTextureFrames",value:function setTextureFrames(){var p=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var S=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(p.length>12)throw new Error("Max frames exceed. Allow 12 frames.");p.length&&this[v].setTexture(p[0],S),this[O]=p,this[I]=S;}},{key:"setFrameIndex",value:function setFrameIndex(p,S){if(p>=this[h]||p<0)throw new Error("Out of range.");var E=this[O].length;if(E<=0)throw new Error("No frames");this[d].frameIndex[p]=S%E;}},{key:"amount",get:function get(){return this[h];},set:function set(p){var S=this[h];p!==S&&(p>this[d].bufferSize&&(this[d]=m(Math.max(p,this[d].bufferSize+1e3),this[d])),this[h]=p,p>S&&this.initBuffer(S));}},{key:"meshData",get:function get(){var _this$v$meshData=this[v].meshData,p=_this$v$meshData.attributes,S=_this$v$meshData.cells,E=_this$v$meshData.positions,R=_this$v$meshData.textureCoord,D=_this$v$meshData.uniforms,U=this[O],M={attributes:f({},p),cells:S,positions:E,textureCoord:R,uniforms:f({},D),instanceCount:this[h],enableBlend:this.enableBlend};U.length&&U.forEach(function(Q,ft){M.uniforms["u_texFrame".concat(ft)]=Q;});var _this$d8=this[d],W=_this$d8.transform0,$=_this$d8.transform1,B=_this$d8.color0,N=_this$d8.color1,z=_this$d8.color2,J=_this$d8.color3,et=_this$d8.color4,at=_this$d8.fillColor,ct=_this$d8.strokeColor,V=_this$d8.frameIndex;return this[v].uniforms.u_texSampler&&(M.attributes.a_frameIndex={data:V,divisor:1}),M.attributes.a_transform0={data:W,divisor:1},M.attributes.a_transform1={data:$,divisor:1},M.attributes.a_colorCloud0={data:B,divisor:1},M.attributes.a_colorCloud1={data:N,divisor:1},M.attributes.a_colorCloud2={data:z,divisor:1},M.attributes.a_colorCloud3={data:J,divisor:1},M.attributes.a_colorCloud4={data:et,divisor:1},this.hasCloudColor&&(M.attributes.a_fillCloudColor={data:at,divisor:1},M.attributes.a_strokeCloudColor={data:ct,divisor:1}),M;}},{key:"setProgram",value:function setProgram(p){this[v].setProgram(p);}},{key:"program",get:function get(){return this[v].program;}},{key:"transform",value:function transform(p,S){var E=this.getTransform(p);return S=r.mat2d.multiply(Array.of(0,0,0,0,0,0),E,S),this.setTransform(p,S),this;}},{key:"translate",value:function translate(p,_ref34){var _ref35=_slicedToArray(_ref34,2),S=_ref35[0],E=_ref35[1];var R=r.mat2d.create();return R=r.mat2d.translate(Array.of(0,0,0,0,0,0),R,[S,E]),this.transform(p,R);}},{key:"rotate",value:function rotate(p,S){var _ref36=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref37=_slicedToArray(_ref36,2),E=_ref37[0],R=_ref37[1];var D=r.mat2d.create();return D=r.mat2d.translate(Array.of(0,0,0,0,0,0),D,[E,R]),D=r.mat2d.rotate(Array.of(0,0,0,0,0,0),D,S),D=r.mat2d.translate(Array.of(0,0,0,0,0,0),D,[-E,-R]),this.transform(p,D);}},{key:"scale",value:function scale(p,_ref38){var _ref39=_slicedToArray(_ref38,2),S=_ref39[0],_ref39$=_ref39[1],E=_ref39$===void 0?S:_ref39$;var _ref40=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref41=_slicedToArray(_ref40,2),R=_ref41[0],D=_ref41[1];var U=r.mat2d.create();return U=r.mat2d.translate(Array.of(0,0,0,0,0,0),U,[R,D]),U=r.mat2d.scale(Array.of(0,0,0,0,0,0),U,[S,E]),U=r.mat2d.translate(Array.of(0,0,0,0,0,0),U,[-R,-D]),this.transform(p,U);}},{key:"skew",value:function skew(p,_ref42){var _ref43=_slicedToArray(_ref42,2),S=_ref43[0],_ref43$=_ref43[1],E=_ref43$===void 0?S:_ref43$;var _ref44=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref45=_slicedToArray(_ref44,2),R=_ref45[0],D=_ref45[1];var U=r.mat2d.create();return U=r.mat2d.translate(Array.of(0,0,0,0,0,0),U,[R,D]),U=r.mat2d.multiply(Array.of(0,0,0,0,0,0),U,r.mat2d.fromValues(1,Math.tan(E),Math.tan(S),1,0,0)),U=r.mat2d.translate(Array.of(0,0,0,0,0,0),U,[-R,-D]),this.transform(p,U);}},{key:"isPointCollision",value:function isPointCollision(p,_ref46){var _this$v;var _ref47=_slicedToArray(_ref46,2),S=_ref47[0],E=_ref47[1];var R=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"both";var D=this.getTransform(p),U=Object(s.transformPoint)([S,E],r.mat2d.invert(Array.of(0,0,0,0,0,0),D));return(_this$v=this[v]).isPointCollision.apply(_this$v,_toConsumableArray(U).concat([R]));}},{key:"isPointInFill",value:function isPointInFill(p,_ref48){var _ref49=_slicedToArray(_ref48,2),S=_ref49[0],E=_ref49[1];return this.isPointCollision(p,[S,E],"fill");}},{key:"isPointInStroke",value:function isPointInStroke(p,_ref50){var _ref51=_slicedToArray(_ref50,2),S=_ref51[0],E=_ref51[1];return this.isPointCollision(p,[S,E],"stroke");}}]);}();},/* 30 *//***/function(i,e,t){t.r(e),t.d(e,"multiply",function(){return n;}),t.d(e,"grayscale",function(){return s;}),t.d(e,"brightness",function(){return c;}),t.d(e,"saturate",function(){return l;}),t.d(e,"contrast",function(){return f;}),t.d(e,"invert",function(){return u;}),t.d(e,"sepia",function(){return v;}),t.d(e,"opacity",function(){return h;}),t.d(e,"hueRotate",function(){return y;});var r=t(26);t(1).glMatrix.setMatrixArrayType(Array);function n(T,O){var I=[],P=T[0],w=T[1],d=T[2],m=T[3],p=T[4],S=T[5],E=T[6],R=T[7],D=T[8],U=T[9],M=T[10],W=T[11],$=T[12],B=T[13],N=T[14],z=T[15],J=T[16],et=T[17],at=T[18],ct=T[19];var V=O[0],Q=O[1],ft=O[2],mt=O[3],yt=O[4];return I[0]=V*P+Q*S+ft*M+mt*z,I[1]=V*w+Q*E+ft*W+mt*J,I[2]=V*d+Q*R+ft*$+mt*et,I[3]=V*m+Q*D+ft*B+mt*at,I[4]=V*p+Q*U+ft*N+mt*ct+yt,V=O[5],Q=O[6],ft=O[7],mt=O[8],yt=O[9],I[5]=V*P+Q*S+ft*M+mt*z,I[6]=V*w+Q*E+ft*W+mt*J,I[7]=V*d+Q*R+ft*$+mt*et,I[8]=V*m+Q*D+ft*B+mt*at,I[9]=V*p+Q*U+ft*N+mt*ct+yt,V=O[10],Q=O[11],ft=O[12],mt=O[13],yt=O[14],I[10]=V*P+Q*S+ft*M+mt*z,I[11]=V*w+Q*E+ft*W+mt*J,I[12]=V*d+Q*R+ft*$+mt*et,I[13]=V*m+Q*D+ft*B+mt*at,I[14]=V*p+Q*U+ft*N+mt*ct+yt,V=O[15],Q=O[16],ft=O[17],mt=O[18],yt=O[19],I[15]=V*P+Q*S+ft*M+mt*z,I[16]=V*w+Q*E+ft*W+mt*J,I[17]=V*d+Q*R+ft*$+mt*et,I[18]=V*m+Q*D+ft*B+mt*at,I[19]=V*p+Q*U+ft*N+mt*ct+yt,I;}function s(T){T=Object(r.clamp)(0,1,T);var O=0.2126*T,I=0.7152*T,P=0.0722*T;return[O+1-T,I,P,0,0,O,I+1-T,P,0,0,O,I,P+1-T,0,0,0,0,0,1,0];}function c(T){return[T,0,0,0,0,0,T,0,0,0,0,0,T,0,0,0,0,0,1,0];}function l(T){var O=0.2126*(1-T),I=0.7152*(1-T),P=0.0722*(1-T);return[O+T,I,P,0,0,O,I+T,P,0,0,O,I,P+T,0,0,0,0,0,1,0];}function f(T){var O=0.5*(1-T);return[T,0,0,0,O,0,T,0,0,O,0,0,T,0,O,0,0,0,1,0];}function u(T){var O=1-2*T;return[O,0,0,0,T,0,O,0,0,T,0,0,O,0,T,0,0,0,1,0];}function v(T){return[1-0.607*T,0.769*T,0.189*T,0,0,0.349*T,1-0.314*T,0.168*T,0,0,0.272*T,0.534*T,1-0.869*T,0,0,0,0,0,1,0];}function h(T){return[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,T,0];}function y(T){var O=T/180*Math.PI,I=Math.cos(O),P=Math.sin(O),w=0.2126,d=0.7152,m=0.0722;return[w+I*(1-w)+P*-w,d+I*-d+P*-d,m+I*-m+P*(1-m),0,0,w+I*-w+P*0.143,d+I*(1-d)+P*0.14,m+I*-m+P*-0.283,0,0,w+I*-w+P*-0.7874,d+I*-d+P*d,m+I*(1-m)+P*m,0,0,0,0,0,1,0];}},/* 31 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return s;});var r=t(32),n=/* @__PURE__ */t.n(r);t(1).glMatrix.setMatrixArrayType(Array);function s(c){var l=n()(c);if(!l||!l.length)throw new TypeError("Invalid color value.");return[l[0]/255,l[1]/255,l[2]/255,l[3]];}},/* 32 *//***/function(i,e,t){var r=t(33),n=t(37),s=t(39);i.exports=function(l){var f,u=r(l);return u.space?(f=Array(3),f[0]=s(u.values[0],0,255),f[1]=s(u.values[1],0,255),f[2]=s(u.values[2],0,255),u.space[0]==="h"&&(f=n.rgb(f)),f.push(s(u.alpha,0,1)),f):[];};},/* 33 *//***/function(i,e,t){(function(r){var n=t(34),s=t(35),c=t(36);i.exports=f;var l={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function f(u){var v,h=[],y=1,T;if(typeof u=="string"){if(n[u])h=n[u].slice(),T="rgb";else if(u==="transparent")y=0,T="rgb",h=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(u)){var O=u.slice(1),I=O.length,P=I<=4;y=1,P?(h=[parseInt(O[0]+O[0],16),parseInt(O[1]+O[1],16),parseInt(O[2]+O[2],16)],I===4&&(y=parseInt(O[3]+O[3],16)/255)):(h=[parseInt(O[0]+O[1],16),parseInt(O[2]+O[3],16),parseInt(O[4]+O[5],16)],I===8&&(y=parseInt(O[6]+O[7],16)/255)),h[0]||(h[0]=0),h[1]||(h[1]=0),h[2]||(h[2]=0),T="rgb";}else if(v=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(u)){var w=v[1],d=w==="rgb",O=w.replace(/a$/,"");T=O;var I=O==="cmyk"?4:O==="gray"?1:3;h=v[2].trim().split(/\s*,\s*/).map(function(E,R){if(/%$/.test(E))return R===I?parseFloat(E)/100:O==="rgb"?parseFloat(E)*255/100:parseFloat(E);if(O[R]==="h"){if(/deg$/.test(E))return parseFloat(E);if(l[E]!==void 0)return l[E];}return parseFloat(E);}),w===O&&h.push(1),y=d||h[I]===void 0?1:h[I],h=h.slice(0,I);}else u.length>10&&/[0-9](?:\s|\/)/.test(u)&&(h=u.match(/([0-9]+)/g).map(function(p){return parseFloat(p);}),T=u.match(/([a-z])/ig).join("").toLowerCase());}else if(!isNaN(u))T="rgb",h=[u>>>16,(u&65280)>>>8,u&255];else if(s(u)){var m=c(u.r,u.red,u.R,null);m!==null?(T="rgb",h=[m,c(u.g,u.green,u.G),c(u.b,u.blue,u.B)]):(T="hsl",h=[c(u.h,u.hue,u.H),c(u.s,u.saturation,u.S),c(u.l,u.lightness,u.L,u.b,u.brightness)]),y=c(u.a,u.alpha,u.opacity,1),u.opacity!=null&&(y/=100);}else(Array.isArray(u)||r.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(u))&&(h=[u[0],u[1],u[2]],T="rgb",y=u.length===4?u[3]:1);return{space:T,values:h,alpha:y};}}).call(this,t(22));},/* 34 *//***/function(i,e,t){i.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};},/* 35 *//***/function(i,e,t){var r=Object.prototype.toString;i.exports=function(n){var s;return r.call(n)==="[object Object]"&&(s=Object.getPrototypeOf(n),s===null||s===Object.getPrototypeOf({}));};},/* 36 *//***/function(i,e){i.exports=function(){for(var t=0;t<arguments.length;t++)if(arguments[t]!==void 0)return arguments[t];};},/* 37 *//***/function(i,e,t){var r=t(38);i.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function rgb(n){var s=n[0]/360,c=n[1]/100,l=n[2]/100,f,u,v,h,y;if(c===0)return y=l*255,[y,y,y];l<0.5?u=l*(1+c):u=l+c-l*c,f=2*l-u,h=[0,0,0];for(var T=0;T<3;T++)v=s+0.3333333333333333*-(T-1),v<0?v++:v>1&&v--,6*v<1?y=f+(u-f)*6*v:2*v<1?y=u:3*v<2?y=f+(u-f)*(0.6666666666666666-v)*6:y=f,h[T]=y*255;return h;}},r.hsl=function(n){var s=n[0]/255,c=n[1]/255,l=n[2]/255,f=Math.min(s,c,l),u=Math.max(s,c,l),v=u-f,h,y,T;return u===f?h=0:s===u?h=(c-l)/v:c===u?h=2+(l-s)/v:l===u&&(h=4+(s-c)/v),h=Math.min(h*60,360),h<0&&(h+=360),T=(f+u)/2,u===f?y=0:T<=0.5?y=v/(u+f):y=v/(2-u-f),[h,y*100,T*100];};},/* 38 *//***/function(i,e,t){i.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]};},/* 39 *//***/function(i,e){i.exports=t;function t(r,n,s){return n<s?r<n?n:r>s?s:r:r<s?s:r>n?n:r;}},/* 40 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return m;});var r=t(41),n=/* @__PURE__ */t.n(r),s=t(42),c=/* @__PURE__ */t.n(s),l=t(43),f=/* @__PURE__ */t.n(l),u=t(44),v=t(46),h=/* @__PURE__ */t.n(v),y=t(53),T=t(55);t(1).glMatrix.setMatrixArrayType(Array);var O=Symbol("contours"),I=Symbol("path"),P=Symbol("simplify"),w=Symbol("scale"),d=2*Math.PI;var m=/*#__PURE__*/function(){function m(){var S=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,m);typeof S=="string"&&(S={path:S}),S.path?this[I]=n()(S.path):this[I]=[],this[O]=null,this[P]=S.simplify!=null?S.simplify:0,this[w]=S.scale!=null?S.scale:2;}return _createClass(m,[{key:"contours",get:function get(){var S=null;if(!this[O]&&this[I]){var E=Object(u["default"])(f()(this[I]));this[O]=h()(E,this[w],this[P]),this[O].path=E,this[O].simplify=this[P],this[O].scale=this[w];}return this[O]&&(S=this[O].map(function(E){return _toConsumableArray(E);}),S.path=this[O].path,S.simplify=this[O].simplify,S.scale=this[O].scale),S;}},{key:"path",get:function get(){return this[I];}},{key:"simplify",get:function get(){return this[P];}},{key:"boundingBox",get:function get(){var S=this.contours;if(S&&S.length){var E=S.reduce(function(R,D){return[].concat(_toConsumableArray(R),_toConsumableArray(D));});return c()(E);}return[[0,0],[0,0]];}},{key:"boundingCenter",get:function get(){var S=this.boundingBox;return S?[0.5*(S[0][0]+S[1][0]),0.5*(S[0][1]+S[1][1])]:[0,0];}},{key:"normalize",value:function normalize(){var _this$I;var S=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var E=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var R=Object(u["default"])(f()(this[I])).map(function(_ref52){var _ref53=_toArray(_ref52),D=_ref53[0],U=_arrayLikeToArray(_ref53).slice(1);var M=[D];for(var W=0;W<U.length;W+=2){var $=U[W]-S,B=U[W+1]-E;M.push($,B);}return M;});return this.beginPath(),(_this$I=this[I]).push.apply(_this$I,_toConsumableArray(R)),this;}},{key:"getPointAtLength",value:function getPointAtLength(S){return this.contours?Object(y.getPointAtLength)(this[O],S):null;}},{key:"getTotalLength",value:function getTotalLength(){return this.contours?Object(y.getTotalLength)(this[O]):0;}},{key:"addPath",value:function addPath(S){var _this$I2;this[O]=null,typeof S=="string"&&(S=n()(S)),(_this$I2=this[I]).push.apply(_this$I2,_toConsumableArray(S));}},{key:"beginPath",value:function beginPath(){this[I]=[],this[O]=null;}},{key:"clear",value:function clear(){this.beginPath();}},{key:"ellipse",value:function ellipse(S,E,R,D,U,M,W){var $=arguments.length>7&&arguments[7]!==undefined?arguments[7]:0;if(M+=U,W+=U,R<=0||D<=0||W===M)return;W<M&&(W=M+d+(W-M)%d),W-M>d&&(W=M+d);var B=W-M;B>=d&&(W-=1e-3);var N=this[I].length>0&&B<d?"L":"M";var z=Object(T.getPoint)(S,E,R,D,M),J=Object(T.getPoint)(S,E,R,D,W),et=+!$;var at=B>Math.PI?1:0;$&&(at=1-at),N+=z.join(" "),N+="A".concat(R," ").concat(D," 0 ").concat(at," ").concat(et," ").concat(J.join(" ")),B>=d&&(N+="Z"),this.addPath(N);}},{key:"arc",value:function arc(S,E,R,D,U){var M=arguments.length>5&&arguments[5]!==undefined?arguments[5]:0;return this.ellipse(S,E,R,R,0,D,U,M);}},{key:"arcTo",value:function arcTo(S,E,R,D,U,M,W){this[O]=null,this[I].push(["A",S,E,R,D,U,M,W]);}},{key:"moveTo",value:function moveTo(S,E){this[O]=null,this[I].push(["M",S,E]);}},{key:"lineTo",value:function lineTo(S,E){this[O]=null,this[I].push(["L",S,E]);}},{key:"bezierCurveTo",value:function bezierCurveTo(S,E,R,D,U,M){this[O]=null,this[I].push(["C",S,E,R,D,U,M]);}},{key:"quadraticCurveTo",value:function quadraticCurveTo(S,E,R,D){this[O]=null,this[I].push(["Q",S,E,R,D]);}},{key:"rect",value:function rect(S,E,R,D){var U="M".concat(S," ").concat(E,"L").concat(S+R," ").concat(E,"L").concat(S+R," ").concat(E+D,"L").concat(S," ").concat(E+D,"Z");this.addPath(U);}},{key:"closePath",value:function closePath(){this[O]=null;var S=[];var E=this[I].length;E>0&&(S=this[I][E-1]),S[0]!=="Z"&&S[0]!=="z"&&this[I].push(["Z"]);}}]);}();},/* 41 *//***/function(i,e){i.exports=n;var t={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},r=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function n(l){var f=[];return l.replace(r,function(u,v,h){var y=v.toLowerCase();for(h=c(h),y=="m"&&h.length>2&&(f.push([v].concat(h.splice(0,2))),y="l",v=v=="m"?"l":"L");;){if(h.length==t[y])return h.unshift(v),f.push(h);if(h.length<t[y])throw new Error("malformed path data");f.push([v].concat(h.splice(0,t[y])));}}),f;}var s=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function c(l){var f=l.match(s);return f?f.map(Number):[];}},/* 42 *//***/function(i,e,t){i.exports=r;function r(n){var s=n.length;if(s===0)return[[],[]];for(var c=n[0].length,l=n[0].slice(),f=n[0].slice(),u=1;u<s;++u)for(var v=n[u],h=0;h<c;++h){var y=v[h];l[h]=Math.min(l[h],y),f[h]=Math.max(f[h],y);}return[l,f];}},/* 43 *//***/function(i,e){i.exports=t;function t(r){var n=0,s=0,c=0,l=0;return r.map(function(f){f=f.slice();var u=f[0],v=u.toUpperCase();if(u!=v)switch(f[0]=v,u){case"a":f[6]+=c,f[7]+=l;break;case"v":f[1]+=l;break;case"h":f[1]+=c;break;default:for(var h=1;h<f.length;)f[h++]+=c,f[h++]+=l;}switch(v){case"Z":c=n,l=s;break;case"H":c=f[1];break;case"V":l=f[1];break;case"M":c=n=f[1],l=s=f[2];break;default:c=f[f.length-2],l=f[f.length-1];}return f;});}},/* 44 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return n;});var r=t(45);t(1).glMatrix.setMatrixArrayType(Array);function n(l){for(var f,u=[],v=0,h=0,y=0,T=0,O=null,I=null,P=0,w=0,d=0,m=l.length;d<m;d++){var p=l[d],S=p[0];switch(S){case"M":y=p[1],T=p[2];break;case"A":var E=Object(r["default"])(P,w,p[6],p[7],p[4],p[5],p[1],p[2],p[3]);if(!E.length)continue;E=E.map(function(W){var _W7=_slicedToArray(W,8),$=_W7[0],B=_W7[1],N=_W7[2],z=_W7[3],J=_W7[4],et=_W7[5],at=_W7[6],ct=_W7[7];return{x1:N,y1:z,x2:J,y2:et,x:at,y:ct};});for(var R=0,D;R<E.length;R++)D=E[R],p=["C",D.x1,D.y1,D.x2,D.y2,D.x,D.y],R<E.length-1&&u.push(p);break;case"S":var U=P,M=w;(f=="C"||f=="S")&&(U+=U-v,M+=M-h),p=["C",U,M,p[1],p[2],p[3],p[4]];break;case"T":f=="Q"||f=="T"?(O=P*2-O,I=w*2-I):(O=P,I=w),p=c(P,w,O,I,p[1],p[2]);break;case"Q":O=p[1],I=p[2],p=c(P,w,p[1],p[2],p[3],p[4]);break;case"L":p=s(P,w,p[1],p[2]);break;case"H":p=s(P,w,p[1],w);break;case"V":p=s(P,w,P,p[1]);break;case"Z":p=s(P,w,y,T);break;}f=S,P=p[p.length-2],w=p[p.length-1],p.length>4?(v=p[p.length-4],h=p[p.length-3]):(v=P,h=w),u.push(p);}return u;}function s(l,f,u,v){return["C",l,f,u,v,u,v];}function c(l,f,u,v,h,y){return["C",l/3+0.6666666666666666*u,f/3+0.6666666666666666*v,h/3+0.6666666666666666*u,y/3+0.6666666666666666*v,h,y];}},/* 45 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return l;}),t(1).glMatrix.setMatrixArrayType(Array);var r=Math.PI*2;function n(f,u,v,h){var y=f*h-u*v<0?-1:1;var T=f*v+u*h;return T>1&&(T=1),T<-1&&(T=-1),y*Math.acos(T);}function s(f,u,v,h,y,T,O,I,P,w){var d=w*(f-v)/2+P*(u-h)/2,m=-P*(f-v)/2+w*(u-h)/2,p=O*O,S=I*I,E=d*d,R=m*m;var D=p*S-p*R-S*E;D<0&&(D=0),D/=p*R+S*E,D=Math.sqrt(D)*(y===T?-1:1);var U=D*O/I*m,M=D*-I/O*d,W=w*U-P*M+(f+v)/2,$=P*U+w*M+(u+h)/2,B=(d-U)/O,N=(m-M)/I,z=(-d-U)/O,J=(-m-M)/I,et=n(1,0,B,N);var at=n(B,N,z,J);return T===0&&at>0&&(at-=r),T===1&&at<0&&(at+=r),[W,$,et,at];}function c(f,u){var v=1.3333333333333333*Math.tan(u/4),h=Math.cos(f),y=Math.sin(f),T=Math.cos(f+u),O=Math.sin(f+u);return[h,y,h-y*v,y+h*v,T+O*v,O-T*v,T,O];}function l(f,u,v,h,y,T,O,I,P){var w=Math.sin(P*r/360),d=Math.cos(P*r/360),m=d*(f-v)/2+w*(u-h)/2,p=-w*(f-v)/2+d*(u-h)/2;if(m===0&&p===0)return[];if(O===0||I===0)return[];O=Math.abs(O),I=Math.abs(I);var S=m*m/(O*O)+p*p/(I*I);S>1&&(O*=Math.sqrt(S),I*=Math.sqrt(S));var E=s(f,u,v,h,y,T,O,I,w,d),R=[];var D=E[2],U=E[3];var M=Math.max(Math.ceil(Math.abs(U)/(r/4)),1);U/=M;for(var W=0;W<M;W++)R.push(c(D,U)),D+=U;return R.map(function(W){for(var $=0;$<W.length;$+=2){var B=W[$+0],N=W[$+1];B*=O,N*=I;var z=d*B-w*N,J=w*B+d*N;W[$+0]=z+E[0],W[$+1]=J+E[1];}return W;});}},/* 46 *//***/function(i,e,t){t(1).glMatrix.setMatrixArrayType(Array);var r=t(47),_t8=t(49),n=_t8.copy,s=t(50);function c(h,y,T){return h[0]=y,h[1]=T,h;}var l=[0,0],f=[0,0],u=[0,0];function v(h,y,T,O){r(T,c(l,O[1],O[2]),c(f,O[3],O[4]),c(u,O[5],O[6]),y,h);}i.exports=function(y,T,O){var I=[],P=[],w=[0,0];return y.forEach(function(d,m,p){if(d[0]==="M")n(w,d.slice(1)),P.length>0&&(I.push(P),P=[]);else if(d[0]==="C")v(P,T,w,d),c(w,d[5],d[6]);else throw new Error("illegal type in SVG: "+d[0]);}),P.length>0&&I.push(P),I.map(function(d){return s(d,O||0);});};},/* 47 *//***/function(i,e,t){i.exports=t(48)();},/* 48 *//***/function(i,e){function t(n){return[n[0],n[1]];}function r(n,s){return[n,s];}i.exports=function(s){s=s||{};var c=typeof s.recursion=="number"?s.recursion:8,l=typeof s.epsilon=="number"?s.epsilon:11920929e-14,f=typeof s.pathEpsilon=="number"?s.pathEpsilon:1,u=typeof s.angleEpsilon=="number"?s.angleEpsilon:0.01,v=s.angleTolerance||0,h=s.cuspLimit||0;return function(I,P,w,d,m,p){p||(p=[]),m=typeof m=="number"?m:1;var S=f/m;return S*=S,y(I,P,w,d,p,S),p;};function y(O,I,P,w,d,m){d.push(t(O));var p=O[0],S=O[1],E=I[0],R=I[1],D=P[0],U=P[1],M=w[0],W=w[1];T(p,S,E,R,D,U,M,W,d,m,0),d.push(t(w));}function T(O,I,P,w,d,m,p,S,E,R,D){if(!(D>c)){var U=Math.PI,M=(O+P)/2,W=(I+w)/2,$=(P+d)/2,B=(w+m)/2,N=(d+p)/2,z=(m+S)/2,J=(M+$)/2,et=(W+B)/2,at=($+N)/2,ct=(B+z)/2,V=(J+at)/2,Q=(et+ct)/2;if(D>0){var ft=p-O,mt=S-I,yt=Math.abs((P-p)*mt-(w-S)*ft),At=Math.abs((d-p)*mt-(m-S)*ft),ht,Nt;if(yt>l&&At>l){if((yt+At)*(yt+At)<=R*(ft*ft+mt*mt)){if(v<u){E.push(r(V,Q));return;}var Bt=Math.atan2(m-w,d-P);if(ht=Math.abs(Bt-Math.atan2(w-I,P-O)),Nt=Math.abs(Math.atan2(S-m,p-d)-Bt),ht>=U&&(ht=2*U-ht),Nt>=U&&(Nt=2*U-Nt),ht+Nt<v){E.push(r(V,Q));return;}if(h!==0){if(ht>h){E.push(r(P,w));return;}if(Nt>h){E.push(r(d,m));return;}}}}else if(yt>l){if(yt*yt<=R*(ft*ft+mt*mt)){if(v<u){E.push(r(V,Q));return;}if(ht=Math.abs(Math.atan2(m-w,d-P)-Math.atan2(w-I,P-O)),ht>=U&&(ht=2*U-ht),ht<v){E.push(r(P,w)),E.push(r(d,m));return;}if(h!==0&&ht>h){E.push(r(P,w));return;}}}else if(At>l){if(At*At<=R*(ft*ft+mt*mt)){if(v<u){E.push(r(V,Q));return;}if(ht=Math.abs(Math.atan2(S-m,p-d)-Math.atan2(m-w,d-P)),ht>=U&&(ht=2*U-ht),ht<v){E.push(r(P,w)),E.push(r(d,m));return;}if(h!==0&&ht>h){E.push(r(d,m));return;}}}else if(ft=V-(O+p)/2,mt=Q-(I+S)/2,ft*ft+mt*mt<=R){E.push(r(V,Q));return;}}T(O,I,M,W,J,et,V,Q,E,R,D+1),T(V,Q,at,ct,N,z,p,S,E,R,D+1);}}};},/* 49 *//***/function(i,e,t){t.r(e),t.d(e,"create",function(){return s;}),t.d(e,"clone",function(){return n;}),t.d(e,"copy",function(){return c;}),t.d(e,"scaleAndAdd",function(){return l;}),t.d(e,"dot",function(){return f;}),t.d(e,"rotate",function(){return u;}),t.d(e,"cross",function(){return v;}),t.d(e,"sub",function(){return h;}),t.d(e,"add",function(){return y;}),t.d(e,"computeMiter",function(){return P;}),t.d(e,"normal",function(){return w;}),t.d(e,"direction",function(){return d;});var r=t(1);t(1).glMatrix.setMatrixArrayType(Array);function n(m){return[m[0],m[1]];}function s(){return[0,0];}var c=r.vec2.copy,l=r.vec2.scaleAndAdd,f=r.vec2.dot,u=r.vec2.rotate,v=r.vec2.cross,h=r.vec2.sub,y=r.vec2.add,T=r.vec2.normalize,O=r.vec2.set,I=s();function P(m,p,S,E,R){y(m,S,E),T(m,m),O(p,-m[1],m[0]),O(I,-S[1],S[0]);var D=R/f(p,I);return Math.abs(D);}function w(m,p){return O(m,-p[1],p[0]),m;}function d(m,p,S){return h(m,p,S),T(m,m),m;}},/* 50 *//***/function(i,e,t){var r=t(51),n=t(52);i.exports=function(c,l){return c=r(c,l),c=n(c,l),c;},i.exports.radialDistance=r,i.exports.douglasPeucker=n;},/* 51 *//***/function(i,e){function t(r,n){var s=r[0]-n[0],c=r[1]-n[1];return s*s+c*c;}i.exports=function(n,s){if(n.length<=1)return n;s=typeof s=="number"?s:1;for(var c=s*s,l=n[0],f=[l],u,v=1,h=n.length;v<h;v++)u=n[v],t(u,l)>c&&(f.push(u),l=u);return l!==u&&f.push(u),f;};},/* 52 *//***/function(i,e){function t(n,s,c){var l=s[0],f=s[1],u=c[0]-l,v=c[1]-f;if(u!==0||v!==0){var h=((n[0]-l)*u+(n[1]-f)*v)/(u*u+v*v);h>1?(l=c[0],f=c[1]):h>0&&(l+=u*h,f+=v*h);}return u=n[0]-l,v=n[1]-f,u*u+v*v;}function r(n,s,c,l,f){for(var u=l,v,h=s+1;h<c;h++){var y=t(n[h],n[s],n[c]);y>u&&(v=h,u=y);}u>l&&(v-s>1&&r(n,s,v,l,f),f.push(n[v]),c-v>1&&r(n,v,c,l,f));}i.exports=function(s,c){if(s.length<=1)return s;c=typeof c=="number"?c:1;var l=c*c,f=s.length-1,u=[s[0]];return r(s,0,f,l,u),u.push(s[f]),u;};},/* 53 *//***/function(i,e,t){t.r(e),t.d(e,"getTotalLength",function(){return n;}),t.d(e,"getPointAtLength",function(){return c;}),t.d(e,"getDashContours",function(){return l;});var r=t(54);t(1).glMatrix.setMatrixArrayType(Array);function n(f){if(f.totalLength!=null)return f.totalLength;var u=0;return f.forEach(function(v){var h=v[0];for(var y=1;y<v.length;y++){var T=v[y];u+=Object(r.distance)(h,T),h=T;}}),f.totalLength=u,u;}function s(f,u){var v=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;if(u=Number(u),!Number.isFinite(u))throw new TypeError("Failed to execute 'getPointAtLength' on figure: The provided float value is non-finite.");if(u<=0)throw new TypeError("Length must > 0");var h=n(f);if(u>=h){var T=f[f.length-1],O=T[T.length-2],I=T[T.length-1],P=Math.atan2(I[1]-O[1],I[0]-O[0]);return{current:f.map(function(w){return _toConsumableArray(w);}),point:{x:I[0],y:I[1],angle:P}};}var y=[];for(var _T3=0;_T3<f.length;_T3++){y[_T3]=[];var _O2=f[_T3];var _I3=_O2[0];for(var _P5=1;_P5<_O2.length;_P5++){var _w9=_O2[_P5],_d9=Object(r.distance)(_I3,_w9);if(u<_d9){var m=u/_d9,p=Math.atan2(_w9[1]-_I3[1],_w9[0]-_I3[0]),S={x:_I3[0]*(1-m)+_w9[0]*m,y:_I3[1]*(1-m)+_w9[1]*m,angle:p};if(y[_T3].push(_I3),u>0&&y[_T3].push([S.x,S.y]),!v)return{current:y,point:S};var E=[],R=_T3;for(;_T3<f.length;_T3++){for(E[_T3-R]=[],_T3===R&&E[0].push([S.x,S.y]);_P5<_O2.length;_P5++)E[_T3-R].push(_O2[_P5]);_P5=0;}return{current:y,point:S,rest:E};}u-=_d9,y[_T3].push(_I3),_I3=_w9;}}}function c(f,u){if(u=Number(u),!Number.isFinite(u))throw new TypeError("Failed to execute 'getPointAtLength' on figure: The provided float value is non-finite.");if(f.length<=0)return{x:0,y:0,angle:0};if(u<=0){var v=f[0][0],h=f[0][1],y=Math.atan2(h[1]-v[1],h[0]-v[0]);return{x:v[0],y:v[1],angle:y};}return s(f,u,!1).point;}function l(f,u,v){var h=0,y=u[0],T=f;var O=[],I=u.length;if(v>0){do v-=u[h%I],h++;while(v>0);v<0&&(y=-v,h--);}else if(v<0){h=-1;do v+=u[h%I+I-1],h--;while(v<0);v>=0&&(h++,y=u[h%I+I-1]-v);}do{var P=s(T,y);T=P.rest,++h%2&&O.push.apply(O,_toConsumableArray(P.current));var _w0=h%I;_w0<0&&(_w0+=I),y=u[_w0];}while(T);return O;}},/* 54 *//***/function(i,e,t){t.r(e),t.d(e,"normalize",function(){return r;}),t.d(e,"distance",function(){return n;}),t(1).glMatrix.setMatrixArrayType(Array);function r(_ref54,f,u,v){var _ref55=_slicedToArray(_ref54,3),s=_ref55[0],c=_ref55[1],l=_ref55[2];return s=s*2/f-1,c=1-c*2/u,Number.isFinite(v)?(l=l*2/v-1,[s,c,l]):[s,c];}function n(_ref56,_ref57){var _ref58=_slicedToArray(_ref56,3),s=_ref58[0],c=_ref58[1],_ref58$=_ref58[2],l=_ref58$===void 0?0:_ref58$;var _ref59=_slicedToArray(_ref57,3),f=_ref59[0],u=_ref59[1],_ref59$=_ref59[2],v=_ref59$===void 0?0:_ref59$;return Math.hypot(f-s,u-c,v-l);}},/* 55 *//***/function(i,e,t){t.r(e),t.d(e,"getPoint",function(){return n;}),t(1).glMatrix.setMatrixArrayType(Array);var r=Math.PI*2;function n(s,c,l,f,u){u%=r,u<0&&(u+=r);var v=Math.tan(u);if(Math.abs(v)<1e5){var h=c-v*s,y=1/Math.pow(l,2)+Math.pow(v,2)/Math.pow(f,2);var T=-1;(u<=Math.PI/2||u>3*Math.PI/2)&&(T=1);var O=T*Math.sqrt(1/y)+s,I=v*O+h;return[O,I];}return u<Math.PI?[s,c+f]:[s,c-f];}},/* 56 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return rt;});var r=t(1),n=t(42),s=/* @__PURE__ */t.n(n),c=t(57),l=t(28),f=t(24),u=t(30),v=t(59),h=t(53),y=t(60),T=/* @__PURE__ */t.n(y),O=t(46),I=/* @__PURE__ */t.n(O),P=t(31),w=t(40),d=t(21);t(1).glMatrix.setMatrixArrayType(Array);function m(nt,Y){if(nt==null)return{};var Z=p(nt,Y),C,L;if(Object.getOwnPropertySymbols){var X=Object.getOwnPropertySymbols(nt);for(L=0;L<X.length;L++)C=X[L],!(Y.indexOf(C)>=0)&&Object.prototype.propertyIsEnumerable.call(nt,C)&&(Z[C]=nt[C]);}return Z;}function p(nt,Y){if(nt==null)return{};var Z={},C=Object.keys(nt),L,X;for(X=0;X<C.length;X++)L=C[X],!(Y.indexOf(L)>=0)&&(Z[L]=nt[L]);return Z;}var S=Symbol("mesh"),E=Symbol("contours"),R=Symbol("stroke"),D=Symbol("fill"),U=Symbol("strokeColor"),M=Symbol("fillColor"),W=Symbol("transform"),$=Symbol("invertTransform"),B=Symbol("uniforms"),N=Symbol("texOptions"),z=Symbol("blend"),J=Symbol("applyTexture"),et=Symbol("applyTransform"),at=Symbol("applyGradientTransform"),ct=Symbol("applyProgram"),V=Symbol("gradient"),Q=Symbol("filter"),ft=Symbol("opacity"),mt=Symbol("program"),yt=Symbol("attributes"),At=Symbol("pass"),ht=Symbol("clipContext"),Nt=Symbol("applyClipPath");function Bt(nt,Y){var Z=nt[1][0]-nt[0][0],C=nt[1][1]-nt[0][1],L=[];for(var X=0;X<Y.length;X++){var K=Y[X],q=[(K[0]-nt[0][0])/Z,1-(K[1]-nt[0][1])/C];L.push(q);}return L;}function G(_ref60,_ref61,_ref62){var _ref63=_slicedToArray(_ref60,2),nt=_ref63[0],Y=_ref63[1];var _ref64=_slicedToArray(_ref61,4),Z=_ref64[0],C=_ref64[1],L=_ref64[2],X=_ref64[3];var K=_ref62.scale;return K||(nt/=L,Y=1-Y/X,nt-=Z,Y+=C),[nt,Y,0];}function k(nt,Y,Z){var C=I()(nt,Y,Z);return C.path=nt,C.simplify=Z,C.scale=Y,C;}var rt=/*#__PURE__*/function(){function rt(Y){_classCallCheck(this,rt);this[R]=null,this[D]=null,this[W]=[1,0,0,1,0,0],this[ft]=1,this[B]={},this[Q]=[],this[z]=null,this[N]={},this.contours=Y.contours,this[mt]=null,this[yt]={},this[At]=[];}return _createClass(rt,[{key:"contours",get:function get(){return this[E];},set:function set(Y){this[S]=null,this[E]=Y;var Z=Y.scale;this.transformScale/Z>1.5&&this.accurate(this.transformScale);}},{key:"setProgram",value:function setProgram(Y){this[mt]=Y,this[S]&&this[ct](Y);}},{key:"program",get:function get(){return this[mt];}},{key:"setAttribute",value:function setAttribute(Y,Z){Z==null?delete this[yt][Y]:this[yt][Y]=Z;}},{key:"getOpacity",value:function getOpacity(){return this[ft];}},{key:"setOpacity",value:function setOpacity(Y){if(Y<0||Y>1)throw new TypeError("Invalid opacity value.");this[S]&&this[S].positions.forEach(function(Z){Z[2]=1/Z[2]>0?Y:-Y;}),this[ft]=Y;}},{key:"setClipPath",value:function setClipPath(Y){this.clipPath=Y,this[B].u_clipSampler&&this[B].u_clipSampler["delete"](),this.setUniforms({u_clipSampler:null}),this[S]&&delete this[S].attributes.a_clipUV,Y&&this[S]&&this[Nt]();}},{key:Nt,value:function value(){if(this.clipPath){this[ht]||(this[ht]=d["default"].createCanvas(1,1));var _this$boundingBox=_slicedToArray(this.boundingBox,2),_this$boundingBox$=_slicedToArray(_this$boundingBox[0],2),Y=_this$boundingBox$[0],Z=_this$boundingBox$[1],_this$boundingBox$2=_slicedToArray(_this$boundingBox[1],2),C=_this$boundingBox$2[0],L=_this$boundingBox$2[1];C&&L&&(this[ht].width=C-Y,this[ht].height=L-Z);var X=this[ht].getContext("2d"),K=new Path2D(this.clipPath);X.clearRect(0,0,this[ht].width,this[ht].height),X.save(),X.translate(-Y,-Z),X.fillStyle="white",X.fill(K),X.restore(),this[S].clipPath=this[ht];var q=Bt(this.boundingBox,this[S].position0);this[S].attributes.a_clipUV=q;}}},{key:"getPointAtLength",value:function getPointAtLength(Y){return Object(h.getPointAtLength)(this[E],Y);}},{key:"getTotalLength",value:function getTotalLength(){return Object(h.getTotalLength)(this[E]);}},{key:"blend",get:function get(){return this[z]==null?"auto":this[z];},set:function set(Y){this[z]=Y,this[S]&&(this[S].enableBlend=this.enableBlend);}},{key:"boundingBox",get:function get(){if(this[S]&&this[S].boundingBox)return this[S].boundingBox;var Y=this.meshData;if(Y){var Z=Y.position0;if(Z.length)Y.boundingBox=s()(Z);else return[[0,0],[0,0]];return Y.boundingBox;}return[[0,0],[0,0]];}},{key:"boundingCenter",get:function get(){var Y=this.boundingBox;return Y?[0.5*(Y[0][0]+Y[1][0]),0.5*(Y[0][1]+Y[1][1])]:[0,0];}},{key:"fillRule",get:function get(){return this[D]?this[D].rule:"nonzero";}},{key:"lineWidth",get:function get(){return this[R]?this[R].lineWidth:0;}},{key:"lineCap",get:function get(){return this[R]?this[R].lineCap:"";}},{key:"lineJoin",get:function get(){return this[R]?this[R].lineJoin:"";}},{key:"miterLimit",get:function get(){return this[R]?this[R].miterLimit:0;}},{key:"strokeStyle",get:function get(){return this[U]&&this[U][3]!==0?Object(f["default"])(this[U]):"";}},{key:"lineDash",get:function get(){return this[R]?this[R].lineDash:null;}},{key:"lineDashOffset",get:function get(){return this[R]?this[R].lineDashOffset:0;}},{key:"fillStyle",get:function get(){return this[M]&&this[M][3]!==0?Object(f["default"])(this[M]):"";}},{key:"gradient",get:function get(){return this[V];}},{key:"texture",get:function get(){return this[B].u_texSampler?{image:this[B].u_texSampler._img,options:this[N]}:null;}},{key:"enableBlend",get:function get(){return this[z]===!0||this[z]===!1?this[z]:this[ft]<1||this[U]!=null&&this[U][3]<1||this[M]!=null&&this[M][3]<1||this[B].u_colorMatrix!=null&&this[B].u_colorMatrix[18]<1||this[B].u_radialGradientVector!=null||this.beforeRender||this.afterRender;}},{key:"filterCanvas",get:function get(){return /blur|drop-shadow|url/.test(this.filter);}},{key:"filter",get:function get(){return this[Q].join(" ");}},{key:"transformMatrix",get:function get(){return this[W];}},{key:"invertMatrix",get:function get(){if(!this[$]){var Y=r.mat2d.invert(Array.of(0,0,0,0,0,0),this[W]);this[$]=Y;}return this[$];}},{key:"transformScale",get:function get(){var Y=this[W];return Math.max(Math.hypot(Y[0],Y[1]),Math.hypot(Y[2],Y[3]));}},{key:"uniforms",get:function get(){return this[B];}},{key:"pass",get:function get(){return this[At];}},{key:ct,value:function value(Y){var Z=this[yt],C=this[S].position0,L=Object.entries(Y._attribute);for(var X=0;X<L.length;X++){var _L$X=_slicedToArray(L[X],2),K=_L$X[0],q=_L$X[1];if(K!=="a_color"&&K!=="a_sourceRect"&&q!=="ignored"){var it=Z[K];if(K==="uv"&&!it){var ut=this[S].boundingBox||s()(C);this[S].attributes[K]=Bt(ut,C);}else{this[S].attributes[K]=[];for(var _ut=0;_ut<C.length;_ut++){var St=C[_ut];this[S].attributes[K].push(it?it(St,X,C):Array(q.size).fill(0));}}}}}// {stroke, fill}
|
|
17
|
+
},{key:"meshData",get:function get(){var _this7=this;if(this._updateMatrix&&this.transformScale/this.contours.scale>1.5&&this.accurate(this.transformScale),!this[S]){!this[D]&&!this[R]&&this.setFill();var Y=this[E],Z={};if(Y&&Y.length){if(this[D])try{var X=T()(Y,this[D]);X.positions=X.positions.map(function(K){return K.push(_this7[ft]),K;}),X.attributes={a_color:Array.from({length:X.positions.length}).map(function(){return _this7[M].map(function(K){return Math.round(255*K);});})// a_sourceRect: Array.from({length: mesh.positions.length}).map(() => [0, 0, 0, 0]),
|
|
18
|
+
},Z.fill=X;}catch(_unused3){}if(this[R]){var _X=this[R].lineDash;var K=Y;if(_X){var it=this[R].lineDashOffset;K=Object(h.getDashContours)(Y,_X,it);}var q=K.map(function(it,ut){var St=it.length>1&&r.vec2.equals(it[0],it[it.length-1]),Ct=_this7[R].build(it,St);return T()([Ct]);});q.forEach(function(it){it.positions=it.positions.map(function(ut){return ut.push(-_this7[ft]),ut;}),it.attributes={a_color:Array.from({length:it.positions.length}).map(function(){return _this7[U].map(function(ut){return Math.round(255*ut);});})};}),Z.stroke=Object(l["default"])(q);}}var C=Object(l["default"])([Z.fill,Z.stroke]);C.fillPointCount=Z.fill?Z.fill.positions.length:0,C.enableBlend=this.enableBlend,C.position0=C.positions.map(function(_ref65){var _ref66=_slicedToArray(_ref65,3),X=_ref66[0],K=_ref66[1],q=_ref66[2];return[X,K,q];}),C.uniforms=this[B],this[S]=C,this[B].u_texSampler&&this[J](C,this[N]);var L=this[W];Object(v.isUnitTransform)(L)||(this[et](C,L),this[B].u_radialGradientVector&&this[at]()),this.clipPath&&this[Nt](),this[mt]&&this[ct](this[mt]);}return this._updateMatrix&&(this[S].matrix=this[W],this[et](this[S],this[W]),this[B].u_radialGradientVector&&this[at]()),this[S];}},{key:et,value:function value(Y,Z){var C=Y.positions,L=Y.position0;for(var X=0;X<C.length;X++){var _L$X2=_slicedToArray(L[X],2),K=_L$X2[0],q=_L$X2[1],it=C[X];it[0]=K*Z[0]+q*Z[2]+Z[4],it[1]=K*Z[1]+q*Z[3]+Z[5];}this._updateMatrix=!1;}},{key:at,value:function value(){var Y=this[W],Z=_toConsumableArray(this._radialGradientVector);if(Z){var _Z=_slicedToArray(Z,5),C=_Z[0],L=_Z[1],X=_Z[3],K=_Z[4];Z[0]=C*Y[0]+L*Y[2]+Y[4],Z[1]=C*Y[1]+L*Y[3]+Y[5],Z[3]=X*Y[0]+K*Y[2]+Y[4],Z[4]=X*Y[1]+K*Y[3]+Y[5],this[B].u_radialGradientVector=Z;}}},{key:J,value:function value(Y,Z){function C(ut,St){return ut==null&&St==null?!0:ut==null||St==null?!1:ut[0]===St[0]&&ut[1]===St[1]&&ut[2]===St[2]&&ut[3]===St[3];}var L=this[B].u_texSampler;if(!L)return;var _L$_img=L._img,X=_L$_img.width,K=_L$_img.height,q=Z.srcRect;var it=Z.rect||[0,0];if(Z.rotated&&(it=[-it[1],it[0],it[3],it[2]]),it[2]==null&&(it[2]=q?q[2]:X),it[3]==null&&(it[3]=q?q[3]:K),Z.hidden)Y.textureCoord=Y.positions.map(function(){return[-1,-1,-1];});else if(!Y.textureCoord||!C(this[N].rect,Z.rect)||this[N].hidden!==Z.hidden||this[N].rotated!==Z.rotated){var ut=null;Z.rotated&&(ut=r.mat2d.rotate(Array.of(0,0,0,0,0,0),r.mat2d.fromValues(1,0,0,1,0,0),0.5*Math.PI),ut=r.mat2d.translate(Array.of(0,0,0,0,0,0),ut,[0,-it[2]])),Y.textureCoord=Y.position0.map(function(_ref67){var _ref68=_slicedToArray(_ref67,3),St=_ref68[0],Ct=_ref68[1],Et=_ref68[2];if(1/Et>0){if(Z.rotated){var wt=St*ut[0]+Ct*ut[2]+ut[4],Ot=St*ut[1]+Ct*ut[3]+ut[5];St=wt;Ct=Ot;}var bt=G([St,Ct],[it[0]/it[2],it[1]/it[3],it[2],it[3]],Z);return Z.repeat&&(bt[2]=1),bt;}return[-1,-1,-1];});}if(q){var _ut2=[q[0]/X,q[1]/K,q[2]/X,q[3]/K];Y.attributes.a_sourceRect=Y.positions.map(function(){return[].concat(_ut2);});}else Y.attributes.a_sourceRect=Y.positions.map(function(){return[0,0,0,0];});}},{key:"accurate",value:function accurate(Y){if(!this.contours)return;if(this.contours.path){var C=this.contours.simplify,L=k(this.contours.path,2*Y,C);this[S]=null,this[E]=L;}}},{key:"canIgnore",value:function canIgnore(){var Y=this[R]==null||this[R].lineWidth===0||this[U][3]===0,Z=this[D]==null||this[M][3]===0,C=this[B].u_radialGradientVector==null,L=this[B].u_texSampler==null;return this[ft]===0||this[mt]==null&&Y&&Z&&C&&L&&!this.beforeRender&&!this.afterRender;}// join: 'miter' or 'bevel'
|
|
19
|
+
// cap: 'butt' or 'square'
|
|
20
|
+
// lineDash: null
|
|
21
|
+
// lineDashOffset: 0
|
|
22
|
+
},{key:"setStroke",value:function setStroke(){var _ref69=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref69$thickness=_ref69.thickness,Y=_ref69$thickness===void 0?1:_ref69$thickness,_ref69$cap=_ref69.cap,Z=_ref69$cap===void 0?"butt":_ref69$cap,_ref69$join=_ref69.join,C=_ref69$join===void 0?"miter":_ref69$join,_ref69$miterLimit=_ref69.miterLimit,L=_ref69$miterLimit===void 0?10:_ref69$miterLimit,_ref69$color=_ref69.color,X=_ref69$color===void 0?[0,0,0,0]:_ref69$color,_ref69$lineDash=_ref69.lineDash,K=_ref69$lineDash===void 0?null:_ref69$lineDash,_ref69$lineDashOffset=_ref69.lineDashOffset,q=_ref69$lineDashOffset===void 0?0:_ref69$lineDashOffset,_ref69$roundSegments=_ref69.roundSegments,it=_ref69$roundSegments===void 0?20:_ref69$roundSegments;return this[S]=null,this[R]=new c["default"]({lineWidth:Y,lineCap:Z,lineJoin:C,miterLimit:L,roundSegments:it}),typeof X=="string"&&(X=Object(P["default"])(X)),this[U]=X,this[R].lineDash=K,this[R].lineDashOffset=q,this;}},{key:"setFill",value:function setFill(){var _ref70=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref70$rule=_ref70.rule,Y=_ref70$rule===void 0?this.fillRule:_ref70$rule,_ref70$color=_ref70.color,Z=_ref70$color===void 0?[0,0,0,0]:_ref70$color;return this[S]=null,this[D]={rule:Y},typeof Z=="string"&&(Z=Object(P["default"])(Z)),this[M]=Z,this;}/**
|
|
23
|
+
options: {
|
|
24
|
+
scale: false,
|
|
25
|
+
repeat: false,
|
|
26
|
+
rotated: false,
|
|
27
|
+
rect: [10, 10],
|
|
28
|
+
srcRect: [...],
|
|
29
|
+
hidden: false,
|
|
30
|
+
}
|
|
31
|
+
*/},{key:"setTexture",value:function setTexture(Y){var Z=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(Y&&Y.image){var _Y=Y,C=_Y.image,L=_Y.rect;if(Y=C,Z.rect)for(var X=0;X<Z.rect.length;X++)L[X]=Z.rect[X];Z.rect=L;}return this[D]||this.setFill(),this.setUniforms({u_texSampler:Y}),this[S]&&this[J](this[S],Z),this[N]=Z,this;}},{key:"setCircularGradient",value:function setCircularGradient(){var _ref71=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},Y=_ref71.vector,Z=_ref71.colors,_ref71$type=_ref71.type,C=_ref71$type===void 0?"fill":_ref71$type;if(Y.length!==3)throw new TypeError("Invalid linearGradient.");this.setGradient({vector:Y,colors:Z,type:C});}},{key:"setLinearGradient",value:function setLinearGradient(){var _ref72=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},Y=_ref72.vector,Z=_ref72.colors,_ref72$type=_ref72.type,C=_ref72$type===void 0?"fill":_ref72$type;if(Y.length!==4)throw new TypeError("Invalid linearGradient.");this.setGradient({vector:Y,colors:Z,type:C});}},{key:"setRadialGradient",value:function setRadialGradient(){var _ref73=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},Y=_ref73.vector,Z=_ref73.colors,_ref73$type=_ref73.type,C=_ref73$type===void 0?"fill":_ref73$type;if(Y.length!==6)throw new TypeError("Invalid radialGradient.");this.setGradient({vector:Y,colors:Z,type:C});}/**
|
|
32
|
+
vector: [x0, y0, r0, x1, y1, r1],
|
|
33
|
+
colors: [{offset:0, color}, {offset:1, color}, ...],
|
|
34
|
+
*/},{key:"setGradient",value:function setGradient(){var _ref74=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},Y=_ref74.vector,Z=_ref74.colors,_ref74$type=_ref74.type,C=_ref74$type===void 0?"fill":_ref74$type;Z=Z.map(function(_ref75){var K=_ref75.offset,q=_ref75.color;return typeof q=="string"&&(q=Object(P["default"])(q)),{offset:K,color:q};}),this[V]=this[V]||{},this[V][C]={vector:Y,colors:Z},Z.sort(function(K,q){return K.offset-q.offset;});var L=[];Z.forEach(function(_ref76){var K=_ref76.offset,q=_ref76.color;L.push.apply(L,[K].concat(_toConsumableArray(q)));});var X;if(Y.length===4?X=[Y[0],Y[1],0,Y[2],Y[3],0]:X=_toConsumableArray(Y),L.length<40&&L.push(-1),L.length>40)throw new Error("Too many colors, should be less than 8 colors");return this._radialGradientVector=X,this[B].u_colorSteps=L,C==="fill"?this[B].u_gradientType=1:this[B].u_gradientType=0,this[at](),this;}},{key:"setUniforms",value:function setUniforms(){var Y=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return Object.assign(this[B],Y),this;}},{key:"setTransform",value:function setTransform(){var Z=this[W];for(var _len3=arguments.length,Y=new Array(_len3),_key3=0;_key3<_len3;_key3++){Y[_key3]=arguments[_key3];}return r.mat2d.equals(Y,Z)||(this[W]=Y,delete this[$],this._updateMatrix=!0),this;}},{key:"transform",value:function transform(){var Z=this[W];for(var _len4=arguments.length,Y=new Array(_len4),_key4=0;_key4<_len4;_key4++){Y[_key4]=arguments[_key4];}return this[W]=r.mat2d.multiply(Array.of(0,0,0,0,0,0),Z,Y),delete this[$],this._updateMatrix=!0,this;}},{key:"translate",value:function translate(Y,Z){var C=r.mat2d.create();return C=r.mat2d.translate(Array.of(0,0,0,0,0,0),C,[Y,Z]),this.transform.apply(this,_toConsumableArray(C));}},{key:"rotate",value:function rotate(Y){var _ref77=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[0,0],_ref78=_slicedToArray(_ref77,2),Z=_ref78[0],C=_ref78[1];var L=r.mat2d.create();return L=r.mat2d.translate(Array.of(0,0,0,0,0,0),L,[Z,C]),L=r.mat2d.rotate(Array.of(0,0,0,0,0,0),L,Y),L=r.mat2d.translate(Array.of(0,0,0,0,0,0),L,[-Z,-C]),this.transform.apply(this,_toConsumableArray(L));}},{key:"scale",value:function scale(Y){var Z=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Y;var _ref79=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref80=_slicedToArray(_ref79,2),C=_ref80[0],L=_ref80[1];var X=r.mat2d.create();return X=r.mat2d.translate(Array.of(0,0,0,0,0,0),X,[C,L]),X=r.mat2d.scale(Array.of(0,0,0,0,0,0),X,[Y,Z]),X=r.mat2d.translate(Array.of(0,0,0,0,0,0),X,[-C,-L]),this.transform.apply(this,_toConsumableArray(X));}},{key:"skew",value:function skew(Y){var Z=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Y;var _ref81=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref82=_slicedToArray(_ref81,2),C=_ref82[0],L=_ref82[1];var X=r.mat2d.create();return X=r.mat2d.translate(Array.of(0,0,0,0,0,0),X,[C,L]),X=r.mat2d.multiply(Array.of(0,0,0,0,0,0),X,r.mat2d.fromValues(1,Math.tan(Z),Math.tan(Y),1,0,0)),X=r.mat2d.translate(Array.of(0,0,0,0,0,0),X,[-C,-L]),this.transform.apply(this,_toConsumableArray(X));}},{key:"clearFilter",value:function clearFilter(){return this.setColorTransform(null),this[Q].length=0,this;}},{key:"setColorTransform",value:function setColorTransform(){for(var _len5=arguments.length,Y=new Array(_len5),_key5=0;_key5<_len5;_key5++){Y[_key5]=arguments[_key5];}return Y[0]===null?this.setUniforms({u_filterFlag:0,u_colorMatrix:0}):this.setUniforms({u_filterFlag:1,u_colorMatrix:Y}),this;}// apply linear color transform
|
|
35
|
+
},{key:"transformColor",value:function transformColor(){var Z=this.uniforms.u_colorMatrix;for(var _len6=arguments.length,Y=new Array(_len6),_key6=0;_key6<_len6;_key6++){Y[_key6]=arguments[_key6];}return Z?Z=Object(u.multiply)(Z,Y):Z=Y,this.setColorTransform.apply(this,_toConsumableArray(Z)),this;}},{key:"blur",value:function blur(Y){return this[Q].push("blur(".concat(Y,"px)")),this;}},{key:"brightness",value:function brightness(){var Y=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[Q].push("brightness(".concat(100*Y,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(u.brightness)(Y)));}},{key:"contrast",value:function contrast(){var Y=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[Q].push("contrast(".concat(100*Y,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(u.contrast)(Y)));}},{key:"dropShadow",value:function dropShadow(Y,Z){var C=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var L=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[0,0,0,1];return Array.isArray(L)&&(L=Object(f["default"])(L)),this[Q].push("drop-shadow(".concat(Y,"px ").concat(Z,"px ").concat(C,"px ").concat(L,")")),this;}},{key:"grayscale",value:function grayscale(){var Y=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[Q].push("grayscale(".concat(100*Y,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(u.grayscale)(Y)));}// https://github.com/phoboslab/WebGLImageFilter/blob/master/webgl-image-filter.js#L371
|
|
36
|
+
},{key:"hueRotate",value:function hueRotate(){var Y=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this[Q].push("hue-rotate(".concat(Y,"deg)")),this.transformColor.apply(this,_toConsumableArray(Object(u.hueRotate)(Y)));}},{key:"invert",value:function invert(){var Y=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[Q].push("invert(".concat(100*Y,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(u.invert)(Y)));}},{key:"opacity",value:function opacity(){var Y=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[Q].push("opacity(".concat(100*Y,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(u.opacity)(Y)));}},{key:"saturate",value:function saturate(){var Y=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[Q].push("saturate(".concat(100*Y,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(u.saturate)(Y)));}},{key:"sepia",value:function sepia(){var Y=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[Q].push("sepia(".concat(100*Y,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(u.sepia)(Y)));}},{key:"url",value:function url(Y){return this[Q].push("url(".concat(Y,")")),this;}},{key:"isPointCollision",value:function isPointCollision(Y,Z){var C=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"both";var L=this.meshData,X=L.positions,K=L.cells,q=this.invertMatrix,it=q[0]*Y+q[2]*Z+q[4],ut=q[1]*Y+q[3]*Z+q[5],St=this.boundingBox;if(it<St[0][0]||it>St[1][0]||ut<St[0][1]||ut>St[1][1])return!1;function Ct(_ref83,_ref84,_ref85){var _ref86=_slicedToArray(_ref83,2),Et=_ref86[0],bt=_ref86[1];var _ref87=_slicedToArray(_ref84,2),wt=_ref87[0],Ot=_ref87[1];var _ref88=_slicedToArray(_ref85,2),Lt=_ref88[0],Yt=_ref88[1];var zt=Lt-wt,Wt=Yt-Ot,Qt=((Et-wt)*zt+(bt-Ot)*Wt)/(Math.pow(zt,2)+Math.pow(Wt,2));return Qt>=0&&Qt<=1;}for(var Et=0;Et<K.length;Et++){var bt=K[Et];if(C==="fill"&&bt[0]>=L.fillPointCount)break;if(C==="stroke"&&bt[0]<L.fillPointCount)continue;var _bt$map=bt.map(function(ne){return X[ne];}),_bt$map2=_slicedToArray(_bt$map,3),_bt$map2$=_slicedToArray(_bt$map2[0],2),wt=_bt$map2$[0],Ot=_bt$map2$[1],_bt$map2$2=_slicedToArray(_bt$map2[1],2),Lt=_bt$map2$2[0],Yt=_bt$map2$2[1],_bt$map2$3=_slicedToArray(_bt$map2[2],2),zt=_bt$map2$3[0],Wt=_bt$map2$3[1],Qt=Math.sign((Y-wt)*(Yt-Ot)-(Lt-wt)*(Z-Ot));if(Qt===0&&Ct([Y,Z],[wt,Ot],[Lt,Yt]))return!0;var ue=Math.sign((Y-Lt)*(Wt-Yt)-(zt-Lt)*(Z-Yt));if(ue===0&&Ct([Y,Z],[Lt,Yt],[zt,Wt]))return!0;var ie=Math.sign((Y-zt)*(Ot-Wt)-(wt-zt)*(Z-Wt));if(ie===0&&Ct([Y,Z],[zt,Wt],[wt,Ot])||Qt===1&&ue===1&&ie===1||Qt===-1&&ue===-1&&ie===-1)return!0;}return!1;}},{key:"isPointInFill",value:function isPointInFill(Y,Z){return this.isPointCollision(Y,Z,"fill");}},{key:"isPointInStroke",value:function isPointInStroke(Y,Z){return this.isPointCollision(Y,Z,"stroke");}},{key:"addPass",value:function addPass(Y){var Z=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var C=Z.width,L=Z.height,X=m(Z,["width","height"]);var K=new w["default"]();K.rect(0,0,C,L);var q=new rt(K,{width:C,height:L});q.setUniforms(X),q.setProgram(Y),this[At].push(q);}}]);}();},/* 57 *//***/function(i,e,t){t.r(e);var r=t(58);t(1).glMatrix.setMatrixArrayType(Array),e["default"]=r.Stroke;},/* 58 *//***/function(i,e,t){t.r(e),t.d(e,"Stroke",function(){return v;});var r=t(49);t(1).glMatrix.setMatrixArrayType(Array);var n=Object(r.create)(),s=Object(r.create)(),c=Object(r.create)(),l=Object(r.create)(),f=Object(r.create)(),u=1e20;var v=/*#__PURE__*/function(){function v(){var _ref89=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref89$lineWidth=_ref89.lineWidth,I=_ref89$lineWidth===void 0?1:_ref89$lineWidth,_ref89$lineJoin=_ref89.lineJoin,P=_ref89$lineJoin===void 0?"miter":_ref89$lineJoin,_ref89$miterLimit=_ref89.miterLimit,w=_ref89$miterLimit===void 0?10:_ref89$miterLimit,_ref89$lineCap=_ref89.lineCap,d=_ref89$lineCap===void 0?"butt":_ref89$lineCap,_ref89$roundSegments=_ref89.roundSegments,m=_ref89$roundSegments===void 0?20:_ref89$roundSegments;_classCallCheck(this,v);this.lineWidth=I,this.lineJoin=P,this.miterLimit=w,this.lineCap=d,this.roundSegments=m,this._normal=null;}return _createClass(v,[{key:"build",value:function build(I){var P=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;var w=I.length;if(I=_toConsumableArray(I),w<2)return I;P&&((I[0][0]!==I[w-1][0]||I[0][1]!==I[w-1][1])&&I.push(_toConsumableArray(I[0])),I.push(_toConsumableArray(I[1]))),w=I.length,this._normal=null;var d={left:[],right:[]},m=this.lineWidth/2,p=this.lineCap;if(!P&&p==="square"){Object(r.direction)(s,I[0],I[1]),Object(r.scaleAndAdd)(I[0],I[0],s,m);var E=I.length-1;Object(r.direction)(s,I[E],I[E-1]),Object(r.scaleAndAdd)(I[E],I[E],s,m);}for(var _E5=1;_E5<w;_E5++){var R=I[_E5-1],D=I[_E5],U=I[_E5+1];this._seg(d,R,D,U,m,P);}return!P&&p==="round"&&T(d,this.roundSegments),[].concat(_toConsumableArray(d.left),_toConsumableArray(d.right.reverse()));}},{key:"_seg",value:function _seg(I,P,w,d,m,p){var S=this.lineJoin==="bevel",E=this.lineJoin==="round";if(Object(r.direction)(s,w,P),this._normal||(this._normal=Object(r.create)(),Object(r.normal)(this._normal,s)),I.left.length||y(I,P,this._normal,m),!d)Object(r.normal)(this._normal,s),p?y(I,P,this._normal,m):y(I,w,this._normal,m);else{Object(r.direction)(c,d,w);var R=Object(r.computeMiter)(l,f,s,c,m);R=Math.min(R,u);var D=Object(r.dot)(l,this._normal)<0?-1:1;var U=S||E;if(!U&&this.lineJoin==="miter"&&R/m>this.miterLimit&&(U=!0),U){Object(r.scaleAndAdd)(n,w,this._normal,-m*D),h(I,n,D);var M=1/0;P&&(M=Math.min(M,Math.hypot(w[0]-P[0],w[1]-P[1]))),d&&(M=Math.min(M,Math.hypot(d[0]-w[0],d[1]-w[1])));var W=Math.max(m,Math.min(R,M));if(Object(r.scaleAndAdd)(n,w,f,W*D),h(I,n,-D),d)if(Object(r.normal)(n,c),Object(r.copy)(this._normal,n),Object(r.scaleAndAdd)(n,w,n,-m*D),E){var $=Object(r.clone)(n),B=D>0?I.left[I.left.length-1]:I.right[I.right.length-1],N=Object(r.clone)(w),z=Object(r.sub)(Object(r.create)(),B,N),J=Object(r.sub)(Object(r.create)(),$,N),et=Math.PI/this.roundSegments;for(var at=0;at<this.roundSegments&&(Object(r.rotate)(z,z,[0,0],D*et),Math.sign(Object(r.cross)(n,z,J)[2])===D);at++)Object(r.add)(n,z,N),h(I,n,D);h(I,$,D);}else h(I,n,D);}else y(I,w,f,R),Object(r.copy)(this._normal,f);}}}]);}();function h(O,I,P){P>0?O.left.push(Object(r.clone)(I)):O.right.push(Object(r.clone)(I));}function y(O,I,P,w){var d=arguments.length>4&&arguments[4]!==undefined?arguments[4]:-1;Object(r.scaleAndAdd)(n,I,P,-w),h(O,n,-d),Object(r.scaleAndAdd)(n,I,P,w),h(O,n,d);}function T(_ref90,P){var O=_ref90.left,I=_ref90.right;var w=Object(r.create)(),d=Object(r.create)();var m=O[0],p=I[0],S=[0.5*(m[0]+p[0]),0.5*(m[1]+p[1])];Object(r.sub)(d,m,S);for(var E=1;E<=P;E++){var R=-1*Math.PI*E/P;Object(r.rotate)(w,d,[0,0],R),Object(r.add)(n,S,w),O.unshift(Object(r.clone)(n));}m=I[I.length-1],p=O[O.length-1],S=[0.5*(m[0]+p[0]),0.5*(m[1]+p[1])],Object(r.sub)(d,m,S);for(var _E6=1;_E6<=P;_E6++){var _R2=-1*Math.PI*_E6/P;Object(r.rotate)(w,d,[0,0],_R2),Object(r.add)(n,S,w),I.push(Object(r.clone)(n));}}},/* 59 *//***/function(i,e,t){t.r(e),t.d(e,"isUnitTransform",function(){return r;}),t(1).glMatrix.setMatrixArrayType(Array);function r(n){return n[0]===1&&n[1]===0&&n[2]===0&&n[3]===1&&n[4]===0&&n[5]===0;}},/* 60 *//***/function(i,e,t){t(1).glMatrix.setMatrixArrayType(Array);var r=t(61),n=t(62);i.exports=function(s,c){if(c=c||{},s=s.filter(function(P){return P.length>2;}),s.length===0)return{positions:[],cells:[]};typeof c.vertexSize!="number"&&(c.vertexSize=s[0][0].length),s=s.map(function(P){return P.reduce(function(w,d){return w.concat(d);});});var l=c.rule==="evenodd"?r.WINDING_ODD:r.WINDING_NONZERO;for(var f=r.tesselate(n({contours:s,windingRule:l,elementType:r.POLYGONS,polySize:3,vertexSize:2},c)),u=[],v=0;v<f.vertices.length;v+=c.vertexSize){var h=f.vertices.slice(v,v+c.vertexSize);u.push(h);}var y=[];for(v=0;v<f.elements.length;v+=3){var T=f.elements[v],O=f.elements[v+1],I=f.elements[v+2];y.push([T,O,I]);}return{positions:u,cells:y};};},/* 61 *//***/function(i,e,t){t(1).glMatrix.setMatrixArrayType(Array);var r={},n={};i.exports=r,r.WINDING_ODD=0,r.WINDING_NONZERO=1,r.WINDING_POSITIVE=2,r.WINDING_NEGATIVE=3,r.WINDING_ABS_GEQ_TWO=4,r.POLYGONS=0,r.CONNECTED_POLYGONS=1,r.BOUNDARY_CONTOURS=2,r.tesselate=function(d){for(var m=d.debug||!1,p=new w(),S=0;S<d.contours.length;S++)p.addContour(d.vertexSize||2,d.contours[S]);return p.tesselate(d.windingRule||r.WINDING_ODD,d.elementType||r.POLYGONS,d.polySize||3,d.vertexSize||2,d.normal||[0,0,1]),{vertices:p.vertices,vertexIndices:p.vertexIndices,vertexCount:p.vertexCount,elements:p.elements,elementCount:p.elementCount,mesh:m?p.mesh:void 0};};var s=function s(d){if(!d)throw"Assertion Failed!";};function c(){this.next=null,this.prev=null,this.anEdge=null,this.coords=[0,0,0],this.s=0,this.t=0,this.pqHandle=0,this.n=0,this.idx=0;}function l(){this.next=null,this.prev=null,this.anEdge=null,this.trail=null,this.n=0,this.marked=!1,this.inside=!1;}function f(d){this.next=null,this.Sym=null,this.Onext=null,this.Lnext=null,this.Org=null,this.Lface=null,this.activeRegion=null,this.winding=0,this.side=d;}f.prototype={get Rface(){return this.Sym.Lface;},set Rface(d){this.Sym.Lface=d;},get Dst(){return this.Sym.Org;},set Dst(d){this.Sym.Org=d;},get Oprev(){return this.Sym.Lnext;},set Oprev(d){this.Sym.Lnext=d;},get Lprev(){return this.Onext.Sym;},set Lprev(d){this.Onext.Sym=d;},get Dprev(){return this.Lnext.Sym;},set Dprev(d){this.Lnext.Sym=d;},get Rprev(){return this.Sym.Onext;},set Rprev(d){this.Sym.Onext=d;},get Dnext(){return/*this.Rprev*/this.Sym.Onext.Sym;},/* 3 pointers */set Dnext(d){this.Sym.Onext.Sym=d;},/* 3 pointers */get Rnext(){return/*this.Oprev*/this.Sym.Lnext.Sym;},/* 3 pointers */set Rnext(d){this.Sym.Lnext.Sym=d;}/* 3 pointers */};function u(){var d=new c(),m=new l(),p=new f(0),S=new f(1);d.next=d.prev=d,d.anEdge=null,m.next=m.prev=m,m.anEdge=null,m.trail=null,m.marked=!1,m.inside=!1,p.next=p,p.Sym=S,p.Onext=null,p.Lnext=null,p.Org=null,p.Lface=null,p.winding=0,p.activeRegion=null,S.next=S,S.Sym=p,S.Onext=null,S.Lnext=null,S.Org=null,S.Lface=null,S.winding=0,S.activeRegion=null,this.vHead=d,this.fHead=m,this.eHead=p,this.eHeadSym=S;}u.prototype={/* MakeEdge creates a new pair of half-edges which form their own loop.
|
|
37
|
+
* No vertex or face structures are allocated, but these must be assigned
|
|
38
|
+
* before the current edge operation is completed.
|
|
39
|
+
*///static TESShalfEdge *MakeEdge( TESSmesh* mesh, TESShalfEdge *eNext )
|
|
40
|
+
makeEdge_:function makeEdge_(d){var m=new f(0),p=new f(1);d.Sym.side<d.side&&(d=d.Sym);var S=d.Sym.next;return p.next=S,S.Sym.next=m,m.next=d,d.Sym.next=p,m.Sym=p,m.Onext=m,m.Lnext=p,m.Org=null,m.Lface=null,m.winding=0,m.activeRegion=null,p.Sym=m,p.Onext=p,p.Lnext=m,p.Org=null,p.Lface=null,p.winding=0,p.activeRegion=null,m;},/* Splice( a, b ) is best described by the Guibas/Stolfi paper or the
|
|
41
|
+
* CS348a notes (see mesh.h). Basically it modifies the mesh so that
|
|
42
|
+
* a->Onext and b->Onext are exchanged. This can have various effects
|
|
43
|
+
* depending on whether a and b belong to different face or vertex rings.
|
|
44
|
+
* For more explanation see tessMeshSplice() below.
|
|
45
|
+
*/// static void Splice( TESShalfEdge *a, TESShalfEdge *b )
|
|
46
|
+
splice_:function splice_(d,m){var p=d.Onext,S=m.Onext;p.Sym.Lnext=m,S.Sym.Lnext=d,d.Onext=S,m.Onext=p;},/* MakeVertex( newVertex, eOrig, vNext ) attaches a new vertex and makes it the
|
|
47
|
+
* origin of all edges in the vertex loop to which eOrig belongs. "vNext" gives
|
|
48
|
+
* a place to insert the new vertex in the global vertex list. We insert
|
|
49
|
+
* the new vertex *before* vNext so that algorithms which walk the vertex
|
|
50
|
+
* list will not see the newly created vertices.
|
|
51
|
+
*///static void MakeVertex( TESSvertex *newVertex, TESShalfEdge *eOrig, TESSvertex *vNext )
|
|
52
|
+
makeVertex_:function makeVertex_(d,m,p){var S=d;s(S!==null);var E=p.prev;S.prev=E,E.next=S,S.next=p,p.prev=S,S.anEdge=m;var R=m;do R.Org=S,R=R.Onext;while(R!==m);},/* MakeFace( newFace, eOrig, fNext ) attaches a new face and makes it the left
|
|
53
|
+
* face of all edges in the face loop to which eOrig belongs. "fNext" gives
|
|
54
|
+
* a place to insert the new face in the global face list. We insert
|
|
55
|
+
* the new face *before* fNext so that algorithms which walk the face
|
|
56
|
+
* list will not see the newly created faces.
|
|
57
|
+
*/// static void MakeFace( TESSface *newFace, TESShalfEdge *eOrig, TESSface *fNext )
|
|
58
|
+
makeFace_:function makeFace_(d,m,p){var S=d;s(S!==null);var E=p.prev;S.prev=E,E.next=S,S.next=p,p.prev=S,S.anEdge=m,S.trail=null,S.marked=!1,S.inside=p.inside;var R=m;do R.Lface=S,R=R.Lnext;while(R!==m);},/* KillEdge( eDel ) destroys an edge (the half-edges eDel and eDel->Sym),
|
|
59
|
+
* and removes from the global edge list.
|
|
60
|
+
*///static void KillEdge( TESSmesh *mesh, TESShalfEdge *eDel )
|
|
61
|
+
killEdge_:function killEdge_(d){d.Sym.side<d.side&&(d=d.Sym);var m=d.next,p=d.Sym.next;m.Sym.next=p,p.Sym.next=m;},/* KillVertex( vDel ) destroys a vertex and removes it from the global
|
|
62
|
+
* vertex list. It updates the vertex loop to point to a given new vertex.
|
|
63
|
+
*///static void KillVertex( TESSmesh *mesh, TESSvertex *vDel, TESSvertex *newOrg )
|
|
64
|
+
killVertex_:function killVertex_(d,m){var p=d.anEdge,S=p;do S.Org=m,S=S.Onext;while(S!==p);var E=d.prev,R=d.next;R.prev=E,E.next=R;},/* KillFace( fDel ) destroys a face and removes it from the global face
|
|
65
|
+
* list. It updates the face loop to point to a given new face.
|
|
66
|
+
*///static void KillFace( TESSmesh *mesh, TESSface *fDel, TESSface *newLface )
|
|
67
|
+
killFace_:function killFace_(d,m){var p=d.anEdge,S=p;do S.Lface=m,S=S.Lnext;while(S!==p);var E=d.prev,R=d.next;R.prev=E,E.next=R;},/****************** Basic Edge Operations **********************//* tessMeshMakeEdge creates one edge, two vertices, and a loop (face).
|
|
68
|
+
* The loop consists of the two new half-edges.
|
|
69
|
+
*///TESShalfEdge *tessMeshMakeEdge( TESSmesh *mesh )
|
|
70
|
+
makeEdge:function makeEdge(){var d=new c(),m=new c(),p=new l(),S=this.makeEdge_(this.eHead);return this.makeVertex_(d,S,this.vHead),this.makeVertex_(m,S.Sym,this.vHead),this.makeFace_(p,S,this.fHead),S;},/* tessMeshSplice( eOrg, eDst ) is the basic operation for changing the
|
|
71
|
+
* mesh connectivity and topology. It changes the mesh so that
|
|
72
|
+
* eOrg->Onext <- OLD( eDst->Onext )
|
|
73
|
+
* eDst->Onext <- OLD( eOrg->Onext )
|
|
74
|
+
* where OLD(...) means the value before the meshSplice operation.
|
|
75
|
+
*
|
|
76
|
+
* This can have two effects on the vertex structure:
|
|
77
|
+
* - if eOrg->Org != eDst->Org, the two vertices are merged together
|
|
78
|
+
* - if eOrg->Org == eDst->Org, the origin is split into two vertices
|
|
79
|
+
* In both cases, eDst->Org is changed and eOrg->Org is untouched.
|
|
80
|
+
*
|
|
81
|
+
* Similarly (and independently) for the face structure,
|
|
82
|
+
* - if eOrg->Lface == eDst->Lface, one loop is split into two
|
|
83
|
+
* - if eOrg->Lface != eDst->Lface, two distinct loops are joined into one
|
|
84
|
+
* In both cases, eDst->Lface is changed and eOrg->Lface is unaffected.
|
|
85
|
+
*
|
|
86
|
+
* Some special cases:
|
|
87
|
+
* If eDst == eOrg, the operation has no effect.
|
|
88
|
+
* If eDst == eOrg->Lnext, the new face will have a single edge.
|
|
89
|
+
* If eDst == eOrg->Lprev, the old face will have a single edge.
|
|
90
|
+
* If eDst == eOrg->Onext, the new vertex will have a single edge.
|
|
91
|
+
* If eDst == eOrg->Oprev, the old vertex will have a single edge.
|
|
92
|
+
*///int tessMeshSplice( TESSmesh* mesh, TESShalfEdge *eOrg, TESShalfEdge *eDst )
|
|
93
|
+
splice:function splice(d,m){var p=!1,S=!1;if(d!==m){if(m.Org!==d.Org&&(S=!0,this.killVertex_(m.Org,d.Org)),m.Lface!==d.Lface&&(p=!0,this.killFace_(m.Lface,d.Lface)),this.splice_(m,d),!S){var E=new c();this.makeVertex_(E,m,d.Org),d.Org.anEdge=d;}if(!p){var R=new l();this.makeFace_(R,m,d.Lface),d.Lface.anEdge=d;}}},/* tessMeshDelete( eDel ) removes the edge eDel. There are several cases:
|
|
94
|
+
* if (eDel->Lface != eDel->Rface), we join two loops into one; the loop
|
|
95
|
+
* eDel->Lface is deleted. Otherwise, we are splitting one loop into two;
|
|
96
|
+
* the newly created loop will contain eDel->Dst. If the deletion of eDel
|
|
97
|
+
* would create isolated vertices, those are deleted as well.
|
|
98
|
+
*
|
|
99
|
+
* This function could be implemented as two calls to tessMeshSplice
|
|
100
|
+
* plus a few calls to memFree, but this would allocate and delete
|
|
101
|
+
* unnecessary vertices and faces.
|
|
102
|
+
*///int tessMeshDelete( TESSmesh *mesh, TESShalfEdge *eDel )
|
|
103
|
+
"delete":function _delete(d){var m=d.Sym,p=!1;if(d.Lface!==d.Rface&&(p=!0,this.killFace_(d.Lface,d.Rface)),d.Onext===d)this.killVertex_(d.Org,null);else if(d.Rface.anEdge=d.Oprev,d.Org.anEdge=d.Onext,this.splice_(d,d.Oprev),!p){var S=new l();this.makeFace_(S,d,d.Lface);}m.Onext===m?(this.killVertex_(m.Org,null),this.killFace_(m.Lface,null)):(d.Lface.anEdge=m.Oprev,m.Org.anEdge=m.Onext,this.splice_(m,m.Oprev)),this.killEdge_(d);},/******************** Other Edge Operations **********************//* All these routines can be implemented with the basic edge
|
|
104
|
+
* operations above. They are provided for convenience and efficiency.
|
|
105
|
+
*//* tessMeshAddEdgeVertex( eOrg ) creates a new edge eNew such that
|
|
106
|
+
* eNew == eOrg->Lnext, and eNew->Dst is a newly created vertex.
|
|
107
|
+
* eOrg and eNew will have the same left face.
|
|
108
|
+
*/// TESShalfEdge *tessMeshAddEdgeVertex( TESSmesh *mesh, TESShalfEdge *eOrg );
|
|
109
|
+
addEdgeVertex:function addEdgeVertex(d){var m=this.makeEdge_(d),p=m.Sym;this.splice_(m,d.Lnext),m.Org=d.Dst;var S=new c();return this.makeVertex_(S,p,m.Org),m.Lface=p.Lface=d.Lface,m;},/* tessMeshSplitEdge( eOrg ) splits eOrg into two edges eOrg and eNew,
|
|
110
|
+
* such that eNew == eOrg->Lnext. The new vertex is eOrg->Dst == eNew->Org.
|
|
111
|
+
* eOrg and eNew will have the same left face.
|
|
112
|
+
*/// TESShalfEdge *tessMeshSplitEdge( TESSmesh *mesh, TESShalfEdge *eOrg );
|
|
113
|
+
splitEdge:function splitEdge(d,m){var p=this.addEdgeVertex(d),S=p.Sym;return this.splice_(d.Sym,d.Sym.Oprev),this.splice_(d.Sym,S),d.Dst=S.Org,S.Dst.anEdge=S.Sym,S.Rface=d.Rface,S.winding=d.winding,S.Sym.winding=d.Sym.winding,S;},/* tessMeshConnect( eOrg, eDst ) creates a new edge from eOrg->Dst
|
|
114
|
+
* to eDst->Org, and returns the corresponding half-edge eNew.
|
|
115
|
+
* If eOrg->Lface == eDst->Lface, this splits one loop into two,
|
|
116
|
+
* and the newly created loop is eNew->Lface. Otherwise, two disjoint
|
|
117
|
+
* loops are merged into one, and the loop eDst->Lface is destroyed.
|
|
118
|
+
*
|
|
119
|
+
* If (eOrg == eDst), the new face will have only two edges.
|
|
120
|
+
* If (eOrg->Lnext == eDst), the old face is reduced to a single edge.
|
|
121
|
+
* If (eOrg->Lnext->Lnext == eDst), the old face is reduced to two edges.
|
|
122
|
+
*/// TESShalfEdge *tessMeshConnect( TESSmesh *mesh, TESShalfEdge *eOrg, TESShalfEdge *eDst );
|
|
123
|
+
connect:function connect(d,m){var p=!1,S=this.makeEdge_(d),E=S.Sym;if(m.Lface!==d.Lface&&(p=!0,this.killFace_(m.Lface,d.Lface)),this.splice_(S,d.Lnext),this.splice_(E,m),S.Org=d.Dst,E.Org=m.Org,S.Lface=E.Lface=d.Lface,d.Lface.anEdge=E,!p){var R=new l();this.makeFace_(R,S,d.Lface);}return S;},/* tessMeshZapFace( fZap ) destroys a face and removes it from the
|
|
124
|
+
* global face list. All edges of fZap will have a NULL pointer as their
|
|
125
|
+
* left face. Any edges which also have a NULL pointer as their right face
|
|
126
|
+
* are deleted entirely (along with any isolated vertices this produces).
|
|
127
|
+
* An entire mesh can be deleted by zapping its faces, one at a time,
|
|
128
|
+
* in any order. Zapped faces cannot be used in further mesh operations!
|
|
129
|
+
*/zapFace:function zapFace(d){var m=d.anEdge,p,S,E,R,D;S=m.Lnext;do p=S,S=p.Lnext,p.Lface=null,p.Rface===null&&(p.Onext===p?this.killVertex_(p.Org,null):(p.Org.anEdge=p.Onext,this.splice_(p,p.Oprev)),E=p.Sym,E.Onext===E?this.killVertex_(E.Org,null):(E.Org.anEdge=E.Onext,this.splice_(E,E.Oprev)),this.killEdge_(p));while(p!=m);R=d.prev,D=d.next,D.prev=R,R.next=D;},countFaceVerts_:function countFaceVerts_(d){var m=d.anEdge,p=0;do p++,m=m.Lnext;while(m!==d.anEdge);return p;},//int tessMeshMergeConvexFaces( TESSmesh *mesh, int maxVertsPerFace )
|
|
130
|
+
mergeConvexFaces:function mergeConvexFaces(d){var m,p,S,E,R,D,U;for(m=this.fHead.next;m!==this.fHead;m=m.next)if(m.inside)for(p=m.anEdge,R=p.Org;S=p.Lnext,E=p.Sym,E&&E.Lface&&E.Lface.inside&&(D=this.countFaceVerts_(m),U=this.countFaceVerts_(E.Lface),D+U-2<=d&&n.vertCCW(p.Lprev.Org,p.Org,E.Lnext.Lnext.Org)&&n.vertCCW(E.Lprev.Org,E.Org,p.Lnext.Lnext.Org)&&(S=E.Lnext,this["delete"](E),p=null,E=null)),!(p&&p.Lnext.Org===R);)p=S;return!0;},/* tessMeshCheckMesh( mesh ) checks a mesh for self-consistency.
|
|
131
|
+
*/check:function check(){var d=this.fHead,m=this.vHead,p=this.eHead,S,E,R,D,U,M;for(E=d,E=d;(S=E.next)!==d;E=S){s(S.prev===E),U=S.anEdge;do s(U.Sym!==U),s(U.Sym.Sym===U),s(U.Lnext.Onext.Sym===U),s(U.Onext.Sym.Lnext===U),s(U.Lface===S),U=U.Lnext;while(U!==S.anEdge);}for(s(S.prev===E&&S.anEdge===null),D=m,D=m;(R=D.next)!==m;D=R){s(R.prev===D),U=R.anEdge;do s(U.Sym!==U),s(U.Sym.Sym===U),s(U.Lnext.Onext.Sym===U),s(U.Onext.Sym.Lnext===U),s(U.Org===R),U=U.Onext;while(U!==R.anEdge);}for(s(R.prev===D&&R.anEdge===null),M=p,M=p;(U=M.next)!==p;M=U)s(U.Sym.next===M.Sym),s(U.Sym!==U),s(U.Sym.Sym===U),s(U.Org!==null),s(U.Dst!==null),s(U.Lnext.Onext.Sym===U),s(U.Onext.Sym.Lnext===U);s(U.Sym.next===M.Sym&&U.Sym===this.eHeadSym&&U.Sym.Sym===U&&U.Org===null&&U.Dst===null&&U.Lface===null&&U.Rface===null);}},n.vertEq=function(d,m){return d.s===m.s&&d.t===m.t;},n.vertLeq=function(d,m){return d.s<m.s||d.s===m.s&&d.t<=m.t;},n.transLeq=function(d,m){return d.t<m.t||d.t===m.t&&d.s<=m.s;},n.edgeGoesLeft=function(d){return n.vertLeq(d.Dst,d.Org);},n.edgeGoesRight=function(d){return n.vertLeq(d.Org,d.Dst);},n.vertL1dist=function(d,m){return Math.abs(d.s-m.s)+Math.abs(d.t-m.t);},n.edgeEval=function(d,m,p){s(n.vertLeq(d,m)&&n.vertLeq(m,p));var S=m.s-d.s,E=p.s-m.s;return S+E>0?S<E?m.t-d.t+(d.t-p.t)*(S/(S+E)):m.t-p.t+(p.t-d.t)*(E/(S+E)):0;},n.edgeSign=function(d,m,p){s(n.vertLeq(d,m)&&n.vertLeq(m,p));var S=m.s-d.s,E=p.s-m.s;return S+E>0?(m.t-p.t)*S+(m.t-d.t)*E:0;},n.transEval=function(d,m,p){s(n.transLeq(d,m)&&n.transLeq(m,p));var S=m.t-d.t,E=p.t-m.t;return S+E>0?S<E?m.s-d.s+(d.s-p.s)*(S/(S+E)):m.s-p.s+(p.s-d.s)*(E/(S+E)):0;},n.transSign=function(d,m,p){s(n.transLeq(d,m)&&n.transLeq(m,p));var S=m.t-d.t,E=p.t-m.t;return S+E>0?(m.s-p.s)*S+(m.s-d.s)*E:0;},n.vertCCW=function(d,m,p){return d.s*(m.t-p.t)+m.s*(p.t-d.t)+p.s*(d.t-m.t)>=0;},n.interpolate=function(d,m,p,S){return d=d<0?0:d,p=p<0?0:p,d<=p?p===0?(m+S)/2:m+(S-m)*(d/(d+p)):S+(m-S)*(p/(d+p));},n.intersect=function(d,m,p,S,E){var R,D,U;n.vertLeq(d,m)||(U=d,d=m,m=U),n.vertLeq(p,S)||(U=p,p=S,S=U),n.vertLeq(d,p)||(U=d,d=p,p=U,U=m,m=S,S=U),n.vertLeq(p,m)?n.vertLeq(m,S)?(R=n.edgeEval(d,p,m),D=n.edgeEval(p,m,S),R+D<0&&(R=-R,D=-D),E.s=n.interpolate(R,p.s,D,m.s)):(R=n.edgeSign(d,p,m),D=-n.edgeSign(d,S,m),R+D<0&&(R=-R,D=-D),E.s=n.interpolate(R,p.s,D,S.s)):E.s=(p.s+m.s)/2,n.transLeq(d,m)||(U=d,d=m,m=U),n.transLeq(p,S)||(U=p,p=S,S=U),n.transLeq(d,p)||(U=d,d=p,p=U,U=m,m=S,S=U),n.transLeq(p,m)?n.transLeq(m,S)?(R=n.transEval(d,p,m),D=n.transEval(p,m,S),R+D<0&&(R=-R,D=-D),E.t=n.interpolate(R,p.t,D,m.t)):(R=n.transSign(d,p,m),D=-n.transSign(d,S,m),R+D<0&&(R=-R,D=-D),E.t=n.interpolate(R,p.t,D,S.t)):E.t=(p.t+m.t)/2;};function v(){this.key=null,this.next=null,this.prev=null;}function h(d,m){this.head=new v(),this.head.next=this.head,this.head.prev=this.head,this.frame=d,this.leq=m;}h.prototype={min:function min(){return this.head.next;},max:function max(){return this.head.prev;},insert:function insert(d){return this.insertBefore(this.head,d);},search:function search(d){var m=this.head;do m=m.next;while(m.key!==null&&!this.leq(this.frame,d,m.key));return m;},insertBefore:function insertBefore(d,m){do d=d.prev;while(d.key!==null&&!this.leq(this.frame,d.key,m));var p=new v();return p.key=m,p.next=d.next,d.next.prev=p,p.prev=d,d.next=p,p;},"delete":function _delete(d){d.next.prev=d.prev,d.prev.next=d.next;}};function y(){this.handle=null;}function T(){this.key=null,this.node=null;}function O(d,m){this.size=0,this.max=d,this.nodes=[],this.nodes.length=d+1;var p;for(p=0;p<this.nodes.length;p++)this.nodes[p]=new y();for(this.handles=[],this.handles.length=d+1,p=0;p<this.handles.length;p++)this.handles[p]=new T();this.initialized=!1,this.freeList=0,this.leq=m,this.nodes[1].handle=1,this.handles[1].key=null;}O.prototype={floatDown_:function floatDown_(d){var m=this.nodes,p=this.handles,S,E,R;for(S=m[d].handle;;){if(R=d<<1,R<this.size&&this.leq(p[m[R+1].handle].key,p[m[R].handle].key)&&++R,s(R<=this.max),E=m[R].handle,R>this.size||this.leq(p[S].key,p[E].key)){m[d].handle=S,p[S].node=d;break;}m[d].handle=E,p[E].node=d,d=R;}},floatUp_:function floatUp_(d){var m=this.nodes,p=this.handles,S,E,R;for(S=m[d].handle;;){if(R=d>>1,E=m[R].handle,R===0||this.leq(p[E].key,p[S].key)){m[d].handle=S,p[S].node=d;break;}m[d].handle=E,p[E].node=d,d=R;}},init:function init(){for(var d=this.size;d>=1;--d)this.floatDown_(d);this.initialized=!0;},min:function min(){return this.handles[this.nodes[1].handle].key;},/* really pqHeapInsert *//* returns INV_HANDLE iff out of memory *///PQhandle pqHeapInsert( TESSalloc* alloc, PriorityQHeap *pq, PQkey keyNew )
|
|
132
|
+
insert:function insert(d){var m,p;if(m=++this.size,m*2>this.max){this.max*=2;var S,E;for(E=this.nodes.length,this.nodes.length=this.max+1,S=E;S<this.nodes.length;S++)this.nodes[S]=new y();for(E=this.handles.length,this.handles.length=this.max+1,S=E;S<this.handles.length;S++)this.handles[S]=new T();}return this.freeList===0?p=m:(p=this.freeList,this.freeList=this.handles[p].node),this.nodes[m].handle=p,this.handles[p].node=m,this.handles[p].key=d,this.initialized&&this.floatUp_(m),p;},//PQkey pqHeapExtractMin( PriorityQHeap *pq )
|
|
133
|
+
extractMin:function extractMin(){var d=this.nodes,m=this.handles,p=d[1].handle,S=m[p].key;return this.size>0&&(d[1].handle=d[this.size].handle,m[d[1].handle].node=1,m[p].key=null,m[p].node=this.freeList,this.freeList=p,--this.size,this.size>0&&this.floatDown_(1)),S;},"delete":function _delete(d){var m=this.nodes,p=this.handles,S;s(d>=1&&d<=this.max&&p[d].key!==null),S=p[d].node,m[S].handle=m[this.size].handle,p[m[S].handle].node=S,--this.size,S<=this.size&&(S<=1||this.leq(p[m[S>>1].handle].key,p[m[S].handle].key)?this.floatDown_(S):this.floatUp_(S)),p[d].key=null,p[d].node=this.freeList,this.freeList=d;}};function I(){this.eUp=null,this.nodeUp=null,this.windingNumber=0,this.inside=!1,this.sentinel=!1,this.dirty=!1,this.fixUpperEdge=!1;}var P={};P.regionBelow=function(d){return d.nodeUp.prev.key;},P.regionAbove=function(d){return d.nodeUp.next.key;},P.debugEvent=function(d){},P.addWinding=function(d,m){d.winding+=m.winding,d.Sym.winding+=m.Sym.winding;},P.edgeLeq=function(d,m,p){var S=d.event,D,U,E=m.eUp,R=p.eUp;if(E.Dst===S)return R.Dst===S?n.vertLeq(E.Org,R.Org)?n.edgeSign(R.Dst,E.Org,R.Org)<=0:n.edgeSign(E.Dst,R.Org,E.Org)>=0:n.edgeSign(R.Dst,S,R.Org)<=0;if(R.Dst===S)return n.edgeSign(E.Dst,S,E.Org)>=0;var D=n.edgeEval(E.Dst,S,E.Org),U=n.edgeEval(R.Dst,S,R.Org);return D>=U;},P.deleteRegion=function(d,m){m.fixUpperEdge&&s(m.eUp.winding===0),m.eUp.activeRegion=null,d.dict["delete"](m.nodeUp);},P.fixUpperEdge=function(d,m,p){s(m.fixUpperEdge),d.mesh["delete"](m.eUp),m.fixUpperEdge=!1,m.eUp=p,p.activeRegion=m;},P.topLeftRegion=function(d,m){var p=m.eUp.Org,S;do m=P.regionAbove(m);while(m.eUp.Org===p);if(m.fixUpperEdge){if(S=d.mesh.connect(P.regionBelow(m).eUp.Sym,m.eUp.Lnext),S===null)return null;P.fixUpperEdge(d,m,S),m=P.regionAbove(m);}return m;},P.topRightRegion=function(d){var m=d.eUp.Dst;do d=P.regionAbove(d);while(d.eUp.Dst===m);return d;},P.addRegionBelow=function(d,m,p){var S=new I();return S.eUp=p,S.nodeUp=d.dict.insertBefore(m.nodeUp,S),S.fixUpperEdge=!1,S.sentinel=!1,S.dirty=!1,p.activeRegion=S,S;},P.isWindingInside=function(d,m){switch(d.windingRule){case r.WINDING_ODD:return(m&1)!==0;case r.WINDING_NONZERO:return m!==0;case r.WINDING_POSITIVE:return m>0;case r.WINDING_NEGATIVE:return m<0;case r.WINDING_ABS_GEQ_TWO:return m>=2||m<=-2;}return s(!1),!1;},P.computeWinding=function(d,m){m.windingNumber=P.regionAbove(m).windingNumber+m.eUp.winding,m.inside=P.isWindingInside(d,m.windingNumber);},P.finishRegion=function(d,m){var p=m.eUp,S=p.Lface;S.inside=m.inside,S.anEdge=p,P.deleteRegion(d,m);},P.finishLeftRegions=function(d,m,p){for(var S,D,E=null,R=m,D=m.eUp;R!==p;){if(R.fixUpperEdge=!1,E=P.regionBelow(R),S=E.eUp,S.Org!=D.Org){if(!E.fixUpperEdge){P.finishRegion(d,R);break;}S=d.mesh.connect(D.Lprev,S.Sym),P.fixUpperEdge(d,E,S);}D.Onext!==S&&(d.mesh.splice(S.Oprev,S),d.mesh.splice(D,S)),P.finishRegion(d,R),D=E.eUp,R=E;}return D;},P.addRightEdges=function(d,m,p,S,E,R){var D,U,M,W,$=!0;M=p;do s(n.vertLeq(M.Org,M.Dst)),P.addRegionBelow(d,m,M.Sym),M=M.Onext;while(M!==S);for(E===null&&(E=P.regionBelow(m).eUp.Rprev),U=m,W=E;D=P.regionBelow(U),M=D.eUp.Sym,M.Org===W.Org;)M.Onext!==W&&(d.mesh.splice(M.Oprev,M),d.mesh.splice(W.Oprev,M)),D.windingNumber=U.windingNumber-M.winding,D.inside=P.isWindingInside(d,D.windingNumber),U.dirty=!0,!$&&P.checkForRightSplice(d,U)&&(P.addWinding(M,W),P.deleteRegion(d,U),d.mesh["delete"](W)),$=!1,U=D,W=M;U.dirty=!0,s(U.windingNumber-M.winding===D.windingNumber),R&&P.walkDirtyRegions(d,U);},P.spliceMergeVertices=function(d,m,p){d.mesh.splice(m,p);},P.vertexWeights=function(d,m,p){var S=n.vertL1dist(m,d),E=n.vertL1dist(p,d),R=0.5*E/(S+E),D=0.5*S/(S+E);d.coords[0]+=R*m.coords[0]+D*p.coords[0],d.coords[1]+=R*m.coords[1]+D*p.coords[1],d.coords[2]+=R*m.coords[2]+D*p.coords[2];},P.getIntersectData=function(d,m,p,S,E,R){m.coords[0]=m.coords[1]=m.coords[2]=0,m.idx=-1,P.vertexWeights(m,p,S),P.vertexWeights(m,E,R);},P.checkForRightSplice=function(d,m){var p=P.regionBelow(m),S=m.eUp,E=p.eUp;if(n.vertLeq(S.Org,E.Org)){if(n.edgeSign(E.Dst,S.Org,E.Org)>0)return!1;n.vertEq(S.Org,E.Org)?S.Org!==E.Org&&(d.pq["delete"](S.Org.pqHandle),P.spliceMergeVertices(d,E.Oprev,S)):(d.mesh.splitEdge(E.Sym),d.mesh.splice(S,E.Oprev),m.dirty=p.dirty=!0);}else{if(n.edgeSign(S.Dst,E.Org,S.Org)<0)return!1;P.regionAbove(m).dirty=m.dirty=!0,d.mesh.splitEdge(S.Sym),d.mesh.splice(E.Oprev,S);}return!0;},P.checkForLeftSplice=function(d,m){var p=P.regionBelow(m),S=m.eUp,E=p.eUp,R;if(s(!n.vertEq(S.Dst,E.Dst)),n.vertLeq(S.Dst,E.Dst)){if(n.edgeSign(S.Dst,E.Dst,S.Org)<0)return!1;P.regionAbove(m).dirty=m.dirty=!0,R=d.mesh.splitEdge(S),d.mesh.splice(E.Sym,R),R.Lface.inside=m.inside;}else{if(n.edgeSign(E.Dst,S.Dst,E.Org)>0)return!1;m.dirty=p.dirty=!0,R=d.mesh.splitEdge(E),d.mesh.splice(S.Lnext,E.Sym),R.Rface.inside=m.inside;}return!0;},P.checkForIntersect=function(d,m){var p=P.regionBelow(m),S=m.eUp,E=p.eUp,R=S.Org,D=E.Org,U=S.Dst,M=E.Dst,W,$,B=new c(),N,z;if(s(!n.vertEq(M,U)),s(n.edgeSign(U,d.event,R)<=0),s(n.edgeSign(M,d.event,D)>=0),s(R!==d.event&&D!==d.event),s(!m.fixUpperEdge&&!p.fixUpperEdge),R===D||(W=Math.min(R.t,U.t),$=Math.max(D.t,M.t),W>$))return!1;if(n.vertLeq(R,D)){if(n.edgeSign(M,R,D)>0)return!1;}else if(n.edgeSign(U,D,R)<0)return!1;return P.debugEvent(d),n.intersect(U,R,M,D,B),s(Math.min(R.t,U.t)<=B.t),s(B.t<=Math.max(D.t,M.t)),s(Math.min(M.s,U.s)<=B.s),s(B.s<=Math.max(D.s,R.s)),n.vertLeq(B,d.event)&&(B.s=d.event.s,B.t=d.event.t),N=n.vertLeq(R,D)?R:D,n.vertLeq(N,B)&&(B.s=N.s,B.t=N.t),n.vertEq(B,R)||n.vertEq(B,D)?(P.checkForRightSplice(d,m),!1):!n.vertEq(U,d.event)&&n.edgeSign(U,d.event,B)>=0||!n.vertEq(M,d.event)&&n.edgeSign(M,d.event,B)<=0?M===d.event?(d.mesh.splitEdge(S.Sym),d.mesh.splice(E.Sym,S),m=P.topLeftRegion(d,m),S=P.regionBelow(m).eUp,P.finishLeftRegions(d,P.regionBelow(m),p),P.addRightEdges(d,m,S.Oprev,S,S,!0),!0):U===d.event?(d.mesh.splitEdge(E.Sym),d.mesh.splice(S.Lnext,E.Oprev),p=m,m=P.topRightRegion(m),z=P.regionBelow(m).eUp.Rprev,p.eUp=E.Oprev,E=P.finishLeftRegions(d,p,null),P.addRightEdges(d,m,E.Onext,S.Rprev,z,!0),!0):(n.edgeSign(U,d.event,B)>=0&&(P.regionAbove(m).dirty=m.dirty=!0,d.mesh.splitEdge(S.Sym),S.Org.s=d.event.s,S.Org.t=d.event.t),n.edgeSign(M,d.event,B)<=0&&(m.dirty=p.dirty=!0,d.mesh.splitEdge(E.Sym),E.Org.s=d.event.s,E.Org.t=d.event.t),!1):(d.mesh.splitEdge(S.Sym),d.mesh.splitEdge(E.Sym),d.mesh.splice(E.Oprev,S),S.Org.s=B.s,S.Org.t=B.t,S.Org.pqHandle=d.pq.insert(S.Org),P.getIntersectData(d,S.Org,R,U,D,M),P.regionAbove(m).dirty=m.dirty=p.dirty=!0,!1);},P.walkDirtyRegions=function(d,m){for(var p=P.regionBelow(m),S,E;;){for(;p.dirty;)m=p,p=P.regionBelow(p);if(!m.dirty&&(p=m,m=P.regionAbove(m),m===null||!m.dirty))return;if(m.dirty=!1,S=m.eUp,E=p.eUp,S.Dst!==E.Dst&&P.checkForLeftSplice(d,m)&&(p.fixUpperEdge?(P.deleteRegion(d,p),d.mesh["delete"](E),p=P.regionBelow(m),E=p.eUp):m.fixUpperEdge&&(P.deleteRegion(d,m),d.mesh["delete"](S),m=P.regionAbove(p),S=m.eUp)),S.Org!==E.Org)if(S.Dst!==E.Dst&&!m.fixUpperEdge&&!p.fixUpperEdge&&(S.Dst===d.event||E.Dst===d.event)){if(P.checkForIntersect(d,m))return;}else P.checkForRightSplice(d,m);S.Org===E.Org&&S.Dst===E.Dst&&(P.addWinding(E,S),P.deleteRegion(d,m),d.mesh["delete"](S),m=P.regionAbove(p));}},P.connectRightVertex=function(d,m,p){var S,E=p.Onext,R=P.regionBelow(m),D=m.eUp,U=R.eUp,M=!1;if(D.Dst!==U.Dst&&P.checkForIntersect(d,m),n.vertEq(D.Org,d.event)&&(d.mesh.splice(E.Oprev,D),m=P.topLeftRegion(d,m),E=P.regionBelow(m).eUp,P.finishLeftRegions(d,P.regionBelow(m),R),M=!0),n.vertEq(U.Org,d.event)&&(d.mesh.splice(p,U.Oprev),p=P.finishLeftRegions(d,R,null),M=!0),M){P.addRightEdges(d,m,p.Onext,E,E,!0);return;}n.vertLeq(U.Org,D.Org)?S=U.Oprev:S=D,S=d.mesh.connect(p.Lprev,S),P.addRightEdges(d,m,S,S.Onext,S.Onext,!1),S.Sym.activeRegion.fixUpperEdge=!0,P.walkDirtyRegions(d,m);},P.connectLeftDegenerate=function(d,m,p){var S,E,R,D,U;if(S=m.eUp,n.vertEq(S.Org,p)){s(!1/*TOLERANCE_NONZERO*/),P.spliceMergeVertices(d,S,p.anEdge);return;}if(!n.vertEq(S.Dst,p)){d.mesh.splitEdge(S.Sym),m.fixUpperEdge&&(d.mesh["delete"](S.Onext),m.fixUpperEdge=!1),d.mesh.splice(p.anEdge,S),P.sweepEvent(d,p);return;}s(!1/*TOLERANCE_NONZERO*/),m=P.topRightRegion(m),U=P.regionBelow(m),R=U.eUp.Sym,E=D=R.Onext,U.fixUpperEdge&&(s(E!==R),P.deleteRegion(d,U),d.mesh["delete"](R),R=E.Oprev),d.mesh.splice(p.anEdge,R),n.edgeGoesLeft(E)||(E=null),P.addRightEdges(d,m,R.Onext,D,E,!0);},P.connectLeftVertex=function(d,m){var p,S,E,R,D,U,M=new I();if(M.eUp=m.anEdge.Sym,p=d.dict.search(M).key,S=P.regionBelow(p),!!S){if(R=p.eUp,D=S.eUp,n.edgeSign(R.Dst,m,R.Org)===0){P.connectLeftDegenerate(d,p,m);return;}if(E=n.vertLeq(D.Dst,R.Dst)?p:S,p.inside||E.fixUpperEdge){if(E===p)U=d.mesh.connect(m.anEdge.Sym,R.Lnext);else{var W=d.mesh.connect(D.Dnext,m.anEdge);U=W.Sym;}E.fixUpperEdge?P.fixUpperEdge(d,E,U):P.computeWinding(d,P.addRegionBelow(d,p,U)),P.sweepEvent(d,m);}else P.addRightEdges(d,p,m.anEdge,m.anEdge,null,!0);}},P.sweepEvent=function(d,m){d.event=m,P.debugEvent(d);for(var p=m.anEdge;p.activeRegion===null;)if(p=p.Onext,p===m.anEdge){P.connectLeftVertex(d,m);return;}var S=P.topLeftRegion(d,p.activeRegion);s(S!==null);var E=P.regionBelow(S),R=E.eUp,D=P.finishLeftRegions(d,E,null);D.Onext===R?P.connectRightVertex(d,S,D):P.addRightEdges(d,S,D.Onext,R,R,!0);},P.addSentinel=function(d,m,p,S){var E=new I(),R=d.mesh.makeEdge();R.Org.s=p,R.Org.t=S,R.Dst.s=m,R.Dst.t=S,d.event=R.Dst,E.eUp=R,E.windingNumber=0,E.inside=!1,E.fixUpperEdge=!1,E.sentinel=!0,E.dirty=!1,E.nodeUp=d.dict.insert(E);},P.initEdgeDict=function(d){d.dict=new h(d,P.edgeLeq);var m=d.bmax[0]-d.bmin[0],p=d.bmax[1]-d.bmin[1],S=d.bmin[0]-m,E=d.bmax[0]+m,R=d.bmin[1]-p,D=d.bmax[1]+p;P.addSentinel(d,S,E,R),P.addSentinel(d,S,E,D);},P.doneEdgeDict=function(d){for(var m,p=0;(m=d.dict.min().key)!==null;)m.sentinel||(s(m.fixUpperEdge),s(++p===1)),s(m.windingNumber===0),P.deleteRegion(d,m);},P.removeDegenerateEdges=function(d){var m,p,S,E=d.mesh.eHead;for(m=E.next;m!==E;m=p)p=m.next,S=m.Lnext,n.vertEq(m.Org,m.Dst)&&m.Lnext.Lnext!==m&&(P.spliceMergeVertices(d,S,m),d.mesh["delete"](m),m=S,S=m.Lnext),S.Lnext===m&&(S!==m&&((S===p||S===p.Sym)&&(p=p.next),d.mesh["delete"](S)),(m===p||m===p.Sym)&&(p=p.next),d.mesh["delete"](m));},P.initPriorityQ=function(d){var m,p,S,E=0;for(S=d.mesh.vHead,p=S.next;p!==S;p=p.next)E++;for(E+=8,m=d.pq=new O(E,n.vertLeq),S=d.mesh.vHead,p=S.next;p!==S;p=p.next)p.pqHandle=m.insert(p);return p!==S?!1:(m.init(),!0);},P.donePriorityQ=function(d){d.pq=null;},P.removeDegenerateFaces=function(d,m){var p,S,E;for(p=m.fHead.next;p!==m.fHead;p=S)S=p.next,E=p.anEdge,s(E.Lnext!==E),E.Lnext.Lnext===E&&(P.addWinding(E.Onext,E),d.mesh["delete"](E));return!0;},P.computeInterior=function(d){var m,p;if(P.removeDegenerateEdges(d),!P.initPriorityQ(d))return!1;for(P.initEdgeDict(d);(m=d.pq.extractMin())!==null;){for(;p=d.pq.min(),!(p===null||!n.vertEq(p,m));)p=d.pq.extractMin(),P.spliceMergeVertices(d,m.anEdge,p.anEdge);P.sweepEvent(d,m);}return d.event=d.dict.min().key.eUp.Org,P.debugEvent(d),P.doneEdgeDict(d),P.donePriorityQ(d),P.removeDegenerateFaces(d,d.mesh)?(d.mesh.check(),!0):!1;};function w(){this.mesh=null,this.normal=[0,0,0],this.sUnit=[0,0,0],this.tUnit=[0,0,0],this.bmin=[0,0],this.bmax=[0,0],this.windingRule=r.WINDING_ODD,this.dict=null,this.pq=null,this.event=null,this.vertexIndexCounter=0,this.vertices=[],this.vertexIndices=[],this.vertexCount=0,this.elements=[],this.elementCount=0;}w.prototype={dot_:function dot_(d,m){return d[0]*m[0]+d[1]*m[1]+d[2]*m[2];},normalize_:function normalize_(d){var m=d[0]*d[0]+d[1]*d[1]+d[2]*d[2];s(m>0),m=Math.sqrt(m),d[0]/=m,d[1]/=m,d[2]/=m;},longAxis_:function longAxis_(d){var m=0;return Math.abs(d[1])>Math.abs(d[0])&&(m=1),Math.abs(d[2])>Math.abs(d[m])&&(m=2),m;},computeNormal_:function computeNormal_(d){var m,p,S,E,R,D,U=[0,0,0],M=[0,0,0],W=[0,0,0],$=[0,0,0],B=[0,0,0],N=[null,null,null],z=[null,null,null],J=this.mesh.vHead,et;for(m=J.next,et=0;et<3;++et)E=m.coords[et],M[et]=E,z[et]=m,U[et]=E,N[et]=m;for(m=J.next;m!==J;m=m.next)for(et=0;et<3;++et)E=m.coords[et],E<M[et]&&(M[et]=E,z[et]=m),E>U[et]&&(U[et]=E,N[et]=m);if(et=0,U[1]-M[1]>U[0]-M[0]&&(et=1),U[2]-M[2]>U[et]-M[et]&&(et=2),M[et]>=U[et]){d[0]=0,d[1]=0,d[2]=1;return;}for(D=0,p=z[et],S=N[et],W[0]=p.coords[0]-S.coords[0],W[1]=p.coords[1]-S.coords[1],W[2]=p.coords[2]-S.coords[2],m=J.next;m!==J;m=m.next)$[0]=m.coords[0]-S.coords[0],$[1]=m.coords[1]-S.coords[1],$[2]=m.coords[2]-S.coords[2],B[0]=W[1]*$[2]-W[2]*$[1],B[1]=W[2]*$[0]-W[0]*$[2],B[2]=W[0]*$[1]-W[1]*$[0],R=B[0]*B[0]+B[1]*B[1]+B[2]*B[2],R>D&&(D=R,d[0]=B[0],d[1]=B[1],d[2]=B[2]);D<=0&&(d[0]=d[1]=d[2]=0,d[this.longAxis_(W)]=1);},checkOrientation_:function checkOrientation_(){var d,m,p=this.mesh.fHead,S,E=this.mesh.vHead,R;for(d=0,m=p.next;m!==p;m=m.next)if(R=m.anEdge,!(R.winding<=0))do d+=(R.Org.s-R.Dst.s)*(R.Org.t+R.Dst.t),R=R.Lnext;while(R!==m.anEdge);if(d<0){for(S=E.next;S!==E;S=S.next)S.t=-S.t;this.tUnit[0]=-this.tUnit[0],this.tUnit[1]=-this.tUnit[1],this.tUnit[2]=-this.tUnit[2];}},/* #ifdef FOR_TRITE_TEST_PROGRAM
|
|
134
|
+
#include <stdlib.h>
|
|
135
|
+
extern int RandomSweep;
|
|
136
|
+
#define S_UNIT_X (RandomSweep ? (2*drand48()-1) : 1.0)
|
|
137
|
+
#define S_UNIT_Y (RandomSweep ? (2*drand48()-1) : 0.0)
|
|
138
|
+
#else
|
|
139
|
+
#if defined(SLANTED_SWEEP) *//* The "feature merging" is not intended to be complete. There are
|
|
140
|
+
* special cases where edges are nearly parallel to the sweep line
|
|
141
|
+
* which are not implemented. The algorithm should still behave
|
|
142
|
+
* robustly (ie. produce a reasonable tesselation) in the presence
|
|
143
|
+
* of such edges, however it may miss features which could have been
|
|
144
|
+
* merged. We could minimize this effect by choosing the sweep line
|
|
145
|
+
* direction to be something unusual (ie. not parallel to one of the
|
|
146
|
+
* coordinate axes).
|
|
147
|
+
*//* #define S_UNIT_X (TESSreal)0.50941539564955385 // Pre-normalized
|
|
148
|
+
#define S_UNIT_Y (TESSreal)0.86052074622010633
|
|
149
|
+
#else
|
|
150
|
+
#define S_UNIT_X (TESSreal)1.0
|
|
151
|
+
#define S_UNIT_Y (TESSreal)0.0
|
|
152
|
+
#endif
|
|
153
|
+
#endif*//* Determine the polygon normal and project vertices onto the plane
|
|
154
|
+
* of the polygon.
|
|
155
|
+
*/projectPolygon_:function projectPolygon_(){var d,m=this.mesh.vHead,p=[0,0,0],S,E,R,D,U=!1;for(p[0]=this.normal[0],p[1]=this.normal[1],p[2]=this.normal[2],p[0]===0&&p[1]===0&&p[2]===0&&(this.computeNormal_(p),U=!0),S=this.sUnit,E=this.tUnit,R=this.longAxis_(p),S[R]=0,S[(R+1)%3]=1,S[(R+2)%3]=0,E[R]=0,E[(R+1)%3]=0,E[(R+2)%3]=p[R]>0?1:-1,d=m.next;d!==m;d=d.next)d.s=this.dot_(d.coords,S),d.t=this.dot_(d.coords,E);for(U&&this.checkOrientation_(),D=!0,d=m.next;d!==m;d=d.next)D?(this.bmin[0]=this.bmax[0]=d.s,this.bmin[1]=this.bmax[1]=d.t,D=!1):(d.s<this.bmin[0]&&(this.bmin[0]=d.s),d.s>this.bmax[0]&&(this.bmax[0]=d.s),d.t<this.bmin[1]&&(this.bmin[1]=d.t),d.t>this.bmax[1]&&(this.bmax[1]=d.t));},addWinding_:function addWinding_(d,m){d.winding+=m.winding,d.Sym.winding+=m.Sym.winding;},/* tessMeshTessellateMonoRegion( face ) tessellates a monotone region
|
|
156
|
+
* (what else would it do??) The region must consist of a single
|
|
157
|
+
* loop of half-edges (see mesh.h) oriented CCW. "Monotone" in this
|
|
158
|
+
* case means that any vertical line intersects the interior of the
|
|
159
|
+
* region in a single interval.
|
|
160
|
+
*
|
|
161
|
+
* Tessellation consists of adding interior edges (actually pairs of
|
|
162
|
+
* half-edges), to split the region into non-overlapping triangles.
|
|
163
|
+
*
|
|
164
|
+
* The basic idea is explained in Preparata and Shamos (which I don''t
|
|
165
|
+
* have handy right now), although their implementation is more
|
|
166
|
+
* complicated than this one. The are two edge chains, an upper chain
|
|
167
|
+
* and a lower chain. We process all vertices from both chains in order,
|
|
168
|
+
* from right to left.
|
|
169
|
+
*
|
|
170
|
+
* The algorithm ensures that the following invariant holds after each
|
|
171
|
+
* vertex is processed: the untessellated region consists of two
|
|
172
|
+
* chains, where one chain (say the upper) is a single edge, and
|
|
173
|
+
* the other chain is concave. The left vertex of the single edge
|
|
174
|
+
* is always to the left of all vertices in the concave chain.
|
|
175
|
+
*
|
|
176
|
+
* Each step consists of adding the rightmost unprocessed vertex to one
|
|
177
|
+
* of the two chains, and forming a fan of triangles from the rightmost
|
|
178
|
+
* of two chain endpoints. Determining whether we can add each triangle
|
|
179
|
+
* to the fan is a simple orientation test. By making the fan as large
|
|
180
|
+
* as possible, we restore the invariant (check it yourself).
|
|
181
|
+
*/// int tessMeshTessellateMonoRegion( TESSmesh *mesh, TESSface *face )
|
|
182
|
+
tessellateMonoRegion_:function tessellateMonoRegion_(d,m){var p,S;for(p=m.anEdge,s(p.Lnext!==p&&p.Lnext.Lnext!==p);n.vertLeq(p.Dst,p.Org);p=p.Lprev);for(;n.vertLeq(p.Org,p.Dst);p=p.Lnext);for(S=p.Lprev;p.Lnext!==S;)if(n.vertLeq(p.Dst,S.Org)){for(;S.Lnext!==p&&(n.edgeGoesLeft(S.Lnext)||n.edgeSign(S.Org,S.Dst,S.Lnext.Dst)<=0);){var E=d.connect(S.Lnext,S);S=E.Sym;}S=S.Lprev;}else{for(;S.Lnext!==p&&(n.edgeGoesRight(p.Lprev)||n.edgeSign(p.Dst,p.Org,p.Lprev.Org)>=0);){var E=d.connect(p,p.Lprev);p=E.Sym;}p=p.Lnext;}for(s(S.Lnext!==p);S.Lnext.Lnext!==p;){var E=d.connect(S.Lnext,S);S=E.Sym;}return!0;},/* tessMeshTessellateInterior( mesh ) tessellates each region of
|
|
183
|
+
* the mesh which is marked "inside" the polygon. Each such region
|
|
184
|
+
* must be monotone.
|
|
185
|
+
*///int tessMeshTessellateInterior( TESSmesh *mesh )
|
|
186
|
+
tessellateInterior_:function tessellateInterior_(d){var m,p;for(m=d.fHead.next;m!==d.fHead;m=p)if(p=m.next,m.inside&&!this.tessellateMonoRegion_(d,m))return!1;return!0;},/* tessMeshDiscardExterior( mesh ) zaps (ie. sets to NULL) all faces
|
|
187
|
+
* which are not marked "inside" the polygon. Since further mesh operations
|
|
188
|
+
* on NULL faces are not allowed, the main purpose is to clean up the
|
|
189
|
+
* mesh so that exterior loops are not represented in the data structure.
|
|
190
|
+
*///void tessMeshDiscardExterior( TESSmesh *mesh )
|
|
191
|
+
discardExterior_:function discardExterior_(d){var m,p;for(m=d.fHead.next;m!==d.fHead;m=p)p=m.next,m.inside||d.zapFace(m);},/* tessMeshSetWindingNumber( mesh, value, keepOnlyBoundary ) resets the
|
|
192
|
+
* winding numbers on all edges so that regions marked "inside" the
|
|
193
|
+
* polygon have a winding number of "value", and regions outside
|
|
194
|
+
* have a winding number of 0.
|
|
195
|
+
*
|
|
196
|
+
* If keepOnlyBoundary is TRUE, it also deletes all edges which do not
|
|
197
|
+
* separate an interior region from an exterior one.
|
|
198
|
+
*/// int tessMeshSetWindingNumber( TESSmesh *mesh, int value, int keepOnlyBoundary )
|
|
199
|
+
setWindingNumber_:function setWindingNumber_(d,m,p){var S,E;for(S=d.eHead.next;S!==d.eHead;S=E)E=S.next,S.Rface.inside!==S.Lface.inside?S.winding=S.Lface.inside?m:-m:p?d["delete"](S):S.winding=0;},getNeighbourFace_:function getNeighbourFace_(d){return!d.Rface||!d.Rface.inside?-1:d.Rface.n;},outputPolymesh_:function outputPolymesh_(d,m,p,S){var E,R,D,U=0,M=0,W,$;for(p>3&&d.mergeConvexFaces(p),E=d.vHead.next;E!==d.vHead;E=E.next)E.n=-1;for(R=d.fHead.next;R!==d.fHead;R=R.next)if(R.n=-1,!!R.inside){D=R.anEdge,W=0;do E=D.Org,E.n===-1&&(E.n=M,M++),W++,D=D.Lnext;while(D!==R.anEdge);s(W<=p),R.n=U,++U;}for(this.elementCount=U,m===r.CONNECTED_POLYGONS&&(U*=2),this.elements=[],this.elements.length=U*p,this.vertexCount=M,this.vertices=[],this.vertices.length=M*S,this.vertexIndices=[],this.vertexIndices.length=M,E=d.vHead.next;E!==d.vHead;E=E.next)if(E.n!==-1){var B=E.n*S;this.vertices[B+0]=E.coords[0],this.vertices[B+1]=E.coords[1],S>2&&(this.vertices[B+2]=E.coords[2]),this.vertexIndices[E.n]=E.idx;}var N=0;for(R=d.fHead.next;R!==d.fHead;R=R.next)if(R.inside){D=R.anEdge,W=0;do E=D.Org,this.elements[N++]=E.n,W++,D=D.Lnext;while(D!==R.anEdge);for($=W;$<p;++$)this.elements[N++]=-1;if(m===r.CONNECTED_POLYGONS){D=R.anEdge;do this.elements[N++]=this.getNeighbourFace_(D),D=D.Lnext;while(D!==R.anEdge);for($=W;$<p;++$)this.elements[N++]=-1;}}},// void OutputContours( TESStesselator *tess, TESSmesh *mesh, int vertexSize )
|
|
200
|
+
outputContours_:function outputContours_(d,m){var p,S,E,R=0,D=0;for(this.vertexCount=0,this.elementCount=0,p=d.fHead.next;p!==d.fHead;p=p.next)if(p.inside){E=S=p.anEdge;do this.vertexCount++,S=S.Lnext;while(S!==E);this.elementCount++;}this.elements=[],this.elements.length=this.elementCount*2,this.vertices=[],this.vertices.length=this.vertexCount*m,this.vertexIndices=[],this.vertexIndices.length=this.vertexCount;var U=0,M=0,W=0;for(R=0,p=d.fHead.next;p!==d.fHead;p=p.next)if(p.inside){D=0,E=S=p.anEdge;do this.vertices[U++]=S.Org.coords[0],this.vertices[U++]=S.Org.coords[1],m>2&&(this.vertices[U++]=S.Org.coords[2]),this.vertexIndices[M++]=S.Org.idx,D++,S=S.Lnext;while(S!==E);this.elements[W++]=R,this.elements[W++]=D,R+=D;}},addContour:function addContour(d,m){var p,S;for(this.mesh===null&&(this.mesh=new u()),d<2&&(d=2),d>3&&(d=3),p=null,S=0;S<m.length;S+=d)p===null?(p=this.mesh.makeEdge(),this.mesh.splice(p,p.Sym)):(this.mesh.splitEdge(p),p=p.Lnext),p.Org.coords[0]=m[S+0],p.Org.coords[1]=m[S+1],d>2?p.Org.coords[2]=m[S+2]:p.Org.coords[2]=0,p.Org.idx=this.vertexIndexCounter++,p.winding=1,p.Sym.winding=-1;},// int tessTesselate( TESStesselator *tess, int windingRule, int elementType, int polySize, int vertexSize, const TESSreal* normal )
|
|
201
|
+
tesselate:function tesselate(d,m,p,S,E){if(this.vertices=[],this.elements=[],this.vertexIndices=[],this.vertexIndexCounter=0,E&&(this.normal[0]=E[0],this.normal[1]=E[1],this.normal[2]=E[2]),this.windingRule=d,S<2&&(S=2),S>3&&(S=3),!this.mesh)return!1;this.projectPolygon_(),P.computeInterior(this);var R=this.mesh;return m===r.BOUNDARY_CONTOURS?this.setWindingNumber_(R,1,!0):this.tessellateInterior_(R),R.check(),m===r.BOUNDARY_CONTOURS?this.outputContours_(R,S):this.outputPolymesh_(R,m,p,S),!0;}};},/* 62 *//***/function(i,e){i.exports=r;var t=Object.prototype.hasOwnProperty;function r(){for(var n={},s=0;s<arguments.length;s++){var c=arguments[s];for(var l in c)t.call(c,l)&&(n[l]=c[l]);}return n;}},/* 63 *//***/function(i,e,t){t.r(e),t.d(e,"createShaders",function(){return f;}),t.d(e,"applyShader",function(){return u;}),t.d(e,"createCloudShaders",function(){return h;}),t.d(e,"applyCloudShader",function(){return y;});var r=t(64),n=t(65),s=t(66),c=t(67);t(1).glMatrix.setMatrixArrayType(Array);var l=Symbol("shaders");function f(T){T[l]=[];for(var O=0;O<16;O++){var I=[],P=!!(O&1),_w1=!!(O&2),_d0=!!(O&4),m=!!(O&8);P&&I.push("#define TEXTURE 1"),_w1&&I.push("#define FILTER 1"),_d0&&I.push("#define GRADIENT 1"),m&&I.push("#define CLIPPATH 1");var p="".concat(I.join("\n"),"\n"),S=[];P&&S.push("uniform sampler2D u_texSampler;"),m&&S.push("uniform sampler2D u_clipSampler;"),T[l][O]=[p+S.join("\n")+n["default"],p+r["default"]];}}function u(T){var _ref91=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref91$hasTexture=_ref91.hasTexture,O=_ref91$hasTexture===void 0?!1:_ref91$hasTexture,_ref91$hasFilter=_ref91.hasFilter,I=_ref91$hasFilter===void 0?!1:_ref91$hasFilter,_ref91$hasGradient=_ref91.hasGradient,P=_ref91$hasGradient===void 0?!1:_ref91$hasGradient,_ref91$hasClipPath=_ref91.hasClipPath,w=_ref91$hasClipPath===void 0?!1:_ref91$hasClipPath;var d=O|I<<1|P<<2|w<<3;var m=T[l][d];Array.isArray(m)&&(m=T.createProgram.apply(T,_toConsumableArray(m)),T[l][d]=m),T.program!==m&&T.useProgram(m,{a_color:{type:"UNSIGNED_BYTE",normalize:!0}});}var v=[];function h(T){for(var O=0;O<64;O++){var I=[],P=!!(O&1),_w10=!!(O&2),_d1=!!(O&4),m=!!(O&8),p=!!(O&16),S=!!(O&32);P&&I.push("#define TEXTURE 1"),_w10&&I.push("#define FILTER 1"),_d1&&I.push("#define GRADIENT 1"),m&&I.push("#define CLOUDCOLOR 1"),p&&I.push("#define CLOUDFILTER 1"),S&&I.push("#define CLIPPATH 1");var E="".concat(I.join("\n"),"\n"),R=[];if(P){R.push("uniform sampler2D u_texSampler;");for(var D=0;D<12;D++)R.push("uniform sampler2D u_texFrame".concat(D,";"));}S&&R.push("uniform sampler2D u_clipSampler;"),v[O]=[E+R.join("\n")+c["default"],E+s["default"]];}}function y(T){var _ref92=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref92$hasTexture=_ref92.hasTexture,O=_ref92$hasTexture===void 0?!1:_ref92$hasTexture,_ref92$hasFilter=_ref92.hasFilter,I=_ref92$hasFilter===void 0?!1:_ref92$hasFilter,_ref92$hasGradient=_ref92.hasGradient,P=_ref92$hasGradient===void 0?!1:_ref92$hasGradient,_ref92$hasCloudColor=_ref92.hasCloudColor,w=_ref92$hasCloudColor===void 0?!1:_ref92$hasCloudColor,_ref92$hasCloudFilter=_ref92.hasCloudFilter,d=_ref92$hasCloudFilter===void 0?!1:_ref92$hasCloudFilter,_ref92$hasClipPath=_ref92.hasClipPath,m=_ref92$hasClipPath===void 0?!1:_ref92$hasClipPath;var p=O|I<<1|P<<2|w<<3|d<<4|m<<5;var S=v[p];Array.isArray(S)&&(S=T.createProgram.apply(T,_toConsumableArray(S)),v[p]=S),T.program!==S&&T.useProgram(S,{a_color:{type:"UNSIGNED_BYTE",normalize:!0},a_fillCloudColor:{type:"UNSIGNED_BYTE",normalize:!0},a_strokeCloudColor:{type:"UNSIGNED_BYTE",normalize:!0},a_frameIndex:{type:"UNSIGNED_BYTE",normalize:!1}});}},/* 64 *//***/function(i,e,t){t.r(e),e["default"]="attribute vec3 a_vertexPosition;\nattribute vec4 a_color;\nvarying vec4 vColor;\nvarying float flagBackground;\nuniform vec2 u_resolution;\nuniform mat3 viewMatrix;\nuniform mat3 projectionMatrix;\n\n#ifdef TEXTURE\nattribute vec3 a_vertexTextureCoord;\nvarying vec3 vTextureCoord;\nattribute vec4 a_sourceRect;\nvarying vec4 vSourceRect;\n#endif\n\n#ifdef CLIPPATH\nattribute vec2 a_clipUV;\nvarying vec2 vClipUV;\n#endif\n\n#ifdef GRADIENT\nuniform float u_radialGradientVector[6];\nvarying vec3 vGradientVector1;\nvarying vec3 vGradientVector2;\n#endif\n\nvoid main() {\n gl_PointSize = 1.0;\n\n vec3 pos = projectionMatrix * viewMatrix * vec3(a_vertexPosition.xy, 1.0);\n gl_Position = vec4(pos.xy, 1.0, 1.0);\n\n#ifdef GRADIENT\n vec3 vg1 = viewMatrix * vec3(u_radialGradientVector[0], u_radialGradientVector[1], 1.0);\n vec3 vg2 = viewMatrix * vec3(u_radialGradientVector[3], u_radialGradientVector[4], 1.0);\n float h = u_resolution.y;\n vg1.y = h - vg1.y;\n vg2.y = h - vg2.y;\n vGradientVector1 = vec3(vg1.xy, u_radialGradientVector[2]);\n vGradientVector2 = vec3(vg2.xy, u_radialGradientVector[5]);\n#endif\n \n flagBackground = a_vertexPosition.z;\n vColor = a_color;\n\n#ifdef TEXTURE\n vTextureCoord = a_vertexTextureCoord;\n vSourceRect = a_sourceRect;\n#endif\n\n#ifdef CLIPPATH\n vClipUV = a_clipUV;\n#endif\n}";},/* 65 *//***/function(i,e,t){t.r(e),e["default"]="precision mediump float;\n\nvarying vec4 vColor;\nvarying float flagBackground;\n\n#ifdef TEXTURE\nvarying vec3 vTextureCoord;\nvarying vec4 vSourceRect;\n#endif\n\n#ifdef CLIPPATH\nvarying vec2 vClipUV;\n#endif\n\n#ifdef FILTER\nuniform int u_filterFlag;\nuniform float u_colorMatrix[20];\n#endif\n\n#ifdef GRADIENT\nvarying vec3 vGradientVector1;\nvarying vec3 vGradientVector2;\nuniform float u_colorSteps[40];\nuniform int u_gradientType;\n// uniform float u_radialGradientVector[6];\n\nvoid gradient(inout vec4 color, vec3 gv1, vec3 gv2, float colorSteps[40]) {\n float t;\n // center circle radius\n float cr = gv1.z;\n // focal circle radius\n float fr = gv2.z;\n\n if(cr > 0.0 || fr > 0.0) {\n // radial gradient\n vec2 center = gv1.xy;\n vec2 focal = gv2.xy;\n float x = focal.x - gl_FragCoord.x;\n float y = focal.y - gl_FragCoord.y;\n float dx = focal.x - center.x;\n float dy = focal.y - center.y;\n float dr = cr - fr;\n float a = dx * dx + dy * dy - dr * dr;\n float b = -2.0 * (y * dy + x * dx + fr * dr);\n float c = x * x + y * y - fr * fr;\n t = 1.0 - 0.5 * (1.0 / a) * (-b + sqrt(b * b - 4.0 * a * c));\n } else {\n // linear gradient\n vec2 v1 = gl_FragCoord.xy - gv1.xy;\n vec2 v2 = gv2.xy - gv1.xy;\n t = (v1.x * v2.x + v1.y * v2.y) / (v2.x * v2.x + v2.y * v2.y);\n }\n\n vec4 colors[8];\n colors[0] = vec4(colorSteps[1], colorSteps[2], colorSteps[3], colorSteps[4]);\n colors[1] = vec4(colorSteps[6], colorSteps[7], colorSteps[8], colorSteps[9]);\n colors[2] = vec4(colorSteps[11], colorSteps[12], colorSteps[13], colorSteps[14]);\n colors[3] = vec4(colorSteps[16], colorSteps[17], colorSteps[18], colorSteps[19]);\n colors[4] = vec4(colorSteps[21], colorSteps[22], colorSteps[23], colorSteps[24]);\n colors[5] = vec4(colorSteps[26], colorSteps[27], colorSteps[28], colorSteps[29]);\n colors[6] = vec4(colorSteps[31], colorSteps[32], colorSteps[33], colorSteps[34]);\n colors[7] = vec4(colorSteps[36], colorSteps[37], colorSteps[38], colorSteps[39]);\n \n float steps[8];\n steps[0] = colorSteps[0];\n steps[1] = colorSteps[5];\n steps[2] = colorSteps[10];\n steps[3] = colorSteps[15];\n steps[4] = colorSteps[20];\n steps[5] = colorSteps[25];\n steps[6] = colorSteps[30];\n steps[7] = colorSteps[35];\n\n color = colors[0];\n for (int i = 1; i < 8; i++) {\n if (steps[i] < 0.0 || steps[i] > 1.0) {\n break;\n }\n if(steps[i] == steps[i - 1]) {\n color = colors[i];\n } else {\n color = mix(color, colors[i], clamp((t - steps[i - 1]) / (steps[i] - steps[i - 1]), 0.0, 1.0));\n }\n if (steps[i] >= t) {\n break;\n }\n }\n}\n#endif\n\n#ifdef FILTER\nvoid transformColor(inout vec4 color, in float colorMatrix[20]) {\n float r = color.r, g = color.g, b = color.b, a = color.a;\n color[0] = colorMatrix[0] * r + colorMatrix[1] * g + colorMatrix[2] * b + colorMatrix[3] * a + colorMatrix[4];\n color[1] = colorMatrix[5] * r + colorMatrix[6] * g + colorMatrix[7] * b + colorMatrix[8] * a + colorMatrix[9];\n color[2] = colorMatrix[10] * r + colorMatrix[11] * g + colorMatrix[12] * b + colorMatrix[13] * a + colorMatrix[14];\n color[3] = colorMatrix[15] * r + colorMatrix[16] * g + colorMatrix[17] * b + colorMatrix[18] * a + colorMatrix[19];\n}\n#endif\n\nvoid main() {\n vec4 color = vColor;\n float opacity = abs(flagBackground);\n\n#ifdef GRADIENT\n if(u_gradientType > 0 && flagBackground > 0.0 || u_gradientType == 0 && flagBackground <= 0.0) {\n gradient(color, vGradientVector1, vGradientVector2, u_colorSteps);\n }\n#endif\n\n if(opacity < 1.0) {\n color.a *= opacity;\n }\n\n#ifdef TEXTURE\n if(flagBackground > 0.0) {\n vec3 texCoord = vTextureCoord;\n\n if(texCoord.z == 1.0) {\n texCoord = fract(texCoord);\n }\n\n if(texCoord.x <= 1.0 && texCoord.x >= 0.0\n && texCoord.y <= 1.0 && texCoord.y >= 0.0) {\n if(vSourceRect.z > 0.0) {\n texCoord.x = vSourceRect.x + texCoord.x * vSourceRect.z;\n texCoord.y = 1.0 - (vSourceRect.y + (1.0 - texCoord.y) * vSourceRect.w);\n }\n vec4 texColor = texture2D(u_texSampler, texCoord.xy);\n float alpha = texColor.a;\n if(opacity < 1.0) {\n texColor.a *= opacity;\n alpha *= mix(0.465, 1.0, opacity);\n }\n // color = mix(color, texColor, texColor.a);\n color.rgb = mix(color.rgb, texColor.rgb, alpha);\n // color.rgb = mix(texColor.rgb, color.rgb, color.a);\n color.rgb = mix(texColor.rgb, color.rgb, clamp(color.a / max(0.0001, texColor.a), 0.0, 1.0));\n color.a = texColor.a + (1.0 - texColor.a) * color.a;\n }\n }\n#endif\n\n#ifdef FILTER\n if(u_filterFlag > 0) {\n transformColor(color, u_colorMatrix);\n }\n#endif\n\n#ifdef CLIPPATH\n float clip = texture2D(u_clipSampler, vClipUV).r;\n color *= clip;\n#endif\n\n gl_FragColor = color;\n}";},/* 66 *//***/function(i,e,t){t.r(e),e["default"]="attribute vec3 a_vertexPosition;\nattribute vec4 a_color;\nvarying vec4 vColor;\nvarying float flagBackground;\nattribute vec3 a_transform0;\nattribute vec3 a_transform1;\nuniform vec2 u_resolution;\nuniform mat3 viewMatrix;\nuniform mat3 projectionMatrix;\n\n#ifdef TEXTURE\nattribute vec3 a_vertexTextureCoord;\nvarying vec3 vTextureCoord;\nattribute float a_frameIndex;\nvarying float frameIndex;\nattribute vec4 a_sourceRect;\nvarying vec4 vSourceRect;\n#endif\n\n#ifdef CLIPPATH\nattribute vec2 a_clipUV;\nvarying vec2 vClipUV;\n#endif\n\n#ifdef CLOUDFILTER\nattribute vec4 a_colorCloud0;\nattribute vec4 a_colorCloud1;\nattribute vec4 a_colorCloud2;\nattribute vec4 a_colorCloud3;\nattribute vec4 a_colorCloud4;\nvarying vec4 colorCloud0;\nvarying vec4 colorCloud1;\nvarying vec4 colorCloud2;\nvarying vec4 colorCloud3;\nvarying vec4 colorCloud4;\n#endif\n\n#ifdef CLOUDCOLOR\nattribute vec4 a_fillCloudColor;\nattribute vec4 a_strokeCloudColor;\n#endif\n\n#ifdef GRADIENT\nuniform float u_radialGradientVector[6];\nvarying vec3 vGradientVector1;\nvarying vec3 vGradientVector2;\n#endif\n\nvoid main() {\n gl_PointSize = 1.0;\n\n mat3 modelMatrix = mat3(\n a_transform0.x, a_transform1.x, 0, \n a_transform0.y, a_transform1.y, 0,\n a_transform0.z, a_transform1.z, 1\n );\n\n vec3 pos = projectionMatrix * viewMatrix * modelMatrix * vec3(a_vertexPosition.xy, 1.0);\n gl_Position = vec4(pos.xy, 1.0, 1.0);\n\n#ifdef GRADIENT\n vec3 vg1 = viewMatrix * vec3(u_radialGradientVector[0], u_radialGradientVector[1], 1.0);\n vec3 vg2 = viewMatrix * vec3(u_radialGradientVector[3], u_radialGradientVector[4], 1.0);\n float h = u_resolution.y;\n vg1.y = h - vg1.y;\n vg2.y = h - vg2.y;\n vGradientVector1 = vec3(vg1.xy, u_radialGradientVector[2]);\n vGradientVector2 = vec3(vg2.xy, u_radialGradientVector[5]);\n#endif\n \n flagBackground = a_vertexPosition.z;\n\n#ifdef CLOUDCOLOR\n if(flagBackground > 0.0) {\n vColor = mix(a_color, a_fillCloudColor, a_fillCloudColor.a);\n } else {\n vColor = mix(a_color, a_strokeCloudColor, a_strokeCloudColor.a);\n }\n#else\n vColor = a_color;\n#endif\n\n#ifdef TEXTURE\n vTextureCoord = a_vertexTextureCoord;\n frameIndex = a_frameIndex;\n vSourceRect = a_sourceRect;\n#endif\n\n#ifdef CLIPPATH\n vClipUV = a_clipUV;\n#endif\n\n#ifdef CLOUDFILTER\n colorCloud0 = a_colorCloud0;\n colorCloud1 = a_colorCloud1;\n colorCloud2 = a_colorCloud2;\n colorCloud3 = a_colorCloud3;\n colorCloud4 = a_colorCloud4;\n#endif\n}";},/* 67 *//***/function(i,e,t){t.r(e),e["default"]="precision mediump float;\n\nvarying vec4 vColor;\nvarying float flagBackground;\n\n#ifdef TEXTURE\nvarying float frameIndex;\nvarying vec3 vTextureCoord;\nvarying vec4 vSourceRect;\n#endif\n\n#ifdef CLIPPATH\nvarying vec2 vClipUV;\n#endif\n\n#ifdef FILTER\nuniform int u_filterFlag;\nuniform float u_colorMatrix[20];\n#endif\n\n#ifdef CLOUDFILTER\nvarying vec4 colorCloud0;\nvarying vec4 colorCloud1;\nvarying vec4 colorCloud2;\nvarying vec4 colorCloud3;\nvarying vec4 colorCloud4;\n#endif\n\n#ifdef GRADIENT\nvarying vec3 vGradientVector1;\nvarying vec3 vGradientVector2;\nuniform float u_colorSteps[40];\nuniform int u_gradientType;\n\nvoid gradient(inout vec4 color, vec3 gv1, vec3 gv2, float colorSteps[40]) {\n float t;\n // center circle radius\n float cr = gv1.z;\n // focal circle radius\n float fr = gv2.z;\n\n if(cr > 0.0 || fr > 0.0) {\n // radial gradient\n vec2 center = gv1.xy;\n vec2 focal = gv2.xy;\n float x = focal.x - gl_FragCoord.x;\n float y = focal.y - gl_FragCoord.y;\n float dx = focal.x - center.x;\n float dy = focal.y - center.y;\n float dr = cr - fr;\n float a = dx * dx + dy * dy - dr * dr;\n float b = -2.0 * (y * dy + x * dx + fr * dr);\n float c = x * x + y * y - fr * fr;\n t = 1.0 - 0.5 * (1.0 / a) * (-b + sqrt(b * b - 4.0 * a * c));\n } else {\n // linear gradient\n vec2 v1 = gl_FragCoord.xy - gv1.xy;\n vec2 v2 = gv2.xy - gv1.xy;\n t = (v1.x * v2.x + v1.y * v2.y) / (v2.x * v2.x + v2.y * v2.y);\n }\n\n vec4 colors[8];\n colors[0] = vec4(colorSteps[1], colorSteps[2], colorSteps[3], colorSteps[4]);\n colors[1] = vec4(colorSteps[6], colorSteps[7], colorSteps[8], colorSteps[9]);\n colors[2] = vec4(colorSteps[11], colorSteps[12], colorSteps[13], colorSteps[14]);\n colors[3] = vec4(colorSteps[16], colorSteps[17], colorSteps[18], colorSteps[19]);\n colors[4] = vec4(colorSteps[21], colorSteps[22], colorSteps[23], colorSteps[24]);\n colors[5] = vec4(colorSteps[26], colorSteps[27], colorSteps[28], colorSteps[29]);\n colors[6] = vec4(colorSteps[31], colorSteps[32], colorSteps[33], colorSteps[34]);\n colors[7] = vec4(colorSteps[36], colorSteps[37], colorSteps[38], colorSteps[39]);\n \n float steps[8];\n steps[0] = colorSteps[0];\n steps[1] = colorSteps[5];\n steps[2] = colorSteps[10];\n steps[3] = colorSteps[15];\n steps[4] = colorSteps[20];\n steps[5] = colorSteps[25];\n steps[6] = colorSteps[30];\n steps[7] = colorSteps[35];\n\n color = colors[0];\n for (int i = 1; i < 8; i++) {\n if (steps[i] < 0.0 || steps[i] > 1.0) {\n break;\n }\n if(steps[i] == steps[i - 1]) {\n color = colors[i];\n } else {\n color = mix(color, colors[i], clamp((t - steps[i - 1]) / (steps[i] - steps[i - 1]), 0.0, 1.0));\n }\n if (steps[i] >= t) {\n break;\n }\n }\n}\n#endif\n\nvoid transformColor(inout vec4 color, in float colorMatrix[20]) {\n float r = color.r, g = color.g, b = color.b, a = color.a;\n color[0] = colorMatrix[0] * r + colorMatrix[1] * g + colorMatrix[2] * b + colorMatrix[3] * a + colorMatrix[4];\n color[1] = colorMatrix[5] * r + colorMatrix[6] * g + colorMatrix[7] * b + colorMatrix[8] * a + colorMatrix[9];\n color[2] = colorMatrix[10] * r + colorMatrix[11] * g + colorMatrix[12] * b + colorMatrix[13] * a + colorMatrix[14];\n color[3] = colorMatrix[15] * r + colorMatrix[16] * g + colorMatrix[17] * b + colorMatrix[18] * a + colorMatrix[19];\n}\n\n#ifdef CLOUDFILTER\nvoid buildCloudColor(inout float colorCloudMatrix[20]) {\n colorCloudMatrix[0] = colorCloud0[0];\n colorCloudMatrix[1] = colorCloud1[0];\n colorCloudMatrix[2] = colorCloud2[0];\n colorCloudMatrix[3] = colorCloud3[0];\n colorCloudMatrix[4] = colorCloud4[0];\n\n colorCloudMatrix[5] = colorCloud0[1];\n colorCloudMatrix[6] = colorCloud1[1];\n colorCloudMatrix[7] = colorCloud2[1];\n colorCloudMatrix[8] = colorCloud3[1];\n colorCloudMatrix[9] = colorCloud4[1];\n\n colorCloudMatrix[10] = colorCloud0[2];\n colorCloudMatrix[11] = colorCloud1[2];\n colorCloudMatrix[12] = colorCloud2[2];\n colorCloudMatrix[13] = colorCloud3[2];\n colorCloudMatrix[14] = colorCloud4[2];\n\n colorCloudMatrix[15] = colorCloud0[3];\n colorCloudMatrix[16] = colorCloud1[3];\n colorCloudMatrix[17] = colorCloud2[3];\n colorCloudMatrix[18] = colorCloud3[3];\n colorCloudMatrix[19] = colorCloud4[3];\n}\n#endif\n\nvoid main() {\n vec4 color = vColor;\n float opacity = abs(flagBackground);\n\n#ifdef GRADIENT\n if(u_gradientType > 0 && flagBackground > 0.0 || u_gradientType == 0 && flagBackground <= 0.0) {\n gradient(color, vGradientVector1, vGradientVector2, u_colorSteps);\n }\n#endif\n\n if(opacity < 1.0) {\n color.a *= opacity;\n }\n\n#ifdef TEXTURE\n if(flagBackground > 0.0) {\n vec3 texCoord = vTextureCoord;\n\n if(texCoord.z == 1.0) {\n texCoord = fract(texCoord);\n }\n\n if(texCoord.x <= 1.0 && texCoord.x >= 0.0\n && texCoord.y <= 1.0 && texCoord.y >= 0.0) {\n if(vSourceRect.z > 0.0) {\n texCoord.x = vSourceRect.x + texCoord.x * vSourceRect.z;\n texCoord.y = 1.0 - (vSourceRect.y + (1.0 - texCoord.y) * vSourceRect.w);\n }\n if(frameIndex < 0.0) {\n vec4 texColor = texture2D(u_texSampler, texCoord.xy);\n color = mix(color, texColor, texColor.a);\n } else {\n int index = int(floor(clamp(0.0, 11.0, frameIndex)));\n vec4 texColor;\n if(index == 0) texColor = texture2D(u_texFrame0, texCoord.xy);\n else if(index == 1) texColor = texture2D(u_texFrame1, texCoord.xy);\n else if(index == 2) texColor = texture2D(u_texFrame2, texCoord.xy);\n else if(index == 3) texColor = texture2D(u_texFrame3, texCoord.xy);\n else if(index == 4) texColor = texture2D(u_texFrame4, texCoord.xy);\n else if(index == 5) texColor = texture2D(u_texFrame5, texCoord.xy);\n else if(index == 6) texColor = texture2D(u_texFrame6, texCoord.xy);\n else if(index == 7) texColor = texture2D(u_texFrame7, texCoord.xy);\n else if(index == 8) texColor = texture2D(u_texFrame8, texCoord.xy);\n else if(index == 9) texColor = texture2D(u_texFrame9, texCoord.xy);\n else if(index == 10) texColor = texture2D(u_texFrame10, texCoord.xy);\n else texColor = texture2D(u_texFrame11, texCoord.xy);\n float alpha = texColor.a;\n if(opacity < 1.0) {\n texColor.a *= opacity;\n alpha *= mix(0.465, 1.0, opacity);\n }\n // color = mix(color, texColor, texColor.a);\n color.rgb = mix(color.rgb, texColor.rgb, alpha);\n // color.rgb = mix(texColor.rgb, color.rgb, color.a);\n color.rgb = mix(texColor.rgb, color.rgb, clamp(color.a / max(0.0001, texColor.a), 0.0, 1.0));\n color.a = texColor.a + (1.0 - texColor.a) * color.a;\n }\n }\n }\n#endif\n\n#ifdef FILTER\n if(u_filterFlag > 0) {\n transformColor(color, u_colorMatrix);\n }\n#endif\n\n#ifdef CLOUDFILTER\n float colorCloudMatrix[20];\n buildCloudColor(colorCloudMatrix);\n transformColor(color, colorCloudMatrix);\n#endif\n\n#ifdef CLIPPATH\n float clip = texture2D(u_clipSampler, vClipUV).r;\n color *= clip;\n#endif\n\n gl_FragColor = color;\n}";},/* 68 *//***/function(i,e,t){t.r(e),function(r,n){t.d(e,"requestAnimationFrame",function(){return c;}),t.d(e,"cancelAnimationFrame",function(){return l;}),t(1).glMatrix.setMatrixArrayType(Array);function s(){if((typeof performance==="undefined"?"undefined":_typeof(performance))<"u"&&performance.now)return performance.now();if(_typeof(r)<"u"&&r.hrtime){var _r$hrtime=r.hrtime(),_r$hrtime2=_slicedToArray(_r$hrtime,2),f=_r$hrtime2[0],u=_r$hrtime2[1];return f*1e3+u*1e-6;}return Date.now?Date.now():(/* @__PURE__ */new Date()).getTime();}var c,l;_typeof(n)<"u"&&typeof n.requestAnimationFrame=="function"?(c=n.requestAnimationFrame,l=n.cancelAnimationFrame):(c=function c(f){return setTimeout(function(){f(s());},16);},l=function l(f){return clearTimeout(f);});}.call(this,t(69),t(22));},/* 69 *//***/function(i,e){var t=i.exports={},r,n;function s(){throw new Error("setTimeout has not been defined");}function c(){throw new Error("clearTimeout has not been defined");}(function(){try{typeof setTimeout=="function"?r=setTimeout:r=s;}catch(_unused4){r=s;}try{typeof clearTimeout=="function"?n=clearTimeout:n=c;}catch(_unused5){n=c;}})();function l(w){if(r===setTimeout)return setTimeout(w,0);if((r===s||!r)&&setTimeout)return r=setTimeout,setTimeout(w,0);try{return r(w,0);}catch(_unused6){try{return r.call(null,w,0);}catch(_unused7){return r.call(this,w,0);}}}function f(w){if(n===clearTimeout)return clearTimeout(w);if((n===c||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(w);try{return n(w);}catch(_unused8){try{return n.call(null,w);}catch(_unused9){return n.call(this,w);}}}var u=[],v=!1,h,y=-1;function T(){!v||!h||(v=!1,h.length?u=h.concat(u):y=-1,u.length&&O());}function O(){if(!v){var w=l(T);v=!0;for(var d=u.length;d;){for(h=u,u=[];++y<d;)h&&h[y].run();y=-1,d=u.length;}h=null,v=!1,f(w);}}t.nextTick=function(w){var d=new Array(arguments.length-1);if(arguments.length>1)for(var m=1;m<arguments.length;m++)d[m-1]=arguments[m];u.push(new I(w,d)),u.length===1&&!v&&l(O);};function I(w,d){this.fun=w,this.array=d;}I.prototype.run=function(){this.fun.apply(null,this.array);},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={};function P(){}t.on=P,t.addListener=P,t.once=P,t.off=P,t.removeListener=P,t.removeAllListeners=P,t.emit=P,t.prependListener=P,t.prependOnceListener=P,t.listeners=function(w){return[];},t.binding=function(w){throw new Error("process.binding is not supported");},t.cwd=function(){return"/";},t.chdir=function(w){throw new Error("process.chdir is not supported");},t.umask=function(){return 0;};},/* 70 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return D;});var r=t(1),n=t(71),s=t(73),c=t(213),l=t(214),f=t(215),u=t(216);t(1).glMatrix.setMatrixArrayType(Array);function v(U,M){var W=Object.keys(U);if(Object.getOwnPropertySymbols){var $=Object.getOwnPropertySymbols(U);M&&($=$.filter(function(B){return Object.getOwnPropertyDescriptor(U,B).enumerable;})),W.push.apply(W,$);}return W;}function h(U){for(var M=1;M<arguments.length;M++){var W=arguments[M]!=null?arguments[M]:{};M%2?v(Object(W),!0).forEach(function($){y(U,$,W[$]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(U,Object.getOwnPropertyDescriptors(W)):v(Object(W)).forEach(function($){Object.defineProperty(U,$,Object.getOwnPropertyDescriptor(W,$));});}return U;}function y(U,M,W){return M in U?Object.defineProperty(U,M,{value:W,enumerable:!0,configurable:!0,writable:!0}):U[M]=W,U;}var T=Symbol["for"]("spritejs_changedAttrs"),O=Symbol["for"]("spritejs_attributes"),I=Symbol("resolution"),P=Symbol("animations"),w=Symbol("eventListeners"),d=Symbol("captureEventListeners"),m=Symbol("filters"),p=Symbol("display"),S=Symbol("program"),E=Symbol("shaderAttrs"),R=Symbol("uniforms");var D=/*#__PURE__*/function(){function D(){var M=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,D);this.attributes=new this.constructor.Attr(this),this[I]={width:300,height:150},Object.assign(this.attributes,M),this[P]=/* @__PURE__ */new Set(),this[w]={},this[d]={};}return _createClass(D,[{key:"ancestors",get:function get(){var M=this.parent;var W=[];for(;M;)W.push(M),M=M.parent;return W;}},{key:"animations",get:function get(){return this[P];}},{key:"filters",get:function get(){return this[m]||this.parent&&this.parent.filters;}},{key:"isVisible",get:function get(){return!1;}},{key:"layer",get:function get(){return this.parent?this.parent.layer:null;}},{key:"localMatrix",get:function get(){var M=this.transformMatrix,_this$attributes=this.attributes,W=_this$attributes.x,$=_this$attributes.y;return M[4]+=W,M[5]+=$,M;}},{key:"opacity",get:function get(){var M=this.attributes.opacity;return this.parent&&this.parent.opacity!=null&&(M*=this.parent.opacity),M;}},{key:"parentNode",get:function get(){return this.parent;}},{key:"nextSibling",get:function get(){return this.getNodeNearBy(1);}},{key:"previousSibling",get:function get(){return this.getNodeNearBy(-1);}},{key:"program",get:function get(){return this[S];}/* get parent defined by connect method */},{key:"renderer",get:function get(){return this.parent?this.parent.renderer:null;}},{key:"renderMatrix",get:function get(){if(this.__cacheRenderMatrix)return this.__cacheRenderMatrix;var M=this.localMatrix;var W=this.parent;if(W){var $=W.__cacheRenderMatrix||W.renderMatrix;$&&(M=r.mat2d.multiply(Array.of(0,0,0,0,0,0),$,M));}return M;}},{key:"worldScaling",get:function get(){var M=this.renderMatrix;return[Math.hypot(M[0],M[1]),Math.hypot(M[2],M[3])];}},{key:"worldRotation",get:function get(){var M=this.renderMatrix;return Math.atan2(M[1],M[3]);}},{key:"worldPosition",get:function get(){var M=this.renderMatrix;return[M[4],M[5]];}},{key:"uniforms",get:function get(){return this[R];}/* get zOrder defined by connect method *//* attributes */},{key:"className",get:function get(){return this.attributes.className;},set:function set(M){this.attributes.className=M;}},{key:"id",get:function get(){return this.attributes.id;},set:function set(M){this.attributes.id=M;}},{key:"name",get:function get(){return this.attributes.name;},set:function set(M){this.attributes.name=M;}},{key:"zIndex",get:function get(){return this.attributes.zIndex;},set:function set(M){this.attributes.zIndex=M;}},{key:"mesh",get:function get(){return null;}},{key:"shaderAttrs",get:function get(){return this[E]||{};}},{key:"activateAnimations",value:function activateAnimations(){var M=this.layer;if(M){var W=this[P];W.forEach(function(B){B.baseTimeline=M.timeline,B.play(),B.finished.then(function(){W["delete"](B);});});var $=this.children;$&&$.forEach(function(B){B.activateAnimations&&B.activateAnimations();});}}},{key:"addEventListener",value:function addEventListener(M,W){var $=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};M==="mousewheel"&&(M="wheel"),typeof $=="boolean"&&($={capture:$});var _$8=$,B=_$8.capture,N=_$8.once,z=B?d:w;return this[z][M]=this[z][M]||[],this[z][M].push({listener:W,once:N}),this;}},{key:"animate",value:function animate(M,W){var _this8=this;var $=new s["default"](this,M,W);return this.effects&&$.applyEffects(this.effects),this.layer&&($.baseTimeline=this.layer.timeline,$.play(),$.finished.then(function(){_this8[P]["delete"]($);})),this[P].add($),$;}},{key:"attr",value:function attr(){for(var _len7=arguments.length,M=new Array(_len7),_key7=0;_key7<_len7;_key7++){M[_key7]=arguments[_key7];}if(M.length===0)return this.attributes[O];if(M.length>1){var W=M[0],$=M[1];return typeof $=="function"&&($=$(this.attr(W))),this.setAttribute(W,$),this;}return typeof M[0]=="string"?this.getAttribute(M[0]):(Object.assign(this.attributes,M[0]),this);}},{key:"cloneNode",value:function cloneNode(){var M=new this.constructor(),W=this.attributes[T];return M.attr(W),M;}},{key:"connect",value:function connect(M,W){Object.defineProperty(this,"parent",{value:M,writable:!1,configurable:!0}),Object.defineProperty(this,"zOrder",{value:W,writable:!1,configurable:!0}),M.timeline&&this.activateAnimations(),this.setResolution(M.getResolution()),this.forceUpdate(),this.dispatchEvent({type:"append",detail:{parent:M,zOrder:W}});}},{key:"contains",value:function contains(M){for(;M&&this!==M;)M=M.parent;return!!M;}},{key:"deactivateAnimations",value:function deactivateAnimations(){this[P].forEach(function(W){return W.cancel();});var M=this.children;M&&M.forEach(function(W){W.deactivateAnimations&&W.deactivateAnimations();});}},{key:"disconnect",value:function disconnect(){var M=this.parent,W=this.zOrder;delete this.parent,delete this.zOrder,this.deactivateAnimations(),this.dispatchEvent({type:"remove",detail:{parent:M,zOrder:W}}),M&&M.forceUpdate();}},{key:"dispatchEvent",value:function dispatchEvent(M){var _this9=this;M instanceof l["default"]||(M=new l["default"](M)),M.target=this;var W=M.type;W==="mousewheel"&&(W="wheel");var $=[this];var B=this.parent;for(;M.bubbles&&B;)$.push(B),B=B.parent;for(var N=$.length-1;N>=0;N--){var z=$[N],J=z[d]&&z[d][W];if(J&&J.length&&(M.currentTarget=z,J.forEach(function(_ref93){var et=_ref93.listener,at=_ref93.once;et.call(_this9,M),at&&$.removeEventListener(et);}),delete M.currentTarget),!M.bubbles&&M.cancelBubble)break;}if(!M.cancelBubble)for(var _N4=0;_N4<$.length;_N4++){var _z=$[_N4],_J3=_z[w]&&_z[w][W];if(_J3&&_J3.length&&(M.currentTarget=_z,_J3.forEach(function(_ref94){var et=_ref94.listener,at=_ref94.once;et.call(_this9,M),at&&$.removeEventListener(et);}),delete M.currentTarget),!M.bubbles||M.cancelBubble)break;}}},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(M){var W=M.layerX,$=M.layerY;return this.isPointCollision(W,$)?(this.dispatchEvent(M),!0):!1;}},{key:"draw",value:function draw(){var _this0=this;var M=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var W=this.mesh;if(W){if(Object(f.applyFilters)(W,this.filters),M.push(W),this[S]){W.setProgram(this[S]);var $=this[E];$&&Object.entries($).forEach(function(_ref95){var _ref96=_slicedToArray(_ref95,2),N=_ref96[0],z=_ref96[1];W.setAttribute(N,z);});var B=this[R];if(this[R]){var N={};Object.entries(B).forEach(function(_ref97){var _ref98=_slicedToArray(_ref97,2),z=_ref98[0],J=_ref98[1];typeof J=="function"&&(J=J(_this0,z)),N[z]=J;}),W.setUniforms(N);}}Object(u["default"])(this,W);}return M;}},{key:"forceUpdate",value:function forceUpdate(){this.parent&&this.parent.forceUpdate();}},{key:"getAttribute",value:function getAttribute(M){return this.attributes[M];}},{key:"getListeners",value:function getListeners(M){var _ref99=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref99$capture=_ref99.capture,W=_ref99$capture===void 0?!1:_ref99$capture;return _toConsumableArray(this[W?d:w][M]||[]);}},{key:"getNodeNearBy",value:function getNodeNearBy(){var M=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;if(!this.parent)return null;if(M===0)return this;var W=this.parent.children,$=W.indexOf(this);return W[$+M];}},{key:"getWorldPosition",value:function getWorldPosition(M,W){var $=this.renderMatrix,B=M*$[0]+W*$[2]+$[4],N=M*$[1]+W*$[3]+$[5];return[B,N];}},{key:"getOffsetPosition",value:function getOffsetPosition(M,W){var $=r.mat2d.invert(Array.of(0,0,0,0,0,0),this.renderMatrix),B=M*$[0]+W*$[2]+$[4],N=M*$[1]+W*$[3]+$[5];return[B,N];}},{key:"getResolution",value:function getResolution(){return h({},this[I]);}},{key:"isPointCollision",value:function isPointCollision(M,W){if(!this.mesh)return!1;var $=this.attributes.pointerEvents;if($==="none"||$!=="all"&&!this.isVisible)return!1;var B="both";return $==="visibleFill"&&(B="fill"),$==="visibleStroke"&&(B="stroke"),this.mesh.isPointCollision(M,W,B);}},{key:"onPropertyChange",value:function onPropertyChange(M,W,$){M!=="id"&&M!=="name"&&M!=="className"&&M!=="pointerEvents"&&M!=="passEvents"&&this.forceUpdate(),M==="filter"&&(this[m]=Object(f.parseFilterString)(W)),M==="zIndex"&&this.parent&&this.parent.reorder();}},{key:"setAttribute",value:function setAttribute(M,W){M==="attrs"&&this.attr(W),this.attributes[M]=W;}},{key:"setMouseCapture",value:function setMouseCapture(){this.layer&&(this.layer.__mouseCapturedTarget=this);}// layer.renderer.createProgram(fragmentShader, vertexShader, attributeOptions)
|
|
202
|
+
},{key:"setProgram",value:function setProgram(M){this[S]=M,this.forceUpdate();}},{key:"setShaderAttribute",value:function setShaderAttribute(M,W){this[E]=this[E]||{},this[E][M]=W,this.forceUpdate();}},{key:"setUniforms",value:function setUniforms(M){this[R]=this[R]||{},Object.assign(this[R],M),this.forceUpdate();}},{key:"setResolution",value:function setResolution(_ref100){var M=_ref100.width,W=_ref100.height;var _this$I3=this[I],$=_this$I3.width,B=_this$I3.height;($!==M||B!==W)&&(this[I]={width:M,height:W},this.forceUpdate(),this.dispatchEvent({type:"resolutionchange",detail:{width:M,height:W}}));}},{key:"show",value:function show(){this.attributes.display==="none"&&(this.attributes.display=this[p]||"");}},{key:"hide",value:function hide(){this.attributes.display!=="none"&&(this[p]=this.attributes.display,this.attributes.display="none");}},{key:"releaseMouseCapture",value:function releaseMouseCapture(){this.layer&&this.layer.__mouseCapturedTarget===this&&(this.layer.__mouseCapturedTarget=null);}},{key:"remove",value:function remove(){return this.parent&&this.parent.removeChild?(this.parent.removeChild(this),!0):!1;}},{key:"removeAllListeners",value:function removeAllListeners(M){var W=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};typeof W=="boolean"&&(W={capture:W});var B=W.capture?d:w;return this[B][M]&&(this[B][M]=[]),this;}},{key:"removeAttribute",value:function removeAttribute(M){this.setAttribute(M,null);}},{key:"removeEventListener",value:function removeEventListener(M,W){var $=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};typeof $=="boolean"&&($={capture:$});var N=$.capture?d:w;if(this[N][M]){var z=this[N][M];if(z)for(var J=0;J<z.length;J++){var et=z[J].listener;if(et===W){this[N][M].splice(J,1);break;}}}return this;}},{key:"transition",value:function transition(M){var W=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"linear";var $=this,B=Symbol("animation");W=W||"linear";var N=0;return _typeof(M)=="object"&&(N=M.delay||0,M=M.duration),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},B,null),"cancel",function cancel(){var z=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;var J=this[B];J&&J.cancel(z);}),"end",function end(){var z=this[B];z&&(z.playState==="running"||z.playState==="pending")&&z.finish();}),"reverse",function reverse(){var z=this[B];if(z)if(z.playState==="running"||z.playState==="pending")z.playbackRate=-z.playbackRate;else{var J=z.timing.direction;z.timing.direction=J==="reverse"?"normal":"reverse",z.play();}return z.finished;}),"attr",function attr(z,J){return this.end(),typeof z=="string"&&(z=_defineProperty({},z,J)),Object.entries(z).forEach(function(_ref101){var _ref102=_slicedToArray(_ref101,2),et=_ref102[0],at=_ref102[1];typeof at=="function"&&(z[et]=at($.attr(et)));}),this[B]=$.animate([z],{duration:M*1e3,delay:N*1e3,fill:"forwards",easing:W}),this[B].finished;});}},{key:"updateContours",value:function updateContours(){}}]);}();y(D,"Attr",n["default"]),c["default"].registerNode(D,"node");},/* 71 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return D;});var r=t(1),n=t(12),s=t(72);t(1).glMatrix.setMatrixArrayType(Array);var c=Symbol["for"]("spritejs_setAttributeDefault"),l=Symbol["for"]("spritejs_declareAlias"),f=Symbol["for"]("spritejs_setAttribute"),u=Symbol["for"]("spritejs_getAttribute"),v=Symbol["for"]("spritejs_attributes"),h=Symbol["for"]("spritejs_changedAttrs"),y=Symbol("subject"),T=Symbol("attr"),O=Symbol("default"),I=Symbol("alias");function P(U,_ref104){var _ref105=_slicedToArray(_ref104,2),M=_ref105[0],W=_ref105[1];var $=r.mat2d.fromValues(1,0,0,1,0,0);return _toConsumableArray(U).forEach(function(_ref106){var _ref107=_slicedToArray(_ref106,2),B=_ref107[0],N=_ref107[1];if((M||W)&&($=r.mat2d.translate(Array.of(0,0,0,0,0,0),$,[M,W])),B==="matrix")$=r.mat2d.multiply($,$,N);else if(B==="offsetTranslate")$[4]+=N[0],$[5]+=N[1];else if(B==="offsetRotate")$=r.mat2d.rotate(Array.of(0,0,0,0,0,0),$,N);else if(B==="skew"){var _N5=_slicedToArray(N,2),z=_N5[0],J=_N5[1];$=r.mat2d.multiply($,$,r.mat2d.fromValues(1,Math.tan(J),Math.tan(z),1,0,0));}else r.mat2d[B]($,$,N);(M||W)&&($=r.mat2d.translate(Array.of(0,0,0,0,0,0),$,[-M,-W]));}),$;}var w=Symbol("transformMatrix"),d=Symbol("transforms"),m=Symbol("changedAttrs"),p=Symbol("lastChangedAttr"),S=Symbol("offsetFigure");function E(U,M,W){var $=U[T][M];if(U[f](M,W,!1)||U[p]!==M){var N=U[d];N.has(M)&&N["delete"](M),W&&(M==="rotate"&&(W=Math.PI*W/180),M==="scale"&&(W=W.map(function(z){return Math.abs(z)>1e-5?z:1/z>0?1e-5:-1e-5;})),N.set(M,W)),U[w]=null,U[y].onPropertyChange(M,W,$,U);}}function R(U){var M=U[S],W=U.offsetDistance*M.getTotalLength(),$=M.getPointAtLength(W);if($){var B=U[d];var N=U.offsetRotate;N==="auto"?N=$.angle:N==="reverse"?N=Math.PI+$.angle:N=Math.PI*N/180,B.set("offsetRotate",N),B.set("offsetTranslate",[$.x,$.y]),U[w]=null;}}var D=/*#__PURE__*/function(){function D(M){var _this1=this;_classCallCheck(this,D);this[y]=M,this[T]={},this[w]=r.mat2d.fromValues(1,0,0,1,0,0),this[d]=/* @__PURE__ */new Map(),this[O]={},this[I]=[],Object.defineProperty(M,"transformMatrix",{get:function get(){return _this1[w]||(_this1[w]=P(_this1[d],_this1.transformOrigin)),_toConsumableArray(_this1[w]);}}),this[c]({id:"",name:"",className:"",/* class */x:0,y:0,/* pos */transformOrigin:[0,0],transform:"",translate:[0,0],rotate:0,scale:[1,1],skew:[0,0],opacity:1,zIndex:0,offsetPath:void 0,offsetDistance:0,offsetRotate:"auto",pointerEvents:"visible",// none | visible | visibleFill | visibleStroke | all
|
|
203
|
+
filter:"none",display:""}),this[l]("class","pos"),this[m]=/* @__PURE__ */new Set(),this[S]=new n.Figure2D({scale:5,simplify:0});}return _createClass(D,[{key:h,get:function get(){var _this10=this;var M={};return _toConsumableArray(this[m]).forEach(function(W){M[W]=_this10[T][W];}),M;}},{key:v,get:function get(){var M=Object.assign({},this[T]);for(var W=0;W<this[I].length;W++){var $=this[I][W];M[$]=this[$];}return M;}},{key:c,value:function value(M){Object.assign(this[O],M),Object.assign(this[T],M);}},{key:l,value:function value(){var _this$I4;(_this$I4=this[I]).push.apply(_this$I4,arguments);}},{key:f,value:function value(M,W){var $=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var B=this[T][M],N=this[y];return W==null&&(W=this[O][M]),Object(s.compareValue)(B,W)?!1:(this[T][M]=W,this[m].has(M)&&this[m]["delete"](M),this[m].add(M),this[p]=M,$&&N.onPropertyChange(M,W,B,this),!0);}},{key:u,value:function value(M){return this[T][M];}},{key:"id",get:function get(){return this[u]("id");},set:function set(M){this[f]("id",M);}},{key:"name",get:function get(){return this[u]("name");},set:function set(M){this[f]("name",M);}},{key:"className",get:function get(){return this[u]("className");},set:function set(M){this[f]("className",M);}},{key:"class",get:function get(){return this.className;},set:function set(M){this.className=M;}},{key:"x",get:function get(){return this[u]("x");},set:function set(M){this[f]("x",Object(s.toNumber)(M));}},{key:"y",get:function get(){return this[u]("y");},set:function set(M){this[f]("y",Object(s.toNumber)(M));}},{key:"pos",get:function get(){return[this.x,this.y];},set:function set(M){M=Object(s.toArray)(M),Array.isArray(M)||(M=[M,M]),this.x=M[0],this.y=M[1];}},{key:"transform",get:function get(){return this[u]("transform");},set:function set(M){var W=null;if(Array.isArray(M)&&(W=M,M="matrix(".concat(M.map(s.toNumber).join(),")")),typeof M=="string")M=M.replace(/\s*,\s*/g,",");else if(M!=null)throw new TypeError("Invalid transform value.");var $=this[T].transform;if(this[f]("transform",M,!1)){var B=this[d];if(B.has("matrix")&&B["delete"]("matrix"),W)B.set("matrix",W);else if(M){var N=M.match(/(matrix|translate|rotate|scale|skew)\([^()]+\)/g);if(N){var z=r.mat2d.fromValues(1,0,0,1,0,0);for(var J=0;J<N.length;J++){var at=N[J].match(/^(matrix|translate|rotate|scale|skew)\(([^()]+)\)/);if(at){var _at2=_slicedToArray(at,3),ct=_at2[1],V=_at2[2];ct==="rotate"?V=Math.PI*parseFloat(V)/180:V=V.trim().split(/[\s,]+/).map(function(Q){return Object(s.toNumber)(Q);}),ct==="matrix"?z=r.mat2d.multiply(z,z,V):ct==="skew"?z=r.mat2d.multiply(z,z,r.mat2d.fromValues(1,Math.tan(V[1]),Math.tan(V[0]),1,0,0)):r.mat2d[ct](z,z,V),B.set("matrix",z);}}}else throw new TypeError("Invalid transform value.");}this[w]=null,this[y].onPropertyChange("transform",M,$,this);}}},{key:"transformOrigin",get:function get(){return this[u]("transformOrigin");},set:function set(M){M=Object(s.toArray)(M,!0),M!=null&&!Array.isArray(M)&&(M=[M,M]),this[f]("transformOrigin",M)&&(this[w]=null);}},{key:"rotate",get:function get(){return this[u]("rotate");},set:function set(M){E(this,"rotate",M);}},{key:"translate",get:function get(){return this[u]("translate");},set:function set(M){M=Object(s.toArray)(M,!0),M!=null&&!Array.isArray(M)&&(M=[M,M]),E(this,"translate",M);}},{key:"scale",get:function get(){return this[u]("scale");},set:function set(M){M=Object(s.toArray)(M,!0),M!=null&&!Array.isArray(M)&&(M=[M,M]),E(this,"scale",M);}},{key:"skew",get:function get(){return this[u]("skew");},set:function set(M){M=Object(s.toArray)(M,!0),M!=null&&!Array.isArray(M)&&(M=[M,M]),E(this,"skew",M);}},{key:"opacity",get:function get(){return this[u]("opacity");},set:function set(M){M!=null&&(M=Number(M)),this[f]("opacity",M);}},{key:"zIndex",get:function get(){return this[u]("zIndex");},set:function set(M){M!=null&&(M=Number(M)),this[f]("zIndex",M);}},{key:"offsetPath",get:function get(){return this[u]("offsetPath");},set:function set(M){this[f]("offsetPath",M)&&(this[S].beginPath(),M!=null&&this[S].addPath(M),R(this));}},{key:"offsetDistance",get:function get(){return this[u]("offsetDistance");},set:function set(M){this[f]("offsetDistance",Object(s.toNumber)(M))&&R(this);}},{key:"offsetRotate",get:function get(){return this[u]("offsetRotate");},set:function set(M){this[f]("offsetRotate",M),R(this);}},{key:"pointerEvents",get:function get(){return this[u]("pointerEvents");},set:function set(M){if(M!=null&&M!=="none"&&M!=="visible"&&M!=="visibleFill"&&M!=="visibleStroke"&&M!=="all")throw new TypeError("Invalid pointerEvents type.");this[f]("pointerEvents",M);}},{key:"filter",get:function get(){return this[u]("filter");},set:function set(M){this[f]("filter",M);}},{key:"display",get:function get(){return this[u]("display");},set:function set(M){this[f]("display",M);}/* istanbul ignore next */},{key:"offset",set:function set(M){}}],[{key:"setDefault",value:function setDefault(M){for(var _len8=arguments.length,W=new Array(_len8>1?_len8-1:0),_key8=1;_key8<_len8;_key8++){W[_key8-1]=arguments[_key8];}return M[c].apply(M,W);}},{key:"declareAlias",value:function declareAlias(M){for(var _len9=arguments.length,W=new Array(_len9>1?_len9-1:0),_key9=1;_key9<_len9;_key9++){W[_key9-1]=arguments[_key9];}return M[l].apply(M,W);}},{key:"setAttribute",value:function setAttribute(M){for(var _len0=arguments.length,W=new Array(_len0>1?_len0-1:0),_key0=1;_key0<_len0;_key0++){W[_key0-1]=arguments[_key0];}return M[f].apply(M,W);}},{key:"getAttribute",value:function getAttribute(M){for(var _len1=arguments.length,W=new Array(_len1>1?_len1-1:0),_key1=1;_key1<_len1;_key1++){W[_key1-1]=arguments[_key1];}return M[u].apply(M,W);}},{key:"getAttributes",value:function getAttributes(M){return M[v];}},{key:"getChangedAttributes",value:function getChangedAttributes(M){return M[h];}}]);}();},/* 72 *//***/function(i,e,t){t.r(e),t.d(e,"sizeToPixel",function(){return r;}),t.d(e,"toString",function(){return n;}),t.d(e,"toNumber",function(){return s;}),t.d(e,"toArray",function(){return c;}),t.d(e,"compareValue",function(){return l;}),t(1).glMatrix.setMatrixArrayType(Array);function r(f,u){var v=f.trim().match(/^([\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin)$/);v?f={size:parseFloat(v[1]),unit:v[2]}:f={size:parseFloat(f),unit:"px"};var _f3=f,h=_f3.size,y=_f3.unit;if(y==="pt")h/=0.75;else if(y==="pc")h*=16;else if(y==="in")h*=96;else if(y==="cm")h*=37.79527559055118;else if(y==="mm")h*=3.7795275590551185;else if(y==="em"||y==="rem"||y==="ex"){if(!u&&typeof getComputedStyle=="function"&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var T=getComputedStyle(document.documentElement).fontSize;T?u=r(T,16):u=16;}h*=u,y==="ex"&&(h/=2);}else if(y==="q")h*=0.9448818897637796;else if(y==="vw"||y==="vh"){if((typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _T4=y==="vw"?window.innerWidth||document.documentElement.clientWidth:window.innerHeight||document.documentElement.clientHeight;h*=_T4/100;}}else if((y==="vmax"||y==="vmin")&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _T5=window.innerWidth||document.documentElement.clientWidth,O=window.innerHeight||document.documentElement.clientHeight;y==="vmax"?h*=Math.max(_T5,O)/100:h*=Math.min(_T5,O)/100;}return h;}function n(f){return f==null?f:String(f);}function s(f){if(f==null)return f;if(typeof f=="string"&&(f=r(f)),!Number.isFinite(f))throw new TypeError("Invalid value");return f;}function c(f){var u=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;return f===""?null:(typeof f=="string"&&(f=f.split(/[\s,]+/g)),Array.isArray(f)&&(u&&(f=f.map(s)),f.length===1)?f[0]:f);}function l(f,u){if(Array.isArray(f)&&Array.isArray(u)){if(f.length!==u.length)return!1;for(var v=0;v<f.length;v++)if(f[v]!==u[v])return!1;return!0;}return f==null&&u==null||f===u;}},/* 73 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return y;});var r=t(74),n=t(32),s=/* @__PURE__ */t.n(n),c=t(68),l=t(72);t(1).glMatrix.setMatrixArrayType(Array);function f(){return f=Object.assign||function(T){for(var O=1;O<arguments.length;O++){var I=arguments[O];for(var P in I)Object.prototype.hasOwnProperty.call(I,P)&&(T[P]=I[P]);}return T;},f.apply(this,arguments);}function u(T){if(typeof T=="string"){if(T=T.trim(),/^[0-9.]+%$/.test(T))return parseFloat(T)/100;if(/^([\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin)$/.test(T))return Object(l.sizeToPixel)(T);}return T;}function v(T,O,I,P,w){return typeof T=="string"&&(T=s()(T)),typeof O=="string"&&(O=s()(O)),r.Effects["default"](T,O,I,P,w);}function h(T,O,I,P,w){return r.Effects["default"](T,O,I,P,w);}r.Effects["default"]=function(T,O,I,P,w){return Array.isArray(T)&&Array.isArray(O)?T.map(function(d,m){return d+(I-P)/(w-P)*(O[m]-d);}):typeof T=="number"&&typeof O=="number"?T+(I-P)/(w-P)*(O-T):I-P>w-I?O:T;},r.Effects.fillColor=v,r.Effects.strokeColor=v,r.Effects.bgcolor=v,r.Effects.borderColor=v,r.Effects.text=h;var y=/*#__PURE__*/function(_r$Animator){function y(O,I,P){var _this11;_classCallCheck(this,y);var w=O.attr();Object.entries(w).forEach(function(_ref108){var _ref109=_slicedToArray(_ref108,2),d=_ref109[0],m=_ref109[1];w[d]=r.Effects[d]?m:u(m);}),I=I.map(function(d){var m=f({},d);var p={};return Object.entries(m).forEach(function(_ref110){var _ref111=_slicedToArray(_ref110,2),S=_ref111[0],E=_ref111[1];p[S]=r.Effects[S]?E:u(E);}),p;}),_this11=_callSuper(this,y,[w,I,P]),_this11.target=O,_this11.setter=function(d,m){m.attr(d);};return _this11;}_inherits(y,_r$Animator);return _createClass(y,[{key:"playState",get:function get(){return this.target.parent?_superPropGet(y,"playState",this,1):"idle";}},{key:"finished",get:function get(){var _this12=this;return _superPropGet(y,"finished",this,1).then(function(){var O=_this12;return new Promise(function(I){function P(){O.setter(O.frame,O.target);var w=O.playState;w==="finished"||w==="idle"?(Object(c.cancelAnimationFrame)(O.requestId),I()):Object(c.requestAnimationFrame)(P);}P();});});}},{key:"finish",value:function finish(){_superPropGet(y,"finish",this,3)([]),Object(c.cancelAnimationFrame)(this.requestId),this.setter(this.frame,this.target);}},{key:"play",value:function play(){if(!this.target.parent||this.playState==="running")return;_superPropGet(y,"play",this,3)([]),this.setter(this.frame,this.target);var O=this;this.ready.then(function(){O.setter(O.frame,O.target),O.requestId=Object(c.requestAnimationFrame)(function I(){var P=O.target;if((typeof document==="undefined"?"undefined":_typeof(document))<"u"&&document.documentElement&&document.documentElement.contains&&P.layer&&P.layer.canvas&&!document.documentElement.contains(P.layer.canvas)){O.cancel();return;}var w=O.playState;O.setter(O.frame,O.target),w!=="idle"&&(w==="running"?O.requestId=Object(c.requestAnimationFrame)(I):(w==="paused"||w==="pending"&&O.timeline.currentTime<0)&&O.ready.then(function(){O.setter(O.frame,O.target),O.requestId=Object(c.requestAnimationFrame)(I);}));});});}},{key:"cancel",value:function cancel(){var O=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;Object(c.cancelAnimationFrame)(this.requestId),O?(this.setter(this.frame,this.target),_superPropGet(y,"cancel",this,3)([])):(_superPropGet(y,"cancel",this,3)([]),this.setter(this.frame,this.target));}}]);}(r.Animator);},/* 74 *//***/function(i,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.Timeline=e.Effects=e.Easings=e.Animator=void 0;var r=t(75),n=v(r),s=t(187),c=v(s),l=t(188),f=t(190),u=v(f);function v(h){return h&&h.__esModule?h:{"default":h};}e.Animator=u["default"],e.Easings=l.Easings,e.Effects=c["default"],e.Timeline=n["default"];},/* 75 *//***/function(i,e,t){Object.defineProperty(e,"__esModule",{value:!0});var r=t(76),n=d(r),s=t(133),c=d(s),l=t(141),f=d(l),u=t(164),v=d(u),h=t(170),y=d(h),T=t(171),O=d(T),I=t(175),P=d(I),w=t(186);function d($){return $&&$.__esModule?$:{"default":$};}var m=(0,w.createNowTime)(),p={originTime:0,playbackRate:1},S=(0,P["default"])("timeMark"),E=(0,P["default"])("playbackRate"),R=(0,P["default"])("timers"),D=(0,P["default"])("originTime"),U=(0,P["default"])("setTimer"),M=(0,P["default"])("parent"),W=function(){function $(B,N){(0,y["default"])(this,$),B instanceof $&&(N=B,B={}),B=(0,v["default"])({},p,B),N&&(this[M]=N);var z=B.nowtime||m;if(N)Object.defineProperty(this,"globalTime",{get:function get(){return N.currentTime;}});else{var J=z();Object.defineProperty(this,"globalTime",{get:function get(){return z()-J;}});}this[S]=[{globalTime:this.globalTime,localTime:-B.originTime,entropy:-B.originTime,playbackRate:B.playbackRate,globalEntropy:0}],this[M]&&(this[S][0].globalEntropy=this[M].entropy),this[D]=B.originTime,this[E]=B.playbackRate,this[R]=new f["default"]();}return(0,O["default"])($,[{key:"markTime",value:function value(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},z=N.time,J=z===void 0?this.currentTime:z,et=N.entropy,at=et===void 0?this.entropy:et,ct=N.playbackRate,V=ct===void 0?this.playbackRate:ct,Q={globalTime:this.globalTime,localTime:J,entropy:at,playbackRate:V,globalEntropy:this.globalEntropy};this[S].push(Q);}},{key:"fork",value:function value(N){return new $(N,this);}},{key:"seekGlobalTime",value:function value(N){var z=this.seekTimeMark(N),J=this[S][z],et=J.entropy,at=J.playbackRate,ct=J.globalTime;return ct+(N-et)/Math.abs(at);}},{key:"seekLocalTime",value:function value(N){var z=this.seekTimeMark(N),J=this[S][z],et=J.localTime,at=J.entropy,ct=J.playbackRate;return ct>0?et+(N-at):et-(N-at);}},{key:"seekTimeMark",value:function value(N){var z=this[S],J=0,et=z.length-1;if(N<=z[J].entropy)return J;if(N>=z[et].entropy)return et;for(var at=Math.floor((J+et)/2);at>J&&at<et;){if(N===z[at].entropy)return at;N<z[at].entropy?et=at:N>z[at].entropy&&(J=at),at=Math.floor((J+et)/2);}return J;}},{key:"updateTimers",value:function value(){var N=this,z=[].concat((0,c["default"])(this[R]));z.forEach(function(J){var et=(0,n["default"])(J,2),at=et[0],ct=et[1];N[U](ct.handler,ct.time,at);});}},{key:"clearTimeout",value:function(B){function N(z){return B.apply(this,arguments);}return N.toString=function(){return B.toString();},N;}(function(B){var N=this[R].get(B);N&&N.timerID!=null&&(this[M]?this[M].clearTimeout(N.timerID):clearTimeout(N.timerID)),this[R]["delete"](B);})},{key:"clearInterval",value:function value(N){return this.clearTimeout(N);}},{key:"clear",value:function value(){var N=this,z=this[R];[].concat((0,c["default"])(z.keys())).forEach(function(J){N.clearTimeout(J);});}/*
|
|
204
|
+
setTimeout(func, {delay: 100, isEntropy: true})
|
|
205
|
+
setTimeout(func, {entropy: 100})
|
|
206
|
+
setTimeout(func, 100})
|
|
207
|
+
*/},{key:"setTimeout",value:function value(N){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{delay:0};return this[U](N,z);}},{key:"setInterval",value:function value(N){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{delay:0},J=this,et=this[U](function at(){J[U](at,z,et),N();},z);return et;}},{key:U,value:function value(N,z){var J=this,et=arguments.length>2&&arguments[2]!==void 0?arguments[2]:(0,P["default"])("timerID");z=(0,w.formatDelay)(z);var at=this[R].get(et),ct=void 0,V=null,Q=void 0,ft=void 0;at?(this.clearTimeout(et),z.isEntropy?ct=(z.delay-(this.entropy-at.startEntropy))/Math.abs(this.playbackRate):ct=(z.delay-(this.currentTime-at.startTime))/this.playbackRate,Q=at.startTime,ft=at.startEntropy):(ct=z.delay/(z.isEntropy?Math.abs(this.playbackRate):this.playbackRate),Q=this.currentTime,ft=this.entropy);var mt=this[M],yt=mt?mt.setTimeout.bind(mt):setTimeout,At=z.heading;return!mt&&At===!1&&ct<0&&(ct=1/0),(isFinite(ct)||mt)&&(ct=Math.ceil(ct),yt!==setTimeout&&(ct={delay:ct,heading:At}),V=yt(function(){J[R]["delete"](et),N();},ct)),this[R].set(et,{timerID:V,handler:N,time:z,startTime:Q,startEntropy:ft}),et;}},{key:"parent",get:function get(){return this[M];}},{key:"lastTimeMark",get:function get(){return this[S][this[S].length-1];}},{key:"currentTime",get:function get(){var N=this.lastTimeMark,z=N.localTime,J=N.globalTime;return z+(this.globalTime-J)*this.playbackRate;},set:function set(N){var z=this,J=this.currentTime,et=N,at=this[R];this.markTime({time:N}),[].concat((0,c["default"])(at)).forEach(function(ct){var V=(0,n["default"])(ct,2),Q=V[0],ft=V[1];if(at.has(Q)){var mt=ft.time,yt=mt.isEntropy,At=mt.delay,ht=mt.heading,Nt=ft.handler,Bt=ft.startTime;if(yt)At===0&&(Nt(),z.clearTimeout(Q));else{var G=Bt+At;(At===0||ht!==!1&&(et-J)*At<=0||J<=G&&G<=et||J>=G&&G>=et)&&(Nt(),z.clearTimeout(Q));}}}),this.updateTimers();}// Both currentTime and entropy should be influenced by playbackRate.
|
|
208
|
+
// If current playbackRate is negative, the currentTime should go backwards
|
|
209
|
+
// while the entropy remain to go forwards.
|
|
210
|
+
// Both of the initial values is set to -originTime
|
|
211
|
+
},{key:"entropy",get:function get(){var N=this.lastTimeMark,z=N.entropy,J=N.globalEntropy;return z+Math.abs((this.globalEntropy-J)*this.playbackRate);},// get globalTime() {
|
|
212
|
+
// if(this[_parent]) {
|
|
213
|
+
// return this[_parent].currentTime;
|
|
214
|
+
// }
|
|
215
|
+
// return nowtime();
|
|
216
|
+
// }
|
|
217
|
+
// change entropy will NOT cause currentTime changing but may influence the pass
|
|
218
|
+
// and the future of the timeline. (It may change the result of seek***Time)
|
|
219
|
+
// While entropy is set, all the marks behind will be droped
|
|
220
|
+
set:function set(N){if(this.entropy>N){var z=this.seekTimeMark(N);this[S].length=z+1;}this.markTime({entropy:N}),this.updateTimers();}},{key:"globalEntropy",get:function get(){return this[M]?this[M].entropy:this.globalTime;}},{key:"playbackRate",get:function get(){return this[E];},set:function set(N){N!==this.playbackRate&&(this.markTime({playbackRate:N}),this[E]=N,this.updateTimers());}},{key:"paused",get:function get(){if(this.playbackRate===0)return!0;for(var N=this.parent;N;){if(N.playbackRate===0)return!0;N=N.parent;}return!1;}}]),$;}();e["default"]=W;},/* 76 *//***/function(i,e,t){e.__esModule=!0;var r=t(77),n=l(r),s=t(129),c=l(s);function l(f){return f&&f.__esModule?f:{"default":f};}e["default"]=/* @__PURE__ */function(){function f(u,v){var h=[],y=!0,T=!1,O=void 0;try{for(var I=(0,c["default"])(u),P;!(y=(P=I.next()).done)&&(h.push(P.value),!(v&&h.length===v));y=!0);}catch(w){T=!0,O=w;}finally{try{!y&&I["return"]&&I["return"]();}finally{if(T)throw O;}}return h;}return function(u,v){if(Array.isArray(u))return u;if((0,n["default"])(Object(u)))return f(u,v);throw new TypeError("Invalid attempt to destructure non-iterable instance");};}();},/* 77 *//***/function(i,e,t){i.exports={"default":t(78),__esModule:!0};},/* 78 *//***/function(i,e,t){t(79),t(125),i.exports=t(127);},/* 79 *//***/function(i,e,t){t(80);for(var r=t(91),n=t(95),s=t(83),c=t(122)("toStringTag"),l="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),f=0;f<l.length;f++){var u=l[f],v=r[u],h=v&&v.prototype;h&&!h[c]&&n(h,c,u),s[u]=s.Array;}},/* 80 *//***/function(i,e,t){var r=t(81),n=t(82),s=t(83),c=t(84);i.exports=t(88)(Array,"Array",function(l,f){this._t=c(l),this._i=0,this._k=f;},function(){var l=this._t,f=this._k,u=this._i++;return!l||u>=l.length?(this._t=void 0,n(1)):f=="keys"?n(0,u):f=="values"?n(0,l[u]):n(0,[u,l[u]]);},"values"),s.Arguments=s.Array,r("keys"),r("values"),r("entries");},/* 81 *//***/function(i,e){i.exports=function(){};},/* 82 *//***/function(i,e){i.exports=function(t,r){return{value:r,done:!!t};};},/* 83 *//***/function(i,e){i.exports={};},/* 84 *//***/function(i,e,t){var r=t(85),n=t(87);i.exports=function(s){return r(n(s));};},/* 85 *//***/function(i,e,t){var r=t(86);i.exports=Object("z").propertyIsEnumerable(0)?Object:function(n){return r(n)=="String"?n.split(""):Object(n);};},/* 86 *//***/function(i,e){var t={}.toString;i.exports=function(r){return t.call(r).slice(8,-1);};},/* 87 *//***/function(i,e){i.exports=function(t){if(t==null)throw TypeError("Can't call method on "+t);return t;};},/* 88 *//***/function(i,e,t){var r=t(89),n=t(90),s=t(106),c=t(95),l=t(83),f=t(107),u=t(121),v=t(123),h=t(122)("iterator"),y=!([].keys&&"next"in[].keys()),T="@@iterator",O="keys",I="values",P=function P(){return this;};i.exports=function(w,d,m,p,S,E,R){f(m,d,p);var D=function D(V){if(!y&&V in $)return $[V];switch(V){case O:return function(){return new m(this,V);};case I:return function(){return new m(this,V);};}return function(){return new m(this,V);};},U=d+" Iterator",M=S==I,W=!1,$=w.prototype,B=$[h]||$[T]||S&&$[S],N=B||D(S),z=S?M?D("entries"):N:void 0,J=d=="Array"&&$.entries||B,et,at,ct;if(J&&(ct=v(J.call(new w())),ct!==Object.prototype&&ct.next&&(u(ct,U,!0),!r&&typeof ct[h]!="function"&&c(ct,h,P))),M&&B&&B.name!==I&&(W=!0,N=function N(){return B.call(this);}),(!r||R)&&(y||W||!$[h])&&c($,h,N),l[d]=N,l[U]=P,S)if(et={values:M?N:D(I),keys:E?N:D(O),entries:z},R)for(at in et)at in $||s($,at,et[at]);else n(n.P+n.F*(y||W),d,et);return et;};},/* 89 *//***/function(i,e){i.exports=!0;},/* 90 *//***/function(i,e,t){var r=t(91),n=t(92),s=t(93),c=t(95),l=t(105),f="prototype",_u2=function u(v,h,y){var T=v&_u2.F,O=v&_u2.G,I=v&_u2.S,P=v&_u2.P,w=v&_u2.B,d=v&_u2.W,m=O?n:n[h]||(n[h]={}),p=m[f],S=O?r:I?r[h]:(r[h]||{})[f],E,R,D;O&&(y=h);for(E in y)R=!T&&S&&S[E]!==void 0,!(R&&l(m,E))&&(D=R?S[E]:y[E],m[E]=O&&typeof S[E]!="function"?y[E]:w&&R?s(D,r):d&&S[E]==D?function(U){var M=function M(W,$,B){if(this instanceof U){switch(arguments.length){case 0:return new U();case 1:return new U(W);case 2:return new U(W,$);}return new U(W,$,B);}return U.apply(this,arguments);};return M[f]=U[f],M;}(D):P&&typeof D=="function"?s(Function.call,D):D,P&&((m.virtual||(m.virtual={}))[E]=D,v&_u2.R&&p&&!p[E]&&c(p,E,D)));};_u2.F=1,_u2.G=2,_u2.S=4,_u2.P=8,_u2.B=16,_u2.W=32,_u2.U=64,_u2.R=128,i.exports=_u2;},/* 91 *//***/function(i,e){var t=i.exports=(typeof window==="undefined"?"undefined":_typeof(window))<"u"&&window.Math==Math?window:(typeof self==="undefined"?"undefined":_typeof(self))<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=t);},/* 92 *//***/function(i,e){var t=i.exports={version:"2.6.11"};typeof __e=="number"&&(__e=t);},/* 93 *//***/function(i,e,t){var r=t(94);i.exports=function(n,s,c){if(r(n),s===void 0)return n;switch(c){case 1:return function(l){return n.call(s,l);};case 2:return function(l,f){return n.call(s,l,f);};case 3:return function(l,f,u){return n.call(s,l,f,u);};}return function(){return n.apply(s,arguments);};};},/* 94 *//***/function(i,e){i.exports=function(t){if(typeof t!="function")throw TypeError(t+" is not a function!");return t;};},/* 95 *//***/function(i,e,t){var r=t(96),n=t(104);i.exports=t(100)?function(s,c,l){return r.f(s,c,n(1,l));}:function(s,c,l){return s[c]=l,s;};},/* 96 *//***/function(i,e,t){var r=t(97),n=t(99),s=t(103),c=Object.defineProperty;e.f=t(100)?Object.defineProperty:function(f,u,v){if(r(f),u=s(u,!0),r(v),n)try{return c(f,u,v);}catch(_unused0){}if("get"in v||"set"in v)throw TypeError("Accessors not supported!");return"value"in v&&(f[u]=v.value),f;};},/* 97 *//***/function(i,e,t){var r=t(98);i.exports=function(n){if(!r(n))throw TypeError(n+" is not an object!");return n;};},/* 98 *//***/function(i,e){i.exports=function(t){return _typeof(t)=="object"?t!==null:typeof t=="function";};},/* 99 *//***/function(i,e,t){i.exports=!t(100)&&!t(101)(function(){return Object.defineProperty(t(102)("div"),"a",{get:function get(){return 7;}}).a!=7;});},/* 100 *//***/function(i,e,t){i.exports=!t(101)(function(){return Object.defineProperty({},"a",{get:function get(){return 7;}}).a!=7;});},/* 101 *//***/function(i,e){i.exports=function(t){try{return!!t();}catch(_unused1){return!0;}};},/* 102 *//***/function(i,e,t){var r=t(98),n=t(91).document,s=r(n)&&r(n.createElement);i.exports=function(c){return s?n.createElement(c):{};};},/* 103 *//***/function(i,e,t){var r=t(98);i.exports=function(n,s){if(!r(n))return n;var c,l;if(s&&typeof(c=n.toString)=="function"&&!r(l=c.call(n))||typeof(c=n.valueOf)=="function"&&!r(l=c.call(n))||!s&&typeof(c=n.toString)=="function"&&!r(l=c.call(n)))return l;throw TypeError("Can't convert object to primitive value");};},/* 104 *//***/function(i,e){i.exports=function(t,r){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:r};};},/* 105 *//***/function(i,e){var t={}.hasOwnProperty;i.exports=function(r,n){return t.call(r,n);};},/* 106 *//***/function(i,e,t){i.exports=t(95);},/* 107 *//***/function(i,e,t){var r=t(108),n=t(104),s=t(121),c={};t(95)(c,t(122)("iterator"),function(){return this;}),i.exports=function(l,f,u){l.prototype=r(c,{next:n(1,u)}),s(l,f+" Iterator");};},/* 108 *//***/function(i,e,t){var r=t(97),n=t(109),s=t(119),c=t(116)("IE_PROTO"),l=function l(){},f="prototype",_u3=function u(){var v=t(102)("iframe"),h=s.length,y="<",T=">",O;for(v.style.display="none",t(120).appendChild(v),v.src="javascript:",O=v.contentWindow.document,O.open(),O.write(y+"script"+T+"document.F=Object"+y+"/script"+T),O.close(),_u3=O.F;h--;)delete _u3[f][s[h]];return _u3();};i.exports=Object.create||function(h,y){var T;return h!==null?(l[f]=r(h),T=new l(),l[f]=null,T[c]=h):T=_u3(),y===void 0?T:n(T,y);};},/* 109 *//***/function(i,e,t){var r=t(96),n=t(97),s=t(110);i.exports=t(100)?Object.defineProperties:function(l,f){n(l);for(var u=s(f),v=u.length,h=0,y;v>h;)r.f(l,y=u[h++],f[y]);return l;};},/* 110 *//***/function(i,e,t){var r=t(111),n=t(119);i.exports=Object.keys||function(c){return r(c,n);};},/* 111 *//***/function(i,e,t){var r=t(105),n=t(84),s=t(112)(!1),c=t(116)("IE_PROTO");i.exports=function(l,f){var u=n(l),v=0,h=[],y;for(y in u)y!=c&&r(u,y)&&h.push(y);for(;f.length>v;)r(u,y=f[v++])&&(~s(h,y)||h.push(y));return h;};},/* 112 *//***/function(i,e,t){var r=t(84),n=t(113),s=t(115);i.exports=function(c){return function(l,f,u){var v=r(l),h=n(v.length),y=s(u,h),T;if(c&&f!=f){for(;h>y;)if(T=v[y++],T!=T)return!0;}else for(;h>y;y++)if((c||y in v)&&v[y]===f)return c||y||0;return!c&&-1;};};},/* 113 *//***/function(i,e,t){var r=t(114),n=Math.min;i.exports=function(s){return s>0?n(r(s),9007199254740991):0;};},/* 114 *//***/function(i,e){var t=Math.ceil,r=Math.floor;i.exports=function(n){return isNaN(n=+n)?0:(n>0?r:t)(n);};},/* 115 *//***/function(i,e,t){var r=t(114),n=Math.max,s=Math.min;i.exports=function(c,l){return c=r(c),c<0?n(c+l,0):s(c,l);};},/* 116 *//***/function(i,e,t){var r=t(117)("keys"),n=t(118);i.exports=function(s){return r[s]||(r[s]=n(s));};},/* 117 *//***/function(i,e,t){var r=t(92),n=t(91),s="__core-js_shared__",c=n[s]||(n[s]={});(i.exports=function(l,f){return c[l]||(c[l]=f!==void 0?f:{});})("versions",[]).push({version:r.version,mode:t(89)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"});},/* 118 *//***/function(i,e){var t=0,r=Math.random();i.exports=function(n){return"Symbol(".concat(n===void 0?"":n,")_",(++t+r).toString(36));};},/* 119 *//***/function(i,e){i.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",");},/* 120 *//***/function(i,e,t){var r=t(91).document;i.exports=r&&r.documentElement;},/* 121 *//***/function(i,e,t){var r=t(96).f,n=t(105),s=t(122)("toStringTag");i.exports=function(c,l,f){c&&!n(c=f?c:c.prototype,s)&&r(c,s,{configurable:!0,value:l});};},/* 122 *//***/function(i,e,t){var r=t(117)("wks"),n=t(118),s=t(91).Symbol,c=typeof s=="function",l=i.exports=function(f){return r[f]||(r[f]=c&&s[f]||(c?s:n)("Symbol."+f));};l.store=r;},/* 123 *//***/function(i,e,t){var r=t(105),n=t(124),s=t(116)("IE_PROTO"),c=Object.prototype;i.exports=Object.getPrototypeOf||function(l){return l=n(l),r(l,s)?l[s]:typeof l.constructor=="function"&&l instanceof l.constructor?l.constructor.prototype:l instanceof Object?c:null;};},/* 124 *//***/function(i,e,t){var r=t(87);i.exports=function(n){return Object(r(n));};},/* 125 *//***/function(i,e,t){var r=t(126)(!0);t(88)(String,"String",function(n){this._t=String(n),this._i=0;},function(){var n=this._t,s=this._i,c;return s>=n.length?{value:void 0,done:!0}:(c=r(n,s),this._i+=c.length,{value:c,done:!1});});},/* 126 *//***/function(i,e,t){var r=t(114),n=t(87);i.exports=function(s){return function(c,l){var f=String(n(c)),u=r(l),v=f.length,h,y;return u<0||u>=v?s?"":void 0:(h=f.charCodeAt(u),h<55296||h>56319||u+1===v||(y=f.charCodeAt(u+1))<56320||y>57343?s?f.charAt(u):h:s?f.slice(u,u+2):(h-55296<<10)+(y-56320)+65536);};};},/* 127 *//***/function(i,e,t){var r=t(128),n=t(122)("iterator"),s=t(83);i.exports=t(92).isIterable=function(c){var l=Object(c);return l[n]!==void 0||"@@iterator"in l||s.hasOwnProperty(r(l));};},/* 128 *//***/function(i,e,t){var r=t(86),n=t(122)("toStringTag"),s=r(/* @__PURE__ */function(){return arguments;}())=="Arguments",c=function c(l,f){try{return l[f];}catch(_unused10){}};i.exports=function(l){var f,u,v;return l===void 0?"Undefined":l===null?"Null":typeof(u=c(f=Object(l),n))=="string"?u:s?r(f):(v=r(f))=="Object"&&typeof f.callee=="function"?"Arguments":v;};},/* 129 *//***/function(i,e,t){i.exports={"default":t(130),__esModule:!0};},/* 130 *//***/function(i,e,t){t(79),t(125),i.exports=t(131);},/* 131 *//***/function(i,e,t){var r=t(97),n=t(132);i.exports=t(92).getIterator=function(s){var c=n(s);if(typeof c!="function")throw TypeError(s+" is not iterable!");return r(c.call(s));};},/* 132 *//***/function(i,e,t){var r=t(128),n=t(122)("iterator"),s=t(83);i.exports=t(92).getIteratorMethod=function(c){if(c!=null)return c[n]||c["@@iterator"]||s[r(c)];};},/* 133 *//***/function(i,e,t){e.__esModule=!0;var r=t(134),n=s(r);function s(c){return c&&c.__esModule?c:{"default":c};}e["default"]=function(c){if(Array.isArray(c)){for(var l=0,f=Array(c.length);l<c.length;l++)f[l]=c[l];return f;}else return(0,n["default"])(c);};},/* 134 *//***/function(i,e,t){i.exports={"default":t(135),__esModule:!0};},/* 135 *//***/function(i,e,t){t(125),t(136),i.exports=t(92).Array.from;},/* 136 *//***/function(i,e,t){var r=t(93),n=t(90),s=t(124),c=t(137),l=t(138),f=t(113),u=t(139),v=t(132);n(n.S+n.F*!t(140)(function(h){Array.from(h);}),"Array",{// 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
|
|
221
|
+
from:function from(y){var T=s(y),O=typeof this=="function"?this:Array,I=arguments.length,P=I>1?arguments[1]:void 0,w=P!==void 0,d=0,m=v(T),p,S,E,R;if(w&&(P=r(P,I>2?arguments[2]:void 0,2)),m!=null&&!(O==Array&&l(m)))for(R=m.call(T),S=new O();!(E=R.next()).done;d++)u(S,d,w?c(R,P,[E.value,d],!0):E.value);else for(p=f(T.length),S=new O(p);p>d;d++)u(S,d,w?P(T[d],d):T[d]);return S.length=d,S;}});},/* 137 *//***/function(i,e,t){var r=t(97);i.exports=function(n,s,c,l){try{return l?s(r(c)[0],c[1]):s(c);}catch(u){var f=n["return"];throw f!==void 0&&r(f.call(n)),u;}};},/* 138 *//***/function(i,e,t){var r=t(83),n=t(122)("iterator"),s=Array.prototype;i.exports=function(c){return c!==void 0&&(r.Array===c||s[n]===c);};},/* 139 *//***/function(i,e,t){var r=t(96),n=t(104);i.exports=function(s,c,l){c in s?r.f(s,c,n(0,l)):s[c]=l;};},/* 140 *//***/function(i,e,t){var r=t(122)("iterator"),n=!1;try{var s=[7][r]();s["return"]=function(){n=!0;},Array.from(s,function(){throw 2;});}catch(_unused11){}i.exports=function(c,l){if(!l&&!n)return!1;var f=!1;try{var u=[7],v=u[r]();v.next=function(){return{done:f=!0};},u[r]=function(){return v;},c(u);}catch(_unused12){}return f;};},/* 141 *//***/function(i,e,t){i.exports={"default":t(142),__esModule:!0};},/* 142 *//***/function(i,e,t){t(143),t(125),t(79),t(144),t(157),t(160),t(162),i.exports=t(92).Map;},/* 143 *//***/function(i,e){},/* 144 *//***/function(i,e,t){var r=t(145),n=t(151),s="Map";i.exports=t(152)(s,function(c){return function(){return c(this,arguments.length>0?arguments[0]:void 0);};},{// 23.1.3.6 Map.prototype.get(key)
|
|
222
|
+
get:function get(l){var f=r.getEntry(n(this,s),l);return f&&f.v;},// 23.1.3.9 Map.prototype.set(key, value)
|
|
223
|
+
set:function set(l,f){return r.def(n(this,s),l===0?0:l,f);}},r,!0);},/* 145 *//***/function(i,e,t){var r=t(96).f,n=t(108),s=t(146),c=t(93),l=t(147),f=t(148),u=t(88),v=t(82),h=t(149),y=t(100),T=t(150).fastKey,O=t(151),I=y?"_s":"size",P=function P(w,d){var m=T(d),p;if(m!=="F")return w._i[m];for(p=w._f;p;p=p.n)if(p.k==d)return p;};i.exports={getConstructor:function getConstructor(w,d,m,p){var S=w(function(E,R){l(E,S,d,"_i"),E._t=d,E._i=n(null),E._f=void 0,E._l=void 0,E[I]=0,R!=null&&f(R,m,E[p],E);});return s(S.prototype,{// 23.1.3.1 Map.prototype.clear()
|
|
224
|
+
// 23.2.3.2 Set.prototype.clear()
|
|
225
|
+
clear:function clear(){for(var R=O(this,d),D=R._i,U=R._f;U;U=U.n)U.r=!0,U.p&&(U.p=U.p.n=void 0),delete D[U.i];R._f=R._l=void 0,R[I]=0;},// 23.1.3.3 Map.prototype.delete(key)
|
|
226
|
+
// 23.2.3.4 Set.prototype.delete(value)
|
|
227
|
+
"delete":function _delete(E){var R=O(this,d),D=P(R,E);if(D){var U=D.n,M=D.p;delete R._i[D.i],D.r=!0,M&&(M.n=U),U&&(U.p=M),R._f==D&&(R._f=U),R._l==D&&(R._l=M),R[I]--;}return!!D;},// 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
|
|
228
|
+
// 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
|
|
229
|
+
forEach:function forEach(R){O(this,d);for(var D=c(R,arguments.length>1?arguments[1]:void 0,3),U;U=U?U.n:this._f;)for(D(U.v,U.k,this);U&&U.r;)U=U.p;},// 23.1.3.7 Map.prototype.has(key)
|
|
230
|
+
// 23.2.3.7 Set.prototype.has(value)
|
|
231
|
+
has:function has(R){return!!P(O(this,d),R);}}),y&&r(S.prototype,"size",{get:function get(){return O(this,d)[I];}}),S;},def:function def(w,d,m){var p=P(w,d),S,E;return p?p.v=m:(w._l=p={i:E=T(d,!0),// <- index
|
|
232
|
+
k:d,// <- key
|
|
233
|
+
v:m,// <- value
|
|
234
|
+
p:S=w._l,// <- previous entry
|
|
235
|
+
n:void 0,// <- next entry
|
|
236
|
+
r:!1// <- removed
|
|
237
|
+
},w._f||(w._f=p),S&&(S.n=p),w[I]++,E!=="F"&&(w._i[E]=p)),w;},getEntry:P,setStrong:function setStrong(w,d,m){u(w,d,function(p,S){this._t=O(p,d),this._k=S,this._l=void 0;},function(){for(var p=this,S=p._k,E=p._l;E&&E.r;)E=E.p;return!p._t||!(p._l=E=E?E.n:p._t._f)?(p._t=void 0,v(1)):S=="keys"?v(0,E.k):S=="values"?v(0,E.v):v(0,[E.k,E.v]);},m?"entries":"values",!m,!0),h(d);}};},/* 146 *//***/function(i,e,t){var r=t(95);i.exports=function(n,s,c){for(var l in s)c&&n[l]?n[l]=s[l]:r(n,l,s[l]);return n;};},/* 147 *//***/function(i,e){i.exports=function(t,r,n,s){if(!(t instanceof r)||s!==void 0&&s in t)throw TypeError(n+": incorrect invocation!");return t;};},/* 148 *//***/function(i,h,t){var r=t(93),n=t(137),s=t(138),c=t(97),l=t(113),f=t(132),u={},v={},h=i.exports=function(y,T,O,I,P){var w=P?function(){return y;}:f(y),d=r(O,I,T?2:1),m=0,p,S,E,R;if(typeof w!="function")throw TypeError(y+" is not iterable!");if(s(w)){for(p=l(y.length);p>m;m++)if(R=T?d(c(S=y[m])[0],S[1]):d(y[m]),R===u||R===v)return R;}else for(E=w.call(y);!(S=E.next()).done;)if(R=n(E,d,S.value,T),R===u||R===v)return R;};h.BREAK=u,h.RETURN=v;},/* 149 *//***/function(i,e,t){var r=t(91),n=t(92),s=t(96),c=t(100),l=t(122)("species");i.exports=function(f){var u=typeof n[f]=="function"?n[f]:r[f];c&&u&&!u[l]&&s.f(u,l,{configurable:!0,get:function get(){return this;}});};},/* 150 *//***/function(i,e,t){var r=t(118)("meta"),n=t(98),s=t(105),c=t(96).f,l=0,f=Object.isExtensible||function(){return!0;},u=!t(101)(function(){return f(Object.preventExtensions({}));}),v=function v(I){c(I,r,{value:{i:"O"+ ++l,// object ID
|
|
238
|
+
w:{}// weak collections IDs
|
|
239
|
+
}});},h=function h(I,P){if(!n(I))return _typeof(I)=="symbol"?I:(typeof I=="string"?"S":"P")+I;if(!s(I,r)){if(!f(I))return"F";if(!P)return"E";v(I);}return I[r].i;},y=function y(I,P){if(!s(I,r)){if(!f(I))return!0;if(!P)return!1;v(I);}return I[r].w;},T=function T(I){return u&&O.NEED&&f(I)&&!s(I,r)&&v(I),I;},O=i.exports={KEY:r,NEED:!1,fastKey:h,getWeak:y,onFreeze:T};},/* 151 *//***/function(i,e,t){var r=t(98);i.exports=function(n,s){if(!r(n)||n._t!==s)throw TypeError("Incompatible receiver, "+s+" required!");return n;};},/* 152 *//***/function(i,e,t){var r=t(91),n=t(90),s=t(150),c=t(101),l=t(95),f=t(146),u=t(148),v=t(147),h=t(98),y=t(121),T=t(96).f,O=t(153)(0),I=t(100);i.exports=function(P,w,d,m,p,S){var E=r[P],R=E,D=p?"set":"add",U=R&&R.prototype,M={};return!I||typeof R!="function"||!(S||U.forEach&&!c(function(){new R().entries().next();}))?(R=m.getConstructor(w,P,p,D),f(R.prototype,d),s.NEED=!0):(R=w(function(W,$){v(W,R,P,"_c"),W._c=new E(),$!=null&&u($,p,W[D],W);}),O("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(W){var $=W=="add"||W=="set";W in U&&!(S&&W=="clear")&&l(R.prototype,W,function(B,N){if(v(this,R,W),!$&&S&&!h(B))return W=="get"?void 0:!1;var z=this._c[W](B===0?0:B,N);return $?this:z;});}),S||T(R.prototype,"size",{get:function get(){return this._c.size;}})),y(R,P),M[P]=R,n(n.G+n.W+n.F,M),S||m.setStrong(R,P,p),R;};},/* 153 *//***/function(i,e,t){var r=t(93),n=t(85),s=t(124),c=t(113),l=t(154);i.exports=function(f,u){var v=f==1,h=f==2,y=f==3,T=f==4,O=f==6,I=f==5||O,P=u||l;return function(w,d,m){for(var p=s(w),S=n(p),E=r(d,m,3),R=c(S.length),D=0,U=v?P(w,R):h?P(w,0):void 0,M,W;R>D;D++)if((I||D in S)&&(M=S[D],W=E(M,D,p),f)){if(v)U[D]=W;else if(W)switch(f){case 3:return!0;case 5:return M;case 6:return D;case 2:U.push(M);}else if(T)return!1;}return O?-1:y||T?T:U;};};},/* 154 *//***/function(i,e,t){var r=t(155);i.exports=function(n,s){return new(r(n))(s);};},/* 155 *//***/function(i,e,t){var r=t(98),n=t(156),s=t(122)("species");i.exports=function(c){var l;return n(c)&&(l=c.constructor,typeof l=="function"&&(l===Array||n(l.prototype))&&(l=void 0),r(l)&&(l=l[s],l===null&&(l=void 0))),l===void 0?Array:l;};},/* 156 *//***/function(i,e,t){var r=t(86);i.exports=Array.isArray||function(s){return r(s)=="Array";};},/* 157 *//***/function(i,e,t){var r=t(90);r(r.P+r.R,"Map",{toJSON:t(158)("Map")});},/* 158 *//***/function(i,e,t){var r=t(128),n=t(159);i.exports=function(s){return function(){if(r(this)!=s)throw TypeError(s+"#toJSON isn't generic");return n(this);};};},/* 159 *//***/function(i,e,t){var r=t(148);i.exports=function(n,s){var c=[];return r(n,!1,c.push,c,s),c;};},/* 160 *//***/function(i,e,t){t(161)("Map");},/* 161 *//***/function(i,e,t){var r=t(90);i.exports=function(n){r(r.S,n,{of:function of(){for(var c=arguments.length,l=new Array(c);c--;)l[c]=arguments[c];return new this(l);}});};},/* 162 *//***/function(i,e,t){t(163)("Map");},/* 163 *//***/function(i,e,t){var r=t(90),n=t(94),s=t(93),c=t(148);i.exports=function(l){r(r.S,l,{from:function from(u){var v=arguments[1],h,y,T,O;return n(this),h=v!==void 0,h&&n(v),u==null?new this():(y=[],h?(T=0,O=s(v,arguments[2],2),c(u,!1,function(I){y.push(O(I,T++));})):c(u,!1,y.push,y),new this(y));}});};},/* 164 *//***/function(i,e,t){i.exports={"default":t(165),__esModule:!0};},/* 165 *//***/function(i,e,t){t(166),i.exports=t(92).Object.assign;},/* 166 *//***/function(i,e,t){var r=t(90);r(r.S+r.F,"Object",{assign:t(167)});},/* 167 *//***/function(i,e,t){var r=t(100),n=t(110),s=t(168),c=t(169),l=t(124),f=t(85),u=Object.assign;i.exports=!u||t(101)(function(){var v={},h={},y=Symbol(),T="abcdefghijklmnopqrst";return v[y]=7,T.split("").forEach(function(O){h[O]=O;}),u({},v)[y]!=7||Object.keys(u({},h)).join("")!=T;})?function(h,y){for(var T=l(h),O=arguments.length,I=1,P=s.f,w=c.f;O>I;)for(var d=f(arguments[I++]),m=P?n(d).concat(P(d)):n(d),p=m.length,S=0,E;p>S;)E=m[S++],(!r||w.call(d,E))&&(T[E]=d[E]);return T;}:u;},/* 168 *//***/function(i,e){e.f=Object.getOwnPropertySymbols;},/* 169 *//***/function(i,e){e.f={}.propertyIsEnumerable;},/* 170 *//***/function(i,e,t){e.__esModule=!0,e["default"]=function(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function");};},/* 171 *//***/function(i,e,t){e.__esModule=!0;var r=t(172),n=s(r);function s(c){return c&&c.__esModule?c:{"default":c};}e["default"]=/* @__PURE__ */function(){function c(l,f){for(var u=0;u<f.length;u++){var v=f[u];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),(0,n["default"])(l,v.key,v);}}return function(l,f,u){return f&&c(l.prototype,f),u&&c(l,u),l;};}();},/* 172 *//***/function(i,e,t){i.exports={"default":t(173),__esModule:!0};},/* 173 *//***/function(i,e,t){t(174);var r=t(92).Object;i.exports=function(s,c,l){return r.defineProperty(s,c,l);};},/* 174 *//***/function(i,e,t){var r=t(90);r(r.S+r.F*!t(100),"Object",{defineProperty:t(96).f});},/* 175 *//***/function(i,e,t){i.exports={"default":t(176),__esModule:!0};},/* 176 *//***/function(i,e,t){t(177),t(143),t(184),t(185),i.exports=t(92).Symbol;},/* 177 *//***/function(i,e,t){var r=t(91),n=t(105),s=t(100),c=t(90),l=t(106),f=t(150).KEY,u=t(101),v=t(117),h=t(121),y=t(118),T=t(122),O=t(178),I=t(179),P=t(180),w=t(156),d=t(97),m=t(98),p=t(124),S=t(84),E=t(103),R=t(104),D=t(108),U=t(181),M=t(183),W=t(168),$=t(96),B=t(110),N=M.f,z=$.f,J=U.f,_et2=r.Symbol,at=r.JSON,ct=at&&at.stringify,V="prototype",Q=T("_hidden"),ft=T("toPrimitive"),mt={}.propertyIsEnumerable,yt=v("symbol-registry"),At=v("symbols"),ht=v("op-symbols"),Nt=Object[V],Bt=typeof _et2=="function"&&!!W.f,G=r.QObject,k=!G||!G[V]||!G[V].findChild,rt=s&&u(function(){return D(z({},"a",{get:function get(){return z(this,"a",{value:7}).a;}})).a!=7;})?function(wt,Ot,Lt){var Yt=N(Nt,Ot);Yt&&delete Nt[Ot],z(wt,Ot,Lt),Yt&&wt!==Nt&&z(Nt,Ot,Yt);}:z,nt=function nt(wt){var Ot=At[wt]=D(_et2[V]);return Ot._k=wt,Ot;},Y=Bt&&_typeof(_et2.iterator)=="symbol"?function(wt){return _typeof(wt)=="symbol";}:function(wt){return wt instanceof _et2;},_Z2=function Z(Ot,Lt,Yt){return Ot===Nt&&_Z2(ht,Lt,Yt),d(Ot),Lt=E(Lt,!0),d(Yt),n(At,Lt)?(Yt.enumerable?(n(Ot,Q)&&Ot[Q][Lt]&&(Ot[Q][Lt]=!1),Yt=D(Yt,{enumerable:R(0,!1)})):(n(Ot,Q)||z(Ot,Q,R(1,{})),Ot[Q][Lt]=!0),rt(Ot,Lt,Yt)):z(Ot,Lt,Yt);},C=function C(Ot,Lt){d(Ot);for(var Yt=P(Lt=S(Lt)),zt=0,Wt=Yt.length,Qt;Wt>zt;)_Z2(Ot,Qt=Yt[zt++],Lt[Qt]);return Ot;},L=function L(Ot,Lt){return Lt===void 0?D(Ot):C(D(Ot),Lt);},X=function X(Ot){var Lt=mt.call(this,Ot=E(Ot,!0));return this===Nt&&n(At,Ot)&&!n(ht,Ot)?!1:Lt||!n(this,Ot)||!n(At,Ot)||n(this,Q)&&this[Q][Ot]?Lt:!0;},K=function K(Ot,Lt){if(Ot=S(Ot),Lt=E(Lt,!0),!(Ot===Nt&&n(At,Lt)&&!n(ht,Lt))){var Yt=N(Ot,Lt);return Yt&&n(At,Lt)&&!(n(Ot,Q)&&Ot[Q][Lt])&&(Yt.enumerable=!0),Yt;}},q=function q(Ot){for(var Lt=J(S(Ot)),Yt=[],zt=0,Wt;Lt.length>zt;)!n(At,Wt=Lt[zt++])&&Wt!=Q&&Wt!=f&&Yt.push(Wt);return Yt;},it=function it(Ot){for(var Lt=Ot===Nt,Yt=J(Lt?ht:S(Ot)),zt=[],Wt=0,Qt;Yt.length>Wt;)n(At,Qt=Yt[Wt++])&&(!Lt||n(Nt,Qt))&&zt.push(At[Qt]);return zt;};Bt||(_et2=function et(){if(this instanceof _et2)throw TypeError("Symbol is not a constructor!");var Ot=y(arguments.length>0?arguments[0]:void 0),_Lt=function Lt(Yt){this===Nt&&_Lt.call(ht,Yt),n(this,Q)&&n(this[Q],Ot)&&(this[Q][Ot]=!1),rt(this,Ot,R(1,Yt));};return s&&k&&rt(Nt,Ot,{configurable:!0,set:_Lt}),nt(Ot);},l(_et2[V],"toString",function(){return this._k;}),M.f=K,$.f=_Z2,t(182).f=U.f=q,t(169).f=X,W.f=it,s&&!t(89)&&l(Nt,"propertyIsEnumerable",X,!0),O.f=function(wt){return nt(T(wt));}),c(c.G+c.W+c.F*!Bt,{Symbol:_et2});for(var ut=// 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
|
|
240
|
+
"hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),St=0;ut.length>St;)T(ut[St++]);for(var Ct=B(T.store),Et=0;Ct.length>Et;)I(Ct[Et++]);c(c.S+c.F*!Bt,"Symbol",{// 19.4.2.1 Symbol.for(key)
|
|
241
|
+
"for":function _for(wt){return n(yt,wt+="")?yt[wt]:yt[wt]=_et2(wt);},// 19.4.2.5 Symbol.keyFor(sym)
|
|
242
|
+
keyFor:function keyFor(Ot){if(!Y(Ot))throw TypeError(Ot+" is not a symbol!");for(var Lt in yt)if(yt[Lt]===Ot)return Lt;},useSetter:function useSetter(){k=!0;},useSimple:function useSimple(){k=!1;}}),c(c.S+c.F*!Bt,"Object",{// 19.1.2.2 Object.create(O [, Properties])
|
|
243
|
+
create:L,// 19.1.2.4 Object.defineProperty(O, P, Attributes)
|
|
244
|
+
defineProperty:_Z2,// 19.1.2.3 Object.defineProperties(O, Properties)
|
|
245
|
+
defineProperties:C,// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
|
|
246
|
+
getOwnPropertyDescriptor:K,// 19.1.2.7 Object.getOwnPropertyNames(O)
|
|
247
|
+
getOwnPropertyNames:q,// 19.1.2.8 Object.getOwnPropertySymbols(O)
|
|
248
|
+
getOwnPropertySymbols:it});var bt=u(function(){W.f(1);});c(c.S+c.F*bt,"Object",{getOwnPropertySymbols:function getOwnPropertySymbols(Ot){return W.f(p(Ot));}}),at&&c(c.S+c.F*(!Bt||u(function(){var wt=_et2();return ct([wt])!="[null]"||ct({a:wt})!="{}"||ct(Object(wt))!="{}";})),"JSON",{stringify:function stringify(Ot){for(var Lt=[Ot],Yt=1,zt,Wt;arguments.length>Yt;)Lt.push(arguments[Yt++]);if(Wt=zt=Lt[1],!(!m(zt)&&Ot===void 0||Y(Ot)))return w(zt)||(zt=function zt(Qt,ue){if(typeof Wt=="function"&&(ue=Wt.call(this,Qt,ue)),!Y(ue))return ue;}),Lt[1]=zt,ct.apply(at,Lt);}}),_et2[V][ft]||t(95)(_et2[V],ft,_et2[V].valueOf),h(_et2,"Symbol"),h(Math,"Math",!0),h(r.JSON,"JSON",!0);},/* 178 *//***/function(i,e,t){e.f=t(122);},/* 179 *//***/function(i,e,t){var r=t(91),n=t(92),s=t(89),c=t(178),l=t(96).f;i.exports=function(f){var u=n.Symbol||(n.Symbol=s?{}:r.Symbol||{});f.charAt(0)!="_"&&!(f in u)&&l(u,f,{value:c.f(f)});};},/* 180 *//***/function(i,e,t){var r=t(110),n=t(168),s=t(169);i.exports=function(c){var l=r(c),f=n.f;if(f)for(var u=f(c),v=s.f,h=0,y;u.length>h;)v.call(c,y=u[h++])&&l.push(y);return l;};},/* 181 *//***/function(i,e,t){var r=t(84),n=t(182).f,s={}.toString,c=(typeof window==="undefined"?"undefined":_typeof(window))=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],l=function l(f){try{return n(f);}catch(_unused13){return c.slice();}};i.exports.f=function(u){return c&&s.call(u)=="[object Window]"?l(u):n(r(u));};},/* 182 *//***/function(i,e,t){var r=t(111),n=t(119).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(c){return r(c,n);};},/* 183 *//***/function(i,e,t){var r=t(169),n=t(104),s=t(84),c=t(103),l=t(105),f=t(99),u=Object.getOwnPropertyDescriptor;e.f=t(100)?u:function(h,y){if(h=s(h),y=c(y,!0),f)try{return u(h,y);}catch(_unused14){}if(l(h,y))return n(!r.f.call(h,y),h[y]);};},/* 184 *//***/function(i,e,t){t(179)("asyncIterator");},/* 185 *//***/function(i,e,t){t(179)("observable");},/* 186 *//***/function(i,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.createNowTime=r,e.formatDelay=n;function r(){var s=null;return Date.now?s=Date.now:s=function s(){return(/* @__PURE__ */new Date()).getTime();},s;}function n(s){return typeof s=="number"?s={delay:s}:"entropy"in s&&(s={delay:s.entropy,isEntropy:!0}),s;}},/* 187 *//***/function(i,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e["default"]={// s - startFrame, e - endFrame
|
|
249
|
+
"default":function _default(n,s,c,l,f){return typeof n=="number"&&typeof s=="number"?n+(c-l)/(f-l)*(s-n):c-l>f-c?s:n;}};},/* 188 *//***/function(i,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.parseEasing=e.Easings=void 0;var r=t(76),n=u(r),s=t(133),c=u(s),l=t(141),f=u(l);function u(w){return w&&w.__esModule?w:{"default":w};}var v=t(189),h=new f["default"]();function y(){for(var w=arguments.length,d=Array(w),m=0;m<w;m++)d[m]=arguments[m];var p=h.get(d);return p||(p=v.apply(void 0,d),h.set(d,p),p);}function T(w){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"end";return function(m,p){for(var S=1;S<p.length;S++){var E=p[S].offset;if(m<=E){var R=p[S-1].offset,D=E,U=(m-R)/(D-R),M=1/w,W=U/M;return d==="end"?W=Math.floor(W):W=Math.ceil(W),M*W*(D-R)+R;}}return 0;};}function O(w){var d=/^cubic-bezier\((.*)\)/,m=w.match(d);if(m){var p=m[1].trim();return p=p.split(",").map(function(M){return parseFloat(M.trim());}),y.apply(void 0,(0,c["default"])(p));}if(d=/^steps\((.*)\)/,m=w.match(d),m){var S=m[1].trim();S=S.split(",").map(function(M){return M.trim();});var E=S,R=(0,n["default"])(E,2),D=R[0],U=R[1];return T(parseInt(D,10),U);}return w;}var I={linear:function linear(d){return d;},ease:y(0.25,0.1,0.25,1),"ease-in":y(0.42,0,1,1),"ease-out":y(0,0,0.58,1),"ease-in-out":y(0.42,0,0.58,1),// 'step-start': function(p, frames){
|
|
250
|
+
// let ret = 0
|
|
251
|
+
// for(let i = 0; i < frames.length; i++){
|
|
252
|
+
// const {offset} = frames[i]
|
|
253
|
+
// ret = offset
|
|
254
|
+
// if(p < offset){
|
|
255
|
+
// break
|
|
256
|
+
// }
|
|
257
|
+
// }
|
|
258
|
+
// return ret
|
|
259
|
+
// },
|
|
260
|
+
// 'step-end': function(p, frames){
|
|
261
|
+
// let ret = 0
|
|
262
|
+
// for(let i = 0; i < frames.length; i++){
|
|
263
|
+
// const {offset} = frames[i]
|
|
264
|
+
// if(p < offset){
|
|
265
|
+
// break
|
|
266
|
+
// }
|
|
267
|
+
// ret = offset
|
|
268
|
+
// }
|
|
269
|
+
// return ret
|
|
270
|
+
// }
|
|
271
|
+
"step-start":T(1,"start"),"step-end":T(1,"end")};function P(w){return typeof w=="string"?I[w]?w=I[w]:w=O(w):w.type==="cubic-bezier"?w=y.apply(void 0,(0,c["default"])(w.value)):w.type==="steps"&&(w=T(w.step,w.pos)),w;}e.Easings=I,e.parseEasing=P;},/* 189 *//***/function(i,e){var t=4,r=1e-3,n=1e-7,s=10,c=11,l=1/(c-1),f=typeof Float32Array=="function";function u(w,d){return 1-3*d+3*w;}function v(w,d){return 3*d-6*w;}function h(w){return 3*w;}function y(w,d,m){return((u(d,m)*w+v(d,m))*w+h(d))*w;}function T(w,d,m){return 3*u(d,m)*w*w+2*v(d,m)*w+h(d);}function O(w,d,m,p,S){var E,R,D=0;do R=d+(m-d)/2,E=y(R,p,S)-w,E>0?m=R:d=R;while(Math.abs(E)>n&&++D<s);return R;}function I(w,d,m,p){for(var S=0;S<t;++S){var E=T(d,m,p);if(E===0)return d;var R=y(d,m,p)-w;d-=R/E;}return d;}function P(w){return w;}i.exports=function(d,m,p,S){if(!(0<=d&&d<=1&&0<=p&&p<=1))throw new Error("bezier x values must be in [0, 1] range");if(d===m&&p===S)return P;for(var E=f?new Float32Array(c):new Array(c),R=0;R<c;++R)E[R]=y(R*l,d,p);function D(U){for(var M=0,W=1,$=c-1;W!==$&&E[W]<=U;++W)M+=l;--W;var B=(U-E[W])/(E[W+1]-E[W]),N=M+B*l,z=T(N,d,p);return z>=r?I(U,N,d,p):z===0?N:O(U,M,M+l,d,p);}return function(M){return M===0?0:M===1?1:y(D(M),m,S);};};},/* 190 *//***/function(i,e,t){Object.defineProperty(e,"__esModule",{value:!0});var r=t(191),n=m(r),s=t(204),c=m(s),l=t(164),f=m(l),u=t(170),v=m(u),h=t(171),y=m(h),T=t(175),O=m(T),I=t(75),P=m(I),w=t(208),d=t(188);function m(z){return z&&z.__esModule?z:{"default":z};}var p=(0,O["default"])("timing"),S=(0,O["default"])("keyframes"),E=(0,O["default"])("initState"),R=(0,O["default"])("readyDefer"),D=(0,O["default"])("finishedDefer"),U=(0,O["default"])("effects"),M=(0,O["default"])("activeReadyTimer"),W=(0,O["default"])("activeFinishTimer"),$=(0,O["default"])("removeDefer"),B={delay:0,endDelay:0,fill:"auto",iterations:1,playbackRate:1,direction:"normal",easing:"linear",effect:null},N=function(){function z(J,et,at){var ct=this;if((0,v["default"])(this,z),Array.isArray(J)){var V=[J[0],J,et];J=V[0],et=V[1],at=V[2];}typeof at=="number"&&(at={duration:at}),this[p]=(0,f["default"])({},B,at),this[p].easing=(0,d.parseEasing)(this[p].easing),this[S]=(0,w.calculateFramesOffset)(et);var Q=this[S][this[S].length-1];this[E]={},(0,c["default"])(Q).forEach(function(ft){Object.prototype.hasOwnProperty.call(J,ft)&&ft!=="easing"&&ft!=="offset"&&(ct[E][ft]=J[ft]);}),this[S]=this[S].map(function(ft){return(0,f["default"])({},ct[E],ft);}),this[S][0].offset!==0&&this[S].unshift((0,f["default"])({},this[E],{offset:0})),Q.offset<1&&this[S].push((0,f["default"])({},Q,{offset:1})),this[U]={},this.timeline=null;}return(0,y["default"])(z,[{key:"pause",value:function value(){this.timeline.playbackRate=0;}},{key:M,value:function value(){var et=this;this[R]&&!this[R].timerID&&(this.timeline.currentTime<0?this[R].timerID=this.timeline.setTimeout(function(){et[R].resolve(),delete et[R];},{delay:-this.timeline.currentTime,heading:!1}):this[R].timerID=this.timeline.setTimeout(function(){et[R].resolve(),delete et[R];},{delay:0,isEntropy:!0}));}},{key:W,value:function value(){var et=this,at=this[p],ct=at.duration,V=at.iterations,Q=at.endDelay,ft=Math.ceil(ct*V+Q-this.timeline.currentTime)+1;this[D]&&!this[D].timerID&&(this[D].timerID=this.timeline.setTimeout(function(){et[D].resolve(),et[$](R),et[$](D);},{delay:ft,heading:!1}),this[D].reverseTimerID=this.timeline.setTimeout(function(){et[D].resolve(),et[$](R),et[$](D),et.timeline=null;},{delay:-this[p].delay-1,heading:!1}));}},{key:"play",value:function value(){if(this.playState==="finished"&&this.cancel(),this.playState==="idle"){if(this.playbackRate<=0)return;var et=this[p],at=et.delay,ct=et.playbackRate,V=et.timeline;this.timeline=new P["default"]({originTime:at,playbackRate:ct},V),this[M](),this[W]();}else this.playState==="paused"&&(this.timeline.playbackRate=this.playbackRate,this[M]());}},{key:$,value:function value(et){var at=this[et],ct=this.timeline;at&&ct&&(ct.clearTimeout(at.timerID),at.reverseTimerID&&ct.clearTimeout(at.reverseTimerID)),delete this[et];}},{key:"cancel",value:function value(){this[$](R),this[$](D),this.timeline=null;}},{key:"finish",value:function value(){this.timeline&&(this.timeline.currentTime=1/0/this.playbackRate),this[$](R),this[$](D);}},{key:"applyEffects",value:function value(et){return(0,f["default"])(this[U],et);}},{key:"playbackRate",get:function get(){return this[p].playbackRate;},set:function set(et){this.timeline&&(this.timeline.playbackRate=et),this[p].playbackRate=et;}},{key:"playState",get:function get(){var et=this.timeline,at=this[p],ct=at.iterations,V=at.duration,Q=at.endDelay,ft="running";if(et==null)ft="idle";else if(et.paused)ft="paused";else if(et.currentTime<0)ft="pending";else{var mt=et.currentTime-ct*V;mt>0&&mt<Q?ft="pending":mt>=Q&&(ft="finished");}return ft;}},{key:"progress",get:function get(){if(!this.timeline)return 0;var et=this[p],at=et.duration,ct=et.iterations,V=this.timeline,Q=this.playState,ft=void 0;if(Q==="idle")ft=0;else if(Q==="paused"&&V.currentTime<0)ft=0;else if(Q==="pending"){if(V.currentTime<0)ft=0;else{var mt=V.seekLocalTime(ct*at);ft=(0,w.periodicity)(mt,at)[1]/at;}}else(Q==="running"||Q==="paused")&&(ft=(0,w.periodicity)(V.currentTime,at)[1]/at);return Q==="finished"&&(ft=(0,w.periodicity)(ct,1)[1]),ft;}},{key:"frame",get:function get(){var et=this.playState,at=this[E],ct=this[p].fill;if(et==="idle")return at;var V=this.timeline.currentTime,Q=this[S].slice(0),ft=(0,w.getProgress)(this.timeline,this[p],this.progress),mt=ft.p,yt=ft.inverted,At=at;return V<0&&et==="pending"?(ct==="backwards"||ct==="both")&&(At=yt?Q[Q.length-1]:Q[0]):(et!=="pending"&&et!=="finished"||ct==="forwards"||ct==="both")&&(At=(0,w.getCurrentFrame)(this[p],Q,this[U],mt)),At;}},{key:"timing",get:function get(){return this[p];}},{key:"effects",get:function get(){return this[U];}},{key:"baseTimeline",set:function set(et){this[p].timeline=et;},get:function get(){return this[p].timeline;}},{key:"ready",get:function get(){return this[R]?this[R].promise:this.timeline&&this.timeline.currentTime>=0&&this.playState!=="paused"?n["default"].resolve():(this[R]=(0,w.defer)(),this.timeline&&this[M](),this[R]?this[R].promise:n["default"].resolve());}},{key:"finished",get:function get(){return this.playState==="finished"?n["default"].resolve():(this[D]||(this[D]=(0,w.defer)(),this.timeline&&this[W]()),this[D].promise);}}]),z;}();e["default"]=N;},/* 191 *//***/function(i,e,t){i.exports={"default":t(192),__esModule:!0};},/* 192 *//***/function(i,e,t){t(143),t(125),t(79),t(193),t(202),t(203),i.exports=t(92).Promise;},/* 193 *//***/function(i,e,t){var r=t(89),n=t(91),s=t(93),c=t(128),l=t(90),f=t(98),u=t(94),v=t(147),h=t(148),y=t(194),T=t(195).set,O=t(197)(),I=t(198),P=t(199),w=t(200),d=t(201),m="Promise",p=n.TypeError,S=n.process,E=S&&S.versions,R=E&&E.v8||"",_D=n[m],U=c(S)=="process",M=function M(){},W,$,B,N,z=$=I.f,J=!!function(){try{var yt=_D.resolve(1),At=(yt.constructor={})[t(122)("species")]=function(ht){ht(M,M);};return(U||typeof PromiseRejectionEvent=="function")&&yt.then(M)instanceof At&&R.indexOf("6.6")!==0&&w.indexOf("Chrome/66")===-1;}catch(_unused15){}}(),et=function et(yt){var At;return f(yt)&&typeof(At=yt.then)=="function"?At:!1;},at=function at(yt,At){if(!yt._n){yt._n=!0;var ht=yt._c;O(function(){for(var Nt=yt._v,Bt=yt._s==1,G=0,k=function k(rt){var nt=Bt?rt.ok:rt.fail,Y=rt.resolve,Z=rt.reject,C=rt.domain,L,X,K;try{nt?(Bt||(yt._h==2&&Q(yt),yt._h=1),nt===!0?L=Nt:(C&&C.enter(),L=nt(Nt),C&&(C.exit(),K=!0)),L===rt.promise?Z(p("Promise-chain cycle")):(X=et(L))?X.call(L,Y,Z):Y(L)):Z(Nt);}catch(q){C&&!K&&C.exit(),Z(q);}};ht.length>G;)k(ht[G++]);yt._c=[],yt._n=!1,At&&!yt._h&&ct(yt);});}},ct=function ct(yt){T.call(n,function(){var At=yt._v,ht=V(yt),Nt,Bt,G;if(ht&&(Nt=P(function(){U?S.emit("unhandledRejection",At,yt):(Bt=n.onunhandledrejection)?Bt({promise:yt,reason:At}):(G=n.console)&&G.error&&G.error("Unhandled promise rejection",At);}),yt._h=U||V(yt)?2:1),yt._a=void 0,ht&&Nt.e)throw Nt.v;});},V=function V(yt){return yt._h!==1&&(yt._a||yt._c).length===0;},Q=function Q(yt){T.call(n,function(){var At;U?S.emit("rejectionHandled",yt):(At=n.onrejectionhandled)&&At({promise:yt,reason:yt._v});});},ft=function ft(yt){var At=this;At._d||(At._d=!0,At=At._w||At,At._v=yt,At._s=2,At._a||(At._a=At._c.slice()),at(At,!0));},_mt3=function mt(yt){var At=this,ht;if(!At._d){At._d=!0,At=At._w||At;try{if(At===yt)throw p("Promise can't be resolved itself");(ht=et(yt))?O(function(){var Nt={_w:At,_d:!1};try{ht.call(yt,s(_mt3,Nt,1),s(ft,Nt,1));}catch(Bt){ft.call(Nt,Bt);}}):(At._v=yt,At._s=1,at(At,!1));}catch(Nt){ft.call({_w:At,_d:!1},Nt);}}};J||(_D=function D(At){v(this,_D,m,"_h"),u(At),W.call(this);try{At(s(_mt3,this,1),s(ft,this,1));}catch(ht){ft.call(this,ht);}},W=function W(At){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1;},W.prototype=t(146)(_D.prototype,{// 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
|
|
272
|
+
then:function then(At,ht){var Nt=z(y(this,_D));return Nt.ok=typeof At=="function"?At:!0,Nt.fail=typeof ht=="function"&&ht,Nt.domain=U?S.domain:void 0,this._c.push(Nt),this._a&&this._a.push(Nt),this._s&&at(this,!1),Nt.promise;},// 25.4.5.1 Promise.prototype.catch(onRejected)
|
|
273
|
+
"catch":function _catch(yt){return this.then(void 0,yt);}}),B=function B(){var yt=new W();this.promise=yt,this.resolve=s(_mt3,yt,1),this.reject=s(ft,yt,1);},I.f=z=function z(yt){return yt===_D||yt===N?new B(yt):$(yt);}),l(l.G+l.W+l.F*!J,{Promise:_D}),t(121)(_D,m),t(149)(m),N=t(92)[m],l(l.S+l.F*!J,m,{// 25.4.4.5 Promise.reject(r)
|
|
274
|
+
reject:function reject(At){var ht=z(this),Nt=ht.reject;return Nt(At),ht.promise;}}),l(l.S+l.F*(r||!J),m,{// 25.4.4.6 Promise.resolve(x)
|
|
275
|
+
resolve:function resolve(At){return d(r&&this===N?_D:this,At);}}),l(l.S+l.F*!(J&&t(140)(function(yt){_D.all(yt)["catch"](M);})),m,{// 25.4.4.1 Promise.all(iterable)
|
|
276
|
+
all:function all(At){var ht=this,Nt=z(ht),Bt=Nt.resolve,G=Nt.reject,k=P(function(){var rt=[],nt=0,Y=1;h(At,!1,function(Z){var C=nt++,L=!1;rt.push(void 0),Y++,ht.resolve(Z).then(function(X){L||(L=!0,rt[C]=X,--Y||Bt(rt));},G);}),--Y||Bt(rt);});return k.e&&G(k.v),Nt.promise;},// 25.4.4.4 Promise.race(iterable)
|
|
277
|
+
race:function race(At){var ht=this,Nt=z(ht),Bt=Nt.reject,G=P(function(){h(At,!1,function(k){ht.resolve(k).then(Nt.resolve,Bt);});});return G.e&&Bt(G.v),Nt.promise;}});},/* 194 *//***/function(i,e,t){var r=t(97),n=t(94),s=t(122)("species");i.exports=function(c,l){var f=r(c).constructor,u;return f===void 0||(u=r(f)[s])==null?l:n(u);};},/* 195 *//***/function(i,e,t){var r=t(93),n=t(196),s=t(120),c=t(102),l=t(91),f=l.process,u=l.setImmediate,v=l.clearImmediate,h=l.MessageChannel,y=l.Dispatch,T=0,O={},I="onreadystatechange",P,w,d,m=function m(){var S=+this;if(O.hasOwnProperty(S)){var E=O[S];delete O[S],E();}},p=function p(S){m.call(S.data);};(!u||!v)&&(u=function u(E){for(var R=[],D=1;arguments.length>D;)R.push(arguments[D++]);return O[++T]=function(){n(typeof E=="function"?E:Function(E),R);},P(T),T;},v=function v(E){delete O[E];},t(86)(f)=="process"?P=function P(S){f.nextTick(r(m,S,1));}:y&&y.now?P=function P(S){y.now(r(m,S,1));}:h?(w=new h(),d=w.port2,w.port1.onmessage=p,P=r(d.postMessage,d,1)):l.addEventListener&&typeof postMessage=="function"&&!l.importScripts?(P=function P(S){l.postMessage(S+"","*");},l.addEventListener("message",p,!1)):I in c("script")?P=function P(S){s.appendChild(c("script"))[I]=function(){s.removeChild(this),m.call(S);};}:P=function P(S){setTimeout(r(m,S,1),0);}),i.exports={set:u,clear:v};},/* 196 *//***/function(i,e){i.exports=function(t,r,n){var s=n===void 0;switch(r.length){case 0:return s?t():t.call(n);case 1:return s?t(r[0]):t.call(n,r[0]);case 2:return s?t(r[0],r[1]):t.call(n,r[0],r[1]);case 3:return s?t(r[0],r[1],r[2]):t.call(n,r[0],r[1],r[2]);case 4:return s?t(r[0],r[1],r[2],r[3]):t.call(n,r[0],r[1],r[2],r[3]);}return t.apply(n,r);};},/* 197 *//***/function(i,e,t){var r=t(91),n=t(195).set,s=r.MutationObserver||r.WebKitMutationObserver,c=r.process,l=r.Promise,f=t(86)(c)=="process";i.exports=function(){var u,v,h,y=function y(){var P,w;for(f&&(P=c.domain)&&P.exit();u;){w=u.fn,u=u.next;try{w();}catch(d){throw u?h():v=void 0,d;}}v=void 0,P&&P.enter();};if(f)h=function h(){c.nextTick(y);};else if(s&&!(r.navigator&&r.navigator.standalone)){var T=!0,O=document.createTextNode("");new s(y).observe(O,{characterData:!0}),h=function h(){O.data=T=!T;};}else if(l&&l.resolve){var I=l.resolve(void 0);h=function h(){I.then(y);};}else h=function h(){n.call(r,y);};return function(P){var w={fn:P,next:void 0};v&&(v.next=w),u||(u=w,h()),v=w;};};},/* 198 *//***/function(i,e,t){var r=t(94);function n(s){var c,l;this.promise=new s(function(f,u){if(c!==void 0||l!==void 0)throw TypeError("Bad Promise constructor");c=f,l=u;}),this.resolve=r(c),this.reject=r(l);}i.exports.f=function(s){return new n(s);};},/* 199 *//***/function(i,e){i.exports=function(t){try{return{e:!1,v:t()};}catch(r){return{e:!0,v:r};}};},/* 200 *//***/function(i,e,t){var r=t(91),n=r.navigator;i.exports=n&&n.userAgent||"";},/* 201 *//***/function(i,e,t){var r=t(97),n=t(98),s=t(198);i.exports=function(c,l){if(r(c),n(l)&&l.constructor===c)return l;var f=s.f(c),u=f.resolve;return u(l),f.promise;};},/* 202 *//***/function(i,e,t){var r=t(90),n=t(92),s=t(91),c=t(194),l=t(201);r(r.P+r.R,"Promise",{"finally":function _finally(f){var u=c(this,n.Promise||s.Promise),v=typeof f=="function";return this.then(v?function(h){return l(u,f()).then(function(){return h;});}:f,v?function(h){return l(u,f()).then(function(){throw h;});}:f);}});},/* 203 *//***/function(i,e,t){var r=t(90),n=t(198),s=t(199);r(r.S,"Promise",{"try":function _try(c){var l=n.f(this),f=s(c);return(f.e?l.reject:l.resolve)(f.v),l.promise;}});},/* 204 *//***/function(i,e,t){i.exports={"default":t(205),__esModule:!0};},/* 205 *//***/function(i,e,t){t(206),i.exports=t(92).Object.keys;},/* 206 *//***/function(i,e,t){var r=t(124),n=t(110);t(207)("keys",function(){return function(c){return n(r(c));};});},/* 207 *//***/function(i,e,t){var r=t(90),n=t(92),s=t(101);i.exports=function(c,l){var f=(n.Object||{})[c]||Object[c],u={};u[c]=l(f),r(r.S+r.F*s(function(){f(1);}),"Object",u);};},/* 208 *//***/function(i,e,t){Object.defineProperty(e,"__esModule",{value:!0});var r=t(76),n=O(r),s=t(209),c=O(s),l=t(164),f=O(l),u=t(191),v=O(u);e.defer=I,e.periodicity=P,e.calculateFramesOffset=w,e.getProgress=d,e.getCurrentFrame=p;var h=t(188),y=t(187),T=O(y);function O(S){return S&&S.__esModule?S:{"default":S};}function I(){var S={};return S.promise=new v["default"](function(E,R){S.resolve=E,S.reject=R;}),S;}function P(S,E){var R=Math.floor(S/E),D=S-R*E;return D===0&&R>0&&(D=E,R--),[R,D];}function w(S){S=S.slice(0);var E=S[0],R=S[S.length-1];R.offset=R.offset||1,E.offset=E.offset||0;for(var D=0,U=-1,M=0;M<S.length;M++){var W=S[M];if(W.offset!=null){var $=M-U;if($>1)for(var B=(W.offset-D)/$,N=0;N<$-1;N++)S[U+N+1].offset=D+B*(N+1);D=W.offset,U=M;}if(W.easing!=null&&(W.easing=(0,h.parseEasing)(W.easing)),M>0){var z=S[M].easing!=null;S[M]=(0,f["default"])({},S[M-1],S[M]),z||delete S[M].easing;}}return S;}function d(S,E,R){var D=S.currentTime,U=E.direction,M=E.duration,W=!1;if(U==="reverse")R=1-R,W=!0;else if(U==="alternate"||U==="alternate-reverse"){var $=Math.floor(D/M);R===1&&$--,$%2^U==="alternate-reverse"&&(R=1-R,W=!0);}return{p:R,inverted:W};}function m(S,E,R,D){var U={};return(0,c["default"])(E).forEach(function(M){var W=(0,n["default"])(M,2),$=W[0],B=W[1];if($!=="offset"&&$!=="easing"){var N=R[$]||R["default"],z=N(S[$],B,D,S.offset,E.offset);z!=null&&(U[$]=z);}}),U;}function p(S,E,R,D){var U=S.easing,M=S.effect;M||(R=(0,f["default"])({},T["default"],R));var W={};D=U(D,E);for(var $=1;$<E.length;$++){var B=E[$],N=B.offset;if(N>=D||$===E.length-1){var z=E[$-1],J=z.offset,et=z.easing,at=D;if(et){var ct=N-J;at=et((D-J)/ct)*ct+J;}M?W=M(z,B,at,J,N):W=m(z,B,R,at);break;}}return W;}},/* 209 *//***/function(i,e,t){i.exports={"default":t(210),__esModule:!0};},/* 210 *//***/function(i,e,t){t(211),i.exports=t(92).Object.entries;},/* 211 *//***/function(i,e,t){var r=t(90),n=t(212)(!0);r(r.S,"Object",{entries:function entries(c){return n(c);}});},/* 212 *//***/function(i,e,t){var r=t(100),n=t(110),s=t(84),c=t(169).f;i.exports=function(l){return function(f){for(var u=s(f),v=n(u),h=v.length,y=0,T=[],O;h>y;)O=v[y++],(!r||c.call(u,O))&&T.push(l?[O,u[O]]:u[O]);return T;};};},/* 213 *//***/function(i,e,t){t.r(e),t(1).glMatrix.setMatrixArrayType(Array);var r=/* @__PURE__ */new Map();function n(c){var l=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var f=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];c=c.toLowerCase();var u=r.get(c);if(!u)throw new TypeError("Invalid node: ".concat(c));var v=new u(l);return f.forEach(function(h){v.appendChild(h);}),v;}var s={registerNode:function registerNode(c,l){var f=arguments.length>2&&arguments[2]!==undefined?arguments[2]:100;if(l=l.toLowerCase(),r.has(l))throw new TypeError("Cannot registerNode, ".concat(l," has been taken."));r.set(l,c),Object.defineProperties(c.prototype,{nodeType:{value:f},tagName:{value:l.toUpperCase()},nodeName:{value:l},ownerDocument:{value:s},namespaceURI:{value:"http://spritejs.com/".concat(l)}});},createElement:n,createElementNS:function createElementNS(c,l){return n(l);},isSpriteNode:function isSpriteNode(c){return r.has(c.toLowerCase());}};e["default"]=s;},/* 214 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return l;}),t(1).glMatrix.setMatrixArrayType(Array);var r=Symbol("type"),n=Symbol("bubbles"),s=Symbol("originalEvent"),c=Symbol("detail");var l=/*#__PURE__*/function(){function l(u){var _ref112=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref112$bubbles=_ref112.bubbles,v=_ref112$bubbles===void 0?null:_ref112$bubbles;_classCallCheck(this,l);if(typeof u=="string"?(this[r]=u,this[n]=!!v):(this[r]=u.type,this[s]=u,this[n]=v!=null?!!v:!!u.bubbles,u.detail&&(this[c]=u.detail)),!this[r])throw new TypeError("Invalid event type.");this.cancelBubble=!1;}return _createClass(l,[{key:"setOriginalEvent",value:function setOriginalEvent(u){this[s]=u;}},{key:"originalEvent",get:function get(){return this[s];}},{key:"type",get:function get(){return this[r];}},{key:"bubbles",get:function get(){return this[n];}},{key:"detail",get:function get(){return this[c];}},{key:"stopPropagation",value:function stopPropagation(){this.cancelBubble=!0;}}]);}();},/* 215 *//***/function(i,e,t){t.r(e),t.d(e,"parseFilterString",function(){return n;}),t.d(e,"applyFilters",function(){return s;});var r=t(72);t(1).glMatrix.setMatrixArrayType(Array);function n(c){if(c=c.trim(),!c||c==="none")return null;var l=/^(?:(url|blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\(([^()]*(?:\(.*\))*[^()]*)\))+$/i,f=c.match(/(?:(url|blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\(([^()]*(?:\(.*\))*[^()]*)\))+?/ig),u=[];return f&&f.forEach(function(v){var h=v.match(l);if(!h)throw new TypeError("Invalid fitler string.");var _h3=_slicedToArray(h,3),y=_h3[1],T=_h3[2];y=y.toLowerCase(),T=T.trim().match(/([^( )]+|([^( )]+\(.*\)))(?=\s|$)/g).map(function(O,I){var P;return y==="url"||y==="drop-shadow"&&I===3?P=O:P=Object(r.toNumber)(O),/%$/.test(O)&&(P/=100),P;}),u.push({type:y,args:T});}),u;}function s(c,l){c.clearFilter(),l&&l.forEach(function(_ref113){var f=_ref113.type,u=_ref113.args;var v=f;v==="drop-shadow"?v="dropShadow":v==="hue-rotate"&&(v="hueRotate"),c[v].apply(c,_toConsumableArray(u));});}},/* 216 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return r;}),t(1).glMatrix.setMatrixArrayType(Array);function r(n,s){if(!s)return;var c=n.getListeners("beforerender"),l=n.getListeners("afterrender");c.length&&!s.beforeRender?s.beforeRender=function(f){n.dispatchEvent({type:"beforerender",detail:{context:f}});}:c.length||(s.beforeRender=null),l.length&&!s.afterRender?s.afterRender=function(f){n.dispatchEvent({type:"afterrender",detail:{context:f}});}:l.length||(s.afterRender=null);}},/* 217 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return u;});var r=t(12),n=t(218),s=t(70),c=t(213);t(1).glMatrix.setMatrixArrayType(Array);var l=Symbol("amount"),f=Symbol("meshCloud");var u=/*#__PURE__*/function(_s$default){function u(h){var _this13;var y=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;_classCallCheck(this,u);_this13=_callSuper(this,u),_this13.meshNode=h,h.connect(_assertThisInitialized(_this13)),_this13[l]=y,_this13[f]=null;return _this13;}_inherits(u,_s$default);return _createClass(u,[{key:"meshCloud",get:function get(){var h=this.meshNode,y=this[l];return!this[f]&&h.mesh&&(this[f]=new r.MeshCloud(h.mesh,y)),this[f];}/* override */},{key:"isVisible",get:function get(){return!!this.meshNode&&this.meshNode.isVisible;}},{key:"amount",get:function get(){return this[l];},set:function set(h){this[l]=h,this[f]&&(this[f].amount=h);}},{key:"brightness",value:function brightness(h,y){this.meshCloud&&(this.meshCloud.brightness(h,y),this.forceUpdate());}},{key:"contrast",value:function contrast(h,y){this.meshCloud&&(this.meshCloud.contrast(h,y),this.forceUpdate());}},{key:"delete",value:function _delete(h){this.meshCloud&&(this.meshCloud["delete"](h),this[l]--,this.forceUpdate());}/* override */},{key:"draw",value:function draw(){var _this14=this;var h=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];if(_superPropGet(u,"draw",this,3)([h]),this.meshCloud){if(this.program){this.meshCloud.setProgram(this.program);var y=this.shaderAttrs;y&&Object.entries(y).forEach(function(_ref114){var _ref115=_slicedToArray(_ref114,2),O=_ref115[0],I=_ref115[1];_this14.meshCloud.mesh.setAttribute(O,I);});var T=this.uniforms;if(this.uniforms){var O={};Object.entries(T).forEach(function(_ref116){var _ref117=_slicedToArray(_ref116,2),I=_ref117[0],P=_ref117[1];typeof P=="function"&&(P=P(_this14,I)),O[I]=P;}),this.meshCloud.mesh.setUniforms(O);}}this.meshNode.textureImage&&Object(n.drawTexture)(this.meshNode,this.meshNode.mesh),h.push(this.meshCloud);}return h;}},{key:"getTransform",value:function getTransform(h){if(this.meshCloud)return this.meshCloud.getTransform(h);}},{key:"grayscale",value:function grayscale(h,y){this.meshCloud&&(this.meshCloud.grayscale(h,y),this.forceUpdate());}},{key:"hueRotate",value:function hueRotate(h,y){this.meshCloud&&(this.meshCloud.hueRotate(h,y),this.forceUpdate());}},{key:"invert",value:function invert(h,y){this.meshCloud&&(this.meshCloud.invert(h,y),this.forceUpdate());}/* override */},{key:"isPointCollision",value:function isPointCollision(h,y){if(!this.meshCloud)return!1;var T=this.attributes.pointerEvents;if(T==="none"||T!=="all"&&!this.isVisible)return!1;var O="both";T==="visibleFill"&&(O="fill"),T==="visibleStroke"&&(O="stroke");for(var I=0;I<this[l];I++)if(!this.meshCloud.isPointCollision(I,[h,y],O))return!1;return!0;}},{key:"setOpacity",value:function setOpacity(h,y){this.meshCloud&&(this.meshCloud.opacity(h,y),this.forceUpdate());}},{key:"rotate",value:function rotate(h,y){var _ref118=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref119=_slicedToArray(_ref118,2),T=_ref119[0],O=_ref119[1];var I=Math.PI*y/180;if(this.meshCloud){var _this$meshNode$attrib=this.meshNode.attributes,P=_this$meshNode$attrib.x,_w11=_this$meshNode$attrib.y;this.meshCloud.rotate(h,I,[T+P,O+_w11]),this.forceUpdate();}}},{key:"saturate",value:function saturate(h,y){this.meshCloud&&(this.meshCloud.saturate(h,y),this.forceUpdate());}},{key:"scale",value:function scale(h,_ref120){var _ref121=_slicedToArray(_ref120,2),y=_ref121[0],_ref121$=_ref121[1],T=_ref121$===void 0?y:_ref121$;var _ref122=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref123=_slicedToArray(_ref122,2),O=_ref123[0],I=_ref123[1];if(this.meshCloud){var _this$meshNode$attrib2=this.meshNode.attributes,P=_this$meshNode$attrib2.x,_w12=_this$meshNode$attrib2.y,_d10=1e-5;Math.abs(y)<_d10&&(y=1/y>0?_d10:-_d10),Math.abs(T)<_d10&&(T=1/T>0?_d10:-_d10),this.meshCloud.scale(h,[y,T],[O+P,I+_w12]),this.forceUpdate();}}},{key:"setColorTransform",value:function setColorTransform(h,y){this.meshCloud&&(this.meshCloud.setColorTransform(h,y),this.forceUpdate());}},{key:"setFillColor",value:function setFillColor(h,y){this.meshCloud&&(Array.isArray(y)&&(y=_toConsumableArray(y),y[0]/=255,y[1]/=255,y[2]/=255),this.meshCloud.setFillColor(h,y),this.forceUpdate());}},{key:"sepia",value:function sepia(h,y){this.meshCloud&&(this.meshCloud.sepia(h,y),this.forceUpdate());}/* override */},{key:"setResolution",value:function setResolution(_ref124){var h=_ref124.width,y=_ref124.height;_superPropGet(u,"setResolution",this,3)([{width:h,height:y}]),this.meshNode.setResolution({width:h,height:y});}},{key:"setStrokeColor",value:function setStrokeColor(h,y){this.meshCloud&&(Array.isArray(y)&&(y=_toConsumableArray(y),y[0]/=255,y[1]/=255,y[2]/=255),this.meshCloud.setStrokeColor(h,y),this.forceUpdate());}},{key:"setTransform",value:function setTransform(h,y){this.meshCloud&&(this.meshCloud.setTransform(h,y),this.forceUpdate());}},{key:"skew",value:function skew(h,_ref125){var _ref126=_slicedToArray(_ref125,2),y=_ref126[0],_ref126$=_ref126[1],T=_ref126$===void 0?y:_ref126$;var _ref127=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref128=_slicedToArray(_ref127,2),O=_ref128[0],I=_ref128[1];if(this.meshCloud){var _this$meshNode$attrib3=this.meshNode.attributes,P=_this$meshNode$attrib3.x,_w13=_this$meshNode$attrib3.y;this.meshCloud.skew(h,[y,T],[O+P,I+_w13]),this.forceUpdate();}}},{key:"transform",value:function transform(h,y){this.meshCloud&&(this.meshCloud.transform(h,y),this.forceUpdate());}},{key:"transformColor",value:function transformColor(h,y){this.meshCloud&&(this.meshCloud.transformColor(h,y),this.forceUpdate());}},{key:"translate",value:function translate(h,_ref129){var _ref130=_slicedToArray(_ref129,2),y=_ref130[0],T=_ref130[1];this.meshCloud&&(this.meshCloud.translate(h,[y,T]),this.forceUpdate());}},{key:"updateMesh",value:function updateMesh(){this[f]&&(this[f].mesh=this.meshNode.mesh,this.forceUpdate());}}]);}(s["default"]);c["default"].registerNode(u,"cloud");},/* 218 *//***/function(i,e,t){t.r(e),t.d(e,"loadTexture",function(){return c;}),t.d(e,"applyTexture",function(){return l;}),t.d(e,"createTexture",function(){return u;}),t.d(e,"deleteTexture",function(){return v;}),t.d(e,"drawTexture",function(){return y;}),t.d(e,"loadFrames",function(){return T;});var r=t(12),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var s={};function c(O,I){if(s[O])return s[O];var P=r.ENV.loadImage(O,{alias:I,useImageBitmap:!1});return P!==null&&P!==void 0?P:O;}function l(_x9,_x0,_x1){return _l2.apply(this,arguments);}function _l2(){_l2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8(O,I,P){var w,_O$attributes,_d11,m,p,S,_t9;return _regenerator().w(function(_context8){while(1)switch(_context8.n){case 0:w=I;typeof I=="string"&&(w=c(I));_t9=w&&typeof w.then=="function";if(!_t9){_context8.n=2;break;}_context8.n=1;return w;case 1:w=_context8.v;case 2:if(!(I===O.attributes.texture)){_context8.n=3;break;}w&&w.image&&(w.sourceRect&&(O.attributes.sourceRect=w.sourceRect),O.textureImageRotated=!!w.rotated,w=w.image);_O$attributes=O.attributes,_d11=_O$attributes.width,m=_O$attributes.height,p=_O$attributes.textureRect,S=O.textureImage;O.textureImage=w,P&&S!==w&&!p&&(_d11==null||m==null)&&O.updateContours(),O.forceUpdate();case 3:return _context8.a(2,w);}},_callee8);}));return _l2.apply(this,arguments);}var f=Symbol("textureMap");function u(O,I){if(I[f]=I[f]||/* @__PURE__ */new Map(),I[f].has(O))return I[f].get(O);var P=I.createTexture(O);return!/^blob:/.test(O.src)&&typeof O.getContext!="function"&&I[f].set(O,P),P;}function v(O,I){if(I[f]&&I[f].has(O)){var P=I[f].get(O);return I.deleteTexture(P),I[f]["delete"](O),!0;}return!1;}var h=Symbol("textureContext");function y(O,I){var P=O.textureImage instanceof String?String(O.textureImage):O.textureImage,w=O.textureImageRotated,d=I.texture,m=O.renderer;if(P){var p=O.originalContentRect;var S=O.attributes.textureRect;var E=O.attributes.textureRepeat,R=O.attributes.sourceRect;if(!d||O[h]&&O[h]!==m||d.image!==P||d.options.repeat!==E||!Object(n.compareValue)(d.options.rect,S)||!Object(n.compareValue)(d.options.srcRect,R)){var D=u(P,m);S?(S[0]+=p[0],S[1]+=p[1]):S=p;var U=null;d&&!m[f].has(d.image)&&(!d.options||!d.options.hidden)&&(U=I.uniforms.u_texSampler),I.setTexture(D,{rect:S,repeat:E,srcRect:R,rotated:w}),U&&U["delete"]&&U["delete"](),O[h]=m;}}else if(d){var _p8=null;!m[f].has(d.image)&&(!d.options||!d.options.hidden)&&(_p8=I.uniforms.u_texSampler),I.setTexture(null),_p8&&_p8["delete"]&&_p8["delete"]();}}function T(_x10,_x11){return _T6.apply(this,arguments);}function _T6(){_T6=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9(O,I){var P,w,_t0;return _regenerator().w(function(_context9){while(1)switch(_context9.n){case 0:_t0=typeof I=="string";if(!_t0){_context9.n=3;break;}_context9.n=1;return fetch(I,{method:"GET",mode:"cors",cache:"default"});case 1:_context9.n=2;return _context9.v.json();case 2:I=_context9.v;case 3:_context9.n=4;return c(O);case 4:P=_context9.v;w=I.frames;return _context9.a(2,(Object.entries(w).forEach(function(_ref131){var _ref132=_slicedToArray(_ref131,2),d=_ref132[0],m=_ref132[1];var _m$frame=m.frame,p=_m$frame.x,S=_m$frame.y,E=_m$frame.w,R=_m$frame.h;var D=[p,S,E,R];var U=m.rotated;U&&(D=[D[0],D[1],D[3],D[2]]),s[d]={image:P,sourceRect:D,rotated:U};}),P));}},_callee9);}));return _T6.apply(this,arguments);}},/* 219 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return T;});var r=t(1),n=t(12),s=t(70),c=t(220),l=t(221),f=t(222),u=t(213),v=t(223);t(1).glMatrix.setMatrixArrayType(Array);function h(O,I,P){return I in O?Object.defineProperty(O,I,{value:P,enumerable:!0,configurable:!0,writable:!0}):O[I]=P,O;}var y=Symbol("mesh");var T=/*#__PURE__*/function(_s$default2){function T(){var I=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,T);return _callSuper(this,T,[I]);}_inherits(T,_s$default2);return _createClass(T,[{key:"borderSize",get:function get(){var _this$attributes2=this.attributes,I=_this$attributes2.paddingTop,P=_this$attributes2.paddingRight,w=_this$attributes2.paddingBottom,d=_this$attributes2.paddingLeft,m=_this$attributes2.borderWidth,_this$contentSize=_slicedToArray(this.contentSize,2),p=_this$contentSize[0],S=_this$contentSize[1];return[d+p+P+m,I+S+w+m];}// content + padding
|
|
278
|
+
},{key:"clientSize",get:function get(){var _this$attributes3=this.attributes,I=_this$attributes3.paddingTop,P=_this$attributes3.paddingRight,w=_this$attributes3.paddingBottom,d=_this$attributes3.paddingLeft,_this$contentSize2=_slicedToArray(this.contentSize,2),m=_this$contentSize2[0],p=_this$contentSize2[1];return[d+m+P,I+p+w];}},{key:"contentSize",get:function get(){var _this$attributes4=this.attributes,I=_this$attributes4.width,P=_this$attributes4.height,w=_this$attributes4.boxSizing,d=_this$attributes4.paddingTop,m=_this$attributes4.paddingRight,p=_this$attributes4.paddingBottom,S=_this$attributes4.paddingLeft;if(I=I||0,P=P||0,w==="border-box"){var E=2*this.attributes.borderWidth;I-=E+m+S,P-=E+d+p,I=Math.max(0,I),P=Math.max(0,P);}return[I,P];}},{key:"hasBorder",get:function get(){return this.attributes.borderWidth>0;}/* override */},{key:"isVisible",get:function get(){var _this$borderSize=_slicedToArray(this.borderSize,2),I=_this$borderSize[0],P=_this$borderSize[1];return I>0&&P>0;}},{key:"mesh",get:function get(){if(this.attributes.display==="none")return null;var I=this.clientBox;if(I){var _P6;var P=this[y];if(P)P.box!==I&&(P.contours=I.contours,P.box=I);else{P=new n.Mesh2D(I),P.box=I;var _d12=this.attributes.bgcolor;if(Object(l.setFillColor)(P,{color:_d12}),this.hasBorder){var _this$attributes5=this.attributes,p=_this$attributes5.borderColor,S=_this$attributes5.borderWidth,E=_this$attributes5.borderDash,R=_this$attributes5.borderDashOffset;Object(l.setStrokeColor)(P,{color:p,lineWidth:S,lineDash:E,lineDashOffset:R});}this[y]=P;var m=this.attributes.clipPath;m&&this[y].setClipPath(m);}var _w14=this.opacity;return P.getOpacity()!==_w14&&P.setOpacity(_w14),(_P6=P).setTransform.apply(_P6,_toConsumableArray(this.renderMatrix)),P;}return null;}// content + padding + border
|
|
279
|
+
},{key:"offsetSize",get:function get(){var _this$attributes6=this.attributes,I=_this$attributes6.paddingTop,P=_this$attributes6.paddingRight,w=_this$attributes6.paddingBottom,d=_this$attributes6.paddingLeft,m=_this$attributes6.borderWidth,_this$contentSize3=_slicedToArray(this.contentSize,2),p=_this$contentSize3[0],S=_this$contentSize3[1],E=2*m;return[d+p+P+E,I+S+w+E];}},{key:"originalClientRect",get:function get(){if(this.mesh){var I=this.mesh.boundingBox;return[I[0][0],I[0][1],I[1][0]-I[0][0],I[1][1]-I[0][1]];}return[0,0,0,0];}},{key:"originalContentRect",get:function get(){var _this$originalClientR=_slicedToArray(this.originalClientRect,4),I=_this$originalClientR[0],P=_this$originalClientR[1],w=_this$originalClientR[2],d=_this$originalClientR[3],m=this.attributes.padding;return[I+m[0],P+m[1],w-m[0]-m[2],d-m[1]-m[3]];}},{key:"getBoundingClientRect",value:function getBoundingClientRect(){var I=this.renderMatrix;this.layer&&this.layer.layerTransformInvert&&(I=r.mat2d.multiply(Array.of(0,0,0,0,0,0),this.layer.transformMatrix,I));var P=null;if(this.mesh){P=_toConsumableArray(this.mesh.boundingBox);var _w15=this.attributes.borderWidth;_w15&&(P[0]=[P[0][0]-_w15,P[0][1]-_w15],P[1]=[P[1][0]+_w15,P[1][1]+_w15]);}return Object(v["default"])(P,I);}// transformPoint(x, y) {
|
|
280
|
+
// const m = mat2d.invert(this.renderMatrix);
|
|
281
|
+
// const newX = x * m[0] + y * m[2] + m[4];
|
|
282
|
+
// const newY = x * m[1] + y * m[3] + m[5];
|
|
283
|
+
// return [newX, newY];
|
|
284
|
+
// }
|
|
285
|
+
/* override */},{key:"onPropertyChange",value:function onPropertyChange(I,P,w){if(_superPropGet(T,"onPropertyChange",this,3)([I,P,w]),(I==="anchorX"||I==="anchorY"||I==="boxSizing"||I==="width"||I==="height"||I==="borderWidth"||I==="paddingLeft"||I==="paddingRight"||I==="paddingTop"||I==="paddingBottom"||/^border(TopLeft|TopRight|BottomRight|BottomLeft)Radius$/.test(I))&&this.updateContours(),this[y]&&I==="clipPath"&&this[y].setClipPath(P),this[y]&&I==="bgcolor"&&Object(l.setFillColor)(this[y],{color:P}),this[y]&&(I==="borderColor"||I==="borderWidth"||I==="borderDash"||I==="borderDashOffset")){var _this$attributes7=this.attributes,_d13=_this$attributes7.borderColor,m=_this$attributes7.borderWidth,p=_this$attributes7.borderDash,S=_this$attributes7.borderDashOffset;Object(l.setStrokeColor)(this[y],{color:_d13,lineWidth:m,lineDash:m?p:0,lineDashOffset:S});}}/* override */},{key:"updateContours",value:function updateContours(){var _this$attributes8=this.attributes,I=_this$attributes8.anchorX,P=_this$attributes8.anchorY,w=_this$attributes8.borderWidth,d=_this$attributes8.borderRadius,_this$borderSize2=_slicedToArray(this.borderSize,2),m=_this$borderSize2[0],p=_this$borderSize2[1],S=this.offsetSize,E=0.5*w,R=-I*S[0]+E,D=-P*S[1]+E;this.clientBox=new n.Figure2D(),Object(f.createRadiusBox)(this.clientBox,[R,D,m,p],d);}}]);}(s["default"]);h(T,"Attr",c["default"]),u["default"].registerNode(T,"block");},/* 220 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return v;});var r=t(71),n=t(72),s=t(221);t(1).glMatrix.setMatrixArrayType(Array);var c=Symbol["for"]("spritejs_setAttribute"),l=Symbol["for"]("spritejs_getAttribute"),f=Symbol["for"]("spritejs_setAttributeDefault"),u=Symbol["for"]("spritejs_declareAlias");var v=/*#__PURE__*/function(_r$default){function v(y){var _this15;_classCallCheck(this,v);_this15=_callSuper(this,v,[y]),_this15[f]({anchorX:0,anchorY:0,/* anchor */width:void 0,height:void 0,/* size */borderWidth:0,borderColor:"rgba(0,0,0,1)",/* border */borderDash:void 0,borderDashOffset:0,borderTopLeftRadius:[0,0],borderTopRightRadius:[0,0],borderBottomRightRadius:[0,0],borderBottomLeftRadius:[0,0],/* borderRadius */bgcolor:"rgba(0,0,0,0)",paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,/* padding */boxSizing:"content-box",clipPath:void 0}),_this15[u]("anchor","size","border","borderRadius","padding");return _this15;}_inherits(v,_r$default);return _createClass(v,[{key:"anchorX",get:function get(){return this[l]("anchorX");},set:function set(y){this[c]("anchorX",Object(n.toNumber)(y));}},{key:"anchorY",get:function get(){return this[l]("anchorY");},set:function set(y){this[c]("anchorY",Object(n.toNumber)(y));}},{key:"anchor",get:function get(){return[this.anchorX,this.anchorY];},set:function set(y){y=Object(n.toArray)(y),Array.isArray(y)||(y=[y,y]),this.anchorX=y[0],this.anchorY=y[1];}},{key:"width",get:function get(){return this[l]("width");},set:function set(y){this[c]("width",Object(n.toNumber)(y));}},{key:"height",get:function get(){return this[l]("height");},set:function set(y){this[c]("height",Object(n.toNumber)(y));}},{key:"size",get:function get(){return[this.width,this.height];},set:function set(y){y=Object(n.toArray)(y),Array.isArray(y)||(y=[y,y]),this.width=y[0],this.height=y[1];}},{key:"borderWidth",get:function get(){return this[l]("borderWidth");},set:function set(y){this[c]("borderWidth",Object(n.toNumber)(y));}},{key:"borderColor",get:function get(){return this[l]("borderColor");},set:function set(y){this[c]("borderColor",Object(s.parseColor)(y));}},{key:"border",get:function get(){return[this.borderWidth,this.borderColor];},set:function set(y){y=Object(n.toArray)(y),Array.isArray(y)||(y=[y]),this.borderWidth=y[0],y[1]!=null&&(this.borderColor=y[1]);}},{key:"borderDash",get:function get(){return this[l]("borderDash");},set:function set(y){y=Object(n.toArray)(y,!0),y!=null&&!Array.isArray(y)&&(y=[y]),this[c]("borderDash",y?y.map(n.toNumber):null);}},{key:"borderDashOffset",get:function get(){return this[l]("borderDashOffset");},set:function set(y){this[c]("borderDashOffset",Object(n.toNumber)(y));}},{key:"borderTopLeftRadius",get:function get(){return this[l]("borderTopLeftRadius");},set:function set(y){y=Object(n.toArray)(y,!0),Array.isArray(y)||(y=[y,y]),this[c]("borderTopLeftRadius",y.map(n.toNumber));}},{key:"borderTopRightRadius",get:function get(){return this[l]("borderTopRightRadius");},set:function set(y){y=Object(n.toArray)(y,!0),Array.isArray(y)||(y=[y,y]),this[c]("borderTopRightRadius",y.map(n.toNumber));}},{key:"borderBottomRightRadius",get:function get(){return this[l]("borderBottomRightRadius");},set:function set(y){y=Object(n.toArray)(y,!0),Array.isArray(y)||(y=[y,y]),this[c]("borderBottomRightRadius",y.map(n.toNumber));}},{key:"borderBottomLeftRadius",get:function get(){return this[l]("borderBottomLeftRadius");},set:function set(y){y=Object(n.toArray)(y,!0),Array.isArray(y)||(y=[y,y]),this[c]("borderBottomLeftRadius",y.map(n.toNumber));}},{key:"borderRadius",get:function get(){return[].concat(_toConsumableArray(this.borderTopLeftRadius),_toConsumableArray(this.borderTopRightRadius),_toConsumableArray(this.borderBottomRightRadius),_toConsumableArray(this.borderBottomLeftRadius));},set:function set(y){if(y=Object(n.toArray)(y),!Array.isArray(y))y=Array(8).fill(y);else if(y.length===2)y=[y[0],y[1],y[0],y[1],y[0],y[1],y[0],y[1]];else if(y.length===4)y=[y[0],y[1],y[2],y[3],y[0],y[1],y[2],y[3]];else if(y.length===6)y=[y[0],y[1],y[2],y[3],y[4],y[5],y[2],y[3]];else if(y.length!==8)throw new TypeError("Invalid borderRadius value.");this.borderTopLeftRadius=[y[0],y[1]],this.borderTopRightRadius=[y[2],y[3]],this.borderBottomRightRadius=[y[4],y[5]],this.borderBottomLeftRadius=[y[6],y[7]];}},{key:"bgcolor",get:function get(){return this[l]("bgcolor");},set:function set(y){this[c]("bgcolor",Object(s.parseColor)(y));}},{key:"paddingTop",get:function get(){return this[l]("paddingTop");},set:function set(y){this[c]("paddingTop",Object(n.toNumber)(y));}},{key:"paddingRight",get:function get(){return this[l]("paddingRight");},set:function set(y){this[c]("paddingRight",Object(n.toNumber)(y));}},{key:"paddingBottom",get:function get(){return this[l]("paddingBottom");},set:function set(y){this[c]("paddingBottom",Object(n.toNumber)(y));}},{key:"paddingLeft",get:function get(){return this[l]("paddingLeft");},set:function set(y){this[c]("paddingLeft",Object(n.toNumber)(y));}},{key:"padding",get:function get(){return[this.paddingTop,this.paddingRight,this.paddingBottom,this.paddingLeft];},set:function set(y){y=Object(n.toArray)(y),Array.isArray(y)?y.length===2?y=[y[0],y[1],y[0],y[1]]:y.length===3&&(y=[y[0],y[1],y[2],y[1]]):y=[y,y,y,y],this.paddingTop=y[0],this.paddingRight=y[1],this.paddingBottom=y[2],this.paddingLeft=y[3];}},{key:"clipPath",get:function get(){return this[l]("clipPath");},set:function set(y){this[c]("clipPath",y);}},{key:"boxSizing",get:function get(){return this[l]("boxSizing");},set:function set(y){if(y!=null&&y!=="border-box"&&y!=="content-box")throw new TypeError("Invalid boxSizing type.");this[c]("boxSizing",y);}}]);}(r["default"]);},/* 221 *//***/function(i,e,t){t.r(e),t.d(e,"Gradient",function(){return s;}),t.d(e,"isTransparent",function(){return c;}),t.d(e,"parseColor",function(){return l;}),t.d(e,"setFillColor",function(){return u;}),t.d(e,"setStrokeColor",function(){return v;}),t.d(e,"Color",function(){return h;});var r=t(32),n=/* @__PURE__ */t.n(r);t(1).glMatrix.setMatrixArrayType(Array);var s=/*#__PURE__*/function(){function s(_ref133){var T=_ref133.vector,O=_ref133.colors;_classCallCheck(this,s);if(!Array.isArray(T)||T.length!==4&&T.length!==6&&T.length!==3)throw new TypeError("Invalid gradient");this.vector=T,this.colors=O.map(function(_ref134){var I=_ref134.offset,P=_ref134.color;return{offset:I,color:l(P)};});}return _createClass(s,[{key:"toString",value:function toString(){return JSON.stringify({vector:this.vector,colors:this.colors});}}]);}();function c(y){return y instanceof s?!1:y==null?!0:n()(y)[3]===0;}function l(y){if(y==null||(y||(y="transparent"),y instanceof s))return y;var T=n()(y);if(!T||!T.length)throw new TypeError("Invalid color value.");return"rgba(".concat(T.join(),")");}function f(y,T,O){var I=y.boundingBox[0];if(O.vector){var P=O.vector,_w16=O.colors;P.length===4?(P=[P[0]+I[0],P[1]+I[1],P[2]+I[0],P[3]+I[1]],y.setLinearGradient({vector:P,colors:_w16,type:T})):P.length===3?(P=[P[0]+I[0],P[1]+I[1],P[2]],y.setCircularGradient({vector:P,colors:_w16,type:T})):(P=[P[0]+I[0],P[1]+I[1],P[2],P[3]+I[0],P[4]+I[1],P[5]],y.setRadialGradient({vector:P,colors:_w16,type:T}));}else y.gradient&&y.gradient[T]&&(delete y.gradient[T],delete y.uniforms.u_radialGradientVector);}function u(y,_ref135){var T=_ref135.color,_ref135$rule=_ref135.rule,O=_ref135$rule===void 0?"nonzero":_ref135$rule;return f(y,"fill",T),T.vector||y.setFill({color:T,rule:O}),y;}function v(y,_ref136){var T=_ref136.color,O=_ref136.lineWidth,I=_ref136.lineCap,P=_ref136.lineJoin,w=_ref136.lineDash,d=_ref136.lineDashOffset,m=_ref136.miterLimit,p=_ref136.roundSegments;f(y,"stroke",T),T.vector&&(T=[0,0,0,1]),y.setStroke({color:T,thickness:O,cap:I,join:P,miterLimit:m,lineDash:w,lineDashOffset:d,roundSegments:p});}var h=/*#__PURE__*/function(_Array){function h(){var _T7,_T8,_n2,_n3;var _this16;var T=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var O=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var I=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var P=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;_classCallCheck(this,h);return _possibleConstructorReturn(_this16,(Array.isArray(T)&&(_T7=T,_T8=_slicedToArray(_T7,4),T=_T8[0],O=_T8[1],I=_T8[2],P=_T8[3],_T7),typeof T=="string"&&(_n2=n()(T),_n3=_slicedToArray(_n2,4),T=_n3[0],O=_n3[1],I=_n3[2],P=_n3[3],T/=255,O/=255,I/=255),_this16=_callSuper(this,h,[T,O,I,P]),_assertThisInitialized(_this16)));}_inherits(h,_Array);return _createClass(h,[{key:"r",get:function get(){return Math.round(this[0]*255);},set:function set(T){this[0]=T/255;}},{key:"g",get:function get(){return Math.round(this[1]*255);},set:function set(T){this[1]=T/255;}},{key:"b",get:function get(){return Math.round(this[2]*255);},set:function set(T){this[2]=T/255;}},{key:"a",get:function get(){return this[3];},set:function set(T){this[3]=T;}},{key:"hex",get:function get(){var T="0".concat(this.r.toString(16)).slice(-2),O="0".concat(this.g.toString(16)).slice(-2),I="0".concat(this.b.toString(16)).slice(-2);var P;return this.a<1&&(P=Math.round(this[3]*255),P="0".concat(P.toString(16)).slice(-2)),"#".concat(T).concat(O).concat(I).concat(P||"");}},{key:"rgba",get:function get(){return"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.a,")");}},{key:"fromColor",value:function fromColor(T){return typeof T=="string"&&(T=n()(T),T[0]/=255,T[1]/=255,T[2]/=255),this[0]=T[0],this[1]=T[1],this[2]=T[2],this[3]=T[3],this;}}]);}(/*#__PURE__*/_wrapNativeSuper(Array));},/* 222 *//***/function(i,e,t){t.r(e),t.d(e,"createRadiusBox",function(){return n;}),t(1).glMatrix.setMatrixArrayType(Array);function r(s,c,l,f,u){var v=arguments.length>5&&arguments[5]!==undefined?arguments[5]:"leftTop";var h=0.5522848,y=f/2*h,T=u/2*h,O=c+f,I=l+u,P=c+f/2,w=l+u/2;v==="leftTop"?(s.moveTo(c,w),s.bezierCurveTo(c,w-T,P-y,l,P,l)):v==="rightTop"?s.bezierCurveTo(P+y,l,O,w-T,O,w):v==="rightBottom"?s.bezierCurveTo(O,w+T,P+y,I,P,I):v==="leftBottom"&&s.bezierCurveTo(P-y,I,c,w+T,c,w);}function n(s,_ref137,v){var _ref138=_slicedToArray(_ref137,4),c=_ref138[0],l=_ref138[1],f=_ref138[2],u=_ref138[3];if(!v||Array.isArray(v)&&v.every(function(h){return h===0;}))s.beginPath(),s.rect(c,l,f,u);else{typeof v=="number"&&(v=Array(8).fill(v));var _v$map=v.map(function(m,p){return p%2?Math.min(m,u/2):Math.min(m,f/2);}),_v$map2=_slicedToArray(_v$map,8),h=_v$map2[0],y=_v$map2[1],T=_v$map2[2],O=_v$map2[3],I=_v$map2[4],P=_v$map2[5],_w17=_v$map2[6],_d14=_v$map2[7];s.beginPath(),s.moveTo(c,l+y),r(s,c,l,h*2,y*2,"leftTop"),s.lineTo(c+f-T,l),r(s,c+f-T*2,l,T*2,O*2,"rightTop"),s.lineTo(c+f,l+u-P),r(s,c+f-I*2,l+u-P*2,I*2,P*2,"rightBottom"),s.lineTo(c+_w17,l+u),r(s,c,l+u-_d14*2,_w17*2,_d14*2,"leftBottom"),s.closePath();}return s;}},/* 223 *//***/function(i,e,t){t.r(e),t(1).glMatrix.setMatrixArrayType(Array),e["default"]=function(r,n){if(!r)return{x:0,y:0,width:0,height:0,left:0,top:0,right:0,bottom:0};var _r2=_slicedToArray(r,2),_r2$=_slicedToArray(_r2[0],2),s=_r2$[0],c=_r2$[1],_r2$2=_slicedToArray(_r2[1],2),l=_r2$2[0],f=_r2$2[1],u=s*n[0]+c*n[2]+n[4],v=s*n[1]+c*n[3]+n[5],h=l*n[0]+c*n[2]+n[4],y=l*n[1]+c*n[3]+n[5],T=l*n[0]+f*n[2]+n[4],O=l*n[1]+f*n[3]+n[5],I=s*n[0]+f*n[2]+n[4],P=s*n[1]+f*n[3]+n[5],w=Math.min(u,h,T,I),d=Math.min(v,y,O,P),m=Math.max(u,h,T,I),p=Math.max(v,y,O,P);return{x:w,y:d,width:m-w,height:p-d,left:w,top:d,right:m,bottom:p};};},/* 224 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return u;});var r=t(218),n=t(219),s=t(225),c=t(213);t(1).glMatrix.setMatrixArrayType(Array);function l(v,h,y){return h in v?Object.defineProperty(v,h,{value:y,enumerable:!0,configurable:!0,writable:!0}):v[h]=y,v;}var f=Symbol("textureTask");var u=/*#__PURE__*/function(_n$default){function u(){var _this17;var h=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,u);typeof h=="string"&&(h={texture:h}),_this17=_callSuper(this,u,[h]);return _this17;}/* override */_inherits(u,_n$default);return _createClass(u,[{key:"contentSize",get:function get(){var _superPropGet2=_superPropGet(u,"contentSize",this,1),_superPropGet3=_slicedToArray(_superPropGet2,2),h=_superPropGet3[0],y=_superPropGet3[1];var _this$attributes9=this.attributes,T=_this$attributes9.width,O=_this$attributes9.height;if(T==null||O==null){var I=this.textureImage,P=this.attributes.textureRect,_w18=this.attributes.sourceRect;if(P)T==null&&(h=P[0]+P[2]),O==null&&(y=P[1]+P[3]);else if(_w18){var _d15=this.layer?this.layer.displayRatio:1;T==null&&(h=_w18[2]/_d15),O==null&&(y=_w18[3]/_d15);}else if(I){var _d16=this.layer?this.layer.displayRatio:1;T==null&&(h=I.width/_d16),O==null&&(y=I.height/_d16);}}return[h,y];}},{key:"textureImageReady",get:function get(){return this[f]||Promise.resolve();}/* override */},{key:"draw",value:function draw(){var h=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];_superPropGet(u,"draw",this,3)([h]);var y=this.mesh;return y&&Object(r.drawTexture)(this,y),h;}/* override */},{key:"onPropertyChange",value:function onPropertyChange(h,y,T){if(_superPropGet(u,"onPropertyChange",this,3)([h,y,T]),h==="texture"&&(this[f]=Object(r.applyTexture)(this,y,!0)),h==="textureRect"){var _this$attributes0=this.attributes,O=_this$attributes0.width,I=_this$attributes0.height;(O==null||I==null)&&this.updateContours();}}}]);}(n["default"]);l(u,"Attr",s["default"]),c["default"].registerNode(u,"sprite");},/* 225 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return l;});var r=t(220);t(1).glMatrix.setMatrixArrayType(Array);var n=Symbol["for"]("spritejs_setAttributeDefault"),s=Symbol["for"]("spritejs_setAttribute"),c=Symbol["for"]("spritejs_getAttribute");var l=/*#__PURE__*/function(_r$default2){function l(u){var _this18;_classCallCheck(this,l);_this18=_callSuper(this,l,[u]),_this18[n]({texture:void 0,textureRect:void 0,textureRepeat:!1,sourceRect:void 0});return _this18;}_inherits(l,_r$default2);return _createClass(l,[{key:"texture",get:function get(){return this[c]("texture");},set:function set(u){this[s]("texture",u);}},{key:"textureRect",get:function get(){return this[c]("textureRect");},set:function set(u){this[s]("textureRect",u);}},{key:"sourceRect",get:function get(){return this[c]("sourceRect");},set:function set(u){this[s]("sourceRect",u);}},{key:"textureRepeat",get:function get(){return this[c]("textureRepeat");},set:function set(u){this[s]("textureRepeat",!!u);}}]);}(r["default"]);},/* 226 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return O;});var r=t(12),n=t(227),s=/* @__PURE__ */t.n(n),c=t(70),l=t(228),f=t(221),u=t(218),v=t(213),h=t(223);t(1).glMatrix.setMatrixArrayType(Array);function y(I,P,w){return P in I?Object.defineProperty(I,P,{value:w,enumerable:!0,configurable:!0,writable:!0}):I[P]=w,I;}var T=Symbol("mesh");var O=/*#__PURE__*/function(_c$default){function O(){var _this19;var P=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,O);typeof P=="string"&&(P={d:P}),_this19=_callSuper(this,O,[P]),_this19.effects={d:function(_d17){function d(_x12,_x13,_x14,_x15,_x16){return _d17.apply(this,arguments);}d.toString=function(){return _d17.toString();};return d;}(function(w,d,m,p,S){var _s$a;var E=(m-p)/(S-p);if(E<=0)return w;if(E>=1)return d;var R=s.a._preprocessing(s.a.path2shapes(w),s.a.path2shapes(d)),D=(_s$a=s.a)._lerp.apply(_s$a,_toConsumableArray(R).concat([E]))[0];return D.reduce(function(M,W){return"".concat(M).concat(W.slice(2).join(" ")," ");},"M".concat(D[0][0]," ").concat(D[0][1],"C")).trim();})};return _this19;}/* override */_inherits(O,_c$default);return _createClass(O,[{key:"isVisible",get:function get(){return!!this.d;}},{key:"mesh",get:function get(){if(this.attributes.display==="none")return null;var P=this.path;if(P){var _w20;var _w19=this[T];if(_w19)_w19.path!==P&&(_w19.contours=P.contours,_w19.path=P);else{_w19=new r.Mesh2D(this.path),_w19.path=P;var m=this.attributes.fillColor,p=this.attributes.fillRule;m&&Object(f.setFillColor)(_w19,{color:m,rule:p});var S=this.attributes.lineWidth,E=this.attributes.strokeColor;if(E&&S>0){var _this$attributes1=this.attributes,D=_this$attributes1.lineCap,U=_this$attributes1.lineJoin,M=_this$attributes1.miterLimit,W=_this$attributes1.lineDash,$=_this$attributes1.lineDashOffset,B=_this$attributes1.roundSegments;Object(f.setStrokeColor)(_w19,{color:E,lineWidth:S,lineCap:D,lineJoin:U,miterLimit:M,lineDash:W,lineDashOffset:$,roundSegments:B});}this[T]=_w19;var R=this.attributes.clipPath;R&&this[T].setClipPath(R);}var _d18=this.opacity;return _w19.getOpacity()!==_d18&&_w19.setOpacity(_d18),(_w20=_w19).setTransform.apply(_w20,_toConsumableArray(this.renderMatrix)),_w19;}return null;}},{key:"originalContentRect",get:function get(){if(this.path){var P=this.path.boundingBox;return[P[0][0],P[0][1],P[1][0]-P[0][0],P[1][1]-P[0][1]];}return[0,0,0,0];}},{key:"originalClientRect",get:function get(){if(this.mesh){var P=this.mesh.boundingBox;return[P[0][0],P[0][1],P[1][0]-P[0][0],P[1][1]-P[0][1]];}return[0,0,0,0];}},{key:"originalClientCenter",get:function get(){return this.mesh?this.mesh.boundingCenter:[0,0];}},{key:"d",get:function get(){return this.attributes.d;}/* override */,set:function set(P){this.attributes.d=P;}},{key:"draw",value:function draw(){var P=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];_superPropGet(O,"draw",this,3)([P]);var w=this.mesh;return w&&Object(u.drawTexture)(this,w),P;}},{key:"getBoundingClientRect",value:function getBoundingClientRect(){var P=null;return this.mesh&&(P=this.mesh.boundingBox),Object(h["default"])(P,this.renderMatrix);}},{key:"getPathLength",value:function getPathLength(){return this.mesh?this.mesh.getTotalLength():0;}},{key:"getPointAtLength",value:function getPointAtLength(P){if(this.mesh){var _w21=this.mesh.getPointAtLength(P);if(_w21)return[_w21.x,_w21.y];}return[0,0];}/* override */},{key:"onPropertyChange",value:function onPropertyChange(P,w,d){if(_superPropGet(O,"onPropertyChange",this,3)([P,w,d]),(P==="d"||P==="normalize")&&this.updateContours(),this[T]&&(P==="fillColor"||P==="fillRule")){var _this$attributes10=this.attributes,m=_this$attributes10.fillColor,p=_this$attributes10.fillRule;Object(f.setFillColor)(this[T],{color:m,rule:p});}if(this[T]&&(P==="strokeColor"||P==="lineWidth"||P==="lineCap"||P==="lineJoin"||P==="lineDash"||P==="lineDashOffset"||P==="roundSegments")){var _this$attributes11=this.attributes,_m4=_this$attributes11.strokeColor,_p9=_this$attributes11.lineWidth;if(_m4&&_p9>0){var _this$attributes12=this.attributes,S=_this$attributes12.lineCap,E=_this$attributes12.lineJoin,R=_this$attributes12.lineDash,D=_this$attributes12.lineDashOffset,U=_this$attributes12.miterLimit,M=_this$attributes12.roundSegments;Object(f.setStrokeColor)(this[T],{color:_m4,lineCap:S,lineJoin:E,lineWidth:_p9,lineDash:R,lineDashOffset:D,miterLimit:U,roundSegments:M});}}this[T]&&P==="clipPath"&&this[T].setClipPath(w),P==="texture"&&Object(u.applyTexture)(this,w);}/* override */},{key:"updateContours",value:function updateContours(){var _this$path;this.path=new r.Figure2D(),this.path.addPath(this.attributes.d),this.attributes.normalize&&(_this$path=this.path).normalize.apply(_this$path,_toConsumableArray(this.path.boundingCenter));}}]);}(c["default"]);y(O,"Attr",l["default"]),v["default"].registerNode(O,"path");},/* 227 *//***/function(i,e,t){(function(r,n){i.exports=n();})(this,function(){var r=/* @__PURE__ */function(){function W($,B){var N=[],z=!0,J=!1,et=void 0;try{for(var at=$[Symbol.iterator](),ct;!(z=(ct=at.next()).done)&&(N.push(ct.value),!(B&&N.length===B));z=!0);}catch(V){J=!0,et=V;}finally{try{!z&&at["return"]&&at["return"]();}finally{if(J)throw et;}}return N;}return function($,B){if(Array.isArray($))return $;if(Symbol.iterator in Object($))return W($,B);throw new TypeError("Invalid attempt to destructure non-iterable instance");};}(),n=Math.PI*2,s=function s($,B,N,z,J,et,at){var ct=$.x,V=$.y;ct*=B,V*=N;var Q=z*ct-J*V,ft=J*ct+z*V;return{x:Q+et,y:ft+at};},c=function c($,B){var N=1.3333333333333333*Math.tan(B/4),z=Math.cos($),J=Math.sin($),et=Math.cos($+B),at=Math.sin($+B);return[{x:z-J*N,y:J+z*N},{x:et+at*N,y:at-et*N},{x:et,y:at}];},l=function l($,B,N,z){var J=$*z-B*N<0?-1:1,et=Math.sqrt($*$+B*B),at=Math.sqrt($*$+B*B),ct=$*N+B*z,V=ct/(et*at);return V>1&&(V=1),V<-1&&(V=-1),J*Math.acos(V);},f=function f($,B,N,z,J,et,at,ct,V,Q,ft,mt){var yt=Math.pow(J,2),At=Math.pow(et,2),ht=Math.pow(ft,2),Nt=Math.pow(mt,2),Bt=yt*At-yt*Nt-At*ht;Bt<0&&(Bt=0),Bt/=yt*Nt+At*ht,Bt=Math.sqrt(Bt)*(at===ct?-1:1);var G=Bt*J/et*mt,k=Bt*-et/J*ft,rt=Q*G-V*k+($+N)/2,nt=V*G+Q*k+(B+z)/2,Y=(ft-G)/J,Z=(mt-k)/et,C=(-ft-G)/J,L=(-mt-k)/et,X=l(1,0,Y,Z),K=l(Y,Z,C,L);return ct===0&&K>0&&(K-=n),ct===1&&K<0&&(K+=n),[rt,nt,X,K];},u=function u($){var B=$.px,N=$.py,z=$.cx,J=$.cy,et=$.rx,at=$.ry,ct=$.xAxisRotation,V=ct===void 0?0:ct,Q=$.largeArcFlag,ft=Q===void 0?0:Q,mt=$.sweepFlag,yt=mt===void 0?0:mt,At=[];if(et===0||at===0)return[];var ht=Math.sin(V*n/360),Nt=Math.cos(V*n/360),Bt=Nt*(B-z)/2+ht*(N-J)/2,G=-ht*(B-z)/2+Nt*(N-J)/2;if(Bt===0&&G===0)return[];et=Math.abs(et),at=Math.abs(at);var k=Math.pow(Bt,2)/Math.pow(et,2)+Math.pow(G,2)/Math.pow(at,2);k>1&&(et*=Math.sqrt(k),at*=Math.sqrt(k));var rt=f(B,N,z,J,et,at,ft,yt,ht,Nt,Bt,G),nt=r(rt,4),Y=nt[0],Z=nt[1],C=nt[2],L=nt[3],X=Math.max(Math.ceil(Math.abs(L)/(n/4)),1);L/=X;for(var K=0;K<X;K++)At.push(c(C,L)),C+=L;return At.map(function(q){var it=s(q[0],et,at,Nt,ht,Y,Z),ut=it.x,St=it.y,Ct=s(q[1],et,at,Nt,ht,Y,Z),Et=Ct.x,bt=Ct.y,wt=s(q[2],et,at,Nt,ht,Y,Z),Ot=wt.x,Lt=wt.y;return{x1:ut,y1:St,x2:Et,y2:bt,x:Ot,y:Lt};});},v={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0/**
|
|
286
|
+
* segment pattern
|
|
287
|
+
* @type {RegExp}
|
|
288
|
+
*/},h=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function y(W){var $=[];return W.replace(h,function(B,N,z){var J=N.toLowerCase();for(z=O(z),J=="m"&&z.length>2&&($.push([N].concat(z.splice(0,2))),J="l",N=N=="m"?"l":"L");;){if(z.length==v[J])return z.unshift(N),$.push(z);if(z.length<v[J])throw new Error("malformed path data");$.push([N].concat(z.splice(0,v[J])));}}),$;}var T=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function O(W){var $=W.match(T);return $?$.map(Number):[];}function I(W){var $=W[0][0],B=W[0][1],N=$,z=B;return W.forEach(function(J){var et=J[0],at=J[2],ct=J[4],V=J[6],Q=J[1],ft=J[3],mt=J[5],yt=J[7];$=Math.min($,et,at,ct,V),B=Math.min(B,Q,ft,mt,yt),N=Math.max(N,et,at,ct,V),z=Math.max(z,Q,ft,mt,yt);}),[$,B,N,z];}function P(W,$){return Math.sqrt(Math.pow(W[0]-$[0],2)+Math.pow(W[1]-$[1],2))+Math.sqrt(Math.pow(W[2]-$[2],2)+Math.pow(W[3]-$[3],2));}function w(W,$){var B=W[0],N=W[2],z=W[4],J=W[6],et=W[1],at=W[3],ct=W[5],V=W[7],Q=$[0],ft=$[2],mt=$[4],yt=$[6],At=$[1],ht=$[3],Nt=$[5],Bt=$[7];return Math.sqrt(Math.pow(Q-B,2)+Math.pow(At-et,2))+Math.sqrt(Math.pow(ft-N,2)+Math.pow(ht-at,2))+Math.sqrt(Math.pow(mt-z,2)+Math.pow(Nt-ct,2))+Math.sqrt(Math.pow(yt-J,2)+Math.pow(Bt-V,2));}function d(W,$){var B=p(W.length),N=[];B.forEach(function(J){var et=0,at=0;J.forEach(function(ct){et+=w(W[ct],$[at++]);}),N.push({index:J,distance:et});}),N.sort(function(J,et){return J.distance-et.distance;});var z=[];return N[0].index.forEach(function(J){z.push(W[J]);}),z;}function m(W,$){var B=S(W.length),N=[];B.forEach(function(J){var et=0;J.forEach(function(at){et+=P(I(W[at]),I($[at]));}),N.push({index:J,distance:et});}),N.sort(function(J,et){return J.distance-et.distance;});var z=[];return N[0].index.forEach(function(J){z.push(W[J]);}),z;}function p(W){for(var $=[],B=0;B<W;B++){for(var N=[],z=0;z<W;z++){var J=z+B;J>W-1&&(J-=W),N[J]=z;}$.push(N);}return $;}function S(W){for(var $=[],B=0;B<W;B++)$.push(B);return E($);}function E(W){var $=[],B=[];function N(z){var J,et;for(J=0;J<z.length;J++)et=z.splice(J,1)[0],B.push(et),z.length==0&&$.push(B.slice()),N(z),z.splice(J,0,et),B.pop();return $;}return N(W);}var R={};R.parser=y,R.lerpCurve=function(W,$,B){return R.lerpPoints(W[0],W[1],$[0],$[1],B).concat(R.lerpPoints(W[2],W[3],$[2],$[3],B)).concat(R.lerpPoints(W[4],W[5],$[4],$[5],B)).concat(R.lerpPoints(W[6],W[7],$[6],$[7],B));},R.lerpPoints=function(W,$,B,N,z){return[W+(B-W)*z,$+(N-$)*z];},R.q2b=function(W,$,B,N,z,J){return[W,$,(W+2*B)/3,($+2*N)/3,(z+2*B)/3,(J+2*N)/3,z,J];},R.path2shapes=function(W){for(var $=R.parser(W),B=0,N=0,z=0,J=$.length,et=[],at=null,ct=void 0,V=void 0,Q=void 0,ft=void 0,mt=void 0,yt=void 0,At=void 0;z<J;z++){var ht=$[z],Nt=ht[0],Bt=$[z-1];switch(Nt){case"m":mt=et.length,et[mt]=[],at=et[mt],B=B+ht[1],N=N+ht[2];break;case"M":mt=et.length,et[mt]=[],at=et[mt],B=ht[1],N=ht[2];break;case"l":at.push([B,N,B,N,B,N,B+ht[1],N+ht[2]]),B+=ht[1],N+=ht[2];break;case"L":at.push([B,N,ht[1],ht[2],ht[1],ht[2],ht[1],ht[2]]),B=ht[1],N=ht[2];break;case"h":at.push([B,N,B,N,B,N,B+ht[1],N]),B+=ht[1];break;case"H":at.push([B,N,ht[1],N,ht[1],N,ht[1],N]),B=ht[1];break;case"v":at.push([B,N,B,N,B,N,B,N+ht[1]]),N+=ht[1];break;case"V":at.push([B,N,B,ht[1],B,ht[1],B,ht[1]]),N=ht[1];break;case"C":at.push([B,N,ht[1],ht[2],ht[3],ht[4],ht[5],ht[6]]),B=ht[5],N=ht[6];break;case"S":Bt[0]==="C"||Bt[0]==="c"?at.push([B,N,B+Bt[5]-Bt[3],N+Bt[6]-Bt[4],ht[1],ht[2],ht[3],ht[4]]):(Bt[0]==="S"||Bt[0]==="s")&&at.push([B,N,B+Bt[3]-Bt[1],N+Bt[4]-Bt[2],ht[1],ht[2],ht[3],ht[4]]),B=ht[3],N=ht[4];break;case"c":at.push([B,N,B+ht[1],N+ht[2],B+ht[3],N+ht[4],B+ht[5],N+ht[6]]),B=B+ht[5],N=N+ht[6];break;case"s":Bt[0]==="C"||Bt[0]==="c"?at.push([B,N,B+Bt[5]-Bt[3],N+Bt[6]-Bt[4],B+ht[1],N+ht[2],B+ht[3],N+ht[4]]):(Bt[0]==="S"||Bt[0]==="s")&&at.push([B,N,B+Bt[3]-Bt[1],N+Bt[4]-Bt[2],B+ht[1],N+ht[2],B+ht[3],N+ht[4]]),B=B+ht[3],N=N+ht[4];break;case"a":yt=u({rx:ht[1],ry:ht[2],px:B,py:N,xAxisRotation:ht[3],largeArcFlag:ht[4],sweepFlag:ht[5],cx:B+ht[6],cy:N+ht[7]}),At=yt[yt.length-1],yt.forEach(function(G,k){k===0?at.push([B,N,G.x1,G.y1,G.x2,G.y2,G.x,G.y]):at.push([yt[k-1].x,yt[k-1].y,G.x1,G.y1,G.x2,G.y2,G.x,G.y]);}),B=At.x,N=At.y;break;case"A":yt=u({rx:ht[1],ry:ht[2],px:B,py:N,xAxisRotation:ht[3],largeArcFlag:ht[4],sweepFlag:ht[5],cx:ht[6],cy:ht[7]}),At=yt[yt.length-1],yt.forEach(function(G,k){k===0?at.push([B,N,G.x1,G.y1,G.x2,G.y2,G.x,G.y]):at.push([yt[k-1].x,yt[k-1].y,G.x1,G.y1,G.x2,G.y2,G.x,G.y]);}),B=At.x,N=At.y;break;case"Q":at.push(R.q2b(B,N,ht[1],ht[2],ht[3],ht[4])),B=ht[3],N=ht[4];break;case"q":at.push(R.q2b(B,N,B+ht[1],N+ht[2],ht[3]+B,ht[4]+N)),B+=ht[3],N+=ht[4];break;case"T":Bt[0]==="Q"||Bt[0]==="q"?(Q=B+Bt[3]-Bt[1],ft=N+Bt[4]-Bt[2],at.push(R.q2b(B,N,Q,ft,ht[1],ht[2]))):(Bt[0]==="T"||Bt[0]==="t")&&(at.push(R.q2b(B,N,B+B-Q,N+N-ft,ht[1],ht[2])),Q=B+B-Q,ft=N+N-ft),B=ht[1],N=ht[2];break;case"t":Bt[0]==="Q"||Bt[0]==="q"?(Q=B+Bt[3]-Bt[1],ft=N+Bt[4]-Bt[2],at.push(R.q2b(B,N,Q,ft,B+ht[1],N+ht[2]))):(Bt[0]==="T"||Bt[0]==="t")&&(at.push(R.q2b(B,N,B+B-Q,N+N-ft,B+ht[1],N+ht[2])),Q=B+B-Q,ft=N+N-ft),B+=ht[1],N+=ht[2];break;case"Z":ct=at[0][0],V=at[0][1],at.push([B,N,ct,V,ct,V,ct,V]);break;case"z":ct=at[0][0],V=at[0][1],at.push([B,N,ct,V,ct,V,ct,V]);break;}}return et;},R._upCurves=function(W,$){for(var B=0,N=0,z=W.length;B<$;B++)W.push(W[N].slice(0)),N++,N>z-1&&(N-=z);};function D(W,$,B,N,z,J,et,at,ct){return{left:U(W,$,B,N,z,J,et,at,ct),right:U(et,at,z,J,B,N,W,$,1-ct,!0)};}function U(W,$,B,N,z,J,et,at,ct,V){var Q=(B-W)*ct+W,ft=(N-$)*ct+$,mt=(z-B)*ct+B,yt=(J-N)*ct+N,At=(et-z)*ct+z,ht=(at-J)*ct+J,Nt=(mt-Q)*ct+Q,Bt=(yt-ft)*ct+ft,G=(At-mt)*ct+mt,k=(ht-yt)*ct+yt,rt=(G-Nt)*ct+Nt,nt=(k-Bt)*ct+Bt;return V?[rt,nt,Nt,Bt,Q,ft,W,$]:[W,$,Q,ft,Nt,Bt,rt,nt];}R._splitCurves=function(W,$){for(var B=0,N=0;B<$;B++){var z=W[N],J=D(z[0],z[1],z[2],z[3],z[4],z[5],z[6],z[7],0.5);W.splice(N,1),W.splice(N,0,J.left,J.right),N+=2,N>=W.length-1&&(N=0);}};function M(W,$){for(var B=function B(J){var et=W[W.length-1],at=[];et.forEach(function(ct){at.push(ct.slice(0));}),W.push(at);},N=0;N<$;N++)B();}return R.lerp=function(W,$,B){return R._lerp(R.path2shapes(W),R.path2shapes($),B);},R.MIM_CURVES_COUNT=100,R._preprocessing=function(W,$){var B=W.length,N=$.length,z=JSON.parse(JSON.stringify(W)),J=JSON.parse(JSON.stringify($));return B>N?M(J,B-N):B<N&&M(z,N-B),z=m(z,J),z.forEach(function(et,at){var ct=et.length,V=J[at].length;ct>V?ct<R.MIM_CURVES_COUNT?(R._splitCurves(et,R.MIM_CURVES_COUNT-ct),R._splitCurves(J[at],R.MIM_CURVES_COUNT-V)):R._splitCurves(J[at],ct-V):ct<V&&(V<R.MIM_CURVES_COUNT?(R._splitCurves(et,R.MIM_CURVES_COUNT-ct),R._splitCurves(J[at],R.MIM_CURVES_COUNT-V)):R._splitCurves(et,V-ct));}),z.forEach(function(et,at){z[at]=d(et,J[at]);}),[z,J];},R._lerp=function(W,$,B){var N=[];return W.forEach(function(z,J){var et=[];z.forEach(function(at,ct){et.push(R.lerpCurve(at,$[J][ct],B));}),N.push(et);}),N;},R.animate=function(W){var $=R.path2shapes(W.from),B=R.path2shapes(W.to),N=R._preprocessing($,B),z=/* @__PURE__ */new Date(),J=W.end||function(){},et=W.progress||function(){},at=W.begin||function(){},ct=W.easing||function(yt){return yt;},V=null,Q=null,ft=W.time;at($);var mt=function yt(){var At=/* @__PURE__ */new Date()-z;if(At>=ft){Q=B,et(Q,1),J(Q),cancelAnimationFrame(V);return;}var ht=ct(At/ft);Q=R._lerp(N[0],N[1],ht),et(Q,ht),V=requestAnimationFrame(yt);};mt();},R;});},/* 228 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return u;});var r=t(71),n=t(221),s=t(72);t(1).glMatrix.setMatrixArrayType(Array);var c=Symbol["for"]("spritejs_setAttributeDefault"),l=Symbol["for"]("spritejs_setAttribute"),f=Symbol["for"]("spritejs_getAttribute");var u=/*#__PURE__*/function(_r$default3){function u(h){var _this20;_classCallCheck(this,u);_this20=_callSuper(this,u,[h]),_this20[c]({d:"",normalize:!1,fillColor:void 0,fillRule:"nonzero",strokeColor:void 0,lineWidth:1,lineJoin:"miter",// 'miter' or 'bevel' or 'round'
|
|
289
|
+
lineCap:"butt",// 'butt' or 'square' or 'round'
|
|
290
|
+
roundSegments:20,// default roundSegment if lineJoin or lineCap is round
|
|
291
|
+
lineDash:void 0,lineDashOffset:0,miterLimit:10,texture:void 0,textureRect:void 0,textureRepeat:!1,sourceRect:void 0,clipPath:void 0});return _this20;}_inherits(u,_r$default3);return _createClass(u,[{key:"d",get:function get(){return this[f]("d");},set:function set(h){this[l]("d",h);}},{key:"normalize",get:function get(){return this[f]("normalize");},set:function set(h){this[l]("normalize",!!h);}},{key:"fillColor",get:function get(){return this[f]("fillColor");},set:function set(h){this[l]("fillColor",Object(n.parseColor)(h));}},{key:"fillRule",get:function get(){return this[f]("fillRule");},set:function set(h){if(h!=null&&h!=="nonzero"&&h!=="evenodd")throw new TypeError("Invalid fill rule.");this[l]("fillRule",h);}},{key:"strokeColor",get:function get(){return this[f]("strokeColor");},set:function set(h){this[l]("strokeColor",Object(n.parseColor)(h));}},{key:"lineWidth",get:function get(){return this[f]("lineWidth");},set:function set(h){this[l]("lineWidth",Object(s.toNumber)(h));}},{key:"lineJoin",get:function get(){return this[f]("lineJoin");},set:function set(h){if(h!=null&&h!=="miter"&&h!=="bevel"&&h!=="round")throw new TypeError("Invalid lineJoin type.");this[l]("lineJoin",h);}},{key:"lineCap",get:function get(){return this[f]("lineCap");},set:function set(h){if(h!=null&&h!=="butt"&&h!=="square"&&h!=="round")throw new TypeError("Invalid lineCap type.");this[l]("lineCap",h);}},{key:"lineDash",get:function get(){return this[f]("lineDash");},set:function set(h){h=Object(s.toArray)(h,!0),h!=null&&!Array.isArray(h)&&(h=[h]),this[l]("lineDash",h?h.map(s.toNumber):null);}},{key:"lineDashOffset",get:function get(){return this[f]("lineDashOffset");},set:function set(h){this[l]("lineDashOffset",Object(s.toNumber)(h));}},{key:"miterLimit",get:function get(){return this[f]("miterLimit");},set:function set(h){this[l]("miterLimit",Object(s.toNumber)(h));}},{key:"roundSegments",get:function get(){return this[f]("roundSegments");},set:function set(h){this[l]("roundSegments",h);}},{key:"texture",get:function get(){return this[f]("texture");},set:function set(h){this[l]("texture",h);}},{key:"textureRect",get:function get(){return this[f]("textureRect");},set:function set(h){this[l]("textureRect",h);}},{key:"sourceRect",get:function get(){return this[f]("sourceRect");},set:function set(h){this[l]("sourceRect",h);}},{key:"textureRepeat",get:function get(){return this[f]("textureRepeat");},set:function set(h){this[l]("textureRepeat",!!h);}},{key:"clipPath",get:function get(){return this[f]("clipPath");},set:function set(h){this[l]("clipPath",h);}}]);}(r["default"]);},/* 229 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return l;});var r=t(226),n=t(213),s=t(230);t(1).glMatrix.setMatrixArrayType(Array);function c(f,u,v){return u in f?Object.defineProperty(f,u,{value:v,enumerable:!0,configurable:!0,writable:!0}):f[u]=v,f;}var l=/*#__PURE__*/function(_r$default4){function l(){_classCallCheck(this,l);return _callSuper(this,l,arguments);}_inherits(l,_r$default4);return _createClass(l,[{key:"isVisible",get:/* override */function get(){var _this$attributes13=this.attributes,u=_this$attributes13.width,v=_this$attributes13.height;return u>0&&v>0&&_superPropGet(l,"isVisible",this,1);}}]);}(r["default"]);c(l,"Attr",s["default"]),n["default"].registerNode(l,"rect");},/* 230 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return v;});var r=t(228),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var s=Symbol["for"]("spritejs_setAttributeDefault"),c=Symbol["for"]("spritejs_setAttribute"),l=Symbol["for"]("spritejs_getAttribute"),f=Symbol["for"]("spritejs_declareAlias");function u(h){var y=h.width,T=h.height;return"M0 0L".concat(y," 0L").concat(y," ").concat(T,"L0 ").concat(T,"Z");}var v=/*#__PURE__*/function(_r$default5){function v(y){var _this21;_classCallCheck(this,v);_this21=_callSuper(this,v,[y]),_this21[s]({width:0,height:0/* size */}),_this21[f]("size");return _this21;}// readonly
|
|
292
|
+
_inherits(v,_r$default5);return _createClass(v,[{key:"d",get:function get(){return this[l]("d");},set:function set(y){}// eslint-disable-line no-empty-function
|
|
293
|
+
},{key:"width",get:function get(){return this[l]("width");},set:function set(y){if(y=Object(n.toNumber)(y),this[c]("width",y)){var T=u(this);this[c]("d",T);}}},{key:"height",get:function get(){return this[l]("height");},set:function set(y){if(y=Object(n.toNumber)(y),this[c]("height",y)){var T=u(this);this[c]("d",T);}}},{key:"size",get:function get(){return[this.width,this.height];},set:function set(y){y=Object(n.toArray)(y),Array.isArray(y)||(y=[y,y]),this.width=y[0],this.height=y[1];}}]);}(r["default"]);},/* 231 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return l;});var r=t(232),n=t(213),s=t(235);t(1).glMatrix.setMatrixArrayType(Array);function c(f,u,v){return u in f?Object.defineProperty(f,u,{value:v,enumerable:!0,configurable:!0,writable:!0}):f[u]=v,f;}var l=/*#__PURE__*/function(_r$default6){function l(){_classCallCheck(this,l);return _callSuper(this,l,arguments);}_inherits(l,_r$default6);return _createClass(l,[{key:"isVisible",get:function get(){var u=this.attributes.sides;return u[0]>0&&u[1]>0&&_superPropGet(l,"isVisible",this,1);}}]);}(r["default"]);c(l,"Attr",s["default"]),n["default"].registerNode(l,"triangle");},/* 232 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return l;});var r=t(226),n=t(213),s=t(233);t(1).glMatrix.setMatrixArrayType(Array);function c(f,u,v){return u in f?Object.defineProperty(f,u,{value:v,enumerable:!0,configurable:!0,writable:!0}):f[u]=v,f;}var l=/*#__PURE__*/function(_r$default7){function l(){_classCallCheck(this,l);return _callSuper(this,l,arguments);}_inherits(l,_r$default7);return _createClass(l,[{key:"isVisible",get:/* override */function get(){var u=this.attributes.points;return u.length>0&&_superPropGet(l,"isVisible",this,1);}}]);}(r["default"]);c(l,"Attr",s["default"]),n["default"].registerNode(l,"polyline");},/* 233 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return h;});var r=t(228),n=t(72),s=t(234);t(1).glMatrix.setMatrixArrayType(Array);var c=Symbol["for"]("spritejs_setAttributeDefault"),l=Symbol["for"]("spritejs_setAttribute"),f=Symbol["for"]("spritejs_getAttribute"),u=Symbol["for"]("spritejs_declareAlias");function v(y){var T=y.points,O=y.smooth,I=y.smoothRange,P=y.close,w=[];for(var m=0;m<T.length;m+=2)w.push([T[m],T[m+1]]);var d="";return O?d=Object(s.makeSmoothCurveLine)(w,I):w.length&&(d="M".concat(w.map(function(m){return m.join(" ");}).join("L"))),d&&P&&(d+="Z"),d;}var h=/*#__PURE__*/function(_r$default8){function h(T){var _this22;_classCallCheck(this,h);_this22=_callSuper(this,h,[T]),_this22[c]({points:[],smooth:!1,smoothRange:[0],closeType:"none"// none | normal
|
|
294
|
+
/* close */}),_this22[u]("close");return _this22;}// readonly
|
|
295
|
+
_inherits(h,_r$default8);return _createClass(h,[{key:"d",get:function get(){return this[f]("d");},set:function set(T){}// eslint-disable-line no-empty-function
|
|
296
|
+
},{key:"close",get:function get(){return this.closeType!=="none";},set:function set(T){T=T?"normal":"none",this.closeType=T;}},{key:"closeType",get:function get(){return this[f]("closeType");},set:function set(T){if(T!=null&&T!=="none"&&T!=="normal")throw new TypeError("Invalid closeType type.");if(this[l]("closeType",T)){var O=v(this);this[l]("d",O);}}},{key:"smooth",get:function get(){return this[f]("smooth");},set:function set(T){if(this[l]("smooth",T)){var O=v(this);this[l]("d",O);}}},{key:"smoothRange",get:function get(){return this[f]("smoothRange");},set:function set(T){if(T&&!Array.isArray(T)&&(T=[T]),this[l]("smoothRange",T)&&this.smooth){var O=v(this);this[l]("d",O);}}},{key:"points",get:function get(){return this[f]("points");},set:function set(T){if(T=Object(n.toArray)(T),Array.isArray(T)&&(T=T.reduce(function(O,I){return Array.isArray(I)?[].concat(_toConsumableArray(O),_toConsumableArray(I.map(function(P){return Object(n.toNumber)(P);}))):[].concat(_toConsumableArray(O),[Object(n.toNumber)(I)]);},[])),this[l]("points",T)){var O=v(this);this[l]("d",O);}}}]);}(r["default"]);},/* 234 *//***/function(i,e,t){t.r(e),t.d(e,"makeSmoothCurveLine",function(){return r;}),t(1).glMatrix.setMatrixArrayType(Array);function r(n){var s=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[0];function c(u){var v=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.168;var h=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0.168;var y,T,O,I;if((n[u].x===n[u+1].x||n[u].y===n[u+1].y)&&(v=0,h=0),u<1?(y=n[0].x+(n[1].x-n[0].x)*v,T=n[0].y+(n[1].y-n[0].y)*v):(y=n[u].x+(n[u+1].x-n[u-1].x)*v,T=n[u].y+(n[u+1].y-n[u-1].y)*v),u>n.length-3){var P=n.length-1;O=n[P].x-(n[P].x-n[P-1].x)*h,I=n[P].y-(n[P].y-n[P-1].y)*h;}else O=n[u+1].x-(n[u+2].x-n[u].x)*h,I=n[u+1].y-(n[u+2].y-n[u].y)*h;return[{x:y,y:T},{x:O,y:I}];}n=n.map(function(_ref139){var _ref140=_slicedToArray(_ref139,2),u=_ref140[0],v=_ref140[1];return{x:u,y:v};});var l="",f=0;return n.forEach(function(u,v){if(v===0)l+="M".concat(u.x," ").concat(u.y);else{for(;v>s[f];)f++;if(f%2){var _c3=c(v-1),_c4=_slicedToArray(_c3,2),h=_c4[0],y=_c4[1];l+="C".concat([h.x,h.y,y.x,y.y,u.x,u.y].join(" "));}else l+="L".concat(u.x," ").concat(u.y);}}),l;}},/* 235 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return u;});var r=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var s=Symbol["for"]("spritejs_setAttributeDefault"),c=Symbol["for"]("spritejs_setAttribute"),l=Symbol["for"]("spritejs_getAttribute");function f(v){var _v$sides=_slicedToArray(v.sides,2),h=_v$sides[0],y=_v$sides[1];var T=v.angle%360;return T<0&&(T+=360),T=Math.PI*T/180,[0,0,h,0,y*Math.cos(T),y*Math.sin(T)];}var u=/*#__PURE__*/function(_r$default9){function u(h){var _this23;_classCallCheck(this,u);_this23=_callSuper(this,u,[h]),_this23[s]({sides:[0,0],angle:60,closeType:"normal"});return _this23;}// readonly
|
|
297
|
+
_inherits(u,_r$default9);return _createClass(u,[{key:"points",get:function get(){return _superPropGet(u,"points",this,1);},set:function set(h){}// eslint-disable-line no-empty-function
|
|
298
|
+
},{key:"sides",get:function get(){return this[l]("sides");},set:function set(h){if(h=Object(n.toArray)(h,!0),h!=null&&!Array.isArray(h)&&(h=[h,h]),this[c]("sides",h)){var y=f(this);_superPropSet(u,"points",y,this,1,1);}}},{key:"angle",get:function get(){return this[l]("angle");},set:function set(h){if(h=Object(n.toNumber)(h),this[c]("angle",h)){var y=f(this);_superPropSet(u,"points",y,this,1,1);}}}]);}(r["default"]);},/* 236 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return l;});var r=t(232),n=t(213),s=t(237);t(1).glMatrix.setMatrixArrayType(Array);function c(f,u,v){return u in f?Object.defineProperty(f,u,{value:v,enumerable:!0,configurable:!0,writable:!0}):f[u]=v,f;}var l=/*#__PURE__*/function(_r$default0){function l(){_classCallCheck(this,l);return _callSuper(this,l,arguments);}_inherits(l,_r$default0);return _createClass(l,[{key:"isVisible",get:/* override */function get(){var u=this.attributes.sides;return u[0]>0&&u[1]>0&&_superPropGet(l,"isVisible",this,1);}}]);}(r["default"]);c(l,"Attr",s["default"]),n["default"].registerNode(l,"parallel");},/* 237 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return u;});var r=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var s=Symbol["for"]("spritejs_setAttributeDefault"),c=Symbol["for"]("spritejs_setAttribute"),l=Symbol["for"]("spritejs_getAttribute");function f(v){var _v$sides2=_slicedToArray(v.sides,2),h=_v$sides2[0],y=_v$sides2[1];var T=v.angle%360;T<0&&(T+=360),T=Math.PI*T/180;var O=y*Math.cos(T),I=y*Math.sin(T);return[0,0,h,0,O+h,I,O,I];}var u=/*#__PURE__*/function(_r$default1){function u(h){var _this24;_classCallCheck(this,u);_this24=_callSuper(this,u,[h]),_this24[s]({sides:[0,0],angle:90,closeType:"normal"});return _this24;}// readonly
|
|
299
|
+
_inherits(u,_r$default1);return _createClass(u,[{key:"points",get:function get(){return _superPropGet(u,"points",this,1);},set:function set(h){}// eslint-disable-line no-empty-function
|
|
300
|
+
},{key:"sides",get:function get(){return this[l]("sides");},set:function set(h){if(h=Object(n.toArray)(h,!0),h!=null&&!Array.isArray(h)&&(h=[h,h]),this[c]("sides",h)){var y=f(this);_superPropSet(u,"points",y,this,1,1);}}},{key:"angle",get:function get(){return this[l]("angle");},set:function set(h){if(h=Object(n.toNumber)(h),this[c]("angle",h)){var y=f(this);_superPropSet(u,"points",y,this,1,1);}}}]);}(r["default"]);},/* 238 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return l;});var r=t(232),n=t(213),s=t(239);t(1).glMatrix.setMatrixArrayType(Array);function c(f,u,v){return u in f?Object.defineProperty(f,u,{value:v,enumerable:!0,configurable:!0,writable:!0}):f[u]=v,f;}var l=/*#__PURE__*/function(_r$default10){function l(){_classCallCheck(this,l);return _callSuper(this,l,arguments);}_inherits(l,_r$default10);return _createClass(l);}(r["default"]);c(l,"Attr",s["default"]),n["default"].registerNode(l,"regular");},/* 239 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return u;});var r=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var s=Symbol["for"]("spritejs_setAttributeDefault"),c=Symbol["for"]("spritejs_setAttribute"),l=Symbol["for"]("spritejs_getAttribute");function f(v){var h=v.edges,y=v.radius,T=v.offsetAngle,O=Math.PI*T/180-0.5*Math.PI;if(h<3||y<=0)return[];var I=[];for(var P=0;P<h;P++){var _w22=P*2*Math.PI/h+O,_d19=y*Math.cos(_w22),m=y*Math.sin(_w22);I.push(_d19,m);}return I;}var u=/*#__PURE__*/function(_r$default11){function u(h){var _this25;_classCallCheck(this,u);_this25=_callSuper(this,u,[h]),_this25[s]({edges:3,radius:0,offsetAngle:0,closeType:"normal"});return _this25;}// readonly
|
|
301
|
+
_inherits(u,_r$default11);return _createClass(u,[{key:"points",get:function get(){return _superPropGet(u,"points",this,1);},set:function set(h){}// eslint-disable-line no-empty-function
|
|
302
|
+
},{key:"edges",get:function get(){return this[l]("edges");},set:function set(h){if(h=Object(n.toNumber)(h),this[c]("edges",h)){var y=f(this);_superPropSet(u,"points",y,this,1,1);}}},{key:"radius",get:function get(){return this[l]("radius");},set:function set(h){if(h=Object(n.toNumber)(h),this[c]("radius",h)){var y=f(this);_superPropSet(u,"points",y,this,1,1);}}},{key:"offsetAngle",get:function get(){return this[l]("offsetAngle");},set:function set(h){if(h=Object(n.toNumber)(h),this[c]("offsetAngle",h)){var y=f(this);_superPropSet(u,"points",y,this,1,1);}}}]);}(r["default"]);},/* 240 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return l;});var r=t(232),n=t(213),s=t(241);t(1).glMatrix.setMatrixArrayType(Array);function c(f,u,v){return u in f?Object.defineProperty(f,u,{value:v,enumerable:!0,configurable:!0,writable:!0}):f[u]=v,f;}var l=/*#__PURE__*/function(_r$default12){function l(){_classCallCheck(this,l);return _callSuper(this,l,arguments);}_inherits(l,_r$default12);return _createClass(l);}(r["default"]);c(l,"Attr",s["default"]),n["default"].registerNode(l,"star");},/* 241 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return u;});var r=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var s=Symbol["for"]("spritejs_setAttributeDefault"),c=Symbol["for"]("spritejs_setAttribute"),l=Symbol["for"]("spritejs_getAttribute");function f(v){var h=v.angles,y=v.innerRadius,T=v.outerRadius,O=v.offsetAngle,I=Math.PI*O/180-0.5*Math.PI;if(h<3||y<=0||T<=0)return[];var P=[];for(var _w23=0;_w23<h*2;_w23++){var _d20=_w23*Math.PI/h+I,m=_w23%2?y:T,p=m*Math.cos(_d20),S=m*Math.sin(_d20);P.push(p,S);}return P;}var u=/*#__PURE__*/function(_r$default13){function u(h){var _this26;_classCallCheck(this,u);_this26=_callSuper(this,u,[h]),_this26[s]({angles:5,innerRadius:0,outerRadius:0,/* radius */offsetAngle:0,closeType:"normal"});return _this26;}// readonly
|
|
303
|
+
_inherits(u,_r$default13);return _createClass(u,[{key:"points",get:function get(){return _superPropGet(u,"points",this,1);},set:function set(h){}// eslint-disable-line no-empty-function
|
|
304
|
+
},{key:"angles",get:function get(){return this[l]("angles");},set:function set(h){if(h=Object(n.toNumber)(h),this[c]("angles",h)){var y=f(this);_superPropSet(u,"points",y,this,1,1);}}},{key:"innerRadius",get:function get(){return this[l]("innerRadius");},set:function set(h){if(h=Object(n.toNumber)(h),this[c]("innerRadius",h)){var y=f(this);_superPropSet(u,"points",y,this,1,1);}}},{key:"outerRadius",get:function get(){return this[l]("outerRadius");},set:function set(h){if(h=Object(n.toNumber)(h),this[c]("outerRadius",h)){var y=f(this);_superPropSet(u,"points",y,this,1,1);}}},{key:"radius",get:function get(){return[this.innerRadius,this.outerRadius];},set:function set(h){h=Object(n.toArray)(h,!0),Array.isArray(h)||(h=[h,h]),this.innerRadius=h[0],this.outerRadius=h[1];}},{key:"offsetAngle",get:function get(){return this[l]("offsetAngle");},set:function set(h){if(h=Object(n.toNumber)(h),this[c]("offsetAngle",h)){var y=f(this);_superPropSet(u,"points",y,this,1,1);}}}]);}(r["default"]);},/* 242 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return l;});var r=t(226),n=t(213),s=t(243);t(1).glMatrix.setMatrixArrayType(Array);function c(f,u,v){return u in f?Object.defineProperty(f,u,{value:v,enumerable:!0,configurable:!0,writable:!0}):f[u]=v,f;}var l=/*#__PURE__*/function(_r$default14){function l(){_classCallCheck(this,l);return _callSuper(this,l,arguments);}_inherits(l,_r$default14);return _createClass(l,[{key:"isVisible",get:/* override */function get(){var _this$attributes14=this.attributes,u=_this$attributes14.radiusX,v=_this$attributes14.radiusY,h=_this$attributes14.startAngle,y=_this$attributes14.endAngle;return u>0&&v>0&&h!==y&&_superPropGet(l,"isVisible",this,1);}}]);}(r["default"]);c(l,"Attr",s["default"]),n["default"].registerNode(l,"ellipse");},/* 243 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return h;});var r=t(12),n=t(228),s=t(72);t(1).glMatrix.setMatrixArrayType(Array);var c=Symbol["for"]("spritejs_setAttributeDefault"),l=Symbol["for"]("spritejs_setAttribute"),f=Symbol["for"]("spritejs_getAttribute"),u=Symbol["for"]("spritejs_declareAlias");function v(y){var T=y.radiusX,O=y.radiusY,I=y.startAngle,P=y.endAngle,w=y.direction,d=y.closeType,m=w==="anitclockwise",p=new r.Figure2D();return d==="sector"&&p.moveTo(0,0),p.ellipse(0,0,T,O,0,Math.PI*I/180,Math.PI*P/180,m),d!=="none"&&p.closePath(),p.path.reduce(function(R,D){return R+D.join(" ");},"");}var h=/*#__PURE__*/function(_n$default2){function h(T){var _this27;_classCallCheck(this,h);_this27=_callSuper(this,h,[T]),_this27[c]({radiusX:0,radiusY:0,/* radius */startAngle:0,endAngle:360,/* angle */direction:"clockwise",// clockwise | anticlockwise
|
|
305
|
+
closeType:"none"// none | sector | normal
|
|
306
|
+
}),_this27[u]("radius","angle");return _this27;}// readonly
|
|
307
|
+
_inherits(h,_n$default2);return _createClass(h,[{key:"d",get:function get(){return this[f]("d");},set:function set(T){}// eslint-disable-line no-empty-function
|
|
308
|
+
},{key:"radiusX",get:function get(){return this[f]("radiusX");},set:function set(T){if(T=Object(s.toNumber)(T),this[l]("radiusX",T)){var O=v(this);this[l]("d",O);}}},{key:"radiusY",get:function get(){return this[f]("radiusY");},set:function set(T){if(T=Object(s.toNumber)(T),this[l]("radiusY",T)){var O=v(this);this[l]("d",O);}}},{key:"radius",get:function get(){return[this.radiusX,this.radiusY];},set:function set(T){T=Object(s.toArray)(T,!0),Array.isArray(T)||(T=[T,T]),this.radiusX=T[0],this.radiusY=T[1];}},{key:"angle",get:function get(){return[this.startAngle,this.endAngle];},set:function set(T){T=Object(s.toArray)(T),Array.isArray(T)||(T=[T,T]),this.startAngle=T[0],this.endAngle=T[1];}},{key:"direction",get:function get(){return this[f]("direction");},set:function set(T){if(T!=null&&T!=="clockwise"&&T!=="anticlockwise")throw new TypeError("Invalid direction type.");this[l]("direction",T);}},{key:"startAngle",get:function get(){return this[f]("startAngle");},set:function set(T){if(T=Object(s.toNumber)(T),this[l]("startAngle",T)){var O=v(this);this[l]("d",O);}}},{key:"endAngle",get:function get(){return this[f]("endAngle");},set:function set(T){if(T=Object(s.toNumber)(T),this[l]("endAngle",T)){var O=v(this);this[l]("d",O);}}},{key:"closeType",get:function get(){return this[f]("closeType");},set:function set(T){if(T!=null&&T!=="none"&&T!=="sector"&&T!=="normal")throw new TypeError("Invalid closeType type.");if(this[l]("closeType",T)){var O=v(this);this[l]("d",O);}}}]);}(n["default"]);},/* 244 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return l;});var r=t(242),n=t(213),s=t(245);t(1).glMatrix.setMatrixArrayType(Array);function c(f,u,v){return u in f?Object.defineProperty(f,u,{value:v,enumerable:!0,configurable:!0,writable:!0}):f[u]=v,f;}var l=/*#__PURE__*/function(_r$default15){function l(){_classCallCheck(this,l);return _callSuper(this,l,arguments);}_inherits(l,_r$default15);return _createClass(l);}(r["default"]);c(l,"Attr",s["default"]),n["default"].registerNode(l,"arc");},/* 245 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return s;});var r=t(243),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var s=/*#__PURE__*/function(_r$default16){function s(){_classCallCheck(this,s);return _callSuper(this,s,arguments);}_inherits(s,_r$default16);return _createClass(s,[{key:"radius",get:function get(){return _superPropGet(s,"radiusX",this,1);},set:function set(l){l=Object(n.toNumber)(l),_superPropSet(s,"radiusX",l,this,1,1),_superPropSet(s,"radiusY",l,this,1,1);}}]);}(r["default"]);},/* 246 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return l;});var r=t(226),n=t(213),s=t(247);t(1).glMatrix.setMatrixArrayType(Array);function c(f,u,v){return u in f?Object.defineProperty(f,u,{value:v,enumerable:!0,configurable:!0,writable:!0}):f[u]=v,f;}var l=/*#__PURE__*/function(_r$default17){function l(){_classCallCheck(this,l);return _callSuper(this,l,arguments);}_inherits(l,_r$default17);return _createClass(l,[{key:"isVisible",get:/* override */function get(){var _this$attributes15=this.attributes,u=_this$attributes15.innerRadius,v=_this$attributes15.outerRadius,h=_this$attributes15.startAngle,y=_this$attributes15.endAngle;return(u>0||v>0)&&h!==y&&_superPropGet(l,"isVisible",this,1);}}]);}(r["default"]);c(l,"Attr",s["default"]),n["default"].registerNode(l,"ring");},/* 247 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return h;});var r=t(12),n=t(228),s=t(72);t(1).glMatrix.setMatrixArrayType(Array);var c=Symbol["for"]("spritejs_setAttributeDefault"),l=Symbol["for"]("spritejs_setAttribute"),f=Symbol["for"]("spritejs_getAttribute"),u=Symbol["for"]("spritejs_declareAlias");function v(y){var _ref141;var T=y.innerRadius,O=y.outerRadius,I=y.startAngle,P=y.endAngle;var w=new r.Figure2D();if(I=Math.PI*I/180,P=Math.PI*P/180,T>O&&(_ref141=[O,T],T=_ref141[0],O=_ref141[1],_ref141),T<=0&&w.moveTo(0,0),w.arc(0,0,O,I,P,!1),T>0){var p=Math.PI*2;P<I&&(P=I+p+(P-I)%p),P-I>=p&&(P=I+p-1e-6),w.arc(0,0,T,P,I,!0);}return w.closePath(),w.path.reduce(function(p,S){return p+S.join(" ");},"");}var h=/*#__PURE__*/function(_n$default3){function h(T){var _this28;_classCallCheck(this,h);_this28=_callSuper(this,h,[T]),_this28[c]({innerRadius:0,outerRadius:0,/* radius */startAngle:0,endAngle:360/* angle */}),_this28[u]("radius","angle");return _this28;}// readonly
|
|
309
|
+
_inherits(h,_n$default3);return _createClass(h,[{key:"d",get:function get(){return this[f]("d");},set:function set(T){}// eslint-disable-line no-empty-function
|
|
310
|
+
},{key:"innerRadius",get:function get(){return this[f]("innerRadius");},set:function set(T){if(T=Object(s.toNumber)(T),this[l]("innerRadius",T)){var O=v(this);this[l]("d",O);}}},{key:"outerRadius",get:function get(){return this[f]("outerRadius");},set:function set(T){if(T=Object(s.toNumber)(T),this[l]("outerRadius",T)){var O=v(this);this[l]("d",O);}}},{key:"radius",get:function get(){return[this.innerRadius,this.outerRadius];},set:function set(T){T=Object(s.toArray)(T,!0),Array.isArray(T)||(T=[T,T]),this.innerRadius=T[0],this.outerRadius=T[1];}},{key:"startAngle",get:function get(){return this[f]("startAngle");},set:function set(T){if(T=Object(s.toNumber)(T),this[l]("startAngle",T)){var O=v(this);this[l]("d",O);}}},{key:"endAngle",get:function get(){return this[f]("endAngle");},set:function set(T){if(T=Object(s.toNumber)(T),this[l]("endAngle",T)){var O=v(this);this[l]("d",O);}}},{key:"angle",get:function get(){return[this.startAngle,this.endAngle];},set:function set(T){T=Object(s.toArray)(T),Array.isArray(T)||(T=[T,T]),this.startAngle=T[0],this.endAngle=T[1];}}]);}(n["default"]);},/* 248 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return O;});var r=t(12),n=t(218),s=t(219),c=t(249),l=t(213);t(1).glMatrix.setMatrixArrayType(Array);function f(I,P,w){return P in I?Object.defineProperty(I,P,{value:w,enumerable:!0,configurable:!0,writable:!0}):I[P]=w,I;}var u=Symbol("textImage"),v=Symbol("textImageTask"),h=Symbol("textureContext"),y=Symbol("updateTextureRect"),T=Symbol("textCanvas");var O=/*#__PURE__*/function(_s$default3){function O(){var _this29;var P=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,O);typeof P=="string"&&(P={text:P}),_this29=_callSuper(this,O,[P]);return _this29;}/* override */_inherits(O,_s$default3);return _createClass(O,[{key:"contentSize",get:function get(){var _superPropGet4=_superPropGet(O,"contentSize",this,1),_superPropGet5=_slicedToArray(_superPropGet4,2),P=_superPropGet5[0],w=_superPropGet5[1];var _this$attributes16=this.attributes,d=_this$attributes16.width,m=_this$attributes16.height;if(d==null||m==null){var p=this[u];p&&(d==null&&(P=p.rect[2]),m==null&&(w=p.rect[3]));}return[P,w];}},{key:"text",get:function get(){return this.attributes.text;},set:function set(P){this.attributes.text=P;}},{key:"textContent",get:function get(){return this.attributes.text;},set:function set(P){this.attributes.text=P;}},{key:"textImage",get:function get(){return this[u]||{};}},{key:"textImageReady",get:function get(){return this[v]||Promise.resolve();}/* override */},{key:"draw",value:function draw(P){_superPropGet(O,"draw",this,3)([P]);var w=this.mesh;if(w){var _d21=this[u];if(_d21){var m=w.texture;if(!m||this[h]&&this[h]!==this.renderer||_d21.needsUpdate?(_d21.needsUpdate=!1,Object(n.deleteTexture)(_d21.image,this.renderer),m=Object(n.createTexture)(_d21.image,this.renderer),this[y]=!0):m=w.uniforms.u_texSampler,this[y]){var _d21$rect$slice=_d21.rect.slice(2),_d21$rect$slice2=_slicedToArray(_d21$rect$slice,2),p=_d21$rect$slice2[0],S=_d21$rect$slice2[1],_this$contentSize4=_slicedToArray(this.contentSize,2),E=_this$contentSize4[0],R=_this$contentSize4[1],D=this.attributes.textAlign,U=this.attributes.verticalAlign;var M=0;D==="center"?M=(E-p)/2:(D==="right"||D==="end")&&(M=E-p);var W=this.attributes.fontSize,$=this.attributes.lineHeight;var B=0;U==="top"?B=(W-$)/2:U==="bottom"&&(B=($-W)/2);var _this$attributes17=this.attributes,N=_this$attributes17.paddingLeft,z=_this$attributes17.paddingTop,J=this.attributes.borderWidth;M+=N+J,B+=z+J;var _this$attributes18=this.attributes,et=_this$attributes18.anchorX,at=_this$attributes18.anchorY;M-=this.offsetSize[0]*et,B-=this.offsetSize[1]*at,w.setTexture(m,{rect:[M,B,p,S]}),this[y]=!1,this[h]=this.renderer;}}}return P;}/* override */},{key:"onPropertyChange",value:function onPropertyChange(P,w,d){P==="text"||P==="fontSize"||P==="fontFamily"||P==="fontStyle"||P==="fontVariant"||P==="fontWeight"||P==="fontStretch"||P==="lineHeight"||P==="strokeColor"||P==="fillColor"||P==="strokeWidth"?this.updateText():((P==="textAlign"||P==="verticalAlign")&&(this[y]=!0),_superPropGet(O,"onPropertyChange",this,3)([P,w,d]));}/* override */},{key:"updateContours",value:function updateContours(){_superPropGet(O,"updateContours",this,3)([]),this[y]=!0;}},{key:"updateText",value:function updateText(){var _this30=this;this[v]||(this[v]=Promise.resolve().then(function(){_this30[v]=null;var _this30$attributes=_this30.attributes,P=_this30$attributes.text,w=_this30$attributes.font,d=_this30$attributes.fillColor,m=_this30$attributes.strokeColor,p=_this30$attributes.strokeWidth,S=_this30.layer?_this30.layer.displayRatio:1;return _this30[T]=_this30[T]||r.ENV.createCanvas(1,1),_this30[u]=r.ENV.createText(P,{font:w,fillColor:d,strokeColor:m,strokeWidth:p,parseFont:r.parseFont,ratio:S,textCanvas:_this30[T]}),_this30[u].needsUpdate=!0,_this30.updateContours(),_this30.forceUpdate(),_this30[u];}));}}]);}(s["default"]);f(O,"Attr",c["default"]),l["default"].registerNode(O,"label");},/* 249 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return h;});var r=t(12),n=t(72),s=t(221),c=t(220);t(1).glMatrix.setMatrixArrayType(Array);var l=Symbol["for"]("spritejs_setAttributeDefault"),f=Symbol["for"]("spritejs_setAttribute"),u=Symbol["for"]("spritejs_getAttribute"),v=Symbol["for"]("spritejs_declareAlias");var h=/*#__PURE__*/function(_c$default2){function h(T){var _this31;_classCallCheck(this,h);_this31=_callSuper(this,h,[T]),_this31[l]({text:"",fontSize:16,fontFamily:"Helvetica,Arial,sans-serif",fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",fontStretch:"normal",lineHeight:"",/* font */textAlign:"left",strokeColor:void 0,strokeWidth:1,fillColor:void 0,verticalAlign:"middle"}),_this31[v]("font");return _this31;}_inherits(h,_c$default2);return _createClass(h,[{key:"text",get:function get(){return this[u]("text")||" ";},set:function set(T){this[f]("text",T);}},{key:"fontSize",get:function get(){return this[u]("fontSize");},set:function set(T){this[f]("fontSize",Object(n.toNumber)(T));}},{key:"fontFamily",get:function get(){return this[u]("fontFamily");},set:function set(T){this[f]("fontFamily",T);}},{key:"fontStyle",get:function get(){return this[u]("fontStyle");},set:function set(T){this[f]("fontStyle",T);}},{key:"fontVariant",get:function get(){return this[u]("fontVariant");},set:function set(T){this[f]("fontVariant",T);}},{key:"fontWeight",get:function get(){return this[u]("fontWeight");},set:function set(T){this[f]("fontWeight",T);}},{key:"fontStretch",get:function get(){return this[u]("fontStretch");},set:function set(T){this[f]("fontStretch",T);}},{key:"lineHeight",get:function get(){return this[u]("lineHeight")||this.fontSize;},set:function set(T){this[f]("lineHeight",Object(n.toNumber)(T));}},{key:"textAlign",get:function get(){return this[u]("textAlign");},set:function set(T){this[f]("textAlign",T);}},{key:"strokeColor",get:function get(){return this[u]("strokeColor");},set:function set(T){this[f]("strokeColor",Object(s.parseColor)(T));}},{key:"strokeWidth",get:function get(){return this[u]("strokeWidth");},set:function set(T){this[f]("strokeWidth",Object(n.toNumber)(T));}},{key:"verticalAlign",get:function get(){return this[u]("verticalAlign");},set:function set(T){this[f]("verticalAlign",T);}},{key:"fillColor",get:function get(){return this[u]("fillColor");},set:function set(T){this[f]("fillColor",Object(s.parseColor)(T));}},{key:"font",get:function get(){var T=this.fontStyle,O=this.fontVariant,I=this.fontWeight,P=this.fontStretch,w=this.fontSize,d=this.lineHeight,m=this.fontFamily;return"".concat(T," ").concat(O," ").concat(I," ").concat(P," ").concat(w,"px/").concat(d,"px ").concat(m);},set:function set(T){if(T==null)this.fontStyle=null,this.fontVariant=null,this.fontWeight=null,this.fontStretch=null,this.fontSize=null,this.lineHeight=null,this.fontFamily=null;else{var O=Object(r.parseFont)(T);this.fontStyle=O.style,this.fontVariant=O.variant,this.fontWeight=O.weight,this.fontStretch=O.stretch,this.fontSize=Object(n.toNumber)("".concat(O.size).concat(O.unit)),O.lineHeight&&(this.lineHeight=O.pxLineHeight),this.fontFamily=O.family;}}}]);}(c["default"]);},/* 250 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return T;});var r=t(12),n=t(219),s=t(251),c=t(213),l=t(252);t(1).glMatrix.setMatrixArrayType(Array);function f(O,I,P){return I in O?Object.defineProperty(O,I,{value:P,enumerable:!0,configurable:!0,writable:!0}):O[I]=P,O;}var u=Symbol("zOrder"),v=Symbol("ordered"),h=Symbol("children"),y=Symbol("sealed");var T=/*#__PURE__*/function(_n$default4){function T(){var _this32;var I=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,T);_this32=_callSuper(this,T,[I]),_this32[h]=[],_this32[v]=null,_this32[u]=0;return _this32;}_inherits(T,_n$default4);return _createClass(T,[{key:"childNodes",get:function get(){return this[h];}},{key:"children",get:function get(){return this[h];}},{key:"orderedChildren",get:function get(){return this[v]||(this[v]=_toConsumableArray(this[h]),this[v].sort(function(I,P){return I.zIndex-P.zIndex||I.zOrder-P.zOrder;})),this[v];}},{key:"append",value:function append(){var _this33=this;for(var _len10=arguments.length,I=new Array(_len10),_key10=0;_key10<_len10;_key10++){I[_key10]=arguments[_key10];}return I.map(function(P){return _this33.appendChild(P);});}},{key:"appendChild",value:function appendChild(I){return I.remove(),this[h].push(I),I.connect(this,this[u]++),this[v]&&(this[v].length&&I.zIndex<this[v][this[v].length-1].zIndex?this.reorder():this[v].push(I)),I;}/* override */// get isVisible() {
|
|
311
|
+
// return this.attributes.opacity > 0 && this[_children].length > 0;
|
|
312
|
+
// }
|
|
313
|
+
/* override */},{key:"cloneNode",value:function cloneNode(){var I=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;var P=_superPropGet(T,"cloneNode",this,3)([]);return I&&this[h].forEach(function(w){var d=w.cloneNode(I);P.appendChild(d);}),P;}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(I){var P=this.orderedChildren;for(var _w24=P.length-1;_w24>=0;_w24--)if(P[_w24].dispatchPointerEvent(I))return!0;return _superPropGet(T,"dispatchPointerEvent",this,3)([I]);}/* override */},{key:"draw",value:function draw(){var I=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];if(this.__cacheRenderMatrix=this.renderMatrix,_superPropGet(T,"draw",this,3)([I]),!this[y]&&this.attributes.display!=="none"){var P=this.orderedChildren;for(var _w25=0;_w25<P.length;_w25++)P[_w25].draw(I);}return this.__cacheRenderMatrix=null,I;}},{key:"getElementById",value:function getElementById(I){return Object(l.querySelector)("#".concat(I),this);}},{key:"getElementsByClassName",value:function getElementsByClassName(I){return Object(l.querySelectorAll)(".".concat(I),this);}},{key:"getElementsByName",value:function getElementsByName(I){return Object(l.querySelectorAll)("[name=\"".concat(I,"\"]"),this);}},{key:"getElementsByTagName",value:function getElementsByTagName(I){return Object(l.querySelectorAll)(I,this);}},{key:"insertBefore",value:function insertBefore(I,P){if(P==null)return this.appendChild(I);I.remove();var w=this[h].indexOf(P);if(w<0)throw new Error("Invalid reference node.");var d=P.zOrder;for(var m=w;m<this[h].length;m++){var p=this[h][m].zOrder,S=this[h][m];delete S.zOrder,Object.defineProperty(S,"zOrder",{value:p+1,writable:!1,configurable:!0});}if(this[h].splice(w,0,I),I.connect(this,d),this[v])if(I.zIndex!==P.zIndex)this.reorder();else{var _m5=this[v].indexOf(P);this[v].splice(_m5,0,I);}return I;}},{key:"querySelector",value:function querySelector(I){return Object(l.querySelector)(I,this);}},{key:"querySelectorAll",value:function querySelectorAll(I){return Object(l.querySelectorAll)(I,this);}},{key:"replaceChild",value:function replaceChild(I,P){I.remove();var w=this[h].indexOf(P);if(w<0)throw new Error("Invalid reference node.");if(this[h][w]=I,I.connect(this,P.zOrder),this[v])if(I.zIndex!==P.zIndex)this.reorder();else{var _d22=this[v].indexOf(P);this[v][_d22]=I;}return P.disconnect(this),I;}},{key:"removeAllChildren",value:function removeAllChildren(){var I=this[h];for(var P=I.length-1;P>=0;P--)I[P].remove();}},{key:"removeChild",value:function removeChild(I){var P=this[h].indexOf(I);if(P>=0){if(this[h].splice(P,1),this[v]){var _w26=this[v].indexOf(I);this[v].splice(_w26,1);}return I.disconnect(this),I;}return null;}},{key:"reorder",value:function reorder(){this[v]=null;}},{key:"seal",value:function seal(){function I(m,p){var S=[];for(var E=0;E<m.length;E++){var R=_toConsumableArray(m[E]);for(var D=1;D<R.length;D+=2){var U=R[D],M=R[D+1];R[D]=U*p[0]+M*p[2]+p[4],R[D+1]=U*p[1]+M*p[3]+p[5];}S.push(R);}return S;}var P=this.orderedChildren,w=new r.Figure2D(),d=this.localMatrix;for(var m=0;m<P.length;m++){var p=P[m];if(p instanceof T&&(p=p.seal()),p.clientBox){var S=p.clientBox.contours.path;S=I(S,p.localMatrix),w.addPath(S);}if(p.path){var _S7=p.path.contours.path;_S7=I(_S7,p.localMatrix),w.addPath(_S7);}}return this[y]=!0,this.clientBox=w,{clientBox:w,localMatrix:d};}/* override */},{key:"setResolution",value:function setResolution(_ref142){var I=_ref142.width,P=_ref142.height;_superPropGet(T,"setResolution",this,3)([{width:I,height:P}]),this[h].forEach(function(w){w.setResolution({width:I,height:P});});}/* override */},{key:"updateContours",value:function updateContours(){this[y]||_superPropGet(T,"updateContours",this,3)([]);}}]);}(n["default"]);f(T,"Attr",s["default"]),c["default"].registerNode(T,"group");},/* 251 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return n;});var r=t(220);t(1).glMatrix.setMatrixArrayType(Array);var n=/*#__PURE__*/function(_r$default18){function n(){_classCallCheck(this,n);return _callSuper(this,n,arguments);}_inherits(n,_r$default18);return _createClass(n);}(r["default"]);},/* 252 *//***/function(i,e,t){t.r(e),t.d(e,"querySelectorAll",function(){return y;}),t.d(e,"querySelector",function(){return T;}),t.d(e,"isMatched",function(){return O;}),t.d(e,"compile",function(){return I;});var r=t(221),n=t(213);t(1).glMatrix.setMatrixArrayType(Array);var s=t(253);function c(P){return P.nodeType===1||n["default"].isSpriteNode(P.nodeName);}function l(P){return Array.from(P.childNodes||[]);}function f(P){return n["default"].isSpriteNode(P.nodeName)?P.parent||P.canvas||P.container:P.parentElement;}function u(P){var w=P.length,d,m,p;for(;--w>-1;){for(d=m=P[w],P[w]=null,p=!0;m;){if(P.indexOf(m)>-1){p=!1,P.splice(w,1);break;}m=f(m);}p&&(P[w]=d);}return P;}var v={isTag:c,existsOne:function existsOne(P,w){return w.some(function(d){return c(d)?P(d)||v.existsOne(P,l(d)):!1;});},getSiblings:function getSiblings(P){var w=f(P);return w&&l(w);},getChildren:l,getParent:f,getAttributeValue:function getAttributeValue(P,w){if(P.nodeType===1&&w==="class"||w==="id")return P[w];if(this.hasAttrib(P,w)){var _d23=P.attributes[w];return Array.isArray(_d23)&&(_d23="[".concat(_d23.join(),"]")),String(_d23);}},hasAttrib:function hasAttrib(P,w){return P.attributes[w]!=null;},removeSubsets:u,getName:function getName(P){return P.tagName?P.tagName.toLowerCase():null;},findOne:function P(w,d){var m=null;for(var p=0,S=d.length;p<S&&!m;p++)if(w(d[p]))m=d[p];else{var E=l(d[p]);E&&E.length>0&&(m=P(w,E));}return m;},findAll:function P(w,d){var m=[];for(var p=0,S=d.length;p<S;p++){if(!c(d[p]))continue;w(d[p])&&m.push(d[p]);var E=l(d[p]);E&&(m=m.concat(P(w,E)));}return m;},getText:function P(w){return Array.isArray(w)?w.map(P).join(""):c(w)?P(l(w)):w.nodeType===3?w.nodeValue:n["default"].isSpriteNode(w.nodeName)?w.text:"";}};function h(P){if(typeof P!="string")return P;var w=P.match(/\[(bgcolor|fillColor|strokeColor|color)\s*=\s*['"]?\w+['"]?\]/g);return w&&(w=w.map(function(d){var m=d.slice(1,-1).split("="),p=Object(r.parseColor)(m[1].replace(/['"]/g,""));return[d,"[".concat(m[0],"=\"").concat(p,"\"]")];}),w.forEach(function(_ref143){var _ref144=_slicedToArray(_ref143,2),d=_ref144[0],m=_ref144[1];P=P.replace(d,m);})),w=P.match(/\[\w+\s*=\s*['"]\[.+?\]['"]\]/g),w&&(w=w.map(function(d){var m=d.slice(1,-1).split("="),p=m[1].slice(2,-2).split(/,/g).map(function(S){return S.trim();});return[d,"[".concat(m[0],"=\"[").concat(p,"]\"]")];}),w.forEach(function(_ref145){var _ref146=_slicedToArray(_ref145,2),d=_ref146[0],m=_ref146[1];P=P.replace(d,m);})),P;}function y(P,w){return s.selectAll(h(P),w,{adapter:v});}function T(P,w){return s.selectOne(h(P),w,{adapter:v});}function O(P,w){return s.is(P,h(w),{adapter:v});}function I(P){return s.compile(h(P),{adapter:v});}},/* 253 *//***/function(i,e,t){i.exports=I;var r=t(254),n=t(273).falseFunc,s=t(274);function c(P){return function(d,m,p){return m=m||{},m.adapter=m.adapter||r,P(d,m,p);};}var l=c(s),f=c(s.compileUnsafe);function u(P){return function(d,m,p){return p=p||{},p.adapter=p.adapter||r,typeof d!="function"&&(d=f(d,p,m)),d.shouldTestNextSiblings&&(m=h(p&&p.context||m,p.adapter)),Array.isArray(m)?m=p.adapter.removeSubsets(m):m=p.adapter.getChildren(m),P(d,m,p);};}function v(P,w){var d=w.getSiblings(P);if(!Array.isArray(d))return[];for(d=d.slice(0);d.shift()!==P;);return d;}function h(P,w){Array.isArray(P)||(P=[P]);for(var d=P.slice(0),m=0,p=P.length;m<p;m++){var S=v(d[m],w);d.push.apply(d,S);}return d;}var y=u(function(w,d,m){return w===n||!d||d.length===0?[]:m.adapter.findAll(w,d);}),T=u(function(w,d,m){return w===n||!d||d.length===0?null:m.adapter.findOne(w,d);});function O(P,w,d){return d=d||{},d.adapter=d.adapter||r,(typeof w=="function"?w:l(w,d))(P);}function I(P,w,d){return y(P,w,d);}I.compile=l,I.filters=s.Pseudos.filters,I.pseudos=s.Pseudos.pseudos,I.selectAll=y,I.selectOne=T,I.is=O,I.parse=l,I.iterate=y,I._compileUnsafe=f,I._compileToken=s.compileToken;},/* 254 *//***/function(i,e,t){var r=i.exports;[t(255),t(268),t(269),t(270),t(271),t(272)].forEach(function(n){Object.keys(n).forEach(function(s){r[s]=n[s].bind(r);});});},/* 255 *//***/function(i,e,t){var r=t(256),n=t(257),s=r.isTag;i.exports={getInnerHTML:c,getOuterHTML:n,getText:l};function c(f,u){return f.children?f.children.map(function(v){return n(v,u);}).join(""):"";}function l(f){return Array.isArray(f)?f.map(l).join(""):s(f)?f.name==="br"?"\n":l(f.children):f.type===r.CDATA?l(f.children):f.type===r.Text?f.data:"";}},/* 256 *//***/function(i,e){i.exports={Text:"text",//Text
|
|
314
|
+
Directive:"directive",//<? ... ?>
|
|
315
|
+
Comment:"comment",//<!-- ... -->
|
|
316
|
+
Script:"script",//<script> tags
|
|
317
|
+
Style:"style",//<style> tags
|
|
318
|
+
Tag:"tag",//Any tag
|
|
319
|
+
CDATA:"cdata",//<![CDATA[ ... ]]>
|
|
320
|
+
Doctype:"doctype",isTag:function isTag(t){return t.type==="tag"||t.type==="script"||t.type==="style";}};},/* 257 *//***/function(i,e,t){var r=t(258),n=t(259),s=t(267);s.elementNames.__proto__=null,s.attributeNames.__proto__=null;var c={__proto__:null,style:!0,script:!0,xmp:!0,iframe:!0,noembed:!0,noframes:!0,plaintext:!0,noscript:!0};function l(P,w){if(P){var d="",m;for(var p in P)m=P[p],d&&(d+=" "),w.xmlMode==="foreign"&&(p=s.attributeNames[p]||p),d+=p,(m!==null&&m!==""||w.xmlMode)&&(d+='="'+(w.decodeEntities?n.encodeXML(m):m.replace(/\"/g,"""))+'"');return d;}}var f={__proto__:null,area:!0,base:!0,basefont:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,isindex:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},u=i.exports=function(P,w){!Array.isArray(P)&&!P.cheerio&&(P=[P]),w=w||{};for(var d="",m=0;m<P.length;m++){var p=P[m];p.type==="root"?d+=u(p.children,w):r.isTag(p)?d+=h(p,w):p.type===r.Directive?d+=y(p):p.type===r.Comment?d+=I(p):p.type===r.CDATA?d+=O(p):d+=T(p,w);}return d;},v=["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"];function h(P,w){w.xmlMode==="foreign"&&(P.name=s.elementNames[P.name]||P.name,P.parent&&v.indexOf(P.parent.name)>=0&&(w=Object.assign({},w,{xmlMode:!1}))),!w.xmlMode&&["svg","math"].indexOf(P.name)>=0&&(w=Object.assign({},w,{xmlMode:"foreign"}));var d="<"+P.name,m=l(P.attribs,w);return m&&(d+=" "+m),w.xmlMode&&(!P.children||P.children.length===0)?d+="/>":(d+=">",P.children&&(d+=u(P.children,w)),(!f[P.name]||w.xmlMode)&&(d+="</"+P.name+">")),d;}function y(P){return"<"+P.data+">";}function T(P,w){var d=P.data||"";return w.decodeEntities&&!(P.parent&&P.parent.name in c)&&(d=n.encodeXML(d)),d;}function O(P){return"<![CDATA["+P.children[0].data+"]]>";}function I(P){return"<!--"+P.data+"-->";}},/* 258 *//***/function(i,e,t){Object.defineProperty(e,"__esModule",{value:!0});function r(n){return n.type==="tag"||n.type==="script"||n.type==="style";}e.isTag=r,e.Text="text",e.Directive="directive",e.Comment="comment",e.Script="script",e.Style="style",e.Tag="tag",e.CDATA="cdata",e.Doctype="doctype";},/* 259 *//***/function(i,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.encode=e.decodeStrict=e.decode=void 0;var r=t(260),n=t(266);function s(v,h){return(!h||h<=0?r.decodeXML:r.decodeHTML)(v);}e.decode=s;function c(v,h){return(!h||h<=0?r.decodeXML:r.decodeHTMLStrict)(v);}e.decodeStrict=c;function l(v,h){return(!h||h<=0?n.encodeXML:n.encodeHTML)(v);}e.encode=l;var f=t(266);Object.defineProperty(e,"encodeXML",{enumerable:!0,get:function get(){return f.encodeXML;}}),Object.defineProperty(e,"encodeHTML",{enumerable:!0,get:function get(){return f.encodeHTML;}}),Object.defineProperty(e,"escape",{enumerable:!0,get:function get(){return f.escape;}}),Object.defineProperty(e,"encodeHTML4",{enumerable:!0,get:function get(){return f.encodeHTML;}}),Object.defineProperty(e,"encodeHTML5",{enumerable:!0,get:function get(){return f.encodeHTML;}});var u=t(260);Object.defineProperty(e,"decodeXML",{enumerable:!0,get:function get(){return u.decodeXML;}}),Object.defineProperty(e,"decodeHTML",{enumerable:!0,get:function get(){return u.decodeHTML;}}),Object.defineProperty(e,"decodeHTMLStrict",{enumerable:!0,get:function get(){return u.decodeHTMLStrict;}}),Object.defineProperty(e,"decodeHTML4",{enumerable:!0,get:function get(){return u.decodeHTML;}}),Object.defineProperty(e,"decodeHTML5",{enumerable:!0,get:function get(){return u.decodeHTML;}}),Object.defineProperty(e,"decodeHTML4Strict",{enumerable:!0,get:function get(){return u.decodeHTMLStrict;}}),Object.defineProperty(e,"decodeHTML5Strict",{enumerable:!0,get:function get(){return u.decodeHTMLStrict;}}),Object.defineProperty(e,"decodeXMLStrict",{enumerable:!0,get:function get(){return u.decodeXML;}});},/* 260 *//***/function(i,e,t){var r=this&&this.__importDefault||function(h){return h&&h.__esModule?h:{"default":h};};Object.defineProperty(e,"__esModule",{value:!0}),e.decodeHTML=e.decodeHTMLStrict=e.decodeXML=void 0;var n=r(t(261)),s=r(t(262)),c=r(t(263)),l=r(t(264));e.decodeXML=f(c["default"]),e.decodeHTMLStrict=f(n["default"]);function f(h){var y=Object.keys(h).join("|"),T=v(h);y+="|#[xX][\\da-fA-F]+|#\\d+";var O=new RegExp("&(?:"+y+");","g");return function(I){return String(I).replace(O,T);};}var u=function u(h,y){return h<y?1:-1;};e.decodeHTML=function(){for(var h=Object.keys(s["default"]).sort(u),y=Object.keys(n["default"]).sort(u),T=0,O=0;T<y.length;T++)h[O]===y[T]?(y[T]+=";?",O++):y[T]+=";";var I=new RegExp("&(?:"+y.join("|")+"|#[xX][\\da-fA-F]+;?|#\\d+;?)","g"),P=v(n["default"]);function w(d){return d.substr(-1)!==";"&&(d+=";"),P(d);}return function(d){return String(d).replace(I,w);};}();function v(h){return function(T){if(T.charAt(1)==="#"){var O=T.charAt(2);return O==="X"||O==="x"?l["default"](parseInt(T.substr(3),16)):l["default"](parseInt(T.substr(2),10));}return h[T.slice(1,-1)];};}},/* 261 *//***/function(i){i.exports=JSON.parse('{"Aacute":"Á","aacute":"á","Abreve":"Ă","abreve":"ă","ac":"∾","acd":"∿","acE":"∾̳","Acirc":"Â","acirc":"â","acute":"´","Acy":"А","acy":"а","AElig":"Æ","aelig":"æ","af":"","Afr":"𝔄","afr":"𝔞","Agrave":"À","agrave":"à","alefsym":"ℵ","aleph":"ℵ","Alpha":"Α","alpha":"α","Amacr":"Ā","amacr":"ā","amalg":"⨿","amp":"&","AMP":"&","andand":"⩕","And":"⩓","and":"∧","andd":"⩜","andslope":"⩘","andv":"⩚","ang":"∠","ange":"⦤","angle":"∠","angmsdaa":"⦨","angmsdab":"⦩","angmsdac":"⦪","angmsdad":"⦫","angmsdae":"⦬","angmsdaf":"⦭","angmsdag":"⦮","angmsdah":"⦯","angmsd":"∡","angrt":"∟","angrtvb":"⊾","angrtvbd":"⦝","angsph":"∢","angst":"Å","angzarr":"⍼","Aogon":"Ą","aogon":"ą","Aopf":"𝔸","aopf":"𝕒","apacir":"⩯","ap":"≈","apE":"⩰","ape":"≊","apid":"≋","apos":"\'","ApplyFunction":"","approx":"≈","approxeq":"≊","Aring":"Å","aring":"å","Ascr":"𝒜","ascr":"𝒶","Assign":"≔","ast":"*","asymp":"≈","asympeq":"≍","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","awconint":"∳","awint":"⨑","backcong":"≌","backepsilon":"϶","backprime":"‵","backsim":"∽","backsimeq":"⋍","Backslash":"∖","Barv":"⫧","barvee":"⊽","barwed":"⌅","Barwed":"⌆","barwedge":"⌅","bbrk":"⎵","bbrktbrk":"⎶","bcong":"≌","Bcy":"Б","bcy":"б","bdquo":"„","becaus":"∵","because":"∵","Because":"∵","bemptyv":"⦰","bepsi":"϶","bernou":"ℬ","Bernoullis":"ℬ","Beta":"Β","beta":"β","beth":"ℶ","between":"≬","Bfr":"𝔅","bfr":"𝔟","bigcap":"⋂","bigcirc":"◯","bigcup":"⋃","bigodot":"⨀","bigoplus":"⨁","bigotimes":"⨂","bigsqcup":"⨆","bigstar":"★","bigtriangledown":"▽","bigtriangleup":"△","biguplus":"⨄","bigvee":"⋁","bigwedge":"⋀","bkarow":"⤍","blacklozenge":"⧫","blacksquare":"▪","blacktriangle":"▴","blacktriangledown":"▾","blacktriangleleft":"◂","blacktriangleright":"▸","blank":"␣","blk12":"▒","blk14":"░","blk34":"▓","block":"█","bne":"=⃥","bnequiv":"≡⃥","bNot":"⫭","bnot":"⌐","Bopf":"𝔹","bopf":"𝕓","bot":"⊥","bottom":"⊥","bowtie":"⋈","boxbox":"⧉","boxdl":"┐","boxdL":"╕","boxDl":"╖","boxDL":"╗","boxdr":"┌","boxdR":"╒","boxDr":"╓","boxDR":"╔","boxh":"─","boxH":"═","boxhd":"┬","boxHd":"╤","boxhD":"╥","boxHD":"╦","boxhu":"┴","boxHu":"╧","boxhU":"╨","boxHU":"╩","boxminus":"⊟","boxplus":"⊞","boxtimes":"⊠","boxul":"┘","boxuL":"╛","boxUl":"╜","boxUL":"╝","boxur":"└","boxuR":"╘","boxUr":"╙","boxUR":"╚","boxv":"│","boxV":"║","boxvh":"┼","boxvH":"╪","boxVh":"╫","boxVH":"╬","boxvl":"┤","boxvL":"╡","boxVl":"╢","boxVL":"╣","boxvr":"├","boxvR":"╞","boxVr":"╟","boxVR":"╠","bprime":"‵","breve":"˘","Breve":"˘","brvbar":"¦","bscr":"𝒷","Bscr":"ℬ","bsemi":"⁏","bsim":"∽","bsime":"⋍","bsolb":"⧅","bsol":"\\\\","bsolhsub":"⟈","bull":"•","bullet":"•","bump":"≎","bumpE":"⪮","bumpe":"≏","Bumpeq":"≎","bumpeq":"≏","Cacute":"Ć","cacute":"ć","capand":"⩄","capbrcup":"⩉","capcap":"⩋","cap":"∩","Cap":"⋒","capcup":"⩇","capdot":"⩀","CapitalDifferentialD":"ⅅ","caps":"∩︀","caret":"⁁","caron":"ˇ","Cayleys":"ℭ","ccaps":"⩍","Ccaron":"Č","ccaron":"č","Ccedil":"Ç","ccedil":"ç","Ccirc":"Ĉ","ccirc":"ĉ","Cconint":"∰","ccups":"⩌","ccupssm":"⩐","Cdot":"Ċ","cdot":"ċ","cedil":"¸","Cedilla":"¸","cemptyv":"⦲","cent":"¢","centerdot":"·","CenterDot":"·","cfr":"𝔠","Cfr":"ℭ","CHcy":"Ч","chcy":"ч","check":"✓","checkmark":"✓","Chi":"Χ","chi":"χ","circ":"ˆ","circeq":"≗","circlearrowleft":"↺","circlearrowright":"↻","circledast":"⊛","circledcirc":"⊚","circleddash":"⊝","CircleDot":"⊙","circledR":"®","circledS":"Ⓢ","CircleMinus":"⊖","CirclePlus":"⊕","CircleTimes":"⊗","cir":"○","cirE":"⧃","cire":"≗","cirfnint":"⨐","cirmid":"⫯","cirscir":"⧂","ClockwiseContourIntegral":"∲","CloseCurlyDoubleQuote":"”","CloseCurlyQuote":"’","clubs":"♣","clubsuit":"♣","colon":":","Colon":"∷","Colone":"⩴","colone":"≔","coloneq":"≔","comma":",","commat":"@","comp":"∁","compfn":"∘","complement":"∁","complexes":"ℂ","cong":"≅","congdot":"⩭","Congruent":"≡","conint":"∮","Conint":"∯","ContourIntegral":"∮","copf":"𝕔","Copf":"ℂ","coprod":"∐","Coproduct":"∐","copy":"©","COPY":"©","copysr":"℗","CounterClockwiseContourIntegral":"∳","crarr":"↵","cross":"✗","Cross":"⨯","Cscr":"𝒞","cscr":"𝒸","csub":"⫏","csube":"⫑","csup":"⫐","csupe":"⫒","ctdot":"⋯","cudarrl":"⤸","cudarrr":"⤵","cuepr":"⋞","cuesc":"⋟","cularr":"↶","cularrp":"⤽","cupbrcap":"⩈","cupcap":"⩆","CupCap":"≍","cup":"∪","Cup":"⋓","cupcup":"⩊","cupdot":"⊍","cupor":"⩅","cups":"∪︀","curarr":"↷","curarrm":"⤼","curlyeqprec":"⋞","curlyeqsucc":"⋟","curlyvee":"⋎","curlywedge":"⋏","curren":"¤","curvearrowleft":"↶","curvearrowright":"↷","cuvee":"⋎","cuwed":"⋏","cwconint":"∲","cwint":"∱","cylcty":"⌭","dagger":"†","Dagger":"‡","daleth":"ℸ","darr":"↓","Darr":"↡","dArr":"⇓","dash":"‐","Dashv":"⫤","dashv":"⊣","dbkarow":"⤏","dblac":"˝","Dcaron":"Ď","dcaron":"ď","Dcy":"Д","dcy":"д","ddagger":"‡","ddarr":"⇊","DD":"ⅅ","dd":"ⅆ","DDotrahd":"⤑","ddotseq":"⩷","deg":"°","Del":"∇","Delta":"Δ","delta":"δ","demptyv":"⦱","dfisht":"⥿","Dfr":"𝔇","dfr":"𝔡","dHar":"⥥","dharl":"⇃","dharr":"⇂","DiacriticalAcute":"´","DiacriticalDot":"˙","DiacriticalDoubleAcute":"˝","DiacriticalGrave":"`","DiacriticalTilde":"˜","diam":"⋄","diamond":"⋄","Diamond":"⋄","diamondsuit":"♦","diams":"♦","die":"¨","DifferentialD":"ⅆ","digamma":"ϝ","disin":"⋲","div":"÷","divide":"÷","divideontimes":"⋇","divonx":"⋇","DJcy":"Ђ","djcy":"ђ","dlcorn":"⌞","dlcrop":"⌍","dollar":"$","Dopf":"𝔻","dopf":"𝕕","Dot":"¨","dot":"˙","DotDot":"⃜","doteq":"≐","doteqdot":"≑","DotEqual":"≐","dotminus":"∸","dotplus":"∔","dotsquare":"⊡","doublebarwedge":"⌆","DoubleContourIntegral":"∯","DoubleDot":"¨","DoubleDownArrow":"⇓","DoubleLeftArrow":"⇐","DoubleLeftRightArrow":"⇔","DoubleLeftTee":"⫤","DoubleLongLeftArrow":"⟸","DoubleLongLeftRightArrow":"⟺","DoubleLongRightArrow":"⟹","DoubleRightArrow":"⇒","DoubleRightTee":"⊨","DoubleUpArrow":"⇑","DoubleUpDownArrow":"⇕","DoubleVerticalBar":"∥","DownArrowBar":"⤓","downarrow":"↓","DownArrow":"↓","Downarrow":"⇓","DownArrowUpArrow":"⇵","DownBreve":"̑","downdownarrows":"⇊","downharpoonleft":"⇃","downharpoonright":"⇂","DownLeftRightVector":"⥐","DownLeftTeeVector":"⥞","DownLeftVectorBar":"⥖","DownLeftVector":"↽","DownRightTeeVector":"⥟","DownRightVectorBar":"⥗","DownRightVector":"⇁","DownTeeArrow":"↧","DownTee":"⊤","drbkarow":"⤐","drcorn":"⌟","drcrop":"⌌","Dscr":"𝒟","dscr":"𝒹","DScy":"Ѕ","dscy":"ѕ","dsol":"⧶","Dstrok":"Đ","dstrok":"đ","dtdot":"⋱","dtri":"▿","dtrif":"▾","duarr":"⇵","duhar":"⥯","dwangle":"⦦","DZcy":"Џ","dzcy":"џ","dzigrarr":"⟿","Eacute":"É","eacute":"é","easter":"⩮","Ecaron":"Ě","ecaron":"ě","Ecirc":"Ê","ecirc":"ê","ecir":"≖","ecolon":"≕","Ecy":"Э","ecy":"э","eDDot":"⩷","Edot":"Ė","edot":"ė","eDot":"≑","ee":"ⅇ","efDot":"≒","Efr":"𝔈","efr":"𝔢","eg":"⪚","Egrave":"È","egrave":"è","egs":"⪖","egsdot":"⪘","el":"⪙","Element":"∈","elinters":"⏧","ell":"ℓ","els":"⪕","elsdot":"⪗","Emacr":"Ē","emacr":"ē","empty":"∅","emptyset":"∅","EmptySmallSquare":"◻","emptyv":"∅","EmptyVerySmallSquare":"▫","emsp13":" ","emsp14":" ","emsp":" ","ENG":"Ŋ","eng":"ŋ","ensp":" ","Eogon":"Ę","eogon":"ę","Eopf":"𝔼","eopf":"𝕖","epar":"⋕","eparsl":"⧣","eplus":"⩱","epsi":"ε","Epsilon":"Ε","epsilon":"ε","epsiv":"ϵ","eqcirc":"≖","eqcolon":"≕","eqsim":"≂","eqslantgtr":"⪖","eqslantless":"⪕","Equal":"⩵","equals":"=","EqualTilde":"≂","equest":"≟","Equilibrium":"⇌","equiv":"≡","equivDD":"⩸","eqvparsl":"⧥","erarr":"⥱","erDot":"≓","escr":"ℯ","Escr":"ℰ","esdot":"≐","Esim":"⩳","esim":"≂","Eta":"Η","eta":"η","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","euro":"€","excl":"!","exist":"∃","Exists":"∃","expectation":"ℰ","exponentiale":"ⅇ","ExponentialE":"ⅇ","fallingdotseq":"≒","Fcy":"Ф","fcy":"ф","female":"♀","ffilig":"ffi","fflig":"ff","ffllig":"ffl","Ffr":"𝔉","ffr":"𝔣","filig":"fi","FilledSmallSquare":"◼","FilledVerySmallSquare":"▪","fjlig":"fj","flat":"♭","fllig":"fl","fltns":"▱","fnof":"ƒ","Fopf":"𝔽","fopf":"𝕗","forall":"∀","ForAll":"∀","fork":"⋔","forkv":"⫙","Fouriertrf":"ℱ","fpartint":"⨍","frac12":"½","frac13":"⅓","frac14":"¼","frac15":"⅕","frac16":"⅙","frac18":"⅛","frac23":"⅔","frac25":"⅖","frac34":"¾","frac35":"⅗","frac38":"⅜","frac45":"⅘","frac56":"⅚","frac58":"⅝","frac78":"⅞","frasl":"⁄","frown":"⌢","fscr":"𝒻","Fscr":"ℱ","gacute":"ǵ","Gamma":"Γ","gamma":"γ","Gammad":"Ϝ","gammad":"ϝ","gap":"⪆","Gbreve":"Ğ","gbreve":"ğ","Gcedil":"Ģ","Gcirc":"Ĝ","gcirc":"ĝ","Gcy":"Г","gcy":"г","Gdot":"Ġ","gdot":"ġ","ge":"≥","gE":"≧","gEl":"⪌","gel":"⋛","geq":"≥","geqq":"≧","geqslant":"⩾","gescc":"⪩","ges":"⩾","gesdot":"⪀","gesdoto":"⪂","gesdotol":"⪄","gesl":"⋛︀","gesles":"⪔","Gfr":"𝔊","gfr":"𝔤","gg":"≫","Gg":"⋙","ggg":"⋙","gimel":"ℷ","GJcy":"Ѓ","gjcy":"ѓ","gla":"⪥","gl":"≷","glE":"⪒","glj":"⪤","gnap":"⪊","gnapprox":"⪊","gne":"⪈","gnE":"≩","gneq":"⪈","gneqq":"≩","gnsim":"⋧","Gopf":"𝔾","gopf":"𝕘","grave":"`","GreaterEqual":"≥","GreaterEqualLess":"⋛","GreaterFullEqual":"≧","GreaterGreater":"⪢","GreaterLess":"≷","GreaterSlantEqual":"⩾","GreaterTilde":"≳","Gscr":"𝒢","gscr":"ℊ","gsim":"≳","gsime":"⪎","gsiml":"⪐","gtcc":"⪧","gtcir":"⩺","gt":">","GT":">","Gt":"≫","gtdot":"⋗","gtlPar":"⦕","gtquest":"⩼","gtrapprox":"⪆","gtrarr":"⥸","gtrdot":"⋗","gtreqless":"⋛","gtreqqless":"⪌","gtrless":"≷","gtrsim":"≳","gvertneqq":"≩︀","gvnE":"≩︀","Hacek":"ˇ","hairsp":" ","half":"½","hamilt":"ℋ","HARDcy":"Ъ","hardcy":"ъ","harrcir":"⥈","harr":"↔","hArr":"⇔","harrw":"↭","Hat":"^","hbar":"ℏ","Hcirc":"Ĥ","hcirc":"ĥ","hearts":"♥","heartsuit":"♥","hellip":"…","hercon":"⊹","hfr":"𝔥","Hfr":"ℌ","HilbertSpace":"ℋ","hksearow":"⤥","hkswarow":"⤦","hoarr":"⇿","homtht":"∻","hookleftarrow":"↩","hookrightarrow":"↪","hopf":"𝕙","Hopf":"ℍ","horbar":"―","HorizontalLine":"─","hscr":"𝒽","Hscr":"ℋ","hslash":"ℏ","Hstrok":"Ħ","hstrok":"ħ","HumpDownHump":"≎","HumpEqual":"≏","hybull":"⁃","hyphen":"‐","Iacute":"Í","iacute":"í","ic":"","Icirc":"Î","icirc":"î","Icy":"И","icy":"и","Idot":"İ","IEcy":"Е","iecy":"е","iexcl":"¡","iff":"⇔","ifr":"𝔦","Ifr":"ℑ","Igrave":"Ì","igrave":"ì","ii":"ⅈ","iiiint":"⨌","iiint":"∭","iinfin":"⧜","iiota":"℩","IJlig":"IJ","ijlig":"ij","Imacr":"Ī","imacr":"ī","image":"ℑ","ImaginaryI":"ⅈ","imagline":"ℐ","imagpart":"ℑ","imath":"ı","Im":"ℑ","imof":"⊷","imped":"Ƶ","Implies":"⇒","incare":"℅","in":"∈","infin":"∞","infintie":"⧝","inodot":"ı","intcal":"⊺","int":"∫","Int":"∬","integers":"ℤ","Integral":"∫","intercal":"⊺","Intersection":"⋂","intlarhk":"⨗","intprod":"⨼","InvisibleComma":"","InvisibleTimes":"","IOcy":"Ё","iocy":"ё","Iogon":"Į","iogon":"į","Iopf":"𝕀","iopf":"𝕚","Iota":"Ι","iota":"ι","iprod":"⨼","iquest":"¿","iscr":"𝒾","Iscr":"ℐ","isin":"∈","isindot":"⋵","isinE":"⋹","isins":"⋴","isinsv":"⋳","isinv":"∈","it":"","Itilde":"Ĩ","itilde":"ĩ","Iukcy":"І","iukcy":"і","Iuml":"Ï","iuml":"ï","Jcirc":"Ĵ","jcirc":"ĵ","Jcy":"Й","jcy":"й","Jfr":"𝔍","jfr":"𝔧","jmath":"ȷ","Jopf":"𝕁","jopf":"𝕛","Jscr":"𝒥","jscr":"𝒿","Jsercy":"Ј","jsercy":"ј","Jukcy":"Є","jukcy":"є","Kappa":"Κ","kappa":"κ","kappav":"ϰ","Kcedil":"Ķ","kcedil":"ķ","Kcy":"К","kcy":"к","Kfr":"𝔎","kfr":"𝔨","kgreen":"ĸ","KHcy":"Х","khcy":"х","KJcy":"Ќ","kjcy":"ќ","Kopf":"𝕂","kopf":"𝕜","Kscr":"𝒦","kscr":"𝓀","lAarr":"⇚","Lacute":"Ĺ","lacute":"ĺ","laemptyv":"⦴","lagran":"ℒ","Lambda":"Λ","lambda":"λ","lang":"⟨","Lang":"⟪","langd":"⦑","langle":"⟨","lap":"⪅","Laplacetrf":"ℒ","laquo":"«","larrb":"⇤","larrbfs":"⤟","larr":"←","Larr":"↞","lArr":"⇐","larrfs":"⤝","larrhk":"↩","larrlp":"↫","larrpl":"⤹","larrsim":"⥳","larrtl":"↢","latail":"⤙","lAtail":"⤛","lat":"⪫","late":"⪭","lates":"⪭︀","lbarr":"⤌","lBarr":"⤎","lbbrk":"❲","lbrace":"{","lbrack":"[","lbrke":"⦋","lbrksld":"⦏","lbrkslu":"⦍","Lcaron":"Ľ","lcaron":"ľ","Lcedil":"Ļ","lcedil":"ļ","lceil":"⌈","lcub":"{","Lcy":"Л","lcy":"л","ldca":"⤶","ldquo":"“","ldquor":"„","ldrdhar":"⥧","ldrushar":"⥋","ldsh":"↲","le":"≤","lE":"≦","LeftAngleBracket":"⟨","LeftArrowBar":"⇤","leftarrow":"←","LeftArrow":"←","Leftarrow":"⇐","LeftArrowRightArrow":"⇆","leftarrowtail":"↢","LeftCeiling":"⌈","LeftDoubleBracket":"⟦","LeftDownTeeVector":"⥡","LeftDownVectorBar":"⥙","LeftDownVector":"⇃","LeftFloor":"⌊","leftharpoondown":"↽","leftharpoonup":"↼","leftleftarrows":"⇇","leftrightarrow":"↔","LeftRightArrow":"↔","Leftrightarrow":"⇔","leftrightarrows":"⇆","leftrightharpoons":"⇋","leftrightsquigarrow":"↭","LeftRightVector":"⥎","LeftTeeArrow":"↤","LeftTee":"⊣","LeftTeeVector":"⥚","leftthreetimes":"⋋","LeftTriangleBar":"⧏","LeftTriangle":"⊲","LeftTriangleEqual":"⊴","LeftUpDownVector":"⥑","LeftUpTeeVector":"⥠","LeftUpVectorBar":"⥘","LeftUpVector":"↿","LeftVectorBar":"⥒","LeftVector":"↼","lEg":"⪋","leg":"⋚","leq":"≤","leqq":"≦","leqslant":"⩽","lescc":"⪨","les":"⩽","lesdot":"⩿","lesdoto":"⪁","lesdotor":"⪃","lesg":"⋚︀","lesges":"⪓","lessapprox":"⪅","lessdot":"⋖","lesseqgtr":"⋚","lesseqqgtr":"⪋","LessEqualGreater":"⋚","LessFullEqual":"≦","LessGreater":"≶","lessgtr":"≶","LessLess":"⪡","lesssim":"≲","LessSlantEqual":"⩽","LessTilde":"≲","lfisht":"⥼","lfloor":"⌊","Lfr":"𝔏","lfr":"𝔩","lg":"≶","lgE":"⪑","lHar":"⥢","lhard":"↽","lharu":"↼","lharul":"⥪","lhblk":"▄","LJcy":"Љ","ljcy":"љ","llarr":"⇇","ll":"≪","Ll":"⋘","llcorner":"⌞","Lleftarrow":"⇚","llhard":"⥫","lltri":"◺","Lmidot":"Ŀ","lmidot":"ŀ","lmoustache":"⎰","lmoust":"⎰","lnap":"⪉","lnapprox":"⪉","lne":"⪇","lnE":"≨","lneq":"⪇","lneqq":"≨","lnsim":"⋦","loang":"⟬","loarr":"⇽","lobrk":"⟦","longleftarrow":"⟵","LongLeftArrow":"⟵","Longleftarrow":"⟸","longleftrightarrow":"⟷","LongLeftRightArrow":"⟷","Longleftrightarrow":"⟺","longmapsto":"⟼","longrightarrow":"⟶","LongRightArrow":"⟶","Longrightarrow":"⟹","looparrowleft":"↫","looparrowright":"↬","lopar":"⦅","Lopf":"𝕃","lopf":"𝕝","loplus":"⨭","lotimes":"⨴","lowast":"∗","lowbar":"_","LowerLeftArrow":"↙","LowerRightArrow":"↘","loz":"◊","lozenge":"◊","lozf":"⧫","lpar":"(","lparlt":"⦓","lrarr":"⇆","lrcorner":"⌟","lrhar":"⇋","lrhard":"⥭","lrm":"","lrtri":"⊿","lsaquo":"‹","lscr":"𝓁","Lscr":"ℒ","lsh":"↰","Lsh":"↰","lsim":"≲","lsime":"⪍","lsimg":"⪏","lsqb":"[","lsquo":"‘","lsquor":"‚","Lstrok":"Ł","lstrok":"ł","ltcc":"⪦","ltcir":"⩹","lt":"<","LT":"<","Lt":"≪","ltdot":"⋖","lthree":"⋋","ltimes":"⋉","ltlarr":"⥶","ltquest":"⩻","ltri":"◃","ltrie":"⊴","ltrif":"◂","ltrPar":"⦖","lurdshar":"⥊","luruhar":"⥦","lvertneqq":"≨︀","lvnE":"≨︀","macr":"¯","male":"♂","malt":"✠","maltese":"✠","Map":"⤅","map":"↦","mapsto":"↦","mapstodown":"↧","mapstoleft":"↤","mapstoup":"↥","marker":"▮","mcomma":"⨩","Mcy":"М","mcy":"м","mdash":"—","mDDot":"∺","measuredangle":"∡","MediumSpace":" ","Mellintrf":"ℳ","Mfr":"𝔐","mfr":"𝔪","mho":"℧","micro":"µ","midast":"*","midcir":"⫰","mid":"∣","middot":"·","minusb":"⊟","minus":"−","minusd":"∸","minusdu":"⨪","MinusPlus":"∓","mlcp":"⫛","mldr":"…","mnplus":"∓","models":"⊧","Mopf":"𝕄","mopf":"𝕞","mp":"∓","mscr":"𝓂","Mscr":"ℳ","mstpos":"∾","Mu":"Μ","mu":"μ","multimap":"⊸","mumap":"⊸","nabla":"∇","Nacute":"Ń","nacute":"ń","nang":"∠⃒","nap":"≉","napE":"⩰̸","napid":"≋̸","napos":"ʼn","napprox":"≉","natural":"♮","naturals":"ℕ","natur":"♮","nbsp":" ","nbump":"≎̸","nbumpe":"≏̸","ncap":"⩃","Ncaron":"Ň","ncaron":"ň","Ncedil":"Ņ","ncedil":"ņ","ncong":"≇","ncongdot":"⩭̸","ncup":"⩂","Ncy":"Н","ncy":"н","ndash":"–","nearhk":"⤤","nearr":"↗","neArr":"⇗","nearrow":"↗","ne":"≠","nedot":"≐̸","NegativeMediumSpace":"","NegativeThickSpace":"","NegativeThinSpace":"","NegativeVeryThinSpace":"","nequiv":"≢","nesear":"⤨","nesim":"≂̸","NestedGreaterGreater":"≫","NestedLessLess":"≪","NewLine":"\\n","nexist":"∄","nexists":"∄","Nfr":"𝔑","nfr":"𝔫","ngE":"≧̸","nge":"≱","ngeq":"≱","ngeqq":"≧̸","ngeqslant":"⩾̸","nges":"⩾̸","nGg":"⋙̸","ngsim":"≵","nGt":"≫⃒","ngt":"≯","ngtr":"≯","nGtv":"≫̸","nharr":"↮","nhArr":"⇎","nhpar":"⫲","ni":"∋","nis":"⋼","nisd":"⋺","niv":"∋","NJcy":"Њ","njcy":"њ","nlarr":"↚","nlArr":"⇍","nldr":"‥","nlE":"≦̸","nle":"≰","nleftarrow":"↚","nLeftarrow":"⇍","nleftrightarrow":"↮","nLeftrightarrow":"⇎","nleq":"≰","nleqq":"≦̸","nleqslant":"⩽̸","nles":"⩽̸","nless":"≮","nLl":"⋘̸","nlsim":"≴","nLt":"≪⃒","nlt":"≮","nltri":"⋪","nltrie":"⋬","nLtv":"≪̸","nmid":"∤","NoBreak":"","NonBreakingSpace":" ","nopf":"𝕟","Nopf":"ℕ","Not":"⫬","not":"¬","NotCongruent":"≢","NotCupCap":"≭","NotDoubleVerticalBar":"∦","NotElement":"∉","NotEqual":"≠","NotEqualTilde":"≂̸","NotExists":"∄","NotGreater":"≯","NotGreaterEqual":"≱","NotGreaterFullEqual":"≧̸","NotGreaterGreater":"≫̸","NotGreaterLess":"≹","NotGreaterSlantEqual":"⩾̸","NotGreaterTilde":"≵","NotHumpDownHump":"≎̸","NotHumpEqual":"≏̸","notin":"∉","notindot":"⋵̸","notinE":"⋹̸","notinva":"∉","notinvb":"⋷","notinvc":"⋶","NotLeftTriangleBar":"⧏̸","NotLeftTriangle":"⋪","NotLeftTriangleEqual":"⋬","NotLess":"≮","NotLessEqual":"≰","NotLessGreater":"≸","NotLessLess":"≪̸","NotLessSlantEqual":"⩽̸","NotLessTilde":"≴","NotNestedGreaterGreater":"⪢̸","NotNestedLessLess":"⪡̸","notni":"∌","notniva":"∌","notnivb":"⋾","notnivc":"⋽","NotPrecedes":"⊀","NotPrecedesEqual":"⪯̸","NotPrecedesSlantEqual":"⋠","NotReverseElement":"∌","NotRightTriangleBar":"⧐̸","NotRightTriangle":"⋫","NotRightTriangleEqual":"⋭","NotSquareSubset":"⊏̸","NotSquareSubsetEqual":"⋢","NotSquareSuperset":"⊐̸","NotSquareSupersetEqual":"⋣","NotSubset":"⊂⃒","NotSubsetEqual":"⊈","NotSucceeds":"⊁","NotSucceedsEqual":"⪰̸","NotSucceedsSlantEqual":"⋡","NotSucceedsTilde":"≿̸","NotSuperset":"⊃⃒","NotSupersetEqual":"⊉","NotTilde":"≁","NotTildeEqual":"≄","NotTildeFullEqual":"≇","NotTildeTilde":"≉","NotVerticalBar":"∤","nparallel":"∦","npar":"∦","nparsl":"⫽⃥","npart":"∂̸","npolint":"⨔","npr":"⊀","nprcue":"⋠","nprec":"⊀","npreceq":"⪯̸","npre":"⪯̸","nrarrc":"⤳̸","nrarr":"↛","nrArr":"⇏","nrarrw":"↝̸","nrightarrow":"↛","nRightarrow":"⇏","nrtri":"⋫","nrtrie":"⋭","nsc":"⊁","nsccue":"⋡","nsce":"⪰̸","Nscr":"𝒩","nscr":"𝓃","nshortmid":"∤","nshortparallel":"∦","nsim":"≁","nsime":"≄","nsimeq":"≄","nsmid":"∤","nspar":"∦","nsqsube":"⋢","nsqsupe":"⋣","nsub":"⊄","nsubE":"⫅̸","nsube":"⊈","nsubset":"⊂⃒","nsubseteq":"⊈","nsubseteqq":"⫅̸","nsucc":"⊁","nsucceq":"⪰̸","nsup":"⊅","nsupE":"⫆̸","nsupe":"⊉","nsupset":"⊃⃒","nsupseteq":"⊉","nsupseteqq":"⫆̸","ntgl":"≹","Ntilde":"Ñ","ntilde":"ñ","ntlg":"≸","ntriangleleft":"⋪","ntrianglelefteq":"⋬","ntriangleright":"⋫","ntrianglerighteq":"⋭","Nu":"Ν","nu":"ν","num":"#","numero":"№","numsp":" ","nvap":"≍⃒","nvdash":"⊬","nvDash":"⊭","nVdash":"⊮","nVDash":"⊯","nvge":"≥⃒","nvgt":">⃒","nvHarr":"⤄","nvinfin":"⧞","nvlArr":"⤂","nvle":"≤⃒","nvlt":"<⃒","nvltrie":"⊴⃒","nvrArr":"⤃","nvrtrie":"⊵⃒","nvsim":"∼⃒","nwarhk":"⤣","nwarr":"↖","nwArr":"⇖","nwarrow":"↖","nwnear":"⤧","Oacute":"Ó","oacute":"ó","oast":"⊛","Ocirc":"Ô","ocirc":"ô","ocir":"⊚","Ocy":"О","ocy":"о","odash":"⊝","Odblac":"Ő","odblac":"ő","odiv":"⨸","odot":"⊙","odsold":"⦼","OElig":"Œ","oelig":"œ","ofcir":"⦿","Ofr":"𝔒","ofr":"𝔬","ogon":"˛","Ograve":"Ò","ograve":"ò","ogt":"⧁","ohbar":"⦵","ohm":"Ω","oint":"∮","olarr":"↺","olcir":"⦾","olcross":"⦻","oline":"‾","olt":"⧀","Omacr":"Ō","omacr":"ō","Omega":"Ω","omega":"ω","Omicron":"Ο","omicron":"ο","omid":"⦶","ominus":"⊖","Oopf":"𝕆","oopf":"𝕠","opar":"⦷","OpenCurlyDoubleQuote":"“","OpenCurlyQuote":"‘","operp":"⦹","oplus":"⊕","orarr":"↻","Or":"⩔","or":"∨","ord":"⩝","order":"ℴ","orderof":"ℴ","ordf":"ª","ordm":"º","origof":"⊶","oror":"⩖","orslope":"⩗","orv":"⩛","oS":"Ⓢ","Oscr":"𝒪","oscr":"ℴ","Oslash":"Ø","oslash":"ø","osol":"⊘","Otilde":"Õ","otilde":"õ","otimesas":"⨶","Otimes":"⨷","otimes":"⊗","Ouml":"Ö","ouml":"ö","ovbar":"⌽","OverBar":"‾","OverBrace":"⏞","OverBracket":"⎴","OverParenthesis":"⏜","para":"¶","parallel":"∥","par":"∥","parsim":"⫳","parsl":"⫽","part":"∂","PartialD":"∂","Pcy":"П","pcy":"п","percnt":"%","period":".","permil":"‰","perp":"⊥","pertenk":"‱","Pfr":"𝔓","pfr":"𝔭","Phi":"Φ","phi":"φ","phiv":"ϕ","phmmat":"ℳ","phone":"☎","Pi":"Π","pi":"π","pitchfork":"⋔","piv":"ϖ","planck":"ℏ","planckh":"ℎ","plankv":"ℏ","plusacir":"⨣","plusb":"⊞","pluscir":"⨢","plus":"+","plusdo":"∔","plusdu":"⨥","pluse":"⩲","PlusMinus":"±","plusmn":"±","plussim":"⨦","plustwo":"⨧","pm":"±","Poincareplane":"ℌ","pointint":"⨕","popf":"𝕡","Popf":"ℙ","pound":"£","prap":"⪷","Pr":"⪻","pr":"≺","prcue":"≼","precapprox":"⪷","prec":"≺","preccurlyeq":"≼","Precedes":"≺","PrecedesEqual":"⪯","PrecedesSlantEqual":"≼","PrecedesTilde":"≾","preceq":"⪯","precnapprox":"⪹","precneqq":"⪵","precnsim":"⋨","pre":"⪯","prE":"⪳","precsim":"≾","prime":"′","Prime":"″","primes":"ℙ","prnap":"⪹","prnE":"⪵","prnsim":"⋨","prod":"∏","Product":"∏","profalar":"⌮","profline":"⌒","profsurf":"⌓","prop":"∝","Proportional":"∝","Proportion":"∷","propto":"∝","prsim":"≾","prurel":"⊰","Pscr":"𝒫","pscr":"𝓅","Psi":"Ψ","psi":"ψ","puncsp":" ","Qfr":"𝔔","qfr":"𝔮","qint":"⨌","qopf":"𝕢","Qopf":"ℚ","qprime":"⁗","Qscr":"𝒬","qscr":"𝓆","quaternions":"ℍ","quatint":"⨖","quest":"?","questeq":"≟","quot":"\\"","QUOT":"\\"","rAarr":"⇛","race":"∽̱","Racute":"Ŕ","racute":"ŕ","radic":"√","raemptyv":"⦳","rang":"⟩","Rang":"⟫","rangd":"⦒","range":"⦥","rangle":"⟩","raquo":"»","rarrap":"⥵","rarrb":"⇥","rarrbfs":"⤠","rarrc":"⤳","rarr":"→","Rarr":"↠","rArr":"⇒","rarrfs":"⤞","rarrhk":"↪","rarrlp":"↬","rarrpl":"⥅","rarrsim":"⥴","Rarrtl":"⤖","rarrtl":"↣","rarrw":"↝","ratail":"⤚","rAtail":"⤜","ratio":"∶","rationals":"ℚ","rbarr":"⤍","rBarr":"⤏","RBarr":"⤐","rbbrk":"❳","rbrace":"}","rbrack":"]","rbrke":"⦌","rbrksld":"⦎","rbrkslu":"⦐","Rcaron":"Ř","rcaron":"ř","Rcedil":"Ŗ","rcedil":"ŗ","rceil":"⌉","rcub":"}","Rcy":"Р","rcy":"р","rdca":"⤷","rdldhar":"⥩","rdquo":"”","rdquor":"”","rdsh":"↳","real":"ℜ","realine":"ℛ","realpart":"ℜ","reals":"ℝ","Re":"ℜ","rect":"▭","reg":"®","REG":"®","ReverseElement":"∋","ReverseEquilibrium":"⇋","ReverseUpEquilibrium":"⥯","rfisht":"⥽","rfloor":"⌋","rfr":"𝔯","Rfr":"ℜ","rHar":"⥤","rhard":"⇁","rharu":"⇀","rharul":"⥬","Rho":"Ρ","rho":"ρ","rhov":"ϱ","RightAngleBracket":"⟩","RightArrowBar":"⇥","rightarrow":"→","RightArrow":"→","Rightarrow":"⇒","RightArrowLeftArrow":"⇄","rightarrowtail":"↣","RightCeiling":"⌉","RightDoubleBracket":"⟧","RightDownTeeVector":"⥝","RightDownVectorBar":"⥕","RightDownVector":"⇂","RightFloor":"⌋","rightharpoondown":"⇁","rightharpoonup":"⇀","rightleftarrows":"⇄","rightleftharpoons":"⇌","rightrightarrows":"⇉","rightsquigarrow":"↝","RightTeeArrow":"↦","RightTee":"⊢","RightTeeVector":"⥛","rightthreetimes":"⋌","RightTriangleBar":"⧐","RightTriangle":"⊳","RightTriangleEqual":"⊵","RightUpDownVector":"⥏","RightUpTeeVector":"⥜","RightUpVectorBar":"⥔","RightUpVector":"↾","RightVectorBar":"⥓","RightVector":"⇀","ring":"˚","risingdotseq":"≓","rlarr":"⇄","rlhar":"⇌","rlm":"","rmoustache":"⎱","rmoust":"⎱","rnmid":"⫮","roang":"⟭","roarr":"⇾","robrk":"⟧","ropar":"⦆","ropf":"𝕣","Ropf":"ℝ","roplus":"⨮","rotimes":"⨵","RoundImplies":"⥰","rpar":")","rpargt":"⦔","rppolint":"⨒","rrarr":"⇉","Rrightarrow":"⇛","rsaquo":"›","rscr":"𝓇","Rscr":"ℛ","rsh":"↱","Rsh":"↱","rsqb":"]","rsquo":"’","rsquor":"’","rthree":"⋌","rtimes":"⋊","rtri":"▹","rtrie":"⊵","rtrif":"▸","rtriltri":"⧎","RuleDelayed":"⧴","ruluhar":"⥨","rx":"℞","Sacute":"Ś","sacute":"ś","sbquo":"‚","scap":"⪸","Scaron":"Š","scaron":"š","Sc":"⪼","sc":"≻","sccue":"≽","sce":"⪰","scE":"⪴","Scedil":"Ş","scedil":"ş","Scirc":"Ŝ","scirc":"ŝ","scnap":"⪺","scnE":"⪶","scnsim":"⋩","scpolint":"⨓","scsim":"≿","Scy":"С","scy":"с","sdotb":"⊡","sdot":"⋅","sdote":"⩦","searhk":"⤥","searr":"↘","seArr":"⇘","searrow":"↘","sect":"§","semi":";","seswar":"⤩","setminus":"∖","setmn":"∖","sext":"✶","Sfr":"𝔖","sfr":"𝔰","sfrown":"⌢","sharp":"♯","SHCHcy":"Щ","shchcy":"щ","SHcy":"Ш","shcy":"ш","ShortDownArrow":"↓","ShortLeftArrow":"←","shortmid":"∣","shortparallel":"∥","ShortRightArrow":"→","ShortUpArrow":"↑","shy":"","Sigma":"Σ","sigma":"σ","sigmaf":"ς","sigmav":"ς","sim":"∼","simdot":"⩪","sime":"≃","simeq":"≃","simg":"⪞","simgE":"⪠","siml":"⪝","simlE":"⪟","simne":"≆","simplus":"⨤","simrarr":"⥲","slarr":"←","SmallCircle":"∘","smallsetminus":"∖","smashp":"⨳","smeparsl":"⧤","smid":"∣","smile":"⌣","smt":"⪪","smte":"⪬","smtes":"⪬︀","SOFTcy":"Ь","softcy":"ь","solbar":"⌿","solb":"⧄","sol":"/","Sopf":"𝕊","sopf":"𝕤","spades":"♠","spadesuit":"♠","spar":"∥","sqcap":"⊓","sqcaps":"⊓︀","sqcup":"⊔","sqcups":"⊔︀","Sqrt":"√","sqsub":"⊏","sqsube":"⊑","sqsubset":"⊏","sqsubseteq":"⊑","sqsup":"⊐","sqsupe":"⊒","sqsupset":"⊐","sqsupseteq":"⊒","square":"□","Square":"□","SquareIntersection":"⊓","SquareSubset":"⊏","SquareSubsetEqual":"⊑","SquareSuperset":"⊐","SquareSupersetEqual":"⊒","SquareUnion":"⊔","squarf":"▪","squ":"□","squf":"▪","srarr":"→","Sscr":"𝒮","sscr":"𝓈","ssetmn":"∖","ssmile":"⌣","sstarf":"⋆","Star":"⋆","star":"☆","starf":"★","straightepsilon":"ϵ","straightphi":"ϕ","strns":"¯","sub":"⊂","Sub":"⋐","subdot":"⪽","subE":"⫅","sube":"⊆","subedot":"⫃","submult":"⫁","subnE":"⫋","subne":"⊊","subplus":"⪿","subrarr":"⥹","subset":"⊂","Subset":"⋐","subseteq":"⊆","subseteqq":"⫅","SubsetEqual":"⊆","subsetneq":"⊊","subsetneqq":"⫋","subsim":"⫇","subsub":"⫕","subsup":"⫓","succapprox":"⪸","succ":"≻","succcurlyeq":"≽","Succeeds":"≻","SucceedsEqual":"⪰","SucceedsSlantEqual":"≽","SucceedsTilde":"≿","succeq":"⪰","succnapprox":"⪺","succneqq":"⪶","succnsim":"⋩","succsim":"≿","SuchThat":"∋","sum":"∑","Sum":"∑","sung":"♪","sup1":"¹","sup2":"²","sup3":"³","sup":"⊃","Sup":"⋑","supdot":"⪾","supdsub":"⫘","supE":"⫆","supe":"⊇","supedot":"⫄","Superset":"⊃","SupersetEqual":"⊇","suphsol":"⟉","suphsub":"⫗","suplarr":"⥻","supmult":"⫂","supnE":"⫌","supne":"⊋","supplus":"⫀","supset":"⊃","Supset":"⋑","supseteq":"⊇","supseteqq":"⫆","supsetneq":"⊋","supsetneqq":"⫌","supsim":"⫈","supsub":"⫔","supsup":"⫖","swarhk":"⤦","swarr":"↙","swArr":"⇙","swarrow":"↙","swnwar":"⤪","szlig":"ß","Tab":"\\t","target":"⌖","Tau":"Τ","tau":"τ","tbrk":"⎴","Tcaron":"Ť","tcaron":"ť","Tcedil":"Ţ","tcedil":"ţ","Tcy":"Т","tcy":"т","tdot":"⃛","telrec":"⌕","Tfr":"𝔗","tfr":"𝔱","there4":"∴","therefore":"∴","Therefore":"∴","Theta":"Θ","theta":"θ","thetasym":"ϑ","thetav":"ϑ","thickapprox":"≈","thicksim":"∼","ThickSpace":" ","ThinSpace":" ","thinsp":" ","thkap":"≈","thksim":"∼","THORN":"Þ","thorn":"þ","tilde":"˜","Tilde":"∼","TildeEqual":"≃","TildeFullEqual":"≅","TildeTilde":"≈","timesbar":"⨱","timesb":"⊠","times":"×","timesd":"⨰","tint":"∭","toea":"⤨","topbot":"⌶","topcir":"⫱","top":"⊤","Topf":"𝕋","topf":"𝕥","topfork":"⫚","tosa":"⤩","tprime":"‴","trade":"™","TRADE":"™","triangle":"▵","triangledown":"▿","triangleleft":"◃","trianglelefteq":"⊴","triangleq":"≜","triangleright":"▹","trianglerighteq":"⊵","tridot":"◬","trie":"≜","triminus":"⨺","TripleDot":"⃛","triplus":"⨹","trisb":"⧍","tritime":"⨻","trpezium":"⏢","Tscr":"𝒯","tscr":"𝓉","TScy":"Ц","tscy":"ц","TSHcy":"Ћ","tshcy":"ћ","Tstrok":"Ŧ","tstrok":"ŧ","twixt":"≬","twoheadleftarrow":"↞","twoheadrightarrow":"↠","Uacute":"Ú","uacute":"ú","uarr":"↑","Uarr":"↟","uArr":"⇑","Uarrocir":"⥉","Ubrcy":"Ў","ubrcy":"ў","Ubreve":"Ŭ","ubreve":"ŭ","Ucirc":"Û","ucirc":"û","Ucy":"У","ucy":"у","udarr":"⇅","Udblac":"Ű","udblac":"ű","udhar":"⥮","ufisht":"⥾","Ufr":"𝔘","ufr":"𝔲","Ugrave":"Ù","ugrave":"ù","uHar":"⥣","uharl":"↿","uharr":"↾","uhblk":"▀","ulcorn":"⌜","ulcorner":"⌜","ulcrop":"⌏","ultri":"◸","Umacr":"Ū","umacr":"ū","uml":"¨","UnderBar":"_","UnderBrace":"⏟","UnderBracket":"⎵","UnderParenthesis":"⏝","Union":"⋃","UnionPlus":"⊎","Uogon":"Ų","uogon":"ų","Uopf":"𝕌","uopf":"𝕦","UpArrowBar":"⤒","uparrow":"↑","UpArrow":"↑","Uparrow":"⇑","UpArrowDownArrow":"⇅","updownarrow":"↕","UpDownArrow":"↕","Updownarrow":"⇕","UpEquilibrium":"⥮","upharpoonleft":"↿","upharpoonright":"↾","uplus":"⊎","UpperLeftArrow":"↖","UpperRightArrow":"↗","upsi":"υ","Upsi":"ϒ","upsih":"ϒ","Upsilon":"Υ","upsilon":"υ","UpTeeArrow":"↥","UpTee":"⊥","upuparrows":"⇈","urcorn":"⌝","urcorner":"⌝","urcrop":"⌎","Uring":"Ů","uring":"ů","urtri":"◹","Uscr":"𝒰","uscr":"𝓊","utdot":"⋰","Utilde":"Ũ","utilde":"ũ","utri":"▵","utrif":"▴","uuarr":"⇈","Uuml":"Ü","uuml":"ü","uwangle":"⦧","vangrt":"⦜","varepsilon":"ϵ","varkappa":"ϰ","varnothing":"∅","varphi":"ϕ","varpi":"ϖ","varpropto":"∝","varr":"↕","vArr":"⇕","varrho":"ϱ","varsigma":"ς","varsubsetneq":"⊊︀","varsubsetneqq":"⫋︀","varsupsetneq":"⊋︀","varsupsetneqq":"⫌︀","vartheta":"ϑ","vartriangleleft":"⊲","vartriangleright":"⊳","vBar":"⫨","Vbar":"⫫","vBarv":"⫩","Vcy":"В","vcy":"в","vdash":"⊢","vDash":"⊨","Vdash":"⊩","VDash":"⊫","Vdashl":"⫦","veebar":"⊻","vee":"∨","Vee":"⋁","veeeq":"≚","vellip":"⋮","verbar":"|","Verbar":"‖","vert":"|","Vert":"‖","VerticalBar":"∣","VerticalLine":"|","VerticalSeparator":"❘","VerticalTilde":"≀","VeryThinSpace":" ","Vfr":"𝔙","vfr":"𝔳","vltri":"⊲","vnsub":"⊂⃒","vnsup":"⊃⃒","Vopf":"𝕍","vopf":"𝕧","vprop":"∝","vrtri":"⊳","Vscr":"𝒱","vscr":"𝓋","vsubnE":"⫋︀","vsubne":"⊊︀","vsupnE":"⫌︀","vsupne":"⊋︀","Vvdash":"⊪","vzigzag":"⦚","Wcirc":"Ŵ","wcirc":"ŵ","wedbar":"⩟","wedge":"∧","Wedge":"⋀","wedgeq":"≙","weierp":"℘","Wfr":"𝔚","wfr":"𝔴","Wopf":"𝕎","wopf":"𝕨","wp":"℘","wr":"≀","wreath":"≀","Wscr":"𝒲","wscr":"𝓌","xcap":"⋂","xcirc":"◯","xcup":"⋃","xdtri":"▽","Xfr":"𝔛","xfr":"𝔵","xharr":"⟷","xhArr":"⟺","Xi":"Ξ","xi":"ξ","xlarr":"⟵","xlArr":"⟸","xmap":"⟼","xnis":"⋻","xodot":"⨀","Xopf":"𝕏","xopf":"𝕩","xoplus":"⨁","xotime":"⨂","xrarr":"⟶","xrArr":"⟹","Xscr":"𝒳","xscr":"𝓍","xsqcup":"⨆","xuplus":"⨄","xutri":"△","xvee":"⋁","xwedge":"⋀","Yacute":"Ý","yacute":"ý","YAcy":"Я","yacy":"я","Ycirc":"Ŷ","ycirc":"ŷ","Ycy":"Ы","ycy":"ы","yen":"¥","Yfr":"𝔜","yfr":"𝔶","YIcy":"Ї","yicy":"ї","Yopf":"𝕐","yopf":"𝕪","Yscr":"𝒴","yscr":"𝓎","YUcy":"Ю","yucy":"ю","yuml":"ÿ","Yuml":"Ÿ","Zacute":"Ź","zacute":"ź","Zcaron":"Ž","zcaron":"ž","Zcy":"З","zcy":"з","Zdot":"Ż","zdot":"ż","zeetrf":"ℨ","ZeroWidthSpace":"","Zeta":"Ζ","zeta":"ζ","zfr":"𝔷","Zfr":"ℨ","ZHcy":"Ж","zhcy":"ж","zigrarr":"⇝","zopf":"𝕫","Zopf":"ℤ","Zscr":"𝒵","zscr":"𝓏","zwj":"","zwnj":""}');},/* 262 *//***/function(i){i.exports=JSON.parse('{"Aacute":"Á","aacute":"á","Acirc":"Â","acirc":"â","acute":"´","AElig":"Æ","aelig":"æ","Agrave":"À","agrave":"à","amp":"&","AMP":"&","Aring":"Å","aring":"å","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","brvbar":"¦","Ccedil":"Ç","ccedil":"ç","cedil":"¸","cent":"¢","copy":"©","COPY":"©","curren":"¤","deg":"°","divide":"÷","Eacute":"É","eacute":"é","Ecirc":"Ê","ecirc":"ê","Egrave":"È","egrave":"è","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","frac12":"½","frac14":"¼","frac34":"¾","gt":">","GT":">","Iacute":"Í","iacute":"í","Icirc":"Î","icirc":"î","iexcl":"¡","Igrave":"Ì","igrave":"ì","iquest":"¿","Iuml":"Ï","iuml":"ï","laquo":"«","lt":"<","LT":"<","macr":"¯","micro":"µ","middot":"·","nbsp":" ","not":"¬","Ntilde":"Ñ","ntilde":"ñ","Oacute":"Ó","oacute":"ó","Ocirc":"Ô","ocirc":"ô","Ograve":"Ò","ograve":"ò","ordf":"ª","ordm":"º","Oslash":"Ø","oslash":"ø","Otilde":"Õ","otilde":"õ","Ouml":"Ö","ouml":"ö","para":"¶","plusmn":"±","pound":"£","quot":"\\"","QUOT":"\\"","raquo":"»","reg":"®","REG":"®","sect":"§","shy":"","sup1":"¹","sup2":"²","sup3":"³","szlig":"ß","THORN":"Þ","thorn":"þ","times":"×","Uacute":"Ú","uacute":"ú","Ucirc":"Û","ucirc":"û","Ugrave":"Ù","ugrave":"ù","uml":"¨","Uuml":"Ü","uuml":"ü","Yacute":"Ý","yacute":"ý","yen":"¥","yuml":"ÿ"}');},/* 263 *//***/function(i){i.exports=JSON.parse("{\"amp\":\"&\",\"apos\":\"'\",\"gt\":\">\",\"lt\":\"<\",\"quot\":\"\\\"\"}");},/* 264 *//***/function(i,e,t){var r=this&&this.__importDefault||function(c){return c&&c.__esModule?c:{"default":c};};Object.defineProperty(e,"__esModule",{value:!0});var n=r(t(265));function s(c){if(c>=55296&&c<=57343||c>1114111)return"�";c in n["default"]&&(c=n["default"][c]);var l="";return c>65535&&(c-=65536,l+=String.fromCharCode(c>>>10&1023|55296),c=56320|c&1023),l+=String.fromCharCode(c),l;}e["default"]=s;},/* 265 *//***/function(i){i.exports=JSON.parse('{"0":65533,"128":8364,"130":8218,"131":402,"132":8222,"133":8230,"134":8224,"135":8225,"136":710,"137":8240,"138":352,"139":8249,"140":338,"142":381,"145":8216,"146":8217,"147":8220,"148":8221,"149":8226,"150":8211,"151":8212,"152":732,"153":8482,"154":353,"155":8250,"156":339,"158":382,"159":376}');},/* 266 *//***/function(i,e,t){var r=this&&this.__importDefault||function(w){return w&&w.__esModule?w:{"default":w};};Object.defineProperty(e,"__esModule",{value:!0}),e.escape=e.encodeHTML=e.encodeXML=void 0;var n=r(t(263)),s=v(n["default"]),c=h(s);e.encodeXML=O(s,c);var l=r(t(261)),f=v(l["default"]),u=h(f);e.encodeHTML=O(f,u);function v(w){return Object.keys(w).sort().reduce(function(d,m){return d[w[m]]="&"+m+";",d;},{});}function h(w){for(var d=[],m=[],p=0,S=Object.keys(w);p<S.length;p++){var E=S[p];E.length===1?d.push("\\"+E):m.push(E);}d.sort();for(var R=0;R<d.length-1;R++){for(var D=R;D<d.length-1&&d[D].charCodeAt(1)+1===d[D+1].charCodeAt(1);)D+=1;var U=1+D-R;U<3||d.splice(R,U,d[R]+"-"+d[D]);}return m.unshift("["+d.join("")+"]"),new RegExp(m.join("|"),"g");}var y=/(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g;function T(w){return"&#x"+w.codePointAt(0).toString(16).toUpperCase()+";";}function O(w,d){return function(m){return m.replace(d,function(p){return w[p];}).replace(y,T);};}var I=h(s);function P(w){return w.replace(I,T).replace(y,T);}e.escape=P;},/* 267 *//***/function(i){i.exports=JSON.parse('{"elementNames":{"altglyph":"altGlyph","altglyphdef":"altGlyphDef","altglyphitem":"altGlyphItem","animatecolor":"animateColor","animatemotion":"animateMotion","animatetransform":"animateTransform","clippath":"clipPath","feblend":"feBlend","fecolormatrix":"feColorMatrix","fecomponenttransfer":"feComponentTransfer","fecomposite":"feComposite","feconvolvematrix":"feConvolveMatrix","fediffuselighting":"feDiffuseLighting","fedisplacementmap":"feDisplacementMap","fedistantlight":"feDistantLight","fedropshadow":"feDropShadow","feflood":"feFlood","fefunca":"feFuncA","fefuncb":"feFuncB","fefuncg":"feFuncG","fefuncr":"feFuncR","fegaussianblur":"feGaussianBlur","feimage":"feImage","femerge":"feMerge","femergenode":"feMergeNode","femorphology":"feMorphology","feoffset":"feOffset","fepointlight":"fePointLight","fespecularlighting":"feSpecularLighting","fespotlight":"feSpotLight","fetile":"feTile","feturbulence":"feTurbulence","foreignobject":"foreignObject","glyphref":"glyphRef","lineargradient":"linearGradient","radialgradient":"radialGradient","textpath":"textPath"},"attributeNames":{"definitionurl":"definitionURL","attributename":"attributeName","attributetype":"attributeType","basefrequency":"baseFrequency","baseprofile":"baseProfile","calcmode":"calcMode","clippathunits":"clipPathUnits","diffuseconstant":"diffuseConstant","edgemode":"edgeMode","filterunits":"filterUnits","glyphref":"glyphRef","gradienttransform":"gradientTransform","gradientunits":"gradientUnits","kernelmatrix":"kernelMatrix","kernelunitlength":"kernelUnitLength","keypoints":"keyPoints","keysplines":"keySplines","keytimes":"keyTimes","lengthadjust":"lengthAdjust","limitingconeangle":"limitingConeAngle","markerheight":"markerHeight","markerunits":"markerUnits","markerwidth":"markerWidth","maskcontentunits":"maskContentUnits","maskunits":"maskUnits","numoctaves":"numOctaves","pathlength":"pathLength","patterncontentunits":"patternContentUnits","patterntransform":"patternTransform","patternunits":"patternUnits","pointsatx":"pointsAtX","pointsaty":"pointsAtY","pointsatz":"pointsAtZ","preservealpha":"preserveAlpha","preserveaspectratio":"preserveAspectRatio","primitiveunits":"primitiveUnits","refx":"refX","refy":"refY","repeatcount":"repeatCount","repeatdur":"repeatDur","requiredextensions":"requiredExtensions","requiredfeatures":"requiredFeatures","specularconstant":"specularConstant","specularexponent":"specularExponent","spreadmethod":"spreadMethod","startoffset":"startOffset","stddeviation":"stdDeviation","stitchtiles":"stitchTiles","surfacescale":"surfaceScale","systemlanguage":"systemLanguage","tablevalues":"tableValues","targetx":"targetX","targety":"targetY","textlength":"textLength","viewbox":"viewBox","viewtarget":"viewTarget","xchannelselector":"xChannelSelector","ychannelselector":"yChannelSelector","zoomandpan":"zoomAndPan"}}');},/* 268 *//***/function(i,e){var t=e.getChildren=function(n){return n.children;},r=e.getParent=function(n){return n.parent;};e.getSiblings=function(n){var s=r(n);return s?t(s):[n];},e.getAttributeValue=function(n,s){return n.attribs&&n.attribs[s];},e.hasAttrib=function(n,s){return!!n.attribs&&hasOwnProperty.call(n.attribs,s);},e.getName=function(n){return n.name;};},/* 269 *//***/function(i,e){e.removeElement=function(t){if(t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t.parent){var r=t.parent.children;r.splice(r.lastIndexOf(t),1);}},e.replaceElement=function(t,r){var n=r.prev=t.prev;n&&(n.next=r);var s=r.next=t.next;s&&(s.prev=r);var c=r.parent=t.parent;if(c){var l=c.children;l[l.lastIndexOf(t)]=r;}},e.appendChild=function(t,r){if(r.parent=t,t.children.push(r)!==1){var n=t.children[t.children.length-2];n.next=r,r.prev=n,r.next=null;}},e.append=function(t,r){var n=t.parent,s=t.next;if(r.next=s,r.prev=t,t.next=r,r.parent=n,s){if(s.prev=r,n){var c=n.children;c.splice(c.lastIndexOf(s),0,r);}}else n&&n.children.push(r);},e.prepend=function(t,r){var n=t.parent;if(n){var s=n.children;s.splice(s.lastIndexOf(t),0,r);}t.prev&&(t.prev.next=r),r.parent=n,r.prev=t.prev,r.next=t,t.prev=r;};},/* 270 *//***/function(i,e,t){var r=t(256).isTag;i.exports={filter:n,find:s,findOneChild:c,findOne:l,existsOne:f,findAll:u};function n(v,h,y,T){return Array.isArray(h)||(h=[h]),(typeof T!="number"||!isFinite(T))&&(T=1/0),s(v,h,y!==!1,T);}function s(v,h,y,T){for(var O=[],I,P=0,w=h.length;P<w&&!(v(h[P])&&(O.push(h[P]),--T<=0)||(I=h[P].children,y&&I&&I.length>0&&(I=s(v,I,y,T),O=O.concat(I),T-=I.length,T<=0)));P++);return O;}function c(v,h){for(var y=0,T=h.length;y<T;y++)if(v(h[y]))return h[y];return null;}function l(v,h){for(var y=null,T=0,O=h.length;T<O&&!y;T++)if(r(h[T]))v(h[T])?y=h[T]:h[T].children.length>0&&(y=l(v,h[T].children));else continue;return y;}function f(v,h){for(var y=0,T=h.length;y<T;y++)if(r(h[y])&&(v(h[y])||h[y].children.length>0&&f(v,h[y].children)))return!0;return!1;}function u(v,h){for(var y=[],T=h.slice();T.length;){var O=T.shift();r(O)&&(O.children&&O.children.length>0&&T.unshift.apply(T,O.children),v(O)&&y.push(O));}return y;}},/* 271 *//***/function(i,e,t){var r=t(256),n=e.isTag=r.isTag;e.testElement=function(f,u){for(var v in f)if(f.hasOwnProperty(v)){if(v==="tag_name"){if(!n(u)||!f.tag_name(u.name))return!1;}else if(v==="tag_type"){if(!f.tag_type(u.type))return!1;}else if(v==="tag_contains"){if(n(u)||!f.tag_contains(u.data))return!1;}else if(!u.attribs||!f[v](u.attribs[v]))return!1;}return!0;};var s={tag_name:function tag_name(f){return typeof f=="function"?function(u){return n(u)&&f(u.name);}:f==="*"?n:function(u){return n(u)&&u.name===f;};},tag_type:function tag_type(f){return typeof f=="function"?function(u){return f(u.type);}:function(u){return u.type===f;};},tag_contains:function tag_contains(f){return typeof f=="function"?function(u){return!n(u)&&f(u.data);}:function(u){return!n(u)&&u.data===f;};}};function c(f,u){return typeof u=="function"?function(v){return v.attribs&&u(v.attribs[f]);}:function(v){return v.attribs&&v.attribs[f]===u;};}function l(f,u){return function(v){return f(v)||u(v);};}e.getElements=function(f,u,v,h){var y=Object.keys(f).map(function(T){var O=f[T];return T in s?s[T](O):c(T,O);});return y.length===0?[]:this.filter(y.reduce(l),u,v,h);},e.getElementById=function(f,u,v){return Array.isArray(u)||(u=[u]),this.findOne(c("id",f),u,v!==!1);},e.getElementsByTagName=function(f,u,v,h){return this.filter(s.tag_name(f),u,v,h);},e.getElementsByTagType=function(f,u,v,h){return this.filter(s.tag_type(f),u,v,h);};},/* 272 *//***/function(i,e){e.removeSubsets=function(n){for(var s=n.length,c,l,f;--s>-1;){for(c=l=n[s],n[s]=null,f=!0;l;){if(n.indexOf(l)>-1){f=!1,n.splice(s,1);break;}l=l.parent;}f&&(n[s]=c);}return n;};var t={DISCONNECTED:1,PRECEDING:2,FOLLOWING:4,CONTAINS:8,CONTAINED_BY:16},r=e.compareDocumentPosition=function(n,s){var c=[],l=[],f,u,v,h,y,T;if(n===s)return 0;for(f=n;f;)c.unshift(f),f=f.parent;for(f=s;f;)l.unshift(f),f=f.parent;for(T=0;c[T]===l[T];)T++;return T===0?t.DISCONNECTED:(u=c[T-1],v=u.children,h=c[T],y=l[T],v.indexOf(h)>v.indexOf(y)?u===s?t.FOLLOWING|t.CONTAINED_BY:t.FOLLOWING:u===n?t.PRECEDING|t.CONTAINS:t.PRECEDING);};e.uniqueSort=function(n){var s=n.length,c,l;for(n=n.slice();--s>-1;)c=n[s],l=n.indexOf(c),l>-1&&l<s&&n.splice(s,1);return n.sort(function(f,u){var v=r(f,u);return v&t.PRECEDING?-1:v&t.FOLLOWING?1:0;}),n;};},/* 273 *//***/function(i,e){i.exports={trueFunc:function trueFunc(){return!0;},falseFunc:function falseFunc(){return!1;}};},/* 274 *//***/function(i,e,t){i.exports=y;var r=t(275).parse,n=t(273),s=t(278),c=t(279),l=t(280),f=t(282),u=n.trueFunc,v=n.falseFunc,h=f.filters;function y(M,W,$){var B=O(M,W,$);return T(B,W);}function T(M,W){var $=W.adapter;return function(N){return $.isTag(N)&&M(N);};}function O(M,W,$){var B=r(M,W);return S(B,W,$);}function I(M){return M.type==="pseudo"&&(M.name==="scope"||Array.isArray(M.data)&&M.data.some(function(W){return W.some(I);}));}var P={type:"descendant"},w={type:"_flexibleDescendant"},d={type:"pseudo",name:"scope"},m={};function p(M,W,$){var B=W.adapter,N=!!$&&!!$.length&&$.every(function(z){return z===m||!!B.getParent(z);});M.forEach(function(z){if(!(z.length>0&&E(z[0])&&z[0].type!=="descendant"))if(N&&!(Array.isArray(z)?z.some(I):I(z)))z.unshift(P);else return;z.unshift(d);});}function S(M,W,$){M=M.filter(function(J){return J.length>0;}),M.forEach(s);var B=Array.isArray($);$=W&&W.context||$,$&&!B&&($=[$]),p(M,W,$);var N=!1,z=M.map(function(J){if(J[0]&&J[1]&&J[0].name==="scope"){var et=J[1].type;B&&et==="descendant"?J[1]=w:(et==="adjacent"||et==="sibling")&&(N=!0);}return R(J,W,$);}).reduce(D,v);return z.shouldTestNextSiblings=N,z;}function E(M){return c[M.type]<0;}function R(M,W,$){return M.reduce(function(B,N){if(B===v)return B;if(!(N.type in l))throw new Error("Rule type "+N.type+" is not supported by css-select");return l[N.type](B,N,W,$);},W&&W.rootFunc||u);}function D(M,W){return W===v||M===u?M:M===v||W===u?W:function(B){return M(B)||W(B);};}function U(M){return M.some(E);}h.not=function(M,W,$,B){var N={xmlMode:!!($&&$.xmlMode),strict:!!($&&$.strict),adapter:$.adapter};if(N.strict&&(W.length>1||W.some(U)))throw new Error("complex selectors in :not aren't allowed in strict mode");var z=S(W,N,B);return z===v?M:z===u?v:function(et){return!z(et)&&M(et);};},h.has=function(M,W,$){var B=$.adapter,N={xmlMode:!!($&&$.xmlMode),strict:!!($&&$.strict),adapter:B},z=W.some(U)?[m]:null,J=S(W,N,z);return J===v?v:J===u?function(at){return B.getChildren(at).some(B.isTag)&&M(at);}:(J=T(J,$),z?function(at){return M(at)&&(z[0]=at,B.existsOne(J,B.getChildren(at)));}:function(at){return M(at)&&B.existsOne(J,B.getChildren(at));});},h.matches=function(M,W,$,B){var N={xmlMode:!!($&&$.xmlMode),strict:!!($&&$.strict),rootFunc:M,adapter:$.adapter};return S(W,N,B);},y.compileToken=S,y.compileUnsafe=O,y.Pseudos=f;},/* 275 *//***/function(i,e,t){var r=this&&this.__createBinding||(Object.create?function(l,f,u,v){v===void 0&&(v=u),Object.defineProperty(l,v,{enumerable:!0,get:function get(){return f[u];}});}:function(l,f,u,v){v===void 0&&(v=u),l[v]=f[u];}),n=this&&this.__exportStar||function(l,f){for(var u in l)u!=="default"&&!f.hasOwnProperty(u)&&r(f,l,u);};Object.defineProperty(e,"__esModule",{value:!0}),n(t(276),e);var s=t(276);Object.defineProperty(e,"parse",{enumerable:!0,get:function get(){return s["default"];}});var c=t(277);Object.defineProperty(e,"stringify",{enumerable:!0,get:function get(){return c["default"];}});},/* 276 *//***/function(i,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=I;var r=/^[^\\]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/,n=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,s=/^\s*((?:\\.|[\w\u00b0-\uFFFF-])+)\s*(?:(\S?)=\s*(?:(['"])([^]*?)\3|(#?(?:\\.|[\w\u00b0-\uFFFF-])*)|)|)\s*(i)?\]/,c={undefined:"exists","":"equals","~":"element","^":"start",$:"end","*":"any","!":"not","|":"hyphen"},l={">":"child","<":"parent","~":"sibling","+":"adjacent"},f={"#":["id","equals"],".":["class","element"]},u=/* @__PURE__ */new Set(["has","not","matches"]),v=/* @__PURE__ */new Set(["contains","icontains"]),h=/* @__PURE__ */new Set(['"',"'"]);function y(d,m,p){var S=parseInt(m,16)-65536;return S!==S||p?m:S<0?// BMP codepoint
|
|
321
|
+
String.fromCharCode(S+65536):// Supplemental Plane codepoint (surrogate pair)
|
|
322
|
+
String.fromCharCode(S>>10|55296,S&1023|56320);}function T(d){return d.replace(n,y);}function O(d){return d===" "||d==="\n"||d===" "||d==="\f"||d==="\r";}function I(d,m){var p=[];if(d=P(p,""+d,m),d!=="")throw new Error("Unmatched selector: "+d);return p;}function P(d,m,p){var S=[],E=!1;function R(){var ft=m.match(r);if(!ft)throw new Error("Expected name, found "+m);var mt=ft[0];return m=m.substr(mt.length),T(mt);}function D(ft){for(;O(m.charAt(ft));)ft++;m=m.substr(ft);}function U(ft){for(var mt=0;m.charAt(--ft)==="\\";)mt++;return(mt&1)===1;}for(D(0);m!=="";){var M=m.charAt(0);if(O(M))E=!0,D(1);else if(M in l)S.push({type:l[M]}),E=!1,D(1);else if(M===","){if(S.length===0)throw new Error("Empty sub-selector");d.push(S),S=[],E=!1,D(1);}else if(E&&(S.length>0&&S.push({type:"descendant"}),E=!1),M==="*")m=m.substr(1),S.push({type:"universal"});else if(M in f){var W=f[M],$=W[0],B=W[1];m=m.substr(1),S.push({type:"attribute",name:$,action:B,value:R(),ignoreCase:!1});}else if(M==="["){m=m.substr(1);var N=m.match(s);if(!N)throw new Error("Malformed attribute selector: "+m);m=m.substr(N[0].length);var z=T(N[1]);(!p||("lowerCaseAttributeNames"in p?p.lowerCaseAttributeNames:!p.xmlMode))&&(z=z.toLowerCase()),S.push({type:"attribute",name:z,action:c[N[2]],value:T(N[4]||N[5]||""),ignoreCase:!!N[6]});}else if(M===":"){if(m.charAt(1)===":"){m=m.substr(2),S.push({type:"pseudo-element",name:R().toLowerCase()});continue;}m=m.substr(1);var J=R().toLowerCase(),N=null;if(m.charAt(0)==="(")if(u.has(J)){var et=m.charAt(1),at=h.has(et);if(m=m.substr(at?2:1),N=[],m=P(N,m,p),at){if(m.charAt(0)!==et)throw new Error("Unmatched quotes in :"+J);m=m.substr(1);}if(m.charAt(0)!==")")throw new Error("Missing closing parenthesis in :"+J+" ("+m+")");m=m.substr(1);}else{for(var ct=1,V=1;V>0&&ct<m.length;ct++)m.charAt(ct)==="("&&!U(ct)?V++:m.charAt(ct)===")"&&!U(ct)&&V--;if(V)throw new Error("Parenthesis not matched");if(N=m.substr(1,ct-2),m=m.substr(ct),v.has(J)){var et=N.charAt(0);et===N.slice(-1)&&h.has(et)&&(N=N.slice(1,-1)),N=T(N);}}S.push({type:"pseudo",name:J,data:N});}else if(r.test(m)){var Q=R();(!p||("lowerCaseTags"in p?p.lowerCaseTags:!p.xmlMode))&&(Q=Q.toLowerCase()),S.push({type:"tag",name:Q});}else return S.length&&S[S.length-1].type==="descendant"&&S.pop(),w(d,S),m;}return w(d,S),m;}function w(d,m){if(d.length>0&&m.length===0)throw new Error("Empty sub-selector");d.push(m);}},/* 277 *//***/function(i,e,t){Object.defineProperty(e,"__esModule",{value:!0});var r={equals:"",element:"~",start:"^",end:"$",any:"*",not:"!",hyphen:"|"};function n(f){return f.map(s).join(", ");}e["default"]=n;function s(f){return f.map(c).join("");}function c(f){switch(f.type){case"child":return" > ";case"parent":return" < ";case"sibling":return" ~ ";case"adjacent":return" + ";case"descendant":return" ";case"universal":return"*";case"tag":return f.name;case"pseudo-element":return"::"+f.name;case"pseudo":return f.data===null?":"+f.name:typeof f.data=="string"?":"+f.name+"("+f.data+")":":"+f.name+"("+n(f.data)+")";case"attribute":return f.action==="exists"?"["+f.name+"]":f.name==="id"&&f.action==="equals"&&!f.ignoreCase?"#"+f.value:f.name==="class"&&f.action==="element"&&!f.ignoreCase?"."+f.value:"["+f.name+r[f.action]+"='"+f.value+"'"+(f.ignoreCase?"i":"")+"]";default:throw new Error("Unknown type");}}function l(f){return f;}},/* 278 *//***/function(i,e,t){i.exports=s;var r=t(279),n={__proto__:null,exists:10,equals:8,not:7,start:6,end:6,any:5,hyphen:4,element:4};function s(l){for(var f=l.map(c),u=1;u<l.length;u++){var v=f[u];if(!(v<0))for(var h=u-1;h>=0&&v<f[h];h--){var y=l[h+1];l[h+1]=l[h],l[h]=y,f[h+1]=f[h],f[h]=v;}}}function c(l){var f=r[l.type];if(f===r.attribute)f=n[l.action],f===n.equals&&l.name==="id"&&(f=9),l.ignoreCase&&(f>>=1);else if(f===r.pseudo)if(!l.data)f=3;else if(l.name==="has"||l.name==="contains")f=0;else if(l.name==="matches"||l.name==="not"){f=0;for(var u=0;u<l.data.length;u++)if(l.data[u].length===1){var v=c(l.data[u][0]);if(v===0){f=0;break;}v>f&&(f=v);}l.data.length>1&&f>0&&(f-=1);}else f=1;return f;}},/* 279 *//***/function(i){i.exports=JSON.parse('{"universal":50,"tag":30,"attribute":1,"pseudo":0,"descendant":-1,"child":-1,"parent":-1,"sibling":-1,"adjacent":-1}');},/* 280 *//***/function(i,e,t){var r=t(281),n=t(282);i.exports={__proto__:null,attribute:r.compile,pseudo:n.compile,//tags
|
|
323
|
+
tag:function tag(s,c,l){var f=c.name,u=l.adapter;return function(h){return u.getName(h)===f&&s(h);};},//traversal
|
|
324
|
+
descendant:function descendant(s,c,l){var f=(typeof WeakSet==="undefined"?"undefined":_typeof(WeakSet))<"u"?/* @__PURE__ */new WeakSet():null,u=l.adapter;return function(h){for(var y=!1;!y&&(h=u.getParent(h));)(!f||!f.has(h))&&(y=s(h),!y&&f&&f.add(h));return y;};},_flexibleDescendant:function _flexibleDescendant(s,c,l){var f=l.adapter;return function(v){for(var h=s(v);!h&&(v=f.getParent(v));)h=s(v);return h;};},parent:function parent(s,c,l){if(l&&l.strict)throw new Error("Parent selector isn't part of CSS3");var f=l.adapter;return function(h){return f.getChildren(h).some(u);};function u(v){return f.isTag(v)&&s(v);}},child:function child(s,c,l){var f=l.adapter;return function(v){var h=f.getParent(v);return!!h&&s(h);};},sibling:function sibling(s,c,l){var f=l.adapter;return function(v){for(var h=f.getSiblings(v),y=0;y<h.length;y++)if(f.isTag(h[y])){if(h[y]===v)break;if(s(h[y]))return!0;}return!1;};},adjacent:function adjacent(s,c,l){var f=l.adapter;return function(v){for(var h=f.getSiblings(v),y,T=0;T<h.length;T++)if(f.isTag(h[T])){if(h[T]===v)break;y=h[T];}return!!y&&s(y);};},universal:function universal(s){return s;}};},/* 281 *//***/function(i,e,t){var r=t(273).falseFunc,n=/[-[\]{}()*+?.,\\^$|#\s]/g,s={__proto__:null,equals:function equals(c,l,f){var u=l.name,v=l.value,h=f.adapter;return l.ignoreCase?(v=v.toLowerCase(),function(T){var O=h.getAttributeValue(T,u);return O!=null&&O.toLowerCase()===v&&c(T);}):function(T){return h.getAttributeValue(T,u)===v&&c(T);};},hyphen:function hyphen(c,l,f){var u=l.name,v=l.value,h=v.length,y=f.adapter;return l.ignoreCase?(v=v.toLowerCase(),function(O){var I=y.getAttributeValue(O,u);return I!=null&&(I.length===h||I.charAt(h)==="-")&&I.substr(0,h).toLowerCase()===v&&c(O);}):function(O){var I=y.getAttributeValue(O,u);return I!=null&&I.substr(0,h)===v&&(I.length===h||I.charAt(h)==="-")&&c(O);};},element:function element(c,l,f){var u=l.name,v=l.value,h=f.adapter;if(/\s/.test(v))return r;v=v.replace(n,"\\$&");var y="(?:^|\\s)"+v+"(?:$|\\s)",T=l.ignoreCase?"i":"",O=new RegExp(y,T);return function(P){var w=h.getAttributeValue(P,u);return w!=null&&O.test(w)&&c(P);};},exists:function exists(c,l,f){var u=l.name,v=f.adapter;return function(y){return v.hasAttrib(y,u)&&c(y);};},start:function start(c,l,f){var u=l.name,v=l.value,h=v.length,y=f.adapter;return h===0?r:l.ignoreCase?(v=v.toLowerCase(),function(O){var I=y.getAttributeValue(O,u);return I!=null&&I.substr(0,h).toLowerCase()===v&&c(O);}):function(O){var I=y.getAttributeValue(O,u);return I!=null&&I.substr(0,h)===v&&c(O);};},end:function end(c,l,f){var u=l.name,v=l.value,h=-v.length,y=f.adapter;return h===0?r:l.ignoreCase?(v=v.toLowerCase(),function(O){var I=y.getAttributeValue(O,u);return I!=null&&I.substr(h).toLowerCase()===v&&c(O);}):function(O){var I=y.getAttributeValue(O,u);return I!=null&&I.substr(h)===v&&c(O);};},any:function any(c,l,f){var u=l.name,v=l.value,h=f.adapter;if(v==="")return r;if(l.ignoreCase){var y=new RegExp(v.replace(n,"\\$&"),"i");return function(O){var I=h.getAttributeValue(O,u);return I!=null&&y.test(I)&&c(O);};}return function(O){var I=h.getAttributeValue(O,u);return I!=null&&I.indexOf(v)>=0&&c(O);};},not:function not(c,l,f){var u=l.name,v=l.value,h=f.adapter;return v===""?function(T){return!!h.getAttributeValue(T,u)&&c(T);}:l.ignoreCase?(v=v.toLowerCase(),function(T){var O=h.getAttributeValue(T,u);return O!=null&&O.toLowerCase()!==v&&c(T);}):function(T){return h.getAttributeValue(T,u)!==v&&c(T);};}};i.exports={compile:function compile(c,l,f){if(f&&f.strict&&(l.ignoreCase||l.action==="not"))throw new Error("Unsupported attribute selector");return s[l.action](c,l,f);},rules:s};},/* 282 *//***/function(i,e,t){var r=t(283),n=t(273),s=t(281),c=n.trueFunc,l=n.falseFunc,f=s.rules.equals;function u(w,d){var m={name:w,value:d};return function(S,E,R){return f(S,m,R);};}function v(w,d){return function(m){return!!d.getParent(m)&&w(m);};}var h={contains:function contains(w,d,m){var p=m.adapter;return function(E){return w(E)&&p.getText(E).indexOf(d)>=0;};},icontains:function icontains(w,d,m){var p=d.toLowerCase(),S=m.adapter;return function(R){return w(R)&&S.getText(R).toLowerCase().indexOf(p)>=0;};},//location specific methods
|
|
325
|
+
"nth-child":function nthChild(w,d,m){var p=r(d),S=m.adapter;return p===l?p:p===c?v(w,S):function(R){for(var D=S.getSiblings(R),U=0,M=0;U<D.length;U++)if(S.isTag(D[U])){if(D[U]===R)break;M++;}return p(M)&&w(R);};},"nth-last-child":function nthLastChild(w,d,m){var p=r(d),S=m.adapter;return p===l?p:p===c?v(w,S):function(R){for(var D=S.getSiblings(R),U=0,M=D.length-1;M>=0;M--)if(S.isTag(D[M])){if(D[M]===R)break;U++;}return p(U)&&w(R);};},"nth-of-type":function nthOfType(w,d,m){var p=r(d),S=m.adapter;return p===l?p:p===c?v(w,S):function(R){for(var D=S.getSiblings(R),U=0,M=0;M<D.length;M++)if(S.isTag(D[M])){if(D[M]===R)break;S.getName(D[M])===S.getName(R)&&U++;}return p(U)&&w(R);};},"nth-last-of-type":function nthLastOfType(w,d,m){var p=r(d),S=m.adapter;return p===l?p:p===c?v(w,S):function(R){for(var D=S.getSiblings(R),U=0,M=D.length-1;M>=0;M--)if(S.isTag(D[M])){if(D[M]===R)break;S.getName(D[M])===S.getName(R)&&U++;}return p(U)&&w(R);};},//TODO determine the actual root element
|
|
326
|
+
root:function root(w,d,m){var p=m.adapter;return function(S){return!p.getParent(S)&&w(S);};},scope:function scope(w,d,m,p){var S=m.adapter;if(!p||p.length===0)return h.root(w,d,m);function E(R,D){return typeof S.equals=="function"?S.equals(R,D):R===D;}return p.length===1?function(R){return E(p[0],R)&&w(R);}:function(R){return p.indexOf(R)>=0&&w(R);};},//jQuery extensions (others follow as pseudos)
|
|
327
|
+
checkbox:u("type","checkbox"),file:u("type","file"),password:u("type","password"),radio:u("type","radio"),reset:u("type","reset"),image:u("type","image"),submit:u("type","submit"),//dynamic state pseudos. These depend on optional Adapter methods.
|
|
328
|
+
hover:function hover(w,d,m){var p=m.adapter;return typeof p.isHovered=="function"?function(E){return w(E)&&p.isHovered(E);}:l;},visited:function visited(w,d,m){var p=m.adapter;return typeof p.isVisited=="function"?function(E){return w(E)&&p.isVisited(E);}:l;},active:function active(w,d,m){var p=m.adapter;return typeof p.isActive=="function"?function(E){return w(E)&&p.isActive(E);}:l;}};function y(w,d){for(var m=0;w&&m<w.length;m++)if(d.isTag(w[m]))return w[m];}var T={empty:function empty(w,d){return!d.getChildren(w).some(function(m){return d.isTag(m)||m.type==="text";});},"first-child":function firstChild(w,d){return y(d.getSiblings(w),d)===w;},"last-child":function lastChild(w,d){for(var m=d.getSiblings(w),p=m.length-1;p>=0;p--){if(m[p]===w)return!0;if(d.isTag(m[p]))break;}return!1;},"first-of-type":function firstOfType(w,d){for(var m=d.getSiblings(w),p=0;p<m.length;p++)if(d.isTag(m[p])){if(m[p]===w)return!0;if(d.getName(m[p])===d.getName(w))break;}return!1;},"last-of-type":function lastOfType(w,d){for(var m=d.getSiblings(w),p=m.length-1;p>=0;p--)if(d.isTag(m[p])){if(m[p]===w)return!0;if(d.getName(m[p])===d.getName(w))break;}return!1;},"only-of-type":function onlyOfType(w,d){for(var m=d.getSiblings(w),p=0,S=m.length;p<S;p++)if(d.isTag(m[p])){if(m[p]===w)continue;if(d.getName(m[p])===d.getName(w))return!1;}return!0;},"only-child":function onlyChild(w,d){for(var m=d.getSiblings(w),p=0;p<m.length;p++)if(d.isTag(m[p])&&m[p]!==w)return!1;return!0;},//:matches(a, area, link)[href]
|
|
329
|
+
link:function link(w,d){return d.hasAttrib(w,"href");},//TODO: :any-link once the name is finalized (as an alias of :link)
|
|
330
|
+
//forms
|
|
331
|
+
//to consider: :target
|
|
332
|
+
//:matches([selected], select:not([multiple]):not(> option[selected]) > option:first-of-type)
|
|
333
|
+
selected:function selected(w,d){if(d.hasAttrib(w,"selected"))return!0;if(d.getName(w)!=="option")return!1;var m=d.getParent(w);if(!m||d.getName(m)!=="select"||d.hasAttrib(m,"multiple"))return!1;for(var p=d.getChildren(m),S=!1,E=0;E<p.length;E++)if(d.isTag(p[E]))if(p[E]===w)S=!0;else if(S){if(d.hasAttrib(p[E],"selected"))return!1;}else return!1;return S;},//https://html.spec.whatwg.org/multipage/scripting.html#disabled-elements
|
|
334
|
+
//:matches(
|
|
335
|
+
// :matches(button, input, select, textarea, menuitem, optgroup, option)[disabled],
|
|
336
|
+
// optgroup[disabled] > option),
|
|
337
|
+
// fieldset[disabled] * //TODO not child of first <legend>
|
|
338
|
+
//)
|
|
339
|
+
disabled:function disabled(w,d){return d.hasAttrib(w,"disabled");},enabled:function enabled(w,d){return!d.hasAttrib(w,"disabled");},//:matches(:matches(:radio, :checkbox)[checked], :selected) (TODO menuitem)
|
|
340
|
+
checked:function checked(w,d){return d.hasAttrib(w,"checked")||T.selected(w,d);},//:matches(input, select, textarea)[required]
|
|
341
|
+
required:function required(w,d){return d.hasAttrib(w,"required");},//:matches(input, select, textarea):not([required])
|
|
342
|
+
optional:function optional(w,d){return!d.hasAttrib(w,"required");},//jQuery extensions
|
|
343
|
+
//:not(:empty)
|
|
344
|
+
parent:function parent(w,d){return!T.empty(w,d);},//:matches(h1, h2, h3, h4, h5, h6)
|
|
345
|
+
header:O(["h1","h2","h3","h4","h5","h6"]),//:matches(button, input[type=button])
|
|
346
|
+
button:function button(w,d){var m=d.getName(w);return m==="button"||m==="input"&&d.getAttributeValue(w,"type")==="button";},//:matches(input, textarea, select, button)
|
|
347
|
+
input:O(["input","textarea","select","button"]),//input:matches(:not([type!='']), [type='text' i])
|
|
348
|
+
text:function text(w,d){var m;return d.getName(w)==="input"&&(!(m=d.getAttributeValue(w,"type"))||m.toLowerCase()==="text");}};function O(w){if((typeof Set==="undefined"?"undefined":_typeof(Set))<"u"){var d=new Set(w);return function(m,p){return d.has(p.getName(m));};}return function(m,p){return w.indexOf(p.getName(m))>=0;};}function I(w,d,m){if(m===null){if(w.length>2&&d!=="scope")throw new Error("pseudo-selector :"+d+" requires an argument");}else if(w.length===2)throw new Error("pseudo-selector :"+d+" doesn't have any arguments");}var P=/^(?:(?:nth|last|first|only)-(?:child|of-type)|root|empty|(?:en|dis)abled|checked|not)$/;i.exports={compile:function compile(w,d,m,p){var S=d.name,E=d.data,R=m.adapter;if(m&&m.strict&&!P.test(S))throw new Error(":"+S+" isn't part of CSS3");if(typeof h[S]=="function")return h[S](w,E,m,p);if(typeof T[S]=="function"){var D=T[S];return I(D,S,E),D===l?D:w===c?function(M){return D(M,R,E);}:function(M){return D(M,R,E)&&w(M);};}else throw new Error("unmatched pseudo-class :"+S);},filters:h,pseudos:T};},/* 283 *//***/function(i,e,t){var r=t(284),n=t(285);i.exports=function(c){return n(r(c));},i.exports.parse=r,i.exports.compile=n;},/* 284 *//***/function(i,e){i.exports=r;var t=/^([+\-]?\d*n)?\s*(?:([+\-]?)\s*(\d+))?$/;function r(n){if(n=n.trim().toLowerCase(),n==="even")return[2,0];if(n==="odd")return[2,1];var s=n.match(t);if(!s)throw new SyntaxError("n-th rule couldn't be parsed ('"+n+"')");var c;return s[1]?(c=parseInt(s[1],10),isNaN(c)&&(s[1].charAt(0)==="-"?c=-1:c=1)):c=0,[c,s[3]?parseInt((s[2]||"")+s[3],10):0];}},/* 285 *//***/function(i,e,t){i.exports=c;var r=t(273),n=r.trueFunc,s=r.falseFunc;function c(l){var f=l[0],u=l[1]-1;if(u<0&&f<=0)return s;if(f===-1)return function(h){return h<=u;};if(f===0)return function(h){return h===u;};if(f===1)return u<0?n:function(h){return h>=u;};var v=u%f;return v<0&&(v+=f),f>1?function(h){return h>=u&&h%f===v;}:(f*=-1,function(h){return h<=u&&h%f===v;});}},/* 286 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return E;});var r=t(12),n=t(74),s=t(1),c=t(68),l=t(250),f=t(213),u=t(218);t(1).glMatrix.setMatrixArrayType(Array);function v(R,D){if(R==null)return{};var U=h(R,D),M,W;if(Object.getOwnPropertySymbols){var $=Object.getOwnPropertySymbols(R);for(W=0;W<$.length;W++)M=$[W],!(D.indexOf(M)>=0)&&Object.prototype.propertyIsEnumerable.call(R,M)&&(U[M]=R[M]);}return U;}function h(R,D){if(R==null)return{};var U={},M=Object.keys(R),W,$;for($=0;$<M.length;$++)W=M[$],!(D.indexOf(W)>=0)&&(U[W]=R[W]);return U;}var y={antialias:!0,autoRender:!0,alpha:!0// for wx-miniprogram
|
|
349
|
+
},T=Symbol("autoRender"),O=Symbol("renderer"),I=Symbol("timeline"),P=Symbol("prepareRender"),w=Symbol("tickRender"),d=Symbol("pass"),m=Symbol("fbo"),p=Symbol("tickers"),S=Symbol("layerTransformInvert");var E=/*#__PURE__*/function(_l$default){function E(){var _this34;var D=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,E);if(_this34=_callSuper(this,E),!D.canvas){var _this34$getResolution=_this34.getResolution(),$=_this34$getResolution.width,B=_this34$getResolution.height,N=r.ENV.createCanvas($,B,{offscreen:!!D.offscreen,id:D.id,extra:D.extra});N.style&&(N.style.position="absolute"),N.dataset&&(N.dataset.layerId=D.id),N.contextType&&(D.contextType=N.contextType),D.canvas=N;}var U=D.canvas,M=Object.assign({},y,D);_this34[T]=M.autoRender,delete D.autoRender;var W=M.Renderer||r.Renderer;_this34[O]=new W(U,M),_this34.options=D,_this34.id=D.id,_this34[d]=[],_this34.setResolution(U),_this34.canvas=U,_this34[I]=new n.Timeline(),_this34.__mouseCapturedTarget=null,_this34[S]=null;return _this34;}_inherits(E,_l$default);return _createClass(E,[{key:"autoRender",get:function get(){return this[T];}},{key:"displayRatio",get:function get(){return this.parent&&this.parent.options?this.parent.options.displayRatio:1;}},{key:"height",get:function get(){var _this$getResolution=this.getResolution(),D=_this$getResolution.height;return D/this.displayRatio;}},{key:"gl",get:function get(){return this.renderer.glRenderer?this.renderer.glRenderer.gl:null;}/* override */},{key:"layer",get:function get(){return this;}},{key:"offscreen",get:function get(){return!!this.options.offscreen||this.canvas._offscreen;}},{key:"pass",get:function get(){return this[d];}},{key:"prepareRender",get:function get(){return this[P]?this[P]:Promise.resolve();}/* override */},{key:"renderer",get:function get(){return this[O];}},{key:"renderOffset",get:function get(){if(this.parent&&this.parent.options){var _this$parent$options=this.parent.options,D=_this$parent$options.left,U=_this$parent$options.top;return[D,U];}return[this.options.left|0,this.options.top|0];}},{key:"timeline",get:function get(){return this[I];}},{key:"width",get:function get(){var _this$getResolution2=this.getResolution(),D=_this$getResolution2.width;return D/this.displayRatio;}},{key:"localMatrix",get:function get(){var _this$attributes19=this.attributes,D=_this$attributes19.x,U=_this$attributes19.y;return[1,0,0,1,D,U];}},{key:"layerTransformInvert",get:function get(){if(this[S])return this[S];var D=this.transformMatrix;return D[0]===1&&D[1]===0&&D[2]===0&&D[3]===1&&D[4]===0&&D[5]===0?null:(this[S]=s.mat2d.invert(Array.of(0,0,0,0,0,0),D),this[S]);}},{key:"forceContextLoss",value:function forceContextLoss(){var D=this.renderer.glRenderer;if(D){var U=D.getExtension("WEBGL_lose_context");if(U)return U.loseContext(),!0;}return!1;}// isPointCollision(x, y) {
|
|
350
|
+
// return true;
|
|
351
|
+
// }
|
|
352
|
+
},{key:"addPass",value:function addPass(){var _ref147=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},D=_ref147.vertex,U=_ref147.fragment,M=_ref147.options,W=_ref147.uniforms;if(this.renderer.glRenderer){var _this$getResolution3=this.getResolution(),$=_this$getResolution3.width,B=_this$getResolution3.height,N=this.renderer.createPassProgram({vertex:D,fragment:U,options:M}),z=new r.Figure2D();z.rect(0,0,$/this.displayRatio,B/this.displayRatio);var J=new r.Mesh2D(z);return J.setUniforms(W),J.setProgram(N),this[d].push(J),this.forceUpdate(),J;}return null;}// delete unused texture to release memory.
|
|
353
|
+
},{key:"deleteTexture",value:function deleteTexture(D){return Object(u.deleteTexture)(D,this.renderer);}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(D){var U=D.type;if(U==="mousedown"||U==="mouseup"||U==="mousemove"){var N=this.__mouseCapturedTarget;if(N){if(N.layer===this)return N.dispatchEvent(D),!0;this.__mouseCapturedTarget=null;}}var M,W;var $=this.layerTransformInvert;if($){M=D.x,W=D.y;var _N6=$,z=_N6[0]*M+_N6[2]*W+_N6[4],J=_N6[1]*M+_N6[3]*W+_N6[5];delete D.x,delete D.y,delete D.layerX,delete D.layerY,Object.defineProperties(D,{layerX:{value:z,configurable:!0},layerY:{value:J,configurable:!0},x:{value:z,configurable:!0},y:{value:J,configurable:!0}});}var B=_superPropGet(E,"dispatchPointerEvent",this,3)([D]);return $&&Object.defineProperties(D,{layerX:{value:M,configurable:!0},layerY:{value:W,configurable:!0},x:{value:M,configurable:!0},y:{value:W,configurable:!0}}),B;}/* override */},{key:"forceUpdate",value:function forceUpdate(){var _this35=this;if(!this[P])if(this.parent&&this.parent.hasOffscreenCanvas){this.parent.forceUpdate();var D=null;var U=new Promise(function(M){D=M;});U._resolve=D,this[P]=U;}else{var _D2=null,_U8=null;var M=new Promise(function(W){_D2=W,_this35[T]&&(_U8=Object(c.requestAnimationFrame)(function(){delete M._requestID,_this35.render();}));});M._resolve=_D2,M._requestID=_U8,this[P]=M;}}},{key:"getFBO",value:function getFBO(){var D=this.renderer.glRenderer,_this$getResolution4=this.getResolution(),U=_this$getResolution4.width,M=_this$getResolution4.height;return D&&(!this[m]||this[m].width!==U||this[m].height!==M)?(this[m]={width:U,height:M,target:D.createFBO(),buffer:D.createFBO(),swap:function swap(){var _ref148=[this.buffer,this.target];this.target=_ref148[0];this.buffer=_ref148[1];}},this[m]):this[m]?this[m]:null;}},{key:"updateGlobalTransform",value:function updateGlobalTransform(){if(this.layerTransformInvert){var D=this.renderer,U=D.__globalTransformMatrix||D.globalTransformMatrix;D.__globalTransformMatrix=U;var M=s.mat2d.fromValues(1,0,0,1,0,0);D.setGlobalTransform.apply(D,_toConsumableArray(s.mat2d.multiply(M,U,this.transformMatrix)));}}/* override */},{key:"onPropertyChange",value:function onPropertyChange(D,U,M){if(_superPropGet(E,"onPropertyChange",this,3)([D,U,M]),D==="zIndex"&&(this.canvas.style.zIndex=U),D==="transform"||D==="translate"||D==="rotate"||D==="scale"||D==="skew"){var W=this[S];if(this[S]=null,this.updateGlobalTransform(),W&&!this.layerTransformInvert){var $=this.renderer,B=$.__globalTransformMatrix||$.globalTransformMatrix;$.setGlobalTransform.apply($,_toConsumableArray(B));}}}},{key:"_prepareRenderFinished",value:function _prepareRenderFinished(){this[P]&&(this[P]._requestID&&Object(c.cancelAnimationFrame)(this[P]._requestID),this[P]._resolve(),delete this[P]);}},{key:"render",value:function render(){var _this36=this;var _ref149=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref149$clear=_ref149.clear,D=_ref149$clear===void 0?!0:_ref149$clear;var U=this[d].length?this.getFBO():null;U&&this.renderer.glRenderer.bindFBO(U.target),D&&this[O].clear();var M=this.draw();if(M&&M.length&&(this.renderer.drawMeshes(M),this.canvas.draw&&this.canvas.draw()),U){var W=this.renderer.glRenderer,$=this[d].length,_this$getResolution5=this.getResolution(),B=_this$getResolution5.width,N=_this$getResolution5.height,z=[0,0,B/this.displayRatio,N/this.displayRatio];this[d].forEach(function(J,et){J.blend=!0,J.setTexture(U.target.texture,{rect:z}),et===$-1?W.bindFBO(null):(U.swap(),W.bindFBO(U.target)),_this36[O].clear(),_this36.renderer.drawMeshes([J]);});}this._prepareRenderFinished();}/* override */},{key:"setResolution",value:function setResolution(_ref150){var _this37=this;var D=_ref150.width,U=_ref150.height;var M=this.renderer,W=M.__globalTransformMatrix||M.globalTransformMatrix,$=W[4],B=W[5],N=W[0],_this$getResolution6=this.getResolution(),z=_this$getResolution6.width,J=_this$getResolution6.height;(z!==D||J!==U)&&(_superPropGet(E,"setResolution",this,3)([{width:D,height:U}]),this.canvas&&(this.canvas.width=D,this.canvas.height=U,M.updateResolution&&M.updateResolution()),this.attributes.size=[D,U],this[d].length&&this[d].forEach(function(V){var Q=new r.Figure2D();Q.rect(0,0,D/_this37.displayRatio,U/_this37.displayRatio),V.contours=Q.contours;}));var _this$renderOffset=_slicedToArray(this.renderOffset,2),et=_this$renderOffset[0],at=_this$renderOffset[1],ct=this.displayRatio;($!==et||B!==at||N!==ct)&&(M.setGlobalTransform(ct,0,0,ct,et,at),M.__globalTransformMatrix=null,this[S]=null,this.updateGlobalTransform(),this.forceUpdate());}/**
|
|
354
|
+
* tick(handler, {originTime = 0, playbackRate = 1.0, duration = Infinity})
|
|
355
|
+
* @param {*} handler
|
|
356
|
+
* @param {*} options
|
|
357
|
+
*/},{key:"tick",value:function tick(){var _this38=this;var D=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var U=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var _U$duration=U.duration,M=_U$duration===void 0?1/0:_U$duration,W=v(U,["duration"]);var $=this.timeline.fork(W),B=this;this[p]=this[p]||[],this[p].push({handler:D,duration:M});var _N7=function N(){var z=null,J=null;var et=function et(){var at=_this38[p].map(function(_ref151){var ct=_ref151.handler,V=_ref151.duration;var Q=Math.min(1,$.currentTime/V);return{value:ct?ct($.currentTime,Q):null,p:Q};});B[w]||(B[w]=Promise.resolve().then(function(){B[T]&&B.render(),delete B[w];for(var ct=at.length-1;ct>=0;ct--){var _at$ct=at[ct],V=_at$ct.value,Q=_at$ct.p;(V===!1||Q>=1)&&_this38[p].splice(ct,1);}_this38[p].length>0&&_N7();}));};if(_this38[P]&&_this38[P]._type!=="ticker"&&(Object(c.cancelAnimationFrame)(_this38[P]._requestID),delete _this38[P]),!_this38[P]){var at=new Promise(function(ct){z=ct,J=Object(c.requestAnimationFrame)(et);});at._resolve=z,at._requestID=J,at._type="ticker",_this38[P]=at;}};_N7();}},{key:"toGlobalPos",value:function toGlobalPos(D,U){if(this.layerTransformInvert){var z=this.transformMatrix;D=z[0]*D+z[2]*U+z[4],U=z[1]*D+z[3]*U+z[5];}var _this$getResolution7=this.getResolution(),M=_this$getResolution7.width,W=_this$getResolution7.height,$=this.renderOffset,B=[this.canvas.clientWidth,this.canvas.clientHeight];D=D*B[0]/M+$[0],U=U*B[1]/W+$[1];var N=this.displayRatio;return D*=N,U*=N,[D,U];}},{key:"toLocalPos",value:function toLocalPos(D,U){var _this$getResolution8=this.getResolution(),M=_this$getResolution8.width,W=_this$getResolution8.height,$=this.renderOffset,B=[this.canvas.clientWidth,this.canvas.clientHeight];D=D*M/B[0]-$[0],U=U*W/B[1]-$[1];var N=this.displayRatio;D/=N,U/=N;var z=this.layerTransformInvert;return z&&(D=z[0]*D+z[2]*U+z[4],U=z[1]*D+z[3]*U+z[5]),[D,U];}}]);}(l["default"]);f["default"].registerNode(E,"layer");},/* 287 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return P;});var r=t(224),n=t(288),s=t(213),c=t(252),l=t(72);t(1).glMatrix.setMatrixArrayType(Array);function f(w,d){if(w==null)return{};var m=u(w,d),p,S;if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(w);for(S=0;S<E.length;S++)p=E[S],!(d.indexOf(p)>=0)&&Object.prototype.propertyIsEnumerable.call(w,p)&&(m[p]=w[p]);}return m;}function u(w,d){if(w==null)return{};var m={},p=Object.keys(w),S,E;for(E=0;E<p.length;E++)S=p[E],!(d.indexOf(S)>=0)&&(m[S]=w[S]);return m;}function v(w,d,m){return d in w?Object.defineProperty(w,d,{value:m,enumerable:!0,configurable:!0,writable:!0}):w[d]=m,w;}var h="http://www.w3.org/2000/svg",y=Symbol["for"]("spritejs_setAttribute"),T=Symbol("root"),O=Symbol("task");function I(w){var d=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var m=w[T];if(m&&m.children[0]){var p=w.svg,S=w.layer?w.layer.displayRatio:1;if(!p.hasAttribute("data-original-width")){var D=p.getAttribute("width");D=D?Object(l.sizeToPixel)(D):300;var U=p.getAttribute("height");U=U?Object(l.sizeToPixel)(U):150,p.hasAttribute("viewBox")||p.setAttribute("viewBox","0 0 ".concat(Math.round(D)," ").concat(Math.round(U))),p.setAttribute("data-original-width",D),p.setAttribute("data-original-height",U);}var E=w.attributes.width||Number(p.getAttribute("data-original-width")),R=w.attributes.height||Number(p.getAttribute("data-original-height"));if(E*=S,R*=S,d&&w.attributes.flexible){var _D3=w.attributes.scale[0];if(E*=_D3,R*=_D3,p.setAttribute("width",E),p.setAttribute("height",R),E&&R&&w.textureImage){var _U9=w.textureImage.width,M=w.textureImage.height,W=w.clientSize;w.attributes.textureRect=[0,0,Math.round(W[0]*_U9/E),Math.round(W[1]*M/R)];}}else w[O]||(p.setAttribute("width",E),p.setAttribute("height",R),w[O]=Promise.resolve().then(function(){delete w[O];var D=m.innerHTML,U=new Blob([D],{type:"image/svg+xml"}),M=URL.createObjectURL(U),W=new Image();W.onload=function(){W.width&&W.height?(w.attributes[y]("texture",W),w.attributes.flexible&&(w.attributes.textureRect=null)):w.attributes[y]("texture",null);},W.src=M;}));}}var P=/*#__PURE__*/function(_r$default19){function P(){var _this39;var d=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,P);typeof d=="string"&&(d={svgText:d});var _d24=d,m=_d24.svgText,p=f(d,["svgText"]);if(_this39=_callSuper(this,P,[p]),_this39[T]=document.createElement("div"),m){_this39[T].innerHTML=m;var S=_this39[T].children[0];S?S.setAttribute("xmlns",h):(fetch(m).then(function(E){return E.text();}).then(function(E){_this39[T].innerHTML=E,(!_this39.observer||_this39.attributes.flexible)&&I(_assertThisInitialized(_this39));}),m=null);}if(!m){var _S8=document.createElementNS(h,"svg");_S8.setAttribute("xmlns",h),_this39[T].appendChild(_S8);}if(typeof MutationObserver=="function"){var _S9=new MutationObserver(function(E){I(_this39,!1);});_S9.observe(_this39[T],{attributes:!0,subtree:!0,characterData:!0,childList:!0}),_this39.observer=_S9;}return _this39;}_inherits(P,_r$default19);return _createClass(P,[{key:"children",get:function get(){return[this.svg];}},{key:"childNodes",get:function get(){return[this.svg];}},{key:"svg",get:function get(){return this[T]?this[T].children[0]:null;}/* override */},{key:"setResolution",value:function setResolution(_ref152){var d=_ref152.width,m=_ref152.height;_superPropGet(P,"setResolution",this,3)([{width:d,height:m}]),I(this);}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(d){var m=_superPropGet(P,"dispatchPointerEvent",this,3)([d]);if(m&&this.attributes.passEvents&&typeof MouseEvent=="function"){var p=d.x,S=d.y;var _this$getOffsetPositi=this.getOffsetPosition(p,S),_this$getOffsetPositi2=_slicedToArray(_this$getOffsetPositi,2),E=_this$getOffsetPositi2[0],R=_this$getOffsetPositi2[1];var D=d.originalEvent,U=this.attributes.anchor,M=this.clientSize;E=(E+U[0]*M[0])/2,R=(R+U[1]*M[1])/2;var W=d.type;if(W===D.type){var $=null;if(D instanceof MouseEvent)$=new MouseEvent(W,{screenX:E,screenY:R,clientX:E,clientY:R,bubbles:D.bubbles,button:D.button,buttons:D.buttons,cancelBubble:D.cancelBubble,cancelable:D.cancelable,currentTarget:D.currentTarget,fromElement:D.fromElement,relatedTarget:D.relatedTarget,returnValue:D.returnValue,srcElement:D.srcElement,target:D.target,toElement:D.toElement,// view: originalEvent.view,
|
|
358
|
+
which:D.witch});else if(D instanceof TouchEvent){var B=null;var N=D.changedTouches||[D];for(var z=0;z<N.length;z++){var J=N[z];if(d.identifier===J.identifier){B=J;break;}}if(B){var _z3=new Touch({identifier:B.identifier,target:B.target,clientX:E,clientY:R,screenX:E,screenY:R,pageX:E,pageY:R,radiusX:B.radiusX,radiusY:B.radiusY,rotationAngle:B.rotationAngle,force:B.force});$=new TouchEvent(W,{cancelable:D.cancelable,bubbles:D.bubbles,composed:D.composed,touches:[_z3],targetTouches:[_z3],changedTouches:[_z3]});}}else $=D;$&&this.svg.dispatchEvent($);}}return m;}},{key:"getElementById",value:function getElementById(d){return Object(c.querySelector)("#".concat(d),this);}},{key:"getElementsByClassName",value:function getElementsByClassName(d){return Object(c.querySelectorAll)(".".concat(d),this);}},{key:"getElementsByName",value:function getElementsByName(d){return Object(c.querySelectorAll)("[name=\"".concat(d,"\"]"),this);}},{key:"getElementsByTagName",value:function getElementsByTagName(d){return Object(c.querySelectorAll)(d,this);}},{key:"querySelector",value:function querySelector(d){return Object(c.querySelector)(d,this);}},{key:"querySelectorAll",value:function querySelectorAll(d){return Object(c.querySelectorAll)(d,this);}/* override */},{key:"onPropertyChange",value:function onPropertyChange(d,m,p){_superPropGet(P,"onPropertyChange",this,3)([d,m,p]),d==="flexible"&&I(this),this.attributes.flexible&&(d==="width"||d==="height"||d==="scale"||d==="transform")&&I(this);}}]);}(r["default"]);v(P,"Attr",n["default"]),s["default"].registerNode(P,"spritesvg");},/* 288 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return l;});var r=t(225);t(1).glMatrix.setMatrixArrayType(Array);var n=Symbol["for"]("spritejs_getAttribute"),s=Symbol["for"]("spritejs_setAttribute"),c=Symbol["for"]("spritejs_setAttributeDefault");var l=/*#__PURE__*/function(_r$default20){function l(u){var _this40;_classCallCheck(this,l);_this40=_callSuper(this,l,[u]),_this40[c]({passEvents:!1,flexible:!1});return _this40;}// readonly
|
|
359
|
+
_inherits(l,_r$default20);return _createClass(l,[{key:"texture",get:function get(){return this[n]("texture");},set:function set(u){}// eslint-disable-line no-empty-function
|
|
360
|
+
},{key:"passEvents",get:function get(){return this[n]("passEvents");},set:function set(u){return this[s]("passEvents",u);}},{key:"flexible",get:function get(){return this[n]("flexible");},set:function set(u){return this[s]("flexible",u);}}]);}(r["default"]);},/* 289 *//***/function(i,e,t){t.r(e);var r=t(12);t(1).glMatrix.setMatrixArrayType(Array);function n(u,v){var h=Object.keys(u);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(u);v&&(y=y.filter(function(T){return Object.getOwnPropertyDescriptor(u,T).enumerable;})),h.push.apply(h,y);}return h;}function s(u){for(var v=1;v<arguments.length;v++){var h=arguments[v]!=null?arguments[v]:{};v%2?n(Object(h),!0).forEach(function(y){c(u,y,h[y]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(h)):n(Object(h)).forEach(function(y){Object.defineProperty(u,y,Object.getOwnPropertyDescriptor(h,y));});}return u;}function c(u,v,h){return v in u?Object.defineProperty(u,v,{value:h,enumerable:!0,configurable:!0,writable:!0}):u[v]=h,u;}var l=Symbol("inited");var f=null;typeof Worker=="function"&&(f=/*#__PURE__*/function(_Worker){function f(u){var _this41;_classCallCheck(this,f);if(u.worker===!0&&(u.worker="./".concat(u.id,".worker.js")),_this41=_callSuper(this,f,[u.worker]),_this41.options=u,!u.canvas){var _this41$getResolution=_this41.getResolution(),v=_this41$getResolution.width,h=_this41$getResolution.height,y=r.ENV.createCanvas(v,h,{offscreen:!1});y.style&&(y.style.position="absolute"),y.dataset&&(y.dataset.layerId=u.id),u.canvas=y;}_this41.canvas=u.canvas;return _this41;}_inherits(f,_Worker);return _createClass(f,[{key:"id",get:function get(){return this.options.id;}},{key:"setResolution",value:function setResolution(_ref153){var u=_ref153.width,v=_ref153.height;if(this[l])this.postMessage({type:"resolution_change",width:u,height:v});else{this.canvas.width=u,this.canvas.height=v;var h=this.options,y=h.canvas.transferControlToOffscreen(),T=s({},h);delete T.container,T.canvas=y,this.postMessage({type:"create",options:T},[y]),this[l]=!0;}}},{key:"getResolution",value:function getResolution(){if(this.canvas){var _this$canvas7=this.canvas,u=_this$canvas7.width,v=_this$canvas7.height;return{width:u,height:v};}return{width:300,height:150};}},{key:"remove",value:function remove(){return this.parent&&this.parent.removeChild?(this.parent.removeChild(this),!0):!1;}},{key:"connect",value:function connect(u,v){Object.defineProperty(this,"parent",{value:u,writable:!1,configurable:!0}),Object.defineProperty(this,"zOrder",{value:v,writable:!1,configurable:!0});}},{key:"disconnect",value:function disconnect(){delete this.parent,delete this.zOrder;}},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(u){this.postMessage({type:"event",event:{cancelBubble:u.cancelBubble,bubbles:u.bubbles,detail:u.detail,identifier:u.identifier,layerX:u.layerX,layerY:u.layerY,originalX:u.originalX,originalY:u.originalY,type:u.type,x:u.x,y:u.y}});}}]);}(/*#__PURE__*/_wrapNativeSuper(Worker))),e["default"]=f;},/* 290 *//***/function(i,e,t){t.r(e),function(r){t.d(e,"default",function(){return E;});var n=t(12),s=t(68),c=t(70),l=t(286),f=t(289),u=t(250),v=t(291),h=t(214),y=t(218),T=t(213);t(1).glMatrix.setMatrixArrayType(Array);var O=Symbol("enteredTargets");function I(R){return R.id=R.id||"_layer".concat(Math.random().toString(36).slice(2,12)),R.dataset||(R.dataset={}),R.dataset.layerId=R.id,R.connect=function(D,U){R.parent=D,Object.defineProperty(R,"zOrder",{value:U,writable:!1,configurable:!0});},R.disconnect=function(D){delete R.zOrder;},R.canvas=R,R.getResolution=function(){return{width:0,height:0};},R.setResolution=function(){return!1;},R.options={handleEvent:!1},R;}function P(R,D){var U=R.children;var M=null;for(var W=0;W<U.length;W++){var $=U[W];if((D===$||M!=null)&&(M=$),M&&M!==D&&!M.offscreen)return M.canvas;}return null;}function w(R,D){var _R$renderOffset=_slicedToArray(R.renderOffset,2),U=_R$renderOffset[0],M=_R$renderOffset[1],_R$getResolution=R.getResolution(),W=_R$getResolution.width,$=_R$getResolution.height,B=R.displayRatio;R.renderer.drawImage(D.canvas,-U/B,-M/B,W/B,$/B);}var d={};function m(R){var D=["mousedown","mouseup","mousemove","mousewheel","wheel","touchstart","touchend","touchmove","touchcancel","click","dblclick","longpress","tap","contextmenu"],U=R.container;U.addEventListener("mouseleave",function(M){var W=R[O];if(W.size){var $=new h["default"]("mouseleave");$.setOriginalEvent(M),_toConsumableArray(W).forEach(function(B){B.dispatchEvent($);}),R[O].clear();}},{passive:!0}),D.forEach(function(M){U.addEventListener(M,function(W){var _R$options=R.options,$=_R$options.left,B=_R$options.top,N=_R$options.displayRatio,z=R.orderedChildren;Object(v["default"])(W,{offsetLeft:$,offsetTop:B,displayRatio:N}).forEach(function(et){var at=et.identifier;if(et.type==="touchmove"||et.type==="touchend"){var V=d[at];V&&V.dispatchEvent(et),et.type==="touchend"&&delete d[at];}else{for(var _V=z.length-1;_V>=0;_V--){var Q=z[_V];if(Q.options.handleEvent!==!1){if(Q.dispatchPointerEvent(et)&&et.target!==Q)break;et.cancelBubble=!1;}}if(et.target===z[0])for(var _V2=z.length-1;_V2>=0;_V2--){var _Q=z[_V2];if(_Q.options.handleEvent!==!1){et.target=_Q;break;}}}var ct=et.target;if(et.type==="touchstart"&&(d[at]=et.target),et.type==="mousemove"){var _V3=R[O];var _Q2;if(ct){var yt=ct.ancestors||[];_Q2=/* @__PURE__ */new Set([ct].concat(_toConsumableArray(yt)));}else _Q2=/* @__PURE__ */new Set();var ft=Object.entries(W);if(!_V3.has(ct)&&ct){var _yt2=new h["default"]("mouseenter");_yt2.setOriginalEvent(W),ft.forEach(function(_ref154){var _ref155=_slicedToArray(_ref154,2),ht=_ref155[0],Nt=_ref155[1];_yt2[ht]=Nt;}),_V3.add(ct),ct.dispatchEvent(_yt2);var At=ct.ancestors;At&&At.forEach(function(ht){ht instanceof c["default"]&&!_V3.has(ht)&&(_V3.add(ht),ht.dispatchEvent(_yt2));});}var mt=new h["default"]("mouseleave");mt.setOriginalEvent(W),ft.forEach(function(_ref156){var _ref157=_slicedToArray(_ref156,2),yt=_ref157[0],At=_ref157[1];mt[yt]=At;}),_toConsumableArray(_V3).forEach(function(yt){_Q2.has(yt)||(_V3["delete"](yt),yt.dispatchEvent(mt));});}});},{passive:M!=="contextmenu"});});}function p(R,D){if(D&&D.style){var U=R.width,M=R.height,W=R.mode,$=R.container;var B=$.clientWidth,N=$.clientHeight;U=U||B,M=M||N,W==="static"?(D.style.width="".concat(U,"px"),D.style.height="".concat(M,"px")):(D.style.top="0",D.style.left="0",D.style.width="".concat(B,"px"),D.style.height="".concat(N,"px"),D.style.transform="",D.style.webkitTransform="");}}var S=Symbol("offscreenLayerCount");var E=/*#__PURE__*/function(_u$default){/**
|
|
361
|
+
width
|
|
362
|
+
height
|
|
363
|
+
mode: 'static', 'scale', 'stickyWidth', 'stickyHeight', 'stickyTop', 'stickyBottom', 'stickyLeft', 'stickyRight'
|
|
364
|
+
*/function E(){var _this42;var D=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,E);if(_this42=_callSuper(this,E),!D.container)if(typeof n.ENV.Container=="function")D.container=new n.ENV.Container(D.width||300,D.height||150);else throw new Error("No container specified.");if(_this42.container=D.container,_this42.container.style&&(_this42.container.style.overflow||(_this42.container.style.overflow="hidden"),_this42.container.style.position||(_this42.container.style.position="relative")),_this42.options=D,D.displayRatio=D.displayRatio||1,D.mode=D.mode||"scale",D.left=0,D.top=0,D.autoResize=D.autoResize!==!1,D.autoResize){var U;if((typeof globalThis==="undefined"?"undefined":_typeof(globalThis))<"u"?U=globalThis:U=(typeof window==="undefined"?"undefined":_typeof(window))<"u"?window:r,U.addEventListener){var M=_this42;U.addEventListener("resize",function W(){(typeof document==="undefined"?"undefined":_typeof(document))<"u"&&document.contains(M.container)?M.resize():U.removeEventListener("resize",W);});}}_this42[O]=/* @__PURE__ */new Set(),_this42.setResolution(D),m(_this42),_this42[S]=0;return _this42;}_inherits(E,_u$default);return _createClass(E,[{key:"hasOffscreenCanvas",get:function get(){return this[S]>0;}},{key:"displayRatio",get:function get(){return this.options.displayRatio;},set:function set(D){this.options.displayRatio!==D&&(this.options.displayRatio=D,this.resize());}},{key:"height",get:function get(){return this.options.height;},set:function set(D){this.options.height!==D&&(this.options.height=D,this.resize());}},{key:"mode",get:function get(){return this.options.mode;},set:function set(D){this.options.mode!==D&&(this.options.mode=D,this.resize());}},{key:"width",get:function get(){return this.options.width;}/* override */,set:function set(D){this.options.width!==D&&(this.options.width=D,this.resize());}},{key:"appendChild",value:function appendChild(D){!(D instanceof l["default"])&&!(D instanceof f["default"])&&I(D);var U=_superPropGet(E,"appendChild",this,3)([D]),M=D.canvas;return D.offscreen?this[S]++:this.container.appendChild(M),p(this.options,M),D.setResolution(this.getResolution()),U;}/* override */},{key:"forceUpdate",value:function forceUpdate(){var _this43=this;this.hasOffscreenCanvas&&!this._requestID&&(this._requestID=Object(s.requestAnimationFrame)(function(){delete _this43._requestID,_this43.render();}));}/* override */},{key:"insertBefore",value:function insertBefore(D,U){!(D instanceof l["default"])&&!(D instanceof f["default"])&&I(D);var M=_superPropGet(E,"insertBefore",this,3)([D,U]),W=D.canvas;if(!D.offscreen){var $=P(this,D);this.container.insertBefore(W,$);}return p(this.options,W),D.setResolution(this.getResolution()),M;}},{key:"layer",value:function layer(){var D=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"default";var U=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};U=Object.assign({},this.options,U),U.id=D;var M=this.orderedChildren;for(var B=0;B<M.length;B++)if(M[B].id===D)return M[B];var W=U.worker;var $;return W?$=new f["default"](U):$=new l["default"](U),this.appendChild($),$;}},{key:"preload",value:function(){var _preload=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0(){var _this44=this;var _len11,D,_key11,U,M,W,_loop2,$,_args1=arguments;return _regenerator().w(function(_context1){while(1)switch(_context1.n){case 0:for(_len11=_args1.length,D=new Array(_len11),_key11=0;_key11<_len11;_key11++){D[_key11]=_args1[_key11];}U=[],M=[],W=[];_loop2=/*#__PURE__*/_regenerator().m(function _loop2($){var B,N,z,J;return _regenerator().w(function(_context0){while(1)switch(_context0.n){case 0:B=D[$];if(typeof B=="string")N=Object(y.loadTexture)(B);else if(Array.isArray(B))N=Object(y.loadFrames).apply(void 0,_toConsumableArray(B));else{z=B.id,J=B.src;N=Object(y.loadTexture)(J,z);}N instanceof Promise||(N=Promise.resolve(N)),M.push(N.then(function(z){U.push(z),W[$]=z;var J=new h["default"]({type:"preload",detail:{current:z,loaded:U,resources:D}});_this44.dispatchEvent(J);}));case 1:return _context0.a(2);}},_loop2);});$=0;case 1:if(!($<D.length)){_context1.n=3;break;}return _context1.d(_regeneratorValues(_loop2($)),2);case 2:$++;_context1.n=1;break;case 3:_context1.n=4;return Promise.all(M);case 4:return _context1.a(2,W);}},_callee0);}));function preload(){return _preload.apply(this,arguments);}return preload;}()/* override */},{key:"removeChild",value:function removeChild(D){var U=_superPropGet(E,"removeChild",this,3)([D]);if(U){D._prepareRenderFinished&&D._prepareRenderFinished();var M=D.canvas;M&&M.remove&&M.remove(),D.offscreen&&this[S]--;}return U;}// for offscreen mode rendering
|
|
365
|
+
},{key:"render",value:function render(){var D=this.orderedChildren;var U=null;var M=[];for(var W=0;W<D.length;W++){var $=D[W],B=M.length>0;if($ instanceof l["default"]&&!$.offscreen){if(!$.autoRender)B&&(console.warn("Some offscreen canvas will not be rendered."),M.length=0);else if(U=$,B){$.renderer.clear();for(var N=0;N<M.length;N++){var z=M[N];z.render(),w($,z);}M.length=0,$.render({clear:!1});}else $.prepareRender&&$.render();}else $.offscreen?U?($.prepareRender&&$.render(),w(U,$)):M.push($):$ instanceof f["default"]&&B&&(console.warn("Some offscreen canvas will not be rendered."),M.length=0);}}/* override */},{key:"replaceChild",value:function replaceChild(D,U){var M=_superPropGet(E,"replaceChild",this,3)([D,U]);U.canvas.remove&&U.canvas.remove(),U.offscreen&&this[S]--;var W=D.canvas;if(!D.offscreen){var $=P(this,D);this.container.insertBefore(W,$);}return p(this.options,W),D.setResolution(this.getResolution()),M;}},{key:"resize",value:function resize(){var D=this.options;this.children.forEach(function(U){p(D,U.canvas);}),this.setResolution(D),this.dispatchEvent({type:"resize"});}/* override */},{key:"setResolution",value:function setResolution(){var _ref158=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},D=_ref158.width,U=_ref158.height;var M=this.container,W=M.clientWidth,$=M.clientHeight;(D==null||U==null)&&(D=D!==null&&D!==void 0?D:W,U=U!==null&&U!==void 0?U:$);var _this$options=this.options,B=_this$options.mode,N=_this$options.displayRatio;if(D*=N,U*=N,this.options.left=0,this.options.top=0,B==="stickyHeight"||B==="stickyLeft"||B==="stickyRight"){var z=D;D=W*U/$,B==="stickyHeight"&&(this.options.left=0.5*(D-z)),B==="stickyRight"&&(this.options.left=D-z);}else if(B==="stickyWidth"||B==="stickyTop"||B==="stickyBottom"){var _z4=U;U=$*D/W,B==="stickyWidth"&&(this.options.top=0.5*(U-_z4)),B==="stickyBottom"&&(this.options.top=U-_z4);}_superPropGet(E,"setResolution",this,3)([{width:D,height:U}]);}},{key:"snapshot",value:function snapshot(){var _ref159=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref159$offscreen=_ref159.offscreen,D=_ref159$offscreen===void 0?!1:_ref159$offscreen,U=_ref159.layers;var M=D?"snapshotOffScreenCanvas":"snapshotCanvas",_this$getResolution9=this.getResolution(),W=_this$getResolution9.width,$=_this$getResolution9.height;this[M]=this[M]||n.ENV.createCanvas(W,$,{offscreen:D});var B=this[M].getContext("2d");U=U||this.orderedChildren,this[M].width=W,this[M].height=$;for(var N=0;N<U.length;N++){var z=U[N];if(!z.options.ignoreSnapshot){z.render&&z.render();var J=z.canvas;J&&J!==z&&B.drawImage(J,0,0,W,$);}}return this[M];}}]);}(u["default"]);(typeof document==="undefined"?"undefined":_typeof(document))<"u"&&(E.prototype.layer3d=function(R){var _this45=this;var D=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var U=D.url||"https://unpkg.com/sprite-extend-3d/dist/sprite-extend-3d.min.js";return new Promise(function(M,W){var $=document.createElement("script");$.async=!1,$.src=U,$.onload=function(){try{M(_this45.layer3d(R,D));}catch(B){W(B);}},document.documentElement.appendChild($);});}),T["default"].registerNode(E,"scene");}.call(this,t(22));},/* 291 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return n;});var r=t(214);t(1).glMatrix.setMatrixArrayType(Array);function n(s){var _ref160=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref160$offsetTop=_ref160.offsetTop,c=_ref160$offsetTop===void 0?0:_ref160$offsetTop,_ref160$offsetLeft=_ref160.offsetLeft,l=_ref160$offsetLeft===void 0?0:_ref160$offsetLeft,_ref160$displayRatio=_ref160.displayRatio,f=_ref160$displayRatio===void 0?1:_ref160$displayRatio;var u,v;var h=[],_s$target$getBounding=s.target.getBoundingClientRect(),y=_s$target$getBounding.left,T=_s$target$getBounding.top,O=_s$target$getBounding.width,I=_s$target$getBounding.height,P=s.target.width,w=s.target.height,d=s.changedTouches||[s];for(var p=0;p<d.length;p++){var S=d[p],E=S.identifier,R=S.clientX,D=S.clientY;R!=null&&D!=null&&h.push({x:Math.round((R|0)-y),y:Math.round((D|0)-T),identifier:E});}h.length<=0&&h.push({x:u,y:v});var m=[];return h.forEach(function(p){p.x!=null&&p.y!=null&&(u=(p.x*P/O-l)/f,v=(p.y*w/I-c)/f);var S=new r["default"](s);Object.defineProperties(S,{layerX:{value:u,configurable:!0},layerY:{value:v,configurable:!0},originalX:{value:p.x},originalY:{value:p.y},x:{value:u,configurable:!0},y:{value:v,configurable:!0},identifier:{value:p.identifier}}),m.push(S);}),m;}}/******/]);Ne.version;Ne.Arc;Ne.Block;Ne.Cloud;Ne.Color;var e1=Ne.Ellipse;Ne.Gradient;var cr=Ne.Group,r1=Ne.Label,il=Ne.Layer;Ne.LayerWorker;Ne.Node;Ne.Parallel;var Ln=Ne.Path,dn=Ne.Polyline,sl=Ne.Rect;Ne.Regular;Ne.Ring;var Xu=Ne.Scene,zu=Ne.Sprite;Ne.SpriteSvg;Ne.Star;Ne.Triangle;Ne.helpers;Ne.createElement;Ne.isSpriteNode;Ne.registerNode;Ne.requestAnimationFrame;Ne.cancelAnimationFrame;Ne.ENV;var Ae=/* @__PURE__ */function(i){return i.Normal="Normal",i.Stroke="Stroke",i.Dotted="Dotted",i.LongDotted="LongDotted",i;}(Ae||{}),pe=/* @__PURE__ */function(i){return i.None="None",i.ShowFloatBar="ShowFloatBar",i.ZIndexFloatBar="ZIndexFloatBar",i.DeleteNode="DeleteNode",i.CopyNode="CopyNode",i.ZIndexNode="ZIndexNode",i.ZIndexBackgroundSVG="ZIndexBackgroundSVG",i.RotateNode="RotateNode",i.SetColorNode="SetColorNode",i.TranslateNode="TranslateNode",i.ScaleNode="ScaleNode",i.OriginalEvent="OriginalEvent",i.CreateScene="CreateScene",i.ActiveCursor="ActiveCursor",i.MoveCursor="MoveCursor",i.CommandEditor="CommandEditor",i.SetEditorData="SetEditorData",i.SetFontStyle="SetFontStyle",i.SetPoint="SetPoint",i.SetLock="SetLock",i.SetShapeOpt="SetShapeOpt",i.CameraChange="CameraChange",i.ActiveMethod="ActiveMethod",i.HidFloatBarBtn="HidFloatBarBtn",i;}(pe||{}),Tt=/* @__PURE__ */function(i){return i[i.Pencil=1]="Pencil",i[i.Eraser=2]="Eraser",i[i.PencilEraser=3]="PencilEraser",i[i.BitMapEraser=4]="BitMapEraser",i[i.Selector=5]="Selector",i[i.Clicker=6]="Clicker",i[i.Arrow=7]="Arrow",i[i.Hand=8]="Hand",i[i.LaserPen=9]="LaserPen",i[i.Text=10]="Text",i[i.Straight=11]="Straight",i[i.Rectangle=12]="Rectangle",i[i.Ellipse=13]="Ellipse",i[i.Star=14]="Star",i[i.Triangle=15]="Triangle",i[i.Rhombus=16]="Rhombus",i[i.Polygon=17]="Polygon",i[i.SpeechBalloon=18]="SpeechBalloon",i[i.Image=19]="Image",i[i.BackgroundSVG=20]="BackgroundSVG",i;}(Tt||{}),Kt=/* @__PURE__ */function(i){return i[i.Local=1]="Local",i[i.Service=2]="Service",i[i.Worker=3]="Worker",i;}(Kt||{}),te=/* @__PURE__ */function(i){return i[i.Pending=0]="Pending",i[i.Start=1]="Start",i[i.Doing=2]="Doing",i[i.Done=3]="Done",i[i.Unwritable=4]="Unwritable",i;}(te||{}),vt=/* @__PURE__ */function(i){return i[i.None=0]="None",i[i.Init=1]="Init",i[i.UpdateCamera=2]="UpdateCamera",i[i.UpdateTools=3]="UpdateTools",i[i.CreateWork=4]="CreateWork",i[i.DrawWork=5]="DrawWork",i[i.FullWork=6]="FullWork",i[i.UpdateNode=7]="UpdateNode",i[i.RemoveNode=8]="RemoveNode",i[i.Clear=9]="Clear",i[i.Select=10]="Select",i[i.Destroy=11]="Destroy",i[i.Snapshot=12]="Snapshot",i[i.BoundingBox=13]="BoundingBox",i[i.Cursor=14]="Cursor",i[i.TextUpdate=15]="TextUpdate",i[i.GetTextActive=16]="GetTextActive",i[i.TasksQueue=17]="TasksQueue",i[i.CursorHover=18]="CursorHover",i[i.CursorBlur=19]="CursorBlur",i[i.Console=20]="Console",i[i.GetImageBitMap=23]="GetImageBitMap",i[i.AuthWriter=24]="AuthWriter",i[i.AuthReader=25]="AuthReader",i[i.AuthClear=26]="AuthClear",i[i.AuthPage=27]="AuthPage",i[i.GetVNodeInfo=28]="GetVNodeInfo",i[i.UpdateDpr=29]="UpdateDpr",i[i.SetFontFace=30]="SetFontFace",i[i.ReportError=31]="ReportError",i[i.ReportLog=32]="ReportLog",i[i.BackgroundSVGUpdate=33]="BackgroundSVGUpdate",i[i.BackgroundSVGDelete=34]="BackgroundSVGDelete",i;}(vt||{}),Ut=/* @__PURE__ */function(i){return i[i.None=0]="None",i[i.Bg=1]="Bg",i[i.ServiceFloat=2]="ServiceFloat",i[i.Float=3]="Float",i[i.TopFloat=4]="TopFloat",i;}(Ut||{}),Ce=/* @__PURE__ */function(i){return i[i.none=1]="none",i[i.all=2]="all",i[i.both=3]="both",i[i.proportional=4]="proportional",i;}(Ce||{}),Tr=/* @__PURE__ */function(i){return i[i.inside=0]="inside",i[i.outside=1]="outside",i[i.intersect=2]="intersect",i;}(Tr||{}),ho=/* @__PURE__ */function(i){return i.Image="image",i.Iconify="iconify",i;}(ho||{});var tn=/*#__PURE__*/function(){function tn(){_classCallCheck(this,tn);dt(this,"localWork");dt(this,"serviceWork");dt(this,"threadEngine");}return _createClass(tn,[{key:"registerForWorker",value:function registerForWorker(e){return this.threadEngine=e,this.localWork=e.localWork,this.serviceWork=e.serviceWork,this;}}]);}();var n1=/*#__PURE__*/function(_tn){function n1(){var _this46;_classCallCheck(this,n1);_this46=_callSuper(this,n1,arguments);dt(_this46,"emitEventType",pe.CopyNode);return _this46;}_inherits(n1,_tn);return _createClass(n1,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,s=t.emitEventType;if(r===vt.FullWork&&n===Kt.Local&&s===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1(t){var n,r,_t1;return _regenerator().w(function(_context10){while(1)switch(_context10.n){case 0:r=t.workId;_t1=r;if(!_t1){_context10.n=1;break;}_context10.n=1;return(n=this.localWork)==null?void 0:n.consumeFull(t);case 1:return _context10.a(2);}},_callee1,this);}));function consumeForLocalWorker(_x17){return _consumeForLocalWorker.apply(this,arguments);}return consumeForLocalWorker;}()}]);}(tn);var gi="++",Me="selector",i1="all";var s1=/*#__PURE__*/function(_tn2){function s1(){var _this47;_classCallCheck(this,s1);_this47=_callSuper(this,s1,arguments);dt(_this47,"emitEventType",pe.SetColorNode);return _this47;}_inherits(s1,_tn2);return _createClass(s1,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,s=t.emitEventType;if(r===vt.UpdateNode&&n===Kt.Local&&s===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee10(t){var v,r,n,s,c,l,f,u,_t10;return _regenerator().w(function(_context11){while(1)switch(_context11.n){case 0:r=t.workId,n=t.updateNodeOpt,s=t.willRefreshSelector,c=t.willSyncService,l=t.willSerializeData,f=t.textUpdateForWoker,u=t.needUndoTicker;_t10=r===Me&&n;if(!_t10){_context11.n=1;break;}_context11.n=1;return(v=this.localWork)==null?void 0:v.updateSelector({updateSelectorOpt:n,willRefreshSelector:s,willSyncService:c,willSerializeData:l,textUpdateForWoker:f,callback:this.updateSelectorCallback,needUndoTicker:u});case 1:return _context11.a(2);}},_callee10,this);}));function consumeForLocalWorker(_x18){return _consumeForLocalWorker2.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,s=t.newServiceStore,c=r.willSyncService,l=r.isSync,f=r.textUpdateForWoker,u=r.needUndoTicker,v=n.render||[],h=n.sp||[];if(c){var _iterator3=_createForOfIteratorHelper(s.entries()),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var _step3$value=_slicedToArray(_step3.value,2),y=_step3$value[0],T=_step3$value[1];f&&T.toolsType===Tt.Text?h.push(_objectSpread(_objectSpread({},T),{},{workId:y,type:vt.TextUpdate,dataType:Kt.Local,willSyncService:!0})):h.push(_objectSpread(_objectSpread({},T),{},{workId:y,type:vt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:l}));}}catch(err){_iterator3.e(err);}finally{_iterator3.f();}}return u&&h.push({type:vt.None,needUndoTicker:u}),{render:v,sp:h};}}]);}(tn);var o1=/*#__PURE__*/function(_tn3){function o1(){var _this48;_classCallCheck(this,o1);_this48=_callSuper(this,o1,arguments);dt(_this48,"emitEventType",pe.ZIndexNode);return _this48;}_inherits(o1,_tn3);return _createClass(o1,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,s=t.emitEventType;if(r===vt.UpdateNode&&n===Kt.Local&&s===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee11(t){var f,r,n,s,c,l,_t11;return _regenerator().w(function(_context12){while(1)switch(_context12.n){case 0:r=t.workId,n=t.updateNodeOpt,s=t.willRefreshSelector,c=t.willSyncService,l=t.willSerializeData;_t11=r===Me&&n;if(!_t11){_context12.n=1;break;}_context12.n=1;return(f=this.localWork)==null?void 0:f.updateSelector({updateSelectorOpt:n,willRefreshSelector:s,willSyncService:c,willSerializeData:l,callback:this.updateSelectorCallback});case 1:return _context12.a(2);}},_callee11,this);}));function consumeForLocalWorker(_x19){return _consumeForLocalWorker3.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,s=t.newServiceStore,c=r.willSyncService,l=r.isSync,f=n.render||[],u=n.sp||[];if(c&&u){var _iterator4=_createForOfIteratorHelper(s.entries()),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var _step4$value=_slicedToArray(_step4.value,2),v=_step4$value[0],h=_step4$value[1];h.toolsType===Tt.BackgroundSVG&&u.push(_objectSpread(_objectSpread({},h),{},{workId:v,type:vt.BackgroundSVGUpdate,dataType:Kt.Local,updateNodeOpt:{useAnimation:!1}})),u.push(_objectSpread(_objectSpread({},h),{},{workId:v,type:vt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:l}));}}catch(err){_iterator4.e(err);}finally{_iterator4.f();}}return{render:f,sp:u};}}]);}(tn);var a1=/*#__PURE__*/function(_tn4){function a1(){var _this49;_classCallCheck(this,a1);_this49=_callSuper(this,a1,arguments);dt(_this49,"emitEventType",pe.TranslateNode);return _this49;}_inherits(a1,_tn4);return _createClass(a1,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,s=t.emitEventType;if(r===vt.UpdateNode&&n===Kt.Local&&s===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker4=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee12(t){var y,T,r,n,s,c,l,f,u,v,h,_t12;return _regenerator().w(function(_context13){while(1)switch(_context13.n){case 0:r=t.workId,n=t.updateNodeOpt,s=t.willRefreshSelector,c=t.willSyncService,l=t.willSerializeData,f=t.textUpdateForWoker,u=t.emitEventType,v=t.smoothSync,h=t.needUndoTicker;_t12=r===Me&&n;if(!_t12){_context13.n=3;break;}if(!(n.workState===te.Done&&n!=null&&n.translate&&(n.translate[0]||n.translate[1])||n.workState!==te.Done)){_context13.n=2;break;}_context13.n=1;return(y=this.localWork)==null?void 0:y.updateSelector({updateSelectorOpt:n,willRefreshSelector:s,willSyncService:c,willSerializeData:l,isSync:!0,textUpdateForWoker:f,emitEventType:u,callback:this.updateSelectorCallback,smoothSync:v,needUndoTicker:h});case 1:_context13.n=3;break;case 2:n.workState===te.Done&&((T=this.localWork)==null||T.vNodes.deleteLastTarget());case 3:return _context13.a(2);}},_callee12,this);}));function consumeForLocalWorker(_x20){return _consumeForLocalWorker4.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,s=t.newServiceStore,c=t.workShapeNode,l=t.res,f=t.smoothSync,u=r.willSyncService,v=r.isSync,h=r.updateSelectorOpt,y=r.textUpdateForWoker,T=r.needUndoTicker,O=h.workState,I=n.render||[],P=n.sp||[];if(O===te.Start)return{sp:[],render:[]};var w=l==null?void 0:l.selectRect;if(u){P.push({type:vt.Select,selectIds:c.selectIds,selectRect:w,willSyncService:O===te.Done?!0:f,isSync:!0,points:O===te.Done&&c.getChildrenPoints()||void 0,textOpt:c.textOpt});var _d25={useAnimation:h.useAnimation||!1};h.uid&&(_d25.uid=h.uid);var _iterator5=_createForOfIteratorHelper(s.entries()),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var _step5$value=_slicedToArray(_step5.value,2),m=_step5$value[0],p=_step5$value[1];p.toolsType===Tt.BackgroundSVG&&P.push(_objectSpread(_objectSpread({},p),{},{workId:m,type:vt.BackgroundSVGUpdate,dataType:Kt.Local,willSyncService:O===te.Done?!0:f,updateNodeOpt:_d25})),y&&p.toolsType===Tt.Text?P.push(_objectSpread(_objectSpread({},p),{},{workId:m,type:vt.TextUpdate,dataType:Kt.Local,willSyncService:O===te.Done?!0:f,updateNodeOpt:_d25})):(f||O===te.Done)&&P.push(_objectSpread(_objectSpread({},p),{},{workId:m,type:vt.UpdateNode,updateNodeOpt:_d25,isSync:v}));}}catch(err){_iterator5.e(err);}finally{_iterator5.f();}}return T&&P.push({type:vt.None,needUndoTicker:T}),{render:I,sp:P};}}]);}(tn);var l1=/*#__PURE__*/function(_tn5){function l1(){var _this50;_classCallCheck(this,l1);_this50=_callSuper(this,l1,arguments);dt(_this50,"emitEventType",pe.ScaleNode);return _this50;}_inherits(l1,_tn5);return _createClass(l1,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,s=t.emitEventType;if(r===vt.UpdateNode&&n===Kt.Local&&s===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker5=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee13(t){var u,r,n,s,c,l,f,_t13;return _regenerator().w(function(_context14){while(1)switch(_context14.n){case 0:r=t.workId,n=t.updateNodeOpt,s=t.willSyncService,c=t.willSerializeData,l=t.smoothSync,f=t.needUndoTicker;_t13=r===Me&&n;if(!_t13){_context14.n=1;break;}_context14.n=1;return(u=this.localWork)==null?void 0:u.updateSelector({updateSelectorOpt:n,willSyncService:s,willSerializeData:c,isSync:!0,callback:this.updateSelectorCallback.bind(this),smoothSync:l,needUndoTicker:f});case 1:return _context14.a(2);}},_callee13,this);}));function consumeForLocalWorker(_x21){return _consumeForLocalWorker5.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,s=t.workShapeNode,c=t.res,l=t.newServiceStore,f=t.smoothSync,u=r.updateSelectorOpt,v=r.willSyncService,h=r.needUndoTicker,y=u.workState,T=n.render||[],O=n.sp||[],I=c==null?void 0:c.selectRect;if(y===te.Start)return{sp:[],render:[]};if(v){O.push({type:vt.Select,selectIds:s.selectIds,selectRect:I,willSyncService:y===te.Done?!0:f,isSync:!0,points:y===te.Done&&s.getChildrenPoints()||void 0,textOpt:s.textOpt});var P={useAnimation:u.useAnimation||!1};u.uid&&(P.uid=u.uid);var _iterator6=_createForOfIteratorHelper(l.entries()),_step6;try{for(_iterator6.s();!(_step6=_iterator6.n()).done;){var _step6$value=_slicedToArray(_step6.value,2),_w27=_step6$value[0],_d26=_step6$value[1];_d26.toolsType===Tt.BackgroundSVG&&O.push(_objectSpread(_objectSpread({},_d26),{},{workId:_w27,type:vt.BackgroundSVGUpdate,dataType:Kt.Local,willSyncService:y===te.Done?!0:f,updateNodeOpt:P})),_d26.toolsType===Tt.Text?O.push(_objectSpread(_objectSpread({},_d26),{},{workId:_w27,type:vt.TextUpdate,dataType:Kt.Local,willSyncService:y===te.Done?!0:f,updateNodeOpt:P})):(f||y===te.Done)&&O.push(_objectSpread(_objectSpread({},_d26),{},{workId:_w27,type:vt.UpdateNode,updateNodeOpt:P,isSync:!0}));}}catch(err){_iterator6.e(err);}finally{_iterator6.f();}}return h&&O.push({type:vt.None,needUndoTicker:h}),{render:T,sp:O};}}]);}(tn);var f1=/*#__PURE__*/function(_tn6){function f1(){var _this51;_classCallCheck(this,f1);_this51=_callSuper(this,f1,arguments);dt(_this51,"emitEventType",pe.RotateNode);return _this51;}_inherits(f1,_tn6);return _createClass(f1,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,s=t.emitEventType;if(r===vt.UpdateNode&&n===Kt.Local&&s===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker6=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee14(t){var h,r,n,s,c,l,f,u,v,_t14;return _regenerator().w(function(_context15){while(1)switch(_context15.n){case 0:r=t.workId,n=t.updateNodeOpt,s=t.willRefreshSelector,c=t.willSyncService,l=t.willSerializeData,f=t.emitEventType,u=t.smoothSync,v=t.needUndoTicker;_t14=r===Me&&n;if(!_t14){_context15.n=1;break;}_context15.n=1;return(h=this.localWork)==null?void 0:h.updateSelector({updateSelectorOpt:n,willRefreshSelector:s,willSyncService:c,willSerializeData:l,emitEventType:f,isSync:!0,callback:this.updateSelectorCallback,smoothSync:u,needUndoTicker:v});case 1:return _context15.a(2);}},_callee14,this);}));function consumeForLocalWorker(_x22){return _consumeForLocalWorker6.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,s=t.workShapeNode,c=t.res,l=t.newServiceStore,f=t.smoothSync,u=r.updateSelectorOpt,v=r.willSyncService,h=r.willSerializeData,y=r.isSync,T=r.needUndoTicker,O=u.workState,I=n.render||[],P=n.sp||[],w=c==null?void 0:c.selectRect;if(v){h&&O===te.Done&&P.push({type:vt.Select,selectIds:s.selectIds,selectRect:w,willSyncService:!0,isSync:y,points:s.getChildrenPoints(),textOpt:s.textOpt,selectorColor:s.selectorColor,strokeColor:s.strokeColor,fillColor:s.fillColor,canTextEdit:s.canTextEdit,canRotate:s.canRotate,scaleType:s.scaleType,opt:s.getWorkOptions()||void 0,canLock:s.canLock,isLocked:s.isLocked,toolsTypes:s.toolsTypes,shapeOpt:s.shapeOpt,thickness:s.thickness,useStroke:s.useStroke,strokeType:s.strokeType});var _d27={useAnimation:u.useAnimation||!1};if(u.uid&&(_d27.uid=u.uid),f||O===te.Done){var _iterator7=_createForOfIteratorHelper(l.entries()),_step7;try{for(_iterator7.s();!(_step7=_iterator7.n()).done;){var _step7$value=_slicedToArray(_step7.value,2),m=_step7$value[0],p=_step7$value[1];P.push(_objectSpread(_objectSpread({},p),{},{workId:m,type:vt.UpdateNode,updateNodeOpt:_d27,isSync:y}));}}catch(err){_iterator7.e(err);}finally{_iterator7.f();}}}return T&&P.push({type:vt.None,needUndoTicker:T}),{render:I,sp:P};}}]);}(tn);var c1=/*#__PURE__*/function(_tn7){function c1(){var _this52;_classCallCheck(this,c1);_this52=_callSuper(this,c1,arguments);dt(_this52,"emitEventType",pe.SetFontStyle);return _this52;}_inherits(c1,_tn7);return _createClass(c1,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,s=t.emitEventType;if(r===vt.UpdateNode&&n===Kt.Local&&s===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker7=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee15(t){var u,r,n,s,c,l,f,_t15;return _regenerator().w(function(_context16){while(1)switch(_context16.n){case 0:r=t.workId,n=t.updateNodeOpt,s=t.willRefreshSelector,c=t.willSyncService,l=t.willSerializeData,f=t.textUpdateForWoker;_t15=r===Me&&n;if(!_t15){_context16.n=1;break;}_context16.n=1;return(u=this.localWork)==null?void 0:u.updateSelector({updateSelectorOpt:n,willRefreshSelector:s,willSyncService:c,willSerializeData:l,textUpdateForWoker:f,callback:this.updateSelectorCallback});case 1:return _context16.a(2);}},_callee15,this);}));function consumeForLocalWorker(_x23){return _consumeForLocalWorker7.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,s=t.newServiceStore,c=t.workShapeNode,l=t.res,f=r.willSyncService,u=r.isSync,v=r.updateSelectorOpt,h=r.textUpdateForWoker,y=n.render||[],T=n.sp||[],O=l==null?void 0:l.selectRect;if(f&&T){v.fontSize&&T.push({type:vt.Select,selectIds:c.selectIds,selectRect:O,willSyncService:f,isSync:u,points:c.getChildrenPoints()});var _iterator8=_createForOfIteratorHelper(s.entries()),_step8;try{for(_iterator8.s();!(_step8=_iterator8.n()).done;){var _step8$value=_slicedToArray(_step8.value,2),I=_step8$value[0],P=_step8$value[1];h&&P.toolsType===Tt.Text?T.push(_objectSpread(_objectSpread({},P),{},{workId:I,type:vt.TextUpdate,dataType:Kt.Local,willSyncService:!0})):T.push(_objectSpread(_objectSpread({},P),{},{workId:I,type:vt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:u}));}}catch(err){_iterator8.e(err);}finally{_iterator8.f();}}return{render:y,sp:T};}}]);}(tn);var u1=/*#__PURE__*/function(_tn8){function u1(){var _this53;_classCallCheck(this,u1);_this53=_callSuper(this,u1,arguments);dt(_this53,"emitEventType",pe.SetPoint);return _this53;}_inherits(u1,_tn8);return _createClass(u1,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,s=t.emitEventType;if(r===vt.UpdateNode&&n===Kt.Local&&s===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker8=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee16(t){var v,r,n,s,c,l,f,u,_t16;return _regenerator().w(function(_context17){while(1)switch(_context17.n){case 0:r=t.workId,n=t.updateNodeOpt,s=t.willRefreshSelector,c=t.willSyncService,l=t.willSerializeData,f=t.textUpdateForWoker,u=t.needUndoTicker;_t16=r===Me&&n;if(!_t16){_context17.n=1;break;}_context17.n=1;return(v=this.localWork)==null?void 0:v.updateSelector({updateSelectorOpt:n,willRefreshSelector:s,willSyncService:c,emitEventType:this.emitEventType,willSerializeData:l,isSync:!0,textUpdateForWoker:f,callback:this.updateSelectorCallback,needUndoTicker:u});case 1:return _context17.a(2);}},_callee16,this);}));function consumeForLocalWorker(_x24){return _consumeForLocalWorker8.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,s=t.newServiceStore,c=t.workShapeNode,l=t.res,f=r.willSyncService,u=r.isSync,v=r.needUndoTicker,h=n.render||[],y=n.sp||[],T=l==null?void 0:l.selectRect;if(f&&y){var _iterator9=_createForOfIteratorHelper(s.entries()),_step9;try{for(_iterator9.s();!(_step9=_iterator9.n()).done;){var _step9$value=_slicedToArray(_step9.value,2),O=_step9$value[0],I=_step9$value[1];y.push(_objectSpread(_objectSpread({},I),{},{workId:O,type:vt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:u}));}}catch(err){_iterator9.e(err);}finally{_iterator9.f();}y.push({type:vt.Select,selectIds:c.selectIds,selectRect:T,willSyncService:f,isSync:u,points:c.getChildrenPoints()});}return v&&y.push({type:vt.None,needUndoTicker:v}),{render:h,sp:y};}}]);}(tn);var h1=/*#__PURE__*/function(_tn9){function h1(){var _this54;_classCallCheck(this,h1);_this54=_callSuper(this,h1,arguments);dt(_this54,"emitEventType",pe.SetLock);return _this54;}_inherits(h1,_tn9);return _createClass(h1,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,s=t.emitEventType;if(r===vt.UpdateNode&&n===Kt.Local&&s===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker9=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee17(t){var u,r,n,s,c,l,f,_t17;return _regenerator().w(function(_context18){while(1)switch(_context18.n){case 0:r=t.workId,n=t.updateNodeOpt,s=t.willRefreshSelector,c=t.willSyncService,l=t.willSerializeData,f=t.needUndoTicker;_t17=r===Me&&n;if(!_t17){_context18.n=1;break;}_context18.n=1;return(u=this.localWork)==null?void 0:u.updateSelector({updateSelectorOpt:n,willRefreshSelector:s,willSyncService:c,willSerializeData:l,callback:this.updateSelectorCallback,needUndoTicker:f});case 1:return _context18.a(2);}},_callee17,this);}));function consumeForLocalWorker(_x25){return _consumeForLocalWorker9.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,s=t.newServiceStore,c=t.workShapeNode,l=t.res,f=r.willSyncService,u=r.isSync,v=r.updateSelectorOpt,h=r.needUndoTicker,y=n.render||[],T=n.sp||[],O=l==null?void 0:l.selectRect;if(f&&T){var _iterator0=_createForOfIteratorHelper(s.entries()),_step0;try{for(_iterator0.s();!(_step0=_iterator0.n()).done;){var _step0$value=_slicedToArray(_step0.value,2),I=_step0$value[0],P=_step0$value[1];T.push(_objectSpread(_objectSpread({},P),{},{workId:I,type:vt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:u}));}}catch(err){_iterator0.e(err);}finally{_iterator0.f();}T.push({isLocked:v.isLocked,selectorColor:c.selectorColor,scaleType:c.scaleType,canRotate:c.canRotate,type:vt.Select,selectIds:c.selectIds,selectRect:O,willSyncService:f,isSync:u});}return h&&T.push({type:vt.None,needUndoTicker:h}),{render:y,sp:T};}}]);}(tn);var d1=/*#__PURE__*/function(_tn0){function d1(){var _this55;_classCallCheck(this,d1);_this55=_callSuper(this,d1,arguments);dt(_this55,"emitEventType",pe.SetShapeOpt);return _this55;}_inherits(d1,_tn0);return _createClass(d1,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,s=t.emitEventType;if(r===vt.UpdateNode&&n===Kt.Local&&s===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker0=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee18(t){var u,r,n,s,c,l,f,_t18;return _regenerator().w(function(_context19){while(1)switch(_context19.n){case 0:r=t.workId,n=t.updateNodeOpt,s=t.willRefreshSelector,c=t.willSyncService,l=t.willSerializeData,f=t.needUndoTicker;_t18=r===Me&&n;if(!_t18){_context19.n=1;break;}_context19.n=1;return(u=this.localWork)==null?void 0:u.updateSelector({updateSelectorOpt:n,willRefreshSelector:s,willSyncService:c,willSerializeData:l,callback:this.updateSelectorCallback,needUndoTicker:f});case 1:return _context19.a(2);}},_callee18,this);}));function consumeForLocalWorker(_x26){return _consumeForLocalWorker0.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,s=t.newServiceStore,c=r.willSyncService,l=r.isSync,f=r.needUndoTicker,u=n.render||[],v=n.sp||[];if(c&&v){var _iterator1=_createForOfIteratorHelper(s.entries()),_step1;try{for(_iterator1.s();!(_step1=_iterator1.n()).done;){var _step1$value=_slicedToArray(_step1.value,2),h=_step1$value[0],y=_step1$value[1];v.push(_objectSpread(_objectSpread({},y),{},{workId:h,type:vt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:l}));}}catch(err){_iterator1.e(err);}finally{_iterator1.f();}}return f&&v.push({type:vt.None,needUndoTicker:f}),{render:u,sp:v};}}]);}(tn);var ju=/*#__PURE__*/function(){function ju(e){var _this56=this;_classCallCheck(this,ju);dt(this,"builders",/* @__PURE__ */new Map());this.builders=new Map(e.map(function(t){return[t,_this56.build(t)];}));}return _createClass(ju,[{key:"build",value:function build(e){switch(e){case pe.TranslateNode:return new a1();case pe.ZIndexNode:return new o1();case pe.CopyNode:return new n1();case pe.SetColorNode:return new s1();case pe.ScaleNode:return new l1();case pe.RotateNode:return new f1();case pe.SetFontStyle:return new c1();case pe.SetPoint:return new u1();case pe.SetLock:return new h1();case pe.SetShapeOpt:return new d1();}}},{key:"registerForWorker",value:function registerForWorker(e){return this.builders.forEach(function(t){t&&t.registerForWorker(e);}),this;}},{key:"consumeForWorker",value:function consumeForWorker(e){var _iterator10=_createForOfIteratorHelper(this.builders.values()),_step10;try{for(_iterator10.s();!(_step10=_iterator10.n()).done;){var t=_step10.value;if(t!=null&&t.consume(e))return!0;}}catch(err){_iterator10.e(err);}finally{_iterator10.f();}return!1;}}]);}();var p1={linear:function linear(i){return i;},easeInQuad:function easeInQuad(i){return i*i;},easeOutQuad:function easeOutQuad(i){return i*(2-i);},easeInOutQuad:function easeInOutQuad(i){return i<0.5?2*i*i:-1+(4-2*i)*i;},easeInCubic:function easeInCubic(i){return i*i*i;},easeOutCubic:function easeOutCubic(i){return--i*i*i+1;},easeInOutCubic:function easeInOutCubic(i){return i<0.5?4*i*i*i:(i-1)*(2*i-2)*(2*i-2)+1;},easeInQuart:function easeInQuart(i){return i*i*i*i;},easeOutQuart:function easeOutQuart(i){return 1- --i*i*i*i;},easeInOutQuart:function easeInOutQuart(i){return i<0.5?8*i*i*i*i:1-8*--i*i*i*i;},easeInQuint:function easeInQuint(i){return i*i*i*i*i;},easeOutQuint:function easeOutQuint(i){return 1+--i*i*i*i*i;},easeInOutQuint:function easeInOutQuint(i){return i<0.5?16*i*i*i*i*i:1+16*--i*i*i*i*i;},easeInSine:function easeInSine(i){return 1-Math.cos(i*Math.PI/2);},easeOutSine:function easeOutSine(i){return Math.sin(i*Math.PI/2);},easeInOutSine:function easeInOutSine(i){return-(Math.cos(Math.PI*i)-1)/2;},easeInExpo:function easeInExpo(i){return i<=0?0:Math.pow(2,10*i-10);},easeOutExpo:function easeOutExpo(i){return i>=1?1:1-Math.pow(2,-10*i);},easeInOutExpo:function easeInOutExpo(i){return i<=0?0:i>=1?1:i<0.5?Math.pow(2,20*i-10)/2:(2-Math.pow(2,-20*i+10))/2;}};var pt=/*#__PURE__*/function(){function pt(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;_classCallCheck(this,pt);this.x=e,this.y=t,this.z=r;}return _createClass(pt,[{key:"XY",get:function get(){return[this.x,this.y];}},{key:"setz",value:function setz(e){return this.z=e,this;}},{key:"setXY",value:function setXY(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.x;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.y;return this.x=e,this.y=t,this;}},{key:"set",value:function set(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.x;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.y;var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this.z;return this.x=e,this.y=t,this.z=r,this;}},{key:"setTo",value:function setTo(_ref161){var _ref161$x=_ref161.x,e=_ref161$x===void 0?0:_ref161$x,_ref161$y=_ref161.y,t=_ref161$y===void 0?0:_ref161$y,_ref161$z=_ref161.z,r=_ref161$z===void 0?1:_ref161$z;return this.x=e,this.y=t,this.z=r,this;}},{key:"rot",value:function rot(e){if(e===0)return this;var t=this.x,r=this.y,n=Math.sin(e),s=Math.cos(e);return this.x=t*s-r*n,this.y=t*n+r*s,this;}},{key:"rotWith",value:function rotWith(e,t){if(t===0)return this;var r=this.x-e.x,n=this.y-e.y,s=Math.sin(t),c=Math.cos(t);return this.x=e.x+(r*c-n*s),this.y=e.y+(r*s+n*c),this;}},{key:"clone",value:function clone(){var e=this.x,t=this.y,r=this.z;return new pt(e,t,r);}},{key:"sub",value:function sub(e){return this.x-=e.x,this.y-=e.y,this;}},{key:"subXY",value:function subXY(e,t){return this.x-=e,this.y-=t,this;}},{key:"subScalar",value:function subScalar(e){return this.x-=e,this.y-=e,this;}},{key:"add",value:function add(e){return this.x+=e.x,this.y+=e.y,this;}},{key:"addXY",value:function addXY(e,t){return this.x+=e,this.y+=t,this;}},{key:"addScalar",value:function addScalar(e){return this.x+=e,this.y+=e,this;}},{key:"clamp",value:function clamp(e,t){return this.x=Math.max(this.x,e),this.y=Math.max(this.y,e),t!==void 0&&(this.x=Math.min(this.x,t),this.y=Math.min(this.y,t)),this;}},{key:"div",value:function div(e){return this.x/=e,this.y/=e,this;}},{key:"divV",value:function divV(e){return this.x/=e.x,this.y/=e.y,this;}},{key:"mul",value:function mul(e){return this.x*=e,this.y*=e,this;}},{key:"mulV",value:function mulV(e){return this.x*=e.x,this.y*=e.y,this;}},{key:"abs",value:function abs(){return this.x=Math.abs(this.x),this.y=Math.abs(this.y),this;}},{key:"nudge",value:function nudge(e,t){var r=pt.Tan(e,this);return this.add(r.mul(t));}},{key:"neg",value:function neg(){return this.x*=-1,this.y*=-1,this;}},{key:"cross",value:function cross(e){return this.x=this.y*e.z-this.z*e.y,this.y=this.z*e.x-this.x*e.z,this;}},{key:"dpr",value:function dpr(e){return pt.Dpr(this,e);}},{key:"cpr",value:function cpr(e){return pt.Cpr(this,e);}},{key:"len2",value:function len2(){return pt.Len2(this);}},{key:"len",value:function len(){return pt.Len(this);}},{key:"pry",value:function pry(e){return pt.Pry(this,e);}},{key:"per",value:function per(){var e=this.x,t=this.y;return this.x=t,this.y=-e,this;}},{key:"uni",value:function uni(){return pt.Uni(this);}},{key:"tan",value:function tan(e){return pt.Tan(this,e);}},{key:"dist",value:function dist(e){return pt.Dist(this,e);}},{key:"distanceToLineSegment",value:function distanceToLineSegment(e,t){return pt.DistanceToLineSegment(e,t,this);}},{key:"slope",value:function slope(e){return pt.Slope(this,e);}},{key:"snapToGrid",value:function snapToGrid(e){return this.x=Math.round(this.x/e)*e,this.y=Math.round(this.y/e)*e,this;}},{key:"angle",value:function angle(e){return pt.Angle(this,e);}},{key:"toAngle",value:function toAngle(){return pt.ToAngle(this);}},{key:"lrp",value:function lrp(e,t){return this.x=this.x+(e.x-this.x)*t,this.y=this.y+(e.y-this.y)*t,this;}},{key:"equals",value:function equals(e,t){return pt.Equals(this,e,t);}},{key:"equalsXY",value:function equalsXY(e,t){return pt.EqualsXY(this,e,t);}},{key:"norm",value:function norm(){var e=this.len();return this.x=e===0?0:this.x/e,this.y=e===0?0:this.y/e,this;}},{key:"toFixed",value:function toFixed(){return pt.ToFixed(this);}},{key:"toString",value:function toString(){return pt.ToString(pt.ToFixed(this));}},{key:"toJson",value:function toJson(){return pt.ToJson(this);}},{key:"toArray",value:function toArray(){return pt.ToArray(this);}}],[{key:"Add",value:function Add(e,t){return new pt(e.x+t.x,e.y+t.y);}},{key:"AddXY",value:function AddXY(e,t,r){return new pt(e.x+t,e.y+r);}},{key:"Sub",value:function Sub(e,t){return new pt(e.x-t.x,e.y-t.y);}},{key:"SubXY",value:function SubXY(e,t,r){return new pt(e.x-t,e.y-r);}},{key:"AddScalar",value:function AddScalar(e,t){return new pt(e.x+t,e.y+t);}},{key:"SubScalar",value:function SubScalar(e,t){return new pt(e.x-t,e.y-t);}},{key:"Div",value:function Div(e,t){return new pt(e.x/t,e.y/t);}},{key:"Mul",value:function Mul(e,t){return new pt(e.x*t,e.y*t);}},{key:"DivV",value:function DivV(e,t){return new pt(e.x/t.x,e.y/t.y);}},{key:"MulV",value:function MulV(e,t){return new pt(e.x*t.x,e.y*t.y);}},{key:"Neg",value:function Neg(e){return new pt(-e.x,-e.y);}},{key:"Per",value:function Per(e){return new pt(e.y,-e.x);}},{key:"Dist2",value:function Dist2(e,t){return pt.Sub(e,t).len2();}},{key:"Abs",value:function Abs(e){return new pt(Math.abs(e.x),Math.abs(e.y));}},{key:"Dist",value:function Dist(e,t){return Math.hypot(e.y-t.y,e.x-t.x);}},{key:"Dpr",value:function Dpr(e,t){return e.x*t.x+e.y*t.y;}},{key:"Cross",value:function Cross(e,t){return new pt(e.y*t.z-e.z*t.y,e.z*t.x-e.x*t.z// A.z = A.x * V.y - A.y * V.x
|
|
366
|
+
);}},{key:"Cpr",value:function Cpr(e,t){return e.x*t.y-t.x*e.y;}},{key:"Len2",value:function Len2(e){return e.x*e.x+e.y*e.y;}},{key:"Len",value:function Len(e){return Math.hypot(e.x,e.y);}},{key:"Pry",value:function Pry(e,t){return pt.Dpr(e,t)/pt.Len(t);}},{key:"Uni",value:function Uni(e){return pt.Div(e,pt.Len(e));}},{key:"Tan",value:function Tan(e,t){return pt.Uni(pt.Sub(e,t));}},{key:"Min",value:function Min(e,t){return new pt(Math.min(e.x,t.x),Math.min(e.y,t.y));}},{key:"Max",value:function Max(e,t){return new pt(Math.max(e.x,t.x),Math.max(e.y,t.y));}},{key:"From",value:function From(e){return new pt().add(e);}},{key:"FromArray",value:function FromArray(e){return new pt(e[0],e[1]);}},{key:"Rot",value:function Rot(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var r=Math.sin(t),n=Math.cos(t);return new pt(e.x*n-e.y*r,e.x*r+e.y*n);}},{key:"RotWith",value:function RotWith(e,t,r){var n=e.x-t.x,s=e.y-t.y,c=Math.sin(r),l=Math.cos(r);return new pt(t.x+(n*l-s*c),t.y+(n*c+s*l));}/**
|
|
367
|
+
* Get the nearest point on a line with a known unit vector that passes through point A
|
|
368
|
+
*
|
|
369
|
+
* ```ts
|
|
370
|
+
* Vec.nearestPointOnLineThroughPoint(A, u, Point)
|
|
371
|
+
* ```
|
|
372
|
+
*
|
|
373
|
+
* @param A - Any point on the line
|
|
374
|
+
* @param u - The unit vector for the line.
|
|
375
|
+
* @param P - A point not on the line to test.
|
|
376
|
+
*/},{key:"NearestPointOnLineThroughPoint",value:function NearestPointOnLineThroughPoint(e,t,r){return pt.Mul(t,pt.Sub(r,e).pry(t)).add(e);}},{key:"NearestPointOnLineSegment",value:function NearestPointOnLineSegment(e,t,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!0;var s=pt.Tan(t,e),c=pt.Add(e,pt.Mul(s,pt.Sub(r,e).pry(s)));if(n){if(c.x<Math.min(e.x,t.x))return pt.Cast(e.x<t.x?e:t);if(c.x>Math.max(e.x,t.x))return pt.Cast(e.x>t.x?e:t);if(c.y<Math.min(e.y,t.y))return pt.Cast(e.y<t.y?e:t);if(c.y>Math.max(e.y,t.y))return pt.Cast(e.y>t.y?e:t);}return c;}},{key:"DistanceToLineThroughPoint",value:function DistanceToLineThroughPoint(e,t,r){return pt.Dist(r,pt.NearestPointOnLineThroughPoint(e,t,r));}},{key:"DistanceToLineSegment",value:function DistanceToLineSegment(e,t,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!0;return pt.Dist(r,pt.NearestPointOnLineSegment(e,t,r,n));}},{key:"Snap",value:function Snap(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return new pt(Math.round(e.x/t)*t,Math.round(e.y/t)*t);}},{key:"Cast",value:function Cast(e){return e instanceof pt?e:pt.From(e);}},{key:"Slope",value:function Slope(e,t){return e.x===t.y?NaN:(e.y-t.y)/(e.x-t.x);}},{key:"Angle",value:function Angle(e,t){return Math.atan2(t.y-e.y,t.x-e.x);}},{key:"Lrp",value:function Lrp(e,t,r){return pt.Sub(t,e).mul(r).add(e);}},{key:"Med",value:function Med(e,t){return new pt((e.x+t.x)/2,(e.y+t.y)/2);}},{key:"Equals",value:function Equals(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1e-4;return Math.abs(e.x-t.x)<r&&Math.abs(e.y-t.y)<r;}},{key:"EqualsXY",value:function EqualsXY(e,t,r){return e.x===t&&e.y===r;}},{key:"EqualsXYZ",value:function EqualsXYZ(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1e-4;return pt.Equals(e,t,r)&&Math.abs((e.z||0)-(t.z||0))<r;}},{key:"Clockwise",value:function Clockwise(e,t,r){return(r.x-e.x)*(t.y-e.y)-(t.x-e.x)*(r.y-e.y)<0;}},{key:"Rescale",value:function Rescale(e,t){var r=pt.Len(e);return new pt(t*e.x/r,t*e.y/r);}},{key:"ScaleWithOrigin",value:function ScaleWithOrigin(e,t,r){return pt.Sub(e,r).mul(t).add(r);}},{key:"ScaleWOrigin",value:function ScaleWOrigin(e,t,r){return pt.Sub(e,r).mulV(t).add(r);}},{key:"ToFixed",value:function ToFixed(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:2;return new pt(+e.x.toFixed(t),+e.y.toFixed(t),+e.z.toFixed(t));}},{key:"Nudge",value:function Nudge(e,t,r){return pt.Add(e,pt.Tan(t,e).mul(r));}},{key:"ToString",value:function ToString(e){return"".concat(e.x,", ").concat(e.y);}},{key:"ToAngle",value:function ToAngle(e){var t=Math.atan2(e.y,e.x);return t<0&&(t+=Math.PI*2),t;}},{key:"FromAngle",value:function FromAngle(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return new pt(Math.cos(e)*t,Math.sin(e)*t);}},{key:"ToArray",value:function ToArray(e){return[e.x,e.y,e.z];}},{key:"ToJson",value:function ToJson(e){var t=e.x,r=e.y,n=e.z;return{x:t,y:r,z:n};}},{key:"Average",value:function Average(e){var t=e.length,r=new pt(0,0);for(var n=0;n<t;n++)r.add(e[n]);return r.div(t);}},{key:"Clamp",value:function Clamp(e,t,r){return r===void 0?new pt(Math.min(Math.max(e.x,t)),Math.min(Math.max(e.y,t))):new pt(Math.min(Math.max(e.x,t),r),Math.min(Math.max(e.y,t),r));}/**
|
|
377
|
+
* Get an array of points (with simulated pressure) between two points.
|
|
378
|
+
*
|
|
379
|
+
* @param A - The first point.
|
|
380
|
+
* @param B - The second point.
|
|
381
|
+
* @param steps - The number of points to return.
|
|
382
|
+
*/},{key:"PointsBetween",value:function PointsBetween(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:6;var n=[];for(var s=0;s<r;s++){var c=p1.easeInQuad(s/(r-1)),l=pt.Lrp(e,t,c);l.z=Math.min(1,0.5+Math.abs(0.5-v1(c))*0.65),n.push(l);}return n;}},{key:"SnapToGrid",value:function SnapToGrid(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:8;return new pt(Math.round(e.x/t)*t,Math.round(e.y/t)*t);}}]);}();var v1=function v1(i){return i<0.5?2*i*i:-1+(4-2*i)*i;};var Jt=/*#__PURE__*/function(_pt){function Jt(){var _this57;var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{x:0,y:0};var s=arguments.length>4&&arguments[4]!==undefined?arguments[4]:0;var c=arguments.length>5&&arguments[5]!==undefined?arguments[5]:0;_classCallCheck(this,Jt);_this57=_callSuper(this,Jt,[e,t,r]),_this57.x=e,_this57.y=t,_this57.z=r,_this57.v=n,_this57.t=s,_this57.a=c;return _this57;}_inherits(Jt,_pt);return _createClass(Jt,[{key:"timestamp",get:function get(){return this.t;}},{key:"pressure",get:function get(){return this.z;}},{key:"angleNum",get:function get(){return this.a;}},{key:"XY",get:function get(){return[this.x,this.y];}},{key:"setA",value:function setA(e){this.a=e;}},{key:"setT",value:function setT(e){this.t=e;}},{key:"setv",value:function setv(e){return this.v={x:e.x,y:e.y},this;}},{key:"set",value:function set(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.x;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.y;var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this.z;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:this.v;var s=arguments.length>4&&arguments[4]!==undefined?arguments[4]:this.t;var c=arguments.length>5&&arguments[5]!==undefined?arguments[5]:this.a;return this.x=e,this.y=t,this.z=r,this.v=n,this.t=s,this.a=c,this;}},{key:"clone",value:function clone(){var e=this.x,t=this.y,r=this.z,n=this.v,s=this.t,c=this.a,l={x:n.x,y:n.y};return new Jt(e,t,r,l,s,c);}},{key:"distance",value:function distance(e){return Jt.GetDistance(this,e);}},{key:"isNear",value:function isNear(e,t){return Jt.IsNear(this,e,t);}},{key:"getAngleByPoints",value:function getAngleByPoints(e,t){return Jt.GetAngleByPoints(e,this,t);}}],[{key:"Sub",value:function Sub(e,t){return new Jt(e.x-t.x,e.y-t.y);}},{key:"Add",value:function Add(e,t){return new Jt(e.x+t.x,e.y+t.y);}},{key:"GetDistance",value:function GetDistance(e,t){return Jt.Len(e.clone().sub(t));}},{key:"GetAngleByPoints",value:function GetAngleByPoints(e,t,r){var n=t.x-e.x,s=r.x-t.x,c=t.y-e.y,l=r.y-t.y;var f=0;var u=Math.sqrt(n*n+c*c),v=Math.sqrt(s*s+l*l);if(u&&v){var h=n*s+c*l;f=Math.acos(h/(u*v)),f=f/Math.PI*180;var y=n*l-c*s;y=y>0?1:-1,f=180+y*f;}return f;}},{key:"IsNear",value:function IsNear(e,t,r){return Jt.Len(e.clone().sub(t))<r;}},{key:"RotWith",value:function RotWith(e,t,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:2;var s=e.x-t.x,c=e.y-t.y,l=Math.sin(r),f=Math.cos(r),u=Math.pow(10,n),v=Math.floor((t.x+(s*f-c*l))*u)/u,h=Math.floor((t.y+(s*l+c*f))*u)/u;return new Jt(v,h);}/**
|
|
383
|
+
* 根据圆心和半径,获取圆上的等份点
|
|
384
|
+
* @param o 圆心
|
|
385
|
+
* @param radius 半径
|
|
386
|
+
* @param average 均分数
|
|
387
|
+
* @returns
|
|
388
|
+
*/},{key:"GetDotStroke",value:function GetDotStroke(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:16;var n=new pt(1,1),s=Math.PI+1e-3,c=Jt.Add(e,Jt.Sub(e,n).uni().per().mul(-t)),l=[];for(var f=1/r,u=f;u<=1;u+=f)l.push(Jt.RotWith(c,e,s*2*u));return l;}/**
|
|
389
|
+
* 根据圆心和圆上的起始点,获取半圆上的等份点
|
|
390
|
+
* @param o 圆心
|
|
391
|
+
* @param p 圆弧起始点
|
|
392
|
+
* @param radian 1,逆时针180度 -1,顺时针
|
|
393
|
+
* @param average 均分数
|
|
394
|
+
* @returns
|
|
395
|
+
*/},{key:"GetSemicircleStroke",value:function GetSemicircleStroke(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:-1;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:8;var s=r*(Math.PI+1e-3),c=[];for(var l=1/n,f=l;f<=1;f+=l)c.push(Jt.RotWith(t,e,s*f));return c;}}]);}(pt);var hn=(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 Rn(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i["default"]:i;}var g1=_typeof(hn)=="object"&&hn&&hn.Object===Object&&hn,Gu=g1,m1=Gu,y1=(typeof self==="undefined"?"undefined":_typeof(self))=="object"&&self&&self.Object===Object&&self,P1=m1||y1||Function("return this")(),en=P1,S1=en,x1=S1.Symbol,Qi=x1,Gc=Qi,ku=Object.prototype,T1=ku.hasOwnProperty,C1=ku.toString,ji=Gc?Gc.toStringTag:void 0;function I1(i){var e=T1.call(i,ji),t=i[ji];try{i[ji]=void 0;var r=!0;}catch(_unused16){}var n=C1.call(i);return r&&(e?i[ji]=t:delete i[ji]),n;}var w1=I1,O1=Object.prototype,A1=O1.toString;function E1(i){return A1.call(i);}var M1=E1,kc=Qi,L1=w1,R1=M1,b1="[object Null]",D1="[object Undefined]",Hc=kc?kc.toStringTag:void 0;function N1(i){return i==null?i===void 0?D1:b1:Hc&&Hc in Object(i)?L1(i):R1(i);}var yi=N1;function B1(i){return i!=null&&_typeof(i)=="object";}var pn=B1,W1=yi,F1=pn,U1="[object Number]";function Y1(i){return typeof i=="number"||F1(i)&&W1(i)==U1;}var $1=Y1,_e=/* @__PURE__ */Rn($1);function X1(){this.__data__=[],this.size=0;}var z1=X1;function j1(i,e){return i===e||i!==i&&e!==e;}var pl=j1,G1=pl;function k1(i,e){for(var t=i.length;t--;)if(G1(i[t][0],e))return t;return-1;}var po=k1,H1=po,V1=Array.prototype,K1=V1.splice;function Z1(i){var e=this.__data__,t=H1(e,i);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():K1.call(e,t,1),--this.size,!0;}var J1=Z1,Q1=po;function q1(i){var e=this.__data__,t=Q1(e,i);return t<0?void 0:e[t][1];}var _1=q1,tP=po;function eP(i){return tP(this.__data__,i)>-1;}var rP=eP,nP=po;function iP(i,e){var t=this.__data__,r=nP(t,i);return r<0?(++this.size,t.push([i,e])):t[r][1]=e,this;}var sP=iP,oP=z1,aP=J1,lP=_1,fP=rP,cP=sP;function Pi(i){var e=-1,t=i==null?0:i.length;for(this.clear();++e<t;){var r=i[e];this.set(r[0],r[1]);}}Pi.prototype.clear=oP;Pi.prototype["delete"]=aP;Pi.prototype.get=lP;Pi.prototype.has=fP;Pi.prototype.set=cP;var vo=Pi,uP=vo;function hP(){this.__data__=new uP(),this.size=0;}var dP=hP;function pP(i){var e=this.__data__,t=e["delete"](i);return this.size=e.size,t;}var vP=pP;function gP(i){return this.__data__.get(i);}var mP=gP;function yP(i){return this.__data__.has(i);}var PP=yP;function SP(i){var e=_typeof(i);return i!=null&&(e=="object"||e=="function");}var qi=SP,xP=yi,TP=qi,CP="[object AsyncFunction]",IP="[object Function]",wP="[object GeneratorFunction]",OP="[object Proxy]";function AP(i){if(!TP(i))return!1;var e=xP(i);return e==IP||e==wP||e==CP||e==OP;}var Hu=AP,EP=en,MP=EP["__core-js_shared__"],LP=MP,tl=LP,Vc=function(){var i=/[^.]+$/.exec(tl&&tl.keys&&tl.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:"";}();function RP(i){return!!Vc&&Vc in i;}var bP=RP,DP=Function.prototype,NP=DP.toString;function BP(i){if(i!=null){try{return NP.call(i);}catch(_unused17){}try{return i+"";}catch(_unused18){}}return"";}var Vu=BP,WP=Hu,FP=bP,UP=qi,YP=Vu,$P=/[\\^$.*+?()[\]{}|]/g,XP=/^\[object .+?Constructor\]$/,zP=Function.prototype,jP=Object.prototype,GP=zP.toString,kP=jP.hasOwnProperty,HP=RegExp("^"+GP.call(kP).replace($P,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function VP(i){if(!UP(i)||FP(i))return!1;var e=WP(i)?HP:XP;return e.test(YP(i));}var KP=VP;function ZP(i,e){return i==null?void 0:i[e];}var JP=ZP,QP=KP,qP=JP;function _P(i,e){var t=qP(i,e);return QP(t)?t:void 0;}var Gn=_P,tS=Gn,eS=en,rS=tS(eS,"Map"),vl=rS,nS=Gn,iS=nS(Object,"create"),go=iS,Kc=go;function sS(){this.__data__=Kc?Kc(null):{},this.size=0;}var oS=sS;function aS(i){var e=this.has(i)&&delete this.__data__[i];return this.size-=e?1:0,e;}var lS=aS,fS=go,cS="__lodash_hash_undefined__",uS=Object.prototype,hS=uS.hasOwnProperty;function dS(i){var e=this.__data__;if(fS){var t=e[i];return t===cS?void 0:t;}return hS.call(e,i)?e[i]:void 0;}var pS=dS,vS=go,gS=Object.prototype,mS=gS.hasOwnProperty;function yS(i){var e=this.__data__;return vS?e[i]!==void 0:mS.call(e,i);}var PS=yS,SS=go,xS="__lodash_hash_undefined__";function TS(i,e){var t=this.__data__;return this.size+=this.has(i)?0:1,t[i]=SS&&e===void 0?xS:e,this;}var CS=TS,IS=oS,wS=lS,OS=pS,AS=PS,ES=CS;function Si(i){var e=-1,t=i==null?0:i.length;for(this.clear();++e<t;){var r=i[e];this.set(r[0],r[1]);}}Si.prototype.clear=IS;Si.prototype["delete"]=wS;Si.prototype.get=OS;Si.prototype.has=AS;Si.prototype.set=ES;var MS=Si,Zc=MS,LS=vo,RS=vl;function bS(){this.size=0,this.__data__={hash:new Zc(),map:new(RS||LS)(),string:new Zc()};}var DS=bS;function NS(i){var e=_typeof(i);return e=="string"||e=="number"||e=="symbol"||e=="boolean"?i!=="__proto__":i===null;}var BS=NS,WS=BS;function FS(i,e){var t=i.__data__;return WS(e)?t[typeof e=="string"?"string":"hash"]:t.map;}var mo=FS,US=mo;function YS(i){var e=US(this,i)["delete"](i);return this.size-=e?1:0,e;}var $S=YS,XS=mo;function zS(i){return XS(this,i).get(i);}var jS=zS,GS=mo;function kS(i){return GS(this,i).has(i);}var HS=kS,VS=mo;function KS(i,e){var t=VS(this,i),r=t.size;return t.set(i,e),this.size+=t.size==r?0:1,this;}var ZS=KS,JS=DS,QS=$S,qS=jS,_S=HS,tx=ZS;function xi(i){var e=-1,t=i==null?0:i.length;for(this.clear();++e<t;){var r=i[e];this.set(r[0],r[1]);}}xi.prototype.clear=JS;xi.prototype["delete"]=QS;xi.prototype.get=qS;xi.prototype.has=_S;xi.prototype.set=tx;var Ku=xi,ex=vo,rx=vl,nx=Ku,ix=200;function sx(i,e){var t=this.__data__;if(t instanceof ex){var r=t.__data__;if(!rx||r.length<ix-1)return r.push([i,e]),this.size=++t.size,this;t=this.__data__=new nx(r);}return t.set(i,e),this.size=t.size,this;}var ox=sx,ax=vo,lx=dP,fx=vP,cx=mP,ux=PP,hx=ox;function Ti(i){var e=this.__data__=new ax(i);this.size=e.size;}Ti.prototype.clear=lx;Ti.prototype["delete"]=fx;Ti.prototype.get=cx;Ti.prototype.has=ux;Ti.prototype.set=hx;var Zu=Ti;function dx(i,e){for(var t=-1,r=i==null?0:i.length;++t<r&&e(i[t],t,i)!==!1;);return i;}var px=dx,vx=Gn,gx=function(){try{var i=vx(Object,"defineProperty");return i({},"",{}),i;}catch(_unused19){}}(),Ju=gx,Jc=Ju;function mx(i,e,t){e=="__proto__"&&Jc?Jc(i,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):i[e]=t;}var Qu=mx,yx=Qu,Px=pl,Sx=Object.prototype,xx=Sx.hasOwnProperty;function Tx(i,e,t){var r=i[e];(!(xx.call(i,e)&&Px(r,t))||t===void 0&&!(e in i))&&yx(i,e,t);}var qu=Tx,Cx=qu,Ix=Qu;function wx(i,e,t,r){var n=!t;t||(t={});for(var s=-1,c=e.length;++s<c;){var l=e[s],f=r?r(t[l],i[l],l,t,i):void 0;f===void 0&&(f=i[l]),n?Ix(t,l,f):Cx(t,l,f);}return t;}var yo=wx;function Ox(i,e){for(var t=-1,r=Array(i);++t<i;)r[t]=e(t);return r;}var Ax=Ox,Ex=yi,Mx=pn,Lx="[object Arguments]";function Rx(i){return Mx(i)&&Ex(i)==Lx;}var bx=Rx,Qc=bx,Dx=pn,_u=Object.prototype,Nx=_u.hasOwnProperty,Bx=_u.propertyIsEnumerable,Wx=Qc(/* @__PURE__ */function(){return arguments;}())?Qc:function(i){return Dx(i)&&Nx.call(i,"callee")&&!Bx.call(i,"callee");},th=Wx,Fx=Array.isArray,_i=Fx,_s={exports:{}};function Ux(){return!1;}var Yx=Ux;_s.exports;(function(i,e){var t=en,r=Yx,n=e&&!e.nodeType&&e,s=n&&!0&&i&&!i.nodeType&&i,c=s&&s.exports===n,l=c?t.Buffer:void 0,f=l?l.isBuffer:void 0,u=f||r;i.exports=u;})(_s,_s.exports);var gl=_s.exports,$x=9007199254740991,Xx=/^(?:0|[1-9]\d*)$/;function zx(i,e){var t=_typeof(i);return e=e!==null&&e!==void 0?e:$x,!!e&&(t=="number"||t!="symbol"&&Xx.test(i))&&i>-1&&i%1==0&&i<e;}var jx=zx,Gx=9007199254740991;function kx(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=Gx;}var eh=kx,Hx=yi,Vx=eh,Kx=pn,Zx="[object Arguments]",Jx="[object Array]",Qx="[object Boolean]",qx="[object Date]",_x="[object Error]",tT="[object Function]",eT="[object Map]",rT="[object Number]",nT="[object Object]",iT="[object RegExp]",sT="[object Set]",oT="[object String]",aT="[object WeakMap]",lT="[object ArrayBuffer]",fT="[object DataView]",cT="[object Float32Array]",uT="[object Float64Array]",hT="[object Int8Array]",dT="[object Int16Array]",pT="[object Int32Array]",vT="[object Uint8Array]",gT="[object Uint8ClampedArray]",mT="[object Uint16Array]",yT="[object Uint32Array]",je={};je[cT]=je[uT]=je[hT]=je[dT]=je[pT]=je[vT]=je[gT]=je[mT]=je[yT]=!0;je[Zx]=je[Jx]=je[lT]=je[Qx]=je[fT]=je[qx]=je[_x]=je[tT]=je[eT]=je[rT]=je[nT]=je[iT]=je[sT]=je[oT]=je[aT]=!1;function PT(i){return Kx(i)&&Vx(i.length)&&!!je[Hx(i)];}var ST=PT;function xT(i){return function(e){return i(e);};}var Po=xT,to={exports:{}};to.exports;(function(i,e){var t=Gu,r=e&&!e.nodeType&&e,n=r&&!0&&i&&!i.nodeType&&i,s=n&&n.exports===r,c=s&&t.process,l=function(){try{var f=n&&n.require&&n.require("util").types;return f||c&&c.binding&&c.binding("util");}catch(_unused20){}}();i.exports=l;})(to,to.exports);var ml=to.exports,TT=ST,CT=Po,qc=ml,_c=qc&&qc.isTypedArray,IT=_c?CT(_c):TT,rh=IT,wT=Ax,OT=th,AT=_i,ET=gl,MT=jx,LT=rh,RT=Object.prototype,bT=RT.hasOwnProperty;function DT(i,e){var t=AT(i),r=!t&&OT(i),n=!t&&!r&&ET(i),s=!t&&!r&&!n&<(i),c=t||r||n||s,l=c?wT(i.length,String):[],f=l.length;for(var u in i)(e||bT.call(i,u))&&!(c&&(// Safari 9 has enumerable `arguments.length` in strict mode.
|
|
396
|
+
u=="length"||// Node.js 0.10 has enumerable non-index properties on buffers.
|
|
397
|
+
n&&(u=="offset"||u=="parent")||// PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
398
|
+
s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||// Skip index properties.
|
|
399
|
+
MT(u,f)))&&l.push(u);return l;}var nh=DT,NT=Object.prototype;function BT(i){var e=i&&i.constructor,t=typeof e=="function"&&e.prototype||NT;return i===t;}var yl=BT;function WT(i,e){return function(t){return i(e(t));};}var ih=WT,FT=ih,UT=FT(Object.keys,Object),YT=UT,$T=yl,XT=YT,zT=Object.prototype,jT=zT.hasOwnProperty;function GT(i){if(!$T(i))return XT(i);var e=[];for(var t in Object(i))jT.call(i,t)&&t!="constructor"&&e.push(t);return e;}var kT=GT,HT=Hu,VT=eh;function KT(i){return i!=null&&VT(i.length)&&!HT(i);}var Pl=KT,ZT=nh,JT=kT,QT=Pl;function qT(i){return QT(i)?ZT(i):JT(i);}var Sl=qT,_T=yo,tC=Sl;function eC(i,e){return i&&_T(e,tC(e),i);}var rC=eC;function nC(i){var e=[];if(i!=null)for(var t in Object(i))e.push(t);return e;}var iC=nC,sC=qi,oC=yl,aC=iC,lC=Object.prototype,fC=lC.hasOwnProperty;function cC(i){if(!sC(i))return aC(i);var e=oC(i),t=[];for(var r in i)r=="constructor"&&(e||!fC.call(i,r))||t.push(r);return t;}var uC=cC,hC=nh,dC=uC,pC=Pl;function vC(i){return pC(i)?hC(i,!0):dC(i);}var xl=vC,gC=yo,mC=xl;function yC(i,e){return i&&gC(e,mC(e),i);}var PC=yC,eo={exports:{}};eo.exports;(function(i,e){var t=en,r=e&&!e.nodeType&&e,n=r&&!0&&i&&!i.nodeType&&i,s=n&&n.exports===r,c=s?t.Buffer:void 0,l=c?c.allocUnsafe:void 0;function f(u,v){if(v)return u.slice();var h=u.length,y=l?l(h):new u.constructor(h);return u.copy(y),y;}i.exports=f;})(eo,eo.exports);var SC=eo.exports;function xC(i,e){var t=-1,r=i.length;for(e||(e=Array(r));++t<r;)e[t]=i[t];return e;}var TC=xC;function CC(i,e){for(var t=-1,r=i==null?0:i.length,n=0,s=[];++t<r;){var c=i[t];e(c,t,i)&&(s[n++]=c);}return s;}var sh=CC;function IC(){return[];}var oh=IC,wC=sh,OC=oh,AC=Object.prototype,EC=AC.propertyIsEnumerable,tu=Object.getOwnPropertySymbols,MC=tu?function(i){return i==null?[]:(i=Object(i),wC(tu(i),function(e){return EC.call(i,e);}));}:OC,Tl=MC,LC=yo,RC=Tl;function bC(i,e){return LC(i,RC(i),e);}var DC=bC;function NC(i,e){for(var t=-1,r=e.length,n=i.length;++t<r;)i[n+t]=e[t];return i;}var Cl=NC,BC=ih,WC=BC(Object.getPrototypeOf,Object),ah=WC,FC=Cl,UC=ah,YC=Tl,$C=oh,XC=Object.getOwnPropertySymbols,zC=XC?function(i){for(var e=[];i;)FC(e,YC(i)),i=UC(i);return e;}:$C,lh=zC,jC=yo,GC=lh;function kC(i,e){return jC(i,GC(i),e);}var HC=kC,VC=Cl,KC=_i;function ZC(i,e,t){var r=e(i);return KC(i)?r:VC(r,t(i));}var fh=ZC,JC=fh,QC=Tl,qC=Sl;function _C(i){return JC(i,qC,QC);}var ch=_C,tI=fh,eI=lh,rI=xl;function nI(i){return tI(i,rI,eI);}var iI=nI,sI=Gn,oI=en,aI=sI(oI,"DataView"),lI=aI,fI=Gn,cI=en,uI=fI(cI,"Promise"),hI=uI,dI=Gn,pI=en,vI=dI(pI,"Set"),uh=vI,gI=Gn,mI=en,yI=gI(mI,"WeakMap"),PI=yI,ol=lI,al=vl,ll=hI,fl=uh,cl=PI,hh=yi,Ci=Vu,eu="[object Map]",SI="[object Object]",ru="[object Promise]",nu="[object Set]",iu="[object WeakMap]",su="[object DataView]",xI=Ci(ol),TI=Ci(al),CI=Ci(ll),II=Ci(fl),wI=Ci(cl),Xn=hh;(ol&&Xn(new ol(new ArrayBuffer(1)))!=su||al&&Xn(new al())!=eu||ll&&Xn(ll.resolve())!=ru||fl&&Xn(new fl())!=nu||cl&&Xn(new cl())!=iu)&&(Xn=function Xn(i){var e=hh(i),t=e==SI?i.constructor:void 0,r=t?Ci(t):"";if(r)switch(r){case xI:return su;case TI:return eu;case CI:return ru;case II:return nu;case wI:return iu;}return e;});var So=Xn,OI=Object.prototype,AI=OI.hasOwnProperty;function EI(i){var e=i.length,t=new i.constructor(e);return e&&typeof i[0]=="string"&&AI.call(i,"index")&&(t.index=i.index,t.input=i.input),t;}var MI=EI,LI=en,RI=LI.Uint8Array,dh=RI,ou=dh;function bI(i){var e=new i.constructor(i.byteLength);return new ou(e).set(new ou(i)),e;}var Il=bI,DI=Il;function NI(i,e){var t=e?DI(i.buffer):i.buffer;return new i.constructor(t,i.byteOffset,i.byteLength);}var BI=NI,WI=/\w*$/;function FI(i){var e=new i.constructor(i.source,WI.exec(i));return e.lastIndex=i.lastIndex,e;}var UI=FI,au=Qi,lu=au?au.prototype:void 0,fu=lu?lu.valueOf:void 0;function YI(i){return fu?Object(fu.call(i)):{};}var $I=YI,XI=Il;function zI(i,e){var t=e?XI(i.buffer):i.buffer;return new i.constructor(t,i.byteOffset,i.length);}var jI=zI,GI=Il,kI=BI,HI=UI,VI=$I,KI=jI,ZI="[object Boolean]",JI="[object Date]",QI="[object Map]",qI="[object Number]",_I="[object RegExp]",tw="[object Set]",ew="[object String]",rw="[object Symbol]",nw="[object ArrayBuffer]",iw="[object DataView]",sw="[object Float32Array]",ow="[object Float64Array]",aw="[object Int8Array]",lw="[object Int16Array]",fw="[object Int32Array]",cw="[object Uint8Array]",uw="[object Uint8ClampedArray]",hw="[object Uint16Array]",dw="[object Uint32Array]";function pw(i,e,t){var r=i.constructor;switch(e){case nw:return GI(i);case ZI:case JI:return new r(+i);case iw:return kI(i,t);case sw:case ow:case aw:case lw:case fw:case cw:case uw:case hw:case dw:return KI(i,t);case QI:return new r();case qI:case ew:return new r(i);case _I:return HI(i);case tw:return new r();case rw:return VI(i);}}var vw=pw,gw=qi,cu=Object.create,mw=/* @__PURE__ */function(){function i(){}return function(e){if(!gw(e))return{};if(cu)return cu(e);i.prototype=e;var t=new i();return i.prototype=void 0,t;};}(),yw=mw,Pw=yw,Sw=ah,xw=yl;function Tw(i){return typeof i.constructor=="function"&&!xw(i)?Pw(Sw(i)):{};}var Cw=Tw,Iw=So,ww=pn,Ow="[object Map]";function Aw(i){return ww(i)&&Iw(i)==Ow;}var Ew=Aw,Mw=Ew,Lw=Po,uu=ml,hu=uu&&uu.isMap,Rw=hu?Lw(hu):Mw,bw=Rw,Dw=So,Nw=pn,Bw="[object Set]";function Ww(i){return Nw(i)&&Dw(i)==Bw;}var Fw=Ww,Uw=Fw,Yw=Po,du=ml,pu=du&&du.isSet,$w=pu?Yw(pu):Uw,ph=$w,Xw=/* @__PURE__ */Rn(ph),zw=Zu,jw=px,Gw=qu,kw=rC,Hw=PC,Vw=SC,Kw=TC,Zw=DC,Jw=HC,Qw=ch,qw=iI,_w=So,tO=MI,eO=vw,rO=Cw,nO=_i,iO=gl,sO=bw,oO=qi,aO=ph,lO=Sl,fO=xl,cO=1,uO=2,hO=4,vh="[object Arguments]",dO="[object Array]",pO="[object Boolean]",vO="[object Date]",gO="[object Error]",gh="[object Function]",mO="[object GeneratorFunction]",yO="[object Map]",PO="[object Number]",mh="[object Object]",SO="[object RegExp]",xO="[object Set]",TO="[object String]",CO="[object Symbol]",IO="[object WeakMap]",wO="[object ArrayBuffer]",OO="[object DataView]",AO="[object Float32Array]",EO="[object Float64Array]",MO="[object Int8Array]",LO="[object Int16Array]",RO="[object Int32Array]",bO="[object Uint8Array]",DO="[object Uint8ClampedArray]",NO="[object Uint16Array]",BO="[object Uint32Array]",Ye={};Ye[vh]=Ye[dO]=Ye[wO]=Ye[OO]=Ye[pO]=Ye[vO]=Ye[AO]=Ye[EO]=Ye[MO]=Ye[LO]=Ye[RO]=Ye[yO]=Ye[PO]=Ye[mh]=Ye[SO]=Ye[xO]=Ye[TO]=Ye[CO]=Ye[bO]=Ye[DO]=Ye[NO]=Ye[BO]=!0;Ye[gO]=Ye[gh]=Ye[IO]=!1;function Qs(i,e,t,r,n,s){var c,l=e&cO,f=e&uO,u=e&hO;if(t&&(c=n?t(i,r,n,s):t(i)),c!==void 0)return c;if(!oO(i))return i;var v=nO(i);if(v){if(c=tO(i),!l)return Kw(i,c);}else{var h=_w(i),y=h==gh||h==mO;if(iO(i))return Vw(i,l);if(h==mh||h==vh||y&&!n){if(c=f||y?{}:rO(i),!l)return f?Jw(i,Hw(c,i)):Zw(i,kw(c,i));}else{if(!Ye[h])return n?i:{};c=eO(i,h,l);}}s||(s=new zw());var T=s.get(i);if(T)return T;s.set(i,c),aO(i)?i.forEach(function(P){c.add(Qs(P,e,t,P,i,s));}):sO(i)&&i.forEach(function(P,w){c.set(w,Qs(P,e,t,w,i,s));});var O=u?f?qw:Qw:f?fO:lO,I=v?void 0:O(i);return jw(I||i,function(P,w){I&&(w=P,P=i[w]),Gw(c,w,Qs(P,e,t,w,i,s));}),c;}var WO=Qs,FO=WO,UO=1,YO=4;function $O(i){return FO(i,UO|YO);}var XO=$O,fr=/* @__PURE__ */Rn(XO);var yh="1.1.35-beta.0",zO="@netless/appliance-plugin";if((typeof window==="undefined"?"undefined":_typeof(window))<"u"){var i=window.__netlessUA||"";i+=" ".concat(zO,"@").concat(yh),window.__netlessUA=i;}var gr={syncOpt:{interval:300},bufferSize:{full:2e4,sub:600},bezier:{combineUnitTime:300},pencilEraser:{maxImageWidth:1920,maxImageHeight:1920,maxCombineTime:500}};function Mn(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var t=i.length;if(t<2)return"";var r=i[0],n=i[1];if(t===2)return"M".concat(fi(r),"L").concat(fi(n));var s="";for(var c=2,l=t-1;c<l;c++)r=i[c],n=i[c+1],s+=ci(r,n);return e?"M".concat(ci(i[0],i[1]),"Q").concat(fi(i[1])).concat(ci(i[1],i[2]),"T").concat(s).concat(ci(i[t-1],i[0])).concat(ci(i[0],i[1]),"Z"):"M".concat(fi(i[0]),"Q").concat(fi(i[1])).concat(ci(i[1],i[2])).concat(i.length>3?"T":"").concat(s,"L").concat(fi(i[t-1]));}var Lr=/*#__PURE__*/function(){function Lr(e){_classCallCheck(this,Lr);dt(this,"maxImageWidth",gr.pencilEraser.maxImageWidth);dt(this,"maxImageHeight",gr.pencilEraser.maxImageHeight);dt(this,"syncUnitTime",gr.syncOpt.interval);dt(this,"vNodes");dt(this,"drawLayer");dt(this,"fullLayer");dt(this,"workId");dt(this,"isDelete",!1);var t=e.vNodes,r=e.fullLayer,n=e.drawLayer,s=e.workId,c=e.toolsOpt;this.vNodes=t,this.fullLayer=r,this.drawLayer=n,this.workId=s,this.syncUnitTime=c.syncUnitTime||this.syncUnitTime;}return _createClass(Lr,[{key:"baseConsumeResult",get:function get(){return{workId:this.workId,toolsType:this.toolsType,opt:this.workOptions};}},{key:"filterSamePoints",value:function filterSamePoints(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.01;return e.reduce(function(r,n){var s=r[r.length-1];return(n&&!s||n&&s&&!n.isNear(s,t))&&r.push(n),r;},[]);}/** 设置工作id */},{key:"setWorkId",value:function setWorkId(e){this.workId=e;}},{key:"getWorkId",value:function getWorkId(){return this.workId;}/** 获取工作选项配置 */},{key:"getWorkOptions",value:function getWorkOptions(){return this.workOptions;}/** 设置工作选项配置 */},{key:"setWorkOptions",value:function setWorkOptions(e){var n,s,c;this.workOptions=e,this.syncUnitTime=e.syncUnitTime||this.syncUnitTime;var t=(n=this.workId)==null?void 0:n.toString(),r=t&&((s=this.vNodes)==null?void 0:s.get(t))||void 0;t&&r&&(r.opt=e,(c=this.vNodes)==null||c.setInfo(t,r));}/** 更新服务端同步配置,返回绘制结果 */},{key:"updataOptService",value:function updataOptService(e){var n,s;var t;var r=(n=this.workId)==null?void 0:n.toString();if(r&&e){var c=this.fullLayer.getElementsByName(r)||this.drawLayer&&this.drawLayer.getElementsByName(r)||[];if(c.length!==1)return;var l=c[0],f=e.pos,u=e.zIndex,v=e.scale,h=e.angle,y=e.translate,T={};_e(u)&&(T.zIndex=u),f&&(T.pos=[f[0],f[1]]),v&&(T.scale=v),h&&(T.rotate=h),y&&(T.translate=y),l.attr(T);var O=l==null?void 0:l.getBoundingClientRect();return O&&(t=Zt(t,{x:Math.floor(O.x-Lr.SafeBorderPadding),y:Math.floor(O.y-Lr.SafeBorderPadding),w:Math.floor(O.width+Lr.SafeBorderPadding*2),h:Math.floor(O.height+Lr.SafeBorderPadding*2)})),(s=this.vNodes)==null||s.setInfo(r,{rect:t,centerPos:f}),t;}}},{key:"drawEraserlines",value:function drawEraserlines(e,t){var r=e.group,n=e.eraserlines,s=e.pos,c=e.layer,l=c.parent;if(t)try{var u=(c.renderer.glRenderer||c.renderer.canvasRenderer).options.displayRatio,v=r.getBoundingClientRect(),h=v.width*u*c.worldScaling[0],y=v.height*u*c.worldScaling[1];var T=1;(h>this.maxImageWidth||y>this.maxImageHeight)&&(T=Math.min(this.maxImageWidth/h,this.maxImageHeight/y));var O=c.getAttribute("scale");O=[O[0]*T,O[1]*T];var I=c.parent.parent,P=c.getAttribute("translate"),_w28=this.createVmRenderNode("".concat(this.workId,"_bitMapLayer"),I,{offscreen:l.offscreen,width:l.width,height:l.height,contextType:"2d",autoRender:!1,bufferSize:500},O,P),_d28=r.cloneNode(!0);if(!n||!n.length)return;this.addEraserlines(_d28,n,s,!1),_w28.appendChild(_d28);var m=_w28.parent;m.render();var p=_w28.renderer.canvasRenderer,S=p.context;if(!S)return;var E=p.options.displayRatio,R=_d28.getBoundingClientRect(),D={x:R.x,y:R.y,w:R.width,h:R.height},U={x:0,y:0,w:I.width,h:I.height};if(Ji(D,U)===Tr.outside){Rr(_d28,m),I.removeChild(m),this.isDelete=!0;return;}var W=fr(D);W.x=Math.floor(Math.max(D.x,0)),W.y=Math.floor(Math.max(D.y,0)),W.w=Math.min(D.x+D.w,I.width)-W.x,W.h=Math.min(D.y+D.h,I.height)-W.y;var $=this.getGroupRect(W,E),B=$.x,N=$.y,z=$.w,J=$.h;var et=S.getImageData(B,N,z,J);if(this.isTransparentRectByCanvas(et)){Rr(_d28,m),I.removeChild(m),this.isDelete=!0,et=null;return;}Rr(r,l);var ct=this.createSpriteNode({imageData:et,safariRect:W,originRect:D,worldScaling:_w28.worldScaling});ct&&r.append(ct),Rr(_d28,m),I.removeChild(m),l.deleteTexture(et),et=null;}catch(f){console.error("[BaseShapeTool] drawEraserlines error:",f);return;}}},{key:"createVmRenderNode",value:function createVmRenderNode(e,t,r,n,s){var c=r.width,l=r.height,f="bitMap-".concat(e),u=t.layer(f,r),v=new cr({anchor:[0.5,0.5],pos:[c*0.5,l*0.5],size:[c,l],name:"viewport",id:e});return v.setAttribute("scale",n),v.setAttribute("translate",s),u.append(v),v;}},{key:"getGroupRect",value:function getGroupRect(e,t){var r=Math.floor(e.x*t),n=Math.floor(e.y*t),s=Math.floor(e.w*t),c=Math.floor(e.h*t);return{x:r,y:n,w:s,h:c};}},{key:"addEraserlines",value:function addEraserlines(e,t,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!0;var _iterator11=_createForOfIteratorHelper(t),_step11;try{for(_iterator11.s();!(_step11=_iterator11.n()).done;){var s=_step11.value;var c=s.thickness,l=s.op;var _iterator12=_createForOfIteratorHelper(l),_step12;try{for(_iterator12.s();!(_step12=_iterator12.n()).done;){var f=_step12.value;var u=f.map(function(O,I){return I%2?O-r[1]:O-r[0];}),v=this.computEraserPoints(u,c),h=Mn(v,!0),y={pos:[0,0],d:h,fillColor:"rgba(0,0,0,1)"},T=new Ln(y);T.addEventListener("beforerender",function(_ref162){var O=_ref162.detail;var I=O.context;n?I.blendFuncSeparate(I.ZERO,I.ZERO,I.ZERO,I.ZERO):I.globalCompositeOperation="destination-out";}),T.addEventListener("afterrender",function(_ref163){var O=_ref163.detail;var I=O.context;n?I.blendFuncSeparate(I.SRC_ALPHA,I.ONE_MINUS_SRC_ALPHA,I.ONE,I.ONE_MINUS_SRC_ALPHA):I.globalCompositeOperation="source-over";}),e.append(T);}}catch(err){_iterator12.e(err);}finally{_iterator12.f();}}}catch(err){_iterator11.e(err);}finally{_iterator11.f();}}},{key:"isTransparentRectByCanvas",value:function isTransparentRectByCanvas(e){var t=!0;for(var r=0;r<e.data.length;r+=4)if(e.data[r+3]!==0){t=!1;break;}return t;}},{key:"createSpriteNode",value:function createSpriteNode(e){var t=e.imageData,r=e.worldScaling,n=e.safariRect,s=e.originRect;var c;if(typeof OffscreenCanvas=="function"){c=new OffscreenCanvas(t.width,t.height);var v=c.getContext("2d");v&&v.putImageData(t,0,0);}else if((typeof document==="undefined"?"undefined":_typeof(document))<"u"){c=document.createElement("canvas"),c.width=t.width,c.height=t.height;var _v4=c.getContext("2d");_v4&&_v4.putImageData(t,0,0);}if(!c)return console.warn("Failed to create imageEraserBitmap Sprite"),null;var l=[Math.floor(s.w/r[0]),Math.floor(s.h/r[1])],f=[Math.floor((n.x-s.x)/r[0]),Math.floor((n.y-s.y)/r[1]),Math.floor(n.w/r[0]),Math.floor(n.h/r[1])],u={name:"eraserTexture",anchor:[0.5,0.5],pos:[0,0],size:l,texture:c,textureRect:f};return new zu(u);}},{key:"computEraserPoints",value:function computEraserPoints(e,t){var r=Math.ceil(t/2);return e.length===2?this.computDot(e,r):this.computLine(e,r);}},{key:"computDot",value:function computDot(e,t){var r=new Jt(e[0],e[1]);return Jt.GetDotStroke(r,t,8);}},{key:"computLine",value:function computLine(e,t){var r=[],n=[];var s,c;for(var l=0;l<e.length;l+=2){var f=new Jt(e[l],e[l+1]);var u=void 0;if(l==e.length-2){var v=new Jt(e[l-2],e[l-1]);u=pt.Sub(f,v).uni(),s=f;}else{l===0&&(c=f);var _v5=new Jt(e[l+2],e[l+3]);u=pt.Sub(_v5,f).uni();}if(u){var _v6=pt.Per(u).mul(t);r.push(Jt.Sub(f,_v6)),n.push(Jt.Add(f,_v6));}}if(s&&c){var _l3=Jt.GetSemicircleStroke(s,r[r.length-1],-1,8),_f4=Jt.GetSemicircleStroke(c,n[0],-1,8);return r.concat(_l3,n.reverse(),_f4);}return[];}},{key:"replace",value:function replace(e,t,r){var _this58=this;var s;if(!t){r&&e.append(r);return;}var n=e.getElementsByName(t);if(n.length){var _iterator13=_createForOfIteratorHelper(n),_step13;try{for(_iterator13.s();!(_step13=_iterator13.n()).done;){var c=_step13.value;r?oE(r,c,e):(c.remove(),_vr(c,e.parent));}}catch(err){_iterator13.e(err);}finally{_iterator13.f();}}else r&&e.append(r);this.fullLayer!==this.drawLayer&&(this.fullLayer===e?(s=this.drawLayer)==null||s.getElementsByName(t).forEach(function(l){var f;l.remove(),_vr(l,(f=_this58.drawLayer)==null?void 0:f.parent);}):this.fullLayer.getElementsByName(t).forEach(function(l){l.remove(),_vr(l,_this58.fullLayer.parent);}));}},{key:"removeDrawCountNodes",value:function removeDrawCountNodes(e,t){var r=[];e.getElementsByName(this.workId).forEach(function(n){n.id&&t&&Number(n.id)<t&&r.push(n);});for(var _i2=0,_r3=r;_i2<_r3.length;_i2++){var n=_r3[_i2];n.remove(),_vr(n,e.parent);}}}],[{key:"updateNodeOpt",value:function updateNodeOpt(e){var d;var t=e.node,r=e.opt,n=e.vNodes,s=e.willSerializeData,c=e.targetNode,l=r.zIndex,f=r.translate,u=r.angle,v=r.originPoint,h=r.scenePoint,y=r.scale,T=r.pointMap,O=r.thickness;var I;var P=c&&fr(c)||n.get(t.name);if(!P)return;_e(l)&&(t.setAttribute("zIndex",l),P.opt.zIndex=l);var w=t.parent;if(w){if(v&&y&&c){var m=[P.op[0],P.op[1]];Co(P.op,h,y,f);var p=[P.op[0],P.op[1]],S=[p[0]-m[0],p[1]-m[1]];if(P.centerPos=[P.centerPos[0]+S[0],P.centerPos[1]+S[1]],P.opt.translate=void 0,P.opt.scale=void 0,P.opt.eraserlines)for(var E=0;E<P.opt.eraserlines.length;E++){var _P$opt$eraserlines$E=P.opt.eraserlines[E],R=_P$opt$eraserlines$E.op,D=_P$opt$eraserlines$E.thickness;P.opt.eraserlines[E].thickness=Math.round(D*Math.max(y[0],y[1]));for(var U=0;U<R.length;U++)Dl(R[U],h,y,f);}}else if(f){if(t.setAttribute("translate",f),P.opt.translate=f,c){var _m6=[f[0]*w.worldScaling[0],f[1]*w.worldScaling[1]];I=Zi(P.rect,_m6),P.rect=I;}else{var _m7=Lr.getRectFromLayer(w,t.name);P.rect=_m7||P.rect;}}else if(_e(u))if(t.setAttribute("rotate",u),P.opt.rotate=u,c)I=bl(P.rect,u),P.rect=I;else{var _m8=Lr.getRectFromLayer(w,t.name);P.rect=_m8||P.rect;}if(T){var _m9=T.get(t.name);if(_m9)for(var _p0=0,_S0=0;_p0<P.op.length;_p0+=3,_S0++)P.op[_p0]=_m9[_S0][0],P.op[_p0+1]=_m9[_S0][1];}if(O&&(d=P==null?void 0:P.opt)!=null&&d.thickness&&(P.opt.thickness=O),s&&!(v&&y&&c)){if(f){var _m0=P.op.map(function(p,S){var E=S%3;return E===0?p+f[0]:E===1?p+f[1]:p;});if(P.op=_m0,P.centerPos=[P.centerPos[0]+f[0],P.centerPos[1]+f[1]],P!=null&&P.opt&&(P.opt.translate=void 0),P.opt.eraserlines)for(var _p1=0;_p1<P.opt.eraserlines.length;_p1++){var _S1=P.opt.eraserlines[_p1].op;for(var _E7=0;_E7<_S1.length;_E7++){var _R3=_S1[_E7].map(function(D,U){return U%2?D+f[1]:D+f[0];});P.opt.eraserlines[_p1].op[_E7]=_R3;}}}else if(_e(u)){var _m1=P.op;if(qA(_m1,P.centerPos,u),P.op=_m1,P!=null&&P.opt&&(P.opt.rotate=void 0),P.opt.eraserlines)for(var _p10=0;_p10<P.opt.eraserlines.length;_p10++){var _S10=P.opt.eraserlines[_p10].op;for(var _E8=0;_E8<_S10.length;_E8++)_A(_S10[_E8],P.centerPos,u);}}}P&&n.setInfo(t.name,P);}}},{key:"getCenterPos",value:function getCenterPos(e,t){var r=t.worldPosition,n=t.worldScaling;return[(e.x+e.w/2-r[0])/n[0],(e.y+e.h/2-r[1])/n[1]];}},{key:"getRectFromLayer",value:function getRectFromLayer(e,t){var r=e.getElementsByName(t)[0];if(r){var n=r.getBoundingClientRect();return{x:Math.floor(n.x-Lr.SafeBorderPadding),y:Math.floor(n.y-Lr.SafeBorderPadding),w:Math.floor(n.width+Lr.SafeBorderPadding*2),h:Math.floor(n.height+Lr.SafeBorderPadding*2)};}}},{key:"isWillRefresh",value:function isWillRefresh(e){var t=e.toolsType,r=e.opt,n=e.node,s=e.updateOpt,c=e.willSerializeData;return!!(c&&(s.angle||s.translate)||s.thickness&&r.thickness&&r.thickness!==s.thickness||s.strokeType&&r.strokeType&&r.strokeType!==s.strokeType||s.originPoint&&s.scenePoint&&s.scale||s.pointMap&&s.pointMap.has(n.name)||t===Tt.Text&&(s.fontSize||s.translate||s.textInfos&&s.textInfos.get(n.name))||t===Tt.BackgroundSVG&&(s.translate||s.scale)||t===Tt.Image&&(s.angle||s.translate||s.scale||s.strokeColor&&r.type===ho.Iconify)||t===s.toolsType&&s.willRefresh||r.eraserlines&&r.eraserlines.length&&(s.strokeColor||s.fillColor));}}]);}();dt(Lr,"SafeBorderPadding",10);var $t=Lr;var wl=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})]);var Ph={exports:{}};(function(i){var e=function(){var t=String.fromCharCode,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",s={};function c(f,u){if(!s[f]){s[f]={};for(var v=0;v<f.length;v++)s[f][f.charAt(v)]=v;}return s[f][u];}var l={compressToBase64:function compressToBase64(f){if(f==null)return"";var u=l._compress(f,6,function(v){return r.charAt(v);});switch(u.length%4){default:case 0:return u;case 1:return u+"===";case 2:return u+"==";case 3:return u+"=";}},decompressFromBase64:function decompressFromBase64(f){return f==null?"":f==""?null:l._decompress(f.length,32,function(u){return c(r,f.charAt(u));});},compressToUTF16:function compressToUTF16(f){return f==null?"":l._compress(f,15,function(u){return t(u+32);})+" ";},decompressFromUTF16:function decompressFromUTF16(f){return f==null?"":f==""?null:l._decompress(f.length,16384,function(u){return f.charCodeAt(u)-32;});},//compress into uint8array (UCS-2 big endian format)
|
|
400
|
+
compressToUint8Array:function compressToUint8Array(f){for(var u=l.compress(f),v=new Uint8Array(u.length*2),h=0,y=u.length;h<y;h++){var T=u.charCodeAt(h);v[h*2]=T>>>8,v[h*2+1]=T%256;}return v;},//decompress from uint8array (UCS-2 big endian format)
|
|
401
|
+
decompressFromUint8Array:function decompressFromUint8Array(f){if(f==null)return l.decompress(f);for(var u=new Array(f.length/2),v=0,h=u.length;v<h;v++)u[v]=f[v*2]*256+f[v*2+1];var y=[];return u.forEach(function(T){y.push(t(T));}),l.decompress(y.join(""));},//compress into a string that is already URI encoded
|
|
402
|
+
compressToEncodedURIComponent:function compressToEncodedURIComponent(f){return f==null?"":l._compress(f,6,function(u){return n.charAt(u);});},//decompress from an output of compressToEncodedURIComponent
|
|
403
|
+
decompressFromEncodedURIComponent:function decompressFromEncodedURIComponent(f){return f==null?"":f==""?null:(f=f.replace(/ /g,"+"),l._decompress(f.length,32,function(u){return c(n,f.charAt(u));}));},compress:function compress(f){return l._compress(f,16,function(u){return t(u);});},_compress:function _compress(f,u,v){if(f==null)return"";var h,y,T={},O={},I="",P="",w="",d=2,m=3,p=2,S=[],E=0,R=0,D;for(D=0;D<f.length;D+=1)if(I=f.charAt(D),Object.prototype.hasOwnProperty.call(T,I)||(T[I]=m++,O[I]=!0),P=w+I,Object.prototype.hasOwnProperty.call(T,P))w=P;else{if(Object.prototype.hasOwnProperty.call(O,w)){if(w.charCodeAt(0)<256){for(h=0;h<p;h++)E=E<<1,R==u-1?(R=0,S.push(v(E)),E=0):R++;for(y=w.charCodeAt(0),h=0;h<8;h++)E=E<<1|y&1,R==u-1?(R=0,S.push(v(E)),E=0):R++,y=y>>1;}else{for(y=1,h=0;h<p;h++)E=E<<1|y,R==u-1?(R=0,S.push(v(E)),E=0):R++,y=0;for(y=w.charCodeAt(0),h=0;h<16;h++)E=E<<1|y&1,R==u-1?(R=0,S.push(v(E)),E=0):R++,y=y>>1;}d--,d==0&&(d=Math.pow(2,p),p++),delete O[w];}else for(y=T[w],h=0;h<p;h++)E=E<<1|y&1,R==u-1?(R=0,S.push(v(E)),E=0):R++,y=y>>1;d--,d==0&&(d=Math.pow(2,p),p++),T[P]=m++,w=String(I);}if(w!==""){if(Object.prototype.hasOwnProperty.call(O,w)){if(w.charCodeAt(0)<256){for(h=0;h<p;h++)E=E<<1,R==u-1?(R=0,S.push(v(E)),E=0):R++;for(y=w.charCodeAt(0),h=0;h<8;h++)E=E<<1|y&1,R==u-1?(R=0,S.push(v(E)),E=0):R++,y=y>>1;}else{for(y=1,h=0;h<p;h++)E=E<<1|y,R==u-1?(R=0,S.push(v(E)),E=0):R++,y=0;for(y=w.charCodeAt(0),h=0;h<16;h++)E=E<<1|y&1,R==u-1?(R=0,S.push(v(E)),E=0):R++,y=y>>1;}d--,d==0&&(d=Math.pow(2,p),p++),delete O[w];}else for(y=T[w],h=0;h<p;h++)E=E<<1|y&1,R==u-1?(R=0,S.push(v(E)),E=0):R++,y=y>>1;d--,d==0&&(d=Math.pow(2,p),p++);}for(y=2,h=0;h<p;h++)E=E<<1|y&1,R==u-1?(R=0,S.push(v(E)),E=0):R++,y=y>>1;for(;;)if(E=E<<1,R==u-1){S.push(v(E));break;}else R++;return S.join("");},decompress:function decompress(f){return f==null?"":f==""?null:l._decompress(f.length,32768,function(u){return f.charCodeAt(u);});},_decompress:function _decompress(f,u,v){var h=[],y=4,T=4,O=3,I="",P=[],w,d,m,p,S,E,R,D={val:v(0),position:u,index:1};for(w=0;w<3;w+=1)h[w]=w;for(m=0,S=Math.pow(2,2),E=1;E!=S;)p=D.val&D.position,D.position>>=1,D.position==0&&(D.position=u,D.val=v(D.index++)),m|=(p>0?1:0)*E,E<<=1;switch(m){case 0:for(m=0,S=Math.pow(2,8),E=1;E!=S;)p=D.val&D.position,D.position>>=1,D.position==0&&(D.position=u,D.val=v(D.index++)),m|=(p>0?1:0)*E,E<<=1;R=t(m);break;case 1:for(m=0,S=Math.pow(2,16),E=1;E!=S;)p=D.val&D.position,D.position>>=1,D.position==0&&(D.position=u,D.val=v(D.index++)),m|=(p>0?1:0)*E,E<<=1;R=t(m);break;case 2:return"";}for(h[3]=R,d=R,P.push(R);;){if(D.index>f)return"";for(m=0,S=Math.pow(2,O),E=1;E!=S;)p=D.val&D.position,D.position>>=1,D.position==0&&(D.position=u,D.val=v(D.index++)),m|=(p>0?1:0)*E,E<<=1;switch(R=m){case 0:for(m=0,S=Math.pow(2,8),E=1;E!=S;)p=D.val&D.position,D.position>>=1,D.position==0&&(D.position=u,D.val=v(D.index++)),m|=(p>0?1:0)*E,E<<=1;h[T++]=t(m),R=T-1,y--;break;case 1:for(m=0,S=Math.pow(2,16),E=1;E!=S;)p=D.val&D.position,D.position>>=1,D.position==0&&(D.position=u,D.val=v(D.index++)),m|=(p>0?1:0)*E,E<<=1;h[T++]=t(m),R=T-1,y--;break;case 2:return P.join("");}if(y==0&&(y=Math.pow(2,O),O++),h[R])I=h[R];else if(R===T)I=d+d.charAt(0);else return null;P.push(I),h[T++]=d+I.charAt(0),y--,d=I,y==0&&(y=Math.pow(2,O),O++);}}};return l;}();i!=null?i.exports=e:(typeof angular==="undefined"?"undefined":_typeof(angular))<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return e;});})(Ph);var Sh=Ph.exports;function mi(i){return JSON.parse(Sh.decompress(i));}function mr(i){return Sh.compress(JSON.stringify(i));}var xh={exports:{}};(function(i){(function(){var e={};e.version="6.4.2.2",e.use_lines=!0,e.use_xyz=!1;var t=!1;i.exports?(i.exports=e,t=!0):(typeof document==="undefined"?"undefined":_typeof(document))<"u"?window.ClipperLib=e:self.ClipperLib=e;var r;if(t){var n="chrome";r="Netscape";}else{var n=navigator.userAgent.toString().toLowerCase();r=navigator.appName;}var s={};n.indexOf("chrome")!=-1&&n.indexOf("chromium")==-1?s.chrome=1:s.chrome=0,n.indexOf("chromium")!=-1?s.chromium=1:s.chromium=0,n.indexOf("safari")!=-1&&n.indexOf("chrome")==-1&&n.indexOf("chromium")==-1?s.safari=1:s.safari=0,n.indexOf("firefox")!=-1?s.firefox=1:s.firefox=0,n.indexOf("firefox/17")!=-1?s.firefox17=1:s.firefox17=0,n.indexOf("firefox/15")!=-1?s.firefox15=1:s.firefox15=0,n.indexOf("firefox/3")!=-1?s.firefox3=1:s.firefox3=0,n.indexOf("opera")!=-1?s.opera=1:s.opera=0,n.indexOf("msie 10")!=-1?s.msie10=1:s.msie10=0,n.indexOf("msie 9")!=-1?s.msie9=1:s.msie9=0,n.indexOf("msie 8")!=-1?s.msie8=1:s.msie8=0,n.indexOf("msie 7")!=-1?s.msie7=1:s.msie7=0,n.indexOf("msie ")!=-1?s.msie=1:s.msie=0,e.biginteger_used=null;var c;function l(a,x,A){e.biginteger_used=1,a!=null&&(typeof a=="number"&&_typeof(x)>"u"?this.fromInt(a):typeof a=="number"?this.fromNumber(a,x,A):x==null&&typeof a!="string"?this.fromString(a,256):this.fromString(a,x));}function f(){return new l(null,void 0,void 0);}function u(a,x,A,F,j,_){for(;--_>=0;){var st=x*this[a++]+A[F]+j;j=Math.floor(st/67108864),A[F++]=st&67108863;}return j;}function v(a,x,A,F,j,_){for(var st=x&32767,Pt=x>>15;--_>=0;){var xt=this[a]&32767,Dt=this[a++]>>15,Ht=Pt*xt+Dt*st;xt=st*xt+((Ht&32767)<<15)+A[F]+(j&1073741823),j=(xt>>>30)+(Ht>>>15)+Pt*Dt+(j>>>30),A[F++]=xt&1073741823;}return j;}function h(a,x,A,F,j,_){for(var st=x&16383,Pt=x>>14;--_>=0;){var xt=this[a]&16383,Dt=this[a++]>>14,Ht=Pt*xt+Dt*st;xt=st*xt+((Ht&16383)<<14)+A[F]+j,j=(xt>>28)+(Ht>>14)+Pt*Dt,A[F++]=xt&268435455;}return j;}r=="Microsoft Internet Explorer"?(l.prototype.am=v,c=30):r!="Netscape"?(l.prototype.am=u,c=26):(l.prototype.am=h,c=28),l.prototype.DB=c,l.prototype.DM=(1<<c)-1,l.prototype.DV=1<<c;var y=52;l.prototype.FV=Math.pow(2,y),l.prototype.F1=y-c,l.prototype.F2=2*c-y;var T="0123456789abcdefghijklmnopqrstuvwxyz",O=new Array(),I,P;for(I=48,P=0;P<=9;++P)O[I++]=P;for(I=97,P=10;P<36;++P)O[I++]=P;for(I=65,P=10;P<36;++P)O[I++]=P;function w(a){return T.charAt(a);}function d(a,x){var A=O[a.charCodeAt(x)];return A!==null&&A!==void 0?A:-1;}function m(a){for(var x=this.t-1;x>=0;--x)a[x]=this[x];a.t=this.t,a.s=this.s;}function p(a){this.t=1,this.s=a<0?-1:0,a>0?this[0]=a:a<-1?this[0]=a+this.DV:this.t=0;}function S(a){var x=f();return x.fromInt(a),x;}function E(a,x){var A;if(x==16)A=4;else if(x==8)A=3;else if(x==256)A=8;else if(x==2)A=1;else if(x==32)A=5;else if(x==4)A=2;else{this.fromRadix(a,x);return;}this.t=0,this.s=0;for(var F=a.length,j=!1,_=0;--F>=0;){var st=A==8?a[F]&255:d(a,F);if(st<0){a.charAt(F)=="-"&&(j=!0);continue;}j=!1,_==0?this[this.t++]=st:_+A>this.DB?(this[this.t-1]|=(st&(1<<this.DB-_)-1)<<_,this[this.t++]=st>>this.DB-_):this[this.t-1]|=st<<_,_+=A,_>=this.DB&&(_-=this.DB);}A==8&&a[0]&128&&(this.s=-1,_>0&&(this[this.t-1]|=(1<<this.DB-_)-1<<_)),this.clamp(),j&&l.ZERO.subTo(this,this);}function R(){for(var a=this.s&this.DM;this.t>0&&this[this.t-1]==a;)--this.t;}function D(a){if(this.s<0)return"-"+this.negate().toString(a);var x;if(a==16)x=4;else if(a==8)x=3;else if(a==2)x=1;else if(a==32)x=5;else if(a==4)x=2;else return this.toRadix(a);var A=(1<<x)-1,F,j=!1,_="",st=this.t,Pt=this.DB-st*this.DB%x;if(st-->0)for(Pt<this.DB&&(F=this[st]>>Pt)>0&&(j=!0,_=w(F));st>=0;)Pt<x?(F=(this[st]&(1<<Pt)-1)<<x-Pt,F|=this[--st]>>(Pt+=this.DB-x)):(F=this[st]>>(Pt-=x)&A,Pt<=0&&(Pt+=this.DB,--st)),F>0&&(j=!0),j&&(_+=w(F));return j?_:"0";}function U(){var a=f();return l.ZERO.subTo(this,a),a;}function M(){return this.s<0?this.negate():this;}function W(a){var x=this.s-a.s;if(x!=0)return x;var A=this.t;if(x=A-a.t,x!=0)return this.s<0?-x:x;for(;--A>=0;)if((x=this[A]-a[A])!=0)return x;return 0;}function $(a){var x=1,A;return(A=a>>>16)!=0&&(a=A,x+=16),(A=a>>8)!=0&&(a=A,x+=8),(A=a>>4)!=0&&(a=A,x+=4),(A=a>>2)!=0&&(a=A,x+=2),(A=a>>1)!=0&&(a=A,x+=1),x;}function B(){return this.t<=0?0:this.DB*(this.t-1)+$(this[this.t-1]^this.s&this.DM);}function N(a,x){var A;for(A=this.t-1;A>=0;--A)x[A+a]=this[A];for(A=a-1;A>=0;--A)x[A]=0;x.t=this.t+a,x.s=this.s;}function z(a,x){for(var A=a;A<this.t;++A)x[A-a]=this[A];x.t=Math.max(this.t-a,0),x.s=this.s;}function J(a,x){var A=a%this.DB,F=this.DB-A,j=(1<<F)-1,_=Math.floor(a/this.DB),st=this.s<<A&this.DM,Pt;for(Pt=this.t-1;Pt>=0;--Pt)x[Pt+_+1]=this[Pt]>>F|st,st=(this[Pt]&j)<<A;for(Pt=_-1;Pt>=0;--Pt)x[Pt]=0;x[_]=st,x.t=this.t+_+1,x.s=this.s,x.clamp();}function et(a,x){x.s=this.s;var A=Math.floor(a/this.DB);if(A>=this.t){x.t=0;return;}var F=a%this.DB,j=this.DB-F,_=(1<<F)-1;x[0]=this[A]>>F;for(var st=A+1;st<this.t;++st)x[st-A-1]|=(this[st]&_)<<j,x[st-A]=this[st]>>F;F>0&&(x[this.t-A-1]|=(this.s&_)<<j),x.t=this.t-A,x.clamp();}function at(a,x){for(var A=0,F=0,j=Math.min(a.t,this.t);A<j;)F+=this[A]-a[A],x[A++]=F&this.DM,F>>=this.DB;if(a.t<this.t){for(F-=a.s;A<this.t;)F+=this[A],x[A++]=F&this.DM,F>>=this.DB;F+=this.s;}else{for(F+=this.s;A<a.t;)F-=a[A],x[A++]=F&this.DM,F>>=this.DB;F-=a.s;}x.s=F<0?-1:0,F<-1?x[A++]=this.DV+F:F>0&&(x[A++]=F),x.t=A,x.clamp();}function ct(a,x){var A=this.abs(),F=a.abs(),j=A.t;for(x.t=j+F.t;--j>=0;)x[j]=0;for(j=0;j<F.t;++j)x[j+A.t]=A.am(0,F[j],x,j,0,A.t);x.s=0,x.clamp(),this.s!=a.s&&l.ZERO.subTo(x,x);}function V(a){for(var x=this.abs(),A=a.t=2*x.t;--A>=0;)a[A]=0;for(A=0;A<x.t-1;++A){var F=x.am(A,x[A],a,2*A,0,1);(a[A+x.t]+=x.am(A+1,2*x[A],a,2*A+1,F,x.t-A-1))>=x.DV&&(a[A+x.t]-=x.DV,a[A+x.t+1]=1);}a.t>0&&(a[a.t-1]+=x.am(A,x[A],a,2*A,0,1)),a.s=0,a.clamp();}function Q(a,x,A){var F=a.abs();if(!(F.t<=0)){var j=this.abs();if(j.t<F.t){x!=null&&x.fromInt(0),A!=null&&this.copyTo(A);return;}A==null&&(A=f());var _=f(),st=this.s,Pt=a.s,xt=this.DB-$(F[F.t-1]);xt>0?(F.lShiftTo(xt,_),j.lShiftTo(xt,A)):(F.copyTo(_),j.copyTo(A));var Dt=_.t,Ht=_[Dt-1];if(Ht!=0){var jt=Ht*(1<<this.F1)+(Dt>1?_[Dt-2]>>this.F2:0),qt=this.FV/jt,oe=(1<<this.F1)/jt,me=1<<this.F2,Pe=A.t,Le=Pe-Dt,or=x!==null&&x!==void 0?x:f();for(_.dlShiftTo(Le,or),A.compareTo(or)>=0&&(A[A.t++]=1,A.subTo(or,A)),l.ONE.dlShiftTo(Dt,or),or.subTo(_,_);_.t<Dt;)_[_.t++]=0;for(;--Le>=0;){var br=A[--Pe]==Ht?this.DM:Math.floor(A[Pe]*qt+(A[Pe-1]+me)*oe);if((A[Pe]+=_.am(0,br,A,Le,0,Dt))<br)for(_.dlShiftTo(Le,or),A.subTo(or,A);A[Pe]<--br;)A.subTo(or,A);}x!=null&&(A.drShiftTo(Dt,x),st!=Pt&&l.ZERO.subTo(x,x)),A.t=Dt,A.clamp(),xt>0&&A.rShiftTo(xt,A),st<0&&l.ZERO.subTo(A,A);}}}function ft(a){var x=f();return this.abs().divRemTo(a,null,x),this.s<0&&x.compareTo(l.ZERO)>0&&a.subTo(x,x),x;}function mt(a){this.m=a;}function yt(a){return a.s<0||a.compareTo(this.m)>=0?a.mod(this.m):a;}function At(a){return a;}function ht(a){a.divRemTo(this.m,null,a);}function Nt(a,x,A){a.multiplyTo(x,A),this.reduce(A);}function Bt(a,x){a.squareTo(x),this.reduce(x);}mt.prototype.convert=yt,mt.prototype.revert=At,mt.prototype.reduce=ht,mt.prototype.mulTo=Nt,mt.prototype.sqrTo=Bt;function G(){if(this.t<1)return 0;var a=this[0];if(!(a&1))return 0;var x=a&3;return x=x*(2-(a&15)*x)&15,x=x*(2-(a&255)*x)&255,x=x*(2-((a&65535)*x&65535))&65535,x=x*(2-a*x%this.DV)%this.DV,x>0?this.DV-x:-x;}function k(a){this.m=a,this.mp=a.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<a.DB-15)-1,this.mt2=2*a.t;}function rt(a){var x=f();return a.abs().dlShiftTo(this.m.t,x),x.divRemTo(this.m,null,x),a.s<0&&x.compareTo(l.ZERO)>0&&this.m.subTo(x,x),x;}function nt(a){var x=f();return a.copyTo(x),this.reduce(x),x;}function Y(a){for(;a.t<=this.mt2;)a[a.t++]=0;for(var x=0;x<this.m.t;++x){var A=a[x]&32767,F=A*this.mpl+((A*this.mph+(a[x]>>15)*this.mpl&this.um)<<15)&a.DM;for(A=x+this.m.t,a[A]+=this.m.am(0,F,a,x,0,this.m.t);a[A]>=a.DV;)a[A]-=a.DV,a[++A]++;}a.clamp(),a.drShiftTo(this.m.t,a),a.compareTo(this.m)>=0&&a.subTo(this.m,a);}function Z(a,x){a.squareTo(x),this.reduce(x);}function C(a,x,A){a.multiplyTo(x,A),this.reduce(A);}k.prototype.convert=rt,k.prototype.revert=nt,k.prototype.reduce=Y,k.prototype.mulTo=C,k.prototype.sqrTo=Z;function L(){return(this.t>0?this[0]&1:this.s)==0;}function X(a,x){if(a>4294967295||a<1)return l.ONE;var A=f(),F=f(),j=x.convert(this),_=$(a)-1;for(j.copyTo(A);--_>=0;)if(x.sqrTo(A,F),(a&1<<_)>0)x.mulTo(F,j,A);else{var st=A;A=F,F=st;}return x.revert(A);}function K(a,x){var A;return a<256||x.isEven()?A=new mt(x):A=new k(x),this.exp(a,A);}l.prototype.copyTo=m,l.prototype.fromInt=p,l.prototype.fromString=E,l.prototype.clamp=R,l.prototype.dlShiftTo=N,l.prototype.drShiftTo=z,l.prototype.lShiftTo=J,l.prototype.rShiftTo=et,l.prototype.subTo=at,l.prototype.multiplyTo=ct,l.prototype.squareTo=V,l.prototype.divRemTo=Q,l.prototype.invDigit=G,l.prototype.isEven=L,l.prototype.exp=X,l.prototype.toString=D,l.prototype.negate=U,l.prototype.abs=M,l.prototype.compareTo=W,l.prototype.bitLength=B,l.prototype.mod=ft,l.prototype.modPowInt=K,l.ZERO=S(0),l.ONE=S(1);function q(){var a=f();return this.copyTo(a),a;}function it(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1;}else{if(this.t==1)return this[0];if(this.t==0)return 0;}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0];}function ut(){return this.t==0?this.s:this[0]<<24>>24;}function St(){return this.t==0?this.s:this[0]<<16>>16;}function Ct(a){return Math.floor(Math.LN2*this.DB/Math.log(a));}function Et(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1;}function bt(a){if(a==null&&(a=10),this.signum()==0||a<2||a>36)return"0";var x=this.chunkSize(a),A=Math.pow(a,x),F=S(A),j=f(),_=f(),st="";for(this.divRemTo(F,j,_);j.signum()>0;)st=(A+_.intValue()).toString(a).substr(1)+st,j.divRemTo(F,j,_);return _.intValue().toString(a)+st;}function wt(a,x){this.fromInt(0),x==null&&(x=10);for(var A=this.chunkSize(x),F=Math.pow(x,A),j=!1,_=0,st=0,Pt=0;Pt<a.length;++Pt){var xt=d(a,Pt);if(xt<0){a.charAt(Pt)=="-"&&this.signum()==0&&(j=!0);continue;}st=x*st+xt,++_>=A&&(this.dMultiply(F),this.dAddOffset(st,0),_=0,st=0);}_>0&&(this.dMultiply(Math.pow(x,_)),this.dAddOffset(st,0)),j&&l.ZERO.subTo(this,this);}function Ot(a,x,A){if(typeof x=="number"){if(a<2)this.fromInt(1);else for(this.fromNumber(a,A),this.testBit(a-1)||this.bitwiseTo(l.ONE.shiftLeft(a-1),ne,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(x);)this.dAddOffset(2,0),this.bitLength()>a&&this.subTo(l.ONE.shiftLeft(a-1),this);}else{var F=new Array(),j=a&7;F.length=(a>>3)+1,x.nextBytes(F),j>0?F[0]&=(1<<j)-1:F[0]=0,this.fromString(F,256);}}function Lt(){var a=this.t,x=new Array();x[0]=this.s;var A=this.DB-a*this.DB%8,F,j=0;if(a-->0)for(A<this.DB&&(F=this[a]>>A)!=(this.s&this.DM)>>A&&(x[j++]=F|this.s<<this.DB-A);a>=0;)A<8?(F=(this[a]&(1<<A)-1)<<8-A,F|=this[--a]>>(A+=this.DB-8)):(F=this[a]>>(A-=8)&255,A<=0&&(A+=this.DB,--a)),F&128&&(F|=-256),j==0&&(this.s&128)!=(F&128)&&++j,(j>0||F!=this.s)&&(x[j++]=F);return x;}function Yt(a){return this.compareTo(a)==0;}function zt(a){return this.compareTo(a)<0?this:a;}function Wt(a){return this.compareTo(a)>0?this:a;}function Qt(a,x,A){var F,j,_=Math.min(a.t,this.t);for(F=0;F<_;++F)A[F]=x(this[F],a[F]);if(a.t<this.t){for(j=a.s&this.DM,F=_;F<this.t;++F)A[F]=x(this[F],j);A.t=this.t;}else{for(j=this.s&this.DM,F=_;F<a.t;++F)A[F]=x(j,a[F]);A.t=a.t;}A.s=x(this.s,a.s),A.clamp();}function ue(a,x){return a&x;}function ie(a){var x=f();return this.bitwiseTo(a,ue,x),x;}function ne(a,x){return a|x;}function ae(a){var x=f();return this.bitwiseTo(a,ne,x),x;}function se(a,x){return a^x;}function We(a){var x=f();return this.bitwiseTo(a,se,x),x;}function Fe(a,x){return a&~x;}function $e(a){var x=f();return this.bitwiseTo(a,Fe,x),x;}function Xe(){for(var a=f(),x=0;x<this.t;++x)a[x]=this.DM&~this[x];return a.t=this.t,a.s=~this.s,a;}function Ge(a){var x=f();return a<0?this.rShiftTo(-a,x):this.lShiftTo(a,x),x;}function ke(a){var x=f();return a<0?this.lShiftTo(-a,x):this.rShiftTo(a,x),x;}function Je(a){if(a==0)return-1;var x=0;return a&65535||(a>>=16,x+=16),a&255||(a>>=8,x+=8),a&15||(a>>=4,x+=4),a&3||(a>>=2,x+=2),a&1||++x,x;}function we(){for(var a=0;a<this.t;++a)if(this[a]!=0)return a*this.DB+Je(this[a]);return this.s<0?this.t*this.DB:-1;}function ur(a){for(var x=0;a!=0;)a&=a-1,++x;return x;}function rn(){for(var a=0,x=this.s&this.DM,A=0;A<this.t;++A)a+=ur(this[A]^x);return a;}function Kr(a){var x=Math.floor(a/this.DB);return x>=this.t?this.s!=0:(this[x]&1<<a%this.DB)!=0;}function Hn(a,x){var A=l.ONE.shiftLeft(a);return this.bitwiseTo(A,x,A),A;}function Vn(a){return this.changeBit(a,ne);}function Io(a){return this.changeBit(a,Fe);}function Ii(a){return this.changeBit(a,se);}function wo(a,x){for(var A=0,F=0,j=Math.min(a.t,this.t);A<j;)F+=this[A]+a[A],x[A++]=F&this.DM,F>>=this.DB;if(a.t<this.t){for(F+=a.s;A<this.t;)F+=this[A],x[A++]=F&this.DM,F>>=this.DB;F+=this.s;}else{for(F+=this.s;A<a.t;)F+=a[A],x[A++]=F&this.DM,F>>=this.DB;F+=a.s;}x.s=F<0?-1:0,F>0?x[A++]=F:F<-1&&(x[A++]=this.DV+F),x.t=A,x.clamp();}function wi(a){var x=f();return this.addTo(a,x),x;}function Oo(a){var x=f();return this.subTo(a,x),x;}function Ao(a){var x=f();return this.multiplyTo(a,x),x;}function Eo(){var a=f();return this.squareTo(a),a;}function Mo(a){var x=f();return this.divRemTo(a,x,null),x;}function Lo(a){var x=f();return this.divRemTo(a,null,x),x;}function ts(a){var x=f(),A=f();return this.divRemTo(a,x,A),new Array(x,A);}function Ro(a){this[this.t]=this.am(0,a-1,this,0,0,this.t),++this.t,this.clamp();}function bo(a,x){if(a!=0){for(;this.t<=x;)this[this.t++]=0;for(this[x]+=a;this[x]>=this.DV;)this[x]-=this.DV,++x>=this.t&&(this[this.t++]=0),++this[x];}}function vn(){}function es(a){return a;}function Do(a,x,A){a.multiplyTo(x,A);}function No(a,x){a.squareTo(x);}vn.prototype.convert=es,vn.prototype.revert=es,vn.prototype.mulTo=Do,vn.prototype.sqrTo=No;function Bo(a){return this.exp(a,new vn());}function Wo(a,x,A){var F=Math.min(this.t+a.t,x);for(A.s=0,A.t=F;F>0;)A[--F]=0;var j;for(j=A.t-this.t;F<j;++F)A[F+this.t]=this.am(0,a[F],A,F,0,this.t);for(j=Math.min(a.t,x);F<j;++F)this.am(0,a[F],A,F,0,x-F);A.clamp();}function Fo(a,x,A){--x;var F=A.t=this.t+a.t-x;for(A.s=0;--F>=0;)A[F]=0;for(F=Math.max(x-this.t,0);F<a.t;++F)A[this.t+F-x]=this.am(x-F,a[F],A,0,0,this.t+F-x);A.clamp(),A.drShiftTo(1,A);}function Xr(a){this.r2=f(),this.q3=f(),l.ONE.dlShiftTo(2*a.t,this.r2),this.mu=this.r2.divide(a),this.m=a;}function Uo(a){if(a.s<0||a.t>2*this.m.t)return a.mod(this.m);if(a.compareTo(this.m)<0)return a;var x=f();return a.copyTo(x),this.reduce(x),x;}function Kn(a){return a;}function Yo(a){for(a.drShiftTo(this.m.t-1,this.r2),a.t>this.m.t+1&&(a.t=this.m.t+1,a.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);a.compareTo(this.r2)<0;)a.dAddOffset(1,this.m.t+1);for(a.subTo(this.r2,a);a.compareTo(this.m)>=0;)a.subTo(this.m,a);}function $o(a,x){a.squareTo(x),this.reduce(x);}function Xo(a,x,A){a.multiplyTo(x,A),this.reduce(A);}Xr.prototype.convert=Uo,Xr.prototype.revert=Kn,Xr.prototype.reduce=Yo,Xr.prototype.mulTo=Xo,Xr.prototype.sqrTo=$o;function rs(a,x){var A=a.bitLength(),F,j=S(1),_;if(A<=0)return j;A<18?F=1:A<48?F=3:A<144?F=4:A<768?F=5:F=6,A<8?_=new mt(x):x.isEven()?_=new Xr(x):_=new k(x);var st=new Array(),Pt=3,xt=F-1,Dt=(1<<F)-1;if(st[1]=_.convert(this),F>1){var Ht=f();for(_.sqrTo(st[1],Ht);Pt<=Dt;)st[Pt]=f(),_.mulTo(Ht,st[Pt-2],st[Pt]),Pt+=2;}var jt=a.t-1,qt,oe=!0,me=f(),Pe;for(A=$(a[jt])-1;jt>=0;){for(A>=xt?qt=a[jt]>>A-xt&Dt:(qt=(a[jt]&(1<<A+1)-1)<<xt-A,jt>0&&(qt|=a[jt-1]>>this.DB+A-xt)),Pt=F;!(qt&1);)qt>>=1,--Pt;if((A-=Pt)<0&&(A+=this.DB,--jt),oe)st[qt].copyTo(j),oe=!1;else{for(;Pt>1;)_.sqrTo(j,me),_.sqrTo(me,j),Pt-=2;Pt>0?_.sqrTo(j,me):(Pe=j,j=me,me=Pe),_.mulTo(me,st[qt],j);}for(;jt>=0&&!(a[jt]&1<<A);)_.sqrTo(j,me),Pe=j,j=me,me=Pe,--A<0&&(A=this.DB-1,--jt);}return _.revert(j);}function ns(a){var x=this.s<0?this.negate():this.clone(),A=a.s<0?a.negate():a.clone();if(x.compareTo(A)<0){var F=x;x=A,A=F;}var j=x.getLowestSetBit(),_=A.getLowestSetBit();if(_<0)return x;for(j<_&&(_=j),_>0&&(x.rShiftTo(_,x),A.rShiftTo(_,A));x.signum()>0;)(j=x.getLowestSetBit())>0&&x.rShiftTo(j,x),(j=A.getLowestSetBit())>0&&A.rShiftTo(j,A),x.compareTo(A)>=0?(x.subTo(A,x),x.rShiftTo(1,x)):(A.subTo(x,A),A.rShiftTo(1,A));return _>0&&A.lShiftTo(_,A),A;}function is(a){if(a<=0)return 0;var x=this.DV%a,A=this.s<0?a-1:0;if(this.t>0)if(x==0)A=this[0]%a;else for(var F=this.t-1;F>=0;--F)A=(x*A+this[F])%a;return A;}function zo(a){var x=a.isEven();if(this.isEven()&&x||a.signum()==0)return l.ZERO;for(var A=a.clone(),F=this.clone(),j=S(1),_=S(0),st=S(0),Pt=S(1);A.signum()!=0;){for(;A.isEven();)A.rShiftTo(1,A),x?((!j.isEven()||!_.isEven())&&(j.addTo(this,j),_.subTo(a,_)),j.rShiftTo(1,j)):_.isEven()||_.subTo(a,_),_.rShiftTo(1,_);for(;F.isEven();)F.rShiftTo(1,F),x?((!st.isEven()||!Pt.isEven())&&(st.addTo(this,st),Pt.subTo(a,Pt)),st.rShiftTo(1,st)):Pt.isEven()||Pt.subTo(a,Pt),Pt.rShiftTo(1,Pt);A.compareTo(F)>=0?(A.subTo(F,A),x&&j.subTo(st,j),_.subTo(Pt,_)):(F.subTo(A,F),x&&st.subTo(j,st),Pt.subTo(_,Pt));}if(F.compareTo(l.ONE)!=0)return l.ZERO;if(Pt.compareTo(a)>=0)return Pt.subtract(a);if(Pt.signum()<0)Pt.addTo(a,Pt);else return Pt;return Pt.signum()<0?Pt.add(a):Pt;}var nr=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],jo=(1<<26)/nr[nr.length-1];function Go(a){var x,A=this.abs();if(A.t==1&&A[0]<=nr[nr.length-1]){for(x=0;x<nr.length;++x)if(A[0]==nr[x])return!0;return!1;}if(A.isEven())return!1;for(x=1;x<nr.length;){for(var F=nr[x],j=x+1;j<nr.length&&F<jo;)F*=nr[j++];for(F=A.modInt(F);x<j;)if(F%nr[x++]==0)return!1;}return A.millerRabin(a);}function ss(a){var x=this.subtract(l.ONE),A=x.getLowestSetBit();if(A<=0)return!1;var F=x.shiftRight(A);a=a+1>>1,a>nr.length&&(a=nr.length);for(var j=f(),_=0;_<a;++_){j.fromInt(nr[Math.floor(Math.random()*nr.length)]);var st=j.modPow(F,this);if(st.compareTo(l.ONE)!=0&&st.compareTo(x)!=0){for(var Pt=1;Pt++<A&&st.compareTo(x)!=0;)if(st=st.modPowInt(2,this),st.compareTo(l.ONE)==0)return!1;if(st.compareTo(x)!=0)return!1;}}return!0;}l.prototype.chunkSize=Ct,l.prototype.toRadix=bt,l.prototype.fromRadix=wt,l.prototype.fromNumber=Ot,l.prototype.bitwiseTo=Qt,l.prototype.changeBit=Hn,l.prototype.addTo=wo,l.prototype.dMultiply=Ro,l.prototype.dAddOffset=bo,l.prototype.multiplyLowerTo=Wo,l.prototype.multiplyUpperTo=Fo,l.prototype.modInt=is,l.prototype.millerRabin=ss,l.prototype.clone=q,l.prototype.intValue=it,l.prototype.byteValue=ut,l.prototype.shortValue=St,l.prototype.signum=Et,l.prototype.toByteArray=Lt,l.prototype.equals=Yt,l.prototype.min=zt,l.prototype.max=Wt,l.prototype.and=ie,l.prototype.or=ae,l.prototype.xor=We,l.prototype.andNot=$e,l.prototype.not=Xe,l.prototype.shiftLeft=Ge,l.prototype.shiftRight=ke,l.prototype.getLowestSetBit=we,l.prototype.bitCount=rn,l.prototype.testBit=Kr,l.prototype.setBit=Vn,l.prototype.clearBit=Io,l.prototype.flipBit=Ii,l.prototype.add=wi,l.prototype.subtract=Oo,l.prototype.multiply=Ao,l.prototype.divide=Mo,l.prototype.remainder=Lo,l.prototype.divideAndRemainder=ts,l.prototype.modPow=rs,l.prototype.modInverse=zo,l.prototype.pow=Bo,l.prototype.gcd=ns,l.prototype.isProbablePrime=Go,l.prototype.square=Eo;var ge=l;ge.prototype.IsNegative=function(){return this.compareTo(ge.ZERO)==-1;},ge.op_Equality=function(a,x){return a.compareTo(x)==0;},ge.op_Inequality=function(a,x){return a.compareTo(x)!=0;},ge.op_GreaterThan=function(a,x){return a.compareTo(x)>0;},ge.op_LessThan=function(a,x){return a.compareTo(x)<0;},ge.op_Addition=function(a,x){return new ge(a,void 0,void 0).add(new ge(x,void 0,void 0));},ge.op_Subtraction=function(a,x){return new ge(a,void 0,void 0).subtract(new ge(x,void 0,void 0));},ge.Int128Mul=function(a,x){return new ge(a,void 0,void 0).multiply(new ge(x,void 0,void 0));},ge.op_Division=function(a,x){return a.divide(x);},ge.prototype.ToDouble=function(){return parseFloat(this.toString());};var Oi=function Oi(a,x){var A;if(_typeof(Object.getOwnPropertyNames)>"u"){for(A in x.prototype)(_typeof(a.prototype[A])>"u"||a.prototype[A]===Object.prototype[A])&&(a.prototype[A]=x.prototype[A]);for(A in x)_typeof(a[A])>"u"&&(a[A]=x[A]);a.$baseCtor=x;}else{for(var F=Object.getOwnPropertyNames(x.prototype),j=0;j<F.length;j++)_typeof(Object.getOwnPropertyDescriptor(a.prototype,F[j]))>"u"&&Object.defineProperty(a.prototype,F[j],Object.getOwnPropertyDescriptor(x.prototype,F[j]));for(A in x)_typeof(a[A])>"u"&&(a[A]=x[A]);a.$baseCtor=x;}};e.Path=function(){return[];},e.Path.prototype.push=Array.prototype.push,e.Paths=function(){return[];},e.Paths.prototype.push=Array.prototype.push,e.DoublePoint=function(){var a=arguments;this.X=0,this.Y=0,a.length===1?(this.X=a[0].X,this.Y=a[0].Y):a.length===2&&(this.X=a[0],this.Y=a[1]);},e.DoublePoint0=function(){this.X=0,this.Y=0;},e.DoublePoint0.prototype=e.DoublePoint.prototype,e.DoublePoint1=function(a){this.X=a.X,this.Y=a.Y;},e.DoublePoint1.prototype=e.DoublePoint.prototype,e.DoublePoint2=function(a,x){this.X=a,this.Y=x;},e.DoublePoint2.prototype=e.DoublePoint.prototype,e.PolyNode=function(){this.m_Parent=null,this.m_polygon=new e.Path(),this.m_Index=0,this.m_jointype=0,this.m_endtype=0,this.m_Childs=[],this.IsOpen=!1;},e.PolyNode.prototype.IsHoleNode=function(){for(var a=!0,x=this.m_Parent;x!==null;)a=!a,x=x.m_Parent;return a;},e.PolyNode.prototype.ChildCount=function(){return this.m_Childs.length;},e.PolyNode.prototype.Contour=function(){return this.m_polygon;},e.PolyNode.prototype.AddChild=function(a){var x=this.m_Childs.length;this.m_Childs.push(a),a.m_Parent=this,a.m_Index=x;},e.PolyNode.prototype.GetNext=function(){return this.m_Childs.length>0?this.m_Childs[0]:this.GetNextSiblingUp();},e.PolyNode.prototype.GetNextSiblingUp=function(){return this.m_Parent===null?null:this.m_Index===this.m_Parent.m_Childs.length-1?this.m_Parent.GetNextSiblingUp():this.m_Parent.m_Childs[this.m_Index+1];},e.PolyNode.prototype.Childs=function(){return this.m_Childs;},e.PolyNode.prototype.Parent=function(){return this.m_Parent;},e.PolyNode.prototype.IsHole=function(){return this.IsHoleNode();},e.PolyTree=function(){this.m_AllPolys=[],e.PolyNode.call(this);},e.PolyTree.prototype.Clear=function(){for(var a=0,x=this.m_AllPolys.length;a<x;a++)this.m_AllPolys[a]=null;this.m_AllPolys.length=0,this.m_Childs.length=0;},e.PolyTree.prototype.GetFirst=function(){return this.m_Childs.length>0?this.m_Childs[0]:null;},e.PolyTree.prototype.Total=function(){var a=this.m_AllPolys.length;return a>0&&this.m_Childs[0]!==this.m_AllPolys[0]&&a--,a;},Oi(e.PolyTree,e.PolyNode),e.Math_Abs_Int64=e.Math_Abs_Int32=e.Math_Abs_Double=function(a){return Math.abs(a);},e.Math_Max_Int32_Int32=function(a,x){return Math.max(a,x);},s.msie||s.opera||s.safari?e.Cast_Int32=function(a){return a|0;}:e.Cast_Int32=function(a){return~~a;},_typeof(Number.toInteger)>"u"&&(Number.toInteger=null),s.chrome?e.Cast_Int64=function(a){return a<-2147483648||a>2147483647?a<0?Math.ceil(a):Math.floor(a):~~a;}:s.firefox&&typeof Number.toInteger=="function"?e.Cast_Int64=function(a){return Number.toInteger(a);}:s.msie7||s.msie8?e.Cast_Int64=function(a){return parseInt(a,10);}:s.msie?e.Cast_Int64=function(a){return a<-2147483648||a>2147483647?a<0?Math.ceil(a):Math.floor(a):a|0;}:e.Cast_Int64=function(a){return a<0?Math.ceil(a):Math.floor(a);},e.Clear=function(a){a.length=0;},e.PI=3.141592653589793,e.PI2=2*3.141592653589793,e.IntPoint=function(){var a=arguments,x=a.length;if(this.X=0,this.Y=0,e.use_xyz){if(this.Z=0,x===3)this.X=a[0],this.Y=a[1],this.Z=a[2];else if(x===2)this.X=a[0],this.Y=a[1],this.Z=0;else if(x===1){if(a[0]instanceof e.DoublePoint){var A=a[0];this.X=e.Clipper.Round(A.X),this.Y=e.Clipper.Round(A.Y),this.Z=0;}else{var F=a[0];_typeof(F.Z)>"u"&&(F.Z=0),this.X=F.X,this.Y=F.Y,this.Z=F.Z;}}else this.X=0,this.Y=0,this.Z=0;}else if(x===2)this.X=a[0],this.Y=a[1];else if(x===1){if(a[0]instanceof e.DoublePoint){var A=a[0];this.X=e.Clipper.Round(A.X),this.Y=e.Clipper.Round(A.Y);}else{var F=a[0];this.X=F.X,this.Y=F.Y;}}else this.X=0,this.Y=0;},e.IntPoint.op_Equality=function(a,x){return a.X===x.X&&a.Y===x.Y;},e.IntPoint.op_Inequality=function(a,x){return a.X!==x.X||a.Y!==x.Y;},e.IntPoint0=function(){this.X=0,this.Y=0,e.use_xyz&&(this.Z=0);},e.IntPoint0.prototype=e.IntPoint.prototype,e.IntPoint1=function(a){this.X=a.X,this.Y=a.Y,e.use_xyz&&(_typeof(a.Z)>"u"?this.Z=0:this.Z=a.Z);},e.IntPoint1.prototype=e.IntPoint.prototype,e.IntPoint1dp=function(a){this.X=e.Clipper.Round(a.X),this.Y=e.Clipper.Round(a.Y),e.use_xyz&&(this.Z=0);},e.IntPoint1dp.prototype=e.IntPoint.prototype,e.IntPoint2=function(a,x,A){this.X=a,this.Y=x,e.use_xyz&&(_typeof(A)>"u"?this.Z=0:this.Z=A);},e.IntPoint2.prototype=e.IntPoint.prototype,e.IntRect=function(){var a=arguments,x=a.length;if(x===4)this.left=a[0],this.top=a[1],this.right=a[2],this.bottom=a[3];else if(x===1){var A=a[0];this.left=A.left,this.top=A.top,this.right=A.right,this.bottom=A.bottom;}else this.left=0,this.top=0,this.right=0,this.bottom=0;},e.IntRect0=function(){this.left=0,this.top=0,this.right=0,this.bottom=0;},e.IntRect0.prototype=e.IntRect.prototype,e.IntRect1=function(a){this.left=a.left,this.top=a.top,this.right=a.right,this.bottom=a.bottom;},e.IntRect1.prototype=e.IntRect.prototype,e.IntRect4=function(a,x,A,F){this.left=a,this.top=x,this.right=A,this.bottom=F;},e.IntRect4.prototype=e.IntRect.prototype,e.ClipType={ctIntersection:0,ctUnion:1,ctDifference:2,ctXor:3},e.PolyType={ptSubject:0,ptClip:1},e.PolyFillType={pftEvenOdd:0,pftNonZero:1,pftPositive:2,pftNegative:3},e.JoinType={jtSquare:0,jtRound:1,jtMiter:2},e.EndType={etOpenSquare:0,etOpenRound:1,etOpenButt:2,etClosedLine:3,etClosedPolygon:4},e.EdgeSide={esLeft:0,esRight:1},e.Direction={dRightToLeft:0,dLeftToRight:1},e.TEdge=function(){this.Bot=new e.IntPoint0(),this.Curr=new e.IntPoint0(),this.Top=new e.IntPoint0(),this.Delta=new e.IntPoint0(),this.Dx=0,this.PolyTyp=e.PolyType.ptSubject,this.Side=e.EdgeSide.esLeft,this.WindDelta=0,this.WindCnt=0,this.WindCnt2=0,this.OutIdx=0,this.Next=null,this.Prev=null,this.NextInLML=null,this.NextInAEL=null,this.PrevInAEL=null,this.NextInSEL=null,this.PrevInSEL=null;},e.IntersectNode=function(){this.Edge1=null,this.Edge2=null,this.Pt=new e.IntPoint0();},e.MyIntersectNodeSort=function(){},e.MyIntersectNodeSort.Compare=function(a,x){var A=x.Pt.Y-a.Pt.Y;return A>0?1:A<0?-1:0;},e.LocalMinima=function(){this.Y=0,this.LeftBound=null,this.RightBound=null,this.Next=null;},e.Scanbeam=function(){this.Y=0,this.Next=null;},e.Maxima=function(){this.X=0,this.Next=null,this.Prev=null;},e.OutRec=function(){this.Idx=0,this.IsHole=!1,this.IsOpen=!1,this.FirstLeft=null,this.Pts=null,this.BottomPt=null,this.PolyNode=null;},e.OutPt=function(){this.Idx=0,this.Pt=new e.IntPoint0(),this.Next=null,this.Prev=null;},e.Join=function(){this.OutPt1=null,this.OutPt2=null,this.OffPt=new e.IntPoint0();},e.ClipperBase=function(){this.m_MinimaList=null,this.m_CurrentLM=null,this.m_edges=new Array(),this.m_UseFullRange=!1,this.m_HasOpenPaths=!1,this.PreserveCollinear=!1,this.m_Scanbeam=null,this.m_PolyOuts=null,this.m_ActiveEdges=null;},e.ClipperBase.horizontal=-9007199254740992,e.ClipperBase.Skip=-2,e.ClipperBase.Unassigned=-1,e.ClipperBase.tolerance=1e-20,e.ClipperBase.loRange=47453132,e.ClipperBase.hiRange=4503599627370495,e.ClipperBase.near_zero=function(a){return a>-e.ClipperBase.tolerance&&a<e.ClipperBase.tolerance;},e.ClipperBase.IsHorizontal=function(a){return a.Delta.Y===0;},e.ClipperBase.prototype.PointIsVertex=function(a,x){var A=x;do{if(e.IntPoint.op_Equality(A.Pt,a))return!0;A=A.Next;}while(A!==x);return!1;},e.ClipperBase.prototype.PointOnLineSegment=function(a,x,A,F){return F?a.X===x.X&&a.Y===x.Y||a.X===A.X&&a.Y===A.Y||a.X>x.X==a.X<A.X&&a.Y>x.Y==a.Y<A.Y&&ge.op_Equality(ge.Int128Mul(a.X-x.X,A.Y-x.Y),ge.Int128Mul(A.X-x.X,a.Y-x.Y)):a.X===x.X&&a.Y===x.Y||a.X===A.X&&a.Y===A.Y||a.X>x.X==a.X<A.X&&a.Y>x.Y==a.Y<A.Y&&(a.X-x.X)*(A.Y-x.Y)===(A.X-x.X)*(a.Y-x.Y);},e.ClipperBase.prototype.PointOnPolygon=function(a,x,A){for(var F=x;;){if(this.PointOnLineSegment(a,F.Pt,F.Next.Pt,A))return!0;if(F=F.Next,F===x)break;}return!1;},e.ClipperBase.prototype.SlopesEqual=e.ClipperBase.SlopesEqual=function(){var a=arguments,x=a.length,A,F,j,_,st,Pt,xt;return x===3?(A=a[0],F=a[1],xt=a[2],xt?ge.op_Equality(ge.Int128Mul(A.Delta.Y,F.Delta.X),ge.Int128Mul(A.Delta.X,F.Delta.Y)):e.Cast_Int64(A.Delta.Y*F.Delta.X)===e.Cast_Int64(A.Delta.X*F.Delta.Y)):x===4?(j=a[0],_=a[1],st=a[2],xt=a[3],xt?ge.op_Equality(ge.Int128Mul(j.Y-_.Y,_.X-st.X),ge.Int128Mul(j.X-_.X,_.Y-st.Y)):e.Cast_Int64((j.Y-_.Y)*(_.X-st.X))-e.Cast_Int64((j.X-_.X)*(_.Y-st.Y))===0):(j=a[0],_=a[1],st=a[2],Pt=a[3],xt=a[4],xt?ge.op_Equality(ge.Int128Mul(j.Y-_.Y,st.X-Pt.X),ge.Int128Mul(j.X-_.X,st.Y-Pt.Y)):e.Cast_Int64((j.Y-_.Y)*(st.X-Pt.X))-e.Cast_Int64((j.X-_.X)*(st.Y-Pt.Y))===0);},e.ClipperBase.SlopesEqual3=function(a,x,A){return A?ge.op_Equality(ge.Int128Mul(a.Delta.Y,x.Delta.X),ge.Int128Mul(a.Delta.X,x.Delta.Y)):e.Cast_Int64(a.Delta.Y*x.Delta.X)===e.Cast_Int64(a.Delta.X*x.Delta.Y);},e.ClipperBase.SlopesEqual4=function(a,x,A,F){return F?ge.op_Equality(ge.Int128Mul(a.Y-x.Y,x.X-A.X),ge.Int128Mul(a.X-x.X,x.Y-A.Y)):e.Cast_Int64((a.Y-x.Y)*(x.X-A.X))-e.Cast_Int64((a.X-x.X)*(x.Y-A.Y))===0;},e.ClipperBase.SlopesEqual5=function(a,x,A,F,j){return j?ge.op_Equality(ge.Int128Mul(a.Y-x.Y,A.X-F.X),ge.Int128Mul(a.X-x.X,A.Y-F.Y)):e.Cast_Int64((a.Y-x.Y)*(A.X-F.X))-e.Cast_Int64((a.X-x.X)*(A.Y-F.Y))===0;},e.ClipperBase.prototype.Clear=function(){this.DisposeLocalMinimaList();for(var a=0,x=this.m_edges.length;a<x;++a){for(var A=0,F=this.m_edges[a].length;A<F;++A)this.m_edges[a][A]=null;e.Clear(this.m_edges[a]);}e.Clear(this.m_edges),this.m_UseFullRange=!1,this.m_HasOpenPaths=!1;},e.ClipperBase.prototype.DisposeLocalMinimaList=function(){for(;this.m_MinimaList!==null;){var a=this.m_MinimaList.Next;this.m_MinimaList=null,this.m_MinimaList=a;}this.m_CurrentLM=null;},e.ClipperBase.prototype.RangeTest=function(a,x){x.Value?(a.X>e.ClipperBase.hiRange||a.Y>e.ClipperBase.hiRange||-a.X>e.ClipperBase.hiRange||-a.Y>e.ClipperBase.hiRange)&&e.Error("Coordinate outside allowed range in RangeTest()."):(a.X>e.ClipperBase.loRange||a.Y>e.ClipperBase.loRange||-a.X>e.ClipperBase.loRange||-a.Y>e.ClipperBase.loRange)&&(x.Value=!0,this.RangeTest(a,x));},e.ClipperBase.prototype.InitEdge=function(a,x,A,F){a.Next=x,a.Prev=A,a.Curr.X=F.X,a.Curr.Y=F.Y,e.use_xyz&&(a.Curr.Z=F.Z),a.OutIdx=-1;},e.ClipperBase.prototype.InitEdge2=function(a,x){a.Curr.Y>=a.Next.Curr.Y?(a.Bot.X=a.Curr.X,a.Bot.Y=a.Curr.Y,e.use_xyz&&(a.Bot.Z=a.Curr.Z),a.Top.X=a.Next.Curr.X,a.Top.Y=a.Next.Curr.Y,e.use_xyz&&(a.Top.Z=a.Next.Curr.Z)):(a.Top.X=a.Curr.X,a.Top.Y=a.Curr.Y,e.use_xyz&&(a.Top.Z=a.Curr.Z),a.Bot.X=a.Next.Curr.X,a.Bot.Y=a.Next.Curr.Y,e.use_xyz&&(a.Bot.Z=a.Next.Curr.Z)),this.SetDx(a),a.PolyTyp=x;},e.ClipperBase.prototype.FindNextLocMin=function(a){for(var x;;){for(;e.IntPoint.op_Inequality(a.Bot,a.Prev.Bot)||e.IntPoint.op_Equality(a.Curr,a.Top);)a=a.Next;if(a.Dx!==e.ClipperBase.horizontal&&a.Prev.Dx!==e.ClipperBase.horizontal)break;for(;a.Prev.Dx===e.ClipperBase.horizontal;)a=a.Prev;for(x=a;a.Dx===e.ClipperBase.horizontal;)a=a.Next;if(a.Top.Y!==a.Prev.Bot.Y){x.Prev.Bot.X<a.Bot.X&&(a=x);break;}}return a;},e.ClipperBase.prototype.ProcessBound=function(a,x){var A,F=a,j;if(F.OutIdx===e.ClipperBase.Skip){if(a=F,x){for(;a.Top.Y===a.Next.Bot.Y;)a=a.Next;for(;a!==F&&a.Dx===e.ClipperBase.horizontal;)a=a.Prev;}else{for(;a.Top.Y===a.Prev.Bot.Y;)a=a.Prev;for(;a!==F&&a.Dx===e.ClipperBase.horizontal;)a=a.Next;}if(a===F)x?F=a.Next:F=a.Prev;else{x?a=F.Next:a=F.Prev;var _=new e.LocalMinima();_.Next=null,_.Y=a.Bot.Y,_.LeftBound=null,_.RightBound=a,a.WindDelta=0,F=this.ProcessBound(a,x),this.InsertLocalMinima(_);}return F;}if(a.Dx===e.ClipperBase.horizontal&&(x?A=a.Prev:A=a.Next,A.Dx===e.ClipperBase.horizontal?A.Bot.X!==a.Bot.X&&A.Top.X!==a.Bot.X&&this.ReverseHorizontal(a):A.Bot.X!==a.Bot.X&&this.ReverseHorizontal(a)),A=a,x){for(;F.Top.Y===F.Next.Bot.Y&&F.Next.OutIdx!==e.ClipperBase.Skip;)F=F.Next;if(F.Dx===e.ClipperBase.horizontal&&F.Next.OutIdx!==e.ClipperBase.Skip){for(j=F;j.Prev.Dx===e.ClipperBase.horizontal;)j=j.Prev;j.Prev.Top.X>F.Next.Top.X&&(F=j.Prev);}for(;a!==F;)a.NextInLML=a.Next,a.Dx===e.ClipperBase.horizontal&&a!==A&&a.Bot.X!==a.Prev.Top.X&&this.ReverseHorizontal(a),a=a.Next;a.Dx===e.ClipperBase.horizontal&&a!==A&&a.Bot.X!==a.Prev.Top.X&&this.ReverseHorizontal(a),F=F.Next;}else{for(;F.Top.Y===F.Prev.Bot.Y&&F.Prev.OutIdx!==e.ClipperBase.Skip;)F=F.Prev;if(F.Dx===e.ClipperBase.horizontal&&F.Prev.OutIdx!==e.ClipperBase.Skip){for(j=F;j.Next.Dx===e.ClipperBase.horizontal;)j=j.Next;(j.Next.Top.X===F.Prev.Top.X||j.Next.Top.X>F.Prev.Top.X)&&(F=j.Next);}for(;a!==F;)a.NextInLML=a.Prev,a.Dx===e.ClipperBase.horizontal&&a!==A&&a.Bot.X!==a.Next.Top.X&&this.ReverseHorizontal(a),a=a.Prev;a.Dx===e.ClipperBase.horizontal&&a!==A&&a.Bot.X!==a.Next.Top.X&&this.ReverseHorizontal(a),F=F.Prev;}return F;},e.ClipperBase.prototype.AddPath=function(a,x,A){e.use_lines?!A&&x===e.PolyType.ptClip&&e.Error("AddPath: Open paths must be subject."):A||e.Error("AddPath: Open paths have been disabled.");var F=a.length-1;if(A)for(;F>0&&e.IntPoint.op_Equality(a[F],a[0]);)--F;for(;F>0&&e.IntPoint.op_Equality(a[F],a[F-1]);)--F;if(A&&F<2||!A&&F<1)return!1;for(var j=new Array(),_=0;_<=F;_++)j.push(new e.TEdge());var st=!0;j[1].Curr.X=a[1].X,j[1].Curr.Y=a[1].Y,e.use_xyz&&(j[1].Curr.Z=a[1].Z);var Pt={Value:this.m_UseFullRange};this.RangeTest(a[0],Pt),this.m_UseFullRange=Pt.Value,Pt.Value=this.m_UseFullRange,this.RangeTest(a[F],Pt),this.m_UseFullRange=Pt.Value,this.InitEdge(j[0],j[1],j[F],a[0]),this.InitEdge(j[F],j[0],j[F-1],a[F]);for(var _=F-1;_>=1;--_)Pt.Value=this.m_UseFullRange,this.RangeTest(a[_],Pt),this.m_UseFullRange=Pt.Value,this.InitEdge(j[_],j[_+1],j[_-1],a[_]);for(var xt=j[0],Dt=xt,Ht=xt;;){if(Dt.Curr===Dt.Next.Curr&&(A||Dt.Next!==xt)){if(Dt===Dt.Next)break;Dt===xt&&(xt=Dt.Next),Dt=this.RemoveEdge(Dt),Ht=Dt;continue;}if(Dt.Prev===Dt.Next)break;if(A&&e.ClipperBase.SlopesEqual4(Dt.Prev.Curr,Dt.Curr,Dt.Next.Curr,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(Dt.Prev.Curr,Dt.Curr,Dt.Next.Curr))){Dt===xt&&(xt=Dt.Next),Dt=this.RemoveEdge(Dt),Dt=Dt.Prev,Ht=Dt;continue;}if(Dt=Dt.Next,Dt===Ht||!A&&Dt.Next===xt)break;}if(!A&&Dt===Dt.Next||A&&Dt.Prev===Dt.Next)return!1;A||(this.m_HasOpenPaths=!0,xt.Prev.OutIdx=e.ClipperBase.Skip),Dt=xt;do this.InitEdge2(Dt,x),Dt=Dt.Next,st&&Dt.Curr.Y!==xt.Curr.Y&&(st=!1);while(Dt!==xt);if(st){if(A)return!1;Dt.Prev.OutIdx=e.ClipperBase.Skip;var jt=new e.LocalMinima();for(jt.Next=null,jt.Y=Dt.Bot.Y,jt.LeftBound=null,jt.RightBound=Dt,jt.RightBound.Side=e.EdgeSide.esRight,jt.RightBound.WindDelta=0;Dt.Bot.X!==Dt.Prev.Top.X&&this.ReverseHorizontal(Dt),Dt.Next.OutIdx!==e.ClipperBase.Skip;)Dt.NextInLML=Dt.Next,Dt=Dt.Next;return this.InsertLocalMinima(jt),this.m_edges.push(j),!0;}this.m_edges.push(j);var qt,oe=null;for(e.IntPoint.op_Equality(Dt.Prev.Bot,Dt.Prev.Top)&&(Dt=Dt.Next);Dt=this.FindNextLocMin(Dt),Dt!==oe;){oe===null&&(oe=Dt);var jt=new e.LocalMinima();jt.Next=null,jt.Y=Dt.Bot.Y,Dt.Dx<Dt.Prev.Dx?(jt.LeftBound=Dt.Prev,jt.RightBound=Dt,qt=!1):(jt.LeftBound=Dt,jt.RightBound=Dt.Prev,qt=!0),jt.LeftBound.Side=e.EdgeSide.esLeft,jt.RightBound.Side=e.EdgeSide.esRight,A?jt.LeftBound.Next===jt.RightBound?jt.LeftBound.WindDelta=-1:jt.LeftBound.WindDelta=1:jt.LeftBound.WindDelta=0,jt.RightBound.WindDelta=-jt.LeftBound.WindDelta,Dt=this.ProcessBound(jt.LeftBound,qt),Dt.OutIdx===e.ClipperBase.Skip&&(Dt=this.ProcessBound(Dt,qt));var me=this.ProcessBound(jt.RightBound,!qt);me.OutIdx===e.ClipperBase.Skip&&(me=this.ProcessBound(me,!qt)),jt.LeftBound.OutIdx===e.ClipperBase.Skip?jt.LeftBound=null:jt.RightBound.OutIdx===e.ClipperBase.Skip&&(jt.RightBound=null),this.InsertLocalMinima(jt),qt||(Dt=me);}return!0;},e.ClipperBase.prototype.AddPaths=function(a,x,A){for(var F=!1,j=0,_=a.length;j<_;++j)this.AddPath(a[j],x,A)&&(F=!0);return F;},e.ClipperBase.prototype.Pt2IsBetweenPt1AndPt3=function(a,x,A){return e.IntPoint.op_Equality(a,A)||e.IntPoint.op_Equality(a,x)||e.IntPoint.op_Equality(A,x)?!1:a.X!==A.X?x.X>a.X==x.X<A.X:x.Y>a.Y==x.Y<A.Y;},e.ClipperBase.prototype.RemoveEdge=function(a){a.Prev.Next=a.Next,a.Next.Prev=a.Prev;var x=a.Next;return a.Prev=null,x;},e.ClipperBase.prototype.SetDx=function(a){a.Delta.X=a.Top.X-a.Bot.X,a.Delta.Y=a.Top.Y-a.Bot.Y,a.Delta.Y===0?a.Dx=e.ClipperBase.horizontal:a.Dx=a.Delta.X/a.Delta.Y;},e.ClipperBase.prototype.InsertLocalMinima=function(a){if(this.m_MinimaList===null)this.m_MinimaList=a;else if(a.Y>=this.m_MinimaList.Y)a.Next=this.m_MinimaList,this.m_MinimaList=a;else{for(var x=this.m_MinimaList;x.Next!==null&&a.Y<x.Next.Y;)x=x.Next;a.Next=x.Next,x.Next=a;}},e.ClipperBase.prototype.PopLocalMinima=function(a,x){return x.v=this.m_CurrentLM,this.m_CurrentLM!==null&&this.m_CurrentLM.Y===a?(this.m_CurrentLM=this.m_CurrentLM.Next,!0):!1;},e.ClipperBase.prototype.ReverseHorizontal=function(a){var x=a.Top.X;a.Top.X=a.Bot.X,a.Bot.X=x,e.use_xyz&&(x=a.Top.Z,a.Top.Z=a.Bot.Z,a.Bot.Z=x);},e.ClipperBase.prototype.Reset=function(){if(this.m_CurrentLM=this.m_MinimaList,this.m_CurrentLM!==null){this.m_Scanbeam=null;for(var a=this.m_MinimaList;a!==null;){this.InsertScanbeam(a.Y);var x=a.LeftBound;x!==null&&(x.Curr.X=x.Bot.X,x.Curr.Y=x.Bot.Y,e.use_xyz&&(x.Curr.Z=x.Bot.Z),x.OutIdx=e.ClipperBase.Unassigned),x=a.RightBound,x!==null&&(x.Curr.X=x.Bot.X,x.Curr.Y=x.Bot.Y,e.use_xyz&&(x.Curr.Z=x.Bot.Z),x.OutIdx=e.ClipperBase.Unassigned),a=a.Next;}this.m_ActiveEdges=null;}},e.ClipperBase.prototype.InsertScanbeam=function(a){if(this.m_Scanbeam===null)this.m_Scanbeam=new e.Scanbeam(),this.m_Scanbeam.Next=null,this.m_Scanbeam.Y=a;else if(a>this.m_Scanbeam.Y){var x=new e.Scanbeam();x.Y=a,x.Next=this.m_Scanbeam,this.m_Scanbeam=x;}else{for(var A=this.m_Scanbeam;A.Next!==null&&a<=A.Next.Y;)A=A.Next;if(a===A.Y)return;var F=new e.Scanbeam();F.Y=a,F.Next=A.Next,A.Next=F;}},e.ClipperBase.prototype.PopScanbeam=function(a){return this.m_Scanbeam===null?(a.v=0,!1):(a.v=this.m_Scanbeam.Y,this.m_Scanbeam=this.m_Scanbeam.Next,!0);},e.ClipperBase.prototype.LocalMinimaPending=function(){return this.m_CurrentLM!==null;},e.ClipperBase.prototype.CreateOutRec=function(){var a=new e.OutRec();return a.Idx=e.ClipperBase.Unassigned,a.IsHole=!1,a.IsOpen=!1,a.FirstLeft=null,a.Pts=null,a.BottomPt=null,a.PolyNode=null,this.m_PolyOuts.push(a),a.Idx=this.m_PolyOuts.length-1,a;},e.ClipperBase.prototype.DisposeOutRec=function(a){var x=this.m_PolyOuts[a];x.Pts=null,x=null,this.m_PolyOuts[a]=null;},e.ClipperBase.prototype.UpdateEdgeIntoAEL=function(a){a.NextInLML===null&&e.Error("UpdateEdgeIntoAEL: invalid call");var x=a.PrevInAEL,A=a.NextInAEL;return a.NextInLML.OutIdx=a.OutIdx,x!==null?x.NextInAEL=a.NextInLML:this.m_ActiveEdges=a.NextInLML,A!==null&&(A.PrevInAEL=a.NextInLML),a.NextInLML.Side=a.Side,a.NextInLML.WindDelta=a.WindDelta,a.NextInLML.WindCnt=a.WindCnt,a.NextInLML.WindCnt2=a.WindCnt2,a=a.NextInLML,a.Curr.X=a.Bot.X,a.Curr.Y=a.Bot.Y,a.PrevInAEL=x,a.NextInAEL=A,e.ClipperBase.IsHorizontal(a)||this.InsertScanbeam(a.Top.Y),a;},e.ClipperBase.prototype.SwapPositionsInAEL=function(a,x){if(!(a.NextInAEL===a.PrevInAEL||x.NextInAEL===x.PrevInAEL)){if(a.NextInAEL===x){var A=x.NextInAEL;A!==null&&(A.PrevInAEL=a);var F=a.PrevInAEL;F!==null&&(F.NextInAEL=x),x.PrevInAEL=F,x.NextInAEL=a,a.PrevInAEL=x,a.NextInAEL=A;}else if(x.NextInAEL===a){var j=a.NextInAEL;j!==null&&(j.PrevInAEL=x);var _=x.PrevInAEL;_!==null&&(_.NextInAEL=a),a.PrevInAEL=_,a.NextInAEL=x,x.PrevInAEL=a,x.NextInAEL=j;}else{var st=a.NextInAEL,Pt=a.PrevInAEL;a.NextInAEL=x.NextInAEL,a.NextInAEL!==null&&(a.NextInAEL.PrevInAEL=a),a.PrevInAEL=x.PrevInAEL,a.PrevInAEL!==null&&(a.PrevInAEL.NextInAEL=a),x.NextInAEL=st,x.NextInAEL!==null&&(x.NextInAEL.PrevInAEL=x),x.PrevInAEL=Pt,x.PrevInAEL!==null&&(x.PrevInAEL.NextInAEL=x);}a.PrevInAEL===null?this.m_ActiveEdges=a:x.PrevInAEL===null&&(this.m_ActiveEdges=x);}},e.ClipperBase.prototype.DeleteFromAEL=function(a){var x=a.PrevInAEL,A=a.NextInAEL;x===null&&A===null&&a!==this.m_ActiveEdges||(x!==null?x.NextInAEL=A:this.m_ActiveEdges=A,A!==null&&(A.PrevInAEL=x),a.NextInAEL=null,a.PrevInAEL=null);},e.Clipper=function(a){_typeof(a)>"u"&&(a=0),this.m_PolyOuts=null,this.m_ClipType=e.ClipType.ctIntersection,this.m_Scanbeam=null,this.m_Maxima=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=null,this.m_IntersectNodeComparer=null,this.m_ExecuteLocked=!1,this.m_ClipFillType=e.PolyFillType.pftEvenOdd,this.m_SubjFillType=e.PolyFillType.pftEvenOdd,this.m_Joins=null,this.m_GhostJoins=null,this.m_UsingPolyTree=!1,this.ReverseSolution=!1,this.StrictlySimple=!1,e.ClipperBase.call(this),this.m_Scanbeam=null,this.m_Maxima=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=new Array(),this.m_IntersectNodeComparer=e.MyIntersectNodeSort.Compare,this.m_ExecuteLocked=!1,this.m_UsingPolyTree=!1,this.m_PolyOuts=new Array(),this.m_Joins=new Array(),this.m_GhostJoins=new Array(),this.ReverseSolution=(1&a)!==0,this.StrictlySimple=(2&a)!==0,this.PreserveCollinear=(4&a)!==0,e.use_xyz&&(this.ZFillFunction=null);},e.Clipper.ioReverseSolution=1,e.Clipper.ioStrictlySimple=2,e.Clipper.ioPreserveCollinear=4,e.Clipper.prototype.Clear=function(){this.m_edges.length!==0&&(this.DisposeAllPolyPts(),e.ClipperBase.prototype.Clear.call(this));},e.Clipper.prototype.InsertMaxima=function(a){var x=new e.Maxima();if(x.X=a,this.m_Maxima===null)this.m_Maxima=x,this.m_Maxima.Next=null,this.m_Maxima.Prev=null;else if(a<this.m_Maxima.X)x.Next=this.m_Maxima,x.Prev=null,this.m_Maxima=x;else{for(var A=this.m_Maxima;A.Next!==null&&a>=A.Next.X;)A=A.Next;if(a===A.X)return;x.Next=A.Next,x.Prev=A,A.Next!==null&&(A.Next.Prev=x),A.Next=x;}},e.Clipper.prototype.Execute=function(){var a=arguments,x=a.length,A=a[1]instanceof e.PolyTree;if(x===4&&!A){var F=a[0],j=a[1],_=a[2],st=a[3];if(this.m_ExecuteLocked)return!1;this.m_HasOpenPaths&&e.Error("Error: PolyTree struct is needed for open path clipping."),this.m_ExecuteLocked=!0,e.Clear(j),this.m_SubjFillType=_,this.m_ClipFillType=st,this.m_ClipType=F,this.m_UsingPolyTree=!1;try{var Pt=this.ExecuteInternal();Pt&&this.BuildResult(j);}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1;}return Pt;}else if(x===4&&A){var F=a[0],xt=a[1],_=a[2],st=a[3];if(this.m_ExecuteLocked)return!1;this.m_ExecuteLocked=!0,this.m_SubjFillType=_,this.m_ClipFillType=st,this.m_ClipType=F,this.m_UsingPolyTree=!0;try{var Pt=this.ExecuteInternal();Pt&&this.BuildResult2(xt);}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1;}return Pt;}else if(x===2&&!A){var F=a[0],j=a[1];return this.Execute(F,j,e.PolyFillType.pftEvenOdd,e.PolyFillType.pftEvenOdd);}else if(x===2&&A){var F=a[0],xt=a[1];return this.Execute(F,xt,e.PolyFillType.pftEvenOdd,e.PolyFillType.pftEvenOdd);}},e.Clipper.prototype.FixHoleLinkage=function(a){if(!(a.FirstLeft===null||a.IsHole!==a.FirstLeft.IsHole&&a.FirstLeft.Pts!==null)){for(var x=a.FirstLeft;x!==null&&(x.IsHole===a.IsHole||x.Pts===null);)x=x.FirstLeft;a.FirstLeft=x;}},e.Clipper.prototype.ExecuteInternal=function(){try{this.Reset(),this.m_SortedEdges=null,this.m_Maxima=null;var a={},x={};if(!this.PopScanbeam(a))return!1;for(this.InsertLocalMinimaIntoAEL(a.v);this.PopScanbeam(x)||this.LocalMinimaPending();){if(this.ProcessHorizontals(),this.m_GhostJoins.length=0,!this.ProcessIntersections(x.v))return!1;this.ProcessEdgesAtTopOfScanbeam(x.v),a.v=x.v,this.InsertLocalMinimaIntoAEL(a.v);}var A,F,j;for(F=0,j=this.m_PolyOuts.length;F<j;F++)A=this.m_PolyOuts[F],!(A.Pts===null||A.IsOpen)&&(A.IsHole^this.ReverseSolution)==this.Area$1(A)>0&&this.ReversePolyPtLinks(A.Pts);for(this.JoinCommonEdges(),F=0,j=this.m_PolyOuts.length;F<j;F++)A=this.m_PolyOuts[F],A.Pts!==null&&(A.IsOpen?this.FixupOutPolyline(A):this.FixupOutPolygon(A));return this.StrictlySimple&&this.DoSimplePolygons(),!0;}finally{this.m_Joins.length=0,this.m_GhostJoins.length=0;}},e.Clipper.prototype.DisposeAllPolyPts=function(){for(var a=0,x=this.m_PolyOuts.length;a<x;++a)this.DisposeOutRec(a);e.Clear(this.m_PolyOuts);},e.Clipper.prototype.AddJoin=function(a,x,A){var F=new e.Join();F.OutPt1=a,F.OutPt2=x,F.OffPt.X=A.X,F.OffPt.Y=A.Y,e.use_xyz&&(F.OffPt.Z=A.Z),this.m_Joins.push(F);},e.Clipper.prototype.AddGhostJoin=function(a,x){var A=new e.Join();A.OutPt1=a,A.OffPt.X=x.X,A.OffPt.Y=x.Y,e.use_xyz&&(A.OffPt.Z=x.Z),this.m_GhostJoins.push(A);},e.Clipper.prototype.SetZ=function(a,x,A){if(this.ZFillFunction!==null){if(a.Z!==0||this.ZFillFunction===null)return;e.IntPoint.op_Equality(a,x.Bot)?a.Z=x.Bot.Z:e.IntPoint.op_Equality(a,x.Top)?a.Z=x.Top.Z:e.IntPoint.op_Equality(a,A.Bot)?a.Z=A.Bot.Z:e.IntPoint.op_Equality(a,A.Top)?a.Z=A.Top.Z:this.ZFillFunction(x.Bot,x.Top,A.Bot,A.Top,a);}},e.Clipper.prototype.InsertLocalMinimaIntoAEL=function(a){for(var x={},A,F;this.PopLocalMinima(a,x);){A=x.v.LeftBound,F=x.v.RightBound;var j=null;if(A===null?(this.InsertEdgeIntoAEL(F,null),this.SetWindingCount(F),this.IsContributing(F)&&(j=this.AddOutPt(F,F.Bot))):F===null?(this.InsertEdgeIntoAEL(A,null),this.SetWindingCount(A),this.IsContributing(A)&&(j=this.AddOutPt(A,A.Bot)),this.InsertScanbeam(A.Top.Y)):(this.InsertEdgeIntoAEL(A,null),this.InsertEdgeIntoAEL(F,A),this.SetWindingCount(A),F.WindCnt=A.WindCnt,F.WindCnt2=A.WindCnt2,this.IsContributing(A)&&(j=this.AddLocalMinPoly(A,F,A.Bot)),this.InsertScanbeam(A.Top.Y)),F!==null&&(e.ClipperBase.IsHorizontal(F)?(F.NextInLML!==null&&this.InsertScanbeam(F.NextInLML.Top.Y),this.AddEdgeToSEL(F)):this.InsertScanbeam(F.Top.Y)),!(A===null||F===null)){if(j!==null&&e.ClipperBase.IsHorizontal(F)&&this.m_GhostJoins.length>0&&F.WindDelta!==0)for(var _=0,st=this.m_GhostJoins.length;_<st;_++){var Pt=this.m_GhostJoins[_];this.HorzSegmentsOverlap(Pt.OutPt1.Pt.X,Pt.OffPt.X,F.Bot.X,F.Top.X)&&this.AddJoin(Pt.OutPt1,j,Pt.OffPt);}if(A.OutIdx>=0&&A.PrevInAEL!==null&&A.PrevInAEL.Curr.X===A.Bot.X&&A.PrevInAEL.OutIdx>=0&&e.ClipperBase.SlopesEqual5(A.PrevInAEL.Curr,A.PrevInAEL.Top,A.Curr,A.Top,this.m_UseFullRange)&&A.WindDelta!==0&&A.PrevInAEL.WindDelta!==0){var xt=this.AddOutPt(A.PrevInAEL,A.Bot);this.AddJoin(j,xt,A.Top);}if(A.NextInAEL!==F){if(F.OutIdx>=0&&F.PrevInAEL.OutIdx>=0&&e.ClipperBase.SlopesEqual5(F.PrevInAEL.Curr,F.PrevInAEL.Top,F.Curr,F.Top,this.m_UseFullRange)&&F.WindDelta!==0&&F.PrevInAEL.WindDelta!==0){var xt=this.AddOutPt(F.PrevInAEL,F.Bot);this.AddJoin(j,xt,F.Top);}var Dt=A.NextInAEL;if(Dt!==null)for(;Dt!==F;)this.IntersectEdges(F,Dt,A.Curr),Dt=Dt.NextInAEL;}}}},e.Clipper.prototype.InsertEdgeIntoAEL=function(a,x){if(this.m_ActiveEdges===null)a.PrevInAEL=null,a.NextInAEL=null,this.m_ActiveEdges=a;else if(x===null&&this.E2InsertsBeforeE1(this.m_ActiveEdges,a))a.PrevInAEL=null,a.NextInAEL=this.m_ActiveEdges,this.m_ActiveEdges.PrevInAEL=a,this.m_ActiveEdges=a;else{for(x===null&&(x=this.m_ActiveEdges);x.NextInAEL!==null&&!this.E2InsertsBeforeE1(x.NextInAEL,a);)x=x.NextInAEL;a.NextInAEL=x.NextInAEL,x.NextInAEL!==null&&(x.NextInAEL.PrevInAEL=a),a.PrevInAEL=x,x.NextInAEL=a;}},e.Clipper.prototype.E2InsertsBeforeE1=function(a,x){return x.Curr.X===a.Curr.X?x.Top.Y>a.Top.Y?x.Top.X<e.Clipper.TopX(a,x.Top.Y):a.Top.X>e.Clipper.TopX(x,a.Top.Y):x.Curr.X<a.Curr.X;},e.Clipper.prototype.IsEvenOddFillType=function(a){return a.PolyTyp===e.PolyType.ptSubject?this.m_SubjFillType===e.PolyFillType.pftEvenOdd:this.m_ClipFillType===e.PolyFillType.pftEvenOdd;},e.Clipper.prototype.IsEvenOddAltFillType=function(a){return a.PolyTyp===e.PolyType.ptSubject?this.m_ClipFillType===e.PolyFillType.pftEvenOdd:this.m_SubjFillType===e.PolyFillType.pftEvenOdd;},e.Clipper.prototype.IsContributing=function(a){var x,A;switch(a.PolyTyp===e.PolyType.ptSubject?(x=this.m_SubjFillType,A=this.m_ClipFillType):(x=this.m_ClipFillType,A=this.m_SubjFillType),x){case e.PolyFillType.pftEvenOdd:if(a.WindDelta===0&&a.WindCnt!==1)return!1;break;case e.PolyFillType.pftNonZero:if(Math.abs(a.WindCnt)!==1)return!1;break;case e.PolyFillType.pftPositive:if(a.WindCnt!==1)return!1;break;default:if(a.WindCnt!==-1)return!1;break;}switch(this.m_ClipType){case e.ClipType.ctIntersection:switch(A){case e.PolyFillType.pftEvenOdd:case e.PolyFillType.pftNonZero:return a.WindCnt2!==0;case e.PolyFillType.pftPositive:return a.WindCnt2>0;default:return a.WindCnt2<0;}case e.ClipType.ctUnion:switch(A){case e.PolyFillType.pftEvenOdd:case e.PolyFillType.pftNonZero:return a.WindCnt2===0;case e.PolyFillType.pftPositive:return a.WindCnt2<=0;default:return a.WindCnt2>=0;}case e.ClipType.ctDifference:if(a.PolyTyp===e.PolyType.ptSubject)switch(A){case e.PolyFillType.pftEvenOdd:case e.PolyFillType.pftNonZero:return a.WindCnt2===0;case e.PolyFillType.pftPositive:return a.WindCnt2<=0;default:return a.WindCnt2>=0;}else switch(A){case e.PolyFillType.pftEvenOdd:case e.PolyFillType.pftNonZero:return a.WindCnt2!==0;case e.PolyFillType.pftPositive:return a.WindCnt2>0;default:return a.WindCnt2<0;}case e.ClipType.ctXor:if(a.WindDelta===0)switch(A){case e.PolyFillType.pftEvenOdd:case e.PolyFillType.pftNonZero:return a.WindCnt2===0;case e.PolyFillType.pftPositive:return a.WindCnt2<=0;default:return a.WindCnt2>=0;}else return!0;}return!0;},e.Clipper.prototype.SetWindingCount=function(a){for(var x=a.PrevInAEL;x!==null&&(x.PolyTyp!==a.PolyTyp||x.WindDelta===0);)x=x.PrevInAEL;if(x===null){var A=a.PolyTyp===e.PolyType.ptSubject?this.m_SubjFillType:this.m_ClipFillType;a.WindDelta===0?a.WindCnt=A===e.PolyFillType.pftNegative?-1:1:a.WindCnt=a.WindDelta,a.WindCnt2=0,x=this.m_ActiveEdges;}else if(a.WindDelta===0&&this.m_ClipType!==e.ClipType.ctUnion)a.WindCnt=1,a.WindCnt2=x.WindCnt2,x=x.NextInAEL;else if(this.IsEvenOddFillType(a)){if(a.WindDelta===0){for(var F=!0,j=x.PrevInAEL;j!==null;)j.PolyTyp===x.PolyTyp&&j.WindDelta!==0&&(F=!F),j=j.PrevInAEL;a.WindCnt=F?0:1;}else a.WindCnt=a.WindDelta;a.WindCnt2=x.WindCnt2,x=x.NextInAEL;}else x.WindCnt*x.WindDelta<0?Math.abs(x.WindCnt)>1?x.WindDelta*a.WindDelta<0?a.WindCnt=x.WindCnt:a.WindCnt=x.WindCnt+a.WindDelta:a.WindCnt=a.WindDelta===0?1:a.WindDelta:a.WindDelta===0?a.WindCnt=x.WindCnt<0?x.WindCnt-1:x.WindCnt+1:x.WindDelta*a.WindDelta<0?a.WindCnt=x.WindCnt:a.WindCnt=x.WindCnt+a.WindDelta,a.WindCnt2=x.WindCnt2,x=x.NextInAEL;if(this.IsEvenOddAltFillType(a))for(;x!==a;)x.WindDelta!==0&&(a.WindCnt2=a.WindCnt2===0?1:0),x=x.NextInAEL;else for(;x!==a;)a.WindCnt2+=x.WindDelta,x=x.NextInAEL;},e.Clipper.prototype.AddEdgeToSEL=function(a){this.m_SortedEdges===null?(this.m_SortedEdges=a,a.PrevInSEL=null,a.NextInSEL=null):(a.NextInSEL=this.m_SortedEdges,a.PrevInSEL=null,this.m_SortedEdges.PrevInSEL=a,this.m_SortedEdges=a);},e.Clipper.prototype.PopEdgeFromSEL=function(a){if(a.v=this.m_SortedEdges,a.v===null)return!1;var x=a.v;return this.m_SortedEdges=a.v.NextInSEL,this.m_SortedEdges!==null&&(this.m_SortedEdges.PrevInSEL=null),x.NextInSEL=null,x.PrevInSEL=null,!0;},e.Clipper.prototype.CopyAELToSEL=function(){var a=this.m_ActiveEdges;for(this.m_SortedEdges=a;a!==null;)a.PrevInSEL=a.PrevInAEL,a.NextInSEL=a.NextInAEL,a=a.NextInAEL;},e.Clipper.prototype.SwapPositionsInSEL=function(a,x){if(!(a.NextInSEL===null&&a.PrevInSEL===null)&&!(x.NextInSEL===null&&x.PrevInSEL===null)){if(a.NextInSEL===x){var A=x.NextInSEL;A!==null&&(A.PrevInSEL=a);var F=a.PrevInSEL;F!==null&&(F.NextInSEL=x),x.PrevInSEL=F,x.NextInSEL=a,a.PrevInSEL=x,a.NextInSEL=A;}else if(x.NextInSEL===a){var A=a.NextInSEL;A!==null&&(A.PrevInSEL=x);var F=x.PrevInSEL;F!==null&&(F.NextInSEL=a),a.PrevInSEL=F,a.NextInSEL=x,x.PrevInSEL=a,x.NextInSEL=A;}else{var A=a.NextInSEL,F=a.PrevInSEL;a.NextInSEL=x.NextInSEL,a.NextInSEL!==null&&(a.NextInSEL.PrevInSEL=a),a.PrevInSEL=x.PrevInSEL,a.PrevInSEL!==null&&(a.PrevInSEL.NextInSEL=a),x.NextInSEL=A,x.NextInSEL!==null&&(x.NextInSEL.PrevInSEL=x),x.PrevInSEL=F,x.PrevInSEL!==null&&(x.PrevInSEL.NextInSEL=x);}a.PrevInSEL===null?this.m_SortedEdges=a:x.PrevInSEL===null&&(this.m_SortedEdges=x);}},e.Clipper.prototype.AddLocalMaxPoly=function(a,x,A){this.AddOutPt(a,A),x.WindDelta===0&&this.AddOutPt(x,A),a.OutIdx===x.OutIdx?(a.OutIdx=-1,x.OutIdx=-1):a.OutIdx<x.OutIdx?this.AppendPolygon(a,x):this.AppendPolygon(x,a);},e.Clipper.prototype.AddLocalMinPoly=function(a,x,A){var F,j,_;if(e.ClipperBase.IsHorizontal(x)||a.Dx>x.Dx?(F=this.AddOutPt(a,A),x.OutIdx=a.OutIdx,a.Side=e.EdgeSide.esLeft,x.Side=e.EdgeSide.esRight,j=a,j.PrevInAEL===x?_=x.PrevInAEL:_=j.PrevInAEL):(F=this.AddOutPt(x,A),a.OutIdx=x.OutIdx,a.Side=e.EdgeSide.esRight,x.Side=e.EdgeSide.esLeft,j=x,j.PrevInAEL===a?_=a.PrevInAEL:_=j.PrevInAEL),_!==null&&_.OutIdx>=0&&_.Top.Y<A.Y&&j.Top.Y<A.Y){var st=e.Clipper.TopX(_,A.Y),Pt=e.Clipper.TopX(j,A.Y);if(st===Pt&&j.WindDelta!==0&&_.WindDelta!==0&&e.ClipperBase.SlopesEqual5(new e.IntPoint2(st,A.Y),_.Top,new e.IntPoint2(Pt,A.Y),j.Top,this.m_UseFullRange)){var xt=this.AddOutPt(_,A);this.AddJoin(F,xt,j.Top);}}return F;},e.Clipper.prototype.AddOutPt=function(a,x){if(a.OutIdx<0){var A=this.CreateOutRec();A.IsOpen=a.WindDelta===0;var F=new e.OutPt();return A.Pts=F,F.Idx=A.Idx,F.Pt.X=x.X,F.Pt.Y=x.Y,e.use_xyz&&(F.Pt.Z=x.Z),F.Next=F,F.Prev=F,A.IsOpen||this.SetHoleState(a,A),a.OutIdx=A.Idx,F;}else{var A=this.m_PolyOuts[a.OutIdx],j=A.Pts,_=a.Side===e.EdgeSide.esLeft;if(_&&e.IntPoint.op_Equality(x,j.Pt))return j;if(!_&&e.IntPoint.op_Equality(x,j.Prev.Pt))return j.Prev;var F=new e.OutPt();return F.Idx=A.Idx,F.Pt.X=x.X,F.Pt.Y=x.Y,e.use_xyz&&(F.Pt.Z=x.Z),F.Next=j,F.Prev=j.Prev,F.Prev.Next=F,j.Prev=F,_&&(A.Pts=F),F;}},e.Clipper.prototype.GetLastOutPt=function(a){var x=this.m_PolyOuts[a.OutIdx];return a.Side===e.EdgeSide.esLeft?x.Pts:x.Pts.Prev;},e.Clipper.prototype.SwapPoints=function(a,x){var A=new e.IntPoint1(a.Value);a.Value.X=x.Value.X,a.Value.Y=x.Value.Y,e.use_xyz&&(a.Value.Z=x.Value.Z),x.Value.X=A.X,x.Value.Y=A.Y,e.use_xyz&&(x.Value.Z=A.Z);},e.Clipper.prototype.HorzSegmentsOverlap=function(a,x,A,F){var j;return a>x&&(j=a,a=x,x=j),A>F&&(j=A,A=F,F=j),a<F&&A<x;},e.Clipper.prototype.SetHoleState=function(a,x){for(var A=a.PrevInAEL,F=null;A!==null;)A.OutIdx>=0&&A.WindDelta!==0&&(F===null?F=A:F.OutIdx===A.OutIdx&&(F=null)),A=A.PrevInAEL;F===null?(x.FirstLeft=null,x.IsHole=!1):(x.FirstLeft=this.m_PolyOuts[F.OutIdx],x.IsHole=!x.FirstLeft.IsHole);},e.Clipper.prototype.GetDx=function(a,x){return a.Y===x.Y?e.ClipperBase.horizontal:(x.X-a.X)/(x.Y-a.Y);},e.Clipper.prototype.FirstIsBottomPt=function(a,x){for(var A=a.Prev;e.IntPoint.op_Equality(A.Pt,a.Pt)&&A!==a;)A=A.Prev;var F=Math.abs(this.GetDx(a.Pt,A.Pt));for(A=a.Next;e.IntPoint.op_Equality(A.Pt,a.Pt)&&A!==a;)A=A.Next;var j=Math.abs(this.GetDx(a.Pt,A.Pt));for(A=x.Prev;e.IntPoint.op_Equality(A.Pt,x.Pt)&&A!==x;)A=A.Prev;var _=Math.abs(this.GetDx(x.Pt,A.Pt));for(A=x.Next;e.IntPoint.op_Equality(A.Pt,x.Pt)&&A!==x;)A=A.Next;var st=Math.abs(this.GetDx(x.Pt,A.Pt));return Math.max(F,j)===Math.max(_,st)&&Math.min(F,j)===Math.min(_,st)?this.Area(a)>0:F>=_&&F>=st||j>=_&&j>=st;},e.Clipper.prototype.GetBottomPt=function(a){for(var x=null,A=a.Next;A!==a;)A.Pt.Y>a.Pt.Y?(a=A,x=null):A.Pt.Y===a.Pt.Y&&A.Pt.X<=a.Pt.X&&(A.Pt.X<a.Pt.X?(x=null,a=A):A.Next!==a&&A.Prev!==a&&(x=A)),A=A.Next;if(x!==null)for(;x!==A;)for(this.FirstIsBottomPt(A,x)||(a=x),x=x.Next;e.IntPoint.op_Inequality(x.Pt,a.Pt);)x=x.Next;return a;},e.Clipper.prototype.GetLowermostRec=function(a,x){a.BottomPt===null&&(a.BottomPt=this.GetBottomPt(a.Pts)),x.BottomPt===null&&(x.BottomPt=this.GetBottomPt(x.Pts));var A=a.BottomPt,F=x.BottomPt;return A.Pt.Y>F.Pt.Y?a:A.Pt.Y<F.Pt.Y?x:A.Pt.X<F.Pt.X?a:A.Pt.X>F.Pt.X||A.Next===A?x:F.Next===F||this.FirstIsBottomPt(A,F)?a:x;},e.Clipper.prototype.OutRec1RightOfOutRec2=function(a,x){do if(a=a.FirstLeft,a===x)return!0;while(a!==null);return!1;},e.Clipper.prototype.GetOutRec=function(a){for(var x=this.m_PolyOuts[a];x!==this.m_PolyOuts[x.Idx];)x=this.m_PolyOuts[x.Idx];return x;},e.Clipper.prototype.AppendPolygon=function(a,x){var A=this.m_PolyOuts[a.OutIdx],F=this.m_PolyOuts[x.OutIdx],j;this.OutRec1RightOfOutRec2(A,F)?j=F:this.OutRec1RightOfOutRec2(F,A)?j=A:j=this.GetLowermostRec(A,F);var _=A.Pts,st=_.Prev,Pt=F.Pts,xt=Pt.Prev;a.Side===e.EdgeSide.esLeft?x.Side===e.EdgeSide.esLeft?(this.ReversePolyPtLinks(Pt),Pt.Next=_,_.Prev=Pt,st.Next=xt,xt.Prev=st,A.Pts=xt):(xt.Next=_,_.Prev=xt,Pt.Prev=st,st.Next=Pt,A.Pts=Pt):x.Side===e.EdgeSide.esRight?(this.ReversePolyPtLinks(Pt),st.Next=xt,xt.Prev=st,Pt.Next=_,_.Prev=Pt):(st.Next=Pt,Pt.Prev=st,_.Prev=xt,xt.Next=_),A.BottomPt=null,j===F&&(F.FirstLeft!==A&&(A.FirstLeft=F.FirstLeft),A.IsHole=F.IsHole),F.Pts=null,F.BottomPt=null,F.FirstLeft=A;var Dt=a.OutIdx,Ht=x.OutIdx;a.OutIdx=-1,x.OutIdx=-1;for(var jt=this.m_ActiveEdges;jt!==null;){if(jt.OutIdx===Ht){jt.OutIdx=Dt,jt.Side=a.Side;break;}jt=jt.NextInAEL;}F.Idx=A.Idx;},e.Clipper.prototype.ReversePolyPtLinks=function(a){if(a!==null){var x,A;x=a;do A=x.Next,x.Next=x.Prev,x.Prev=A,x=A;while(x!==a);}},e.Clipper.SwapSides=function(a,x){var A=a.Side;a.Side=x.Side,x.Side=A;},e.Clipper.SwapPolyIndexes=function(a,x){var A=a.OutIdx;a.OutIdx=x.OutIdx,x.OutIdx=A;},e.Clipper.prototype.IntersectEdges=function(a,x,A){var F=a.OutIdx>=0,j=x.OutIdx>=0;if(e.use_xyz&&this.SetZ(A,a,x),e.use_lines&&(a.WindDelta===0||x.WindDelta===0)){if(a.WindDelta===0&&x.WindDelta===0)return;a.PolyTyp===x.PolyTyp&&a.WindDelta!==x.WindDelta&&this.m_ClipType===e.ClipType.ctUnion?a.WindDelta===0?j&&(this.AddOutPt(a,A),F&&(a.OutIdx=-1)):F&&(this.AddOutPt(x,A),j&&(x.OutIdx=-1)):a.PolyTyp!==x.PolyTyp&&(a.WindDelta===0&&Math.abs(x.WindCnt)===1&&(this.m_ClipType!==e.ClipType.ctUnion||x.WindCnt2===0)?(this.AddOutPt(a,A),F&&(a.OutIdx=-1)):x.WindDelta===0&&Math.abs(a.WindCnt)===1&&(this.m_ClipType!==e.ClipType.ctUnion||a.WindCnt2===0)&&(this.AddOutPt(x,A),j&&(x.OutIdx=-1)));return;}if(a.PolyTyp===x.PolyTyp){if(this.IsEvenOddFillType(a)){var _=a.WindCnt;a.WindCnt=x.WindCnt,x.WindCnt=_;}else a.WindCnt+x.WindDelta===0?a.WindCnt=-a.WindCnt:a.WindCnt+=x.WindDelta,x.WindCnt-a.WindDelta===0?x.WindCnt=-x.WindCnt:x.WindCnt-=a.WindDelta;}else this.IsEvenOddFillType(x)?a.WindCnt2=a.WindCnt2===0?1:0:a.WindCnt2+=x.WindDelta,this.IsEvenOddFillType(a)?x.WindCnt2=x.WindCnt2===0?1:0:x.WindCnt2-=a.WindDelta;var st,Pt,xt,Dt;a.PolyTyp===e.PolyType.ptSubject?(st=this.m_SubjFillType,xt=this.m_ClipFillType):(st=this.m_ClipFillType,xt=this.m_SubjFillType),x.PolyTyp===e.PolyType.ptSubject?(Pt=this.m_SubjFillType,Dt=this.m_ClipFillType):(Pt=this.m_ClipFillType,Dt=this.m_SubjFillType);var Ht,jt;switch(st){case e.PolyFillType.pftPositive:Ht=a.WindCnt;break;case e.PolyFillType.pftNegative:Ht=-a.WindCnt;break;default:Ht=Math.abs(a.WindCnt);break;}switch(Pt){case e.PolyFillType.pftPositive:jt=x.WindCnt;break;case e.PolyFillType.pftNegative:jt=-x.WindCnt;break;default:jt=Math.abs(x.WindCnt);break;}if(F&&j)Ht!==0&&Ht!==1||jt!==0&&jt!==1||a.PolyTyp!==x.PolyTyp&&this.m_ClipType!==e.ClipType.ctXor?this.AddLocalMaxPoly(a,x,A):(this.AddOutPt(a,A),this.AddOutPt(x,A),e.Clipper.SwapSides(a,x),e.Clipper.SwapPolyIndexes(a,x));else if(F)(jt===0||jt===1)&&(this.AddOutPt(a,A),e.Clipper.SwapSides(a,x),e.Clipper.SwapPolyIndexes(a,x));else if(j)(Ht===0||Ht===1)&&(this.AddOutPt(x,A),e.Clipper.SwapSides(a,x),e.Clipper.SwapPolyIndexes(a,x));else if((Ht===0||Ht===1)&&(jt===0||jt===1)){var qt,oe;switch(xt){case e.PolyFillType.pftPositive:qt=a.WindCnt2;break;case e.PolyFillType.pftNegative:qt=-a.WindCnt2;break;default:qt=Math.abs(a.WindCnt2);break;}switch(Dt){case e.PolyFillType.pftPositive:oe=x.WindCnt2;break;case e.PolyFillType.pftNegative:oe=-x.WindCnt2;break;default:oe=Math.abs(x.WindCnt2);break;}if(a.PolyTyp!==x.PolyTyp)this.AddLocalMinPoly(a,x,A);else if(Ht===1&&jt===1)switch(this.m_ClipType){case e.ClipType.ctIntersection:qt>0&&oe>0&&this.AddLocalMinPoly(a,x,A);break;case e.ClipType.ctUnion:qt<=0&&oe<=0&&this.AddLocalMinPoly(a,x,A);break;case e.ClipType.ctDifference:(a.PolyTyp===e.PolyType.ptClip&&qt>0&&oe>0||a.PolyTyp===e.PolyType.ptSubject&&qt<=0&&oe<=0)&&this.AddLocalMinPoly(a,x,A);break;case e.ClipType.ctXor:this.AddLocalMinPoly(a,x,A);break;}else e.Clipper.SwapSides(a,x);}},e.Clipper.prototype.DeleteFromSEL=function(a){var x=a.PrevInSEL,A=a.NextInSEL;x===null&&A===null&&a!==this.m_SortedEdges||(x!==null?x.NextInSEL=A:this.m_SortedEdges=A,A!==null&&(A.PrevInSEL=x),a.NextInSEL=null,a.PrevInSEL=null);},e.Clipper.prototype.ProcessHorizontals=function(){for(var a={};this.PopEdgeFromSEL(a);)this.ProcessHorizontal(a.v);},e.Clipper.prototype.GetHorzDirection=function(a,x){a.Bot.X<a.Top.X?(x.Left=a.Bot.X,x.Right=a.Top.X,x.Dir=e.Direction.dLeftToRight):(x.Left=a.Top.X,x.Right=a.Bot.X,x.Dir=e.Direction.dRightToLeft);},e.Clipper.prototype.ProcessHorizontal=function(a){var x={Dir:null,Left:null,Right:null};this.GetHorzDirection(a,x);for(var A=x.Dir,F=x.Left,j=x.Right,_=a.WindDelta===0,st=a,Pt=null;st.NextInLML!==null&&e.ClipperBase.IsHorizontal(st.NextInLML);)st=st.NextInLML;st.NextInLML===null&&(Pt=this.GetMaximaPair(st));var xt=this.m_Maxima;if(xt!==null)if(A===e.Direction.dLeftToRight){for(;xt!==null&&xt.X<=a.Bot.X;)xt=xt.Next;xt!==null&&xt.X>=st.Top.X&&(xt=null);}else{for(;xt.Next!==null&&xt.Next.X<a.Bot.X;)xt=xt.Next;xt.X<=st.Top.X&&(xt=null);}for(var Dt=null;;){for(var Ht=a===st,jt=this.GetNextInAEL(a,A);jt!==null;){if(xt!==null)if(A===e.Direction.dLeftToRight)for(;xt!==null&&xt.X<jt.Curr.X;)a.OutIdx>=0&&!_&&this.AddOutPt(a,new e.IntPoint2(xt.X,a.Bot.Y)),xt=xt.Next;else for(;xt!==null&&xt.X>jt.Curr.X;)a.OutIdx>=0&&!_&&this.AddOutPt(a,new e.IntPoint2(xt.X,a.Bot.Y)),xt=xt.Prev;if(A===e.Direction.dLeftToRight&&jt.Curr.X>j||A===e.Direction.dRightToLeft&&jt.Curr.X<F||jt.Curr.X===a.Top.X&&a.NextInLML!==null&&jt.Dx<a.NextInLML.Dx)break;if(a.OutIdx>=0&&!_){e.use_xyz&&(A===e.Direction.dLeftToRight?this.SetZ(jt.Curr,a,jt):this.SetZ(jt.Curr,jt,a)),Dt=this.AddOutPt(a,jt.Curr);for(var qt=this.m_SortedEdges;qt!==null;){if(qt.OutIdx>=0&&this.HorzSegmentsOverlap(a.Bot.X,a.Top.X,qt.Bot.X,qt.Top.X)){var oe=this.GetLastOutPt(qt);this.AddJoin(oe,Dt,qt.Top);}qt=qt.NextInSEL;}this.AddGhostJoin(Dt,a.Bot);}if(jt===Pt&&Ht){a.OutIdx>=0&&this.AddLocalMaxPoly(a,Pt,a.Top),this.DeleteFromAEL(a),this.DeleteFromAEL(Pt);return;}if(A===e.Direction.dLeftToRight){var me=new e.IntPoint2(jt.Curr.X,a.Curr.Y);this.IntersectEdges(a,jt,me);}else{var me=new e.IntPoint2(jt.Curr.X,a.Curr.Y);this.IntersectEdges(jt,a,me);}var Pe=this.GetNextInAEL(jt,A);this.SwapPositionsInAEL(a,jt),jt=Pe;}if(a.NextInLML===null||!e.ClipperBase.IsHorizontal(a.NextInLML))break;a=this.UpdateEdgeIntoAEL(a),a.OutIdx>=0&&this.AddOutPt(a,a.Bot),x={Dir:A,Left:F,Right:j},this.GetHorzDirection(a,x),A=x.Dir,F=x.Left,j=x.Right;}if(a.OutIdx>=0&&Dt===null){Dt=this.GetLastOutPt(a);for(var qt=this.m_SortedEdges;qt!==null;){if(qt.OutIdx>=0&&this.HorzSegmentsOverlap(a.Bot.X,a.Top.X,qt.Bot.X,qt.Top.X)){var oe=this.GetLastOutPt(qt);this.AddJoin(oe,Dt,qt.Top);}qt=qt.NextInSEL;}this.AddGhostJoin(Dt,a.Top);}if(a.NextInLML!==null){if(a.OutIdx>=0){if(Dt=this.AddOutPt(a,a.Top),a=this.UpdateEdgeIntoAEL(a),a.WindDelta===0)return;var Le=a.PrevInAEL,Pe=a.NextInAEL;if(Le!==null&&Le.Curr.X===a.Bot.X&&Le.Curr.Y===a.Bot.Y&&Le.WindDelta===0&&Le.OutIdx>=0&&Le.Curr.Y>Le.Top.Y&&e.ClipperBase.SlopesEqual3(a,Le,this.m_UseFullRange)){var oe=this.AddOutPt(Le,a.Bot);this.AddJoin(Dt,oe,a.Top);}else if(Pe!==null&&Pe.Curr.X===a.Bot.X&&Pe.Curr.Y===a.Bot.Y&&Pe.WindDelta!==0&&Pe.OutIdx>=0&&Pe.Curr.Y>Pe.Top.Y&&e.ClipperBase.SlopesEqual3(a,Pe,this.m_UseFullRange)){var oe=this.AddOutPt(Pe,a.Bot);this.AddJoin(Dt,oe,a.Top);}}else a=this.UpdateEdgeIntoAEL(a);}else a.OutIdx>=0&&this.AddOutPt(a,a.Top),this.DeleteFromAEL(a);},e.Clipper.prototype.GetNextInAEL=function(a,x){return x===e.Direction.dLeftToRight?a.NextInAEL:a.PrevInAEL;},e.Clipper.prototype.IsMinima=function(a){return a!==null&&a.Prev.NextInLML!==a&&a.Next.NextInLML!==a;},e.Clipper.prototype.IsMaxima=function(a,x){return a!==null&&a.Top.Y===x&&a.NextInLML===null;},e.Clipper.prototype.IsIntermediate=function(a,x){return a.Top.Y===x&&a.NextInLML!==null;},e.Clipper.prototype.GetMaximaPair=function(a){return e.IntPoint.op_Equality(a.Next.Top,a.Top)&&a.Next.NextInLML===null?a.Next:e.IntPoint.op_Equality(a.Prev.Top,a.Top)&&a.Prev.NextInLML===null?a.Prev:null;},e.Clipper.prototype.GetMaximaPairEx=function(a){var x=this.GetMaximaPair(a);return x===null||x.OutIdx===e.ClipperBase.Skip||x.NextInAEL===x.PrevInAEL&&!e.ClipperBase.IsHorizontal(x)?null:x;},e.Clipper.prototype.ProcessIntersections=function(a){if(this.m_ActiveEdges===null)return!0;try{if(this.BuildIntersectList(a),this.m_IntersectList.length===0)return!0;if(this.m_IntersectList.length===1||this.FixupIntersectionOrder())this.ProcessIntersectList();else return!1;}catch(_unused21){this.m_SortedEdges=null,this.m_IntersectList.length=0,e.Error("ProcessIntersections error");}return this.m_SortedEdges=null,!0;},e.Clipper.prototype.BuildIntersectList=function(a){if(this.m_ActiveEdges!==null){var x=this.m_ActiveEdges;for(this.m_SortedEdges=x;x!==null;)x.PrevInSEL=x.PrevInAEL,x.NextInSEL=x.NextInAEL,x.Curr.X=e.Clipper.TopX(x,a),x=x.NextInAEL;for(var A=!0;A&&this.m_SortedEdges!==null;){for(A=!1,x=this.m_SortedEdges;x.NextInSEL!==null;){var F=x.NextInSEL,j=new e.IntPoint0();if(x.Curr.X>F.Curr.X){this.IntersectPoint(x,F,j),j.Y<a&&(j=new e.IntPoint2(e.Clipper.TopX(x,a),a));var _=new e.IntersectNode();_.Edge1=x,_.Edge2=F,_.Pt.X=j.X,_.Pt.Y=j.Y,e.use_xyz&&(_.Pt.Z=j.Z),this.m_IntersectList.push(_),this.SwapPositionsInSEL(x,F),A=!0;}else x=F;}if(x.PrevInSEL!==null)x.PrevInSEL.NextInSEL=null;else break;}this.m_SortedEdges=null;}},e.Clipper.prototype.EdgesAdjacent=function(a){return a.Edge1.NextInSEL===a.Edge2||a.Edge1.PrevInSEL===a.Edge2;},e.Clipper.IntersectNodeSort=function(a,x){return x.Pt.Y-a.Pt.Y;},e.Clipper.prototype.FixupIntersectionOrder=function(){this.m_IntersectList.sort(this.m_IntersectNodeComparer),this.CopyAELToSEL();for(var a=this.m_IntersectList.length,x=0;x<a;x++){if(!this.EdgesAdjacent(this.m_IntersectList[x])){for(var A=x+1;A<a&&!this.EdgesAdjacent(this.m_IntersectList[A]);)A++;if(A===a)return!1;var F=this.m_IntersectList[x];this.m_IntersectList[x]=this.m_IntersectList[A],this.m_IntersectList[A]=F;}this.SwapPositionsInSEL(this.m_IntersectList[x].Edge1,this.m_IntersectList[x].Edge2);}return!0;},e.Clipper.prototype.ProcessIntersectList=function(){for(var a=0,x=this.m_IntersectList.length;a<x;a++){var A=this.m_IntersectList[a];this.IntersectEdges(A.Edge1,A.Edge2,A.Pt),this.SwapPositionsInAEL(A.Edge1,A.Edge2);}this.m_IntersectList.length=0;};var Ai=function Ai(a){return a<0?Math.ceil(a-0.5):Math.round(a);},ko=function ko(a){return a<0?Math.ceil(a-0.5):Math.floor(a+0.5);},os=function os(a){return a<0?-Math.round(Math.abs(a)):Math.round(a);},Zn=function Zn(a){return a<0?(a-=0.5,a<-2147483648?Math.ceil(a):a|0):(a+=0.5,a>2147483647?Math.floor(a):a|0);};s.msie?e.Clipper.Round=Ai:s.chromium?e.Clipper.Round=os:s.safari?e.Clipper.Round=Zn:e.Clipper.Round=ko,e.Clipper.TopX=function(a,x){return x===a.Top.Y?a.Top.X:a.Bot.X+e.Clipper.Round(a.Dx*(x-a.Bot.Y));},e.Clipper.prototype.IntersectPoint=function(a,x,A){A.X=0,A.Y=0;var F,j;if(a.Dx===x.Dx){A.Y=a.Curr.Y,A.X=e.Clipper.TopX(a,A.Y);return;}if(a.Delta.X===0)A.X=a.Bot.X,e.ClipperBase.IsHorizontal(x)?A.Y=x.Bot.Y:(j=x.Bot.Y-x.Bot.X/x.Dx,A.Y=e.Clipper.Round(A.X/x.Dx+j));else if(x.Delta.X===0)A.X=x.Bot.X,e.ClipperBase.IsHorizontal(a)?A.Y=a.Bot.Y:(F=a.Bot.Y-a.Bot.X/a.Dx,A.Y=e.Clipper.Round(A.X/a.Dx+F));else{F=a.Bot.X-a.Bot.Y*a.Dx,j=x.Bot.X-x.Bot.Y*x.Dx;var _=(j-F)/(a.Dx-x.Dx);A.Y=e.Clipper.Round(_),Math.abs(a.Dx)<Math.abs(x.Dx)?A.X=e.Clipper.Round(a.Dx*_+F):A.X=e.Clipper.Round(x.Dx*_+j);}if(A.Y<a.Top.Y||A.Y<x.Top.Y){if(a.Top.Y>x.Top.Y)return A.Y=a.Top.Y,A.X=e.Clipper.TopX(x,a.Top.Y),A.X<a.Top.X;A.Y=x.Top.Y,Math.abs(a.Dx)<Math.abs(x.Dx)?A.X=e.Clipper.TopX(a,A.Y):A.X=e.Clipper.TopX(x,A.Y);}A.Y>a.Curr.Y&&(A.Y=a.Curr.Y,Math.abs(a.Dx)>Math.abs(x.Dx)?A.X=e.Clipper.TopX(x,A.Y):A.X=e.Clipper.TopX(a,A.Y));},e.Clipper.prototype.ProcessEdgesAtTopOfScanbeam=function(a){for(var x=this.m_ActiveEdges;x!==null;){var A=this.IsMaxima(x,a);if(A){var F=this.GetMaximaPairEx(x);A=F===null||!e.ClipperBase.IsHorizontal(F);}if(A){this.StrictlySimple&&this.InsertMaxima(x.Top.X);var j=x.PrevInAEL;this.DoMaxima(x),j===null?x=this.m_ActiveEdges:x=j.NextInAEL;}else{if(this.IsIntermediate(x,a)&&e.ClipperBase.IsHorizontal(x.NextInLML)?(x=this.UpdateEdgeIntoAEL(x),x.OutIdx>=0&&this.AddOutPt(x,x.Bot),this.AddEdgeToSEL(x)):(x.Curr.X=e.Clipper.TopX(x,a),x.Curr.Y=a),e.use_xyz&&(x.Top.Y===a?x.Curr.Z=x.Top.Z:x.Bot.Y===a?x.Curr.Z=x.Bot.Z:x.Curr.Z=0),this.StrictlySimple){var j=x.PrevInAEL;if(x.OutIdx>=0&&x.WindDelta!==0&&j!==null&&j.OutIdx>=0&&j.Curr.X===x.Curr.X&&j.WindDelta!==0){var _=new e.IntPoint1(x.Curr);e.use_xyz&&this.SetZ(_,j,x);var st=this.AddOutPt(j,_),Pt=this.AddOutPt(x,_);this.AddJoin(st,Pt,_);}}x=x.NextInAEL;}}for(this.ProcessHorizontals(),this.m_Maxima=null,x=this.m_ActiveEdges;x!==null;){if(this.IsIntermediate(x,a)){var st=null;x.OutIdx>=0&&(st=this.AddOutPt(x,x.Top)),x=this.UpdateEdgeIntoAEL(x);var j=x.PrevInAEL,xt=x.NextInAEL;if(j!==null&&j.Curr.X===x.Bot.X&&j.Curr.Y===x.Bot.Y&&st!==null&&j.OutIdx>=0&&j.Curr.Y===j.Top.Y&&e.ClipperBase.SlopesEqual5(x.Curr,x.Top,j.Curr,j.Top,this.m_UseFullRange)&&x.WindDelta!==0&&j.WindDelta!==0){var Pt=this.AddOutPt(ePrev2,x.Bot);this.AddJoin(st,Pt,x.Top);}else if(xt!==null&&xt.Curr.X===x.Bot.X&&xt.Curr.Y===x.Bot.Y&&st!==null&&xt.OutIdx>=0&&xt.Curr.Y===xt.Top.Y&&e.ClipperBase.SlopesEqual5(x.Curr,x.Top,xt.Curr,xt.Top,this.m_UseFullRange)&&x.WindDelta!==0&&xt.WindDelta!==0){var Pt=this.AddOutPt(xt,x.Bot);this.AddJoin(st,Pt,x.Top);}}x=x.NextInAEL;}},e.Clipper.prototype.DoMaxima=function(a){var x=this.GetMaximaPairEx(a);if(x===null){a.OutIdx>=0&&this.AddOutPt(a,a.Top),this.DeleteFromAEL(a);return;}for(var A=a.NextInAEL;A!==null&&A!==x;)this.IntersectEdges(a,A,a.Top),this.SwapPositionsInAEL(a,A),A=a.NextInAEL;a.OutIdx===-1&&x.OutIdx===-1?(this.DeleteFromAEL(a),this.DeleteFromAEL(x)):a.OutIdx>=0&&x.OutIdx>=0?(a.OutIdx>=0&&this.AddLocalMaxPoly(a,x,a.Top),this.DeleteFromAEL(a),this.DeleteFromAEL(x)):e.use_lines&&a.WindDelta===0?(a.OutIdx>=0&&(this.AddOutPt(a,a.Top),a.OutIdx=e.ClipperBase.Unassigned),this.DeleteFromAEL(a),x.OutIdx>=0&&(this.AddOutPt(x,a.Top),x.OutIdx=e.ClipperBase.Unassigned),this.DeleteFromAEL(x)):e.Error("DoMaxima error");},e.Clipper.ReversePaths=function(a){for(var x=0,A=a.length;x<A;x++)a[x].reverse();},e.Clipper.Orientation=function(a){return e.Clipper.Area(a)>=0;},e.Clipper.prototype.PointCount=function(a){if(a===null)return 0;var x=0,A=a;do x++,A=A.Next;while(A!==a);return x;},e.Clipper.prototype.BuildResult=function(a){e.Clear(a);for(var x=0,A=this.m_PolyOuts.length;x<A;x++){var F=this.m_PolyOuts[x];if(F.Pts!==null){var j=F.Pts.Prev,_=this.PointCount(j);if(!(_<2)){for(var st=new Array(_),Pt=0;Pt<_;Pt++)st[Pt]=j.Pt,j=j.Prev;a.push(st);}}}},e.Clipper.prototype.BuildResult2=function(a){a.Clear();for(var x=0,A=this.m_PolyOuts.length;x<A;x++){var F=this.m_PolyOuts[x],j=this.PointCount(F.Pts);if(!(F.IsOpen&&j<2||!F.IsOpen&&j<3)){this.FixHoleLinkage(F);var _=new e.PolyNode();a.m_AllPolys.push(_),F.PolyNode=_,_.m_polygon.length=j;for(var st=F.Pts.Prev,Pt=0;Pt<j;Pt++)_.m_polygon[Pt]=st.Pt,st=st.Prev;}}for(var x=0,A=this.m_PolyOuts.length;x<A;x++){var F=this.m_PolyOuts[x];F.PolyNode!==null&&(F.IsOpen?(F.PolyNode.IsOpen=!0,a.AddChild(F.PolyNode)):F.FirstLeft!==null&&F.FirstLeft.PolyNode!==null?F.FirstLeft.PolyNode.AddChild(F.PolyNode):a.AddChild(F.PolyNode));}},e.Clipper.prototype.FixupOutPolyline=function(a){for(var x=a.Pts,A=x.Prev;x!==A;)if(x=x.Next,e.IntPoint.op_Equality(x.Pt,x.Prev.Pt)){x===A&&(A=x.Prev);var F=x.Prev;F.Next=x.Next,x.Next.Prev=F,x=F;}x===x.Prev&&(a.Pts=null);},e.Clipper.prototype.FixupOutPolygon=function(a){var x=null;a.BottomPt=null;for(var A=a.Pts,F=this.PreserveCollinear||this.StrictlySimple;;){if(A.Prev===A||A.Prev===A.Next){a.Pts=null;return;}if(e.IntPoint.op_Equality(A.Pt,A.Next.Pt)||e.IntPoint.op_Equality(A.Pt,A.Prev.Pt)||e.ClipperBase.SlopesEqual4(A.Prev.Pt,A.Pt,A.Next.Pt,this.m_UseFullRange)&&(!F||!this.Pt2IsBetweenPt1AndPt3(A.Prev.Pt,A.Pt,A.Next.Pt)))x=null,A.Prev.Next=A.Next,A.Next.Prev=A.Prev,A=A.Prev;else{if(A===x)break;x===null&&(x=A),A=A.Next;}}a.Pts=A;},e.Clipper.prototype.DupOutPt=function(a,x){var A=new e.OutPt();return A.Pt.X=a.Pt.X,A.Pt.Y=a.Pt.Y,e.use_xyz&&(A.Pt.Z=a.Pt.Z),A.Idx=a.Idx,x?(A.Next=a.Next,A.Prev=a,a.Next.Prev=A,a.Next=A):(A.Prev=a.Prev,A.Next=a,a.Prev.Next=A,a.Prev=A),A;},e.Clipper.prototype.GetOverlap=function(a,x,A,F,j){return a<x?A<F?(j.Left=Math.max(a,A),j.Right=Math.min(x,F)):(j.Left=Math.max(a,F),j.Right=Math.min(x,A)):A<F?(j.Left=Math.max(x,A),j.Right=Math.min(a,F)):(j.Left=Math.max(x,F),j.Right=Math.min(a,A)),j.Left<j.Right;},e.Clipper.prototype.JoinHorz=function(a,x,A,F,j,_){var st=a.Pt.X>x.Pt.X?e.Direction.dRightToLeft:e.Direction.dLeftToRight,Pt=A.Pt.X>F.Pt.X?e.Direction.dRightToLeft:e.Direction.dLeftToRight;if(st===Pt)return!1;if(st===e.Direction.dLeftToRight){for(;a.Next.Pt.X<=j.X&&a.Next.Pt.X>=a.Pt.X&&a.Next.Pt.Y===j.Y;)a=a.Next;_&&a.Pt.X!==j.X&&(a=a.Next),x=this.DupOutPt(a,!_),e.IntPoint.op_Inequality(x.Pt,j)&&(a=x,a.Pt.X=j.X,a.Pt.Y=j.Y,e.use_xyz&&(a.Pt.Z=j.Z),x=this.DupOutPt(a,!_));}else{for(;a.Next.Pt.X>=j.X&&a.Next.Pt.X<=a.Pt.X&&a.Next.Pt.Y===j.Y;)a=a.Next;!_&&a.Pt.X!==j.X&&(a=a.Next),x=this.DupOutPt(a,_),e.IntPoint.op_Inequality(x.Pt,j)&&(a=x,a.Pt.X=j.X,a.Pt.Y=j.Y,e.use_xyz&&(a.Pt.Z=j.Z),x=this.DupOutPt(a,_));}if(Pt===e.Direction.dLeftToRight){for(;A.Next.Pt.X<=j.X&&A.Next.Pt.X>=A.Pt.X&&A.Next.Pt.Y===j.Y;)A=A.Next;_&&A.Pt.X!==j.X&&(A=A.Next),F=this.DupOutPt(A,!_),e.IntPoint.op_Inequality(F.Pt,j)&&(A=F,A.Pt.X=j.X,A.Pt.Y=j.Y,e.use_xyz&&(A.Pt.Z=j.Z),F=this.DupOutPt(A,!_));}else{for(;A.Next.Pt.X>=j.X&&A.Next.Pt.X<=A.Pt.X&&A.Next.Pt.Y===j.Y;)A=A.Next;!_&&A.Pt.X!==j.X&&(A=A.Next),F=this.DupOutPt(A,_),e.IntPoint.op_Inequality(F.Pt,j)&&(A=F,A.Pt.X=j.X,A.Pt.Y=j.Y,e.use_xyz&&(A.Pt.Z=j.Z),F=this.DupOutPt(A,_));}return st===e.Direction.dLeftToRight===_?(a.Prev=A,A.Next=a,x.Next=F,F.Prev=x):(a.Next=A,A.Prev=a,x.Prev=F,F.Next=x),!0;},e.Clipper.prototype.JoinPoints=function(a,x,A){var F=a.OutPt1,j=new e.OutPt(),_=a.OutPt2,st=new e.OutPt(),Pt=a.OutPt1.Pt.Y===a.OffPt.Y;if(Pt&&e.IntPoint.op_Equality(a.OffPt,a.OutPt1.Pt)&&e.IntPoint.op_Equality(a.OffPt,a.OutPt2.Pt)){if(x!==A)return!1;for(j=a.OutPt1.Next;j!==F&&e.IntPoint.op_Equality(j.Pt,a.OffPt);)j=j.Next;var xt=j.Pt.Y>a.OffPt.Y;for(st=a.OutPt2.Next;st!==_&&e.IntPoint.op_Equality(st.Pt,a.OffPt);)st=st.Next;var Dt=st.Pt.Y>a.OffPt.Y;return xt===Dt?!1:xt?(j=this.DupOutPt(F,!1),st=this.DupOutPt(_,!0),F.Prev=_,_.Next=F,j.Next=st,st.Prev=j,a.OutPt1=F,a.OutPt2=j,!0):(j=this.DupOutPt(F,!0),st=this.DupOutPt(_,!1),F.Next=_,_.Prev=F,j.Prev=st,st.Next=j,a.OutPt1=F,a.OutPt2=j,!0);}else if(Pt){for(j=F;F.Prev.Pt.Y===F.Pt.Y&&F.Prev!==j&&F.Prev!==_;)F=F.Prev;for(;j.Next.Pt.Y===j.Pt.Y&&j.Next!==F&&j.Next!==_;)j=j.Next;if(j.Next===F||j.Next===_)return!1;for(st=_;_.Prev.Pt.Y===_.Pt.Y&&_.Prev!==st&&_.Prev!==j;)_=_.Prev;for(;st.Next.Pt.Y===st.Pt.Y&&st.Next!==_&&st.Next!==F;)st=st.Next;if(st.Next===_||st.Next===F)return!1;var Ht={Left:null,Right:null};if(!this.GetOverlap(F.Pt.X,j.Pt.X,_.Pt.X,st.Pt.X,Ht))return!1;var jt=Ht.Left,qt=Ht.Right,oe=new e.IntPoint0(),me;return F.Pt.X>=jt&&F.Pt.X<=qt?(oe.X=F.Pt.X,oe.Y=F.Pt.Y,e.use_xyz&&(oe.Z=F.Pt.Z),me=F.Pt.X>j.Pt.X):_.Pt.X>=jt&&_.Pt.X<=qt?(oe.X=_.Pt.X,oe.Y=_.Pt.Y,e.use_xyz&&(oe.Z=_.Pt.Z),me=_.Pt.X>st.Pt.X):j.Pt.X>=jt&&j.Pt.X<=qt?(oe.X=j.Pt.X,oe.Y=j.Pt.Y,e.use_xyz&&(oe.Z=j.Pt.Z),me=j.Pt.X>F.Pt.X):(oe.X=st.Pt.X,oe.Y=st.Pt.Y,e.use_xyz&&(oe.Z=st.Pt.Z),me=st.Pt.X>_.Pt.X),a.OutPt1=F,a.OutPt2=_,this.JoinHorz(F,j,_,st,oe,me);}else{for(j=F.Next;e.IntPoint.op_Equality(j.Pt,F.Pt)&&j!==F;)j=j.Next;var Pe=j.Pt.Y>F.Pt.Y||!e.ClipperBase.SlopesEqual4(F.Pt,j.Pt,a.OffPt,this.m_UseFullRange);if(Pe){for(j=F.Prev;e.IntPoint.op_Equality(j.Pt,F.Pt)&&j!==F;)j=j.Prev;if(j.Pt.Y>F.Pt.Y||!e.ClipperBase.SlopesEqual4(F.Pt,j.Pt,a.OffPt,this.m_UseFullRange))return!1;}for(st=_.Next;e.IntPoint.op_Equality(st.Pt,_.Pt)&&st!==_;)st=st.Next;var Le=st.Pt.Y>_.Pt.Y||!e.ClipperBase.SlopesEqual4(_.Pt,st.Pt,a.OffPt,this.m_UseFullRange);if(Le){for(st=_.Prev;e.IntPoint.op_Equality(st.Pt,_.Pt)&&st!==_;)st=st.Prev;if(st.Pt.Y>_.Pt.Y||!e.ClipperBase.SlopesEqual4(_.Pt,st.Pt,a.OffPt,this.m_UseFullRange))return!1;}return j===F||st===_||j===st||x===A&&Pe===Le?!1:Pe?(j=this.DupOutPt(F,!1),st=this.DupOutPt(_,!0),F.Prev=_,_.Next=F,j.Next=st,st.Prev=j,a.OutPt1=F,a.OutPt2=j,!0):(j=this.DupOutPt(F,!0),st=this.DupOutPt(_,!1),F.Next=_,_.Prev=F,j.Prev=st,st.Next=j,a.OutPt1=F,a.OutPt2=j,!0);}},e.Clipper.GetBounds=function(a){for(var x=0,A=a.length;x<A&&a[x].length===0;)x++;if(x===A)return new e.IntRect(0,0,0,0);var F=new e.IntRect();for(F.left=a[x][0].X,F.right=F.left,F.top=a[x][0].Y,F.bottom=F.top;x<A;x++)for(var j=0,_=a[x].length;j<_;j++)a[x][j].X<F.left?F.left=a[x][j].X:a[x][j].X>F.right&&(F.right=a[x][j].X),a[x][j].Y<F.top?F.top=a[x][j].Y:a[x][j].Y>F.bottom&&(F.bottom=a[x][j].Y);return F;},e.Clipper.prototype.GetBounds2=function(a){var x=a,A=new e.IntRect();for(A.left=a.Pt.X,A.right=a.Pt.X,A.top=a.Pt.Y,A.bottom=a.Pt.Y,a=a.Next;a!==x;)a.Pt.X<A.left&&(A.left=a.Pt.X),a.Pt.X>A.right&&(A.right=a.Pt.X),a.Pt.Y<A.top&&(A.top=a.Pt.Y),a.Pt.Y>A.bottom&&(A.bottom=a.Pt.Y),a=a.Next;return A;},e.Clipper.PointInPolygon=function(a,x){var A=0,F=x.length;if(F<3)return 0;for(var j=x[0],_=1;_<=F;++_){var st=_===F?x[0]:x[_];if(st.Y===a.Y&&(st.X===a.X||j.Y===a.Y&&st.X>a.X==j.X<a.X))return-1;if(j.Y<a.Y!=st.Y<a.Y){if(j.X>=a.X){if(st.X>a.X)A=1-A;else{var Pt=(j.X-a.X)*(st.Y-a.Y)-(st.X-a.X)*(j.Y-a.Y);if(Pt===0)return-1;Pt>0==st.Y>j.Y&&(A=1-A);}}else if(st.X>a.X){var Pt=(j.X-a.X)*(st.Y-a.Y)-(st.X-a.X)*(j.Y-a.Y);if(Pt===0)return-1;Pt>0==st.Y>j.Y&&(A=1-A);}}j=st;}return A;},e.Clipper.prototype.PointInPolygon=function(a,x){var A=0,F=x,j=a.X,_=a.Y,st=x.Pt.X,Pt=x.Pt.Y;do{x=x.Next;var xt=x.Pt.X,Dt=x.Pt.Y;if(Dt===_&&(xt===j||Pt===_&&xt>j==st<j))return-1;if(Pt<_!=Dt<_){if(st>=j){if(xt>j)A=1-A;else{var Ht=(st-j)*(Dt-_)-(xt-j)*(Pt-_);if(Ht===0)return-1;Ht>0==Dt>Pt&&(A=1-A);}}else if(xt>j){var Ht=(st-j)*(Dt-_)-(xt-j)*(Pt-_);if(Ht===0)return-1;Ht>0==Dt>Pt&&(A=1-A);}}st=xt,Pt=Dt;}while(F!==x);return A;},e.Clipper.prototype.Poly2ContainsPoly1=function(a,x){var A=a;do{var F=this.PointInPolygon(A.Pt,x);if(F>=0)return F>0;A=A.Next;}while(A!==a);return!0;},e.Clipper.prototype.FixupFirstLefts1=function(a,x){for(var A,F,j=0,_=this.m_PolyOuts.length;j<_;j++)A=this.m_PolyOuts[j],F=e.Clipper.ParseFirstLeft(A.FirstLeft),A.Pts!==null&&F===a&&this.Poly2ContainsPoly1(A.Pts,x.Pts)&&(A.FirstLeft=x);},e.Clipper.prototype.FixupFirstLefts2=function(a,x){for(var A=x.FirstLeft,F,j,_=0,st=this.m_PolyOuts.length;_<st;_++)F=this.m_PolyOuts[_],!(F.Pts===null||F===x||F===a)&&(j=e.Clipper.ParseFirstLeft(F.FirstLeft),!(j!==A&&j!==a&&j!==x)&&(this.Poly2ContainsPoly1(F.Pts,a.Pts)?F.FirstLeft=a:this.Poly2ContainsPoly1(F.Pts,x.Pts)?F.FirstLeft=x:(F.FirstLeft===a||F.FirstLeft===x)&&(F.FirstLeft=A)));},e.Clipper.prototype.FixupFirstLefts3=function(a,x){for(var A,F,j=0,_=this.m_PolyOuts.length;j<_;j++)A=this.m_PolyOuts[j],F=e.Clipper.ParseFirstLeft(A.FirstLeft),A.Pts!==null&&F===a&&(A.FirstLeft=x);},e.Clipper.ParseFirstLeft=function(a){for(;a!==null&&a.Pts===null;)a=a.FirstLeft;return a;},e.Clipper.prototype.JoinCommonEdges=function(){for(var a=0,x=this.m_Joins.length;a<x;a++){var A=this.m_Joins[a],F=this.GetOutRec(A.OutPt1.Idx),j=this.GetOutRec(A.OutPt2.Idx);if(!(F.Pts===null||j.Pts===null)&&!(F.IsOpen||j.IsOpen)){var _;F===j?_=F:this.OutRec1RightOfOutRec2(F,j)?_=j:this.OutRec1RightOfOutRec2(j,F)?_=F:_=this.GetLowermostRec(F,j),this.JoinPoints(A,F,j)&&(F===j?(F.Pts=A.OutPt1,F.BottomPt=null,j=this.CreateOutRec(),j.Pts=A.OutPt2,this.UpdateOutPtIdxs(j),this.Poly2ContainsPoly1(j.Pts,F.Pts)?(j.IsHole=!F.IsHole,j.FirstLeft=F,this.m_UsingPolyTree&&this.FixupFirstLefts2(j,F),(j.IsHole^this.ReverseSolution)==this.Area$1(j)>0&&this.ReversePolyPtLinks(j.Pts)):this.Poly2ContainsPoly1(F.Pts,j.Pts)?(j.IsHole=F.IsHole,F.IsHole=!j.IsHole,j.FirstLeft=F.FirstLeft,F.FirstLeft=j,this.m_UsingPolyTree&&this.FixupFirstLefts2(F,j),(F.IsHole^this.ReverseSolution)==this.Area$1(F)>0&&this.ReversePolyPtLinks(F.Pts)):(j.IsHole=F.IsHole,j.FirstLeft=F.FirstLeft,this.m_UsingPolyTree&&this.FixupFirstLefts1(F,j))):(j.Pts=null,j.BottomPt=null,j.Idx=F.Idx,F.IsHole=_.IsHole,_===j&&(F.FirstLeft=j.FirstLeft),j.FirstLeft=F,this.m_UsingPolyTree&&this.FixupFirstLefts3(j,F)));}}},e.Clipper.prototype.UpdateOutPtIdxs=function(a){var x=a.Pts;do x.Idx=a.Idx,x=x.Prev;while(x!==a.Pts);},e.Clipper.prototype.DoSimplePolygons=function(){for(var a=0;a<this.m_PolyOuts.length;){var x=this.m_PolyOuts[a++],A=x.Pts;if(!(A===null||x.IsOpen))do{for(var F=A.Next;F!==x.Pts;){if(e.IntPoint.op_Equality(A.Pt,F.Pt)&&F.Next!==A&&F.Prev!==A){var j=A.Prev,_=F.Prev;A.Prev=_,_.Next=A,F.Prev=j,j.Next=F,x.Pts=A;var st=this.CreateOutRec();st.Pts=F,this.UpdateOutPtIdxs(st),this.Poly2ContainsPoly1(st.Pts,x.Pts)?(st.IsHole=!x.IsHole,st.FirstLeft=x,this.m_UsingPolyTree&&this.FixupFirstLefts2(st,x)):this.Poly2ContainsPoly1(x.Pts,st.Pts)?(st.IsHole=x.IsHole,x.IsHole=!st.IsHole,st.FirstLeft=x.FirstLeft,x.FirstLeft=st,this.m_UsingPolyTree&&this.FixupFirstLefts2(x,st)):(st.IsHole=x.IsHole,st.FirstLeft=x.FirstLeft,this.m_UsingPolyTree&&this.FixupFirstLefts1(x,st)),F=A;}F=F.Next;}A=A.Next;}while(A!==x.Pts);}},e.Clipper.Area=function(a){if(!Array.isArray(a))return 0;var x=a.length;if(x<3)return 0;for(var A=0,F=0,j=x-1;F<x;++F)A+=(a[j].X+a[F].X)*(a[j].Y-a[F].Y),j=F;return-A*0.5;},e.Clipper.prototype.Area=function(a){var x=a;if(a===null)return 0;var A=0;do A=A+(a.Prev.Pt.X+a.Pt.X)*(a.Prev.Pt.Y-a.Pt.Y),a=a.Next;while(a!==x);return A*0.5;},e.Clipper.prototype.Area$1=function(a){return this.Area(a.Pts);},e.Clipper.SimplifyPolygon=function(a,x){var A=new Array(),F=new e.Clipper(0);return F.StrictlySimple=!0,F.AddPath(a,e.PolyType.ptSubject,!0),F.Execute(e.ClipType.ctUnion,A,x,x),A;},e.Clipper.SimplifyPolygons=function(a,x){_typeof(x)>"u"&&(x=e.PolyFillType.pftEvenOdd);var A=new Array(),F=new e.Clipper(0);return F.StrictlySimple=!0,F.AddPaths(a,e.PolyType.ptSubject,!0),F.Execute(e.ClipType.ctUnion,A,x,x),A;},e.Clipper.DistanceSqrd=function(a,x){var A=a.X-x.X,F=a.Y-x.Y;return A*A+F*F;},e.Clipper.DistanceFromLineSqrd=function(a,x,A){var F=x.Y-A.Y,j=A.X-x.X,_=F*x.X+j*x.Y;return _=F*a.X+j*a.Y-_,_*_/(F*F+j*j);},e.Clipper.SlopesNearCollinear=function(a,x,A,F){return Math.abs(a.X-x.X)>Math.abs(a.Y-x.Y)?a.X>x.X==a.X<A.X?e.Clipper.DistanceFromLineSqrd(a,x,A)<F:x.X>a.X==x.X<A.X?e.Clipper.DistanceFromLineSqrd(x,a,A)<F:e.Clipper.DistanceFromLineSqrd(A,a,x)<F:a.Y>x.Y==a.Y<A.Y?e.Clipper.DistanceFromLineSqrd(a,x,A)<F:x.Y>a.Y==x.Y<A.Y?e.Clipper.DistanceFromLineSqrd(x,a,A)<F:e.Clipper.DistanceFromLineSqrd(A,a,x)<F;},e.Clipper.PointsAreClose=function(a,x,A){var F=a.X-x.X,j=a.Y-x.Y;return F*F+j*j<=A;},e.Clipper.ExcludeOp=function(a){var x=a.Prev;return x.Next=a.Next,a.Next.Prev=x,x.Idx=0,x;},e.Clipper.CleanPolygon=function(a,x){_typeof(x)>"u"&&(x=1.415);var A=a.length;if(A===0)return new Array();for(var F=new Array(A),j=0;j<A;++j)F[j]=new e.OutPt();for(var j=0;j<A;++j)F[j].Pt=a[j],F[j].Next=F[(j+1)%A],F[j].Next.Prev=F[j],F[j].Idx=0;for(var _=x*x,st=F[0];st.Idx===0&&st.Next!==st.Prev;)e.Clipper.PointsAreClose(st.Pt,st.Prev.Pt,_)?(st=e.Clipper.ExcludeOp(st),A--):e.Clipper.PointsAreClose(st.Prev.Pt,st.Next.Pt,_)?(e.Clipper.ExcludeOp(st.Next),st=e.Clipper.ExcludeOp(st),A-=2):e.Clipper.SlopesNearCollinear(st.Prev.Pt,st.Pt,st.Next.Pt,_)?(st=e.Clipper.ExcludeOp(st),A--):(st.Idx=1,st=st.Next);A<3&&(A=0);for(var Pt=new Array(A),j=0;j<A;++j)Pt[j]=new e.IntPoint1(st.Pt),st=st.Next;return F=null,Pt;},e.Clipper.CleanPolygons=function(a,x){for(var A=new Array(a.length),F=0,j=a.length;F<j;F++)A[F]=e.Clipper.CleanPolygon(a[F],x);return A;},e.Clipper.Minkowski=function(a,x,A,F){var j=F?1:0,_=a.length,st=x.length,Pt=new Array();if(A)for(var xt=0;xt<st;xt++){for(var Dt=new Array(_),Ht=0,jt=a.length,qt=a[Ht];Ht<jt;Ht++,qt=a[Ht])Dt[Ht]=new e.IntPoint2(x[xt].X+qt.X,x[xt].Y+qt.Y);Pt.push(Dt);}else for(var xt=0;xt<st;xt++){for(var Dt=new Array(_),Ht=0,jt=a.length,qt=a[Ht];Ht<jt;Ht++,qt=a[Ht])Dt[Ht]=new e.IntPoint2(x[xt].X-qt.X,x[xt].Y-qt.Y);Pt.push(Dt);}for(var oe=new Array(),xt=0;xt<st-1+j;xt++)for(var Ht=0;Ht<_;Ht++){var me=new Array();me.push(Pt[xt%st][Ht%_]),me.push(Pt[(xt+1)%st][Ht%_]),me.push(Pt[(xt+1)%st][(Ht+1)%_]),me.push(Pt[xt%st][(Ht+1)%_]),e.Clipper.Orientation(me)||me.reverse(),oe.push(me);}return oe;},e.Clipper.MinkowskiSum=function(a,x,A){if(x[0]instanceof Array){for(var j=x,st=new e.Paths(),_=new e.Clipper(),Pt=0;Pt<j.length;++Pt){var xt=e.Clipper.Minkowski(a,j[Pt],!0,A);if(_.AddPaths(xt,e.PolyType.ptSubject,!0),A){var F=e.Clipper.TranslatePath(j[Pt],a[0]);_.AddPath(F,e.PolyType.ptClip,!0);}}return _.Execute(e.ClipType.ctUnion,st,e.PolyFillType.pftNonZero,e.PolyFillType.pftNonZero),st;}else{var F=x,j=e.Clipper.Minkowski(a,F,!0,A),_=new e.Clipper();return _.AddPaths(j,e.PolyType.ptSubject,!0),_.Execute(e.ClipType.ctUnion,j,e.PolyFillType.pftNonZero,e.PolyFillType.pftNonZero),j;}},e.Clipper.TranslatePath=function(a,x){for(var A=new e.Path(),F=0;F<a.length;F++)A.push(new e.IntPoint2(a[F].X+x.X,a[F].Y+x.Y));return A;},e.Clipper.MinkowskiDiff=function(a,x){var A=e.Clipper.Minkowski(a,x,!1,!0),F=new e.Clipper();return F.AddPaths(A,e.PolyType.ptSubject,!0),F.Execute(e.ClipType.ctUnion,A,e.PolyFillType.pftNonZero,e.PolyFillType.pftNonZero),A;},e.Clipper.PolyTreeToPaths=function(a){var x=new Array();return e.Clipper.AddPolyNodeToPaths(a,e.Clipper.NodeType.ntAny,x),x;},e.Clipper.AddPolyNodeToPaths=function(a,x,A){var F=!0;switch(x){case e.Clipper.NodeType.ntOpen:return;case e.Clipper.NodeType.ntClosed:F=!a.IsOpen;break;}a.m_polygon.length>0&&F&&A.push(a.m_polygon);for(var j=0,_=a.Childs(),st=_.length,Pt=_[j];j<st;j++,Pt=_[j])e.Clipper.AddPolyNodeToPaths(Pt,x,A);},e.Clipper.OpenPathsFromPolyTree=function(a){for(var x=new e.Paths(),A=0,F=a.ChildCount();A<F;A++)a.Childs()[A].IsOpen&&x.push(a.Childs()[A].m_polygon);return x;},e.Clipper.ClosedPathsFromPolyTree=function(a){var x=new e.Paths();return e.Clipper.AddPolyNodeToPaths(a,e.Clipper.NodeType.ntClosed,x),x;},Oi(e.Clipper,e.ClipperBase),e.Clipper.NodeType={ntAny:0,ntOpen:1,ntClosed:2},e.ClipperOffset=function(a,x){_typeof(a)>"u"&&(a=2),_typeof(x)>"u"&&(x=e.ClipperOffset.def_arc_tolerance),this.m_destPolys=new e.Paths(),this.m_srcPoly=new e.Path(),this.m_destPoly=new e.Path(),this.m_normals=new Array(),this.m_delta=0,this.m_sinA=0,this.m_sin=0,this.m_cos=0,this.m_miterLim=0,this.m_StepsPerRad=0,this.m_lowest=new e.IntPoint0(),this.m_polyNodes=new e.PolyNode(),this.MiterLimit=a,this.ArcTolerance=x,this.m_lowest.X=-1;},e.ClipperOffset.two_pi=6.28318530717959,e.ClipperOffset.def_arc_tolerance=0.25,e.ClipperOffset.prototype.Clear=function(){e.Clear(this.m_polyNodes.Childs()),this.m_lowest.X=-1;},e.ClipperOffset.Round=e.Clipper.Round,e.ClipperOffset.prototype.AddPath=function(a,x,A){var F=a.length-1;if(!(F<0)){var j=new e.PolyNode();if(j.m_jointype=x,j.m_endtype=A,A===e.EndType.etClosedLine||A===e.EndType.etClosedPolygon)for(;F>0&&e.IntPoint.op_Equality(a[0],a[F]);)F--;j.m_polygon.push(a[0]);for(var _=0,st=0,Pt=1;Pt<=F;Pt++)e.IntPoint.op_Inequality(j.m_polygon[_],a[Pt])&&(_++,j.m_polygon.push(a[Pt]),(a[Pt].Y>j.m_polygon[st].Y||a[Pt].Y===j.m_polygon[st].Y&&a[Pt].X<j.m_polygon[st].X)&&(st=_));if(!(A===e.EndType.etClosedPolygon&&_<2)&&(this.m_polyNodes.AddChild(j),A===e.EndType.etClosedPolygon))if(this.m_lowest.X<0)this.m_lowest=new e.IntPoint2(this.m_polyNodes.ChildCount()-1,st);else{var xt=this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon[this.m_lowest.Y];(j.m_polygon[st].Y>xt.Y||j.m_polygon[st].Y===xt.Y&&j.m_polygon[st].X<xt.X)&&(this.m_lowest=new e.IntPoint2(this.m_polyNodes.ChildCount()-1,st));}}},e.ClipperOffset.prototype.AddPaths=function(a,x,A){for(var F=0,j=a.length;F<j;F++)this.AddPath(a[F],x,A);},e.ClipperOffset.prototype.FixOrientations=function(){if(this.m_lowest.X>=0&&!e.Clipper.Orientation(this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon))for(var a=0;a<this.m_polyNodes.ChildCount();a++){var x=this.m_polyNodes.Childs()[a];(x.m_endtype===e.EndType.etClosedPolygon||x.m_endtype===e.EndType.etClosedLine&&e.Clipper.Orientation(x.m_polygon))&&x.m_polygon.reverse();}else for(var a=0;a<this.m_polyNodes.ChildCount();a++){var x=this.m_polyNodes.Childs()[a];x.m_endtype===e.EndType.etClosedLine&&!e.Clipper.Orientation(x.m_polygon)&&x.m_polygon.reverse();}},e.ClipperOffset.GetUnitNormal=function(a,x){var A=x.X-a.X,F=x.Y-a.Y;if(A===0&&F===0)return new e.DoublePoint2(0,0);var j=1/Math.sqrt(A*A+F*F);return A*=j,F*=j,new e.DoublePoint2(F,-A);},e.ClipperOffset.prototype.DoOffset=function(a){if(this.m_destPolys=new Array(),this.m_delta=a,e.ClipperBase.near_zero(a)){for(var x=0;x<this.m_polyNodes.ChildCount();x++){var A=this.m_polyNodes.Childs()[x];A.m_endtype===e.EndType.etClosedPolygon&&this.m_destPolys.push(A.m_polygon);}return;}this.MiterLimit>2?this.m_miterLim=2/(this.MiterLimit*this.MiterLimit):this.m_miterLim=0.5;var F;this.ArcTolerance<=0?F=e.ClipperOffset.def_arc_tolerance:this.ArcTolerance>Math.abs(a)*e.ClipperOffset.def_arc_tolerance?F=Math.abs(a)*e.ClipperOffset.def_arc_tolerance:F=this.ArcTolerance;var j=3.14159265358979/Math.acos(1-F/Math.abs(a));this.m_sin=Math.sin(e.ClipperOffset.two_pi/j),this.m_cos=Math.cos(e.ClipperOffset.two_pi/j),this.m_StepsPerRad=j/e.ClipperOffset.two_pi,a<0&&(this.m_sin=-this.m_sin);for(var x=0;x<this.m_polyNodes.ChildCount();x++){var A=this.m_polyNodes.Childs()[x];this.m_srcPoly=A.m_polygon;var _=this.m_srcPoly.length;if(!(_===0||a<=0&&(_<3||A.m_endtype!==e.EndType.etClosedPolygon))){if(this.m_destPoly=new Array(),_===1){if(A.m_jointype===e.JoinType.jtRound)for(var st=1,Pt=0,xt=1;xt<=j;xt++){this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[0].X+st*a),e.ClipperOffset.Round(this.m_srcPoly[0].Y+Pt*a)));var Dt=st;st=st*this.m_cos-this.m_sin*Pt,Pt=Dt*this.m_sin+Pt*this.m_cos;}else for(var st=-1,Pt=-1,xt=0;xt<4;++xt)this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[0].X+st*a),e.ClipperOffset.Round(this.m_srcPoly[0].Y+Pt*a))),st<0?st=1:Pt<0?Pt=1:st=-1;this.m_destPolys.push(this.m_destPoly);continue;}this.m_normals.length=0;for(var xt=0;xt<_-1;xt++)this.m_normals.push(e.ClipperOffset.GetUnitNormal(this.m_srcPoly[xt],this.m_srcPoly[xt+1]));if(A.m_endtype===e.EndType.etClosedLine||A.m_endtype===e.EndType.etClosedPolygon?this.m_normals.push(e.ClipperOffset.GetUnitNormal(this.m_srcPoly[_-1],this.m_srcPoly[0])):this.m_normals.push(new e.DoublePoint1(this.m_normals[_-2])),A.m_endtype===e.EndType.etClosedPolygon){for(var Ht=_-1,xt=0;xt<_;xt++)Ht=this.OffsetPoint(xt,Ht,A.m_jointype);this.m_destPolys.push(this.m_destPoly);}else if(A.m_endtype===e.EndType.etClosedLine){for(var Ht=_-1,xt=0;xt<_;xt++)Ht=this.OffsetPoint(xt,Ht,A.m_jointype);this.m_destPolys.push(this.m_destPoly),this.m_destPoly=new Array();for(var jt=this.m_normals[_-1],xt=_-1;xt>0;xt--)this.m_normals[xt]=new e.DoublePoint2(-this.m_normals[xt-1].X,-this.m_normals[xt-1].Y);this.m_normals[0]=new e.DoublePoint2(-jt.X,-jt.Y),Ht=0;for(var xt=_-1;xt>=0;xt--)Ht=this.OffsetPoint(xt,Ht,A.m_jointype);this.m_destPolys.push(this.m_destPoly);}else{for(var Ht=0,xt=1;xt<_-1;++xt)Ht=this.OffsetPoint(xt,Ht,A.m_jointype);var qt;if(A.m_endtype===e.EndType.etOpenButt){var xt=_-1;qt=new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[xt].X+this.m_normals[xt].X*a),e.ClipperOffset.Round(this.m_srcPoly[xt].Y+this.m_normals[xt].Y*a)),this.m_destPoly.push(qt),qt=new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[xt].X-this.m_normals[xt].X*a),e.ClipperOffset.Round(this.m_srcPoly[xt].Y-this.m_normals[xt].Y*a)),this.m_destPoly.push(qt);}else{var xt=_-1;Ht=_-2,this.m_sinA=0,this.m_normals[xt]=new e.DoublePoint2(-this.m_normals[xt].X,-this.m_normals[xt].Y),A.m_endtype===e.EndType.etOpenSquare?this.DoSquare(xt,Ht):this.DoRound(xt,Ht);}for(var xt=_-1;xt>0;xt--)this.m_normals[xt]=new e.DoublePoint2(-this.m_normals[xt-1].X,-this.m_normals[xt-1].Y);this.m_normals[0]=new e.DoublePoint2(-this.m_normals[1].X,-this.m_normals[1].Y),Ht=_-1;for(var xt=Ht-1;xt>0;--xt)Ht=this.OffsetPoint(xt,Ht,A.m_jointype);A.m_endtype===e.EndType.etOpenButt?(qt=new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[0].X-this.m_normals[0].X*a),e.ClipperOffset.Round(this.m_srcPoly[0].Y-this.m_normals[0].Y*a)),this.m_destPoly.push(qt),qt=new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[0].X+this.m_normals[0].X*a),e.ClipperOffset.Round(this.m_srcPoly[0].Y+this.m_normals[0].Y*a)),this.m_destPoly.push(qt)):(Ht=1,this.m_sinA=0,A.m_endtype===e.EndType.etOpenSquare?this.DoSquare(0,1):this.DoRound(0,1)),this.m_destPolys.push(this.m_destPoly);}}}},e.ClipperOffset.prototype.Execute=function(){var a=arguments,x=a[0]instanceof e.PolyTree;if(x){var A=a[0],F=a[1];A.Clear(),this.FixOrientations(),this.DoOffset(F);var j=new e.Clipper(0);if(j.AddPaths(this.m_destPolys,e.PolyType.ptSubject,!0),F>0)j.Execute(e.ClipType.ctUnion,A,e.PolyFillType.pftPositive,e.PolyFillType.pftPositive);else{var _=e.Clipper.GetBounds(this.m_destPolys),st=new e.Path();if(st.push(new e.IntPoint2(_.left-10,_.bottom+10)),st.push(new e.IntPoint2(_.right+10,_.bottom+10)),st.push(new e.IntPoint2(_.right+10,_.top-10)),st.push(new e.IntPoint2(_.left-10,_.top-10)),j.AddPath(st,e.PolyType.ptSubject,!0),j.ReverseSolution=!0,j.Execute(e.ClipType.ctUnion,A,e.PolyFillType.pftNegative,e.PolyFillType.pftNegative),A.ChildCount()===1&&A.Childs()[0].ChildCount()>0){var Pt=A.Childs()[0];A.Childs()[0]=Pt.Childs()[0],A.Childs()[0].m_Parent=A;for(var xt=1;xt<Pt.ChildCount();xt++)A.AddChild(Pt.Childs()[xt]);}else A.Clear();}}else{var A=a[0],F=a[1];e.Clear(A),this.FixOrientations(),this.DoOffset(F);var j=new e.Clipper(0);if(j.AddPaths(this.m_destPolys,e.PolyType.ptSubject,!0),F>0)j.Execute(e.ClipType.ctUnion,A,e.PolyFillType.pftPositive,e.PolyFillType.pftPositive);else{var _=e.Clipper.GetBounds(this.m_destPolys),st=new e.Path();st.push(new e.IntPoint2(_.left-10,_.bottom+10)),st.push(new e.IntPoint2(_.right+10,_.bottom+10)),st.push(new e.IntPoint2(_.right+10,_.top-10)),st.push(new e.IntPoint2(_.left-10,_.top-10)),j.AddPath(st,e.PolyType.ptSubject,!0),j.ReverseSolution=!0,j.Execute(e.ClipType.ctUnion,A,e.PolyFillType.pftNegative,e.PolyFillType.pftNegative),A.length>0&&A.splice(0,1);}}},e.ClipperOffset.prototype.OffsetPoint=function(a,x,A){if(this.m_sinA=this.m_normals[x].X*this.m_normals[a].Y-this.m_normals[a].X*this.m_normals[x].Y,Math.abs(this.m_sinA*this.m_delta)<1){var F=this.m_normals[x].X*this.m_normals[a].X+this.m_normals[a].Y*this.m_normals[x].Y;if(F>0)return this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[a].X+this.m_normals[x].X*this.m_delta),e.ClipperOffset.Round(this.m_srcPoly[a].Y+this.m_normals[x].Y*this.m_delta))),x;}else this.m_sinA>1?this.m_sinA=1:this.m_sinA<-1&&(this.m_sinA=-1);if(this.m_sinA*this.m_delta<0)this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[a].X+this.m_normals[x].X*this.m_delta),e.ClipperOffset.Round(this.m_srcPoly[a].Y+this.m_normals[x].Y*this.m_delta))),this.m_destPoly.push(new e.IntPoint1(this.m_srcPoly[a])),this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[a].X+this.m_normals[a].X*this.m_delta),e.ClipperOffset.Round(this.m_srcPoly[a].Y+this.m_normals[a].Y*this.m_delta)));else switch(A){case e.JoinType.jtMiter:{var j=1+(this.m_normals[a].X*this.m_normals[x].X+this.m_normals[a].Y*this.m_normals[x].Y);j>=this.m_miterLim?this.DoMiter(a,x,j):this.DoSquare(a,x);break;}case e.JoinType.jtSquare:this.DoSquare(a,x);break;case e.JoinType.jtRound:this.DoRound(a,x);break;}return x=a,x;},e.ClipperOffset.prototype.DoSquare=function(a,x){var A=Math.tan(Math.atan2(this.m_sinA,this.m_normals[x].X*this.m_normals[a].X+this.m_normals[x].Y*this.m_normals[a].Y)/4);this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[a].X+this.m_delta*(this.m_normals[x].X-this.m_normals[x].Y*A)),e.ClipperOffset.Round(this.m_srcPoly[a].Y+this.m_delta*(this.m_normals[x].Y+this.m_normals[x].X*A)))),this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[a].X+this.m_delta*(this.m_normals[a].X+this.m_normals[a].Y*A)),e.ClipperOffset.Round(this.m_srcPoly[a].Y+this.m_delta*(this.m_normals[a].Y-this.m_normals[a].X*A))));},e.ClipperOffset.prototype.DoMiter=function(a,x,A){var F=this.m_delta/A;this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[a].X+(this.m_normals[x].X+this.m_normals[a].X)*F),e.ClipperOffset.Round(this.m_srcPoly[a].Y+(this.m_normals[x].Y+this.m_normals[a].Y)*F)));},e.ClipperOffset.prototype.DoRound=function(a,x){for(var A=Math.atan2(this.m_sinA,this.m_normals[x].X*this.m_normals[a].X+this.m_normals[x].Y*this.m_normals[a].Y),F=Math.max(e.Cast_Int32(e.ClipperOffset.Round(this.m_StepsPerRad*Math.abs(A))),1),j=this.m_normals[x].X,_=this.m_normals[x].Y,st,Pt=0;Pt<F;++Pt)this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[a].X+j*this.m_delta),e.ClipperOffset.Round(this.m_srcPoly[a].Y+_*this.m_delta))),st=j,j=j*this.m_cos-this.m_sin*_,_=st*this.m_sin+_*this.m_cos;this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[a].X+this.m_normals[a].X*this.m_delta),e.ClipperOffset.Round(this.m_srcPoly[a].Y+this.m_normals[a].Y*this.m_delta)));},e.Error=function(a){try{throw new Error(a);}catch(x){alert(x.message);}},e.JS={},e.JS.AreaOfPolygon=function(a,x){return x||(x=1),e.Clipper.Area(a)/(x*x);},e.JS.AreaOfPolygons=function(a,x){x||(x=1);for(var A=0,F=0;F<a.length;F++)A+=e.Clipper.Area(a[F]);return A/(x*x);},e.JS.BoundsOfPath=function(a,x){return e.JS.BoundsOfPaths([a],x);},e.JS.BoundsOfPaths=function(a,x){x||(x=1);var A=e.Clipper.GetBounds(a);return A.left/=x,A.bottom/=x,A.right/=x,A.top/=x,A;},e.JS.Clean=function(F,x){if(!(F instanceof Array))return[];var A=F[0]instanceof Array,F=e.JS.Clone(F);if(typeof x!="number"||x===null)return e.Error("Delta is not a number in Clean()."),F;if(F.length===0||F.length===1&&F[0].length===0||x<0)return F;A||(F=[F]);for(var j=F.length,_,st,Pt,xt,Dt,Ht,jt,qt=[],oe=0;oe<j;oe++)if(st=F[oe],_=st.length,_!==0){if(_<3){Pt=st,qt.push(Pt);continue;}for(Pt=st,xt=x*x,Dt=st[0],Ht=1,jt=1;jt<_;jt++)(st[jt].X-Dt.X)*(st[jt].X-Dt.X)+(st[jt].Y-Dt.Y)*(st[jt].Y-Dt.Y)<=xt||(Pt[Ht]=st[jt],Dt=st[jt],Ht++);Dt=st[Ht-1],(st[0].X-Dt.X)*(st[0].X-Dt.X)+(st[0].Y-Dt.Y)*(st[0].Y-Dt.Y)<=xt&&Ht--,Ht<_&&Pt.splice(Ht,_-Ht),Pt.length&&qt.push(Pt);}return!A&&qt.length?qt=qt[0]:!A&&qt.length===0?qt=[]:A&&qt.length===0&&(qt=[[]]),qt;},e.JS.Clone=function(a){if(!(a instanceof Array))return[];if(a.length===0)return[];if(a.length===1&&a[0].length===0)return[[]];var x=a[0]instanceof Array;x||(a=[a]);var A=a.length,F,j,_,st,Pt=new Array(A);for(j=0;j<A;j++){for(F=a[j].length,st=new Array(F),_=0;_<F;_++)st[_]={X:a[j][_].X,Y:a[j][_].Y};Pt[j]=st;}return x||(Pt=Pt[0]),Pt;},e.JS.Lighten=function(a,x){if(!(a instanceof Array))return[];if(typeof x!="number"||x===null)return e.Error("Tolerance is not a number in Lighten()."),e.JS.Clone(a);if(a.length===0||a.length===1&&a[0].length===0||x<0)return e.JS.Clone(a);var A=a[0]instanceof Array;A||(a=[a]);var F,j,_,st,Pt,xt,Dt,Ht,jt,qt,oe,me,Pe,Le,or,br,gn,as=a.length,Ho=x*x,mn=[];for(F=0;F<as;F++)if(_=a[F],xt=_.length,xt!==0){for(st=0;st<1e6;st++){for(Pt=[],xt=_.length,_[xt-1].X!==_[0].X||_[xt-1].Y!==_[0].Y?(me=1,_.push({X:_[0].X,Y:_[0].Y}),xt=_.length):me=0,oe=[],j=0;j<xt-2;j++)Dt=_[j],jt=_[j+1],Ht=_[j+2],br=Dt.X,gn=Dt.Y,Pe=Ht.X-br,Le=Ht.Y-gn,(Pe!==0||Le!==0)&&(or=((jt.X-br)*Pe+(jt.Y-gn)*Le)/(Pe*Pe+Le*Le),or>1?(br=Ht.X,gn=Ht.Y):or>0&&(br+=Pe*or,gn+=Le*or)),Pe=jt.X-br,Le=jt.Y-gn,qt=Pe*Pe+Le*Le,qt<=Ho&&(oe[j+1]=1,j++);for(Pt.push({X:_[0].X,Y:_[0].Y}),j=1;j<xt-1;j++)oe[j]||Pt.push({X:_[j].X,Y:_[j].Y});if(Pt.push({X:_[xt-1].X,Y:_[xt-1].Y}),me&&_.pop(),oe.length)_=Pt;else break;}xt=Pt.length,Pt[xt-1].X===Pt[0].X&&Pt[xt-1].Y===Pt[0].Y&&Pt.pop(),Pt.length>2&&mn.push(Pt);}return A||(mn=mn[0]),_typeof(mn)>"u"&&(mn=[]),mn;},e.JS.PerimeterOfPath=function(a,x,A){if(_typeof(a)>"u")return 0;var F=Math.sqrt,j=0,_,st,Pt=0,xt=0,Dt=0,Ht=0,jt=a.length;if(jt<2)return 0;for(x&&(a[jt]=a[0],jt++);--jt;)_=a[jt],Pt=_.X,xt=_.Y,st=a[jt-1],Dt=st.X,Ht=st.Y,j+=F((Pt-Dt)*(Pt-Dt)+(xt-Ht)*(xt-Ht));return x&&a.pop(),j/A;},e.JS.PerimeterOfPaths=function(a,x,A){A||(A=1);for(var F=0,j=0;j<a.length;j++)F+=e.JS.PerimeterOfPath(a[j],x,A);return F;},e.JS.ScaleDownPath=function(a,x){var A,F;for(x||(x=1),A=a.length;A--;)F=a[A],F.X=F.X/x,F.Y=F.Y/x;},e.JS.ScaleDownPaths=function(a,x){var A,F,j;for(x||(x=1),A=a.length;A--;)for(F=a[A].length;F--;)j=a[A][F],j.X=j.X/x,j.Y=j.Y/x;},e.JS.ScaleUpPath=function(a,x){var A,F,j=Math.round;for(x||(x=1),A=a.length;A--;)F=a[A],F.X=j(F.X*x),F.Y=j(F.Y*x);},e.JS.ScaleUpPaths=function(a,x){var A,F,j,_=Math.round;for(x||(x=1),A=a.length;A--;)for(F=a[A].length;F--;)j=a[A][F],j.X=_(j.X*x),j.Y=_(j.Y*x);},e.ExPolygons=function(){return[];},e.ExPolygon=function(){this.outer=null,this.holes=null;},e.JS.AddOuterPolyNodeToExPolygons=function(a,x){var A=new e.ExPolygon();A.outer=a.Contour();var F=a.Childs(),j=F.length;A.holes=new Array(j);var _,st,Pt,xt,Dt,Ht;for(Pt=0;Pt<j;Pt++)for(_=F[Pt],A.holes[Pt]=_.Contour(),xt=0,Dt=_.Childs(),Ht=Dt.length;xt<Ht;xt++)st=Dt[xt],e.JS.AddOuterPolyNodeToExPolygons(st,x);x.push(A);},e.JS.ExPolygonsToPaths=function(a){var x,A,F,j,_=new e.Paths();for(x=0,F=a.length;x<F;x++)for(_.push(a[x].outer),A=0,j=a[x].holes.length;A<j;A++)_.push(a[x].holes[A]);return _;},e.JS.PolyTreeToExPolygons=function(a){var x=new e.ExPolygons(),A,F,j,_;for(F=0,j=a.Childs(),_=j.length;F<_;F++)A=j[F],e.JS.AddOuterPolyNodeToExPolygons(A,x);return x;};})();})(xh);var jO=xh.exports,qr=/* @__PURE__ */Rn(jO);function Th(i,e){var t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0.01;return Math.abs(i[0]-e[0])<t&&Math.abs(i[1]-e[1])<t;}function GO(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.01;if(i.length===0)return[];var t=[[i[0][0],i[0][1]]];for(var r=1;r<i.length;r++)Th([i[r][0],i[r][1]],t[t.length-1],e)||t.push([i[r][0],i[r][1]]);return t;}function kO(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.01;if(i.length<=2)return i;var t=i[0],r=i[i.length-1];return Th(t,r,e)?i.slice(0,-1):i;}function HO(i){var e=i.reduce(function(r,n){return r+n[0];},0)/i.length,t=i.reduce(function(r,n){return r+n[1];},0)/i.length;return[e,t];}function vu(i,e){return Math.atan2(e[1]-i[1],e[0]-i[0]);}function VO(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.01;if(i.length<=2)return i;var t=[];var _iterator14=_createForOfIteratorHelper(i),_step14;try{var _loop3=function _loop3(){var n=_step14.value;t.some(function(c){return Math.abs(c[0]-n[0])<e&&Math.abs(c[1]-n[1])<e;})||t.push([n[0],n[1]]);};for(_iterator14.s();!(_step14=_iterator14.n()).done;){_loop3();}}catch(err){_iterator14.e(err);}finally{_iterator14.f();}var r=HO(t);return t.sort(function(n,s){var c=vu(r,n),l=vu(r,s);return c-l;});}function KO(i,e){var t=e[0].x<e[e.length-1].x;return i.map(function(n){var c=n.map(function(l){var f=-1,u=1/0,v=0;for(var h=0;h<e.length;h++){var y=e[h],T=Math.sqrt(Math.pow(y.x-l[0],2)+Math.pow(y.y-l[1],2));T<u&&(u=T,f=h,v=y.z);}return{point:l,index:f,bestZ:v};}).sort(function(l,f){return l.index-f.index;}).map(function(l){return[].concat(_toConsumableArray(l.point),[l.bestZ]);});return t&&c[0][0]>c[c.length-1][0]||!t&&c[0][0]<c[c.length-1][0]?c.reverse():c;}).sort(function(n,s){var c=n[0][0],l=s[0][0];return t?c-l:l-c;});}function ZO(i,e){var t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0.01;var n=i.map(function(h){return[h.x,h.y];}),s=function s(h,y){return h.map(function(_ref164){var _ref165=_slicedToArray(_ref164,2),T=_ref165[0],O=_ref165[1];return{X:Math.round(T*y),Y:Math.round(O*y)};});},c=new qr.ClipperOffset();c.AddPath(s(n,1e3),qr.JoinType.jtRound,qr.EndType.etOpenButt);var l=[];c.Execute(l,1);var f=new qr.Clipper();f.AddPaths(l,qr.PolyType.ptSubject,!0),e.forEach(function(h){f.AddPath(s(h,1e3),qr.PolyType.ptClip,!0);});var u=new qr.Paths();f.Execute(qr.ClipType.ctDifference,u,qr.PolyFillType.pftNonZero,qr.PolyFillType.pftNonZero);var v=u.map(function(h){return kO(VO(GO(h.map(function(y){return[y.X/1e3,y.Y/1e3];}),t),t),t);}).filter(function(h){return h.length>=2;});return KO(v,i);}var Ch=/*#__PURE__*/function(_$t){function Ch(t){var _this59;_classCallCheck(this,Ch);_this59=_callSuper(this,Ch,[t]);dt(_this59,"canRotate",!0);dt(_this59,"scaleType",Ce.all);dt(_this59,"toolsType",Tt.Pencil);dt(_this59,"syncTimestamp");dt(_this59,"syncIndex",0);dt(_this59,"tmpPoints",[]);dt(_this59,"MAX_REPEAR",10);/** 合并原始点的灵敏度 */dt(_this59,"uniThickness");dt(_this59,"workOptions");dt(_this59,"centerPos",[0,0]);_this59.workOptions=t.toolsOpt,_this59.uniThickness=_this59.MAX_REPEAR/_this59.workOptions.thickness/10,_this59.syncTimestamp=0;return _this59;}/** 批量合并消费本地数据,返回绘制结果 */_inherits(Ch,_$t);return _createClass(Ch,[{key:"combineConsume",value:function combineConsume(){var l;var t=(l=this.workId)==null?void 0:l.toString();if(this.tmpPoints.length<2)return{type:vt.None};var r=this.transformDataAll(!0),n={name:t};var s;var c=this.drawLayer||this.fullLayer;return r.length&&(s=this.draw({attrs:n,tasks:r,replaceId:t,layer:c})),{rect:s,type:vt.DrawWork,dataType:Kt.Local};}},{key:"setWorkOptions",value:function setWorkOptions(t){_superPropGet(Ch,"setWorkOptions",this,3)([t]),this.syncTimestamp=Date.now();}},{key:"consume",value:function consume(t){var _this60=this;var r=t.data,n=t.isFullWork,s=t.isSubWorker,c=t.isMainThread,l=t.drawCount,f=t.removeDrawCount,u=t.isSimpleWorker,v=r.workId,h=r.syncUnitTime;h&&(this.syncUnitTime=h);var _this$transformData=this.transformData(r,!1),y=_this$transformData.tasks,T=_this$transformData.effects,O=_this$transformData.consumeIndex;this.syncIndex=Math.min(this.syncIndex,O,Math.max(0,this.tmpPoints.length-2));var I={name:v,id:_e(l)&&l.toString()||void 0};var P,w=!1;var d=this.syncIndex;if(this.syncTimestamp===0&&(this.syncTimestamp=Date.now()),y.length&&(y[0].taskId-this.syncTimestamp>this.syncUnitTime&&(w=!0,this.syncTimestamp=y[0].taskId,this.syncIndex=this.tmpPoints.length),s||c||u)){var S=n?this.fullLayer:this.drawLayer||this.fullLayer;P=this.draw({attrs:I,tasks:y,effects:T,layer:S,removeDrawCount:f});}if(u){var _S11=[];this.tmpPoints.slice(d).forEach(function(R){_S11.push(R.x,R.y,_this60.computRadius(R.z,_this60.workOptions.thickness));});var E=!this.workOptions.previewLocalOnly&&w;return _objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:vt.DrawWork,dataType:Kt.Local,op:E?_S11:void 0,index:E?d*3:void 0,rect:P,updateNodeOpt:{useAnimation:!0}});}if(s)return O>10&&this.tmpPoints.splice(0,O-10),{rect:P,type:vt.DrawWork,dataType:Kt.Local};var m=[];this.tmpPoints.slice(d).forEach(function(S){m.push(S.x,S.y,_this60.computRadius(S.z,_this60.workOptions.thickness));});var p=!this.workOptions.previewLocalOnly&&w;return _objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:vt.DrawWork,dataType:Kt.Local,rect:P,op:p?m:void 0,index:p?d*3:void 0,updateNodeOpt:{useAnimation:!0}});}},{key:"consumeAll",value:function consumeAll(t){var v;var r=this.workId;if(t.data){var _t$data=t.data,h=_t$data.op,y=_t$data.workState;h!=null&&h.length&&y===te.Done&&this.workOptions.strokeType===Ae.Stroke&&this.updateTempPointsWithPressureWhenDone(h);}var n=this.transformDataAll(!0),s={name:r};var c;var l=this.fullLayer;if(n.length&&(c=this.draw({attrs:s,tasks:n,replaceId:r,layer:l})),this.tmpPoints.length<2)return this.replace(l,r),{type:vt.RemoveNode,removeIds:[r],rect:c};var f=[];this.tmpPoints.map(function(h){f.push(h.x,h.y,h.z);}),this.syncTimestamp=0,delete this.workOptions.syncUnitTime;var u=mr(f);return(v=this.vNodes)==null||v.setInfo(r,{rect:c,op:f,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:c&&$t.getCenterPos(c,l)}),_objectSpread(_objectSpread({},this.baseConsumeResult),{},{rect:c,type:vt.FullWork,dataType:Kt.Local,ops:u,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(t){var h,y;var r=t.op,n=t.isFullWork,s=t.replaceId,_t$workState=t.workState,c=_t$workState===void 0?te.Done:_t$workState;this.tmpPoints.length=0;for(var T=0;T<r.length;T+=3){var O=new Jt(r[T],r[T+1],r[T+2]);if(this.tmpPoints.length>0){var I=this.tmpPoints[this.tmpPoints.length-1],P=pt.Sub(O,I).uni();O.setv(P);}this.tmpPoints.push(O);}if(this.tmpPoints.length<2)return;var l=this.transformDataAll(!0),f=(h=this.workId)==null?void 0:h.toString(),u={name:f};var v;if(f&&l.length){var _T9=n?this.fullLayer:this.drawLayer||this.fullLayer;v=this.draw({attrs:u,tasks:l,replaceId:s,layer:_T9,isDrawEraserlines:c===te.Done}),(y=this.vNodes)==null||y.setInfo(f,{rect:v,op:r,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:v&&$t.getCenterPos(v,_T9)});}return v;}},{key:"computPencilPoints",value:function computPencilPoints(t){var _this61=this;var r=[],n=t.op,s=t.eraserPolylines,c=t.eraserThickness;this.tmpPoints.length=0;for(var f=0;f<n.length;f+=3){var u=new Jt(n[f],n[f+1],n[f+2]);if(this.tmpPoints.length>0){var v=this.tmpPoints[this.tmpPoints.length-1],h=pt.Sub(u,v).uni();u.setv(h);}this.tmpPoints.push(u);}if(this.tmpPoints.length<2)return;var l=this.transformDataAll(!0);if(l.length){var _loop4=function _loop4(){var _l$_f=l[_f5],u=_l$_f.pos,v=_l$_f.points,h=v.map(function(O){return O.point.addXY(u[0],u[1]);}),y=[];var _iterator15=_createForOfIteratorHelper(s),_step15;try{for(_iterator15.s();!(_step15=_iterator15.n()).done;){var O=_step15.value;var I=[];for(var _w29=0;_w29<O.length;_w29+=2){var _d29=new Jt(O[_w29],O[_w29+1]);if(I.length>0){var m=I[I.length-1].point,p=pt.Sub(_d29,m).uni();_d29.setv(p);}I.push({point:_d29,radius:c});}var _this61$computStroke=_this61.computStroke(I,!1),P=_this61$computStroke.ps;y.push(P.map(function(w){return w.XY;}));}}catch(err){_iterator15.e(err);}finally{_iterator15.f();}ZO(h,y,0.01).forEach(function(O){r.push(O.map(function(I){return[I[0],I[1],I[2]];}).flat(1));});};for(var _f5=0;_f5<l.length;_f5++){_loop4();}}return r;}},{key:"transformDataAll",value:function transformDataAll(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;return this.getTaskPoints(this.tmpPoints,t&&this.workOptions.thickness||void 0);}},{key:"draw",value:function draw(t){var _this62=this;var r=t.attrs,n=t.tasks,s=t.replaceId,c=t.effects,l=t.layer,f=t.removeDrawCount,_t$isDrawEraserlines=t.isDrawEraserlines,u=_t$isDrawEraserlines===void 0?!0:_t$isDrawEraserlines,_this$workOptions=this.workOptions,v=_this$workOptions.strokeColor,h=_this$workOptions.strokeType,y=_this$workOptions.thickness,T=_this$workOptions.zIndex,O=_this$workOptions.scale,I=_this$workOptions.rotate,P=_this$workOptions.translate,w=_this$workOptions.eraserlines,d=_this$workOptions.lineCap,m=_this$workOptions.lineDash;c!=null&&c.size&&(c.forEach(function(U){var M;(M=l.getElementById(U+""))==null||M.remove();}),c.clear()),f&&this.removeDrawCountNodes(l,f);var p;var S=[],E=l.worldPosition,R=l.worldScaling;for(var U=0;U<n.length;U++){var _n$U=n[U],M=_n$U.pos,W=_n$U.points,_this$computDrawPoint=this.computDrawPoints(W),$=_this$computDrawPoint.ps,B=_this$computDrawPoint.rect;var N=void 0;var z=W.length===1;h===Ae.Stroke||z?N=Mn($,!0):N=Mn($,!1);var J={pos:M,d:N,fillColor:h===Ae.Stroke||z?v:void 0,lineDash:z?void 0:h===Ae.Dotted?[m&&m[0]||1,(m&&m[1]||2)*y]:h===Ae.LongDotted?[(m&&m[0]||1)*y,(m&&m[1]||2)*y]:void 0,strokeColor:v,lineCap:z?void 0:d,lineWidth:h===Ae.Stroke||z?0:y};p=Zt(p,{x:Math.floor((B.x+M[0])*R[0]+E[0]-$t.SafeBorderPadding),y:Math.floor((B.y+M[1])*R[1]+E[1]-$t.SafeBorderPadding),w:Math.floor(B.w*R[0]+2*$t.SafeBorderPadding),h:Math.floor(B.h*R[1]+2*$t.SafeBorderPadding)}),S.push(J);}O&&(r.scale=O),I&&(r.rotate=I),P&&(r.translate=P);var D=new cr();if(p){this.centerPos=$t.getCenterPos(p,l);var _U0=h===Ae.Stroke&&!w;D.attr(_objectSpread(_objectSpread({},r),{},{normalize:!0,anchor:[0.5,0.5],bgcolor:_U0?v:void 0,pos:this.centerPos,size:[(p.w-2*$t.SafeBorderPadding)/R[0],(p.h-2*$t.SafeBorderPadding)/R[1]],zIndex:T}));var _M9=S.map(function(W){return W.pos=[W.pos[0]-_this62.centerPos[0],W.pos[1]-_this62.centerPos[1]],new Ln(W);});D.append.apply(D,_toConsumableArray(_M9)),_U0&&D.seal(),w&&(this.scaleType=Ce.proportional,this.drawEraserlines({group:D,eraserlines:w,pos:this.centerPos,layer:l},u)),this.replace(l,s,D);}if(O||I||P){var _U1=D==null?void 0:D.getBoundingClientRect();_U1&&(p={x:Math.floor(_U1.x-$t.SafeBorderPadding),y:Math.floor(_U1.y-$t.SafeBorderPadding),w:Math.floor(_U1.width+$t.SafeBorderPadding*2),h:Math.floor(_U1.height+$t.SafeBorderPadding*2)});}return this.isDelete&&D.setAttribute("opacity",0),p;}},{key:"computDrawPoints",value:function computDrawPoints(t){return this.workOptions.strokeType===Ae.Stroke||t.length===1?this.computStroke(t):this.computNomal(t);}},{key:"computNomal",value:function computNomal(t){var r=this.workOptions.thickness;var n=t.map(function(s){return r=Math.max(r,s.radius),s.point;});return{ps:n,rect:De(n,r)};}},{key:"computStroke",value:function computStroke(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;return t.length===1?this.computDotStroke(t[0]):this.computLineStroke(t,r);}},{key:"computLineStroke",value:function computLineStroke(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var n=[],s=[];for(var f=0;f<t.length;f++){var _t$f=t[f],u=_t$f.point,v=_t$f.radius;var h=u.v;f===0&&t.length>1&&(h=t[f+1].point.v);var y=pt.Per(h).mul(v);n.push(Jt.Sub(u,y)),s.push(Jt.Add(u,y));}var c=t[t.length-1];if(r){var _f6=Jt.GetSemicircleStroke(c.point,n[n.length-1],-1,8),_u4=Jt.GetSemicircleStroke(t[0].point,s[0],-1,8),_v7=n.concat(_f6,s.reverse(),_u4);return{ps:_v7,rect:De(_v7)};}var l=n.concat(s.reverse());return{ps:l,rect:De(l)};}},{key:"computDotStroke",value:function computDotStroke(t){var r=t.point,n=t.radius,s={x:r.x-n,y:r.y-n,w:n*2,h:n*2};return{ps:Jt.GetDotStroke(r,n,8),rect:s};}},{key:"transformData",value:function transformData(t,r){var n=t.op,s=t.workState;var c=this.tmpPoints.length-1,l=[];if(n!=null&&n.length&&s){var _this$workOptions2=this.workOptions,f=_this$workOptions2.strokeType,u=_this$workOptions2.thickness,v=/* @__PURE__ */new Set();c=f===Ae.Stroke?this.updateTempPointsWithPressure(n,u,v):this.updateTempPoints(n,u,v);var h=r?this.tmpPoints:this.tmpPoints.slice(c);return l=this.getTaskPoints(h,u),{tasks:l,effects:v,consumeIndex:c};}return{tasks:l,consumeIndex:c};}/** 压力渐变公式 */},{key:"computRadius",value:function computRadius(t,r){return t*0.03*r+r*0.5;}},{key:"getMinZ",value:function getMinZ(t,r){return((r||Math.max(1,Math.floor(t*0.3)))-t*0.5)*100/t/3;}},{key:"getTaskPoints",value:function getTaskPoints(t,r){var h;var n=[];if(t.length===0)return[];var s=0,c=t[0].x,l=t[0].y,f=[c,l],u=[],v=t[0].t;for(;s<t.length;){var y=t[s],T=y.x-c,O=y.y-l,I=y.z,P=r?this.computRadius(I,r):I;if(u.push({point:new Jt(T,O,I,t[s].v),radius:P}),s>0&&s<t.length-1){var _w30=t[s].getAngleByPoints(t[s-1],t[s+1]);if(_w30<60||_w30>300){var _d30=(h=u.pop())==null?void 0:h.point.clone();_d30&&n.push({taskId:v,pos:f,points:[].concat(_toConsumableArray(u),[{point:_d30,radius:P}])}),c=t[s].x,l=t[s].y,f=[c,l];var m=y.x-c,p=y.y-l;u=[{point:new Jt(m,p,I),radius:P}],v=Date.now();}}s++;}return n.push({taskId:v,pos:f,points:u}),n;}},{key:"updateTempPointsWithPressure",value:function updateTempPointsWithPressure(t,r,n){var s=Date.now(),c=this.tmpPoints.length;var l=c;for(var u=0;u<t.length;u+=2){l=Math.min(l,c);var v=this.tmpPoints.length,h=new Jt(t[u],t[u+1]);if(v===0){this.tmpPoints.push(h);continue;}var y=v-1,T=this.tmpPoints[y],O=pt.Sub(h,T).uni();if(h.isNear(T,r)){if(T.z<this.MAX_REPEAR){if(T.setz(Math.min(T.z+1,this.MAX_REPEAR)),l=Math.min(l,y),v>1){var _w31=v-1;for(;_w31>0;){var _d31=this.tmpPoints[_w31].distance(this.tmpPoints[_w31-1]),m=Math.max(this.tmpPoints[_w31].z-this.uniThickness*_d31,0);if(this.tmpPoints[_w31-1].z>=m)break;this.tmpPoints[_w31-1].setz(m),l=Math.min(l,_w31-1),_w31--;}}}else l=1/0;continue;}h.setv(O);var I=h.distance(T),P=Math.max(T.z-this.uniThickness*I,0);v>1&&pt.Equals(O,T.v,0.02)&&(P>0||T.z<=0)&&(n&&T.t&&n.add(T.t),this.tmpPoints.pop(),l=Math.min(y,l)),h.setz(P),this.tmpPoints.push(h);}if(l===1/0)return this.tmpPoints.length;var f=c;if(l===c){f=Math.max(f-1,0);var _u5=this.tmpPoints[f].t;_u5&&(n==null||n.add(_u5));}else{var _u6=c-1;for(f=l;_u6>=0;){var _v8=this.tmpPoints[_u6].t;if(_v8&&(n==null||n.add(_v8),_u6<=l)){f=_u6,_u6=-1;break;}_u6--;}}return this.tmpPoints[f].setT(s),f;}},{key:"updateTempPoints",value:function updateTempPoints(t,r,n){var u;var s=Date.now(),c=this.tmpPoints.length;var l=c;for(var v=0;v<t.length;v+=2){var h=this.tmpPoints.length,y=new Jt(t[v],t[v+1]);if(h===0){this.tmpPoints.push(y);continue;}var T=h-1,O=this.tmpPoints[T],I=pt.Sub(y,O).uni();if(y.isNear(O,r/2)){l=Math.min(T,l);continue;}pt.Equals(I,O.v,0.02)&&(n&&O.t&&n.add(O.t),this.tmpPoints.pop(),l=Math.min(T,l)),y.setv(I),this.tmpPoints.push(y);}var f=c;if(l===c){f=Math.max(f-1,0);var _v9=this.tmpPoints[f].t;_v9&&(n==null||n.add(_v9));}else{var _v0=Math.min(c-1,l);for(f=l;_v0>=0;){var _h4=(u=this.tmpPoints[_v0])==null?void 0:u.t;if(_h4&&(n==null||n.add(_h4),_v0<=l)){f=_v0,_v0=-1;break;}_v0--;}}return this.tmpPoints[f].setT(s),f;}},{key:"updateTempPointsWithPressureWhenDone",value:function updateTempPointsWithPressureWhenDone(t){var r=this.workOptions.thickness,n=t.length,s=this.getMinZ(r);for(var c=0;c<n;c+=2){var l=this.tmpPoints.length,f=new Jt(t[c],t[c+1]);if(l===0){this.tmpPoints.push(f);continue;}var u=l-1,v=this.tmpPoints[u],h=pt.Sub(f,v).uni(),y=f.distance(v);if(l>1&&v.z===s)break;if(f.isNear(v,r/2)){if(n<3&&v.z<this.MAX_REPEAR&&(v.setz(Math.min(v.z+1,this.MAX_REPEAR)),l>1)){var O=l-1;for(;O>0;){var I=this.tmpPoints[O].distance(this.tmpPoints[O-1]),P=Math.max(this.tmpPoints[O].z-this.uniThickness*I,-r/4);if(this.tmpPoints[O-1].z>=P)break;this.tmpPoints[O-1].setz(P),O--;}}continue;}f.setv(h);var T=Math.max(v.z-this.uniThickness*y,s);l>1&&pt.Equals(h,v.v,0.02)&&v.z<=0&&this.tmpPoints.pop(),f.setz(T),this.tmpPoints.push(f);}}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var h,y;var r=t.node,n=t.opt,s=t.vNodes,c=n.strokeColor,l=n.strokeType,f=n.lineCap,u=n.lineDash,v=s.get(r.name);return c&&(r.tagName==="GROUP"?sE(r)?r.setAttribute("bgcolor",c):r.children.forEach(function(T){T.setAttribute("strokeColor",c),T.getAttribute("fillColor")&&T.setAttribute("fillColor",c);}):(r.setAttribute("strokeColor",c),r.setAttribute("fillColor",c)),(h=v==null?void 0:v.opt)!=null&&h.strokeColor&&(v.opt.strokeColor=c)),l&&v!=null&&v.opt&&(y=v.opt)!=null&&y.strokeType&&(v.opt.strokeType=l),f&&v!=null&&v.opt&&(v.opt.lineCap=f),u&&v!=null&&v.opt&&(v.opt.lineDash=u),v&&s.setInfo(r.name,v),$t.updateNodeOpt(t);}}]);}($t);var Ih=/*#__PURE__*/function(_$t2){function Ih(t){var _this63;_classCallCheck(this,Ih);_this63=_callSuper(this,Ih,[t]);dt(_this63,"toolsType",Tt.LaserPen);dt(_this63,"canRotate",!1);dt(_this63,"scaleType",Ce.none);dt(_this63,"syncTimestamp");dt(_this63,"syncIndex",0);dt(_this63,"tmpPoints",[]);dt(_this63,"workOptions");dt(_this63,"consumeIndex",0);_this63.workOptions=t.toolsOpt,_this63.syncTimestamp=0;return _this63;}_inherits(Ih,_$t2);return _createClass(Ih,[{key:"combineConsume",value:function combineConsume(){}},{key:"setWorkOptions",value:function setWorkOptions(t){_superPropGet(Ih,"setWorkOptions",this,3)([t]),this.syncTimestamp=Date.now();}},{key:"consume",value:function consume(t){var r=t.data,n=t.isSubWorker,s=r.workId,c=r.op,l=r.syncUnitTime;if((c==null?void 0:c.length)===0)return{type:vt.None};if(l&&(this.syncUnitTime=l),this.updateTempPoints(c||[]),this.consumeIndex>this.tmpPoints.length-4)return{type:vt.None};var _this$workOptions3=this.workOptions,f=_this$workOptions3.strokeColor,u=_this$workOptions3.thickness,v=_this$workOptions3.strokeType,h=_this$workOptions3.lineDash,y=_this$workOptions3.lineCap,T=De(this.tmpPoints,u);var O=!1;var I=this.syncIndex,P=this.tmpPoints.slice(this.consumeIndex);this.consumeIndex=this.tmpPoints.length-1,this.syncTimestamp===0&&(this.syncTimestamp=Date.now());var w={name:s==null?void 0:s.toString(),opacity:1,lineDash:v===Ae.Dotted?[h&&h[0]||1,(h&&h[1]||2)*u]:v===Ae.LongDotted?[(h&&h[0]||1)*u,(h&&h[1]||2)*u]:void 0,strokeColor:f,lineCap:y,lineWidth:u,anchor:[0.5,0.5]},d=this.getTaskPoints(P);if(d.length){var p=Date.now();p-this.syncTimestamp>this.syncUnitTime&&(O=!0,this.syncTimestamp=p,this.syncIndex=this.tmpPoints.length),n&&this.draw({attrs:w,tasks:d,isDot:!1,layer:this.drawLayer||this.fullLayer});}var m=[];return this.tmpPoints.slice(I).forEach(function(p){m.push(p.x,p.y);}),_objectSpread({rect:{x:T.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:T.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:T.w*this.fullLayer.worldScaling[0],h:T.h*this.fullLayer.worldScaling[1]},type:vt.DrawWork,dataType:Kt.Local,op:O?m:void 0,index:O?I*2:void 0},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var c;var t=(c=this.workId)==null?void 0:c.toString();var r;if(this.tmpPoints.length-1>this.consumeIndex){var l=this.tmpPoints.slice(this.consumeIndex);var f=l.length===1,_this$workOptions4=this.workOptions,u=_this$workOptions4.strokeColor,v=_this$workOptions4.thickness,h=_this$workOptions4.strokeType;if(f){var O=this.computDotStroke({point:l[0],radius:v/2});l=O.ps,r=O.rect;}else r=De(this.tmpPoints,v);var y={name:t==null?void 0:t.toString(),fillColor:f?u:void 0,opacity:1,lineDash:h===Ae.Dotted&&!f?[1,v*2]:h===Ae.LongDotted&&!f?[v,v*2]:void 0,strokeColor:u,lineCap:f?void 0:"round",lineWidth:f?0:v,anchor:[0.5,0.5]},T=this.getTaskPoints(l);T.length&&this.draw({attrs:y,tasks:T,isDot:f,layer:this.drawLayer||this.fullLayer});}var n=[];this.tmpPoints.forEach(function(l){n.push(l.x,l.y);});var s=mr(n);return _objectSpread({rect:r&&{x:r.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:r.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:r.w*this.fullLayer.worldScaling[0],h:r.h*this.fullLayer.worldScaling[1]},type:vt.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(t){var I;var r=t.op,n=t.replaceId,s=t.isFullWork,_this$workOptions5=this.workOptions,c=_this$workOptions5.strokeColor,l=_this$workOptions5.thickness,f=_this$workOptions5.strokeType;if(!r.length){var P=De(this.tmpPoints,l);return{x:P.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:P.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:P.w*this.fullLayer.worldScaling[0],h:P.h*this.fullLayer.worldScaling[1]};}var u=Math.max(0,this.tmpPoints.length-1);this.updateTempPoints(r||[]);var v,h=this.tmpPoints.slice(u);var y=h.length===1;if(y){var _P7=this.computDotStroke({point:h[0],radius:l/2});h=_P7.ps,v=_P7.rect;}else v=De(this.tmpPoints,l);var T={name:(I=this.workId)==null?void 0:I.toString(),fillColor:y?c:void 0,opacity:1,lineDash:f===Ae.Dotted&&!y?[1,l*2]:f===Ae.LongDotted&&!y?[l,l*2]:void 0,strokeColor:c,lineCap:y?void 0:"round",lineWidth:y?0:l,anchor:[0.5,0.5]},O=this.getTaskPoints(h);if(O.length){var _P8=s?this.fullLayer:this.drawLayer||this.fullLayer;this.draw({attrs:T,tasks:O,isDot:y,replaceId:n,layer:_P8});}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(t){var r=t.point,n=t.radius,s={x:r.x-n,y:r.y-n,w:n*2,h:n*2};return{ps:Jt.GetDotStroke(r,n,8),rect:s};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=this.tmpPoints.length;for(var n=0;n<t.length;n+=2){if(r){var s=this.tmpPoints.slice(-1)[0];s&&s.x===t[n]&&s.y===t[n+1]&&this.tmpPoints.pop();}this.tmpPoints.push(new Jt(t[n],t[n+1]));}}},{key:"draw",value:function(){var _draw2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee19(t){var r,n,s,c,l,_iterator16,_step16,_loop5,_t19;return _regenerator().w(function(_context21){while(1)switch(_context21.p=_context21.n){case 0:r=t.attrs,n=t.tasks,s=t.isDot,c=t.layer,l=this.workOptions.duration;_iterator16=_createForOfIteratorHelper(n);_context21.p=1;_loop5=/*#__PURE__*/_regenerator().m(function _loop5(){var f,u,v,h,y;return _regenerator().w(function(_context20){while(1)switch(_context20.n){case 0:f=_step16.value;u=new Ln(),v=f.pos,h=f.points;s?y=Mn(h,!0):y=Mn(h,!1),u.attr(_objectSpread(_objectSpread({},r),{},{pos:v,d:y})),c.appendChild(u),u.transition(l).attr({scale:s?[0.1,0.1]:[1,1],lineWidth:s?0:1}).then(function(){u.remove();});case 1:return _context20.a(2);}},_loop5);});_iterator16.s();case 2:if((_step16=_iterator16.n()).done){_context21.n=4;break;}return _context21.d(_regeneratorValues(_loop5()),3);case 3:_context21.n=2;break;case 4:_context21.n=6;break;case 5:_context21.p=5;_t19=_context21.v;_iterator16.e(_t19);case 6:_context21.p=6;_iterator16.f();return _context21.f(6);case 7:return _context21.a(2);}},_callee19,this,[[1,5,6,7]]);}));function draw(_x27){return _draw2.apply(this,arguments);}return draw;}()},{key:"getTaskPoints",value:function getTaskPoints(t){var u;var r=[];if(t.length===0)return[];var n=0,s=t[0].x,c=t[0].y,l=[s,c],f=[];for(;n<t.length;){var v=t[n],h=v.x-s,y=v.y-c;if(f.push(new Jt(h,y)),n>0&&n<t.length-1){var T=t[n].getAngleByPoints(t[n-1],t[n+1]);if(T<60||T>300){var O=(u=f.pop())==null?void 0:u.clone();O&&r.push({pos:l,points:[].concat(_toConsumableArray(f),[O])}),s=t[n].x,c=t[n].y,l=[s,c];var I=v.x-s,P=v.y-c;f=[new Jt(I,P)];}}n++;}return r.push({pos:l,points:f}),r;}},{key:"removeLocal",value:function removeLocal(){}},{key:"removeService",value:function removeService(t){var r;var n=[];return this.fullLayer.getElementsByName(t).forEach(function(s){if(s.name===t){var c=s.getBoundingClientRect();r=Zt(r,{x:c.x,y:c.y,w:c.width,h:c.height}),n.push(s);}}),n.length&&n.forEach(function(s){return s.remove();}),r;}}]);}($t);var JO=ro;ro.polyline=ro;ro.polygon=QO;function ro(i,e,t){var r=i.length,n=ui(i[0],e),s=[],c,l,f,u,v;for(t||(t=[]),c=1;c<r;c++){for(l=i[c-1],f=i[c],u=v=ui(f,e);;)if(n|u){if(n&u)break;n?(l=ul(l,f,n,e),n=ui(l,e)):(f=ul(l,f,u,e),u=ui(f,e));}else{s.push(l),u!==v?(s.push(f),c<r-1&&(t.push(s),s=[])):c===r-1&&s.push(f);break;}n=v;}return s.length&&t.push(s),t;}function QO(i,e){var t,r,n,s,c,l,f;for(r=1;r<=8;r*=2){for(t=[],n=i[i.length-1],s=!(ui(n,e)&r),c=0;c<i.length;c++)l=i[c],f=!(ui(l,e)&r),f!==s&&t.push(ul(n,l,r,e)),f&&t.push(l),n=l,s=f;if(i=t,!i.length)break;}return t;}function ul(i,e,t,r){return t&8?[i[0]+(e[0]-i[0])*(r[3]-i[1])/(e[1]-i[1]),r[3]]:// top
|
|
404
|
+
t&4?[i[0]+(e[0]-i[0])*(r[1]-i[1])/(e[1]-i[1]),r[1]]:// bottom
|
|
405
|
+
t&2?[r[2],i[1]+(e[1]-i[1])*(r[2]-i[0])/(e[0]-i[0])]:// right
|
|
406
|
+
t&1?[r[0],i[1]+(e[1]-i[1])*(r[0]-i[0])/(e[0]-i[0])]:// left
|
|
407
|
+
null;}function ui(i,e){var t=0;return i[0]<e[0]?t|=1:i[0]>e[2]&&(t|=2),i[1]<e[1]?t|=4:i[1]>e[3]&&(t|=8),t;}var Ol=/* @__PURE__ */Rn(JO);var di=/*#__PURE__*/function(_$t3){function di(t,r){var _this64;_classCallCheck(this,di);_this64=_callSuper(this,di,[t]);dt(_this64,"canRotate",!1);dt(_this64,"scaleType",Ce.none);dt(_this64,"toolsType",Tt.Eraser);dt(_this64,"serviceWork");dt(_this64,"tmpPoints",[]);dt(_this64,"workOptions");dt(_this64,"worldPosition");dt(_this64,"worldScaling");dt(_this64,"eraserRect");dt(_this64,"eraserPolyline");_this64.serviceWork=r,_this64.workOptions=t.toolsOpt,_this64.worldPosition=_this64.fullLayer.worldPosition,_this64.worldScaling=_this64.fullLayer.worldScaling;return _this64;}_inherits(di,_$t3);return _createClass(di,[{key:"combineConsume",value:function combineConsume(){}},{key:"consumeService",value:function consumeService(){}},{key:"setWorkOptions",value:function setWorkOptions(t){_superPropGet(di,"setWorkOptions",this,3)([t]);}},{key:"createEraserRect",value:function createEraserRect(t){var r=t[0]*this.worldScaling[0]+this.worldPosition[0],n=t[1]*this.worldScaling[1]+this.worldPosition[1],_di$eraserSizes$this$=di.eraserSizes[this.workOptions.thickness],s=_di$eraserSizes$this$.width,c=_di$eraserSizes$this$.height;this.eraserRect={x:r-s*0.5,y:n-c*0.5,w:s,h:c},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 t=this.tmpPoints.slice(-2);if(this.tmpPoints.length===4){var r=new pt(this.tmpPoints[0],this.tmpPoints[1]),n=new pt(this.tmpPoints[2],this.tmpPoints[3]),s=pt.Sub(n,r).uni(),c=pt.Dist(r,n),_di$eraserSizes$this$2=di.eraserSizes[this.workOptions.thickness],l=_di$eraserSizes$this$2.width,f=_di$eraserSizes$this$2.height,u=Math.min(l,f),v=Math.round(c/u);if(v>1){var h=[];for(var y=0;y<v;y++){var T=pt.Mul(s,y*u);h.push(this.tmpPoints[0]+T.x,this.tmpPoints[1]+T.y);}return h.concat(t);}}return t;}},{key:"isNear",value:function isNear(t,r){var n=new pt(t[0],t[1]),s=new pt(r[0],r[1]),_di$eraserSizes$this$3=di.eraserSizes[this.workOptions.thickness],c=_di$eraserSizes$this$3.width,l=_di$eraserSizes$this$3.height;return pt.Dist(n,s)<Math.hypot(c,l)*0.5;}},{key:"remove",value:function remove(t){var _this65=this;var r=t.curNodeMap,n=t.removeIds;var s;var _iterator17=_createForOfIteratorHelper(r.values()),_step17;try{for(_iterator17.s();!(_step17=_iterator17.n()).done;){var c=_step17.value;if(c.rect&&this.eraserRect&&this.eraserPolyline&&dl(this.eraserRect,c.rect)){var l=c.op,f=[],u=[];for(var h=0;h<l.length;h+=3){var y=new pt(l[h]*this.worldScaling[0]+this.worldPosition[0],l[h+1]*this.worldScaling[1]+this.worldPosition[1],l[h+2]);u.push(y),f.push(new Jt(y.x,y.y));}var v=f.length&&De(f)||c.rect;dl(v,this.eraserRect)&&(u.length>1?Ol.polyline(u.map(function(y){return y.XY;}),this.eraserPolyline).length&&n.add(c.name):n.add(c.name),s=Zt(s,c.rect||v));}}}catch(err){_iterator17.e(err);}finally{_iterator17.f();}return n.forEach(function(c){var f;var l=_this65.fullLayer.getElementsByName(c);l[0]&&(l[0].remove(),_vr(l[0],_this65.fullLayer.parent),(f=_this65.vNodes)==null||f["delete"](c));}),s&&(s.x-=$t.SafeBorderPadding,s.y-=$t.SafeBorderPadding,s.w+=$t.SafeBorderPadding*2,s.h+=$t.SafeBorderPadding*2),s;}},{key:"consume",value:function consume(t){var _t$data2=t.data,r=_t$data2.op,n=_t$data2.disableEraseImage,s=_t$data2.disableEraseText;if(!r||r.length===0)return _objectSpread({type:vt.None},this.baseConsumeResult);var c=this.tmpPoints.length;if(c>1&&this.isNear([r[0],r[1]],[this.tmpPoints[c-2],this.tmpPoints[c-1]]))return _objectSpread({type:vt.None},this.baseConsumeResult);c<3?this.tmpPoints.push(r[0],r[1]):this.tmpPoints.splice(2,2,r[0],r[1]);var l=this.computRectCenterPoints();var f;var u=/* @__PURE__ */new Set();if(!this.vNodes)return _objectSpread({type:vt.None},this.baseConsumeResult);var v=this.getCanEraserNodeMap(this.vNodes.getCanEraserNodes(this.vNodes.curNodeMap,{disableEraseImage:n,disableEraseText:s}));for(var h=0;h<l.length-1;h+=2){this.createEraserRect(l.slice(h,h+2));var y=this.remove({curNodeMap:v,removeIds:u});f=Zt(f,y);}return f&&u.size?{type:vt.RemoveNode,rect:f,removeIds:_toConsumableArray(u)}:_objectSpread({type:vt.None},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(t){return this.consume(t);}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}},{key:"getCanEraserNodeMap",value:function getCanEraserNodeMap(t){var r;if(this.serviceWork){var n=new Map(t),s=this.serviceWork.selectorWorkShapes,c=this.serviceWork.workShapes;var _iterator18=_createForOfIteratorHelper(s.values()),_step18;try{for(_iterator18.s();!(_step18=_iterator18.n()).done;){var l=_step18.value;if((r=l.selectIds)!=null&&r.length){var _iterator20=_createForOfIteratorHelper(l.selectIds),_step20;try{for(_iterator20.s();!(_step20=_iterator20.n()).done;){var f=_step20.value;n["delete"](f);}}catch(err){_iterator20.e(err);}finally{_iterator20.f();}}}}catch(err){_iterator18.e(err);}finally{_iterator18.f();}var _iterator19=_createForOfIteratorHelper(c.keys()),_step19;try{for(_iterator19.s();!(_step19=_iterator19.n()).done;){var _l4=_step19.value;n["delete"](_l4);}}catch(err){_iterator19.e(err);}finally{_iterator19.f();}return n;}return t;}}]);}($t);// 来源于white-sdk
|
|
408
|
+
dt(di,"eraserSizes",wl);var no=di;var qO="__lodash_hash_undefined__";function _O(i){return this.__data__.set(i,qO),this;}var t2=_O;function e2(i){return this.__data__.has(i);}var r2=e2,n2=Ku,i2=t2,s2=r2;function io(i){var e=-1,t=i==null?0:i.length;for(this.__data__=new n2();++e<t;)this.add(i[e]);}io.prototype.add=io.prototype.push=i2;io.prototype.has=s2;var Al=io;function o2(i,e){for(var t=-1,r=i==null?0:i.length;++t<r;)if(e(i[t],t,i))return!0;return!1;}var a2=o2;function l2(i,e){return i.has(e);}var El=l2,f2=Al,c2=a2,u2=El,h2=1,d2=2;function p2(i,e,t,r,n,s){var c=t&h2,l=i.length,f=e.length;if(l!=f&&!(c&&f>l))return!1;var u=s.get(i),v=s.get(e);if(u&&v)return u==e&&v==i;var h=-1,y=!0,T=t&d2?new f2():void 0;for(s.set(i,e),s.set(e,i);++h<l;){var O=i[h],I=e[h];if(r)var P=c?r(I,O,h,e,i,s):r(O,I,h,i,e,s);if(P!==void 0){if(P)continue;y=!1;break;}if(T){if(!c2(e,function(w,d){if(!u2(T,d)&&(O===w||n(O,w,t,r,s)))return T.push(d);})){y=!1;break;}}else if(!(O===I||n(O,I,t,r,s))){y=!1;break;}}return s["delete"](i),s["delete"](e),y;}var wh=p2;function v2(i){var e=-1,t=Array(i.size);return i.forEach(function(r,n){t[++e]=[n,r];}),t;}var g2=v2;function m2(i){var e=-1,t=Array(i.size);return i.forEach(function(r){t[++e]=r;}),t;}var Ml=m2,gu=Qi,mu=dh,y2=pl,P2=wh,S2=g2,x2=Ml,T2=1,C2=2,I2="[object Boolean]",w2="[object Date]",O2="[object Error]",A2="[object Map]",E2="[object Number]",M2="[object RegExp]",L2="[object Set]",R2="[object String]",b2="[object Symbol]",D2="[object ArrayBuffer]",N2="[object DataView]",yu=gu?gu.prototype:void 0,el=yu?yu.valueOf:void 0;function B2(i,e,t,r,n,s,c){switch(t){case N2:if(i.byteLength!=e.byteLength||i.byteOffset!=e.byteOffset)return!1;i=i.buffer,e=e.buffer;case D2:return!(i.byteLength!=e.byteLength||!s(new mu(i),new mu(e)));case I2:case w2:case E2:return y2(+i,+e);case O2:return i.name==e.name&&i.message==e.message;case M2:case R2:return i==e+"";case A2:var l=S2;case L2:var f=r&T2;if(l||(l=x2),i.size!=e.size&&!f)return!1;var u=c.get(i);if(u)return u==e;r|=C2,c.set(i,e);var v=P2(l(i),l(e),r,n,s,c);return c["delete"](i),v;case b2:if(el)return el.call(i)==el.call(e);}return!1;}var W2=B2,Pu=ch,F2=1,U2=Object.prototype,Y2=U2.hasOwnProperty;function $2(i,e,t,r,n,s){var c=t&F2,l=Pu(i),f=l.length,u=Pu(e),v=u.length;if(f!=v&&!c)return!1;for(var h=f;h--;){var y=l[h];if(!(c?y in e:Y2.call(e,y)))return!1;}var T=s.get(i),O=s.get(e);if(T&&O)return T==e&&O==i;var I=!0;s.set(i,e),s.set(e,i);for(var P=c;++h<f;){y=l[h];var w=i[y],d=e[y];if(r)var m=c?r(d,w,y,e,i,s):r(w,d,y,i,e,s);if(!(m===void 0?w===d||n(w,d,t,r,s):m)){I=!1;break;}P||(P=y=="constructor");}if(I&&!P){var p=i.constructor,S=e.constructor;p!=S&&"constructor"in i&&"constructor"in e&&!(typeof p=="function"&&p instanceof p&&typeof S=="function"&&S instanceof S)&&(I=!1);}return s["delete"](i),s["delete"](e),I;}var X2=$2,rl=Zu,z2=wh,j2=W2,G2=X2,Su=So,xu=_i,Tu=gl,k2=rh,H2=1,Cu="[object Arguments]",Iu="[object Array]",Hs="[object Object]",V2=Object.prototype,wu=V2.hasOwnProperty;function K2(i,e,t,r,n,s){var c=xu(i),l=xu(e),f=c?Iu:Su(i),u=l?Iu:Su(e);f=f==Cu?Hs:f,u=u==Cu?Hs:u;var v=f==Hs,h=u==Hs,y=f==u;if(y&&Tu(i)){if(!Tu(e))return!1;c=!0,v=!1;}if(y&&!v)return s||(s=new rl()),c||k2(i)?z2(i,e,t,r,n,s):j2(i,e,f,t,r,n,s);if(!(t&H2)){var T=v&&wu.call(i,"__wrapped__"),O=h&&wu.call(e,"__wrapped__");if(T||O){var I=T?i.value():i,P=O?e.value():e;return s||(s=new rl()),n(I,P,t,r,s);}}return y?(s||(s=new rl()),G2(i,e,t,r,n,s)):!1;}var Z2=K2,J2=Z2,Ou=pn;function Oh(i,e,t,r,n){return i===e?!0:i==null||e==null||!Ou(i)&&!Ou(e)?i!==i&&e!==e:J2(i,e,t,r,Oh,n);}var Q2=Oh,q2=Q2;function _2(i,e){return q2(i,e);}var tA=_2,_r=/* @__PURE__ */Rn(tA);function Au(i,e,t){var r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:1;return"rgba(".concat(i,",").concat(e,",").concat(t,",").concat(r,")");}function eA(i){var e=i.split(","),t=parseInt(e[0].split("(")[1]),r=parseInt(e[1]),n=parseInt(e[2]),s=Number(e[3].split(")")[0]);return[t,r,n,s];}var uo=/*#__PURE__*/function(_$t4){function uo(t){var _this66;_classCallCheck(this,uo);_this66=_callSuper(this,uo,[t]);dt(_this66,"toolsType",Tt.Selector);dt(_this66,"tmpPoints",[]);dt(_this66,"subTmpPoints",[]);dt(_this66,"workOptions");dt(_this66,"vNodes");dt(_this66,"selectIds");dt(_this66,"selectorColor");dt(_this66,"strokeColor");dt(_this66,"fillColor");dt(_this66,"oldSelectRect");dt(_this66,"oldSubSelectRect");dt(_this66,"canRotate",!1);dt(_this66,"canTextEdit",!1);dt(_this66,"canLock",!1);dt(_this66,"scaleType",Ce.all);dt(_this66,"toolsTypes");dt(_this66,"shapeOpt");dt(_this66,"textOpt");dt(_this66,"isLocked");dt(_this66,"thickness");dt(_this66,"strokeType");dt(_this66,"useStroke");_this66.workOptions=t.toolsOpt,_this66.vNodes=t.vNodes;return _this66;}_inherits(uo,_$t4);return _createClass(uo,[{key:"computSelector",value:function computSelector(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;var r=De(this.tmpPoints);if(r.w===0||r.h===0)return{selectIds:[],intersectRect:void 0,subNodeMap:/* @__PURE__ */new Map()};var _this$vNodes$getRectI=this.vNodes.getRectIntersectRange(r,t),n=_this$vNodes$getRectI.rectRange,s=_this$vNodes$getRectI.nodeRange;return{selectIds:_toConsumableArray(s.keys()),intersectRect:n,subNodeMap:s};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=this.tmpPoints.length,n=t.length;if(n>1){var s=new Jt(t[n-2]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],t[n-1]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[1]);r===2?this.tmpPoints.splice(1,1,s):this.tmpPoints.push(s);}}},{key:"drawSelector",value:function drawSelector(t){var _this67=this;var r=t.drawRect,n=t.subNodeMap,s=t.selectorId,c=t.layer,l=t.isService,f=new cr({pos:[r.x,r.y],anchor:[0,0],size:[r.w,r.h],id:s,name:s,zIndex:9999}),u=[];if(l){var v=new sl({normalize:!0,pos:[r.w/2,r.h/2],lineWidth:1,strokeColor:this.selectorColor||this.workOptions.strokeColor,width:r.w,height:r.h,name:uo.selectorBorderId});u.push(v);}n.forEach(function(v,h){var y=[v.rect.x+v.rect.w/2-r.x,v.rect.y+v.rect.h/2-r.y],T=new sl({normalize:!0,pos:y,lineWidth:1,strokeColor:n.size>1?_this67.selectorColor||_this67.workOptions.strokeColor:void 0,width:v.rect.w,height:v.rect.h,id:"selector-".concat(h),name:"selector-".concat(h)});u.push(T);}),u&&f.append.apply(f,u),(c==null?void 0:c.parent).appendChild(f);}},{key:"draw",value:function draw(t,r,n){var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!1;var f,u;var c=n.intersectRect,l=n.subNodeMap;(u=(f=r.parent)==null?void 0:f.getElementById(t))==null||u.remove(),c&&this.drawSelector({drawRect:c,subNodeMap:l,selectorId:t,layer:r,isService:s});}},{key:"getSelecteorInfo",value:function getSelecteorInfo(t){this.scaleType=Ce.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 r=/* @__PURE__ */new Set();var n,s=!0;var _iterator21=_createForOfIteratorHelper(t.values()),_step21;try{for(_iterator21.s();!(_step21=_iterator21.n()).done;){var c=_step21.value;var l=c.opt,f=c.canRotate,u=c.scaleType,v=c.toolsType;this.selectorColor=this.workOptions.strokeColor,l.strokeColor&&(this.strokeColor=l.strokeColor),l.fillColor&&(this.fillColor=l.fillColor),l.textOpt&&(this.textOpt=l.textOpt),l.thickness&&(this.thickness=l.thickness),v!==Tt.Pencil&&(s=!1),l.strokeType&&(this.strokeType=l.strokeType),v===Tt.SpeechBalloon&&(r.add(v),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.placement=l.placement),v===Tt.Polygon&&(r.add(v),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.vertices=l.vertices),v===Tt.Star&&(r.add(v),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.vertices=l.vertices,this.shapeOpt.innerRatio=l.innerRatio,this.shapeOpt.innerVerticeStep=l.innerVerticeStep),v===Tt.Text&&(this.textOpt=l),t.size===1&&(this.textOpt&&(this.canTextEdit=!0),this.canRotate=f,this.scaleType=u),(v===Tt.Image||v===Tt.BackgroundSVG)&&(n=c),(u===Ce.proportional&&this.scaleType!==Ce.none||u===Ce.none)&&(this.scaleType=u);}}catch(err){_iterator21.e(err);}finally{_iterator21.f();}s&&(this.useStroke=!0),r.size&&(this.toolsTypes=_toConsumableArray(r)),n&&(t.size===1?(this.canLock=!0,n.opt.locked&&(this.isLocked=!0,this.scaleType=Ce.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)):t.size>1&&!n.opt.locked&&(this.canLock=!1,this.canRotate=!1));}},{key:"getChildrenPoints",value:function getChildrenPoints(){var t,r;if(this.scaleType===Ce.both&&((t=this.selectIds)==null?void 0:t.length)===1){var n=this.selectIds[0],s=(r=this.vNodes.get(n))==null?void 0:r.op;if(s){var c=[];for(var l=0;l<s.length;l+=3)c.push([s[l],s[l+1]]);return c;}}}},{key:"consume",value:function consume(t){if(t.isSubWorker)return this.subWorkerConsume(t);var r=_objectSpread({type:vt.Select,dataType:Kt.Local},this.baseConsumeResult);if(t.isSimpleWorker){var v=this.subWorkerConsume(t);r.subRect=v.rect;}var _t$data3=t.data,n=_t$data3.op,s=_t$data3.workState;var c=this.oldSelectRect;if(s===te.Start&&(c=this.unSelectedAllIds()),!(n!=null&&n.length)||!this.vNodes.curNodeMap.size)return t.isSimpleWorker?r:{type:vt.None};this.updateTempPoints(n);var l=this.computSelector();if(this.selectIds&&_r(this.selectIds,l.selectIds))return t.isSimpleWorker?r:{type:vt.None};this.selectIds=l.selectIds;var f=l.intersectRect;this.getSelecteorInfo(l.subNodeMap),this.draw(Me,this.fullLayer,l),this.oldSelectRect=f;var u=this.getChildrenPoints();return r=_objectSpread(_objectSpread({},r),{},{rect:Zt(f,c),selectIds:l.selectIds,selectRect:f,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:u,isLocked:this.isLocked,toolsTypes:this.toolsTypes,shapeOpt:this.shapeOpt,thickness:this.thickness,useStroke:this.useStroke,strokeType:this.strokeType}),r;}},{key:"consumeAll",value:function consumeAll(){var r,n;var t=this.oldSelectRect;if(!((r=this.selectIds)!=null&&r.length)&&this.tmpPoints[0]&&this.selectSingleTool(this.tmpPoints[0].XY,Me,!1),(n=this.selectIds)!=null&&n.length&&(t=this.selectedByIds(this.selectIds)),t){var s=this.getChildrenPoints();return _objectSpread({type:vt.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{type:vt.None};}},{key:"consumeService",value:function consumeService(){}},{key:"updateTempPointsForSubWorker",value:function updateTempPointsForSubWorker(t){var r=t.slice(-2),n=new Jt(r[0],r[1]);if(this.subTmpPoints[0].isNear(n,1))return!1;if(this.subTmpPoints.length===2){if(n.isNear(this.subTmpPoints[1],1))return!1;this.subTmpPoints[1]=n;}else this.subTmpPoints.push(n);return!0;}},{key:"computDrawPoints",value:function computDrawPoints(t){var r=this.workOptions.thickness,n=[];var _iterator22=_createForOfIteratorHelper(t),_step22;try{for(_iterator22.s();!(_step22=_iterator22.n()).done;){var l=_step22.value;n.push(_construct(pt,_toConsumableArray(l)));}}catch(err){_iterator22.e(err);}finally{_iterator22.f();}var s=De(n,r),c=[s.x+s.w/2,s.y+s.h/2];return{rect:s,pos:c,points:n.map(function(l){return l.XY;}).flat(1)};}},{key:"drawForSubWorker",value:function drawForSubWorker(t){var r=t.workId,n=t.layer,s=t.ps,_this$workOptions6=this.workOptions,c=_this$workOptions6.strokeColor,l=_this$workOptions6.scale,f=_this$workOptions6.rotate,u=_this$workOptions6.translate,v=n.worldPosition,h=n.worldScaling,_this$computDrawPoint2=this.computDrawPoints(s),y=_this$computDrawPoint2.points,T=_this$computDrawPoint2.rect,O=_this$computDrawPoint2.pos,I=1/n.worldScaling[0],P=c&&eA(c)||[0,0,0,0],w={close:!0,normalize:!0,points:y,lineWidth:I,fillColor:Au(P[0],P[1],P[2],0.1),strokeColor:Au(P[0],P[1],P[2],1),lineJoin:"round",lineCap:"round"};var d={x:Math.floor(T.x*h[0]+v[0]-$t.SafeBorderPadding),y:Math.floor(T.y*h[1]+v[1]-$t.SafeBorderPadding),w:Math.floor(T.w*h[0]+2*$t.SafeBorderPadding),h:Math.floor(T.h*h[0]+2*$t.SafeBorderPadding)};var m=new cr({name:r,id:r,pos:O,anchor:[0.5,0.5],size:[T.w,T.h],scale:l,rotate:f,translate:u}),p=new dn(_objectSpread(_objectSpread({},w),{},{pos:[0,0]}));if(m.appendChild(p),this.replace(n,r,m),l||f||u){var S=m.getBoundingClientRect();d={x:Math.floor(S.x-$t.SafeBorderPadding),y:Math.floor(S.y-$t.SafeBorderPadding),w:Math.floor(S.width+2*$t.SafeBorderPadding),h:Math.floor(S.height+2*$t.SafeBorderPadding)};}return d;}},{key:"transformData",value:function transformData(t){var r=De(t);return[[r.x,r.y,0],[r.x+r.w,r.y,0],[r.x+r.w,r.y+r.h,0],[r.x,r.y+r.h,0]];}},{key:"subWorkerConsume",value:function subWorkerConsume(t){var r=t.data,n=t.isFullWork,s=r.op,c=r.syncUnitTime;c&&(this.syncUnitTime=c);var l=s==null?void 0:s.length;if(!l||l<2)return{type:vt.None,rect:void 0};var f;if(this.subTmpPoints.length===0?(this.subTmpPoints=[new Jt(s[0],s[1])],f=!1):f=this.updateTempPointsForSubWorker(s),!f)return{type:vt.None,rect:void 0};var u=this.transformData(this.subTmpPoints),v=n?this.fullLayer:this.drawLayer||this.fullLayer,h=this.drawForSubWorker({ps:u,workId:this.workId,layer:v}),y=Zt(h,this.oldSubSelectRect);return this.oldSubSelectRect=h,_objectSpread({rect:y,type:vt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);}},{key:"subWorkerConsumeAll",value:function subWorkerConsumeAll(t){var r=t.isFullWork,n=r?this.fullLayer:this.drawLayer||this.fullLayer;return this.replace(n,this.workId),_objectSpread({rect:this.oldSelectRect,type:vt.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(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Me;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;if(t.length===2){var s=t[0],c=t[1];var l;var _this$vNodes$getRectI2=this.vNodes.getRectIntersectRange({x:s,y:c,w:0,h:0},!1),f=_this$vNodes$getRectI2.nodeRange,u=_toConsumableArray(f.values()).sort(function(v,h){return(h.opt.zIndex||0)-(v.opt.zIndex||0);});var _iterator23=_createForOfIteratorHelper(u),_step23;try{for(_iterator23.s();!(_step23=_iterator23.n()).done;){var _v1=_step23.value;var _h5=this.fullLayer.getElementsByName(_v1.name);if(Zh(_h5).find(function(T){return T.isPointCollision(s,c);})){l=_v1;break;}}}catch(err){_iterator23.e(err);}finally{_iterator23.f();}if(l){var v=l.name;if(!_r(this.oldSelectRect,l.rect)){var h=/* @__PURE__ */new Map([[v,l]]);this.getSelecteorInfo(h),this.draw(r,this.fullLayer,{intersectRect:l.rect,subNodeMap:h,selectIds:this.selectIds||[]},n);}this.selectIds=[v],this.oldSelectRect=l.rect;}}}},{key:"unSelectedAllIds",value:function unSelectedAllIds(){var t;var _iterator24=_createForOfIteratorHelper(this.vNodes.curNodeMap.entries()),_step24;try{for(_iterator24.s();!(_step24=_iterator24.n()).done;){var _step24$value=_slicedToArray(_step24.value,2),r=_step24$value[0],n=_step24$value[1];n.isSelected&&(t=Zt(t,n.rect),this.vNodes.unSelected(r));}}catch(err){_iterator24.e(err);}finally{_iterator24.f();}return t;}},{key:"unSelectedByIds",value:function unSelectedByIds(t){var r;var _iterator25=_createForOfIteratorHelper(t),_step25;try{for(_iterator25.s();!(_step25=_iterator25.n()).done;){var n=_step25.value;var s=this.vNodes.get(n);s&&s.isSelected&&(r=Zt(r,s.rect),this.vNodes.unSelected(n));}}catch(err){_iterator25.e(err);}finally{_iterator25.f();}return r;}},{key:"selectedByIds",value:function selectedByIds(t){var r;var _iterator26=_createForOfIteratorHelper(t),_step26;try{for(_iterator26.s();!(_step26=_iterator26.n()).done;){var n=_step26.value;var s=this.vNodes.get(n);s&&(r=Zt(r,s.rect),this.vNodes.selected(n));}}catch(err){_iterator26.e(err);}finally{_iterator26.f();}return r;}},{key:"getSelectorRect",value:function getSelectorRect(t,r){var l;var n;var s=(l=t.parent)==null?void 0:l.getElementById(r),c=s==null?void 0:s.getBoundingClientRect();return c&&(n=Zt(n,{x:Math.floor(c.x),y:Math.floor(c.y),w:Math.floor(c.width+1),h:Math.floor(c.height+1)})),n;}},{key:"isCanFillColor",value:function isCanFillColor(t){return t===Tt.Ellipse||t===Tt.Triangle||t===Tt.Rectangle||t===Tt.Polygon||t===Tt.Star||t===Tt.SpeechBalloon;}},{key:"updateSelector",value:function(){var _updateSelector=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee20(t){var r,n,s,c,l,f,u,v,h,y,T,O,I,P,w,d,_iterator27,_step27,S,E,R,D,U,M,W,$,B,N,z,m,_S12,_E9,_R4,p,_t20,_t21,_t22;return _regenerator().w(function(_context22){while(1)switch(_context22.p=_context22.n){case 0:r=t.updateSelectorOpt,n=t.selectIds,s=t.vNodes,c=t.willSerializeData,l=t.worker,f=t.offset,u=this.fullLayer;if(u){_context22.n=1;break;}return _context22.a(2);case 1:h=/* @__PURE__ */new Map(),y=r.originPoint,T=r.workState,O=r.angle,I=r.translate,P=r.dir,w=r.scale;f&&(I?r.translate=[I[0]+f[0],I[1]+f[1]]:r.translate=f);if(!(y||I||_e(O))){_context22.n=3;break;}if(!(T===te.Start&&n)){_context22.n=2;break;}return _context22.a(2,(s.setTargetAssignKeys(n),{type:vt.Select,dataType:Kt.Local,selectRect:this.oldSelectRect,rect:this.oldSelectRect}));case 2:if(!(d=s.getLastTarget(),!d)){_context22.n=3;break;}return _context22.a(2);case 3:if(!n){_context22.n=18;break;}_iterator27=_createForOfIteratorHelper(n);_context22.p=4;_iterator27.s();case 5:if((_step27=_iterator27.n()).done){_context22.n=15;break;}S=_step27.value;E=s.get(S);if(!E){_context22.n=14;break;}R=E.toolsType,D=E.opt,U=(u==null?void 0:u.getElementsByName(S))[0];if(!U){_context22.n=14;break;}M=_objectSpread({},r);W=void 0;$=$t.isWillRefresh({toolsType:R,opt:D,updateOpt:M,vNodes:s,node:U,willSerializeData:c});if(!R){_context22.n=14;break;}W=d==null?void 0:d.get(S);B=Kh(R);if(!(B==null||B.updateNodeOpt({node:U,opt:M,vNodes:s,willSerializeData:c,targetNode:W}),E&&l&&$)){_context22.n=13;break;}N=l.createWorkShapeNode({workId:S,toolsType:R,toolsOpt:E.opt});N==null||N.setWorkId(S);z=void 0;if(!(R===Tt.BackgroundSVG)){_context22.n=6;break;}z=N.consumeService({isFullWork:!0,replaceId:S});_context22.n=12;break;case 6:if(!(R===Tt.Image)){_context22.n=8;break;}_context22.n=7;return N.consumeServiceAsync({isFullWork:!0,replaceId:S,worker:l});case 7:z=_context22.v;_context22.n=12;break;case 8:if(!(R===Tt.Text)){_context22.n=10;break;}_context22.n=9;return N.consumeServiceAsync({isFullWork:!0,replaceId:S,isDrawLabel:!0});case 9:z=_context22.v;_context22.n=12;break;case 10:_context22.p=10;z=N==null?void 0:N.consumeService({op:E.op,isFullWork:!0,replaceId:S,workState:T});_context22.n=12;break;case 11:_context22.p=11;_t20=_context22.v;console.error("consumeService error",_t20);return _context22.a(3,14);case 12:z&&(E.rect=z);case 13:E&&(h.set(S,E),v=Zt(v,E.rect));case 14:_context22.n=5;break;case 15:_context22.n=17;break;case 16:_context22.p=16;_t21=_context22.v;_iterator27.e(_t21);case 17:_context22.p=17;_iterator27.f();return _context22.f(17);case 18:d&&T===te.Done&&(s.deleteLastTarget(),d=void 0);m=v;if(!(y&&I&&w&&P&&m&&!f)){_context22.n=25;break;}_S12=[[m.x,m.y],[m.x+m.w,m.y],[m.x+m.w,m.y+m.h],[m.x,m.y+m.h]];_t22=P;_context22.n=_t22==="top"?19:_t22==="topLeft"?19:_t22==="left"?19:_t22==="topRight"?20:_t22==="right"?21:_t22==="bottomRight"?21:_t22==="bottom"?21:_t22==="bottomLeft"?22:23;break;case 19:I[0]>0&&I[1]>0?_E9=_S12[0]:I[0]>0?_E9=_S12[3]:I[1]>0?_E9=_S12[1]:_E9=_S12[2];return _context22.a(3,23);case 20:I[0]<0&&I[1]>0?_E9=_S12[1]:I[0]<0?_E9=_S12[2]:I[1]>0?_E9=_S12[0]:_E9=_S12[3];return _context22.a(3,23);case 21:I[0]<0&&I[1]<0?_E9=_S12[2]:I[0]<0?_E9=_S12[1]:I[1]<0?_E9=_S12[3]:_E9=_S12[0];return _context22.a(3,23);case 22:I[0]>0&&I[1]<0?_E9=_S12[3]:I[0]>0?_E9=_S12[0]:I[1]<0?_E9=_S12[2]:_E9=_S12[1];return _context22.a(3,23);case 23:_R4=_E9&&[y[0]-_E9[0],y[1]-_E9[1]]||[0,0];if(_r(_R4,[0,0])){_context22.n=25;break;}_context22.n=24;return this.updateSelector(_objectSpread(_objectSpread({},t),{},{updateSelectorOpt:{workState:T},offset:_R4}));case 24:return _context22.a(2,_context22.v);case 25:this.getSelecteorInfo(h),this.draw(Me,u,{selectIds:n||[],subNodeMap:h,intersectRect:m});p=Zt(this.oldSelectRect,m);return _context22.a(2,(this.oldSelectRect=m,{type:vt.Select,dataType:Kt.Local,selectRect:m,renderRect:v,rect:Zt(p,m),selectIds:n}));}},_callee20,this,[[10,11],[4,16,17,18]]);}));function updateSelector(_x28){return _updateSelector.apply(this,arguments);}return updateSelector;}()},{key:"blurSelector",value:function blurSelector(){var t=this.unSelectedAllIds();return{type:vt.Select,dataType:Kt.Local,rect:t,selectIds:[],willSyncService:!0};}},{key:"getRightServiceId",value:function getRightServiceId(t){return t.replace(gi,"-");}},{key:"selectServiceNode",value:function selectServiceNode(t,r,n){var _this68=this;var s=r.selectIds,c=this.getRightServiceId(t),l=this.getSelectorRect(this.fullLayer,c);var f;var u=/* @__PURE__ */new Map();return s==null||s.forEach(function(v){var h=_this68.vNodes.get(v);h&&(f=Zt(f,h.rect),u.set(v,h));}),this.getSelecteorInfo(u),this.draw(c,this.fullLayer,{intersectRect:f,selectIds:s||[],subNodeMap:u},n),Zt(f,l);}},{key:"reRenderSelector",value:function reRenderSelector(){var _this69=this;var n;var t;var r=/* @__PURE__ */new Map();return(n=this.selectIds)==null||n.forEach(function(s){var c=_this69.vNodes.get(s);c&&(t=Zt(t,c.rect),r.set(s,c));},this),this.getSelecteorInfo(r),this.draw(Me,this.fullLayer,{intersectRect:t,subNodeMap:r,selectIds:this.selectIds||[]}),this.oldSelectRect=t,t;}},{key:"updateSelectIds",value:function updateSelectIds(t){var c;var r;var n=(c=this.selectIds)==null?void 0:c.filter(function(l){return!t.includes(l);});if(n!=null&&n.length&&(r=this.unSelectedByIds(n)),t.length){var l=this.selectedByIds(t);r=Zt(r,l);}this.selectIds=t;var s=this.reRenderSelector();return{bgRect:r,selectRect:s};}},{key:"cursorHover",value:function cursorHover(t){var c,l;var r=this.oldSelectRect;this.selectIds=[];var n=(c=this.workId)==null?void 0:c.toString(),s=[t[0]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],t[1]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[1]];if(this.selectSingleTool(s,n,!0),this.oldSelectRect&&!_r(r,this.oldSelectRect))return{type:vt.CursorHover,dataType:Kt.Local,rect:Zt(r,this.oldSelectRect),selectorColor:this.selectorColor,willSyncService:!1};if((l=this.selectIds)!=null&&l.length||(this.oldSelectRect=void 0),r&&!this.oldSelectRect)return this.cursorBlur(),{type:vt.CursorHover,dataType:Kt.Local,rect:r,selectorColor:this.selectorColor,willSyncService:!1};}},{key:"cursorBlur",value:function cursorBlur(){var r,n;this.selectIds=[];var t=(r=this.workId)==null?void 0:r.toString();((n=this.fullLayer)==null?void 0:n.parent).children.forEach(function(s){s.name===t&&s.remove();});}}]);}($t);dt(uo,"selectorBorderId","selector-border");var ki=uo;var Ah=/*#__PURE__*/function(_$t5){function Ah(t){var _this70;_classCallCheck(this,Ah);_this70=_callSuper(this,Ah,[t]);dt(_this70,"canRotate",!1);dt(_this70,"scaleType",Ce.both);dt(_this70,"toolsType",Tt.Arrow);dt(_this70,"tmpPoints",[]);dt(_this70,"workOptions");dt(_this70,"oldRect");dt(_this70,"arrowTipWidth");dt(_this70,"syncTimestamp");_this70.workOptions=t.toolsOpt,_this70.arrowTipWidth=_this70.workOptions.thickness*4,_this70.syncTimestamp=0,_this70.syncUnitTime=50;return _this70;}_inherits(Ah,_$t5);return _createClass(Ah,[{key:"consume",value:function consume(t){var r=t.data,n=t.isFullWork,s=t.isSubWorker,c=t.isMainThread,l=t.smoothSync,f=t.isSimpleWorker,u=this.workId,v=r.op,h=r.syncUnitTime;h&&(this.syncUnitTime=h);var y=v==null?void 0:v.length;if(!y||y<2)return{type:vt.None};var T;if(this.tmpPoints.length===0?(this.tmpPoints=[new Jt(v[0],v[1])],T=!1):T=this.updateTempPoints(v),!T)return{type:vt.None};var O;if(s||c||f){var P=n?this.fullLayer:this.drawLayer||this.fullLayer;O=this.draw({workId:u,layer:P});}if(f){var _P9=Zt(O,this.oldRect);this.oldRect=O;var _w32=_objectSpread({rect:_P9,type:vt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);if(l){var _d32=Date.now();_d32-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=_d32,_w32.op=this.tmpPoints.map(function(m){return[].concat(_toConsumableArray(m.XY),[0]);}).flat(1),_w32.index=0,_w32.isSync=!0);}return _w32;}if(!s&&l){var _P0=Date.now();return _P0-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_P0,_objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:vt.DrawWork,dataType:Kt.Local,op:this.tmpPoints.map(function(w){return[].concat(_toConsumableArray(w.XY),[0]);}).flat(1),isSync:!0,index:0})):{type:vt.None};}var I=Zt(O,this.oldRect);return this.oldRect=O,_objectSpread(_objectSpread({rect:I},this.baseConsumeResult),{},{type:vt.DrawWork,dataType:Kt.Local});}},{key:"consumeAll",value:function consumeAll(){var l;var t=this.workId;if(this.tmpPoints.length<2)return{type:vt.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r});this.oldRect=n;var s=this.tmpPoints.map(function(f){return[].concat(_toConsumableArray(f.XY),[0]);}).flat(1),c=mr(s);return(l=this.vNodes)==null||l.setInfo(t,{rect:n,op:s,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:$t.getCenterPos(n,r)}),_objectSpread(_objectSpread({rect:n},this.baseConsumeResult),{},{type:vt.FullWork,dataType:Kt.Local,ops:c,isSync:!0,updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(t){var r=t.workId,n=t.layer,s=t.isDrawEraserlines,_this$workOptions7=this.workOptions,c=_this$workOptions7.strokeColor,l=_this$workOptions7.thickness,f=_this$workOptions7.zIndex,u=_this$workOptions7.scale,v=_this$workOptions7.rotate,h=_this$workOptions7.translate,y=_this$workOptions7.strokeType,T=_this$workOptions7.eraserlines,O=_this$workOptions7.lineDash,I=_this$workOptions7.lineCap,P=n.worldPosition,w=n.worldScaling,_this$computDrawPoint3=this.computDrawPoints(l),d=_this$computDrawPoint3.points,m=_this$computDrawPoint3.pos,p=_this$computDrawPoint3.rect,S=_this$computDrawPoint3.isTriangle,E=_this$computDrawPoint3.trianglePoints,R=_this$computDrawPoint3.trianglePos,D=[p.x+p.w/2,p.y+p.h/2],U={pos:D,name:r,id:r,zIndex:f,anchor:[0.5,0.5],size:[p.w,p.h]};u&&(U.scale=u),v&&(U.rotate=v),h&&(U.translate=h);var M=new cr(U),W={points:E,pos:[R[0]-D[0],R[1]-D[1]],fillColor:c,strokeColor:c,lineWidth:0,normalize:!1},$=new dn(W);if(M.append($),!S&&d&&m){var N={points:d,pos:[m[0]-D[0],m[1]-D[1]],fillColor:c,strokeColor:c,lineDash:y===Ae.Dotted?[O&&O[0]||1,(O&&O[1]||2)*l]:y===Ae.LongDotted?[(O&&O[0]||1)*l,(O&&O[1]||2)*l]:void 0,lineCap:y===Ae.Normal?void 0:I,lineWidth:l,normalize:!1},z=new dn(N);M.append(z);}T&&(this.scaleType=Ce.proportional,this.drawEraserlines({group:M,eraserlines:T,pos:D,layer:n},s)),this.replace(n,r,M);var B={x:Math.floor(p.x*w[0]+P[0]-$t.SafeBorderPadding),y:Math.floor(p.y*w[1]+P[1]-$t.SafeBorderPadding),w:Math.floor(p.w*w[0]+2*$t.SafeBorderPadding),h:Math.floor(p.h*w[1]+2*$t.SafeBorderPadding)};if(u||v||h){var _N8=M.getBoundingClientRect();B={x:Math.floor(_N8.x-$t.SafeBorderPadding),y:Math.floor(_N8.y-$t.SafeBorderPadding),w:Math.floor(_N8.width+$t.SafeBorderPadding*2),h:Math.floor(_N8.height+$t.SafeBorderPadding*2)};}return this.isDelete&&M.setAttribute("opacity",0),B;}},{key:"computDrawPoints",value:function computDrawPoints(t){return this.tmpPoints[1].distance(this.tmpPoints[0])>this.arrowTipWidth?this.computFullArrowPoints(t):this.computTrianglePoints();}},{key:"computFullArrowPoints",value:function computFullArrowPoints(t){var _this71=this;var r=pt.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),n=pt.Per(r).mul(t/2),s=Jt.Sub(this.tmpPoints[0],n),c=Jt.Add(this.tmpPoints[0],n),l=pt.Mul(r,this.arrowTipWidth),f=pt.Sub(this.tmpPoints[1],l),u=Jt.Sub(f,n),v=Jt.Add(f,n),h=pt.Per(r).mul(t*1.5),y=Jt.Sub(f,h),T=Jt.Add(f,h),O=[this.tmpPoints[0],f],I=[y,this.tmpPoints[1],T],P=[s,c].concat(I,[u,v]);return{trianglePoints:I.map(function(w){return Jt.Sub(w,_this71.tmpPoints[1]).XY;}).flat(1),trianglePos:this.tmpPoints[1].XY,points:O.map(function(w){return Jt.Sub(w,_this71.tmpPoints[0]).XY;}).flat(1),rect:De(P),isTriangle:!1,pos:this.tmpPoints[0].XY};}},{key:"computTrianglePoints",value:function computTrianglePoints(){var _this72=this;var t=pt.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),r=this.tmpPoints[1].distance(this.tmpPoints[0]),n=pt.Per(t).mul(Math.floor(r*3/8)),s=Jt.Sub(this.tmpPoints[0],n),c=Jt.Add(this.tmpPoints[0],n),l=[s,this.tmpPoints[1],c];return{trianglePoints:l.map(function(f){return Jt.Sub(f,_this72.tmpPoints[1]).XY;}).flat(1),trianglePos:this.tmpPoints[1].XY,rect:De(l),isTriangle:!0};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=t.slice(-2),n=new Jt(r[0],r[1]),s=this.tmpPoints[0],c=this.workOptions.thickness;if(s.isNear(n,c))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n;}else this.tmpPoints.push(n);return!0;}},{key:"consumeService",value:function consumeService(t){var u,v;var r=t.op,n=t.isFullWork,_t$workState2=t.workState,s=_t$workState2===void 0?te.Done:_t$workState2,c=(u=this.workId)==null?void 0:u.toString();if(!c)return;this.tmpPoints.length=0;for(var h=0;h<r.length;h+=3)this.tmpPoints.push(new Jt(r[h],r[h+1],r[h+2]));var l=n?this.fullLayer:this.drawLayer||this.fullLayer,f=this.draw({workId:c,layer:l,isDrawEraserlines:s===te.Done});return this.oldRect=f,(v=this.vNodes)==null||v.setInfo(c,{rect:f,op:r,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:$t.getCenterPos(f,l)}),f;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var u,v;var r=t.node,n=t.opt,s=t.vNodes,c=n.strokeColor,l=n.strokeType,f=s.get(r.name);return c&&(r.tagName==="GROUP"?r.children.forEach(function(h){h.setAttribute("strokeColor",c),h.getAttribute("fillColor")&&h.setAttribute("fillColor",c);}):(r.setAttribute("strokeColor",c),r.setAttribute("fillColor",c)),(u=f==null?void 0:f.opt)!=null&&u.strokeColor&&(f.opt.strokeColor=c)),l&&f!=null&&f.opt&&(v=f.opt)!=null&&v.strokeType&&(f.opt.strokeType=l),f&&s.setInfo(r.name,f),$t.updateNodeOpt(t);}}]);}($t);var Eh=/*#__PURE__*/function(_$t6){function Eh(t){var _this73;_classCallCheck(this,Eh);_this73=_callSuper(this,Eh,[t]);dt(_this73,"canRotate",!1);dt(_this73,"scaleType",Ce.all);dt(_this73,"toolsType",Tt.Ellipse);dt(_this73,"tmpPoints",[]);dt(_this73,"workOptions");dt(_this73,"oldRect");dt(_this73,"syncTimestamp");_this73.workOptions=t.toolsOpt,_this73.syncTimestamp=0,_this73.syncUnitTime=50;return _this73;}_inherits(Eh,_$t6);return _createClass(Eh,[{key:"consume",value:function consume(t){var r=t.data,n=t.isFullWork,s=t.isSubWorker,c=t.isMainThread,l=t.smoothSync,f=t.isSimpleWorker,u=this.workId,v=r.op,h=r.syncUnitTime;h&&(this.syncUnitTime=h);var y=v==null?void 0:v.length;if(!y||y<2)return{type:vt.None};var T;if(this.tmpPoints.length===0?(this.tmpPoints=[new Jt(v[0],v[1])],T=!1):T=this.updateTempPoints(v),!T)return{type:vt.None};var O;if(s||c||f){var I=n?this.fullLayer:this.drawLayer||this.fullLayer;O=this.draw({workId:u,layer:I,isDrawing:!0});var P=I.parent.parent,_w33={x:0,y:0,w:Math.floor(P.width),h:Math.floor(P.height)},_d33=_objectSpread({type:vt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);if(Ji(O,_w33)!==Tr.outside){var p=Zt(O,this.oldRect);if(this.oldRect=O,_d33.rect=p,!f)return _d33;}if(f){var _p11=Date.now();return _p11-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=_p11,_d33.op=this.tmpPoints.map(function(S){return[].concat(_toConsumableArray(S.XY),[0]);}).flat(1),_d33.index=0,_d33.isSync=!0),_d33;}return{type:vt.None};}if(!s&&!c&&!f&&l){var _I4=Date.now();return _I4-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_I4,_objectSpread(_objectSpread({type:vt.DrawWork,dataType:Kt.Local},this.baseConsumeResult),{},{op:this.tmpPoints.map(function(P){return[].concat(_toConsumableArray(P.XY),[0]);}).flat(1),isSync:!0,index:0})):{type:vt.None};}return{type:vt.None};}},{key:"consumeAll",value:function consumeAll(){var l;var t=this.workId;if(this.tmpPoints.length<2)return{type:vt.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r,isDrawing:!1});this.oldRect=n;var s=this.tmpPoints.map(function(f){return[].concat(_toConsumableArray(f.XY),[0]);}).flat(1),c=mr(s);return(l=this.vNodes)==null||l.setInfo(t,{rect:n,op:s,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:n&&$t.getCenterPos(n,r)}),_objectSpread(_objectSpread({rect:n,type:vt.FullWork,dataType:Kt.Local},this.baseConsumeResult),{},{ops:c,isSync:!0,updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(t){var r=t.workId,n=t.layer,s=t.isDrawing,c=t.isDrawEraserlines,_this$workOptions8=this.workOptions,l=_this$workOptions8.strokeColor,f=_this$workOptions8.fillColor,u=_this$workOptions8.thickness,v=_this$workOptions8.zIndex,h=_this$workOptions8.scale,y=_this$workOptions8.rotate,T=_this$workOptions8.translate,O=_this$workOptions8.strokeType,I=_this$workOptions8.eraserlines,P=_this$workOptions8.lineDash,w=_this$workOptions8.lineCap,d=n.worldScaling,_this$computDrawPoint4=this.computDrawPoints(u),m=_this$computDrawPoint4.radius,p=_this$computDrawPoint4.rect,S=_this$computDrawPoint4.pos,E={closeType:"normal",radius:m,lineWidth:u,fillColor:f!=="transparent"&&f||void 0,strokeColor:l,normalize:!0,lineCap:w,lineDash:O===Ae.Dotted?[P&&P[0]||1,(P&&P[1]||2)*u]:O===Ae.LongDotted?[(P&&P[0]||1)*u,(P&&P[1]||2)*u]:void 0},R={name:r,id:r,zIndex:v,pos:S,anchor:[0.5,0.5],size:[p.w,p.h]};h&&(R.scale=h),y&&(R.rotate=y),T&&(R.translate=T);var D=new cr(R);if(s){var W=new Ln({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:l,lineWidth:1,scale:[1/d[0],1/d[1]]});D.append(W);}var U=new e1(_objectSpread(_objectSpread({},E),{},{pos:[0,0]}));D.append(U),I&&(this.scaleType=Ce.proportional,this.drawEraserlines({group:D,eraserlines:I,pos:S,layer:n},c)),this.replace(n,r,D);var M=D.getBoundingClientRect();return this.isDelete&&D.setAttribute("opacity",0),{x:Math.floor(M.x-$t.SafeBorderPadding),y:Math.floor(M.y-$t.SafeBorderPadding),w:Math.floor(M.width+$t.SafeBorderPadding*2),h:Math.floor(M.height+$t.SafeBorderPadding*2)};}},{key:"computDrawPoints",value:function computDrawPoints(t){var r=De(this.tmpPoints),n=De(this.tmpPoints,t),s=[Math.floor(r.x+r.w/2),Math.floor(r.y+r.h/2)];return{rect:n,pos:s,radius:[Math.floor(r.w/2),Math.floor(r.h/2)]};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=t.slice(-2),n=new Jt(r[0],r[1]),s=this.tmpPoints[0],c=this.workOptions.thickness;if(s.isNear(n,c))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n;}else this.tmpPoints.push(n);return!0;}},{key:"consumeService",value:function consumeService(t){var u,v;var r=t.op,n=t.isFullWork,_t$workState3=t.workState,s=_t$workState3===void 0?te.Done:_t$workState3,c=(u=this.workId)==null?void 0:u.toString();if(!c)return;this.tmpPoints.length=0;for(var h=0;h<r.length;h+=3)this.tmpPoints.push(new Jt(r[h],r[h+1],r[h+2]));var l=n?this.fullLayer:this.drawLayer||this.fullLayer,f=this.draw({workId:c,layer:l,isDrawing:!1,isDrawEraserlines:s===te.Done});return this.oldRect=f,(v=this.vNodes)==null||v.setInfo(c,{rect:f,op:r,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:$t.getCenterPos(f,l)}),f;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var h,y,T;var r=t.node,n=t.opt,s=t.vNodes,c=n.strokeColor,l=n.fillColor,f=n.strokeType,u=s.get(r.name);var v=r;return r.tagName==="GROUP"&&(v=r.children[0]),c&&(v.setAttribute("strokeColor",c),(h=u==null?void 0:u.opt)!=null&&h.strokeColor&&(u.opt.strokeColor=c)),l&&(l==="transparent"?v.setAttribute("fillColor","rgba(0,0,0,0)"):v.setAttribute("fillColor",l),(y=u==null?void 0:u.opt)!=null&&y.fillColor&&(u.opt.fillColor=l)),f&&u!=null&&u.opt&&(T=u.opt)!=null&&T.strokeType&&(u.opt.strokeType=f),u&&s.setInfo(r.name,u),$t.updateNodeOpt(t);}}]);}($t);var Mh=/*#__PURE__*/function(_$t7){function Mh(t){var _this74;_classCallCheck(this,Mh);_this74=_callSuper(this,Mh,[t]);dt(_this74,"canRotate",!0);dt(_this74,"scaleType",Ce.all);dt(_this74,"toolsType",Tt.Rectangle);dt(_this74,"tmpPoints",[]);dt(_this74,"workOptions");dt(_this74,"oldRect");dt(_this74,"syncTimestamp");_this74.workOptions=t.toolsOpt,_this74.syncTimestamp=0,_this74.syncUnitTime=50;return _this74;}_inherits(Mh,_$t7);return _createClass(Mh,[{key:"transformData",value:function transformData(){var t=De(this.tmpPoints);return[[t.x,t.y,0],[t.x+t.w,t.y,0],[t.x+t.w,t.y+t.h,0],[t.x,t.y+t.h,0]];}},{key:"computDrawPoints",value:function computDrawPoints(t){var r=this.workOptions.thickness,n=[];var _iterator28=_createForOfIteratorHelper(t),_step28;try{for(_iterator28.s();!(_step28=_iterator28.n()).done;){var l=_step28.value;n.push(_construct(pt,_toConsumableArray(l)));}}catch(err){_iterator28.e(err);}finally{_iterator28.f();}var s=De(n,r),c=[s.x+s.w/2,s.y+s.h/2];return{rect:s,pos:c,points:n.map(function(l){return l.XY;}).flat(1)};}},{key:"consume",value:function consume(t){var r=t.data,n=t.isFullWork,s=t.isSubWorker,c=t.isMainThread,l=t.smoothSync,f=t.isSimpleWorker,u=this.workId,v=r.op,h=v==null?void 0:v.length;if(!h||h<2)return{type:vt.None};var y;if(this.tmpPoints.length===0?(this.tmpPoints=[new Jt(v[0],v[1])],y=!1):y=this.updateTempPoints(v),!y)return{type:vt.None};var T=this.transformData();var O;if(s||c||f){var P=n?this.fullLayer:this.drawLayer||this.fullLayer;O=this.draw({ps:T,workId:u,layer:P,isDrawing:!0});}if(f){var _P1=Zt(O,this.oldRect);this.oldRect=O;var _w34=_objectSpread({rect:_P1,type:vt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);if(l){var _d34=Date.now();_d34-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=_d34,_w34.op=T.flat(1),_w34.index=0,_w34.isSync=!0);}return _w34;}if(!s&&l){var _P10=Date.now();return _P10-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_P10,_objectSpread({type:vt.DrawWork,dataType:Kt.Local,op:T.flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:vt.None};}var I=Zt(O,this.oldRect);return this.oldRect=O,_objectSpread({rect:I,type:vt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var f;var t=this.workId;if(this.tmpPoints.length<2)return{type:vt.RemoveNode,removeIds:[t]};var r=this.transformData(),n=this.fullLayer,s=this.draw({ps:r,workId:t,layer:n,isDrawing:!1});this.oldRect=s;var c=r.flat(1),l=mr(c);return(f=this.vNodes)==null||f.setInfo(t,{rect:s,op:c,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:s&&$t.getCenterPos(s,n)}),_objectSpread(_objectSpread({rect:s,type:vt.FullWork,dataType:Kt.Local,ops:l,isSync:!0},this.baseConsumeResult),{},{updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(t){var r=t.workId,n=t.layer,s=t.isDrawing,c=t.ps,l=t.replaceId,_t$isDrawEraserlines2=t.isDrawEraserlines,f=_t$isDrawEraserlines2===void 0?!0:_t$isDrawEraserlines2,_this$workOptions9=this.workOptions,u=_this$workOptions9.strokeColor,v=_this$workOptions9.fillColor,h=_this$workOptions9.thickness,y=_this$workOptions9.zIndex,T=_this$workOptions9.scale,O=_this$workOptions9.rotate,I=_this$workOptions9.translate,P=_this$workOptions9.strokeType,w=_this$workOptions9.eraserlines,d=_this$workOptions9.lineCap,m=_this$workOptions9.lineDash,p=n.worldPosition,S=n.worldScaling,_this$computDrawPoint5=this.computDrawPoints(c),E=_this$computDrawPoint5.points,R=_this$computDrawPoint5.rect,D=_this$computDrawPoint5.pos,U={close:!0,normalize:!0,points:E,lineWidth:h,fillColor:v!=="transparent"&&v||void 0,strokeColor:u,lineCap:d,lineDash:P===Ae.Dotted?[m&&m[0]||1,(m&&m[1]||2)*h]:P===Ae.LongDotted?[(m&&m[0]||1)*h,(m&&m[1]||2)*h]:void 0};var M={x:Math.floor(R.x*S[0]+p[0]-$t.SafeBorderPadding),y:Math.floor(R.y*S[1]+p[1]-$t.SafeBorderPadding),w:Math.floor(R.w*S[0]+2*$t.SafeBorderPadding),h:Math.floor(R.h*S[0]+2*$t.SafeBorderPadding)};var W=new cr({name:r,id:r,zIndex:y,pos:D,anchor:[0.5,0.5],size:[R.w,R.h],scale:T,rotate:O,translate:I}),$=new dn(_objectSpread(_objectSpread({},U),{},{pos:[0,0]}));if(W.appendChild($),s){var B=new Ln({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:u,lineWidth:1,scale:[1/S[0],1/S[1]]});W.appendChild(B);}if(w&&(this.scaleType=Ce.proportional,this.drawEraserlines({group:W,eraserlines:w,pos:D,layer:n},f)),this.replace(n,l||r,W),T||O||I){var _B4=W.getBoundingClientRect();M={x:Math.floor(_B4.x-$t.SafeBorderPadding),y:Math.floor(_B4.y-$t.SafeBorderPadding),w:Math.floor(_B4.width+2*$t.SafeBorderPadding),h:Math.floor(_B4.height+2*$t.SafeBorderPadding)};}return this.isDelete&&W.setAttribute("opacity",0),M;}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=t.slice(-2),n=new Jt(r[0],r[1]),s=this.tmpPoints[0],c=this.workOptions.thickness;if(s.isNear(n,c))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n;}else this.tmpPoints.push(n);return!0;}},{key:"consumeService",value:function consumeService(t){var h,y;var r=t.op,n=t.isFullWork,s=t.replaceId,_t$workState4=t.workState,c=_t$workState4===void 0?te.Done:_t$workState4,l=(h=this.workId)==null?void 0:h.toString();if(!l)return;var f=[];for(var T=0;T<r.length;T+=3)f.push([r[T],r[T+1],r[T+2]]);var u=n?this.fullLayer:this.drawLayer||this.fullLayer,v=this.draw({ps:f,workId:l,layer:u,isDrawing:!1,replaceId:s,isDrawEraserlines:c===te.Done});return this.oldRect=v,(y=this.vNodes)==null||y.setInfo(l,{rect:v,op:r,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:v&&$t.getCenterPos(v,u)}),v;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var h,y,T;var r=t.node,n=t.opt,s=t.vNodes,c=n.strokeColor,l=n.fillColor,f=n.strokeType,u=s.get(r.name);var v=r;return r.tagName==="GROUP"&&(v=r.children[0]),c&&(v.setAttribute("strokeColor",c),(h=u==null?void 0:u.opt)!=null&&h.strokeColor&&(u.opt.strokeColor=c)),l&&(l==="transparent"?v.setAttribute("fillColor","rgba(0,0,0,0)"):v.setAttribute("fillColor",l),(y=u==null?void 0:u.opt)!=null&&y.fillColor&&(u.opt.fillColor=l)),f&&u!=null&&u.opt&&(T=u.opt)!=null&&T.strokeType&&(u.opt.strokeType=f),u&&s.setInfo(r.name,u),$t.updateNodeOpt(t);}}]);}($t);var Lh=/*#__PURE__*/function(_$t8){function Lh(t){var _this75;_classCallCheck(this,Lh);_this75=_callSuper(this,Lh,[t]);dt(_this75,"canRotate",!1);dt(_this75,"scaleType",Ce.all);dt(_this75,"toolsType",Tt.Star);dt(_this75,"tmpPoints",[]);dt(_this75,"workOptions");dt(_this75,"oldRect");dt(_this75,"syncTimestamp");_this75.workOptions=t.toolsOpt,_this75.syncTimestamp=0,_this75.syncUnitTime=50;return _this75;}_inherits(Lh,_$t8);return _createClass(Lh,[{key:"consume",value:function consume(t){var r=t.data,n=t.isFullWork,s=t.isSubWorker,c=t.isMainThread,l=t.smoothSync,f=t.isSimpleWorker,u=this.workId,v=r.op,h=r.syncUnitTime,y=v==null?void 0:v.length;if(!y||y<2)return{type:vt.None};h&&(this.syncUnitTime=h);var T;if(this.tmpPoints.length===0?(this.tmpPoints=[new Jt(v[0],v[1])],T=!1):T=this.updateTempPoints(v),!T)return{type:vt.None};var O;if(s||c||f){var P=n?this.fullLayer:this.drawLayer||this.fullLayer;O=this.draw({workId:u,layer:P,isDrawing:!0});}if(f){var _P11=Zt(O,this.oldRect);this.oldRect=O;var _w35=_objectSpread({rect:_P11,type:vt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);if(l){var _d35=Date.now();_d35-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=_d35,_w35.op=this.tmpPoints.map(function(m){return[].concat(_toConsumableArray(m.XY),[0]);}).flat(1),_w35.index=0,_w35.isSync=!0);}return _w35;}if(!s&&l){var _P12=Date.now();return _P12-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_P12,_objectSpread({type:vt.DrawWork,dataType:Kt.Local,op:this.tmpPoints.map(function(w){return[].concat(_toConsumableArray(w.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:vt.None};}var I=Zt(O,this.oldRect);return this.oldRect=O,_objectSpread({rect:I,type:vt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var l;var t=this.workId;if(this.tmpPoints.length<2)return{type:vt.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r,isDrawing:!1});this.oldRect=n;var s=this.tmpPoints.map(function(f){return[].concat(_toConsumableArray(f.XY),[0]);}).flat(1),c=mr(s);return(l=this.vNodes)==null||l.setInfo(t,{rect:n,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&$t.getCenterPos(n,r)}),_objectSpread(_objectSpread({rect:n,type:vt.FullWork,dataType:Kt.Local,ops:c,isSync:!0},this.baseConsumeResult),{},{updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(t){var r=t.workId,n=t.layer,s=t.isDrawing,_t$isDrawEraserlines3=t.isDrawEraserlines,c=_t$isDrawEraserlines3===void 0?!0:_t$isDrawEraserlines3,_this$workOptions0=this.workOptions,l=_this$workOptions0.strokeColor,f=_this$workOptions0.fillColor,u=_this$workOptions0.thickness,v=_this$workOptions0.zIndex,h=_this$workOptions0.vertices,y=_this$workOptions0.innerVerticeStep,T=_this$workOptions0.innerRatio,O=_this$workOptions0.scale,I=_this$workOptions0.rotate,P=_this$workOptions0.translate,w=_this$workOptions0.strokeType,d=_this$workOptions0.eraserlines,m=_this$workOptions0.lineDash,p=_this$workOptions0.lineCap,S=n.worldScaling,_this$computDrawPoint6=this.computDrawPoints(u,h,y,T),E=_this$computDrawPoint6.rect,R=_this$computDrawPoint6.pos,D=_this$computDrawPoint6.points,U={close:!0,points:D,lineWidth:u,fillColor:f!=="transparent"&&f||void 0,strokeColor:l,normalize:!0,lineCap:p,lineDash:w===Ae.Dotted?[m&&m[0]||1,(m&&m[1]||2)*u]:w===Ae.LongDotted?[(m&&m[0]||1)*u,(m&&m[1]||2)*u]:void 0},M={name:r,id:r,zIndex:v,pos:R,anchor:[0.5,0.5],size:[E.w,E.h]};O&&(M.scale=O),I&&(M.rotate=I),P&&(M.translate=P);var W=new cr(M);if(s){var N=new Ln({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:l,lineWidth:1,scale:[1/S[0],1/S[1]]});W.append(N);}var $=new dn(_objectSpread(_objectSpread({},U),{},{pos:[0,0]}));W.append($),d&&(this.scaleType=Ce.proportional,this.drawEraserlines({group:W,eraserlines:d,pos:R,layer:n},c)),this.replace(n,r,W);var B=W.getBoundingClientRect();return this.isDelete&&W.setAttribute("opacity",0),{x:Math.floor(B.x-$t.SafeBorderPadding),y:Math.floor(B.y-$t.SafeBorderPadding),w:Math.floor(B.width+$t.SafeBorderPadding*2),h:Math.floor(B.height+$t.SafeBorderPadding*2)};}},{key:"computDrawPoints",value:function computDrawPoints(t,r,n,s){var c=De(this.tmpPoints),l=[Math.floor(c.x+c.w/2),Math.floor(c.y+c.h/2)],f=Qh(c.w,c.h),u=Math.floor(Math.min(c.w,c.h)/2),v=s*u,h=[],y=2*Math.PI/r;for(var O=0;O<r;O++){var I=O*y-0.5*Math.PI;var P=void 0,_w36=void 0;O%n===1?(P=v*f[0]*Math.cos(I),_w36=v*f[1]*Math.sin(I)):(P=u*f[0]*Math.cos(I),_w36=u*f[1]*Math.sin(I),h.push(P,_w36)),h.push(P,_w36);}return{rect:De(this.tmpPoints,t),pos:l,points:h};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=t.slice(-2),n=new Jt(r[0],r[1]),s=this.tmpPoints[0],c=this.workOptions.thickness;if(s.isNear(n,c)||Jt.Sub(s,n).XY.includes(0))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n;}else this.tmpPoints.push(n);return!0;}},{key:"consumeService",value:function consumeService(t){var u,v;var r=t.op,n=t.isFullWork,_t$workState5=t.workState,s=_t$workState5===void 0?te.Done:_t$workState5,c=(u=this.workId)==null?void 0:u.toString();if(!c)return;this.tmpPoints.length=0;for(var h=0;h<r.length;h+=3)this.tmpPoints.push(new Jt(r[h],r[h+1],r[h+2]));var l=n?this.fullLayer:this.drawLayer||this.fullLayer,f=this.draw({workId:c,layer:l,isDrawing:!1,isDrawEraserlines:s===te.Done});return this.oldRect=f,(v=this.vNodes)==null||v.setInfo(c,{rect:f,op:r,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:f&&$t.getCenterPos(f,l)}),f;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var P;var r=t.node,n=t.opt,s=t.vNodes,c=n.strokeColor,l=n.fillColor,f=n.toolsType,u=n.vertices,v=n.innerVerticeStep,h=n.innerRatio,y=n.strokeType,T=s.get(r.name),O=T==null?void 0:T.opt;var I=r;return r.tagName==="GROUP"&&(I=r.children[0]),c&&(I.setAttribute("strokeColor",c),O!=null&&O.strokeColor&&(O.strokeColor=c)),l&&(l==="transparent"?I.setAttribute("fillColor","rgba(0,0,0,0)"):I.setAttribute("fillColor",l),O!=null&&O.fillColor&&(O.fillColor=l)),f===Tt.Star&&(u&&(O.vertices=u),v&&(O.innerVerticeStep=v),h&&(O.innerRatio=h)),y&&T!=null&&T.opt&&(P=T.opt)!=null&&P.strokeType&&(T.opt.strokeType=y),T&&s.setInfo(r.name,_objectSpread(_objectSpread({},T),{},{opt:O})),$t.updateNodeOpt(t);}}]);}($t);var Rh=/*#__PURE__*/function(_$t9){function Rh(t){var _this76;_classCallCheck(this,Rh);_this76=_callSuper(this,Rh,[t]);dt(_this76,"canRotate",!1);dt(_this76,"scaleType",Ce.all);dt(_this76,"toolsType",Tt.Polygon);dt(_this76,"tmpPoints",[]);dt(_this76,"workOptions");dt(_this76,"oldRect");dt(_this76,"syncTimestamp");_this76.workOptions=t.toolsOpt,_this76.syncTimestamp=0,_this76.syncUnitTime=50;return _this76;}_inherits(Rh,_$t9);return _createClass(Rh,[{key:"consume",value:function consume(t){var r=t.data,n=t.isFullWork,s=t.isSubWorker,c=t.isMainThread,l=t.smoothSync,f=t.isSimpleWorker,u=r.op,v=r.syncUnitTime;v&&(this.syncUnitTime=v);var h=this.workId,y=u==null?void 0:u.length;if(!y||y<2)return{type:vt.None};var T;if(this.tmpPoints.length===0?(this.tmpPoints=[new Jt(u[0],u[1])],T=!1):T=this.updateTempPoints(u),!T)return{type:vt.None};var O;if(s||c||f){var P=n?this.fullLayer:this.drawLayer||this.fullLayer;O=this.draw({workId:h,layer:P,isDrawing:!0});}if(f){var _P13=Zt(O,this.oldRect);this.oldRect=O;var _w37=_objectSpread({type:vt.DrawWork,rect:_P13,dataType:Kt.Local},this.baseConsumeResult);if(l){var _d36=Date.now();_d36-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=_d36,_w37.op=this.tmpPoints.map(function(m){return[].concat(_toConsumableArray(m.XY),[0]);}).flat(1),_w37.index=0,_w37.isSync=!0);}return _w37;}if(!s&&l){var _P14=Date.now();return _P14-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_P14,_objectSpread({type:vt.DrawWork,dataType:Kt.Local,op:this.tmpPoints.map(function(w){return[].concat(_toConsumableArray(w.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:vt.None};}var I=Zt(O,this.oldRect);return this.oldRect=O,_objectSpread({rect:I,type:vt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var l;var t=this.workId;if(this.tmpPoints.length<2)return{type:vt.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r,isDrawing:!1});this.oldRect=n;var s=this.tmpPoints.map(function(f){return[].concat(_toConsumableArray(f.XY),[0]);}).flat(1),c=mr(s);return(l=this.vNodes)==null||l.setInfo(t,{rect:n,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&$t.getCenterPos(n,r)}),_objectSpread(_objectSpread({rect:n,type:vt.FullWork,dataType:Kt.Local,ops:c,isSync:!0},this.baseConsumeResult),{},{updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(t){var r=t.workId,n=t.layer,s=t.isDrawing,_t$isDrawEraserlines4=t.isDrawEraserlines,c=_t$isDrawEraserlines4===void 0?!0:_t$isDrawEraserlines4,_this$workOptions1=this.workOptions,l=_this$workOptions1.strokeColor,f=_this$workOptions1.fillColor,u=_this$workOptions1.thickness,v=_this$workOptions1.zIndex,h=_this$workOptions1.vertices,y=_this$workOptions1.scale,T=_this$workOptions1.rotate,O=_this$workOptions1.translate,I=_this$workOptions1.strokeType,P=_this$workOptions1.eraserlines,w=_this$workOptions1.lineCap,d=_this$workOptions1.lineDash,m=n.worldScaling,_this$computDrawPoint7=this.computDrawPoints(u,h),p=_this$computDrawPoint7.rect,S=_this$computDrawPoint7.pos,E=_this$computDrawPoint7.points,R={close:!0,points:E,lineWidth:u,fillColor:f!=="transparent"&&f||void 0,strokeColor:l,normalize:!0,lineCap:w,lineDash:I===Ae.Dotted?[d&&d[0]||1,(d&&d[1]||2)*u]:I===Ae.LongDotted?[(d&&d[0]||1)*u,(d&&d[1]||2)*u]:void 0},D={name:r,id:r,zIndex:v,pos:S,anchor:[0.5,0.5],size:[p.w,p.h]};y&&(D.scale=y),T&&(D.rotate=T),O&&(D.translate=O);var U=new cr(D);if(s){var $=new Ln({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:l,lineWidth:1,scale:[1/m[0],1/m[1]]});U.append($);}var M=new dn(_objectSpread(_objectSpread({},R),{},{pos:[0,0]}));U.append(M),P&&(this.scaleType=Ce.proportional,this.drawEraserlines({group:U,eraserlines:P,pos:S,layer:n},c)),this.replace(n,r,U);var W=U.getBoundingClientRect();return this.isDelete&&U.setAttribute("opacity",0),{x:Math.floor(W.x-$t.SafeBorderPadding),y:Math.floor(W.y-$t.SafeBorderPadding),w:Math.floor(W.width+$t.SafeBorderPadding*2),h:Math.floor(W.height+$t.SafeBorderPadding*2)};}},{key:"computDrawPoints",value:function computDrawPoints(t,r){var n=De(this.tmpPoints),s=[Math.floor(n.x+n.w/2),Math.floor(n.y+n.h/2)],c=Qh(n.w,n.h),l=Math.floor(Math.min(n.w,n.h)/2),f=[],u=2*Math.PI/r;for(var h=0;h<r;h++){var y=h*u-0.5*Math.PI,T=l*c[0]*Math.cos(y),O=l*c[1]*Math.sin(y);f.push(T,O);}return{rect:De(this.tmpPoints,t),pos:s,points:f};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=t.slice(-2),n=new Jt(r[0],r[1]),s=this.tmpPoints[0],c=this.workOptions.thickness;if(s.isNear(n,c)||Jt.Sub(s,n).XY.includes(0))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n;}else this.tmpPoints.push(n);return!0;}},{key:"consumeService",value:function consumeService(t){var u,v;var r=t.op,n=t.isFullWork,_t$workState6=t.workState,s=_t$workState6===void 0?te.Done:_t$workState6,c=(u=this.workId)==null?void 0:u.toString();if(!c)return;this.tmpPoints.length=0;for(var h=0;h<r.length;h+=3)this.tmpPoints.push(new Jt(r[h],r[h+1],r[h+2]));var l=n?this.fullLayer:this.drawLayer||this.fullLayer,f=this.draw({workId:c,layer:l,isDrawing:!1,isDrawEraserlines:s===te.Done});return this.oldRect=f,(v=this.vNodes)==null||v.setInfo(c,{rect:f,op:r,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:f&&$t.getCenterPos(f,l)}),f;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var O;var r=t.node,n=t.opt,s=t.vNodes,c=n.strokeColor,l=n.fillColor,f=n.toolsType,u=n.vertices,v=n.strokeType,h=s.get(r.name),y=h==null?void 0:h.opt;var T=r;return r.tagName==="GROUP"&&(T=r.children[0]),c&&(T.setAttribute("strokeColor",c),y!=null&&y.strokeColor&&(y.strokeColor=c)),l&&(l==="transparent"?T.setAttribute("fillColor","rgba(0,0,0,0)"):T.setAttribute("fillColor",l),y!=null&&y.fillColor&&(y.fillColor=l)),f===Tt.Polygon&&u&&(y.vertices=u),v&&h!=null&&h.opt&&(O=h.opt)!=null&&O.strokeType&&(h.opt.strokeType=v),h&&s.setInfo(r.name,_objectSpread(_objectSpread({},h),{},{opt:y})),$t.updateNodeOpt(t);}}]);}($t);var Vr=/*#__PURE__*/function(){function Vr(){_classCallCheck(this,Vr);}return _createClass(Vr,null,[{key:"bezier",value:function bezier(e,t){var r=[];for(var n=0;n<t.length;n+=4){var s=t[n],c=t[n+1],l=t[n+2],f=t[n+3];s&&c&&l&&f?r.push.apply(r,_toConsumableArray(Vr.getBezierPoints(e,s,c,l,f))):s&&c&&l?r.push.apply(r,_toConsumableArray(Vr.getBezierPoints(e,s,c,l))):s&&c?r.push.apply(r,_toConsumableArray(Vr.getBezierPoints(e,s,c))):s&&r.push(s);}return r;}/**
|
|
409
|
+
* @desc 获取点,这里可以设置点的个数
|
|
410
|
+
* @param {number} num 点个数
|
|
411
|
+
* @param {Vec2d} p1 点坐标
|
|
412
|
+
* @param {Vec2d} p2 点坐标
|
|
413
|
+
* @param {Vec2d} p3 点坐标
|
|
414
|
+
* @param {Vec2d} p4 点坐标
|
|
415
|
+
* 如果参数是 num, p1, p2 为一阶贝塞尔
|
|
416
|
+
* 如果参数是 num, p1, c1, p2 为二阶贝塞尔
|
|
417
|
+
* 如果参数是 num, p1, c1, c2, p2 为三阶贝塞尔
|
|
418
|
+
*/},{key:"getBezierPoints",value:function getBezierPoints(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:10;var t=arguments.length>1?arguments[1]:undefined;var r=arguments.length>2?arguments[2]:undefined;var n=arguments.length>3?arguments[3]:undefined;var s=arguments.length>4?arguments[4]:undefined;var c=null;var l=[];!n&&!s?c=Vr.oneBezier:n&&!s?c=Vr.twoBezier:n&&s&&(c=Vr.threeBezier);for(var f=0;f<e;f++)c&&l.push(c(f/e,t,r,n,s));return s?l.push(s):n&&l.push(n),l;}/**
|
|
419
|
+
* @desc 一阶贝塞尔
|
|
420
|
+
* @param {number} t 当前百分比
|
|
421
|
+
* @param {Vec2d} p1 起点坐标
|
|
422
|
+
* @param {Vec2d} p2 终点坐标
|
|
423
|
+
*/},{key:"oneBezier",value:function oneBezier(e,t,r){var n=t.x+(r.x-t.x)*e,s=t.y+(r.y-t.y)*e;return new pt(n,s);}/**
|
|
424
|
+
* @desc 二阶贝塞尔
|
|
425
|
+
* @param {number} t 当前百分比
|
|
426
|
+
* @param {Array} p1 起点坐标
|
|
427
|
+
* @param {Array} p2 终点坐标
|
|
428
|
+
* @param {Array} cp 控制点
|
|
429
|
+
*/},{key:"twoBezier",value:function twoBezier(e,t,r,n){var s=(1-e)*(1-e)*t.x+2*e*(1-e)*r.x+e*e*n.x,c=(1-e)*(1-e)*t.y+2*e*(1-e)*r.y+e*e*n.y;return new pt(s,c);}/**
|
|
430
|
+
* @desc 三阶贝塞尔
|
|
431
|
+
* @param {number} t 当前百分比
|
|
432
|
+
* @param {Array} p1 起点坐标
|
|
433
|
+
* @param {Array} p2 终点坐标
|
|
434
|
+
* @param {Array} cp1 控制点1
|
|
435
|
+
* @param {Array} cp2 控制点2
|
|
436
|
+
*/},{key:"threeBezier",value:function threeBezier(e,t,r,n,s){var c=t.x*(1-e)*(1-e)*(1-e)+3*r.x*e*(1-e)*(1-e)+3*n.x*e*e*(1-e)+s.x*e*e*e,l=t.y*(1-e)*(1-e)*(1-e)+3*r.y*e*(1-e)*(1-e)+3*n.y*e*e*(1-e)+s.y*e*e*e;return new pt(c,l);}}]);}();var bh=/*#__PURE__*/function(_$t0){function bh(t){var _this77;_classCallCheck(this,bh);_this77=_callSuper(this,bh,[t]);dt(_this77,"canRotate",!1);dt(_this77,"scaleType",Ce.all);dt(_this77,"toolsType",Tt.SpeechBalloon);dt(_this77,"ratio",0.8);dt(_this77,"tmpPoints",[]);dt(_this77,"workOptions");dt(_this77,"oldRect");dt(_this77,"syncTimestamp");_this77.workOptions=t.toolsOpt,_this77.syncTimestamp=0,_this77.syncUnitTime=50;return _this77;}_inherits(bh,_$t0);return _createClass(bh,[{key:"consume",value:function consume(t){var I;var r=t.data,n=t.isFullWork,s=t.isSubWorker,c=t.isMainThread,l=t.smoothSync,f=t.isSimpleWorker,u=(I=r==null?void 0:r.workId)==null?void 0:I.toString();if(!u)return{type:vt.None};var v=r.op,h=v==null?void 0:v.length;if(!h||h<2)return{type:vt.None};var y;if(this.tmpPoints.length===0?(this.tmpPoints=[new Jt(v[0],v[1])],y=!1):y=this.updateTempPoints(v),!y)return{type:vt.None};var T;if(s||c||f){var P=n?this.fullLayer:this.drawLayer||this.fullLayer;T=this.draw({workId:u,layer:P,isDrawing:!0});}if(f){var _P15=Zt(T,this.oldRect);this.oldRect=T;var _w38=_objectSpread({rect:_P15,type:vt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);if(l){var _d37=Date.now();_d37-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=_d37,_w38.op=this.tmpPoints.map(function(m){return[].concat(_toConsumableArray(m.XY),[0]);}).flat(1),_w38.index=0,_w38.isSync=!0);}return _w38;}if(!s&&l){var _P16=Date.now();return _P16-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_P16,_objectSpread({type:vt.DrawWork,dataType:Kt.Local,op:this.tmpPoints.map(function(w){return[].concat(_toConsumableArray(w.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:vt.None};}var O=Zt(T,this.oldRect);return this.oldRect=T,_objectSpread({rect:O,type:vt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var l;var t=this.workId;if(this.tmpPoints.length<2)return{type:vt.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r,isDrawing:!1});this.oldRect=n;var s=this.tmpPoints.map(function(f){return[].concat(_toConsumableArray(f.XY),[0]);}).flat(1),c=mr(s);return(l=this.vNodes)==null||l.setInfo(t,{rect:n,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&$t.getCenterPos(n,r)}),_objectSpread(_objectSpread({rect:n,type:vt.FullWork,dataType:Kt.Local,ops:c,isSync:!0},this.baseConsumeResult),{},{updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(t){var r=t.workId,n=t.layer,_t$isDrawEraserlines5=t.isDrawEraserlines,s=_t$isDrawEraserlines5===void 0?!0:_t$isDrawEraserlines5,_this$workOptions10=this.workOptions,c=_this$workOptions10.strokeColor,l=_this$workOptions10.fillColor,f=_this$workOptions10.thickness,u=_this$workOptions10.zIndex,v=_this$workOptions10.placement,h=_this$workOptions10.scale,y=_this$workOptions10.rotate,T=_this$workOptions10.translate,O=_this$workOptions10.strokeType,I=_this$workOptions10.eraserlines,P=_this$workOptions10.lineDash,w=_this$workOptions10.lineCap,_this$computDrawPoint8=this.computDrawPoints(f,v),d=_this$computDrawPoint8.rect,m=_this$computDrawPoint8.pos,p=_this$computDrawPoint8.points,S={points:p.map(function(M){return M.XY;}),lineWidth:f,fillColor:l!=="transparent"&&l||void 0,strokeColor:c,normalize:!0,className:"".concat(m[0],",").concat(m[1]),close:!0,lineCap:w,lineDash:O===Ae.Dotted?[P&&P[0]||1,(P&&P[1]||2)*f]:O===Ae.LongDotted?[(P&&P[0]||1)*f,(P&&P[1]||2)*f]:void 0},E={name:r,id:r,zIndex:u,pos:m,anchor:[0.5,0.5],size:[d.w,d.h]};h&&(E.scale=h),y&&(E.rotate=y),T&&(E.translate=T);var R=new cr(E),D=new dn(_objectSpread(_objectSpread({},S),{},{pos:[0,0]}));R.append(D),I&&(this.scaleType=Ce.proportional,this.drawEraserlines({group:R,eraserlines:I,pos:m,layer:n},s)),this.replace(n,r,R);var U=R.getBoundingClientRect();return this.isDelete&&R.setAttribute("opacity",0),{x:Math.floor(U.x-$t.SafeBorderPadding),y:Math.floor(U.y-$t.SafeBorderPadding),w:Math.floor(U.width+$t.SafeBorderPadding*2),h:Math.floor(U.height+$t.SafeBorderPadding*2)};}},{key:"transformControlPoints",value:function transformControlPoints(t){var r=De(this.tmpPoints);switch(t){case"bottom":case"bottomLeft":case"bottomRight":{var n=r.y+r.h*this.ratio;return[new pt(r.x,r.y,0),new pt(r.x+r.w,r.y,0),new pt(r.x+r.w,n,0),new pt(r.x,n,0)];}case"top":case"topLeft":case"topRight":{var _n4=r.y+r.h*(1-this.ratio);return[new pt(r.x,_n4,0),new pt(r.x+r.w,_n4,0),new pt(r.x+r.w,r.y+r.h,0),new pt(r.x,r.y+r.h,0)];}case"left":case"leftBottom":case"leftTop":{var _n5=r.x+r.w*(1-this.ratio);return[new pt(_n5,r.y,0),new pt(r.x+r.w,r.y,0),new pt(r.x+r.w,r.y+r.h,0),new pt(_n5,r.y+r.h,0)];}case"right":case"rightBottom":case"rightTop":{var _n6=r.x+r.w*this.ratio;return[new pt(r.x,r.y,0),new pt(_n6,r.y,0),new pt(_n6,r.y+r.h,0),new pt(r.x,r.y+r.h,0)];}}}},{key:"computDrawPoints",value:function computDrawPoints(t,r){var n=De(this.tmpPoints),s=this.transformControlPoints(r),c=Math.floor(n.w*0.1),l=Math.floor(n.h*0.1),f=[],u=pt.Add(s[0],new pt(0,l,0)),v=pt.Add(s[0],new pt(c,0,0)),h=Vr.getBezierPoints(10,u,s[0],v),y=pt.Sub(s[1],new pt(c,0,0)),T=pt.Add(s[1],new pt(0,l,0)),O=Vr.getBezierPoints(10,y,s[1],T),I=pt.Sub(s[2],new pt(0,l,0)),P=pt.Sub(s[2],new pt(c,0,0)),w=Vr.getBezierPoints(10,I,s[2],P),d=pt.Add(s[3],new pt(c,0,0)),m=pt.Sub(s[3],new pt(0,l,0)),p=Vr.getBezierPoints(10,d,s[3],m),S=c*(1-this.ratio)*10,E=l*(1-this.ratio)*10;switch(r){case"bottom":{var U=pt.Sub(s[2],new pt(c*5-S/2,0,0)),M=pt.Sub(s[2],new pt(c*5,-E,0)),W=pt.Sub(s[2],new pt(c*5+S/2,0,0));f.push.apply(f,[M,W].concat(_toConsumableArray(p),_toConsumableArray(h),_toConsumableArray(O),_toConsumableArray(w),[U]));break;}case"bottomRight":{var _U10=pt.Sub(s[2],new pt(c*1.1,0,0)),_M0=pt.Sub(s[2],new pt(c*1.1+S/2,-E,0)),_W8=pt.Sub(s[2],new pt(c*1.1+S,0,0));f.push.apply(f,[_M0,_W8].concat(_toConsumableArray(p),_toConsumableArray(h),_toConsumableArray(O),_toConsumableArray(w),[_U10]));break;}case"bottomLeft":{var _U11=pt.Add(s[3],new pt(c*1.1+S,0,0)),_M1=pt.Add(s[3],new pt(c*1.1+S/2,E,0)),_W9=pt.Add(s[3],new pt(c*1.1,0,0));f.push.apply(f,[_M1,_W9].concat(_toConsumableArray(p),_toConsumableArray(h),_toConsumableArray(O),_toConsumableArray(w),[_U11]));break;}case"top":{var _U12=pt.Sub(s[1],new pt(c*5-S/2,0,0)),_M10=pt.Sub(s[1],new pt(c*5,E,0)),_W0=pt.Sub(s[1],new pt(c*5+S/2,0,0));f.push.apply(f,[_M10,_U12].concat(_toConsumableArray(O),_toConsumableArray(w),_toConsumableArray(p),_toConsumableArray(h),[_W0]));break;}case"topRight":{var _U13=pt.Sub(s[1],new pt(c*1.1,0,0)),_M11=pt.Sub(s[1],new pt(c*1.1+S/2,E,0)),_W1=pt.Sub(s[1],new pt(c*1.1+S,0,0));f.push.apply(f,[_M11,_U13].concat(_toConsumableArray(O),_toConsumableArray(w),_toConsumableArray(p),_toConsumableArray(h),[_W1]));break;}case"topLeft":{var _U14=pt.Add(s[0],new pt(c*1.1+S,0,0)),_M12=pt.Add(s[0],new pt(c*1.1+S/2,-E,0)),_W10=pt.Add(s[0],new pt(c*1.1,0,0));f.push.apply(f,[_M12,_U14].concat(_toConsumableArray(O),_toConsumableArray(w),_toConsumableArray(p),_toConsumableArray(h),[_W10]));break;}case"left":{var _U15=pt.Add(s[0],new pt(0,l*5-E/2,0)),_M13=pt.Add(s[0],new pt(-S,l*5,0)),_W11=pt.Add(s[0],new pt(0,l*5+E/2,0));f.push.apply(f,[_M13,_U15].concat(_toConsumableArray(h),_toConsumableArray(O),_toConsumableArray(w),_toConsumableArray(p),[_W11]));break;}case"leftTop":{var _U16=pt.Add(s[0],new pt(0,l*1.1,0)),_M14=pt.Add(s[0],new pt(-S,l*1.1+E/2,0)),_W12=pt.Add(s[0],new pt(0,l*1.1+E,0));f.push.apply(f,[_M14,_U16].concat(_toConsumableArray(h),_toConsumableArray(O),_toConsumableArray(w),_toConsumableArray(p),[_W12]));break;}case"leftBottom":{var _U17=pt.Sub(s[3],new pt(0,l*1.1+E,0)),_M15=pt.Sub(s[3],new pt(S,l*1.1+E/2,0)),_W13=pt.Sub(s[3],new pt(0,l*1.1,0));f.push.apply(f,[_M15,_U17].concat(_toConsumableArray(h),_toConsumableArray(O),_toConsumableArray(w),_toConsumableArray(p),[_W13]));break;}case"right":{var _U18=pt.Add(s[1],new pt(0,l*5-E/2,0)),_M16=pt.Add(s[1],new pt(S,l*5,0)),_W14=pt.Add(s[1],new pt(0,l*5+E/2,0));f.push.apply(f,[_M16,_W14].concat(_toConsumableArray(w),_toConsumableArray(p),_toConsumableArray(h),_toConsumableArray(O),[_U18]));break;}case"rightTop":{var _U19=pt.Add(s[1],new pt(0,l*1.1,0)),_M17=pt.Add(s[1],new pt(S,l*1.1+E/2,0)),_W15=pt.Add(s[1],new pt(0,l*1.1+E,0));f.push.apply(f,[_M17,_W15].concat(_toConsumableArray(w),_toConsumableArray(p),_toConsumableArray(h),_toConsumableArray(O),[_U19]));break;}case"rightBottom":{var _U20=pt.Sub(s[2],new pt(0,l*1.1+E,0)),_M18=pt.Sub(s[2],new pt(-S,l*1.1+E/2,0)),_W16=pt.Sub(s[2],new pt(0,l*1.1,0));f.push.apply(f,[_M18,_W16].concat(_toConsumableArray(w),_toConsumableArray(p),_toConsumableArray(h),_toConsumableArray(O),[_U20]));break;}}var R=De(this.tmpPoints,t),D=[Math.floor(R.x+R.w/2),Math.floor(R.y+R.h/2)];return{rect:R,pos:D,points:f};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=t.slice(-2),n=new Jt(r[0],r[1]),s=this.tmpPoints[0],c=this.workOptions.thickness;if(s.isNear(n,c)||Jt.Sub(s,n).XY.includes(0))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n;}else this.tmpPoints.push(n);return!0;}},{key:"consumeService",value:function consumeService(t){var u,v;var r=t.op,n=t.isFullWork,_t$workState7=t.workState,s=_t$workState7===void 0?te.Done:_t$workState7,c=(u=this.workId)==null?void 0:u.toString();if(!c)return;this.tmpPoints.length=0;for(var h=0;h<r.length;h+=3)this.tmpPoints.push(new Jt(r[h],r[h+1],r[h+2]));var l=n?this.fullLayer:this.drawLayer||this.fullLayer,f=this.draw({workId:c,layer:l,isDrawing:!1,isDrawEraserlines:s===te.Done});return this.oldRect=f,(v=this.vNodes)==null||v.setInfo(c,{rect:f,op:r,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:f&&$t.getCenterPos(f,l)}),f;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var O;var r=t.node,n=t.opt,s=t.vNodes,c=n.strokeColor,l=n.fillColor,f=n.toolsType,u=n.placement,v=n.strokeType,h=s.get(r.name),y=h==null?void 0:h.opt;var T=r;return r.tagName==="GROUP"&&(T=r.children[0]),c&&(T.setAttribute("strokeColor",c),y!=null&&y.strokeColor&&(y.strokeColor=c)),l&&(l==="transparent"?T.setAttribute("fillColor","rgba(0,0,0,0)"):T.setAttribute("fillColor",l),y!=null&&y.fillColor&&(y.fillColor=l)),f===Tt.SpeechBalloon&&u&&(y.placement=u),v&&h!=null&&h.opt&&(O=h.opt)!=null&&O.strokeType&&(h.opt.strokeType=v),h&&s.setInfo(r.name,_objectSpread(_objectSpread({},h),{},{opt:y})),$t.updateNodeOpt(t);}}]);}($t);var rA=yi,nA=pn,iA="[object Boolean]";function sA(i){return i===!0||i===!1||nA(i)&&rA(i)==iA;}var oA=sA,zn=/* @__PURE__ */Rn(oA);var Hi=/*#__PURE__*/function(_$t1){function Hi(t){var _this78;_classCallCheck(this,Hi);_this78=_callSuper(this,Hi,[t]);dt(_this78,"canRotate",!0);dt(_this78,"scaleType",Ce.all);dt(_this78,"toolsType",Tt.Image);dt(_this78,"tmpPoints",[]);dt(_this78,"workOptions");dt(_this78,"oldRect");_this78.workOptions=t.toolsOpt,_this78.scaleType=Hi.getScaleType(_this78.workOptions);return _this78;}_inherits(Hi,_$t1);return _createClass(Hi,[{key:"consume",value:function consume(){return{type:vt.None};}},{key:"consumeAll",value:function consumeAll(){return{type:vt.None};}},{key:"draw",value:function draw(t){var r=t.layer,n=t.workId,s=t.replaceId,c=t.imageBitmap,_this$workOptions11=this.workOptions,l=_this$workOptions11.centerX,f=_this$workOptions11.centerY,u=_this$workOptions11.width,v=_this$workOptions11.height,h=_this$workOptions11.rotate,y=_this$workOptions11.zIndex,T=_this$workOptions11.eraserlines,O=new cr({anchor:[0.5,0.5],pos:[l,f],name:n,size:[u,v],zIndex:y,rotate:h}),I={anchor:[0.5,0.5],pos:[0,0],size:[u,v],texture:c};c||(I.bgcolor="rgba(0,0,0,0.3)");var P=new zu(I);O.append(P),T&&this.drawEraserlines({group:O,eraserlines:T,pos:[l,f],layer:r}),this.replace(r,s||n,O);var w=O.getBoundingClientRect();if(w)return{x:Math.floor(w.x-$t.SafeBorderPadding),y:Math.floor(w.y-$t.SafeBorderPadding),w:Math.floor(w.width+$t.SafeBorderPadding*2),h:Math.floor(w.height+$t.SafeBorderPadding*2)};}},{key:"consumeService",value:function consumeService(){}},{key:"consumeServiceAsync",value:function(){var _consumeServiceAsync=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee21(t){var v,h,y,T,r,n,s,_this$workOptions12,c,l,f,u,O,I;return _regenerator().w(function(_context23){while(1)switch(_context23.n){case 0:r=t.isFullWork,n=t.replaceId,s=t.worker,_this$workOptions12=this.workOptions,c=_this$workOptions12.src,l=_this$workOptions12.uuid,f=((v=this.workId)==null?void 0:v.toString())||l,u=r?this.fullLayer:this.drawLayer||this.fullLayer;if(!c){_context23.n=2;break;}_context23.n=1;return s.loadImageBitMap({toolsType:this.toolsType,opt:this.workOptions,workId:f,isSubWorker:s instanceof ad});case 1:O=_context23.v;if(!O){_context23.n=2;break;}I=this.draw({workId:f,layer:u,replaceId:n,imageBitmap:O});return _context23.a(2,(this.oldRect=f&&((y=(h=this.vNodes)==null?void 0:h.get(f))==null?void 0:y.rect)||void 0,(T=this.vNodes)==null||T.setInfo(f,{rect:I,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:I&&$t.getCenterPos(I,u)}),I));case 2:return _context23.a(2);}},_callee21,this);}));function consumeServiceAsync(_x29){return _consumeServiceAsync.apply(this,arguments);}return consumeServiceAsync;}()},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"getScaleType",value:function getScaleType(t){var r=t.uniformScale,n=t.rotate;return r!==!1||n&&Math.abs(n)%90>0?Ce.proportional:Ce.all;}},{key:"updateNodeOpt",value:function updateNodeOpt(t){var r=t.node,n=t.opt,s=t.vNodes,c=t.targetNode,l=n.translate,f=n.originPoint,u=n.scenePoint,v=n.scale,h=n.angle,y=n.isLocked,T=n.zIndex,O=n.strokeColor,I=c&&fr(c)||s.get(r.name);if(!I)return;var P=r.parent;if(P){if(O&&(I.opt.strokeColor=O),_e(T)&&(r.setAttribute("zIndex",T),I.opt.zIndex=T),zn(y)&&(I.opt.locked=y),f&&u&&v&&l){var _I$opt=I.opt,_w39=_I$opt.centerX,_d38=_I$opt.centerY,m=_I$opt.width,p=_I$opt.height,S=_I$opt.uniformScale,E=S!==!1?[v[0],v[0]]:v,R=[_w39,_d38],D=[_w39,_d38];Co(D,u,E,l);var U=[D[0]-R[0],D[1]-R[1]];if(I.centerPos=[I.centerPos[0]+U[0],I.centerPos[1]+U[1]],I.opt.width=Math.round(m*E[0]),I.opt.height=Math.round(p*E[1]),I.opt.centerX=D[0],I.opt.centerY=D[1],I.opt.eraserlines){var _iterator29=_createForOfIteratorHelper(I.opt.eraserlines),_step29;try{for(_iterator29.s();!(_step29=_iterator29.n()).done;){var M=_step29.value;var W=M.op,$=M.thickness;M.thickness=Math.round($*Math.max(v[0],v[1]));for(var B=0;B<W.length;B++)Dl(W[B],u,v,l);}}catch(err){_iterator29.e(err);}finally{_iterator29.f();}}}else if(l){if(I.opt.centerX=I.opt.centerX+l[0],I.opt.centerY=I.opt.centerY+l[1],I.centerPos=[I.centerPos[0]+l[0],I.centerPos[1]+l[1]],I.opt.eraserlines){var _iterator30=_createForOfIteratorHelper(I.opt.eraserlines),_step30;try{for(_iterator30.s();!(_step30=_iterator30.n()).done;){var _w40=_step30.value;var _d39=_w40.op;for(var _m10=0;_m10<_d39.length;_m10++){var _p12=_d39[_m10].map(function(S,E){return E%2?S+l[1]:S+l[0];});_w40.op[_m10]=_p12;}}}catch(err){_iterator30.e(err);}finally{_iterator30.f();}}}else if(_e(h))if(I.opt.rotate=h,I.scaleType=Hi.getScaleType(I.opt),c){var _w41=bl(I.rect,h);I.rect=_w41;}else{var _w42=$t.getRectFromLayer(P,r.name);I.rect=_w42||I.rect;}return I&&s.setInfo(r.name,I),I==null?void 0:I.rect;}}}]);}($t);var Dh=/*#__PURE__*/function(_$t10){function Dh(t){var _this79;_classCallCheck(this,Dh);_this79=_callSuper(this,Dh,[t]);dt(_this79,"canRotate",!1);dt(_this79,"scaleType",Ce.both);dt(_this79,"toolsType",Tt.Straight);dt(_this79,"tmpPoints",[]);dt(_this79,"workOptions");dt(_this79,"oldRect");dt(_this79,"straightTipWidth");dt(_this79,"syncTimestamp");_this79.workOptions=t.toolsOpt,_this79.straightTipWidth=_this79.workOptions.thickness/2,_this79.syncTimestamp=0,_this79.syncUnitTime=50;return _this79;}_inherits(Dh,_$t10);return _createClass(Dh,[{key:"consume",value:function consume(t){var r=t.data,n=t.isFullWork,s=t.isSubWorker,c=t.isMainThread,l=t.smoothSync,f=t.isSimpleWorker,u=this.workId,v=r.op,h=r.syncUnitTime,y=v==null?void 0:v.length;if(!y||y<2)return{type:vt.None};h&&(this.syncUnitTime=h);var T;if(this.tmpPoints.length===0?(this.tmpPoints=[new Jt(v[0],v[1])],T=!1):T=this.updateTempPoints(v),!T)return{type:vt.None};var O;if(s||c||f){var P=n?this.fullLayer:this.drawLayer||this.fullLayer;O=this.draw({workId:u,layer:P});}if(f){var _P17=Zt(O,this.oldRect);this.oldRect=O;var _w43=_objectSpread({rect:_P17,type:vt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);if(l){var _d40=Date.now();_d40-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=_d40,_w43.op=this.tmpPoints.map(function(m){return[].concat(_toConsumableArray(m.XY),[0]);}).flat(1),_w43.index=0,_w43.isSync=!0);}return _w43;}if(!s&&l){var _P18=Date.now();return _P18-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_P18,_objectSpread({type:vt.DrawWork,dataType:Kt.Local,op:this.tmpPoints.map(function(w){return[].concat(_toConsumableArray(w.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:vt.None};}var I=Zt(O,this.oldRect);return this.oldRect=O,_objectSpread({rect:I,type:vt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var l;var t=this.workId;if(this.tmpPoints.length<2)return{type:vt.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r});this.oldRect=n;var s=this.tmpPoints.map(function(f){return[].concat(_toConsumableArray(f.XY),[0]);}).flat(1),c=mr(s);return(l=this.vNodes)==null||l.setInfo(t,{rect:n,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&$t.getCenterPos(n,r)}),_objectSpread(_objectSpread({rect:n,type:vt.FullWork,dataType:Kt.Local,ops:c,isSync:!0},this.baseConsumeResult),{},{updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(t){var r=t.workId,n=t.layer,_t$isDrawEraserlines6=t.isDrawEraserlines,s=_t$isDrawEraserlines6===void 0?!0:_t$isDrawEraserlines6,_this$workOptions13=this.workOptions,c=_this$workOptions13.strokeColor,l=_this$workOptions13.thickness,f=_this$workOptions13.zIndex,u=_this$workOptions13.scale,v=_this$workOptions13.rotate,h=_this$workOptions13.translate,y=_this$workOptions13.strokeType,T=_this$workOptions13.eraserlines,O=_this$workOptions13.lineCap,I=_this$workOptions13.lineDash,P=n.worldPosition,w=n.worldScaling,_this$computDrawPoint9=this.computDrawPoints(l,y),d=_this$computDrawPoint9.d,m=_this$computDrawPoint9.rect,p=_this$computDrawPoint9.isDot,S=[m.x+m.w/2,m.y+m.h/2],E=new cr({pos:S,anchor:[0.5,0.5],size:[m.w,m.h],name:r,id:r,normalize:!0,zIndex:f}),R={pos:[0,0],normalize:!0,d:d,fillColor:c,strokeColor:c,lineDash:p?void 0:y===Ae.Dotted?[I&&I[0]||1,(I&&I[1]||2)*l]:y===Ae.LongDotted?[(I&&I[0]||1)*l,(I&&I[1]||2)*l]:void 0,lineCap:p?void 0:O,lineWidth:y===Ae.Normal||p?0:l};u&&(R.scale=u),v&&(R.rotate=v),h&&(R.translate=h);var D=new Ln(R);E.append(D),T&&(this.scaleType=Ce.proportional,this.drawEraserlines({group:E,eraserlines:T,pos:S,layer:n},s)),this.replace(n,r,E);var U={x:Math.floor(m.x*w[0]+P[0]-$t.SafeBorderPadding),y:Math.floor(m.y*w[1]+P[1]-$t.SafeBorderPadding),w:Math.floor(m.w*w[0]+2*$t.SafeBorderPadding),h:Math.floor(m.h*w[1]+2*$t.SafeBorderPadding)};if(v||u||h){var M=D.getBoundingClientRect();U={x:Math.floor(M.x-$t.SafeBorderPadding),y:Math.floor(M.y-$t.SafeBorderPadding),w:Math.floor(M.width+$t.SafeBorderPadding*2),h:Math.floor(M.height+$t.SafeBorderPadding*2)};}return this.isDelete&&E.setAttribute("opacity",0),U;}},{key:"computDrawPoints",value:function computDrawPoints(t,r){return this.tmpPoints[1].distance(this.tmpPoints[0])>this.straightTipWidth?this.computFullPoints(t,r):this.computDotPoints(t);}},{key:"computFullPoints",value:function computFullPoints(t,r){var n=pt.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),s=pt.Per(n).mul(t/2),c=Jt.Sub(this.tmpPoints[0],s),l=Jt.Add(this.tmpPoints[0],s),f=Jt.Sub(this.tmpPoints[1],s),u=Jt.Add(this.tmpPoints[1],s),v=Jt.GetSemicircleStroke(this.tmpPoints[1],f,-1,8),h=Jt.GetSemicircleStroke(this.tmpPoints[0],l,-1,8),y=[c,f].concat(_toConsumableArray(v),[u,l],_toConsumableArray(h));var T;return r!==Ae.Normal?T=Mn(this.tmpPoints,!1):T=Mn(y,!0),{d:T,rect:De(y),isDot:!1,pos:this.tmpPoints[0].XY};}},{key:"computDotPoints",value:function computDotPoints(t){var r=Jt.GetDotStroke(this.tmpPoints[0],t/2,8);return{d:Mn(r,!0),rect:De(r),isDot:!0,pos:this.tmpPoints[0].XY};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=t.slice(-2),n=new Jt(r[0],r[1]),s=this.tmpPoints[0],c=this.workOptions.thickness;if(s.isNear(n,c))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n;}else this.tmpPoints.push(n);return!0;}},{key:"consumeService",value:function consumeService(t){var u,v;var r=t.op,n=t.isFullWork,_t$workState8=t.workState,s=_t$workState8===void 0?te.Done:_t$workState8,c=(u=this.workId)==null?void 0:u.toString();if(!c)return;this.tmpPoints.length=0;for(var h=0;h<r.length;h+=3)this.tmpPoints.push(new Jt(r[h],r[h+1],r[h+2]));var l=n?this.fullLayer:this.drawLayer||this.fullLayer,f=this.draw({workId:c,layer:l,isDrawEraserlines:s===te.Done});return this.oldRect=f,(v=this.vNodes)==null||v.setInfo(c,{rect:f,op:r,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:f&&$t.getCenterPos(f,l)}),f;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var u,v;var r=t.node,n=t.opt,s=t.vNodes,c=n.strokeColor,l=n.strokeType,f=s.get(r.name);return c&&(r.tagName==="GROUP"?r.children.forEach(function(h){h.setAttribute("strokeColor",c),h.getAttribute("fillColor")&&h.setAttribute("fillColor",c);}):(r.setAttribute("strokeColor",c),r.setAttribute("fillColor",c)),(u=f==null?void 0:f.opt)!=null&&u.strokeColor&&(f.opt.strokeColor=c)),l&&f!=null&&f.opt&&(v=f.opt)!=null&&v.strokeType&&(f.opt.strokeType=l),f&&s.setInfo(r.name,f),$t.updateNodeOpt(t);}}]);}($t);var hi="cursorhover",Eu=20,jn="mainView";var Mu={exports:{}},Ve={},hl={exports:{}},kn={};function Nh(){var i={};return i["align-content"]=!1,i["align-items"]=!1,i["align-self"]=!1,i["alignment-adjust"]=!1,i["alignment-baseline"]=!1,i.all=!1,i["anchor-point"]=!1,i.animation=!1,i["animation-delay"]=!1,i["animation-direction"]=!1,i["animation-duration"]=!1,i["animation-fill-mode"]=!1,i["animation-iteration-count"]=!1,i["animation-name"]=!1,i["animation-play-state"]=!1,i["animation-timing-function"]=!1,i.azimuth=!1,i["backface-visibility"]=!1,i.background=!0,i["background-attachment"]=!0,i["background-clip"]=!0,i["background-color"]=!0,i["background-image"]=!0,i["background-origin"]=!0,i["background-position"]=!0,i["background-repeat"]=!0,i["background-size"]=!0,i["baseline-shift"]=!1,i.binding=!1,i.bleed=!1,i["bookmark-label"]=!1,i["bookmark-level"]=!1,i["bookmark-state"]=!1,i.border=!0,i["border-bottom"]=!0,i["border-bottom-color"]=!0,i["border-bottom-left-radius"]=!0,i["border-bottom-right-radius"]=!0,i["border-bottom-style"]=!0,i["border-bottom-width"]=!0,i["border-collapse"]=!0,i["border-color"]=!0,i["border-image"]=!0,i["border-image-outset"]=!0,i["border-image-repeat"]=!0,i["border-image-slice"]=!0,i["border-image-source"]=!0,i["border-image-width"]=!0,i["border-left"]=!0,i["border-left-color"]=!0,i["border-left-style"]=!0,i["border-left-width"]=!0,i["border-radius"]=!0,i["border-right"]=!0,i["border-right-color"]=!0,i["border-right-style"]=!0,i["border-right-width"]=!0,i["border-spacing"]=!0,i["border-style"]=!0,i["border-top"]=!0,i["border-top-color"]=!0,i["border-top-left-radius"]=!0,i["border-top-right-radius"]=!0,i["border-top-style"]=!0,i["border-top-width"]=!0,i["border-width"]=!0,i.bottom=!1,i["box-decoration-break"]=!0,i["box-shadow"]=!0,i["box-sizing"]=!0,i["box-snap"]=!0,i["box-suppress"]=!0,i["break-after"]=!0,i["break-before"]=!0,i["break-inside"]=!0,i["caption-side"]=!1,i.chains=!1,i.clear=!0,i.clip=!1,i["clip-path"]=!1,i["clip-rule"]=!1,i.color=!0,i["color-interpolation-filters"]=!0,i["column-count"]=!1,i["column-fill"]=!1,i["column-gap"]=!1,i["column-rule"]=!1,i["column-rule-color"]=!1,i["column-rule-style"]=!1,i["column-rule-width"]=!1,i["column-span"]=!1,i["column-width"]=!1,i.columns=!1,i.contain=!1,i.content=!1,i["counter-increment"]=!1,i["counter-reset"]=!1,i["counter-set"]=!1,i.crop=!1,i.cue=!1,i["cue-after"]=!1,i["cue-before"]=!1,i.cursor=!1,i.direction=!1,i.display=!0,i["display-inside"]=!0,i["display-list"]=!0,i["display-outside"]=!0,i["dominant-baseline"]=!1,i.elevation=!1,i["empty-cells"]=!1,i.filter=!1,i.flex=!1,i["flex-basis"]=!1,i["flex-direction"]=!1,i["flex-flow"]=!1,i["flex-grow"]=!1,i["flex-shrink"]=!1,i["flex-wrap"]=!1,i["float"]=!1,i["float-offset"]=!1,i["flood-color"]=!1,i["flood-opacity"]=!1,i["flow-from"]=!1,i["flow-into"]=!1,i.font=!0,i["font-family"]=!0,i["font-feature-settings"]=!0,i["font-kerning"]=!0,i["font-language-override"]=!0,i["font-size"]=!0,i["font-size-adjust"]=!0,i["font-stretch"]=!0,i["font-style"]=!0,i["font-synthesis"]=!0,i["font-variant"]=!0,i["font-variant-alternates"]=!0,i["font-variant-caps"]=!0,i["font-variant-east-asian"]=!0,i["font-variant-ligatures"]=!0,i["font-variant-numeric"]=!0,i["font-variant-position"]=!0,i["font-weight"]=!0,i.grid=!1,i["grid-area"]=!1,i["grid-auto-columns"]=!1,i["grid-auto-flow"]=!1,i["grid-auto-rows"]=!1,i["grid-column"]=!1,i["grid-column-end"]=!1,i["grid-column-start"]=!1,i["grid-row"]=!1,i["grid-row-end"]=!1,i["grid-row-start"]=!1,i["grid-template"]=!1,i["grid-template-areas"]=!1,i["grid-template-columns"]=!1,i["grid-template-rows"]=!1,i["hanging-punctuation"]=!1,i.height=!0,i.hyphens=!1,i.icon=!1,i["image-orientation"]=!1,i["image-resolution"]=!1,i["ime-mode"]=!1,i["initial-letters"]=!1,i["inline-box-align"]=!1,i["justify-content"]=!1,i["justify-items"]=!1,i["justify-self"]=!1,i.left=!1,i["letter-spacing"]=!0,i["lighting-color"]=!0,i["line-box-contain"]=!1,i["line-break"]=!1,i["line-grid"]=!1,i["line-height"]=!1,i["line-snap"]=!1,i["line-stacking"]=!1,i["line-stacking-ruby"]=!1,i["line-stacking-shift"]=!1,i["line-stacking-strategy"]=!1,i["list-style"]=!0,i["list-style-image"]=!0,i["list-style-position"]=!0,i["list-style-type"]=!0,i.margin=!0,i["margin-bottom"]=!0,i["margin-left"]=!0,i["margin-right"]=!0,i["margin-top"]=!0,i["marker-offset"]=!1,i["marker-side"]=!1,i.marks=!1,i.mask=!1,i["mask-box"]=!1,i["mask-box-outset"]=!1,i["mask-box-repeat"]=!1,i["mask-box-slice"]=!1,i["mask-box-source"]=!1,i["mask-box-width"]=!1,i["mask-clip"]=!1,i["mask-image"]=!1,i["mask-origin"]=!1,i["mask-position"]=!1,i["mask-repeat"]=!1,i["mask-size"]=!1,i["mask-source-type"]=!1,i["mask-type"]=!1,i["max-height"]=!0,i["max-lines"]=!1,i["max-width"]=!0,i["min-height"]=!0,i["min-width"]=!0,i["move-to"]=!1,i["nav-down"]=!1,i["nav-index"]=!1,i["nav-left"]=!1,i["nav-right"]=!1,i["nav-up"]=!1,i["object-fit"]=!1,i["object-position"]=!1,i.opacity=!1,i.order=!1,i.orphans=!1,i.outline=!1,i["outline-color"]=!1,i["outline-offset"]=!1,i["outline-style"]=!1,i["outline-width"]=!1,i.overflow=!1,i["overflow-wrap"]=!1,i["overflow-x"]=!1,i["overflow-y"]=!1,i.padding=!0,i["padding-bottom"]=!0,i["padding-left"]=!0,i["padding-right"]=!0,i["padding-top"]=!0,i.page=!1,i["page-break-after"]=!1,i["page-break-before"]=!1,i["page-break-inside"]=!1,i["page-policy"]=!1,i.pause=!1,i["pause-after"]=!1,i["pause-before"]=!1,i.perspective=!1,i["perspective-origin"]=!1,i.pitch=!1,i["pitch-range"]=!1,i["play-during"]=!1,i.position=!1,i["presentation-level"]=!1,i.quotes=!1,i["region-fragment"]=!1,i.resize=!1,i.rest=!1,i["rest-after"]=!1,i["rest-before"]=!1,i.richness=!1,i.right=!1,i.rotation=!1,i["rotation-point"]=!1,i["ruby-align"]=!1,i["ruby-merge"]=!1,i["ruby-position"]=!1,i["shape-image-threshold"]=!1,i["shape-outside"]=!1,i["shape-margin"]=!1,i.size=!1,i.speak=!1,i["speak-as"]=!1,i["speak-header"]=!1,i["speak-numeral"]=!1,i["speak-punctuation"]=!1,i["speech-rate"]=!1,i.stress=!1,i["string-set"]=!1,i["tab-size"]=!1,i["table-layout"]=!1,i["text-align"]=!0,i["text-align-last"]=!0,i["text-combine-upright"]=!0,i["text-decoration"]=!0,i["text-decoration-color"]=!0,i["text-decoration-line"]=!0,i["text-decoration-skip"]=!0,i["text-decoration-style"]=!0,i["text-emphasis"]=!0,i["text-emphasis-color"]=!0,i["text-emphasis-position"]=!0,i["text-emphasis-style"]=!0,i["text-height"]=!0,i["text-indent"]=!0,i["text-justify"]=!0,i["text-orientation"]=!0,i["text-overflow"]=!0,i["text-shadow"]=!0,i["text-space-collapse"]=!0,i["text-transform"]=!0,i["text-underline-position"]=!0,i["text-wrap"]=!0,i.top=!1,i.transform=!1,i["transform-origin"]=!1,i["transform-style"]=!1,i.transition=!1,i["transition-delay"]=!1,i["transition-duration"]=!1,i["transition-property"]=!1,i["transition-timing-function"]=!1,i["unicode-bidi"]=!1,i["vertical-align"]=!1,i.visibility=!1,i["voice-balance"]=!1,i["voice-duration"]=!1,i["voice-family"]=!1,i["voice-pitch"]=!1,i["voice-range"]=!1,i["voice-rate"]=!1,i["voice-stress"]=!1,i["voice-volume"]=!1,i.volume=!1,i["white-space"]=!1,i.widows=!1,i.width=!0,i["will-change"]=!1,i["word-break"]=!0,i["word-spacing"]=!0,i["word-wrap"]=!0,i["wrap-flow"]=!1,i["wrap-through"]=!1,i["writing-mode"]=!1,i["z-index"]=!1,i;}function aA(i,e,t){}function lA(i,e,t){}var fA=/javascript\s*\:/img;function cA(i,e){return fA.test(e)?"":e;}kn.whiteList=Nh();kn.getDefaultWhiteList=Nh;kn.onAttr=aA;kn.onIgnoreAttr=lA;kn.safeAttrValue=cA;var uA={indexOf:function indexOf(i,e){var t,r;if(Array.prototype.indexOf)return i.indexOf(e);for(t=0,r=i.length;t<r;t++)if(i[t]===e)return t;return-1;},forEach:function forEach(i,e,t){var r,n;if(Array.prototype.forEach)return i.forEach(e,t);for(r=0,n=i.length;r<n;r++)e.call(t,i[r],r,i);},trim:function trim(i){return String.prototype.trim?i.trim():i.replace(/(^\s*)|(\s*$)/g,"");},trimRight:function trimRight(i){return String.prototype.trimRight?i.trimRight():i.replace(/(\s*$)/g,"");}},Gi=uA;function hA(i,e){i=Gi.trimRight(i),i[i.length-1]!==";"&&(i+=";");var t=i.length,r=!1,n=0,s=0,c="";function l(){if(!r){var v=Gi.trim(i.slice(n,s)),h=v.indexOf(":");if(h!==-1){var y=Gi.trim(v.slice(0,h)),T=Gi.trim(v.slice(h+1));if(y){var O=e(n,c.length,y,T,v);O&&(c+=O+"; ");}}}n=s+1;}for(;s<t;s++){var f=i[s];if(f==="/"&&i[s+1]==="*"){var u=i.indexOf("*/",s+2);if(u===-1)break;s=u+1,n=s+1,r=!1;}else f==="("?r=!0:f===")"?r=!1:f===";"?r||l():f==="\n"&&l();}return Gi.trim(c);}var dA=hA,Vs=kn,pA=dA;function Lu(i){return i==null;}function vA(i){var e={};for(var t in i)e[t]=i[t];return e;}function Bh(i){i=vA(i||{}),i.whiteList=i.whiteList||Vs.whiteList,i.onAttr=i.onAttr||Vs.onAttr,i.onIgnoreAttr=i.onIgnoreAttr||Vs.onIgnoreAttr,i.safeAttrValue=i.safeAttrValue||Vs.safeAttrValue,this.options=i;}Bh.prototype.process=function(i){if(i=i||"",i=i.toString(),!i)return"";var e=this,t=e.options,r=t.whiteList,n=t.onAttr,s=t.onIgnoreAttr,c=t.safeAttrValue,l=pA(i,function(f,u,v,h,y){var T=r[v],O=!1;if(T===!0?O=T:typeof T=="function"?O=T(h):T instanceof RegExp&&(O=T.test(h)),O!==!0&&(O=!1),h=c(v,h),!!h){var I={position:u,sourcePosition:f,source:y,isWhite:O};if(O){var P=n(v,h,I);return Lu(P)?v+":"+h:P;}else{var P=s(v,h,I);if(!Lu(P))return P;}}});return l;};var gA=Bh;(function(i,e){var t=kn,r=gA;function n(c,l){var f=new r(l);return f.process(c);}e=i.exports=n,e.FilterCSS=r;for(var s in t)e[s]=t[s];(typeof window==="undefined"?"undefined":_typeof(window))<"u"&&(window.filterCSS=i.exports);})(hl,hl.exports);var Ll=hl.exports,Rl={indexOf:function indexOf(i,e){var t,r;if(Array.prototype.indexOf)return i.indexOf(e);for(t=0,r=i.length;t<r;t++)if(i[t]===e)return t;return-1;},forEach:function forEach(i,e,t){var r,n;if(Array.prototype.forEach)return i.forEach(e,t);for(r=0,n=i.length;r<n;r++)e.call(t,i[r],r,i);},trim:function trim(i){return String.prototype.trim?i.trim():i.replace(/(^\s*)|(\s*$)/g,"");},spaceIndex:function spaceIndex(i){var e=/\s|\n|\t/,t=e.exec(i);return t?t.index:-1;}},mA=Ll.FilterCSS,yA=Ll.getDefaultWhiteList,so=Rl;function Wh(){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 Fh=new mA();function PA(i,e,t){}function SA(i,e,t){}function xA(i,e,t){}function TA(i,e,t){}function Uh(i){return i.replace(IA,"<").replace(wA,">");}function CA(i,e,t,r){if(t=Gh(t),e==="href"||e==="src"){if(t=so.trim(t),t==="#")return"#";if(!(t.substr(0,7)==="http://"||t.substr(0,8)==="https://"||t.substr(0,7)==="mailto:"||t.substr(0,4)==="tel:"||t.substr(0,11)==="data:image/"||t.substr(0,6)==="ftp://"||t.substr(0,2)==="./"||t.substr(0,3)==="../"||t[0]==="#"||t[0]==="/"))return"";}else if(e==="background"){if(Ks.lastIndex=0,Ks.test(t))return"";}else if(e==="style"){if(Ru.lastIndex=0,Ru.test(t)||(bu.lastIndex=0,bu.test(t)&&(Ks.lastIndex=0,Ks.test(t))))return"";r!==!1&&(r=r||Fh,t=r.process(t));}return t=kh(t),t;}var IA=/</g,wA=/>/g,OA=/"/g,AA=/"/g,EA=/&#([a-zA-Z0-9]*);?/gim,MA=/:?/gim,LA=/&newline;?/gim,Ks=/((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,Ru=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,bu=/u\s*r\s*l\s*\(.*/gi;function Yh(i){return i.replace(OA,""");}function $h(i){return i.replace(AA,'"');}function Xh(i){return i.replace(EA,function(t,r){return r[0]==="x"||r[0]==="X"?String.fromCharCode(parseInt(r.substr(1),16)):String.fromCharCode(parseInt(r,10));});}function zh(i){return i.replace(MA,":").replace(LA," ");}function jh(i){for(var e="",t=0,r=i.length;t<r;t++)e+=i.charCodeAt(t)<32?" ":i.charAt(t);return so.trim(e);}function Gh(i){return i=$h(i),i=Xh(i),i=zh(i),i=jh(i),i;}function kh(i){return i=Yh(i),i=Uh(i),i;}function RA(){return"";}function bA(i,e){typeof e!="function"&&(e=function e(){});var t=!Array.isArray(i);function r(c){return t?!0:so.indexOf(i,c)!==-1;}var n=[],s=!1;return{onIgnoreTag:function onIgnoreTag(c,l,f){if(r(c)){if(f.isClosing){var u="[/removed]",v=f.position+u.length;return n.push([s!==!1?s:f.position,v]),s=!1,u;}else return s||(s=f.position),"[removed]";}else return e(c,l,f);},remove:function remove(c){var l="",f=0;return so.forEach(n,function(u){l+=c.slice(f,u[0]),f=u[1];}),l+=c.slice(f),l;}};}function DA(i){for(var e="",t=0;t<i.length;){var r=i.indexOf("<!--",t);if(r===-1){e+=i.slice(t);break;}e+=i.slice(t,r);var n=i.indexOf("-->",r);if(n===-1)break;t=n+3;}return e;}function NA(i){var e=i.split("");return e=e.filter(function(t){var r=t.charCodeAt(0);return r===127?!1:r<=31?r===10||r===13:!0;}),e.join("");}Ve.whiteList=Wh();Ve.getDefaultWhiteList=Wh;Ve.onTag=PA;Ve.onIgnoreTag=SA;Ve.onTagAttr=xA;Ve.onIgnoreTagAttr=TA;Ve.safeAttrValue=CA;Ve.escapeHtml=Uh;Ve.escapeQuote=Yh;Ve.unescapeQuote=$h;Ve.escapeHtmlEntities=Xh;Ve.escapeDangerHtml5Entities=zh;Ve.clearNonPrintableCharacter=jh;Ve.friendlyAttrValue=Gh;Ve.escapeAttrValue=kh;Ve.onIgnoreTagStripAll=RA;Ve.StripTagBody=bA;Ve.stripCommentTag=DA;Ve.stripBlankChar=NA;Ve.attributeWrapSign='"';Ve.cssFilter=Fh;Ve.getDefaultCSSWhiteList=yA;var xo={},An=Rl;function BA(i){var e=An.spaceIndex(i),t;return e===-1?t=i.slice(1,-1):t=i.slice(1,e+1),t=An.trim(t).toLowerCase(),t.slice(0,1)==="/"&&(t=t.slice(1)),t.slice(-1)==="/"&&(t=t.slice(0,-1)),t;}function WA(i){return i.slice(0,2)==="</";}function FA(i,e,t){var r="",n=0,s=!1,c=!1,l=0,f=i.length,u="",v="";t:for(l=0;l<f;l++){var h=i.charAt(l);if(s===!1){if(h==="<"){s=l;continue;}}else if(c===!1){if(h==="<"){r+=t(i.slice(n,l)),s=l,n=l;continue;}if(h===">"||l===f-1){r+=t(i.slice(n,s)),v=i.slice(s,l+1),u=BA(v),r+=e(s,r.length,u,v,WA(v)),n=l+1,s=!1;continue;}if(h==='"'||h==="'")for(var y=1,T=i.charAt(l-y);T.trim()===""||T==="=";){if(T==="="){c=h;continue t;}T=i.charAt(l-++y);}}else if(h===c){c=!1;continue;}}return n<f&&(r+=t(i.substr(n))),r;}var UA=/[^a-zA-Z0-9\\_:.-]/gim;function YA(i,e){var t=0,r=0,n=[],s=!1,c=i.length;function l(y,T){if(y=An.trim(y),y=y.replace(UA,"").toLowerCase(),!(y.length<1)){var O=e(y,T||"");O&&n.push(O);}}for(var f=0;f<c;f++){var u=i.charAt(f),v,h;if(s===!1&&u==="="){s=i.slice(t,f),t=f+1,r=i.charAt(t)==='"'||i.charAt(t)==="'"?t:XA(i,f+1);continue;}if(s!==!1&&f===r){if(h=i.indexOf(u,f+1),h===-1)break;v=An.trim(i.slice(r+1,h)),l(s,v),s=!1,f=h,t=f+1;continue;}if(/\s|\n|\t/.test(u))if(i=i.replace(/\s|\n|\t/g," "),s===!1){if(h=$A(i,f),h===-1){v=An.trim(i.slice(t,f)),l(v),s=!1,t=f+1;continue;}else{f=h-1;continue;}}else if(h=zA(i,f-1),h===-1){v=An.trim(i.slice(t,f)),v=Du(v),l(s,v),s=!1,t=f+1;continue;}else continue;}return t<i.length&&(s===!1?l(i.slice(t)):l(s,Du(An.trim(i.slice(t))))),An.trim(n.join(" "));}function $A(i,e){for(;e<i.length;e++){var t=i[e];if(t!==" ")return t==="="?e:-1;}}function XA(i,e){for(;e<i.length;e++){var t=i[e];if(t!==" ")return t==="'"||t==='"'?e:-1;}}function zA(i,e){for(;e>0;e--){var t=i[e];if(t!==" ")return t==="="?e:-1;}}function jA(i){return i[0]==='"'&&i[i.length-1]==='"'||i[0]==="'"&&i[i.length-1]==="'";}function Du(i){return jA(i)?i.substr(1,i.length-2):i;}xo.parseTag=FA;xo.parseAttr=YA;var GA=Ll.FilterCSS,$r=Ve,Hh=xo,kA=Hh.parseTag,HA=Hh.parseAttr,qs=Rl;function Zs(i){return i==null;}function VA(i){var e=qs.spaceIndex(i);if(e===-1)return{html:"",closing:i[i.length-2]==="/"};i=qs.trim(i.slice(e+1,-1));var t=i[i.length-1]==="/";return t&&(i=qs.trim(i.slice(0,-1))),{html:i,closing:t};}function KA(i){var e={};for(var t in i)e[t]=i[t];return e;}function ZA(i){var e={};for(var t in i)Array.isArray(i[t])?e[t.toLowerCase()]=i[t].map(function(r){return r.toLowerCase();}):e[t.toLowerCase()]=i[t];return e;}function Vh(i){i=KA(i||{}),i.stripIgnoreTag&&(i.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),i.onIgnoreTag=$r.onIgnoreTagStripAll),i.whiteList||i.allowList?i.whiteList=ZA(i.whiteList||i.allowList):i.whiteList=$r.whiteList,this.attributeWrapSign=i.singleQuotedAttributeValue===!0?"'":$r.attributeWrapSign,i.onTag=i.onTag||$r.onTag,i.onTagAttr=i.onTagAttr||$r.onTagAttr,i.onIgnoreTag=i.onIgnoreTag||$r.onIgnoreTag,i.onIgnoreTagAttr=i.onIgnoreTagAttr||$r.onIgnoreTagAttr,i.safeAttrValue=i.safeAttrValue||$r.safeAttrValue,i.escapeHtml=i.escapeHtml||$r.escapeHtml,this.options=i,i.css===!1?this.cssFilter=!1:(i.css=i.css||{},this.cssFilter=new GA(i.css));}Vh.prototype.process=function(i){if(i=i||"",i=i.toString(),!i)return"";var e=this,t=e.options,r=t.whiteList,n=t.onTag,s=t.onIgnoreTag,c=t.onTagAttr,l=t.onIgnoreTagAttr,f=t.safeAttrValue,u=t.escapeHtml,v=e.attributeWrapSign,h=e.cssFilter;t.stripBlankChar&&(i=$r.stripBlankChar(i)),t.allowCommentTag||(i=$r.stripCommentTag(i));var y=!1;t.stripIgnoreTagBody&&(y=$r.StripTagBody(t.stripIgnoreTagBody,s),s=y.onIgnoreTag);var T=kA(i,function(O,I,P,w,d){var m={sourcePosition:O,position:I,isClosing:d,isWhite:Object.prototype.hasOwnProperty.call(r,P)},p=n(P,w,m);if(!Zs(p))return p;if(m.isWhite){if(m.isClosing)return"</"+P+">";var S=VA(w),E=r[P],R=HA(S.html,function(D,U){var M=qs.indexOf(E,D)!==-1,W=c(P,D,U,M);return Zs(W)?M?(U=f(P,D,U,h),U?D+"="+v+U+v:D):(W=l(P,D,U,M),Zs(W)?void 0:W):W;});return w="<"+P,R&&(w+=" "+R),S.closing&&(w+=" /"),w+=">",w;}else return p=s(P,w,m),Zs(p)?u(w):p;},u);return y&&(T=y.remove(T)),T;};var JA=Vh;(function(i,e){var t=Ve,r=xo,n=JA;function s(l,f){var u=new n(f);return u.process(l);}e=i.exports=s,e.filterXSS=s,e.FilterXSS=n,function(){for(var l in t)e[l]=t[l];for(var f in r)e[f]=r[f];}(),(typeof window==="undefined"?"undefined":_typeof(window))<"u"&&(window.filterXSS=i.exports);function c(){return(typeof self==="undefined"?"undefined":_typeof(self))<"u"&&(typeof DedicatedWorkerGlobalScope==="undefined"?"undefined":_typeof(DedicatedWorkerGlobalScope))<"u"&&self instanceof DedicatedWorkerGlobalScope;}c()&&(self.filterXSS=i.exports);})(Mu,Mu.exports);var oo={exports:{}};/**
|
|
437
|
+
* @license
|
|
438
|
+
* Lodash <https://lodash.com/>
|
|
439
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
440
|
+
* Released under MIT license <https://lodash.com/license>
|
|
441
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
442
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
443
|
+
*/oo.exports;(function(i,e){(function(){var t,r="4.18.1",n=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",l="Invalid `variable` option passed into `_.template`",f="Invalid `imports` option passed into `_.template`",u="__lodash_hash_undefined__",v=500,h="__lodash_placeholder__",y=1,T=2,O=4,I=1,P=2,w=1,d=2,m=4,p=8,S=16,E=32,R=64,D=128,U=256,M=512,W=30,$="...",B=800,N=16,z=1,J=2,et=3,at=1/0,ct=9007199254740991,V=17976931348623157e292,Q=NaN,ft=4294967295,mt=ft-1,yt=ft>>>1,At=[["ary",D],["bind",w],["bindKey",d],["curry",p],["curryRight",S],["flip",M],["partial",E],["partialRight",R],["rearg",U]],ht="[object Arguments]",Nt="[object Array]",Bt="[object AsyncFunction]",G="[object Boolean]",k="[object Date]",rt="[object DOMException]",nt="[object Error]",Y="[object Function]",Z="[object GeneratorFunction]",C="[object Map]",L="[object Number]",X="[object Null]",K="[object Object]",q="[object Promise]",it="[object Proxy]",ut="[object RegExp]",St="[object Set]",Ct="[object String]",Et="[object Symbol]",bt="[object Undefined]",wt="[object WeakMap]",Ot="[object WeakSet]",Lt="[object ArrayBuffer]",Yt="[object DataView]",zt="[object Float32Array]",Wt="[object Float64Array]",Qt="[object Int8Array]",ue="[object Int16Array]",ie="[object Int32Array]",ne="[object Uint8Array]",ae="[object Uint8ClampedArray]",se="[object Uint16Array]",We="[object Uint32Array]",Fe=/\b__p \+= '';/g,$e=/\b(__p \+=) '' \+/g,Xe=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ge=/&(?:amp|lt|gt|quot|#39);/g,ke=/[&<>"']/g,Je=RegExp(Ge.source),we=RegExp(ke.source),ur=/<%-([\s\S]+?)%>/g,rn=/<%([\s\S]+?)%>/g,Kr=/<%=([\s\S]+?)%>/g,Hn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Vn=/^\w*$/,Io=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ii=/[\\^$.*+?()[\]{}|]/g,wo=RegExp(Ii.source),wi=/^\s+/,Oo=/\s/,Ao=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Eo=/\{\n\/\* \[wrapped with (.+)\] \*/,Mo=/,? & /,Lo=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ts=/[()=,{}\[\]\/\s]/,Ro=/\\(\\)?/g,bo=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,vn=/\w*$/,es=/^[-+]0x[0-9a-f]+$/i,Do=/^0b[01]+$/i,No=/^\[object .+?Constructor\]$/,Bo=/^0o[0-7]+$/i,Wo=/^(?:0|[1-9]\d*)$/,Fo=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Xr=/($^)/,Uo=/['\n\r\u2028\u2029\\]/g,Kn="\\ud800-\\udfff",Yo="\\u0300-\\u036f",$o="\\ufe20-\\ufe2f",Xo="\\u20d0-\\u20ff",rs=Yo+$o+Xo,ns="\\u2700-\\u27bf",is="a-z\\xdf-\\xf6\\xf8-\\xff",zo="\\xac\\xb1\\xd7\\xf7",nr="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",jo="\\u2000-\\u206f",Go=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ss="A-Z\\xc0-\\xd6\\xd8-\\xde",ge="\\ufe0e\\ufe0f",Oi=zo+nr+jo+Go,Ai="['’]",ko="["+Kn+"]",os="["+Oi+"]",Zn="["+rs+"]",a="\\d+",x="["+ns+"]",A="["+is+"]",F="[^"+Kn+Oi+a+ns+is+ss+"]",j="\\ud83c[\\udffb-\\udfff]",_="(?:"+Zn+"|"+j+")",st="[^"+Kn+"]",Pt="(?:\\ud83c[\\udde6-\\uddff]){2}",xt="[\\ud800-\\udbff][\\udc00-\\udfff]",Dt="["+ss+"]",Ht="\\u200d",jt="(?:"+A+"|"+F+")",qt="(?:"+Dt+"|"+F+")",oe="(?:"+Ai+"(?:d|ll|m|re|s|t|ve))?",me="(?:"+Ai+"(?:D|LL|M|RE|S|T|VE))?",Pe=_+"?",Le="["+ge+"]?",or="(?:"+Ht+"(?:"+[st,Pt,xt].join("|")+")"+Le+Pe+")*",br="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",gn="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",as=Le+Pe+or,Ho="(?:"+[x,Pt,xt].join("|")+")"+as,mn="(?:"+[st+Zn+"?",Zn,Pt,xt,ko].join("|")+")",fd=RegExp(Ai,"g"),cd=RegExp(Zn,"g"),Vo=RegExp(j+"(?="+j+")|"+mn+as,"g"),ud=RegExp([Dt+"?"+A+"+"+oe+"(?="+[os,Dt,"$"].join("|")+")",qt+"+"+me+"(?="+[os,Dt+jt,"$"].join("|")+")",Dt+"?"+jt+"+"+oe,Dt+"+"+me,gn,br,a,Ho].join("|"),"g"),hd=RegExp("["+Ht+Kn+rs+ge+"]"),dd=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,pd=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],vd=-1,ze={};ze[zt]=ze[Wt]=ze[Qt]=ze[ue]=ze[ie]=ze[ne]=ze[ae]=ze[se]=ze[We]=!0,ze[ht]=ze[Nt]=ze[Lt]=ze[G]=ze[Yt]=ze[k]=ze[nt]=ze[Y]=ze[C]=ze[L]=ze[K]=ze[ut]=ze[St]=ze[Ct]=ze[wt]=!1;var Ue={};Ue[ht]=Ue[Nt]=Ue[Lt]=Ue[Yt]=Ue[G]=Ue[k]=Ue[zt]=Ue[Wt]=Ue[Qt]=Ue[ue]=Ue[ie]=Ue[C]=Ue[L]=Ue[K]=Ue[ut]=Ue[St]=Ue[Ct]=Ue[Et]=Ue[ne]=Ue[ae]=Ue[se]=Ue[We]=!0,Ue[nt]=Ue[Y]=Ue[wt]=!1;var gd={// Latin-1 Supplement block.
|
|
444
|
+
À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",// Latin Extended-A block.
|
|
445
|
+
Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},md={"&":"&","<":"<",">":">",'"':""","'":"'"},yd={"&":"&","<":"<",">":">",""":'"',"'":"'"},Pd={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Sd=parseFloat,xd=parseInt,Bl=_typeof(hn)=="object"&&hn&&hn.Object===Object&&hn,Td=(typeof self==="undefined"?"undefined":_typeof(self))=="object"&&self&&self.Object===Object&&self,ir=Bl||Td||Function("return this")(),Ko=e&&!e.nodeType&&e,bn=Ko&&!0&&i&&!i.nodeType&&i,Wl=bn&&bn.exports===Ko,Zo=Wl&&Bl.process,Dr=function(){try{var Mt=bn&&bn.require&&bn.require("util").types;return Mt||Zo&&Zo.binding&&Zo.binding("util");}catch(_unused22){}}(),Fl=Dr&&Dr.isArrayBuffer,Ul=Dr&&Dr.isDate,Yl=Dr&&Dr.isMap,$l=Dr&&Dr.isRegExp,Xl=Dr&&Dr.isSet,zl=Dr&&Dr.isTypedArray;function Cr(Mt,Xt,Ft){switch(Ft.length){case 0:return Mt.call(Xt);case 1:return Mt.call(Xt,Ft[0]);case 2:return Mt.call(Xt,Ft[0],Ft[1]);case 3:return Mt.call(Xt,Ft[0],Ft[1],Ft[2]);}return Mt.apply(Xt,Ft);}function Cd(Mt,Xt,Ft,ee){for(var he=-1,Ee=Mt==null?0:Mt.length;++he<Ee;){var tr=Mt[he];Xt(ee,tr,Ft(tr),Mt);}return ee;}function Ir(Mt,Xt){for(var Ft=-1,ee=Mt==null?0:Mt.length;++Ft<ee&&Xt(Mt[Ft],Ft,Mt)!==!1;);return Mt;}function Id(Mt,Xt){for(var Ft=Mt==null?0:Mt.length;Ft--&&Xt(Mt[Ft],Ft,Mt)!==!1;);return Mt;}function jl(Mt,Xt){for(var Ft=-1,ee=Mt==null?0:Mt.length;++Ft<ee;)if(!Xt(Mt[Ft],Ft,Mt))return!1;return!0;}function yn(Mt,Xt){for(var Ft=-1,ee=Mt==null?0:Mt.length,he=0,Ee=[];++Ft<ee;){var tr=Mt[Ft];Xt(tr,Ft,Mt)&&(Ee[he++]=tr);}return Ee;}function ls(Mt,Xt){var Ft=Mt==null?0:Mt.length;return!!Ft&&Jn(Mt,Xt,0)>-1;}function Jo(Mt,Xt,Ft){for(var ee=-1,he=Mt==null?0:Mt.length;++ee<he;)if(Ft(Xt,Mt[ee]))return!0;return!1;}function He(Mt,Xt){for(var Ft=-1,ee=Mt==null?0:Mt.length,he=Array(ee);++Ft<ee;)he[Ft]=Xt(Mt[Ft],Ft,Mt);return he;}function Pn(Mt,Xt){for(var Ft=-1,ee=Xt.length,he=Mt.length;++Ft<ee;)Mt[he+Ft]=Xt[Ft];return Mt;}function Qo(Mt,Xt,Ft,ee){var he=-1,Ee=Mt==null?0:Mt.length;for(ee&&Ee&&(Ft=Mt[++he]);++he<Ee;)Ft=Xt(Ft,Mt[he],he,Mt);return Ft;}function wd(Mt,Xt,Ft,ee){var he=Mt==null?0:Mt.length;for(ee&&he&&(Ft=Mt[--he]);he--;)Ft=Xt(Ft,Mt[he],he,Mt);return Ft;}function qo(Mt,Xt){for(var Ft=-1,ee=Mt==null?0:Mt.length;++Ft<ee;)if(Xt(Mt[Ft],Ft,Mt))return!0;return!1;}var Od=_o("length");function Ad(Mt){return Mt.split("");}function Ed(Mt){return Mt.match(Lo)||[];}function Gl(Mt,Xt,Ft){var ee;return Ft(Mt,function(he,Ee,tr){if(Xt(he,Ee,tr))return ee=Ee,!1;}),ee;}function fs(Mt,Xt,Ft,ee){for(var he=Mt.length,Ee=Ft+(ee?1:-1);ee?Ee--:++Ee<he;)if(Xt(Mt[Ee],Ee,Mt))return Ee;return-1;}function Jn(Mt,Xt,Ft){return Xt===Xt?$d(Mt,Xt,Ft):fs(Mt,kl,Ft);}function Md(Mt,Xt,Ft,ee){for(var he=Ft-1,Ee=Mt.length;++he<Ee;)if(ee(Mt[he],Xt))return he;return-1;}function kl(Mt){return Mt!==Mt;}function Hl(Mt,Xt){var Ft=Mt==null?0:Mt.length;return Ft?ea(Mt,Xt)/Ft:Q;}function _o(Mt){return function(Xt){return Xt==null?t:Xt[Mt];};}function ta(Mt){return function(Xt){return Mt==null?t:Mt[Xt];};}function Vl(Mt,Xt,Ft,ee,he){return he(Mt,function(Ee,tr,Be){Ft=ee?(ee=!1,Ee):Xt(Ft,Ee,tr,Be);}),Ft;}function Ld(Mt,Xt){var Ft=Mt.length;for(Mt.sort(Xt);Ft--;)Mt[Ft]=Mt[Ft].value;return Mt;}function ea(Mt,Xt){for(var Ft,ee=-1,he=Mt.length;++ee<he;){var Ee=Xt(Mt[ee]);Ee!==t&&(Ft=Ft===t?Ee:Ft+Ee);}return Ft;}function ra(Mt,Xt){for(var Ft=-1,ee=Array(Mt);++Ft<Mt;)ee[Ft]=Xt(Ft);return ee;}function Rd(Mt,Xt){return He(Xt,function(Ft){return[Ft,Mt[Ft]];});}function Kl(Mt){return Mt&&Mt.slice(0,ql(Mt)+1).replace(wi,"");}function wr(Mt){return function(Xt){return Mt(Xt);};}function na(Mt,Xt){return He(Xt,function(Ft){return Mt[Ft];});}function Ei(Mt,Xt){return Mt.has(Xt);}function Zl(Mt,Xt){for(var Ft=-1,ee=Mt.length;++Ft<ee&&Jn(Xt,Mt[Ft],0)>-1;);return Ft;}function Jl(Mt,Xt){for(var Ft=Mt.length;Ft--&&Jn(Xt,Mt[Ft],0)>-1;);return Ft;}function bd(Mt,Xt){for(var Ft=Mt.length,ee=0;Ft--;)Mt[Ft]===Xt&&++ee;return ee;}var Dd=ta(gd),Nd=ta(md);function Bd(Mt){return"\\"+Pd[Mt];}function Wd(Mt,Xt){return Mt==null?t:Mt[Xt];}function Qn(Mt){return hd.test(Mt);}function Fd(Mt){return dd.test(Mt);}function Ud(Mt){for(var Xt,Ft=[];!(Xt=Mt.next()).done;)Ft.push(Xt.value);return Ft;}function ia(Mt){var Xt=-1,Ft=Array(Mt.size);return Mt.forEach(function(ee,he){Ft[++Xt]=[he,ee];}),Ft;}function Ql(Mt,Xt){return function(Ft){return Mt(Xt(Ft));};}function Sn(Mt,Xt){for(var Ft=-1,ee=Mt.length,he=0,Ee=[];++Ft<ee;){var tr=Mt[Ft];(tr===Xt||tr===h)&&(Mt[Ft]=h,Ee[he++]=Ft);}return Ee;}function cs(Mt){var Xt=-1,Ft=Array(Mt.size);return Mt.forEach(function(ee){Ft[++Xt]=ee;}),Ft;}function Yd(Mt){var Xt=-1,Ft=Array(Mt.size);return Mt.forEach(function(ee){Ft[++Xt]=[ee,ee];}),Ft;}function $d(Mt,Xt,Ft){for(var ee=Ft-1,he=Mt.length;++ee<he;)if(Mt[ee]===Xt)return ee;return-1;}function Xd(Mt,Xt,Ft){for(var ee=Ft+1;ee--;)if(Mt[ee]===Xt)return ee;return ee;}function qn(Mt){return Qn(Mt)?jd(Mt):Od(Mt);}function zr(Mt){return Qn(Mt)?Gd(Mt):Ad(Mt);}function ql(Mt){for(var Xt=Mt.length;Xt--&&Oo.test(Mt.charAt(Xt)););return Xt;}var zd=ta(yd);function jd(Mt){for(var Xt=Vo.lastIndex=0;Vo.test(Mt);)++Xt;return Xt;}function Gd(Mt){return Mt.match(Vo)||[];}function kd(Mt){return Mt.match(ud)||[];}var Hd=function Mt(Xt){Xt=Xt==null?ir:_n.defaults(ir.Object(),Xt,_n.pick(ir,pd));var Ft=Xt.Array,ee=Xt.Date,he=Xt.Error,Ee=Xt.Function,tr=Xt.Math,Be=Xt.Object,sa=Xt.RegExp,Vd=Xt.String,Nr=Xt.TypeError,us=Ft.prototype,Kd=Ee.prototype,ti=Be.prototype,hs=Xt["__core-js_shared__"],ds=Kd.toString,Re=ti.hasOwnProperty,Zd=0,_l=function(){var o=/[^.]+$/.exec(hs&&hs.keys&&hs.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:"";}(),ps=ti.toString,Jd=ds.call(Be),Qd=ir._,qd=sa("^"+ds.call(Re).replace(Ii,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),vs=Wl?Xt.Buffer:t,xn=Xt.Symbol,gs=Xt.Uint8Array,tf=vs?vs.allocUnsafe:t,ms=Ql(Be.getPrototypeOf,Be),ef=Be.create,rf=ti.propertyIsEnumerable,ys=us.splice,nf=xn?xn.isConcatSpreadable:t,Mi=xn?xn.iterator:t,Dn=xn?xn.toStringTag:t,Ps=function(){try{var o=Un(Be,"defineProperty");return o({},"",{}),o;}catch(_unused23){}}(),_d=Xt.clearTimeout!==ir.clearTimeout&&Xt.clearTimeout,tp=ee&&ee.now!==ir.Date.now&&ee.now,ep=Xt.setTimeout!==ir.setTimeout&&Xt.setTimeout,Ss=tr.ceil,xs=tr.floor,oa=Be.getOwnPropertySymbols,rp=vs?vs.isBuffer:t,sf=Xt.isFinite,np=us.join,ip=Ql(Be.keys,Be),er=tr.max,ar=tr.min,sp=ee.now,op=Xt.parseInt,of=tr.random,ap=us.reverse,aa=Un(Xt,"DataView"),Li=Un(Xt,"Map"),la=Un(Xt,"Promise"),ei=Un(Xt,"Set"),Ri=Un(Xt,"WeakMap"),bi=Un(Be,"create"),Ts=Ri&&new Ri(),ri={},lp=Yn(aa),fp=Yn(Li),cp=Yn(la),up=Yn(ei),hp=Yn(Ri),Cs=xn?xn.prototype:t,Di=Cs?Cs.valueOf:t,af=Cs?Cs.toString:t;function ot(o){if(Ze(o)&&!de(o)&&!(o instanceof Ie)){if(o instanceof Br)return o;if(Re.call(o,"__wrapped__"))return lc(o);}return new Br(o);}var ni=/* @__PURE__ */function(){function o(){}return function(g){if(!Ke(g))return{};if(ef)return ef(g);o.prototype=g;var b=new o();return o.prototype=t,b;};}();function Is(){}function Br(o,g){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!g,this.__index__=0,this.__values__=t;}ot.templateSettings={/**
|
|
446
|
+
* Used to detect `data` property values to be HTML-escaped.
|
|
447
|
+
*
|
|
448
|
+
* @memberOf _.templateSettings
|
|
449
|
+
* @type {RegExp}
|
|
450
|
+
*/escape:ur,/**
|
|
451
|
+
* Used to detect code to be evaluated.
|
|
452
|
+
*
|
|
453
|
+
* @memberOf _.templateSettings
|
|
454
|
+
* @type {RegExp}
|
|
455
|
+
*/evaluate:rn,/**
|
|
456
|
+
* Used to detect `data` property values to inject.
|
|
457
|
+
*
|
|
458
|
+
* @memberOf _.templateSettings
|
|
459
|
+
* @type {RegExp}
|
|
460
|
+
*/interpolate:Kr,/**
|
|
461
|
+
* Used to reference the data object in the template text.
|
|
462
|
+
*
|
|
463
|
+
* @memberOf _.templateSettings
|
|
464
|
+
* @type {string}
|
|
465
|
+
*/variable:"",/**
|
|
466
|
+
* Used to import variables into the compiled template.
|
|
467
|
+
*
|
|
468
|
+
* @memberOf _.templateSettings
|
|
469
|
+
* @type {Object}
|
|
470
|
+
*/imports:{/**
|
|
471
|
+
* A reference to the `lodash` function.
|
|
472
|
+
*
|
|
473
|
+
* @memberOf _.templateSettings.imports
|
|
474
|
+
* @type {Function}
|
|
475
|
+
*/_:ot}},ot.prototype=Is.prototype,ot.prototype.constructor=ot,Br.prototype=ni(Is.prototype),Br.prototype.constructor=Br;function Ie(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ft,this.__views__=[];}function dp(){var o=new Ie(this.__wrapped__);return o.__actions__=yr(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=yr(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=yr(this.__views__),o;}function pp(){if(this.__filtered__){var o=new Ie(this);o.__dir__=-1,o.__filtered__=!0;}else o=this.clone(),o.__dir__*=-1;return o;}function vp(){var o=this.__wrapped__.value(),g=this.__dir__,b=de(o),H=g<0,tt=b?o.length:0,lt=A0(0,tt,this.__views__),gt=lt.start,It=lt.end,Rt=It-gt,Gt=H?It:gt-1,kt=this.__iteratees__,Vt=kt.length,_t=0,re=ar(Rt,this.__takeCount__);if(!b||!H&&tt==Rt&&re==Rt)return Rf(o,this.__actions__);var ce=[];t:for(;Rt--&&_t<re;){Gt+=g;for(var Se=-1,le=o[Gt];++Se<Vt;){var Te=kt[Se],Oe=Te.iteratee,Er=Te.type,pr=Oe(le);if(Er==J)le=pr;else if(!pr){if(Er==z)continue t;break t;}}ce[_t++]=le;}return ce;}Ie.prototype=ni(Is.prototype),Ie.prototype.constructor=Ie;function Nn(o){var g=-1,b=o==null?0:o.length;for(this.clear();++g<b;){var H=o[g];this.set(H[0],H[1]);}}function gp(){this.__data__=bi?bi(null):{},this.size=0;}function mp(o){var g=this.has(o)&&delete this.__data__[o];return this.size-=g?1:0,g;}function yp(o){var g=this.__data__;if(bi){var b=g[o];return b===u?t:b;}return Re.call(g,o)?g[o]:t;}function Pp(o){var g=this.__data__;return bi?g[o]!==t:Re.call(g,o);}function Sp(o,g){var b=this.__data__;return this.size+=this.has(o)?0:1,b[o]=bi&&g===t?u:g,this;}Nn.prototype.clear=gp,Nn.prototype["delete"]=mp,Nn.prototype.get=yp,Nn.prototype.has=Pp,Nn.prototype.set=Sp;function nn(o){var g=-1,b=o==null?0:o.length;for(this.clear();++g<b;){var H=o[g];this.set(H[0],H[1]);}}function xp(){this.__data__=[],this.size=0;}function Tp(o){var g=this.__data__,b=ws(g,o);if(b<0)return!1;var H=g.length-1;return b==H?g.pop():ys.call(g,b,1),--this.size,!0;}function Cp(o){var g=this.__data__,b=ws(g,o);return b<0?t:g[b][1];}function Ip(o){return ws(this.__data__,o)>-1;}function wp(o,g){var b=this.__data__,H=ws(b,o);return H<0?(++this.size,b.push([o,g])):b[H][1]=g,this;}nn.prototype.clear=xp,nn.prototype["delete"]=Tp,nn.prototype.get=Cp,nn.prototype.has=Ip,nn.prototype.set=wp;function sn(o){var g=-1,b=o==null?0:o.length;for(this.clear();++g<b;){var H=o[g];this.set(H[0],H[1]);}}function Op(){this.size=0,this.__data__={hash:new Nn(),map:new(Li||nn)(),string:new Nn()};}function Ap(o){var g=Fs(this,o)["delete"](o);return this.size-=g?1:0,g;}function Ep(o){return Fs(this,o).get(o);}function Mp(o){return Fs(this,o).has(o);}function Lp(o,g){var b=Fs(this,o),H=b.size;return b.set(o,g),this.size+=b.size==H?0:1,this;}sn.prototype.clear=Op,sn.prototype["delete"]=Ap,sn.prototype.get=Ep,sn.prototype.has=Mp,sn.prototype.set=Lp;function Bn(o){var g=-1,b=o==null?0:o.length;for(this.__data__=new sn();++g<b;)this.add(o[g]);}function Rp(o){return this.__data__.set(o,u),this;}function bp(o){return this.__data__.has(o);}Bn.prototype.add=Bn.prototype.push=Rp,Bn.prototype.has=bp;function jr(o){var g=this.__data__=new nn(o);this.size=g.size;}function Dp(){this.__data__=new nn(),this.size=0;}function Np(o){var g=this.__data__,b=g["delete"](o);return this.size=g.size,b;}function Bp(o){return this.__data__.get(o);}function Wp(o){return this.__data__.has(o);}function Fp(o,g){var b=this.__data__;if(b instanceof nn){var H=b.__data__;if(!Li||H.length<n-1)return H.push([o,g]),this.size=++b.size,this;b=this.__data__=new sn(H);}return b.set(o,g),this.size=b.size,this;}jr.prototype.clear=Dp,jr.prototype["delete"]=Np,jr.prototype.get=Bp,jr.prototype.has=Wp,jr.prototype.set=Fp;function lf(o,g){var b=de(o),H=!b&&$n(o),tt=!b&&!H&&On(o),lt=!b&&!H&&!tt&&ai(o),gt=b||H||tt||lt,It=gt?ra(o.length,Vd):[],Rt=It.length;for(var Gt in o)(g||Re.call(o,Gt))&&!(gt&&(// Safari 9 has enumerable `arguments.length` in strict mode.
|
|
476
|
+
Gt=="length"||// Node.js 0.10 has enumerable non-index properties on buffers.
|
|
477
|
+
tt&&(Gt=="offset"||Gt=="parent")||// PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
478
|
+
lt&&(Gt=="buffer"||Gt=="byteLength"||Gt=="byteOffset")||// Skip index properties.
|
|
479
|
+
ln(Gt,Rt)))&&It.push(Gt);return It;}function ff(o){var g=o.length;return g?o[Pa(0,g-1)]:t;}function Up(o,g){return Us(yr(o),Wn(g,0,o.length));}function Yp(o){return Us(yr(o));}function fa(o,g,b){(b!==t&&!kr(o[g],b)||b===t&&!(g in o))&&Zr(o,g,b);}function Ni(o,g,b){var H=o[g];(!(Re.call(o,g)&&kr(H,b))||b===t&&!(g in o))&&Zr(o,g,b);}function ws(o,g){for(var b=o.length;b--;)if(kr(o[b][0],g))return b;return-1;}function $p(o,g,b,H){return Tn(o,function(tt,lt,gt){g(H,tt,b(tt),gt);}),H;}function cf(o,g){return o&&Qr(g,rr(g),o);}function Xp(o,g){return o&&Qr(g,Sr(g),o);}function Zr(o,g,b){g=="__proto__"&&Ps?Ps(o,g,{configurable:!0,enumerable:!0,value:b,writable:!0}):o[g]=b;}function ca(o,g){for(var b=-1,H=g.length,tt=Ft(H),lt=o==null;++b<H;)tt[b]=lt?t:ka(o,g[b]);return tt;}function Wn(o,g,b){return o===o&&(b!==t&&(o=o<=b?o:b),g!==t&&(o=o>=g?o:g)),o;}function Wr(o,g,b,H,tt,lt){var gt,It=g&y,Rt=g&T,Gt=g&O;if(b&&(gt=tt?b(o,H,tt,lt):b(o)),gt!==t)return gt;if(!Ke(o))return o;var kt=de(o);if(kt){if(gt=M0(o),!It)return yr(o,gt);}else{var Vt=lr(o),_t=Vt==Y||Vt==Z;if(On(o))return Nf(o,It);if(Vt==K||Vt==ht||_t&&!tt){if(gt=Rt||_t?{}:_f(o),!It)return Rt?y0(o,Xp(gt,o)):m0(o,cf(gt,o));}else{if(!Ue[Vt])return tt?o:{};gt=L0(o,Vt,It);}}lt||(lt=new jr());var re=lt.get(o);if(re)return re;lt.set(o,gt),Ec(o)?o.forEach(function(le){gt.add(Wr(le,g,b,le,o,lt));}):Oc(o)&&o.forEach(function(le,Te){gt.set(Te,Wr(le,g,b,Te,o,lt));});var ce=Gt?Rt?La:Ma:Rt?Sr:rr,Se=kt?t:ce(o);return Ir(Se||o,function(le,Te){Se&&(Te=le,le=o[Te]),Ni(gt,Te,Wr(le,g,b,Te,o,lt));}),gt;}function zp(o){var g=rr(o);return function(b){return uf(b,o,g);};}function uf(o,g,b){var H=b.length;if(o==null)return!H;for(o=Be(o);H--;){var tt=b[H],lt=g[tt],gt=o[tt];if(gt===t&&!(tt in o)||!lt(gt))return!1;}return!0;}function hf(o,g,b){if(typeof o!="function")throw new Nr(c);return Xi(function(){o.apply(t,b);},g);}function Bi(o,g,b,H){var tt=-1,lt=ls,gt=!0,It=o.length,Rt=[],Gt=g.length;if(!It)return Rt;b&&(g=He(g,wr(b))),H?(lt=Jo,gt=!1):g.length>=n&&(lt=Ei,gt=!1,g=new Bn(g));t:for(;++tt<It;){var kt=o[tt],Vt=b==null?kt:b(kt);if(kt=H||kt!==0?kt:0,gt&&Vt===Vt){for(var _t=Gt;_t--;)if(g[_t]===Vt)continue t;Rt.push(kt);}else lt(g,Vt,H)||Rt.push(kt);}return Rt;}var Tn=Yf(Jr),df=Yf(ha,!0);function jp(o,g){var b=!0;return Tn(o,function(H,tt,lt){return b=!!g(H,tt,lt),b;}),b;}function Os(o,g,b){for(var H=-1,tt=o.length;++H<tt;){var lt=o[H],gt=g(lt);if(gt!=null&&(It===t?gt===gt&&!Ar(gt):b(gt,It)))var It=gt,Rt=lt;}return Rt;}function Gp(o,g,b,H){var tt=o.length;for(b=ye(b),b<0&&(b=-b>tt?0:tt+b),H=H===t||H>tt?tt:ye(H),H<0&&(H+=tt),H=b>H?0:Lc(H);b<H;)o[b++]=g;return o;}function pf(o,g){var b=[];return Tn(o,function(H,tt,lt){g(H,tt,lt)&&b.push(H);}),b;}function sr(o,g,b,H,tt){var lt=-1,gt=o.length;for(b||(b=b0),tt||(tt=[]);++lt<gt;){var It=o[lt];g>0&&b(It)?g>1?sr(It,g-1,b,H,tt):Pn(tt,It):H||(tt[tt.length]=It);}return tt;}var ua=$f(),vf=$f(!0);function Jr(o,g){return o&&ua(o,g,rr);}function ha(o,g){return o&&vf(o,g,rr);}function As(o,g){return yn(g,function(b){return fn(o[b]);});}function Fn(o,g){g=In(g,o);for(var b=0,H=g.length;o!=null&&b<H;)o=o[Gr(g[b++])];return b&&b==H?o:t;}function gf(o,g,b){var H=g(o);return de(o)?H:Pn(H,b(o));}function hr(o){return o==null?o===t?bt:X:Dn&&Dn in Be(o)?O0(o):Y0(o);}function da(o,g){return o>g;}function kp(o,g){return o!=null&&Re.call(o,g);}function Hp(o,g){return o!=null&&g in Be(o);}function Vp(o,g,b){return o>=ar(g,b)&&o<er(g,b);}function pa(o,g,b){for(var H=b?Jo:ls,tt=o[0].length,lt=o.length,gt=lt,It=Ft(lt),Rt=1/0,Gt=[];gt--;){var kt=o[gt];gt&&g&&(kt=He(kt,wr(g))),Rt=ar(kt.length,Rt),It[gt]=!b&&(g||tt>=120&&kt.length>=120)?new Bn(gt&&kt):t;}kt=o[0];var Vt=-1,_t=It[0];t:for(;++Vt<tt&&Gt.length<Rt;){var re=kt[Vt],ce=g?g(re):re;if(re=b||re!==0?re:0,!(_t?Ei(_t,ce):H(Gt,ce,b))){for(gt=lt;--gt;){var Se=It[gt];if(!(Se?Ei(Se,ce):H(o[gt],ce,b)))continue t;}_t&&_t.push(ce),Gt.push(re);}}return Gt;}function Kp(o,g,b,H){return Jr(o,function(tt,lt,gt){g(H,b(tt),lt,gt);}),H;}function Wi(o,g,b){g=In(g,o),o=nc(o,g);var H=o==null?o:o[Gr(Ur(g))];return H==null?t:Cr(H,o,b);}function mf(o){return Ze(o)&&hr(o)==ht;}function Zp(o){return Ze(o)&&hr(o)==Lt;}function Jp(o){return Ze(o)&&hr(o)==k;}function Fi(o,g,b,H,tt){return o===g?!0:o==null||g==null||!Ze(o)&&!Ze(g)?o!==o&&g!==g:Qp(o,g,b,H,Fi,tt);}function Qp(o,g,b,H,tt,lt){var gt=de(o),It=de(g),Rt=gt?Nt:lr(o),Gt=It?Nt:lr(g);Rt=Rt==ht?K:Rt,Gt=Gt==ht?K:Gt;var kt=Rt==K,Vt=Gt==K,_t=Rt==Gt;if(_t&&On(o)){if(!On(g))return!1;gt=!0,kt=!1;}if(_t&&!kt)return lt||(lt=new jr()),gt||ai(o)?Jf(o,g,b,H,tt,lt):I0(o,g,Rt,b,H,tt,lt);if(!(b&I)){var re=kt&&Re.call(o,"__wrapped__"),ce=Vt&&Re.call(g,"__wrapped__");if(re||ce){var Se=re?o.value():o,le=ce?g.value():g;return lt||(lt=new jr()),tt(Se,le,b,H,lt);}}return _t?(lt||(lt=new jr()),w0(o,g,b,H,tt,lt)):!1;}function qp(o){return Ze(o)&&lr(o)==C;}function va(o,g,b,H){var tt=b.length,lt=tt,gt=!H;if(o==null)return!lt;for(o=Be(o);tt--;){var It=b[tt];if(gt&&It[2]?It[1]!==o[It[0]]:!(It[0]in o))return!1;}for(;++tt<lt;){It=b[tt];var Rt=It[0],Gt=o[Rt],kt=It[1];if(gt&&It[2]){if(Gt===t&&!(Rt in o))return!1;}else{var Vt=new jr();if(H)var _t=H(Gt,kt,Rt,o,g,Vt);if(!(_t===t?Fi(kt,Gt,I|P,H,Vt):_t))return!1;}}return!0;}function yf(o){if(!Ke(o)||N0(o))return!1;var g=fn(o)?qd:No;return g.test(Yn(o));}function _p(o){return Ze(o)&&hr(o)==ut;}function t0(o){return Ze(o)&&lr(o)==St;}function e0(o){return Ze(o)&&Gs(o.length)&&!!ze[hr(o)];}function Pf(o){return typeof o=="function"?o:o==null?xr:_typeof(o)=="object"?de(o)?Tf(o[0],o[1]):xf(o):zc(o);}function ga(o){if(!$i(o))return ip(o);var g=[];for(var b in Be(o))Re.call(o,b)&&b!="constructor"&&g.push(b);return g;}function r0(o){if(!Ke(o))return U0(o);var g=$i(o),b=[];for(var H in o)H=="constructor"&&(g||!Re.call(o,H))||b.push(H);return b;}function ma(o,g){return o<g;}function Sf(o,g){var b=-1,H=Pr(o)?Ft(o.length):[];return Tn(o,function(tt,lt,gt){H[++b]=g(tt,lt,gt);}),H;}function xf(o){var g=ba(o);return g.length==1&&g[0][2]?ec(g[0][0],g[0][1]):function(b){return b===o||va(b,o,g);};}function Tf(o,g){return Na(o)&&tc(g)?ec(Gr(o),g):function(b){var H=ka(b,o);return H===t&&H===g?Ha(b,o):Fi(g,H,I|P);};}function Es(o,g,b,H,tt){o!==g&&ua(g,function(lt,gt){if(tt||(tt=new jr()),Ke(lt))n0(o,g,gt,b,Es,H,tt);else{var It=H?H(Wa(o,gt),lt,gt+"",o,g,tt):t;It===t&&(It=lt),fa(o,gt,It);}},Sr);}function n0(o,g,b,H,tt,lt,gt){var It=Wa(o,b),Rt=Wa(g,b),Gt=gt.get(Rt);if(Gt){fa(o,b,Gt);return;}var kt=lt?lt(It,Rt,b+"",o,g,gt):t,Vt=kt===t;if(Vt){var _t=de(Rt),re=!_t&&On(Rt),ce=!_t&&!re&&ai(Rt);kt=Rt,_t||re||ce?de(It)?kt=It:Qe(It)?kt=yr(It):re?(Vt=!1,kt=Nf(Rt,!0)):ce?(Vt=!1,kt=Bf(Rt,!0)):kt=[]:zi(Rt)||$n(Rt)?(kt=It,$n(It)?kt=Rc(It):(!Ke(It)||fn(It))&&(kt=_f(Rt))):Vt=!1;}Vt&&(gt.set(Rt,kt),tt(kt,Rt,H,lt,gt),gt["delete"](Rt)),fa(o,b,kt);}function Cf(o,g){var b=o.length;if(b)return g+=g<0?b:0,ln(g,b)?o[g]:t;}function If(o,g,b){g.length?g=He(g,function(lt){return de(lt)?function(gt){return Fn(gt,lt.length===1?lt[0]:lt);}:lt;}):g=[xr];var H=-1;g=He(g,wr(fe()));var tt=Sf(o,function(lt,gt,It){var Rt=He(g,function(Gt){return Gt(lt);});return{criteria:Rt,index:++H,value:lt};});return Ld(tt,function(lt,gt){return g0(lt,gt,b);});}function i0(o,g){return wf(o,g,function(b,H){return Ha(o,H);});}function wf(o,g,b){for(var H=-1,tt=g.length,lt={};++H<tt;){var gt=g[H],It=Fn(o,gt);b(It,gt)&&Ui(lt,In(gt,o),It);}return lt;}function s0(o){return function(g){return Fn(g,o);};}function ya(o,g,b,H){var tt=H?Md:Jn,lt=-1,gt=g.length,It=o;for(o===g&&(g=yr(g)),b&&(It=He(o,wr(b)));++lt<gt;)for(var Rt=0,Gt=g[lt],kt=b?b(Gt):Gt;(Rt=tt(It,kt,Rt,H))>-1;)It!==o&&ys.call(It,Rt,1),ys.call(o,Rt,1);return o;}function Of(o,g){for(var b=o?g.length:0,H=b-1;b--;){var tt=g[b];if(b==H||tt!==lt){var lt=tt;ln(tt)?ys.call(o,tt,1):Ta(o,tt);}}return o;}function Pa(o,g){return o+xs(of()*(g-o+1));}function o0(o,g,b,H){for(var tt=-1,lt=er(Ss((g-o)/(b||1)),0),gt=Ft(lt);lt--;)gt[H?lt:++tt]=o,o+=b;return gt;}function Sa(o,g){var b="";if(!o||g<1||g>ct)return b;do g%2&&(b+=o),g=xs(g/2),g&&(o+=o);while(g);return b;}function xe(o,g){return Fa(rc(o,g,xr),o+"");}function a0(o){return ff(li(o));}function l0(o,g){var b=li(o);return Us(b,Wn(g,0,b.length));}function Ui(o,g,b,H){if(!Ke(o))return o;g=In(g,o);for(var tt=-1,lt=g.length,gt=lt-1,It=o;It!=null&&++tt<lt;){var Rt=Gr(g[tt]),Gt=b;if(Rt==="__proto__"||Rt==="constructor"||Rt==="prototype")return o;if(tt!=gt){var kt=It[Rt];Gt=H?H(kt,Rt,It):t,Gt===t&&(Gt=Ke(kt)?kt:ln(g[tt+1])?[]:{});}Ni(It,Rt,Gt),It=It[Rt];}return o;}var Af=Ts?function(o,g){return Ts.set(o,g),o;}:xr,f0=Ps?function(o,g){return Ps(o,"toString",{configurable:!0,enumerable:!1,value:Ka(g),writable:!0});}:xr;function c0(o){return Us(li(o));}function Fr(o,g,b){var H=-1,tt=o.length;g<0&&(g=-g>tt?0:tt+g),b=b>tt?tt:b,b<0&&(b+=tt),tt=g>b?0:b-g>>>0,g>>>=0;for(var lt=Ft(tt);++H<tt;)lt[H]=o[H+g];return lt;}function u0(o,g){var b;return Tn(o,function(H,tt,lt){return b=g(H,tt,lt),!b;}),!!b;}function Ms(o,g,b){var H=0,tt=o==null?H:o.length;if(typeof g=="number"&&g===g&&tt<=yt){for(;H<tt;){var lt=H+tt>>>1,gt=o[lt];gt!==null&&!Ar(gt)&&(b?gt<=g:gt<g)?H=lt+1:tt=lt;}return tt;}return xa(o,g,xr,b);}function xa(o,g,b,H){var tt=0,lt=o==null?0:o.length;if(lt===0)return 0;g=b(g);for(var gt=g!==g,It=g===null,Rt=Ar(g),Gt=g===t;tt<lt;){var kt=xs((tt+lt)/2),Vt=b(o[kt]),_t=Vt!==t,re=Vt===null,ce=Vt===Vt,Se=Ar(Vt);if(gt)var le=H||ce;else Gt?le=ce&&(H||_t):It?le=ce&&_t&&(H||!re):Rt?le=ce&&_t&&!re&&(H||!Se):re||Se?le=!1:le=H?Vt<=g:Vt<g;le?tt=kt+1:lt=kt;}return ar(lt,mt);}function Ef(o,g){for(var b=-1,H=o.length,tt=0,lt=[];++b<H;){var gt=o[b],It=g?g(gt):gt;if(!b||!kr(It,Rt)){var Rt=It;lt[tt++]=gt===0?0:gt;}}return lt;}function Mf(o){return typeof o=="number"?o:Ar(o)?Q:+o;}function Or(o){if(typeof o=="string")return o;if(de(o))return He(o,Or)+"";if(Ar(o))return af?af.call(o):"";var g=o+"";return g=="0"&&1/o==-at?"-0":g;}function Cn(o,g,b){var H=-1,tt=ls,lt=o.length,gt=!0,It=[],Rt=It;if(b)gt=!1,tt=Jo;else if(lt>=n){var Gt=g?null:T0(o);if(Gt)return cs(Gt);gt=!1,tt=Ei,Rt=new Bn();}else Rt=g?[]:It;t:for(;++H<lt;){var kt=o[H],Vt=g?g(kt):kt;if(kt=b||kt!==0?kt:0,gt&&Vt===Vt){for(var _t=Rt.length;_t--;)if(Rt[_t]===Vt)continue t;g&&Rt.push(Vt),It.push(kt);}else tt(Rt,Vt,b)||(Rt!==It&&Rt.push(Vt),It.push(kt));}return It;}function Ta(o,g){g=In(g,o);var b=-1,H=g.length;if(!H)return!0;for(;++b<H;){var tt=Gr(g[b]);if(tt==="__proto__"&&!Re.call(o,"__proto__")||(tt==="constructor"||tt==="prototype")&&b<H-1)return!1;}var lt=nc(o,g);return lt==null||delete lt[Gr(Ur(g))];}function Lf(o,g,b,H){return Ui(o,g,b(Fn(o,g)),H);}function Ls(o,g,b,H){for(var tt=o.length,lt=H?tt:-1;(H?lt--:++lt<tt)&&g(o[lt],lt,o););return b?Fr(o,H?0:lt,H?lt+1:tt):Fr(o,H?lt+1:0,H?tt:lt);}function Rf(o,g){var b=o;return b instanceof Ie&&(b=b.value()),Qo(g,function(H,tt){return tt.func.apply(tt.thisArg,Pn([H],tt.args));},b);}function Ca(o,g,b){var H=o.length;if(H<2)return H?Cn(o[0]):[];for(var tt=-1,lt=Ft(H);++tt<H;)for(var gt=o[tt],It=-1;++It<H;)It!=tt&&(lt[tt]=Bi(lt[tt]||gt,o[It],g,b));return Cn(sr(lt,1),g,b);}function bf(o,g,b){for(var H=-1,tt=o.length,lt=g.length,gt={};++H<tt;){var It=H<lt?g[H]:t;b(gt,o[H],It);}return gt;}function Ia(o){return Qe(o)?o:[];}function wa(o){return typeof o=="function"?o:xr;}function In(o,g){return de(o)?o:Na(o,g)?[o]:ac(be(o));}var h0=xe;function wn(o,g,b){var H=o.length;return b=b===t?H:b,!g&&b>=H?o:Fr(o,g,b);}var Df=_d||function(o){return ir.clearTimeout(o);};function Nf(o,g){if(g)return o.slice();var b=o.length,H=tf?tf(b):new o.constructor(b);return o.copy(H),H;}function Oa(o){var g=new o.constructor(o.byteLength);return new gs(g).set(new gs(o)),g;}function d0(o,g){var b=g?Oa(o.buffer):o.buffer;return new o.constructor(b,o.byteOffset,o.byteLength);}function p0(o){var g=new o.constructor(o.source,vn.exec(o));return g.lastIndex=o.lastIndex,g;}function v0(o){return Di?Be(Di.call(o)):{};}function Bf(o,g){var b=g?Oa(o.buffer):o.buffer;return new o.constructor(b,o.byteOffset,o.length);}function Wf(o,g){if(o!==g){var b=o!==t,H=o===null,tt=o===o,lt=Ar(o),gt=g!==t,It=g===null,Rt=g===g,Gt=Ar(g);if(!It&&!Gt&&!lt&&o>g||lt&>&&Rt&&!It&&!Gt||H&>&&Rt||!b&&Rt||!tt)return 1;if(!H&&!lt&&!Gt&&o<g||Gt&&b&&tt&&!H&&!lt||It&&b&&tt||!gt&&tt||!Rt)return-1;}return 0;}function g0(o,g,b){for(var H=-1,tt=o.criteria,lt=g.criteria,gt=tt.length,It=b.length;++H<gt;){var Rt=Wf(tt[H],lt[H]);if(Rt){if(H>=It)return Rt;var Gt=b[H];return Rt*(Gt=="desc"?-1:1);}}return o.index-g.index;}function Ff(o,g,b,H){for(var tt=-1,lt=o.length,gt=b.length,It=-1,Rt=g.length,Gt=er(lt-gt,0),kt=Ft(Rt+Gt),Vt=!H;++It<Rt;)kt[It]=g[It];for(;++tt<gt;)(Vt||tt<lt)&&(kt[b[tt]]=o[tt]);for(;Gt--;)kt[It++]=o[tt++];return kt;}function Uf(o,g,b,H){for(var tt=-1,lt=o.length,gt=-1,It=b.length,Rt=-1,Gt=g.length,kt=er(lt-It,0),Vt=Ft(kt+Gt),_t=!H;++tt<kt;)Vt[tt]=o[tt];for(var re=tt;++Rt<Gt;)Vt[re+Rt]=g[Rt];for(;++gt<It;)(_t||tt<lt)&&(Vt[re+b[gt]]=o[tt++]);return Vt;}function yr(o,g){var b=-1,H=o.length;for(g||(g=Ft(H));++b<H;)g[b]=o[b];return g;}function Qr(o,g,b,H){var tt=!b;b||(b={});for(var lt=-1,gt=g.length;++lt<gt;){var It=g[lt],Rt=H?H(b[It],o[It],It,b,o):t;Rt===t&&(Rt=o[It]),tt?Zr(b,It,Rt):Ni(b,It,Rt);}return b;}function m0(o,g){return Qr(o,Da(o),g);}function y0(o,g){return Qr(o,Qf(o),g);}function Rs(o,g){return function(b,H){var tt=de(b)?Cd:$p,lt=g?g():{};return tt(b,o,fe(H,2),lt);};}function ii(o){return xe(function(g,b){var H=-1,tt=b.length,lt=tt>1?b[tt-1]:t,gt=tt>2?b[2]:t;for(lt=o.length>3&&typeof lt=="function"?(tt--,lt):t,gt&&dr(b[0],b[1],gt)&&(lt=tt<3?t:lt,tt=1),g=Be(g);++H<tt;){var It=b[H];It&&o(g,It,H,lt);}return g;});}function Yf(o,g){return function(b,H){if(b==null)return b;if(!Pr(b))return o(b,H);for(var tt=b.length,lt=g?tt:-1,gt=Be(b);(g?lt--:++lt<tt)&&H(gt[lt],lt,gt)!==!1;);return b;};}function $f(o){return function(g,b,H){for(var tt=-1,lt=Be(g),gt=H(g),It=gt.length;It--;){var Rt=gt[o?It:++tt];if(b(lt[Rt],Rt,lt)===!1)break;}return g;};}function P0(o,g,b){var H=g&w,tt=Yi(o);function lt(){var gt=this&&this!==ir&&this instanceof lt?tt:o;return gt.apply(H?b:this,arguments);}return lt;}function Xf(o){return function(g){g=be(g);var b=Qn(g)?zr(g):t,H=b?b[0]:g.charAt(0),tt=b?wn(b,1).join(""):g.slice(1);return H[o]()+tt;};}function si(o){return function(g){return Qo($c(Yc(g).replace(fd,"")),o,"");};}function Yi(o){return function(){var g=arguments;switch(g.length){case 0:return new o();case 1:return new o(g[0]);case 2:return new o(g[0],g[1]);case 3:return new o(g[0],g[1],g[2]);case 4:return new o(g[0],g[1],g[2],g[3]);case 5:return new o(g[0],g[1],g[2],g[3],g[4]);case 6:return new o(g[0],g[1],g[2],g[3],g[4],g[5]);case 7:return new o(g[0],g[1],g[2],g[3],g[4],g[5],g[6]);}var b=ni(o.prototype),H=o.apply(b,g);return Ke(H)?H:b;};}function S0(o,g,b){var H=Yi(o);function tt(){for(var lt=arguments.length,gt=Ft(lt),It=lt,Rt=oi(tt);It--;)gt[It]=arguments[It];var Gt=lt<3&>[0]!==Rt&>[lt-1]!==Rt?[]:Sn(gt,Rt);if(lt-=Gt.length,lt<b)return Hf(o,g,bs,tt.placeholder,t,gt,Gt,t,t,b-lt);var kt=this&&this!==ir&&this instanceof tt?H:o;return Cr(kt,this,gt);}return tt;}function zf(o){return function(g,b,H){var tt=Be(g);if(!Pr(g)){var lt=fe(b,3);g=rr(g),b=function b(It){return lt(tt[It],It,tt);};}var gt=o(g,b,H);return gt>-1?tt[lt?g[gt]:gt]:t;};}function jf(o){return an(function(g){var b=g.length,H=b,tt=Br.prototype.thru;for(o&&g.reverse();H--;){var lt=g[H];if(typeof lt!="function")throw new Nr(c);if(tt&&!gt&&Ws(lt)=="wrapper")var gt=new Br([],!0);}for(H=gt?H:b;++H<b;){lt=g[H];var It=Ws(lt),Rt=It=="wrapper"?Ra(lt):t;Rt&&Ba(Rt[0])&&Rt[1]==(D|p|E|U)&&!Rt[4].length&&Rt[9]==1?gt=gt[Ws(Rt[0])].apply(gt,Rt[3]):gt=lt.length==1&&Ba(lt)?gt[It]():gt.thru(lt);}return function(){var Gt=arguments,kt=Gt[0];if(gt&&Gt.length==1&&de(kt))return gt.plant(kt).value();for(var Vt=0,_t=b?g[Vt].apply(this,Gt):kt;++Vt<b;)_t=g[Vt].call(this,_t);return _t;};});}function bs(o,g,b,H,tt,lt,gt,It,Rt,Gt){var kt=g&D,Vt=g&w,_t=g&d,re=g&(p|S),ce=g&M,Se=_t?t:Yi(o);function le(){for(var Te=arguments.length,Oe=Ft(Te),Er=Te;Er--;)Oe[Er]=arguments[Er];if(re)var pr=oi(le),Mr=bd(Oe,pr);if(H&&(Oe=Ff(Oe,H,tt,re)),lt&&(Oe=Uf(Oe,lt,gt,re)),Te-=Mr,re&&Te<Gt){var qe=Sn(Oe,pr);return Hf(o,g,bs,le.placeholder,b,Oe,qe,It,Rt,Gt-Te);}var Hr=Vt?b:this,un=_t?Hr[o]:o;return Te=Oe.length,It?Oe=$0(Oe,It):ce&&Te>1&&Oe.reverse(),kt&&Rt<Te&&(Oe.length=Rt),this&&this!==ir&&this instanceof le&&(un=Se||Yi(un)),un.apply(Hr,Oe);}return le;}function Gf(o,g){return function(b,H){return Kp(b,o,g(H),{});};}function Ds(o,g){return function(b,H){var tt;if(b===t&&H===t)return g;if(b!==t&&(tt=b),H!==t){if(tt===t)return H;typeof b=="string"||typeof H=="string"?(b=Or(b),H=Or(H)):(b=Mf(b),H=Mf(H)),tt=o(b,H);}return tt;};}function Aa(o){return an(function(g){return g=He(g,wr(fe())),xe(function(b){var H=this;return o(g,function(tt){return Cr(tt,H,b);});});});}function Ns(o,g){g=g===t?" ":Or(g);var b=g.length;if(b<2)return b?Sa(g,o):g;var H=Sa(g,Ss(o/qn(g)));return Qn(g)?wn(zr(H),0,o).join(""):H.slice(0,o);}function x0(o,g,b,H){var tt=g&w,lt=Yi(o);function gt(){for(var It=-1,Rt=arguments.length,Gt=-1,kt=H.length,Vt=Ft(kt+Rt),_t=this&&this!==ir&&this instanceof gt?lt:o;++Gt<kt;)Vt[Gt]=H[Gt];for(;Rt--;)Vt[Gt++]=arguments[++It];return Cr(_t,tt?b:this,Vt);}return gt;}function kf(o){return function(g,b,H){return H&&typeof H!="number"&&dr(g,b,H)&&(b=H=t),g=cn(g),b===t?(b=g,g=0):b=cn(b),H=H===t?g<b?1:-1:cn(H),o0(g,b,H,o);};}function Bs(o){return function(g,b){return typeof g=="string"&&typeof b=="string"||(g=Yr(g),b=Yr(b)),o(g,b);};}function Hf(o,g,b,H,tt,lt,gt,It,Rt,Gt){var kt=g&p,Vt=kt?gt:t,_t=kt?t:gt,re=kt?lt:t,ce=kt?t:lt;g|=kt?E:R,g&=~(kt?R:E),g&m||(g&=-4);var Se=[o,g,tt,re,Vt,ce,_t,It,Rt,Gt],le=b.apply(t,Se);return Ba(o)&&ic(le,Se),le.placeholder=H,sc(le,o,g);}function Ea(o){var g=tr[o];return function(b,H){if(b=Yr(b),H=H==null?0:ar(ye(H),292),H&&sf(b)){var tt=(be(b)+"e").split("e"),lt=g(tt[0]+"e"+(+tt[1]+H));return tt=(be(lt)+"e").split("e"),+(tt[0]+"e"+(+tt[1]-H));}return g(b);};}var T0=ei&&1/cs(new ei([,-0]))[1]==at?function(o){return new ei(o);}:Qa;function Vf(o){return function(g){var b=lr(g);return b==C?ia(g):b==St?Yd(g):Rd(g,o(g));};}function on(o,g,b,H,tt,lt,gt,It){var Rt=g&d;if(!Rt&&typeof o!="function")throw new Nr(c);var Gt=H?H.length:0;if(Gt||(g&=-97,H=tt=t),gt=gt===t?gt:er(ye(gt),0),It=It===t?It:ye(It),Gt-=tt?tt.length:0,g&R){var kt=H,Vt=tt;H=tt=t;}var _t=Rt?t:Ra(o),re=[o,g,b,H,tt,kt,Vt,lt,gt,It];if(_t&&F0(re,_t),o=re[0],g=re[1],b=re[2],H=re[3],tt=re[4],It=re[9]=re[9]===t?Rt?0:o.length:er(re[9]-Gt,0),!It&&g&(p|S)&&(g&=-25),!g||g==w)var ce=P0(o,g,b);else g==p||g==S?ce=S0(o,g,It):(g==E||g==(w|E))&&!tt.length?ce=x0(o,g,b,H):ce=bs.apply(t,re);var Se=_t?Af:ic;return sc(Se(ce,re),o,g);}function Kf(o,g,b,H){return o===t||kr(o,ti[b])&&!Re.call(H,b)?g:o;}function Zf(o,g,b,H,tt,lt){return Ke(o)&&Ke(g)&&(lt.set(g,o),Es(o,g,t,Zf,lt),lt["delete"](g)),o;}function C0(o){return zi(o)?t:o;}function Jf(o,g,b,H,tt,lt){var gt=b&I,It=o.length,Rt=g.length;if(It!=Rt&&!(gt&&Rt>It))return!1;var Gt=lt.get(o),kt=lt.get(g);if(Gt&&kt)return Gt==g&&kt==o;var Vt=-1,_t=!0,re=b&P?new Bn():t;for(lt.set(o,g),lt.set(g,o);++Vt<It;){var ce=o[Vt],Se=g[Vt];if(H)var le=gt?H(Se,ce,Vt,g,o,lt):H(ce,Se,Vt,o,g,lt);if(le!==t){if(le)continue;_t=!1;break;}if(re){if(!qo(g,function(Te,Oe){if(!Ei(re,Oe)&&(ce===Te||tt(ce,Te,b,H,lt)))return re.push(Oe);})){_t=!1;break;}}else if(!(ce===Se||tt(ce,Se,b,H,lt))){_t=!1;break;}}return lt["delete"](o),lt["delete"](g),_t;}function I0(o,g,b,H,tt,lt,gt){switch(b){case Yt:if(o.byteLength!=g.byteLength||o.byteOffset!=g.byteOffset)return!1;o=o.buffer,g=g.buffer;case Lt:return!(o.byteLength!=g.byteLength||!lt(new gs(o),new gs(g)));case G:case k:case L:return kr(+o,+g);case nt:return o.name==g.name&&o.message==g.message;case ut:case Ct:return o==g+"";case C:var It=ia;case St:var Rt=H&I;if(It||(It=cs),o.size!=g.size&&!Rt)return!1;var Gt=gt.get(o);if(Gt)return Gt==g;H|=P,gt.set(o,g);var kt=Jf(It(o),It(g),H,tt,lt,gt);return gt["delete"](o),kt;case Et:if(Di)return Di.call(o)==Di.call(g);}return!1;}function w0(o,g,b,H,tt,lt){var gt=b&I,It=Ma(o),Rt=It.length,Gt=Ma(g),kt=Gt.length;if(Rt!=kt&&!gt)return!1;for(var Vt=Rt;Vt--;){var _t=It[Vt];if(!(gt?_t in g:Re.call(g,_t)))return!1;}var re=lt.get(o),ce=lt.get(g);if(re&&ce)return re==g&&ce==o;var Se=!0;lt.set(o,g),lt.set(g,o);for(var le=gt;++Vt<Rt;){_t=It[Vt];var Te=o[_t],Oe=g[_t];if(H)var Er=gt?H(Oe,Te,_t,g,o,lt):H(Te,Oe,_t,o,g,lt);if(!(Er===t?Te===Oe||tt(Te,Oe,b,H,lt):Er)){Se=!1;break;}le||(le=_t=="constructor");}if(Se&&!le){var pr=o.constructor,Mr=g.constructor;pr!=Mr&&"constructor"in o&&"constructor"in g&&!(typeof pr=="function"&&pr instanceof pr&&typeof Mr=="function"&&Mr instanceof Mr)&&(Se=!1);}return lt["delete"](o),lt["delete"](g),Se;}function an(o){return Fa(rc(o,t,uc),o+"");}function Ma(o){return gf(o,rr,Da);}function La(o){return gf(o,Sr,Qf);}var Ra=Ts?function(o){return Ts.get(o);}:Qa;function Ws(o){for(var g=o.name+"",b=ri[g],H=Re.call(ri,g)?b.length:0;H--;){var tt=b[H],lt=tt.func;if(lt==null||lt==o)return tt.name;}return g;}function oi(o){var g=Re.call(ot,"placeholder")?ot:o;return g.placeholder;}function fe(){var o=ot.iteratee||Za;return o=o===Za?Pf:o,arguments.length?o(arguments[0],arguments[1]):o;}function Fs(o,g){var b=o.__data__;return D0(g)?b[typeof g=="string"?"string":"hash"]:b.map;}function ba(o){for(var g=rr(o),b=g.length;b--;){var H=g[b],tt=o[H];g[b]=[H,tt,tc(tt)];}return g;}function Un(o,g){var b=Wd(o,g);return yf(b)?b:t;}function O0(o){var g=Re.call(o,Dn),b=o[Dn];try{o[Dn]=t;var H=!0;}catch(_unused24){}var tt=ps.call(o);return H&&(g?o[Dn]=b:delete o[Dn]),tt;}var Da=oa?function(o){return o==null?[]:(o=Be(o),yn(oa(o),function(g){return rf.call(o,g);}));}:qa,Qf=oa?function(o){for(var g=[];o;)Pn(g,Da(o)),o=ms(o);return g;}:qa,lr=hr;(aa&&lr(new aa(new ArrayBuffer(1)))!=Yt||Li&&lr(new Li())!=C||la&&lr(la.resolve())!=q||ei&&lr(new ei())!=St||Ri&&lr(new Ri())!=wt)&&(lr=function lr(o){var g=hr(o),b=g==K?o.constructor:t,H=b?Yn(b):"";if(H)switch(H){case lp:return Yt;case fp:return C;case cp:return q;case up:return St;case hp:return wt;}return g;});function A0(o,g,b){for(var H=-1,tt=b.length;++H<tt;){var lt=b[H],gt=lt.size;switch(lt.type){case"drop":o+=gt;break;case"dropRight":g-=gt;break;case"take":g=ar(g,o+gt);break;case"takeRight":o=er(o,g-gt);break;}}return{start:o,end:g};}function E0(o){var g=o.match(Eo);return g?g[1].split(Mo):[];}function qf(o,g,b){g=In(g,o);for(var H=-1,tt=g.length,lt=!1;++H<tt;){var gt=Gr(g[H]);if(!(lt=o!=null&&b(o,gt)))break;o=o[gt];}return lt||++H!=tt?lt:(tt=o==null?0:o.length,!!tt&&Gs(tt)&&ln(gt,tt)&&(de(o)||$n(o)));}function M0(o){var g=o.length,b=new o.constructor(g);return g&&typeof o[0]=="string"&&Re.call(o,"index")&&(b.index=o.index,b.input=o.input),b;}function _f(o){return typeof o.constructor=="function"&&!$i(o)?ni(ms(o)):{};}function L0(o,g,b){var H=o.constructor;switch(g){case Lt:return Oa(o);case G:case k:return new H(+o);case Yt:return d0(o,b);case zt:case Wt:case Qt:case ue:case ie:case ne:case ae:case se:case We:return Bf(o,b);case C:return new H();case L:case Ct:return new H(o);case ut:return p0(o);case St:return new H();case Et:return v0(o);}}function R0(o,g){var b=g.length;if(!b)return o;var H=b-1;return g[H]=(b>1?"& ":"")+g[H],g=g.join(b>2?", ":" "),o.replace(Ao,"{\n/* [wrapped with "+g+"] */\n");}function b0(o){return de(o)||$n(o)||!!(nf&&o&&o[nf]);}function ln(o,g){var b=_typeof(o);return g=g!==null&&g!==void 0?g:ct,!!g&&(b=="number"||b!="symbol"&&Wo.test(o))&&o>-1&&o%1==0&&o<g;}function dr(o,g,b){if(!Ke(b))return!1;var H=_typeof(g);return(H=="number"?Pr(b)&&ln(g,b.length):H=="string"&&g in b)?kr(b[g],o):!1;}function Na(o,g){if(de(o))return!1;var b=_typeof(o);return b=="number"||b=="symbol"||b=="boolean"||o==null||Ar(o)?!0:Vn.test(o)||!Hn.test(o)||g!=null&&o in Be(g);}function D0(o){var g=_typeof(o);return g=="string"||g=="number"||g=="symbol"||g=="boolean"?o!=="__proto__":o===null;}function Ba(o){var g=Ws(o),b=ot[g];if(typeof b!="function"||!(g in Ie.prototype))return!1;if(o===b)return!0;var H=Ra(b);return!!H&&o===H[0];}function N0(o){return!!_l&&_l in o;}var B0=hs?fn:_a;function $i(o){var g=o&&o.constructor,b=typeof g=="function"&&g.prototype||ti;return o===b;}function tc(o){return o===o&&!Ke(o);}function ec(o,g){return function(b){return b==null?!1:b[o]===g&&(g!==t||o in Be(b));};}function W0(o){var g=zs(o,function(H){return b.size===v&&b.clear(),H;}),b=g.cache;return g;}function F0(o,g){var b=o[1],H=g[1],tt=b|H,lt=tt<(w|d|D),gt=H==D&&b==p||H==D&&b==U&&o[7].length<=g[8]||H==(D|U)&&g[7].length<=g[8]&&b==p;if(!(lt||gt))return o;H&w&&(o[2]=g[2],tt|=b&w?0:m);var It=g[3];if(It){var Rt=o[3];o[3]=Rt?Ff(Rt,It,g[4]):It,o[4]=Rt?Sn(o[3],h):g[4];}return It=g[5],It&&(Rt=o[5],o[5]=Rt?Uf(Rt,It,g[6]):It,o[6]=Rt?Sn(o[5],h):g[6]),It=g[7],It&&(o[7]=It),H&D&&(o[8]=o[8]==null?g[8]:ar(o[8],g[8])),o[9]==null&&(o[9]=g[9]),o[0]=g[0],o[1]=tt,o;}function U0(o){var g=[];if(o!=null)for(var b in Be(o))g.push(b);return g;}function Y0(o){return ps.call(o);}function rc(o,g,b){return g=er(g===t?o.length-1:g,0),function(){for(var H=arguments,tt=-1,lt=er(H.length-g,0),gt=Ft(lt);++tt<lt;)gt[tt]=H[g+tt];tt=-1;for(var It=Ft(g+1);++tt<g;)It[tt]=H[tt];return It[g]=b(gt),Cr(o,this,It);};}function nc(o,g){return g.length<2?o:Fn(o,Fr(g,0,-1));}function $0(o,g){for(var b=o.length,H=ar(g.length,b),tt=yr(o);H--;){var lt=g[H];o[H]=ln(lt,b)?tt[lt]:t;}return o;}function Wa(o,g){if(!(g==="constructor"&&typeof o[g]=="function")&&g!="__proto__")return o[g];}var ic=oc(Af),Xi=ep||function(o,g){return ir.setTimeout(o,g);},Fa=oc(f0);function sc(o,g,b){var H=g+"";return Fa(o,R0(H,X0(E0(H),b)));}function oc(o){var g=0,b=0;return function(){var H=sp(),tt=N-(H-b);if(b=H,tt>0){if(++g>=B)return arguments[0];}else g=0;return o.apply(t,arguments);};}function Us(o,g){var b=-1,H=o.length,tt=H-1;for(g=g===t?H:g;++b<g;){var lt=Pa(b,tt),gt=o[lt];o[lt]=o[b],o[b]=gt;}return o.length=g,o;}var ac=W0(function(o){var g=[];return o.charCodeAt(0)===46&&g.push(""),o.replace(Io,function(b,H,tt,lt){g.push(tt?lt.replace(Ro,"$1"):H||b);}),g;});function Gr(o){if(typeof o=="string"||Ar(o))return o;var g=o+"";return g=="0"&&1/o==-at?"-0":g;}function Yn(o){if(o!=null){try{return ds.call(o);}catch(_unused25){}try{return o+"";}catch(_unused26){}}return"";}function X0(o,g){return Ir(At,function(b){var H="_."+b[0];g&b[1]&&!ls(o,H)&&o.push(H);}),o.sort();}function lc(o){if(o instanceof Ie)return o.clone();var g=new Br(o.__wrapped__,o.__chain__);return g.__actions__=yr(o.__actions__),g.__index__=o.__index__,g.__values__=o.__values__,g;}function z0(o,g,b){(b?dr(o,g,b):g===t)?g=1:g=er(ye(g),0);var H=o==null?0:o.length;if(!H||g<1)return[];for(var tt=0,lt=0,gt=Ft(Ss(H/g));tt<H;)gt[lt++]=Fr(o,tt,tt+=g);return gt;}function j0(o){for(var g=-1,b=o==null?0:o.length,H=0,tt=[];++g<b;){var lt=o[g];lt&&(tt[H++]=lt);}return tt;}function G0(){var o=arguments.length;if(!o)return[];for(var g=Ft(o-1),b=arguments[0],H=o;H--;)g[H-1]=arguments[H];return Pn(de(b)?yr(b):[b],sr(g,1));}var k0=xe(function(o,g){return Qe(o)?Bi(o,sr(g,1,Qe,!0)):[];}),H0=xe(function(o,g){var b=Ur(g);return Qe(b)&&(b=t),Qe(o)?Bi(o,sr(g,1,Qe,!0),fe(b,2)):[];}),V0=xe(function(o,g){var b=Ur(g);return Qe(b)&&(b=t),Qe(o)?Bi(o,sr(g,1,Qe,!0),t,b):[];});function K0(o,g,b){var H=o==null?0:o.length;return H?(g=b||g===t?1:ye(g),Fr(o,g<0?0:g,H)):[];}function Z0(o,g,b){var H=o==null?0:o.length;return H?(g=b||g===t?1:ye(g),g=H-g,Fr(o,0,g<0?0:g)):[];}function J0(o,g){return o&&o.length?Ls(o,fe(g,3),!0,!0):[];}function Q0(o,g){return o&&o.length?Ls(o,fe(g,3),!0):[];}function q0(o,g,b,H){var tt=o==null?0:o.length;return tt?(b&&typeof b!="number"&&dr(o,g,b)&&(b=0,H=tt),Gp(o,g,b,H)):[];}function fc(o,g,b){var H=o==null?0:o.length;if(!H)return-1;var tt=b==null?0:ye(b);return tt<0&&(tt=er(H+tt,0)),fs(o,fe(g,3),tt);}function cc(o,g,b){var H=o==null?0:o.length;if(!H)return-1;var tt=H-1;return b!==t&&(tt=ye(b),tt=b<0?er(H+tt,0):ar(tt,H-1)),fs(o,fe(g,3),tt,!0);}function uc(o){var g=o==null?0:o.length;return g?sr(o,1):[];}function _0(o){var g=o==null?0:o.length;return g?sr(o,at):[];}function tv(o,g){var b=o==null?0:o.length;return b?(g=g===t?1:ye(g),sr(o,g)):[];}function ev(o){for(var g=-1,b=o==null?0:o.length,H={};++g<b;){var tt=o[g];Zr(H,tt[0],tt[1]);}return H;}function hc(o){return o&&o.length?o[0]:t;}function rv(o,g,b){var H=o==null?0:o.length;if(!H)return-1;var tt=b==null?0:ye(b);return tt<0&&(tt=er(H+tt,0)),Jn(o,g,tt);}function nv(o){var g=o==null?0:o.length;return g?Fr(o,0,-1):[];}var iv=xe(function(o){var g=He(o,Ia);return g.length&&g[0]===o[0]?pa(g):[];}),sv=xe(function(o){var g=Ur(o),b=He(o,Ia);return g===Ur(b)?g=t:b.pop(),b.length&&b[0]===o[0]?pa(b,fe(g,2)):[];}),ov=xe(function(o){var g=Ur(o),b=He(o,Ia);return g=typeof g=="function"?g:t,g&&b.pop(),b.length&&b[0]===o[0]?pa(b,t,g):[];});function av(o,g){return o==null?"":np.call(o,g);}function Ur(o){var g=o==null?0:o.length;return g?o[g-1]:t;}function lv(o,g,b){var H=o==null?0:o.length;if(!H)return-1;var tt=H;return b!==t&&(tt=ye(b),tt=tt<0?er(H+tt,0):ar(tt,H-1)),g===g?Xd(o,g,tt):fs(o,kl,tt,!0);}function fv(o,g){return o&&o.length?Cf(o,ye(g)):t;}var cv=xe(dc);function dc(o,g){return o&&o.length&&g&&g.length?ya(o,g):o;}function uv(o,g,b){return o&&o.length&&g&&g.length?ya(o,g,fe(b,2)):o;}function hv(o,g,b){return o&&o.length&&g&&g.length?ya(o,g,t,b):o;}var dv=an(function(o,g){var b=o==null?0:o.length,H=ca(o,g);return Of(o,He(g,function(tt){return ln(tt,b)?+tt:tt;}).sort(Wf)),H;});function pv(o,g){var b=[];if(!(o&&o.length))return b;var H=-1,tt=[],lt=o.length;for(g=fe(g,3);++H<lt;){var gt=o[H];g(gt,H,o)&&(b.push(gt),tt.push(H));}return Of(o,tt),b;}function Ua(o){return o==null?o:ap.call(o);}function vv(o,g,b){var H=o==null?0:o.length;return H?(b&&typeof b!="number"&&dr(o,g,b)?(g=0,b=H):(g=g==null?0:ye(g),b=b===t?H:ye(b)),Fr(o,g,b)):[];}function gv(o,g){return Ms(o,g);}function mv(o,g,b){return xa(o,g,fe(b,2));}function yv(o,g){var b=o==null?0:o.length;if(b){var H=Ms(o,g);if(H<b&&kr(o[H],g))return H;}return-1;}function Pv(o,g){return Ms(o,g,!0);}function Sv(o,g,b){return xa(o,g,fe(b,2),!0);}function xv(o,g){var b=o==null?0:o.length;if(b){var H=Ms(o,g,!0)-1;if(kr(o[H],g))return H;}return-1;}function Tv(o){return o&&o.length?Ef(o):[];}function Cv(o,g){return o&&o.length?Ef(o,fe(g,2)):[];}function Iv(o){var g=o==null?0:o.length;return g?Fr(o,1,g):[];}function wv(o,g,b){return o&&o.length?(g=b||g===t?1:ye(g),Fr(o,0,g<0?0:g)):[];}function Ov(o,g,b){var H=o==null?0:o.length;return H?(g=b||g===t?1:ye(g),g=H-g,Fr(o,g<0?0:g,H)):[];}function Av(o,g){return o&&o.length?Ls(o,fe(g,3),!1,!0):[];}function Ev(o,g){return o&&o.length?Ls(o,fe(g,3)):[];}var Mv=xe(function(o){return Cn(sr(o,1,Qe,!0));}),Lv=xe(function(o){var g=Ur(o);return Qe(g)&&(g=t),Cn(sr(o,1,Qe,!0),fe(g,2));}),Rv=xe(function(o){var g=Ur(o);return g=typeof g=="function"?g:t,Cn(sr(o,1,Qe,!0),t,g);});function bv(o){return o&&o.length?Cn(o):[];}function Dv(o,g){return o&&o.length?Cn(o,fe(g,2)):[];}function Nv(o,g){return g=typeof g=="function"?g:t,o&&o.length?Cn(o,t,g):[];}function Ya(o){if(!(o&&o.length))return[];var g=0;return o=yn(o,function(b){if(Qe(b))return g=er(b.length,g),!0;}),ra(g,function(b){return He(o,_o(b));});}function pc(o,g){if(!(o&&o.length))return[];var b=Ya(o);return g==null?b:He(b,function(H){return Cr(g,t,H);});}var Bv=xe(function(o,g){return Qe(o)?Bi(o,g):[];}),Wv=xe(function(o){return Ca(yn(o,Qe));}),Fv=xe(function(o){var g=Ur(o);return Qe(g)&&(g=t),Ca(yn(o,Qe),fe(g,2));}),Uv=xe(function(o){var g=Ur(o);return g=typeof g=="function"?g:t,Ca(yn(o,Qe),t,g);}),Yv=xe(Ya);function $v(o,g){return bf(o||[],g||[],Ni);}function Xv(o,g){return bf(o||[],g||[],Ui);}var zv=xe(function(o){var g=o.length,b=g>1?o[g-1]:t;return b=typeof b=="function"?(o.pop(),b):t,pc(o,b);});function vc(o){var g=ot(o);return g.__chain__=!0,g;}function jv(o,g){return g(o),o;}function Ys(o,g){return g(o);}var Gv=an(function(o){var g=o.length,b=g?o[0]:0,H=this.__wrapped__,tt=function tt(lt){return ca(lt,o);};return g>1||this.__actions__.length||!(H instanceof Ie)||!ln(b)?this.thru(tt):(H=H.slice(b,+b+(g?1:0)),H.__actions__.push({func:Ys,args:[tt],thisArg:t}),new Br(H,this.__chain__).thru(function(lt){return g&&!lt.length&<.push(t),lt;}));});function kv(){return vc(this);}function Hv(){return new Br(this.value(),this.__chain__);}function Vv(){this.__values__===t&&(this.__values__=Mc(this.value()));var o=this.__index__>=this.__values__.length,g=o?t:this.__values__[this.__index__++];return{done:o,value:g};}function Kv(){return this;}function Zv(o){for(var g,b=this;b instanceof Is;){var H=lc(b);H.__index__=0,H.__values__=t,g?tt.__wrapped__=H:g=H;var tt=H;b=b.__wrapped__;}return tt.__wrapped__=o,g;}function Jv(){var o=this.__wrapped__;if(o instanceof Ie){var g=o;return this.__actions__.length&&(g=new Ie(this)),g=g.reverse(),g.__actions__.push({func:Ys,args:[Ua],thisArg:t}),new Br(g,this.__chain__);}return this.thru(Ua);}function Qv(){return Rf(this.__wrapped__,this.__actions__);}var qv=Rs(function(o,g,b){Re.call(o,b)?++o[b]:Zr(o,b,1);});function _v(o,g,b){var H=de(o)?jl:jp;return b&&dr(o,g,b)&&(g=t),H(o,fe(g,3));}function tg(o,g){var b=de(o)?yn:pf;return b(o,fe(g,3));}var eg=zf(fc),rg=zf(cc);function ng(o,g){return sr($s(o,g),1);}function ig(o,g){return sr($s(o,g),at);}function sg(o,g,b){return b=b===t?1:ye(b),sr($s(o,g),b);}function gc(o,g){var b=de(o)?Ir:Tn;return b(o,fe(g,3));}function mc(o,g){var b=de(o)?Id:df;return b(o,fe(g,3));}var og=Rs(function(o,g,b){Re.call(o,b)?o[b].push(g):Zr(o,b,[g]);});function ag(o,g,b,H){o=Pr(o)?o:li(o),b=b&&!H?ye(b):0;var tt=o.length;return b<0&&(b=er(tt+b,0)),ks(o)?b<=tt&&o.indexOf(g,b)>-1:!!tt&&Jn(o,g,b)>-1;}var lg=xe(function(o,g,b){var H=-1,tt=typeof g=="function",lt=Pr(o)?Ft(o.length):[];return Tn(o,function(gt){lt[++H]=tt?Cr(g,gt,b):Wi(gt,g,b);}),lt;}),fg=Rs(function(o,g,b){Zr(o,b,g);});function $s(o,g){var b=de(o)?He:Sf;return b(o,fe(g,3));}function cg(o,g,b,H){return o==null?[]:(de(g)||(g=g==null?[]:[g]),b=H?t:b,de(b)||(b=b==null?[]:[b]),If(o,g,b));}var ug=Rs(function(o,g,b){o[b?0:1].push(g);},function(){return[[],[]];});function hg(o,g,b){var H=de(o)?Qo:Vl,tt=arguments.length<3;return H(o,fe(g,4),b,tt,Tn);}function dg(o,g,b){var H=de(o)?wd:Vl,tt=arguments.length<3;return H(o,fe(g,4),b,tt,df);}function pg(o,g){var b=de(o)?yn:pf;return b(o,js(fe(g,3)));}function vg(o){var g=de(o)?ff:a0;return g(o);}function gg(o,g,b){(b?dr(o,g,b):g===t)?g=1:g=ye(g);var H=de(o)?Up:l0;return H(o,g);}function mg(o){var g=de(o)?Yp:c0;return g(o);}function yg(o){if(o==null)return 0;if(Pr(o))return ks(o)?qn(o):o.length;var g=lr(o);return g==C||g==St?o.size:ga(o).length;}function Pg(o,g,b){var H=de(o)?qo:u0;return b&&dr(o,g,b)&&(g=t),H(o,fe(g,3));}var Sg=xe(function(o,g){if(o==null)return[];var b=g.length;return b>1&&dr(o,g[0],g[1])?g=[]:b>2&&dr(g[0],g[1],g[2])&&(g=[g[0]]),If(o,sr(g,1),[]);}),Xs=tp||function(){return ir.Date.now();};function xg(o,g){if(typeof g!="function")throw new Nr(c);return o=ye(o),function(){if(--o<1)return g.apply(this,arguments);};}function yc(o,g,b){return g=b?t:g,g=o&&g==null?o.length:g,on(o,D,t,t,t,t,g);}function Pc(o,g){var b;if(typeof g!="function")throw new Nr(c);return o=ye(o),function(){return--o>0&&(b=g.apply(this,arguments)),o<=1&&(g=t),b;};}var $a=xe(function(o,g,b){var H=w;if(b.length){var tt=Sn(b,oi($a));H|=E;}return on(o,H,g,b,tt);}),Sc=xe(function(o,g,b){var H=w|d;if(b.length){var tt=Sn(b,oi(Sc));H|=E;}return on(g,H,o,b,tt);});function xc(o,g,b){g=b?t:g;var H=on(o,p,t,t,t,t,t,g);return H.placeholder=xc.placeholder,H;}function Tc(o,g,b){g=b?t:g;var H=on(o,S,t,t,t,t,t,g);return H.placeholder=Tc.placeholder,H;}function Cc(o,g,b){var H,tt,lt,gt,It,Rt,Gt=0,kt=!1,Vt=!1,_t=!0;if(typeof o!="function")throw new Nr(c);g=Yr(g)||0,Ke(b)&&(kt=!!b.leading,Vt="maxWait"in b,lt=Vt?er(Yr(b.maxWait)||0,g):lt,_t="trailing"in b?!!b.trailing:_t);function re(qe){var Hr=H,un=tt;return H=tt=t,Gt=qe,gt=o.apply(un,Hr),gt;}function ce(qe){return Gt=qe,It=Xi(Te,g),kt?re(qe):gt;}function Se(qe){var Hr=qe-Rt,un=qe-Gt,jc=g-Hr;return Vt?ar(jc,lt-un):jc;}function le(qe){var Hr=qe-Rt,un=qe-Gt;return Rt===t||Hr>=g||Hr<0||Vt&&un>=lt;}function Te(){var qe=Xs();if(le(qe))return Oe(qe);It=Xi(Te,Se(qe));}function Oe(qe){return It=t,_t&&H?re(qe):(H=tt=t,gt);}function Er(){It!==t&&Df(It),Gt=0,H=Rt=tt=It=t;}function pr(){return It===t?gt:Oe(Xs());}function Mr(){var qe=Xs(),Hr=le(qe);if(H=arguments,tt=this,Rt=qe,Hr){if(It===t)return ce(Rt);if(Vt)return Df(It),It=Xi(Te,g),re(Rt);}return It===t&&(It=Xi(Te,g)),gt;}return Mr.cancel=Er,Mr.flush=pr,Mr;}var Tg=xe(function(o,g){return hf(o,1,g);}),Cg=xe(function(o,g,b){return hf(o,Yr(g)||0,b);});function Ig(o){return on(o,M);}function zs(o,g){if(typeof o!="function"||g!=null&&typeof g!="function")throw new Nr(c);var _b=function b(){var H=arguments,tt=g?g.apply(this,H):H[0],lt=_b.cache;if(lt.has(tt))return lt.get(tt);var gt=o.apply(this,H);return _b.cache=lt.set(tt,gt)||lt,gt;};return _b.cache=new(zs.Cache||sn)(),_b;}zs.Cache=sn;function js(o){if(typeof o!="function")throw new Nr(c);return function(){var g=arguments;switch(g.length){case 0:return!o.call(this);case 1:return!o.call(this,g[0]);case 2:return!o.call(this,g[0],g[1]);case 3:return!o.call(this,g[0],g[1],g[2]);}return!o.apply(this,g);};}function wg(o){return Pc(2,o);}var Og=h0(function(o,g){g=g.length==1&&de(g[0])?He(g[0],wr(fe())):He(sr(g,1),wr(fe()));var b=g.length;return xe(function(H){for(var tt=-1,lt=ar(H.length,b);++tt<lt;)H[tt]=g[tt].call(this,H[tt]);return Cr(o,this,H);});}),Xa=xe(function(o,g){var b=Sn(g,oi(Xa));return on(o,E,t,g,b);}),Ic=xe(function(o,g){var b=Sn(g,oi(Ic));return on(o,R,t,g,b);}),Ag=an(function(o,g){return on(o,U,t,t,t,g);});function Eg(o,g){if(typeof o!="function")throw new Nr(c);return g=g===t?g:ye(g),xe(o,g);}function Mg(o,g){if(typeof o!="function")throw new Nr(c);return g=g==null?0:er(ye(g),0),xe(function(b){var H=b[g],tt=wn(b,0,g);return H&&Pn(tt,H),Cr(o,this,tt);});}function Lg(o,g,b){var H=!0,tt=!0;if(typeof o!="function")throw new Nr(c);return Ke(b)&&(H="leading"in b?!!b.leading:H,tt="trailing"in b?!!b.trailing:tt),Cc(o,g,{leading:H,maxWait:g,trailing:tt});}function Rg(o){return yc(o,1);}function bg(o,g){return Xa(wa(g),o);}function Dg(){if(!arguments.length)return[];var o=arguments[0];return de(o)?o:[o];}function Ng(o){return Wr(o,O);}function Bg(o,g){return g=typeof g=="function"?g:t,Wr(o,O,g);}function Wg(o){return Wr(o,y|O);}function Fg(o,g){return g=typeof g=="function"?g:t,Wr(o,y|O,g);}function Ug(o,g){return g==null||uf(o,g,rr(g));}function kr(o,g){return o===g||o!==o&&g!==g;}var Yg=Bs(da),$g=Bs(function(o,g){return o>=g;}),$n=mf(/* @__PURE__ */function(){return arguments;}())?mf:function(o){return Ze(o)&&Re.call(o,"callee")&&!rf.call(o,"callee");},de=Ft.isArray,Xg=Fl?wr(Fl):Zp;function Pr(o){return o!=null&&Gs(o.length)&&!fn(o);}function Qe(o){return Ze(o)&&Pr(o);}function zg(o){return o===!0||o===!1||Ze(o)&&hr(o)==G;}var On=rp||_a,jg=Ul?wr(Ul):Jp;function Gg(o){return Ze(o)&&o.nodeType===1&&!zi(o);}function kg(o){if(o==null)return!0;if(Pr(o)&&(de(o)||typeof o=="string"||typeof o.splice=="function"||On(o)||ai(o)||$n(o)))return!o.length;var g=lr(o);if(g==C||g==St)return!o.size;if($i(o))return!ga(o).length;for(var b in o)if(Re.call(o,b))return!1;return!0;}function Hg(o,g){return Fi(o,g);}function Vg(o,g,b){b=typeof b=="function"?b:t;var H=b?b(o,g):t;return H===t?Fi(o,g,t,b):!!H;}function za(o){if(!Ze(o))return!1;var g=hr(o);return g==nt||g==rt||typeof o.message=="string"&&typeof o.name=="string"&&!zi(o);}function Kg(o){return typeof o=="number"&&sf(o);}function fn(o){if(!Ke(o))return!1;var g=hr(o);return g==Y||g==Z||g==Bt||g==it;}function wc(o){return typeof o=="number"&&o==ye(o);}function Gs(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=ct;}function Ke(o){var g=_typeof(o);return o!=null&&(g=="object"||g=="function");}function Ze(o){return o!=null&&_typeof(o)=="object";}var Oc=Yl?wr(Yl):qp;function Zg(o,g){return o===g||va(o,g,ba(g));}function Jg(o,g,b){return b=typeof b=="function"?b:t,va(o,g,ba(g),b);}function Qg(o){return Ac(o)&&o!=+o;}function qg(o){if(B0(o))throw new he(s);return yf(o);}function _g(o){return o===null;}function tm(o){return o==null;}function Ac(o){return typeof o=="number"||Ze(o)&&hr(o)==L;}function zi(o){if(!Ze(o)||hr(o)!=K)return!1;var g=ms(o);if(g===null)return!0;var b=Re.call(g,"constructor")&&g.constructor;return typeof b=="function"&&b instanceof b&&ds.call(b)==Jd;}var ja=$l?wr($l):_p;function em(o){return wc(o)&&o>=-ct&&o<=ct;}var Ec=Xl?wr(Xl):t0;function ks(o){return typeof o=="string"||!de(o)&&Ze(o)&&hr(o)==Ct;}function Ar(o){return _typeof(o)=="symbol"||Ze(o)&&hr(o)==Et;}var ai=zl?wr(zl):e0;function rm(o){return o===t;}function nm(o){return Ze(o)&&lr(o)==wt;}function im(o){return Ze(o)&&hr(o)==Ot;}var sm=Bs(ma),om=Bs(function(o,g){return o<=g;});function Mc(o){if(!o)return[];if(Pr(o))return ks(o)?zr(o):yr(o);if(Mi&&o[Mi])return Ud(o[Mi]());var g=lr(o),b=g==C?ia:g==St?cs:li;return b(o);}function cn(o){if(!o)return o===0?o:0;if(o=Yr(o),o===at||o===-at){var g=o<0?-1:1;return g*V;}return o===o?o:0;}function ye(o){var g=cn(o),b=g%1;return g===g?b?g-b:g:0;}function Lc(o){return o?Wn(ye(o),0,ft):0;}function Yr(o){if(typeof o=="number")return o;if(Ar(o))return Q;if(Ke(o)){var g=typeof o.valueOf=="function"?o.valueOf():o;o=Ke(g)?g+"":g;}if(typeof o!="string")return o===0?o:+o;o=Kl(o);var b=Do.test(o);return b||Bo.test(o)?xd(o.slice(2),b?2:8):es.test(o)?Q:+o;}function Rc(o){return Qr(o,Sr(o));}function am(o){return o?Wn(ye(o),-ct,ct):o===0?o:0;}function be(o){return o==null?"":Or(o);}var lm=ii(function(o,g){if($i(g)||Pr(g)){Qr(g,rr(g),o);return;}for(var b in g)Re.call(g,b)&&Ni(o,b,g[b]);}),bc=ii(function(o,g){Qr(g,Sr(g),o);}),Dc=ii(function(o,g,b,H){Qr(g,Sr(g),o,H);}),Ga=ii(function(o,g,b,H){Qr(g,rr(g),o,H);}),fm=an(ca);function cm(o,g){var b=ni(o);return g==null?b:cf(b,g);}var um=xe(function(o,g){o=Be(o);var b=-1,H=g.length,tt=H>2?g[2]:t;for(tt&&dr(g[0],g[1],tt)&&(H=1);++b<H;)for(var lt=g[b],gt=Sr(lt),It=-1,Rt=gt.length;++It<Rt;){var Gt=gt[It],kt=o[Gt];(kt===t||kr(kt,ti[Gt])&&!Re.call(o,Gt))&&(o[Gt]=lt[Gt]);}return o;}),hm=xe(function(o){return o.push(t,Zf),Cr(Nc,t,o);});function dm(o,g){return Gl(o,fe(g,3),Jr);}function pm(o,g){return Gl(o,fe(g,3),ha);}function vm(o,g){return o==null?o:ua(o,fe(g,3),Sr);}function gm(o,g){return o==null?o:vf(o,fe(g,3),Sr);}function mm(o,g){return o&&Jr(o,fe(g,3));}function ym(o,g){return o&&ha(o,fe(g,3));}function Pm(o){return o==null?[]:As(o,rr(o));}function Sm(o){return o==null?[]:As(o,Sr(o));}function ka(o,g,b){var H=o==null?t:Fn(o,g);return H===t?b:H;}function xm(o,g){return o!=null&&qf(o,g,kp);}function Ha(o,g){return o!=null&&qf(o,g,Hp);}var Tm=Gf(function(o,g,b){g!=null&&typeof g.toString!="function"&&(g=ps.call(g)),o[g]=b;},Ka(xr)),Cm=Gf(function(o,g,b){g!=null&&typeof g.toString!="function"&&(g=ps.call(g)),Re.call(o,g)?o[g].push(b):o[g]=[b];},fe),Im=xe(Wi);function rr(o){return Pr(o)?lf(o):ga(o);}function Sr(o){return Pr(o)?lf(o,!0):r0(o);}function wm(o,g){var b={};return g=fe(g,3),Jr(o,function(H,tt,lt){Zr(b,g(H,tt,lt),H);}),b;}function Om(o,g){var b={};return g=fe(g,3),Jr(o,function(H,tt,lt){Zr(b,tt,g(H,tt,lt));}),b;}var Am=ii(function(o,g,b){Es(o,g,b);}),Nc=ii(function(o,g,b,H){Es(o,g,b,H);}),Em=an(function(o,g){var b={};if(o==null)return b;var H=!1;g=He(g,function(lt){return lt=In(lt,o),H||(H=lt.length>1),lt;}),Qr(o,La(o),b),H&&(b=Wr(b,y|T|O,C0));for(var tt=g.length;tt--;)Ta(b,g[tt]);return b;});function Mm(o,g){return Bc(o,js(fe(g)));}var Lm=an(function(o,g){return o==null?{}:i0(o,g);});function Bc(o,g){if(o==null)return{};var b=He(La(o),function(H){return[H];});return g=fe(g),wf(o,b,function(H,tt){return g(H,tt[0]);});}function Rm(o,g,b){g=In(g,o);var H=-1,tt=g.length;for(tt||(tt=1,o=t);++H<tt;){var lt=o==null?t:o[Gr(g[H])];lt===t&&(H=tt,lt=b),o=fn(lt)?lt.call(o):lt;}return o;}function bm(o,g,b){return o==null?o:Ui(o,g,b);}function Dm(o,g,b,H){return H=typeof H=="function"?H:t,o==null?o:Ui(o,g,b,H);}var Wc=Vf(rr),Fc=Vf(Sr);function Nm(o,g,b){var H=de(o),tt=H||On(o)||ai(o);if(g=fe(g,4),b==null){var lt=o&&o.constructor;tt?b=H?new lt():[]:Ke(o)?b=fn(lt)?ni(ms(o)):{}:b={};}return(tt?Ir:Jr)(o,function(gt,It,Rt){return g(b,gt,It,Rt);}),b;}function Bm(o,g){return o==null?!0:Ta(o,g);}function Wm(o,g,b){return o==null?o:Lf(o,g,wa(b));}function Fm(o,g,b,H){return H=typeof H=="function"?H:t,o==null?o:Lf(o,g,wa(b),H);}function li(o){return o==null?[]:na(o,rr(o));}function Um(o){return o==null?[]:na(o,Sr(o));}function Ym(o,g,b){return b===t&&(b=g,g=t),b!==t&&(b=Yr(b),b=b===b?b:0),g!==t&&(g=Yr(g),g=g===g?g:0),Wn(Yr(o),g,b);}function $m(o,g,b){return g=cn(g),b===t?(b=g,g=0):b=cn(b),o=Yr(o),Vp(o,g,b);}function Xm(o,g,b){if(b&&typeof b!="boolean"&&dr(o,g,b)&&(g=b=t),b===t&&(typeof g=="boolean"?(b=g,g=t):typeof o=="boolean"&&(b=o,o=t)),o===t&&g===t?(o=0,g=1):(o=cn(o),g===t?(g=o,o=0):g=cn(g)),o>g){var H=o;o=g,g=H;}if(b||o%1||g%1){var tt=of();return ar(o+tt*(g-o+Sd("1e-"+((tt+"").length-1))),g);}return Pa(o,g);}var zm=si(function(o,g,b){return g=g.toLowerCase(),o+(b?Uc(g):g);});function Uc(o){return Va(be(o).toLowerCase());}function Yc(o){return o=be(o),o&&o.replace(Fo,Dd).replace(cd,"");}function jm(o,g,b){o=be(o),g=Or(g);var H=o.length;b=b===t?H:Wn(ye(b),0,H);var tt=b;return b-=g.length,b>=0&&o.slice(b,tt)==g;}function Gm(o){return o=be(o),o&&we.test(o)?o.replace(ke,Nd):o;}function km(o){return o=be(o),o&&wo.test(o)?o.replace(Ii,"\\$&"):o;}var Hm=si(function(o,g,b){return o+(b?"-":"")+g.toLowerCase();}),Vm=si(function(o,g,b){return o+(b?" ":"")+g.toLowerCase();}),Km=Xf("toLowerCase");function Zm(o,g,b){o=be(o),g=ye(g);var H=g?qn(o):0;if(!g||H>=g)return o;var tt=(g-H)/2;return Ns(xs(tt),b)+o+Ns(Ss(tt),b);}function Jm(o,g,b){o=be(o),g=ye(g);var H=g?qn(o):0;return g&&H<g?o+Ns(g-H,b):o;}function Qm(o,g,b){o=be(o),g=ye(g);var H=g?qn(o):0;return g&&H<g?Ns(g-H,b)+o:o;}function qm(o,g,b){return b||g==null?g=0:g&&(g=+g),op(be(o).replace(wi,""),g||0);}function _m(o,g,b){return(b?dr(o,g,b):g===t)?g=1:g=ye(g),Sa(be(o),g);}function ty(){var o=arguments,g=be(o[0]);return o.length<3?g:g.replace(o[1],o[2]);}var ey=si(function(o,g,b){return o+(b?"_":"")+g.toLowerCase();});function ry(o,g,b){return b&&typeof b!="number"&&dr(o,g,b)&&(g=b=t),b=b===t?ft:b>>>0,b?(o=be(o),o&&(typeof g=="string"||g!=null&&!ja(g))&&(g=Or(g),!g&&Qn(o))?wn(zr(o),0,b):o.split(g,b)):[];}var ny=si(function(o,g,b){return o+(b?" ":"")+Va(g);});function iy(o,g,b){return o=be(o),b=b==null?0:Wn(ye(b),0,o.length),g=Or(g),o.slice(b,b+g.length)==g;}function sy(o,g,b){var H=ot.templateSettings;b&&dr(o,g,b)&&(g=t),o=be(o),g=Ga({},g,H,Kf);var tt=Ga({},g.imports,H.imports,Kf),lt=rr(tt),gt=na(tt,lt);Ir(lt,function(le){if(ts.test(le))throw new he(f);});var It,Rt,Gt=0,kt=g.interpolate||Xr,Vt="__p += '",_t=sa((g.escape||Xr).source+"|"+kt.source+"|"+(kt===Kr?bo:Xr).source+"|"+(g.evaluate||Xr).source+"|$","g"),re="//# sourceURL="+(Re.call(g,"sourceURL")?(g.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++vd+"]")+"\n";o.replace(_t,function(le,Te,Oe,Er,pr,Mr){return Oe||(Oe=Er),Vt+=o.slice(Gt,Mr).replace(Uo,Bd),Te&&(It=!0,Vt+="' +\n__e("+Te+") +\n'"),pr&&(Rt=!0,Vt+="';\n"+pr+";\n__p += '"),Oe&&(Vt+="' +\n((__t = ("+Oe+")) == null ? '' : __t) +\n'"),Gt=Mr+le.length,le;}),Vt+="';\n";var ce=Re.call(g,"variable")&&g.variable;if(!ce)Vt="with (obj) {\n"+Vt+"\n}\n";else if(ts.test(ce))throw new he(l);Vt=(Rt?Vt.replace(Fe,""):Vt).replace($e,"$1").replace(Xe,"$1;"),Vt="function("+(ce||"obj")+") {\n"+(ce?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(It?", __e = _.escape":"")+(Rt?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+Vt+"return __p\n}";var Se=Xc(function(){return Ee(lt,re+"return "+Vt).apply(t,gt);});if(Se.source=Vt,za(Se))throw Se;return Se;}function oy(o){return be(o).toLowerCase();}function ay(o){return be(o).toUpperCase();}function ly(o,g,b){if(o=be(o),o&&(b||g===t))return Kl(o);if(!o||!(g=Or(g)))return o;var H=zr(o),tt=zr(g),lt=Zl(H,tt),gt=Jl(H,tt)+1;return wn(H,lt,gt).join("");}function fy(o,g,b){if(o=be(o),o&&(b||g===t))return o.slice(0,ql(o)+1);if(!o||!(g=Or(g)))return o;var H=zr(o),tt=Jl(H,zr(g))+1;return wn(H,0,tt).join("");}function cy(o,g,b){if(o=be(o),o&&(b||g===t))return o.replace(wi,"");if(!o||!(g=Or(g)))return o;var H=zr(o),tt=Zl(H,zr(g));return wn(H,tt).join("");}function uy(o,g){var b=W,H=$;if(Ke(g)){var tt="separator"in g?g.separator:tt;b="length"in g?ye(g.length):b,H="omission"in g?Or(g.omission):H;}o=be(o);var lt=o.length;if(Qn(o)){var gt=zr(o);lt=gt.length;}if(b>=lt)return o;var It=b-qn(H);if(It<1)return H;var Rt=gt?wn(gt,0,It).join(""):o.slice(0,It);if(tt===t)return Rt+H;if(gt&&(It+=Rt.length-It),ja(tt)){if(o.slice(It).search(tt)){var Gt,kt=Rt;for(tt.global||(tt=sa(tt.source,be(vn.exec(tt))+"g")),tt.lastIndex=0;Gt=tt.exec(kt);)var Vt=Gt.index;Rt=Rt.slice(0,Vt===t?It:Vt);}}else if(o.indexOf(Or(tt),It)!=It){var _t=Rt.lastIndexOf(tt);_t>-1&&(Rt=Rt.slice(0,_t));}return Rt+H;}function hy(o){return o=be(o),o&&Je.test(o)?o.replace(Ge,zd):o;}var dy=si(function(o,g,b){return o+(b?" ":"")+g.toUpperCase();}),Va=Xf("toUpperCase");function $c(o,g,b){return o=be(o),g=b?t:g,g===t?Fd(o)?kd(o):Ed(o):o.match(g)||[];}var Xc=xe(function(o,g){try{return Cr(o,t,g);}catch(b){return za(b)?b:new he(b);}}),py=an(function(o,g){return Ir(g,function(b){b=Gr(b),Zr(o,b,$a(o[b],o));}),o;});function vy(o){var g=o==null?0:o.length,b=fe();return o=g?He(o,function(H){if(typeof H[1]!="function")throw new Nr(c);return[b(H[0]),H[1]];}):[],xe(function(H){for(var tt=-1;++tt<g;){var lt=o[tt];if(Cr(lt[0],this,H))return Cr(lt[1],this,H);}});}function gy(o){return zp(Wr(o,y));}function Ka(o){return function(){return o;};}function my(o,g){return o==null||o!==o?g:o;}var yy=jf(),Py=jf(!0);function xr(o){return o;}function Za(o){return Pf(typeof o=="function"?o:Wr(o,y));}function Sy(o){return xf(Wr(o,y));}function xy(o,g){return Tf(o,Wr(g,y));}var Ty=xe(function(o,g){return function(b){return Wi(b,o,g);};}),Cy=xe(function(o,g){return function(b){return Wi(o,b,g);};});function Ja(o,g,b){var H=rr(g),tt=As(g,H);b==null&&!(Ke(g)&&(tt.length||!H.length))&&(b=g,g=o,o=this,tt=As(g,rr(g)));var lt=!(Ke(b)&&"chain"in b)||!!b.chain,gt=fn(o);return Ir(tt,function(It){var Rt=g[It];o[It]=Rt,gt&&(o.prototype[It]=function(){var Gt=this.__chain__;if(lt||Gt){var kt=o(this.__wrapped__),Vt=kt.__actions__=yr(this.__actions__);return Vt.push({func:Rt,args:arguments,thisArg:o}),kt.__chain__=Gt,kt;}return Rt.apply(o,Pn([this.value()],arguments));});}),o;}function Iy(){return ir._===this&&(ir._=Qd),this;}function Qa(){}function wy(o){return o=ye(o),xe(function(g){return Cf(g,o);});}var Oy=Aa(He),Ay=Aa(jl),Ey=Aa(qo);function zc(o){return Na(o)?_o(Gr(o)):s0(o);}function My(o){return function(g){return o==null?t:Fn(o,g);};}var Ly=kf(),Ry=kf(!0);function qa(){return[];}function _a(){return!1;}function by(){return{};}function Dy(){return"";}function Ny(){return!0;}function By(o,g){if(o=ye(o),o<1||o>ct)return[];var b=ft,H=ar(o,ft);g=fe(g),o-=ft;for(var tt=ra(H,g);++b<o;)g(b);return tt;}function Wy(o){return de(o)?He(o,Gr):Ar(o)?[o]:yr(ac(be(o)));}function Fy(o){var g=++Zd;return be(o)+g;}var Uy=Ds(function(o,g){return o+g;},0),Yy=Ea("ceil"),$y=Ds(function(o,g){return o/g;},1),Xy=Ea("floor");function zy(o){return o&&o.length?Os(o,xr,da):t;}function jy(o,g){return o&&o.length?Os(o,fe(g,2),da):t;}function Gy(o){return Hl(o,xr);}function ky(o,g){return Hl(o,fe(g,2));}function Hy(o){return o&&o.length?Os(o,xr,ma):t;}function Vy(o,g){return o&&o.length?Os(o,fe(g,2),ma):t;}var Ky=Ds(function(o,g){return o*g;},1),Zy=Ea("round"),Jy=Ds(function(o,g){return o-g;},0);function Qy(o){return o&&o.length?ea(o,xr):0;}function qy(o,g){return o&&o.length?ea(o,fe(g,2)):0;}return ot.after=xg,ot.ary=yc,ot.assign=lm,ot.assignIn=bc,ot.assignInWith=Dc,ot.assignWith=Ga,ot.at=fm,ot.before=Pc,ot.bind=$a,ot.bindAll=py,ot.bindKey=Sc,ot.castArray=Dg,ot.chain=vc,ot.chunk=z0,ot.compact=j0,ot.concat=G0,ot.cond=vy,ot.conforms=gy,ot.constant=Ka,ot.countBy=qv,ot.create=cm,ot.curry=xc,ot.curryRight=Tc,ot.debounce=Cc,ot.defaults=um,ot.defaultsDeep=hm,ot.defer=Tg,ot.delay=Cg,ot.difference=k0,ot.differenceBy=H0,ot.differenceWith=V0,ot.drop=K0,ot.dropRight=Z0,ot.dropRightWhile=J0,ot.dropWhile=Q0,ot.fill=q0,ot.filter=tg,ot.flatMap=ng,ot.flatMapDeep=ig,ot.flatMapDepth=sg,ot.flatten=uc,ot.flattenDeep=_0,ot.flattenDepth=tv,ot.flip=Ig,ot.flow=yy,ot.flowRight=Py,ot.fromPairs=ev,ot.functions=Pm,ot.functionsIn=Sm,ot.groupBy=og,ot.initial=nv,ot.intersection=iv,ot.intersectionBy=sv,ot.intersectionWith=ov,ot.invert=Tm,ot.invertBy=Cm,ot.invokeMap=lg,ot.iteratee=Za,ot.keyBy=fg,ot.keys=rr,ot.keysIn=Sr,ot.map=$s,ot.mapKeys=wm,ot.mapValues=Om,ot.matches=Sy,ot.matchesProperty=xy,ot.memoize=zs,ot.merge=Am,ot.mergeWith=Nc,ot.method=Ty,ot.methodOf=Cy,ot.mixin=Ja,ot.negate=js,ot.nthArg=wy,ot.omit=Em,ot.omitBy=Mm,ot.once=wg,ot.orderBy=cg,ot.over=Oy,ot.overArgs=Og,ot.overEvery=Ay,ot.overSome=Ey,ot.partial=Xa,ot.partialRight=Ic,ot.partition=ug,ot.pick=Lm,ot.pickBy=Bc,ot.property=zc,ot.propertyOf=My,ot.pull=cv,ot.pullAll=dc,ot.pullAllBy=uv,ot.pullAllWith=hv,ot.pullAt=dv,ot.range=Ly,ot.rangeRight=Ry,ot.rearg=Ag,ot.reject=pg,ot.remove=pv,ot.rest=Eg,ot.reverse=Ua,ot.sampleSize=gg,ot.set=bm,ot.setWith=Dm,ot.shuffle=mg,ot.slice=vv,ot.sortBy=Sg,ot.sortedUniq=Tv,ot.sortedUniqBy=Cv,ot.split=ry,ot.spread=Mg,ot.tail=Iv,ot.take=wv,ot.takeRight=Ov,ot.takeRightWhile=Av,ot.takeWhile=Ev,ot.tap=jv,ot.throttle=Lg,ot.thru=Ys,ot.toArray=Mc,ot.toPairs=Wc,ot.toPairsIn=Fc,ot.toPath=Wy,ot.toPlainObject=Rc,ot.transform=Nm,ot.unary=Rg,ot.union=Mv,ot.unionBy=Lv,ot.unionWith=Rv,ot.uniq=bv,ot.uniqBy=Dv,ot.uniqWith=Nv,ot.unset=Bm,ot.unzip=Ya,ot.unzipWith=pc,ot.update=Wm,ot.updateWith=Fm,ot.values=li,ot.valuesIn=Um,ot.without=Bv,ot.words=$c,ot.wrap=bg,ot.xor=Wv,ot.xorBy=Fv,ot.xorWith=Uv,ot.zip=Yv,ot.zipObject=$v,ot.zipObjectDeep=Xv,ot.zipWith=zv,ot.entries=Wc,ot.entriesIn=Fc,ot.extend=bc,ot.extendWith=Dc,Ja(ot,ot),ot.add=Uy,ot.attempt=Xc,ot.camelCase=zm,ot.capitalize=Uc,ot.ceil=Yy,ot.clamp=Ym,ot.clone=Ng,ot.cloneDeep=Wg,ot.cloneDeepWith=Fg,ot.cloneWith=Bg,ot.conformsTo=Ug,ot.deburr=Yc,ot.defaultTo=my,ot.divide=$y,ot.endsWith=jm,ot.eq=kr,ot.escape=Gm,ot.escapeRegExp=km,ot.every=_v,ot.find=eg,ot.findIndex=fc,ot.findKey=dm,ot.findLast=rg,ot.findLastIndex=cc,ot.findLastKey=pm,ot.floor=Xy,ot.forEach=gc,ot.forEachRight=mc,ot.forIn=vm,ot.forInRight=gm,ot.forOwn=mm,ot.forOwnRight=ym,ot.get=ka,ot.gt=Yg,ot.gte=$g,ot.has=xm,ot.hasIn=Ha,ot.head=hc,ot.identity=xr,ot.includes=ag,ot.indexOf=rv,ot.inRange=$m,ot.invoke=Im,ot.isArguments=$n,ot.isArray=de,ot.isArrayBuffer=Xg,ot.isArrayLike=Pr,ot.isArrayLikeObject=Qe,ot.isBoolean=zg,ot.isBuffer=On,ot.isDate=jg,ot.isElement=Gg,ot.isEmpty=kg,ot.isEqual=Hg,ot.isEqualWith=Vg,ot.isError=za,ot.isFinite=Kg,ot.isFunction=fn,ot.isInteger=wc,ot.isLength=Gs,ot.isMap=Oc,ot.isMatch=Zg,ot.isMatchWith=Jg,ot.isNaN=Qg,ot.isNative=qg,ot.isNil=tm,ot.isNull=_g,ot.isNumber=Ac,ot.isObject=Ke,ot.isObjectLike=Ze,ot.isPlainObject=zi,ot.isRegExp=ja,ot.isSafeInteger=em,ot.isSet=Ec,ot.isString=ks,ot.isSymbol=Ar,ot.isTypedArray=ai,ot.isUndefined=rm,ot.isWeakMap=nm,ot.isWeakSet=im,ot.join=av,ot.kebabCase=Hm,ot.last=Ur,ot.lastIndexOf=lv,ot.lowerCase=Vm,ot.lowerFirst=Km,ot.lt=sm,ot.lte=om,ot.max=zy,ot.maxBy=jy,ot.mean=Gy,ot.meanBy=ky,ot.min=Hy,ot.minBy=Vy,ot.stubArray=qa,ot.stubFalse=_a,ot.stubObject=by,ot.stubString=Dy,ot.stubTrue=Ny,ot.multiply=Ky,ot.nth=fv,ot.noConflict=Iy,ot.noop=Qa,ot.now=Xs,ot.pad=Zm,ot.padEnd=Jm,ot.padStart=Qm,ot.parseInt=qm,ot.random=Xm,ot.reduce=hg,ot.reduceRight=dg,ot.repeat=_m,ot.replace=ty,ot.result=Rm,ot.round=Zy,ot.runInContext=Mt,ot.sample=vg,ot.size=yg,ot.snakeCase=ey,ot.some=Pg,ot.sortedIndex=gv,ot.sortedIndexBy=mv,ot.sortedIndexOf=yv,ot.sortedLastIndex=Pv,ot.sortedLastIndexBy=Sv,ot.sortedLastIndexOf=xv,ot.startCase=ny,ot.startsWith=iy,ot.subtract=Jy,ot.sum=Qy,ot.sumBy=qy,ot.template=sy,ot.times=By,ot.toFinite=cn,ot.toInteger=ye,ot.toLength=Lc,ot.toLower=oy,ot.toNumber=Yr,ot.toSafeInteger=am,ot.toString=be,ot.toUpper=ay,ot.trim=ly,ot.trimEnd=fy,ot.trimStart=cy,ot.truncate=uy,ot.unescape=hy,ot.uniqueId=Fy,ot.upperCase=dy,ot.upperFirst=Va,ot.each=gc,ot.eachRight=mc,ot.first=hc,Ja(ot,function(){var o={};return Jr(ot,function(g,b){Re.call(ot.prototype,b)||(o[b]=g);}),o;}(),{chain:!1}),ot.VERSION=r,Ir(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){ot[o].placeholder=ot;}),Ir(["drop","take"],function(o,g){Ie.prototype[o]=function(b){b=b===t?1:er(ye(b),0);var H=this.__filtered__&&!g?new Ie(this):this.clone();return H.__filtered__?H.__takeCount__=ar(b,H.__takeCount__):H.__views__.push({size:ar(b,ft),type:o+(H.__dir__<0?"Right":"")}),H;},Ie.prototype[o+"Right"]=function(b){return this.reverse()[o](b).reverse();};}),Ir(["filter","map","takeWhile"],function(o,g){var b=g+1,H=b==z||b==et;Ie.prototype[o]=function(tt){var lt=this.clone();return lt.__iteratees__.push({iteratee:fe(tt,3),type:b}),lt.__filtered__=lt.__filtered__||H,lt;};}),Ir(["head","last"],function(o,g){var b="take"+(g?"Right":"");Ie.prototype[o]=function(){return this[b](1).value()[0];};}),Ir(["initial","tail"],function(o,g){var b="drop"+(g?"":"Right");Ie.prototype[o]=function(){return this.__filtered__?new Ie(this):this[b](1);};}),Ie.prototype.compact=function(){return this.filter(xr);},Ie.prototype.find=function(o){return this.filter(o).head();},Ie.prototype.findLast=function(o){return this.reverse().find(o);},Ie.prototype.invokeMap=xe(function(o,g){return typeof o=="function"?new Ie(this):this.map(function(b){return Wi(b,o,g);});}),Ie.prototype.reject=function(o){return this.filter(js(fe(o)));},Ie.prototype.slice=function(o,g){o=ye(o);var b=this;return b.__filtered__&&(o>0||g<0)?new Ie(b):(o<0?b=b.takeRight(-o):o&&(b=b.drop(o)),g!==t&&(g=ye(g),b=g<0?b.dropRight(-g):b.take(g-o)),b);},Ie.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse();},Ie.prototype.toArray=function(){return this.take(ft);},Jr(Ie.prototype,function(o,g){var b=/^(?:filter|find|map|reject)|While$/.test(g),H=/^(?:head|last)$/.test(g),tt=ot[H?"take"+(g=="last"?"Right":""):g],lt=H||/^find/.test(g);tt&&(ot.prototype[g]=function(){var gt=this.__wrapped__,It=H?[1]:arguments,Rt=gt instanceof Ie,Gt=It[0],kt=Rt||de(gt),Vt=function Vt(Te){var Oe=tt.apply(ot,Pn([Te],It));return H&&_t?Oe[0]:Oe;};kt&&b&&typeof Gt=="function"&&Gt.length!=1&&(Rt=kt=!1);var _t=this.__chain__,re=!!this.__actions__.length,ce=lt&&!_t,Se=Rt&&!re;if(!lt&&kt){gt=Se?gt:new Ie(this);var le=o.apply(gt,It);return le.__actions__.push({func:Ys,args:[Vt],thisArg:t}),new Br(le,_t);}return ce&&Se?o.apply(this,It):(le=this.thru(Vt),ce?H?le.value()[0]:le.value():le);});}),Ir(["pop","push","shift","sort","splice","unshift"],function(o){var g=us[o],b=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",H=/^(?:pop|shift)$/.test(o);ot.prototype[o]=function(){var tt=arguments;if(H&&!this.__chain__){var lt=this.value();return g.apply(de(lt)?lt:[],tt);}return this[b](function(gt){return g.apply(de(gt)?gt:[],tt);});};}),Jr(Ie.prototype,function(o,g){var b=ot[g];if(b){var H=b.name+"";Re.call(ri,H)||(ri[H]=[]),ri[H].push({name:g,func:b});}}),ri[bs(t,d).name]=[{name:"wrapper",func:t}],Ie.prototype.clone=dp,Ie.prototype.reverse=pp,Ie.prototype.value=vp,ot.prototype.at=Gv,ot.prototype.chain=kv,ot.prototype.commit=Hv,ot.prototype.next=Vv,ot.prototype.plant=Zv,ot.prototype.reverse=Jv,ot.prototype.toJSON=ot.prototype.valueOf=ot.prototype.value=Qv,ot.prototype.first=ot.prototype.head,Mi&&(ot.prototype[Mi]=Kv),ot;},_n=Hd();bn?((bn.exports=_n)._=_n,Ko._=_n):ir._=_n;}).call(hn);})(oo,oo.exports);oo.exports;var Js=5,En=/*#__PURE__*/function(_$t11){function En(t){var _this80;_classCallCheck(this,En);_this80=_callSuper(this,En,[t]);dt(_this80,"canRotate",!1);dt(_this80,"scaleType",Ce.proportional);dt(_this80,"toolsType",Tt.Text);dt(_this80,"tmpPoints",[]);dt(_this80,"workOptions");dt(_this80,"oldRect");_this80.workOptions=t.toolsOpt;return _this80;}_inherits(En,_$t11);return _createClass(En,[{key:"consume",value:function consume(){return{type:vt.None};}},{key:"consumeAll",value:function consumeAll(){return{type:vt.None};}},{key:"consumeService",value:function consumeService(){}},{key:"draw",value:function(){var _draw3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee22(t){var r,n,s,c,_this$workOptions14,l,f,u,v,h,y,T,O,I,P,_w44,_d41,m;return _regenerator().w(function(_context24){while(1)switch(_context24.n){case 0:r=t.workId,n=t.layer,s=t.isDrawLabel,c=t.boxRect,_this$workOptions14=this.workOptions,l=_this$workOptions14.boxSize,f=_this$workOptions14.boxPoint,u=_this$workOptions14.zIndex,v=n.worldPosition,h=n.worldScaling;if(!(!f||!l)){_context24.n=1;break;}return _context24.a(2);case 1:y={name:r,id:r,pos:[f[0]-Js,f[1]-Js],anchor:[0,0],size:l,zIndex:u},T=new cr(y),O={x:f[0]-Js,y:f[1]-Js,w:l[0],h:l[1]},I={x:Math.floor(O.x*h[0]+v[0]),y:Math.floor(O.y*h[1]+v[1]),w:Math.floor(O.w*h[0])+2,h:Math.floor(O.h*h[1])+2};this.replace(n,r,T);if(!(c&&(P=Ji(I,c)),(s||c&&P!==Tr.outside)&&n&&this.workOptions.text)){_context24.n=3;break;}_context24.n=2;return En.createLabels(this.workOptions,n,I);case 2:_w44=_context24.v;_d41=_w44.labels;m=_w44.maxWidth;T.append.apply(T,_toConsumableArray(_d41)),I.w=Math.ceil(Math.max(m*n.worldScaling[0],I.w));case 3:return _context24.a(2,I);}},_callee22,this);}));function draw(_x30){return _draw3.apply(this,arguments);}return draw;}()},{key:"consumeServiceAsync",value:function(){var _consumeServiceAsync2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee23(t){var v,h,y,T,r,n,s,c,l,f,u;return _regenerator().w(function(_context25){while(1)switch(_context25.n){case 0:r=(v=this.workId)==null?void 0:v.toString();if(r){_context25.n=1;break;}return _context25.a(2);case 1:n=t.isFullWork,s=t.replaceId,c=t.isDrawLabel,l=t.boxRect;this.oldRect=s&&((y=(h=this.vNodes)==null?void 0:h.get(s))==null?void 0:y.rect)||void 0;f=n?this.fullLayer:this.drawLayer||this.fullLayer;_context25.n=2;return this.draw({workId:r,layer:f,isDrawLabel:_typeof(c)>"u"&&this.workOptions.workState===te.Done||c,boxRect:l});case 2:u=_context25.v;return _context25.a(2,((T=this.vNodes)==null||T.setInfo(r,{rect:u,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:u&&$t.getCenterPos(u,f)}),u));}},_callee23,this);}));function consumeServiceAsync(_x31){return _consumeServiceAsync2.apply(this,arguments);}return consumeServiceAsync;}()},{key:"updataOptService",value:function updataOptService(){}},{key:"updataOptServiceAsync",value:function(){var _updataOptServiceAsync=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee24(t,r,n){var I,P,s,c,l,f,u,v,h,y,T,O;return _regenerator().w(function(_context26){while(1)switch(_context26.n){case 0:if(this.workId){_context26.n=1;break;}return _context26.a(2);case 1:s=this.workId.toString(),c=t.fontColor,l=t.fontBgColor,f=t.bold,u=t.italic,v=t.lineThrough,h=t.underline,y=t.zIndex,T=(I=this.vNodes)==null?void 0:I.get(s);if(T){_context26.n=2;break;}return _context26.a(2);case 2:c&&(T.opt.fontColor=c),l&&(T.opt.fontBgColor=l),f&&(T.opt.bold=f),u&&(T.opt.italic=u),zn(v)&&(T.opt.lineThrough=v),zn(h)&&(T.opt.underline=h),_e(y)&&(T.opt.zIndex=y),this.oldRect=T.rect;_context26.n=3;return this.draw({workId:s,layer:this.fullLayer,isDrawLabel:_typeof(r)>"u"&&this.workOptions.workState===te.Done||r,boxRect:n});case 3:O=_context26.v;return _context26.a(2,((P=this.vNodes)==null||P.setInfo(s,{rect:O,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:O&&$t.getCenterPos(O,this.fullLayer)}),O));}},_callee24,this);}));function updataOptServiceAsync(_x32,_x33,_x34){return _updataOptServiceAsync.apply(this,arguments);}return updataOptServiceAsync;}()},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"getSafetySnippetRatio",value:function getSafetySnippetRatio(t){var r=(t==null?void 0:t.parent).displayRatio||1,n=Math.ceil(t.worldScaling[0]*10)/10;var s=n;return n<=2?s=n*r*2:n>2&&n<=3?s=n*r*1.6:n>3&&n<=4?s=n*r*1.2:n>4&&(s=n*r),Math.floor(s*1e3)/1e3;}},{key:"getSafetySnippetFontLength",value:function getSafetySnippetFontLength(t){return Math.floor(En.textImageSnippetSize*3/4/t)||1;}},{key:"createLabels",value:function(){var _createLabels=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee25(t,r,n){var W,s,c,l,_ref166,f,u,v,h,y,T,O,I,P,w,d,m,p,S,E,R,D,U,M,$,B,N,z,J,et,at,ct,V,Q,ft,yt,At,ht,Nt,Bt,G,k,rt,nt,mt,_ht2,_Nt,_Bt,_ht3,_Nt2,_yt3,_At2;return _regenerator().w(function(_context27){while(1)switch(_context27.n){case 0:s=[],c=n.x,l=n.y,_ref166=(W=r.parent)==null?void 0:W.parent,f=_ref166.width,u=_ref166.height,v=mi(t.text),h=v.length,y=t.fontSize,T=t.lineHeight,O=t.bold,I=t.textAlign,P=t.italic,w=t.fontFamily,d=t.verticalAlign,m=t.fontColor,p=t.fontBgColor,S=t.underline,E=t.lineThrough,R=En.getSafetySnippetRatio(r)||1,D=Math.floor(y*R),U=En.getSafetySnippetFontLength(D);M=0;$=0;case 1:if(!($<h)){_context27.n=7;break;}B=v[$],N=T||D*1.5;if(!B){_context27.n=6;break;}z=aE(B),J=[0,0],et=[0,y*1.2];d==="middle"&&(J[1]=Math.floor($*y*1.2+6+y*(1.1-1)));at=[0,Math.floor(-y*0.15)];J[0]=6;ct=Math.sin(Math.PI/180*20);V=0;Q=[];ft=0;case 2:if(!(ft<z)){_context27.n=5;break;}I==="left"&&(at[0]=V),ft===0&&P==="italic"&&(at[0]=at[0]-ct/2*y);yt=B.slice(ft,ft+U);At={anchor:[0,0],pos:at,text:yt,fontFamily:w,fontSize:D,lineHeight:N,strokeColor:m,fontWeight:O,fillColor:m,textAlign:I,fontStyle:P,scale:[1/R,1/R]};ht=new r1(At);_context27.n=3;return ht.textImageReady;case 3:Nt=_context27.v;Bt=!0;if(Nt){G=Nt.rect&&Nt.rect[2],k=Nt.rect&&Nt.rect[3];if(G&&k){rt=G/R,nt=k/R;V=rt+V,P==="italic"&&(O==="bold"?V=V-ct*y*1.2:V=V-ct*y),((at[0]+J[0]+rt)*r.worldScaling[0]+c<=0||(at[0]+J[0])*r.worldScaling[0]+c>=f||(at[1]+J[1]+nt)*r.worldScaling[1]+l<=0||(at[1]+J[1])*r.worldScaling[1]+l>=u)&&(ht.disconnect(),Bt=!1),Bt&&Q.push(ht);}}ft+=U;case 4:_context27.n=2;break;case 5:et[0]=V,P==="italic"&&(et[0]=et[0]+ct*y),M=Math.max(M,et[0]);mt=!0;if(((J[0]+et[0])*r.worldScaling[0]+c<=0||J[0]*r.worldScaling[0]+c>=f||(J[1]+et[1])*r.worldScaling[0]+l<=0||J[1]*r.worldScaling[1]+l>=u)&&(mt=!1),mt){if(S){_ht2=Math.floor(y/10),_Nt={normalize:!1,pos:[0,y*1.1+_ht2/2],lineWidth:_ht2,points:[0,0,Math.ceil(et[0]),0],strokeColor:m,className:"underline"},_Bt=new dn(_Nt);Q.push(_Bt);}if(E){_ht3={normalize:!1,pos:[0,y*1.2/2],lineWidth:Math.floor(y/10),points:[0,0,Math.ceil(et[0]),0],strokeColor:m,className:"lineThrough"},_Nt2=new dn(_ht3);Q.push(_Nt2);}_yt3={pos:J,anchor:[0,0],size:et,bgcolor:p},_At2=new cr(_yt3);_At2.append.apply(_At2,Q),s.push(_At2);}case 6:$++;_context27.n=1;break;case 7:return _context27.a(2,{labels:s,maxWidth:M});}},_callee25);}));function createLabels(_x35,_x36,_x37){return _createLabels.apply(this,arguments);}return createLabels;}()},{key:"updateNodeOpt",value:function updateNodeOpt(t){var r=t.node,n=t.opt,s=t.vNodes,c=t.targetNode,l=n.fontBgColor,f=n.fontColor,u=n.translate,v=n.originPoint,h=n.scenePoint,y=n.scale,T=n.bold,O=n.italic,I=n.lineThrough,P=n.underline,w=n.fontSize,d=n.textInfos,m=n.zIndex,p=c&&fr(c)||s.get(r.name);if(!p||!r.parent)return;var E=p.opt;if(_e(m)&&(r.setAttribute("zIndex",m),p.opt.zIndex=m),f&&E.fontColor&&(E.fontColor=f,r.children.forEach(function(R){R.tagName==="GROUP"&&R.children.forEach(function(D){D.tagName==="LABEL"?(D.setAttribute("fillColor",f),D.setAttribute("strokeColor",f)):D.tagName==="POLYLINE"&&D.setAttribute("strokeColor",f);});})),l&&E.fontBgColor&&(E.fontBgColor=l,r.children.forEach(function(R){R.tagName==="GROUP"&&R.setAttribute("bgcolor",l);})),T&&(E.bold=T),O&&(E.italic=O),zn(I)&&(E.lineThrough=I),zn(P)&&(E.underline=P),w&&(E.fontSize=w),v&&h&&y&&c&&E.boxPoint){var R=d==null?void 0:d.get(r.name);if(R){var W=R.fontSize,$=R.boxSize;E.boxSize=$||E.boxSize,E.fontSize=W||E.fontSize;}var D=[E.boxPoint[0],E.boxPoint[1]];Co(E.boxPoint,h,y,u);var U=[p.op[0],p.op[1]],M=[U[0]-D[0],U[1]-D[1]];if(p.centerPos=[p.centerPos[0]+M[0],p.centerPos[1]+M[1]],p.opt.eraserlines){var _iterator31=_createForOfIteratorHelper(p.opt.eraserlines),_step31;try{for(_iterator31.s();!(_step31=_iterator31.n()).done;){var _W17=_step31.value;var _$9=_W17.op,B=_W17.thickness;_W17.thickness=Math.round(B*Math.max(y[0],y[1]));for(var N=0;N<_$9.length;N++)Dl(_$9[N],h,y,u);}}catch(err){_iterator31.e(err);}finally{_iterator31.f();}}}else if(u&&E.boxPoint&&(E.boxPoint=[Math.round(E.boxPoint[0]+u[0]),Math.round(E.boxPoint[1]+u[1])],p.centerPos=[p.centerPos[0]+u[0],p.centerPos[1]+u[1]],p.opt.eraserlines)){var _iterator32=_createForOfIteratorHelper(p.opt.eraserlines),_step32;try{for(_iterator32.s();!(_step32=_iterator32.n()).done;){var _R5=_step32.value;var _D4=_R5.op;for(var _U21=0;_U21<_D4.length;_U21++){var _M19=_D4[_U21].map(function(W,$){return $%2?W+u[1]:W+u[0];});_R5.op[_U21]=_M19;}}}catch(err){_iterator32.e(err);}finally{_iterator32.f();}}return p&&s.setInfo(r.name,p),p==null?void 0:p.rect;}},{key:"getRectFromLayer",value:function getRectFromLayer(t,r){var n=t.getElementsByName(r)[0];if(n){var s=n.getBoundingClientRect();var c={x:Math.floor(s.x),y:Math.floor(s.y),w:Math.floor(s.width+2),h:Math.floor(s.height+2)};return n.children.forEach(function(l){if(l.tagName==="GROUP"){var f=n.getBoundingClientRect();c=Zt(c,{x:Math.floor(f.x),y:Math.floor(f.y),w:Math.floor(f.width+2),h:Math.floor(f.height+2)});}}),c;}}}]);}($t);// 4k
|
|
480
|
+
dt(En,"textImageSnippetSize",1024*4),dt(En,"SafeBorderPadding",30);var Vi=En;var pi=/*#__PURE__*/function(_$t12){function pi(t){var _this81;_classCallCheck(this,pi);_this81=_callSuper(this,pi,[t]);dt(_this81,"canRotate",!1);dt(_this81,"scaleType",Ce.none);dt(_this81,"toolsType",Tt.PencilEraser);dt(_this81,"tmpPoints",[]);dt(_this81,"workOptions");dt(_this81,"worldPosition");dt(_this81,"worldScaling");dt(_this81,"eraserRect");dt(_this81,"eraserPolyline");_this81.workOptions=t.toolsOpt,_this81.worldPosition=_this81.fullLayer.worldPosition,_this81.worldScaling=_this81.fullLayer.worldScaling;return _this81;}/** 批量合并消费本地数据,返回绘制结果 */_inherits(pi,_$t12);return _createClass(pi,[{key:"combineConsume",value:function combineConsume(t){var r=t.workerEngine;if(this.tmpPoints.length<2)return{type:vt.None};var n=this.workOptions.thickness,_pi$eraserSizes$n=pi.eraserSizes[n],s=_pi$eraserSizes$n.width,c=_pi$eraserSizes$n.height,l=Math.round(Math.max(s,c)/this.worldScaling[0]),_this$getChangeNodes=this.getChangeNodes(l,r),f=_this$getChangeNodes.rect,u=_this$getChangeNodes.willNewNodes,v=_this$getChangeNodes.willDeleteNodes;return _objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:vt.DrawWork,rect:f,willNewNodes:u,willDeleteNodes:v});}},{key:"consumeService",value:function consumeService(){}},{key:"updateTempPoints",value:function updateTempPoints(t,r){var n=this.tmpPoints.length-1;var s=Date.now();for(var c=0;c<t.length;c+=2){var l=this.tmpPoints.length,f=new Jt(t[c],t[c+1]);if(l===0){this.tmpPoints.push(f);continue;}var u=l-1,v=this.tmpPoints[u],h=pt.Sub(f,v).uni();f.isNear(v,r/2)||(pt.Equals(h,v.v,0.02)&&(this.tmpPoints.pop(),n--),f.setv(h),f.setT(s),this.tmpPoints.push(f));}return Math.max(n,0);}},{key:"getChangeNodes",value:function getChangeNodes(t,r){var n=/* @__PURE__ */new Map(),s=/* @__PURE__ */new Set();var c;if(!this.vNodes)return{willDeleteNodes:s,willNewNodes:n,rect:c};var l=this.worldPosition;var f=De(this.tmpPoints,t);f=Zi(f,l),f=Jh(f,this.worldScaling,l);var _this$vNodes$getRectI3=this.vNodes.getRectIntersectRange(f),u=_this$vNodes$getRectI3.nodeRange;if(!u.size)return{willDeleteNodes:s,willNewNodes:n,rect:c};var v=this.computEraserPointLines(this.tmpPoints,90);var _iterator33=_createForOfIteratorHelper(u.entries()),_step33;try{for(_iterator33.s();!(_step33=_iterator33.n()).done;){var _step33$value=_slicedToArray(_step33.value,2),h=_step33$value[0],y=_step33$value[1];if(y.toolsType!==Tt.Pencil)continue;var T=Zi(y.rect,[-l[0],-l[1]]);T={x:T.x/this.worldScaling[0],y:T.y/this.worldScaling[1],w:T.w/this.worldScaling[0],h:T.h/this.worldScaling[1]};var O=[T.x,T.y,T.x+T.w,T.y+T.h],I=[],P=[];var _iterator34=_createForOfIteratorHelper(v),_step34;try{for(_iterator34.s();!(_step34=_iterator34.n()).done;){var _w47=_step34.value;Ol.polyline(_w47,O,I);}}catch(err){_iterator34.e(err);}finally{_iterator34.f();}if(I.length&&y.opt){var _iterator35=_createForOfIteratorHelper(I),_step35;try{for(_iterator35.s();!(_step35=_iterator35.n()).done;){var _w45=_step35.value;var _d42=[];for(var m=0;m<_w45.length;m++)m!==0&&_r(_w45[m],_w45[m-1])||_d42.push.apply(_d42,_toConsumableArray(_w45[m]));P.push(_d42);}}catch(err){_iterator35.e(err);}finally{_iterator35.f();}}if(P.length&&r){var _w46=r.createWorkShapeNode({workId:h,toolsType:Tt.Pencil,toolsOpt:y.opt});_w46.setWorkId(h);var _d43=_w46==null?void 0:_w46.computPencilPoints({op:y.op,eraserPolylines:P,eraserThickness:t});if(c=Zt(c,y.rect),s.add(h),r.removeNode(h),_d43.length)for(var _m11=0;_m11<_d43.length;_m11++){var p="".concat(h,"_").concat(Date.now(),"_").concat(_m11),S=p,R=r.setFullWork({workId:S,opt:y.opt,toolsType:Tt.Pencil}).consumeService({op:_d43[_m11],isFullWork:!0,replaceId:S});r.clearWorkShapeNodeCache(S),c=Zt(c,R),n.set(p,_objectSpread(_objectSpread({},y),{},{toolsType:Tt.Pencil,rect:R!==null&&R!==void 0?R:y.rect,name:p,op:_d43[_m11]}));}}}}catch(err){_iterator33.e(err);}finally{_iterator33.f();}return{willNewNodes:n,willDeleteNodes:s,rect:c};}},{key:"consume",value:function consume(t){var r=t.data,n=r.op;if(!n||n.length===0)return _objectSpread({type:vt.None},this.baseConsumeResult);var s=this.workOptions.thickness,_pi$eraserSizes$s=pi.eraserSizes[s],c=_pi$eraserSizes$s.width,l=_pi$eraserSizes$s.height,f=Math.max(c,l)/this.worldScaling[0];return this.updateTempPoints(n,f),_objectSpread({type:vt.None},this.baseConsumeResult);}},{key:"computEraserPointLines",value:function computEraserPointLines(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:60;var n=[];var s=0;var c=360-r;for(var l=1;l<t.length;l++){var f=t[l-1],u=t[l];if(l===1&&s===0&&(n[s]=[f.XY]),n[s].push(u.XY),l<t.length-1){var v=u.getAngleByPoints(f,t[l+1]);(v<r||v>c)&&(s++,n[s]=[u.XY]);}}return t.length===1&&n.length===0&&n.push([t[0].XY,t[0].XY]),n;}},{key:"consumeAll",value:function consumeAll(t){var r=t.workerEngine;if(this.replace(this.fullLayer,this.workId),!this.tmpPoints.length)return _objectSpread({type:vt.None},this.baseConsumeResult);var n=this.workOptions.thickness,_pi$eraserSizes$n2=pi.eraserSizes[n],s=_pi$eraserSizes$n2.width,c=_pi$eraserSizes$n2.height,l=Math.max(s,c)/this.worldScaling[0],_this$getChangeNodes2=this.getChangeNodes(l,r),f=_this$getChangeNodes2.willDeleteNodes,u=_this$getChangeNodes2.willNewNodes,v=_this$getChangeNodes2.rect;if(f.size===0&&u.size===0)return _objectSpread(_objectSpread({type:vt.FullWork},this.baseConsumeResult),{},{rect:v});var h=[];this.tmpPoints.map(function(T){h.push(T.x,T.y,l/2);});var y=mr(h);return _objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:vt.FullWork,dataType:Kt.Local,rect:v,ops:y,willNewNodes:u,willDeleteNodes:f});}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}]);}($t);// 来源于white-sdk
|
|
481
|
+
dt(pi,"eraserSizes",wl);var ao=pi;var vi=/*#__PURE__*/function(_$t13){function vi(t){var _this82;_classCallCheck(this,vi);_this82=_callSuper(this,vi,[t]);dt(_this82,"canRotate",!1);dt(_this82,"scaleType",Ce.none);dt(_this82,"toolsType",Tt.BitMapEraser);dt(_this82,"tmpPoints",[]);dt(_this82,"workOptions");dt(_this82,"worldPosition");dt(_this82,"worldScaling");dt(_this82,"eraserRect");dt(_this82,"eraserPolyline");dt(_this82,"oldRect");_this82.workOptions=t.toolsOpt,_this82.worldPosition=_this82.fullLayer.worldPosition,_this82.worldScaling=_this82.fullLayer.worldScaling;return _this82;}/** 批量合并消费本地数据,返回绘制结果 */_inherits(vi,_$t13);return _createClass(vi,[{key:"combineConsume",value:function combineConsume(t){var r=t.workerEngine;if(this.tmpPoints.length<2)return{type:vt.None};var n=this.workOptions.thickness,_vi$eraserSizes$n=vi.eraserSizes[n],s=_vi$eraserSizes$n.width,c=_vi$eraserSizes$n.height,l=Math.round(Math.max(s,c)/this.worldScaling[0]),_this$getChangeNodes3=this.getChangeNodes(l,r),f=_this$getChangeNodes3.willDeleteNodes,u=_this$getChangeNodes3.rect;return _objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:vt.DrawWork,rect:u,willDeleteNodes:f});}},{key:"consumeService",value:function consumeService(){}},{key:"updateTempPoints",value:function updateTempPoints(t,r){var n=this.tmpPoints.length-1;var s=Date.now();for(var c=0;c<t.length;c+=2){var l=this.tmpPoints.length,f=new Jt(t[c],t[c+1]);if(l===0){this.tmpPoints.push(f);continue;}var u=l-1,v=this.tmpPoints[u],h=pt.Sub(f,v).uni();f.isNear(v,r/2)||(pt.Equals(h,v.v,0.02)&&(this.tmpPoints.pop(),n--),f.setv(h),f.setT(s),this.tmpPoints.push(f));}return Math.max(n,0);}},{key:"getChangeNodes",value:function getChangeNodes(t,r){var _this83=this;var n=/* @__PURE__ */new Map(),s=/* @__PURE__ */new Set();var c;if(!this.vNodes)return{willDeleteNodes:s,willUpdateNodes:n,rect:c};var l=this.worldPosition;var f=De(this.tmpPoints,t);f=Zi(f,l),f=Jh(f,this.worldScaling,l);var _this$vNodes$getRectI4=this.vNodes.getRectIntersectRange(f),u=_this$vNodes$getRectI4.nodeRange;if(!u.size)return{willDeleteNodes:s,willUpdateNodes:n,rect:c};var v=this.computEraserPointLines(this.tmpPoints,120);var _iterator36=_createForOfIteratorHelper(u.entries()),_step36;try{for(_iterator36.s();!(_step36=_iterator36.n()).done;){var _step36$value=_slicedToArray(_step36.value,2),h=_step36$value[0],y=_step36$value[1];if(y.toolsType===Tt.Text||y.toolsType===Tt.Image)continue;var T=Zi(y.rect,[-l[0],-l[1]]);T={x:T.x/this.worldScaling[0],y:T.y/this.worldScaling[1],w:T.w/this.worldScaling[0],h:T.h/this.worldScaling[1]};var O=[T.x,T.y,T.x+T.w,T.y+T.h],I=[],P=[];var _iterator37=_createForOfIteratorHelper(v),_step37;try{for(_iterator37.s();!(_step37=_iterator37.n()).done;){var _m13=_step37.value;Ol.polyline(_m13,O,I);}}catch(err){_iterator37.e(err);}finally{_iterator37.f();}if(I.length&&y.opt){var _iterator38=_createForOfIteratorHelper(I),_step38;try{for(_iterator38.s();!(_step38=_iterator38.n()).done;){var m=_step38.value;var p=[];for(var S=0;S<m.length&&!(isNaN(m[S][0])||isNaN(m[S][1]));S++){var E=m[S].map(function(R){return Math.round(R*100)/100;});if(S!==0){var R=m[S-1].map(function(D){return Math.round(D*100)/100;});if(_r(E,R))continue;}p.push.apply(p,_toConsumableArray(E));}p.length!==0&&P.push(p);}}catch(err){_iterator38.e(err);}finally{_iterator38.f();}}if(!P.length)continue;var _w48=y.opt.eraserlines?y.opt.eraserlines:[],_d44=_w48.find(function(m){return m.workId===_this83.workId;});if(_d44?_d44.op=P:_w48.push({workId:this.workId,op:P,thickness:t}),y.opt.eraserlines=_w48,r){var _m12=y.toolsType,_p13=r.createWorkShapeNode({workId:h,toolsType:_m12,toolsOpt:y.opt});_p13==null||_p13.setWorkId(h);var _S13=_p13==null?void 0:_p13.consumeService({op:y.op,isFullWork:!0,replaceId:h});if(c=Zt(c,_S13),_p13!=null&&_p13.isDelete){r.removeNode(h),s.add(h);continue;}}n.set(h,y);}}catch(err){_iterator36.e(err);}finally{_iterator36.f();}return{willUpdateNodes:n,willDeleteNodes:s,rect:c};}},{key:"consume",value:function consume(t){var r=t.data,n=r.op;if(!n||n.length===0)return _objectSpread({type:vt.None},this.baseConsumeResult);var s=this.workOptions.thickness,_vi$eraserSizes$s=vi.eraserSizes[s],c=_vi$eraserSizes$s.width,l=_vi$eraserSizes$s.height,f=Math.round(Math.max(c,l)/this.worldScaling[0]);return this.updateTempPoints(n,f),_objectSpread({type:vt.None},this.baseConsumeResult);}},{key:"computEraserPointLines",value:function computEraserPointLines(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:60;var n=[];var s=0;var c=360-r;for(var l=1;l<t.length;l++){var f=t[l-1],u=t[l];if(l===1&&s===0&&(n[s]=[f.XY]),n[s].push(u.XY),l<t.length-1){var v=u.getAngleByPoints(f,t[l+1]);(v<r||v>c)&&(s++,n[s]=[u.XY]);}}return t.length===1&&n.length===0&&n.push([t[0].XY,t[0].XY]),n;}},{key:"consumeAll",value:function consumeAll(t){var r=t.workerEngine;if(this.replace(this.fullLayer,this.workId),!this.tmpPoints.length)return _objectSpread({type:vt.None},this.baseConsumeResult);var n=this.workOptions.thickness,_vi$eraserSizes$n2=vi.eraserSizes[n],s=_vi$eraserSizes$n2.width,c=_vi$eraserSizes$n2.height,l=Math.round(Math.max(s,c)/this.worldScaling[0]),_this$getChangeNodes4=this.getChangeNodes(l,r),f=_this$getChangeNodes4.willDeleteNodes,u=_this$getChangeNodes4.willUpdateNodes,v=_this$getChangeNodes4.rect;if(f.size===0&&u.size===0)return _objectSpread(_objectSpread({type:vt.FullWork},this.baseConsumeResult),{},{rect:v});var h=[];this.tmpPoints.map(function(T){h.push(T.x,T.y,l/2);});var y=mr(h);return _objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:vt.FullWork,dataType:Kt.Local,rect:v,ops:y,willUpdateNodes:u,willDeleteNodes:f});}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}]);}($t);// 来源于white-sdk
|
|
482
|
+
dt(vi,"eraserSizes",wl);var lo=vi;var Ki=/*#__PURE__*/function(_$t14){function Ki(t){var _this84;_classCallCheck(this,Ki);_this84=_callSuper(this,Ki,[t]);dt(_this84,"canRotate",!1);dt(_this84,"scaleType",Ce.all);dt(_this84,"toolsType",Tt.BackgroundSVG);dt(_this84,"tmpPoints",[]);dt(_this84,"workOptions");dt(_this84,"oldRect");_this84.workOptions=t.toolsOpt,_this84.scaleType=Ki.getScaleType(_this84.workOptions);return _this84;}_inherits(Ki,_$t14);return _createClass(Ki,[{key:"consume",value:function consume(){return{type:vt.None};}},{key:"consumeAll",value:function consumeAll(){return{type:vt.None};}},{key:"draw",value:function draw(t){var r=t.layer,n=t.workId,s=t.replaceId,_this$workOptions15=this.workOptions,c=_this$workOptions15.centerX,l=_this$workOptions15.centerY,f=_this$workOptions15.width,u=_this$workOptions15.height,v=_this$workOptions15.rotate,h=_this$workOptions15.zIndex,y=(h||0)-100,T=new cr({anchor:[0.5,0.5],pos:[c,l],name:n,size:[f,u],zIndex:y,rotate:v}),O=new sl({normalize:!0,pos:[0,0],width:f,height:u});T.appendChild(O),this.replace(r,s||n,T);var I=T.getBoundingClientRect();if(I)return{x:Math.floor(I.x-$t.SafeBorderPadding),y:Math.floor(I.y-$t.SafeBorderPadding),w:Math.floor(I.width+$t.SafeBorderPadding*2),h:Math.floor(I.height+$t.SafeBorderPadding*2)};}},{key:"consumeService",value:function consumeService(t){var c;var r=t.replaceId,n=this.workId,s=this.draw({workId:n,layer:this.fullLayer,replaceId:r});return(c=this.vNodes)==null||c.setInfo(n,{rect:s,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:s&&$t.getCenterPos(s,this.fullLayer)}),s;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"getScaleType",value:function getScaleType(t){var r=t.uniformScale,n=t.rotate;return r!==!1||n&&Math.abs(n)%90>0?Ce.proportional:Ce.all;}},{key:"updateNodeOpt",value:function updateNodeOpt(t){var r=t.node,n=t.opt,s=t.vNodes,c=t.targetNode,l=n.translate,f=n.originPoint,u=n.scenePoint,v=n.scale,h=n.angle,y=n.isLocked,T=n.zIndexForBackgroundSVG,O=c&&fr(c)||s.get(r.name);if(!O)return;var I=r.parent;if(I){if(_e(T)){var P=(T||0)-100;r.setAttribute("zIndex",P),O.opt.zIndex=T;}if(zn(y)&&(O.opt.locked=y),f&&u&&v&&l){var _O$opt=O.opt,_P19=_O$opt.centerX,_w49=_O$opt.centerY,_d45=_O$opt.width,m=_O$opt.height,p=_O$opt.uniformScale,S=p!==!1?[v[0],v[0]]:v,E=[_P19,_w49],R=[_P19,_w49];Co(R,u,S,l);var D=[R[0]-E[0],R[1]-E[1]];O.centerPos=[O.centerPos[0]+D[0],O.centerPos[1]+D[1]],O.opt.width=Math.round(_d45*S[0]),O.opt.height=Math.round(m*S[1]),O.opt.centerX=R[0],O.opt.centerY=R[1];}else if(l)O.opt.centerX=O.opt.centerX+l[0],O.opt.centerY=O.opt.centerY+l[1],O.centerPos=[O.centerPos[0]+l[0],O.centerPos[1]+l[1]];else if(_e(h))if(O.opt.rotate=h,O.scaleType=Ki.getScaleType(O.opt),c){var _P20=bl(O.rect,h);O.rect=_P20;}else{var _P21=$t.getRectFromLayer(I,r.name);O.rect=_P21||O.rect;}return O&&s.setInfo(r.name,O),O==null?void 0:O.rect;}}}]);}($t);function Kh(i){switch(i){case Tt.Arrow:return Ah;case Tt.Pencil:return Ch;case Tt.Straight:return Dh;case Tt.Ellipse:return Eh;case Tt.Polygon:case Tt.Triangle:return Rh;case Tt.Star:case Tt.Rhombus:return Lh;case Tt.Rectangle:return Mh;case Tt.SpeechBalloon:return bh;case Tt.Text:return Vi;case Tt.LaserPen:return Ih;case Tt.Eraser:return no;case Tt.PencilEraser:return ao;case Tt.BitMapEraser:return lo;case Tt.Selector:return ki;case Tt.Image:return Hi;case Tt.BackgroundSVG:return Ki;}}function To(i,e){var t=i.toolsType,r=_objectWithoutProperties(i,_excluded);switch(t){case Tt.Arrow:return new Ah(r);case Tt.Pencil:return new Ch(r);case Tt.Straight:return new Dh(r);case Tt.Ellipse:return new Eh(r);case Tt.Polygon:case Tt.Triangle:return new Rh(r);case Tt.Star:case Tt.Rhombus:return new Lh(r);case Tt.Rectangle:return new Mh(r);case Tt.SpeechBalloon:return new bh(r);case Tt.Text:return new Vi(r);case Tt.LaserPen:return new Ih(r);case Tt.Eraser:return new no(r,e);case Tt.BitMapEraser:return new lo(r);case Tt.PencilEraser:return new ao(r);case Tt.Selector:return r.vNodes?new ki(_objectSpread(_objectSpread({},r),{},{vNodes:r.vNodes,drawLayer:r.fullLayer})):void 0;case Tt.Image:return new Hi(r);case Tt.BackgroundSVG:return new Ki(_objectSpread(_objectSpread({},r),{},{toolsOpt:r.toolsOpt}));default:return;}}function Zh(i){var e=[],t=["PATH","SPRITE","POLYLINE","RECT","ELLIPSE","LABEL","SPRITESVG"];var _iterator39=_createForOfIteratorHelper(i),_step39;try{for(_iterator39.s();!(_step39=_iterator39.n()).done;){var r=_step39.value;if(r.tagName==="GROUP"&&r.children.length){var n=Zh(r.children);e.push.apply(e,_toConsumableArray(n));}r.tagName&&t.includes(r.tagName)&&e.push(r);}}catch(err){_iterator39.e(err);}finally{_iterator39.f();}return e;}function Zt(i,e){if(i&&e){var t=Math.min(i.x,e.x),r=Math.min(i.y,e.y),n=Math.max(i.x+i.w,e.x+e.w),s=Math.max(i.y+i.h,e.y+e.h),c=n-t,l=s-r;return{x:t,y:r,w:c,h:l};}return e||i;}function De(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var t={x:0,y:0,w:0,h:0};var r=1/0,n=1/0,s=-1/0,c=-1/0;return i.forEach(function(l){var _l$XY=_slicedToArray(l.XY,2),f=_l$XY[0],u=_l$XY[1];r=Math.min(r,f-e),n=Math.min(n,u-e),s=Math.max(s,f+e),c=Math.max(c,u+e);}),t.x=r,t.y=n,t.w=s-r,t.h=c-n,t;}function dl(i,e){return!(i.x+i.w<e.x||i.x>e.x+e.w||i.y+i.h<e.y||i.y>e.y+e.h);}function ve(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:10;return{x:Math.floor(i.x-e),y:Math.floor(i.y-e),w:Math.ceil(i.w+e*2),h:Math.ceil(i.h+e*2)};}function Zi(i,e){return{x:i.x+e[0],y:i.y+e[1],w:i.w,h:i.h};}function QA(i,e){var t=new pt(i.x,i.y),r=new pt(i.x+i.w,i.y),n=new pt(i.x+i.w,i.y+i.h),s=new pt(i.x,i.y+i.h),c=new pt(i.x+i.w/2,i.y+i.h/2),l=Math.PI*e/180,f=pt.RotWith(t,c,l),u=pt.RotWith(r,c,l),v=pt.RotWith(n,c,l),h=pt.RotWith(s,c,l);return[f,u,v,h];}function bl(i,e){var t=QA(i,e);return De(t);}function Jh(i,e,t){var r=new pt(i.x,i.y),n=new pt(i.x+i.w,i.y),s=new pt(i.x+i.w,i.y+i.h),c=new pt(i.x,i.y+i.h),l=new pt(t[0],t[1]),f=new pt(e[0],e[1]),u=pt.ScaleWOrigin(r,f,l),v=pt.ScaleWOrigin(n,f,l),h=pt.ScaleWOrigin(s,f,l),y=pt.ScaleWOrigin(c,f,l);return De([u,v,h,y]);}function qA(i,e,t){var r=new pt(e[0],e[1]);for(var n=0;n<i.length;n+=3){var s=new pt(i[n],i[n+1]),c=Math.PI*t/180,l=pt.RotWith(s,r,c);i[n]=l.x,i[n+1]=l.y;}}function _A(i,e,t){var r=new pt(e[0],e[1]);for(var n=0;n<i.length;n+=2){var s=new pt(i[n],i[n+1]),c=Math.PI*t/180,l=pt.RotWith(s,r,c);i[n]=l.x,i[n+1]=l.y;}}function Co(i,e,t){var r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[0,0];var n=new pt(e[0],e[1]);for(var s=0;s<i.length;s+=3){var c=new pt(i[s],i[s+1]),l=new pt(t[0],t[1]),f=pt.ScaleWOrigin(c,l,n);i[s]=f.x+r[0],i[s+1]=f.y+r[1];}}function Dl(i,e,t){var r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[0,0];var n=new pt(e[0],e[1]);for(var s=0;s<i.length;s+=2){var c=new pt(i[s],i[s+1]),l=new pt(t[0],t[1]),f=pt.ScaleWOrigin(c,l,n);i[s]=f.x+r[0],i[s+1]=f.y+r[1];}}function tE(i,e){return i[0]>=e.x&&i[0]<=e.x+e.w&&i[1]>=e.y&&i[1]<=e.y+e.h;}function Qh(i,e){var t=i<=e?1:i/e,r=e<=i?1:e/i;return[t,r];}function eE(i){var _iterator40=_createForOfIteratorHelper(i),_step40;try{for(_iterator40.s();!(_step40=_iterator40.n()).done;){var e=_step40.value;if(isNaN(e)||e===1/0||e===-1/0)return!1;}}catch(err){_iterator40.e(err);}finally{_iterator40.f();}return!0;}function rE(i){return i!==Math.floor(i);}function nE(i){var e=i.toString();return e.indexOf(".")!==-1?e.split(".")[1].length:0;}function iE(i,e){for(;e!==0;){var _ref167=[e,i%e];i=_ref167[0];e=_ref167[1];}return i;}var sE=function sE(i){if(i.tagName==="GROUP"){var e=Object.getOwnPropertySymbols(i).find(function(t){return t.toString()==="Symbol(sealed)";});if(e&&i[e])return!0;}return!1;},_vr=function vr(i,e){if(i.mesh&&i.mesh.texture&&i.name==="eraserTexture"){var t=i.mesh.texture.image;e.deleteTexture(t);}else if(i.tagName==="GROUP"&&i&&i.children){var _iterator41=_createForOfIteratorHelper(i.children),_step41;try{for(_iterator41.s();!(_step41=_iterator41.n()).done;){var _t23=_step41.value;_vr(_t23,e);}}catch(err){_iterator41.e(err);}finally{_iterator41.f();}}},Rr=function Rr(i,e){_vr(i,e),i.removeAllChildren();},oE=function oE(i,e,t){var r=t.parent;if(e){var n=e.children;if(n){var _iterator42=_createForOfIteratorHelper(n),_step42;try{for(_iterator42.s();!(_step42=_iterator42.n()).done;){var s=_step42.value;if(_vr(s,r),s.tagName==="GROUP"){var _iterator43=_createForOfIteratorHelper(s.children),_step43;try{for(_iterator43.s();!(_step43=_iterator43.n()).done;){var c=_step43.value;_vr(c,r);}}catch(err){_iterator43.e(err);}finally{_iterator43.f();}}}}catch(err){_iterator42.e(err);}finally{_iterator42.f();}}}e.parent.replaceChild(i,e);},qh=function qh(i,e,t){if(i.w+i.x<=0||i.h+i.y<=0||i.w<=0||i.h<=0)return;var r=e.width,n=e.height,s={x:Math.floor(Math.max(0,i.x)),y:Math.floor(Math.max(0,i.y)),w:Math.floor(Math.min(r,i.w)),h:Math.floor(Math.min(n,i.h))};if(s.x+s.w>r&&(s.w=Math.floor(r-s.x)),s.y+s.h>n&&(s.h=Math.floor(n-s.y)),rE(t)){var c=nE(t),l=Math.pow(10,c),f=iE(l,t*l),u=s.x%f,v=s.x-u;v>=0?(s.x=v,s.w=s.w+u):(s.x=0,s.w=s.w+u-v);var h=s.y%f,y=s.y-h;y>=0?(s.y=y,s.h=s.h+h):(s.y=0,s.h=s.h+h-y);}return s;};function fi(i){return"".concat(fo(i.x),",").concat(fo(i.y)," ");}function ci(i,e){return"".concat(fo((i.x+e.x)/2),",").concat(fo((i.y+e.y)/2)," ");}function fo(i){return+i.toFixed(4);}var Ji=function Ji(i,e){return i.x+i.w<e.x||i.x>e.x+e.w||i.y+i.h<e.y||i.y>e.y+e.h?Tr.outside:i.x>=e.x&&i.y>=e.y&&i.x+i.w<=e.x+e.w&&i.y+i.h<=e.y+e.h?Tr.inside:Tr.intersect;};function aE(i){var e=0;for(var t=0;t<i.length;t++){var r=i.charCodeAt(t);r>=1&&r<=126||65376<=r&&r<=65439?e++:e+=2;}return e;}var Nu=/*#__PURE__*/function(){function Nu(e){_classCallCheck(this,Nu);dt(this,"_map");dt(this,"_observers",/* @__PURE__ */new Set());this._map=new Map(e);}return _createClass(Nu,[{key:"notifyObservers",value:function notifyObservers(e,t,r){var _iterator44=_createForOfIteratorHelper(this._observers),_step44;try{for(_iterator44.s();!(_step44=_iterator44.n()).done;){var n=_step44.value;n(e,t,r);}}catch(err){_iterator44.e(err);}finally{_iterator44.f();}}},{key:"observe",value:function observe(e){this._observers.add(e);}},{key:"unobserve",value:function unobserve(e){this._observers["delete"](e);}},{key:"get",value:function get(e){return this._map.get(e);}},{key:"set",value:function set(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var n=this._map.has(e)?"update":"add";return this._map.set(e,t),r&&this.notifyObservers(n,e,t),this;}},{key:"has",value:function has(e){return this._map.has(e);}},{key:"delete",value:function _delete(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var r=this._map.get(e),n=this._map["delete"](e);return t&&r&&this.notifyObservers("delete",e,r),n;}},{key:"clear",value:function clear(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;var t=this._map.keys();if(this._map.clear(),e){var _iterator45=_createForOfIteratorHelper(t),_step45;try{for(_iterator45.s();!(_step45=_iterator45.n()).done;){var r=_step45.value;this.notifyObservers("clear",r,void 0);}}catch(err){_iterator45.e(err);}finally{_iterator45.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(e,t){this._map.forEach(e,t);}}]);}();var lE=/*#__PURE__*/function(){function lE(e,t){_classCallCheck(this,lE);dt(this,"viewId");dt(this,"scene");dt(this,"fullLayer");dt(this,"curNodeMap");dt(this,"targetNodeMap",[]);dt(this,"highLevelIds");dt(this,"canClearUids");dt(this,"localUid");this.viewId=e,this.scene=t,this.curNodeMap=new Nu();}return _createClass(lE,[{key:"init",value:function init(e){this.fullLayer=e;}},{key:"get",value:function get(e){return this.curNodeMap.get(e);}},{key:"setLocalUid",value:function setLocalUid(e){this.localUid=e;}},{key:"getLocalUid",value:function getLocalUid(){return this.localUid;}},{key:"setCanClearUids",value:function setCanClearUids(e){this.canClearUids=e;}},{key:"getCanClearUids",value:function getCanClearUids(){return this.canClearUids;}},{key:"getCanEraserNodes",value:function getCanEraserNodes(e,t){var r=/* @__PURE__ */new Map();var _iterator46=_createForOfIteratorHelper(e.entries()),_step46;try{for(_iterator46.s();!(_step46=_iterator46.n()).done;){var _step46$value=_slicedToArray(_step46.value,2),n=_step46$value[0],s=_step46$value[1];s.toolsType!==Tt.BackgroundSVG&&(s.toolsType===Tt.Image&&s.opt.type===ho.Image&&(s.opt.locked||t&&t.disableEraseImage)||s.toolsType===Tt.Text&&(s.opt.workState===te.Doing||s.opt.workState===te.Start||t&&t.disableEraseText)||this.isCanClearWorkId(n)&&r.set(n,s));}}catch(err){_iterator46.e(err);}finally{_iterator46.f();}return r;}},{key:"getNodesByType",value:function getNodesByType(e){var t=/* @__PURE__ */new Map();return this.curNodeMap.forEach(function(r,n){r.toolsType===e&&t.set(n,r);}),t;}},{key:"gethasEraserNodes",value:function gethasEraserNodes(){var e=/* @__PURE__ */new Map();return this.curNodeMap.forEach(function(t,r){var n;(n=t.opt.eraserlines)!=null&&n.length&&e.set(r,t);}),e;}},{key:"hasRenderNodes",value:function hasRenderNodes(){return!0;}},{key:"has",value:function has(e){return this.curNodeMap.has(e);}},{key:"setInfo",value:function setInfo(e,t){var r=this.curNodeMap.get(e)||{name:e,rect:t.rect};t.rect&&(r.rect=fr(t.rect)),t.op&&eE(t.op)&&(r.op=fr(t.op)),t.canRotate&&(r.canRotate=t.canRotate),t.scaleType&&(r.scaleType=t.scaleType),t.opt&&(r.opt=fr(t.opt)),t.toolsType&&(r.toolsType=t.toolsType),t.centerPos&&(r.centerPos=fr(t.centerPos)),zn(t.isSelected)&&(r.isSelected=t.isSelected),r.rect?this.curNodeMap.set(e,r):this.curNodeMap["delete"](e);}},{key:"selected",value:function selected(e){this.setInfo(e,{isSelected:!0});}},{key:"unSelected",value:function unSelected(e){this.setInfo(e,{isSelected:!1});}},{key:"delete",value:function _delete(e){this.curNodeMap["delete"](e);}},{key:"clear",value:function clear(){this.curNodeMap.clear(),this.targetNodeMap.length=0;}},{key:"getRectIntersectRange",value:function getRectIntersectRange(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var n;var s=/* @__PURE__ */new Map();var _iterator47=_createForOfIteratorHelper(this.curNodeMap.entries()),_step47;try{for(_iterator47.s();!(_step47=_iterator47.n()).done;){var _step47$value=_slicedToArray(_step47.value,2),c=_step47$value[0],l=_step47$value[1];if(dl(e,l.rect)){if(t&&l.toolsType===Tt.Image&&l.opt.locked||r&&l.toolsType===Tt.Text&&(l.opt.workState===te.Doing||l.opt.workState===te.Start))continue;n=Zt(n,l.rect),s.set(c,l);}}}catch(err){_iterator47.e(err);}finally{_iterator47.f();}return{rectRange:n,nodeRange:s};}},{key:"getNodeRectFormShape",value:function getNodeRectFormShape(e,t){var r=Kh(t.toolsType);return this.fullLayer&&(r==null?void 0:r.getRectFromLayer(this.fullLayer,e));}},{key:"updateNodeRect",value:function updateNodeRect(e){var t=this.curNodeMap.get(e);if(t){var r=this.getNodeRectFormShape(e,t);if(!r){this.curNodeMap["delete"](e);return;}t.rect=r,this.curNodeMap.set(e,t);}}},{key:"updateHighLevelNodesRect",value:function updateHighLevelNodesRect(e){this.highLevelIds=e;var _iterator48=_createForOfIteratorHelper(this.highLevelIds.keys()),_step48;try{for(_iterator48.s();!(_step48=_iterator48.n()).done;){var t=_step48.value;this.updateNodeRect(t);}}catch(err){_iterator48.e(err);}finally{_iterator48.f();}}},{key:"updateLowLevelNodesRect",value:function updateLowLevelNodesRect(){var e;var _iterator49=_createForOfIteratorHelper(this.curNodeMap.keys()),_step49;try{for(_iterator49.s();!(_step49=_iterator49.n()).done;){var t=_step49.value;(e=this.highLevelIds)!=null&&e.has(t)||this.updateNodeRect(t);}}catch(err){_iterator49.e(err);}finally{_iterator49.f();}}},{key:"clearHighLevelIds",value:function clearHighLevelIds(){this.highLevelIds=void 0;}},{key:"setTargetAssignKeys",value:function setTargetAssignKeys(e){var t=new Nu();var _iterator50=_createForOfIteratorHelper(e),_step50;try{for(_iterator50.s();!(_step50=_iterator50.n()).done;){var r=_step50.value;var n=this.curNodeMap.get(r);n&&t.set(r,fr(n));}}catch(err){_iterator50.e(err);}finally{_iterator50.f();}return this.targetNodeMap.push(fr(t)),this.targetNodeMap.length-1;}},{key:"setTarget",value:function setTarget(){var e=this.curNodeMap.keys();return this.setTargetAssignKeys(Array.from(e));}},{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(e){return this.targetNodeMap[e];}},{key:"deleteTarget",value:function deleteTarget(e){this.targetNodeMap.length=e;}},{key:"clearTarget",value:function clearTarget(){this.targetNodeMap.length=0;}},{key:"isLocalWorkId",value:function isLocalWorkId(e){return e.split(gi).length===1;}},{key:"isCanClearWorkId",value:function isCanClearWorkId(e){if(this.canClearUids===void 0||this.canClearUids===!0)return!0;if(Xw(this.canClearUids)){var t=e.split(gi);if(t.length===1)return this.canClearUids.has("localSelf")||this.localUid&&this.canClearUids.has(this.localUid);if(t.length===2)return this.canClearUids.has(t[0]);}return!1;}}]);}();var _h=/*#__PURE__*/function(){function _h(e,t,r){_classCallCheck(this,_h);dt(this,"viewId");dt(this,"type");dt(this,"scene");dt(this,"fullLayer");dt(this,"vNodes");dt(this,"dpr");dt(this,"contextType");dt(this,"opt");dt(this,"cameraOpt");dt(this,"isSafari",!1);dt(this,"combinePostMsg",/* @__PURE__ */new Set());dt(this,"workerTaskId");dt(this,"protectedTask");// protected hasPriorityDraw: boolean = true;
|
|
483
|
+
dt(this,"delayPostDoneResolve");dt(this,"cacheImages",/* @__PURE__ */new Map());dt(this,"imageResolveMap",/* @__PURE__ */new Map());dt(this,"taskUpdateCameraId");dt(this,"debounceUpdateCameraId");var n,s;if(this.viewId=e,this.type=r,this.opt=t,this.dpr=t.dpr,this.contextType=this.getSupportContextType(r,(n=t==null?void 0:t.offscreenCanvasOpt)==null?void 0:n.contextType),!this.contextType)throw new Error("Sorry, your browser doesn't support canvas context type 2d or webgl");try{this.scene=this.createScene(t),this.createRenderLayer(this.scene,t);}catch(c){if(this.contextType!=="2d")this.contextType="2d",(s=this.scene)==null||s.disconnect(),this.scene=this.createScene(t),this.createRenderLayer(this.scene,t);else throw c;}this.vNodes=new lE(e,this.scene);}return _createClass(_h,[{key:"createRenderLayer",value:function createRenderLayer(e,t){var r=gr.bufferSize.full,n=gr.bufferSize.sub;this.fullLayer=this.createLayer("fullLayer",e,_objectSpread(_objectSpread({},t.layerOpt),{},{bufferSize:this.viewId===jn?r:n*2}));}},{key:"updateDpr",value:function(){var _updateDpr=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee26(e){return _regenerator().w(function(_context28){while(1)switch(_context28.n){case 0:this.dpr=e,this.scene.displayRatio=e;case 1:return _context28.a(2);}},_callee26,this);}));function updateDpr(_x38){return _updateDpr.apply(this,arguments);}return updateDpr;}()},{key:"getCachedImages",value:function getCachedImages(e){var t;return(t=this.cacheImages.get(e))==null?void 0:t.imageBitmap;}},{key:"getCachedImagesByWorkId",value:function getCachedImagesByWorkId(e){var _iterator51=_createForOfIteratorHelper(this.cacheImages.entries()),_step51;try{for(_iterator51.s();!(_step51=_iterator51.n()).done;){var _step51$value=_slicedToArray(_step51.value,2),t=_step51$value[0],r=_step51$value[1];if(t===e&&r.imageBitmap)return r.imageBitmap;}}catch(err){_iterator51.e(err);}finally{_iterator51.f();}}},{key:"deleteCachedImagesByWorkId",value:function deleteCachedImagesByWorkId(e,t){var _iterator52=_createForOfIteratorHelper(this.cacheImages.entries()),_step52;try{for(_iterator52.s();!(_step52=_iterator52.n()).done;){var _step52$value=_slicedToArray(_step52.value,2),r=_step52$value[0],n=_step52$value[1];t&&r===t||n.workId===e&&(n.imageBitmap.close(),this.cacheImages["delete"](r));}}catch(err){_iterator52.e(err);}finally{_iterator52.f();}}},{key:"clearCacheImages",value:function clearCacheImages(){this.cacheImages.forEach(function(e){return e.imageBitmap.close();}),this.cacheImages.clear();}},{key:"clearImageResolveMap",value:function clearImageResolveMap(){this.imageResolveMap.forEach(function(_ref168){var e=_ref168.timer;e&&clearTimeout(e);}),this.imageResolveMap.clear();}},{key:"setIsSafari",value:function setIsSafari(e){this.isSafari=e;}},{key:"on",value:function(){var _on=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee27(e){var t,r,n,s,c,l,f,u,_u7,v,h,y,_t24,_t25;return _regenerator().w(function(_context29){while(1)switch(_context29.n){case 0:t=e.msgType,r=e.toolsType,n=e.opt,s=e.imageSrc,c=e.imageBitmap,l=e.workId,f=e.dpr;_t24=t;_context29.n=_t24===vt.UpdateDpr?1:_t24===vt.UpdateCamera?3:_t24===vt.Destroy?5:_t24===vt.Clear?6:_t24===vt.UpdateTools?8:_t24===vt.GetImageBitMap?9:10;break;case 1:_t25=_e(f);if(!_t25){_context29.n=2;break;}_context29.n=2;return this.updateDpr(f);case 2:return _context29.a(3,10);case 3:_context29.n=4;return this.updateCamera(e);case 4:return _context29.a(3,10);case 5:this.destroy();return _context29.a(3,10);case 6:_context29.n=7;return this.clearAll();case 7:return _context29.a(3,10);case 8:if(r&&n){u={toolsType:r,toolsOpt:n,combineUnitTime:e.combineUnitTime,maxCombineEraserTime:e.maxCombineEraserTime};this.localWork.setToolsOpt(u);}return _context29.a(3,10);case 9:if(s&&c&&l){_u7=l.toString();this.cacheImages.set(s,{imageBitmap:c,workId:_u7});v=this.imageResolveMap.get(s);if(v){h=v.resolve,y=v.timer;y&&clearTimeout(y),h&&h(s);}this.deleteCachedImagesByWorkId(_u7,s);}return _context29.a(3,10);case 10:return _context29.a(2);}},_callee27,this);}));function on(_x39){return _on.apply(this,arguments);}return on;}()},{key:"getIconSize",value:function getIconSize(e,t,r){var n=e*r,s=t*r;return n<=50||s<=50?[50,50]:n<=100||s<=100?[100,100]:n<=200||s<=200?[200,200]:n<=400||s<=400?[400,400]:n<=800||s<=800?[800,800]:[1600,1600];}},{key:"loadImageBitMap",value:function(){var _loadImageBitMap=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee28(e){var _this85=this;var t,r,n,s,c,l,f,u,v,h,y,_this$getIconSize,_this$getIconSize2,P,_w50,_P22,_P23,I;return _regenerator().w(function(_context30){while(1)switch(_context30.n){case 0:t=e.toolsType,r=e.opt,n=e.workId,s=e.isSubWorker;if(!(t===Tt.Image&&r&&n)){_context30.n=5;break;}c=n.toString(),l=r.src,f=r.type,u=r.width,v=r.height,h=r.strokeColor;if(!(!l||!f||!u||!v)){_context30.n=1;break;}return _context30.a(2);case 1:y=l;if(f===ho.Iconify){_this$getIconSize=this.getIconSize(u,v,this.dpr),_this$getIconSize2=_slicedToArray(_this$getIconSize,2),P=_this$getIconSize2[0],_w50=_this$getIconSize2[1];y="".concat(l,"?width=").concat(P,"&height=").concat(_w50,"&color=").concat(h);}if(!this.cacheImages.has(y)){_context30.n=2;break;}_P22=this.getCachedImages(y);if(!_P22){_context30.n=2;break;}return _context30.a(2,_P22);case 2:if(!this.imageResolveMap.has(y)){_context30.n=3;break;}_P23=this.getCachedImagesByWorkId(c);if(!_P23){_context30.n=3;break;}return _context30.a(2,_P23);case 3:_context30.n=4;return new Promise(function(P){var w=_this85.imageResolveMap.get(y)||{resolve:void 0,timer:void 0};w.timer&&clearTimeout(w.timer),w.resolve=P,w.timer=setTimeout(function(){var d=_this85.imageResolveMap.get(y);d!=null&&d.resolve&&d.resolve(y);},5e3),_this85.imageResolveMap.set(y,w),_this85._post({sp:[{imageSrc:y,workId:c,viewId:_this85.viewId,isgl:!!_this85.fullLayer.parent.gl,isSubWorker:s,type:vt.GetImageBitMap}]});});case 4:I=_context30.v;return _context30.a(2,(this.imageResolveMap["delete"](I),this.getCachedImages(y)));case 5:return _context30.a(2);}},_callee28,this);}));function loadImageBitMap(_x40){return _loadImageBitMap.apply(this,arguments);}return loadImageBitMap;}()},{key:"createLocalWork",value:function createLocalWork(e){var t=e.workId,r=e.opt,n=e.toolsType;t&&r&&(!this.localWork.getToolsOpt()&&n&&this.setToolsOpt({toolsType:n,toolsOpt:r}),this.setWorkOpt({workId:t,toolsOpt:r}));}},{key:"updateScene",value:function updateScene(e,t,r){e.attr(_objectSpread({},t));var n=t.width,s=t.height;e.container.width=n,e.container.height=s,e.width=n,e.height=s,this.updateLayer({width:n,height:s},r);}},{key:"updateLayer",value:function updateLayer(e,t){var r=e.width,n=e.height,s=t||this.fullLayer;s&&(s.parent.setAttribute("width",r),s.parent.setAttribute("height",n),s.setAttribute("size",[r,n]),s.setAttribute("pos",[r*0.5,n*0.5]));}},{key:"getSupportContextType",value:function getSupportContextType(e,t){var r=new OffscreenCanvas(100,100);var n=["2d"];e===co.Full&&this.viewId===jn&&(n=["webgl2","webgl","2d"],t&&n.unshift(t));for(var _i3=0,_n7=n;_i3<_n7.length;_i3++){var s=_n7[_i3];try{if(r.getContext(s))return s;}catch(c){throw c;}}}},{key:"createScene",value:function createScene(e){var t=e.offscreenCanvasOpt,r=t.width,n=t.height,s=new OffscreenCanvas(r,n);t.contextType&&delete t.contextType;var c=new Xu(_objectSpread(_objectSpread({container:s,displayRatio:this.dpr,depth:!1,desynchronized:!0,failIfMajorPerformanceCaveat:!0},t),{},{contextType:this.contextType,id:this.viewId}));return c.setAttribute("id",this.viewId),c;}},{key:"createLayer",value:function createLayer(e,t,r,n){var s="offscreen-".concat(e),c=r.width,l=r.height;n&&(r.offscreen=!0,r.canvas=n);var f=t.layer(s,r),u=new cr({anchor:[0.5,0.5],pos:[c*0.5,l*0.5],size:[c,l],name:"viewport",id:e});return f.append(u),u;}},{key:"clearAll",value:function(){var _clearAll=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee29(){var e;return _regenerator().w(function(_context31){while(1)switch(_context31.n){case 0:this.fullLayer&&(this.fullLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),Rr(this.fullLayer,this.fullLayer.parent)),this.taskUpdateCameraId&&(clearTimeout(this.taskUpdateCameraId),this.taskUpdateCameraId=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 _context31.a(2);}},_callee29,this);}));function clearAll(){return _clearAll.apply(this,arguments);}return clearAll;}()},{key:"setToolsOpt",value:function setToolsOpt(e){this.localWork.setToolsOpt(e);}},{key:"setWorkOpt",value:function setWorkOpt(e){var t=e.workId,r=e.toolsOpt;t&&r&&this.localWork.setWorkOptions(t.toString(),r);}},{key:"destroy",value:function destroy(){var e;this.vNodes.clear(),this.fullLayer.remove(),_vr(this.fullLayer,this.fullLayer.parent),this.clearCacheImages(),this.clearImageResolveMap(),this.scene.remove(),this.localWork.destroy(),(e=this.serviceWork)==null||e.destroy();}},{key:"post",value:function(){var _post=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee30(e){return _regenerator().w(function(_context32){while(1)switch(_context32.n){case 0:this.combinePostMsg.add(e);_context32.n=1;return this.runBatchPostData();case 1:return _context32.a(2);}},_callee30,this);}));function post(_x41){return _post.apply(this,arguments);}return post;}()},{key:"runBatchPostData",value:function(){var _runBatchPostData=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee31(){var _this86=this;var _t26,_t27;return _regenerator().w(function(_context33){while(1)switch(_context33.n){case 0:this.workerTaskId||(this.workerTaskId=setTimeout(function(){_this86.workerTaskId=void 0,_this86.combinePost();},16));_t26=this.type===co.Full&&!this.delayPostDoneResolve;if(!_t26){_context33.n=2;break;}_context33.n=1;return new Promise(function(t){_this86.delayPostDoneResolve=t;});case 1:_t26=_context33.v;case 2:_t27=_t26;if(!_t27){_context33.n=3;break;}this.delayPostDoneResolve=void 0;case 3:return _context33.a(2);}},_callee31,this);}));function runBatchPostData(){return _runBatchPostData.apply(this,arguments);}return runBatchPostData;}()},{key:"combinePostData",value:function combinePostData(){var l,f;this.workerTaskId=void 0;var e=[],t=[];var r,n,s;var c=/* @__PURE__ */new Set();var _iterator53=_createForOfIteratorHelper(this.combinePostMsg.values()),_step53;try{for(_iterator53.s();!(_step53=_iterator53.n()).done;){var u=_step53.value;if((l=u.render)!=null&&l.length){var _iterator54=_createForOfIteratorHelper(u.render),_step54;try{for(_iterator54.s();!(_step54=_iterator54.n()).done;){var v=_step54.value;var h=!1;if(v.workId&&c.add(v.workId),v.isClearAll&&(v.rect=this.getSceneRect(),v.isClear=!0,delete v.isClearAll),v.drawCanvas){var y=this.getLayer(v.drawCanvas);if(!y||!(y.parent instanceof il))continue;if(y.parent.render(),v.isDrawAll){var T=this.getSceneRect();v.rect=T,delete v.isDrawAll;}}var _iterator55=_createForOfIteratorHelper(e),_step55;try{for(_iterator55.s();!(_step55=_iterator55.n()).done;){var _y3=_step55.value;if(v.viewId===_y3.viewId){v.isClear&&_y3.clearCanvas&&_y3.isClear&&_y3.clearCanvas===v.clearCanvas&&(_y3.rect=Zt(_y3.rect,v.rect),h=!0),_y3.drawCanvas&&_y3.drawCanvas===v.drawCanvas&&(_y3.rect=Zt(_y3.rect,v.rect),h=!0);continue;}}}catch(err){_iterator55.e(err);}finally{_iterator55.f();}h||(v.isClear&&!v.drawCanvas?e.unshift(v):e.push(v));}}catch(err){_iterator54.e(err);}finally{_iterator54.f();}}if((f=u.sp)!=null&&f.length){var _iterator56=_createForOfIteratorHelper(u.sp),_step56;try{for(_iterator56.s();!(_step56=_iterator56.n()).done;){var _v10=_step56.value;var _h6=!1;var _iterator57=_createForOfIteratorHelper(t),_step57;try{for(_iterator57.s();!(_step57=_iterator57.n()).done;){var _y4=_step57.value;if(_r(_v10,_y4)){_h6=!0;break;}}}catch(err){_iterator57.e(err);}finally{_iterator57.f();}_h6||t.push(_v10);}}catch(err){_iterator56.e(err);}finally{_iterator56.f();}}_e(u.fullWorkerDrawCount)&&(r=u.fullWorkerDrawCount),_e(u.subWorkerDrawCount)&&(n=u.subWorkerDrawCount),_e(u.consumeCount)&&(s=u.consumeCount);}}catch(err){_iterator53.e(err);}finally{_iterator53.f();}return this.combinePostMsg.clear(),{render:e,sp:t,fullWorkerDrawCount:r,subWorkerDrawCount:n,consumeCount:s,workIds:c,viewId:this.viewId};}},{key:"getSceneRect",value:function getSceneRect(){var _this$scene=this.scene,e=_this$scene.width,t=_this$scene.height;return{x:0,y:0,w:Math.floor(e),h:Math.floor(t)};}}]);}();var Nl=/*#__PURE__*/function(){function Nl(e){_classCallCheck(this,Nl);dt(this,"viewId");dt(this,"vNodes");dt(this,"thread");dt(this,"fullLayer");dt(this,"drawLayer");dt(this,"_post");dt(this,"tmpOpt");dt(this,"workShapes",/* @__PURE__ */new Map());dt(this,"drawCount",0);dt(this,"consumeCount",0);dt(this,"syncUnitTime",gr.syncOpt.interval);dt(this,"combineUnitTime",gr.bezier.combineUnitTime);dt(this,"maxCombineEraserTime",gr.pencilEraser.maxCombineTime);this.thread=e.thread,this.viewId=e.viewId,this.vNodes=e.vNodes,this.fullLayer=e.fullLayer,this.drawLayer=e.drawLayer,this._post=this.thread.post.bind(e.thread);}return _createClass(Nl,[{key:"setmaxCombineEraserTime",value:function setmaxCombineEraserTime(e){this.maxCombineEraserTime=e;}},{key:"setCombineUnitTime",value:function setCombineUnitTime(e){this.combineUnitTime=e;}},{key:"setSyncUnitTime",value:function setSyncUnitTime(e){this.syncUnitTime=e;}},{key:"destroy",value:function destroy(){this.workShapes.clear();}},{key:"getWorkShapes",value:function getWorkShapes(){return this.workShapes;}},{key:"getWorkShape",value:function getWorkShape(e){return this.workShapes.get(e);}},{key:"createWorkShape",value:function createWorkShape(e,t){if(e&&this.tmpOpt){var r={toolsType:this.tmpOpt.toolsType,toolsOpt:t||this.tmpOpt.toolsOpt},n=this.createWorkShapeNode(_objectSpread(_objectSpread({},r),{},{workId:e}));n&&this.workShapes.set(e,n);}}},{key:"setWorkOptions",value:function setWorkOptions(e,t){var r=this.getWorkShape(e);r||this.createWorkShape(e,t),r==null||r.setWorkOptions(t);}},{key:"createWorkShapeNode",value:function createWorkShapeNode(e){var t;return To(_objectSpread(_objectSpread({},e),{},{vNodes:this.vNodes,fullLayer:this.fullLayer,drawLayer:this.drawLayer}),(t=this.thread)==null?void 0:t.serviceWork);}},{key:"setToolsOpt",value:function setToolsOpt(e){var t,r,n;((t=this.tmpOpt)==null?void 0:t.toolsType)!==e.toolsType&&(r=this.tmpOpt)!=null&&r.toolsType&&this.clearAllWorkShapesCache(),this.tmpOpt=e,(n=e.toolsOpt)!=null&&n.syncUnitTime&&(this.syncUnitTime=e.toolsOpt.syncUnitTime),e.combineUnitTime&&(this.combineUnitTime=e.combineUnitTime),e.maxCombineEraserTime&&(this.maxCombineEraserTime=e.maxCombineEraserTime);}},{key:"getToolsOpt",value:function getToolsOpt(){return this.tmpOpt;}},{key:"clearWorkShapeNodeCache",value:function clearWorkShapeNodeCache(e){var t;(t=this.getWorkShape(e))==null||t.clearTmpPoints(),this.workShapes["delete"](e);}},{key:"clearAllWorkShapesCache",value:function clearAllWorkShapesCache(){this.workShapes.forEach(function(e){return e.clearTmpPoints();}),this.workShapes.clear();}},{key:"setFullWork",value:function setFullWork(e){var t=e.workId,r=e.opt,n=e.toolsType;if(t&&r&&n){var s=t.toString();var c;return t&&this.workShapes.has(s)?(c=this.workShapes.get(s),(c==null?void 0:c.toolsType)!==n?(c==null||c.clearTmpPoints(),this.workShapes["delete"](s),c=void 0):c==null||c.setWorkOptions(r)):c=this.createWorkShapeNode({toolsOpt:r,toolsType:n,workId:s}),c||(c=this.createWorkShapeNode({toolsOpt:r,toolsType:n,workId:s})),c?(this.workShapes.set(s,c),c):void 0;}}}]);}();function fE(i){return i;}var td=fE;function cE(i,e,t){switch(t.length){case 0:return i.call(e);case 1:return i.call(e,t[0]);case 2:return i.call(e,t[0],t[1]);case 3:return i.call(e,t[0],t[1],t[2]);}return i.apply(e,t);}var uE=cE,hE=uE,Bu=Math.max;function dE(i,e,t){return e=Bu(e===void 0?i.length-1:e,0),function(){for(var r=arguments,n=-1,s=Bu(r.length-e,0),c=Array(s);++n<s;)c[n]=r[e+n];n=-1;for(var l=Array(e+1);++n<e;)l[n]=r[n];return l[e]=t(c),hE(i,this,l);};}var pE=dE;function vE(i){return function(){return i;};}var gE=vE,mE=gE,Wu=Ju,yE=td,PE=Wu?function(i,e){return Wu(i,"toString",{configurable:!0,enumerable:!1,value:mE(e),writable:!0});}:yE,SE=PE,xE=800,TE=16,CE=Date.now;function IE(i){var e=0,t=0;return function(){var r=CE(),n=TE-(r-t);if(t=r,n>0){if(++e>=xE)return arguments[0];}else e=0;return i.apply(void 0,arguments);};}var wE=IE,OE=SE,AE=wE,EE=AE(OE),ME=EE,LE=td,RE=pE,bE=ME;function DE(i,e){return bE(RE(i,e,LE),i+"");}var NE=DE;function BE(i,e,t,r){for(var n=i.length,s=t+(r?1:-1);r?s--:++s<n;)if(e(i[s],s,i))return s;return-1;}var WE=BE;function FE(i){return i!==i;}var UE=FE;function YE(i,e,t){for(var r=t-1,n=i.length;++r<n;)if(i[r]===e)return r;return-1;}var $E=YE,XE=WE,zE=UE,jE=$E;function GE(i,e,t){return e===e?jE(i,e,t):XE(i,zE,t);}var kE=GE,HE=kE;function VE(i,e){var t=i==null?0:i.length;return!!t&&HE(i,e,0)>-1;}var ed=VE;function KE(i,e,t){for(var r=-1,n=i==null?0:i.length;++r<n;)if(t(e,i[r]))return!0;return!1;}var rd=KE;function ZE(i,e){for(var t=-1,r=i==null?0:i.length,n=Array(r);++t<r;)n[t]=e(i[t],t,i);return n;}var JE=ZE,QE=Al,qE=ed,_E=rd,tM=JE,eM=Po,rM=El,nM=200;function iM(i,e,t,r){var n=-1,s=qE,c=!0,l=i.length,f=[],u=e.length;if(!l)return f;t&&(e=tM(e,eM(t))),r?(s=_E,c=!1):e.length>=nM&&(s=rM,c=!1,e=new QE(e));t:for(;++n<l;){var v=i[n],h=t==null?v:t(v);if(v=r||v!==0?v:0,c&&h===h){for(var y=u;y--;)if(e[y]===h)continue t;f.push(v);}else s(e,h,r)||f.push(v);}return f;}var sM=iM,Fu=Qi,oM=th,aM=_i,Uu=Fu?Fu.isConcatSpreadable:void 0;function lM(i){return aM(i)||oM(i)||!!(Uu&&i&&i[Uu]);}var fM=lM,cM=Cl,uM=fM;function nd(i,e,t,r,n){var s=-1,c=i.length;for(t||(t=uM),n||(n=[]);++s<c;){var l=i[s];e>0&&t(l)?e>1?nd(l,e-1,t,r,n):cM(n,l):r||(n[n.length]=l);}return n;}var hM=nd;function dM(){}var pM=dM,nl=uh,vM=pM,gM=Ml,mM=1/0,yM=nl&&1/gM(new nl([,-0]))[1]==mM?function(i){return new nl(i);}:vM,PM=yM,SM=Al,xM=ed,TM=rd,CM=El,IM=PM,wM=Ml,OM=200;function AM(i,e,t){var r=-1,n=xM,s=i.length,c=!0,l=[],f=l;if(t)c=!1,n=TM;else if(s>=OM){var u=e?null:IM(i);if(u)return wM(u);c=!1,n=CM,f=new SM();}else f=e?[]:l;t:for(;++r<s;){var v=i[r],h=e?e(v):v;if(v=t||v!==0?v:0,c&&h===h){for(var y=f.length;y--;)if(f[y]===h)continue t;e&&f.push(h),l.push(v);}else n(f,h,t)||(f!==l&&f.push(h),l.push(v));}return l;}var EM=AM,MM=sM,LM=hM,Yu=EM;function RM(i,e,t){var r=i.length;if(r<2)return r?Yu(i[0]):[];for(var n=-1,s=Array(r);++n<r;)for(var c=i[n],l=-1;++l<r;)l!=n&&(s[n]=MM(s[n]||c,i[l],e,t));return Yu(LM(s,1),e,t);}var bM=RM,DM=Pl,NM=pn;function BM(i){return NM(i)&&DM(i);}var WM=BM,FM=sh,UM=NE,YM=bM,$M=WM,XM=UM(function(i){return YM(FM(i,$M));}),zM=XM,jM=/* @__PURE__ */Rn(zM);var id=/*#__PURE__*/function(_Nl){function id(t){var _this87;_classCallCheck(this,id);_this87=_callSuper(this,id,[t]);dt(_this87,"_type","full");dt(_this87,"combineTimerId");dt(_this87,"combineDrawResolve");dt(_this87,"combineDrawActiveId");dt(_this87,"drawWorkActiveId");dt(_this87,"effectSelectNodeData",/* @__PURE__ */new Set());return _this87;}_inherits(id,_Nl);return _createClass(id,[{key:"loadImageBitMap",value:function(){var _loadImageBitMap2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee32(t){return _regenerator().w(function(_context34){while(1)switch(_context34.n){case 0:_context34.n=1;return this.thread.loadImageBitMap(t);case 1:return _context34.a(2,_context34.v);}},_callee32,this);}));function loadImageBitMap(_x42){return _loadImageBitMap2.apply(this,arguments);}return loadImageBitMap;}()},{key:"consumeDraw",value:function(){var _consumeDraw=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee33(t,r){var _this88=this;var n,s,c,l,f,u,v,h,y,_t28,_t29,_t30,_t31,_t32,_t33;return _regenerator().w(function(_context35){while(1)switch(_context35.n){case 0:n=t.op,s=t.workId,c=t.scenePath,l=t.postCount,f=t.smoothSync;if(!(n!=null&&n.length&&s)){_context35.n=15;break;}u=s.toString(),v=this.getWorkShape(u);if(v){_context35.n=1;break;}return _context35.a(2);case 1:h=v.toolsType;if(!(h===Tt.LaserPen)){_context35.n=2;break;}return _context35.a(2);case 2:_t28=this.combineDrawActiveId&&this.combineDrawActiveId!==u;if(!_t28){_context35.n=3;break;}this.combineTimerId&&(clearTimeout(this.combineTimerId),this.combineTimerId=void 0,this.combineDrawResolve&&this.combineDrawResolve(!1),this.combineDrawActiveId=void 0);_context35.n=3;return this.consumeDrawAll({workId:this.combineDrawActiveId,scenePath:c,viewId:this.viewId,msgType:vt.DrawWork,dataType:Kt.Local},r);case 3:_t29=this.drawWorkActiveId&&this.drawWorkActiveId!==u;if(!_t29){_context35.n=5;break;}_context35.n=4;return this.consumeDrawAll({workId:this.drawWorkActiveId,scenePath:c,viewId:this.viewId,msgType:vt.DrawWork,dataType:Kt.Local},r);case 4:this.drawWorkActiveId=void 0;case 5:!this.drawWorkActiveId&&u!==Me&&(this.drawWorkActiveId=u);_e(l)&&(this.consumeCount=l);y=v.consume({data:t,isFullWork:!0,smoothSync:f});_t30=h;_context35.n=_t30===Tt.Selector?6:_t30===Tt.PencilEraser?8:_t30===Tt.BitMapEraser?8:_t30===Tt.Eraser?9:_t30===Tt.Arrow?11:_t30===Tt.Straight?11:_t30===Tt.Ellipse?11:_t30===Tt.Rectangle?11:_t30===Tt.Star?11:_t30===Tt.Polygon?11:_t30===Tt.SpeechBalloon?11:_t30===Tt.Pencil?13:15;break;case 6:_t31=y.type===vt.Select;if(!_t31){_context35.n=7;break;}y.selectIds&&r.runReverseSelectWork(y.selectIds);_context35.n=7;return this.drawSelector(y);case 7:return _context35.a(3,15);case 8:this.drawCount++,this.combineTimerId||(this.combineTimerId=1,this.combineDrawActiveId=u,this.drawEraserCombine(u,this.drawCount).then(function(){_this88.combineTimerId=void 0;}));return _context35.a(3,15);case 9:_context35.n=10;return this.drawEraser(y);case 10:return _context35.a(3,15);case 11:_t32=y;if(!_t32){_context35.n=12;break;}this.drawCount++;_context35.n=12;return this.drawShape(y);case 12:return _context35.a(3,15);case 13:this.drawCount++;!this.combineTimerId&&this.combineUnitTime!==1/0&&new Promise(function(T){_this88.combineDrawActiveId=u,_this88.combineDrawResolve=T,_this88.combineTimerId=setTimeout(function(){_this88.combineTimerId=void 0,_this88.combineDrawResolve&&_this88.combineDrawResolve(!0);},_this88.combineUnitTime);}).then(function(T){T&&_this88.drawPencilCombine(u,_this88.drawCount),_this88.combineDrawResolve=void 0;});_t33=y;if(!_t33){_context35.n=14;break;}_context35.n=14;return this.drawPencil(y);case 14:return _context35.a(3,15);case 15:return _context35.a(2);}},_callee33,this);}));function consumeDraw(_x43,_x44){return _consumeDraw.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee34(t,r){var l,f,u,n,s,c,v,h,y,T,O,I,_t34;return _regenerator().w(function(_context36){while(1)switch(_context36.n){case 0:this.combineTimerId&&(clearTimeout(this.combineTimerId),this.combineTimerId=void 0,this.combineDrawResolve&&this.combineDrawResolve(!1),this.combineDrawActiveId=void 0);n=t.workId,s=t.scenePath,c=t.isLockSentEventCursor;if(!n){_context36.n=12;break;}v=n.toString();this.drawWorkActiveId===v&&(this.drawWorkActiveId=void 0);h=this.workShapes.get(v);if(h){_context36.n=1;break;}return _context36.a(2);case 1:y=h.toolsType;if(!(y===Tt.LaserPen)){_context36.n=2;break;}return _context36.a(2);case 2:T=this.workShapes.get(hi),O=(l=T==null?void 0:T.selectIds)==null?void 0:l[0],I=h.consumeAll({data:t,workerEngine:this});_t34=y;_context36.n=_t34===Tt.Selector?3:_t34===Tt.PencilEraser?5:_t34===Tt.BitMapEraser?5:_t34===Tt.Eraser?7:_t34===Tt.Arrow?8:_t34===Tt.Straight?8:_t34===Tt.Ellipse?8:_t34===Tt.Rectangle?8:_t34===Tt.Star?8:_t34===Tt.Polygon?8:_t34===Tt.SpeechBalloon?8:_t34===Tt.Pencil?10:12;break;case 3:I.selectIds&&O&&(f=I.selectIds)!=null&&f.includes(O)&&T.cursorBlur();I.selectIds&&r.runReverseSelectWork(I.selectIds);_context36.n=4;return this.drawSelector(_objectSpread(_objectSpread({},I),{},{scenePath:s}),c);case 4:(u=h.selectIds)!=null&&u.length?h.clearTmpPoints():this.clearWorkShapeNodeCache(v);return _context36.a(3,12);case 5:_context36.n=6;return this.drawEraserFull(h,_objectSpread(_objectSpread({},I),{},{scenePath:s}),c,t.needUndoTicker);case 6:this.drawCount=0;this.clearWorkShapeNodeCache(v);return _context36.a(3,12);case 7:this.drawEraser(_objectSpread(_objectSpread({},I),{},{scenePath:s}),c,t.needUndoTicker),h.clearTmpPoints();return _context36.a(3,12);case 8:_context36.n=9;return this.drawPencilFull(_objectSpread(_objectSpread({},I),{},{scenePath:s}),c,t.needUndoTicker);case 9:this.drawCount=0;this.clearWorkShapeNodeCache(v);return _context36.a(3,12);case 10:_context36.n=11;return this.drawPencilFull(_objectSpread(_objectSpread({},I),{},{scenePath:s}),c,t.needUndoTicker);case 11:this.drawCount=0;this.clearWorkShapeNodeCache(v);return _context36.a(3,12);case 12:return _context36.a(2);}},_callee34,this);}));function consumeDrawAll(_x45,_x46){return _consumeDrawAll.apply(this,arguments);}return consumeDrawAll;}()},{key:"workShapesDone",value:function(){var _workShapesDone=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee35(t,r){var _iterator58,_step58,n,_t35;return _regenerator().w(function(_context37){while(1)switch(_context37.p=_context37.n){case 0:_iterator58=_createForOfIteratorHelper(this.workShapes.keys());_context37.p=1;_iterator58.s();case 2:if((_step58=_iterator58.n()).done){_context37.n=4;break;}n=_step58.value;_context37.n=3;return this.consumeDrawAll({workId:n,scenePath:t,viewId:this.viewId,msgType:vt.DrawWork,dataType:Kt.Local},r);case 3:_context37.n=2;break;case 4:_context37.n=6;break;case 5:_context37.p=5;_t35=_context37.v;_iterator58.e(_t35);case 6:_context37.p=6;_iterator58.f();return _context37.f(6);case 7:return _context37.a(2);}},_callee35,this,[[1,5,6,7]]);}));function workShapesDone(_x47,_x48){return _workShapesDone.apply(this,arguments);}return workShapesDone;}()},{key:"consumeFull",value:function(){var _consumeFull=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee36(t){var s,c,r,n,l,f,u,v,h,y,T;return _regenerator().w(function(_context38){while(1)switch(_context38.n){case 0:r=this.setFullWork(t),n=t.ops&&mi(t.ops)||t.op;if(!r){_context38.n=8;break;}l=(s=t.workId)==null?void 0:s.toString();if(l){_context38.n=1;break;}return _context38.a(2);case 1:f=(c=this.vNodes.get(l))==null?void 0:c.rect;if(!(r.toolsType===Tt.BackgroundSVG)){_context38.n=2;break;}u=r.consumeService({isFullWork:!0,replaceId:l});_context38.n=7;break;case 2:if(!(r.toolsType===Tt.Image)){_context38.n=4;break;}_context38.n=3;return r.consumeServiceAsync({isFullWork:!0,replaceId:l,worker:this});case 3:u=_context38.v;v=(t==null?void 0:t.updateNodeOpt)&&r.updataOptService(t.updateNodeOpt);_context38.n=7;break;case 4:if(!(r.toolsType===Tt.Text)){_context38.n=6;break;}_context38.n=5;return r.consumeServiceAsync({isFullWork:!0,replaceId:l,boxRect:this.thread.getSceneRect()});case 5:u=_context38.v;_context38.n=7;break;case 6:u=r.consumeService({op:n,isFullWork:!0,replaceId:l}),v=(t==null?void 0:t.updateNodeOpt)&&r.updataOptService(t.updateNodeOpt);case 7:u=Zt(u,v);h=[],y=[];if(!(t.workId&&this.workShapes["delete"](t.workId.toString()),t.clearPreviewLocalWork&&h.push({isClearAll:!0,clearCanvas:Ut.Float,viewId:this.viewId}),u&&t.willRefresh&&(f&&(h.push({rect:ve(f),isClear:!0,clearCanvas:Ut.Bg,viewId:this.viewId}),u=Zt(u,f)),h.push({rect:ve(u),drawCanvas:Ut.Bg,viewId:this.viewId})),t.willSyncService&&y.push({opt:t.opt,toolsType:t.toolsType,type:vt.FullWork,workId:t.workId,ops:t.ops,updateNodeOpt:t.updateNodeOpt,viewId:this.viewId}),t.isLockSentEventCursor&&y.push({type:vt.None,isLockSentEventCursor:!0}),t.needUndoTicker&&y.push({type:vt.None,needUndoTicker:t.needUndoTicker}),h.length||y.length)){_context38.n=8;break;}T={render:h,sp:y};_context38.n=8;return this._post(T);case 8:return _context38.a(2);}},_callee36,this);}));function consumeFull(_x49){return _consumeFull.apply(this,arguments);}return consumeFull;}()},{key:"removeSelector",value:function(){var _removeSelector=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee37(t,r){var n,s,c,l,f,u,v,_iterator59,_step59,h,y,T,_t36,_t37,_t38;return _regenerator().w(function(_context39){while(1)switch(_context39.p=_context39.n){case 0:n=t.willSyncService,s=t.needUndoTicker,c=[],l=[],f=[],u=this.workShapes.get(Me);if(u){_context39.n=1;break;}return _context39.a(2);case 1:v=u.selectIds&&_toConsumableArray(u.selectIds)||[];_iterator59=_createForOfIteratorHelper(v);_context39.p=2;_iterator59.s();case 3:if((_step59=_iterator59.n()).done){_context39.n=8;break;}h=_step59.value;y=this.vNodes.get(h);if(!y){_context39.n=6;break;}_t36=y.toolsType;_context39.n=_t36===Tt.Text?4:_t36===Tt.BackgroundSVG?5:6;break;case 4:c.push({type:vt.TextUpdate,toolsType:Tt.Text,workId:h,dataType:Kt.Local});return _context39.a(3,6);case 5:c.push({type:vt.BackgroundSVGDelete,toolsType:Tt.BackgroundSVG,workId:h,dataType:Kt.Local,viewId:this.viewId});return _context39.a(3,6);case 6:T=this._removeWork(h);T.length&&l.push.apply(l,_toConsumableArray(T)),r==null||r.deleteCachedImagesByWorkId(h),f.push(h);case 7:_context39.n=3;break;case 8:_context39.n=10;break;case 9:_context39.p=9;_t37=_context39.v;_iterator59.e(_t37);case 10:_context39.p=10;_iterator59.f();return _context39.f(10);case 11:f.length&&c.push({type:vt.RemoveNode,removeIds:f});c.push({type:vt.Select,selectIds:[],willSyncService:n});_context39.n=12;return this.blurSelector();case 12:s&&c.push({type:vt.None,needUndoTicker:s});_t38=l.length||c.length;if(!_t38){_context39.n=13;break;}_context39.n=13;return this._post({render:l,sp:c});case 13:return _context39.a(2);}},_callee37,this,[[2,9,10,11]]);}));function removeSelector(_x50,_x51){return _removeSelector.apply(this,arguments);}return removeSelector;}()},{key:"removeWork",value:function(){var _removeWork2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee38(t){var r,n,s,_t39;return _regenerator().w(function(_context40){while(1)switch(_context40.n){case 0:r=t.workId,n=r==null?void 0:r.toString();if(!n){_context40.n=1;break;}s=this._removeWork(n);_t39=s.length;if(!_t39){_context40.n=1;break;}_context40.n=1;return this._post({render:s});case 1:return _context40.a(2);}},_callee38,this);}));function removeWork(_x52){return _removeWork2.apply(this,arguments);}return removeWork;}()},{key:"removeNode",value:function removeNode(t){var _this89=this;var s,c,l;var r=this.vNodes.get(t);r&&(r.toolsType===Tt.BackgroundSVG&&this._post({sp:[{type:vt.BackgroundSVGDelete,toolsType:Tt.BackgroundSVG,workId:t,dataType:Kt.Local,viewId:this.viewId}]}),(s=this.fullLayer)==null||s.getElementsByName(t).forEach(function(f){f.remove(),_vr(f,_this89.fullLayer.parent);}),this.vNodes["delete"](t));var n=this.drawLayer&&$t.getRectFromLayer(this.drawLayer,t);if(n){var f=(c=this.drawLayer)==null?void 0:c.getElementsByName(t)[0];f&&(f.remove(),_vr(f,(l=this.drawLayer)==null?void 0:l.parent));}return this.getWorkShape(t)&&this.clearWorkShapeNodeCache(t),{fullRect:r==null?void 0:r.rect,drawRect:n};}},{key:"_removeWork",value:function _removeWork(t){var _this$removeNode=this.removeNode(t),r=_this$removeNode.fullRect,n=_this$removeNode.drawRect,s=[];return r&&s.push({rect:ve(r),clearCanvas:Ut.Bg,isClear:!0,viewId:this.viewId},{rect:ve(r),drawCanvas:Ut.Bg,viewId:this.viewId}),n&&s.push({rect:ve(n),clearCanvas:Ut.Float,isClear:!0,viewId:this.viewId},{rect:ve(n),drawCanvas:Ut.Float,viewId:this.viewId}),s;}},{key:"checkTextActive",value:function(){var _checkTextActive=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee39(t){var r,n,s,c,l,f,u,_iterator60,_step60,_v11,h,y,T,O,v,_t40,_t41;return _regenerator().w(function(_context41){while(1)switch(_context41.p=_context41.n){case 0:r=t.op,n=t.viewId,s=t.dataType;if(!(r!=null&&r.length)){_context41.n=11;break;}f=r[0]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],u=r[1]*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1];_iterator60=_createForOfIteratorHelper(this.vNodes.curNodeMap.values());_context41.p=1;_iterator60.s();case 2:if((_step60=_iterator60.n()).done){_context41.n=4;break;}_v11=_step60.value;h=_v11.rect,y=_v11.name,T=_v11.toolsType,O=_v11.opt;if(!(T===Tt.Text&&O.workState===te.Done&&tE([f,u],h))){_context41.n=3;break;}c=y,l=this.setFullWork({workId:y,toolsType:T,opt:O});return _context41.a(3,4);case 3:_context41.n=2;break;case 4:_context41.n=6;break;case 5:_context41.p=5;_t40=_context41.v;_iterator60.e(_t40);case 6:_context41.p=6;_iterator60.f();return _context41.f(6);case 7:if(!c){_context41.n=11;break;}_t41=l;if(!_t41){_context41.n=9;break;}_context41.n=8;return l.consumeServiceAsync({isFullWork:!0,replaceId:l.getWorkId(),boxRect:this.thread.getSceneRect()});case 8:v=_context41.v;case 9:_context41.n=10;return this.blurSelector({viewId:n,msgType:vt.Select,dataType:s,isSync:!0});case 10:_context41.n=11;return this._post({render:v&&[{rect:ve(v),clearCanvas:Ut.Bg,isClear:!0,viewId:this.viewId},{rect:ve(v),drawCanvas:Ut.Bg,viewId:this.viewId}],sp:[{type:vt.GetTextActive,toolsType:Tt.Text,workId:c}]});case 11:return _context41.a(2);}},_callee39,this,[[1,5,6,7]]);}));function checkTextActive(_x53){return _checkTextActive.apply(this,arguments);}return checkTextActive;}()},{key:"colloctEffectSelectWork",value:function(){var _colloctEffectSelectWork=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee40(t){var _this90=this;var r,n,s;return _regenerator().w(function(_context42){while(1)switch(_context42.n){case 0:r=this.workShapes.get(Me),n=t.workId,s=t.msgType;if(!(r&&n&&r.selectIds&&r.selectIds.includes(n.toString()))){_context42.n=2;break;}s===vt.RemoveNode?r.selectIds=r.selectIds.filter(function(c){return c!==n.toString();}):this.effectSelectNodeData.add(t);_context42.n=1;return this.runEffectSelectWork(!0).then(function(){var c;(c=_this90.effectSelectNodeData)==null||c.clear();});case 1:return _context42.a(2);case 2:return _context42.a(2,t);}},_callee40,this);}));function colloctEffectSelectWork(_x54){return _colloctEffectSelectWork.apply(this,arguments);}return colloctEffectSelectWork;}()},{key:"updateSelector",value:function(){var _updateSelector2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee41(t){var _this91=this;var I,r,n,s,c,l,f,u,v,h,y,T,O,_t42;return _regenerator().w(function(_context43){while(1)switch(_context43.n){case 0:r=this.workShapes.get(Me);if((I=r==null?void 0:r.selectIds)!=null&&I.length){_context43.n=1;break;}return _context43.a(2);case 1:n=t.callback;s=_objectWithoutProperties(t,_excluded2);c=s.updateSelectorOpt;l=s.willSerializeData;f=s.smoothSync;_context43.n=2;return r==null?void 0:r.updateSelector({updateSelectorOpt:c,selectIds:fr(r.selectIds),vNodes:this.vNodes,willSerializeData:l,worker:this});case 2:u=_context43.v;v=/* @__PURE__ */new Map();u!=null&&u.selectIds&&(h=jM(r.selectIds,u.selectIds),u.selectIds.forEach(function(P){var w=_this91.vNodes.get(P);if(w){var _d46=w.toolsType,m=w.op,p=w.opt;v.set(P,{opt:p,toolsType:_d46,ops:(m==null?void 0:m.length)&&mr(m)||void 0});}}),r.selectIds=u.selectIds);y=[],T=[];u!=null&&u.rect&&y.push({rect:ve(u.rect),clearCanvas:Ut.Bg,isClear:!0,viewId:this.viewId},{rect:ve(u.rect),drawCanvas:Ut.Bg,viewId:this.viewId});O=n&&n({res:u,workShapeNode:r,param:s,postData:{render:y,sp:T},newServiceStore:v,smoothSync:f})||{render:y,sp:T};h&&O.sp.push({type:vt.RemoveNode,removeIds:h,viewId:this.viewId});_t42=O.render.length||O.sp.length;if(!_t42){_context43.n=3;break;}_context43.n=3;return this._post(O);case 3:return _context43.a(2);}},_callee41,this);}));function updateSelector(_x55){return _updateSelector2.apply(this,arguments);}return updateSelector;}()},{key:"blurSelector",value:function(){var _blurSelector=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee42(t){var s,r,n,c;return _regenerator().w(function(_context44){while(1)switch(_context44.n){case 0:r=this.workShapes.get(Me),n=r==null?void 0:r.blurSelector();if(!(this.clearWorkShapeNodeCache(Me),((s=this.fullLayer)==null?void 0:s.parent).children.forEach(function(c){c.name===Me&&c.remove();}),n)){_context44.n=1;break;}c=[];c.push(_objectSpread(_objectSpread({},n),{},{isSync:t==null?void 0:t.isSync}));_context44.n=1;return this._post({render:(n==null?void 0:n.rect)&&[{rect:ve(n.rect),clearCanvas:Ut.Bg,isClear:!0,viewId:this.viewId},{rect:ve(n.rect),drawCanvas:Ut.Bg,viewId:this.viewId}],sp:c});case 1:return _context44.a(2);}},_callee42,this);}));function blurSelector(_x56){return _blurSelector.apply(this,arguments);}return blurSelector;}()},{key:"hasSelector",value:function hasSelector(){return this.workShapes.has(Me);}},{key:"getSelector",value:function getSelector(){return this.workShapes.get(Me);}},{key:"reRenderSelector",value:function(){var _reRenderSelector=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee43(){var t,c,r,n,s,l,_args45=arguments;return _regenerator().w(function(_context45){while(1)switch(_context45.n){case 0:t=_args45.length>0&&_args45[0]!==undefined?_args45[0]:!1;r=this.workShapes.get(Me);if(r){_context45.n=1;break;}return _context45.a(2);case 1:if(!(r&&!((c=r.selectIds)!=null&&c.length))){_context45.n=3;break;}_context45.n=2;return this.blurSelector();case 2:return _context45.a(2);case 3:n=r.oldSelectRect,s=r.reRenderSelector();if(!s){_context45.n=4;break;}l=Zt(n,s)||s;_context45.n=4;return this._post({render:[{rect:ve(l),clearCanvas:Ut.Bg,isClear:!0,viewId:this.viewId},{rect:ve(l),drawCanvas:Ut.Bg,viewId:this.viewId}],sp:[{type:vt.Select,selectIds:r.selectIds,selectRect:s,willSyncService:t,viewId:this.viewId,points:r.getChildrenPoints(),textOpt:r.textOpt,selectorColor:r.selectorColor,strokeColor:r.strokeColor,fillColor:r.fillColor,canTextEdit:r.canTextEdit,canRotate:r.canRotate,scaleType:r.scaleType,opt:r.getWorkOptions()||void 0,canLock:r.canLock,isLocked:r.isLocked,toolsTypes:r.toolsTypes,shapeOpt:r.shapeOpt,thickness:r.thickness,useStroke:r.useStroke,strokeType:r.strokeType}]});case 4:return _context45.a(2);}},_callee43,this);}));function reRenderSelector(){return _reRenderSelector.apply(this,arguments);}return reRenderSelector;}()},{key:"updateFullSelectWork",value:function(){var _updateFullSelectWork=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee44(t){var s,c,l,f,u,v,h,r,n,_r$updateSelectIds,y,T,O;return _regenerator().w(function(_context46){while(1)switch(_context46.n){case 0:r=this.workShapes.get(Me),n=t.selectIds;if(n!=null&&n.length){_context46.n=2;break;}_context46.n=1;return this.blurSelector(t);case 1:return _context46.a(2);case 2:if(r){_context46.n=4;break;}!this.setFullWork(t)&&t.workId&&((s=this.tmpOpt)==null?void 0:s.toolsType)===Tt.Selector&&this.createWorkShape(t.workId.toString());_context46.n=3;return this.updateFullSelectWork(t);case 3:return _context46.a(2);case 4:if(!(r&&n!=null&&n.length)){_context46.n=5;break;}_r$updateSelectIds=r.updateSelectIds(n),y=_r$updateSelectIds.bgRect,T=_r$updateSelectIds.selectRect,O={render:[],sp:[]};y&&((c=O.render)==null||c.push({rect:ve(y),clearCanvas:Ut.Bg,isClear:!0,viewId:this.viewId},{rect:ve(y),drawCanvas:Ut.Bg,viewId:this.viewId}));(h=O.sp)==null||h.push(_objectSpread(_objectSpread({},t),{},{selectorColor:((l=t.opt)==null?void 0:l.strokeColor)||r.selectorColor,strokeColor:((f=t.opt)==null?void 0:f.strokeColor)||r.strokeColor,fillColor:((u=t.opt)==null?void 0:u.fillColor)||r.fillColor,textOpt:((v=t.opt)==null?void 0:v.textOpt)||r.textOpt,canTextEdit:r.canTextEdit,canRotate:r.canRotate,scaleType:r.scaleType,type:vt.Select,selectRect:T,points:r.getChildrenPoints(),willSyncService:(t==null?void 0:t.willSyncService)||!1,opt:(t==null?void 0:t.willSyncService)&&r.getWorkOptions()||void 0,canLock:r.canLock,isLocked:r.isLocked,toolsTypes:r.toolsTypes,shapeOpt:r.shapeOpt,thickness:r.thickness,useStroke:r.useStroke,strokeType:r.strokeType}));_context46.n=5;return this._post(O);case 5:return _context46.a(2);}},_callee44,this);}));function updateFullSelectWork(_x57){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(id,"destroy",this,3)([]),this.effectSelectNodeData.clear();}},{key:"drawEraserCombine",value:function(){var _drawEraserCombine=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee45(t,r){var s,c,l,f,n,u,v,h,y,_iterator61,_step61,_step61$value,_y5,T;return _regenerator().w(function(_context47){while(1)switch(_context47.n){case 0:n=(s=this.workShapes.get(t))==null?void 0:s.combineConsume({workerEngine:this});if(!n){_context47.n=1;break;}u=n.willDeleteNodes,v=n.willNewNodes,h={render:[],fullWorkerDrawCount:r,sp:[]};if(n!=null&&n.rect){y=ve(n.rect);(c=h.render)==null||c.push({rect:y,isClear:!0,clearCanvas:Ut.Bg,viewId:this.viewId},{rect:y,drawCanvas:Ut.Bg,viewId:this.viewId});}if(u!=null&&u.size&&((l=h.sp)==null||l.push({type:vt.RemoveNode,removeIds:_toConsumableArray(u),viewId:this.thread.viewId})),v!=null&&v.size){_iterator61=_createForOfIteratorHelper(v);try{for(_iterator61.s();!(_step61=_iterator61.n()).done;){_step61$value=_slicedToArray(_step61.value,2),_y5=_step61$value[0],T=_step61$value[1];(f=h.sp)==null||f.push({type:vt.FullWork,dataType:Kt.Local,toolsType:Tt.Pencil,ops:mr(T.op),opt:T.opt,workId:_y5,updateNodeOpt:{useAnimation:!1}});}}catch(err){_iterator61.e(err);}finally{_iterator61.f();}}_context47.n=1;return this._post(h);case 1:return _context47.a(2);}},_callee45,this);}));function drawEraserCombine(_x58,_x59){return _drawEraserCombine.apply(this,arguments);}return drawEraserCombine;}()},{key:"drawPencilCombine",value:function(){var _drawPencilCombine=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee46(t,r){var s,c,l,n,f,u;return _regenerator().w(function(_context48){while(1)switch(_context48.n){case 0:n=(s=this.workShapes.get(t))==null?void 0:s.combineConsume();if(!n){_context48.n=1;break;}f={render:[],fullWorkerDrawCount:r};if(n!=null&&n.rect){u=ve(n.rect);(c=f.render)==null||c.push({rect:u,isClear:!0,clearCanvas:Ut.Float,viewId:this.viewId}),(l=f.render)==null||l.push({rect:u,drawCanvas:Ut.Float,viewId:this.viewId});}_context48.n=1;return this._post(f);case 1:return _context48.a(2);}},_callee46,this);}));function drawPencilCombine(_x60,_x61){return _drawPencilCombine.apply(this,arguments);}return drawPencilCombine;}()},{key:"drawSelector",value:function(){var _drawSelector=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee47(t,r){var s,c,n;return _regenerator().w(function(_context49){while(1)switch(_context49.n){case 0:n={render:[],sp:[t]};r&&((s=n.sp)==null||s.push({type:vt.None,isLockSentEventCursor:r}));t.rect&&((c=n.render)==null||c.push({rect:ve(t.rect),clearCanvas:Ut.Bg,isClear:!0,viewId:this.viewId},{rect:ve(t.rect),drawCanvas:Ut.Bg,viewId:this.viewId}));_context49.n=1;return this._post(n);case 1:return _context49.a(2);}},_callee47,this);}));function drawSelector(_x62,_x63){return _drawSelector.apply(this,arguments);}return drawSelector;}()},{key:"drawPencilFull",value:function(){var _drawPencilFull=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee48(t,r,n){var c,l,f,s;return _regenerator().w(function(_context50){while(1)switch(_context50.n){case 0:s={fullWorkerDrawCount:1/0,render:[],sp:[t]};r&&((c=s.sp)==null||c.push({type:vt.None,isLockSentEventCursor:r}));t!=null&&t.rect&&((l=s.render)==null||l.push({isClearAll:!0,clearCanvas:Ut.Float,viewId:this.viewId},{rect:t.rect,isClear:!0,clearCanvas:Ut.Bg,viewId:this.viewId},{rect:t.rect,drawCanvas:Ut.Bg,viewId:this.viewId}));n&&((f=s.sp)==null||f.push({type:vt.None,needUndoTicker:n}));_context50.n=1;return this._post(s);case 1:return _context50.a(2);}},_callee48,this);}));function drawPencilFull(_x64,_x65,_x66){return _drawPencilFull.apply(this,arguments);}return drawPencilFull;}()},{key:"drawEraserFull",value:function(){var _drawEraserFull=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee49(t,r,n,s){var c,l,f,u,v,h,_iterator62,_step62,_step62$value,T,O,_iterator63,_step63,_step63$value,_T0,_O3,y;return _regenerator().w(function(_context51){while(1)switch(_context51.n){case 0:c=r.rect,l=r.willUpdateNodes,f=r.willDeleteNodes,u=r.willNewNodes,v=t.getWorkId(),h=[{type:vt.RemoveNode,removeIds:[v],viewId:this.viewId}];if(n&&h.push({type:vt.None,isLockSentEventCursor:n}),l!=null&&l.size||f!=null&&f.size||u!=null&&u.size){if(l!=null&&l.size){_iterator62=_createForOfIteratorHelper(l);try{for(_iterator62.s();!(_step62=_iterator62.n()).done;){_step62$value=_slicedToArray(_step62.value,2),T=_step62$value[0],O=_step62$value[1];h.push({type:vt.UpdateNode,dataType:Kt.Local,opt:O.opt,workId:T,updateNodeOpt:{useAnimation:!1}});}}catch(err){_iterator62.e(err);}finally{_iterator62.f();}}if(f!=null&&f.size&&h.push({type:vt.RemoveNode,removeIds:_toConsumableArray(f),viewId:this.thread.viewId}),u!=null&&u.size){_iterator63=_createForOfIteratorHelper(u);try{for(_iterator63.s();!(_step63=_iterator63.n()).done;){_step63$value=_slicedToArray(_step63.value,2),_T0=_step63$value[0],_O3=_step63$value[1];h.push({type:vt.FullWork,dataType:Kt.Local,toolsType:_O3.toolsType,ops:mr(_O3.op),opt:_O3.opt,workId:_T0,updateNodeOpt:{useAnimation:!1}});}}catch(err){_iterator63.e(err);}finally{_iterator63.f();}}}y=[{isClearAll:!0,clearCanvas:Ut.Float,viewId:this.viewId}];c&&y.push({rect:c,isClear:!0,clearCanvas:Ut.Bg,viewId:this.viewId},{rect:c,drawCanvas:Ut.Bg,viewId:this.viewId});s&&h.push({type:vt.None,needUndoTicker:s});_context51.n=1;return this._post({sp:h,render:y,fullWorkerDrawCount:1/0});case 1:return _context51.a(2);}},_callee49,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 _callee50(t,r,n){var s,c;return _regenerator().w(function(_context52){while(1)switch(_context52.n){case 0:s=[],c=[];r&&s.push({type:vt.None,isLockSentEventCursor:r});t.removeIds&&s.push(t);t.rect&&c.push({rect:t.rect,isClear:!0,clearCanvas:Ut.Bg,viewId:this.viewId},{rect:t.rect,drawCanvas:Ut.Bg,viewId:this.viewId});n&&s.push({type:vt.None,needUndoTicker:n});_context52.n=1;return this._post({sp:s,render:c,consumeCount:this.consumeCount});case 1:return _context52.a(2);}},_callee50,this);}));function drawEraser(_x71,_x72,_x73){return _drawEraser.apply(this,arguments);}return drawEraser;}()},{key:"drawShape",value:function(){var _drawShape=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee51(t){return _regenerator().w(function(_context53){while(1)switch(_context53.n){case 0:_context53.n=1;return this._post({fullWorkerDrawCount:this.drawCount,sp:(t==null?void 0:t.op)&&[t]});case 1:return _context53.a(2);}},_callee51,this);}));function drawShape(_x74){return _drawShape.apply(this,arguments);}return drawShape;}()},{key:"drawPencil",value:function(){var _drawPencil=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee52(t){return _regenerator().w(function(_context54){while(1)switch(_context54.n){case 0:_context54.n=1;return this._post({sp:(t==null?void 0:t.op)&&[t]});case 1:return _context54.a(2);}},_callee52,this);}));function drawPencil(_x75){return _drawPencil.apply(this,arguments);}return drawPencil;}()},{key:"runEffectSelectWork",value:function(){var _runEffectSelectWork=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee53(t){var r,_iterator64,_step64,n,s,c,l,_t43;return _regenerator().w(function(_context55){while(1)switch(_context55.p=_context55.n){case 0:_iterator64=_createForOfIteratorHelper(this.effectSelectNodeData.values());_context55.p=1;_iterator64.s();case 2:if((_step64=_iterator64.n()).done){_context55.n=10;break;}n=_step64.value;s=this.setFullWork(n);if(!s){_context55.n=9;break;}c=(r=s.getWorkId())==null?void 0:r.toString();if(!(s.toolsType===Tt.BackgroundSVG)){_context55.n=3;break;}s.consumeService({isFullWork:!0,replaceId:c});_context55.n=8;break;case 3:if(!(s.toolsType===Tt.Image)){_context55.n=5;break;}_context55.n=4;return s.consumeServiceAsync({isFullWork:!0,replaceId:c,worker:this});case 4:_context55.n=8;break;case 5:if(!(s.toolsType===Tt.Text)){_context55.n=7;break;}_context55.n=6;return s.consumeServiceAsync({isFullWork:!0,replaceId:c,boxRect:this.thread.getSceneRect()});case 6:_context55.n=8;break;case 7:l=n.ops&&mi(n.ops);s.consumeService({op:l,isFullWork:!0,replaceId:c}),n!=null&&n.updateNodeOpt&&s.updataOptService(n.updateNodeOpt);case 8:n.workId&&this.workShapes["delete"](n.workId.toString());case 9:_context55.n=2;break;case 10:_context55.n=12;break;case 11:_context55.p=11;_t43=_context55.v;_iterator64.e(_t43);case 12:_context55.p=12;_iterator64.f();return _context55.f(12);case 13:_context55.n=14;return this.reRenderSelector(t);case 14:return _context55.a(2);}},_callee53,this,[[1,11,12,13]]);}));function runEffectSelectWork(_x76){return _runEffectSelectWork.apply(this,arguments);}return runEffectSelectWork;}()},{key:"cursorHover",value:function(){var _cursorHover=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee54(t){var l,r,n,s,c,f,u,_t44;return _regenerator().w(function(_context56){while(1)switch(_context56.n){case 0:r=t.opt,n=t.toolsType,s=t.point,c=this.setFullWork({workId:hi,toolsType:n,opt:r});if(!(c&&s)){_context56.n=1;break;}f=c.cursorHover(s),u={render:[]};_t44=f&&f.type===vt.CursorHover&&f.rect;if(!_t44){_context56.n=1;break;}(l=u.render)==null||l.push({rect:ve(f.rect),clearCanvas:Ut.Bg,isClear:!0,viewId:this.viewId},{rect:ve(f.rect),drawCanvas:Ut.Bg,viewId:this.viewId});_context56.n=1;return this._post(u);case 1:return _context56.a(2);}},_callee54,this);}));function cursorHover(_x77){return _cursorHover.apply(this,arguments);}return cursorHover;}()},{key:"cursorBlur",value:function(){var _cursorBlur=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee55(){var n,t,r,_t45,_t46;return _regenerator().w(function(_context57){while(1)switch(_context57.n){case 0:t=this.getWorkShape(hi);_t45=t&&(n=t.selectIds)!=null&&n.length;if(!_t45){_context57.n=1;break;}r=t.oldSelectRect;t.cursorBlur();this.clearWorkShapeNodeCache(hi);_t46=r;if(!_t46){_context57.n=1;break;}_context57.n=1;return this._post({render:[{rect:ve(r),clearCanvas:Ut.Bg,isClear:!0,viewId:this.viewId},{rect:ve(r),drawCanvas:Ut.Bg,viewId:this.viewId}]});case 1:this.fullLayer.parent.children.forEach(function(s){s.name==="Cursor_Hover_Id"&&s.remove();});case 2:return _context57.a(2);}},_callee55,this);}));function cursorBlur(){return _cursorBlur.apply(this,arguments);}return cursorBlur;}()}]);}(Nl);var sd=/*#__PURE__*/function(){function sd(e){_classCallCheck(this,sd);dt(this,"viewId");dt(this,"vNodes");dt(this,"fullLayer");dt(this,"drawLayer");dt(this,"workShapes",/* @__PURE__ */new Map());dt(this,"selectorWorkShapes",/* @__PURE__ */new Map());dt(this,"thread");dt(this,"animationId");dt(this,"willRunEffectSelectorIds",/* @__PURE__ */new Set());dt(this,"runEffectId");dt(this,"noAnimationRect");dt(this,"syncUnitTime",gr.syncOpt.interval);dt(this,"post");this.viewId=e.viewId,this.vNodes=e.vNodes,this.fullLayer=e.fullLayer,this.drawLayer=e.drawLayer,this.thread=e.thread,this.post=e.thread.post.bind(e.thread);}return _createClass(sd,[{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 _callee56(e){return _regenerator().w(function(_context58){while(1)switch(_context58.n){case 0:this.activeWorkShape(e),this.runAnimation();case 1:return _context58.a(2);}},_callee56,this);}));function consumeDraw(_x78){return _consumeDraw2.apply(this,arguments);}return consumeDraw;}()},{key:"consumeFull",value:function consumeFull(e){this.activeWorkShape(e),this.runAnimation();}},{key:"runSelectWork",value:function runSelectWork(e){this.activeSelectorShape(e);var t=e.workId,r=t==null?void 0:t.toString();r&&this.willRunEffectSelectorIds.add(r),this.runEffect();}},{key:"setNodeKey",value:function setNodeKey(e,t,r,n){return t.toolsType=r,t.node=To({workId:e,toolsType:r,toolsOpt:n,vNodes:this.vNodes,fullLayer:this.fullLayer,drawLayer:this.drawLayer},this),t;}},{key:"runReverseSelectWork",value:function runReverseSelectWork(e){var _this92=this;e.forEach(function(t){_this92.selectorWorkShapes.forEach(function(r,n){var s;if((s=r.selectIds)!=null&&s.length){var c=r.selectIds.indexOf(t);c>-1&&(r.selectIds.splice(c,1),_this92.willRunEffectSelectorIds.add(n));}});}),this.willRunEffectSelectorIds.size&&this.runEffect();}},{key:"removeWork",value:function(){var _removeWork3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee57(e){var t,r,n;return _regenerator().w(function(_context59){while(1)switch(_context59.n){case 0:t=e.workId,r=t==null?void 0:t.toString();if(!r){_context59.n=3;break;}n=this.workShapes.get(r);if(!n){_context59.n=2;break;}this.workShapes["delete"](r);_context59.n=1;return this.removeNode(r,e,n==null?void 0:n.totalRect,!1);case 1:return _context59.a(2);case 2:_context59.n=3;return this.removeNode(r,e);case 3:return _context59.a(2);}},_callee57,this);}));function removeWork(_x79){return _removeWork3.apply(this,arguments);}return removeWork;}()},{key:"removeSelectWork",value:function removeSelectWork(e){var t=e.workId,r=t==null?void 0:t.toString();r&&(this.activeSelectorShape(e),this.willRunEffectSelectorIds.add(r)),this.runEffect();}},{key:"removeNode",value:function(){var _removeNode=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee58(e,t,r){var _this93=this;var n,v,s,c,l,f,u,_args60=arguments,_t47;return _regenerator().w(function(_context60){while(1)switch(_context60.n){case 0:n=_args60.length>3&&_args60[3]!==undefined?_args60[3]:!0;e.indexOf(Me)>-1&&this.removeSelectWork(t);s=r;c=(v=this.vNodes.get(e))==null?void 0:v.rect;c&&(s=Zt(c,s));l=this.fullLayer&&$t.getRectFromLayer(this.fullLayer,e);s=Zt(s,l);f=this.drawLayer&&$t.getRectFromLayer(this.drawLayer,e);s=Zt(s,f),this.fullLayer.getElementsByName(e).forEach(function(h){h.remove(),_vr(h,_this93.fullLayer.parent);}),this.drawLayer.getElementsByName(e).forEach(function(h){h.remove(),_vr(h,_this93.drawLayer.parent);});u=this.vNodes.get(e);u&&u.toolsType===Tt.BackgroundSVG&&this.post({sp:[{type:vt.BackgroundSVGDelete,toolsType:Tt.BackgroundSVG,workId:e,dataType:Kt.Service,viewId:this.viewId}]});this.vNodes["delete"](e);_t47=s;if(!_t47){_context60.n=1;break;}_context60.n=1;return this.post({render:[{rect:ve(s),isClear:!0,clearCanvas:n?Ut.Bg:Ut.ServiceFloat,workerType:n?void 0:Kt.Service,viewId:this.viewId},{rect:ve(s),drawCanvas:n?Ut.Bg:Ut.ServiceFloat,workerType:n?void 0:Kt.Service,viewId:this.viewId}]});case 1:return _context60.a(2);}},_callee58,this);}));function removeNode(_x80,_x81,_x82){return _removeNode.apply(this,arguments);}return removeNode;}()},{key:"activeWorkShape",value:function activeWorkShape(e){var O,I,P,w;var t=e.workId,r=e.opt,n=e.toolsType,s=e.type,c=e.updateNodeOpt,l=e.ops,f=e.op,u=e.useAnimation,v=e.isEnableCursor;if(!t)return;var h=t.toString(),y=(O=this.vNodes.get(h))==null?void 0:O.rect;if(!((I=this.workShapes)!=null&&I.has(h))){var _d47={toolsType:n,animationWorkData:f||[],animationIndex:0,type:s,updateNodeOpt:c,ops:l,useAnimation:_typeof(u)<"u"?u:_typeof(c==null?void 0:c.useAnimation)<"u"?c==null?void 0:c.useAnimation:!0,oldRect:y,isDiff:!1,isEnableCursor:v};n&&r&&(_d47=this.setNodeKey(h,_d47,n,r)),(P=this.workShapes)==null||P.set(h,_d47);}var T=(w=this.workShapes)==null?void 0:w.get(h);T.isEnableCursor=v,s&&(T.type=s),l&&(T.animationWorkData=mi(l),T.ops=l),c&&(T.updateNodeOpt=c),f&&(T.isDiff=this.hasDiffData(T.animationWorkData||[],f,T.toolsType),T.animationWorkData=f),T.node&&T.node.getWorkId()!==h&&T.node.setWorkId(h),y&&(T.oldRect=y),n&&r&&(r.syncUnitTime&&(this.syncUnitTime=r.syncUnitTime),T.toolsType!==n&&n&&r&&this.setNodeKey(h,T,n,r),T.node&&T.node.setWorkOptions(r));}},{key:"hasDiffData",value:function hasDiffData(e,t,r){var n=e.length;if(t.length<n)return!0;switch(r){case Tt.Pencil:{for(var s=0;s<n;s+=3)if(t[s]!==e[s]||t[s+1]!==e[s+1])return!0;break;}case Tt.LaserPen:{for(var _s2=0;_s2<n;_s2+=2)if(t[_s2]!==e[_s2]||t[_s2+1]!==e[_s2+1])return!0;break;}}return!1;}},{key:"animationDraw",value:function(){var _animationDraw=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee59(){var _this94=this;var n,s,c,l,f,u,v,h,y,T,O,I,P,w,d,m,p,S,E,R,D,U,M,W,$,B,N,z,J,et,at,ct,V,Q,ft,mt,yt,At,ht,Nt,Bt,G,k,rt,e,t,r,_iterator65,_step65,_loop6,_t49,_t50;return _regenerator().w(function(_context62){while(1)switch(_context62.p=_context62.n){case 0:this.animationId=void 0;e=!1;t={render:[]},r=/* @__PURE__ */new Map();_iterator65=_createForOfIteratorHelper(this.workShapes.entries());_context62.p=1;_loop6=/*#__PURE__*/_regenerator().m(function _loop6(){var _step65$value,nt,Y,Z,C,_Z3,_C2,_Z4,_C3,_Z5,_C4,L,X,_Z6,_C5,_L,_X2,K,q,it,_q,_Z7,_C6,_L2,_X3,_t48;return _regenerator().w(function(_context61){while(1)switch(_context61.n){case 0:_step65$value=_slicedToArray(_step65.value,2),nt=_step65$value[0],Y=_step65$value[1];_t48=Y.toolsType;_context61.n=_t48===Tt.BackgroundSVG?1:_t48===Tt.Image?2:_t48===Tt.Text?4:_t48===Tt.Arrow?7:_t48===Tt.Straight?7:_t48===Tt.Rectangle?7:_t48===Tt.Ellipse?7:_t48===Tt.Star?7:_t48===Tt.Polygon?7:_t48===Tt.SpeechBalloon?7:_t48===Tt.Pencil?8:13;break;case 1:Z=Y.oldRect;Z&&((n=t.render)==null||n.push({rect:Z,isClear:!0,clearCanvas:Ut.Bg,viewId:_this94.viewId}),(s=t.render)==null||s.push({rect:Z,drawCanvas:Ut.Bg,viewId:_this94.viewId}));C=(c=Y.node)==null?void 0:c.consumeService({isFullWork:!0,replaceId:nt});_this94.selectorWorkShapes.forEach(function(L,X){var K;(K=L.selectIds)!=null&&K.includes(nt)&&(_this94.willRunEffectSelectorIds.add(X),_this94.noAnimationRect=Zt(_this94.noAnimationRect,Z),_this94.noAnimationRect=Zt(_this94.noAnimationRect,C),_this94.runEffect());}),_this94.workShapes["delete"](nt),(l=t.render)==null||l.push({rect:C,drawCanvas:Ut.Bg,viewId:_this94.viewId});return _context61.a(3,13);case 2:_Z3=Y.oldRect;_Z3&&((f=t.render)==null||f.push({rect:_Z3,isClear:!0,clearCanvas:Ut.Bg,viewId:_this94.viewId}),(u=t.render)==null||u.push({rect:_Z3,drawCanvas:Ut.Bg,viewId:_this94.viewId}));_context61.n=3;return(v=Y.node)==null?void 0:v.consumeServiceAsync({isFullWork:!0,worker:_this94.thread});case 3:_C2=_context61.v;_this94.selectorWorkShapes.forEach(function(L,X){var K;(K=L.selectIds)!=null&&K.includes(nt)&&(_this94.willRunEffectSelectorIds.add(X),_this94.noAnimationRect=Zt(_this94.noAnimationRect,_Z3),_this94.noAnimationRect=Zt(_this94.noAnimationRect,_C2),_this94.runEffect());}),_this94.workShapes["delete"](nt),(h=t.render)==null||h.push({rect:_C2,drawCanvas:Ut.Bg,viewId:_this94.viewId});return _context61.a(3,13);case 4:if(!Y.node){_context61.n=6;break;}_Z4=Y.oldRect;_Z4&&((y=t.render)==null||y.push({rect:_Z4,isClear:!0,clearCanvas:Ut.Bg,viewId:_this94.viewId}),(T=t.render)==null||T.push({rect:_Z4,drawCanvas:Ut.Bg,viewId:_this94.viewId}));_context61.n=5;return Y.node.consumeServiceAsync({isFullWork:!0,replaceId:nt,boxRect:_this94.thread.getSceneRect()});case 5:_C3=_context61.v;_this94.selectorWorkShapes.forEach(function(L,X){var K;(K=L.selectIds)!=null&&K.includes(nt)&&(_this94.willRunEffectSelectorIds.add(X),_this94.noAnimationRect=Zt(_this94.noAnimationRect,_Z4),_this94.noAnimationRect=Zt(_this94.noAnimationRect,_C3),_this94.runEffect());}),(O=Y.node)==null||O.clearTmpPoints(),_this94.workShapes["delete"](nt),(I=t.render)==null||I.push({rect:_C3,drawCanvas:Ut.Bg,viewId:_this94.viewId});case 6:return _context61.a(3,13);case 7:_Z5=!!Y.ops;if((P=Y.animationWorkData)!=null&&P.length){_C4=Y.oldRect,L=Y.node.oldRect;_C4&&((w=t.render)==null||w.push({rect:_C4,isClear:!0,clearCanvas:Ut.Bg,viewId:_this94.viewId}),(d=t.render)==null||d.push({rect:_C4,drawCanvas:Ut.Bg,viewId:_this94.viewId})),L&&((m=t.render)==null||m.push({rect:L,isClear:!0,clearCanvas:Ut.ServiceFloat,viewId:_this94.viewId}));X=(p=Y.node)==null?void 0:p.consumeService({op:Y.animationWorkData,isFullWork:_Z5});Y.isEnableCursor?r.set(nt,{workState:_C4?Y.ops?te.Done:te.Doing:te.Start,op:Y.animationWorkData.slice(-3,-1)}):_Z5&&!Y.useAnimation&&(S=Y.updateNodeOpt)!=null&&S.useAnimation&&r.set(nt,{workState:te.Done,op:Y.animationWorkData.slice(-3,-1),uid:(E=Y.updateNodeOpt)==null?void 0:E.uid}),_Z5?(_this94.selectorWorkShapes.forEach(function(K,q){var it;(it=K.selectIds)!=null&&it.includes(nt)&&(_this94.willRunEffectSelectorIds.add(q),_this94.noAnimationRect=Zt(_this94.noAnimationRect,_C4),_this94.noAnimationRect=Zt(_this94.noAnimationRect,L),_this94.noAnimationRect=Zt(_this94.noAnimationRect,X),_this94.runEffect());}),(R=Y.node)==null||R.clearTmpPoints(),_this94.workShapes["delete"](nt),(D=t.render)==null||D.push({rect:X,drawCanvas:Ut.Bg,viewId:_this94.viewId})):(U=t.render)==null||U.push({rect:X,drawCanvas:Ut.ServiceFloat,workerType:_Z5?void 0:Kt.Service,viewId:_this94.viewId}),Y.animationWorkData.length=0;}return _context61.a(3,13);case 8:if(!Y.useAnimation){_context61.n=11;break;}if(!Y.useAnimation){_context61.n=10;break;}if(!Y.isDel){_context61.n=9;break;}(ft=Y.node)==null||ft.clearTmpPoints(),_this94.workShapes["delete"](nt);return _context61.a(3,13);case 9:_Z6=3,_C5=_this94.computNextAnimationIndex(Y,_Z6),_L=Y.isDiff?0:Math.max(0,(Y.animationIndex||0)-_Z6),_X2=(Y.animationWorkData||[]).slice(0,_C5),K=(yt=(mt=Y.node)==null?void 0:mt.getWorkId())==null?void 0:yt.toString();if((Y.animationIndex||0)<_C5||Y.isDiff){q=(At=Y.node)==null?void 0:At.consumeService({op:_X2,isFullWork:!1,replaceId:K});if((ht=t.render)==null||ht.push({isClear:!0,rect:q,clearCanvas:Ut.ServiceFloat,viewId:_this94.viewId}),(Nt=t.render)==null||Nt.push({rect:q,drawCanvas:Ut.ServiceFloat,viewId:_this94.viewId}),Y.animationIndex=_C5,Y.isDiff&&(Y.isDiff=!1),_X2.length&&Y.isEnableCursor){it=_X2.slice(-3,-1);r.set(nt,{workState:_L===0?te.Start:_C5===((Bt=Y.animationWorkData)==null?void 0:Bt.length)?te.Done:te.Doing,op:it});}}else if(Y.ops){_q=(G=Y.node)==null?void 0:G.consumeService({op:Y.animationWorkData||[],isFullWork:!0,replaceId:K});Y.isDel=!0,(k=t.render)==null||k.push({isClear:!0,rect:_q,clearCanvas:Ut.ServiceFloat,viewId:_this94.viewId},{rect:_q,drawCanvas:Ut.ServiceFloat,viewId:_this94.viewId},{isClear:!0,rect:_q,clearCanvas:Ut.Bg,viewId:_this94.viewId},{rect:_q,drawCanvas:Ut.Bg,viewId:_this94.viewId}),Y.isEnableCursor&&r.set(nt,{workState:te.Done,op:_X2.slice(-3,-1)});}e=!0;return _context61.a(3,13);case 10:_context61.n=12;break;case 11:_Z7=!!Y.ops;_C6=(M=Y.node)==null?void 0:M.consumeService({op:Y.animationWorkData||[],isFullWork:_Z7,replaceId:nt});_L2=(W=Y.node)==null?void 0:W.updataOptService(Y.updateNodeOpt);if(_Z7){if(_C6=Zt(_C6,_L2),($=t.render)==null||$.push({isClear:!0,rect:Zt(Y.oldRect,_C6),clearCanvas:Ut.Bg,viewId:_this94.viewId}),(B=t.render)==null||B.push({rect:Zt(Y.oldRect,_C6),drawCanvas:Ut.Bg,viewId:_this94.viewId}),(N=Y.updateNodeOpt)!=null&&N.useAnimation&&((z=t.render)==null||z.push({isClear:!0,rect:Zt(Y.oldRect,_C6),clearCanvas:Ut.ServiceFloat,viewId:_this94.viewId}),(J=t.render)==null||J.push({rect:Zt(Y.oldRect,_C6),drawCanvas:Ut.ServiceFloat,viewId:_this94.viewId}),!Y.isEnableCursor&&(et=Y.animationWorkData)!=null&&et.length)){_X3=Y.animationWorkData.slice(-3,-1);r.set(nt,{workState:te.Done,op:_X3,uid:(at=Y.updateNodeOpt)==null?void 0:at.uid});}_this94.selectorWorkShapes.forEach(function(X,K){var q;(q=X.selectIds)!=null&&q.includes(nt)&&(_this94.willRunEffectSelectorIds.add(K),_this94.noAnimationRect=Zt(_this94.noAnimationRect,_C6),_this94.runEffect());}),(ct=Y.node)==null||ct.clearTmpPoints(),_this94.workShapes["delete"](nt);}else _C6=Zt(_C6,_L2),(V=t.render)==null||V.push({isClear:!0,rect:Zt(Y.oldRect,_C6),clearCanvas:Ut.ServiceFloat,viewId:_this94.viewId}),(Q=t.render)==null||Q.push({rect:Zt(Y.oldRect,_C6),drawCanvas:Ut.ServiceFloat,viewId:_this94.viewId});case 12:return _context61.a(3,13);case 13:return _context61.a(2);}},_loop6);});_iterator65.s();case 2:if((_step65=_iterator65.n()).done){_context62.n=4;break;}return _context62.d(_regeneratorValues(_loop6()),3);case 3:_context62.n=2;break;case 4:_context62.n=6;break;case 5:_context62.p=5;_t49=_context62.v;_iterator65.e(_t49);case 6:_context62.p=6;_iterator65.f();return _context62.f(6);case 7:e&&this.runAnimation();r.size&&(t.sp=[],r.forEach(function(nt,Y){var Z;(Z=t.sp)==null||Z.push({type:vt.Cursor,uid:nt.uid||Y.split(gi)[0],op:nt.op,workState:nt.workState,viewId:_this94.viewId});}));_t50=(rt=t.render)!=null&&rt.length;if(!_t50){_context62.n=8;break;}_context62.n=8;return this.post(t);case 8:return _context62.a(2);}},_callee59,this,[[1,5,6,7]]);}));function animationDraw(){return _animationDraw.apply(this,arguments);}return animationDraw;}()},{key:"runAnimation",value:function runAnimation(){var _this95=this;this.animationId||(this.animationId=setTimeout(function(){_this95.animationId=void 0,_this95.animationDraw();},16));}},{key:"computNextAnimationIndex",value:function computNextAnimationIndex(e,t){var r=Math.floor((e.animationWorkData||[]).slice(e.animationIndex).length*48/t/this.syncUnitTime)*t;return Math.min((e.animationIndex||0)+(r||t),(e.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 _callee60(){var _this96=this;var e,_t51;return _regenerator().w(function(_context63){while(1)switch(_context63.n){case 0:this.runEffectId=void 0;e=this.noAnimationRect;this.willRunEffectSelectorIds.forEach(function(t){var s,c;var r=_this96.selectorWorkShapes.get(t),n=r&&r.selectIds&&((s=r.node)==null?void 0:s.selectServiceNode(t,r,!0));e=Zt(e,n),(c=r==null?void 0:r.selectIds)!=null&&c.length||_this96.selectorWorkShapes["delete"](t);});_t51=e;if(!_t51){_context63.n=1;break;}_context63.n=1;return this.post({render:[{rect:ve(e),isClear:!0,clearCanvas:Ut.Bg,viewId:this.viewId},{rect:ve(e),drawCanvas:Ut.Bg,viewId:this.viewId}]});case 1:this.willRunEffectSelectorIds.clear();this.noAnimationRect=void 0;case 2:return _context63.a(2);}},_callee60,this);}));function effectRunSelector(){return _effectRunSelector.apply(this,arguments);}return effectRunSelector;}()},{key:"activeSelectorShape",value:function activeSelectorShape(e){var v,h,y;var t=e.workId,r=e.opt,n=e.toolsType,s=e.type,c=e.selectIds,l=e.imageBitmap;if(!t)return;var f=t.toString();if(!((v=this.selectorWorkShapes)!=null&&v.has(f))){var T={toolsType:n,selectIds:c,type:s,opt:r,imageBitmap:l};n&&r&&(T=this.setNodeKey(f,T,n,r)),(h=this.selectorWorkShapes)==null||h.set(f,T);}var u=(y=this.selectorWorkShapes)==null?void 0:y.get(f);s&&(u.type=s),u.node&&u.node.getWorkId()!==f&&u.node.setWorkId(f),l&&(u.imageBitmap=l),u.selectIds=c||[];}}]);}();var GM=/*#__PURE__*/function(_Nl2){function GM(t){var _this97;_classCallCheck(this,GM);_this97=_callSuper(this,GM,[t]);dt(_this97,"drawWorkActiveId");return _this97;}_inherits(GM,_Nl2);return _createClass(GM,[{key:"runSelectWork",value:function runSelectWork(t){var n;var r=this.setFullWork(t);r&&(n=t.selectIds)!=null&&n.length&&t.workId&&r.selectServiceNode(t.workId.toString(),{selectIds:t.selectIds},!1);}},{key:"workShapesDone",value:function workShapesDone(){var _iterator66=_createForOfIteratorHelper(this.workShapes.keys()),_step66;try{for(_iterator66.s();!(_step66=_iterator66.n()).done;){var t=_step66.value;this.clearWorkShapeNodeCache(t);}}catch(err){_iterator66.e(err);}finally{_iterator66.f();}Rr(this.fullLayer,this.fullLayer.parent);}},{key:"consumeDraw",value:function(){var _consumeDraw3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee61(t){var r,n,s,c,l,f,u,_t52,_t53,_t54,_t55,_t56,_t57;return _regenerator().w(function(_context64){while(1)switch(_context64.n){case 0:r=t.workId,n=t.fullWorkerDrawCount,s=t.postCount,c=r==null?void 0:r.toString(),l=c&&this.workShapes.get(c);if(l){_context64.n=1;break;}return _context64.a(2);case 1:_t52=this.drawWorkActiveId&&this.drawWorkActiveId!==c;if(!_t52){_context64.n=3;break;}_context64.n=2;return this.consumeDrawAll({workId:this.drawWorkActiveId,viewId:this.viewId,msgType:vt.DrawWork,dataType:Kt.Local});case 2:this.drawWorkActiveId=void 0;case 3:!this.drawWorkActiveId&&c!==Me&&(this.drawWorkActiveId=c);f=l.toolsType;_e(s)&&(this.consumeCount=s);u=l.consume({data:t,drawCount:this.drawCount,isFullWork:!0,isSubWorker:!0,removeDrawCount:n});_t53=f;_context64.n=_t53===Tt.Selector?4:_t53===Tt.Ellipse?6:_t53===Tt.Arrow?6:_t53===Tt.Straight?6:_t53===Tt.Rectangle?6:_t53===Tt.Star?6:_t53===Tt.Polygon?6:_t53===Tt.SpeechBalloon?6:_t53===Tt.Pencil?8:_t53===Tt.BitMapEraser?10:_t53===Tt.PencilEraser?10:12;break;case 4:_t54=u;if(!_t54){_context64.n=5;break;}this.drawCount++;_context64.n=5;return this.drawSelector(u);case 5:return _context64.a(3,12);case 6:_t55=u;if(!_t55){_context64.n=7;break;}this.drawCount++;_context64.n=7;return this.drawShape(u);case 7:return _context64.a(3,12);case 8:_t56=u;if(!_t56){_context64.n=9;break;}this.drawCount++;_context64.n=9;return this.drawPencil(u,r==null?void 0:r.toString());case 9:return _context64.a(3,12);case 10:_t57=u;if(!_t57){_context64.n=11;break;}this.drawCount++;_context64.n=11;return this._post({subWorkerDrawCount:this.drawCount,consumeCount:this.consumeCount});case 11:return _context64.a(3,12);case 12:return _context64.a(2);}},_callee61,this);}));function consumeDraw(_x83){return _consumeDraw3.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee62(t){var r,n,s,_t58;return _regenerator().w(function(_context65){while(1)switch(_context65.n){case 0:r=t.workId;if(!r){_context65.n=4;break;}n=r.toString();this.drawWorkActiveId===n&&(this.drawWorkActiveId=void 0);s=this.workShapes.get(n);if(s){_context65.n=1;break;}return _context65.a(2);case 1:_t58=s.toolsType;_context65.n=_t58===Tt.Selector?2:_t58===Tt.Arrow?3:_t58===Tt.Straight?3:_t58===Tt.Ellipse?3:_t58===Tt.Pencil?3:_t58===Tt.Rectangle?3:_t58===Tt.Star?3:_t58===Tt.Polygon?3:_t58===Tt.SpeechBalloon?3:_t58===Tt.BitMapEraser?3:_t58===Tt.PencilEraser?3:4;break;case 2:this.drawCount=0,Rr(this.fullLayer,this.fullLayer.parent),this.clearWorkShapeNodeCache(n),this._post({render:[{isClearAll:!0,clearCanvas:Ut.Float,viewId:this.viewId}]});return _context65.a(3,4);case 3:this.drawCount=0,Rr(this.fullLayer,this.fullLayer.parent),this.clearWorkShapeNodeCache(n);return _context65.a(3,4);case 4:return _context65.a(2);}},_callee62,this);}));function consumeDrawAll(_x84){return _consumeDrawAll2.apply(this,arguments);}return consumeDrawAll;}()},{key:"removeWork",value:function(){var _removeWork4=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee63(t){var r,n,s,c;return _regenerator().w(function(_context66){while(1)switch(_context66.n){case 0:r=t.workId,n=r==null?void 0:r.toString();if(!n){_context66.n=1;break;}s=this.removeNode(n);if(!s){_context66.n=1;break;}c=[];c.push({rect:ve(s),clearCanvas:Ut.Float,isClear:!0,viewId:this.viewId},{rect:ve(s),drawCanvas:Ut.Float,viewId:this.viewId});_context66.n=1;return this._post({render:c});case 1:return _context66.a(2);}},_callee63,this);}));function removeWork(_x85){return _removeWork4.apply(this,arguments);}return removeWork;}()},{key:"removeNode",value:function removeNode(t){var _this98=this;var r=this.workShapes.has(t);var n;return r&&(this.fullLayer.getElementsByName(t).forEach(function(s){var c=s.getBoundingClientRect();n=Zt(n,{x:c.x-$t.SafeBorderPadding,y:c.y-$t.SafeBorderPadding,w:c.width+$t.SafeBorderPadding*2,h:c.height+$t.SafeBorderPadding*2}),s.remove(),_vr(s,_this98.fullLayer.parent);}),n&&this.clearWorkShapeNodeCache(t)),n;}},{key:"drawPencil",value:function(){var _drawPencil2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee64(t,r){return _regenerator().w(function(_context67){while(1)switch(_context67.n){case 0:_context67.n=1;return this._post({subWorkerDrawCount:this.drawCount,consumeCount:this.consumeCount,render:[{rect:t==null?void 0:t.rect,workId:r,drawCanvas:Ut.Float,viewId:this.viewId}],sp:(t==null?void 0:t.op)&&[t]});case 1:return _context67.a(2);}},_callee64,this);}));function drawPencil(_x86,_x87){return _drawPencil2.apply(this,arguments);}return drawPencil;}()},{key:"drawShape",value:function(){var _drawShape2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee65(t){return _regenerator().w(function(_context68){while(1)switch(_context68.n){case 0:_context68.n=1;return this._post({subWorkerDrawCount:this.drawCount,consumeCount:this.consumeCount,render:[{rect:(t==null?void 0:t.rect)&&ve(t.rect),isClear:!0,clearCanvas:Ut.Float,viewId:this.viewId},{rect:(t==null?void 0:t.rect)&&ve(t.rect),drawCanvas:Ut.Float,viewId:this.viewId}]});case 1:return _context68.a(2);}},_callee65,this);}));function drawShape(_x88){return _drawShape2.apply(this,arguments);}return drawShape;}()},{key:"drawSelector",value:function(){var _drawSelector2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee66(t){return _regenerator().w(function(_context69){while(1)switch(_context69.n){case 0:_context69.n=1;return this._post({subWorkerDrawCount:this.drawCount,consumeCount:this.consumeCount,render:[{rect:(t==null?void 0:t.rect)&&ve(t.rect),isClear:!0,clearCanvas:Ut.Float,viewId:this.viewId},{rect:(t==null?void 0:t.rect)&&ve(t.rect),drawCanvas:Ut.Float,viewId:this.viewId}]});case 1:return _context69.a(2);}},_callee66,this);}));function drawSelector(_x89){return _drawSelector2.apply(this,arguments);}return drawSelector;}()}]);}(Nl);var kM=/*#__PURE__*/function(){function kM(e){_classCallCheck(this,kM);dt(this,"viewId");dt(this,"vNodes");dt(this,"topLayer");dt(this,"thread");dt(this,"post");dt(this,"serviceWorkShapes",/* @__PURE__ */new Map());dt(this,"localWorkShapes",/* @__PURE__ */new Map());dt(this,"tmpOpt");dt(this,"syncUnitTime",gr.syncOpt.interval);dt(this,"animationId");this.viewId=e.viewId,this.vNodes=e.vNodes,this.topLayer=e.topLayer,this.thread=e.thread,this.post=e.thread.post.bind(e.thread);}return _createClass(kM,[{key:"canUseTopLayer",value:function canUseTopLayer(e){return e===Tt.LaserPen;}},{key:"getWorkShape",value:function getWorkShape(e){return this.localWorkShapes.get(e);}},{key:"createWorkShape",value:function createWorkShape(e,t){if(e&&this.tmpOpt){var r={toolsType:this.tmpOpt.toolsType,toolsOpt:t||this.tmpOpt.toolsOpt},n=this.createWorkShapeNode(_objectSpread(_objectSpread({},r),{},{workId:e}));return n&&this.localWorkShapes.set(e,{node:n,toolsType:n.toolsType,workState:te.Start}),n;}}},{key:"setWorkOptions",value:function setWorkOptions(e,t){var n;var r=(n=this.localWorkShapes.get(e))==null?void 0:n.node;r||this.createWorkShape(e,t),r==null||r.setWorkOptions(t);}},{key:"createWorkShapeNode",value:function createWorkShapeNode(e){var t=e.toolsType;if(t===Tt.LaserPen)return To(_objectSpread(_objectSpread({},e),{},{vNodes:this.vNodes,fullLayer:this.topLayer,drawLayer:this.topLayer}));}},{key:"clearAllWorkShapesCache",value:function clearAllWorkShapesCache(){this.localWorkShapes.forEach(function(e){var t;return(t=e.node)==null?void 0:t.clearTmpPoints();}),this.localWorkShapes.clear();}},{key:"setToolsOpt",value:function setToolsOpt(e){var t;this.tmpOpt=e,(t=e.toolsOpt)!=null&&t.syncUnitTime&&(this.syncUnitTime=e.toolsOpt.syncUnitTime);}},{key:"getToolsOpt",value:function getToolsOpt(){return this.tmpOpt;}},{key:"consumeDraw",value:function consumeDraw(e){var t=e.workId,r=e.dataType;if(r===Kt.Service)this.activeServiceWorkShape(e);else{var n=t==null?void 0:t.toString(),s=n&&this.localWorkShapes.get(n);if(!s)return;var c=s.node.consume({data:e,isFullWork:!1,isSubWorker:!0});c.rect&&(s.totalRect=Zt(c.rect,s.totalRect),s.result=c,s.workState=te.Doing,n&&this.localWorkShapes.set(n,s));}this.runAnimation();}},{key:"consumeDrawAll",value:function consumeDrawAll(e){var t=e.workId,r=e.dataType;if(r===Kt.Service)this.activeServiceWorkShape(e);else{var n=t==null?void 0:t.toString(),s=n&&this.localWorkShapes.get(n);if(!s)return;var c=s.node.consumeAll({data:e});s.totalRect=Zt(c.rect,s.totalRect),s.result=c,s.workState=te.Done,n&&this.localWorkShapes.set(n,s);}this.runAnimation();}},{key:"destroy",value:function destroy(){this.serviceWorkShapes.clear(),this.localWorkShapes.clear();}},{key:"setNodeKey",value:function setNodeKey(e,t,r,n){return t.toolsType=r,t.node=this.createWorkShapeNode({workId:e,toolsType:r,toolsOpt:n}),t;}},{key:"activeServiceWorkShape",value:function activeServiceWorkShape(e){var y,T;var t=e.workId,r=e.opt,n=e.toolsType,s=e.type,c=e.updateNodeOpt,l=e.ops,f=e.op;if(!t)return;var u=t.toString(),v=(y=this.vNodes.get(u))==null?void 0:y.rect;if(!((T=this.serviceWorkShapes)!=null&&T.has(u))){var O={toolsType:n,animationWorkData:f||[],animationIndex:0,type:s,updateNodeOpt:c,ops:l,oldRect:v};n&&r&&(O=this.setNodeKey(u,O,n,r)),this.serviceWorkShapes.set(u,O);}var h=this.serviceWorkShapes.get(u);s&&(h.type=s),l&&(h.animationWorkData=mi(l),h.ops=l),c&&(h.updateNodeOpt=c),f&&(h.animationWorkData=f),h.node&&h.node.getWorkId()!==u&&h.node.setWorkId(u),v&&(h.oldRect=v),n&&r&&(h.toolsType!==n&&n&&r&&this.setNodeKey(u,h,n,r),h.node&&h.node.setWorkOptions(r));}},{key:"computNextAnimationIndex",value:function computNextAnimationIndex(e,t){var r=Math.floor((e.animationWorkData||[]).slice(e.animationIndex).length*32/t/this.syncUnitTime)*t;return Math.min((e.animationIndex||0)+(r||t),(e.animationWorkData||[]).length);}},{key:"animationDraw",value:function(){var _animationDraw2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee67(){var _this99=this;var c,l,f,u,e,t,r,n,s,_iterator67,_step67,_step67$value,v,h,T,O,I,P,_iterator68,_step68,_step68$value,_v12,_h7,y,_T1,_O4,_I5,_P24,_t59,_t60,_t61,_t62;return _regenerator().w(function(_context70){while(1)switch(_context70.p=_context70.n){case 0:this.animationId=void 0;e=!1;t=/* @__PURE__ */new Map(),r=[],n=[],s=[];_iterator67=_createForOfIteratorHelper(this.serviceWorkShapes.entries());_context70.p=1;_iterator67.s();case 2:if((_step67=_iterator67.n()).done){_context70.n=6;break;}_step67$value=_slicedToArray(_step67.value,2),v=_step67$value[0],h=_step67$value[1];_t59=h.toolsType;_context70.n=_t59===Tt.LaserPen?3:5;break;case 3:T=this.computNextAnimationIndex(h,8),O=Math.max(0,h.animationIndex||0),I=(h.animationWorkData||[]).slice(O,T);if((h.animationIndex||0)<T){P=(c=h.node)==null?void 0:c.consumeService({op:I,isFullWork:!1});h.totalRect=Zt(h.totalRect,P),h.animationIndex=T,I.length&&t.set(v,{workState:O===0?te.Start:T===((l=h.animationWorkData)==null?void 0:l.length)?te.Done:te.Doing,op:I.slice(-2)});}if(!(n.push({isClear:!0,rect:h.totalRect,clearCanvas:Ut.TopFloat,viewId:this.viewId}),r.push({rect:h.totalRect,drawCanvas:Ut.TopFloat,viewId:this.viewId}),h.isDel)){_context70.n=4;break;}(f=h.node)==null||f.clearTmpPoints(),this.serviceWorkShapes["delete"](v);return _context70.a(3,5);case 4:h.ops&&h.animationIndex===((u=h.animationWorkData)==null?void 0:u.length)&&!h.isDel&&(this.topLayer.getElementsByName(v.toString())[0]||(h.isDel=!0,this.serviceWorkShapes.set(v,h))),e=!0;return _context70.a(3,5);case 5:_context70.n=2;break;case 6:_context70.n=8;break;case 7:_context70.p=7;_t60=_context70.v;_iterator67.e(_t60);case 8:_context70.p=8;_iterator67.f();return _context70.f(8);case 9:_iterator68=_createForOfIteratorHelper(this.localWorkShapes.entries());_context70.p=10;_iterator68.s();case 11:if((_step68=_iterator68.n()).done){_context70.n=15;break;}_step68$value=_slicedToArray(_step68.value,2),_v12=_step68$value[0],_h7=_step68$value[1];y=_h7.result,_T1=_h7.toolsType,_O4=_h7.totalRect,_I5=_h7.isDel,_P24=_h7.workState;_t61=_T1;_context70.n=_t61===Tt.LaserPen?12:14;break;case 12:if(!(_O4&&(n.push({isClear:!0,rect:_O4,clearCanvas:Ut.TopFloat,viewId:this.viewId}),r.push({rect:_O4,drawCanvas:Ut.TopFloat,viewId:this.viewId})),_I5)){_context70.n=13;break;}_h7.node.clearTmpPoints(),this.localWorkShapes["delete"](_v12),s.push({removeIds:[_v12.toString()],viewId:this.viewId,type:vt.RemoveNode});return _context70.a(3,14);case 13:y&&((y.op||y.ops)&&s.push(y),_h7.result=void 0),!this.topLayer.getElementsByName(_v12.toString())[0]&&_P24===te.Done&&(_h7.isDel=!0,this.localWorkShapes.set(_v12,_h7)),e=!0;return _context70.a(3,14);case 14:_context70.n=11;break;case 15:_context70.n=17;break;case 16:_context70.p=16;_t62=_context70.v;_iterator68.e(_t62);case 17:_context70.p=17;_iterator68.f();return _context70.f(17);case 18:e&&this.runAnimation(),t.size&&t.forEach(function(v,h){s.push({type:vt.Cursor,uid:h.split(gi)[0],op:v.op,workState:v.workState,viewId:_this99.viewId});}),(r.length||n.length||s.length)&&this.post({render:[].concat(n,r),sp:s});case 19:return _context70.a(2);}},_callee67,this,[[10,16,17,18],[1,7,8,9]]);}));function animationDraw(){return _animationDraw2.apply(this,arguments);}return animationDraw;}()},{key:"runAnimation",value:function runAnimation(){var _this100=this;this.animationId||(this.animationId=setTimeout(function(){_this100.animationId=void 0,_this100.animationDraw();},16));}}]);}();var HM=/*#__PURE__*/function(_id){function HM(t){var _this101;_classCallCheck(this,HM);_this101=_callSuper(this,HM,[t]);dt(_this101,"_type","simple");return _this101;}_inherits(HM,_id);return _createClass(HM,[{key:"createWorkShapeNode",value:function createWorkShapeNode(t){var n;var r=t.toolsType;return r===Tt.Selector?this.vNodes?new ki(_objectSpread(_objectSpread({},t),{},{fullLayer:this.fullLayer,vNodes:this.vNodes,drawLayer:this.drawLayer})):void 0:To(_objectSpread(_objectSpread({},t),{},{vNodes:this.vNodes,fullLayer:this.fullLayer,drawLayer:this.drawLayer}),(n=this.thread)==null?void 0:n.serviceWork);}},{key:"drawPencil",value:function(){var _drawPencil3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee68(t,r){return _regenerator().w(function(_context71){while(1)switch(_context71.n){case 0:_context71.n=1;return this._post({consumeCount:this.consumeCount,render:[{rect:t==null?void 0:t.rect,workId:r,drawCanvas:Ut.Float,viewId:this.viewId}],sp:(t==null?void 0:t.op)&&[t]});case 1:return _context71.a(2);}},_callee68,this);}));function drawPencil(_x90,_x91){return _drawPencil3.apply(this,arguments);}return drawPencil;}()},{key:"drawShape",value:function(){var _drawShape3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee69(t){return _regenerator().w(function(_context72){while(1)switch(_context72.n){case 0:_context72.n=1;return this._post({consumeCount:this.consumeCount,sp:(t==null?void 0:t.op)&&[t],render:[{rect:(t==null?void 0:t.rect)&&ve(t.rect),isClear:!0,clearCanvas:Ut.Float,viewId:this.viewId},{rect:(t==null?void 0:t.rect)&&ve(t.rect),drawCanvas:Ut.Float,viewId:this.viewId}]});case 1:return _context72.a(2);}},_callee69,this);}));function drawShape(_x92){return _drawShape3.apply(this,arguments);}return drawShape;}()},{key:"drawSelector",value:function(){var _drawSelector3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee70(t,r){var n,c,l,f,s,_args73=arguments;return _regenerator().w(function(_context73){while(1)switch(_context73.n){case 0:n=_args73.length>2&&_args73[2]!==undefined?_args73[2]:[];s={render:n,sp:[t],consumeCount:this.consumeCount};r&&((c=s.sp)==null||c.push({type:vt.None,isLockSentEventCursor:r}));t.subRect&&((l=s.render)==null||l.push({rect:ve(t.subRect),isClear:!0,clearCanvas:Ut.Float,viewId:this.viewId},{rect:ve(t.subRect),drawCanvas:Ut.Float,viewId:this.viewId}));t.rect&&((f=s.render)==null||f.push({rect:ve(t.rect),clearCanvas:Ut.Bg,isClear:!0,viewId:this.viewId},{rect:ve(t.rect),drawCanvas:Ut.Bg,viewId:this.viewId}));_context73.n=1;return this._post(s);case 1:return _context73.a(2);}},_callee70,this);}));function drawSelector(_x93,_x94){return _drawSelector3.apply(this,arguments);}return drawSelector;}()},{key:"drawEraserCombine",value:function(){var _drawEraserCombine2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee71(t){var n,s,c,l,r,f,u,v,h,_iterator69,_step69,_step69$value,_h8,y;return _regenerator().w(function(_context74){while(1)switch(_context74.n){case 0:r=(n=this.workShapes.get(t))==null?void 0:n.combineConsume({workerEngine:this});if(!r){_context74.n=1;break;}f=r.willDeleteNodes,u=r.willNewNodes,v={render:[],sp:[]};if(r!=null&&r.rect){h=ve(r.rect);(s=v.render)==null||s.push({rect:h,isClear:!0,clearCanvas:Ut.Bg,viewId:this.viewId},{rect:h,drawCanvas:Ut.Bg,viewId:this.viewId});}if(f!=null&&f.size&&((c=v.sp)==null||c.push({type:vt.RemoveNode,removeIds:_toConsumableArray(f),viewId:this.thread.viewId})),u!=null&&u.size){_iterator69=_createForOfIteratorHelper(u);try{for(_iterator69.s();!(_step69=_iterator69.n()).done;){_step69$value=_slicedToArray(_step69.value,2),_h8=_step69$value[0],y=_step69$value[1];(l=v.sp)==null||l.push({type:vt.FullWork,dataType:Kt.Local,toolsType:Tt.Pencil,ops:mr(y.op),opt:y.opt,workId:_h8,updateNodeOpt:{useAnimation:!1}});}}catch(err){_iterator69.e(err);}finally{_iterator69.f();}}_context74.n=1;return this._post(v);case 1:return _context74.a(2);}},_callee71,this);}));function drawEraserCombine(_x95){return _drawEraserCombine2.apply(this,arguments);}return drawEraserCombine;}()},{key:"consumeDraw",value:function(){var _consumeDraw4=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee72(t,r){var _this102=this;var n,s,c,l,f,u,v,h,y,_t63,_t64,_t65;return _regenerator().w(function(_context75){while(1)switch(_context75.n){case 0:n=t.op,s=t.workId,c=t.scenePath,l=t.postCount,f=t.smoothSync;if(!(n!=null&&n.length&&s)){_context75.n=15;break;}u=s.toString(),v=this.getWorkShape(u);if(v){_context75.n=1;break;}return _context75.a(2);case 1:h=v.toolsType;if(!(h===Tt.LaserPen)){_context75.n=2;break;}return _context75.a(2);case 2:_t63=this.drawWorkActiveId&&this.drawWorkActiveId!==u;if(!_t63){_context75.n=4;break;}_context75.n=3;return this.consumeDrawAll({workId:this.drawWorkActiveId,scenePath:c,viewId:this.viewId,msgType:vt.DrawWork,dataType:Kt.Local},r);case 3:this.drawWorkActiveId=void 0;case 4:!this.drawWorkActiveId&&u!==Me&&(this.drawWorkActiveId=u);_e(l)&&(this.consumeCount=l);y=v.consume({data:t,isSimpleWorker:!0,smoothSync:f});_t64=h;_context75.n=_t64===Tt.Selector?5:_t64===Tt.PencilEraser?7:_t64===Tt.BitMapEraser?7:_t64===Tt.Eraser?9:_t64===Tt.Arrow?11:_t64===Tt.Straight?11:_t64===Tt.Ellipse?11:_t64===Tt.Rectangle?11:_t64===Tt.Star?11:_t64===Tt.Polygon?11:_t64===Tt.SpeechBalloon?11:_t64===Tt.Pencil?13:15;break;case 5:this.drawCount++;y.type===vt.Select&&y.selectIds&&r.runReverseSelectWork(y.selectIds);_context75.n=6;return this.drawSelector(y);case 6:return _context75.a(3,15);case 7:this.drawCount++;this.combineTimerId||(this.combineTimerId=1,this.combineDrawActiveId=u,this.drawEraserCombine(u).then(function(){_this102.combineTimerId=void 0;}));_context75.n=8;return this._post({consumeCount:this.consumeCount});case 8:return _context75.a(3,15);case 9:_context75.n=10;return this.drawEraser(y);case 10:return _context75.a(3,15);case 11:_t65=y;if(!_t65){_context75.n=12;break;}this.drawCount++;_context75.n=12;return this.drawShape(y);case 12:return _context75.a(3,15);case 13:this.drawCount++;_context75.n=14;return this.drawPencil(y,u);case 14:return _context75.a(3,15);case 15:return _context75.a(2);}},_callee72,this);}));function consumeDraw(_x96,_x97){return _consumeDraw4.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee73(t,r){var l,f,u,n,s,c,v,h,y,T,O,I,P,_t66;return _regenerator().w(function(_context76){while(1)switch(_context76.n){case 0:this.combineTimerId&&(clearTimeout(this.combineTimerId),this.combineTimerId=void 0,this.combineDrawResolve&&this.combineDrawResolve(!1),this.combineDrawActiveId=void 0);n=t.workId,s=t.scenePath,c=t.isLockSentEventCursor;if(!n){_context76.n=10;break;}v=n.toString();this.drawWorkActiveId===v&&(this.drawWorkActiveId=void 0);h=this.workShapes.get(v);if(h){_context76.n=1;break;}return _context76.a(2);case 1:y=h.toolsType;if(!(y===Tt.LaserPen)){_context76.n=2;break;}return _context76.a(2);case 2:T=this.workShapes.get(hi),O=(l=T==null?void 0:T.selectIds)==null?void 0:l[0],I=h.consumeAll({data:t,workerEngine:this});_t66=y;_context76.n=_t66===Tt.Selector?3:_t66===Tt.PencilEraser?5:_t66===Tt.BitMapEraser?5:_t66===Tt.Eraser?7:_t66===Tt.Arrow?8:_t66===Tt.Straight?8:_t66===Tt.Ellipse?8:_t66===Tt.Rectangle?8:_t66===Tt.Star?8:_t66===Tt.Polygon?8:_t66===Tt.SpeechBalloon?8:_t66===Tt.Pencil?8:10;break;case 3:P=[];this.drawLayer&&(this.drawCount=0,Rr(this.drawLayer,this.drawLayer.parent),this.getWorkShape(v).clearSubTmpPoints(),P.push({isClearAll:!0,clearCanvas:Ut.Float,viewId:this.viewId}));I.selectIds&&O&&(f=I.selectIds)!=null&&f.includes(O)&&T.cursorBlur();I.selectIds&&r.runReverseSelectWork(I.selectIds);_context76.n=4;return this.drawSelector(_objectSpread(_objectSpread({},I),{},{scenePath:s}),c,P);case 4:(u=h.selectIds)!=null&&u.length?h.clearTmpPoints():this.clearWorkShapeNodeCache(v);return _context76.a(3,10);case 5:_context76.n=6;return this.drawEraserFull(h,_objectSpread(_objectSpread({},I),{},{scenePath:s}),c,t.needUndoTicker);case 6:this.drawCount=0;this.clearWorkShapeNodeCache(v);return _context76.a(3,10);case 7:this.drawEraser(_objectSpread(_objectSpread({},I),{},{scenePath:s}),c,t.needUndoTicker),h.clearTmpPoints();return _context76.a(3,10);case 8:_context76.n=9;return this.drawPencilFull(_objectSpread(_objectSpread({},I),{},{scenePath:s}),c,t.needUndoTicker);case 9:this.drawCount=0;this.clearWorkShapeNodeCache(v);return _context76.a(3,10);case 10:return _context76.a(2);}},_callee73,this);}));function consumeDrawAll(_x98,_x99){return _consumeDrawAll3.apply(this,arguments);}return consumeDrawAll;}()}]);}(id);var VM=/*#__PURE__*/function(_sd){function VM(t){var _this103;_classCallCheck(this,VM);_this103=_callSuper(this,VM,[t]);dt(_this103,"_type","simple");return _this103;}_inherits(VM,_sd);return _createClass(VM,[{key:"animationDraw",value:function(){var _animationDraw3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee74(){var _this104=this;var s,c,l,f,u,v,h,y,T,O,I,P,w,d,m,p,S,E,R,D,U,M,W,$,B,N,z,J,et,at,ct,V,Q,ft,mt,yt,At,ht,Nt,Bt,G,k,rt,t,r,n,_iterator70,_step70,_loop7,_t68,_t69;return _regenerator().w(function(_context78){while(1)switch(_context78.p=_context78.n){case 0:this.animationId=void 0;t=!1;r={render:[]},n=/* @__PURE__ */new Map();_iterator70=_createForOfIteratorHelper(this.workShapes.entries());_context78.p=1;_loop7=/*#__PURE__*/_regenerator().m(function _loop7(){var _step70$value,nt,Y,Z,C,_Z8,_C7,_Z9,_C8,_Z0,_C9,L,X,_Z1,_C0,_L3,_X4,K,q,it,_q2,_Z10,_C1,_L4,_X5,_t67;return _regenerator().w(function(_context77){while(1)switch(_context77.n){case 0:_step70$value=_slicedToArray(_step70.value,2),nt=_step70$value[0],Y=_step70$value[1];_t67=Y.toolsType;_context77.n=_t67===Tt.BackgroundSVG?1:_t67===Tt.Image?2:_t67===Tt.Text?4:_t67===Tt.Arrow?7:_t67===Tt.Straight?7:_t67===Tt.Rectangle?7:_t67===Tt.Ellipse?7:_t67===Tt.Star?7:_t67===Tt.Polygon?7:_t67===Tt.SpeechBalloon?7:_t67===Tt.Pencil?8:13;break;case 1:Z=Y.oldRect;Z&&((s=r.render)==null||s.push({rect:Z,isClear:!0,clearCanvas:Ut.Bg,viewId:_this104.viewId}),(c=r.render)==null||c.push({rect:Z,drawCanvas:Ut.Bg,viewId:_this104.viewId}));C=Y.node.consumeService({isFullWork:!0,replaceId:nt});_this104.selectorWorkShapes.forEach(function(L,X){var K;(K=L.selectIds)!=null&&K.includes(nt)&&(_this104.willRunEffectSelectorIds.add(X),_this104.noAnimationRect=Zt(_this104.noAnimationRect,Z),_this104.noAnimationRect=Zt(_this104.noAnimationRect,C),_this104.runEffect());}),_this104.workShapes["delete"](nt),(l=r.render)==null||l.push({rect:C,drawCanvas:Ut.Bg,viewId:_this104.viewId});return _context77.a(3,13);case 2:_Z8=Y.oldRect;_Z8&&((f=r.render)==null||f.push({rect:_Z8,isClear:!0,clearCanvas:Ut.Bg,viewId:_this104.viewId}),(u=r.render)==null||u.push({rect:_Z8,drawCanvas:Ut.Bg,viewId:_this104.viewId}));_context77.n=3;return(v=Y.node)==null?void 0:v.consumeServiceAsync({isFullWork:!0,worker:_this104.thread});case 3:_C7=_context77.v;_this104.selectorWorkShapes.forEach(function(L,X){var K;(K=L.selectIds)!=null&&K.includes(nt)&&(_this104.willRunEffectSelectorIds.add(X),_this104.noAnimationRect=Zt(_this104.noAnimationRect,_Z8),_this104.noAnimationRect=Zt(_this104.noAnimationRect,_C7),_this104.runEffect());}),_this104.workShapes["delete"](nt),(h=r.render)==null||h.push({rect:_C7,drawCanvas:Ut.Bg,viewId:_this104.viewId});return _context77.a(3,13);case 4:if(!Y.node){_context77.n=6;break;}_Z9=Y.oldRect;_Z9&&((y=r.render)==null||y.push({rect:_Z9,isClear:!0,clearCanvas:Ut.Bg,viewId:_this104.viewId}),(T=r.render)==null||T.push({rect:_Z9,drawCanvas:Ut.Bg,viewId:_this104.viewId}));_context77.n=5;return Y.node.consumeServiceAsync({isFullWork:!0,replaceId:nt,boxRect:_this104.thread.getSceneRect()});case 5:_C8=_context77.v;_this104.selectorWorkShapes.forEach(function(L,X){var K;(K=L.selectIds)!=null&&K.includes(nt)&&(_this104.willRunEffectSelectorIds.add(X),_this104.noAnimationRect=Zt(_this104.noAnimationRect,_Z9),_this104.noAnimationRect=Zt(_this104.noAnimationRect,_C8),_this104.runEffect());}),(O=Y.node)==null||O.clearTmpPoints(),_this104.workShapes["delete"](nt),(I=r.render)==null||I.push({rect:_C8,drawCanvas:Ut.Bg,viewId:_this104.viewId});case 6:return _context77.a(3,13);case 7:_Z0=!!Y.ops;if((P=Y.animationWorkData)!=null&&P.length){_C9=Y.oldRect,L=Y.node.oldRect;_C9&&((w=r.render)==null||w.push({rect:_C9,isClear:!0,clearCanvas:Ut.Bg,viewId:_this104.viewId}),(d=r.render)==null||d.push({rect:_C9,drawCanvas:Ut.Bg,viewId:_this104.viewId})),L&&((m=r.render)==null||m.push({rect:L,isClear:!0,clearCanvas:Ut.ServiceFloat,viewId:_this104.viewId}));X=(p=Y.node)==null?void 0:p.consumeService({op:Y.animationWorkData,isFullWork:_Z0});Y.isEnableCursor?n.set(nt,{workState:_C9?Y.ops?te.Done:te.Doing:te.Start,op:Y.animationWorkData.slice(-3,-1)}):_Z0&&!Y.useAnimation&&(S=Y.updateNodeOpt)!=null&&S.useAnimation&&n.set(nt,{workState:te.Done,op:Y.animationWorkData.slice(-3,-1),uid:(E=Y.updateNodeOpt)==null?void 0:E.uid}),_Z0?(_this104.selectorWorkShapes.forEach(function(K,q){var it;(it=K.selectIds)!=null&&it.includes(nt)&&(_this104.willRunEffectSelectorIds.add(q),_this104.noAnimationRect=Zt(_this104.noAnimationRect,_C9),_this104.noAnimationRect=Zt(_this104.noAnimationRect,L),_this104.noAnimationRect=Zt(_this104.noAnimationRect,X),_this104.runEffect());}),(R=Y.node)==null||R.clearTmpPoints(),_this104.workShapes["delete"](nt),(D=r.render)==null||D.push({rect:X,drawCanvas:Ut.Bg,viewId:_this104.viewId})):(U=r.render)==null||U.push({rect:X,drawCanvas:Ut.ServiceFloat,workerType:_Z0?void 0:Kt.Service,viewId:_this104.viewId}),Y.animationWorkData.length=0;}return _context77.a(3,13);case 8:if(!Y.useAnimation){_context77.n=11;break;}if(!Y.useAnimation){_context77.n=10;break;}if(!Y.isDel){_context77.n=9;break;}(ft=Y.node)==null||ft.clearTmpPoints(),_this104.workShapes["delete"](nt);return _context77.a(3,13);case 9:_Z1=3,_C0=_this104.computNextAnimationIndex(Y,_Z1),_L3=Y.isDiff?0:Math.max(0,(Y.animationIndex||0)-_Z1),_X4=(Y.animationWorkData||[]).slice(0,_C0),K=(yt=(mt=Y.node)==null?void 0:mt.getWorkId())==null?void 0:yt.toString();if((Y.animationIndex||0)<_C0||Y.isDiff){q=(At=Y.node)==null?void 0:At.consumeService({op:_X4,isFullWork:!1,replaceId:K});if((ht=r.render)==null||ht.push({isClear:!0,rect:q,clearCanvas:Ut.ServiceFloat,viewId:_this104.viewId}),(Nt=r.render)==null||Nt.push({rect:q,drawCanvas:Ut.ServiceFloat,viewId:_this104.viewId}),Y.animationIndex=_C0,Y.isDiff&&(Y.isDiff=!1),_X4.length&&Y.isEnableCursor){it=_X4.slice(-3,-1);n.set(nt,{workState:_L3===0?te.Start:_C0===((Bt=Y.animationWorkData)==null?void 0:Bt.length)?te.Done:te.Doing,op:it});}}else if(Y.ops){_q2=(G=Y.node)==null?void 0:G.consumeService({op:Y.animationWorkData||[],isFullWork:!0,replaceId:K});Y.isDel=!0,(k=r.render)==null||k.push({isClear:!0,rect:_q2,clearCanvas:Ut.ServiceFloat,viewId:_this104.viewId},{rect:_q2,drawCanvas:Ut.ServiceFloat,viewId:_this104.viewId},{isClear:!0,rect:_q2,clearCanvas:Ut.Bg,viewId:_this104.viewId},{rect:_q2,drawCanvas:Ut.Bg,viewId:_this104.viewId}),Y.isEnableCursor&&n.set(nt,{workState:te.Done,op:_X4.slice(-3,-1)});}t=!0;return _context77.a(3,13);case 10:_context77.n=12;break;case 11:_Z10=!!Y.ops;_C1=(M=Y.node)==null?void 0:M.consumeService({op:Y.animationWorkData||[],isFullWork:_Z10,replaceId:nt});_L4=(W=Y.node)==null?void 0:W.updataOptService(Y.updateNodeOpt);if(_Z10){if(_C1=Zt(_C1,_L4),($=r.render)==null||$.push({isClear:!0,rect:Zt(Y.oldRect,_C1),clearCanvas:Ut.Bg,viewId:_this104.viewId}),(B=r.render)==null||B.push({rect:Zt(Y.oldRect,_C1),drawCanvas:Ut.Bg,viewId:_this104.viewId}),(N=Y.updateNodeOpt)!=null&&N.useAnimation&&((z=r.render)==null||z.push({isClear:!0,rect:Zt(Y.oldRect,_C1),clearCanvas:Ut.ServiceFloat,viewId:_this104.viewId}),(J=r.render)==null||J.push({rect:Zt(Y.oldRect,_C1),drawCanvas:Ut.ServiceFloat,viewId:_this104.viewId}),!Y.isEnableCursor&&(et=Y.animationWorkData)!=null&&et.length)){_X5=Y.animationWorkData.slice(-3,-1);n.set(nt,{workState:te.Done,op:_X5,uid:(at=Y.updateNodeOpt)==null?void 0:at.uid});}_this104.selectorWorkShapes.forEach(function(X,K){var q;(q=X.selectIds)!=null&&q.includes(nt)&&(_this104.willRunEffectSelectorIds.add(K),_this104.noAnimationRect=Zt(_this104.noAnimationRect,_C1),_this104.runEffect());}),(ct=Y.node)==null||ct.clearTmpPoints(),_this104.workShapes["delete"](nt);}else _C1=Zt(_C1,_L4),(V=r.render)==null||V.push({isClear:!0,rect:Zt(Y.oldRect,_C1),clearCanvas:Ut.ServiceFloat,viewId:_this104.viewId}),(Q=r.render)==null||Q.push({rect:Zt(Y.oldRect,_C1),drawCanvas:Ut.ServiceFloat,viewId:_this104.viewId});case 12:return _context77.a(3,13);case 13:return _context77.a(2);}},_loop7);});_iterator70.s();case 2:if((_step70=_iterator70.n()).done){_context78.n=4;break;}return _context78.d(_regeneratorValues(_loop7()),3);case 3:_context78.n=2;break;case 4:_context78.n=6;break;case 5:_context78.p=5;_t68=_context78.v;_iterator70.e(_t68);case 6:_context78.p=6;_iterator70.f();return _context78.f(6);case 7:t&&this.runAnimation();n.size&&(r.sp=[],n.forEach(function(nt,Y){var Z;(Z=r.sp)==null||Z.push({type:vt.Cursor,uid:nt.uid||Y.split(gi)[0],op:nt.op,workState:nt.workState,viewId:_this104.viewId});}));_t69=(rt=r.render)!=null&&rt.length;if(!_t69){_context78.n=8;break;}_context78.n=8;return this.post(r);case 8:return _context78.a(2);}},_callee74,this,[[1,5,6,7]]);}));function animationDraw(){return _animationDraw3.apply(this,arguments);}return animationDraw;}()}]);}(sd);var od=/*#__PURE__*/function(_Nl3){function od(t){var _this105;_classCallCheck(this,od);_this105=_callSuper(this,od,[t]);dt(_this105,"opt");dt(_this105,"scene");dt(_this105,"cameraOpt");dt(_this105,"vNodes");_this105.opt=t,_this105.vNodes=void 0;return _this105;}_inherits(od,_Nl3);return _createClass(od,[{key:"createSnapshotFullLayer",value:function createSnapshotFullLayer(t,r){this.scene=this.opt.createScene(t),this.fullLayer=this.opt.createLayer("snapshotFullLayer",this.scene,r);}},{key:"destroySnapshotFullLayer",value:function destroySnapshotFullLayer(){var t,r,n;Rr(this.fullLayer,this.fullLayer.parent),(t=this.fullLayer)==null||t.disconnect(),(r=this.fullLayer)==null||r.remove(),(n=this.scene)==null||n.remove(),this.scene=void 0;}},{key:"updateScene",value:function updateScene(t){if(!this.scene)throw new Error("SnapshotWork scene is not initialized");this.scene.attr(_objectSpread({},t));var r=t.width,n=t.height;this.scene.width=r,this.scene.height=n,this.updateLayer({width:r,height:n});}},{key:"updateLayer",value:function updateLayer(t){if(!this.fullLayer)throw new Error("SnapshotWork snapshotFullLayer is not initialized");var r=t.width,n=t.height;this.fullLayer.parent.setAttribute("width",r),this.fullLayer.parent.setAttribute("height",n),this.fullLayer.setAttribute("size",[r,n]),this.fullLayer.setAttribute("pos",[r*0.5,n*0.5]);}},{key:"setCameraOpt",value:function setCameraOpt(t){this.cameraOpt=t;var r=t.scale,n=t.centerX,s=t.centerY,c=t.width,l=t.height;if(!this.scene)throw new Error("SnapshotWork scene is not initialized");if(!this.fullLayer)throw new Error("SnapshotWork snapshotFullLayer is not initialized");(c!==this.scene.width||l!==this.scene.height)&&this.updateScene({width:c,height:l}),this.fullLayer.setAttribute("scale",[r,r]),this.fullLayer.setAttribute("translate",[-n,-s]);}},{key:"getOffscreen",value:function getOffscreen(){var r;return((r=this.fullLayer)==null?void 0:r.parent).canvas;}},{key:"getRectImageBitmap",value:function getRectImageBitmap(t,r){var n=t.rect,s=this.thread.dpr,c=Math.floor(n.x*s),l=Math.floor(n.y*s),f=Math.floor(n.w*s),u=Math.floor(n.h*s);return createImageBitmap(this.getOffscreen(),c,l,f,u,r);}},{key:"getSnapshot",value:function(){var _getSnapshot=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee75(t){var r,n,s,c,l,_i4,_Object$entries,_Object$entries$_i,u,v,h,y,f,_v13,_t70,_t71;return _regenerator().w(function(_context79){while(1)switch(_context79.p=_context79.n){case 0:r=t.scenePath,n=t.scenes,s=t.cameraOpt,c=t.w,l=t.h;if(!(r&&n&&s&&this.fullLayer)){_context79.n=9;break;}this.setCameraOpt(s);_i4=0,_Object$entries=Object.entries(n);case 1:if(!(_i4<_Object$entries.length)){_context79.n=5;break;}_Object$entries$_i=_slicedToArray(_Object$entries[_i4],2),u=_Object$entries$_i[0],v=_Object$entries$_i[1];if(!(v!=null&&v.type)){_context79.n=4;break;}_t70=v==null?void 0:v.type;_context79.n=_t70===vt.UpdateNode?2:_t70===vt.FullWork?2:4;break;case 2:h=v.opt,y=_objectSpread(_objectSpread({},v),{},{opt:h,workId:u,msgType:vt.FullWork,dataType:Kt.Service,viewId:this.viewId});_context79.n=3;return this.runFullWork(y);case 3:return _context79.a(3,4);case 4:_i4++;_context79.n=1;break;case 5:c&&l&&(f={resizeWidth:c,resizeHeight:l});_context79.p=6;_context79.n=7;return this.getSnapshotRender({scenePath:r,options:f});case 7:_context79.n=9;break;case 8:_context79.p=8;_t71=_context79.v;_v13=_t71&&_t71 instanceof Error?_t71.message:_t71==null?void 0:_t71.toString();console.error("[SnapshotWork] getSnapshotRender error",_v13),this.thread._post({sp:[{type:vt.ReportError,reportString:"[SnapshotWork] getSnapshotRender error: ".concat(_v13)}]});case 9:return _context79.a(2);}},_callee75,this,[[6,8]]);}));function getSnapshot(_x100){return _getSnapshot.apply(this,arguments);}return getSnapshot;}()},{key:"runFullWork",value:function(){var _runFullWork=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee76(t){var s,r,n,c,l,f;return _regenerator().w(function(_context80){while(1)switch(_context80.n){case 0:r=this.setFullWork(t),n=t.ops&&mi(t.ops);if(!r){_context80.n=7;break;}f=(s=r.getWorkId())==null?void 0:s.toString();if(!(r.toolsType===Tt.BackgroundSVG)){_context80.n=1;break;}c=r.consumeService({isFullWork:!0,replaceId:f});_context80.n=6;break;case 1:if(!(r.toolsType===Tt.Image)){_context80.n=3;break;}_context80.n=2;return r.consumeServiceAsync({isFullWork:!0,worker:this.thread});case 2:c=_context80.v;_context80.n=6;break;case 3:if(!(r.toolsType===Tt.Text)){_context80.n=5;break;}_context80.n=4;return r.consumeServiceAsync({isFullWork:!0,replaceId:f,isDrawLabel:!0});case 4:c=_context80.v;_context80.n=6;break;case 5:c=r.consumeService({op:n,isFullWork:!0,replaceId:f}),l=(t==null?void 0:t.updateNodeOpt)&&r.updataOptService(t.updateNodeOpt);case 6:t.workId&&this.workShapes["delete"](t.workId.toString());return _context80.a(2,Zt(c,l));case 7:return _context80.a(2);}},_callee76,this);}));function runFullWork(_x101){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,t=_this$scene2.width,r=_this$scene2.height;return{x:0,y:0,w:Math.floor(t),h:Math.floor(r)};}},{key:"getSnapshotRender",value:function(){var _getSnapshotRender=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee77(t){var c,r,n,s;return _regenerator().w(function(_context81){while(1)switch(_context81.n){case 0:r=t.scenePath,n=t.options;((c=this.fullLayer)==null?void 0:c.parent).render();_context81.n=1;return this.getRectImageBitmap({rect:this.getSceneRect(),drawCanvas:Ut.None},n);case 1:s=_context81.v;s&&(this.thread._post({sp:[{type:vt.Snapshot,scenePath:r,imageBitmap:s,viewId:this.viewId,index:0}]},[s]),s.close());case 2:return _context81.a(2);}},_callee77,this);}));function getSnapshotRender(_x102){return _getSnapshotRender.apply(this,arguments);}return getSnapshotRender;}()},{key:"getBoundingRect",value:function(){var _getBoundingRect=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee78(t){var r,n,s,c,_i5,_Object$entries2,_Object$entries2$_i,l,f,u,_t72;return _regenerator().w(function(_context82){while(1)switch(_context82.n){case 0:r=t.scenePath,n=t.scenes,s=t.cameraOpt;if(!(r&&n&&s&&this.fullLayer)){_context82.n=6;break;}this.setCameraOpt(s);_i5=0,_Object$entries2=Object.entries(n);case 1:if(!(_i5<_Object$entries2.length)){_context82.n=5;break;}_Object$entries2$_i=_slicedToArray(_Object$entries2[_i5],2),l=_Object$entries2$_i[0],f=_Object$entries2$_i[1];if(!(f!=null&&f.type)){_context82.n=4;break;}_t72=f==null?void 0:f.type;_context82.n=_t72===vt.UpdateNode?2:_t72===vt.FullWork?2:4;break;case 2:_context82.n=3;return this.runFullWork(_objectSpread(_objectSpread({},f),{},{workId:l,msgType:vt.FullWork,dataType:Kt.Service,viewId:this.viewId}));case 3:u=_context82.v;c=Zt(c,u);return _context82.a(3,4);case 4:_i5++;_context82.n=1;break;case 5:c&&this.thread._post({sp:[{type:vt.BoundingBox,scenePath:r,rect:c,viewId:this.viewId}]});case 6:return _context82.a(2);}},_callee78,this);}));function getBoundingRect(_x103){return _getBoundingRect.apply(this,arguments);}return getBoundingRect;}()}]);}(Nl);var co=/* @__PURE__ */function(i){return i.Full="full",i.Sub="sub",i;}(co||{});var KM=/*#__PURE__*/function(){function KM(e,t){var _this106=this;_classCallCheck(this,KM);dt(this,"_self");dt(this,"version",yh);dt(this,"type");// protected hasPriorityDraw: boolean = true;
|
|
484
|
+
dt(this,"workThreadMap",/* @__PURE__ */new Map());dt(this,"post",function(e,t){t?_this106._self.postMessage(e,t):_this106._self.postMessage(e);});this._self=e,this.type=t,this.register();}return _createClass(KM,[{key:"init",value:function init(e){var t=e.viewId,r=e.dpr,n=e.offscreenCanvasOpt,s=e.layerOpt,c=e.isSafari,l=e.combineUnitTime,f=e.syncUnitTime,u=e.maxCombineEraserTime,v=e.offscreenCanvas,h=e.isUseSimple;if(!r||!n||!s)return;var y;this.type==="full"&&(h?y=new ZM(t,{dpr:r,offscreenCanvasOpt:n,layerOpt:s,combineUnitTime:l,syncUnitTime:f,maxCombineEraserTime:u,offscreenCanvas:v},this.post):y=new ld(t,{dpr:r,offscreenCanvasOpt:n,layerOpt:s,combineUnitTime:l,syncUnitTime:f,maxCombineEraserTime:u},this.post)),this.type==="sub"&&!h&&(y=new ad(t,{dpr:r,offscreenCanvasOpt:n,layerOpt:s,isUseSimple:h},this.post)),y&&c&&y.setIsSafari(c),y&&e.cameraOpt&&y.setCameraOpt(e.cameraOpt);var T=this.workThreadMap.get(t);T==null||T.destroy(),y&&this.workThreadMap.set(t,y);}},{key:"setFontFaces",value:function(){var _setFontFaces=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee79(e){var _this107=this;var t,r,_iterator71,_step71,_loop8,_t76;return _regenerator().w(function(_context84){while(1)switch(_context84.p=_context84.n){case 0:t=[],r=[];_iterator71=_createForOfIteratorHelper(e);_context84.p=1;_loop8=/*#__PURE__*/_regenerator().m(function _loop8(){var n,s,c,l,f,u,v,h,y,_t73,_t74,_t75;return _regenerator().w(function(_context83){while(1)switch(_context83.p=_context83.n){case 0:n=_step71.value;s=n.fontFamily,c=n.buffer;_context83.p=1;if(!(!c||c.byteLength===0)){_context83.n=2;break;}throw new Error("Invalid font data for ".concat(s,": empty buffer"));case 2:try{l=new FontFace(s,c);}catch(_unused27){f=new Uint8Array(c);l=new FontFace(s,f);}_context83.n=3;return _this107._self.fonts.add(l);case 3:_context83.p=3;_context83.n=4;return l.loaded;case 4:t.push(s);_context83.n=17;break;case 5:_context83.p=5;_t73=_context83.v;u=_this107._self.fonts;if(!(u&&typeof u.load=="function")){_context83.n=14;break;}_context83.p=6;v=u.load(s);h=new Promise(function(T,O){return setTimeout(function(){return O(new Error("Font load timeout for ".concat(s)));},5e3);});_context83.n=7;return Promise.race([v,h]);case 7:y=_context83.v;if(!(y&&y.length>0)){_context83.n=8;break;}t.push(s);_context83.n=9;break;case 8:throw new Error("Font ".concat(s," load returned empty result"));case 9:_context83.n=13;break;case 10:_context83.p=10;_t74=_context83.v;_context83.n=11;return _this107.isFontAvailable(s);case 11:if(!_context83.v){_context83.n=12;break;}t.push(s);_context83.n=13;break;case 12:throw _t74;case 13:_context83.n=17;break;case 14:_context83.n=15;return _this107.isFontAvailable(s);case 15:if(!_context83.v){_context83.n=16;break;}t.push(s);_context83.n=17;break;case 16:throw _t73;case 17:_context83.n=19;break;case 18:_context83.p=18;_t75=_context83.v;console.error("Font ".concat(s," load error: ").concat(_t75)),r.push(s);case 19:return _context83.a(2);}},_loop8,null,[[6,10],[3,5],[1,18]]);});_iterator71.s();case 2:if((_step71=_iterator71.n()).done){_context84.n=4;break;}return _context84.d(_regeneratorValues(_loop8()),3);case 3:_context84.n=2;break;case 4:_context84.n=6;break;case 5:_context84.p=5;_t76=_context84.v;_iterator71.e(_t76);case 6:_context84.p=6;_iterator71.f();return _context84.f(6);case 7:this.post({sp:[{type:vt.SetFontFace,setFontFaceResult:!0,failedFonts:r.length>0?r:void 0}]});case 8:return _context84.a(2);}},_callee79,this,[[1,5,6,7]]);}));function setFontFaces(_x104){return _setFontFaces.apply(this,arguments);}return setFontFaces;}()// 检查字体是否可用
|
|
485
|
+
},{key:"isFontAvailable",value:function(){var _isFontAvailable=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee80(e){var t,r,n,_iterator72,_step72,_s3,s,_t77,_t78,_t79,_t80;return _regenerator().w(function(_context85){while(1)switch(_context85.p=_context85.n){case 0:_context85.p=0;t=this._self.fonts;if(t){_context85.n=1;break;}return _context85.a(2,!1);case 1:r=!1,n=null;_iterator72=_createForOfIteratorHelper(t);_context85.p=2;_iterator72.s();case 3:if((_step72=_iterator72.n()).done){_context85.n=5;break;}_s3=_step72.value;if(!(_s3.family===e)){_context85.n=4;break;}r=!0,n=_s3;return _context85.a(3,5);case 4:_context85.n=3;break;case 5:_context85.n=7;break;case 6:_context85.p=6;_t77=_context85.v;_iterator72.e(_t77);case 7:_context85.p=7;_iterator72.f();return _context85.f(7);case 8:if(!(!r||!n)){_context85.n=9;break;}return _context85.a(2,!1);case 9:if(!(n.status==="loaded")){_context85.n=10;break;}return _context85.a(2,!0);case 10:_context85.p=10;_context85.n=11;return n.loaded;case 11:return _context85.a(2,!0);case 12:_context85.p=12;_t78=_context85.v;if(!(t&&typeof t.load=="function")){_context85.n=16;break;}_context85.p=13;_context85.n=14;return t.load(e);case 14:s=_context85.v;return _context85.a(2,s&&s.length>0);case 15:_context85.p=15;_t79=_context85.v;return _context85.a(2,!1);case 16:return _context85.a(2,!0);case 17:_context85.n=19;break;case 18:_context85.p=18;_t80=_context85.v;return _context85.a(2,!1);case 19:return _context85.a(2);}},_callee80,this,[[13,15],[10,12],[2,6,7,8],[0,18]]);}));function isFontAvailable(_x105){return _isFontAvailable.apply(this,arguments);}return isFontAvailable;}()},{key:"register",value:function register(){var _this108=this;onmessage=/*#__PURE__*/function(){var _ref169=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee81(e){var t,_iteratorAbruptCompletion,_didIteratorError,_iteratorError,_iterator,_step,r,n,s,c,l,f,_iterator73,_step73,_step73$value,v,h,y,_iterator74,_step74,_v14,u,_t81,_t82,_t83;return _regenerator().w(function(_context86){while(1)switch(_context86.p=_context86.n){case 0:t=e.data;if(!t){_context86.n=25;break;}_iteratorAbruptCompletion=false;_didIteratorError=false;_context86.p=1;_iterator=_asyncIterator(t.values());case 2:_context86.n=3;return _iterator.next();case 3:if(!(_iteratorAbruptCompletion=!(_step=_context86.v).done)){_context86.n=18;break;}r=_step.value;n=r.msgType,s=r.viewId,c=r.tasksqueue,l=r.mainTasksqueueCount,f=r.fontBuffers;if(!f){_context86.n=4;break;}_this108.setFontFaces(f);return _context86.a(3,17);case 4:if(!(n===vt.Console)){_context86.n=5;break;}console.log(_this108);return _context86.a(3,17);case 5:if(!(n===vt.Init)){_context86.n=6;break;}_this108.init(r);return _context86.a(3,17);case 6:if(!(n===vt.TasksQueue&&c!=null&&c.size)){_context86.n=7;break;}_iterator73=_createForOfIteratorHelper(_this108.workThreadMap.entries());try{for(_iterator73.s();!(_step73=_iterator73.n()).done;){_step73$value=_slicedToArray(_step73.value,2),v=_step73$value[0],h=_step73$value[1];y=c.get(v);y&&h.on(y);}}catch(err){_iterator73.e(err);}finally{_iterator73.f();}_this108.type==="full"&&_e(l)&&_this108.post({workerTasksqueueCount:l});return _context86.a(3,17);case 7:if(!(s===i1)){_context86.n=15;break;}_iterator74=_createForOfIteratorHelper(_this108.workThreadMap.values());_context86.p=8;_iterator74.s();case 9:if((_step74=_iterator74.n()).done){_context86.n=11;break;}_v14=_step74.value;_context86.n=10;return _v14.on(r);case 10:_context86.n=9;break;case 11:_context86.n=13;break;case 12:_context86.p=12;_t81=_context86.v;_iterator74.e(_t81);case 13:_context86.p=13;_iterator74.f();return _context86.f(13);case 14:n===vt.Destroy&&_this108.workThreadMap.clear();return _context86.a(3,17);case 15:u=_this108.workThreadMap.get(s);_t82=u;if(!_t82){_context86.n=17;break;}_context86.n=16;return u.on(r);case 16:n===vt.Destroy&&_this108.workThreadMap["delete"](s);case 17:_iteratorAbruptCompletion=false;_context86.n=2;break;case 18:_context86.n=20;break;case 19:_context86.p=19;_t83=_context86.v;_didIteratorError=true;_iteratorError=_t83;case 20:_context86.p=20;_context86.p=21;if(!(_iteratorAbruptCompletion&&_iterator["return"]!=null)){_context86.n=22;break;}_context86.n=22;return _iterator["return"]();case 22:_context86.p=22;if(!_didIteratorError){_context86.n=23;break;}throw _iteratorError;case 23:return _context86.f(22);case 24:return _context86.f(20);case 25:return _context86.a(2);}},_callee81,null,[[21,,22,24],[8,12,13,14],[1,19,20,25]]);}));return function onmessage(_x106){return _ref169.apply(this,arguments);};}();}}]);}();var ad=/*#__PURE__*/function(_h9){function ad(t,r,n){var _this109;_classCallCheck(this,ad);_this109=_callSuper(this,ad,[t,r,"sub"/* Sub */]);dt(_this109,"type","sub");dt(_this109,"_post");dt(_this109,"topLayer");dt(_this109,"serviceWork");dt(_this109,"localWork");dt(_this109,"topLayerWork");dt(_this109,"snapshotWork");_this109._post=n;var s=gr.bufferSize.sub;_this109.topLayer=r.isUseSimple?void 0:_this109.createLayer("topLayer",_this109.scene,_objectSpread(_objectSpread({},r.layerOpt),{},{bufferSize:s,contextType:"2d"}));var c={thread:_this109,viewId:_this109.viewId,vNodes:_this109.vNodes,fullLayer:_this109.fullLayer,topLayer:_this109.topLayer,isUseSimple:r.isUseSimple};_this109.localWork=new GM(c),r.isUseSimple||(_this109.topLayerWork=new kM(c)),_this109.snapshotWork=new od(_objectSpread(_objectSpread({},c),{},{createScene:_this109.createScene.bind(_this109),createLayer:_this109.createLayer.bind(_this109)})),_this109.vNodes.init(_this109.fullLayer);return _this109;}_inherits(ad,_h9);return _createClass(ad,[{key:"combinePost",value:function(){var _combinePost=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee82(){var _this110=this;var c,l,_this$combinePostData,t,r,n,f,_iterator75,_step75,u,v,s,_t84;return _regenerator().w(function(_context87){while(1)switch(_context87.p=_context87.n){case 0:_this$combinePostData=this.combinePostData(),t=_this$combinePostData.render,r=_objectWithoutProperties(_this$combinePostData,_excluded3);if(!(t!=null&&t.length)){_context87.n=11;break;}f=[];_iterator75=_createForOfIteratorHelper(t);_context87.p=1;_iterator75.s();case 2:if((_step75=_iterator75.n()).done){_context87.n=7;break;}u=_step75.value;if(!u.rect){_context87.n=6;break;}if(!(u.rect=qh(fr(u.rect),this.scene,this.dpr),!u.rect)){_context87.n=3;break;}return _context87.a(3,6);case 3:if(!(u.drawCanvas&&u.rect&&u.rect.w>0&&u.rect.h>0)){_context87.n=5;break;}_context87.n=4;return this.getRectImageBitmap(u);case 4:v=_context87.v;u.imageBitmap=v,n||(n=[]),n.push(v);case 5:f.push(u);case 6:_context87.n=2;break;case 7:_context87.n=9;break;case 8:_context87.p=8;_t84=_context87.v;_iterator75.e(_t84);case 9:_context87.p=9;_iterator75.f();return _context87.f(9);case 10:r.render=f;case 11:s=(c=r.sp)==null?void 0:c.filter(function(f){return f.type!==vt.None||f.isLockSentEventCursor||f.needUndoTicker;});s!=null&&s.length?r.sp=s.map(function(f){return _objectSpread(_objectSpread({},f),{},{viewId:_this110.viewId});}):delete r.sp,r.consumeCount===void 0&&delete r.consumeCount,r.subWorkerDrawCount===void 0&&delete r.subWorkerDrawCount,(s!=null&&s.length||r.consumeCount||r.subWorkerDrawCount||(l=r==null?void 0:r.render)!=null&&l.length)&&this._post(r,n),this.delayPostDoneResolve&&this.delayPostDoneResolve(!0);case 12:return _context87.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(t){var u,v,r,n,s,c,l,f,h,_t85,_t86;return _regenerator().w(function(_context88){while(1)switch(_context88.n){case 0:r=t.msgType,n=t.toolsType,s=t.opt,c=t.dataType,l=t.workState,f=t.isLockSentEventCursor;_t85=r;_context88.n=_t85===vt.UpdateTools?1:_t85===vt.CreateWork?3:_t85===vt.DrawWork?4:_t85===vt.RemoveNode?8:_t85===vt.FullWork?10:_t85===vt.Snapshot?14:_t85===vt.BoundingBox?16:18;break;case 1:if(!(n&&(u=this.topLayerWork)!=null&&u.canUseTopLayer(n)&&s)){_context88.n=2;break;}h={toolsType:n,toolsOpt:s};this.topLayerWork.setToolsOpt(h);return _context88.a(2);case 2:return _context88.a(3,18);case 3:this.createLocalWork(t);return _context88.a(2);case 4:if(!(l===te.Done&&c===Kt.Local)){_context88.n=6;break;}_context88.n=5;return this.consumeDrawAll(c,t);case 5:n===Tt.LaserPen&&f&&this.post({sp:[{type:vt.None,isLockSentEventCursor:f}]});_context88.n=7;break;case 6:this.consumeDraw(c,t);case 7:return _context88.a(2);case 8:_context88.n=9;return this.removeNode(t);case 9:return _context88.a(2);case 10:if(!(n&&(v=this.topLayerWork)!=null&&v.canUseTopLayer(n))){_context88.n=12;break;}_context88.n=11;return this.consumeDrawAll(c,t);case 11:_context88.n=13;break;case 12:_t86=c===Kt.Local&&t.clearPreviewLocalWork&&t.workId;if(!_t86){_context88.n=13;break;}_context88.n=13;return this.localWork.consumeDrawAll(_objectSpread(_objectSpread({},t),{},{msgType:vt.DrawWork,workState:te.Done}));case 13:return _context88.a(2);case 14:this.snapshotWork.createSnapshotFullLayer(this.opt,_objectSpread(_objectSpread({},this.opt.layerOpt),{},{bufferSize:this.viewId===jn?6e3:3e3,contextType:"2d"}));_context88.n=15;return this.snapshotWork.getSnapshot(t);case 15:this.snapshotWork.destroySnapshotFullLayer();return _context88.a(2);case 16:this.snapshotWork.createSnapshotFullLayer(this.opt,_objectSpread(_objectSpread({},this.opt.layerOpt),{},{bufferSize:this.viewId===jn?6e3:3e3,contextType:"2d"}));_context88.n=17;return this.snapshotWork.getBoundingRect(t);case 17:this.snapshotWork.destroySnapshotFullLayer();return _context88.a(2);case 18:_context88.n=19;return _superPropGet(ad,"on",this,3)([t]);case 19:return _context88.a(2);}},_callee83,this);}));function on(_x107){return _on2.apply(this,arguments);}return on;}()},{key:"createLocalWork",value:function createLocalWork(t){var c;var r=t.workId,n=t.toolsType,s=t.opt;if(n&&(c=this.topLayerWork)!=null&&c.canUseTopLayer(n)&&r&&s){this.topLayerWork.getToolsOpt()||this.topLayerWork.setToolsOpt({toolsType:n,toolsOpt:s}),this.topLayerWork.setWorkOptions(r.toString(),s);return;}n&&_superPropGet(ad,"createLocalWork",this,3)([t]);}},{key:"removeNode",value:function(){var _removeNode2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee84(t){var r,_t87;return _regenerator().w(function(_context89){while(1)switch(_context89.n){case 0:r=t.dataType;_t87=r===Kt.Local;if(!_t87){_context89.n=1;break;}_context89.n=1;return this.localWork.removeWork(t);case 1:return _context89.a(2);}},_callee84,this);}));function removeNode(_x108){return _removeNode2.apply(this,arguments);}return removeNode;}()},{key:"getLayer",value:function getLayer(t){switch(t){case Ut.TopFloat:return this.topLayer||this.fullLayer;default:return this.fullLayer;}}},{key:"getOffscreen",value:function getOffscreen(t){var n;return((n=this.getLayer(t))==null?void 0:n.parent).canvas;}},{key:"consumeDraw",value:function(){var _consumeDraw5=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee85(t,r){var c,n,s,_t88;return _regenerator().w(function(_context90){while(1)switch(_context90.n){case 0:n=r.workId,s=r.toolsType;if(!n){_context90.n=3;break;}if(!(s&&(c=this.topLayerWork)!=null&&c.canUseTopLayer(s))){_context90.n=1;break;}t===Kt.Local&&(this.topLayerWork.getWorkShape(n.toString())||this.createLocalWork(r)),this.topLayerWork.consumeDraw(r);return _context90.a(2);case 1:_t88=s;if(!_t88){_context90.n=2;break;}this.localWork.getWorkShape(n.toString())||this.createLocalWork(r);_context90.n=2;return this.localWork.consumeDraw(r);case 2:return _context90.a(2);case 3:return _context90.a(2);}},_callee85,this);}));function consumeDraw(_x109,_x110){return _consumeDraw5.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll4=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee86(t,r){var l,n,s,c,f;return _regenerator().w(function(_context91){while(1)switch(_context91.n){case 0:n=r.workId,s=r.toolsType,c=r.dataType;if(!n){_context91.n=2;break;}f=n.toString();if(!(s&&(l=this.topLayerWork)!=null&&l.canUseTopLayer(s))){_context91.n=1;break;}c===Kt.Local&&(this.topLayerWork.getWorkShape(f)||this.createLocalWork(r)),this.topLayerWork.consumeDrawAll(r);return _context91.a(2);case 1:s&&(this.localWork.getWorkShape(f)||_superPropGet(ad,"createLocalWork",this,3)([r]),this.localWork.consumeDrawAll(r));return _context91.a(2);case 2:return _context91.a(2);}},_callee86,this);}));function consumeDrawAll(_x111,_x112){return _consumeDrawAll4.apply(this,arguments);}return consumeDrawAll;}()},{key:"clearAll",value:function(){var _clearAll2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee87(){return _regenerator().w(function(_context92){while(1)switch(_context92.n){case 0:this.vNodes.clear();_superPropGet(ad,"clearAll",this,3)([]);this.topLayer&&(this.topLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),Rr(this.topLayer,this.topLayer.parent));_context92.n=1;return this.post({render:[{isClearAll:!0,clearCanvas:Ut.TopFloat,viewId:this.viewId}],sp:[{type:vt.Clear}]});case 1:return _context92.a(2);}},_callee87,this);}));function clearAll(){return _clearAll2.apply(this,arguments);}return clearAll;}()},{key:"getRectImageBitmap",value:function getRectImageBitmap(t,r){var n=t.rect,s=t.drawCanvas,c=Math.floor(n.x*this.dpr),l=Math.floor(n.y*this.dpr),f=Math.floor(n.w*this.dpr||1),u=Math.floor(n.h*this.dpr||1);return createImageBitmap(this.getOffscreen(s),c,l,f,u,r);}},{key:"updateLayer",value:function updateLayer(t){var r=t.width,n=t.height;_superPropGet(ad,"updateLayer",this,3)([t]),this.topLayer&&(this.topLayer.parent.setAttribute("width",r),this.topLayer.parent.setAttribute("height",n),this.topLayer.setAttribute("size",[r,n]),this.topLayer.setAttribute("pos",[r*0.5,n*0.5]));}},{key:"updateDpr",value:function(){var _updateDpr2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee88(t){var r,n,s,_t89;return _regenerator().w(function(_context93){while(1)switch(_context93.n){case 0:_superPropGet(ad,"updateDpr",this,3)([t]);r=this.topLayerWork&&!!this.topLayerWork.localWorkShapes.size||!1,n=!!this.localWork.getWorkShapes().size,s=[];n&&s.push({isClearAll:!0,clearCanvas:Ut.Float,viewId:this.viewId});r&&s.push({isClearAll:!0,clearCanvas:Ut.TopFloat,viewId:this.viewId});_t89=s.length;if(!_t89){_context93.n=1;break;}_context93.n=1;return this.post({render:s});case 1:return _context93.a(2);}},_callee88,this);}));function updateDpr(_x113){return _updateDpr2.apply(this,arguments);}return updateDpr;}()},{key:"updateCamera",value:function(){var _updateCamera=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee89(t){var _this111=this;var s,r,n,c,l,_iterator76,_step76,_loop9,_t90,_t91;return _regenerator().w(function(_context95){while(1)switch(_context95.p=_context95.n){case 0:r=[],n=t.cameraOpt;if(!(n&&!_r(this.cameraOpt,n))){_context95.n=8;break;}c=this.topLayerWork&&!!this.topLayerWork.localWorkShapes.size||!1,l=!!this.localWork.getWorkShapes().size;if(!(l&&this.localWork.workShapesDone(),this.setCameraOpt(n),l&&r.push({isClearAll:!0,clearCanvas:Ut.Float,viewId:this.viewId}),c&&this.topLayerWork)){_context95.n=7;break;}r.push({isClearAll:!0,clearCanvas:Ut.TopFloat,viewId:this.viewId});_iterator76=_createForOfIteratorHelper(this.topLayerWork.localWorkShapes.entries()||[]);_context95.p=1;_loop9=/*#__PURE__*/_regenerator().m(function _loop9(){var _step76$value,f,u,v;return _regenerator().w(function(_context94){while(1)switch(_context94.n){case 0:_step76$value=_slicedToArray(_step76.value,2),f=_step76$value[0],u=_step76$value[1];if(u.totalRect){(s=_this111.topLayer)==null||s.getElementsByName(f.toString()).forEach(function(h){var y=h.getBoundingClientRect(),T=ve({x:y.x,y:y.y,w:y.width,h:y.height});v=Zt(v,T);}),u.totalRect=v,_this111.topLayerWork.localWorkShapes.set(f,u);}case 1:return _context94.a(2);}},_loop9);});_iterator76.s();case 2:if((_step76=_iterator76.n()).done){_context95.n=4;break;}return _context95.d(_regeneratorValues(_loop9()),3);case 3:_context95.n=2;break;case 4:_context95.n=6;break;case 5:_context95.p=5;_t90=_context95.v;_iterator76.e(_t90);case 6:_context95.p=6;_iterator76.f();return _context95.f(6);case 7:_t91=r.length;if(!_t91){_context95.n=8;break;}_context95.n=8;return this.post({render:r});case 8:return _context95.a(2);}},_callee89,this,[[1,5,6,7]]);}));function updateCamera(_x114){return _updateCamera.apply(this,arguments);}return updateCamera;}()},{key:"setCameraOpt",value:function setCameraOpt(t,r){var u,v;this.cameraOpt=t;var n=t.scale,s=t.centerX,c=t.centerY,l=t.width,f=t.height;(l!==this.scene.width||f!==this.scene.height)&&this.updateScene(this.scene,{width:l,height:f}),r?(r.setAttribute("scale",[n,n]),r.setAttribute("translate",[-s,-c])):(this.fullLayer.setAttribute("scale",[n,n]),this.fullLayer.setAttribute("translate",[-s,-c]),(u=this.topLayer)==null||u.setAttribute("scale",[n,n]),(v=this.topLayer)==null||v.setAttribute("translate",[-s,-c]));}}]);}(_h);var ld=/*#__PURE__*/function(_h0){function ld(t,r,n){var _this112;_classCallCheck(this,ld);_this112=_callSuper(this,ld,[t,r,"full"/* Full */]);dt(_this112,"serviceDrawLayer");dt(_this112,"localDrawLayer");dt(_this112,"snapshotFullLayer");dt(_this112,"methodBuilder");dt(_this112,"localWork");dt(_this112,"serviceWork");dt(_this112,"_post");dt(_this112,"debounceUpdateCache",/* @__PURE__ */new Set());_this112._post=n;var s=gr.bufferSize.sub;_this112.serviceDrawLayer=_this112.createLayer("serviceDrawLayer",_this112.scene,_objectSpread(_objectSpread({},r.layerOpt),{},{bufferSize:s,contextType:"2d"})),_this112.localDrawLayer=_this112.createLayer("localDrawLayer",_this112.scene,_objectSpread(_objectSpread({},r.layerOpt),{},{bufferSize:s,contextType:"2d"}));var c={thread:_this112,viewId:_this112.viewId,vNodes:_this112.vNodes,fullLayer:_this112.fullLayer};_this112.localWork=new id(_objectSpread(_objectSpread({},c),{},{drawLayer:_this112.localDrawLayer})),r.combineUnitTime&&_this112.localWork.setCombineUnitTime(r.combineUnitTime),r.maxCombineEraserTime&&_this112.localWork.setmaxCombineEraserTime(r.maxCombineEraserTime),r.syncUnitTime&&_this112.localWork.setSyncUnitTime(r.syncUnitTime),_this112.serviceWork=new sd(_objectSpread(_objectSpread({},c),{},{drawLayer:_this112.serviceDrawLayer})),_this112.methodBuilder=new ju([pe.CopyNode,pe.SetColorNode,pe.DeleteNode,pe.RotateNode,pe.ScaleNode,pe.TranslateNode,pe.ZIndexNode,pe.SetFontStyle,pe.SetPoint,pe.SetLock,pe.SetShapeOpt]).registerForWorker(_this112),_this112.vNodes.init(_this112.fullLayer);return _this112;}_inherits(ld,_h0);return _createClass(ld,[{key:"combinePost",value:function(){var _combinePost2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee90(){var _this113=this;var c,l,_this$combinePostData2,t,r,n,f,_iterator77,_step77,u,v,s,_t92;return _regenerator().w(function(_context96){while(1)switch(_context96.p=_context96.n){case 0:_this$combinePostData2=this.combinePostData(),t=_this$combinePostData2.render,r=_objectWithoutProperties(_this$combinePostData2,_excluded4);if(!(t!=null&&t.length)){_context96.n=11;break;}f=[];_iterator77=_createForOfIteratorHelper(t);_context96.p=1;_iterator77.s();case 2:if((_step77=_iterator77.n()).done){_context96.n=7;break;}u=_step77.value;if(!u.rect){_context96.n=6;break;}if(!(u.rect=qh(fr(u.rect),this.scene,this.dpr),!u.rect)){_context96.n=3;break;}return _context96.a(3,6);case 3:if(!(u.drawCanvas&&u.rect&&u.rect.w>0&&u.rect.h>0)){_context96.n=5;break;}_context96.n=4;return this.getRectImageBitmap(u);case 4:v=_context96.v;u.imageBitmap=v,n||(n=[]),n.push(v);case 5:f.push(u);case 6:_context96.n=2;break;case 7:_context96.n=9;break;case 8:_context96.p=8;_t92=_context96.v;_iterator77.e(_t92);case 9:_context96.p=9;_iterator77.f();return _context96.f(9);case 10:r.render=f;case 11:s=(c=r.sp)==null?void 0:c.filter(function(f){return f.type!==vt.None||f.isLockSentEventCursor||f.needUndoTicker;});s!=null&&s.length?r.sp=s.map(function(f){return _objectSpread(_objectSpread({},f),{},{viewId:_this113.viewId});}):delete r.sp,r.fullWorkerDrawCount===void 0&&delete r.fullWorkerDrawCount,r.consumeCount===void 0&&delete r.consumeCount,(r!=null&&r.fullWorkerDrawCount||r.consumeCount||s!=null&&s.length||(l=r.render)!=null&&l.length)&&this._post(r,n),this.delayPostDoneResolve&&this.delayPostDoneResolve(!0);case 12:return _context96.a(2);}},_callee90,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 _callee91(t){var _this114=this;var r,n,s,c,l,f,u,v,_u8,_t93,_t94;return _regenerator().w(function(_context97){while(1)switch(_context97.n){case 0:if(!this.methodBuilder.consumeForWorker(t)){_context97.n=1;break;}return _context97.a(2);case 1:r=t.msgType,n=t.dataType,s=t.workId,c=t.toolsType,l=t.workState,f=t.workIds;_t93=r;_context97.n=_t93===vt.AuthClear?2:_t93===vt.CreateWork?3:_t93===vt.DrawWork?4:_t93===vt.Select?8:_t93===vt.UpdateNode?12:_t93===vt.FullWork?12:_t93===vt.RemoveNode?13:_t93===vt.GetTextActive?15:_t93===vt.CursorHover?17:_t93===vt.CursorBlur?19:_t93===vt.GetVNodeInfo?21:22;break;case 2:u=t.clearUids,v=t.localUid;this.vNodes.setCanClearUids(u),this.vNodes.setLocalUid(v);return _context97.a(3,22);case 3:c!==Tt.LaserPen&&this.createLocalWork(t);return _context97.a(3,22);case 4:_t94=c!==Tt.LaserPen;if(!_t94){_context97.n=7;break;}if(!(l===te.Done&&n===Kt.Local)){_context97.n=6;break;}_context97.n=5;return this.consumeDrawAll(n,t);case 5:_context97.n=7;break;case 6:this.consumeDraw(n,t);case 7:return _context97.a(3,22);case 8:if(!(s===Me)){_context97.n=10;break;}_context97.n=9;return this.localWork.updateFullSelectWork(t);case 9:_context97.n=11;break;case 10:this.serviceWork.runSelectWork(t);case 11:return _context97.a(2);case 12:this.consumeFull(n,t);return _context97.a(2);case 13:_context97.n=14;return this.removeNode(t);case 14:return _context97.a(2);case 15:_context97.n=16;return this.checkTextActive(t);case 16:return _context97.a(2);case 17:_context97.n=18;return this.cursorHover(t);case 18:return _context97.a(2);case 19:_context97.n=20;return this.cursorBlur();case 20:return _context97.a(2);case 21:if(s&&f){_u8=f.map(function(v){return _this114.vNodes.get(v);});this.post({sp:[{type:vt.GetVNodeInfo,dataType:Kt.Worker,workId:s,vInfo:_u8}]});}return _context97.a(3,22);case 22:_context97.n=23;return _superPropGet(ld,"on",this,3)([t]);case 23:return _context97.a(2);}},_callee91,this);}));function on(_x115){return _on3.apply(this,arguments);}return on;}()},{key:"removeNode",value:function(){var _removeNode3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee92(t){var _this115=this;var r,n,s,c,l,_iterator78,_step78,_loop0,_t95;return _regenerator().w(function(_context99){while(1)switch(_context99.p=_context99.n){case 0:r=t.dataType,n=t.workId,s=t.removeIds,c=[],l=s||[];if(!(n&&l.push(n.toString()),l.length)){_context99.n=8;break;}_iterator78=_createForOfIteratorHelper(l);_context99.p=1;_loop0=/*#__PURE__*/_regenerator().m(function _loop0(){var f;return _regenerator().w(function(_context98){while(1)switch(_context98.n){case 0:f=_step78.value;f===Me?c.push(_this115.localWork.removeSelector(t,_this115)):r===Kt.Local?c.push(_this115.localWork.removeWork(t).then(function(){_this115.localWork.colloctEffectSelectWork(t),_this115.deleteCachedImagesByWorkId(f);})):r===Kt.Service&&c.push(_this115.serviceWork.removeWork(t).then(function(){_this115.localWork.colloctEffectSelectWork(t),_this115.deleteCachedImagesByWorkId(f);}));case 1:return _context98.a(2);}},_loop0);});_iterator78.s();case 2:if((_step78=_iterator78.n()).done){_context99.n=4;break;}return _context99.d(_regeneratorValues(_loop0()),3);case 3:_context99.n=2;break;case 4:_context99.n=6;break;case 5:_context99.p=5;_t95=_context99.v;_iterator78.e(_t95);case 6:_context99.p=6;_iterator78.f();return _context99.f(6);case 7:_context99.n=8;return Promise.all(c);case 8:return _context99.a(2);}},_callee92,null,[[1,5,6,7]]);}));function removeNode(_x116){return _removeNode3.apply(this,arguments);}return removeNode;}()},{key:"checkTextActive",value:function(){var _checkTextActive2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee93(t){var r,_t96;return _regenerator().w(function(_context100){while(1)switch(_context100.n){case 0:r=t.dataType;_t96=r===Kt.Local;if(!_t96){_context100.n=1;break;}_context100.n=1;return this.localWork.checkTextActive(t);case 1:return _context100.a(2);}},_callee93,this);}));function checkTextActive(_x117){return _checkTextActive2.apply(this,arguments);}return checkTextActive;}()},{key:"clearAll",value:function(){var _clearAll3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee94(){return _regenerator().w(function(_context101){while(1)switch(_context101.n){case 0:this.vNodes.clear();_superPropGet(ld,"clearAll",this,3)([]);this.localDrawLayer&&(this.localDrawLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),Rr(this.localDrawLayer,this.localDrawLayer.parent));this.serviceDrawLayer&&(this.serviceDrawLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),Rr(this.serviceDrawLayer,this.serviceDrawLayer.parent));_context101.n=1;return this.post({render:[{isClearAll:!0,clearCanvas:Ut.Bg,viewId:this.viewId},{isClearAll:!0,clearCanvas:Ut.ServiceFloat,viewId:this.viewId},{isClearAll:!0,clearCanvas:Ut.Float,viewId:this.viewId}],sp:[{type:vt.Clear}]});case 1:return _context101.a(2);}},_callee94,this);}));function clearAll(){return _clearAll3.apply(this,arguments);}return clearAll;}()},{key:"updateLayer",value:function updateLayer(t){var r=t.width,n=t.height;_superPropGet(ld,"updateLayer",this,3)([t]),this.localDrawLayer&&(this.localDrawLayer.parent.setAttribute("width",r),this.localDrawLayer.parent.setAttribute("height",n),this.localDrawLayer.setAttribute("size",[r,n]),this.localDrawLayer.setAttribute("pos",[r*0.5,n*0.5])),this.serviceDrawLayer&&(this.serviceDrawLayer.parent.setAttribute("width",r),this.serviceDrawLayer.parent.setAttribute("height",n),this.serviceDrawLayer.setAttribute("size",[r,n]),this.serviceDrawLayer.setAttribute("pos",[r*0.5,n*0.5]));}},{key:"setCameraOpt",value:function setCameraOpt(t){this.cameraOpt=t;var r=t.scale,n=t.centerX,s=t.centerY,c=t.width,l=t.height;(c!==this.scene.width||l!==this.scene.height)&&this.updateScene(this.scene,{width:c,height:l}),this.fullLayer&&(this.fullLayer.setAttribute("scale",[r,r]),this.fullLayer.setAttribute("translate",[-n,-s])),this.localDrawLayer&&(this.localDrawLayer.setAttribute("scale",[r,r]),this.localDrawLayer.setAttribute("translate",[-n,-s])),this.serviceDrawLayer&&(this.serviceDrawLayer.setAttribute("scale",[r,r]),this.serviceDrawLayer.setAttribute("translate",[-n,-s]));}},{key:"getLayer",value:function getLayer(t){switch(t){case Ut.Bg:return this.fullLayer;case Ut.ServiceFloat:return this.serviceDrawLayer;case Ut.Float:return this.localDrawLayer;}}},{key:"getOffscreen",value:function getOffscreen(t){return this.getLayer(t).parent.canvas;}},{key:"consumeFull",value:function(){var _consumeFull2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee95(t,r){var n,_t97;return _regenerator().w(function(_context102){while(1)switch(_context102.n){case 0:_context102.n=1;return this.localWork.colloctEffectSelectWork(r);case 1:n=_context102.v;_t97=n&&t===Kt.Local;if(!_t97){_context102.n=2;break;}_context102.n=2;return this.localWork.consumeFull(n);case 2:n&&t===Kt.Service&&this.serviceWork.consumeFull(n);case 3:return _context102.a(2);}},_callee95,this);}));function consumeFull(_x118,_x119){return _consumeFull2.apply(this,arguments);}return consumeFull;}()},{key:"consumeDraw",value:function(){var _consumeDraw6=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee96(t,r){var n,_t98;return _regenerator().w(function(_context103){while(1)switch(_context103.n){case 0:n=r.workId;_t98=t===Kt.Local&&n;if(!_t98){_context103.n=1;break;}this.localWork.getWorkShape(n.toString())||this.createLocalWork(r);_context103.n=1;return this.localWork.consumeDraw(r,this.serviceWork);case 1:t===Kt.Service&&this.serviceWork.consumeDraw(r);case 2:return _context103.a(2);}},_callee96,this);}));function consumeDraw(_x120,_x121){return _consumeDraw6.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll5=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee97(t,r){var n,_t99;return _regenerator().w(function(_context104){while(1)switch(_context104.n){case 0:n=r.workId;_t99=t===Kt.Local&&n;if(!_t99){_context104.n=1;break;}this.localWork.getWorkShape(n.toString())||this.createLocalWork(r);_context104.n=1;return this.localWork.consumeDrawAll(r,this.serviceWork);case 1:return _context104.a(2);}},_callee97,this);}));function consumeDrawAll(_x122,_x123){return _consumeDrawAll5.apply(this,arguments);}return consumeDrawAll;}()},{key:"updateDpr",value:function(){var _updateDpr3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee98(t){return _regenerator().w(function(_context105){while(1)switch(_context105.n){case 0:_superPropGet(ld,"updateDpr",this,3)([t]);_context105.n=1;return this.post({render:[{isClearAll:!0,clearCanvas:Ut.Bg,viewId:this.viewId},{isDrawAll:!0,drawCanvas:Ut.Bg,viewId:this.viewId}]});case 1:return _context105.a(2);}},_callee98,this);}));function updateDpr(_x124){return _updateDpr3.apply(this,arguments);}return updateDpr;}()},{key:"updateCamera",value:function(){var _updateCamera2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee99(t){var _this116=this;var c,l,f,u,v,r,n,s,h,P,_iterator79,_step79,_step79$value,_w51,_d48,y,_iterator80,_step80,_step80$value,_P29,_w56,_d51,_iterator81,_step81,_step81$value,_P30,_w57,_d52,T,O,_P25,_iterator82,_step82,_w52,I,_iterator83,_step83,_P26,_w53,_iterator84,_step84,_d49,_iterator85,_step85,_step85$value,_P28,_step85$value$,_w55,_d50,m,p,S,E,R,D,U,M,W,$,_iterator86,_step86,_step86$value,_P27,_w54,_t100,_t101;return _regenerator().w(function(_context106){while(1)switch(_context106.p=_context106.n){case 0:r=[],n=t.cameraOpt,s=t.scenePath;if(!(n&&!_r(this.cameraOpt,n))){_context106.n=11;break;}this.taskUpdateCameraId&&(clearTimeout(this.taskUpdateCameraId),this.taskUpdateCameraId=void 0);h=!!this.serviceDrawLayer.children.length;if(!s){_context106.n=10;break;}P=!1;_iterator79=_createForOfIteratorHelper(this.localWork.getWorkShapes().entries());_context106.p=1;_iterator79.s();case 2:if((_step79=_iterator79.n()).done){_context106.n=6;break;}_step79$value=_slicedToArray(_step79.value,2),_w51=_step79$value[0],_d48=_step79$value[1];_t100=_d48.toolsType;_context106.n=_t100===Tt.Text?3:_t100===Tt.PencilEraser?3:_t100===Tt.Eraser?3:_t100===Tt.Selector?3:_t100===Tt.LaserPen?3:4;break;case 3:return _context106.a(3,5);case 4:_w51!==hi&&_w51!==Me&&(P=!0);return _context106.a(3,5);case 5:_context106.n=2;break;case 6:_context106.n=8;break;case 7:_context106.p=7;_t101=_context106.v;_iterator79.e(_t101);case 8:_context106.p=8;_iterator79.f();return _context106.f(8);case 9:if(!P){_context106.n=10;break;}this.taskUpdateCameraId=setTimeout(function(){_this116.taskUpdateCameraId=void 0,_this116.updateCamera(t);},Eu);return _context106.a(2);case 10:y=/* @__PURE__ */new Map();_iterator80=_createForOfIteratorHelper(this.vNodes.getNodesByType(Tt.Text).entries());try{for(_iterator80.s();!(_step80=_iterator80.n()).done;){_step80$value=_slicedToArray(_step80.value,2),_P29=_step80$value[0],_w56=_step80$value[1];_d51=_w56.rect;y.set(_P29,{rect:fr(_d51),scale:(c=this.cameraOpt)==null?void 0:c.scale});}}catch(err){_iterator80.e(err);}finally{_iterator80.f();}_iterator81=_createForOfIteratorHelper(this.vNodes.gethasEraserNodes().entries());try{for(_iterator81.s();!(_step81=_iterator81.n()).done;){_step81$value=_slicedToArray(_step81.value,2),_P30=_step81$value[0],_w57=_step81$value[1];_d52=_w57.rect;y.set(_P30,{rect:fr(_d52),scale:(l=this.cameraOpt)==null?void 0:l.scale});}}catch(err){_iterator81.e(err);}finally{_iterator81.f();}T=new Set(y.keys());O=!1;if(this.localWork.hasSelector()){_P25=(f=this.localWork.getSelector())==null?void 0:f.selectIds;if(_P25){O=!0;_iterator82=_createForOfIteratorHelper(_P25);try{for(_iterator82.s();!(_step82=_iterator82.n()).done;){_w52=_step82.value;T.add(_w52);}}catch(err){_iterator82.e(err);}finally{_iterator82.f();}}}I=!1;if(this.serviceWork.selectorWorkShapes.size){_iterator83=_createForOfIteratorHelper(this.serviceWork.selectorWorkShapes.values());try{for(_iterator83.s();!(_step83=_iterator83.n()).done;){_P26=_step83.value;_w53=_P26.selectIds;if(_w53){I=!0;_iterator84=_createForOfIteratorHelper(_w53);try{for(_iterator84.s();!(_step84=_iterator84.n()).done;){_d49=_step84.value;T.add(_d49);}}catch(err){_iterator84.e(err);}finally{_iterator84.f();}}}}catch(err){_iterator83.e(err);}finally{_iterator83.f();}}if(this.setCameraOpt(n),this.vNodes.curNodeMap.size){this.vNodes.clearTarget(),this.vNodes.updateHighLevelNodesRect(T),this.debounceUpdateCameraId&&clearTimeout(this.debounceUpdateCameraId);_iterator85=_createForOfIteratorHelper(y.entries());try{for(_iterator85.s();!(_step85=_iterator85.n()).done;){_step85$value=_slicedToArray(_step85.value,2),_P28=_step85$value[0],_step85$value$=_step85$value[1],_w55=_step85$value$.rect,_d50=_step85$value$.scale;m=this.vNodes.get(_P28);if(m){p=_w55,S=m.rect,E=this.getSceneRect(),R=Ji(p,E),D=Ji(S,E),U=m.toolsType,M=m.opt;W=!1;(R!==D||p.w!==S.w||p.h!==S.h||D===Tr.intersect)&&(W=!0),U===Tt.Text&&// (opt as TextOptions).workState === EventWorkState.Done &&
|
|
486
|
+
W&&this.debounceUpdateCache.add(_P28);$=!1;_d50&&(u=this.cameraOpt)!=null&&u.scale&&_d50>this.cameraOpt.scale?D!==Tr.outside&&R!==Tr.inside&&($=!0):_d50&&(v=this.cameraOpt)!=null&&v.scale&&_d50===this.cameraOpt.scale&&(p.x!==S.x||p.y!==S.y)&&(D===Tr.inside&&R!==Tr.inside||D===Tr.intersect&&R===Tr.intersect)&&($=!0),M.eraserlines&&M.eraserlines.length&&$&&!this.debounceUpdateCache.has(_P28)&&this.debounceUpdateCache.add(_P28);}}}catch(err){_iterator85.e(err);}finally{_iterator85.f();}if(O&&this.localWork.reRenderSelector(),I){_iterator86=_createForOfIteratorHelper(this.serviceWork.selectorWorkShapes.entries());try{for(_iterator86.s();!(_step86=_iterator86.n()).done;){_step86$value=_slicedToArray(_step86.value,2),_P27=_step86$value[0],_w54=_step86$value[1];this.serviceWork.runSelectWork({workId:_P27,selectIds:_w54.selectIds,msgType:vt.Select,dataType:Kt.Service,viewId:this.viewId});}}catch(err){_iterator86.e(err);}finally{_iterator86.f();}}this.debounceUpdateCameraId=setTimeout(function(){var w;_this116.debounceUpdateCameraId=void 0;var P=[];var _iterator87=_createForOfIteratorHelper(_this116.debounceUpdateCache.values()),_step87;try{var _loop1=function _loop1(){var d=_step87.value;var m=_this116.vNodes.get(d);if(m){var p=m.toolsType,S=m.opt,E=m.op,R=_this116.localWork.setFullWork({toolsType:p,opt:S,workId:d});R&&(p===Tt.Text?(w=_this116.fullLayer)!=null&&w.getElementsByName(d)[0]&&R instanceof Vi&&P.push(R.consumeServiceAsync({isFullWork:!0,replaceId:d,boxRect:_this116.getSceneRect()})):S.eraserlines&&S.eraserlines.length&&P.push(new Promise(function(D){var U=R.consumeService({op:E,isFullWork:!0,replaceId:d,workState:te.Done});_this116.localWork.clearWorkShapeNodeCache(d),D(U);})));}_this116.debounceUpdateCache["delete"](d);};for(_iterator87.s();!(_step87=_iterator87.n()).done;){_loop1();}}catch(err){_iterator87.e(err);}finally{_iterator87.f();}P.length?Promise.all(P).then(function(){var d=[];d.push({isClearAll:!0,clearCanvas:Ut.Bg,viewId:_this116.viewId},{isDrawAll:!0,drawCanvas:Ut.Bg,viewId:_this116.viewId}),d.length&&_this116.post({render:d}),_this116.vNodes.updateLowLevelNodesRect(),_this116.vNodes.clearHighLevelIds();}):(_this116.vNodes.updateLowLevelNodesRect(),_this116.vNodes.clearHighLevelIds());},Eu*5);}h&&r.push({isClearAll:!0,clearCanvas:Ut.ServiceFloat,viewId:this.viewId}),this.vNodes.hasRenderNodes()&&r.push({isClearAll:!0,clearCanvas:Ut.Bg,viewId:this.viewId},{isDrawAll:!0,drawCanvas:Ut.Bg,viewId:this.viewId}),r.length&&this.post({render:r});case 11:return _context106.a(2);}},_callee99,this,[[1,7,8,9]]);}));function updateCamera(_x125){return _updateCamera2.apply(this,arguments);}return updateCamera;}()},{key:"getRectImageBitmap",value:function getRectImageBitmap(t){var r=t.rect,n=t.drawCanvas,s=Math.floor(r.x*this.dpr),c=Math.floor(r.y*this.dpr),l=Math.floor(r.w*this.dpr||1),f=Math.floor(r.h*this.dpr||1);return createImageBitmap(this.getOffscreen(n),s,c,l,f,{resizeQuality:"low"});}},{key:"cursorHover",value:function(){var _cursorHover2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee100(t){return _regenerator().w(function(_context107){while(1)switch(_context107.n){case 0:_context107.n=1;return this.localWork.cursorHover(t);case 1:return _context107.a(2);}},_callee100,this);}));function cursorHover(_x126){return _cursorHover2.apply(this,arguments);}return cursorHover;}()},{key:"cursorBlur",value:function(){var _cursorBlur2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee101(){return _regenerator().w(function(_context108){while(1)switch(_context108.n){case 0:_context108.n=1;return this.localWork.cursorBlur();case 1:return _context108.a(2);}},_callee101,this);}));function cursorBlur(){return _cursorBlur2.apply(this,arguments);}return cursorBlur;}()},{key:"destroy",value:function destroy(){_superPropGet(ld,"destroy",this,3)([]);}}]);}(_h);var ZM=/*#__PURE__*/function(_ld){function ZM(t,r,n){var _this117;_classCallCheck(this,ZM);var c,l,f,u;_this117=_callSuper(this,ZM,[t,r,n]);dt(_this117,"snapshotWork");dt(_this117,"localDrawScene");dt(_this117,"serviceDrawScene");dt(_this117,"offscreenCanvas");dt(_this117,"localWork");dt(_this117,"serviceWork");if(_this117._post=n,r.offscreenCanvas){_this117.offscreenCanvas=r.offscreenCanvas,_this117.localDrawScene=_this117.createScene(r,(c=_this117.offscreenCanvas)==null?void 0:c.localCanvas),_this117.serviceDrawScene=_this117.createScene(r,(l=_this117.offscreenCanvas)==null?void 0:l.serviceCanvas);var v=gr.bufferSize.sub;_this117.serviceDrawLayer=_this117.createLayer("serviceDrawLayer",_this117.serviceDrawScene||_this117.scene,_objectSpread(_objectSpread({},r.layerOpt),{},{bufferSize:v,contextType:"2d"}),(f=_this117.offscreenCanvas)==null?void 0:f.serviceCanvas),_this117.localDrawLayer=_this117.createLayer("localDrawLayer",_this117.localDrawScene||_this117.scene,_objectSpread(_objectSpread({},r.layerOpt),{},{bufferSize:v,contextType:"2d"}),(u=_this117.offscreenCanvas)==null?void 0:u.localCanvas);}var s={thread:_this117,viewId:_this117.viewId,vNodes:_this117.vNodes,fullLayer:_this117.fullLayer};_this117.localWork=new HM(_objectSpread(_objectSpread({},s),{},{drawLayer:_this117.localDrawLayer})),r.combineUnitTime&&_this117.localWork.setCombineUnitTime(r.combineUnitTime),r.maxCombineEraserTime&&_this117.localWork.setmaxCombineEraserTime(r.maxCombineEraserTime),r.syncUnitTime&&_this117.localWork.setSyncUnitTime(r.syncUnitTime),_this117.serviceWork=new VM(_objectSpread(_objectSpread({},s),{},{drawLayer:_this117.serviceDrawLayer})),_this117.snapshotWork=new od(_objectSpread(_objectSpread({},s),{},{createScene:_this117.createScene.bind(_this117),createLayer:_this117.createLayer.bind(_this117)})),_this117.methodBuilder=new ju([pe.CopyNode,pe.SetColorNode,pe.DeleteNode,pe.RotateNode,pe.ScaleNode,pe.TranslateNode,pe.ZIndexNode,pe.SetFontStyle,pe.SetPoint,pe.SetLock,pe.SetShapeOpt]).registerForWorker(_this117);return _this117;}_inherits(ZM,_ld);return _createClass(ZM,[{key:"createRenderLayer",value:function createRenderLayer(t,r,n){var l;var s=gr.bufferSize.full,c=gr.bufferSize.sub;this.fullLayer=this.createLayer("fullLayer",t,_objectSpread(_objectSpread({},r.layerOpt),{},{bufferSize:this.viewId===jn?s:c*2}),n||((l=r.offscreenCanvas)==null?void 0:l.bgCanvas));}},{key:"createScene",value:function createScene(t,r){var n=t.offscreenCanvas,s=t.offscreenCanvasOpt,c=s.width,l=s.height,f=r||(n==null?void 0:n.bgCanvas)||new OffscreenCanvas(c,l);s.contextType&&delete s.contextType;var u=new Xu(_objectSpread(_objectSpread({container:f,displayRatio:this.dpr,depth:!1,desynchronized:!0,failIfMajorPerformanceCaveat:!0},s),{},{contextType:this.contextType,id:this.viewId}));return u.setAttribute("id",this.viewId),u;}},{key:"combinePostData",value:function combinePostData(){var c,l;this.workerTaskId=void 0;var t=[],r=[];var n;var s=/* @__PURE__ */new Set();var _iterator88=_createForOfIteratorHelper(this.combinePostMsg.values()),_step88;try{for(_iterator88.s();!(_step88=_iterator88.n()).done;){var f=_step88.value;if((c=f.render)!=null&&c.length)try{if(this.offscreenCanvas){var _iterator89=_createForOfIteratorHelper(f.render),_step89;try{for(_iterator89.s();!(_step89=_iterator89.n()).done;){var u=_step89.value;u.workId&&s.add(u.workId);var v=u.drawCanvas||u.clearCanvas;if(v){var h=this.getLayer(v);if(!h||!(h.parent instanceof il))continue;h.parent.render();}}}catch(err){_iterator89.e(err);}finally{_iterator89.f();}}else{var _iterator90=_createForOfIteratorHelper(f.render),_step90;try{for(_iterator90.s();!(_step90=_iterator90.n()).done;){var _u9=_step90.value;var _v15=!1;if(_u9.workId&&s.add(_u9.workId),_u9.isClearAll&&(_u9.rect=this.getSceneRect(),_u9.isClear=!0,delete _u9.isClearAll),_u9.drawCanvas){var _h1=this.getLayer(_u9.drawCanvas);if(!_h1||!(_h1.parent instanceof il))continue;if(_h1.parent.render(),_u9.isDrawAll){var y=this.getSceneRect();_u9.rect=y,delete _u9.isDrawAll;}}var _iterator91=_createForOfIteratorHelper(t),_step91;try{for(_iterator91.s();!(_step91=_iterator91.n()).done;){var _h10=_step91.value;if(_u9.viewId===_h10.viewId){_u9.isClear&&_h10.clearCanvas&&_h10.isClear&&_h10.clearCanvas===_u9.clearCanvas&&(_h10.rect=Zt(_h10.rect,_u9.rect),_v15=!0),_h10.drawCanvas&&_h10.drawCanvas===_u9.drawCanvas&&(_h10.rect=Zt(_h10.rect,_u9.rect),_v15=!0);continue;}}}catch(err){_iterator91.e(err);}finally{_iterator91.f();}_v15||(_u9.isClear&&!_u9.drawCanvas?t.unshift(_u9):t.push(_u9));}}catch(err){_iterator90.e(err);}finally{_iterator90.f();}}}catch(u){var _v16=u&&u instanceof Error?u.message:u==null?void 0:u.toString();console.error("[WorkThreadEngineForSimpleWorker] combinePostData error",_v16),r.push({type:vt.ReportError,reportString:"[WorkThreadEngineForSimpleWorker] combinePostData error: ".concat(_v16)});}if((l=f.sp)!=null&&l.length){var _iterator92=_createForOfIteratorHelper(f.sp),_step92;try{for(_iterator92.s();!(_step92=_iterator92.n()).done;){var _u0=_step92.value;var _v17=!1;var _iterator93=_createForOfIteratorHelper(r),_step93;try{for(_iterator93.s();!(_step93=_iterator93.n()).done;){var _h11=_step93.value;if(_r(_u0,_h11)){_v17=!0;break;}}}catch(err){_iterator93.e(err);}finally{_iterator93.f();}_v17||r.push(_u0);}}catch(err){_iterator92.e(err);}finally{_iterator92.f();}}_e(f.consumeCount)&&(n=f.consumeCount);}}catch(err){_iterator88.e(err);}finally{_iterator88.f();}return this.combinePostMsg.clear(),{render:t,sp:r,consumeCount:n,workIds:s,viewId:this.viewId};}},{key:"on",value:function(){var _on4=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee102(t){var r,_t102;return _regenerator().w(function(_context109){while(1)switch(_context109.n){case 0:if(!this.methodBuilder.consumeForWorker(t)){_context109.n=1;break;}return _context109.a(2);case 1:r=t.msgType;_t102=r;_context109.n=_t102===vt.Snapshot?2:_t102===vt.BoundingBox?4:6;break;case 2:this.snapshotWork.createSnapshotFullLayer(this.opt,_objectSpread(_objectSpread({},this.opt.layerOpt),{},{bufferSize:this.viewId===jn?6e3:3e3,contextType:"2d"}));_context109.n=3;return this.snapshotWork.getSnapshot(t);case 3:this.snapshotWork.destroySnapshotFullLayer();return _context109.a(2);case 4:this.snapshotWork.createSnapshotFullLayer(this.opt,_objectSpread(_objectSpread({},this.opt.layerOpt),{},{bufferSize:this.viewId===jn?6e3:3e3,contextType:"2d"}));_context109.n=5;return this.snapshotWork.getBoundingRect(t);case 5:this.snapshotWork.destroySnapshotFullLayer();return _context109.a(2);case 6:_context109.n=7;return _superPropGet(ZM,"on",this,3)([t]);case 7:return _context109.a(2);}},_callee102,this);}));function on(_x127){return _on4.apply(this,arguments);}return on;}()},{key:"setCameraOpt",value:function setCameraOpt(t){if(this.localDrawScene&&this.serviceDrawScene){var r=t.width,n=t.height;(r!==this.localDrawScene.width||n!==this.localDrawScene.height)&&this.updateScene(this.localDrawScene,{width:r,height:n},this.localDrawLayer),(r!==this.serviceDrawScene.width||n!==this.serviceDrawScene.height)&&this.updateScene(this.serviceDrawScene,{width:r,height:n},this.serviceDrawLayer);}_superPropGet(ZM,"setCameraOpt",this,3)([t]);}},{key:"updateDpr",value:function(){var _updateDpr4=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee103(t){return _regenerator().w(function(_context110){while(1)switch(_context110.n){case 0:this.localDrawScene&&this.serviceDrawScene&&(this.localDrawScene.displayRatio=t,this.serviceDrawScene.displayRatio=t),_superPropGet(ZM,"updateDpr",this,3)([t]);case 1:return _context110.a(2);}},_callee103,this);}));function updateDpr(_x128){return _updateDpr4.apply(this,arguments);}return updateDpr;}()}]);}(ld);var $u=self;$u.sub=new KM($u,co.Sub);
|