@netless/appliance-plugin 1.1.18 → 1.1.19-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +318 -260
- package/cdn/cdn.js +1 -1
- package/cdn/fullWorker-XyhFxc.js +439 -0
- package/cdn/subWorker-BpFYAC.js +439 -0
- package/dist/appliance-plugin.js +1 -1
- package/dist/appliance-plugin.mjs +7 -7
- package/dist/cdn.d.ts +2 -2
- package/dist/collector/collector.d.ts +2 -2
- package/dist/collector/index.d.ts +4 -4
- package/dist/collector/types.d.ts +2 -2
- package/dist/component/miniMap/index.d.ts +1 -1
- package/dist/component/miniMap/manager.d.ts +2 -2
- package/dist/component/miniMap/view.d.ts +1 -1
- package/dist/component/textEditor/index.d.ts +2 -2
- package/dist/component/textEditor/manager.d.ts +2 -1
- package/dist/component/textEditor/types.d.ts +4 -3
- package/dist/component/textEditor/view.d.ts +1 -1
- package/dist/core/index.d.ts +3 -3
- package/dist/core/mainEngine.d.ts +20 -5
- package/dist/core/mainThread/base.d.ts +4 -4
- package/dist/core/mainThread/index.d.ts +2 -2
- package/dist/core/mainThread/snapshotThread.d.ts +3 -3
- package/dist/core/mainThread/subLocalThread.d.ts +13 -6
- package/dist/core/mainThread/subServiceThread.d.ts +1 -1
- package/dist/core/mainThread/workerMainThread.d.ts +2 -2
- package/dist/core/msgEvent/copyNode/forMain.d.ts +2 -2
- package/dist/core/msgEvent/forMainThread.d.ts +4 -4
- package/dist/core/msgEvent/forWorker.d.ts +4 -4
- package/dist/core/msgEvent/index.d.ts +4 -4
- package/dist/core/tools/arrow.d.ts +4 -0
- package/dist/core/tools/base.d.ts +4 -3
- package/dist/core/tools/ellipse.d.ts +4 -0
- package/dist/core/tools/index.d.ts +14 -14
- package/dist/core/tools/laserPen.d.ts +1 -1
- package/dist/core/tools/pencilEraser.d.ts +4 -34
- package/dist/core/tools/pencilEraserBitMap.d.ts +7 -30
- package/dist/core/tools/polygon.d.ts +4 -0
- package/dist/core/tools/rectangle.d.ts +4 -0
- package/dist/core/tools/selector.d.ts +1 -1
- package/dist/core/tools/speechBalloon.d.ts +4 -0
- package/dist/core/tools/star.d.ts +4 -0
- package/dist/core/tools/straight.d.ts +4 -0
- package/dist/core/types.d.ts +20 -9
- package/dist/core/utils/clipper.d.ts +1 -1
- package/dist/core/utils/getSvgPathFromPoints.d.ts +1 -1
- package/dist/core/utils/index.d.ts +4 -4
- package/dist/core/utils/primitives/Box2d.d.ts +4 -4
- package/dist/core/utils/proxy.d.ts +3 -4
- package/dist/core/worker/base.d.ts +5 -2
- package/dist/core/worker/fullWorkerLocal.d.ts +6 -11
- package/dist/cursors/index.d.ts +6 -4
- package/dist/displayer/cursor/index.d.ts +1 -0
- package/dist/fullWorker.js +142 -203
- package/dist/{index-BRQCDzgF.mjs → index-BJkvFhzU.mjs} +9239 -5525
- package/dist/index-BXV0vpe1.js +1 -0
- package/dist/index-D2qjaZgV.js +1 -0
- package/dist/index-DM5jr5_3.mjs +2776 -0
- package/dist/plugin/applianceMultiPlugin.d.ts +2 -3
- package/dist/plugin/applianceSinglePlugin.d.ts +3 -4
- package/dist/plugin/baseApplianceManager.d.ts +4 -4
- package/dist/plugin/baseViewContainerManager.d.ts +7 -3
- package/dist/plugin/const.d.ts +2 -34
- package/dist/plugin/multi/containerManager.d.ts +1 -1
- package/dist/plugin/types.d.ts +61 -25
- package/dist/style.css +1 -1
- package/dist/subWorker.js +142 -203
- package/dist/undo/index.d.ts +1 -1
- package/package.json +8 -2
- package/cdn/fullWorker-D_Qymn.js +0 -500
- package/cdn/subWorker-am2Vr9.js +0 -500
- package/dist/index-BmM-scQu.mjs +0 -2502
- package/dist/index-C9F49Gge.js +0 -1
- package/dist/index-DUGXE2hv.js +0 -1
|
@@ -0,0 +1,439 @@
|
|
|
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 s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)o=s[r],t.includes(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(e.includes(n))continue;t[n]=r[n];}return t;}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 _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 _toArray(r){return _arrayWithHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableRest();}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 ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e;}function _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 _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 _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}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 _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 _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _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 Zs=Object.defineProperty;var Js=function Js(u,e,t){return e in u?Zs(u,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[e]=t;};var at=function at(u,e,t){return Js(u,_typeof(e)!="symbol"?e+"":e,t);};var Kt=/* @__PURE__ */function(u){return u.Normal="Normal",u.Stroke="Stroke",u.Dotted="Dotted",u.LongDotted="LongDotted",u;}(Kt||{}),kt=/* @__PURE__ */function(u){return u.None="None",u.ShowFloatBar="ShowFloatBar",u.ZIndexFloatBar="ZIndexFloatBar",u.DeleteNode="DeleteNode",u.CopyNode="CopyNode",u.ZIndexActive="ZIndexActive",u.ZIndexNode="ZIndexNode",u.RotateNode="RotateNode",u.SetColorNode="SetColorNode",u.TranslateNode="TranslateNode",u.ScaleNode="ScaleNode",u.OriginalEvent="OriginalEvent",u.CreateScene="CreateScene",u.ActiveCursor="ActiveCursor",u.MoveCursor="MoveCursor",u.CommandEditor="CommandEditor",u.SetEditorData="SetEditorData",u.SetFontStyle="SetFontStyle",u.SetPoint="SetPoint",u.SetLock="SetLock",u.SetShapeOpt="SetShapeOpt",u.CameraChange="CameraChange",u.ActiveMethod="ActiveMethod",u.HidFloatBarBtn="HidFloatBarBtn",u;}(kt||{}),xt=/* @__PURE__ */function(u){return u[u.Pencil=1]="Pencil",u[u.Eraser=2]="Eraser",u[u.PencilEraser=3]="PencilEraser",u[u.BitMapEraser=4]="BitMapEraser",u[u.Selector=5]="Selector",u[u.Clicker=6]="Clicker",u[u.Arrow=7]="Arrow",u[u.Hand=8]="Hand",u[u.LaserPen=9]="LaserPen",u[u.Text=10]="Text",u[u.Straight=11]="Straight",u[u.Rectangle=12]="Rectangle",u[u.Ellipse=13]="Ellipse",u[u.Star=14]="Star",u[u.Triangle=15]="Triangle",u[u.Rhombus=16]="Rhombus",u[u.Polygon=17]="Polygon",u[u.SpeechBalloon=18]="SpeechBalloon",u[u.Image=19]="Image",u;}(xt||{}),bt=/* @__PURE__ */function(u){return u[u.Local=1]="Local",u[u.Service=2]="Service",u[u.Worker=3]="Worker",u;}(bt||{}),Ft=/* @__PURE__ */function(u){return u[u.Pending=0]="Pending",u[u.Start=1]="Start",u[u.Doing=2]="Doing",u[u.Done=3]="Done",u[u.Unwritable=4]="Unwritable",u;}(Ft||{}),dt=/* @__PURE__ */function(u){return u[u.None=0]="None",u[u.Init=1]="Init",u[u.UpdateCamera=2]="UpdateCamera",u[u.UpdateTools=3]="UpdateTools",u[u.CreateWork=4]="CreateWork",u[u.DrawWork=5]="DrawWork",u[u.FullWork=6]="FullWork",u[u.UpdateNode=7]="UpdateNode",u[u.RemoveNode=8]="RemoveNode",u[u.Clear=9]="Clear",u[u.Select=10]="Select",u[u.Destroy=11]="Destroy",u[u.Snapshot=12]="Snapshot",u[u.BoundingBox=13]="BoundingBox",u[u.Cursor=14]="Cursor",u[u.TextUpdate=15]="TextUpdate",u[u.GetTextActive=16]="GetTextActive",u[u.TasksQueue=17]="TasksQueue",u[u.CursorHover=18]="CursorHover",u[u.CursorBlur=19]="CursorBlur",u[u.Console=20]="Console",u[u.PriorityWorker=21]="PriorityWorker",u[u.PriorityMainThreadWorker=22]="PriorityMainThreadWorker",u[u.GetImageBitMap=23]="GetImageBitMap",u[u.AuthWriter=24]="AuthWriter",u[u.AuthReader=25]="AuthReader",u[u.AuthClear=26]="AuthClear",u[u.AuthPage=27]="AuthPage",u[u.GetVNodeInfo=28]="GetVNodeInfo",u[u.UpdateDpr=29]="UpdateDpr",u;}(dt||{}),Rt=/* @__PURE__ */function(u){return u[u.None=0]="None",u[u.Bg=1]="Bg",u[u.ServiceFloat=2]="ServiceFloat",u[u.Float=3]="Float",u[u.TopFloat=4]="TopFloat",u;}(Rt||{}),Qt=/* @__PURE__ */function(u){return u[u.none=1]="none",u[u.all=2]="all",u[u.both=3]="both",u[u.proportional=4]="proportional",u;}(Qt||{}),ge=/* @__PURE__ */function(u){return u[u.inside=0]="inside",u[u.outside=1]="outside",u[u.intersect=2]="intersect",u;}(ge||{}),Zr=/* @__PURE__ */function(u){return u.Image="image",u.Iconify="iconify",u;}(Zr||{});var Oe=/*#__PURE__*/function(){function Oe(){_classCallCheck(this,Oe);at(this,"localWork");at(this,"serviceWork");at(this,"threadEngine");}return _createClass(Oe,[{key:"registerForWorker",value:function registerForWorker(e){return this.threadEngine=e,this.localWork=e.localWork,this.serviceWork=e.serviceWork,this;}}]);}();var Qs=/*#__PURE__*/function(_Oe){function Qs(){var _this;_classCallCheck(this,Qs);_this=_callSuper(this,Qs,arguments);at(_this,"emitEventType",kt.CopyNode);return _this;}_inherits(Qs,_Oe);return _createClass(Qs,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,s=t.emitEventType;if(r===dt.FullWork&&n===bt.Local&&s===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(t){var n,r;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:r=t.workId;_context.t0=r;if(!_context.t0){_context.next=5;break;}_context.next=5;return(n=this.localWork)==null?void 0:n.consumeFull(t);case 5:case"end":return _context.stop();}},_callee,this);}));function consumeForLocalWorker(_x){return _consumeForLocalWorker.apply(this,arguments);}return consumeForLocalWorker;}()}]);}(Oe);var or="++",qt="selector",qs="all";var _s=/*#__PURE__*/function(_Oe2){function _s(){var _this2;_classCallCheck(this,_s);_this2=_callSuper(this,_s,arguments);at(_this2,"emitEventType",kt.SetColorNode);return _this2;}_inherits(_s,_Oe2);return _createClass(_s,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,s=t.emitEventType;if(r===dt.UpdateNode&&n===bt.Local&&s===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(t){var c,r,n,s,l,o,a;return _regeneratorRuntime().wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:r=t.workId,n=t.updateNodeOpt,s=t.willRefreshSelector,l=t.willSyncService,o=t.willSerializeData,a=t.textUpdateForWoker;_context2.t0=r===qt&&n;if(!_context2.t0){_context2.next=5;break;}_context2.next=5;return(c=this.localWork)==null?void 0:c.updateSelector({updateSelectorOpt:n,willRefreshSelector:s,willSyncService:l,willSerializeData:o,textUpdateForWoker:a,callback:this.updateSelectorCallback});case 5:case"end":return _context2.stop();}},_callee2,this);}));function consumeForLocalWorker(_x2){return _consumeForLocalWorker2.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,s=t.newServiceStore,l=r.willSyncService,o=r.isSync,a=r.textUpdateForWoker,c=n.render||[],y=n.sp||[];if(l){var _iterator2=_createForOfIteratorHelper(s.entries()),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var _step2$value=_slicedToArray(_step2.value,2),f=_step2$value[0],g=_step2$value[1];a&&g.toolsType===xt.Text?y.push(_objectSpread(_objectSpread({},g),{},{workId:f,type:dt.TextUpdate,dataType:bt.Local,willSyncService:!0})):y.push(_objectSpread(_objectSpread({},g),{},{workId:f,type:dt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}));}}catch(err){_iterator2.e(err);}finally{_iterator2.f();}}return{render:c,sp:y};}}]);}(Oe);var to=/*#__PURE__*/function(_Oe3){function to(){var _this3;_classCallCheck(this,to);_this3=_callSuper(this,to,arguments);at(_this3,"emitEventType",kt.ZIndexNode);return _this3;}_inherits(to,_Oe3);return _createClass(to,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,s=t.emitEventType;if(r===dt.UpdateNode&&n===bt.Local&&s===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(t){var a,r,n,s,l,o;return _regeneratorRuntime().wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:r=t.workId,n=t.updateNodeOpt,s=t.willRefreshSelector,l=t.willSyncService,o=t.willSerializeData;_context3.t0=r===qt&&n;if(!_context3.t0){_context3.next=5;break;}_context3.next=5;return(a=this.localWork)==null?void 0:a.updateSelector({updateSelectorOpt:n,willRefreshSelector:s,willSyncService:l,willSerializeData:o,callback:this.updateSelectorCallback});case 5:case"end":return _context3.stop();}},_callee3,this);}));function consumeForLocalWorker(_x3){return _consumeForLocalWorker3.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,s=t.newServiceStore,l=r.willSyncService,o=r.isSync,a=n.render||[],c=n.sp||[];if(l&&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],f=_step3$value[1];c.push(_objectSpread(_objectSpread({},f),{},{workId:y,type:dt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}));}}catch(err){_iterator3.e(err);}finally{_iterator3.f();}}return{render:a,sp:c};}}]);}(Oe);var eo=/*#__PURE__*/function(_Oe4){function eo(){var _this4;_classCallCheck(this,eo);_this4=_callSuper(this,eo,arguments);at(_this4,"emitEventType",kt.TranslateNode);return _this4;}_inherits(eo,_Oe4);return _createClass(eo,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,s=t.emitEventType;if(r===dt.UpdateNode&&n===bt.Local&&s===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(t){var f,g,r,n,s,l,o,a,c,y;return _regeneratorRuntime().wrap(function _callee4$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:r=t.workId,n=t.updateNodeOpt,s=t.willRefreshSelector,l=t.willSyncService,o=t.willSerializeData,a=t.textUpdateForWoker,c=t.emitEventType,y=t.smoothSync;_context4.t0=r===qt&&n;if(!_context4.t0){_context4.next=9;break;}if(!(n.workState===Ft.Done&&n!=null&&n.translate&&(n.translate[0]||n.translate[1])||n.workState!==Ft.Done)){_context4.next=8;break;}_context4.next=6;return(f=this.localWork)==null?void 0:f.updateSelector({updateSelectorOpt:n,willRefreshSelector:s,willSyncService:l,willSerializeData:o,isSync:!0,textUpdateForWoker:a,emitEventType:c,callback:this.updateSelectorCallback,smoothSync:y});case 6:_context4.next=9;break;case 8:n.workState===Ft.Done&&((g=this.localWork)==null||g.vNodes.deleteLastTarget());case 9:case"end":return _context4.stop();}},_callee4,this);}));function consumeForLocalWorker(_x4){return _consumeForLocalWorker4.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,s=t.newServiceStore,l=t.workShapeNode,o=t.res,a=t.smoothSync,c=r.willSyncService,y=r.isSync,f=r.updateSelectorOpt,g=r.textUpdateForWoker,x=f.workState,M=n.render||[],S=n.sp||[];if(x===Ft.Start)return{sp:[],render:[]};var P=o==null?void 0:o.selectRect;if(c){S.push({type:dt.Select,selectIds:l.selectIds,selectRect:P,willSyncService:x===Ft.Done?!0:a,isSync:!0,points:x===Ft.Done&&l.getChildrenPoints()||void 0,textOpt:l.textOpt});var C={useAnimation:f.useAnimation||!1};f.uid&&(C.uid=f.uid);var _iterator4=_createForOfIteratorHelper(s.entries()),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var _step4$value=_slicedToArray(_step4.value,2),h=_step4$value[0],p=_step4$value[1];g&&p.toolsType===xt.Text?S.push(_objectSpread(_objectSpread({},p),{},{workId:h,type:dt.TextUpdate,dataType:bt.Local,willSyncService:x===Ft.Done?!0:a,updateNodeOpt:C})):(a||x===Ft.Done)&&S.push(_objectSpread(_objectSpread({},p),{},{workId:h,type:dt.UpdateNode,updateNodeOpt:C,isSync:y}));}}catch(err){_iterator4.e(err);}finally{_iterator4.f();}}return{render:M,sp:S};}}]);}(Oe);var ro=/*#__PURE__*/function(_Oe5){function ro(){var _this5;_classCallCheck(this,ro);_this5=_callSuper(this,ro,arguments);at(_this5,"emitEventType",kt.DeleteNode);return _this5;}_inherits(ro,_Oe5);return _createClass(ro,[{key:"consume",value:function consume(){return!1;}}]);}(Oe);var no=/*#__PURE__*/function(_Oe6){function no(){var _this6;_classCallCheck(this,no);_this6=_callSuper(this,no,arguments);at(_this6,"emitEventType",kt.ScaleNode);return _this6;}_inherits(no,_Oe6);return _createClass(no,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,s=t.emitEventType;if(r===dt.UpdateNode&&n===bt.Local&&s===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(t){var a,r,n,s,l,o;return _regeneratorRuntime().wrap(function _callee5$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:r=t.workId,n=t.updateNodeOpt,s=t.willSyncService,l=t.willSerializeData,o=t.smoothSync;_context5.t0=r===qt&&n;if(!_context5.t0){_context5.next=5;break;}_context5.next=5;return(a=this.localWork)==null?void 0:a.updateSelector({updateSelectorOpt:n,willSyncService:s,willSerializeData:l,isSync:!0,callback:this.updateSelectorCallback.bind(this),smoothSync:o});case 5:case"end":return _context5.stop();}},_callee5,this);}));function consumeForLocalWorker(_x5){return _consumeForLocalWorker5.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,s=t.workShapeNode,l=t.res,o=t.newServiceStore,a=t.smoothSync,c=r.updateSelectorOpt,y=r.willSyncService,f=c.workState,g=n.render||[],x=n.sp||[],M=l==null?void 0:l.selectRect;if(f===Ft.Start)return{sp:[],render:[]};if(y){x.push({type:dt.Select,selectIds:s.selectIds,selectRect:M,willSyncService:f===Ft.Done?!0:a,isSync:!0,points:f===Ft.Done&&s.getChildrenPoints()||void 0,textOpt:s.textOpt});var S={useAnimation:c.useAnimation||!1};c.uid&&(S.uid=c.uid);var _iterator5=_createForOfIteratorHelper(o.entries()),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var _step5$value=_slicedToArray(_step5.value,2),P=_step5$value[0],C=_step5$value[1];C.toolsType===xt.Text?x.push(_objectSpread(_objectSpread({},C),{},{workId:P,type:dt.TextUpdate,dataType:bt.Local,willSyncService:f===Ft.Done?!0:a,updateNodeOpt:S})):(a||f===Ft.Done)&&x.push(_objectSpread(_objectSpread({},C),{},{workId:P,type:dt.UpdateNode,updateNodeOpt:S,isSync:!0}));}}catch(err){_iterator5.e(err);}finally{_iterator5.f();}}return{render:g,sp:x};}}]);}(Oe);var io=/*#__PURE__*/function(_Oe7){function io(){var _this7;_classCallCheck(this,io);_this7=_callSuper(this,io,arguments);at(_this7,"emitEventType",kt.RotateNode);return _this7;}_inherits(io,_Oe7);return _createClass(io,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,s=t.emitEventType;if(r===dt.UpdateNode&&n===bt.Local&&s===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker6=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(t){var y,r,n,s,l,o,a,c;return _regeneratorRuntime().wrap(function _callee6$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:r=t.workId,n=t.updateNodeOpt,s=t.willRefreshSelector,l=t.willSyncService,o=t.willSerializeData,a=t.emitEventType,c=t.smoothSync;_context6.t0=r===qt&&n;if(!_context6.t0){_context6.next=5;break;}_context6.next=5;return(y=this.localWork)==null?void 0:y.updateSelector({updateSelectorOpt:n,willRefreshSelector:s,willSyncService:l,willSerializeData:o,emitEventType:a,isSync:!0,callback:this.updateSelectorCallback,smoothSync:c});case 5:case"end":return _context6.stop();}},_callee6,this);}));function consumeForLocalWorker(_x6){return _consumeForLocalWorker6.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,s=t.workShapeNode,l=t.res,o=t.newServiceStore,a=t.smoothSync,c=r.updateSelectorOpt,y=r.willSyncService,f=r.willSerializeData,g=r.isSync,x=c.workState,M=n.render||[],S=n.sp||[],P=l==null?void 0:l.selectRect;if(y){f&&x===Ft.Done&&S.push({type:dt.Select,selectIds:s.selectIds,selectRect:P,willSyncService:!0,isSync:g,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 C={useAnimation:c.useAnimation||!1};if(c.uid&&(C.uid=c.uid),a||x===Ft.Done){var _iterator6=_createForOfIteratorHelper(o.entries()),_step6;try{for(_iterator6.s();!(_step6=_iterator6.n()).done;){var _step6$value=_slicedToArray(_step6.value,2),h=_step6$value[0],p=_step6$value[1];S.push(_objectSpread(_objectSpread({},p),{},{workId:h,type:dt.UpdateNode,updateNodeOpt:C,isSync:g}));}}catch(err){_iterator6.e(err);}finally{_iterator6.f();}}}return{render:M,sp:S};}}]);}(Oe);var so=/*#__PURE__*/function(_Oe8){function so(){var _this8;_classCallCheck(this,so);_this8=_callSuper(this,so,arguments);at(_this8,"emitEventType",kt.SetFontStyle);return _this8;}_inherits(so,_Oe8);return _createClass(so,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,s=t.emitEventType;if(r===dt.UpdateNode&&n===bt.Local&&s===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker7=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(t){var c,r,n,s,l,o,a;return _regeneratorRuntime().wrap(function _callee7$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:r=t.workId,n=t.updateNodeOpt,s=t.willRefreshSelector,l=t.willSyncService,o=t.willSerializeData,a=t.textUpdateForWoker;_context7.t0=r===qt&&n;if(!_context7.t0){_context7.next=5;break;}_context7.next=5;return(c=this.localWork)==null?void 0:c.updateSelector({updateSelectorOpt:n,willRefreshSelector:s,willSyncService:l,willSerializeData:o,textUpdateForWoker:a,callback:this.updateSelectorCallback});case 5:case"end":return _context7.stop();}},_callee7,this);}));function consumeForLocalWorker(_x7){return _consumeForLocalWorker7.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,s=t.newServiceStore,l=t.workShapeNode,o=t.res,a=r.willSyncService,c=r.isSync,y=r.updateSelectorOpt,f=r.textUpdateForWoker,g=n.render||[],x=n.sp||[],M=o==null?void 0:o.selectRect;if(a&&x){y.fontSize&&x.push({type:dt.Select,selectIds:l.selectIds,selectRect:M,willSyncService:a,isSync:c,points:l.getChildrenPoints()});var _iterator7=_createForOfIteratorHelper(s.entries()),_step7;try{for(_iterator7.s();!(_step7=_iterator7.n()).done;){var _step7$value=_slicedToArray(_step7.value,2),S=_step7$value[0],P=_step7$value[1];f&&P.toolsType===xt.Text?x.push(_objectSpread(_objectSpread({},P),{},{workId:S,type:dt.TextUpdate,dataType:bt.Local,willSyncService:!0})):x.push(_objectSpread(_objectSpread({},P),{},{workId:S,type:dt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:c}));}}catch(err){_iterator7.e(err);}finally{_iterator7.f();}}return{render:g,sp:x};}}]);}(Oe);var oo=/*#__PURE__*/function(_Oe9){function oo(){var _this9;_classCallCheck(this,oo);_this9=_callSuper(this,oo,arguments);at(_this9,"emitEventType",kt.SetPoint);return _this9;}_inherits(oo,_Oe9);return _createClass(oo,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,s=t.emitEventType;if(r===dt.UpdateNode&&n===bt.Local&&s===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker8=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(t){var c,r,n,s,l,o,a;return _regeneratorRuntime().wrap(function _callee8$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:r=t.workId,n=t.updateNodeOpt,s=t.willRefreshSelector,l=t.willSyncService,o=t.willSerializeData,a=t.textUpdateForWoker;_context8.t0=r===qt&&n;if(!_context8.t0){_context8.next=5;break;}_context8.next=5;return(c=this.localWork)==null?void 0:c.updateSelector({updateSelectorOpt:n,willRefreshSelector:s,willSyncService:l,emitEventType:this.emitEventType,willSerializeData:o,isSync:!0,textUpdateForWoker:a,callback:this.updateSelectorCallback});case 5:case"end":return _context8.stop();}},_callee8,this);}));function consumeForLocalWorker(_x8){return _consumeForLocalWorker8.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,s=t.newServiceStore,l=t.workShapeNode,o=t.res,a=r.willSyncService,c=r.isSync,y=n.render||[],f=n.sp||[],g=o==null?void 0:o.selectRect;if(a&&f){var _iterator8=_createForOfIteratorHelper(s.entries()),_step8;try{for(_iterator8.s();!(_step8=_iterator8.n()).done;){var _step8$value=_slicedToArray(_step8.value,2),x=_step8$value[0],M=_step8$value[1];f.push(_objectSpread(_objectSpread({},M),{},{workId:x,type:dt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:c}));}}catch(err){_iterator8.e(err);}finally{_iterator8.f();}f.push({type:dt.Select,selectIds:l.selectIds,selectRect:g,willSyncService:a,isSync:c,points:l.getChildrenPoints()});}return{render:y,sp:f};}}]);}(Oe);var ao=/*#__PURE__*/function(_Oe10){function ao(){var _this10;_classCallCheck(this,ao);_this10=_callSuper(this,ao,arguments);at(_this10,"emitEventType",kt.SetLock);return _this10;}_inherits(ao,_Oe10);return _createClass(ao,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,s=t.emitEventType;if(r===dt.UpdateNode&&n===bt.Local&&s===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker9=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(t){var a,r,n,s,l,o;return _regeneratorRuntime().wrap(function _callee9$(_context9){while(1)switch(_context9.prev=_context9.next){case 0:r=t.workId,n=t.updateNodeOpt,s=t.willRefreshSelector,l=t.willSyncService,o=t.willSerializeData;_context9.t0=r===qt&&n;if(!_context9.t0){_context9.next=5;break;}_context9.next=5;return(a=this.localWork)==null?void 0:a.updateSelector({updateSelectorOpt:n,willRefreshSelector:s,willSyncService:l,willSerializeData:o,callback:this.updateSelectorCallback});case 5:case"end":return _context9.stop();}},_callee9,this);}));function consumeForLocalWorker(_x9){return _consumeForLocalWorker9.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,s=t.newServiceStore,l=t.workShapeNode,o=t.res,a=r.willSyncService,c=r.isSync,y=r.updateSelectorOpt,f=n.render||[],g=n.sp||[],x=o==null?void 0:o.selectRect;if(a&&g){var _iterator9=_createForOfIteratorHelper(s.entries()),_step9;try{for(_iterator9.s();!(_step9=_iterator9.n()).done;){var _step9$value=_slicedToArray(_step9.value,2),M=_step9$value[0],S=_step9$value[1];g.push(_objectSpread(_objectSpread({},S),{},{workId:M,type:dt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:c}));}}catch(err){_iterator9.e(err);}finally{_iterator9.f();}g.push({isLocked:y.isLocked,selectorColor:l.selectorColor,scaleType:l.scaleType,canRotate:l.canRotate,type:dt.Select,selectIds:l.selectIds,selectRect:x,willSyncService:a,isSync:c});}return{render:f,sp:g};}}]);}(Oe);var lo=/*#__PURE__*/function(_Oe11){function lo(){var _this11;_classCallCheck(this,lo);_this11=_callSuper(this,lo,arguments);at(_this11,"emitEventType",kt.SetShapeOpt);return _this11;}_inherits(lo,_Oe11);return _createClass(lo,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,s=t.emitEventType;if(r===dt.UpdateNode&&n===bt.Local&&s===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker10=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(t){var a,r,n,s,l,o;return _regeneratorRuntime().wrap(function _callee10$(_context10){while(1)switch(_context10.prev=_context10.next){case 0:r=t.workId,n=t.updateNodeOpt,s=t.willRefreshSelector,l=t.willSyncService,o=t.willSerializeData;_context10.t0=r===qt&&n;if(!_context10.t0){_context10.next=5;break;}_context10.next=5;return(a=this.localWork)==null?void 0:a.updateSelector({updateSelectorOpt:n,willRefreshSelector:s,willSyncService:l,willSerializeData:o,callback:this.updateSelectorCallback});case 5:case"end":return _context10.stop();}},_callee10,this);}));function consumeForLocalWorker(_x10){return _consumeForLocalWorker10.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,s=t.newServiceStore,l=r.willSyncService,o=r.isSync,a=n.render||[],c=n.sp||[];if(l&&c){var _iterator10=_createForOfIteratorHelper(s.entries()),_step10;try{for(_iterator10.s();!(_step10=_iterator10.n()).done;){var _step10$value=_slicedToArray(_step10.value,2),y=_step10$value[0],f=_step10$value[1];c.push(_objectSpread(_objectSpread({},f),{},{workId:y,type:dt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}));}}catch(err){_iterator10.e(err);}finally{_iterator10.f();}}return{render:a,sp:c};}}]);}(Oe);var co=/*#__PURE__*/function(){function co(e){var _this12=this;_classCallCheck(this,co);at(this,"builders",/* @__PURE__ */new Map());this.builders=new Map(e.map(function(t){return[t,_this12.build(t)];}));}return _createClass(co,[{key:"build",value:function build(e){switch(e){case kt.TranslateNode:return new eo();case kt.ZIndexNode:return new to();case kt.CopyNode:return new Qs();case kt.SetColorNode:return new _s();case kt.DeleteNode:return new ro();case kt.ScaleNode:return new no();case kt.RotateNode:return new io();case kt.SetFontStyle:return new so();case kt.SetPoint:return new oo();case kt.SetLock:return new ao();case kt.SetShapeOpt:return new lo();}}},{key:"registerForWorker",value:function registerForWorker(e){return this.builders.forEach(function(t){t&&t.registerForWorker(e);}),this;}},{key:"consumeForWorker",value:function consumeForWorker(e){var _iterator11=_createForOfIteratorHelper(this.builders.values()),_step11;try{for(_iterator11.s();!(_step11=_iterator11.n()).done;){var t=_step11.value;if(t!=null&&t.consume(e))return!0;}}catch(err){_iterator11.e(err);}finally{_iterator11.f();}return!1;}}]);}();var fo={linear:function linear(u){return u;},easeInQuad:function easeInQuad(u){return u*u;},easeOutQuad:function easeOutQuad(u){return u*(2-u);},easeInOutQuad:function easeInOutQuad(u){return u<0.5?2*u*u:-1+(4-2*u)*u;},easeInCubic:function easeInCubic(u){return u*u*u;},easeOutCubic:function easeOutCubic(u){return--u*u*u+1;},easeInOutCubic:function easeInOutCubic(u){return u<0.5?4*u*u*u:(u-1)*(2*u-2)*(2*u-2)+1;},easeInQuart:function easeInQuart(u){return u*u*u*u;},easeOutQuart:function easeOutQuart(u){return 1- --u*u*u*u;},easeInOutQuart:function easeInOutQuart(u){return u<0.5?8*u*u*u*u:1-8*--u*u*u*u;},easeInQuint:function easeInQuint(u){return u*u*u*u*u;},easeOutQuint:function easeOutQuint(u){return 1+--u*u*u*u*u;},easeInOutQuint:function easeInOutQuint(u){return u<0.5?16*u*u*u*u*u:1+16*--u*u*u*u*u;},easeInSine:function easeInSine(u){return 1-Math.cos(u*Math.PI/2);},easeOutSine:function easeOutSine(u){return Math.sin(u*Math.PI/2);},easeInOutSine:function easeInOutSine(u){return-(Math.cos(Math.PI*u)-1)/2;},easeInExpo:function easeInExpo(u){return u<=0?0:Math.pow(2,10*u-10);},easeOutExpo:function easeOutExpo(u){return u>=1?1:1-Math.pow(2,-10*u);},easeInOutExpo:function easeInOutExpo(u){return u<=0?0:u>=1?1:u<0.5?Math.pow(2,20*u-10)/2:(2-Math.pow(2,-20*u+10))/2;}};var ot=/*#__PURE__*/function(){function ot(){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,ot);this.x=e,this.y=t,this.z=r;}return _createClass(ot,[{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(_ref){var _ref$x=_ref.x,e=_ref$x===void 0?0:_ref$x,_ref$y=_ref.y,t=_ref$y===void 0?0:_ref$y,_ref$z=_ref.z,r=_ref$z===void 0?1:_ref$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),l=Math.cos(t);return this.x=e.x+(r*l-n*s),this.y=e.y+(r*s+n*l),this;}},{key:"clone",value:function clone(){var e=this.x,t=this.y,r=this.z;return new ot(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=ot.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 ot.Dpr(this,e);}},{key:"cpr",value:function cpr(e){return ot.Cpr(this,e);}},{key:"len2",value:function len2(){return ot.Len2(this);}},{key:"len",value:function len(){return ot.Len(this);}},{key:"pry",value:function pry(e){return ot.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 ot.Uni(this);}},{key:"tan",value:function tan(e){return ot.Tan(this,e);}},{key:"dist",value:function dist(e){return ot.Dist(this,e);}},{key:"distanceToLineSegment",value:function distanceToLineSegment(e,t){return ot.DistanceToLineSegment(e,t,this);}},{key:"slope",value:function slope(e){return ot.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 ot.Angle(this,e);}},{key:"toAngle",value:function toAngle(){return ot.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 ot.Equals(this,e,t);}},{key:"equalsXY",value:function equalsXY(e,t){return ot.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 ot.ToFixed(this);}},{key:"toString",value:function toString(){return ot.ToString(ot.ToFixed(this));}},{key:"toJson",value:function toJson(){return ot.ToJson(this);}},{key:"toArray",value:function toArray(){return ot.ToArray(this);}}],[{key:"Add",value:function Add(e,t){return new ot(e.x+t.x,e.y+t.y);}},{key:"AddXY",value:function AddXY(e,t,r){return new ot(e.x+t,e.y+r);}},{key:"Sub",value:function Sub(e,t){return new ot(e.x-t.x,e.y-t.y);}},{key:"SubXY",value:function SubXY(e,t,r){return new ot(e.x-t,e.y-r);}},{key:"AddScalar",value:function AddScalar(e,t){return new ot(e.x+t,e.y+t);}},{key:"SubScalar",value:function SubScalar(e,t){return new ot(e.x-t,e.y-t);}},{key:"Div",value:function Div(e,t){return new ot(e.x/t,e.y/t);}},{key:"Mul",value:function Mul(e,t){return new ot(e.x*t,e.y*t);}},{key:"DivV",value:function DivV(e,t){return new ot(e.x/t.x,e.y/t.y);}},{key:"MulV",value:function MulV(e,t){return new ot(e.x*t.x,e.y*t.y);}},{key:"Neg",value:function Neg(e){return new ot(-e.x,-e.y);}},{key:"Per",value:function Per(e){return new ot(e.y,-e.x);}},{key:"Dist2",value:function Dist2(e,t){return ot.Sub(e,t).len2();}},{key:"Abs",value:function Abs(e){return new ot(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 ot(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
|
|
2
|
+
);}},{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 ot.Dpr(e,t)/ot.Len(t);}},{key:"Uni",value:function Uni(e){return ot.Div(e,ot.Len(e));}},{key:"Tan",value:function Tan(e,t){return ot.Uni(ot.Sub(e,t));}},{key:"Min",value:function Min(e,t){return new ot(Math.min(e.x,t.x),Math.min(e.y,t.y));}},{key:"Max",value:function Max(e,t){return new ot(Math.max(e.x,t.x),Math.max(e.y,t.y));}},{key:"From",value:function From(e){return new ot().add(e);}},{key:"FromArray",value:function FromArray(e){return new ot(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 ot(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,l=Math.sin(r),o=Math.cos(r);return new ot(t.x+(n*o-s*l),t.y+(n*l+s*o));}/**
|
|
3
|
+
* Get the nearest point on a line with a known unit vector that passes through point A
|
|
4
|
+
*
|
|
5
|
+
* ```ts
|
|
6
|
+
* Vec.nearestPointOnLineThroughPoint(A, u, Point)
|
|
7
|
+
* ```
|
|
8
|
+
*
|
|
9
|
+
* @param A - Any point on the line
|
|
10
|
+
* @param u - The unit vector for the line.
|
|
11
|
+
* @param P - A point not on the line to test.
|
|
12
|
+
*/},{key:"NearestPointOnLineThroughPoint",value:function NearestPointOnLineThroughPoint(e,t,r){return ot.Mul(t,ot.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=ot.Tan(t,e),l=ot.Add(e,ot.Mul(s,ot.Sub(r,e).pry(s)));if(n){if(l.x<Math.min(e.x,t.x))return ot.Cast(e.x<t.x?e:t);if(l.x>Math.max(e.x,t.x))return ot.Cast(e.x>t.x?e:t);if(l.y<Math.min(e.y,t.y))return ot.Cast(e.y<t.y?e:t);if(l.y>Math.max(e.y,t.y))return ot.Cast(e.y>t.y?e:t);}return l;}},{key:"DistanceToLineThroughPoint",value:function DistanceToLineThroughPoint(e,t,r){return ot.Dist(r,ot.NearestPointOnLineThroughPoint(e,t,r));}},{key:"DistanceToLineSegment",value:function DistanceToLineSegment(e,t,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!0;return ot.Dist(r,ot.NearestPointOnLineSegment(e,t,r,n));}},{key:"Snap",value:function Snap(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return new ot(Math.round(e.x/t)*t,Math.round(e.y/t)*t);}},{key:"Cast",value:function Cast(e){return e instanceof ot?e:ot.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 ot.Sub(t,e).mul(r).add(e);}},{key:"Med",value:function Med(e,t){return new ot((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 ot.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=ot.Len(e);return new ot(t*e.x/r,t*e.y/r);}},{key:"ScaleWithOrigin",value:function ScaleWithOrigin(e,t,r){return ot.Sub(e,r).mul(t).add(r);}},{key:"ScaleWOrigin",value:function ScaleWOrigin(e,t,r){return ot.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 ot(+e.x.toFixed(t),+e.y.toFixed(t),+e.z.toFixed(t));}},{key:"Nudge",value:function Nudge(e,t,r){return ot.Add(e,ot.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 ot(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 ot(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 ot(Math.min(Math.max(e.x,t)),Math.min(Math.max(e.y,t))):new ot(Math.min(Math.max(e.x,t),r),Math.min(Math.max(e.y,t),r));}/**
|
|
13
|
+
* Get an array of points (with simulated pressure) between two points.
|
|
14
|
+
*
|
|
15
|
+
* @param A - The first point.
|
|
16
|
+
* @param B - The second point.
|
|
17
|
+
* @param steps - The number of points to return.
|
|
18
|
+
*/},{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 l=fo.easeInQuad(s/(r-1)),o=ot.Lrp(e,t,l);o.z=Math.min(1,0.5+Math.abs(0.5-ho(l))*0.65),n.push(o);}return n;}},{key:"SnapToGrid",value:function SnapToGrid(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:8;return new ot(Math.round(e.x/t)*t,Math.round(e.y/t)*t);}}]);}();var ho=function ho(u){return u<0.5?2*u*u:-1+(4-2*u)*u;};var Dt=/*#__PURE__*/function(_ot){function Dt(){var _this13;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 l=arguments.length>5&&arguments[5]!==undefined?arguments[5]:0;_classCallCheck(this,Dt);_this13=_callSuper(this,Dt,[e,t,r]),_this13.x=e,_this13.y=t,_this13.z=r,_this13.v=n,_this13.t=s,_this13.a=l;return _this13;}_inherits(Dt,_ot);return _createClass(Dt,[{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 l=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=l,this;}},{key:"clone",value:function clone(){var e=this.x,t=this.y,r=this.z,n=this.v,s=this.t,l=this.a,o={x:n.x,y:n.y};return new Dt(e,t,r,o,s,l);}},{key:"distance",value:function distance(e){return Dt.GetDistance(this,e);}},{key:"isNear",value:function isNear(e,t){return Dt.IsNear(this,e,t);}},{key:"getAngleByPoints",value:function getAngleByPoints(e,t){return Dt.GetAngleByPoints(e,this,t);}}],[{key:"Sub",value:function Sub(e,t){return new Dt(e.x-t.x,e.y-t.y);}},{key:"Add",value:function Add(e,t){return new Dt(e.x+t.x,e.y+t.y);}},{key:"GetDistance",value:function GetDistance(e,t){return Dt.Len(e.clone().sub(t));}},{key:"GetAngleByPoints",value:function GetAngleByPoints(e,t,r){var n=t.x-e.x,s=r.x-t.x,l=t.y-e.y,o=r.y-t.y;var a=0;var c=Math.sqrt(n*n+l*l),y=Math.sqrt(s*s+o*o);if(c&&y){var f=n*s+l*o;a=Math.acos(f/(c*y)),a=a/Math.PI*180;var g=n*o-l*s;g=g>0?1:-1,a=180+g*a;}return a;}},{key:"IsNear",value:function IsNear(e,t,r){return Dt.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,l=e.y-t.y,o=Math.sin(r),a=Math.cos(r),c=Math.pow(10,n),y=Math.floor((t.x+(s*a-l*o))*c)/c,f=Math.floor((t.y+(s*o+l*a))*c)/c;return new Dt(y,f);}/**
|
|
19
|
+
* 根据圆心和半径,获取圆上的等份点
|
|
20
|
+
* @param o 圆心
|
|
21
|
+
* @param radius 半径
|
|
22
|
+
* @param average 均分数
|
|
23
|
+
* @returns
|
|
24
|
+
*/},{key:"GetDotStroke",value:function GetDotStroke(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:16;var n=new ot(1,1),s=Math.PI+1e-3,l=Dt.Add(e,Dt.Sub(e,n).uni().per().mul(-t)),o=[];for(var a=1/r,c=a;c<=1;c+=a)o.push(Dt.RotWith(l,e,s*2*c));return o;}/**
|
|
25
|
+
* 根据圆心和圆上的起始点,获取半圆上的等份点
|
|
26
|
+
* @param o 圆心
|
|
27
|
+
* @param p 圆弧起始点
|
|
28
|
+
* @param radian 1,逆时针180度 -1,顺时针
|
|
29
|
+
* @param average 均分数
|
|
30
|
+
* @returns
|
|
31
|
+
*/},{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),l=[];for(var o=1/n,a=o;a<=1;a+=o)l.push(Dt.RotWith(t,e,s*a));return l;}}]);}(ot);var te=/******/function(u){var e={};function t(r){if(e[r])return e[r].exports;var n=e[r]={/******/i:r,/******/l:!1,/******/exports:{}/******/};return u[r].call(n.exports,n,n.exports,t),n.l=!0,n.exports;}return t.m=u,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 l in r)t.d(s,l,function(o){return r[o];}.bind(null,l));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(u,e,t){t.r(e),t.d(e,"version",function(){return Q;}),t.d(e,"helpers",function(){return Y;}),t.d(e,"createElement",function(){return W;}),t.d(e,"isSpriteNode",function(){return D;}),t.d(e,"registerNode",function(){return R;});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 l=t(217);t.d(e,"Cloud",function(){return l["default"];});var o=t(219);t.d(e,"Block",function(){return o["default"];});var a=t(224);t.d(e,"Sprite",function(){return a["default"];});var c=t(226);t.d(e,"Path",function(){return c["default"];});var y=t(229);t.d(e,"Rect",function(){return y["default"];});var f=t(231);t.d(e,"Triangle",function(){return f["default"];});var g=t(236);t.d(e,"Parallel",function(){return g["default"];});var x=t(238);t.d(e,"Regular",function(){return x["default"];});var M=t(240);t.d(e,"Star",function(){return M["default"];});var S=t(242);t.d(e,"Ellipse",function(){return S["default"];});var P=t(244);t.d(e,"Arc",function(){return P["default"];});var C=t(246);t.d(e,"Ring",function(){return C["default"];});var h=t(232);t.d(e,"Polyline",function(){return h["default"];});var p=t(248);t.d(e,"Label",function(){return p["default"];});var d=t(250);t.d(e,"Group",function(){return d["default"];});var v=t(286);t.d(e,"Layer",function(){return v["default"];});var I=t(287);t.d(e,"SpriteSvg",function(){return I["default"];});var L=t(289);t.d(e,"LayerWorker",function(){return L["default"];});var w=t(290);t.d(e,"Scene",function(){return w["default"];});var B=t(213),E=t(221);t.d(e,"Color",function(){return E.Color;}),t.d(e,"Gradient",function(){return E.Gradient;});var b=t(72);t(1).glMatrix.setMatrixArrayType(Array);var W=B["default"].createElement,D=B["default"].isSpriteNode,R=B["default"].registerNode,Y={parseColor:E.parseColor,sizeToPixel:b.sizeToPixel,toArray:b.toArray,toString:b.toString,toNumber:b.toNumber};var V;V="3.8.3";var Q=V;},/* 1 *//***/function(u,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 l=t(5);t.d(e,"mat3",function(){return l;});var o=t(6);t.d(e,"mat4",function(){return o;});var a=t(7);t.d(e,"quat",function(){return a;});var c=t(10);t.d(e,"quat2",function(){return c;});var y=t(11);t.d(e,"vec2",function(){return y;});var f=t(8);t.d(e,"vec3",function(){return f;});var g=t(9);t.d(e,"vec4",function(){return g;});},/* 2 *//***/function(u,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 l;}),t.d(e,"toRadian",function(){return a;}),t.d(e,"equals",function(){return c;});var r=1e-6,n=(typeof Float32Array==="undefined"?"undefined":_typeof(Float32Array))<"u"?Float32Array:Array,s=Math.random;function l(y){n=y;}var o=Math.PI/180;function a(y){return y*o;}function c(y,f){return Math.abs(y-f)<=r*Math.max(1,Math.abs(y),Math.abs(f));}Math.hypot||(Math.hypot=function(){for(var y=0,f=arguments.length;f--;)y+=arguments[f]*arguments[f];return Math.sqrt(y);});},/* 3 *//***/function(u,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 l;}),t.d(e,"identity",function(){return o;}),t.d(e,"fromValues",function(){return a;}),t.d(e,"set",function(){return c;}),t.d(e,"transpose",function(){return y;}),t.d(e,"invert",function(){return f;}),t.d(e,"adjoint",function(){return g;}),t.d(e,"determinant",function(){return x;}),t.d(e,"multiply",function(){return M;}),t.d(e,"rotate",function(){return S;}),t.d(e,"scale",function(){return P;}),t.d(e,"fromRotation",function(){return C;}),t.d(e,"fromScaling",function(){return h;}),t.d(e,"str",function(){return p;}),t.d(e,"frob",function(){return d;}),t.d(e,"LDU",function(){return v;}),t.d(e,"add",function(){return I;}),t.d(e,"subtract",function(){return L;}),t.d(e,"exactEquals",function(){return w;}),t.d(e,"equals",function(){return B;}),t.d(e,"multiplyScalar",function(){return E;}),t.d(e,"multiplyScalarAndAdd",function(){return b;}),t.d(e,"mul",function(){return W;}),t.d(e,"sub",function(){return D;});var r=t(2);function n(){var R=new r.ARRAY_TYPE(4);return r.ARRAY_TYPE!=Float32Array&&(R[1]=0,R[2]=0),R[0]=1,R[3]=1,R;}function s(R){var Y=new r.ARRAY_TYPE(4);return Y[0]=R[0],Y[1]=R[1],Y[2]=R[2],Y[3]=R[3],Y;}function l(R,Y){return R[0]=Y[0],R[1]=Y[1],R[2]=Y[2],R[3]=Y[3],R;}function o(R){return R[0]=1,R[1]=0,R[2]=0,R[3]=1,R;}function a(R,Y,V,Q){var et=new r.ARRAY_TYPE(4);return et[0]=R,et[1]=Y,et[2]=V,et[3]=Q,et;}function c(R,Y,V,Q,et){return R[0]=Y,R[1]=V,R[2]=Q,R[3]=et,R;}function y(R,Y){if(R===Y){var V=Y[1];R[1]=Y[2],R[2]=V;}else R[0]=Y[0],R[1]=Y[2],R[2]=Y[1],R[3]=Y[3];return R;}function f(R,Y){var V=Y[0],Q=Y[1],et=Y[2],it=Y[3],$=V*it-et*Q;return $?($=1/$,R[0]=it*$,R[1]=-Q*$,R[2]=-et*$,R[3]=V*$,R):null;}function g(R,Y){var V=Y[0];return R[0]=Y[3],R[1]=-Y[1],R[2]=-Y[2],R[3]=V,R;}function x(R){return R[0]*R[3]-R[2]*R[1];}function M(R,Y,V){var Q=Y[0],et=Y[1],it=Y[2],$=Y[3],K=V[0],rt=V[1],lt=V[2],ct=V[3];return R[0]=Q*K+it*rt,R[1]=et*K+$*rt,R[2]=Q*lt+it*ct,R[3]=et*lt+$*ct,R;}function S(R,Y,V){var Q=Y[0],et=Y[1],it=Y[2],$=Y[3],K=Math.sin(V),rt=Math.cos(V);return R[0]=Q*rt+it*K,R[1]=et*rt+$*K,R[2]=Q*-K+it*rt,R[3]=et*-K+$*rt,R;}function P(R,Y,V){var Q=Y[0],et=Y[1],it=Y[2],$=Y[3],K=V[0],rt=V[1];return R[0]=Q*K,R[1]=et*K,R[2]=it*rt,R[3]=$*rt,R;}function C(R,Y){var V=Math.sin(Y),Q=Math.cos(Y);return R[0]=Q,R[1]=V,R[2]=-V,R[3]=Q,R;}function h(R,Y){return R[0]=Y[0],R[1]=0,R[2]=0,R[3]=Y[1],R;}function p(R){return"mat2("+R[0]+", "+R[1]+", "+R[2]+", "+R[3]+")";}function d(R){return Math.hypot(R[0],R[1],R[2],R[3]);}function v(R,Y,V,Q){return R[2]=Q[2]/Q[0],V[0]=Q[0],V[1]=Q[1],V[3]=Q[3]-R[2]*V[1],[R,Y,V];}function I(R,Y,V){return R[0]=Y[0]+V[0],R[1]=Y[1]+V[1],R[2]=Y[2]+V[2],R[3]=Y[3]+V[3],R;}function L(R,Y,V){return R[0]=Y[0]-V[0],R[1]=Y[1]-V[1],R[2]=Y[2]-V[2],R[3]=Y[3]-V[3],R;}function w(R,Y){return R[0]===Y[0]&&R[1]===Y[1]&&R[2]===Y[2]&&R[3]===Y[3];}function B(R,Y){var V=R[0],Q=R[1],et=R[2],it=R[3],$=Y[0],K=Y[1],rt=Y[2],lt=Y[3];return Math.abs(V-$)<=r.EPSILON*Math.max(1,Math.abs(V),Math.abs($))&&Math.abs(Q-K)<=r.EPSILON*Math.max(1,Math.abs(Q),Math.abs(K))&&Math.abs(et-rt)<=r.EPSILON*Math.max(1,Math.abs(et),Math.abs(rt))&&Math.abs(it-lt)<=r.EPSILON*Math.max(1,Math.abs(it),Math.abs(lt));}function E(R,Y,V){return R[0]=Y[0]*V,R[1]=Y[1]*V,R[2]=Y[2]*V,R[3]=Y[3]*V,R;}function b(R,Y,V,Q){return R[0]=Y[0]+V[0]*Q,R[1]=Y[1]+V[1]*Q,R[2]=Y[2]+V[2]*Q,R[3]=Y[3]+V[3]*Q,R;}var W=M,D=L;},/* 4 *//***/function(u,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 l;}),t.d(e,"identity",function(){return o;}),t.d(e,"fromValues",function(){return a;}),t.d(e,"set",function(){return c;}),t.d(e,"invert",function(){return y;}),t.d(e,"determinant",function(){return f;}),t.d(e,"multiply",function(){return g;}),t.d(e,"rotate",function(){return x;}),t.d(e,"scale",function(){return M;}),t.d(e,"translate",function(){return S;}),t.d(e,"fromRotation",function(){return P;}),t.d(e,"fromScaling",function(){return C;}),t.d(e,"fromTranslation",function(){return h;}),t.d(e,"str",function(){return p;}),t.d(e,"frob",function(){return d;}),t.d(e,"add",function(){return v;}),t.d(e,"subtract",function(){return I;}),t.d(e,"multiplyScalar",function(){return L;}),t.d(e,"multiplyScalarAndAdd",function(){return w;}),t.d(e,"exactEquals",function(){return B;}),t.d(e,"equals",function(){return E;}),t.d(e,"mul",function(){return b;}),t.d(e,"sub",function(){return W;});var r=t(2);function n(){var D=new r.ARRAY_TYPE(6);return r.ARRAY_TYPE!=Float32Array&&(D[1]=0,D[2]=0,D[4]=0,D[5]=0),D[0]=1,D[3]=1,D;}function s(D){var R=new r.ARRAY_TYPE(6);return R[0]=D[0],R[1]=D[1],R[2]=D[2],R[3]=D[3],R[4]=D[4],R[5]=D[5],R;}function l(D,R){return D[0]=R[0],D[1]=R[1],D[2]=R[2],D[3]=R[3],D[4]=R[4],D[5]=R[5],D;}function o(D){return D[0]=1,D[1]=0,D[2]=0,D[3]=1,D[4]=0,D[5]=0,D;}function a(D,R,Y,V,Q,et){var it=new r.ARRAY_TYPE(6);return it[0]=D,it[1]=R,it[2]=Y,it[3]=V,it[4]=Q,it[5]=et,it;}function c(D,R,Y,V,Q,et,it){return D[0]=R,D[1]=Y,D[2]=V,D[3]=Q,D[4]=et,D[5]=it,D;}function y(D,R){var Y=R[0],V=R[1],Q=R[2],et=R[3],it=R[4],$=R[5],K=Y*et-V*Q;return K?(K=1/K,D[0]=et*K,D[1]=-V*K,D[2]=-Q*K,D[3]=Y*K,D[4]=(Q*$-et*it)*K,D[5]=(V*it-Y*$)*K,D):null;}function f(D){return D[0]*D[3]-D[1]*D[2];}function g(D,R,Y){var V=R[0],Q=R[1],et=R[2],it=R[3],$=R[4],K=R[5],rt=Y[0],lt=Y[1],ct=Y[2],gt=Y[3],st=Y[4],Ot=Y[5];return D[0]=V*rt+et*lt,D[1]=Q*rt+it*lt,D[2]=V*ct+et*gt,D[3]=Q*ct+it*gt,D[4]=V*st+et*Ot+$,D[5]=Q*st+it*Ot+K,D;}function x(D,R,Y){var V=R[0],Q=R[1],et=R[2],it=R[3],$=R[4],K=R[5],rt=Math.sin(Y),lt=Math.cos(Y);return D[0]=V*lt+et*rt,D[1]=Q*lt+it*rt,D[2]=V*-rt+et*lt,D[3]=Q*-rt+it*lt,D[4]=$,D[5]=K,D;}function M(D,R,Y){var V=R[0],Q=R[1],et=R[2],it=R[3],$=R[4],K=R[5],rt=Y[0],lt=Y[1];return D[0]=V*rt,D[1]=Q*rt,D[2]=et*lt,D[3]=it*lt,D[4]=$,D[5]=K,D;}function S(D,R,Y){var V=R[0],Q=R[1],et=R[2],it=R[3],$=R[4],K=R[5],rt=Y[0],lt=Y[1];return D[0]=V,D[1]=Q,D[2]=et,D[3]=it,D[4]=V*rt+et*lt+$,D[5]=Q*rt+it*lt+K,D;}function P(D,R){var Y=Math.sin(R),V=Math.cos(R);return D[0]=V,D[1]=Y,D[2]=-Y,D[3]=V,D[4]=0,D[5]=0,D;}function C(D,R){return D[0]=R[0],D[1]=0,D[2]=0,D[3]=R[1],D[4]=0,D[5]=0,D;}function h(D,R){return D[0]=1,D[1]=0,D[2]=0,D[3]=1,D[4]=R[0],D[5]=R[1],D;}function p(D){return"mat2d("+D[0]+", "+D[1]+", "+D[2]+", "+D[3]+", "+D[4]+", "+D[5]+")";}function d(D){return Math.hypot(D[0],D[1],D[2],D[3],D[4],D[5],1);}function v(D,R,Y){return D[0]=R[0]+Y[0],D[1]=R[1]+Y[1],D[2]=R[2]+Y[2],D[3]=R[3]+Y[3],D[4]=R[4]+Y[4],D[5]=R[5]+Y[5],D;}function I(D,R,Y){return D[0]=R[0]-Y[0],D[1]=R[1]-Y[1],D[2]=R[2]-Y[2],D[3]=R[3]-Y[3],D[4]=R[4]-Y[4],D[5]=R[5]-Y[5],D;}function L(D,R,Y){return D[0]=R[0]*Y,D[1]=R[1]*Y,D[2]=R[2]*Y,D[3]=R[3]*Y,D[4]=R[4]*Y,D[5]=R[5]*Y,D;}function w(D,R,Y,V){return D[0]=R[0]+Y[0]*V,D[1]=R[1]+Y[1]*V,D[2]=R[2]+Y[2]*V,D[3]=R[3]+Y[3]*V,D[4]=R[4]+Y[4]*V,D[5]=R[5]+Y[5]*V,D;}function B(D,R){return D[0]===R[0]&&D[1]===R[1]&&D[2]===R[2]&&D[3]===R[3]&&D[4]===R[4]&&D[5]===R[5];}function E(D,R){var Y=D[0],V=D[1],Q=D[2],et=D[3],it=D[4],$=D[5],K=R[0],rt=R[1],lt=R[2],ct=R[3],gt=R[4],st=R[5];return Math.abs(Y-K)<=r.EPSILON*Math.max(1,Math.abs(Y),Math.abs(K))&&Math.abs(V-rt)<=r.EPSILON*Math.max(1,Math.abs(V),Math.abs(rt))&&Math.abs(Q-lt)<=r.EPSILON*Math.max(1,Math.abs(Q),Math.abs(lt))&&Math.abs(et-ct)<=r.EPSILON*Math.max(1,Math.abs(et),Math.abs(ct))&&Math.abs(it-gt)<=r.EPSILON*Math.max(1,Math.abs(it),Math.abs(gt))&&Math.abs($-st)<=r.EPSILON*Math.max(1,Math.abs($),Math.abs(st));}var b=g,W=I;},/* 5 *//***/function(u,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 l;}),t.d(e,"copy",function(){return o;}),t.d(e,"fromValues",function(){return a;}),t.d(e,"set",function(){return c;}),t.d(e,"identity",function(){return y;}),t.d(e,"transpose",function(){return f;}),t.d(e,"invert",function(){return g;}),t.d(e,"adjoint",function(){return x;}),t.d(e,"determinant",function(){return M;}),t.d(e,"multiply",function(){return S;}),t.d(e,"translate",function(){return P;}),t.d(e,"rotate",function(){return C;}),t.d(e,"scale",function(){return h;}),t.d(e,"fromTranslation",function(){return p;}),t.d(e,"fromRotation",function(){return d;}),t.d(e,"fromScaling",function(){return v;}),t.d(e,"fromMat2d",function(){return I;}),t.d(e,"fromQuat",function(){return L;}),t.d(e,"normalFromMat4",function(){return w;}),t.d(e,"projection",function(){return B;}),t.d(e,"str",function(){return E;}),t.d(e,"frob",function(){return b;}),t.d(e,"add",function(){return W;}),t.d(e,"subtract",function(){return D;}),t.d(e,"multiplyScalar",function(){return R;}),t.d(e,"multiplyScalarAndAdd",function(){return Y;}),t.d(e,"exactEquals",function(){return V;}),t.d(e,"equals",function(){return Q;}),t.d(e,"mul",function(){return et;}),t.d(e,"sub",function(){return it;});var r=t(2);function n(){var $=new r.ARRAY_TYPE(9);return r.ARRAY_TYPE!=Float32Array&&($[1]=0,$[2]=0,$[3]=0,$[5]=0,$[6]=0,$[7]=0),$[0]=1,$[4]=1,$[8]=1,$;}function s($,K){return $[0]=K[0],$[1]=K[1],$[2]=K[2],$[3]=K[4],$[4]=K[5],$[5]=K[6],$[6]=K[8],$[7]=K[9],$[8]=K[10],$;}function l($){var K=new r.ARRAY_TYPE(9);return K[0]=$[0],K[1]=$[1],K[2]=$[2],K[3]=$[3],K[4]=$[4],K[5]=$[5],K[6]=$[6],K[7]=$[7],K[8]=$[8],K;}function o($,K){return $[0]=K[0],$[1]=K[1],$[2]=K[2],$[3]=K[3],$[4]=K[4],$[5]=K[5],$[6]=K[6],$[7]=K[7],$[8]=K[8],$;}function a($,K,rt,lt,ct,gt,st,Ot,St){var F=new r.ARRAY_TYPE(9);return F[0]=$,F[1]=K,F[2]=rt,F[3]=lt,F[4]=ct,F[5]=gt,F[6]=st,F[7]=Ot,F[8]=St,F;}function c($,K,rt,lt,ct,gt,st,Ot,St,F){return $[0]=K,$[1]=rt,$[2]=lt,$[3]=ct,$[4]=gt,$[5]=st,$[6]=Ot,$[7]=St,$[8]=F,$;}function y($){return $[0]=1,$[1]=0,$[2]=0,$[3]=0,$[4]=1,$[5]=0,$[6]=0,$[7]=0,$[8]=1,$;}function f($,K){if($===K){var rt=K[1],lt=K[2],ct=K[5];$[1]=K[3],$[2]=K[6],$[3]=rt,$[5]=K[7],$[6]=lt,$[7]=ct;}else $[0]=K[0],$[1]=K[3],$[2]=K[6],$[3]=K[1],$[4]=K[4],$[5]=K[7],$[6]=K[2],$[7]=K[5],$[8]=K[8];return $;}function g($,K){var rt=K[0],lt=K[1],ct=K[2],gt=K[3],st=K[4],Ot=K[5],St=K[6],F=K[7],z=K[8],Z=z*st-Ot*F,tt=-z*gt+Ot*St,j=F*gt-st*St,H=rt*Z+lt*tt+ct*j;return H?(H=1/H,$[0]=Z*H,$[1]=(-z*lt+ct*F)*H,$[2]=(Ot*lt-ct*st)*H,$[3]=tt*H,$[4]=(z*rt-ct*St)*H,$[5]=(-Ot*rt+ct*gt)*H,$[6]=j*H,$[7]=(-F*rt+lt*St)*H,$[8]=(st*rt-lt*gt)*H,$):null;}function x($,K){var rt=K[0],lt=K[1],ct=K[2],gt=K[3],st=K[4],Ot=K[5],St=K[6],F=K[7],z=K[8];return $[0]=st*z-Ot*F,$[1]=ct*F-lt*z,$[2]=lt*Ot-ct*st,$[3]=Ot*St-gt*z,$[4]=rt*z-ct*St,$[5]=ct*gt-rt*Ot,$[6]=gt*F-st*St,$[7]=lt*St-rt*F,$[8]=rt*st-lt*gt,$;}function M($){var K=$[0],rt=$[1],lt=$[2],ct=$[3],gt=$[4],st=$[5],Ot=$[6],St=$[7],F=$[8];return K*(F*gt-st*St)+rt*(-F*ct+st*Ot)+lt*(St*ct-gt*Ot);}function S($,K,rt){var lt=K[0],ct=K[1],gt=K[2],st=K[3],Ot=K[4],St=K[5],F=K[6],z=K[7],Z=K[8],tt=rt[0],j=rt[1],H=rt[2],T=rt[3],A=rt[4],U=rt[5],G=rt[6],J=rt[7],q=rt[8];return $[0]=tt*lt+j*st+H*F,$[1]=tt*ct+j*Ot+H*z,$[2]=tt*gt+j*St+H*Z,$[3]=T*lt+A*st+U*F,$[4]=T*ct+A*Ot+U*z,$[5]=T*gt+A*St+U*Z,$[6]=G*lt+J*st+q*F,$[7]=G*ct+J*Ot+q*z,$[8]=G*gt+J*St+q*Z,$;}function P($,K,rt){var lt=K[0],ct=K[1],gt=K[2],st=K[3],Ot=K[4],St=K[5],F=K[6],z=K[7],Z=K[8],tt=rt[0],j=rt[1];return $[0]=lt,$[1]=ct,$[2]=gt,$[3]=st,$[4]=Ot,$[5]=St,$[6]=tt*lt+j*st+F,$[7]=tt*ct+j*Ot+z,$[8]=tt*gt+j*St+Z,$;}function C($,K,rt){var lt=K[0],ct=K[1],gt=K[2],st=K[3],Ot=K[4],St=K[5],F=K[6],z=K[7],Z=K[8],tt=Math.sin(rt),j=Math.cos(rt);return $[0]=j*lt+tt*st,$[1]=j*ct+tt*Ot,$[2]=j*gt+tt*St,$[3]=j*st-tt*lt,$[4]=j*Ot-tt*ct,$[5]=j*St-tt*gt,$[6]=F,$[7]=z,$[8]=Z,$;}function h($,K,rt){var lt=rt[0],ct=rt[1];return $[0]=lt*K[0],$[1]=lt*K[1],$[2]=lt*K[2],$[3]=ct*K[3],$[4]=ct*K[4],$[5]=ct*K[5],$[6]=K[6],$[7]=K[7],$[8]=K[8],$;}function p($,K){return $[0]=1,$[1]=0,$[2]=0,$[3]=0,$[4]=1,$[5]=0,$[6]=K[0],$[7]=K[1],$[8]=1,$;}function d($,K){var rt=Math.sin(K),lt=Math.cos(K);return $[0]=lt,$[1]=rt,$[2]=0,$[3]=-rt,$[4]=lt,$[5]=0,$[6]=0,$[7]=0,$[8]=1,$;}function v($,K){return $[0]=K[0],$[1]=0,$[2]=0,$[3]=0,$[4]=K[1],$[5]=0,$[6]=0,$[7]=0,$[8]=1,$;}function I($,K){return $[0]=K[0],$[1]=K[1],$[2]=0,$[3]=K[2],$[4]=K[3],$[5]=0,$[6]=K[4],$[7]=K[5],$[8]=1,$;}function L($,K){var rt=K[0],lt=K[1],ct=K[2],gt=K[3],st=rt+rt,Ot=lt+lt,St=ct+ct,F=rt*st,z=lt*st,Z=lt*Ot,tt=ct*st,j=ct*Ot,H=ct*St,T=gt*st,A=gt*Ot,U=gt*St;return $[0]=1-Z-H,$[3]=z-U,$[6]=tt+A,$[1]=z+U,$[4]=1-F-H,$[7]=j-T,$[2]=tt-A,$[5]=j+T,$[8]=1-F-Z,$;}function w($,K){var rt=K[0],lt=K[1],ct=K[2],gt=K[3],st=K[4],Ot=K[5],St=K[6],F=K[7],z=K[8],Z=K[9],tt=K[10],j=K[11],H=K[12],T=K[13],A=K[14],U=K[15],G=rt*Ot-lt*st,J=rt*St-ct*st,q=rt*F-gt*st,nt=lt*St-ct*Ot,ut=lt*F-gt*Ot,pt=ct*F-gt*St,yt=z*T-Z*H,Tt=z*A-tt*H,vt=z*U-j*H,mt=Z*A-tt*T,Pt=Z*U-j*T,Mt=tt*U-j*A,At=G*Mt-J*Pt+q*mt+nt*vt-ut*Tt+pt*yt;return At?(At=1/At,$[0]=(Ot*Mt-St*Pt+F*mt)*At,$[1]=(St*vt-st*Mt-F*Tt)*At,$[2]=(st*Pt-Ot*vt+F*yt)*At,$[3]=(ct*Pt-lt*Mt-gt*mt)*At,$[4]=(rt*Mt-ct*vt+gt*Tt)*At,$[5]=(lt*vt-rt*Pt-gt*yt)*At,$[6]=(T*pt-A*ut+U*nt)*At,$[7]=(A*q-H*pt-U*J)*At,$[8]=(H*ut-T*q+U*G)*At,$):null;}function B($,K,rt){return $[0]=2/K,$[1]=0,$[2]=0,$[3]=0,$[4]=-2/rt,$[5]=0,$[6]=-1,$[7]=1,$[8]=1,$;}function E($){return"mat3("+$[0]+", "+$[1]+", "+$[2]+", "+$[3]+", "+$[4]+", "+$[5]+", "+$[6]+", "+$[7]+", "+$[8]+")";}function b($){return Math.hypot($[0],$[1],$[2],$[3],$[4],$[5],$[6],$[7],$[8]);}function W($,K,rt){return $[0]=K[0]+rt[0],$[1]=K[1]+rt[1],$[2]=K[2]+rt[2],$[3]=K[3]+rt[3],$[4]=K[4]+rt[4],$[5]=K[5]+rt[5],$[6]=K[6]+rt[6],$[7]=K[7]+rt[7],$[8]=K[8]+rt[8],$;}function D($,K,rt){return $[0]=K[0]-rt[0],$[1]=K[1]-rt[1],$[2]=K[2]-rt[2],$[3]=K[3]-rt[3],$[4]=K[4]-rt[4],$[5]=K[5]-rt[5],$[6]=K[6]-rt[6],$[7]=K[7]-rt[7],$[8]=K[8]-rt[8],$;}function R($,K,rt){return $[0]=K[0]*rt,$[1]=K[1]*rt,$[2]=K[2]*rt,$[3]=K[3]*rt,$[4]=K[4]*rt,$[5]=K[5]*rt,$[6]=K[6]*rt,$[7]=K[7]*rt,$[8]=K[8]*rt,$;}function Y($,K,rt,lt){return $[0]=K[0]+rt[0]*lt,$[1]=K[1]+rt[1]*lt,$[2]=K[2]+rt[2]*lt,$[3]=K[3]+rt[3]*lt,$[4]=K[4]+rt[4]*lt,$[5]=K[5]+rt[5]*lt,$[6]=K[6]+rt[6]*lt,$[7]=K[7]+rt[7]*lt,$[8]=K[8]+rt[8]*lt,$;}function V($,K){return $[0]===K[0]&&$[1]===K[1]&&$[2]===K[2]&&$[3]===K[3]&&$[4]===K[4]&&$[5]===K[5]&&$[6]===K[6]&&$[7]===K[7]&&$[8]===K[8];}function Q($,K){var rt=$[0],lt=$[1],ct=$[2],gt=$[3],st=$[4],Ot=$[5],St=$[6],F=$[7],z=$[8],Z=K[0],tt=K[1],j=K[2],H=K[3],T=K[4],A=K[5],U=K[6],G=K[7],J=K[8];return Math.abs(rt-Z)<=r.EPSILON*Math.max(1,Math.abs(rt),Math.abs(Z))&&Math.abs(lt-tt)<=r.EPSILON*Math.max(1,Math.abs(lt),Math.abs(tt))&&Math.abs(ct-j)<=r.EPSILON*Math.max(1,Math.abs(ct),Math.abs(j))&&Math.abs(gt-H)<=r.EPSILON*Math.max(1,Math.abs(gt),Math.abs(H))&&Math.abs(st-T)<=r.EPSILON*Math.max(1,Math.abs(st),Math.abs(T))&&Math.abs(Ot-A)<=r.EPSILON*Math.max(1,Math.abs(Ot),Math.abs(A))&&Math.abs(St-U)<=r.EPSILON*Math.max(1,Math.abs(St),Math.abs(U))&&Math.abs(F-G)<=r.EPSILON*Math.max(1,Math.abs(F),Math.abs(G))&&Math.abs(z-J)<=r.EPSILON*Math.max(1,Math.abs(z),Math.abs(J));}var et=S,it=D;},/* 6 *//***/function(u,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 l;}),t.d(e,"fromValues",function(){return o;}),t.d(e,"set",function(){return a;}),t.d(e,"identity",function(){return c;}),t.d(e,"transpose",function(){return y;}),t.d(e,"invert",function(){return f;}),t.d(e,"adjoint",function(){return g;}),t.d(e,"determinant",function(){return x;}),t.d(e,"multiply",function(){return M;}),t.d(e,"translate",function(){return S;}),t.d(e,"scale",function(){return P;}),t.d(e,"rotate",function(){return C;}),t.d(e,"rotateX",function(){return h;}),t.d(e,"rotateY",function(){return p;}),t.d(e,"rotateZ",function(){return d;}),t.d(e,"fromTranslation",function(){return v;}),t.d(e,"fromScaling",function(){return I;}),t.d(e,"fromRotation",function(){return L;}),t.d(e,"fromXRotation",function(){return w;}),t.d(e,"fromYRotation",function(){return B;}),t.d(e,"fromZRotation",function(){return E;}),t.d(e,"fromRotationTranslation",function(){return b;}),t.d(e,"fromQuat2",function(){return W;}),t.d(e,"getTranslation",function(){return D;}),t.d(e,"getScaling",function(){return R;}),t.d(e,"getRotation",function(){return Y;}),t.d(e,"fromRotationTranslationScale",function(){return V;}),t.d(e,"fromRotationTranslationScaleOrigin",function(){return Q;}),t.d(e,"fromQuat",function(){return et;}),t.d(e,"frustum",function(){return it;}),t.d(e,"perspective",function(){return $;}),t.d(e,"perspectiveFromFieldOfView",function(){return K;}),t.d(e,"ortho",function(){return rt;}),t.d(e,"lookAt",function(){return lt;}),t.d(e,"targetTo",function(){return ct;}),t.d(e,"str",function(){return gt;}),t.d(e,"frob",function(){return st;}),t.d(e,"add",function(){return Ot;}),t.d(e,"subtract",function(){return St;}),t.d(e,"multiplyScalar",function(){return F;}),t.d(e,"multiplyScalarAndAdd",function(){return z;}),t.d(e,"exactEquals",function(){return Z;}),t.d(e,"equals",function(){return tt;}),t.d(e,"mul",function(){return j;}),t.d(e,"sub",function(){return H;});var r=t(2);function n(){var T=new r.ARRAY_TYPE(16);return r.ARRAY_TYPE!=Float32Array&&(T[1]=0,T[2]=0,T[3]=0,T[4]=0,T[6]=0,T[7]=0,T[8]=0,T[9]=0,T[11]=0,T[12]=0,T[13]=0,T[14]=0),T[0]=1,T[5]=1,T[10]=1,T[15]=1,T;}function s(T){var A=new r.ARRAY_TYPE(16);return A[0]=T[0],A[1]=T[1],A[2]=T[2],A[3]=T[3],A[4]=T[4],A[5]=T[5],A[6]=T[6],A[7]=T[7],A[8]=T[8],A[9]=T[9],A[10]=T[10],A[11]=T[11],A[12]=T[12],A[13]=T[13],A[14]=T[14],A[15]=T[15],A;}function l(T,A){return T[0]=A[0],T[1]=A[1],T[2]=A[2],T[3]=A[3],T[4]=A[4],T[5]=A[5],T[6]=A[6],T[7]=A[7],T[8]=A[8],T[9]=A[9],T[10]=A[10],T[11]=A[11],T[12]=A[12],T[13]=A[13],T[14]=A[14],T[15]=A[15],T;}function o(T,A,U,G,J,q,nt,ut,pt,yt,Tt,vt,mt,Pt,Mt,At){var It=new r.ARRAY_TYPE(16);return It[0]=T,It[1]=A,It[2]=U,It[3]=G,It[4]=J,It[5]=q,It[6]=nt,It[7]=ut,It[8]=pt,It[9]=yt,It[10]=Tt,It[11]=vt,It[12]=mt,It[13]=Pt,It[14]=Mt,It[15]=At,It;}function a(T,A,U,G,J,q,nt,ut,pt,yt,Tt,vt,mt,Pt,Mt,At,It){return T[0]=A,T[1]=U,T[2]=G,T[3]=J,T[4]=q,T[5]=nt,T[6]=ut,T[7]=pt,T[8]=yt,T[9]=Tt,T[10]=vt,T[11]=mt,T[12]=Pt,T[13]=Mt,T[14]=At,T[15]=It,T;}function c(T){return T[0]=1,T[1]=0,T[2]=0,T[3]=0,T[4]=0,T[5]=1,T[6]=0,T[7]=0,T[8]=0,T[9]=0,T[10]=1,T[11]=0,T[12]=0,T[13]=0,T[14]=0,T[15]=1,T;}function y(T,A){if(T===A){var U=A[1],G=A[2],J=A[3],q=A[6],nt=A[7],ut=A[11];T[1]=A[4],T[2]=A[8],T[3]=A[12],T[4]=U,T[6]=A[9],T[7]=A[13],T[8]=G,T[9]=q,T[11]=A[14],T[12]=J,T[13]=nt,T[14]=ut;}else T[0]=A[0],T[1]=A[4],T[2]=A[8],T[3]=A[12],T[4]=A[1],T[5]=A[5],T[6]=A[9],T[7]=A[13],T[8]=A[2],T[9]=A[6],T[10]=A[10],T[11]=A[14],T[12]=A[3],T[13]=A[7],T[14]=A[11],T[15]=A[15];return T;}function f(T,A){var U=A[0],G=A[1],J=A[2],q=A[3],nt=A[4],ut=A[5],pt=A[6],yt=A[7],Tt=A[8],vt=A[9],mt=A[10],Pt=A[11],Mt=A[12],At=A[13],It=A[14],Nt=A[15],$t=U*ut-G*nt,jt=U*pt-J*nt,Ut=U*yt-q*nt,zt=G*pt-J*ut,Xt=G*yt-q*ut,ae=J*yt-q*pt,ie=Tt*At-vt*Mt,se=Tt*It-mt*Mt,oe=Tt*Nt-Pt*Mt,le=vt*It-mt*At,ce=vt*Nt-Pt*At,fe=mt*Nt-Pt*It,Zt=$t*fe-jt*ce+Ut*le+zt*oe-Xt*se+ae*ie;return Zt?(Zt=1/Zt,T[0]=(ut*fe-pt*ce+yt*le)*Zt,T[1]=(J*ce-G*fe-q*le)*Zt,T[2]=(At*ae-It*Xt+Nt*zt)*Zt,T[3]=(mt*Xt-vt*ae-Pt*zt)*Zt,T[4]=(pt*oe-nt*fe-yt*se)*Zt,T[5]=(U*fe-J*oe+q*se)*Zt,T[6]=(It*Ut-Mt*ae-Nt*jt)*Zt,T[7]=(Tt*ae-mt*Ut+Pt*jt)*Zt,T[8]=(nt*ce-ut*oe+yt*ie)*Zt,T[9]=(G*oe-U*ce-q*ie)*Zt,T[10]=(Mt*Xt-At*Ut+Nt*$t)*Zt,T[11]=(vt*Ut-Tt*Xt-Pt*$t)*Zt,T[12]=(ut*se-nt*le-pt*ie)*Zt,T[13]=(U*le-G*se+J*ie)*Zt,T[14]=(At*jt-Mt*zt-It*$t)*Zt,T[15]=(Tt*zt-vt*jt+mt*$t)*Zt,T):null;}function g(T,A){var U=A[0],G=A[1],J=A[2],q=A[3],nt=A[4],ut=A[5],pt=A[6],yt=A[7],Tt=A[8],vt=A[9],mt=A[10],Pt=A[11],Mt=A[12],At=A[13],It=A[14],Nt=A[15];return T[0]=ut*(mt*Nt-Pt*It)-vt*(pt*Nt-yt*It)+At*(pt*Pt-yt*mt),T[1]=-(G*(mt*Nt-Pt*It)-vt*(J*Nt-q*It)+At*(J*Pt-q*mt)),T[2]=G*(pt*Nt-yt*It)-ut*(J*Nt-q*It)+At*(J*yt-q*pt),T[3]=-(G*(pt*Pt-yt*mt)-ut*(J*Pt-q*mt)+vt*(J*yt-q*pt)),T[4]=-(nt*(mt*Nt-Pt*It)-Tt*(pt*Nt-yt*It)+Mt*(pt*Pt-yt*mt)),T[5]=U*(mt*Nt-Pt*It)-Tt*(J*Nt-q*It)+Mt*(J*Pt-q*mt),T[6]=-(U*(pt*Nt-yt*It)-nt*(J*Nt-q*It)+Mt*(J*yt-q*pt)),T[7]=U*(pt*Pt-yt*mt)-nt*(J*Pt-q*mt)+Tt*(J*yt-q*pt),T[8]=nt*(vt*Nt-Pt*At)-Tt*(ut*Nt-yt*At)+Mt*(ut*Pt-yt*vt),T[9]=-(U*(vt*Nt-Pt*At)-Tt*(G*Nt-q*At)+Mt*(G*Pt-q*vt)),T[10]=U*(ut*Nt-yt*At)-nt*(G*Nt-q*At)+Mt*(G*yt-q*ut),T[11]=-(U*(ut*Pt-yt*vt)-nt*(G*Pt-q*vt)+Tt*(G*yt-q*ut)),T[12]=-(nt*(vt*It-mt*At)-Tt*(ut*It-pt*At)+Mt*(ut*mt-pt*vt)),T[13]=U*(vt*It-mt*At)-Tt*(G*It-J*At)+Mt*(G*mt-J*vt),T[14]=-(U*(ut*It-pt*At)-nt*(G*It-J*At)+Mt*(G*pt-J*ut)),T[15]=U*(ut*mt-pt*vt)-nt*(G*mt-J*vt)+Tt*(G*pt-J*ut),T;}function x(T){var A=T[0],U=T[1],G=T[2],J=T[3],q=T[4],nt=T[5],ut=T[6],pt=T[7],yt=T[8],Tt=T[9],vt=T[10],mt=T[11],Pt=T[12],Mt=T[13],At=T[14],It=T[15],Nt=A*nt-U*q,$t=A*ut-G*q,jt=A*pt-J*q,Ut=U*ut-G*nt,zt=U*pt-J*nt,Xt=G*pt-J*ut,ae=yt*Mt-Tt*Pt,ie=yt*At-vt*Pt,se=yt*It-mt*Pt,oe=Tt*At-vt*Mt,le=Tt*It-mt*Mt,ce=vt*It-mt*At;return Nt*ce-$t*le+jt*oe+Ut*se-zt*ie+Xt*ae;}function M(T,A,U){var G=A[0],J=A[1],q=A[2],nt=A[3],ut=A[4],pt=A[5],yt=A[6],Tt=A[7],vt=A[8],mt=A[9],Pt=A[10],Mt=A[11],At=A[12],It=A[13],Nt=A[14],$t=A[15],jt=U[0],Ut=U[1],zt=U[2],Xt=U[3];return T[0]=jt*G+Ut*ut+zt*vt+Xt*At,T[1]=jt*J+Ut*pt+zt*mt+Xt*It,T[2]=jt*q+Ut*yt+zt*Pt+Xt*Nt,T[3]=jt*nt+Ut*Tt+zt*Mt+Xt*$t,jt=U[4],Ut=U[5],zt=U[6],Xt=U[7],T[4]=jt*G+Ut*ut+zt*vt+Xt*At,T[5]=jt*J+Ut*pt+zt*mt+Xt*It,T[6]=jt*q+Ut*yt+zt*Pt+Xt*Nt,T[7]=jt*nt+Ut*Tt+zt*Mt+Xt*$t,jt=U[8],Ut=U[9],zt=U[10],Xt=U[11],T[8]=jt*G+Ut*ut+zt*vt+Xt*At,T[9]=jt*J+Ut*pt+zt*mt+Xt*It,T[10]=jt*q+Ut*yt+zt*Pt+Xt*Nt,T[11]=jt*nt+Ut*Tt+zt*Mt+Xt*$t,jt=U[12],Ut=U[13],zt=U[14],Xt=U[15],T[12]=jt*G+Ut*ut+zt*vt+Xt*At,T[13]=jt*J+Ut*pt+zt*mt+Xt*It,T[14]=jt*q+Ut*yt+zt*Pt+Xt*Nt,T[15]=jt*nt+Ut*Tt+zt*Mt+Xt*$t,T;}function S(T,A,U){var G=U[0],J=U[1],q=U[2],nt,ut,pt,yt,Tt,vt,mt,Pt,Mt,At,It,Nt;return A===T?(T[12]=A[0]*G+A[4]*J+A[8]*q+A[12],T[13]=A[1]*G+A[5]*J+A[9]*q+A[13],T[14]=A[2]*G+A[6]*J+A[10]*q+A[14],T[15]=A[3]*G+A[7]*J+A[11]*q+A[15]):(nt=A[0],ut=A[1],pt=A[2],yt=A[3],Tt=A[4],vt=A[5],mt=A[6],Pt=A[7],Mt=A[8],At=A[9],It=A[10],Nt=A[11],T[0]=nt,T[1]=ut,T[2]=pt,T[3]=yt,T[4]=Tt,T[5]=vt,T[6]=mt,T[7]=Pt,T[8]=Mt,T[9]=At,T[10]=It,T[11]=Nt,T[12]=nt*G+Tt*J+Mt*q+A[12],T[13]=ut*G+vt*J+At*q+A[13],T[14]=pt*G+mt*J+It*q+A[14],T[15]=yt*G+Pt*J+Nt*q+A[15]),T;}function P(T,A,U){var G=U[0],J=U[1],q=U[2];return T[0]=A[0]*G,T[1]=A[1]*G,T[2]=A[2]*G,T[3]=A[3]*G,T[4]=A[4]*J,T[5]=A[5]*J,T[6]=A[6]*J,T[7]=A[7]*J,T[8]=A[8]*q,T[9]=A[9]*q,T[10]=A[10]*q,T[11]=A[11]*q,T[12]=A[12],T[13]=A[13],T[14]=A[14],T[15]=A[15],T;}function C(T,A,U,G){var J=G[0],q=G[1],nt=G[2],ut=Math.hypot(J,q,nt),pt,yt,Tt,vt,mt,Pt,Mt,At,It,Nt,$t,jt,Ut,zt,Xt,ae,ie,se,oe,le,ce,fe,Zt,Pe;return ut<r.EPSILON?null:(ut=1/ut,J*=ut,q*=ut,nt*=ut,pt=Math.sin(U),yt=Math.cos(U),Tt=1-yt,vt=A[0],mt=A[1],Pt=A[2],Mt=A[3],At=A[4],It=A[5],Nt=A[6],$t=A[7],jt=A[8],Ut=A[9],zt=A[10],Xt=A[11],ae=J*J*Tt+yt,ie=q*J*Tt+nt*pt,se=nt*J*Tt-q*pt,oe=J*q*Tt-nt*pt,le=q*q*Tt+yt,ce=nt*q*Tt+J*pt,fe=J*nt*Tt+q*pt,Zt=q*nt*Tt-J*pt,Pe=nt*nt*Tt+yt,T[0]=vt*ae+At*ie+jt*se,T[1]=mt*ae+It*ie+Ut*se,T[2]=Pt*ae+Nt*ie+zt*se,T[3]=Mt*ae+$t*ie+Xt*se,T[4]=vt*oe+At*le+jt*ce,T[5]=mt*oe+It*le+Ut*ce,T[6]=Pt*oe+Nt*le+zt*ce,T[7]=Mt*oe+$t*le+Xt*ce,T[8]=vt*fe+At*Zt+jt*Pe,T[9]=mt*fe+It*Zt+Ut*Pe,T[10]=Pt*fe+Nt*Zt+zt*Pe,T[11]=Mt*fe+$t*Zt+Xt*Pe,A!==T&&(T[12]=A[12],T[13]=A[13],T[14]=A[14],T[15]=A[15]),T);}function h(T,A,U){var G=Math.sin(U),J=Math.cos(U),q=A[4],nt=A[5],ut=A[6],pt=A[7],yt=A[8],Tt=A[9],vt=A[10],mt=A[11];return A!==T&&(T[0]=A[0],T[1]=A[1],T[2]=A[2],T[3]=A[3],T[12]=A[12],T[13]=A[13],T[14]=A[14],T[15]=A[15]),T[4]=q*J+yt*G,T[5]=nt*J+Tt*G,T[6]=ut*J+vt*G,T[7]=pt*J+mt*G,T[8]=yt*J-q*G,T[9]=Tt*J-nt*G,T[10]=vt*J-ut*G,T[11]=mt*J-pt*G,T;}function p(T,A,U){var G=Math.sin(U),J=Math.cos(U),q=A[0],nt=A[1],ut=A[2],pt=A[3],yt=A[8],Tt=A[9],vt=A[10],mt=A[11];return A!==T&&(T[4]=A[4],T[5]=A[5],T[6]=A[6],T[7]=A[7],T[12]=A[12],T[13]=A[13],T[14]=A[14],T[15]=A[15]),T[0]=q*J-yt*G,T[1]=nt*J-Tt*G,T[2]=ut*J-vt*G,T[3]=pt*J-mt*G,T[8]=q*G+yt*J,T[9]=nt*G+Tt*J,T[10]=ut*G+vt*J,T[11]=pt*G+mt*J,T;}function d(T,A,U){var G=Math.sin(U),J=Math.cos(U),q=A[0],nt=A[1],ut=A[2],pt=A[3],yt=A[4],Tt=A[5],vt=A[6],mt=A[7];return A!==T&&(T[8]=A[8],T[9]=A[9],T[10]=A[10],T[11]=A[11],T[12]=A[12],T[13]=A[13],T[14]=A[14],T[15]=A[15]),T[0]=q*J+yt*G,T[1]=nt*J+Tt*G,T[2]=ut*J+vt*G,T[3]=pt*J+mt*G,T[4]=yt*J-q*G,T[5]=Tt*J-nt*G,T[6]=vt*J-ut*G,T[7]=mt*J-pt*G,T;}function v(T,A){return T[0]=1,T[1]=0,T[2]=0,T[3]=0,T[4]=0,T[5]=1,T[6]=0,T[7]=0,T[8]=0,T[9]=0,T[10]=1,T[11]=0,T[12]=A[0],T[13]=A[1],T[14]=A[2],T[15]=1,T;}function I(T,A){return T[0]=A[0],T[1]=0,T[2]=0,T[3]=0,T[4]=0,T[5]=A[1],T[6]=0,T[7]=0,T[8]=0,T[9]=0,T[10]=A[2],T[11]=0,T[12]=0,T[13]=0,T[14]=0,T[15]=1,T;}function L(T,A,U){var G=U[0],J=U[1],q=U[2],nt=Math.hypot(G,J,q),ut,pt,yt;return nt<r.EPSILON?null:(nt=1/nt,G*=nt,J*=nt,q*=nt,ut=Math.sin(A),pt=Math.cos(A),yt=1-pt,T[0]=G*G*yt+pt,T[1]=J*G*yt+q*ut,T[2]=q*G*yt-J*ut,T[3]=0,T[4]=G*J*yt-q*ut,T[5]=J*J*yt+pt,T[6]=q*J*yt+G*ut,T[7]=0,T[8]=G*q*yt+J*ut,T[9]=J*q*yt-G*ut,T[10]=q*q*yt+pt,T[11]=0,T[12]=0,T[13]=0,T[14]=0,T[15]=1,T);}function w(T,A){var U=Math.sin(A),G=Math.cos(A);return T[0]=1,T[1]=0,T[2]=0,T[3]=0,T[4]=0,T[5]=G,T[6]=U,T[7]=0,T[8]=0,T[9]=-U,T[10]=G,T[11]=0,T[12]=0,T[13]=0,T[14]=0,T[15]=1,T;}function B(T,A){var U=Math.sin(A),G=Math.cos(A);return T[0]=G,T[1]=0,T[2]=-U,T[3]=0,T[4]=0,T[5]=1,T[6]=0,T[7]=0,T[8]=U,T[9]=0,T[10]=G,T[11]=0,T[12]=0,T[13]=0,T[14]=0,T[15]=1,T;}function E(T,A){var U=Math.sin(A),G=Math.cos(A);return T[0]=G,T[1]=U,T[2]=0,T[3]=0,T[4]=-U,T[5]=G,T[6]=0,T[7]=0,T[8]=0,T[9]=0,T[10]=1,T[11]=0,T[12]=0,T[13]=0,T[14]=0,T[15]=1,T;}function b(T,A,U){var G=A[0],J=A[1],q=A[2],nt=A[3],ut=G+G,pt=J+J,yt=q+q,Tt=G*ut,vt=G*pt,mt=G*yt,Pt=J*pt,Mt=J*yt,At=q*yt,It=nt*ut,Nt=nt*pt,$t=nt*yt;return T[0]=1-(Pt+At),T[1]=vt+$t,T[2]=mt-Nt,T[3]=0,T[4]=vt-$t,T[5]=1-(Tt+At),T[6]=Mt+It,T[7]=0,T[8]=mt+Nt,T[9]=Mt-It,T[10]=1-(Tt+Pt),T[11]=0,T[12]=U[0],T[13]=U[1],T[14]=U[2],T[15]=1,T;}function W(T,A){var U=new r.ARRAY_TYPE(3),G=-A[0],J=-A[1],q=-A[2],nt=A[3],ut=A[4],pt=A[5],yt=A[6],Tt=A[7],vt=G*G+J*J+q*q+nt*nt;return vt>0?(U[0]=(ut*nt+Tt*G+pt*q-yt*J)*2/vt,U[1]=(pt*nt+Tt*J+yt*G-ut*q)*2/vt,U[2]=(yt*nt+Tt*q+ut*J-pt*G)*2/vt):(U[0]=(ut*nt+Tt*G+pt*q-yt*J)*2,U[1]=(pt*nt+Tt*J+yt*G-ut*q)*2,U[2]=(yt*nt+Tt*q+ut*J-pt*G)*2),b(T,A,U),T;}function D(T,A){return T[0]=A[12],T[1]=A[13],T[2]=A[14],T;}function R(T,A){var U=A[0],G=A[1],J=A[2],q=A[4],nt=A[5],ut=A[6],pt=A[8],yt=A[9],Tt=A[10];return T[0]=Math.hypot(U,G,J),T[1]=Math.hypot(q,nt,ut),T[2]=Math.hypot(pt,yt,Tt),T;}function Y(T,A){var U=new r.ARRAY_TYPE(3);R(U,A);var G=1/U[0],J=1/U[1],q=1/U[2],nt=A[0]*G,ut=A[1]*J,pt=A[2]*q,yt=A[4]*G,Tt=A[5]*J,vt=A[6]*q,mt=A[8]*G,Pt=A[9]*J,Mt=A[10]*q,At=nt+Tt+Mt,It=0;return At>0?(It=Math.sqrt(At+1)*2,T[3]=0.25*It,T[0]=(vt-Pt)/It,T[1]=(mt-pt)/It,T[2]=(ut-yt)/It):nt>Tt&&nt>Mt?(It=Math.sqrt(1+nt-Tt-Mt)*2,T[3]=(vt-Pt)/It,T[0]=0.25*It,T[1]=(ut+yt)/It,T[2]=(mt+pt)/It):Tt>Mt?(It=Math.sqrt(1+Tt-nt-Mt)*2,T[3]=(mt-pt)/It,T[0]=(ut+yt)/It,T[1]=0.25*It,T[2]=(vt+Pt)/It):(It=Math.sqrt(1+Mt-nt-Tt)*2,T[3]=(ut-yt)/It,T[0]=(mt+pt)/It,T[1]=(vt+Pt)/It,T[2]=0.25*It),T;}function V(T,A,U,G){var J=A[0],q=A[1],nt=A[2],ut=A[3],pt=J+J,yt=q+q,Tt=nt+nt,vt=J*pt,mt=J*yt,Pt=J*Tt,Mt=q*yt,At=q*Tt,It=nt*Tt,Nt=ut*pt,$t=ut*yt,jt=ut*Tt,Ut=G[0],zt=G[1],Xt=G[2];return T[0]=(1-(Mt+It))*Ut,T[1]=(mt+jt)*Ut,T[2]=(Pt-$t)*Ut,T[3]=0,T[4]=(mt-jt)*zt,T[5]=(1-(vt+It))*zt,T[6]=(At+Nt)*zt,T[7]=0,T[8]=(Pt+$t)*Xt,T[9]=(At-Nt)*Xt,T[10]=(1-(vt+Mt))*Xt,T[11]=0,T[12]=U[0],T[13]=U[1],T[14]=U[2],T[15]=1,T;}function Q(T,A,U,G,J){var q=A[0],nt=A[1],ut=A[2],pt=A[3],yt=q+q,Tt=nt+nt,vt=ut+ut,mt=q*yt,Pt=q*Tt,Mt=q*vt,At=nt*Tt,It=nt*vt,Nt=ut*vt,$t=pt*yt,jt=pt*Tt,Ut=pt*vt,zt=G[0],Xt=G[1],ae=G[2],ie=J[0],se=J[1],oe=J[2],le=(1-(At+Nt))*zt,ce=(Pt+Ut)*zt,fe=(Mt-jt)*zt,Zt=(Pt-Ut)*Xt,Pe=(1-(mt+Nt))*Xt,Be=(It+$t)*Xt,We=(Mt+jt)*ae,dr=(It-$t)*ae,pr=(1-(mt+At))*ae;return T[0]=le,T[1]=ce,T[2]=fe,T[3]=0,T[4]=Zt,T[5]=Pe,T[6]=Be,T[7]=0,T[8]=We,T[9]=dr,T[10]=pr,T[11]=0,T[12]=U[0]+ie-(le*ie+Zt*se+We*oe),T[13]=U[1]+se-(ce*ie+Pe*se+dr*oe),T[14]=U[2]+oe-(fe*ie+Be*se+pr*oe),T[15]=1,T;}function et(T,A){var U=A[0],G=A[1],J=A[2],q=A[3],nt=U+U,ut=G+G,pt=J+J,yt=U*nt,Tt=G*nt,vt=G*ut,mt=J*nt,Pt=J*ut,Mt=J*pt,At=q*nt,It=q*ut,Nt=q*pt;return T[0]=1-vt-Mt,T[1]=Tt+Nt,T[2]=mt-It,T[3]=0,T[4]=Tt-Nt,T[5]=1-yt-Mt,T[6]=Pt+At,T[7]=0,T[8]=mt+It,T[9]=Pt-At,T[10]=1-yt-vt,T[11]=0,T[12]=0,T[13]=0,T[14]=0,T[15]=1,T;}function it(T,A,U,G,J,q,nt){var ut=1/(U-A),pt=1/(J-G),yt=1/(q-nt);return T[0]=q*2*ut,T[1]=0,T[2]=0,T[3]=0,T[4]=0,T[5]=q*2*pt,T[6]=0,T[7]=0,T[8]=(U+A)*ut,T[9]=(J+G)*pt,T[10]=(nt+q)*yt,T[11]=-1,T[12]=0,T[13]=0,T[14]=nt*q*2*yt,T[15]=0,T;}function $(T,A,U,G,J){var q=1/Math.tan(A/2),nt;return T[0]=q/U,T[1]=0,T[2]=0,T[3]=0,T[4]=0,T[5]=q,T[6]=0,T[7]=0,T[8]=0,T[9]=0,T[11]=-1,T[12]=0,T[13]=0,T[15]=0,J!=null&&J!==1/0?(nt=1/(G-J),T[10]=(J+G)*nt,T[14]=2*J*G*nt):(T[10]=-1,T[14]=-2*G),T;}function K(T,A,U,G){var J=Math.tan(A.upDegrees*Math.PI/180),q=Math.tan(A.downDegrees*Math.PI/180),nt=Math.tan(A.leftDegrees*Math.PI/180),ut=Math.tan(A.rightDegrees*Math.PI/180),pt=2/(nt+ut),yt=2/(J+q);return T[0]=pt,T[1]=0,T[2]=0,T[3]=0,T[4]=0,T[5]=yt,T[6]=0,T[7]=0,T[8]=-((nt-ut)*pt*0.5),T[9]=(J-q)*yt*0.5,T[10]=G/(U-G),T[11]=-1,T[12]=0,T[13]=0,T[14]=G*U/(U-G),T[15]=0,T;}function rt(T,A,U,G,J,q,nt){var ut=1/(A-U),pt=1/(G-J),yt=1/(q-nt);return T[0]=-2*ut,T[1]=0,T[2]=0,T[3]=0,T[4]=0,T[5]=-2*pt,T[6]=0,T[7]=0,T[8]=0,T[9]=0,T[10]=2*yt,T[11]=0,T[12]=(A+U)*ut,T[13]=(J+G)*pt,T[14]=(nt+q)*yt,T[15]=1,T;}function lt(T,A,U,G){var J,q,nt,ut,pt,yt,Tt,vt,mt,Pt,Mt=A[0],At=A[1],It=A[2],Nt=G[0],$t=G[1],jt=G[2],Ut=U[0],zt=U[1],Xt=U[2];return Math.abs(Mt-Ut)<r.EPSILON&&Math.abs(At-zt)<r.EPSILON&&Math.abs(It-Xt)<r.EPSILON?c(T):(Tt=Mt-Ut,vt=At-zt,mt=It-Xt,Pt=1/Math.hypot(Tt,vt,mt),Tt*=Pt,vt*=Pt,mt*=Pt,J=$t*mt-jt*vt,q=jt*Tt-Nt*mt,nt=Nt*vt-$t*Tt,Pt=Math.hypot(J,q,nt),Pt?(Pt=1/Pt,J*=Pt,q*=Pt,nt*=Pt):(J=0,q=0,nt=0),ut=vt*nt-mt*q,pt=mt*J-Tt*nt,yt=Tt*q-vt*J,Pt=Math.hypot(ut,pt,yt),Pt?(Pt=1/Pt,ut*=Pt,pt*=Pt,yt*=Pt):(ut=0,pt=0,yt=0),T[0]=J,T[1]=ut,T[2]=Tt,T[3]=0,T[4]=q,T[5]=pt,T[6]=vt,T[7]=0,T[8]=nt,T[9]=yt,T[10]=mt,T[11]=0,T[12]=-(J*Mt+q*At+nt*It),T[13]=-(ut*Mt+pt*At+yt*It),T[14]=-(Tt*Mt+vt*At+mt*It),T[15]=1,T);}function ct(T,A,U,G){var J=A[0],q=A[1],nt=A[2],ut=G[0],pt=G[1],yt=G[2],Tt=J-U[0],vt=q-U[1],mt=nt-U[2],Pt=Tt*Tt+vt*vt+mt*mt;Pt>0&&(Pt=1/Math.sqrt(Pt),Tt*=Pt,vt*=Pt,mt*=Pt);var Mt=pt*mt-yt*vt,At=yt*Tt-ut*mt,It=ut*vt-pt*Tt;return Pt=Mt*Mt+At*At+It*It,Pt>0&&(Pt=1/Math.sqrt(Pt),Mt*=Pt,At*=Pt,It*=Pt),T[0]=Mt,T[1]=At,T[2]=It,T[3]=0,T[4]=vt*It-mt*At,T[5]=mt*Mt-Tt*It,T[6]=Tt*At-vt*Mt,T[7]=0,T[8]=Tt,T[9]=vt,T[10]=mt,T[11]=0,T[12]=J,T[13]=q,T[14]=nt,T[15]=1,T;}function gt(T){return"mat4("+T[0]+", "+T[1]+", "+T[2]+", "+T[3]+", "+T[4]+", "+T[5]+", "+T[6]+", "+T[7]+", "+T[8]+", "+T[9]+", "+T[10]+", "+T[11]+", "+T[12]+", "+T[13]+", "+T[14]+", "+T[15]+")";}function st(T){return Math.hypot(T[0],T[1],T[2],T[3],T[4],T[5],T[6],T[7],T[8],T[9],T[10],T[11],T[12],T[13],T[14],T[15]);}function Ot(T,A,U){return T[0]=A[0]+U[0],T[1]=A[1]+U[1],T[2]=A[2]+U[2],T[3]=A[3]+U[3],T[4]=A[4]+U[4],T[5]=A[5]+U[5],T[6]=A[6]+U[6],T[7]=A[7]+U[7],T[8]=A[8]+U[8],T[9]=A[9]+U[9],T[10]=A[10]+U[10],T[11]=A[11]+U[11],T[12]=A[12]+U[12],T[13]=A[13]+U[13],T[14]=A[14]+U[14],T[15]=A[15]+U[15],T;}function St(T,A,U){return T[0]=A[0]-U[0],T[1]=A[1]-U[1],T[2]=A[2]-U[2],T[3]=A[3]-U[3],T[4]=A[4]-U[4],T[5]=A[5]-U[5],T[6]=A[6]-U[6],T[7]=A[7]-U[7],T[8]=A[8]-U[8],T[9]=A[9]-U[9],T[10]=A[10]-U[10],T[11]=A[11]-U[11],T[12]=A[12]-U[12],T[13]=A[13]-U[13],T[14]=A[14]-U[14],T[15]=A[15]-U[15],T;}function F(T,A,U){return T[0]=A[0]*U,T[1]=A[1]*U,T[2]=A[2]*U,T[3]=A[3]*U,T[4]=A[4]*U,T[5]=A[5]*U,T[6]=A[6]*U,T[7]=A[7]*U,T[8]=A[8]*U,T[9]=A[9]*U,T[10]=A[10]*U,T[11]=A[11]*U,T[12]=A[12]*U,T[13]=A[13]*U,T[14]=A[14]*U,T[15]=A[15]*U,T;}function z(T,A,U,G){return T[0]=A[0]+U[0]*G,T[1]=A[1]+U[1]*G,T[2]=A[2]+U[2]*G,T[3]=A[3]+U[3]*G,T[4]=A[4]+U[4]*G,T[5]=A[5]+U[5]*G,T[6]=A[6]+U[6]*G,T[7]=A[7]+U[7]*G,T[8]=A[8]+U[8]*G,T[9]=A[9]+U[9]*G,T[10]=A[10]+U[10]*G,T[11]=A[11]+U[11]*G,T[12]=A[12]+U[12]*G,T[13]=A[13]+U[13]*G,T[14]=A[14]+U[14]*G,T[15]=A[15]+U[15]*G,T;}function Z(T,A){return T[0]===A[0]&&T[1]===A[1]&&T[2]===A[2]&&T[3]===A[3]&&T[4]===A[4]&&T[5]===A[5]&&T[6]===A[6]&&T[7]===A[7]&&T[8]===A[8]&&T[9]===A[9]&&T[10]===A[10]&&T[11]===A[11]&&T[12]===A[12]&&T[13]===A[13]&&T[14]===A[14]&&T[15]===A[15];}function tt(T,A){var U=T[0],G=T[1],J=T[2],q=T[3],nt=T[4],ut=T[5],pt=T[6],yt=T[7],Tt=T[8],vt=T[9],mt=T[10],Pt=T[11],Mt=T[12],At=T[13],It=T[14],Nt=T[15],$t=A[0],jt=A[1],Ut=A[2],zt=A[3],Xt=A[4],ae=A[5],ie=A[6],se=A[7],oe=A[8],le=A[9],ce=A[10],fe=A[11],Zt=A[12],Pe=A[13],Be=A[14],We=A[15];return Math.abs(U-$t)<=r.EPSILON*Math.max(1,Math.abs(U),Math.abs($t))&&Math.abs(G-jt)<=r.EPSILON*Math.max(1,Math.abs(G),Math.abs(jt))&&Math.abs(J-Ut)<=r.EPSILON*Math.max(1,Math.abs(J),Math.abs(Ut))&&Math.abs(q-zt)<=r.EPSILON*Math.max(1,Math.abs(q),Math.abs(zt))&&Math.abs(nt-Xt)<=r.EPSILON*Math.max(1,Math.abs(nt),Math.abs(Xt))&&Math.abs(ut-ae)<=r.EPSILON*Math.max(1,Math.abs(ut),Math.abs(ae))&&Math.abs(pt-ie)<=r.EPSILON*Math.max(1,Math.abs(pt),Math.abs(ie))&&Math.abs(yt-se)<=r.EPSILON*Math.max(1,Math.abs(yt),Math.abs(se))&&Math.abs(Tt-oe)<=r.EPSILON*Math.max(1,Math.abs(Tt),Math.abs(oe))&&Math.abs(vt-le)<=r.EPSILON*Math.max(1,Math.abs(vt),Math.abs(le))&&Math.abs(mt-ce)<=r.EPSILON*Math.max(1,Math.abs(mt),Math.abs(ce))&&Math.abs(Pt-fe)<=r.EPSILON*Math.max(1,Math.abs(Pt),Math.abs(fe))&&Math.abs(Mt-Zt)<=r.EPSILON*Math.max(1,Math.abs(Mt),Math.abs(Zt))&&Math.abs(At-Pe)<=r.EPSILON*Math.max(1,Math.abs(At),Math.abs(Pe))&&Math.abs(It-Be)<=r.EPSILON*Math.max(1,Math.abs(It),Math.abs(Be))&&Math.abs(Nt-We)<=r.EPSILON*Math.max(1,Math.abs(Nt),Math.abs(We));}var j=M,H=St;},/* 7 *//***/function(u,e,t){t.r(e),t.d(e,"create",function(){return o;}),t.d(e,"identity",function(){return a;}),t.d(e,"setAxisAngle",function(){return c;}),t.d(e,"getAxisAngle",function(){return y;}),t.d(e,"getAngle",function(){return f;}),t.d(e,"multiply",function(){return g;}),t.d(e,"rotateX",function(){return x;}),t.d(e,"rotateY",function(){return M;}),t.d(e,"rotateZ",function(){return S;}),t.d(e,"calculateW",function(){return P;}),t.d(e,"exp",function(){return C;}),t.d(e,"ln",function(){return h;}),t.d(e,"pow",function(){return p;}),t.d(e,"slerp",function(){return d;}),t.d(e,"random",function(){return v;}),t.d(e,"invert",function(){return I;}),t.d(e,"conjugate",function(){return L;}),t.d(e,"fromMat3",function(){return w;}),t.d(e,"fromEuler",function(){return B;}),t.d(e,"str",function(){return E;}),t.d(e,"clone",function(){return b;}),t.d(e,"fromValues",function(){return W;}),t.d(e,"copy",function(){return D;}),t.d(e,"set",function(){return R;}),t.d(e,"add",function(){return Y;}),t.d(e,"mul",function(){return V;}),t.d(e,"scale",function(){return Q;}),t.d(e,"dot",function(){return et;}),t.d(e,"lerp",function(){return it;}),t.d(e,"length",function(){return $;}),t.d(e,"len",function(){return K;}),t.d(e,"squaredLength",function(){return rt;}),t.d(e,"sqrLen",function(){return lt;}),t.d(e,"normalize",function(){return ct;}),t.d(e,"exactEquals",function(){return gt;}),t.d(e,"equals",function(){return st;}),t.d(e,"rotationTo",function(){return Ot;}),t.d(e,"sqlerp",function(){return St;}),t.d(e,"setAxes",function(){return F;});var r=t(2),n=t(5),s=t(8),l=t(9);function o(){var z=new r.ARRAY_TYPE(4);return r.ARRAY_TYPE!=Float32Array&&(z[0]=0,z[1]=0,z[2]=0),z[3]=1,z;}function a(z){return z[0]=0,z[1]=0,z[2]=0,z[3]=1,z;}function c(z,Z,tt){tt=tt*0.5;var j=Math.sin(tt);return z[0]=j*Z[0],z[1]=j*Z[1],z[2]=j*Z[2],z[3]=Math.cos(tt),z;}function y(z,Z){var tt=Math.acos(Z[3])*2,j=Math.sin(tt/2);return j>r.EPSILON?(z[0]=Z[0]/j,z[1]=Z[1]/j,z[2]=Z[2]/j):(z[0]=1,z[1]=0,z[2]=0),tt;}function f(z,Z){var tt=et(z,Z);return Math.acos(2*tt*tt-1);}function g(z,Z,tt){var j=Z[0],H=Z[1],T=Z[2],A=Z[3],U=tt[0],G=tt[1],J=tt[2],q=tt[3];return z[0]=j*q+A*U+H*J-T*G,z[1]=H*q+A*G+T*U-j*J,z[2]=T*q+A*J+j*G-H*U,z[3]=A*q-j*U-H*G-T*J,z;}function x(z,Z,tt){tt*=0.5;var j=Z[0],H=Z[1],T=Z[2],A=Z[3],U=Math.sin(tt),G=Math.cos(tt);return z[0]=j*G+A*U,z[1]=H*G+T*U,z[2]=T*G-H*U,z[3]=A*G-j*U,z;}function M(z,Z,tt){tt*=0.5;var j=Z[0],H=Z[1],T=Z[2],A=Z[3],U=Math.sin(tt),G=Math.cos(tt);return z[0]=j*G-T*U,z[1]=H*G+A*U,z[2]=T*G+j*U,z[3]=A*G-H*U,z;}function S(z,Z,tt){tt*=0.5;var j=Z[0],H=Z[1],T=Z[2],A=Z[3],U=Math.sin(tt),G=Math.cos(tt);return z[0]=j*G+H*U,z[1]=H*G-j*U,z[2]=T*G+A*U,z[3]=A*G-T*U,z;}function P(z,Z){var tt=Z[0],j=Z[1],H=Z[2];return z[0]=tt,z[1]=j,z[2]=H,z[3]=Math.sqrt(Math.abs(1-tt*tt-j*j-H*H)),z;}function C(z,Z){var tt=Z[0],j=Z[1],H=Z[2],T=Z[3],A=Math.sqrt(tt*tt+j*j+H*H),U=Math.exp(T),G=A>0?U*Math.sin(A)/A:0;return z[0]=tt*G,z[1]=j*G,z[2]=H*G,z[3]=U*Math.cos(A),z;}function h(z,Z){var tt=Z[0],j=Z[1],H=Z[2],T=Z[3],A=Math.sqrt(tt*tt+j*j+H*H),U=A>0?Math.atan2(A,T)/A:0;return z[0]=tt*U,z[1]=j*U,z[2]=H*U,z[3]=0.5*Math.log(tt*tt+j*j+H*H+T*T),z;}function p(z,Z,tt){return h(z,Z),Q(z,z,tt),C(z,z),z;}function d(z,Z,tt,j){var H=Z[0],T=Z[1],A=Z[2],U=Z[3],G=tt[0],J=tt[1],q=tt[2],nt=tt[3],ut,pt,yt,Tt,vt;return pt=H*G+T*J+A*q+U*nt,pt<0&&(pt=-pt,G=-G,J=-J,q=-q,nt=-nt),1-pt>r.EPSILON?(ut=Math.acos(pt),yt=Math.sin(ut),Tt=Math.sin((1-j)*ut)/yt,vt=Math.sin(j*ut)/yt):(Tt=1-j,vt=j),z[0]=Tt*H+vt*G,z[1]=Tt*T+vt*J,z[2]=Tt*A+vt*q,z[3]=Tt*U+vt*nt,z;}function v(z){var Z=r.RANDOM(),tt=r.RANDOM(),j=r.RANDOM(),H=Math.sqrt(1-Z),T=Math.sqrt(Z);return z[0]=H*Math.sin(2*Math.PI*tt),z[1]=H*Math.cos(2*Math.PI*tt),z[2]=T*Math.sin(2*Math.PI*j),z[3]=T*Math.cos(2*Math.PI*j),z;}function I(z,Z){var tt=Z[0],j=Z[1],H=Z[2],T=Z[3],A=tt*tt+j*j+H*H+T*T,U=A?1/A:0;return z[0]=-tt*U,z[1]=-j*U,z[2]=-H*U,z[3]=T*U,z;}function L(z,Z){return z[0]=-Z[0],z[1]=-Z[1],z[2]=-Z[2],z[3]=Z[3],z;}function w(z,Z){var tt=Z[0]+Z[4]+Z[8],j;if(tt>0)j=Math.sqrt(tt+1),z[3]=0.5*j,j=0.5/j,z[0]=(Z[5]-Z[7])*j,z[1]=(Z[6]-Z[2])*j,z[2]=(Z[1]-Z[3])*j;else{var H=0;Z[4]>Z[0]&&(H=1),Z[8]>Z[H*3+H]&&(H=2);var T=(H+1)%3,A=(H+2)%3;j=Math.sqrt(Z[H*3+H]-Z[T*3+T]-Z[A*3+A]+1),z[H]=0.5*j,j=0.5/j,z[3]=(Z[T*3+A]-Z[A*3+T])*j,z[T]=(Z[T*3+H]+Z[H*3+T])*j,z[A]=(Z[A*3+H]+Z[H*3+A])*j;}return z;}function B(z,Z,tt,j){var H=0.5*Math.PI/180;Z*=H,tt*=H,j*=H;var T=Math.sin(Z),A=Math.cos(Z),U=Math.sin(tt),G=Math.cos(tt),J=Math.sin(j),q=Math.cos(j);return z[0]=T*G*q-A*U*J,z[1]=A*U*q+T*G*J,z[2]=A*G*J-T*U*q,z[3]=A*G*q+T*U*J,z;}function E(z){return"quat("+z[0]+", "+z[1]+", "+z[2]+", "+z[3]+")";}var b=l.clone,W=l.fromValues,D=l.copy,R=l.set,Y=l.add,V=g,Q=l.scale,et=l.dot,it=l.lerp,$=l.length,K=$,rt=l.squaredLength,lt=rt,ct=l.normalize,gt=l.exactEquals,st=l.equals,Ot=function(){var z=s.create(),Z=s.fromValues(1,0,0),tt=s.fromValues(0,1,0);return function(j,H,T){var A=s.dot(H,T);return A<-0.999999?(s.cross(z,Z,H),s.len(z)<1e-6&&s.cross(z,tt,H),s.normalize(z,z),c(j,z,Math.PI),j):A>0.999999?(j[0]=0,j[1]=0,j[2]=0,j[3]=1,j):(s.cross(z,H,T),j[0]=z[0],j[1]=z[1],j[2]=z[2],j[3]=1+A,ct(j,j));};}(),St=function(){var z=o(),Z=o();return function(tt,j,H,T,A,U){return d(z,j,A,U),d(Z,H,T,U),d(tt,z,Z,2*U*(1-U)),tt;};}(),F=function(){var z=n.create();return function(Z,tt,j,H){return z[0]=j[0],z[3]=j[1],z[6]=j[2],z[1]=H[0],z[4]=H[1],z[7]=H[2],z[2]=-tt[0],z[5]=-tt[1],z[8]=-tt[2],ct(Z,w(Z,z));};}();},/* 8 *//***/function(u,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 l;}),t.d(e,"fromValues",function(){return o;}),t.d(e,"copy",function(){return a;}),t.d(e,"set",function(){return c;}),t.d(e,"add",function(){return y;}),t.d(e,"subtract",function(){return f;}),t.d(e,"multiply",function(){return g;}),t.d(e,"divide",function(){return x;}),t.d(e,"ceil",function(){return M;}),t.d(e,"floor",function(){return S;}),t.d(e,"min",function(){return P;}),t.d(e,"max",function(){return C;}),t.d(e,"round",function(){return h;}),t.d(e,"scale",function(){return p;}),t.d(e,"scaleAndAdd",function(){return d;}),t.d(e,"distance",function(){return v;}),t.d(e,"squaredDistance",function(){return I;}),t.d(e,"squaredLength",function(){return L;}),t.d(e,"negate",function(){return w;}),t.d(e,"inverse",function(){return B;}),t.d(e,"normalize",function(){return E;}),t.d(e,"dot",function(){return b;}),t.d(e,"cross",function(){return W;}),t.d(e,"lerp",function(){return D;}),t.d(e,"hermite",function(){return R;}),t.d(e,"bezier",function(){return Y;}),t.d(e,"random",function(){return V;}),t.d(e,"transformMat4",function(){return Q;}),t.d(e,"transformMat3",function(){return et;}),t.d(e,"transformQuat",function(){return it;}),t.d(e,"rotateX",function(){return $;}),t.d(e,"rotateY",function(){return K;}),t.d(e,"rotateZ",function(){return rt;}),t.d(e,"angle",function(){return lt;}),t.d(e,"zero",function(){return ct;}),t.d(e,"str",function(){return gt;}),t.d(e,"exactEquals",function(){return st;}),t.d(e,"equals",function(){return Ot;}),t.d(e,"sub",function(){return St;}),t.d(e,"mul",function(){return F;}),t.d(e,"div",function(){return z;}),t.d(e,"dist",function(){return Z;}),t.d(e,"sqrDist",function(){return tt;}),t.d(e,"len",function(){return j;}),t.d(e,"sqrLen",function(){return H;}),t.d(e,"forEach",function(){return T;});var r=t(2);function n(){var A=new r.ARRAY_TYPE(3);return r.ARRAY_TYPE!=Float32Array&&(A[0]=0,A[1]=0,A[2]=0),A;}function s(A){var U=new r.ARRAY_TYPE(3);return U[0]=A[0],U[1]=A[1],U[2]=A[2],U;}function l(A){var U=A[0],G=A[1],J=A[2];return Math.hypot(U,G,J);}function o(A,U,G){var J=new r.ARRAY_TYPE(3);return J[0]=A,J[1]=U,J[2]=G,J;}function a(A,U){return A[0]=U[0],A[1]=U[1],A[2]=U[2],A;}function c(A,U,G,J){return A[0]=U,A[1]=G,A[2]=J,A;}function y(A,U,G){return A[0]=U[0]+G[0],A[1]=U[1]+G[1],A[2]=U[2]+G[2],A;}function f(A,U,G){return A[0]=U[0]-G[0],A[1]=U[1]-G[1],A[2]=U[2]-G[2],A;}function g(A,U,G){return A[0]=U[0]*G[0],A[1]=U[1]*G[1],A[2]=U[2]*G[2],A;}function x(A,U,G){return A[0]=U[0]/G[0],A[1]=U[1]/G[1],A[2]=U[2]/G[2],A;}function M(A,U){return A[0]=Math.ceil(U[0]),A[1]=Math.ceil(U[1]),A[2]=Math.ceil(U[2]),A;}function S(A,U){return A[0]=Math.floor(U[0]),A[1]=Math.floor(U[1]),A[2]=Math.floor(U[2]),A;}function P(A,U,G){return A[0]=Math.min(U[0],G[0]),A[1]=Math.min(U[1],G[1]),A[2]=Math.min(U[2],G[2]),A;}function C(A,U,G){return A[0]=Math.max(U[0],G[0]),A[1]=Math.max(U[1],G[1]),A[2]=Math.max(U[2],G[2]),A;}function h(A,U){return A[0]=Math.round(U[0]),A[1]=Math.round(U[1]),A[2]=Math.round(U[2]),A;}function p(A,U,G){return A[0]=U[0]*G,A[1]=U[1]*G,A[2]=U[2]*G,A;}function d(A,U,G,J){return A[0]=U[0]+G[0]*J,A[1]=U[1]+G[1]*J,A[2]=U[2]+G[2]*J,A;}function v(A,U){var G=U[0]-A[0],J=U[1]-A[1],q=U[2]-A[2];return Math.hypot(G,J,q);}function I(A,U){var G=U[0]-A[0],J=U[1]-A[1],q=U[2]-A[2];return G*G+J*J+q*q;}function L(A){var U=A[0],G=A[1],J=A[2];return U*U+G*G+J*J;}function w(A,U){return A[0]=-U[0],A[1]=-U[1],A[2]=-U[2],A;}function B(A,U){return A[0]=1/U[0],A[1]=1/U[1],A[2]=1/U[2],A;}function E(A,U){var G=U[0],J=U[1],q=U[2],nt=G*G+J*J+q*q;return nt>0&&(nt=1/Math.sqrt(nt)),A[0]=U[0]*nt,A[1]=U[1]*nt,A[2]=U[2]*nt,A;}function b(A,U){return A[0]*U[0]+A[1]*U[1]+A[2]*U[2];}function W(A,U,G){var J=U[0],q=U[1],nt=U[2],ut=G[0],pt=G[1],yt=G[2];return A[0]=q*yt-nt*pt,A[1]=nt*ut-J*yt,A[2]=J*pt-q*ut,A;}function D(A,U,G,J){var q=U[0],nt=U[1],ut=U[2];return A[0]=q+J*(G[0]-q),A[1]=nt+J*(G[1]-nt),A[2]=ut+J*(G[2]-ut),A;}function R(A,U,G,J,q,nt){var ut=nt*nt,pt=ut*(2*nt-3)+1,yt=ut*(nt-2)+nt,Tt=ut*(nt-1),vt=ut*(3-2*nt);return A[0]=U[0]*pt+G[0]*yt+J[0]*Tt+q[0]*vt,A[1]=U[1]*pt+G[1]*yt+J[1]*Tt+q[1]*vt,A[2]=U[2]*pt+G[2]*yt+J[2]*Tt+q[2]*vt,A;}function Y(A,U,G,J,q,nt){var ut=1-nt,pt=ut*ut,yt=nt*nt,Tt=pt*ut,vt=3*nt*pt,mt=3*yt*ut,Pt=yt*nt;return A[0]=U[0]*Tt+G[0]*vt+J[0]*mt+q[0]*Pt,A[1]=U[1]*Tt+G[1]*vt+J[1]*mt+q[1]*Pt,A[2]=U[2]*Tt+G[2]*vt+J[2]*mt+q[2]*Pt,A;}function V(A,U){U=U||1;var G=r.RANDOM()*2*Math.PI,J=r.RANDOM()*2-1,q=Math.sqrt(1-J*J)*U;return A[0]=Math.cos(G)*q,A[1]=Math.sin(G)*q,A[2]=J*U,A;}function Q(A,U,G){var J=U[0],q=U[1],nt=U[2],ut=G[3]*J+G[7]*q+G[11]*nt+G[15];return ut=ut||1,A[0]=(G[0]*J+G[4]*q+G[8]*nt+G[12])/ut,A[1]=(G[1]*J+G[5]*q+G[9]*nt+G[13])/ut,A[2]=(G[2]*J+G[6]*q+G[10]*nt+G[14])/ut,A;}function et(A,U,G){var J=U[0],q=U[1],nt=U[2];return A[0]=J*G[0]+q*G[3]+nt*G[6],A[1]=J*G[1]+q*G[4]+nt*G[7],A[2]=J*G[2]+q*G[5]+nt*G[8],A;}function it(A,U,G){var J=G[0],q=G[1],nt=G[2],ut=G[3],pt=U[0],yt=U[1],Tt=U[2],vt=q*Tt-nt*yt,mt=nt*pt-J*Tt,Pt=J*yt-q*pt,Mt=q*Pt-nt*mt,At=nt*vt-J*Pt,It=J*mt-q*vt,Nt=ut*2;return vt*=Nt,mt*=Nt,Pt*=Nt,Mt*=2,At*=2,It*=2,A[0]=pt+vt+Mt,A[1]=yt+mt+At,A[2]=Tt+Pt+It,A;}function $(A,U,G,J){var q=[],nt=[];return q[0]=U[0]-G[0],q[1]=U[1]-G[1],q[2]=U[2]-G[2],nt[0]=q[0],nt[1]=q[1]*Math.cos(J)-q[2]*Math.sin(J),nt[2]=q[1]*Math.sin(J)+q[2]*Math.cos(J),A[0]=nt[0]+G[0],A[1]=nt[1]+G[1],A[2]=nt[2]+G[2],A;}function K(A,U,G,J){var q=[],nt=[];return q[0]=U[0]-G[0],q[1]=U[1]-G[1],q[2]=U[2]-G[2],nt[0]=q[2]*Math.sin(J)+q[0]*Math.cos(J),nt[1]=q[1],nt[2]=q[2]*Math.cos(J)-q[0]*Math.sin(J),A[0]=nt[0]+G[0],A[1]=nt[1]+G[1],A[2]=nt[2]+G[2],A;}function rt(A,U,G,J){var q=[],nt=[];return q[0]=U[0]-G[0],q[1]=U[1]-G[1],q[2]=U[2]-G[2],nt[0]=q[0]*Math.cos(J)-q[1]*Math.sin(J),nt[1]=q[0]*Math.sin(J)+q[1]*Math.cos(J),nt[2]=q[2],A[0]=nt[0]+G[0],A[1]=nt[1]+G[1],A[2]=nt[2]+G[2],A;}function lt(A,U){var G=A[0],J=A[1],q=A[2],nt=U[0],ut=U[1],pt=U[2],yt=Math.sqrt(G*G+J*J+q*q),Tt=Math.sqrt(nt*nt+ut*ut+pt*pt),vt=yt*Tt,mt=vt&&b(A,U)/vt;return Math.acos(Math.min(Math.max(mt,-1),1));}function ct(A){return A[0]=0,A[1]=0,A[2]=0,A;}function gt(A){return"vec3("+A[0]+", "+A[1]+", "+A[2]+")";}function st(A,U){return A[0]===U[0]&&A[1]===U[1]&&A[2]===U[2];}function Ot(A,U){var G=A[0],J=A[1],q=A[2],nt=U[0],ut=U[1],pt=U[2];return Math.abs(G-nt)<=r.EPSILON*Math.max(1,Math.abs(G),Math.abs(nt))&&Math.abs(J-ut)<=r.EPSILON*Math.max(1,Math.abs(J),Math.abs(ut))&&Math.abs(q-pt)<=r.EPSILON*Math.max(1,Math.abs(q),Math.abs(pt));}var St=f,F=g,z=x,Z=v,tt=I,j=l,H=L,T=function(){var A=n();return function(U,G,J,q,nt,ut){var pt,yt;for(G||(G=3),J||(J=0),q?yt=Math.min(q*G+J,U.length):yt=U.length,pt=J;pt<yt;pt+=G)A[0]=U[pt],A[1]=U[pt+1],A[2]=U[pt+2],nt(A,A,ut),U[pt]=A[0],U[pt+1]=A[1],U[pt+2]=A[2];return U;};}();},/* 9 *//***/function(u,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 l;}),t.d(e,"copy",function(){return o;}),t.d(e,"set",function(){return a;}),t.d(e,"add",function(){return c;}),t.d(e,"subtract",function(){return y;}),t.d(e,"multiply",function(){return f;}),t.d(e,"divide",function(){return g;}),t.d(e,"ceil",function(){return x;}),t.d(e,"floor",function(){return M;}),t.d(e,"min",function(){return S;}),t.d(e,"max",function(){return P;}),t.d(e,"round",function(){return C;}),t.d(e,"scale",function(){return h;}),t.d(e,"scaleAndAdd",function(){return p;}),t.d(e,"distance",function(){return d;}),t.d(e,"squaredDistance",function(){return v;}),t.d(e,"length",function(){return I;}),t.d(e,"squaredLength",function(){return L;}),t.d(e,"negate",function(){return w;}),t.d(e,"inverse",function(){return B;}),t.d(e,"normalize",function(){return E;}),t.d(e,"dot",function(){return b;}),t.d(e,"cross",function(){return W;}),t.d(e,"lerp",function(){return D;}),t.d(e,"random",function(){return R;}),t.d(e,"transformMat4",function(){return Y;}),t.d(e,"transformQuat",function(){return V;}),t.d(e,"zero",function(){return Q;}),t.d(e,"str",function(){return et;}),t.d(e,"exactEquals",function(){return it;}),t.d(e,"equals",function(){return $;}),t.d(e,"sub",function(){return K;}),t.d(e,"mul",function(){return rt;}),t.d(e,"div",function(){return lt;}),t.d(e,"dist",function(){return ct;}),t.d(e,"sqrDist",function(){return gt;}),t.d(e,"len",function(){return st;}),t.d(e,"sqrLen",function(){return Ot;}),t.d(e,"forEach",function(){return St;});var r=t(2);function n(){var F=new r.ARRAY_TYPE(4);return r.ARRAY_TYPE!=Float32Array&&(F[0]=0,F[1]=0,F[2]=0,F[3]=0),F;}function s(F){var z=new r.ARRAY_TYPE(4);return z[0]=F[0],z[1]=F[1],z[2]=F[2],z[3]=F[3],z;}function l(F,z,Z,tt){var j=new r.ARRAY_TYPE(4);return j[0]=F,j[1]=z,j[2]=Z,j[3]=tt,j;}function o(F,z){return F[0]=z[0],F[1]=z[1],F[2]=z[2],F[3]=z[3],F;}function a(F,z,Z,tt,j){return F[0]=z,F[1]=Z,F[2]=tt,F[3]=j,F;}function c(F,z,Z){return F[0]=z[0]+Z[0],F[1]=z[1]+Z[1],F[2]=z[2]+Z[2],F[3]=z[3]+Z[3],F;}function y(F,z,Z){return F[0]=z[0]-Z[0],F[1]=z[1]-Z[1],F[2]=z[2]-Z[2],F[3]=z[3]-Z[3],F;}function f(F,z,Z){return F[0]=z[0]*Z[0],F[1]=z[1]*Z[1],F[2]=z[2]*Z[2],F[3]=z[3]*Z[3],F;}function g(F,z,Z){return F[0]=z[0]/Z[0],F[1]=z[1]/Z[1],F[2]=z[2]/Z[2],F[3]=z[3]/Z[3],F;}function x(F,z){return F[0]=Math.ceil(z[0]),F[1]=Math.ceil(z[1]),F[2]=Math.ceil(z[2]),F[3]=Math.ceil(z[3]),F;}function M(F,z){return F[0]=Math.floor(z[0]),F[1]=Math.floor(z[1]),F[2]=Math.floor(z[2]),F[3]=Math.floor(z[3]),F;}function S(F,z,Z){return F[0]=Math.min(z[0],Z[0]),F[1]=Math.min(z[1],Z[1]),F[2]=Math.min(z[2],Z[2]),F[3]=Math.min(z[3],Z[3]),F;}function P(F,z,Z){return F[0]=Math.max(z[0],Z[0]),F[1]=Math.max(z[1],Z[1]),F[2]=Math.max(z[2],Z[2]),F[3]=Math.max(z[3],Z[3]),F;}function C(F,z){return F[0]=Math.round(z[0]),F[1]=Math.round(z[1]),F[2]=Math.round(z[2]),F[3]=Math.round(z[3]),F;}function h(F,z,Z){return F[0]=z[0]*Z,F[1]=z[1]*Z,F[2]=z[2]*Z,F[3]=z[3]*Z,F;}function p(F,z,Z,tt){return F[0]=z[0]+Z[0]*tt,F[1]=z[1]+Z[1]*tt,F[2]=z[2]+Z[2]*tt,F[3]=z[3]+Z[3]*tt,F;}function d(F,z){var Z=z[0]-F[0],tt=z[1]-F[1],j=z[2]-F[2],H=z[3]-F[3];return Math.hypot(Z,tt,j,H);}function v(F,z){var Z=z[0]-F[0],tt=z[1]-F[1],j=z[2]-F[2],H=z[3]-F[3];return Z*Z+tt*tt+j*j+H*H;}function I(F){var z=F[0],Z=F[1],tt=F[2],j=F[3];return Math.hypot(z,Z,tt,j);}function L(F){var z=F[0],Z=F[1],tt=F[2],j=F[3];return z*z+Z*Z+tt*tt+j*j;}function w(F,z){return F[0]=-z[0],F[1]=-z[1],F[2]=-z[2],F[3]=-z[3],F;}function B(F,z){return F[0]=1/z[0],F[1]=1/z[1],F[2]=1/z[2],F[3]=1/z[3],F;}function E(F,z){var Z=z[0],tt=z[1],j=z[2],H=z[3],T=Z*Z+tt*tt+j*j+H*H;return T>0&&(T=1/Math.sqrt(T)),F[0]=Z*T,F[1]=tt*T,F[2]=j*T,F[3]=H*T,F;}function b(F,z){return F[0]*z[0]+F[1]*z[1]+F[2]*z[2]+F[3]*z[3];}function W(F,z,Z,tt){var j=Z[0]*tt[1]-Z[1]*tt[0],H=Z[0]*tt[2]-Z[2]*tt[0],T=Z[0]*tt[3]-Z[3]*tt[0],A=Z[1]*tt[2]-Z[2]*tt[1],U=Z[1]*tt[3]-Z[3]*tt[1],G=Z[2]*tt[3]-Z[3]*tt[2],J=z[0],q=z[1],nt=z[2],ut=z[3];return F[0]=q*G-nt*U+ut*A,F[1]=-(J*G)+nt*T-ut*H,F[2]=J*U-q*T+ut*j,F[3]=-(J*A)+q*H-nt*j,F;}function D(F,z,Z,tt){var j=z[0],H=z[1],T=z[2],A=z[3];return F[0]=j+tt*(Z[0]-j),F[1]=H+tt*(Z[1]-H),F[2]=T+tt*(Z[2]-T),F[3]=A+tt*(Z[3]-A),F;}function R(F,z){z=z||1;var Z,tt,j,H,T,A;do Z=r.RANDOM()*2-1,tt=r.RANDOM()*2-1,T=Z*Z+tt*tt;while(T>=1);do j=r.RANDOM()*2-1,H=r.RANDOM()*2-1,A=j*j+H*H;while(A>=1);var U=Math.sqrt((1-T)/A);return F[0]=z*Z,F[1]=z*tt,F[2]=z*j*U,F[3]=z*H*U,F;}function Y(F,z,Z){var tt=z[0],j=z[1],H=z[2],T=z[3];return F[0]=Z[0]*tt+Z[4]*j+Z[8]*H+Z[12]*T,F[1]=Z[1]*tt+Z[5]*j+Z[9]*H+Z[13]*T,F[2]=Z[2]*tt+Z[6]*j+Z[10]*H+Z[14]*T,F[3]=Z[3]*tt+Z[7]*j+Z[11]*H+Z[15]*T,F;}function V(F,z,Z){var tt=z[0],j=z[1],H=z[2],T=Z[0],A=Z[1],U=Z[2],G=Z[3],J=G*tt+A*H-U*j,q=G*j+U*tt-T*H,nt=G*H+T*j-A*tt,ut=-T*tt-A*j-U*H;return F[0]=J*G+ut*-T+q*-U-nt*-A,F[1]=q*G+ut*-A+nt*-T-J*-U,F[2]=nt*G+ut*-U+J*-A-q*-T,F[3]=z[3],F;}function Q(F){return F[0]=0,F[1]=0,F[2]=0,F[3]=0,F;}function et(F){return"vec4("+F[0]+", "+F[1]+", "+F[2]+", "+F[3]+")";}function it(F,z){return F[0]===z[0]&&F[1]===z[1]&&F[2]===z[2]&&F[3]===z[3];}function $(F,z){var Z=F[0],tt=F[1],j=F[2],H=F[3],T=z[0],A=z[1],U=z[2],G=z[3];return Math.abs(Z-T)<=r.EPSILON*Math.max(1,Math.abs(Z),Math.abs(T))&&Math.abs(tt-A)<=r.EPSILON*Math.max(1,Math.abs(tt),Math.abs(A))&&Math.abs(j-U)<=r.EPSILON*Math.max(1,Math.abs(j),Math.abs(U))&&Math.abs(H-G)<=r.EPSILON*Math.max(1,Math.abs(H),Math.abs(G));}var K=y,rt=f,lt=g,ct=d,gt=v,st=I,Ot=L,St=function(){var F=n();return function(z,Z,tt,j,H,T){var A,U;for(Z||(Z=4),tt||(tt=0),j?U=Math.min(j*Z+tt,z.length):U=z.length,A=tt;A<U;A+=Z)F[0]=z[A],F[1]=z[A+1],F[2]=z[A+2],F[3]=z[A+3],H(F,F,T),z[A]=F[0],z[A+1]=F[1],z[A+2]=F[2],z[A+3]=F[3];return z;};}();},/* 10 *//***/function(u,e,t){t.r(e),t.d(e,"create",function(){return l;}),t.d(e,"clone",function(){return o;}),t.d(e,"fromValues",function(){return a;}),t.d(e,"fromRotationTranslationValues",function(){return c;}),t.d(e,"fromRotationTranslation",function(){return y;}),t.d(e,"fromTranslation",function(){return f;}),t.d(e,"fromRotation",function(){return g;}),t.d(e,"fromMat4",function(){return x;}),t.d(e,"copy",function(){return M;}),t.d(e,"identity",function(){return S;}),t.d(e,"set",function(){return P;}),t.d(e,"getReal",function(){return C;}),t.d(e,"getDual",function(){return h;}),t.d(e,"setReal",function(){return p;}),t.d(e,"setDual",function(){return d;}),t.d(e,"getTranslation",function(){return v;}),t.d(e,"translate",function(){return I;}),t.d(e,"rotateX",function(){return L;}),t.d(e,"rotateY",function(){return w;}),t.d(e,"rotateZ",function(){return B;}),t.d(e,"rotateByQuatAppend",function(){return E;}),t.d(e,"rotateByQuatPrepend",function(){return b;}),t.d(e,"rotateAroundAxis",function(){return W;}),t.d(e,"add",function(){return D;}),t.d(e,"multiply",function(){return R;}),t.d(e,"mul",function(){return Y;}),t.d(e,"scale",function(){return V;}),t.d(e,"dot",function(){return Q;}),t.d(e,"lerp",function(){return et;}),t.d(e,"invert",function(){return it;}),t.d(e,"conjugate",function(){return $;}),t.d(e,"length",function(){return K;}),t.d(e,"len",function(){return rt;}),t.d(e,"squaredLength",function(){return lt;}),t.d(e,"sqrLen",function(){return ct;}),t.d(e,"normalize",function(){return gt;}),t.d(e,"str",function(){return st;}),t.d(e,"exactEquals",function(){return Ot;}),t.d(e,"equals",function(){return St;});var r=t(2),n=t(7),s=t(6);function l(){var F=new r.ARRAY_TYPE(8);return r.ARRAY_TYPE!=Float32Array&&(F[0]=0,F[1]=0,F[2]=0,F[4]=0,F[5]=0,F[6]=0,F[7]=0),F[3]=1,F;}function o(F){var z=new r.ARRAY_TYPE(8);return z[0]=F[0],z[1]=F[1],z[2]=F[2],z[3]=F[3],z[4]=F[4],z[5]=F[5],z[6]=F[6],z[7]=F[7],z;}function a(F,z,Z,tt,j,H,T,A){var U=new r.ARRAY_TYPE(8);return U[0]=F,U[1]=z,U[2]=Z,U[3]=tt,U[4]=j,U[5]=H,U[6]=T,U[7]=A,U;}function c(F,z,Z,tt,j,H,T){var A=new r.ARRAY_TYPE(8);A[0]=F,A[1]=z,A[2]=Z,A[3]=tt;var U=j*0.5,G=H*0.5,J=T*0.5;return A[4]=U*tt+G*Z-J*z,A[5]=G*tt+J*F-U*Z,A[6]=J*tt+U*z-G*F,A[7]=-U*F-G*z-J*Z,A;}function y(F,z,Z){var tt=Z[0]*0.5,j=Z[1]*0.5,H=Z[2]*0.5,T=z[0],A=z[1],U=z[2],G=z[3];return F[0]=T,F[1]=A,F[2]=U,F[3]=G,F[4]=tt*G+j*U-H*A,F[5]=j*G+H*T-tt*U,F[6]=H*G+tt*A-j*T,F[7]=-tt*T-j*A-H*U,F;}function f(F,z){return F[0]=0,F[1]=0,F[2]=0,F[3]=1,F[4]=z[0]*0.5,F[5]=z[1]*0.5,F[6]=z[2]*0.5,F[7]=0,F;}function g(F,z){return F[0]=z[0],F[1]=z[1],F[2]=z[2],F[3]=z[3],F[4]=0,F[5]=0,F[6]=0,F[7]=0,F;}function x(F,z){var Z=n.create();s.getRotation(Z,z);var tt=new r.ARRAY_TYPE(3);return s.getTranslation(tt,z),y(F,Z,tt),F;}function M(F,z){return F[0]=z[0],F[1]=z[1],F[2]=z[2],F[3]=z[3],F[4]=z[4],F[5]=z[5],F[6]=z[6],F[7]=z[7],F;}function S(F){return F[0]=0,F[1]=0,F[2]=0,F[3]=1,F[4]=0,F[5]=0,F[6]=0,F[7]=0,F;}function P(F,z,Z,tt,j,H,T,A,U){return F[0]=z,F[1]=Z,F[2]=tt,F[3]=j,F[4]=H,F[5]=T,F[6]=A,F[7]=U,F;}var C=n.copy;function h(F,z){return F[0]=z[4],F[1]=z[5],F[2]=z[6],F[3]=z[7],F;}var p=n.copy;function d(F,z){return F[4]=z[0],F[5]=z[1],F[6]=z[2],F[7]=z[3],F;}function v(F,z){var Z=z[4],tt=z[5],j=z[6],H=z[7],T=-z[0],A=-z[1],U=-z[2],G=z[3];return F[0]=(Z*G+H*T+tt*U-j*A)*2,F[1]=(tt*G+H*A+j*T-Z*U)*2,F[2]=(j*G+H*U+Z*A-tt*T)*2,F;}function I(F,z,Z){var tt=z[0],j=z[1],H=z[2],T=z[3],A=Z[0]*0.5,U=Z[1]*0.5,G=Z[2]*0.5,J=z[4],q=z[5],nt=z[6],ut=z[7];return F[0]=tt,F[1]=j,F[2]=H,F[3]=T,F[4]=T*A+j*G-H*U+J,F[5]=T*U+H*A-tt*G+q,F[6]=T*G+tt*U-j*A+nt,F[7]=-tt*A-j*U-H*G+ut,F;}function L(F,z,Z){var tt=-z[0],j=-z[1],H=-z[2],T=z[3],A=z[4],U=z[5],G=z[6],J=z[7],q=A*T+J*tt+U*H-G*j,nt=U*T+J*j+G*tt-A*H,ut=G*T+J*H+A*j-U*tt,pt=J*T-A*tt-U*j-G*H;return n.rotateX(F,z,Z),tt=F[0],j=F[1],H=F[2],T=F[3],F[4]=q*T+pt*tt+nt*H-ut*j,F[5]=nt*T+pt*j+ut*tt-q*H,F[6]=ut*T+pt*H+q*j-nt*tt,F[7]=pt*T-q*tt-nt*j-ut*H,F;}function w(F,z,Z){var tt=-z[0],j=-z[1],H=-z[2],T=z[3],A=z[4],U=z[5],G=z[6],J=z[7],q=A*T+J*tt+U*H-G*j,nt=U*T+J*j+G*tt-A*H,ut=G*T+J*H+A*j-U*tt,pt=J*T-A*tt-U*j-G*H;return n.rotateY(F,z,Z),tt=F[0],j=F[1],H=F[2],T=F[3],F[4]=q*T+pt*tt+nt*H-ut*j,F[5]=nt*T+pt*j+ut*tt-q*H,F[6]=ut*T+pt*H+q*j-nt*tt,F[7]=pt*T-q*tt-nt*j-ut*H,F;}function B(F,z,Z){var tt=-z[0],j=-z[1],H=-z[2],T=z[3],A=z[4],U=z[5],G=z[6],J=z[7],q=A*T+J*tt+U*H-G*j,nt=U*T+J*j+G*tt-A*H,ut=G*T+J*H+A*j-U*tt,pt=J*T-A*tt-U*j-G*H;return n.rotateZ(F,z,Z),tt=F[0],j=F[1],H=F[2],T=F[3],F[4]=q*T+pt*tt+nt*H-ut*j,F[5]=nt*T+pt*j+ut*tt-q*H,F[6]=ut*T+pt*H+q*j-nt*tt,F[7]=pt*T-q*tt-nt*j-ut*H,F;}function E(F,z,Z){var tt=Z[0],j=Z[1],H=Z[2],T=Z[3],A=z[0],U=z[1],G=z[2],J=z[3];return F[0]=A*T+J*tt+U*H-G*j,F[1]=U*T+J*j+G*tt-A*H,F[2]=G*T+J*H+A*j-U*tt,F[3]=J*T-A*tt-U*j-G*H,A=z[4],U=z[5],G=z[6],J=z[7],F[4]=A*T+J*tt+U*H-G*j,F[5]=U*T+J*j+G*tt-A*H,F[6]=G*T+J*H+A*j-U*tt,F[7]=J*T-A*tt-U*j-G*H,F;}function b(F,z,Z){var tt=z[0],j=z[1],H=z[2],T=z[3],A=Z[0],U=Z[1],G=Z[2],J=Z[3];return F[0]=tt*J+T*A+j*G-H*U,F[1]=j*J+T*U+H*A-tt*G,F[2]=H*J+T*G+tt*U-j*A,F[3]=T*J-tt*A-j*U-H*G,A=Z[4],U=Z[5],G=Z[6],J=Z[7],F[4]=tt*J+T*A+j*G-H*U,F[5]=j*J+T*U+H*A-tt*G,F[6]=H*J+T*G+tt*U-j*A,F[7]=T*J-tt*A-j*U-H*G,F;}function W(F,z,Z,tt){if(Math.abs(tt)<r.EPSILON)return M(F,z);var j=Math.hypot(Z[0],Z[1],Z[2]);tt=tt*0.5;var H=Math.sin(tt),T=H*Z[0]/j,A=H*Z[1]/j,U=H*Z[2]/j,G=Math.cos(tt),J=z[0],q=z[1],nt=z[2],ut=z[3];F[0]=J*G+ut*T+q*U-nt*A,F[1]=q*G+ut*A+nt*T-J*U,F[2]=nt*G+ut*U+J*A-q*T,F[3]=ut*G-J*T-q*A-nt*U;var pt=z[4],yt=z[5],Tt=z[6],vt=z[7];return F[4]=pt*G+vt*T+yt*U-Tt*A,F[5]=yt*G+vt*A+Tt*T-pt*U,F[6]=Tt*G+vt*U+pt*A-yt*T,F[7]=vt*G-pt*T-yt*A-Tt*U,F;}function D(F,z,Z){return F[0]=z[0]+Z[0],F[1]=z[1]+Z[1],F[2]=z[2]+Z[2],F[3]=z[3]+Z[3],F[4]=z[4]+Z[4],F[5]=z[5]+Z[5],F[6]=z[6]+Z[6],F[7]=z[7]+Z[7],F;}function R(F,z,Z){var tt=z[0],j=z[1],H=z[2],T=z[3],A=Z[4],U=Z[5],G=Z[6],J=Z[7],q=z[4],nt=z[5],ut=z[6],pt=z[7],yt=Z[0],Tt=Z[1],vt=Z[2],mt=Z[3];return F[0]=tt*mt+T*yt+j*vt-H*Tt,F[1]=j*mt+T*Tt+H*yt-tt*vt,F[2]=H*mt+T*vt+tt*Tt-j*yt,F[3]=T*mt-tt*yt-j*Tt-H*vt,F[4]=tt*J+T*A+j*G-H*U+q*mt+pt*yt+nt*vt-ut*Tt,F[5]=j*J+T*U+H*A-tt*G+nt*mt+pt*Tt+ut*yt-q*vt,F[6]=H*J+T*G+tt*U-j*A+ut*mt+pt*vt+q*Tt-nt*yt,F[7]=T*J-tt*A-j*U-H*G+pt*mt-q*yt-nt*Tt-ut*vt,F;}var Y=R;function V(F,z,Z){return F[0]=z[0]*Z,F[1]=z[1]*Z,F[2]=z[2]*Z,F[3]=z[3]*Z,F[4]=z[4]*Z,F[5]=z[5]*Z,F[6]=z[6]*Z,F[7]=z[7]*Z,F;}var Q=n.dot;function et(F,z,Z,tt){var j=1-tt;return Q(z,Z)<0&&(tt=-tt),F[0]=z[0]*j+Z[0]*tt,F[1]=z[1]*j+Z[1]*tt,F[2]=z[2]*j+Z[2]*tt,F[3]=z[3]*j+Z[3]*tt,F[4]=z[4]*j+Z[4]*tt,F[5]=z[5]*j+Z[5]*tt,F[6]=z[6]*j+Z[6]*tt,F[7]=z[7]*j+Z[7]*tt,F;}function it(F,z){var Z=lt(z);return F[0]=-z[0]/Z,F[1]=-z[1]/Z,F[2]=-z[2]/Z,F[3]=z[3]/Z,F[4]=-z[4]/Z,F[5]=-z[5]/Z,F[6]=-z[6]/Z,F[7]=z[7]/Z,F;}function $(F,z){return F[0]=-z[0],F[1]=-z[1],F[2]=-z[2],F[3]=z[3],F[4]=-z[4],F[5]=-z[5],F[6]=-z[6],F[7]=z[7],F;}var K=n.length,rt=K,lt=n.squaredLength,ct=lt;function gt(F,z){var Z=lt(z);if(Z>0){Z=Math.sqrt(Z);var tt=z[0]/Z,j=z[1]/Z,H=z[2]/Z,T=z[3]/Z,A=z[4],U=z[5],G=z[6],J=z[7],q=tt*A+j*U+H*G+T*J;F[0]=tt,F[1]=j,F[2]=H,F[3]=T,F[4]=(A-tt*q)/Z,F[5]=(U-j*q)/Z,F[6]=(G-H*q)/Z,F[7]=(J-T*q)/Z;}return F;}function st(F){return"quat2("+F[0]+", "+F[1]+", "+F[2]+", "+F[3]+", "+F[4]+", "+F[5]+", "+F[6]+", "+F[7]+")";}function Ot(F,z){return F[0]===z[0]&&F[1]===z[1]&&F[2]===z[2]&&F[3]===z[3]&&F[4]===z[4]&&F[5]===z[5]&&F[6]===z[6]&&F[7]===z[7];}function St(F,z){var Z=F[0],tt=F[1],j=F[2],H=F[3],T=F[4],A=F[5],U=F[6],G=F[7],J=z[0],q=z[1],nt=z[2],ut=z[3],pt=z[4],yt=z[5],Tt=z[6],vt=z[7];return Math.abs(Z-J)<=r.EPSILON*Math.max(1,Math.abs(Z),Math.abs(J))&&Math.abs(tt-q)<=r.EPSILON*Math.max(1,Math.abs(tt),Math.abs(q))&&Math.abs(j-nt)<=r.EPSILON*Math.max(1,Math.abs(j),Math.abs(nt))&&Math.abs(H-ut)<=r.EPSILON*Math.max(1,Math.abs(H),Math.abs(ut))&&Math.abs(T-pt)<=r.EPSILON*Math.max(1,Math.abs(T),Math.abs(pt))&&Math.abs(A-yt)<=r.EPSILON*Math.max(1,Math.abs(A),Math.abs(yt))&&Math.abs(U-Tt)<=r.EPSILON*Math.max(1,Math.abs(U),Math.abs(Tt))&&Math.abs(G-vt)<=r.EPSILON*Math.max(1,Math.abs(G),Math.abs(vt));}},/* 11 *//***/function(u,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 l;}),t.d(e,"copy",function(){return o;}),t.d(e,"set",function(){return a;}),t.d(e,"add",function(){return c;}),t.d(e,"subtract",function(){return y;}),t.d(e,"multiply",function(){return f;}),t.d(e,"divide",function(){return g;}),t.d(e,"ceil",function(){return x;}),t.d(e,"floor",function(){return M;}),t.d(e,"min",function(){return S;}),t.d(e,"max",function(){return P;}),t.d(e,"round",function(){return C;}),t.d(e,"scale",function(){return h;}),t.d(e,"scaleAndAdd",function(){return p;}),t.d(e,"distance",function(){return d;}),t.d(e,"squaredDistance",function(){return v;}),t.d(e,"length",function(){return I;}),t.d(e,"squaredLength",function(){return L;}),t.d(e,"negate",function(){return w;}),t.d(e,"inverse",function(){return B;}),t.d(e,"normalize",function(){return E;}),t.d(e,"dot",function(){return b;}),t.d(e,"cross",function(){return W;}),t.d(e,"lerp",function(){return D;}),t.d(e,"random",function(){return R;}),t.d(e,"transformMat2",function(){return Y;}),t.d(e,"transformMat2d",function(){return V;}),t.d(e,"transformMat3",function(){return Q;}),t.d(e,"transformMat4",function(){return et;}),t.d(e,"rotate",function(){return it;}),t.d(e,"angle",function(){return $;}),t.d(e,"zero",function(){return K;}),t.d(e,"str",function(){return rt;}),t.d(e,"exactEquals",function(){return lt;}),t.d(e,"equals",function(){return ct;}),t.d(e,"len",function(){return gt;}),t.d(e,"sub",function(){return st;}),t.d(e,"mul",function(){return Ot;}),t.d(e,"div",function(){return St;}),t.d(e,"dist",function(){return F;}),t.d(e,"sqrDist",function(){return z;}),t.d(e,"sqrLen",function(){return Z;}),t.d(e,"forEach",function(){return tt;});var r=t(2);function n(){var j=new r.ARRAY_TYPE(2);return r.ARRAY_TYPE!=Float32Array&&(j[0]=0,j[1]=0),j;}function s(j){var H=new r.ARRAY_TYPE(2);return H[0]=j[0],H[1]=j[1],H;}function l(j,H){var T=new r.ARRAY_TYPE(2);return T[0]=j,T[1]=H,T;}function o(j,H){return j[0]=H[0],j[1]=H[1],j;}function a(j,H,T){return j[0]=H,j[1]=T,j;}function c(j,H,T){return j[0]=H[0]+T[0],j[1]=H[1]+T[1],j;}function y(j,H,T){return j[0]=H[0]-T[0],j[1]=H[1]-T[1],j;}function f(j,H,T){return j[0]=H[0]*T[0],j[1]=H[1]*T[1],j;}function g(j,H,T){return j[0]=H[0]/T[0],j[1]=H[1]/T[1],j;}function x(j,H){return j[0]=Math.ceil(H[0]),j[1]=Math.ceil(H[1]),j;}function M(j,H){return j[0]=Math.floor(H[0]),j[1]=Math.floor(H[1]),j;}function S(j,H,T){return j[0]=Math.min(H[0],T[0]),j[1]=Math.min(H[1],T[1]),j;}function P(j,H,T){return j[0]=Math.max(H[0],T[0]),j[1]=Math.max(H[1],T[1]),j;}function C(j,H){return j[0]=Math.round(H[0]),j[1]=Math.round(H[1]),j;}function h(j,H,T){return j[0]=H[0]*T,j[1]=H[1]*T,j;}function p(j,H,T,A){return j[0]=H[0]+T[0]*A,j[1]=H[1]+T[1]*A,j;}function d(j,H){var T=H[0]-j[0],A=H[1]-j[1];return Math.hypot(T,A);}function v(j,H){var T=H[0]-j[0],A=H[1]-j[1];return T*T+A*A;}function I(j){var H=j[0],T=j[1];return Math.hypot(H,T);}function L(j){var H=j[0],T=j[1];return H*H+T*T;}function w(j,H){return j[0]=-H[0],j[1]=-H[1],j;}function B(j,H){return j[0]=1/H[0],j[1]=1/H[1],j;}function E(j,H){var T=H[0],A=H[1],U=T*T+A*A;return U>0&&(U=1/Math.sqrt(U)),j[0]=H[0]*U,j[1]=H[1]*U,j;}function b(j,H){return j[0]*H[0]+j[1]*H[1];}function W(j,H,T){var A=H[0]*T[1]-H[1]*T[0];return j[0]=j[1]=0,j[2]=A,j;}function D(j,H,T,A){var U=H[0],G=H[1];return j[0]=U+A*(T[0]-U),j[1]=G+A*(T[1]-G),j;}function R(j,H){H=H||1;var T=r.RANDOM()*2*Math.PI;return j[0]=Math.cos(T)*H,j[1]=Math.sin(T)*H,j;}function Y(j,H,T){var A=H[0],U=H[1];return j[0]=T[0]*A+T[2]*U,j[1]=T[1]*A+T[3]*U,j;}function V(j,H,T){var A=H[0],U=H[1];return j[0]=T[0]*A+T[2]*U+T[4],j[1]=T[1]*A+T[3]*U+T[5],j;}function Q(j,H,T){var A=H[0],U=H[1];return j[0]=T[0]*A+T[3]*U+T[6],j[1]=T[1]*A+T[4]*U+T[7],j;}function et(j,H,T){var A=H[0],U=H[1];return j[0]=T[0]*A+T[4]*U+T[12],j[1]=T[1]*A+T[5]*U+T[13],j;}function it(j,H,T,A){var U=H[0]-T[0],G=H[1]-T[1],J=Math.sin(A),q=Math.cos(A);return j[0]=U*q-G*J+T[0],j[1]=U*J+G*q+T[1],j;}function $(j,H){var T=j[0],A=j[1],U=H[0],G=H[1],J=Math.sqrt(T*T+A*A)*Math.sqrt(U*U+G*G),q=J&&(T*U+A*G)/J;return Math.acos(Math.min(Math.max(q,-1),1));}function K(j){return j[0]=0,j[1]=0,j;}function rt(j){return"vec2("+j[0]+", "+j[1]+")";}function lt(j,H){return j[0]===H[0]&&j[1]===H[1];}function ct(j,H){var T=j[0],A=j[1],U=H[0],G=H[1];return Math.abs(T-U)<=r.EPSILON*Math.max(1,Math.abs(T),Math.abs(U))&&Math.abs(A-G)<=r.EPSILON*Math.max(1,Math.abs(A),Math.abs(G));}var gt=I,st=y,Ot=f,St=g,F=d,z=v,Z=L,tt=function(){var j=n();return function(H,T,A,U,G,J){var q,nt;for(T||(T=2),A||(A=0),U?nt=Math.min(U*T+A,H.length):nt=H.length,q=A;q<nt;q+=T)j[0]=H[q],j[1]=H[q+1],G(j,j,J),H[q]=j[0],H[q+1]=j[1];return H;};}();},/* 12 *//***/function(u,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 l=t(29);t.d(e,"MeshCloud",function(){return l["default"];});var o=t(23);t.d(e,"parseFont",function(){return o["default"];});var a=t(31);t.d(e,"parseColor",function(){return a["default"];});var c=t(21);t.d(e,"ENV",function(){return c["default"];}),t(1).glMatrix.setMatrixArrayType(Array);},/* 13 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return B;});var r=t(14),n=t(1),s=t(20),l=t(27),o=t(25),a=t(40),c=t(56),y=t(29),f=t(59),g=t(21),x=t(63);t(1).glMatrix.setMatrixArrayType(Array);var M={autoUpdate:!1,// premultipliedAlpha: true,
|
|
32
|
+
preserveDrawingBuffer:!1,// depth: false,
|
|
33
|
+
// antialias: false,
|
|
34
|
+
bufferSize:1500},S="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",C=Symbol("glRenderer"),h=Symbol("canvasRenderer"),p=Symbol("options"),d=Symbol("globalTransform"),v=Symbol("applyGlobalTransform"),I=Symbol("canvas");function L(E){var b=E.gl,W=E.fbo;W&&b.bindFramebuffer(b.FRAMEBUFFER,W),E._draw(),W&&b.bindFramebuffer(b.FRAMEBUFFER,null);}function w(E,b,W,D){var R=E.createTexture(b.canvas),Y=[[[0,0],[W,0],[W,D],[0,D],[0,0]]];Y.closed=!0;var V=new c["default"]({contours:Y});V.setTexture(R),E.setMeshData([V.meshData]),L(E),R["delete"](),b.clearRect(0,0,W,D),delete b._filter;}var B=/*#__PURE__*/function(){function B(b){var W=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,B);var D=W.contextType;if(D||(typeof WebGL2RenderingContext=="function"?D="webgl2":typeof WebGLRenderingContext=="function"?D="webgl":D="2d"),!b.getContext){var R=b;b={getContext:function getContext(){return R;},width:W.width,height:W.height},R.canvas=b,D="2d";}if(this[I]=b,D!=="webgl"&&D!=="webgl2"&&D!=="2d")throw new Error("Unknown context type ".concat(D));if(W.contextType=D,this[p]=Object.assign({},M,W),D==="webgl"||D==="webgl2"){D==="webgl2"&&(this[p].webgl2=!0);var _R=new r["default"](b,this[p]);D==="webgl2"&&!_R.isWebGL2&&(W.contextType="webgl"),Object(x.createShaders)(_R),Object(x.applyShader)(_R),Object(x.createCloudShaders)(_R);var Y=_R.gl;Y.clearColor(0,0,0,0),Y.blendFuncSeparate(Y.SRC_ALPHA,Y.ONE_MINUS_SRC_ALPHA,Y.ONE,Y.ONE_MINUS_SRC_ALPHA),this[C]=_R;}else this[h]=new s["default"](b,this[p]);this[d]=[1,0,0,0,1,0,0,0,1],this.updateResolution();}return _createClass(B,[{key:"canvas",get:function get(){return this[I];}},{key:"canvasRenderer",get:function get(){return this[h];}},{key:"glRenderer",get:function get(){return this[C];}},{key:"isWebGL2",get:function get(){return this[C]&&this[C].isWebGL2;}},{key:"options",get:function get(){return this[p];}},{key:"globalTransformMatrix",get:function get(){var b=this[d];return[b[0],b[1],b[3],b[4],b[6],b[7]];}},{key:"viewMatrix",get:function get(){return this[d];}},{key:v,value:function value(){var b=this[C]||this[h];if(this[C]){var _this$canvas=this.canvas,W=_this$canvas.width,D=_this$canvas.height;b.uniforms.viewMatrix=this.viewMatrix,b.uniforms.projectionMatrix=this.projectionMatrix,b.uniforms.u_resolution=[W,D];}}},{key:"updateResolution",value:function updateResolution(){var _this$canvas2=this.canvas,b=_this$canvas2.width,W=_this$canvas2.height,D=[// translation
|
|
35
|
+
1,0,0,0,1,0,-b/2,-W/2,1],R=[// scale
|
|
36
|
+
2/b,0,0,0,-2/W,0,0,0,1],Y=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),R,D);this.projectionMatrix=Y,this[C]&&this[C].gl.viewport(0,0,b,W);}},{key:"createTexture",value:function createTexture(b,W){return(this[C]||this[h]).createTexture(b,W);}/* async */},{key:"loadTexture",value:function loadTexture(b){var _ref2=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref2$useImageBitmap=_ref2.useImageBitmap,W=_ref2$useImageBitmap===void 0?!1:_ref2$useImageBitmap;return(this[C]||this[h]).loadTexture(b,{useImageBitmap:W});}},{key:"createText",value:function createText(b){var _ref3=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref3$font=_ref3.font,W=_ref3$font===void 0?"16px arial":_ref3$font,_ref3$fillColor=_ref3.fillColor,D=_ref3$fillColor===void 0?null:_ref3$fillColor,_ref3$strokeColor=_ref3.strokeColor,R=_ref3$strokeColor===void 0?null:_ref3$strokeColor,_ref3$strokeWidth=_ref3.strokeWidth,Y=_ref3$strokeWidth===void 0?1:_ref3$strokeWidth;if(this[C]){var V=g["default"].createText(b,{font:W,fillColor:D,strokeColor:R,strokeWidth:Y});return{image:this.createTexture(V.image),rect:V.rect};}return{_img:{font:W,fillColor:D,strokeColor:R,strokeWidth:Y,text:b}};}},{key:"createProgram",value:function createProgram(){var _ref4=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},b=_ref4.vertex,W=_ref4.fragment,D=_ref4.options;if(this[C]){var R=this[C].compileSync(W,b);return R._attribOpts=D,R;}throw new Error("Context 2D cannot create webgl program.");}},{key:"createPassProgram",value:function createPassProgram(){var _ref5=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref5$vertex=_ref5.vertex,b=_ref5$vertex===void 0?S:_ref5$vertex,_ref5$fragment=_ref5.fragment,W=_ref5$fragment===void 0?P:_ref5$fragment,D=_ref5.options;return this.createProgram({vertex:b,fragment:W,options:D});}},{key:"useProgram",value:function useProgram(b){var W=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(this[C]){var D=Object.assign({},b._attribOpts,W);return this[C].useProgram(b,D);}throw new Error("Context 2D cannot use webgl program.");}},{key:"deleteTexture",value:function deleteTexture(b){return(this[C]||this[h]).deleteTexture(b);}},{key:"clear",value:function clear(){var _this$h;if(this[C]){var W=this[C].gl;W.clear(W.COLOR_BUFFER_BIT);}else(_this$h=this[h]).clear.apply(_this$h,arguments);}},{key:"drawMeshCloud",value:function drawMeshCloud(b){var _ref6=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref6$clear=_ref6.clear,W=_ref6$clear===void 0?!1:_ref6$clear,_ref6$program=_ref6.program,D=_ref6$program===void 0?null:_ref6$program;var R=this[C]||this[h],Y=D||b.program;if(this[C]){var V=R.gl;if(W&&V.clear(V.COLOR_BUFFER_BIT),Y)R.program!==Y&&this.useProgram(Y,{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 Q=b.mesh.meshData,et=!!Q.uniforms.u_texSampler,it=!!Q.uniforms.u_filterFlag,$=!!Q.uniforms.u_radialGradientVector,K=b.hasCloudColor,rt=b.hasCloudFilter,lt=!!Q.uniforms.u_clipSampler;Object(x.applyCloudShader)(R,{hasTexture:et,hasFilter:it,hasGradient:$,hasCloudColor:K,hasCloudFilter:rt,hasClipPath:lt});}this[v](),R.setMeshData([b.meshData]),b.beforeRender&&b.beforeRender(V,b),L(R),b.afterRender&&b.afterRender(V,b);}else R.setTransform(this.globalTransformMatrix),R.drawMeshCloud(b,{clear:W,hook:!1});}},{key:"drawMeshes",value:function drawMeshes(b){var _this14=this;var _ref7=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref7$clear=_ref7.clear,W=_ref7$clear===void 0?!1:_ref7$clear,_ref7$program=_ref7.program,D=_ref7$program===void 0?null:_ref7$program;var R=this[C]||this[h];if(this[C]){var Y=R.fbo,V=Object(l["default"])(this,b,D==null),Q=R.gl;W&&Q.clear(Q.COLOR_BUFFER_BIT);var et=!Object(f.isUnitTransform)(this.globalTransformMatrix);this._drawCalls=0;var _iterator12=_createForOfIteratorHelper(V),_step12;try{var _loop=function _loop(){var it=_step12.value;_this14._drawCalls++;var $=D||it.program;if(it instanceof y["default"])_this14.drawMeshCloud(it,{clear:W,program:$});else{var _this14$canvas=_this14.canvas,K=_this14$canvas.width,rt=_this14$canvas.height;if(it.beforeRender&&it.beforeRender(Q,it),it.pass.length&&((!_this14.fbo||_this14.fbo.width!==K||_this14.fbo.height!==rt)&&(_this14.fbo={width:K,height:rt,target:R.createFBO(),buffer:R.createFBO(),swap:function swap(){var _ref8=[this.buffer,this.target];this.target=_ref8[0];this.buffer=_ref8[1];}}),R.bindFBO(_this14.fbo.target)),!$&&it.filterCanvas){Object(x.applyShader)(R,{hasTexture:!0});var lt=_this14.filterContext;lt||(lt=g["default"].createCanvas(K,rt).getContext("2d"),_this14.filterContext=lt);var ct=b[it.packIndex],gt=ct.filter,st=b[it.packIndex+1],Ot=b[it.packIndex-1];(!Ot||!Ot.filterCanvas||Ot.filter!==gt)&&(!st||!st.filterCanvas||st.filter!==gt)?(et?(lt.save(),Object(o.drawMesh2D)(ct,lt,!1),lt.restore(),Object(o.applyFilter)(lt,gt)):Object(o.drawMesh2D)(ct,lt,!0),_this14[v](),w(R,lt,K,rt)):(et&<.save(),Object(o.drawMesh2D)(ct,lt,!1),et&<.restore(),(!st||!st.filterCanvas||ct.filter!==st.filter)&&(Object(o.applyFilter)(lt,gt),_this14[v](),w(R,lt,K,rt)));}else{if($)R.program!==$&&_this14.useProgram($,{a_color:{type:"UNSIGNED_BYTE",normalize:!0}});else{var _lt=!!it.uniforms.u_texSampler,_ct=!!it.uniforms.u_filterFlag,_gt=!!it.uniforms.u_radialGradientVector,_st=!!it.uniforms.u_clipSampler;Object(x.applyShader)(R,{hasTexture:_lt,hasFilter:_ct,hasGradient:_gt,hasClipPath:_st});}it.filterCanvas&&console.warn("User program ignored some filter effects."),_this14[v](),R.setMeshData([it]),L(R);}if(it.pass.length){var _lt2=it.pass.length;it.pass.forEach(function(ct,gt){ct.blend=it.enableBlend,ct.setTexture(R.fbo.texture),gt===_lt2-1?R.bindFBO(Y):(_this14.fbo.swap(),R.bindFBO(_this14.fbo.target)),ct.program?R.useProgram(ct.program):(_this14.defaultPassProgram=_this14.defaultPassProgram||_this14.createPassProgram(),R.useProgram(_this14.defaultPassProgram)),R.setMeshData([ct.meshData]),Q.clear(Q.COLOR_BUFFER_BIT),L(R);});}it.afterRender&&it.afterRender(Q,it);}};for(_iterator12.s();!(_step12=_iterator12.n()).done;){_loop();}}catch(err){_iterator12.e(err);}finally{_iterator12.f();}}else R.setTransform(this.globalTransformMatrix),R.drawMeshes(b,{clear:W});}},{key:"drawImage",value:function drawImage(b){for(var _len=arguments.length,W=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){W[_key-1]=arguments[_key];}var D=W.length;if(D<2)throw new TypeError("Failed to execute 'drawImage' on 'Renderer': 3 arguments required, but only ".concat(W.length+1," present."));if(D!==2&&D!==4&&D!==8)throw new TypeError("Failed to execute 'drawImage' on 'Renderer': Valid arities are: [3, 5, 9], but ".concat(W.length+1," arguments provided."));var R=null,Y=null;D===2?R=[W[0],W[1],b.width,b.height]:D===4?R=W:D===8&&(Y=W.slice(0,4),R=W.slice(4));var V=this.createTexture(b),_this$canvas3=this.canvas,Q=_this$canvas3.width,et=_this$canvas3.height,it=new a["default"]();it.rect(R[0],R[1],Q,et);var $=new c["default"](it,{width:Q,height:et});$.setTexture(V,{rect:R,srcRect:Y}),this.drawMeshes([$]),this.deleteTexture(V);}},{key:"setGlobalTransform",value:function setGlobalTransform(){return this[d]=[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 W=this[d];for(var _len2=arguments.length,b=new Array(_len2),_key2=0;_key2<_len2;_key2++){b[_key2]=arguments[_key2];}return this[d]=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),W,b),this;}},{key:"globalTranslate",value:function globalTranslate(b,W){var D=n.mat3.create();return D=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),D,[b,W]),this.globalTransform.apply(this,_toConsumableArray(D));}},{key:"globalRotate",value:function globalRotate(b){var _ref9=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[0,0],_ref10=_slicedToArray(_ref9,2),W=_ref10[0],D=_ref10[1];var R=n.mat3.create();return R=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),R,[W,D]),R=n.mat3.rotate(Array.of(0,0,0,0,0,0,0,0,0),R,b),R=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),R,[-W,-D]),this.globalTransform.apply(this,_toConsumableArray(R));}},{key:"globalScale",value:function globalScale(b){var W=arguments.length>1&&arguments[1]!==undefined?arguments[1]:b;var _ref11=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref12=_slicedToArray(_ref11,2),D=_ref12[0],R=_ref12[1];var Y=n.mat3.create();return Y=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),Y,[D,R]),Y=n.mat3.scale(Array.of(0,0,0,0,0,0,0,0,0),Y,[b,W]),Y=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),Y,[-D,-R]),this.globalTransform.apply(this,_toConsumableArray(Y));}},{key:"globalSkew",value:function globalSkew(b){var W=arguments.length>1&&arguments[1]!==undefined?arguments[1]:b;var _ref13=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref14=_slicedToArray(_ref13,2),D=_ref14[0],R=_ref14[1];var Y=n.mat3.create();return Y=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),Y,[D,R]),Y=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),Y,n.mat3.fromValues(1,Math.tan(W),Math.tan(b),1,0,0)),Y=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),Y,[-D,-R]),this.globalTransform.apply(this,_toConsumableArray(Y));}},{key:"transformPoint",value:function transformPoint(b,W,D){var R=this.globalTransformMatrix;D&&(R=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),R,D));var Y=b*R[0]+W*R[2]+R[4],V=b*R[1]+W*R[3]+R[5];return[Y,V];}}]);}();},/* 14 *//***/function(u,e,t){t.r(e);var r=t(15);t(1).glMatrix.setMatrixArrayType(Array),e["default"]=r["default"];},/* 15 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return x;});var r=t(16),n=t(17),s=t(18),l=t(19);t(1).glMatrix.setMatrixArrayType(Array);function o(M,S,P){return S in M?Object.defineProperty(M,S,{value:P,enumerable:!0,configurable:!0,writable:!0}):M[S]=P,M;}var a={};function c(M){var S=arguments.length>1&&arguments[1]!==undefined?arguments[1]:3;var P=[],C=M.length;for(var h=0;h<C;h++)h%S<2&&P.push(0.5*(M[h]+1));return P;}function y(M,S){var P=S._buffers;Object.values(P).forEach(function(C){M.deleteBuffer(C);}),S._buffers={};}function f(M,S,P){return M.activeTexture(M.TEXTURE0+P),Array.isArray(S._img)?M.bindTexture(M.TEXTURE_CUBE_MAP,S):M.bindTexture(M.TEXTURE_2D,S),S;}var g={"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 x=/*#__PURE__*/function(){function x(S){var P=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,x);this.options=Object.assign({},x.defaultOptions,P),this.canvas=S;var C;this.options.webgl2&&(C=S.getContext("webgl2",this.options)),C==null&&(C=Object(r.setupWebGL)(S,this.options),this.aia_ext=C.getExtension("ANGLE_instanced_arrays")),this.gl=C,C.viewport(0,0,S.width,S.height),C.clearColor(0,0,0,0),C.blendFuncSeparate(C.SRC_ALPHA,C.ONE_MINUS_SRC_ALPHA,C.ONE,C.ONE_MINUS_SRC_ALPHA),this.programs=[],this._events={};}return _createClass(x,[{key:"program",get:function get(){var S=this.gl;return S.getParameter(S.CURRENT_PROGRAM);}// WebGLRenderingContext.uniform[1234][fi][v]()
|
|
37
|
+
// WebGLRenderingContext.uniformMatrix[234]fv()
|
|
38
|
+
},{key:"_declareUniform",value:function _declareUniform(S,P){var C=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"1f";var h=this.gl,p=h.getUniformLocation(S,P);var d;var v=this;if(/^sampler/.test(C)){var I=S._samplerMap,L=S._bindTextures;Object.defineProperty(S.uniforms,P,{get:function get(){return d;},set:function set(w){d=w;var B=I[P]!=null?I[P]:L.length;L[B]=w,f(h,w,B),I[P]||(I[P]=B,h.uniform1i(p,B)),v.options.autoUpdate&&v.update();},configurable:!1,enumerable:!0});}else{var _I=C.indexOf("Matrix")===0,_L=!_I&&/v$/.test(C),w=h["uniform".concat(C)].bind(h);Object.defineProperty(S.uniforms,P,{get:function get(){return d;},set:function set(B){d=B,typeof B=="number"&&(B=[B]),_I?w(p,!1,B):_L?w(p,B):w.apply(void 0,[p].concat(_toConsumableArray(B))),v.options.autoUpdate&&v.update();},configurable:!1,enumerable:!0});}}},{key:"_draw",value:function _draw(){var _this15=this;var S=this.program;S.meshData.forEach(function(P,C){var h=P.positions,p=P.cells,d=P.instanceCount,v=P.cellsCount,I=P.attributes,L=P.uniforms,w=P.textureCoord,B=P.enableBlend,E=_this15.gl;var b=P.mode!=null?P.mode:E.TRIANGLES;typeof b=="string"&&(b=E[b]),B?E.enable(E.BLEND):E.disable(E.BLEND),E.bindBuffer(E.ARRAY_BUFFER,S._buffers.verticesBuffer),E.bufferData(E.ARRAY_BUFFER,h,E.STATIC_DRAW),p&&(E.bindBuffer(E.ELEMENT_ARRAY_BUFFER,S._buffers.cellsBuffer),E.bufferData(E.ELEMENT_ARRAY_BUFFER,p,E.STATIC_DRAW));var W=[];I&&Object.values(I).forEach(function(_ref15){var R=_ref15.name,Y=_ref15.data,V=_ref15.divisor;if(E.bindBuffer(E.ARRAY_BUFFER,S._buffers[R]),E.bufferData(E.ARRAY_BUFFER,Y,E.STATIC_DRAW),V!=null){var Q=E.getAttribLocation(S,R);Q>=0&&(E.enableVertexAttribArray(Q),W.push(Q),E.vertexAttribDivisor?E.vertexAttribDivisor(Q,V):_this15.aia_ext&&_this15.aia_ext.vertexAttribDivisorANGLE(Q,V));}}),L&&Object.entries(L).forEach(function(_ref16){var _ref17=_slicedToArray(_ref16,2),R=_ref17[0],Y=_ref17[1];_this15.uniforms[R]=Y;});var D;if(!p){var R=S._dimension;D=h.length/R;}if(S._enableTextures&&S._buffers.texCoordBuffer){var _R2=w||c(h,S._dimension);E.bindBuffer(E.ARRAY_BUFFER,S._buffers.texCoordBuffer),E.bufferData(E.ARRAY_BUFFER,x.FLOAT(_R2),E.STATIC_DRAW);}d!=null?(p?E.drawElementsInstanced?E.drawElementsInstanced(b,v,E.UNSIGNED_SHORT,0,d):_this15.aia_ext&&_this15.aia_ext.drawElementsInstancedANGLE(b,v,E.UNSIGNED_SHORT,0,d):E.drawArraysInstanced?E.drawArraysInstanced(b,0,D,d):_this15.aia_ext.drawArraysInstancedANGLE(b,0,D,d),W.forEach(function(R){E.vertexAttribDivisor?E.vertexAttribDivisor(R,null):_this15.aia_ext&&_this15.aia_ext.vertexAttribDivisorANGLE(R,null);})):p?E.drawElements(b,v,E.UNSIGNED_SHORT,0):E.drawArrays(b,0,D);});}},{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 S=this.program;if(!S||!S.uniforms)throw Error("No avaliable program.");return S.uniforms;}},{key:"deleteProgram",value:function deleteProgram(S){var P=this.gl;this.program===S&&(this.startRender=!1,this._renderFrameID&&(cancelAnimationFrame(this._renderFrameID),delete this._renderFrameID),P.useProgram(null));var C=this.programs.indexOf(S);C>=0&&this.programs.splice(C,1),y(P,S),P.deleteProgram(S);}/**
|
|
39
|
+
[{
|
|
40
|
+
positions: ...
|
|
41
|
+
cells: ...
|
|
42
|
+
textureCoord: ...
|
|
43
|
+
attributes: {name: {data:..., normalize: true}},
|
|
44
|
+
uniforms: ...
|
|
45
|
+
}]
|
|
46
|
+
*/},{key:"setMeshData",value:function setMeshData(S){var _this16=this;Array.isArray(S)||(S=[S]);var P=this.program;P.meshData=S.map(function(_ref18){var C=_ref18.mode,h=_ref18.positions,p=_ref18.instanceCount,d=_ref18.cells,v=_ref18.cellsCount,I=_ref18.attributes,L=_ref18.uniforms,w=_ref18.textureCoord,B=_ref18.enableBlend;var E={positions:x.FLOAT(h),uniforms:L,enableBlend:!!B,textureCoord:x.FLOAT(w)};if(d&&(E.cells=x.USHORT(d),E.cellsCount=v||E.cells.length),C!=null&&(E.mode=C),p!=null){if(!_this16.isWebGL2&&!_this16.aia_ext)throw new Error("Cannot use instanceCount in this rendering context, use webgl2 context instead.");E.instanceCount=p;}if(I){var b={};Object.entries(I).forEach(function(_ref19){var _ref20=_slicedToArray(_ref19,2),W=_ref20[0],D=_ref20[1];if(!P._attribute[W])P._attribute[W]="ignored";else if(P._attribute[W]!=="ignored"){var _P$_attribute$W=P._attribute[W],R=_P$_attribute$W.name,Y=_P$_attribute$W.type;var V=D.data||D;if(Array.isArray(V)&&(V=x[Y](V)),b[W]={name:R,data:V},D.divisor!=null){if(!_this16.isWebGL2&&!_this16.aia_ext)throw new Error("Cannot use divisor in this rendering context, use webgl2 context instead.");b[W].divisor=D.divisor;}}}),E.attributes=b;}return E;}),this.options.autoUpdate&&this.update();}},{key:"createProgram",value:function createProgram(S,P){var _this17=this;var C=/^\s*uniform\s+sampler/mg.test(S);S==null&&(S=s["default"]),P==null&&(P=C?l["default"]:n["default"]);var h=this.gl,p=Object(r.createProgram)(h,P,S);p.shaderText={vertexShader:P,fragmentShader:S},p._buffers={},p._attribute={},p.uniforms={},p._samplerMap={},p._bindTextures=[];var d=new RegExp("(?:attribute|in) vec(\\d) ".concat(this.options.vertexPosition),"im");var v=P.match(d);v&&(p._dimension=Number(v[1]));var I=new RegExp("(?:attribute|in) vec(\\d) ".concat(this.options.vertexTextureCoord),"im");v=P.match(I),v&&(p._texCoordSize=Number(v[1]));var L=/^\s*(?:attribute|in) (\w+?)(\d*) (\w+)/gim;if(v=P.match(L),v)for(var E=0;E<v.length;E++){var b=/^\s*(?:attribute|in) (\w+?)(\d*) (\w+)/im,W=v[E].match(b);if(W&&W[3]!==this.options.vertexPosition&&W[3]!==this.options.vertexTextureCoord){var _W=_slicedToArray(W,4),D=_W[1],R=_W[2],Y=_W[3];D==="mat"&&(R=Math.pow(R,2)),p._buffers[Y]=h.createBuffer(),p._attribute[Y]={name:Y,type:D,size:Number(R)||1};}}var w=/^\s*uniform\s+(\w+)\s+(\w+)(\[\d+\])?/mg;v=P.match(w)||[],v=v.concat(S.match(w)||[]),v.forEach(function(E){var b=E.match(/^\s*uniform\s+(\w+)\s+(\w+)(\[\d+\])?/);var _b$slice=b.slice(1),_b$slice2=_slicedToArray(_b$slice,3),W=_b$slice2[0],D=_b$slice2[1],R=_b$slice2[2];W=g[W],R=!!R,W.indexOf("Matrix")!==0&&R&&(W+="v"),_this17._declareUniform(p,D,W);}),p._buffers.verticesBuffer=h.createBuffer(),p._buffers.cellsBuffer=h.createBuffer();var B=h.getAttribLocation(p,this.options.vertexTextureCoord);return p._enableTextures=B>=0,p._enableTextures&&(p._buffers.texCoordBuffer=h.createBuffer()),this.programs.push(p),p;}},{key:"useProgram",value:function useProgram(S){var P=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};this.startRender=!1,this._renderFrameID&&(cancelAnimationFrame(this._renderFrameID),delete this._renderFrameID);var C=this.gl;C.useProgram(S);var h=S._dimension;C.bindBuffer(C.ARRAY_BUFFER,S._buffers.verticesBuffer);var p=C.getAttribLocation(S,this.options.vertexPosition);if(C.vertexAttribPointer(p,h,C.FLOAT,!1,0,0),C.enableVertexAttribArray(p),S._enableTextures){C.bindBuffer(C.ARRAY_BUFFER,S._buffers.texCoordBuffer);var d=C.getAttribLocation(S,this.options.vertexTextureCoord);C.vertexAttribPointer(d,S._texCoordSize||2,C.FLOAT,!1,0,0),C.enableVertexAttribArray(d);}if(Object.entries(S._attribute).forEach(function(_ref21){var _ref22=_slicedToArray(_ref21,2),d=_ref22[0],v=_ref22[1];if(v!=="ignored"){var I=v.size,L=P[d]||{},w=!!L.normalize;var B=L.type||"FLOAT";var E=L.key||d;B==="UBYTE"&&(B="UNSIGNED_BYTE"),B==="USHORT"&&(B="UNSIGNED_SHORT"),v.type=B,E&&E!==d&&(S._attribute[E]=v),C.bindBuffer(C.ARRAY_BUFFER,S._buffers[d]);var b=C.getAttribLocation(S,d);b>=0&&(C.vertexAttribPointer(b,I,C[B],w,0,0),C.enableVertexAttribArray(b));}}),!S.meshData){var _d2=[[-1,-1,0,1].slice(0,h),[1,-1,0,1].slice(0,h),[1,1,0,1].slice(0,h),[-1,1,0,1].slice(0,h)],v=[[0,1,3],[3,1,2]];this.setMeshData({positions:_d2,cells:v});}return S;}},{key:"compileSync",value:function compileSync(S,P){S=S||s["default"];var C={};function h(I){I=I.replace(/^\s*/mg,"");var L=[],w=I.match(/^#pragma\s+include\s+.*/mg);if(w){for(var B=0;B<w.length;B++){var b=w[B].match(/(?:<|")(.*)(?:>|")/);if(b){var W=b[0].indexOf("<")===0?"lib":"link";var D=b[1];if(D==="graph"&&(D="graphics"),C[D])L.push("/* included ".concat(D," */"));else if(C[D]=!0,W==="lib"){var R=h(a[D]);L.push(R);}else if(W==="link")throw new Error("Cannot load external links synchronously. Use compile instead of compileSync.");}}L.forEach(function(B){I=I.replace(/^#pragma\s+include\s+.*/m,B);});}return I;}var p=h(S),d=P?h(P):null;return this.createProgram(p,d);}},{key:"compile",value:function(){var _compile=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12(S,P){var C,h,_h2,p,d;return _regeneratorRuntime().wrap(function _callee12$(_context12){while(1)switch(_context12.prev=_context12.next){case 0:_h2=function _h4(){_h2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11(I){var L,w,B,b,W,D,R,_R3;return _regeneratorRuntime().wrap(function _callee11$(_context11){while(1)switch(_context11.prev=_context11.next){case 0:I=I.replace(/^\s*/mg,"");L=[],w=I.match(/^#pragma\s+include\s+.*/mg);if(!w){_context11.next=32;break;}B=0;case 4:if(!(B<w.length)){_context11.next=31;break;}b=w[B].match(/(?:<|")(.*)(?:>|")/);if(!b){_context11.next=28;break;}W=b[0].indexOf("<")===0?"lib":"link";D=b[1];if(!(D==="graph"&&(D="graphics"),C[D])){_context11.next=13;break;}L.push("/* included ".concat(D," */"));_context11.next=28;break;case 13:if(!(C[D]=!0,W==="lib")){_context11.next=20;break;}_context11.next=16;return h(a[D]);case 16:R=_context11.sent;L.push(R);_context11.next=28;break;case 20:if(!(W==="link")){_context11.next=28;break;}_context11.next=23;return x.fetchShader(D);case 23:_R3=_context11.sent;_context11.next=26;return h(_R3);case 26:_R3=_context11.sent;L.push(_R3);case 28:B++;_context11.next=4;break;case 31:L.forEach(function(B){I=I.replace(/^#pragma\s+include\s+.*/m,B);});case 32:return _context11.abrupt("return",I);case 33:case"end":return _context11.stop();}},_callee11);}));return _h2.apply(this,arguments);};h=function _h3(_x13){return _h2.apply(this,arguments);};S=S||s["default"];C={};_context12.next=6;return h(S);case 6:p=_context12.sent;if(!P){_context12.next=13;break;}_context12.next=10;return h(P);case 10:_context12.t0=_context12.sent;_context12.next=14;break;case 13:_context12.t0=null;case 14:d=_context12.t0;return _context12.abrupt("return",this.createProgram(p,d));case 16:case"end":return _context12.stop();}},_callee12,this);}));function compile(_x11,_x12){return _compile.apply(this,arguments);}return compile;}()},{key:"load",value:function(){var _load=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee13(S){var P,_args13=arguments;return _regeneratorRuntime().wrap(function _callee13$(_context13){while(1)switch(_context13.prev=_context13.next){case 0:P=_args13.length>1&&_args13[1]!==undefined?_args13[1]:null;_context13.next=3;return x.fetchShader(S);case 3:S=_context13.sent;_context13.t0=P;if(!_context13.t0){_context13.next=9;break;}_context13.next=8;return x.fetchShader(P);case 8:P=_context13.sent;case 9:return _context13.abrupt("return",this.compile(S,P));case 10:case"end":return _context13.stop();}},_callee13,this);}));function load(_x14){return _load.apply(this,arguments);}return load;}()},{key:"createTexture",value:function createTexture(){var _this18=this;var S=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var _ref23=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref23$wrapS=_ref23.wrapS,P=_ref23$wrapS===void 0?this.gl.CLAMP_TO_EDGE:_ref23$wrapS,_ref23$wrapT=_ref23.wrapT,C=_ref23$wrapT===void 0?this.gl.CLAMP_TO_EDGE:_ref23$wrapT,_ref23$minFilter=_ref23.minFilter,h=_ref23$minFilter===void 0?this.gl.LINEAR:_ref23$minFilter,_ref23$magFilter=_ref23.magFilter,p=_ref23$magFilter===void 0?this.gl.LINEAR:_ref23$magFilter;var d=this.gl,v=Array.isArray(S)?d.TEXTURE_CUBE_MAP:d.TEXTURE_2D;this._max_texture_image_units=this._max_texture_image_units||d.getParameter(d.MAX_COMBINED_TEXTURE_IMAGE_UNITS),d.activeTexture(d.TEXTURE0+this._max_texture_image_units-1);var I=d.createTexture();d.bindTexture(v,I),d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL,!0);var _this$canvas4=this.canvas,L=_this$canvas4.width,w=_this$canvas4.height;if(S){if(v===d.TEXTURE_CUBE_MAP)for(var B=0;B<6;B++)d.texImage2D(d.TEXTURE_CUBE_MAP_POSITIVE_X+B,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,S[B]);else d.texImage2D(v,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,S);}else if(v===d.TEXTURE_CUBE_MAP)for(var _B=0;_B<6;_B++)this.gl.texImage2D(this.gl.TEXTURE_CUBE_MAP_POSITIVE_X+_B,0,d.RGBA,L,w,0,d.RGBA,d.UNSIGNED_BYTE,null);else d.texImage2D(v,0,d.RGBA,L,w,0,d.RGBA,d.UNSIGNED_BYTE,null);return d.texParameteri(v,d.TEXTURE_MIN_FILTER,h),d.texParameteri(v,d.TEXTURE_MAG_FILTER,p),d.texParameteri(v,d.TEXTURE_WRAP_S,P),d.texParameteri(v,d.TEXTURE_WRAP_T,C),v===d.TEXTURE_CUBE_MAP&&(S.width=S[0].width,S.height=S[0].height),d.bindTexture(v,null),I._img=S||{width:L,height:w},I["delete"]=function(){_this18.deleteTexture(I);},I;}},{key:"deleteTexture",value:function deleteTexture(S){var P=S._img;this.gl.deleteTexture(S),typeof P.close=="function"&&P.close();}},{key:"loadTexture",value:function(){var _loadTexture=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee14(S){var _ref24,_ref24$useImageBitmap,P,C,_args14=arguments;return _regeneratorRuntime().wrap(function _callee14$(_context14){while(1)switch(_context14.prev=_context14.next){case 0:_ref24=_args14.length>1&&_args14[1]!==undefined?_args14[1]:{},_ref24$useImageBitmap=_ref24.useImageBitmap,P=_ref24$useImageBitmap===void 0?!0:_ref24$useImageBitmap;_context14.next=3;return x.loadImage(S,{useImageBitmap:P});case 3:C=_context14.sent;return _context14.abrupt("return",this.createTexture(C));case 5:case"end":return _context14.stop();}},_callee14,this);}));function loadTexture(_x15){return _loadTexture.apply(this,arguments);}return loadTexture;}()},{key:"createFBO",value:function createFBO(){var _ref25=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref25$color=_ref25.color,S=_ref25$color===void 0?1:_ref25$color,_ref25$blend=_ref25.blend,P=_ref25$blend===void 0?!1:_ref25$blend,_ref25$depth=_ref25.depth,C=_ref25$depth===void 0?this.options.depth!==!1:_ref25$depth,_ref25$stencil=_ref25.stencil,h=_ref25$stencil===void 0?!!this.options.stencil:_ref25$stencil;var p=this.gl,d=p.createFramebuffer();p.bindFramebuffer(p.FRAMEBUFFER,d);var v=[];for(var w=0;w<S;w++){var B=this.createTexture();p.framebufferTexture2D(p.FRAMEBUFFER,p.COLOR_ATTACHMENT0+w,p.TEXTURE_2D,B,0/* level */),v.push(B);}d.textures=v,d.texture=v[0],d.blend=P;var _this$canvas5=this.canvas,I=_this$canvas5.width,L=_this$canvas5.height;return C&&!h&&(d.depthBuffer=p.createRenderbuffer(),p.bindRenderbuffer(p.RENDERBUFFER,d.depthBuffer),p.renderbufferStorage(p.RENDERBUFFER,p.DEPTH_COMPONENT16,I,L),p.framebufferRenderbuffer(p.FRAMEBUFFER,p.DEPTH_ATTACHMENT,p.RENDERBUFFER,d.depthBuffer)),h&&!C&&(d.stencilBuffer=p.createRenderbuffer(),p.bindRenderbuffer(p.RENDERBUFFER,d.stencilBuffer),p.renderbufferStorage(p.RENDERBUFFER,p.STENCIL_INDEX8,I,L),p.framebufferRenderbuffer(p.FRAMEBUFFER,p.STENCIL_ATTACHMENT,p.RENDERBUFFER,d.stencilBuffer)),C&&h&&(d.depthStencilBuffer=p.createRenderbuffer(),p.bindRenderbuffer(p.RENDERBUFFER,d.depthStencilBuffer),p.renderbufferStorage(p.RENDERBUFFER,p.DEPTH_STENCIL,I,L),p.framebufferRenderbuffer(p.FRAMEBUFFER,p.DEPTH_STENCIL_ATTACHMENT,p.RENDERBUFFER,d.depthStencilBuffer)),p.bindFramebuffer(p.FRAMEBUFFER,null),d;}},{key:"bindFBO",value:function bindFBO(){var S=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;this.fbo=S;}},{key:"render",value:function render(){var _ref26=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref26$clearBuffer=_ref26.clearBuffer,S=_ref26$clearBuffer===void 0?!0:_ref26$clearBuffer;this.startRender=!0;var P=this.gl;var C=this.program;C||(C=this.createProgram(),this.useProgram(C)),this.fbo&&P.bindFramebuffer(P.FRAMEBUFFER,this.fbo);var h=this.options.depth;h&&P.enable(P.DEPTH_TEST),this.gl.clear(this.gl.COLOR_BUFFER_BIT|(h?this.gl.DEPTH_BUFFER_BIT:0)|(this.options.stencil?this.gl.STENCIL_BUFFER_BIT:0));var p=this._renderFrameID;this._draw(),this.fbo&&P.bindFramebuffer(P.FRAMEBUFFER,null),this._renderFrameID===p&&(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 S=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};Object.assign(a,S);}},{key:"FLOAT",value:function FLOAT(S,P){return Object(r.pointsToBuffer)(S,Float32Array,P);}},{key:"UNSIGNED_BYTE",value:function UNSIGNED_BYTE(S,P){return Object(r.pointsToBuffer)(S,Uint8Array,P);}},{key:"UNSIGNED_SHORT",value:function UNSIGNED_SHORT(S,P){return Object(r.pointsToBuffer)(S,Uint16Array,P);}},{key:"BYTE",value:function BYTE(S,P){return Object(r.pointsToBuffer)(S,Int8Array,P);}},{key:"SHORT",value:function SHORT(S,P){return Object(r.pointsToBuffer)(S,Int16Array,P);}}]);}();o(x,"defaultOptions",{preserveDrawingBuffer:!0,autoUpdate:!0,vertexPosition:"a_vertexPosition",vertexTextureCoord:"a_vertexTextureCoord",webgl2:!1}),o(x,"UBYTE",x.UNSIGNED_BYTE),o(x,"USHORT",x.UNSIGNED_SHORT),o(x,"fetchShader",r.fetchShader),o(x,"loadImage",r.loadImage);},/* 16 *//***/function(u,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 l;}),t.d(e,"loadImage",function(){return a;}),t.d(e,"fetchShader",function(){return y;}),t(1).glMatrix.setMatrixArrayType(Array);function r(f,g){var x=["webgl","experimental-webgl","webkit-3d","moz-webgl"];var M=null;for(var S=0;S<x.length;++S){try{M=f.getContext(x[S],g);}catch(_unused){}if(M)break;}return M;}function n(f,g){var x=r(f,g);if(!x)throw new Error("Sorry, your browser doesn't support WebGL.");return x;}function s(f,g,x){var M=f.createShader(f.VERTEX_SHADER);if(f.shaderSource(M,g),f.compileShader(M),!f.getShaderParameter(M,f.COMPILE_STATUS)){var _C="Vertex shader failed to compile. The error log is:".concat(f.getShaderInfoLog(M));throw new Error(_C);}var S=f.createShader(f.FRAGMENT_SHADER);if(f.shaderSource(S,x),f.compileShader(S),!f.getShaderParameter(S,f.COMPILE_STATUS)){var _C2="Fragment shader failed to compile. The error log is:".concat(f.getShaderInfoLog(S));throw new Error(_C2);}var P=f.createProgram();if(f.attachShader(P,M),f.attachShader(P,S),f.linkProgram(P),!f.getProgramParameter(P,f.LINK_STATUS)){var _C3="Shader program failed to link. The error log is:".concat(f.getProgramInfoLog(P));throw new Error(_C3);}return f.deleteShader(M),f.deleteShader(S),P;}function l(f){var g=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Float32Array;var x=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;if(x&&!(x instanceof g))throw new TypeError("Wrong buffer type.");if(f==null||f instanceof g)return f;if(f[0]==null||f[0].length==null)return x?(x.set(f,0),x):new g(f);var M=f[0].length,S=f.length;x||(x=new g(M*S));var P=0;for(var _C4=0;_C4<S;_C4++)for(var _h5=0;_h5<M;_h5++)x[P++]=f[_C4][_h5];return x;}var o={};function a(f){var _ref27=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref27$useImageBitmap=_ref27.useImageBitmap,g=_ref27$useImageBitmap===void 0?!0:_ref27$useImageBitmap,_ref27$alias=_ref27.alias,x=_ref27$alias===void 0?null:_ref27$alias;if(!o[f]){if(typeof Image=="function"){var M=new Image();typeof f=="string"&&!((typeof location==="undefined"?"undefined":_typeof(location))=="object"&&/^file:/.test(location.href))&&!/^data:/.test(f)&&(M.crossOrigin="anonymous"),o[f]=new Promise(function(S){M.onload=function(){g&&typeof createImageBitmap=="function"?createImageBitmap(M,{imageOrientation:"flipY"}).then(function(P){o[f]=P,x&&(o[x]=P),S(P);}):(o[f]=M,x&&(o[x]=M),S(M));},M.src=f;}),x&&(o[x]=o[f]);}else if(typeof fetch=="function")return fetch(f,{method:"GET",mode:"cors",cache:"default"}).then(function(M){return M.blob();}).then(function(M){return createImageBitmap(M,{imageOrientation:"flipY"}).then(function(S){return o[f]=S,x&&(o[x]=S),S;});});}return o[f];}var c={};function y(_x16){return _y.apply(this,arguments);}function _y(){_y=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee15(f){var g,x;return _regeneratorRuntime().wrap(function _callee15$(_context15){while(1)switch(_context15.prev=_context15.next){case 0:if(!c[f]){_context15.next=2;break;}return _context15.abrupt("return",c[f]);case 2:_context15.next=4;return fetch(f);case 4:g=_context15.sent;if(!(g.status>=200&&g.status<300)){_context15.next=10;break;}_context15.next=8;return g.text();case 8:x=_context15.sent;return _context15.abrupt("return",(c[f]=x,x));case 10:throw new Error("Shader loaded error.");case 11:case"end":return _context15.stop();}},_callee15);}));return _y.apply(this,arguments);}},/* 17 *//***/function(u,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(u,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(u,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(u,e,t){t.r(e),t.d(e,"default",function(){return l;});var r=t(21),n=t(25);t(1).glMatrix.setMatrixArrayType(Array);var s=Symbol("transform");var l=/*#__PURE__*/function(){function l(a,c){_classCallCheck(this,l);this.context=a.getContext("2d"),this.options=c,this[s]=[1,0,0,1,0,0];}return _createClass(l,[{key:"createTexture",value:function createTexture(a){return{_img:a};}},{key:"loadTexture",value:function(){var _loadTexture2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee16(a){var c;return _regeneratorRuntime().wrap(function _callee16$(_context16){while(1)switch(_context16.prev=_context16.next){case 0:_context16.next=2;return r["default"].loadImage(a,{useImageBitmap:!1});case 2:c=_context16.sent;return _context16.abrupt("return",this.createTexture(c));case 4:case"end":return _context16.stop();}},_callee16,this);}));function loadTexture(_x17){return _loadTexture2.apply(this,arguments);}return loadTexture;}()},{key:"deleteTexture",value:function deleteTexture(a){return a;}},{key:"clear",value:function clear(a,c,y,f){var g=this.context;a=a||0,c=c||0,y=y||g.canvas.width-a,f=f||g.canvas.height-c,g.clearRect(a,c,y,f);}},{key:"drawMeshCloud",value:function drawMeshCloud(a){var _ref28=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref28$clear=_ref28.clear,c=_ref28$clear===void 0?!1:_ref28$clear;var y=[];for(var f=0;f<a.amount;f++){var g=a.getTransform(f);var x=a.getTextureFrame(f);x&&(x=x._img);var M=a.getFilter(f),_a$getCloudRGBA=a.getCloudRGBA(f),S=_a$getCloudRGBA.fill,P=_a$getCloudRGBA.stroke;y.push({mesh:a.mesh,_cloudOptions:[S,P,x,g,M]});}a.beforeRender&&a.beforeRender(this.context,a),this.drawMeshes(y,{clear:c,hook:!1}),a.afterRender&&a.afterRender(this.context,a);}},{key:"drawMeshes",value:function drawMeshes(a){var _this19=this;var _ref29=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref29$clear=_ref29.clear,c=_ref29$clear===void 0?!1:_ref29$clear,_ref29$hook=_ref29.hook,y=_ref29$hook===void 0?!0:_ref29$hook;var f=this.context;c&&f.clearRect(0,0,f.canvas.width,f.canvas.height);var g=null;var _f$canvas=f.canvas,x=_f$canvas.width,M=_f$canvas.height,S=a.length;a.forEach(function(P,C){var _P$_cloudOptions,_this19$filterBuffer;var h,p,d,v,I;y&&P.beforeRender&&P.beforeRender(f,P),P._cloudOptions&&(_P$_cloudOptions=_slicedToArray(P._cloudOptions,5),h=_P$_cloudOptions[0],p=_P$_cloudOptions[1],d=_P$_cloudOptions[2],v=_P$_cloudOptions[3],I=_P$_cloudOptions[4],P=P.mesh);var L=P.filter;if(I&&(L=L?"".concat(L," ").concat(I):I),L&&!_this19.filterBuffer&&_this19.filterBuffer!==!1){var w=r["default"].createCanvas(x,M);w?_this19.filterBuffer=w.getContext("2d"):_this19.filterBuffer=!1;}g&&g!==L&&(Object(n.applyFilter)(_this19.filterBuffer,g),f.drawImage(_this19.filterBuffer.canvas,0,0,x,M),_this19.filterBuffer.clearRect(0,0,x,M),g=null),L&&_this19.filterBuffer?(_this19.filterBuffer.save(),(_this19$filterBuffer=_this19.filterBuffer).transform.apply(_this19$filterBuffer,_toConsumableArray(_this19[s])),Object(n.drawMesh2D)(P,_this19.filterBuffer,!1,h,p,d,v),_this19.filterBuffer.restore(),C===S-1?(Object(n.applyFilter)(_this19.filterBuffer,L),f.drawImage(_this19.filterBuffer.canvas,0,0,x,M),_this19.filterBuffer.clearRect(0,0,x,M)):g=L):(f.save(),f.transform.apply(f,_toConsumableArray(_this19[s])),Object(n.drawMesh2D)(P,f,!1,h,p,d,v),f.restore()),y&&P.afterRender&&P.afterRender(f,P);});}},{key:"setTransform",value:function setTransform(a){this[s]=a;}}]);}();},/* 21 *//***/function(u,e,t){t.r(e),function(r){var n=t(14),s=t(23),l=t(24);t(1).glMatrix.setMatrixArrayType(Array);var o={};function a(x,M){var S=x.style,P=x.variant,C=x.weight,h=x.stretch,p=x.size,d=x.pxLineHeight,v=x.family;return h==="normal"?"".concat(S," ").concat(P," ").concat(C," ").concat(p*M,"px/").concat(d*M,"px ").concat(v):"".concat(S," ").concat(P," ").concat(C," ").concat(h," ").concat(p*M,"px/").concat(d*M,"px ").concat(v);}function c(x,_ref30){var M=_ref30.font,S=_ref30.fillColor,P=_ref30.strokeColor,C=_ref30.strokeWidth,_ref30$ratio=_ref30.ratio,h=_ref30$ratio===void 0?1:_ref30$ratio,p=_ref30.textCanvas,_ref30$cachable=_ref30.cachable,d=_ref30$cachable===void 0?!1:_ref30$cachable;var v;if(d){v=[x,M,String(S),String(P),String(C)].join("###");var V=o[v];if(V)return V;}p||(p=f(1,1));var I=p.getContext("2d");I.save(),I.font=M;var _I$measureText=I.measureText(x),L=_I$measureText.width;I.restore();var w=Object(s["default"])(M),B=Math.max(w.pxLineHeight,w.pxHeight*1.13);/italic|oblique/.test(M)&&(L+=B*Math.tan(15*Math.PI/180)),!S&&!P&&(S="#000");var E=I.canvas,b=Math.ceil(L),W=Math.ceil(B);E.width=Math.round(b*h),E.height=Math.round(W*h),I.save(),I.font=a(w,h),I.textAlign="center",I.textBaseline="middle";var D=E.height*0.5+w.pxHeight*0.05*h,R=E.width*0.5;if(S){if(Array.isArray(S))S=Object(l["default"])(S);else if(S.vector){var _V;var _S=S,Q=_S.vector,et=_S.colors;Q.length===6?_V=I.createRadialGradient.apply(I,_toConsumableArray(Q)):_V=I.createLinearGradient.apply(I,_toConsumableArray(Q)),et.forEach(function(_ref31){var it=_ref31.offset,$=_ref31.color;_V.addColorStop(it,$);}),S=_V;}I.fillStyle=S,I.fillText(x,R,D);}if(P){if(I.lineWidth=C*h,Array.isArray(P))P=Object(l["default"])(P);else if(P.vector){var _V2;var _P=P,_Q=_P.vector,_et=_P.colors;_Q.length===6?_V2=I.createRadialGradient.apply(I,_toConsumableArray(_Q)):_V2=I.createLinearGradient.apply(I,_toConsumableArray(_Q)),_et.forEach(function(_ref32){var it=_ref32.offset,$=_ref32.color;_V2.addColorStop(it,$);}),P=_V2;}I.strokeStyle=P,I.strokeText(x,R,D);}I.restore();var Y={image:p,rect:[0,0,b,W]};return d&&(o[v]=Y),Y;}var y=!1;if((typeof navigator==="undefined"?"undefined":_typeof(navigator))=="object"&&typeof navigator.userAgent=="string"){var x=navigator.userAgent.toLowerCase().match(/chrome\/(\d+)/);x&&(y=Number(x[1])<70);}function f(x,M){var S=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var P=S.offscreen||!y&&S.offscreen!==!1;var C;return _typeof(r)<"u"&&typeof r.createCanvas=="function"?C=r.createCanvas(x,M,S):P&&typeof OffscreenCanvas=="function"?C=new OffscreenCanvas(x,M):(C=document.createElement("canvas"),C.width=x,C.height=M),C;}var g={createCanvas:f,createText:c,loadImage:n["default"].loadImage};e["default"]=g;}.call(this,t(22));},/* 22 *//***/function(u,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);}u.exports=t;},/* 23 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return S;}),t(1).glMatrix.setMatrixArrayType(Array);function r(P,C){if(typeof P=="string"){var d=P.trim().match(/^([\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin|%)$/);d?P={size:parseFloat(d[1]),unit:d[2]}:P={size:parseInt(P,10),unit:"px"};}var _P2=P,h=_P2.size,p=_P2.unit;if(p==="pt")h/=0.75;else if(p==="pc")h*=16;else if(p==="in")h*=96;else if(p==="cm")h*=96/2.54;else if(p==="mm")h*=96/25.4;else if(p==="em"||p==="rem"||p==="ex"){if(!C&&typeof getComputedStyle=="function"&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _d3=getComputedStyle(document.documentElement).fontSize;C=r(_d3,16);}h*=C,p==="ex"&&(h/=2);}else if(p==="q")h*=96/25.4/4;else if(p==="vw"||p==="vh"){if((typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _d4=p==="vw"?document.documentElement.clientWidth:document.documentElement.clientHeight;h*=_d4/100;}}else if((p==="vmax"||p==="vmin")&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _d5=document.documentElement.clientWidth,v=document.documentElement.clientHeight;p==="vmax"?h*=Math.max(_d5,v)/100:h*=Math.min(_d5,v)/100;}return h;}var n="bold|bolder|lighter|[1-9]00",s="italic|oblique",l="small-caps",o="ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded",a="px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin|%",c="'([^']+)'|\"([^\"]+)\"|([\\w-]|[\u4E00-\u9FA5])+",y=new RegExp("(".concat(n,") +"),"i"),f=new RegExp("(".concat(s,") +"),"i"),g=new RegExp("(".concat(l,") +"),"i"),x=new RegExp("(".concat(o,") +"),"i"),M=new RegExp("([\\d\\.]+)("+a+")(?:\\/([\\d\\.]+)("+a+"))? *((?:"+c+")( *, *(?:"+c+"))*)");function S(P,C){var h=M.exec(P);if(!h)return;var p=parseFloat(h[3]),d={weight:"normal",style:"normal",stretch:"normal",variant:"normal",size:parseFloat(h[1]),unit:h[2],lineHeight:Number.isFinite(p)?p:void 0,lineHeightUnit:h[4],family:h[5].replace(/ *, */g,",")},v=P.substring(0,h.index),I=y.exec(v),L=f.exec(v),w=g.exec(v),B=x.exec(v);return I&&(d.weight=I[1]),L&&(d.style=L[1]),w&&(d.variant=w[1]),B&&(d.stretch=B[1]),d.pxHeight=r({size:d.size,unit:d.unit},C),d.pxLineHeight=r({size:d.lineHeight||d.size,unit:d.lineHeightUnit||d.unit},C),d;}},/* 24 *//***/function(u,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,l){return l<3?Math.round(s*255):s;}).join(),")");}},/* 25 *//***/function(u,e,t){t.r(e),t.d(e,"applyFilter",function(){return o;}),t.d(e,"drawMesh2D",function(){return c;});var r=t(1),n=t(24),s=t(23),l=t(26);t(1).glMatrix.setMatrixArrayType(Array);function o(y,f){var g=y.canvas;y.save(),y.filter=f,y.drawImage(g,0,0,g.width,g.height),y.restore();}function a(y,f){var g=/rgba\((\d+),(\d+),(\d+),(\d+)\)/;y=y.match(g).slice(1,5).map(Number),f=f.match(g).slice(1,5).map(Number);var x=[],M=f[3];for(var S=0;S<4;S++)x[S]=Object(l.mix)(y[S],f[S],M);return"rgba(".concat(x.join(),")");}function c(y,f){var g=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var x=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;var M=arguments.length>4&&arguments[4]!==undefined?arguments[4]:null;var S=arguments.length>5&&arguments[5]!==undefined?arguments[5]:null;var P=arguments.length>6&&arguments[6]!==undefined?arguments[6]:null;f.save();var C=!1,h=!1;if(f.globalAlpha=y.getOpacity(),y._updateMatrix&&y.transformScale/y.contours.scale>1.5&&y.accurate(y.transformScale),y.lineWidth){var v=y.gradient&&y.gradient.stroke;if(v){var _v2=v,I=_v2.vector,L=_v2.colors;if(I.length===6)v=f.createRadialGradient.apply(f,_toConsumableArray(I));else if(I.length===4)v=f.createLinearGradient.apply(f,_toConsumableArray(I));else if(I.length===3)v=f.createCircularGradient.apply(f,_toConsumableArray(I));else throw new TypeError("Invalid vector dimension.");L.forEach(function(_ref33){var w=_ref33.offset,B=_ref33.color;var E=Object(n["default"])(B);M&&(E=a(E,M)),v.addColorStop(w,E);}),f.strokeStyle=v,C=!0;}else y.strokeStyle&&(M?f.strokeStyle=a(y.strokeStyle,M):f.strokeStyle=y.strokeStyle,C=!0);}C&&(f.lineWidth=y.lineWidth,f.lineJoin=y.lineJoin,f.lineCap=y.lineCap,f.miterLimit=y.miterLimit,y.lineDash&&(f.setLineDash(y.lineDash),y.lineDashOffset&&(f.lineDashOffset=y.lineDashOffset)));var p=y.gradient&&y.gradient.fill;if(p){var _p2=p,_v3=_p2.vector,_I2=_p2.colors;if(_v3.length===6)p=f.createRadialGradient.apply(f,_toConsumableArray(_v3));else if(_v3.length===4)p=f.createLinearGradient.apply(f,_toConsumableArray(_v3));else if(_v3.length===3)p=f.createCircularGradient.apply(f,_toConsumableArray(_v3));else throw new TypeError("Invalid vector dimension.");_I2.forEach(function(_ref34){var L=_ref34.offset,w=_ref34.color;var B=Object(n["default"])(w);M&&(B=a(B,M)),p.addColorStop(L,B);}),f.fillStyle=p,h=!0;}else y.fillStyle&&(x?f.fillStyle=a(y.fillStyle,x):f.fillStyle=y.fillStyle,h=!0);if(P&&f.transform.apply(f,_toConsumableArray(P)),f.transform.apply(f,_toConsumableArray(y.transformMatrix)),y.clipPath){var _v4=y.clipPath,_I3=new Path2D(_v4);f.clip(_I3);}var d=y.contours.length;if(y.contours.forEach(function(v,I){var L=v.length,w=L>1&&r.vec2.equals(v[0],v[L-1]),B=I===d-1&&y.texture;if(v&&L>0){if(h||C||B){f.beginPath(),f.moveTo.apply(f,_toConsumableArray(v[0]));for(var E=1;E<L;E++)E===L-1&&w?f.closePath():f.lineTo.apply(f,_toConsumableArray(v[E]));}if(h&&f.fill(y.fillRule),B){f.save(),f.clip();var _y$texture=y.texture,_E=_y$texture.image,b=_y$texture.options;if(S&&(_E=S),b.repeat&&console.warn("Context 2D not supported image repeat yet."),_E.font){b.scale&&console.warn("Context 2D not supported text scale yet."),b.srcRect&&console.warn("Context 2D not supported text srcRect yet.");var _E2=_E,W=_E2.font,D=_E2.fillColor,R=_E2.strokeColor,Y=_E2.strokeWidth,V=_E2.text;!D&&!R&&(D="#000"),Array.isArray(D)&&(D=Object(n["default"])(D)),Array.isArray(R)&&(R=Object(n["default"])(R)),f.font=W;var _f$measureText=f.measureText(V),Q=_f$measureText.width,et=Object(s["default"])(W),it=Math.max(et.pxLineHeight,et.pxHeight*1.13);f.textAlign="center",f.textBaseline="middle";var $=b.rect,K=$[0]+it*0.5+et.pxHeight*0.06,rt=$[1]+Q*0.5;$[2]!=null&&f.scale($[2]/Q,$[3]/it),D&&(f.fillStyle=D,f.fillText(V,rt,K)),R&&(f.lineWidth=Y,f.strokeStyle=R,f.strokeText(V,rt,K));}else{var _W2=b.rect;var _D=b.srcRect;b.scale&&(_W2=[0,0,f.canvas.width,f.canvas.height]),b.rotated&&_W2&&(_W2=[-_W2[1],_W2[0],_W2[3],_W2[2]]),_D&&(_W2=_W2||[0,0,_D[2],_D[3]]),b.rotated&&(f.translate(0,_W2?_W2[2]:_E.width),f.rotate(-0.5*Math.PI)),_D?f.drawImage.apply(f,[_E].concat(_toConsumableArray(_D),_toConsumableArray(_W2))):_W2?f.drawImage.apply(f,[_E].concat(_toConsumableArray(_W2))):f.drawImage(_E,0,0);}f.restore();}C&&f.stroke();}}),f.restore(),g){var _v5=y.filter;_v5&&o(f,_v5);}}},/* 26 *//***/function(u,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(l,o,a){var _ref35;return o>a&&(_ref35=[a,o],o=_ref35[0],a=_ref35[1],_ref35),l<o?o:l>a?a:l;}function n(l,o,a){return l*(1-a)+o*a;}function s(l,o){var _l2=_slicedToArray(l,2),a=_l2[0],c=_l2[1];return[a*o[0]+c*o[2]+o[4],a*o[1]+c*o[3]+o[5]];}},/* 27 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return a;});var r=t(28),n=t(29);t(1).glMatrix.setMatrixArrayType(Array);function s(c,y,f){var g=c.uniforms||{},x=y.uniforms||{};if(g.u_texSampler&&x.u_texSampler&&g.u_texSampler!==x.u_texSampler)return!1;var M=Object.keys(g),S=Object.keys(x),P=M.indexOf("u_texSampler"),C=S.indexOf("u_texSampler");if(P>=0&&M.splice(P,1),C>=0&&S.splice(C,1),M.length!==S.length)return!1;var h=M.every(function(p){var d=g[p],v=x[p];if(d===v)return!0;if(d.length&&v.length&&d.length===v.length){for(var I=0;I<d.length;I++)if(d[I]!==v[I])return!1;return!0;}return!1;});if(h){if(g.u_texSampler&&!x.u_texSampler)y.setTexture(g.u_texSampler,{hidden:!0});else if(!g.u_texSampler&&x.u_texSampler)for(var p=0;p<f.length;p++)f[p].setTexture(x.u_texSampler,{hidden:!0});}return h;}var l={};function o(c,y){if(c.length){var f=Object(r["default"])(c,l);return f.enableBlend=y,c[0].filterCanvas&&(f.filterCanvas=!0),f.packIndex=c[0].packIndex,f.packLength=c.length,f.beforeRender=c[0].beforeRender,f.pass=c[0].pass,f.afterRender=c[c.length-1].afterRender,c.length=0,f;}}function a(c,y){var f=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;return/*#__PURE__*/_regeneratorRuntime().mark(function _callee17(){var g,x,M,S,P,_C5,_h6,d,p,_d6,v;return _regeneratorRuntime().wrap(function _callee17$(_context17){while(1)switch(_context17.prev=_context17.next){case 0:g=[],x=c.options.bufferSize;M=0,S=!1;P=0;case 3:if(!(P<y.length)){_context17.next=47;break;}_C5=y[P];if(!(_C5 instanceof n["default"])){_context17.next=16;break;}_context17.t0=g.length;if(!_context17.t0){_context17.next=10;break;}_context17.next=10;return o(g,S);case 10:M=0;S=!1;_context17.next=14;return _C5;case 14:_context17.next=44;break;case 16:_h6=_C5.meshData;if(_h6.clipPath&&!_h6.uniforms.u_clipSampler){d=c.createTexture(_h6.clipPath);_h6.uniforms.u_clipSampler=d;}p=0;if(!((!f||!_C5.canIgnore())&&_h6&&_h6.positions.length)){_context17.next=40;break;}_C5.packIndex=P;_d6=_C5.filterCanvas;if(!(p=_h6.positions.length,_d6||M+p>x)){_context17.next=31;break;}_context17.t1=g.length;if(!_context17.t1){_context17.next=27;break;}_context17.next=27;return o(g,S);case 27:M=0;S=!1;_context17.next=39;break;case 31:if(!M){_context17.next=39;break;}v=g[g.length-1];_context17.t2=v&&(v.filterCanvas||v.afterRender||_C5.beforeRender||v.pass.length||_C5.pass.length||v.program!==_C5.program||!s(v,_C5,g));if(!_context17.t2){_context17.next=39;break;}_context17.next=37;return o(g,S);case 37:M=0;S=!1;case 39:g.push(_C5),S=S||_C5.enableBlend,M+=p;case 40:_context17.t3=P===y.length-1&&g.length;if(!_context17.t3){_context17.next=44;break;}_context17.next=44;return o(g,S);case 44:P++;_context17.next=3;break;case 47:case"end":return _context17.stop();}},_callee17);})();}},/* 28 *//***/function(u,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(l,o){var a=0,c=0,y=0,f=0,g=0,x=0,M=0;var S=l[0].program;for(var P=0;P<l.length;P++){var _C6=l[P].meshData;if(_C6){M+=_C6.positions.length;var _h7=_C6.positions[0].length;a+=_C6.positions.length*_h7,c+=_C6.cells.length*3,x+=_C6.attributes.a_color.length*4;var p=_C6.textureCoord;p&&(y+=p.length*p[0].length);var d=_C6.attributes.a_sourceRect;d&&(f+=d.length*4);var v=_C6.attributes.a_clipUV;v&&(g+=v.length*2);}}if((!o.positions||o.positions.length<a)&&(o.positions=new Float32Array(a)),(!o.cells||o.cells.length<c)&&(o.cells=new Uint16Array(c)),y&&(!o.textureCoord||o.textureCoord.length<y)&&(o.textureCoord=new Float32Array(y)),(!o.a_color||o.a_color.length<x)&&(o.a_color=new Uint8Array(x)),f&&(!o.a_sourceRect||o.a_sourceRect.length<f)&&(o.a_sourceRect=new Float32Array(f)),g&&(!o.a_clipUV||o.a_clipUV.length<g)&&(o.a_clipUV=new Float32Array(g)),S){var _P3=Object.entries(S._attribute),_C7=S._attribOpts||{};for(var _h8=0;_h8<_P3.length;_h8++){var _P3$_h=_slicedToArray(_P3[_h8],2),_p3=_P3$_h[0],_d7=_P3$_h[1];if(_p3!=="a_color"&&_p3!=="a_sourceRect"&&_d7!=="ignored"){var _v6=_C7[_p3]?_C7[_p3].type:"FLOAT",I=r[_v6],L=_d7.size*M;(!o[_p3]||o[_p3].length<L)&&(o[_p3]=new I(L));}}}return o;}function s(l,o){var a=[],c=[],y=[],f=[],g=[],x=[],M=0,S=0;var P=l[0]?l[0].uniforms||{}:{},C=l[0]?l[0].program:null;o&&(n(l,o),c=o.cells,a=o.positions,y=o.textureCoord,f=o.a_color,g=o.a_sourceRect,x=o.a_clipUV);var h=!1,p=!1;var d={};for(var I=0;I<l.length;I++){var L=l[I];if(L){var _a2,_f2,_g,_x18,_y2;if(L.meshData&&(L=L.meshData),o){var B=L.positions;for(var E=0;E<B.length;E++){var b=B[E],W=3*(M+E);for(var D=0;D<b.length;D++)a[W+D]=b[D];}}else(_a2=a).push.apply(_a2,_toConsumableArray(L.positions));var w=L.cells;for(var _B2=0;_B2<w.length;_B2++){var _E3=w[_B2];if(o){var _b=3*(S+_B2);c[_b]=_E3[0]+M,c[_b+1]=_E3[1]+M,c[_b+2]=_E3[2]+M;}else c.push([_E3[0]+M,_E3[1]+M,_E3[2]+M]);}if(o){var _B3=L.attributes.a_color;for(var _E4=0;_E4<_B3.length;_E4++){var _b2=_B3[_E4],_W3=4*(M+_E4);f[_W3]=_b2[0],f[_W3+1]=_b2[1],f[_W3+2]=_b2[2],f[_W3+3]=_b2[3];}}else(_f2=f).push.apply(_f2,_toConsumableArray(L.attributes.a_color));if(L.attributes.a_sourceRect)if(h=!0,o){var _B4=L.attributes.a_sourceRect;for(var _E5=0;_E5<_B4.length;_E5++){var _b3=_B4[_E5],_W4=4*(M+_E5);g[_W4]=_b3[0],g[_W4+1]=_b3[1],g[_W4+2]=_b3[2],g[_W4+3]=_b3[3];}}else(_g=g).push.apply(_g,_toConsumableArray(L.attributes.a_sourceRect));if(L.attributes.a_clipUV)if(p=!0,o){var _B5=L.attributes.a_clipUV;for(var _E6=0;_E6<_B5.length;_E6++){var _b4=_B5[_E6],_W5=2*(M+_E6);x[_W5]=_b4[0],x[_W5+1]=_b4[1];}}else(_x18=x).push.apply(_x18,_toConsumableArray(L.attributes.a_clipUV));if(L.textureCoord)if(o){var _B6=L.textureCoord;for(var _E7=0;_E7<_B6.length;_E7++){var _b5=_B6[_E7],_W6=3*(M+_E7);for(var _D2=0;_D2<_b5.length;_D2++)y[_W6+_D2]=_b5[_D2];}}else(_y2=y).push.apply(_y2,_toConsumableArray(L.textureCoord));if(C){var _B7=Object.entries(C._attribute);for(var _E8=0;_E8<_B7.length;_E8++){var _d$_b;var _B7$_E=_slicedToArray(_B7[_E8],2),_b6=_B7$_E[0],_W7=_B7$_E[1];if(_b6!=="a_color"&&_b6!=="a_sourceRect"&&_W7!=="ignored")if(d[_b6]=[],o){d[_b6]=o[_b6];var _D3=L.attributes[_b6],R=_D3[0].length;for(var Y=0;Y<_D3.length;Y++){var V=_D3[Y],Q=R*(M+Y);for(var et=0;et<V.length;et++)d[_b6][Q+et]=V[et];}}else(_d$_b=d[_b6]).push.apply(_d$_b,_toConsumableArray(L.attributes[_b6]));}}M+=L.positions.length,S+=L.cells.length;}}d.a_color=f,h&&g&&g.length>0&&(d.a_sourceRect=g);var v={positions:a,cells:c,attributes:d,uniforms:P,cellsCount:S*3,program:C};return y&&y.length&&(v.textureCoord=y),p&&x.length>0&&(d.a_clipUV=x),v;}},/* 29 *//***/function(u,e,t){t.r(e);var r=t(1),n=t(30),s=t(26),l=t(31);t(1).glMatrix.setMatrixArrayType(Array);function o(d,v){var I=Object.keys(d);if(Object.getOwnPropertySymbols){var L=Object.getOwnPropertySymbols(d);v&&(L=L.filter(function(w){return Object.getOwnPropertyDescriptor(d,w).enumerable;})),I.push.apply(I,L);}return I;}function a(d){for(var v=1;v<arguments.length;v++){var I=arguments[v]!=null?arguments[v]:{};v%2?o(Object(I),!0).forEach(function(L){c(d,L,I[L]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(I)):o(Object(I)).forEach(function(L){Object.defineProperty(d,L,Object.getOwnPropertyDescriptor(I,L));});}return d;}function c(d,v,I){return v in d?Object.defineProperty(d,v,{value:I,enumerable:!0,configurable:!0,writable:!0}):d[v]=I,d;}var y=Symbol("mesh"),f=Symbol("count"),g=Symbol("blend"),x=Symbol("filter"),M=Symbol("textures"),S=Symbol("textureOptions"),P=Symbol("cloudColor"),C=Symbol("cloudFilter"),h=Symbol("buffer");function p(d){var v=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var I=new Float32Array(3*d),L=new Float32Array(3*d),w=new Float32Array(4*d),B=new Float32Array(4*d),E=new Float32Array(4*d),b=new Float32Array(4*d),W=new Float32Array(4*d),D=new Uint8Array(d),R=new Uint8Array(4*d),Y=new Uint8Array(4*d);return v&&(I.set(v.transform0,0),L.set(v.transform1,0),w.set(v.color0,0),B.set(v.color1,0),E.set(v.color2,0),b.set(v.color3,0),W.set(v.color4,0),D.set(v.frameIndex,0),R.set(v.fillColor,0),Y.set(v.strokeColor,0)),{bufferSize:d,transform0:I,transform1:L,color0:w,color1:B,color2:E,color3:b,color4:W,frameIndex:D,fillColor:R,strokeColor:Y};}e["default"]=/*#__PURE__*/function(){function _class(d){var v=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;var _ref36=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},_ref36$buffer=_ref36.buffer,I=_ref36$buffer===void 0?1e3:_ref36$buffer;_classCallCheck(this,_class);I=Math.max(I,v),this[f]=v,this[y]=d,this[h]=p(I),this[M]=[],this[x]=[],this[P]=!1,this[C]=!1,this[g]=!1,this.initBuffer();}return _createClass(_class,[{key:"initBuffer",value:function initBuffer(){var d=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var v=this[f];for(var I=d;I<v;I++)this[h].transform0.set([1,0,0],I*3),this[h].transform1.set([0,1,0],I*3),this[h].frameIndex.set([-1],I),this[h].fillColor.set([0,0,0,0],I*4),this[h].strokeColor.set([0,0,0,0],I*4),this.setColorTransform(I,null);}},{key:"bufferSize",get:function get(){return this[h].bufferSize;}},{key:"mesh",get:function get(){return this[y];},set:function set(d){this[y]=d,this[M]&&this.setTextureFrames(this[M],this[S]);}},{key:"hasCloudColor",get:function get(){return this[P];}},{key:"hasCloudFilter",get:function get(){return this[C];}},{key:"_getFilter",value:function _getFilter(d){return this[x][d]=this[x][d]||[],this[x][d];}},{key:"getFilter",value:function getFilter(d){return this._getFilter(d).join(" ");}},{key:"enableBlend",get:function get(){return this[y].enableBlend||this[g];}},{key:"canIgnore",value:function canIgnore(){return this[y].canIgnore();}},{key:"delete",value:function _delete(d){if(d>=this[f]||d<0)throw new Error("Out of range.");var _this$h2=this[h],v=_this$h2.transform0,I=_this$h2.transform1,L=_this$h2.color0,w=_this$h2.color1,B=_this$h2.color2,E=_this$h2.color3,b=_this$h2.color4,W=_this$h2.frameIndex,D=_this$h2.fillColor,R=_this$h2.strokeColor;v.set(v.subarray(3*(d+1)),3*d),I.set(I.subarray(3*(d+1)),3*d),L.set(L.subarray(4*(d+1)),4*d),w.set(w.subarray(4*(d+1)),4*d),B.set(B.subarray(4*(d+1)),4*d),E.set(E.subarray(4*(d+1)),4*d),b.set(b.subarray(4*(d+1)),4*d),W.set(W.subarray(d+1),d),D.set(D.subarray(4*(d+1)),4*d),R.set(R.subarray(4*(d+1)),4*d);for(var Y in this[x])Y===d?delete this[x][Y]:Y>d&&(this[x][Y-1]=this[x][Y],delete this[x][Y]);this[f]--;}},{key:"setColorTransform",value:function setColorTransform(d,v){if(d>=this[f]||d<0)throw new Error("Out of range.");d*=4;var _this$h3=this[h],I=_this$h3.color0,L=_this$h3.color1,w=_this$h3.color2,B=_this$h3.color3,E=_this$h3.color4;return v!=null?(I.set([v[0],v[5],v[10],v[15]],d),L.set([v[1],v[6],v[11],v[16]],d),w.set([v[2],v[7],v[12],v[17]],d),B.set([v[3],v[8],v[13],v[18]],d),E.set([v[4],v[9],v[14],v[19]],d),this[g]=this[g]||v[18]<1,this[C]=!0):(I.set([1,0,0,0],d),L.set([0,1,0,0],d),w.set([0,0,1,0],d),B.set([0,0,0,1],d),E.set([0,0,0,0],d)),this;}},{key:"getColorTransform",value:function getColorTransform(d){if(d>=this[f]||d<0)throw new Error("Out of range.");d*=4;var _this$h4=this[h],v=_this$h4.color0,I=_this$h4.color1,L=_this$h4.color2,w=_this$h4.color3,B=_this$h4.color4;return[v[d],I[d],L[d],w[d],B[d],v[d+1],I[d+1],L[d+1],w[d+1],B[d+1],v[d+2],I[d+2],L[d+2],w[d+2],B[d+2],v[d+3],I[d+3],L[d+3],w[d+3],B[d+3]];}},{key:"transformColor",value:function transformColor(d,v){var I=this.getColorTransform(d);return I=Object(n.multiply)(I,v),this.setColorTransform(d,I),this;}},{key:"setFillColor",value:function setFillColor(d,v){if(d>=this[f]||d<0)throw new Error("Out of range.");typeof v=="string"&&(v=Object(l["default"])(v)),v[3]>0&&(this[P]=!0),this[h].fillColor.set(v.map(function(I){return Math.round(255*I);}),4*d);}},{key:"setStrokeColor",value:function setStrokeColor(d,v){if(d>=this[f]||d<0)throw new Error("Out of range.");typeof v=="string"&&(v=Object(l["default"])(v)),v[3]>0&&(this[P]=!0),this[h].strokeColor.set(v.map(function(I){return Math.round(255*I);}),4*d);}},{key:"getCloudRGBA",value:function getCloudRGBA(d){if(d>=this[f]||d<0)throw new Error("Out of range.");d*=4;var _this$h5=this[h],v=_this$h5.fillColor,I=_this$h5.strokeColor,L=[v[d],v[d+1],v[d+2],v[d+3]],w=[I[d],I[d+1],I[d+2],I[d+3]];return L[3]/=255,w[3]/=255,{fill:"rgba(".concat(L.join(),")"),stroke:"rgba(".concat(w.join(),")")};}},{key:"grayscale",value:function grayscale(d,v){this.transformColor(d,Object(n.grayscale)(v)),this._getFilter(d).push("grayscale(".concat(100*v,"%)"));}},{key:"brightness",value:function brightness(d,v){this.transformColor(d,Object(n.brightness)(v)),this._getFilter(d).push("brightness(".concat(100*v,"%)"));}},{key:"saturate",value:function saturate(d,v){this.transformColor(d,Object(n.saturate)(v)),this._getFilter(d).push("saturate(".concat(100*v,"%)"));}},{key:"contrast",value:function contrast(d,v){this.transformColor(d,Object(n.contrast)(v)),this._getFilter(d).push("contrast(".concat(100*v,"%)"));}},{key:"invert",value:function invert(d,v){this.transformColor(d,Object(n.invert)(v)),this._getFilter(d).push("invert(".concat(100*v,"%)"));}},{key:"sepia",value:function sepia(d,v){this.transformColor(d,Object(n.sepia)(v)),this._getFilter(d).push("sepia(".concat(100*v,"%)"));}},{key:"opacity",value:function opacity(d,v){this.transformColor(d,Object(n.opacity)(v)),this._getFilter(d).push("opacity(".concat(100*v,"%)"));}},{key:"hueRotate",value:function hueRotate(d,v){this.transformColor(d,Object(n.hueRotate)(v)),this._getFilter(d).push("hue-rotate(".concat(v,"deg)"));}},{key:"setTransform",value:function setTransform(d,v){if(d>=this[f]||d<0)throw new Error("Out of range.");d*=3,v==null&&(v=[1,0,0,1,0,0]);var _this$h6=this[h],I=_this$h6.transform0,L=_this$h6.transform1;return I.set([v[0],v[2],v[4]],d),L.set([v[1],v[3],v[5]],d),this;}},{key:"getTransform",value:function getTransform(d){if(d>=this[f]||d<0)throw new Error("Out of range.");d*=3;var _this$h7=this[h],v=_this$h7.transform0,I=_this$h7.transform1;return[v[d],I[d],v[d+1],I[d+1],v[d+2],I[d+2]];}},{key:"getTextureFrame",value:function getTextureFrame(d){return this[M][this[h].frameIndex[d]];}},{key:"setTextureFrames",value:function setTextureFrames(){var d=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var v=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(d.length>12)throw new Error("Max frames exceed. Allow 12 frames.");d.length&&this[y].setTexture(d[0],v),this[M]=d,this[S]=v;}},{key:"setFrameIndex",value:function setFrameIndex(d,v){if(d>=this[f]||d<0)throw new Error("Out of range.");var I=this[M].length;if(I<=0)throw new Error("No frames");this[h].frameIndex[d]=v%I;}},{key:"amount",get:function get(){return this[f];},set:function set(d){var v=this[f];d!==v&&(d>this[h].bufferSize&&(this[h]=p(Math.max(d,this[h].bufferSize+1e3),this[h])),this[f]=d,d>v&&this.initBuffer(v));}},{key:"meshData",get:function get(){var _this$y$meshData=this[y].meshData,d=_this$y$meshData.attributes,v=_this$y$meshData.cells,I=_this$y$meshData.positions,L=_this$y$meshData.textureCoord,w=_this$y$meshData.uniforms,B=this[M],E={attributes:a({},d),cells:v,positions:I,textureCoord:L,uniforms:a({},w),instanceCount:this[f],enableBlend:this.enableBlend};B.length&&B.forEach(function(K,rt){E.uniforms["u_texFrame".concat(rt)]=K;});var _this$h8=this[h],b=_this$h8.transform0,W=_this$h8.transform1,D=_this$h8.color0,R=_this$h8.color1,Y=_this$h8.color2,V=_this$h8.color3,Q=_this$h8.color4,et=_this$h8.fillColor,it=_this$h8.strokeColor,$=_this$h8.frameIndex;return this[y].uniforms.u_texSampler&&(E.attributes.a_frameIndex={data:$,divisor:1}),E.attributes.a_transform0={data:b,divisor:1},E.attributes.a_transform1={data:W,divisor:1},E.attributes.a_colorCloud0={data:D,divisor:1},E.attributes.a_colorCloud1={data:R,divisor:1},E.attributes.a_colorCloud2={data:Y,divisor:1},E.attributes.a_colorCloud3={data:V,divisor:1},E.attributes.a_colorCloud4={data:Q,divisor:1},this.hasCloudColor&&(E.attributes.a_fillCloudColor={data:et,divisor:1},E.attributes.a_strokeCloudColor={data:it,divisor:1}),E;}},{key:"setProgram",value:function setProgram(d){this[y].setProgram(d);}},{key:"program",get:function get(){return this[y].program;}},{key:"transform",value:function transform(d,v){var I=this.getTransform(d);return v=r.mat2d.multiply(Array.of(0,0,0,0,0,0),I,v),this.setTransform(d,v),this;}},{key:"translate",value:function translate(d,_ref37){var _ref38=_slicedToArray(_ref37,2),v=_ref38[0],I=_ref38[1];var L=r.mat2d.create();return L=r.mat2d.translate(Array.of(0,0,0,0,0,0),L,[v,I]),this.transform(d,L);}},{key:"rotate",value:function rotate(d,v){var _ref39=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref40=_slicedToArray(_ref39,2),I=_ref40[0],L=_ref40[1];var w=r.mat2d.create();return w=r.mat2d.translate(Array.of(0,0,0,0,0,0),w,[I,L]),w=r.mat2d.rotate(Array.of(0,0,0,0,0,0),w,v),w=r.mat2d.translate(Array.of(0,0,0,0,0,0),w,[-I,-L]),this.transform(d,w);}},{key:"scale",value:function scale(d,_ref41){var _ref42=_slicedToArray(_ref41,2),v=_ref42[0],_ref42$=_ref42[1],I=_ref42$===void 0?v:_ref42$;var _ref43=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref44=_slicedToArray(_ref43,2),L=_ref44[0],w=_ref44[1];var B=r.mat2d.create();return B=r.mat2d.translate(Array.of(0,0,0,0,0,0),B,[L,w]),B=r.mat2d.scale(Array.of(0,0,0,0,0,0),B,[v,I]),B=r.mat2d.translate(Array.of(0,0,0,0,0,0),B,[-L,-w]),this.transform(d,B);}},{key:"skew",value:function skew(d,_ref45){var _ref46=_slicedToArray(_ref45,2),v=_ref46[0],_ref46$=_ref46[1],I=_ref46$===void 0?v:_ref46$;var _ref47=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref48=_slicedToArray(_ref47,2),L=_ref48[0],w=_ref48[1];var B=r.mat2d.create();return B=r.mat2d.translate(Array.of(0,0,0,0,0,0),B,[L,w]),B=r.mat2d.multiply(Array.of(0,0,0,0,0,0),B,r.mat2d.fromValues(1,Math.tan(I),Math.tan(v),1,0,0)),B=r.mat2d.translate(Array.of(0,0,0,0,0,0),B,[-L,-w]),this.transform(d,B);}},{key:"isPointCollision",value:function isPointCollision(d,_ref49){var _this$y;var _ref50=_slicedToArray(_ref49,2),v=_ref50[0],I=_ref50[1];var L=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"both";var w=this.getTransform(d),B=Object(s.transformPoint)([v,I],r.mat2d.invert(Array.of(0,0,0,0,0,0),w));return(_this$y=this[y]).isPointCollision.apply(_this$y,_toConsumableArray(B).concat([L]));}},{key:"isPointInFill",value:function isPointInFill(d,_ref51){var _ref52=_slicedToArray(_ref51,2),v=_ref52[0],I=_ref52[1];return this.isPointCollision(d,[v,I],"fill");}},{key:"isPointInStroke",value:function isPointInStroke(d,_ref53){var _ref54=_slicedToArray(_ref53,2),v=_ref54[0],I=_ref54[1];return this.isPointCollision(d,[v,I],"stroke");}}]);}();},/* 30 *//***/function(u,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 l;}),t.d(e,"saturate",function(){return o;}),t.d(e,"contrast",function(){return a;}),t.d(e,"invert",function(){return c;}),t.d(e,"sepia",function(){return y;}),t.d(e,"opacity",function(){return f;}),t.d(e,"hueRotate",function(){return g;});var r=t(26);t(1).glMatrix.setMatrixArrayType(Array);function n(x,M){var S=[],P=x[0],C=x[1],h=x[2],p=x[3],d=x[4],v=x[5],I=x[6],L=x[7],w=x[8],B=x[9],E=x[10],b=x[11],W=x[12],D=x[13],R=x[14],Y=x[15],V=x[16],Q=x[17],et=x[18],it=x[19];var $=M[0],K=M[1],rt=M[2],lt=M[3],ct=M[4];return S[0]=$*P+K*v+rt*E+lt*Y,S[1]=$*C+K*I+rt*b+lt*V,S[2]=$*h+K*L+rt*W+lt*Q,S[3]=$*p+K*w+rt*D+lt*et,S[4]=$*d+K*B+rt*R+lt*it+ct,$=M[5],K=M[6],rt=M[7],lt=M[8],ct=M[9],S[5]=$*P+K*v+rt*E+lt*Y,S[6]=$*C+K*I+rt*b+lt*V,S[7]=$*h+K*L+rt*W+lt*Q,S[8]=$*p+K*w+rt*D+lt*et,S[9]=$*d+K*B+rt*R+lt*it+ct,$=M[10],K=M[11],rt=M[12],lt=M[13],ct=M[14],S[10]=$*P+K*v+rt*E+lt*Y,S[11]=$*C+K*I+rt*b+lt*V,S[12]=$*h+K*L+rt*W+lt*Q,S[13]=$*p+K*w+rt*D+lt*et,S[14]=$*d+K*B+rt*R+lt*it+ct,$=M[15],K=M[16],rt=M[17],lt=M[18],ct=M[19],S[15]=$*P+K*v+rt*E+lt*Y,S[16]=$*C+K*I+rt*b+lt*V,S[17]=$*h+K*L+rt*W+lt*Q,S[18]=$*p+K*w+rt*D+lt*et,S[19]=$*d+K*B+rt*R+lt*it+ct,S;}function s(x){x=Object(r.clamp)(0,1,x);var M=0.2126*x,S=0.7152*x,P=0.0722*x;return[M+1-x,S,P,0,0,M,S+1-x,P,0,0,M,S,P+1-x,0,0,0,0,0,1,0];}function l(x){return[x,0,0,0,0,0,x,0,0,0,0,0,x,0,0,0,0,0,1,0];}function o(x){var M=0.2126*(1-x),S=0.7152*(1-x),P=0.0722*(1-x);return[M+x,S,P,0,0,M,S+x,P,0,0,M,S,P+x,0,0,0,0,0,1,0];}function a(x){var M=0.5*(1-x);return[x,0,0,0,M,0,x,0,0,M,0,0,x,0,M,0,0,0,1,0];}function c(x){var M=1-2*x;return[M,0,0,0,x,0,M,0,0,x,0,0,M,0,x,0,0,0,1,0];}function y(x){return[1-0.607*x,0.769*x,0.189*x,0,0,0.349*x,1-0.314*x,0.168*x,0,0,0.272*x,0.534*x,1-0.869*x,0,0,0,0,0,1,0];}function f(x){return[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,x,0];}function g(x){var M=x/180*Math.PI,S=Math.cos(M),P=Math.sin(M),C=0.2126,h=0.7152,p=0.0722;return[C+S*(1-C)+P*-C,h+S*-h+P*-h,p+S*-p+P*(1-p),0,0,C+S*-C+P*0.143,h+S*(1-h)+P*0.14,p+S*-p+P*-0.283,0,0,C+S*-C+P*-(1-C),h+S*-h+P*h,p+S*(1-p)+P*p,0,0,0,0,0,1,0];}},/* 31 *//***/function(u,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(l){var o=n()(l);if(!o||!o.length)throw new TypeError("Invalid color value.");return[o[0]/255,o[1]/255,o[2]/255,o[3]];}},/* 32 *//***/function(u,e,t){var r=t(33),n=t(37),s=t(39);u.exports=function(o){var a,c=r(o);return c.space?(a=Array(3),a[0]=s(c.values[0],0,255),a[1]=s(c.values[1],0,255),a[2]=s(c.values[2],0,255),c.space[0]==="h"&&(a=n.rgb(a)),a.push(s(c.alpha,0,1)),a):[];};},/* 33 *//***/function(u,e,t){(function(r){var n=t(34),s=t(35),l=t(36);u.exports=a;var o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function a(c){var y,f=[],g=1,x;if(typeof c=="string"){if(n[c])f=n[c].slice(),x="rgb";else if(c==="transparent")g=0,x="rgb",f=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(c)){var M=c.slice(1),S=M.length,P=S<=4;g=1,P?(f=[parseInt(M[0]+M[0],16),parseInt(M[1]+M[1],16),parseInt(M[2]+M[2],16)],S===4&&(g=parseInt(M[3]+M[3],16)/255)):(f=[parseInt(M[0]+M[1],16),parseInt(M[2]+M[3],16),parseInt(M[4]+M[5],16)],S===8&&(g=parseInt(M[6]+M[7],16)/255)),f[0]||(f[0]=0),f[1]||(f[1]=0),f[2]||(f[2]=0),x="rgb";}else if(y=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(c)){var C=y[1],h=C==="rgb",M=C.replace(/a$/,"");x=M;var S=M==="cmyk"?4:M==="gray"?1:3;f=y[2].trim().split(/\s*,\s*/).map(function(I,L){if(/%$/.test(I))return L===S?parseFloat(I)/100:M==="rgb"?parseFloat(I)*255/100:parseFloat(I);if(M[L]==="h"){if(/deg$/.test(I))return parseFloat(I);if(o[I]!==void 0)return o[I];}return parseFloat(I);}),C===M&&f.push(1),g=h||f[S]===void 0?1:f[S],f=f.slice(0,S);}else c.length>10&&/[0-9](?:\s|\/)/.test(c)&&(f=c.match(/([0-9]+)/g).map(function(d){return parseFloat(d);}),x=c.match(/([a-z])/ig).join("").toLowerCase());}else if(!isNaN(c))x="rgb",f=[c>>>16,(c&65280)>>>8,c&255];else if(s(c)){var p=l(c.r,c.red,c.R,null);p!==null?(x="rgb",f=[p,l(c.g,c.green,c.G),l(c.b,c.blue,c.B)]):(x="hsl",f=[l(c.h,c.hue,c.H),l(c.s,c.saturation,c.S),l(c.l,c.lightness,c.L,c.b,c.brightness)]),g=l(c.a,c.alpha,c.opacity,1),c.opacity!=null&&(g/=100);}else(Array.isArray(c)||r.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(c))&&(f=[c[0],c[1],c[2]],x="rgb",g=c.length===4?c[3]:1);return{space:x,values:f,alpha:g};}}).call(this,t(22));},/* 34 *//***/function(u,e,t){u.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(u,e,t){var r=Object.prototype.toString;u.exports=function(n){var s;return r.call(n)==="[object Object]"&&(s=Object.getPrototypeOf(n),s===null||s===Object.getPrototypeOf({}));};},/* 36 *//***/function(u,e){u.exports=function(){for(var t=0;t<arguments.length;t++)if(arguments[t]!==void 0)return arguments[t];};},/* 37 *//***/function(u,e,t){var r=t(38);u.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,l=n[1]/100,o=n[2]/100,a,c,y,f,g;if(l===0)return g=o*255,[g,g,g];o<0.5?c=o*(1+l):c=o+l-o*l,a=2*o-c,f=[0,0,0];for(var x=0;x<3;x++)y=s+1/3*-(x-1),y<0?y++:y>1&&y--,6*y<1?g=a+(c-a)*6*y:2*y<1?g=c:3*y<2?g=a+(c-a)*(2/3-y)*6:g=a,f[x]=g*255;return f;}},r.hsl=function(n){var s=n[0]/255,l=n[1]/255,o=n[2]/255,a=Math.min(s,l,o),c=Math.max(s,l,o),y=c-a,f,g,x;return c===a?f=0:s===c?f=(l-o)/y:l===c?f=2+(o-s)/y:o===c&&(f=4+(s-l)/y),f=Math.min(f*60,360),f<0&&(f+=360),x=(a+c)/2,c===a?g=0:x<=0.5?g=y/(c+a):g=y/(2-c-a),[f,g*100,x*100];};},/* 38 *//***/function(u,e,t){u.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]};},/* 39 *//***/function(u,e){u.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(u,e,t){t.r(e),t.d(e,"default",function(){return p;});var r=t(41),n=/* @__PURE__ */t.n(r),s=t(42),l=/* @__PURE__ */t.n(s),o=t(43),a=/* @__PURE__ */t.n(o),c=t(44),y=t(46),f=/* @__PURE__ */t.n(y),g=t(53),x=t(55);t(1).glMatrix.setMatrixArrayType(Array);var M=Symbol("contours"),S=Symbol("path"),P=Symbol("simplify"),C=Symbol("scale"),h=2*Math.PI;var p=/*#__PURE__*/function(){function p(){var v=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,p);typeof v=="string"&&(v={path:v}),v.path?this[S]=n()(v.path):this[S]=[],this[M]=null,this[P]=v.simplify!=null?v.simplify:0,this[C]=v.scale!=null?v.scale:2;}return _createClass(p,[{key:"contours",get:function get(){var v=null;if(!this[M]&&this[S]){var I=Object(c["default"])(a()(this[S]));this[M]=f()(I,this[C],this[P]),this[M].path=I,this[M].simplify=this[P],this[M].scale=this[C];}return this[M]&&(v=this[M].map(function(I){return _toConsumableArray(I);}),v.path=this[M].path,v.simplify=this[M].simplify,v.scale=this[M].scale),v;}},{key:"path",get:function get(){return this[S];}},{key:"simplify",get:function get(){return this[P];}},{key:"boundingBox",get:function get(){var v=this.contours;if(v&&v.length){var I=v.reduce(function(L,w){return[].concat(_toConsumableArray(L),_toConsumableArray(w));});return l()(I);}return[[0,0],[0,0]];}},{key:"boundingCenter",get:function get(){var v=this.boundingBox;return v?[0.5*(v[0][0]+v[1][0]),0.5*(v[0][1]+v[1][1])]:[0,0];}},{key:"normalize",value:function normalize(){var _this$S;var v=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var I=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var L=Object(c["default"])(a()(this[S])).map(function(_ref55){var _ref56=_toArray(_ref55),w=_ref56[0],B=_ref56.slice(1);var E=[w];for(var b=0;b<B.length;b+=2){var W=B[b]-v,D=B[b+1]-I;E.push(W,D);}return E;});return this.beginPath(),(_this$S=this[S]).push.apply(_this$S,_toConsumableArray(L)),this;}},{key:"getPointAtLength",value:function getPointAtLength(v){return this.contours?Object(g.getPointAtLength)(this[M],v):null;}},{key:"getTotalLength",value:function getTotalLength(){return this.contours?Object(g.getTotalLength)(this[M]):0;}},{key:"addPath",value:function addPath(v){var _this$S2;this[M]=null,typeof v=="string"&&(v=n()(v)),(_this$S2=this[S]).push.apply(_this$S2,_toConsumableArray(v));}},{key:"beginPath",value:function beginPath(){this[S]=[],this[M]=null;}},{key:"clear",value:function clear(){this.beginPath();}},{key:"ellipse",value:function ellipse(v,I,L,w,B,E,b){var W=arguments.length>7&&arguments[7]!==undefined?arguments[7]:0;if(E+=B,b+=B,L<=0||w<=0||b===E)return;b<E&&(b=E+h+(b-E)%h),b-E>h&&(b=E+h);var D=b-E;D>=h&&(b-=1e-3);var R=this[S].length>0&&D<h?"L":"M";var Y=Object(x.getPoint)(v,I,L,w,E),V=Object(x.getPoint)(v,I,L,w,b),Q=+!W;var et=D>Math.PI?1:0;W&&(et=1-et),R+=Y.join(" "),R+="A".concat(L," ").concat(w," 0 ").concat(et," ").concat(Q," ").concat(V.join(" ")),D>=h&&(R+="Z"),this.addPath(R);}},{key:"arc",value:function arc(v,I,L,w,B){var E=arguments.length>5&&arguments[5]!==undefined?arguments[5]:0;return this.ellipse(v,I,L,L,0,w,B,E);}},{key:"arcTo",value:function arcTo(v,I,L,w,B,E,b){this[M]=null,this[S].push(["A",v,I,L,w,B,E,b]);}},{key:"moveTo",value:function moveTo(v,I){this[M]=null,this[S].push(["M",v,I]);}},{key:"lineTo",value:function lineTo(v,I){this[M]=null,this[S].push(["L",v,I]);}},{key:"bezierCurveTo",value:function bezierCurveTo(v,I,L,w,B,E){this[M]=null,this[S].push(["C",v,I,L,w,B,E]);}},{key:"quadraticCurveTo",value:function quadraticCurveTo(v,I,L,w){this[M]=null,this[S].push(["Q",v,I,L,w]);}},{key:"rect",value:function rect(v,I,L,w){var B="M".concat(v," ").concat(I,"L").concat(v+L," ").concat(I,"L").concat(v+L," ").concat(I+w,"L").concat(v," ").concat(I+w,"Z");this.addPath(B);}},{key:"closePath",value:function closePath(){this[M]=null;var v=[];var I=this[S].length;I>0&&(v=this[S][I-1]),v[0]!=="Z"&&v[0]!=="z"&&this[S].push(["Z"]);}}]);}();},/* 41 *//***/function(u,e){u.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(o){var a=[];return o.replace(r,function(c,y,f){var g=y.toLowerCase();for(f=l(f),g=="m"&&f.length>2&&(a.push([y].concat(f.splice(0,2))),g="l",y=y=="m"?"l":"L");;){if(f.length==t[g])return f.unshift(y),a.push(f);if(f.length<t[g])throw new Error("malformed path data");a.push([y].concat(f.splice(0,t[g])));}}),a;}var s=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function l(o){var a=o.match(s);return a?a.map(Number):[];}},/* 42 *//***/function(u,e,t){u.exports=r;function r(n){var s=n.length;if(s===0)return[[],[]];for(var l=n[0].length,o=n[0].slice(),a=n[0].slice(),c=1;c<s;++c)for(var y=n[c],f=0;f<l;++f){var g=y[f];o[f]=Math.min(o[f],g),a[f]=Math.max(a[f],g);}return[o,a];}},/* 43 *//***/function(u,e){u.exports=t;function t(r){var n=0,s=0,l=0,o=0;return r.map(function(a){a=a.slice();var c=a[0],y=c.toUpperCase();if(c!=y)switch(a[0]=y,c){case"a":a[6]+=l,a[7]+=o;break;case"v":a[1]+=o;break;case"h":a[1]+=l;break;default:for(var f=1;f<a.length;)a[f++]+=l,a[f++]+=o;}switch(y){case"Z":l=n,o=s;break;case"H":l=a[1];break;case"V":o=a[1];break;case"M":l=n=a[1],o=s=a[2];break;default:l=a[a.length-2],o=a[a.length-1];}return a;});}},/* 44 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return n;});var r=t(45);t(1).glMatrix.setMatrixArrayType(Array);function n(o){for(var a,c=[],y=0,f=0,g=0,x=0,M=null,S=null,P=0,C=0,h=0,p=o.length;h<p;h++){var d=o[h],v=d[0];switch(v){case"M":g=d[1],x=d[2];break;case"A":var I=Object(r["default"])(P,C,d[6],d[7],d[4],d[5],d[1],d[2],d[3]);if(!I.length)continue;I=I.map(function(b){var _b7=_slicedToArray(b,8),W=_b7[0],D=_b7[1],R=_b7[2],Y=_b7[3],V=_b7[4],Q=_b7[5],et=_b7[6],it=_b7[7];return{x1:R,y1:Y,x2:V,y2:Q,x:et,y:it};});for(var L=0,w;L<I.length;L++)w=I[L],d=["C",w.x1,w.y1,w.x2,w.y2,w.x,w.y],L<I.length-1&&c.push(d);break;case"S":var B=P,E=C;(a=="C"||a=="S")&&(B+=B-y,E+=E-f),d=["C",B,E,d[1],d[2],d[3],d[4]];break;case"T":a=="Q"||a=="T"?(M=P*2-M,S=C*2-S):(M=P,S=C),d=l(P,C,M,S,d[1],d[2]);break;case"Q":M=d[1],S=d[2],d=l(P,C,d[1],d[2],d[3],d[4]);break;case"L":d=s(P,C,d[1],d[2]);break;case"H":d=s(P,C,d[1],C);break;case"V":d=s(P,C,P,d[1]);break;case"Z":d=s(P,C,g,x);break;}a=v,P=d[d.length-2],C=d[d.length-1],d.length>4?(y=d[d.length-4],f=d[d.length-3]):(y=P,f=C),c.push(d);}return c;}function s(o,a,c,y){return["C",o,a,c,y,c,y];}function l(o,a,c,y,f,g){return["C",o/3+2/3*c,a/3+2/3*y,f/3+2/3*c,g/3+2/3*y,f,g];}},/* 45 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return o;}),t(1).glMatrix.setMatrixArrayType(Array);var r=Math.PI*2;function n(a,c,y,f){var g=a*f-c*y<0?-1:1;var x=a*y+c*f;return x>1&&(x=1),x<-1&&(x=-1),g*Math.acos(x);}function s(a,c,y,f,g,x,M,S,P,C){var h=C*(a-y)/2+P*(c-f)/2,p=-P*(a-y)/2+C*(c-f)/2,d=M*M,v=S*S,I=h*h,L=p*p;var w=d*v-d*L-v*I;w<0&&(w=0),w/=d*L+v*I,w=Math.sqrt(w)*(g===x?-1:1);var B=w*M/S*p,E=w*-S/M*h,b=C*B-P*E+(a+y)/2,W=P*B+C*E+(c+f)/2,D=(h-B)/M,R=(p-E)/S,Y=(-h-B)/M,V=(-p-E)/S,Q=n(1,0,D,R);var et=n(D,R,Y,V);return x===0&&et>0&&(et-=r),x===1&&et<0&&(et+=r),[b,W,Q,et];}function l(a,c){var y=1.3333333333333333*Math.tan(c/4),f=Math.cos(a),g=Math.sin(a),x=Math.cos(a+c),M=Math.sin(a+c);return[f,g,f-g*y,g+f*y,x+M*y,M-x*y,x,M];}function o(a,c,y,f,g,x,M,S,P){var C=Math.sin(P*r/360),h=Math.cos(P*r/360),p=h*(a-y)/2+C*(c-f)/2,d=-C*(a-y)/2+h*(c-f)/2;if(p===0&&d===0)return[];if(M===0||S===0)return[];M=Math.abs(M),S=Math.abs(S);var v=p*p/(M*M)+d*d/(S*S);v>1&&(M*=Math.sqrt(v),S*=Math.sqrt(v));var I=s(a,c,y,f,g,x,M,S,C,h),L=[];var w=I[2],B=I[3];var E=Math.max(Math.ceil(Math.abs(B)/(r/4)),1);B/=E;for(var b=0;b<E;b++)L.push(l(w,B)),w+=B;return L.map(function(b){for(var W=0;W<b.length;W+=2){var D=b[W+0],R=b[W+1];D*=M,R*=S;var Y=h*D-C*R,V=C*D+h*R;b[W+0]=Y+I[0],b[W+1]=V+I[1];}return b;});}},/* 46 *//***/function(u,e,t){t(1).glMatrix.setMatrixArrayType(Array);var r=t(47),_t2=t(49),n=_t2.copy,s=t(50);function l(f,g,x){return f[0]=g,f[1]=x,f;}var o=[0,0],a=[0,0],c=[0,0];function y(f,g,x,M){r(x,l(o,M[1],M[2]),l(a,M[3],M[4]),l(c,M[5],M[6]),g,f);}u.exports=function(g,x,M){var S=[],P=[],C=[0,0];return g.forEach(function(h,p,d){if(h[0]==="M")n(C,h.slice(1)),P.length>0&&(S.push(P),P=[]);else if(h[0]==="C")y(P,x,C,h),l(C,h[5],h[6]);else throw new Error("illegal type in SVG: "+h[0]);}),P.length>0&&S.push(P),S.map(function(h){return s(h,M||0);});};},/* 47 *//***/function(u,e,t){u.exports=t(48)();},/* 48 *//***/function(u,e){function t(n){return[n[0],n[1]];}function r(n,s){return[n,s];}u.exports=function(s){s=s||{};var l=typeof s.recursion=="number"?s.recursion:8,o=typeof s.epsilon=="number"?s.epsilon:11920929e-14,a=typeof s.pathEpsilon=="number"?s.pathEpsilon:1,c=typeof s.angleEpsilon=="number"?s.angleEpsilon:0.01,y=s.angleTolerance||0,f=s.cuspLimit||0;return function(S,P,C,h,p,d){d||(d=[]),p=typeof p=="number"?p:1;var v=a/p;return v*=v,g(S,P,C,h,d,v),d;};function g(M,S,P,C,h,p){h.push(t(M));var d=M[0],v=M[1],I=S[0],L=S[1],w=P[0],B=P[1],E=C[0],b=C[1];x(d,v,I,L,w,B,E,b,h,p,0),h.push(t(C));}function x(M,S,P,C,h,p,d,v,I,L,w){if(!(w>l)){var B=Math.PI,E=(M+P)/2,b=(S+C)/2,W=(P+h)/2,D=(C+p)/2,R=(h+d)/2,Y=(p+v)/2,V=(E+W)/2,Q=(b+D)/2,et=(W+R)/2,it=(D+Y)/2,$=(V+et)/2,K=(Q+it)/2;if(w>0){var rt=d-M,lt=v-S,ct=Math.abs((P-d)*lt-(C-v)*rt),gt=Math.abs((h-d)*lt-(p-v)*rt),st,Ot;if(ct>o&>>o){if((ct+gt)*(ct+gt)<=L*(rt*rt+lt*lt)){if(y<c){I.push(r($,K));return;}var St=Math.atan2(p-C,h-P);if(st=Math.abs(St-Math.atan2(C-S,P-M)),Ot=Math.abs(Math.atan2(v-p,d-h)-St),st>=B&&(st=2*B-st),Ot>=B&&(Ot=2*B-Ot),st+Ot<y){I.push(r($,K));return;}if(f!==0){if(st>f){I.push(r(P,C));return;}if(Ot>f){I.push(r(h,p));return;}}}}else if(ct>o){if(ct*ct<=L*(rt*rt+lt*lt)){if(y<c){I.push(r($,K));return;}if(st=Math.abs(Math.atan2(p-C,h-P)-Math.atan2(C-S,P-M)),st>=B&&(st=2*B-st),st<y){I.push(r(P,C)),I.push(r(h,p));return;}if(f!==0&&st>f){I.push(r(P,C));return;}}}else if(gt>o){if(gt*gt<=L*(rt*rt+lt*lt)){if(y<c){I.push(r($,K));return;}if(st=Math.abs(Math.atan2(v-p,d-h)-Math.atan2(p-C,h-P)),st>=B&&(st=2*B-st),st<y){I.push(r(P,C)),I.push(r(h,p));return;}if(f!==0&&st>f){I.push(r(h,p));return;}}}else if(rt=$-(M+d)/2,lt=K-(S+v)/2,rt*rt+lt*lt<=L){I.push(r($,K));return;}}x(M,S,E,b,V,Q,$,K,I,L,w+1),x($,K,et,it,R,Y,d,v,I,L,w+1);}}};},/* 49 *//***/function(u,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 l;}),t.d(e,"scaleAndAdd",function(){return o;}),t.d(e,"dot",function(){return a;}),t.d(e,"rotate",function(){return c;}),t.d(e,"cross",function(){return y;}),t.d(e,"sub",function(){return f;}),t.d(e,"add",function(){return g;}),t.d(e,"computeMiter",function(){return P;}),t.d(e,"normal",function(){return C;}),t.d(e,"direction",function(){return h;});var r=t(1);t(1).glMatrix.setMatrixArrayType(Array);function n(p){return[p[0],p[1]];}function s(){return[0,0];}var l=r.vec2.copy,o=r.vec2.scaleAndAdd,a=r.vec2.dot,c=r.vec2.rotate,y=r.vec2.cross,f=r.vec2.sub,g=r.vec2.add,x=r.vec2.normalize,M=r.vec2.set,S=s();function P(p,d,v,I,L){g(p,v,I),x(p,p),M(d,-p[1],p[0]),M(S,-v[1],v[0]);var w=L/a(d,S);return Math.abs(w);}function C(p,d){return M(p,-d[1],d[0]),p;}function h(p,d,v){return f(p,d,v),x(p,p),p;}},/* 50 *//***/function(u,e,t){var r=t(51),n=t(52);u.exports=function(l,o){return l=r(l,o),l=n(l,o),l;},u.exports.radialDistance=r,u.exports.douglasPeucker=n;},/* 51 *//***/function(u,e){function t(r,n){var s=r[0]-n[0],l=r[1]-n[1];return s*s+l*l;}u.exports=function(n,s){if(n.length<=1)return n;s=typeof s=="number"?s:1;for(var l=s*s,o=n[0],a=[o],c,y=1,f=n.length;y<f;y++)c=n[y],t(c,o)>l&&(a.push(c),o=c);return o!==c&&a.push(c),a;};},/* 52 *//***/function(u,e){function t(n,s,l){var o=s[0],a=s[1],c=l[0]-o,y=l[1]-a;if(c!==0||y!==0){var f=((n[0]-o)*c+(n[1]-a)*y)/(c*c+y*y);f>1?(o=l[0],a=l[1]):f>0&&(o+=c*f,a+=y*f);}return c=n[0]-o,y=n[1]-a,c*c+y*y;}function r(n,s,l,o,a){for(var c=o,y,f=s+1;f<l;f++){var g=t(n[f],n[s],n[l]);g>c&&(y=f,c=g);}c>o&&(y-s>1&&r(n,s,y,o,a),a.push(n[y]),l-y>1&&r(n,y,l,o,a));}u.exports=function(s,l){if(s.length<=1)return s;l=typeof l=="number"?l:1;var o=l*l,a=s.length-1,c=[s[0]];return r(s,0,a,o,c),c.push(s[a]),c;};},/* 53 *//***/function(u,e,t){t.r(e),t.d(e,"getTotalLength",function(){return n;}),t.d(e,"getPointAtLength",function(){return l;}),t.d(e,"getDashContours",function(){return o;});var r=t(54);t(1).glMatrix.setMatrixArrayType(Array);function n(a){if(a.totalLength!=null)return a.totalLength;var c=0;return a.forEach(function(y){var f=y[0];for(var g=1;g<y.length;g++){var x=y[g];c+=Object(r.distance)(f,x),f=x;}}),a.totalLength=c,c;}function s(a,c){var y=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;if(c=Number(c),!Number.isFinite(c))throw new TypeError("Failed to execute 'getPointAtLength' on figure: The provided float value is non-finite.");if(c<=0)throw new TypeError("Length must > 0");var f=n(a);if(c>=f){var x=a[a.length-1],M=x[x.length-2],S=x[x.length-1],P=Math.atan2(S[1]-M[1],S[0]-M[0]);return{current:a.map(function(C){return _toConsumableArray(C);}),point:{x:S[0],y:S[1],angle:P}};}var g=[];for(var _x19=0;_x19<a.length;_x19++){g[_x19]=[];var _M=a[_x19];var _S2=_M[0];for(var _P4=1;_P4<_M.length;_P4++){var _C8=_M[_P4],_h9=Object(r.distance)(_S2,_C8);if(c<_h9){var p=c/_h9,d=Math.atan2(_C8[1]-_S2[1],_C8[0]-_S2[0]),v={x:_S2[0]*(1-p)+_C8[0]*p,y:_S2[1]*(1-p)+_C8[1]*p,angle:d};if(g[_x19].push(_S2),c>0&&g[_x19].push([v.x,v.y]),!y)return{current:g,point:v};var I=[],L=_x19;for(;_x19<a.length;_x19++){for(I[_x19-L]=[],_x19===L&&I[0].push([v.x,v.y]);_P4<_M.length;_P4++)I[_x19-L].push(_M[_P4]);_P4=0;}return{current:g,point:v,rest:I};}c-=_h9,g[_x19].push(_S2),_S2=_C8;}}}function l(a,c){if(c=Number(c),!Number.isFinite(c))throw new TypeError("Failed to execute 'getPointAtLength' on figure: The provided float value is non-finite.");if(a.length<=0)return{x:0,y:0,angle:0};if(c<=0){var y=a[0][0],f=a[0][1],g=Math.atan2(f[1]-y[1],f[0]-y[0]);return{x:y[0],y:y[1],angle:g};}return s(a,c,!1).point;}function o(a,c,y){var f=0,g=c[0],x=a;var M=[],S=c.length;if(y>0){do y-=c[f%S],f++;while(y>0);y<0&&(g=-y,f--);}else if(y<0){f=-1;do y+=c[f%S+S-1],f--;while(y<0);y>=0&&(f++,g=c[f%S+S-1]-y);}do{var P=s(x,g);x=P.rest,++f%2&&M.push.apply(M,_toConsumableArray(P.current));var _C9=f%S;_C9<0&&(_C9+=S),g=c[_C9];}while(x);return M;}},/* 54 *//***/function(u,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(_ref57,a,c,y){var _ref58=_slicedToArray(_ref57,3),s=_ref58[0],l=_ref58[1],o=_ref58[2];return s=s*2/a-1,l=1-l*2/c,Number.isFinite(y)?(o=o*2/y-1,[s,l,o]):[s,l];}function n(_ref59,_ref60){var _ref61=_slicedToArray(_ref59,3),s=_ref61[0],l=_ref61[1],_ref61$=_ref61[2],o=_ref61$===void 0?0:_ref61$;var _ref62=_slicedToArray(_ref60,3),a=_ref62[0],c=_ref62[1],_ref62$=_ref62[2],y=_ref62$===void 0?0:_ref62$;return Math.hypot(a-s,c-l,y-o);}},/* 55 *//***/function(u,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,l,o,a,c){c%=r,c<0&&(c+=r);var y=Math.tan(c);if(Math.abs(y)<1e5){var f=l-y*s,g=1/Math.pow(o,2)+Math.pow(y,2)/Math.pow(a,2);var x=-1;(c<=Math.PI/2||c>3*Math.PI/2)&&(x=1);var M=x*Math.sqrt(1/g)+s,S=y*M+f;return[M,S];}return c<Math.PI?[s,l+a]:[s,l-a];}},/* 56 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return Z;});var r=t(1),n=t(42),s=/* @__PURE__ */t.n(n),l=t(57),o=t(28),a=t(24),c=t(30),y=t(59),f=t(53),g=t(60),x=/* @__PURE__ */t.n(g),M=t(46),S=/* @__PURE__ */t.n(M),P=t(31),C=t(40),h=t(21);t(1).glMatrix.setMatrixArrayType(Array);function p(tt,j){if(tt==null)return{};var H=d(tt,j),T,A;if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(tt);for(A=0;A<U.length;A++)T=U[A],!(j.indexOf(T)>=0)&&Object.prototype.propertyIsEnumerable.call(tt,T)&&(H[T]=tt[T]);}return H;}function d(tt,j){if(tt==null)return{};var H={},T=Object.keys(tt),A,U;for(U=0;U<T.length;U++)A=T[U],!(j.indexOf(A)>=0)&&(H[A]=tt[A]);return H;}var v=Symbol("mesh"),I=Symbol("contours"),L=Symbol("stroke"),w=Symbol("fill"),B=Symbol("strokeColor"),E=Symbol("fillColor"),b=Symbol("transform"),W=Symbol("invertTransform"),D=Symbol("uniforms"),R=Symbol("texOptions"),Y=Symbol("blend"),V=Symbol("applyTexture"),Q=Symbol("applyTransform"),et=Symbol("applyGradientTransform"),it=Symbol("applyProgram"),$=Symbol("gradient"),K=Symbol("filter"),rt=Symbol("opacity"),lt=Symbol("program"),ct=Symbol("attributes"),gt=Symbol("pass"),st=Symbol("clipContext"),Ot=Symbol("applyClipPath");function St(tt,j){var H=tt[1][0]-tt[0][0],T=tt[1][1]-tt[0][1],A=[];for(var U=0;U<j.length;U++){var G=j[U],J=[(G[0]-tt[0][0])/H,1-(G[1]-tt[0][1])/T];A.push(J);}return A;}function F(_ref63,_ref64,_ref65){var _ref66=_slicedToArray(_ref63,2),tt=_ref66[0],j=_ref66[1];var _ref67=_slicedToArray(_ref64,4),H=_ref67[0],T=_ref67[1],A=_ref67[2],U=_ref67[3];var G=_ref65.scale;return G||(tt/=A,j=1-j/U,tt-=H,j+=T),[tt,j,0];}function z(tt,j,H){var T=S()(tt,j,H);return T.path=tt,T.simplify=H,T.scale=j,T;}var Z=/*#__PURE__*/function(){function Z(j){_classCallCheck(this,Z);this[L]=null,this[w]=null,this[b]=[1,0,0,1,0,0],this[rt]=1,this[D]={},this[K]=[],this[Y]=null,this[R]={},this.contours=j.contours,this[lt]=null,this[ct]={},this[gt]=[];}return _createClass(Z,[{key:"contours",get:function get(){return this[I];},set:function set(j){this[v]=null,this[I]=j;var H=j.scale;this.transformScale/H>1.5&&this.accurate(this.transformScale);}},{key:"setProgram",value:function setProgram(j){this[lt]=j,this[v]&&this[it](j);}},{key:"program",get:function get(){return this[lt];}},{key:"setAttribute",value:function setAttribute(j,H){H==null?delete this[ct][j]:this[ct][j]=H;}},{key:"getOpacity",value:function getOpacity(){return this[rt];}},{key:"setOpacity",value:function setOpacity(j){if(j<0||j>1)throw new TypeError("Invalid opacity value.");this[v]&&this[v].positions.forEach(function(H){H[2]=1/H[2]>0?j:-j;}),this[rt]=j;}},{key:"setClipPath",value:function setClipPath(j){this.clipPath=j,this[D].u_clipSampler&&this[D].u_clipSampler["delete"](),this.setUniforms({u_clipSampler:null}),this[v]&&delete this[v].attributes.a_clipUV,j&&this[v]&&this[Ot]();}},{key:Ot,value:function value(){if(this.clipPath){this[st]||(this[st]=h["default"].createCanvas(1,1));var _this$boundingBox=_slicedToArray(this.boundingBox,2),_this$boundingBox$=_slicedToArray(_this$boundingBox[0],2),j=_this$boundingBox$[0],H=_this$boundingBox$[1],_this$boundingBox$2=_slicedToArray(_this$boundingBox[1],2),T=_this$boundingBox$2[0],A=_this$boundingBox$2[1];T&&A&&(this[st].width=T-j,this[st].height=A-H);var U=this[st].getContext("2d"),G=new Path2D(this.clipPath);U.clearRect(0,0,this[st].width,this[st].height),U.save(),U.translate(-j,-H),U.fillStyle="white",U.fill(G),U.restore(),this[v].clipPath=this[st];var J=St(this.boundingBox,this[v].position0);this[v].attributes.a_clipUV=J;}}},{key:"getPointAtLength",value:function getPointAtLength(j){return Object(f.getPointAtLength)(this[I],j);}},{key:"getTotalLength",value:function getTotalLength(){return Object(f.getTotalLength)(this[I]);}},{key:"blend",get:function get(){return this[Y]==null?"auto":this[Y];},set:function set(j){this[Y]=j,this[v]&&(this[v].enableBlend=this.enableBlend);}},{key:"boundingBox",get:function get(){if(this[v]&&this[v].boundingBox)return this[v].boundingBox;var j=this.meshData;if(j){var H=j.position0;if(H.length)j.boundingBox=s()(H);else return[[0,0],[0,0]];return j.boundingBox;}return[[0,0],[0,0]];}},{key:"boundingCenter",get:function get(){var j=this.boundingBox;return j?[0.5*(j[0][0]+j[1][0]),0.5*(j[0][1]+j[1][1])]:[0,0];}},{key:"fillRule",get:function get(){return this[w]?this[w].rule:"nonzero";}},{key:"lineWidth",get:function get(){return this[L]?this[L].lineWidth:0;}},{key:"lineCap",get:function get(){return this[L]?this[L].lineCap:"";}},{key:"lineJoin",get:function get(){return this[L]?this[L].lineJoin:"";}},{key:"miterLimit",get:function get(){return this[L]?this[L].miterLimit:0;}},{key:"strokeStyle",get:function get(){return this[B]&&this[B][3]!==0?Object(a["default"])(this[B]):"";}},{key:"lineDash",get:function get(){return this[L]?this[L].lineDash:null;}},{key:"lineDashOffset",get:function get(){return this[L]?this[L].lineDashOffset:0;}},{key:"fillStyle",get:function get(){return this[E]&&this[E][3]!==0?Object(a["default"])(this[E]):"";}},{key:"gradient",get:function get(){return this[$];}},{key:"texture",get:function get(){return this[D].u_texSampler?{image:this[D].u_texSampler._img,options:this[R]}:null;}},{key:"enableBlend",get:function get(){return this[Y]===!0||this[Y]===!1?this[Y]:this[rt]<1||this[B]!=null&&this[B][3]<1||this[E]!=null&&this[E][3]<1||this[D].u_colorMatrix!=null&&this[D].u_colorMatrix[18]<1||this[D].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[K].join(" ");}},{key:"transformMatrix",get:function get(){return this[b];}},{key:"invertMatrix",get:function get(){if(!this[W]){var j=r.mat2d.invert(Array.of(0,0,0,0,0,0),this[b]);this[W]=j;}return this[W];}},{key:"transformScale",get:function get(){var j=this[b];return Math.max(Math.hypot(j[0],j[1]),Math.hypot(j[2],j[3]));}},{key:"uniforms",get:function get(){return this[D];}},{key:"pass",get:function get(){return this[gt];}},{key:it,value:function value(j){var H=this[ct],T=this[v].position0,A=Object.entries(j._attribute);for(var U=0;U<A.length;U++){var _A$U=_slicedToArray(A[U],2),G=_A$U[0],J=_A$U[1];if(G!=="a_color"&&G!=="a_sourceRect"&&J!=="ignored"){var q=H[G];if(G==="uv"&&!q){var nt=this[v].boundingBox||s()(T);this[v].attributes[G]=St(nt,T);}else{this[v].attributes[G]=[];for(var _nt=0;_nt<T.length;_nt++){var ut=T[_nt];this[v].attributes[G].push(q?q(ut,U,T):Array(J.size).fill(0));}}}}}// {stroke, fill}
|
|
47
|
+
},{key:"meshData",get:function get(){var _this20=this;if(this._updateMatrix&&this.transformScale/this.contours.scale>1.5&&this.accurate(this.transformScale),!this[v]){!this[w]&&!this[L]&&this.setFill();var j=this[I],H={};if(j&&j.length){if(this[w])try{var U=x()(j,this[w]);U.positions=U.positions.map(function(G){return G.push(_this20[rt]),G;}),U.attributes={a_color:Array.from({length:U.positions.length}).map(function(){return _this20[E].map(function(G){return Math.round(255*G);});})// a_sourceRect: Array.from({length: mesh.positions.length}).map(() => [0, 0, 0, 0]),
|
|
48
|
+
},H.fill=U;}catch(_unused3){}if(this[L]){var _U=this[L].lineDash;var G=j;if(_U){var q=this[L].lineDashOffset;G=Object(f.getDashContours)(j,_U,q);}var J=G.map(function(q,nt){var ut=q.length>1&&r.vec2.equals(q[0],q[q.length-1]),pt=_this20[L].build(q,ut);return x()([pt]);});J.forEach(function(q){q.positions=q.positions.map(function(nt){return nt.push(-_this20[rt]),nt;}),q.attributes={a_color:Array.from({length:q.positions.length}).map(function(){return _this20[B].map(function(nt){return Math.round(255*nt);});})};}),H.stroke=Object(o["default"])(J);}}var T=Object(o["default"])([H.fill,H.stroke]);T.fillPointCount=H.fill?H.fill.positions.length:0,T.enableBlend=this.enableBlend,T.position0=T.positions.map(function(_ref68){var _ref69=_slicedToArray(_ref68,3),U=_ref69[0],G=_ref69[1],J=_ref69[2];return[U,G,J];}),T.uniforms=this[D],this[v]=T,this[D].u_texSampler&&this[V](T,this[R]);var A=this[b];Object(y.isUnitTransform)(A)||(this[Q](T,A),this[D].u_radialGradientVector&&this[et]()),this.clipPath&&this[Ot](),this[lt]&&this[it](this[lt]);}return this._updateMatrix&&(this[v].matrix=this[b],this[Q](this[v],this[b]),this[D].u_radialGradientVector&&this[et]()),this[v];}},{key:Q,value:function value(j,H){var T=j.positions,A=j.position0;for(var U=0;U<T.length;U++){var _A$U2=_slicedToArray(A[U],2),G=_A$U2[0],J=_A$U2[1],q=T[U];q[0]=G*H[0]+J*H[2]+H[4],q[1]=G*H[1]+J*H[3]+H[5];}this._updateMatrix=!1;}},{key:et,value:function value(){var j=this[b],H=_toConsumableArray(this._radialGradientVector);if(H){var _H=_slicedToArray(H,5),T=_H[0],A=_H[1],U=_H[3],G=_H[4];H[0]=T*j[0]+A*j[2]+j[4],H[1]=T*j[1]+A*j[3]+j[5],H[3]=U*j[0]+G*j[2]+j[4],H[4]=U*j[1]+G*j[3]+j[5],this[D].u_radialGradientVector=H;}}},{key:V,value:function value(j,H){function T(nt,ut){return nt==null&&ut==null?!0:nt==null||ut==null?!1:nt[0]===ut[0]&&nt[1]===ut[1]&&nt[2]===ut[2]&&nt[3]===ut[3];}var A=this[D].u_texSampler;if(!A)return;var _A$_img=A._img,U=_A$_img.width,G=_A$_img.height,J=H.srcRect;var q=H.rect||[0,0];if(H.rotated&&(q=[-q[1],q[0],q[3],q[2]]),q[2]==null&&(q[2]=J?J[2]:U),q[3]==null&&(q[3]=J?J[3]:G),H.hidden)j.textureCoord=j.positions.map(function(){return[-1,-1,-1];});else if(!j.textureCoord||!T(this[R].rect,H.rect)||this[R].hidden!==H.hidden||this[R].rotated!==H.rotated){var nt=null;H.rotated&&(nt=r.mat2d.rotate(Array.of(0,0,0,0,0,0),r.mat2d.fromValues(1,0,0,1,0,0),0.5*Math.PI),nt=r.mat2d.translate(Array.of(0,0,0,0,0,0),nt,[0,-q[2]])),j.textureCoord=j.position0.map(function(_ref70){var _ref71=_slicedToArray(_ref70,3),ut=_ref71[0],pt=_ref71[1],yt=_ref71[2];if(1/yt>0){if(H.rotated){var vt=ut*nt[0]+pt*nt[2]+nt[4],mt=ut*nt[1]+pt*nt[3]+nt[5];ut=vt;pt=mt;}var Tt=F([ut,pt],[q[0]/q[2],q[1]/q[3],q[2],q[3]],H);return H.repeat&&(Tt[2]=1),Tt;}return[-1,-1,-1];});}if(J){var _nt2=[J[0]/U,J[1]/G,J[2]/U,J[3]/G];j.attributes.a_sourceRect=j.positions.map(function(){return[].concat(_nt2);});}else j.attributes.a_sourceRect=j.positions.map(function(){return[0,0,0,0];});}},{key:"accurate",value:function accurate(j){if(!this.contours)return;if(this.contours.path){var T=this.contours.simplify,A=z(this.contours.path,2*j,T);this[v]=null,this[I]=A;}}},{key:"canIgnore",value:function canIgnore(){var j=this[L]==null||this[L].lineWidth===0||this[B][3]===0,H=this[w]==null||this[E][3]===0,T=this[D].u_radialGradientVector==null,A=this[D].u_texSampler==null;return this[rt]===0||this[lt]==null&&j&&H&&T&&A&&!this.beforeRender&&!this.afterRender;}// join: 'miter' or 'bevel'
|
|
49
|
+
// cap: 'butt' or 'square'
|
|
50
|
+
// lineDash: null
|
|
51
|
+
// lineDashOffset: 0
|
|
52
|
+
},{key:"setStroke",value:function setStroke(){var _ref72=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref72$thickness=_ref72.thickness,j=_ref72$thickness===void 0?1:_ref72$thickness,_ref72$cap=_ref72.cap,H=_ref72$cap===void 0?"butt":_ref72$cap,_ref72$join=_ref72.join,T=_ref72$join===void 0?"miter":_ref72$join,_ref72$miterLimit=_ref72.miterLimit,A=_ref72$miterLimit===void 0?10:_ref72$miterLimit,_ref72$color=_ref72.color,U=_ref72$color===void 0?[0,0,0,0]:_ref72$color,_ref72$lineDash=_ref72.lineDash,G=_ref72$lineDash===void 0?null:_ref72$lineDash,_ref72$lineDashOffset=_ref72.lineDashOffset,J=_ref72$lineDashOffset===void 0?0:_ref72$lineDashOffset,_ref72$roundSegments=_ref72.roundSegments,q=_ref72$roundSegments===void 0?20:_ref72$roundSegments;return this[v]=null,this[L]=new l["default"]({lineWidth:j,lineCap:H,lineJoin:T,miterLimit:A,roundSegments:q}),typeof U=="string"&&(U=Object(P["default"])(U)),this[B]=U,this[L].lineDash=G,this[L].lineDashOffset=J,this;}},{key:"setFill",value:function setFill(){var _ref73=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref73$rule=_ref73.rule,j=_ref73$rule===void 0?this.fillRule:_ref73$rule,_ref73$color=_ref73.color,H=_ref73$color===void 0?[0,0,0,0]:_ref73$color;return this[v]=null,this[w]={rule:j},typeof H=="string"&&(H=Object(P["default"])(H)),this[E]=H,this;}/**
|
|
53
|
+
options: {
|
|
54
|
+
scale: false,
|
|
55
|
+
repeat: false,
|
|
56
|
+
rotated: false,
|
|
57
|
+
rect: [10, 10],
|
|
58
|
+
srcRect: [...],
|
|
59
|
+
hidden: false,
|
|
60
|
+
}
|
|
61
|
+
*/},{key:"setTexture",value:function setTexture(j){var H=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(j&&j.image){var _j=j,T=_j.image,A=_j.rect;if(j=T,H.rect)for(var U=0;U<H.rect.length;U++)A[U]=H.rect[U];H.rect=A;}return this[w]||this.setFill(),this.setUniforms({u_texSampler:j}),this[v]&&this[V](this[v],H),this[R]=H,this;}},{key:"setCircularGradient",value:function setCircularGradient(){var _ref74=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},j=_ref74.vector,H=_ref74.colors,_ref74$type=_ref74.type,T=_ref74$type===void 0?"fill":_ref74$type;if(j.length!==3)throw new TypeError("Invalid linearGradient.");this.setGradient({vector:j,colors:H,type:T});}},{key:"setLinearGradient",value:function setLinearGradient(){var _ref75=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},j=_ref75.vector,H=_ref75.colors,_ref75$type=_ref75.type,T=_ref75$type===void 0?"fill":_ref75$type;if(j.length!==4)throw new TypeError("Invalid linearGradient.");this.setGradient({vector:j,colors:H,type:T});}},{key:"setRadialGradient",value:function setRadialGradient(){var _ref76=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},j=_ref76.vector,H=_ref76.colors,_ref76$type=_ref76.type,T=_ref76$type===void 0?"fill":_ref76$type;if(j.length!==6)throw new TypeError("Invalid radialGradient.");this.setGradient({vector:j,colors:H,type:T});}/**
|
|
62
|
+
vector: [x0, y0, r0, x1, y1, r1],
|
|
63
|
+
colors: [{offset:0, color}, {offset:1, color}, ...],
|
|
64
|
+
*/},{key:"setGradient",value:function setGradient(){var _ref77=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},j=_ref77.vector,H=_ref77.colors,_ref77$type=_ref77.type,T=_ref77$type===void 0?"fill":_ref77$type;H=H.map(function(_ref78){var G=_ref78.offset,J=_ref78.color;return typeof J=="string"&&(J=Object(P["default"])(J)),{offset:G,color:J};}),this[$]=this[$]||{},this[$][T]={vector:j,colors:H},H.sort(function(G,J){return G.offset-J.offset;});var A=[];H.forEach(function(_ref79){var G=_ref79.offset,J=_ref79.color;A.push.apply(A,[G].concat(_toConsumableArray(J)));});var U;if(j.length===4?U=[j[0],j[1],0,j[2],j[3],0]:U=_toConsumableArray(j),A.length<40&&A.push(-1),A.length>40)throw new Error("Too many colors, should be less than 8 colors");return this._radialGradientVector=U,this[D].u_colorSteps=A,T==="fill"?this[D].u_gradientType=1:this[D].u_gradientType=0,this[et](),this;}},{key:"setUniforms",value:function setUniforms(){var j=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return Object.assign(this[D],j),this;}},{key:"setTransform",value:function setTransform(){var H=this[b];for(var _len3=arguments.length,j=new Array(_len3),_key3=0;_key3<_len3;_key3++){j[_key3]=arguments[_key3];}return r.mat2d.equals(j,H)||(this[b]=j,delete this[W],this._updateMatrix=!0),this;}},{key:"transform",value:function transform(){var H=this[b];for(var _len4=arguments.length,j=new Array(_len4),_key4=0;_key4<_len4;_key4++){j[_key4]=arguments[_key4];}return this[b]=r.mat2d.multiply(Array.of(0,0,0,0,0,0),H,j),delete this[W],this._updateMatrix=!0,this;}},{key:"translate",value:function translate(j,H){var T=r.mat2d.create();return T=r.mat2d.translate(Array.of(0,0,0,0,0,0),T,[j,H]),this.transform.apply(this,_toConsumableArray(T));}},{key:"rotate",value:function rotate(j){var _ref80=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[0,0],_ref81=_slicedToArray(_ref80,2),H=_ref81[0],T=_ref81[1];var A=r.mat2d.create();return A=r.mat2d.translate(Array.of(0,0,0,0,0,0),A,[H,T]),A=r.mat2d.rotate(Array.of(0,0,0,0,0,0),A,j),A=r.mat2d.translate(Array.of(0,0,0,0,0,0),A,[-H,-T]),this.transform.apply(this,_toConsumableArray(A));}},{key:"scale",value:function scale(j){var H=arguments.length>1&&arguments[1]!==undefined?arguments[1]:j;var _ref82=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref83=_slicedToArray(_ref82,2),T=_ref83[0],A=_ref83[1];var U=r.mat2d.create();return U=r.mat2d.translate(Array.of(0,0,0,0,0,0),U,[T,A]),U=r.mat2d.scale(Array.of(0,0,0,0,0,0),U,[j,H]),U=r.mat2d.translate(Array.of(0,0,0,0,0,0),U,[-T,-A]),this.transform.apply(this,_toConsumableArray(U));}},{key:"skew",value:function skew(j){var H=arguments.length>1&&arguments[1]!==undefined?arguments[1]:j;var _ref84=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref85=_slicedToArray(_ref84,2),T=_ref85[0],A=_ref85[1];var U=r.mat2d.create();return U=r.mat2d.translate(Array.of(0,0,0,0,0,0),U,[T,A]),U=r.mat2d.multiply(Array.of(0,0,0,0,0,0),U,r.mat2d.fromValues(1,Math.tan(H),Math.tan(j),1,0,0)),U=r.mat2d.translate(Array.of(0,0,0,0,0,0),U,[-T,-A]),this.transform.apply(this,_toConsumableArray(U));}},{key:"clearFilter",value:function clearFilter(){return this.setColorTransform(null),this[K].length=0,this;}},{key:"setColorTransform",value:function setColorTransform(){for(var _len5=arguments.length,j=new Array(_len5),_key5=0;_key5<_len5;_key5++){j[_key5]=arguments[_key5];}return j[0]===null?this.setUniforms({u_filterFlag:0,u_colorMatrix:0}):this.setUniforms({u_filterFlag:1,u_colorMatrix:j}),this;}// apply linear color transform
|
|
65
|
+
},{key:"transformColor",value:function transformColor(){var H=this.uniforms.u_colorMatrix;for(var _len6=arguments.length,j=new Array(_len6),_key6=0;_key6<_len6;_key6++){j[_key6]=arguments[_key6];}return H?H=Object(c.multiply)(H,j):H=j,this.setColorTransform.apply(this,_toConsumableArray(H)),this;}},{key:"blur",value:function blur(j){return this[K].push("blur(".concat(j,"px)")),this;}},{key:"brightness",value:function brightness(){var j=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[K].push("brightness(".concat(100*j,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(c.brightness)(j)));}},{key:"contrast",value:function contrast(){var j=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[K].push("contrast(".concat(100*j,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(c.contrast)(j)));}},{key:"dropShadow",value:function dropShadow(j,H){var T=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var A=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[0,0,0,1];return Array.isArray(A)&&(A=Object(a["default"])(A)),this[K].push("drop-shadow(".concat(j,"px ").concat(H,"px ").concat(T,"px ").concat(A,")")),this;}},{key:"grayscale",value:function grayscale(){var j=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[K].push("grayscale(".concat(100*j,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(c.grayscale)(j)));}// https://github.com/phoboslab/WebGLImageFilter/blob/master/webgl-image-filter.js#L371
|
|
66
|
+
},{key:"hueRotate",value:function hueRotate(){var j=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this[K].push("hue-rotate(".concat(j,"deg)")),this.transformColor.apply(this,_toConsumableArray(Object(c.hueRotate)(j)));}},{key:"invert",value:function invert(){var j=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[K].push("invert(".concat(100*j,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(c.invert)(j)));}},{key:"opacity",value:function opacity(){var j=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[K].push("opacity(".concat(100*j,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(c.opacity)(j)));}},{key:"saturate",value:function saturate(){var j=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[K].push("saturate(".concat(100*j,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(c.saturate)(j)));}},{key:"sepia",value:function sepia(){var j=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[K].push("sepia(".concat(100*j,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(c.sepia)(j)));}},{key:"url",value:function url(j){return this[K].push("url(".concat(j,")")),this;}},{key:"isPointCollision",value:function isPointCollision(j,H){var T=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"both";var A=this.meshData,U=A.positions,G=A.cells,J=this.invertMatrix,q=J[0]*j+J[2]*H+J[4],nt=J[1]*j+J[3]*H+J[5],ut=this.boundingBox;if(q<ut[0][0]||q>ut[1][0]||nt<ut[0][1]||nt>ut[1][1])return!1;function pt(_ref86,_ref87,_ref88){var _ref89=_slicedToArray(_ref86,2),yt=_ref89[0],Tt=_ref89[1];var _ref90=_slicedToArray(_ref87,2),vt=_ref90[0],mt=_ref90[1];var _ref91=_slicedToArray(_ref88,2),Pt=_ref91[0],Mt=_ref91[1];var At=Pt-vt,It=Mt-mt,Nt=((yt-vt)*At+(Tt-mt)*It)/(Math.pow(At,2)+Math.pow(It,2));return Nt>=0&&Nt<=1;}for(var yt=0;yt<G.length;yt++){var Tt=G[yt];if(T==="fill"&&Tt[0]>=A.fillPointCount)break;if(T==="stroke"&&Tt[0]<A.fillPointCount)continue;var _Tt$map=Tt.map(function(Ut){return U[Ut];}),_Tt$map2=_slicedToArray(_Tt$map,3),_Tt$map2$=_slicedToArray(_Tt$map2[0],2),vt=_Tt$map2$[0],mt=_Tt$map2$[1],_Tt$map2$2=_slicedToArray(_Tt$map2[1],2),Pt=_Tt$map2$2[0],Mt=_Tt$map2$2[1],_Tt$map2$3=_slicedToArray(_Tt$map2[2],2),At=_Tt$map2$3[0],It=_Tt$map2$3[1],Nt=Math.sign((j-vt)*(Mt-mt)-(Pt-vt)*(H-mt));if(Nt===0&&pt([j,H],[vt,mt],[Pt,Mt]))return!0;var $t=Math.sign((j-Pt)*(It-Mt)-(At-Pt)*(H-Mt));if($t===0&&pt([j,H],[Pt,Mt],[At,It]))return!0;var jt=Math.sign((j-At)*(mt-It)-(vt-At)*(H-It));if(jt===0&&pt([j,H],[At,It],[vt,mt])||Nt===1&&$t===1&&jt===1||Nt===-1&&$t===-1&&jt===-1)return!0;}return!1;}},{key:"isPointInFill",value:function isPointInFill(j,H){return this.isPointCollision(j,H,"fill");}},{key:"isPointInStroke",value:function isPointInStroke(j,H){return this.isPointCollision(j,H,"stroke");}},{key:"addPass",value:function addPass(j){var H=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var T=H.width,A=H.height,U=p(H,["width","height"]);var G=new C["default"]();G.rect(0,0,T,A);var J=new Z(G,{width:T,height:A});J.setUniforms(U),J.setProgram(j),this[gt].push(J);}}]);}();},/* 57 *//***/function(u,e,t){t.r(e);var r=t(58);t(1).glMatrix.setMatrixArrayType(Array),e["default"]=r.Stroke;},/* 58 *//***/function(u,e,t){t.r(e),t.d(e,"Stroke",function(){return y;});var r=t(49);t(1).glMatrix.setMatrixArrayType(Array);var n=Object(r.create)(),s=Object(r.create)(),l=Object(r.create)(),o=Object(r.create)(),a=Object(r.create)(),c=1e20;var y=/*#__PURE__*/function(){function y(){var _ref92=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref92$lineWidth=_ref92.lineWidth,S=_ref92$lineWidth===void 0?1:_ref92$lineWidth,_ref92$lineJoin=_ref92.lineJoin,P=_ref92$lineJoin===void 0?"miter":_ref92$lineJoin,_ref92$miterLimit=_ref92.miterLimit,C=_ref92$miterLimit===void 0?10:_ref92$miterLimit,_ref92$lineCap=_ref92.lineCap,h=_ref92$lineCap===void 0?"butt":_ref92$lineCap,_ref92$roundSegments=_ref92.roundSegments,p=_ref92$roundSegments===void 0?20:_ref92$roundSegments;_classCallCheck(this,y);this.lineWidth=S,this.lineJoin=P,this.miterLimit=C,this.lineCap=h,this.roundSegments=p,this._normal=null;}return _createClass(y,[{key:"build",value:function build(S){var P=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;var C=S.length;if(S=_toConsumableArray(S),C<2)return S;P&&((S[0][0]!==S[C-1][0]||S[0][1]!==S[C-1][1])&&S.push(_toConsumableArray(S[0])),S.push(_toConsumableArray(S[1]))),C=S.length,this._normal=null;var h={left:[],right:[]},p=this.lineWidth/2,d=this.lineCap;if(!P&&d==="square"){Object(r.direction)(s,S[0],S[1]),Object(r.scaleAndAdd)(S[0],S[0],s,p);var I=S.length-1;Object(r.direction)(s,S[I],S[I-1]),Object(r.scaleAndAdd)(S[I],S[I],s,p);}for(var _I4=1;_I4<C;_I4++){var L=S[_I4-1],w=S[_I4],B=S[_I4+1];this._seg(h,L,w,B,p,P);}return!P&&d==="round"&&x(h,this.roundSegments),[].concat(_toConsumableArray(h.left),_toConsumableArray(h.right.reverse()));}},{key:"_seg",value:function _seg(S,P,C,h,p,d){var v=this.lineJoin==="bevel",I=this.lineJoin==="round";if(Object(r.direction)(s,C,P),this._normal||(this._normal=Object(r.create)(),Object(r.normal)(this._normal,s)),S.left.length||g(S,P,this._normal,p),!h)Object(r.normal)(this._normal,s),d?g(S,P,this._normal,p):g(S,C,this._normal,p);else{Object(r.direction)(l,h,C);var L=Object(r.computeMiter)(o,a,s,l,p);L=Math.min(L,c);var w=Object(r.dot)(o,this._normal)<0?-1:1;var B=v||I;if(!B&&this.lineJoin==="miter"&&L/p>this.miterLimit&&(B=!0),B){Object(r.scaleAndAdd)(n,C,this._normal,-p*w),f(S,n,w);var E=1/0;P&&(E=Math.min(E,Math.hypot(C[0]-P[0],C[1]-P[1]))),h&&(E=Math.min(E,Math.hypot(h[0]-C[0],h[1]-C[1])));var b=Math.max(p,Math.min(L,E));if(Object(r.scaleAndAdd)(n,C,a,b*w),f(S,n,-w),h)if(Object(r.normal)(n,l),Object(r.copy)(this._normal,n),Object(r.scaleAndAdd)(n,C,n,-p*w),I){var W=Object(r.clone)(n),D=w>0?S.left[S.left.length-1]:S.right[S.right.length-1],R=Object(r.clone)(C),Y=Object(r.sub)(Object(r.create)(),D,R),V=Object(r.sub)(Object(r.create)(),W,R),Q=Math.PI/this.roundSegments;for(var et=0;et<this.roundSegments&&(Object(r.rotate)(Y,Y,[0,0],w*Q),Math.sign(Object(r.cross)(n,Y,V)[2])===w);et++)Object(r.add)(n,Y,R),f(S,n,w);f(S,W,w);}else f(S,n,w);}else g(S,C,a,L),Object(r.copy)(this._normal,a);}}}]);}();function f(M,S,P){P>0?M.left.push(Object(r.clone)(S)):M.right.push(Object(r.clone)(S));}function g(M,S,P,C){var h=arguments.length>4&&arguments[4]!==undefined?arguments[4]:-1;Object(r.scaleAndAdd)(n,S,P,-C),f(M,n,-h),Object(r.scaleAndAdd)(n,S,P,C),f(M,n,h);}function x(_ref93,P){var M=_ref93.left,S=_ref93.right;var C=Object(r.create)(),h=Object(r.create)();var p=M[0],d=S[0],v=[0.5*(p[0]+d[0]),0.5*(p[1]+d[1])];Object(r.sub)(h,p,v);for(var I=1;I<=P;I++){var L=-1*Math.PI*I/P;Object(r.rotate)(C,h,[0,0],L),Object(r.add)(n,v,C),M.unshift(Object(r.clone)(n));}p=S[S.length-1],d=M[M.length-1],v=[0.5*(p[0]+d[0]),0.5*(p[1]+d[1])],Object(r.sub)(h,p,v);for(var _I5=1;_I5<=P;_I5++){var _L2=-1*Math.PI*_I5/P;Object(r.rotate)(C,h,[0,0],_L2),Object(r.add)(n,v,C),S.push(Object(r.clone)(n));}}},/* 59 *//***/function(u,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(u,e,t){t(1).glMatrix.setMatrixArrayType(Array);var r=t(61),n=t(62);u.exports=function(s,l){if(l=l||{},s=s.filter(function(P){return P.length>2;}),s.length===0)return{positions:[],cells:[]};typeof l.vertexSize!="number"&&(l.vertexSize=s[0][0].length),s=s.map(function(P){return P.reduce(function(C,h){return C.concat(h);});});var o=l.rule==="evenodd"?r.WINDING_ODD:r.WINDING_NONZERO;for(var a=r.tesselate(n({contours:s,windingRule:o,elementType:r.POLYGONS,polySize:3,vertexSize:2},l)),c=[],y=0;y<a.vertices.length;y+=l.vertexSize){var f=a.vertices.slice(y,y+l.vertexSize);c.push(f);}var g=[];for(y=0;y<a.elements.length;y+=3){var x=a.elements[y],M=a.elements[y+1],S=a.elements[y+2];g.push([x,M,S]);}return{positions:c,cells:g};};},/* 61 *//***/function(u,e,t){t(1).glMatrix.setMatrixArrayType(Array);var r={},n={};u.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(h){for(var p=h.debug||!1,d=new C(),v=0;v<h.contours.length;v++)d.addContour(h.vertexSize||2,h.contours[v]);return d.tesselate(h.windingRule||r.WINDING_ODD,h.elementType||r.POLYGONS,h.polySize||3,h.vertexSize||2,h.normal||[0,0,1]),{vertices:d.vertices,vertexIndices:d.vertexIndices,vertexCount:d.vertexCount,elements:d.elements,elementCount:d.elementCount,mesh:p?d.mesh:void 0};};var s=function s(h){if(!h)throw"Assertion Failed!";};function l(){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 o(){this.next=null,this.prev=null,this.anEdge=null,this.trail=null,this.n=0,this.marked=!1,this.inside=!1;}function a(h){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=h;}a.prototype={get Rface(){return this.Sym.Lface;},set Rface(h){this.Sym.Lface=h;},get Dst(){return this.Sym.Org;},set Dst(h){this.Sym.Org=h;},get Oprev(){return this.Sym.Lnext;},set Oprev(h){this.Sym.Lnext=h;},get Lprev(){return this.Onext.Sym;},set Lprev(h){this.Onext.Sym=h;},get Dprev(){return this.Lnext.Sym;},set Dprev(h){this.Lnext.Sym=h;},get Rprev(){return this.Sym.Onext;},set Rprev(h){this.Sym.Onext=h;},get Dnext(){return/*this.Rprev*/this.Sym.Onext.Sym;},/* 3 pointers */set Dnext(h){this.Sym.Onext.Sym=h;},/* 3 pointers */get Rnext(){return/*this.Oprev*/this.Sym.Lnext.Sym;},/* 3 pointers */set Rnext(h){this.Sym.Lnext.Sym=h;}/* 3 pointers */};function c(){var h=new l(),p=new o(),d=new a(0),v=new a(1);h.next=h.prev=h,h.anEdge=null,p.next=p.prev=p,p.anEdge=null,p.trail=null,p.marked=!1,p.inside=!1,d.next=d,d.Sym=v,d.Onext=null,d.Lnext=null,d.Org=null,d.Lface=null,d.winding=0,d.activeRegion=null,v.next=v,v.Sym=d,v.Onext=null,v.Lnext=null,v.Org=null,v.Lface=null,v.winding=0,v.activeRegion=null,this.vHead=h,this.fHead=p,this.eHead=d,this.eHeadSym=v;}c.prototype={/* MakeEdge creates a new pair of half-edges which form their own loop.
|
|
67
|
+
* No vertex or face structures are allocated, but these must be assigned
|
|
68
|
+
* before the current edge operation is completed.
|
|
69
|
+
*///static TESShalfEdge *MakeEdge( TESSmesh* mesh, TESShalfEdge *eNext )
|
|
70
|
+
makeEdge_:function makeEdge_(h){var p=new a(0),d=new a(1);h.Sym.side<h.side&&(h=h.Sym);var v=h.Sym.next;return d.next=v,v.Sym.next=p,p.next=h,h.Sym.next=d,p.Sym=d,p.Onext=p,p.Lnext=d,p.Org=null,p.Lface=null,p.winding=0,p.activeRegion=null,d.Sym=p,d.Onext=d,d.Lnext=p,d.Org=null,d.Lface=null,d.winding=0,d.activeRegion=null,p;},/* Splice( a, b ) is best described by the Guibas/Stolfi paper or the
|
|
71
|
+
* CS348a notes (see mesh.h). Basically it modifies the mesh so that
|
|
72
|
+
* a->Onext and b->Onext are exchanged. This can have various effects
|
|
73
|
+
* depending on whether a and b belong to different face or vertex rings.
|
|
74
|
+
* For more explanation see tessMeshSplice() below.
|
|
75
|
+
*/// static void Splice( TESShalfEdge *a, TESShalfEdge *b )
|
|
76
|
+
splice_:function splice_(h,p){var d=h.Onext,v=p.Onext;d.Sym.Lnext=p,v.Sym.Lnext=h,h.Onext=v,p.Onext=d;},/* MakeVertex( newVertex, eOrig, vNext ) attaches a new vertex and makes it the
|
|
77
|
+
* origin of all edges in the vertex loop to which eOrig belongs. "vNext" gives
|
|
78
|
+
* a place to insert the new vertex in the global vertex list. We insert
|
|
79
|
+
* the new vertex *before* vNext so that algorithms which walk the vertex
|
|
80
|
+
* list will not see the newly created vertices.
|
|
81
|
+
*///static void MakeVertex( TESSvertex *newVertex, TESShalfEdge *eOrig, TESSvertex *vNext )
|
|
82
|
+
makeVertex_:function makeVertex_(h,p,d){var v=h;s(v!==null);var I=d.prev;v.prev=I,I.next=v,v.next=d,d.prev=v,v.anEdge=p;var L=p;do L.Org=v,L=L.Onext;while(L!==p);},/* MakeFace( newFace, eOrig, fNext ) attaches a new face and makes it the left
|
|
83
|
+
* face of all edges in the face loop to which eOrig belongs. "fNext" gives
|
|
84
|
+
* a place to insert the new face in the global face list. We insert
|
|
85
|
+
* the new face *before* fNext so that algorithms which walk the face
|
|
86
|
+
* list will not see the newly created faces.
|
|
87
|
+
*/// static void MakeFace( TESSface *newFace, TESShalfEdge *eOrig, TESSface *fNext )
|
|
88
|
+
makeFace_:function makeFace_(h,p,d){var v=h;s(v!==null);var I=d.prev;v.prev=I,I.next=v,v.next=d,d.prev=v,v.anEdge=p,v.trail=null,v.marked=!1,v.inside=d.inside;var L=p;do L.Lface=v,L=L.Lnext;while(L!==p);},/* KillEdge( eDel ) destroys an edge (the half-edges eDel and eDel->Sym),
|
|
89
|
+
* and removes from the global edge list.
|
|
90
|
+
*///static void KillEdge( TESSmesh *mesh, TESShalfEdge *eDel )
|
|
91
|
+
killEdge_:function killEdge_(h){h.Sym.side<h.side&&(h=h.Sym);var p=h.next,d=h.Sym.next;p.Sym.next=d,d.Sym.next=p;},/* KillVertex( vDel ) destroys a vertex and removes it from the global
|
|
92
|
+
* vertex list. It updates the vertex loop to point to a given new vertex.
|
|
93
|
+
*///static void KillVertex( TESSmesh *mesh, TESSvertex *vDel, TESSvertex *newOrg )
|
|
94
|
+
killVertex_:function killVertex_(h,p){var d=h.anEdge,v=d;do v.Org=p,v=v.Onext;while(v!==d);var I=h.prev,L=h.next;L.prev=I,I.next=L;},/* KillFace( fDel ) destroys a face and removes it from the global face
|
|
95
|
+
* list. It updates the face loop to point to a given new face.
|
|
96
|
+
*///static void KillFace( TESSmesh *mesh, TESSface *fDel, TESSface *newLface )
|
|
97
|
+
killFace_:function killFace_(h,p){var d=h.anEdge,v=d;do v.Lface=p,v=v.Lnext;while(v!==d);var I=h.prev,L=h.next;L.prev=I,I.next=L;},/****************** Basic Edge Operations **********************//* tessMeshMakeEdge creates one edge, two vertices, and a loop (face).
|
|
98
|
+
* The loop consists of the two new half-edges.
|
|
99
|
+
*///TESShalfEdge *tessMeshMakeEdge( TESSmesh *mesh )
|
|
100
|
+
makeEdge:function makeEdge(){var h=new l(),p=new l(),d=new o(),v=this.makeEdge_(this.eHead);return this.makeVertex_(h,v,this.vHead),this.makeVertex_(p,v.Sym,this.vHead),this.makeFace_(d,v,this.fHead),v;},/* tessMeshSplice( eOrg, eDst ) is the basic operation for changing the
|
|
101
|
+
* mesh connectivity and topology. It changes the mesh so that
|
|
102
|
+
* eOrg->Onext <- OLD( eDst->Onext )
|
|
103
|
+
* eDst->Onext <- OLD( eOrg->Onext )
|
|
104
|
+
* where OLD(...) means the value before the meshSplice operation.
|
|
105
|
+
*
|
|
106
|
+
* This can have two effects on the vertex structure:
|
|
107
|
+
* - if eOrg->Org != eDst->Org, the two vertices are merged together
|
|
108
|
+
* - if eOrg->Org == eDst->Org, the origin is split into two vertices
|
|
109
|
+
* In both cases, eDst->Org is changed and eOrg->Org is untouched.
|
|
110
|
+
*
|
|
111
|
+
* Similarly (and independently) for the face structure,
|
|
112
|
+
* - if eOrg->Lface == eDst->Lface, one loop is split into two
|
|
113
|
+
* - if eOrg->Lface != eDst->Lface, two distinct loops are joined into one
|
|
114
|
+
* In both cases, eDst->Lface is changed and eOrg->Lface is unaffected.
|
|
115
|
+
*
|
|
116
|
+
* Some special cases:
|
|
117
|
+
* If eDst == eOrg, the operation has no effect.
|
|
118
|
+
* If eDst == eOrg->Lnext, the new face will have a single edge.
|
|
119
|
+
* If eDst == eOrg->Lprev, the old face will have a single edge.
|
|
120
|
+
* If eDst == eOrg->Onext, the new vertex will have a single edge.
|
|
121
|
+
* If eDst == eOrg->Oprev, the old vertex will have a single edge.
|
|
122
|
+
*///int tessMeshSplice( TESSmesh* mesh, TESShalfEdge *eOrg, TESShalfEdge *eDst )
|
|
123
|
+
splice:function splice(h,p){var d=!1,v=!1;if(h!==p){if(p.Org!==h.Org&&(v=!0,this.killVertex_(p.Org,h.Org)),p.Lface!==h.Lface&&(d=!0,this.killFace_(p.Lface,h.Lface)),this.splice_(p,h),!v){var I=new l();this.makeVertex_(I,p,h.Org),h.Org.anEdge=h;}if(!d){var L=new o();this.makeFace_(L,p,h.Lface),h.Lface.anEdge=h;}}},/* tessMeshDelete( eDel ) removes the edge eDel. There are several cases:
|
|
124
|
+
* if (eDel->Lface != eDel->Rface), we join two loops into one; the loop
|
|
125
|
+
* eDel->Lface is deleted. Otherwise, we are splitting one loop into two;
|
|
126
|
+
* the newly created loop will contain eDel->Dst. If the deletion of eDel
|
|
127
|
+
* would create isolated vertices, those are deleted as well.
|
|
128
|
+
*
|
|
129
|
+
* This function could be implemented as two calls to tessMeshSplice
|
|
130
|
+
* plus a few calls to memFree, but this would allocate and delete
|
|
131
|
+
* unnecessary vertices and faces.
|
|
132
|
+
*///int tessMeshDelete( TESSmesh *mesh, TESShalfEdge *eDel )
|
|
133
|
+
"delete":function _delete(h){var p=h.Sym,d=!1;if(h.Lface!==h.Rface&&(d=!0,this.killFace_(h.Lface,h.Rface)),h.Onext===h)this.killVertex_(h.Org,null);else if(h.Rface.anEdge=h.Oprev,h.Org.anEdge=h.Onext,this.splice_(h,h.Oprev),!d){var v=new o();this.makeFace_(v,h,h.Lface);}p.Onext===p?(this.killVertex_(p.Org,null),this.killFace_(p.Lface,null)):(h.Lface.anEdge=p.Oprev,p.Org.anEdge=p.Onext,this.splice_(p,p.Oprev)),this.killEdge_(h);},/******************** Other Edge Operations **********************//* All these routines can be implemented with the basic edge
|
|
134
|
+
* operations above. They are provided for convenience and efficiency.
|
|
135
|
+
*//* tessMeshAddEdgeVertex( eOrg ) creates a new edge eNew such that
|
|
136
|
+
* eNew == eOrg->Lnext, and eNew->Dst is a newly created vertex.
|
|
137
|
+
* eOrg and eNew will have the same left face.
|
|
138
|
+
*/// TESShalfEdge *tessMeshAddEdgeVertex( TESSmesh *mesh, TESShalfEdge *eOrg );
|
|
139
|
+
addEdgeVertex:function addEdgeVertex(h){var p=this.makeEdge_(h),d=p.Sym;this.splice_(p,h.Lnext),p.Org=h.Dst;var v=new l();return this.makeVertex_(v,d,p.Org),p.Lface=d.Lface=h.Lface,p;},/* tessMeshSplitEdge( eOrg ) splits eOrg into two edges eOrg and eNew,
|
|
140
|
+
* such that eNew == eOrg->Lnext. The new vertex is eOrg->Dst == eNew->Org.
|
|
141
|
+
* eOrg and eNew will have the same left face.
|
|
142
|
+
*/// TESShalfEdge *tessMeshSplitEdge( TESSmesh *mesh, TESShalfEdge *eOrg );
|
|
143
|
+
splitEdge:function splitEdge(h,p){var d=this.addEdgeVertex(h),v=d.Sym;return this.splice_(h.Sym,h.Sym.Oprev),this.splice_(h.Sym,v),h.Dst=v.Org,v.Dst.anEdge=v.Sym,v.Rface=h.Rface,v.winding=h.winding,v.Sym.winding=h.Sym.winding,v;},/* tessMeshConnect( eOrg, eDst ) creates a new edge from eOrg->Dst
|
|
144
|
+
* to eDst->Org, and returns the corresponding half-edge eNew.
|
|
145
|
+
* If eOrg->Lface == eDst->Lface, this splits one loop into two,
|
|
146
|
+
* and the newly created loop is eNew->Lface. Otherwise, two disjoint
|
|
147
|
+
* loops are merged into one, and the loop eDst->Lface is destroyed.
|
|
148
|
+
*
|
|
149
|
+
* If (eOrg == eDst), the new face will have only two edges.
|
|
150
|
+
* If (eOrg->Lnext == eDst), the old face is reduced to a single edge.
|
|
151
|
+
* If (eOrg->Lnext->Lnext == eDst), the old face is reduced to two edges.
|
|
152
|
+
*/// TESShalfEdge *tessMeshConnect( TESSmesh *mesh, TESShalfEdge *eOrg, TESShalfEdge *eDst );
|
|
153
|
+
connect:function connect(h,p){var d=!1,v=this.makeEdge_(h),I=v.Sym;if(p.Lface!==h.Lface&&(d=!0,this.killFace_(p.Lface,h.Lface)),this.splice_(v,h.Lnext),this.splice_(I,p),v.Org=h.Dst,I.Org=p.Org,v.Lface=I.Lface=h.Lface,h.Lface.anEdge=I,!d){var L=new o();this.makeFace_(L,v,h.Lface);}return v;},/* tessMeshZapFace( fZap ) destroys a face and removes it from the
|
|
154
|
+
* global face list. All edges of fZap will have a NULL pointer as their
|
|
155
|
+
* left face. Any edges which also have a NULL pointer as their right face
|
|
156
|
+
* are deleted entirely (along with any isolated vertices this produces).
|
|
157
|
+
* An entire mesh can be deleted by zapping its faces, one at a time,
|
|
158
|
+
* in any order. Zapped faces cannot be used in further mesh operations!
|
|
159
|
+
*/zapFace:function zapFace(h){var p=h.anEdge,d,v,I,L,w;v=p.Lnext;do d=v,v=d.Lnext,d.Lface=null,d.Rface===null&&(d.Onext===d?this.killVertex_(d.Org,null):(d.Org.anEdge=d.Onext,this.splice_(d,d.Oprev)),I=d.Sym,I.Onext===I?this.killVertex_(I.Org,null):(I.Org.anEdge=I.Onext,this.splice_(I,I.Oprev)),this.killEdge_(d));while(d!=p);L=h.prev,w=h.next,w.prev=L,L.next=w;},countFaceVerts_:function countFaceVerts_(h){var p=h.anEdge,d=0;do d++,p=p.Lnext;while(p!==h.anEdge);return d;},//int tessMeshMergeConvexFaces( TESSmesh *mesh, int maxVertsPerFace )
|
|
160
|
+
mergeConvexFaces:function mergeConvexFaces(h){var p,d,v,I,L,w,B;for(p=this.fHead.next;p!==this.fHead;p=p.next)if(p.inside)for(d=p.anEdge,L=d.Org;v=d.Lnext,I=d.Sym,I&&I.Lface&&I.Lface.inside&&(w=this.countFaceVerts_(p),B=this.countFaceVerts_(I.Lface),w+B-2<=h&&n.vertCCW(d.Lprev.Org,d.Org,I.Lnext.Lnext.Org)&&n.vertCCW(I.Lprev.Org,I.Org,d.Lnext.Lnext.Org)&&(v=I.Lnext,this["delete"](I),d=null,I=null)),!(d&&d.Lnext.Org===L);)d=v;return!0;},/* tessMeshCheckMesh( mesh ) checks a mesh for self-consistency.
|
|
161
|
+
*/check:function check(){var h=this.fHead,p=this.vHead,d=this.eHead,v,I,L,w,B,E;for(I=h,I=h;(v=I.next)!==h;I=v){s(v.prev===I),B=v.anEdge;do s(B.Sym!==B),s(B.Sym.Sym===B),s(B.Lnext.Onext.Sym===B),s(B.Onext.Sym.Lnext===B),s(B.Lface===v),B=B.Lnext;while(B!==v.anEdge);}for(s(v.prev===I&&v.anEdge===null),w=p,w=p;(L=w.next)!==p;w=L){s(L.prev===w),B=L.anEdge;do s(B.Sym!==B),s(B.Sym.Sym===B),s(B.Lnext.Onext.Sym===B),s(B.Onext.Sym.Lnext===B),s(B.Org===L),B=B.Onext;while(B!==L.anEdge);}for(s(L.prev===w&&L.anEdge===null),E=d,E=d;(B=E.next)!==d;E=B)s(B.Sym.next===E.Sym),s(B.Sym!==B),s(B.Sym.Sym===B),s(B.Org!==null),s(B.Dst!==null),s(B.Lnext.Onext.Sym===B),s(B.Onext.Sym.Lnext===B);s(B.Sym.next===E.Sym&&B.Sym===this.eHeadSym&&B.Sym.Sym===B&&B.Org===null&&B.Dst===null&&B.Lface===null&&B.Rface===null);}},n.vertEq=function(h,p){return h.s===p.s&&h.t===p.t;},n.vertLeq=function(h,p){return h.s<p.s||h.s===p.s&&h.t<=p.t;},n.transLeq=function(h,p){return h.t<p.t||h.t===p.t&&h.s<=p.s;},n.edgeGoesLeft=function(h){return n.vertLeq(h.Dst,h.Org);},n.edgeGoesRight=function(h){return n.vertLeq(h.Org,h.Dst);},n.vertL1dist=function(h,p){return Math.abs(h.s-p.s)+Math.abs(h.t-p.t);},n.edgeEval=function(h,p,d){s(n.vertLeq(h,p)&&n.vertLeq(p,d));var v=p.s-h.s,I=d.s-p.s;return v+I>0?v<I?p.t-h.t+(h.t-d.t)*(v/(v+I)):p.t-d.t+(d.t-h.t)*(I/(v+I)):0;},n.edgeSign=function(h,p,d){s(n.vertLeq(h,p)&&n.vertLeq(p,d));var v=p.s-h.s,I=d.s-p.s;return v+I>0?(p.t-d.t)*v+(p.t-h.t)*I:0;},n.transEval=function(h,p,d){s(n.transLeq(h,p)&&n.transLeq(p,d));var v=p.t-h.t,I=d.t-p.t;return v+I>0?v<I?p.s-h.s+(h.s-d.s)*(v/(v+I)):p.s-d.s+(d.s-h.s)*(I/(v+I)):0;},n.transSign=function(h,p,d){s(n.transLeq(h,p)&&n.transLeq(p,d));var v=p.t-h.t,I=d.t-p.t;return v+I>0?(p.s-d.s)*v+(p.s-h.s)*I:0;},n.vertCCW=function(h,p,d){return h.s*(p.t-d.t)+p.s*(d.t-h.t)+d.s*(h.t-p.t)>=0;},n.interpolate=function(h,p,d,v){return h=h<0?0:h,d=d<0?0:d,h<=d?d===0?(p+v)/2:p+(v-p)*(h/(h+d)):v+(p-v)*(d/(h+d));},n.intersect=function(h,p,d,v,I){var L,w,B;n.vertLeq(h,p)||(B=h,h=p,p=B),n.vertLeq(d,v)||(B=d,d=v,v=B),n.vertLeq(h,d)||(B=h,h=d,d=B,B=p,p=v,v=B),n.vertLeq(d,p)?n.vertLeq(p,v)?(L=n.edgeEval(h,d,p),w=n.edgeEval(d,p,v),L+w<0&&(L=-L,w=-w),I.s=n.interpolate(L,d.s,w,p.s)):(L=n.edgeSign(h,d,p),w=-n.edgeSign(h,v,p),L+w<0&&(L=-L,w=-w),I.s=n.interpolate(L,d.s,w,v.s)):I.s=(d.s+p.s)/2,n.transLeq(h,p)||(B=h,h=p,p=B),n.transLeq(d,v)||(B=d,d=v,v=B),n.transLeq(h,d)||(B=h,h=d,d=B,B=p,p=v,v=B),n.transLeq(d,p)?n.transLeq(p,v)?(L=n.transEval(h,d,p),w=n.transEval(d,p,v),L+w<0&&(L=-L,w=-w),I.t=n.interpolate(L,d.t,w,p.t)):(L=n.transSign(h,d,p),w=-n.transSign(h,v,p),L+w<0&&(L=-L,w=-w),I.t=n.interpolate(L,d.t,w,v.t)):I.t=(d.t+p.t)/2;};function y(){this.key=null,this.next=null,this.prev=null;}function f(h,p){this.head=new y(),this.head.next=this.head,this.head.prev=this.head,this.frame=h,this.leq=p;}f.prototype={min:function min(){return this.head.next;},max:function max(){return this.head.prev;},insert:function insert(h){return this.insertBefore(this.head,h);},search:function search(h){var p=this.head;do p=p.next;while(p.key!==null&&!this.leq(this.frame,h,p.key));return p;},insertBefore:function insertBefore(h,p){do h=h.prev;while(h.key!==null&&!this.leq(this.frame,h.key,p));var d=new y();return d.key=p,d.next=h.next,h.next.prev=d,d.prev=h,h.next=d,d;},"delete":function _delete(h){h.next.prev=h.prev,h.prev.next=h.next;}};function g(){this.handle=null;}function x(){this.key=null,this.node=null;}function M(h,p){this.size=0,this.max=h,this.nodes=[],this.nodes.length=h+1;var d;for(d=0;d<this.nodes.length;d++)this.nodes[d]=new g();for(this.handles=[],this.handles.length=h+1,d=0;d<this.handles.length;d++)this.handles[d]=new x();this.initialized=!1,this.freeList=0,this.leq=p,this.nodes[1].handle=1,this.handles[1].key=null;}M.prototype={floatDown_:function floatDown_(h){var p=this.nodes,d=this.handles,v,I,L;for(v=p[h].handle;;){if(L=h<<1,L<this.size&&this.leq(d[p[L+1].handle].key,d[p[L].handle].key)&&++L,s(L<=this.max),I=p[L].handle,L>this.size||this.leq(d[v].key,d[I].key)){p[h].handle=v,d[v].node=h;break;}p[h].handle=I,d[I].node=h,h=L;}},floatUp_:function floatUp_(h){var p=this.nodes,d=this.handles,v,I,L;for(v=p[h].handle;;){if(L=h>>1,I=p[L].handle,L===0||this.leq(d[I].key,d[v].key)){p[h].handle=v,d[v].node=h;break;}p[h].handle=I,d[I].node=h,h=L;}},init:function init(){for(var h=this.size;h>=1;--h)this.floatDown_(h);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 )
|
|
162
|
+
insert:function insert(h){var p,d;if(p=++this.size,p*2>this.max){this.max*=2;var v,I;for(I=this.nodes.length,this.nodes.length=this.max+1,v=I;v<this.nodes.length;v++)this.nodes[v]=new g();for(I=this.handles.length,this.handles.length=this.max+1,v=I;v<this.handles.length;v++)this.handles[v]=new x();}return this.freeList===0?d=p:(d=this.freeList,this.freeList=this.handles[d].node),this.nodes[p].handle=d,this.handles[d].node=p,this.handles[d].key=h,this.initialized&&this.floatUp_(p),d;},//PQkey pqHeapExtractMin( PriorityQHeap *pq )
|
|
163
|
+
extractMin:function extractMin(){var h=this.nodes,p=this.handles,d=h[1].handle,v=p[d].key;return this.size>0&&(h[1].handle=h[this.size].handle,p[h[1].handle].node=1,p[d].key=null,p[d].node=this.freeList,this.freeList=d,--this.size,this.size>0&&this.floatDown_(1)),v;},"delete":function _delete(h){var p=this.nodes,d=this.handles,v;s(h>=1&&h<=this.max&&d[h].key!==null),v=d[h].node,p[v].handle=p[this.size].handle,d[p[v].handle].node=v,--this.size,v<=this.size&&(v<=1||this.leq(d[p[v>>1].handle].key,d[p[v].handle].key)?this.floatDown_(v):this.floatUp_(v)),d[h].key=null,d[h].node=this.freeList,this.freeList=h;}};function S(){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(h){return h.nodeUp.prev.key;},P.regionAbove=function(h){return h.nodeUp.next.key;},P.debugEvent=function(h){},P.addWinding=function(h,p){h.winding+=p.winding,h.Sym.winding+=p.Sym.winding;},P.edgeLeq=function(h,p,d){var v=h.event,w,B,I=p.eUp,L=d.eUp;if(I.Dst===v)return L.Dst===v?n.vertLeq(I.Org,L.Org)?n.edgeSign(L.Dst,I.Org,L.Org)<=0:n.edgeSign(I.Dst,L.Org,I.Org)>=0:n.edgeSign(L.Dst,v,L.Org)<=0;if(L.Dst===v)return n.edgeSign(I.Dst,v,I.Org)>=0;var w=n.edgeEval(I.Dst,v,I.Org),B=n.edgeEval(L.Dst,v,L.Org);return w>=B;},P.deleteRegion=function(h,p){p.fixUpperEdge&&s(p.eUp.winding===0),p.eUp.activeRegion=null,h.dict["delete"](p.nodeUp);},P.fixUpperEdge=function(h,p,d){s(p.fixUpperEdge),h.mesh["delete"](p.eUp),p.fixUpperEdge=!1,p.eUp=d,d.activeRegion=p;},P.topLeftRegion=function(h,p){var d=p.eUp.Org,v;do p=P.regionAbove(p);while(p.eUp.Org===d);if(p.fixUpperEdge){if(v=h.mesh.connect(P.regionBelow(p).eUp.Sym,p.eUp.Lnext),v===null)return null;P.fixUpperEdge(h,p,v),p=P.regionAbove(p);}return p;},P.topRightRegion=function(h){var p=h.eUp.Dst;do h=P.regionAbove(h);while(h.eUp.Dst===p);return h;},P.addRegionBelow=function(h,p,d){var v=new S();return v.eUp=d,v.nodeUp=h.dict.insertBefore(p.nodeUp,v),v.fixUpperEdge=!1,v.sentinel=!1,v.dirty=!1,d.activeRegion=v,v;},P.isWindingInside=function(h,p){switch(h.windingRule){case r.WINDING_ODD:return(p&1)!==0;case r.WINDING_NONZERO:return p!==0;case r.WINDING_POSITIVE:return p>0;case r.WINDING_NEGATIVE:return p<0;case r.WINDING_ABS_GEQ_TWO:return p>=2||p<=-2;}return s(!1),!1;},P.computeWinding=function(h,p){p.windingNumber=P.regionAbove(p).windingNumber+p.eUp.winding,p.inside=P.isWindingInside(h,p.windingNumber);},P.finishRegion=function(h,p){var d=p.eUp,v=d.Lface;v.inside=p.inside,v.anEdge=d,P.deleteRegion(h,p);},P.finishLeftRegions=function(h,p,d){for(var v,w,I=null,L=p,w=p.eUp;L!==d;){if(L.fixUpperEdge=!1,I=P.regionBelow(L),v=I.eUp,v.Org!=w.Org){if(!I.fixUpperEdge){P.finishRegion(h,L);break;}v=h.mesh.connect(w.Lprev,v.Sym),P.fixUpperEdge(h,I,v);}w.Onext!==v&&(h.mesh.splice(v.Oprev,v),h.mesh.splice(w,v)),P.finishRegion(h,L),w=I.eUp,L=I;}return w;},P.addRightEdges=function(h,p,d,v,I,L){var w,B,E,b,W=!0;E=d;do s(n.vertLeq(E.Org,E.Dst)),P.addRegionBelow(h,p,E.Sym),E=E.Onext;while(E!==v);for(I===null&&(I=P.regionBelow(p).eUp.Rprev),B=p,b=I;w=P.regionBelow(B),E=w.eUp.Sym,E.Org===b.Org;)E.Onext!==b&&(h.mesh.splice(E.Oprev,E),h.mesh.splice(b.Oprev,E)),w.windingNumber=B.windingNumber-E.winding,w.inside=P.isWindingInside(h,w.windingNumber),B.dirty=!0,!W&&P.checkForRightSplice(h,B)&&(P.addWinding(E,b),P.deleteRegion(h,B),h.mesh["delete"](b)),W=!1,B=w,b=E;B.dirty=!0,s(B.windingNumber-E.winding===w.windingNumber),L&&P.walkDirtyRegions(h,B);},P.spliceMergeVertices=function(h,p,d){h.mesh.splice(p,d);},P.vertexWeights=function(h,p,d){var v=n.vertL1dist(p,h),I=n.vertL1dist(d,h),L=0.5*I/(v+I),w=0.5*v/(v+I);h.coords[0]+=L*p.coords[0]+w*d.coords[0],h.coords[1]+=L*p.coords[1]+w*d.coords[1],h.coords[2]+=L*p.coords[2]+w*d.coords[2];},P.getIntersectData=function(h,p,d,v,I,L){p.coords[0]=p.coords[1]=p.coords[2]=0,p.idx=-1,P.vertexWeights(p,d,v),P.vertexWeights(p,I,L);},P.checkForRightSplice=function(h,p){var d=P.regionBelow(p),v=p.eUp,I=d.eUp;if(n.vertLeq(v.Org,I.Org)){if(n.edgeSign(I.Dst,v.Org,I.Org)>0)return!1;n.vertEq(v.Org,I.Org)?v.Org!==I.Org&&(h.pq["delete"](v.Org.pqHandle),P.spliceMergeVertices(h,I.Oprev,v)):(h.mesh.splitEdge(I.Sym),h.mesh.splice(v,I.Oprev),p.dirty=d.dirty=!0);}else{if(n.edgeSign(v.Dst,I.Org,v.Org)<0)return!1;P.regionAbove(p).dirty=p.dirty=!0,h.mesh.splitEdge(v.Sym),h.mesh.splice(I.Oprev,v);}return!0;},P.checkForLeftSplice=function(h,p){var d=P.regionBelow(p),v=p.eUp,I=d.eUp,L;if(s(!n.vertEq(v.Dst,I.Dst)),n.vertLeq(v.Dst,I.Dst)){if(n.edgeSign(v.Dst,I.Dst,v.Org)<0)return!1;P.regionAbove(p).dirty=p.dirty=!0,L=h.mesh.splitEdge(v),h.mesh.splice(I.Sym,L),L.Lface.inside=p.inside;}else{if(n.edgeSign(I.Dst,v.Dst,I.Org)>0)return!1;p.dirty=d.dirty=!0,L=h.mesh.splitEdge(I),h.mesh.splice(v.Lnext,I.Sym),L.Rface.inside=p.inside;}return!0;},P.checkForIntersect=function(h,p){var d=P.regionBelow(p),v=p.eUp,I=d.eUp,L=v.Org,w=I.Org,B=v.Dst,E=I.Dst,b,W,D=new l(),R,Y;if(s(!n.vertEq(E,B)),s(n.edgeSign(B,h.event,L)<=0),s(n.edgeSign(E,h.event,w)>=0),s(L!==h.event&&w!==h.event),s(!p.fixUpperEdge&&!d.fixUpperEdge),L===w||(b=Math.min(L.t,B.t),W=Math.max(w.t,E.t),b>W))return!1;if(n.vertLeq(L,w)){if(n.edgeSign(E,L,w)>0)return!1;}else if(n.edgeSign(B,w,L)<0)return!1;return P.debugEvent(h),n.intersect(B,L,E,w,D),s(Math.min(L.t,B.t)<=D.t),s(D.t<=Math.max(w.t,E.t)),s(Math.min(E.s,B.s)<=D.s),s(D.s<=Math.max(w.s,L.s)),n.vertLeq(D,h.event)&&(D.s=h.event.s,D.t=h.event.t),R=n.vertLeq(L,w)?L:w,n.vertLeq(R,D)&&(D.s=R.s,D.t=R.t),n.vertEq(D,L)||n.vertEq(D,w)?(P.checkForRightSplice(h,p),!1):!n.vertEq(B,h.event)&&n.edgeSign(B,h.event,D)>=0||!n.vertEq(E,h.event)&&n.edgeSign(E,h.event,D)<=0?E===h.event?(h.mesh.splitEdge(v.Sym),h.mesh.splice(I.Sym,v),p=P.topLeftRegion(h,p),v=P.regionBelow(p).eUp,P.finishLeftRegions(h,P.regionBelow(p),d),P.addRightEdges(h,p,v.Oprev,v,v,!0),!0):B===h.event?(h.mesh.splitEdge(I.Sym),h.mesh.splice(v.Lnext,I.Oprev),d=p,p=P.topRightRegion(p),Y=P.regionBelow(p).eUp.Rprev,d.eUp=I.Oprev,I=P.finishLeftRegions(h,d,null),P.addRightEdges(h,p,I.Onext,v.Rprev,Y,!0),!0):(n.edgeSign(B,h.event,D)>=0&&(P.regionAbove(p).dirty=p.dirty=!0,h.mesh.splitEdge(v.Sym),v.Org.s=h.event.s,v.Org.t=h.event.t),n.edgeSign(E,h.event,D)<=0&&(p.dirty=d.dirty=!0,h.mesh.splitEdge(I.Sym),I.Org.s=h.event.s,I.Org.t=h.event.t),!1):(h.mesh.splitEdge(v.Sym),h.mesh.splitEdge(I.Sym),h.mesh.splice(I.Oprev,v),v.Org.s=D.s,v.Org.t=D.t,v.Org.pqHandle=h.pq.insert(v.Org),P.getIntersectData(h,v.Org,L,B,w,E),P.regionAbove(p).dirty=p.dirty=d.dirty=!0,!1);},P.walkDirtyRegions=function(h,p){for(var d=P.regionBelow(p),v,I;;){for(;d.dirty;)p=d,d=P.regionBelow(d);if(!p.dirty&&(d=p,p=P.regionAbove(p),p===null||!p.dirty))return;if(p.dirty=!1,v=p.eUp,I=d.eUp,v.Dst!==I.Dst&&P.checkForLeftSplice(h,p)&&(d.fixUpperEdge?(P.deleteRegion(h,d),h.mesh["delete"](I),d=P.regionBelow(p),I=d.eUp):p.fixUpperEdge&&(P.deleteRegion(h,p),h.mesh["delete"](v),p=P.regionAbove(d),v=p.eUp)),v.Org!==I.Org)if(v.Dst!==I.Dst&&!p.fixUpperEdge&&!d.fixUpperEdge&&(v.Dst===h.event||I.Dst===h.event)){if(P.checkForIntersect(h,p))return;}else P.checkForRightSplice(h,p);v.Org===I.Org&&v.Dst===I.Dst&&(P.addWinding(I,v),P.deleteRegion(h,p),h.mesh["delete"](v),p=P.regionAbove(d));}},P.connectRightVertex=function(h,p,d){var v,I=d.Onext,L=P.regionBelow(p),w=p.eUp,B=L.eUp,E=!1;if(w.Dst!==B.Dst&&P.checkForIntersect(h,p),n.vertEq(w.Org,h.event)&&(h.mesh.splice(I.Oprev,w),p=P.topLeftRegion(h,p),I=P.regionBelow(p).eUp,P.finishLeftRegions(h,P.regionBelow(p),L),E=!0),n.vertEq(B.Org,h.event)&&(h.mesh.splice(d,B.Oprev),d=P.finishLeftRegions(h,L,null),E=!0),E){P.addRightEdges(h,p,d.Onext,I,I,!0);return;}n.vertLeq(B.Org,w.Org)?v=B.Oprev:v=w,v=h.mesh.connect(d.Lprev,v),P.addRightEdges(h,p,v,v.Onext,v.Onext,!1),v.Sym.activeRegion.fixUpperEdge=!0,P.walkDirtyRegions(h,p);},P.connectLeftDegenerate=function(h,p,d){var v,I,L,w,B;if(v=p.eUp,n.vertEq(v.Org,d)){s(!1/*TOLERANCE_NONZERO*/),P.spliceMergeVertices(h,v,d.anEdge);return;}if(!n.vertEq(v.Dst,d)){h.mesh.splitEdge(v.Sym),p.fixUpperEdge&&(h.mesh["delete"](v.Onext),p.fixUpperEdge=!1),h.mesh.splice(d.anEdge,v),P.sweepEvent(h,d);return;}s(!1/*TOLERANCE_NONZERO*/),p=P.topRightRegion(p),B=P.regionBelow(p),L=B.eUp.Sym,I=w=L.Onext,B.fixUpperEdge&&(s(I!==L),P.deleteRegion(h,B),h.mesh["delete"](L),L=I.Oprev),h.mesh.splice(d.anEdge,L),n.edgeGoesLeft(I)||(I=null),P.addRightEdges(h,p,L.Onext,w,I,!0);},P.connectLeftVertex=function(h,p){var d,v,I,L,w,B,E=new S();if(E.eUp=p.anEdge.Sym,d=h.dict.search(E).key,v=P.regionBelow(d),!!v){if(L=d.eUp,w=v.eUp,n.edgeSign(L.Dst,p,L.Org)===0){P.connectLeftDegenerate(h,d,p);return;}if(I=n.vertLeq(w.Dst,L.Dst)?d:v,d.inside||I.fixUpperEdge){if(I===d)B=h.mesh.connect(p.anEdge.Sym,L.Lnext);else{var b=h.mesh.connect(w.Dnext,p.anEdge);B=b.Sym;}I.fixUpperEdge?P.fixUpperEdge(h,I,B):P.computeWinding(h,P.addRegionBelow(h,d,B)),P.sweepEvent(h,p);}else P.addRightEdges(h,d,p.anEdge,p.anEdge,null,!0);}},P.sweepEvent=function(h,p){h.event=p,P.debugEvent(h);for(var d=p.anEdge;d.activeRegion===null;)if(d=d.Onext,d===p.anEdge){P.connectLeftVertex(h,p);return;}var v=P.topLeftRegion(h,d.activeRegion);s(v!==null);var I=P.regionBelow(v),L=I.eUp,w=P.finishLeftRegions(h,I,null);w.Onext===L?P.connectRightVertex(h,v,w):P.addRightEdges(h,v,w.Onext,L,L,!0);},P.addSentinel=function(h,p,d,v){var I=new S(),L=h.mesh.makeEdge();L.Org.s=d,L.Org.t=v,L.Dst.s=p,L.Dst.t=v,h.event=L.Dst,I.eUp=L,I.windingNumber=0,I.inside=!1,I.fixUpperEdge=!1,I.sentinel=!0,I.dirty=!1,I.nodeUp=h.dict.insert(I);},P.initEdgeDict=function(h){h.dict=new f(h,P.edgeLeq);var p=h.bmax[0]-h.bmin[0],d=h.bmax[1]-h.bmin[1],v=h.bmin[0]-p,I=h.bmax[0]+p,L=h.bmin[1]-d,w=h.bmax[1]+d;P.addSentinel(h,v,I,L),P.addSentinel(h,v,I,w);},P.doneEdgeDict=function(h){for(var p,d=0;(p=h.dict.min().key)!==null;)p.sentinel||(s(p.fixUpperEdge),s(++d===1)),s(p.windingNumber===0),P.deleteRegion(h,p);},P.removeDegenerateEdges=function(h){var p,d,v,I=h.mesh.eHead;for(p=I.next;p!==I;p=d)d=p.next,v=p.Lnext,n.vertEq(p.Org,p.Dst)&&p.Lnext.Lnext!==p&&(P.spliceMergeVertices(h,v,p),h.mesh["delete"](p),p=v,v=p.Lnext),v.Lnext===p&&(v!==p&&((v===d||v===d.Sym)&&(d=d.next),h.mesh["delete"](v)),(p===d||p===d.Sym)&&(d=d.next),h.mesh["delete"](p));},P.initPriorityQ=function(h){var p,d,v,I=0;for(v=h.mesh.vHead,d=v.next;d!==v;d=d.next)I++;for(I+=8,p=h.pq=new M(I,n.vertLeq),v=h.mesh.vHead,d=v.next;d!==v;d=d.next)d.pqHandle=p.insert(d);return d!==v?!1:(p.init(),!0);},P.donePriorityQ=function(h){h.pq=null;},P.removeDegenerateFaces=function(h,p){var d,v,I;for(d=p.fHead.next;d!==p.fHead;d=v)v=d.next,I=d.anEdge,s(I.Lnext!==I),I.Lnext.Lnext===I&&(P.addWinding(I.Onext,I),h.mesh["delete"](I));return!0;},P.computeInterior=function(h){var p,d;if(P.removeDegenerateEdges(h),!P.initPriorityQ(h))return!1;for(P.initEdgeDict(h);(p=h.pq.extractMin())!==null;){for(;d=h.pq.min(),!(d===null||!n.vertEq(d,p));)d=h.pq.extractMin(),P.spliceMergeVertices(h,p.anEdge,d.anEdge);P.sweepEvent(h,p);}return h.event=h.dict.min().key.eUp.Org,P.debugEvent(h),P.doneEdgeDict(h),P.donePriorityQ(h),P.removeDegenerateFaces(h,h.mesh)?(h.mesh.check(),!0):!1;};function C(){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;}C.prototype={dot_:function dot_(h,p){return h[0]*p[0]+h[1]*p[1]+h[2]*p[2];},normalize_:function normalize_(h){var p=h[0]*h[0]+h[1]*h[1]+h[2]*h[2];s(p>0),p=Math.sqrt(p),h[0]/=p,h[1]/=p,h[2]/=p;},longAxis_:function longAxis_(h){var p=0;return Math.abs(h[1])>Math.abs(h[0])&&(p=1),Math.abs(h[2])>Math.abs(h[p])&&(p=2),p;},computeNormal_:function computeNormal_(h){var p,d,v,I,L,w,B=[0,0,0],E=[0,0,0],b=[0,0,0],W=[0,0,0],D=[0,0,0],R=[null,null,null],Y=[null,null,null],V=this.mesh.vHead,Q;for(p=V.next,Q=0;Q<3;++Q)I=p.coords[Q],E[Q]=I,Y[Q]=p,B[Q]=I,R[Q]=p;for(p=V.next;p!==V;p=p.next)for(Q=0;Q<3;++Q)I=p.coords[Q],I<E[Q]&&(E[Q]=I,Y[Q]=p),I>B[Q]&&(B[Q]=I,R[Q]=p);if(Q=0,B[1]-E[1]>B[0]-E[0]&&(Q=1),B[2]-E[2]>B[Q]-E[Q]&&(Q=2),E[Q]>=B[Q]){h[0]=0,h[1]=0,h[2]=1;return;}for(w=0,d=Y[Q],v=R[Q],b[0]=d.coords[0]-v.coords[0],b[1]=d.coords[1]-v.coords[1],b[2]=d.coords[2]-v.coords[2],p=V.next;p!==V;p=p.next)W[0]=p.coords[0]-v.coords[0],W[1]=p.coords[1]-v.coords[1],W[2]=p.coords[2]-v.coords[2],D[0]=b[1]*W[2]-b[2]*W[1],D[1]=b[2]*W[0]-b[0]*W[2],D[2]=b[0]*W[1]-b[1]*W[0],L=D[0]*D[0]+D[1]*D[1]+D[2]*D[2],L>w&&(w=L,h[0]=D[0],h[1]=D[1],h[2]=D[2]);w<=0&&(h[0]=h[1]=h[2]=0,h[this.longAxis_(b)]=1);},checkOrientation_:function checkOrientation_(){var h,p,d=this.mesh.fHead,v,I=this.mesh.vHead,L;for(h=0,p=d.next;p!==d;p=p.next)if(L=p.anEdge,!(L.winding<=0))do h+=(L.Org.s-L.Dst.s)*(L.Org.t+L.Dst.t),L=L.Lnext;while(L!==p.anEdge);if(h<0){for(v=I.next;v!==I;v=v.next)v.t=-v.t;this.tUnit[0]=-this.tUnit[0],this.tUnit[1]=-this.tUnit[1],this.tUnit[2]=-this.tUnit[2];}},/* #ifdef FOR_TRITE_TEST_PROGRAM
|
|
164
|
+
#include <stdlib.h>
|
|
165
|
+
extern int RandomSweep;
|
|
166
|
+
#define S_UNIT_X (RandomSweep ? (2*drand48()-1) : 1.0)
|
|
167
|
+
#define S_UNIT_Y (RandomSweep ? (2*drand48()-1) : 0.0)
|
|
168
|
+
#else
|
|
169
|
+
#if defined(SLANTED_SWEEP) *//* The "feature merging" is not intended to be complete. There are
|
|
170
|
+
* special cases where edges are nearly parallel to the sweep line
|
|
171
|
+
* which are not implemented. The algorithm should still behave
|
|
172
|
+
* robustly (ie. produce a reasonable tesselation) in the presence
|
|
173
|
+
* of such edges, however it may miss features which could have been
|
|
174
|
+
* merged. We could minimize this effect by choosing the sweep line
|
|
175
|
+
* direction to be something unusual (ie. not parallel to one of the
|
|
176
|
+
* coordinate axes).
|
|
177
|
+
*//* #define S_UNIT_X (TESSreal)0.50941539564955385 // Pre-normalized
|
|
178
|
+
#define S_UNIT_Y (TESSreal)0.86052074622010633
|
|
179
|
+
#else
|
|
180
|
+
#define S_UNIT_X (TESSreal)1.0
|
|
181
|
+
#define S_UNIT_Y (TESSreal)0.0
|
|
182
|
+
#endif
|
|
183
|
+
#endif*//* Determine the polygon normal and project vertices onto the plane
|
|
184
|
+
* of the polygon.
|
|
185
|
+
*/projectPolygon_:function projectPolygon_(){var h,p=this.mesh.vHead,d=[0,0,0],v,I,L,w,B=!1;for(d[0]=this.normal[0],d[1]=this.normal[1],d[2]=this.normal[2],d[0]===0&&d[1]===0&&d[2]===0&&(this.computeNormal_(d),B=!0),v=this.sUnit,I=this.tUnit,L=this.longAxis_(d),v[L]=0,v[(L+1)%3]=1,v[(L+2)%3]=0,I[L]=0,I[(L+1)%3]=0,I[(L+2)%3]=d[L]>0?1:-1,h=p.next;h!==p;h=h.next)h.s=this.dot_(h.coords,v),h.t=this.dot_(h.coords,I);for(B&&this.checkOrientation_(),w=!0,h=p.next;h!==p;h=h.next)w?(this.bmin[0]=this.bmax[0]=h.s,this.bmin[1]=this.bmax[1]=h.t,w=!1):(h.s<this.bmin[0]&&(this.bmin[0]=h.s),h.s>this.bmax[0]&&(this.bmax[0]=h.s),h.t<this.bmin[1]&&(this.bmin[1]=h.t),h.t>this.bmax[1]&&(this.bmax[1]=h.t));},addWinding_:function addWinding_(h,p){h.winding+=p.winding,h.Sym.winding+=p.Sym.winding;},/* tessMeshTessellateMonoRegion( face ) tessellates a monotone region
|
|
186
|
+
* (what else would it do??) The region must consist of a single
|
|
187
|
+
* loop of half-edges (see mesh.h) oriented CCW. "Monotone" in this
|
|
188
|
+
* case means that any vertical line intersects the interior of the
|
|
189
|
+
* region in a single interval.
|
|
190
|
+
*
|
|
191
|
+
* Tessellation consists of adding interior edges (actually pairs of
|
|
192
|
+
* half-edges), to split the region into non-overlapping triangles.
|
|
193
|
+
*
|
|
194
|
+
* The basic idea is explained in Preparata and Shamos (which I don''t
|
|
195
|
+
* have handy right now), although their implementation is more
|
|
196
|
+
* complicated than this one. The are two edge chains, an upper chain
|
|
197
|
+
* and a lower chain. We process all vertices from both chains in order,
|
|
198
|
+
* from right to left.
|
|
199
|
+
*
|
|
200
|
+
* The algorithm ensures that the following invariant holds after each
|
|
201
|
+
* vertex is processed: the untessellated region consists of two
|
|
202
|
+
* chains, where one chain (say the upper) is a single edge, and
|
|
203
|
+
* the other chain is concave. The left vertex of the single edge
|
|
204
|
+
* is always to the left of all vertices in the concave chain.
|
|
205
|
+
*
|
|
206
|
+
* Each step consists of adding the rightmost unprocessed vertex to one
|
|
207
|
+
* of the two chains, and forming a fan of triangles from the rightmost
|
|
208
|
+
* of two chain endpoints. Determining whether we can add each triangle
|
|
209
|
+
* to the fan is a simple orientation test. By making the fan as large
|
|
210
|
+
* as possible, we restore the invariant (check it yourself).
|
|
211
|
+
*/// int tessMeshTessellateMonoRegion( TESSmesh *mesh, TESSface *face )
|
|
212
|
+
tessellateMonoRegion_:function tessellateMonoRegion_(h,p){var d,v;for(d=p.anEdge,s(d.Lnext!==d&&d.Lnext.Lnext!==d);n.vertLeq(d.Dst,d.Org);d=d.Lprev);for(;n.vertLeq(d.Org,d.Dst);d=d.Lnext);for(v=d.Lprev;d.Lnext!==v;)if(n.vertLeq(d.Dst,v.Org)){for(;v.Lnext!==d&&(n.edgeGoesLeft(v.Lnext)||n.edgeSign(v.Org,v.Dst,v.Lnext.Dst)<=0);){var I=h.connect(v.Lnext,v);v=I.Sym;}v=v.Lprev;}else{for(;v.Lnext!==d&&(n.edgeGoesRight(d.Lprev)||n.edgeSign(d.Dst,d.Org,d.Lprev.Org)>=0);){var I=h.connect(d,d.Lprev);d=I.Sym;}d=d.Lnext;}for(s(v.Lnext!==d);v.Lnext.Lnext!==d;){var I=h.connect(v.Lnext,v);v=I.Sym;}return!0;},/* tessMeshTessellateInterior( mesh ) tessellates each region of
|
|
213
|
+
* the mesh which is marked "inside" the polygon. Each such region
|
|
214
|
+
* must be monotone.
|
|
215
|
+
*///int tessMeshTessellateInterior( TESSmesh *mesh )
|
|
216
|
+
tessellateInterior_:function tessellateInterior_(h){var p,d;for(p=h.fHead.next;p!==h.fHead;p=d)if(d=p.next,p.inside&&!this.tessellateMonoRegion_(h,p))return!1;return!0;},/* tessMeshDiscardExterior( mesh ) zaps (ie. sets to NULL) all faces
|
|
217
|
+
* which are not marked "inside" the polygon. Since further mesh operations
|
|
218
|
+
* on NULL faces are not allowed, the main purpose is to clean up the
|
|
219
|
+
* mesh so that exterior loops are not represented in the data structure.
|
|
220
|
+
*///void tessMeshDiscardExterior( TESSmesh *mesh )
|
|
221
|
+
discardExterior_:function discardExterior_(h){var p,d;for(p=h.fHead.next;p!==h.fHead;p=d)d=p.next,p.inside||h.zapFace(p);},/* tessMeshSetWindingNumber( mesh, value, keepOnlyBoundary ) resets the
|
|
222
|
+
* winding numbers on all edges so that regions marked "inside" the
|
|
223
|
+
* polygon have a winding number of "value", and regions outside
|
|
224
|
+
* have a winding number of 0.
|
|
225
|
+
*
|
|
226
|
+
* If keepOnlyBoundary is TRUE, it also deletes all edges which do not
|
|
227
|
+
* separate an interior region from an exterior one.
|
|
228
|
+
*/// int tessMeshSetWindingNumber( TESSmesh *mesh, int value, int keepOnlyBoundary )
|
|
229
|
+
setWindingNumber_:function setWindingNumber_(h,p,d){var v,I;for(v=h.eHead.next;v!==h.eHead;v=I)I=v.next,v.Rface.inside!==v.Lface.inside?v.winding=v.Lface.inside?p:-p:d?h["delete"](v):v.winding=0;},getNeighbourFace_:function getNeighbourFace_(h){return!h.Rface||!h.Rface.inside?-1:h.Rface.n;},outputPolymesh_:function outputPolymesh_(h,p,d,v){var I,L,w,B=0,E=0,b,W;for(d>3&&h.mergeConvexFaces(d),I=h.vHead.next;I!==h.vHead;I=I.next)I.n=-1;for(L=h.fHead.next;L!==h.fHead;L=L.next)if(L.n=-1,!!L.inside){w=L.anEdge,b=0;do I=w.Org,I.n===-1&&(I.n=E,E++),b++,w=w.Lnext;while(w!==L.anEdge);s(b<=d),L.n=B,++B;}for(this.elementCount=B,p===r.CONNECTED_POLYGONS&&(B*=2),this.elements=[],this.elements.length=B*d,this.vertexCount=E,this.vertices=[],this.vertices.length=E*v,this.vertexIndices=[],this.vertexIndices.length=E,I=h.vHead.next;I!==h.vHead;I=I.next)if(I.n!==-1){var D=I.n*v;this.vertices[D+0]=I.coords[0],this.vertices[D+1]=I.coords[1],v>2&&(this.vertices[D+2]=I.coords[2]),this.vertexIndices[I.n]=I.idx;}var R=0;for(L=h.fHead.next;L!==h.fHead;L=L.next)if(L.inside){w=L.anEdge,b=0;do I=w.Org,this.elements[R++]=I.n,b++,w=w.Lnext;while(w!==L.anEdge);for(W=b;W<d;++W)this.elements[R++]=-1;if(p===r.CONNECTED_POLYGONS){w=L.anEdge;do this.elements[R++]=this.getNeighbourFace_(w),w=w.Lnext;while(w!==L.anEdge);for(W=b;W<d;++W)this.elements[R++]=-1;}}},// void OutputContours( TESStesselator *tess, TESSmesh *mesh, int vertexSize )
|
|
230
|
+
outputContours_:function outputContours_(h,p){var d,v,I,L=0,w=0;for(this.vertexCount=0,this.elementCount=0,d=h.fHead.next;d!==h.fHead;d=d.next)if(d.inside){I=v=d.anEdge;do this.vertexCount++,v=v.Lnext;while(v!==I);this.elementCount++;}this.elements=[],this.elements.length=this.elementCount*2,this.vertices=[],this.vertices.length=this.vertexCount*p,this.vertexIndices=[],this.vertexIndices.length=this.vertexCount;var B=0,E=0,b=0;for(L=0,d=h.fHead.next;d!==h.fHead;d=d.next)if(d.inside){w=0,I=v=d.anEdge;do this.vertices[B++]=v.Org.coords[0],this.vertices[B++]=v.Org.coords[1],p>2&&(this.vertices[B++]=v.Org.coords[2]),this.vertexIndices[E++]=v.Org.idx,w++,v=v.Lnext;while(v!==I);this.elements[b++]=L,this.elements[b++]=w,L+=w;}},addContour:function addContour(h,p){var d,v;for(this.mesh===null&&(this.mesh=new c()),h<2&&(h=2),h>3&&(h=3),d=null,v=0;v<p.length;v+=h)d===null?(d=this.mesh.makeEdge(),this.mesh.splice(d,d.Sym)):(this.mesh.splitEdge(d),d=d.Lnext),d.Org.coords[0]=p[v+0],d.Org.coords[1]=p[v+1],h>2?d.Org.coords[2]=p[v+2]:d.Org.coords[2]=0,d.Org.idx=this.vertexIndexCounter++,d.winding=1,d.Sym.winding=-1;},// int tessTesselate( TESStesselator *tess, int windingRule, int elementType, int polySize, int vertexSize, const TESSreal* normal )
|
|
231
|
+
tesselate:function tesselate(h,p,d,v,I){if(this.vertices=[],this.elements=[],this.vertexIndices=[],this.vertexIndexCounter=0,I&&(this.normal[0]=I[0],this.normal[1]=I[1],this.normal[2]=I[2]),this.windingRule=h,v<2&&(v=2),v>3&&(v=3),!this.mesh)return!1;this.projectPolygon_(),P.computeInterior(this);var L=this.mesh;return p===r.BOUNDARY_CONTOURS?this.setWindingNumber_(L,1,!0):this.tessellateInterior_(L),L.check(),p===r.BOUNDARY_CONTOURS?this.outputContours_(L,v):this.outputPolymesh_(L,p,d,v),!0;}};},/* 62 *//***/function(u,e){u.exports=r;var t=Object.prototype.hasOwnProperty;function r(){for(var n={},s=0;s<arguments.length;s++){var l=arguments[s];for(var o in l)t.call(l,o)&&(n[o]=l[o]);}return n;}},/* 63 *//***/function(u,e,t){t.r(e),t.d(e,"createShaders",function(){return a;}),t.d(e,"applyShader",function(){return c;}),t.d(e,"createCloudShaders",function(){return f;}),t.d(e,"applyCloudShader",function(){return g;});var r=t(64),n=t(65),s=t(66),l=t(67);t(1).glMatrix.setMatrixArrayType(Array);var o=Symbol("shaders");function a(x){x[o]=[];for(var M=0;M<16;M++){var S=[],P=!!(M&1),_C10=!!(M&2),_h10=!!(M&4),p=!!(M&8);P&&S.push("#define TEXTURE 1"),_C10&&S.push("#define FILTER 1"),_h10&&S.push("#define GRADIENT 1"),p&&S.push("#define CLIPPATH 1");var d="".concat(S.join("\n"),"\n"),v=[];P&&v.push("uniform sampler2D u_texSampler;"),p&&v.push("uniform sampler2D u_clipSampler;"),x[o][M]=[d+v.join("\n")+n["default"],d+r["default"]];}}function c(x){var _ref94=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref94$hasTexture=_ref94.hasTexture,M=_ref94$hasTexture===void 0?!1:_ref94$hasTexture,_ref94$hasFilter=_ref94.hasFilter,S=_ref94$hasFilter===void 0?!1:_ref94$hasFilter,_ref94$hasGradient=_ref94.hasGradient,P=_ref94$hasGradient===void 0?!1:_ref94$hasGradient,_ref94$hasClipPath=_ref94.hasClipPath,C=_ref94$hasClipPath===void 0?!1:_ref94$hasClipPath;var h=M|S<<1|P<<2|C<<3;var p=x[o][h];Array.isArray(p)&&(p=x.createProgram.apply(x,_toConsumableArray(p)),x[o][h]=p),x.program!==p&&x.useProgram(p,{a_color:{type:"UNSIGNED_BYTE",normalize:!0}});}var y=[];function f(x){for(var M=0;M<64;M++){var S=[],P=!!(M&1),_C11=!!(M&2),_h11=!!(M&4),p=!!(M&8),d=!!(M&16),v=!!(M&32);P&&S.push("#define TEXTURE 1"),_C11&&S.push("#define FILTER 1"),_h11&&S.push("#define GRADIENT 1"),p&&S.push("#define CLOUDCOLOR 1"),d&&S.push("#define CLOUDFILTER 1"),v&&S.push("#define CLIPPATH 1");var I="".concat(S.join("\n"),"\n"),L=[];if(P){L.push("uniform sampler2D u_texSampler;");for(var w=0;w<12;w++)L.push("uniform sampler2D u_texFrame".concat(w,";"));}v&&L.push("uniform sampler2D u_clipSampler;"),y[M]=[I+L.join("\n")+l["default"],I+s["default"]];}}function g(x){var _ref95=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref95$hasTexture=_ref95.hasTexture,M=_ref95$hasTexture===void 0?!1:_ref95$hasTexture,_ref95$hasFilter=_ref95.hasFilter,S=_ref95$hasFilter===void 0?!1:_ref95$hasFilter,_ref95$hasGradient=_ref95.hasGradient,P=_ref95$hasGradient===void 0?!1:_ref95$hasGradient,_ref95$hasCloudColor=_ref95.hasCloudColor,C=_ref95$hasCloudColor===void 0?!1:_ref95$hasCloudColor,_ref95$hasCloudFilter=_ref95.hasCloudFilter,h=_ref95$hasCloudFilter===void 0?!1:_ref95$hasCloudFilter,_ref95$hasClipPath=_ref95.hasClipPath,p=_ref95$hasClipPath===void 0?!1:_ref95$hasClipPath;var d=M|S<<1|P<<2|C<<3|h<<4|p<<5;var v=y[d];Array.isArray(v)&&(v=x.createProgram.apply(x,_toConsumableArray(v)),y[d]=v),x.program!==v&&x.useProgram(v,{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(u,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(u,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(u,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(u,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(u,e,t){t.r(e),function(r,n){t.d(e,"requestAnimationFrame",function(){return l;}),t.d(e,"cancelAnimationFrame",function(){return o;}),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),a=_r$hrtime2[0],c=_r$hrtime2[1];return a*1e3+c*1e-6;}return Date.now?Date.now():(/* @__PURE__ */new Date()).getTime();}var l,o;_typeof(n)<"u"&&typeof n.requestAnimationFrame=="function"?(l=n.requestAnimationFrame,o=n.cancelAnimationFrame):(l=function l(a){return setTimeout(function(){a(s());},16);},o=function o(a){return clearTimeout(a);});}.call(this,t(69),t(22));},/* 69 *//***/function(u,e){var t=u.exports={},r,n;function s(){throw new Error("setTimeout has not been defined");}function l(){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=l;}catch(_unused5){n=l;}})();function o(C){if(r===setTimeout)return setTimeout(C,0);if((r===s||!r)&&setTimeout)return r=setTimeout,setTimeout(C,0);try{return r(C,0);}catch(_unused6){try{return r.call(null,C,0);}catch(_unused7){return r.call(this,C,0);}}}function a(C){if(n===clearTimeout)return clearTimeout(C);if((n===l||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(C);try{return n(C);}catch(_unused8){try{return n.call(null,C);}catch(_unused9){return n.call(this,C);}}}var c=[],y=!1,f,g=-1;function x(){!y||!f||(y=!1,f.length?c=f.concat(c):g=-1,c.length&&M());}function M(){if(!y){var C=o(x);y=!0;for(var h=c.length;h;){for(f=c,c=[];++g<h;)f&&f[g].run();g=-1,h=c.length;}f=null,y=!1,a(C);}}t.nextTick=function(C){var h=new Array(arguments.length-1);if(arguments.length>1)for(var p=1;p<arguments.length;p++)h[p-1]=arguments[p];c.push(new S(C,h)),c.length===1&&!y&&o(M);};function S(C,h){this.fun=C,this.array=h;}S.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(C){return[];},t.binding=function(C){throw new Error("process.binding is not supported");},t.cwd=function(){return"/";},t.chdir=function(C){throw new Error("process.chdir is not supported");},t.umask=function(){return 0;};},/* 70 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return w;});var r=t(1),n=t(71),s=t(73),l=t(213),o=t(214),a=t(215),c=t(216);t(1).glMatrix.setMatrixArrayType(Array);function y(B,E){var b=Object.keys(B);if(Object.getOwnPropertySymbols){var W=Object.getOwnPropertySymbols(B);E&&(W=W.filter(function(D){return Object.getOwnPropertyDescriptor(B,D).enumerable;})),b.push.apply(b,W);}return b;}function f(B){for(var E=1;E<arguments.length;E++){var b=arguments[E]!=null?arguments[E]:{};E%2?y(Object(b),!0).forEach(function(W){g(B,W,b[W]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(B,Object.getOwnPropertyDescriptors(b)):y(Object(b)).forEach(function(W){Object.defineProperty(B,W,Object.getOwnPropertyDescriptor(b,W));});}return B;}function g(B,E,b){return E in B?Object.defineProperty(B,E,{value:b,enumerable:!0,configurable:!0,writable:!0}):B[E]=b,B;}var x=Symbol["for"]("spritejs_changedAttrs"),M=Symbol["for"]("spritejs_attributes"),S=Symbol("resolution"),P=Symbol("animations"),C=Symbol("eventListeners"),h=Symbol("captureEventListeners"),p=Symbol("filters"),d=Symbol("display"),v=Symbol("program"),I=Symbol("shaderAttrs"),L=Symbol("uniforms");var w=/*#__PURE__*/function(){function w(){var E=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,w);this.attributes=new this.constructor.Attr(this),this[S]={width:300,height:150},Object.assign(this.attributes,E),this[P]=/* @__PURE__ */new Set(),this[C]={},this[h]={};}return _createClass(w,[{key:"ancestors",get:function get(){var E=this.parent;var b=[];for(;E;)b.push(E),E=E.parent;return b;}},{key:"animations",get:function get(){return this[P];}},{key:"filters",get:function get(){return this[p]||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 E=this.transformMatrix,_this$attributes=this.attributes,b=_this$attributes.x,W=_this$attributes.y;return E[4]+=b,E[5]+=W,E;}},{key:"opacity",get:function get(){var E=this.attributes.opacity;return this.parent&&this.parent.opacity!=null&&(E*=this.parent.opacity),E;}},{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[v];}/* 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 E=this.localMatrix;var b=this.parent;if(b){var W=b.__cacheRenderMatrix||b.renderMatrix;W&&(E=r.mat2d.multiply(Array.of(0,0,0,0,0,0),W,E));}return E;}},{key:"worldScaling",get:function get(){var E=this.renderMatrix;return[Math.hypot(E[0],E[1]),Math.hypot(E[2],E[3])];}},{key:"worldRotation",get:function get(){var E=this.renderMatrix;return Math.atan2(E[1],E[3]);}},{key:"worldPosition",get:function get(){var E=this.renderMatrix;return[E[4],E[5]];}},{key:"uniforms",get:function get(){return this[L];}/* get zOrder defined by connect method *//* attributes */},{key:"className",get:function get(){return this.attributes.className;},set:function set(E){this.attributes.className=E;}},{key:"id",get:function get(){return this.attributes.id;},set:function set(E){this.attributes.id=E;}},{key:"name",get:function get(){return this.attributes.name;},set:function set(E){this.attributes.name=E;}},{key:"zIndex",get:function get(){return this.attributes.zIndex;},set:function set(E){this.attributes.zIndex=E;}},{key:"mesh",get:function get(){return null;}},{key:"shaderAttrs",get:function get(){return this[I]||{};}},{key:"activateAnimations",value:function activateAnimations(){var E=this.layer;if(E){var b=this[P];b.forEach(function(D){D.baseTimeline=E.timeline,D.play(),D.finished.then(function(){b["delete"](D);});});var W=this.children;W&&W.forEach(function(D){D.activateAnimations&&D.activateAnimations();});}}},{key:"addEventListener",value:function addEventListener(E,b){var W=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};E==="mousewheel"&&(E="wheel"),typeof W=="boolean"&&(W={capture:W});var _W8=W,D=_W8.capture,R=_W8.once,Y=D?h:C;return this[Y][E]=this[Y][E]||[],this[Y][E].push({listener:b,once:R}),this;}},{key:"animate",value:function animate(E,b){var _this21=this;var W=new s["default"](this,E,b);return this.effects&&W.applyEffects(this.effects),this.layer&&(W.baseTimeline=this.layer.timeline,W.play(),W.finished.then(function(){_this21[P]["delete"](W);})),this[P].add(W),W;}},{key:"attr",value:function attr(){for(var _len7=arguments.length,E=new Array(_len7),_key7=0;_key7<_len7;_key7++){E[_key7]=arguments[_key7];}if(E.length===0)return this.attributes[M];if(E.length>1){var b=E[0],W=E[1];return typeof W=="function"&&(W=W(this.attr(b))),this.setAttribute(b,W),this;}return typeof E[0]=="string"?this.getAttribute(E[0]):(Object.assign(this.attributes,E[0]),this);}},{key:"cloneNode",value:function cloneNode(){var E=new this.constructor(),b=this.attributes[x];return E.attr(b),E;}},{key:"connect",value:function connect(E,b){Object.defineProperty(this,"parent",{value:E,writable:!1,configurable:!0}),Object.defineProperty(this,"zOrder",{value:b,writable:!1,configurable:!0}),E.timeline&&this.activateAnimations(),this.setResolution(E.getResolution()),this.forceUpdate(),this.dispatchEvent({type:"append",detail:{parent:E,zOrder:b}});}},{key:"contains",value:function contains(E){for(;E&&this!==E;)E=E.parent;return!!E;}},{key:"deactivateAnimations",value:function deactivateAnimations(){this[P].forEach(function(b){return b.cancel();});var E=this.children;E&&E.forEach(function(b){b.deactivateAnimations&&b.deactivateAnimations();});}},{key:"disconnect",value:function disconnect(){var E=this.parent,b=this.zOrder;delete this.parent,delete this.zOrder,this.deactivateAnimations(),this.dispatchEvent({type:"remove",detail:{parent:E,zOrder:b}}),E&&E.forceUpdate();}},{key:"dispatchEvent",value:function dispatchEvent(E){var _this22=this;E instanceof o["default"]||(E=new o["default"](E)),E.target=this;var b=E.type;b==="mousewheel"&&(b="wheel");var W=[this];var D=this.parent;for(;E.bubbles&&D;)W.push(D),D=D.parent;for(var R=W.length-1;R>=0;R--){var Y=W[R],V=Y[h]&&Y[h][b];if(V&&V.length&&(E.currentTarget=Y,V.forEach(function(_ref96){var Q=_ref96.listener,et=_ref96.once;Q.call(_this22,E),et&&W.removeEventListener(Q);}),delete E.currentTarget),!E.bubbles&&E.cancelBubble)break;}if(!E.cancelBubble)for(var _R4=0;_R4<W.length;_R4++){var _Y=W[_R4],_V3=_Y[C]&&_Y[C][b];if(_V3&&_V3.length&&(E.currentTarget=_Y,_V3.forEach(function(_ref97){var Q=_ref97.listener,et=_ref97.once;Q.call(_this22,E),et&&W.removeEventListener(Q);}),delete E.currentTarget),!E.bubbles||E.cancelBubble)break;}}},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(E){var b=E.layerX,W=E.layerY;return this.isPointCollision(b,W)?(this.dispatchEvent(E),!0):!1;}},{key:"draw",value:function draw(){var _this23=this;var E=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var b=this.mesh;if(b){if(Object(a.applyFilters)(b,this.filters),E.push(b),this[v]){b.setProgram(this[v]);var W=this[I];W&&Object.entries(W).forEach(function(_ref98){var _ref99=_slicedToArray(_ref98,2),R=_ref99[0],Y=_ref99[1];b.setAttribute(R,Y);});var D=this[L];if(this[L]){var R={};Object.entries(D).forEach(function(_ref100){var _ref101=_slicedToArray(_ref100,2),Y=_ref101[0],V=_ref101[1];typeof V=="function"&&(V=V(_this23,Y)),R[Y]=V;}),b.setUniforms(R);}}Object(c["default"])(this,b);}return E;}},{key:"forceUpdate",value:function forceUpdate(){this.parent&&this.parent.forceUpdate();}},{key:"getAttribute",value:function getAttribute(E){return this.attributes[E];}},{key:"getListeners",value:function getListeners(E){var _ref102=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref102$capture=_ref102.capture,b=_ref102$capture===void 0?!1:_ref102$capture;return _toConsumableArray(this[b?h:C][E]||[]);}},{key:"getNodeNearBy",value:function getNodeNearBy(){var E=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;if(!this.parent)return null;if(E===0)return this;var b=this.parent.children,W=b.indexOf(this);return b[W+E];}},{key:"getWorldPosition",value:function getWorldPosition(E,b){var W=this.renderMatrix,D=E*W[0]+b*W[2]+W[4],R=E*W[1]+b*W[3]+W[5];return[D,R];}},{key:"getOffsetPosition",value:function getOffsetPosition(E,b){var W=r.mat2d.invert(Array.of(0,0,0,0,0,0),this.renderMatrix),D=E*W[0]+b*W[2]+W[4],R=E*W[1]+b*W[3]+W[5];return[D,R];}},{key:"getResolution",value:function getResolution(){return f({},this[S]);}},{key:"isPointCollision",value:function isPointCollision(E,b){if(!this.mesh)return!1;var W=this.attributes.pointerEvents;if(W==="none"||W!=="all"&&!this.isVisible)return!1;var D="both";return W==="visibleFill"&&(D="fill"),W==="visibleStroke"&&(D="stroke"),this.mesh.isPointCollision(E,b,D);}},{key:"onPropertyChange",value:function onPropertyChange(E,b,W){E!=="id"&&E!=="name"&&E!=="className"&&E!=="pointerEvents"&&E!=="passEvents"&&this.forceUpdate(),E==="filter"&&(this[p]=Object(a.parseFilterString)(b)),E==="zIndex"&&this.parent&&this.parent.reorder();}},{key:"setAttribute",value:function setAttribute(E,b){E==="attrs"&&this.attr(b),this.attributes[E]=b;}},{key:"setMouseCapture",value:function setMouseCapture(){this.layer&&(this.layer.__mouseCapturedTarget=this);}// layer.renderer.createProgram(fragmentShader, vertexShader, attributeOptions)
|
|
232
|
+
},{key:"setProgram",value:function setProgram(E){this[v]=E,this.forceUpdate();}},{key:"setShaderAttribute",value:function setShaderAttribute(E,b){this[I]=this[I]||{},this[I][E]=b,this.forceUpdate();}},{key:"setUniforms",value:function setUniforms(E){this[L]=this[L]||{},Object.assign(this[L],E),this.forceUpdate();}},{key:"setResolution",value:function setResolution(_ref103){var E=_ref103.width,b=_ref103.height;var _this$S3=this[S],W=_this$S3.width,D=_this$S3.height;(W!==E||D!==b)&&(this[S]={width:E,height:b},this.forceUpdate(),this.dispatchEvent({type:"resolutionchange",detail:{width:E,height:b}}));}},{key:"show",value:function show(){this.attributes.display==="none"&&(this.attributes.display=this[d]||"");}},{key:"hide",value:function hide(){this.attributes.display!=="none"&&(this[d]=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(E){var b=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};typeof b=="boolean"&&(b={capture:b});var D=b.capture?h:C;return this[D][E]&&(this[D][E]=[]),this;}},{key:"removeAttribute",value:function removeAttribute(E){this.setAttribute(E,null);}},{key:"removeEventListener",value:function removeEventListener(E,b){var W=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};typeof W=="boolean"&&(W={capture:W});var R=W.capture?h:C;if(this[R][E]){var Y=this[R][E];if(Y)for(var V=0;V<Y.length;V++){var Q=Y[V].listener;if(Q===b){this[R][E].splice(V,1);break;}}}return this;}},{key:"transition",value:function transition(E){var b=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"linear";var W=this,D=Symbol("animation");b=b||"linear";var R=0;return _typeof(E)=="object"&&(R=E.delay||0,E=E.duration),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},D,null),"cancel",function cancel(){var Y=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;var V=this[D];V&&V.cancel(Y);}),"end",function end(){var Y=this[D];Y&&(Y.playState==="running"||Y.playState==="pending")&&Y.finish();}),"reverse",function reverse(){var Y=this[D];if(Y)if(Y.playState==="running"||Y.playState==="pending")Y.playbackRate=-Y.playbackRate;else{var V=Y.timing.direction;Y.timing.direction=V==="reverse"?"normal":"reverse",Y.play();}return Y.finished;}),"attr",function attr(Y,V){return this.end(),typeof Y=="string"&&(Y=_defineProperty({},Y,V)),Object.entries(Y).forEach(function(_ref104){var _ref105=_slicedToArray(_ref104,2),Q=_ref105[0],et=_ref105[1];typeof et=="function"&&(Y[Q]=et(W.attr(Q)));}),this[D]=W.animate([Y],{duration:E*1e3,delay:R*1e3,fill:"forwards",easing:b}),this[D].finished;});}},{key:"updateContours",value:function updateContours(){}}]);}();g(w,"Attr",n["default"]),l["default"].registerNode(w,"node");},/* 71 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return w;});var r=t(1),n=t(12),s=t(72);t(1).glMatrix.setMatrixArrayType(Array);var l=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_declareAlias"),a=Symbol["for"]("spritejs_setAttribute"),c=Symbol["for"]("spritejs_getAttribute"),y=Symbol["for"]("spritejs_attributes"),f=Symbol["for"]("spritejs_changedAttrs"),g=Symbol("subject"),x=Symbol("attr"),M=Symbol("default"),S=Symbol("alias");function P(B,_ref107){var _ref108=_slicedToArray(_ref107,2),E=_ref108[0],b=_ref108[1];var W=r.mat2d.fromValues(1,0,0,1,0,0);return _toConsumableArray(B).forEach(function(_ref109){var _ref110=_slicedToArray(_ref109,2),D=_ref110[0],R=_ref110[1];if((E||b)&&(W=r.mat2d.translate(Array.of(0,0,0,0,0,0),W,[E,b])),D==="matrix")W=r.mat2d.multiply(W,W,R);else if(D==="offsetTranslate")W[4]+=R[0],W[5]+=R[1];else if(D==="offsetRotate")W=r.mat2d.rotate(Array.of(0,0,0,0,0,0),W,R);else if(D==="skew"){var _R5=_slicedToArray(R,2),Y=_R5[0],V=_R5[1];W=r.mat2d.multiply(W,W,r.mat2d.fromValues(1,Math.tan(V),Math.tan(Y),1,0,0));}else r.mat2d[D](W,W,R);(E||b)&&(W=r.mat2d.translate(Array.of(0,0,0,0,0,0),W,[-E,-b]));}),W;}var C=Symbol("transformMatrix"),h=Symbol("transforms"),p=Symbol("changedAttrs"),d=Symbol("lastChangedAttr"),v=Symbol("offsetFigure");function I(B,E,b){var W=B[x][E];if(B[a](E,b,!1)||B[d]!==E){var R=B[h];R.has(E)&&R["delete"](E),b&&(E==="rotate"&&(b=Math.PI*b/180),E==="scale"&&(b=b.map(function(Y){return Math.abs(Y)>1e-5?Y:1/Y>0?1e-5:-1e-5;})),R.set(E,b)),B[C]=null,B[g].onPropertyChange(E,b,W,B);}}function L(B){var E=B[v],b=B.offsetDistance*E.getTotalLength(),W=E.getPointAtLength(b);if(W){var D=B[h];var R=B.offsetRotate;R==="auto"?R=W.angle:R==="reverse"?R=Math.PI+W.angle:R=Math.PI*R/180,D.set("offsetRotate",R),D.set("offsetTranslate",[W.x,W.y]),B[C]=null;}}var w=/*#__PURE__*/function(){function w(E){var _this24=this;_classCallCheck(this,w);this[g]=E,this[x]={},this[C]=r.mat2d.fromValues(1,0,0,1,0,0),this[h]=/* @__PURE__ */new Map(),this[M]={},this[S]=[],Object.defineProperty(E,"transformMatrix",{get:function get(){return _this24[C]||(_this24[C]=P(_this24[h],_this24.transformOrigin)),_toConsumableArray(_this24[C]);}}),this[l]({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
|
|
233
|
+
filter:"none",display:""}),this[o]("class","pos"),this[p]=/* @__PURE__ */new Set(),this[v]=new n.Figure2D({scale:5,simplify:0});}return _createClass(w,[{key:f,get:function get(){var _this25=this;var E={};return _toConsumableArray(this[p]).forEach(function(b){E[b]=_this25[x][b];}),E;}},{key:y,get:function get(){var E=Object.assign({},this[x]);for(var b=0;b<this[S].length;b++){var W=this[S][b];E[W]=this[W];}return E;}},{key:l,value:function value(E){Object.assign(this[M],E),Object.assign(this[x],E);}},{key:o,value:function value(){var _this$S4;(_this$S4=this[S]).push.apply(_this$S4,arguments);}},{key:a,value:function value(E,b){var W=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var D=this[x][E],R=this[g];return b==null&&(b=this[M][E]),Object(s.compareValue)(D,b)?!1:(this[x][E]=b,this[p].has(E)&&this[p]["delete"](E),this[p].add(E),this[d]=E,W&&R.onPropertyChange(E,b,D,this),!0);}},{key:c,value:function value(E){return this[x][E];}},{key:"id",get:function get(){return this[c]("id");},set:function set(E){this[a]("id",E);}},{key:"name",get:function get(){return this[c]("name");},set:function set(E){this[a]("name",E);}},{key:"className",get:function get(){return this[c]("className");},set:function set(E){this[a]("className",E);}},{key:"class",get:function get(){return this.className;},set:function set(E){this.className=E;}},{key:"x",get:function get(){return this[c]("x");},set:function set(E){this[a]("x",Object(s.toNumber)(E));}},{key:"y",get:function get(){return this[c]("y");},set:function set(E){this[a]("y",Object(s.toNumber)(E));}},{key:"pos",get:function get(){return[this.x,this.y];},set:function set(E){E=Object(s.toArray)(E),Array.isArray(E)||(E=[E,E]),this.x=E[0],this.y=E[1];}},{key:"transform",get:function get(){return this[c]("transform");},set:function set(E){var b=null;if(Array.isArray(E)&&(b=E,E="matrix(".concat(E.map(s.toNumber).join(),")")),typeof E=="string")E=E.replace(/\s*,\s*/g,",");else if(E!=null)throw new TypeError("Invalid transform value.");var W=this[x].transform;if(this[a]("transform",E,!1)){var D=this[h];if(D.has("matrix")&&D["delete"]("matrix"),b)D.set("matrix",b);else if(E){var R=E.match(/(matrix|translate|rotate|scale|skew)\([^()]+\)/g);if(R){var Y=r.mat2d.fromValues(1,0,0,1,0,0);for(var V=0;V<R.length;V++){var et=R[V].match(/^(matrix|translate|rotate|scale|skew)\(([^()]+)\)/);if(et){var _et2=_slicedToArray(et,3),it=_et2[1],$=_et2[2];it==="rotate"?$=Math.PI*parseFloat($)/180:$=$.trim().split(/[\s,]+/).map(function(K){return Object(s.toNumber)(K);}),it==="matrix"?Y=r.mat2d.multiply(Y,Y,$):it==="skew"?Y=r.mat2d.multiply(Y,Y,r.mat2d.fromValues(1,Math.tan($[1]),Math.tan($[0]),1,0,0)):r.mat2d[it](Y,Y,$),D.set("matrix",Y);}}}else throw new TypeError("Invalid transform value.");}this[C]=null,this[g].onPropertyChange("transform",E,W,this);}}},{key:"transformOrigin",get:function get(){return this[c]("transformOrigin");},set:function set(E){E=Object(s.toArray)(E,!0),E!=null&&!Array.isArray(E)&&(E=[E,E]),this[a]("transformOrigin",E)&&(this[C]=null);}},{key:"rotate",get:function get(){return this[c]("rotate");},set:function set(E){I(this,"rotate",E);}},{key:"translate",get:function get(){return this[c]("translate");},set:function set(E){E=Object(s.toArray)(E,!0),E!=null&&!Array.isArray(E)&&(E=[E,E]),I(this,"translate",E);}},{key:"scale",get:function get(){return this[c]("scale");},set:function set(E){E=Object(s.toArray)(E,!0),E!=null&&!Array.isArray(E)&&(E=[E,E]),I(this,"scale",E);}},{key:"skew",get:function get(){return this[c]("skew");},set:function set(E){E=Object(s.toArray)(E,!0),E!=null&&!Array.isArray(E)&&(E=[E,E]),I(this,"skew",E);}},{key:"opacity",get:function get(){return this[c]("opacity");},set:function set(E){E!=null&&(E=Number(E)),this[a]("opacity",E);}},{key:"zIndex",get:function get(){return this[c]("zIndex");},set:function set(E){E!=null&&(E=Number(E)),this[a]("zIndex",E);}},{key:"offsetPath",get:function get(){return this[c]("offsetPath");},set:function set(E){this[a]("offsetPath",E)&&(this[v].beginPath(),E!=null&&this[v].addPath(E),L(this));}},{key:"offsetDistance",get:function get(){return this[c]("offsetDistance");},set:function set(E){this[a]("offsetDistance",Object(s.toNumber)(E))&&L(this);}},{key:"offsetRotate",get:function get(){return this[c]("offsetRotate");},set:function set(E){this[a]("offsetRotate",E),L(this);}},{key:"pointerEvents",get:function get(){return this[c]("pointerEvents");},set:function set(E){if(E!=null&&E!=="none"&&E!=="visible"&&E!=="visibleFill"&&E!=="visibleStroke"&&E!=="all")throw new TypeError("Invalid pointerEvents type.");this[a]("pointerEvents",E);}},{key:"filter",get:function get(){return this[c]("filter");},set:function set(E){this[a]("filter",E);}},{key:"display",get:function get(){return this[c]("display");},set:function set(E){this[a]("display",E);}/* istanbul ignore next */},{key:"offset",set:function set(E){}}],[{key:"setDefault",value:function setDefault(E){for(var _len8=arguments.length,b=new Array(_len8>1?_len8-1:0),_key8=1;_key8<_len8;_key8++){b[_key8-1]=arguments[_key8];}return E[l].apply(E,b);}},{key:"declareAlias",value:function declareAlias(E){for(var _len9=arguments.length,b=new Array(_len9>1?_len9-1:0),_key9=1;_key9<_len9;_key9++){b[_key9-1]=arguments[_key9];}return E[o].apply(E,b);}},{key:"setAttribute",value:function setAttribute(E){for(var _len10=arguments.length,b=new Array(_len10>1?_len10-1:0),_key10=1;_key10<_len10;_key10++){b[_key10-1]=arguments[_key10];}return E[a].apply(E,b);}},{key:"getAttribute",value:function getAttribute(E){for(var _len11=arguments.length,b=new Array(_len11>1?_len11-1:0),_key11=1;_key11<_len11;_key11++){b[_key11-1]=arguments[_key11];}return E[c].apply(E,b);}},{key:"getAttributes",value:function getAttributes(E){return E[y];}},{key:"getChangedAttributes",value:function getChangedAttributes(E){return E[f];}}]);}();},/* 72 *//***/function(u,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 l;}),t.d(e,"compareValue",function(){return o;}),t(1).glMatrix.setMatrixArrayType(Array);function r(a,c){var y=a.trim().match(/^([\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin)$/);y?a={size:parseFloat(y[1]),unit:y[2]}:a={size:parseFloat(a),unit:"px"};var _a3=a,f=_a3.size,g=_a3.unit;if(g==="pt")f/=0.75;else if(g==="pc")f*=16;else if(g==="in")f*=96;else if(g==="cm")f*=96/2.54;else if(g==="mm")f*=96/25.4;else if(g==="em"||g==="rem"||g==="ex"){if(!c&&typeof getComputedStyle=="function"&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var x=getComputedStyle(document.documentElement).fontSize;x?c=r(x,16):c=16;}f*=c,g==="ex"&&(f/=2);}else if(g==="q")f*=96/25.4/4;else if(g==="vw"||g==="vh"){if((typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _x20=g==="vw"?window.innerWidth||document.documentElement.clientWidth:window.innerHeight||document.documentElement.clientHeight;f*=_x20/100;}}else if((g==="vmax"||g==="vmin")&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _x21=window.innerWidth||document.documentElement.clientWidth,M=window.innerHeight||document.documentElement.clientHeight;g==="vmax"?f*=Math.max(_x21,M)/100:f*=Math.min(_x21,M)/100;}return f;}function n(a){return a==null?a:String(a);}function s(a){if(a==null)return a;if(typeof a=="string"&&(a=r(a)),!Number.isFinite(a))throw new TypeError("Invalid value");return a;}function l(a){var c=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;return a===""?null:(typeof a=="string"&&(a=a.split(/[\s,]+/g)),Array.isArray(a)&&(c&&(a=a.map(s)),a.length===1)?a[0]:a);}function o(a,c){if(Array.isArray(a)&&Array.isArray(c)){if(a.length!==c.length)return!1;for(var y=0;y<a.length;y++)if(a[y]!==c[y])return!1;return!0;}return a==null&&c==null||a===c;}},/* 73 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return g;});var r=t(74),n=t(32),s=/* @__PURE__ */t.n(n),l=t(68),o=t(72);t(1).glMatrix.setMatrixArrayType(Array);function a(){return a=Object.assign||function(x){for(var M=1;M<arguments.length;M++){var S=arguments[M];for(var P in S)Object.prototype.hasOwnProperty.call(S,P)&&(x[P]=S[P]);}return x;},a.apply(this,arguments);}function c(x){if(typeof x=="string"){if(x=x.trim(),/^[0-9.]+%$/.test(x))return parseFloat(x)/100;if(/^([\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin)$/.test(x))return Object(o.sizeToPixel)(x);}return x;}function y(x,M,S,P,C){return typeof x=="string"&&(x=s()(x)),typeof M=="string"&&(M=s()(M)),r.Effects["default"](x,M,S,P,C);}function f(x,M,S,P,C){return r.Effects["default"](x,M,S,P,C);}r.Effects["default"]=function(x,M,S,P,C){return Array.isArray(x)&&Array.isArray(M)?x.map(function(h,p){return h+(S-P)/(C-P)*(M[p]-h);}):typeof x=="number"&&typeof M=="number"?x+(S-P)/(C-P)*(M-x):S-P>C-S?M:x;},r.Effects.fillColor=y,r.Effects.strokeColor=y,r.Effects.bgcolor=y,r.Effects.borderColor=y,r.Effects.text=f;var g=/*#__PURE__*/function(_r$Animator){function g(M,S,P){var _this26;_classCallCheck(this,g);var C=M.attr();Object.entries(C).forEach(function(_ref111){var _ref112=_slicedToArray(_ref111,2),h=_ref112[0],p=_ref112[1];C[h]=r.Effects[h]?p:c(p);}),S=S.map(function(h){var p=a({},h);var d={};return Object.entries(p).forEach(function(_ref113){var _ref114=_slicedToArray(_ref113,2),v=_ref114[0],I=_ref114[1];d[v]=r.Effects[v]?I:c(I);}),d;}),_this26=_callSuper(this,g,[C,S,P]),_this26.target=M,_this26.setter=function(h,p){p.attr(h);};return _this26;}_inherits(g,_r$Animator);return _createClass(g,[{key:"playState",get:function get(){return this.target.parent?_superPropGet(g,"playState",this,1):"idle";}},{key:"finished",get:function get(){var _this27=this;return _superPropGet(g,"finished",this,1).then(function(){var M=_this27;return new Promise(function(S){function P(){M.setter(M.frame,M.target);var C=M.playState;C==="finished"||C==="idle"?(Object(l.cancelAnimationFrame)(M.requestId),S()):Object(l.requestAnimationFrame)(P);}P();});});}},{key:"finish",value:function finish(){_superPropGet(g,"finish",this,3)([]),Object(l.cancelAnimationFrame)(this.requestId),this.setter(this.frame,this.target);}},{key:"play",value:function play(){if(!this.target.parent||this.playState==="running")return;_superPropGet(g,"play",this,3)([]),this.setter(this.frame,this.target);var M=this;this.ready.then(function(){M.setter(M.frame,M.target),M.requestId=Object(l.requestAnimationFrame)(function S(){var P=M.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)){M.cancel();return;}var C=M.playState;M.setter(M.frame,M.target),C!=="idle"&&(C==="running"?M.requestId=Object(l.requestAnimationFrame)(S):(C==="paused"||C==="pending"&&M.timeline.currentTime<0)&&M.ready.then(function(){M.setter(M.frame,M.target),M.requestId=Object(l.requestAnimationFrame)(S);}));});});}},{key:"cancel",value:function cancel(){var M=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;Object(l.cancelAnimationFrame)(this.requestId),M?(this.setter(this.frame,this.target),_superPropGet(g,"cancel",this,3)([])):(_superPropGet(g,"cancel",this,3)([]),this.setter(this.frame,this.target));}}]);}(r.Animator);},/* 74 *//***/function(u,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.Timeline=e.Effects=e.Easings=e.Animator=void 0;var r=t(75),n=y(r),s=t(187),l=y(s),o=t(188),a=t(190),c=y(a);function y(f){return f&&f.__esModule?f:{"default":f};}e.Animator=c["default"],e.Easings=o.Easings,e.Effects=l["default"],e.Timeline=n["default"];},/* 75 *//***/function(u,e,t){Object.defineProperty(e,"__esModule",{value:!0});var r=t(76),n=h(r),s=t(133),l=h(s),o=t(141),a=h(o),c=t(164),y=h(c),f=t(170),g=h(f),x=t(171),M=h(x),S=t(175),P=h(S),C=t(186);function h(W){return W&&W.__esModule?W:{"default":W};}var p=(0,C.createNowTime)(),d={originTime:0,playbackRate:1},v=(0,P["default"])("timeMark"),I=(0,P["default"])("playbackRate"),L=(0,P["default"])("timers"),w=(0,P["default"])("originTime"),B=(0,P["default"])("setTimer"),E=(0,P["default"])("parent"),b=function(){function W(D,R){(0,g["default"])(this,W),D instanceof W&&(R=D,D={}),D=(0,y["default"])({},d,D),R&&(this[E]=R);var Y=D.nowtime||p;if(R)Object.defineProperty(this,"globalTime",{get:function get(){return R.currentTime;}});else{var V=Y();Object.defineProperty(this,"globalTime",{get:function get(){return Y()-V;}});}this[v]=[{globalTime:this.globalTime,localTime:-D.originTime,entropy:-D.originTime,playbackRate:D.playbackRate,globalEntropy:0}],this[E]&&(this[v][0].globalEntropy=this[E].entropy),this[w]=D.originTime,this[I]=D.playbackRate,this[L]=new a["default"]();}return(0,M["default"])(W,[{key:"markTime",value:function value(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Y=R.time,V=Y===void 0?this.currentTime:Y,Q=R.entropy,et=Q===void 0?this.entropy:Q,it=R.playbackRate,$=it===void 0?this.playbackRate:it,K={globalTime:this.globalTime,localTime:V,entropy:et,playbackRate:$,globalEntropy:this.globalEntropy};this[v].push(K);}},{key:"fork",value:function value(R){return new W(R,this);}},{key:"seekGlobalTime",value:function value(R){var Y=this.seekTimeMark(R),V=this[v][Y],Q=V.entropy,et=V.playbackRate,it=V.globalTime;return it+(R-Q)/Math.abs(et);}},{key:"seekLocalTime",value:function value(R){var Y=this.seekTimeMark(R),V=this[v][Y],Q=V.localTime,et=V.entropy,it=V.playbackRate;return it>0?Q+(R-et):Q-(R-et);}},{key:"seekTimeMark",value:function value(R){var Y=this[v],V=0,Q=Y.length-1;if(R<=Y[V].entropy)return V;if(R>=Y[Q].entropy)return Q;for(var et=Math.floor((V+Q)/2);et>V&&et<Q;){if(R===Y[et].entropy)return et;R<Y[et].entropy?Q=et:R>Y[et].entropy&&(V=et),et=Math.floor((V+Q)/2);}return V;}},{key:"updateTimers",value:function value(){var R=this,Y=[].concat((0,l["default"])(this[L]));Y.forEach(function(V){var Q=(0,n["default"])(V,2),et=Q[0],it=Q[1];R[B](it.handler,it.time,et);});}},{key:"clearTimeout",value:function(D){function R(Y){return D.apply(this,arguments);}return R.toString=function(){return D.toString();},R;}(function(D){var R=this[L].get(D);R&&R.timerID!=null&&(this[E]?this[E].clearTimeout(R.timerID):clearTimeout(R.timerID)),this[L]["delete"](D);})},{key:"clearInterval",value:function value(R){return this.clearTimeout(R);}},{key:"clear",value:function value(){var R=this,Y=this[L];[].concat((0,l["default"])(Y.keys())).forEach(function(V){R.clearTimeout(V);});}/*
|
|
234
|
+
setTimeout(func, {delay: 100, isEntropy: true})
|
|
235
|
+
setTimeout(func, {entropy: 100})
|
|
236
|
+
setTimeout(func, 100})
|
|
237
|
+
*/},{key:"setTimeout",value:function value(R){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{delay:0};return this[B](R,Y);}},{key:"setInterval",value:function value(R){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{delay:0},V=this,Q=this[B](function et(){V[B](et,Y,Q),R();},Y);return Q;}},{key:B,value:function value(R,Y){var V=this,Q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:(0,P["default"])("timerID");Y=(0,C.formatDelay)(Y);var et=this[L].get(Q),it=void 0,$=null,K=void 0,rt=void 0;et?(this.clearTimeout(Q),Y.isEntropy?it=(Y.delay-(this.entropy-et.startEntropy))/Math.abs(this.playbackRate):it=(Y.delay-(this.currentTime-et.startTime))/this.playbackRate,K=et.startTime,rt=et.startEntropy):(it=Y.delay/(Y.isEntropy?Math.abs(this.playbackRate):this.playbackRate),K=this.currentTime,rt=this.entropy);var lt=this[E],ct=lt?lt.setTimeout.bind(lt):setTimeout,gt=Y.heading;return!lt&>===!1&&it<0&&(it=1/0),(isFinite(it)||lt)&&(it=Math.ceil(it),ct!==setTimeout&&(it={delay:it,heading:gt}),$=ct(function(){V[L]["delete"](Q),R();},it)),this[L].set(Q,{timerID:$,handler:R,time:Y,startTime:K,startEntropy:rt}),Q;}},{key:"parent",get:function get(){return this[E];}},{key:"lastTimeMark",get:function get(){return this[v][this[v].length-1];}},{key:"currentTime",get:function get(){var R=this.lastTimeMark,Y=R.localTime,V=R.globalTime;return Y+(this.globalTime-V)*this.playbackRate;},set:function set(R){var Y=this,V=this.currentTime,Q=R,et=this[L];this.markTime({time:R}),[].concat((0,l["default"])(et)).forEach(function(it){var $=(0,n["default"])(it,2),K=$[0],rt=$[1];if(et.has(K)){var lt=rt.time,ct=lt.isEntropy,gt=lt.delay,st=lt.heading,Ot=rt.handler,St=rt.startTime;if(ct)gt===0&&(Ot(),Y.clearTimeout(K));else{var F=St+gt;(gt===0||st!==!1&&(Q-V)*gt<=0||V<=F&&F<=Q||V>=F&&F>=Q)&&(Ot(),Y.clearTimeout(K));}}}),this.updateTimers();}// Both currentTime and entropy should be influenced by playbackRate.
|
|
238
|
+
// If current playbackRate is negative, the currentTime should go backwards
|
|
239
|
+
// while the entropy remain to go forwards.
|
|
240
|
+
// Both of the initial values is set to -originTime
|
|
241
|
+
},{key:"entropy",get:function get(){var R=this.lastTimeMark,Y=R.entropy,V=R.globalEntropy;return Y+Math.abs((this.globalEntropy-V)*this.playbackRate);},// get globalTime() {
|
|
242
|
+
// if(this[_parent]) {
|
|
243
|
+
// return this[_parent].currentTime;
|
|
244
|
+
// }
|
|
245
|
+
// return nowtime();
|
|
246
|
+
// }
|
|
247
|
+
// change entropy will NOT cause currentTime changing but may influence the pass
|
|
248
|
+
// and the future of the timeline. (It may change the result of seek***Time)
|
|
249
|
+
// While entropy is set, all the marks behind will be droped
|
|
250
|
+
set:function set(R){if(this.entropy>R){var Y=this.seekTimeMark(R);this[v].length=Y+1;}this.markTime({entropy:R}),this.updateTimers();}},{key:"globalEntropy",get:function get(){return this[E]?this[E].entropy:this.globalTime;}},{key:"playbackRate",get:function get(){return this[I];},set:function set(R){R!==this.playbackRate&&(this.markTime({playbackRate:R}),this[I]=R,this.updateTimers());}},{key:"paused",get:function get(){if(this.playbackRate===0)return!0;for(var R=this.parent;R;){if(R.playbackRate===0)return!0;R=R.parent;}return!1;}}]),W;}();e["default"]=b;},/* 76 *//***/function(u,e,t){e.__esModule=!0;var r=t(77),n=o(r),s=t(129),l=o(s);function o(a){return a&&a.__esModule?a:{"default":a};}e["default"]=/* @__PURE__ */function(){function a(c,y){var f=[],g=!0,x=!1,M=void 0;try{for(var S=(0,l["default"])(c),P;!(g=(P=S.next()).done)&&(f.push(P.value),!(y&&f.length===y));g=!0);}catch(C){x=!0,M=C;}finally{try{!g&&S["return"]&&S["return"]();}finally{if(x)throw M;}}return f;}return function(c,y){if(Array.isArray(c))return c;if((0,n["default"])(Object(c)))return a(c,y);throw new TypeError("Invalid attempt to destructure non-iterable instance");};}();},/* 77 *//***/function(u,e,t){u.exports={"default":t(78),__esModule:!0};},/* 78 *//***/function(u,e,t){t(79),t(125),u.exports=t(127);},/* 79 *//***/function(u,e,t){t(80);for(var r=t(91),n=t(95),s=t(83),l=t(122)("toStringTag"),o="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(","),a=0;a<o.length;a++){var c=o[a],y=r[c],f=y&&y.prototype;f&&!f[l]&&n(f,l,c),s[c]=s.Array;}},/* 80 *//***/function(u,e,t){var r=t(81),n=t(82),s=t(83),l=t(84);u.exports=t(88)(Array,"Array",function(o,a){this._t=l(o),this._i=0,this._k=a;},function(){var o=this._t,a=this._k,c=this._i++;return!o||c>=o.length?(this._t=void 0,n(1)):a=="keys"?n(0,c):a=="values"?n(0,o[c]):n(0,[c,o[c]]);},"values"),s.Arguments=s.Array,r("keys"),r("values"),r("entries");},/* 81 *//***/function(u,e){u.exports=function(){};},/* 82 *//***/function(u,e){u.exports=function(t,r){return{value:r,done:!!t};};},/* 83 *//***/function(u,e){u.exports={};},/* 84 *//***/function(u,e,t){var r=t(85),n=t(87);u.exports=function(s){return r(n(s));};},/* 85 *//***/function(u,e,t){var r=t(86);u.exports=Object("z").propertyIsEnumerable(0)?Object:function(n){return r(n)=="String"?n.split(""):Object(n);};},/* 86 *//***/function(u,e){var t={}.toString;u.exports=function(r){return t.call(r).slice(8,-1);};},/* 87 *//***/function(u,e){u.exports=function(t){if(t==null)throw TypeError("Can't call method on "+t);return t;};},/* 88 *//***/function(u,e,t){var r=t(89),n=t(90),s=t(106),l=t(95),o=t(83),a=t(107),c=t(121),y=t(123),f=t(122)("iterator"),g=!([].keys&&"next"in[].keys()),x="@@iterator",M="keys",S="values",P=function P(){return this;};u.exports=function(C,h,p,d,v,I,L){a(p,h,d);var w=function w($){if(!g&&$ in W)return W[$];switch($){case M:return function(){return new p(this,$);};case S:return function(){return new p(this,$);};}return function(){return new p(this,$);};},B=h+" Iterator",E=v==S,b=!1,W=C.prototype,D=W[f]||W[x]||v&&W[v],R=D||w(v),Y=v?E?w("entries"):R:void 0,V=h=="Array"&&W.entries||D,Q,et,it;if(V&&(it=y(V.call(new C())),it!==Object.prototype&&it.next&&(c(it,B,!0),!r&&typeof it[f]!="function"&&l(it,f,P))),E&&D&&D.name!==S&&(b=!0,R=function R(){return D.call(this);}),(!r||L)&&(g||b||!W[f])&&l(W,f,R),o[h]=R,o[B]=P,v)if(Q={values:E?R:w(S),keys:I?R:w(M),entries:Y},L)for(et in Q)et in W||s(W,et,Q[et]);else n(n.P+n.F*(g||b),h,Q);return Q;};},/* 89 *//***/function(u,e){u.exports=!0;},/* 90 *//***/function(u,e,t){var r=t(91),n=t(92),s=t(93),l=t(95),o=t(105),a="prototype",_c2=function c(y,f,g){var x=y&_c2.F,M=y&_c2.G,S=y&_c2.S,P=y&_c2.P,C=y&_c2.B,h=y&_c2.W,p=M?n:n[f]||(n[f]={}),d=p[a],v=M?r:S?r[f]:(r[f]||{})[a],I,L,w;M&&(g=f);for(I in g)L=!x&&v&&v[I]!==void 0,!(L&&o(p,I))&&(w=L?v[I]:g[I],p[I]=M&&typeof v[I]!="function"?g[I]:C&&L?s(w,r):h&&v[I]==w?function(B){var E=function E(b,W,D){if(this instanceof B){switch(arguments.length){case 0:return new B();case 1:return new B(b);case 2:return new B(b,W);}return new B(b,W,D);}return B.apply(this,arguments);};return E[a]=B[a],E;}(w):P&&typeof w=="function"?s(Function.call,w):w,P&&((p.virtual||(p.virtual={}))[I]=w,y&_c2.R&&d&&!d[I]&&l(d,I,w)));};_c2.F=1,_c2.G=2,_c2.S=4,_c2.P=8,_c2.B=16,_c2.W=32,_c2.U=64,_c2.R=128,u.exports=_c2;},/* 91 *//***/function(u,e){var t=u.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(u,e){var t=u.exports={version:"2.6.11"};typeof __e=="number"&&(__e=t);},/* 93 *//***/function(u,e,t){var r=t(94);u.exports=function(n,s,l){if(r(n),s===void 0)return n;switch(l){case 1:return function(o){return n.call(s,o);};case 2:return function(o,a){return n.call(s,o,a);};case 3:return function(o,a,c){return n.call(s,o,a,c);};}return function(){return n.apply(s,arguments);};};},/* 94 *//***/function(u,e){u.exports=function(t){if(typeof t!="function")throw TypeError(t+" is not a function!");return t;};},/* 95 *//***/function(u,e,t){var r=t(96),n=t(104);u.exports=t(100)?function(s,l,o){return r.f(s,l,n(1,o));}:function(s,l,o){return s[l]=o,s;};},/* 96 *//***/function(u,e,t){var r=t(97),n=t(99),s=t(103),l=Object.defineProperty;e.f=t(100)?Object.defineProperty:function(a,c,y){if(r(a),c=s(c,!0),r(y),n)try{return l(a,c,y);}catch(_unused10){}if("get"in y||"set"in y)throw TypeError("Accessors not supported!");return"value"in y&&(a[c]=y.value),a;};},/* 97 *//***/function(u,e,t){var r=t(98);u.exports=function(n){if(!r(n))throw TypeError(n+" is not an object!");return n;};},/* 98 *//***/function(u,e){u.exports=function(t){return _typeof(t)=="object"?t!==null:typeof t=="function";};},/* 99 *//***/function(u,e,t){u.exports=!t(100)&&!t(101)(function(){return Object.defineProperty(t(102)("div"),"a",{get:function get(){return 7;}}).a!=7;});},/* 100 *//***/function(u,e,t){u.exports=!t(101)(function(){return Object.defineProperty({},"a",{get:function get(){return 7;}}).a!=7;});},/* 101 *//***/function(u,e){u.exports=function(t){try{return!!t();}catch(_unused11){return!0;}};},/* 102 *//***/function(u,e,t){var r=t(98),n=t(91).document,s=r(n)&&r(n.createElement);u.exports=function(l){return s?n.createElement(l):{};};},/* 103 *//***/function(u,e,t){var r=t(98);u.exports=function(n,s){if(!r(n))return n;var l,o;if(s&&typeof(l=n.toString)=="function"&&!r(o=l.call(n))||typeof(l=n.valueOf)=="function"&&!r(o=l.call(n))||!s&&typeof(l=n.toString)=="function"&&!r(o=l.call(n)))return o;throw TypeError("Can't convert object to primitive value");};},/* 104 *//***/function(u,e){u.exports=function(t,r){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:r};};},/* 105 *//***/function(u,e){var t={}.hasOwnProperty;u.exports=function(r,n){return t.call(r,n);};},/* 106 *//***/function(u,e,t){u.exports=t(95);},/* 107 *//***/function(u,e,t){var r=t(108),n=t(104),s=t(121),l={};t(95)(l,t(122)("iterator"),function(){return this;}),u.exports=function(o,a,c){o.prototype=r(l,{next:n(1,c)}),s(o,a+" Iterator");};},/* 108 *//***/function(u,e,t){var r=t(97),n=t(109),s=t(119),l=t(116)("IE_PROTO"),o=function o(){},a="prototype",_c3=function c(){var y=t(102)("iframe"),f=s.length,g="<",x=">",M;for(y.style.display="none",t(120).appendChild(y),y.src="javascript:",M=y.contentWindow.document,M.open(),M.write(g+"script"+x+"document.F=Object"+g+"/script"+x),M.close(),_c3=M.F;f--;)delete _c3[a][s[f]];return _c3();};u.exports=Object.create||function(f,g){var x;return f!==null?(o[a]=r(f),x=new o(),o[a]=null,x[l]=f):x=_c3(),g===void 0?x:n(x,g);};},/* 109 *//***/function(u,e,t){var r=t(96),n=t(97),s=t(110);u.exports=t(100)?Object.defineProperties:function(o,a){n(o);for(var c=s(a),y=c.length,f=0,g;y>f;)r.f(o,g=c[f++],a[g]);return o;};},/* 110 *//***/function(u,e,t){var r=t(111),n=t(119);u.exports=Object.keys||function(l){return r(l,n);};},/* 111 *//***/function(u,e,t){var r=t(105),n=t(84),s=t(112)(!1),l=t(116)("IE_PROTO");u.exports=function(o,a){var c=n(o),y=0,f=[],g;for(g in c)g!=l&&r(c,g)&&f.push(g);for(;a.length>y;)r(c,g=a[y++])&&(~s(f,g)||f.push(g));return f;};},/* 112 *//***/function(u,e,t){var r=t(84),n=t(113),s=t(115);u.exports=function(l){return function(o,a,c){var y=r(o),f=n(y.length),g=s(c,f),x;if(l&&a!=a){for(;f>g;)if(x=y[g++],x!=x)return!0;}else for(;f>g;g++)if((l||g in y)&&y[g]===a)return l||g||0;return!l&&-1;};};},/* 113 *//***/function(u,e,t){var r=t(114),n=Math.min;u.exports=function(s){return s>0?n(r(s),9007199254740991):0;};},/* 114 *//***/function(u,e){var t=Math.ceil,r=Math.floor;u.exports=function(n){return isNaN(n=+n)?0:(n>0?r:t)(n);};},/* 115 *//***/function(u,e,t){var r=t(114),n=Math.max,s=Math.min;u.exports=function(l,o){return l=r(l),l<0?n(l+o,0):s(l,o);};},/* 116 *//***/function(u,e,t){var r=t(117)("keys"),n=t(118);u.exports=function(s){return r[s]||(r[s]=n(s));};},/* 117 *//***/function(u,e,t){var r=t(92),n=t(91),s="__core-js_shared__",l=n[s]||(n[s]={});(u.exports=function(o,a){return l[o]||(l[o]=a!==void 0?a:{});})("versions",[]).push({version:r.version,mode:t(89)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"});},/* 118 *//***/function(u,e){var t=0,r=Math.random();u.exports=function(n){return"Symbol(".concat(n===void 0?"":n,")_",(++t+r).toString(36));};},/* 119 *//***/function(u,e){u.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",");},/* 120 *//***/function(u,e,t){var r=t(91).document;u.exports=r&&r.documentElement;},/* 121 *//***/function(u,e,t){var r=t(96).f,n=t(105),s=t(122)("toStringTag");u.exports=function(l,o,a){l&&!n(l=a?l:l.prototype,s)&&r(l,s,{configurable:!0,value:o});};},/* 122 *//***/function(u,e,t){var r=t(117)("wks"),n=t(118),s=t(91).Symbol,l=typeof s=="function",o=u.exports=function(a){return r[a]||(r[a]=l&&s[a]||(l?s:n)("Symbol."+a));};o.store=r;},/* 123 *//***/function(u,e,t){var r=t(105),n=t(124),s=t(116)("IE_PROTO"),l=Object.prototype;u.exports=Object.getPrototypeOf||function(o){return o=n(o),r(o,s)?o[s]:typeof o.constructor=="function"&&o instanceof o.constructor?o.constructor.prototype:o instanceof Object?l:null;};},/* 124 *//***/function(u,e,t){var r=t(87);u.exports=function(n){return Object(r(n));};},/* 125 *//***/function(u,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,l;return s>=n.length?{value:void 0,done:!0}:(l=r(n,s),this._i+=l.length,{value:l,done:!1});});},/* 126 *//***/function(u,e,t){var r=t(114),n=t(87);u.exports=function(s){return function(l,o){var a=String(n(l)),c=r(o),y=a.length,f,g;return c<0||c>=y?s?"":void 0:(f=a.charCodeAt(c),f<55296||f>56319||c+1===y||(g=a.charCodeAt(c+1))<56320||g>57343?s?a.charAt(c):f:s?a.slice(c,c+2):(f-55296<<10)+(g-56320)+65536);};};},/* 127 *//***/function(u,e,t){var r=t(128),n=t(122)("iterator"),s=t(83);u.exports=t(92).isIterable=function(l){var o=Object(l);return o[n]!==void 0||"@@iterator"in o||s.hasOwnProperty(r(o));};},/* 128 *//***/function(u,e,t){var r=t(86),n=t(122)("toStringTag"),s=r(/* @__PURE__ */function(){return arguments;}())=="Arguments",l=function l(o,a){try{return o[a];}catch(_unused12){}};u.exports=function(o){var a,c,y;return o===void 0?"Undefined":o===null?"Null":typeof(c=l(a=Object(o),n))=="string"?c:s?r(a):(y=r(a))=="Object"&&typeof a.callee=="function"?"Arguments":y;};},/* 129 *//***/function(u,e,t){u.exports={"default":t(130),__esModule:!0};},/* 130 *//***/function(u,e,t){t(79),t(125),u.exports=t(131);},/* 131 *//***/function(u,e,t){var r=t(97),n=t(132);u.exports=t(92).getIterator=function(s){var l=n(s);if(typeof l!="function")throw TypeError(s+" is not iterable!");return r(l.call(s));};},/* 132 *//***/function(u,e,t){var r=t(128),n=t(122)("iterator"),s=t(83);u.exports=t(92).getIteratorMethod=function(l){if(l!=null)return l[n]||l["@@iterator"]||s[r(l)];};},/* 133 *//***/function(u,e,t){e.__esModule=!0;var r=t(134),n=s(r);function s(l){return l&&l.__esModule?l:{"default":l};}e["default"]=function(l){if(Array.isArray(l)){for(var o=0,a=Array(l.length);o<l.length;o++)a[o]=l[o];return a;}else return(0,n["default"])(l);};},/* 134 *//***/function(u,e,t){u.exports={"default":t(135),__esModule:!0};},/* 135 *//***/function(u,e,t){t(125),t(136),u.exports=t(92).Array.from;},/* 136 *//***/function(u,e,t){var r=t(93),n=t(90),s=t(124),l=t(137),o=t(138),a=t(113),c=t(139),y=t(132);n(n.S+n.F*!t(140)(function(f){Array.from(f);}),"Array",{// 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
|
|
251
|
+
from:function from(g){var x=s(g),M=typeof this=="function"?this:Array,S=arguments.length,P=S>1?arguments[1]:void 0,C=P!==void 0,h=0,p=y(x),d,v,I,L;if(C&&(P=r(P,S>2?arguments[2]:void 0,2)),p!=null&&!(M==Array&&o(p)))for(L=p.call(x),v=new M();!(I=L.next()).done;h++)c(v,h,C?l(L,P,[I.value,h],!0):I.value);else for(d=a(x.length),v=new M(d);d>h;h++)c(v,h,C?P(x[h],h):x[h]);return v.length=h,v;}});},/* 137 *//***/function(u,e,t){var r=t(97);u.exports=function(n,s,l,o){try{return o?s(r(l)[0],l[1]):s(l);}catch(c){var a=n["return"];throw a!==void 0&&r(a.call(n)),c;}};},/* 138 *//***/function(u,e,t){var r=t(83),n=t(122)("iterator"),s=Array.prototype;u.exports=function(l){return l!==void 0&&(r.Array===l||s[n]===l);};},/* 139 *//***/function(u,e,t){var r=t(96),n=t(104);u.exports=function(s,l,o){l in s?r.f(s,l,n(0,o)):s[l]=o;};},/* 140 *//***/function(u,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(_unused13){}u.exports=function(l,o){if(!o&&!n)return!1;var a=!1;try{var c=[7],y=c[r]();y.next=function(){return{done:a=!0};},c[r]=function(){return y;},l(c);}catch(_unused14){}return a;};},/* 141 *//***/function(u,e,t){u.exports={"default":t(142),__esModule:!0};},/* 142 *//***/function(u,e,t){t(143),t(125),t(79),t(144),t(157),t(160),t(162),u.exports=t(92).Map;},/* 143 *//***/function(u,e){},/* 144 *//***/function(u,e,t){var r=t(145),n=t(151),s="Map";u.exports=t(152)(s,function(l){return function(){return l(this,arguments.length>0?arguments[0]:void 0);};},{// 23.1.3.6 Map.prototype.get(key)
|
|
252
|
+
get:function get(o){var a=r.getEntry(n(this,s),o);return a&&a.v;},// 23.1.3.9 Map.prototype.set(key, value)
|
|
253
|
+
set:function set(o,a){return r.def(n(this,s),o===0?0:o,a);}},r,!0);},/* 145 *//***/function(u,e,t){var r=t(96).f,n=t(108),s=t(146),l=t(93),o=t(147),a=t(148),c=t(88),y=t(82),f=t(149),g=t(100),x=t(150).fastKey,M=t(151),S=g?"_s":"size",P=function P(C,h){var p=x(h),d;if(p!=="F")return C._i[p];for(d=C._f;d;d=d.n)if(d.k==h)return d;};u.exports={getConstructor:function getConstructor(C,h,p,d){var v=C(function(I,L){o(I,v,h,"_i"),I._t=h,I._i=n(null),I._f=void 0,I._l=void 0,I[S]=0,L!=null&&a(L,p,I[d],I);});return s(v.prototype,{// 23.1.3.1 Map.prototype.clear()
|
|
254
|
+
// 23.2.3.2 Set.prototype.clear()
|
|
255
|
+
clear:function clear(){for(var L=M(this,h),w=L._i,B=L._f;B;B=B.n)B.r=!0,B.p&&(B.p=B.p.n=void 0),delete w[B.i];L._f=L._l=void 0,L[S]=0;},// 23.1.3.3 Map.prototype.delete(key)
|
|
256
|
+
// 23.2.3.4 Set.prototype.delete(value)
|
|
257
|
+
"delete":function _delete(I){var L=M(this,h),w=P(L,I);if(w){var B=w.n,E=w.p;delete L._i[w.i],w.r=!0,E&&(E.n=B),B&&(B.p=E),L._f==w&&(L._f=B),L._l==w&&(L._l=E),L[S]--;}return!!w;},// 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
|
|
258
|
+
// 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
|
|
259
|
+
forEach:function forEach(L){M(this,h);for(var w=l(L,arguments.length>1?arguments[1]:void 0,3),B;B=B?B.n:this._f;)for(w(B.v,B.k,this);B&&B.r;)B=B.p;},// 23.1.3.7 Map.prototype.has(key)
|
|
260
|
+
// 23.2.3.7 Set.prototype.has(value)
|
|
261
|
+
has:function has(L){return!!P(M(this,h),L);}}),g&&r(v.prototype,"size",{get:function get(){return M(this,h)[S];}}),v;},def:function def(C,h,p){var d=P(C,h),v,I;return d?d.v=p:(C._l=d={i:I=x(h,!0),// <- index
|
|
262
|
+
k:h,// <- key
|
|
263
|
+
v:p,// <- value
|
|
264
|
+
p:v=C._l,// <- previous entry
|
|
265
|
+
n:void 0,// <- next entry
|
|
266
|
+
r:!1// <- removed
|
|
267
|
+
},C._f||(C._f=d),v&&(v.n=d),C[S]++,I!=="F"&&(C._i[I]=d)),C;},getEntry:P,setStrong:function setStrong(C,h,p){c(C,h,function(d,v){this._t=M(d,h),this._k=v,this._l=void 0;},function(){for(var d=this,v=d._k,I=d._l;I&&I.r;)I=I.p;return!d._t||!(d._l=I=I?I.n:d._t._f)?(d._t=void 0,y(1)):v=="keys"?y(0,I.k):v=="values"?y(0,I.v):y(0,[I.k,I.v]);},p?"entries":"values",!p,!0),f(h);}};},/* 146 *//***/function(u,e,t){var r=t(95);u.exports=function(n,s,l){for(var o in s)l&&n[o]?n[o]=s[o]:r(n,o,s[o]);return n;};},/* 147 *//***/function(u,e){u.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(u,f,t){var r=t(93),n=t(137),s=t(138),l=t(97),o=t(113),a=t(132),c={},y={},f=u.exports=function(g,x,M,S,P){var C=P?function(){return g;}:a(g),h=r(M,S,x?2:1),p=0,d,v,I,L;if(typeof C!="function")throw TypeError(g+" is not iterable!");if(s(C)){for(d=o(g.length);d>p;p++)if(L=x?h(l(v=g[p])[0],v[1]):h(g[p]),L===c||L===y)return L;}else for(I=C.call(g);!(v=I.next()).done;)if(L=n(I,h,v.value,x),L===c||L===y)return L;};f.BREAK=c,f.RETURN=y;},/* 149 *//***/function(u,e,t){var r=t(91),n=t(92),s=t(96),l=t(100),o=t(122)("species");u.exports=function(a){var c=typeof n[a]=="function"?n[a]:r[a];l&&c&&!c[o]&&s.f(c,o,{configurable:!0,get:function get(){return this;}});};},/* 150 *//***/function(u,e,t){var r=t(118)("meta"),n=t(98),s=t(105),l=t(96).f,o=0,a=Object.isExtensible||function(){return!0;},c=!t(101)(function(){return a(Object.preventExtensions({}));}),y=function y(S){l(S,r,{value:{i:"O"+ ++o,// object ID
|
|
268
|
+
w:{}// weak collections IDs
|
|
269
|
+
}});},f=function f(S,P){if(!n(S))return _typeof(S)=="symbol"?S:(typeof S=="string"?"S":"P")+S;if(!s(S,r)){if(!a(S))return"F";if(!P)return"E";y(S);}return S[r].i;},g=function g(S,P){if(!s(S,r)){if(!a(S))return!0;if(!P)return!1;y(S);}return S[r].w;},x=function x(S){return c&&M.NEED&&a(S)&&!s(S,r)&&y(S),S;},M=u.exports={KEY:r,NEED:!1,fastKey:f,getWeak:g,onFreeze:x};},/* 151 *//***/function(u,e,t){var r=t(98);u.exports=function(n,s){if(!r(n)||n._t!==s)throw TypeError("Incompatible receiver, "+s+" required!");return n;};},/* 152 *//***/function(u,e,t){var r=t(91),n=t(90),s=t(150),l=t(101),o=t(95),a=t(146),c=t(148),y=t(147),f=t(98),g=t(121),x=t(96).f,M=t(153)(0),S=t(100);u.exports=function(P,C,h,p,d,v){var I=r[P],L=I,w=d?"set":"add",B=L&&L.prototype,E={};return!S||typeof L!="function"||!(v||B.forEach&&!l(function(){new L().entries().next();}))?(L=p.getConstructor(C,P,d,w),a(L.prototype,h),s.NEED=!0):(L=C(function(b,W){y(b,L,P,"_c"),b._c=new I(),W!=null&&c(W,d,b[w],b);}),M("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(b){var W=b=="add"||b=="set";b in B&&!(v&&b=="clear")&&o(L.prototype,b,function(D,R){if(y(this,L,b),!W&&v&&!f(D))return b=="get"?void 0:!1;var Y=this._c[b](D===0?0:D,R);return W?this:Y;});}),v||x(L.prototype,"size",{get:function get(){return this._c.size;}})),g(L,P),E[P]=L,n(n.G+n.W+n.F,E),v||p.setStrong(L,P,d),L;};},/* 153 *//***/function(u,e,t){var r=t(93),n=t(85),s=t(124),l=t(113),o=t(154);u.exports=function(a,c){var y=a==1,f=a==2,g=a==3,x=a==4,M=a==6,S=a==5||M,P=c||o;return function(C,h,p){for(var d=s(C),v=n(d),I=r(h,p,3),L=l(v.length),w=0,B=y?P(C,L):f?P(C,0):void 0,E,b;L>w;w++)if((S||w in v)&&(E=v[w],b=I(E,w,d),a)){if(y)B[w]=b;else if(b)switch(a){case 3:return!0;case 5:return E;case 6:return w;case 2:B.push(E);}else if(x)return!1;}return M?-1:g||x?x:B;};};},/* 154 *//***/function(u,e,t){var r=t(155);u.exports=function(n,s){return new(r(n))(s);};},/* 155 *//***/function(u,e,t){var r=t(98),n=t(156),s=t(122)("species");u.exports=function(l){var o;return n(l)&&(o=l.constructor,typeof o=="function"&&(o===Array||n(o.prototype))&&(o=void 0),r(o)&&(o=o[s],o===null&&(o=void 0))),o===void 0?Array:o;};},/* 156 *//***/function(u,e,t){var r=t(86);u.exports=Array.isArray||function(s){return r(s)=="Array";};},/* 157 *//***/function(u,e,t){var r=t(90);r(r.P+r.R,"Map",{toJSON:t(158)("Map")});},/* 158 *//***/function(u,e,t){var r=t(128),n=t(159);u.exports=function(s){return function(){if(r(this)!=s)throw TypeError(s+"#toJSON isn't generic");return n(this);};};},/* 159 *//***/function(u,e,t){var r=t(148);u.exports=function(n,s){var l=[];return r(n,!1,l.push,l,s),l;};},/* 160 *//***/function(u,e,t){t(161)("Map");},/* 161 *//***/function(u,e,t){var r=t(90);u.exports=function(n){r(r.S,n,{of:function of(){for(var l=arguments.length,o=new Array(l);l--;)o[l]=arguments[l];return new this(o);}});};},/* 162 *//***/function(u,e,t){t(163)("Map");},/* 163 *//***/function(u,e,t){var r=t(90),n=t(94),s=t(93),l=t(148);u.exports=function(o){r(r.S,o,{from:function from(c){var y=arguments[1],f,g,x,M;return n(this),f=y!==void 0,f&&n(y),c==null?new this():(g=[],f?(x=0,M=s(y,arguments[2],2),l(c,!1,function(S){g.push(M(S,x++));})):l(c,!1,g.push,g),new this(g));}});};},/* 164 *//***/function(u,e,t){u.exports={"default":t(165),__esModule:!0};},/* 165 *//***/function(u,e,t){t(166),u.exports=t(92).Object.assign;},/* 166 *//***/function(u,e,t){var r=t(90);r(r.S+r.F,"Object",{assign:t(167)});},/* 167 *//***/function(u,e,t){var r=t(100),n=t(110),s=t(168),l=t(169),o=t(124),a=t(85),c=Object.assign;u.exports=!c||t(101)(function(){var y={},f={},g=Symbol(),x="abcdefghijklmnopqrst";return y[g]=7,x.split("").forEach(function(M){f[M]=M;}),c({},y)[g]!=7||Object.keys(c({},f)).join("")!=x;})?function(f,g){for(var x=o(f),M=arguments.length,S=1,P=s.f,C=l.f;M>S;)for(var h=a(arguments[S++]),p=P?n(h).concat(P(h)):n(h),d=p.length,v=0,I;d>v;)I=p[v++],(!r||C.call(h,I))&&(x[I]=h[I]);return x;}:c;},/* 168 *//***/function(u,e){e.f=Object.getOwnPropertySymbols;},/* 169 *//***/function(u,e){e.f={}.propertyIsEnumerable;},/* 170 *//***/function(u,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(u,e,t){e.__esModule=!0;var r=t(172),n=s(r);function s(l){return l&&l.__esModule?l:{"default":l};}e["default"]=/* @__PURE__ */function(){function l(o,a){for(var c=0;c<a.length;c++){var y=a[c];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),(0,n["default"])(o,y.key,y);}}return function(o,a,c){return a&&l(o.prototype,a),c&&l(o,c),o;};}();},/* 172 *//***/function(u,e,t){u.exports={"default":t(173),__esModule:!0};},/* 173 *//***/function(u,e,t){t(174);var r=t(92).Object;u.exports=function(s,l,o){return r.defineProperty(s,l,o);};},/* 174 *//***/function(u,e,t){var r=t(90);r(r.S+r.F*!t(100),"Object",{defineProperty:t(96).f});},/* 175 *//***/function(u,e,t){u.exports={"default":t(176),__esModule:!0};},/* 176 *//***/function(u,e,t){t(177),t(143),t(184),t(185),u.exports=t(92).Symbol;},/* 177 *//***/function(u,e,t){var r=t(91),n=t(105),s=t(100),l=t(90),o=t(106),a=t(150).KEY,c=t(101),y=t(117),f=t(121),g=t(118),x=t(122),M=t(178),S=t(179),P=t(180),C=t(156),h=t(97),p=t(98),d=t(124),v=t(84),I=t(103),L=t(104),w=t(108),B=t(181),E=t(183),b=t(168),W=t(96),D=t(110),R=E.f,Y=W.f,V=B.f,_Q2=r.Symbol,et=r.JSON,it=et&&et.stringify,$="prototype",K=x("_hidden"),rt=x("toPrimitive"),lt={}.propertyIsEnumerable,ct=y("symbol-registry"),gt=y("symbols"),st=y("op-symbols"),Ot=Object[$],St=typeof _Q2=="function"&&!!b.f,F=r.QObject,z=!F||!F[$]||!F[$].findChild,Z=s&&c(function(){return w(Y({},"a",{get:function get(){return Y(this,"a",{value:7}).a;}})).a!=7;})?function(vt,mt,Pt){var Mt=R(Ot,mt);Mt&&delete Ot[mt],Y(vt,mt,Pt),Mt&&vt!==Ot&&Y(Ot,mt,Mt);}:Y,tt=function tt(vt){var mt=gt[vt]=w(_Q2[$]);return mt._k=vt,mt;},j=St&&_typeof(_Q2.iterator)=="symbol"?function(vt){return _typeof(vt)=="symbol";}:function(vt){return vt instanceof _Q2;},_H2=function H(mt,Pt,Mt){return mt===Ot&&_H2(st,Pt,Mt),h(mt),Pt=I(Pt,!0),h(Mt),n(gt,Pt)?(Mt.enumerable?(n(mt,K)&&mt[K][Pt]&&(mt[K][Pt]=!1),Mt=w(Mt,{enumerable:L(0,!1)})):(n(mt,K)||Y(mt,K,L(1,{})),mt[K][Pt]=!0),Z(mt,Pt,Mt)):Y(mt,Pt,Mt);},T=function T(mt,Pt){h(mt);for(var Mt=P(Pt=v(Pt)),At=0,It=Mt.length,Nt;It>At;)_H2(mt,Nt=Mt[At++],Pt[Nt]);return mt;},A=function A(mt,Pt){return Pt===void 0?w(mt):T(w(mt),Pt);},U=function U(mt){var Pt=lt.call(this,mt=I(mt,!0));return this===Ot&&n(gt,mt)&&!n(st,mt)?!1:Pt||!n(this,mt)||!n(gt,mt)||n(this,K)&&this[K][mt]?Pt:!0;},G=function G(mt,Pt){if(mt=v(mt),Pt=I(Pt,!0),!(mt===Ot&&n(gt,Pt)&&!n(st,Pt))){var Mt=R(mt,Pt);return Mt&&n(gt,Pt)&&!(n(mt,K)&&mt[K][Pt])&&(Mt.enumerable=!0),Mt;}},J=function J(mt){for(var Pt=V(v(mt)),Mt=[],At=0,It;Pt.length>At;)!n(gt,It=Pt[At++])&&It!=K&&It!=a&&Mt.push(It);return Mt;},q=function q(mt){for(var Pt=mt===Ot,Mt=V(Pt?st:v(mt)),At=[],It=0,Nt;Mt.length>It;)n(gt,Nt=Mt[It++])&&(!Pt||n(Ot,Nt))&&At.push(gt[Nt]);return At;};St||(_Q2=function Q(){if(this instanceof _Q2)throw TypeError("Symbol is not a constructor!");var mt=g(arguments.length>0?arguments[0]:void 0),_Pt=function Pt(Mt){this===Ot&&_Pt.call(st,Mt),n(this,K)&&n(this[K],mt)&&(this[K][mt]=!1),Z(this,mt,L(1,Mt));};return s&&z&&Z(Ot,mt,{configurable:!0,set:_Pt}),tt(mt);},o(_Q2[$],"toString",function(){return this._k;}),E.f=G,W.f=_H2,t(182).f=B.f=J,t(169).f=U,b.f=q,s&&!t(89)&&o(Ot,"propertyIsEnumerable",U,!0),M.f=function(vt){return tt(x(vt));}),l(l.G+l.W+l.F*!St,{Symbol:_Q2});for(var nt=// 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
|
|
270
|
+
"hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ut=0;nt.length>ut;)x(nt[ut++]);for(var pt=D(x.store),yt=0;pt.length>yt;)S(pt[yt++]);l(l.S+l.F*!St,"Symbol",{// 19.4.2.1 Symbol.for(key)
|
|
271
|
+
"for":function _for(vt){return n(ct,vt+="")?ct[vt]:ct[vt]=_Q2(vt);},// 19.4.2.5 Symbol.keyFor(sym)
|
|
272
|
+
keyFor:function keyFor(mt){if(!j(mt))throw TypeError(mt+" is not a symbol!");for(var Pt in ct)if(ct[Pt]===mt)return Pt;},useSetter:function useSetter(){z=!0;},useSimple:function useSimple(){z=!1;}}),l(l.S+l.F*!St,"Object",{// 19.1.2.2 Object.create(O [, Properties])
|
|
273
|
+
create:A,// 19.1.2.4 Object.defineProperty(O, P, Attributes)
|
|
274
|
+
defineProperty:_H2,// 19.1.2.3 Object.defineProperties(O, Properties)
|
|
275
|
+
defineProperties:T,// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
|
|
276
|
+
getOwnPropertyDescriptor:G,// 19.1.2.7 Object.getOwnPropertyNames(O)
|
|
277
|
+
getOwnPropertyNames:J,// 19.1.2.8 Object.getOwnPropertySymbols(O)
|
|
278
|
+
getOwnPropertySymbols:q});var Tt=c(function(){b.f(1);});l(l.S+l.F*Tt,"Object",{getOwnPropertySymbols:function getOwnPropertySymbols(mt){return b.f(d(mt));}}),et&&l(l.S+l.F*(!St||c(function(){var vt=_Q2();return it([vt])!="[null]"||it({a:vt})!="{}"||it(Object(vt))!="{}";})),"JSON",{stringify:function stringify(mt){for(var Pt=[mt],Mt=1,At,It;arguments.length>Mt;)Pt.push(arguments[Mt++]);if(It=At=Pt[1],!(!p(At)&&mt===void 0||j(mt)))return C(At)||(At=function At(Nt,$t){if(typeof It=="function"&&($t=It.call(this,Nt,$t)),!j($t))return $t;}),Pt[1]=At,it.apply(et,Pt);}}),_Q2[$][rt]||t(95)(_Q2[$],rt,_Q2[$].valueOf),f(_Q2,"Symbol"),f(Math,"Math",!0),f(r.JSON,"JSON",!0);},/* 178 *//***/function(u,e,t){e.f=t(122);},/* 179 *//***/function(u,e,t){var r=t(91),n=t(92),s=t(89),l=t(178),o=t(96).f;u.exports=function(a){var c=n.Symbol||(n.Symbol=s?{}:r.Symbol||{});a.charAt(0)!="_"&&!(a in c)&&o(c,a,{value:l.f(a)});};},/* 180 *//***/function(u,e,t){var r=t(110),n=t(168),s=t(169);u.exports=function(l){var o=r(l),a=n.f;if(a)for(var c=a(l),y=s.f,f=0,g;c.length>f;)y.call(l,g=c[f++])&&o.push(g);return o;};},/* 181 *//***/function(u,e,t){var r=t(84),n=t(182).f,s={}.toString,l=(typeof window==="undefined"?"undefined":_typeof(window))=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],o=function o(a){try{return n(a);}catch(_unused15){return l.slice();}};u.exports.f=function(c){return l&&s.call(c)=="[object Window]"?o(c):n(r(c));};},/* 182 *//***/function(u,e,t){var r=t(111),n=t(119).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(l){return r(l,n);};},/* 183 *//***/function(u,e,t){var r=t(169),n=t(104),s=t(84),l=t(103),o=t(105),a=t(99),c=Object.getOwnPropertyDescriptor;e.f=t(100)?c:function(f,g){if(f=s(f),g=l(g,!0),a)try{return c(f,g);}catch(_unused16){}if(o(f,g))return n(!r.f.call(f,g),f[g]);};},/* 184 *//***/function(u,e,t){t(179)("asyncIterator");},/* 185 *//***/function(u,e,t){t(179)("observable");},/* 186 *//***/function(u,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(u,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e["default"]={// s - startFrame, e - endFrame
|
|
279
|
+
"default":function _default(n,s,l,o,a){return typeof n=="number"&&typeof s=="number"?n+(l-o)/(a-o)*(s-n):l-o>a-l?s:n;}};},/* 188 *//***/function(u,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.parseEasing=e.Easings=void 0;var r=t(76),n=c(r),s=t(133),l=c(s),o=t(141),a=c(o);function c(C){return C&&C.__esModule?C:{"default":C};}var y=t(189),f=new a["default"]();function g(){for(var C=arguments.length,h=Array(C),p=0;p<C;p++)h[p]=arguments[p];var d=f.get(h);return d||(d=y.apply(void 0,h),f.set(h,d),d);}function x(C){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"end";return function(p,d){for(var v=1;v<d.length;v++){var I=d[v].offset;if(p<=I){var L=d[v-1].offset,w=I,B=(p-L)/(w-L),E=1/C,b=B/E;return h==="end"?b=Math.floor(b):b=Math.ceil(b),E*b*(w-L)+L;}}return 0;};}function M(C){var h=/^cubic-bezier\((.*)\)/,p=C.match(h);if(p){var d=p[1].trim();return d=d.split(",").map(function(E){return parseFloat(E.trim());}),g.apply(void 0,(0,l["default"])(d));}if(h=/^steps\((.*)\)/,p=C.match(h),p){var v=p[1].trim();v=v.split(",").map(function(E){return E.trim();});var I=v,L=(0,n["default"])(I,2),w=L[0],B=L[1];return x(parseInt(w,10),B);}return C;}var S={linear:function linear(h){return h;},ease:g(0.25,0.1,0.25,1),"ease-in":g(0.42,0,1,1),"ease-out":g(0,0,0.58,1),"ease-in-out":g(0.42,0,0.58,1),// 'step-start': function(p, frames){
|
|
280
|
+
// let ret = 0
|
|
281
|
+
// for(let i = 0; i < frames.length; i++){
|
|
282
|
+
// const {offset} = frames[i]
|
|
283
|
+
// ret = offset
|
|
284
|
+
// if(p < offset){
|
|
285
|
+
// break
|
|
286
|
+
// }
|
|
287
|
+
// }
|
|
288
|
+
// return ret
|
|
289
|
+
// },
|
|
290
|
+
// 'step-end': function(p, frames){
|
|
291
|
+
// let ret = 0
|
|
292
|
+
// for(let i = 0; i < frames.length; i++){
|
|
293
|
+
// const {offset} = frames[i]
|
|
294
|
+
// if(p < offset){
|
|
295
|
+
// break
|
|
296
|
+
// }
|
|
297
|
+
// ret = offset
|
|
298
|
+
// }
|
|
299
|
+
// return ret
|
|
300
|
+
// }
|
|
301
|
+
"step-start":x(1,"start"),"step-end":x(1,"end")};function P(C){return typeof C=="string"?S[C]?C=S[C]:C=M(C):C.type==="cubic-bezier"?C=g.apply(void 0,(0,l["default"])(C.value)):C.type==="steps"&&(C=x(C.step,C.pos)),C;}e.Easings=S,e.parseEasing=P;},/* 189 *//***/function(u,e){var t=4,r=1e-3,n=1e-7,s=10,l=11,o=1/(l-1),a=typeof Float32Array=="function";function c(C,h){return 1-3*h+3*C;}function y(C,h){return 3*h-6*C;}function f(C){return 3*C;}function g(C,h,p){return((c(h,p)*C+y(h,p))*C+f(h))*C;}function x(C,h,p){return 3*c(h,p)*C*C+2*y(h,p)*C+f(h);}function M(C,h,p,d,v){var I,L,w=0;do L=h+(p-h)/2,I=g(L,d,v)-C,I>0?p=L:h=L;while(Math.abs(I)>n&&++w<s);return L;}function S(C,h,p,d){for(var v=0;v<t;++v){var I=x(h,p,d);if(I===0)return h;var L=g(h,p,d)-C;h-=L/I;}return h;}function P(C){return C;}u.exports=function(h,p,d,v){if(!(0<=h&&h<=1&&0<=d&&d<=1))throw new Error("bezier x values must be in [0, 1] range");if(h===p&&d===v)return P;for(var I=a?new Float32Array(l):new Array(l),L=0;L<l;++L)I[L]=g(L*o,h,d);function w(B){for(var E=0,b=1,W=l-1;b!==W&&I[b]<=B;++b)E+=o;--b;var D=(B-I[b])/(I[b+1]-I[b]),R=E+D*o,Y=x(R,h,d);return Y>=r?S(B,R,h,d):Y===0?R:M(B,E,E+o,h,d);}return function(E){return E===0?0:E===1?1:g(w(E),p,v);};};},/* 190 *//***/function(u,e,t){Object.defineProperty(e,"__esModule",{value:!0});var r=t(191),n=p(r),s=t(204),l=p(s),o=t(164),a=p(o),c=t(170),y=p(c),f=t(171),g=p(f),x=t(175),M=p(x),S=t(75),P=p(S),C=t(208),h=t(188);function p(Y){return Y&&Y.__esModule?Y:{"default":Y};}var d=(0,M["default"])("timing"),v=(0,M["default"])("keyframes"),I=(0,M["default"])("initState"),L=(0,M["default"])("readyDefer"),w=(0,M["default"])("finishedDefer"),B=(0,M["default"])("effects"),E=(0,M["default"])("activeReadyTimer"),b=(0,M["default"])("activeFinishTimer"),W=(0,M["default"])("removeDefer"),D={delay:0,endDelay:0,fill:"auto",iterations:1,playbackRate:1,direction:"normal",easing:"linear",effect:null},R=function(){function Y(V,Q,et){var it=this;if((0,y["default"])(this,Y),Array.isArray(V)){var $=[V[0],V,Q];V=$[0],Q=$[1],et=$[2];}typeof et=="number"&&(et={duration:et}),this[d]=(0,a["default"])({},D,et),this[d].easing=(0,h.parseEasing)(this[d].easing),this[v]=(0,C.calculateFramesOffset)(Q);var K=this[v][this[v].length-1];this[I]={},(0,l["default"])(K).forEach(function(rt){Object.prototype.hasOwnProperty.call(V,rt)&&rt!=="easing"&&rt!=="offset"&&(it[I][rt]=V[rt]);}),this[v]=this[v].map(function(rt){return(0,a["default"])({},it[I],rt);}),this[v][0].offset!==0&&this[v].unshift((0,a["default"])({},this[I],{offset:0})),K.offset<1&&this[v].push((0,a["default"])({},K,{offset:1})),this[B]={},this.timeline=null;}return(0,g["default"])(Y,[{key:"pause",value:function value(){this.timeline.playbackRate=0;}},{key:E,value:function value(){var Q=this;this[L]&&!this[L].timerID&&(this.timeline.currentTime<0?this[L].timerID=this.timeline.setTimeout(function(){Q[L].resolve(),delete Q[L];},{delay:-this.timeline.currentTime,heading:!1}):this[L].timerID=this.timeline.setTimeout(function(){Q[L].resolve(),delete Q[L];},{delay:0,isEntropy:!0}));}},{key:b,value:function value(){var Q=this,et=this[d],it=et.duration,$=et.iterations,K=et.endDelay,rt=Math.ceil(it*$+K-this.timeline.currentTime)+1;this[w]&&!this[w].timerID&&(this[w].timerID=this.timeline.setTimeout(function(){Q[w].resolve(),Q[W](L),Q[W](w);},{delay:rt,heading:!1}),this[w].reverseTimerID=this.timeline.setTimeout(function(){Q[w].resolve(),Q[W](L),Q[W](w),Q.timeline=null;},{delay:-this[d].delay-1,heading:!1}));}},{key:"play",value:function value(){if(this.playState==="finished"&&this.cancel(),this.playState==="idle"){if(this.playbackRate<=0)return;var Q=this[d],et=Q.delay,it=Q.playbackRate,$=Q.timeline;this.timeline=new P["default"]({originTime:et,playbackRate:it},$),this[E](),this[b]();}else this.playState==="paused"&&(this.timeline.playbackRate=this.playbackRate,this[E]());}},{key:W,value:function value(Q){var et=this[Q],it=this.timeline;et&&it&&(it.clearTimeout(et.timerID),et.reverseTimerID&&it.clearTimeout(et.reverseTimerID)),delete this[Q];}},{key:"cancel",value:function value(){this[W](L),this[W](w),this.timeline=null;}},{key:"finish",value:function value(){this.timeline&&(this.timeline.currentTime=1/0/this.playbackRate),this[W](L),this[W](w);}},{key:"applyEffects",value:function value(Q){return(0,a["default"])(this[B],Q);}},{key:"playbackRate",get:function get(){return this[d].playbackRate;},set:function set(Q){this.timeline&&(this.timeline.playbackRate=Q),this[d].playbackRate=Q;}},{key:"playState",get:function get(){var Q=this.timeline,et=this[d],it=et.iterations,$=et.duration,K=et.endDelay,rt="running";if(Q==null)rt="idle";else if(Q.paused)rt="paused";else if(Q.currentTime<0)rt="pending";else{var lt=Q.currentTime-it*$;lt>0&<<K?rt="pending":lt>=K&&(rt="finished");}return rt;}},{key:"progress",get:function get(){if(!this.timeline)return 0;var Q=this[d],et=Q.duration,it=Q.iterations,$=this.timeline,K=this.playState,rt=void 0;if(K==="idle")rt=0;else if(K==="paused"&&$.currentTime<0)rt=0;else if(K==="pending"){if($.currentTime<0)rt=0;else{var lt=$.seekLocalTime(it*et);rt=(0,C.periodicity)(lt,et)[1]/et;}}else(K==="running"||K==="paused")&&(rt=(0,C.periodicity)($.currentTime,et)[1]/et);return K==="finished"&&(rt=(0,C.periodicity)(it,1)[1]),rt;}},{key:"frame",get:function get(){var Q=this.playState,et=this[I],it=this[d].fill;if(Q==="idle")return et;var $=this.timeline.currentTime,K=this[v].slice(0),rt=(0,C.getProgress)(this.timeline,this[d],this.progress),lt=rt.p,ct=rt.inverted,gt=et;return $<0&&Q==="pending"?(it==="backwards"||it==="both")&&(gt=ct?K[K.length-1]:K[0]):(Q!=="pending"&&Q!=="finished"||it==="forwards"||it==="both")&&(gt=(0,C.getCurrentFrame)(this[d],K,this[B],lt)),gt;}},{key:"timing",get:function get(){return this[d];}},{key:"effects",get:function get(){return this[B];}},{key:"baseTimeline",set:function set(Q){this[d].timeline=Q;},get:function get(){return this[d].timeline;}},{key:"ready",get:function get(){return this[L]?this[L].promise:this.timeline&&this.timeline.currentTime>=0&&this.playState!=="paused"?n["default"].resolve():(this[L]=(0,C.defer)(),this.timeline&&this[E](),this[L]?this[L].promise:n["default"].resolve());}},{key:"finished",get:function get(){return this.playState==="finished"?n["default"].resolve():(this[w]||(this[w]=(0,C.defer)(),this.timeline&&this[b]()),this[w].promise);}}]),Y;}();e["default"]=R;},/* 191 *//***/function(u,e,t){u.exports={"default":t(192),__esModule:!0};},/* 192 *//***/function(u,e,t){t(143),t(125),t(79),t(193),t(202),t(203),u.exports=t(92).Promise;},/* 193 *//***/function(u,e,t){var r=t(89),n=t(91),s=t(93),l=t(128),o=t(90),a=t(98),c=t(94),y=t(147),f=t(148),g=t(194),x=t(195).set,M=t(197)(),S=t(198),P=t(199),C=t(200),h=t(201),p="Promise",d=n.TypeError,v=n.process,I=v&&v.versions,L=I&&I.v8||"",_w=n[p],B=l(v)=="process",E=function E(){},b,W,D,R,Y=W=S.f,V=!!function(){try{var ct=_w.resolve(1),gt=(ct.constructor={})[t(122)("species")]=function(st){st(E,E);};return(B||typeof PromiseRejectionEvent=="function")&&ct.then(E)instanceof gt&&L.indexOf("6.6")!==0&&C.indexOf("Chrome/66")===-1;}catch(_unused17){}}(),Q=function Q(ct){var gt;return a(ct)&&typeof(gt=ct.then)=="function"?gt:!1;},et=function et(ct,gt){if(!ct._n){ct._n=!0;var st=ct._c;M(function(){for(var Ot=ct._v,St=ct._s==1,F=0,z=function z(Z){var tt=St?Z.ok:Z.fail,j=Z.resolve,H=Z.reject,T=Z.domain,A,U,G;try{tt?(St||(ct._h==2&&K(ct),ct._h=1),tt===!0?A=Ot:(T&&T.enter(),A=tt(Ot),T&&(T.exit(),G=!0)),A===Z.promise?H(d("Promise-chain cycle")):(U=Q(A))?U.call(A,j,H):j(A)):H(Ot);}catch(J){T&&!G&&T.exit(),H(J);}};st.length>F;)z(st[F++]);ct._c=[],ct._n=!1,gt&&!ct._h&&it(ct);});}},it=function it(ct){x.call(n,function(){var gt=ct._v,st=$(ct),Ot,St,F;if(st&&(Ot=P(function(){B?v.emit("unhandledRejection",gt,ct):(St=n.onunhandledrejection)?St({promise:ct,reason:gt}):(F=n.console)&&F.error&&F.error("Unhandled promise rejection",gt);}),ct._h=B||$(ct)?2:1),ct._a=void 0,st&&Ot.e)throw Ot.v;});},$=function $(ct){return ct._h!==1&&(ct._a||ct._c).length===0;},K=function K(ct){x.call(n,function(){var gt;B?v.emit("rejectionHandled",ct):(gt=n.onrejectionhandled)&>({promise:ct,reason:ct._v});});},rt=function rt(ct){var gt=this;gt._d||(gt._d=!0,gt=gt._w||gt,gt._v=ct,gt._s=2,gt._a||(gt._a=gt._c.slice()),et(gt,!0));},_lt3=function lt(ct){var gt=this,st;if(!gt._d){gt._d=!0,gt=gt._w||gt;try{if(gt===ct)throw d("Promise can't be resolved itself");(st=Q(ct))?M(function(){var Ot={_w:gt,_d:!1};try{st.call(ct,s(_lt3,Ot,1),s(rt,Ot,1));}catch(St){rt.call(Ot,St);}}):(gt._v=ct,gt._s=1,et(gt,!1));}catch(Ot){rt.call({_w:gt,_d:!1},Ot);}}};V||(_w=function w(gt){y(this,_w,p,"_h"),c(gt),b.call(this);try{gt(s(_lt3,this,1),s(rt,this,1));}catch(st){rt.call(this,st);}},b=function b(gt){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1;},b.prototype=t(146)(_w.prototype,{// 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
|
|
302
|
+
then:function then(gt,st){var Ot=Y(g(this,_w));return Ot.ok=typeof gt=="function"?gt:!0,Ot.fail=typeof st=="function"&&st,Ot.domain=B?v.domain:void 0,this._c.push(Ot),this._a&&this._a.push(Ot),this._s&&et(this,!1),Ot.promise;},// 25.4.5.1 Promise.prototype.catch(onRejected)
|
|
303
|
+
"catch":function _catch(ct){return this.then(void 0,ct);}}),D=function D(){var ct=new b();this.promise=ct,this.resolve=s(_lt3,ct,1),this.reject=s(rt,ct,1);},S.f=Y=function Y(ct){return ct===_w||ct===R?new D(ct):W(ct);}),o(o.G+o.W+o.F*!V,{Promise:_w}),t(121)(_w,p),t(149)(p),R=t(92)[p],o(o.S+o.F*!V,p,{// 25.4.4.5 Promise.reject(r)
|
|
304
|
+
reject:function reject(gt){var st=Y(this),Ot=st.reject;return Ot(gt),st.promise;}}),o(o.S+o.F*(r||!V),p,{// 25.4.4.6 Promise.resolve(x)
|
|
305
|
+
resolve:function resolve(gt){return h(r&&this===R?_w:this,gt);}}),o(o.S+o.F*!(V&&t(140)(function(ct){_w.all(ct)["catch"](E);})),p,{// 25.4.4.1 Promise.all(iterable)
|
|
306
|
+
all:function all(gt){var st=this,Ot=Y(st),St=Ot.resolve,F=Ot.reject,z=P(function(){var Z=[],tt=0,j=1;f(gt,!1,function(H){var T=tt++,A=!1;Z.push(void 0),j++,st.resolve(H).then(function(U){A||(A=!0,Z[T]=U,--j||St(Z));},F);}),--j||St(Z);});return z.e&&F(z.v),Ot.promise;},// 25.4.4.4 Promise.race(iterable)
|
|
307
|
+
race:function race(gt){var st=this,Ot=Y(st),St=Ot.reject,F=P(function(){f(gt,!1,function(z){st.resolve(z).then(Ot.resolve,St);});});return F.e&&St(F.v),Ot.promise;}});},/* 194 *//***/function(u,e,t){var r=t(97),n=t(94),s=t(122)("species");u.exports=function(l,o){var a=r(l).constructor,c;return a===void 0||(c=r(a)[s])==null?o:n(c);};},/* 195 *//***/function(u,e,t){var r=t(93),n=t(196),s=t(120),l=t(102),o=t(91),a=o.process,c=o.setImmediate,y=o.clearImmediate,f=o.MessageChannel,g=o.Dispatch,x=0,M={},S="onreadystatechange",P,C,h,p=function p(){var v=+this;if(M.hasOwnProperty(v)){var I=M[v];delete M[v],I();}},d=function d(v){p.call(v.data);};(!c||!y)&&(c=function c(I){for(var L=[],w=1;arguments.length>w;)L.push(arguments[w++]);return M[++x]=function(){n(typeof I=="function"?I:Function(I),L);},P(x),x;},y=function y(I){delete M[I];},t(86)(a)=="process"?P=function P(v){a.nextTick(r(p,v,1));}:g&&g.now?P=function P(v){g.now(r(p,v,1));}:f?(C=new f(),h=C.port2,C.port1.onmessage=d,P=r(h.postMessage,h,1)):o.addEventListener&&typeof postMessage=="function"&&!o.importScripts?(P=function P(v){o.postMessage(v+"","*");},o.addEventListener("message",d,!1)):S in l("script")?P=function P(v){s.appendChild(l("script"))[S]=function(){s.removeChild(this),p.call(v);};}:P=function P(v){setTimeout(r(p,v,1),0);}),u.exports={set:c,clear:y};},/* 196 *//***/function(u,e){u.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(u,e,t){var r=t(91),n=t(195).set,s=r.MutationObserver||r.WebKitMutationObserver,l=r.process,o=r.Promise,a=t(86)(l)=="process";u.exports=function(){var c,y,f,g=function g(){var P,C;for(a&&(P=l.domain)&&P.exit();c;){C=c.fn,c=c.next;try{C();}catch(h){throw c?f():y=void 0,h;}}y=void 0,P&&P.enter();};if(a)f=function f(){l.nextTick(g);};else if(s&&!(r.navigator&&r.navigator.standalone)){var x=!0,M=document.createTextNode("");new s(g).observe(M,{characterData:!0}),f=function f(){M.data=x=!x;};}else if(o&&o.resolve){var S=o.resolve(void 0);f=function f(){S.then(g);};}else f=function f(){n.call(r,g);};return function(P){var C={fn:P,next:void 0};y&&(y.next=C),c||(c=C,f()),y=C;};};},/* 198 *//***/function(u,e,t){var r=t(94);function n(s){var l,o;this.promise=new s(function(a,c){if(l!==void 0||o!==void 0)throw TypeError("Bad Promise constructor");l=a,o=c;}),this.resolve=r(l),this.reject=r(o);}u.exports.f=function(s){return new n(s);};},/* 199 *//***/function(u,e){u.exports=function(t){try{return{e:!1,v:t()};}catch(r){return{e:!0,v:r};}};},/* 200 *//***/function(u,e,t){var r=t(91),n=r.navigator;u.exports=n&&n.userAgent||"";},/* 201 *//***/function(u,e,t){var r=t(97),n=t(98),s=t(198);u.exports=function(l,o){if(r(l),n(o)&&o.constructor===l)return o;var a=s.f(l),c=a.resolve;return c(o),a.promise;};},/* 202 *//***/function(u,e,t){var r=t(90),n=t(92),s=t(91),l=t(194),o=t(201);r(r.P+r.R,"Promise",{"finally":function _finally(a){var c=l(this,n.Promise||s.Promise),y=typeof a=="function";return this.then(y?function(f){return o(c,a()).then(function(){return f;});}:a,y?function(f){return o(c,a()).then(function(){throw f;});}:a);}});},/* 203 *//***/function(u,e,t){var r=t(90),n=t(198),s=t(199);r(r.S,"Promise",{"try":function _try(l){var o=n.f(this),a=s(l);return(a.e?o.reject:o.resolve)(a.v),o.promise;}});},/* 204 *//***/function(u,e,t){u.exports={"default":t(205),__esModule:!0};},/* 205 *//***/function(u,e,t){t(206),u.exports=t(92).Object.keys;},/* 206 *//***/function(u,e,t){var r=t(124),n=t(110);t(207)("keys",function(){return function(l){return n(r(l));};});},/* 207 *//***/function(u,e,t){var r=t(90),n=t(92),s=t(101);u.exports=function(l,o){var a=(n.Object||{})[l]||Object[l],c={};c[l]=o(a),r(r.S+r.F*s(function(){a(1);}),"Object",c);};},/* 208 *//***/function(u,e,t){Object.defineProperty(e,"__esModule",{value:!0});var r=t(76),n=M(r),s=t(209),l=M(s),o=t(164),a=M(o),c=t(191),y=M(c);e.defer=S,e.periodicity=P,e.calculateFramesOffset=C,e.getProgress=h,e.getCurrentFrame=d;var f=t(188),g=t(187),x=M(g);function M(v){return v&&v.__esModule?v:{"default":v};}function S(){var v={};return v.promise=new y["default"](function(I,L){v.resolve=I,v.reject=L;}),v;}function P(v,I){var L=Math.floor(v/I),w=v-L*I;return w===0&&L>0&&(w=I,L--),[L,w];}function C(v){v=v.slice(0);var I=v[0],L=v[v.length-1];L.offset=L.offset||1,I.offset=I.offset||0;for(var w=0,B=-1,E=0;E<v.length;E++){var b=v[E];if(b.offset!=null){var W=E-B;if(W>1)for(var D=(b.offset-w)/W,R=0;R<W-1;R++)v[B+R+1].offset=w+D*(R+1);w=b.offset,B=E;}if(b.easing!=null&&(b.easing=(0,f.parseEasing)(b.easing)),E>0){var Y=v[E].easing!=null;v[E]=(0,a["default"])({},v[E-1],v[E]),Y||delete v[E].easing;}}return v;}function h(v,I,L){var w=v.currentTime,B=I.direction,E=I.duration,b=!1;if(B==="reverse")L=1-L,b=!0;else if(B==="alternate"||B==="alternate-reverse"){var W=Math.floor(w/E);L===1&&W--,W%2^B==="alternate-reverse"&&(L=1-L,b=!0);}return{p:L,inverted:b};}function p(v,I,L,w){var B={};return(0,l["default"])(I).forEach(function(E){var b=(0,n["default"])(E,2),W=b[0],D=b[1];if(W!=="offset"&&W!=="easing"){var R=L[W]||L["default"],Y=R(v[W],D,w,v.offset,I.offset);Y!=null&&(B[W]=Y);}}),B;}function d(v,I,L,w){var B=v.easing,E=v.effect;E||(L=(0,a["default"])({},x["default"],L));var b={};w=B(w,I);for(var W=1;W<I.length;W++){var D=I[W],R=D.offset;if(R>=w||W===I.length-1){var Y=I[W-1],V=Y.offset,Q=Y.easing,et=w;if(Q){var it=R-V;et=Q((w-V)/it)*it+V;}E?b=E(Y,D,et,V,R):b=p(Y,D,L,et);break;}}return b;}},/* 209 *//***/function(u,e,t){u.exports={"default":t(210),__esModule:!0};},/* 210 *//***/function(u,e,t){t(211),u.exports=t(92).Object.entries;},/* 211 *//***/function(u,e,t){var r=t(90),n=t(212)(!0);r(r.S,"Object",{entries:function entries(l){return n(l);}});},/* 212 *//***/function(u,e,t){var r=t(100),n=t(110),s=t(84),l=t(169).f;u.exports=function(o){return function(a){for(var c=s(a),y=n(c),f=y.length,g=0,x=[],M;f>g;)M=y[g++],(!r||l.call(c,M))&&x.push(o?[M,c[M]]:c[M]);return x;};};},/* 213 *//***/function(u,e,t){t.r(e),t(1).glMatrix.setMatrixArrayType(Array);var r=/* @__PURE__ */new Map();function n(l){var o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var a=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];l=l.toLowerCase();var c=r.get(l);if(!c)throw new TypeError("Invalid node: ".concat(l));var y=new c(o);return a.forEach(function(f){y.appendChild(f);}),y;}var s={registerNode:function registerNode(l,o){var a=arguments.length>2&&arguments[2]!==undefined?arguments[2]:100;if(o=o.toLowerCase(),r.has(o))throw new TypeError("Cannot registerNode, ".concat(o," has been taken."));r.set(o,l),Object.defineProperties(l.prototype,{nodeType:{value:a},tagName:{value:o.toUpperCase()},nodeName:{value:o},ownerDocument:{value:s},namespaceURI:{value:"http://spritejs.com/".concat(o)}});},createElement:n,createElementNS:function createElementNS(l,o){return n(o);},isSpriteNode:function isSpriteNode(l){return r.has(l.toLowerCase());}};e["default"]=s;},/* 214 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return o;}),t(1).glMatrix.setMatrixArrayType(Array);var r=Symbol("type"),n=Symbol("bubbles"),s=Symbol("originalEvent"),l=Symbol("detail");var o=/*#__PURE__*/function(){function o(c){var _ref115=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref115$bubbles=_ref115.bubbles,y=_ref115$bubbles===void 0?null:_ref115$bubbles;_classCallCheck(this,o);if(typeof c=="string"?(this[r]=c,this[n]=!!y):(this[r]=c.type,this[s]=c,this[n]=y!=null?!!y:!!c.bubbles,c.detail&&(this[l]=c.detail)),!this[r])throw new TypeError("Invalid event type.");this.cancelBubble=!1;}return _createClass(o,[{key:"setOriginalEvent",value:function setOriginalEvent(c){this[s]=c;}},{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[l];}},{key:"stopPropagation",value:function stopPropagation(){this.cancelBubble=!0;}}]);}();},/* 215 *//***/function(u,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(l){if(l=l.trim(),!l||l==="none")return null;var o=/^(?:(url|blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\(([^()]*(?:\(.*\))*[^()]*)\))+$/i,a=l.match(/(?:(url|blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\(([^()]*(?:\(.*\))*[^()]*)\))+?/ig),c=[];return a&&a.forEach(function(y){var f=y.match(o);if(!f)throw new TypeError("Invalid fitler string.");var _f3=_slicedToArray(f,3),g=_f3[1],x=_f3[2];g=g.toLowerCase(),x=x.trim().match(/([^( )]+|([^( )]+\(.*\)))(?=\s|$)/g).map(function(M,S){var P;return g==="url"||g==="drop-shadow"&&S===3?P=M:P=Object(r.toNumber)(M),/%$/.test(M)&&(P/=100),P;}),c.push({type:g,args:x});}),c;}function s(l,o){l.clearFilter(),o&&o.forEach(function(_ref116){var a=_ref116.type,c=_ref116.args;var y=a;y==="drop-shadow"?y="dropShadow":y==="hue-rotate"&&(y="hueRotate"),l[y].apply(l,_toConsumableArray(c));});}},/* 216 *//***/function(u,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 l=n.getListeners("beforerender"),o=n.getListeners("afterrender");l.length&&!s.beforeRender?s.beforeRender=function(a){n.dispatchEvent({type:"beforerender",detail:{context:a}});}:l.length||(s.beforeRender=null),o.length&&!s.afterRender?s.afterRender=function(a){n.dispatchEvent({type:"afterrender",detail:{context:a}});}:o.length||(s.afterRender=null);}},/* 217 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return c;});var r=t(12),n=t(218),s=t(70),l=t(213);t(1).glMatrix.setMatrixArrayType(Array);var o=Symbol("amount"),a=Symbol("meshCloud");var c=/*#__PURE__*/function(_s$default){function c(f){var _this28;var g=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;_classCallCheck(this,c);_this28=_callSuper(this,c),_this28.meshNode=f,f.connect(_assertThisInitialized(_this28)),_this28[o]=g,_this28[a]=null;return _this28;}_inherits(c,_s$default);return _createClass(c,[{key:"meshCloud",get:function get(){var f=this.meshNode,g=this[o];return!this[a]&&f.mesh&&(this[a]=new r.MeshCloud(f.mesh,g)),this[a];}/* override */},{key:"isVisible",get:function get(){return!!this.meshNode&&this.meshNode.isVisible;}},{key:"amount",get:function get(){return this[o];},set:function set(f){this[o]=f,this[a]&&(this[a].amount=f);}},{key:"brightness",value:function brightness(f,g){this.meshCloud&&(this.meshCloud.brightness(f,g),this.forceUpdate());}},{key:"contrast",value:function contrast(f,g){this.meshCloud&&(this.meshCloud.contrast(f,g),this.forceUpdate());}},{key:"delete",value:function _delete(f){this.meshCloud&&(this.meshCloud["delete"](f),this[o]--,this.forceUpdate());}/* override */},{key:"draw",value:function draw(){var _this29=this;var f=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];if(_superPropGet(c,"draw",this,3)([f]),this.meshCloud){if(this.program){this.meshCloud.setProgram(this.program);var g=this.shaderAttrs;g&&Object.entries(g).forEach(function(_ref117){var _ref118=_slicedToArray(_ref117,2),M=_ref118[0],S=_ref118[1];_this29.meshCloud.mesh.setAttribute(M,S);});var x=this.uniforms;if(this.uniforms){var M={};Object.entries(x).forEach(function(_ref119){var _ref120=_slicedToArray(_ref119,2),S=_ref120[0],P=_ref120[1];typeof P=="function"&&(P=P(_this29,S)),M[S]=P;}),this.meshCloud.mesh.setUniforms(M);}}this.meshNode.textureImage&&Object(n.drawTexture)(this.meshNode,this.meshNode.mesh),f.push(this.meshCloud);}return f;}},{key:"getTransform",value:function getTransform(f){if(this.meshCloud)return this.meshCloud.getTransform(f);}},{key:"grayscale",value:function grayscale(f,g){this.meshCloud&&(this.meshCloud.grayscale(f,g),this.forceUpdate());}},{key:"hueRotate",value:function hueRotate(f,g){this.meshCloud&&(this.meshCloud.hueRotate(f,g),this.forceUpdate());}},{key:"invert",value:function invert(f,g){this.meshCloud&&(this.meshCloud.invert(f,g),this.forceUpdate());}/* override */},{key:"isPointCollision",value:function isPointCollision(f,g){if(!this.meshCloud)return!1;var x=this.attributes.pointerEvents;if(x==="none"||x!=="all"&&!this.isVisible)return!1;var M="both";x==="visibleFill"&&(M="fill"),x==="visibleStroke"&&(M="stroke");for(var S=0;S<this[o];S++)if(!this.meshCloud.isPointCollision(S,[f,g],M))return!1;return!0;}},{key:"setOpacity",value:function setOpacity(f,g){this.meshCloud&&(this.meshCloud.opacity(f,g),this.forceUpdate());}},{key:"rotate",value:function rotate(f,g){var _ref121=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref122=_slicedToArray(_ref121,2),x=_ref122[0],M=_ref122[1];var S=Math.PI*g/180;if(this.meshCloud){var _this$meshNode$attrib=this.meshNode.attributes,P=_this$meshNode$attrib.x,_C12=_this$meshNode$attrib.y;this.meshCloud.rotate(f,S,[x+P,M+_C12]),this.forceUpdate();}}},{key:"saturate",value:function saturate(f,g){this.meshCloud&&(this.meshCloud.saturate(f,g),this.forceUpdate());}},{key:"scale",value:function scale(f,_ref123){var _ref124=_slicedToArray(_ref123,2),g=_ref124[0],_ref124$=_ref124[1],x=_ref124$===void 0?g:_ref124$;var _ref125=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref126=_slicedToArray(_ref125,2),M=_ref126[0],S=_ref126[1];if(this.meshCloud){var _this$meshNode$attrib2=this.meshNode.attributes,P=_this$meshNode$attrib2.x,_C13=_this$meshNode$attrib2.y,_h12=1e-5;Math.abs(g)<_h12&&(g=1/g>0?_h12:-_h12),Math.abs(x)<_h12&&(x=1/x>0?_h12:-_h12),this.meshCloud.scale(f,[g,x],[M+P,S+_C13]),this.forceUpdate();}}},{key:"setColorTransform",value:function setColorTransform(f,g){this.meshCloud&&(this.meshCloud.setColorTransform(f,g),this.forceUpdate());}},{key:"setFillColor",value:function setFillColor(f,g){this.meshCloud&&(Array.isArray(g)&&(g=_toConsumableArray(g),g[0]/=255,g[1]/=255,g[2]/=255),this.meshCloud.setFillColor(f,g),this.forceUpdate());}},{key:"sepia",value:function sepia(f,g){this.meshCloud&&(this.meshCloud.sepia(f,g),this.forceUpdate());}/* override */},{key:"setResolution",value:function setResolution(_ref127){var f=_ref127.width,g=_ref127.height;_superPropGet(c,"setResolution",this,3)([{width:f,height:g}]),this.meshNode.setResolution({width:f,height:g});}},{key:"setStrokeColor",value:function setStrokeColor(f,g){this.meshCloud&&(Array.isArray(g)&&(g=_toConsumableArray(g),g[0]/=255,g[1]/=255,g[2]/=255),this.meshCloud.setStrokeColor(f,g),this.forceUpdate());}},{key:"setTransform",value:function setTransform(f,g){this.meshCloud&&(this.meshCloud.setTransform(f,g),this.forceUpdate());}},{key:"skew",value:function skew(f,_ref128){var _ref129=_slicedToArray(_ref128,2),g=_ref129[0],_ref129$=_ref129[1],x=_ref129$===void 0?g:_ref129$;var _ref130=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref131=_slicedToArray(_ref130,2),M=_ref131[0],S=_ref131[1];if(this.meshCloud){var _this$meshNode$attrib3=this.meshNode.attributes,P=_this$meshNode$attrib3.x,_C14=_this$meshNode$attrib3.y;this.meshCloud.skew(f,[g,x],[M+P,S+_C14]),this.forceUpdate();}}},{key:"transform",value:function transform(f,g){this.meshCloud&&(this.meshCloud.transform(f,g),this.forceUpdate());}},{key:"transformColor",value:function transformColor(f,g){this.meshCloud&&(this.meshCloud.transformColor(f,g),this.forceUpdate());}},{key:"translate",value:function translate(f,_ref132){var _ref133=_slicedToArray(_ref132,2),g=_ref133[0],x=_ref133[1];this.meshCloud&&(this.meshCloud.translate(f,[g,x]),this.forceUpdate());}},{key:"updateMesh",value:function updateMesh(){this[a]&&(this[a].mesh=this.meshNode.mesh,this.forceUpdate());}}]);}(s["default"]);l["default"].registerNode(c,"cloud");},/* 218 *//***/function(u,e,t){t.r(e),t.d(e,"loadTexture",function(){return l;}),t.d(e,"applyTexture",function(){return o;}),t.d(e,"createTexture",function(){return c;}),t.d(e,"deleteTexture",function(){return y;}),t.d(e,"drawTexture",function(){return g;}),t.d(e,"loadFrames",function(){return x;});var r=t(12),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var s={};function l(M,S){if(s[M])return s[M];var P=r.ENV.loadImage(M,{alias:S,useImageBitmap:!1});return P!==null&&P!==void 0?P:M;}function o(_x22,_x23,_x24){return _o2.apply(this,arguments);}function _o2(){_o2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee18(M,S,P){var C,_M$attributes,_h13,p,d,v;return _regeneratorRuntime().wrap(function _callee18$(_context18){while(1)switch(_context18.prev=_context18.next){case 0:C=S;typeof S=="string"&&(C=l(S));_context18.t0=C&&typeof C.then=="function";if(!_context18.t0){_context18.next=7;break;}_context18.next=6;return C;case 6:C=_context18.sent;case 7:if(!(S===M.attributes.texture)){_context18.next=11;break;}C&&C.image&&(C.sourceRect&&(M.attributes.sourceRect=C.sourceRect),M.textureImageRotated=!!C.rotated,C=C.image);_M$attributes=M.attributes,_h13=_M$attributes.width,p=_M$attributes.height,d=_M$attributes.textureRect,v=M.textureImage;M.textureImage=C,P&&v!==C&&!d&&(_h13==null||p==null)&&M.updateContours(),M.forceUpdate();case 11:return _context18.abrupt("return",C);case 12:case"end":return _context18.stop();}},_callee18);}));return _o2.apply(this,arguments);}var a=Symbol("textureMap");function c(M,S){if(S[a]=S[a]||/* @__PURE__ */new Map(),S[a].has(M))return S[a].get(M);var P=S.createTexture(M);return!/^blob:/.test(M.src)&&typeof M.getContext!="function"&&S[a].set(M,P),P;}function y(M,S){if(S[a]&&S[a].has(M)){var P=S[a].get(M);return S.deleteTexture(P),S[a]["delete"](M),!0;}return!1;}var f=Symbol("textureContext");function g(M,S){var P=M.textureImage instanceof String?String(M.textureImage):M.textureImage,C=M.textureImageRotated,h=S.texture,p=M.renderer;if(P){var d=M.originalContentRect;var v=M.attributes.textureRect;var I=M.attributes.textureRepeat,L=M.attributes.sourceRect;if(!h||M[f]&&M[f]!==p||h.image!==P||h.options.repeat!==I||!Object(n.compareValue)(h.options.rect,v)||!Object(n.compareValue)(h.options.srcRect,L)){var w=c(P,p);v?(v[0]+=d[0],v[1]+=d[1]):v=d;var B=null;h&&!p[a].has(h.image)&&(!h.options||!h.options.hidden)&&(B=S.uniforms.u_texSampler),S.setTexture(w,{rect:v,repeat:I,srcRect:L,rotated:C}),B&&B["delete"]&&B["delete"](),M[f]=p;}}else if(h){var _d8=null;!p[a].has(h.image)&&(!h.options||!h.options.hidden)&&(_d8=S.uniforms.u_texSampler),S.setTexture(null),_d8&&_d8["delete"]&&_d8["delete"]();}}function x(_x25,_x26){return _x27.apply(this,arguments);}function _x27(){_x27=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee19(M,S){var P,C;return _regeneratorRuntime().wrap(function _callee19$(_context19){while(1)switch(_context19.prev=_context19.next){case 0:_context19.t0=typeof S=="string";if(!_context19.t0){_context19.next=7;break;}_context19.next=4;return fetch(S,{method:"GET",mode:"cors",cache:"default"});case 4:_context19.next=6;return _context19.sent.json();case 6:S=_context19.sent;case 7:_context19.next=9;return l(M);case 9:P=_context19.sent;C=S.frames;return _context19.abrupt("return",(Object.entries(C).forEach(function(_ref134){var _ref135=_slicedToArray(_ref134,2),h=_ref135[0],p=_ref135[1];var _p$frame=p.frame,d=_p$frame.x,v=_p$frame.y,I=_p$frame.w,L=_p$frame.h;var w=[d,v,I,L];var B=p.rotated;B&&(w=[w[0],w[1],w[3],w[2]]),s[h]={image:P,sourceRect:w,rotated:B};}),P));case 12:case"end":return _context19.stop();}},_callee19);}));return _x27.apply(this,arguments);}},/* 219 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return x;});var r=t(1),n=t(12),s=t(70),l=t(220),o=t(221),a=t(222),c=t(213),y=t(223);t(1).glMatrix.setMatrixArrayType(Array);function f(M,S,P){return S in M?Object.defineProperty(M,S,{value:P,enumerable:!0,configurable:!0,writable:!0}):M[S]=P,M;}var g=Symbol("mesh");var x=/*#__PURE__*/function(_s$default2){function x(){var S=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,x);return _callSuper(this,x,[S]);}_inherits(x,_s$default2);return _createClass(x,[{key:"borderSize",get:function get(){var _this$attributes2=this.attributes,S=_this$attributes2.paddingTop,P=_this$attributes2.paddingRight,C=_this$attributes2.paddingBottom,h=_this$attributes2.paddingLeft,p=_this$attributes2.borderWidth,_this$contentSize=_slicedToArray(this.contentSize,2),d=_this$contentSize[0],v=_this$contentSize[1];return[h+d+P+p,S+v+C+p];}// content + padding
|
|
308
|
+
},{key:"clientSize",get:function get(){var _this$attributes3=this.attributes,S=_this$attributes3.paddingTop,P=_this$attributes3.paddingRight,C=_this$attributes3.paddingBottom,h=_this$attributes3.paddingLeft,_this$contentSize2=_slicedToArray(this.contentSize,2),p=_this$contentSize2[0],d=_this$contentSize2[1];return[h+p+P,S+d+C];}},{key:"contentSize",get:function get(){var _this$attributes4=this.attributes,S=_this$attributes4.width,P=_this$attributes4.height,C=_this$attributes4.boxSizing,h=_this$attributes4.paddingTop,p=_this$attributes4.paddingRight,d=_this$attributes4.paddingBottom,v=_this$attributes4.paddingLeft;if(S=S||0,P=P||0,C==="border-box"){var I=2*this.attributes.borderWidth;S-=I+p+v,P-=I+h+d,S=Math.max(0,S),P=Math.max(0,P);}return[S,P];}},{key:"hasBorder",get:function get(){return this.attributes.borderWidth>0;}/* override */},{key:"isVisible",get:function get(){var _this$borderSize=_slicedToArray(this.borderSize,2),S=_this$borderSize[0],P=_this$borderSize[1];return S>0&&P>0;}},{key:"mesh",get:function get(){if(this.attributes.display==="none")return null;var S=this.clientBox;if(S){var _P5;var P=this[g];if(P)P.box!==S&&(P.contours=S.contours,P.box=S);else{P=new n.Mesh2D(S),P.box=S;var _h14=this.attributes.bgcolor;if(Object(o.setFillColor)(P,{color:_h14}),this.hasBorder){var _this$attributes5=this.attributes,d=_this$attributes5.borderColor,v=_this$attributes5.borderWidth,I=_this$attributes5.borderDash,L=_this$attributes5.borderDashOffset;Object(o.setStrokeColor)(P,{color:d,lineWidth:v,lineDash:I,lineDashOffset:L});}this[g]=P;var p=this.attributes.clipPath;p&&this[g].setClipPath(p);}var _C15=this.opacity;return P.getOpacity()!==_C15&&P.setOpacity(_C15),(_P5=P).setTransform.apply(_P5,_toConsumableArray(this.renderMatrix)),P;}return null;}// content + padding + border
|
|
309
|
+
},{key:"offsetSize",get:function get(){var _this$attributes6=this.attributes,S=_this$attributes6.paddingTop,P=_this$attributes6.paddingRight,C=_this$attributes6.paddingBottom,h=_this$attributes6.paddingLeft,p=_this$attributes6.borderWidth,_this$contentSize3=_slicedToArray(this.contentSize,2),d=_this$contentSize3[0],v=_this$contentSize3[1],I=2*p;return[h+d+P+I,S+v+C+I];}},{key:"originalClientRect",get:function get(){if(this.mesh){var S=this.mesh.boundingBox;return[S[0][0],S[0][1],S[1][0]-S[0][0],S[1][1]-S[0][1]];}return[0,0,0,0];}},{key:"originalContentRect",get:function get(){var _this$originalClientR=_slicedToArray(this.originalClientRect,4),S=_this$originalClientR[0],P=_this$originalClientR[1],C=_this$originalClientR[2],h=_this$originalClientR[3],p=this.attributes.padding;return[S+p[0],P+p[1],C-p[0]-p[2],h-p[1]-p[3]];}},{key:"getBoundingClientRect",value:function getBoundingClientRect(){var S=this.renderMatrix;this.layer&&this.layer.layerTransformInvert&&(S=r.mat2d.multiply(Array.of(0,0,0,0,0,0),this.layer.transformMatrix,S));var P=null;if(this.mesh){P=_toConsumableArray(this.mesh.boundingBox);var _C16=this.attributes.borderWidth;_C16&&(P[0]=[P[0][0]-_C16,P[0][1]-_C16],P[1]=[P[1][0]+_C16,P[1][1]+_C16]);}return Object(y["default"])(P,S);}// transformPoint(x, y) {
|
|
310
|
+
// const m = mat2d.invert(this.renderMatrix);
|
|
311
|
+
// const newX = x * m[0] + y * m[2] + m[4];
|
|
312
|
+
// const newY = x * m[1] + y * m[3] + m[5];
|
|
313
|
+
// return [newX, newY];
|
|
314
|
+
// }
|
|
315
|
+
/* override */},{key:"onPropertyChange",value:function onPropertyChange(S,P,C){if(_superPropGet(x,"onPropertyChange",this,3)([S,P,C]),(S==="anchorX"||S==="anchorY"||S==="boxSizing"||S==="width"||S==="height"||S==="borderWidth"||S==="paddingLeft"||S==="paddingRight"||S==="paddingTop"||S==="paddingBottom"||/^border(TopLeft|TopRight|BottomRight|BottomLeft)Radius$/.test(S))&&this.updateContours(),this[g]&&S==="clipPath"&&this[g].setClipPath(P),this[g]&&S==="bgcolor"&&Object(o.setFillColor)(this[g],{color:P}),this[g]&&(S==="borderColor"||S==="borderWidth"||S==="borderDash"||S==="borderDashOffset")){var _this$attributes7=this.attributes,_h15=_this$attributes7.borderColor,p=_this$attributes7.borderWidth,d=_this$attributes7.borderDash,v=_this$attributes7.borderDashOffset;Object(o.setStrokeColor)(this[g],{color:_h15,lineWidth:p,lineDash:p?d:0,lineDashOffset:v});}}/* override */},{key:"updateContours",value:function updateContours(){var _this$attributes8=this.attributes,S=_this$attributes8.anchorX,P=_this$attributes8.anchorY,C=_this$attributes8.borderWidth,h=_this$attributes8.borderRadius,_this$borderSize2=_slicedToArray(this.borderSize,2),p=_this$borderSize2[0],d=_this$borderSize2[1],v=this.offsetSize,I=0.5*C,L=-S*v[0]+I,w=-P*v[1]+I;this.clientBox=new n.Figure2D(),Object(a.createRadiusBox)(this.clientBox,[L,w,p,d],h);}}]);}(s["default"]);f(x,"Attr",l["default"]),c["default"].registerNode(x,"block");},/* 220 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return y;});var r=t(71),n=t(72),s=t(221);t(1).glMatrix.setMatrixArrayType(Array);var l=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute"),a=Symbol["for"]("spritejs_setAttributeDefault"),c=Symbol["for"]("spritejs_declareAlias");var y=/*#__PURE__*/function(_r$default){function y(g){var _this30;_classCallCheck(this,y);_this30=_callSuper(this,y,[g]),_this30[a]({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}),_this30[c]("anchor","size","border","borderRadius","padding");return _this30;}_inherits(y,_r$default);return _createClass(y,[{key:"anchorX",get:function get(){return this[o]("anchorX");},set:function set(g){this[l]("anchorX",Object(n.toNumber)(g));}},{key:"anchorY",get:function get(){return this[o]("anchorY");},set:function set(g){this[l]("anchorY",Object(n.toNumber)(g));}},{key:"anchor",get:function get(){return[this.anchorX,this.anchorY];},set:function set(g){g=Object(n.toArray)(g),Array.isArray(g)||(g=[g,g]),this.anchorX=g[0],this.anchorY=g[1];}},{key:"width",get:function get(){return this[o]("width");},set:function set(g){this[l]("width",Object(n.toNumber)(g));}},{key:"height",get:function get(){return this[o]("height");},set:function set(g){this[l]("height",Object(n.toNumber)(g));}},{key:"size",get:function get(){return[this.width,this.height];},set:function set(g){g=Object(n.toArray)(g),Array.isArray(g)||(g=[g,g]),this.width=g[0],this.height=g[1];}},{key:"borderWidth",get:function get(){return this[o]("borderWidth");},set:function set(g){this[l]("borderWidth",Object(n.toNumber)(g));}},{key:"borderColor",get:function get(){return this[o]("borderColor");},set:function set(g){this[l]("borderColor",Object(s.parseColor)(g));}},{key:"border",get:function get(){return[this.borderWidth,this.borderColor];},set:function set(g){g=Object(n.toArray)(g),Array.isArray(g)||(g=[g]),this.borderWidth=g[0],g[1]!=null&&(this.borderColor=g[1]);}},{key:"borderDash",get:function get(){return this[o]("borderDash");},set:function set(g){g=Object(n.toArray)(g,!0),g!=null&&!Array.isArray(g)&&(g=[g]),this[l]("borderDash",g?g.map(n.toNumber):null);}},{key:"borderDashOffset",get:function get(){return this[o]("borderDashOffset");},set:function set(g){this[l]("borderDashOffset",Object(n.toNumber)(g));}},{key:"borderTopLeftRadius",get:function get(){return this[o]("borderTopLeftRadius");},set:function set(g){g=Object(n.toArray)(g,!0),Array.isArray(g)||(g=[g,g]),this[l]("borderTopLeftRadius",g.map(n.toNumber));}},{key:"borderTopRightRadius",get:function get(){return this[o]("borderTopRightRadius");},set:function set(g){g=Object(n.toArray)(g,!0),Array.isArray(g)||(g=[g,g]),this[l]("borderTopRightRadius",g.map(n.toNumber));}},{key:"borderBottomRightRadius",get:function get(){return this[o]("borderBottomRightRadius");},set:function set(g){g=Object(n.toArray)(g,!0),Array.isArray(g)||(g=[g,g]),this[l]("borderBottomRightRadius",g.map(n.toNumber));}},{key:"borderBottomLeftRadius",get:function get(){return this[o]("borderBottomLeftRadius");},set:function set(g){g=Object(n.toArray)(g,!0),Array.isArray(g)||(g=[g,g]),this[l]("borderBottomLeftRadius",g.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(g){if(g=Object(n.toArray)(g),!Array.isArray(g))g=Array(8).fill(g);else if(g.length===2)g=[g[0],g[1],g[0],g[1],g[0],g[1],g[0],g[1]];else if(g.length===4)g=[g[0],g[1],g[2],g[3],g[0],g[1],g[2],g[3]];else if(g.length===6)g=[g[0],g[1],g[2],g[3],g[4],g[5],g[2],g[3]];else if(g.length!==8)throw new TypeError("Invalid borderRadius value.");this.borderTopLeftRadius=[g[0],g[1]],this.borderTopRightRadius=[g[2],g[3]],this.borderBottomRightRadius=[g[4],g[5]],this.borderBottomLeftRadius=[g[6],g[7]];}},{key:"bgcolor",get:function get(){return this[o]("bgcolor");},set:function set(g){this[l]("bgcolor",Object(s.parseColor)(g));}},{key:"paddingTop",get:function get(){return this[o]("paddingTop");},set:function set(g){this[l]("paddingTop",Object(n.toNumber)(g));}},{key:"paddingRight",get:function get(){return this[o]("paddingRight");},set:function set(g){this[l]("paddingRight",Object(n.toNumber)(g));}},{key:"paddingBottom",get:function get(){return this[o]("paddingBottom");},set:function set(g){this[l]("paddingBottom",Object(n.toNumber)(g));}},{key:"paddingLeft",get:function get(){return this[o]("paddingLeft");},set:function set(g){this[l]("paddingLeft",Object(n.toNumber)(g));}},{key:"padding",get:function get(){return[this.paddingTop,this.paddingRight,this.paddingBottom,this.paddingLeft];},set:function set(g){g=Object(n.toArray)(g),Array.isArray(g)?g.length===2?g=[g[0],g[1],g[0],g[1]]:g.length===3&&(g=[g[0],g[1],g[2],g[1]]):g=[g,g,g,g],this.paddingTop=g[0],this.paddingRight=g[1],this.paddingBottom=g[2],this.paddingLeft=g[3];}},{key:"clipPath",get:function get(){return this[o]("clipPath");},set:function set(g){this[l]("clipPath",g);}},{key:"boxSizing",get:function get(){return this[o]("boxSizing");},set:function set(g){if(g!=null&&g!=="border-box"&&g!=="content-box")throw new TypeError("Invalid boxSizing type.");this[l]("boxSizing",g);}}]);}(r["default"]);},/* 221 *//***/function(u,e,t){t.r(e),t.d(e,"Gradient",function(){return s;}),t.d(e,"isTransparent",function(){return l;}),t.d(e,"parseColor",function(){return o;}),t.d(e,"setFillColor",function(){return c;}),t.d(e,"setStrokeColor",function(){return y;}),t.d(e,"Color",function(){return f;});var r=t(32),n=/* @__PURE__ */t.n(r);t(1).glMatrix.setMatrixArrayType(Array);var s=/*#__PURE__*/function(){function s(_ref136){var x=_ref136.vector,M=_ref136.colors;_classCallCheck(this,s);if(!Array.isArray(x)||x.length!==4&&x.length!==6&&x.length!==3)throw new TypeError("Invalid gradient");this.vector=x,this.colors=M.map(function(_ref137){var S=_ref137.offset,P=_ref137.color;return{offset:S,color:o(P)};});}return _createClass(s,[{key:"toString",value:function toString(){return JSON.stringify({vector:this.vector,colors:this.colors});}}]);}();function l(g){return g instanceof s?!1:g==null?!0:n()(g)[3]===0;}function o(g){if(g==null||(g||(g="transparent"),g instanceof s))return g;var x=n()(g);if(!x||!x.length)throw new TypeError("Invalid color value.");return"rgba(".concat(x.join(),")");}function a(g,x,M){var S=g.boundingBox[0];if(M.vector){var P=M.vector,_C17=M.colors;P.length===4?(P=[P[0]+S[0],P[1]+S[1],P[2]+S[0],P[3]+S[1]],g.setLinearGradient({vector:P,colors:_C17,type:x})):P.length===3?(P=[P[0]+S[0],P[1]+S[1],P[2]],g.setCircularGradient({vector:P,colors:_C17,type:x})):(P=[P[0]+S[0],P[1]+S[1],P[2],P[3]+S[0],P[4]+S[1],P[5]],g.setRadialGradient({vector:P,colors:_C17,type:x}));}else g.gradient&&g.gradient[x]&&(delete g.gradient[x],delete g.uniforms.u_radialGradientVector);}function c(g,_ref138){var x=_ref138.color,_ref138$rule=_ref138.rule,M=_ref138$rule===void 0?"nonzero":_ref138$rule;return a(g,"fill",x),x.vector||g.setFill({color:x,rule:M}),g;}function y(g,_ref139){var x=_ref139.color,M=_ref139.lineWidth,S=_ref139.lineCap,P=_ref139.lineJoin,C=_ref139.lineDash,h=_ref139.lineDashOffset,p=_ref139.miterLimit,d=_ref139.roundSegments;a(g,"stroke",x),x.vector&&(x=[0,0,0,1]),g.setStroke({color:x,thickness:M,cap:S,join:P,miterLimit:p,lineDash:C,lineDashOffset:h,roundSegments:d});}var f=/*#__PURE__*/function(_Array){function f(){var _x28,_x29,_n2,_n3;var _this31;var x=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var M=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var S=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var P=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;_classCallCheck(this,f);return _possibleConstructorReturn(_this31,(Array.isArray(x)&&(_x28=x,_x29=_slicedToArray(_x28,4),x=_x29[0],M=_x29[1],S=_x29[2],P=_x29[3],_x28),typeof x=="string"&&(_n2=n()(x),_n3=_slicedToArray(_n2,4),x=_n3[0],M=_n3[1],S=_n3[2],P=_n3[3],x/=255,M/=255,S/=255),_this31=_callSuper(this,f,[x,M,S,P]),_assertThisInitialized(_this31)));}_inherits(f,_Array);return _createClass(f,[{key:"r",get:function get(){return Math.round(this[0]*255);},set:function set(x){this[0]=x/255;}},{key:"g",get:function get(){return Math.round(this[1]*255);},set:function set(x){this[1]=x/255;}},{key:"b",get:function get(){return Math.round(this[2]*255);},set:function set(x){this[2]=x/255;}},{key:"a",get:function get(){return this[3];},set:function set(x){this[3]=x;}},{key:"hex",get:function get(){var x="0".concat(this.r.toString(16)).slice(-2),M="0".concat(this.g.toString(16)).slice(-2),S="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(x).concat(M).concat(S).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(x){return typeof x=="string"&&(x=n()(x),x[0]/=255,x[1]/=255,x[2]/=255),this[0]=x[0],this[1]=x[1],this[2]=x[2],this[3]=x[3],this;}}]);}(/*#__PURE__*/_wrapNativeSuper(Array));},/* 222 *//***/function(u,e,t){t.r(e),t.d(e,"createRadiusBox",function(){return n;}),t(1).glMatrix.setMatrixArrayType(Array);function r(s,l,o,a,c){var y=arguments.length>5&&arguments[5]!==undefined?arguments[5]:"leftTop";var f=0.5522848,g=a/2*f,x=c/2*f,M=l+a,S=o+c,P=l+a/2,C=o+c/2;y==="leftTop"?(s.moveTo(l,C),s.bezierCurveTo(l,C-x,P-g,o,P,o)):y==="rightTop"?s.bezierCurveTo(P+g,o,M,C-x,M,C):y==="rightBottom"?s.bezierCurveTo(M,C+x,P+g,S,P,S):y==="leftBottom"&&s.bezierCurveTo(P-g,S,l,C+x,l,C);}function n(s,_ref140,y){var _ref141=_slicedToArray(_ref140,4),l=_ref141[0],o=_ref141[1],a=_ref141[2],c=_ref141[3];if(!y||Array.isArray(y)&&y.every(function(f){return f===0;}))s.beginPath(),s.rect(l,o,a,c);else{typeof y=="number"&&(y=Array(8).fill(y));var _y$map=y.map(function(p,d){return d%2?Math.min(p,c/2):Math.min(p,a/2);}),_y$map2=_slicedToArray(_y$map,8),f=_y$map2[0],g=_y$map2[1],x=_y$map2[2],M=_y$map2[3],S=_y$map2[4],P=_y$map2[5],_C18=_y$map2[6],_h16=_y$map2[7];s.beginPath(),s.moveTo(l,o+g),r(s,l,o,f*2,g*2,"leftTop"),s.lineTo(l+a-x,o),r(s,l+a-x*2,o,x*2,M*2,"rightTop"),s.lineTo(l+a,o+c-P),r(s,l+a-S*2,o+c-P*2,S*2,P*2,"rightBottom"),s.lineTo(l+_C18,o+c),r(s,l,o+c-_h16*2,_C18*2,_h16*2,"leftBottom"),s.closePath();}return s;}},/* 223 *//***/function(u,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],l=_r2$[1],_r2$2=_slicedToArray(_r2[1],2),o=_r2$2[0],a=_r2$2[1],c=s*n[0]+l*n[2]+n[4],y=s*n[1]+l*n[3]+n[5],f=o*n[0]+l*n[2]+n[4],g=o*n[1]+l*n[3]+n[5],x=o*n[0]+a*n[2]+n[4],M=o*n[1]+a*n[3]+n[5],S=s*n[0]+a*n[2]+n[4],P=s*n[1]+a*n[3]+n[5],C=Math.min(c,f,x,S),h=Math.min(y,g,M,P),p=Math.max(c,f,x,S),d=Math.max(y,g,M,P);return{x:C,y:h,width:p-C,height:d-h,left:C,top:h,right:p,bottom:d};};},/* 224 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return c;});var r=t(218),n=t(219),s=t(225),l=t(213);t(1).glMatrix.setMatrixArrayType(Array);function o(y,f,g){return f in y?Object.defineProperty(y,f,{value:g,enumerable:!0,configurable:!0,writable:!0}):y[f]=g,y;}var a=Symbol("textureTask");var c=/*#__PURE__*/function(_n$default){function c(){var _this32;var f=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,c);typeof f=="string"&&(f={texture:f}),_this32=_callSuper(this,c,[f]);return _this32;}/* override */_inherits(c,_n$default);return _createClass(c,[{key:"contentSize",get:function get(){var _superPropGet2=_superPropGet(c,"contentSize",this,1),_superPropGet3=_slicedToArray(_superPropGet2,2),f=_superPropGet3[0],g=_superPropGet3[1];var _this$attributes9=this.attributes,x=_this$attributes9.width,M=_this$attributes9.height;if(x==null||M==null){var S=this.textureImage,P=this.attributes.textureRect,_C19=this.attributes.sourceRect;if(P)x==null&&(f=P[0]+P[2]),M==null&&(g=P[1]+P[3]);else if(_C19){var _h17=this.layer?this.layer.displayRatio:1;x==null&&(f=_C19[2]/_h17),M==null&&(g=_C19[3]/_h17);}else if(S){var _h18=this.layer?this.layer.displayRatio:1;x==null&&(f=S.width/_h18),M==null&&(g=S.height/_h18);}}return[f,g];}},{key:"textureImageReady",get:function get(){return this[a]||Promise.resolve();}/* override */},{key:"draw",value:function draw(){var f=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];_superPropGet(c,"draw",this,3)([f]);var g=this.mesh;return g&&Object(r.drawTexture)(this,g),f;}/* override */},{key:"onPropertyChange",value:function onPropertyChange(f,g,x){if(_superPropGet(c,"onPropertyChange",this,3)([f,g,x]),f==="texture"&&(this[a]=Object(r.applyTexture)(this,g,!0)),f==="textureRect"){var _this$attributes10=this.attributes,M=_this$attributes10.width,S=_this$attributes10.height;(M==null||S==null)&&this.updateContours();}}}]);}(n["default"]);o(c,"Attr",s["default"]),l["default"].registerNode(c,"sprite");},/* 225 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return o;});var r=t(220);t(1).glMatrix.setMatrixArrayType(Array);var n=Symbol["for"]("spritejs_setAttributeDefault"),s=Symbol["for"]("spritejs_setAttribute"),l=Symbol["for"]("spritejs_getAttribute");var o=/*#__PURE__*/function(_r$default2){function o(c){var _this33;_classCallCheck(this,o);_this33=_callSuper(this,o,[c]),_this33[n]({texture:void 0,textureRect:void 0,textureRepeat:!1,sourceRect:void 0});return _this33;}_inherits(o,_r$default2);return _createClass(o,[{key:"texture",get:function get(){return this[l]("texture");},set:function set(c){this[s]("texture",c);}},{key:"textureRect",get:function get(){return this[l]("textureRect");},set:function set(c){this[s]("textureRect",c);}},{key:"sourceRect",get:function get(){return this[l]("sourceRect");},set:function set(c){this[s]("sourceRect",c);}},{key:"textureRepeat",get:function get(){return this[l]("textureRepeat");},set:function set(c){this[s]("textureRepeat",!!c);}}]);}(r["default"]);},/* 226 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return M;});var r=t(12),n=t(227),s=/* @__PURE__ */t.n(n),l=t(70),o=t(228),a=t(221),c=t(218),y=t(213),f=t(223);t(1).glMatrix.setMatrixArrayType(Array);function g(S,P,C){return P in S?Object.defineProperty(S,P,{value:C,enumerable:!0,configurable:!0,writable:!0}):S[P]=C,S;}var x=Symbol("mesh");var M=/*#__PURE__*/function(_l$default){function M(){var _this34;var P=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,M);typeof P=="string"&&(P={d:P}),_this34=_callSuper(this,M,[P]),_this34.effects={d:function d(C,h,p,_d9,v){var _s$a;var I=(p-_d9)/(v-_d9);if(I<=0)return C;if(I>=1)return h;var L=s.a._preprocessing(s.a.path2shapes(C),s.a.path2shapes(h)),w=(_s$a=s.a)._lerp.apply(_s$a,_toConsumableArray(L).concat([I]))[0];return w.reduce(function(E,b){return"".concat(E).concat(b.slice(2).join(" ")," ");},"M".concat(w[0][0]," ").concat(w[0][1],"C")).trim();}};return _this34;}/* override */_inherits(M,_l$default);return _createClass(M,[{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 _C21;var _C20=this[x];if(_C20)_C20.path!==P&&(_C20.contours=P.contours,_C20.path=P);else{_C20=new r.Mesh2D(this.path),_C20.path=P;var p=this.attributes.fillColor,d=this.attributes.fillRule;p&&Object(a.setFillColor)(_C20,{color:p,rule:d});var v=this.attributes.lineWidth,I=this.attributes.strokeColor;if(I&&v>0){var _this$attributes11=this.attributes,w=_this$attributes11.lineCap,B=_this$attributes11.lineJoin,E=_this$attributes11.miterLimit,b=_this$attributes11.lineDash,W=_this$attributes11.lineDashOffset,D=_this$attributes11.roundSegments;Object(a.setStrokeColor)(_C20,{color:I,lineWidth:v,lineCap:w,lineJoin:B,miterLimit:E,lineDash:b,lineDashOffset:W,roundSegments:D});}this[x]=_C20;var L=this.attributes.clipPath;L&&this[x].setClipPath(L);}var _h19=this.opacity;return _C20.getOpacity()!==_h19&&_C20.setOpacity(_h19),(_C21=_C20).setTransform.apply(_C21,_toConsumableArray(this.renderMatrix)),_C20;}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(M,"draw",this,3)([P]);var C=this.mesh;return C&&Object(c.drawTexture)(this,C),P;}},{key:"getBoundingClientRect",value:function getBoundingClientRect(){var P=null;return this.mesh&&(P=this.mesh.boundingBox),Object(f["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 _C22=this.mesh.getPointAtLength(P);if(_C22)return[_C22.x,_C22.y];}return[0,0];}/* override */},{key:"onPropertyChange",value:function onPropertyChange(P,C,h){if(_superPropGet(M,"onPropertyChange",this,3)([P,C,h]),(P==="d"||P==="normalize")&&this.updateContours(),this[x]&&(P==="fillColor"||P==="fillRule")){var _this$attributes12=this.attributes,p=_this$attributes12.fillColor,d=_this$attributes12.fillRule;Object(a.setFillColor)(this[x],{color:p,rule:d});}if(this[x]&&(P==="strokeColor"||P==="lineWidth"||P==="lineCap"||P==="lineJoin"||P==="lineDash"||P==="lineDashOffset"||P==="roundSegments")){var _this$attributes13=this.attributes,_p4=_this$attributes13.strokeColor,_d10=_this$attributes13.lineWidth;if(_p4&&_d10>0){var _this$attributes14=this.attributes,v=_this$attributes14.lineCap,I=_this$attributes14.lineJoin,L=_this$attributes14.lineDash,w=_this$attributes14.lineDashOffset,B=_this$attributes14.miterLimit,E=_this$attributes14.roundSegments;Object(a.setStrokeColor)(this[x],{color:_p4,lineCap:v,lineJoin:I,lineWidth:_d10,lineDash:L,lineDashOffset:w,miterLimit:B,roundSegments:E});}}this[x]&&P==="clipPath"&&this[x].setClipPath(C),P==="texture"&&Object(c.applyTexture)(this,C);}/* 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));}}]);}(l["default"]);g(M,"Attr",o["default"]),y["default"].registerNode(M,"path");},/* 227 *//***/function(u,e,t){(function(r,n){u.exports=n();})(this,function(){var r=/* @__PURE__ */function(){function b(W,D){var R=[],Y=!0,V=!1,Q=void 0;try{for(var et=W[Symbol.iterator](),it;!(Y=(it=et.next()).done)&&(R.push(it.value),!(D&&R.length===D));Y=!0);}catch($){V=!0,Q=$;}finally{try{!Y&&et["return"]&&et["return"]();}finally{if(V)throw Q;}}return R;}return function(W,D){if(Array.isArray(W))return W;if(Symbol.iterator in Object(W))return b(W,D);throw new TypeError("Invalid attempt to destructure non-iterable instance");};}(),n=Math.PI*2,s=function s(W,D,R,Y,V,Q,et){var it=W.x,$=W.y;it*=D,$*=R;var K=Y*it-V*$,rt=V*it+Y*$;return{x:K+Q,y:rt+et};},l=function l(W,D){var R=1.3333333333333333*Math.tan(D/4),Y=Math.cos(W),V=Math.sin(W),Q=Math.cos(W+D),et=Math.sin(W+D);return[{x:Y-V*R,y:V+Y*R},{x:Q+et*R,y:et-Q*R},{x:Q,y:et}];},o=function o(W,D,R,Y){var V=W*Y-D*R<0?-1:1,Q=Math.sqrt(W*W+D*D),et=Math.sqrt(W*W+D*D),it=W*R+D*Y,$=it/(Q*et);return $>1&&($=1),$<-1&&($=-1),V*Math.acos($);},a=function a(W,D,R,Y,V,Q,et,it,$,K,rt,lt){var ct=Math.pow(V,2),gt=Math.pow(Q,2),st=Math.pow(rt,2),Ot=Math.pow(lt,2),St=ct*gt-ct*Ot-gt*st;St<0&&(St=0),St/=ct*Ot+gt*st,St=Math.sqrt(St)*(et===it?-1:1);var F=St*V/Q*lt,z=St*-Q/V*rt,Z=K*F-$*z+(W+R)/2,tt=$*F+K*z+(D+Y)/2,j=(rt-F)/V,H=(lt-z)/Q,T=(-rt-F)/V,A=(-lt-z)/Q,U=o(1,0,j,H),G=o(j,H,T,A);return it===0&&G>0&&(G-=n),it===1&&G<0&&(G+=n),[Z,tt,U,G];},c=function c(W){var D=W.px,R=W.py,Y=W.cx,V=W.cy,Q=W.rx,et=W.ry,it=W.xAxisRotation,$=it===void 0?0:it,K=W.largeArcFlag,rt=K===void 0?0:K,lt=W.sweepFlag,ct=lt===void 0?0:lt,gt=[];if(Q===0||et===0)return[];var st=Math.sin($*n/360),Ot=Math.cos($*n/360),St=Ot*(D-Y)/2+st*(R-V)/2,F=-st*(D-Y)/2+Ot*(R-V)/2;if(St===0&&F===0)return[];Q=Math.abs(Q),et=Math.abs(et);var z=Math.pow(St,2)/Math.pow(Q,2)+Math.pow(F,2)/Math.pow(et,2);z>1&&(Q*=Math.sqrt(z),et*=Math.sqrt(z));var Z=a(D,R,Y,V,Q,et,rt,ct,st,Ot,St,F),tt=r(Z,4),j=tt[0],H=tt[1],T=tt[2],A=tt[3],U=Math.max(Math.ceil(Math.abs(A)/(n/4)),1);A/=U;for(var G=0;G<U;G++)gt.push(l(T,A)),T+=A;return gt.map(function(J){var q=s(J[0],Q,et,Ot,st,j,H),nt=q.x,ut=q.y,pt=s(J[1],Q,et,Ot,st,j,H),yt=pt.x,Tt=pt.y,vt=s(J[2],Q,et,Ot,st,j,H),mt=vt.x,Pt=vt.y;return{x1:nt,y1:ut,x2:yt,y2:Tt,x:mt,y:Pt};});},y={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0/**
|
|
316
|
+
* segment pattern
|
|
317
|
+
* @type {RegExp}
|
|
318
|
+
*/},f=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function g(b){var W=[];return b.replace(f,function(D,R,Y){var V=R.toLowerCase();for(Y=M(Y),V=="m"&&Y.length>2&&(W.push([R].concat(Y.splice(0,2))),V="l",R=R=="m"?"l":"L");;){if(Y.length==y[V])return Y.unshift(R),W.push(Y);if(Y.length<y[V])throw new Error("malformed path data");W.push([R].concat(Y.splice(0,y[V])));}}),W;}var x=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function M(b){var W=b.match(x);return W?W.map(Number):[];}function S(b){var W=b[0][0],D=b[0][1],R=W,Y=D;return b.forEach(function(V){var Q=V[0],et=V[2],it=V[4],$=V[6],K=V[1],rt=V[3],lt=V[5],ct=V[7];W=Math.min(W,Q,et,it,$),D=Math.min(D,K,rt,lt,ct),R=Math.max(R,Q,et,it,$),Y=Math.max(Y,K,rt,lt,ct);}),[W,D,R,Y];}function P(b,W){return Math.sqrt(Math.pow(b[0]-W[0],2)+Math.pow(b[1]-W[1],2))+Math.sqrt(Math.pow(b[2]-W[2],2)+Math.pow(b[3]-W[3],2));}function C(b,W){var D=b[0],R=b[2],Y=b[4],V=b[6],Q=b[1],et=b[3],it=b[5],$=b[7],K=W[0],rt=W[2],lt=W[4],ct=W[6],gt=W[1],st=W[3],Ot=W[5],St=W[7];return Math.sqrt(Math.pow(K-D,2)+Math.pow(gt-Q,2))+Math.sqrt(Math.pow(rt-R,2)+Math.pow(st-et,2))+Math.sqrt(Math.pow(lt-Y,2)+Math.pow(Ot-it,2))+Math.sqrt(Math.pow(ct-V,2)+Math.pow(St-$,2));}function h(b,W){var D=d(b.length),R=[];D.forEach(function(V){var Q=0,et=0;V.forEach(function(it){Q+=C(b[it],W[et++]);}),R.push({index:V,distance:Q});}),R.sort(function(V,Q){return V.distance-Q.distance;});var Y=[];return R[0].index.forEach(function(V){Y.push(b[V]);}),Y;}function p(b,W){var D=v(b.length),R=[];D.forEach(function(V){var Q=0;V.forEach(function(et){Q+=P(S(b[et]),S(W[et]));}),R.push({index:V,distance:Q});}),R.sort(function(V,Q){return V.distance-Q.distance;});var Y=[];return R[0].index.forEach(function(V){Y.push(b[V]);}),Y;}function d(b){for(var W=[],D=0;D<b;D++){for(var R=[],Y=0;Y<b;Y++){var V=Y+D;V>b-1&&(V-=b),R[V]=Y;}W.push(R);}return W;}function v(b){for(var W=[],D=0;D<b;D++)W.push(D);return I(W);}function I(b){var W=[],D=[];function R(Y){var V,Q;for(V=0;V<Y.length;V++)Q=Y.splice(V,1)[0],D.push(Q),Y.length==0&&W.push(D.slice()),R(Y),Y.splice(V,0,Q),D.pop();return W;}return R(b);}var L={};L.parser=g,L.lerpCurve=function(b,W,D){return L.lerpPoints(b[0],b[1],W[0],W[1],D).concat(L.lerpPoints(b[2],b[3],W[2],W[3],D)).concat(L.lerpPoints(b[4],b[5],W[4],W[5],D)).concat(L.lerpPoints(b[6],b[7],W[6],W[7],D));},L.lerpPoints=function(b,W,D,R,Y){return[b+(D-b)*Y,W+(R-W)*Y];},L.q2b=function(b,W,D,R,Y,V){return[b,W,(b+2*D)/3,(W+2*R)/3,(Y+2*D)/3,(V+2*R)/3,Y,V];},L.path2shapes=function(b){for(var W=L.parser(b),D=0,R=0,Y=0,V=W.length,Q=[],et=null,it=void 0,$=void 0,K=void 0,rt=void 0,lt=void 0,ct=void 0,gt=void 0;Y<V;Y++){var st=W[Y],Ot=st[0],St=W[Y-1];switch(Ot){case"m":lt=Q.length,Q[lt]=[],et=Q[lt],D=D+st[1],R=R+st[2];break;case"M":lt=Q.length,Q[lt]=[],et=Q[lt],D=st[1],R=st[2];break;case"l":et.push([D,R,D,R,D,R,D+st[1],R+st[2]]),D+=st[1],R+=st[2];break;case"L":et.push([D,R,st[1],st[2],st[1],st[2],st[1],st[2]]),D=st[1],R=st[2];break;case"h":et.push([D,R,D,R,D,R,D+st[1],R]),D+=st[1];break;case"H":et.push([D,R,st[1],R,st[1],R,st[1],R]),D=st[1];break;case"v":et.push([D,R,D,R,D,R,D,R+st[1]]),R+=st[1];break;case"V":et.push([D,R,D,st[1],D,st[1],D,st[1]]),R=st[1];break;case"C":et.push([D,R,st[1],st[2],st[3],st[4],st[5],st[6]]),D=st[5],R=st[6];break;case"S":St[0]==="C"||St[0]==="c"?et.push([D,R,D+St[5]-St[3],R+St[6]-St[4],st[1],st[2],st[3],st[4]]):(St[0]==="S"||St[0]==="s")&&et.push([D,R,D+St[3]-St[1],R+St[4]-St[2],st[1],st[2],st[3],st[4]]),D=st[3],R=st[4];break;case"c":et.push([D,R,D+st[1],R+st[2],D+st[3],R+st[4],D+st[5],R+st[6]]),D=D+st[5],R=R+st[6];break;case"s":St[0]==="C"||St[0]==="c"?et.push([D,R,D+St[5]-St[3],R+St[6]-St[4],D+st[1],R+st[2],D+st[3],R+st[4]]):(St[0]==="S"||St[0]==="s")&&et.push([D,R,D+St[3]-St[1],R+St[4]-St[2],D+st[1],R+st[2],D+st[3],R+st[4]]),D=D+st[3],R=R+st[4];break;case"a":ct=c({rx:st[1],ry:st[2],px:D,py:R,xAxisRotation:st[3],largeArcFlag:st[4],sweepFlag:st[5],cx:D+st[6],cy:R+st[7]}),gt=ct[ct.length-1],ct.forEach(function(F,z){z===0?et.push([D,R,F.x1,F.y1,F.x2,F.y2,F.x,F.y]):et.push([ct[z-1].x,ct[z-1].y,F.x1,F.y1,F.x2,F.y2,F.x,F.y]);}),D=gt.x,R=gt.y;break;case"A":ct=c({rx:st[1],ry:st[2],px:D,py:R,xAxisRotation:st[3],largeArcFlag:st[4],sweepFlag:st[5],cx:st[6],cy:st[7]}),gt=ct[ct.length-1],ct.forEach(function(F,z){z===0?et.push([D,R,F.x1,F.y1,F.x2,F.y2,F.x,F.y]):et.push([ct[z-1].x,ct[z-1].y,F.x1,F.y1,F.x2,F.y2,F.x,F.y]);}),D=gt.x,R=gt.y;break;case"Q":et.push(L.q2b(D,R,st[1],st[2],st[3],st[4])),D=st[3],R=st[4];break;case"q":et.push(L.q2b(D,R,D+st[1],R+st[2],st[3]+D,st[4]+R)),D+=st[3],R+=st[4];break;case"T":St[0]==="Q"||St[0]==="q"?(K=D+St[3]-St[1],rt=R+St[4]-St[2],et.push(L.q2b(D,R,K,rt,st[1],st[2]))):(St[0]==="T"||St[0]==="t")&&(et.push(L.q2b(D,R,D+D-K,R+R-rt,st[1],st[2])),K=D+D-K,rt=R+R-rt),D=st[1],R=st[2];break;case"t":St[0]==="Q"||St[0]==="q"?(K=D+St[3]-St[1],rt=R+St[4]-St[2],et.push(L.q2b(D,R,K,rt,D+st[1],R+st[2]))):(St[0]==="T"||St[0]==="t")&&(et.push(L.q2b(D,R,D+D-K,R+R-rt,D+st[1],R+st[2])),K=D+D-K,rt=R+R-rt),D+=st[1],R+=st[2];break;case"Z":it=et[0][0],$=et[0][1],et.push([D,R,it,$,it,$,it,$]);break;case"z":it=et[0][0],$=et[0][1],et.push([D,R,it,$,it,$,it,$]);break;}}return Q;},L._upCurves=function(b,W){for(var D=0,R=0,Y=b.length;D<W;D++)b.push(b[R].slice(0)),R++,R>Y-1&&(R-=Y);};function w(b,W,D,R,Y,V,Q,et,it){return{left:B(b,W,D,R,Y,V,Q,et,it),right:B(Q,et,Y,V,D,R,b,W,1-it,!0)};}function B(b,W,D,R,Y,V,Q,et,it,$){var K=(D-b)*it+b,rt=(R-W)*it+W,lt=(Y-D)*it+D,ct=(V-R)*it+R,gt=(Q-Y)*it+Y,st=(et-V)*it+V,Ot=(lt-K)*it+K,St=(ct-rt)*it+rt,F=(gt-lt)*it+lt,z=(st-ct)*it+ct,Z=(F-Ot)*it+Ot,tt=(z-St)*it+St;return $?[Z,tt,Ot,St,K,rt,b,W]:[b,W,K,rt,Ot,St,Z,tt];}L._splitCurves=function(b,W){for(var D=0,R=0;D<W;D++){var Y=b[R],V=w(Y[0],Y[1],Y[2],Y[3],Y[4],Y[5],Y[6],Y[7],0.5);b.splice(R,1),b.splice(R,0,V.left,V.right),R+=2,R>=b.length-1&&(R=0);}};function E(b,W){for(var D=function D(V){var Q=b[b.length-1],et=[];Q.forEach(function(it){et.push(it.slice(0));}),b.push(et);},R=0;R<W;R++)D();}return L.lerp=function(b,W,D){return L._lerp(L.path2shapes(b),L.path2shapes(W),D);},L.MIM_CURVES_COUNT=100,L._preprocessing=function(b,W){var D=b.length,R=W.length,Y=JSON.parse(JSON.stringify(b)),V=JSON.parse(JSON.stringify(W));return D>R?E(V,D-R):D<R&&E(Y,R-D),Y=p(Y,V),Y.forEach(function(Q,et){var it=Q.length,$=V[et].length;it>$?it<L.MIM_CURVES_COUNT?(L._splitCurves(Q,L.MIM_CURVES_COUNT-it),L._splitCurves(V[et],L.MIM_CURVES_COUNT-$)):L._splitCurves(V[et],it-$):it<$&&($<L.MIM_CURVES_COUNT?(L._splitCurves(Q,L.MIM_CURVES_COUNT-it),L._splitCurves(V[et],L.MIM_CURVES_COUNT-$)):L._splitCurves(Q,$-it));}),Y.forEach(function(Q,et){Y[et]=h(Q,V[et]);}),[Y,V];},L._lerp=function(b,W,D){var R=[];return b.forEach(function(Y,V){var Q=[];Y.forEach(function(et,it){Q.push(L.lerpCurve(et,W[V][it],D));}),R.push(Q);}),R;},L.animate=function(b){var W=L.path2shapes(b.from),D=L.path2shapes(b.to),R=L._preprocessing(W,D),Y=/* @__PURE__ */new Date(),V=b.end||function(){},Q=b.progress||function(){},et=b.begin||function(){},it=b.easing||function(ct){return ct;},$=null,K=null,rt=b.time;et(W);var lt=function ct(){var gt=/* @__PURE__ */new Date()-Y;if(gt>=rt){K=D,Q(K,1),V(K),cancelAnimationFrame($);return;}var st=it(gt/rt);K=L._lerp(R[0],R[1],st),Q(K,st),$=requestAnimationFrame(ct);};lt();},L;});},/* 228 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return c;});var r=t(71),n=t(221),s=t(72);t(1).glMatrix.setMatrixArrayType(Array);var l=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_setAttribute"),a=Symbol["for"]("spritejs_getAttribute");var c=/*#__PURE__*/function(_r$default3){function c(f){var _this35;_classCallCheck(this,c);_this35=_callSuper(this,c,[f]),_this35[l]({d:"",normalize:!1,fillColor:void 0,fillRule:"nonzero",strokeColor:void 0,lineWidth:1,lineJoin:"miter",// 'miter' or 'bevel' or 'round'
|
|
319
|
+
lineCap:"butt",// 'butt' or 'square' or 'round'
|
|
320
|
+
roundSegments:20,// default roundSegment if lineJoin or lineCap is round
|
|
321
|
+
lineDash:void 0,lineDashOffset:0,miterLimit:10,texture:void 0,textureRect:void 0,textureRepeat:!1,sourceRect:void 0,clipPath:void 0});return _this35;}_inherits(c,_r$default3);return _createClass(c,[{key:"d",get:function get(){return this[a]("d");},set:function set(f){this[o]("d",f);}},{key:"normalize",get:function get(){return this[a]("normalize");},set:function set(f){this[o]("normalize",!!f);}},{key:"fillColor",get:function get(){return this[a]("fillColor");},set:function set(f){this[o]("fillColor",Object(n.parseColor)(f));}},{key:"fillRule",get:function get(){return this[a]("fillRule");},set:function set(f){if(f!=null&&f!=="nonzero"&&f!=="evenodd")throw new TypeError("Invalid fill rule.");this[o]("fillRule",f);}},{key:"strokeColor",get:function get(){return this[a]("strokeColor");},set:function set(f){this[o]("strokeColor",Object(n.parseColor)(f));}},{key:"lineWidth",get:function get(){return this[a]("lineWidth");},set:function set(f){this[o]("lineWidth",Object(s.toNumber)(f));}},{key:"lineJoin",get:function get(){return this[a]("lineJoin");},set:function set(f){if(f!=null&&f!=="miter"&&f!=="bevel"&&f!=="round")throw new TypeError("Invalid lineJoin type.");this[o]("lineJoin",f);}},{key:"lineCap",get:function get(){return this[a]("lineCap");},set:function set(f){if(f!=null&&f!=="butt"&&f!=="square"&&f!=="round")throw new TypeError("Invalid lineCap type.");this[o]("lineCap",f);}},{key:"lineDash",get:function get(){return this[a]("lineDash");},set:function set(f){f=Object(s.toArray)(f,!0),f!=null&&!Array.isArray(f)&&(f=[f]),this[o]("lineDash",f?f.map(s.toNumber):null);}},{key:"lineDashOffset",get:function get(){return this[a]("lineDashOffset");},set:function set(f){this[o]("lineDashOffset",Object(s.toNumber)(f));}},{key:"miterLimit",get:function get(){return this[a]("miterLimit");},set:function set(f){this[o]("miterLimit",Object(s.toNumber)(f));}},{key:"roundSegments",get:function get(){return this[a]("roundSegments");},set:function set(f){this[o]("roundSegments",f);}},{key:"texture",get:function get(){return this[a]("texture");},set:function set(f){this[o]("texture",f);}},{key:"textureRect",get:function get(){return this[a]("textureRect");},set:function set(f){this[o]("textureRect",f);}},{key:"sourceRect",get:function get(){return this[a]("sourceRect");},set:function set(f){this[o]("sourceRect",f);}},{key:"textureRepeat",get:function get(){return this[a]("textureRepeat");},set:function set(f){this[o]("textureRepeat",!!f);}},{key:"clipPath",get:function get(){return this[a]("clipPath");},set:function set(f){this[o]("clipPath",f);}}]);}(r["default"]);},/* 229 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return o;});var r=t(226),n=t(213),s=t(230);t(1).glMatrix.setMatrixArrayType(Array);function l(a,c,y){return c in a?Object.defineProperty(a,c,{value:y,enumerable:!0,configurable:!0,writable:!0}):a[c]=y,a;}var o=/*#__PURE__*/function(_r$default4){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_r$default4);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var _this$attributes15=this.attributes,c=_this$attributes15.width,y=_this$attributes15.height;return c>0&&y>0&&_superPropGet(o,"isVisible",this,1);}}]);}(r["default"]);l(o,"Attr",s["default"]),n["default"].registerNode(o,"rect");},/* 230 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return y;});var r=t(228),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var s=Symbol["for"]("spritejs_setAttributeDefault"),l=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute"),a=Symbol["for"]("spritejs_declareAlias");function c(f){var g=f.width,x=f.height;return"M0 0L".concat(g," 0L").concat(g," ").concat(x,"L0 ").concat(x,"Z");}var y=/*#__PURE__*/function(_r$default5){function y(g){var _this36;_classCallCheck(this,y);_this36=_callSuper(this,y,[g]),_this36[s]({width:0,height:0/* size */}),_this36[a]("size");return _this36;}// readonly
|
|
322
|
+
_inherits(y,_r$default5);return _createClass(y,[{key:"d",get:function get(){return this[o]("d");},set:function set(g){}// eslint-disable-line no-empty-function
|
|
323
|
+
},{key:"width",get:function get(){return this[o]("width");},set:function set(g){if(g=Object(n.toNumber)(g),this[l]("width",g)){var x=c(this);this[l]("d",x);}}},{key:"height",get:function get(){return this[o]("height");},set:function set(g){if(g=Object(n.toNumber)(g),this[l]("height",g)){var x=c(this);this[l]("d",x);}}},{key:"size",get:function get(){return[this.width,this.height];},set:function set(g){g=Object(n.toArray)(g),Array.isArray(g)||(g=[g,g]),this.width=g[0],this.height=g[1];}}]);}(r["default"]);},/* 231 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return o;});var r=t(232),n=t(213),s=t(235);t(1).glMatrix.setMatrixArrayType(Array);function l(a,c,y){return c in a?Object.defineProperty(a,c,{value:y,enumerable:!0,configurable:!0,writable:!0}):a[c]=y,a;}var o=/*#__PURE__*/function(_r$default6){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_r$default6);return _createClass(o,[{key:"isVisible",get:function get(){var c=this.attributes.sides;return c[0]>0&&c[1]>0&&_superPropGet(o,"isVisible",this,1);}}]);}(r["default"]);l(o,"Attr",s["default"]),n["default"].registerNode(o,"triangle");},/* 232 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return o;});var r=t(226),n=t(213),s=t(233);t(1).glMatrix.setMatrixArrayType(Array);function l(a,c,y){return c in a?Object.defineProperty(a,c,{value:y,enumerable:!0,configurable:!0,writable:!0}):a[c]=y,a;}var o=/*#__PURE__*/function(_r$default7){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_r$default7);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var c=this.attributes.points;return c.length>0&&_superPropGet(o,"isVisible",this,1);}}]);}(r["default"]);l(o,"Attr",s["default"]),n["default"].registerNode(o,"polyline");},/* 233 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return f;});var r=t(228),n=t(72),s=t(234);t(1).glMatrix.setMatrixArrayType(Array);var l=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_setAttribute"),a=Symbol["for"]("spritejs_getAttribute"),c=Symbol["for"]("spritejs_declareAlias");function y(g){var x=g.points,M=g.smooth,S=g.smoothRange,P=g.close,C=[];for(var p=0;p<x.length;p+=2)C.push([x[p],x[p+1]]);var h="";return M?h=Object(s.makeSmoothCurveLine)(C,S):C.length&&(h="M".concat(C.map(function(p){return p.join(" ");}).join("L"))),h&&P&&(h+="Z"),h;}var f=/*#__PURE__*/function(_r$default8){function f(x){var _this37;_classCallCheck(this,f);_this37=_callSuper(this,f,[x]),_this37[l]({points:[],smooth:!1,smoothRange:[0],closeType:"none"// none | normal
|
|
324
|
+
/* close */}),_this37[c]("close");return _this37;}// readonly
|
|
325
|
+
_inherits(f,_r$default8);return _createClass(f,[{key:"d",get:function get(){return this[a]("d");},set:function set(x){}// eslint-disable-line no-empty-function
|
|
326
|
+
},{key:"close",get:function get(){return this.closeType!=="none";},set:function set(x){x=x?"normal":"none",this.closeType=x;}},{key:"closeType",get:function get(){return this[a]("closeType");},set:function set(x){if(x!=null&&x!=="none"&&x!=="normal")throw new TypeError("Invalid closeType type.");if(this[o]("closeType",x)){var M=y(this);this[o]("d",M);}}},{key:"smooth",get:function get(){return this[a]("smooth");},set:function set(x){if(this[o]("smooth",x)){var M=y(this);this[o]("d",M);}}},{key:"smoothRange",get:function get(){return this[a]("smoothRange");},set:function set(x){if(x&&!Array.isArray(x)&&(x=[x]),this[o]("smoothRange",x)&&this.smooth){var M=y(this);this[o]("d",M);}}},{key:"points",get:function get(){return this[a]("points");},set:function set(x){if(x=Object(n.toArray)(x),Array.isArray(x)&&(x=x.reduce(function(M,S){return Array.isArray(S)?[].concat(_toConsumableArray(M),_toConsumableArray(S.map(function(P){return Object(n.toNumber)(P);}))):[].concat(_toConsumableArray(M),[Object(n.toNumber)(S)]);},[])),this[o]("points",x)){var M=y(this);this[o]("d",M);}}}]);}(r["default"]);},/* 234 *//***/function(u,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 l(c){var y=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.168;var f=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0.168;var g,x,M,S;if((n[c].x===n[c+1].x||n[c].y===n[c+1].y)&&(y=0,f=0),c<1?(g=n[0].x+(n[1].x-n[0].x)*y,x=n[0].y+(n[1].y-n[0].y)*y):(g=n[c].x+(n[c+1].x-n[c-1].x)*y,x=n[c].y+(n[c+1].y-n[c-1].y)*y),c>n.length-3){var P=n.length-1;M=n[P].x-(n[P].x-n[P-1].x)*f,S=n[P].y-(n[P].y-n[P-1].y)*f;}else M=n[c+1].x-(n[c+2].x-n[c].x)*f,S=n[c+1].y-(n[c+2].y-n[c].y)*f;return[{x:g,y:x},{x:M,y:S}];}n=n.map(function(_ref142){var _ref143=_slicedToArray(_ref142,2),c=_ref143[0],y=_ref143[1];return{x:c,y:y};});var o="",a=0;return n.forEach(function(c,y){if(y===0)o+="M".concat(c.x," ").concat(c.y);else{for(;y>s[a];)a++;if(a%2){var _l3=l(y-1),_l4=_slicedToArray(_l3,2),f=_l4[0],g=_l4[1];o+="C".concat([f.x,f.y,g.x,g.y,c.x,c.y].join(" "));}else o+="L".concat(c.x," ").concat(c.y);}}),o;}},/* 235 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return c;});var r=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var s=Symbol["for"]("spritejs_setAttributeDefault"),l=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute");function a(y){var _y$sides=_slicedToArray(y.sides,2),f=_y$sides[0],g=_y$sides[1];var x=y.angle%360;return x<0&&(x+=360),x=Math.PI*x/180,[0,0,f,0,g*Math.cos(x),g*Math.sin(x)];}var c=/*#__PURE__*/function(_r$default9){function c(f){var _this38;_classCallCheck(this,c);_this38=_callSuper(this,c,[f]),_this38[s]({sides:[0,0],angle:60,closeType:"normal"});return _this38;}// readonly
|
|
327
|
+
_inherits(c,_r$default9);return _createClass(c,[{key:"points",get:function get(){return _superPropGet(c,"points",this,1);},set:function set(f){}// eslint-disable-line no-empty-function
|
|
328
|
+
},{key:"sides",get:function get(){return this[o]("sides");},set:function set(f){if(f=Object(n.toArray)(f,!0),f!=null&&!Array.isArray(f)&&(f=[f,f]),this[l]("sides",f)){var g=a(this);_superPropSet(c,"points",g,this,1,1);}}},{key:"angle",get:function get(){return this[o]("angle");},set:function set(f){if(f=Object(n.toNumber)(f),this[l]("angle",f)){var g=a(this);_superPropSet(c,"points",g,this,1,1);}}}]);}(r["default"]);},/* 236 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return o;});var r=t(232),n=t(213),s=t(237);t(1).glMatrix.setMatrixArrayType(Array);function l(a,c,y){return c in a?Object.defineProperty(a,c,{value:y,enumerable:!0,configurable:!0,writable:!0}):a[c]=y,a;}var o=/*#__PURE__*/function(_r$default10){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_r$default10);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var c=this.attributes.sides;return c[0]>0&&c[1]>0&&_superPropGet(o,"isVisible",this,1);}}]);}(r["default"]);l(o,"Attr",s["default"]),n["default"].registerNode(o,"parallel");},/* 237 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return c;});var r=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var s=Symbol["for"]("spritejs_setAttributeDefault"),l=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute");function a(y){var _y$sides2=_slicedToArray(y.sides,2),f=_y$sides2[0],g=_y$sides2[1];var x=y.angle%360;x<0&&(x+=360),x=Math.PI*x/180;var M=g*Math.cos(x),S=g*Math.sin(x);return[0,0,f,0,M+f,S,M,S];}var c=/*#__PURE__*/function(_r$default11){function c(f){var _this39;_classCallCheck(this,c);_this39=_callSuper(this,c,[f]),_this39[s]({sides:[0,0],angle:90,closeType:"normal"});return _this39;}// readonly
|
|
329
|
+
_inherits(c,_r$default11);return _createClass(c,[{key:"points",get:function get(){return _superPropGet(c,"points",this,1);},set:function set(f){}// eslint-disable-line no-empty-function
|
|
330
|
+
},{key:"sides",get:function get(){return this[o]("sides");},set:function set(f){if(f=Object(n.toArray)(f,!0),f!=null&&!Array.isArray(f)&&(f=[f,f]),this[l]("sides",f)){var g=a(this);_superPropSet(c,"points",g,this,1,1);}}},{key:"angle",get:function get(){return this[o]("angle");},set:function set(f){if(f=Object(n.toNumber)(f),this[l]("angle",f)){var g=a(this);_superPropSet(c,"points",g,this,1,1);}}}]);}(r["default"]);},/* 238 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return o;});var r=t(232),n=t(213),s=t(239);t(1).glMatrix.setMatrixArrayType(Array);function l(a,c,y){return c in a?Object.defineProperty(a,c,{value:y,enumerable:!0,configurable:!0,writable:!0}):a[c]=y,a;}var o=/*#__PURE__*/function(_r$default12){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_r$default12);return _createClass(o);}(r["default"]);l(o,"Attr",s["default"]),n["default"].registerNode(o,"regular");},/* 239 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return c;});var r=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var s=Symbol["for"]("spritejs_setAttributeDefault"),l=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute");function a(y){var f=y.edges,g=y.radius,x=y.offsetAngle,M=Math.PI*x/180-0.5*Math.PI;if(f<3||g<=0)return[];var S=[];for(var P=0;P<f;P++){var _C23=P*2*Math.PI/f+M,_h20=g*Math.cos(_C23),p=g*Math.sin(_C23);S.push(_h20,p);}return S;}var c=/*#__PURE__*/function(_r$default13){function c(f){var _this40;_classCallCheck(this,c);_this40=_callSuper(this,c,[f]),_this40[s]({edges:3,radius:0,offsetAngle:0,closeType:"normal"});return _this40;}// readonly
|
|
331
|
+
_inherits(c,_r$default13);return _createClass(c,[{key:"points",get:function get(){return _superPropGet(c,"points",this,1);},set:function set(f){}// eslint-disable-line no-empty-function
|
|
332
|
+
},{key:"edges",get:function get(){return this[o]("edges");},set:function set(f){if(f=Object(n.toNumber)(f),this[l]("edges",f)){var g=a(this);_superPropSet(c,"points",g,this,1,1);}}},{key:"radius",get:function get(){return this[o]("radius");},set:function set(f){if(f=Object(n.toNumber)(f),this[l]("radius",f)){var g=a(this);_superPropSet(c,"points",g,this,1,1);}}},{key:"offsetAngle",get:function get(){return this[o]("offsetAngle");},set:function set(f){if(f=Object(n.toNumber)(f),this[l]("offsetAngle",f)){var g=a(this);_superPropSet(c,"points",g,this,1,1);}}}]);}(r["default"]);},/* 240 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return o;});var r=t(232),n=t(213),s=t(241);t(1).glMatrix.setMatrixArrayType(Array);function l(a,c,y){return c in a?Object.defineProperty(a,c,{value:y,enumerable:!0,configurable:!0,writable:!0}):a[c]=y,a;}var o=/*#__PURE__*/function(_r$default14){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_r$default14);return _createClass(o);}(r["default"]);l(o,"Attr",s["default"]),n["default"].registerNode(o,"star");},/* 241 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return c;});var r=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var s=Symbol["for"]("spritejs_setAttributeDefault"),l=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute");function a(y){var f=y.angles,g=y.innerRadius,x=y.outerRadius,M=y.offsetAngle,S=Math.PI*M/180-0.5*Math.PI;if(f<3||g<=0||x<=0)return[];var P=[];for(var _C24=0;_C24<f*2;_C24++){var _h21=_C24*Math.PI/f+S,p=_C24%2?g:x,d=p*Math.cos(_h21),v=p*Math.sin(_h21);P.push(d,v);}return P;}var c=/*#__PURE__*/function(_r$default15){function c(f){var _this41;_classCallCheck(this,c);_this41=_callSuper(this,c,[f]),_this41[s]({angles:5,innerRadius:0,outerRadius:0,/* radius */offsetAngle:0,closeType:"normal"});return _this41;}// readonly
|
|
333
|
+
_inherits(c,_r$default15);return _createClass(c,[{key:"points",get:function get(){return _superPropGet(c,"points",this,1);},set:function set(f){}// eslint-disable-line no-empty-function
|
|
334
|
+
},{key:"angles",get:function get(){return this[o]("angles");},set:function set(f){if(f=Object(n.toNumber)(f),this[l]("angles",f)){var g=a(this);_superPropSet(c,"points",g,this,1,1);}}},{key:"innerRadius",get:function get(){return this[o]("innerRadius");},set:function set(f){if(f=Object(n.toNumber)(f),this[l]("innerRadius",f)){var g=a(this);_superPropSet(c,"points",g,this,1,1);}}},{key:"outerRadius",get:function get(){return this[o]("outerRadius");},set:function set(f){if(f=Object(n.toNumber)(f),this[l]("outerRadius",f)){var g=a(this);_superPropSet(c,"points",g,this,1,1);}}},{key:"radius",get:function get(){return[this.innerRadius,this.outerRadius];},set:function set(f){f=Object(n.toArray)(f,!0),Array.isArray(f)||(f=[f,f]),this.innerRadius=f[0],this.outerRadius=f[1];}},{key:"offsetAngle",get:function get(){return this[o]("offsetAngle");},set:function set(f){if(f=Object(n.toNumber)(f),this[l]("offsetAngle",f)){var g=a(this);_superPropSet(c,"points",g,this,1,1);}}}]);}(r["default"]);},/* 242 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return o;});var r=t(226),n=t(213),s=t(243);t(1).glMatrix.setMatrixArrayType(Array);function l(a,c,y){return c in a?Object.defineProperty(a,c,{value:y,enumerable:!0,configurable:!0,writable:!0}):a[c]=y,a;}var o=/*#__PURE__*/function(_r$default16){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_r$default16);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var _this$attributes16=this.attributes,c=_this$attributes16.radiusX,y=_this$attributes16.radiusY,f=_this$attributes16.startAngle,g=_this$attributes16.endAngle;return c>0&&y>0&&f!==g&&_superPropGet(o,"isVisible",this,1);}}]);}(r["default"]);l(o,"Attr",s["default"]),n["default"].registerNode(o,"ellipse");},/* 243 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return f;});var r=t(12),n=t(228),s=t(72);t(1).glMatrix.setMatrixArrayType(Array);var l=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_setAttribute"),a=Symbol["for"]("spritejs_getAttribute"),c=Symbol["for"]("spritejs_declareAlias");function y(g){var x=g.radiusX,M=g.radiusY,S=g.startAngle,P=g.endAngle,C=g.direction,h=g.closeType,p=C==="anitclockwise",d=new r.Figure2D();return h==="sector"&&d.moveTo(0,0),d.ellipse(0,0,x,M,0,Math.PI*S/180,Math.PI*P/180,p),h!=="none"&&d.closePath(),d.path.reduce(function(L,w){return L+w.join(" ");},"");}var f=/*#__PURE__*/function(_n$default2){function f(x){var _this42;_classCallCheck(this,f);_this42=_callSuper(this,f,[x]),_this42[l]({radiusX:0,radiusY:0,/* radius */startAngle:0,endAngle:360,/* angle */direction:"clockwise",// clockwise | anticlockwise
|
|
335
|
+
closeType:"none"// none | sector | normal
|
|
336
|
+
}),_this42[c]("radius","angle");return _this42;}// readonly
|
|
337
|
+
_inherits(f,_n$default2);return _createClass(f,[{key:"d",get:function get(){return this[a]("d");},set:function set(x){}// eslint-disable-line no-empty-function
|
|
338
|
+
},{key:"radiusX",get:function get(){return this[a]("radiusX");},set:function set(x){if(x=Object(s.toNumber)(x),this[o]("radiusX",x)){var M=y(this);this[o]("d",M);}}},{key:"radiusY",get:function get(){return this[a]("radiusY");},set:function set(x){if(x=Object(s.toNumber)(x),this[o]("radiusY",x)){var M=y(this);this[o]("d",M);}}},{key:"radius",get:function get(){return[this.radiusX,this.radiusY];},set:function set(x){x=Object(s.toArray)(x,!0),Array.isArray(x)||(x=[x,x]),this.radiusX=x[0],this.radiusY=x[1];}},{key:"angle",get:function get(){return[this.startAngle,this.endAngle];},set:function set(x){x=Object(s.toArray)(x),Array.isArray(x)||(x=[x,x]),this.startAngle=x[0],this.endAngle=x[1];}},{key:"direction",get:function get(){return this[a]("direction");},set:function set(x){if(x!=null&&x!=="clockwise"&&x!=="anticlockwise")throw new TypeError("Invalid direction type.");this[o]("direction",x);}},{key:"startAngle",get:function get(){return this[a]("startAngle");},set:function set(x){if(x=Object(s.toNumber)(x),this[o]("startAngle",x)){var M=y(this);this[o]("d",M);}}},{key:"endAngle",get:function get(){return this[a]("endAngle");},set:function set(x){if(x=Object(s.toNumber)(x),this[o]("endAngle",x)){var M=y(this);this[o]("d",M);}}},{key:"closeType",get:function get(){return this[a]("closeType");},set:function set(x){if(x!=null&&x!=="none"&&x!=="sector"&&x!=="normal")throw new TypeError("Invalid closeType type.");if(this[o]("closeType",x)){var M=y(this);this[o]("d",M);}}}]);}(n["default"]);},/* 244 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return o;});var r=t(242),n=t(213),s=t(245);t(1).glMatrix.setMatrixArrayType(Array);function l(a,c,y){return c in a?Object.defineProperty(a,c,{value:y,enumerable:!0,configurable:!0,writable:!0}):a[c]=y,a;}var o=/*#__PURE__*/function(_r$default17){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_r$default17);return _createClass(o);}(r["default"]);l(o,"Attr",s["default"]),n["default"].registerNode(o,"arc");},/* 245 *//***/function(u,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$default18){function s(){_classCallCheck(this,s);return _callSuper(this,s,arguments);}_inherits(s,_r$default18);return _createClass(s,[{key:"radius",get:function get(){return _superPropGet(s,"radiusX",this,1);},set:function set(o){o=Object(n.toNumber)(o),_superPropSet(s,"radiusX",o,this,1,1),_superPropSet(s,"radiusY",o,this,1,1);}}]);}(r["default"]);},/* 246 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return o;});var r=t(226),n=t(213),s=t(247);t(1).glMatrix.setMatrixArrayType(Array);function l(a,c,y){return c in a?Object.defineProperty(a,c,{value:y,enumerable:!0,configurable:!0,writable:!0}):a[c]=y,a;}var o=/*#__PURE__*/function(_r$default19){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_r$default19);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var _this$attributes17=this.attributes,c=_this$attributes17.innerRadius,y=_this$attributes17.outerRadius,f=_this$attributes17.startAngle,g=_this$attributes17.endAngle;return(c>0||y>0)&&f!==g&&_superPropGet(o,"isVisible",this,1);}}]);}(r["default"]);l(o,"Attr",s["default"]),n["default"].registerNode(o,"ring");},/* 247 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return f;});var r=t(12),n=t(228),s=t(72);t(1).glMatrix.setMatrixArrayType(Array);var l=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_setAttribute"),a=Symbol["for"]("spritejs_getAttribute"),c=Symbol["for"]("spritejs_declareAlias");function y(g){var _ref144;var x=g.innerRadius,M=g.outerRadius,S=g.startAngle,P=g.endAngle;var C=new r.Figure2D();if(S=Math.PI*S/180,P=Math.PI*P/180,x>M&&(_ref144=[M,x],x=_ref144[0],M=_ref144[1],_ref144),x<=0&&C.moveTo(0,0),C.arc(0,0,M,S,P,!1),x>0){var d=Math.PI*2;P<S&&(P=S+d+(P-S)%d),P-S>=d&&(P=S+d-1e-6),C.arc(0,0,x,P,S,!0);}return C.closePath(),C.path.reduce(function(d,v){return d+v.join(" ");},"");}var f=/*#__PURE__*/function(_n$default3){function f(x){var _this43;_classCallCheck(this,f);_this43=_callSuper(this,f,[x]),_this43[l]({innerRadius:0,outerRadius:0,/* radius */startAngle:0,endAngle:360/* angle */}),_this43[c]("radius","angle");return _this43;}// readonly
|
|
339
|
+
_inherits(f,_n$default3);return _createClass(f,[{key:"d",get:function get(){return this[a]("d");},set:function set(x){}// eslint-disable-line no-empty-function
|
|
340
|
+
},{key:"innerRadius",get:function get(){return this[a]("innerRadius");},set:function set(x){if(x=Object(s.toNumber)(x),this[o]("innerRadius",x)){var M=y(this);this[o]("d",M);}}},{key:"outerRadius",get:function get(){return this[a]("outerRadius");},set:function set(x){if(x=Object(s.toNumber)(x),this[o]("outerRadius",x)){var M=y(this);this[o]("d",M);}}},{key:"radius",get:function get(){return[this.innerRadius,this.outerRadius];},set:function set(x){x=Object(s.toArray)(x,!0),Array.isArray(x)||(x=[x,x]),this.innerRadius=x[0],this.outerRadius=x[1];}},{key:"startAngle",get:function get(){return this[a]("startAngle");},set:function set(x){if(x=Object(s.toNumber)(x),this[o]("startAngle",x)){var M=y(this);this[o]("d",M);}}},{key:"endAngle",get:function get(){return this[a]("endAngle");},set:function set(x){if(x=Object(s.toNumber)(x),this[o]("endAngle",x)){var M=y(this);this[o]("d",M);}}},{key:"angle",get:function get(){return[this.startAngle,this.endAngle];},set:function set(x){x=Object(s.toArray)(x),Array.isArray(x)||(x=[x,x]),this.startAngle=x[0],this.endAngle=x[1];}}]);}(n["default"]);},/* 248 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return M;});var r=t(12),n=t(218),s=t(219),l=t(249),o=t(213);t(1).glMatrix.setMatrixArrayType(Array);function a(S,P,C){return P in S?Object.defineProperty(S,P,{value:C,enumerable:!0,configurable:!0,writable:!0}):S[P]=C,S;}var c=Symbol("textImage"),y=Symbol("textImageTask"),f=Symbol("textureContext"),g=Symbol("updateTextureRect"),x=Symbol("textCanvas");var M=/*#__PURE__*/function(_s$default3){function M(){var _this44;var P=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,M);typeof P=="string"&&(P={text:P}),_this44=_callSuper(this,M,[P]);return _this44;}/* override */_inherits(M,_s$default3);return _createClass(M,[{key:"contentSize",get:function get(){var _superPropGet4=_superPropGet(M,"contentSize",this,1),_superPropGet5=_slicedToArray(_superPropGet4,2),P=_superPropGet5[0],C=_superPropGet5[1];var _this$attributes18=this.attributes,h=_this$attributes18.width,p=_this$attributes18.height;if(h==null||p==null){var d=this[c];d&&(h==null&&(P=d.rect[2]),p==null&&(C=d.rect[3]));}return[P,C];}},{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[c]||{};}},{key:"textImageReady",get:function get(){return this[y]||Promise.resolve();}/* override */},{key:"draw",value:function draw(P){_superPropGet(M,"draw",this,3)([P]);var C=this.mesh;if(C){var _h22=this[c];if(_h22){var p=C.texture;if(!p||this[f]&&this[f]!==this.renderer||_h22.needsUpdate?(_h22.needsUpdate=!1,Object(n.deleteTexture)(_h22.image,this.renderer),p=Object(n.createTexture)(_h22.image,this.renderer),this[g]=!0):p=C.uniforms.u_texSampler,this[g]){var _h22$rect$slice=_h22.rect.slice(2),_h22$rect$slice2=_slicedToArray(_h22$rect$slice,2),d=_h22$rect$slice2[0],v=_h22$rect$slice2[1],_this$contentSize4=_slicedToArray(this.contentSize,2),I=_this$contentSize4[0],L=_this$contentSize4[1],w=this.attributes.textAlign,B=this.attributes.verticalAlign;var E=0;w==="center"?E=(I-d)/2:(w==="right"||w==="end")&&(E=I-d);var b=this.attributes.fontSize,W=this.attributes.lineHeight;var D=0;B==="top"?D=(b-W)/2:B==="bottom"&&(D=(W-b)/2);var _this$attributes19=this.attributes,R=_this$attributes19.paddingLeft,Y=_this$attributes19.paddingTop,V=this.attributes.borderWidth;E+=R+V,D+=Y+V;var _this$attributes20=this.attributes,Q=_this$attributes20.anchorX,et=_this$attributes20.anchorY;E-=this.offsetSize[0]*Q,D-=this.offsetSize[1]*et,C.setTexture(p,{rect:[E,D,d,v]}),this[g]=!1,this[f]=this.renderer;}}}return P;}/* override */},{key:"onPropertyChange",value:function onPropertyChange(P,C,h){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[g]=!0),_superPropGet(M,"onPropertyChange",this,3)([P,C,h]));}/* override */},{key:"updateContours",value:function updateContours(){_superPropGet(M,"updateContours",this,3)([]),this[g]=!0;}},{key:"updateText",value:function updateText(){var _this45=this;this[y]||(this[y]=Promise.resolve().then(function(){_this45[y]=null;var _this45$attributes=_this45.attributes,P=_this45$attributes.text,C=_this45$attributes.font,h=_this45$attributes.fillColor,p=_this45$attributes.strokeColor,d=_this45$attributes.strokeWidth,v=_this45.layer?_this45.layer.displayRatio:1;return _this45[x]=_this45[x]||r.ENV.createCanvas(1,1),_this45[c]=r.ENV.createText(P,{font:C,fillColor:h,strokeColor:p,strokeWidth:d,parseFont:r.parseFont,ratio:v,textCanvas:_this45[x]}),_this45[c].needsUpdate=!0,_this45.updateContours(),_this45.forceUpdate(),_this45[c];}));}}]);}(s["default"]);a(M,"Attr",l["default"]),o["default"].registerNode(M,"label");},/* 249 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return f;});var r=t(12),n=t(72),s=t(221),l=t(220);t(1).glMatrix.setMatrixArrayType(Array);var o=Symbol["for"]("spritejs_setAttributeDefault"),a=Symbol["for"]("spritejs_setAttribute"),c=Symbol["for"]("spritejs_getAttribute"),y=Symbol["for"]("spritejs_declareAlias");var f=/*#__PURE__*/function(_l$default2){function f(x){var _this46;_classCallCheck(this,f);_this46=_callSuper(this,f,[x]),_this46[o]({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"}),_this46[y]("font");return _this46;}_inherits(f,_l$default2);return _createClass(f,[{key:"text",get:function get(){return this[c]("text")||" ";},set:function set(x){this[a]("text",x);}},{key:"fontSize",get:function get(){return this[c]("fontSize");},set:function set(x){this[a]("fontSize",Object(n.toNumber)(x));}},{key:"fontFamily",get:function get(){return this[c]("fontFamily");},set:function set(x){this[a]("fontFamily",x);}},{key:"fontStyle",get:function get(){return this[c]("fontStyle");},set:function set(x){this[a]("fontStyle",x);}},{key:"fontVariant",get:function get(){return this[c]("fontVariant");},set:function set(x){this[a]("fontVariant",x);}},{key:"fontWeight",get:function get(){return this[c]("fontWeight");},set:function set(x){this[a]("fontWeight",x);}},{key:"fontStretch",get:function get(){return this[c]("fontStretch");},set:function set(x){this[a]("fontStretch",x);}},{key:"lineHeight",get:function get(){return this[c]("lineHeight")||this.fontSize;},set:function set(x){this[a]("lineHeight",Object(n.toNumber)(x));}},{key:"textAlign",get:function get(){return this[c]("textAlign");},set:function set(x){this[a]("textAlign",x);}},{key:"strokeColor",get:function get(){return this[c]("strokeColor");},set:function set(x){this[a]("strokeColor",Object(s.parseColor)(x));}},{key:"strokeWidth",get:function get(){return this[c]("strokeWidth");},set:function set(x){this[a]("strokeWidth",Object(n.toNumber)(x));}},{key:"verticalAlign",get:function get(){return this[c]("verticalAlign");},set:function set(x){this[a]("verticalAlign",x);}},{key:"fillColor",get:function get(){return this[c]("fillColor");},set:function set(x){this[a]("fillColor",Object(s.parseColor)(x));}},{key:"font",get:function get(){var x=this.fontStyle,M=this.fontVariant,S=this.fontWeight,P=this.fontStretch,C=this.fontSize,h=this.lineHeight,p=this.fontFamily;return"".concat(x," ").concat(M," ").concat(S," ").concat(P," ").concat(C,"px/").concat(h,"px ").concat(p);},set:function set(x){if(x==null)this.fontStyle=null,this.fontVariant=null,this.fontWeight=null,this.fontStretch=null,this.fontSize=null,this.lineHeight=null,this.fontFamily=null;else{var M=Object(r.parseFont)(x);this.fontStyle=M.style,this.fontVariant=M.variant,this.fontWeight=M.weight,this.fontStretch=M.stretch,this.fontSize=Object(n.toNumber)("".concat(M.size).concat(M.unit)),M.lineHeight&&(this.lineHeight=M.pxLineHeight),this.fontFamily=M.family;}}}]);}(l["default"]);},/* 250 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return x;});var r=t(12),n=t(219),s=t(251),l=t(213),o=t(252);t(1).glMatrix.setMatrixArrayType(Array);function a(M,S,P){return S in M?Object.defineProperty(M,S,{value:P,enumerable:!0,configurable:!0,writable:!0}):M[S]=P,M;}var c=Symbol("zOrder"),y=Symbol("ordered"),f=Symbol("children"),g=Symbol("sealed");var x=/*#__PURE__*/function(_n$default4){function x(){var _this47;var S=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,x);_this47=_callSuper(this,x,[S]),_this47[f]=[],_this47[y]=null,_this47[c]=0;return _this47;}_inherits(x,_n$default4);return _createClass(x,[{key:"childNodes",get:function get(){return this[f];}},{key:"children",get:function get(){return this[f];}},{key:"orderedChildren",get:function get(){return this[y]||(this[y]=_toConsumableArray(this[f]),this[y].sort(function(S,P){return S.zIndex-P.zIndex||S.zOrder-P.zOrder;})),this[y];}},{key:"append",value:function append(){var _this48=this;for(var _len12=arguments.length,S=new Array(_len12),_key12=0;_key12<_len12;_key12++){S[_key12]=arguments[_key12];}return S.map(function(P){return _this48.appendChild(P);});}},{key:"appendChild",value:function appendChild(S){return S.remove(),this[f].push(S),S.connect(this,this[c]++),this[y]&&(this[y].length&&S.zIndex<this[y][this[y].length-1].zIndex?this.reorder():this[y].push(S)),S;}/* override */// get isVisible() {
|
|
341
|
+
// return this.attributes.opacity > 0 && this[_children].length > 0;
|
|
342
|
+
// }
|
|
343
|
+
/* override */},{key:"cloneNode",value:function cloneNode(){var S=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;var P=_superPropGet(x,"cloneNode",this,3)([]);return S&&this[f].forEach(function(C){var h=C.cloneNode(S);P.appendChild(h);}),P;}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(S){var P=this.orderedChildren;for(var _C25=P.length-1;_C25>=0;_C25--)if(P[_C25].dispatchPointerEvent(S))return!0;return _superPropGet(x,"dispatchPointerEvent",this,3)([S]);}/* override */},{key:"draw",value:function draw(){var S=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];if(this.__cacheRenderMatrix=this.renderMatrix,_superPropGet(x,"draw",this,3)([S]),!this[g]&&this.attributes.display!=="none"){var P=this.orderedChildren;for(var _C26=0;_C26<P.length;_C26++)P[_C26].draw(S);}return this.__cacheRenderMatrix=null,S;}},{key:"getElementById",value:function getElementById(S){return Object(o.querySelector)("#".concat(S),this);}},{key:"getElementsByClassName",value:function getElementsByClassName(S){return Object(o.querySelectorAll)(".".concat(S),this);}},{key:"getElementsByName",value:function getElementsByName(S){return Object(o.querySelectorAll)("[name=\"".concat(S,"\"]"),this);}},{key:"getElementsByTagName",value:function getElementsByTagName(S){return Object(o.querySelectorAll)(S,this);}},{key:"insertBefore",value:function insertBefore(S,P){if(P==null)return this.appendChild(S);S.remove();var C=this[f].indexOf(P);if(C<0)throw new Error("Invalid reference node.");var h=P.zOrder;for(var p=C;p<this[f].length;p++){var d=this[f][p].zOrder,v=this[f][p];delete v.zOrder,Object.defineProperty(v,"zOrder",{value:d+1,writable:!1,configurable:!0});}if(this[f].splice(C,0,S),S.connect(this,h),this[y])if(S.zIndex!==P.zIndex)this.reorder();else{var _p5=this[y].indexOf(P);this[y].splice(_p5,0,S);}return S;}},{key:"querySelector",value:function querySelector(S){return Object(o.querySelector)(S,this);}},{key:"querySelectorAll",value:function querySelectorAll(S){return Object(o.querySelectorAll)(S,this);}},{key:"replaceChild",value:function replaceChild(S,P){S.remove();var C=this[f].indexOf(P);if(C<0)throw new Error("Invalid reference node.");if(this[f][C]=S,S.connect(this,P.zOrder),this[y])if(S.zIndex!==P.zIndex)this.reorder();else{var _h23=this[y].indexOf(P);this[y][_h23]=S;}return P.disconnect(this),S;}},{key:"removeAllChildren",value:function removeAllChildren(){var S=this[f];for(var P=S.length-1;P>=0;P--)S[P].remove();}},{key:"removeChild",value:function removeChild(S){var P=this[f].indexOf(S);if(P>=0){if(this[f].splice(P,1),this[y]){var _C27=this[y].indexOf(S);this[y].splice(_C27,1);}return S.disconnect(this),S;}return null;}},{key:"reorder",value:function reorder(){this[y]=null;}},{key:"seal",value:function seal(){function S(p,d){var v=[];for(var I=0;I<p.length;I++){var L=_toConsumableArray(p[I]);for(var w=1;w<L.length;w+=2){var B=L[w],E=L[w+1];L[w]=B*d[0]+E*d[2]+d[4],L[w+1]=B*d[1]+E*d[3]+d[5];}v.push(L);}return v;}var P=this.orderedChildren,C=new r.Figure2D(),h=this.localMatrix;for(var p=0;p<P.length;p++){var d=P[p];if(d instanceof x&&(d=d.seal()),d.clientBox){var v=d.clientBox.contours.path;v=S(v,d.localMatrix),C.addPath(v);}if(d.path){var _v7=d.path.contours.path;_v7=S(_v7,d.localMatrix),C.addPath(_v7);}}return this[g]=!0,this.clientBox=C,{clientBox:C,localMatrix:h};}/* override */},{key:"setResolution",value:function setResolution(_ref145){var S=_ref145.width,P=_ref145.height;_superPropGet(x,"setResolution",this,3)([{width:S,height:P}]),this[f].forEach(function(C){C.setResolution({width:S,height:P});});}/* override */},{key:"updateContours",value:function updateContours(){this[g]||_superPropGet(x,"updateContours",this,3)([]);}}]);}(n["default"]);a(x,"Attr",s["default"]),l["default"].registerNode(x,"group");},/* 251 *//***/function(u,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$default20){function n(){_classCallCheck(this,n);return _callSuper(this,n,arguments);}_inherits(n,_r$default20);return _createClass(n);}(r["default"]);},/* 252 *//***/function(u,e,t){t.r(e),t.d(e,"querySelectorAll",function(){return g;}),t.d(e,"querySelector",function(){return x;}),t.d(e,"isMatched",function(){return M;}),t.d(e,"compile",function(){return S;});var r=t(221),n=t(213);t(1).glMatrix.setMatrixArrayType(Array);var s=t(253);function l(P){return P.nodeType===1||n["default"].isSpriteNode(P.nodeName);}function o(P){return Array.from(P.childNodes||[]);}function a(P){return n["default"].isSpriteNode(P.nodeName)?P.parent||P.canvas||P.container:P.parentElement;}function c(P){var C=P.length,h,p,d;for(;--C>-1;){for(h=p=P[C],P[C]=null,d=!0;p;){if(P.indexOf(p)>-1){d=!1,P.splice(C,1);break;}p=a(p);}d&&(P[C]=h);}return P;}var y={isTag:l,existsOne:function existsOne(P,C){return C.some(function(h){return l(h)?P(h)||y.existsOne(P,o(h)):!1;});},getSiblings:function getSiblings(P){var C=a(P);return C&&o(C);},getChildren:o,getParent:a,getAttributeValue:function getAttributeValue(P,C){if(P.nodeType===1&&C==="class"||C==="id")return P[C];if(this.hasAttrib(P,C)){var _h24=P.attributes[C];return Array.isArray(_h24)&&(_h24="[".concat(_h24.join(),"]")),String(_h24);}},hasAttrib:function hasAttrib(P,C){return P.attributes[C]!=null;},removeSubsets:c,getName:function getName(P){return P.tagName?P.tagName.toLowerCase():null;},findOne:function P(C,h){var p=null;for(var d=0,v=h.length;d<v&&!p;d++)if(C(h[d]))p=h[d];else{var I=o(h[d]);I&&I.length>0&&(p=P(C,I));}return p;},findAll:function P(C,h){var p=[];for(var d=0,v=h.length;d<v;d++){if(!l(h[d]))continue;C(h[d])&&p.push(h[d]);var I=o(h[d]);I&&(p=p.concat(P(C,I)));}return p;},getText:function P(C){return Array.isArray(C)?C.map(P).join(""):l(C)?P(o(C)):C.nodeType===3?C.nodeValue:n["default"].isSpriteNode(C.nodeName)?C.text:"";}};function f(P){if(typeof P!="string")return P;var C=P.match(/\[(bgcolor|fillColor|strokeColor|color)\s*=\s*['"]?\w+['"]?\]/g);return C&&(C=C.map(function(h){var p=h.slice(1,-1).split("="),d=Object(r.parseColor)(p[1].replace(/['"]/g,""));return[h,"[".concat(p[0],"=\"").concat(d,"\"]")];}),C.forEach(function(_ref146){var _ref147=_slicedToArray(_ref146,2),h=_ref147[0],p=_ref147[1];P=P.replace(h,p);})),C=P.match(/\[\w+\s*=\s*['"]\[.+?\]['"]\]/g),C&&(C=C.map(function(h){var p=h.slice(1,-1).split("="),d=p[1].slice(2,-2).split(/,/g).map(function(v){return v.trim();});return[h,"[".concat(p[0],"=\"[").concat(d,"]\"]")];}),C.forEach(function(_ref148){var _ref149=_slicedToArray(_ref148,2),h=_ref149[0],p=_ref149[1];P=P.replace(h,p);})),P;}function g(P,C){return s.selectAll(f(P),C,{adapter:y});}function x(P,C){return s.selectOne(f(P),C,{adapter:y});}function M(P,C){return s.is(P,f(C),{adapter:y});}function S(P){return s.compile(f(P),{adapter:y});}},/* 253 *//***/function(u,e,t){u.exports=S;var r=t(254),n=t(273).falseFunc,s=t(274);function l(P){return function(h,p,d){return p=p||{},p.adapter=p.adapter||r,P(h,p,d);};}var o=l(s),a=l(s.compileUnsafe);function c(P){return function(h,p,d){return d=d||{},d.adapter=d.adapter||r,typeof h!="function"&&(h=a(h,d,p)),h.shouldTestNextSiblings&&(p=f(d&&d.context||p,d.adapter)),Array.isArray(p)?p=d.adapter.removeSubsets(p):p=d.adapter.getChildren(p),P(h,p,d);};}function y(P,C){var h=C.getSiblings(P);if(!Array.isArray(h))return[];for(h=h.slice(0);h.shift()!==P;);return h;}function f(P,C){Array.isArray(P)||(P=[P]);for(var h=P.slice(0),p=0,d=P.length;p<d;p++){var v=y(h[p],C);h.push.apply(h,v);}return h;}var g=c(function(C,h,p){return C===n||!h||h.length===0?[]:p.adapter.findAll(C,h);}),x=c(function(C,h,p){return C===n||!h||h.length===0?null:p.adapter.findOne(C,h);});function M(P,C,h){return h=h||{},h.adapter=h.adapter||r,(typeof C=="function"?C:o(C,h))(P);}function S(P,C,h){return g(P,C,h);}S.compile=o,S.filters=s.Pseudos.filters,S.pseudos=s.Pseudos.pseudos,S.selectAll=g,S.selectOne=x,S.is=M,S.parse=o,S.iterate=g,S._compileUnsafe=a,S._compileToken=s.compileToken;},/* 254 *//***/function(u,e,t){var r=u.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(u,e,t){var r=t(256),n=t(257),s=r.isTag;u.exports={getInnerHTML:l,getOuterHTML:n,getText:o};function l(a,c){return a.children?a.children.map(function(y){return n(y,c);}).join(""):"";}function o(a){return Array.isArray(a)?a.map(o).join(""):s(a)?a.name==="br"?"\n":o(a.children):a.type===r.CDATA?o(a.children):a.type===r.Text?a.data:"";}},/* 256 *//***/function(u,e){u.exports={Text:"text",//Text
|
|
344
|
+
Directive:"directive",//<? ... ?>
|
|
345
|
+
Comment:"comment",//<!-- ... -->
|
|
346
|
+
Script:"script",//<script> tags
|
|
347
|
+
Style:"style",//<style> tags
|
|
348
|
+
Tag:"tag",//Any tag
|
|
349
|
+
CDATA:"cdata",//<![CDATA[ ... ]]>
|
|
350
|
+
Doctype:"doctype",isTag:function isTag(t){return t.type==="tag"||t.type==="script"||t.type==="style";}};},/* 257 *//***/function(u,e,t){var r=t(258),n=t(259),s=t(267);s.elementNames.__proto__=null,s.attributeNames.__proto__=null;var l={__proto__:null,style:!0,script:!0,xmp:!0,iframe:!0,noembed:!0,noframes:!0,plaintext:!0,noscript:!0};function o(P,C){if(P){var h="",p;for(var d in P)p=P[d],h&&(h+=" "),C.xmlMode==="foreign"&&(d=s.attributeNames[d]||d),h+=d,(p!==null&&p!==""||C.xmlMode)&&(h+='="'+(C.decodeEntities?n.encodeXML(p):p.replace(/\"/g,"""))+'"');return h;}}var a={__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},c=u.exports=function(P,C){!Array.isArray(P)&&!P.cheerio&&(P=[P]),C=C||{};for(var h="",p=0;p<P.length;p++){var d=P[p];d.type==="root"?h+=c(d.children,C):r.isTag(d)?h+=f(d,C):d.type===r.Directive?h+=g(d):d.type===r.Comment?h+=S(d):d.type===r.CDATA?h+=M(d):h+=x(d,C);}return h;},y=["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"];function f(P,C){C.xmlMode==="foreign"&&(P.name=s.elementNames[P.name]||P.name,P.parent&&y.indexOf(P.parent.name)>=0&&(C=Object.assign({},C,{xmlMode:!1}))),!C.xmlMode&&["svg","math"].indexOf(P.name)>=0&&(C=Object.assign({},C,{xmlMode:"foreign"}));var h="<"+P.name,p=o(P.attribs,C);return p&&(h+=" "+p),C.xmlMode&&(!P.children||P.children.length===0)?h+="/>":(h+=">",P.children&&(h+=c(P.children,C)),(!a[P.name]||C.xmlMode)&&(h+="</"+P.name+">")),h;}function g(P){return"<"+P.data+">";}function x(P,C){var h=P.data||"";return C.decodeEntities&&!(P.parent&&P.parent.name in l)&&(h=n.encodeXML(h)),h;}function M(P){return"<![CDATA["+P.children[0].data+"]]>";}function S(P){return"<!--"+P.data+"-->";}},/* 258 *//***/function(u,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(u,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(y,f){return(!f||f<=0?r.decodeXML:r.decodeHTML)(y);}e.decode=s;function l(y,f){return(!f||f<=0?r.decodeXML:r.decodeHTMLStrict)(y);}e.decodeStrict=l;function o(y,f){return(!f||f<=0?n.encodeXML:n.encodeHTML)(y);}e.encode=o;var a=t(266);Object.defineProperty(e,"encodeXML",{enumerable:!0,get:function get(){return a.encodeXML;}}),Object.defineProperty(e,"encodeHTML",{enumerable:!0,get:function get(){return a.encodeHTML;}}),Object.defineProperty(e,"escape",{enumerable:!0,get:function get(){return a.escape;}}),Object.defineProperty(e,"encodeHTML4",{enumerable:!0,get:function get(){return a.encodeHTML;}}),Object.defineProperty(e,"encodeHTML5",{enumerable:!0,get:function get(){return a.encodeHTML;}});var c=t(260);Object.defineProperty(e,"decodeXML",{enumerable:!0,get:function get(){return c.decodeXML;}}),Object.defineProperty(e,"decodeHTML",{enumerable:!0,get:function get(){return c.decodeHTML;}}),Object.defineProperty(e,"decodeHTMLStrict",{enumerable:!0,get:function get(){return c.decodeHTMLStrict;}}),Object.defineProperty(e,"decodeHTML4",{enumerable:!0,get:function get(){return c.decodeHTML;}}),Object.defineProperty(e,"decodeHTML5",{enumerable:!0,get:function get(){return c.decodeHTML;}}),Object.defineProperty(e,"decodeHTML4Strict",{enumerable:!0,get:function get(){return c.decodeHTMLStrict;}}),Object.defineProperty(e,"decodeHTML5Strict",{enumerable:!0,get:function get(){return c.decodeHTMLStrict;}}),Object.defineProperty(e,"decodeXMLStrict",{enumerable:!0,get:function get(){return c.decodeXML;}});},/* 260 *//***/function(u,e,t){var r=this&&this.__importDefault||function(f){return f&&f.__esModule?f:{"default":f};};Object.defineProperty(e,"__esModule",{value:!0}),e.decodeHTML=e.decodeHTMLStrict=e.decodeXML=void 0;var n=r(t(261)),s=r(t(262)),l=r(t(263)),o=r(t(264));e.decodeXML=a(l["default"]),e.decodeHTMLStrict=a(n["default"]);function a(f){var g=Object.keys(f).join("|"),x=y(f);g+="|#[xX][\\da-fA-F]+|#\\d+";var M=new RegExp("&(?:"+g+");","g");return function(S){return String(S).replace(M,x);};}var c=function c(f,g){return f<g?1:-1;};e.decodeHTML=function(){for(var f=Object.keys(s["default"]).sort(c),g=Object.keys(n["default"]).sort(c),x=0,M=0;x<g.length;x++)f[M]===g[x]?(g[x]+=";?",M++):g[x]+=";";var S=new RegExp("&(?:"+g.join("|")+"|#[xX][\\da-fA-F]+;?|#\\d+;?)","g"),P=y(n["default"]);function C(h){return h.substr(-1)!==";"&&(h+=";"),P(h);}return function(h){return String(h).replace(S,C);};}();function y(f){return function(x){if(x.charAt(1)==="#"){var M=x.charAt(2);return M==="X"||M==="x"?o["default"](parseInt(x.substr(3),16)):o["default"](parseInt(x.substr(2),10));}return f[x.slice(1,-1)];};}},/* 261 *//***/function(u){u.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(u){u.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(u){u.exports=JSON.parse("{\"amp\":\"&\",\"apos\":\"'\",\"gt\":\">\",\"lt\":\"<\",\"quot\":\"\\\"\"}");},/* 264 *//***/function(u,e,t){var r=this&&this.__importDefault||function(l){return l&&l.__esModule?l:{"default":l};};Object.defineProperty(e,"__esModule",{value:!0});var n=r(t(265));function s(l){if(l>=55296&&l<=57343||l>1114111)return"�";l in n["default"]&&(l=n["default"][l]);var o="";return l>65535&&(l-=65536,o+=String.fromCharCode(l>>>10&1023|55296),l=56320|l&1023),o+=String.fromCharCode(l),o;}e["default"]=s;},/* 265 *//***/function(u){u.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(u,e,t){var r=this&&this.__importDefault||function(C){return C&&C.__esModule?C:{"default":C};};Object.defineProperty(e,"__esModule",{value:!0}),e.escape=e.encodeHTML=e.encodeXML=void 0;var n=r(t(263)),s=y(n["default"]),l=f(s);e.encodeXML=M(s,l);var o=r(t(261)),a=y(o["default"]),c=f(a);e.encodeHTML=M(a,c);function y(C){return Object.keys(C).sort().reduce(function(h,p){return h[C[p]]="&"+p+";",h;},{});}function f(C){for(var h=[],p=[],d=0,v=Object.keys(C);d<v.length;d++){var I=v[d];I.length===1?h.push("\\"+I):p.push(I);}h.sort();for(var L=0;L<h.length-1;L++){for(var w=L;w<h.length-1&&h[w].charCodeAt(1)+1===h[w+1].charCodeAt(1);)w+=1;var B=1+w-L;B<3||h.splice(L,B,h[L]+"-"+h[w]);}return p.unshift("["+h.join("")+"]"),new RegExp(p.join("|"),"g");}var g=/(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g;function x(C){return"&#x"+C.codePointAt(0).toString(16).toUpperCase()+";";}function M(C,h){return function(p){return p.replace(h,function(d){return C[d];}).replace(g,x);};}var S=f(s);function P(C){return C.replace(S,x).replace(g,x);}e.escape=P;},/* 267 *//***/function(u){u.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(u,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(u,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 l=r.parent=t.parent;if(l){var o=l.children;o[o.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 l=n.children;l.splice(l.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(u,e,t){var r=t(256).isTag;u.exports={filter:n,find:s,findOneChild:l,findOne:o,existsOne:a,findAll:c};function n(y,f,g,x){return Array.isArray(f)||(f=[f]),(typeof x!="number"||!isFinite(x))&&(x=1/0),s(y,f,g!==!1,x);}function s(y,f,g,x){for(var M=[],S,P=0,C=f.length;P<C&&!(y(f[P])&&(M.push(f[P]),--x<=0)||(S=f[P].children,g&&S&&S.length>0&&(S=s(y,S,g,x),M=M.concat(S),x-=S.length,x<=0)));P++);return M;}function l(y,f){for(var g=0,x=f.length;g<x;g++)if(y(f[g]))return f[g];return null;}function o(y,f){for(var g=null,x=0,M=f.length;x<M&&!g;x++)if(r(f[x]))y(f[x])?g=f[x]:f[x].children.length>0&&(g=o(y,f[x].children));else continue;return g;}function a(y,f){for(var g=0,x=f.length;g<x;g++)if(r(f[g])&&(y(f[g])||f[g].children.length>0&&a(y,f[g].children)))return!0;return!1;}function c(y,f){for(var g=[],x=f.slice();x.length;){var M=x.shift();r(M)&&(M.children&&M.children.length>0&&x.unshift.apply(x,M.children),y(M)&&g.push(M));}return g;}},/* 271 *//***/function(u,e,t){var r=t(256),n=e.isTag=r.isTag;e.testElement=function(a,c){for(var y in a)if(a.hasOwnProperty(y)){if(y==="tag_name"){if(!n(c)||!a.tag_name(c.name))return!1;}else if(y==="tag_type"){if(!a.tag_type(c.type))return!1;}else if(y==="tag_contains"){if(n(c)||!a.tag_contains(c.data))return!1;}else if(!c.attribs||!a[y](c.attribs[y]))return!1;}return!0;};var s={tag_name:function tag_name(a){return typeof a=="function"?function(c){return n(c)&&a(c.name);}:a==="*"?n:function(c){return n(c)&&c.name===a;};},tag_type:function tag_type(a){return typeof a=="function"?function(c){return a(c.type);}:function(c){return c.type===a;};},tag_contains:function tag_contains(a){return typeof a=="function"?function(c){return!n(c)&&a(c.data);}:function(c){return!n(c)&&c.data===a;};}};function l(a,c){return typeof c=="function"?function(y){return y.attribs&&c(y.attribs[a]);}:function(y){return y.attribs&&y.attribs[a]===c;};}function o(a,c){return function(y){return a(y)||c(y);};}e.getElements=function(a,c,y,f){var g=Object.keys(a).map(function(x){var M=a[x];return x in s?s[x](M):l(x,M);});return g.length===0?[]:this.filter(g.reduce(o),c,y,f);},e.getElementById=function(a,c,y){return Array.isArray(c)||(c=[c]),this.findOne(l("id",a),c,y!==!1);},e.getElementsByTagName=function(a,c,y,f){return this.filter(s.tag_name(a),c,y,f);},e.getElementsByTagType=function(a,c,y,f){return this.filter(s.tag_type(a),c,y,f);};},/* 272 *//***/function(u,e){e.removeSubsets=function(n){for(var s=n.length,l,o,a;--s>-1;){for(l=o=n[s],n[s]=null,a=!0;o;){if(n.indexOf(o)>-1){a=!1,n.splice(s,1);break;}o=o.parent;}a&&(n[s]=l);}return n;};var t={DISCONNECTED:1,PRECEDING:2,FOLLOWING:4,CONTAINS:8,CONTAINED_BY:16},r=e.compareDocumentPosition=function(n,s){var l=[],o=[],a,c,y,f,g,x;if(n===s)return 0;for(a=n;a;)l.unshift(a),a=a.parent;for(a=s;a;)o.unshift(a),a=a.parent;for(x=0;l[x]===o[x];)x++;return x===0?t.DISCONNECTED:(c=l[x-1],y=c.children,f=l[x],g=o[x],y.indexOf(f)>y.indexOf(g)?c===s?t.FOLLOWING|t.CONTAINED_BY:t.FOLLOWING:c===n?t.PRECEDING|t.CONTAINS:t.PRECEDING);};e.uniqueSort=function(n){var s=n.length,l,o;for(n=n.slice();--s>-1;)l=n[s],o=n.indexOf(l),o>-1&&o<s&&n.splice(s,1);return n.sort(function(a,c){var y=r(a,c);return y&t.PRECEDING?-1:y&t.FOLLOWING?1:0;}),n;};},/* 273 *//***/function(u,e){u.exports={trueFunc:function trueFunc(){return!0;},falseFunc:function falseFunc(){return!1;}};},/* 274 *//***/function(u,e,t){u.exports=g;var r=t(275).parse,n=t(273),s=t(278),l=t(279),o=t(280),a=t(282),c=n.trueFunc,y=n.falseFunc,f=a.filters;function g(E,b,W){var D=M(E,b,W);return x(D,b);}function x(E,b){var W=b.adapter;return function(R){return W.isTag(R)&&E(R);};}function M(E,b,W){var D=r(E,b);return v(D,b,W);}function S(E){return E.type==="pseudo"&&(E.name==="scope"||Array.isArray(E.data)&&E.data.some(function(b){return b.some(S);}));}var P={type:"descendant"},C={type:"_flexibleDescendant"},h={type:"pseudo",name:"scope"},p={};function d(E,b,W){var D=b.adapter,R=!!W&&!!W.length&&W.every(function(Y){return Y===p||!!D.getParent(Y);});E.forEach(function(Y){if(!(Y.length>0&&I(Y[0])&&Y[0].type!=="descendant"))if(R&&!(Array.isArray(Y)?Y.some(S):S(Y)))Y.unshift(P);else return;Y.unshift(h);});}function v(E,b,W){E=E.filter(function(V){return V.length>0;}),E.forEach(s);var D=Array.isArray(W);W=b&&b.context||W,W&&!D&&(W=[W]),d(E,b,W);var R=!1,Y=E.map(function(V){if(V[0]&&V[1]&&V[0].name==="scope"){var Q=V[1].type;D&&Q==="descendant"?V[1]=C:(Q==="adjacent"||Q==="sibling")&&(R=!0);}return L(V,b,W);}).reduce(w,y);return Y.shouldTestNextSiblings=R,Y;}function I(E){return l[E.type]<0;}function L(E,b,W){return E.reduce(function(D,R){if(D===y)return D;if(!(R.type in o))throw new Error("Rule type "+R.type+" is not supported by css-select");return o[R.type](D,R,b,W);},b&&b.rootFunc||c);}function w(E,b){return b===y||E===c?E:E===y||b===c?b:function(D){return E(D)||b(D);};}function B(E){return E.some(I);}f.not=function(E,b,W,D){var R={xmlMode:!!(W&&W.xmlMode),strict:!!(W&&W.strict),adapter:W.adapter};if(R.strict&&(b.length>1||b.some(B)))throw new Error("complex selectors in :not aren't allowed in strict mode");var Y=v(b,R,D);return Y===y?E:Y===c?y:function(Q){return!Y(Q)&&E(Q);};},f.has=function(E,b,W){var D=W.adapter,R={xmlMode:!!(W&&W.xmlMode),strict:!!(W&&W.strict),adapter:D},Y=b.some(B)?[p]:null,V=v(b,R,Y);return V===y?y:V===c?function(et){return D.getChildren(et).some(D.isTag)&&E(et);}:(V=x(V,W),Y?function(et){return E(et)&&(Y[0]=et,D.existsOne(V,D.getChildren(et)));}:function(et){return E(et)&&D.existsOne(V,D.getChildren(et));});},f.matches=function(E,b,W,D){var R={xmlMode:!!(W&&W.xmlMode),strict:!!(W&&W.strict),rootFunc:E,adapter:W.adapter};return v(b,R,D);},g.compileToken=v,g.compileUnsafe=M,g.Pseudos=a;},/* 275 *//***/function(u,e,t){var r=this&&this.__createBinding||(Object.create?function(o,a,c,y){y===void 0&&(y=c),Object.defineProperty(o,y,{enumerable:!0,get:function get(){return a[c];}});}:function(o,a,c,y){y===void 0&&(y=c),o[y]=a[c];}),n=this&&this.__exportStar||function(o,a){for(var c in o)c!=="default"&&!a.hasOwnProperty(c)&&r(a,o,c);};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 l=t(277);Object.defineProperty(e,"stringify",{enumerable:!0,get:function get(){return l["default"];}});},/* 276 *//***/function(u,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=S;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)?\]/,l={undefined:"exists","":"equals","~":"element","^":"start",$:"end","*":"any","!":"not","|":"hyphen"},o={">":"child","<":"parent","~":"sibling","+":"adjacent"},a={"#":["id","equals"],".":["class","element"]},c=/* @__PURE__ */new Set(["has","not","matches"]),y=/* @__PURE__ */new Set(["contains","icontains"]),f=/* @__PURE__ */new Set(['"',"'"]);function g(h,p,d){var v=parseInt(p,16)-65536;return v!==v||d?p:v<0?// BMP codepoint
|
|
351
|
+
String.fromCharCode(v+65536):// Supplemental Plane codepoint (surrogate pair)
|
|
352
|
+
String.fromCharCode(v>>10|55296,v&1023|56320);}function x(h){return h.replace(n,g);}function M(h){return h===" "||h==="\n"||h===" "||h==="\f"||h==="\r";}function S(h,p){var d=[];if(h=P(d,""+h,p),h!=="")throw new Error("Unmatched selector: "+h);return d;}function P(h,p,d){var v=[],I=!1;function L(){var rt=p.match(r);if(!rt)throw new Error("Expected name, found "+p);var lt=rt[0];return p=p.substr(lt.length),x(lt);}function w(rt){for(;M(p.charAt(rt));)rt++;p=p.substr(rt);}function B(rt){for(var lt=0;p.charAt(--rt)==="\\";)lt++;return(lt&1)===1;}for(w(0);p!=="";){var E=p.charAt(0);if(M(E))I=!0,w(1);else if(E in o)v.push({type:o[E]}),I=!1,w(1);else if(E===","){if(v.length===0)throw new Error("Empty sub-selector");h.push(v),v=[],I=!1,w(1);}else if(I&&(v.length>0&&v.push({type:"descendant"}),I=!1),E==="*")p=p.substr(1),v.push({type:"universal"});else if(E in a){var b=a[E],W=b[0],D=b[1];p=p.substr(1),v.push({type:"attribute",name:W,action:D,value:L(),ignoreCase:!1});}else if(E==="["){p=p.substr(1);var R=p.match(s);if(!R)throw new Error("Malformed attribute selector: "+p);p=p.substr(R[0].length);var Y=x(R[1]);(!d||("lowerCaseAttributeNames"in d?d.lowerCaseAttributeNames:!d.xmlMode))&&(Y=Y.toLowerCase()),v.push({type:"attribute",name:Y,action:l[R[2]],value:x(R[4]||R[5]||""),ignoreCase:!!R[6]});}else if(E===":"){if(p.charAt(1)===":"){p=p.substr(2),v.push({type:"pseudo-element",name:L().toLowerCase()});continue;}p=p.substr(1);var V=L().toLowerCase(),R=null;if(p.charAt(0)==="(")if(c.has(V)){var Q=p.charAt(1),et=f.has(Q);if(p=p.substr(et?2:1),R=[],p=P(R,p,d),et){if(p.charAt(0)!==Q)throw new Error("Unmatched quotes in :"+V);p=p.substr(1);}if(p.charAt(0)!==")")throw new Error("Missing closing parenthesis in :"+V+" ("+p+")");p=p.substr(1);}else{for(var it=1,$=1;$>0&&it<p.length;it++)p.charAt(it)==="("&&!B(it)?$++:p.charAt(it)===")"&&!B(it)&&$--;if($)throw new Error("Parenthesis not matched");if(R=p.substr(1,it-2),p=p.substr(it),y.has(V)){var Q=R.charAt(0);Q===R.slice(-1)&&f.has(Q)&&(R=R.slice(1,-1)),R=x(R);}}v.push({type:"pseudo",name:V,data:R});}else if(r.test(p)){var K=L();(!d||("lowerCaseTags"in d?d.lowerCaseTags:!d.xmlMode))&&(K=K.toLowerCase()),v.push({type:"tag",name:K});}else return v.length&&v[v.length-1].type==="descendant"&&v.pop(),C(h,v),p;}return C(h,v),p;}function C(h,p){if(h.length>0&&p.length===0)throw new Error("Empty sub-selector");h.push(p);}},/* 277 *//***/function(u,e,t){Object.defineProperty(e,"__esModule",{value:!0});var r={equals:"",element:"~",start:"^",end:"$",any:"*",not:"!",hyphen:"|"};function n(a){return a.map(s).join(", ");}e["default"]=n;function s(a){return a.map(l).join("");}function l(a){switch(a.type){case"child":return" > ";case"parent":return" < ";case"sibling":return" ~ ";case"adjacent":return" + ";case"descendant":return" ";case"universal":return"*";case"tag":return a.name;case"pseudo-element":return"::"+a.name;case"pseudo":return a.data===null?":"+a.name:typeof a.data=="string"?":"+a.name+"("+a.data+")":":"+a.name+"("+n(a.data)+")";case"attribute":return a.action==="exists"?"["+a.name+"]":a.name==="id"&&a.action==="equals"&&!a.ignoreCase?"#"+a.value:a.name==="class"&&a.action==="element"&&!a.ignoreCase?"."+a.value:"["+a.name+r[a.action]+"='"+a.value+"'"+(a.ignoreCase?"i":"")+"]";default:throw new Error("Unknown type");}}function o(a){return a;}},/* 278 *//***/function(u,e,t){u.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(o){for(var a=o.map(l),c=1;c<o.length;c++){var y=a[c];if(!(y<0))for(var f=c-1;f>=0&&y<a[f];f--){var g=o[f+1];o[f+1]=o[f],o[f]=g,a[f+1]=a[f],a[f]=y;}}}function l(o){var a=r[o.type];if(a===r.attribute)a=n[o.action],a===n.equals&&o.name==="id"&&(a=9),o.ignoreCase&&(a>>=1);else if(a===r.pseudo)if(!o.data)a=3;else if(o.name==="has"||o.name==="contains")a=0;else if(o.name==="matches"||o.name==="not"){a=0;for(var c=0;c<o.data.length;c++)if(o.data[c].length===1){var y=l(o.data[c][0]);if(y===0){a=0;break;}y>a&&(a=y);}o.data.length>1&&a>0&&(a-=1);}else a=1;return a;}},/* 279 *//***/function(u){u.exports=JSON.parse('{"universal":50,"tag":30,"attribute":1,"pseudo":0,"descendant":-1,"child":-1,"parent":-1,"sibling":-1,"adjacent":-1}');},/* 280 *//***/function(u,e,t){var r=t(281),n=t(282);u.exports={__proto__:null,attribute:r.compile,pseudo:n.compile,//tags
|
|
353
|
+
tag:function tag(s,l,o){var a=l.name,c=o.adapter;return function(f){return c.getName(f)===a&&s(f);};},//traversal
|
|
354
|
+
descendant:function descendant(s,l,o){var a=(typeof WeakSet==="undefined"?"undefined":_typeof(WeakSet))<"u"?/* @__PURE__ */new WeakSet():null,c=o.adapter;return function(f){for(var g=!1;!g&&(f=c.getParent(f));)(!a||!a.has(f))&&(g=s(f),!g&&a&&a.add(f));return g;};},_flexibleDescendant:function _flexibleDescendant(s,l,o){var a=o.adapter;return function(y){for(var f=s(y);!f&&(y=a.getParent(y));)f=s(y);return f;};},parent:function parent(s,l,o){if(o&&o.strict)throw new Error("Parent selector isn't part of CSS3");var a=o.adapter;return function(f){return a.getChildren(f).some(c);};function c(y){return a.isTag(y)&&s(y);}},child:function child(s,l,o){var a=o.adapter;return function(y){var f=a.getParent(y);return!!f&&s(f);};},sibling:function sibling(s,l,o){var a=o.adapter;return function(y){for(var f=a.getSiblings(y),g=0;g<f.length;g++)if(a.isTag(f[g])){if(f[g]===y)break;if(s(f[g]))return!0;}return!1;};},adjacent:function adjacent(s,l,o){var a=o.adapter;return function(y){for(var f=a.getSiblings(y),g,x=0;x<f.length;x++)if(a.isTag(f[x])){if(f[x]===y)break;g=f[x];}return!!g&&s(g);};},universal:function universal(s){return s;}};},/* 281 *//***/function(u,e,t){var r=t(273).falseFunc,n=/[-[\]{}()*+?.,\\^$|#\s]/g,s={__proto__:null,equals:function equals(l,o,a){var c=o.name,y=o.value,f=a.adapter;return o.ignoreCase?(y=y.toLowerCase(),function(x){var M=f.getAttributeValue(x,c);return M!=null&&M.toLowerCase()===y&&l(x);}):function(x){return f.getAttributeValue(x,c)===y&&l(x);};},hyphen:function hyphen(l,o,a){var c=o.name,y=o.value,f=y.length,g=a.adapter;return o.ignoreCase?(y=y.toLowerCase(),function(M){var S=g.getAttributeValue(M,c);return S!=null&&(S.length===f||S.charAt(f)==="-")&&S.substr(0,f).toLowerCase()===y&&l(M);}):function(M){var S=g.getAttributeValue(M,c);return S!=null&&S.substr(0,f)===y&&(S.length===f||S.charAt(f)==="-")&&l(M);};},element:function element(l,o,a){var c=o.name,y=o.value,f=a.adapter;if(/\s/.test(y))return r;y=y.replace(n,"\\$&");var g="(?:^|\\s)"+y+"(?:$|\\s)",x=o.ignoreCase?"i":"",M=new RegExp(g,x);return function(P){var C=f.getAttributeValue(P,c);return C!=null&&M.test(C)&&l(P);};},exists:function exists(l,o,a){var c=o.name,y=a.adapter;return function(g){return y.hasAttrib(g,c)&&l(g);};},start:function start(l,o,a){var c=o.name,y=o.value,f=y.length,g=a.adapter;return f===0?r:o.ignoreCase?(y=y.toLowerCase(),function(M){var S=g.getAttributeValue(M,c);return S!=null&&S.substr(0,f).toLowerCase()===y&&l(M);}):function(M){var S=g.getAttributeValue(M,c);return S!=null&&S.substr(0,f)===y&&l(M);};},end:function end(l,o,a){var c=o.name,y=o.value,f=-y.length,g=a.adapter;return f===0?r:o.ignoreCase?(y=y.toLowerCase(),function(M){var S=g.getAttributeValue(M,c);return S!=null&&S.substr(f).toLowerCase()===y&&l(M);}):function(M){var S=g.getAttributeValue(M,c);return S!=null&&S.substr(f)===y&&l(M);};},any:function any(l,o,a){var c=o.name,y=o.value,f=a.adapter;if(y==="")return r;if(o.ignoreCase){var g=new RegExp(y.replace(n,"\\$&"),"i");return function(M){var S=f.getAttributeValue(M,c);return S!=null&&g.test(S)&&l(M);};}return function(M){var S=f.getAttributeValue(M,c);return S!=null&&S.indexOf(y)>=0&&l(M);};},not:function not(l,o,a){var c=o.name,y=o.value,f=a.adapter;return y===""?function(x){return!!f.getAttributeValue(x,c)&&l(x);}:o.ignoreCase?(y=y.toLowerCase(),function(x){var M=f.getAttributeValue(x,c);return M!=null&&M.toLowerCase()!==y&&l(x);}):function(x){return f.getAttributeValue(x,c)!==y&&l(x);};}};u.exports={compile:function compile(l,o,a){if(a&&a.strict&&(o.ignoreCase||o.action==="not"))throw new Error("Unsupported attribute selector");return s[o.action](l,o,a);},rules:s};},/* 282 *//***/function(u,e,t){var r=t(283),n=t(273),s=t(281),l=n.trueFunc,o=n.falseFunc,a=s.rules.equals;function c(C,h){var p={name:C,value:h};return function(v,I,L){return a(v,p,L);};}function y(C,h){return function(p){return!!h.getParent(p)&&C(p);};}var f={contains:function contains(C,h,p){var d=p.adapter;return function(I){return C(I)&&d.getText(I).indexOf(h)>=0;};},icontains:function icontains(C,h,p){var d=h.toLowerCase(),v=p.adapter;return function(L){return C(L)&&v.getText(L).toLowerCase().indexOf(d)>=0;};},//location specific methods
|
|
355
|
+
"nth-child":function nthChild(C,h,p){var d=r(h),v=p.adapter;return d===o?d:d===l?y(C,v):function(L){for(var w=v.getSiblings(L),B=0,E=0;B<w.length;B++)if(v.isTag(w[B])){if(w[B]===L)break;E++;}return d(E)&&C(L);};},"nth-last-child":function nthLastChild(C,h,p){var d=r(h),v=p.adapter;return d===o?d:d===l?y(C,v):function(L){for(var w=v.getSiblings(L),B=0,E=w.length-1;E>=0;E--)if(v.isTag(w[E])){if(w[E]===L)break;B++;}return d(B)&&C(L);};},"nth-of-type":function nthOfType(C,h,p){var d=r(h),v=p.adapter;return d===o?d:d===l?y(C,v):function(L){for(var w=v.getSiblings(L),B=0,E=0;E<w.length;E++)if(v.isTag(w[E])){if(w[E]===L)break;v.getName(w[E])===v.getName(L)&&B++;}return d(B)&&C(L);};},"nth-last-of-type":function nthLastOfType(C,h,p){var d=r(h),v=p.adapter;return d===o?d:d===l?y(C,v):function(L){for(var w=v.getSiblings(L),B=0,E=w.length-1;E>=0;E--)if(v.isTag(w[E])){if(w[E]===L)break;v.getName(w[E])===v.getName(L)&&B++;}return d(B)&&C(L);};},//TODO determine the actual root element
|
|
356
|
+
root:function root(C,h,p){var d=p.adapter;return function(v){return!d.getParent(v)&&C(v);};},scope:function scope(C,h,p,d){var v=p.adapter;if(!d||d.length===0)return f.root(C,h,p);function I(L,w){return typeof v.equals=="function"?v.equals(L,w):L===w;}return d.length===1?function(L){return I(d[0],L)&&C(L);}:function(L){return d.indexOf(L)>=0&&C(L);};},//jQuery extensions (others follow as pseudos)
|
|
357
|
+
checkbox:c("type","checkbox"),file:c("type","file"),password:c("type","password"),radio:c("type","radio"),reset:c("type","reset"),image:c("type","image"),submit:c("type","submit"),//dynamic state pseudos. These depend on optional Adapter methods.
|
|
358
|
+
hover:function hover(C,h,p){var d=p.adapter;return typeof d.isHovered=="function"?function(I){return C(I)&&d.isHovered(I);}:o;},visited:function visited(C,h,p){var d=p.adapter;return typeof d.isVisited=="function"?function(I){return C(I)&&d.isVisited(I);}:o;},active:function active(C,h,p){var d=p.adapter;return typeof d.isActive=="function"?function(I){return C(I)&&d.isActive(I);}:o;}};function g(C,h){for(var p=0;C&&p<C.length;p++)if(h.isTag(C[p]))return C[p];}var x={empty:function empty(C,h){return!h.getChildren(C).some(function(p){return h.isTag(p)||p.type==="text";});},"first-child":function firstChild(C,h){return g(h.getSiblings(C),h)===C;},"last-child":function lastChild(C,h){for(var p=h.getSiblings(C),d=p.length-1;d>=0;d--){if(p[d]===C)return!0;if(h.isTag(p[d]))break;}return!1;},"first-of-type":function firstOfType(C,h){for(var p=h.getSiblings(C),d=0;d<p.length;d++)if(h.isTag(p[d])){if(p[d]===C)return!0;if(h.getName(p[d])===h.getName(C))break;}return!1;},"last-of-type":function lastOfType(C,h){for(var p=h.getSiblings(C),d=p.length-1;d>=0;d--)if(h.isTag(p[d])){if(p[d]===C)return!0;if(h.getName(p[d])===h.getName(C))break;}return!1;},"only-of-type":function onlyOfType(C,h){for(var p=h.getSiblings(C),d=0,v=p.length;d<v;d++)if(h.isTag(p[d])){if(p[d]===C)continue;if(h.getName(p[d])===h.getName(C))return!1;}return!0;},"only-child":function onlyChild(C,h){for(var p=h.getSiblings(C),d=0;d<p.length;d++)if(h.isTag(p[d])&&p[d]!==C)return!1;return!0;},//:matches(a, area, link)[href]
|
|
359
|
+
link:function link(C,h){return h.hasAttrib(C,"href");},//TODO: :any-link once the name is finalized (as an alias of :link)
|
|
360
|
+
//forms
|
|
361
|
+
//to consider: :target
|
|
362
|
+
//:matches([selected], select:not([multiple]):not(> option[selected]) > option:first-of-type)
|
|
363
|
+
selected:function selected(C,h){if(h.hasAttrib(C,"selected"))return!0;if(h.getName(C)!=="option")return!1;var p=h.getParent(C);if(!p||h.getName(p)!=="select"||h.hasAttrib(p,"multiple"))return!1;for(var d=h.getChildren(p),v=!1,I=0;I<d.length;I++)if(h.isTag(d[I]))if(d[I]===C)v=!0;else if(v){if(h.hasAttrib(d[I],"selected"))return!1;}else return!1;return v;},//https://html.spec.whatwg.org/multipage/scripting.html#disabled-elements
|
|
364
|
+
//:matches(
|
|
365
|
+
// :matches(button, input, select, textarea, menuitem, optgroup, option)[disabled],
|
|
366
|
+
// optgroup[disabled] > option),
|
|
367
|
+
// fieldset[disabled] * //TODO not child of first <legend>
|
|
368
|
+
//)
|
|
369
|
+
disabled:function disabled(C,h){return h.hasAttrib(C,"disabled");},enabled:function enabled(C,h){return!h.hasAttrib(C,"disabled");},//:matches(:matches(:radio, :checkbox)[checked], :selected) (TODO menuitem)
|
|
370
|
+
checked:function checked(C,h){return h.hasAttrib(C,"checked")||x.selected(C,h);},//:matches(input, select, textarea)[required]
|
|
371
|
+
required:function required(C,h){return h.hasAttrib(C,"required");},//:matches(input, select, textarea):not([required])
|
|
372
|
+
optional:function optional(C,h){return!h.hasAttrib(C,"required");},//jQuery extensions
|
|
373
|
+
//:not(:empty)
|
|
374
|
+
parent:function parent(C,h){return!x.empty(C,h);},//:matches(h1, h2, h3, h4, h5, h6)
|
|
375
|
+
header:M(["h1","h2","h3","h4","h5","h6"]),//:matches(button, input[type=button])
|
|
376
|
+
button:function button(C,h){var p=h.getName(C);return p==="button"||p==="input"&&h.getAttributeValue(C,"type")==="button";},//:matches(input, textarea, select, button)
|
|
377
|
+
input:M(["input","textarea","select","button"]),//input:matches(:not([type!='']), [type='text' i])
|
|
378
|
+
text:function text(C,h){var p;return h.getName(C)==="input"&&(!(p=h.getAttributeValue(C,"type"))||p.toLowerCase()==="text");}};function M(C){if((typeof Set==="undefined"?"undefined":_typeof(Set))<"u"){var h=new Set(C);return function(p,d){return h.has(d.getName(p));};}return function(p,d){return C.indexOf(d.getName(p))>=0;};}function S(C,h,p){if(p===null){if(C.length>2&&h!=="scope")throw new Error("pseudo-selector :"+h+" requires an argument");}else if(C.length===2)throw new Error("pseudo-selector :"+h+" doesn't have any arguments");}var P=/^(?:(?:nth|last|first|only)-(?:child|of-type)|root|empty|(?:en|dis)abled|checked|not)$/;u.exports={compile:function compile(C,h,p,d){var v=h.name,I=h.data,L=p.adapter;if(p&&p.strict&&!P.test(v))throw new Error(":"+v+" isn't part of CSS3");if(typeof f[v]=="function")return f[v](C,I,p,d);if(typeof x[v]=="function"){var w=x[v];return S(w,v,I),w===o?w:C===l?function(E){return w(E,L,I);}:function(E){return w(E,L,I)&&C(E);};}else throw new Error("unmatched pseudo-class :"+v);},filters:f,pseudos:x};},/* 283 *//***/function(u,e,t){var r=t(284),n=t(285);u.exports=function(l){return n(r(l));},u.exports.parse=r,u.exports.compile=n;},/* 284 *//***/function(u,e){u.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 l;return s[1]?(l=parseInt(s[1],10),isNaN(l)&&(s[1].charAt(0)==="-"?l=-1:l=1)):l=0,[l,s[3]?parseInt((s[2]||"")+s[3],10):0];}},/* 285 *//***/function(u,e,t){u.exports=l;var r=t(273),n=r.trueFunc,s=r.falseFunc;function l(o){var a=o[0],c=o[1]-1;if(c<0&&a<=0)return s;if(a===-1)return function(f){return f<=c;};if(a===0)return function(f){return f===c;};if(a===1)return c<0?n:function(f){return f>=c;};var y=c%a;return y<0&&(y+=a),a>1?function(f){return f>=c&&f%a===y;}:(a*=-1,function(f){return f<=c&&f%a===y;});}},/* 286 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return I;});var r=t(12),n=t(74),s=t(1),l=t(68),o=t(250),a=t(213),c=t(218);t(1).glMatrix.setMatrixArrayType(Array);function y(L,w){if(L==null)return{};var B=f(L,w),E,b;if(Object.getOwnPropertySymbols){var W=Object.getOwnPropertySymbols(L);for(b=0;b<W.length;b++)E=W[b],!(w.indexOf(E)>=0)&&Object.prototype.propertyIsEnumerable.call(L,E)&&(B[E]=L[E]);}return B;}function f(L,w){if(L==null)return{};var B={},E=Object.keys(L),b,W;for(W=0;W<E.length;W++)b=E[W],!(w.indexOf(b)>=0)&&(B[b]=L[b]);return B;}var g={antialias:!0,autoRender:!0,alpha:!0// for wx-miniprogram
|
|
379
|
+
},x=Symbol("autoRender"),M=Symbol("renderer"),S=Symbol("timeline"),P=Symbol("prepareRender"),C=Symbol("tickRender"),h=Symbol("pass"),p=Symbol("fbo"),d=Symbol("tickers"),v=Symbol("layerTransformInvert");var I=/*#__PURE__*/function(_o$default){function I(){var _this49;var w=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,I);if(_this49=_callSuper(this,I),!w.canvas){var _this49$getResolution=_this49.getResolution(),W=_this49$getResolution.width,D=_this49$getResolution.height,R=r.ENV.createCanvas(W,D,{offscreen:!!w.offscreen,id:w.id,extra:w.extra});R.style&&(R.style.position="absolute"),R.dataset&&(R.dataset.layerId=w.id),R.contextType&&(w.contextType=R.contextType),w.canvas=R;}var B=w.canvas,E=Object.assign({},g,w);_this49[x]=E.autoRender,delete w.autoRender;var b=E.Renderer||r.Renderer;_this49[M]=new b(B,E),_this49.options=w,_this49.id=w.id,_this49[h]=[],_this49.setResolution(B),_this49.canvas=B,_this49[S]=new n.Timeline(),_this49.__mouseCapturedTarget=null,_this49[v]=null;return _this49;}_inherits(I,_o$default);return _createClass(I,[{key:"autoRender",get:function get(){return this[x];}},{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(),w=_this$getResolution.height;return w/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[h];}},{key:"prepareRender",get:function get(){return this[P]?this[P]:Promise.resolve();}/* override */},{key:"renderer",get:function get(){return this[M];}},{key:"renderOffset",get:function get(){if(this.parent&&this.parent.options){var _this$parent$options=this.parent.options,w=_this$parent$options.left,B=_this$parent$options.top;return[w,B];}return[this.options.left|0,this.options.top|0];}},{key:"timeline",get:function get(){return this[S];}},{key:"width",get:function get(){var _this$getResolution2=this.getResolution(),w=_this$getResolution2.width;return w/this.displayRatio;}},{key:"localMatrix",get:function get(){var _this$attributes21=this.attributes,w=_this$attributes21.x,B=_this$attributes21.y;return[1,0,0,1,w,B];}},{key:"layerTransformInvert",get:function get(){if(this[v])return this[v];var w=this.transformMatrix;return w[0]===1&&w[1]===0&&w[2]===0&&w[3]===1&&w[4]===0&&w[5]===0?null:(this[v]=s.mat2d.invert(Array.of(0,0,0,0,0,0),w),this[v]);}},{key:"forceContextLoss",value:function forceContextLoss(){var w=this.renderer.glRenderer;if(w){var B=w.getExtension("WEBGL_lose_context");if(B)return B.loseContext(),!0;}return!1;}// isPointCollision(x, y) {
|
|
380
|
+
// return true;
|
|
381
|
+
// }
|
|
382
|
+
},{key:"addPass",value:function addPass(){var _ref150=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},w=_ref150.vertex,B=_ref150.fragment,E=_ref150.options,b=_ref150.uniforms;if(this.renderer.glRenderer){var _this$getResolution3=this.getResolution(),W=_this$getResolution3.width,D=_this$getResolution3.height,R=this.renderer.createPassProgram({vertex:w,fragment:B,options:E}),Y=new r.Figure2D();Y.rect(0,0,W/this.displayRatio,D/this.displayRatio);var V=new r.Mesh2D(Y);return V.setUniforms(b),V.setProgram(R),this[h].push(V),this.forceUpdate(),V;}return null;}// delete unused texture to release memory.
|
|
383
|
+
},{key:"deleteTexture",value:function deleteTexture(w){return Object(c.deleteTexture)(w,this.renderer);}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(w){var B=w.type;if(B==="mousedown"||B==="mouseup"||B==="mousemove"){var R=this.__mouseCapturedTarget;if(R){if(R.layer===this)return R.dispatchEvent(w),!0;this.__mouseCapturedTarget=null;}}var E,b;var W=this.layerTransformInvert;if(W){E=w.x,b=w.y;var _R6=W,Y=_R6[0]*E+_R6[2]*b+_R6[4],V=_R6[1]*E+_R6[3]*b+_R6[5];delete w.x,delete w.y,delete w.layerX,delete w.layerY,Object.defineProperties(w,{layerX:{value:Y,configurable:!0},layerY:{value:V,configurable:!0},x:{value:Y,configurable:!0},y:{value:V,configurable:!0}});}var D=_superPropGet(I,"dispatchPointerEvent",this,3)([w]);return W&&Object.defineProperties(w,{layerX:{value:E,configurable:!0},layerY:{value:b,configurable:!0},x:{value:E,configurable:!0},y:{value:b,configurable:!0}}),D;}/* override */},{key:"forceUpdate",value:function forceUpdate(){var _this50=this;if(!this[P])if(this.parent&&this.parent.hasOffscreenCanvas){this.parent.forceUpdate();var w=null;var B=new Promise(function(E){w=E;});B._resolve=w,this[P]=B;}else{var _w2=null,_B8=null;var E=new Promise(function(b){_w2=b,_this50[x]&&(_B8=Object(l.requestAnimationFrame)(function(){delete E._requestID,_this50.render();}));});E._resolve=_w2,E._requestID=_B8,this[P]=E;}}},{key:"getFBO",value:function getFBO(){var w=this.renderer.glRenderer,_this$getResolution4=this.getResolution(),B=_this$getResolution4.width,E=_this$getResolution4.height;return w&&(!this[p]||this[p].width!==B||this[p].height!==E)?(this[p]={width:B,height:E,target:w.createFBO(),buffer:w.createFBO(),swap:function swap(){var _ref151=[this.buffer,this.target];this.target=_ref151[0];this.buffer=_ref151[1];}},this[p]):this[p]?this[p]:null;}},{key:"updateGlobalTransform",value:function updateGlobalTransform(){if(this.layerTransformInvert){var w=this.renderer,B=w.__globalTransformMatrix||w.globalTransformMatrix;w.__globalTransformMatrix=B;var E=s.mat2d.fromValues(1,0,0,1,0,0);w.setGlobalTransform.apply(w,_toConsumableArray(s.mat2d.multiply(E,B,this.transformMatrix)));}}/* override */},{key:"onPropertyChange",value:function onPropertyChange(w,B,E){if(_superPropGet(I,"onPropertyChange",this,3)([w,B,E]),w==="zIndex"&&(this.canvas.style.zIndex=B),w==="transform"||w==="translate"||w==="rotate"||w==="scale"||w==="skew"){var b=this[v];if(this[v]=null,this.updateGlobalTransform(),b&&!this.layerTransformInvert){var W=this.renderer,D=W.__globalTransformMatrix||W.globalTransformMatrix;W.setGlobalTransform.apply(W,_toConsumableArray(D));}}}},{key:"_prepareRenderFinished",value:function _prepareRenderFinished(){this[P]&&(this[P]._requestID&&Object(l.cancelAnimationFrame)(this[P]._requestID),this[P]._resolve(),delete this[P]);}},{key:"render",value:function render(){var _this51=this;var _ref152=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref152$clear=_ref152.clear,w=_ref152$clear===void 0?!0:_ref152$clear;var B=this[h].length?this.getFBO():null;B&&this.renderer.glRenderer.bindFBO(B.target),w&&this[M].clear();var E=this.draw();if(E&&E.length&&(this.renderer.drawMeshes(E),this.canvas.draw&&this.canvas.draw()),B){var b=this.renderer.glRenderer,W=this[h].length,_this$getResolution5=this.getResolution(),D=_this$getResolution5.width,R=_this$getResolution5.height,Y=[0,0,D/this.displayRatio,R/this.displayRatio];this[h].forEach(function(V,Q){V.blend=!0,V.setTexture(B.target.texture,{rect:Y}),Q===W-1?b.bindFBO(null):(B.swap(),b.bindFBO(B.target)),_this51[M].clear(),_this51.renderer.drawMeshes([V]);});}this._prepareRenderFinished();}/* override */},{key:"setResolution",value:function setResolution(_ref153){var _this52=this;var w=_ref153.width,B=_ref153.height;var E=this.renderer,b=E.__globalTransformMatrix||E.globalTransformMatrix,W=b[4],D=b[5],R=b[0],_this$getResolution6=this.getResolution(),Y=_this$getResolution6.width,V=_this$getResolution6.height;(Y!==w||V!==B)&&(_superPropGet(I,"setResolution",this,3)([{width:w,height:B}]),this.canvas&&(this.canvas.width=w,this.canvas.height=B,E.updateResolution&&E.updateResolution()),this.attributes.size=[w,B],this[h].length&&this[h].forEach(function($){var K=new r.Figure2D();K.rect(0,0,w/_this52.displayRatio,B/_this52.displayRatio),$.contours=K.contours;}));var _this$renderOffset=_slicedToArray(this.renderOffset,2),Q=_this$renderOffset[0],et=_this$renderOffset[1],it=this.displayRatio;(W!==Q||D!==et||R!==it)&&(E.setGlobalTransform(it,0,0,it,Q,et),E.__globalTransformMatrix=null,this[v]=null,this.updateGlobalTransform(),this.forceUpdate());}/**
|
|
384
|
+
* tick(handler, {originTime = 0, playbackRate = 1.0, duration = Infinity})
|
|
385
|
+
* @param {*} handler
|
|
386
|
+
* @param {*} options
|
|
387
|
+
*/},{key:"tick",value:function tick(){var _this53=this;var w=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var B=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var _B$duration=B.duration,E=_B$duration===void 0?1/0:_B$duration,b=y(B,["duration"]);var W=this.timeline.fork(b),D=this;this[d]=this[d]||[],this[d].push({handler:w,duration:E});var _R7=function R(){var Y=null,V=null;var Q=function Q(){var et=_this53[d].map(function(_ref154){var it=_ref154.handler,$=_ref154.duration;var K=Math.min(1,W.currentTime/$);return{value:it?it(W.currentTime,K):null,p:K};});D[C]||(D[C]=Promise.resolve().then(function(){D[x]&&D.render(),delete D[C];for(var it=et.length-1;it>=0;it--){var _et$it=et[it],$=_et$it.value,K=_et$it.p;($===!1||K>=1)&&_this53[d].splice(it,1);}_this53[d].length>0&&_R7();}));};if(_this53[P]&&_this53[P]._type!=="ticker"&&(Object(l.cancelAnimationFrame)(_this53[P]._requestID),delete _this53[P]),!_this53[P]){var et=new Promise(function(it){Y=it,V=Object(l.requestAnimationFrame)(Q);});et._resolve=Y,et._requestID=V,et._type="ticker",_this53[P]=et;}};_R7();}},{key:"toGlobalPos",value:function toGlobalPos(w,B){if(this.layerTransformInvert){var Y=this.transformMatrix;w=Y[0]*w+Y[2]*B+Y[4],B=Y[1]*w+Y[3]*B+Y[5];}var _this$getResolution7=this.getResolution(),E=_this$getResolution7.width,b=_this$getResolution7.height,W=this.renderOffset,D=[this.canvas.clientWidth,this.canvas.clientHeight];w=w*D[0]/E+W[0],B=B*D[1]/b+W[1];var R=this.displayRatio;return w*=R,B*=R,[w,B];}},{key:"toLocalPos",value:function toLocalPos(w,B){var _this$getResolution8=this.getResolution(),E=_this$getResolution8.width,b=_this$getResolution8.height,W=this.renderOffset,D=[this.canvas.clientWidth,this.canvas.clientHeight];w=w*E/D[0]-W[0],B=B*b/D[1]-W[1];var R=this.displayRatio;w/=R,B/=R;var Y=this.layerTransformInvert;return Y&&(w=Y[0]*w+Y[2]*B+Y[4],B=Y[1]*w+Y[3]*B+Y[5]),[w,B];}}]);}(o["default"]);a["default"].registerNode(I,"layer");},/* 287 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return P;});var r=t(224),n=t(288),s=t(213),l=t(252),o=t(72);t(1).glMatrix.setMatrixArrayType(Array);function a(C,h){if(C==null)return{};var p=c(C,h),d,v;if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(C);for(v=0;v<I.length;v++)d=I[v],!(h.indexOf(d)>=0)&&Object.prototype.propertyIsEnumerable.call(C,d)&&(p[d]=C[d]);}return p;}function c(C,h){if(C==null)return{};var p={},d=Object.keys(C),v,I;for(I=0;I<d.length;I++)v=d[I],!(h.indexOf(v)>=0)&&(p[v]=C[v]);return p;}function y(C,h,p){return h in C?Object.defineProperty(C,h,{value:p,enumerable:!0,configurable:!0,writable:!0}):C[h]=p,C;}var f="http://www.w3.org/2000/svg",g=Symbol["for"]("spritejs_setAttribute"),x=Symbol("root"),M=Symbol("task");function S(C){var h=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var p=C[x];if(p&&p.children[0]){var d=C.svg,v=C.layer?C.layer.displayRatio:1;if(!d.hasAttribute("data-original-width")){var w=d.getAttribute("width");w=w?Object(o.sizeToPixel)(w):300;var B=d.getAttribute("height");B=B?Object(o.sizeToPixel)(B):150,d.hasAttribute("viewBox")||d.setAttribute("viewBox","0 0 ".concat(Math.round(w)," ").concat(Math.round(B))),d.setAttribute("data-original-width",w),d.setAttribute("data-original-height",B);}var I=C.attributes.width||Number(d.getAttribute("data-original-width")),L=C.attributes.height||Number(d.getAttribute("data-original-height"));if(I*=v,L*=v,h&&C.attributes.flexible){var _w3=C.attributes.scale[0];if(I*=_w3,L*=_w3,d.setAttribute("width",I),d.setAttribute("height",L),I&&L&&C.textureImage){var _B9=C.textureImage.width,E=C.textureImage.height,b=C.clientSize;C.attributes.textureRect=[0,0,Math.round(b[0]*_B9/I),Math.round(b[1]*E/L)];}}else C[M]||(d.setAttribute("width",I),d.setAttribute("height",L),C[M]=Promise.resolve().then(function(){delete C[M];var w=p.innerHTML,B=new Blob([w],{type:"image/svg+xml"}),E=URL.createObjectURL(B),b=new Image();b.onload=function(){b.width&&b.height?(C.attributes[g]("texture",b),C.attributes.flexible&&(C.attributes.textureRect=null)):C.attributes[g]("texture",null);},b.src=E;}));}}var P=/*#__PURE__*/function(_r$default21){function P(){var _this54;var h=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,P);typeof h=="string"&&(h={svgText:h});var _h25=h,p=_h25.svgText,d=a(h,["svgText"]);if(_this54=_callSuper(this,P,[d]),_this54[x]=document.createElement("div"),p){_this54[x].innerHTML=p;var v=_this54[x].children[0];v?v.setAttribute("xmlns",f):(fetch(p).then(function(I){return I.text();}).then(function(I){_this54[x].innerHTML=I,(!_this54.observer||_this54.attributes.flexible)&&S(_assertThisInitialized(_this54));}),p=null);}if(!p){var _v8=document.createElementNS(f,"svg");_v8.setAttribute("xmlns",f),_this54[x].appendChild(_v8);}if(typeof MutationObserver=="function"){var _v9=new MutationObserver(function(I){S(_this54,!1);});_v9.observe(_this54[x],{attributes:!0,subtree:!0,characterData:!0,childList:!0}),_this54.observer=_v9;}return _this54;}_inherits(P,_r$default21);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[x]?this[x].children[0]:null;}/* override */},{key:"setResolution",value:function setResolution(_ref155){var h=_ref155.width,p=_ref155.height;_superPropGet(P,"setResolution",this,3)([{width:h,height:p}]),S(this);}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(h){var p=_superPropGet(P,"dispatchPointerEvent",this,3)([h]);if(p&&this.attributes.passEvents&&typeof MouseEvent=="function"){var d=h.x,v=h.y;var _this$getOffsetPositi=this.getOffsetPosition(d,v),_this$getOffsetPositi2=_slicedToArray(_this$getOffsetPositi,2),I=_this$getOffsetPositi2[0],L=_this$getOffsetPositi2[1];var w=h.originalEvent,B=this.attributes.anchor,E=this.clientSize;I=(I+B[0]*E[0])/2,L=(L+B[1]*E[1])/2;var b=h.type;if(b===w.type){var W=null;if(w instanceof MouseEvent)W=new MouseEvent(b,{screenX:I,screenY:L,clientX:I,clientY:L,bubbles:w.bubbles,button:w.button,buttons:w.buttons,cancelBubble:w.cancelBubble,cancelable:w.cancelable,currentTarget:w.currentTarget,fromElement:w.fromElement,relatedTarget:w.relatedTarget,returnValue:w.returnValue,srcElement:w.srcElement,target:w.target,toElement:w.toElement,// view: originalEvent.view,
|
|
388
|
+
which:w.witch});else if(w instanceof TouchEvent){var D=null;var R=w.changedTouches||[w];for(var Y=0;Y<R.length;Y++){var V=R[Y];if(h.identifier===V.identifier){D=V;break;}}if(D){var _Y3=new Touch({identifier:D.identifier,target:D.target,clientX:I,clientY:L,screenX:I,screenY:L,pageX:I,pageY:L,radiusX:D.radiusX,radiusY:D.radiusY,rotationAngle:D.rotationAngle,force:D.force});W=new TouchEvent(b,{cancelable:w.cancelable,bubbles:w.bubbles,composed:w.composed,touches:[_Y3],targetTouches:[_Y3],changedTouches:[_Y3]});}}else W=w;W&&this.svg.dispatchEvent(W);}}return p;}},{key:"getElementById",value:function getElementById(h){return Object(l.querySelector)("#".concat(h),this);}},{key:"getElementsByClassName",value:function getElementsByClassName(h){return Object(l.querySelectorAll)(".".concat(h),this);}},{key:"getElementsByName",value:function getElementsByName(h){return Object(l.querySelectorAll)("[name=\"".concat(h,"\"]"),this);}},{key:"getElementsByTagName",value:function getElementsByTagName(h){return Object(l.querySelectorAll)(h,this);}},{key:"querySelector",value:function querySelector(h){return Object(l.querySelector)(h,this);}},{key:"querySelectorAll",value:function querySelectorAll(h){return Object(l.querySelectorAll)(h,this);}/* override */},{key:"onPropertyChange",value:function onPropertyChange(h,p,d){_superPropGet(P,"onPropertyChange",this,3)([h,p,d]),h==="flexible"&&S(this),this.attributes.flexible&&(h==="width"||h==="height"||h==="scale"||h==="transform")&&S(this);}}]);}(r["default"]);y(P,"Attr",n["default"]),s["default"].registerNode(P,"spritesvg");},/* 288 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return o;});var r=t(225);t(1).glMatrix.setMatrixArrayType(Array);var n=Symbol["for"]("spritejs_getAttribute"),s=Symbol["for"]("spritejs_setAttribute"),l=Symbol["for"]("spritejs_setAttributeDefault");var o=/*#__PURE__*/function(_r$default22){function o(c){var _this55;_classCallCheck(this,o);_this55=_callSuper(this,o,[c]),_this55[l]({passEvents:!1,flexible:!1});return _this55;}// readonly
|
|
389
|
+
_inherits(o,_r$default22);return _createClass(o,[{key:"texture",get:function get(){return this[n]("texture");},set:function set(c){}// eslint-disable-line no-empty-function
|
|
390
|
+
},{key:"passEvents",get:function get(){return this[n]("passEvents");},set:function set(c){return this[s]("passEvents",c);}},{key:"flexible",get:function get(){return this[n]("flexible");},set:function set(c){return this[s]("flexible",c);}}]);}(r["default"]);},/* 289 *//***/function(u,e,t){t.r(e);var r=t(12);t(1).glMatrix.setMatrixArrayType(Array);function n(c,y){var f=Object.keys(c);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(c);y&&(g=g.filter(function(x){return Object.getOwnPropertyDescriptor(c,x).enumerable;})),f.push.apply(f,g);}return f;}function s(c){for(var y=1;y<arguments.length;y++){var f=arguments[y]!=null?arguments[y]:{};y%2?n(Object(f),!0).forEach(function(g){l(c,g,f[g]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(f)):n(Object(f)).forEach(function(g){Object.defineProperty(c,g,Object.getOwnPropertyDescriptor(f,g));});}return c;}function l(c,y,f){return y in c?Object.defineProperty(c,y,{value:f,enumerable:!0,configurable:!0,writable:!0}):c[y]=f,c;}var o=Symbol("inited");var a=null;typeof Worker=="function"&&(a=/*#__PURE__*/function(_Worker){function a(c){var _this56;_classCallCheck(this,a);if(c.worker===!0&&(c.worker="./".concat(c.id,".worker.js")),_this56=_callSuper(this,a,[c.worker]),_this56.options=c,!c.canvas){var _this56$getResolution=_this56.getResolution(),y=_this56$getResolution.width,f=_this56$getResolution.height,g=r.ENV.createCanvas(y,f,{offscreen:!1});g.style&&(g.style.position="absolute"),g.dataset&&(g.dataset.layerId=c.id),c.canvas=g;}_this56.canvas=c.canvas;return _this56;}_inherits(a,_Worker);return _createClass(a,[{key:"id",get:function get(){return this.options.id;}},{key:"setResolution",value:function setResolution(_ref156){var c=_ref156.width,y=_ref156.height;if(this[o])this.postMessage({type:"resolution_change",width:c,height:y});else{this.canvas.width=c,this.canvas.height=y;var f=this.options,g=f.canvas.transferControlToOffscreen(),x=s({},f);delete x.container,x.canvas=g,this.postMessage({type:"create",options:x},[g]),this[o]=!0;}}},{key:"getResolution",value:function getResolution(){if(this.canvas){var _this$canvas6=this.canvas,c=_this$canvas6.width,y=_this$canvas6.height;return{width:c,height:y};}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(c,y){Object.defineProperty(this,"parent",{value:c,writable:!1,configurable:!0}),Object.defineProperty(this,"zOrder",{value:y,writable:!1,configurable:!0});}},{key:"disconnect",value:function disconnect(){delete this.parent,delete this.zOrder;}},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(c){this.postMessage({type:"event",event:{cancelBubble:c.cancelBubble,bubbles:c.bubbles,detail:c.detail,identifier:c.identifier,layerX:c.layerX,layerY:c.layerY,originalX:c.originalX,originalY:c.originalY,type:c.type,x:c.x,y:c.y}});}}]);}(/*#__PURE__*/_wrapNativeSuper(Worker))),e["default"]=a;},/* 290 *//***/function(u,e,t){t.r(e),function(r){t.d(e,"default",function(){return I;});var n=t(12),s=t(68),l=t(70),o=t(286),a=t(289),c=t(250),y=t(291),f=t(214),g=t(218),x=t(213);t(1).glMatrix.setMatrixArrayType(Array);var M=Symbol("enteredTargets");function S(L){return L.id=L.id||"_layer".concat(Math.random().toString(36).slice(2,12)),L.dataset||(L.dataset={}),L.dataset.layerId=L.id,L.connect=function(w,B){L.parent=w,Object.defineProperty(L,"zOrder",{value:B,writable:!1,configurable:!0});},L.disconnect=function(w){delete L.zOrder;},L.canvas=L,L.getResolution=function(){return{width:0,height:0};},L.setResolution=function(){return!1;},L.options={handleEvent:!1},L;}function P(L,w){var B=L.children;var E=null;for(var b=0;b<B.length;b++){var W=B[b];if((w===W||E!=null)&&(E=W),E&&E!==w&&!E.offscreen)return E.canvas;}return null;}function C(L,w){var _L$renderOffset=_slicedToArray(L.renderOffset,2),B=_L$renderOffset[0],E=_L$renderOffset[1],_L$getResolution=L.getResolution(),b=_L$getResolution.width,W=_L$getResolution.height,D=L.displayRatio;L.renderer.drawImage(w.canvas,-B/D,-E/D,b/D,W/D);}var h={};function p(L){var w=["mousedown","mouseup","mousemove","mousewheel","wheel","touchstart","touchend","touchmove","touchcancel","click","dblclick","longpress","tap","contextmenu"],B=L.container;B.addEventListener("mouseleave",function(E){var b=L[M];if(b.size){var W=new f["default"]("mouseleave");W.setOriginalEvent(E),_toConsumableArray(b).forEach(function(D){D.dispatchEvent(W);}),L[M].clear();}},{passive:!0}),w.forEach(function(E){B.addEventListener(E,function(b){var _L$options=L.options,W=_L$options.left,D=_L$options.top,R=_L$options.displayRatio,Y=L.orderedChildren;Object(y["default"])(b,{offsetLeft:W,offsetTop:D,displayRatio:R}).forEach(function(Q){var et=Q.identifier;if(Q.type==="touchmove"||Q.type==="touchend"){var $=h[et];$&&$.dispatchEvent(Q),Q.type==="touchend"&&delete h[et];}else{for(var _$=Y.length-1;_$>=0;_$--){var K=Y[_$];if(K.options.handleEvent!==!1){if(K.dispatchPointerEvent(Q)&&Q.target!==K)break;Q.cancelBubble=!1;}}if(Q.target===Y[0])for(var _$2=Y.length-1;_$2>=0;_$2--){var _K=Y[_$2];if(_K.options.handleEvent!==!1){Q.target=_K;break;}}}var it=Q.target;if(Q.type==="touchstart"&&(h[et]=Q.target),Q.type==="mousemove"){var _$3=L[M];var _K2;if(it){var ct=it.ancestors||[];_K2=/* @__PURE__ */new Set([it].concat(_toConsumableArray(ct)));}else _K2=/* @__PURE__ */new Set();var rt=Object.entries(b);if(!_$3.has(it)&&it){var _ct2=new f["default"]("mouseenter");_ct2.setOriginalEvent(b),rt.forEach(function(_ref157){var _ref158=_slicedToArray(_ref157,2),st=_ref158[0],Ot=_ref158[1];_ct2[st]=Ot;}),_$3.add(it),it.dispatchEvent(_ct2);var gt=it.ancestors;gt&>.forEach(function(st){st instanceof l["default"]&&!_$3.has(st)&&(_$3.add(st),st.dispatchEvent(_ct2));});}var lt=new f["default"]("mouseleave");lt.setOriginalEvent(b),rt.forEach(function(_ref159){var _ref160=_slicedToArray(_ref159,2),ct=_ref160[0],gt=_ref160[1];lt[ct]=gt;}),_toConsumableArray(_$3).forEach(function(ct){_K2.has(ct)||(_$3["delete"](ct),ct.dispatchEvent(lt));});}});},{passive:E!=="contextmenu"});});}function d(L,w){if(w&&w.style){var B=L.width,E=L.height,b=L.mode,W=L.container;var D=W.clientWidth,R=W.clientHeight;B=B||D,E=E||R,b==="static"?(w.style.width="".concat(B,"px"),w.style.height="".concat(E,"px")):(w.style.top="0",w.style.left="0",w.style.width="".concat(D,"px"),w.style.height="".concat(R,"px"),w.style.transform="",w.style.webkitTransform="");}}var v=Symbol("offscreenLayerCount");var I=/*#__PURE__*/function(_c$default){/**
|
|
391
|
+
width
|
|
392
|
+
height
|
|
393
|
+
mode: 'static', 'scale', 'stickyWidth', 'stickyHeight', 'stickyTop', 'stickyBottom', 'stickyLeft', 'stickyRight'
|
|
394
|
+
*/function I(){var _this57;var w=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,I);if(_this57=_callSuper(this,I),!w.container)if(typeof n.ENV.Container=="function")w.container=new n.ENV.Container(w.width||300,w.height||150);else throw new Error("No container specified.");if(_this57.container=w.container,_this57.container.style&&(_this57.container.style.overflow||(_this57.container.style.overflow="hidden"),_this57.container.style.position||(_this57.container.style.position="relative")),_this57.options=w,w.displayRatio=w.displayRatio||1,w.mode=w.mode||"scale",w.left=0,w.top=0,w.autoResize=w.autoResize!==!1,w.autoResize){var B;if((typeof globalThis==="undefined"?"undefined":_typeof(globalThis))<"u"?B=globalThis:B=(typeof window==="undefined"?"undefined":_typeof(window))<"u"?window:r,B.addEventListener){var E=_this57;B.addEventListener("resize",function b(){(typeof document==="undefined"?"undefined":_typeof(document))<"u"&&document.contains(E.container)?E.resize():B.removeEventListener("resize",b);});}}_this57[M]=/* @__PURE__ */new Set(),_this57.setResolution(w),p(_this57),_this57[v]=0;return _this57;}_inherits(I,_c$default);return _createClass(I,[{key:"hasOffscreenCanvas",get:function get(){return this[v]>0;}},{key:"displayRatio",get:function get(){return this.options.displayRatio;},set:function set(w){this.options.displayRatio!==w&&(this.options.displayRatio=w,this.resize());}},{key:"height",get:function get(){return this.options.height;},set:function set(w){this.options.height!==w&&(this.options.height=w,this.resize());}},{key:"mode",get:function get(){return this.options.mode;},set:function set(w){this.options.mode!==w&&(this.options.mode=w,this.resize());}},{key:"width",get:function get(){return this.options.width;}/* override */,set:function set(w){this.options.width!==w&&(this.options.width=w,this.resize());}},{key:"appendChild",value:function appendChild(w){!(w instanceof o["default"])&&!(w instanceof a["default"])&&S(w);var B=_superPropGet(I,"appendChild",this,3)([w]),E=w.canvas;return w.offscreen?this[v]++:this.container.appendChild(E),d(this.options,E),w.setResolution(this.getResolution()),B;}/* override */},{key:"forceUpdate",value:function forceUpdate(){var _this58=this;this.hasOffscreenCanvas&&!this._requestID&&(this._requestID=Object(s.requestAnimationFrame)(function(){delete _this58._requestID,_this58.render();}));}/* override */},{key:"insertBefore",value:function insertBefore(w,B){!(w instanceof o["default"])&&!(w instanceof a["default"])&&S(w);var E=_superPropGet(I,"insertBefore",this,3)([w,B]),b=w.canvas;if(!w.offscreen){var W=P(this,w);this.container.insertBefore(b,W);}return d(this.options,b),w.setResolution(this.getResolution()),E;}},{key:"layer",value:function layer(){var w=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"default";var B=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};B=Object.assign({},this.options,B),B.id=w;var E=this.orderedChildren;for(var D=0;D<E.length;D++)if(E[D].id===w)return E[D];var b=B.worker;var W;return b?W=new a["default"](B):W=new o["default"](B),this.appendChild(W),W;}},{key:"preload",value:function(){var _preload=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee20(){var _this59=this;var _len13,w,_key13,B,E,b,_loop2,W,_args21=arguments;return _regeneratorRuntime().wrap(function _callee20$(_context21){while(1)switch(_context21.prev=_context21.next){case 0:for(_len13=_args21.length,w=new Array(_len13),_key13=0;_key13<_len13;_key13++){w[_key13]=_args21[_key13];}B=[],E=[],b=[];_loop2=/*#__PURE__*/_regeneratorRuntime().mark(function _loop2(W){var D,R,Y,V;return _regeneratorRuntime().wrap(function _loop2$(_context20){while(1)switch(_context20.prev=_context20.next){case 0:D=w[W];if(typeof D=="string")R=Object(g.loadTexture)(D);else if(Array.isArray(D))R=Object(g.loadFrames).apply(void 0,_toConsumableArray(D));else{Y=D.id,V=D.src;R=Object(g.loadTexture)(V,Y);}R instanceof Promise||(R=Promise.resolve(R)),E.push(R.then(function(Y){B.push(Y),b[W]=Y;var V=new f["default"]({type:"preload",detail:{current:Y,loaded:B,resources:w}});_this59.dispatchEvent(V);}));case 3:case"end":return _context20.stop();}},_loop2);});W=0;case 4:if(!(W<w.length)){_context21.next=9;break;}return _context21.delegateYield(_loop2(W),"t0",6);case 6:W++;_context21.next=4;break;case 9:_context21.next=11;return Promise.all(E);case 11:return _context21.abrupt("return",b);case 12:case"end":return _context21.stop();}},_callee20);}));function preload(){return _preload.apply(this,arguments);}return preload;}()/* override */},{key:"removeChild",value:function removeChild(w){var B=_superPropGet(I,"removeChild",this,3)([w]);if(B){w._prepareRenderFinished&&w._prepareRenderFinished();var E=w.canvas;E&&E.remove&&E.remove(),w.offscreen&&this[v]--;}return B;}// for offscreen mode rendering
|
|
395
|
+
},{key:"render",value:function render(){var w=this.orderedChildren;var B=null;var E=[];for(var b=0;b<w.length;b++){var W=w[b],D=E.length>0;if(W instanceof o["default"]&&!W.offscreen){if(!W.autoRender)D&&(console.warn("Some offscreen canvas will not be rendered."),E.length=0);else if(B=W,D){W.renderer.clear();for(var R=0;R<E.length;R++){var Y=E[R];Y.render(),C(W,Y);}E.length=0,W.render({clear:!1});}else W.prepareRender&&W.render();}else W.offscreen?B?(W.prepareRender&&W.render(),C(B,W)):E.push(W):W instanceof a["default"]&&D&&(console.warn("Some offscreen canvas will not be rendered."),E.length=0);}}/* override */},{key:"replaceChild",value:function replaceChild(w,B){var E=_superPropGet(I,"replaceChild",this,3)([w,B]);B.canvas.remove&&B.canvas.remove(),B.offscreen&&this[v]--;var b=w.canvas;if(!w.offscreen){var W=P(this,w);this.container.insertBefore(b,W);}return d(this.options,b),w.setResolution(this.getResolution()),E;}},{key:"resize",value:function resize(){var w=this.options;this.children.forEach(function(B){d(w,B.canvas);}),this.setResolution(w),this.dispatchEvent({type:"resize"});}/* override */},{key:"setResolution",value:function setResolution(){var _w4,_B10;var _ref161=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},w=_ref161.width,B=_ref161.height;var E=this.container,b=E.clientWidth,W=E.clientHeight;(w==null||B==null)&&(w=(_w4=w)!==null&&_w4!==void 0?_w4:b,B=(_B10=B)!==null&&_B10!==void 0?_B10:W);var _this$options=this.options,D=_this$options.mode,R=_this$options.displayRatio;if(w*=R,B*=R,this.options.left=0,this.options.top=0,D==="stickyHeight"||D==="stickyLeft"||D==="stickyRight"){var Y=w;w=b*B/W,D==="stickyHeight"&&(this.options.left=0.5*(w-Y)),D==="stickyRight"&&(this.options.left=w-Y);}else if(D==="stickyWidth"||D==="stickyTop"||D==="stickyBottom"){var _Y4=B;B=W*w/b,D==="stickyWidth"&&(this.options.top=0.5*(B-_Y4)),D==="stickyBottom"&&(this.options.top=B-_Y4);}_superPropGet(I,"setResolution",this,3)([{width:w,height:B}]);}},{key:"snapshot",value:function snapshot(){var _ref162=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref162$offscreen=_ref162.offscreen,w=_ref162$offscreen===void 0?!1:_ref162$offscreen,B=_ref162.layers;var E=w?"snapshotOffScreenCanvas":"snapshotCanvas",_this$getResolution9=this.getResolution(),b=_this$getResolution9.width,W=_this$getResolution9.height;this[E]=this[E]||n.ENV.createCanvas(b,W,{offscreen:w});var D=this[E].getContext("2d");B=B||this.orderedChildren,this[E].width=b,this[E].height=W;for(var R=0;R<B.length;R++){var Y=B[R];if(!Y.options.ignoreSnapshot){Y.render&&Y.render();var V=Y.canvas;V&&V!==Y&&D.drawImage(V,0,0,b,W);}}return this[E];}}]);}(c["default"]);(typeof document==="undefined"?"undefined":_typeof(document))<"u"&&(I.prototype.layer3d=function(L){var _this60=this;var w=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var B=w.url||"https://unpkg.com/sprite-extend-3d/dist/sprite-extend-3d.min.js";return new Promise(function(E,b){var W=document.createElement("script");W.async=!1,W.src=B,W.onload=function(){try{E(_this60.layer3d(L,w));}catch(D){b(D);}},document.documentElement.appendChild(W);});}),x["default"].registerNode(I,"scene");}.call(this,t(22));},/* 291 *//***/function(u,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 _ref163=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref163$offsetTop=_ref163.offsetTop,l=_ref163$offsetTop===void 0?0:_ref163$offsetTop,_ref163$offsetLeft=_ref163.offsetLeft,o=_ref163$offsetLeft===void 0?0:_ref163$offsetLeft,_ref163$displayRatio=_ref163.displayRatio,a=_ref163$displayRatio===void 0?1:_ref163$displayRatio;var c,y;var f=[],_s$target$getBounding=s.target.getBoundingClientRect(),g=_s$target$getBounding.left,x=_s$target$getBounding.top,M=_s$target$getBounding.width,S=_s$target$getBounding.height,P=s.target.width,C=s.target.height,h=s.changedTouches||[s];for(var d=0;d<h.length;d++){var v=h[d],I=v.identifier,L=v.clientX,w=v.clientY;L!=null&&w!=null&&f.push({x:Math.round((L|0)-g),y:Math.round((w|0)-x),identifier:I});}f.length<=0&&f.push({x:c,y:y});var p=[];return f.forEach(function(d){d.x!=null&&d.y!=null&&(c=(d.x*P/M-o)/a,y=(d.y*C/S-l)/a);var v=new r["default"](s);Object.defineProperties(v,{layerX:{value:c,configurable:!0},layerY:{value:y,configurable:!0},originalX:{value:d.x},originalY:{value:d.y},x:{value:c,configurable:!0},y:{value:y,configurable:!0},identifier:{value:d.identifier}}),p.push(v);}),p;}}/******/]);te.version;te.Arc;te.Block;te.Cloud;te.Color;var uo=te.Ellipse;te.Gradient;var me=te.Group,po=te.Label,mo=te.Layer;te.LayerWorker;te.Node;te.Parallel;var be=te.Path,Le=te.Polyline,Pn=te.Rect;te.Regular;te.Ring;var vo=te.Scene,hi=te.Sprite;te.SpriteSvg;te.Star;te.Triangle;te.helpers;te.createElement;te.isSpriteNode;te.registerNode;te.requestAnimationFrame;te.cancelAnimationFrame;te.ENV;var mr=(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 Ne(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u["default"]:u;}var go=_typeof(mr)=="object"&&mr&&mr.Object===Object&&mr,ui=go,yo=ui,Po=(typeof self==="undefined"?"undefined":_typeof(self))=="object"&&self&&self.Object===Object&&self,xo=yo||Po||Function("return this")(),Ee=xo,So=Ee,To=So.Symbol,fr=To,xn=fr,di=Object.prototype,Co=di.hasOwnProperty,Oo=di.toString,nr=xn?xn.toStringTag:void 0;function Io(u){var e=Co.call(u,nr),t=u[nr];try{u[nr]=void 0;var r=!0;}catch(_unused18){}var n=Oo.call(u);return r&&(e?u[nr]=t:delete u[nr]),n;}var Mo=Io,Eo=Object.prototype,Ao=Eo.toString;function Lo(u){return Ao.call(u);}var wo=Lo,Sn=fr,Ro=Mo,Do=wo,bo="[object Null]",No="[object Undefined]",Tn=Sn?Sn.toStringTag:void 0;function Bo(u){return u==null?u===void 0?No:bo:Tn&&Tn in Object(u)?Ro(u):Do(u);}var Je=Bo;function Wo(u){return u!=null&&_typeof(u)=="object";}var we=Wo,Fo=Je,Uo=we,jo="[object Number]";function Yo(u){return typeof u=="number"||Uo(u)&&Fo(u)==jo;}var Xo=Yo,ue=/* @__PURE__ */Ne(Xo);function zo(){this.__data__=[],this.size=0;}var $o=zo;function Go(u,e){return u===e||u!==u&&e!==e;}var Jr=Go,Ho=Jr;function Vo(u,e){for(var t=u.length;t--;)if(Ho(u[t][0],e))return t;return-1;}var Rr=Vo,Ko=Rr,ko=Array.prototype,Zo=ko.splice;function Jo(u){var e=this.__data__,t=Ko(e,u);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():Zo.call(e,t,1),--this.size,!0;}var Qo=Jo,qo=Rr;function _o(u){var e=this.__data__,t=qo(e,u);return t<0?void 0:e[t][1];}var ta=_o,ea=Rr;function ra(u){return ea(this.__data__,u)>-1;}var na=ra,ia=Rr;function sa(u,e){var t=this.__data__,r=ia(t,u);return r<0?(++this.size,t.push([u,e])):t[r][1]=e,this;}var oa=sa,aa=$o,la=Qo,ca=ta,fa=na,ha=oa;function Qe(u){var e=-1,t=u==null?0:u.length;for(this.clear();++e<t;){var r=u[e];this.set(r[0],r[1]);}}Qe.prototype.clear=aa;Qe.prototype["delete"]=la;Qe.prototype.get=ca;Qe.prototype.has=fa;Qe.prototype.set=ha;var Dr=Qe,ua=Dr;function da(){this.__data__=new ua(),this.size=0;}var pa=da;function ma(u){var e=this.__data__,t=e["delete"](u);return this.size=e.size,t;}var va=ma;function ga(u){return this.__data__.get(u);}var ya=ga;function Pa(u){return this.__data__.has(u);}var xa=Pa;function Sa(u){var e=_typeof(u);return u!=null&&(e=="object"||e=="function");}var hr=Sa,Ta=Je,Ca=hr,Oa="[object AsyncFunction]",Ia="[object Function]",Ma="[object GeneratorFunction]",Ea="[object Proxy]";function Aa(u){if(!Ca(u))return!1;var e=Ta(u);return e==Ia||e==Ma||e==Oa||e==Ea;}var pi=Aa,La=Ee,wa=La["__core-js_shared__"],Ra=wa,Ur=Ra,Cn=function(){var u=/[^.]+$/.exec(Ur&&Ur.keys&&Ur.keys.IE_PROTO||"");return u?"Symbol(src)_1."+u:"";}();function Da(u){return!!Cn&&Cn in u;}var ba=Da,Na=Function.prototype,Ba=Na.toString;function Wa(u){if(u!=null){try{return Ba.call(u);}catch(_unused19){}try{return u+"";}catch(_unused20){}}return"";}var mi=Wa,Fa=pi,Ua=ba,ja=hr,Ya=mi,Xa=/[\\^$.*+?()[\]{}|]/g,za=/^\[object .+?Constructor\]$/,$a=Function.prototype,Ga=Object.prototype,Ha=$a.toString,Va=Ga.hasOwnProperty,Ka=RegExp("^"+Ha.call(Va).replace(Xa,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ka(u){if(!ja(u)||Ua(u))return!1;var e=Fa(u)?Ka:za;return e.test(Ya(u));}var Za=ka;function Ja(u,e){return u==null?void 0:u[e];}var Qa=Ja,qa=Za,_a=Qa;function tl(u,e){var t=_a(u,e);return qa(t)?t:void 0;}var Ue=tl,el=Ue,rl=Ee,nl=el(rl,"Map"),Qr=nl,il=Ue,sl=il(Object,"create"),br=sl,On=br;function ol(){this.__data__=On?On(null):{},this.size=0;}var al=ol;function ll(u){var e=this.has(u)&&delete this.__data__[u];return this.size-=e?1:0,e;}var cl=ll,fl=br,hl="__lodash_hash_undefined__",ul=Object.prototype,dl=ul.hasOwnProperty;function pl(u){var e=this.__data__;if(fl){var t=e[u];return t===hl?void 0:t;}return dl.call(e,u)?e[u]:void 0;}var ml=pl,vl=br,gl=Object.prototype,yl=gl.hasOwnProperty;function Pl(u){var e=this.__data__;return vl?e[u]!==void 0:yl.call(e,u);}var xl=Pl,Sl=br,Tl="__lodash_hash_undefined__";function Cl(u,e){var t=this.__data__;return this.size+=this.has(u)?0:1,t[u]=Sl&&e===void 0?Tl:e,this;}var Ol=Cl,Il=al,Ml=cl,El=ml,Al=xl,Ll=Ol;function qe(u){var e=-1,t=u==null?0:u.length;for(this.clear();++e<t;){var r=u[e];this.set(r[0],r[1]);}}qe.prototype.clear=Il;qe.prototype["delete"]=Ml;qe.prototype.get=El;qe.prototype.has=Al;qe.prototype.set=Ll;var wl=qe,In=wl,Rl=Dr,Dl=Qr;function bl(){this.size=0,this.__data__={hash:new In(),map:new(Dl||Rl)(),string:new In()};}var Nl=bl;function Bl(u){var e=_typeof(u);return e=="string"||e=="number"||e=="symbol"||e=="boolean"?u!=="__proto__":u===null;}var Wl=Bl,Fl=Wl;function Ul(u,e){var t=u.__data__;return Fl(e)?t[typeof e=="string"?"string":"hash"]:t.map;}var Nr=Ul,jl=Nr;function Yl(u){var e=jl(this,u)["delete"](u);return this.size-=e?1:0,e;}var Xl=Yl,zl=Nr;function $l(u){return zl(this,u).get(u);}var Gl=$l,Hl=Nr;function Vl(u){return Hl(this,u).has(u);}var Kl=Vl,kl=Nr;function Zl(u,e){var t=kl(this,u),r=t.size;return t.set(u,e),this.size+=t.size==r?0:1,this;}var Jl=Zl,Ql=Nl,ql=Xl,_l=Gl,tc=Kl,ec=Jl;function _e(u){var e=-1,t=u==null?0:u.length;for(this.clear();++e<t;){var r=u[e];this.set(r[0],r[1]);}}_e.prototype.clear=Ql;_e.prototype["delete"]=ql;_e.prototype.get=_l;_e.prototype.has=tc;_e.prototype.set=ec;var vi=_e,rc=Dr,nc=Qr,ic=vi,sc=200;function oc(u,e){var t=this.__data__;if(t instanceof rc){var r=t.__data__;if(!nc||r.length<sc-1)return r.push([u,e]),this.size=++t.size,this;t=this.__data__=new ic(r);}return t.set(u,e),this.size=t.size,this;}var ac=oc,lc=Dr,cc=pa,fc=va,hc=ya,uc=xa,dc=ac;function tr(u){var e=this.__data__=new lc(u);this.size=e.size;}tr.prototype.clear=cc;tr.prototype["delete"]=fc;tr.prototype.get=hc;tr.prototype.has=uc;tr.prototype.set=dc;var gi=tr;function pc(u,e){for(var t=-1,r=u==null?0:u.length;++t<r&&e(u[t],t,u)!==!1;);return u;}var mc=pc,vc=Ue,gc=function(){try{var u=vc(Object,"defineProperty");return u({},"",{}),u;}catch(_unused21){}}(),yi=gc,Mn=yi;function yc(u,e,t){e=="__proto__"&&Mn?Mn(u,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):u[e]=t;}var Pi=yc,Pc=Pi,xc=Jr,Sc=Object.prototype,Tc=Sc.hasOwnProperty;function Cc(u,e,t){var r=u[e];(!(Tc.call(u,e)&&xc(r,t))||t===void 0&&!(e in u))&&Pc(u,e,t);}var xi=Cc,Oc=xi,Ic=Pi;function Mc(u,e,t,r){var n=!t;t||(t={});for(var s=-1,l=e.length;++s<l;){var o=e[s],a=r?r(t[o],u[o],o,t,u):void 0;a===void 0&&(a=u[o]),n?Ic(t,o,a):Oc(t,o,a);}return t;}var Br=Mc;function Ec(u,e){for(var t=-1,r=Array(u);++t<u;)r[t]=e(t);return r;}var Ac=Ec,Lc=Je,wc=we,Rc="[object Arguments]";function Dc(u){return wc(u)&&Lc(u)==Rc;}var bc=Dc,En=bc,Nc=we,Si=Object.prototype,Bc=Si.hasOwnProperty,Wc=Si.propertyIsEnumerable,Fc=En(/* @__PURE__ */function(){return arguments;}())?En:function(u){return Nc(u)&&Bc.call(u,"callee")&&!Wc.call(u,"callee");},Ti=Fc,Uc=Array.isArray,ur=Uc,yr={exports:{}};function jc(){return!1;}var Yc=jc;yr.exports;(function(u,e){var t=Ee,r=Yc,n=e&&!e.nodeType&&e,s=n&&!0&&u&&!u.nodeType&&u,l=s&&s.exports===n,o=l?t.Buffer:void 0,a=o?o.isBuffer:void 0,c=a||r;u.exports=c;})(yr,yr.exports);var qr=yr.exports,Xc=9007199254740991,zc=/^(?:0|[1-9]\d*)$/;function $c(u,e){var _e2;var t=_typeof(u);return e=(_e2=e)!==null&&_e2!==void 0?_e2:Xc,!!e&&(t=="number"||t!="symbol"&&zc.test(u))&&u>-1&&u%1==0&&u<e;}var Gc=$c,Hc=9007199254740991;function Vc(u){return typeof u=="number"&&u>-1&&u%1==0&&u<=Hc;}var Ci=Vc,Kc=Je,kc=Ci,Zc=we,Jc="[object Arguments]",Qc="[object Array]",qc="[object Boolean]",_c="[object Date]",tf="[object Error]",ef="[object Function]",rf="[object Map]",nf="[object Number]",sf="[object Object]",of="[object RegExp]",af="[object Set]",lf="[object String]",cf="[object WeakMap]",ff="[object ArrayBuffer]",hf="[object DataView]",uf="[object Float32Array]",df="[object Float64Array]",pf="[object Int8Array]",mf="[object Int16Array]",vf="[object Int32Array]",gf="[object Uint8Array]",yf="[object Uint8ClampedArray]",Pf="[object Uint16Array]",xf="[object Uint32Array]",ne={};ne[uf]=ne[df]=ne[pf]=ne[mf]=ne[vf]=ne[gf]=ne[yf]=ne[Pf]=ne[xf]=!0;ne[Jc]=ne[Qc]=ne[ff]=ne[qc]=ne[hf]=ne[_c]=ne[tf]=ne[ef]=ne[rf]=ne[nf]=ne[sf]=ne[of]=ne[af]=ne[lf]=ne[cf]=!1;function Sf(u){return Zc(u)&&kc(u.length)&&!!ne[Kc(u)];}var Tf=Sf;function Cf(u){return function(e){return u(e);};}var Wr=Cf,Pr={exports:{}};Pr.exports;(function(u,e){var t=ui,r=e&&!e.nodeType&&e,n=r&&!0&&u&&!u.nodeType&&u,s=n&&n.exports===r,l=s&&t.process,o=function(){try{var a=n&&n.require&&n.require("util").types;return a||l&&l.binding&&l.binding("util");}catch(_unused22){}}();u.exports=o;})(Pr,Pr.exports);var _r=Pr.exports,Of=Tf,If=Wr,An=_r,Ln=An&&An.isTypedArray,Mf=Ln?If(Ln):Of,Oi=Mf,Ef=Ac,Af=Ti,Lf=ur,wf=qr,Rf=Gc,Df=Oi,bf=Object.prototype,Nf=bf.hasOwnProperty;function Bf(u,e){var t=Lf(u),r=!t&&Af(u),n=!t&&!r&&wf(u),s=!t&&!r&&!n&&Df(u),l=t||r||n||s,o=l?Ef(u.length,String):[],a=o.length;for(var c in u)(e||Nf.call(u,c))&&!(l&&(// Safari 9 has enumerable `arguments.length` in strict mode.
|
|
396
|
+
c=="length"||// Node.js 0.10 has enumerable non-index properties on buffers.
|
|
397
|
+
n&&(c=="offset"||c=="parent")||// PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
398
|
+
s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||// Skip index properties.
|
|
399
|
+
Rf(c,a)))&&o.push(c);return o;}var Ii=Bf,Wf=Object.prototype;function Ff(u){var e=u&&u.constructor,t=typeof e=="function"&&e.prototype||Wf;return u===t;}var tn=Ff;function Uf(u,e){return function(t){return u(e(t));};}var Mi=Uf,jf=Mi,Yf=jf(Object.keys,Object),Xf=Yf,zf=tn,$f=Xf,Gf=Object.prototype,Hf=Gf.hasOwnProperty;function Vf(u){if(!zf(u))return $f(u);var e=[];for(var t in Object(u))Hf.call(u,t)&&t!="constructor"&&e.push(t);return e;}var Kf=Vf,kf=pi,Zf=Ci;function Jf(u){return u!=null&&Zf(u.length)&&!kf(u);}var en=Jf,Qf=Ii,qf=Kf,_f=en;function th(u){return _f(u)?Qf(u):qf(u);}var rn=th,eh=Br,rh=rn;function nh(u,e){return u&&eh(e,rh(e),u);}var ih=nh;function sh(u){var e=[];if(u!=null)for(var t in Object(u))e.push(t);return e;}var oh=sh,ah=hr,lh=tn,ch=oh,fh=Object.prototype,hh=fh.hasOwnProperty;function uh(u){if(!ah(u))return ch(u);var e=lh(u),t=[];for(var r in u)r=="constructor"&&(e||!hh.call(u,r))||t.push(r);return t;}var dh=uh,ph=Ii,mh=dh,vh=en;function gh(u){return vh(u)?ph(u,!0):mh(u);}var nn=gh,yh=Br,Ph=nn;function xh(u,e){return u&&yh(e,Ph(e),u);}var Sh=xh,xr={exports:{}};xr.exports;(function(u,e){var t=Ee,r=e&&!e.nodeType&&e,n=r&&!0&&u&&!u.nodeType&&u,s=n&&n.exports===r,l=s?t.Buffer:void 0,o=l?l.allocUnsafe:void 0;function a(c,y){if(y)return c.slice();var f=c.length,g=o?o(f):new c.constructor(f);return c.copy(g),g;}u.exports=a;})(xr,xr.exports);var Th=xr.exports;function Ch(u,e){var t=-1,r=u.length;for(e||(e=Array(r));++t<r;)e[t]=u[t];return e;}var Oh=Ch;function Ih(u,e){for(var t=-1,r=u==null?0:u.length,n=0,s=[];++t<r;){var l=u[t];e(l,t,u)&&(s[n++]=l);}return s;}var Ei=Ih;function Mh(){return[];}var Ai=Mh,Eh=Ei,Ah=Ai,Lh=Object.prototype,wh=Lh.propertyIsEnumerable,wn=Object.getOwnPropertySymbols,Rh=wn?function(u){return u==null?[]:(u=Object(u),Eh(wn(u),function(e){return wh.call(u,e);}));}:Ah,sn=Rh,Dh=Br,bh=sn;function Nh(u,e){return Dh(u,bh(u),e);}var Bh=Nh;function Wh(u,e){for(var t=-1,r=e.length,n=u.length;++t<r;)u[n+t]=e[t];return u;}var on=Wh,Fh=Mi,Uh=Fh(Object.getPrototypeOf,Object),Li=Uh,jh=on,Yh=Li,Xh=sn,zh=Ai,$h=Object.getOwnPropertySymbols,Gh=$h?function(u){for(var e=[];u;)jh(e,Xh(u)),u=Yh(u);return e;}:zh,wi=Gh,Hh=Br,Vh=wi;function Kh(u,e){return Hh(u,Vh(u),e);}var kh=Kh,Zh=on,Jh=ur;function Qh(u,e,t){var r=e(u);return Jh(u)?r:Zh(r,t(u));}var Ri=Qh,qh=Ri,_h=sn,tu=rn;function eu(u){return qh(u,tu,_h);}var Di=eu,ru=Ri,nu=wi,iu=nn;function su(u){return ru(u,iu,nu);}var ou=su,au=Ue,lu=Ee,cu=au(lu,"DataView"),fu=cu,hu=Ue,uu=Ee,du=hu(uu,"Promise"),pu=du,mu=Ue,vu=Ee,gu=mu(vu,"Set"),bi=gu,yu=Ue,Pu=Ee,xu=yu(Pu,"WeakMap"),Su=xu,zr=fu,$r=Qr,Gr=pu,Hr=bi,Vr=Su,Ni=Je,er=mi,Rn="[object Map]",Tu="[object Object]",Dn="[object Promise]",bn="[object Set]",Nn="[object WeakMap]",Bn="[object DataView]",Cu=er(zr),Ou=er($r),Iu=er(Gr),Mu=er(Hr),Eu=er(Vr),Fe=Ni;(zr&&Fe(new zr(new ArrayBuffer(1)))!=Bn||$r&&Fe(new $r())!=Rn||Gr&&Fe(Gr.resolve())!=Dn||Hr&&Fe(new Hr())!=bn||Vr&&Fe(new Vr())!=Nn)&&(Fe=function Fe(u){var e=Ni(u),t=e==Tu?u.constructor:void 0,r=t?er(t):"";if(r)switch(r){case Cu:return Bn;case Ou:return Rn;case Iu:return Dn;case Mu:return bn;case Eu:return Nn;}return e;});var Fr=Fe,Au=Object.prototype,Lu=Au.hasOwnProperty;function wu(u){var e=u.length,t=new u.constructor(e);return e&&typeof u[0]=="string"&&Lu.call(u,"index")&&(t.index=u.index,t.input=u.input),t;}var Ru=wu,Du=Ee,bu=Du.Uint8Array,Bi=bu,Wn=Bi;function Nu(u){var e=new u.constructor(u.byteLength);return new Wn(e).set(new Wn(u)),e;}var an=Nu,Bu=an;function Wu(u,e){var t=e?Bu(u.buffer):u.buffer;return new u.constructor(t,u.byteOffset,u.byteLength);}var Fu=Wu,Uu=/\w*$/;function ju(u){var e=new u.constructor(u.source,Uu.exec(u));return e.lastIndex=u.lastIndex,e;}var Yu=ju,Fn=fr,Un=Fn?Fn.prototype:void 0,jn=Un?Un.valueOf:void 0;function Xu(u){return jn?Object(jn.call(u)):{};}var zu=Xu,$u=an;function Gu(u,e){var t=e?$u(u.buffer):u.buffer;return new u.constructor(t,u.byteOffset,u.length);}var Hu=Gu,Vu=an,Ku=Fu,ku=Yu,Zu=zu,Ju=Hu,Qu="[object Boolean]",qu="[object Date]",_u="[object Map]",td="[object Number]",ed="[object RegExp]",rd="[object Set]",nd="[object String]",id="[object Symbol]",sd="[object ArrayBuffer]",od="[object DataView]",ad="[object Float32Array]",ld="[object Float64Array]",cd="[object Int8Array]",fd="[object Int16Array]",hd="[object Int32Array]",ud="[object Uint8Array]",dd="[object Uint8ClampedArray]",pd="[object Uint16Array]",md="[object Uint32Array]";function vd(u,e,t){var r=u.constructor;switch(e){case sd:return Vu(u);case Qu:case qu:return new r(+u);case od:return Ku(u,t);case ad:case ld:case cd:case fd:case hd:case ud:case dd:case pd:case md:return Ju(u,t);case _u:return new r();case td:case nd:return new r(u);case ed:return ku(u);case rd:return new r();case id:return Zu(u);}}var gd=vd,yd=hr,Yn=Object.create,Pd=/* @__PURE__ */function(){function u(){}return function(e){if(!yd(e))return{};if(Yn)return Yn(e);u.prototype=e;var t=new u();return u.prototype=void 0,t;};}(),xd=Pd,Sd=xd,Td=Li,Cd=tn;function Od(u){return typeof u.constructor=="function"&&!Cd(u)?Sd(Td(u)):{};}var Id=Od,Md=Fr,Ed=we,Ad="[object Map]";function Ld(u){return Ed(u)&&Md(u)==Ad;}var wd=Ld,Rd=wd,Dd=Wr,Xn=_r,zn=Xn&&Xn.isMap,bd=zn?Dd(zn):Rd,Nd=bd,Bd=Fr,Wd=we,Fd="[object Set]";function Ud(u){return Wd(u)&&Bd(u)==Fd;}var jd=Ud,Yd=jd,Xd=Wr,$n=_r,Gn=$n&&$n.isSet,zd=Gn?Xd(Gn):Yd,Wi=zd,$d=/* @__PURE__ */Ne(Wi),Gd=gi,Hd=mc,Vd=xi,Kd=ih,kd=Sh,Zd=Th,Jd=Oh,Qd=Bh,qd=kh,_d=Di,tp=ou,ep=Fr,rp=Ru,np=gd,ip=Id,sp=ur,op=qr,ap=Nd,lp=hr,cp=Wi,fp=rn,hp=nn,up=1,dp=2,pp=4,Fi="[object Arguments]",mp="[object Array]",vp="[object Boolean]",gp="[object Date]",yp="[object Error]",Ui="[object Function]",Pp="[object GeneratorFunction]",xp="[object Map]",Sp="[object Number]",ji="[object Object]",Tp="[object RegExp]",Cp="[object Set]",Op="[object String]",Ip="[object Symbol]",Mp="[object WeakMap]",Ep="[object ArrayBuffer]",Ap="[object DataView]",Lp="[object Float32Array]",wp="[object Float64Array]",Rp="[object Int8Array]",Dp="[object Int16Array]",bp="[object Int32Array]",Np="[object Uint8Array]",Bp="[object Uint8ClampedArray]",Wp="[object Uint16Array]",Fp="[object Uint32Array]",re={};re[Fi]=re[mp]=re[Ep]=re[Ap]=re[vp]=re[gp]=re[Lp]=re[wp]=re[Rp]=re[Dp]=re[bp]=re[xp]=re[Sp]=re[ji]=re[Tp]=re[Cp]=re[Op]=re[Ip]=re[Np]=re[Bp]=re[Wp]=re[Fp]=!0;re[yp]=re[Ui]=re[Mp]=!1;function gr(u,e,t,r,n,s){var l,o=e&up,a=e&dp,c=e&pp;if(t&&(l=n?t(u,r,n,s):t(u)),l!==void 0)return l;if(!lp(u))return u;var y=sp(u);if(y){if(l=rp(u),!o)return Jd(u,l);}else{var f=ep(u),g=f==Ui||f==Pp;if(op(u))return Zd(u,o);if(f==ji||f==Fi||g&&!n){if(l=a||g?{}:ip(u),!o)return a?qd(u,kd(l,u)):Qd(u,Kd(l,u));}else{if(!re[f])return n?u:{};l=np(u,f,o);}}s||(s=new Gd());var x=s.get(u);if(x)return x;s.set(u,l),cp(u)?u.forEach(function(P){l.add(gr(P,e,t,P,u,s));}):ap(u)&&u.forEach(function(P,C){l.set(C,gr(P,e,t,C,u,s));});var M=c?a?tp:_d:a?hp:fp,S=y?void 0:M(u);return Hd(S||u,function(P,C){S&&(C=P,P=u[C]),Vd(l,C,gr(P,e,t,C,u,s));}),l;}var Up=gr,jp=Up,Yp=1,Xp=4;function zp(u){return jp(u,Yp|Xp);}var $p=zp,he=/* @__PURE__ */Ne($p);var Yi="1.1.19-beta.2",Gp="@netless/appliance-plugin";if((typeof window==="undefined"?"undefined":_typeof(window))<"u"){var u=window.__netlessUA||"";u+=" ".concat(Gp,"@").concat(Yi),window.__netlessUA=u;}var Te={useWorker:"auto",syncOpt:{interval:300,smoothSync:!0},cursor:{enable:!0,expirationTime:5e3},bufferSize:{full:2e4,sub:600},bezier:{enable:!0,maxDrawCount:1/0,combineUnitTime:300},pencilEraser:{useBitMap:!0,maxImageWidth:1920,maxImageHeight:1920,maxCombineTime:500},strokeWidth:{min:1,max:10},textEditor:{showFloatBar:!0,canSelectorSwitch:!0,rightBoundBreak:!1}};function De(u){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var t=u.length;if(t<2)return"";var r=u[0],n=u[1];if(t===2)return"M".concat(ze(r),"L").concat(ze(n));var s="";for(var l=2,o=t-1;l<o;l++)r=u[l],n=u[l+1],s+=$e(r,n);return e?"M".concat($e(u[0],u[1]),"Q").concat(ze(u[1])).concat($e(u[1],u[2]),"T").concat(s).concat($e(u[t-1],u[0])).concat($e(u[0],u[1]),"Z"):"M".concat(ze(u[0]),"Q").concat(ze(u[1])).concat($e(u[1],u[2])).concat(u.length>3?"T":"").concat(s,"L").concat(ze(u[t-1]));}var xe=/*#__PURE__*/function(){function xe(e){_classCallCheck(this,xe);at(this,"maxImageWidth",Te.pencilEraser.maxImageWidth);at(this,"maxImageHeight",Te.pencilEraser.maxImageHeight);at(this,"syncUnitTime",Te.syncOpt.interval);at(this,"vNodes");at(this,"drawLayer");at(this,"fullLayer");at(this,"workId");at(this,"isDelete",!1);var t=e.vNodes,r=e.fullLayer,n=e.drawLayer,s=e.workId,l=e.toolsOpt;this.vNodes=t,this.fullLayer=r,this.drawLayer=n,this.workId=s,this.syncUnitTime=l.syncUnitTime||this.syncUnitTime;}return _createClass(xe,[{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,l;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,(l=this.vNodes)==null||l.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 l=this.fullLayer.getElementsByName(r)||this.drawLayer&&this.drawLayer.getElementsByName(r)||[];if(l.length!==1)return;var o=l[0],a=e.pos,c=e.zIndex,y=e.scale,f=e.angle,g=e.translate,x={};ue(c)&&(x.zIndex=c),a&&(x.pos=[a[0],a[1]]),y&&(x.scale=y),f&&(x.rotate=f),g&&(x.translate=g),o.attr(x);var M=o==null?void 0:o.getBoundingClientRect();return M&&(t=Wt(t,{x:Math.floor(M.x-xe.SafeBorderPadding),y:Math.floor(M.y-xe.SafeBorderPadding),w:Math.floor(M.width+xe.SafeBorderPadding*2),h:Math.floor(M.height+xe.SafeBorderPadding*2)})),(s=this.vNodes)==null||s.setInfo(r,{rect:t,centerPos:a}),t;}}},{key:"drawEraserlines",value:function drawEraserlines(e,t){var r=e.group,n=e.eraserlines,s=e.pos,l=e.layer,o=l.parent;if(t)try{var c=(l.renderer.glRenderer||l.renderer.canvasRenderer).options.displayRatio,y=r.getBoundingClientRect(),f=y.width*c*l.worldScaling[0],g=y.height*c*l.worldScaling[1];var x=1;(f>this.maxImageWidth||g>this.maxImageHeight)&&(x=Math.min(this.maxImageWidth/f,this.maxImageHeight/g));var M=l.getAttribute("scale");M=[M[0]*x,M[1]*x];var S=l.parent.parent,P=l.getAttribute("translate"),_C28=this.createVmRenderNode("".concat(this.workId,"_bitMapLayer"),S,{offscreen:o.offscreen,width:o.width,height:o.height,contextType:"2d",autoRender:!1,bufferSize:500},M,P),_h26=r.cloneNode(!0);if(!n||!n.length)return;this.addEraserlines(_h26,n,s,!1),_C28.appendChild(_h26);var p=_C28.parent;p.render();var d=_C28.renderer.canvasRenderer,v=d.context;if(!v)return;var I=d.options.displayRatio,L=_h26.getBoundingClientRect(),w={x:L.x,y:L.y,w:L.width,h:L.height},B={x:0,y:0,w:S.width,h:S.height};if(sr(w,B)===ge.outside){Se(_h26,p),S.removeChild(p),this.isDelete=!0;return;}var b=he(w);b.x=Math.floor(Math.max(w.x,0)),b.y=Math.floor(Math.max(w.y,0)),b.w=Math.min(w.x+w.w,S.width)-b.x,b.h=Math.min(w.y+w.h,S.height)-b.y;var W=this.getGroupRect(b,I),D=W.x,R=W.y,Y=W.w,V=W.h;var Q=v.getImageData(D,R,Y,V);if(this.isTransparentRectByCanvas(Q)){Se(_h26,p),S.removeChild(p),this.isDelete=!0,Q=null;return;}Se(r,o);var it=this.createSpriteNode({imageData:Q,safariRect:b,originRect:w,worldScaling:_C28.worldScaling});it&&r.append(it),Se(_h26,p),S.removeChild(p),o.deleteTexture(Q),Q=null;}catch(a){console.error("[BaseShapeTool] drawEraserlines error:",a);return;}}},{key:"createVmRenderNode",value:function createVmRenderNode(e,t,r,n,s){var l=r.width,o=r.height,a="bitMap-".concat(e),c=t.layer(a,r),y=new me({anchor:[0.5,0.5],pos:[l*0.5,o*0.5],size:[l,o],name:"viewport",id:e});return y.setAttribute("scale",n),y.setAttribute("translate",s),c.append(y),y;}},{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),l=Math.floor(e.h*t);return{x:r,y:n,w:s,h:l};}},{key:"addEraserlines",value:function addEraserlines(e,t,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!0;var _iterator13=_createForOfIteratorHelper(t),_step13;try{for(_iterator13.s();!(_step13=_iterator13.n()).done;){var s=_step13.value;var l=s.thickness,o=s.op;var _iterator14=_createForOfIteratorHelper(o),_step14;try{for(_iterator14.s();!(_step14=_iterator14.n()).done;){var a=_step14.value;var c=a.map(function(M,S){return S%2?M-r[1]:M-r[0];}),y=this.computEraserPoints(c,l),f=De(y,!0),g={pos:[0,0],d:f,fillColor:"rgba(0,0,0,1)"},x=new be(g);x.addEventListener("beforerender",function(_ref164){var M=_ref164.detail;var S=M.context;n?S.blendFuncSeparate(S.ZERO,S.ZERO,S.ZERO,S.ZERO):S.globalCompositeOperation="destination-out";}),x.addEventListener("afterrender",function(_ref165){var M=_ref165.detail;var S=M.context;n?S.blendFuncSeparate(S.SRC_ALPHA,S.ONE_MINUS_SRC_ALPHA,S.ONE,S.ONE_MINUS_SRC_ALPHA):S.globalCompositeOperation="source-over";}),e.append(x);}}catch(err){_iterator14.e(err);}finally{_iterator14.f();}}}catch(err){_iterator13.e(err);}finally{_iterator13.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 l;if(typeof OffscreenCanvas=="function"){l=new OffscreenCanvas(t.width,t.height);var y=l.getContext("2d");y&&y.putImageData(t,0,0);}else if((typeof document==="undefined"?"undefined":_typeof(document))<"u"){l=document.createElement("canvas"),l.width=t.width,l.height=t.height;var _y3=l.getContext("2d");_y3&&_y3.putImageData(t,0,0);}if(!l)return console.warn("Failed to create imageEraserBitmap Sprite"),null;var o=[Math.floor(s.w/r[0]),Math.floor(s.h/r[1])],a=[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])],c={name:"eraserTexture",anchor:[0.5,0.5],pos:[0,0],size:o,texture:l,textureRect:a};return new hi(c);}},{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 Dt(e[0],e[1]);return Dt.GetDotStroke(r,t,8);}},{key:"computLine",value:function computLine(e,t){var r=[],n=[];var s,l;for(var o=0;o<e.length;o+=2){var a=new Dt(e[o],e[o+1]);var c=void 0;if(o==e.length-2){var y=new Dt(e[o-2],e[o-1]);c=ot.Sub(a,y).uni(),s=a;}else{o===0&&(l=a);var _y4=new Dt(e[o+2],e[o+3]);c=ot.Sub(_y4,a).uni();}if(c){var _y5=ot.Per(c).mul(t);r.push(Dt.Sub(a,_y5)),n.push(Dt.Add(a,_y5));}}if(s&&l){var _o3=Dt.GetSemicircleStroke(s,r[r.length-1],-1,8),_a4=Dt.GetSemicircleStroke(l,n[0],-1,8);return r.concat(_o3,n.reverse(),_a4);}return[];}},{key:"replace",value:function replace(e,t,r){var _this61=this;var s;if(!t){r&&e.append(r);return;}var n=e.getElementsByName(t);if(n.length){var _iterator15=_createForOfIteratorHelper(n),_step15;try{for(_iterator15.s();!(_step15=_iterator15.n()).done;){var l=_step15.value;r?ym(r,l,e):(l.remove(),_pe(l,e.parent));}}catch(err){_iterator15.e(err);}finally{_iterator15.f();}}else r&&e.append(r);this.fullLayer!==this.drawLayer&&(this.fullLayer===e?(s=this.drawLayer)==null||s.getElementsByName(t).forEach(function(o){var a;o.remove(),_pe(o,(a=_this61.drawLayer)==null?void 0:a.parent);}):this.fullLayer.getElementsByName(t).forEach(function(o){o.remove(),_pe(o,_this61.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(),_pe(n,e.parent);}}}],[{key:"updateNodeOpt",value:function updateNodeOpt(e){var h;var t=e.node,r=e.opt,n=e.vNodes,s=e.willSerializeData,l=e.targetNode,o=r.zIndex,a=r.translate,c=r.angle,y=r.originPoint,f=r.scenePoint,g=r.scale,x=r.pointMap,M=r.thickness;var S;var P=l&&he(l)||n.get(t.name);if(!P)return;ue(o)&&(t.setAttribute("zIndex",o),P.opt.zIndex=o);var C=t.parent;if(C){if(y&&g&&l){var p=[P.op[0],P.op[1]];mn(P.op,f,g,a);var d=[P.op[0],P.op[1]],v=[d[0]-p[0],d[1]-p[1]];if(P.centerPos=[P.centerPos[0]+v[0],P.centerPos[1]+v[1]],P.opt.translate=void 0,P.opt.scale=void 0,P.opt.eraserlines)for(var I=0;I<P.opt.eraserlines.length;I++){var _P$opt$eraserlines$I=P.opt.eraserlines[I],L=_P$opt$eraserlines$I.op,w=_P$opt$eraserlines$I.thickness;P.opt.eraserlines[I].thickness=Math.round(w*Math.max(g[0],g[1]));for(var B=0;B<L.length;B++)vn(L[B],f,g,a);}}else if(a){if(t.setAttribute("translate",a),P.opt.translate=a,l){var _p6=[a[0]*C.worldScaling[0],a[1]*C.worldScaling[1]];S=cr(P.rect,_p6),P.rect=S;}else{var _p7=xe.getRectFromLayer(C,t.name);P.rect=_p7||P.rect;}}else if(ue(c))if(t.setAttribute("rotate",c),P.opt.rotate=c,l)S=ns(P.rect,c),P.rect=S;else{var _p8=xe.getRectFromLayer(C,t.name);P.rect=_p8||P.rect;}if(x){var _p9=x.get(t.name);if(_p9)for(var _d11=0,_v10=0;_d11<P.op.length;_d11+=3,_v10++)P.op[_d11]=_p9[_v10][0],P.op[_d11+1]=_p9[_v10][1];}if(M&&(h=P==null?void 0:P.opt)!=null&&h.thickness&&(P.opt.thickness=M),s&&!(y&&g&&l)){if(a){var _p10=P.op.map(function(d,v){var I=v%3;return I===0?d+a[0]:I===1?d+a[1]:d;});if(P.op=_p10,P.centerPos=[P.centerPos[0]+a[0],P.centerPos[1]+a[1]],P!=null&&P.opt&&(P.opt.translate=void 0),P.opt.eraserlines)for(var _d12=0;_d12<P.opt.eraserlines.length;_d12++){var _v11=P.opt.eraserlines[_d12].op;for(var _I6=0;_I6<_v11.length;_I6++){var _L3=_v11[_I6].map(function(w,B){return B%2?w+a[1]:w+a[0];});P.opt.eraserlines[_d12].op[_I6]=_L3;}}}else if(ue(c)){var _p11=P.op;if(fm(_p11,P.centerPos,c),P.op=_p11,P!=null&&P.opt&&(P.opt.rotate=void 0),P.opt.eraserlines)for(var _d13=0;_d13<P.opt.eraserlines.length;_d13++){var _v12=P.opt.eraserlines[_d13].op;for(var _I7=0;_I7<_v12.length;_I7++)hm(_v12[_I7],P.centerPos,c);}}}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-xe.SafeBorderPadding),y:Math.floor(n.y-xe.SafeBorderPadding),w:Math.floor(n.width+xe.SafeBorderPadding*2),h:Math.floor(n.height+xe.SafeBorderPadding*2)};}}},{key:"isWillRefresh",value:function isWillRefresh(e){var t=e.toolsType,r=e.opt,n=e.node,s=e.updateOpt,l=e.willSerializeData;return!!(l&&(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===xt.Text&&(s.fontSize||s.translate||s.textInfos&&s.textInfos.get(n.name))||t===xt.Image&&(s.angle||s.translate||s.scale||s.strokeColor&&s.type===Zr.Iconify)||t===s.toolsType&&s.willRefresh||r.eraserlines&&r.eraserlines.length&&(s.strokeColor||s.fillColor));}}]);}();at(xe,"SafeBorderPadding",10);var Et=xe;var ln=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 cn={exports:{}};cn.exports;(function(u){var e=function(){var t=String.fromCharCode,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",s={};function l(a,c){if(!s[a]){s[a]={};for(var y=0;y<a.length;y++)s[a][a.charAt(y)]=y;}return s[a][c];}var o={compressToBase64:function compressToBase64(a){if(a==null)return"";var c=o._compress(a,6,function(y){return r.charAt(y);});switch(c.length%4){default:case 0:return c;case 1:return c+"===";case 2:return c+"==";case 3:return c+"=";}},decompressFromBase64:function decompressFromBase64(a){return a==null?"":a==""?null:o._decompress(a.length,32,function(c){return l(r,a.charAt(c));});},compressToUTF16:function compressToUTF16(a){return a==null?"":o._compress(a,15,function(c){return t(c+32);})+" ";},decompressFromUTF16:function decompressFromUTF16(a){return a==null?"":a==""?null:o._decompress(a.length,16384,function(c){return a.charCodeAt(c)-32;});},//compress into uint8array (UCS-2 big endian format)
|
|
400
|
+
compressToUint8Array:function compressToUint8Array(a){for(var c=o.compress(a),y=new Uint8Array(c.length*2),f=0,g=c.length;f<g;f++){var x=c.charCodeAt(f);y[f*2]=x>>>8,y[f*2+1]=x%256;}return y;},//decompress from uint8array (UCS-2 big endian format)
|
|
401
|
+
decompressFromUint8Array:function decompressFromUint8Array(a){if(a==null)return o.decompress(a);for(var c=new Array(a.length/2),y=0,f=c.length;y<f;y++)c[y]=a[y*2]*256+a[y*2+1];var g=[];return c.forEach(function(x){g.push(t(x));}),o.decompress(g.join(""));},//compress into a string that is already URI encoded
|
|
402
|
+
compressToEncodedURIComponent:function compressToEncodedURIComponent(a){return a==null?"":o._compress(a,6,function(c){return n.charAt(c);});},//decompress from an output of compressToEncodedURIComponent
|
|
403
|
+
decompressFromEncodedURIComponent:function decompressFromEncodedURIComponent(a){return a==null?"":a==""?null:(a=a.replace(/ /g,"+"),o._decompress(a.length,32,function(c){return l(n,a.charAt(c));}));},compress:function compress(a){return o._compress(a,16,function(c){return t(c);});},_compress:function _compress(a,c,y){if(a==null)return"";var f,g,x={},M={},S="",P="",C="",h=2,p=3,d=2,v=[],I=0,L=0,w;for(w=0;w<a.length;w+=1)if(S=a.charAt(w),Object.prototype.hasOwnProperty.call(x,S)||(x[S]=p++,M[S]=!0),P=C+S,Object.prototype.hasOwnProperty.call(x,P))C=P;else{if(Object.prototype.hasOwnProperty.call(M,C)){if(C.charCodeAt(0)<256){for(f=0;f<d;f++)I=I<<1,L==c-1?(L=0,v.push(y(I)),I=0):L++;for(g=C.charCodeAt(0),f=0;f<8;f++)I=I<<1|g&1,L==c-1?(L=0,v.push(y(I)),I=0):L++,g=g>>1;}else{for(g=1,f=0;f<d;f++)I=I<<1|g,L==c-1?(L=0,v.push(y(I)),I=0):L++,g=0;for(g=C.charCodeAt(0),f=0;f<16;f++)I=I<<1|g&1,L==c-1?(L=0,v.push(y(I)),I=0):L++,g=g>>1;}h--,h==0&&(h=Math.pow(2,d),d++),delete M[C];}else for(g=x[C],f=0;f<d;f++)I=I<<1|g&1,L==c-1?(L=0,v.push(y(I)),I=0):L++,g=g>>1;h--,h==0&&(h=Math.pow(2,d),d++),x[P]=p++,C=String(S);}if(C!==""){if(Object.prototype.hasOwnProperty.call(M,C)){if(C.charCodeAt(0)<256){for(f=0;f<d;f++)I=I<<1,L==c-1?(L=0,v.push(y(I)),I=0):L++;for(g=C.charCodeAt(0),f=0;f<8;f++)I=I<<1|g&1,L==c-1?(L=0,v.push(y(I)),I=0):L++,g=g>>1;}else{for(g=1,f=0;f<d;f++)I=I<<1|g,L==c-1?(L=0,v.push(y(I)),I=0):L++,g=0;for(g=C.charCodeAt(0),f=0;f<16;f++)I=I<<1|g&1,L==c-1?(L=0,v.push(y(I)),I=0):L++,g=g>>1;}h--,h==0&&(h=Math.pow(2,d),d++),delete M[C];}else for(g=x[C],f=0;f<d;f++)I=I<<1|g&1,L==c-1?(L=0,v.push(y(I)),I=0):L++,g=g>>1;h--,h==0&&(h=Math.pow(2,d),d++);}for(g=2,f=0;f<d;f++)I=I<<1|g&1,L==c-1?(L=0,v.push(y(I)),I=0):L++,g=g>>1;for(;;)if(I=I<<1,L==c-1){v.push(y(I));break;}else L++;return v.join("");},decompress:function decompress(a){return a==null?"":a==""?null:o._decompress(a.length,32768,function(c){return a.charCodeAt(c);});},_decompress:function _decompress(a,c,y){var f=[],g=4,x=4,M=3,S="",P=[],C,h,p,d,v,I,L,w={val:y(0),position:c,index:1};for(C=0;C<3;C+=1)f[C]=C;for(p=0,v=Math.pow(2,2),I=1;I!=v;)d=w.val&w.position,w.position>>=1,w.position==0&&(w.position=c,w.val=y(w.index++)),p|=(d>0?1:0)*I,I<<=1;switch(p){case 0:for(p=0,v=Math.pow(2,8),I=1;I!=v;)d=w.val&w.position,w.position>>=1,w.position==0&&(w.position=c,w.val=y(w.index++)),p|=(d>0?1:0)*I,I<<=1;L=t(p);break;case 1:for(p=0,v=Math.pow(2,16),I=1;I!=v;)d=w.val&w.position,w.position>>=1,w.position==0&&(w.position=c,w.val=y(w.index++)),p|=(d>0?1:0)*I,I<<=1;L=t(p);break;case 2:return"";}for(f[3]=L,h=L,P.push(L);;){if(w.index>a)return"";for(p=0,v=Math.pow(2,M),I=1;I!=v;)d=w.val&w.position,w.position>>=1,w.position==0&&(w.position=c,w.val=y(w.index++)),p|=(d>0?1:0)*I,I<<=1;switch(L=p){case 0:for(p=0,v=Math.pow(2,8),I=1;I!=v;)d=w.val&w.position,w.position>>=1,w.position==0&&(w.position=c,w.val=y(w.index++)),p|=(d>0?1:0)*I,I<<=1;f[x++]=t(p),L=x-1,g--;break;case 1:for(p=0,v=Math.pow(2,16),I=1;I!=v;)d=w.val&w.position,w.position>>=1,w.position==0&&(w.position=c,w.val=y(w.index++)),p|=(d>0?1:0)*I,I<<=1;f[x++]=t(p),L=x-1,g--;break;case 2:return P.join("");}if(g==0&&(g=Math.pow(2,M),M++),f[L])S=f[L];else if(L===x)S=h+h.charAt(0);else return null;P.push(S),f[x++]=h+S.charAt(0),g--,h=S,g==0&&(g=Math.pow(2,M),M++);}}};return o;}();u!=null?u.exports=e:(typeof angular==="undefined"?"undefined":_typeof(angular))<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return e;});})(cn);var Xi=cn.exports;function Ze(u){return JSON.parse(Xi.decompress(u));}function ye(u){return Xi.compress(JSON.stringify(u));}var zi={exports:{}};(function(u){(function(){var e={};e.version="6.4.2.2",e.use_lines=!0,e.use_xyz=!1;var t=!1;u.exports?(u.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 l;function o(i,m,O){e.biginteger_used=1,i!=null&&(typeof i=="number"&&_typeof(m)>"u"?this.fromInt(i):typeof i=="number"?this.fromNumber(i,m,O):m==null&&typeof i!="string"?this.fromString(i,256):this.fromString(i,m));}function a(){return new o(null,void 0,void 0);}function c(i,m,O,N,X,k){for(;--k>=0;){var _=m*this[i++]+O[N]+X;X=Math.floor(_/67108864),O[N++]=_&67108863;}return X;}function y(i,m,O,N,X,k){for(var _=m&32767,ft=m>>15;--k>=0;){var ht=this[i]&32767,Ct=this[i++]>>15,wt=ft*ht+Ct*_;ht=_*ht+((wt&32767)<<15)+O[N]+(X&1073741823),X=(ht>>>30)+(wt>>>15)+ft*Ct+(X>>>30),O[N++]=ht&1073741823;}return X;}function f(i,m,O,N,X,k){for(var _=m&16383,ft=m>>14;--k>=0;){var ht=this[i]&16383,Ct=this[i++]>>14,wt=ft*ht+Ct*_;ht=_*ht+((wt&16383)<<14)+O[N]+X,X=(ht>>28)+(wt>>14)+ft*Ct,O[N++]=ht&268435455;}return X;}r=="Microsoft Internet Explorer"?(o.prototype.am=y,l=30):r!="Netscape"?(o.prototype.am=c,l=26):(o.prototype.am=f,l=28),o.prototype.DB=l,o.prototype.DM=(1<<l)-1,o.prototype.DV=1<<l;var g=52;o.prototype.FV=Math.pow(2,g),o.prototype.F1=g-l,o.prototype.F2=2*l-g;var x="0123456789abcdefghijklmnopqrstuvwxyz",M=new Array(),S,P;for(S=48,P=0;P<=9;++P)M[S++]=P;for(S=97,P=10;P<36;++P)M[S++]=P;for(S=65,P=10;P<36;++P)M[S++]=P;function C(i){return x.charAt(i);}function h(i,m){var O=M[i.charCodeAt(m)];return O!==null&&O!==void 0?O:-1;}function p(i){for(var m=this.t-1;m>=0;--m)i[m]=this[m];i.t=this.t,i.s=this.s;}function d(i){this.t=1,this.s=i<0?-1:0,i>0?this[0]=i:i<-1?this[0]=i+this.DV:this.t=0;}function v(i){var m=a();return m.fromInt(i),m;}function I(i,m){var O;if(m==16)O=4;else if(m==8)O=3;else if(m==256)O=8;else if(m==2)O=1;else if(m==32)O=5;else if(m==4)O=2;else{this.fromRadix(i,m);return;}this.t=0,this.s=0;for(var N=i.length,X=!1,k=0;--N>=0;){var _=O==8?i[N]&255:h(i,N);if(_<0){i.charAt(N)=="-"&&(X=!0);continue;}X=!1,k==0?this[this.t++]=_:k+O>this.DB?(this[this.t-1]|=(_&(1<<this.DB-k)-1)<<k,this[this.t++]=_>>this.DB-k):this[this.t-1]|=_<<k,k+=O,k>=this.DB&&(k-=this.DB);}O==8&&i[0]&128&&(this.s=-1,k>0&&(this[this.t-1]|=(1<<this.DB-k)-1<<k)),this.clamp(),X&&o.ZERO.subTo(this,this);}function L(){for(var i=this.s&this.DM;this.t>0&&this[this.t-1]==i;)--this.t;}function w(i){if(this.s<0)return"-"+this.negate().toString(i);var m;if(i==16)m=4;else if(i==8)m=3;else if(i==2)m=1;else if(i==32)m=5;else if(i==4)m=2;else return this.toRadix(i);var O=(1<<m)-1,N,X=!1,k="",_=this.t,ft=this.DB-_*this.DB%m;if(_-->0)for(ft<this.DB&&(N=this[_]>>ft)>0&&(X=!0,k=C(N));_>=0;)ft<m?(N=(this[_]&(1<<ft)-1)<<m-ft,N|=this[--_]>>(ft+=this.DB-m)):(N=this[_]>>(ft-=m)&O,ft<=0&&(ft+=this.DB,--_)),N>0&&(X=!0),X&&(k+=C(N));return X?k:"0";}function B(){var i=a();return o.ZERO.subTo(this,i),i;}function E(){return this.s<0?this.negate():this;}function b(i){var m=this.s-i.s;if(m!=0)return m;var O=this.t;if(m=O-i.t,m!=0)return this.s<0?-m:m;for(;--O>=0;)if((m=this[O]-i[O])!=0)return m;return 0;}function W(i){var m=1,O;return(O=i>>>16)!=0&&(i=O,m+=16),(O=i>>8)!=0&&(i=O,m+=8),(O=i>>4)!=0&&(i=O,m+=4),(O=i>>2)!=0&&(i=O,m+=2),(O=i>>1)!=0&&(i=O,m+=1),m;}function D(){return this.t<=0?0:this.DB*(this.t-1)+W(this[this.t-1]^this.s&this.DM);}function R(i,m){var O;for(O=this.t-1;O>=0;--O)m[O+i]=this[O];for(O=i-1;O>=0;--O)m[O]=0;m.t=this.t+i,m.s=this.s;}function Y(i,m){for(var O=i;O<this.t;++O)m[O-i]=this[O];m.t=Math.max(this.t-i,0),m.s=this.s;}function V(i,m){var O=i%this.DB,N=this.DB-O,X=(1<<N)-1,k=Math.floor(i/this.DB),_=this.s<<O&this.DM,ft;for(ft=this.t-1;ft>=0;--ft)m[ft+k+1]=this[ft]>>N|_,_=(this[ft]&X)<<O;for(ft=k-1;ft>=0;--ft)m[ft]=0;m[k]=_,m.t=this.t+k+1,m.s=this.s,m.clamp();}function Q(i,m){m.s=this.s;var O=Math.floor(i/this.DB);if(O>=this.t){m.t=0;return;}var N=i%this.DB,X=this.DB-N,k=(1<<N)-1;m[0]=this[O]>>N;for(var _=O+1;_<this.t;++_)m[_-O-1]|=(this[_]&k)<<X,m[_-O]=this[_]>>N;N>0&&(m[this.t-O-1]|=(this.s&k)<<X),m.t=this.t-O,m.clamp();}function et(i,m){for(var O=0,N=0,X=Math.min(i.t,this.t);O<X;)N+=this[O]-i[O],m[O++]=N&this.DM,N>>=this.DB;if(i.t<this.t){for(N-=i.s;O<this.t;)N+=this[O],m[O++]=N&this.DM,N>>=this.DB;N+=this.s;}else{for(N+=this.s;O<i.t;)N-=i[O],m[O++]=N&this.DM,N>>=this.DB;N-=i.s;}m.s=N<0?-1:0,N<-1?m[O++]=this.DV+N:N>0&&(m[O++]=N),m.t=O,m.clamp();}function it(i,m){var O=this.abs(),N=i.abs(),X=O.t;for(m.t=X+N.t;--X>=0;)m[X]=0;for(X=0;X<N.t;++X)m[X+O.t]=O.am(0,N[X],m,X,0,O.t);m.s=0,m.clamp(),this.s!=i.s&&o.ZERO.subTo(m,m);}function $(i){for(var m=this.abs(),O=i.t=2*m.t;--O>=0;)i[O]=0;for(O=0;O<m.t-1;++O){var N=m.am(O,m[O],i,2*O,0,1);(i[O+m.t]+=m.am(O+1,2*m[O],i,2*O+1,N,m.t-O-1))>=m.DV&&(i[O+m.t]-=m.DV,i[O+m.t+1]=1);}i.t>0&&(i[i.t-1]+=m.am(O,m[O],i,2*O,0,1)),i.s=0,i.clamp();}function K(i,m,O){var N=i.abs();if(!(N.t<=0)){var X=this.abs();if(X.t<N.t){m!=null&&m.fromInt(0),O!=null&&this.copyTo(O);return;}O==null&&(O=a());var k=a(),_=this.s,ft=i.s,ht=this.DB-W(N[N.t-1]);ht>0?(N.lShiftTo(ht,k),X.lShiftTo(ht,O)):(N.copyTo(k),X.copyTo(O));var Ct=k.t,wt=k[Ct-1];if(wt!=0){var Lt=wt*(1<<this.F1)+(Ct>1?k[Ct-2]>>this.F2:0),Bt=this.FV/Lt,Yt=(1<<this.F1)/Lt,Ht=1<<this.F2,Vt=O.t,ee=Vt-Ct,ve=m!==null&&m!==void 0?m:a();for(k.dlShiftTo(ee,ve),O.compareTo(ve)>=0&&(O[O.t++]=1,O.subTo(ve,O)),o.ONE.dlShiftTo(Ct,ve),ve.subTo(k,k);k.t<Ct;)k[k.t++]=0;for(;--ee>=0;){var Ie=O[--Vt]==wt?this.DM:Math.floor(O[Vt]*Bt+(O[Vt-1]+Ht)*Yt);if((O[Vt]+=k.am(0,Ie,O,ee,0,Ct))<Ie)for(k.dlShiftTo(ee,ve),O.subTo(ve,O);O[Vt]<--Ie;)O.subTo(ve,O);}m!=null&&(O.drShiftTo(Ct,m),_!=ft&&o.ZERO.subTo(m,m)),O.t=Ct,O.clamp(),ht>0&&O.rShiftTo(ht,O),_<0&&o.ZERO.subTo(O,O);}}}function rt(i){var m=a();return this.abs().divRemTo(i,null,m),this.s<0&&m.compareTo(o.ZERO)>0&&i.subTo(m,m),m;}function lt(i){this.m=i;}function ct(i){return i.s<0||i.compareTo(this.m)>=0?i.mod(this.m):i;}function gt(i){return i;}function st(i){i.divRemTo(this.m,null,i);}function Ot(i,m,O){i.multiplyTo(m,O),this.reduce(O);}function St(i,m){i.squareTo(m),this.reduce(m);}lt.prototype.convert=ct,lt.prototype.revert=gt,lt.prototype.reduce=st,lt.prototype.mulTo=Ot,lt.prototype.sqrTo=St;function F(){if(this.t<1)return 0;var i=this[0];if(!(i&1))return 0;var m=i&3;return m=m*(2-(i&15)*m)&15,m=m*(2-(i&255)*m)&255,m=m*(2-((i&65535)*m&65535))&65535,m=m*(2-i*m%this.DV)%this.DV,m>0?this.DV-m:-m;}function z(i){this.m=i,this.mp=i.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<i.DB-15)-1,this.mt2=2*i.t;}function Z(i){var m=a();return i.abs().dlShiftTo(this.m.t,m),m.divRemTo(this.m,null,m),i.s<0&&m.compareTo(o.ZERO)>0&&this.m.subTo(m,m),m;}function tt(i){var m=a();return i.copyTo(m),this.reduce(m),m;}function j(i){for(;i.t<=this.mt2;)i[i.t++]=0;for(var m=0;m<this.m.t;++m){var O=i[m]&32767,N=O*this.mpl+((O*this.mph+(i[m]>>15)*this.mpl&this.um)<<15)&i.DM;for(O=m+this.m.t,i[O]+=this.m.am(0,N,i,m,0,this.m.t);i[O]>=i.DV;)i[O]-=i.DV,i[++O]++;}i.clamp(),i.drShiftTo(this.m.t,i),i.compareTo(this.m)>=0&&i.subTo(this.m,i);}function H(i,m){i.squareTo(m),this.reduce(m);}function T(i,m,O){i.multiplyTo(m,O),this.reduce(O);}z.prototype.convert=Z,z.prototype.revert=tt,z.prototype.reduce=j,z.prototype.mulTo=T,z.prototype.sqrTo=H;function A(){return(this.t>0?this[0]&1:this.s)==0;}function U(i,m){if(i>4294967295||i<1)return o.ONE;var O=a(),N=a(),X=m.convert(this),k=W(i)-1;for(X.copyTo(O);--k>=0;)if(m.sqrTo(O,N),(i&1<<k)>0)m.mulTo(N,X,O);else{var _=O;O=N,N=_;}return m.revert(O);}function G(i,m){var O;return i<256||m.isEven()?O=new lt(m):O=new z(m),this.exp(i,O);}o.prototype.copyTo=p,o.prototype.fromInt=d,o.prototype.fromString=I,o.prototype.clamp=L,o.prototype.dlShiftTo=R,o.prototype.drShiftTo=Y,o.prototype.lShiftTo=V,o.prototype.rShiftTo=Q,o.prototype.subTo=et,o.prototype.multiplyTo=it,o.prototype.squareTo=$,o.prototype.divRemTo=K,o.prototype.invDigit=F,o.prototype.isEven=A,o.prototype.exp=U,o.prototype.toString=w,o.prototype.negate=B,o.prototype.abs=E,o.prototype.compareTo=b,o.prototype.bitLength=D,o.prototype.mod=rt,o.prototype.modPowInt=G,o.ZERO=v(0),o.ONE=v(1);function J(){var i=a();return this.copyTo(i),i;}function q(){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 nt(){return this.t==0?this.s:this[0]<<24>>24;}function ut(){return this.t==0?this.s:this[0]<<16>>16;}function pt(i){return Math.floor(Math.LN2*this.DB/Math.log(i));}function yt(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1;}function Tt(i){if(i==null&&(i=10),this.signum()==0||i<2||i>36)return"0";var m=this.chunkSize(i),O=Math.pow(i,m),N=v(O),X=a(),k=a(),_="";for(this.divRemTo(N,X,k);X.signum()>0;)_=(O+k.intValue()).toString(i).substr(1)+_,X.divRemTo(N,X,k);return k.intValue().toString(i)+_;}function vt(i,m){this.fromInt(0),m==null&&(m=10);for(var O=this.chunkSize(m),N=Math.pow(m,O),X=!1,k=0,_=0,ft=0;ft<i.length;++ft){var ht=h(i,ft);if(ht<0){i.charAt(ft)=="-"&&this.signum()==0&&(X=!0);continue;}_=m*_+ht,++k>=O&&(this.dMultiply(N),this.dAddOffset(_,0),k=0,_=0);}k>0&&(this.dMultiply(Math.pow(m,k)),this.dAddOffset(_,0)),X&&o.ZERO.subTo(this,this);}function mt(i,m,O){if(typeof m=="number"){if(i<2)this.fromInt(1);else for(this.fromNumber(i,O),this.testBit(i-1)||this.bitwiseTo(o.ONE.shiftLeft(i-1),Ut,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(m);)this.dAddOffset(2,0),this.bitLength()>i&&this.subTo(o.ONE.shiftLeft(i-1),this);}else{var N=new Array(),X=i&7;N.length=(i>>3)+1,m.nextBytes(N),X>0?N[0]&=(1<<X)-1:N[0]=0,this.fromString(N,256);}}function Pt(){var i=this.t,m=new Array();m[0]=this.s;var O=this.DB-i*this.DB%8,N,X=0;if(i-->0)for(O<this.DB&&(N=this[i]>>O)!=(this.s&this.DM)>>O&&(m[X++]=N|this.s<<this.DB-O);i>=0;)O<8?(N=(this[i]&(1<<O)-1)<<8-O,N|=this[--i]>>(O+=this.DB-8)):(N=this[i]>>(O-=8)&255,O<=0&&(O+=this.DB,--i)),N&128&&(N|=-256),X==0&&(this.s&128)!=(N&128)&&++X,(X>0||N!=this.s)&&(m[X++]=N);return m;}function Mt(i){return this.compareTo(i)==0;}function At(i){return this.compareTo(i)<0?this:i;}function It(i){return this.compareTo(i)>0?this:i;}function Nt(i,m,O){var N,X,k=Math.min(i.t,this.t);for(N=0;N<k;++N)O[N]=m(this[N],i[N]);if(i.t<this.t){for(X=i.s&this.DM,N=k;N<this.t;++N)O[N]=m(this[N],X);O.t=this.t;}else{for(X=this.s&this.DM,N=k;N<i.t;++N)O[N]=m(X,i[N]);O.t=i.t;}O.s=m(this.s,i.s),O.clamp();}function $t(i,m){return i&m;}function jt(i){var m=a();return this.bitwiseTo(i,$t,m),m;}function Ut(i,m){return i|m;}function zt(i){var m=a();return this.bitwiseTo(i,Ut,m),m;}function Xt(i,m){return i^m;}function ae(i){var m=a();return this.bitwiseTo(i,Xt,m),m;}function ie(i,m){return i&~m;}function se(i){var m=a();return this.bitwiseTo(i,ie,m),m;}function oe(){for(var i=a(),m=0;m<this.t;++m)i[m]=this.DM&~this[m];return i.t=this.t,i.s=~this.s,i;}function le(i){var m=a();return i<0?this.rShiftTo(-i,m):this.lShiftTo(i,m),m;}function ce(i){var m=a();return i<0?this.lShiftTo(-i,m):this.rShiftTo(i,m),m;}function fe(i){if(i==0)return-1;var m=0;return i&65535||(i>>=16,m+=16),i&255||(i>>=8,m+=8),i&15||(i>>=4,m+=4),i&3||(i>>=2,m+=2),i&1||++m,m;}function Zt(){for(var i=0;i<this.t;++i)if(this[i]!=0)return i*this.DB+fe(this[i]);return this.s<0?this.t*this.DB:-1;}function Pe(i){for(var m=0;i!=0;)i&=i-1,++m;return m;}function Be(){for(var i=0,m=this.s&this.DM,O=0;O<this.t;++O)i+=Pe(this[O]^m);return i;}function We(i){var m=Math.floor(i/this.DB);return m>=this.t?this.s!=0:(this[m]&1<<i%this.DB)!=0;}function dr(i,m){var O=o.ONE.shiftLeft(i);return this.bitwiseTo(O,m,O),O;}function pr(i){return this.changeBit(i,Ut);}function ps(i){return this.changeBit(i,ie);}function ms(i){return this.changeBit(i,Xt);}function vs(i,m){for(var O=0,N=0,X=Math.min(i.t,this.t);O<X;)N+=this[O]+i[O],m[O++]=N&this.DM,N>>=this.DB;if(i.t<this.t){for(N+=i.s;O<this.t;)N+=this[O],m[O++]=N&this.DM,N>>=this.DB;N+=this.s;}else{for(N+=this.s;O<i.t;)N+=i[O],m[O++]=N&this.DM,N>>=this.DB;N+=i.s;}m.s=N<0?-1:0,N>0?m[O++]=N:N<-1&&(m[O++]=this.DV+N),m.t=O,m.clamp();}function gs(i){var m=a();return this.addTo(i,m),m;}function ys(i){var m=a();return this.subTo(i,m),m;}function Ps(i){var m=a();return this.multiplyTo(i,m),m;}function xs(){var i=a();return this.squareTo(i),i;}function Ss(i){var m=a();return this.divRemTo(i,m,null),m;}function Ts(i){var m=a();return this.divRemTo(i,null,m),m;}function Cs(i){var m=a(),O=a();return this.divRemTo(i,m,O),new Array(m,O);}function Os(i){this[this.t]=this.am(0,i-1,this,0,0,this.t),++this.t,this.clamp();}function Is(i,m){if(i!=0){for(;this.t<=m;)this[this.t++]=0;for(this[m]+=i;this[m]>=this.DV;)this[m]-=this.DV,++m>=this.t&&(this[this.t++]=0),++this[m];}}function rr(){}function gn(i){return i;}function Ms(i,m,O){i.multiplyTo(m,O);}function Es(i,m){i.squareTo(m);}rr.prototype.convert=gn,rr.prototype.revert=gn,rr.prototype.mulTo=Ms,rr.prototype.sqrTo=Es;function As(i){return this.exp(i,new rr());}function Ls(i,m,O){var N=Math.min(this.t+i.t,m);for(O.s=0,O.t=N;N>0;)O[--N]=0;var X;for(X=O.t-this.t;N<X;++N)O[N+this.t]=this.am(0,i[N],O,N,0,this.t);for(X=Math.min(i.t,m);N<X;++N)this.am(0,i[N],O,N,0,m-N);O.clamp();}function ws(i,m,O){--m;var N=O.t=this.t+i.t-m;for(O.s=0;--N>=0;)O[N]=0;for(N=Math.max(m-this.t,0);N<i.t;++N)O[this.t+N-m]=this.am(m-N,i[N],O,0,0,this.t+N-m);O.clamp(),O.drShiftTo(1,O);}function je(i){this.r2=a(),this.q3=a(),o.ONE.dlShiftTo(2*i.t,this.r2),this.mu=this.r2.divide(i),this.m=i;}function Rs(i){if(i.s<0||i.t>2*this.m.t)return i.mod(this.m);if(i.compareTo(this.m)<0)return i;var m=a();return i.copyTo(m),this.reduce(m),m;}function Ds(i){return i;}function bs(i){for(i.drShiftTo(this.m.t-1,this.r2),i.t>this.m.t+1&&(i.t=this.m.t+1,i.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);i.compareTo(this.r2)<0;)i.dAddOffset(1,this.m.t+1);for(i.subTo(this.r2,i);i.compareTo(this.m)>=0;)i.subTo(this.m,i);}function Ns(i,m){i.squareTo(m),this.reduce(m);}function Bs(i,m,O){i.multiplyTo(m,O),this.reduce(O);}je.prototype.convert=Rs,je.prototype.revert=Ds,je.prototype.reduce=bs,je.prototype.mulTo=Bs,je.prototype.sqrTo=Ns;function Ws(i,m){var O=i.bitLength(),N,X=v(1),k;if(O<=0)return X;O<18?N=1:O<48?N=3:O<144?N=4:O<768?N=5:N=6,O<8?k=new lt(m):m.isEven()?k=new je(m):k=new z(m);var _=new Array(),ft=3,ht=N-1,Ct=(1<<N)-1;if(_[1]=k.convert(this),N>1){var wt=a();for(k.sqrTo(_[1],wt);ft<=Ct;)_[ft]=a(),k.mulTo(wt,_[ft-2],_[ft]),ft+=2;}var Lt=i.t-1,Bt,Yt=!0,Ht=a(),Vt;for(O=W(i[Lt])-1;Lt>=0;){for(O>=ht?Bt=i[Lt]>>O-ht&Ct:(Bt=(i[Lt]&(1<<O+1)-1)<<ht-O,Lt>0&&(Bt|=i[Lt-1]>>this.DB+O-ht)),ft=N;!(Bt&1);)Bt>>=1,--ft;if((O-=ft)<0&&(O+=this.DB,--Lt),Yt)_[Bt].copyTo(X),Yt=!1;else{for(;ft>1;)k.sqrTo(X,Ht),k.sqrTo(Ht,X),ft-=2;ft>0?k.sqrTo(X,Ht):(Vt=X,X=Ht,Ht=Vt),k.mulTo(Ht,_[Bt],X);}for(;Lt>=0&&!(i[Lt]&1<<O);)k.sqrTo(X,Ht),Vt=X,X=Ht,Ht=Vt,--O<0&&(O=this.DB-1,--Lt);}return k.revert(X);}function Fs(i){var m=this.s<0?this.negate():this.clone(),O=i.s<0?i.negate():i.clone();if(m.compareTo(O)<0){var N=m;m=O,O=N;}var X=m.getLowestSetBit(),k=O.getLowestSetBit();if(k<0)return m;for(X<k&&(k=X),k>0&&(m.rShiftTo(k,m),O.rShiftTo(k,O));m.signum()>0;)(X=m.getLowestSetBit())>0&&m.rShiftTo(X,m),(X=O.getLowestSetBit())>0&&O.rShiftTo(X,O),m.compareTo(O)>=0?(m.subTo(O,m),m.rShiftTo(1,m)):(O.subTo(m,O),O.rShiftTo(1,O));return k>0&&O.lShiftTo(k,O),O;}function Us(i){if(i<=0)return 0;var m=this.DV%i,O=this.s<0?i-1:0;if(this.t>0)if(m==0)O=this[0]%i;else for(var N=this.t-1;N>=0;--N)O=(m*O+this[N])%i;return O;}function js(i){var m=i.isEven();if(this.isEven()&&m||i.signum()==0)return o.ZERO;for(var O=i.clone(),N=this.clone(),X=v(1),k=v(0),_=v(0),ft=v(1);O.signum()!=0;){for(;O.isEven();)O.rShiftTo(1,O),m?((!X.isEven()||!k.isEven())&&(X.addTo(this,X),k.subTo(i,k)),X.rShiftTo(1,X)):k.isEven()||k.subTo(i,k),k.rShiftTo(1,k);for(;N.isEven();)N.rShiftTo(1,N),m?((!_.isEven()||!ft.isEven())&&(_.addTo(this,_),ft.subTo(i,ft)),_.rShiftTo(1,_)):ft.isEven()||ft.subTo(i,ft),ft.rShiftTo(1,ft);O.compareTo(N)>=0?(O.subTo(N,O),m&&X.subTo(_,X),k.subTo(ft,k)):(N.subTo(O,N),m&&_.subTo(X,_),ft.subTo(k,ft));}if(N.compareTo(o.ONE)!=0)return o.ZERO;if(ft.compareTo(i)>=0)return ft.subtract(i);if(ft.signum()<0)ft.addTo(i,ft);else return ft;return ft.signum()<0?ft.add(i):ft;}var de=[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],Ys=(1<<26)/de[de.length-1];function Xs(i){var m,O=this.abs();if(O.t==1&&O[0]<=de[de.length-1]){for(m=0;m<de.length;++m)if(O[0]==de[m])return!0;return!1;}if(O.isEven())return!1;for(m=1;m<de.length;){for(var N=de[m],X=m+1;X<de.length&&N<Ys;)N*=de[X++];for(N=O.modInt(N);m<X;)if(N%de[m++]==0)return!1;}return O.millerRabin(i);}function zs(i){var m=this.subtract(o.ONE),O=m.getLowestSetBit();if(O<=0)return!1;var N=m.shiftRight(O);i=i+1>>1,i>de.length&&(i=de.length);for(var X=a(),k=0;k<i;++k){X.fromInt(de[Math.floor(Math.random()*de.length)]);var _=X.modPow(N,this);if(_.compareTo(o.ONE)!=0&&_.compareTo(m)!=0){for(var ft=1;ft++<O&&_.compareTo(m)!=0;)if(_=_.modPowInt(2,this),_.compareTo(o.ONE)==0)return!1;if(_.compareTo(m)!=0)return!1;}}return!0;}o.prototype.chunkSize=pt,o.prototype.toRadix=Tt,o.prototype.fromRadix=vt,o.prototype.fromNumber=mt,o.prototype.bitwiseTo=Nt,o.prototype.changeBit=dr,o.prototype.addTo=vs,o.prototype.dMultiply=Os,o.prototype.dAddOffset=Is,o.prototype.multiplyLowerTo=Ls,o.prototype.multiplyUpperTo=ws,o.prototype.modInt=Us,o.prototype.millerRabin=zs,o.prototype.clone=J,o.prototype.intValue=q,o.prototype.byteValue=nt,o.prototype.shortValue=ut,o.prototype.signum=yt,o.prototype.toByteArray=Pt,o.prototype.equals=Mt,o.prototype.min=At,o.prototype.max=It,o.prototype.and=jt,o.prototype.or=zt,o.prototype.xor=ae,o.prototype.andNot=se,o.prototype.not=oe,o.prototype.shiftLeft=le,o.prototype.shiftRight=ce,o.prototype.getLowestSetBit=Zt,o.prototype.bitCount=Be,o.prototype.testBit=We,o.prototype.setBit=pr,o.prototype.clearBit=ps,o.prototype.flipBit=ms,o.prototype.add=gs,o.prototype.subtract=ys,o.prototype.multiply=Ps,o.prototype.divide=Ss,o.prototype.remainder=Ts,o.prototype.divideAndRemainder=Cs,o.prototype.modPow=Ws,o.prototype.modInverse=js,o.prototype.pow=As,o.prototype.gcd=Fs,o.prototype.isProbablePrime=Xs,o.prototype.square=xs;var Gt=o;Gt.prototype.IsNegative=function(){return this.compareTo(Gt.ZERO)==-1;},Gt.op_Equality=function(i,m){return i.compareTo(m)==0;},Gt.op_Inequality=function(i,m){return i.compareTo(m)!=0;},Gt.op_GreaterThan=function(i,m){return i.compareTo(m)>0;},Gt.op_LessThan=function(i,m){return i.compareTo(m)<0;},Gt.op_Addition=function(i,m){return new Gt(i,void 0,void 0).add(new Gt(m,void 0,void 0));},Gt.op_Subtraction=function(i,m){return new Gt(i,void 0,void 0).subtract(new Gt(m,void 0,void 0));},Gt.Int128Mul=function(i,m){return new Gt(i,void 0,void 0).multiply(new Gt(m,void 0,void 0));},Gt.op_Division=function(i,m){return i.divide(m);},Gt.prototype.ToDouble=function(){return parseFloat(this.toString());};var yn=function yn(i,m){var O;if(_typeof(Object.getOwnPropertyNames)>"u"){for(O in m.prototype)(_typeof(i.prototype[O])>"u"||i.prototype[O]===Object.prototype[O])&&(i.prototype[O]=m.prototype[O]);for(O in m)_typeof(i[O])>"u"&&(i[O]=m[O]);i.$baseCtor=m;}else{for(var N=Object.getOwnPropertyNames(m.prototype),X=0;X<N.length;X++)_typeof(Object.getOwnPropertyDescriptor(i.prototype,N[X]))>"u"&&Object.defineProperty(i.prototype,N[X],Object.getOwnPropertyDescriptor(m.prototype,N[X]));for(O in m)_typeof(i[O])>"u"&&(i[O]=m[O]);i.$baseCtor=m;}};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 i=arguments;this.X=0,this.Y=0,i.length===1?(this.X=i[0].X,this.Y=i[0].Y):i.length===2&&(this.X=i[0],this.Y=i[1]);},e.DoublePoint0=function(){this.X=0,this.Y=0;},e.DoublePoint0.prototype=e.DoublePoint.prototype,e.DoublePoint1=function(i){this.X=i.X,this.Y=i.Y;},e.DoublePoint1.prototype=e.DoublePoint.prototype,e.DoublePoint2=function(i,m){this.X=i,this.Y=m;},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 i=!0,m=this.m_Parent;m!==null;)i=!i,m=m.m_Parent;return i;},e.PolyNode.prototype.ChildCount=function(){return this.m_Childs.length;},e.PolyNode.prototype.Contour=function(){return this.m_polygon;},e.PolyNode.prototype.AddChild=function(i){var m=this.m_Childs.length;this.m_Childs.push(i),i.m_Parent=this,i.m_Index=m;},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 i=0,m=this.m_AllPolys.length;i<m;i++)this.m_AllPolys[i]=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 i=this.m_AllPolys.length;return i>0&&this.m_Childs[0]!==this.m_AllPolys[0]&&i--,i;},yn(e.PolyTree,e.PolyNode),e.Math_Abs_Int64=e.Math_Abs_Int32=e.Math_Abs_Double=function(i){return Math.abs(i);},e.Math_Max_Int32_Int32=function(i,m){return Math.max(i,m);},s.msie||s.opera||s.safari?e.Cast_Int32=function(i){return i|0;}:e.Cast_Int32=function(i){return~~i;},_typeof(Number.toInteger)>"u"&&(Number.toInteger=null),s.chrome?e.Cast_Int64=function(i){return i<-2147483648||i>2147483647?i<0?Math.ceil(i):Math.floor(i):~~i;}:s.firefox&&typeof Number.toInteger=="function"?e.Cast_Int64=function(i){return Number.toInteger(i);}:s.msie7||s.msie8?e.Cast_Int64=function(i){return parseInt(i,10);}:s.msie?e.Cast_Int64=function(i){return i<-2147483648||i>2147483647?i<0?Math.ceil(i):Math.floor(i):i|0;}:e.Cast_Int64=function(i){return i<0?Math.ceil(i):Math.floor(i);},e.Clear=function(i){i.length=0;},e.PI=3.141592653589793,e.PI2=2*3.141592653589793,e.IntPoint=function(){var i=arguments,m=i.length;if(this.X=0,this.Y=0,e.use_xyz){if(this.Z=0,m===3)this.X=i[0],this.Y=i[1],this.Z=i[2];else if(m===2)this.X=i[0],this.Y=i[1],this.Z=0;else if(m===1){if(i[0]instanceof e.DoublePoint){var O=i[0];this.X=e.Clipper.Round(O.X),this.Y=e.Clipper.Round(O.Y),this.Z=0;}else{var N=i[0];_typeof(N.Z)>"u"&&(N.Z=0),this.X=N.X,this.Y=N.Y,this.Z=N.Z;}}else this.X=0,this.Y=0,this.Z=0;}else if(m===2)this.X=i[0],this.Y=i[1];else if(m===1){if(i[0]instanceof e.DoublePoint){var O=i[0];this.X=e.Clipper.Round(O.X),this.Y=e.Clipper.Round(O.Y);}else{var N=i[0];this.X=N.X,this.Y=N.Y;}}else this.X=0,this.Y=0;},e.IntPoint.op_Equality=function(i,m){return i.X===m.X&&i.Y===m.Y;},e.IntPoint.op_Inequality=function(i,m){return i.X!==m.X||i.Y!==m.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(i){this.X=i.X,this.Y=i.Y,e.use_xyz&&(_typeof(i.Z)>"u"?this.Z=0:this.Z=i.Z);},e.IntPoint1.prototype=e.IntPoint.prototype,e.IntPoint1dp=function(i){this.X=e.Clipper.Round(i.X),this.Y=e.Clipper.Round(i.Y),e.use_xyz&&(this.Z=0);},e.IntPoint1dp.prototype=e.IntPoint.prototype,e.IntPoint2=function(i,m,O){this.X=i,this.Y=m,e.use_xyz&&(_typeof(O)>"u"?this.Z=0:this.Z=O);},e.IntPoint2.prototype=e.IntPoint.prototype,e.IntRect=function(){var i=arguments,m=i.length;if(m===4)this.left=i[0],this.top=i[1],this.right=i[2],this.bottom=i[3];else if(m===1){var O=i[0];this.left=O.left,this.top=O.top,this.right=O.right,this.bottom=O.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(i){this.left=i.left,this.top=i.top,this.right=i.right,this.bottom=i.bottom;},e.IntRect1.prototype=e.IntRect.prototype,e.IntRect4=function(i,m,O,N){this.left=i,this.top=m,this.right=O,this.bottom=N;},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(i,m){var O=m.Pt.Y-i.Pt.Y;return O>0?1:O<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(i){return i>-e.ClipperBase.tolerance&&i<e.ClipperBase.tolerance;},e.ClipperBase.IsHorizontal=function(i){return i.Delta.Y===0;},e.ClipperBase.prototype.PointIsVertex=function(i,m){var O=m;do{if(e.IntPoint.op_Equality(O.Pt,i))return!0;O=O.Next;}while(O!==m);return!1;},e.ClipperBase.prototype.PointOnLineSegment=function(i,m,O,N){return N?i.X===m.X&&i.Y===m.Y||i.X===O.X&&i.Y===O.Y||i.X>m.X==i.X<O.X&&i.Y>m.Y==i.Y<O.Y&&Gt.op_Equality(Gt.Int128Mul(i.X-m.X,O.Y-m.Y),Gt.Int128Mul(O.X-m.X,i.Y-m.Y)):i.X===m.X&&i.Y===m.Y||i.X===O.X&&i.Y===O.Y||i.X>m.X==i.X<O.X&&i.Y>m.Y==i.Y<O.Y&&(i.X-m.X)*(O.Y-m.Y)===(O.X-m.X)*(i.Y-m.Y);},e.ClipperBase.prototype.PointOnPolygon=function(i,m,O){for(var N=m;;){if(this.PointOnLineSegment(i,N.Pt,N.Next.Pt,O))return!0;if(N=N.Next,N===m)break;}return!1;},e.ClipperBase.prototype.SlopesEqual=e.ClipperBase.SlopesEqual=function(){var i=arguments,m=i.length,O,N,X,k,_,ft,ht;return m===3?(O=i[0],N=i[1],ht=i[2],ht?Gt.op_Equality(Gt.Int128Mul(O.Delta.Y,N.Delta.X),Gt.Int128Mul(O.Delta.X,N.Delta.Y)):e.Cast_Int64(O.Delta.Y*N.Delta.X)===e.Cast_Int64(O.Delta.X*N.Delta.Y)):m===4?(X=i[0],k=i[1],_=i[2],ht=i[3],ht?Gt.op_Equality(Gt.Int128Mul(X.Y-k.Y,k.X-_.X),Gt.Int128Mul(X.X-k.X,k.Y-_.Y)):e.Cast_Int64((X.Y-k.Y)*(k.X-_.X))-e.Cast_Int64((X.X-k.X)*(k.Y-_.Y))===0):(X=i[0],k=i[1],_=i[2],ft=i[3],ht=i[4],ht?Gt.op_Equality(Gt.Int128Mul(X.Y-k.Y,_.X-ft.X),Gt.Int128Mul(X.X-k.X,_.Y-ft.Y)):e.Cast_Int64((X.Y-k.Y)*(_.X-ft.X))-e.Cast_Int64((X.X-k.X)*(_.Y-ft.Y))===0);},e.ClipperBase.SlopesEqual3=function(i,m,O){return O?Gt.op_Equality(Gt.Int128Mul(i.Delta.Y,m.Delta.X),Gt.Int128Mul(i.Delta.X,m.Delta.Y)):e.Cast_Int64(i.Delta.Y*m.Delta.X)===e.Cast_Int64(i.Delta.X*m.Delta.Y);},e.ClipperBase.SlopesEqual4=function(i,m,O,N){return N?Gt.op_Equality(Gt.Int128Mul(i.Y-m.Y,m.X-O.X),Gt.Int128Mul(i.X-m.X,m.Y-O.Y)):e.Cast_Int64((i.Y-m.Y)*(m.X-O.X))-e.Cast_Int64((i.X-m.X)*(m.Y-O.Y))===0;},e.ClipperBase.SlopesEqual5=function(i,m,O,N,X){return X?Gt.op_Equality(Gt.Int128Mul(i.Y-m.Y,O.X-N.X),Gt.Int128Mul(i.X-m.X,O.Y-N.Y)):e.Cast_Int64((i.Y-m.Y)*(O.X-N.X))-e.Cast_Int64((i.X-m.X)*(O.Y-N.Y))===0;},e.ClipperBase.prototype.Clear=function(){this.DisposeLocalMinimaList();for(var i=0,m=this.m_edges.length;i<m;++i){for(var O=0,N=this.m_edges[i].length;O<N;++O)this.m_edges[i][O]=null;e.Clear(this.m_edges[i]);}e.Clear(this.m_edges),this.m_UseFullRange=!1,this.m_HasOpenPaths=!1;},e.ClipperBase.prototype.DisposeLocalMinimaList=function(){for(;this.m_MinimaList!==null;){var i=this.m_MinimaList.Next;this.m_MinimaList=null,this.m_MinimaList=i;}this.m_CurrentLM=null;},e.ClipperBase.prototype.RangeTest=function(i,m){m.Value?(i.X>e.ClipperBase.hiRange||i.Y>e.ClipperBase.hiRange||-i.X>e.ClipperBase.hiRange||-i.Y>e.ClipperBase.hiRange)&&e.Error("Coordinate outside allowed range in RangeTest()."):(i.X>e.ClipperBase.loRange||i.Y>e.ClipperBase.loRange||-i.X>e.ClipperBase.loRange||-i.Y>e.ClipperBase.loRange)&&(m.Value=!0,this.RangeTest(i,m));},e.ClipperBase.prototype.InitEdge=function(i,m,O,N){i.Next=m,i.Prev=O,i.Curr.X=N.X,i.Curr.Y=N.Y,e.use_xyz&&(i.Curr.Z=N.Z),i.OutIdx=-1;},e.ClipperBase.prototype.InitEdge2=function(i,m){i.Curr.Y>=i.Next.Curr.Y?(i.Bot.X=i.Curr.X,i.Bot.Y=i.Curr.Y,e.use_xyz&&(i.Bot.Z=i.Curr.Z),i.Top.X=i.Next.Curr.X,i.Top.Y=i.Next.Curr.Y,e.use_xyz&&(i.Top.Z=i.Next.Curr.Z)):(i.Top.X=i.Curr.X,i.Top.Y=i.Curr.Y,e.use_xyz&&(i.Top.Z=i.Curr.Z),i.Bot.X=i.Next.Curr.X,i.Bot.Y=i.Next.Curr.Y,e.use_xyz&&(i.Bot.Z=i.Next.Curr.Z)),this.SetDx(i),i.PolyTyp=m;},e.ClipperBase.prototype.FindNextLocMin=function(i){for(var m;;){for(;e.IntPoint.op_Inequality(i.Bot,i.Prev.Bot)||e.IntPoint.op_Equality(i.Curr,i.Top);)i=i.Next;if(i.Dx!==e.ClipperBase.horizontal&&i.Prev.Dx!==e.ClipperBase.horizontal)break;for(;i.Prev.Dx===e.ClipperBase.horizontal;)i=i.Prev;for(m=i;i.Dx===e.ClipperBase.horizontal;)i=i.Next;if(i.Top.Y!==i.Prev.Bot.Y){m.Prev.Bot.X<i.Bot.X&&(i=m);break;}}return i;},e.ClipperBase.prototype.ProcessBound=function(i,m){var O,N=i,X;if(N.OutIdx===e.ClipperBase.Skip){if(i=N,m){for(;i.Top.Y===i.Next.Bot.Y;)i=i.Next;for(;i!==N&&i.Dx===e.ClipperBase.horizontal;)i=i.Prev;}else{for(;i.Top.Y===i.Prev.Bot.Y;)i=i.Prev;for(;i!==N&&i.Dx===e.ClipperBase.horizontal;)i=i.Next;}if(i===N)m?N=i.Next:N=i.Prev;else{m?i=N.Next:i=N.Prev;var k=new e.LocalMinima();k.Next=null,k.Y=i.Bot.Y,k.LeftBound=null,k.RightBound=i,i.WindDelta=0,N=this.ProcessBound(i,m),this.InsertLocalMinima(k);}return N;}if(i.Dx===e.ClipperBase.horizontal&&(m?O=i.Prev:O=i.Next,O.Dx===e.ClipperBase.horizontal?O.Bot.X!==i.Bot.X&&O.Top.X!==i.Bot.X&&this.ReverseHorizontal(i):O.Bot.X!==i.Bot.X&&this.ReverseHorizontal(i)),O=i,m){for(;N.Top.Y===N.Next.Bot.Y&&N.Next.OutIdx!==e.ClipperBase.Skip;)N=N.Next;if(N.Dx===e.ClipperBase.horizontal&&N.Next.OutIdx!==e.ClipperBase.Skip){for(X=N;X.Prev.Dx===e.ClipperBase.horizontal;)X=X.Prev;X.Prev.Top.X>N.Next.Top.X&&(N=X.Prev);}for(;i!==N;)i.NextInLML=i.Next,i.Dx===e.ClipperBase.horizontal&&i!==O&&i.Bot.X!==i.Prev.Top.X&&this.ReverseHorizontal(i),i=i.Next;i.Dx===e.ClipperBase.horizontal&&i!==O&&i.Bot.X!==i.Prev.Top.X&&this.ReverseHorizontal(i),N=N.Next;}else{for(;N.Top.Y===N.Prev.Bot.Y&&N.Prev.OutIdx!==e.ClipperBase.Skip;)N=N.Prev;if(N.Dx===e.ClipperBase.horizontal&&N.Prev.OutIdx!==e.ClipperBase.Skip){for(X=N;X.Next.Dx===e.ClipperBase.horizontal;)X=X.Next;(X.Next.Top.X===N.Prev.Top.X||X.Next.Top.X>N.Prev.Top.X)&&(N=X.Next);}for(;i!==N;)i.NextInLML=i.Prev,i.Dx===e.ClipperBase.horizontal&&i!==O&&i.Bot.X!==i.Next.Top.X&&this.ReverseHorizontal(i),i=i.Prev;i.Dx===e.ClipperBase.horizontal&&i!==O&&i.Bot.X!==i.Next.Top.X&&this.ReverseHorizontal(i),N=N.Prev;}return N;},e.ClipperBase.prototype.AddPath=function(i,m,O){e.use_lines?!O&&m===e.PolyType.ptClip&&e.Error("AddPath: Open paths must be subject."):O||e.Error("AddPath: Open paths have been disabled.");var N=i.length-1;if(O)for(;N>0&&e.IntPoint.op_Equality(i[N],i[0]);)--N;for(;N>0&&e.IntPoint.op_Equality(i[N],i[N-1]);)--N;if(O&&N<2||!O&&N<1)return!1;for(var X=new Array(),k=0;k<=N;k++)X.push(new e.TEdge());var _=!0;X[1].Curr.X=i[1].X,X[1].Curr.Y=i[1].Y,e.use_xyz&&(X[1].Curr.Z=i[1].Z);var ft={Value:this.m_UseFullRange};this.RangeTest(i[0],ft),this.m_UseFullRange=ft.Value,ft.Value=this.m_UseFullRange,this.RangeTest(i[N],ft),this.m_UseFullRange=ft.Value,this.InitEdge(X[0],X[1],X[N],i[0]),this.InitEdge(X[N],X[0],X[N-1],i[N]);for(var k=N-1;k>=1;--k)ft.Value=this.m_UseFullRange,this.RangeTest(i[k],ft),this.m_UseFullRange=ft.Value,this.InitEdge(X[k],X[k+1],X[k-1],i[k]);for(var ht=X[0],Ct=ht,wt=ht;;){if(Ct.Curr===Ct.Next.Curr&&(O||Ct.Next!==ht)){if(Ct===Ct.Next)break;Ct===ht&&(ht=Ct.Next),Ct=this.RemoveEdge(Ct),wt=Ct;continue;}if(Ct.Prev===Ct.Next)break;if(O&&e.ClipperBase.SlopesEqual4(Ct.Prev.Curr,Ct.Curr,Ct.Next.Curr,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(Ct.Prev.Curr,Ct.Curr,Ct.Next.Curr))){Ct===ht&&(ht=Ct.Next),Ct=this.RemoveEdge(Ct),Ct=Ct.Prev,wt=Ct;continue;}if(Ct=Ct.Next,Ct===wt||!O&&Ct.Next===ht)break;}if(!O&&Ct===Ct.Next||O&&Ct.Prev===Ct.Next)return!1;O||(this.m_HasOpenPaths=!0,ht.Prev.OutIdx=e.ClipperBase.Skip),Ct=ht;do this.InitEdge2(Ct,m),Ct=Ct.Next,_&&Ct.Curr.Y!==ht.Curr.Y&&(_=!1);while(Ct!==ht);if(_){if(O)return!1;Ct.Prev.OutIdx=e.ClipperBase.Skip;var Lt=new e.LocalMinima();for(Lt.Next=null,Lt.Y=Ct.Bot.Y,Lt.LeftBound=null,Lt.RightBound=Ct,Lt.RightBound.Side=e.EdgeSide.esRight,Lt.RightBound.WindDelta=0;Ct.Bot.X!==Ct.Prev.Top.X&&this.ReverseHorizontal(Ct),Ct.Next.OutIdx!==e.ClipperBase.Skip;)Ct.NextInLML=Ct.Next,Ct=Ct.Next;return this.InsertLocalMinima(Lt),this.m_edges.push(X),!0;}this.m_edges.push(X);var Bt,Yt=null;for(e.IntPoint.op_Equality(Ct.Prev.Bot,Ct.Prev.Top)&&(Ct=Ct.Next);Ct=this.FindNextLocMin(Ct),Ct!==Yt;){Yt===null&&(Yt=Ct);var Lt=new e.LocalMinima();Lt.Next=null,Lt.Y=Ct.Bot.Y,Ct.Dx<Ct.Prev.Dx?(Lt.LeftBound=Ct.Prev,Lt.RightBound=Ct,Bt=!1):(Lt.LeftBound=Ct,Lt.RightBound=Ct.Prev,Bt=!0),Lt.LeftBound.Side=e.EdgeSide.esLeft,Lt.RightBound.Side=e.EdgeSide.esRight,O?Lt.LeftBound.Next===Lt.RightBound?Lt.LeftBound.WindDelta=-1:Lt.LeftBound.WindDelta=1:Lt.LeftBound.WindDelta=0,Lt.RightBound.WindDelta=-Lt.LeftBound.WindDelta,Ct=this.ProcessBound(Lt.LeftBound,Bt),Ct.OutIdx===e.ClipperBase.Skip&&(Ct=this.ProcessBound(Ct,Bt));var Ht=this.ProcessBound(Lt.RightBound,!Bt);Ht.OutIdx===e.ClipperBase.Skip&&(Ht=this.ProcessBound(Ht,!Bt)),Lt.LeftBound.OutIdx===e.ClipperBase.Skip?Lt.LeftBound=null:Lt.RightBound.OutIdx===e.ClipperBase.Skip&&(Lt.RightBound=null),this.InsertLocalMinima(Lt),Bt||(Ct=Ht);}return!0;},e.ClipperBase.prototype.AddPaths=function(i,m,O){for(var N=!1,X=0,k=i.length;X<k;++X)this.AddPath(i[X],m,O)&&(N=!0);return N;},e.ClipperBase.prototype.Pt2IsBetweenPt1AndPt3=function(i,m,O){return e.IntPoint.op_Equality(i,O)||e.IntPoint.op_Equality(i,m)||e.IntPoint.op_Equality(O,m)?!1:i.X!==O.X?m.X>i.X==m.X<O.X:m.Y>i.Y==m.Y<O.Y;},e.ClipperBase.prototype.RemoveEdge=function(i){i.Prev.Next=i.Next,i.Next.Prev=i.Prev;var m=i.Next;return i.Prev=null,m;},e.ClipperBase.prototype.SetDx=function(i){i.Delta.X=i.Top.X-i.Bot.X,i.Delta.Y=i.Top.Y-i.Bot.Y,i.Delta.Y===0?i.Dx=e.ClipperBase.horizontal:i.Dx=i.Delta.X/i.Delta.Y;},e.ClipperBase.prototype.InsertLocalMinima=function(i){if(this.m_MinimaList===null)this.m_MinimaList=i;else if(i.Y>=this.m_MinimaList.Y)i.Next=this.m_MinimaList,this.m_MinimaList=i;else{for(var m=this.m_MinimaList;m.Next!==null&&i.Y<m.Next.Y;)m=m.Next;i.Next=m.Next,m.Next=i;}},e.ClipperBase.prototype.PopLocalMinima=function(i,m){return m.v=this.m_CurrentLM,this.m_CurrentLM!==null&&this.m_CurrentLM.Y===i?(this.m_CurrentLM=this.m_CurrentLM.Next,!0):!1;},e.ClipperBase.prototype.ReverseHorizontal=function(i){var m=i.Top.X;i.Top.X=i.Bot.X,i.Bot.X=m,e.use_xyz&&(m=i.Top.Z,i.Top.Z=i.Bot.Z,i.Bot.Z=m);},e.ClipperBase.prototype.Reset=function(){if(this.m_CurrentLM=this.m_MinimaList,this.m_CurrentLM!==null){this.m_Scanbeam=null;for(var i=this.m_MinimaList;i!==null;){this.InsertScanbeam(i.Y);var m=i.LeftBound;m!==null&&(m.Curr.X=m.Bot.X,m.Curr.Y=m.Bot.Y,e.use_xyz&&(m.Curr.Z=m.Bot.Z),m.OutIdx=e.ClipperBase.Unassigned),m=i.RightBound,m!==null&&(m.Curr.X=m.Bot.X,m.Curr.Y=m.Bot.Y,e.use_xyz&&(m.Curr.Z=m.Bot.Z),m.OutIdx=e.ClipperBase.Unassigned),i=i.Next;}this.m_ActiveEdges=null;}},e.ClipperBase.prototype.InsertScanbeam=function(i){if(this.m_Scanbeam===null)this.m_Scanbeam=new e.Scanbeam(),this.m_Scanbeam.Next=null,this.m_Scanbeam.Y=i;else if(i>this.m_Scanbeam.Y){var m=new e.Scanbeam();m.Y=i,m.Next=this.m_Scanbeam,this.m_Scanbeam=m;}else{for(var O=this.m_Scanbeam;O.Next!==null&&i<=O.Next.Y;)O=O.Next;if(i===O.Y)return;var N=new e.Scanbeam();N.Y=i,N.Next=O.Next,O.Next=N;}},e.ClipperBase.prototype.PopScanbeam=function(i){return this.m_Scanbeam===null?(i.v=0,!1):(i.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 i=new e.OutRec();return i.Idx=e.ClipperBase.Unassigned,i.IsHole=!1,i.IsOpen=!1,i.FirstLeft=null,i.Pts=null,i.BottomPt=null,i.PolyNode=null,this.m_PolyOuts.push(i),i.Idx=this.m_PolyOuts.length-1,i;},e.ClipperBase.prototype.DisposeOutRec=function(i){var m=this.m_PolyOuts[i];m.Pts=null,m=null,this.m_PolyOuts[i]=null;},e.ClipperBase.prototype.UpdateEdgeIntoAEL=function(i){i.NextInLML===null&&e.Error("UpdateEdgeIntoAEL: invalid call");var m=i.PrevInAEL,O=i.NextInAEL;return i.NextInLML.OutIdx=i.OutIdx,m!==null?m.NextInAEL=i.NextInLML:this.m_ActiveEdges=i.NextInLML,O!==null&&(O.PrevInAEL=i.NextInLML),i.NextInLML.Side=i.Side,i.NextInLML.WindDelta=i.WindDelta,i.NextInLML.WindCnt=i.WindCnt,i.NextInLML.WindCnt2=i.WindCnt2,i=i.NextInLML,i.Curr.X=i.Bot.X,i.Curr.Y=i.Bot.Y,i.PrevInAEL=m,i.NextInAEL=O,e.ClipperBase.IsHorizontal(i)||this.InsertScanbeam(i.Top.Y),i;},e.ClipperBase.prototype.SwapPositionsInAEL=function(i,m){if(!(i.NextInAEL===i.PrevInAEL||m.NextInAEL===m.PrevInAEL)){if(i.NextInAEL===m){var O=m.NextInAEL;O!==null&&(O.PrevInAEL=i);var N=i.PrevInAEL;N!==null&&(N.NextInAEL=m),m.PrevInAEL=N,m.NextInAEL=i,i.PrevInAEL=m,i.NextInAEL=O;}else if(m.NextInAEL===i){var X=i.NextInAEL;X!==null&&(X.PrevInAEL=m);var k=m.PrevInAEL;k!==null&&(k.NextInAEL=i),i.PrevInAEL=k,i.NextInAEL=m,m.PrevInAEL=i,m.NextInAEL=X;}else{var _=i.NextInAEL,ft=i.PrevInAEL;i.NextInAEL=m.NextInAEL,i.NextInAEL!==null&&(i.NextInAEL.PrevInAEL=i),i.PrevInAEL=m.PrevInAEL,i.PrevInAEL!==null&&(i.PrevInAEL.NextInAEL=i),m.NextInAEL=_,m.NextInAEL!==null&&(m.NextInAEL.PrevInAEL=m),m.PrevInAEL=ft,m.PrevInAEL!==null&&(m.PrevInAEL.NextInAEL=m);}i.PrevInAEL===null?this.m_ActiveEdges=i:m.PrevInAEL===null&&(this.m_ActiveEdges=m);}},e.ClipperBase.prototype.DeleteFromAEL=function(i){var m=i.PrevInAEL,O=i.NextInAEL;m===null&&O===null&&i!==this.m_ActiveEdges||(m!==null?m.NextInAEL=O:this.m_ActiveEdges=O,O!==null&&(O.PrevInAEL=m),i.NextInAEL=null,i.PrevInAEL=null);},e.Clipper=function(i){_typeof(i)>"u"&&(i=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&i)!==0,this.StrictlySimple=(2&i)!==0,this.PreserveCollinear=(4&i)!==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(i){var m=new e.Maxima();if(m.X=i,this.m_Maxima===null)this.m_Maxima=m,this.m_Maxima.Next=null,this.m_Maxima.Prev=null;else if(i<this.m_Maxima.X)m.Next=this.m_Maxima,m.Prev=null,this.m_Maxima=m;else{for(var O=this.m_Maxima;O.Next!==null&&i>=O.Next.X;)O=O.Next;if(i===O.X)return;m.Next=O.Next,m.Prev=O,O.Next!==null&&(O.Next.Prev=m),O.Next=m;}},e.Clipper.prototype.Execute=function(){var i=arguments,m=i.length,O=i[1]instanceof e.PolyTree;if(m===4&&!O){var N=i[0],X=i[1],k=i[2],_=i[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(X),this.m_SubjFillType=k,this.m_ClipFillType=_,this.m_ClipType=N,this.m_UsingPolyTree=!1;try{var ft=this.ExecuteInternal();ft&&this.BuildResult(X);}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1;}return ft;}else if(m===4&&O){var N=i[0],ht=i[1],k=i[2],_=i[3];if(this.m_ExecuteLocked)return!1;this.m_ExecuteLocked=!0,this.m_SubjFillType=k,this.m_ClipFillType=_,this.m_ClipType=N,this.m_UsingPolyTree=!0;try{var ft=this.ExecuteInternal();ft&&this.BuildResult2(ht);}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1;}return ft;}else if(m===2&&!O){var N=i[0],X=i[1];return this.Execute(N,X,e.PolyFillType.pftEvenOdd,e.PolyFillType.pftEvenOdd);}else if(m===2&&O){var N=i[0],ht=i[1];return this.Execute(N,ht,e.PolyFillType.pftEvenOdd,e.PolyFillType.pftEvenOdd);}},e.Clipper.prototype.FixHoleLinkage=function(i){if(!(i.FirstLeft===null||i.IsHole!==i.FirstLeft.IsHole&&i.FirstLeft.Pts!==null)){for(var m=i.FirstLeft;m!==null&&(m.IsHole===i.IsHole||m.Pts===null);)m=m.FirstLeft;i.FirstLeft=m;}},e.Clipper.prototype.ExecuteInternal=function(){try{this.Reset(),this.m_SortedEdges=null,this.m_Maxima=null;var i={},m={};if(!this.PopScanbeam(i))return!1;for(this.InsertLocalMinimaIntoAEL(i.v);this.PopScanbeam(m)||this.LocalMinimaPending();){if(this.ProcessHorizontals(),this.m_GhostJoins.length=0,!this.ProcessIntersections(m.v))return!1;this.ProcessEdgesAtTopOfScanbeam(m.v),i.v=m.v,this.InsertLocalMinimaIntoAEL(i.v);}var O,N,X;for(N=0,X=this.m_PolyOuts.length;N<X;N++)O=this.m_PolyOuts[N],!(O.Pts===null||O.IsOpen)&&(O.IsHole^this.ReverseSolution)==this.Area$1(O)>0&&this.ReversePolyPtLinks(O.Pts);for(this.JoinCommonEdges(),N=0,X=this.m_PolyOuts.length;N<X;N++)O=this.m_PolyOuts[N],O.Pts!==null&&(O.IsOpen?this.FixupOutPolyline(O):this.FixupOutPolygon(O));return this.StrictlySimple&&this.DoSimplePolygons(),!0;}finally{this.m_Joins.length=0,this.m_GhostJoins.length=0;}},e.Clipper.prototype.DisposeAllPolyPts=function(){for(var i=0,m=this.m_PolyOuts.length;i<m;++i)this.DisposeOutRec(i);e.Clear(this.m_PolyOuts);},e.Clipper.prototype.AddJoin=function(i,m,O){var N=new e.Join();N.OutPt1=i,N.OutPt2=m,N.OffPt.X=O.X,N.OffPt.Y=O.Y,e.use_xyz&&(N.OffPt.Z=O.Z),this.m_Joins.push(N);},e.Clipper.prototype.AddGhostJoin=function(i,m){var O=new e.Join();O.OutPt1=i,O.OffPt.X=m.X,O.OffPt.Y=m.Y,e.use_xyz&&(O.OffPt.Z=m.Z),this.m_GhostJoins.push(O);},e.Clipper.prototype.SetZ=function(i,m,O){if(this.ZFillFunction!==null){if(i.Z!==0||this.ZFillFunction===null)return;e.IntPoint.op_Equality(i,m.Bot)?i.Z=m.Bot.Z:e.IntPoint.op_Equality(i,m.Top)?i.Z=m.Top.Z:e.IntPoint.op_Equality(i,O.Bot)?i.Z=O.Bot.Z:e.IntPoint.op_Equality(i,O.Top)?i.Z=O.Top.Z:this.ZFillFunction(m.Bot,m.Top,O.Bot,O.Top,i);}},e.Clipper.prototype.InsertLocalMinimaIntoAEL=function(i){for(var m={},O,N;this.PopLocalMinima(i,m);){O=m.v.LeftBound,N=m.v.RightBound;var X=null;if(O===null?(this.InsertEdgeIntoAEL(N,null),this.SetWindingCount(N),this.IsContributing(N)&&(X=this.AddOutPt(N,N.Bot))):N===null?(this.InsertEdgeIntoAEL(O,null),this.SetWindingCount(O),this.IsContributing(O)&&(X=this.AddOutPt(O,O.Bot)),this.InsertScanbeam(O.Top.Y)):(this.InsertEdgeIntoAEL(O,null),this.InsertEdgeIntoAEL(N,O),this.SetWindingCount(O),N.WindCnt=O.WindCnt,N.WindCnt2=O.WindCnt2,this.IsContributing(O)&&(X=this.AddLocalMinPoly(O,N,O.Bot)),this.InsertScanbeam(O.Top.Y)),N!==null&&(e.ClipperBase.IsHorizontal(N)?(N.NextInLML!==null&&this.InsertScanbeam(N.NextInLML.Top.Y),this.AddEdgeToSEL(N)):this.InsertScanbeam(N.Top.Y)),!(O===null||N===null)){if(X!==null&&e.ClipperBase.IsHorizontal(N)&&this.m_GhostJoins.length>0&&N.WindDelta!==0)for(var k=0,_=this.m_GhostJoins.length;k<_;k++){var ft=this.m_GhostJoins[k];this.HorzSegmentsOverlap(ft.OutPt1.Pt.X,ft.OffPt.X,N.Bot.X,N.Top.X)&&this.AddJoin(ft.OutPt1,X,ft.OffPt);}if(O.OutIdx>=0&&O.PrevInAEL!==null&&O.PrevInAEL.Curr.X===O.Bot.X&&O.PrevInAEL.OutIdx>=0&&e.ClipperBase.SlopesEqual5(O.PrevInAEL.Curr,O.PrevInAEL.Top,O.Curr,O.Top,this.m_UseFullRange)&&O.WindDelta!==0&&O.PrevInAEL.WindDelta!==0){var ht=this.AddOutPt(O.PrevInAEL,O.Bot);this.AddJoin(X,ht,O.Top);}if(O.NextInAEL!==N){if(N.OutIdx>=0&&N.PrevInAEL.OutIdx>=0&&e.ClipperBase.SlopesEqual5(N.PrevInAEL.Curr,N.PrevInAEL.Top,N.Curr,N.Top,this.m_UseFullRange)&&N.WindDelta!==0&&N.PrevInAEL.WindDelta!==0){var ht=this.AddOutPt(N.PrevInAEL,N.Bot);this.AddJoin(X,ht,N.Top);}var Ct=O.NextInAEL;if(Ct!==null)for(;Ct!==N;)this.IntersectEdges(N,Ct,O.Curr),Ct=Ct.NextInAEL;}}}},e.Clipper.prototype.InsertEdgeIntoAEL=function(i,m){if(this.m_ActiveEdges===null)i.PrevInAEL=null,i.NextInAEL=null,this.m_ActiveEdges=i;else if(m===null&&this.E2InsertsBeforeE1(this.m_ActiveEdges,i))i.PrevInAEL=null,i.NextInAEL=this.m_ActiveEdges,this.m_ActiveEdges.PrevInAEL=i,this.m_ActiveEdges=i;else{for(m===null&&(m=this.m_ActiveEdges);m.NextInAEL!==null&&!this.E2InsertsBeforeE1(m.NextInAEL,i);)m=m.NextInAEL;i.NextInAEL=m.NextInAEL,m.NextInAEL!==null&&(m.NextInAEL.PrevInAEL=i),i.PrevInAEL=m,m.NextInAEL=i;}},e.Clipper.prototype.E2InsertsBeforeE1=function(i,m){return m.Curr.X===i.Curr.X?m.Top.Y>i.Top.Y?m.Top.X<e.Clipper.TopX(i,m.Top.Y):i.Top.X>e.Clipper.TopX(m,i.Top.Y):m.Curr.X<i.Curr.X;},e.Clipper.prototype.IsEvenOddFillType=function(i){return i.PolyTyp===e.PolyType.ptSubject?this.m_SubjFillType===e.PolyFillType.pftEvenOdd:this.m_ClipFillType===e.PolyFillType.pftEvenOdd;},e.Clipper.prototype.IsEvenOddAltFillType=function(i){return i.PolyTyp===e.PolyType.ptSubject?this.m_ClipFillType===e.PolyFillType.pftEvenOdd:this.m_SubjFillType===e.PolyFillType.pftEvenOdd;},e.Clipper.prototype.IsContributing=function(i){var m,O;switch(i.PolyTyp===e.PolyType.ptSubject?(m=this.m_SubjFillType,O=this.m_ClipFillType):(m=this.m_ClipFillType,O=this.m_SubjFillType),m){case e.PolyFillType.pftEvenOdd:if(i.WindDelta===0&&i.WindCnt!==1)return!1;break;case e.PolyFillType.pftNonZero:if(Math.abs(i.WindCnt)!==1)return!1;break;case e.PolyFillType.pftPositive:if(i.WindCnt!==1)return!1;break;default:if(i.WindCnt!==-1)return!1;break;}switch(this.m_ClipType){case e.ClipType.ctIntersection:switch(O){case e.PolyFillType.pftEvenOdd:case e.PolyFillType.pftNonZero:return i.WindCnt2!==0;case e.PolyFillType.pftPositive:return i.WindCnt2>0;default:return i.WindCnt2<0;}case e.ClipType.ctUnion:switch(O){case e.PolyFillType.pftEvenOdd:case e.PolyFillType.pftNonZero:return i.WindCnt2===0;case e.PolyFillType.pftPositive:return i.WindCnt2<=0;default:return i.WindCnt2>=0;}case e.ClipType.ctDifference:if(i.PolyTyp===e.PolyType.ptSubject)switch(O){case e.PolyFillType.pftEvenOdd:case e.PolyFillType.pftNonZero:return i.WindCnt2===0;case e.PolyFillType.pftPositive:return i.WindCnt2<=0;default:return i.WindCnt2>=0;}else switch(O){case e.PolyFillType.pftEvenOdd:case e.PolyFillType.pftNonZero:return i.WindCnt2!==0;case e.PolyFillType.pftPositive:return i.WindCnt2>0;default:return i.WindCnt2<0;}case e.ClipType.ctXor:if(i.WindDelta===0)switch(O){case e.PolyFillType.pftEvenOdd:case e.PolyFillType.pftNonZero:return i.WindCnt2===0;case e.PolyFillType.pftPositive:return i.WindCnt2<=0;default:return i.WindCnt2>=0;}else return!0;}return!0;},e.Clipper.prototype.SetWindingCount=function(i){for(var m=i.PrevInAEL;m!==null&&(m.PolyTyp!==i.PolyTyp||m.WindDelta===0);)m=m.PrevInAEL;if(m===null){var O=i.PolyTyp===e.PolyType.ptSubject?this.m_SubjFillType:this.m_ClipFillType;i.WindDelta===0?i.WindCnt=O===e.PolyFillType.pftNegative?-1:1:i.WindCnt=i.WindDelta,i.WindCnt2=0,m=this.m_ActiveEdges;}else if(i.WindDelta===0&&this.m_ClipType!==e.ClipType.ctUnion)i.WindCnt=1,i.WindCnt2=m.WindCnt2,m=m.NextInAEL;else if(this.IsEvenOddFillType(i)){if(i.WindDelta===0){for(var N=!0,X=m.PrevInAEL;X!==null;)X.PolyTyp===m.PolyTyp&&X.WindDelta!==0&&(N=!N),X=X.PrevInAEL;i.WindCnt=N?0:1;}else i.WindCnt=i.WindDelta;i.WindCnt2=m.WindCnt2,m=m.NextInAEL;}else m.WindCnt*m.WindDelta<0?Math.abs(m.WindCnt)>1?m.WindDelta*i.WindDelta<0?i.WindCnt=m.WindCnt:i.WindCnt=m.WindCnt+i.WindDelta:i.WindCnt=i.WindDelta===0?1:i.WindDelta:i.WindDelta===0?i.WindCnt=m.WindCnt<0?m.WindCnt-1:m.WindCnt+1:m.WindDelta*i.WindDelta<0?i.WindCnt=m.WindCnt:i.WindCnt=m.WindCnt+i.WindDelta,i.WindCnt2=m.WindCnt2,m=m.NextInAEL;if(this.IsEvenOddAltFillType(i))for(;m!==i;)m.WindDelta!==0&&(i.WindCnt2=i.WindCnt2===0?1:0),m=m.NextInAEL;else for(;m!==i;)i.WindCnt2+=m.WindDelta,m=m.NextInAEL;},e.Clipper.prototype.AddEdgeToSEL=function(i){this.m_SortedEdges===null?(this.m_SortedEdges=i,i.PrevInSEL=null,i.NextInSEL=null):(i.NextInSEL=this.m_SortedEdges,i.PrevInSEL=null,this.m_SortedEdges.PrevInSEL=i,this.m_SortedEdges=i);},e.Clipper.prototype.PopEdgeFromSEL=function(i){if(i.v=this.m_SortedEdges,i.v===null)return!1;var m=i.v;return this.m_SortedEdges=i.v.NextInSEL,this.m_SortedEdges!==null&&(this.m_SortedEdges.PrevInSEL=null),m.NextInSEL=null,m.PrevInSEL=null,!0;},e.Clipper.prototype.CopyAELToSEL=function(){var i=this.m_ActiveEdges;for(this.m_SortedEdges=i;i!==null;)i.PrevInSEL=i.PrevInAEL,i.NextInSEL=i.NextInAEL,i=i.NextInAEL;},e.Clipper.prototype.SwapPositionsInSEL=function(i,m){if(!(i.NextInSEL===null&&i.PrevInSEL===null)&&!(m.NextInSEL===null&&m.PrevInSEL===null)){if(i.NextInSEL===m){var O=m.NextInSEL;O!==null&&(O.PrevInSEL=i);var N=i.PrevInSEL;N!==null&&(N.NextInSEL=m),m.PrevInSEL=N,m.NextInSEL=i,i.PrevInSEL=m,i.NextInSEL=O;}else if(m.NextInSEL===i){var O=i.NextInSEL;O!==null&&(O.PrevInSEL=m);var N=m.PrevInSEL;N!==null&&(N.NextInSEL=i),i.PrevInSEL=N,i.NextInSEL=m,m.PrevInSEL=i,m.NextInSEL=O;}else{var O=i.NextInSEL,N=i.PrevInSEL;i.NextInSEL=m.NextInSEL,i.NextInSEL!==null&&(i.NextInSEL.PrevInSEL=i),i.PrevInSEL=m.PrevInSEL,i.PrevInSEL!==null&&(i.PrevInSEL.NextInSEL=i),m.NextInSEL=O,m.NextInSEL!==null&&(m.NextInSEL.PrevInSEL=m),m.PrevInSEL=N,m.PrevInSEL!==null&&(m.PrevInSEL.NextInSEL=m);}i.PrevInSEL===null?this.m_SortedEdges=i:m.PrevInSEL===null&&(this.m_SortedEdges=m);}},e.Clipper.prototype.AddLocalMaxPoly=function(i,m,O){this.AddOutPt(i,O),m.WindDelta===0&&this.AddOutPt(m,O),i.OutIdx===m.OutIdx?(i.OutIdx=-1,m.OutIdx=-1):i.OutIdx<m.OutIdx?this.AppendPolygon(i,m):this.AppendPolygon(m,i);},e.Clipper.prototype.AddLocalMinPoly=function(i,m,O){var N,X,k;if(e.ClipperBase.IsHorizontal(m)||i.Dx>m.Dx?(N=this.AddOutPt(i,O),m.OutIdx=i.OutIdx,i.Side=e.EdgeSide.esLeft,m.Side=e.EdgeSide.esRight,X=i,X.PrevInAEL===m?k=m.PrevInAEL:k=X.PrevInAEL):(N=this.AddOutPt(m,O),i.OutIdx=m.OutIdx,i.Side=e.EdgeSide.esRight,m.Side=e.EdgeSide.esLeft,X=m,X.PrevInAEL===i?k=i.PrevInAEL:k=X.PrevInAEL),k!==null&&k.OutIdx>=0&&k.Top.Y<O.Y&&X.Top.Y<O.Y){var _=e.Clipper.TopX(k,O.Y),ft=e.Clipper.TopX(X,O.Y);if(_===ft&&X.WindDelta!==0&&k.WindDelta!==0&&e.ClipperBase.SlopesEqual5(new e.IntPoint2(_,O.Y),k.Top,new e.IntPoint2(ft,O.Y),X.Top,this.m_UseFullRange)){var ht=this.AddOutPt(k,O);this.AddJoin(N,ht,X.Top);}}return N;},e.Clipper.prototype.AddOutPt=function(i,m){if(i.OutIdx<0){var O=this.CreateOutRec();O.IsOpen=i.WindDelta===0;var N=new e.OutPt();return O.Pts=N,N.Idx=O.Idx,N.Pt.X=m.X,N.Pt.Y=m.Y,e.use_xyz&&(N.Pt.Z=m.Z),N.Next=N,N.Prev=N,O.IsOpen||this.SetHoleState(i,O),i.OutIdx=O.Idx,N;}else{var O=this.m_PolyOuts[i.OutIdx],X=O.Pts,k=i.Side===e.EdgeSide.esLeft;if(k&&e.IntPoint.op_Equality(m,X.Pt))return X;if(!k&&e.IntPoint.op_Equality(m,X.Prev.Pt))return X.Prev;var N=new e.OutPt();return N.Idx=O.Idx,N.Pt.X=m.X,N.Pt.Y=m.Y,e.use_xyz&&(N.Pt.Z=m.Z),N.Next=X,N.Prev=X.Prev,N.Prev.Next=N,X.Prev=N,k&&(O.Pts=N),N;}},e.Clipper.prototype.GetLastOutPt=function(i){var m=this.m_PolyOuts[i.OutIdx];return i.Side===e.EdgeSide.esLeft?m.Pts:m.Pts.Prev;},e.Clipper.prototype.SwapPoints=function(i,m){var O=new e.IntPoint1(i.Value);i.Value.X=m.Value.X,i.Value.Y=m.Value.Y,e.use_xyz&&(i.Value.Z=m.Value.Z),m.Value.X=O.X,m.Value.Y=O.Y,e.use_xyz&&(m.Value.Z=O.Z);},e.Clipper.prototype.HorzSegmentsOverlap=function(i,m,O,N){var X;return i>m&&(X=i,i=m,m=X),O>N&&(X=O,O=N,N=X),i<N&&O<m;},e.Clipper.prototype.SetHoleState=function(i,m){for(var O=i.PrevInAEL,N=null;O!==null;)O.OutIdx>=0&&O.WindDelta!==0&&(N===null?N=O:N.OutIdx===O.OutIdx&&(N=null)),O=O.PrevInAEL;N===null?(m.FirstLeft=null,m.IsHole=!1):(m.FirstLeft=this.m_PolyOuts[N.OutIdx],m.IsHole=!m.FirstLeft.IsHole);},e.Clipper.prototype.GetDx=function(i,m){return i.Y===m.Y?e.ClipperBase.horizontal:(m.X-i.X)/(m.Y-i.Y);},e.Clipper.prototype.FirstIsBottomPt=function(i,m){for(var O=i.Prev;e.IntPoint.op_Equality(O.Pt,i.Pt)&&O!==i;)O=O.Prev;var N=Math.abs(this.GetDx(i.Pt,O.Pt));for(O=i.Next;e.IntPoint.op_Equality(O.Pt,i.Pt)&&O!==i;)O=O.Next;var X=Math.abs(this.GetDx(i.Pt,O.Pt));for(O=m.Prev;e.IntPoint.op_Equality(O.Pt,m.Pt)&&O!==m;)O=O.Prev;var k=Math.abs(this.GetDx(m.Pt,O.Pt));for(O=m.Next;e.IntPoint.op_Equality(O.Pt,m.Pt)&&O!==m;)O=O.Next;var _=Math.abs(this.GetDx(m.Pt,O.Pt));return Math.max(N,X)===Math.max(k,_)&&Math.min(N,X)===Math.min(k,_)?this.Area(i)>0:N>=k&&N>=_||X>=k&&X>=_;},e.Clipper.prototype.GetBottomPt=function(i){for(var m=null,O=i.Next;O!==i;)O.Pt.Y>i.Pt.Y?(i=O,m=null):O.Pt.Y===i.Pt.Y&&O.Pt.X<=i.Pt.X&&(O.Pt.X<i.Pt.X?(m=null,i=O):O.Next!==i&&O.Prev!==i&&(m=O)),O=O.Next;if(m!==null)for(;m!==O;)for(this.FirstIsBottomPt(O,m)||(i=m),m=m.Next;e.IntPoint.op_Inequality(m.Pt,i.Pt);)m=m.Next;return i;},e.Clipper.prototype.GetLowermostRec=function(i,m){i.BottomPt===null&&(i.BottomPt=this.GetBottomPt(i.Pts)),m.BottomPt===null&&(m.BottomPt=this.GetBottomPt(m.Pts));var O=i.BottomPt,N=m.BottomPt;return O.Pt.Y>N.Pt.Y?i:O.Pt.Y<N.Pt.Y?m:O.Pt.X<N.Pt.X?i:O.Pt.X>N.Pt.X||O.Next===O?m:N.Next===N||this.FirstIsBottomPt(O,N)?i:m;},e.Clipper.prototype.OutRec1RightOfOutRec2=function(i,m){do if(i=i.FirstLeft,i===m)return!0;while(i!==null);return!1;},e.Clipper.prototype.GetOutRec=function(i){for(var m=this.m_PolyOuts[i];m!==this.m_PolyOuts[m.Idx];)m=this.m_PolyOuts[m.Idx];return m;},e.Clipper.prototype.AppendPolygon=function(i,m){var O=this.m_PolyOuts[i.OutIdx],N=this.m_PolyOuts[m.OutIdx],X;this.OutRec1RightOfOutRec2(O,N)?X=N:this.OutRec1RightOfOutRec2(N,O)?X=O:X=this.GetLowermostRec(O,N);var k=O.Pts,_=k.Prev,ft=N.Pts,ht=ft.Prev;i.Side===e.EdgeSide.esLeft?m.Side===e.EdgeSide.esLeft?(this.ReversePolyPtLinks(ft),ft.Next=k,k.Prev=ft,_.Next=ht,ht.Prev=_,O.Pts=ht):(ht.Next=k,k.Prev=ht,ft.Prev=_,_.Next=ft,O.Pts=ft):m.Side===e.EdgeSide.esRight?(this.ReversePolyPtLinks(ft),_.Next=ht,ht.Prev=_,ft.Next=k,k.Prev=ft):(_.Next=ft,ft.Prev=_,k.Prev=ht,ht.Next=k),O.BottomPt=null,X===N&&(N.FirstLeft!==O&&(O.FirstLeft=N.FirstLeft),O.IsHole=N.IsHole),N.Pts=null,N.BottomPt=null,N.FirstLeft=O;var Ct=i.OutIdx,wt=m.OutIdx;i.OutIdx=-1,m.OutIdx=-1;for(var Lt=this.m_ActiveEdges;Lt!==null;){if(Lt.OutIdx===wt){Lt.OutIdx=Ct,Lt.Side=i.Side;break;}Lt=Lt.NextInAEL;}N.Idx=O.Idx;},e.Clipper.prototype.ReversePolyPtLinks=function(i){if(i!==null){var m,O;m=i;do O=m.Next,m.Next=m.Prev,m.Prev=O,m=O;while(m!==i);}},e.Clipper.SwapSides=function(i,m){var O=i.Side;i.Side=m.Side,m.Side=O;},e.Clipper.SwapPolyIndexes=function(i,m){var O=i.OutIdx;i.OutIdx=m.OutIdx,m.OutIdx=O;},e.Clipper.prototype.IntersectEdges=function(i,m,O){var N=i.OutIdx>=0,X=m.OutIdx>=0;if(e.use_xyz&&this.SetZ(O,i,m),e.use_lines&&(i.WindDelta===0||m.WindDelta===0)){if(i.WindDelta===0&&m.WindDelta===0)return;i.PolyTyp===m.PolyTyp&&i.WindDelta!==m.WindDelta&&this.m_ClipType===e.ClipType.ctUnion?i.WindDelta===0?X&&(this.AddOutPt(i,O),N&&(i.OutIdx=-1)):N&&(this.AddOutPt(m,O),X&&(m.OutIdx=-1)):i.PolyTyp!==m.PolyTyp&&(i.WindDelta===0&&Math.abs(m.WindCnt)===1&&(this.m_ClipType!==e.ClipType.ctUnion||m.WindCnt2===0)?(this.AddOutPt(i,O),N&&(i.OutIdx=-1)):m.WindDelta===0&&Math.abs(i.WindCnt)===1&&(this.m_ClipType!==e.ClipType.ctUnion||i.WindCnt2===0)&&(this.AddOutPt(m,O),X&&(m.OutIdx=-1)));return;}if(i.PolyTyp===m.PolyTyp){if(this.IsEvenOddFillType(i)){var k=i.WindCnt;i.WindCnt=m.WindCnt,m.WindCnt=k;}else i.WindCnt+m.WindDelta===0?i.WindCnt=-i.WindCnt:i.WindCnt+=m.WindDelta,m.WindCnt-i.WindDelta===0?m.WindCnt=-m.WindCnt:m.WindCnt-=i.WindDelta;}else this.IsEvenOddFillType(m)?i.WindCnt2=i.WindCnt2===0?1:0:i.WindCnt2+=m.WindDelta,this.IsEvenOddFillType(i)?m.WindCnt2=m.WindCnt2===0?1:0:m.WindCnt2-=i.WindDelta;var _,ft,ht,Ct;i.PolyTyp===e.PolyType.ptSubject?(_=this.m_SubjFillType,ht=this.m_ClipFillType):(_=this.m_ClipFillType,ht=this.m_SubjFillType),m.PolyTyp===e.PolyType.ptSubject?(ft=this.m_SubjFillType,Ct=this.m_ClipFillType):(ft=this.m_ClipFillType,Ct=this.m_SubjFillType);var wt,Lt;switch(_){case e.PolyFillType.pftPositive:wt=i.WindCnt;break;case e.PolyFillType.pftNegative:wt=-i.WindCnt;break;default:wt=Math.abs(i.WindCnt);break;}switch(ft){case e.PolyFillType.pftPositive:Lt=m.WindCnt;break;case e.PolyFillType.pftNegative:Lt=-m.WindCnt;break;default:Lt=Math.abs(m.WindCnt);break;}if(N&&X)wt!==0&&wt!==1||Lt!==0&&Lt!==1||i.PolyTyp!==m.PolyTyp&&this.m_ClipType!==e.ClipType.ctXor?this.AddLocalMaxPoly(i,m,O):(this.AddOutPt(i,O),this.AddOutPt(m,O),e.Clipper.SwapSides(i,m),e.Clipper.SwapPolyIndexes(i,m));else if(N)(Lt===0||Lt===1)&&(this.AddOutPt(i,O),e.Clipper.SwapSides(i,m),e.Clipper.SwapPolyIndexes(i,m));else if(X)(wt===0||wt===1)&&(this.AddOutPt(m,O),e.Clipper.SwapSides(i,m),e.Clipper.SwapPolyIndexes(i,m));else if((wt===0||wt===1)&&(Lt===0||Lt===1)){var Bt,Yt;switch(ht){case e.PolyFillType.pftPositive:Bt=i.WindCnt2;break;case e.PolyFillType.pftNegative:Bt=-i.WindCnt2;break;default:Bt=Math.abs(i.WindCnt2);break;}switch(Ct){case e.PolyFillType.pftPositive:Yt=m.WindCnt2;break;case e.PolyFillType.pftNegative:Yt=-m.WindCnt2;break;default:Yt=Math.abs(m.WindCnt2);break;}if(i.PolyTyp!==m.PolyTyp)this.AddLocalMinPoly(i,m,O);else if(wt===1&&Lt===1)switch(this.m_ClipType){case e.ClipType.ctIntersection:Bt>0&&Yt>0&&this.AddLocalMinPoly(i,m,O);break;case e.ClipType.ctUnion:Bt<=0&&Yt<=0&&this.AddLocalMinPoly(i,m,O);break;case e.ClipType.ctDifference:(i.PolyTyp===e.PolyType.ptClip&&Bt>0&&Yt>0||i.PolyTyp===e.PolyType.ptSubject&&Bt<=0&&Yt<=0)&&this.AddLocalMinPoly(i,m,O);break;case e.ClipType.ctXor:this.AddLocalMinPoly(i,m,O);break;}else e.Clipper.SwapSides(i,m);}},e.Clipper.prototype.DeleteFromSEL=function(i){var m=i.PrevInSEL,O=i.NextInSEL;m===null&&O===null&&i!==this.m_SortedEdges||(m!==null?m.NextInSEL=O:this.m_SortedEdges=O,O!==null&&(O.PrevInSEL=m),i.NextInSEL=null,i.PrevInSEL=null);},e.Clipper.prototype.ProcessHorizontals=function(){for(var i={};this.PopEdgeFromSEL(i);)this.ProcessHorizontal(i.v);},e.Clipper.prototype.GetHorzDirection=function(i,m){i.Bot.X<i.Top.X?(m.Left=i.Bot.X,m.Right=i.Top.X,m.Dir=e.Direction.dLeftToRight):(m.Left=i.Top.X,m.Right=i.Bot.X,m.Dir=e.Direction.dRightToLeft);},e.Clipper.prototype.ProcessHorizontal=function(i){var m={Dir:null,Left:null,Right:null};this.GetHorzDirection(i,m);for(var O=m.Dir,N=m.Left,X=m.Right,k=i.WindDelta===0,_=i,ft=null;_.NextInLML!==null&&e.ClipperBase.IsHorizontal(_.NextInLML);)_=_.NextInLML;_.NextInLML===null&&(ft=this.GetMaximaPair(_));var ht=this.m_Maxima;if(ht!==null)if(O===e.Direction.dLeftToRight){for(;ht!==null&&ht.X<=i.Bot.X;)ht=ht.Next;ht!==null&&ht.X>=_.Top.X&&(ht=null);}else{for(;ht.Next!==null&&ht.Next.X<i.Bot.X;)ht=ht.Next;ht.X<=_.Top.X&&(ht=null);}for(var Ct=null;;){for(var wt=i===_,Lt=this.GetNextInAEL(i,O);Lt!==null;){if(ht!==null)if(O===e.Direction.dLeftToRight)for(;ht!==null&&ht.X<Lt.Curr.X;)i.OutIdx>=0&&!k&&this.AddOutPt(i,new e.IntPoint2(ht.X,i.Bot.Y)),ht=ht.Next;else for(;ht!==null&&ht.X>Lt.Curr.X;)i.OutIdx>=0&&!k&&this.AddOutPt(i,new e.IntPoint2(ht.X,i.Bot.Y)),ht=ht.Prev;if(O===e.Direction.dLeftToRight&&Lt.Curr.X>X||O===e.Direction.dRightToLeft&&Lt.Curr.X<N||Lt.Curr.X===i.Top.X&&i.NextInLML!==null&&Lt.Dx<i.NextInLML.Dx)break;if(i.OutIdx>=0&&!k){e.use_xyz&&(O===e.Direction.dLeftToRight?this.SetZ(Lt.Curr,i,Lt):this.SetZ(Lt.Curr,Lt,i)),Ct=this.AddOutPt(i,Lt.Curr);for(var Bt=this.m_SortedEdges;Bt!==null;){if(Bt.OutIdx>=0&&this.HorzSegmentsOverlap(i.Bot.X,i.Top.X,Bt.Bot.X,Bt.Top.X)){var Yt=this.GetLastOutPt(Bt);this.AddJoin(Yt,Ct,Bt.Top);}Bt=Bt.NextInSEL;}this.AddGhostJoin(Ct,i.Bot);}if(Lt===ft&&wt){i.OutIdx>=0&&this.AddLocalMaxPoly(i,ft,i.Top),this.DeleteFromAEL(i),this.DeleteFromAEL(ft);return;}if(O===e.Direction.dLeftToRight){var Ht=new e.IntPoint2(Lt.Curr.X,i.Curr.Y);this.IntersectEdges(i,Lt,Ht);}else{var Ht=new e.IntPoint2(Lt.Curr.X,i.Curr.Y);this.IntersectEdges(Lt,i,Ht);}var Vt=this.GetNextInAEL(Lt,O);this.SwapPositionsInAEL(i,Lt),Lt=Vt;}if(i.NextInLML===null||!e.ClipperBase.IsHorizontal(i.NextInLML))break;i=this.UpdateEdgeIntoAEL(i),i.OutIdx>=0&&this.AddOutPt(i,i.Bot),m={Dir:O,Left:N,Right:X},this.GetHorzDirection(i,m),O=m.Dir,N=m.Left,X=m.Right;}if(i.OutIdx>=0&&Ct===null){Ct=this.GetLastOutPt(i);for(var Bt=this.m_SortedEdges;Bt!==null;){if(Bt.OutIdx>=0&&this.HorzSegmentsOverlap(i.Bot.X,i.Top.X,Bt.Bot.X,Bt.Top.X)){var Yt=this.GetLastOutPt(Bt);this.AddJoin(Yt,Ct,Bt.Top);}Bt=Bt.NextInSEL;}this.AddGhostJoin(Ct,i.Top);}if(i.NextInLML!==null){if(i.OutIdx>=0){if(Ct=this.AddOutPt(i,i.Top),i=this.UpdateEdgeIntoAEL(i),i.WindDelta===0)return;var ee=i.PrevInAEL,Vt=i.NextInAEL;if(ee!==null&&ee.Curr.X===i.Bot.X&&ee.Curr.Y===i.Bot.Y&&ee.WindDelta===0&&ee.OutIdx>=0&&ee.Curr.Y>ee.Top.Y&&e.ClipperBase.SlopesEqual3(i,ee,this.m_UseFullRange)){var Yt=this.AddOutPt(ee,i.Bot);this.AddJoin(Ct,Yt,i.Top);}else if(Vt!==null&&Vt.Curr.X===i.Bot.X&&Vt.Curr.Y===i.Bot.Y&&Vt.WindDelta!==0&&Vt.OutIdx>=0&&Vt.Curr.Y>Vt.Top.Y&&e.ClipperBase.SlopesEqual3(i,Vt,this.m_UseFullRange)){var Yt=this.AddOutPt(Vt,i.Bot);this.AddJoin(Ct,Yt,i.Top);}}else i=this.UpdateEdgeIntoAEL(i);}else i.OutIdx>=0&&this.AddOutPt(i,i.Top),this.DeleteFromAEL(i);},e.Clipper.prototype.GetNextInAEL=function(i,m){return m===e.Direction.dLeftToRight?i.NextInAEL:i.PrevInAEL;},e.Clipper.prototype.IsMinima=function(i){return i!==null&&i.Prev.NextInLML!==i&&i.Next.NextInLML!==i;},e.Clipper.prototype.IsMaxima=function(i,m){return i!==null&&i.Top.Y===m&&i.NextInLML===null;},e.Clipper.prototype.IsIntermediate=function(i,m){return i.Top.Y===m&&i.NextInLML!==null;},e.Clipper.prototype.GetMaximaPair=function(i){return e.IntPoint.op_Equality(i.Next.Top,i.Top)&&i.Next.NextInLML===null?i.Next:e.IntPoint.op_Equality(i.Prev.Top,i.Top)&&i.Prev.NextInLML===null?i.Prev:null;},e.Clipper.prototype.GetMaximaPairEx=function(i){var m=this.GetMaximaPair(i);return m===null||m.OutIdx===e.ClipperBase.Skip||m.NextInAEL===m.PrevInAEL&&!e.ClipperBase.IsHorizontal(m)?null:m;},e.Clipper.prototype.ProcessIntersections=function(i){if(this.m_ActiveEdges===null)return!0;try{if(this.BuildIntersectList(i),this.m_IntersectList.length===0)return!0;if(this.m_IntersectList.length===1||this.FixupIntersectionOrder())this.ProcessIntersectList();else return!1;}catch(_unused23){this.m_SortedEdges=null,this.m_IntersectList.length=0,e.Error("ProcessIntersections error");}return this.m_SortedEdges=null,!0;},e.Clipper.prototype.BuildIntersectList=function(i){if(this.m_ActiveEdges!==null){var m=this.m_ActiveEdges;for(this.m_SortedEdges=m;m!==null;)m.PrevInSEL=m.PrevInAEL,m.NextInSEL=m.NextInAEL,m.Curr.X=e.Clipper.TopX(m,i),m=m.NextInAEL;for(var O=!0;O&&this.m_SortedEdges!==null;){for(O=!1,m=this.m_SortedEdges;m.NextInSEL!==null;){var N=m.NextInSEL,X=new e.IntPoint0();if(m.Curr.X>N.Curr.X){this.IntersectPoint(m,N,X),X.Y<i&&(X=new e.IntPoint2(e.Clipper.TopX(m,i),i));var k=new e.IntersectNode();k.Edge1=m,k.Edge2=N,k.Pt.X=X.X,k.Pt.Y=X.Y,e.use_xyz&&(k.Pt.Z=X.Z),this.m_IntersectList.push(k),this.SwapPositionsInSEL(m,N),O=!0;}else m=N;}if(m.PrevInSEL!==null)m.PrevInSEL.NextInSEL=null;else break;}this.m_SortedEdges=null;}},e.Clipper.prototype.EdgesAdjacent=function(i){return i.Edge1.NextInSEL===i.Edge2||i.Edge1.PrevInSEL===i.Edge2;},e.Clipper.IntersectNodeSort=function(i,m){return m.Pt.Y-i.Pt.Y;},e.Clipper.prototype.FixupIntersectionOrder=function(){this.m_IntersectList.sort(this.m_IntersectNodeComparer),this.CopyAELToSEL();for(var i=this.m_IntersectList.length,m=0;m<i;m++){if(!this.EdgesAdjacent(this.m_IntersectList[m])){for(var O=m+1;O<i&&!this.EdgesAdjacent(this.m_IntersectList[O]);)O++;if(O===i)return!1;var N=this.m_IntersectList[m];this.m_IntersectList[m]=this.m_IntersectList[O],this.m_IntersectList[O]=N;}this.SwapPositionsInSEL(this.m_IntersectList[m].Edge1,this.m_IntersectList[m].Edge2);}return!0;},e.Clipper.prototype.ProcessIntersectList=function(){for(var i=0,m=this.m_IntersectList.length;i<m;i++){var O=this.m_IntersectList[i];this.IntersectEdges(O.Edge1,O.Edge2,O.Pt),this.SwapPositionsInAEL(O.Edge1,O.Edge2);}this.m_IntersectList.length=0;};var $s=function $s(i){return i<0?Math.ceil(i-0.5):Math.round(i);},Gs=function Gs(i){return i<0?Math.ceil(i-0.5):Math.floor(i+0.5);},Hs=function Hs(i){return i<0?-Math.round(Math.abs(i)):Math.round(i);},Vs=function Vs(i){return i<0?(i-=0.5,i<-2147483648?Math.ceil(i):i|0):(i+=0.5,i>2147483647?Math.floor(i):i|0);};s.msie?e.Clipper.Round=$s:s.chromium?e.Clipper.Round=Hs:s.safari?e.Clipper.Round=Vs:e.Clipper.Round=Gs,e.Clipper.TopX=function(i,m){return m===i.Top.Y?i.Top.X:i.Bot.X+e.Clipper.Round(i.Dx*(m-i.Bot.Y));},e.Clipper.prototype.IntersectPoint=function(i,m,O){O.X=0,O.Y=0;var N,X;if(i.Dx===m.Dx){O.Y=i.Curr.Y,O.X=e.Clipper.TopX(i,O.Y);return;}if(i.Delta.X===0)O.X=i.Bot.X,e.ClipperBase.IsHorizontal(m)?O.Y=m.Bot.Y:(X=m.Bot.Y-m.Bot.X/m.Dx,O.Y=e.Clipper.Round(O.X/m.Dx+X));else if(m.Delta.X===0)O.X=m.Bot.X,e.ClipperBase.IsHorizontal(i)?O.Y=i.Bot.Y:(N=i.Bot.Y-i.Bot.X/i.Dx,O.Y=e.Clipper.Round(O.X/i.Dx+N));else{N=i.Bot.X-i.Bot.Y*i.Dx,X=m.Bot.X-m.Bot.Y*m.Dx;var k=(X-N)/(i.Dx-m.Dx);O.Y=e.Clipper.Round(k),Math.abs(i.Dx)<Math.abs(m.Dx)?O.X=e.Clipper.Round(i.Dx*k+N):O.X=e.Clipper.Round(m.Dx*k+X);}if(O.Y<i.Top.Y||O.Y<m.Top.Y){if(i.Top.Y>m.Top.Y)return O.Y=i.Top.Y,O.X=e.Clipper.TopX(m,i.Top.Y),O.X<i.Top.X;O.Y=m.Top.Y,Math.abs(i.Dx)<Math.abs(m.Dx)?O.X=e.Clipper.TopX(i,O.Y):O.X=e.Clipper.TopX(m,O.Y);}O.Y>i.Curr.Y&&(O.Y=i.Curr.Y,Math.abs(i.Dx)>Math.abs(m.Dx)?O.X=e.Clipper.TopX(m,O.Y):O.X=e.Clipper.TopX(i,O.Y));},e.Clipper.prototype.ProcessEdgesAtTopOfScanbeam=function(i){for(var m=this.m_ActiveEdges;m!==null;){var O=this.IsMaxima(m,i);if(O){var N=this.GetMaximaPairEx(m);O=N===null||!e.ClipperBase.IsHorizontal(N);}if(O){this.StrictlySimple&&this.InsertMaxima(m.Top.X);var X=m.PrevInAEL;this.DoMaxima(m),X===null?m=this.m_ActiveEdges:m=X.NextInAEL;}else{if(this.IsIntermediate(m,i)&&e.ClipperBase.IsHorizontal(m.NextInLML)?(m=this.UpdateEdgeIntoAEL(m),m.OutIdx>=0&&this.AddOutPt(m,m.Bot),this.AddEdgeToSEL(m)):(m.Curr.X=e.Clipper.TopX(m,i),m.Curr.Y=i),e.use_xyz&&(m.Top.Y===i?m.Curr.Z=m.Top.Z:m.Bot.Y===i?m.Curr.Z=m.Bot.Z:m.Curr.Z=0),this.StrictlySimple){var X=m.PrevInAEL;if(m.OutIdx>=0&&m.WindDelta!==0&&X!==null&&X.OutIdx>=0&&X.Curr.X===m.Curr.X&&X.WindDelta!==0){var k=new e.IntPoint1(m.Curr);e.use_xyz&&this.SetZ(k,X,m);var _=this.AddOutPt(X,k),ft=this.AddOutPt(m,k);this.AddJoin(_,ft,k);}}m=m.NextInAEL;}}for(this.ProcessHorizontals(),this.m_Maxima=null,m=this.m_ActiveEdges;m!==null;){if(this.IsIntermediate(m,i)){var _=null;m.OutIdx>=0&&(_=this.AddOutPt(m,m.Top)),m=this.UpdateEdgeIntoAEL(m);var X=m.PrevInAEL,ht=m.NextInAEL;if(X!==null&&X.Curr.X===m.Bot.X&&X.Curr.Y===m.Bot.Y&&_!==null&&X.OutIdx>=0&&X.Curr.Y===X.Top.Y&&e.ClipperBase.SlopesEqual5(m.Curr,m.Top,X.Curr,X.Top,this.m_UseFullRange)&&m.WindDelta!==0&&X.WindDelta!==0){var ft=this.AddOutPt(ePrev2,m.Bot);this.AddJoin(_,ft,m.Top);}else if(ht!==null&&ht.Curr.X===m.Bot.X&&ht.Curr.Y===m.Bot.Y&&_!==null&&ht.OutIdx>=0&&ht.Curr.Y===ht.Top.Y&&e.ClipperBase.SlopesEqual5(m.Curr,m.Top,ht.Curr,ht.Top,this.m_UseFullRange)&&m.WindDelta!==0&&ht.WindDelta!==0){var ft=this.AddOutPt(ht,m.Bot);this.AddJoin(_,ft,m.Top);}}m=m.NextInAEL;}},e.Clipper.prototype.DoMaxima=function(i){var m=this.GetMaximaPairEx(i);if(m===null){i.OutIdx>=0&&this.AddOutPt(i,i.Top),this.DeleteFromAEL(i);return;}for(var O=i.NextInAEL;O!==null&&O!==m;)this.IntersectEdges(i,O,i.Top),this.SwapPositionsInAEL(i,O),O=i.NextInAEL;i.OutIdx===-1&&m.OutIdx===-1?(this.DeleteFromAEL(i),this.DeleteFromAEL(m)):i.OutIdx>=0&&m.OutIdx>=0?(i.OutIdx>=0&&this.AddLocalMaxPoly(i,m,i.Top),this.DeleteFromAEL(i),this.DeleteFromAEL(m)):e.use_lines&&i.WindDelta===0?(i.OutIdx>=0&&(this.AddOutPt(i,i.Top),i.OutIdx=e.ClipperBase.Unassigned),this.DeleteFromAEL(i),m.OutIdx>=0&&(this.AddOutPt(m,i.Top),m.OutIdx=e.ClipperBase.Unassigned),this.DeleteFromAEL(m)):e.Error("DoMaxima error");},e.Clipper.ReversePaths=function(i){for(var m=0,O=i.length;m<O;m++)i[m].reverse();},e.Clipper.Orientation=function(i){return e.Clipper.Area(i)>=0;},e.Clipper.prototype.PointCount=function(i){if(i===null)return 0;var m=0,O=i;do m++,O=O.Next;while(O!==i);return m;},e.Clipper.prototype.BuildResult=function(i){e.Clear(i);for(var m=0,O=this.m_PolyOuts.length;m<O;m++){var N=this.m_PolyOuts[m];if(N.Pts!==null){var X=N.Pts.Prev,k=this.PointCount(X);if(!(k<2)){for(var _=new Array(k),ft=0;ft<k;ft++)_[ft]=X.Pt,X=X.Prev;i.push(_);}}}},e.Clipper.prototype.BuildResult2=function(i){i.Clear();for(var m=0,O=this.m_PolyOuts.length;m<O;m++){var N=this.m_PolyOuts[m],X=this.PointCount(N.Pts);if(!(N.IsOpen&&X<2||!N.IsOpen&&X<3)){this.FixHoleLinkage(N);var k=new e.PolyNode();i.m_AllPolys.push(k),N.PolyNode=k,k.m_polygon.length=X;for(var _=N.Pts.Prev,ft=0;ft<X;ft++)k.m_polygon[ft]=_.Pt,_=_.Prev;}}for(var m=0,O=this.m_PolyOuts.length;m<O;m++){var N=this.m_PolyOuts[m];N.PolyNode!==null&&(N.IsOpen?(N.PolyNode.IsOpen=!0,i.AddChild(N.PolyNode)):N.FirstLeft!==null&&N.FirstLeft.PolyNode!==null?N.FirstLeft.PolyNode.AddChild(N.PolyNode):i.AddChild(N.PolyNode));}},e.Clipper.prototype.FixupOutPolyline=function(i){for(var m=i.Pts,O=m.Prev;m!==O;)if(m=m.Next,e.IntPoint.op_Equality(m.Pt,m.Prev.Pt)){m===O&&(O=m.Prev);var N=m.Prev;N.Next=m.Next,m.Next.Prev=N,m=N;}m===m.Prev&&(i.Pts=null);},e.Clipper.prototype.FixupOutPolygon=function(i){var m=null;i.BottomPt=null;for(var O=i.Pts,N=this.PreserveCollinear||this.StrictlySimple;;){if(O.Prev===O||O.Prev===O.Next){i.Pts=null;return;}if(e.IntPoint.op_Equality(O.Pt,O.Next.Pt)||e.IntPoint.op_Equality(O.Pt,O.Prev.Pt)||e.ClipperBase.SlopesEqual4(O.Prev.Pt,O.Pt,O.Next.Pt,this.m_UseFullRange)&&(!N||!this.Pt2IsBetweenPt1AndPt3(O.Prev.Pt,O.Pt,O.Next.Pt)))m=null,O.Prev.Next=O.Next,O.Next.Prev=O.Prev,O=O.Prev;else{if(O===m)break;m===null&&(m=O),O=O.Next;}}i.Pts=O;},e.Clipper.prototype.DupOutPt=function(i,m){var O=new e.OutPt();return O.Pt.X=i.Pt.X,O.Pt.Y=i.Pt.Y,e.use_xyz&&(O.Pt.Z=i.Pt.Z),O.Idx=i.Idx,m?(O.Next=i.Next,O.Prev=i,i.Next.Prev=O,i.Next=O):(O.Prev=i.Prev,O.Next=i,i.Prev.Next=O,i.Prev=O),O;},e.Clipper.prototype.GetOverlap=function(i,m,O,N,X){return i<m?O<N?(X.Left=Math.max(i,O),X.Right=Math.min(m,N)):(X.Left=Math.max(i,N),X.Right=Math.min(m,O)):O<N?(X.Left=Math.max(m,O),X.Right=Math.min(i,N)):(X.Left=Math.max(m,N),X.Right=Math.min(i,O)),X.Left<X.Right;},e.Clipper.prototype.JoinHorz=function(i,m,O,N,X,k){var _=i.Pt.X>m.Pt.X?e.Direction.dRightToLeft:e.Direction.dLeftToRight,ft=O.Pt.X>N.Pt.X?e.Direction.dRightToLeft:e.Direction.dLeftToRight;if(_===ft)return!1;if(_===e.Direction.dLeftToRight){for(;i.Next.Pt.X<=X.X&&i.Next.Pt.X>=i.Pt.X&&i.Next.Pt.Y===X.Y;)i=i.Next;k&&i.Pt.X!==X.X&&(i=i.Next),m=this.DupOutPt(i,!k),e.IntPoint.op_Inequality(m.Pt,X)&&(i=m,i.Pt.X=X.X,i.Pt.Y=X.Y,e.use_xyz&&(i.Pt.Z=X.Z),m=this.DupOutPt(i,!k));}else{for(;i.Next.Pt.X>=X.X&&i.Next.Pt.X<=i.Pt.X&&i.Next.Pt.Y===X.Y;)i=i.Next;!k&&i.Pt.X!==X.X&&(i=i.Next),m=this.DupOutPt(i,k),e.IntPoint.op_Inequality(m.Pt,X)&&(i=m,i.Pt.X=X.X,i.Pt.Y=X.Y,e.use_xyz&&(i.Pt.Z=X.Z),m=this.DupOutPt(i,k));}if(ft===e.Direction.dLeftToRight){for(;O.Next.Pt.X<=X.X&&O.Next.Pt.X>=O.Pt.X&&O.Next.Pt.Y===X.Y;)O=O.Next;k&&O.Pt.X!==X.X&&(O=O.Next),N=this.DupOutPt(O,!k),e.IntPoint.op_Inequality(N.Pt,X)&&(O=N,O.Pt.X=X.X,O.Pt.Y=X.Y,e.use_xyz&&(O.Pt.Z=X.Z),N=this.DupOutPt(O,!k));}else{for(;O.Next.Pt.X>=X.X&&O.Next.Pt.X<=O.Pt.X&&O.Next.Pt.Y===X.Y;)O=O.Next;!k&&O.Pt.X!==X.X&&(O=O.Next),N=this.DupOutPt(O,k),e.IntPoint.op_Inequality(N.Pt,X)&&(O=N,O.Pt.X=X.X,O.Pt.Y=X.Y,e.use_xyz&&(O.Pt.Z=X.Z),N=this.DupOutPt(O,k));}return _===e.Direction.dLeftToRight===k?(i.Prev=O,O.Next=i,m.Next=N,N.Prev=m):(i.Next=O,O.Prev=i,m.Prev=N,N.Next=m),!0;},e.Clipper.prototype.JoinPoints=function(i,m,O){var N=i.OutPt1,X=new e.OutPt(),k=i.OutPt2,_=new e.OutPt(),ft=i.OutPt1.Pt.Y===i.OffPt.Y;if(ft&&e.IntPoint.op_Equality(i.OffPt,i.OutPt1.Pt)&&e.IntPoint.op_Equality(i.OffPt,i.OutPt2.Pt)){if(m!==O)return!1;for(X=i.OutPt1.Next;X!==N&&e.IntPoint.op_Equality(X.Pt,i.OffPt);)X=X.Next;var ht=X.Pt.Y>i.OffPt.Y;for(_=i.OutPt2.Next;_!==k&&e.IntPoint.op_Equality(_.Pt,i.OffPt);)_=_.Next;var Ct=_.Pt.Y>i.OffPt.Y;return ht===Ct?!1:ht?(X=this.DupOutPt(N,!1),_=this.DupOutPt(k,!0),N.Prev=k,k.Next=N,X.Next=_,_.Prev=X,i.OutPt1=N,i.OutPt2=X,!0):(X=this.DupOutPt(N,!0),_=this.DupOutPt(k,!1),N.Next=k,k.Prev=N,X.Prev=_,_.Next=X,i.OutPt1=N,i.OutPt2=X,!0);}else if(ft){for(X=N;N.Prev.Pt.Y===N.Pt.Y&&N.Prev!==X&&N.Prev!==k;)N=N.Prev;for(;X.Next.Pt.Y===X.Pt.Y&&X.Next!==N&&X.Next!==k;)X=X.Next;if(X.Next===N||X.Next===k)return!1;for(_=k;k.Prev.Pt.Y===k.Pt.Y&&k.Prev!==_&&k.Prev!==X;)k=k.Prev;for(;_.Next.Pt.Y===_.Pt.Y&&_.Next!==k&&_.Next!==N;)_=_.Next;if(_.Next===k||_.Next===N)return!1;var wt={Left:null,Right:null};if(!this.GetOverlap(N.Pt.X,X.Pt.X,k.Pt.X,_.Pt.X,wt))return!1;var Lt=wt.Left,Bt=wt.Right,Yt=new e.IntPoint0(),Ht;return N.Pt.X>=Lt&&N.Pt.X<=Bt?(Yt.X=N.Pt.X,Yt.Y=N.Pt.Y,e.use_xyz&&(Yt.Z=N.Pt.Z),Ht=N.Pt.X>X.Pt.X):k.Pt.X>=Lt&&k.Pt.X<=Bt?(Yt.X=k.Pt.X,Yt.Y=k.Pt.Y,e.use_xyz&&(Yt.Z=k.Pt.Z),Ht=k.Pt.X>_.Pt.X):X.Pt.X>=Lt&&X.Pt.X<=Bt?(Yt.X=X.Pt.X,Yt.Y=X.Pt.Y,e.use_xyz&&(Yt.Z=X.Pt.Z),Ht=X.Pt.X>N.Pt.X):(Yt.X=_.Pt.X,Yt.Y=_.Pt.Y,e.use_xyz&&(Yt.Z=_.Pt.Z),Ht=_.Pt.X>k.Pt.X),i.OutPt1=N,i.OutPt2=k,this.JoinHorz(N,X,k,_,Yt,Ht);}else{for(X=N.Next;e.IntPoint.op_Equality(X.Pt,N.Pt)&&X!==N;)X=X.Next;var Vt=X.Pt.Y>N.Pt.Y||!e.ClipperBase.SlopesEqual4(N.Pt,X.Pt,i.OffPt,this.m_UseFullRange);if(Vt){for(X=N.Prev;e.IntPoint.op_Equality(X.Pt,N.Pt)&&X!==N;)X=X.Prev;if(X.Pt.Y>N.Pt.Y||!e.ClipperBase.SlopesEqual4(N.Pt,X.Pt,i.OffPt,this.m_UseFullRange))return!1;}for(_=k.Next;e.IntPoint.op_Equality(_.Pt,k.Pt)&&_!==k;)_=_.Next;var ee=_.Pt.Y>k.Pt.Y||!e.ClipperBase.SlopesEqual4(k.Pt,_.Pt,i.OffPt,this.m_UseFullRange);if(ee){for(_=k.Prev;e.IntPoint.op_Equality(_.Pt,k.Pt)&&_!==k;)_=_.Prev;if(_.Pt.Y>k.Pt.Y||!e.ClipperBase.SlopesEqual4(k.Pt,_.Pt,i.OffPt,this.m_UseFullRange))return!1;}return X===N||_===k||X===_||m===O&&Vt===ee?!1:Vt?(X=this.DupOutPt(N,!1),_=this.DupOutPt(k,!0),N.Prev=k,k.Next=N,X.Next=_,_.Prev=X,i.OutPt1=N,i.OutPt2=X,!0):(X=this.DupOutPt(N,!0),_=this.DupOutPt(k,!1),N.Next=k,k.Prev=N,X.Prev=_,_.Next=X,i.OutPt1=N,i.OutPt2=X,!0);}},e.Clipper.GetBounds=function(i){for(var m=0,O=i.length;m<O&&i[m].length===0;)m++;if(m===O)return new e.IntRect(0,0,0,0);var N=new e.IntRect();for(N.left=i[m][0].X,N.right=N.left,N.top=i[m][0].Y,N.bottom=N.top;m<O;m++)for(var X=0,k=i[m].length;X<k;X++)i[m][X].X<N.left?N.left=i[m][X].X:i[m][X].X>N.right&&(N.right=i[m][X].X),i[m][X].Y<N.top?N.top=i[m][X].Y:i[m][X].Y>N.bottom&&(N.bottom=i[m][X].Y);return N;},e.Clipper.prototype.GetBounds2=function(i){var m=i,O=new e.IntRect();for(O.left=i.Pt.X,O.right=i.Pt.X,O.top=i.Pt.Y,O.bottom=i.Pt.Y,i=i.Next;i!==m;)i.Pt.X<O.left&&(O.left=i.Pt.X),i.Pt.X>O.right&&(O.right=i.Pt.X),i.Pt.Y<O.top&&(O.top=i.Pt.Y),i.Pt.Y>O.bottom&&(O.bottom=i.Pt.Y),i=i.Next;return O;},e.Clipper.PointInPolygon=function(i,m){var O=0,N=m.length;if(N<3)return 0;for(var X=m[0],k=1;k<=N;++k){var _=k===N?m[0]:m[k];if(_.Y===i.Y&&(_.X===i.X||X.Y===i.Y&&_.X>i.X==X.X<i.X))return-1;if(X.Y<i.Y!=_.Y<i.Y){if(X.X>=i.X){if(_.X>i.X)O=1-O;else{var ft=(X.X-i.X)*(_.Y-i.Y)-(_.X-i.X)*(X.Y-i.Y);if(ft===0)return-1;ft>0==_.Y>X.Y&&(O=1-O);}}else if(_.X>i.X){var ft=(X.X-i.X)*(_.Y-i.Y)-(_.X-i.X)*(X.Y-i.Y);if(ft===0)return-1;ft>0==_.Y>X.Y&&(O=1-O);}}X=_;}return O;},e.Clipper.prototype.PointInPolygon=function(i,m){var O=0,N=m,X=i.X,k=i.Y,_=m.Pt.X,ft=m.Pt.Y;do{m=m.Next;var ht=m.Pt.X,Ct=m.Pt.Y;if(Ct===k&&(ht===X||ft===k&&ht>X==_<X))return-1;if(ft<k!=Ct<k){if(_>=X){if(ht>X)O=1-O;else{var wt=(_-X)*(Ct-k)-(ht-X)*(ft-k);if(wt===0)return-1;wt>0==Ct>ft&&(O=1-O);}}else if(ht>X){var wt=(_-X)*(Ct-k)-(ht-X)*(ft-k);if(wt===0)return-1;wt>0==Ct>ft&&(O=1-O);}}_=ht,ft=Ct;}while(N!==m);return O;},e.Clipper.prototype.Poly2ContainsPoly1=function(i,m){var O=i;do{var N=this.PointInPolygon(O.Pt,m);if(N>=0)return N>0;O=O.Next;}while(O!==i);return!0;},e.Clipper.prototype.FixupFirstLefts1=function(i,m){for(var O,N,X=0,k=this.m_PolyOuts.length;X<k;X++)O=this.m_PolyOuts[X],N=e.Clipper.ParseFirstLeft(O.FirstLeft),O.Pts!==null&&N===i&&this.Poly2ContainsPoly1(O.Pts,m.Pts)&&(O.FirstLeft=m);},e.Clipper.prototype.FixupFirstLefts2=function(i,m){for(var O=m.FirstLeft,N,X,k=0,_=this.m_PolyOuts.length;k<_;k++)N=this.m_PolyOuts[k],!(N.Pts===null||N===m||N===i)&&(X=e.Clipper.ParseFirstLeft(N.FirstLeft),!(X!==O&&X!==i&&X!==m)&&(this.Poly2ContainsPoly1(N.Pts,i.Pts)?N.FirstLeft=i:this.Poly2ContainsPoly1(N.Pts,m.Pts)?N.FirstLeft=m:(N.FirstLeft===i||N.FirstLeft===m)&&(N.FirstLeft=O)));},e.Clipper.prototype.FixupFirstLefts3=function(i,m){for(var O,N,X=0,k=this.m_PolyOuts.length;X<k;X++)O=this.m_PolyOuts[X],N=e.Clipper.ParseFirstLeft(O.FirstLeft),O.Pts!==null&&N===i&&(O.FirstLeft=m);},e.Clipper.ParseFirstLeft=function(i){for(;i!==null&&i.Pts===null;)i=i.FirstLeft;return i;},e.Clipper.prototype.JoinCommonEdges=function(){for(var i=0,m=this.m_Joins.length;i<m;i++){var O=this.m_Joins[i],N=this.GetOutRec(O.OutPt1.Idx),X=this.GetOutRec(O.OutPt2.Idx);if(!(N.Pts===null||X.Pts===null)&&!(N.IsOpen||X.IsOpen)){var k;N===X?k=N:this.OutRec1RightOfOutRec2(N,X)?k=X:this.OutRec1RightOfOutRec2(X,N)?k=N:k=this.GetLowermostRec(N,X),this.JoinPoints(O,N,X)&&(N===X?(N.Pts=O.OutPt1,N.BottomPt=null,X=this.CreateOutRec(),X.Pts=O.OutPt2,this.UpdateOutPtIdxs(X),this.Poly2ContainsPoly1(X.Pts,N.Pts)?(X.IsHole=!N.IsHole,X.FirstLeft=N,this.m_UsingPolyTree&&this.FixupFirstLefts2(X,N),(X.IsHole^this.ReverseSolution)==this.Area$1(X)>0&&this.ReversePolyPtLinks(X.Pts)):this.Poly2ContainsPoly1(N.Pts,X.Pts)?(X.IsHole=N.IsHole,N.IsHole=!X.IsHole,X.FirstLeft=N.FirstLeft,N.FirstLeft=X,this.m_UsingPolyTree&&this.FixupFirstLefts2(N,X),(N.IsHole^this.ReverseSolution)==this.Area$1(N)>0&&this.ReversePolyPtLinks(N.Pts)):(X.IsHole=N.IsHole,X.FirstLeft=N.FirstLeft,this.m_UsingPolyTree&&this.FixupFirstLefts1(N,X))):(X.Pts=null,X.BottomPt=null,X.Idx=N.Idx,N.IsHole=k.IsHole,k===X&&(N.FirstLeft=X.FirstLeft),X.FirstLeft=N,this.m_UsingPolyTree&&this.FixupFirstLefts3(X,N)));}}},e.Clipper.prototype.UpdateOutPtIdxs=function(i){var m=i.Pts;do m.Idx=i.Idx,m=m.Prev;while(m!==i.Pts);},e.Clipper.prototype.DoSimplePolygons=function(){for(var i=0;i<this.m_PolyOuts.length;){var m=this.m_PolyOuts[i++],O=m.Pts;if(!(O===null||m.IsOpen))do{for(var N=O.Next;N!==m.Pts;){if(e.IntPoint.op_Equality(O.Pt,N.Pt)&&N.Next!==O&&N.Prev!==O){var X=O.Prev,k=N.Prev;O.Prev=k,k.Next=O,N.Prev=X,X.Next=N,m.Pts=O;var _=this.CreateOutRec();_.Pts=N,this.UpdateOutPtIdxs(_),this.Poly2ContainsPoly1(_.Pts,m.Pts)?(_.IsHole=!m.IsHole,_.FirstLeft=m,this.m_UsingPolyTree&&this.FixupFirstLefts2(_,m)):this.Poly2ContainsPoly1(m.Pts,_.Pts)?(_.IsHole=m.IsHole,m.IsHole=!_.IsHole,_.FirstLeft=m.FirstLeft,m.FirstLeft=_,this.m_UsingPolyTree&&this.FixupFirstLefts2(m,_)):(_.IsHole=m.IsHole,_.FirstLeft=m.FirstLeft,this.m_UsingPolyTree&&this.FixupFirstLefts1(m,_)),N=O;}N=N.Next;}O=O.Next;}while(O!==m.Pts);}},e.Clipper.Area=function(i){if(!Array.isArray(i))return 0;var m=i.length;if(m<3)return 0;for(var O=0,N=0,X=m-1;N<m;++N)O+=(i[X].X+i[N].X)*(i[X].Y-i[N].Y),X=N;return-O*0.5;},e.Clipper.prototype.Area=function(i){var m=i;if(i===null)return 0;var O=0;do O=O+(i.Prev.Pt.X+i.Pt.X)*(i.Prev.Pt.Y-i.Pt.Y),i=i.Next;while(i!==m);return O*0.5;},e.Clipper.prototype.Area$1=function(i){return this.Area(i.Pts);},e.Clipper.SimplifyPolygon=function(i,m){var O=new Array(),N=new e.Clipper(0);return N.StrictlySimple=!0,N.AddPath(i,e.PolyType.ptSubject,!0),N.Execute(e.ClipType.ctUnion,O,m,m),O;},e.Clipper.SimplifyPolygons=function(i,m){_typeof(m)>"u"&&(m=e.PolyFillType.pftEvenOdd);var O=new Array(),N=new e.Clipper(0);return N.StrictlySimple=!0,N.AddPaths(i,e.PolyType.ptSubject,!0),N.Execute(e.ClipType.ctUnion,O,m,m),O;},e.Clipper.DistanceSqrd=function(i,m){var O=i.X-m.X,N=i.Y-m.Y;return O*O+N*N;},e.Clipper.DistanceFromLineSqrd=function(i,m,O){var N=m.Y-O.Y,X=O.X-m.X,k=N*m.X+X*m.Y;return k=N*i.X+X*i.Y-k,k*k/(N*N+X*X);},e.Clipper.SlopesNearCollinear=function(i,m,O,N){return Math.abs(i.X-m.X)>Math.abs(i.Y-m.Y)?i.X>m.X==i.X<O.X?e.Clipper.DistanceFromLineSqrd(i,m,O)<N:m.X>i.X==m.X<O.X?e.Clipper.DistanceFromLineSqrd(m,i,O)<N:e.Clipper.DistanceFromLineSqrd(O,i,m)<N:i.Y>m.Y==i.Y<O.Y?e.Clipper.DistanceFromLineSqrd(i,m,O)<N:m.Y>i.Y==m.Y<O.Y?e.Clipper.DistanceFromLineSqrd(m,i,O)<N:e.Clipper.DistanceFromLineSqrd(O,i,m)<N;},e.Clipper.PointsAreClose=function(i,m,O){var N=i.X-m.X,X=i.Y-m.Y;return N*N+X*X<=O;},e.Clipper.ExcludeOp=function(i){var m=i.Prev;return m.Next=i.Next,i.Next.Prev=m,m.Idx=0,m;},e.Clipper.CleanPolygon=function(i,m){_typeof(m)>"u"&&(m=1.415);var O=i.length;if(O===0)return new Array();for(var N=new Array(O),X=0;X<O;++X)N[X]=new e.OutPt();for(var X=0;X<O;++X)N[X].Pt=i[X],N[X].Next=N[(X+1)%O],N[X].Next.Prev=N[X],N[X].Idx=0;for(var k=m*m,_=N[0];_.Idx===0&&_.Next!==_.Prev;)e.Clipper.PointsAreClose(_.Pt,_.Prev.Pt,k)?(_=e.Clipper.ExcludeOp(_),O--):e.Clipper.PointsAreClose(_.Prev.Pt,_.Next.Pt,k)?(e.Clipper.ExcludeOp(_.Next),_=e.Clipper.ExcludeOp(_),O-=2):e.Clipper.SlopesNearCollinear(_.Prev.Pt,_.Pt,_.Next.Pt,k)?(_=e.Clipper.ExcludeOp(_),O--):(_.Idx=1,_=_.Next);O<3&&(O=0);for(var ft=new Array(O),X=0;X<O;++X)ft[X]=new e.IntPoint1(_.Pt),_=_.Next;return N=null,ft;},e.Clipper.CleanPolygons=function(i,m){for(var O=new Array(i.length),N=0,X=i.length;N<X;N++)O[N]=e.Clipper.CleanPolygon(i[N],m);return O;},e.Clipper.Minkowski=function(i,m,O,N){var X=N?1:0,k=i.length,_=m.length,ft=new Array();if(O)for(var ht=0;ht<_;ht++){for(var Ct=new Array(k),wt=0,Lt=i.length,Bt=i[wt];wt<Lt;wt++,Bt=i[wt])Ct[wt]=new e.IntPoint2(m[ht].X+Bt.X,m[ht].Y+Bt.Y);ft.push(Ct);}else for(var ht=0;ht<_;ht++){for(var Ct=new Array(k),wt=0,Lt=i.length,Bt=i[wt];wt<Lt;wt++,Bt=i[wt])Ct[wt]=new e.IntPoint2(m[ht].X-Bt.X,m[ht].Y-Bt.Y);ft.push(Ct);}for(var Yt=new Array(),ht=0;ht<_-1+X;ht++)for(var wt=0;wt<k;wt++){var Ht=new Array();Ht.push(ft[ht%_][wt%k]),Ht.push(ft[(ht+1)%_][wt%k]),Ht.push(ft[(ht+1)%_][(wt+1)%k]),Ht.push(ft[ht%_][(wt+1)%k]),e.Clipper.Orientation(Ht)||Ht.reverse(),Yt.push(Ht);}return Yt;},e.Clipper.MinkowskiSum=function(i,m,O){if(m[0]instanceof Array){for(var X=m,_=new e.Paths(),k=new e.Clipper(),ft=0;ft<X.length;++ft){var ht=e.Clipper.Minkowski(i,X[ft],!0,O);if(k.AddPaths(ht,e.PolyType.ptSubject,!0),O){var N=e.Clipper.TranslatePath(X[ft],i[0]);k.AddPath(N,e.PolyType.ptClip,!0);}}return k.Execute(e.ClipType.ctUnion,_,e.PolyFillType.pftNonZero,e.PolyFillType.pftNonZero),_;}else{var N=m,X=e.Clipper.Minkowski(i,N,!0,O),k=new e.Clipper();return k.AddPaths(X,e.PolyType.ptSubject,!0),k.Execute(e.ClipType.ctUnion,X,e.PolyFillType.pftNonZero,e.PolyFillType.pftNonZero),X;}},e.Clipper.TranslatePath=function(i,m){for(var O=new e.Path(),N=0;N<i.length;N++)O.push(new e.IntPoint2(i[N].X+m.X,i[N].Y+m.Y));return O;},e.Clipper.MinkowskiDiff=function(i,m){var O=e.Clipper.Minkowski(i,m,!1,!0),N=new e.Clipper();return N.AddPaths(O,e.PolyType.ptSubject,!0),N.Execute(e.ClipType.ctUnion,O,e.PolyFillType.pftNonZero,e.PolyFillType.pftNonZero),O;},e.Clipper.PolyTreeToPaths=function(i){var m=new Array();return e.Clipper.AddPolyNodeToPaths(i,e.Clipper.NodeType.ntAny,m),m;},e.Clipper.AddPolyNodeToPaths=function(i,m,O){var N=!0;switch(m){case e.Clipper.NodeType.ntOpen:return;case e.Clipper.NodeType.ntClosed:N=!i.IsOpen;break;}i.m_polygon.length>0&&N&&O.push(i.m_polygon);for(var X=0,k=i.Childs(),_=k.length,ft=k[X];X<_;X++,ft=k[X])e.Clipper.AddPolyNodeToPaths(ft,m,O);},e.Clipper.OpenPathsFromPolyTree=function(i){for(var m=new e.Paths(),O=0,N=i.ChildCount();O<N;O++)i.Childs()[O].IsOpen&&m.push(i.Childs()[O].m_polygon);return m;},e.Clipper.ClosedPathsFromPolyTree=function(i){var m=new e.Paths();return e.Clipper.AddPolyNodeToPaths(i,e.Clipper.NodeType.ntClosed,m),m;},yn(e.Clipper,e.ClipperBase),e.Clipper.NodeType={ntAny:0,ntOpen:1,ntClosed:2},e.ClipperOffset=function(i,m){_typeof(i)>"u"&&(i=2),_typeof(m)>"u"&&(m=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=i,this.ArcTolerance=m,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(i,m,O){var N=i.length-1;if(!(N<0)){var X=new e.PolyNode();if(X.m_jointype=m,X.m_endtype=O,O===e.EndType.etClosedLine||O===e.EndType.etClosedPolygon)for(;N>0&&e.IntPoint.op_Equality(i[0],i[N]);)N--;X.m_polygon.push(i[0]);for(var k=0,_=0,ft=1;ft<=N;ft++)e.IntPoint.op_Inequality(X.m_polygon[k],i[ft])&&(k++,X.m_polygon.push(i[ft]),(i[ft].Y>X.m_polygon[_].Y||i[ft].Y===X.m_polygon[_].Y&&i[ft].X<X.m_polygon[_].X)&&(_=k));if(!(O===e.EndType.etClosedPolygon&&k<2)&&(this.m_polyNodes.AddChild(X),O===e.EndType.etClosedPolygon))if(this.m_lowest.X<0)this.m_lowest=new e.IntPoint2(this.m_polyNodes.ChildCount()-1,_);else{var ht=this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon[this.m_lowest.Y];(X.m_polygon[_].Y>ht.Y||X.m_polygon[_].Y===ht.Y&&X.m_polygon[_].X<ht.X)&&(this.m_lowest=new e.IntPoint2(this.m_polyNodes.ChildCount()-1,_));}}},e.ClipperOffset.prototype.AddPaths=function(i,m,O){for(var N=0,X=i.length;N<X;N++)this.AddPath(i[N],m,O);},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 i=0;i<this.m_polyNodes.ChildCount();i++){var m=this.m_polyNodes.Childs()[i];(m.m_endtype===e.EndType.etClosedPolygon||m.m_endtype===e.EndType.etClosedLine&&e.Clipper.Orientation(m.m_polygon))&&m.m_polygon.reverse();}else for(var i=0;i<this.m_polyNodes.ChildCount();i++){var m=this.m_polyNodes.Childs()[i];m.m_endtype===e.EndType.etClosedLine&&!e.Clipper.Orientation(m.m_polygon)&&m.m_polygon.reverse();}},e.ClipperOffset.GetUnitNormal=function(i,m){var O=m.X-i.X,N=m.Y-i.Y;if(O===0&&N===0)return new e.DoublePoint2(0,0);var X=1/Math.sqrt(O*O+N*N);return O*=X,N*=X,new e.DoublePoint2(N,-O);},e.ClipperOffset.prototype.DoOffset=function(i){if(this.m_destPolys=new Array(),this.m_delta=i,e.ClipperBase.near_zero(i)){for(var m=0;m<this.m_polyNodes.ChildCount();m++){var O=this.m_polyNodes.Childs()[m];O.m_endtype===e.EndType.etClosedPolygon&&this.m_destPolys.push(O.m_polygon);}return;}this.MiterLimit>2?this.m_miterLim=2/(this.MiterLimit*this.MiterLimit):this.m_miterLim=0.5;var N;this.ArcTolerance<=0?N=e.ClipperOffset.def_arc_tolerance:this.ArcTolerance>Math.abs(i)*e.ClipperOffset.def_arc_tolerance?N=Math.abs(i)*e.ClipperOffset.def_arc_tolerance:N=this.ArcTolerance;var X=3.14159265358979/Math.acos(1-N/Math.abs(i));this.m_sin=Math.sin(e.ClipperOffset.two_pi/X),this.m_cos=Math.cos(e.ClipperOffset.two_pi/X),this.m_StepsPerRad=X/e.ClipperOffset.two_pi,i<0&&(this.m_sin=-this.m_sin);for(var m=0;m<this.m_polyNodes.ChildCount();m++){var O=this.m_polyNodes.Childs()[m];this.m_srcPoly=O.m_polygon;var k=this.m_srcPoly.length;if(!(k===0||i<=0&&(k<3||O.m_endtype!==e.EndType.etClosedPolygon))){if(this.m_destPoly=new Array(),k===1){if(O.m_jointype===e.JoinType.jtRound)for(var _=1,ft=0,ht=1;ht<=X;ht++){this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[0].X+_*i),e.ClipperOffset.Round(this.m_srcPoly[0].Y+ft*i)));var Ct=_;_=_*this.m_cos-this.m_sin*ft,ft=Ct*this.m_sin+ft*this.m_cos;}else for(var _=-1,ft=-1,ht=0;ht<4;++ht)this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[0].X+_*i),e.ClipperOffset.Round(this.m_srcPoly[0].Y+ft*i))),_<0?_=1:ft<0?ft=1:_=-1;this.m_destPolys.push(this.m_destPoly);continue;}this.m_normals.length=0;for(var ht=0;ht<k-1;ht++)this.m_normals.push(e.ClipperOffset.GetUnitNormal(this.m_srcPoly[ht],this.m_srcPoly[ht+1]));if(O.m_endtype===e.EndType.etClosedLine||O.m_endtype===e.EndType.etClosedPolygon?this.m_normals.push(e.ClipperOffset.GetUnitNormal(this.m_srcPoly[k-1],this.m_srcPoly[0])):this.m_normals.push(new e.DoublePoint1(this.m_normals[k-2])),O.m_endtype===e.EndType.etClosedPolygon){for(var wt=k-1,ht=0;ht<k;ht++)wt=this.OffsetPoint(ht,wt,O.m_jointype);this.m_destPolys.push(this.m_destPoly);}else if(O.m_endtype===e.EndType.etClosedLine){for(var wt=k-1,ht=0;ht<k;ht++)wt=this.OffsetPoint(ht,wt,O.m_jointype);this.m_destPolys.push(this.m_destPoly),this.m_destPoly=new Array();for(var Lt=this.m_normals[k-1],ht=k-1;ht>0;ht--)this.m_normals[ht]=new e.DoublePoint2(-this.m_normals[ht-1].X,-this.m_normals[ht-1].Y);this.m_normals[0]=new e.DoublePoint2(-Lt.X,-Lt.Y),wt=0;for(var ht=k-1;ht>=0;ht--)wt=this.OffsetPoint(ht,wt,O.m_jointype);this.m_destPolys.push(this.m_destPoly);}else{for(var wt=0,ht=1;ht<k-1;++ht)wt=this.OffsetPoint(ht,wt,O.m_jointype);var Bt;if(O.m_endtype===e.EndType.etOpenButt){var ht=k-1;Bt=new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[ht].X+this.m_normals[ht].X*i),e.ClipperOffset.Round(this.m_srcPoly[ht].Y+this.m_normals[ht].Y*i)),this.m_destPoly.push(Bt),Bt=new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[ht].X-this.m_normals[ht].X*i),e.ClipperOffset.Round(this.m_srcPoly[ht].Y-this.m_normals[ht].Y*i)),this.m_destPoly.push(Bt);}else{var ht=k-1;wt=k-2,this.m_sinA=0,this.m_normals[ht]=new e.DoublePoint2(-this.m_normals[ht].X,-this.m_normals[ht].Y),O.m_endtype===e.EndType.etOpenSquare?this.DoSquare(ht,wt):this.DoRound(ht,wt);}for(var ht=k-1;ht>0;ht--)this.m_normals[ht]=new e.DoublePoint2(-this.m_normals[ht-1].X,-this.m_normals[ht-1].Y);this.m_normals[0]=new e.DoublePoint2(-this.m_normals[1].X,-this.m_normals[1].Y),wt=k-1;for(var ht=wt-1;ht>0;--ht)wt=this.OffsetPoint(ht,wt,O.m_jointype);O.m_endtype===e.EndType.etOpenButt?(Bt=new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[0].X-this.m_normals[0].X*i),e.ClipperOffset.Round(this.m_srcPoly[0].Y-this.m_normals[0].Y*i)),this.m_destPoly.push(Bt),Bt=new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[0].X+this.m_normals[0].X*i),e.ClipperOffset.Round(this.m_srcPoly[0].Y+this.m_normals[0].Y*i)),this.m_destPoly.push(Bt)):(wt=1,this.m_sinA=0,O.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 i=arguments,m=i[0]instanceof e.PolyTree;if(m){var O=i[0],N=i[1];O.Clear(),this.FixOrientations(),this.DoOffset(N);var X=new e.Clipper(0);if(X.AddPaths(this.m_destPolys,e.PolyType.ptSubject,!0),N>0)X.Execute(e.ClipType.ctUnion,O,e.PolyFillType.pftPositive,e.PolyFillType.pftPositive);else{var k=e.Clipper.GetBounds(this.m_destPolys),_=new e.Path();if(_.push(new e.IntPoint2(k.left-10,k.bottom+10)),_.push(new e.IntPoint2(k.right+10,k.bottom+10)),_.push(new e.IntPoint2(k.right+10,k.top-10)),_.push(new e.IntPoint2(k.left-10,k.top-10)),X.AddPath(_,e.PolyType.ptSubject,!0),X.ReverseSolution=!0,X.Execute(e.ClipType.ctUnion,O,e.PolyFillType.pftNegative,e.PolyFillType.pftNegative),O.ChildCount()===1&&O.Childs()[0].ChildCount()>0){var ft=O.Childs()[0];O.Childs()[0]=ft.Childs()[0],O.Childs()[0].m_Parent=O;for(var ht=1;ht<ft.ChildCount();ht++)O.AddChild(ft.Childs()[ht]);}else O.Clear();}}else{var O=i[0],N=i[1];e.Clear(O),this.FixOrientations(),this.DoOffset(N);var X=new e.Clipper(0);if(X.AddPaths(this.m_destPolys,e.PolyType.ptSubject,!0),N>0)X.Execute(e.ClipType.ctUnion,O,e.PolyFillType.pftPositive,e.PolyFillType.pftPositive);else{var k=e.Clipper.GetBounds(this.m_destPolys),_=new e.Path();_.push(new e.IntPoint2(k.left-10,k.bottom+10)),_.push(new e.IntPoint2(k.right+10,k.bottom+10)),_.push(new e.IntPoint2(k.right+10,k.top-10)),_.push(new e.IntPoint2(k.left-10,k.top-10)),X.AddPath(_,e.PolyType.ptSubject,!0),X.ReverseSolution=!0,X.Execute(e.ClipType.ctUnion,O,e.PolyFillType.pftNegative,e.PolyFillType.pftNegative),O.length>0&&O.splice(0,1);}}},e.ClipperOffset.prototype.OffsetPoint=function(i,m,O){if(this.m_sinA=this.m_normals[m].X*this.m_normals[i].Y-this.m_normals[i].X*this.m_normals[m].Y,Math.abs(this.m_sinA*this.m_delta)<1){var N=this.m_normals[m].X*this.m_normals[i].X+this.m_normals[i].Y*this.m_normals[m].Y;if(N>0)return this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[i].X+this.m_normals[m].X*this.m_delta),e.ClipperOffset.Round(this.m_srcPoly[i].Y+this.m_normals[m].Y*this.m_delta))),m;}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[i].X+this.m_normals[m].X*this.m_delta),e.ClipperOffset.Round(this.m_srcPoly[i].Y+this.m_normals[m].Y*this.m_delta))),this.m_destPoly.push(new e.IntPoint1(this.m_srcPoly[i])),this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[i].X+this.m_normals[i].X*this.m_delta),e.ClipperOffset.Round(this.m_srcPoly[i].Y+this.m_normals[i].Y*this.m_delta)));else switch(O){case e.JoinType.jtMiter:{var X=1+(this.m_normals[i].X*this.m_normals[m].X+this.m_normals[i].Y*this.m_normals[m].Y);X>=this.m_miterLim?this.DoMiter(i,m,X):this.DoSquare(i,m);break;}case e.JoinType.jtSquare:this.DoSquare(i,m);break;case e.JoinType.jtRound:this.DoRound(i,m);break;}return m=i,m;},e.ClipperOffset.prototype.DoSquare=function(i,m){var O=Math.tan(Math.atan2(this.m_sinA,this.m_normals[m].X*this.m_normals[i].X+this.m_normals[m].Y*this.m_normals[i].Y)/4);this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[i].X+this.m_delta*(this.m_normals[m].X-this.m_normals[m].Y*O)),e.ClipperOffset.Round(this.m_srcPoly[i].Y+this.m_delta*(this.m_normals[m].Y+this.m_normals[m].X*O)))),this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[i].X+this.m_delta*(this.m_normals[i].X+this.m_normals[i].Y*O)),e.ClipperOffset.Round(this.m_srcPoly[i].Y+this.m_delta*(this.m_normals[i].Y-this.m_normals[i].X*O))));},e.ClipperOffset.prototype.DoMiter=function(i,m,O){var N=this.m_delta/O;this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[i].X+(this.m_normals[m].X+this.m_normals[i].X)*N),e.ClipperOffset.Round(this.m_srcPoly[i].Y+(this.m_normals[m].Y+this.m_normals[i].Y)*N)));},e.ClipperOffset.prototype.DoRound=function(i,m){for(var O=Math.atan2(this.m_sinA,this.m_normals[m].X*this.m_normals[i].X+this.m_normals[m].Y*this.m_normals[i].Y),N=Math.max(e.Cast_Int32(e.ClipperOffset.Round(this.m_StepsPerRad*Math.abs(O))),1),X=this.m_normals[m].X,k=this.m_normals[m].Y,_,ft=0;ft<N;++ft)this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[i].X+X*this.m_delta),e.ClipperOffset.Round(this.m_srcPoly[i].Y+k*this.m_delta))),_=X,X=X*this.m_cos-this.m_sin*k,k=_*this.m_sin+k*this.m_cos;this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[i].X+this.m_normals[i].X*this.m_delta),e.ClipperOffset.Round(this.m_srcPoly[i].Y+this.m_normals[i].Y*this.m_delta)));},e.Error=function(i){try{throw new Error(i);}catch(m){alert(m.message);}},e.JS={},e.JS.AreaOfPolygon=function(i,m){return m||(m=1),e.Clipper.Area(i)/(m*m);},e.JS.AreaOfPolygons=function(i,m){m||(m=1);for(var O=0,N=0;N<i.length;N++)O+=e.Clipper.Area(i[N]);return O/(m*m);},e.JS.BoundsOfPath=function(i,m){return e.JS.BoundsOfPaths([i],m);},e.JS.BoundsOfPaths=function(i,m){m||(m=1);var O=e.Clipper.GetBounds(i);return O.left/=m,O.bottom/=m,O.right/=m,O.top/=m,O;},e.JS.Clean=function(N,m){if(!(N instanceof Array))return[];var O=N[0]instanceof Array,N=e.JS.Clone(N);if(typeof m!="number"||m===null)return e.Error("Delta is not a number in Clean()."),N;if(N.length===0||N.length===1&&N[0].length===0||m<0)return N;O||(N=[N]);for(var X=N.length,k,_,ft,ht,Ct,wt,Lt,Bt=[],Yt=0;Yt<X;Yt++)if(_=N[Yt],k=_.length,k!==0){if(k<3){ft=_,Bt.push(ft);continue;}for(ft=_,ht=m*m,Ct=_[0],wt=1,Lt=1;Lt<k;Lt++)(_[Lt].X-Ct.X)*(_[Lt].X-Ct.X)+(_[Lt].Y-Ct.Y)*(_[Lt].Y-Ct.Y)<=ht||(ft[wt]=_[Lt],Ct=_[Lt],wt++);Ct=_[wt-1],(_[0].X-Ct.X)*(_[0].X-Ct.X)+(_[0].Y-Ct.Y)*(_[0].Y-Ct.Y)<=ht&&wt--,wt<k&&ft.splice(wt,k-wt),ft.length&&Bt.push(ft);}return!O&&Bt.length?Bt=Bt[0]:!O&&Bt.length===0?Bt=[]:O&&Bt.length===0&&(Bt=[[]]),Bt;},e.JS.Clone=function(i){if(!(i instanceof Array))return[];if(i.length===0)return[];if(i.length===1&&i[0].length===0)return[[]];var m=i[0]instanceof Array;m||(i=[i]);var O=i.length,N,X,k,_,ft=new Array(O);for(X=0;X<O;X++){for(N=i[X].length,_=new Array(N),k=0;k<N;k++)_[k]={X:i[X][k].X,Y:i[X][k].Y};ft[X]=_;}return m||(ft=ft[0]),ft;},e.JS.Lighten=function(i,m){if(!(i instanceof Array))return[];if(typeof m!="number"||m===null)return e.Error("Tolerance is not a number in Lighten()."),e.JS.Clone(i);if(i.length===0||i.length===1&&i[0].length===0||m<0)return e.JS.Clone(i);var O=i[0]instanceof Array;O||(i=[i]);var N,X,k,_,ft,ht,Ct,wt,Lt,Bt,Yt,Ht,Vt,ee,ve,Ie,Ye,Ks=i.length,ks=m*m,Xe=[];for(N=0;N<Ks;N++)if(k=i[N],ht=k.length,ht!==0){for(_=0;_<1e6;_++){for(ft=[],ht=k.length,k[ht-1].X!==k[0].X||k[ht-1].Y!==k[0].Y?(Ht=1,k.push({X:k[0].X,Y:k[0].Y}),ht=k.length):Ht=0,Yt=[],X=0;X<ht-2;X++)Ct=k[X],Lt=k[X+1],wt=k[X+2],Ie=Ct.X,Ye=Ct.Y,Vt=wt.X-Ie,ee=wt.Y-Ye,(Vt!==0||ee!==0)&&(ve=((Lt.X-Ie)*Vt+(Lt.Y-Ye)*ee)/(Vt*Vt+ee*ee),ve>1?(Ie=wt.X,Ye=wt.Y):ve>0&&(Ie+=Vt*ve,Ye+=ee*ve)),Vt=Lt.X-Ie,ee=Lt.Y-Ye,Bt=Vt*Vt+ee*ee,Bt<=ks&&(Yt[X+1]=1,X++);for(ft.push({X:k[0].X,Y:k[0].Y}),X=1;X<ht-1;X++)Yt[X]||ft.push({X:k[X].X,Y:k[X].Y});if(ft.push({X:k[ht-1].X,Y:k[ht-1].Y}),Ht&&k.pop(),Yt.length)k=ft;else break;}ht=ft.length,ft[ht-1].X===ft[0].X&&ft[ht-1].Y===ft[0].Y&&ft.pop(),ft.length>2&&Xe.push(ft);}return O||(Xe=Xe[0]),_typeof(Xe)>"u"&&(Xe=[]),Xe;},e.JS.PerimeterOfPath=function(i,m,O){if(_typeof(i)>"u")return 0;var N=Math.sqrt,X=0,k,_,ft=0,ht=0,Ct=0,wt=0,Lt=i.length;if(Lt<2)return 0;for(m&&(i[Lt]=i[0],Lt++);--Lt;)k=i[Lt],ft=k.X,ht=k.Y,_=i[Lt-1],Ct=_.X,wt=_.Y,X+=N((ft-Ct)*(ft-Ct)+(ht-wt)*(ht-wt));return m&&i.pop(),X/O;},e.JS.PerimeterOfPaths=function(i,m,O){O||(O=1);for(var N=0,X=0;X<i.length;X++)N+=e.JS.PerimeterOfPath(i[X],m,O);return N;},e.JS.ScaleDownPath=function(i,m){var O,N;for(m||(m=1),O=i.length;O--;)N=i[O],N.X=N.X/m,N.Y=N.Y/m;},e.JS.ScaleDownPaths=function(i,m){var O,N,X;for(m||(m=1),O=i.length;O--;)for(N=i[O].length;N--;)X=i[O][N],X.X=X.X/m,X.Y=X.Y/m;},e.JS.ScaleUpPath=function(i,m){var O,N,X=Math.round;for(m||(m=1),O=i.length;O--;)N=i[O],N.X=X(N.X*m),N.Y=X(N.Y*m);},e.JS.ScaleUpPaths=function(i,m){var O,N,X,k=Math.round;for(m||(m=1),O=i.length;O--;)for(N=i[O].length;N--;)X=i[O][N],X.X=k(X.X*m),X.Y=k(X.Y*m);},e.ExPolygons=function(){return[];},e.ExPolygon=function(){this.outer=null,this.holes=null;},e.JS.AddOuterPolyNodeToExPolygons=function(i,m){var O=new e.ExPolygon();O.outer=i.Contour();var N=i.Childs(),X=N.length;O.holes=new Array(X);var k,_,ft,ht,Ct,wt;for(ft=0;ft<X;ft++)for(k=N[ft],O.holes[ft]=k.Contour(),ht=0,Ct=k.Childs(),wt=Ct.length;ht<wt;ht++)_=Ct[ht],e.JS.AddOuterPolyNodeToExPolygons(_,m);m.push(O);},e.JS.ExPolygonsToPaths=function(i){var m,O,N,X,k=new e.Paths();for(m=0,N=i.length;m<N;m++)for(k.push(i[m].outer),O=0,X=i[m].holes.length;O<X;O++)k.push(i[m].holes[O]);return k;},e.JS.PolyTreeToExPolygons=function(i){var m=new e.ExPolygons(),O,N,X,k;for(N=0,X=i.Childs(),k=X.length;N<k;N++)O=X[N],e.JS.AddOuterPolyNodeToExPolygons(O,m);return m;};})();})(zi);var Hp=zi.exports,Me=/* @__PURE__ */Ne(Hp);function $i(u,e){var t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0.01;return Math.abs(u[0]-e[0])<t&&Math.abs(u[1]-e[1])<t;}function Vp(u){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.01;if(u.length===0)return[];var t=[[u[0][0],u[0][1]]];for(var r=1;r<u.length;r++)$i([u[r][0],u[r][1]],t[t.length-1],e)||t.push([u[r][0],u[r][1]]);return t;}function Kp(u){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.01;if(u.length<=2)return u;var t=u[0],r=u[u.length-1];return $i(t,r,e)?u.slice(0,-1):u;}function kp(u){var e=u.reduce(function(r,n){return r+n[0];},0)/u.length,t=u.reduce(function(r,n){return r+n[1];},0)/u.length;return[e,t];}function Hn(u,e){return Math.atan2(e[1]-u[1],e[0]-u[0]);}function Zp(u){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.01;if(u.length<=2)return u;var t=[];var _iterator16=_createForOfIteratorHelper(u),_step16;try{var _loop3=function _loop3(){var n=_step16.value;t.some(function(l){return Math.abs(l[0]-n[0])<e&&Math.abs(l[1]-n[1])<e;})||t.push([n[0],n[1]]);};for(_iterator16.s();!(_step16=_iterator16.n()).done;){_loop3();}}catch(err){_iterator16.e(err);}finally{_iterator16.f();}var r=kp(t);return t.sort(function(n,s){var l=Hn(r,n),o=Hn(r,s);return l-o;});}function Jp(u,e){var t=e[0].x<e[e.length-1].x;return u.map(function(n){var l=n.map(function(o){var a=-1,c=1/0,y=0;for(var f=0;f<e.length;f++){var g=e[f],x=Math.sqrt(Math.pow(g.x-o[0],2)+Math.pow(g.y-o[1],2));x<c&&(c=x,a=f,y=g.z);}return{point:o,index:a,bestZ:y};}).sort(function(o,a){return o.index-a.index;}).map(function(o){return[].concat(_toConsumableArray(o.point),[o.bestZ]);});return t&&l[0][0]>l[l.length-1][0]||!t&&l[0][0]<l[l.length-1][0]?l.reverse():l;}).sort(function(n,s){var l=n[0][0],o=s[0][0];return t?l-o:o-l;});}function Qp(u,e){var t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0.01;var n=u.map(function(f){return[f.x,f.y];}),s=function s(f,g){return f.map(function(_ref166){var _ref167=_slicedToArray(_ref166,2),x=_ref167[0],M=_ref167[1];return{X:Math.round(x*g),Y:Math.round(M*g)};});},l=new Me.ClipperOffset();l.AddPath(s(n,1e3),Me.JoinType.jtRound,Me.EndType.etOpenButt);var o=[];l.Execute(o,1);var a=new Me.Clipper();a.AddPaths(o,Me.PolyType.ptSubject,!0),e.forEach(function(f){a.AddPath(s(f,1e3),Me.PolyType.ptClip,!0);});var c=new Me.Paths();a.Execute(Me.ClipType.ctDifference,c,Me.PolyFillType.pftNonZero,Me.PolyFillType.pftNonZero);var y=c.map(function(f){return Kp(Zp(Vp(f.map(function(g){return[g.X/1e3,g.Y/1e3];}),t),t),t);}).filter(function(f){return f.length>=2;});return Jp(y,u);}var Gi=/*#__PURE__*/function(_Et){function Gi(t){var _this62;_classCallCheck(this,Gi);_this62=_callSuper(this,Gi,[t]);at(_this62,"canRotate",!0);at(_this62,"scaleType",Qt.all);at(_this62,"toolsType",xt.Pencil);at(_this62,"syncTimestamp");at(_this62,"syncIndex",0);at(_this62,"tmpPoints",[]);at(_this62,"MAX_REPEAR",10);/** 合并原始点的灵敏度 */at(_this62,"uniThickness");at(_this62,"workOptions");at(_this62,"centerPos",[0,0]);_this62.workOptions=t.toolsOpt,_this62.uniThickness=_this62.MAX_REPEAR/_this62.workOptions.thickness/10,_this62.syncTimestamp=0;return _this62;}/** 批量合并消费本地数据,返回绘制结果 */_inherits(Gi,_Et);return _createClass(Gi,[{key:"combineConsume",value:function combineConsume(){var o;var t=(o=this.workId)==null?void 0:o.toString();if(this.tmpPoints.length<2)return{type:dt.None};var r=this.transformDataAll(!0),n={name:t};var s;var l=this.drawLayer||this.fullLayer;return r.length&&(s=this.draw({attrs:n,tasks:r,replaceId:t,layer:l})),{rect:s,type:dt.DrawWork,dataType:bt.Local};}},{key:"setWorkOptions",value:function setWorkOptions(t){_superPropGet(Gi,"setWorkOptions",this,3)([t]),this.syncTimestamp=Date.now();}},{key:"consume",value:function consume(t){var _this63=this;var r=t.data,n=t.isFullWork,s=t.isSubWorker,l=t.isMainThread,o=t.drawCount,a=t.removeDrawCount,c=r.workId,y=r.syncUnitTime;y&&(this.syncUnitTime=y);var _this$transformData=this.transformData(r,!1),f=_this$transformData.tasks,g=_this$transformData.effects,x=_this$transformData.consumeIndex;this.syncIndex=Math.min(this.syncIndex,x,Math.max(0,this.tmpPoints.length-2));var M={name:c,id:ue(o)&&o.toString()||void 0};var S,P=!1;var C=this.syncIndex;if(this.syncTimestamp===0&&(this.syncTimestamp=Date.now()),f.length&&(f[0].taskId-this.syncTimestamp>this.syncUnitTime&&(P=!0,this.syncTimestamp=f[0].taskId,this.syncIndex=this.tmpPoints.length),s||l)){var p=n?this.fullLayer:this.drawLayer||this.fullLayer;S=this.draw({attrs:M,tasks:f,effects:g,layer:p,removeDrawCount:a});}if(s)return x>10&&this.tmpPoints.splice(0,x-10),{rect:S,type:dt.DrawWork,dataType:bt.Local};var h=[];return this.tmpPoints.slice(C).forEach(function(p){h.push(p.x,p.y,_this63.computRadius(p.z,_this63.workOptions.thickness));}),_objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:dt.DrawWork,dataType:bt.Local,rect:S,op:P?h:void 0,index:P?C*3:void 0,updateNodeOpt:{useAnimation:!0}});}},{key:"consumeAll",value:function consumeAll(t){var y;var r=this.workId;if(t.data){var _t$data=t.data,f=_t$data.op,g=_t$data.workState;f!=null&&f.length&&g===Ft.Done&&this.workOptions.strokeType===Kt.Stroke&&this.updateTempPointsWithPressureWhenDone(f);}var n=this.transformDataAll(!0),s={name:r};var l;var o=this.fullLayer;if(n.length&&(l=this.draw({attrs:s,tasks:n,replaceId:r,layer:o})),this.tmpPoints.length<2)return this.replace(o,r),{type:dt.RemoveNode,removeIds:[r],rect:l};var a=[];this.tmpPoints.map(function(f){a.push(f.x,f.y,f.z);}),this.syncTimestamp=0,delete this.workOptions.syncUnitTime;var c=ye(a);return(y=this.vNodes)==null||y.setInfo(r,{rect:l,op:a,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:l&&Et.getCenterPos(l,o)}),_objectSpread(_objectSpread({},this.baseConsumeResult),{},{rect:l,type:dt.FullWork,dataType:bt.Local,ops:c,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 f,g;var r=t.op,n=t.isFullWork,s=t.replaceId,_t$workState=t.workState,l=_t$workState===void 0?Ft.Done:_t$workState;this.tmpPoints.length=0;for(var x=0;x<r.length;x+=3){var M=new Dt(r[x],r[x+1],r[x+2]);if(this.tmpPoints.length>0){var S=this.tmpPoints[this.tmpPoints.length-1],P=ot.Sub(M,S).uni();M.setv(P);}this.tmpPoints.push(M);}if(this.tmpPoints.length<2)return;var o=this.transformDataAll(!0),a=(f=this.workId)==null?void 0:f.toString(),c={name:a};var y;if(a&&o.length){var _x30=n?this.fullLayer:this.drawLayer||this.fullLayer;y=this.draw({attrs:c,tasks:o,replaceId:s,layer:_x30,isDrawEraserlines:l===Ft.Done}),(g=this.vNodes)==null||g.setInfo(a,{rect:y,op:r,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:y&&Et.getCenterPos(y,_x30)});}return y;}},{key:"computPencilPoints",value:function computPencilPoints(t){var _this64=this;var r=[],n=t.op,s=t.eraserPolylines,l=t.eraserThickness;this.tmpPoints.length=0;for(var a=0;a<n.length;a+=3){var c=new Dt(n[a],n[a+1],n[a+2]);if(this.tmpPoints.length>0){var y=this.tmpPoints[this.tmpPoints.length-1],f=ot.Sub(c,y).uni();c.setv(f);}this.tmpPoints.push(c);}if(this.tmpPoints.length<2)return;var o=this.transformDataAll(!0);if(o.length){var _loop4=function _loop4(){var _o$_a=o[_a5],c=_o$_a.pos,y=_o$_a.points,f=y.map(function(M){return M.point.addXY(c[0],c[1]);}),g=[];var _iterator17=_createForOfIteratorHelper(s),_step17;try{for(_iterator17.s();!(_step17=_iterator17.n()).done;){var M=_step17.value;var S=[];for(var _C29=0;_C29<M.length;_C29+=2){var _h27=new Dt(M[_C29],M[_C29+1]);if(S.length>0){var p=S[S.length-1].point,d=ot.Sub(_h27,p).uni();_h27.setv(d);}S.push({point:_h27,radius:l});}var _this64$computStroke=_this64.computStroke(S,!1),P=_this64$computStroke.ps;g.push(P.map(function(C){return C.XY;}));}}catch(err){_iterator17.e(err);}finally{_iterator17.f();}Qp(f,g,0.01).forEach(function(M){r.push(M.map(function(S){return[S[0],S[1],S[2]];}).flat(1));});};for(var _a5=0;_a5<o.length;_a5++){_loop4();}}return r;}},{key:"transformDataAll",value:function transformDataAll(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;var r=this.filterSamePoints(this.tmpPoints,this.workOptions.thickness);return this.getTaskPoints(r,t&&this.workOptions.thickness||void 0);}},{key:"draw",value:function draw(t){var _this65=this;var r=t.attrs,n=t.tasks,s=t.replaceId,l=t.effects,o=t.layer,a=t.removeDrawCount,_t$isDrawEraserlines=t.isDrawEraserlines,c=_t$isDrawEraserlines===void 0?!0:_t$isDrawEraserlines,_this$workOptions=this.workOptions,y=_this$workOptions.strokeColor,f=_this$workOptions.strokeType,g=_this$workOptions.thickness,x=_this$workOptions.zIndex,M=_this$workOptions.scale,S=_this$workOptions.rotate,P=_this$workOptions.translate,C=_this$workOptions.eraserlines;l!=null&&l.size&&(l.forEach(function(L){var w;(w=o.getElementById(L+""))==null||w.remove();}),l.clear()),a&&this.removeDrawCountNodes(o,a);var h;var p=[],d=o.worldPosition,v=o.worldScaling;for(var L=0;L<n.length;L++){var _n$L=n[L],w=_n$L.pos,B=_n$L.points,_this$computDrawPoint=this.computDrawPoints(B),E=_this$computDrawPoint.ps,b=_this$computDrawPoint.rect;var W=void 0;var D=B.length===1;f===Kt.Stroke||D?W=De(E,!0):W=De(E,!1);var R={pos:w,d:W,fillColor:f===Kt.Stroke||D?y:void 0,lineDash:f===Kt.Dotted&&!D?[1,g*2]:f===Kt.LongDotted&&!D?[g,g*2]:void 0,strokeColor:y,lineCap:f===Kt.Stroke||D?void 0:"round",lineWidth:f===Kt.Stroke||D?0:g};h=Wt(h,{x:Math.floor((b.x+w[0])*v[0]+d[0]-Et.SafeBorderPadding),y:Math.floor((b.y+w[1])*v[1]+d[1]-Et.SafeBorderPadding),w:Math.floor(b.w*v[0]+2*Et.SafeBorderPadding),h:Math.floor(b.h*v[1]+2*Et.SafeBorderPadding)}),p.push(R);}M&&(r.scale=M),S&&(r.rotate=S),P&&(r.translate=P);var I=new me();if(h){this.centerPos=Et.getCenterPos(h,o);var _L4=f===Kt.Stroke&&!C;I.attr(_objectSpread(_objectSpread({},r),{},{normalize:!0,anchor:[0.5,0.5],bgcolor:_L4?y:void 0,pos:this.centerPos,size:[(h.w-2*Et.SafeBorderPadding)/v[0],(h.h-2*Et.SafeBorderPadding)/v[1]],zIndex:x}));var _w5=p.map(function(B){return B.pos=[B.pos[0]-_this65.centerPos[0],B.pos[1]-_this65.centerPos[1]],new be(B);});I.append.apply(I,_toConsumableArray(_w5)),_L4&&I.seal(),C&&(this.scaleType=Qt.proportional,this.drawEraserlines({group:I,eraserlines:C,pos:this.centerPos,layer:o},c)),this.replace(o,s,I);}if(M||S||P){var _L5=I==null?void 0:I.getBoundingClientRect();_L5&&(h={x:Math.floor(_L5.x-Et.SafeBorderPadding),y:Math.floor(_L5.y-Et.SafeBorderPadding),w:Math.floor(_L5.width+Et.SafeBorderPadding*2),h:Math.floor(_L5.height+Et.SafeBorderPadding*2)});}return this.isDelete&&I.setAttribute("opacity",0),h;}},{key:"computDrawPoints",value:function computDrawPoints(t){return this.workOptions.strokeType===Kt.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:_t(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 a=0;a<t.length;a++){var _t$a=t[a],c=_t$a.point,y=_t$a.radius;var f=c.v;a===0&&t.length>1&&(f=t[a+1].point.v);var g=ot.Per(f).mul(y);n.push(Dt.Sub(c,g)),s.push(Dt.Add(c,g));}var l=t[t.length-1];if(r){var _a6=Dt.GetSemicircleStroke(l.point,n[n.length-1],-1,8),_c4=Dt.GetSemicircleStroke(t[0].point,s[0],-1,8),_y6=n.concat(_a6,s.reverse(),_c4);return{ps:_y6,rect:_t(_y6)};}var o=n.concat(s.reverse());return{ps:o,rect:_t(o)};}},{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:Dt.GetDotStroke(r,n,8),rect:s};}},{key:"transformData",value:function transformData(t,r){var n=t.op,s=t.workState;var l=this.tmpPoints.length-1,o=[];if(n!=null&&n.length&&s){var _this$workOptions2=this.workOptions,a=_this$workOptions2.strokeType,c=_this$workOptions2.thickness,y=/* @__PURE__ */new Set();l=a===Kt.Stroke?this.updateTempPointsWithPressure(n,c,y):this.updateTempPoints(n,c,y);var f=r?this.tmpPoints:this.tmpPoints.slice(l);return o=this.getTaskPoints(f,c),{tasks:o,effects:y,consumeIndex:l};}return{tasks:o,consumeIndex:l};}/** 压力渐变公式 */},{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 f;var n=[];if(t.length===0)return[];var s=0,l=t[0].x,o=t[0].y,a=[l,o],c=[],y=t[0].t;for(;s<t.length;){var g=t[s],x=g.x-l,M=g.y-o,S=g.z,P=r?this.computRadius(S,r):S;if(c.push({point:new Dt(x,M,S,t[s].v),radius:P}),s>0&&s<t.length-1){var _C30=t[s].getAngleByPoints(t[s-1],t[s+1]);if(_C30<60||_C30>300){var _h28=(f=c.pop())==null?void 0:f.point.clone();_h28&&n.push({taskId:y,pos:a,points:[].concat(_toConsumableArray(c),[{point:_h28,radius:P}])}),l=t[s].x,o=t[s].y,a=[l,o];var p=g.x-l,d=g.y-o;c=[{point:new Dt(p,d,S),radius:P}],y=Date.now();}}s++;}return n.push({taskId:y,pos:a,points:c}),n;}},{key:"updateTempPointsWithPressure",value:function updateTempPointsWithPressure(t,r,n){var s=Date.now(),l=this.tmpPoints.length;var o=l;for(var c=0;c<t.length;c+=2){o=Math.min(o,l);var y=this.tmpPoints.length,f=new Dt(t[c],t[c+1]);if(y===0){this.tmpPoints.push(f);continue;}var g=y-1,x=this.tmpPoints[g],M=ot.Sub(f,x).uni();if(f.isNear(x,r)){if(x.z<this.MAX_REPEAR){if(x.setz(Math.min(x.z+1,this.MAX_REPEAR)),o=Math.min(o,g),y>1){var _C31=y-1;for(;_C31>0;){var _h29=this.tmpPoints[_C31].distance(this.tmpPoints[_C31-1]),p=Math.max(this.tmpPoints[_C31].z-this.uniThickness*_h29,0);if(this.tmpPoints[_C31-1].z>=p)break;this.tmpPoints[_C31-1].setz(p),o=Math.min(o,_C31-1),_C31--;}}}else o=1/0;continue;}f.setv(M);var S=f.distance(x),P=Math.max(x.z-this.uniThickness*S,0);y>1&&ot.Equals(M,x.v,0.02)&&(P>0||x.z<=0)&&(n&&x.t&&n.add(x.t),this.tmpPoints.pop(),o=Math.min(g,o)),f.setz(P),this.tmpPoints.push(f);}if(o===1/0)return this.tmpPoints.length;var a=l;if(o===l){a=Math.max(a-1,0);var _c5=this.tmpPoints[a].t;_c5&&(n==null||n.add(_c5));}else{var _c6=l-1;for(a=o;_c6>=0;){var _y7=this.tmpPoints[_c6].t;if(_y7&&(n==null||n.add(_y7),_c6<=o)){a=_c6,_c6=-1;break;}_c6--;}}return this.tmpPoints[a].setT(s),a;}},{key:"updateTempPoints",value:function updateTempPoints(t,r,n){var c;var s=Date.now(),l=this.tmpPoints.length;var o=l;for(var y=0;y<t.length;y+=2){var f=this.tmpPoints.length,g=new Dt(t[y],t[y+1]);if(f===0){this.tmpPoints.push(g);continue;}var x=f-1,M=this.tmpPoints[x],S=ot.Sub(g,M).uni();if(g.isNear(M,r/2)){o=Math.min(x,o);continue;}ot.Equals(S,M.v,0.02)&&(n&&M.t&&n.add(M.t),this.tmpPoints.pop(),o=Math.min(x,o)),g.setv(S),this.tmpPoints.push(g);}var a=l;if(o===l){a=Math.max(a-1,0);var _y8=this.tmpPoints[a].t;_y8&&(n==null||n.add(_y8));}else{var _y9=Math.min(l-1,o);for(a=o;_y9>=0;){var _f4=(c=this.tmpPoints[_y9])==null?void 0:c.t;if(_f4&&(n==null||n.add(_f4),_y9<=o)){a=_y9,_y9=-1;break;}_y9--;}}return this.tmpPoints[a].setT(s),a;}},{key:"updateTempPointsWithPressureWhenDone",value:function updateTempPointsWithPressureWhenDone(t){var r=this.workOptions.thickness,n=t.length,s=this.getMinZ(r);for(var l=0;l<n;l+=2){var o=this.tmpPoints.length,a=new Dt(t[l],t[l+1]);if(o===0){this.tmpPoints.push(a);continue;}var c=o-1,y=this.tmpPoints[c],f=ot.Sub(a,y).uni(),g=a.distance(y);if(o>1&&y.z===s)break;if(a.isNear(y,r/2)){if(n<3&&y.z<this.MAX_REPEAR&&(y.setz(Math.min(y.z+1,this.MAX_REPEAR)),o>1)){var M=o-1;for(;M>0;){var S=this.tmpPoints[M].distance(this.tmpPoints[M-1]),P=Math.max(this.tmpPoints[M].z-this.uniThickness*S,-r/4);if(this.tmpPoints[M-1].z>=P)break;this.tmpPoints[M-1].setz(P),M--;}}continue;}a.setv(f);var x=Math.max(y.z-this.uniThickness*g,s);o>1&&ot.Equals(f,y.v,0.02)&&y.z<=0&&this.tmpPoints.pop(),a.setz(x),this.tmpPoints.push(a);}}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var c,y;var r=t.node,n=t.opt,s=t.vNodes,l=n.strokeColor,o=n.strokeType,a=s.get(r.name);return l&&(r.tagName==="GROUP"?gm(r)?r.setAttribute("bgcolor",l):r.children.forEach(function(f){f.setAttribute("strokeColor",l),f.getAttribute("fillColor")&&f.setAttribute("fillColor",l);}):(r.setAttribute("strokeColor",l),r.setAttribute("fillColor",l)),(c=a==null?void 0:a.opt)!=null&&c.strokeColor&&(a.opt.strokeColor=l)),o&&a!=null&&a.opt&&(y=a.opt)!=null&&y.strokeType&&(a.opt.strokeType=o),a&&s.setInfo(r.name,a),Et.updateNodeOpt(t);}}]);}(Et);var Hi=/*#__PURE__*/function(_Et2){function Hi(t){var _this66;_classCallCheck(this,Hi);_this66=_callSuper(this,Hi,[t]);at(_this66,"toolsType",xt.LaserPen);at(_this66,"canRotate",!1);at(_this66,"scaleType",Qt.none);at(_this66,"syncTimestamp");at(_this66,"syncIndex",0);at(_this66,"tmpPoints",[]);at(_this66,"workOptions");at(_this66,"consumeIndex",0);_this66.workOptions=t.toolsOpt,_this66.syncTimestamp=0;return _this66;}_inherits(Hi,_Et2);return _createClass(Hi,[{key:"combineConsume",value:function combineConsume(){}},{key:"setWorkOptions",value:function setWorkOptions(t){_superPropGet(Hi,"setWorkOptions",this,3)([t]),this.syncTimestamp=Date.now();}},{key:"consume",value:function consume(t){var r=t.data,n=t.isSubWorker,s=r.workId,l=r.op,o=r.syncUnitTime;if((l==null?void 0:l.length)===0)return{type:dt.None};if(o&&(this.syncUnitTime=o),this.updateTempPoints(l||[]),this.consumeIndex>this.tmpPoints.length-4)return{type:dt.None};var _this$workOptions3=this.workOptions,a=_this$workOptions3.strokeColor,c=_this$workOptions3.thickness,y=_this$workOptions3.strokeType,f=_t(this.tmpPoints,c);var g=!1;var x=this.syncIndex,M=this.tmpPoints.slice(this.consumeIndex);this.consumeIndex=this.tmpPoints.length-1,this.syncTimestamp===0&&(this.syncTimestamp=Date.now());var S={name:s==null?void 0:s.toString(),opacity:1,lineDash:y===Kt.Dotted?[1,c*2]:y===Kt.LongDotted?[c,c*2]:void 0,strokeColor:a,lineCap:"round",lineWidth:c,anchor:[0.5,0.5]},P=this.getTaskPoints(M);if(P.length){var _h30=Date.now();_h30-this.syncTimestamp>this.syncUnitTime&&(g=!0,this.syncTimestamp=_h30,this.syncIndex=this.tmpPoints.length),n&&this.draw({attrs:S,tasks:P,isDot:!1,layer:this.drawLayer||this.fullLayer});}var C=[];return this.tmpPoints.slice(x).forEach(function(h){C.push(h.x,h.y);}),_objectSpread({rect:{x:f.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:f.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:f.w*this.fullLayer.worldScaling[0],h:f.h*this.fullLayer.worldScaling[1]},type:dt.DrawWork,dataType:bt.Local,op:g?C:void 0,index:g?x*2:void 0},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var l;var t=(l=this.workId)==null?void 0:l.toString();var r;if(this.tmpPoints.length-1>this.consumeIndex){var o=this.tmpPoints.slice(this.consumeIndex);var a=o.length===1,_this$workOptions4=this.workOptions,c=_this$workOptions4.strokeColor,y=_this$workOptions4.thickness,f=_this$workOptions4.strokeType;if(a){var M=this.computDotStroke({point:o[0],radius:y/2});o=M.ps,r=M.rect;}else r=_t(this.tmpPoints,y);var g={name:t==null?void 0:t.toString(),fillColor:a?c:void 0,opacity:1,lineDash:f===Kt.Dotted&&!a?[1,y*2]:f===Kt.LongDotted&&!a?[y,y*2]:void 0,strokeColor:c,lineCap:a?void 0:"round",lineWidth:a?0:y,anchor:[0.5,0.5]},x=this.getTaskPoints(o);x.length&&this.draw({attrs:g,tasks:x,isDot:a,layer:this.drawLayer||this.fullLayer});}var n=[];this.tmpPoints.forEach(function(o){n.push(o.x,o.y);});var s=ye(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:dt.FullWork,dataType:bt.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 S;var r=t.op,n=t.replaceId,s=t.isFullWork,_this$workOptions5=this.workOptions,l=_this$workOptions5.strokeColor,o=_this$workOptions5.thickness,a=_this$workOptions5.strokeType;if(!r.length){var P=_t(this.tmpPoints,o);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 c=Math.max(0,this.tmpPoints.length-1);this.updateTempPoints(r||[]);var y,f=this.tmpPoints.slice(c);var g=f.length===1;if(g){var _P6=this.computDotStroke({point:f[0],radius:o/2});f=_P6.ps,y=_P6.rect;}else y=_t(this.tmpPoints,o);var x={name:(S=this.workId)==null?void 0:S.toString(),fillColor:g?l:void 0,opacity:1,lineDash:a===Kt.Dotted&&!g?[1,o*2]:a===Kt.LongDotted&&!g?[o,o*2]:void 0,strokeColor:l,lineCap:g?void 0:"round",lineWidth:g?0:o,anchor:[0.5,0.5]},M=this.getTaskPoints(f);if(M.length){var _P7=s?this.fullLayer:this.drawLayer||this.fullLayer;this.draw({attrs:x,tasks:M,isDot:g,replaceId:n,layer:_P7});}return{x:y.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:y.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:y.w*this.fullLayer.worldScaling[0],h:y.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:Dt.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 Dt(t[n],t[n+1]));}}},{key:"draw",value:function(){var _draw2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee21(t){var _this67=this;var r,n,s,l,o,_iterator18,_step18,_loop5;return _regeneratorRuntime().wrap(function _callee21$(_context23){while(1)switch(_context23.prev=_context23.next){case 0:r=t.attrs,n=t.tasks,s=t.isDot,l=t.layer,o=this.workOptions.duration;_iterator18=_createForOfIteratorHelper(n);_context23.prev=2;_loop5=/*#__PURE__*/_regeneratorRuntime().mark(function _loop5(){var a,c,y,f,g,_this67$workOptions,x,M,S,_l$getResolution,P,_C32;return _regeneratorRuntime().wrap(function _loop5$(_context22){while(1)switch(_context22.prev=_context22.next){case 0:a=_step18.value;c=new be(),y=a.pos,f=a.points;s?g=De(f,!0):g=De(f,!1),c.attr(_objectSpread(_objectSpread({},r),{},{pos:y,d:g}));_this67$workOptions=_this67.workOptions,x=_this67$workOptions.vertex,M=_this67$workOptions.fragment;if(x&&M){S=l.renderer.createProgram({vertex:x,fragment:M}),_l$getResolution=l.getResolution(),P=_l$getResolution.width,_C32=_l$getResolution.height;c.setUniforms({u_time:0,u_resolution:[P,_C32]}),c.setProgram(S);}l.appendChild(c),c.transition(o).attr({scale:s?[0.1,0.1]:[1,1],lineWidth:s?0:1}).then(function(){c.remove();});case 6:case"end":return _context22.stop();}},_loop5);});_iterator18.s();case 5:if((_step18=_iterator18.n()).done){_context23.next=9;break;}return _context23.delegateYield(_loop5(),"t0",7);case 7:_context23.next=5;break;case 9:_context23.next=14;break;case 11:_context23.prev=11;_context23.t1=_context23["catch"](2);_iterator18.e(_context23.t1);case 14:_context23.prev=14;_iterator18.f();return _context23.finish(14);case 17:case"end":return _context23.stop();}},_callee21,this,[[2,11,14,17]]);}));function draw(_x31){return _draw2.apply(this,arguments);}return draw;}()},{key:"getTaskPoints",value:function getTaskPoints(t){var c;var r=[];if(t.length===0)return[];var n=0,s=t[0].x,l=t[0].y,o=[s,l],a=[];for(;n<t.length;){var y=t[n],f=y.x-s,g=y.y-l;if(a.push(new Dt(f,g)),n>0&&n<t.length-1){var x=t[n].getAngleByPoints(t[n-1],t[n+1]);if(x<60||x>300){var M=(c=a.pop())==null?void 0:c.clone();M&&r.push({pos:o,points:[].concat(_toConsumableArray(a),[M])}),s=t[n].x,l=t[n].y,o=[s,l];var S=y.x-s,P=y.y-l;a=[new Dt(S,P)];}}n++;}return r.push({pos:o,points:a}),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 l=s.getBoundingClientRect();r=Wt(r,{x:l.x,y:l.y,w:l.width,h:l.height}),n.push(s);}}),n.length&&n.forEach(function(s){return s.remove();}),r;}}]);}(Et);var qp=Sr;Sr.polyline=Sr;Sr.polygon=_p;function Sr(u,e,t){var r=u.length,n=Ge(u[0],e),s=[],l,o,a,c,y;for(t||(t=[]),l=1;l<r;l++){for(o=u[l-1],a=u[l],c=y=Ge(a,e);;)if(n|c){if(n&c)break;n?(o=Kr(o,a,n,e),n=Ge(o,e)):(a=Kr(o,a,c,e),c=Ge(a,e));}else{s.push(o),c!==y?(s.push(a),l<r-1&&(t.push(s),s=[])):l===r-1&&s.push(a);break;}n=y;}return s.length&&t.push(s),t;}function _p(u,e){var t,r,n,s,l,o,a;for(r=1;r<=8;r*=2){for(t=[],n=u[u.length-1],s=!(Ge(n,e)&r),l=0;l<u.length;l++)o=u[l],a=!(Ge(o,e)&r),a!==s&&t.push(Kr(n,o,r,e)),a&&t.push(o),n=o,s=a;if(u=t,!u.length)break;}return t;}function Kr(u,e,t,r){return t&8?[u[0]+(e[0]-u[0])*(r[3]-u[1])/(e[1]-u[1]),r[3]]:// top
|
|
404
|
+
t&4?[u[0]+(e[0]-u[0])*(r[1]-u[1])/(e[1]-u[1]),r[1]]:// bottom
|
|
405
|
+
t&2?[r[2],u[1]+(e[1]-u[1])*(r[2]-u[0])/(e[0]-u[0])]:// right
|
|
406
|
+
t&1?[r[0],u[1]+(e[1]-u[1])*(r[0]-u[0])/(e[0]-u[0])]:// left
|
|
407
|
+
null;}function Ge(u,e){var t=0;return u[0]<e[0]?t|=1:u[0]>e[2]&&(t|=2),u[1]<e[1]?t|=4:u[1]>e[3]&&(t|=8),t;}var fn=/* @__PURE__ */Ne(qp);var Ve=/*#__PURE__*/function(_Et3){function Ve(t,r){var _this68;_classCallCheck(this,Ve);_this68=_callSuper(this,Ve,[t]);at(_this68,"canRotate",!1);at(_this68,"scaleType",Qt.none);at(_this68,"toolsType",xt.Eraser);at(_this68,"serviceWork");at(_this68,"tmpPoints",[]);at(_this68,"workOptions");at(_this68,"worldPosition");at(_this68,"worldScaling");at(_this68,"eraserRect");at(_this68,"eraserPolyline");_this68.serviceWork=r,_this68.workOptions=t.toolsOpt,_this68.worldPosition=_this68.fullLayer.worldPosition,_this68.worldScaling=_this68.fullLayer.worldScaling;return _this68;}_inherits(Ve,_Et3);return _createClass(Ve,[{key:"combineConsume",value:function combineConsume(){}},{key:"consumeService",value:function consumeService(){}},{key:"setWorkOptions",value:function setWorkOptions(t){_superPropGet(Ve,"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],_Ve$eraserSizes$this$=Ve.eraserSizes[this.workOptions.thickness],s=_Ve$eraserSizes$this$.width,l=_Ve$eraserSizes$this$.height;this.eraserRect={x:r-s*0.5,y:n-l*0.5,w:s,h:l},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 ot(this.tmpPoints[0],this.tmpPoints[1]),n=new ot(this.tmpPoints[2],this.tmpPoints[3]),s=ot.Sub(n,r).uni(),l=ot.Dist(r,n),_Ve$eraserSizes$this$2=Ve.eraserSizes[this.workOptions.thickness],o=_Ve$eraserSizes$this$2.width,a=_Ve$eraserSizes$this$2.height,c=Math.min(o,a),y=Math.round(l/c);if(y>1){var f=[];for(var g=0;g<y;g++){var x=ot.Mul(s,g*c);f.push(this.tmpPoints[0]+x.x,this.tmpPoints[1]+x.y);}return f.concat(t);}}return t;}},{key:"isNear",value:function isNear(t,r){var n=new ot(t[0],t[1]),s=new ot(r[0],r[1]),_Ve$eraserSizes$this$3=Ve.eraserSizes[this.workOptions.thickness],l=_Ve$eraserSizes$this$3.width,o=_Ve$eraserSizes$this$3.height;return ot.Dist(n,s)<Math.hypot(l,o)*0.5;}},{key:"remove",value:function remove(t){var _this69=this;var r=t.curNodeMap,n=t.removeIds;var s;var _iterator19=_createForOfIteratorHelper(r.values()),_step19;try{for(_iterator19.s();!(_step19=_iterator19.n()).done;){var l=_step19.value;if(l.rect&&this.eraserRect&&this.eraserPolyline&&kr(this.eraserRect,l.rect)){var o=l.op,a=[],c=[];for(var f=0;f<o.length;f+=3){var g=new ot(o[f]*this.worldScaling[0]+this.worldPosition[0],o[f+1]*this.worldScaling[1]+this.worldPosition[1],o[f+2]);c.push(g),a.push(new Dt(g.x,g.y));}var y=a.length&&_t(a)||l.rect;kr(y,this.eraserRect)&&(c.length>1?fn.polyline(c.map(function(g){return g.XY;}),this.eraserPolyline).length&&n.add(l.name):n.add(l.name),s=Wt(s,l.rect||y));}}}catch(err){_iterator19.e(err);}finally{_iterator19.f();}return n.forEach(function(l){var a;var o=_this69.fullLayer.getElementsByName(l);o[0]&&(o[0].remove(),_pe(o[0],_this69.fullLayer.parent),(a=_this69.vNodes)==null||a["delete"](l));}),s&&(s.x-=Et.SafeBorderPadding,s.y-=Et.SafeBorderPadding,s.w+=Et.SafeBorderPadding*2,s.h+=Et.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:dt.None},this.baseConsumeResult);var l=this.tmpPoints.length;if(l>1&&this.isNear([r[0],r[1]],[this.tmpPoints[l-2],this.tmpPoints[l-1]]))return _objectSpread({type:dt.None},this.baseConsumeResult);l<3?this.tmpPoints.push(r[0],r[1]):this.tmpPoints.splice(2,2,r[0],r[1]);var o=this.computRectCenterPoints();var a;var c=/* @__PURE__ */new Set();if(!this.vNodes)return _objectSpread({type:dt.None},this.baseConsumeResult);var y=this.getCanEraserNodeMap(this.vNodes.getCanEraserNodes(this.vNodes.curNodeMap,{disableEraseImage:n,disableEraseText:s}));for(var f=0;f<o.length-1;f+=2){this.createEraserRect(o.slice(f,f+2));var g=this.remove({curNodeMap:y,removeIds:c});a=Wt(a,g);}return a&&c.size?{type:dt.RemoveNode,rect:a,removeIds:_toConsumableArray(c)}:_objectSpread({type:dt.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,l=this.serviceWork.workShapes;var _iterator20=_createForOfIteratorHelper(s.values()),_step20;try{for(_iterator20.s();!(_step20=_iterator20.n()).done;){var o=_step20.value;if((r=o.selectIds)!=null&&r.length){var _iterator22=_createForOfIteratorHelper(o.selectIds),_step22;try{for(_iterator22.s();!(_step22=_iterator22.n()).done;){var a=_step22.value;n["delete"](a);}}catch(err){_iterator22.e(err);}finally{_iterator22.f();}}}}catch(err){_iterator20.e(err);}finally{_iterator20.f();}var _iterator21=_createForOfIteratorHelper(l.keys()),_step21;try{for(_iterator21.s();!(_step21=_iterator21.n()).done;){var _o4=_step21.value;n["delete"](_o4);}}catch(err){_iterator21.e(err);}finally{_iterator21.f();}return n;}return t;}}]);}(Et);// 来源于white-sdk
|
|
408
|
+
at(Ve,"eraserSizes",ln);var Tr=Ve;var t0="__lodash_hash_undefined__";function e0(u){return this.__data__.set(u,t0),this;}var r0=e0;function n0(u){return this.__data__.has(u);}var i0=n0,s0=vi,o0=r0,a0=i0;function Cr(u){var e=-1,t=u==null?0:u.length;for(this.__data__=new s0();++e<t;)this.add(u[e]);}Cr.prototype.add=Cr.prototype.push=o0;Cr.prototype.has=a0;var hn=Cr;function l0(u,e){for(var t=-1,r=u==null?0:u.length;++t<r;)if(e(u[t],t,u))return!0;return!1;}var c0=l0;function f0(u,e){return u.has(e);}var un=f0,h0=hn,u0=c0,d0=un,p0=1,m0=2;function v0(u,e,t,r,n,s){var l=t&p0,o=u.length,a=e.length;if(o!=a&&!(l&&a>o))return!1;var c=s.get(u),y=s.get(e);if(c&&y)return c==e&&y==u;var f=-1,g=!0,x=t&m0?new h0():void 0;for(s.set(u,e),s.set(e,u);++f<o;){var M=u[f],S=e[f];if(r)var P=l?r(S,M,f,e,u,s):r(M,S,f,u,e,s);if(P!==void 0){if(P)continue;g=!1;break;}if(x){if(!u0(e,function(C,h){if(!d0(x,h)&&(M===C||n(M,C,t,r,s)))return x.push(h);})){g=!1;break;}}else if(!(M===S||n(M,S,t,r,s))){g=!1;break;}}return s["delete"](u),s["delete"](e),g;}var Vi=v0;function g0(u){var e=-1,t=Array(u.size);return u.forEach(function(r,n){t[++e]=[n,r];}),t;}var y0=g0;function P0(u){var e=-1,t=Array(u.size);return u.forEach(function(r){t[++e]=r;}),t;}var dn=P0,Vn=fr,Kn=Bi,x0=Jr,S0=Vi,T0=y0,C0=dn,O0=1,I0=2,M0="[object Boolean]",E0="[object Date]",A0="[object Error]",L0="[object Map]",w0="[object Number]",R0="[object RegExp]",D0="[object Set]",b0="[object String]",N0="[object Symbol]",B0="[object ArrayBuffer]",W0="[object DataView]",kn=Vn?Vn.prototype:void 0,jr=kn?kn.valueOf:void 0;function F0(u,e,t,r,n,s,l){switch(t){case W0:if(u.byteLength!=e.byteLength||u.byteOffset!=e.byteOffset)return!1;u=u.buffer,e=e.buffer;case B0:return!(u.byteLength!=e.byteLength||!s(new Kn(u),new Kn(e)));case M0:case E0:case w0:return x0(+u,+e);case A0:return u.name==e.name&&u.message==e.message;case R0:case b0:return u==e+"";case L0:var o=T0;case D0:var a=r&O0;if(o||(o=C0),u.size!=e.size&&!a)return!1;var c=l.get(u);if(c)return c==e;r|=I0,l.set(u,e);var y=S0(o(u),o(e),r,n,s,l);return l["delete"](u),y;case N0:if(jr)return jr.call(u)==jr.call(e);}return!1;}var U0=F0,Zn=Di,j0=1,Y0=Object.prototype,X0=Y0.hasOwnProperty;function z0(u,e,t,r,n,s){var l=t&j0,o=Zn(u),a=o.length,c=Zn(e),y=c.length;if(a!=y&&!l)return!1;for(var f=a;f--;){var g=o[f];if(!(l?g in e:X0.call(e,g)))return!1;}var x=s.get(u),M=s.get(e);if(x&&M)return x==e&&M==u;var S=!0;s.set(u,e),s.set(e,u);for(var P=l;++f<a;){g=o[f];var C=u[g],h=e[g];if(r)var p=l?r(h,C,g,e,u,s):r(C,h,g,u,e,s);if(!(p===void 0?C===h||n(C,h,t,r,s):p)){S=!1;break;}P||(P=g=="constructor");}if(S&&!P){var d=u.constructor,v=e.constructor;d!=v&&"constructor"in u&&"constructor"in e&&!(typeof d=="function"&&d instanceof d&&typeof v=="function"&&v instanceof v)&&(S=!1);}return s["delete"](u),s["delete"](e),S;}var $0=z0,Yr=gi,G0=Vi,H0=U0,V0=$0,Jn=Fr,Qn=ur,qn=qr,K0=Oi,k0=1,_n="[object Arguments]",ti="[object Array]",vr="[object Object]",Z0=Object.prototype,ei=Z0.hasOwnProperty;function J0(u,e,t,r,n,s){var l=Qn(u),o=Qn(e),a=l?ti:Jn(u),c=o?ti:Jn(e);a=a==_n?vr:a,c=c==_n?vr:c;var y=a==vr,f=c==vr,g=a==c;if(g&&qn(u)){if(!qn(e))return!1;l=!0,y=!1;}if(g&&!y)return s||(s=new Yr()),l||K0(u)?G0(u,e,t,r,n,s):H0(u,e,a,t,r,n,s);if(!(t&k0)){var x=y&&ei.call(u,"__wrapped__"),M=f&&ei.call(e,"__wrapped__");if(x||M){var S=x?u.value():u,P=M?e.value():e;return s||(s=new Yr()),n(S,P,t,r,s);}}return g?(s||(s=new Yr()),V0(u,e,t,r,n,s)):!1;}var Q0=J0,q0=Q0,ri=we;function Ki(u,e,t,r,n){return u===e?!0:u==null||e==null||!ri(u)&&!ri(e)?u!==u&&e!==e:q0(u,e,t,r,Ki,n);}var _0=Ki,tm=_0;function em(u,e){return tm(u,e);}var rm=em,Ae=/* @__PURE__ */Ne(rm);function ni(u,e,t){var r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:1;return"rgba(".concat(u,",").concat(e,",").concat(t,",").concat(r,")");}function nm(u){var e=u.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 wr=/*#__PURE__*/function(_Et4){function wr(t){var _this70;_classCallCheck(this,wr);_this70=_callSuper(this,wr,[t]);at(_this70,"toolsType",xt.Selector);at(_this70,"tmpPoints",[]);at(_this70,"workOptions");at(_this70,"vNodes");at(_this70,"selectIds");at(_this70,"selectorColor");at(_this70,"strokeColor");at(_this70,"fillColor");at(_this70,"oldSelectRect");at(_this70,"canRotate",!1);at(_this70,"canTextEdit",!1);at(_this70,"canLock",!1);at(_this70,"scaleType",Qt.all);at(_this70,"toolsTypes");at(_this70,"shapeOpt");at(_this70,"textOpt");at(_this70,"isLocked");at(_this70,"thickness");at(_this70,"strokeType");at(_this70,"useStroke");_this70.workOptions=t.toolsOpt,_this70.vNodes=t.vNodes;return _this70;}_inherits(wr,_Et4);return _createClass(wr,[{key:"computSelector",value:function computSelector(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;var r=_t(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 Dt(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 _this71=this;var r=t.drawRect,n=t.subNodeMap,s=t.selectorId,l=t.layer,o=t.isService,a=new me({pos:[r.x,r.y],anchor:[0,0],size:[r.w,r.h],id:s,name:s,zIndex:9999}),c=[];if(o){var y=new Pn({normalize:!0,pos:[r.w/2,r.h/2],lineWidth:1,strokeColor:this.selectorColor||this.workOptions.strokeColor,width:r.w,height:r.h,name:wr.selectorBorderId});c.push(y);}n.forEach(function(y,f){var g=[y.rect.x+y.rect.w/2-r.x,y.rect.y+y.rect.h/2-r.y],x=new Pn({normalize:!0,pos:g,lineWidth:1,strokeColor:n.size>1?_this71.selectorColor||_this71.workOptions.strokeColor:void 0,width:y.rect.w,height:y.rect.h,id:"selector-".concat(f),name:"selector-".concat(f)});c.push(x);}),c&&a.append.apply(a,c),(l==null?void 0:l.parent).appendChild(a);}},{key:"draw",value:function draw(t,r,n){var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!1;var a,c;var l=n.intersectRect,o=n.subNodeMap;(c=(a=r.parent)==null?void 0:a.getElementById(t))==null||c.remove(),l&&this.drawSelector({drawRect:l,subNodeMap:o,selectorId:t,layer:r,isService:s});}},{key:"getSelecteorInfo",value:function getSelecteorInfo(t){this.scaleType=Qt.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 _iterator23=_createForOfIteratorHelper(t.values()),_step23;try{for(_iterator23.s();!(_step23=_iterator23.n()).done;){var l=_step23.value;var o=l.opt,a=l.canRotate,c=l.scaleType,y=l.toolsType;this.selectorColor=this.workOptions.strokeColor,o.strokeColor&&(this.strokeColor=o.strokeColor),o.fillColor&&(this.fillColor=o.fillColor),o.textOpt&&(this.textOpt=o.textOpt),o.thickness&&(this.thickness=o.thickness),y!==xt.Pencil&&(s=!1),o.strokeType&&(this.strokeType=o.strokeType),y===xt.SpeechBalloon&&(r.add(y),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.placement=o.placement),y===xt.Polygon&&(r.add(y),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.vertices=o.vertices),y===xt.Star&&(r.add(y),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.vertices=o.vertices,this.shapeOpt.innerRatio=o.innerRatio,this.shapeOpt.innerVerticeStep=o.innerVerticeStep),y===xt.Text&&(this.textOpt=o),t.size===1&&(this.textOpt&&(this.canTextEdit=!0),this.canRotate=a,this.scaleType=c),y===xt.Image&&(n=l),(c===Qt.proportional&&this.scaleType!==Qt.none||c===Qt.none)&&(this.scaleType=c);}}catch(err){_iterator23.e(err);}finally{_iterator23.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=Qt.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===Qt.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 l=[];for(var o=0;o<s.length;o+=3)l.push([s[o],s[o+1]]);return l;}}}},{key:"consume",value:function consume(t){if(t.isSubWorker)return this.subWorkerConsume(t);var _t$data3=t.data,r=_t$data3.op,n=_t$data3.workState;var s=this.oldSelectRect;if(n===Ft.Start&&(s=this.unSelectedAllIds()),!(r!=null&&r.length)||!this.vNodes.curNodeMap.size)return{type:dt.None};this.updateTempPoints(r);var l=this.computSelector();if(this.selectIds&&Ae(this.selectIds,l.selectIds))return{type:dt.None};this.selectIds=l.selectIds;var o=l.intersectRect;this.getSelecteorInfo(l.subNodeMap),this.draw(qt,this.fullLayer,l),this.oldSelectRect=o;var a=this.getChildrenPoints();return _objectSpread({type:dt.Select,dataType:bt.Local,rect:Wt(o,s),selectIds:l.selectIds,selectRect:o,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:a,isLocked:this.isLocked,toolsTypes:this.toolsTypes,shapeOpt:this.shapeOpt,thickness:this.thickness,useStroke:this.useStroke,strokeType:this.strokeType},this.baseConsumeResult);}},{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,qt,!1),(n=this.selectIds)!=null&&n.length&&(t=this.selectedByIds(this.selectIds)),t){var s=this.getChildrenPoints();return _objectSpread({type:dt.Select,dataType:bt.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:dt.None};}},{key:"consumeService",value:function consumeService(){}},{key:"updateTempPointsForSubWorker",value:function updateTempPointsForSubWorker(t){var r=t.slice(-2),n=new Dt(r[0],r[1]);if(this.tmpPoints[0].isNear(n,1))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:"computDrawPoints",value:function computDrawPoints(t){var r=this.workOptions.thickness,n=[];var _iterator24=_createForOfIteratorHelper(t),_step24;try{for(_iterator24.s();!(_step24=_iterator24.n()).done;){var o=_step24.value;n.push(_construct(ot,_toConsumableArray(o)));}}catch(err){_iterator24.e(err);}finally{_iterator24.f();}var s=_t(n,r),l=[s.x+s.w/2,s.y+s.h/2];return{rect:s,pos:l,points:n.map(function(o){return o.XY;}).flat(1)};}},{key:"drawForSubWorker",value:function drawForSubWorker(t){var r=t.workId,n=t.layer,s=t.ps,_this$workOptions6=this.workOptions,l=_this$workOptions6.strokeColor,o=_this$workOptions6.scale,a=_this$workOptions6.rotate,c=_this$workOptions6.translate,y=n.worldPosition,f=n.worldScaling,_this$computDrawPoint2=this.computDrawPoints(s),g=_this$computDrawPoint2.points,x=_this$computDrawPoint2.rect,M=_this$computDrawPoint2.pos,S=1/n.worldScaling[0],P=l&&nm(l)||[0,0,0,0],C={close:!0,normalize:!0,points:g,lineWidth:S,fillColor:ni(P[0],P[1],P[2],0.1),strokeColor:ni(P[0],P[1],P[2],1),lineJoin:"round",lineCap:"round"};var h={x:Math.floor(x.x*f[0]+y[0]-Et.SafeBorderPadding),y:Math.floor(x.y*f[1]+y[1]-Et.SafeBorderPadding),w:Math.floor(x.w*f[0]+2*Et.SafeBorderPadding),h:Math.floor(x.h*f[0]+2*Et.SafeBorderPadding)};var p=new me({name:r,id:r,pos:M,anchor:[0.5,0.5],size:[x.w,x.h],scale:o,rotate:a,translate:c}),d=new Le(_objectSpread(_objectSpread({},C),{},{pos:[0,0]}));if(p.appendChild(d),this.replace(n,r,p),o||a||c){var v=p.getBoundingClientRect();h={x:Math.floor(v.x-Et.SafeBorderPadding),y:Math.floor(v.y-Et.SafeBorderPadding),w:Math.floor(v.width+2*Et.SafeBorderPadding),h:Math.floor(v.height+2*Et.SafeBorderPadding)};}return h;}},{key:"transformData",value:function transformData(){var t=_t(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:"subWorkerConsume",value:function subWorkerConsume(t){var r=t.data,n=t.isFullWork,s=r.op,l=r.syncUnitTime;l&&(this.syncUnitTime=l);var o=s==null?void 0:s.length;if(!o||o<2)return{type:dt.None};var a;if(this.tmpPoints.length===0?(this.tmpPoints=[new Dt(s[0],s[1])],a=!1):a=this.updateTempPointsForSubWorker(s),!a)return{type:dt.None};var c=this.transformData(),y=n?this.fullLayer:this.drawLayer||this.fullLayer,f=this.drawForSubWorker({ps:c,workId:this.workId,layer:y}),g=Wt(f,this.oldSelectRect);return this.oldSelectRect=f,_objectSpread({rect:g,type:dt.DrawWork,dataType:bt.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:dt.FullWork,dataType:bt.Local},this.baseConsumeResult);}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}},{key:"clearSelectData",value:function clearSelectData(){this.selectIds=void 0,this.oldSelectRect=void 0;}},{key:"selectSingleTool",value:function selectSingleTool(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:qt;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;if(t.length===2){var s=t[0],l=t[1];var o;var _this$vNodes$getRectI2=this.vNodes.getRectIntersectRange({x:s,y:l,w:0,h:0},!1),a=_this$vNodes$getRectI2.nodeRange,c=_toConsumableArray(a.values()).sort(function(y,f){return(f.opt.zIndex||0)-(y.opt.zIndex||0);});var _iterator25=_createForOfIteratorHelper(c),_step25;try{for(_iterator25.s();!(_step25=_iterator25.n()).done;){var _y10=_step25.value;var _f5=this.fullLayer.getElementsByName(_y10.name);if(rs(_f5).find(function(x){return x.isPointCollision(s,l);})){o=_y10;break;}}}catch(err){_iterator25.e(err);}finally{_iterator25.f();}if(o){var y=o.name;if(!Ae(this.oldSelectRect,o.rect)){var f=/* @__PURE__ */new Map([[y,o]]);this.getSelecteorInfo(f),this.draw(r,this.fullLayer,{intersectRect:o.rect,subNodeMap:f,selectIds:this.selectIds||[]},n);}this.selectIds=[y],this.oldSelectRect=o.rect;}}}},{key:"unSelectedAllIds",value:function unSelectedAllIds(){var t;var _iterator26=_createForOfIteratorHelper(this.vNodes.curNodeMap.entries()),_step26;try{for(_iterator26.s();!(_step26=_iterator26.n()).done;){var _step26$value=_slicedToArray(_step26.value,2),r=_step26$value[0],n=_step26$value[1];n.isSelected&&(t=Wt(t,n.rect),this.vNodes.unSelected(r));}}catch(err){_iterator26.e(err);}finally{_iterator26.f();}return t;}},{key:"unSelectedByIds",value:function unSelectedByIds(t){var r;var _iterator27=_createForOfIteratorHelper(t),_step27;try{for(_iterator27.s();!(_step27=_iterator27.n()).done;){var n=_step27.value;var s=this.vNodes.get(n);s&&s.isSelected&&(r=Wt(r,s.rect),this.vNodes.unSelected(n));}}catch(err){_iterator27.e(err);}finally{_iterator27.f();}return r;}},{key:"selectedByIds",value:function selectedByIds(t){var r;var _iterator28=_createForOfIteratorHelper(t),_step28;try{for(_iterator28.s();!(_step28=_iterator28.n()).done;){var n=_step28.value;var s=this.vNodes.get(n);s&&(r=Wt(r,s.rect),this.vNodes.selected(n));}}catch(err){_iterator28.e(err);}finally{_iterator28.f();}return r;}},{key:"getSelectorRect",value:function getSelectorRect(t,r){var o;var n;var s=(o=t.parent)==null?void 0:o.getElementById(r),l=s==null?void 0:s.getBoundingClientRect();return l&&(n=Wt(n,{x:Math.floor(l.x),y:Math.floor(l.y),w:Math.floor(l.width+1),h:Math.floor(l.height+1)})),n;}},{key:"isCanFillColor",value:function isCanFillColor(t){return t===xt.Ellipse||t===xt.Triangle||t===xt.Rectangle||t===xt.Polygon||t===xt.Star||t===xt.SpeechBalloon;}},{key:"updateSelector",value:function(){var _updateSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee22(t){var r,n,s,l,o,a,c,y,f,g,x,M,S,P,C,h,_iterator29,_step29,v,I,L,w,B,E,b,W,D,R,Y,p,_v13,_I8,_L6,d;return _regeneratorRuntime().wrap(function _callee22$(_context24){while(1)switch(_context24.prev=_context24.next){case 0:r=t.updateSelectorOpt,n=t.selectIds,s=t.vNodes,l=t.willSerializeData,o=t.worker,a=t.offset,c=this.fullLayer;if(c){_context24.next=3;break;}return _context24.abrupt("return");case 3:f=/* @__PURE__ */new Map(),g=r.originPoint,x=r.workState,M=r.angle,S=r.translate,P=r.dir,C=r.scale;a&&(S?r.translate=[S[0]+a[0],S[1]+a[1]]:r.translate=a);if(!(g||S||ue(M))){_context24.next=10;break;}if(!(x===Ft.Start&&n)){_context24.next=8;break;}return _context24.abrupt("return",(s.setTargetAssignKeys(n),{type:dt.Select,dataType:bt.Local,selectRect:this.oldSelectRect,rect:this.oldSelectRect}));case 8:if(!(h=s.getLastTarget(),!h)){_context24.next=10;break;}return _context24.abrupt("return");case 10:if(!n){_context24.next=62;break;}_iterator29=_createForOfIteratorHelper(n);_context24.prev=12;_iterator29.s();case 14:if((_step29=_iterator29.n()).done){_context24.next=54;break;}v=_step29.value;I=s.get(v);if(!I){_context24.next=52;break;}L=I.toolsType,w=I.opt,B=(c==null?void 0:c.getElementsByName(v))[0];if(!B){_context24.next=52;break;}E=_objectSpread({},r);b=void 0;W=Et.isWillRefresh({toolsType:L,opt:w,updateOpt:E,vNodes:s,node:B,willSerializeData:l});if(!L){_context24.next=52;break;}b=h==null?void 0:h.get(v);D=es(L);if(!(D==null||D.updateNodeOpt({node:B,opt:E,vNodes:s,willSerializeData:l,targetNode:b}),I&&o&&W)){_context24.next=51;break;}R=o.createWorkShapeNode({workId:v,toolsType:L,toolsOpt:I.opt});R==null||R.setWorkId(v);Y=void 0;if(!(L===xt.Image)){_context24.next=36;break;}_context24.next=33;return R.consumeServiceAsync({isFullWork:!0,replaceId:v,worker:o});case 33:Y=_context24.sent;_context24.next=50;break;case 36:if(!(L===xt.Text)){_context24.next=42;break;}_context24.next=39;return R.consumeServiceAsync({isFullWork:!0,replaceId:v});case 39:Y=_context24.sent;_context24.next=50;break;case 42:_context24.prev=42;Y=R==null?void 0:R.consumeService({op:I.op,isFullWork:!0,replaceId:v,workState:x});_context24.next=50;break;case 46:_context24.prev=46;_context24.t0=_context24["catch"](42);console.error("consumeService error",_context24.t0);return _context24.abrupt("continue",52);case 50:Y&&(I.rect=Y);case 51:I&&(f.set(v,I),y=Wt(y,I.rect));case 52:_context24.next=14;break;case 54:_context24.next=59;break;case 56:_context24.prev=56;_context24.t1=_context24["catch"](12);_iterator29.e(_context24.t1);case 59:_context24.prev=59;_iterator29.f();return _context24.finish(59);case 62:h&&x===Ft.Done&&(s.deleteLastTarget(),h=void 0);p=y;if(!(g&&S&&C&&P&&p&&!a)){_context24.next=82;break;}_v13=[[p.x,p.y],[p.x+p.w,p.y],[p.x+p.w,p.y+p.h],[p.x,p.y+p.h]];_context24.t2=P;_context24.next=_context24.t2==="top"?69:_context24.t2==="topLeft"?69:_context24.t2==="left"?69:_context24.t2==="topRight"?71:_context24.t2==="right"?73:_context24.t2==="bottomRight"?73:_context24.t2==="bottom"?73:_context24.t2==="bottomLeft"?75:77;break;case 69:S[0]>0&&S[1]>0?_I8=_v13[0]:S[0]>0?_I8=_v13[3]:S[1]>0?_I8=_v13[1]:_I8=_v13[2];return _context24.abrupt("break",77);case 71:S[0]<0&&S[1]>0?_I8=_v13[1]:S[0]<0?_I8=_v13[2]:S[1]>0?_I8=_v13[0]:_I8=_v13[3];return _context24.abrupt("break",77);case 73:S[0]<0&&S[1]<0?_I8=_v13[2]:S[0]<0?_I8=_v13[1]:S[1]<0?_I8=_v13[3]:_I8=_v13[0];return _context24.abrupt("break",77);case 75:S[0]>0&&S[1]<0?_I8=_v13[3]:S[0]>0?_I8=_v13[0]:S[1]<0?_I8=_v13[2]:_I8=_v13[1];return _context24.abrupt("break",77);case 77:_L6=_I8&&[g[0]-_I8[0],g[1]-_I8[1]]||[0,0];if(Ae(_L6,[0,0])){_context24.next=82;break;}_context24.next=81;return this.updateSelector(_objectSpread(_objectSpread({},t),{},{updateSelectorOpt:{workState:x},offset:_L6}));case 81:return _context24.abrupt("return",_context24.sent);case 82:this.getSelecteorInfo(f),this.draw(qt,c,{selectIds:n||[],subNodeMap:f,intersectRect:p});d=Wt(this.oldSelectRect,p);return _context24.abrupt("return",(this.oldSelectRect=p,{type:dt.Select,dataType:bt.Local,selectRect:p,renderRect:y,rect:Wt(d,p),selectIds:n}));case 85:case"end":return _context24.stop();}},_callee22,this,[[12,56,59,62],[42,46]]);}));function updateSelector(_x32){return _updateSelector.apply(this,arguments);}return updateSelector;}()},{key:"blurSelector",value:function blurSelector(){var t=this.unSelectedAllIds();return{type:dt.Select,dataType:bt.Local,rect:t,selectIds:[],willSyncService:!0};}},{key:"getRightServiceId",value:function getRightServiceId(t){return t.replace(or,"-");}},{key:"selectServiceNode",value:function selectServiceNode(t,r,n){var _this72=this;var s=r.selectIds,l=this.getRightServiceId(t),o=this.getSelectorRect(this.fullLayer,l);var a;var c=/* @__PURE__ */new Map();return s==null||s.forEach(function(y){var f=_this72.vNodes.get(y);f&&(a=Wt(a,f.rect),c.set(y,f));}),this.getSelecteorInfo(c),this.draw(l,this.fullLayer,{intersectRect:a,selectIds:s||[],subNodeMap:c},n),Wt(a,o);}},{key:"reRenderSelector",value:function reRenderSelector(){var _this73=this;var n;var t;var r=/* @__PURE__ */new Map();return(n=this.selectIds)==null||n.forEach(function(s){var l=_this73.vNodes.get(s);l&&(t=Wt(t,l.rect),r.set(s,l));},this),this.getSelecteorInfo(r),this.draw(qt,this.fullLayer,{intersectRect:t,subNodeMap:r,selectIds:this.selectIds||[]}),this.oldSelectRect=t,t;}},{key:"updateSelectIds",value:function updateSelectIds(t){var l;var r;var n=(l=this.selectIds)==null?void 0:l.filter(function(o){return!t.includes(o);});if(n!=null&&n.length&&(r=this.unSelectedByIds(n)),t.length){var o=this.selectedByIds(t);r=Wt(r,o);}this.selectIds=t;var s=this.reRenderSelector();return{bgRect:r,selectRect:s};}},{key:"cursorHover",value:function cursorHover(t){var l,o;var r=this.oldSelectRect;this.selectIds=[];var n=(l=this.workId)==null?void 0:l.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&&!Ae(r,this.oldSelectRect))return{type:dt.CursorHover,dataType:bt.Local,rect:Wt(r,this.oldSelectRect),selectorColor:this.selectorColor,willSyncService:!1};if((o=this.selectIds)!=null&&o.length||(this.oldSelectRect=void 0),r&&!this.oldSelectRect)return this.cursorBlur(),{type:dt.CursorHover,dataType:bt.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();});}}]);}(Et);at(wr,"selectorBorderId","selector-border");var Or=wr;var ki=/*#__PURE__*/function(_Et5){function ki(t){var _this74;_classCallCheck(this,ki);_this74=_callSuper(this,ki,[t]);at(_this74,"canRotate",!1);at(_this74,"scaleType",Qt.both);at(_this74,"toolsType",xt.Arrow);at(_this74,"tmpPoints",[]);at(_this74,"workOptions");at(_this74,"oldRect");at(_this74,"arrowTipWidth");at(_this74,"syncTimestamp");_this74.workOptions=t.toolsOpt,_this74.arrowTipWidth=_this74.workOptions.thickness*4,_this74.syncTimestamp=0,_this74.syncUnitTime=50;return _this74;}_inherits(ki,_Et5);return _createClass(ki,[{key:"consume",value:function consume(t){var r=t.data,n=t.isFullWork,s=t.isSubWorker,l=t.isMainThread,o=t.smoothSync,a=this.workId,c=r.op,y=r.syncUnitTime;y&&(this.syncUnitTime=y);var f=c==null?void 0:c.length;if(!f||f<2)return{type:dt.None};var g;if(this.tmpPoints.length===0?(this.tmpPoints=[new Dt(c[0],c[1])],g=!1):g=this.updateTempPoints(c),!g)return{type:dt.None};var x;if(s||l){var S=n?this.fullLayer:this.drawLayer||this.fullLayer;x=this.draw({workId:a,layer:S});}if(!s&&o){var _S3=Date.now();return _S3-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_S3,_objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:dt.DrawWork,dataType:bt.Local,op:this.tmpPoints.map(function(P){return[].concat(_toConsumableArray(P.XY),[0]);}).flat(1),isSync:!0,index:0})):{type:dt.None};}var M=Wt(x,this.oldRect);return this.oldRect=x,_objectSpread(_objectSpread({rect:M},this.baseConsumeResult),{},{type:dt.DrawWork,dataType:bt.Local});}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:dt.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r});this.oldRect=n;var s=this.tmpPoints.map(function(a){return[].concat(_toConsumableArray(a.XY),[0]);}).flat(1),l=ye(s);return(o=this.vNodes)==null||o.setInfo(t,{rect:n,op:s,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:Et.getCenterPos(n,r)}),_objectSpread(_objectSpread({rect:n},this.baseConsumeResult),{},{type:dt.FullWork,dataType:bt.Local,ops:l,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,l=_this$workOptions7.strokeColor,o=_this$workOptions7.thickness,a=_this$workOptions7.zIndex,c=_this$workOptions7.scale,y=_this$workOptions7.rotate,f=_this$workOptions7.translate,g=_this$workOptions7.strokeType,x=_this$workOptions7.eraserlines,M=n.worldPosition,S=n.worldScaling,_this$computDrawPoint3=this.computDrawPoints(o),P=_this$computDrawPoint3.points,C=_this$computDrawPoint3.pos,h=_this$computDrawPoint3.rect,p=_this$computDrawPoint3.isTriangle,d=_this$computDrawPoint3.trianglePoints,v=_this$computDrawPoint3.trianglePos,I=[h.x+h.w/2,h.y+h.h/2],L={pos:I,name:r,id:r,zIndex:a,anchor:[0.5,0.5],size:[h.w,h.h]};c&&(L.scale=c),y&&(L.rotate=y),f&&(L.translate=f);var w=new me(L),B={points:d,pos:[v[0]-I[0],v[1]-I[1]],fillColor:l,strokeColor:l,lineWidth:0,normalize:!1},E=new Le(B);if(w.append(E),!p&&P&&C){var W={points:P,pos:[C[0]-I[0],C[1]-I[1]],fillColor:l,strokeColor:l,lineDash:g===Kt.Dotted&&!p?[1,o*2]:g===Kt.LongDotted&&!p?[o,o*2]:void 0,lineCap:g===Kt.Normal?void 0:"round",lineWidth:o,normalize:!1},D=new Le(W);w.append(D);}x&&(this.scaleType=Qt.proportional,this.drawEraserlines({group:w,eraserlines:x,pos:I,layer:n},s)),this.replace(n,r,w);var b={x:Math.floor(h.x*S[0]+M[0]-Et.SafeBorderPadding),y:Math.floor(h.y*S[1]+M[1]-Et.SafeBorderPadding),w:Math.floor(h.w*S[0]+2*Et.SafeBorderPadding),h:Math.floor(h.h*S[1]+2*Et.SafeBorderPadding)};if(c||y||f){var _W9=w.getBoundingClientRect();b={x:Math.floor(_W9.x-Et.SafeBorderPadding),y:Math.floor(_W9.y-Et.SafeBorderPadding),w:Math.floor(_W9.width+Et.SafeBorderPadding*2),h:Math.floor(_W9.height+Et.SafeBorderPadding*2)};}return this.isDelete&&w.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 _this75=this;var r=ot.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),n=ot.Per(r).mul(t/2),s=Dt.Sub(this.tmpPoints[0],n),l=Dt.Add(this.tmpPoints[0],n),o=ot.Mul(r,this.arrowTipWidth),a=ot.Sub(this.tmpPoints[1],o),c=Dt.Sub(a,n),y=Dt.Add(a,n),f=ot.Per(r).mul(t*1.5),g=Dt.Sub(a,f),x=Dt.Add(a,f),M=[this.tmpPoints[0],a],S=[g,this.tmpPoints[1],x],P=[s,l].concat(S,[c,y]);return{trianglePoints:S.map(function(C){return Dt.Sub(C,_this75.tmpPoints[1]).XY;}).flat(1),trianglePos:this.tmpPoints[1].XY,points:M.map(function(C){return Dt.Sub(C,_this75.tmpPoints[0]).XY;}).flat(1),rect:_t(P),isTriangle:!1,pos:this.tmpPoints[0].XY};}},{key:"computTrianglePoints",value:function computTrianglePoints(){var _this76=this;var t=ot.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),r=this.tmpPoints[1].distance(this.tmpPoints[0]),n=ot.Per(t).mul(Math.floor(r*3/8)),s=Dt.Sub(this.tmpPoints[0],n),l=Dt.Add(this.tmpPoints[0],n),o=[s,this.tmpPoints[1],l];return{trianglePoints:o.map(function(a){return Dt.Sub(a,_this76.tmpPoints[1]).XY;}).flat(1),trianglePos:this.tmpPoints[1].XY,rect:_t(o),isTriangle:!0};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=t.slice(-2),n=new Dt(r[0],r[1]),s=this.tmpPoints[0],l=this.workOptions.thickness;if(s.isNear(n,l))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 c,y;var r=t.op,n=t.isFullWork,_t$workState2=t.workState,s=_t$workState2===void 0?Ft.Done:_t$workState2,l=(c=this.workId)==null?void 0:c.toString();if(!l)return;this.tmpPoints.length=0;for(var f=0;f<r.length;f+=3)this.tmpPoints.push(new Dt(r[f],r[f+1],r[f+2]));var o=n?this.fullLayer:this.drawLayer||this.fullLayer,a=this.draw({workId:l,layer:o,isDrawEraserlines:s===Ft.Done});return this.oldRect=a,(y=this.vNodes)==null||y.setInfo(l,{rect:a,op:r,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:Et.getCenterPos(a,o)}),a;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var c,y;var r=t.node,n=t.opt,s=t.vNodes,l=n.strokeColor,o=n.strokeType,a=s.get(r.name);return l&&(r.tagName==="GROUP"?r.children.forEach(function(f){f.setAttribute("strokeColor",l),f.getAttribute("fillColor")&&f.setAttribute("fillColor",l);}):(r.setAttribute("strokeColor",l),r.setAttribute("fillColor",l)),(c=a==null?void 0:a.opt)!=null&&c.strokeColor&&(a.opt.strokeColor=l)),o&&a!=null&&a.opt&&(y=a.opt)!=null&&y.strokeType&&(a.opt.strokeType=o),a&&s.setInfo(r.name,a),Et.updateNodeOpt(t);}}]);}(Et);var Zi=/*#__PURE__*/function(_Et6){function Zi(t){var _this77;_classCallCheck(this,Zi);_this77=_callSuper(this,Zi,[t]);at(_this77,"canRotate",!1);at(_this77,"scaleType",Qt.all);at(_this77,"toolsType",xt.Ellipse);at(_this77,"tmpPoints",[]);at(_this77,"workOptions");at(_this77,"oldRect");at(_this77,"syncTimestamp");_this77.workOptions=t.toolsOpt,_this77.syncTimestamp=0,_this77.syncUnitTime=50;return _this77;}_inherits(Zi,_Et6);return _createClass(Zi,[{key:"consume",value:function consume(t){var r=t.data,n=t.isFullWork,s=t.isSubWorker,l=t.isMainThread,o=t.smoothSync,a=this.workId,c=r.op,y=r.syncUnitTime;y&&(this.syncUnitTime=y);var f=c==null?void 0:c.length;if(!f||f<2)return{type:dt.None};var g;if(this.tmpPoints.length===0?(this.tmpPoints=[new Dt(c[0],c[1])],g=!1):g=this.updateTempPoints(c),!g)return{type:dt.None};if(!s&&o){var M=Date.now();return M-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=M,_objectSpread(_objectSpread({type:dt.DrawWork,dataType:bt.Local},this.baseConsumeResult),{},{op:this.tmpPoints.map(function(S){return[].concat(_toConsumableArray(S.XY),[0]);}).flat(1),isSync:!0,index:0})):{type:dt.None};}var x;if(s||l){var _M2=n?this.fullLayer:this.drawLayer||this.fullLayer;x=this.draw({workId:a,layer:_M2,isDrawing:!0});var S=_M2.parent.parent,P={x:0,y:0,w:Math.floor(S.width),h:Math.floor(S.height)};if(sr(x,P)!==ge.outside){var _h31=Wt(x,this.oldRect);return this.oldRect=x,_objectSpread({rect:_h31,type:dt.DrawWork,dataType:bt.Local},this.baseConsumeResult);}return{type:dt.None};}return{type:dt.None};}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:dt.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(a){return[].concat(_toConsumableArray(a.XY),[0]);}).flat(1),l=ye(s);return(o=this.vNodes)==null||o.setInfo(t,{rect:n,op:s,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:n&&Et.getCenterPos(n,r)}),_objectSpread(_objectSpread({rect:n,type:dt.FullWork,dataType:bt.Local},this.baseConsumeResult),{},{ops:l,isSync:!0,updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(t){var r=t.workId,n=t.layer,s=t.isDrawing,l=t.isDrawEraserlines,_this$workOptions8=this.workOptions,o=_this$workOptions8.strokeColor,a=_this$workOptions8.fillColor,c=_this$workOptions8.thickness,y=_this$workOptions8.zIndex,f=_this$workOptions8.scale,g=_this$workOptions8.rotate,x=_this$workOptions8.translate,M=_this$workOptions8.strokeType,S=_this$workOptions8.eraserlines,P=n.worldScaling,_this$computDrawPoint4=this.computDrawPoints(c),C=_this$computDrawPoint4.radius,h=_this$computDrawPoint4.rect,p=_this$computDrawPoint4.pos,d={closeType:"normal",radius:C,lineWidth:c,fillColor:a!=="transparent"&&a||void 0,strokeColor:o,normalize:!0,lineJoin:"round",lineCap:"round",lineDash:M===Kt.Dotted?[1,c*2]:M===Kt.LongDotted?[c,c*2]:void 0},v={name:r,id:r,zIndex:y,pos:p,anchor:[0.5,0.5],size:[h.w,h.h]};f&&(v.scale=f),g&&(v.rotate=g),x&&(v.translate=x);var I=new me(v);if(s){var B=new be({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:o,lineWidth:1,scale:[1/P[0],1/P[1]]});I.append(B);}var L=new uo(_objectSpread(_objectSpread({},d),{},{pos:[0,0]}));I.append(L),S&&(this.scaleType=Qt.proportional,this.drawEraserlines({group:I,eraserlines:S,pos:p,layer:n},l)),this.replace(n,r,I);var w=I.getBoundingClientRect();return this.isDelete&&I.setAttribute("opacity",0),{x:Math.floor(w.x-Et.SafeBorderPadding),y:Math.floor(w.y-Et.SafeBorderPadding),w:Math.floor(w.width+Et.SafeBorderPadding*2),h:Math.floor(w.height+Et.SafeBorderPadding*2)};}},{key:"computDrawPoints",value:function computDrawPoints(t){var r=_t(this.tmpPoints),n=_t(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 Dt(r[0],r[1]),s=this.tmpPoints[0],l=this.workOptions.thickness;if(s.isNear(n,l))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 c,y;var r=t.op,n=t.isFullWork,_t$workState3=t.workState,s=_t$workState3===void 0?Ft.Done:_t$workState3,l=(c=this.workId)==null?void 0:c.toString();if(!l)return;this.tmpPoints.length=0;for(var f=0;f<r.length;f+=3)this.tmpPoints.push(new Dt(r[f],r[f+1],r[f+2]));var o=n?this.fullLayer:this.drawLayer||this.fullLayer,a=this.draw({workId:l,layer:o,isDrawing:!1,isDrawEraserlines:s===Ft.Done});return this.oldRect=a,(y=this.vNodes)==null||y.setInfo(l,{rect:a,op:r,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:Et.getCenterPos(a,o)}),a;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var f,g,x;var r=t.node,n=t.opt,s=t.vNodes,l=n.strokeColor,o=n.fillColor,a=n.strokeType,c=s.get(r.name);var y=r;return r.tagName==="GROUP"&&(y=r.children[0]),l&&(y.setAttribute("strokeColor",l),(f=c==null?void 0:c.opt)!=null&&f.strokeColor&&(c.opt.strokeColor=l)),o&&(o==="transparent"?y.setAttribute("fillColor","rgba(0,0,0,0)"):y.setAttribute("fillColor",o),(g=c==null?void 0:c.opt)!=null&&g.fillColor&&(c.opt.fillColor=o)),a&&c!=null&&c.opt&&(x=c.opt)!=null&&x.strokeType&&(c.opt.strokeType=a),c&&s.setInfo(r.name,c),Et.updateNodeOpt(t);}}]);}(Et);var Ji=/*#__PURE__*/function(_Et7){function Ji(t){var _this78;_classCallCheck(this,Ji);_this78=_callSuper(this,Ji,[t]);at(_this78,"canRotate",!0);at(_this78,"scaleType",Qt.all);at(_this78,"toolsType",xt.Rectangle);at(_this78,"tmpPoints",[]);at(_this78,"workOptions");at(_this78,"oldRect");at(_this78,"syncTimestamp");_this78.workOptions=t.toolsOpt,_this78.syncTimestamp=0,_this78.syncUnitTime=50;return _this78;}_inherits(Ji,_Et7);return _createClass(Ji,[{key:"transformData",value:function transformData(){var t=_t(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 _iterator30=_createForOfIteratorHelper(t),_step30;try{for(_iterator30.s();!(_step30=_iterator30.n()).done;){var o=_step30.value;n.push(_construct(ot,_toConsumableArray(o)));}}catch(err){_iterator30.e(err);}finally{_iterator30.f();}var s=_t(n,r),l=[s.x+s.w/2,s.y+s.h/2];return{rect:s,pos:l,points:n.map(function(o){return o.XY;}).flat(1)};}},{key:"consume",value:function consume(t){var r=t.data,n=t.isFullWork,s=t.isSubWorker,l=t.isMainThread,o=t.smoothSync,a=this.workId,c=r.op,y=c==null?void 0:c.length;if(!y||y<2)return{type:dt.None};var f;if(this.tmpPoints.length===0?(this.tmpPoints=[new Dt(c[0],c[1])],f=!1):f=this.updateTempPoints(c),!f)return{type:dt.None};var g=this.transformData();var x;if(s||l){var S=n?this.fullLayer:this.drawLayer||this.fullLayer;x=this.draw({ps:g,workId:a,layer:S,isDrawing:!0});}if(!s&&o){var _S4=Date.now();return _S4-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_S4,_objectSpread({type:dt.DrawWork,dataType:bt.Local,op:g.flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:dt.None};}var M=Wt(x,this.oldRect);return this.oldRect=x,_objectSpread({rect:M,type:dt.DrawWork,dataType:bt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var a;var t=this.workId;if(this.tmpPoints.length<2)return{type:dt.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 l=r.flat(1),o=ye(l);return(a=this.vNodes)==null||a.setInfo(t,{rect:s,op:l,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:s&&Et.getCenterPos(s,n)}),_objectSpread(_objectSpread({rect:s,type:dt.FullWork,dataType:bt.Local,ops:o,isSync:!0},this.baseConsumeResult),{},{updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(t){var r=t.workId,n=t.layer,s=t.isDrawing,l=t.ps,o=t.replaceId,_t$isDrawEraserlines2=t.isDrawEraserlines,a=_t$isDrawEraserlines2===void 0?!0:_t$isDrawEraserlines2,_this$workOptions9=this.workOptions,c=_this$workOptions9.strokeColor,y=_this$workOptions9.fillColor,f=_this$workOptions9.thickness,g=_this$workOptions9.zIndex,x=_this$workOptions9.scale,M=_this$workOptions9.rotate,S=_this$workOptions9.translate,P=_this$workOptions9.strokeType,C=_this$workOptions9.eraserlines,h=n.worldPosition,p=n.worldScaling,_this$computDrawPoint5=this.computDrawPoints(l),d=_this$computDrawPoint5.points,v=_this$computDrawPoint5.rect,I=_this$computDrawPoint5.pos,L={close:!0,normalize:!0,points:d,lineWidth:f,fillColor:y!=="transparent"&&y||void 0,strokeColor:c,lineJoin:"round",lineCap:"round",lineDash:P===Kt.Dotted?[1,f*2]:P===Kt.LongDotted?[f,f*2]:void 0};var w={x:Math.floor(v.x*p[0]+h[0]-Et.SafeBorderPadding),y:Math.floor(v.y*p[1]+h[1]-Et.SafeBorderPadding),w:Math.floor(v.w*p[0]+2*Et.SafeBorderPadding),h:Math.floor(v.h*p[0]+2*Et.SafeBorderPadding)};var B=new me({name:r,id:r,zIndex:g,pos:I,anchor:[0.5,0.5],size:[v.w,v.h],scale:x,rotate:M,translate:S}),E=new Le(_objectSpread(_objectSpread({},L),{},{pos:[0,0]}));if(B.appendChild(E),s){var b=new be({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:c,lineWidth:1,scale:[1/p[0],1/p[1]]});B.appendChild(b);}if(C&&(this.scaleType=Qt.proportional,this.drawEraserlines({group:B,eraserlines:C,pos:I,layer:n},a)),this.replace(n,o||r,B),x||M||S){var _b8=B.getBoundingClientRect();w={x:Math.floor(_b8.x-Et.SafeBorderPadding),y:Math.floor(_b8.y-Et.SafeBorderPadding),w:Math.floor(_b8.width+2*Et.SafeBorderPadding),h:Math.floor(_b8.height+2*Et.SafeBorderPadding)};}return this.isDelete&&B.setAttribute("opacity",0),w;}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=t.slice(-2),n=new Dt(r[0],r[1]),s=this.tmpPoints[0],l=this.workOptions.thickness;if(s.isNear(n,l))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 f,g;var r=t.op,n=t.isFullWork,s=t.replaceId,_t$workState4=t.workState,l=_t$workState4===void 0?Ft.Done:_t$workState4,o=(f=this.workId)==null?void 0:f.toString();if(!o)return;var a=[];for(var x=0;x<r.length;x+=3)a.push([r[x],r[x+1],r[x+2]]);var c=n?this.fullLayer:this.drawLayer||this.fullLayer,y=this.draw({ps:a,workId:o,layer:c,isDrawing:!1,replaceId:s,isDrawEraserlines:l===Ft.Done});return this.oldRect=y,(g=this.vNodes)==null||g.setInfo(o,{rect:y,op:r,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:y&&Et.getCenterPos(y,c)}),y;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var f,g,x;var r=t.node,n=t.opt,s=t.vNodes,l=n.strokeColor,o=n.fillColor,a=n.strokeType,c=s.get(r.name);var y=r;return r.tagName==="GROUP"&&(y=r.children[0]),l&&(y.setAttribute("strokeColor",l),(f=c==null?void 0:c.opt)!=null&&f.strokeColor&&(c.opt.strokeColor=l)),o&&(o==="transparent"?y.setAttribute("fillColor","rgba(0,0,0,0)"):y.setAttribute("fillColor",o),(g=c==null?void 0:c.opt)!=null&&g.fillColor&&(c.opt.fillColor=o)),a&&c!=null&&c.opt&&(x=c.opt)!=null&&x.strokeType&&(c.opt.strokeType=a),c&&s.setInfo(r.name,c),Et.updateNodeOpt(t);}}]);}(Et);var Qi=/*#__PURE__*/function(_Et8){function Qi(t){var _this79;_classCallCheck(this,Qi);_this79=_callSuper(this,Qi,[t]);at(_this79,"canRotate",!1);at(_this79,"scaleType",Qt.all);at(_this79,"toolsType",xt.Star);at(_this79,"tmpPoints",[]);at(_this79,"workOptions");at(_this79,"oldRect");at(_this79,"syncTimestamp");_this79.workOptions=t.toolsOpt,_this79.syncTimestamp=0,_this79.syncUnitTime=50;return _this79;}_inherits(Qi,_Et8);return _createClass(Qi,[{key:"consume",value:function consume(t){var r=t.data,n=t.isFullWork,s=t.isSubWorker,l=t.isMainThread,o=t.smoothSync,a=this.workId,c=r.op,y=r.syncUnitTime,f=c==null?void 0:c.length;if(!f||f<2)return{type:dt.None};y&&(this.syncUnitTime=y);var g;if(this.tmpPoints.length===0?(this.tmpPoints=[new Dt(c[0],c[1])],g=!1):g=this.updateTempPoints(c),!g)return{type:dt.None};var x;if(s||l){var S=n?this.fullLayer:this.drawLayer||this.fullLayer;x=this.draw({workId:a,layer:S,isDrawing:!0});}if(!s&&o){var _S5=Date.now();return _S5-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_S5,_objectSpread({type:dt.DrawWork,dataType:bt.Local,op:this.tmpPoints.map(function(P){return[].concat(_toConsumableArray(P.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:dt.None};}var M=Wt(x,this.oldRect);return this.oldRect=x,_objectSpread({rect:M,type:dt.DrawWork,dataType:bt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:dt.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(a){return[].concat(_toConsumableArray(a.XY),[0]);}).flat(1),l=ye(s);return(o=this.vNodes)==null||o.setInfo(t,{rect:n,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&Et.getCenterPos(n,r)}),_objectSpread(_objectSpread({rect:n,type:dt.FullWork,dataType:bt.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,_t$isDrawEraserlines3=t.isDrawEraserlines,l=_t$isDrawEraserlines3===void 0?!0:_t$isDrawEraserlines3,_this$workOptions10=this.workOptions,o=_this$workOptions10.strokeColor,a=_this$workOptions10.fillColor,c=_this$workOptions10.thickness,y=_this$workOptions10.zIndex,f=_this$workOptions10.vertices,g=_this$workOptions10.innerVerticeStep,x=_this$workOptions10.innerRatio,M=_this$workOptions10.scale,S=_this$workOptions10.rotate,P=_this$workOptions10.translate,C=_this$workOptions10.strokeType,h=_this$workOptions10.eraserlines,p=n.worldScaling,_this$computDrawPoint6=this.computDrawPoints(c,f,g,x),d=_this$computDrawPoint6.rect,v=_this$computDrawPoint6.pos,I=_this$computDrawPoint6.points,L={close:!0,points:I,lineWidth:c,fillColor:a!=="transparent"&&a||void 0,strokeColor:o,normalize:!0,lineJoin:"round",lineCap:"round",lineDash:C===Kt.Dotted?[1,c*2]:C===Kt.LongDotted?[c,c*2]:void 0},w={name:r,id:r,zIndex:y,pos:v,anchor:[0.5,0.5],size:[d.w,d.h]};M&&(w.scale=M),S&&(w.rotate=S),P&&(w.translate=P);var B=new me(w);if(s){var W=new be({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:o,lineWidth:1,scale:[1/p[0],1/p[1]]});B.append(W);}var E=new Le(_objectSpread(_objectSpread({},L),{},{pos:[0,0]}));B.append(E),h&&(this.scaleType=Qt.proportional,this.drawEraserlines({group:B,eraserlines:h,pos:v,layer:n},l)),this.replace(n,r,B);var b=B.getBoundingClientRect();return this.isDelete&&B.setAttribute("opacity",0),{x:Math.floor(b.x-Et.SafeBorderPadding),y:Math.floor(b.y-Et.SafeBorderPadding),w:Math.floor(b.width+Et.SafeBorderPadding*2),h:Math.floor(b.height+Et.SafeBorderPadding*2)};}},{key:"computDrawPoints",value:function computDrawPoints(t,r,n,s){var l=_t(this.tmpPoints),o=[Math.floor(l.x+l.w/2),Math.floor(l.y+l.h/2)],a=ss(l.w,l.h),c=Math.floor(Math.min(l.w,l.h)/2),y=s*c,f=[],g=2*Math.PI/r;for(var M=0;M<r;M++){var S=M*g-0.5*Math.PI;var P=void 0,_C33=void 0;M%n===1?(P=y*a[0]*Math.cos(S),_C33=y*a[1]*Math.sin(S)):(P=c*a[0]*Math.cos(S),_C33=c*a[1]*Math.sin(S),f.push(P,_C33)),f.push(P,_C33);}return{rect:_t(this.tmpPoints,t),pos:o,points:f};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=t.slice(-2),n=new Dt(r[0],r[1]),s=this.tmpPoints[0],l=this.workOptions.thickness;if(s.isNear(n,l)||Dt.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 c,y;var r=t.op,n=t.isFullWork,_t$workState5=t.workState,s=_t$workState5===void 0?Ft.Done:_t$workState5,l=(c=this.workId)==null?void 0:c.toString();if(!l)return;this.tmpPoints.length=0;for(var f=0;f<r.length;f+=3)this.tmpPoints.push(new Dt(r[f],r[f+1],r[f+2]));var o=n?this.fullLayer:this.drawLayer||this.fullLayer,a=this.draw({workId:l,layer:o,isDrawing:!1,isDrawEraserlines:s===Ft.Done});return this.oldRect=a,(y=this.vNodes)==null||y.setInfo(l,{rect:a,op:r,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&Et.getCenterPos(a,o)}),a;}},{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,l=n.strokeColor,o=n.fillColor,a=n.toolsType,c=n.vertices,y=n.innerVerticeStep,f=n.innerRatio,g=n.strokeType,x=s.get(r.name),M=x==null?void 0:x.opt;var S=r;return r.tagName==="GROUP"&&(S=r.children[0]),l&&(S.setAttribute("strokeColor",l),M!=null&&M.strokeColor&&(M.strokeColor=l)),o&&(o==="transparent"?S.setAttribute("fillColor","rgba(0,0,0,0)"):S.setAttribute("fillColor",o),M!=null&&M.fillColor&&(M.fillColor=o)),a===xt.Star&&(c&&(M.vertices=c),y&&(M.innerVerticeStep=y),f&&(M.innerRatio=f)),g&&x!=null&&x.opt&&(P=x.opt)!=null&&P.strokeType&&(x.opt.strokeType=g),x&&s.setInfo(r.name,_objectSpread(_objectSpread({},x),{},{opt:M})),Et.updateNodeOpt(t);}}]);}(Et);var qi=/*#__PURE__*/function(_Et9){function qi(t){var _this80;_classCallCheck(this,qi);_this80=_callSuper(this,qi,[t]);at(_this80,"canRotate",!1);at(_this80,"scaleType",Qt.all);at(_this80,"toolsType",xt.Polygon);at(_this80,"tmpPoints",[]);at(_this80,"workOptions");at(_this80,"oldRect");at(_this80,"syncTimestamp");_this80.workOptions=t.toolsOpt,_this80.syncTimestamp=0,_this80.syncUnitTime=50;return _this80;}_inherits(qi,_Et9);return _createClass(qi,[{key:"consume",value:function consume(t){var r=t.data,n=t.isFullWork,s=t.isSubWorker,l=t.isMainThread,o=t.smoothSync,a=r.op,c=r.syncUnitTime;c&&(this.syncUnitTime=c);var y=this.workId,f=a==null?void 0:a.length;if(!f||f<2)return{type:dt.None};var g;if(this.tmpPoints.length===0?(this.tmpPoints=[new Dt(a[0],a[1])],g=!1):g=this.updateTempPoints(a),!g)return{type:dt.None};var x;if(s||l){var S=n?this.fullLayer:this.drawLayer||this.fullLayer;x=this.draw({workId:y,layer:S,isDrawing:!0});}if(!s&&o){var _S6=Date.now();return _S6-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_S6,_objectSpread({type:dt.DrawWork,dataType:bt.Local,op:this.tmpPoints.map(function(P){return[].concat(_toConsumableArray(P.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:dt.None};}var M=Wt(x,this.oldRect);return this.oldRect=x,_objectSpread({rect:M,type:dt.DrawWork,dataType:bt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:dt.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(a){return[].concat(_toConsumableArray(a.XY),[0]);}).flat(1),l=ye(s);return(o=this.vNodes)==null||o.setInfo(t,{rect:n,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&Et.getCenterPos(n,r)}),_objectSpread(_objectSpread({rect:n,type:dt.FullWork,dataType:bt.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,_t$isDrawEraserlines4=t.isDrawEraserlines,l=_t$isDrawEraserlines4===void 0?!0:_t$isDrawEraserlines4,_this$workOptions11=this.workOptions,o=_this$workOptions11.strokeColor,a=_this$workOptions11.fillColor,c=_this$workOptions11.thickness,y=_this$workOptions11.zIndex,f=_this$workOptions11.vertices,g=_this$workOptions11.scale,x=_this$workOptions11.rotate,M=_this$workOptions11.translate,S=_this$workOptions11.strokeType,P=_this$workOptions11.eraserlines,C=n.worldScaling,_this$computDrawPoint7=this.computDrawPoints(c,f),h=_this$computDrawPoint7.rect,p=_this$computDrawPoint7.pos,d=_this$computDrawPoint7.points,v={close:!0,points:d,lineWidth:c,fillColor:a!=="transparent"&&a||void 0,strokeColor:o,normalize:!0,lineJoin:"round",lineCap:"round",lineDash:S===Kt.Dotted?[1,c*2]:S===Kt.LongDotted?[c,c*2]:void 0},I={name:r,id:r,zIndex:y,pos:p,anchor:[0.5,0.5],size:[h.w,h.h]};g&&(I.scale=g),x&&(I.rotate=x),M&&(I.translate=M);var L=new me(I);if(s){var E=new be({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:o,lineWidth:1,scale:[1/C[0],1/C[1]]});L.append(E);}var w=new Le(_objectSpread(_objectSpread({},v),{},{pos:[0,0]}));L.append(w),P&&(this.scaleType=Qt.proportional,this.drawEraserlines({group:L,eraserlines:P,pos:p,layer:n},l)),this.replace(n,r,L);var B=L.getBoundingClientRect();return this.isDelete&&L.setAttribute("opacity",0),{x:Math.floor(B.x-Et.SafeBorderPadding),y:Math.floor(B.y-Et.SafeBorderPadding),w:Math.floor(B.width+Et.SafeBorderPadding*2),h:Math.floor(B.height+Et.SafeBorderPadding*2)};}},{key:"computDrawPoints",value:function computDrawPoints(t,r){var n=_t(this.tmpPoints),s=[Math.floor(n.x+n.w/2),Math.floor(n.y+n.h/2)],l=ss(n.w,n.h),o=Math.floor(Math.min(n.w,n.h)/2),a=[],c=2*Math.PI/r;for(var f=0;f<r;f++){var g=f*c-0.5*Math.PI,x=o*l[0]*Math.cos(g),M=o*l[1]*Math.sin(g);a.push(x,M);}return{rect:_t(this.tmpPoints,t),pos:s,points:a};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=t.slice(-2),n=new Dt(r[0],r[1]),s=this.tmpPoints[0],l=this.workOptions.thickness;if(s.isNear(n,l)||Dt.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 c,y;var r=t.op,n=t.isFullWork,_t$workState6=t.workState,s=_t$workState6===void 0?Ft.Done:_t$workState6,l=(c=this.workId)==null?void 0:c.toString();if(!l)return;this.tmpPoints.length=0;for(var f=0;f<r.length;f+=3)this.tmpPoints.push(new Dt(r[f],r[f+1],r[f+2]));var o=n?this.fullLayer:this.drawLayer||this.fullLayer,a=this.draw({workId:l,layer:o,isDrawing:!1,isDrawEraserlines:s===Ft.Done});return this.oldRect=a,(y=this.vNodes)==null||y.setInfo(l,{rect:a,op:r,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&Et.getCenterPos(a,o)}),a;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var M;var r=t.node,n=t.opt,s=t.vNodes,l=n.strokeColor,o=n.fillColor,a=n.toolsType,c=n.vertices,y=n.strokeType,f=s.get(r.name),g=f==null?void 0:f.opt;var x=r;return r.tagName==="GROUP"&&(x=r.children[0]),l&&(x.setAttribute("strokeColor",l),g!=null&&g.strokeColor&&(g.strokeColor=l)),o&&(o==="transparent"?x.setAttribute("fillColor","rgba(0,0,0,0)"):x.setAttribute("fillColor",o),g!=null&&g.fillColor&&(g.fillColor=o)),a===xt.Polygon&&c&&(g.vertices=c),y&&f!=null&&f.opt&&(M=f.opt)!=null&&M.strokeType&&(f.opt.strokeType=y),f&&s.setInfo(r.name,_objectSpread(_objectSpread({},f),{},{opt:g})),Et.updateNodeOpt(t);}}]);}(Et);var Ce=/*#__PURE__*/function(){function Ce(){_classCallCheck(this,Ce);}return _createClass(Ce,null,[{key:"bezier",value:function bezier(e,t){var r=[];for(var n=0;n<t.length;n+=4){var s=t[n],l=t[n+1],o=t[n+2],a=t[n+3];s&&l&&o&&a?r.push.apply(r,_toConsumableArray(Ce.getBezierPoints(e,s,l,o,a))):s&&l&&o?r.push.apply(r,_toConsumableArray(Ce.getBezierPoints(e,s,l,o))):s&&l?r.push.apply(r,_toConsumableArray(Ce.getBezierPoints(e,s,l))):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 l=null;var o=[];!n&&!s?l=Ce.oneBezier:n&&!s?l=Ce.twoBezier:n&&s&&(l=Ce.threeBezier);for(var a=0;a<e;a++)l&&o.push(l(a/e,t,r,n,s));return s?o.push(s):n&&o.push(n),o;}/**
|
|
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 ot(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,l=(1-e)*(1-e)*t.y+2*e*(1-e)*r.y+e*e*n.y;return new ot(s,l);}/**
|
|
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 l=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,o=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 ot(l,o);}}]);}();var _i=/*#__PURE__*/function(_Et10){function _i(t){var _this81;_classCallCheck(this,_i);_this81=_callSuper(this,_i,[t]);at(_this81,"canRotate",!1);at(_this81,"scaleType",Qt.all);at(_this81,"toolsType",xt.SpeechBalloon);at(_this81,"ratio",0.8);at(_this81,"tmpPoints",[]);at(_this81,"workOptions");at(_this81,"oldRect");at(_this81,"syncTimestamp");_this81.workOptions=t.toolsOpt,_this81.syncTimestamp=0,_this81.syncUnitTime=50;return _this81;}_inherits(_i,_Et10);return _createClass(_i,[{key:"consume",value:function consume(t){var M;var r=t.data,n=t.isFullWork,s=t.isSubWorker,l=t.isMainThread,o=t.smoothSync,a=(M=r==null?void 0:r.workId)==null?void 0:M.toString();if(!a)return{type:dt.None};var c=r.op,y=c==null?void 0:c.length;if(!y||y<2)return{type:dt.None};var f;if(this.tmpPoints.length===0?(this.tmpPoints=[new Dt(c[0],c[1])],f=!1):f=this.updateTempPoints(c),!f)return{type:dt.None};var g;if(s||l){var S=n?this.fullLayer:this.drawLayer||this.fullLayer;g=this.draw({workId:a,layer:S,isDrawing:!0});}if(!s&&o){var _S7=Date.now();return _S7-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_S7,_objectSpread({type:dt.DrawWork,dataType:bt.Local,op:this.tmpPoints.map(function(P){return[].concat(_toConsumableArray(P.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:dt.None};}var x=Wt(g,this.oldRect);return this.oldRect=g,_objectSpread({rect:x,type:dt.DrawWork,dataType:bt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:dt.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(a){return[].concat(_toConsumableArray(a.XY),[0]);}).flat(1),l=ye(s);return(o=this.vNodes)==null||o.setInfo(t,{rect:n,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&Et.getCenterPos(n,r)}),_objectSpread(_objectSpread({rect:n,type:dt.FullWork,dataType:bt.Local,ops:l,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$workOptions12=this.workOptions,l=_this$workOptions12.strokeColor,o=_this$workOptions12.fillColor,a=_this$workOptions12.thickness,c=_this$workOptions12.zIndex,y=_this$workOptions12.placement,f=_this$workOptions12.scale,g=_this$workOptions12.rotate,x=_this$workOptions12.translate,M=_this$workOptions12.strokeType,S=_this$workOptions12.eraserlines,_this$computDrawPoint8=this.computDrawPoints(a,y),P=_this$computDrawPoint8.rect,C=_this$computDrawPoint8.pos,h=_this$computDrawPoint8.points,p={points:h.map(function(w){return w.XY;}),lineWidth:a,fillColor:o!=="transparent"&&o||void 0,strokeColor:l,normalize:!0,className:"".concat(C[0],",").concat(C[1]),close:!0,lineJoin:"round",lineCap:"round",lineDash:M===Kt.Dotted?[1,a*2]:M===Kt.LongDotted?[a,a*2]:void 0},d={name:r,id:r,zIndex:c,pos:C,anchor:[0.5,0.5],size:[P.w,P.h]};f&&(d.scale=f),g&&(d.rotate=g),x&&(d.translate=x);var v=new me(d),I=new Le(_objectSpread(_objectSpread({},p),{},{pos:[0,0]}));v.append(I),S&&(this.scaleType=Qt.proportional,this.drawEraserlines({group:v,eraserlines:S,pos:C,layer:n},s)),this.replace(n,r,v);var L=v.getBoundingClientRect();return this.isDelete&&v.setAttribute("opacity",0),{x:Math.floor(L.x-Et.SafeBorderPadding),y:Math.floor(L.y-Et.SafeBorderPadding),w:Math.floor(L.width+Et.SafeBorderPadding*2),h:Math.floor(L.height+Et.SafeBorderPadding*2)};}},{key:"transformControlPoints",value:function transformControlPoints(t){var r=_t(this.tmpPoints);switch(t){case"bottom":case"bottomLeft":case"bottomRight":{var n=r.y+r.h*this.ratio;return[new ot(r.x,r.y,0),new ot(r.x+r.w,r.y,0),new ot(r.x+r.w,n,0),new ot(r.x,n,0)];}case"top":case"topLeft":case"topRight":{var _n4=r.y+r.h*(1-this.ratio);return[new ot(r.x,_n4,0),new ot(r.x+r.w,_n4,0),new ot(r.x+r.w,r.y+r.h,0),new ot(r.x,r.y+r.h,0)];}case"left":case"leftBottom":case"leftTop":{var _n5=r.x+r.w*(1-this.ratio);return[new ot(_n5,r.y,0),new ot(r.x+r.w,r.y,0),new ot(r.x+r.w,r.y+r.h,0),new ot(_n5,r.y+r.h,0)];}case"right":case"rightBottom":case"rightTop":{var _n6=r.x+r.w*this.ratio;return[new ot(r.x,r.y,0),new ot(_n6,r.y,0),new ot(_n6,r.y+r.h,0),new ot(r.x,r.y+r.h,0)];}}}},{key:"computDrawPoints",value:function computDrawPoints(t,r){var n=_t(this.tmpPoints),s=this.transformControlPoints(r),l=Math.floor(n.w*0.1),o=Math.floor(n.h*0.1),a=[],c=ot.Add(s[0],new ot(0,o,0)),y=ot.Add(s[0],new ot(l,0,0)),f=Ce.getBezierPoints(10,c,s[0],y),g=ot.Sub(s[1],new ot(l,0,0)),x=ot.Add(s[1],new ot(0,o,0)),M=Ce.getBezierPoints(10,g,s[1],x),S=ot.Sub(s[2],new ot(0,o,0)),P=ot.Sub(s[2],new ot(l,0,0)),C=Ce.getBezierPoints(10,S,s[2],P),h=ot.Add(s[3],new ot(l,0,0)),p=ot.Sub(s[3],new ot(0,o,0)),d=Ce.getBezierPoints(10,h,s[3],p),v=l*(1-this.ratio)*10,I=o*(1-this.ratio)*10;switch(r){case"bottom":{var B=ot.Sub(s[2],new ot(l*5-v/2,0,0)),E=ot.Sub(s[2],new ot(l*5,-I,0)),b=ot.Sub(s[2],new ot(l*5+v/2,0,0));a.push.apply(a,[E,b].concat(_toConsumableArray(d),_toConsumableArray(f),_toConsumableArray(M),_toConsumableArray(C),[B]));break;}case"bottomRight":{var _B11=ot.Sub(s[2],new ot(l*1.1,0,0)),_E9=ot.Sub(s[2],new ot(l*1.1+v/2,-I,0)),_b9=ot.Sub(s[2],new ot(l*1.1+v,0,0));a.push.apply(a,[_E9,_b9].concat(_toConsumableArray(d),_toConsumableArray(f),_toConsumableArray(M),_toConsumableArray(C),[_B11]));break;}case"bottomLeft":{var _B12=ot.Add(s[3],new ot(l*1.1+v,0,0)),_E10=ot.Add(s[3],new ot(l*1.1+v/2,I,0)),_b10=ot.Add(s[3],new ot(l*1.1,0,0));a.push.apply(a,[_E10,_b10].concat(_toConsumableArray(d),_toConsumableArray(f),_toConsumableArray(M),_toConsumableArray(C),[_B12]));break;}case"top":{var _B13=ot.Sub(s[1],new ot(l*5-v/2,0,0)),_E11=ot.Sub(s[1],new ot(l*5,I,0)),_b11=ot.Sub(s[1],new ot(l*5+v/2,0,0));a.push.apply(a,[_E11,_B13].concat(_toConsumableArray(M),_toConsumableArray(C),_toConsumableArray(d),_toConsumableArray(f),[_b11]));break;}case"topRight":{var _B14=ot.Sub(s[1],new ot(l*1.1,0,0)),_E12=ot.Sub(s[1],new ot(l*1.1+v/2,I,0)),_b12=ot.Sub(s[1],new ot(l*1.1+v,0,0));a.push.apply(a,[_E12,_B14].concat(_toConsumableArray(M),_toConsumableArray(C),_toConsumableArray(d),_toConsumableArray(f),[_b12]));break;}case"topLeft":{var _B15=ot.Add(s[0],new ot(l*1.1+v,0,0)),_E13=ot.Add(s[0],new ot(l*1.1+v/2,-I,0)),_b13=ot.Add(s[0],new ot(l*1.1,0,0));a.push.apply(a,[_E13,_B15].concat(_toConsumableArray(M),_toConsumableArray(C),_toConsumableArray(d),_toConsumableArray(f),[_b13]));break;}case"left":{var _B16=ot.Add(s[0],new ot(0,o*5-I/2,0)),_E14=ot.Add(s[0],new ot(-v,o*5,0)),_b14=ot.Add(s[0],new ot(0,o*5+I/2,0));a.push.apply(a,[_E14,_B16].concat(_toConsumableArray(f),_toConsumableArray(M),_toConsumableArray(C),_toConsumableArray(d),[_b14]));break;}case"leftTop":{var _B17=ot.Add(s[0],new ot(0,o*1.1,0)),_E15=ot.Add(s[0],new ot(-v,o*1.1+I/2,0)),_b15=ot.Add(s[0],new ot(0,o*1.1+I,0));a.push.apply(a,[_E15,_B17].concat(_toConsumableArray(f),_toConsumableArray(M),_toConsumableArray(C),_toConsumableArray(d),[_b15]));break;}case"leftBottom":{var _B18=ot.Sub(s[3],new ot(0,o*1.1+I,0)),_E16=ot.Sub(s[3],new ot(v,o*1.1+I/2,0)),_b16=ot.Sub(s[3],new ot(0,o*1.1,0));a.push.apply(a,[_E16,_B18].concat(_toConsumableArray(f),_toConsumableArray(M),_toConsumableArray(C),_toConsumableArray(d),[_b16]));break;}case"right":{var _B19=ot.Add(s[1],new ot(0,o*5-I/2,0)),_E17=ot.Add(s[1],new ot(v,o*5,0)),_b17=ot.Add(s[1],new ot(0,o*5+I/2,0));a.push.apply(a,[_E17,_b17].concat(_toConsumableArray(C),_toConsumableArray(d),_toConsumableArray(f),_toConsumableArray(M),[_B19]));break;}case"rightTop":{var _B20=ot.Add(s[1],new ot(0,o*1.1,0)),_E18=ot.Add(s[1],new ot(v,o*1.1+I/2,0)),_b18=ot.Add(s[1],new ot(0,o*1.1+I,0));a.push.apply(a,[_E18,_b18].concat(_toConsumableArray(C),_toConsumableArray(d),_toConsumableArray(f),_toConsumableArray(M),[_B20]));break;}case"rightBottom":{var _B21=ot.Sub(s[2],new ot(0,o*1.1+I,0)),_E19=ot.Sub(s[2],new ot(-v,o*1.1+I/2,0)),_b19=ot.Sub(s[2],new ot(0,o*1.1,0));a.push.apply(a,[_E19,_b19].concat(_toConsumableArray(C),_toConsumableArray(d),_toConsumableArray(f),_toConsumableArray(M),[_B21]));break;}}var L=_t(this.tmpPoints,t),w=[Math.floor(L.x+L.w/2),Math.floor(L.y+L.h/2)];return{rect:L,pos:w,points:a};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=t.slice(-2),n=new Dt(r[0],r[1]),s=this.tmpPoints[0],l=this.workOptions.thickness;if(s.isNear(n,l)||Dt.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 c,y;var r=t.op,n=t.isFullWork,_t$workState7=t.workState,s=_t$workState7===void 0?Ft.Done:_t$workState7,l=(c=this.workId)==null?void 0:c.toString();if(!l)return;this.tmpPoints.length=0;for(var f=0;f<r.length;f+=3)this.tmpPoints.push(new Dt(r[f],r[f+1],r[f+2]));var o=n?this.fullLayer:this.drawLayer||this.fullLayer,a=this.draw({workId:l,layer:o,isDrawing:!1,isDrawEraserlines:s===Ft.Done});return this.oldRect=a,(y=this.vNodes)==null||y.setInfo(l,{rect:a,op:r,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&Et.getCenterPos(a,o)}),a;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var M;var r=t.node,n=t.opt,s=t.vNodes,l=n.strokeColor,o=n.fillColor,a=n.toolsType,c=n.placement,y=n.strokeType,f=s.get(r.name),g=f==null?void 0:f.opt;var x=r;return r.tagName==="GROUP"&&(x=r.children[0]),l&&(x.setAttribute("strokeColor",l),g!=null&&g.strokeColor&&(g.strokeColor=l)),o&&(o==="transparent"?x.setAttribute("fillColor","rgba(0,0,0,0)"):x.setAttribute("fillColor",o),g!=null&&g.fillColor&&(g.fillColor=o)),a===xt.SpeechBalloon&&c&&(g.placement=c),y&&f!=null&&f.opt&&(M=f.opt)!=null&&M.strokeType&&(f.opt.strokeType=y),f&&s.setInfo(r.name,_objectSpread(_objectSpread({},f),{},{opt:g})),Et.updateNodeOpt(t);}}]);}(Et);var im=Je,sm=we,om="[object Boolean]";function am(u){return u===!0||u===!1||sm(u)&&im(u)==om;}var lm=am,He=/* @__PURE__ */Ne(lm);var ar=/*#__PURE__*/function(_Et11){function ar(t){var _this82;_classCallCheck(this,ar);_this82=_callSuper(this,ar,[t]);at(_this82,"canRotate",!0);at(_this82,"scaleType",Qt.all);at(_this82,"toolsType",xt.Image);at(_this82,"tmpPoints",[]);at(_this82,"workOptions");at(_this82,"oldRect");_this82.workOptions=t.toolsOpt,_this82.scaleType=ar.getScaleType(_this82.workOptions);return _this82;}_inherits(ar,_Et11);return _createClass(ar,[{key:"consume",value:function consume(){return{type:dt.None};}},{key:"consumeAll",value:function consumeAll(){return{type:dt.None};}},{key:"draw",value:function draw(t){var r=t.layer,n=t.workId,s=t.replaceId,l=t.imageBitmap,_this$workOptions13=this.workOptions,o=_this$workOptions13.centerX,a=_this$workOptions13.centerY,c=_this$workOptions13.width,y=_this$workOptions13.height,f=_this$workOptions13.rotate,g=_this$workOptions13.zIndex,x=_this$workOptions13.eraserlines,M=new me({anchor:[0.5,0.5],pos:[o,a],name:n,size:[c,y],zIndex:g,rotate:f}),S={anchor:[0.5,0.5],pos:[0,0],size:[c,y],texture:l};l||(S.bgcolor="rgba(0,0,0,0.3)");var P=new hi(S);M.append(P),x&&this.drawEraserlines({group:M,eraserlines:x,pos:[o,a],layer:r}),this.replace(r,s||n,M);var C=M.getBoundingClientRect();if(C)return{x:Math.floor(C.x-Et.SafeBorderPadding),y:Math.floor(C.y-Et.SafeBorderPadding),w:Math.floor(C.width+Et.SafeBorderPadding*2),h:Math.floor(C.height+Et.SafeBorderPadding*2)};}},{key:"consumeService",value:function consumeService(){}},{key:"consumeServiceAsync",value:function(){var _consumeServiceAsync=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee23(t){var y,f,g,x,r,n,s,_this$workOptions14,l,o,a,c,M,S;return _regeneratorRuntime().wrap(function _callee23$(_context25){while(1)switch(_context25.prev=_context25.next){case 0:r=t.isFullWork,n=t.replaceId,s=t.worker,_this$workOptions14=this.workOptions,l=_this$workOptions14.src,o=_this$workOptions14.uuid,a=((y=this.workId)==null?void 0:y.toString())||o,c=r?this.fullLayer:this.drawLayer||this.fullLayer;if(!l){_context25.next=8;break;}_context25.next=4;return s.loadImageBitMap({toolsType:this.toolsType,opt:this.workOptions,workId:a,isSubWorker:s instanceof ds});case 4:M=_context25.sent;if(!M){_context25.next=8;break;}S=this.draw({workId:a,layer:c,replaceId:n,imageBitmap:M});return _context25.abrupt("return",(this.oldRect=a&&((g=(f=this.vNodes)==null?void 0:f.get(a))==null?void 0:g.rect)||void 0,(x=this.vNodes)==null||x.setInfo(a,{rect:S,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:S&&Et.getCenterPos(S,c)}),S));case 8:case"end":return _context25.stop();}},_callee23,this);}));function consumeServiceAsync(_x33){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?Qt.proportional:Qt.all;}},{key:"updateNodeOpt",value:function updateNodeOpt(t){var r=t.node,n=t.opt,s=t.vNodes,l=t.targetNode,o=n.translate,a=n.originPoint,c=n.scenePoint,y=n.scale,f=n.angle,g=n.isLocked,x=n.zIndex,M=n.strokeColor,S=l&&he(l)||s.get(r.name);if(!S)return;var P=r.parent;if(P){if(M&&(S.opt.strokeColor=M),ue(x)&&(r.setAttribute("zIndex",x),S.opt.zIndex=x),He(g)&&(S.opt.locked=g),a&&c&&y&&o){var _S$opt=S.opt,_C34=_S$opt.centerX,_h32=_S$opt.centerY,p=_S$opt.width,d=_S$opt.height,v=_S$opt.uniformScale,I=v!==!1?[y[0],y[0]]:y,L=[_C34,_h32],w=[_C34,_h32];mn(w,c,I,o);var B=[w[0]-L[0],w[1]-L[1]];if(S.centerPos=[S.centerPos[0]+B[0],S.centerPos[1]+B[1]],S.opt.width=Math.round(p*I[0]),S.opt.height=Math.round(d*I[1]),S.opt.centerX=w[0],S.opt.centerY=w[1],S.opt.eraserlines){var _iterator31=_createForOfIteratorHelper(S.opt.eraserlines),_step31;try{for(_iterator31.s();!(_step31=_iterator31.n()).done;){var E=_step31.value;var b=E.op,W=E.thickness;E.thickness=Math.round(W*Math.max(y[0],y[1]));for(var D=0;D<b.length;D++)vn(b[D],c,y,o);}}catch(err){_iterator31.e(err);}finally{_iterator31.f();}}}else if(o){if(S.opt.centerX=S.opt.centerX+o[0],S.opt.centerY=S.opt.centerY+o[1],S.centerPos=[S.centerPos[0]+o[0],S.centerPos[1]+o[1]],S.opt.eraserlines){var _iterator32=_createForOfIteratorHelper(S.opt.eraserlines),_step32;try{for(_iterator32.s();!(_step32=_iterator32.n()).done;){var _C35=_step32.value;var _h33=_C35.op;for(var _p12=0;_p12<_h33.length;_p12++){var _d14=_h33[_p12].map(function(v,I){return I%2?v+o[1]:v+o[0];});_C35.op[_p12]=_d14;}}}catch(err){_iterator32.e(err);}finally{_iterator32.f();}}}else if(ue(f))if(S.opt.rotate=f,S.scaleType=ar.getScaleType(S.opt),l){var _C36=ns(S.rect,f);S.rect=_C36;}else{var _C37=Et.getRectFromLayer(P,r.name);S.rect=_C37||S.rect;}return S&&s.setInfo(r.name,S),S==null?void 0:S.rect;}}}]);}(Et);var ts=/*#__PURE__*/function(_Et12){function ts(t){var _this83;_classCallCheck(this,ts);_this83=_callSuper(this,ts,[t]);at(_this83,"canRotate",!1);at(_this83,"scaleType",Qt.both);at(_this83,"toolsType",xt.Straight);at(_this83,"tmpPoints",[]);at(_this83,"workOptions");at(_this83,"oldRect");at(_this83,"straightTipWidth");at(_this83,"syncTimestamp");_this83.workOptions=t.toolsOpt,_this83.straightTipWidth=_this83.workOptions.thickness/2,_this83.syncTimestamp=0,_this83.syncUnitTime=50;return _this83;}_inherits(ts,_Et12);return _createClass(ts,[{key:"consume",value:function consume(t){var r=t.data,n=t.isFullWork,s=t.isSubWorker,l=t.isMainThread,o=t.smoothSync,a=this.workId,c=r.op,y=r.syncUnitTime,f=c==null?void 0:c.length;if(!f||f<2)return{type:dt.None};y&&(this.syncUnitTime=y);var g;if(this.tmpPoints.length===0?(this.tmpPoints=[new Dt(c[0],c[1])],g=!1):g=this.updateTempPoints(c),!g)return{type:dt.None};var x;if(s||l){var S=n?this.fullLayer:this.drawLayer||this.fullLayer;x=this.draw({workId:a,layer:S});}if(!s&&o){var _S8=Date.now();return _S8-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_S8,_objectSpread({type:dt.DrawWork,dataType:bt.Local,op:this.tmpPoints.map(function(P){return[].concat(_toConsumableArray(P.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:dt.None};}var M=Wt(x,this.oldRect);return this.oldRect=x,_objectSpread({rect:M,type:dt.DrawWork,dataType:bt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:dt.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r});this.oldRect=n;var s=this.tmpPoints.map(function(a){return[].concat(_toConsumableArray(a.XY),[0]);}).flat(1),l=ye(s);return(o=this.vNodes)==null||o.setInfo(t,{rect:n,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&Et.getCenterPos(n,r)}),_objectSpread(_objectSpread({rect:n,type:dt.FullWork,dataType:bt.Local,ops:l,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$workOptions15=this.workOptions,l=_this$workOptions15.strokeColor,o=_this$workOptions15.thickness,a=_this$workOptions15.zIndex,c=_this$workOptions15.scale,y=_this$workOptions15.rotate,f=_this$workOptions15.translate,g=_this$workOptions15.strokeType,x=_this$workOptions15.eraserlines,M=n.worldPosition,S=n.worldScaling,_this$computDrawPoint9=this.computDrawPoints(o,g),P=_this$computDrawPoint9.d,C=_this$computDrawPoint9.rect,h=_this$computDrawPoint9.isDot,p=[C.x+C.w/2,C.y+C.h/2],d=new me({pos:p,anchor:[0.5,0.5],size:[C.w,C.h],name:r,id:r,normalize:!0,zIndex:a}),v={pos:[0,0],normalize:!0,d:P,fillColor:l,strokeColor:l,lineDash:g===Kt.Dotted&&!h?[1,o*2]:g===Kt.LongDotted&&!h?[o,o*2]:void 0,lineCap:g===Kt.Normal||h?void 0:"round",lineWidth:g===Kt.Normal||h?0:o};c&&(v.scale=c),y&&(v.rotate=y),f&&(v.translate=f);var I=new be(v);d.append(I),x&&(this.scaleType=Qt.proportional,this.drawEraserlines({group:d,eraserlines:x,pos:p,layer:n},s)),this.replace(n,r,d);var L={x:Math.floor(C.x*S[0]+M[0]-Et.SafeBorderPadding),y:Math.floor(C.y*S[1]+M[1]-Et.SafeBorderPadding),w:Math.floor(C.w*S[0]+2*Et.SafeBorderPadding),h:Math.floor(C.h*S[1]+2*Et.SafeBorderPadding)};if(y||c||f){var w=I.getBoundingClientRect();L={x:Math.floor(w.x-Et.SafeBorderPadding),y:Math.floor(w.y-Et.SafeBorderPadding),w:Math.floor(w.width+Et.SafeBorderPadding*2),h:Math.floor(w.height+Et.SafeBorderPadding*2)};}return this.isDelete&&d.setAttribute("opacity",0),L;}},{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=ot.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),s=ot.Per(n).mul(t/2),l=Dt.Sub(this.tmpPoints[0],s),o=Dt.Add(this.tmpPoints[0],s),a=Dt.Sub(this.tmpPoints[1],s),c=Dt.Add(this.tmpPoints[1],s),y=Dt.GetSemicircleStroke(this.tmpPoints[1],a,-1,8),f=Dt.GetSemicircleStroke(this.tmpPoints[0],o,-1,8),g=[l,a].concat(_toConsumableArray(y),[c,o],_toConsumableArray(f));var x;return r!==Kt.Normal?x=De(this.tmpPoints,!1):x=De(g,!0),{d:x,rect:_t(g),isDot:!1,pos:this.tmpPoints[0].XY};}},{key:"computDotPoints",value:function computDotPoints(t){var r=Dt.GetDotStroke(this.tmpPoints[0],t/2,8);return{d:De(r,!0),rect:_t(r),isDot:!0,pos:this.tmpPoints[0].XY};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=t.slice(-2),n=new Dt(r[0],r[1]),s=this.tmpPoints[0],l=this.workOptions.thickness;if(s.isNear(n,l))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 c,y;var r=t.op,n=t.isFullWork,_t$workState8=t.workState,s=_t$workState8===void 0?Ft.Done:_t$workState8,l=(c=this.workId)==null?void 0:c.toString();if(!l)return;this.tmpPoints.length=0;for(var f=0;f<r.length;f+=3)this.tmpPoints.push(new Dt(r[f],r[f+1],r[f+2]));var o=n?this.fullLayer:this.drawLayer||this.fullLayer,a=this.draw({workId:l,layer:o,isDrawEraserlines:s===Ft.Done});return this.oldRect=a,(y=this.vNodes)==null||y.setInfo(l,{rect:a,op:r,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&Et.getCenterPos(a,o)}),a;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var c,y;var r=t.node,n=t.opt,s=t.vNodes,l=n.strokeColor,o=n.strokeType,a=s.get(r.name);return l&&(r.tagName==="GROUP"?r.children.forEach(function(f){f.setAttribute("strokeColor",l),f.getAttribute("fillColor")&&f.setAttribute("fillColor",l);}):(r.setAttribute("strokeColor",l),r.setAttribute("fillColor",l)),(c=a==null?void 0:a.opt)!=null&&c.strokeColor&&(a.opt.strokeColor=l)),o&&a!=null&&a.opt&&(y=a.opt)!=null&&y.strokeType&&(a.opt.strokeType=o),a&&s.setInfo(r.name,a),Et.updateNodeOpt(t);}}]);}(Et);var Re=/*#__PURE__*/function(_Et13){function Re(t){var _this84;_classCallCheck(this,Re);_this84=_callSuper(this,Re,[t]);at(_this84,"canRotate",!1);at(_this84,"scaleType",Qt.proportional);at(_this84,"toolsType",xt.Text);at(_this84,"tmpPoints",[]);at(_this84,"workOptions");at(_this84,"oldRect");_this84.workOptions=t.toolsOpt;return _this84;}_inherits(Re,_Et13);return _createClass(Re,[{key:"consume",value:function consume(){return{type:dt.None};}},{key:"consumeAll",value:function consumeAll(){return{type:dt.None};}},{key:"consumeService",value:function consumeService(){}},{key:"draw",value:function(){var _draw3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee24(t){var r,n,s,_this$workOptions16,l,o,a,c,y,f,g,x,M,S,P,_C38;return _regeneratorRuntime().wrap(function _callee24$(_context26){while(1)switch(_context26.prev=_context26.next){case 0:r=t.workId,n=t.layer,s=t.isDrawLabel,_this$workOptions16=this.workOptions,l=_this$workOptions16.boxSize,o=_this$workOptions16.boxPoint,a=_this$workOptions16.zIndex,c=n.worldPosition,y=n.worldScaling;if(!(!o||!l)){_context26.next=3;break;}return _context26.abrupt("return");case 3:f={name:r,id:r,pos:[o[0],o[1]],anchor:[0,0],size:l,zIndex:a},g=new me(f),x={x:o[0],y:o[1],w:l[0],h:l[1]},M={x:Math.floor(x.x*y[0]+c[0]),y:Math.floor(x.y*y[1]+c[1]),w:Math.floor(x.w*y[0])+2,h:Math.floor(x.h*y[1])+2};if(!(this.replace(n,r,g),s&&n&&this.workOptions.text)){_context26.next=11;break;}_context26.next=7;return Re.createLabels(this.workOptions,n,M);case 7:S=_context26.sent;P=S.labels;_C38=S.maxWidth;g.append.apply(g,_toConsumableArray(P)),M.w=Math.ceil(Math.max(_C38*n.worldScaling[0],M.w));case 11:return _context26.abrupt("return",M);case 12:case"end":return _context26.stop();}},_callee24,this);}));function draw(_x34){return _draw3.apply(this,arguments);}return draw;}()},{key:"consumeServiceAsync",value:function(){var _consumeServiceAsync2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee25(t){var c,y,f,g,r,n,s,l,o,a;return _regeneratorRuntime().wrap(function _callee25$(_context27){while(1)switch(_context27.prev=_context27.next){case 0:r=(c=this.workId)==null?void 0:c.toString();if(r){_context27.next=3;break;}return _context27.abrupt("return");case 3:n=t.isFullWork,s=t.replaceId,l=t.isDrawLabel;this.oldRect=s&&((f=(y=this.vNodes)==null?void 0:y.get(s))==null?void 0:f.rect)||void 0;o=n?this.fullLayer:this.drawLayer||this.fullLayer;_context27.next=8;return this.draw({workId:r,layer:o,isDrawLabel:_typeof(l)>"u"&&this.workOptions.workState===Ft.Done||l});case 8:a=_context27.sent;return _context27.abrupt("return",((g=this.vNodes)==null||g.setInfo(r,{rect:a,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&Et.getCenterPos(a,o)}),a));case 10:case"end":return _context27.stop();}},_callee25,this);}));function consumeServiceAsync(_x35){return _consumeServiceAsync2.apply(this,arguments);}return consumeServiceAsync;}()},{key:"updataOptService",value:function updataOptService(){}},{key:"updataOptServiceAsync",value:function(){var _updataOptServiceAsync=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee26(t,r){var M,S,n,s,l,o,a,c,y,f,g,x;return _regeneratorRuntime().wrap(function _callee26$(_context28){while(1)switch(_context28.prev=_context28.next){case 0:if(this.workId){_context28.next=2;break;}return _context28.abrupt("return");case 2:n=this.workId.toString(),s=t.fontColor,l=t.fontBgColor,o=t.bold,a=t.italic,c=t.lineThrough,y=t.underline,f=t.zIndex,g=(M=this.vNodes)==null?void 0:M.get(n);if(g){_context28.next=5;break;}return _context28.abrupt("return");case 5:s&&(g.opt.fontColor=s),l&&(g.opt.fontBgColor=l),o&&(g.opt.bold=o),a&&(g.opt.italic=a),He(c)&&(g.opt.lineThrough=c),He(y)&&(g.opt.underline=y),ue(f)&&(g.opt.zIndex=f),this.oldRect=g.rect;_context28.next=8;return this.draw({workId:n,layer:this.fullLayer,isDrawLabel:_typeof(r)>"u"&&this.workOptions.workState===Ft.Done||r});case 8:x=_context28.sent;return _context28.abrupt("return",((S=this.vNodes)==null||S.setInfo(n,{rect:x,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:x&&Et.getCenterPos(x,this.fullLayer)}),x));case 10:case"end":return _context28.stop();}},_callee26,this);}));function updataOptServiceAsync(_x36,_x37){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>=0.2&&n<1?s=n*r:n<=2&&n>=1?s=n*r*1.6:n>2&&n<=3?s=n*r*1.4:n>3&&n<=4?s=n*r*0.8:n>4&&(s=n*r*0.6),Math.floor(s*1e3)/1e3;}},{key:"getSafetySnippetFontLength",value:function getSafetySnippetFontLength(t){return Math.floor(Re.textImageSnippetSize*3/4/t)||1;}},{key:"createLabels",value:function(){var _createLabels=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee27(t,r,n){var b,s,l,o,_ref168,a,c,y,f,g,x,M,S,P,C,h,p,d,v,I,L,w,B,E,W,D,R,Y,V,Q,et,it,$,K,rt,ct,gt,st,Ot,St,F,z,Z,tt,lt,_st2,_Ot,_St,_st3,_Ot2,_ct3,_gt2;return _regeneratorRuntime().wrap(function _callee27$(_context29){while(1)switch(_context29.prev=_context29.next){case 0:s=[],l=n.x,o=n.y,_ref168=(b=r.parent)==null?void 0:b.parent,a=_ref168.width,c=_ref168.height,y=Ze(t.text),f=y.length,g=t.fontSize,x=t.lineHeight,M=t.bold,S=t.textAlign,P=t.italic,C=t.fontFamily,h=t.verticalAlign,p=t.fontColor,d=t.fontBgColor,v=t.underline,I=t.lineThrough,L=Re.getSafetySnippetRatio(r)||1,w=Math.floor(g*L),B=Re.getSafetySnippetFontLength(w);E=0;W=0;case 3:if(!(W<f)){_context29.next=33;break;}D=y[W],R=x||w*1.5;if(!D){_context29.next=30;break;}Y=Pm(D),V=[0,0],Q=[0,g*1.2];h==="middle"&&(V[1]=W*g*1.2+5);et=[0,-g*0.15];V[0]=5;it=Math.sin(Math.PI/180*20);$=0;K=[];rt=0;case 14:if(!(rt<Y)){_context29.next=27;break;}S==="left"&&(et[0]=$),rt===0&&P==="italic"&&(et[0]=et[0]-it/2*g);ct=D.slice(rt,rt+B);gt={anchor:[0,0],pos:et,text:ct,fontFamily:C,fontSize:w,lineHeight:R,strokeColor:p,fontWeight:M,fillColor:p,textAlign:S,fontStyle:P,scale:[1/L,1/L]};st=new po(gt);_context29.next=21;return st.textImageReady;case 21:Ot=_context29.sent;St=!0;if(Ot){F=Ot.rect&&Ot.rect[2],z=Ot.rect&&Ot.rect[3];if(F&&z){Z=F/L,tt=z/L;$=Z+$,P==="italic"&&(M==="bold"?$=$-it*g*1.2:$=$-it*g),((et[0]+V[0]+Z)*r.worldScaling[0]+l<=0||(et[0]+V[0])*r.worldScaling[0]+l>=a||(et[1]+V[1]+tt)*r.worldScaling[1]+o<=0||(et[1]+V[1])*r.worldScaling[1]+o>=c)&&(st.disconnect(),St=!1),St&&K.push(st);}}rt+=B;case 25:_context29.next=14;break;case 27:Q[0]=$,P==="italic"&&(Q[0]=Q[0]+it*g),E=Math.max(E,Q[0]);lt=!0;if(((V[0]+Q[0])*r.worldScaling[0]+l<=0||V[0]*r.worldScaling[0]+l>=a||(V[1]+Q[1])*r.worldScaling[0]+o<=0||V[1]*r.worldScaling[1]+o>=c)&&(lt=!1),lt){if(v){_st2=Math.floor(g/10),_Ot={normalize:!1,pos:[0,g*1.1+_st2/2],lineWidth:_st2,points:[0,0,Math.ceil(Q[0]),0],strokeColor:p,className:"underline"},_St=new Le(_Ot);K.push(_St);}if(I){_st3={normalize:!1,pos:[0,g*1.2/2],lineWidth:Math.floor(g/10),points:[0,0,Math.ceil(Q[0]),0],strokeColor:p,className:"lineThrough"},_Ot2=new Le(_st3);K.push(_Ot2);}_ct3={pos:V,anchor:[0,0],size:Q,bgcolor:d},_gt2=new me(_ct3);_gt2.append.apply(_gt2,K),s.push(_gt2);}case 30:W++;_context29.next=3;break;case 33:return _context29.abrupt("return",{labels:s,maxWidth:E});case 34:case"end":return _context29.stop();}},_callee27);}));function createLabels(_x38,_x39,_x40){return _createLabels.apply(this,arguments);}return createLabels;}()},{key:"updateNodeOpt",value:function updateNodeOpt(t){var r=t.node,n=t.opt,s=t.vNodes,l=t.targetNode,o=n.fontBgColor,a=n.fontColor,c=n.translate,y=n.originPoint,f=n.scenePoint,g=n.scale,x=n.bold,M=n.italic,S=n.lineThrough,P=n.underline,C=n.fontSize,h=n.textInfos,p=n.zIndex,d=l&&he(l)||s.get(r.name);if(!d||!r.parent)return;var I=d.opt;if(ue(p)&&(r.setAttribute("zIndex",p),d.opt.zIndex=p),a&&I.fontColor&&(I.fontColor=a,r.children.forEach(function(L){L.tagName==="GROUP"&&L.children.forEach(function(w){w.tagName==="LABEL"?(w.setAttribute("fillColor",a),w.setAttribute("strokeColor",a)):w.tagName==="POLYLINE"&&w.setAttribute("strokeColor",a);});})),o&&I.fontBgColor&&(I.fontBgColor=o,r.children.forEach(function(L){L.tagName==="GROUP"&&L.setAttribute("bgcolor",o);})),x&&(I.bold=x),M&&(I.italic=M),He(S)&&(I.lineThrough=S),He(P)&&(I.underline=P),C&&(I.fontSize=C),y&&f&&g&&l&&I.boxPoint){var L=h==null?void 0:h.get(r.name);if(L){var b=L.fontSize,W=L.boxSize;I.boxSize=W||I.boxSize,I.fontSize=b||I.fontSize;}var w=[I.boxPoint[0],I.boxPoint[1]];mn(I.boxPoint,f,g,c);var B=[d.op[0],d.op[1]],E=[B[0]-w[0],B[1]-w[1]];if(d.centerPos=[d.centerPos[0]+E[0],d.centerPos[1]+E[1]],d.opt.eraserlines){var _iterator33=_createForOfIteratorHelper(d.opt.eraserlines),_step33;try{for(_iterator33.s();!(_step33=_iterator33.n()).done;){var _b20=_step33.value;var _W10=_b20.op,D=_b20.thickness;_b20.thickness=Math.round(D*Math.max(g[0],g[1]));for(var R=0;R<_W10.length;R++)vn(_W10[R],f,g,c);}}catch(err){_iterator33.e(err);}finally{_iterator33.f();}}}else if(c&&I.boxPoint&&(I.boxPoint=[I.boxPoint[0]+c[0],I.boxPoint[1]+c[1]],d.centerPos=[d.centerPos[0]+c[0],d.centerPos[1]+c[1]],d.opt.eraserlines)){var _iterator34=_createForOfIteratorHelper(d.opt.eraserlines),_step34;try{for(_iterator34.s();!(_step34=_iterator34.n()).done;){var _L7=_step34.value;var _w6=_L7.op;for(var _B22=0;_B22<_w6.length;_B22++){var _E20=_w6[_B22].map(function(b,W){return W%2?b+c[1]:b+c[0];});_L7.op[_B22]=_E20;}}}catch(err){_iterator34.e(err);}finally{_iterator34.f();}}return d&&s.setInfo(r.name,d),d==null?void 0:d.rect;}},{key:"getRectFromLayer",value:function getRectFromLayer(t,r){var n=t.getElementsByName(r)[0];if(n){var s=n.getBoundingClientRect();var l={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(o){if(o.tagName==="GROUP"){var a=n.getBoundingClientRect();l=Wt(l,{x:Math.floor(a.x),y:Math.floor(a.y),w:Math.floor(a.width+2),h:Math.floor(a.height+2)});}}),l;}}}]);}(Et);// 4k
|
|
437
|
+
at(Re,"textImageSnippetSize",1024*4),at(Re,"SafeBorderPadding",30);var lr=Re;var Ke=/*#__PURE__*/function(_Et14){function Ke(t){var _this85;_classCallCheck(this,Ke);_this85=_callSuper(this,Ke,[t]);at(_this85,"canRotate",!1);at(_this85,"scaleType",Qt.none);at(_this85,"toolsType",xt.PencilEraser);at(_this85,"tmpPoints",[]);at(_this85,"workOptions");at(_this85,"worldPosition");at(_this85,"worldScaling");at(_this85,"eraserRect");at(_this85,"eraserPolyline");_this85.workOptions=t.toolsOpt,_this85.worldPosition=_this85.fullLayer.worldPosition,_this85.worldScaling=_this85.fullLayer.worldScaling;return _this85;}/** 批量合并消费本地数据,返回绘制结果 */_inherits(Ke,_Et14);return _createClass(Ke,[{key:"combineConsume",value:function combineConsume(t){var r=t.workerEngine;if(this.tmpPoints.length<2)return{type:dt.None};var n=this.workOptions.thickness,_Ke$eraserSizes$n=Ke.eraserSizes[n],s=_Ke$eraserSizes$n.width,l=_Ke$eraserSizes$n.height,o=Math.round(Math.max(s,l)/this.worldScaling[0]),_this$getChangeNodes=this.getChangeNodes(o,r),a=_this$getChangeNodes.rect,c=_this$getChangeNodes.willNewNodes,y=_this$getChangeNodes.willDeleteNodes;return _objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:dt.DrawWork,rect:a,willNewNodes:c,willDeleteNodes:y});}},{key:"consumeService",value:function consumeService(){}},{key:"updateTempPoints",value:function updateTempPoints(t,r){var n=this.tmpPoints.length-1;var s=Date.now();for(var l=0;l<t.length;l+=2){var o=this.tmpPoints.length,a=new Dt(t[l],t[l+1]);if(o===0){this.tmpPoints.push(a);continue;}var c=o-1,y=this.tmpPoints[c],f=ot.Sub(a,y).uni();a.isNear(y,r/2)||(ot.Equals(f,y.v,0.02)&&(this.tmpPoints.pop(),n--),a.setv(f),a.setT(s),this.tmpPoints.push(a));}return Math.max(n,0);}},{key:"getChangeNodes",value:function getChangeNodes(t,r){var n=/* @__PURE__ */new Map(),s=/* @__PURE__ */new Set();var l;if(!this.vNodes)return{willDeleteNodes:s,willNewNodes:n,rect:l};var o=this.worldPosition;var a=_t(this.tmpPoints,t);a=cr(a,o),a=is(a,this.worldScaling,o);var _this$vNodes$getRectI3=this.vNodes.getRectIntersectRange(a),c=_this$vNodes$getRectI3.nodeRange;if(!c.size)return{willDeleteNodes:s,willNewNodes:n,rect:l};var y=this.computEraserPointLines(this.tmpPoints,90);var _iterator35=_createForOfIteratorHelper(c.entries()),_step35;try{for(_iterator35.s();!(_step35=_iterator35.n()).done;){var _step35$value=_slicedToArray(_step35.value,2),f=_step35$value[0],g=_step35$value[1];if(g.toolsType!==xt.Pencil)continue;var x=cr(g.rect,[-o[0],-o[1]]);x={x:x.x/this.worldScaling[0],y:x.y/this.worldScaling[1],w:x.w/this.worldScaling[0],h:x.h/this.worldScaling[1]};var M=[x.x,x.y,x.x+x.w,x.y+x.h],S=[],P=[];var _iterator36=_createForOfIteratorHelper(y),_step36;try{for(_iterator36.s();!(_step36=_iterator36.n()).done;){var _C41=_step36.value;fn.polyline(_C41,M,S);}}catch(err){_iterator36.e(err);}finally{_iterator36.f();}if(S.length&&g.opt){var _iterator37=_createForOfIteratorHelper(S),_step37;try{for(_iterator37.s();!(_step37=_iterator37.n()).done;){var _C39=_step37.value;var _h34=[];for(var p=0;p<_C39.length;p++)p!==0&&Ae(_C39[p],_C39[p-1])||_h34.push.apply(_h34,_toConsumableArray(_C39[p]));P.push(_h34);}}catch(err){_iterator37.e(err);}finally{_iterator37.f();}}if(P.length&&r){var _C40=r.createWorkShapeNode({workId:f,toolsType:xt.Pencil,toolsOpt:g.opt});_C40.setWorkId(f);var _h35=_C40==null?void 0:_C40.computPencilPoints({op:g.op,eraserPolylines:P,eraserThickness:t});if(l=Wt(l,g.rect),s.add(f),r.removeNode(f),_h35.length)for(var _p13=0;_p13<_h35.length;_p13++){var d="".concat(f,"_").concat(Date.now(),"_").concat(_p13),v=d,L=r.setFullWork({workId:v,opt:g.opt,toolsType:xt.Pencil}).consumeService({op:_h35[_p13],isFullWork:!0,replaceId:v});r.clearWorkShapeNodeCache(v),l=Wt(l,L),n.set(d,_objectSpread(_objectSpread({},g),{},{toolsType:xt.Pencil,rect:L!==null&&L!==void 0?L:g.rect,name:d,op:_h35[_p13]}));}}}}catch(err){_iterator35.e(err);}finally{_iterator35.f();}return{willNewNodes:n,willDeleteNodes:s,rect:l};}},{key:"consume",value:function consume(t){var r=t.data,n=r.op;if(!n||n.length===0)return _objectSpread({type:dt.None},this.baseConsumeResult);var s=this.workOptions.thickness,_Ke$eraserSizes$s=Ke.eraserSizes[s],l=_Ke$eraserSizes$s.width,o=_Ke$eraserSizes$s.height,a=Math.max(l,o)/this.worldScaling[0];return this.updateTempPoints(n,a),_objectSpread({type:dt.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 l=360-r;for(var o=1;o<t.length;o++){var a=t[o-1],c=t[o];if(o===1&&s===0&&(n[s]=[a.XY]),n[s].push(c.XY),o<t.length-1){var y=c.getAngleByPoints(a,t[o+1]);(y<r||y>l)&&(s++,n[s]=[c.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:dt.None},this.baseConsumeResult);var n=this.workOptions.thickness,_Ke$eraserSizes$n2=Ke.eraserSizes[n],s=_Ke$eraserSizes$n2.width,l=_Ke$eraserSizes$n2.height,o=Math.max(s,l)/this.worldScaling[0],_this$getChangeNodes2=this.getChangeNodes(o,r),a=_this$getChangeNodes2.willDeleteNodes,c=_this$getChangeNodes2.willNewNodes,y=_this$getChangeNodes2.rect;if(a.size===0&&c.size===0)return _objectSpread(_objectSpread({type:dt.FullWork},this.baseConsumeResult),{},{rect:y});var f=[];this.tmpPoints.map(function(x){f.push(x.x,x.y,o/2);});var g=ye(f);return _objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:dt.FullWork,dataType:bt.Local,rect:y,ops:g,willNewNodes:c,willDeleteNodes:a});}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}]);}(Et);// 来源于white-sdk
|
|
438
|
+
at(Ke,"eraserSizes",ln);var Ir=Ke;var ke=/*#__PURE__*/function(_Et15){function ke(t){var _this86;_classCallCheck(this,ke);_this86=_callSuper(this,ke,[t]);at(_this86,"canRotate",!1);at(_this86,"scaleType",Qt.none);at(_this86,"toolsType",xt.BitMapEraser);at(_this86,"tmpPoints",[]);at(_this86,"workOptions");at(_this86,"worldPosition");at(_this86,"worldScaling");at(_this86,"eraserRect");at(_this86,"eraserPolyline");at(_this86,"oldRect");_this86.workOptions=t.toolsOpt,_this86.worldPosition=_this86.fullLayer.worldPosition,_this86.worldScaling=_this86.fullLayer.worldScaling;return _this86;}/** 批量合并消费本地数据,返回绘制结果 */_inherits(ke,_Et15);return _createClass(ke,[{key:"combineConsume",value:function combineConsume(t){var r=t.workerEngine;if(this.tmpPoints.length<2)return{type:dt.None};var n=this.workOptions.thickness,_ke$eraserSizes$n=ke.eraserSizes[n],s=_ke$eraserSizes$n.width,l=_ke$eraserSizes$n.height,o=Math.round(Math.max(s,l)/this.worldScaling[0]),_this$getChangeNodes3=this.getChangeNodes(o,r),a=_this$getChangeNodes3.willDeleteNodes,c=_this$getChangeNodes3.rect;return _objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:dt.DrawWork,rect:c,willDeleteNodes:a});}},{key:"consumeService",value:function consumeService(){}},{key:"updateTempPoints",value:function updateTempPoints(t,r){var n=this.tmpPoints.length-1;var s=Date.now();for(var l=0;l<t.length;l+=2){var o=this.tmpPoints.length,a=new Dt(t[l],t[l+1]);if(o===0){this.tmpPoints.push(a);continue;}var c=o-1,y=this.tmpPoints[c],f=ot.Sub(a,y).uni();a.isNear(y,r/2)||(ot.Equals(f,y.v,0.02)&&(this.tmpPoints.pop(),n--),a.setv(f),a.setT(s),this.tmpPoints.push(a));}return Math.max(n,0);}},{key:"getChangeNodes",value:function getChangeNodes(t,r){var _this87=this;var n=/* @__PURE__ */new Map(),s=/* @__PURE__ */new Set();var l;if(!this.vNodes)return{willDeleteNodes:s,willUpdateNodes:n,rect:l};var o=this.worldPosition;var a=_t(this.tmpPoints,t);a=cr(a,o),a=is(a,this.worldScaling,o);var _this$vNodes$getRectI4=this.vNodes.getRectIntersectRange(a),c=_this$vNodes$getRectI4.nodeRange;if(!c.size)return{willDeleteNodes:s,willUpdateNodes:n,rect:l};var y=this.computEraserPointLines(this.tmpPoints);var _iterator38=_createForOfIteratorHelper(c.entries()),_step38;try{for(_iterator38.s();!(_step38=_iterator38.n()).done;){var _step38$value=_slicedToArray(_step38.value,2),f=_step38$value[0],g=_step38$value[1];if(g.toolsType===xt.Text||g.toolsType===xt.Image)continue;var x=cr(g.rect,[-o[0],-o[1]]);x={x:x.x/this.worldScaling[0],y:x.y/this.worldScaling[1],w:x.w/this.worldScaling[0],h:x.h/this.worldScaling[1]};var M=[x.x,x.y,x.x+x.w,x.y+x.h],S=[],P=[];var _iterator39=_createForOfIteratorHelper(y),_step39;try{for(_iterator39.s();!(_step39=_iterator39.n()).done;){var _p15=_step39.value;fn.polyline(_p15,M,S);}}catch(err){_iterator39.e(err);}finally{_iterator39.f();}if(S.length&&g.opt){var _iterator40=_createForOfIteratorHelper(S),_step40;try{for(_iterator40.s();!(_step40=_iterator40.n()).done;){var p=_step40.value;var d=[];for(var v=0;v<p.length&&!(isNaN(p[v][0])||isNaN(p[v][1]));v++){var I=p[v].map(function(L){return Math.round(L*100)/100;});if(v!==0){var L=p[v-1].map(function(w){return Math.round(w*100)/100;});if(Ae(I,L))continue;}d.push.apply(d,_toConsumableArray(I));}d.length!==0&&P.push(d);}}catch(err){_iterator40.e(err);}finally{_iterator40.f();}}if(!P.length)continue;var _C42=g.opt.eraserlines?g.opt.eraserlines:[],_h36=_C42.find(function(p){return p.workId===_this87.workId;});if(_h36?_h36.op=P:_C42.push({workId:this.workId,op:P,thickness:t}),g.opt.eraserlines=_C42,r){var _p14=g.toolsType,_d15=r.createWorkShapeNode({workId:f,toolsType:_p14,toolsOpt:g.opt});_d15==null||_d15.setWorkId(f);var _v14=_d15==null?void 0:_d15.consumeService({op:g.op,isFullWork:!0,replaceId:f});if(l=Wt(l,_v14),_d15!=null&&_d15.isDelete){r.removeNode(f),s.add(f);continue;}}n.set(f,g);}}catch(err){_iterator38.e(err);}finally{_iterator38.f();}return{willUpdateNodes:n,willDeleteNodes:s,rect:l};}},{key:"consume",value:function consume(t){var r=t.data,n=r.op;if(!n||n.length===0)return _objectSpread({type:dt.None},this.baseConsumeResult);var s=this.workOptions.thickness,_ke$eraserSizes$s=ke.eraserSizes[s],l=_ke$eraserSizes$s.width,o=_ke$eraserSizes$s.height,a=Math.round(Math.max(l,o)/this.worldScaling[0]);return this.updateTempPoints(n,a),_objectSpread({type:dt.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 l=360-r;for(var o=1;o<t.length;o++){var a=t[o-1],c=t[o];if(o===1&&s===0&&(n[s]=[a.XY]),n[s].push(c.XY),o<t.length-1){var y=c.getAngleByPoints(a,t[o+1]);(y<r||y>l)&&(s++,n[s]=[c.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:dt.None},this.baseConsumeResult);var n=this.workOptions.thickness,_ke$eraserSizes$n2=ke.eraserSizes[n],s=_ke$eraserSizes$n2.width,l=_ke$eraserSizes$n2.height,o=Math.round(Math.max(s,l)/this.worldScaling[0]),_this$getChangeNodes4=this.getChangeNodes(o,r),a=_this$getChangeNodes4.willDeleteNodes,c=_this$getChangeNodes4.willUpdateNodes,y=_this$getChangeNodes4.rect;if(a.size===0&&c.size===0)return _objectSpread(_objectSpread({type:dt.FullWork},this.baseConsumeResult),{},{rect:y});var f=[];this.tmpPoints.map(function(x){f.push(x.x,x.y,o/2);});var g=ye(f);return _objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:dt.FullWork,dataType:bt.Local,rect:y,ops:g,willUpdateNodes:c,willDeleteNodes:a});}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}]);}(Et);// 来源于white-sdk
|
|
439
|
+
at(ke,"eraserSizes",ln);var Mr=ke;function es(u){switch(u){case xt.Arrow:return ki;case xt.Pencil:return Gi;case xt.Straight:return ts;case xt.Ellipse:return Zi;case xt.Polygon:case xt.Triangle:return qi;case xt.Star:case xt.Rhombus:return Qi;case xt.Rectangle:return Ji;case xt.SpeechBalloon:return _i;case xt.Text:return lr;case xt.LaserPen:return Hi;case xt.Eraser:return Tr;case xt.PencilEraser:return Ir;case xt.BitMapEraser:return Mr;case xt.Selector:return Or;case xt.Image:return ar;}}function pn(u,e){var t=u.toolsType,r=_objectWithoutProperties(u,_excluded);switch(t){case xt.Arrow:return new ki(r);case xt.Pencil:return new Gi(r);case xt.Straight:return new ts(r);case xt.Ellipse:return new Zi(r);case xt.Polygon:case xt.Triangle:return new qi(r);case xt.Star:case xt.Rhombus:return new Qi(r);case xt.Rectangle:return new Ji(r);case xt.SpeechBalloon:return new _i(r);case xt.Text:return new lr(r);case xt.LaserPen:return new Hi(r);case xt.Eraser:return new Tr(r,e);case xt.BitMapEraser:return new Mr(r);case xt.PencilEraser:return new Ir(r);case xt.Selector:return r.vNodes?new Or(_objectSpread(_objectSpread({},r),{},{vNodes:r.vNodes,drawLayer:r.fullLayer})):void 0;case xt.Image:return new ar(r);default:return;}}function rs(u){var e=[],t=["PATH","SPRITE","POLYLINE","RECT","ELLIPSE","LABEL"];var _iterator41=_createForOfIteratorHelper(u),_step41;try{for(_iterator41.s();!(_step41=_iterator41.n()).done;){var r=_step41.value;if(r.tagName==="GROUP"&&r.children.length){var n=rs(r.children);e.push.apply(e,_toConsumableArray(n));}r.tagName&&t.includes(r.tagName)&&e.push(r);}}catch(err){_iterator41.e(err);}finally{_iterator41.f();}return e;}function Wt(u,e){if(u&&e){var t=Math.min(u.x,e.x),r=Math.min(u.y,e.y),n=Math.max(u.x+u.w,e.x+e.w),s=Math.max(u.y+u.h,e.y+e.h),l=n-t,o=s-r;return{x:t,y:r,w:l,h:o};}return e||u;}function _t(u){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,l=-1/0;return u.forEach(function(o){var _o$XY=_slicedToArray(o.XY,2),a=_o$XY[0],c=_o$XY[1];r=Math.min(r,a-e),n=Math.min(n,c-e),s=Math.max(s,a+e),l=Math.max(l,c+e);}),t.x=r,t.y=n,t.w=s-r,t.h=l-n,t;}function kr(u,e){return!(u.x+u.w<e.x||u.x>e.x+e.w||u.y+u.h<e.y||u.y>e.y+e.h);}function Jt(u){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:10;return{x:Math.floor(u.x-e),y:Math.floor(u.y-e),w:Math.ceil(u.w+e*2),h:Math.ceil(u.h+e*2)};}function cr(u,e){return{x:u.x+e[0],y:u.y+e[1],w:u.w,h:u.h};}function cm(u,e){var t=new ot(u.x,u.y),r=new ot(u.x+u.w,u.y),n=new ot(u.x+u.w,u.y+u.h),s=new ot(u.x,u.y+u.h),l=new ot(u.x+u.w/2,u.y+u.h/2),o=Math.PI*e/180,a=ot.RotWith(t,l,o),c=ot.RotWith(r,l,o),y=ot.RotWith(n,l,o),f=ot.RotWith(s,l,o);return[a,c,y,f];}function ns(u,e){var t=cm(u,e);return _t(t);}function is(u,e,t){var r=new ot(u.x,u.y),n=new ot(u.x+u.w,u.y),s=new ot(u.x+u.w,u.y+u.h),l=new ot(u.x,u.y+u.h),o=new ot(t[0],t[1]),a=new ot(e[0],e[1]),c=ot.ScaleWOrigin(r,a,o),y=ot.ScaleWOrigin(n,a,o),f=ot.ScaleWOrigin(s,a,o),g=ot.ScaleWOrigin(l,a,o);return _t([c,y,f,g]);}function fm(u,e,t){var r=new ot(e[0],e[1]);for(var n=0;n<u.length;n+=3){var s=new ot(u[n],u[n+1]),l=Math.PI*t/180,o=ot.RotWith(s,r,l);u[n]=o.x,u[n+1]=o.y;}}function hm(u,e,t){var r=new ot(e[0],e[1]);for(var n=0;n<u.length;n+=2){var s=new ot(u[n],u[n+1]),l=Math.PI*t/180,o=ot.RotWith(s,r,l);u[n]=o.x,u[n+1]=o.y;}}function mn(u,e,t){var r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[0,0];var n=new ot(e[0],e[1]);for(var s=0;s<u.length;s+=3){var l=new ot(u[s],u[s+1]),o=new ot(t[0],t[1]),a=ot.ScaleWOrigin(l,o,n);u[s]=a.x+r[0],u[s+1]=a.y+r[1];}}function vn(u,e,t){var r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[0,0];var n=new ot(e[0],e[1]);for(var s=0;s<u.length;s+=2){var l=new ot(u[s],u[s+1]),o=new ot(t[0],t[1]),a=ot.ScaleWOrigin(l,o,n);u[s]=a.x+r[0],u[s+1]=a.y+r[1];}}function um(u,e){return u[0]>=e.x&&u[0]<=e.x+e.w&&u[1]>=e.y&&u[1]<=e.y+e.h;}function ss(u,e){var t=u<=e?1:u/e,r=e<=u?1:e/u;return[t,r];}function dm(u){var _iterator42=_createForOfIteratorHelper(u),_step42;try{for(_iterator42.s();!(_step42=_iterator42.n()).done;){var _e3=_step42.value;if(isNaN(_e3)||_e3===1/0||_e3===-1/0)return!1;}}catch(err){_iterator42.e(err);}finally{_iterator42.f();}return!0;}function pm(u){return u!==Math.floor(u);}function mm(u){var e=u.toString();return e.indexOf(".")!==-1?e.split(".")[1].length:0;}function vm(u,e){for(;e!==0;){var _ref169=[e,u%e];u=_ref169[0];e=_ref169[1];}return u;}var gm=function gm(u){if(u.tagName==="GROUP"){var _e4=Object.getOwnPropertySymbols(u).find(function(t){return t.toString()==="Symbol(sealed)";});if(_e4&&u[_e4])return!0;}return!1;},_pe=function pe(u,e){if(u.mesh&&u.mesh.texture&&u.name==="eraserTexture"){var t=u.mesh.texture.image;e.deleteTexture(t);}else if(u.tagName==="GROUP"&&u&&u.children){var _iterator43=_createForOfIteratorHelper(u.children),_step43;try{for(_iterator43.s();!(_step43=_iterator43.n()).done;){var _t3=_step43.value;_pe(_t3,e);}}catch(err){_iterator43.e(err);}finally{_iterator43.f();}}},Se=function Se(u,e){_pe(u,e),u.removeAllChildren();},ym=function ym(u,e,t){var r=t.parent;if(e){var n=e.children;if(n){var _iterator44=_createForOfIteratorHelper(n),_step44;try{for(_iterator44.s();!(_step44=_iterator44.n()).done;){var s=_step44.value;if(_pe(s,r),s.tagName==="GROUP"){var _iterator45=_createForOfIteratorHelper(s.children),_step45;try{for(_iterator45.s();!(_step45=_iterator45.n()).done;){var l=_step45.value;_pe(l,r);}}catch(err){_iterator45.e(err);}finally{_iterator45.f();}}}}catch(err){_iterator44.e(err);}finally{_iterator44.f();}}}e.parent.replaceChild(u,e);},os=function os(u,e,t){if(u.w+u.x<=0||u.h+u.y<=0||u.w<=0||u.h<=0)return;var r=e.width,n=e.height,s={x:Math.floor(Math.max(0,u.x)),y:Math.floor(Math.max(0,u.y)),w:Math.floor(Math.min(r,u.w)),h:Math.floor(Math.min(n,u.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)),pm(t)){var l=mm(t),o=Math.pow(10,l),a=vm(o,t*o),c=s.x%a,y=s.x-c;y>=0?(s.x=y,s.w=s.w+c):(s.x=0,s.w=s.w+c-y);var f=s.y%a,g=s.y-f;g>=0?(s.y=g,s.h=s.h+f):(s.y=0,s.h=s.h+f-g);}return s;};function ze(u){return"".concat(Er(u.x),",").concat(Er(u.y)," ");}function $e(u,e){return"".concat(Er((u.x+e.x)/2),",").concat(Er((u.y+e.y)/2)," ");}function Er(u){return+u.toFixed(4);}var sr=function sr(u,e){return u.x+u.w<e.x||u.x>e.x+e.w||u.y+u.h<e.y||u.y>e.y+e.h?ge.outside:u.x>=e.x&&u.y>=e.y&&u.x+u.w<=e.x+e.w&&u.y+u.h<=e.y+e.h?ge.inside:ge.intersect;};function Pm(u){var e=0;for(var t=0;t<u.length;t++){var r=u.charCodeAt(t);r>=1&&r<=126||65376<=r&&r<=65439?e++:e+=2;}return e;}var ir="cursorhover",ii=20,Ar="mainView";var xm=/*#__PURE__*/function(){function xm(e,t){_classCallCheck(this,xm);at(this,"viewId");at(this,"scene");at(this,"fullLayer");at(this,"curNodeMap",/* @__PURE__ */new Map());at(this,"targetNodeMap",[]);at(this,"highLevelIds");at(this,"canClearUids");at(this,"localUid");this.viewId=e,this.scene=t;}return _createClass(xm,[{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===xt.Image&&(s.opt.locked||t&&t.disableEraseImage)||s.toolsType===xt.Text&&(s.opt.workState===Ft.Doing||s.opt.workState===Ft.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=he(t.rect)),t.op&&dm(t.op)&&(r.op=he(t.op)),t.canRotate&&(r.canRotate=t.canRotate),t.scaleType&&(r.scaleType=t.scaleType),t.opt&&(r.opt=he(t.opt)),t.toolsType&&(r.toolsType=t.toolsType),t.centerPos&&(r.centerPos=he(t.centerPos)),He(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),l=_step47$value[0],o=_step47$value[1];if(kr(e,o.rect)){if(t&&o.toolsType===xt.Image&&o.opt.locked||r&&o.toolsType===xt.Text&&(o.opt.workState===Ft.Doing||o.opt.workState===Ft.Start))continue;n=Wt(n,o.rect),s.set(l,o);}}}catch(err){_iterator47.e(err);}finally{_iterator47.f();}return{rectRange:n,nodeRange:s};}},{key:"getNodeRectFormShape",value:function getNodeRectFormShape(e,t){var r=es(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=/* @__PURE__ */new Map();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,he(n));}}catch(err){_iterator50.e(err);}finally{_iterator50.f();}return this.targetNodeMap.push(he(t)),this.targetNodeMap.length-1;}},{key:"setTarget",value:function setTarget(){return this.targetNodeMap.push(he(this.curNodeMap)),this.targetNodeMap.length-1;}},{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(or).length===1;}},{key:"isCanClearWorkId",value:function isCanClearWorkId(e){if(this.canClearUids===void 0||this.canClearUids===!0)return!0;if($d(this.canClearUids)){var t=e.split(or);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 as=/*#__PURE__*/function(){function as(e,t,r){_classCallCheck(this,as);at(this,"viewId");at(this,"scene");at(this,"fullLayer");at(this,"vNodes");at(this,"dpr");at(this,"contextType");at(this,"opt");at(this,"cameraOpt");at(this,"isSafari",!1);at(this,"combinePostMsg",/* @__PURE__ */new Set());at(this,"workerTaskId");at(this,"protectedTask");at(this,"hasPriorityDraw",!0);at(this,"delayPostDoneResolve");at(this,"cacheImages",/* @__PURE__ */new Map());at(this,"imageResolveMap",/* @__PURE__ */new Map());at(this,"taskUpdateCameraId");at(this,"debounceUpdateCameraId");var n,s;if(this.viewId=e,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.createRenderLayer(t);}catch(l){if(this.contextType!=="2d")this.contextType="2d",(s=this.scene)==null||s.disconnect(),this.createRenderLayer(t);else throw l;}this.vNodes=new xm(e,this.scene);}return _createClass(as,[{key:"createRenderLayer",value:function createRenderLayer(e){this.scene=this.createScene(e.offscreenCanvasOpt);var t=Te.bufferSize.full,r=Te.bufferSize.sub;this.fullLayer=this.createLayer("fullLayer",this.scene,_objectSpread(_objectSpread({},e.layerOpt),{},{bufferSize:this.viewId===Ar?t:r*2}));}},{key:"updateDpr",value:function(){var _updateDpr=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee28(e){return _regeneratorRuntime().wrap(function _callee28$(_context30){while(1)switch(_context30.prev=_context30.next){case 0:this.dpr=e,this.scene.displayRatio=e;case 1:case"end":return _context30.stop();}},_callee28,this);}));function updateDpr(_x41){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(_ref170){var e=_ref170.timer;e&&clearTimeout(e);}),this.imageResolveMap.clear();}},{key:"setHasPriorityDraw",value:function setHasPriorityDraw(e){this.hasPriorityDraw=e;}},{key:"getPriorityDraw",value:function getPriorityDraw(){return this.hasPriorityDraw;}},{key:"setIsSafari",value:function setIsSafari(e){this.isSafari=e;}},{key:"on",value:function(){var _on=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee29(e){var t,r,n,s,l,o,a,c,_c7,y,f,g;return _regeneratorRuntime().wrap(function _callee29$(_context31){while(1)switch(_context31.prev=_context31.next){case 0:t=e.msgType,r=e.toolsType,n=e.opt,s=e.imageSrc,l=e.imageBitmap,o=e.workId,a=e.dpr;_context31.t0=t;_context31.next=_context31.t0===dt.UpdateDpr?4:_context31.t0===dt.UpdateCamera?9:_context31.t0===dt.Destroy?12:_context31.t0===dt.Clear?14:_context31.t0===dt.UpdateTools?17:_context31.t0===dt.GetImageBitMap?19:21;break;case 4:_context31.t1=ue(a);if(!_context31.t1){_context31.next=8;break;}_context31.next=8;return this.updateDpr(a);case 8:return _context31.abrupt("break",21);case 9:_context31.next=11;return this.updateCamera(e);case 11:return _context31.abrupt("break",21);case 12:this.destroy();return _context31.abrupt("break",21);case 14:_context31.next=16;return this.clearAll();case 16:return _context31.abrupt("break",21);case 17:if(r&&n){c={toolsType:r,toolsOpt:n,combineUnitTime:e.combineUnitTime,maxCombineEraserTime:e.maxCombineEraserTime};this.localWork.setToolsOpt(c);}return _context31.abrupt("break",21);case 19:if(s&&l&&o){_c7=o.toString();this.cacheImages.set(s,{imageBitmap:l,workId:_c7});y=this.imageResolveMap.get(s);if(y){f=y.resolve,g=y.timer;g&&clearTimeout(g),f&&f(s);}this.deleteCachedImagesByWorkId(_c7,s);}return _context31.abrupt("break",21);case 21:case"end":return _context31.stop();}},_callee29,this);}));function on(_x42){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__*/_regeneratorRuntime().mark(function _callee30(e){var _this88=this;var t,r,n,s,l,o,a,c,y,f,g,_this$getIconSize,_this$getIconSize2,P,_C43,_P8,_P9,S;return _regeneratorRuntime().wrap(function _callee30$(_context32){while(1)switch(_context32.prev=_context32.next){case 0:t=e.toolsType,r=e.opt,n=e.workId,s=e.isSubWorker;if(!(t===xt.Image&&r&&n)){_context32.next=19;break;}l=n.toString(),o=r.src,a=r.type,c=r.width,y=r.height,f=r.strokeColor;if(!(!o||!a||!c||!y)){_context32.next=5;break;}return _context32.abrupt("return");case 5:g=o;if(a===Zr.Iconify){_this$getIconSize=this.getIconSize(c,y,this.dpr),_this$getIconSize2=_slicedToArray(_this$getIconSize,2),P=_this$getIconSize2[0],_C43=_this$getIconSize2[1];g="".concat(o,"?width=").concat(P,"&height=").concat(_C43,"&color=").concat(f);}if(!this.cacheImages.has(g)){_context32.next=11;break;}_P8=this.getCachedImages(g);if(!_P8){_context32.next=11;break;}return _context32.abrupt("return",_P8);case 11:if(!this.imageResolveMap.has(g)){_context32.next=15;break;}_P9=this.getCachedImagesByWorkId(l);if(!_P9){_context32.next=15;break;}return _context32.abrupt("return",_P9);case 15:_context32.next=17;return new Promise(function(P){var C=_this88.imageResolveMap.get(g)||{resolve:void 0,timer:void 0};C.timer&&clearTimeout(C.timer),C.resolve=P,C.timer=setTimeout(function(){var h=_this88.imageResolveMap.get(g);h!=null&&h.resolve&&h.resolve(g);},5e3),_this88.imageResolveMap.set(g,C),_this88._post({sp:[{imageSrc:g,workId:l,viewId:_this88.viewId,isgl:!!_this88.fullLayer.parent.gl,isSubWorker:s,type:dt.GetImageBitMap}]});});case 17:S=_context32.sent;return _context32.abrupt("return",(this.imageResolveMap["delete"](S),this.getCachedImages(g)));case 19:case"end":return _context32.stop();}},_callee30,this);}));function loadImageBitMap(_x43){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){this.scene.attr(_objectSpread({},e));var t=e.width,r=e.height;this.scene.container.width=t,this.scene.container.height=r,this.scene.width=t,this.scene.height=r,this.updateLayer({width:t,height:r});}},{key:"updateLayer",value:function updateLayer(e){var t=e.width,r=e.height;this.fullLayer&&(this.fullLayer.parent.setAttribute("width",t),this.fullLayer.parent.setAttribute("height",r),this.fullLayer.setAttribute("size",[t,r]),this.fullLayer.setAttribute("pos",[t*0.5,r*0.5]));}},{key:"getSupportContextType",value:function getSupportContextType(e,t){var r=new OffscreenCanvas(100,100);var n=["2d"];e===Lr.Full&&this.viewId===Ar&&(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(l){throw l;}}}},{key:"createScene",value:function createScene(e){var t=e.width,r=e.height,n=new OffscreenCanvas(t,r);e.contextType&&delete e.contextType;var s=new vo(_objectSpread(_objectSpread({container:n,displayRatio:this.dpr,depth:!1,desynchronized:!0,failIfMajorPerformanceCaveat:!0},e),{},{contextType:this.contextType,id:this.viewId}));return s.setAttribute("id",this.viewId),s;}},{key:"createLayer",value:function createLayer(e,t,r){var n=r.width,s=r.height,l="offscreen-".concat(e),o=t.layer(l,r),a=new me({anchor:[0.5,0.5],pos:[n*0.5,s*0.5],size:[n,s],name:"viewport",id:e});return o.append(a),a;}},{key:"clearAll",value:function(){var _clearAll=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee31(){var e;return _regeneratorRuntime().wrap(function _callee31$(_context33){while(1)switch(_context33.prev=_context33.next){case 0:this.fullLayer&&(this.fullLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),Se(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:case"end":return _context33.stop();}},_callee31,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(),_pe(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__*/_regeneratorRuntime().mark(function _callee32(e){return _regeneratorRuntime().wrap(function _callee32$(_context34){while(1)switch(_context34.prev=_context34.next){case 0:this.combinePostMsg.add(e);_context34.next=3;return this.runBatchPostData();case 3:case"end":return _context34.stop();}},_callee32,this);}));function post(_x44){return _post.apply(this,arguments);}return post;}()},{key:"runBatchPostData",value:function(){var _runBatchPostData=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee33(){var _this89=this;return _regeneratorRuntime().wrap(function _callee33$(_context35){while(1)switch(_context35.prev=_context35.next){case 0:this.workerTaskId||(this.workerTaskId=setTimeout(function(){_this89.workerTaskId=void 0,_this89.combinePost();},16));_context35.t0=this.type===Lr.Full&&!this.delayPostDoneResolve;if(!_context35.t0){_context35.next=6;break;}_context35.next=5;return new Promise(function(t){_this89.delayPostDoneResolve=t;});case 5:_context35.t0=_context35.sent;case 6:_context35.t1=_context35.t0;if(!_context35.t1){_context35.next=9;break;}this.delayPostDoneResolve=void 0;case 9:case"end":return _context35.stop();}},_callee33,this);}));function runBatchPostData(){return _runBatchPostData.apply(this,arguments);}return runBatchPostData;}()},{key:"combinePostData",value:function combinePostData(){var o,a;this.workerTaskId=void 0;var e=[],t=[];var r,n,s;var l=/* @__PURE__ */new Set();var _iterator53=_createForOfIteratorHelper(this.combinePostMsg.values()),_step53;try{for(_iterator53.s();!(_step53=_iterator53.n()).done;){var c=_step53.value;if((o=c.render)!=null&&o.length){var _iterator54=_createForOfIteratorHelper(c.render),_step54;try{for(_iterator54.s();!(_step54=_iterator54.n()).done;){var y=_step54.value;var f=!1;if(y.workId&&l.add(y.workId),y.isClearAll&&(y.rect=this.getSceneRect(),y.isClear=!0,delete y.isClearAll),y.drawCanvas){var g=this.getLayer(y.drawCanvas);if(!g||!(g.parent instanceof mo))continue;if(g.parent.render(),y.isDrawAll){var x=this.getSceneRect();y.rect=x,delete y.isDrawAll;}}var _iterator55=_createForOfIteratorHelper(e),_step55;try{for(_iterator55.s();!(_step55=_iterator55.n()).done;){var _g2=_step55.value;if(y.viewId===_g2.viewId){y.isClear&&_g2.clearCanvas&&_g2.isClear&&_g2.clearCanvas===y.clearCanvas&&(_g2.rect=Wt(_g2.rect,y.rect),f=!0),_g2.drawCanvas&&_g2.drawCanvas===y.drawCanvas&&(_g2.rect=Wt(_g2.rect,y.rect),f=!0);continue;}}}catch(err){_iterator55.e(err);}finally{_iterator55.f();}f||(y.isClear&&!y.drawCanvas?e.unshift(y):e.push(y));}}catch(err){_iterator54.e(err);}finally{_iterator54.f();}}if((a=c.sp)!=null&&a.length){var _iterator56=_createForOfIteratorHelper(c.sp),_step56;try{for(_iterator56.s();!(_step56=_iterator56.n()).done;){var _y11=_step56.value;var _f6=!1;var _iterator57=_createForOfIteratorHelper(t),_step57;try{for(_iterator57.s();!(_step57=_iterator57.n()).done;){var _g3=_step57.value;if(Ae(_y11,_g3)){_f6=!0;break;}}}catch(err){_iterator57.e(err);}finally{_iterator57.f();}_f6||t.push(_y11);}}catch(err){_iterator56.e(err);}finally{_iterator56.f();}}ue(c.fullWorkerDrawCount)&&(r=c.fullWorkerDrawCount),ue(c.subWorkerDrawCount)&&(n=c.subWorkerDrawCount),ue(c.consumeCount)&&(s=c.consumeCount);}}catch(err){_iterator53.e(err);}finally{_iterator53.f();}return this.combinePostMsg.clear(),{render:e,sp:t,fullWorkerDrawCount:r,subWorkerDrawCount:n,consumeCount:s,workIds:l,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 ls=/*#__PURE__*/function(){function ls(e){_classCallCheck(this,ls);at(this,"viewId");at(this,"vNodes");at(this,"thread");at(this,"fullLayer");at(this,"drawLayer");at(this,"_post");at(this,"tmpOpt");at(this,"workShapes",/* @__PURE__ */new Map());at(this,"drawCount",0);at(this,"consumeCount",0);at(this,"syncUnitTime",Te.syncOpt.interval);at(this,"combineUnitTime",Te.bezier.combineUnitTime);at(this,"maxCombineEraserTime",Te.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(ls,[{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 pn(_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 l;return t&&this.workShapes.has(s)?(l=this.workShapes.get(s),l==null||l.setWorkOptions(r)):l=this.createWorkShapeNode({toolsOpt:r,toolsType:n,workId:s}),l?(this.workShapes.set(s,l),l):void 0;}}}]);}();function Sm(u){return u;}var cs=Sm;function Tm(u,e,t){switch(t.length){case 0:return u.call(e);case 1:return u.call(e,t[0]);case 2:return u.call(e,t[0],t[1]);case 3:return u.call(e,t[0],t[1],t[2]);}return u.apply(e,t);}var Cm=Tm,Om=Cm,si=Math.max;function Im(u,e,t){return e=si(e===void 0?u.length-1:e,0),function(){for(var r=arguments,n=-1,s=si(r.length-e,0),l=Array(s);++n<s;)l[n]=r[e+n];n=-1;for(var o=Array(e+1);++n<e;)o[n]=r[n];return o[e]=t(l),Om(u,this,o);};}var Mm=Im;function Em(u){return function(){return u;};}var Am=Em,Lm=Am,oi=yi,wm=cs,Rm=oi?function(u,e){return oi(u,"toString",{configurable:!0,enumerable:!1,value:Lm(e),writable:!0});}:wm,Dm=Rm,bm=800,Nm=16,Bm=Date.now;function Wm(u){var e=0,t=0;return function(){var r=Bm(),n=Nm-(r-t);if(t=r,n>0){if(++e>=bm)return arguments[0];}else e=0;return u.apply(void 0,arguments);};}var Fm=Wm,Um=Dm,jm=Fm,Ym=jm(Um),Xm=Ym,zm=cs,$m=Mm,Gm=Xm;function Hm(u,e){return Gm($m(u,e,zm),u+"");}var Vm=Hm;function Km(u,e,t,r){for(var n=u.length,s=t+(r?1:-1);r?s--:++s<n;)if(e(u[s],s,u))return s;return-1;}var km=Km;function Zm(u){return u!==u;}var Jm=Zm;function Qm(u,e,t){for(var r=t-1,n=u.length;++r<n;)if(u[r]===e)return r;return-1;}var qm=Qm,_m=km,tv=Jm,ev=qm;function rv(u,e,t){return e===e?ev(u,e,t):_m(u,tv,t);}var nv=rv,iv=nv;function sv(u,e){var t=u==null?0:u.length;return!!t&&iv(u,e,0)>-1;}var fs=sv;function ov(u,e,t){for(var r=-1,n=u==null?0:u.length;++r<n;)if(t(e,u[r]))return!0;return!1;}var hs=ov;function av(u,e){for(var t=-1,r=u==null?0:u.length,n=Array(r);++t<r;)n[t]=e(u[t],t,u);return n;}var lv=av,cv=hn,fv=fs,hv=hs,uv=lv,dv=Wr,pv=un,mv=200;function vv(u,e,t,r){var n=-1,s=fv,l=!0,o=u.length,a=[],c=e.length;if(!o)return a;t&&(e=uv(e,dv(t))),r?(s=hv,l=!1):e.length>=mv&&(s=pv,l=!1,e=new cv(e));t:for(;++n<o;){var y=u[n],f=t==null?y:t(y);if(y=r||y!==0?y:0,l&&f===f){for(var g=c;g--;)if(e[g]===f)continue t;a.push(y);}else s(e,f,r)||a.push(y);}return a;}var gv=vv,ai=fr,yv=Ti,Pv=ur,li=ai?ai.isConcatSpreadable:void 0;function xv(u){return Pv(u)||yv(u)||!!(li&&u&&u[li]);}var Sv=xv,Tv=on,Cv=Sv;function us(u,e,t,r,n){var s=-1,l=u.length;for(t||(t=Cv),n||(n=[]);++s<l;){var o=u[s];e>0&&t(o)?e>1?us(o,e-1,t,r,n):Tv(n,o):r||(n[n.length]=o);}return n;}var Ov=us;function Iv(){}var Mv=Iv,Xr=bi,Ev=Mv,Av=dn,Lv=1/0,wv=Xr&&1/Av(new Xr([,-0]))[1]==Lv?function(u){return new Xr(u);}:Ev,Rv=wv,Dv=hn,bv=fs,Nv=hs,Bv=un,Wv=Rv,Fv=dn,Uv=200;function jv(u,e,t){var r=-1,n=bv,s=u.length,l=!0,o=[],a=o;if(t)l=!1,n=Nv;else if(s>=Uv){var c=e?null:Wv(u);if(c)return Fv(c);l=!1,n=Bv,a=new Dv();}else a=e?[]:o;t:for(;++r<s;){var y=u[r],f=e?e(y):y;if(y=t||y!==0?y:0,l&&f===f){for(var g=a.length;g--;)if(a[g]===f)continue t;e&&a.push(f),o.push(y);}else n(a,f,t)||(a!==o&&a.push(f),o.push(y));}return o;}var Yv=jv,Xv=gv,zv=Ov,ci=Yv;function $v(u,e,t){var r=u.length;if(r<2)return r?ci(u[0]):[];for(var n=-1,s=Array(r);++n<r;)for(var l=u[n],o=-1;++o<r;)o!=n&&(s[n]=Xv(s[n]||l,u[o],e,t));return ci(zv(s,1),e,t);}var Gv=$v,Hv=en,Vv=we;function Kv(u){return Vv(u)&&Hv(u);}var kv=Kv,Zv=Ei,Jv=Vm,Qv=Gv,qv=kv,_v=Jv(function(u){return Qv(Zv(u,qv));}),tg=_v,eg=/* @__PURE__ */Ne(tg);var rg=/*#__PURE__*/function(_ls){function rg(t){var _this90;_classCallCheck(this,rg);_this90=_callSuper(this,rg,[t]);at(_this90,"combineTimerId");at(_this90,"combineDrawResolve");at(_this90,"combineDrawActiveId");at(_this90,"drawWorkActiveId");at(_this90,"effectSelectNodeData",/* @__PURE__ */new Set());return _this90;}_inherits(rg,_ls);return _createClass(rg,[{key:"loadImageBitMap",value:function(){var _loadImageBitMap2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee34(t){return _regeneratorRuntime().wrap(function _callee34$(_context36){while(1)switch(_context36.prev=_context36.next){case 0:_context36.next=2;return this.thread.loadImageBitMap(t);case 2:return _context36.abrupt("return",_context36.sent);case 3:case"end":return _context36.stop();}},_callee34,this);}));function loadImageBitMap(_x45){return _loadImageBitMap2.apply(this,arguments);}return loadImageBitMap;}()},{key:"consumeDraw",value:function(){var _consumeDraw=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee35(t,r){var _this91=this;var n,s,l,o,a,c,y,f,g;return _regeneratorRuntime().wrap(function _callee35$(_context37){while(1)switch(_context37.prev=_context37.next){case 0:n=t.op,s=t.workId,l=t.scenePath,o=t.postCount,a=t.smoothSync;if(!(n!=null&&n.length&&s)){_context37.next=48;break;}c=s.toString(),y=this.getWorkShape(c);if(y){_context37.next=5;break;}return _context37.abrupt("return");case 5:f=y.toolsType;if(!(f===xt.LaserPen)){_context37.next=8;break;}return _context37.abrupt("return");case 8:_context37.t0=this.combineDrawActiveId&&this.combineDrawActiveId!==c;if(!_context37.t0){_context37.next=13;break;}this.combineTimerId&&(clearTimeout(this.combineTimerId),this.combineTimerId=void 0,this.combineDrawResolve&&this.combineDrawResolve(!1),this.combineDrawActiveId=void 0);_context37.next=13;return this.consumeDrawAll({workId:this.combineDrawActiveId,scenePath:l,viewId:this.viewId,msgType:dt.DrawWork,dataType:bt.Local},r);case 13:_context37.t1=this.drawWorkActiveId&&this.drawWorkActiveId!==c;if(!_context37.t1){_context37.next=18;break;}_context37.next=17;return this.consumeDrawAll({workId:this.drawWorkActiveId,scenePath:l,viewId:this.viewId,msgType:dt.DrawWork,dataType:bt.Local},r);case 17:this.drawWorkActiveId=void 0;case 18:!this.drawWorkActiveId&&c!==qt&&(this.drawWorkActiveId=c);ue(o)&&(this.consumeCount=o);g=y.consume({data:t,isFullWork:!0,smoothSync:a});_context37.t2=f;_context37.next=_context37.t2===xt.Selector?24:_context37.t2===xt.PencilEraser?30:_context37.t2===xt.BitMapEraser?30:_context37.t2===xt.Eraser?32:_context37.t2===xt.Arrow?35:_context37.t2===xt.Straight?35:_context37.t2===xt.Ellipse?35:_context37.t2===xt.Rectangle?35:_context37.t2===xt.Star?35:_context37.t2===xt.Polygon?35:_context37.t2===xt.SpeechBalloon?35:_context37.t2===xt.Pencil?41:48;break;case 24:_context37.t3=g.type===dt.Select;if(!_context37.t3){_context37.next=29;break;}g.selectIds&&r.runReverseSelectWork(g.selectIds);_context37.next=29;return this.drawSelector(g);case 29:return _context37.abrupt("break",48);case 30:this.drawCount++,this.combineTimerId||(this.combineTimerId=1,this.combineDrawActiveId=c,this.drawEraserCombine(c,this.drawCount).then(function(){_this91.combineTimerId=void 0;}));return _context37.abrupt("break",48);case 32:_context37.next=34;return this.drawEraser(g);case 34:return _context37.abrupt("break",48);case 35:_context37.t4=g;if(!_context37.t4){_context37.next=40;break;}this.drawCount++;_context37.next=40;return this.drawShape(g);case 40:return _context37.abrupt("break",48);case 41:this.drawCount++;!this.combineTimerId&&this.combineUnitTime!==1/0&&new Promise(function(x){_this91.combineDrawActiveId=c,_this91.combineDrawResolve=x,_this91.combineTimerId=setTimeout(function(){_this91.combineTimerId=void 0,_this91.combineDrawResolve&&_this91.combineDrawResolve(!0);},_this91.combineUnitTime);}).then(function(x){x&&_this91.drawPencilCombine(c,_this91.drawCount),_this91.combineDrawResolve=void 0;});_context37.t5=g;if(!_context37.t5){_context37.next=47;break;}_context37.next=47;return this.drawPencil(g);case 47:return _context37.abrupt("break",48);case 48:case"end":return _context37.stop();}},_callee35,this);}));function consumeDraw(_x46,_x47){return _consumeDraw.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee36(t,r){var o,a,c,n,s,l,y,f,g,x,M,S;return _regeneratorRuntime().wrap(function _callee36$(_context38){while(1)switch(_context38.prev=_context38.next){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,l=t.isLockSentEventCursor;if(!n){_context38.next=38;break;}y=n.toString();this.drawWorkActiveId===y&&(this.drawWorkActiveId=void 0);f=this.workShapes.get(y);if(f){_context38.next=8;break;}return _context38.abrupt("return");case 8:g=f.toolsType;if(!(g===xt.LaserPen)){_context38.next=11;break;}return _context38.abrupt("return");case 11:x=this.workShapes.get(ir),M=(o=x==null?void 0:x.selectIds)==null?void 0:o[0],S=f.consumeAll({data:t,workerEngine:this});_context38.t0=g;_context38.next=_context38.t0===xt.Selector?15:_context38.t0===xt.PencilEraser?21:_context38.t0===xt.BitMapEraser?21:_context38.t0===xt.Eraser?26:_context38.t0===xt.Arrow?28:_context38.t0===xt.Straight?28:_context38.t0===xt.Ellipse?28:_context38.t0===xt.Rectangle?28:_context38.t0===xt.Star?28:_context38.t0===xt.Polygon?28:_context38.t0===xt.SpeechBalloon?28:_context38.t0===xt.Pencil?33:38;break;case 15:S.selectIds&&M&&(a=S.selectIds)!=null&&a.includes(M)&&x.cursorBlur();S.selectIds&&r.runReverseSelectWork(S.selectIds);_context38.next=19;return this.drawSelector(_objectSpread(_objectSpread({},S),{},{scenePath:s}),l);case 19:(c=f.selectIds)!=null&&c.length?f.clearTmpPoints():this.clearWorkShapeNodeCache(y);return _context38.abrupt("break",38);case 21:_context38.next=23;return this.drawEraserFull(f,_objectSpread(_objectSpread({},S),{},{scenePath:s}),l);case 23:this.drawCount=0;this.clearWorkShapeNodeCache(y);return _context38.abrupt("break",38);case 26:this.drawEraser(_objectSpread(_objectSpread({},S),{},{scenePath:s}),l),f.clearTmpPoints();return _context38.abrupt("break",38);case 28:_context38.next=30;return this.drawPencilFull(_objectSpread(_objectSpread({},S),{},{scenePath:s}),l);case 30:this.drawCount=0;this.clearWorkShapeNodeCache(y);return _context38.abrupt("break",38);case 33:_context38.next=35;return this.drawPencilFull(_objectSpread(_objectSpread({},S),{},{scenePath:s}),l);case 35:this.drawCount=0;this.clearWorkShapeNodeCache(y);return _context38.abrupt("break",38);case 38:case"end":return _context38.stop();}},_callee36,this);}));function consumeDrawAll(_x48,_x49){return _consumeDrawAll.apply(this,arguments);}return consumeDrawAll;}()},{key:"workShapesDone",value:function(){var _workShapesDone=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee37(t,r){var _iterator58,_step58,n;return _regeneratorRuntime().wrap(function _callee37$(_context39){while(1)switch(_context39.prev=_context39.next){case 0:_iterator58=_createForOfIteratorHelper(this.workShapes.keys());_context39.prev=1;_iterator58.s();case 3:if((_step58=_iterator58.n()).done){_context39.next=9;break;}n=_step58.value;_context39.next=7;return this.consumeDrawAll({workId:n,scenePath:t,viewId:this.viewId,msgType:dt.DrawWork,dataType:bt.Local},r);case 7:_context39.next=3;break;case 9:_context39.next=14;break;case 11:_context39.prev=11;_context39.t0=_context39["catch"](1);_iterator58.e(_context39.t0);case 14:_context39.prev=14;_iterator58.f();return _context39.finish(14);case 17:case"end":return _context39.stop();}},_callee37,this,[[1,11,14,17]]);}));function workShapesDone(_x50,_x51){return _workShapesDone.apply(this,arguments);}return workShapesDone;}()},{key:"consumeFull",value:function(){var _consumeFull=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee38(t){var s,l,r,n,o,a,c,y,f,g,x;return _regeneratorRuntime().wrap(function _callee38$(_context40){while(1)switch(_context40.prev=_context40.next){case 0:r=this.setFullWork(t),n=t.ops&&Ze(t.ops)||t.op;if(!r){_context40.next=26;break;}o=(s=t.workId)==null?void 0:s.toString();if(o){_context40.next=5;break;}return _context40.abrupt("return");case 5:a=(l=this.vNodes.get(o))==null?void 0:l.rect;if(!(r.toolsType===xt.Image)){_context40.next=13;break;}_context40.next=9;return r.consumeServiceAsync({isFullWork:!0,replaceId:o,worker:this});case 9:c=_context40.sent;y=(t==null?void 0:t.updateNodeOpt)&&r.updataOptService(t.updateNodeOpt);_context40.next=20;break;case 13:if(!(r.toolsType===xt.Text)){_context40.next=19;break;}_context40.next=16;return r.consumeServiceAsync({isFullWork:!0,replaceId:o});case 16:c=_context40.sent;_context40.next=20;break;case 19:c=r.consumeService({op:n,isFullWork:!0,replaceId:o}),y=(t==null?void 0:t.updateNodeOpt)&&r.updataOptService(t.updateNodeOpt);case 20:c=Wt(c,y);f=[],g=[];if(!(t.workId&&this.workShapes["delete"](t.workId.toString()),c&&t.willRefresh&&(a&&(f.push({rect:Jt(a),isClear:!0,clearCanvas:Rt.Bg,viewId:this.viewId}),c=Wt(c,a)),f.push({rect:Jt(c),drawCanvas:Rt.Bg,viewId:this.viewId})),t.willSyncService&&g.push({opt:t.opt,toolsType:t.toolsType,type:dt.FullWork,workId:t.workId,ops:t.ops,updateNodeOpt:t.updateNodeOpt,viewId:this.viewId}),f.length||g.length)){_context40.next=26;break;}x={render:f,sp:g};_context40.next=26;return this._post(x);case 26:case"end":return _context40.stop();}},_callee38,this);}));function consumeFull(_x52){return _consumeFull.apply(this,arguments);}return consumeFull;}()},{key:"commandDeleteText",value:function commandDeleteText(t){var r=this.vNodes.get(t);if(r&&r.toolsType===xt.Text)return{type:dt.TextUpdate,toolsType:xt.Text,workId:t,dataType:bt.Local};}},{key:"removeSelector",value:function(){var _removeSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee39(t,r){var n,s,l,o,a,c,_iterator59,_step59,y,x,g;return _regeneratorRuntime().wrap(function _callee39$(_context41){while(1)switch(_context41.prev=_context41.next){case 0:n=t.willSyncService,s=[],l=[],o=[],a=this.workShapes.get(qt);if(a){_context41.next=3;break;}return _context41.abrupt("return");case 3:c=a.selectIds&&_toConsumableArray(a.selectIds)||[];_iterator59=_createForOfIteratorHelper(c);try{for(_iterator59.s();!(_step59=_iterator59.n()).done;){y=_step59.value;if(this.vNodes.get(y)){x=this.commandDeleteText(y);x&&s.push(x);}g=this._removeWork(y);g.length&&l.push.apply(l,_toConsumableArray(g)),r==null||r.deleteCachedImagesByWorkId(y),o.push(y);}}catch(err){_iterator59.e(err);}finally{_iterator59.f();}o.length&&s.push({type:dt.RemoveNode,removeIds:o});s.push({type:dt.Select,selectIds:[],willSyncService:n});_context41.next=10;return this.blurSelector();case 10:_context41.t0=l.length||s.length;if(!_context41.t0){_context41.next=14;break;}_context41.next=14;return this._post({render:l,sp:s});case 14:case"end":return _context41.stop();}},_callee39,this);}));function removeSelector(_x53,_x54){return _removeSelector.apply(this,arguments);}return removeSelector;}()},{key:"removeWork",value:function(){var _removeWork2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee40(t){var r,n,s;return _regeneratorRuntime().wrap(function _callee40$(_context42){while(1)switch(_context42.prev=_context42.next){case 0:r=t.workId,n=r==null?void 0:r.toString();if(!n){_context42.next=7;break;}s=this._removeWork(n);_context42.t0=s.length;if(!_context42.t0){_context42.next=7;break;}_context42.next=7;return this._post({render:s});case 7:case"end":return _context42.stop();}},_callee40,this);}));function removeWork(_x55){return _removeWork2.apply(this,arguments);}return removeWork;}()},{key:"removeNode",value:function removeNode(t){var _this92=this;var s,l,o;var r=this.vNodes.get(t);r&&((s=this.fullLayer)==null||s.getElementsByName(t).forEach(function(a){a.remove(),_pe(a,_this92.fullLayer.parent);}),this.vNodes["delete"](t));var n=this.drawLayer&&Et.getRectFromLayer(this.drawLayer,t);if(n){var a=(l=this.drawLayer)==null?void 0:l.getElementsByName(t)[0];a&&(a.remove(),_pe(a,(o=this.drawLayer)==null?void 0:o.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:Jt(r),clearCanvas:Rt.Bg,isClear:!0,viewId:this.viewId},{rect:Jt(r),drawCanvas:Rt.Bg,viewId:this.viewId}),n&&s.push({rect:Jt(n),clearCanvas:Rt.Float,isClear:!0,viewId:this.viewId},{rect:Jt(n),drawCanvas:Rt.Float,viewId:this.viewId}),s;}},{key:"checkTextActive",value:function(){var _checkTextActive=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee41(t){var r,n,s,l,o,a,c,_iterator60,_step60,y,f,g,x,M;return _regeneratorRuntime().wrap(function _callee41$(_context43){while(1)switch(_context43.prev=_context43.next){case 0:r=t.op,n=t.viewId,s=t.dataType;if(!(r!=null&&r.length)){_context43.next=32;break;}a=r[0]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],c=r[1]*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1];_iterator60=_createForOfIteratorHelper(this.vNodes.curNodeMap.values());_context43.prev=4;_iterator60.s();case 6:if((_step60=_iterator60.n()).done){_context43.next=14;break;}y=_step60.value;f=y.rect,g=y.name,x=y.toolsType,M=y.opt;if(!(x===xt.Text&&M.workState===Ft.Done&&um([a,c],f))){_context43.next=12;break;}l=g,o=this.setFullWork({workId:g,toolsType:x,opt:M});return _context43.abrupt("break",14);case 12:_context43.next=6;break;case 14:_context43.next=19;break;case 16:_context43.prev=16;_context43.t0=_context43["catch"](4);_iterator60.e(_context43.t0);case 19:_context43.prev=19;_iterator60.f();return _context43.finish(19);case 22:_context43.t1=l;if(!_context43.t1){_context43.next=32;break;}_context43.t2=o;if(!_context43.t2){_context43.next=28;break;}_context43.next=28;return o.consumeServiceAsync({isFullWork:!0,replaceId:o.getWorkId(),isDrawLabel:!1});case 28:_context43.next=30;return this.blurSelector({viewId:n,msgType:dt.Select,dataType:s,isSync:!0});case 30:_context43.next=32;return this._post({sp:[{type:dt.GetTextActive,toolsType:xt.Text,workId:l}]});case 32:case"end":return _context43.stop();}},_callee41,this,[[4,16,19,22]]);}));function checkTextActive(_x56){return _checkTextActive.apply(this,arguments);}return checkTextActive;}()},{key:"colloctEffectSelectWork",value:function(){var _colloctEffectSelectWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee42(t){var _this93=this;var r,n,s;return _regeneratorRuntime().wrap(function _callee42$(_context44){while(1)switch(_context44.prev=_context44.next){case 0:r=this.workShapes.get(qt),n=t.workId,s=t.msgType;if(!(r&&n&&r.selectIds&&r.selectIds.includes(n.toString()))){_context44.next=6;break;}s===dt.RemoveNode?r.selectIds=r.selectIds.filter(function(l){return l!==n.toString();}):this.effectSelectNodeData.add(t);_context44.next=5;return this.runEffectSelectWork(!0).then(function(){var l;(l=_this93.effectSelectNodeData)==null||l.clear();});case 5:return _context44.abrupt("return");case 6:return _context44.abrupt("return",t);case 7:case"end":return _context44.stop();}},_callee42,this);}));function colloctEffectSelectWork(_x57){return _colloctEffectSelectWork.apply(this,arguments);}return colloctEffectSelectWork;}()},{key:"updateSelector",value:function(){var _updateSelector2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee43(t){var _this94=this;var S,r,n,s,l,o,a,c,y,f,g,x,M;return _regeneratorRuntime().wrap(function _callee43$(_context45){while(1)switch(_context45.prev=_context45.next){case 0:r=this.workShapes.get(qt);if((S=r==null?void 0:r.selectIds)!=null&&S.length){_context45.next=3;break;}return _context45.abrupt("return");case 3:n=t.callback;s=_objectWithoutProperties(t,_excluded2);l=s.updateSelectorOpt;o=s.willSerializeData;a=s.smoothSync;_context45.next=10;return r==null?void 0:r.updateSelector({updateSelectorOpt:l,selectIds:he(r.selectIds),vNodes:this.vNodes,willSerializeData:o,worker:this});case 10:c=_context45.sent;y=/* @__PURE__ */new Map();c!=null&&c.selectIds&&(f=eg(r.selectIds,c.selectIds),c.selectIds.forEach(function(P){var C=_this94.vNodes.get(P);if(C){var _h37=C.toolsType,p=C.op,d=C.opt;y.set(P,{opt:d,toolsType:_h37,ops:(p==null?void 0:p.length)&&ye(p)||void 0});}}),r.selectIds=c.selectIds);g=[],x=[];c!=null&&c.rect&&g.push({rect:Jt(c.rect),clearCanvas:Rt.Bg,isClear:!0,viewId:this.viewId},{rect:Jt(c.rect),drawCanvas:Rt.Bg,viewId:this.viewId});M=n&&n({res:c,workShapeNode:r,param:s,postData:{render:g,sp:x},newServiceStore:y,smoothSync:a})||{render:g,sp:x};f&&M.sp.push({type:dt.RemoveNode,removeIds:f,viewId:this.viewId});_context45.t0=M.render.length||M.sp.length;if(!_context45.t0){_context45.next=21;break;}_context45.next=21;return this._post(M);case 21:case"end":return _context45.stop();}},_callee43,this);}));function updateSelector(_x58){return _updateSelector2.apply(this,arguments);}return updateSelector;}()},{key:"blurSelector",value:function(){var _blurSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee44(t){var s,r,n,l;return _regeneratorRuntime().wrap(function _callee44$(_context46){while(1)switch(_context46.prev=_context46.next){case 0:r=this.workShapes.get(qt),n=r==null?void 0:r.blurSelector();if(!(this.clearWorkShapeNodeCache(qt),((s=this.fullLayer)==null?void 0:s.parent).children.forEach(function(l){l.name===qt&&l.remove();}),n)){_context46.next=6;break;}l=[];l.push(_objectSpread(_objectSpread({},n),{},{isSync:t==null?void 0:t.isSync}));_context46.next=6;return this._post({render:(n==null?void 0:n.rect)&&[{rect:Jt(n.rect),clearCanvas:Rt.Bg,isClear:!0,viewId:this.viewId},{rect:Jt(n.rect),drawCanvas:Rt.Bg,viewId:this.viewId}],sp:l});case 6:case"end":return _context46.stop();}},_callee44,this);}));function blurSelector(_x59){return _blurSelector.apply(this,arguments);}return blurSelector;}()},{key:"hasSelector",value:function hasSelector(){return this.workShapes.has(qt);}},{key:"getSelector",value:function getSelector(){return this.workShapes.get(qt);}},{key:"reRenderSelector",value:function(){var _reRenderSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee45(){var t,l,r,n,s,o,_args47=arguments;return _regeneratorRuntime().wrap(function _callee45$(_context47){while(1)switch(_context47.prev=_context47.next){case 0:t=_args47.length>0&&_args47[0]!==undefined?_args47[0]:!1;r=this.workShapes.get(qt);if(r){_context47.next=4;break;}return _context47.abrupt("return");case 4:if(!(r&&!((l=r.selectIds)!=null&&l.length))){_context47.next=8;break;}_context47.next=7;return this.blurSelector();case 7:return _context47.abrupt("return");case 8:n=r.oldSelectRect,s=r.reRenderSelector();if(!s){_context47.next=13;break;}o=Wt(n,s)||s;_context47.next=13;return this._post({render:[{rect:Jt(o),clearCanvas:Rt.Bg,isClear:!0,viewId:this.viewId},{rect:Jt(o),drawCanvas:Rt.Bg,viewId:this.viewId}],sp:[{type:dt.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 13:case"end":return _context47.stop();}},_callee45,this);}));function reRenderSelector(){return _reRenderSelector.apply(this,arguments);}return reRenderSelector;}()},{key:"updateFullSelectWork",value:function(){var _updateFullSelectWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee46(t){var s,l,o,a,c,y,f,r,n,_r$updateSelectIds,g,x,M;return _regeneratorRuntime().wrap(function _callee46$(_context48){while(1)switch(_context48.prev=_context48.next){case 0:r=this.workShapes.get(qt),n=t.selectIds;if(n!=null&&n.length){_context48.next=5;break;}_context48.next=4;return this.blurSelector(t);case 4:return _context48.abrupt("return");case 5:if(r){_context48.next=10;break;}!this.setFullWork(t)&&t.workId&&((s=this.tmpOpt)==null?void 0:s.toolsType)===xt.Selector&&this.createWorkShape(t.workId.toString());_context48.next=9;return this.updateFullSelectWork(t);case 9:return _context48.abrupt("return");case 10:if(!(r&&n!=null&&n.length)){_context48.next=16;break;}_r$updateSelectIds=r.updateSelectIds(n),g=_r$updateSelectIds.bgRect,x=_r$updateSelectIds.selectRect,M={render:[],sp:[]};g&&((l=M.render)==null||l.push({rect:Jt(g),clearCanvas:Rt.Bg,isClear:!0,viewId:this.viewId},{rect:Jt(g),drawCanvas:Rt.Bg,viewId:this.viewId}));(f=M.sp)==null||f.push(_objectSpread(_objectSpread({},t),{},{selectorColor:((o=t.opt)==null?void 0:o.strokeColor)||r.selectorColor,strokeColor:((a=t.opt)==null?void 0:a.strokeColor)||r.strokeColor,fillColor:((c=t.opt)==null?void 0:c.fillColor)||r.fillColor,textOpt:((y=t.opt)==null?void 0:y.textOpt)||r.textOpt,canTextEdit:r.canTextEdit,canRotate:r.canRotate,scaleType:r.scaleType,type:dt.Select,selectRect:x,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}));_context48.next=16;return this._post(M);case 16:case"end":return _context48.stop();}},_callee46,this);}));function updateFullSelectWork(_x60){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(rg,"destroy",this,3)([]),this.effectSelectNodeData.clear();}},{key:"drawEraserCombine",value:function(){var _drawEraserCombine=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee47(t,r){var s,l,o,a,n,c,y,f,g,_iterator61,_step61,_step61$value,_g4,x;return _regeneratorRuntime().wrap(function _callee47$(_context49){while(1)switch(_context49.prev=_context49.next){case 0:n=(s=this.workShapes.get(t))==null?void 0:s.combineConsume({workerEngine:this});if(!n){_context49.next=7;break;}c=n.willDeleteNodes,y=n.willNewNodes,f={render:[],fullWorkerDrawCount:r,sp:[]};if(n!=null&&n.rect){g=Jt(n.rect);(l=f.render)==null||l.push({rect:g,isClear:!0,clearCanvas:Rt.Bg,viewId:this.viewId},{rect:g,drawCanvas:Rt.Bg,viewId:this.viewId});}if(c!=null&&c.size&&((o=f.sp)==null||o.push({type:dt.RemoveNode,removeIds:_toConsumableArray(c),viewId:this.thread.viewId})),y!=null&&y.size){_iterator61=_createForOfIteratorHelper(y);try{for(_iterator61.s();!(_step61=_iterator61.n()).done;){_step61$value=_slicedToArray(_step61.value,2),_g4=_step61$value[0],x=_step61$value[1];(a=f.sp)==null||a.push({type:dt.FullWork,dataType:bt.Local,toolsType:xt.Pencil,ops:ye(x.op),opt:x.opt,workId:_g4,updateNodeOpt:{useAnimation:!1}});}}catch(err){_iterator61.e(err);}finally{_iterator61.f();}}_context49.next=7;return this._post(f);case 7:case"end":return _context49.stop();}},_callee47,this);}));function drawEraserCombine(_x61,_x62){return _drawEraserCombine.apply(this,arguments);}return drawEraserCombine;}()},{key:"drawPencilCombine",value:function(){var _drawPencilCombine=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee48(t,r){var s,l,o,n,a,c;return _regeneratorRuntime().wrap(function _callee48$(_context50){while(1)switch(_context50.prev=_context50.next){case 0:n=(s=this.workShapes.get(t))==null?void 0:s.combineConsume();if(!n){_context50.next=6;break;}a={render:[],fullWorkerDrawCount:r};if(n!=null&&n.rect){c=Jt(n.rect);(l=a.render)==null||l.push({rect:c,isClear:!0,clearCanvas:Rt.Float,viewId:this.viewId}),(o=a.render)==null||o.push({rect:c,drawCanvas:Rt.Float,viewId:this.viewId});}_context50.next=6;return this._post(a);case 6:case"end":return _context50.stop();}},_callee48,this);}));function drawPencilCombine(_x63,_x64){return _drawPencilCombine.apply(this,arguments);}return drawPencilCombine;}()},{key:"drawSelector",value:function(){var _drawSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee49(t,r){var s,l,n;return _regeneratorRuntime().wrap(function _callee49$(_context51){while(1)switch(_context51.prev=_context51.next){case 0:n={render:[],sp:[t]};r&&((s=n.sp)==null||s.push({type:dt.None,isLockSentEventCursor:r}));t.rect&&((l=n.render)==null||l.push({rect:Jt(t.rect),clearCanvas:Rt.Bg,isClear:!0,viewId:this.viewId},{rect:Jt(t.rect),drawCanvas:Rt.Bg,viewId:this.viewId}));_context51.next=5;return this._post(n);case 5:case"end":return _context51.stop();}},_callee49,this);}));function drawSelector(_x65,_x66){return _drawSelector.apply(this,arguments);}return drawSelector;}()},{key:"drawPencilFull",value:function(){var _drawPencilFull=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee50(t,r){var s,l,n;return _regeneratorRuntime().wrap(function _callee50$(_context52){while(1)switch(_context52.prev=_context52.next){case 0:n={fullWorkerDrawCount:1/0,render:[],sp:[t]};r&&((s=n.sp)==null||s.push({type:dt.None,isLockSentEventCursor:r}));t!=null&&t.rect&&((l=n.render)==null||l.push({isClearAll:!0,clearCanvas:Rt.Float,viewId:this.viewId},{rect:t.rect,isClear:!0,clearCanvas:Rt.Bg,viewId:this.viewId},{rect:t.rect,drawCanvas:Rt.Bg,viewId:this.viewId}));_context52.next=5;return this._post(n);case 5:case"end":return _context52.stop();}},_callee50,this);}));function drawPencilFull(_x67,_x68){return _drawPencilFull.apply(this,arguments);}return drawPencilFull;}()},{key:"drawEraserFull",value:function(){var _drawEraserFull=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee51(t,r,n){var s,l,o,a,c,y,_iterator62,_step62,_step62$value,g,x,_iterator63,_step63,_step63$value,_g5,_x72,f;return _regeneratorRuntime().wrap(function _callee51$(_context53){while(1)switch(_context53.prev=_context53.next){case 0:s=r.rect,l=r.willUpdateNodes,o=r.willDeleteNodes,a=r.willNewNodes,c=t.getWorkId(),y=[{type:dt.RemoveNode,removeIds:[c],viewId:this.viewId}];if(n&&y.push({type:dt.None,isLockSentEventCursor:n}),l!=null&&l.size||o!=null&&o.size||a!=null&&a.size){if(l!=null&&l.size){_iterator62=_createForOfIteratorHelper(l);try{for(_iterator62.s();!(_step62=_iterator62.n()).done;){_step62$value=_slicedToArray(_step62.value,2),g=_step62$value[0],x=_step62$value[1];y.push({type:dt.UpdateNode,dataType:bt.Local,opt:x.opt,workId:g,updateNodeOpt:{useAnimation:!1}});}}catch(err){_iterator62.e(err);}finally{_iterator62.f();}}if(o!=null&&o.size&&y.push({type:dt.RemoveNode,removeIds:_toConsumableArray(o),viewId:this.thread.viewId}),a!=null&&a.size){_iterator63=_createForOfIteratorHelper(a);try{for(_iterator63.s();!(_step63=_iterator63.n()).done;){_step63$value=_slicedToArray(_step63.value,2),_g5=_step63$value[0],_x72=_step63$value[1];y.push({type:dt.FullWork,dataType:bt.Local,toolsType:_x72.toolsType,ops:ye(_x72.op),opt:_x72.opt,workId:_g5,updateNodeOpt:{useAnimation:!1}});}}catch(err){_iterator63.e(err);}finally{_iterator63.f();}}}f=[{isClearAll:!0,clearCanvas:Rt.Float,viewId:this.viewId}];s&&f.push({rect:s,isClear:!0,clearCanvas:Rt.Bg,viewId:this.viewId},{rect:s,drawCanvas:Rt.Bg,viewId:this.viewId});_context53.next=6;return this._post({sp:y,render:f,fullWorkerDrawCount:1/0});case 6:case"end":return _context53.stop();}},_callee51,this);}));function drawEraserFull(_x69,_x70,_x71){return _drawEraserFull.apply(this,arguments);}return drawEraserFull;}()},{key:"drawEraser",value:function(){var _drawEraser=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee52(t,r){var n,s;return _regeneratorRuntime().wrap(function _callee52$(_context54){while(1)switch(_context54.prev=_context54.next){case 0:n=[],s=[];r&&n.push({type:dt.None,isLockSentEventCursor:r});t.removeIds&&n.push(t);t.rect&&s.push({rect:t.rect,isClear:!0,clearCanvas:Rt.Bg,viewId:this.viewId},{rect:t.rect,drawCanvas:Rt.Bg,viewId:this.viewId});_context54.next=6;return this._post({sp:n,render:s,consumeCount:this.consumeCount});case 6:case"end":return _context54.stop();}},_callee52,this);}));function drawEraser(_x73,_x74){return _drawEraser.apply(this,arguments);}return drawEraser;}()},{key:"drawShape",value:function(){var _drawShape=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee53(t){return _regeneratorRuntime().wrap(function _callee53$(_context55){while(1)switch(_context55.prev=_context55.next){case 0:_context55.next=2;return this._post({fullWorkerDrawCount:this.drawCount,sp:(t==null?void 0:t.op)&&[t]});case 2:case"end":return _context55.stop();}},_callee53,this);}));function drawShape(_x75){return _drawShape.apply(this,arguments);}return drawShape;}()},{key:"drawPencil",value:function(){var _drawPencil=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee54(t){return _regeneratorRuntime().wrap(function _callee54$(_context56){while(1)switch(_context56.prev=_context56.next){case 0:_context56.next=2;return this._post({sp:(t==null?void 0:t.op)&&[t]});case 2:case"end":return _context56.stop();}},_callee54,this);}));function drawPencil(_x76){return _drawPencil.apply(this,arguments);}return drawPencil;}()},{key:"runEffectSelectWork",value:function(){var _runEffectSelectWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee55(t){var r,_iterator64,_step64,n,s,l,o;return _regeneratorRuntime().wrap(function _callee55$(_context57){while(1)switch(_context57.prev=_context57.next){case 0:_iterator64=_createForOfIteratorHelper(this.effectSelectNodeData.values());_context57.prev=1;_iterator64.s();case 3:if((_step64=_iterator64.n()).done){_context57.next=23;break;}n=_step64.value;s=this.setFullWork(n);if(!s){_context57.next=21;break;}l=(r=s.getWorkId())==null?void 0:r.toString();if(!(s.toolsType===xt.Image)){_context57.next=13;break;}_context57.next=11;return s.consumeServiceAsync({isFullWork:!0,replaceId:l,worker:this});case 11:_context57.next=20;break;case 13:if(!(s.toolsType===xt.Text)){_context57.next=18;break;}_context57.next=16;return s.consumeServiceAsync({isFullWork:!0,replaceId:l});case 16:_context57.next=20;break;case 18:o=n.ops&&Ze(n.ops);s.consumeService({op:o,isFullWork:!0,replaceId:l}),n!=null&&n.updateNodeOpt&&s.updataOptService(n.updateNodeOpt);case 20:n.workId&&this.workShapes["delete"](n.workId.toString());case 21:_context57.next=3;break;case 23:_context57.next=28;break;case 25:_context57.prev=25;_context57.t0=_context57["catch"](1);_iterator64.e(_context57.t0);case 28:_context57.prev=28;_iterator64.f();return _context57.finish(28);case 31:_context57.next=33;return this.reRenderSelector(t);case 33:case"end":return _context57.stop();}},_callee55,this,[[1,25,28,31]]);}));function runEffectSelectWork(_x77){return _runEffectSelectWork.apply(this,arguments);}return runEffectSelectWork;}()},{key:"cursorHover",value:function(){var _cursorHover=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee56(t){var o,r,n,s,l,a,c;return _regeneratorRuntime().wrap(function _callee56$(_context58){while(1)switch(_context58.prev=_context58.next){case 0:r=t.opt,n=t.toolsType,s=t.point,l=this.setFullWork({workId:ir,toolsType:n,opt:r});if(!(l&&s)){_context58.next=8;break;}a=l.cursorHover(s),c={render:[]};_context58.t0=a&&a.type===dt.CursorHover&&a.rect;if(!_context58.t0){_context58.next=8;break;}(o=c.render)==null||o.push({rect:Jt(a.rect),clearCanvas:Rt.Bg,isClear:!0,viewId:this.viewId},{rect:Jt(a.rect),drawCanvas:Rt.Bg,viewId:this.viewId});_context58.next=8;return this._post(c);case 8:case"end":return _context58.stop();}},_callee56,this);}));function cursorHover(_x78){return _cursorHover.apply(this,arguments);}return cursorHover;}()},{key:"cursorBlur",value:function(){var _cursorBlur=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee57(){var n,t,r;return _regeneratorRuntime().wrap(function _callee57$(_context59){while(1)switch(_context59.prev=_context59.next){case 0:t=this.getWorkShape(ir);_context59.t0=t&&(n=t.selectIds)!=null&&n.length;if(!_context59.t0){_context59.next=10;break;}r=t.oldSelectRect;t.cursorBlur();this.clearWorkShapeNodeCache(ir);_context59.t1=r;if(!_context59.t1){_context59.next=10;break;}_context59.next=10;return this._post({render:[{rect:Jt(r),clearCanvas:Rt.Bg,isClear:!0,viewId:this.viewId},{rect:Jt(r),drawCanvas:Rt.Bg,viewId:this.viewId}]});case 10:this.fullLayer.parent.children.forEach(function(s){s.name==="Cursor_Hover_Id"&&s.remove();});case 11:case"end":return _context59.stop();}},_callee57,this);}));function cursorBlur(){return _cursorBlur.apply(this,arguments);}return cursorBlur;}()}]);}(ls);var ng=/*#__PURE__*/function(){function ng(e){_classCallCheck(this,ng);at(this,"viewId");at(this,"vNodes");at(this,"fullLayer");at(this,"drawLayer");at(this,"workShapes",/* @__PURE__ */new Map());at(this,"selectorWorkShapes",/* @__PURE__ */new Map());at(this,"thread");at(this,"animationId");at(this,"willRunEffectSelectorIds",/* @__PURE__ */new Set());at(this,"runEffectId");at(this,"noAnimationRect");at(this,"syncUnitTime",Te.syncOpt.interval);at(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(ng,[{key:"destroy",value:function destroy(){this.workShapes.clear(),this.selectorWorkShapes.clear(),this.willRunEffectSelectorIds.clear();}},{key:"consumeDraw",value:function(){var _consumeDraw2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee58(e){return _regeneratorRuntime().wrap(function _callee58$(_context60){while(1)switch(_context60.prev=_context60.next){case 0:this.activeWorkShape(e),this.runAnimation();case 1:case"end":return _context60.stop();}},_callee58,this);}));function consumeDraw(_x79){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=pn({workId:e,toolsType:r,toolsOpt:n,vNodes:this.vNodes,fullLayer:this.fullLayer,drawLayer:this.drawLayer},this),t;}},{key:"runReverseSelectWork",value:function runReverseSelectWork(e){var _this95=this;e.forEach(function(t){_this95.selectorWorkShapes.forEach(function(r,n){var s;if((s=r.selectIds)!=null&&s.length){var l=r.selectIds.indexOf(t);l>-1&&(r.selectIds.splice(l,1),_this95.willRunEffectSelectorIds.add(n));}});}),this.willRunEffectSelectorIds.size&&this.runEffect();}},{key:"removeWork",value:function(){var _removeWork3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee59(e){var t,r,n;return _regeneratorRuntime().wrap(function _callee59$(_context61){while(1)switch(_context61.prev=_context61.next){case 0:t=e.workId,r=t==null?void 0:t.toString();if(!r){_context61.next=10;break;}n=this.workShapes.get(r);if(!n){_context61.next=8;break;}this.workShapes["delete"](r);_context61.next=7;return this.removeNode(r,e,n==null?void 0:n.totalRect,!1);case 7:return _context61.abrupt("return");case 8:_context61.next=10;return this.removeNode(r,e);case 10:case"end":return _context61.stop();}},_callee59,this);}));function removeWork(_x80){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__*/_regeneratorRuntime().mark(function _callee60(e,t,r){var _this96=this;var n,c,s,l,o,a,_args62=arguments;return _regeneratorRuntime().wrap(function _callee60$(_context62){while(1)switch(_context62.prev=_context62.next){case 0:n=_args62.length>3&&_args62[3]!==undefined?_args62[3]:!0;e.indexOf(qt)>-1&&this.removeSelectWork(t);s=r;l=(c=this.vNodes.get(e))==null?void 0:c.rect;l&&(s=Wt(l,s));o=this.fullLayer&&Et.getRectFromLayer(this.fullLayer,e);s=Wt(s,o);a=this.drawLayer&&Et.getRectFromLayer(this.drawLayer,e);s=Wt(s,a);this.fullLayer.getElementsByName(e).forEach(function(y){y.remove(),_pe(y,_this96.fullLayer.parent);});this.drawLayer.getElementsByName(e).forEach(function(y){y.remove(),_pe(y,_this96.drawLayer.parent);});this.vNodes["delete"](e);_context62.t0=s;if(!_context62.t0){_context62.next=16;break;}_context62.next=16;return this.post({render:[{rect:Jt(s),isClear:!0,clearCanvas:n?Rt.Bg:Rt.ServiceFloat,workerType:n?void 0:bt.Service,viewId:this.viewId},{rect:Jt(s),drawCanvas:n?Rt.Bg:Rt.ServiceFloat,workerType:n?void 0:bt.Service,viewId:this.viewId}]});case 16:case"end":return _context62.stop();}},_callee60,this);}));function removeNode(_x81,_x82,_x83){return _removeNode.apply(this,arguments);}return removeNode;}()},{key:"activeWorkShape",value:function activeWorkShape(e){var M,S,P,C;var t=e.workId,r=e.opt,n=e.toolsType,s=e.type,l=e.updateNodeOpt,o=e.ops,a=e.op,c=e.useAnimation,y=e.isEnableCursor;if(!t)return;var f=t.toString(),g=(M=this.vNodes.get(f))==null?void 0:M.rect;if(!((S=this.workShapes)!=null&&S.has(f))){var _h38={toolsType:n,animationWorkData:a||[],animationIndex:0,type:s,updateNodeOpt:l,ops:o,useAnimation:_typeof(c)<"u"?c:_typeof(l==null?void 0:l.useAnimation)<"u"?l==null?void 0:l.useAnimation:!0,oldRect:g,isDiff:!1,isEnableCursor:y};n&&r&&(_h38=this.setNodeKey(f,_h38,n,r)),(P=this.workShapes)==null||P.set(f,_h38);}var x=(C=this.workShapes)==null?void 0:C.get(f);x.isEnableCursor=y,s&&(x.type=s),o&&(x.animationWorkData=Ze(o),x.ops=o),l&&(x.updateNodeOpt=l),a&&(x.isDiff=this.hasDiffData(x.animationWorkData||[],a,x.toolsType),x.animationWorkData=a),x.node&&x.node.getWorkId()!==f&&x.node.setWorkId(f),g&&(x.oldRect=g),n&&r&&(r.syncUnitTime&&(this.syncUnitTime=r.syncUnitTime),x.toolsType!==n&&n&&r&&this.setNodeKey(f,x,n,r),x.node&&x.node.setWorkOptions(r));}},{key:"hasDiffData",value:function hasDiffData(e,t,r){var n=e.length;if(t.length<n)return!0;switch(r){case xt.Pencil:{for(var s=0;s<n;s+=3)if(t[s]!==e[s]||t[s+1]!==e[s+1])return!0;break;}case xt.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__*/_regeneratorRuntime().mark(function _callee61(){var _this97=this;var n,s,l,o,a,c,y,f,g,x,M,S,P,C,h,p,d,v,I,L,w,B,E,b,W,D,R,Y,V,Q,et,it,$,K,rt,lt,ct,gt,st,Ot,e,t,r,_iterator65,_step65,_loop6;return _regeneratorRuntime().wrap(function _callee61$(_context64){while(1)switch(_context64.prev=_context64.next){case 0:this.animationId=void 0;e=!1;t={render:[]},r=/* @__PURE__ */new Map();_iterator65=_createForOfIteratorHelper(this.workShapes.entries());_context64.prev=4;_loop6=/*#__PURE__*/_regeneratorRuntime().mark(function _loop6(){var _step65$value,St,F,z,Z,_z,_Z,_z2,_Z2,tt,j,_z3,_Z3,_tt,_j2,H,T,A,_T,_z4,_Z4,_tt2,_j3;return _regeneratorRuntime().wrap(function _loop6$(_context63){while(1)switch(_context63.prev=_context63.next){case 0:_step65$value=_slicedToArray(_step65.value,2),St=_step65$value[0],F=_step65$value[1];_context63.t0=F.toolsType;_context63.next=_context63.t0===xt.Image?4:_context63.t0===xt.Text?11:_context63.t0===xt.Arrow?19:_context63.t0===xt.Straight?19:_context63.t0===xt.Rectangle?19:_context63.t0===xt.Ellipse?19:_context63.t0===xt.Star?19:_context63.t0===xt.Polygon?19:_context63.t0===xt.SpeechBalloon?19:_context63.t0===xt.Pencil?22:38;break;case 4:z=F.oldRect;z&&((n=t.render)==null||n.push({rect:z,isClear:!0,clearCanvas:Rt.Bg,viewId:_this97.viewId}),(s=t.render)==null||s.push({rect:z,drawCanvas:Rt.Bg,viewId:_this97.viewId}));_context63.next=8;return(l=F.node)==null?void 0:l.consumeServiceAsync({isFullWork:!0,worker:_this97.thread});case 8:Z=_context63.sent;_this97.selectorWorkShapes.forEach(function(tt,j){var H;(H=tt.selectIds)!=null&&H.includes(St)&&(_this97.willRunEffectSelectorIds.add(j),_this97.noAnimationRect=Wt(_this97.noAnimationRect,z),_this97.noAnimationRect=Wt(_this97.noAnimationRect,Z),_this97.runEffect());}),_this97.workShapes["delete"](St),(o=t.render)==null||o.push({rect:Z,drawCanvas:Rt.Bg,viewId:_this97.viewId});return _context63.abrupt("break",38);case 11:if(!F.node){_context63.next=18;break;}_z=F.oldRect;_z&&((a=t.render)==null||a.push({rect:_z,isClear:!0,clearCanvas:Rt.Bg,viewId:_this97.viewId}),(c=t.render)==null||c.push({rect:_z,drawCanvas:Rt.Bg,viewId:_this97.viewId}));_context63.next=16;return F.node.consumeServiceAsync({isFullWork:!0,replaceId:St});case 16:_Z=_context63.sent;_this97.selectorWorkShapes.forEach(function(tt,j){var H;(H=tt.selectIds)!=null&&H.includes(St)&&(_this97.willRunEffectSelectorIds.add(j),_this97.noAnimationRect=Wt(_this97.noAnimationRect,_z),_this97.noAnimationRect=Wt(_this97.noAnimationRect,_Z),_this97.runEffect());}),(y=F.node)==null||y.clearTmpPoints(),_this97.workShapes["delete"](St),(f=t.render)==null||f.push({rect:_Z,drawCanvas:Rt.Bg,viewId:_this97.viewId});case 18:return _context63.abrupt("break",38);case 19:_z2=!!F.ops;if((g=F.animationWorkData)!=null&&g.length){_Z2=F.oldRect,tt=F.node.oldRect;_Z2&&((x=t.render)==null||x.push({rect:_Z2,isClear:!0,clearCanvas:Rt.Bg,viewId:_this97.viewId}),(M=t.render)==null||M.push({rect:_Z2,drawCanvas:Rt.Bg,viewId:_this97.viewId})),tt&&((S=t.render)==null||S.push({rect:tt,isClear:!0,clearCanvas:Rt.ServiceFloat,viewId:_this97.viewId}));j=(P=F.node)==null?void 0:P.consumeService({op:F.animationWorkData,isFullWork:_z2});F.isEnableCursor?r.set(St,{workState:_Z2?F.ops?Ft.Done:Ft.Doing:Ft.Start,op:F.animationWorkData.slice(-3,-1)}):_z2&&!F.useAnimation&&(C=F.updateNodeOpt)!=null&&C.useAnimation&&r.set(St,{workState:Ft.Done,op:F.animationWorkData.slice(-3,-1),uid:(h=F.updateNodeOpt)==null?void 0:h.uid}),_z2?(_this97.selectorWorkShapes.forEach(function(H,T){var A;(A=H.selectIds)!=null&&A.includes(St)&&(_this97.willRunEffectSelectorIds.add(T),_this97.noAnimationRect=Wt(_this97.noAnimationRect,_Z2),_this97.noAnimationRect=Wt(_this97.noAnimationRect,tt),_this97.noAnimationRect=Wt(_this97.noAnimationRect,j),_this97.runEffect());}),(p=F.node)==null||p.clearTmpPoints(),_this97.workShapes["delete"](St),(d=t.render)==null||d.push({rect:j,drawCanvas:Rt.Bg,viewId:_this97.viewId})):(v=t.render)==null||v.push({rect:j,drawCanvas:Rt.ServiceFloat,workerType:_z2?void 0:bt.Service,viewId:_this97.viewId}),F.animationWorkData.length=0;}return _context63.abrupt("break",38);case 22:if(!F.useAnimation){_context63.next=33;break;}if(!F.useAnimation){_context63.next=31;break;}if(!F.isDel){_context63.next=27;break;}(et=F.node)==null||et.clearTmpPoints(),_this97.workShapes["delete"](St);return _context63.abrupt("break",38);case 27:_z3=3,_Z3=_this97.computNextAnimationIndex(F,_z3),_tt=F.isDiff?0:Math.max(0,(F.animationIndex||0)-_z3),_j2=(F.animationWorkData||[]).slice(0,_Z3),H=($=(it=F.node)==null?void 0:it.getWorkId())==null?void 0:$.toString();if((F.animationIndex||0)<_Z3||F.isDiff){T=(K=F.node)==null?void 0:K.consumeService({op:_j2,isFullWork:!1,replaceId:H});if((rt=t.render)==null||rt.push({isClear:!0,rect:T,clearCanvas:Rt.ServiceFloat,viewId:_this97.viewId}),(lt=t.render)==null||lt.push({rect:T,drawCanvas:Rt.ServiceFloat,viewId:_this97.viewId}),F.animationIndex=_Z3,F.isDiff&&(F.isDiff=!1),_j2.length&&F.isEnableCursor){A=_j2.slice(-3,-1);r.set(St,{workState:_tt===0?Ft.Start:_Z3===((ct=F.animationWorkData)==null?void 0:ct.length)?Ft.Done:Ft.Doing,op:A});}}else if(F.ops){_T=(gt=F.node)==null?void 0:gt.consumeService({op:F.animationWorkData||[],isFullWork:!0,replaceId:H});F.isDel=!0,(st=t.render)==null||st.push({isClear:!0,rect:_T,clearCanvas:Rt.ServiceFloat,viewId:_this97.viewId},{rect:_T,drawCanvas:Rt.ServiceFloat,viewId:_this97.viewId},{isClear:!0,rect:_T,clearCanvas:Rt.Bg,viewId:_this97.viewId},{rect:_T,drawCanvas:Rt.Bg,viewId:_this97.viewId}),F.isEnableCursor&&r.set(St,{workState:Ft.Done,op:_j2.slice(-3,-1)});}e=!0;return _context63.abrupt("break",38);case 31:_context63.next=37;break;case 33:_z4=!!F.ops;_Z4=(I=F.node)==null?void 0:I.consumeService({op:F.animationWorkData||[],isFullWork:_z4,replaceId:St});_tt2=(L=F.node)==null?void 0:L.updataOptService(F.updateNodeOpt);if(_z4){if(_Z4=Wt(_Z4,_tt2),(w=t.render)==null||w.push({isClear:!0,rect:Wt(F.oldRect,_Z4),clearCanvas:Rt.Bg,viewId:_this97.viewId}),(B=t.render)==null||B.push({rect:Wt(F.oldRect,_Z4),drawCanvas:Rt.Bg,viewId:_this97.viewId}),(E=F.updateNodeOpt)!=null&&E.useAnimation&&((b=t.render)==null||b.push({isClear:!0,rect:Wt(F.oldRect,_Z4),clearCanvas:Rt.ServiceFloat,viewId:_this97.viewId}),(W=t.render)==null||W.push({rect:Wt(F.oldRect,_Z4),drawCanvas:Rt.ServiceFloat,viewId:_this97.viewId}),!F.isEnableCursor&&(D=F.animationWorkData)!=null&&D.length)){_j3=F.animationWorkData.slice(-3,-1);r.set(St,{workState:Ft.Done,op:_j3,uid:(R=F.updateNodeOpt)==null?void 0:R.uid});}_this97.selectorWorkShapes.forEach(function(j,H){var T;(T=j.selectIds)!=null&&T.includes(St)&&(_this97.willRunEffectSelectorIds.add(H),_this97.noAnimationRect=Wt(_this97.noAnimationRect,_Z4),_this97.runEffect());}),(Y=F.node)==null||Y.clearTmpPoints(),_this97.workShapes["delete"](St);}else _Z4=Wt(_Z4,_tt2),(V=t.render)==null||V.push({isClear:!0,rect:Wt(F.oldRect,_Z4),clearCanvas:Rt.ServiceFloat,viewId:_this97.viewId}),(Q=t.render)==null||Q.push({rect:Wt(F.oldRect,_Z4),drawCanvas:Rt.ServiceFloat,viewId:_this97.viewId});case 37:return _context63.abrupt("break",38);case 38:case"end":return _context63.stop();}},_loop6);});_iterator65.s();case 7:if((_step65=_iterator65.n()).done){_context64.next=11;break;}return _context64.delegateYield(_loop6(),"t0",9);case 9:_context64.next=7;break;case 11:_context64.next=16;break;case 13:_context64.prev=13;_context64.t1=_context64["catch"](4);_iterator65.e(_context64.t1);case 16:_context64.prev=16;_iterator65.f();return _context64.finish(16);case 19:e&&this.runAnimation();r.size&&(t.sp=[],r.forEach(function(St,F){var z;(z=t.sp)==null||z.push({type:dt.Cursor,uid:St.uid||F.split(or)[0],op:St.op,workState:St.workState,viewId:_this97.viewId});}));_context64.t2=(Ot=t.render)!=null&&Ot.length;if(!_context64.t2){_context64.next=25;break;}_context64.next=25;return this.post(t);case 25:case"end":return _context64.stop();}},_callee61,this,[[4,13,16,19]]);}));function animationDraw(){return _animationDraw.apply(this,arguments);}return animationDraw;}()},{key:"runAnimation",value:function runAnimation(){var _this98=this;this.animationId||(this.animationId=setTimeout(function(){_this98.animationId=void 0,_this98.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__*/_regeneratorRuntime().mark(function _callee62(){var _this99=this;var e;return _regeneratorRuntime().wrap(function _callee62$(_context65){while(1)switch(_context65.prev=_context65.next){case 0:this.runEffectId=void 0;e=this.noAnimationRect;this.willRunEffectSelectorIds.forEach(function(t){var s,l;var r=_this99.selectorWorkShapes.get(t),n=r&&r.selectIds&&((s=r.node)==null?void 0:s.selectServiceNode(t,r,!0));e=Wt(e,n),(l=r==null?void 0:r.selectIds)!=null&&l.length||_this99.selectorWorkShapes["delete"](t);});_context65.t0=e;if(!_context65.t0){_context65.next=7;break;}_context65.next=7;return this.post({render:[{rect:Jt(e),isClear:!0,clearCanvas:Rt.Bg,viewId:this.viewId},{rect:Jt(e),drawCanvas:Rt.Bg,viewId:this.viewId}]});case 7:this.willRunEffectSelectorIds.clear();this.noAnimationRect=void 0;case 9:case"end":return _context65.stop();}},_callee62,this);}));function effectRunSelector(){return _effectRunSelector.apply(this,arguments);}return effectRunSelector;}()},{key:"activeSelectorShape",value:function activeSelectorShape(e){var y,f,g;var t=e.workId,r=e.opt,n=e.toolsType,s=e.type,l=e.selectIds,o=e.imageBitmap;if(!t)return;var a=t.toString();if(!((y=this.selectorWorkShapes)!=null&&y.has(a))){var x={toolsType:n,selectIds:l,type:s,opt:r,imageBitmap:o};n&&r&&(x=this.setNodeKey(a,x,n,r)),(f=this.selectorWorkShapes)==null||f.set(a,x);}var c=(g=this.selectorWorkShapes)==null?void 0:g.get(a);s&&(c.type=s),c.node&&c.node.getWorkId()!==a&&c.node.setWorkId(a),o&&(c.imageBitmap=o),c.selectIds=l||[];}}]);}();var ig=/*#__PURE__*/function(_ls2){function ig(t){var _this100;_classCallCheck(this,ig);_this100=_callSuper(this,ig,[t]);at(_this100,"drawWorkActiveId");return _this100;}_inherits(ig,_ls2);return _createClass(ig,[{key:"runFullWork",value:function(){var _runFullWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee63(t){var s,r,n,l,o,a;return _regeneratorRuntime().wrap(function _callee63$(_context66){while(1)switch(_context66.prev=_context66.next){case 0:r=this.setFullWork(t),n=t.ops&&Ze(t.ops);if(!r){_context66.next=18;break;}a=(s=r.getWorkId())==null?void 0:s.toString();if(!(r.toolsType===xt.Image)){_context66.next=9;break;}_context66.next=6;return r.consumeServiceAsync({isFullWork:!0,worker:this.thread});case 6:l=_context66.sent;_context66.next=16;break;case 9:if(!(r.toolsType===xt.Text)){_context66.next=15;break;}_context66.next=12;return r.consumeServiceAsync({isFullWork:!0,replaceId:a,isDrawLabel:!0});case 12:l=_context66.sent;_context66.next=16;break;case 15:l=r.consumeService({op:n,isFullWork:!0,replaceId:a}),o=(t==null?void 0:t.updateNodeOpt)&&r.updataOptService(t.updateNodeOpt);case 16:t.workId&&this.workShapes["delete"](t.workId.toString());return _context66.abrupt("return",Wt(l,o));case 18:case"end":return _context66.stop();}},_callee63,this);}));function runFullWork(_x84){return _runFullWork.apply(this,arguments);}return runFullWork;}()},{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();}Se(this.fullLayer,this.fullLayer.parent);}},{key:"canUseSubWorker",value:function canUseSubWorker(t){var r=this.thread.getPriorityDraw();return r||!r&&t!==xt.Pencil;}},{key:"consumeDraw",value:function(){var _consumeDraw3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee64(t){var r,n,s,l,o,a,c;return _regeneratorRuntime().wrap(function _callee64$(_context67){while(1)switch(_context67.prev=_context67.next){case 0:r=t.workId,n=t.fullWorkerDrawCount,s=t.postCount,l=r==null?void 0:r.toString(),o=l&&this.workShapes.get(l);if(o){_context67.next=3;break;}return _context67.abrupt("return");case 3:_context67.t0=this.drawWorkActiveId&&this.drawWorkActiveId!==l;if(!_context67.t0){_context67.next=8;break;}_context67.next=7;return this.consumeDrawAll({workId:this.drawWorkActiveId,viewId:this.viewId,msgType:dt.DrawWork,dataType:bt.Local});case 7:this.drawWorkActiveId=void 0;case 8:!this.drawWorkActiveId&&l!==qt&&(this.drawWorkActiveId=l);a=o.toolsType;ue(s)&&(this.consumeCount=s);c=o.consume({data:t,drawCount:this.drawCount,isFullWork:!0,isSubWorker:!0,removeDrawCount:n});_context67.t1=a;_context67.next=_context67.t1===xt.Selector?15:_context67.t1===xt.Ellipse?21:_context67.t1===xt.Arrow?21:_context67.t1===xt.Straight?21:_context67.t1===xt.Rectangle?21:_context67.t1===xt.Star?21:_context67.t1===xt.Polygon?21:_context67.t1===xt.SpeechBalloon?21:_context67.t1===xt.Pencil?27:_context67.t1===xt.BitMapEraser?33:_context67.t1===xt.PencilEraser?33:39;break;case 15:_context67.t2=c;if(!_context67.t2){_context67.next=20;break;}this.drawCount++;_context67.next=20;return this.drawSelector(c);case 20:return _context67.abrupt("break",39);case 21:_context67.t3=c;if(!_context67.t3){_context67.next=26;break;}this.drawCount++;_context67.next=26;return this.drawShape(c);case 26:return _context67.abrupt("break",39);case 27:_context67.t4=c;if(!_context67.t4){_context67.next=32;break;}this.drawCount++;_context67.next=32;return this.drawPencil(c,r==null?void 0:r.toString());case 32:return _context67.abrupt("break",39);case 33:_context67.t5=c;if(!_context67.t5){_context67.next=38;break;}this.drawCount++;_context67.next=38;return this._post({subWorkerDrawCount:this.drawCount,consumeCount:this.consumeCount});case 38:return _context67.abrupt("break",39);case 39:case"end":return _context67.stop();}},_callee64,this);}));function consumeDraw(_x85){return _consumeDraw3.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee65(t){var r,n,s;return _regeneratorRuntime().wrap(function _callee65$(_context68){while(1)switch(_context68.prev=_context68.next){case 0:r=t.workId;if(!r){_context68.next=14;break;}n=r.toString();this.drawWorkActiveId===n&&(this.drawWorkActiveId=void 0);s=this.workShapes.get(n);if(s){_context68.next=7;break;}return _context68.abrupt("return");case 7:_context68.t0=s.toolsType;_context68.next=_context68.t0===xt.Selector?10:_context68.t0===xt.Arrow?12:_context68.t0===xt.Straight?12:_context68.t0===xt.Ellipse?12:_context68.t0===xt.Pencil?12:_context68.t0===xt.Rectangle?12:_context68.t0===xt.Star?12:_context68.t0===xt.Polygon?12:_context68.t0===xt.SpeechBalloon?12:_context68.t0===xt.BitMapEraser?12:_context68.t0===xt.PencilEraser?12:14;break;case 10:this.drawCount=0,Se(this.fullLayer,this.fullLayer.parent),this.clearWorkShapeNodeCache(n),this._post({render:[{isClearAll:!0,clearCanvas:Rt.Float,viewId:this.viewId}]});return _context68.abrupt("break",14);case 12:this.drawCount=0,Se(this.fullLayer,this.fullLayer.parent),this.clearWorkShapeNodeCache(n);return _context68.abrupt("break",14);case 14:case"end":return _context68.stop();}},_callee65,this);}));function consumeDrawAll(_x86){return _consumeDrawAll2.apply(this,arguments);}return consumeDrawAll;}()},{key:"removeWork",value:function(){var _removeWork4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee66(t){var r,n,s,l;return _regeneratorRuntime().wrap(function _callee66$(_context69){while(1)switch(_context69.prev=_context69.next){case 0:r=t.workId,n=r==null?void 0:r.toString();if(!n){_context69.next=8;break;}s=this.removeNode(n);if(!s){_context69.next=8;break;}l=[];l.push({rect:Jt(s),clearCanvas:Rt.Float,isClear:!0,viewId:this.viewId},{rect:Jt(s),drawCanvas:Rt.Float,viewId:this.viewId});_context69.next=8;return this._post({render:l});case 8:case"end":return _context69.stop();}},_callee66,this);}));function removeWork(_x87){return _removeWork4.apply(this,arguments);}return removeWork;}()},{key:"removeNode",value:function removeNode(t){var _this101=this;var r=this.workShapes.has(t);var n;return r&&(this.fullLayer.getElementsByName(t).forEach(function(s){var l=s.getBoundingClientRect();n=Wt(n,{x:l.x-Et.SafeBorderPadding,y:l.y-Et.SafeBorderPadding,w:l.width+Et.SafeBorderPadding*2,h:l.height+Et.SafeBorderPadding*2}),s.remove(),_pe(s,_this101.fullLayer.parent);}),n&&this.clearWorkShapeNodeCache(t)),n;}},{key:"drawPencil",value:function(){var _drawPencil2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee67(t,r){return _regeneratorRuntime().wrap(function _callee67$(_context70){while(1)switch(_context70.prev=_context70.next){case 0:_context70.next=2;return this._post({subWorkerDrawCount:this.drawCount,consumeCount:this.consumeCount,render:[{rect:t==null?void 0:t.rect,workId:r,drawCanvas:Rt.Float,viewId:this.viewId}],sp:(t==null?void 0:t.op)&&[t]});case 2:case"end":return _context70.stop();}},_callee67,this);}));function drawPencil(_x88,_x89){return _drawPencil2.apply(this,arguments);}return drawPencil;}()},{key:"drawShape",value:function(){var _drawShape2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee68(t){return _regeneratorRuntime().wrap(function _callee68$(_context71){while(1)switch(_context71.prev=_context71.next){case 0:_context71.next=2;return this._post({subWorkerDrawCount:this.drawCount,consumeCount:this.consumeCount,render:[{rect:(t==null?void 0:t.rect)&&Jt(t.rect),isClear:!0,clearCanvas:Rt.Float,viewId:this.viewId},{rect:(t==null?void 0:t.rect)&&Jt(t.rect),drawCanvas:Rt.Float,viewId:this.viewId}]});case 2:case"end":return _context71.stop();}},_callee68,this);}));function drawShape(_x90){return _drawShape2.apply(this,arguments);}return drawShape;}()},{key:"drawSelector",value:function(){var _drawSelector2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee69(t){return _regeneratorRuntime().wrap(function _callee69$(_context72){while(1)switch(_context72.prev=_context72.next){case 0:_context72.next=2;return this._post({subWorkerDrawCount:this.drawCount,consumeCount:this.consumeCount,render:[{rect:(t==null?void 0:t.rect)&&Jt(t.rect),isClear:!0,clearCanvas:Rt.Float,viewId:this.viewId},{rect:(t==null?void 0:t.rect)&&Jt(t.rect),drawCanvas:Rt.Float,viewId:this.viewId}]});case 2:case"end":return _context72.stop();}},_callee69,this);}));function drawSelector(_x91){return _drawSelector2.apply(this,arguments);}return drawSelector;}()}]);}(ls);var sg=/*#__PURE__*/function(){function sg(e){_classCallCheck(this,sg);at(this,"viewId");at(this,"vNodes");at(this,"topLayer");at(this,"thread");at(this,"post");at(this,"serviceWorkShapes",/* @__PURE__ */new Map());at(this,"localWorkShapes",/* @__PURE__ */new Map());at(this,"tmpOpt");at(this,"syncUnitTime",Te.syncOpt.interval);at(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(sg,[{key:"canUseTopLayer",value:function canUseTopLayer(e){return e===xt.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:Ft.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===xt.LaserPen)return pn(_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===bt.Service)this.activeServiceWorkShape(e);else{var n=t==null?void 0:t.toString(),s=n&&this.localWorkShapes.get(n);if(!s)return;var l=s.node.consume({data:e,isFullWork:!1,isSubWorker:!0});l.rect&&(s.totalRect=Wt(l.rect,s.totalRect),s.result=l,s.workState=Ft.Doing,n&&this.localWorkShapes.set(n,s));}this.runAnimation();}},{key:"consumeDrawAll",value:function consumeDrawAll(e){var t=e.workId,r=e.dataType;if(r===bt.Service)this.activeServiceWorkShape(e);else{var n=t==null?void 0:t.toString(),s=n&&this.localWorkShapes.get(n);if(!s)return;var l=s.node.consumeAll({data:e});s.totalRect=Wt(l.rect,s.totalRect),s.result=l,s.workState=Ft.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 g,x;var t=e.workId,r=e.opt,n=e.toolsType,s=e.type,l=e.updateNodeOpt,o=e.ops,a=e.op;if(!t)return;var c=t.toString(),y=(g=this.vNodes.get(c))==null?void 0:g.rect;if(!((x=this.serviceWorkShapes)!=null&&x.has(c))){var M={toolsType:n,animationWorkData:a||[],animationIndex:0,type:s,updateNodeOpt:l,ops:o,oldRect:y};n&&r&&(M=this.setNodeKey(c,M,n,r)),this.serviceWorkShapes.set(c,M);}var f=this.serviceWorkShapes.get(c);s&&(f.type=s),o&&(f.animationWorkData=Ze(o),f.ops=o),l&&(f.updateNodeOpt=l),a&&(f.animationWorkData=a),f.node&&f.node.getWorkId()!==c&&f.node.setWorkId(c),y&&(f.oldRect=y),n&&r&&(f.toolsType!==n&&n&&r&&this.setNodeKey(c,f,n,r),f.node&&f.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__*/_regeneratorRuntime().mark(function _callee70(){var _this102=this;var l,o,a,c,e,t,r,n,s,_iterator67,_step67,_step67$value,y,f,x,M,S,P,_iterator68,_step68,_step68$value,_y12,_f7,g,_x92,_M3,_S9,_P10;return _regeneratorRuntime().wrap(function _callee70$(_context73){while(1)switch(_context73.prev=_context73.next){case 0:this.animationId=void 0;e=!1;t=/* @__PURE__ */new Map(),r=[],n=[],s=[];_iterator67=_createForOfIteratorHelper(this.serviceWorkShapes.entries());_context73.prev=4;_iterator67.s();case 6:if((_step67=_iterator67.n()).done){_context73.next=20;break;}_step67$value=_slicedToArray(_step67.value,2),y=_step67$value[0],f=_step67$value[1];_context73.t0=f.toolsType;_context73.next=_context73.t0===xt.LaserPen?11:18;break;case 11:x=this.computNextAnimationIndex(f,8),M=Math.max(0,f.animationIndex||0),S=(f.animationWorkData||[]).slice(M,x);if((f.animationIndex||0)<x){P=(l=f.node)==null?void 0:l.consumeService({op:S,isFullWork:!1});f.totalRect=Wt(f.totalRect,P),f.animationIndex=x,S.length&&t.set(y,{workState:M===0?Ft.Start:x===((o=f.animationWorkData)==null?void 0:o.length)?Ft.Done:Ft.Doing,op:S.slice(-2)});}if(!(n.push({isClear:!0,rect:f.totalRect,clearCanvas:Rt.TopFloat,viewId:this.viewId}),r.push({rect:f.totalRect,drawCanvas:Rt.TopFloat,viewId:this.viewId}),f.isDel)){_context73.next=16;break;}(a=f.node)==null||a.clearTmpPoints(),this.serviceWorkShapes["delete"](y);return _context73.abrupt("break",18);case 16:f.ops&&f.animationIndex===((c=f.animationWorkData)==null?void 0:c.length)&&!f.isDel&&(this.topLayer.getElementsByName(y.toString())[0]||(f.isDel=!0,this.serviceWorkShapes.set(y,f))),e=!0;return _context73.abrupt("break",18);case 18:_context73.next=6;break;case 20:_context73.next=25;break;case 22:_context73.prev=22;_context73.t1=_context73["catch"](4);_iterator67.e(_context73.t1);case 25:_context73.prev=25;_iterator67.f();return _context73.finish(25);case 28:_iterator68=_createForOfIteratorHelper(this.localWorkShapes.entries());_context73.prev=29;_iterator68.s();case 31:if((_step68=_iterator68.n()).done){_context73.next=44;break;}_step68$value=_slicedToArray(_step68.value,2),_y12=_step68$value[0],_f7=_step68$value[1];g=_f7.result,_x92=_f7.toolsType,_M3=_f7.totalRect,_S9=_f7.isDel,_P10=_f7.workState;_context73.t2=_x92;_context73.next=_context73.t2===xt.LaserPen?37:42;break;case 37:if(!(_M3&&(n.push({isClear:!0,rect:_M3,clearCanvas:Rt.TopFloat,viewId:this.viewId}),r.push({rect:_M3,drawCanvas:Rt.TopFloat,viewId:this.viewId})),_S9)){_context73.next=40;break;}_f7.node.clearTmpPoints(),this.localWorkShapes["delete"](_y12),s.push({removeIds:[_y12.toString()],viewId:this.viewId,type:dt.RemoveNode});return _context73.abrupt("break",42);case 40:g&&((g.op||g.ops)&&s.push(g),_f7.result=void 0),!this.topLayer.getElementsByName(_y12.toString())[0]&&_P10===Ft.Done&&(_f7.isDel=!0,this.localWorkShapes.set(_y12,_f7)),e=!0;return _context73.abrupt("break",42);case 42:_context73.next=31;break;case 44:_context73.next=49;break;case 46:_context73.prev=46;_context73.t3=_context73["catch"](29);_iterator68.e(_context73.t3);case 49:_context73.prev=49;_iterator68.f();return _context73.finish(49);case 52:e&&this.runAnimation(),t.size&&t.forEach(function(y,f){s.push({type:dt.Cursor,uid:f.split(or)[0],op:y.op,workState:y.workState,viewId:_this102.viewId});}),(r.length||n.length||s.length)&&this.post({render:[].concat(n,r),sp:s});case 53:case"end":return _context73.stop();}},_callee70,this,[[4,22,25,28],[29,46,49,52]]);}));function animationDraw(){return _animationDraw2.apply(this,arguments);}return animationDraw;}()},{key:"runAnimation",value:function runAnimation(){var _this103=this;this.animationId||(this.animationId=setTimeout(function(){_this103.animationId=void 0,_this103.animationDraw();},16));}}]);}();var Lr=/* @__PURE__ */function(u){return u.Full="full",u.Sub="sub",u;}(Lr||{});var og=/*#__PURE__*/function(){function og(e,t){_classCallCheck(this,og);at(this,"_self");at(this,"version",Yi);at(this,"type");at(this,"hasPriorityDraw",!0);at(this,"workThreadMap",/* @__PURE__ */new Map());this._self=e,this.type=t,this.register();}return _createClass(og,[{key:"init",value:function init(e){var t=e.viewId,r=e.dpr,n=e.offscreenCanvasOpt,s=e.layerOpt,l=e.isSafari,o=e.combineUnitTime,a=e.syncUnitTime,c=e.maxCombineEraserTime;if(!r||!n||!s)return;var y;this.type==="full"&&(y=new ag(t,{dpr:r,offscreenCanvasOpt:n,layerOpt:s,combineUnitTime:o,syncUnitTime:a,maxCombineEraserTime:c},this.post.bind(this))),this.type==="sub"&&(y=new ds(t,{dpr:r,offscreenCanvasOpt:n,layerOpt:s},this.post.bind(this)),y.setHasPriorityDraw(this.hasPriorityDraw)),y&&l&&y.setIsSafari(l),y&&e.cameraOpt&&y.setCameraOpt(e.cameraOpt),y&&this.workThreadMap.set(t,y);}},{key:"register",value:function register(){var _this104=this;onmessage=/*#__PURE__*/function(){var _ref171=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee71(e){var t,_iteratorAbruptCompletion,_didIteratorError,_iteratorError,_iterator,_step,r,n,s,l,o,_iterator69,_step69,c,_iterator70,_step70,_step70$value,_c8,y,f,_iterator71,_step71,_c9,a;return _regeneratorRuntime().wrap(function _callee71$(_context74){while(1)switch(_context74.prev=_context74.next){case 0:t=e.data;if(!t){_context74.next=56;break;}_iteratorAbruptCompletion=false;_didIteratorError=false;_context74.prev=4;_iterator=_asyncIterator(t.values());case 6:_context74.next=8;return _iterator.next();case 8:if(!(_iteratorAbruptCompletion=!(_step=_context74.sent).done)){_context74.next=40;break;}r=_step.value;n=r.msgType,s=r.viewId,l=r.tasksqueue,o=r.mainTasksqueueCount;if(!(n===dt.Console)){_context74.next=14;break;}console.log(_this104);return _context74.abrupt("continue",37);case 14:if(!(n===dt.Init)){_context74.next=17;break;}_this104.init(r);return _context74.abrupt("continue",37);case 17:if(!(_this104.type==="sub"&&(n===dt.PriorityWorker||n===dt.PriorityMainThreadWorker))){_context74.next=22;break;}n===dt.PriorityWorker?_this104.hasPriorityDraw=!0:n===dt.PriorityMainThreadWorker&&(_this104.hasPriorityDraw=!1);_iterator69=_createForOfIteratorHelper(_this104.workThreadMap.values());try{for(_iterator69.s();!(_step69=_iterator69.n()).done;){c=_step69.value;c.setHasPriorityDraw(_this104.hasPriorityDraw);}}catch(err){_iterator69.e(err);}finally{_iterator69.f();}return _context74.abrupt("continue",37);case 22:if(!(n===dt.TasksQueue&&l!=null&&l.size)){_context74.next=27;break;}_iterator70=_createForOfIteratorHelper(_this104.workThreadMap.entries());try{for(_iterator70.s();!(_step70=_iterator70.n()).done;){_step70$value=_slicedToArray(_step70.value,2),_c8=_step70$value[0],y=_step70$value[1];f=l.get(_c8);f&&y.on(f);}}catch(err){_iterator70.e(err);}finally{_iterator70.f();}_this104.type==="full"&&ue(o)&&_this104.post({workerTasksqueueCount:o});return _context74.abrupt("continue",37);case 27:if(!(s===qs)){_context74.next=31;break;}_iterator71=_createForOfIteratorHelper(_this104.workThreadMap.values());try{for(_iterator71.s();!(_step71=_iterator71.n()).done;){_c9=_step71.value;_c9.on(r),n===dt.Destroy&&_this104.workThreadMap["delete"](s);}}catch(err){_iterator71.e(err);}finally{_iterator71.f();}return _context74.abrupt("continue",37);case 31:a=_this104.workThreadMap.get(s);_context74.t0=a;if(!_context74.t0){_context74.next=37;break;}_context74.next=36;return a.on(r);case 36:n===dt.Destroy&&_this104.workThreadMap["delete"](s);case 37:_iteratorAbruptCompletion=false;_context74.next=6;break;case 40:_context74.next=46;break;case 42:_context74.prev=42;_context74.t1=_context74["catch"](4);_didIteratorError=true;_iteratorError=_context74.t1;case 46:_context74.prev=46;_context74.prev=47;if(!(_iteratorAbruptCompletion&&_iterator["return"]!=null)){_context74.next=51;break;}_context74.next=51;return _iterator["return"]();case 51:_context74.prev=51;if(!_didIteratorError){_context74.next=54;break;}throw _iteratorError;case 54:return _context74.finish(51);case 55:return _context74.finish(46);case 56:case"end":return _context74.stop();}},_callee71,null,[[4,42,46,56],[47,,51,55]]);}));return function onmessage(_x93){return _ref171.apply(this,arguments);};}();}},{key:"post",value:function post(e,t){t?this._self.postMessage(e,t):this._self.postMessage(e);}}]);}();var ag=/*#__PURE__*/function(_as){function ag(t,r,n){var _this105;_classCallCheck(this,ag);_this105=_callSuper(this,ag,[t,r,"full"/* Full */]);at(_this105,"type","full");at(_this105,"serviceDrawLayer");at(_this105,"localDrawLayer");at(_this105,"snapshotFullLayer");at(_this105,"methodBuilder");at(_this105,"localWork");at(_this105,"serviceWork");at(_this105,"_post");at(_this105,"debounceUpdateCache",/* @__PURE__ */new Set());_this105._post=n;var s=Te.bufferSize.sub;_this105.serviceDrawLayer=_this105.createLayer("serviceDrawLayer",_this105.scene,_objectSpread(_objectSpread({},r.layerOpt),{},{bufferSize:s,contextType:"2d"})),_this105.localDrawLayer=_this105.createLayer("localDrawLayer",_this105.scene,_objectSpread(_objectSpread({},r.layerOpt),{},{bufferSize:s,contextType:"2d"}));var l={thread:_this105,viewId:_this105.viewId,vNodes:_this105.vNodes,fullLayer:_this105.fullLayer};_this105.localWork=new rg(_objectSpread(_objectSpread({},l),{},{drawLayer:_this105.localDrawLayer})),r.combineUnitTime&&_this105.localWork.setCombineUnitTime(r.combineUnitTime),r.maxCombineEraserTime&&_this105.localWork.setmaxCombineEraserTime(r.maxCombineEraserTime),r.syncUnitTime&&_this105.localWork.setSyncUnitTime(r.syncUnitTime),_this105.serviceWork=new ng(_objectSpread(_objectSpread({},l),{},{drawLayer:_this105.serviceDrawLayer})),_this105.methodBuilder=new co([kt.CopyNode,kt.SetColorNode,kt.DeleteNode,kt.RotateNode,kt.ScaleNode,kt.TranslateNode,kt.ZIndexNode,kt.SetFontStyle,kt.SetPoint,kt.SetLock,kt.SetShapeOpt]).registerForWorker(_this105),_this105.vNodes.init(_this105.fullLayer);return _this105;}_inherits(ag,_as);return _createClass(ag,[{key:"combinePost",value:function(){var _combinePost=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee72(){var _this106=this;var l,o,_this$combinePostData,t,r,n,a,_iterator72,_step72,c,y,s;return _regeneratorRuntime().wrap(function _callee72$(_context75){while(1)switch(_context75.prev=_context75.next){case 0:_this$combinePostData=this.combinePostData(),t=_this$combinePostData.render,r=_objectWithoutProperties(_this$combinePostData,_excluded3);if(!(t!=null&&t.length)){_context75.next=28;break;}a=[];_iterator72=_createForOfIteratorHelper(t);_context75.prev=4;_iterator72.s();case 6:if((_step72=_iterator72.n()).done){_context75.next=19;break;}c=_step72.value;if(!c.rect){_context75.next=17;break;}if(!(c.rect=os(he(c.rect),this.scene,this.dpr),!c.rect)){_context75.next=11;break;}return _context75.abrupt("continue",17);case 11:if(!(c.drawCanvas&&c.rect&&c.rect.w>0&&c.rect.h>0)){_context75.next=16;break;}_context75.next=14;return this.getRectImageBitmap(c);case 14:y=_context75.sent;c.imageBitmap=y,n||(n=[]),n.push(y);case 16:a.push(c);case 17:_context75.next=6;break;case 19:_context75.next=24;break;case 21:_context75.prev=21;_context75.t0=_context75["catch"](4);_iterator72.e(_context75.t0);case 24:_context75.prev=24;_iterator72.f();return _context75.finish(24);case 27:r.render=a;case 28:s=(l=r.sp)==null?void 0:l.filter(function(a){return a.type!==dt.None||a.isLockSentEventCursor;});s!=null&&s.length?r.sp=s.map(function(a){return _objectSpread(_objectSpread({},a),{},{viewId:_this106.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||(o=r.render)!=null&&o.length)&&this._post(r,n),this.delayPostDoneResolve&&this.delayPostDoneResolve(!0);case 30:case"end":return _context75.stop();}},_callee72,this,[[4,21,24,27]]);}));function combinePost(){return _combinePost.apply(this,arguments);}return combinePost;}()},{key:"on",value:function(){var _on2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee73(t){var _this107=this;var r,n,s,l,o,a,c,y,_c10;return _regeneratorRuntime().wrap(function _callee73$(_context76){while(1)switch(_context76.prev=_context76.next){case 0:if(!this.methodBuilder.consumeForWorker(t)){_context76.next=2;break;}return _context76.abrupt("return");case 2:r=t.msgType,n=t.dataType,s=t.workId,l=t.toolsType,o=t.workState,a=t.workIds;_context76.t0=r;_context76.next=_context76.t0===dt.AuthClear?6:_context76.t0===dt.CreateWork?9:_context76.t0===dt.DrawWork?11:_context76.t0===dt.Select?20:_context76.t0===dt.UpdateNode?27:_context76.t0===dt.FullWork?27:_context76.t0===dt.RemoveNode?29:_context76.t0===dt.GetTextActive?32:_context76.t0===dt.CursorHover?35:_context76.t0===dt.CursorBlur?38:_context76.t0===dt.GetVNodeInfo?41:43;break;case 6:c=t.clearUids,y=t.localUid;this.vNodes.setCanClearUids(c),this.vNodes.setLocalUid(y);return _context76.abrupt("break",43);case 9:l!==xt.LaserPen&&this.createLocalWork(t);return _context76.abrupt("break",43);case 11:_context76.t1=l!==xt.LaserPen;if(!_context76.t1){_context76.next=19;break;}if(!(o===Ft.Done&&n===bt.Local)){_context76.next=18;break;}_context76.next=16;return this.consumeDrawAll(n,t);case 16:_context76.next=19;break;case 18:this.consumeDraw(n,t);case 19:return _context76.abrupt("break",43);case 20:if(!(s===qt)){_context76.next=25;break;}_context76.next=23;return this.localWork.updateFullSelectWork(t);case 23:_context76.next=26;break;case 25:this.serviceWork.runSelectWork(t);case 26:return _context76.abrupt("return");case 27:this.consumeFull(n,t);return _context76.abrupt("return");case 29:_context76.next=31;return this.removeNode(t);case 31:return _context76.abrupt("return");case 32:_context76.next=34;return this.checkTextActive(t);case 34:return _context76.abrupt("return");case 35:_context76.next=37;return this.cursorHover(t);case 37:return _context76.abrupt("return");case 38:_context76.next=40;return this.cursorBlur();case 40:return _context76.abrupt("return");case 41:if(s&&a){_c10=a.map(function(y){return _this107.vNodes.get(y);});this.post({sp:[{type:dt.GetVNodeInfo,dataType:bt.Worker,workId:s,vInfo:_c10}]});}return _context76.abrupt("break",43);case 43:_context76.next=45;return _superPropGet(ag,"on",this,3)([t]);case 45:case"end":return _context76.stop();}},_callee73,this);}));function on(_x94){return _on2.apply(this,arguments);}return on;}()},{key:"removeNode",value:function(){var _removeNode2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee74(t){var _this108=this;var r,n,s,l,o,_iterator73,_step73,_loop7;return _regeneratorRuntime().wrap(function _callee74$(_context78){while(1)switch(_context78.prev=_context78.next){case 0:r=t.dataType,n=t.workId,s=t.removeIds,l=[],o=s||[];if(!(n&&o.push(n.toString()),o.length)){_context78.next=20;break;}_iterator73=_createForOfIteratorHelper(o);_context78.prev=3;_loop7=/*#__PURE__*/_regeneratorRuntime().mark(function _loop7(){var a;return _regeneratorRuntime().wrap(function _loop7$(_context77){while(1)switch(_context77.prev=_context77.next){case 0:a=_step73.value;a===qt?l.push(_this108.localWork.removeSelector(t,_this108)):r===bt.Local?l.push(_this108.localWork.removeWork(t).then(function(){_this108.localWork.colloctEffectSelectWork(t),_this108.deleteCachedImagesByWorkId(a);})):r===bt.Service&&l.push(_this108.serviceWork.removeWork(t).then(function(){_this108.localWork.colloctEffectSelectWork(t),_this108.deleteCachedImagesByWorkId(a);}));case 2:case"end":return _context77.stop();}},_loop7);});_iterator73.s();case 6:if((_step73=_iterator73.n()).done){_context78.next=10;break;}return _context78.delegateYield(_loop7(),"t0",8);case 8:_context78.next=6;break;case 10:_context78.next=15;break;case 12:_context78.prev=12;_context78.t1=_context78["catch"](3);_iterator73.e(_context78.t1);case 15:_context78.prev=15;_iterator73.f();return _context78.finish(15);case 18:_context78.next=20;return Promise.all(l);case 20:case"end":return _context78.stop();}},_callee74,null,[[3,12,15,18]]);}));function removeNode(_x95){return _removeNode2.apply(this,arguments);}return removeNode;}()},{key:"checkTextActive",value:function(){var _checkTextActive2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee75(t){var r;return _regeneratorRuntime().wrap(function _callee75$(_context79){while(1)switch(_context79.prev=_context79.next){case 0:r=t.dataType;_context79.t0=r===bt.Local;if(!_context79.t0){_context79.next=5;break;}_context79.next=5;return this.localWork.checkTextActive(t);case 5:case"end":return _context79.stop();}},_callee75,this);}));function checkTextActive(_x96){return _checkTextActive2.apply(this,arguments);}return checkTextActive;}()},{key:"clearAll",value:function(){var _clearAll2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee76(){return _regeneratorRuntime().wrap(function _callee76$(_context80){while(1)switch(_context80.prev=_context80.next){case 0:this.vNodes.clear();_superPropGet(ag,"clearAll",this,3)([]);this.localDrawLayer&&(this.localDrawLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),Se(this.localDrawLayer,this.localDrawLayer.parent));this.serviceDrawLayer&&(this.serviceDrawLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),Se(this.serviceDrawLayer,this.serviceDrawLayer.parent));_context80.next=6;return this.post({render:[{isClearAll:!0,clearCanvas:Rt.Bg,viewId:this.viewId},{isClearAll:!0,clearCanvas:Rt.ServiceFloat,viewId:this.viewId},{isClearAll:!0,clearCanvas:Rt.Float,viewId:this.viewId}],sp:[{type:dt.Clear}]});case 6:case"end":return _context80.stop();}},_callee76,this);}));function clearAll(){return _clearAll2.apply(this,arguments);}return clearAll;}()},{key:"updateLayer",value:function updateLayer(t){var r=t.width,n=t.height;_superPropGet(ag,"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,l=t.width,o=t.height;(l!==this.scene.width||o!==this.scene.height)&&this.updateScene({width:l,height:o}),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 Rt.Bg:return this.fullLayer;case Rt.ServiceFloat:return this.serviceDrawLayer;case Rt.Float:return this.localDrawLayer;}}},{key:"getOffscreen",value:function getOffscreen(t){return this.getLayer(t).parent.canvas;}},{key:"consumeFull",value:function(){var _consumeFull2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee77(t,r){var n;return _regeneratorRuntime().wrap(function _callee77$(_context81){while(1)switch(_context81.prev=_context81.next){case 0:_context81.next=2;return this.localWork.colloctEffectSelectWork(r);case 2:n=_context81.sent;_context81.t0=n&&t===bt.Local;if(!_context81.t0){_context81.next=7;break;}_context81.next=7;return this.localWork.consumeFull(n);case 7:n&&t===bt.Service&&this.serviceWork.consumeFull(n);case 8:case"end":return _context81.stop();}},_callee77,this);}));function consumeFull(_x97,_x98){return _consumeFull2.apply(this,arguments);}return consumeFull;}()},{key:"consumeDraw",value:function(){var _consumeDraw4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee78(t,r){var n;return _regeneratorRuntime().wrap(function _callee78$(_context82){while(1)switch(_context82.prev=_context82.next){case 0:n=r.workId;_context82.t0=t===bt.Local&&n;if(!_context82.t0){_context82.next=6;break;}this.localWork.getWorkShape(n.toString())||this.createLocalWork(r);_context82.next=6;return this.localWork.consumeDraw(r,this.serviceWork);case 6:t===bt.Service&&this.serviceWork.consumeDraw(r);case 7:case"end":return _context82.stop();}},_callee78,this);}));function consumeDraw(_x99,_x100){return _consumeDraw4.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee79(t,r){var n;return _regeneratorRuntime().wrap(function _callee79$(_context83){while(1)switch(_context83.prev=_context83.next){case 0:n=r.workId;_context83.t0=t===bt.Local&&n;if(!_context83.t0){_context83.next=6;break;}this.localWork.getWorkShape(n.toString())||this.createLocalWork(r);_context83.next=6;return this.localWork.consumeDrawAll(r,this.serviceWork);case 6:case"end":return _context83.stop();}},_callee79,this);}));function consumeDrawAll(_x101,_x102){return _consumeDrawAll3.apply(this,arguments);}return consumeDrawAll;}()},{key:"updateDpr",value:function(){var _updateDpr2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee80(t){return _regeneratorRuntime().wrap(function _callee80$(_context84){while(1)switch(_context84.prev=_context84.next){case 0:_superPropGet(ag,"updateDpr",this,3)([t]);_context84.next=3;return this.post({render:[{isClearAll:!0,clearCanvas:Rt.Bg,viewId:this.viewId},{isDrawAll:!0,drawCanvas:Rt.Bg,viewId:this.viewId}]});case 3:case"end":return _context84.stop();}},_callee80,this);}));function updateDpr(_x103){return _updateDpr2.apply(this,arguments);}return updateDpr;}()},{key:"updateCamera",value:function(){var _updateCamera=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee81(t){var _this109=this;var l,o,a,c,y,r,n,s,f,P,_iterator74,_step74,_step74$value,_C44,_h39,g,_iterator75,_step75,_step75$value,_P15,_C49,_h42,_iterator76,_step76,_step76$value,_P16,_C50,_h43,x,M,_P11,_iterator77,_step77,_C45,S,_iterator78,_step78,_P12,_C46,_iterator79,_step79,_h40,_iterator80,_step80,_step80$value,_P14,_step80$value$,_C48,_h41,p,d,v,I,L,w,B,E,b,W,_iterator81,_step81,_step81$value,_P13,_C47;return _regeneratorRuntime().wrap(function _callee81$(_context85){while(1)switch(_context85.prev=_context85.next){case 0:r=[],n=t.cameraOpt,s=t.scenePath;if(!(n&&!Ae(this.cameraOpt,n))){_context85.next=42;break;}this.taskUpdateCameraId&&(clearTimeout(this.taskUpdateCameraId),this.taskUpdateCameraId=void 0);f=!!this.serviceDrawLayer.children.length;if(!s){_context85.next=30;break;}P=!1;_iterator74=_createForOfIteratorHelper(this.localWork.getWorkShapes().entries());_context85.prev=7;_iterator74.s();case 9:if((_step74=_iterator74.n()).done){_context85.next=19;break;}_step74$value=_slicedToArray(_step74.value,2),_C44=_step74$value[0],_h39=_step74$value[1];_context85.t0=_h39.toolsType;_context85.next=_context85.t0===xt.Text?14:_context85.t0===xt.PencilEraser?14:_context85.t0===xt.Eraser?14:_context85.t0===xt.Selector?14:_context85.t0===xt.LaserPen?14:15;break;case 14:return _context85.abrupt("break",17);case 15:_C44!==ir&&_C44!==qt&&(P=!0);return _context85.abrupt("break",17);case 17:_context85.next=9;break;case 19:_context85.next=24;break;case 21:_context85.prev=21;_context85.t1=_context85["catch"](7);_iterator74.e(_context85.t1);case 24:_context85.prev=24;_iterator74.f();return _context85.finish(24);case 27:if(!P){_context85.next=30;break;}this.taskUpdateCameraId=setTimeout(function(){_this109.taskUpdateCameraId=void 0,_this109.updateCamera(t);},ii);return _context85.abrupt("return");case 30:g=/* @__PURE__ */new Map();_iterator75=_createForOfIteratorHelper(this.vNodes.getNodesByType(xt.Text).entries());try{for(_iterator75.s();!(_step75=_iterator75.n()).done;){_step75$value=_slicedToArray(_step75.value,2),_P15=_step75$value[0],_C49=_step75$value[1];_h42=_C49.rect;g.set(_P15,{rect:he(_h42),scale:(l=this.cameraOpt)==null?void 0:l.scale});}}catch(err){_iterator75.e(err);}finally{_iterator75.f();}_iterator76=_createForOfIteratorHelper(this.vNodes.gethasEraserNodes().entries());try{for(_iterator76.s();!(_step76=_iterator76.n()).done;){_step76$value=_slicedToArray(_step76.value,2),_P16=_step76$value[0],_C50=_step76$value[1];_h43=_C50.rect;g.set(_P16,{rect:he(_h43),scale:(o=this.cameraOpt)==null?void 0:o.scale});}}catch(err){_iterator76.e(err);}finally{_iterator76.f();}x=new Set(g.keys());M=!1;if(this.localWork.hasSelector()){_P11=(a=this.localWork.getSelector())==null?void 0:a.selectIds;if(_P11){M=!0;_iterator77=_createForOfIteratorHelper(_P11);try{for(_iterator77.s();!(_step77=_iterator77.n()).done;){_C45=_step77.value;x.add(_C45);}}catch(err){_iterator77.e(err);}finally{_iterator77.f();}}}S=!1;if(this.serviceWork.selectorWorkShapes.size){_iterator78=_createForOfIteratorHelper(this.serviceWork.selectorWorkShapes.values());try{for(_iterator78.s();!(_step78=_iterator78.n()).done;){_P12=_step78.value;_C46=_P12.selectIds;if(_C46){S=!0;_iterator79=_createForOfIteratorHelper(_C46);try{for(_iterator79.s();!(_step79=_iterator79.n()).done;){_h40=_step79.value;x.add(_h40);}}catch(err){_iterator79.e(err);}finally{_iterator79.f();}}}}catch(err){_iterator78.e(err);}finally{_iterator78.f();}}if(this.setCameraOpt(n),this.vNodes.curNodeMap.size){this.vNodes.clearTarget(),this.vNodes.updateHighLevelNodesRect(x),this.debounceUpdateCameraId&&clearTimeout(this.debounceUpdateCameraId);_iterator80=_createForOfIteratorHelper(g.entries());try{for(_iterator80.s();!(_step80=_iterator80.n()).done;){_step80$value=_slicedToArray(_step80.value,2),_P14=_step80$value[0],_step80$value$=_step80$value[1],_C48=_step80$value$.rect,_h41=_step80$value$.scale;p=this.vNodes.get(_P14);if(p){d=_C48,v=p.rect,I=this.getSceneRect(),L=sr(d,I),w=sr(v,I),B=p.toolsType,E=p.opt;b=!1;(L!==w||d.w!==v.w||d.h!==v.h||w===ge.intersect)&&(b=!0),B===xt.Text&&E.workState===Ft.Done&&b&&this.debounceUpdateCache.add(_P14);W=!1;_h41&&(c=this.cameraOpt)!=null&&c.scale&&_h41>this.cameraOpt.scale?w!==ge.outside&&L!==ge.inside&&(W=!0):_h41&&(y=this.cameraOpt)!=null&&y.scale&&_h41===this.cameraOpt.scale&&(d.x!==v.x||d.y!==v.y)&&(w===ge.inside&&L!==ge.inside||w===ge.intersect&&L===ge.intersect)&&(W=!0),E.eraserlines&&E.eraserlines.length&&W&&!this.debounceUpdateCache.has(_P14)&&this.debounceUpdateCache.add(_P14);}}}catch(err){_iterator80.e(err);}finally{_iterator80.f();}if(M&&this.localWork.reRenderSelector(),S){_iterator81=_createForOfIteratorHelper(this.serviceWork.selectorWorkShapes.entries());try{for(_iterator81.s();!(_step81=_iterator81.n()).done;){_step81$value=_slicedToArray(_step81.value,2),_P13=_step81$value[0],_C47=_step81$value[1];this.serviceWork.runSelectWork({workId:_P13,selectIds:_C47.selectIds,msgType:dt.Select,dataType:bt.Service,viewId:this.viewId});}}catch(err){_iterator81.e(err);}finally{_iterator81.f();}}this.debounceUpdateCameraId=setTimeout(function(){var C;_this109.debounceUpdateCameraId=void 0;var P=[];var _iterator82=_createForOfIteratorHelper(_this109.debounceUpdateCache.values()),_step82;try{var _loop8=function _loop8(){var h=_step82.value;var p=_this109.vNodes.get(h);if(p){var d=p.toolsType,v=p.opt,I=p.rect,L=p.op,w=_this109.localWork.setFullWork({toolsType:d,opt:v,workId:h});if(w){var B=_this109.getSceneRect(),E=sr(I,B);d===xt.Text?(C=_this109.fullLayer)!=null&&C.getElementsByName(h)[0]&&w instanceof lr&&P.push(w.consumeServiceAsync({isFullWork:!0,replaceId:h,isDrawLabel:E!==ge.outside})):v.eraserlines&&v.eraserlines.length&&P.push(new Promise(function(b){var W=w.consumeService({op:L,isFullWork:!0,replaceId:h,workState:Ft.Done});_this109.localWork.clearWorkShapeNodeCache(h),b(W);}));}}_this109.debounceUpdateCache["delete"](h);};for(_iterator82.s();!(_step82=_iterator82.n()).done;){_loop8();}}catch(err){_iterator82.e(err);}finally{_iterator82.f();}P.length?Promise.all(P).then(function(){var h=[];h.push({isClearAll:!0,clearCanvas:Rt.Bg,viewId:_this109.viewId},{isDrawAll:!0,drawCanvas:Rt.Bg,viewId:_this109.viewId}),h.length&&_this109.post({render:h}),_this109.vNodes.updateLowLevelNodesRect(),_this109.vNodes.clearHighLevelIds();}):(_this109.vNodes.updateLowLevelNodesRect(),_this109.vNodes.clearHighLevelIds());},ii*10);}f&&r.push({isClearAll:!0,clearCanvas:Rt.ServiceFloat,viewId:this.viewId}),this.vNodes.hasRenderNodes()&&r.push({isClearAll:!0,clearCanvas:Rt.Bg,viewId:this.viewId},{isDrawAll:!0,drawCanvas:Rt.Bg,viewId:this.viewId}),r.length&&this.post({render:r});case 42:case"end":return _context85.stop();}},_callee81,this,[[7,21,24,27]]);}));function updateCamera(_x104){return _updateCamera.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),l=Math.floor(r.y*this.dpr),o=Math.floor(r.w*this.dpr||1),a=Math.floor(r.h*this.dpr||1);return createImageBitmap(this.getOffscreen(n),s,l,o,a,{resizeQuality:"low"});}},{key:"cursorHover",value:function(){var _cursorHover2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee82(t){return _regeneratorRuntime().wrap(function _callee82$(_context86){while(1)switch(_context86.prev=_context86.next){case 0:_context86.next=2;return this.localWork.cursorHover(t);case 2:case"end":return _context86.stop();}},_callee82,this);}));function cursorHover(_x105){return _cursorHover2.apply(this,arguments);}return cursorHover;}()},{key:"cursorBlur",value:function(){var _cursorBlur2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee83(){return _regeneratorRuntime().wrap(function _callee83$(_context87){while(1)switch(_context87.prev=_context87.next){case 0:_context87.next=2;return this.localWork.cursorBlur();case 2:case"end":return _context87.stop();}},_callee83,this);}));function cursorBlur(){return _cursorBlur2.apply(this,arguments);}return cursorBlur;}()},{key:"destroy",value:function destroy(){_superPropGet(ag,"destroy",this,3)([]);}}]);}(as);var ds=/*#__PURE__*/function(_as2){function ds(t,r,n){var _this110;_classCallCheck(this,ds);_this110=_callSuper(this,ds,[t,r,"sub"/* Sub */]);at(_this110,"type","sub");at(_this110,"_post");at(_this110,"topLayer");at(_this110,"snapshotFullLayer");at(_this110,"serviceWork");at(_this110,"localWork");at(_this110,"topLayerWork");_this110._post=n;var s=Te.bufferSize.sub;_this110.topLayer=_this110.createLayer("topLayer",_this110.scene,_objectSpread(_objectSpread({},r.layerOpt),{},{bufferSize:s,contextType:"2d"}));var l={thread:_this110,viewId:_this110.viewId,vNodes:_this110.vNodes,fullLayer:_this110.fullLayer,topLayer:_this110.topLayer};_this110.localWork=new ig(l),_this110.topLayerWork=new sg(l),_this110.vNodes.init(_this110.fullLayer);return _this110;}_inherits(ds,_as2);return _createClass(ds,[{key:"combinePost",value:function(){var _combinePost2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee84(){var _this111=this;var l,o,_this$combinePostData2,t,r,n,a,_iterator83,_step83,c,y,s;return _regeneratorRuntime().wrap(function _callee84$(_context88){while(1)switch(_context88.prev=_context88.next){case 0:_this$combinePostData2=this.combinePostData(),t=_this$combinePostData2.render,r=_objectWithoutProperties(_this$combinePostData2,_excluded4);if(!(t!=null&&t.length)){_context88.next=28;break;}a=[];_iterator83=_createForOfIteratorHelper(t);_context88.prev=4;_iterator83.s();case 6:if((_step83=_iterator83.n()).done){_context88.next=19;break;}c=_step83.value;if(!c.rect){_context88.next=17;break;}if(!(c.rect=os(he(c.rect),this.scene,this.dpr),!c.rect)){_context88.next=11;break;}return _context88.abrupt("continue",17);case 11:if(!(c.drawCanvas&&c.rect&&c.rect.w>0&&c.rect.h>0)){_context88.next=16;break;}_context88.next=14;return this.getRectImageBitmap(c);case 14:y=_context88.sent;c.imageBitmap=y,n||(n=[]),n.push(y);case 16:a.push(c);case 17:_context88.next=6;break;case 19:_context88.next=24;break;case 21:_context88.prev=21;_context88.t0=_context88["catch"](4);_iterator83.e(_context88.t0);case 24:_context88.prev=24;_iterator83.f();return _context88.finish(24);case 27:r.render=a;case 28:s=(l=r.sp)==null?void 0:l.filter(function(a){return a.type!==dt.None||a.isLockSentEventCursor;});s!=null&&s.length?r.sp=s.map(function(a){return _objectSpread(_objectSpread({},a),{},{viewId:_this111.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||(o=r==null?void 0:r.render)!=null&&o.length)&&this._post(r,n),this.delayPostDoneResolve&&this.delayPostDoneResolve(!0);case 30:case"end":return _context88.stop();}},_callee84,this,[[4,21,24,27]]);}));function combinePost(){return _combinePost2.apply(this,arguments);}return combinePost;}()},{key:"getLayer",value:function getLayer(t,r){if(r&&this.snapshotFullLayer)return this.snapshotFullLayer;switch(t){case Rt.TopFloat:return this.topLayer;default:return this.fullLayer;}}},{key:"on",value:function(){var _on3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee85(t){var r,n,s,l,o,a,c;return _regeneratorRuntime().wrap(function _callee85$(_context89){while(1)switch(_context89.prev=_context89.next){case 0:r=t.msgType,n=t.toolsType,s=t.opt,l=t.dataType,o=t.workState,a=t.isLockSentEventCursor;_context89.t0=r;_context89.next=_context89.t0===dt.UpdateTools?4:_context89.t0===dt.CreateWork?9:_context89.t0===dt.DrawWork?11:_context89.t0===dt.RemoveNode?19:_context89.t0===dt.FullWork?22:_context89.t0===dt.Snapshot?27:_context89.t0===dt.BoundingBox?34:41;break;case 4:if(!(n&&this.topLayerWork.canUseTopLayer(n)&&s)){_context89.next=8;break;}c={toolsType:n,toolsOpt:s};this.topLayerWork.setToolsOpt(c);return _context89.abrupt("return");case 8:return _context89.abrupt("break",41);case 9:this.createLocalWork(t);return _context89.abrupt("return");case 11:if(!(o===Ft.Done&&l===bt.Local)){_context89.next=17;break;}_context89.next=14;return this.consumeDrawAll(l,t);case 14:n===xt.LaserPen&&a&&this.post({sp:[{type:dt.None,isLockSentEventCursor:a}]});_context89.next=18;break;case 17:this.consumeDraw(l,t);case 18:return _context89.abrupt("return");case 19:_context89.next=21;return this.removeNode(t);case 21:return _context89.abrupt("return");case 22:_context89.t1=n&&this.topLayerWork.canUseTopLayer(n);if(!_context89.t1){_context89.next=26;break;}_context89.next=26;return this.consumeDrawAll(l,t);case 26:return _context89.abrupt("return");case 27:this.snapshotFullLayer=this.createLayer("snapshotFullLayer",this.scene,_objectSpread(_objectSpread({},this.opt.layerOpt),{},{bufferSize:this.viewId===Ar?6e3:3e3,contextType:"2d"}));_context89.t2=this.snapshotFullLayer;if(!_context89.t2){_context89.next=33;break;}_context89.next=32;return this.getSnapshot(t);case 32:this.snapshotFullLayer=void 0;case 33:return _context89.abrupt("return");case 34:this.snapshotFullLayer=this.createLayer("snapshotFullLayer",this.scene,_objectSpread(_objectSpread({},this.opt.layerOpt),{},{bufferSize:this.viewId===Ar?6e3:3e3,contextType:"2d"}));_context89.t3=this.snapshotFullLayer;if(!_context89.t3){_context89.next=40;break;}_context89.next=39;return this.getBoundingRect(t);case 39:this.snapshotFullLayer=void 0;case 40:return _context89.abrupt("return");case 41:_context89.next=43;return _superPropGet(ds,"on",this,3)([t]);case 43:case"end":return _context89.stop();}},_callee85,this);}));function on(_x106){return _on3.apply(this,arguments);}return on;}()},{key:"createLocalWork",value:function createLocalWork(t){var r=t.workId,n=t.toolsType,s=t.opt;if(n&&this.topLayerWork.canUseTopLayer(n)&&r&&s){this.topLayerWork.getToolsOpt()||this.topLayerWork.setToolsOpt({toolsType:n,toolsOpt:s}),this.topLayerWork.setWorkOptions(r.toString(),s);return;}n&&this.localWork.canUseSubWorker(n)&&_superPropGet(ds,"createLocalWork",this,3)([t]);}},{key:"removeNode",value:function(){var _removeNode3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee86(t){var r;return _regeneratorRuntime().wrap(function _callee86$(_context90){while(1)switch(_context90.prev=_context90.next){case 0:r=t.dataType;_context90.t0=r===bt.Local;if(!_context90.t0){_context90.next=5;break;}_context90.next=5;return this.localWork.removeWork(t);case 5:case"end":return _context90.stop();}},_callee86,this);}));function removeNode(_x107){return _removeNode3.apply(this,arguments);}return removeNode;}()},{key:"getOffscreen",value:function getOffscreen(t,r){return this.getLayer(t,r).parent.canvas;}},{key:"consumeDraw",value:function(){var _consumeDraw5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee87(t,r){var n,s;return _regeneratorRuntime().wrap(function _callee87$(_context91){while(1)switch(_context91.prev=_context91.next){case 0:n=r.workId,s=r.toolsType;if(!n){_context91.next=11;break;}if(!(s&&this.topLayerWork.canUseTopLayer(s))){_context91.next=5;break;}t===bt.Local&&(this.topLayerWork.getWorkShape(n.toString())||this.createLocalWork(r)),this.topLayerWork.consumeDraw(r);return _context91.abrupt("return");case 5:_context91.t0=s&&this.localWork.canUseSubWorker(s);if(!_context91.t0){_context91.next=10;break;}this.localWork.getWorkShape(n.toString())||this.createLocalWork(r);_context91.next=10;return this.localWork.consumeDraw(r);case 10:return _context91.abrupt("return");case 11:case"end":return _context91.stop();}},_callee87,this);}));function consumeDraw(_x108,_x109){return _consumeDraw5.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee88(t,r){var n,s,l,o;return _regeneratorRuntime().wrap(function _callee88$(_context92){while(1)switch(_context92.prev=_context92.next){case 0:n=r.workId,s=r.toolsType,l=r.dataType;if(!n){_context92.next=8;break;}o=n.toString();if(!(s&&this.topLayerWork.canUseTopLayer(s))){_context92.next=6;break;}l===bt.Local&&(this.topLayerWork.getWorkShape(o)||this.createLocalWork(r)),this.topLayerWork.consumeDrawAll(r);return _context92.abrupt("return");case 6:s&&this.localWork.canUseSubWorker(s)&&(this.localWork.getWorkShape(o)||_superPropGet(ds,"createLocalWork",this,3)([r]),this.localWork.consumeDrawAll(r));return _context92.abrupt("return");case 8:case"end":return _context92.stop();}},_callee88,this);}));function consumeDrawAll(_x110,_x111){return _consumeDrawAll4.apply(this,arguments);}return consumeDrawAll;}()},{key:"clearAll",value:function(){var _clearAll3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee89(){return _regeneratorRuntime().wrap(function _callee89$(_context93){while(1)switch(_context93.prev=_context93.next){case 0:this.vNodes.clear();_superPropGet(ds,"clearAll",this,3)([]);this.topLayer&&(this.topLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),Se(this.topLayer,this.topLayer.parent));_context93.next=5;return this.post({render:[{isClearAll:!0,clearCanvas:Rt.TopFloat,viewId:this.viewId}],sp:[{type:dt.Clear}]});case 5:case"end":return _context93.stop();}},_callee89,this);}));function clearAll(){return _clearAll3.apply(this,arguments);}return clearAll;}()},{key:"getRectImageBitmap",value:function getRectImageBitmap(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;var n=arguments.length>2?arguments[2]:undefined;var s=t.rect,l=t.drawCanvas,o=Math.floor(s.x*this.dpr),a=Math.floor(s.y*this.dpr),c=Math.floor(s.w*this.dpr||1),y=Math.floor(s.h*this.dpr||1);return createImageBitmap(this.getOffscreen(l,r),o,a,c,y,n);}},{key:"updateLayer",value:function updateLayer(t){var r=t.width,n=t.height;_superPropGet(ds,"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])),this.snapshotFullLayer&&(this.snapshotFullLayer.parent.setAttribute("width",r),this.snapshotFullLayer.parent.setAttribute("height",n),this.snapshotFullLayer.setAttribute("size",[r,n]),this.snapshotFullLayer.setAttribute("pos",[r*0.5,n*0.5]));}},{key:"updateDpr",value:function(){var _updateDpr3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee90(t){var r,n,s;return _regeneratorRuntime().wrap(function _callee90$(_context94){while(1)switch(_context94.prev=_context94.next){case 0:_superPropGet(ds,"updateDpr",this,3)([t]);r=!!this.topLayerWork.localWorkShapes.size,n=!!this.localWork.getWorkShapes().size,s=[];n&&s.push({isClearAll:!0,clearCanvas:Rt.Float,viewId:this.viewId});r&&s.push({isClearAll:!0,clearCanvas:Rt.TopFloat,viewId:this.viewId});_context94.t0=s.length;if(!_context94.t0){_context94.next=8;break;}_context94.next=8;return this.post({render:s});case 8:case"end":return _context94.stop();}},_callee90,this);}));function updateDpr(_x112){return _updateDpr3.apply(this,arguments);}return updateDpr;}()},{key:"updateCamera",value:function(){var _updateCamera2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee91(t){var _this112=this;var r,n,s,l,_iterator84,_step84,_loop9;return _regeneratorRuntime().wrap(function _callee91$(_context96){while(1)switch(_context96.prev=_context96.next){case 0:r=[],n=t.cameraOpt;if(!(n&&!Ae(this.cameraOpt,n))){_context96.next=25;break;}s=!!this.topLayerWork.localWorkShapes.size,l=!!this.localWork.getWorkShapes().size;if(!(l&&this.localWork.workShapesDone(),this.setCameraOpt(n),l&&r.push({isClearAll:!0,clearCanvas:Rt.Float,viewId:this.viewId}),s)){_context96.next=21;break;}r.push({isClearAll:!0,clearCanvas:Rt.TopFloat,viewId:this.viewId});_iterator84=_createForOfIteratorHelper(this.topLayerWork.localWorkShapes.entries());_context96.prev=6;_loop9=/*#__PURE__*/_regeneratorRuntime().mark(function _loop9(){var _step84$value,o,a,c;return _regeneratorRuntime().wrap(function _loop9$(_context95){while(1)switch(_context95.prev=_context95.next){case 0:_step84$value=_slicedToArray(_step84.value,2),o=_step84$value[0],a=_step84$value[1];if(a.totalRect){_this112.topLayer.getElementsByName(o.toString()).forEach(function(y){var f=y.getBoundingClientRect(),g=Jt({x:f.x,y:f.y,w:f.width,h:f.height});c=Wt(c,g);}),a.totalRect=c,_this112.topLayerWork.localWorkShapes.set(o,a);}case 2:case"end":return _context95.stop();}},_loop9);});_iterator84.s();case 9:if((_step84=_iterator84.n()).done){_context96.next=13;break;}return _context96.delegateYield(_loop9(),"t0",11);case 11:_context96.next=9;break;case 13:_context96.next=18;break;case 15:_context96.prev=15;_context96.t1=_context96["catch"](6);_iterator84.e(_context96.t1);case 18:_context96.prev=18;_iterator84.f();return _context96.finish(18);case 21:_context96.t2=r.length;if(!_context96.t2){_context96.next=25;break;}_context96.next=25;return this.post({render:r});case 25:case"end":return _context96.stop();}},_callee91,this,[[6,15,18,21]]);}));function updateCamera(_x113){return _updateCamera2.apply(this,arguments);}return updateCamera;}()},{key:"setCameraOpt",value:function setCameraOpt(t,r){this.cameraOpt=t;var n=t.scale,s=t.centerX,l=t.centerY,o=t.width,a=t.height;(o!==this.scene.width||a!==this.scene.height)&&this.updateScene({width:o,height:a}),r?(r.setAttribute("scale",[n,n]),r.setAttribute("translate",[-s,-l])):(this.fullLayer.setAttribute("scale",[n,n]),this.fullLayer.setAttribute("translate",[-s,-l]),this.topLayer.setAttribute("scale",[n,n]),this.topLayer.setAttribute("translate",[-s,-l]));}},{key:"getSnapshot",value:function(){var _getSnapshot=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee92(t){var r,n,s,l,o,a,c,_i4,_Object$entries,_Object$entries$_i,f,g,x,M,S,y;return _regeneratorRuntime().wrap(function _callee92$(_context97){while(1)switch(_context97.prev=_context97.next){case 0:r=t.scenePath,n=t.scenes,s=t.cameraOpt,l=t.w,o=t.h;if(!(r&&n&&s&&this.snapshotFullLayer)){_context97.next=26;break;}a=he(this.cameraOpt);this.setCameraOpt(s,this.snapshotFullLayer),this.localWork.fullLayer=this.snapshotFullLayer,this.localWork.drawLayer=void 0;_i4=0,_Object$entries=Object.entries(n);case 5:if(!(_i4<_Object$entries.length)){_context97.next=21;break;}_Object$entries$_i=_slicedToArray(_Object$entries[_i4],2),f=_Object$entries$_i[0],g=_Object$entries$_i[1];if(!(g!=null&&g.type)){_context97.next=18;break;}_context97.t0=g==null?void 0:g.type;_context97.next=_context97.t0===dt.UpdateNode?11:_context97.t0===dt.FullWork?11:18;break;case 11:x=g.opt;M=_objectSpread(_objectSpread({},g),{},{opt:x,workId:f,msgType:dt.FullWork,dataType:bt.Service,viewId:this.viewId});_context97.next=15;return this.localWork.runFullWork(M);case 15:S=_context97.sent;c=Wt(c,S);return _context97.abrupt("break",18);case 18:_i4++;_context97.next=5;break;case 21:l&&o&&(y={resizeWidth:l,resizeHeight:o});_context97.next=24;return this.getSnapshotRender({scenePath:r,curCameraOpt:a,options:y});case 24:this.localWork.fullLayer=this.fullLayer;this.localWork.drawLayer=void 0;case 26:case"end":return _context97.stop();}},_callee92,this);}));function getSnapshot(_x114){return _getSnapshot.apply(this,arguments);}return getSnapshot;}()},{key:"getSnapshotRender",value:function(){var _getSnapshotRender=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee93(t){var o,r,n,s,l;return _regeneratorRuntime().wrap(function _callee93$(_context98){while(1)switch(_context98.prev=_context98.next){case 0:r=t.scenePath,n=t.curCameraOpt,s=t.options;((o=this.snapshotFullLayer)==null?void 0:o.parent).render();_context98.next=4;return this.getRectImageBitmap({rect:this.getSceneRect(),drawCanvas:Rt.None},!0,s);case 4:l=_context98.sent;l&&(this._post({sp:[{type:dt.Snapshot,scenePath:r,imageBitmap:l,viewId:this.viewId}]},[l]),l.close(),this.snapshotFullLayer&&Se(this.snapshotFullLayer,this.snapshotFullLayer.parent),this.setCameraOpt(n,this.fullLayer));case 6:case"end":return _context98.stop();}},_callee93,this);}));function getSnapshotRender(_x115){return _getSnapshotRender.apply(this,arguments);}return getSnapshotRender;}()},{key:"getBoundingRect",value:function(){var _getBoundingRect=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee94(t){var r,n,s,l,o,_i5,_Object$entries2,_Object$entries2$_i,a,c,y;return _regeneratorRuntime().wrap(function _callee94$(_context99){while(1)switch(_context99.prev=_context99.next){case 0:r=t.scenePath,n=t.scenes,s=t.cameraOpt;if(!(r&&n&&s&&this.snapshotFullLayer)){_context99.next=27;break;}l=he(this.cameraOpt);this.setCameraOpt(s,this.snapshotFullLayer),this.localWork.fullLayer=this.snapshotFullLayer,this.localWork.drawLayer=void 0;_i5=0,_Object$entries2=Object.entries(n);case 5:if(!(_i5<_Object$entries2.length)){_context99.next=19;break;}_Object$entries2$_i=_slicedToArray(_Object$entries2[_i5],2),a=_Object$entries2$_i[0],c=_Object$entries2$_i[1];if(!(c!=null&&c.type)){_context99.next=16;break;}_context99.t0=c==null?void 0:c.type;_context99.next=_context99.t0===dt.UpdateNode?11:_context99.t0===dt.FullWork?11:16;break;case 11:_context99.next=13;return this.localWork.runFullWork(_objectSpread(_objectSpread({},c),{},{workId:a,msgType:dt.FullWork,dataType:bt.Service,viewId:this.viewId}));case 13:y=_context99.sent;o=Wt(o,y);return _context99.abrupt("break",16);case 16:_i5++;_context99.next=5;break;case 19:_context99.t1=o;if(!_context99.t1){_context99.next=23;break;}_context99.next=23;return this.post({sp:[{type:dt.BoundingBox,scenePath:r,rect:o}]});case 23:this.localWork.fullLayer=this.fullLayer;this.localWork.drawLayer=void 0;Se(this.snapshotFullLayer,this.snapshotFullLayer.parent);this.setCameraOpt(l,this.fullLayer);case 27:case"end":return _context99.stop();}},_callee94,this);}));function getBoundingRect(_x116){return _getBoundingRect.apply(this,arguments);}return getBoundingRect;}()}]);}(as);var fi=self;fi.sub=new og(fi,Lr.Sub);
|