@netless/appliance-plugin 1.0.4 → 1.0.7
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/cdn/cdn.js +1 -1
- package/cdn/fullWorker-CF7R0e.js +438 -0
- package/cdn/subWorker-BbF9q2.js +438 -0
- package/dist/appliance-plugin.js +1 -1
- package/dist/appliance-plugin.mjs +7 -7
- package/dist/collector/utils/color.d.ts +1 -1
- package/dist/core/enum.d.ts +22 -16
- package/dist/core/mainEngine.d.ts +10 -3
- package/dist/core/mainThread/snapshotThread.d.ts +1 -1
- package/dist/core/mainThread/subLocalThread.d.ts +2 -1
- package/dist/core/mainThread/subTopThread.d.ts +3 -3
- package/dist/core/mainThread/workerMainThread.d.ts +99 -0
- package/dist/core/tools/eraser.d.ts +1 -20
- package/dist/core/tools/pencilEraser.d.ts +76 -0
- package/dist/core/tools/utils.d.ts +6 -5
- package/dist/core/types.d.ts +1 -0
- package/dist/core/utils/math.d.ts +3 -0
- package/dist/core/utils/spriteNode.d.ts +1 -1
- package/dist/core/vNodeManager.d.ts +1 -0
- package/dist/core/worker/base.d.ts +5 -2
- package/dist/core/worker/fullWorkerLocal.d.ts +2 -0
- package/dist/core/worker/subWorkerLocal.d.ts +3 -2
- package/dist/core/worker/subWorkerTopLayer.d.ts +3 -3
- package/dist/core/worker/workerManager.d.ts +1 -0
- package/dist/displayer/floatBar/index.d.ts +2 -2
- package/dist/displayer/floatBar/resizable/index.d.ts +1 -1
- package/dist/displayer/types.d.ts +0 -1
- package/dist/fullWorker.js +126 -125
- package/dist/index-2kLI3OsH.js +1 -0
- package/dist/index-C7xQ-iwn.mjs +2304 -0
- package/dist/index-DWP99OFK.mjs +13721 -0
- package/dist/index-OwNIkbKl.js +1 -0
- package/dist/plugin/baseApplianceManager.d.ts +5 -4
- package/dist/plugin/baseViewContainerManager.d.ts +4 -3
- package/dist/plugin/const.d.ts +3 -0
- package/dist/plugin/displayerView.d.ts +2 -1
- package/dist/plugin/multi/containerManager.d.ts +2 -0
- package/dist/plugin/multi/displayer/appViewDisplayerManager.d.ts +1 -0
- package/dist/plugin/multi/displayer/mainViewDisplayerManager.d.ts +1 -0
- package/dist/plugin/single/applianceSingleManager.d.ts +0 -1
- package/dist/plugin/single/containerManager.d.ts +2 -0
- package/dist/plugin/single/displayer/mainViewDisplayerManager.d.ts +1 -0
- package/dist/plugin/types.d.ts +11 -0
- package/dist/style.css +1 -1
- package/dist/subWorker.js +126 -125
- package/dist/undo/index.d.ts +0 -1
- package/package.json +6 -7
- package/cdn/fullWorker-DRJe2Z.js +0 -437
- package/cdn/subWorker-BCicGG.js +0 -437
- package/dist/index-BJWcnp2n.mjs +0 -5683
- package/dist/index-Bj242vt1.mjs +0 -9769
- package/dist/index-C_jpLx3X.js +0 -1
- package/dist/index-D6FsYoIf.js +0 -1
package/cdn/fullWorker-DRJe2Z.js
DELETED
|
@@ -1,437 +0,0 @@
|
|
|
1
|
-
var _excluded=["toolsType"],_excluded2=["callback"],_excluded3=["render"],_excluded4=["render"];function _objectWithoutProperties(e,t){if(null==e)return{};var o,r,i=_objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r<n.length;r++)o=n[r],t.indexOf(o)>=0||{}.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.indexOf(n)>=0)continue;t[n]=r[n];}return t;}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 _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 _n7=0,F=function F(){};return{s:F,n:function n(){return _n7>=r.length?{done:!0}:{done:!1,value:r[_n7++]};},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 Ei=Object.defineProperty;var Ai=function Ai(u,r,t){return r in u?Ei(u,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[r]=t;};var rt=function rt(u,r,t){return Ai(u,_typeof(r)!="symbol"?r+"":r,t),t;};var Lt=/* @__PURE__ */function(u){return u.Normal="Normal",u.Stroke="Stroke",u.Dotted="Dotted",u.LongDotted="LongDotted",u;}(Lt||{}),bt=/* @__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;}(bt||{}),gt=/* @__PURE__ */function(u){return u[u.Pencil=1]="Pencil",u[u.Eraser=2]="Eraser",u[u.Selector=3]="Selector",u[u.Clicker=4]="Clicker",u[u.Arrow=5]="Arrow",u[u.Hand=6]="Hand",u[u.LaserPen=7]="LaserPen",u[u.Text=8]="Text",u[u.Straight=9]="Straight",u[u.Rectangle=10]="Rectangle",u[u.Ellipse=11]="Ellipse",u[u.Star=12]="Star",u[u.Triangle=13]="Triangle",u[u.Rhombus=14]="Rhombus",u[u.Polygon=15]="Polygon",u[u.SpeechBalloon=16]="SpeechBalloon",u[u.Image=17]="Image",u;}(gt||{}),Tt=/* @__PURE__ */function(u){return u[u.Local=1]="Local",u[u.Service=2]="Service",u[u.Worker=3]="Worker",u;}(Tt||{}),It=/* @__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;}(It||{}),ft=/* @__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;}(ft||{}),ye=/* @__PURE__ */function(u){return u.Webgl2="webgl2",u.Webgl="webgl",u.Canvas2d="2d",u;}(ye||{}),xt=/* @__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;}(xt||{}),Gt=/* @__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;}(Gt||{}),Te=/* @__PURE__ */function(u){return u[u.inside=0]="inside",u[u.outside=1]="outside",u[u.intersect=2]="intersect",u;}(Te||{});var te=/*#__PURE__*/function(){function te(){_classCallCheck(this,te);rt(this,"localWork");rt(this,"serviceWork");rt(this,"scene");}return _createClass(te,[{key:"registerForWorker",value:function registerForWorker(r,t,e){return this.localWork=r,this.serviceWork=t,this.scene=e,this;}}]);}();var Ci=/*#__PURE__*/function(_te){function Ci(){var _this;_classCallCheck(this,Ci);_this=_callSuper(this,Ci,arguments);rt(_this,"emitEventType",bt.CopyNode);return _this;}_inherits(Ci,_te);return _createClass(Ci,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ft.FullWork&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(t){var n,e;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:e=t.workId;_context.t0=e;if(!_context.t0){_context.next=5;break;}_context.next=5;return(n=this.localWork)==null?void 0:n.consumeFull(t,this.scene);case 5:case"end":return _context.stop();}},_callee,this);}));function consumeForLocalWorker(_x){return _consumeForLocalWorker.apply(this,arguments);}return consumeForLocalWorker;}()}]);}(te);var pr="++",Nt="selector",Ri="all";var Ii=/*#__PURE__*/function(_te2){function Ii(){var _this2;_classCallCheck(this,Ii);_this2=_callSuper(this,Ii,arguments);rt(_this2,"emitEventType",bt.SetColorNode);return _this2;}_inherits(Ii,_te2);return _createClass(Ii,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ft.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(t){var c,e,n,i,a,o,s;return _regeneratorRuntime().wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData,s=t.textUpdateForWoker;_context2.t0=e===Nt&&n;if(!_context2.t0){_context2.next=5;break;}_context2.next=5;return(c=this.localWork)==null?void 0:c.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:o,textUpdateForWoker:s,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 e=t.param,n=t.postData,i=t.newServiceStore,a=e.willSyncService,o=e.isSync,s=e.textUpdateForWoker,c=n.render||[],p=n.sp||[];if(a){var _iterator2=_createForOfIteratorHelper(i.entries()),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var _step2$value=_slicedToArray(_step2.value,2),h=_step2$value[0],v=_step2$value[1];s&&v.toolsType===gt.Text?p.push(_objectSpread(_objectSpread({},v),{},{workId:h,type:ft.TextUpdate,dataType:Tt.Local,willSyncService:!0})):p.push(_objectSpread(_objectSpread({},v),{},{workId:h,type:ft.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}));}}catch(err){_iterator2.e(err);}finally{_iterator2.f();}}return{render:c,sp:p};}}]);}(te);var Li=/*#__PURE__*/function(_te3){function Li(){var _this3;_classCallCheck(this,Li);_this3=_callSuper(this,Li,arguments);rt(_this3,"emitEventType",bt.ZIndexNode);return _this3;}_inherits(Li,_te3);return _createClass(Li,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ft.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(t){var s,e,n,i,a,o;return _regeneratorRuntime().wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData;_context3.t0=e===Nt&&n;if(!_context3.t0){_context3.next=5;break;}_context3.next=5;return(s=this.localWork)==null?void 0:s.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,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 e=t.param,n=t.postData,i=t.newServiceStore,a=e.willSyncService,o=e.isSync,s=n.render||[],c=n.sp||[];if(a&&c){var _iterator3=_createForOfIteratorHelper(i.entries()),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var _step3$value=_slicedToArray(_step3.value,2),p=_step3$value[0],h=_step3$value[1];c.push(_objectSpread(_objectSpread({},h),{},{workId:p,type:ft.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}));}}catch(err){_iterator3.e(err);}finally{_iterator3.f();}}return{render:s,sp:c};}}]);}(te);var bi=/*#__PURE__*/function(_te4){function bi(){var _this4;_classCallCheck(this,bi);_this4=_callSuper(this,bi,arguments);rt(_this4,"emitEventType",bt.TranslateNode);return _this4;}_inherits(bi,_te4);return _createClass(bi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ft.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(t){var p,h,e,n,i,a,o,s,c;return _regeneratorRuntime().wrap(function _callee4$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData,s=t.textUpdateForWoker,c=t.emitEventType;_context4.t0=e===Nt&&n;if(!_context4.t0){_context4.next=9;break;}if(!(n.workState===It.Done&&n!=null&&n.translate&&(n.translate[0]||n.translate[1])||n.workState!==It.Done)){_context4.next=8;break;}_context4.next=6;return(p=this.localWork)==null?void 0:p.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:o,isSync:!0,textUpdateForWoker:s,emitEventType:c,scene:this.scene,callback:this.updateSelectorCallback});case 6:_context4.next=9;break;case 8:n.workState===It.Done&&((h=this.localWork)==null||h.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 e=t.param,n=t.postData,i=t.newServiceStore,a=t.workShapeNode,o=t.res,s=e.willSyncService,c=e.isSync,p=e.updateSelectorOpt,h=e.textUpdateForWoker,v=p.workState,y=n.render||[],M=n.sp||[];if(v===It.Start)return{sp:[],render:[]};var T=o==null?void 0:o.selectRect;if(s){M.push({type:ft.Select,selectIds:a.selectIds,selectRect:T,willSyncService:!0,isSync:!0,points:v===It.Done&&a.getChildrenPoints()||void 0,textOpt:a.textOpt});var _iterator4=_createForOfIteratorHelper(i.entries()),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var _step4$value=_slicedToArray(_step4.value,2),m=_step4$value[0],x=_step4$value[1];h&&x.toolsType===gt.Text?M.push(_objectSpread(_objectSpread({},x),{},{workId:m,type:ft.TextUpdate,dataType:Tt.Local,willSyncService:!0})):M.push(_objectSpread(_objectSpread({},x),{},{workId:m,type:ft.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:c}));}}catch(err){_iterator4.e(err);}finally{_iterator4.f();}}return{render:y,sp:M};}}]);}(te);var Di=/*#__PURE__*/function(_te5){function Di(){var _this5;_classCallCheck(this,Di);_this5=_callSuper(this,Di,arguments);rt(_this5,"emitEventType",bt.DeleteNode);return _this5;}_inherits(Di,_te5);return _createClass(Di,[{key:"consume",value:function consume(){return!1;}}]);}(te);var wi=/*#__PURE__*/function(_te6){function wi(){var _this6;_classCallCheck(this,wi);_this6=_callSuper(this,wi,arguments);rt(_this6,"emitEventType",bt.ScaleNode);return _this6;}_inherits(wi,_te6);return _createClass(wi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ft.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(t){var o,e,n,i,a;return _regeneratorRuntime().wrap(function _callee5$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willSyncService,a=t.willSerializeData;_context5.t0=e===Nt&&n;if(!_context5.t0){_context5.next=5;break;}_context5.next=5;return(o=this.localWork)==null?void 0:o.updateSelector({updateSelectorOpt:n,willSyncService:i,willSerializeData:a,isSync:!0,scene:this.scene,callback:this.updateSelectorCallback.bind(this)});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 e=t.param,n=t.postData,i=t.workShapeNode,a=t.res,o=t.newServiceStore,s=e.updateSelectorOpt,c=e.willSyncService,p=s.workState,h=n.render||[],v=n.sp||[],y=a==null?void 0:a.selectRect;if(p===It.Start)return{sp:[],render:[]};if(c){v.push({type:ft.Select,selectIds:i.selectIds,selectRect:y,willSyncService:!0,isSync:!0,points:p===It.Done&&i.getChildrenPoints()||void 0,textOpt:i.textOpt});var _iterator5=_createForOfIteratorHelper(o.entries()),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var _step5$value=_slicedToArray(_step5.value,2),M=_step5$value[0],T=_step5$value[1];T.toolsType===gt.Text?v.push(_objectSpread(_objectSpread({},T),{},{workId:M,type:ft.TextUpdate,dataType:Tt.Local,willSyncService:!0})):v.push(_objectSpread(_objectSpread({},T),{},{workId:M,type:ft.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:!0}));}}catch(err){_iterator5.e(err);}finally{_iterator5.f();}}return{render:h,sp:v};}}]);}(te);var Ni=/*#__PURE__*/function(_te7){function Ni(){var _this7;_classCallCheck(this,Ni);_this7=_callSuper(this,Ni,arguments);rt(_this7,"emitEventType",bt.RotateNode);return _this7;}_inherits(Ni,_te7);return _createClass(Ni,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ft.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker6=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(t){var c,e,n,i,a,o,s;return _regeneratorRuntime().wrap(function _callee6$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData,s=t.emitEventType;_context6.t0=e===Nt&&n;if(!_context6.t0){_context6.next=5;break;}_context6.next=5;return(c=this.localWork)==null?void 0:c.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:o,emitEventType:s,isSync:!0,scene:this.scene,callback:this.updateSelectorCallback});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 e=t.param,n=t.postData,i=t.workShapeNode,a=t.res,o=t.newServiceStore,s=e.updateSelectorOpt,c=e.willSyncService,p=e.willSerializeData,h=e.isSync,v=s.workState,y=n.render||[],M=n.sp||[],T=a==null?void 0:a.selectRect;if(c){p&&v===It.Done&&M.push({type:ft.Select,selectIds:i.selectIds,selectRect:T,willSyncService:!0,isSync:h,points:i.getChildrenPoints(),textOpt:i.textOpt,selectorColor:i.selectorColor,strokeColor:i.strokeColor,fillColor:i.fillColor,canTextEdit:i.canTextEdit,canRotate:i.canRotate,scaleType:i.scaleType,opt:i.getWorkOptions()||void 0,canLock:i.canLock,isLocked:i.isLocked,toolsTypes:i.toolsTypes,shapeOpt:i.shapeOpt,thickness:i.thickness,useStroke:i.useStroke,strokeType:i.strokeType});var _iterator6=_createForOfIteratorHelper(o.entries()),_step6;try{for(_iterator6.s();!(_step6=_iterator6.n()).done;){var _step6$value=_slicedToArray(_step6.value,2),m=_step6$value[0],x=_step6$value[1];M.push(_objectSpread(_objectSpread({},x),{},{workId:m,type:ft.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:h}));}}catch(err){_iterator6.e(err);}finally{_iterator6.f();}}return{render:y,sp:M};}}]);}(te);var Wi=/*#__PURE__*/function(_te8){function Wi(){var _this8;_classCallCheck(this,Wi);_this8=_callSuper(this,Wi,arguments);rt(_this8,"emitEventType",bt.SetFontStyle);return _this8;}_inherits(Wi,_te8);return _createClass(Wi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ft.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker7=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(t){var c,e,n,i,a,o,s;return _regeneratorRuntime().wrap(function _callee7$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData,s=t.textUpdateForWoker;_context7.t0=e===Nt&&n;if(!_context7.t0){_context7.next=5;break;}_context7.next=5;return(c=this.localWork)==null?void 0:c.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:o,textUpdateForWoker:s,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 e=t.param,n=t.postData,i=t.newServiceStore,a=t.workShapeNode,o=t.res,s=e.willSyncService,c=e.isSync,p=e.updateSelectorOpt,h=e.textUpdateForWoker,v=n.render||[],y=n.sp||[],M=o==null?void 0:o.selectRect;if(s&&y){p.fontSize&&y.push({type:ft.Select,selectIds:a.selectIds,selectRect:M,willSyncService:s,isSync:c,points:a.getChildrenPoints()});var _iterator7=_createForOfIteratorHelper(i.entries()),_step7;try{for(_iterator7.s();!(_step7=_iterator7.n()).done;){var _step7$value=_slicedToArray(_step7.value,2),T=_step7$value[0],m=_step7$value[1];h&&m.toolsType===gt.Text?y.push(_objectSpread(_objectSpread({},m),{},{workId:T,type:ft.TextUpdate,dataType:Tt.Local,willSyncService:!0})):y.push(_objectSpread(_objectSpread({},m),{},{workId:T,type:ft.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:c}));}}catch(err){_iterator7.e(err);}finally{_iterator7.f();}}return{render:v,sp:y};}}]);}(te);var Bi=/*#__PURE__*/function(_te9){function Bi(){var _this9;_classCallCheck(this,Bi);_this9=_callSuper(this,Bi,arguments);rt(_this9,"emitEventType",bt.SetPoint);return _this9;}_inherits(Bi,_te9);return _createClass(Bi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ft.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker8=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(t){var c,e,n,i,a,o,s;return _regeneratorRuntime().wrap(function _callee8$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData,s=t.textUpdateForWoker;_context8.t0=e===Nt&&n;if(!_context8.t0){_context8.next=5;break;}_context8.next=5;return(c=this.localWork)==null?void 0:c.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,emitEventType:this.emitEventType,willSerializeData:o,isSync:!0,textUpdateForWoker:s,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 e=t.param,n=t.postData,i=t.newServiceStore,a=t.workShapeNode,o=t.res,s=e.willSyncService,c=e.isSync,p=n.render||[],h=n.sp||[],v=o==null?void 0:o.selectRect;if(s&&h){var _iterator8=_createForOfIteratorHelper(i.entries()),_step8;try{for(_iterator8.s();!(_step8=_iterator8.n()).done;){var _step8$value=_slicedToArray(_step8.value,2),y=_step8$value[0],M=_step8$value[1];h.push(_objectSpread(_objectSpread({},M),{},{workId:y,type:ft.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:c}));}}catch(err){_iterator8.e(err);}finally{_iterator8.f();}h.push({type:ft.Select,selectIds:a.selectIds,selectRect:v,willSyncService:s,isSync:c,points:a.getChildrenPoints()});}return{render:p,sp:h};}}]);}(te);var Fi=/*#__PURE__*/function(_te10){function Fi(){var _this10;_classCallCheck(this,Fi);_this10=_callSuper(this,Fi,arguments);rt(_this10,"emitEventType",bt.SetLock);return _this10;}_inherits(Fi,_te10);return _createClass(Fi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ft.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker9=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(t){var s,e,n,i,a,o;return _regeneratorRuntime().wrap(function _callee9$(_context9){while(1)switch(_context9.prev=_context9.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData;_context9.t0=e===Nt&&n;if(!_context9.t0){_context9.next=5;break;}_context9.next=5;return(s=this.localWork)==null?void 0:s.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,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 e=t.param,n=t.postData,i=t.newServiceStore,a=t.workShapeNode,o=t.res,s=e.willSyncService,c=e.isSync,p=e.updateSelectorOpt,h=n.render||[],v=n.sp||[],y=o==null?void 0:o.selectRect;if(s&&v){var _iterator9=_createForOfIteratorHelper(i.entries()),_step9;try{for(_iterator9.s();!(_step9=_iterator9.n()).done;){var _step9$value=_slicedToArray(_step9.value,2),M=_step9$value[0],T=_step9$value[1];v.push(_objectSpread(_objectSpread({},T),{},{workId:M,type:ft.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:c}));}}catch(err){_iterator9.e(err);}finally{_iterator9.f();}v.push({isLocked:p.isLocked,selectorColor:a.selectorColor,scaleType:a.scaleType,canRotate:a.canRotate,type:ft.Select,selectIds:a.selectIds,selectRect:y,willSyncService:s,isSync:c});}return{render:h,sp:v};}}]);}(te);var Ui=/*#__PURE__*/function(_te11){function Ui(){var _this11;_classCallCheck(this,Ui);_this11=_callSuper(this,Ui,arguments);rt(_this11,"emitEventType",bt.SetShapeOpt);return _this11;}_inherits(Ui,_te11);return _createClass(Ui,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ft.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker10=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(t){var s,e,n,i,a,o;return _regeneratorRuntime().wrap(function _callee10$(_context10){while(1)switch(_context10.prev=_context10.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData;_context10.t0=e===Nt&&n;if(!_context10.t0){_context10.next=5;break;}_context10.next=5;return(s=this.localWork)==null?void 0:s.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,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 e=t.param,n=t.postData,i=t.newServiceStore,a=e.willSyncService,o=e.isSync,s=n.render||[],c=n.sp||[];if(a&&c){var _iterator10=_createForOfIteratorHelper(i.entries()),_step10;try{for(_iterator10.s();!(_step10=_iterator10.n()).done;){var _step10$value=_slicedToArray(_step10.value,2),p=_step10$value[0],h=_step10$value[1];c.push(_objectSpread(_objectSpread({},h),{},{workId:p,type:ft.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}));}}catch(err){_iterator10.e(err);}finally{_iterator10.f();}}return{render:s,sp:c};}}]);}(te);var ji=/*#__PURE__*/function(){function ji(r){var _this12=this;_classCallCheck(this,ji);rt(this,"builders",/* @__PURE__ */new Map());this.builders=new Map(r.map(function(t){return[t,_this12.build(t)];}));}return _createClass(ji,[{key:"build",value:function build(r){switch(r){case bt.TranslateNode:return new bi();case bt.ZIndexNode:return new Li();case bt.CopyNode:return new Ci();case bt.SetColorNode:return new Ii();case bt.DeleteNode:return new Di();case bt.ScaleNode:return new wi();case bt.RotateNode:return new Ni();case bt.SetFontStyle:return new Wi();case bt.SetPoint:return new Bi();case bt.SetLock:return new Fi();case bt.SetShapeOpt:return new Ui();}}},{key:"registerForWorker",value:function registerForWorker(r,t,e){return this.builders.forEach(function(n){n&&n.registerForWorker(r,t,e);}),this;}},{key:"consumeForWorker",value:function consumeForWorker(r){var _iterator11=_createForOfIteratorHelper(this.builders.values()),_step11;try{for(_iterator11.s();!(_step11=_iterator11.n()).done;){var t=_step11.value;if(t!=null&&t.consume(r))return!0;}}catch(err){_iterator11.e(err);}finally{_iterator11.f();}return!1;}}]);}();var $i={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 tt=/*#__PURE__*/function(){function tt(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;_classCallCheck(this,tt);this.x=r,this.y=t,this.z=e;}return _createClass(tt,[{key:"XY",get:function get(){return[this.x,this.y];}},{key:"setz",value:function setz(r){return this.z=r,this;}},{key:"setXY",value:function setXY(){var r=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=r,this.y=t,this;}},{key:"set",value:function set(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.x;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.y;var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this.z;return this.x=r,this.y=t,this.z=e,this;}},{key:"setTo",value:function setTo(_ref){var _ref$x=_ref.x,r=_ref$x===void 0?0:_ref$x,_ref$y=_ref.y,t=_ref$y===void 0?0:_ref$y,_ref$z=_ref.z,e=_ref$z===void 0?1:_ref$z;return this.x=r,this.y=t,this.z=e,this;}},{key:"rot",value:function rot(r){if(r===0)return this;var t=this.x,e=this.y,n=Math.sin(r),i=Math.cos(r);return this.x=t*i-e*n,this.y=t*n+e*i,this;}},{key:"rotWith",value:function rotWith(r,t){if(t===0)return this;var e=this.x-r.x,n=this.y-r.y,i=Math.sin(t),a=Math.cos(t);return this.x=r.x+(e*a-n*i),this.y=r.y+(e*i+n*a),this;}},{key:"clone",value:function clone(){var r=this.x,t=this.y,e=this.z;return new tt(r,t,e);}},{key:"sub",value:function sub(r){return this.x-=r.x,this.y-=r.y,this;}},{key:"subXY",value:function subXY(r,t){return this.x-=r,this.y-=t,this;}},{key:"subScalar",value:function subScalar(r){return this.x-=r,this.y-=r,this;}},{key:"add",value:function add(r){return this.x+=r.x,this.y+=r.y,this;}},{key:"addXY",value:function addXY(r,t){return this.x+=r,this.y+=t,this;}},{key:"addScalar",value:function addScalar(r){return this.x+=r,this.y+=r,this;}},{key:"clamp",value:function clamp(r,t){return this.x=Math.max(this.x,r),this.y=Math.max(this.y,r),t!==void 0&&(this.x=Math.min(this.x,t),this.y=Math.min(this.y,t)),this;}},{key:"div",value:function div(r){return this.x/=r,this.y/=r,this;}},{key:"divV",value:function divV(r){return this.x/=r.x,this.y/=r.y,this;}},{key:"mul",value:function mul(r){return this.x*=r,this.y*=r,this;}},{key:"mulV",value:function mulV(r){return this.x*=r.x,this.y*=r.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(r,t){var e=tt.Tan(r,this);return this.add(e.mul(t));}},{key:"neg",value:function neg(){return this.x*=-1,this.y*=-1,this;}},{key:"cross",value:function cross(r){return this.x=this.y*r.z-this.z*r.y,this.y=this.z*r.x-this.x*r.z,this;}},{key:"dpr",value:function dpr(r){return tt.Dpr(this,r);}},{key:"cpr",value:function cpr(r){return tt.Cpr(this,r);}},{key:"len2",value:function len2(){return tt.Len2(this);}},{key:"len",value:function len(){return tt.Len(this);}},{key:"pry",value:function pry(r){return tt.Pry(this,r);}},{key:"per",value:function per(){var r=this.x,t=this.y;return this.x=t,this.y=-r,this;}},{key:"uni",value:function uni(){return tt.Uni(this);}},{key:"tan",value:function tan(r){return tt.Tan(this,r);}},{key:"dist",value:function dist(r){return tt.Dist(this,r);}},{key:"distanceToLineSegment",value:function distanceToLineSegment(r,t){return tt.DistanceToLineSegment(r,t,this);}},{key:"slope",value:function slope(r){return tt.Slope(this,r);}},{key:"snapToGrid",value:function snapToGrid(r){return this.x=Math.round(this.x/r)*r,this.y=Math.round(this.y/r)*r,this;}},{key:"angle",value:function angle(r){return tt.Angle(this,r);}},{key:"toAngle",value:function toAngle(){return tt.ToAngle(this);}},{key:"lrp",value:function lrp(r,t){return this.x=this.x+(r.x-this.x)*t,this.y=this.y+(r.y-this.y)*t,this;}},{key:"equals",value:function equals(r,t){return tt.Equals(this,r,t);}},{key:"equalsXY",value:function equalsXY(r,t){return tt.EqualsXY(this,r,t);}},{key:"norm",value:function norm(){var r=this.len();return this.x=r===0?0:this.x/r,this.y=r===0?0:this.y/r,this;}},{key:"toFixed",value:function toFixed(){return tt.ToFixed(this);}},{key:"toString",value:function toString(){return tt.ToString(tt.ToFixed(this));}},{key:"toJson",value:function toJson(){return tt.ToJson(this);}},{key:"toArray",value:function toArray(){return tt.ToArray(this);}}],[{key:"Add",value:function Add(r,t){return new tt(r.x+t.x,r.y+t.y);}},{key:"AddXY",value:function AddXY(r,t,e){return new tt(r.x+t,r.y+e);}},{key:"Sub",value:function Sub(r,t){return new tt(r.x-t.x,r.y-t.y);}},{key:"SubXY",value:function SubXY(r,t,e){return new tt(r.x-t,r.y-e);}},{key:"AddScalar",value:function AddScalar(r,t){return new tt(r.x+t,r.y+t);}},{key:"SubScalar",value:function SubScalar(r,t){return new tt(r.x-t,r.y-t);}},{key:"Div",value:function Div(r,t){return new tt(r.x/t,r.y/t);}},{key:"Mul",value:function Mul(r,t){return new tt(r.x*t,r.y*t);}},{key:"DivV",value:function DivV(r,t){return new tt(r.x/t.x,r.y/t.y);}},{key:"MulV",value:function MulV(r,t){return new tt(r.x*t.x,r.y*t.y);}},{key:"Neg",value:function Neg(r){return new tt(-r.x,-r.y);}},{key:"Per",value:function Per(r){return new tt(r.y,-r.x);}},{key:"Dist2",value:function Dist2(r,t){return tt.Sub(r,t).len2();}},{key:"Abs",value:function Abs(r){return new tt(Math.abs(r.x),Math.abs(r.y));}},{key:"Dist",value:function Dist(r,t){return Math.hypot(r.y-t.y,r.x-t.x);}},{key:"Dpr",value:function Dpr(r,t){return r.x*t.x+r.y*t.y;}},{key:"Cross",value:function Cross(r,t){return new tt(r.y*t.z-r.z*t.y,r.z*t.x-r.x*t.z// A.z = A.x * V.y - A.y * V.x
|
|
2
|
-
);}},{key:"Cpr",value:function Cpr(r,t){return r.x*t.y-t.x*r.y;}},{key:"Len2",value:function Len2(r){return r.x*r.x+r.y*r.y;}},{key:"Len",value:function Len(r){return Math.hypot(r.x,r.y);}},{key:"Pry",value:function Pry(r,t){return tt.Dpr(r,t)/tt.Len(t);}},{key:"Uni",value:function Uni(r){return tt.Div(r,tt.Len(r));}},{key:"Tan",value:function Tan(r,t){return tt.Uni(tt.Sub(r,t));}},{key:"Min",value:function Min(r,t){return new tt(Math.min(r.x,t.x),Math.min(r.y,t.y));}},{key:"Max",value:function Max(r,t){return new tt(Math.max(r.x,t.x),Math.max(r.y,t.y));}},{key:"From",value:function From(r){return new tt().add(r);}},{key:"FromArray",value:function FromArray(r){return new tt(r[0],r[1]);}},{key:"Rot",value:function Rot(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var e=Math.sin(t),n=Math.cos(t);return new tt(r.x*n-r.y*e,r.x*e+r.y*n);}},{key:"RotWith",value:function RotWith(r,t,e){var n=r.x-t.x,i=r.y-t.y,a=Math.sin(e),o=Math.cos(e);return new tt(t.x+(n*o-i*a),t.y+(n*a+i*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(r,t,e){return tt.Mul(t,tt.Sub(e,r).pry(t)).add(r);}},{key:"NearestPointOnLineSegment",value:function NearestPointOnLineSegment(r,t,e){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!0;var i=tt.Tan(t,r),a=tt.Add(r,tt.Mul(i,tt.Sub(e,r).pry(i)));if(n){if(a.x<Math.min(r.x,t.x))return tt.Cast(r.x<t.x?r:t);if(a.x>Math.max(r.x,t.x))return tt.Cast(r.x>t.x?r:t);if(a.y<Math.min(r.y,t.y))return tt.Cast(r.y<t.y?r:t);if(a.y>Math.max(r.y,t.y))return tt.Cast(r.y>t.y?r:t);}return a;}},{key:"DistanceToLineThroughPoint",value:function DistanceToLineThroughPoint(r,t,e){return tt.Dist(e,tt.NearestPointOnLineThroughPoint(r,t,e));}},{key:"DistanceToLineSegment",value:function DistanceToLineSegment(r,t,e){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!0;return tt.Dist(e,tt.NearestPointOnLineSegment(r,t,e,n));}},{key:"Snap",value:function Snap(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return new tt(Math.round(r.x/t)*t,Math.round(r.y/t)*t);}},{key:"Cast",value:function Cast(r){return r instanceof tt?r:tt.From(r);}},{key:"Slope",value:function Slope(r,t){return r.x===t.y?NaN:(r.y-t.y)/(r.x-t.x);}},{key:"Angle",value:function Angle(r,t){return Math.atan2(t.y-r.y,t.x-r.x);}},{key:"Lrp",value:function Lrp(r,t,e){return tt.Sub(t,r).mul(e).add(r);}},{key:"Med",value:function Med(r,t){return new tt((r.x+t.x)/2,(r.y+t.y)/2);}},{key:"Equals",value:function Equals(r,t){var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1e-4;return Math.abs(r.x-t.x)<e&&Math.abs(r.y-t.y)<e;}},{key:"EqualsXY",value:function EqualsXY(r,t,e){return r.x===t&&r.y===e;}},{key:"EqualsXYZ",value:function EqualsXYZ(r,t){var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1e-4;return tt.Equals(r,t,e)&&Math.abs((r.z||0)-(t.z||0))<e;}},{key:"Clockwise",value:function Clockwise(r,t,e){return(e.x-r.x)*(t.y-r.y)-(t.x-r.x)*(e.y-r.y)<0;}},{key:"Rescale",value:function Rescale(r,t){var e=tt.Len(r);return new tt(t*r.x/e,t*r.y/e);}},{key:"ScaleWithOrigin",value:function ScaleWithOrigin(r,t,e){return tt.Sub(r,e).mul(t).add(e);}},{key:"ScaleWOrigin",value:function ScaleWOrigin(r,t,e){return tt.Sub(r,e).mulV(t).add(e);}},{key:"ToFixed",value:function ToFixed(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:2;return new tt(+r.x.toFixed(t),+r.y.toFixed(t),+r.z.toFixed(t));}},{key:"Nudge",value:function Nudge(r,t,e){return tt.Add(r,tt.Tan(t,r).mul(e));}},{key:"ToString",value:function ToString(r){return"".concat(r.x,", ").concat(r.y);}},{key:"ToAngle",value:function ToAngle(r){var t=Math.atan2(r.y,r.x);return t<0&&(t+=Math.PI*2),t;}},{key:"FromAngle",value:function FromAngle(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return new tt(Math.cos(r)*t,Math.sin(r)*t);}},{key:"ToArray",value:function ToArray(r){return[r.x,r.y,r.z];}},{key:"ToJson",value:function ToJson(r){var t=r.x,e=r.y,n=r.z;return{x:t,y:e,z:n};}},{key:"Average",value:function Average(r){var t=r.length,e=new tt(0,0);for(var n=0;n<t;n++)e.add(r[n]);return e.div(t);}},{key:"Clamp",value:function Clamp(r,t,e){return e===void 0?new tt(Math.min(Math.max(r.x,t)),Math.min(Math.max(r.y,t))):new tt(Math.min(Math.max(r.x,t),e),Math.min(Math.max(r.y,t),e));}/**
|
|
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(r,t){var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:6;var n=[];for(var i=0;i<e;i++){var a=$i.easeInQuad(i/(e-1)),o=tt.Lrp(r,t,a);o.z=Math.min(1,0.5+Math.abs(0.5-zi(a))*0.65),n.push(o);}return n;}},{key:"SnapToGrid",value:function SnapToGrid(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:8;return new tt(Math.round(r.x/t)*t,Math.round(r.y/t)*t);}}]);}();var zi=function zi(u){return u<0.5?2*u*u:-1+(4-2*u)*u;};var Be=(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 he(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u["default"]:u;}var Gi=_typeof(Be)=="object"&&Be&&Be.Object===Object&&Be,In=Gi,Hi=In,Ki=(typeof self==="undefined"?"undefined":_typeof(self))=="object"&&self&&self.Object===Object&&self,Vi=Hi||Ki||Function("return this")(),ee=Vi,Yi=ee,Xi=Yi.Symbol,Ne=Xi,Wr=Ne,Ln=Object.prototype,Ji=Ln.hasOwnProperty,Qi=Ln.toString,Le=Wr?Wr.toStringTag:void 0;function Zi(u){var r=Ji.call(u,Le),t=u[Le];try{u[Le]=void 0;var e=!0;}catch(_unused){}var n=Qi.call(u);return e&&(r?u[Le]=t:delete u[Le]),n;}var ki=Zi,qi=Object.prototype,_i=qi.toString;function ts(u){return _i.call(u);}var es=ts,Br=Ne,rs=ki,ns=es,is="[object Null]",ss="[object Undefined]",Fr=Br?Br.toStringTag:void 0;function os(u){return u==null?u===void 0?ss:is:Fr&&Fr in Object(u)?rs(u):ns(u);}var de=os;function as(u){return u!=null&&_typeof(u)=="object";}var re=as,ls=de,cs=re,fs="[object Number]";function us(u){return typeof u=="number"||cs(u)&&ls(u)==fs;}var hs=us,kt=/* @__PURE__ */he(hs);function ds(){this.__data__=[],this.size=0;}var gs=ds;function ps(u,r){return u===r||u!==u&&r!==r;}var vr=ps,vs=vr;function ms(u,r){for(var t=u.length;t--;)if(vs(u[t][0],r))return t;return-1;}var Ze=ms,ys=Ze,Ss=Array.prototype,xs=Ss.splice;function Ts(u){var r=this.__data__,t=ys(r,u);if(t<0)return!1;var e=r.length-1;return t==e?r.pop():xs.call(r,t,1),--this.size,!0;}var Ms=Ts,Os=Ze;function Ps(u){var r=this.__data__,t=Os(r,u);return t<0?void 0:r[t][1];}var Es=Ps,As=Ze;function Cs(u){return As(this.__data__,u)>-1;}var Rs=Cs,Is=Ze;function Ls(u,r){var t=this.__data__,e=Is(t,u);return e<0?(++this.size,t.push([u,r])):t[e][1]=r,this;}var bs=Ls,Ds=gs,ws=Ms,Ns=Es,Ws=Rs,Bs=bs;function Oe(u){var r=-1,t=u==null?0:u.length;for(this.clear();++r<t;){var e=u[r];this.set(e[0],e[1]);}}Oe.prototype.clear=Ds;Oe.prototype["delete"]=ws;Oe.prototype.get=Ns;Oe.prototype.has=Ws;Oe.prototype.set=Bs;var ke=Oe,Fs=ke;function Us(){this.__data__=new Fs(),this.size=0;}var js=Us;function $s(u){var r=this.__data__,t=r["delete"](u);return this.size=r.size,t;}var zs=$s;function Gs(u){return this.__data__.get(u);}var Hs=Gs;function Ks(u){return this.__data__.has(u);}var Vs=Ks;function Ys(u){var r=_typeof(u);return u!=null&&(r=="object"||r=="function");}var le=Ys,Xs=de,Js=le,Qs="[object AsyncFunction]",Zs="[object Function]",ks="[object GeneratorFunction]",qs="[object Proxy]";function _s(u){if(!Js(u))return!1;var r=Xs(u);return r==Zs||r==ks||r==Qs||r==qs;}var bn=_s,to=ee,eo=to["__core-js_shared__"],ro=eo,nr=ro,Ur=function(){var u=/[^.]+$/.exec(nr&&nr.keys&&nr.keys.IE_PROTO||"");return u?"Symbol(src)_1."+u:"";}();function no(u){return!!Ur&&Ur in u;}var io=no,so=Function.prototype,oo=so.toString;function ao(u){if(u!=null){try{return oo.call(u);}catch(_unused2){}try{return u+"";}catch(_unused3){}}return"";}var Dn=ao,lo=bn,co=io,fo=le,uo=Dn,ho=/[\\^$.*+?()[\]{}|]/g,go=/^\[object .+?Constructor\]$/,po=Function.prototype,vo=Object.prototype,mo=po.toString,yo=vo.hasOwnProperty,So=RegExp("^"+mo.call(yo).replace(ho,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function xo(u){if(!fo(u)||co(u))return!1;var r=lo(u)?So:go;return r.test(uo(u));}var To=xo;function Mo(u,r){return u==null?void 0:u[r];}var Oo=Mo,Po=To,Eo=Oo;function Ao(u,r){var t=Eo(u,r);return Po(t)?t:void 0;}var ge=Ao,Co=ge,Ro=ee,Io=Co(Ro,"Map"),mr=Io,Lo=ge,bo=Lo(Object,"create"),qe=bo,jr=qe;function Do(){this.__data__=jr?jr(null):{},this.size=0;}var wo=Do;function No(u){var r=this.has(u)&&delete this.__data__[u];return this.size-=r?1:0,r;}var Wo=No,Bo=qe,Fo="__lodash_hash_undefined__",Uo=Object.prototype,jo=Uo.hasOwnProperty;function $o(u){var r=this.__data__;if(Bo){var t=r[u];return t===Fo?void 0:t;}return jo.call(r,u)?r[u]:void 0;}var zo=$o,Go=qe,Ho=Object.prototype,Ko=Ho.hasOwnProperty;function Vo(u){var r=this.__data__;return Go?r[u]!==void 0:Ko.call(r,u);}var Yo=Vo,Xo=qe,Jo="__lodash_hash_undefined__";function Qo(u,r){var t=this.__data__;return this.size+=this.has(u)?0:1,t[u]=Xo&&r===void 0?Jo:r,this;}var Zo=Qo,ko=wo,qo=Wo,_o=zo,ta=Yo,ea=Zo;function Pe(u){var r=-1,t=u==null?0:u.length;for(this.clear();++r<t;){var e=u[r];this.set(e[0],e[1]);}}Pe.prototype.clear=ko;Pe.prototype["delete"]=qo;Pe.prototype.get=_o;Pe.prototype.has=ta;Pe.prototype.set=ea;var ra=Pe,$r=ra,na=ke,ia=mr;function sa(){this.size=0,this.__data__={hash:new $r(),map:new(ia||na)(),string:new $r()};}var oa=sa;function aa(u){var r=_typeof(u);return r=="string"||r=="number"||r=="symbol"||r=="boolean"?u!=="__proto__":u===null;}var la=aa,ca=la;function fa(u,r){var t=u.__data__;return ca(r)?t[typeof r=="string"?"string":"hash"]:t.map;}var _e=fa,ua=_e;function ha(u){var r=ua(this,u)["delete"](u);return this.size-=r?1:0,r;}var da=ha,ga=_e;function pa(u){return ga(this,u).get(u);}var va=pa,ma=_e;function ya(u){return ma(this,u).has(u);}var Sa=ya,xa=_e;function Ta(u,r){var t=xa(this,u),e=t.size;return t.set(u,r),this.size+=t.size==e?0:1,this;}var Ma=Ta,Oa=oa,Pa=da,Ea=va,Aa=Sa,Ca=Ma;function Ee(u){var r=-1,t=u==null?0:u.length;for(this.clear();++r<t;){var e=u[r];this.set(e[0],e[1]);}}Ee.prototype.clear=Oa;Ee.prototype["delete"]=Pa;Ee.prototype.get=Ea;Ee.prototype.has=Aa;Ee.prototype.set=Ca;var wn=Ee,Ra=ke,Ia=mr,La=wn,ba=200;function Da(u,r){var t=this.__data__;if(t instanceof Ra){var e=t.__data__;if(!Ia||e.length<ba-1)return e.push([u,r]),this.size=++t.size,this;t=this.__data__=new La(e);}return t.set(u,r),this.size=t.size,this;}var wa=Da,Na=ke,Wa=js,Ba=zs,Fa=Hs,Ua=Vs,ja=wa;function Ae(u){var r=this.__data__=new Na(u);this.size=r.size;}Ae.prototype.clear=Wa;Ae.prototype["delete"]=Ba;Ae.prototype.get=Fa;Ae.prototype.has=Ua;Ae.prototype.set=ja;var Nn=Ae;function $a(u,r){for(var t=-1,e=u==null?0:u.length;++t<e&&r(u[t],t,u)!==!1;);return u;}var za=$a,Ga=ge,Ha=function(){try{var u=Ga(Object,"defineProperty");return u({},"",{}),u;}catch(_unused4){}}(),Wn=Ha,zr=Wn;function Ka(u,r,t){r=="__proto__"&&zr?zr(u,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):u[r]=t;}var Bn=Ka,Va=Bn,Ya=vr,Xa=Object.prototype,Ja=Xa.hasOwnProperty;function Qa(u,r,t){var e=u[r];(!(Ja.call(u,r)&&Ya(e,t))||t===void 0&&!(r in u))&&Va(u,r,t);}var Fn=Qa,Za=Fn,ka=Bn;function qa(u,r,t,e){var n=!t;t||(t={});for(var i=-1,a=r.length;++i<a;){var o=r[i],s=e?e(t[o],u[o],o,t,u):void 0;s===void 0&&(s=u[o]),n?ka(t,o,s):Za(t,o,s);}return t;}var tr=qa;function _a(u,r){for(var t=-1,e=Array(u);++t<u;)e[t]=r(t);return e;}var tl=_a,el=de,rl=re,nl="[object Arguments]";function il(u){return rl(u)&&el(u)==nl;}var sl=il,Gr=sl,ol=re,Un=Object.prototype,al=Un.hasOwnProperty,ll=Un.propertyIsEnumerable,cl=Gr(/* @__PURE__ */function(){return arguments;}())?Gr:function(u){return ol(u)&&al.call(u,"callee")&&!ll.call(u,"callee");},jn=cl,fl=Array.isArray,We=fl,je={exports:{}};function ul(){return!1;}var hl=ul;je.exports;(function(u,r){var t=ee,e=hl,n=r&&!r.nodeType&&r,i=n&&!0&&u&&!u.nodeType&&u,a=i&&i.exports===n,o=a?t.Buffer:void 0,s=o?o.isBuffer:void 0,c=s||e;u.exports=c;})(je,je.exports);var yr=je.exports,dl=9007199254740991,gl=/^(?:0|[1-9]\d*)$/;function pl(u,r){var _r2;var t=_typeof(u);return r=(_r2=r)!==null&&_r2!==void 0?_r2:dl,!!r&&(t=="number"||t!="symbol"&&gl.test(u))&&u>-1&&u%1==0&&u<r;}var vl=pl,ml=9007199254740991;function yl(u){return typeof u=="number"&&u>-1&&u%1==0&&u<=ml;}var $n=yl,Sl=de,xl=$n,Tl=re,Ml="[object Arguments]",Ol="[object Array]",Pl="[object Boolean]",El="[object Date]",Al="[object Error]",Cl="[object Function]",Rl="[object Map]",Il="[object Number]",Ll="[object Object]",bl="[object RegExp]",Dl="[object Set]",wl="[object String]",Nl="[object WeakMap]",Wl="[object ArrayBuffer]",Bl="[object DataView]",Fl="[object Float32Array]",Ul="[object Float64Array]",jl="[object Int8Array]",$l="[object Int16Array]",zl="[object Int32Array]",Gl="[object Uint8Array]",Hl="[object Uint8ClampedArray]",Kl="[object Uint16Array]",Vl="[object Uint32Array]",Ft={};Ft[Fl]=Ft[Ul]=Ft[jl]=Ft[$l]=Ft[zl]=Ft[Gl]=Ft[Hl]=Ft[Kl]=Ft[Vl]=!0;Ft[Ml]=Ft[Ol]=Ft[Wl]=Ft[Pl]=Ft[Bl]=Ft[El]=Ft[Al]=Ft[Cl]=Ft[Rl]=Ft[Il]=Ft[Ll]=Ft[bl]=Ft[Dl]=Ft[wl]=Ft[Nl]=!1;function Yl(u){return Tl(u)&&xl(u.length)&&!!Ft[Sl(u)];}var Xl=Yl;function Jl(u){return function(r){return u(r);};}var er=Jl,$e={exports:{}};$e.exports;(function(u,r){var t=In,e=r&&!r.nodeType&&r,n=e&&!0&&u&&!u.nodeType&&u,i=n&&n.exports===e,a=i&&t.process,o=function(){try{var s=n&&n.require&&n.require("util").types;return s||a&&a.binding&&a.binding("util");}catch(_unused5){}}();u.exports=o;})($e,$e.exports);var Sr=$e.exports,Ql=Xl,Zl=er,Hr=Sr,Kr=Hr&&Hr.isTypedArray,kl=Kr?Zl(Kr):Ql,zn=kl,ql=tl,_l=jn,tc=We,ec=yr,rc=vl,nc=zn,ic=Object.prototype,sc=ic.hasOwnProperty;function oc(u,r){var t=tc(u),e=!t&&_l(u),n=!t&&!e&&ec(u),i=!t&&!e&&!n&&nc(u),a=t||e||n||i,o=a?ql(u.length,String):[],s=o.length;for(var c in u)(r||sc.call(u,c))&&!(a&&(// Safari 9 has enumerable `arguments.length` in strict mode.
|
|
19
|
-
c=="length"||// Node.js 0.10 has enumerable non-index properties on buffers.
|
|
20
|
-
n&&(c=="offset"||c=="parent")||// PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
21
|
-
i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||// Skip index properties.
|
|
22
|
-
rc(c,s)))&&o.push(c);return o;}var Gn=oc,ac=Object.prototype;function lc(u){var r=u&&u.constructor,t=typeof r=="function"&&r.prototype||ac;return u===t;}var xr=lc;function cc(u,r){return function(t){return u(r(t));};}var Hn=cc,fc=Hn,uc=fc(Object.keys,Object),hc=uc,dc=xr,gc=hc,pc=Object.prototype,vc=pc.hasOwnProperty;function mc(u){if(!dc(u))return gc(u);var r=[];for(var t in Object(u))vc.call(u,t)&&t!="constructor"&&r.push(t);return r;}var yc=mc,Sc=bn,xc=$n;function Tc(u){return u!=null&&xc(u.length)&&!Sc(u);}var Tr=Tc,Mc=Gn,Oc=yc,Pc=Tr;function Ec(u){return Pc(u)?Mc(u):Oc(u);}var Mr=Ec,Ac=tr,Cc=Mr;function Rc(u,r){return u&&Ac(r,Cc(r),u);}var Ic=Rc;function Lc(u){var r=[];if(u!=null)for(var t in Object(u))r.push(t);return r;}var bc=Lc,Dc=le,wc=xr,Nc=bc,Wc=Object.prototype,Bc=Wc.hasOwnProperty;function Fc(u){if(!Dc(u))return Nc(u);var r=wc(u),t=[];for(var e in u)e=="constructor"&&(r||!Bc.call(u,e))||t.push(e);return t;}var Uc=Fc,jc=Gn,$c=Uc,zc=Tr;function Gc(u){return zc(u)?jc(u,!0):$c(u);}var Or=Gc,Hc=tr,Kc=Or;function Vc(u,r){return u&&Hc(r,Kc(r),u);}var Yc=Vc,ze={exports:{}};ze.exports;(function(u,r){var t=ee,e=r&&!r.nodeType&&r,n=e&&!0&&u&&!u.nodeType&&u,i=n&&n.exports===e,a=i?t.Buffer:void 0,o=a?a.allocUnsafe:void 0;function s(c,p){if(p)return c.slice();var h=c.length,v=o?o(h):new c.constructor(h);return c.copy(v),v;}u.exports=s;})(ze,ze.exports);var Xc=ze.exports;function Jc(u,r){var t=-1,e=u.length;for(r||(r=Array(e));++t<e;)r[t]=u[t];return r;}var Qc=Jc;function Zc(u,r){for(var t=-1,e=u==null?0:u.length,n=0,i=[];++t<e;){var a=u[t];r(a,t,u)&&(i[n++]=a);}return i;}var Kn=Zc;function kc(){return[];}var Vn=kc,qc=Kn,_c=Vn,tf=Object.prototype,ef=tf.propertyIsEnumerable,Vr=Object.getOwnPropertySymbols,rf=Vr?function(u){return u==null?[]:(u=Object(u),qc(Vr(u),function(r){return ef.call(u,r);}));}:_c,Pr=rf,nf=tr,sf=Pr;function of(u,r){return nf(u,sf(u),r);}var af=of;function lf(u,r){for(var t=-1,e=r.length,n=u.length;++t<e;)u[n+t]=r[t];return u;}var Er=lf,cf=Hn,ff=cf(Object.getPrototypeOf,Object),Yn=ff,uf=Er,hf=Yn,df=Pr,gf=Vn,pf=Object.getOwnPropertySymbols,vf=pf?function(u){for(var r=[];u;)uf(r,df(u)),u=hf(u);return r;}:gf,Xn=vf,mf=tr,yf=Xn;function Sf(u,r){return mf(u,yf(u),r);}var xf=Sf,Tf=Er,Mf=We;function Of(u,r,t){var e=r(u);return Mf(u)?e:Tf(e,t(u));}var Jn=Of,Pf=Jn,Ef=Pr,Af=Mr;function Cf(u){return Pf(u,Af,Ef);}var Qn=Cf,Rf=Jn,If=Xn,Lf=Or;function bf(u){return Rf(u,Lf,If);}var Df=bf,wf=ge,Nf=ee,Wf=wf(Nf,"DataView"),Bf=Wf,Ff=ge,Uf=ee,jf=Ff(Uf,"Promise"),$f=jf,zf=ge,Gf=ee,Hf=zf(Gf,"Set"),Zn=Hf,Kf=ge,Vf=ee,Yf=Kf(Vf,"WeakMap"),Xf=Yf,cr=Bf,fr=mr,ur=$f,hr=Zn,dr=Xf,kn=de,Ce=Dn,Yr="[object Map]",Jf="[object Object]",Xr="[object Promise]",Jr="[object Set]",Qr="[object WeakMap]",Zr="[object DataView]",Qf=Ce(cr),Zf=Ce(fr),kf=Ce(ur),qf=Ce(hr),_f=Ce(dr),ce=kn;(cr&&ce(new cr(new ArrayBuffer(1)))!=Zr||fr&&ce(new fr())!=Yr||ur&&ce(ur.resolve())!=Xr||hr&&ce(new hr())!=Jr||dr&&ce(new dr())!=Qr)&&(ce=function ce(u){var r=kn(u),t=r==Jf?u.constructor:void 0,e=t?Ce(t):"";if(e)switch(e){case Qf:return Zr;case Zf:return Yr;case kf:return Xr;case qf:return Jr;case _f:return Qr;}return r;});var rr=ce,tu=Object.prototype,eu=tu.hasOwnProperty;function ru(u){var r=u.length,t=new u.constructor(r);return r&&typeof u[0]=="string"&&eu.call(u,"index")&&(t.index=u.index,t.input=u.input),t;}var nu=ru,iu=ee,su=iu.Uint8Array,qn=su,kr=qn;function ou(u){var r=new u.constructor(u.byteLength);return new kr(r).set(new kr(u)),r;}var Ar=ou,au=Ar;function lu(u,r){var t=r?au(u.buffer):u.buffer;return new u.constructor(t,u.byteOffset,u.byteLength);}var cu=lu,fu=/\w*$/;function uu(u){var r=new u.constructor(u.source,fu.exec(u));return r.lastIndex=u.lastIndex,r;}var hu=uu,qr=Ne,_r=qr?qr.prototype:void 0,tn=_r?_r.valueOf:void 0;function du(u){return tn?Object(tn.call(u)):{};}var gu=du,pu=Ar;function vu(u,r){var t=r?pu(u.buffer):u.buffer;return new u.constructor(t,u.byteOffset,u.length);}var mu=vu,yu=Ar,Su=cu,xu=hu,Tu=gu,Mu=mu,Ou="[object Boolean]",Pu="[object Date]",Eu="[object Map]",Au="[object Number]",Cu="[object RegExp]",Ru="[object Set]",Iu="[object String]",Lu="[object Symbol]",bu="[object ArrayBuffer]",Du="[object DataView]",wu="[object Float32Array]",Nu="[object Float64Array]",Wu="[object Int8Array]",Bu="[object Int16Array]",Fu="[object Int32Array]",Uu="[object Uint8Array]",ju="[object Uint8ClampedArray]",$u="[object Uint16Array]",zu="[object Uint32Array]";function Gu(u,r,t){var e=u.constructor;switch(r){case bu:return yu(u);case Ou:case Pu:return new e(+u);case Du:return Su(u,t);case wu:case Nu:case Wu:case Bu:case Fu:case Uu:case ju:case $u:case zu:return Mu(u,t);case Eu:return new e();case Au:case Iu:return new e(u);case Cu:return xu(u);case Ru:return new e();case Lu:return Tu(u);}}var Hu=Gu,Ku=le,en=Object.create,Vu=/* @__PURE__ */function(){function u(){}return function(r){if(!Ku(r))return{};if(en)return en(r);u.prototype=r;var t=new u();return u.prototype=void 0,t;};}(),Yu=Vu,Xu=Yu,Ju=Yn,Qu=xr;function Zu(u){return typeof u.constructor=="function"&&!Qu(u)?Xu(Ju(u)):{};}var ku=Zu,qu=rr,_u=re,th="[object Map]";function eh(u){return _u(u)&&qu(u)==th;}var rh=eh,nh=rh,ih=er,rn=Sr,nn=rn&&rn.isMap,sh=nn?ih(nn):nh,oh=sh,ah=rr,lh=re,ch="[object Set]";function fh(u){return lh(u)&&ah(u)==ch;}var uh=fh,hh=uh,dh=er,sn=Sr,on=sn&&sn.isSet,gh=on?dh(on):hh,ph=gh,vh=Nn,mh=za,yh=Fn,Sh=Ic,xh=Yc,Th=Xc,Mh=Qc,Oh=af,Ph=xf,Eh=Qn,Ah=Df,Ch=rr,Rh=nu,Ih=Hu,Lh=ku,bh=We,Dh=yr,wh=oh,Nh=le,Wh=ph,Bh=Mr,Fh=Or,Uh=1,jh=2,$h=4,_n="[object Arguments]",zh="[object Array]",Gh="[object Boolean]",Hh="[object Date]",Kh="[object Error]",ti="[object Function]",Vh="[object GeneratorFunction]",Yh="[object Map]",Xh="[object Number]",ei="[object Object]",Jh="[object RegExp]",Qh="[object Set]",Zh="[object String]",kh="[object Symbol]",qh="[object WeakMap]",_h="[object ArrayBuffer]",td="[object DataView]",ed="[object Float32Array]",rd="[object Float64Array]",nd="[object Int8Array]",id="[object Int16Array]",sd="[object Int32Array]",od="[object Uint8Array]",ad="[object Uint8ClampedArray]",ld="[object Uint16Array]",cd="[object Uint32Array]",Bt={};Bt[_n]=Bt[zh]=Bt[_h]=Bt[td]=Bt[Gh]=Bt[Hh]=Bt[ed]=Bt[rd]=Bt[nd]=Bt[id]=Bt[sd]=Bt[Yh]=Bt[Xh]=Bt[ei]=Bt[Jh]=Bt[Qh]=Bt[Zh]=Bt[kh]=Bt[od]=Bt[ad]=Bt[ld]=Bt[cd]=!0;Bt[Kh]=Bt[ti]=Bt[qh]=!1;function Ue(u,r,t,e,n,i){var a,o=r&Uh,s=r&jh,c=r&$h;if(t&&(a=n?t(u,e,n,i):t(u)),a!==void 0)return a;if(!Nh(u))return u;var p=bh(u);if(p){if(a=Rh(u),!o)return Mh(u,a);}else{var h=Ch(u),v=h==ti||h==Vh;if(Dh(u))return Th(u,o);if(h==ei||h==_n||v&&!n){if(a=s||v?{}:Lh(u),!o)return s?Ph(u,xh(a,u)):Oh(u,Sh(a,u));}else{if(!Bt[h])return n?u:{};a=Ih(u,h,o);}}i||(i=new vh());var y=i.get(u);if(y)return y;i.set(u,a),Wh(u)?u.forEach(function(m){a.add(Ue(m,r,t,m,u,i));}):wh(u)&&u.forEach(function(m,x){a.set(x,Ue(m,r,t,x,u,i));});var M=c?s?Ah:Eh:s?Fh:Bh,T=p?void 0:M(u);return mh(T||u,function(m,x){T&&(x=m,m=u[x]),yh(a,x,Ue(m,r,t,x,u,i));}),a;}var fd=Ue,ud=fd,hd=1,dd=4;function gd(u){return ud(u,hd|dd);}var pd=gd,Xt=/* @__PURE__ */he(pd);var ri="1.0.4",vd="@netless/appliance-plugin",md=typeof OffscreenCanvas=="function"?"worker":"mainThread";if((typeof window==="undefined"?"undefined":_typeof(window))<"u"){var u=window.__netlessUA||"";u+=" ".concat(vd,"@").concat(ri,"_").concat(md),window.__netlessUA=u;}var ne={syncOpt:{interval:200},canvasOpt:{contextType:ye.Canvas2d},cdn:{subWorkerUrl:"https://cdn.jsdelivr.net/npm/@netless/appliance-plugin@latest/dist/subWorker.js",fullWorkerUrl:"https://cdn.jsdelivr.net/npm/@netless/appliance-plugin@latest/dist/fullWorker.js"},cursor:{expirationTime:5e3},bufferSize:{full:2e4,sub:1e3}},Jt=/*#__PURE__*/function(){function Jt(r){_classCallCheck(this,Jt);rt(this,"syncUnitTime",ne.syncOpt.interval);rt(this,"vNodes");rt(this,"drawLayer");rt(this,"fullLayer");rt(this,"workId");var t=r.vNodes,e=r.fullLayer,n=r.drawLayer,i=r.workId,a=r.toolsOpt;this.vNodes=t,this.fullLayer=e,this.drawLayer=n,this.workId=i,this.syncUnitTime=a.syncUnitTime||this.syncUnitTime;}return _createClass(Jt,[{key:"baseConsumeResult",get:function get(){return{workId:this.workId,toolsType:this.toolsType,opt:this.workOptions};}},{key:"filterSamePoints",value:function filterSamePoints(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.01;return r.reduce(function(e,n){var i=e[e.length-1];return(n&&!i||n&&i&&!n.isNear(i,t))&&e.push(n),e;},[]);}/** 设置工作id */},{key:"setWorkId",value:function setWorkId(r){this.workId=r;}},{key:"getWorkId",value:function getWorkId(){return this.workId;}/** 获取工作选项配置 */},{key:"getWorkOptions",value:function getWorkOptions(){return this.workOptions;}/** 设置工作选项配置 */},{key:"setWorkOptions",value:function setWorkOptions(r){var n,i,a;this.workOptions=r,this.syncUnitTime=r.syncUnitTime||this.syncUnitTime;var t=(n=this.workId)==null?void 0:n.toString(),e=t&&((i=this.vNodes)==null?void 0:i.get(t))||void 0;t&&e&&(e.opt=r,(a=this.vNodes)==null||a.setInfo(t,e));}/** 更新服务端同步配置,返回绘制结果 */},{key:"updataOptService",value:function updataOptService(r){var n,i;var t;var e=(n=this.workId)==null?void 0:n.toString();if(e&&r){var a=this.fullLayer.getElementsByName(e)||this.drawLayer&&this.drawLayer.getElementsByName(e)||[];if(a.length!==1)return;var o=a[0],s=r.pos,c=r.zIndex,p=r.scale,h=r.angle,v=r.translate,y={};kt(c)&&(y.zIndex=c),s&&(y.pos=[s[0],s[1]]),p&&(y.scale=p),h&&(y.rotate=h),v&&(y.translate=v),o.attr(y);var M=o==null?void 0:o.getBoundingClientRect();return M&&(t=Ot(t,{x:Math.floor(M.x-Jt.SafeBorderPadding),y:Math.floor(M.y-Jt.SafeBorderPadding),w:Math.floor(M.width+Jt.SafeBorderPadding*2),h:Math.floor(M.height+Jt.SafeBorderPadding*2)})),(i=this.vNodes)==null||i.setInfo(e,{rect:t,centerPos:s}),t;}}},{key:"replace",value:function replace(r,t,e){var _this13=this;var o;var n=r.getElementsByName(t),i=n.length;if(i){if(i>1)for(var s=1;s<n.length;s++)r.removeChild(n[s]),n[s].disconnect();e?r.replaceChild(e,n[0]):r.removeChild(n[0]),n[0].disconnect();}else e&&r.append(e);this.fullLayer===r?(o=this.drawLayer)==null||o.getElementsByName(t).forEach(function(s){var c;(c=_this13.drawLayer)==null||c.removeChild(s),s.disconnect();}):this.fullLayer.getElementsByName(t).forEach(function(s){_this13.fullLayer.removeChild(s),s.disconnect();});}}],[{key:"updateNodeOpt",value:function updateNodeOpt(r){var l;var t=r.node,e=r.opt,n=r.vNodes,i=r.willSerializeData,a=r.targetNode,o=e.zIndex,s=e.translate,c=e.angle,p=e.originPoint,h=e.scenePoint,v=e.scale,y=e.pointMap,M=e.thickness;var T;var m=a&&Xt(a)||n.get(t.name);if(!m)return;kt(o)&&(t.setAttribute("zIndex",o),m.opt.zIndex=o);var x=t.parent;if(x){if(p&&v&&a){var d=[m.op[0],m.op[1]];Dr(m.op,h,v,s);var f=[m.op[0],m.op[1]],g=[f[0]-d[0],f[1]-d[1]];m.centerPos=[m.centerPos[0]+g[0],m.centerPos[1]+g[1]],m.opt.translate=void 0,m.opt.scale=void 0;}else if(s){if(t.setAttribute("translate",s),m.opt.translate=s,a){var _d2=[s[0]*x.worldScaling[0],s[1]*x.worldScaling[1]];T=N0(m.rect,_d2),m.rect=T;}else{var _d3=Jt.getRectFromLayer(x,t.name);m.rect=_d3||m.rect;}}else if(kt(c))if(t.setAttribute("rotate",c),m.opt.rotate=c,a)T=mi(m.rect,c),m.rect=T;else{var _d4=Jt.getRectFromLayer(x,t.name);m.rect=_d4||m.rect;}if(y){var _d5=y.get(t.name);if(_d5)for(var _f2=0,_g2=0;_f2<m.op.length;_f2+=3,_g2++)m.op[_f2]=_d5[_g2][0],m.op[_f2+1]=_d5[_g2][1];}if(M&&(l=m==null?void 0:m.opt)!=null&&l.thickness&&(m.opt.thickness=M),i&&!(p&&v&&a)){if(s){var _d6=m.op.map(function(f,g){var O=g%3;return O===0?f+s[0]:O===1?f+s[1]:f;});m.op=_d6,m.centerPos=[m.centerPos[0]+s[0],m.centerPos[1]+s[1]],m!=null&&m.opt&&(m.opt.translate=void 0);}else if(kt(c)){var _d7=m.op;B0(_d7,m.centerPos,c),m.op=_d7,m!=null&&m.opt&&(m.opt.rotate=void 0);}}m&&n.setInfo(t.name,m);}}},{key:"getCenterPos",value:function getCenterPos(r,t){var e=t.worldPosition,n=t.worldScaling;return[(r.x+r.w/2-e[0])/n[0],(r.y+r.h/2-e[1])/n[1]];}},{key:"getRectFromLayer",value:function getRectFromLayer(r,t){var e=r.getElementsByName(t)[0];if(e){var n=e.getBoundingClientRect();return{x:Math.floor(n.x-Jt.SafeBorderPadding),y:Math.floor(n.y-Jt.SafeBorderPadding),w:Math.floor(n.width+Jt.SafeBorderPadding*2),h:Math.floor(n.height+Jt.SafeBorderPadding*2)};}}}]);}();rt(Jt,"SafeBorderPadding",10);var yt=Jt;var Wt=/******/function(u){var r={};function t(e){if(r[e])return r[e].exports;var n=r[e]={/******/i:e,/******/l:!1,/******/exports:{}/******/};return u[e].call(n.exports,n,n.exports,t),n.l=!0,n.exports;}return t.m=u,t.c=r,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:i});},t.r=function(e){(typeof Symbol==="undefined"?"undefined":_typeof(Symbol))<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0});},t.t=function(e,n){if(n&1&&(e=t(e)),n&8||n&4&&_typeof(e)=="object"&&e&&e.__esModule)return e;var i=/* @__PURE__ */Object.create(null);if(t.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),n&2&&typeof e!="string")for(var a in e)t.d(i,a,function(o){return e[o];}.bind(null,a));return i;},t.n=function(e){var n=e&&e.__esModule?(/******/function(){return e["default"];}):(/******/function(){return e;});return t.d(n,"a",n),n;},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n);},t.p="/js/",t(t.s=0);}([/* 0 */ /***/function(u,r,t){t.r(r),t.d(r,"version",function(){return H;}),t.d(r,"helpers",function(){return B;}),t.d(r,"createElement",function(){return D;}),t.d(r,"isSpriteNode",function(){return I;}),t.d(r,"registerNode",function(){return C;});var e=t(12);t.d(r,"ENV",function(){return e.ENV;});var n=t(68);t.d(r,"requestAnimationFrame",function(){return n.requestAnimationFrame;}),t.d(r,"cancelAnimationFrame",function(){return n.cancelAnimationFrame;});var i=t(70);t.d(r,"Node",function(){return i["default"];});var a=t(217);t.d(r,"Cloud",function(){return a["default"];});var o=t(219);t.d(r,"Block",function(){return o["default"];});var s=t(224);t.d(r,"Sprite",function(){return s["default"];});var c=t(226);t.d(r,"Path",function(){return c["default"];});var p=t(229);t.d(r,"Rect",function(){return p["default"];});var h=t(231);t.d(r,"Triangle",function(){return h["default"];});var v=t(236);t.d(r,"Parallel",function(){return v["default"];});var y=t(238);t.d(r,"Regular",function(){return y["default"];});var M=t(240);t.d(r,"Star",function(){return M["default"];});var T=t(242);t.d(r,"Ellipse",function(){return T["default"];});var m=t(244);t.d(r,"Arc",function(){return m["default"];});var x=t(246);t.d(r,"Ring",function(){return x["default"];});var l=t(232);t.d(r,"Polyline",function(){return l["default"];});var d=t(248);t.d(r,"Label",function(){return d["default"];});var f=t(250);t.d(r,"Group",function(){return f["default"];});var g=t(286);t.d(r,"Layer",function(){return g["default"];});var O=t(287);t.d(r,"SpriteSvg",function(){return O["default"];});var A=t(289);t.d(r,"LayerWorker",function(){return A["default"];});var R=t(290);t.d(r,"Scene",function(){return R["default"];});var b=t(213),P=t(221);t.d(r,"Color",function(){return P.Color;}),t.d(r,"Gradient",function(){return P.Gradient;});var L=t(72);t(1).glMatrix.setMatrixArrayType(Array);var D=b["default"].createElement,I=b["default"].isSpriteNode,C=b["default"].registerNode,B={parseColor:P.parseColor,sizeToPixel:L.sizeToPixel,toArray:L.toArray,toString:L.toString,toNumber:L.toNumber};var G;G="3.8.3";var H=G;},/* 1 */ /***/function(u,r,t){t.r(r);var e=t(2);t.d(r,"glMatrix",function(){return e;});var n=t(3);t.d(r,"mat2",function(){return n;});var i=t(4);t.d(r,"mat2d",function(){return i;});var a=t(5);t.d(r,"mat3",function(){return a;});var o=t(6);t.d(r,"mat4",function(){return o;});var s=t(7);t.d(r,"quat",function(){return s;});var c=t(10);t.d(r,"quat2",function(){return c;});var p=t(11);t.d(r,"vec2",function(){return p;});var h=t(8);t.d(r,"vec3",function(){return h;});var v=t(9);t.d(r,"vec4",function(){return v;});},/* 2 */ /***/function(u,r,t){t.r(r),t.d(r,"EPSILON",function(){return e;}),t.d(r,"ARRAY_TYPE",function(){return n;}),t.d(r,"RANDOM",function(){return i;}),t.d(r,"setMatrixArrayType",function(){return a;}),t.d(r,"toRadian",function(){return s;}),t.d(r,"equals",function(){return c;});var e=1e-6,n=(typeof Float32Array==="undefined"?"undefined":_typeof(Float32Array))<"u"?Float32Array:Array,i=Math.random;function a(p){n=p;}var o=Math.PI/180;function s(p){return p*o;}function c(p,h){return Math.abs(p-h)<=e*Math.max(1,Math.abs(p),Math.abs(h));}Math.hypot||(Math.hypot=function(){for(var p=0,h=arguments.length;h--;)p+=arguments[h]*arguments[h];return Math.sqrt(p);});},/* 3 */ /***/function(u,r,t){t.r(r),t.d(r,"create",function(){return n;}),t.d(r,"clone",function(){return i;}),t.d(r,"copy",function(){return a;}),t.d(r,"identity",function(){return o;}),t.d(r,"fromValues",function(){return s;}),t.d(r,"set",function(){return c;}),t.d(r,"transpose",function(){return p;}),t.d(r,"invert",function(){return h;}),t.d(r,"adjoint",function(){return v;}),t.d(r,"determinant",function(){return y;}),t.d(r,"multiply",function(){return M;}),t.d(r,"rotate",function(){return T;}),t.d(r,"scale",function(){return m;}),t.d(r,"fromRotation",function(){return x;}),t.d(r,"fromScaling",function(){return l;}),t.d(r,"str",function(){return d;}),t.d(r,"frob",function(){return f;}),t.d(r,"LDU",function(){return g;}),t.d(r,"add",function(){return O;}),t.d(r,"subtract",function(){return A;}),t.d(r,"exactEquals",function(){return R;}),t.d(r,"equals",function(){return b;}),t.d(r,"multiplyScalar",function(){return P;}),t.d(r,"multiplyScalarAndAdd",function(){return L;}),t.d(r,"mul",function(){return D;}),t.d(r,"sub",function(){return I;});var e=t(2);function n(){var C=new e.ARRAY_TYPE(4);return e.ARRAY_TYPE!=Float32Array&&(C[1]=0,C[2]=0),C[0]=1,C[3]=1,C;}function i(C){var B=new e.ARRAY_TYPE(4);return B[0]=C[0],B[1]=C[1],B[2]=C[2],B[3]=C[3],B;}function a(C,B){return C[0]=B[0],C[1]=B[1],C[2]=B[2],C[3]=B[3],C;}function o(C){return C[0]=1,C[1]=0,C[2]=0,C[3]=1,C;}function s(C,B,G,H){var X=new e.ARRAY_TYPE(4);return X[0]=C,X[1]=B,X[2]=G,X[3]=H,X;}function c(C,B,G,H,X){return C[0]=B,C[1]=G,C[2]=H,C[3]=X,C;}function p(C,B){if(C===B){var G=B[1];C[1]=B[2],C[2]=G;}else C[0]=B[0],C[1]=B[2],C[2]=B[1],C[3]=B[3];return C;}function h(C,B){var G=B[0],H=B[1],X=B[2],Z=B[3],W=G*Z-X*H;return W?(W=1/W,C[0]=Z*W,C[1]=-H*W,C[2]=-X*W,C[3]=G*W,C):null;}function v(C,B){var G=B[0];return C[0]=B[3],C[1]=-B[1],C[2]=-B[2],C[3]=G,C;}function y(C){return C[0]*C[3]-C[2]*C[1];}function M(C,B,G){var H=B[0],X=B[1],Z=B[2],W=B[3],z=G[0],Q=G[1],et=G[2],_=G[3];return C[0]=H*z+Z*Q,C[1]=X*z+W*Q,C[2]=H*et+Z*_,C[3]=X*et+W*_,C;}function T(C,B,G){var H=B[0],X=B[1],Z=B[2],W=B[3],z=Math.sin(G),Q=Math.cos(G);return C[0]=H*Q+Z*z,C[1]=X*Q+W*z,C[2]=H*-z+Z*Q,C[3]=X*-z+W*Q,C;}function m(C,B,G){var H=B[0],X=B[1],Z=B[2],W=B[3],z=G[0],Q=G[1];return C[0]=H*z,C[1]=X*z,C[2]=Z*Q,C[3]=W*Q,C;}function x(C,B){var G=Math.sin(B),H=Math.cos(B);return C[0]=H,C[1]=G,C[2]=-G,C[3]=H,C;}function l(C,B){return C[0]=B[0],C[1]=0,C[2]=0,C[3]=B[1],C;}function d(C){return"mat2("+C[0]+", "+C[1]+", "+C[2]+", "+C[3]+")";}function f(C){return Math.hypot(C[0],C[1],C[2],C[3]);}function g(C,B,G,H){return C[2]=H[2]/H[0],G[0]=H[0],G[1]=H[1],G[3]=H[3]-C[2]*G[1],[C,B,G];}function O(C,B,G){return C[0]=B[0]+G[0],C[1]=B[1]+G[1],C[2]=B[2]+G[2],C[3]=B[3]+G[3],C;}function A(C,B,G){return C[0]=B[0]-G[0],C[1]=B[1]-G[1],C[2]=B[2]-G[2],C[3]=B[3]-G[3],C;}function R(C,B){return C[0]===B[0]&&C[1]===B[1]&&C[2]===B[2]&&C[3]===B[3];}function b(C,B){var G=C[0],H=C[1],X=C[2],Z=C[3],W=B[0],z=B[1],Q=B[2],et=B[3];return Math.abs(G-W)<=e.EPSILON*Math.max(1,Math.abs(G),Math.abs(W))&&Math.abs(H-z)<=e.EPSILON*Math.max(1,Math.abs(H),Math.abs(z))&&Math.abs(X-Q)<=e.EPSILON*Math.max(1,Math.abs(X),Math.abs(Q))&&Math.abs(Z-et)<=e.EPSILON*Math.max(1,Math.abs(Z),Math.abs(et));}function P(C,B,G){return C[0]=B[0]*G,C[1]=B[1]*G,C[2]=B[2]*G,C[3]=B[3]*G,C;}function L(C,B,G,H){return C[0]=B[0]+G[0]*H,C[1]=B[1]+G[1]*H,C[2]=B[2]+G[2]*H,C[3]=B[3]+G[3]*H,C;}var D=M,I=A;},/* 4 */ /***/function(u,r,t){t.r(r),t.d(r,"create",function(){return n;}),t.d(r,"clone",function(){return i;}),t.d(r,"copy",function(){return a;}),t.d(r,"identity",function(){return o;}),t.d(r,"fromValues",function(){return s;}),t.d(r,"set",function(){return c;}),t.d(r,"invert",function(){return p;}),t.d(r,"determinant",function(){return h;}),t.d(r,"multiply",function(){return v;}),t.d(r,"rotate",function(){return y;}),t.d(r,"scale",function(){return M;}),t.d(r,"translate",function(){return T;}),t.d(r,"fromRotation",function(){return m;}),t.d(r,"fromScaling",function(){return x;}),t.d(r,"fromTranslation",function(){return l;}),t.d(r,"str",function(){return d;}),t.d(r,"frob",function(){return f;}),t.d(r,"add",function(){return g;}),t.d(r,"subtract",function(){return O;}),t.d(r,"multiplyScalar",function(){return A;}),t.d(r,"multiplyScalarAndAdd",function(){return R;}),t.d(r,"exactEquals",function(){return b;}),t.d(r,"equals",function(){return P;}),t.d(r,"mul",function(){return L;}),t.d(r,"sub",function(){return D;});var e=t(2);function n(){var I=new e.ARRAY_TYPE(6);return e.ARRAY_TYPE!=Float32Array&&(I[1]=0,I[2]=0,I[4]=0,I[5]=0),I[0]=1,I[3]=1,I;}function i(I){var C=new e.ARRAY_TYPE(6);return C[0]=I[0],C[1]=I[1],C[2]=I[2],C[3]=I[3],C[4]=I[4],C[5]=I[5],C;}function a(I,C){return I[0]=C[0],I[1]=C[1],I[2]=C[2],I[3]=C[3],I[4]=C[4],I[5]=C[5],I;}function o(I){return I[0]=1,I[1]=0,I[2]=0,I[3]=1,I[4]=0,I[5]=0,I;}function s(I,C,B,G,H,X){var Z=new e.ARRAY_TYPE(6);return Z[0]=I,Z[1]=C,Z[2]=B,Z[3]=G,Z[4]=H,Z[5]=X,Z;}function c(I,C,B,G,H,X,Z){return I[0]=C,I[1]=B,I[2]=G,I[3]=H,I[4]=X,I[5]=Z,I;}function p(I,C){var B=C[0],G=C[1],H=C[2],X=C[3],Z=C[4],W=C[5],z=B*X-G*H;return z?(z=1/z,I[0]=X*z,I[1]=-G*z,I[2]=-H*z,I[3]=B*z,I[4]=(H*W-X*Z)*z,I[5]=(G*Z-B*W)*z,I):null;}function h(I){return I[0]*I[3]-I[1]*I[2];}function v(I,C,B){var G=C[0],H=C[1],X=C[2],Z=C[3],W=C[4],z=C[5],Q=B[0],et=B[1],_=B[2],st=B[3],q=B[4],ht=B[5];return I[0]=G*Q+X*et,I[1]=H*Q+Z*et,I[2]=G*_+X*st,I[3]=H*_+Z*st,I[4]=G*q+X*ht+W,I[5]=H*q+Z*ht+z,I;}function y(I,C,B){var G=C[0],H=C[1],X=C[2],Z=C[3],W=C[4],z=C[5],Q=Math.sin(B),et=Math.cos(B);return I[0]=G*et+X*Q,I[1]=H*et+Z*Q,I[2]=G*-Q+X*et,I[3]=H*-Q+Z*et,I[4]=W,I[5]=z,I;}function M(I,C,B){var G=C[0],H=C[1],X=C[2],Z=C[3],W=C[4],z=C[5],Q=B[0],et=B[1];return I[0]=G*Q,I[1]=H*Q,I[2]=X*et,I[3]=Z*et,I[4]=W,I[5]=z,I;}function T(I,C,B){var G=C[0],H=C[1],X=C[2],Z=C[3],W=C[4],z=C[5],Q=B[0],et=B[1];return I[0]=G,I[1]=H,I[2]=X,I[3]=Z,I[4]=G*Q+X*et+W,I[5]=H*Q+Z*et+z,I;}function m(I,C){var B=Math.sin(C),G=Math.cos(C);return I[0]=G,I[1]=B,I[2]=-B,I[3]=G,I[4]=0,I[5]=0,I;}function x(I,C){return I[0]=C[0],I[1]=0,I[2]=0,I[3]=C[1],I[4]=0,I[5]=0,I;}function l(I,C){return I[0]=1,I[1]=0,I[2]=0,I[3]=1,I[4]=C[0],I[5]=C[1],I;}function d(I){return"mat2d("+I[0]+", "+I[1]+", "+I[2]+", "+I[3]+", "+I[4]+", "+I[5]+")";}function f(I){return Math.hypot(I[0],I[1],I[2],I[3],I[4],I[5],1);}function g(I,C,B){return I[0]=C[0]+B[0],I[1]=C[1]+B[1],I[2]=C[2]+B[2],I[3]=C[3]+B[3],I[4]=C[4]+B[4],I[5]=C[5]+B[5],I;}function O(I,C,B){return I[0]=C[0]-B[0],I[1]=C[1]-B[1],I[2]=C[2]-B[2],I[3]=C[3]-B[3],I[4]=C[4]-B[4],I[5]=C[5]-B[5],I;}function A(I,C,B){return I[0]=C[0]*B,I[1]=C[1]*B,I[2]=C[2]*B,I[3]=C[3]*B,I[4]=C[4]*B,I[5]=C[5]*B,I;}function R(I,C,B,G){return I[0]=C[0]+B[0]*G,I[1]=C[1]+B[1]*G,I[2]=C[2]+B[2]*G,I[3]=C[3]+B[3]*G,I[4]=C[4]+B[4]*G,I[5]=C[5]+B[5]*G,I;}function b(I,C){return I[0]===C[0]&&I[1]===C[1]&&I[2]===C[2]&&I[3]===C[3]&&I[4]===C[4]&&I[5]===C[5];}function P(I,C){var B=I[0],G=I[1],H=I[2],X=I[3],Z=I[4],W=I[5],z=C[0],Q=C[1],et=C[2],_=C[3],st=C[4],q=C[5];return Math.abs(B-z)<=e.EPSILON*Math.max(1,Math.abs(B),Math.abs(z))&&Math.abs(G-Q)<=e.EPSILON*Math.max(1,Math.abs(G),Math.abs(Q))&&Math.abs(H-et)<=e.EPSILON*Math.max(1,Math.abs(H),Math.abs(et))&&Math.abs(X-_)<=e.EPSILON*Math.max(1,Math.abs(X),Math.abs(_))&&Math.abs(Z-st)<=e.EPSILON*Math.max(1,Math.abs(Z),Math.abs(st))&&Math.abs(W-q)<=e.EPSILON*Math.max(1,Math.abs(W),Math.abs(q));}var L=v,D=O;},/* 5 */ /***/function(u,r,t){t.r(r),t.d(r,"create",function(){return n;}),t.d(r,"fromMat4",function(){return i;}),t.d(r,"clone",function(){return a;}),t.d(r,"copy",function(){return o;}),t.d(r,"fromValues",function(){return s;}),t.d(r,"set",function(){return c;}),t.d(r,"identity",function(){return p;}),t.d(r,"transpose",function(){return h;}),t.d(r,"invert",function(){return v;}),t.d(r,"adjoint",function(){return y;}),t.d(r,"determinant",function(){return M;}),t.d(r,"multiply",function(){return T;}),t.d(r,"translate",function(){return m;}),t.d(r,"rotate",function(){return x;}),t.d(r,"scale",function(){return l;}),t.d(r,"fromTranslation",function(){return d;}),t.d(r,"fromRotation",function(){return f;}),t.d(r,"fromScaling",function(){return g;}),t.d(r,"fromMat2d",function(){return O;}),t.d(r,"fromQuat",function(){return A;}),t.d(r,"normalFromMat4",function(){return R;}),t.d(r,"projection",function(){return b;}),t.d(r,"str",function(){return P;}),t.d(r,"frob",function(){return L;}),t.d(r,"add",function(){return D;}),t.d(r,"subtract",function(){return I;}),t.d(r,"multiplyScalar",function(){return C;}),t.d(r,"multiplyScalarAndAdd",function(){return B;}),t.d(r,"exactEquals",function(){return G;}),t.d(r,"equals",function(){return H;}),t.d(r,"mul",function(){return X;}),t.d(r,"sub",function(){return Z;});var e=t(2);function n(){var W=new e.ARRAY_TYPE(9);return e.ARRAY_TYPE!=Float32Array&&(W[1]=0,W[2]=0,W[3]=0,W[5]=0,W[6]=0,W[7]=0),W[0]=1,W[4]=1,W[8]=1,W;}function i(W,z){return W[0]=z[0],W[1]=z[1],W[2]=z[2],W[3]=z[4],W[4]=z[5],W[5]=z[6],W[6]=z[8],W[7]=z[9],W[8]=z[10],W;}function a(W){var z=new e.ARRAY_TYPE(9);return z[0]=W[0],z[1]=W[1],z[2]=W[2],z[3]=W[3],z[4]=W[4],z[5]=W[5],z[6]=W[6],z[7]=W[7],z[8]=W[8],z;}function o(W,z){return W[0]=z[0],W[1]=z[1],W[2]=z[2],W[3]=z[3],W[4]=z[4],W[5]=z[5],W[6]=z[6],W[7]=z[7],W[8]=z[8],W;}function s(W,z,Q,et,_,st,q,ht,dt){var F=new e.ARRAY_TYPE(9);return F[0]=W,F[1]=z,F[2]=Q,F[3]=et,F[4]=_,F[5]=st,F[6]=q,F[7]=ht,F[8]=dt,F;}function c(W,z,Q,et,_,st,q,ht,dt,F){return W[0]=z,W[1]=Q,W[2]=et,W[3]=_,W[4]=st,W[5]=q,W[6]=ht,W[7]=dt,W[8]=F,W;}function p(W){return W[0]=1,W[1]=0,W[2]=0,W[3]=0,W[4]=1,W[5]=0,W[6]=0,W[7]=0,W[8]=1,W;}function h(W,z){if(W===z){var Q=z[1],et=z[2],_=z[5];W[1]=z[3],W[2]=z[6],W[3]=Q,W[5]=z[7],W[6]=et,W[7]=_;}else W[0]=z[0],W[1]=z[3],W[2]=z[6],W[3]=z[1],W[4]=z[4],W[5]=z[7],W[6]=z[2],W[7]=z[5],W[8]=z[8];return W;}function v(W,z){var Q=z[0],et=z[1],_=z[2],st=z[3],q=z[4],ht=z[5],dt=z[6],F=z[7],U=z[8],V=U*q-ht*F,J=-U*st+ht*dt,N=F*st-q*dt,$=Q*V+et*J+_*N;return $?($=1/$,W[0]=V*$,W[1]=(-U*et+_*F)*$,W[2]=(ht*et-_*q)*$,W[3]=J*$,W[4]=(U*Q-_*dt)*$,W[5]=(-ht*Q+_*st)*$,W[6]=N*$,W[7]=(-F*Q+et*dt)*$,W[8]=(q*Q-et*st)*$,W):null;}function y(W,z){var Q=z[0],et=z[1],_=z[2],st=z[3],q=z[4],ht=z[5],dt=z[6],F=z[7],U=z[8];return W[0]=q*U-ht*F,W[1]=_*F-et*U,W[2]=et*ht-_*q,W[3]=ht*dt-st*U,W[4]=Q*U-_*dt,W[5]=_*st-Q*ht,W[6]=st*F-q*dt,W[7]=et*dt-Q*F,W[8]=Q*q-et*st,W;}function M(W){var z=W[0],Q=W[1],et=W[2],_=W[3],st=W[4],q=W[5],ht=W[6],dt=W[7],F=W[8];return z*(F*st-q*dt)+Q*(-F*_+q*ht)+et*(dt*_-st*ht);}function T(W,z,Q){var et=z[0],_=z[1],st=z[2],q=z[3],ht=z[4],dt=z[5],F=z[6],U=z[7],V=z[8],J=Q[0],N=Q[1],$=Q[2],S=Q[3],E=Q[4],w=Q[5],j=Q[6],K=Q[7],Y=Q[8];return W[0]=J*et+N*q+$*F,W[1]=J*_+N*ht+$*U,W[2]=J*st+N*dt+$*V,W[3]=S*et+E*q+w*F,W[4]=S*_+E*ht+w*U,W[5]=S*st+E*dt+w*V,W[6]=j*et+K*q+Y*F,W[7]=j*_+K*ht+Y*U,W[8]=j*st+K*dt+Y*V,W;}function m(W,z,Q){var et=z[0],_=z[1],st=z[2],q=z[3],ht=z[4],dt=z[5],F=z[6],U=z[7],V=z[8],J=Q[0],N=Q[1];return W[0]=et,W[1]=_,W[2]=st,W[3]=q,W[4]=ht,W[5]=dt,W[6]=J*et+N*q+F,W[7]=J*_+N*ht+U,W[8]=J*st+N*dt+V,W;}function x(W,z,Q){var et=z[0],_=z[1],st=z[2],q=z[3],ht=z[4],dt=z[5],F=z[6],U=z[7],V=z[8],J=Math.sin(Q),N=Math.cos(Q);return W[0]=N*et+J*q,W[1]=N*_+J*ht,W[2]=N*st+J*dt,W[3]=N*q-J*et,W[4]=N*ht-J*_,W[5]=N*dt-J*st,W[6]=F,W[7]=U,W[8]=V,W;}function l(W,z,Q){var et=Q[0],_=Q[1];return W[0]=et*z[0],W[1]=et*z[1],W[2]=et*z[2],W[3]=_*z[3],W[4]=_*z[4],W[5]=_*z[5],W[6]=z[6],W[7]=z[7],W[8]=z[8],W;}function d(W,z){return W[0]=1,W[1]=0,W[2]=0,W[3]=0,W[4]=1,W[5]=0,W[6]=z[0],W[7]=z[1],W[8]=1,W;}function f(W,z){var Q=Math.sin(z),et=Math.cos(z);return W[0]=et,W[1]=Q,W[2]=0,W[3]=-Q,W[4]=et,W[5]=0,W[6]=0,W[7]=0,W[8]=1,W;}function g(W,z){return W[0]=z[0],W[1]=0,W[2]=0,W[3]=0,W[4]=z[1],W[5]=0,W[6]=0,W[7]=0,W[8]=1,W;}function O(W,z){return W[0]=z[0],W[1]=z[1],W[2]=0,W[3]=z[2],W[4]=z[3],W[5]=0,W[6]=z[4],W[7]=z[5],W[8]=1,W;}function A(W,z){var Q=z[0],et=z[1],_=z[2],st=z[3],q=Q+Q,ht=et+et,dt=_+_,F=Q*q,U=et*q,V=et*ht,J=_*q,N=_*ht,$=_*dt,S=st*q,E=st*ht,w=st*dt;return W[0]=1-V-$,W[3]=U-w,W[6]=J+E,W[1]=U+w,W[4]=1-F-$,W[7]=N-S,W[2]=J-E,W[5]=N+S,W[8]=1-F-V,W;}function R(W,z){var Q=z[0],et=z[1],_=z[2],st=z[3],q=z[4],ht=z[5],dt=z[6],F=z[7],U=z[8],V=z[9],J=z[10],N=z[11],$=z[12],S=z[13],E=z[14],w=z[15],j=Q*ht-et*q,K=Q*dt-_*q,Y=Q*F-st*q,k=et*dt-_*ht,nt=et*F-st*ht,it=_*F-st*dt,lt=U*S-V*$,ut=U*E-J*$,at=U*w-N*$,ot=V*E-J*S,ct=V*w-N*S,vt=J*w-N*E,mt=j*vt-K*ct+Y*ot+k*at-nt*ut+it*lt;return mt?(mt=1/mt,W[0]=(ht*vt-dt*ct+F*ot)*mt,W[1]=(dt*at-q*vt-F*ut)*mt,W[2]=(q*ct-ht*at+F*lt)*mt,W[3]=(_*ct-et*vt-st*ot)*mt,W[4]=(Q*vt-_*at+st*ut)*mt,W[5]=(et*at-Q*ct-st*lt)*mt,W[6]=(S*it-E*nt+w*k)*mt,W[7]=(E*Y-$*it-w*K)*mt,W[8]=($*nt-S*Y+w*j)*mt,W):null;}function b(W,z,Q){return W[0]=2/z,W[1]=0,W[2]=0,W[3]=0,W[4]=-2/Q,W[5]=0,W[6]=-1,W[7]=1,W[8]=1,W;}function P(W){return"mat3("+W[0]+", "+W[1]+", "+W[2]+", "+W[3]+", "+W[4]+", "+W[5]+", "+W[6]+", "+W[7]+", "+W[8]+")";}function L(W){return Math.hypot(W[0],W[1],W[2],W[3],W[4],W[5],W[6],W[7],W[8]);}function D(W,z,Q){return W[0]=z[0]+Q[0],W[1]=z[1]+Q[1],W[2]=z[2]+Q[2],W[3]=z[3]+Q[3],W[4]=z[4]+Q[4],W[5]=z[5]+Q[5],W[6]=z[6]+Q[6],W[7]=z[7]+Q[7],W[8]=z[8]+Q[8],W;}function I(W,z,Q){return W[0]=z[0]-Q[0],W[1]=z[1]-Q[1],W[2]=z[2]-Q[2],W[3]=z[3]-Q[3],W[4]=z[4]-Q[4],W[5]=z[5]-Q[5],W[6]=z[6]-Q[6],W[7]=z[7]-Q[7],W[8]=z[8]-Q[8],W;}function C(W,z,Q){return W[0]=z[0]*Q,W[1]=z[1]*Q,W[2]=z[2]*Q,W[3]=z[3]*Q,W[4]=z[4]*Q,W[5]=z[5]*Q,W[6]=z[6]*Q,W[7]=z[7]*Q,W[8]=z[8]*Q,W;}function B(W,z,Q,et){return W[0]=z[0]+Q[0]*et,W[1]=z[1]+Q[1]*et,W[2]=z[2]+Q[2]*et,W[3]=z[3]+Q[3]*et,W[4]=z[4]+Q[4]*et,W[5]=z[5]+Q[5]*et,W[6]=z[6]+Q[6]*et,W[7]=z[7]+Q[7]*et,W[8]=z[8]+Q[8]*et,W;}function G(W,z){return W[0]===z[0]&&W[1]===z[1]&&W[2]===z[2]&&W[3]===z[3]&&W[4]===z[4]&&W[5]===z[5]&&W[6]===z[6]&&W[7]===z[7]&&W[8]===z[8];}function H(W,z){var Q=W[0],et=W[1],_=W[2],st=W[3],q=W[4],ht=W[5],dt=W[6],F=W[7],U=W[8],V=z[0],J=z[1],N=z[2],$=z[3],S=z[4],E=z[5],w=z[6],j=z[7],K=z[8];return Math.abs(Q-V)<=e.EPSILON*Math.max(1,Math.abs(Q),Math.abs(V))&&Math.abs(et-J)<=e.EPSILON*Math.max(1,Math.abs(et),Math.abs(J))&&Math.abs(_-N)<=e.EPSILON*Math.max(1,Math.abs(_),Math.abs(N))&&Math.abs(st-$)<=e.EPSILON*Math.max(1,Math.abs(st),Math.abs($))&&Math.abs(q-S)<=e.EPSILON*Math.max(1,Math.abs(q),Math.abs(S))&&Math.abs(ht-E)<=e.EPSILON*Math.max(1,Math.abs(ht),Math.abs(E))&&Math.abs(dt-w)<=e.EPSILON*Math.max(1,Math.abs(dt),Math.abs(w))&&Math.abs(F-j)<=e.EPSILON*Math.max(1,Math.abs(F),Math.abs(j))&&Math.abs(U-K)<=e.EPSILON*Math.max(1,Math.abs(U),Math.abs(K));}var X=T,Z=I;},/* 6 */ /***/function(u,r,t){t.r(r),t.d(r,"create",function(){return n;}),t.d(r,"clone",function(){return i;}),t.d(r,"copy",function(){return a;}),t.d(r,"fromValues",function(){return o;}),t.d(r,"set",function(){return s;}),t.d(r,"identity",function(){return c;}),t.d(r,"transpose",function(){return p;}),t.d(r,"invert",function(){return h;}),t.d(r,"adjoint",function(){return v;}),t.d(r,"determinant",function(){return y;}),t.d(r,"multiply",function(){return M;}),t.d(r,"translate",function(){return T;}),t.d(r,"scale",function(){return m;}),t.d(r,"rotate",function(){return x;}),t.d(r,"rotateX",function(){return l;}),t.d(r,"rotateY",function(){return d;}),t.d(r,"rotateZ",function(){return f;}),t.d(r,"fromTranslation",function(){return g;}),t.d(r,"fromScaling",function(){return O;}),t.d(r,"fromRotation",function(){return A;}),t.d(r,"fromXRotation",function(){return R;}),t.d(r,"fromYRotation",function(){return b;}),t.d(r,"fromZRotation",function(){return P;}),t.d(r,"fromRotationTranslation",function(){return L;}),t.d(r,"fromQuat2",function(){return D;}),t.d(r,"getTranslation",function(){return I;}),t.d(r,"getScaling",function(){return C;}),t.d(r,"getRotation",function(){return B;}),t.d(r,"fromRotationTranslationScale",function(){return G;}),t.d(r,"fromRotationTranslationScaleOrigin",function(){return H;}),t.d(r,"fromQuat",function(){return X;}),t.d(r,"frustum",function(){return Z;}),t.d(r,"perspective",function(){return W;}),t.d(r,"perspectiveFromFieldOfView",function(){return z;}),t.d(r,"ortho",function(){return Q;}),t.d(r,"lookAt",function(){return et;}),t.d(r,"targetTo",function(){return _;}),t.d(r,"str",function(){return st;}),t.d(r,"frob",function(){return q;}),t.d(r,"add",function(){return ht;}),t.d(r,"subtract",function(){return dt;}),t.d(r,"multiplyScalar",function(){return F;}),t.d(r,"multiplyScalarAndAdd",function(){return U;}),t.d(r,"exactEquals",function(){return V;}),t.d(r,"equals",function(){return J;}),t.d(r,"mul",function(){return N;}),t.d(r,"sub",function(){return $;});var e=t(2);function n(){var S=new e.ARRAY_TYPE(16);return e.ARRAY_TYPE!=Float32Array&&(S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[11]=0,S[12]=0,S[13]=0,S[14]=0),S[0]=1,S[5]=1,S[10]=1,S[15]=1,S;}function i(S){var E=new e.ARRAY_TYPE(16);return E[0]=S[0],E[1]=S[1],E[2]=S[2],E[3]=S[3],E[4]=S[4],E[5]=S[5],E[6]=S[6],E[7]=S[7],E[8]=S[8],E[9]=S[9],E[10]=S[10],E[11]=S[11],E[12]=S[12],E[13]=S[13],E[14]=S[14],E[15]=S[15],E;}function a(S,E){return S[0]=E[0],S[1]=E[1],S[2]=E[2],S[3]=E[3],S[4]=E[4],S[5]=E[5],S[6]=E[6],S[7]=E[7],S[8]=E[8],S[9]=E[9],S[10]=E[10],S[11]=E[11],S[12]=E[12],S[13]=E[13],S[14]=E[14],S[15]=E[15],S;}function o(S,E,w,j,K,Y,k,nt,it,lt,ut,at,ot,ct,vt,mt){var pt=new e.ARRAY_TYPE(16);return pt[0]=S,pt[1]=E,pt[2]=w,pt[3]=j,pt[4]=K,pt[5]=Y,pt[6]=k,pt[7]=nt,pt[8]=it,pt[9]=lt,pt[10]=ut,pt[11]=at,pt[12]=ot,pt[13]=ct,pt[14]=vt,pt[15]=mt,pt;}function s(S,E,w,j,K,Y,k,nt,it,lt,ut,at,ot,ct,vt,mt,pt){return S[0]=E,S[1]=w,S[2]=j,S[3]=K,S[4]=Y,S[5]=k,S[6]=nt,S[7]=it,S[8]=lt,S[9]=ut,S[10]=at,S[11]=ot,S[12]=ct,S[13]=vt,S[14]=mt,S[15]=pt,S;}function c(S){return S[0]=1,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=1,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[10]=1,S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S;}function p(S,E){if(S===E){var w=E[1],j=E[2],K=E[3],Y=E[6],k=E[7],nt=E[11];S[1]=E[4],S[2]=E[8],S[3]=E[12],S[4]=w,S[6]=E[9],S[7]=E[13],S[8]=j,S[9]=Y,S[11]=E[14],S[12]=K,S[13]=k,S[14]=nt;}else S[0]=E[0],S[1]=E[4],S[2]=E[8],S[3]=E[12],S[4]=E[1],S[5]=E[5],S[6]=E[9],S[7]=E[13],S[8]=E[2],S[9]=E[6],S[10]=E[10],S[11]=E[14],S[12]=E[3],S[13]=E[7],S[14]=E[11],S[15]=E[15];return S;}function h(S,E){var w=E[0],j=E[1],K=E[2],Y=E[3],k=E[4],nt=E[5],it=E[6],lt=E[7],ut=E[8],at=E[9],ot=E[10],ct=E[11],vt=E[12],mt=E[13],pt=E[14],St=E[15],Rt=w*nt-j*k,Pt=w*it-K*k,Et=w*lt-Y*k,At=j*it-K*nt,Ct=j*lt-Y*nt,Ht=K*lt-Y*it,jt=ut*mt-at*vt,$t=ut*pt-ot*vt,zt=ut*St-ct*vt,Kt=at*pt-ot*mt,Vt=at*St-ct*mt,Yt=ot*St-ct*pt,Dt=Rt*Yt-Pt*Vt+Et*Kt+At*zt-Ct*$t+Ht*jt;return Dt?(Dt=1/Dt,S[0]=(nt*Yt-it*Vt+lt*Kt)*Dt,S[1]=(K*Vt-j*Yt-Y*Kt)*Dt,S[2]=(mt*Ht-pt*Ct+St*At)*Dt,S[3]=(ot*Ct-at*Ht-ct*At)*Dt,S[4]=(it*zt-k*Yt-lt*$t)*Dt,S[5]=(w*Yt-K*zt+Y*$t)*Dt,S[6]=(pt*Et-vt*Ht-St*Pt)*Dt,S[7]=(ut*Ht-ot*Et+ct*Pt)*Dt,S[8]=(k*Vt-nt*zt+lt*jt)*Dt,S[9]=(j*zt-w*Vt-Y*jt)*Dt,S[10]=(vt*Ct-mt*Et+St*Rt)*Dt,S[11]=(at*Et-ut*Ct-ct*Rt)*Dt,S[12]=(nt*$t-k*Kt-it*jt)*Dt,S[13]=(w*Kt-j*$t+K*jt)*Dt,S[14]=(mt*Pt-vt*At-pt*Rt)*Dt,S[15]=(ut*At-at*Pt+ot*Rt)*Dt,S):null;}function v(S,E){var w=E[0],j=E[1],K=E[2],Y=E[3],k=E[4],nt=E[5],it=E[6],lt=E[7],ut=E[8],at=E[9],ot=E[10],ct=E[11],vt=E[12],mt=E[13],pt=E[14],St=E[15];return S[0]=nt*(ot*St-ct*pt)-at*(it*St-lt*pt)+mt*(it*ct-lt*ot),S[1]=-(j*(ot*St-ct*pt)-at*(K*St-Y*pt)+mt*(K*ct-Y*ot)),S[2]=j*(it*St-lt*pt)-nt*(K*St-Y*pt)+mt*(K*lt-Y*it),S[3]=-(j*(it*ct-lt*ot)-nt*(K*ct-Y*ot)+at*(K*lt-Y*it)),S[4]=-(k*(ot*St-ct*pt)-ut*(it*St-lt*pt)+vt*(it*ct-lt*ot)),S[5]=w*(ot*St-ct*pt)-ut*(K*St-Y*pt)+vt*(K*ct-Y*ot),S[6]=-(w*(it*St-lt*pt)-k*(K*St-Y*pt)+vt*(K*lt-Y*it)),S[7]=w*(it*ct-lt*ot)-k*(K*ct-Y*ot)+ut*(K*lt-Y*it),S[8]=k*(at*St-ct*mt)-ut*(nt*St-lt*mt)+vt*(nt*ct-lt*at),S[9]=-(w*(at*St-ct*mt)-ut*(j*St-Y*mt)+vt*(j*ct-Y*at)),S[10]=w*(nt*St-lt*mt)-k*(j*St-Y*mt)+vt*(j*lt-Y*nt),S[11]=-(w*(nt*ct-lt*at)-k*(j*ct-Y*at)+ut*(j*lt-Y*nt)),S[12]=-(k*(at*pt-ot*mt)-ut*(nt*pt-it*mt)+vt*(nt*ot-it*at)),S[13]=w*(at*pt-ot*mt)-ut*(j*pt-K*mt)+vt*(j*ot-K*at),S[14]=-(w*(nt*pt-it*mt)-k*(j*pt-K*mt)+vt*(j*it-K*nt)),S[15]=w*(nt*ot-it*at)-k*(j*ot-K*at)+ut*(j*it-K*nt),S;}function y(S){var E=S[0],w=S[1],j=S[2],K=S[3],Y=S[4],k=S[5],nt=S[6],it=S[7],lt=S[8],ut=S[9],at=S[10],ot=S[11],ct=S[12],vt=S[13],mt=S[14],pt=S[15],St=E*k-w*Y,Rt=E*nt-j*Y,Pt=E*it-K*Y,Et=w*nt-j*k,At=w*it-K*k,Ct=j*it-K*nt,Ht=lt*vt-ut*ct,jt=lt*mt-at*ct,$t=lt*pt-ot*ct,zt=ut*mt-at*vt,Kt=ut*pt-ot*vt,Vt=at*pt-ot*mt;return St*Vt-Rt*Kt+Pt*zt+Et*$t-At*jt+Ct*Ht;}function M(S,E,w){var j=E[0],K=E[1],Y=E[2],k=E[3],nt=E[4],it=E[5],lt=E[6],ut=E[7],at=E[8],ot=E[9],ct=E[10],vt=E[11],mt=E[12],pt=E[13],St=E[14],Rt=E[15],Pt=w[0],Et=w[1],At=w[2],Ct=w[3];return S[0]=Pt*j+Et*nt+At*at+Ct*mt,S[1]=Pt*K+Et*it+At*ot+Ct*pt,S[2]=Pt*Y+Et*lt+At*ct+Ct*St,S[3]=Pt*k+Et*ut+At*vt+Ct*Rt,Pt=w[4],Et=w[5],At=w[6],Ct=w[7],S[4]=Pt*j+Et*nt+At*at+Ct*mt,S[5]=Pt*K+Et*it+At*ot+Ct*pt,S[6]=Pt*Y+Et*lt+At*ct+Ct*St,S[7]=Pt*k+Et*ut+At*vt+Ct*Rt,Pt=w[8],Et=w[9],At=w[10],Ct=w[11],S[8]=Pt*j+Et*nt+At*at+Ct*mt,S[9]=Pt*K+Et*it+At*ot+Ct*pt,S[10]=Pt*Y+Et*lt+At*ct+Ct*St,S[11]=Pt*k+Et*ut+At*vt+Ct*Rt,Pt=w[12],Et=w[13],At=w[14],Ct=w[15],S[12]=Pt*j+Et*nt+At*at+Ct*mt,S[13]=Pt*K+Et*it+At*ot+Ct*pt,S[14]=Pt*Y+Et*lt+At*ct+Ct*St,S[15]=Pt*k+Et*ut+At*vt+Ct*Rt,S;}function T(S,E,w){var j=w[0],K=w[1],Y=w[2],k,nt,it,lt,ut,at,ot,ct,vt,mt,pt,St;return E===S?(S[12]=E[0]*j+E[4]*K+E[8]*Y+E[12],S[13]=E[1]*j+E[5]*K+E[9]*Y+E[13],S[14]=E[2]*j+E[6]*K+E[10]*Y+E[14],S[15]=E[3]*j+E[7]*K+E[11]*Y+E[15]):(k=E[0],nt=E[1],it=E[2],lt=E[3],ut=E[4],at=E[5],ot=E[6],ct=E[7],vt=E[8],mt=E[9],pt=E[10],St=E[11],S[0]=k,S[1]=nt,S[2]=it,S[3]=lt,S[4]=ut,S[5]=at,S[6]=ot,S[7]=ct,S[8]=vt,S[9]=mt,S[10]=pt,S[11]=St,S[12]=k*j+ut*K+vt*Y+E[12],S[13]=nt*j+at*K+mt*Y+E[13],S[14]=it*j+ot*K+pt*Y+E[14],S[15]=lt*j+ct*K+St*Y+E[15]),S;}function m(S,E,w){var j=w[0],K=w[1],Y=w[2];return S[0]=E[0]*j,S[1]=E[1]*j,S[2]=E[2]*j,S[3]=E[3]*j,S[4]=E[4]*K,S[5]=E[5]*K,S[6]=E[6]*K,S[7]=E[7]*K,S[8]=E[8]*Y,S[9]=E[9]*Y,S[10]=E[10]*Y,S[11]=E[11]*Y,S[12]=E[12],S[13]=E[13],S[14]=E[14],S[15]=E[15],S;}function x(S,E,w,j){var K=j[0],Y=j[1],k=j[2],nt=Math.hypot(K,Y,k),it,lt,ut,at,ot,ct,vt,mt,pt,St,Rt,Pt,Et,At,Ct,Ht,jt,$t,zt,Kt,Vt,Yt,Dt,Qt;return nt<e.EPSILON?null:(nt=1/nt,K*=nt,Y*=nt,k*=nt,it=Math.sin(w),lt=Math.cos(w),ut=1-lt,at=E[0],ot=E[1],ct=E[2],vt=E[3],mt=E[4],pt=E[5],St=E[6],Rt=E[7],Pt=E[8],Et=E[9],At=E[10],Ct=E[11],Ht=K*K*ut+lt,jt=Y*K*ut+k*it,$t=k*K*ut-Y*it,zt=K*Y*ut-k*it,Kt=Y*Y*ut+lt,Vt=k*Y*ut+K*it,Yt=K*k*ut+Y*it,Dt=Y*k*ut-K*it,Qt=k*k*ut+lt,S[0]=at*Ht+mt*jt+Pt*$t,S[1]=ot*Ht+pt*jt+Et*$t,S[2]=ct*Ht+St*jt+At*$t,S[3]=vt*Ht+Rt*jt+Ct*$t,S[4]=at*zt+mt*Kt+Pt*Vt,S[5]=ot*zt+pt*Kt+Et*Vt,S[6]=ct*zt+St*Kt+At*Vt,S[7]=vt*zt+Rt*Kt+Ct*Vt,S[8]=at*Yt+mt*Dt+Pt*Qt,S[9]=ot*Yt+pt*Dt+Et*Qt,S[10]=ct*Yt+St*Dt+At*Qt,S[11]=vt*Yt+Rt*Dt+Ct*Qt,E!==S&&(S[12]=E[12],S[13]=E[13],S[14]=E[14],S[15]=E[15]),S);}function l(S,E,w){var j=Math.sin(w),K=Math.cos(w),Y=E[4],k=E[5],nt=E[6],it=E[7],lt=E[8],ut=E[9],at=E[10],ot=E[11];return E!==S&&(S[0]=E[0],S[1]=E[1],S[2]=E[2],S[3]=E[3],S[12]=E[12],S[13]=E[13],S[14]=E[14],S[15]=E[15]),S[4]=Y*K+lt*j,S[5]=k*K+ut*j,S[6]=nt*K+at*j,S[7]=it*K+ot*j,S[8]=lt*K-Y*j,S[9]=ut*K-k*j,S[10]=at*K-nt*j,S[11]=ot*K-it*j,S;}function d(S,E,w){var j=Math.sin(w),K=Math.cos(w),Y=E[0],k=E[1],nt=E[2],it=E[3],lt=E[8],ut=E[9],at=E[10],ot=E[11];return E!==S&&(S[4]=E[4],S[5]=E[5],S[6]=E[6],S[7]=E[7],S[12]=E[12],S[13]=E[13],S[14]=E[14],S[15]=E[15]),S[0]=Y*K-lt*j,S[1]=k*K-ut*j,S[2]=nt*K-at*j,S[3]=it*K-ot*j,S[8]=Y*j+lt*K,S[9]=k*j+ut*K,S[10]=nt*j+at*K,S[11]=it*j+ot*K,S;}function f(S,E,w){var j=Math.sin(w),K=Math.cos(w),Y=E[0],k=E[1],nt=E[2],it=E[3],lt=E[4],ut=E[5],at=E[6],ot=E[7];return E!==S&&(S[8]=E[8],S[9]=E[9],S[10]=E[10],S[11]=E[11],S[12]=E[12],S[13]=E[13],S[14]=E[14],S[15]=E[15]),S[0]=Y*K+lt*j,S[1]=k*K+ut*j,S[2]=nt*K+at*j,S[3]=it*K+ot*j,S[4]=lt*K-Y*j,S[5]=ut*K-k*j,S[6]=at*K-nt*j,S[7]=ot*K-it*j,S;}function g(S,E){return S[0]=1,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=1,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[10]=1,S[11]=0,S[12]=E[0],S[13]=E[1],S[14]=E[2],S[15]=1,S;}function O(S,E){return S[0]=E[0],S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=E[1],S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[10]=E[2],S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S;}function A(S,E,w){var j=w[0],K=w[1],Y=w[2],k=Math.hypot(j,K,Y),nt,it,lt;return k<e.EPSILON?null:(k=1/k,j*=k,K*=k,Y*=k,nt=Math.sin(E),it=Math.cos(E),lt=1-it,S[0]=j*j*lt+it,S[1]=K*j*lt+Y*nt,S[2]=Y*j*lt-K*nt,S[3]=0,S[4]=j*K*lt-Y*nt,S[5]=K*K*lt+it,S[6]=Y*K*lt+j*nt,S[7]=0,S[8]=j*Y*lt+K*nt,S[9]=K*Y*lt-j*nt,S[10]=Y*Y*lt+it,S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S);}function R(S,E){var w=Math.sin(E),j=Math.cos(E);return S[0]=1,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=j,S[6]=w,S[7]=0,S[8]=0,S[9]=-w,S[10]=j,S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S;}function b(S,E){var w=Math.sin(E),j=Math.cos(E);return S[0]=j,S[1]=0,S[2]=-w,S[3]=0,S[4]=0,S[5]=1,S[6]=0,S[7]=0,S[8]=w,S[9]=0,S[10]=j,S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S;}function P(S,E){var w=Math.sin(E),j=Math.cos(E);return S[0]=j,S[1]=w,S[2]=0,S[3]=0,S[4]=-w,S[5]=j,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[10]=1,S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S;}function L(S,E,w){var j=E[0],K=E[1],Y=E[2],k=E[3],nt=j+j,it=K+K,lt=Y+Y,ut=j*nt,at=j*it,ot=j*lt,ct=K*it,vt=K*lt,mt=Y*lt,pt=k*nt,St=k*it,Rt=k*lt;return S[0]=1-(ct+mt),S[1]=at+Rt,S[2]=ot-St,S[3]=0,S[4]=at-Rt,S[5]=1-(ut+mt),S[6]=vt+pt,S[7]=0,S[8]=ot+St,S[9]=vt-pt,S[10]=1-(ut+ct),S[11]=0,S[12]=w[0],S[13]=w[1],S[14]=w[2],S[15]=1,S;}function D(S,E){var w=new e.ARRAY_TYPE(3),j=-E[0],K=-E[1],Y=-E[2],k=E[3],nt=E[4],it=E[5],lt=E[6],ut=E[7],at=j*j+K*K+Y*Y+k*k;return at>0?(w[0]=(nt*k+ut*j+it*Y-lt*K)*2/at,w[1]=(it*k+ut*K+lt*j-nt*Y)*2/at,w[2]=(lt*k+ut*Y+nt*K-it*j)*2/at):(w[0]=(nt*k+ut*j+it*Y-lt*K)*2,w[1]=(it*k+ut*K+lt*j-nt*Y)*2,w[2]=(lt*k+ut*Y+nt*K-it*j)*2),L(S,E,w),S;}function I(S,E){return S[0]=E[12],S[1]=E[13],S[2]=E[14],S;}function C(S,E){var w=E[0],j=E[1],K=E[2],Y=E[4],k=E[5],nt=E[6],it=E[8],lt=E[9],ut=E[10];return S[0]=Math.hypot(w,j,K),S[1]=Math.hypot(Y,k,nt),S[2]=Math.hypot(it,lt,ut),S;}function B(S,E){var w=new e.ARRAY_TYPE(3);C(w,E);var j=1/w[0],K=1/w[1],Y=1/w[2],k=E[0]*j,nt=E[1]*K,it=E[2]*Y,lt=E[4]*j,ut=E[5]*K,at=E[6]*Y,ot=E[8]*j,ct=E[9]*K,vt=E[10]*Y,mt=k+ut+vt,pt=0;return mt>0?(pt=Math.sqrt(mt+1)*2,S[3]=0.25*pt,S[0]=(at-ct)/pt,S[1]=(ot-it)/pt,S[2]=(nt-lt)/pt):k>ut&&k>vt?(pt=Math.sqrt(1+k-ut-vt)*2,S[3]=(at-ct)/pt,S[0]=0.25*pt,S[1]=(nt+lt)/pt,S[2]=(ot+it)/pt):ut>vt?(pt=Math.sqrt(1+ut-k-vt)*2,S[3]=(ot-it)/pt,S[0]=(nt+lt)/pt,S[1]=0.25*pt,S[2]=(at+ct)/pt):(pt=Math.sqrt(1+vt-k-ut)*2,S[3]=(nt-lt)/pt,S[0]=(ot+it)/pt,S[1]=(at+ct)/pt,S[2]=0.25*pt),S;}function G(S,E,w,j){var K=E[0],Y=E[1],k=E[2],nt=E[3],it=K+K,lt=Y+Y,ut=k+k,at=K*it,ot=K*lt,ct=K*ut,vt=Y*lt,mt=Y*ut,pt=k*ut,St=nt*it,Rt=nt*lt,Pt=nt*ut,Et=j[0],At=j[1],Ct=j[2];return S[0]=(1-(vt+pt))*Et,S[1]=(ot+Pt)*Et,S[2]=(ct-Rt)*Et,S[3]=0,S[4]=(ot-Pt)*At,S[5]=(1-(at+pt))*At,S[6]=(mt+St)*At,S[7]=0,S[8]=(ct+Rt)*Ct,S[9]=(mt-St)*Ct,S[10]=(1-(at+vt))*Ct,S[11]=0,S[12]=w[0],S[13]=w[1],S[14]=w[2],S[15]=1,S;}function H(S,E,w,j,K){var Y=E[0],k=E[1],nt=E[2],it=E[3],lt=Y+Y,ut=k+k,at=nt+nt,ot=Y*lt,ct=Y*ut,vt=Y*at,mt=k*ut,pt=k*at,St=nt*at,Rt=it*lt,Pt=it*ut,Et=it*at,At=j[0],Ct=j[1],Ht=j[2],jt=K[0],$t=K[1],zt=K[2],Kt=(1-(mt+St))*At,Vt=(ct+Et)*At,Yt=(vt-Pt)*At,Dt=(ct-Et)*Ct,Qt=(1-(ot+St))*Ct,Re=(pt+Rt)*Ct,Ie=(vt+Pt)*Ht,wr=(pt-Rt)*Ht,Nr=(1-(ot+mt))*Ht;return S[0]=Kt,S[1]=Vt,S[2]=Yt,S[3]=0,S[4]=Dt,S[5]=Qt,S[6]=Re,S[7]=0,S[8]=Ie,S[9]=wr,S[10]=Nr,S[11]=0,S[12]=w[0]+jt-(Kt*jt+Dt*$t+Ie*zt),S[13]=w[1]+$t-(Vt*jt+Qt*$t+wr*zt),S[14]=w[2]+zt-(Yt*jt+Re*$t+Nr*zt),S[15]=1,S;}function X(S,E){var w=E[0],j=E[1],K=E[2],Y=E[3],k=w+w,nt=j+j,it=K+K,lt=w*k,ut=j*k,at=j*nt,ot=K*k,ct=K*nt,vt=K*it,mt=Y*k,pt=Y*nt,St=Y*it;return S[0]=1-at-vt,S[1]=ut+St,S[2]=ot-pt,S[3]=0,S[4]=ut-St,S[5]=1-lt-vt,S[6]=ct+mt,S[7]=0,S[8]=ot+pt,S[9]=ct-mt,S[10]=1-lt-at,S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S;}function Z(S,E,w,j,K,Y,k){var nt=1/(w-E),it=1/(K-j),lt=1/(Y-k);return S[0]=Y*2*nt,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=Y*2*it,S[6]=0,S[7]=0,S[8]=(w+E)*nt,S[9]=(K+j)*it,S[10]=(k+Y)*lt,S[11]=-1,S[12]=0,S[13]=0,S[14]=k*Y*2*lt,S[15]=0,S;}function W(S,E,w,j,K){var Y=1/Math.tan(E/2),k;return S[0]=Y/w,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=Y,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[11]=-1,S[12]=0,S[13]=0,S[15]=0,K!=null&&K!==1/0?(k=1/(j-K),S[10]=(K+j)*k,S[14]=2*K*j*k):(S[10]=-1,S[14]=-2*j),S;}function z(S,E,w,j){var K=Math.tan(E.upDegrees*Math.PI/180),Y=Math.tan(E.downDegrees*Math.PI/180),k=Math.tan(E.leftDegrees*Math.PI/180),nt=Math.tan(E.rightDegrees*Math.PI/180),it=2/(k+nt),lt=2/(K+Y);return S[0]=it,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=lt,S[6]=0,S[7]=0,S[8]=-((k-nt)*it*0.5),S[9]=(K-Y)*lt*0.5,S[10]=j/(w-j),S[11]=-1,S[12]=0,S[13]=0,S[14]=j*w/(w-j),S[15]=0,S;}function Q(S,E,w,j,K,Y,k){var nt=1/(E-w),it=1/(j-K),lt=1/(Y-k);return S[0]=-2*nt,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=-2*it,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[10]=2*lt,S[11]=0,S[12]=(E+w)*nt,S[13]=(K+j)*it,S[14]=(k+Y)*lt,S[15]=1,S;}function et(S,E,w,j){var K,Y,k,nt,it,lt,ut,at,ot,ct,vt=E[0],mt=E[1],pt=E[2],St=j[0],Rt=j[1],Pt=j[2],Et=w[0],At=w[1],Ct=w[2];return Math.abs(vt-Et)<e.EPSILON&&Math.abs(mt-At)<e.EPSILON&&Math.abs(pt-Ct)<e.EPSILON?c(S):(ut=vt-Et,at=mt-At,ot=pt-Ct,ct=1/Math.hypot(ut,at,ot),ut*=ct,at*=ct,ot*=ct,K=Rt*ot-Pt*at,Y=Pt*ut-St*ot,k=St*at-Rt*ut,ct=Math.hypot(K,Y,k),ct?(ct=1/ct,K*=ct,Y*=ct,k*=ct):(K=0,Y=0,k=0),nt=at*k-ot*Y,it=ot*K-ut*k,lt=ut*Y-at*K,ct=Math.hypot(nt,it,lt),ct?(ct=1/ct,nt*=ct,it*=ct,lt*=ct):(nt=0,it=0,lt=0),S[0]=K,S[1]=nt,S[2]=ut,S[3]=0,S[4]=Y,S[5]=it,S[6]=at,S[7]=0,S[8]=k,S[9]=lt,S[10]=ot,S[11]=0,S[12]=-(K*vt+Y*mt+k*pt),S[13]=-(nt*vt+it*mt+lt*pt),S[14]=-(ut*vt+at*mt+ot*pt),S[15]=1,S);}function _(S,E,w,j){var K=E[0],Y=E[1],k=E[2],nt=j[0],it=j[1],lt=j[2],ut=K-w[0],at=Y-w[1],ot=k-w[2],ct=ut*ut+at*at+ot*ot;ct>0&&(ct=1/Math.sqrt(ct),ut*=ct,at*=ct,ot*=ct);var vt=it*ot-lt*at,mt=lt*ut-nt*ot,pt=nt*at-it*ut;return ct=vt*vt+mt*mt+pt*pt,ct>0&&(ct=1/Math.sqrt(ct),vt*=ct,mt*=ct,pt*=ct),S[0]=vt,S[1]=mt,S[2]=pt,S[3]=0,S[4]=at*pt-ot*mt,S[5]=ot*vt-ut*pt,S[6]=ut*mt-at*vt,S[7]=0,S[8]=ut,S[9]=at,S[10]=ot,S[11]=0,S[12]=K,S[13]=Y,S[14]=k,S[15]=1,S;}function st(S){return"mat4("+S[0]+", "+S[1]+", "+S[2]+", "+S[3]+", "+S[4]+", "+S[5]+", "+S[6]+", "+S[7]+", "+S[8]+", "+S[9]+", "+S[10]+", "+S[11]+", "+S[12]+", "+S[13]+", "+S[14]+", "+S[15]+")";}function q(S){return Math.hypot(S[0],S[1],S[2],S[3],S[4],S[5],S[6],S[7],S[8],S[9],S[10],S[11],S[12],S[13],S[14],S[15]);}function ht(S,E,w){return S[0]=E[0]+w[0],S[1]=E[1]+w[1],S[2]=E[2]+w[2],S[3]=E[3]+w[3],S[4]=E[4]+w[4],S[5]=E[5]+w[5],S[6]=E[6]+w[6],S[7]=E[7]+w[7],S[8]=E[8]+w[8],S[9]=E[9]+w[9],S[10]=E[10]+w[10],S[11]=E[11]+w[11],S[12]=E[12]+w[12],S[13]=E[13]+w[13],S[14]=E[14]+w[14],S[15]=E[15]+w[15],S;}function dt(S,E,w){return S[0]=E[0]-w[0],S[1]=E[1]-w[1],S[2]=E[2]-w[2],S[3]=E[3]-w[3],S[4]=E[4]-w[4],S[5]=E[5]-w[5],S[6]=E[6]-w[6],S[7]=E[7]-w[7],S[8]=E[8]-w[8],S[9]=E[9]-w[9],S[10]=E[10]-w[10],S[11]=E[11]-w[11],S[12]=E[12]-w[12],S[13]=E[13]-w[13],S[14]=E[14]-w[14],S[15]=E[15]-w[15],S;}function F(S,E,w){return S[0]=E[0]*w,S[1]=E[1]*w,S[2]=E[2]*w,S[3]=E[3]*w,S[4]=E[4]*w,S[5]=E[5]*w,S[6]=E[6]*w,S[7]=E[7]*w,S[8]=E[8]*w,S[9]=E[9]*w,S[10]=E[10]*w,S[11]=E[11]*w,S[12]=E[12]*w,S[13]=E[13]*w,S[14]=E[14]*w,S[15]=E[15]*w,S;}function U(S,E,w,j){return S[0]=E[0]+w[0]*j,S[1]=E[1]+w[1]*j,S[2]=E[2]+w[2]*j,S[3]=E[3]+w[3]*j,S[4]=E[4]+w[4]*j,S[5]=E[5]+w[5]*j,S[6]=E[6]+w[6]*j,S[7]=E[7]+w[7]*j,S[8]=E[8]+w[8]*j,S[9]=E[9]+w[9]*j,S[10]=E[10]+w[10]*j,S[11]=E[11]+w[11]*j,S[12]=E[12]+w[12]*j,S[13]=E[13]+w[13]*j,S[14]=E[14]+w[14]*j,S[15]=E[15]+w[15]*j,S;}function V(S,E){return S[0]===E[0]&&S[1]===E[1]&&S[2]===E[2]&&S[3]===E[3]&&S[4]===E[4]&&S[5]===E[5]&&S[6]===E[6]&&S[7]===E[7]&&S[8]===E[8]&&S[9]===E[9]&&S[10]===E[10]&&S[11]===E[11]&&S[12]===E[12]&&S[13]===E[13]&&S[14]===E[14]&&S[15]===E[15];}function J(S,E){var w=S[0],j=S[1],K=S[2],Y=S[3],k=S[4],nt=S[5],it=S[6],lt=S[7],ut=S[8],at=S[9],ot=S[10],ct=S[11],vt=S[12],mt=S[13],pt=S[14],St=S[15],Rt=E[0],Pt=E[1],Et=E[2],At=E[3],Ct=E[4],Ht=E[5],jt=E[6],$t=E[7],zt=E[8],Kt=E[9],Vt=E[10],Yt=E[11],Dt=E[12],Qt=E[13],Re=E[14],Ie=E[15];return Math.abs(w-Rt)<=e.EPSILON*Math.max(1,Math.abs(w),Math.abs(Rt))&&Math.abs(j-Pt)<=e.EPSILON*Math.max(1,Math.abs(j),Math.abs(Pt))&&Math.abs(K-Et)<=e.EPSILON*Math.max(1,Math.abs(K),Math.abs(Et))&&Math.abs(Y-At)<=e.EPSILON*Math.max(1,Math.abs(Y),Math.abs(At))&&Math.abs(k-Ct)<=e.EPSILON*Math.max(1,Math.abs(k),Math.abs(Ct))&&Math.abs(nt-Ht)<=e.EPSILON*Math.max(1,Math.abs(nt),Math.abs(Ht))&&Math.abs(it-jt)<=e.EPSILON*Math.max(1,Math.abs(it),Math.abs(jt))&&Math.abs(lt-$t)<=e.EPSILON*Math.max(1,Math.abs(lt),Math.abs($t))&&Math.abs(ut-zt)<=e.EPSILON*Math.max(1,Math.abs(ut),Math.abs(zt))&&Math.abs(at-Kt)<=e.EPSILON*Math.max(1,Math.abs(at),Math.abs(Kt))&&Math.abs(ot-Vt)<=e.EPSILON*Math.max(1,Math.abs(ot),Math.abs(Vt))&&Math.abs(ct-Yt)<=e.EPSILON*Math.max(1,Math.abs(ct),Math.abs(Yt))&&Math.abs(vt-Dt)<=e.EPSILON*Math.max(1,Math.abs(vt),Math.abs(Dt))&&Math.abs(mt-Qt)<=e.EPSILON*Math.max(1,Math.abs(mt),Math.abs(Qt))&&Math.abs(pt-Re)<=e.EPSILON*Math.max(1,Math.abs(pt),Math.abs(Re))&&Math.abs(St-Ie)<=e.EPSILON*Math.max(1,Math.abs(St),Math.abs(Ie));}var N=M,$=dt;},/* 7 */ /***/function(u,r,t){t.r(r),t.d(r,"create",function(){return o;}),t.d(r,"identity",function(){return s;}),t.d(r,"setAxisAngle",function(){return c;}),t.d(r,"getAxisAngle",function(){return p;}),t.d(r,"getAngle",function(){return h;}),t.d(r,"multiply",function(){return v;}),t.d(r,"rotateX",function(){return y;}),t.d(r,"rotateY",function(){return M;}),t.d(r,"rotateZ",function(){return T;}),t.d(r,"calculateW",function(){return m;}),t.d(r,"exp",function(){return x;}),t.d(r,"ln",function(){return l;}),t.d(r,"pow",function(){return d;}),t.d(r,"slerp",function(){return f;}),t.d(r,"random",function(){return g;}),t.d(r,"invert",function(){return O;}),t.d(r,"conjugate",function(){return A;}),t.d(r,"fromMat3",function(){return R;}),t.d(r,"fromEuler",function(){return b;}),t.d(r,"str",function(){return P;}),t.d(r,"clone",function(){return L;}),t.d(r,"fromValues",function(){return D;}),t.d(r,"copy",function(){return I;}),t.d(r,"set",function(){return C;}),t.d(r,"add",function(){return B;}),t.d(r,"mul",function(){return G;}),t.d(r,"scale",function(){return H;}),t.d(r,"dot",function(){return X;}),t.d(r,"lerp",function(){return Z;}),t.d(r,"length",function(){return W;}),t.d(r,"len",function(){return z;}),t.d(r,"squaredLength",function(){return Q;}),t.d(r,"sqrLen",function(){return et;}),t.d(r,"normalize",function(){return _;}),t.d(r,"exactEquals",function(){return st;}),t.d(r,"equals",function(){return q;}),t.d(r,"rotationTo",function(){return ht;}),t.d(r,"sqlerp",function(){return dt;}),t.d(r,"setAxes",function(){return F;});var e=t(2),n=t(5),i=t(8),a=t(9);function o(){var U=new e.ARRAY_TYPE(4);return e.ARRAY_TYPE!=Float32Array&&(U[0]=0,U[1]=0,U[2]=0),U[3]=1,U;}function s(U){return U[0]=0,U[1]=0,U[2]=0,U[3]=1,U;}function c(U,V,J){J=J*0.5;var N=Math.sin(J);return U[0]=N*V[0],U[1]=N*V[1],U[2]=N*V[2],U[3]=Math.cos(J),U;}function p(U,V){var J=Math.acos(V[3])*2,N=Math.sin(J/2);return N>e.EPSILON?(U[0]=V[0]/N,U[1]=V[1]/N,U[2]=V[2]/N):(U[0]=1,U[1]=0,U[2]=0),J;}function h(U,V){var J=X(U,V);return Math.acos(2*J*J-1);}function v(U,V,J){var N=V[0],$=V[1],S=V[2],E=V[3],w=J[0],j=J[1],K=J[2],Y=J[3];return U[0]=N*Y+E*w+$*K-S*j,U[1]=$*Y+E*j+S*w-N*K,U[2]=S*Y+E*K+N*j-$*w,U[3]=E*Y-N*w-$*j-S*K,U;}function y(U,V,J){J*=0.5;var N=V[0],$=V[1],S=V[2],E=V[3],w=Math.sin(J),j=Math.cos(J);return U[0]=N*j+E*w,U[1]=$*j+S*w,U[2]=S*j-$*w,U[3]=E*j-N*w,U;}function M(U,V,J){J*=0.5;var N=V[0],$=V[1],S=V[2],E=V[3],w=Math.sin(J),j=Math.cos(J);return U[0]=N*j-S*w,U[1]=$*j+E*w,U[2]=S*j+N*w,U[3]=E*j-$*w,U;}function T(U,V,J){J*=0.5;var N=V[0],$=V[1],S=V[2],E=V[3],w=Math.sin(J),j=Math.cos(J);return U[0]=N*j+$*w,U[1]=$*j-N*w,U[2]=S*j+E*w,U[3]=E*j-S*w,U;}function m(U,V){var J=V[0],N=V[1],$=V[2];return U[0]=J,U[1]=N,U[2]=$,U[3]=Math.sqrt(Math.abs(1-J*J-N*N-$*$)),U;}function x(U,V){var J=V[0],N=V[1],$=V[2],S=V[3],E=Math.sqrt(J*J+N*N+$*$),w=Math.exp(S),j=E>0?w*Math.sin(E)/E:0;return U[0]=J*j,U[1]=N*j,U[2]=$*j,U[3]=w*Math.cos(E),U;}function l(U,V){var J=V[0],N=V[1],$=V[2],S=V[3],E=Math.sqrt(J*J+N*N+$*$),w=E>0?Math.atan2(E,S)/E:0;return U[0]=J*w,U[1]=N*w,U[2]=$*w,U[3]=0.5*Math.log(J*J+N*N+$*$+S*S),U;}function d(U,V,J){return l(U,V),H(U,U,J),x(U,U),U;}function f(U,V,J,N){var $=V[0],S=V[1],E=V[2],w=V[3],j=J[0],K=J[1],Y=J[2],k=J[3],nt,it,lt,ut,at;return it=$*j+S*K+E*Y+w*k,it<0&&(it=-it,j=-j,K=-K,Y=-Y,k=-k),1-it>e.EPSILON?(nt=Math.acos(it),lt=Math.sin(nt),ut=Math.sin((1-N)*nt)/lt,at=Math.sin(N*nt)/lt):(ut=1-N,at=N),U[0]=ut*$+at*j,U[1]=ut*S+at*K,U[2]=ut*E+at*Y,U[3]=ut*w+at*k,U;}function g(U){var V=e.RANDOM(),J=e.RANDOM(),N=e.RANDOM(),$=Math.sqrt(1-V),S=Math.sqrt(V);return U[0]=$*Math.sin(2*Math.PI*J),U[1]=$*Math.cos(2*Math.PI*J),U[2]=S*Math.sin(2*Math.PI*N),U[3]=S*Math.cos(2*Math.PI*N),U;}function O(U,V){var J=V[0],N=V[1],$=V[2],S=V[3],E=J*J+N*N+$*$+S*S,w=E?1/E:0;return U[0]=-J*w,U[1]=-N*w,U[2]=-$*w,U[3]=S*w,U;}function A(U,V){return U[0]=-V[0],U[1]=-V[1],U[2]=-V[2],U[3]=V[3],U;}function R(U,V){var J=V[0]+V[4]+V[8],N;if(J>0)N=Math.sqrt(J+1),U[3]=0.5*N,N=0.5/N,U[0]=(V[5]-V[7])*N,U[1]=(V[6]-V[2])*N,U[2]=(V[1]-V[3])*N;else{var $=0;V[4]>V[0]&&($=1),V[8]>V[$*3+$]&&($=2);var S=($+1)%3,E=($+2)%3;N=Math.sqrt(V[$*3+$]-V[S*3+S]-V[E*3+E]+1),U[$]=0.5*N,N=0.5/N,U[3]=(V[S*3+E]-V[E*3+S])*N,U[S]=(V[S*3+$]+V[$*3+S])*N,U[E]=(V[E*3+$]+V[$*3+E])*N;}return U;}function b(U,V,J,N){var $=0.5*Math.PI/180;V*=$,J*=$,N*=$;var S=Math.sin(V),E=Math.cos(V),w=Math.sin(J),j=Math.cos(J),K=Math.sin(N),Y=Math.cos(N);return U[0]=S*j*Y-E*w*K,U[1]=E*w*Y+S*j*K,U[2]=E*j*K-S*w*Y,U[3]=E*j*Y+S*w*K,U;}function P(U){return"quat("+U[0]+", "+U[1]+", "+U[2]+", "+U[3]+")";}var L=a.clone,D=a.fromValues,I=a.copy,C=a.set,B=a.add,G=v,H=a.scale,X=a.dot,Z=a.lerp,W=a.length,z=W,Q=a.squaredLength,et=Q,_=a.normalize,st=a.exactEquals,q=a.equals,ht=function(){var U=i.create(),V=i.fromValues(1,0,0),J=i.fromValues(0,1,0);return function(N,$,S){var E=i.dot($,S);return E<-0.999999?(i.cross(U,V,$),i.len(U)<1e-6&&i.cross(U,J,$),i.normalize(U,U),c(N,U,Math.PI),N):E>0.999999?(N[0]=0,N[1]=0,N[2]=0,N[3]=1,N):(i.cross(U,$,S),N[0]=U[0],N[1]=U[1],N[2]=U[2],N[3]=1+E,_(N,N));};}(),dt=function(){var U=o(),V=o();return function(J,N,$,S,E,w){return f(U,N,E,w),f(V,$,S,w),f(J,U,V,2*w*(1-w)),J;};}(),F=function(){var U=n.create();return function(V,J,N,$){return U[0]=N[0],U[3]=N[1],U[6]=N[2],U[1]=$[0],U[4]=$[1],U[7]=$[2],U[2]=-J[0],U[5]=-J[1],U[8]=-J[2],_(V,R(V,U));};}();},/* 8 */ /***/function(u,r,t){t.r(r),t.d(r,"create",function(){return n;}),t.d(r,"clone",function(){return i;}),t.d(r,"length",function(){return a;}),t.d(r,"fromValues",function(){return o;}),t.d(r,"copy",function(){return s;}),t.d(r,"set",function(){return c;}),t.d(r,"add",function(){return p;}),t.d(r,"subtract",function(){return h;}),t.d(r,"multiply",function(){return v;}),t.d(r,"divide",function(){return y;}),t.d(r,"ceil",function(){return M;}),t.d(r,"floor",function(){return T;}),t.d(r,"min",function(){return m;}),t.d(r,"max",function(){return x;}),t.d(r,"round",function(){return l;}),t.d(r,"scale",function(){return d;}),t.d(r,"scaleAndAdd",function(){return f;}),t.d(r,"distance",function(){return g;}),t.d(r,"squaredDistance",function(){return O;}),t.d(r,"squaredLength",function(){return A;}),t.d(r,"negate",function(){return R;}),t.d(r,"inverse",function(){return b;}),t.d(r,"normalize",function(){return P;}),t.d(r,"dot",function(){return L;}),t.d(r,"cross",function(){return D;}),t.d(r,"lerp",function(){return I;}),t.d(r,"hermite",function(){return C;}),t.d(r,"bezier",function(){return B;}),t.d(r,"random",function(){return G;}),t.d(r,"transformMat4",function(){return H;}),t.d(r,"transformMat3",function(){return X;}),t.d(r,"transformQuat",function(){return Z;}),t.d(r,"rotateX",function(){return W;}),t.d(r,"rotateY",function(){return z;}),t.d(r,"rotateZ",function(){return Q;}),t.d(r,"angle",function(){return et;}),t.d(r,"zero",function(){return _;}),t.d(r,"str",function(){return st;}),t.d(r,"exactEquals",function(){return q;}),t.d(r,"equals",function(){return ht;}),t.d(r,"sub",function(){return dt;}),t.d(r,"mul",function(){return F;}),t.d(r,"div",function(){return U;}),t.d(r,"dist",function(){return V;}),t.d(r,"sqrDist",function(){return J;}),t.d(r,"len",function(){return N;}),t.d(r,"sqrLen",function(){return $;}),t.d(r,"forEach",function(){return S;});var e=t(2);function n(){var E=new e.ARRAY_TYPE(3);return e.ARRAY_TYPE!=Float32Array&&(E[0]=0,E[1]=0,E[2]=0),E;}function i(E){var w=new e.ARRAY_TYPE(3);return w[0]=E[0],w[1]=E[1],w[2]=E[2],w;}function a(E){var w=E[0],j=E[1],K=E[2];return Math.hypot(w,j,K);}function o(E,w,j){var K=new e.ARRAY_TYPE(3);return K[0]=E,K[1]=w,K[2]=j,K;}function s(E,w){return E[0]=w[0],E[1]=w[1],E[2]=w[2],E;}function c(E,w,j,K){return E[0]=w,E[1]=j,E[2]=K,E;}function p(E,w,j){return E[0]=w[0]+j[0],E[1]=w[1]+j[1],E[2]=w[2]+j[2],E;}function h(E,w,j){return E[0]=w[0]-j[0],E[1]=w[1]-j[1],E[2]=w[2]-j[2],E;}function v(E,w,j){return E[0]=w[0]*j[0],E[1]=w[1]*j[1],E[2]=w[2]*j[2],E;}function y(E,w,j){return E[0]=w[0]/j[0],E[1]=w[1]/j[1],E[2]=w[2]/j[2],E;}function M(E,w){return E[0]=Math.ceil(w[0]),E[1]=Math.ceil(w[1]),E[2]=Math.ceil(w[2]),E;}function T(E,w){return E[0]=Math.floor(w[0]),E[1]=Math.floor(w[1]),E[2]=Math.floor(w[2]),E;}function m(E,w,j){return E[0]=Math.min(w[0],j[0]),E[1]=Math.min(w[1],j[1]),E[2]=Math.min(w[2],j[2]),E;}function x(E,w,j){return E[0]=Math.max(w[0],j[0]),E[1]=Math.max(w[1],j[1]),E[2]=Math.max(w[2],j[2]),E;}function l(E,w){return E[0]=Math.round(w[0]),E[1]=Math.round(w[1]),E[2]=Math.round(w[2]),E;}function d(E,w,j){return E[0]=w[0]*j,E[1]=w[1]*j,E[2]=w[2]*j,E;}function f(E,w,j,K){return E[0]=w[0]+j[0]*K,E[1]=w[1]+j[1]*K,E[2]=w[2]+j[2]*K,E;}function g(E,w){var j=w[0]-E[0],K=w[1]-E[1],Y=w[2]-E[2];return Math.hypot(j,K,Y);}function O(E,w){var j=w[0]-E[0],K=w[1]-E[1],Y=w[2]-E[2];return j*j+K*K+Y*Y;}function A(E){var w=E[0],j=E[1],K=E[2];return w*w+j*j+K*K;}function R(E,w){return E[0]=-w[0],E[1]=-w[1],E[2]=-w[2],E;}function b(E,w){return E[0]=1/w[0],E[1]=1/w[1],E[2]=1/w[2],E;}function P(E,w){var j=w[0],K=w[1],Y=w[2],k=j*j+K*K+Y*Y;return k>0&&(k=1/Math.sqrt(k)),E[0]=w[0]*k,E[1]=w[1]*k,E[2]=w[2]*k,E;}function L(E,w){return E[0]*w[0]+E[1]*w[1]+E[2]*w[2];}function D(E,w,j){var K=w[0],Y=w[1],k=w[2],nt=j[0],it=j[1],lt=j[2];return E[0]=Y*lt-k*it,E[1]=k*nt-K*lt,E[2]=K*it-Y*nt,E;}function I(E,w,j,K){var Y=w[0],k=w[1],nt=w[2];return E[0]=Y+K*(j[0]-Y),E[1]=k+K*(j[1]-k),E[2]=nt+K*(j[2]-nt),E;}function C(E,w,j,K,Y,k){var nt=k*k,it=nt*(2*k-3)+1,lt=nt*(k-2)+k,ut=nt*(k-1),at=nt*(3-2*k);return E[0]=w[0]*it+j[0]*lt+K[0]*ut+Y[0]*at,E[1]=w[1]*it+j[1]*lt+K[1]*ut+Y[1]*at,E[2]=w[2]*it+j[2]*lt+K[2]*ut+Y[2]*at,E;}function B(E,w,j,K,Y,k){var nt=1-k,it=nt*nt,lt=k*k,ut=it*nt,at=3*k*it,ot=3*lt*nt,ct=lt*k;return E[0]=w[0]*ut+j[0]*at+K[0]*ot+Y[0]*ct,E[1]=w[1]*ut+j[1]*at+K[1]*ot+Y[1]*ct,E[2]=w[2]*ut+j[2]*at+K[2]*ot+Y[2]*ct,E;}function G(E,w){w=w||1;var j=e.RANDOM()*2*Math.PI,K=e.RANDOM()*2-1,Y=Math.sqrt(1-K*K)*w;return E[0]=Math.cos(j)*Y,E[1]=Math.sin(j)*Y,E[2]=K*w,E;}function H(E,w,j){var K=w[0],Y=w[1],k=w[2],nt=j[3]*K+j[7]*Y+j[11]*k+j[15];return nt=nt||1,E[0]=(j[0]*K+j[4]*Y+j[8]*k+j[12])/nt,E[1]=(j[1]*K+j[5]*Y+j[9]*k+j[13])/nt,E[2]=(j[2]*K+j[6]*Y+j[10]*k+j[14])/nt,E;}function X(E,w,j){var K=w[0],Y=w[1],k=w[2];return E[0]=K*j[0]+Y*j[3]+k*j[6],E[1]=K*j[1]+Y*j[4]+k*j[7],E[2]=K*j[2]+Y*j[5]+k*j[8],E;}function Z(E,w,j){var K=j[0],Y=j[1],k=j[2],nt=j[3],it=w[0],lt=w[1],ut=w[2],at=Y*ut-k*lt,ot=k*it-K*ut,ct=K*lt-Y*it,vt=Y*ct-k*ot,mt=k*at-K*ct,pt=K*ot-Y*at,St=nt*2;return at*=St,ot*=St,ct*=St,vt*=2,mt*=2,pt*=2,E[0]=it+at+vt,E[1]=lt+ot+mt,E[2]=ut+ct+pt,E;}function W(E,w,j,K){var Y=[],k=[];return Y[0]=w[0]-j[0],Y[1]=w[1]-j[1],Y[2]=w[2]-j[2],k[0]=Y[0],k[1]=Y[1]*Math.cos(K)-Y[2]*Math.sin(K),k[2]=Y[1]*Math.sin(K)+Y[2]*Math.cos(K),E[0]=k[0]+j[0],E[1]=k[1]+j[1],E[2]=k[2]+j[2],E;}function z(E,w,j,K){var Y=[],k=[];return Y[0]=w[0]-j[0],Y[1]=w[1]-j[1],Y[2]=w[2]-j[2],k[0]=Y[2]*Math.sin(K)+Y[0]*Math.cos(K),k[1]=Y[1],k[2]=Y[2]*Math.cos(K)-Y[0]*Math.sin(K),E[0]=k[0]+j[0],E[1]=k[1]+j[1],E[2]=k[2]+j[2],E;}function Q(E,w,j,K){var Y=[],k=[];return Y[0]=w[0]-j[0],Y[1]=w[1]-j[1],Y[2]=w[2]-j[2],k[0]=Y[0]*Math.cos(K)-Y[1]*Math.sin(K),k[1]=Y[0]*Math.sin(K)+Y[1]*Math.cos(K),k[2]=Y[2],E[0]=k[0]+j[0],E[1]=k[1]+j[1],E[2]=k[2]+j[2],E;}function et(E,w){var j=E[0],K=E[1],Y=E[2],k=w[0],nt=w[1],it=w[2],lt=Math.sqrt(j*j+K*K+Y*Y),ut=Math.sqrt(k*k+nt*nt+it*it),at=lt*ut,ot=at&&L(E,w)/at;return Math.acos(Math.min(Math.max(ot,-1),1));}function _(E){return E[0]=0,E[1]=0,E[2]=0,E;}function st(E){return"vec3("+E[0]+", "+E[1]+", "+E[2]+")";}function q(E,w){return E[0]===w[0]&&E[1]===w[1]&&E[2]===w[2];}function ht(E,w){var j=E[0],K=E[1],Y=E[2],k=w[0],nt=w[1],it=w[2];return Math.abs(j-k)<=e.EPSILON*Math.max(1,Math.abs(j),Math.abs(k))&&Math.abs(K-nt)<=e.EPSILON*Math.max(1,Math.abs(K),Math.abs(nt))&&Math.abs(Y-it)<=e.EPSILON*Math.max(1,Math.abs(Y),Math.abs(it));}var dt=h,F=v,U=y,V=g,J=O,N=a,$=A,S=function(){var E=n();return function(w,j,K,Y,k,nt){var it,lt;for(j||(j=3),K||(K=0),Y?lt=Math.min(Y*j+K,w.length):lt=w.length,it=K;it<lt;it+=j)E[0]=w[it],E[1]=w[it+1],E[2]=w[it+2],k(E,E,nt),w[it]=E[0],w[it+1]=E[1],w[it+2]=E[2];return w;};}();},/* 9 */ /***/function(u,r,t){t.r(r),t.d(r,"create",function(){return n;}),t.d(r,"clone",function(){return i;}),t.d(r,"fromValues",function(){return a;}),t.d(r,"copy",function(){return o;}),t.d(r,"set",function(){return s;}),t.d(r,"add",function(){return c;}),t.d(r,"subtract",function(){return p;}),t.d(r,"multiply",function(){return h;}),t.d(r,"divide",function(){return v;}),t.d(r,"ceil",function(){return y;}),t.d(r,"floor",function(){return M;}),t.d(r,"min",function(){return T;}),t.d(r,"max",function(){return m;}),t.d(r,"round",function(){return x;}),t.d(r,"scale",function(){return l;}),t.d(r,"scaleAndAdd",function(){return d;}),t.d(r,"distance",function(){return f;}),t.d(r,"squaredDistance",function(){return g;}),t.d(r,"length",function(){return O;}),t.d(r,"squaredLength",function(){return A;}),t.d(r,"negate",function(){return R;}),t.d(r,"inverse",function(){return b;}),t.d(r,"normalize",function(){return P;}),t.d(r,"dot",function(){return L;}),t.d(r,"cross",function(){return D;}),t.d(r,"lerp",function(){return I;}),t.d(r,"random",function(){return C;}),t.d(r,"transformMat4",function(){return B;}),t.d(r,"transformQuat",function(){return G;}),t.d(r,"zero",function(){return H;}),t.d(r,"str",function(){return X;}),t.d(r,"exactEquals",function(){return Z;}),t.d(r,"equals",function(){return W;}),t.d(r,"sub",function(){return z;}),t.d(r,"mul",function(){return Q;}),t.d(r,"div",function(){return et;}),t.d(r,"dist",function(){return _;}),t.d(r,"sqrDist",function(){return st;}),t.d(r,"len",function(){return q;}),t.d(r,"sqrLen",function(){return ht;}),t.d(r,"forEach",function(){return dt;});var e=t(2);function n(){var F=new e.ARRAY_TYPE(4);return e.ARRAY_TYPE!=Float32Array&&(F[0]=0,F[1]=0,F[2]=0,F[3]=0),F;}function i(F){var U=new e.ARRAY_TYPE(4);return U[0]=F[0],U[1]=F[1],U[2]=F[2],U[3]=F[3],U;}function a(F,U,V,J){var N=new e.ARRAY_TYPE(4);return N[0]=F,N[1]=U,N[2]=V,N[3]=J,N;}function o(F,U){return F[0]=U[0],F[1]=U[1],F[2]=U[2],F[3]=U[3],F;}function s(F,U,V,J,N){return F[0]=U,F[1]=V,F[2]=J,F[3]=N,F;}function c(F,U,V){return F[0]=U[0]+V[0],F[1]=U[1]+V[1],F[2]=U[2]+V[2],F[3]=U[3]+V[3],F;}function p(F,U,V){return F[0]=U[0]-V[0],F[1]=U[1]-V[1],F[2]=U[2]-V[2],F[3]=U[3]-V[3],F;}function h(F,U,V){return F[0]=U[0]*V[0],F[1]=U[1]*V[1],F[2]=U[2]*V[2],F[3]=U[3]*V[3],F;}function v(F,U,V){return F[0]=U[0]/V[0],F[1]=U[1]/V[1],F[2]=U[2]/V[2],F[3]=U[3]/V[3],F;}function y(F,U){return F[0]=Math.ceil(U[0]),F[1]=Math.ceil(U[1]),F[2]=Math.ceil(U[2]),F[3]=Math.ceil(U[3]),F;}function M(F,U){return F[0]=Math.floor(U[0]),F[1]=Math.floor(U[1]),F[2]=Math.floor(U[2]),F[3]=Math.floor(U[3]),F;}function T(F,U,V){return F[0]=Math.min(U[0],V[0]),F[1]=Math.min(U[1],V[1]),F[2]=Math.min(U[2],V[2]),F[3]=Math.min(U[3],V[3]),F;}function m(F,U,V){return F[0]=Math.max(U[0],V[0]),F[1]=Math.max(U[1],V[1]),F[2]=Math.max(U[2],V[2]),F[3]=Math.max(U[3],V[3]),F;}function x(F,U){return F[0]=Math.round(U[0]),F[1]=Math.round(U[1]),F[2]=Math.round(U[2]),F[3]=Math.round(U[3]),F;}function l(F,U,V){return F[0]=U[0]*V,F[1]=U[1]*V,F[2]=U[2]*V,F[3]=U[3]*V,F;}function d(F,U,V,J){return F[0]=U[0]+V[0]*J,F[1]=U[1]+V[1]*J,F[2]=U[2]+V[2]*J,F[3]=U[3]+V[3]*J,F;}function f(F,U){var V=U[0]-F[0],J=U[1]-F[1],N=U[2]-F[2],$=U[3]-F[3];return Math.hypot(V,J,N,$);}function g(F,U){var V=U[0]-F[0],J=U[1]-F[1],N=U[2]-F[2],$=U[3]-F[3];return V*V+J*J+N*N+$*$;}function O(F){var U=F[0],V=F[1],J=F[2],N=F[3];return Math.hypot(U,V,J,N);}function A(F){var U=F[0],V=F[1],J=F[2],N=F[3];return U*U+V*V+J*J+N*N;}function R(F,U){return F[0]=-U[0],F[1]=-U[1],F[2]=-U[2],F[3]=-U[3],F;}function b(F,U){return F[0]=1/U[0],F[1]=1/U[1],F[2]=1/U[2],F[3]=1/U[3],F;}function P(F,U){var V=U[0],J=U[1],N=U[2],$=U[3],S=V*V+J*J+N*N+$*$;return S>0&&(S=1/Math.sqrt(S)),F[0]=V*S,F[1]=J*S,F[2]=N*S,F[3]=$*S,F;}function L(F,U){return F[0]*U[0]+F[1]*U[1]+F[2]*U[2]+F[3]*U[3];}function D(F,U,V,J){var N=V[0]*J[1]-V[1]*J[0],$=V[0]*J[2]-V[2]*J[0],S=V[0]*J[3]-V[3]*J[0],E=V[1]*J[2]-V[2]*J[1],w=V[1]*J[3]-V[3]*J[1],j=V[2]*J[3]-V[3]*J[2],K=U[0],Y=U[1],k=U[2],nt=U[3];return F[0]=Y*j-k*w+nt*E,F[1]=-(K*j)+k*S-nt*$,F[2]=K*w-Y*S+nt*N,F[3]=-(K*E)+Y*$-k*N,F;}function I(F,U,V,J){var N=U[0],$=U[1],S=U[2],E=U[3];return F[0]=N+J*(V[0]-N),F[1]=$+J*(V[1]-$),F[2]=S+J*(V[2]-S),F[3]=E+J*(V[3]-E),F;}function C(F,U){U=U||1;var V,J,N,$,S,E;do V=e.RANDOM()*2-1,J=e.RANDOM()*2-1,S=V*V+J*J;while(S>=1);do N=e.RANDOM()*2-1,$=e.RANDOM()*2-1,E=N*N+$*$;while(E>=1);var w=Math.sqrt((1-S)/E);return F[0]=U*V,F[1]=U*J,F[2]=U*N*w,F[3]=U*$*w,F;}function B(F,U,V){var J=U[0],N=U[1],$=U[2],S=U[3];return F[0]=V[0]*J+V[4]*N+V[8]*$+V[12]*S,F[1]=V[1]*J+V[5]*N+V[9]*$+V[13]*S,F[2]=V[2]*J+V[6]*N+V[10]*$+V[14]*S,F[3]=V[3]*J+V[7]*N+V[11]*$+V[15]*S,F;}function G(F,U,V){var J=U[0],N=U[1],$=U[2],S=V[0],E=V[1],w=V[2],j=V[3],K=j*J+E*$-w*N,Y=j*N+w*J-S*$,k=j*$+S*N-E*J,nt=-S*J-E*N-w*$;return F[0]=K*j+nt*-S+Y*-w-k*-E,F[1]=Y*j+nt*-E+k*-S-K*-w,F[2]=k*j+nt*-w+K*-E-Y*-S,F[3]=U[3],F;}function H(F){return F[0]=0,F[1]=0,F[2]=0,F[3]=0,F;}function X(F){return"vec4("+F[0]+", "+F[1]+", "+F[2]+", "+F[3]+")";}function Z(F,U){return F[0]===U[0]&&F[1]===U[1]&&F[2]===U[2]&&F[3]===U[3];}function W(F,U){var V=F[0],J=F[1],N=F[2],$=F[3],S=U[0],E=U[1],w=U[2],j=U[3];return Math.abs(V-S)<=e.EPSILON*Math.max(1,Math.abs(V),Math.abs(S))&&Math.abs(J-E)<=e.EPSILON*Math.max(1,Math.abs(J),Math.abs(E))&&Math.abs(N-w)<=e.EPSILON*Math.max(1,Math.abs(N),Math.abs(w))&&Math.abs($-j)<=e.EPSILON*Math.max(1,Math.abs($),Math.abs(j));}var z=p,Q=h,et=v,_=f,st=g,q=O,ht=A,dt=function(){var F=n();return function(U,V,J,N,$,S){var E,w;for(V||(V=4),J||(J=0),N?w=Math.min(N*V+J,U.length):w=U.length,E=J;E<w;E+=V)F[0]=U[E],F[1]=U[E+1],F[2]=U[E+2],F[3]=U[E+3],$(F,F,S),U[E]=F[0],U[E+1]=F[1],U[E+2]=F[2],U[E+3]=F[3];return U;};}();},/* 10 */ /***/function(u,r,t){t.r(r),t.d(r,"create",function(){return a;}),t.d(r,"clone",function(){return o;}),t.d(r,"fromValues",function(){return s;}),t.d(r,"fromRotationTranslationValues",function(){return c;}),t.d(r,"fromRotationTranslation",function(){return p;}),t.d(r,"fromTranslation",function(){return h;}),t.d(r,"fromRotation",function(){return v;}),t.d(r,"fromMat4",function(){return y;}),t.d(r,"copy",function(){return M;}),t.d(r,"identity",function(){return T;}),t.d(r,"set",function(){return m;}),t.d(r,"getReal",function(){return x;}),t.d(r,"getDual",function(){return l;}),t.d(r,"setReal",function(){return d;}),t.d(r,"setDual",function(){return f;}),t.d(r,"getTranslation",function(){return g;}),t.d(r,"translate",function(){return O;}),t.d(r,"rotateX",function(){return A;}),t.d(r,"rotateY",function(){return R;}),t.d(r,"rotateZ",function(){return b;}),t.d(r,"rotateByQuatAppend",function(){return P;}),t.d(r,"rotateByQuatPrepend",function(){return L;}),t.d(r,"rotateAroundAxis",function(){return D;}),t.d(r,"add",function(){return I;}),t.d(r,"multiply",function(){return C;}),t.d(r,"mul",function(){return B;}),t.d(r,"scale",function(){return G;}),t.d(r,"dot",function(){return H;}),t.d(r,"lerp",function(){return X;}),t.d(r,"invert",function(){return Z;}),t.d(r,"conjugate",function(){return W;}),t.d(r,"length",function(){return z;}),t.d(r,"len",function(){return Q;}),t.d(r,"squaredLength",function(){return et;}),t.d(r,"sqrLen",function(){return _;}),t.d(r,"normalize",function(){return st;}),t.d(r,"str",function(){return q;}),t.d(r,"exactEquals",function(){return ht;}),t.d(r,"equals",function(){return dt;});var e=t(2),n=t(7),i=t(6);function a(){var F=new e.ARRAY_TYPE(8);return e.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 U=new e.ARRAY_TYPE(8);return U[0]=F[0],U[1]=F[1],U[2]=F[2],U[3]=F[3],U[4]=F[4],U[5]=F[5],U[6]=F[6],U[7]=F[7],U;}function s(F,U,V,J,N,$,S,E){var w=new e.ARRAY_TYPE(8);return w[0]=F,w[1]=U,w[2]=V,w[3]=J,w[4]=N,w[5]=$,w[6]=S,w[7]=E,w;}function c(F,U,V,J,N,$,S){var E=new e.ARRAY_TYPE(8);E[0]=F,E[1]=U,E[2]=V,E[3]=J;var w=N*0.5,j=$*0.5,K=S*0.5;return E[4]=w*J+j*V-K*U,E[5]=j*J+K*F-w*V,E[6]=K*J+w*U-j*F,E[7]=-w*F-j*U-K*V,E;}function p(F,U,V){var J=V[0]*0.5,N=V[1]*0.5,$=V[2]*0.5,S=U[0],E=U[1],w=U[2],j=U[3];return F[0]=S,F[1]=E,F[2]=w,F[3]=j,F[4]=J*j+N*w-$*E,F[5]=N*j+$*S-J*w,F[6]=$*j+J*E-N*S,F[7]=-J*S-N*E-$*w,F;}function h(F,U){return F[0]=0,F[1]=0,F[2]=0,F[3]=1,F[4]=U[0]*0.5,F[5]=U[1]*0.5,F[6]=U[2]*0.5,F[7]=0,F;}function v(F,U){return F[0]=U[0],F[1]=U[1],F[2]=U[2],F[3]=U[3],F[4]=0,F[5]=0,F[6]=0,F[7]=0,F;}function y(F,U){var V=n.create();i.getRotation(V,U);var J=new e.ARRAY_TYPE(3);return i.getTranslation(J,U),p(F,V,J),F;}function M(F,U){return F[0]=U[0],F[1]=U[1],F[2]=U[2],F[3]=U[3],F[4]=U[4],F[5]=U[5],F[6]=U[6],F[7]=U[7],F;}function T(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 m(F,U,V,J,N,$,S,E,w){return F[0]=U,F[1]=V,F[2]=J,F[3]=N,F[4]=$,F[5]=S,F[6]=E,F[7]=w,F;}var x=n.copy;function l(F,U){return F[0]=U[4],F[1]=U[5],F[2]=U[6],F[3]=U[7],F;}var d=n.copy;function f(F,U){return F[4]=U[0],F[5]=U[1],F[6]=U[2],F[7]=U[3],F;}function g(F,U){var V=U[4],J=U[5],N=U[6],$=U[7],S=-U[0],E=-U[1],w=-U[2],j=U[3];return F[0]=(V*j+$*S+J*w-N*E)*2,F[1]=(J*j+$*E+N*S-V*w)*2,F[2]=(N*j+$*w+V*E-J*S)*2,F;}function O(F,U,V){var J=U[0],N=U[1],$=U[2],S=U[3],E=V[0]*0.5,w=V[1]*0.5,j=V[2]*0.5,K=U[4],Y=U[5],k=U[6],nt=U[7];return F[0]=J,F[1]=N,F[2]=$,F[3]=S,F[4]=S*E+N*j-$*w+K,F[5]=S*w+$*E-J*j+Y,F[6]=S*j+J*w-N*E+k,F[7]=-J*E-N*w-$*j+nt,F;}function A(F,U,V){var J=-U[0],N=-U[1],$=-U[2],S=U[3],E=U[4],w=U[5],j=U[6],K=U[7],Y=E*S+K*J+w*$-j*N,k=w*S+K*N+j*J-E*$,nt=j*S+K*$+E*N-w*J,it=K*S-E*J-w*N-j*$;return n.rotateX(F,U,V),J=F[0],N=F[1],$=F[2],S=F[3],F[4]=Y*S+it*J+k*$-nt*N,F[5]=k*S+it*N+nt*J-Y*$,F[6]=nt*S+it*$+Y*N-k*J,F[7]=it*S-Y*J-k*N-nt*$,F;}function R(F,U,V){var J=-U[0],N=-U[1],$=-U[2],S=U[3],E=U[4],w=U[5],j=U[6],K=U[7],Y=E*S+K*J+w*$-j*N,k=w*S+K*N+j*J-E*$,nt=j*S+K*$+E*N-w*J,it=K*S-E*J-w*N-j*$;return n.rotateY(F,U,V),J=F[0],N=F[1],$=F[2],S=F[3],F[4]=Y*S+it*J+k*$-nt*N,F[5]=k*S+it*N+nt*J-Y*$,F[6]=nt*S+it*$+Y*N-k*J,F[7]=it*S-Y*J-k*N-nt*$,F;}function b(F,U,V){var J=-U[0],N=-U[1],$=-U[2],S=U[3],E=U[4],w=U[5],j=U[6],K=U[7],Y=E*S+K*J+w*$-j*N,k=w*S+K*N+j*J-E*$,nt=j*S+K*$+E*N-w*J,it=K*S-E*J-w*N-j*$;return n.rotateZ(F,U,V),J=F[0],N=F[1],$=F[2],S=F[3],F[4]=Y*S+it*J+k*$-nt*N,F[5]=k*S+it*N+nt*J-Y*$,F[6]=nt*S+it*$+Y*N-k*J,F[7]=it*S-Y*J-k*N-nt*$,F;}function P(F,U,V){var J=V[0],N=V[1],$=V[2],S=V[3],E=U[0],w=U[1],j=U[2],K=U[3];return F[0]=E*S+K*J+w*$-j*N,F[1]=w*S+K*N+j*J-E*$,F[2]=j*S+K*$+E*N-w*J,F[3]=K*S-E*J-w*N-j*$,E=U[4],w=U[5],j=U[6],K=U[7],F[4]=E*S+K*J+w*$-j*N,F[5]=w*S+K*N+j*J-E*$,F[6]=j*S+K*$+E*N-w*J,F[7]=K*S-E*J-w*N-j*$,F;}function L(F,U,V){var J=U[0],N=U[1],$=U[2],S=U[3],E=V[0],w=V[1],j=V[2],K=V[3];return F[0]=J*K+S*E+N*j-$*w,F[1]=N*K+S*w+$*E-J*j,F[2]=$*K+S*j+J*w-N*E,F[3]=S*K-J*E-N*w-$*j,E=V[4],w=V[5],j=V[6],K=V[7],F[4]=J*K+S*E+N*j-$*w,F[5]=N*K+S*w+$*E-J*j,F[6]=$*K+S*j+J*w-N*E,F[7]=S*K-J*E-N*w-$*j,F;}function D(F,U,V,J){if(Math.abs(J)<e.EPSILON)return M(F,U);var N=Math.hypot(V[0],V[1],V[2]);J=J*0.5;var $=Math.sin(J),S=$*V[0]/N,E=$*V[1]/N,w=$*V[2]/N,j=Math.cos(J),K=U[0],Y=U[1],k=U[2],nt=U[3];F[0]=K*j+nt*S+Y*w-k*E,F[1]=Y*j+nt*E+k*S-K*w,F[2]=k*j+nt*w+K*E-Y*S,F[3]=nt*j-K*S-Y*E-k*w;var it=U[4],lt=U[5],ut=U[6],at=U[7];return F[4]=it*j+at*S+lt*w-ut*E,F[5]=lt*j+at*E+ut*S-it*w,F[6]=ut*j+at*w+it*E-lt*S,F[7]=at*j-it*S-lt*E-ut*w,F;}function I(F,U,V){return F[0]=U[0]+V[0],F[1]=U[1]+V[1],F[2]=U[2]+V[2],F[3]=U[3]+V[3],F[4]=U[4]+V[4],F[5]=U[5]+V[5],F[6]=U[6]+V[6],F[7]=U[7]+V[7],F;}function C(F,U,V){var J=U[0],N=U[1],$=U[2],S=U[3],E=V[4],w=V[5],j=V[6],K=V[7],Y=U[4],k=U[5],nt=U[6],it=U[7],lt=V[0],ut=V[1],at=V[2],ot=V[3];return F[0]=J*ot+S*lt+N*at-$*ut,F[1]=N*ot+S*ut+$*lt-J*at,F[2]=$*ot+S*at+J*ut-N*lt,F[3]=S*ot-J*lt-N*ut-$*at,F[4]=J*K+S*E+N*j-$*w+Y*ot+it*lt+k*at-nt*ut,F[5]=N*K+S*w+$*E-J*j+k*ot+it*ut+nt*lt-Y*at,F[6]=$*K+S*j+J*w-N*E+nt*ot+it*at+Y*ut-k*lt,F[7]=S*K-J*E-N*w-$*j+it*ot-Y*lt-k*ut-nt*at,F;}var B=C;function G(F,U,V){return F[0]=U[0]*V,F[1]=U[1]*V,F[2]=U[2]*V,F[3]=U[3]*V,F[4]=U[4]*V,F[5]=U[5]*V,F[6]=U[6]*V,F[7]=U[7]*V,F;}var H=n.dot;function X(F,U,V,J){var N=1-J;return H(U,V)<0&&(J=-J),F[0]=U[0]*N+V[0]*J,F[1]=U[1]*N+V[1]*J,F[2]=U[2]*N+V[2]*J,F[3]=U[3]*N+V[3]*J,F[4]=U[4]*N+V[4]*J,F[5]=U[5]*N+V[5]*J,F[6]=U[6]*N+V[6]*J,F[7]=U[7]*N+V[7]*J,F;}function Z(F,U){var V=et(U);return F[0]=-U[0]/V,F[1]=-U[1]/V,F[2]=-U[2]/V,F[3]=U[3]/V,F[4]=-U[4]/V,F[5]=-U[5]/V,F[6]=-U[6]/V,F[7]=U[7]/V,F;}function W(F,U){return F[0]=-U[0],F[1]=-U[1],F[2]=-U[2],F[3]=U[3],F[4]=-U[4],F[5]=-U[5],F[6]=-U[6],F[7]=U[7],F;}var z=n.length,Q=z,et=n.squaredLength,_=et;function st(F,U){var V=et(U);if(V>0){V=Math.sqrt(V);var J=U[0]/V,N=U[1]/V,$=U[2]/V,S=U[3]/V,E=U[4],w=U[5],j=U[6],K=U[7],Y=J*E+N*w+$*j+S*K;F[0]=J,F[1]=N,F[2]=$,F[3]=S,F[4]=(E-J*Y)/V,F[5]=(w-N*Y)/V,F[6]=(j-$*Y)/V,F[7]=(K-S*Y)/V;}return F;}function q(F){return"quat2("+F[0]+", "+F[1]+", "+F[2]+", "+F[3]+", "+F[4]+", "+F[5]+", "+F[6]+", "+F[7]+")";}function ht(F,U){return F[0]===U[0]&&F[1]===U[1]&&F[2]===U[2]&&F[3]===U[3]&&F[4]===U[4]&&F[5]===U[5]&&F[6]===U[6]&&F[7]===U[7];}function dt(F,U){var V=F[0],J=F[1],N=F[2],$=F[3],S=F[4],E=F[5],w=F[6],j=F[7],K=U[0],Y=U[1],k=U[2],nt=U[3],it=U[4],lt=U[5],ut=U[6],at=U[7];return Math.abs(V-K)<=e.EPSILON*Math.max(1,Math.abs(V),Math.abs(K))&&Math.abs(J-Y)<=e.EPSILON*Math.max(1,Math.abs(J),Math.abs(Y))&&Math.abs(N-k)<=e.EPSILON*Math.max(1,Math.abs(N),Math.abs(k))&&Math.abs($-nt)<=e.EPSILON*Math.max(1,Math.abs($),Math.abs(nt))&&Math.abs(S-it)<=e.EPSILON*Math.max(1,Math.abs(S),Math.abs(it))&&Math.abs(E-lt)<=e.EPSILON*Math.max(1,Math.abs(E),Math.abs(lt))&&Math.abs(w-ut)<=e.EPSILON*Math.max(1,Math.abs(w),Math.abs(ut))&&Math.abs(j-at)<=e.EPSILON*Math.max(1,Math.abs(j),Math.abs(at));}},/* 11 */ /***/function(u,r,t){t.r(r),t.d(r,"create",function(){return n;}),t.d(r,"clone",function(){return i;}),t.d(r,"fromValues",function(){return a;}),t.d(r,"copy",function(){return o;}),t.d(r,"set",function(){return s;}),t.d(r,"add",function(){return c;}),t.d(r,"subtract",function(){return p;}),t.d(r,"multiply",function(){return h;}),t.d(r,"divide",function(){return v;}),t.d(r,"ceil",function(){return y;}),t.d(r,"floor",function(){return M;}),t.d(r,"min",function(){return T;}),t.d(r,"max",function(){return m;}),t.d(r,"round",function(){return x;}),t.d(r,"scale",function(){return l;}),t.d(r,"scaleAndAdd",function(){return d;}),t.d(r,"distance",function(){return f;}),t.d(r,"squaredDistance",function(){return g;}),t.d(r,"length",function(){return O;}),t.d(r,"squaredLength",function(){return A;}),t.d(r,"negate",function(){return R;}),t.d(r,"inverse",function(){return b;}),t.d(r,"normalize",function(){return P;}),t.d(r,"dot",function(){return L;}),t.d(r,"cross",function(){return D;}),t.d(r,"lerp",function(){return I;}),t.d(r,"random",function(){return C;}),t.d(r,"transformMat2",function(){return B;}),t.d(r,"transformMat2d",function(){return G;}),t.d(r,"transformMat3",function(){return H;}),t.d(r,"transformMat4",function(){return X;}),t.d(r,"rotate",function(){return Z;}),t.d(r,"angle",function(){return W;}),t.d(r,"zero",function(){return z;}),t.d(r,"str",function(){return Q;}),t.d(r,"exactEquals",function(){return et;}),t.d(r,"equals",function(){return _;}),t.d(r,"len",function(){return st;}),t.d(r,"sub",function(){return q;}),t.d(r,"mul",function(){return ht;}),t.d(r,"div",function(){return dt;}),t.d(r,"dist",function(){return F;}),t.d(r,"sqrDist",function(){return U;}),t.d(r,"sqrLen",function(){return V;}),t.d(r,"forEach",function(){return J;});var e=t(2);function n(){var N=new e.ARRAY_TYPE(2);return e.ARRAY_TYPE!=Float32Array&&(N[0]=0,N[1]=0),N;}function i(N){var $=new e.ARRAY_TYPE(2);return $[0]=N[0],$[1]=N[1],$;}function a(N,$){var S=new e.ARRAY_TYPE(2);return S[0]=N,S[1]=$,S;}function o(N,$){return N[0]=$[0],N[1]=$[1],N;}function s(N,$,S){return N[0]=$,N[1]=S,N;}function c(N,$,S){return N[0]=$[0]+S[0],N[1]=$[1]+S[1],N;}function p(N,$,S){return N[0]=$[0]-S[0],N[1]=$[1]-S[1],N;}function h(N,$,S){return N[0]=$[0]*S[0],N[1]=$[1]*S[1],N;}function v(N,$,S){return N[0]=$[0]/S[0],N[1]=$[1]/S[1],N;}function y(N,$){return N[0]=Math.ceil($[0]),N[1]=Math.ceil($[1]),N;}function M(N,$){return N[0]=Math.floor($[0]),N[1]=Math.floor($[1]),N;}function T(N,$,S){return N[0]=Math.min($[0],S[0]),N[1]=Math.min($[1],S[1]),N;}function m(N,$,S){return N[0]=Math.max($[0],S[0]),N[1]=Math.max($[1],S[1]),N;}function x(N,$){return N[0]=Math.round($[0]),N[1]=Math.round($[1]),N;}function l(N,$,S){return N[0]=$[0]*S,N[1]=$[1]*S,N;}function d(N,$,S,E){return N[0]=$[0]+S[0]*E,N[1]=$[1]+S[1]*E,N;}function f(N,$){var S=$[0]-N[0],E=$[1]-N[1];return Math.hypot(S,E);}function g(N,$){var S=$[0]-N[0],E=$[1]-N[1];return S*S+E*E;}function O(N){var $=N[0],S=N[1];return Math.hypot($,S);}function A(N){var $=N[0],S=N[1];return $*$+S*S;}function R(N,$){return N[0]=-$[0],N[1]=-$[1],N;}function b(N,$){return N[0]=1/$[0],N[1]=1/$[1],N;}function P(N,$){var S=$[0],E=$[1],w=S*S+E*E;return w>0&&(w=1/Math.sqrt(w)),N[0]=$[0]*w,N[1]=$[1]*w,N;}function L(N,$){return N[0]*$[0]+N[1]*$[1];}function D(N,$,S){var E=$[0]*S[1]-$[1]*S[0];return N[0]=N[1]=0,N[2]=E,N;}function I(N,$,S,E){var w=$[0],j=$[1];return N[0]=w+E*(S[0]-w),N[1]=j+E*(S[1]-j),N;}function C(N,$){$=$||1;var S=e.RANDOM()*2*Math.PI;return N[0]=Math.cos(S)*$,N[1]=Math.sin(S)*$,N;}function B(N,$,S){var E=$[0],w=$[1];return N[0]=S[0]*E+S[2]*w,N[1]=S[1]*E+S[3]*w,N;}function G(N,$,S){var E=$[0],w=$[1];return N[0]=S[0]*E+S[2]*w+S[4],N[1]=S[1]*E+S[3]*w+S[5],N;}function H(N,$,S){var E=$[0],w=$[1];return N[0]=S[0]*E+S[3]*w+S[6],N[1]=S[1]*E+S[4]*w+S[7],N;}function X(N,$,S){var E=$[0],w=$[1];return N[0]=S[0]*E+S[4]*w+S[12],N[1]=S[1]*E+S[5]*w+S[13],N;}function Z(N,$,S,E){var w=$[0]-S[0],j=$[1]-S[1],K=Math.sin(E),Y=Math.cos(E);return N[0]=w*Y-j*K+S[0],N[1]=w*K+j*Y+S[1],N;}function W(N,$){var S=N[0],E=N[1],w=$[0],j=$[1],K=Math.sqrt(S*S+E*E)*Math.sqrt(w*w+j*j),Y=K&&(S*w+E*j)/K;return Math.acos(Math.min(Math.max(Y,-1),1));}function z(N){return N[0]=0,N[1]=0,N;}function Q(N){return"vec2("+N[0]+", "+N[1]+")";}function et(N,$){return N[0]===$[0]&&N[1]===$[1];}function _(N,$){var S=N[0],E=N[1],w=$[0],j=$[1];return Math.abs(S-w)<=e.EPSILON*Math.max(1,Math.abs(S),Math.abs(w))&&Math.abs(E-j)<=e.EPSILON*Math.max(1,Math.abs(E),Math.abs(j));}var st=O,q=p,ht=h,dt=v,F=f,U=g,V=A,J=function(){var N=n();return function($,S,E,w,j,K){var Y,k;for(S||(S=2),E||(E=0),w?k=Math.min(w*S+E,$.length):k=$.length,Y=E;Y<k;Y+=S)N[0]=$[Y],N[1]=$[Y+1],j(N,N,K),$[Y]=N[0],$[Y+1]=N[1];return $;};}();},/* 12 */ /***/function(u,r,t){t.r(r);var e=t(13);t.d(r,"Renderer",function(){return e["default"];});var n=t(40);t.d(r,"Figure2D",function(){return n["default"];});var i=t(56);t.d(r,"Mesh2D",function(){return i["default"];});var a=t(29);t.d(r,"MeshCloud",function(){return a["default"];});var o=t(23);t.d(r,"parseFont",function(){return o["default"];});var s=t(31);t.d(r,"parseColor",function(){return s["default"];});var c=t(21);t.d(r,"ENV",function(){return c["default"];}),t(1).glMatrix.setMatrixArrayType(Array);},/* 13 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return b;});var e=t(14),n=t(1),i=t(20),a=t(27),o=t(25),s=t(40),c=t(56),p=t(29),h=t(59),v=t(21),y=t(63);t(1).glMatrix.setMatrixArrayType(Array);var M={autoUpdate:!1,// premultipliedAlpha: true,
|
|
23
|
-
preserveDrawingBuffer:!1,// depth: false,
|
|
24
|
-
// antialias: false,
|
|
25
|
-
bufferSize:1500},T="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",m="precision mediump float;\nvarying vec3 vTextureCoord;\nuniform sampler2D u_texSampler;\nvoid main() {\n gl_FragColor = texture2D(u_texSampler, vTextureCoord.xy);\n}\n",x=Symbol("glRenderer"),l=Symbol("canvasRenderer"),d=Symbol("options"),f=Symbol("globalTransform"),g=Symbol("applyGlobalTransform"),O=Symbol("canvas");function A(P){var L=P.gl,D=P.fbo;D&&L.bindFramebuffer(L.FRAMEBUFFER,D),P._draw(),D&&L.bindFramebuffer(L.FRAMEBUFFER,null);}function R(P,L,D,I){var C=P.createTexture(L.canvas),B=[[[0,0],[D,0],[D,I],[0,I],[0,0]]];B.closed=!0;var G=new c["default"]({contours:B});G.setTexture(C),P.setMeshData([G.meshData]),A(P),C["delete"](),L.clearRect(0,0,D,I),delete L._filter;}var b=/*#__PURE__*/function(){function b(L){var D=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,b);var I=D.contextType;if(I||(typeof WebGL2RenderingContext=="function"?I="webgl2":typeof WebGLRenderingContext=="function"?I="webgl":I="2d"),!L.getContext){var C=L;L={getContext:function getContext(){return C;},width:D.width,height:D.height},C.canvas=L,I="2d";}if(this[O]=L,I!=="webgl"&&I!=="webgl2"&&I!=="2d")throw new Error("Unknown context type ".concat(I));if(D.contextType=I,this[d]=Object.assign({},M,D),I==="webgl"||I==="webgl2"){I==="webgl2"&&(this[d].webgl2=!0);var _C=new e["default"](L,this[d]);I==="webgl2"&&!_C.isWebGL2&&(D.contextType="webgl"),Object(y.createShaders)(_C),Object(y.applyShader)(_C),Object(y.createCloudShaders)(_C);var B=_C.gl;B.clearColor(0,0,0,0),B.blendFuncSeparate(B.SRC_ALPHA,B.ONE_MINUS_SRC_ALPHA,B.ONE,B.ONE_MINUS_SRC_ALPHA),this[x]=_C;}else this[l]=new i["default"](L,this[d]);this[f]=[1,0,0,0,1,0,0,0,1],this.updateResolution();}return _createClass(b,[{key:"canvas",get:function get(){return this[O];}},{key:"canvasRenderer",get:function get(){return this[l];}},{key:"glRenderer",get:function get(){return this[x];}},{key:"isWebGL2",get:function get(){return this[x]&&this[x].isWebGL2;}},{key:"options",get:function get(){return this[d];}},{key:"globalTransformMatrix",get:function get(){var L=this[f];return[L[0],L[1],L[3],L[4],L[6],L[7]];}},{key:"viewMatrix",get:function get(){return this[f];}},{key:g,value:function value(){var L=this[x]||this[l];if(this[x]){var _this$canvas=this.canvas,D=_this$canvas.width,I=_this$canvas.height;L.uniforms.viewMatrix=this.viewMatrix,L.uniforms.projectionMatrix=this.projectionMatrix,L.uniforms.u_resolution=[D,I];}}},{key:"updateResolution",value:function updateResolution(){var _this$canvas2=this.canvas,L=_this$canvas2.width,D=_this$canvas2.height,I=[// translation
|
|
26
|
-
1,0,0,0,1,0,-L/2,-D/2,1],C=[// scale
|
|
27
|
-
2/L,0,0,0,-2/D,0,0,0,1],B=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),C,I);this.projectionMatrix=B,this[x]&&this[x].gl.viewport(0,0,L,D);}},{key:"createTexture",value:function createTexture(L,D){return(this[x]||this[l]).createTexture(L,D);}/* async */},{key:"loadTexture",value:function loadTexture(L){var _ref2=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref2$useImageBitmap=_ref2.useImageBitmap,D=_ref2$useImageBitmap===void 0?!1:_ref2$useImageBitmap;return(this[x]||this[l]).loadTexture(L,{useImageBitmap:D});}},{key:"createText",value:function createText(L){var _ref3=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref3$font=_ref3.font,D=_ref3$font===void 0?"16px arial":_ref3$font,_ref3$fillColor=_ref3.fillColor,I=_ref3$fillColor===void 0?null:_ref3$fillColor,_ref3$strokeColor=_ref3.strokeColor,C=_ref3$strokeColor===void 0?null:_ref3$strokeColor,_ref3$strokeWidth=_ref3.strokeWidth,B=_ref3$strokeWidth===void 0?1:_ref3$strokeWidth;if(this[x]){var G=v["default"].createText(L,{font:D,fillColor:I,strokeColor:C,strokeWidth:B});return{image:this.createTexture(G.image),rect:G.rect};}return{_img:{font:D,fillColor:I,strokeColor:C,strokeWidth:B,text:L}};}},{key:"createProgram",value:function createProgram(){var _ref4=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},L=_ref4.vertex,D=_ref4.fragment,I=_ref4.options;if(this[x]){var C=this[x].compileSync(D,L);return C._attribOpts=I,C;}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,L=_ref5$vertex===void 0?T:_ref5$vertex,_ref5$fragment=_ref5.fragment,D=_ref5$fragment===void 0?m:_ref5$fragment,I=_ref5.options;return this.createProgram({vertex:L,fragment:D,options:I});}},{key:"useProgram",value:function useProgram(L){var D=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(this[x]){var I=Object.assign({},L._attribOpts,D);return this[x].useProgram(L,I);}throw new Error("Context 2D cannot use webgl program.");}},{key:"deleteTexture",value:function deleteTexture(L){return(this[x]||this[l]).deleteTexture(L);}},{key:"clear",value:function clear(){var _this$l;if(this[x]){var D=this[x].gl;D.clear(D.COLOR_BUFFER_BIT);}else(_this$l=this[l]).clear.apply(_this$l,arguments);}},{key:"drawMeshCloud",value:function drawMeshCloud(L){var _ref6=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref6$clear=_ref6.clear,D=_ref6$clear===void 0?!1:_ref6$clear,_ref6$program=_ref6.program,I=_ref6$program===void 0?null:_ref6$program;var C=this[x]||this[l],B=I||L.program;if(this[x]){var G=C.gl;if(D&&G.clear(G.COLOR_BUFFER_BIT),B)C.program!==B&&this.useProgram(B,{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 H=L.mesh.meshData,X=!!H.uniforms.u_texSampler,Z=!!H.uniforms.u_filterFlag,W=!!H.uniforms.u_radialGradientVector,z=L.hasCloudColor,Q=L.hasCloudFilter,et=!!H.uniforms.u_clipSampler;Object(y.applyCloudShader)(C,{hasTexture:X,hasFilter:Z,hasGradient:W,hasCloudColor:z,hasCloudFilter:Q,hasClipPath:et});}this[g](),C.setMeshData([L.meshData]),L.beforeRender&&L.beforeRender(G,L),A(C),L.afterRender&&L.afterRender(G,L);}else C.setTransform(this.globalTransformMatrix),C.drawMeshCloud(L,{clear:D,hook:!1});}},{key:"drawMeshes",value:function drawMeshes(L){var _this14=this;var _ref7=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref7$clear=_ref7.clear,D=_ref7$clear===void 0?!1:_ref7$clear,_ref7$program=_ref7.program,I=_ref7$program===void 0?null:_ref7$program;var C=this[x]||this[l];if(this[x]){var B=C.fbo,G=Object(a["default"])(this,L,I==null),H=C.gl;D&&H.clear(H.COLOR_BUFFER_BIT);var X=!Object(h.isUnitTransform)(this.globalTransformMatrix);this._drawCalls=0;var _iterator12=_createForOfIteratorHelper(G),_step12;try{var _loop=function _loop(){var Z=_step12.value;_this14._drawCalls++;var W=I||Z.program;if(Z instanceof p["default"])_this14.drawMeshCloud(Z,{clear:D,program:W});else{var _this14$canvas=_this14.canvas,z=_this14$canvas.width,Q=_this14$canvas.height;if(Z.beforeRender&&Z.beforeRender(H,Z),Z.pass.length&&((!_this14.fbo||_this14.fbo.width!==z||_this14.fbo.height!==Q)&&(_this14.fbo={width:z,height:Q,target:C.createFBO(),buffer:C.createFBO(),swap:function swap(){var _ref8=[this.buffer,this.target];this.target=_ref8[0];this.buffer=_ref8[1];}}),C.bindFBO(_this14.fbo.target)),!W&&Z.filterCanvas){Object(y.applyShader)(C,{hasTexture:!0});var et=_this14.filterContext;et||(et=v["default"].createCanvas(z,Q).getContext("2d"),_this14.filterContext=et);var _=L[Z.packIndex],st=_.filter,q=L[Z.packIndex+1],ht=L[Z.packIndex-1];(!ht||!ht.filterCanvas||ht.filter!==st)&&(!q||!q.filterCanvas||q.filter!==st)?(X?(et.save(),Object(o.drawMesh2D)(_,et,!1),et.restore(),Object(o.applyFilter)(et,st)):Object(o.drawMesh2D)(_,et,!0),_this14[g](),R(C,et,z,Q)):(X&&et.save(),Object(o.drawMesh2D)(_,et,!1),X&&et.restore(),(!q||!q.filterCanvas||_.filter!==q.filter)&&(Object(o.applyFilter)(et,st),_this14[g](),R(C,et,z,Q)));}else{if(W)C.program!==W&&_this14.useProgram(W,{a_color:{type:"UNSIGNED_BYTE",normalize:!0}});else{var _et=!!Z.uniforms.u_texSampler,_2=!!Z.uniforms.u_filterFlag,_st=!!Z.uniforms.u_radialGradientVector,_q=!!Z.uniforms.u_clipSampler;Object(y.applyShader)(C,{hasTexture:_et,hasFilter:_2,hasGradient:_st,hasClipPath:_q});}Z.filterCanvas&&console.warn("User program ignored some filter effects."),_this14[g](),C.setMeshData([Z]),A(C);}if(Z.pass.length){var _et2=Z.pass.length;Z.pass.forEach(function(_,st){_.blend=Z.enableBlend,_.setTexture(C.fbo.texture),st===_et2-1?C.bindFBO(B):(_this14.fbo.swap(),C.bindFBO(_this14.fbo.target)),_.program?C.useProgram(_.program):(_this14.defaultPassProgram=_this14.defaultPassProgram||_this14.createPassProgram(),C.useProgram(_this14.defaultPassProgram)),C.setMeshData([_.meshData]),H.clear(H.COLOR_BUFFER_BIT),A(C);});}Z.afterRender&&Z.afterRender(H,Z);}};for(_iterator12.s();!(_step12=_iterator12.n()).done;){_loop();}}catch(err){_iterator12.e(err);}finally{_iterator12.f();}}else C.setTransform(this.globalTransformMatrix),C.drawMeshes(L,{clear:D});}},{key:"drawImage",value:function drawImage(L){for(var _len=arguments.length,D=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){D[_key-1]=arguments[_key];}var I=D.length;if(I<2)throw new TypeError("Failed to execute 'drawImage' on 'Renderer': 3 arguments required, but only ".concat(D.length+1," present."));if(I!==2&&I!==4&&I!==8)throw new TypeError("Failed to execute 'drawImage' on 'Renderer': Valid arities are: [3, 5, 9], but ".concat(D.length+1," arguments provided."));var C=null,B=null;I===2?C=[D[0],D[1],L.width,L.height]:I===4?C=D:I===8&&(B=D.slice(0,4),C=D.slice(4));var G=this.createTexture(L),_this$canvas3=this.canvas,H=_this$canvas3.width,X=_this$canvas3.height,Z=new s["default"]();Z.rect(C[0],C[1],H,X);var W=new c["default"](Z,{width:H,height:X});W.setTexture(G,{rect:C,srcRect:B}),this.drawMeshes([W]),this.deleteTexture(G);}},{key:"setGlobalTransform",value:function setGlobalTransform(){return this[f]=[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 D=this[f];for(var _len2=arguments.length,L=new Array(_len2),_key2=0;_key2<_len2;_key2++){L[_key2]=arguments[_key2];}return this[f]=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),D,L),this;}},{key:"globalTranslate",value:function globalTranslate(L,D){var I=n.mat3.create();return I=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),I,[L,D]),this.globalTransform.apply(this,_toConsumableArray(I));}},{key:"globalRotate",value:function globalRotate(L){var _ref9=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[0,0],_ref10=_slicedToArray(_ref9,2),D=_ref10[0],I=_ref10[1];var C=n.mat3.create();return C=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),C,[D,I]),C=n.mat3.rotate(Array.of(0,0,0,0,0,0,0,0,0),C,L),C=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),C,[-D,-I]),this.globalTransform.apply(this,_toConsumableArray(C));}},{key:"globalScale",value:function globalScale(L){var D=arguments.length>1&&arguments[1]!==undefined?arguments[1]:L;var _ref11=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref12=_slicedToArray(_ref11,2),I=_ref12[0],C=_ref12[1];var B=n.mat3.create();return B=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),B,[I,C]),B=n.mat3.scale(Array.of(0,0,0,0,0,0,0,0,0),B,[L,D]),B=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),B,[-I,-C]),this.globalTransform.apply(this,_toConsumableArray(B));}},{key:"globalSkew",value:function globalSkew(L){var D=arguments.length>1&&arguments[1]!==undefined?arguments[1]:L;var _ref13=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref14=_slicedToArray(_ref13,2),I=_ref14[0],C=_ref14[1];var B=n.mat3.create();return B=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),B,[I,C]),B=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),B,n.mat3.fromValues(1,Math.tan(D),Math.tan(L),1,0,0)),B=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),B,[-I,-C]),this.globalTransform.apply(this,_toConsumableArray(B));}},{key:"transformPoint",value:function transformPoint(L,D,I){var C=this.globalTransformMatrix;I&&(C=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),C,I));var B=L*C[0]+D*C[2]+C[4],G=L*C[1]+D*C[3]+C[5];return[B,G];}}]);}();},/* 14 */ /***/function(u,r,t){t.r(r);var e=t(15);t(1).glMatrix.setMatrixArrayType(Array),r["default"]=e["default"];},/* 15 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return y;});var e=t(16),n=t(17),i=t(18),a=t(19);t(1).glMatrix.setMatrixArrayType(Array);function o(M,T,m){return T in M?Object.defineProperty(M,T,{value:m,enumerable:!0,configurable:!0,writable:!0}):M[T]=m,M;}var s={};function c(M){var T=arguments.length>1&&arguments[1]!==undefined?arguments[1]:3;var m=[],x=M.length;for(var l=0;l<x;l++)l%T<2&&m.push(0.5*(M[l]+1));return m;}function p(M,T){var m=T._buffers;Object.values(m).forEach(function(x){M.deleteBuffer(x);}),T._buffers={};}function h(M,T,m){return M.activeTexture(M.TEXTURE0+m),Array.isArray(T._img)?M.bindTexture(M.TEXTURE_CUBE_MAP,T):M.bindTexture(M.TEXTURE_2D,T),T;}var v={"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 y=/*#__PURE__*/function(){function y(T){var m=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,y);this.options=Object.assign({},y.defaultOptions,m),this.canvas=T;var x;this.options.webgl2&&(x=T.getContext("webgl2",this.options)),x==null&&(x=Object(e.setupWebGL)(T,this.options),this.aia_ext=x.getExtension("ANGLE_instanced_arrays")),this.gl=x,x.viewport(0,0,T.width,T.height),x.clearColor(0,0,0,0),x.blendFuncSeparate(x.SRC_ALPHA,x.ONE_MINUS_SRC_ALPHA,x.ONE,x.ONE_MINUS_SRC_ALPHA),this.programs=[],this._events={};}return _createClass(y,[{key:"program",get:function get(){var T=this.gl;return T.getParameter(T.CURRENT_PROGRAM);}// WebGLRenderingContext.uniform[1234][fi][v]()
|
|
28
|
-
// WebGLRenderingContext.uniformMatrix[234]fv()
|
|
29
|
-
},{key:"_declareUniform",value:function _declareUniform(T,m){var x=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"1f";var l=this.gl,d=l.getUniformLocation(T,m);var f;var g=this;if(/^sampler/.test(x)){var O=T._samplerMap,A=T._bindTextures;Object.defineProperty(T.uniforms,m,{get:function get(){return f;},set:function set(R){f=R;var b=O[m]!=null?O[m]:A.length;A[b]=R,h(l,R,b),O[m]||(O[m]=b,l.uniform1i(d,b)),g.options.autoUpdate&&g.update();},configurable:!1,enumerable:!0});}else{var _O=x.indexOf("Matrix")===0,_A=!_O&&/v$/.test(x),R=l["uniform".concat(x)].bind(l);Object.defineProperty(T.uniforms,m,{get:function get(){return f;},set:function set(b){f=b,typeof b=="number"&&(b=[b]),_O?R(d,!1,b):_A?R(d,b):R.apply(void 0,[d].concat(_toConsumableArray(b))),g.options.autoUpdate&&g.update();},configurable:!1,enumerable:!0});}}},{key:"_draw",value:function _draw(){var _this15=this;var T=this.program;T.meshData.forEach(function(m,x){var l=m.positions,d=m.cells,f=m.instanceCount,g=m.cellsCount,O=m.attributes,A=m.uniforms,R=m.textureCoord,b=m.enableBlend,P=_this15.gl;var L=m.mode!=null?m.mode:P.TRIANGLES;typeof L=="string"&&(L=P[L]),b?P.enable(P.BLEND):P.disable(P.BLEND),P.bindBuffer(P.ARRAY_BUFFER,T._buffers.verticesBuffer),P.bufferData(P.ARRAY_BUFFER,l,P.STATIC_DRAW),d&&(P.bindBuffer(P.ELEMENT_ARRAY_BUFFER,T._buffers.cellsBuffer),P.bufferData(P.ELEMENT_ARRAY_BUFFER,d,P.STATIC_DRAW));var D=[];O&&Object.values(O).forEach(function(_ref15){var C=_ref15.name,B=_ref15.data,G=_ref15.divisor;if(P.bindBuffer(P.ARRAY_BUFFER,T._buffers[C]),P.bufferData(P.ARRAY_BUFFER,B,P.STATIC_DRAW),G!=null){var H=P.getAttribLocation(T,C);H>=0&&(P.enableVertexAttribArray(H),D.push(H),P.vertexAttribDivisor?P.vertexAttribDivisor(H,G):_this15.aia_ext&&_this15.aia_ext.vertexAttribDivisorANGLE(H,G));}}),A&&Object.entries(A).forEach(function(_ref16){var _ref17=_slicedToArray(_ref16,2),C=_ref17[0],B=_ref17[1];_this15.uniforms[C]=B;});var I;if(!d){var C=T._dimension;I=l.length/C;}if(T._enableTextures&&T._buffers.texCoordBuffer){var _C2=R||c(l,T._dimension);P.bindBuffer(P.ARRAY_BUFFER,T._buffers.texCoordBuffer),P.bufferData(P.ARRAY_BUFFER,y.FLOAT(_C2),P.STATIC_DRAW);}f!=null?(d?P.drawElementsInstanced?P.drawElementsInstanced(L,g,P.UNSIGNED_SHORT,0,f):_this15.aia_ext&&_this15.aia_ext.drawElementsInstancedANGLE(L,g,P.UNSIGNED_SHORT,0,f):P.drawArraysInstanced?P.drawArraysInstanced(L,0,I,f):_this15.aia_ext.drawArraysInstancedANGLE(L,0,I,f),D.forEach(function(C){P.vertexAttribDivisor?P.vertexAttribDivisor(C,null):_this15.aia_ext&&_this15.aia_ext.vertexAttribDivisorANGLE(C,null);})):d?P.drawElements(L,g,P.UNSIGNED_SHORT,0):P.drawArrays(L,0,I);});}},{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 T=this.program;if(!T||!T.uniforms)throw Error("No avaliable program.");return T.uniforms;}},{key:"deleteProgram",value:function deleteProgram(T){var m=this.gl;this.program===T&&(this.startRender=!1,this._renderFrameID&&(cancelAnimationFrame(this._renderFrameID),delete this._renderFrameID),m.useProgram(null));var x=this.programs.indexOf(T);x>=0&&this.programs.splice(x,1),p(m,T),m.deleteProgram(T);}/**
|
|
30
|
-
[{
|
|
31
|
-
positions: ...
|
|
32
|
-
cells: ...
|
|
33
|
-
textureCoord: ...
|
|
34
|
-
attributes: {name: {data:..., normalize: true}},
|
|
35
|
-
uniforms: ...
|
|
36
|
-
}]
|
|
37
|
-
*/},{key:"setMeshData",value:function setMeshData(T){var _this16=this;Array.isArray(T)||(T=[T]);var m=this.program;m.meshData=T.map(function(_ref18){var x=_ref18.mode,l=_ref18.positions,d=_ref18.instanceCount,f=_ref18.cells,g=_ref18.cellsCount,O=_ref18.attributes,A=_ref18.uniforms,R=_ref18.textureCoord,b=_ref18.enableBlend;var P={positions:y.FLOAT(l),uniforms:A,enableBlend:!!b,textureCoord:y.FLOAT(R)};if(f&&(P.cells=y.USHORT(f),P.cellsCount=g||P.cells.length),x!=null&&(P.mode=x),d!=null){if(!_this16.isWebGL2&&!_this16.aia_ext)throw new Error("Cannot use instanceCount in this rendering context, use webgl2 context instead.");P.instanceCount=d;}if(O){var L={};Object.entries(O).forEach(function(_ref19){var _ref20=_slicedToArray(_ref19,2),D=_ref20[0],I=_ref20[1];if(!m._attribute[D])m._attribute[D]="ignored";else if(m._attribute[D]!=="ignored"){var _m$_attribute$D=m._attribute[D],C=_m$_attribute$D.name,B=_m$_attribute$D.type;var G=I.data||I;if(Array.isArray(G)&&(G=y[B](G)),L[D]={name:C,data:G},I.divisor!=null){if(!_this16.isWebGL2&&!_this16.aia_ext)throw new Error("Cannot use divisor in this rendering context, use webgl2 context instead.");L[D].divisor=I.divisor;}}}),P.attributes=L;}return P;}),this.options.autoUpdate&&this.update();}},{key:"createProgram",value:function createProgram(T,m){var _this17=this;var x=/^\s*uniform\s+sampler/mg.test(T);T==null&&(T=i["default"]),m==null&&(m=x?a["default"]:n["default"]);var l=this.gl,d=Object(e.createProgram)(l,m,T);d.shaderText={vertexShader:m,fragmentShader:T},d._buffers={},d._attribute={},d.uniforms={},d._samplerMap={},d._bindTextures=[];var f=new RegExp("(?:attribute|in) vec(\\d) ".concat(this.options.vertexPosition),"im");var g=m.match(f);g&&(d._dimension=Number(g[1]));var O=new RegExp("(?:attribute|in) vec(\\d) ".concat(this.options.vertexTextureCoord),"im");g=m.match(O),g&&(d._texCoordSize=Number(g[1]));var A=/^\s*(?:attribute|in) (\w+?)(\d*) (\w+)/gim;if(g=m.match(A),g)for(var P=0;P<g.length;P++){var L=/^\s*(?:attribute|in) (\w+?)(\d*) (\w+)/im,D=g[P].match(L);if(D&&D[3]!==this.options.vertexPosition&&D[3]!==this.options.vertexTextureCoord){var _D=_slicedToArray(D,4),I=_D[1],C=_D[2],B=_D[3];I==="mat"&&(C=Math.pow(C,2)),d._buffers[B]=l.createBuffer(),d._attribute[B]={name:B,type:I,size:Number(C)||1};}}var R=/^\s*uniform\s+(\w+)\s+(\w+)(\[\d+\])?/mg;g=m.match(R)||[],g=g.concat(T.match(R)||[]),g.forEach(function(P){var L=P.match(/^\s*uniform\s+(\w+)\s+(\w+)(\[\d+\])?/);var _L$slice=L.slice(1),_L$slice2=_slicedToArray(_L$slice,3),D=_L$slice2[0],I=_L$slice2[1],C=_L$slice2[2];D=v[D],C=!!C,D.indexOf("Matrix")!==0&&C&&(D+="v"),_this17._declareUniform(d,I,D);}),d._buffers.verticesBuffer=l.createBuffer(),d._buffers.cellsBuffer=l.createBuffer();var b=l.getAttribLocation(d,this.options.vertexTextureCoord);return d._enableTextures=b>=0,d._enableTextures&&(d._buffers.texCoordBuffer=l.createBuffer()),this.programs.push(d),d;}},{key:"useProgram",value:function useProgram(T){var m=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};this.startRender=!1,this._renderFrameID&&(cancelAnimationFrame(this._renderFrameID),delete this._renderFrameID);var x=this.gl;x.useProgram(T);var l=T._dimension;x.bindBuffer(x.ARRAY_BUFFER,T._buffers.verticesBuffer);var d=x.getAttribLocation(T,this.options.vertexPosition);if(x.vertexAttribPointer(d,l,x.FLOAT,!1,0,0),x.enableVertexAttribArray(d),T._enableTextures){x.bindBuffer(x.ARRAY_BUFFER,T._buffers.texCoordBuffer);var f=x.getAttribLocation(T,this.options.vertexTextureCoord);x.vertexAttribPointer(f,T._texCoordSize||2,x.FLOAT,!1,0,0),x.enableVertexAttribArray(f);}if(Object.entries(T._attribute).forEach(function(_ref21){var _ref22=_slicedToArray(_ref21,2),f=_ref22[0],g=_ref22[1];if(g!=="ignored"){var O=g.size,A=m[f]||{},R=!!A.normalize;var b=A.type||"FLOAT";var P=A.key||f;b==="UBYTE"&&(b="UNSIGNED_BYTE"),b==="USHORT"&&(b="UNSIGNED_SHORT"),g.type=b,P&&P!==f&&(T._attribute[P]=g),x.bindBuffer(x.ARRAY_BUFFER,T._buffers[f]);var L=x.getAttribLocation(T,f);L>=0&&(x.vertexAttribPointer(L,O,x[b],R,0,0),x.enableVertexAttribArray(L));}}),!T.meshData){var _f3=[[-1,-1,0,1].slice(0,l),[1,-1,0,1].slice(0,l),[1,1,0,1].slice(0,l),[-1,1,0,1].slice(0,l)],g=[[0,1,3],[3,1,2]];this.setMeshData({positions:_f3,cells:g});}return T;}},{key:"compileSync",value:function compileSync(T,m){T=T||i["default"];var x={};function l(O){O=O.replace(/^\s*/mg,"");var A=[],R=O.match(/^#pragma\s+include\s+.*/mg);if(R){for(var b=0;b<R.length;b++){var L=R[b].match(/(?:<|")(.*)(?:>|")/);if(L){var D=L[0].indexOf("<")===0?"lib":"link";var I=L[1];if(I==="graph"&&(I="graphics"),x[I])A.push("/* included ".concat(I," */"));else if(x[I]=!0,D==="lib"){var C=l(s[I]);A.push(C);}else if(D==="link")throw new Error("Cannot load external links synchronously. Use compile instead of compileSync.");}}A.forEach(function(b){O=O.replace(/^#pragma\s+include\s+.*/m,b);});}return O;}var d=l(T),f=m?l(m):null;return this.createProgram(d,f);}},{key:"compile",value:function(){var _compile=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12(T,m){var x,l,_l2,d,f;return _regeneratorRuntime().wrap(function _callee12$(_context12){while(1)switch(_context12.prev=_context12.next){case 0:_l2=function _l4(){_l2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11(O){var A,R,b,L,D,I,C,_C3;return _regeneratorRuntime().wrap(function _callee11$(_context11){while(1)switch(_context11.prev=_context11.next){case 0:O=O.replace(/^\s*/mg,"");A=[],R=O.match(/^#pragma\s+include\s+.*/mg);if(!R){_context11.next=32;break;}b=0;case 4:if(!(b<R.length)){_context11.next=31;break;}L=R[b].match(/(?:<|")(.*)(?:>|")/);if(!L){_context11.next=28;break;}D=L[0].indexOf("<")===0?"lib":"link";I=L[1];if(!(I==="graph"&&(I="graphics"),x[I])){_context11.next=13;break;}A.push("/* included ".concat(I," */"));_context11.next=28;break;case 13:if(!(x[I]=!0,D==="lib")){_context11.next=20;break;}_context11.next=16;return l(s[I]);case 16:C=_context11.sent;A.push(C);_context11.next=28;break;case 20:if(!(D==="link")){_context11.next=28;break;}_context11.next=23;return y.fetchShader(I);case 23:_C3=_context11.sent;_context11.next=26;return l(_C3);case 26:_C3=_context11.sent;A.push(_C3);case 28:b++;_context11.next=4;break;case 31:A.forEach(function(b){O=O.replace(/^#pragma\s+include\s+.*/m,b);});case 32:return _context11.abrupt("return",O);case 33:case"end":return _context11.stop();}},_callee11);}));return _l2.apply(this,arguments);};l=function _l3(_x13){return _l2.apply(this,arguments);};T=T||i["default"];x={};_context12.next=6;return l(T);case 6:d=_context12.sent;if(!m){_context12.next=13;break;}_context12.next=10;return l(m);case 10:_context12.t0=_context12.sent;_context12.next=14;break;case 13:_context12.t0=null;case 14:f=_context12.t0;return _context12.abrupt("return",this.createProgram(d,f));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(T){var m,_args13=arguments;return _regeneratorRuntime().wrap(function _callee13$(_context13){while(1)switch(_context13.prev=_context13.next){case 0:m=_args13.length>1&&_args13[1]!==undefined?_args13[1]:null;_context13.next=3;return y.fetchShader(T);case 3:T=_context13.sent;_context13.t0=m;if(!_context13.t0){_context13.next=9;break;}_context13.next=8;return y.fetchShader(m);case 8:m=_context13.sent;case 9:return _context13.abrupt("return",this.compile(T,m));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 T=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var _ref23=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref23$wrapS=_ref23.wrapS,m=_ref23$wrapS===void 0?this.gl.CLAMP_TO_EDGE:_ref23$wrapS,_ref23$wrapT=_ref23.wrapT,x=_ref23$wrapT===void 0?this.gl.CLAMP_TO_EDGE:_ref23$wrapT,_ref23$minFilter=_ref23.minFilter,l=_ref23$minFilter===void 0?this.gl.LINEAR:_ref23$minFilter,_ref23$magFilter=_ref23.magFilter,d=_ref23$magFilter===void 0?this.gl.LINEAR:_ref23$magFilter;var f=this.gl,g=Array.isArray(T)?f.TEXTURE_CUBE_MAP:f.TEXTURE_2D;this._max_texture_image_units=this._max_texture_image_units||f.getParameter(f.MAX_COMBINED_TEXTURE_IMAGE_UNITS),f.activeTexture(f.TEXTURE0+this._max_texture_image_units-1);var O=f.createTexture();f.bindTexture(g,O),f.pixelStorei(f.UNPACK_FLIP_Y_WEBGL,!0);var _this$canvas4=this.canvas,A=_this$canvas4.width,R=_this$canvas4.height;if(T){if(g===f.TEXTURE_CUBE_MAP)for(var b=0;b<6;b++)f.texImage2D(f.TEXTURE_CUBE_MAP_POSITIVE_X+b,0,f.RGBA,f.RGBA,f.UNSIGNED_BYTE,T[b]);else f.texImage2D(g,0,f.RGBA,f.RGBA,f.UNSIGNED_BYTE,T);}else if(g===f.TEXTURE_CUBE_MAP)for(var _b=0;_b<6;_b++)this.gl.texImage2D(this.gl.TEXTURE_CUBE_MAP_POSITIVE_X+_b,0,f.RGBA,A,R,0,f.RGBA,f.UNSIGNED_BYTE,null);else f.texImage2D(g,0,f.RGBA,A,R,0,f.RGBA,f.UNSIGNED_BYTE,null);return f.texParameteri(g,f.TEXTURE_MIN_FILTER,l),f.texParameteri(g,f.TEXTURE_MAG_FILTER,d),f.texParameteri(g,f.TEXTURE_WRAP_S,m),f.texParameteri(g,f.TEXTURE_WRAP_T,x),g===f.TEXTURE_CUBE_MAP&&(T.width=T[0].width,T.height=T[0].height),f.bindTexture(g,null),O._img=T||{width:A,height:R},O["delete"]=function(){_this18.deleteTexture(O);},O;}},{key:"deleteTexture",value:function deleteTexture(T){var m=T._img;this.gl.deleteTexture(T),typeof m.close=="function"&&m.close();}},{key:"loadTexture",value:function(){var _loadTexture=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee14(T){var _ref24,_ref24$useImageBitmap,m,x,_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,m=_ref24$useImageBitmap===void 0?!0:_ref24$useImageBitmap;_context14.next=3;return y.loadImage(T,{useImageBitmap:m});case 3:x=_context14.sent;return _context14.abrupt("return",this.createTexture(x));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,T=_ref25$color===void 0?1:_ref25$color,_ref25$blend=_ref25.blend,m=_ref25$blend===void 0?!1:_ref25$blend,_ref25$depth=_ref25.depth,x=_ref25$depth===void 0?this.options.depth!==!1:_ref25$depth,_ref25$stencil=_ref25.stencil,l=_ref25$stencil===void 0?!!this.options.stencil:_ref25$stencil;var d=this.gl,f=d.createFramebuffer();d.bindFramebuffer(d.FRAMEBUFFER,f);var g=[];for(var R=0;R<T;R++){var b=this.createTexture();d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0+R,d.TEXTURE_2D,b,0/* level */),g.push(b);}f.textures=g,f.texture=g[0],f.blend=m;var _this$canvas5=this.canvas,O=_this$canvas5.width,A=_this$canvas5.height;return x&&!l&&(f.depthBuffer=d.createRenderbuffer(),d.bindRenderbuffer(d.RENDERBUFFER,f.depthBuffer),d.renderbufferStorage(d.RENDERBUFFER,d.DEPTH_COMPONENT16,O,A),d.framebufferRenderbuffer(d.FRAMEBUFFER,d.DEPTH_ATTACHMENT,d.RENDERBUFFER,f.depthBuffer)),l&&!x&&(f.stencilBuffer=d.createRenderbuffer(),d.bindRenderbuffer(d.RENDERBUFFER,f.stencilBuffer),d.renderbufferStorage(d.RENDERBUFFER,d.STENCIL_INDEX8,O,A),d.framebufferRenderbuffer(d.FRAMEBUFFER,d.STENCIL_ATTACHMENT,d.RENDERBUFFER,f.stencilBuffer)),x&&l&&(f.depthStencilBuffer=d.createRenderbuffer(),d.bindRenderbuffer(d.RENDERBUFFER,f.depthStencilBuffer),d.renderbufferStorage(d.RENDERBUFFER,d.DEPTH_STENCIL,O,A),d.framebufferRenderbuffer(d.FRAMEBUFFER,d.DEPTH_STENCIL_ATTACHMENT,d.RENDERBUFFER,f.depthStencilBuffer)),d.bindFramebuffer(d.FRAMEBUFFER,null),f;}},{key:"bindFBO",value:function bindFBO(){var T=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;this.fbo=T;}},{key:"render",value:function render(){var _ref26=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref26$clearBuffer=_ref26.clearBuffer,T=_ref26$clearBuffer===void 0?!0:_ref26$clearBuffer;this.startRender=!0;var m=this.gl;var x=this.program;x||(x=this.createProgram(),this.useProgram(x)),this.fbo&&m.bindFramebuffer(m.FRAMEBUFFER,this.fbo);var l=this.options.depth;l&&m.enable(m.DEPTH_TEST),this.gl.clear(this.gl.COLOR_BUFFER_BIT|(l?this.gl.DEPTH_BUFFER_BIT:0)|(this.options.stencil?this.gl.STENCIL_BUFFER_BIT:0));var d=this._renderFrameID;this._draw(),this.fbo&&m.bindFramebuffer(m.FRAMEBUFFER,null),this._renderFrameID===d&&(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 T=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};Object.assign(s,T);}},{key:"FLOAT",value:function FLOAT(T,m){return Object(e.pointsToBuffer)(T,Float32Array,m);}},{key:"UNSIGNED_BYTE",value:function UNSIGNED_BYTE(T,m){return Object(e.pointsToBuffer)(T,Uint8Array,m);}},{key:"UNSIGNED_SHORT",value:function UNSIGNED_SHORT(T,m){return Object(e.pointsToBuffer)(T,Uint16Array,m);}},{key:"BYTE",value:function BYTE(T,m){return Object(e.pointsToBuffer)(T,Int8Array,m);}},{key:"SHORT",value:function SHORT(T,m){return Object(e.pointsToBuffer)(T,Int16Array,m);}}]);}();o(y,"defaultOptions",{preserveDrawingBuffer:!0,autoUpdate:!0,vertexPosition:"a_vertexPosition",vertexTextureCoord:"a_vertexTextureCoord",webgl2:!1}),o(y,"UBYTE",y.UNSIGNED_BYTE),o(y,"USHORT",y.UNSIGNED_SHORT),o(y,"fetchShader",e.fetchShader),o(y,"loadImage",e.loadImage);},/* 16 */ /***/function(u,r,t){t.r(r),t.d(r,"setupWebGL",function(){return n;}),t.d(r,"createProgram",function(){return i;}),t.d(r,"pointsToBuffer",function(){return a;}),t.d(r,"loadImage",function(){return s;}),t.d(r,"fetchShader",function(){return p;}),t(1).glMatrix.setMatrixArrayType(Array);function e(h,v){var y=["webgl","experimental-webgl","webkit-3d","moz-webgl"];var M=null;for(var T=0;T<y.length;++T){try{M=h.getContext(y[T],v);}catch(_unused6){}if(M)break;}return M;}function n(h,v){var y=e(h,v);if(!y)throw new Error("Sorry, your browser doesn't support WebGL.");return y;}function i(h,v,y){var M=h.createShader(h.VERTEX_SHADER);if(h.shaderSource(M,v),h.compileShader(M),!h.getShaderParameter(M,h.COMPILE_STATUS)){var _x16="Vertex shader failed to compile. The error log is:".concat(h.getShaderInfoLog(M));throw new Error(_x16);}var T=h.createShader(h.FRAGMENT_SHADER);if(h.shaderSource(T,y),h.compileShader(T),!h.getShaderParameter(T,h.COMPILE_STATUS)){var _x17="Fragment shader failed to compile. The error log is:".concat(h.getShaderInfoLog(T));throw new Error(_x17);}var m=h.createProgram();if(h.attachShader(m,M),h.attachShader(m,T),h.linkProgram(m),!h.getProgramParameter(m,h.LINK_STATUS)){var _x18="Shader program failed to link. The error log is:".concat(h.getProgramInfoLog(m));throw new Error(_x18);}return h.deleteShader(M),h.deleteShader(T),m;}function a(h){var v=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Float32Array;var y=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;if(y&&!(y instanceof v))throw new TypeError("Wrong buffer type.");if(h==null||h instanceof v)return h;if(h[0]==null||h[0].length==null)return y?(y.set(h,0),y):new v(h);var M=h[0].length,T=h.length;y||(y=new v(M*T));var m=0;for(var _x19=0;_x19<T;_x19++)for(var _l5=0;_l5<M;_l5++)y[m++]=h[_x19][_l5];return y;}var o={};function s(h){var _ref27=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref27$useImageBitmap=_ref27.useImageBitmap,v=_ref27$useImageBitmap===void 0?!0:_ref27$useImageBitmap,_ref27$alias=_ref27.alias,y=_ref27$alias===void 0?null:_ref27$alias;if(!o[h]){if(typeof Image=="function"){var M=new Image();typeof h=="string"&&!((typeof location==="undefined"?"undefined":_typeof(location))=="object"&&/^file:/.test(location.href))&&!/^data:/.test(h)&&(M.crossOrigin="anonymous"),o[h]=new Promise(function(T){M.onload=function(){v&&typeof createImageBitmap=="function"?createImageBitmap(M,{imageOrientation:"flipY"}).then(function(m){o[h]=m,y&&(o[y]=m),T(m);}):(o[h]=M,y&&(o[y]=M),T(M));},M.src=h;}),y&&(o[y]=o[h]);}else if(typeof fetch=="function")return fetch(h,{method:"GET",mode:"cors",cache:"default"}).then(function(M){return M.blob();}).then(function(M){return createImageBitmap(M,{imageOrientation:"flipY"}).then(function(T){return o[h]=T,y&&(o[y]=T),T;});});}return o[h];}var c={};function p(_x20){return _p2.apply(this,arguments);}function _p2(){_p2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee15(h){var v,y;return _regeneratorRuntime().wrap(function _callee15$(_context15){while(1)switch(_context15.prev=_context15.next){case 0:if(!c[h]){_context15.next=2;break;}return _context15.abrupt("return",c[h]);case 2:_context15.next=4;return fetch(h);case 4:v=_context15.sent;if(!(v.status>=200&&v.status<300)){_context15.next=10;break;}_context15.next=8;return v.text();case 8:y=_context15.sent;return _context15.abrupt("return",(c[h]=y,y));case 10:throw new Error("Shader loaded error.");case 11:case"end":return _context15.stop();}},_callee15);}));return _p2.apply(this,arguments);}},/* 17 */ /***/function(u,r,t){t.r(r),r["default"]="attribute vec3 a_vertexPosition;\n\nvoid main() {\n gl_PointSize = 1.0;\n gl_Position = vec4(a_vertexPosition, 1);\n}";},/* 18 */ /***/function(u,r,t){t.r(r),r["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,r,t){t.r(r),r["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,r,t){t.r(r),t.d(r,"default",function(){return a;});var e=t(21),n=t(25);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol("transform");var a=/*#__PURE__*/function(){function a(s,c){_classCallCheck(this,a);this.context=s.getContext("2d"),this.options=c,this[i]=[1,0,0,1,0,0];}return _createClass(a,[{key:"createTexture",value:function createTexture(s){return{_img:s};}},{key:"loadTexture",value:function(){var _loadTexture2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee16(s){var c;return _regeneratorRuntime().wrap(function _callee16$(_context16){while(1)switch(_context16.prev=_context16.next){case 0:_context16.next=2;return e["default"].loadImage(s,{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(_x21){return _loadTexture2.apply(this,arguments);}return loadTexture;}()},{key:"deleteTexture",value:function deleteTexture(s){return s;}},{key:"clear",value:function clear(s,c,p,h){var v=this.context;s=s||0,c=c||0,p=p||v.canvas.width-s,h=h||v.canvas.height-c,v.clearRect(s,c,p,h);}},{key:"drawMeshCloud",value:function drawMeshCloud(s){var _ref28=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref28$clear=_ref28.clear,c=_ref28$clear===void 0?!1:_ref28$clear;var p=[];for(var h=0;h<s.amount;h++){var v=s.getTransform(h);var y=s.getTextureFrame(h);y&&(y=y._img);var M=s.getFilter(h),_s$getCloudRGBA=s.getCloudRGBA(h),T=_s$getCloudRGBA.fill,m=_s$getCloudRGBA.stroke;p.push({mesh:s.mesh,_cloudOptions:[T,m,y,v,M]});}s.beforeRender&&s.beforeRender(this.context,s),this.drawMeshes(p,{clear:c,hook:!1}),s.afterRender&&s.afterRender(this.context,s);}},{key:"drawMeshes",value:function drawMeshes(s){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,p=_ref29$hook===void 0?!0:_ref29$hook;var h=this.context;c&&h.clearRect(0,0,h.canvas.width,h.canvas.height);var v=null;var _h$canvas=h.canvas,y=_h$canvas.width,M=_h$canvas.height,T=s.length;s.forEach(function(m,x){var _m$_cloudOptions,_this19$filterBuffer;var l,d,f,g,O;p&&m.beforeRender&&m.beforeRender(h,m),m._cloudOptions&&((_m$_cloudOptions=_slicedToArray(m._cloudOptions,5),l=_m$_cloudOptions[0],d=_m$_cloudOptions[1],f=_m$_cloudOptions[2],g=_m$_cloudOptions[3],O=_m$_cloudOptions[4]),m=m.mesh);var A=m.filter;if(O&&(A=A?"".concat(A," ").concat(O):O),A&&!_this19.filterBuffer&&_this19.filterBuffer!==!1){var R=e["default"].createCanvas(y,M);R?_this19.filterBuffer=R.getContext("2d"):_this19.filterBuffer=!1;}v&&v!==A&&(Object(n.applyFilter)(_this19.filterBuffer,v),h.drawImage(_this19.filterBuffer.canvas,0,0,y,M),_this19.filterBuffer.clearRect(0,0,y,M),v=null),A&&_this19.filterBuffer?(_this19.filterBuffer.save(),(_this19$filterBuffer=_this19.filterBuffer).transform.apply(_this19$filterBuffer,_toConsumableArray(_this19[i])),Object(n.drawMesh2D)(m,_this19.filterBuffer,!1,l,d,f,g),_this19.filterBuffer.restore(),x===T-1?(Object(n.applyFilter)(_this19.filterBuffer,A),h.drawImage(_this19.filterBuffer.canvas,0,0,y,M),_this19.filterBuffer.clearRect(0,0,y,M)):v=A):(h.save(),h.transform.apply(h,_toConsumableArray(_this19[i])),Object(n.drawMesh2D)(m,h,!1,l,d,f,g),h.restore()),p&&m.afterRender&&m.afterRender(h,m);});}},{key:"setTransform",value:function setTransform(s){this[i]=s;}}]);}();},/* 21 */ /***/function(u,r,t){t.r(r),function(e){var n=t(14),i=t(23),a=t(24);t(1).glMatrix.setMatrixArrayType(Array);var o={};function s(y,M){var T=y.style,m=y.variant,x=y.weight,l=y.stretch,d=y.size,f=y.pxLineHeight,g=y.family;return l==="normal"?"".concat(T," ").concat(m," ").concat(x," ").concat(d*M,"px/").concat(f*M,"px ").concat(g):"".concat(T," ").concat(m," ").concat(x," ").concat(l," ").concat(d*M,"px/").concat(f*M,"px ").concat(g);}function c(y,_ref30){var M=_ref30.font,T=_ref30.fillColor,m=_ref30.strokeColor,x=_ref30.strokeWidth,_ref30$ratio=_ref30.ratio,l=_ref30$ratio===void 0?1:_ref30$ratio,d=_ref30.textCanvas,_ref30$cachable=_ref30.cachable,f=_ref30$cachable===void 0?!1:_ref30$cachable;var g;if(f){g=[y,M,String(T),String(m),String(x)].join("###");var G=o[g];if(G)return G;}d||(d=h(1,1));var O=d.getContext("2d");O.save(),O.font=M;var _O$measureText=O.measureText(y),A=_O$measureText.width;O.restore();var R=Object(i["default"])(M),b=Math.max(R.pxLineHeight,R.pxHeight*1.13);/italic|oblique/.test(M)&&(A+=b*Math.tan(15*Math.PI/180)),!T&&!m&&(T="#000");var P=O.canvas,L=Math.ceil(A),D=Math.ceil(b);P.width=Math.round(L*l),P.height=Math.round(D*l),O.save(),O.font=s(R,l),O.textAlign="center",O.textBaseline="middle";var I=P.height*0.5+R.pxHeight*0.05*l,C=P.width*0.5;if(T){if(Array.isArray(T))T=Object(a["default"])(T);else if(T.vector){var _G;var _T=T,H=_T.vector,X=_T.colors;H.length===6?_G=O.createRadialGradient.apply(O,_toConsumableArray(H)):_G=O.createLinearGradient.apply(O,_toConsumableArray(H)),X.forEach(function(_ref31){var Z=_ref31.offset,W=_ref31.color;_G.addColorStop(Z,W);}),T=_G;}O.fillStyle=T,O.fillText(y,C,I);}if(m){if(O.lineWidth=x*l,Array.isArray(m))m=Object(a["default"])(m);else if(m.vector){var _G2;var _m=m,_H=_m.vector,_X=_m.colors;_H.length===6?_G2=O.createRadialGradient.apply(O,_toConsumableArray(_H)):_G2=O.createLinearGradient.apply(O,_toConsumableArray(_H)),_X.forEach(function(_ref32){var Z=_ref32.offset,W=_ref32.color;_G2.addColorStop(Z,W);}),m=_G2;}O.strokeStyle=m,O.strokeText(y,C,I);}O.restore();var B={image:d,rect:[0,0,L,D]};return f&&(o[g]=B),B;}var p=!1;if((typeof navigator==="undefined"?"undefined":_typeof(navigator))=="object"&&typeof navigator.userAgent=="string"){var y=navigator.userAgent.toLowerCase().match(/chrome\/(\d+)/);y&&(p=Number(y[1])<70);}function h(y,M){var T=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var m=T.offscreen||!p&&T.offscreen!==!1;var x;return _typeof(e)<"u"&&typeof e.createCanvas=="function"?x=e.createCanvas(y,M,T):m&&typeof OffscreenCanvas=="function"?x=new OffscreenCanvas(y,M):(x=document.createElement("canvas"),x.width=y,x.height=M),x;}var v={createCanvas:h,createText:c,loadImage:n["default"].loadImage};r["default"]=v;}.call(this,t(22));},/* 22 */ /***/function(u,r){var t;t=/* @__PURE__ */function(){return this;}();try{t=t||new Function("return this")();}catch(_unused7){(typeof window==="undefined"?"undefined":_typeof(window))=="object"&&(t=window);}u.exports=t;},/* 23 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return T;}),t(1).glMatrix.setMatrixArrayType(Array);function e(m,x){if(typeof m=="string"){var f=m.trim().match(/^([\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin|%)$/);f?m={size:parseFloat(f[1]),unit:f[2]}:m={size:parseInt(m,10),unit:"px"};}var _m2=m,l=_m2.size,d=_m2.unit;if(d==="pt")l/=0.75;else if(d==="pc")l*=16;else if(d==="in")l*=96;else if(d==="cm")l*=96/2.54;else if(d==="mm")l*=96/25.4;else if(d==="em"||d==="rem"||d==="ex"){if(!x&&typeof getComputedStyle=="function"&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _f4=getComputedStyle(document.documentElement).fontSize;x=e(_f4,16);}l*=x,d==="ex"&&(l/=2);}else if(d==="q")l*=96/25.4/4;else if(d==="vw"||d==="vh"){if((typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _f5=d==="vw"?document.documentElement.clientWidth:document.documentElement.clientHeight;l*=_f5/100;}}else if((d==="vmax"||d==="vmin")&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _f6=document.documentElement.clientWidth,g=document.documentElement.clientHeight;d==="vmax"?l*=Math.max(_f6,g)/100:l*=Math.min(_f6,g)/100;}return l;}var n="bold|bolder|lighter|[1-9]00",i="italic|oblique",a="small-caps",o="ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded",s="px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin|%",c="'([^']+)'|\"([^\"]+)\"|([\\w-]|[\u4E00-\u9FA5])+",p=new RegExp("(".concat(n,") +"),"i"),h=new RegExp("(".concat(i,") +"),"i"),v=new RegExp("(".concat(a,") +"),"i"),y=new RegExp("(".concat(o,") +"),"i"),M=new RegExp("([\\d\\.]+)("+s+")(?:\\/([\\d\\.]+)("+s+"))? *((?:"+c+")( *, *(?:"+c+"))*)");function T(m,x){var l=M.exec(m);if(!l)return;var d=parseFloat(l[3]),f={weight:"normal",style:"normal",stretch:"normal",variant:"normal",size:parseFloat(l[1]),unit:l[2],lineHeight:Number.isFinite(d)?d:void 0,lineHeightUnit:l[4],family:l[5].replace(/ *, */g,",")},g=m.substring(0,l.index),O=p.exec(g),A=h.exec(g),R=v.exec(g),b=y.exec(g);return O&&(f.weight=O[1]),A&&(f.style=A[1]),R&&(f.variant=R[1]),b&&(f.stretch=b[1]),f.pxHeight=e({size:f.size,unit:f.unit},x),f.pxLineHeight=e({size:f.lineHeight||f.size,unit:f.lineHeightUnit||f.unit},x),f;}},/* 24 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return e;}),t(1).glMatrix.setMatrixArrayType(Array);function e(n){return"rgba(".concat(n.map(function(i,a){return a<3?Math.round(i*255):i;}).join(),")");}},/* 25 */ /***/function(u,r,t){t.r(r),t.d(r,"applyFilter",function(){return o;}),t.d(r,"drawMesh2D",function(){return c;});var e=t(1),n=t(24),i=t(23),a=t(26);t(1).glMatrix.setMatrixArrayType(Array);function o(p,h){var v=p.canvas;p.save(),p.filter=h,p.drawImage(v,0,0,v.width,v.height),p.restore();}function s(p,h){var v=/rgba\((\d+),(\d+),(\d+),(\d+)\)/;p=p.match(v).slice(1,5).map(Number),h=h.match(v).slice(1,5).map(Number);var y=[],M=h[3];for(var T=0;T<4;T++)y[T]=Object(a.mix)(p[T],h[T],M);return"rgba(".concat(y.join(),")");}function c(p,h){var v=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var y=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;var M=arguments.length>4&&arguments[4]!==undefined?arguments[4]:null;var T=arguments.length>5&&arguments[5]!==undefined?arguments[5]:null;var m=arguments.length>6&&arguments[6]!==undefined?arguments[6]:null;h.save();var x=!1,l=!1;if(h.globalAlpha=p.getOpacity(),p._updateMatrix&&p.transformScale/p.contours.scale>1.5&&p.accurate(p.transformScale),p.lineWidth){var g=p.gradient&&p.gradient.stroke;if(g){var _g3=g,O=_g3.vector,A=_g3.colors;if(O.length===6)g=h.createRadialGradient.apply(h,_toConsumableArray(O));else if(O.length===4)g=h.createLinearGradient.apply(h,_toConsumableArray(O));else if(O.length===3)g=h.createCircularGradient.apply(h,_toConsumableArray(O));else throw new TypeError("Invalid vector dimension.");A.forEach(function(_ref33){var R=_ref33.offset,b=_ref33.color;var P=Object(n["default"])(b);M&&(P=s(P,M)),g.addColorStop(R,P);}),h.strokeStyle=g,x=!0;}else p.strokeStyle&&(M?h.strokeStyle=s(p.strokeStyle,M):h.strokeStyle=p.strokeStyle,x=!0);}x&&(h.lineWidth=p.lineWidth,h.lineJoin=p.lineJoin,h.lineCap=p.lineCap,h.miterLimit=p.miterLimit,p.lineDash&&(h.setLineDash(p.lineDash),p.lineDashOffset&&(h.lineDashOffset=p.lineDashOffset)));var d=p.gradient&&p.gradient.fill;if(d){var _d8=d,_g4=_d8.vector,_O2=_d8.colors;if(_g4.length===6)d=h.createRadialGradient.apply(h,_toConsumableArray(_g4));else if(_g4.length===4)d=h.createLinearGradient.apply(h,_toConsumableArray(_g4));else if(_g4.length===3)d=h.createCircularGradient.apply(h,_toConsumableArray(_g4));else throw new TypeError("Invalid vector dimension.");_O2.forEach(function(_ref34){var A=_ref34.offset,R=_ref34.color;var b=Object(n["default"])(R);M&&(b=s(b,M)),d.addColorStop(A,b);}),h.fillStyle=d,l=!0;}else p.fillStyle&&(y?h.fillStyle=s(p.fillStyle,y):h.fillStyle=p.fillStyle,l=!0);if(m&&h.transform.apply(h,_toConsumableArray(m)),h.transform.apply(h,_toConsumableArray(p.transformMatrix)),p.clipPath){var _g5=p.clipPath,_O3=new Path2D(_g5);h.clip(_O3);}var f=p.contours.length;if(p.contours.forEach(function(g,O){var A=g.length,R=A>1&&e.vec2.equals(g[0],g[A-1]),b=O===f-1&&p.texture;if(g&&A>0){if(l||x||b){h.beginPath(),h.moveTo.apply(h,_toConsumableArray(g[0]));for(var P=1;P<A;P++)P===A-1&&R?h.closePath():h.lineTo.apply(h,_toConsumableArray(g[P]));}if(l&&h.fill(p.fillRule),b){h.save(),h.clip();var _p$texture=p.texture,_P=_p$texture.image,L=_p$texture.options;if(T&&(_P=T),L.repeat&&console.warn("Context 2D not supported image repeat yet."),_P.font){L.scale&&console.warn("Context 2D not supported text scale yet."),L.srcRect&&console.warn("Context 2D not supported text srcRect yet.");var _P2=_P,D=_P2.font,I=_P2.fillColor,C=_P2.strokeColor,B=_P2.strokeWidth,G=_P2.text;!I&&!C&&(I="#000"),Array.isArray(I)&&(I=Object(n["default"])(I)),Array.isArray(C)&&(C=Object(n["default"])(C)),h.font=D;var _h$measureText=h.measureText(G),H=_h$measureText.width,X=Object(i["default"])(D),Z=Math.max(X.pxLineHeight,X.pxHeight*1.13);h.textAlign="center",h.textBaseline="middle";var W=L.rect,z=W[0]+Z*0.5+X.pxHeight*0.06,Q=W[1]+H*0.5;W[2]!=null&&h.scale(W[2]/H,W[3]/Z),I&&(h.fillStyle=I,h.fillText(G,Q,z)),C&&(h.lineWidth=B,h.strokeStyle=C,h.strokeText(G,Q,z));}else{var _D2=L.rect;var _I=L.srcRect;L.scale&&(_D2=[0,0,h.canvas.width,h.canvas.height]),L.rotated&&_D2&&(_D2=[-_D2[1],_D2[0],_D2[3],_D2[2]]),_I&&(_D2=_D2||[0,0,_I[2],_I[3]]),L.rotated&&(h.translate(0,_D2?_D2[2]:_P.width),h.rotate(-0.5*Math.PI)),_I?h.drawImage.apply(h,[_P].concat(_toConsumableArray(_I),_toConsumableArray(_D2))):_D2?h.drawImage.apply(h,[_P].concat(_toConsumableArray(_D2))):h.drawImage(_P,0,0);}h.restore();}x&&h.stroke();}}),h.restore(),v){var _g6=p.filter;_g6&&o(h,_g6);}}},/* 26 */ /***/function(u,r,t){t.r(r),t.d(r,"clamp",function(){return e;}),t.d(r,"mix",function(){return n;}),t.d(r,"transformPoint",function(){return i;}),t(1).glMatrix.setMatrixArrayType(Array);function e(a,o,s){var _ref35;return o>s&&(_ref35=[s,o],o=_ref35[0],s=_ref35[1],_ref35),a<o?o:a>s?s:a;}function n(a,o,s){return a*(1-s)+o*s;}function i(a,o){var _a2=_slicedToArray(a,2),s=_a2[0],c=_a2[1];return[s*o[0]+c*o[2]+o[4],s*o[1]+c*o[3]+o[5]];}},/* 27 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return s;});var e=t(28),n=t(29);t(1).glMatrix.setMatrixArrayType(Array);function i(c,p,h){var v=c.uniforms||{},y=p.uniforms||{};if(v.u_texSampler&&y.u_texSampler&&v.u_texSampler!==y.u_texSampler)return!1;var M=Object.keys(v),T=Object.keys(y),m=M.indexOf("u_texSampler"),x=T.indexOf("u_texSampler");if(m>=0&&M.splice(m,1),x>=0&&T.splice(x,1),M.length!==T.length)return!1;var l=M.every(function(d){var f=v[d],g=y[d];if(f===g)return!0;if(f.length&&g.length&&f.length===g.length){for(var O=0;O<f.length;O++)if(f[O]!==g[O])return!1;return!0;}return!1;});if(l){if(v.u_texSampler&&!y.u_texSampler)p.setTexture(v.u_texSampler,{hidden:!0});else if(!v.u_texSampler&&y.u_texSampler)for(var d=0;d<h.length;d++)h[d].setTexture(y.u_texSampler,{hidden:!0});}return l;}var a={};function o(c,p){if(c.length){var h=Object(e["default"])(c,a);return h.enableBlend=p,c[0].filterCanvas&&(h.filterCanvas=!0),h.packIndex=c[0].packIndex,h.packLength=c.length,h.beforeRender=c[0].beforeRender,h.pass=c[0].pass,h.afterRender=c[c.length-1].afterRender,c.length=0,h;}}function s(c,p){var h=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;return/*#__PURE__*/_regeneratorRuntime().mark(function _callee17(){var v,y,M,T,m,_x22,_l6,f,d,_f7,g;return _regeneratorRuntime().wrap(function _callee17$(_context17){while(1)switch(_context17.prev=_context17.next){case 0:v=[],y=c.options.bufferSize;M=0,T=!1;m=0;case 3:if(!(m<p.length)){_context17.next=47;break;}_x22=p[m];if(!(_x22 instanceof n["default"])){_context17.next=16;break;}_context17.t0=v.length;if(!_context17.t0){_context17.next=10;break;}_context17.next=10;return o(v,T);case 10:M=0;T=!1;_context17.next=14;return _x22;case 14:_context17.next=44;break;case 16:_l6=_x22.meshData;if(_l6.clipPath&&!_l6.uniforms.u_clipSampler){f=c.createTexture(_l6.clipPath);_l6.uniforms.u_clipSampler=f;}d=0;if(!((!h||!_x22.canIgnore())&&_l6&&_l6.positions.length)){_context17.next=40;break;}_x22.packIndex=m;_f7=_x22.filterCanvas;if(!(d=_l6.positions.length,_f7||M+d>y)){_context17.next=31;break;}_context17.t1=v.length;if(!_context17.t1){_context17.next=27;break;}_context17.next=27;return o(v,T);case 27:M=0;T=!1;_context17.next=39;break;case 31:if(!M){_context17.next=39;break;}g=v[v.length-1];_context17.t2=g&&(g.filterCanvas||g.afterRender||_x22.beforeRender||g.pass.length||_x22.pass.length||g.program!==_x22.program||!i(g,_x22,v));if(!_context17.t2){_context17.next=39;break;}_context17.next=37;return o(v,T);case 37:M=0;T=!1;case 39:v.push(_x22),T=T||_x22.enableBlend,M+=d;case 40:_context17.t3=m===p.length-1&&v.length;if(!_context17.t3){_context17.next=44;break;}_context17.next=44;return o(v,T);case 44:m++;_context17.next=3;break;case 47:case"end":return _context17.stop();}},_callee17);})();}},/* 28 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return i;}),t(1).glMatrix.setMatrixArrayType(Array);var e={UNSIGNED_BYTE:Uint8Array,UNSIGNED_SHORT:Uint16Array,BYTE:Int8Array,SHORT:Int16Array,FLOAT:Float32Array};function n(a,o){var s=0,c=0,p=0,h=0,v=0,y=0,M=0;var T=a[0].program;for(var m=0;m<a.length;m++){var _x23=a[m].meshData;if(_x23){M+=_x23.positions.length;var _l7=_x23.positions[0].length;s+=_x23.positions.length*_l7,c+=_x23.cells.length*3,y+=_x23.attributes.a_color.length*4;var d=_x23.textureCoord;d&&(p+=d.length*d[0].length);var f=_x23.attributes.a_sourceRect;f&&(h+=f.length*4);var g=_x23.attributes.a_clipUV;g&&(v+=g.length*2);}}if((!o.positions||o.positions.length<s)&&(o.positions=new Float32Array(s)),(!o.cells||o.cells.length<c)&&(o.cells=new Uint16Array(c)),p&&(!o.textureCoord||o.textureCoord.length<p)&&(o.textureCoord=new Float32Array(p)),(!o.a_color||o.a_color.length<y)&&(o.a_color=new Uint8Array(y)),h&&(!o.a_sourceRect||o.a_sourceRect.length<h)&&(o.a_sourceRect=new Float32Array(h)),v&&(!o.a_clipUV||o.a_clipUV.length<v)&&(o.a_clipUV=new Float32Array(v)),T){var _m3=Object.entries(T._attribute),_x24=T._attribOpts||{};for(var _l8=0;_l8<_m3.length;_l8++){var _m3$_l=_slicedToArray(_m3[_l8],2),_d9=_m3$_l[0],_f8=_m3$_l[1];if(_d9!=="a_color"&&_d9!=="a_sourceRect"&&_f8!=="ignored"){var _g7=_x24[_d9]?_x24[_d9].type:"FLOAT",O=e[_g7],A=_f8.size*M;(!o[_d9]||o[_d9].length<A)&&(o[_d9]=new O(A));}}}return o;}function i(a,o){var s=[],c=[],p=[],h=[],v=[],y=[],M=0,T=0;var m=a[0]?a[0].uniforms||{}:{},x=a[0]?a[0].program:null;o&&(n(a,o),c=o.cells,s=o.positions,p=o.textureCoord,h=o.a_color,v=o.a_sourceRect,y=o.a_clipUV);var l=!1,d=!1;var f={};for(var O=0;O<a.length;O++){var A=a[O];if(A){var _s2,_h2,_v,_y,_p3;if(A.meshData&&(A=A.meshData),o){var b=A.positions;for(var P=0;P<b.length;P++){var L=b[P],D=3*(M+P);for(var I=0;I<L.length;I++)s[D+I]=L[I];}}else(_s2=s).push.apply(_s2,_toConsumableArray(A.positions));var R=A.cells;for(var _b2=0;_b2<R.length;_b2++){var _P3=R[_b2];if(o){var _L=3*(T+_b2);c[_L]=_P3[0]+M,c[_L+1]=_P3[1]+M,c[_L+2]=_P3[2]+M;}else c.push([_P3[0]+M,_P3[1]+M,_P3[2]+M]);}if(o){var _b3=A.attributes.a_color;for(var _P4=0;_P4<_b3.length;_P4++){var _L2=_b3[_P4],_D3=4*(M+_P4);h[_D3]=_L2[0],h[_D3+1]=_L2[1],h[_D3+2]=_L2[2],h[_D3+3]=_L2[3];}}else(_h2=h).push.apply(_h2,_toConsumableArray(A.attributes.a_color));if(A.attributes.a_sourceRect)if(l=!0,o){var _b4=A.attributes.a_sourceRect;for(var _P5=0;_P5<_b4.length;_P5++){var _L3=_b4[_P5],_D4=4*(M+_P5);v[_D4]=_L3[0],v[_D4+1]=_L3[1],v[_D4+2]=_L3[2],v[_D4+3]=_L3[3];}}else(_v=v).push.apply(_v,_toConsumableArray(A.attributes.a_sourceRect));if(A.attributes.a_clipUV)if(d=!0,o){var _b5=A.attributes.a_clipUV;for(var _P6=0;_P6<_b5.length;_P6++){var _L4=_b5[_P6],_D5=2*(M+_P6);y[_D5]=_L4[0],y[_D5+1]=_L4[1];}}else(_y=y).push.apply(_y,_toConsumableArray(A.attributes.a_clipUV));if(A.textureCoord)if(o){var _b6=A.textureCoord;for(var _P7=0;_P7<_b6.length;_P7++){var _L5=_b6[_P7],_D6=3*(M+_P7);for(var _I2=0;_I2<_L5.length;_I2++)p[_D6+_I2]=_L5[_I2];}}else(_p3=p).push.apply(_p3,_toConsumableArray(A.textureCoord));if(x){var _b7=Object.entries(x._attribute);for(var _P8=0;_P8<_b7.length;_P8++){var _f$_L;var _b7$_P=_slicedToArray(_b7[_P8],2),_L6=_b7$_P[0],_D7=_b7$_P[1];if(_L6!=="a_color"&&_L6!=="a_sourceRect"&&_D7!=="ignored")if(f[_L6]=[],o){f[_L6]=o[_L6];var _I3=A.attributes[_L6],C=_I3[0].length;for(var B=0;B<_I3.length;B++){var G=_I3[B],H=C*(M+B);for(var X=0;X<G.length;X++)f[_L6][H+X]=G[X];}}else(_f$_L=f[_L6]).push.apply(_f$_L,_toConsumableArray(A.attributes[_L6]));}}M+=A.positions.length,T+=A.cells.length;}}f.a_color=h,l&&v&&v.length>0&&(f.a_sourceRect=v);var g={positions:s,cells:c,attributes:f,uniforms:m,cellsCount:T*3,program:x};return p&&p.length&&(g.textureCoord=p),d&&y.length>0&&(f.a_clipUV=y),g;}},/* 29 */ /***/function(u,r,t){t.r(r);var e=t(1),n=t(30),i=t(26),a=t(31);t(1).glMatrix.setMatrixArrayType(Array);function o(f,g){var O=Object.keys(f);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(f);g&&(A=A.filter(function(R){return Object.getOwnPropertyDescriptor(f,R).enumerable;})),O.push.apply(O,A);}return O;}function s(f){for(var g=1;g<arguments.length;g++){var O=arguments[g]!=null?arguments[g]:{};g%2?o(Object(O),!0).forEach(function(A){c(f,A,O[A]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(O)):o(Object(O)).forEach(function(A){Object.defineProperty(f,A,Object.getOwnPropertyDescriptor(O,A));});}return f;}function c(f,g,O){return g in f?Object.defineProperty(f,g,{value:O,enumerable:!0,configurable:!0,writable:!0}):f[g]=O,f;}var p=Symbol("mesh"),h=Symbol("count"),v=Symbol("blend"),y=Symbol("filter"),M=Symbol("textures"),T=Symbol("textureOptions"),m=Symbol("cloudColor"),x=Symbol("cloudFilter"),l=Symbol("buffer");function d(f){var g=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var O=new Float32Array(3*f),A=new Float32Array(3*f),R=new Float32Array(4*f),b=new Float32Array(4*f),P=new Float32Array(4*f),L=new Float32Array(4*f),D=new Float32Array(4*f),I=new Uint8Array(f),C=new Uint8Array(4*f),B=new Uint8Array(4*f);return g&&(O.set(g.transform0,0),A.set(g.transform1,0),R.set(g.color0,0),b.set(g.color1,0),P.set(g.color2,0),L.set(g.color3,0),D.set(g.color4,0),I.set(g.frameIndex,0),C.set(g.fillColor,0),B.set(g.strokeColor,0)),{bufferSize:f,transform0:O,transform1:A,color0:R,color1:b,color2:P,color3:L,color4:D,frameIndex:I,fillColor:C,strokeColor:B};}r["default"]=/*#__PURE__*/function(){function _class(f){var g=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;var _ref36=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},_ref36$buffer=_ref36.buffer,O=_ref36$buffer===void 0?1e3:_ref36$buffer;_classCallCheck(this,_class);O=Math.max(O,g),this[h]=g,this[p]=f,this[l]=d(O),this[M]=[],this[y]=[],this[m]=!1,this[x]=!1,this[v]=!1,this.initBuffer();}return _createClass(_class,[{key:"initBuffer",value:function initBuffer(){var f=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var g=this[h];for(var O=f;O<g;O++)this[l].transform0.set([1,0,0],O*3),this[l].transform1.set([0,1,0],O*3),this[l].frameIndex.set([-1],O),this[l].fillColor.set([0,0,0,0],O*4),this[l].strokeColor.set([0,0,0,0],O*4),this.setColorTransform(O,null);}},{key:"bufferSize",get:function get(){return this[l].bufferSize;}},{key:"mesh",get:function get(){return this[p];},set:function set(f){this[p]=f,this[M]&&this.setTextureFrames(this[M],this[T]);}},{key:"hasCloudColor",get:function get(){return this[m];}},{key:"hasCloudFilter",get:function get(){return this[x];}},{key:"_getFilter",value:function _getFilter(f){return this[y][f]=this[y][f]||[],this[y][f];}},{key:"getFilter",value:function getFilter(f){return this._getFilter(f).join(" ");}},{key:"enableBlend",get:function get(){return this[p].enableBlend||this[v];}},{key:"canIgnore",value:function canIgnore(){return this[p].canIgnore();}},{key:"delete",value:function _delete(f){if(f>=this[h]||f<0)throw new Error("Out of range.");var _this$l2=this[l],g=_this$l2.transform0,O=_this$l2.transform1,A=_this$l2.color0,R=_this$l2.color1,b=_this$l2.color2,P=_this$l2.color3,L=_this$l2.color4,D=_this$l2.frameIndex,I=_this$l2.fillColor,C=_this$l2.strokeColor;g.set(g.subarray(3*(f+1)),3*f),O.set(O.subarray(3*(f+1)),3*f),A.set(A.subarray(4*(f+1)),4*f),R.set(R.subarray(4*(f+1)),4*f),b.set(b.subarray(4*(f+1)),4*f),P.set(P.subarray(4*(f+1)),4*f),L.set(L.subarray(4*(f+1)),4*f),D.set(D.subarray(f+1),f),I.set(I.subarray(4*(f+1)),4*f),C.set(C.subarray(4*(f+1)),4*f);for(var B in this[y])B===f?delete this[y][B]:B>f&&(this[y][B-1]=this[y][B],delete this[y][B]);this[h]--;}},{key:"setColorTransform",value:function setColorTransform(f,g){if(f>=this[h]||f<0)throw new Error("Out of range.");f*=4;var _this$l3=this[l],O=_this$l3.color0,A=_this$l3.color1,R=_this$l3.color2,b=_this$l3.color3,P=_this$l3.color4;return g!=null?(O.set([g[0],g[5],g[10],g[15]],f),A.set([g[1],g[6],g[11],g[16]],f),R.set([g[2],g[7],g[12],g[17]],f),b.set([g[3],g[8],g[13],g[18]],f),P.set([g[4],g[9],g[14],g[19]],f),this[v]=this[v]||g[18]<1,this[x]=!0):(O.set([1,0,0,0],f),A.set([0,1,0,0],f),R.set([0,0,1,0],f),b.set([0,0,0,1],f),P.set([0,0,0,0],f)),this;}},{key:"getColorTransform",value:function getColorTransform(f){if(f>=this[h]||f<0)throw new Error("Out of range.");f*=4;var _this$l4=this[l],g=_this$l4.color0,O=_this$l4.color1,A=_this$l4.color2,R=_this$l4.color3,b=_this$l4.color4;return[g[f],O[f],A[f],R[f],b[f],g[f+1],O[f+1],A[f+1],R[f+1],b[f+1],g[f+2],O[f+2],A[f+2],R[f+2],b[f+2],g[f+3],O[f+3],A[f+3],R[f+3],b[f+3]];}},{key:"transformColor",value:function transformColor(f,g){var O=this.getColorTransform(f);return O=Object(n.multiply)(O,g),this.setColorTransform(f,O),this;}},{key:"setFillColor",value:function setFillColor(f,g){if(f>=this[h]||f<0)throw new Error("Out of range.");typeof g=="string"&&(g=Object(a["default"])(g)),g[3]>0&&(this[m]=!0),this[l].fillColor.set(g.map(function(O){return Math.round(255*O);}),4*f);}},{key:"setStrokeColor",value:function setStrokeColor(f,g){if(f>=this[h]||f<0)throw new Error("Out of range.");typeof g=="string"&&(g=Object(a["default"])(g)),g[3]>0&&(this[m]=!0),this[l].strokeColor.set(g.map(function(O){return Math.round(255*O);}),4*f);}},{key:"getCloudRGBA",value:function getCloudRGBA(f){if(f>=this[h]||f<0)throw new Error("Out of range.");f*=4;var _this$l5=this[l],g=_this$l5.fillColor,O=_this$l5.strokeColor,A=[g[f],g[f+1],g[f+2],g[f+3]],R=[O[f],O[f+1],O[f+2],O[f+3]];return A[3]/=255,R[3]/=255,{fill:"rgba(".concat(A.join(),")"),stroke:"rgba(".concat(R.join(),")")};}},{key:"grayscale",value:function grayscale(f,g){this.transformColor(f,Object(n.grayscale)(g)),this._getFilter(f).push("grayscale(".concat(100*g,"%)"));}},{key:"brightness",value:function brightness(f,g){this.transformColor(f,Object(n.brightness)(g)),this._getFilter(f).push("brightness(".concat(100*g,"%)"));}},{key:"saturate",value:function saturate(f,g){this.transformColor(f,Object(n.saturate)(g)),this._getFilter(f).push("saturate(".concat(100*g,"%)"));}},{key:"contrast",value:function contrast(f,g){this.transformColor(f,Object(n.contrast)(g)),this._getFilter(f).push("contrast(".concat(100*g,"%)"));}},{key:"invert",value:function invert(f,g){this.transformColor(f,Object(n.invert)(g)),this._getFilter(f).push("invert(".concat(100*g,"%)"));}},{key:"sepia",value:function sepia(f,g){this.transformColor(f,Object(n.sepia)(g)),this._getFilter(f).push("sepia(".concat(100*g,"%)"));}},{key:"opacity",value:function opacity(f,g){this.transformColor(f,Object(n.opacity)(g)),this._getFilter(f).push("opacity(".concat(100*g,"%)"));}},{key:"hueRotate",value:function hueRotate(f,g){this.transformColor(f,Object(n.hueRotate)(g)),this._getFilter(f).push("hue-rotate(".concat(g,"deg)"));}},{key:"setTransform",value:function setTransform(f,g){if(f>=this[h]||f<0)throw new Error("Out of range.");f*=3,g==null&&(g=[1,0,0,1,0,0]);var _this$l6=this[l],O=_this$l6.transform0,A=_this$l6.transform1;return O.set([g[0],g[2],g[4]],f),A.set([g[1],g[3],g[5]],f),this;}},{key:"getTransform",value:function getTransform(f){if(f>=this[h]||f<0)throw new Error("Out of range.");f*=3;var _this$l7=this[l],g=_this$l7.transform0,O=_this$l7.transform1;return[g[f],O[f],g[f+1],O[f+1],g[f+2],O[f+2]];}},{key:"getTextureFrame",value:function getTextureFrame(f){return this[M][this[l].frameIndex[f]];}},{key:"setTextureFrames",value:function setTextureFrames(){var f=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var g=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(f.length>12)throw new Error("Max frames exceed. Allow 12 frames.");f.length&&this[p].setTexture(f[0],g),this[M]=f,this[T]=g;}},{key:"setFrameIndex",value:function setFrameIndex(f,g){if(f>=this[h]||f<0)throw new Error("Out of range.");var O=this[M].length;if(O<=0)throw new Error("No frames");this[l].frameIndex[f]=g%O;}},{key:"amount",get:function get(){return this[h];},set:function set(f){var g=this[h];f!==g&&(f>this[l].bufferSize&&(this[l]=d(Math.max(f,this[l].bufferSize+1e3),this[l])),this[h]=f,f>g&&this.initBuffer(g));}},{key:"meshData",get:function get(){var _this$p$meshData=this[p].meshData,f=_this$p$meshData.attributes,g=_this$p$meshData.cells,O=_this$p$meshData.positions,A=_this$p$meshData.textureCoord,R=_this$p$meshData.uniforms,b=this[M],P={attributes:s({},f),cells:g,positions:O,textureCoord:A,uniforms:s({},R),instanceCount:this[h],enableBlend:this.enableBlend};b.length&&b.forEach(function(z,Q){P.uniforms["u_texFrame".concat(Q)]=z;});var _this$l8=this[l],L=_this$l8.transform0,D=_this$l8.transform1,I=_this$l8.color0,C=_this$l8.color1,B=_this$l8.color2,G=_this$l8.color3,H=_this$l8.color4,X=_this$l8.fillColor,Z=_this$l8.strokeColor,W=_this$l8.frameIndex;return this[p].uniforms.u_texSampler&&(P.attributes.a_frameIndex={data:W,divisor:1}),P.attributes.a_transform0={data:L,divisor:1},P.attributes.a_transform1={data:D,divisor:1},P.attributes.a_colorCloud0={data:I,divisor:1},P.attributes.a_colorCloud1={data:C,divisor:1},P.attributes.a_colorCloud2={data:B,divisor:1},P.attributes.a_colorCloud3={data:G,divisor:1},P.attributes.a_colorCloud4={data:H,divisor:1},this.hasCloudColor&&(P.attributes.a_fillCloudColor={data:X,divisor:1},P.attributes.a_strokeCloudColor={data:Z,divisor:1}),P;}},{key:"setProgram",value:function setProgram(f){this[p].setProgram(f);}},{key:"program",get:function get(){return this[p].program;}},{key:"transform",value:function transform(f,g){var O=this.getTransform(f);return g=e.mat2d.multiply(Array.of(0,0,0,0,0,0),O,g),this.setTransform(f,g),this;}},{key:"translate",value:function translate(f,_ref37){var _ref38=_slicedToArray(_ref37,2),g=_ref38[0],O=_ref38[1];var A=e.mat2d.create();return A=e.mat2d.translate(Array.of(0,0,0,0,0,0),A,[g,O]),this.transform(f,A);}},{key:"rotate",value:function rotate(f,g){var _ref39=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref40=_slicedToArray(_ref39,2),O=_ref40[0],A=_ref40[1];var R=e.mat2d.create();return R=e.mat2d.translate(Array.of(0,0,0,0,0,0),R,[O,A]),R=e.mat2d.rotate(Array.of(0,0,0,0,0,0),R,g),R=e.mat2d.translate(Array.of(0,0,0,0,0,0),R,[-O,-A]),this.transform(f,R);}},{key:"scale",value:function scale(f,_ref41){var _ref42=_slicedToArray(_ref41,2),g=_ref42[0],_ref42$=_ref42[1],O=_ref42$===void 0?g:_ref42$;var _ref43=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref44=_slicedToArray(_ref43,2),A=_ref44[0],R=_ref44[1];var b=e.mat2d.create();return b=e.mat2d.translate(Array.of(0,0,0,0,0,0),b,[A,R]),b=e.mat2d.scale(Array.of(0,0,0,0,0,0),b,[g,O]),b=e.mat2d.translate(Array.of(0,0,0,0,0,0),b,[-A,-R]),this.transform(f,b);}},{key:"skew",value:function skew(f,_ref45){var _ref46=_slicedToArray(_ref45,2),g=_ref46[0],_ref46$=_ref46[1],O=_ref46$===void 0?g:_ref46$;var _ref47=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref48=_slicedToArray(_ref47,2),A=_ref48[0],R=_ref48[1];var b=e.mat2d.create();return b=e.mat2d.translate(Array.of(0,0,0,0,0,0),b,[A,R]),b=e.mat2d.multiply(Array.of(0,0,0,0,0,0),b,e.mat2d.fromValues(1,Math.tan(O),Math.tan(g),1,0,0)),b=e.mat2d.translate(Array.of(0,0,0,0,0,0),b,[-A,-R]),this.transform(f,b);}},{key:"isPointCollision",value:function isPointCollision(f,_ref49){var _this$p;var _ref50=_slicedToArray(_ref49,2),g=_ref50[0],O=_ref50[1];var A=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"both";var R=this.getTransform(f),b=Object(i.transformPoint)([g,O],e.mat2d.invert(Array.of(0,0,0,0,0,0),R));return(_this$p=this[p]).isPointCollision.apply(_this$p,_toConsumableArray(b).concat([A]));}},{key:"isPointInFill",value:function isPointInFill(f,_ref51){var _ref52=_slicedToArray(_ref51,2),g=_ref52[0],O=_ref52[1];return this.isPointCollision(f,[g,O],"fill");}},{key:"isPointInStroke",value:function isPointInStroke(f,_ref53){var _ref54=_slicedToArray(_ref53,2),g=_ref54[0],O=_ref54[1];return this.isPointCollision(f,[g,O],"stroke");}}]);}();},/* 30 */ /***/function(u,r,t){t.r(r),t.d(r,"multiply",function(){return n;}),t.d(r,"grayscale",function(){return i;}),t.d(r,"brightness",function(){return a;}),t.d(r,"saturate",function(){return o;}),t.d(r,"contrast",function(){return s;}),t.d(r,"invert",function(){return c;}),t.d(r,"sepia",function(){return p;}),t.d(r,"opacity",function(){return h;}),t.d(r,"hueRotate",function(){return v;});var e=t(26);t(1).glMatrix.setMatrixArrayType(Array);function n(y,M){var T=[],m=y[0],x=y[1],l=y[2],d=y[3],f=y[4],g=y[5],O=y[6],A=y[7],R=y[8],b=y[9],P=y[10],L=y[11],D=y[12],I=y[13],C=y[14],B=y[15],G=y[16],H=y[17],X=y[18],Z=y[19];var W=M[0],z=M[1],Q=M[2],et=M[3],_=M[4];return T[0]=W*m+z*g+Q*P+et*B,T[1]=W*x+z*O+Q*L+et*G,T[2]=W*l+z*A+Q*D+et*H,T[3]=W*d+z*R+Q*I+et*X,T[4]=W*f+z*b+Q*C+et*Z+_,W=M[5],z=M[6],Q=M[7],et=M[8],_=M[9],T[5]=W*m+z*g+Q*P+et*B,T[6]=W*x+z*O+Q*L+et*G,T[7]=W*l+z*A+Q*D+et*H,T[8]=W*d+z*R+Q*I+et*X,T[9]=W*f+z*b+Q*C+et*Z+_,W=M[10],z=M[11],Q=M[12],et=M[13],_=M[14],T[10]=W*m+z*g+Q*P+et*B,T[11]=W*x+z*O+Q*L+et*G,T[12]=W*l+z*A+Q*D+et*H,T[13]=W*d+z*R+Q*I+et*X,T[14]=W*f+z*b+Q*C+et*Z+_,W=M[15],z=M[16],Q=M[17],et=M[18],_=M[19],T[15]=W*m+z*g+Q*P+et*B,T[16]=W*x+z*O+Q*L+et*G,T[17]=W*l+z*A+Q*D+et*H,T[18]=W*d+z*R+Q*I+et*X,T[19]=W*f+z*b+Q*C+et*Z+_,T;}function i(y){y=Object(e.clamp)(0,1,y);var M=0.2126*y,T=0.7152*y,m=0.0722*y;return[M+1-y,T,m,0,0,M,T+1-y,m,0,0,M,T,m+1-y,0,0,0,0,0,1,0];}function a(y){return[y,0,0,0,0,0,y,0,0,0,0,0,y,0,0,0,0,0,1,0];}function o(y){var M=0.2126*(1-y),T=0.7152*(1-y),m=0.0722*(1-y);return[M+y,T,m,0,0,M,T+y,m,0,0,M,T,m+y,0,0,0,0,0,1,0];}function s(y){var M=0.5*(1-y);return[y,0,0,0,M,0,y,0,0,M,0,0,y,0,M,0,0,0,1,0];}function c(y){var M=1-2*y;return[M,0,0,0,y,0,M,0,0,y,0,0,M,0,y,0,0,0,1,0];}function p(y){return[1-0.607*y,0.769*y,0.189*y,0,0,0.349*y,1-0.314*y,0.168*y,0,0,0.272*y,0.534*y,1-0.869*y,0,0,0,0,0,1,0];}function h(y){return[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,y,0];}function v(y){var M=y/180*Math.PI,T=Math.cos(M),m=Math.sin(M),x=0.2126,l=0.7152,d=0.0722;return[x+T*(1-x)+m*-x,l+T*-l+m*-l,d+T*-d+m*(1-d),0,0,x+T*-x+m*0.143,l+T*(1-l)+m*0.14,d+T*-d+m*-0.283,0,0,x+T*-x+m*-(1-x),l+T*-l+m*l,d+T*(1-d)+m*d,0,0,0,0,0,1,0];}},/* 31 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return i;});var e=t(32),n=/* @__PURE__ */t.n(e);t(1).glMatrix.setMatrixArrayType(Array);function i(a){var o=n()(a);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,r,t){var e=t(33),n=t(37),i=t(39);u.exports=function(o){var s,c=e(o);return c.space?(s=Array(3),s[0]=i(c.values[0],0,255),s[1]=i(c.values[1],0,255),s[2]=i(c.values[2],0,255),c.space[0]==="h"&&(s=n.rgb(s)),s.push(i(c.alpha,0,1)),s):[];};},/* 33 */ /***/function(u,r,t){(function(e){var n=t(34),i=t(35),a=t(36);u.exports=s;var o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function s(c){var p,h=[],v=1,y;if(typeof c=="string"){if(n[c])h=n[c].slice(),y="rgb";else if(c==="transparent")v=0,y="rgb",h=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(c)){var M=c.slice(1),T=M.length,m=T<=4;v=1,m?(h=[parseInt(M[0]+M[0],16),parseInt(M[1]+M[1],16),parseInt(M[2]+M[2],16)],T===4&&(v=parseInt(M[3]+M[3],16)/255)):(h=[parseInt(M[0]+M[1],16),parseInt(M[2]+M[3],16),parseInt(M[4]+M[5],16)],T===8&&(v=parseInt(M[6]+M[7],16)/255)),h[0]||(h[0]=0),h[1]||(h[1]=0),h[2]||(h[2]=0),y="rgb";}else if(p=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(c)){var x=p[1],l=x==="rgb",M=x.replace(/a$/,"");y=M;var T=M==="cmyk"?4:M==="gray"?1:3;h=p[2].trim().split(/\s*,\s*/).map(function(O,A){if(/%$/.test(O))return A===T?parseFloat(O)/100:M==="rgb"?parseFloat(O)*255/100:parseFloat(O);if(M[A]==="h"){if(/deg$/.test(O))return parseFloat(O);if(o[O]!==void 0)return o[O];}return parseFloat(O);}),x===M&&h.push(1),v=l||h[T]===void 0?1:h[T],h=h.slice(0,T);}else c.length>10&&/[0-9](?:\s|\/)/.test(c)&&(h=c.match(/([0-9]+)/g).map(function(f){return parseFloat(f);}),y=c.match(/([a-z])/ig).join("").toLowerCase());}else if(!isNaN(c))y="rgb",h=[c>>>16,(c&65280)>>>8,c&255];else if(i(c)){var d=a(c.r,c.red,c.R,null);d!==null?(y="rgb",h=[d,a(c.g,c.green,c.G),a(c.b,c.blue,c.B)]):(y="hsl",h=[a(c.h,c.hue,c.H),a(c.s,c.saturation,c.S),a(c.l,c.lightness,c.L,c.b,c.brightness)]),v=a(c.a,c.alpha,c.opacity,1),c.opacity!=null&&(v/=100);}else(Array.isArray(c)||e.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(c))&&(h=[c[0],c[1],c[2]],y="rgb",v=c.length===4?c[3]:1);return{space:y,values:h,alpha:v};}}).call(this,t(22));},/* 34 */ /***/function(u,r,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,r,t){var e=Object.prototype.toString;u.exports=function(n){var i;return e.call(n)==="[object Object]"&&(i=Object.getPrototypeOf(n),i===null||i===Object.getPrototypeOf({}));};},/* 36 */ /***/function(u,r){u.exports=function(){for(var t=0;t<arguments.length;t++)if(arguments[t]!==void 0)return arguments[t];};},/* 37 */ /***/function(u,r,t){var e=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 i=n[0]/360,a=n[1]/100,o=n[2]/100,s,c,p,h,v;if(a===0)return v=o*255,[v,v,v];o<0.5?c=o*(1+a):c=o+a-o*a,s=2*o-c,h=[0,0,0];for(var y=0;y<3;y++)p=i+1/3*-(y-1),p<0?p++:p>1&&p--,6*p<1?v=s+(c-s)*6*p:2*p<1?v=c:3*p<2?v=s+(c-s)*(2/3-p)*6:v=s,h[y]=v*255;return h;}},e.hsl=function(n){var i=n[0]/255,a=n[1]/255,o=n[2]/255,s=Math.min(i,a,o),c=Math.max(i,a,o),p=c-s,h,v,y;return c===s?h=0:i===c?h=(a-o)/p:a===c?h=2+(o-i)/p:o===c&&(h=4+(i-a)/p),h=Math.min(h*60,360),h<0&&(h+=360),y=(s+c)/2,c===s?v=0:y<=0.5?v=p/(c+s):v=p/(2-c-s),[h,v*100,y*100];};},/* 38 */ /***/function(u,r,t){u.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]};},/* 39 */ /***/function(u,r){u.exports=t;function t(e,n,i){return n<i?e<n?n:e>i?i:e:e<i?i:e>n?n:e;}},/* 40 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return d;});var e=t(41),n=/* @__PURE__ */t.n(e),i=t(42),a=/* @__PURE__ */t.n(i),o=t(43),s=/* @__PURE__ */t.n(o),c=t(44),p=t(46),h=/* @__PURE__ */t.n(p),v=t(53),y=t(55);t(1).glMatrix.setMatrixArrayType(Array);var M=Symbol("contours"),T=Symbol("path"),m=Symbol("simplify"),x=Symbol("scale"),l=2*Math.PI;var d=/*#__PURE__*/function(){function d(){var g=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,d);typeof g=="string"&&(g={path:g}),g.path?this[T]=n()(g.path):this[T]=[],this[M]=null,this[m]=g.simplify!=null?g.simplify:0,this[x]=g.scale!=null?g.scale:2;}return _createClass(d,[{key:"contours",get:function get(){var g=null;if(!this[M]&&this[T]){var O=Object(c["default"])(s()(this[T]));this[M]=h()(O,this[x],this[m]),this[M].path=O,this[M].simplify=this[m],this[M].scale=this[x];}return this[M]&&(g=this[M].map(function(O){return _toConsumableArray(O);}),g.path=this[M].path,g.simplify=this[M].simplify,g.scale=this[M].scale),g;}},{key:"path",get:function get(){return this[T];}},{key:"simplify",get:function get(){return this[m];}},{key:"boundingBox",get:function get(){var g=this.contours;if(g&&g.length){var O=g.reduce(function(A,R){return[].concat(_toConsumableArray(A),_toConsumableArray(R));});return a()(O);}return[[0,0],[0,0]];}},{key:"boundingCenter",get:function get(){var g=this.boundingBox;return g?[0.5*(g[0][0]+g[1][0]),0.5*(g[0][1]+g[1][1])]:[0,0];}},{key:"normalize",value:function normalize(){var _this$T;var g=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var O=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var A=Object(c["default"])(s()(this[T])).map(function(_ref55){var _ref56=_toArray(_ref55),R=_ref56[0],b=_ref56.slice(1);var P=[R];for(var L=0;L<b.length;L+=2){var D=b[L]-g,I=b[L+1]-O;P.push(D,I);}return P;});return this.beginPath(),(_this$T=this[T]).push.apply(_this$T,_toConsumableArray(A)),this;}},{key:"getPointAtLength",value:function getPointAtLength(g){return this.contours?Object(v.getPointAtLength)(this[M],g):null;}},{key:"getTotalLength",value:function getTotalLength(){return this.contours?Object(v.getTotalLength)(this[M]):0;}},{key:"addPath",value:function addPath(g){var _this$T2;this[M]=null,typeof g=="string"&&(g=n()(g)),(_this$T2=this[T]).push.apply(_this$T2,_toConsumableArray(g));}},{key:"beginPath",value:function beginPath(){this[T]=[],this[M]=null;}},{key:"clear",value:function clear(){this.beginPath();}},{key:"ellipse",value:function ellipse(g,O,A,R,b,P,L){var D=arguments.length>7&&arguments[7]!==undefined?arguments[7]:0;if(P+=b,L+=b,A<=0||R<=0||L===P)return;L<P&&(L=P+l+(L-P)%l),L-P>l&&(L=P+l);var I=L-P;I>=l&&(L-=1e-3);var C=this[T].length>0&&I<l?"L":"M";var B=Object(y.getPoint)(g,O,A,R,P),G=Object(y.getPoint)(g,O,A,R,L),H=+!D;var X=I>Math.PI?1:0;D&&(X=1-X),C+=B.join(" "),C+="A".concat(A," ").concat(R," 0 ").concat(X," ").concat(H," ").concat(G.join(" ")),I>=l&&(C+="Z"),this.addPath(C);}},{key:"arc",value:function arc(g,O,A,R,b){var P=arguments.length>5&&arguments[5]!==undefined?arguments[5]:0;return this.ellipse(g,O,A,A,0,R,b,P);}},{key:"arcTo",value:function arcTo(g,O,A,R,b,P,L){this[M]=null,this[T].push(["A",g,O,A,R,b,P,L]);}},{key:"moveTo",value:function moveTo(g,O){this[M]=null,this[T].push(["M",g,O]);}},{key:"lineTo",value:function lineTo(g,O){this[M]=null,this[T].push(["L",g,O]);}},{key:"bezierCurveTo",value:function bezierCurveTo(g,O,A,R,b,P){this[M]=null,this[T].push(["C",g,O,A,R,b,P]);}},{key:"quadraticCurveTo",value:function quadraticCurveTo(g,O,A,R){this[M]=null,this[T].push(["Q",g,O,A,R]);}},{key:"rect",value:function rect(g,O,A,R){var b="M".concat(g," ").concat(O,"L").concat(g+A," ").concat(O,"L").concat(g+A," ").concat(O+R,"L").concat(g," ").concat(O+R,"Z");this.addPath(b);}},{key:"closePath",value:function closePath(){this[M]=null;var g=[];var O=this[T].length;O>0&&(g=this[T][O-1]),g[0]!=="Z"&&g[0]!=="z"&&this[T].push(["Z"]);}}]);}();},/* 41 */ /***/function(u,r){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},e=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function n(o){var s=[];return o.replace(e,function(c,p,h){var v=p.toLowerCase();for(h=a(h),v=="m"&&h.length>2&&(s.push([p].concat(h.splice(0,2))),v="l",p=p=="m"?"l":"L");;){if(h.length==t[v])return h.unshift(p),s.push(h);if(h.length<t[v])throw new Error("malformed path data");s.push([p].concat(h.splice(0,t[v])));}}),s;}var i=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function a(o){var s=o.match(i);return s?s.map(Number):[];}},/* 42 */ /***/function(u,r,t){u.exports=e;function e(n){var i=n.length;if(i===0)return[[],[]];for(var a=n[0].length,o=n[0].slice(),s=n[0].slice(),c=1;c<i;++c)for(var p=n[c],h=0;h<a;++h){var v=p[h];o[h]=Math.min(o[h],v),s[h]=Math.max(s[h],v);}return[o,s];}},/* 43 */ /***/function(u,r){u.exports=t;function t(e){var n=0,i=0,a=0,o=0;return e.map(function(s){s=s.slice();var c=s[0],p=c.toUpperCase();if(c!=p)switch(s[0]=p,c){case"a":s[6]+=a,s[7]+=o;break;case"v":s[1]+=o;break;case"h":s[1]+=a;break;default:for(var h=1;h<s.length;)s[h++]+=a,s[h++]+=o;}switch(p){case"Z":a=n,o=i;break;case"H":a=s[1];break;case"V":o=s[1];break;case"M":a=n=s[1],o=i=s[2];break;default:a=s[s.length-2],o=s[s.length-1];}return s;});}},/* 44 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return n;});var e=t(45);t(1).glMatrix.setMatrixArrayType(Array);function n(o){for(var s,c=[],p=0,h=0,v=0,y=0,M=null,T=null,m=0,x=0,l=0,d=o.length;l<d;l++){var f=o[l],g=f[0];switch(g){case"M":v=f[1],y=f[2];break;case"A":var O=Object(e["default"])(m,x,f[6],f[7],f[4],f[5],f[1],f[2],f[3]);if(!O.length)continue;O=O.map(function(L){var _L7=_slicedToArray(L,8),D=_L7[0],I=_L7[1],C=_L7[2],B=_L7[3],G=_L7[4],H=_L7[5],X=_L7[6],Z=_L7[7];return{x1:C,y1:B,x2:G,y2:H,x:X,y:Z};});for(var A=0,R;A<O.length;A++)R=O[A],f=["C",R.x1,R.y1,R.x2,R.y2,R.x,R.y],A<O.length-1&&c.push(f);break;case"S":var b=m,P=x;(s=="C"||s=="S")&&(b+=b-p,P+=P-h),f=["C",b,P,f[1],f[2],f[3],f[4]];break;case"T":s=="Q"||s=="T"?(M=m*2-M,T=x*2-T):(M=m,T=x),f=a(m,x,M,T,f[1],f[2]);break;case"Q":M=f[1],T=f[2],f=a(m,x,f[1],f[2],f[3],f[4]);break;case"L":f=i(m,x,f[1],f[2]);break;case"H":f=i(m,x,f[1],x);break;case"V":f=i(m,x,m,f[1]);break;case"Z":f=i(m,x,v,y);break;}s=g,m=f[f.length-2],x=f[f.length-1],f.length>4?(p=f[f.length-4],h=f[f.length-3]):(p=m,h=x),c.push(f);}return c;}function i(o,s,c,p){return["C",o,s,c,p,c,p];}function a(o,s,c,p,h,v){return["C",o/3+2/3*c,s/3+2/3*p,h/3+2/3*c,v/3+2/3*p,h,v];}},/* 45 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return o;}),t(1).glMatrix.setMatrixArrayType(Array);var e=Math.PI*2;function n(s,c,p,h){var v=s*h-c*p<0?-1:1;var y=s*p+c*h;return y>1&&(y=1),y<-1&&(y=-1),v*Math.acos(y);}function i(s,c,p,h,v,y,M,T,m,x){var l=x*(s-p)/2+m*(c-h)/2,d=-m*(s-p)/2+x*(c-h)/2,f=M*M,g=T*T,O=l*l,A=d*d;var R=f*g-f*A-g*O;R<0&&(R=0),R/=f*A+g*O,R=Math.sqrt(R)*(v===y?-1:1);var b=R*M/T*d,P=R*-T/M*l,L=x*b-m*P+(s+p)/2,D=m*b+x*P+(c+h)/2,I=(l-b)/M,C=(d-P)/T,B=(-l-b)/M,G=(-d-P)/T,H=n(1,0,I,C);var X=n(I,C,B,G);return y===0&&X>0&&(X-=e),y===1&&X<0&&(X+=e),[L,D,H,X];}function a(s,c){var p=1.3333333333333333*Math.tan(c/4),h=Math.cos(s),v=Math.sin(s),y=Math.cos(s+c),M=Math.sin(s+c);return[h,v,h-v*p,v+h*p,y+M*p,M-y*p,y,M];}function o(s,c,p,h,v,y,M,T,m){var x=Math.sin(m*e/360),l=Math.cos(m*e/360),d=l*(s-p)/2+x*(c-h)/2,f=-x*(s-p)/2+l*(c-h)/2;if(d===0&&f===0)return[];if(M===0||T===0)return[];M=Math.abs(M),T=Math.abs(T);var g=d*d/(M*M)+f*f/(T*T);g>1&&(M*=Math.sqrt(g),T*=Math.sqrt(g));var O=i(s,c,p,h,v,y,M,T,x,l),A=[];var R=O[2],b=O[3];var P=Math.max(Math.ceil(Math.abs(b)/(e/4)),1);b/=P;for(var L=0;L<P;L++)A.push(a(R,b)),R+=b;return A.map(function(L){for(var D=0;D<L.length;D+=2){var I=L[D+0],C=L[D+1];I*=M,C*=T;var B=l*I-x*C,G=x*I+l*C;L[D+0]=B+O[0],L[D+1]=G+O[1];}return L;});}},/* 46 */ /***/function(u,r,t){t(1).glMatrix.setMatrixArrayType(Array);var e=t(47),_t2=t(49),n=_t2.copy,i=t(50);function a(h,v,y){return h[0]=v,h[1]=y,h;}var o=[0,0],s=[0,0],c=[0,0];function p(h,v,y,M){e(y,a(o,M[1],M[2]),a(s,M[3],M[4]),a(c,M[5],M[6]),v,h);}u.exports=function(v,y,M){var T=[],m=[],x=[0,0];return v.forEach(function(l,d,f){if(l[0]==="M")n(x,l.slice(1)),m.length>0&&(T.push(m),m=[]);else if(l[0]==="C")p(m,y,x,l),a(x,l[5],l[6]);else throw new Error("illegal type in SVG: "+l[0]);}),m.length>0&&T.push(m),T.map(function(l){return i(l,M||0);});};},/* 47 */ /***/function(u,r,t){u.exports=t(48)();},/* 48 */ /***/function(u,r){function t(n){return[n[0],n[1]];}function e(n,i){return[n,i];}u.exports=function(i){i=i||{};var a=typeof i.recursion=="number"?i.recursion:8,o=typeof i.epsilon=="number"?i.epsilon:11920929e-14,s=typeof i.pathEpsilon=="number"?i.pathEpsilon:1,c=typeof i.angleEpsilon=="number"?i.angleEpsilon:0.01,p=i.angleTolerance||0,h=i.cuspLimit||0;return function(T,m,x,l,d,f){f||(f=[]),d=typeof d=="number"?d:1;var g=s/d;return g*=g,v(T,m,x,l,f,g),f;};function v(M,T,m,x,l,d){l.push(t(M));var f=M[0],g=M[1],O=T[0],A=T[1],R=m[0],b=m[1],P=x[0],L=x[1];y(f,g,O,A,R,b,P,L,l,d,0),l.push(t(x));}function y(M,T,m,x,l,d,f,g,O,A,R){if(!(R>a)){var b=Math.PI,P=(M+m)/2,L=(T+x)/2,D=(m+l)/2,I=(x+d)/2,C=(l+f)/2,B=(d+g)/2,G=(P+D)/2,H=(L+I)/2,X=(D+C)/2,Z=(I+B)/2,W=(G+X)/2,z=(H+Z)/2;if(R>0){var Q=f-M,et=g-T,_=Math.abs((m-f)*et-(x-g)*Q),st=Math.abs((l-f)*et-(d-g)*Q),q,ht;if(_>o&&st>o){if((_+st)*(_+st)<=A*(Q*Q+et*et)){if(p<c){O.push(e(W,z));return;}var dt=Math.atan2(d-x,l-m);if(q=Math.abs(dt-Math.atan2(x-T,m-M)),ht=Math.abs(Math.atan2(g-d,f-l)-dt),q>=b&&(q=2*b-q),ht>=b&&(ht=2*b-ht),q+ht<p){O.push(e(W,z));return;}if(h!==0){if(q>h){O.push(e(m,x));return;}if(ht>h){O.push(e(l,d));return;}}}}else if(_>o){if(_*_<=A*(Q*Q+et*et)){if(p<c){O.push(e(W,z));return;}if(q=Math.abs(Math.atan2(d-x,l-m)-Math.atan2(x-T,m-M)),q>=b&&(q=2*b-q),q<p){O.push(e(m,x)),O.push(e(l,d));return;}if(h!==0&&q>h){O.push(e(m,x));return;}}}else if(st>o){if(st*st<=A*(Q*Q+et*et)){if(p<c){O.push(e(W,z));return;}if(q=Math.abs(Math.atan2(g-d,f-l)-Math.atan2(d-x,l-m)),q>=b&&(q=2*b-q),q<p){O.push(e(m,x)),O.push(e(l,d));return;}if(h!==0&&q>h){O.push(e(l,d));return;}}}else if(Q=W-(M+f)/2,et=z-(T+g)/2,Q*Q+et*et<=A){O.push(e(W,z));return;}}y(M,T,P,L,G,H,W,z,O,A,R+1),y(W,z,X,Z,C,B,f,g,O,A,R+1);}}};},/* 49 */ /***/function(u,r,t){t.r(r),t.d(r,"create",function(){return i;}),t.d(r,"clone",function(){return n;}),t.d(r,"copy",function(){return a;}),t.d(r,"scaleAndAdd",function(){return o;}),t.d(r,"dot",function(){return s;}),t.d(r,"rotate",function(){return c;}),t.d(r,"cross",function(){return p;}),t.d(r,"sub",function(){return h;}),t.d(r,"add",function(){return v;}),t.d(r,"computeMiter",function(){return m;}),t.d(r,"normal",function(){return x;}),t.d(r,"direction",function(){return l;});var e=t(1);t(1).glMatrix.setMatrixArrayType(Array);function n(d){return[d[0],d[1]];}function i(){return[0,0];}var a=e.vec2.copy,o=e.vec2.scaleAndAdd,s=e.vec2.dot,c=e.vec2.rotate,p=e.vec2.cross,h=e.vec2.sub,v=e.vec2.add,y=e.vec2.normalize,M=e.vec2.set,T=i();function m(d,f,g,O,A){v(d,g,O),y(d,d),M(f,-d[1],d[0]),M(T,-g[1],g[0]);var R=A/s(f,T);return Math.abs(R);}function x(d,f){return M(d,-f[1],f[0]),d;}function l(d,f,g){return h(d,f,g),y(d,d),d;}},/* 50 */ /***/function(u,r,t){var e=t(51),n=t(52);u.exports=function(a,o){return a=e(a,o),a=n(a,o),a;},u.exports.radialDistance=e,u.exports.douglasPeucker=n;},/* 51 */ /***/function(u,r){function t(e,n){var i=e[0]-n[0],a=e[1]-n[1];return i*i+a*a;}u.exports=function(n,i){if(n.length<=1)return n;i=typeof i=="number"?i:1;for(var a=i*i,o=n[0],s=[o],c,p=1,h=n.length;p<h;p++)c=n[p],t(c,o)>a&&(s.push(c),o=c);return o!==c&&s.push(c),s;};},/* 52 */ /***/function(u,r){function t(n,i,a){var o=i[0],s=i[1],c=a[0]-o,p=a[1]-s;if(c!==0||p!==0){var h=((n[0]-o)*c+(n[1]-s)*p)/(c*c+p*p);h>1?(o=a[0],s=a[1]):h>0&&(o+=c*h,s+=p*h);}return c=n[0]-o,p=n[1]-s,c*c+p*p;}function e(n,i,a,o,s){for(var c=o,p,h=i+1;h<a;h++){var v=t(n[h],n[i],n[a]);v>c&&(p=h,c=v);}c>o&&(p-i>1&&e(n,i,p,o,s),s.push(n[p]),a-p>1&&e(n,p,a,o,s));}u.exports=function(i,a){if(i.length<=1)return i;a=typeof a=="number"?a:1;var o=a*a,s=i.length-1,c=[i[0]];return e(i,0,s,o,c),c.push(i[s]),c;};},/* 53 */ /***/function(u,r,t){t.r(r),t.d(r,"getTotalLength",function(){return n;}),t.d(r,"getPointAtLength",function(){return a;}),t.d(r,"getDashContours",function(){return o;});var e=t(54);t(1).glMatrix.setMatrixArrayType(Array);function n(s){if(s.totalLength!=null)return s.totalLength;var c=0;return s.forEach(function(p){var h=p[0];for(var v=1;v<p.length;v++){var y=p[v];c+=Object(e.distance)(h,y),h=y;}}),s.totalLength=c,c;}function i(s,c){var p=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 h=n(s);if(c>=h){var y=s[s.length-1],M=y[y.length-2],T=y[y.length-1],m=Math.atan2(T[1]-M[1],T[0]-M[0]);return{current:s.map(function(x){return _toConsumableArray(x);}),point:{x:T[0],y:T[1],angle:m}};}var v=[];for(var _y2=0;_y2<s.length;_y2++){v[_y2]=[];var _M=s[_y2];var _T2=_M[0];for(var _m4=1;_m4<_M.length;_m4++){var _x25=_M[_m4],_l9=Object(e.distance)(_T2,_x25);if(c<_l9){var d=c/_l9,f=Math.atan2(_x25[1]-_T2[1],_x25[0]-_T2[0]),g={x:_T2[0]*(1-d)+_x25[0]*d,y:_T2[1]*(1-d)+_x25[1]*d,angle:f};if(v[_y2].push(_T2),c>0&&v[_y2].push([g.x,g.y]),!p)return{current:v,point:g};var O=[],A=_y2;for(;_y2<s.length;_y2++){for(O[_y2-A]=[],_y2===A&&O[0].push([g.x,g.y]);_m4<_M.length;_m4++)O[_y2-A].push(_M[_m4]);_m4=0;}return{current:v,point:g,rest:O};}c-=_l9,v[_y2].push(_T2),_T2=_x25;}}}function a(s,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(s.length<=0)return{x:0,y:0,angle:0};if(c<=0){var p=s[0][0],h=s[0][1],v=Math.atan2(h[1]-p[1],h[0]-p[0]);return{x:p[0],y:p[1],angle:v};}return i(s,c,!1).point;}function o(s,c,p){var h=0,v=c[0],y=s;var M=[],T=c.length;if(p>0){do p-=c[h%T],h++;while(p>0);p<0&&(v=-p,h--);}else if(p<0){h=-1;do p+=c[h%T+T-1],h--;while(p<0);p>=0&&(h++,v=c[h%T+T-1]-p);}do{var m=i(y,v);y=m.rest,++h%2&&M.push.apply(M,_toConsumableArray(m.current));var _x26=h%T;_x26<0&&(_x26+=T),v=c[_x26];}while(y);return M;}},/* 54 */ /***/function(u,r,t){t.r(r),t.d(r,"normalize",function(){return e;}),t.d(r,"distance",function(){return n;}),t(1).glMatrix.setMatrixArrayType(Array);function e(_ref57,s,c,p){var _ref58=_slicedToArray(_ref57,3),i=_ref58[0],a=_ref58[1],o=_ref58[2];return i=i*2/s-1,a=1-a*2/c,Number.isFinite(p)?(o=o*2/p-1,[i,a,o]):[i,a];}function n(_ref59,_ref60){var _ref61=_slicedToArray(_ref59,3),i=_ref61[0],a=_ref61[1],_ref61$=_ref61[2],o=_ref61$===void 0?0:_ref61$;var _ref62=_slicedToArray(_ref60,3),s=_ref62[0],c=_ref62[1],_ref62$=_ref62[2],p=_ref62$===void 0?0:_ref62$;return Math.hypot(s-i,c-a,p-o);}},/* 55 */ /***/function(u,r,t){t.r(r),t.d(r,"getPoint",function(){return n;}),t(1).glMatrix.setMatrixArrayType(Array);var e=Math.PI*2;function n(i,a,o,s,c){c%=e,c<0&&(c+=e);var p=Math.tan(c);if(Math.abs(p)<1e5){var h=a-p*i,v=1/Math.pow(o,2)+Math.pow(p,2)/Math.pow(s,2);var y=-1;(c<=Math.PI/2||c>3*Math.PI/2)&&(y=1);var M=y*Math.sqrt(1/v)+i,T=p*M+h;return[M,T];}return c<Math.PI?[i,a+s]:[i,a-s];}},/* 56 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return V;});var e=t(1),n=t(42),i=/* @__PURE__ */t.n(n),a=t(57),o=t(28),s=t(24),c=t(30),p=t(59),h=t(53),v=t(60),y=/* @__PURE__ */t.n(v),M=t(46),T=/* @__PURE__ */t.n(M),m=t(31),x=t(40),l=t(21);t(1).glMatrix.setMatrixArrayType(Array);function d(J,N){if(J==null)return{};var $=f(J,N),S,E;if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(J);for(E=0;E<w.length;E++)S=w[E],!(N.indexOf(S)>=0)&&Object.prototype.propertyIsEnumerable.call(J,S)&&($[S]=J[S]);}return $;}function f(J,N){if(J==null)return{};var $={},S=Object.keys(J),E,w;for(w=0;w<S.length;w++)E=S[w],!(N.indexOf(E)>=0)&&($[E]=J[E]);return $;}var g=Symbol("mesh"),O=Symbol("contours"),A=Symbol("stroke"),R=Symbol("fill"),b=Symbol("strokeColor"),P=Symbol("fillColor"),L=Symbol("transform"),D=Symbol("invertTransform"),I=Symbol("uniforms"),C=Symbol("texOptions"),B=Symbol("blend"),G=Symbol("applyTexture"),H=Symbol("applyTransform"),X=Symbol("applyGradientTransform"),Z=Symbol("applyProgram"),W=Symbol("gradient"),z=Symbol("filter"),Q=Symbol("opacity"),et=Symbol("program"),_=Symbol("attributes"),st=Symbol("pass"),q=Symbol("clipContext"),ht=Symbol("applyClipPath");function dt(J,N){var $=J[1][0]-J[0][0],S=J[1][1]-J[0][1],E=[];for(var w=0;w<N.length;w++){var j=N[w],K=[(j[0]-J[0][0])/$,1-(j[1]-J[0][1])/S];E.push(K);}return E;}function F(_ref63,_ref64,_ref65){var _ref66=_slicedToArray(_ref63,2),J=_ref66[0],N=_ref66[1];var _ref67=_slicedToArray(_ref64,4),$=_ref67[0],S=_ref67[1],E=_ref67[2],w=_ref67[3];var j=_ref65.scale;return j||(J/=E,N=1-N/w,J-=$,N+=S),[J,N,0];}function U(J,N,$){var S=T()(J,N,$);return S.path=J,S.simplify=$,S.scale=N,S;}var V=/*#__PURE__*/function(){function V(N){_classCallCheck(this,V);this[A]=null,this[R]=null,this[L]=[1,0,0,1,0,0],this[Q]=1,this[I]={},this[z]=[],this[B]=null,this[C]={},this.contours=N.contours,this[et]=null,this[_]={},this[st]=[];}return _createClass(V,[{key:"contours",get:function get(){return this[O];},set:function set(N){this[g]=null,this[O]=N;var $=N.scale;this.transformScale/$>1.5&&this.accurate(this.transformScale);}},{key:"setProgram",value:function setProgram(N){this[et]=N,this[g]&&this[Z](N);}},{key:"program",get:function get(){return this[et];}},{key:"setAttribute",value:function setAttribute(N,$){$==null?delete this[_][N]:this[_][N]=$;}},{key:"getOpacity",value:function getOpacity(){return this[Q];}},{key:"setOpacity",value:function setOpacity(N){if(N<0||N>1)throw new TypeError("Invalid opacity value.");this[g]&&this[g].positions.forEach(function($){$[2]=1/$[2]>0?N:-N;}),this[Q]=N;}},{key:"setClipPath",value:function setClipPath(N){this.clipPath=N,this[I].u_clipSampler&&this[I].u_clipSampler["delete"](),this.setUniforms({u_clipSampler:null}),this[g]&&delete this[g].attributes.a_clipUV,N&&this[g]&&this[ht]();}},{key:ht,value:function value(){if(this.clipPath){this[q]||(this[q]=l["default"].createCanvas(1,1));var _this$boundingBox=_slicedToArray(this.boundingBox,2),_this$boundingBox$=_slicedToArray(_this$boundingBox[0],2),N=_this$boundingBox$[0],$=_this$boundingBox$[1],_this$boundingBox$2=_slicedToArray(_this$boundingBox[1],2),S=_this$boundingBox$2[0],E=_this$boundingBox$2[1];S&&E&&(this[q].width=S-N,this[q].height=E-$);var w=this[q].getContext("2d"),j=new Path2D(this.clipPath);w.clearRect(0,0,this[q].width,this[q].height),w.save(),w.translate(-N,-$),w.fillStyle="white",w.fill(j),w.restore(),this[g].clipPath=this[q];var K=dt(this.boundingBox,this[g].position0);this[g].attributes.a_clipUV=K;}}},{key:"getPointAtLength",value:function getPointAtLength(N){return Object(h.getPointAtLength)(this[O],N);}},{key:"getTotalLength",value:function getTotalLength(){return Object(h.getTotalLength)(this[O]);}},{key:"blend",get:function get(){return this[B]==null?"auto":this[B];}},{key:"blend",set:function set(N){this[B]=N,this[g]&&(this[g].enableBlend=this.enableBlend);}},{key:"boundingBox",get:function get(){if(this[g]&&this[g].boundingBox)return this[g].boundingBox;var N=this.meshData;if(N){var $=N.position0;if($.length)N.boundingBox=i()($);else return[[0,0],[0,0]];return N.boundingBox;}return[[0,0],[0,0]];}},{key:"boundingCenter",get:function get(){var N=this.boundingBox;return N?[0.5*(N[0][0]+N[1][0]),0.5*(N[0][1]+N[1][1])]:[0,0];}},{key:"fillRule",get:function get(){return this[R]?this[R].rule:"nonzero";}},{key:"lineWidth",get:function get(){return this[A]?this[A].lineWidth:0;}},{key:"lineCap",get:function get(){return this[A]?this[A].lineCap:"";}},{key:"lineJoin",get:function get(){return this[A]?this[A].lineJoin:"";}},{key:"miterLimit",get:function get(){return this[A]?this[A].miterLimit:0;}},{key:"strokeStyle",get:function get(){return this[b]&&this[b][3]!==0?Object(s["default"])(this[b]):"";}},{key:"lineDash",get:function get(){return this[A]?this[A].lineDash:null;}},{key:"lineDashOffset",get:function get(){return this[A]?this[A].lineDashOffset:0;}},{key:"fillStyle",get:function get(){return this[P]&&this[P][3]!==0?Object(s["default"])(this[P]):"";}},{key:"gradient",get:function get(){return this[W];}},{key:"texture",get:function get(){return this[I].u_texSampler?{image:this[I].u_texSampler._img,options:this[C]}:null;}},{key:"enableBlend",get:function get(){return this[B]===!0||this[B]===!1?this[B]:this[Q]<1||this[b]!=null&&this[b][3]<1||this[P]!=null&&this[P][3]<1||this[I].u_colorMatrix!=null&&this[I].u_colorMatrix[18]<1||this[I].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[z].join(" ");}},{key:"transformMatrix",get:function get(){return this[L];}},{key:"invertMatrix",get:function get(){if(!this[D]){var N=e.mat2d.invert(Array.of(0,0,0,0,0,0),this[L]);this[D]=N;}return this[D];}},{key:"transformScale",get:function get(){var N=this[L];return Math.max(Math.hypot(N[0],N[1]),Math.hypot(N[2],N[3]));}},{key:"uniforms",get:function get(){return this[I];}},{key:"pass",get:function get(){return this[st];}},{key:Z,value:function value(N){var $=this[_],S=this[g].position0,E=Object.entries(N._attribute);for(var w=0;w<E.length;w++){var _E$w=_slicedToArray(E[w],2),j=_E$w[0],K=_E$w[1];if(j!=="a_color"&&j!=="a_sourceRect"&&K!=="ignored"){var Y=$[j];if(j==="uv"&&!Y){var k=this[g].boundingBox||i()(S);this[g].attributes[j]=dt(k,S);}else{this[g].attributes[j]=[];for(var _k=0;_k<S.length;_k++){var nt=S[_k];this[g].attributes[j].push(Y?Y(nt,w,S):Array(K.size).fill(0));}}}}}// {stroke, fill}
|
|
38
|
-
},{key:"meshData",get:function get(){var _this20=this;if(this._updateMatrix&&this.transformScale/this.contours.scale>1.5&&this.accurate(this.transformScale),!this[g]){!this[R]&&!this[A]&&this.setFill();var N=this[O],$={};if(N&&N.length){if(this[R])try{var w=y()(N,this[R]);w.positions=w.positions.map(function(j){return j.push(_this20[Q]),j;}),w.attributes={a_color:Array.from({length:w.positions.length}).map(function(){return _this20[P].map(function(j){return Math.round(255*j);});})// a_sourceRect: Array.from({length: mesh.positions.length}).map(() => [0, 0, 0, 0]),
|
|
39
|
-
},$.fill=w;}catch(_unused8){}if(this[A]){var _w=this[A].lineDash;var j=N;if(_w){var Y=this[A].lineDashOffset;j=Object(h.getDashContours)(N,_w,Y);}var K=j.map(function(Y,k){var nt=Y.length>1&&e.vec2.equals(Y[0],Y[Y.length-1]),it=_this20[A].build(Y,nt);return y()([it]);});K.forEach(function(Y){Y.positions=Y.positions.map(function(k){return k.push(-_this20[Q]),k;}),Y.attributes={a_color:Array.from({length:Y.positions.length}).map(function(){return _this20[b].map(function(k){return Math.round(255*k);});})};}),$.stroke=Object(o["default"])(K);}}var S=Object(o["default"])([$.fill,$.stroke]);S.fillPointCount=$.fill?$.fill.positions.length:0,S.enableBlend=this.enableBlend,S.position0=S.positions.map(function(_ref68){var _ref69=_slicedToArray(_ref68,3),w=_ref69[0],j=_ref69[1],K=_ref69[2];return[w,j,K];}),S.uniforms=this[I],this[g]=S,this[I].u_texSampler&&this[G](S,this[C]);var E=this[L];Object(p.isUnitTransform)(E)||(this[H](S,E),this[I].u_radialGradientVector&&this[X]()),this.clipPath&&this[ht](),this[et]&&this[Z](this[et]);}return this._updateMatrix&&(this[g].matrix=this[L],this[H](this[g],this[L]),this[I].u_radialGradientVector&&this[X]()),this[g];}},{key:H,value:function value(N,$){var S=N.positions,E=N.position0;for(var w=0;w<S.length;w++){var _E$w2=_slicedToArray(E[w],2),j=_E$w2[0],K=_E$w2[1],Y=S[w];Y[0]=j*$[0]+K*$[2]+$[4],Y[1]=j*$[1]+K*$[3]+$[5];}this._updateMatrix=!1;}},{key:X,value:function value(){var N=this[L],$=_toConsumableArray(this._radialGradientVector);if($){var _$=_slicedToArray($,5),S=_$[0],E=_$[1],w=_$[3],j=_$[4];$[0]=S*N[0]+E*N[2]+N[4],$[1]=S*N[1]+E*N[3]+N[5],$[3]=w*N[0]+j*N[2]+N[4],$[4]=w*N[1]+j*N[3]+N[5],this[I].u_radialGradientVector=$;}}},{key:G,value:function value(N,$){function S(k,nt){return k==null&&nt==null?!0:k==null||nt==null?!1:k[0]===nt[0]&&k[1]===nt[1]&&k[2]===nt[2]&&k[3]===nt[3];}var E=this[I].u_texSampler;if(!E)return;var _E$_img=E._img,w=_E$_img.width,j=_E$_img.height,K=$.srcRect;var Y=$.rect||[0,0];if($.rotated&&(Y=[-Y[1],Y[0],Y[3],Y[2]]),Y[2]==null&&(Y[2]=K?K[2]:w),Y[3]==null&&(Y[3]=K?K[3]:j),$.hidden)N.textureCoord=N.positions.map(function(){return[-1,-1,-1];});else if(!N.textureCoord||!S(this[C].rect,$.rect)||this[C].hidden!==$.hidden||this[C].rotated!==$.rotated){var k=null;$.rotated&&(k=e.mat2d.rotate(Array.of(0,0,0,0,0,0),e.mat2d.fromValues(1,0,0,1,0,0),0.5*Math.PI),k=e.mat2d.translate(Array.of(0,0,0,0,0,0),k,[0,-Y[2]])),N.textureCoord=N.position0.map(function(_ref70){var _ref71=_slicedToArray(_ref70,3),nt=_ref71[0],it=_ref71[1],lt=_ref71[2];if(1/lt>0){if($.rotated){var at=nt*k[0]+it*k[2]+k[4],ot=nt*k[1]+it*k[3]+k[5];nt=at;it=ot;}var ut=F([nt,it],[Y[0]/Y[2],Y[1]/Y[3],Y[2],Y[3]],$);return $.repeat&&(ut[2]=1),ut;}return[-1,-1,-1];});}if(K){var _k2=[K[0]/w,K[1]/j,K[2]/w,K[3]/j];N.attributes.a_sourceRect=N.positions.map(function(){return[].concat(_k2);});}else N.attributes.a_sourceRect=N.positions.map(function(){return[0,0,0,0];});}},{key:"accurate",value:function accurate(N){if(!this.contours)return;if(this.contours.path){var S=this.contours.simplify,E=U(this.contours.path,2*N,S);this[g]=null,this[O]=E;}}},{key:"canIgnore",value:function canIgnore(){var N=this[A]==null||this[A].lineWidth===0||this[b][3]===0,$=this[R]==null||this[P][3]===0,S=this[I].u_radialGradientVector==null,E=this[I].u_texSampler==null;return this[Q]===0||this[et]==null&&N&&$&&S&&E&&!this.beforeRender&&!this.afterRender;}// join: 'miter' or 'bevel'
|
|
40
|
-
// cap: 'butt' or 'square'
|
|
41
|
-
// lineDash: null
|
|
42
|
-
// lineDashOffset: 0
|
|
43
|
-
},{key:"setStroke",value:function setStroke(){var _ref72=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref72$thickness=_ref72.thickness,N=_ref72$thickness===void 0?1:_ref72$thickness,_ref72$cap=_ref72.cap,$=_ref72$cap===void 0?"butt":_ref72$cap,_ref72$join=_ref72.join,S=_ref72$join===void 0?"miter":_ref72$join,_ref72$miterLimit=_ref72.miterLimit,E=_ref72$miterLimit===void 0?10:_ref72$miterLimit,_ref72$color=_ref72.color,w=_ref72$color===void 0?[0,0,0,0]:_ref72$color,_ref72$lineDash=_ref72.lineDash,j=_ref72$lineDash===void 0?null:_ref72$lineDash,_ref72$lineDashOffset=_ref72.lineDashOffset,K=_ref72$lineDashOffset===void 0?0:_ref72$lineDashOffset,_ref72$roundSegments=_ref72.roundSegments,Y=_ref72$roundSegments===void 0?20:_ref72$roundSegments;return this[g]=null,this[A]=new a["default"]({lineWidth:N,lineCap:$,lineJoin:S,miterLimit:E,roundSegments:Y}),typeof w=="string"&&(w=Object(m["default"])(w)),this[b]=w,this[A].lineDash=j,this[A].lineDashOffset=K,this;}},{key:"setFill",value:function setFill(){var _ref73=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref73$rule=_ref73.rule,N=_ref73$rule===void 0?this.fillRule:_ref73$rule,_ref73$color=_ref73.color,$=_ref73$color===void 0?[0,0,0,0]:_ref73$color;return this[g]=null,this[R]={rule:N},typeof $=="string"&&($=Object(m["default"])($)),this[P]=$,this;}/**
|
|
44
|
-
options: {
|
|
45
|
-
scale: false,
|
|
46
|
-
repeat: false,
|
|
47
|
-
rotated: false,
|
|
48
|
-
rect: [10, 10],
|
|
49
|
-
srcRect: [...],
|
|
50
|
-
hidden: false,
|
|
51
|
-
}
|
|
52
|
-
*/},{key:"setTexture",value:function setTexture(N){var $=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(N&&N.image){var _N=N,S=_N.image,E=_N.rect;if(N=S,$.rect)for(var w=0;w<$.rect.length;w++)E[w]=$.rect[w];$.rect=E;}return this[R]||this.setFill(),this.setUniforms({u_texSampler:N}),this[g]&&this[G](this[g],$),this[C]=$,this;}},{key:"setCircularGradient",value:function setCircularGradient(){var _ref74=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},N=_ref74.vector,$=_ref74.colors,_ref74$type=_ref74.type,S=_ref74$type===void 0?"fill":_ref74$type;if(N.length!==3)throw new TypeError("Invalid linearGradient.");this.setGradient({vector:N,colors:$,type:S});}},{key:"setLinearGradient",value:function setLinearGradient(){var _ref75=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},N=_ref75.vector,$=_ref75.colors,_ref75$type=_ref75.type,S=_ref75$type===void 0?"fill":_ref75$type;if(N.length!==4)throw new TypeError("Invalid linearGradient.");this.setGradient({vector:N,colors:$,type:S});}},{key:"setRadialGradient",value:function setRadialGradient(){var _ref76=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},N=_ref76.vector,$=_ref76.colors,_ref76$type=_ref76.type,S=_ref76$type===void 0?"fill":_ref76$type;if(N.length!==6)throw new TypeError("Invalid radialGradient.");this.setGradient({vector:N,colors:$,type:S});}/**
|
|
53
|
-
vector: [x0, y0, r0, x1, y1, r1],
|
|
54
|
-
colors: [{offset:0, color}, {offset:1, color}, ...],
|
|
55
|
-
*/},{key:"setGradient",value:function setGradient(){var _ref77=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},N=_ref77.vector,$=_ref77.colors,_ref77$type=_ref77.type,S=_ref77$type===void 0?"fill":_ref77$type;$=$.map(function(_ref78){var j=_ref78.offset,K=_ref78.color;return typeof K=="string"&&(K=Object(m["default"])(K)),{offset:j,color:K};}),this[W]=this[W]||{},this[W][S]={vector:N,colors:$},$.sort(function(j,K){return j.offset-K.offset;});var E=[];$.forEach(function(_ref79){var j=_ref79.offset,K=_ref79.color;E.push.apply(E,[j].concat(_toConsumableArray(K)));});var w;if(N.length===4?w=[N[0],N[1],0,N[2],N[3],0]:w=_toConsumableArray(N),E.length<40&&E.push(-1),E.length>40)throw new Error("Too many colors, should be less than 8 colors");return this._radialGradientVector=w,this[I].u_colorSteps=E,S==="fill"?this[I].u_gradientType=1:this[I].u_gradientType=0,this[X](),this;}},{key:"setUniforms",value:function setUniforms(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return Object.assign(this[I],N),this;}},{key:"setTransform",value:function setTransform(){var $=this[L];for(var _len3=arguments.length,N=new Array(_len3),_key3=0;_key3<_len3;_key3++){N[_key3]=arguments[_key3];}return e.mat2d.equals(N,$)||(this[L]=N,delete this[D],this._updateMatrix=!0),this;}},{key:"transform",value:function transform(){var $=this[L];for(var _len4=arguments.length,N=new Array(_len4),_key4=0;_key4<_len4;_key4++){N[_key4]=arguments[_key4];}return this[L]=e.mat2d.multiply(Array.of(0,0,0,0,0,0),$,N),delete this[D],this._updateMatrix=!0,this;}},{key:"translate",value:function translate(N,$){var S=e.mat2d.create();return S=e.mat2d.translate(Array.of(0,0,0,0,0,0),S,[N,$]),this.transform.apply(this,_toConsumableArray(S));}},{key:"rotate",value:function rotate(N){var _ref80=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[0,0],_ref81=_slicedToArray(_ref80,2),$=_ref81[0],S=_ref81[1];var E=e.mat2d.create();return E=e.mat2d.translate(Array.of(0,0,0,0,0,0),E,[$,S]),E=e.mat2d.rotate(Array.of(0,0,0,0,0,0),E,N),E=e.mat2d.translate(Array.of(0,0,0,0,0,0),E,[-$,-S]),this.transform.apply(this,_toConsumableArray(E));}},{key:"scale",value:function scale(N){var $=arguments.length>1&&arguments[1]!==undefined?arguments[1]:N;var _ref82=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref83=_slicedToArray(_ref82,2),S=_ref83[0],E=_ref83[1];var w=e.mat2d.create();return w=e.mat2d.translate(Array.of(0,0,0,0,0,0),w,[S,E]),w=e.mat2d.scale(Array.of(0,0,0,0,0,0),w,[N,$]),w=e.mat2d.translate(Array.of(0,0,0,0,0,0),w,[-S,-E]),this.transform.apply(this,_toConsumableArray(w));}},{key:"skew",value:function skew(N){var $=arguments.length>1&&arguments[1]!==undefined?arguments[1]:N;var _ref84=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref85=_slicedToArray(_ref84,2),S=_ref85[0],E=_ref85[1];var w=e.mat2d.create();return w=e.mat2d.translate(Array.of(0,0,0,0,0,0),w,[S,E]),w=e.mat2d.multiply(Array.of(0,0,0,0,0,0),w,e.mat2d.fromValues(1,Math.tan($),Math.tan(N),1,0,0)),w=e.mat2d.translate(Array.of(0,0,0,0,0,0),w,[-S,-E]),this.transform.apply(this,_toConsumableArray(w));}},{key:"clearFilter",value:function clearFilter(){return this.setColorTransform(null),this[z].length=0,this;}},{key:"setColorTransform",value:function setColorTransform(){for(var _len5=arguments.length,N=new Array(_len5),_key5=0;_key5<_len5;_key5++){N[_key5]=arguments[_key5];}return N[0]===null?this.setUniforms({u_filterFlag:0,u_colorMatrix:0}):this.setUniforms({u_filterFlag:1,u_colorMatrix:N}),this;}// apply linear color transform
|
|
56
|
-
},{key:"transformColor",value:function transformColor(){var $=this.uniforms.u_colorMatrix;for(var _len6=arguments.length,N=new Array(_len6),_key6=0;_key6<_len6;_key6++){N[_key6]=arguments[_key6];}return $?$=Object(c.multiply)($,N):$=N,this.setColorTransform.apply(this,_toConsumableArray($)),this;}},{key:"blur",value:function blur(N){return this[z].push("blur(".concat(N,"px)")),this;}},{key:"brightness",value:function brightness(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[z].push("brightness(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(c.brightness)(N)));}},{key:"contrast",value:function contrast(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[z].push("contrast(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(c.contrast)(N)));}},{key:"dropShadow",value:function dropShadow(N,$){var S=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var E=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[0,0,0,1];return Array.isArray(E)&&(E=Object(s["default"])(E)),this[z].push("drop-shadow(".concat(N,"px ").concat($,"px ").concat(S,"px ").concat(E,")")),this;}},{key:"grayscale",value:function grayscale(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[z].push("grayscale(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(c.grayscale)(N)));}// https://github.com/phoboslab/WebGLImageFilter/blob/master/webgl-image-filter.js#L371
|
|
57
|
-
},{key:"hueRotate",value:function hueRotate(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this[z].push("hue-rotate(".concat(N,"deg)")),this.transformColor.apply(this,_toConsumableArray(Object(c.hueRotate)(N)));}},{key:"invert",value:function invert(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[z].push("invert(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(c.invert)(N)));}},{key:"opacity",value:function opacity(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[z].push("opacity(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(c.opacity)(N)));}},{key:"saturate",value:function saturate(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[z].push("saturate(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(c.saturate)(N)));}},{key:"sepia",value:function sepia(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[z].push("sepia(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(c.sepia)(N)));}},{key:"url",value:function url(N){return this[z].push("url(".concat(N,")")),this;}},{key:"isPointCollision",value:function isPointCollision(N,$){var S=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"both";var E=this.meshData,w=E.positions,j=E.cells,K=this.invertMatrix,Y=K[0]*N+K[2]*$+K[4],k=K[1]*N+K[3]*$+K[5],nt=this.boundingBox;if(Y<nt[0][0]||Y>nt[1][0]||k<nt[0][1]||k>nt[1][1])return!1;function it(_ref86,_ref87,_ref88){var _ref89=_slicedToArray(_ref86,2),lt=_ref89[0],ut=_ref89[1];var _ref90=_slicedToArray(_ref87,2),at=_ref90[0],ot=_ref90[1];var _ref91=_slicedToArray(_ref88,2),ct=_ref91[0],vt=_ref91[1];var mt=ct-at,pt=vt-ot,St=((lt-at)*mt+(ut-ot)*pt)/(Math.pow(mt,2)+Math.pow(pt,2));return St>=0&&St<=1;}for(var lt=0;lt<j.length;lt++){var ut=j[lt];if(S==="fill"&&ut[0]>=E.fillPointCount)break;if(S==="stroke"&&ut[0]<E.fillPointCount)continue;var _ut$map=ut.map(function(Et){return w[Et];}),_ut$map2=_slicedToArray(_ut$map,3),_ut$map2$=_slicedToArray(_ut$map2[0],2),at=_ut$map2$[0],ot=_ut$map2$[1],_ut$map2$2=_slicedToArray(_ut$map2[1],2),ct=_ut$map2$2[0],vt=_ut$map2$2[1],_ut$map2$3=_slicedToArray(_ut$map2[2],2),mt=_ut$map2$3[0],pt=_ut$map2$3[1],St=Math.sign((N-at)*(vt-ot)-(ct-at)*($-ot));if(St===0&&it([N,$],[at,ot],[ct,vt]))return!0;var Rt=Math.sign((N-ct)*(pt-vt)-(mt-ct)*($-vt));if(Rt===0&&it([N,$],[ct,vt],[mt,pt]))return!0;var Pt=Math.sign((N-mt)*(ot-pt)-(at-mt)*($-pt));if(Pt===0&&it([N,$],[mt,pt],[at,ot])||St===1&&Rt===1&&Pt===1||St===-1&&Rt===-1&&Pt===-1)return!0;}return!1;}},{key:"isPointInFill",value:function isPointInFill(N,$){return this.isPointCollision(N,$,"fill");}},{key:"isPointInStroke",value:function isPointInStroke(N,$){return this.isPointCollision(N,$,"stroke");}},{key:"addPass",value:function addPass(N){var $=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var S=$.width,E=$.height,w=d($,["width","height"]);var j=new x["default"]();j.rect(0,0,S,E);var K=new V(j,{width:S,height:E});K.setUniforms(w),K.setProgram(N),this[st].push(K);}}]);}();},/* 57 */ /***/function(u,r,t){t.r(r);var e=t(58);t(1).glMatrix.setMatrixArrayType(Array),r["default"]=e.Stroke;},/* 58 */ /***/function(u,r,t){t.r(r),t.d(r,"Stroke",function(){return p;});var e=t(49);t(1).glMatrix.setMatrixArrayType(Array);var n=Object(e.create)(),i=Object(e.create)(),a=Object(e.create)(),o=Object(e.create)(),s=Object(e.create)(),c=1e20;var p=/*#__PURE__*/function(){function p(){var _ref92=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref92$lineWidth=_ref92.lineWidth,T=_ref92$lineWidth===void 0?1:_ref92$lineWidth,_ref92$lineJoin=_ref92.lineJoin,m=_ref92$lineJoin===void 0?"miter":_ref92$lineJoin,_ref92$miterLimit=_ref92.miterLimit,x=_ref92$miterLimit===void 0?10:_ref92$miterLimit,_ref92$lineCap=_ref92.lineCap,l=_ref92$lineCap===void 0?"butt":_ref92$lineCap,_ref92$roundSegments=_ref92.roundSegments,d=_ref92$roundSegments===void 0?20:_ref92$roundSegments;_classCallCheck(this,p);this.lineWidth=T,this.lineJoin=m,this.miterLimit=x,this.lineCap=l,this.roundSegments=d,this._normal=null;}return _createClass(p,[{key:"build",value:function build(T){var m=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;var x=T.length;if(T=_toConsumableArray(T),x<2)return T;m&&((T[0][0]!==T[x-1][0]||T[0][1]!==T[x-1][1])&&T.push(_toConsumableArray(T[0])),T.push(_toConsumableArray(T[1]))),x=T.length,this._normal=null;var l={left:[],right:[]},d=this.lineWidth/2,f=this.lineCap;if(!m&&f==="square"){Object(e.direction)(i,T[0],T[1]),Object(e.scaleAndAdd)(T[0],T[0],i,d);var O=T.length-1;Object(e.direction)(i,T[O],T[O-1]),Object(e.scaleAndAdd)(T[O],T[O],i,d);}for(var _O4=1;_O4<x;_O4++){var A=T[_O4-1],R=T[_O4],b=T[_O4+1];this._seg(l,A,R,b,d,m);}return!m&&f==="round"&&y(l,this.roundSegments),[].concat(_toConsumableArray(l.left),_toConsumableArray(l.right.reverse()));}},{key:"_seg",value:function _seg(T,m,x,l,d,f){var g=this.lineJoin==="bevel",O=this.lineJoin==="round";if(Object(e.direction)(i,x,m),this._normal||(this._normal=Object(e.create)(),Object(e.normal)(this._normal,i)),T.left.length||v(T,m,this._normal,d),!l)Object(e.normal)(this._normal,i),f?v(T,m,this._normal,d):v(T,x,this._normal,d);else{Object(e.direction)(a,l,x);var A=Object(e.computeMiter)(o,s,i,a,d);A=Math.min(A,c);var R=Object(e.dot)(o,this._normal)<0?-1:1;var b=g||O;if(!b&&this.lineJoin==="miter"&&A/d>this.miterLimit&&(b=!0),b){Object(e.scaleAndAdd)(n,x,this._normal,-d*R),h(T,n,R);var P=1/0;m&&(P=Math.min(P,Math.hypot(x[0]-m[0],x[1]-m[1]))),l&&(P=Math.min(P,Math.hypot(l[0]-x[0],l[1]-x[1])));var L=Math.max(d,Math.min(A,P));if(Object(e.scaleAndAdd)(n,x,s,L*R),h(T,n,-R),l)if(Object(e.normal)(n,a),Object(e.copy)(this._normal,n),Object(e.scaleAndAdd)(n,x,n,-d*R),O){var D=Object(e.clone)(n),I=R>0?T.left[T.left.length-1]:T.right[T.right.length-1],C=Object(e.clone)(x),B=Object(e.sub)(Object(e.create)(),I,C),G=Object(e.sub)(Object(e.create)(),D,C),H=Math.PI/this.roundSegments;for(var X=0;X<this.roundSegments&&(Object(e.rotate)(B,B,[0,0],R*H),Math.sign(Object(e.cross)(n,B,G)[2])===R);X++)Object(e.add)(n,B,C),h(T,n,R);h(T,D,R);}else h(T,n,R);}else v(T,x,s,A),Object(e.copy)(this._normal,s);}}}]);}();function h(M,T,m){m>0?M.left.push(Object(e.clone)(T)):M.right.push(Object(e.clone)(T));}function v(M,T,m,x){var l=arguments.length>4&&arguments[4]!==undefined?arguments[4]:-1;Object(e.scaleAndAdd)(n,T,m,-x),h(M,n,-l),Object(e.scaleAndAdd)(n,T,m,x),h(M,n,l);}function y(_ref93,m){var M=_ref93.left,T=_ref93.right;var x=Object(e.create)(),l=Object(e.create)();var d=M[0],f=T[0],g=[0.5*(d[0]+f[0]),0.5*(d[1]+f[1])];Object(e.sub)(l,d,g);for(var O=1;O<=m;O++){var A=-1*Math.PI*O/m;Object(e.rotate)(x,l,[0,0],A),Object(e.add)(n,g,x),M.unshift(Object(e.clone)(n));}d=T[T.length-1],f=M[M.length-1],g=[0.5*(d[0]+f[0]),0.5*(d[1]+f[1])],Object(e.sub)(l,d,g);for(var _O5=1;_O5<=m;_O5++){var _A2=-1*Math.PI*_O5/m;Object(e.rotate)(x,l,[0,0],_A2),Object(e.add)(n,g,x),T.push(Object(e.clone)(n));}}},/* 59 */ /***/function(u,r,t){t.r(r),t.d(r,"isUnitTransform",function(){return e;}),t(1).glMatrix.setMatrixArrayType(Array);function e(n){return n[0]===1&&n[1]===0&&n[2]===0&&n[3]===1&&n[4]===0&&n[5]===0;}},/* 60 */ /***/function(u,r,t){t(1).glMatrix.setMatrixArrayType(Array);var e=t(61),n=t(62);u.exports=function(i,a){if(a=a||{},i=i.filter(function(m){return m.length>2;}),i.length===0)return{positions:[],cells:[]};typeof a.vertexSize!="number"&&(a.vertexSize=i[0][0].length),i=i.map(function(m){return m.reduce(function(x,l){return x.concat(l);});});var o=a.rule==="evenodd"?e.WINDING_ODD:e.WINDING_NONZERO;for(var s=e.tesselate(n({contours:i,windingRule:o,elementType:e.POLYGONS,polySize:3,vertexSize:2},a)),c=[],p=0;p<s.vertices.length;p+=a.vertexSize){var h=s.vertices.slice(p,p+a.vertexSize);c.push(h);}var v=[];for(p=0;p<s.elements.length;p+=3){var y=s.elements[p],M=s.elements[p+1],T=s.elements[p+2];v.push([y,M,T]);}return{positions:c,cells:v};};},/* 61 */ /***/function(u,r,t){t(1).glMatrix.setMatrixArrayType(Array);var e={},n={};u.exports=e,e.WINDING_ODD=0,e.WINDING_NONZERO=1,e.WINDING_POSITIVE=2,e.WINDING_NEGATIVE=3,e.WINDING_ABS_GEQ_TWO=4,e.POLYGONS=0,e.CONNECTED_POLYGONS=1,e.BOUNDARY_CONTOURS=2,e.tesselate=function(l){for(var d=l.debug||!1,f=new x(),g=0;g<l.contours.length;g++)f.addContour(l.vertexSize||2,l.contours[g]);return f.tesselate(l.windingRule||e.WINDING_ODD,l.elementType||e.POLYGONS,l.polySize||3,l.vertexSize||2,l.normal||[0,0,1]),{vertices:f.vertices,vertexIndices:f.vertexIndices,vertexCount:f.vertexCount,elements:f.elements,elementCount:f.elementCount,mesh:d?f.mesh:void 0};};var i=function i(l){if(!l)throw"Assertion Failed!";};function a(){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 s(l){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=l;}s.prototype={get Rface(){return this.Sym.Lface;},set Rface(l){this.Sym.Lface=l;},get Dst(){return this.Sym.Org;},set Dst(l){this.Sym.Org=l;},get Oprev(){return this.Sym.Lnext;},set Oprev(l){this.Sym.Lnext=l;},get Lprev(){return this.Onext.Sym;},set Lprev(l){this.Onext.Sym=l;},get Dprev(){return this.Lnext.Sym;},set Dprev(l){this.Lnext.Sym=l;},get Rprev(){return this.Sym.Onext;},set Rprev(l){this.Sym.Onext=l;},get Dnext(){return/*this.Rprev*/this.Sym.Onext.Sym;},/* 3 pointers */set Dnext(l){this.Sym.Onext.Sym=l;},/* 3 pointers */get Rnext(){return/*this.Oprev*/this.Sym.Lnext.Sym;},/* 3 pointers */set Rnext(l){this.Sym.Lnext.Sym=l;}/* 3 pointers */};function c(){var l=new a(),d=new o(),f=new s(0),g=new s(1);l.next=l.prev=l,l.anEdge=null,d.next=d.prev=d,d.anEdge=null,d.trail=null,d.marked=!1,d.inside=!1,f.next=f,f.Sym=g,f.Onext=null,f.Lnext=null,f.Org=null,f.Lface=null,f.winding=0,f.activeRegion=null,g.next=g,g.Sym=f,g.Onext=null,g.Lnext=null,g.Org=null,g.Lface=null,g.winding=0,g.activeRegion=null,this.vHead=l,this.fHead=d,this.eHead=f,this.eHeadSym=g;}c.prototype={/* MakeEdge creates a new pair of half-edges which form their own loop.
|
|
58
|
-
* No vertex or face structures are allocated, but these must be assigned
|
|
59
|
-
* before the current edge operation is completed.
|
|
60
|
-
*/ //static TESShalfEdge *MakeEdge( TESSmesh* mesh, TESShalfEdge *eNext )
|
|
61
|
-
makeEdge_:function makeEdge_(l){var d=new s(0),f=new s(1);l.Sym.side<l.side&&(l=l.Sym);var g=l.Sym.next;return f.next=g,g.Sym.next=d,d.next=l,l.Sym.next=f,d.Sym=f,d.Onext=d,d.Lnext=f,d.Org=null,d.Lface=null,d.winding=0,d.activeRegion=null,f.Sym=d,f.Onext=f,f.Lnext=d,f.Org=null,f.Lface=null,f.winding=0,f.activeRegion=null,d;},/* Splice( a, b ) is best described by the Guibas/Stolfi paper or the
|
|
62
|
-
* CS348a notes (see mesh.h). Basically it modifies the mesh so that
|
|
63
|
-
* a->Onext and b->Onext are exchanged. This can have various effects
|
|
64
|
-
* depending on whether a and b belong to different face or vertex rings.
|
|
65
|
-
* For more explanation see tessMeshSplice() below.
|
|
66
|
-
*/ // static void Splice( TESShalfEdge *a, TESShalfEdge *b )
|
|
67
|
-
splice_:function splice_(l,d){var f=l.Onext,g=d.Onext;f.Sym.Lnext=d,g.Sym.Lnext=l,l.Onext=g,d.Onext=f;},/* MakeVertex( newVertex, eOrig, vNext ) attaches a new vertex and makes it the
|
|
68
|
-
* origin of all edges in the vertex loop to which eOrig belongs. "vNext" gives
|
|
69
|
-
* a place to insert the new vertex in the global vertex list. We insert
|
|
70
|
-
* the new vertex *before* vNext so that algorithms which walk the vertex
|
|
71
|
-
* list will not see the newly created vertices.
|
|
72
|
-
*/ //static void MakeVertex( TESSvertex *newVertex, TESShalfEdge *eOrig, TESSvertex *vNext )
|
|
73
|
-
makeVertex_:function makeVertex_(l,d,f){var g=l;i(g!==null);var O=f.prev;g.prev=O,O.next=g,g.next=f,f.prev=g,g.anEdge=d;var A=d;do A.Org=g,A=A.Onext;while(A!==d);},/* MakeFace( newFace, eOrig, fNext ) attaches a new face and makes it the left
|
|
74
|
-
* face of all edges in the face loop to which eOrig belongs. "fNext" gives
|
|
75
|
-
* a place to insert the new face in the global face list. We insert
|
|
76
|
-
* the new face *before* fNext so that algorithms which walk the face
|
|
77
|
-
* list will not see the newly created faces.
|
|
78
|
-
*/ // static void MakeFace( TESSface *newFace, TESShalfEdge *eOrig, TESSface *fNext )
|
|
79
|
-
makeFace_:function makeFace_(l,d,f){var g=l;i(g!==null);var O=f.prev;g.prev=O,O.next=g,g.next=f,f.prev=g,g.anEdge=d,g.trail=null,g.marked=!1,g.inside=f.inside;var A=d;do A.Lface=g,A=A.Lnext;while(A!==d);},/* KillEdge( eDel ) destroys an edge (the half-edges eDel and eDel->Sym),
|
|
80
|
-
* and removes from the global edge list.
|
|
81
|
-
*/ //static void KillEdge( TESSmesh *mesh, TESShalfEdge *eDel )
|
|
82
|
-
killEdge_:function killEdge_(l){l.Sym.side<l.side&&(l=l.Sym);var d=l.next,f=l.Sym.next;d.Sym.next=f,f.Sym.next=d;},/* KillVertex( vDel ) destroys a vertex and removes it from the global
|
|
83
|
-
* vertex list. It updates the vertex loop to point to a given new vertex.
|
|
84
|
-
*/ //static void KillVertex( TESSmesh *mesh, TESSvertex *vDel, TESSvertex *newOrg )
|
|
85
|
-
killVertex_:function killVertex_(l,d){var f=l.anEdge,g=f;do g.Org=d,g=g.Onext;while(g!==f);var O=l.prev,A=l.next;A.prev=O,O.next=A;},/* KillFace( fDel ) destroys a face and removes it from the global face
|
|
86
|
-
* list. It updates the face loop to point to a given new face.
|
|
87
|
-
*/ //static void KillFace( TESSmesh *mesh, TESSface *fDel, TESSface *newLface )
|
|
88
|
-
killFace_:function killFace_(l,d){var f=l.anEdge,g=f;do g.Lface=d,g=g.Lnext;while(g!==f);var O=l.prev,A=l.next;A.prev=O,O.next=A;},/****************** Basic Edge Operations **********************/ /* tessMeshMakeEdge creates one edge, two vertices, and a loop (face).
|
|
89
|
-
* The loop consists of the two new half-edges.
|
|
90
|
-
*/ //TESShalfEdge *tessMeshMakeEdge( TESSmesh *mesh )
|
|
91
|
-
makeEdge:function makeEdge(){var l=new a(),d=new a(),f=new o(),g=this.makeEdge_(this.eHead);return this.makeVertex_(l,g,this.vHead),this.makeVertex_(d,g.Sym,this.vHead),this.makeFace_(f,g,this.fHead),g;},/* tessMeshSplice( eOrg, eDst ) is the basic operation for changing the
|
|
92
|
-
* mesh connectivity and topology. It changes the mesh so that
|
|
93
|
-
* eOrg->Onext <- OLD( eDst->Onext )
|
|
94
|
-
* eDst->Onext <- OLD( eOrg->Onext )
|
|
95
|
-
* where OLD(...) means the value before the meshSplice operation.
|
|
96
|
-
*
|
|
97
|
-
* This can have two effects on the vertex structure:
|
|
98
|
-
* - if eOrg->Org != eDst->Org, the two vertices are merged together
|
|
99
|
-
* - if eOrg->Org == eDst->Org, the origin is split into two vertices
|
|
100
|
-
* In both cases, eDst->Org is changed and eOrg->Org is untouched.
|
|
101
|
-
*
|
|
102
|
-
* Similarly (and independently) for the face structure,
|
|
103
|
-
* - if eOrg->Lface == eDst->Lface, one loop is split into two
|
|
104
|
-
* - if eOrg->Lface != eDst->Lface, two distinct loops are joined into one
|
|
105
|
-
* In both cases, eDst->Lface is changed and eOrg->Lface is unaffected.
|
|
106
|
-
*
|
|
107
|
-
* Some special cases:
|
|
108
|
-
* If eDst == eOrg, the operation has no effect.
|
|
109
|
-
* If eDst == eOrg->Lnext, the new face will have a single edge.
|
|
110
|
-
* If eDst == eOrg->Lprev, the old face will have a single edge.
|
|
111
|
-
* If eDst == eOrg->Onext, the new vertex will have a single edge.
|
|
112
|
-
* If eDst == eOrg->Oprev, the old vertex will have a single edge.
|
|
113
|
-
*/ //int tessMeshSplice( TESSmesh* mesh, TESShalfEdge *eOrg, TESShalfEdge *eDst )
|
|
114
|
-
splice:function splice(l,d){var f=!1,g=!1;if(l!==d){if(d.Org!==l.Org&&(g=!0,this.killVertex_(d.Org,l.Org)),d.Lface!==l.Lface&&(f=!0,this.killFace_(d.Lface,l.Lface)),this.splice_(d,l),!g){var O=new a();this.makeVertex_(O,d,l.Org),l.Org.anEdge=l;}if(!f){var A=new o();this.makeFace_(A,d,l.Lface),l.Lface.anEdge=l;}}},/* tessMeshDelete( eDel ) removes the edge eDel. There are several cases:
|
|
115
|
-
* if (eDel->Lface != eDel->Rface), we join two loops into one; the loop
|
|
116
|
-
* eDel->Lface is deleted. Otherwise, we are splitting one loop into two;
|
|
117
|
-
* the newly created loop will contain eDel->Dst. If the deletion of eDel
|
|
118
|
-
* would create isolated vertices, those are deleted as well.
|
|
119
|
-
*
|
|
120
|
-
* This function could be implemented as two calls to tessMeshSplice
|
|
121
|
-
* plus a few calls to memFree, but this would allocate and delete
|
|
122
|
-
* unnecessary vertices and faces.
|
|
123
|
-
*/ //int tessMeshDelete( TESSmesh *mesh, TESShalfEdge *eDel )
|
|
124
|
-
"delete":function _delete(l){var d=l.Sym,f=!1;if(l.Lface!==l.Rface&&(f=!0,this.killFace_(l.Lface,l.Rface)),l.Onext===l)this.killVertex_(l.Org,null);else if(l.Rface.anEdge=l.Oprev,l.Org.anEdge=l.Onext,this.splice_(l,l.Oprev),!f){var g=new o();this.makeFace_(g,l,l.Lface);}d.Onext===d?(this.killVertex_(d.Org,null),this.killFace_(d.Lface,null)):(l.Lface.anEdge=d.Oprev,d.Org.anEdge=d.Onext,this.splice_(d,d.Oprev)),this.killEdge_(l);},/******************** Other Edge Operations **********************/ /* All these routines can be implemented with the basic edge
|
|
125
|
-
* operations above. They are provided for convenience and efficiency.
|
|
126
|
-
*/ /* tessMeshAddEdgeVertex( eOrg ) creates a new edge eNew such that
|
|
127
|
-
* eNew == eOrg->Lnext, and eNew->Dst is a newly created vertex.
|
|
128
|
-
* eOrg and eNew will have the same left face.
|
|
129
|
-
*/ // TESShalfEdge *tessMeshAddEdgeVertex( TESSmesh *mesh, TESShalfEdge *eOrg );
|
|
130
|
-
addEdgeVertex:function addEdgeVertex(l){var d=this.makeEdge_(l),f=d.Sym;this.splice_(d,l.Lnext),d.Org=l.Dst;var g=new a();return this.makeVertex_(g,f,d.Org),d.Lface=f.Lface=l.Lface,d;},/* tessMeshSplitEdge( eOrg ) splits eOrg into two edges eOrg and eNew,
|
|
131
|
-
* such that eNew == eOrg->Lnext. The new vertex is eOrg->Dst == eNew->Org.
|
|
132
|
-
* eOrg and eNew will have the same left face.
|
|
133
|
-
*/ // TESShalfEdge *tessMeshSplitEdge( TESSmesh *mesh, TESShalfEdge *eOrg );
|
|
134
|
-
splitEdge:function splitEdge(l,d){var f=this.addEdgeVertex(l),g=f.Sym;return this.splice_(l.Sym,l.Sym.Oprev),this.splice_(l.Sym,g),l.Dst=g.Org,g.Dst.anEdge=g.Sym,g.Rface=l.Rface,g.winding=l.winding,g.Sym.winding=l.Sym.winding,g;},/* tessMeshConnect( eOrg, eDst ) creates a new edge from eOrg->Dst
|
|
135
|
-
* to eDst->Org, and returns the corresponding half-edge eNew.
|
|
136
|
-
* If eOrg->Lface == eDst->Lface, this splits one loop into two,
|
|
137
|
-
* and the newly created loop is eNew->Lface. Otherwise, two disjoint
|
|
138
|
-
* loops are merged into one, and the loop eDst->Lface is destroyed.
|
|
139
|
-
*
|
|
140
|
-
* If (eOrg == eDst), the new face will have only two edges.
|
|
141
|
-
* If (eOrg->Lnext == eDst), the old face is reduced to a single edge.
|
|
142
|
-
* If (eOrg->Lnext->Lnext == eDst), the old face is reduced to two edges.
|
|
143
|
-
*/ // TESShalfEdge *tessMeshConnect( TESSmesh *mesh, TESShalfEdge *eOrg, TESShalfEdge *eDst );
|
|
144
|
-
connect:function connect(l,d){var f=!1,g=this.makeEdge_(l),O=g.Sym;if(d.Lface!==l.Lface&&(f=!0,this.killFace_(d.Lface,l.Lface)),this.splice_(g,l.Lnext),this.splice_(O,d),g.Org=l.Dst,O.Org=d.Org,g.Lface=O.Lface=l.Lface,l.Lface.anEdge=O,!f){var A=new o();this.makeFace_(A,g,l.Lface);}return g;},/* tessMeshZapFace( fZap ) destroys a face and removes it from the
|
|
145
|
-
* global face list. All edges of fZap will have a NULL pointer as their
|
|
146
|
-
* left face. Any edges which also have a NULL pointer as their right face
|
|
147
|
-
* are deleted entirely (along with any isolated vertices this produces).
|
|
148
|
-
* An entire mesh can be deleted by zapping its faces, one at a time,
|
|
149
|
-
* in any order. Zapped faces cannot be used in further mesh operations!
|
|
150
|
-
*/zapFace:function zapFace(l){var d=l.anEdge,f,g,O,A,R;g=d.Lnext;do f=g,g=f.Lnext,f.Lface=null,f.Rface===null&&(f.Onext===f?this.killVertex_(f.Org,null):(f.Org.anEdge=f.Onext,this.splice_(f,f.Oprev)),O=f.Sym,O.Onext===O?this.killVertex_(O.Org,null):(O.Org.anEdge=O.Onext,this.splice_(O,O.Oprev)),this.killEdge_(f));while(f!=d);A=l.prev,R=l.next,R.prev=A,A.next=R;},countFaceVerts_:function countFaceVerts_(l){var d=l.anEdge,f=0;do f++,d=d.Lnext;while(d!==l.anEdge);return f;},//int tessMeshMergeConvexFaces( TESSmesh *mesh, int maxVertsPerFace )
|
|
151
|
-
mergeConvexFaces:function mergeConvexFaces(l){var d,f,g,O,A,R,b;for(d=this.fHead.next;d!==this.fHead;d=d.next)if(d.inside)for(f=d.anEdge,A=f.Org;g=f.Lnext,O=f.Sym,O&&O.Lface&&O.Lface.inside&&(R=this.countFaceVerts_(d),b=this.countFaceVerts_(O.Lface),R+b-2<=l&&n.vertCCW(f.Lprev.Org,f.Org,O.Lnext.Lnext.Org)&&n.vertCCW(O.Lprev.Org,O.Org,f.Lnext.Lnext.Org)&&(g=O.Lnext,this["delete"](O),f=null,O=null)),!(f&&f.Lnext.Org===A);)f=g;return!0;},/* tessMeshCheckMesh( mesh ) checks a mesh for self-consistency.
|
|
152
|
-
*/check:function check(){var l=this.fHead,d=this.vHead,f=this.eHead,g,O,A,R,b,P;for(O=l,O=l;(g=O.next)!==l;O=g){i(g.prev===O),b=g.anEdge;do i(b.Sym!==b),i(b.Sym.Sym===b),i(b.Lnext.Onext.Sym===b),i(b.Onext.Sym.Lnext===b),i(b.Lface===g),b=b.Lnext;while(b!==g.anEdge);}for(i(g.prev===O&&g.anEdge===null),R=d,R=d;(A=R.next)!==d;R=A){i(A.prev===R),b=A.anEdge;do i(b.Sym!==b),i(b.Sym.Sym===b),i(b.Lnext.Onext.Sym===b),i(b.Onext.Sym.Lnext===b),i(b.Org===A),b=b.Onext;while(b!==A.anEdge);}for(i(A.prev===R&&A.anEdge===null),P=f,P=f;(b=P.next)!==f;P=b)i(b.Sym.next===P.Sym),i(b.Sym!==b),i(b.Sym.Sym===b),i(b.Org!==null),i(b.Dst!==null),i(b.Lnext.Onext.Sym===b),i(b.Onext.Sym.Lnext===b);i(b.Sym.next===P.Sym&&b.Sym===this.eHeadSym&&b.Sym.Sym===b&&b.Org===null&&b.Dst===null&&b.Lface===null&&b.Rface===null);}},n.vertEq=function(l,d){return l.s===d.s&&l.t===d.t;},n.vertLeq=function(l,d){return l.s<d.s||l.s===d.s&&l.t<=d.t;},n.transLeq=function(l,d){return l.t<d.t||l.t===d.t&&l.s<=d.s;},n.edgeGoesLeft=function(l){return n.vertLeq(l.Dst,l.Org);},n.edgeGoesRight=function(l){return n.vertLeq(l.Org,l.Dst);},n.vertL1dist=function(l,d){return Math.abs(l.s-d.s)+Math.abs(l.t-d.t);},n.edgeEval=function(l,d,f){i(n.vertLeq(l,d)&&n.vertLeq(d,f));var g=d.s-l.s,O=f.s-d.s;return g+O>0?g<O?d.t-l.t+(l.t-f.t)*(g/(g+O)):d.t-f.t+(f.t-l.t)*(O/(g+O)):0;},n.edgeSign=function(l,d,f){i(n.vertLeq(l,d)&&n.vertLeq(d,f));var g=d.s-l.s,O=f.s-d.s;return g+O>0?(d.t-f.t)*g+(d.t-l.t)*O:0;},n.transEval=function(l,d,f){i(n.transLeq(l,d)&&n.transLeq(d,f));var g=d.t-l.t,O=f.t-d.t;return g+O>0?g<O?d.s-l.s+(l.s-f.s)*(g/(g+O)):d.s-f.s+(f.s-l.s)*(O/(g+O)):0;},n.transSign=function(l,d,f){i(n.transLeq(l,d)&&n.transLeq(d,f));var g=d.t-l.t,O=f.t-d.t;return g+O>0?(d.s-f.s)*g+(d.s-l.s)*O:0;},n.vertCCW=function(l,d,f){return l.s*(d.t-f.t)+d.s*(f.t-l.t)+f.s*(l.t-d.t)>=0;},n.interpolate=function(l,d,f,g){return l=l<0?0:l,f=f<0?0:f,l<=f?f===0?(d+g)/2:d+(g-d)*(l/(l+f)):g+(d-g)*(f/(l+f));},n.intersect=function(l,d,f,g,O){var A,R,b;n.vertLeq(l,d)||(b=l,l=d,d=b),n.vertLeq(f,g)||(b=f,f=g,g=b),n.vertLeq(l,f)||(b=l,l=f,f=b,b=d,d=g,g=b),n.vertLeq(f,d)?n.vertLeq(d,g)?(A=n.edgeEval(l,f,d),R=n.edgeEval(f,d,g),A+R<0&&(A=-A,R=-R),O.s=n.interpolate(A,f.s,R,d.s)):(A=n.edgeSign(l,f,d),R=-n.edgeSign(l,g,d),A+R<0&&(A=-A,R=-R),O.s=n.interpolate(A,f.s,R,g.s)):O.s=(f.s+d.s)/2,n.transLeq(l,d)||(b=l,l=d,d=b),n.transLeq(f,g)||(b=f,f=g,g=b),n.transLeq(l,f)||(b=l,l=f,f=b,b=d,d=g,g=b),n.transLeq(f,d)?n.transLeq(d,g)?(A=n.transEval(l,f,d),R=n.transEval(f,d,g),A+R<0&&(A=-A,R=-R),O.t=n.interpolate(A,f.t,R,d.t)):(A=n.transSign(l,f,d),R=-n.transSign(l,g,d),A+R<0&&(A=-A,R=-R),O.t=n.interpolate(A,f.t,R,g.t)):O.t=(f.t+d.t)/2;};function p(){this.key=null,this.next=null,this.prev=null;}function h(l,d){this.head=new p(),this.head.next=this.head,this.head.prev=this.head,this.frame=l,this.leq=d;}h.prototype={min:function min(){return this.head.next;},max:function max(){return this.head.prev;},insert:function insert(l){return this.insertBefore(this.head,l);},search:function search(l){var d=this.head;do d=d.next;while(d.key!==null&&!this.leq(this.frame,l,d.key));return d;},insertBefore:function insertBefore(l,d){do l=l.prev;while(l.key!==null&&!this.leq(this.frame,l.key,d));var f=new p();return f.key=d,f.next=l.next,l.next.prev=f,f.prev=l,l.next=f,f;},"delete":function _delete(l){l.next.prev=l.prev,l.prev.next=l.next;}};function v(){this.handle=null;}function y(){this.key=null,this.node=null;}function M(l,d){this.size=0,this.max=l,this.nodes=[],this.nodes.length=l+1;var f;for(f=0;f<this.nodes.length;f++)this.nodes[f]=new v();for(this.handles=[],this.handles.length=l+1,f=0;f<this.handles.length;f++)this.handles[f]=new y();this.initialized=!1,this.freeList=0,this.leq=d,this.nodes[1].handle=1,this.handles[1].key=null;}M.prototype={floatDown_:function floatDown_(l){var d=this.nodes,f=this.handles,g,O,A;for(g=d[l].handle;;){if(A=l<<1,A<this.size&&this.leq(f[d[A+1].handle].key,f[d[A].handle].key)&&++A,i(A<=this.max),O=d[A].handle,A>this.size||this.leq(f[g].key,f[O].key)){d[l].handle=g,f[g].node=l;break;}d[l].handle=O,f[O].node=l,l=A;}},floatUp_:function floatUp_(l){var d=this.nodes,f=this.handles,g,O,A;for(g=d[l].handle;;){if(A=l>>1,O=d[A].handle,A===0||this.leq(f[O].key,f[g].key)){d[l].handle=g,f[g].node=l;break;}d[l].handle=O,f[O].node=l,l=A;}},init:function init(){for(var l=this.size;l>=1;--l)this.floatDown_(l);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 )
|
|
153
|
-
insert:function insert(l){var d,f;if(d=++this.size,d*2>this.max){this.max*=2;var g,O;for(O=this.nodes.length,this.nodes.length=this.max+1,g=O;g<this.nodes.length;g++)this.nodes[g]=new v();for(O=this.handles.length,this.handles.length=this.max+1,g=O;g<this.handles.length;g++)this.handles[g]=new y();}return this.freeList===0?f=d:(f=this.freeList,this.freeList=this.handles[f].node),this.nodes[d].handle=f,this.handles[f].node=d,this.handles[f].key=l,this.initialized&&this.floatUp_(d),f;},//PQkey pqHeapExtractMin( PriorityQHeap *pq )
|
|
154
|
-
extractMin:function extractMin(){var l=this.nodes,d=this.handles,f=l[1].handle,g=d[f].key;return this.size>0&&(l[1].handle=l[this.size].handle,d[l[1].handle].node=1,d[f].key=null,d[f].node=this.freeList,this.freeList=f,--this.size,this.size>0&&this.floatDown_(1)),g;},"delete":function _delete(l){var d=this.nodes,f=this.handles,g;i(l>=1&&l<=this.max&&f[l].key!==null),g=f[l].node,d[g].handle=d[this.size].handle,f[d[g].handle].node=g,--this.size,g<=this.size&&(g<=1||this.leq(f[d[g>>1].handle].key,f[d[g].handle].key)?this.floatDown_(g):this.floatUp_(g)),f[l].key=null,f[l].node=this.freeList,this.freeList=l;}};function T(){this.eUp=null,this.nodeUp=null,this.windingNumber=0,this.inside=!1,this.sentinel=!1,this.dirty=!1,this.fixUpperEdge=!1;}var m={};m.regionBelow=function(l){return l.nodeUp.prev.key;},m.regionAbove=function(l){return l.nodeUp.next.key;},m.debugEvent=function(l){},m.addWinding=function(l,d){l.winding+=d.winding,l.Sym.winding+=d.Sym.winding;},m.edgeLeq=function(l,d,f){var g=l.event,R,b,O=d.eUp,A=f.eUp;if(O.Dst===g)return A.Dst===g?n.vertLeq(O.Org,A.Org)?n.edgeSign(A.Dst,O.Org,A.Org)<=0:n.edgeSign(O.Dst,A.Org,O.Org)>=0:n.edgeSign(A.Dst,g,A.Org)<=0;if(A.Dst===g)return n.edgeSign(O.Dst,g,O.Org)>=0;var R=n.edgeEval(O.Dst,g,O.Org),b=n.edgeEval(A.Dst,g,A.Org);return R>=b;},m.deleteRegion=function(l,d){d.fixUpperEdge&&i(d.eUp.winding===0),d.eUp.activeRegion=null,l.dict["delete"](d.nodeUp);},m.fixUpperEdge=function(l,d,f){i(d.fixUpperEdge),l.mesh["delete"](d.eUp),d.fixUpperEdge=!1,d.eUp=f,f.activeRegion=d;},m.topLeftRegion=function(l,d){var f=d.eUp.Org,g;do d=m.regionAbove(d);while(d.eUp.Org===f);if(d.fixUpperEdge){if(g=l.mesh.connect(m.regionBelow(d).eUp.Sym,d.eUp.Lnext),g===null)return null;m.fixUpperEdge(l,d,g),d=m.regionAbove(d);}return d;},m.topRightRegion=function(l){var d=l.eUp.Dst;do l=m.regionAbove(l);while(l.eUp.Dst===d);return l;},m.addRegionBelow=function(l,d,f){var g=new T();return g.eUp=f,g.nodeUp=l.dict.insertBefore(d.nodeUp,g),g.fixUpperEdge=!1,g.sentinel=!1,g.dirty=!1,f.activeRegion=g,g;},m.isWindingInside=function(l,d){switch(l.windingRule){case e.WINDING_ODD:return(d&1)!==0;case e.WINDING_NONZERO:return d!==0;case e.WINDING_POSITIVE:return d>0;case e.WINDING_NEGATIVE:return d<0;case e.WINDING_ABS_GEQ_TWO:return d>=2||d<=-2;}return i(!1),!1;},m.computeWinding=function(l,d){d.windingNumber=m.regionAbove(d).windingNumber+d.eUp.winding,d.inside=m.isWindingInside(l,d.windingNumber);},m.finishRegion=function(l,d){var f=d.eUp,g=f.Lface;g.inside=d.inside,g.anEdge=f,m.deleteRegion(l,d);},m.finishLeftRegions=function(l,d,f){for(var g,R,O=null,A=d,R=d.eUp;A!==f;){if(A.fixUpperEdge=!1,O=m.regionBelow(A),g=O.eUp,g.Org!=R.Org){if(!O.fixUpperEdge){m.finishRegion(l,A);break;}g=l.mesh.connect(R.Lprev,g.Sym),m.fixUpperEdge(l,O,g);}R.Onext!==g&&(l.mesh.splice(g.Oprev,g),l.mesh.splice(R,g)),m.finishRegion(l,A),R=O.eUp,A=O;}return R;},m.addRightEdges=function(l,d,f,g,O,A){var R,b,P,L,D=!0;P=f;do i(n.vertLeq(P.Org,P.Dst)),m.addRegionBelow(l,d,P.Sym),P=P.Onext;while(P!==g);for(O===null&&(O=m.regionBelow(d).eUp.Rprev),b=d,L=O;R=m.regionBelow(b),P=R.eUp.Sym,P.Org===L.Org;)P.Onext!==L&&(l.mesh.splice(P.Oprev,P),l.mesh.splice(L.Oprev,P)),R.windingNumber=b.windingNumber-P.winding,R.inside=m.isWindingInside(l,R.windingNumber),b.dirty=!0,!D&&m.checkForRightSplice(l,b)&&(m.addWinding(P,L),m.deleteRegion(l,b),l.mesh["delete"](L)),D=!1,b=R,L=P;b.dirty=!0,i(b.windingNumber-P.winding===R.windingNumber),A&&m.walkDirtyRegions(l,b);},m.spliceMergeVertices=function(l,d,f){l.mesh.splice(d,f);},m.vertexWeights=function(l,d,f){var g=n.vertL1dist(d,l),O=n.vertL1dist(f,l),A=0.5*O/(g+O),R=0.5*g/(g+O);l.coords[0]+=A*d.coords[0]+R*f.coords[0],l.coords[1]+=A*d.coords[1]+R*f.coords[1],l.coords[2]+=A*d.coords[2]+R*f.coords[2];},m.getIntersectData=function(l,d,f,g,O,A){d.coords[0]=d.coords[1]=d.coords[2]=0,d.idx=-1,m.vertexWeights(d,f,g),m.vertexWeights(d,O,A);},m.checkForRightSplice=function(l,d){var f=m.regionBelow(d),g=d.eUp,O=f.eUp;if(n.vertLeq(g.Org,O.Org)){if(n.edgeSign(O.Dst,g.Org,O.Org)>0)return!1;n.vertEq(g.Org,O.Org)?g.Org!==O.Org&&(l.pq["delete"](g.Org.pqHandle),m.spliceMergeVertices(l,O.Oprev,g)):(l.mesh.splitEdge(O.Sym),l.mesh.splice(g,O.Oprev),d.dirty=f.dirty=!0);}else{if(n.edgeSign(g.Dst,O.Org,g.Org)<0)return!1;m.regionAbove(d).dirty=d.dirty=!0,l.mesh.splitEdge(g.Sym),l.mesh.splice(O.Oprev,g);}return!0;},m.checkForLeftSplice=function(l,d){var f=m.regionBelow(d),g=d.eUp,O=f.eUp,A;if(i(!n.vertEq(g.Dst,O.Dst)),n.vertLeq(g.Dst,O.Dst)){if(n.edgeSign(g.Dst,O.Dst,g.Org)<0)return!1;m.regionAbove(d).dirty=d.dirty=!0,A=l.mesh.splitEdge(g),l.mesh.splice(O.Sym,A),A.Lface.inside=d.inside;}else{if(n.edgeSign(O.Dst,g.Dst,O.Org)>0)return!1;d.dirty=f.dirty=!0,A=l.mesh.splitEdge(O),l.mesh.splice(g.Lnext,O.Sym),A.Rface.inside=d.inside;}return!0;},m.checkForIntersect=function(l,d){var f=m.regionBelow(d),g=d.eUp,O=f.eUp,A=g.Org,R=O.Org,b=g.Dst,P=O.Dst,L,D,I=new a(),C,B;if(i(!n.vertEq(P,b)),i(n.edgeSign(b,l.event,A)<=0),i(n.edgeSign(P,l.event,R)>=0),i(A!==l.event&&R!==l.event),i(!d.fixUpperEdge&&!f.fixUpperEdge),A===R||(L=Math.min(A.t,b.t),D=Math.max(R.t,P.t),L>D))return!1;if(n.vertLeq(A,R)){if(n.edgeSign(P,A,R)>0)return!1;}else if(n.edgeSign(b,R,A)<0)return!1;return m.debugEvent(l),n.intersect(b,A,P,R,I),i(Math.min(A.t,b.t)<=I.t),i(I.t<=Math.max(R.t,P.t)),i(Math.min(P.s,b.s)<=I.s),i(I.s<=Math.max(R.s,A.s)),n.vertLeq(I,l.event)&&(I.s=l.event.s,I.t=l.event.t),C=n.vertLeq(A,R)?A:R,n.vertLeq(C,I)&&(I.s=C.s,I.t=C.t),n.vertEq(I,A)||n.vertEq(I,R)?(m.checkForRightSplice(l,d),!1):!n.vertEq(b,l.event)&&n.edgeSign(b,l.event,I)>=0||!n.vertEq(P,l.event)&&n.edgeSign(P,l.event,I)<=0?P===l.event?(l.mesh.splitEdge(g.Sym),l.mesh.splice(O.Sym,g),d=m.topLeftRegion(l,d),g=m.regionBelow(d).eUp,m.finishLeftRegions(l,m.regionBelow(d),f),m.addRightEdges(l,d,g.Oprev,g,g,!0),!0):b===l.event?(l.mesh.splitEdge(O.Sym),l.mesh.splice(g.Lnext,O.Oprev),f=d,d=m.topRightRegion(d),B=m.regionBelow(d).eUp.Rprev,f.eUp=O.Oprev,O=m.finishLeftRegions(l,f,null),m.addRightEdges(l,d,O.Onext,g.Rprev,B,!0),!0):(n.edgeSign(b,l.event,I)>=0&&(m.regionAbove(d).dirty=d.dirty=!0,l.mesh.splitEdge(g.Sym),g.Org.s=l.event.s,g.Org.t=l.event.t),n.edgeSign(P,l.event,I)<=0&&(d.dirty=f.dirty=!0,l.mesh.splitEdge(O.Sym),O.Org.s=l.event.s,O.Org.t=l.event.t),!1):(l.mesh.splitEdge(g.Sym),l.mesh.splitEdge(O.Sym),l.mesh.splice(O.Oprev,g),g.Org.s=I.s,g.Org.t=I.t,g.Org.pqHandle=l.pq.insert(g.Org),m.getIntersectData(l,g.Org,A,b,R,P),m.regionAbove(d).dirty=d.dirty=f.dirty=!0,!1);},m.walkDirtyRegions=function(l,d){for(var f=m.regionBelow(d),g,O;;){for(;f.dirty;)d=f,f=m.regionBelow(f);if(!d.dirty&&(f=d,d=m.regionAbove(d),d===null||!d.dirty))return;if(d.dirty=!1,g=d.eUp,O=f.eUp,g.Dst!==O.Dst&&m.checkForLeftSplice(l,d)&&(f.fixUpperEdge?(m.deleteRegion(l,f),l.mesh["delete"](O),f=m.regionBelow(d),O=f.eUp):d.fixUpperEdge&&(m.deleteRegion(l,d),l.mesh["delete"](g),d=m.regionAbove(f),g=d.eUp)),g.Org!==O.Org)if(g.Dst!==O.Dst&&!d.fixUpperEdge&&!f.fixUpperEdge&&(g.Dst===l.event||O.Dst===l.event)){if(m.checkForIntersect(l,d))return;}else m.checkForRightSplice(l,d);g.Org===O.Org&&g.Dst===O.Dst&&(m.addWinding(O,g),m.deleteRegion(l,d),l.mesh["delete"](g),d=m.regionAbove(f));}},m.connectRightVertex=function(l,d,f){var g,O=f.Onext,A=m.regionBelow(d),R=d.eUp,b=A.eUp,P=!1;if(R.Dst!==b.Dst&&m.checkForIntersect(l,d),n.vertEq(R.Org,l.event)&&(l.mesh.splice(O.Oprev,R),d=m.topLeftRegion(l,d),O=m.regionBelow(d).eUp,m.finishLeftRegions(l,m.regionBelow(d),A),P=!0),n.vertEq(b.Org,l.event)&&(l.mesh.splice(f,b.Oprev),f=m.finishLeftRegions(l,A,null),P=!0),P){m.addRightEdges(l,d,f.Onext,O,O,!0);return;}n.vertLeq(b.Org,R.Org)?g=b.Oprev:g=R,g=l.mesh.connect(f.Lprev,g),m.addRightEdges(l,d,g,g.Onext,g.Onext,!1),g.Sym.activeRegion.fixUpperEdge=!0,m.walkDirtyRegions(l,d);},m.connectLeftDegenerate=function(l,d,f){var g,O,A,R,b;if(g=d.eUp,n.vertEq(g.Org,f)){i(!1/*TOLERANCE_NONZERO*/),m.spliceMergeVertices(l,g,f.anEdge);return;}if(!n.vertEq(g.Dst,f)){l.mesh.splitEdge(g.Sym),d.fixUpperEdge&&(l.mesh["delete"](g.Onext),d.fixUpperEdge=!1),l.mesh.splice(f.anEdge,g),m.sweepEvent(l,f);return;}i(!1/*TOLERANCE_NONZERO*/),d=m.topRightRegion(d),b=m.regionBelow(d),A=b.eUp.Sym,O=R=A.Onext,b.fixUpperEdge&&(i(O!==A),m.deleteRegion(l,b),l.mesh["delete"](A),A=O.Oprev),l.mesh.splice(f.anEdge,A),n.edgeGoesLeft(O)||(O=null),m.addRightEdges(l,d,A.Onext,R,O,!0);},m.connectLeftVertex=function(l,d){var f,g,O,A,R,b,P=new T();if(P.eUp=d.anEdge.Sym,f=l.dict.search(P).key,g=m.regionBelow(f),!!g){if(A=f.eUp,R=g.eUp,n.edgeSign(A.Dst,d,A.Org)===0){m.connectLeftDegenerate(l,f,d);return;}if(O=n.vertLeq(R.Dst,A.Dst)?f:g,f.inside||O.fixUpperEdge){if(O===f)b=l.mesh.connect(d.anEdge.Sym,A.Lnext);else{var L=l.mesh.connect(R.Dnext,d.anEdge);b=L.Sym;}O.fixUpperEdge?m.fixUpperEdge(l,O,b):m.computeWinding(l,m.addRegionBelow(l,f,b)),m.sweepEvent(l,d);}else m.addRightEdges(l,f,d.anEdge,d.anEdge,null,!0);}},m.sweepEvent=function(l,d){l.event=d,m.debugEvent(l);for(var f=d.anEdge;f.activeRegion===null;)if(f=f.Onext,f===d.anEdge){m.connectLeftVertex(l,d);return;}var g=m.topLeftRegion(l,f.activeRegion);i(g!==null);var O=m.regionBelow(g),A=O.eUp,R=m.finishLeftRegions(l,O,null);R.Onext===A?m.connectRightVertex(l,g,R):m.addRightEdges(l,g,R.Onext,A,A,!0);},m.addSentinel=function(l,d,f,g){var O=new T(),A=l.mesh.makeEdge();A.Org.s=f,A.Org.t=g,A.Dst.s=d,A.Dst.t=g,l.event=A.Dst,O.eUp=A,O.windingNumber=0,O.inside=!1,O.fixUpperEdge=!1,O.sentinel=!0,O.dirty=!1,O.nodeUp=l.dict.insert(O);},m.initEdgeDict=function(l){l.dict=new h(l,m.edgeLeq);var d=l.bmax[0]-l.bmin[0],f=l.bmax[1]-l.bmin[1],g=l.bmin[0]-d,O=l.bmax[0]+d,A=l.bmin[1]-f,R=l.bmax[1]+f;m.addSentinel(l,g,O,A),m.addSentinel(l,g,O,R);},m.doneEdgeDict=function(l){for(var d,f=0;(d=l.dict.min().key)!==null;)d.sentinel||(i(d.fixUpperEdge),i(++f===1)),i(d.windingNumber===0),m.deleteRegion(l,d);},m.removeDegenerateEdges=function(l){var d,f,g,O=l.mesh.eHead;for(d=O.next;d!==O;d=f)f=d.next,g=d.Lnext,n.vertEq(d.Org,d.Dst)&&d.Lnext.Lnext!==d&&(m.spliceMergeVertices(l,g,d),l.mesh["delete"](d),d=g,g=d.Lnext),g.Lnext===d&&(g!==d&&((g===f||g===f.Sym)&&(f=f.next),l.mesh["delete"](g)),(d===f||d===f.Sym)&&(f=f.next),l.mesh["delete"](d));},m.initPriorityQ=function(l){var d,f,g,O=0;for(g=l.mesh.vHead,f=g.next;f!==g;f=f.next)O++;for(O+=8,d=l.pq=new M(O,n.vertLeq),g=l.mesh.vHead,f=g.next;f!==g;f=f.next)f.pqHandle=d.insert(f);return f!==g?!1:(d.init(),!0);},m.donePriorityQ=function(l){l.pq=null;},m.removeDegenerateFaces=function(l,d){var f,g,O;for(f=d.fHead.next;f!==d.fHead;f=g)g=f.next,O=f.anEdge,i(O.Lnext!==O),O.Lnext.Lnext===O&&(m.addWinding(O.Onext,O),l.mesh["delete"](O));return!0;},m.computeInterior=function(l){var d,f;if(m.removeDegenerateEdges(l),!m.initPriorityQ(l))return!1;for(m.initEdgeDict(l);(d=l.pq.extractMin())!==null;){for(;f=l.pq.min(),!(f===null||!n.vertEq(f,d));)f=l.pq.extractMin(),m.spliceMergeVertices(l,d.anEdge,f.anEdge);m.sweepEvent(l,d);}return l.event=l.dict.min().key.eUp.Org,m.debugEvent(l),m.doneEdgeDict(l),m.donePriorityQ(l),m.removeDegenerateFaces(l,l.mesh)?(l.mesh.check(),!0):!1;};function x(){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=e.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;}x.prototype={dot_:function dot_(l,d){return l[0]*d[0]+l[1]*d[1]+l[2]*d[2];},normalize_:function normalize_(l){var d=l[0]*l[0]+l[1]*l[1]+l[2]*l[2];i(d>0),d=Math.sqrt(d),l[0]/=d,l[1]/=d,l[2]/=d;},longAxis_:function longAxis_(l){var d=0;return Math.abs(l[1])>Math.abs(l[0])&&(d=1),Math.abs(l[2])>Math.abs(l[d])&&(d=2),d;},computeNormal_:function computeNormal_(l){var d,f,g,O,A,R,b=[0,0,0],P=[0,0,0],L=[0,0,0],D=[0,0,0],I=[0,0,0],C=[null,null,null],B=[null,null,null],G=this.mesh.vHead,H;for(d=G.next,H=0;H<3;++H)O=d.coords[H],P[H]=O,B[H]=d,b[H]=O,C[H]=d;for(d=G.next;d!==G;d=d.next)for(H=0;H<3;++H)O=d.coords[H],O<P[H]&&(P[H]=O,B[H]=d),O>b[H]&&(b[H]=O,C[H]=d);if(H=0,b[1]-P[1]>b[0]-P[0]&&(H=1),b[2]-P[2]>b[H]-P[H]&&(H=2),P[H]>=b[H]){l[0]=0,l[1]=0,l[2]=1;return;}for(R=0,f=B[H],g=C[H],L[0]=f.coords[0]-g.coords[0],L[1]=f.coords[1]-g.coords[1],L[2]=f.coords[2]-g.coords[2],d=G.next;d!==G;d=d.next)D[0]=d.coords[0]-g.coords[0],D[1]=d.coords[1]-g.coords[1],D[2]=d.coords[2]-g.coords[2],I[0]=L[1]*D[2]-L[2]*D[1],I[1]=L[2]*D[0]-L[0]*D[2],I[2]=L[0]*D[1]-L[1]*D[0],A=I[0]*I[0]+I[1]*I[1]+I[2]*I[2],A>R&&(R=A,l[0]=I[0],l[1]=I[1],l[2]=I[2]);R<=0&&(l[0]=l[1]=l[2]=0,l[this.longAxis_(L)]=1);},checkOrientation_:function checkOrientation_(){var l,d,f=this.mesh.fHead,g,O=this.mesh.vHead,A;for(l=0,d=f.next;d!==f;d=d.next)if(A=d.anEdge,!(A.winding<=0))do l+=(A.Org.s-A.Dst.s)*(A.Org.t+A.Dst.t),A=A.Lnext;while(A!==d.anEdge);if(l<0){for(g=O.next;g!==O;g=g.next)g.t=-g.t;this.tUnit[0]=-this.tUnit[0],this.tUnit[1]=-this.tUnit[1],this.tUnit[2]=-this.tUnit[2];}},/* #ifdef FOR_TRITE_TEST_PROGRAM
|
|
155
|
-
#include <stdlib.h>
|
|
156
|
-
extern int RandomSweep;
|
|
157
|
-
#define S_UNIT_X (RandomSweep ? (2*drand48()-1) : 1.0)
|
|
158
|
-
#define S_UNIT_Y (RandomSweep ? (2*drand48()-1) : 0.0)
|
|
159
|
-
#else
|
|
160
|
-
#if defined(SLANTED_SWEEP) */ /* The "feature merging" is not intended to be complete. There are
|
|
161
|
-
* special cases where edges are nearly parallel to the sweep line
|
|
162
|
-
* which are not implemented. The algorithm should still behave
|
|
163
|
-
* robustly (ie. produce a reasonable tesselation) in the presence
|
|
164
|
-
* of such edges, however it may miss features which could have been
|
|
165
|
-
* merged. We could minimize this effect by choosing the sweep line
|
|
166
|
-
* direction to be something unusual (ie. not parallel to one of the
|
|
167
|
-
* coordinate axes).
|
|
168
|
-
*/ /* #define S_UNIT_X (TESSreal)0.50941539564955385 // Pre-normalized
|
|
169
|
-
#define S_UNIT_Y (TESSreal)0.86052074622010633
|
|
170
|
-
#else
|
|
171
|
-
#define S_UNIT_X (TESSreal)1.0
|
|
172
|
-
#define S_UNIT_Y (TESSreal)0.0
|
|
173
|
-
#endif
|
|
174
|
-
#endif*/ /* Determine the polygon normal and project vertices onto the plane
|
|
175
|
-
* of the polygon.
|
|
176
|
-
*/projectPolygon_:function projectPolygon_(){var l,d=this.mesh.vHead,f=[0,0,0],g,O,A,R,b=!1;for(f[0]=this.normal[0],f[1]=this.normal[1],f[2]=this.normal[2],f[0]===0&&f[1]===0&&f[2]===0&&(this.computeNormal_(f),b=!0),g=this.sUnit,O=this.tUnit,A=this.longAxis_(f),g[A]=0,g[(A+1)%3]=1,g[(A+2)%3]=0,O[A]=0,O[(A+1)%3]=0,O[(A+2)%3]=f[A]>0?1:-1,l=d.next;l!==d;l=l.next)l.s=this.dot_(l.coords,g),l.t=this.dot_(l.coords,O);for(b&&this.checkOrientation_(),R=!0,l=d.next;l!==d;l=l.next)R?(this.bmin[0]=this.bmax[0]=l.s,this.bmin[1]=this.bmax[1]=l.t,R=!1):(l.s<this.bmin[0]&&(this.bmin[0]=l.s),l.s>this.bmax[0]&&(this.bmax[0]=l.s),l.t<this.bmin[1]&&(this.bmin[1]=l.t),l.t>this.bmax[1]&&(this.bmax[1]=l.t));},addWinding_:function addWinding_(l,d){l.winding+=d.winding,l.Sym.winding+=d.Sym.winding;},/* tessMeshTessellateMonoRegion( face ) tessellates a monotone region
|
|
177
|
-
* (what else would it do??) The region must consist of a single
|
|
178
|
-
* loop of half-edges (see mesh.h) oriented CCW. "Monotone" in this
|
|
179
|
-
* case means that any vertical line intersects the interior of the
|
|
180
|
-
* region in a single interval.
|
|
181
|
-
*
|
|
182
|
-
* Tessellation consists of adding interior edges (actually pairs of
|
|
183
|
-
* half-edges), to split the region into non-overlapping triangles.
|
|
184
|
-
*
|
|
185
|
-
* The basic idea is explained in Preparata and Shamos (which I don''t
|
|
186
|
-
* have handy right now), although their implementation is more
|
|
187
|
-
* complicated than this one. The are two edge chains, an upper chain
|
|
188
|
-
* and a lower chain. We process all vertices from both chains in order,
|
|
189
|
-
* from right to left.
|
|
190
|
-
*
|
|
191
|
-
* The algorithm ensures that the following invariant holds after each
|
|
192
|
-
* vertex is processed: the untessellated region consists of two
|
|
193
|
-
* chains, where one chain (say the upper) is a single edge, and
|
|
194
|
-
* the other chain is concave. The left vertex of the single edge
|
|
195
|
-
* is always to the left of all vertices in the concave chain.
|
|
196
|
-
*
|
|
197
|
-
* Each step consists of adding the rightmost unprocessed vertex to one
|
|
198
|
-
* of the two chains, and forming a fan of triangles from the rightmost
|
|
199
|
-
* of two chain endpoints. Determining whether we can add each triangle
|
|
200
|
-
* to the fan is a simple orientation test. By making the fan as large
|
|
201
|
-
* as possible, we restore the invariant (check it yourself).
|
|
202
|
-
*/ // int tessMeshTessellateMonoRegion( TESSmesh *mesh, TESSface *face )
|
|
203
|
-
tessellateMonoRegion_:function tessellateMonoRegion_(l,d){var f,g;for(f=d.anEdge,i(f.Lnext!==f&&f.Lnext.Lnext!==f);n.vertLeq(f.Dst,f.Org);f=f.Lprev);for(;n.vertLeq(f.Org,f.Dst);f=f.Lnext);for(g=f.Lprev;f.Lnext!==g;)if(n.vertLeq(f.Dst,g.Org)){for(;g.Lnext!==f&&(n.edgeGoesLeft(g.Lnext)||n.edgeSign(g.Org,g.Dst,g.Lnext.Dst)<=0);){var O=l.connect(g.Lnext,g);g=O.Sym;}g=g.Lprev;}else{for(;g.Lnext!==f&&(n.edgeGoesRight(f.Lprev)||n.edgeSign(f.Dst,f.Org,f.Lprev.Org)>=0);){var O=l.connect(f,f.Lprev);f=O.Sym;}f=f.Lnext;}for(i(g.Lnext!==f);g.Lnext.Lnext!==f;){var O=l.connect(g.Lnext,g);g=O.Sym;}return!0;},/* tessMeshTessellateInterior( mesh ) tessellates each region of
|
|
204
|
-
* the mesh which is marked "inside" the polygon. Each such region
|
|
205
|
-
* must be monotone.
|
|
206
|
-
*/ //int tessMeshTessellateInterior( TESSmesh *mesh )
|
|
207
|
-
tessellateInterior_:function tessellateInterior_(l){var d,f;for(d=l.fHead.next;d!==l.fHead;d=f)if(f=d.next,d.inside&&!this.tessellateMonoRegion_(l,d))return!1;return!0;},/* tessMeshDiscardExterior( mesh ) zaps (ie. sets to NULL) all faces
|
|
208
|
-
* which are not marked "inside" the polygon. Since further mesh operations
|
|
209
|
-
* on NULL faces are not allowed, the main purpose is to clean up the
|
|
210
|
-
* mesh so that exterior loops are not represented in the data structure.
|
|
211
|
-
*/ //void tessMeshDiscardExterior( TESSmesh *mesh )
|
|
212
|
-
discardExterior_:function discardExterior_(l){var d,f;for(d=l.fHead.next;d!==l.fHead;d=f)f=d.next,d.inside||l.zapFace(d);},/* tessMeshSetWindingNumber( mesh, value, keepOnlyBoundary ) resets the
|
|
213
|
-
* winding numbers on all edges so that regions marked "inside" the
|
|
214
|
-
* polygon have a winding number of "value", and regions outside
|
|
215
|
-
* have a winding number of 0.
|
|
216
|
-
*
|
|
217
|
-
* If keepOnlyBoundary is TRUE, it also deletes all edges which do not
|
|
218
|
-
* separate an interior region from an exterior one.
|
|
219
|
-
*/ // int tessMeshSetWindingNumber( TESSmesh *mesh, int value, int keepOnlyBoundary )
|
|
220
|
-
setWindingNumber_:function setWindingNumber_(l,d,f){var g,O;for(g=l.eHead.next;g!==l.eHead;g=O)O=g.next,g.Rface.inside!==g.Lface.inside?g.winding=g.Lface.inside?d:-d:f?l["delete"](g):g.winding=0;},getNeighbourFace_:function getNeighbourFace_(l){return!l.Rface||!l.Rface.inside?-1:l.Rface.n;},outputPolymesh_:function outputPolymesh_(l,d,f,g){var O,A,R,b=0,P=0,L,D;for(f>3&&l.mergeConvexFaces(f),O=l.vHead.next;O!==l.vHead;O=O.next)O.n=-1;for(A=l.fHead.next;A!==l.fHead;A=A.next)if(A.n=-1,!!A.inside){R=A.anEdge,L=0;do O=R.Org,O.n===-1&&(O.n=P,P++),L++,R=R.Lnext;while(R!==A.anEdge);i(L<=f),A.n=b,++b;}for(this.elementCount=b,d===e.CONNECTED_POLYGONS&&(b*=2),this.elements=[],this.elements.length=b*f,this.vertexCount=P,this.vertices=[],this.vertices.length=P*g,this.vertexIndices=[],this.vertexIndices.length=P,O=l.vHead.next;O!==l.vHead;O=O.next)if(O.n!==-1){var I=O.n*g;this.vertices[I+0]=O.coords[0],this.vertices[I+1]=O.coords[1],g>2&&(this.vertices[I+2]=O.coords[2]),this.vertexIndices[O.n]=O.idx;}var C=0;for(A=l.fHead.next;A!==l.fHead;A=A.next)if(A.inside){R=A.anEdge,L=0;do O=R.Org,this.elements[C++]=O.n,L++,R=R.Lnext;while(R!==A.anEdge);for(D=L;D<f;++D)this.elements[C++]=-1;if(d===e.CONNECTED_POLYGONS){R=A.anEdge;do this.elements[C++]=this.getNeighbourFace_(R),R=R.Lnext;while(R!==A.anEdge);for(D=L;D<f;++D)this.elements[C++]=-1;}}},// void OutputContours( TESStesselator *tess, TESSmesh *mesh, int vertexSize )
|
|
221
|
-
outputContours_:function outputContours_(l,d){var f,g,O,A=0,R=0;for(this.vertexCount=0,this.elementCount=0,f=l.fHead.next;f!==l.fHead;f=f.next)if(f.inside){O=g=f.anEdge;do this.vertexCount++,g=g.Lnext;while(g!==O);this.elementCount++;}this.elements=[],this.elements.length=this.elementCount*2,this.vertices=[],this.vertices.length=this.vertexCount*d,this.vertexIndices=[],this.vertexIndices.length=this.vertexCount;var b=0,P=0,L=0;for(A=0,f=l.fHead.next;f!==l.fHead;f=f.next)if(f.inside){R=0,O=g=f.anEdge;do this.vertices[b++]=g.Org.coords[0],this.vertices[b++]=g.Org.coords[1],d>2&&(this.vertices[b++]=g.Org.coords[2]),this.vertexIndices[P++]=g.Org.idx,R++,g=g.Lnext;while(g!==O);this.elements[L++]=A,this.elements[L++]=R,A+=R;}},addContour:function addContour(l,d){var f,g;for(this.mesh===null&&(this.mesh=new c()),l<2&&(l=2),l>3&&(l=3),f=null,g=0;g<d.length;g+=l)f===null?(f=this.mesh.makeEdge(),this.mesh.splice(f,f.Sym)):(this.mesh.splitEdge(f),f=f.Lnext),f.Org.coords[0]=d[g+0],f.Org.coords[1]=d[g+1],l>2?f.Org.coords[2]=d[g+2]:f.Org.coords[2]=0,f.Org.idx=this.vertexIndexCounter++,f.winding=1,f.Sym.winding=-1;},// int tessTesselate( TESStesselator *tess, int windingRule, int elementType, int polySize, int vertexSize, const TESSreal* normal )
|
|
222
|
-
tesselate:function tesselate(l,d,f,g,O){if(this.vertices=[],this.elements=[],this.vertexIndices=[],this.vertexIndexCounter=0,O&&(this.normal[0]=O[0],this.normal[1]=O[1],this.normal[2]=O[2]),this.windingRule=l,g<2&&(g=2),g>3&&(g=3),!this.mesh)return!1;this.projectPolygon_(),m.computeInterior(this);var A=this.mesh;return d===e.BOUNDARY_CONTOURS?this.setWindingNumber_(A,1,!0):this.tessellateInterior_(A),A.check(),d===e.BOUNDARY_CONTOURS?this.outputContours_(A,g):this.outputPolymesh_(A,d,f,g),!0;}};},/* 62 */ /***/function(u,r){u.exports=e;var t=Object.prototype.hasOwnProperty;function e(){for(var n={},i=0;i<arguments.length;i++){var a=arguments[i];for(var o in a)t.call(a,o)&&(n[o]=a[o]);}return n;}},/* 63 */ /***/function(u,r,t){t.r(r),t.d(r,"createShaders",function(){return s;}),t.d(r,"applyShader",function(){return c;}),t.d(r,"createCloudShaders",function(){return h;}),t.d(r,"applyCloudShader",function(){return v;});var e=t(64),n=t(65),i=t(66),a=t(67);t(1).glMatrix.setMatrixArrayType(Array);var o=Symbol("shaders");function s(y){y[o]=[];for(var M=0;M<16;M++){var T=[],m=!!(M&1),_x27=!!(M&2),_l10=!!(M&4),d=!!(M&8);m&&T.push("#define TEXTURE 1"),_x27&&T.push("#define FILTER 1"),_l10&&T.push("#define GRADIENT 1"),d&&T.push("#define CLIPPATH 1");var f="".concat(T.join("\n"),"\n"),g=[];m&&g.push("uniform sampler2D u_texSampler;"),d&&g.push("uniform sampler2D u_clipSampler;"),y[o][M]=[f+g.join("\n")+n["default"],f+e["default"]];}}function c(y){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,T=_ref94$hasFilter===void 0?!1:_ref94$hasFilter,_ref94$hasGradient=_ref94.hasGradient,m=_ref94$hasGradient===void 0?!1:_ref94$hasGradient,_ref94$hasClipPath=_ref94.hasClipPath,x=_ref94$hasClipPath===void 0?!1:_ref94$hasClipPath;var l=M|T<<1|m<<2|x<<3;var d=y[o][l];Array.isArray(d)&&(d=y.createProgram.apply(y,_toConsumableArray(d)),y[o][l]=d),y.program!==d&&y.useProgram(d,{a_color:{type:"UNSIGNED_BYTE",normalize:!0}});}var p=[];function h(y){for(var M=0;M<64;M++){var T=[],m=!!(M&1),_x28=!!(M&2),_l11=!!(M&4),d=!!(M&8),f=!!(M&16),g=!!(M&32);m&&T.push("#define TEXTURE 1"),_x28&&T.push("#define FILTER 1"),_l11&&T.push("#define GRADIENT 1"),d&&T.push("#define CLOUDCOLOR 1"),f&&T.push("#define CLOUDFILTER 1"),g&&T.push("#define CLIPPATH 1");var O="".concat(T.join("\n"),"\n"),A=[];if(m){A.push("uniform sampler2D u_texSampler;");for(var R=0;R<12;R++)A.push("uniform sampler2D u_texFrame".concat(R,";"));}g&&A.push("uniform sampler2D u_clipSampler;"),p[M]=[O+A.join("\n")+a["default"],O+i["default"]];}}function v(y){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,T=_ref95$hasFilter===void 0?!1:_ref95$hasFilter,_ref95$hasGradient=_ref95.hasGradient,m=_ref95$hasGradient===void 0?!1:_ref95$hasGradient,_ref95$hasCloudColor=_ref95.hasCloudColor,x=_ref95$hasCloudColor===void 0?!1:_ref95$hasCloudColor,_ref95$hasCloudFilter=_ref95.hasCloudFilter,l=_ref95$hasCloudFilter===void 0?!1:_ref95$hasCloudFilter,_ref95$hasClipPath=_ref95.hasClipPath,d=_ref95$hasClipPath===void 0?!1:_ref95$hasClipPath;var f=M|T<<1|m<<2|x<<3|l<<4|d<<5;var g=p[f];Array.isArray(g)&&(g=y.createProgram.apply(y,_toConsumableArray(g)),p[f]=g),y.program!==g&&y.useProgram(g,{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,r,t){t.r(r),r["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,r,t){t.r(r),r["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,r,t){t.r(r),r["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,r,t){t.r(r),r["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,r,t){t.r(r),function(e,n){t.d(r,"requestAnimationFrame",function(){return a;}),t.d(r,"cancelAnimationFrame",function(){return o;}),t(1).glMatrix.setMatrixArrayType(Array);function i(){if((typeof performance==="undefined"?"undefined":_typeof(performance))<"u"&&performance.now)return performance.now();if(_typeof(e)<"u"&&e.hrtime){var _e$hrtime=e.hrtime(),_e$hrtime2=_slicedToArray(_e$hrtime,2),s=_e$hrtime2[0],c=_e$hrtime2[1];return s*1e3+c*1e-6;}return Date.now?Date.now():(/* @__PURE__ */new Date()).getTime();}var a,o;_typeof(n)<"u"&&typeof n.requestAnimationFrame=="function"?(a=n.requestAnimationFrame,o=n.cancelAnimationFrame):(a=function a(s){return setTimeout(function(){s(i());},16);},o=function o(s){return clearTimeout(s);});}.call(this,t(69),t(22));},/* 69 */ /***/function(u,r){var t=u.exports={},e,n;function i(){throw new Error("setTimeout has not been defined");}function a(){throw new Error("clearTimeout has not been defined");}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=i;}catch(_unused9){e=i;}try{typeof clearTimeout=="function"?n=clearTimeout:n=a;}catch(_unused10){n=a;}})();function o(x){if(e===setTimeout)return setTimeout(x,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(x,0);try{return e(x,0);}catch(_unused11){try{return e.call(null,x,0);}catch(_unused12){return e.call(this,x,0);}}}function s(x){if(n===clearTimeout)return clearTimeout(x);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(x);try{return n(x);}catch(_unused13){try{return n.call(null,x);}catch(_unused14){return n.call(this,x);}}}var c=[],p=!1,h,v=-1;function y(){!p||!h||(p=!1,h.length?c=h.concat(c):v=-1,c.length&&M());}function M(){if(!p){var x=o(y);p=!0;for(var l=c.length;l;){for(h=c,c=[];++v<l;)h&&h[v].run();v=-1,l=c.length;}h=null,p=!1,s(x);}}t.nextTick=function(x){var l=new Array(arguments.length-1);if(arguments.length>1)for(var d=1;d<arguments.length;d++)l[d-1]=arguments[d];c.push(new T(x,l)),c.length===1&&!p&&o(M);};function T(x,l){this.fun=x,this.array=l;}T.prototype.run=function(){this.fun.apply(null,this.array);},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={};function m(){}t.on=m,t.addListener=m,t.once=m,t.off=m,t.removeListener=m,t.removeAllListeners=m,t.emit=m,t.prependListener=m,t.prependOnceListener=m,t.listeners=function(x){return[];},t.binding=function(x){throw new Error("process.binding is not supported");},t.cwd=function(){return"/";},t.chdir=function(x){throw new Error("process.chdir is not supported");},t.umask=function(){return 0;};},/* 70 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return R;});var e=t(1),n=t(71),i=t(73),a=t(213),o=t(214),s=t(215),c=t(216);t(1).glMatrix.setMatrixArrayType(Array);function p(b,P){var L=Object.keys(b);if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(b);P&&(D=D.filter(function(I){return Object.getOwnPropertyDescriptor(b,I).enumerable;})),L.push.apply(L,D);}return L;}function h(b){for(var P=1;P<arguments.length;P++){var L=arguments[P]!=null?arguments[P]:{};P%2?p(Object(L),!0).forEach(function(D){v(b,D,L[D]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(L)):p(Object(L)).forEach(function(D){Object.defineProperty(b,D,Object.getOwnPropertyDescriptor(L,D));});}return b;}function v(b,P,L){return P in b?Object.defineProperty(b,P,{value:L,enumerable:!0,configurable:!0,writable:!0}):b[P]=L,b;}var y=Symbol["for"]("spritejs_changedAttrs"),M=Symbol["for"]("spritejs_attributes"),T=Symbol("resolution"),m=Symbol("animations"),x=Symbol("eventListeners"),l=Symbol("captureEventListeners"),d=Symbol("filters"),f=Symbol("display"),g=Symbol("program"),O=Symbol("shaderAttrs"),A=Symbol("uniforms");var R=/*#__PURE__*/function(){function R(){var P=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,R);this.attributes=new this.constructor.Attr(this),this[T]={width:300,height:150},Object.assign(this.attributes,P),this[m]=/* @__PURE__ */new Set(),this[x]={},this[l]={};}return _createClass(R,[{key:"ancestors",get:function get(){var P=this.parent;var L=[];for(;P;)L.push(P),P=P.parent;return L;}},{key:"animations",get:function get(){return this[m];}},{key:"filters",get:function get(){return this[d]||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 P=this.transformMatrix,_this$attributes=this.attributes,L=_this$attributes.x,D=_this$attributes.y;return P[4]+=L,P[5]+=D,P;}},{key:"opacity",get:function get(){var P=this.attributes.opacity;return this.parent&&this.parent.opacity!=null&&(P*=this.parent.opacity),P;}},{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[g];}/* 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 P=this.localMatrix;var L=this.parent;if(L){var D=L.__cacheRenderMatrix||L.renderMatrix;D&&(P=e.mat2d.multiply(Array.of(0,0,0,0,0,0),D,P));}return P;}},{key:"worldScaling",get:function get(){var P=this.renderMatrix;return[Math.hypot(P[0],P[1]),Math.hypot(P[2],P[3])];}},{key:"worldRotation",get:function get(){var P=this.renderMatrix;return Math.atan2(P[1],P[3]);}},{key:"worldPosition",get:function get(){var P=this.renderMatrix;return[P[4],P[5]];}},{key:"uniforms",get:function get(){return this[A];}/* get zOrder defined by connect method */ /* attributes */},{key:"className",get:function get(){return this.attributes.className;},set:function set(P){this.attributes.className=P;}},{key:"id",get:function get(){return this.attributes.id;},set:function set(P){this.attributes.id=P;}},{key:"name",get:function get(){return this.attributes.name;},set:function set(P){this.attributes.name=P;}},{key:"zIndex",get:function get(){return this.attributes.zIndex;},set:function set(P){this.attributes.zIndex=P;}},{key:"mesh",get:function get(){return null;}},{key:"shaderAttrs",get:function get(){return this[O]||{};}},{key:"activateAnimations",value:function activateAnimations(){var P=this.layer;if(P){var L=this[m];L.forEach(function(I){I.baseTimeline=P.timeline,I.play(),I.finished.then(function(){L["delete"](I);});});var D=this.children;D&&D.forEach(function(I){I.activateAnimations&&I.activateAnimations();});}}},{key:"addEventListener",value:function addEventListener(P,L){var D=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};P==="mousewheel"&&(P="wheel"),typeof D=="boolean"&&(D={capture:D});var _D8=D,I=_D8.capture,C=_D8.once,B=I?l:x;return this[B][P]=this[B][P]||[],this[B][P].push({listener:L,once:C}),this;}},{key:"animate",value:function animate(P,L){var _this21=this;var D=new i["default"](this,P,L);return this.effects&&D.applyEffects(this.effects),this.layer&&(D.baseTimeline=this.layer.timeline,D.play(),D.finished.then(function(){_this21[m]["delete"](D);})),this[m].add(D),D;}},{key:"attr",value:function attr(){for(var _len7=arguments.length,P=new Array(_len7),_key7=0;_key7<_len7;_key7++){P[_key7]=arguments[_key7];}if(P.length===0)return this.attributes[M];if(P.length>1){var L=P[0],D=P[1];return typeof D=="function"&&(D=D(this.attr(L))),this.setAttribute(L,D),this;}return typeof P[0]=="string"?this.getAttribute(P[0]):(Object.assign(this.attributes,P[0]),this);}},{key:"cloneNode",value:function cloneNode(){var P=new this.constructor(),L=this.attributes[y];return P.attr(L),P;}},{key:"connect",value:function connect(P,L){Object.defineProperty(this,"parent",{value:P,writable:!1,configurable:!0}),Object.defineProperty(this,"zOrder",{value:L,writable:!1,configurable:!0}),P.timeline&&this.activateAnimations(),this.setResolution(P.getResolution()),this.forceUpdate(),this.dispatchEvent({type:"append",detail:{parent:P,zOrder:L}});}},{key:"contains",value:function contains(P){for(;P&&this!==P;)P=P.parent;return!!P;}},{key:"deactivateAnimations",value:function deactivateAnimations(){this[m].forEach(function(L){return L.cancel();});var P=this.children;P&&P.forEach(function(L){L.deactivateAnimations&&L.deactivateAnimations();});}},{key:"disconnect",value:function disconnect(){var P=this.parent,L=this.zOrder;delete this.parent,delete this.zOrder,this.deactivateAnimations(),this.dispatchEvent({type:"remove",detail:{parent:P,zOrder:L}}),P&&P.forceUpdate();}},{key:"dispatchEvent",value:function dispatchEvent(P){var _this22=this;P instanceof o["default"]||(P=new o["default"](P)),P.target=this;var L=P.type;L==="mousewheel"&&(L="wheel");var D=[this];var I=this.parent;for(;P.bubbles&&I;)D.push(I),I=I.parent;for(var C=D.length-1;C>=0;C--){var B=D[C],G=B[l]&&B[l][L];if(G&&G.length&&(P.currentTarget=B,G.forEach(function(_ref96){var H=_ref96.listener,X=_ref96.once;H.call(_this22,P),X&&D.removeEventListener(H);}),delete P.currentTarget),!P.bubbles&&P.cancelBubble)break;}if(!P.cancelBubble)for(var _C4=0;_C4<D.length;_C4++){var _B=D[_C4],_G3=_B[x]&&_B[x][L];if(_G3&&_G3.length&&(P.currentTarget=_B,_G3.forEach(function(_ref97){var H=_ref97.listener,X=_ref97.once;H.call(_this22,P),X&&D.removeEventListener(H);}),delete P.currentTarget),!P.bubbles||P.cancelBubble)break;}}},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(P){var L=P.layerX,D=P.layerY;return this.isPointCollision(L,D)?(this.dispatchEvent(P),!0):!1;}},{key:"draw",value:function draw(){var _this23=this;var P=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var L=this.mesh;if(L){if(Object(s.applyFilters)(L,this.filters),P.push(L),this[g]){L.setProgram(this[g]);var D=this[O];D&&Object.entries(D).forEach(function(_ref98){var _ref99=_slicedToArray(_ref98,2),C=_ref99[0],B=_ref99[1];L.setAttribute(C,B);});var I=this[A];if(this[A]){var C={};Object.entries(I).forEach(function(_ref100){var _ref101=_slicedToArray(_ref100,2),B=_ref101[0],G=_ref101[1];typeof G=="function"&&(G=G(_this23,B)),C[B]=G;}),L.setUniforms(C);}}Object(c["default"])(this,L);}return P;}},{key:"forceUpdate",value:function forceUpdate(){this.parent&&this.parent.forceUpdate();}},{key:"getAttribute",value:function getAttribute(P){return this.attributes[P];}},{key:"getListeners",value:function getListeners(P){var _ref102=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref102$capture=_ref102.capture,L=_ref102$capture===void 0?!1:_ref102$capture;return _toConsumableArray(this[L?l:x][P]||[]);}},{key:"getNodeNearBy",value:function getNodeNearBy(){var P=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;if(!this.parent)return null;if(P===0)return this;var L=this.parent.children,D=L.indexOf(this);return L[D+P];}},{key:"getWorldPosition",value:function getWorldPosition(P,L){var D=this.renderMatrix,I=P*D[0]+L*D[2]+D[4],C=P*D[1]+L*D[3]+D[5];return[I,C];}},{key:"getOffsetPosition",value:function getOffsetPosition(P,L){var D=e.mat2d.invert(Array.of(0,0,0,0,0,0),this.renderMatrix),I=P*D[0]+L*D[2]+D[4],C=P*D[1]+L*D[3]+D[5];return[I,C];}},{key:"getResolution",value:function getResolution(){return h({},this[T]);}},{key:"isPointCollision",value:function isPointCollision(P,L){if(!this.mesh)return!1;var D=this.attributes.pointerEvents;if(D==="none"||D!=="all"&&!this.isVisible)return!1;var I="both";return D==="visibleFill"&&(I="fill"),D==="visibleStroke"&&(I="stroke"),this.mesh.isPointCollision(P,L,I);}},{key:"onPropertyChange",value:function onPropertyChange(P,L,D){P!=="id"&&P!=="name"&&P!=="className"&&P!=="pointerEvents"&&P!=="passEvents"&&this.forceUpdate(),P==="filter"&&(this[d]=Object(s.parseFilterString)(L)),P==="zIndex"&&this.parent&&this.parent.reorder();}},{key:"setAttribute",value:function setAttribute(P,L){P==="attrs"&&this.attr(L),this.attributes[P]=L;}},{key:"setMouseCapture",value:function setMouseCapture(){this.layer&&(this.layer.__mouseCapturedTarget=this);}// layer.renderer.createProgram(fragmentShader, vertexShader, attributeOptions)
|
|
223
|
-
},{key:"setProgram",value:function setProgram(P){this[g]=P,this.forceUpdate();}},{key:"setShaderAttribute",value:function setShaderAttribute(P,L){this[O]=this[O]||{},this[O][P]=L,this.forceUpdate();}},{key:"setUniforms",value:function setUniforms(P){this[A]=this[A]||{},Object.assign(this[A],P),this.forceUpdate();}},{key:"setResolution",value:function setResolution(_ref103){var P=_ref103.width,L=_ref103.height;var _this$T3=this[T],D=_this$T3.width,I=_this$T3.height;(D!==P||I!==L)&&(this[T]={width:P,height:L},this.forceUpdate(),this.dispatchEvent({type:"resolutionchange",detail:{width:P,height:L}}));}},{key:"show",value:function show(){this.attributes.display==="none"&&(this.attributes.display=this[f]||"");}},{key:"hide",value:function hide(){this.attributes.display!=="none"&&(this[f]=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(P){var L=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};typeof L=="boolean"&&(L={capture:L});var I=L.capture?l:x;return this[I][P]&&(this[I][P]=[]),this;}},{key:"removeAttribute",value:function removeAttribute(P){this.setAttribute(P,null);}},{key:"removeEventListener",value:function removeEventListener(P,L){var D=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};typeof D=="boolean"&&(D={capture:D});var C=D.capture?l:x;if(this[C][P]){var B=this[C][P];if(B)for(var G=0;G<B.length;G++){var H=B[G].listener;if(H===L){this[C][P].splice(G,1);break;}}}return this;}},{key:"transition",value:function transition(P){var L=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"linear";var D=this,I=Symbol("animation");L=L||"linear";var C=0;return _typeof(P)=="object"&&(C=P.delay||0,P=P.duration),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},I,null),"cancel",function cancel(){var B=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;var G=this[I];G&&G.cancel(B);}),"end",function end(){var B=this[I];B&&(B.playState==="running"||B.playState==="pending")&&B.finish();}),"reverse",function reverse(){var B=this[I];if(B)if(B.playState==="running"||B.playState==="pending")B.playbackRate=-B.playbackRate;else{var G=B.timing.direction;B.timing.direction=G==="reverse"?"normal":"reverse",B.play();}return B.finished;}),"attr",function attr(B,G){return this.end(),typeof B=="string"&&(B=_defineProperty({},B,G)),Object.entries(B).forEach(function(_ref104){var _ref105=_slicedToArray(_ref104,2),H=_ref105[0],X=_ref105[1];typeof X=="function"&&(B[H]=X(D.attr(H)));}),this[I]=D.animate([B],{duration:P*1e3,delay:C*1e3,fill:"forwards",easing:L}),this[I].finished;});}},{key:"updateContours",value:function updateContours(){}}]);}();v(R,"Attr",n["default"]),a["default"].registerNode(R,"node");},/* 71 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return R;});var e=t(1),n=t(12),i=t(72);t(1).glMatrix.setMatrixArrayType(Array);var a=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_declareAlias"),s=Symbol["for"]("spritejs_setAttribute"),c=Symbol["for"]("spritejs_getAttribute"),p=Symbol["for"]("spritejs_attributes"),h=Symbol["for"]("spritejs_changedAttrs"),v=Symbol("subject"),y=Symbol("attr"),M=Symbol("default"),T=Symbol("alias");function m(b,_ref107){var _ref108=_slicedToArray(_ref107,2),P=_ref108[0],L=_ref108[1];var D=e.mat2d.fromValues(1,0,0,1,0,0);return _toConsumableArray(b).forEach(function(_ref109){var _ref110=_slicedToArray(_ref109,2),I=_ref110[0],C=_ref110[1];if((P||L)&&(D=e.mat2d.translate(Array.of(0,0,0,0,0,0),D,[P,L])),I==="matrix")D=e.mat2d.multiply(D,D,C);else if(I==="offsetTranslate")D[4]+=C[0],D[5]+=C[1];else if(I==="offsetRotate")D=e.mat2d.rotate(Array.of(0,0,0,0,0,0),D,C);else if(I==="skew"){var _C5=_slicedToArray(C,2),B=_C5[0],G=_C5[1];D=e.mat2d.multiply(D,D,e.mat2d.fromValues(1,Math.tan(G),Math.tan(B),1,0,0));}else e.mat2d[I](D,D,C);(P||L)&&(D=e.mat2d.translate(Array.of(0,0,0,0,0,0),D,[-P,-L]));}),D;}var x=Symbol("transformMatrix"),l=Symbol("transforms"),d=Symbol("changedAttrs"),f=Symbol("lastChangedAttr"),g=Symbol("offsetFigure");function O(b,P,L){var D=b[y][P];if(b[s](P,L,!1)||b[f]!==P){var C=b[l];C.has(P)&&C["delete"](P),L&&(P==="rotate"&&(L=Math.PI*L/180),P==="scale"&&(L=L.map(function(B){return Math.abs(B)>1e-5?B:1/B>0?1e-5:-1e-5;})),C.set(P,L)),b[x]=null,b[v].onPropertyChange(P,L,D,b);}}function A(b){var P=b[g],L=b.offsetDistance*P.getTotalLength(),D=P.getPointAtLength(L);if(D){var I=b[l];var C=b.offsetRotate;C==="auto"?C=D.angle:C==="reverse"?C=Math.PI+D.angle:C=Math.PI*C/180,I.set("offsetRotate",C),I.set("offsetTranslate",[D.x,D.y]),b[x]=null;}}var R=/*#__PURE__*/function(){function R(P){var _this24=this;_classCallCheck(this,R);this[v]=P,this[y]={},this[x]=e.mat2d.fromValues(1,0,0,1,0,0),this[l]=/* @__PURE__ */new Map(),this[M]={},this[T]=[],Object.defineProperty(P,"transformMatrix",{get:function get(){return _this24[x]||(_this24[x]=m(_this24[l],_this24.transformOrigin)),_toConsumableArray(_this24[x]);}}),this[a]({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
|
|
224
|
-
filter:"none",display:""}),this[o]("class","pos"),this[d]=/* @__PURE__ */new Set(),this[g]=new n.Figure2D({scale:5,simplify:0});}return _createClass(R,[{key:h,get:function get(){var _this25=this;var P={};return _toConsumableArray(this[d]).forEach(function(L){P[L]=_this25[y][L];}),P;}},{key:p,get:function get(){var P=Object.assign({},this[y]);for(var L=0;L<this[T].length;L++){var D=this[T][L];P[D]=this[D];}return P;}},{key:a,value:function value(P){Object.assign(this[M],P),Object.assign(this[y],P);}},{key:o,value:function value(){var _this$T4;(_this$T4=this[T]).push.apply(_this$T4,arguments);}},{key:s,value:function value(P,L){var D=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var I=this[y][P],C=this[v];return L==null&&(L=this[M][P]),Object(i.compareValue)(I,L)?!1:(this[y][P]=L,this[d].has(P)&&this[d]["delete"](P),this[d].add(P),this[f]=P,D&&C.onPropertyChange(P,L,I,this),!0);}},{key:c,value:function value(P){return this[y][P];}},{key:"id",set:function set(P){this[s]("id",P);}},{key:"id",get:function get(){return this[c]("id");}},{key:"name",set:function set(P){this[s]("name",P);}},{key:"name",get:function get(){return this[c]("name");}},{key:"className",set:function set(P){this[s]("className",P);}},{key:"className",get:function get(){return this[c]("className");}},{key:"class",set:function set(P){this.className=P;}},{key:"class",get:function get(){return this.className;}},{key:"x",get:function get(){return this[c]("x");}},{key:"x",set:function set(P){this[s]("x",Object(i.toNumber)(P));}},{key:"y",get:function get(){return this[c]("y");}},{key:"y",set:function set(P){this[s]("y",Object(i.toNumber)(P));}},{key:"pos",get:function get(){return[this.x,this.y];}},{key:"pos",set:function set(P){P=Object(i.toArray)(P),Array.isArray(P)||(P=[P,P]),this.x=P[0],this.y=P[1];}},{key:"transform",get:function get(){return this[c]("transform");}},{key:"transform",set:function set(P){var L=null;if(Array.isArray(P)&&(L=P,P="matrix(".concat(P.map(i.toNumber).join(),")")),typeof P=="string")P=P.replace(/\s*,\s*/g,",");else if(P!=null)throw new TypeError("Invalid transform value.");var D=this[y].transform;if(this[s]("transform",P,!1)){var I=this[l];if(I.has("matrix")&&I["delete"]("matrix"),L)I.set("matrix",L);else if(P){var C=P.match(/(matrix|translate|rotate|scale|skew)\([^()]+\)/g);if(C){var B=e.mat2d.fromValues(1,0,0,1,0,0);for(var G=0;G<C.length;G++){var X=C[G].match(/^(matrix|translate|rotate|scale|skew)\(([^()]+)\)/);if(X){var _X2=_slicedToArray(X,3),Z=_X2[1],W=_X2[2];Z==="rotate"?W=Math.PI*parseFloat(W)/180:W=W.trim().split(/[\s,]+/).map(function(z){return Object(i.toNumber)(z);}),Z==="matrix"?B=e.mat2d.multiply(B,B,W):Z==="skew"?B=e.mat2d.multiply(B,B,e.mat2d.fromValues(1,Math.tan(W[1]),Math.tan(W[0]),1,0,0)):e.mat2d[Z](B,B,W),I.set("matrix",B);}}}else throw new TypeError("Invalid transform value.");}this[x]=null,this[v].onPropertyChange("transform",P,D,this);}}},{key:"transformOrigin",get:function get(){return this[c]("transformOrigin");}},{key:"transformOrigin",set:function set(P){P=Object(i.toArray)(P,!0),P!=null&&!Array.isArray(P)&&(P=[P,P]),this[s]("transformOrigin",P)&&(this[x]=null);}},{key:"rotate",get:function get(){return this[c]("rotate");}},{key:"rotate",set:function set(P){O(this,"rotate",P);}},{key:"translate",get:function get(){return this[c]("translate");}},{key:"translate",set:function set(P){P=Object(i.toArray)(P,!0),P!=null&&!Array.isArray(P)&&(P=[P,P]),O(this,"translate",P);}},{key:"scale",get:function get(){return this[c]("scale");}},{key:"scale",set:function set(P){P=Object(i.toArray)(P,!0),P!=null&&!Array.isArray(P)&&(P=[P,P]),O(this,"scale",P);}},{key:"skew",get:function get(){return this[c]("skew");}},{key:"skew",set:function set(P){P=Object(i.toArray)(P,!0),P!=null&&!Array.isArray(P)&&(P=[P,P]),O(this,"skew",P);}},{key:"opacity",get:function get(){return this[c]("opacity");}},{key:"opacity",set:function set(P){P!=null&&(P=Number(P)),this[s]("opacity",P);}},{key:"zIndex",get:function get(){return this[c]("zIndex");}},{key:"zIndex",set:function set(P){P!=null&&(P=Number(P)),this[s]("zIndex",P);}},{key:"offsetPath",get:function get(){return this[c]("offsetPath");}},{key:"offsetPath",set:function set(P){this[s]("offsetPath",P)&&(this[g].beginPath(),P!=null&&this[g].addPath(P),A(this));}},{key:"offsetDistance",get:function get(){return this[c]("offsetDistance");}},{key:"offsetDistance",set:function set(P){this[s]("offsetDistance",Object(i.toNumber)(P))&&A(this);}},{key:"offsetRotate",get:function get(){return this[c]("offsetRotate");}},{key:"offsetRotate",set:function set(P){this[s]("offsetRotate",P),A(this);}},{key:"pointerEvents",get:function get(){return this[c]("pointerEvents");}},{key:"pointerEvents",set:function set(P){if(P!=null&&P!=="none"&&P!=="visible"&&P!=="visibleFill"&&P!=="visibleStroke"&&P!=="all")throw new TypeError("Invalid pointerEvents type.");this[s]("pointerEvents",P);}},{key:"filter",get:function get(){return this[c]("filter");}},{key:"filter",set:function set(P){this[s]("filter",P);}},{key:"display",get:function get(){return this[c]("display");}},{key:"display",set:function set(P){this[s]("display",P);}/* istanbul ignore next */},{key:"offset",set:function set(P){}}],[{key:"setDefault",value:function setDefault(P){for(var _len8=arguments.length,L=new Array(_len8>1?_len8-1:0),_key8=1;_key8<_len8;_key8++){L[_key8-1]=arguments[_key8];}return P[a].apply(P,L);}},{key:"declareAlias",value:function declareAlias(P){for(var _len9=arguments.length,L=new Array(_len9>1?_len9-1:0),_key9=1;_key9<_len9;_key9++){L[_key9-1]=arguments[_key9];}return P[o].apply(P,L);}},{key:"setAttribute",value:function setAttribute(P){for(var _len10=arguments.length,L=new Array(_len10>1?_len10-1:0),_key10=1;_key10<_len10;_key10++){L[_key10-1]=arguments[_key10];}return P[s].apply(P,L);}},{key:"getAttribute",value:function getAttribute(P){for(var _len11=arguments.length,L=new Array(_len11>1?_len11-1:0),_key11=1;_key11<_len11;_key11++){L[_key11-1]=arguments[_key11];}return P[c].apply(P,L);}},{key:"getAttributes",value:function getAttributes(P){return P[p];}},{key:"getChangedAttributes",value:function getChangedAttributes(P){return P[h];}}]);}();},/* 72 */ /***/function(u,r,t){t.r(r),t.d(r,"sizeToPixel",function(){return e;}),t.d(r,"toString",function(){return n;}),t.d(r,"toNumber",function(){return i;}),t.d(r,"toArray",function(){return a;}),t.d(r,"compareValue",function(){return o;}),t(1).glMatrix.setMatrixArrayType(Array);function e(s,c){var p=s.trim().match(/^([\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin)$/);p?s={size:parseFloat(p[1]),unit:p[2]}:s={size:parseFloat(s),unit:"px"};var _s3=s,h=_s3.size,v=_s3.unit;if(v==="pt")h/=0.75;else if(v==="pc")h*=16;else if(v==="in")h*=96;else if(v==="cm")h*=96/2.54;else if(v==="mm")h*=96/25.4;else if(v==="em"||v==="rem"||v==="ex"){if(!c&&typeof getComputedStyle=="function"&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var y=getComputedStyle(document.documentElement).fontSize;y?c=e(y,16):c=16;}h*=c,v==="ex"&&(h/=2);}else if(v==="q")h*=96/25.4/4;else if(v==="vw"||v==="vh"){if((typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _y3=v==="vw"?window.innerWidth||document.documentElement.clientWidth:window.innerHeight||document.documentElement.clientHeight;h*=_y3/100;}}else if((v==="vmax"||v==="vmin")&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _y4=window.innerWidth||document.documentElement.clientWidth,M=window.innerHeight||document.documentElement.clientHeight;v==="vmax"?h*=Math.max(_y4,M)/100:h*=Math.min(_y4,M)/100;}return h;}function n(s){return s==null?s:String(s);}function i(s){if(s==null)return s;if(typeof s=="string"&&(s=e(s)),!Number.isFinite(s))throw new TypeError("Invalid value");return s;}function a(s){var c=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;return s===""?null:(typeof s=="string"&&(s=s.split(/[\s,]+/g)),Array.isArray(s)&&(c&&(s=s.map(i)),s.length===1)?s[0]:s);}function o(s,c){if(Array.isArray(s)&&Array.isArray(c)){if(s.length!==c.length)return!1;for(var p=0;p<s.length;p++)if(s[p]!==c[p])return!1;return!0;}return s==null&&c==null||s===c;}},/* 73 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return v;});var e=t(74),n=t(32),i=/* @__PURE__ */t.n(n),a=t(68),o=t(72);t(1).glMatrix.setMatrixArrayType(Array);function s(){return s=Object.assign||function(y){for(var M=1;M<arguments.length;M++){var T=arguments[M];for(var m in T)Object.prototype.hasOwnProperty.call(T,m)&&(y[m]=T[m]);}return y;},s.apply(this,arguments);}function c(y){if(typeof y=="string"){if(y=y.trim(),/^[0-9.]+%$/.test(y))return parseFloat(y)/100;if(/^([\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin)$/.test(y))return Object(o.sizeToPixel)(y);}return y;}function p(y,M,T,m,x){return typeof y=="string"&&(y=i()(y)),typeof M=="string"&&(M=i()(M)),e.Effects["default"](y,M,T,m,x);}function h(y,M,T,m,x){return e.Effects["default"](y,M,T,m,x);}e.Effects["default"]=function(y,M,T,m,x){return Array.isArray(y)&&Array.isArray(M)?y.map(function(l,d){return l+(T-m)/(x-m)*(M[d]-l);}):typeof y=="number"&&typeof M=="number"?y+(T-m)/(x-m)*(M-y):T-m>x-T?M:y;},e.Effects.fillColor=p,e.Effects.strokeColor=p,e.Effects.bgcolor=p,e.Effects.borderColor=p,e.Effects.text=h;var v=/*#__PURE__*/function(_e$Animator){function v(M,T,m){var _this26;_classCallCheck(this,v);var x=M.attr();Object.entries(x).forEach(function(_ref111){var _ref112=_slicedToArray(_ref111,2),l=_ref112[0],d=_ref112[1];x[l]=e.Effects[l]?d:c(d);}),T=T.map(function(l){var d=s({},l);var f={};return Object.entries(d).forEach(function(_ref113){var _ref114=_slicedToArray(_ref113,2),g=_ref114[0],O=_ref114[1];f[g]=e.Effects[g]?O:c(O);}),f;}),_this26=_callSuper(this,v,[x,T,m]),_this26.target=M,_this26.setter=function(l,d){d.attr(l);};return _this26;}_inherits(v,_e$Animator);return _createClass(v,[{key:"playState",get:function get(){return this.target.parent?_get(_getPrototypeOf(v.prototype),"playState",this):"idle";}},{key:"finished",get:function get(){var _this27=this;return _get(_getPrototypeOf(v.prototype),"finished",this).then(function(){var M=_this27;return new Promise(function(T){function m(){M.setter(M.frame,M.target);var x=M.playState;x==="finished"||x==="idle"?(Object(a.cancelAnimationFrame)(M.requestId),T()):Object(a.requestAnimationFrame)(m);}m();});});}},{key:"finish",value:function finish(){_get(_getPrototypeOf(v.prototype),"finish",this).call(this),Object(a.cancelAnimationFrame)(this.requestId),this.setter(this.frame,this.target);}},{key:"play",value:function play(){if(!this.target.parent||this.playState==="running")return;_get(_getPrototypeOf(v.prototype),"play",this).call(this),this.setter(this.frame,this.target);var M=this;this.ready.then(function(){M.setter(M.frame,M.target),M.requestId=Object(a.requestAnimationFrame)(function T(){var m=M.target;if((typeof document==="undefined"?"undefined":_typeof(document))<"u"&&document.documentElement&&document.documentElement.contains&&m.layer&&m.layer.canvas&&!document.documentElement.contains(m.layer.canvas)){M.cancel();return;}var x=M.playState;M.setter(M.frame,M.target),x!=="idle"&&(x==="running"?M.requestId=Object(a.requestAnimationFrame)(T):(x==="paused"||x==="pending"&&M.timeline.currentTime<0)&&M.ready.then(function(){M.setter(M.frame,M.target),M.requestId=Object(a.requestAnimationFrame)(T);}));});});}},{key:"cancel",value:function cancel(){var M=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;Object(a.cancelAnimationFrame)(this.requestId),M?(this.setter(this.frame,this.target),_get(_getPrototypeOf(v.prototype),"cancel",this).call(this)):(_get(_getPrototypeOf(v.prototype),"cancel",this).call(this),this.setter(this.frame,this.target));}}]);}(e.Animator);},/* 74 */ /***/function(u,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r.Timeline=r.Effects=r.Easings=r.Animator=void 0;var e=t(75),n=p(e),i=t(187),a=p(i),o=t(188),s=t(190),c=p(s);function p(h){return h&&h.__esModule?h:{"default":h};}r.Animator=c["default"],r.Easings=o.Easings,r.Effects=a["default"],r.Timeline=n["default"];},/* 75 */ /***/function(u,r,t){Object.defineProperty(r,"__esModule",{value:!0});var e=t(76),n=l(e),i=t(133),a=l(i),o=t(141),s=l(o),c=t(164),p=l(c),h=t(170),v=l(h),y=t(171),M=l(y),T=t(175),m=l(T),x=t(186);function l(D){return D&&D.__esModule?D:{"default":D};}var d=(0,x.createNowTime)(),f={originTime:0,playbackRate:1},g=(0,m["default"])("timeMark"),O=(0,m["default"])("playbackRate"),A=(0,m["default"])("timers"),R=(0,m["default"])("originTime"),b=(0,m["default"])("setTimer"),P=(0,m["default"])("parent"),L=function(){function D(I,C){(0,v["default"])(this,D),I instanceof D&&(C=I,I={}),I=(0,p["default"])({},f,I),C&&(this[P]=C);var B=I.nowtime||d;if(C)Object.defineProperty(this,"globalTime",{get:function get(){return C.currentTime;}});else{var G=B();Object.defineProperty(this,"globalTime",{get:function get(){return B()-G;}});}this[g]=[{globalTime:this.globalTime,localTime:-I.originTime,entropy:-I.originTime,playbackRate:I.playbackRate,globalEntropy:0}],this[P]&&(this[g][0].globalEntropy=this[P].entropy),this[R]=I.originTime,this[O]=I.playbackRate,this[A]=new s["default"]();}return(0,M["default"])(D,[{key:"markTime",value:function value(){var C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},B=C.time,G=B===void 0?this.currentTime:B,H=C.entropy,X=H===void 0?this.entropy:H,Z=C.playbackRate,W=Z===void 0?this.playbackRate:Z,z={globalTime:this.globalTime,localTime:G,entropy:X,playbackRate:W,globalEntropy:this.globalEntropy};this[g].push(z);}},{key:"fork",value:function value(C){return new D(C,this);}},{key:"seekGlobalTime",value:function value(C){var B=this.seekTimeMark(C),G=this[g][B],H=G.entropy,X=G.playbackRate,Z=G.globalTime;return Z+(C-H)/Math.abs(X);}},{key:"seekLocalTime",value:function value(C){var B=this.seekTimeMark(C),G=this[g][B],H=G.localTime,X=G.entropy,Z=G.playbackRate;return Z>0?H+(C-X):H-(C-X);}},{key:"seekTimeMark",value:function value(C){var B=this[g],G=0,H=B.length-1;if(C<=B[G].entropy)return G;if(C>=B[H].entropy)return H;for(var X=Math.floor((G+H)/2);X>G&&X<H;){if(C===B[X].entropy)return X;C<B[X].entropy?H=X:C>B[X].entropy&&(G=X),X=Math.floor((G+H)/2);}return G;}},{key:"updateTimers",value:function value(){var C=this,B=[].concat((0,a["default"])(this[A]));B.forEach(function(G){var H=(0,n["default"])(G,2),X=H[0],Z=H[1];C[b](Z.handler,Z.time,X);});}},{key:"clearTimeout",value:function(I){function C(B){return I.apply(this,arguments);}return C.toString=function(){return I.toString();},C;}(function(I){var C=this[A].get(I);C&&C.timerID!=null&&(this[P]?this[P].clearTimeout(C.timerID):clearTimeout(C.timerID)),this[A]["delete"](I);})},{key:"clearInterval",value:function value(C){return this.clearTimeout(C);}},{key:"clear",value:function value(){var C=this,B=this[A];[].concat((0,a["default"])(B.keys())).forEach(function(G){C.clearTimeout(G);});}/*
|
|
225
|
-
setTimeout(func, {delay: 100, isEntropy: true})
|
|
226
|
-
setTimeout(func, {entropy: 100})
|
|
227
|
-
setTimeout(func, 100})
|
|
228
|
-
*/},{key:"setTimeout",value:function value(C){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{delay:0};return this[b](C,B);}},{key:"setInterval",value:function value(C){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{delay:0},G=this,H=this[b](function X(){G[b](X,B,H),C();},B);return H;}},{key:b,value:function value(C,B){var G=this,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:(0,m["default"])("timerID");B=(0,x.formatDelay)(B);var X=this[A].get(H),Z=void 0,W=null,z=void 0,Q=void 0;X?(this.clearTimeout(H),B.isEntropy?Z=(B.delay-(this.entropy-X.startEntropy))/Math.abs(this.playbackRate):Z=(B.delay-(this.currentTime-X.startTime))/this.playbackRate,z=X.startTime,Q=X.startEntropy):(Z=B.delay/(B.isEntropy?Math.abs(this.playbackRate):this.playbackRate),z=this.currentTime,Q=this.entropy);var et=this[P],_=et?et.setTimeout.bind(et):setTimeout,st=B.heading;return!et&&st===!1&&Z<0&&(Z=1/0),(isFinite(Z)||et)&&(Z=Math.ceil(Z),_!==setTimeout&&(Z={delay:Z,heading:st}),W=_(function(){G[A]["delete"](H),C();},Z)),this[A].set(H,{timerID:W,handler:C,time:B,startTime:z,startEntropy:Q}),H;}},{key:"parent",get:function get(){return this[P];}},{key:"lastTimeMark",get:function get(){return this[g][this[g].length-1];}},{key:"currentTime",get:function get(){var C=this.lastTimeMark,B=C.localTime,G=C.globalTime;return B+(this.globalTime-G)*this.playbackRate;},set:function set(C){var B=this,G=this.currentTime,H=C,X=this[A];this.markTime({time:C}),[].concat((0,a["default"])(X)).forEach(function(Z){var W=(0,n["default"])(Z,2),z=W[0],Q=W[1];if(X.has(z)){var et=Q.time,_=et.isEntropy,st=et.delay,q=et.heading,ht=Q.handler,dt=Q.startTime;if(_)st===0&&(ht(),B.clearTimeout(z));else{var F=dt+st;(st===0||q!==!1&&(H-G)*st<=0||G<=F&&F<=H||G>=F&&F>=H)&&(ht(),B.clearTimeout(z));}}}),this.updateTimers();}// Both currentTime and entropy should be influenced by playbackRate.
|
|
229
|
-
// If current playbackRate is negative, the currentTime should go backwards
|
|
230
|
-
// while the entropy remain to go forwards.
|
|
231
|
-
// Both of the initial values is set to -originTime
|
|
232
|
-
},{key:"entropy",get:function get(){var C=this.lastTimeMark,B=C.entropy,G=C.globalEntropy;return B+Math.abs((this.globalEntropy-G)*this.playbackRate);},// get globalTime() {
|
|
233
|
-
// if(this[_parent]) {
|
|
234
|
-
// return this[_parent].currentTime;
|
|
235
|
-
// }
|
|
236
|
-
// return nowtime();
|
|
237
|
-
// }
|
|
238
|
-
// change entropy will NOT cause currentTime changing but may influence the pass
|
|
239
|
-
// and the future of the timeline. (It may change the result of seek***Time)
|
|
240
|
-
// While entropy is set, all the marks behind will be droped
|
|
241
|
-
set:function set(C){if(this.entropy>C){var B=this.seekTimeMark(C);this[g].length=B+1;}this.markTime({entropy:C}),this.updateTimers();}},{key:"globalEntropy",get:function get(){return this[P]?this[P].entropy:this.globalTime;}},{key:"playbackRate",get:function get(){return this[O];},set:function set(C){C!==this.playbackRate&&(this.markTime({playbackRate:C}),this[O]=C,this.updateTimers());}},{key:"paused",get:function get(){if(this.playbackRate===0)return!0;for(var C=this.parent;C;){if(C.playbackRate===0)return!0;C=C.parent;}return!1;}}]),D;}();r["default"]=L;},/* 76 */ /***/function(u,r,t){r.__esModule=!0;var e=t(77),n=o(e),i=t(129),a=o(i);function o(s){return s&&s.__esModule?s:{"default":s};}r["default"]=/* @__PURE__ */function(){function s(c,p){var h=[],v=!0,y=!1,M=void 0;try{for(var T=(0,a["default"])(c),m;!(v=(m=T.next()).done)&&(h.push(m.value),!(p&&h.length===p));v=!0);}catch(x){y=!0,M=x;}finally{try{!v&&T["return"]&&T["return"]();}finally{if(y)throw M;}}return h;}return function(c,p){if(Array.isArray(c))return c;if((0,n["default"])(Object(c)))return s(c,p);throw new TypeError("Invalid attempt to destructure non-iterable instance");};}();},/* 77 */ /***/function(u,r,t){u.exports={"default":t(78),__esModule:!0};},/* 78 */ /***/function(u,r,t){t(79),t(125),u.exports=t(127);},/* 79 */ /***/function(u,r,t){t(80);for(var e=t(91),n=t(95),i=t(83),a=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(","),s=0;s<o.length;s++){var c=o[s],p=e[c],h=p&&p.prototype;h&&!h[a]&&n(h,a,c),i[c]=i.Array;}},/* 80 */ /***/function(u,r,t){var e=t(81),n=t(82),i=t(83),a=t(84);u.exports=t(88)(Array,"Array",function(o,s){this._t=a(o),this._i=0,this._k=s;},function(){var o=this._t,s=this._k,c=this._i++;return!o||c>=o.length?(this._t=void 0,n(1)):s=="keys"?n(0,c):s=="values"?n(0,o[c]):n(0,[c,o[c]]);},"values"),i.Arguments=i.Array,e("keys"),e("values"),e("entries");},/* 81 */ /***/function(u,r){u.exports=function(){};},/* 82 */ /***/function(u,r){u.exports=function(t,e){return{value:e,done:!!t};};},/* 83 */ /***/function(u,r){u.exports={};},/* 84 */ /***/function(u,r,t){var e=t(85),n=t(87);u.exports=function(i){return e(n(i));};},/* 85 */ /***/function(u,r,t){var e=t(86);u.exports=Object("z").propertyIsEnumerable(0)?Object:function(n){return e(n)=="String"?n.split(""):Object(n);};},/* 86 */ /***/function(u,r){var t={}.toString;u.exports=function(e){return t.call(e).slice(8,-1);};},/* 87 */ /***/function(u,r){u.exports=function(t){if(t==null)throw TypeError("Can't call method on "+t);return t;};},/* 88 */ /***/function(u,r,t){var e=t(89),n=t(90),i=t(106),a=t(95),o=t(83),s=t(107),c=t(121),p=t(123),h=t(122)("iterator"),v=!([].keys&&"next"in[].keys()),y="@@iterator",M="keys",T="values",m=function m(){return this;};u.exports=function(x,l,d,f,g,O,A){s(d,l,f);var R=function R(W){if(!v&&W in D)return D[W];switch(W){case M:return function(){return new d(this,W);};case T:return function(){return new d(this,W);};}return function(){return new d(this,W);};},b=l+" Iterator",P=g==T,L=!1,D=x.prototype,I=D[h]||D[y]||g&&D[g],C=I||R(g),B=g?P?R("entries"):C:void 0,G=l=="Array"&&D.entries||I,H,X,Z;if(G&&(Z=p(G.call(new x())),Z!==Object.prototype&&Z.next&&(c(Z,b,!0),!e&&typeof Z[h]!="function"&&a(Z,h,m))),P&&I&&I.name!==T&&(L=!0,C=function C(){return I.call(this);}),(!e||A)&&(v||L||!D[h])&&a(D,h,C),o[l]=C,o[b]=m,g)if(H={values:P?C:R(T),keys:O?C:R(M),entries:B},A)for(X in H)X in D||i(D,X,H[X]);else n(n.P+n.F*(v||L),l,H);return H;};},/* 89 */ /***/function(u,r){u.exports=!0;},/* 90 */ /***/function(u,r,t){var e=t(91),n=t(92),i=t(93),a=t(95),o=t(105),s="prototype",c=function c(p,h,v){var y=p&c.F,M=p&c.G,T=p&c.S,m=p&c.P,x=p&c.B,l=p&c.W,d=M?n:n[h]||(n[h]={}),f=d[s],g=M?e:T?e[h]:(e[h]||{})[s],O,A,R;M&&(v=h);for(O in v)A=!y&&g&&g[O]!==void 0,!(A&&o(d,O))&&(R=A?g[O]:v[O],d[O]=M&&typeof g[O]!="function"?v[O]:x&&A?i(R,e):l&&g[O]==R?function(b){var P=function P(L,D,I){if(this instanceof b){switch(arguments.length){case 0:return new b();case 1:return new b(L);case 2:return new b(L,D);}return new b(L,D,I);}return b.apply(this,arguments);};return P[s]=b[s],P;}(R):m&&typeof R=="function"?i(Function.call,R):R,m&&((d.virtual||(d.virtual={}))[O]=R,p&c.R&&f&&!f[O]&&a(f,O,R)));};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,u.exports=c;},/* 91 */ /***/function(u,r){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,r){var t=u.exports={version:"2.6.11"};typeof __e=="number"&&(__e=t);},/* 93 */ /***/function(u,r,t){var e=t(94);u.exports=function(n,i,a){if(e(n),i===void 0)return n;switch(a){case 1:return function(o){return n.call(i,o);};case 2:return function(o,s){return n.call(i,o,s);};case 3:return function(o,s,c){return n.call(i,o,s,c);};}return function(){return n.apply(i,arguments);};};},/* 94 */ /***/function(u,r){u.exports=function(t){if(typeof t!="function")throw TypeError(t+" is not a function!");return t;};},/* 95 */ /***/function(u,r,t){var e=t(96),n=t(104);u.exports=t(100)?function(i,a,o){return e.f(i,a,n(1,o));}:function(i,a,o){return i[a]=o,i;};},/* 96 */ /***/function(u,r,t){var e=t(97),n=t(99),i=t(103),a=Object.defineProperty;r.f=t(100)?Object.defineProperty:function(s,c,p){if(e(s),c=i(c,!0),e(p),n)try{return a(s,c,p);}catch(_unused15){}if("get"in p||"set"in p)throw TypeError("Accessors not supported!");return"value"in p&&(s[c]=p.value),s;};},/* 97 */ /***/function(u,r,t){var e=t(98);u.exports=function(n){if(!e(n))throw TypeError(n+" is not an object!");return n;};},/* 98 */ /***/function(u,r){u.exports=function(t){return _typeof(t)=="object"?t!==null:typeof t=="function";};},/* 99 */ /***/function(u,r,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,r,t){u.exports=!t(101)(function(){return Object.defineProperty({},"a",{get:function get(){return 7;}}).a!=7;});},/* 101 */ /***/function(u,r){u.exports=function(t){try{return!!t();}catch(_unused16){return!0;}};},/* 102 */ /***/function(u,r,t){var e=t(98),n=t(91).document,i=e(n)&&e(n.createElement);u.exports=function(a){return i?n.createElement(a):{};};},/* 103 */ /***/function(u,r,t){var e=t(98);u.exports=function(n,i){if(!e(n))return n;var a,o;if(i&&typeof(a=n.toString)=="function"&&!e(o=a.call(n))||typeof(a=n.valueOf)=="function"&&!e(o=a.call(n))||!i&&typeof(a=n.toString)=="function"&&!e(o=a.call(n)))return o;throw TypeError("Can't convert object to primitive value");};},/* 104 */ /***/function(u,r){u.exports=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e};};},/* 105 */ /***/function(u,r){var t={}.hasOwnProperty;u.exports=function(e,n){return t.call(e,n);};},/* 106 */ /***/function(u,r,t){u.exports=t(95);},/* 107 */ /***/function(u,r,t){var e=t(108),n=t(104),i=t(121),a={};t(95)(a,t(122)("iterator"),function(){return this;}),u.exports=function(o,s,c){o.prototype=e(a,{next:n(1,c)}),i(o,s+" Iterator");};},/* 108 */ /***/function(u,r,t){var e=t(97),n=t(109),i=t(119),a=t(116)("IE_PROTO"),o=function o(){},s="prototype",_c2=function c(){var p=t(102)("iframe"),h=i.length,v="<",y=">",M;for(p.style.display="none",t(120).appendChild(p),p.src="javascript:",M=p.contentWindow.document,M.open(),M.write(v+"script"+y+"document.F=Object"+v+"/script"+y),M.close(),_c2=M.F;h--;)delete _c2[s][i[h]];return _c2();};u.exports=Object.create||function(h,v){var y;return h!==null?(o[s]=e(h),y=new o(),o[s]=null,y[a]=h):y=_c2(),v===void 0?y:n(y,v);};},/* 109 */ /***/function(u,r,t){var e=t(96),n=t(97),i=t(110);u.exports=t(100)?Object.defineProperties:function(o,s){n(o);for(var c=i(s),p=c.length,h=0,v;p>h;)e.f(o,v=c[h++],s[v]);return o;};},/* 110 */ /***/function(u,r,t){var e=t(111),n=t(119);u.exports=Object.keys||function(a){return e(a,n);};},/* 111 */ /***/function(u,r,t){var e=t(105),n=t(84),i=t(112)(!1),a=t(116)("IE_PROTO");u.exports=function(o,s){var c=n(o),p=0,h=[],v;for(v in c)v!=a&&e(c,v)&&h.push(v);for(;s.length>p;)e(c,v=s[p++])&&(~i(h,v)||h.push(v));return h;};},/* 112 */ /***/function(u,r,t){var e=t(84),n=t(113),i=t(115);u.exports=function(a){return function(o,s,c){var p=e(o),h=n(p.length),v=i(c,h),y;if(a&&s!=s){for(;h>v;)if(y=p[v++],y!=y)return!0;}else for(;h>v;v++)if((a||v in p)&&p[v]===s)return a||v||0;return!a&&-1;};};},/* 113 */ /***/function(u,r,t){var e=t(114),n=Math.min;u.exports=function(i){return i>0?n(e(i),9007199254740991):0;};},/* 114 */ /***/function(u,r){var t=Math.ceil,e=Math.floor;u.exports=function(n){return isNaN(n=+n)?0:(n>0?e:t)(n);};},/* 115 */ /***/function(u,r,t){var e=t(114),n=Math.max,i=Math.min;u.exports=function(a,o){return a=e(a),a<0?n(a+o,0):i(a,o);};},/* 116 */ /***/function(u,r,t){var e=t(117)("keys"),n=t(118);u.exports=function(i){return e[i]||(e[i]=n(i));};},/* 117 */ /***/function(u,r,t){var e=t(92),n=t(91),i="__core-js_shared__",a=n[i]||(n[i]={});(u.exports=function(o,s){return a[o]||(a[o]=s!==void 0?s:{});})("versions",[]).push({version:e.version,mode:t(89)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"});},/* 118 */ /***/function(u,r){var t=0,e=Math.random();u.exports=function(n){return"Symbol(".concat(n===void 0?"":n,")_",(++t+e).toString(36));};},/* 119 */ /***/function(u,r){u.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",");},/* 120 */ /***/function(u,r,t){var e=t(91).document;u.exports=e&&e.documentElement;},/* 121 */ /***/function(u,r,t){var e=t(96).f,n=t(105),i=t(122)("toStringTag");u.exports=function(a,o,s){a&&!n(a=s?a:a.prototype,i)&&e(a,i,{configurable:!0,value:o});};},/* 122 */ /***/function(u,r,t){var e=t(117)("wks"),n=t(118),i=t(91).Symbol,a=typeof i=="function",o=u.exports=function(s){return e[s]||(e[s]=a&&i[s]||(a?i:n)("Symbol."+s));};o.store=e;},/* 123 */ /***/function(u,r,t){var e=t(105),n=t(124),i=t(116)("IE_PROTO"),a=Object.prototype;u.exports=Object.getPrototypeOf||function(o){return o=n(o),e(o,i)?o[i]:typeof o.constructor=="function"&&o instanceof o.constructor?o.constructor.prototype:o instanceof Object?a:null;};},/* 124 */ /***/function(u,r,t){var e=t(87);u.exports=function(n){return Object(e(n));};},/* 125 */ /***/function(u,r,t){var e=t(126)(!0);t(88)(String,"String",function(n){this._t=String(n),this._i=0;},function(){var n=this._t,i=this._i,a;return i>=n.length?{value:void 0,done:!0}:(a=e(n,i),this._i+=a.length,{value:a,done:!1});});},/* 126 */ /***/function(u,r,t){var e=t(114),n=t(87);u.exports=function(i){return function(a,o){var s=String(n(a)),c=e(o),p=s.length,h,v;return c<0||c>=p?i?"":void 0:(h=s.charCodeAt(c),h<55296||h>56319||c+1===p||(v=s.charCodeAt(c+1))<56320||v>57343?i?s.charAt(c):h:i?s.slice(c,c+2):(h-55296<<10)+(v-56320)+65536);};};},/* 127 */ /***/function(u,r,t){var e=t(128),n=t(122)("iterator"),i=t(83);u.exports=t(92).isIterable=function(a){var o=Object(a);return o[n]!==void 0||"@@iterator"in o||i.hasOwnProperty(e(o));};},/* 128 */ /***/function(u,r,t){var e=t(86),n=t(122)("toStringTag"),i=e(/* @__PURE__ */function(){return arguments;}())=="Arguments",a=function a(o,s){try{return o[s];}catch(_unused17){}};u.exports=function(o){var s,c,p;return o===void 0?"Undefined":o===null?"Null":typeof(c=a(s=Object(o),n))=="string"?c:i?e(s):(p=e(s))=="Object"&&typeof s.callee=="function"?"Arguments":p;};},/* 129 */ /***/function(u,r,t){u.exports={"default":t(130),__esModule:!0};},/* 130 */ /***/function(u,r,t){t(79),t(125),u.exports=t(131);},/* 131 */ /***/function(u,r,t){var e=t(97),n=t(132);u.exports=t(92).getIterator=function(i){var a=n(i);if(typeof a!="function")throw TypeError(i+" is not iterable!");return e(a.call(i));};},/* 132 */ /***/function(u,r,t){var e=t(128),n=t(122)("iterator"),i=t(83);u.exports=t(92).getIteratorMethod=function(a){if(a!=null)return a[n]||a["@@iterator"]||i[e(a)];};},/* 133 */ /***/function(u,r,t){r.__esModule=!0;var e=t(134),n=i(e);function i(a){return a&&a.__esModule?a:{"default":a};}r["default"]=function(a){if(Array.isArray(a)){for(var o=0,s=Array(a.length);o<a.length;o++)s[o]=a[o];return s;}else return(0,n["default"])(a);};},/* 134 */ /***/function(u,r,t){u.exports={"default":t(135),__esModule:!0};},/* 135 */ /***/function(u,r,t){t(125),t(136),u.exports=t(92).Array.from;},/* 136 */ /***/function(u,r,t){var e=t(93),n=t(90),i=t(124),a=t(137),o=t(138),s=t(113),c=t(139),p=t(132);n(n.S+n.F*!t(140)(function(h){Array.from(h);}),"Array",{// 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
|
|
242
|
-
from:function from(v){var y=i(v),M=typeof this=="function"?this:Array,T=arguments.length,m=T>1?arguments[1]:void 0,x=m!==void 0,l=0,d=p(y),f,g,O,A;if(x&&(m=e(m,T>2?arguments[2]:void 0,2)),d!=null&&!(M==Array&&o(d)))for(A=d.call(y),g=new M();!(O=A.next()).done;l++)c(g,l,x?a(A,m,[O.value,l],!0):O.value);else for(f=s(y.length),g=new M(f);f>l;l++)c(g,l,x?m(y[l],l):y[l]);return g.length=l,g;}});},/* 137 */ /***/function(u,r,t){var e=t(97);u.exports=function(n,i,a,o){try{return o?i(e(a)[0],a[1]):i(a);}catch(c){var s=n["return"];throw s!==void 0&&e(s.call(n)),c;}};},/* 138 */ /***/function(u,r,t){var e=t(83),n=t(122)("iterator"),i=Array.prototype;u.exports=function(a){return a!==void 0&&(e.Array===a||i[n]===a);};},/* 139 */ /***/function(u,r,t){var e=t(96),n=t(104);u.exports=function(i,a,o){a in i?e.f(i,a,n(0,o)):i[a]=o;};},/* 140 */ /***/function(u,r,t){var e=t(122)("iterator"),n=!1;try{var i=[7][e]();i["return"]=function(){n=!0;},Array.from(i,function(){throw 2;});}catch(_unused18){}u.exports=function(a,o){if(!o&&!n)return!1;var s=!1;try{var c=[7],p=c[e]();p.next=function(){return{done:s=!0};},c[e]=function(){return p;},a(c);}catch(_unused19){}return s;};},/* 141 */ /***/function(u,r,t){u.exports={"default":t(142),__esModule:!0};},/* 142 */ /***/function(u,r,t){t(143),t(125),t(79),t(144),t(157),t(160),t(162),u.exports=t(92).Map;},/* 143 */ /***/function(u,r){},/* 144 */ /***/function(u,r,t){var e=t(145),n=t(151),i="Map";u.exports=t(152)(i,function(a){return function(){return a(this,arguments.length>0?arguments[0]:void 0);};},{// 23.1.3.6 Map.prototype.get(key)
|
|
243
|
-
get:function get(o){var s=e.getEntry(n(this,i),o);return s&&s.v;},// 23.1.3.9 Map.prototype.set(key, value)
|
|
244
|
-
set:function set(o,s){return e.def(n(this,i),o===0?0:o,s);}},e,!0);},/* 145 */ /***/function(u,r,t){var e=t(96).f,n=t(108),i=t(146),a=t(93),o=t(147),s=t(148),c=t(88),p=t(82),h=t(149),v=t(100),y=t(150).fastKey,M=t(151),T=v?"_s":"size",m=function m(x,l){var d=y(l),f;if(d!=="F")return x._i[d];for(f=x._f;f;f=f.n)if(f.k==l)return f;};u.exports={getConstructor:function getConstructor(x,l,d,f){var g=x(function(O,A){o(O,g,l,"_i"),O._t=l,O._i=n(null),O._f=void 0,O._l=void 0,O[T]=0,A!=null&&s(A,d,O[f],O);});return i(g.prototype,{// 23.1.3.1 Map.prototype.clear()
|
|
245
|
-
// 23.2.3.2 Set.prototype.clear()
|
|
246
|
-
clear:function clear(){for(var A=M(this,l),R=A._i,b=A._f;b;b=b.n)b.r=!0,b.p&&(b.p=b.p.n=void 0),delete R[b.i];A._f=A._l=void 0,A[T]=0;},// 23.1.3.3 Map.prototype.delete(key)
|
|
247
|
-
// 23.2.3.4 Set.prototype.delete(value)
|
|
248
|
-
"delete":function _delete(O){var A=M(this,l),R=m(A,O);if(R){var b=R.n,P=R.p;delete A._i[R.i],R.r=!0,P&&(P.n=b),b&&(b.p=P),A._f==R&&(A._f=b),A._l==R&&(A._l=P),A[T]--;}return!!R;},// 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
|
|
249
|
-
// 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
|
|
250
|
-
forEach:function forEach(A){M(this,l);for(var R=a(A,arguments.length>1?arguments[1]:void 0,3),b;b=b?b.n:this._f;)for(R(b.v,b.k,this);b&&b.r;)b=b.p;},// 23.1.3.7 Map.prototype.has(key)
|
|
251
|
-
// 23.2.3.7 Set.prototype.has(value)
|
|
252
|
-
has:function has(A){return!!m(M(this,l),A);}}),v&&e(g.prototype,"size",{get:function get(){return M(this,l)[T];}}),g;},def:function def(x,l,d){var f=m(x,l),g,O;return f?f.v=d:(x._l=f={i:O=y(l,!0),// <- index
|
|
253
|
-
k:l,// <- key
|
|
254
|
-
v:d,// <- value
|
|
255
|
-
p:g=x._l,// <- previous entry
|
|
256
|
-
n:void 0,// <- next entry
|
|
257
|
-
r:!1// <- removed
|
|
258
|
-
},x._f||(x._f=f),g&&(g.n=f),x[T]++,O!=="F"&&(x._i[O]=f)),x;},getEntry:m,setStrong:function setStrong(x,l,d){c(x,l,function(f,g){this._t=M(f,l),this._k=g,this._l=void 0;},function(){for(var f=this,g=f._k,O=f._l;O&&O.r;)O=O.p;return!f._t||!(f._l=O=O?O.n:f._t._f)?(f._t=void 0,p(1)):g=="keys"?p(0,O.k):g=="values"?p(0,O.v):p(0,[O.k,O.v]);},d?"entries":"values",!d,!0),h(l);}};},/* 146 */ /***/function(u,r,t){var e=t(95);u.exports=function(n,i,a){for(var o in i)a&&n[o]?n[o]=i[o]:e(n,o,i[o]);return n;};},/* 147 */ /***/function(u,r){u.exports=function(t,e,n,i){if(!(t instanceof e)||i!==void 0&&i in t)throw TypeError(n+": incorrect invocation!");return t;};},/* 148 */ /***/function(u,h,t){var e=t(93),n=t(137),i=t(138),a=t(97),o=t(113),s=t(132),c={},p={},h=u.exports=function(v,y,M,T,m){var x=m?function(){return v;}:s(v),l=e(M,T,y?2:1),d=0,f,g,O,A;if(typeof x!="function")throw TypeError(v+" is not iterable!");if(i(x)){for(f=o(v.length);f>d;d++)if(A=y?l(a(g=v[d])[0],g[1]):l(v[d]),A===c||A===p)return A;}else for(O=x.call(v);!(g=O.next()).done;)if(A=n(O,l,g.value,y),A===c||A===p)return A;};h.BREAK=c,h.RETURN=p;},/* 149 */ /***/function(u,r,t){var e=t(91),n=t(92),i=t(96),a=t(100),o=t(122)("species");u.exports=function(s){var c=typeof n[s]=="function"?n[s]:e[s];a&&c&&!c[o]&&i.f(c,o,{configurable:!0,get:function get(){return this;}});};},/* 150 */ /***/function(u,r,t){var e=t(118)("meta"),n=t(98),i=t(105),a=t(96).f,o=0,s=Object.isExtensible||function(){return!0;},c=!t(101)(function(){return s(Object.preventExtensions({}));}),p=function p(T){a(T,e,{value:{i:"O"+ ++o,// object ID
|
|
259
|
-
w:{}// weak collections IDs
|
|
260
|
-
}});},h=function h(T,m){if(!n(T))return _typeof(T)=="symbol"?T:(typeof T=="string"?"S":"P")+T;if(!i(T,e)){if(!s(T))return"F";if(!m)return"E";p(T);}return T[e].i;},v=function v(T,m){if(!i(T,e)){if(!s(T))return!0;if(!m)return!1;p(T);}return T[e].w;},y=function y(T){return c&&M.NEED&&s(T)&&!i(T,e)&&p(T),T;},M=u.exports={KEY:e,NEED:!1,fastKey:h,getWeak:v,onFreeze:y};},/* 151 */ /***/function(u,r,t){var e=t(98);u.exports=function(n,i){if(!e(n)||n._t!==i)throw TypeError("Incompatible receiver, "+i+" required!");return n;};},/* 152 */ /***/function(u,r,t){var e=t(91),n=t(90),i=t(150),a=t(101),o=t(95),s=t(146),c=t(148),p=t(147),h=t(98),v=t(121),y=t(96).f,M=t(153)(0),T=t(100);u.exports=function(m,x,l,d,f,g){var O=e[m],A=O,R=f?"set":"add",b=A&&A.prototype,P={};return!T||typeof A!="function"||!(g||b.forEach&&!a(function(){new A().entries().next();}))?(A=d.getConstructor(x,m,f,R),s(A.prototype,l),i.NEED=!0):(A=x(function(L,D){p(L,A,m,"_c"),L._c=new O(),D!=null&&c(D,f,L[R],L);}),M("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(L){var D=L=="add"||L=="set";L in b&&!(g&&L=="clear")&&o(A.prototype,L,function(I,C){if(p(this,A,L),!D&&g&&!h(I))return L=="get"?void 0:!1;var B=this._c[L](I===0?0:I,C);return D?this:B;});}),g||y(A.prototype,"size",{get:function get(){return this._c.size;}})),v(A,m),P[m]=A,n(n.G+n.W+n.F,P),g||d.setStrong(A,m,f),A;};},/* 153 */ /***/function(u,r,t){var e=t(93),n=t(85),i=t(124),a=t(113),o=t(154);u.exports=function(s,c){var p=s==1,h=s==2,v=s==3,y=s==4,M=s==6,T=s==5||M,m=c||o;return function(x,l,d){for(var f=i(x),g=n(f),O=e(l,d,3),A=a(g.length),R=0,b=p?m(x,A):h?m(x,0):void 0,P,L;A>R;R++)if((T||R in g)&&(P=g[R],L=O(P,R,f),s)){if(p)b[R]=L;else if(L)switch(s){case 3:return!0;case 5:return P;case 6:return R;case 2:b.push(P);}else if(y)return!1;}return M?-1:v||y?y:b;};};},/* 154 */ /***/function(u,r,t){var e=t(155);u.exports=function(n,i){return new(e(n))(i);};},/* 155 */ /***/function(u,r,t){var e=t(98),n=t(156),i=t(122)("species");u.exports=function(a){var o;return n(a)&&(o=a.constructor,typeof o=="function"&&(o===Array||n(o.prototype))&&(o=void 0),e(o)&&(o=o[i],o===null&&(o=void 0))),o===void 0?Array:o;};},/* 156 */ /***/function(u,r,t){var e=t(86);u.exports=Array.isArray||function(i){return e(i)=="Array";};},/* 157 */ /***/function(u,r,t){var e=t(90);e(e.P+e.R,"Map",{toJSON:t(158)("Map")});},/* 158 */ /***/function(u,r,t){var e=t(128),n=t(159);u.exports=function(i){return function(){if(e(this)!=i)throw TypeError(i+"#toJSON isn't generic");return n(this);};};},/* 159 */ /***/function(u,r,t){var e=t(148);u.exports=function(n,i){var a=[];return e(n,!1,a.push,a,i),a;};},/* 160 */ /***/function(u,r,t){t(161)("Map");},/* 161 */ /***/function(u,r,t){var e=t(90);u.exports=function(n){e(e.S,n,{of:function of(){for(var a=arguments.length,o=new Array(a);a--;)o[a]=arguments[a];return new this(o);}});};},/* 162 */ /***/function(u,r,t){t(163)("Map");},/* 163 */ /***/function(u,r,t){var e=t(90),n=t(94),i=t(93),a=t(148);u.exports=function(o){e(e.S,o,{from:function from(c){var p=arguments[1],h,v,y,M;return n(this),h=p!==void 0,h&&n(p),c==null?new this():(v=[],h?(y=0,M=i(p,arguments[2],2),a(c,!1,function(T){v.push(M(T,y++));})):a(c,!1,v.push,v),new this(v));}});};},/* 164 */ /***/function(u,r,t){u.exports={"default":t(165),__esModule:!0};},/* 165 */ /***/function(u,r,t){t(166),u.exports=t(92).Object.assign;},/* 166 */ /***/function(u,r,t){var e=t(90);e(e.S+e.F,"Object",{assign:t(167)});},/* 167 */ /***/function(u,r,t){var e=t(100),n=t(110),i=t(168),a=t(169),o=t(124),s=t(85),c=Object.assign;u.exports=!c||t(101)(function(){var p={},h={},v=Symbol(),y="abcdefghijklmnopqrst";return p[v]=7,y.split("").forEach(function(M){h[M]=M;}),c({},p)[v]!=7||Object.keys(c({},h)).join("")!=y;})?function(h,v){for(var y=o(h),M=arguments.length,T=1,m=i.f,x=a.f;M>T;)for(var l=s(arguments[T++]),d=m?n(l).concat(m(l)):n(l),f=d.length,g=0,O;f>g;)O=d[g++],(!e||x.call(l,O))&&(y[O]=l[O]);return y;}:c;},/* 168 */ /***/function(u,r){r.f=Object.getOwnPropertySymbols;},/* 169 */ /***/function(u,r){r.f={}.propertyIsEnumerable;},/* 170 */ /***/function(u,r,t){r.__esModule=!0,r["default"]=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function");};},/* 171 */ /***/function(u,r,t){r.__esModule=!0;var e=t(172),n=i(e);function i(a){return a&&a.__esModule?a:{"default":a};}r["default"]=/* @__PURE__ */function(){function a(o,s){for(var c=0;c<s.length;c++){var p=s[c];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),(0,n["default"])(o,p.key,p);}}return function(o,s,c){return s&&a(o.prototype,s),c&&a(o,c),o;};}();},/* 172 */ /***/function(u,r,t){u.exports={"default":t(173),__esModule:!0};},/* 173 */ /***/function(u,r,t){t(174);var e=t(92).Object;u.exports=function(i,a,o){return e.defineProperty(i,a,o);};},/* 174 */ /***/function(u,r,t){var e=t(90);e(e.S+e.F*!t(100),"Object",{defineProperty:t(96).f});},/* 175 */ /***/function(u,r,t){u.exports={"default":t(176),__esModule:!0};},/* 176 */ /***/function(u,r,t){t(177),t(143),t(184),t(185),u.exports=t(92).Symbol;},/* 177 */ /***/function(u,r,t){var e=t(91),n=t(105),i=t(100),a=t(90),o=t(106),s=t(150).KEY,c=t(101),p=t(117),h=t(121),v=t(118),y=t(122),M=t(178),T=t(179),m=t(180),x=t(156),l=t(97),d=t(98),f=t(124),g=t(84),O=t(103),A=t(104),R=t(108),b=t(181),P=t(183),L=t(168),D=t(96),I=t(110),C=P.f,B=D.f,G=b.f,_H2=e.Symbol,X=e.JSON,Z=X&&X.stringify,W="prototype",z=y("_hidden"),Q=y("toPrimitive"),et={}.propertyIsEnumerable,_=p("symbol-registry"),st=p("symbols"),q=p("op-symbols"),ht=Object[W],dt=typeof _H2=="function"&&!!L.f,F=e.QObject,U=!F||!F[W]||!F[W].findChild,V=i&&c(function(){return R(B({},"a",{get:function get(){return B(this,"a",{value:7}).a;}})).a!=7;})?function(at,ot,ct){var vt=C(ht,ot);vt&&delete ht[ot],B(at,ot,ct),vt&&at!==ht&&B(ht,ot,vt);}:B,J=function J(at){var ot=st[at]=R(_H2[W]);return ot._k=at,ot;},N=dt&&_typeof(_H2.iterator)=="symbol"?function(at){return _typeof(at)=="symbol";}:function(at){return at instanceof _H2;},$=function $(ot,ct,vt){return ot===ht&&$(q,ct,vt),l(ot),ct=O(ct,!0),l(vt),n(st,ct)?(vt.enumerable?(n(ot,z)&&ot[z][ct]&&(ot[z][ct]=!1),vt=R(vt,{enumerable:A(0,!1)})):(n(ot,z)||B(ot,z,A(1,{})),ot[z][ct]=!0),V(ot,ct,vt)):B(ot,ct,vt);},S=function S(ot,ct){l(ot);for(var vt=m(ct=g(ct)),mt=0,pt=vt.length,St;pt>mt;)$(ot,St=vt[mt++],ct[St]);return ot;},E=function E(ot,ct){return ct===void 0?R(ot):S(R(ot),ct);},w=function w(ot){var ct=et.call(this,ot=O(ot,!0));return this===ht&&n(st,ot)&&!n(q,ot)?!1:ct||!n(this,ot)||!n(st,ot)||n(this,z)&&this[z][ot]?ct:!0;},j=function j(ot,ct){if(ot=g(ot),ct=O(ct,!0),!(ot===ht&&n(st,ct)&&!n(q,ct))){var vt=C(ot,ct);return vt&&n(st,ct)&&!(n(ot,z)&&ot[z][ct])&&(vt.enumerable=!0),vt;}},K=function K(ot){for(var ct=G(g(ot)),vt=[],mt=0,pt;ct.length>mt;)!n(st,pt=ct[mt++])&&pt!=z&&pt!=s&&vt.push(pt);return vt;},Y=function Y(ot){for(var ct=ot===ht,vt=G(ct?q:g(ot)),mt=[],pt=0,St;vt.length>pt;)n(st,St=vt[pt++])&&(!ct||n(ht,St))&&mt.push(st[St]);return mt;};dt||(_H2=function H(){if(this instanceof _H2)throw TypeError("Symbol is not a constructor!");var ot=v(arguments.length>0?arguments[0]:void 0),ct=function ct(vt){this===ht&&ct.call(q,vt),n(this,z)&&n(this[z],ot)&&(this[z][ot]=!1),V(this,ot,A(1,vt));};return i&&U&&V(ht,ot,{configurable:!0,set:ct}),J(ot);},o(_H2[W],"toString",function(){return this._k;}),P.f=j,D.f=$,t(182).f=b.f=K,t(169).f=w,L.f=Y,i&&!t(89)&&o(ht,"propertyIsEnumerable",w,!0),M.f=function(at){return J(y(at));}),a(a.G+a.W+a.F*!dt,{Symbol:_H2});for(var k=// 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
|
|
261
|
-
"hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),nt=0;k.length>nt;)y(k[nt++]);for(var it=I(y.store),lt=0;it.length>lt;)T(it[lt++]);a(a.S+a.F*!dt,"Symbol",{// 19.4.2.1 Symbol.for(key)
|
|
262
|
-
"for":function _for(at){return n(_,at+="")?_[at]:_[at]=_H2(at);},// 19.4.2.5 Symbol.keyFor(sym)
|
|
263
|
-
keyFor:function keyFor(ot){if(!N(ot))throw TypeError(ot+" is not a symbol!");for(var ct in _)if(_[ct]===ot)return ct;},useSetter:function useSetter(){U=!0;},useSimple:function useSimple(){U=!1;}}),a(a.S+a.F*!dt,"Object",{// 19.1.2.2 Object.create(O [, Properties])
|
|
264
|
-
create:E,// 19.1.2.4 Object.defineProperty(O, P, Attributes)
|
|
265
|
-
defineProperty:$,// 19.1.2.3 Object.defineProperties(O, Properties)
|
|
266
|
-
defineProperties:S,// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
|
|
267
|
-
getOwnPropertyDescriptor:j,// 19.1.2.7 Object.getOwnPropertyNames(O)
|
|
268
|
-
getOwnPropertyNames:K,// 19.1.2.8 Object.getOwnPropertySymbols(O)
|
|
269
|
-
getOwnPropertySymbols:Y});var ut=c(function(){L.f(1);});a(a.S+a.F*ut,"Object",{getOwnPropertySymbols:function getOwnPropertySymbols(ot){return L.f(f(ot));}}),X&&a(a.S+a.F*(!dt||c(function(){var at=_H2();return Z([at])!="[null]"||Z({a:at})!="{}"||Z(Object(at))!="{}";})),"JSON",{stringify:function stringify(ot){for(var ct=[ot],vt=1,mt,pt;arguments.length>vt;)ct.push(arguments[vt++]);if(pt=mt=ct[1],!(!d(mt)&&ot===void 0||N(ot)))return x(mt)||(mt=function mt(St,Rt){if(typeof pt=="function"&&(Rt=pt.call(this,St,Rt)),!N(Rt))return Rt;}),ct[1]=mt,Z.apply(X,ct);}}),_H2[W][Q]||t(95)(_H2[W],Q,_H2[W].valueOf),h(_H2,"Symbol"),h(Math,"Math",!0),h(e.JSON,"JSON",!0);},/* 178 */ /***/function(u,r,t){r.f=t(122);},/* 179 */ /***/function(u,r,t){var e=t(91),n=t(92),i=t(89),a=t(178),o=t(96).f;u.exports=function(s){var c=n.Symbol||(n.Symbol=i?{}:e.Symbol||{});s.charAt(0)!="_"&&!(s in c)&&o(c,s,{value:a.f(s)});};},/* 180 */ /***/function(u,r,t){var e=t(110),n=t(168),i=t(169);u.exports=function(a){var o=e(a),s=n.f;if(s)for(var c=s(a),p=i.f,h=0,v;c.length>h;)p.call(a,v=c[h++])&&o.push(v);return o;};},/* 181 */ /***/function(u,r,t){var e=t(84),n=t(182).f,i={}.toString,a=(typeof window==="undefined"?"undefined":_typeof(window))=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],o=function o(s){try{return n(s);}catch(_unused20){return a.slice();}};u.exports.f=function(c){return a&&i.call(c)=="[object Window]"?o(c):n(e(c));};},/* 182 */ /***/function(u,r,t){var e=t(111),n=t(119).concat("length","prototype");r.f=Object.getOwnPropertyNames||function(a){return e(a,n);};},/* 183 */ /***/function(u,r,t){var e=t(169),n=t(104),i=t(84),a=t(103),o=t(105),s=t(99),c=Object.getOwnPropertyDescriptor;r.f=t(100)?c:function(h,v){if(h=i(h),v=a(v,!0),s)try{return c(h,v);}catch(_unused21){}if(o(h,v))return n(!e.f.call(h,v),h[v]);};},/* 184 */ /***/function(u,r,t){t(179)("asyncIterator");},/* 185 */ /***/function(u,r,t){t(179)("observable");},/* 186 */ /***/function(u,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r.createNowTime=e,r.formatDelay=n;function e(){var i=null;return Date.now?i=Date.now:i=function i(){return(/* @__PURE__ */new Date()).getTime();},i;}function n(i){return typeof i=="number"?i={delay:i}:"entropy"in i&&(i={delay:i.entropy,isEntropy:!0}),i;}},/* 187 */ /***/function(u,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r["default"]={// s - startFrame, e - endFrame
|
|
270
|
-
"default":function _default(n,i,a,o,s){return typeof n=="number"&&typeof i=="number"?n+(a-o)/(s-o)*(i-n):a-o>s-a?i:n;}};},/* 188 */ /***/function(u,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r.parseEasing=r.Easings=void 0;var e=t(76),n=c(e),i=t(133),a=c(i),o=t(141),s=c(o);function c(x){return x&&x.__esModule?x:{"default":x};}var p=t(189),h=new s["default"]();function v(){for(var x=arguments.length,l=Array(x),d=0;d<x;d++)l[d]=arguments[d];var f=h.get(l);return f||(f=p.apply(void 0,l),h.set(l,f),f);}function y(x){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"end";return function(d,f){for(var g=1;g<f.length;g++){var O=f[g].offset;if(d<=O){var A=f[g-1].offset,R=O,b=(d-A)/(R-A),P=1/x,L=b/P;return l==="end"?L=Math.floor(L):L=Math.ceil(L),P*L*(R-A)+A;}}return 0;};}function M(x){var l=/^cubic-bezier\((.*)\)/,d=x.match(l);if(d){var f=d[1].trim();return f=f.split(",").map(function(P){return parseFloat(P.trim());}),v.apply(void 0,(0,a["default"])(f));}if(l=/^steps\((.*)\)/,d=x.match(l),d){var g=d[1].trim();g=g.split(",").map(function(P){return P.trim();});var O=g,A=(0,n["default"])(O,2),R=A[0],b=A[1];return y(parseInt(R,10),b);}return x;}var T={linear:function linear(l){return l;},ease:v(0.25,0.1,0.25,1),"ease-in":v(0.42,0,1,1),"ease-out":v(0,0,0.58,1),"ease-in-out":v(0.42,0,0.58,1),// 'step-start': function(p, frames){
|
|
271
|
-
// let ret = 0
|
|
272
|
-
// for(let i = 0; i < frames.length; i++){
|
|
273
|
-
// const {offset} = frames[i]
|
|
274
|
-
// ret = offset
|
|
275
|
-
// if(p < offset){
|
|
276
|
-
// break
|
|
277
|
-
// }
|
|
278
|
-
// }
|
|
279
|
-
// return ret
|
|
280
|
-
// },
|
|
281
|
-
// 'step-end': function(p, frames){
|
|
282
|
-
// let ret = 0
|
|
283
|
-
// for(let i = 0; i < frames.length; i++){
|
|
284
|
-
// const {offset} = frames[i]
|
|
285
|
-
// if(p < offset){
|
|
286
|
-
// break
|
|
287
|
-
// }
|
|
288
|
-
// ret = offset
|
|
289
|
-
// }
|
|
290
|
-
// return ret
|
|
291
|
-
// }
|
|
292
|
-
"step-start":y(1,"start"),"step-end":y(1,"end")};function m(x){return typeof x=="string"?T[x]?x=T[x]:x=M(x):x.type==="cubic-bezier"?x=v.apply(void 0,(0,a["default"])(x.value)):x.type==="steps"&&(x=y(x.step,x.pos)),x;}r.Easings=T,r.parseEasing=m;},/* 189 */ /***/function(u,r){var t=4,e=1e-3,n=1e-7,i=10,a=11,o=1/(a-1),s=typeof Float32Array=="function";function c(x,l){return 1-3*l+3*x;}function p(x,l){return 3*l-6*x;}function h(x){return 3*x;}function v(x,l,d){return((c(l,d)*x+p(l,d))*x+h(l))*x;}function y(x,l,d){return 3*c(l,d)*x*x+2*p(l,d)*x+h(l);}function M(x,l,d,f,g){var O,A,R=0;do A=l+(d-l)/2,O=v(A,f,g)-x,O>0?d=A:l=A;while(Math.abs(O)>n&&++R<i);return A;}function T(x,l,d,f){for(var g=0;g<t;++g){var O=y(l,d,f);if(O===0)return l;var A=v(l,d,f)-x;l-=A/O;}return l;}function m(x){return x;}u.exports=function(l,d,f,g){if(!(0<=l&&l<=1&&0<=f&&f<=1))throw new Error("bezier x values must be in [0, 1] range");if(l===d&&f===g)return m;for(var O=s?new Float32Array(a):new Array(a),A=0;A<a;++A)O[A]=v(A*o,l,f);function R(b){for(var P=0,L=1,D=a-1;L!==D&&O[L]<=b;++L)P+=o;--L;var I=(b-O[L])/(O[L+1]-O[L]),C=P+I*o,B=y(C,l,f);return B>=e?T(b,C,l,f):B===0?C:M(b,P,P+o,l,f);}return function(P){return P===0?0:P===1?1:v(R(P),d,g);};};},/* 190 */ /***/function(u,r,t){Object.defineProperty(r,"__esModule",{value:!0});var e=t(191),n=d(e),i=t(204),a=d(i),o=t(164),s=d(o),c=t(170),p=d(c),h=t(171),v=d(h),y=t(175),M=d(y),T=t(75),m=d(T),x=t(208),l=t(188);function d(B){return B&&B.__esModule?B:{"default":B};}var f=(0,M["default"])("timing"),g=(0,M["default"])("keyframes"),O=(0,M["default"])("initState"),A=(0,M["default"])("readyDefer"),R=(0,M["default"])("finishedDefer"),b=(0,M["default"])("effects"),P=(0,M["default"])("activeReadyTimer"),L=(0,M["default"])("activeFinishTimer"),D=(0,M["default"])("removeDefer"),I={delay:0,endDelay:0,fill:"auto",iterations:1,playbackRate:1,direction:"normal",easing:"linear",effect:null},C=function(){function B(G,H,X){var Z=this;if((0,p["default"])(this,B),Array.isArray(G)){var W=[G[0],G,H];G=W[0],H=W[1],X=W[2];}typeof X=="number"&&(X={duration:X}),this[f]=(0,s["default"])({},I,X),this[f].easing=(0,l.parseEasing)(this[f].easing),this[g]=(0,x.calculateFramesOffset)(H);var z=this[g][this[g].length-1];this[O]={},(0,a["default"])(z).forEach(function(Q){Object.prototype.hasOwnProperty.call(G,Q)&&Q!=="easing"&&Q!=="offset"&&(Z[O][Q]=G[Q]);}),this[g]=this[g].map(function(Q){return(0,s["default"])({},Z[O],Q);}),this[g][0].offset!==0&&this[g].unshift((0,s["default"])({},this[O],{offset:0})),z.offset<1&&this[g].push((0,s["default"])({},z,{offset:1})),this[b]={},this.timeline=null;}return(0,v["default"])(B,[{key:"pause",value:function value(){this.timeline.playbackRate=0;}},{key:P,value:function value(){var H=this;this[A]&&!this[A].timerID&&(this.timeline.currentTime<0?this[A].timerID=this.timeline.setTimeout(function(){H[A].resolve(),delete H[A];},{delay:-this.timeline.currentTime,heading:!1}):this[A].timerID=this.timeline.setTimeout(function(){H[A].resolve(),delete H[A];},{delay:0,isEntropy:!0}));}},{key:L,value:function value(){var H=this,X=this[f],Z=X.duration,W=X.iterations,z=X.endDelay,Q=Math.ceil(Z*W+z-this.timeline.currentTime)+1;this[R]&&!this[R].timerID&&(this[R].timerID=this.timeline.setTimeout(function(){H[R].resolve(),H[D](A),H[D](R);},{delay:Q,heading:!1}),this[R].reverseTimerID=this.timeline.setTimeout(function(){H[R].resolve(),H[D](A),H[D](R),H.timeline=null;},{delay:-this[f].delay-1,heading:!1}));}},{key:"play",value:function value(){if(this.playState==="finished"&&this.cancel(),this.playState==="idle"){if(this.playbackRate<=0)return;var H=this[f],X=H.delay,Z=H.playbackRate,W=H.timeline;this.timeline=new m["default"]({originTime:X,playbackRate:Z},W),this[P](),this[L]();}else this.playState==="paused"&&(this.timeline.playbackRate=this.playbackRate,this[P]());}},{key:D,value:function value(H){var X=this[H],Z=this.timeline;X&&Z&&(Z.clearTimeout(X.timerID),X.reverseTimerID&&Z.clearTimeout(X.reverseTimerID)),delete this[H];}},{key:"cancel",value:function value(){this[D](A),this[D](R),this.timeline=null;}},{key:"finish",value:function value(){this.timeline&&(this.timeline.currentTime=1/0/this.playbackRate),this[D](A),this[D](R);}},{key:"applyEffects",value:function value(H){return(0,s["default"])(this[b],H);}},{key:"playbackRate",get:function get(){return this[f].playbackRate;},set:function set(H){this.timeline&&(this.timeline.playbackRate=H),this[f].playbackRate=H;}},{key:"playState",get:function get(){var H=this.timeline,X=this[f],Z=X.iterations,W=X.duration,z=X.endDelay,Q="running";if(H==null)Q="idle";else if(H.paused)Q="paused";else if(H.currentTime<0)Q="pending";else{var et=H.currentTime-Z*W;et>0&&et<z?Q="pending":et>=z&&(Q="finished");}return Q;}},{key:"progress",get:function get(){if(!this.timeline)return 0;var H=this[f],X=H.duration,Z=H.iterations,W=this.timeline,z=this.playState,Q=void 0;if(z==="idle")Q=0;else if(z==="paused"&&W.currentTime<0)Q=0;else if(z==="pending"){if(W.currentTime<0)Q=0;else{var et=W.seekLocalTime(Z*X);Q=(0,x.periodicity)(et,X)[1]/X;}}else(z==="running"||z==="paused")&&(Q=(0,x.periodicity)(W.currentTime,X)[1]/X);return z==="finished"&&(Q=(0,x.periodicity)(Z,1)[1]),Q;}},{key:"frame",get:function get(){var H=this.playState,X=this[O],Z=this[f].fill;if(H==="idle")return X;var W=this.timeline.currentTime,z=this[g].slice(0),Q=(0,x.getProgress)(this.timeline,this[f],this.progress),et=Q.p,_=Q.inverted,st=X;return W<0&&H==="pending"?(Z==="backwards"||Z==="both")&&(st=_?z[z.length-1]:z[0]):(H!=="pending"&&H!=="finished"||Z==="forwards"||Z==="both")&&(st=(0,x.getCurrentFrame)(this[f],z,this[b],et)),st;}},{key:"timing",get:function get(){return this[f];}},{key:"effects",get:function get(){return this[b];}},{key:"baseTimeline",set:function set(H){this[f].timeline=H;},get:function get(){return this[f].timeline;}},{key:"ready",get:function get(){return this[A]?this[A].promise:this.timeline&&this.timeline.currentTime>=0&&this.playState!=="paused"?n["default"].resolve():(this[A]=(0,x.defer)(),this.timeline&&this[P](),this[A]?this[A].promise:n["default"].resolve());}},{key:"finished",get:function get(){return this.playState==="finished"?n["default"].resolve():(this[R]||(this[R]=(0,x.defer)(),this.timeline&&this[L]()),this[R].promise);}}]),B;}();r["default"]=C;},/* 191 */ /***/function(u,r,t){u.exports={"default":t(192),__esModule:!0};},/* 192 */ /***/function(u,r,t){t(143),t(125),t(79),t(193),t(202),t(203),u.exports=t(92).Promise;},/* 193 */ /***/function(u,r,t){var e=t(89),n=t(91),i=t(93),a=t(128),o=t(90),s=t(98),c=t(94),p=t(147),h=t(148),v=t(194),y=t(195).set,M=t(197)(),T=t(198),m=t(199),x=t(200),l=t(201),d="Promise",f=n.TypeError,g=n.process,O=g&&g.versions,A=O&&O.v8||"",_R=n[d],b=a(g)=="process",P=function P(){},L,D,I,C,B=D=T.f,G=!!function(){try{var _=_R.resolve(1),st=(_.constructor={})[t(122)("species")]=function(q){q(P,P);};return(b||typeof PromiseRejectionEvent=="function")&&_.then(P)instanceof st&&A.indexOf("6.6")!==0&&x.indexOf("Chrome/66")===-1;}catch(_unused22){}}(),H=function H(_){var st;return s(_)&&typeof(st=_.then)=="function"?st:!1;},X=function X(_,st){if(!_._n){_._n=!0;var q=_._c;M(function(){for(var ht=_._v,dt=_._s==1,F=0,U=function U(V){var J=dt?V.ok:V.fail,N=V.resolve,$=V.reject,S=V.domain,E,w,j;try{J?(dt||(_._h==2&&z(_),_._h=1),J===!0?E=ht:(S&&S.enter(),E=J(ht),S&&(S.exit(),j=!0)),E===V.promise?$(f("Promise-chain cycle")):(w=H(E))?w.call(E,N,$):N(E)):$(ht);}catch(K){S&&!j&&S.exit(),$(K);}};q.length>F;)U(q[F++]);_._c=[],_._n=!1,st&&!_._h&&Z(_);});}},Z=function Z(_){y.call(n,function(){var st=_._v,q=W(_),ht,dt,F;if(q&&(ht=m(function(){b?g.emit("unhandledRejection",st,_):(dt=n.onunhandledrejection)?dt({promise:_,reason:st}):(F=n.console)&&F.error&&F.error("Unhandled promise rejection",st);}),_._h=b||W(_)?2:1),_._a=void 0,q&&ht.e)throw ht.v;});},W=function W(_){return _._h!==1&&(_._a||_._c).length===0;},z=function z(_){y.call(n,function(){var st;b?g.emit("rejectionHandled",_):(st=n.onrejectionhandled)&&st({promise:_,reason:_._v});});},Q=function Q(_){var st=this;st._d||(st._d=!0,st=st._w||st,st._v=_,st._s=2,st._a||(st._a=st._c.slice()),X(st,!0));},et=function et(_){var st=this,q;if(!st._d){st._d=!0,st=st._w||st;try{if(st===_)throw f("Promise can't be resolved itself");(q=H(_))?M(function(){var ht={_w:st,_d:!1};try{q.call(_,i(et,ht,1),i(Q,ht,1));}catch(dt){Q.call(ht,dt);}}):(st._v=_,st._s=1,X(st,!1));}catch(ht){Q.call({_w:st,_d:!1},ht);}}};G||(_R=function R(st){p(this,_R,d,"_h"),c(st),L.call(this);try{st(i(et,this,1),i(Q,this,1));}catch(q){Q.call(this,q);}},L=function L(st){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1;},L.prototype=t(146)(_R.prototype,{// 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
|
|
293
|
-
then:function then(st,q){var ht=B(v(this,_R));return ht.ok=typeof st=="function"?st:!0,ht.fail=typeof q=="function"&&q,ht.domain=b?g.domain:void 0,this._c.push(ht),this._a&&this._a.push(ht),this._s&&X(this,!1),ht.promise;},// 25.4.5.1 Promise.prototype.catch(onRejected)
|
|
294
|
-
"catch":function _catch(_){return this.then(void 0,_);}}),I=function I(){var _=new L();this.promise=_,this.resolve=i(et,_,1),this.reject=i(Q,_,1);},T.f=B=function B(_){return _===_R||_===C?new I(_):D(_);}),o(o.G+o.W+o.F*!G,{Promise:_R}),t(121)(_R,d),t(149)(d),C=t(92)[d],o(o.S+o.F*!G,d,{// 25.4.4.5 Promise.reject(r)
|
|
295
|
-
reject:function reject(st){var q=B(this),ht=q.reject;return ht(st),q.promise;}}),o(o.S+o.F*(e||!G),d,{// 25.4.4.6 Promise.resolve(x)
|
|
296
|
-
resolve:function resolve(st){return l(e&&this===C?_R:this,st);}}),o(o.S+o.F*!(G&&t(140)(function(_){_R.all(_)["catch"](P);})),d,{// 25.4.4.1 Promise.all(iterable)
|
|
297
|
-
all:function all(st){var q=this,ht=B(q),dt=ht.resolve,F=ht.reject,U=m(function(){var V=[],J=0,N=1;h(st,!1,function($){var S=J++,E=!1;V.push(void 0),N++,q.resolve($).then(function(w){E||(E=!0,V[S]=w,--N||dt(V));},F);}),--N||dt(V);});return U.e&&F(U.v),ht.promise;},// 25.4.4.4 Promise.race(iterable)
|
|
298
|
-
race:function race(st){var q=this,ht=B(q),dt=ht.reject,F=m(function(){h(st,!1,function(U){q.resolve(U).then(ht.resolve,dt);});});return F.e&&dt(F.v),ht.promise;}});},/* 194 */ /***/function(u,r,t){var e=t(97),n=t(94),i=t(122)("species");u.exports=function(a,o){var s=e(a).constructor,c;return s===void 0||(c=e(s)[i])==null?o:n(c);};},/* 195 */ /***/function(u,r,t){var e=t(93),n=t(196),i=t(120),a=t(102),o=t(91),s=o.process,c=o.setImmediate,p=o.clearImmediate,h=o.MessageChannel,v=o.Dispatch,y=0,M={},T="onreadystatechange",m,x,l,d=function d(){var g=+this;if(M.hasOwnProperty(g)){var O=M[g];delete M[g],O();}},f=function f(g){d.call(g.data);};(!c||!p)&&(c=function c(O){for(var A=[],R=1;arguments.length>R;)A.push(arguments[R++]);return M[++y]=function(){n(typeof O=="function"?O:Function(O),A);},m(y),y;},p=function p(O){delete M[O];},t(86)(s)=="process"?m=function m(g){s.nextTick(e(d,g,1));}:v&&v.now?m=function m(g){v.now(e(d,g,1));}:h?(x=new h(),l=x.port2,x.port1.onmessage=f,m=e(l.postMessage,l,1)):o.addEventListener&&typeof postMessage=="function"&&!o.importScripts?(m=function m(g){o.postMessage(g+"","*");},o.addEventListener("message",f,!1)):T in a("script")?m=function m(g){i.appendChild(a("script"))[T]=function(){i.removeChild(this),d.call(g);};}:m=function m(g){setTimeout(e(d,g,1),0);}),u.exports={set:c,clear:p};},/* 196 */ /***/function(u,r){u.exports=function(t,e,n){var i=n===void 0;switch(e.length){case 0:return i?t():t.call(n);case 1:return i?t(e[0]):t.call(n,e[0]);case 2:return i?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return i?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return i?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3]);}return t.apply(n,e);};},/* 197 */ /***/function(u,r,t){var e=t(91),n=t(195).set,i=e.MutationObserver||e.WebKitMutationObserver,a=e.process,o=e.Promise,s=t(86)(a)=="process";u.exports=function(){var c,p,h,v=function v(){var m,x;for(s&&(m=a.domain)&&m.exit();c;){x=c.fn,c=c.next;try{x();}catch(l){throw c?h():p=void 0,l;}}p=void 0,m&&m.enter();};if(s)h=function h(){a.nextTick(v);};else if(i&&!(e.navigator&&e.navigator.standalone)){var y=!0,M=document.createTextNode("");new i(v).observe(M,{characterData:!0}),h=function h(){M.data=y=!y;};}else if(o&&o.resolve){var T=o.resolve(void 0);h=function h(){T.then(v);};}else h=function h(){n.call(e,v);};return function(m){var x={fn:m,next:void 0};p&&(p.next=x),c||(c=x,h()),p=x;};};},/* 198 */ /***/function(u,r,t){var e=t(94);function n(i){var a,o;this.promise=new i(function(s,c){if(a!==void 0||o!==void 0)throw TypeError("Bad Promise constructor");a=s,o=c;}),this.resolve=e(a),this.reject=e(o);}u.exports.f=function(i){return new n(i);};},/* 199 */ /***/function(u,r){u.exports=function(t){try{return{e:!1,v:t()};}catch(e){return{e:!0,v:e};}};},/* 200 */ /***/function(u,r,t){var e=t(91),n=e.navigator;u.exports=n&&n.userAgent||"";},/* 201 */ /***/function(u,r,t){var e=t(97),n=t(98),i=t(198);u.exports=function(a,o){if(e(a),n(o)&&o.constructor===a)return o;var s=i.f(a),c=s.resolve;return c(o),s.promise;};},/* 202 */ /***/function(u,r,t){var e=t(90),n=t(92),i=t(91),a=t(194),o=t(201);e(e.P+e.R,"Promise",{"finally":function _finally(s){var c=a(this,n.Promise||i.Promise),p=typeof s=="function";return this.then(p?function(h){return o(c,s()).then(function(){return h;});}:s,p?function(h){return o(c,s()).then(function(){throw h;});}:s);}});},/* 203 */ /***/function(u,r,t){var e=t(90),n=t(198),i=t(199);e(e.S,"Promise",{"try":function _try(a){var o=n.f(this),s=i(a);return(s.e?o.reject:o.resolve)(s.v),o.promise;}});},/* 204 */ /***/function(u,r,t){u.exports={"default":t(205),__esModule:!0};},/* 205 */ /***/function(u,r,t){t(206),u.exports=t(92).Object.keys;},/* 206 */ /***/function(u,r,t){var e=t(124),n=t(110);t(207)("keys",function(){return function(a){return n(e(a));};});},/* 207 */ /***/function(u,r,t){var e=t(90),n=t(92),i=t(101);u.exports=function(a,o){var s=(n.Object||{})[a]||Object[a],c={};c[a]=o(s),e(e.S+e.F*i(function(){s(1);}),"Object",c);};},/* 208 */ /***/function(u,r,t){Object.defineProperty(r,"__esModule",{value:!0});var e=t(76),n=M(e),i=t(209),a=M(i),o=t(164),s=M(o),c=t(191),p=M(c);r.defer=T,r.periodicity=m,r.calculateFramesOffset=x,r.getProgress=l,r.getCurrentFrame=f;var h=t(188),v=t(187),y=M(v);function M(g){return g&&g.__esModule?g:{"default":g};}function T(){var g={};return g.promise=new p["default"](function(O,A){g.resolve=O,g.reject=A;}),g;}function m(g,O){var A=Math.floor(g/O),R=g-A*O;return R===0&&A>0&&(R=O,A--),[A,R];}function x(g){g=g.slice(0);var O=g[0],A=g[g.length-1];A.offset=A.offset||1,O.offset=O.offset||0;for(var R=0,b=-1,P=0;P<g.length;P++){var L=g[P];if(L.offset!=null){var D=P-b;if(D>1)for(var I=(L.offset-R)/D,C=0;C<D-1;C++)g[b+C+1].offset=R+I*(C+1);R=L.offset,b=P;}if(L.easing!=null&&(L.easing=(0,h.parseEasing)(L.easing)),P>0){var B=g[P].easing!=null;g[P]=(0,s["default"])({},g[P-1],g[P]),B||delete g[P].easing;}}return g;}function l(g,O,A){var R=g.currentTime,b=O.direction,P=O.duration,L=!1;if(b==="reverse")A=1-A,L=!0;else if(b==="alternate"||b==="alternate-reverse"){var D=Math.floor(R/P);A===1&&D--,D%2^b==="alternate-reverse"&&(A=1-A,L=!0);}return{p:A,inverted:L};}function d(g,O,A,R){var b={};return(0,a["default"])(O).forEach(function(P){var L=(0,n["default"])(P,2),D=L[0],I=L[1];if(D!=="offset"&&D!=="easing"){var C=A[D]||A["default"],B=C(g[D],I,R,g.offset,O.offset);B!=null&&(b[D]=B);}}),b;}function f(g,O,A,R){var b=g.easing,P=g.effect;P||(A=(0,s["default"])({},y["default"],A));var L={};R=b(R,O);for(var D=1;D<O.length;D++){var I=O[D],C=I.offset;if(C>=R||D===O.length-1){var B=O[D-1],G=B.offset,H=B.easing,X=R;if(H){var Z=C-G;X=H((R-G)/Z)*Z+G;}P?L=P(B,I,X,G,C):L=d(B,I,A,X);break;}}return L;}},/* 209 */ /***/function(u,r,t){u.exports={"default":t(210),__esModule:!0};},/* 210 */ /***/function(u,r,t){t(211),u.exports=t(92).Object.entries;},/* 211 */ /***/function(u,r,t){var e=t(90),n=t(212)(!0);e(e.S,"Object",{entries:function entries(a){return n(a);}});},/* 212 */ /***/function(u,r,t){var e=t(100),n=t(110),i=t(84),a=t(169).f;u.exports=function(o){return function(s){for(var c=i(s),p=n(c),h=p.length,v=0,y=[],M;h>v;)M=p[v++],(!e||a.call(c,M))&&y.push(o?[M,c[M]]:c[M]);return y;};};},/* 213 */ /***/function(u,r,t){t.r(r),t(1).glMatrix.setMatrixArrayType(Array);var e=/* @__PURE__ */new Map();function n(a){var o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var s=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];a=a.toLowerCase();var c=e.get(a);if(!c)throw new TypeError("Invalid node: ".concat(a));var p=new c(o);return s.forEach(function(h){p.appendChild(h);}),p;}var i={registerNode:function registerNode(a,o){var s=arguments.length>2&&arguments[2]!==undefined?arguments[2]:100;if(o=o.toLowerCase(),e.has(o))throw new TypeError("Cannot registerNode, ".concat(o," has been taken."));e.set(o,a),Object.defineProperties(a.prototype,{nodeType:{value:s},tagName:{value:o.toUpperCase()},nodeName:{value:o},ownerDocument:{value:i},namespaceURI:{value:"http://spritejs.com/".concat(o)}});},createElement:n,createElementNS:function createElementNS(a,o){return n(o);},isSpriteNode:function isSpriteNode(a){return e.has(a.toLowerCase());}};r["default"]=i;},/* 214 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return o;}),t(1).glMatrix.setMatrixArrayType(Array);var e=Symbol("type"),n=Symbol("bubbles"),i=Symbol("originalEvent"),a=Symbol("detail");var o=/*#__PURE__*/function(){function o(c){var _ref115=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref115$bubbles=_ref115.bubbles,p=_ref115$bubbles===void 0?null:_ref115$bubbles;_classCallCheck(this,o);if(typeof c=="string"?(this[e]=c,this[n]=!!p):(this[e]=c.type,this[i]=c,this[n]=p!=null?!!p:!!c.bubbles,c.detail&&(this[a]=c.detail)),!this[e])throw new TypeError("Invalid event type.");this.cancelBubble=!1;}return _createClass(o,[{key:"setOriginalEvent",value:function setOriginalEvent(c){this[i]=c;}},{key:"originalEvent",get:function get(){return this[i];}},{key:"type",get:function get(){return this[e];}},{key:"bubbles",get:function get(){return this[n];}},{key:"detail",get:function get(){return this[a];}},{key:"stopPropagation",value:function stopPropagation(){this.cancelBubble=!0;}}]);}();},/* 215 */ /***/function(u,r,t){t.r(r),t.d(r,"parseFilterString",function(){return n;}),t.d(r,"applyFilters",function(){return i;});var e=t(72);t(1).glMatrix.setMatrixArrayType(Array);function n(a){if(a=a.trim(),!a||a==="none")return null;var o=/^(?:(url|blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\(([^()]*(?:\(.*\))*[^()]*)\))+$/i,s=a.match(/(?:(url|blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\(([^()]*(?:\(.*\))*[^()]*)\))+?/ig),c=[];return s&&s.forEach(function(p){var h=p.match(o);if(!h)throw new TypeError("Invalid fitler string.");var _h3=_slicedToArray(h,3),v=_h3[1],y=_h3[2];v=v.toLowerCase(),y=y.trim().match(/([^( )]+|([^( )]+\(.*\)))(?=\s|$)/g).map(function(M,T){var m;return v==="url"||v==="drop-shadow"&&T===3?m=M:m=Object(e.toNumber)(M),/%$/.test(M)&&(m/=100),m;}),c.push({type:v,args:y});}),c;}function i(a,o){a.clearFilter(),o&&o.forEach(function(_ref116){var s=_ref116.type,c=_ref116.args;var p=s;p==="drop-shadow"?p="dropShadow":p==="hue-rotate"&&(p="hueRotate"),a[p].apply(a,_toConsumableArray(c));});}},/* 216 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return e;}),t(1).glMatrix.setMatrixArrayType(Array);function e(n,i){if(!i)return;var a=n.getListeners("beforerender"),o=n.getListeners("afterrender");a.length&&!i.beforeRender?i.beforeRender=function(s){n.dispatchEvent({type:"beforerender",detail:{context:s}});}:a.length||(i.beforeRender=null),o.length&&!i.afterRender?i.afterRender=function(s){n.dispatchEvent({type:"afterrender",detail:{context:s}});}:o.length||(i.afterRender=null);}},/* 217 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return c;});var e=t(12),n=t(218),i=t(70),a=t(213);t(1).glMatrix.setMatrixArrayType(Array);var o=Symbol("amount"),s=Symbol("meshCloud");var c=/*#__PURE__*/function(_i$default){function c(h){var _this28;var v=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;_classCallCheck(this,c);_this28=_callSuper(this,c),_this28.meshNode=h,h.connect(_assertThisInitialized(_this28)),_this28[o]=v,_this28[s]=null;return _this28;}_inherits(c,_i$default);return _createClass(c,[{key:"meshCloud",get:function get(){var h=this.meshNode,v=this[o];return!this[s]&&h.mesh&&(this[s]=new e.MeshCloud(h.mesh,v)),this[s];}/* override */},{key:"isVisible",get:function get(){return!!this.meshNode&&this.meshNode.isVisible;}},{key:"amount",get:function get(){return this[o];},set:function set(h){this[o]=h,this[s]&&(this[s].amount=h);}},{key:"brightness",value:function brightness(h,v){this.meshCloud&&(this.meshCloud.brightness(h,v),this.forceUpdate());}},{key:"contrast",value:function contrast(h,v){this.meshCloud&&(this.meshCloud.contrast(h,v),this.forceUpdate());}},{key:"delete",value:function _delete(h){this.meshCloud&&(this.meshCloud["delete"](h),this[o]--,this.forceUpdate());}/* override */},{key:"draw",value:function draw(){var _this29=this;var h=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];if(_get(_getPrototypeOf(c.prototype),"draw",this).call(this,h),this.meshCloud){if(this.program){this.meshCloud.setProgram(this.program);var v=this.shaderAttrs;v&&Object.entries(v).forEach(function(_ref117){var _ref118=_slicedToArray(_ref117,2),M=_ref118[0],T=_ref118[1];_this29.meshCloud.mesh.setAttribute(M,T);});var y=this.uniforms;if(this.uniforms){var M={};Object.entries(y).forEach(function(_ref119){var _ref120=_slicedToArray(_ref119,2),T=_ref120[0],m=_ref120[1];typeof m=="function"&&(m=m(_this29,T)),M[T]=m;}),this.meshCloud.mesh.setUniforms(M);}}this.meshNode.textureImage&&Object(n.drawTexture)(this.meshNode,this.meshNode.mesh),h.push(this.meshCloud);}return h;}},{key:"getTransform",value:function getTransform(h){if(this.meshCloud)return this.meshCloud.getTransform(h);}},{key:"grayscale",value:function grayscale(h,v){this.meshCloud&&(this.meshCloud.grayscale(h,v),this.forceUpdate());}},{key:"hueRotate",value:function hueRotate(h,v){this.meshCloud&&(this.meshCloud.hueRotate(h,v),this.forceUpdate());}},{key:"invert",value:function invert(h,v){this.meshCloud&&(this.meshCloud.invert(h,v),this.forceUpdate());}/* override */},{key:"isPointCollision",value:function isPointCollision(h,v){if(!this.meshCloud)return!1;var y=this.attributes.pointerEvents;if(y==="none"||y!=="all"&&!this.isVisible)return!1;var M="both";y==="visibleFill"&&(M="fill"),y==="visibleStroke"&&(M="stroke");for(var T=0;T<this[o];T++)if(!this.meshCloud.isPointCollision(T,[h,v],M))return!1;return!0;}},{key:"setOpacity",value:function setOpacity(h,v){this.meshCloud&&(this.meshCloud.opacity(h,v),this.forceUpdate());}},{key:"rotate",value:function rotate(h,v){var _ref121=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref122=_slicedToArray(_ref121,2),y=_ref122[0],M=_ref122[1];var T=Math.PI*v/180;if(this.meshCloud){var _this$meshNode$attrib=this.meshNode.attributes,m=_this$meshNode$attrib.x,_x29=_this$meshNode$attrib.y;this.meshCloud.rotate(h,T,[y+m,M+_x29]),this.forceUpdate();}}},{key:"saturate",value:function saturate(h,v){this.meshCloud&&(this.meshCloud.saturate(h,v),this.forceUpdate());}},{key:"scale",value:function scale(h,_ref123){var _ref124=_slicedToArray(_ref123,2),v=_ref124[0],_ref124$=_ref124[1],y=_ref124$===void 0?v:_ref124$;var _ref125=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref126=_slicedToArray(_ref125,2),M=_ref126[0],T=_ref126[1];if(this.meshCloud){var _this$meshNode$attrib2=this.meshNode.attributes,m=_this$meshNode$attrib2.x,_x30=_this$meshNode$attrib2.y,_l12=1e-5;Math.abs(v)<_l12&&(v=1/v>0?_l12:-_l12),Math.abs(y)<_l12&&(y=1/y>0?_l12:-_l12),this.meshCloud.scale(h,[v,y],[M+m,T+_x30]),this.forceUpdate();}}},{key:"setColorTransform",value:function setColorTransform(h,v){this.meshCloud&&(this.meshCloud.setColorTransform(h,v),this.forceUpdate());}},{key:"setFillColor",value:function setFillColor(h,v){this.meshCloud&&(Array.isArray(v)&&(v=_toConsumableArray(v),v[0]/=255,v[1]/=255,v[2]/=255),this.meshCloud.setFillColor(h,v),this.forceUpdate());}},{key:"sepia",value:function sepia(h,v){this.meshCloud&&(this.meshCloud.sepia(h,v),this.forceUpdate());}/* override */},{key:"setResolution",value:function setResolution(_ref127){var h=_ref127.width,v=_ref127.height;_get(_getPrototypeOf(c.prototype),"setResolution",this).call(this,{width:h,height:v}),this.meshNode.setResolution({width:h,height:v});}},{key:"setStrokeColor",value:function setStrokeColor(h,v){this.meshCloud&&(Array.isArray(v)&&(v=_toConsumableArray(v),v[0]/=255,v[1]/=255,v[2]/=255),this.meshCloud.setStrokeColor(h,v),this.forceUpdate());}},{key:"setTransform",value:function setTransform(h,v){this.meshCloud&&(this.meshCloud.setTransform(h,v),this.forceUpdate());}},{key:"skew",value:function skew(h,_ref128){var _ref129=_slicedToArray(_ref128,2),v=_ref129[0],_ref129$=_ref129[1],y=_ref129$===void 0?v:_ref129$;var _ref130=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref131=_slicedToArray(_ref130,2),M=_ref131[0],T=_ref131[1];if(this.meshCloud){var _this$meshNode$attrib3=this.meshNode.attributes,m=_this$meshNode$attrib3.x,_x31=_this$meshNode$attrib3.y;this.meshCloud.skew(h,[v,y],[M+m,T+_x31]),this.forceUpdate();}}},{key:"transform",value:function transform(h,v){this.meshCloud&&(this.meshCloud.transform(h,v),this.forceUpdate());}},{key:"transformColor",value:function transformColor(h,v){this.meshCloud&&(this.meshCloud.transformColor(h,v),this.forceUpdate());}},{key:"translate",value:function translate(h,_ref132){var _ref133=_slicedToArray(_ref132,2),v=_ref133[0],y=_ref133[1];this.meshCloud&&(this.meshCloud.translate(h,[v,y]),this.forceUpdate());}},{key:"updateMesh",value:function updateMesh(){this[s]&&(this[s].mesh=this.meshNode.mesh,this.forceUpdate());}}]);}(i["default"]);a["default"].registerNode(c,"cloud");},/* 218 */ /***/function(u,r,t){t.r(r),t.d(r,"loadTexture",function(){return a;}),t.d(r,"applyTexture",function(){return o;}),t.d(r,"createTexture",function(){return c;}),t.d(r,"deleteTexture",function(){return p;}),t.d(r,"drawTexture",function(){return v;}),t.d(r,"loadFrames",function(){return y;});var e=t(12),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i={};function a(M,T){if(i[M])return i[M];var m=e.ENV.loadImage(M,{alias:T,useImageBitmap:!1});return m!==null&&m!==void 0?m:M;}function o(_x32,_x33,_x34){return _o2.apply(this,arguments);}function _o2(){_o2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee18(M,T,m){var x,_M$attributes,_l13,d,f,g;return _regeneratorRuntime().wrap(function _callee18$(_context18){while(1)switch(_context18.prev=_context18.next){case 0:x=T;typeof T=="string"&&(x=a(T));_context18.t0=x&&typeof x.then=="function";if(!_context18.t0){_context18.next=7;break;}_context18.next=6;return x;case 6:x=_context18.sent;case 7:if(!(T===M.attributes.texture)){_context18.next=11;break;}x&&x.image&&(x.sourceRect&&(M.attributes.sourceRect=x.sourceRect),M.textureImageRotated=!!x.rotated,x=x.image);_M$attributes=M.attributes,_l13=_M$attributes.width,d=_M$attributes.height,f=_M$attributes.textureRect,g=M.textureImage;M.textureImage=x,m&&g!==x&&!f&&(_l13==null||d==null)&&M.updateContours(),M.forceUpdate();case 11:return _context18.abrupt("return",x);case 12:case"end":return _context18.stop();}},_callee18);}));return _o2.apply(this,arguments);}var s=Symbol("textureMap");function c(M,T){if(T[s]=T[s]||/* @__PURE__ */new Map(),T[s].has(M))return T[s].get(M);var m=T.createTexture(M);return!/^blob:/.test(M.src)&&typeof M.getContext!="function"&&T[s].set(M,m),m;}function p(M,T){if(T[s]&&T[s].has(M)){var m=T[s].get(M);return T.deleteTexture(m),T[s]["delete"](M),!0;}return!1;}var h=Symbol("textureContext");function v(M,T){var m=M.textureImage instanceof String?String(M.textureImage):M.textureImage,x=M.textureImageRotated,l=T.texture,d=M.renderer;if(m){var f=M.originalContentRect;var g=M.attributes.textureRect;var O=M.attributes.textureRepeat,A=M.attributes.sourceRect;if(!l||M[h]&&M[h]!==d||l.image!==m||l.options.repeat!==O||!Object(n.compareValue)(l.options.rect,g)||!Object(n.compareValue)(l.options.srcRect,A)){var R=c(m,d);g?(g[0]+=f[0],g[1]+=f[1]):g=f;var b=null;l&&!d[s].has(l.image)&&(!l.options||!l.options.hidden)&&(b=T.uniforms.u_texSampler),T.setTexture(R,{rect:g,repeat:O,srcRect:A,rotated:x}),b&&b["delete"]&&b["delete"](),M[h]=d;}}else if(l){var _f9=null;!d[s].has(l.image)&&(!l.options||!l.options.hidden)&&(_f9=T.uniforms.u_texSampler),T.setTexture(null),_f9&&_f9["delete"]&&_f9["delete"]();}}function y(_x35,_x36){return _y5.apply(this,arguments);}function _y5(){_y5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee19(M,T){var m,x;return _regeneratorRuntime().wrap(function _callee19$(_context19){while(1)switch(_context19.prev=_context19.next){case 0:_context19.t0=typeof T=="string";if(!_context19.t0){_context19.next=7;break;}_context19.next=4;return fetch(T,{method:"GET",mode:"cors",cache:"default"});case 4:_context19.next=6;return _context19.sent.json();case 6:T=_context19.sent;case 7:_context19.next=9;return a(M);case 9:m=_context19.sent;x=T.frames;return _context19.abrupt("return",(Object.entries(x).forEach(function(_ref134){var _ref135=_slicedToArray(_ref134,2),l=_ref135[0],d=_ref135[1];var _d$frame=d.frame,f=_d$frame.x,g=_d$frame.y,O=_d$frame.w,A=_d$frame.h;var R=[f,g,O,A];var b=d.rotated;b&&(R=[R[0],R[1],R[3],R[2]]),i[l]={image:m,sourceRect:R,rotated:b};}),m));case 12:case"end":return _context19.stop();}},_callee19);}));return _y5.apply(this,arguments);}},/* 219 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return y;});var e=t(1),n=t(12),i=t(70),a=t(220),o=t(221),s=t(222),c=t(213),p=t(223);t(1).glMatrix.setMatrixArrayType(Array);function h(M,T,m){return T in M?Object.defineProperty(M,T,{value:m,enumerable:!0,configurable:!0,writable:!0}):M[T]=m,M;}var v=Symbol("mesh");var y=/*#__PURE__*/function(_i$default2){function y(){var T=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,y);return _callSuper(this,y,[T]);}_inherits(y,_i$default2);return _createClass(y,[{key:"borderSize",get:function get(){var _this$attributes2=this.attributes,T=_this$attributes2.paddingTop,m=_this$attributes2.paddingRight,x=_this$attributes2.paddingBottom,l=_this$attributes2.paddingLeft,d=_this$attributes2.borderWidth,_this$contentSize=_slicedToArray(this.contentSize,2),f=_this$contentSize[0],g=_this$contentSize[1];return[l+f+m+d,T+g+x+d];}// content + padding
|
|
299
|
-
},{key:"clientSize",get:function get(){var _this$attributes3=this.attributes,T=_this$attributes3.paddingTop,m=_this$attributes3.paddingRight,x=_this$attributes3.paddingBottom,l=_this$attributes3.paddingLeft,_this$contentSize2=_slicedToArray(this.contentSize,2),d=_this$contentSize2[0],f=_this$contentSize2[1];return[l+d+m,T+f+x];}},{key:"contentSize",get:function get(){var _this$attributes4=this.attributes,T=_this$attributes4.width,m=_this$attributes4.height,x=_this$attributes4.boxSizing,l=_this$attributes4.paddingTop,d=_this$attributes4.paddingRight,f=_this$attributes4.paddingBottom,g=_this$attributes4.paddingLeft;if(T=T||0,m=m||0,x==="border-box"){var O=2*this.attributes.borderWidth;T-=O+d+g,m-=O+l+f,T=Math.max(0,T),m=Math.max(0,m);}return[T,m];}},{key:"hasBorder",get:function get(){return this.attributes.borderWidth>0;}/* override */},{key:"isVisible",get:function get(){var _this$borderSize=_slicedToArray(this.borderSize,2),T=_this$borderSize[0],m=_this$borderSize[1];return T>0&&m>0;}},{key:"mesh",get:function get(){if(this.attributes.display==="none")return null;var T=this.clientBox;if(T){var _m5;var m=this[v];if(m)m.box!==T&&(m.contours=T.contours,m.box=T);else{m=new n.Mesh2D(T),m.box=T;var _l14=this.attributes.bgcolor;if(Object(o.setFillColor)(m,{color:_l14}),this.hasBorder){var _this$attributes5=this.attributes,f=_this$attributes5.borderColor,g=_this$attributes5.borderWidth,O=_this$attributes5.borderDash,A=_this$attributes5.borderDashOffset;Object(o.setStrokeColor)(m,{color:f,lineWidth:g,lineDash:O,lineDashOffset:A});}this[v]=m;var d=this.attributes.clipPath;d&&this[v].setClipPath(d);}var _x37=this.opacity;return m.getOpacity()!==_x37&&m.setOpacity(_x37),(_m5=m).setTransform.apply(_m5,_toConsumableArray(this.renderMatrix)),m;}return null;}// content + padding + border
|
|
300
|
-
},{key:"offsetSize",get:function get(){var _this$attributes6=this.attributes,T=_this$attributes6.paddingTop,m=_this$attributes6.paddingRight,x=_this$attributes6.paddingBottom,l=_this$attributes6.paddingLeft,d=_this$attributes6.borderWidth,_this$contentSize3=_slicedToArray(this.contentSize,2),f=_this$contentSize3[0],g=_this$contentSize3[1],O=2*d;return[l+f+m+O,T+g+x+O];}},{key:"originalClientRect",get:function get(){if(this.mesh){var T=this.mesh.boundingBox;return[T[0][0],T[0][1],T[1][0]-T[0][0],T[1][1]-T[0][1]];}return[0,0,0,0];}},{key:"originalContentRect",get:function get(){var _this$originalClientR=_slicedToArray(this.originalClientRect,4),T=_this$originalClientR[0],m=_this$originalClientR[1],x=_this$originalClientR[2],l=_this$originalClientR[3],d=this.attributes.padding;return[T+d[0],m+d[1],x-d[0]-d[2],l-d[1]-d[3]];}},{key:"getBoundingClientRect",value:function getBoundingClientRect(){var T=this.renderMatrix;this.layer&&this.layer.layerTransformInvert&&(T=e.mat2d.multiply(Array.of(0,0,0,0,0,0),this.layer.transformMatrix,T));var m=null;if(this.mesh){m=_toConsumableArray(this.mesh.boundingBox);var _x38=this.attributes.borderWidth;_x38&&(m[0]=[m[0][0]-_x38,m[0][1]-_x38],m[1]=[m[1][0]+_x38,m[1][1]+_x38]);}return Object(p["default"])(m,T);}// transformPoint(x, y) {
|
|
301
|
-
// const m = mat2d.invert(this.renderMatrix);
|
|
302
|
-
// const newX = x * m[0] + y * m[2] + m[4];
|
|
303
|
-
// const newY = x * m[1] + y * m[3] + m[5];
|
|
304
|
-
// return [newX, newY];
|
|
305
|
-
// }
|
|
306
|
-
/* override */},{key:"onPropertyChange",value:function onPropertyChange(T,m,x){if(_get(_getPrototypeOf(y.prototype),"onPropertyChange",this).call(this,T,m,x),(T==="anchorX"||T==="anchorY"||T==="boxSizing"||T==="width"||T==="height"||T==="borderWidth"||T==="paddingLeft"||T==="paddingRight"||T==="paddingTop"||T==="paddingBottom"||/^border(TopLeft|TopRight|BottomRight|BottomLeft)Radius$/.test(T))&&this.updateContours(),this[v]&&T==="clipPath"&&this[v].setClipPath(m),this[v]&&T==="bgcolor"&&Object(o.setFillColor)(this[v],{color:m}),this[v]&&(T==="borderColor"||T==="borderWidth"||T==="borderDash"||T==="borderDashOffset")){var _this$attributes7=this.attributes,_l15=_this$attributes7.borderColor,d=_this$attributes7.borderWidth,f=_this$attributes7.borderDash,g=_this$attributes7.borderDashOffset;Object(o.setStrokeColor)(this[v],{color:_l15,lineWidth:d,lineDash:d?f:0,lineDashOffset:g});}}/* override */},{key:"updateContours",value:function updateContours(){var _this$attributes8=this.attributes,T=_this$attributes8.anchorX,m=_this$attributes8.anchorY,x=_this$attributes8.borderWidth,l=_this$attributes8.borderRadius,_this$borderSize2=_slicedToArray(this.borderSize,2),d=_this$borderSize2[0],f=_this$borderSize2[1],g=this.offsetSize,O=0.5*x,A=-T*g[0]+O,R=-m*g[1]+O;this.clientBox=new n.Figure2D(),Object(s.createRadiusBox)(this.clientBox,[A,R,d,f],l);}}]);}(i["default"]);h(y,"Attr",a["default"]),c["default"].registerNode(y,"block");},/* 220 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return p;});var e=t(71),n=t(72),i=t(221);t(1).glMatrix.setMatrixArrayType(Array);var a=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute"),s=Symbol["for"]("spritejs_setAttributeDefault"),c=Symbol["for"]("spritejs_declareAlias");var p=/*#__PURE__*/function(_e$default){function p(v){var _this30;_classCallCheck(this,p);_this30=_callSuper(this,p,[v]),_this30[s]({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(p,_e$default);return _createClass(p,[{key:"anchorX",get:function get(){return this[o]("anchorX");},set:function set(v){this[a]("anchorX",Object(n.toNumber)(v));}},{key:"anchorY",get:function get(){return this[o]("anchorY");},set:function set(v){this[a]("anchorY",Object(n.toNumber)(v));}},{key:"anchor",get:function get(){return[this.anchorX,this.anchorY];},set:function set(v){v=Object(n.toArray)(v),Array.isArray(v)||(v=[v,v]),this.anchorX=v[0],this.anchorY=v[1];}},{key:"width",get:function get(){return this[o]("width");},set:function set(v){this[a]("width",Object(n.toNumber)(v));}},{key:"height",get:function get(){return this[o]("height");},set:function set(v){this[a]("height",Object(n.toNumber)(v));}},{key:"size",get:function get(){return[this.width,this.height];},set:function set(v){v=Object(n.toArray)(v),Array.isArray(v)||(v=[v,v]),this.width=v[0],this.height=v[1];}},{key:"borderWidth",get:function get(){return this[o]("borderWidth");},set:function set(v){this[a]("borderWidth",Object(n.toNumber)(v));}},{key:"borderColor",get:function get(){return this[o]("borderColor");},set:function set(v){this[a]("borderColor",Object(i.parseColor)(v));}},{key:"border",get:function get(){return[this.borderWidth,this.borderColor];},set:function set(v){v=Object(n.toArray)(v),Array.isArray(v)||(v=[v]),this.borderWidth=v[0],v[1]!=null&&(this.borderColor=v[1]);}},{key:"borderDash",get:function get(){return this[o]("borderDash");},set:function set(v){v=Object(n.toArray)(v,!0),v!=null&&!Array.isArray(v)&&(v=[v]),this[a]("borderDash",v?v.map(n.toNumber):null);}},{key:"borderDashOffset",get:function get(){return this[o]("borderDashOffset");},set:function set(v){this[a]("borderDashOffset",Object(n.toNumber)(v));}},{key:"borderTopLeftRadius",get:function get(){return this[o]("borderTopLeftRadius");},set:function set(v){v=Object(n.toArray)(v,!0),Array.isArray(v)||(v=[v,v]),this[a]("borderTopLeftRadius",v.map(n.toNumber));}},{key:"borderTopRightRadius",get:function get(){return this[o]("borderTopRightRadius");},set:function set(v){v=Object(n.toArray)(v,!0),Array.isArray(v)||(v=[v,v]),this[a]("borderTopRightRadius",v.map(n.toNumber));}},{key:"borderBottomRightRadius",get:function get(){return this[o]("borderBottomRightRadius");},set:function set(v){v=Object(n.toArray)(v,!0),Array.isArray(v)||(v=[v,v]),this[a]("borderBottomRightRadius",v.map(n.toNumber));}},{key:"borderBottomLeftRadius",get:function get(){return this[o]("borderBottomLeftRadius");},set:function set(v){v=Object(n.toArray)(v,!0),Array.isArray(v)||(v=[v,v]),this[a]("borderBottomLeftRadius",v.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(v){if(v=Object(n.toArray)(v),!Array.isArray(v))v=Array(8).fill(v);else if(v.length===2)v=[v[0],v[1],v[0],v[1],v[0],v[1],v[0],v[1]];else if(v.length===4)v=[v[0],v[1],v[2],v[3],v[0],v[1],v[2],v[3]];else if(v.length===6)v=[v[0],v[1],v[2],v[3],v[4],v[5],v[2],v[3]];else if(v.length!==8)throw new TypeError("Invalid borderRadius value.");this.borderTopLeftRadius=[v[0],v[1]],this.borderTopRightRadius=[v[2],v[3]],this.borderBottomRightRadius=[v[4],v[5]],this.borderBottomLeftRadius=[v[6],v[7]];}},{key:"bgcolor",get:function get(){return this[o]("bgcolor");},set:function set(v){this[a]("bgcolor",Object(i.parseColor)(v));}},{key:"paddingTop",get:function get(){return this[o]("paddingTop");},set:function set(v){this[a]("paddingTop",Object(n.toNumber)(v));}},{key:"paddingRight",get:function get(){return this[o]("paddingRight");},set:function set(v){this[a]("paddingRight",Object(n.toNumber)(v));}},{key:"paddingBottom",get:function get(){return this[o]("paddingBottom");},set:function set(v){this[a]("paddingBottom",Object(n.toNumber)(v));}},{key:"paddingLeft",get:function get(){return this[o]("paddingLeft");},set:function set(v){this[a]("paddingLeft",Object(n.toNumber)(v));}},{key:"padding",get:function get(){return[this.paddingTop,this.paddingRight,this.paddingBottom,this.paddingLeft];},set:function set(v){v=Object(n.toArray)(v),Array.isArray(v)?v.length===2?v=[v[0],v[1],v[0],v[1]]:v.length===3&&(v=[v[0],v[1],v[2],v[1]]):v=[v,v,v,v],this.paddingTop=v[0],this.paddingRight=v[1],this.paddingBottom=v[2],this.paddingLeft=v[3];}},{key:"clipPath",get:function get(){return this[o]("clipPath");},set:function set(v){this[a]("clipPath",v);}},{key:"boxSizing",get:function get(){return this[o]("boxSizing");},set:function set(v){if(v!=null&&v!=="border-box"&&v!=="content-box")throw new TypeError("Invalid boxSizing type.");this[a]("boxSizing",v);}}]);}(e["default"]);},/* 221 */ /***/function(u,r,t){t.r(r),t.d(r,"Gradient",function(){return i;}),t.d(r,"isTransparent",function(){return a;}),t.d(r,"parseColor",function(){return o;}),t.d(r,"setFillColor",function(){return c;}),t.d(r,"setStrokeColor",function(){return p;}),t.d(r,"Color",function(){return h;});var e=t(32),n=/* @__PURE__ */t.n(e);t(1).glMatrix.setMatrixArrayType(Array);var i=/*#__PURE__*/function(){function i(_ref136){var y=_ref136.vector,M=_ref136.colors;_classCallCheck(this,i);if(!Array.isArray(y)||y.length!==4&&y.length!==6&&y.length!==3)throw new TypeError("Invalid gradient");this.vector=y,this.colors=M.map(function(_ref137){var T=_ref137.offset,m=_ref137.color;return{offset:T,color:o(m)};});}return _createClass(i,[{key:"toString",value:function toString(){return JSON.stringify({vector:this.vector,colors:this.colors});}}]);}();function a(v){return v instanceof i?!1:v==null?!0:n()(v)[3]===0;}function o(v){if(v==null||(v||(v="transparent"),v instanceof i))return v;var y=n()(v);if(!y||!y.length)throw new TypeError("Invalid color value.");return"rgba(".concat(y.join(),")");}function s(v,y,M){var T=v.boundingBox[0];if(M.vector){var m=M.vector,_x39=M.colors;m.length===4?(m=[m[0]+T[0],m[1]+T[1],m[2]+T[0],m[3]+T[1]],v.setLinearGradient({vector:m,colors:_x39,type:y})):m.length===3?(m=[m[0]+T[0],m[1]+T[1],m[2]],v.setCircularGradient({vector:m,colors:_x39,type:y})):(m=[m[0]+T[0],m[1]+T[1],m[2],m[3]+T[0],m[4]+T[1],m[5]],v.setRadialGradient({vector:m,colors:_x39,type:y}));}else v.gradient&&v.gradient[y]&&(delete v.gradient[y],delete v.uniforms.u_radialGradientVector);}function c(v,_ref138){var y=_ref138.color,_ref138$rule=_ref138.rule,M=_ref138$rule===void 0?"nonzero":_ref138$rule;return s(v,"fill",y),y.vector||v.setFill({color:y,rule:M}),v;}function p(v,_ref139){var y=_ref139.color,M=_ref139.lineWidth,T=_ref139.lineCap,m=_ref139.lineJoin,x=_ref139.lineDash,l=_ref139.lineDashOffset,d=_ref139.miterLimit,f=_ref139.roundSegments;s(v,"stroke",y),y.vector&&(y=[0,0,0,1]),v.setStroke({color:y,thickness:M,cap:T,join:m,miterLimit:d,lineDash:x,lineDashOffset:l,roundSegments:f});}var h=/*#__PURE__*/function(_Array){function h(){var _y6,_y7,_n2,_n3;var _this31;var y=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var M=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var T=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var m=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;_classCallCheck(this,h);return _possibleConstructorReturn(_this31,(Array.isArray(y)&&(_y6=y,_y7=_slicedToArray(_y6,4),y=_y7[0],M=_y7[1],T=_y7[2],m=_y7[3],_y6),typeof y=="string"&&((_n2=n()(y),_n3=_slicedToArray(_n2,4),y=_n3[0],M=_n3[1],T=_n3[2],m=_n3[3]),y/=255,M/=255,T/=255),_this31=_callSuper(this,h,[y,M,T,m]),_assertThisInitialized(_this31)));}_inherits(h,_Array);return _createClass(h,[{key:"r",get:function get(){return Math.round(this[0]*255);},set:function set(y){this[0]=y/255;}},{key:"g",get:function get(){return Math.round(this[1]*255);},set:function set(y){this[1]=y/255;}},{key:"b",get:function get(){return Math.round(this[2]*255);},set:function set(y){this[2]=y/255;}},{key:"a",get:function get(){return this[3];},set:function set(y){this[3]=y;}},{key:"hex",get:function get(){var y="0".concat(this.r.toString(16)).slice(-2),M="0".concat(this.g.toString(16)).slice(-2),T="0".concat(this.b.toString(16)).slice(-2);var m;return this.a<1&&(m=Math.round(this[3]*255),m="0".concat(m.toString(16)).slice(-2)),"#".concat(y).concat(M).concat(T).concat(m||"");}},{key:"rgba",get:function get(){return"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.a,")");}},{key:"fromColor",value:function fromColor(y){return typeof y=="string"&&(y=n()(y),y[0]/=255,y[1]/=255,y[2]/=255),this[0]=y[0],this[1]=y[1],this[2]=y[2],this[3]=y[3],this;}}]);}(/*#__PURE__*/_wrapNativeSuper(Array));},/* 222 */ /***/function(u,r,t){t.r(r),t.d(r,"createRadiusBox",function(){return n;}),t(1).glMatrix.setMatrixArrayType(Array);function e(i,a,o,s,c){var p=arguments.length>5&&arguments[5]!==undefined?arguments[5]:"leftTop";var h=0.5522848,v=s/2*h,y=c/2*h,M=a+s,T=o+c,m=a+s/2,x=o+c/2;p==="leftTop"?(i.moveTo(a,x),i.bezierCurveTo(a,x-y,m-v,o,m,o)):p==="rightTop"?i.bezierCurveTo(m+v,o,M,x-y,M,x):p==="rightBottom"?i.bezierCurveTo(M,x+y,m+v,T,m,T):p==="leftBottom"&&i.bezierCurveTo(m-v,T,a,x+y,a,x);}function n(i,_ref140,p){var _ref141=_slicedToArray(_ref140,4),a=_ref141[0],o=_ref141[1],s=_ref141[2],c=_ref141[3];if(!p||Array.isArray(p)&&p.every(function(h){return h===0;}))i.beginPath(),i.rect(a,o,s,c);else{typeof p=="number"&&(p=Array(8).fill(p));var _p$map=p.map(function(d,f){return f%2?Math.min(d,c/2):Math.min(d,s/2);}),_p$map2=_slicedToArray(_p$map,8),h=_p$map2[0],v=_p$map2[1],y=_p$map2[2],M=_p$map2[3],T=_p$map2[4],m=_p$map2[5],_x40=_p$map2[6],_l16=_p$map2[7];i.beginPath(),i.moveTo(a,o+v),e(i,a,o,h*2,v*2,"leftTop"),i.lineTo(a+s-y,o),e(i,a+s-y*2,o,y*2,M*2,"rightTop"),i.lineTo(a+s,o+c-m),e(i,a+s-T*2,o+c-m*2,T*2,m*2,"rightBottom"),i.lineTo(a+_x40,o+c),e(i,a,o+c-_l16*2,_x40*2,_l16*2,"leftBottom"),i.closePath();}return i;}},/* 223 */ /***/function(u,r,t){t.r(r),t(1).glMatrix.setMatrixArrayType(Array),r["default"]=function(e,n){if(!e)return{x:0,y:0,width:0,height:0,left:0,top:0,right:0,bottom:0};var _e2=_slicedToArray(e,2),_e2$=_slicedToArray(_e2[0],2),i=_e2$[0],a=_e2$[1],_e2$2=_slicedToArray(_e2[1],2),o=_e2$2[0],s=_e2$2[1],c=i*n[0]+a*n[2]+n[4],p=i*n[1]+a*n[3]+n[5],h=o*n[0]+a*n[2]+n[4],v=o*n[1]+a*n[3]+n[5],y=o*n[0]+s*n[2]+n[4],M=o*n[1]+s*n[3]+n[5],T=i*n[0]+s*n[2]+n[4],m=i*n[1]+s*n[3]+n[5],x=Math.min(c,h,y,T),l=Math.min(p,v,M,m),d=Math.max(c,h,y,T),f=Math.max(p,v,M,m);return{x:x,y:l,width:d-x,height:f-l,left:x,top:l,right:d,bottom:f};};},/* 224 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return c;});var e=t(218),n=t(219),i=t(225),a=t(213);t(1).glMatrix.setMatrixArrayType(Array);function o(p,h,v){return h in p?Object.defineProperty(p,h,{value:v,enumerable:!0,configurable:!0,writable:!0}):p[h]=v,p;}var s=Symbol("textureTask");var c=/*#__PURE__*/function(_n$default){function c(){var _this32;var h=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,c);typeof h=="string"&&(h={texture:h}),_this32=_callSuper(this,c,[h]);return _this32;}/* override */_inherits(c,_n$default);return _createClass(c,[{key:"contentSize",get:function get(){var _get2=_get(_getPrototypeOf(c.prototype),"contentSize",this),_get3=_slicedToArray(_get2,2),h=_get3[0],v=_get3[1];var _this$attributes9=this.attributes,y=_this$attributes9.width,M=_this$attributes9.height;if(y==null||M==null){var T=this.textureImage,m=this.attributes.textureRect,_x41=this.attributes.sourceRect;if(m)y==null&&(h=m[0]+m[2]),M==null&&(v=m[1]+m[3]);else if(_x41){var _l17=this.layer?this.layer.displayRatio:1;y==null&&(h=_x41[2]/_l17),M==null&&(v=_x41[3]/_l17);}else if(T){var _l18=this.layer?this.layer.displayRatio:1;y==null&&(h=T.width/_l18),M==null&&(v=T.height/_l18);}}return[h,v];}},{key:"textureImageReady",get:function get(){return this[s]||Promise.resolve();}/* override */},{key:"draw",value:function draw(){var h=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];_get(_getPrototypeOf(c.prototype),"draw",this).call(this,h);var v=this.mesh;return v&&Object(e.drawTexture)(this,v),h;}/* override */},{key:"onPropertyChange",value:function onPropertyChange(h,v,y){if(_get(_getPrototypeOf(c.prototype),"onPropertyChange",this).call(this,h,v,y),h==="texture"&&(this[s]=Object(e.applyTexture)(this,v,!0)),h==="textureRect"){var _this$attributes10=this.attributes,M=_this$attributes10.width,T=_this$attributes10.height;(M==null||T==null)&&this.updateContours();}}}]);}(n["default"]);o(c,"Attr",i["default"]),a["default"].registerNode(c,"sprite");},/* 225 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(220);t(1).glMatrix.setMatrixArrayType(Array);var n=Symbol["for"]("spritejs_setAttributeDefault"),i=Symbol["for"]("spritejs_setAttribute"),a=Symbol["for"]("spritejs_getAttribute");var o=/*#__PURE__*/function(_e$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,_e$default2);return _createClass(o,[{key:"texture",get:function get(){return this[a]("texture");},set:function set(c){this[i]("texture",c);}},{key:"textureRect",get:function get(){return this[a]("textureRect");},set:function set(c){this[i]("textureRect",c);}},{key:"sourceRect",get:function get(){return this[a]("sourceRect");},set:function set(c){this[i]("sourceRect",c);}},{key:"textureRepeat",get:function get(){return this[a]("textureRepeat");},set:function set(c){this[i]("textureRepeat",!!c);}}]);}(e["default"]);},/* 226 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return M;});var e=t(12),n=t(227),i=/* @__PURE__ */t.n(n),a=t(70),o=t(228),s=t(221),c=t(218),p=t(213),h=t(223);t(1).glMatrix.setMatrixArrayType(Array);function v(T,m,x){return m in T?Object.defineProperty(T,m,{value:x,enumerable:!0,configurable:!0,writable:!0}):T[m]=x,T;}var y=Symbol("mesh");var M=/*#__PURE__*/function(_a$default){function M(){var _this34;var m=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,M);typeof m=="string"&&(m={d:m}),_this34=_callSuper(this,M,[m]),_this34.effects={d:function d(x,l,_d10,f,g){var _i$a;var O=(_d10-f)/(g-f);if(O<=0)return x;if(O>=1)return l;var A=i.a._preprocessing(i.a.path2shapes(x),i.a.path2shapes(l)),R=(_i$a=i.a)._lerp.apply(_i$a,_toConsumableArray(A).concat([O]))[0];return R.reduce(function(P,L){return"".concat(P).concat(L.slice(2).join(" ")," ");},"M".concat(R[0][0]," ").concat(R[0][1],"C")).trim();}};return _this34;}/* override */_inherits(M,_a$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 m=this.path;if(m){var _x43;var _x42=this[y];if(_x42)_x42.path!==m&&(_x42.contours=m.contours,_x42.path=m);else{_x42=new e.Mesh2D(this.path),_x42.path=m;var d=this.attributes.fillColor,f=this.attributes.fillRule;d&&Object(s.setFillColor)(_x42,{color:d,rule:f});var g=this.attributes.lineWidth,O=this.attributes.strokeColor;if(O&&g>0){var _this$attributes11=this.attributes,R=_this$attributes11.lineCap,b=_this$attributes11.lineJoin,P=_this$attributes11.miterLimit,L=_this$attributes11.lineDash,D=_this$attributes11.lineDashOffset,I=_this$attributes11.roundSegments;Object(s.setStrokeColor)(_x42,{color:O,lineWidth:g,lineCap:R,lineJoin:b,miterLimit:P,lineDash:L,lineDashOffset:D,roundSegments:I});}this[y]=_x42;var A=this.attributes.clipPath;A&&this[y].setClipPath(A);}var _l19=this.opacity;return _x42.getOpacity()!==_l19&&_x42.setOpacity(_l19),(_x43=_x42).setTransform.apply(_x43,_toConsumableArray(this.renderMatrix)),_x42;}return null;}},{key:"originalContentRect",get:function get(){if(this.path){var m=this.path.boundingBox;return[m[0][0],m[0][1],m[1][0]-m[0][0],m[1][1]-m[0][1]];}return[0,0,0,0];}},{key:"originalClientRect",get:function get(){if(this.mesh){var m=this.mesh.boundingBox;return[m[0][0],m[0][1],m[1][0]-m[0][0],m[1][1]-m[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(m){this.attributes.d=m;}},{key:"draw",value:function draw(){var m=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];_get(_getPrototypeOf(M.prototype),"draw",this).call(this,m);var x=this.mesh;return x&&Object(c.drawTexture)(this,x),m;}},{key:"getBoundingClientRect",value:function getBoundingClientRect(){var m=null;return this.mesh&&(m=this.mesh.boundingBox),Object(h["default"])(m,this.renderMatrix);}},{key:"getPathLength",value:function getPathLength(){return this.mesh?this.mesh.getTotalLength():0;}},{key:"getPointAtLength",value:function getPointAtLength(m){if(this.mesh){var _x44=this.mesh.getPointAtLength(m);if(_x44)return[_x44.x,_x44.y];}return[0,0];}/* override */},{key:"onPropertyChange",value:function onPropertyChange(m,x,l){if(_get(_getPrototypeOf(M.prototype),"onPropertyChange",this).call(this,m,x,l),(m==="d"||m==="normalize")&&this.updateContours(),this[y]&&(m==="fillColor"||m==="fillRule")){var _this$attributes12=this.attributes,d=_this$attributes12.fillColor,f=_this$attributes12.fillRule;Object(s.setFillColor)(this[y],{color:d,rule:f});}if(this[y]&&(m==="strokeColor"||m==="lineWidth"||m==="lineCap"||m==="lineJoin"||m==="lineDash"||m==="lineDashOffset"||m==="roundSegments")){var _this$attributes13=this.attributes,_d11=_this$attributes13.strokeColor,_f10=_this$attributes13.lineWidth;if(_d11&&_f10>0){var _this$attributes14=this.attributes,g=_this$attributes14.lineCap,O=_this$attributes14.lineJoin,A=_this$attributes14.lineDash,R=_this$attributes14.lineDashOffset,b=_this$attributes14.miterLimit,P=_this$attributes14.roundSegments;Object(s.setStrokeColor)(this[y],{color:_d11,lineCap:g,lineJoin:O,lineWidth:_f10,lineDash:A,lineDashOffset:R,miterLimit:b,roundSegments:P});}}this[y]&&m==="clipPath"&&this[y].setClipPath(x),m==="texture"&&Object(c.applyTexture)(this,x);}/* override */},{key:"updateContours",value:function updateContours(){var _this$path;this.path=new e.Figure2D(),this.path.addPath(this.attributes.d),this.attributes.normalize&&(_this$path=this.path).normalize.apply(_this$path,_toConsumableArray(this.path.boundingCenter));}}]);}(a["default"]);v(M,"Attr",o["default"]),p["default"].registerNode(M,"path");},/* 227 */ /***/function(u,r,t){(function(e,n){u.exports=n();})(this,function(){var e=/* @__PURE__ */function(){function L(D,I){var C=[],B=!0,G=!1,H=void 0;try{for(var X=D[Symbol.iterator](),Z;!(B=(Z=X.next()).done)&&(C.push(Z.value),!(I&&C.length===I));B=!0);}catch(W){G=!0,H=W;}finally{try{!B&&X["return"]&&X["return"]();}finally{if(G)throw H;}}return C;}return function(D,I){if(Array.isArray(D))return D;if(Symbol.iterator in Object(D))return L(D,I);throw new TypeError("Invalid attempt to destructure non-iterable instance");};}(),n=Math.PI*2,i=function i(D,I,C,B,G,H,X){var Z=D.x,W=D.y;Z*=I,W*=C;var z=B*Z-G*W,Q=G*Z+B*W;return{x:z+H,y:Q+X};},a=function a(D,I){var C=1.3333333333333333*Math.tan(I/4),B=Math.cos(D),G=Math.sin(D),H=Math.cos(D+I),X=Math.sin(D+I);return[{x:B-G*C,y:G+B*C},{x:H+X*C,y:X-H*C},{x:H,y:X}];},o=function o(D,I,C,B){var G=D*B-I*C<0?-1:1,H=Math.sqrt(D*D+I*I),X=Math.sqrt(D*D+I*I),Z=D*C+I*B,W=Z/(H*X);return W>1&&(W=1),W<-1&&(W=-1),G*Math.acos(W);},s=function s(D,I,C,B,G,H,X,Z,W,z,Q,et){var _=Math.pow(G,2),st=Math.pow(H,2),q=Math.pow(Q,2),ht=Math.pow(et,2),dt=_*st-_*ht-st*q;dt<0&&(dt=0),dt/=_*ht+st*q,dt=Math.sqrt(dt)*(X===Z?-1:1);var F=dt*G/H*et,U=dt*-H/G*Q,V=z*F-W*U+(D+C)/2,J=W*F+z*U+(I+B)/2,N=(Q-F)/G,$=(et-U)/H,S=(-Q-F)/G,E=(-et-U)/H,w=o(1,0,N,$),j=o(N,$,S,E);return Z===0&&j>0&&(j-=n),Z===1&&j<0&&(j+=n),[V,J,w,j];},c=function c(D){var I=D.px,C=D.py,B=D.cx,G=D.cy,H=D.rx,X=D.ry,Z=D.xAxisRotation,W=Z===void 0?0:Z,z=D.largeArcFlag,Q=z===void 0?0:z,et=D.sweepFlag,_=et===void 0?0:et,st=[];if(H===0||X===0)return[];var q=Math.sin(W*n/360),ht=Math.cos(W*n/360),dt=ht*(I-B)/2+q*(C-G)/2,F=-q*(I-B)/2+ht*(C-G)/2;if(dt===0&&F===0)return[];H=Math.abs(H),X=Math.abs(X);var U=Math.pow(dt,2)/Math.pow(H,2)+Math.pow(F,2)/Math.pow(X,2);U>1&&(H*=Math.sqrt(U),X*=Math.sqrt(U));var V=s(I,C,B,G,H,X,Q,_,q,ht,dt,F),J=e(V,4),N=J[0],$=J[1],S=J[2],E=J[3],w=Math.max(Math.ceil(Math.abs(E)/(n/4)),1);E/=w;for(var j=0;j<w;j++)st.push(a(S,E)),S+=E;return st.map(function(K){var Y=i(K[0],H,X,ht,q,N,$),k=Y.x,nt=Y.y,it=i(K[1],H,X,ht,q,N,$),lt=it.x,ut=it.y,at=i(K[2],H,X,ht,q,N,$),ot=at.x,ct=at.y;return{x1:k,y1:nt,x2:lt,y2:ut,x:ot,y:ct};});},p={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0/**
|
|
307
|
-
* segment pattern
|
|
308
|
-
* @type {RegExp}
|
|
309
|
-
*/},h=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function v(L){var D=[];return L.replace(h,function(I,C,B){var G=C.toLowerCase();for(B=M(B),G=="m"&&B.length>2&&(D.push([C].concat(B.splice(0,2))),G="l",C=C=="m"?"l":"L");;){if(B.length==p[G])return B.unshift(C),D.push(B);if(B.length<p[G])throw new Error("malformed path data");D.push([C].concat(B.splice(0,p[G])));}}),D;}var y=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function M(L){var D=L.match(y);return D?D.map(Number):[];}function T(L){var D=L[0][0],I=L[0][1],C=D,B=I;return L.forEach(function(G){var H=G[0],X=G[2],Z=G[4],W=G[6],z=G[1],Q=G[3],et=G[5],_=G[7];D=Math.min(D,H,X,Z,W),I=Math.min(I,z,Q,et,_),C=Math.max(C,H,X,Z,W),B=Math.max(B,z,Q,et,_);}),[D,I,C,B];}function m(L,D){return Math.sqrt(Math.pow(L[0]-D[0],2)+Math.pow(L[1]-D[1],2))+Math.sqrt(Math.pow(L[2]-D[2],2)+Math.pow(L[3]-D[3],2));}function x(L,D){var I=L[0],C=L[2],B=L[4],G=L[6],H=L[1],X=L[3],Z=L[5],W=L[7],z=D[0],Q=D[2],et=D[4],_=D[6],st=D[1],q=D[3],ht=D[5],dt=D[7];return Math.sqrt(Math.pow(z-I,2)+Math.pow(st-H,2))+Math.sqrt(Math.pow(Q-C,2)+Math.pow(q-X,2))+Math.sqrt(Math.pow(et-B,2)+Math.pow(ht-Z,2))+Math.sqrt(Math.pow(_-G,2)+Math.pow(dt-W,2));}function l(L,D){var I=f(L.length),C=[];I.forEach(function(G){var H=0,X=0;G.forEach(function(Z){H+=x(L[Z],D[X++]);}),C.push({index:G,distance:H});}),C.sort(function(G,H){return G.distance-H.distance;});var B=[];return C[0].index.forEach(function(G){B.push(L[G]);}),B;}function d(L,D){var I=g(L.length),C=[];I.forEach(function(G){var H=0;G.forEach(function(X){H+=m(T(L[X]),T(D[X]));}),C.push({index:G,distance:H});}),C.sort(function(G,H){return G.distance-H.distance;});var B=[];return C[0].index.forEach(function(G){B.push(L[G]);}),B;}function f(L){for(var D=[],I=0;I<L;I++){for(var C=[],B=0;B<L;B++){var G=B+I;G>L-1&&(G-=L),C[G]=B;}D.push(C);}return D;}function g(L){for(var D=[],I=0;I<L;I++)D.push(I);return O(D);}function O(L){var D=[],I=[];function C(B){var G,H;for(G=0;G<B.length;G++)H=B.splice(G,1)[0],I.push(H),B.length==0&&D.push(I.slice()),C(B),B.splice(G,0,H),I.pop();return D;}return C(L);}var A={};A.parser=v,A.lerpCurve=function(L,D,I){return A.lerpPoints(L[0],L[1],D[0],D[1],I).concat(A.lerpPoints(L[2],L[3],D[2],D[3],I)).concat(A.lerpPoints(L[4],L[5],D[4],D[5],I)).concat(A.lerpPoints(L[6],L[7],D[6],D[7],I));},A.lerpPoints=function(L,D,I,C,B){return[L+(I-L)*B,D+(C-D)*B];},A.q2b=function(L,D,I,C,B,G){return[L,D,(L+2*I)/3,(D+2*C)/3,(B+2*I)/3,(G+2*C)/3,B,G];},A.path2shapes=function(L){for(var D=A.parser(L),I=0,C=0,B=0,G=D.length,H=[],X=null,Z=void 0,W=void 0,z=void 0,Q=void 0,et=void 0,_=void 0,st=void 0;B<G;B++){var q=D[B],ht=q[0],dt=D[B-1];switch(ht){case"m":et=H.length,H[et]=[],X=H[et],I=I+q[1],C=C+q[2];break;case"M":et=H.length,H[et]=[],X=H[et],I=q[1],C=q[2];break;case"l":X.push([I,C,I,C,I,C,I+q[1],C+q[2]]),I+=q[1],C+=q[2];break;case"L":X.push([I,C,q[1],q[2],q[1],q[2],q[1],q[2]]),I=q[1],C=q[2];break;case"h":X.push([I,C,I,C,I,C,I+q[1],C]),I+=q[1];break;case"H":X.push([I,C,q[1],C,q[1],C,q[1],C]),I=q[1];break;case"v":X.push([I,C,I,C,I,C,I,C+q[1]]),C+=q[1];break;case"V":X.push([I,C,I,q[1],I,q[1],I,q[1]]),C=q[1];break;case"C":X.push([I,C,q[1],q[2],q[3],q[4],q[5],q[6]]),I=q[5],C=q[6];break;case"S":dt[0]==="C"||dt[0]==="c"?X.push([I,C,I+dt[5]-dt[3],C+dt[6]-dt[4],q[1],q[2],q[3],q[4]]):(dt[0]==="S"||dt[0]==="s")&&X.push([I,C,I+dt[3]-dt[1],C+dt[4]-dt[2],q[1],q[2],q[3],q[4]]),I=q[3],C=q[4];break;case"c":X.push([I,C,I+q[1],C+q[2],I+q[3],C+q[4],I+q[5],C+q[6]]),I=I+q[5],C=C+q[6];break;case"s":dt[0]==="C"||dt[0]==="c"?X.push([I,C,I+dt[5]-dt[3],C+dt[6]-dt[4],I+q[1],C+q[2],I+q[3],C+q[4]]):(dt[0]==="S"||dt[0]==="s")&&X.push([I,C,I+dt[3]-dt[1],C+dt[4]-dt[2],I+q[1],C+q[2],I+q[3],C+q[4]]),I=I+q[3],C=C+q[4];break;case"a":_=c({rx:q[1],ry:q[2],px:I,py:C,xAxisRotation:q[3],largeArcFlag:q[4],sweepFlag:q[5],cx:I+q[6],cy:C+q[7]}),st=_[_.length-1],_.forEach(function(F,U){U===0?X.push([I,C,F.x1,F.y1,F.x2,F.y2,F.x,F.y]):X.push([_[U-1].x,_[U-1].y,F.x1,F.y1,F.x2,F.y2,F.x,F.y]);}),I=st.x,C=st.y;break;case"A":_=c({rx:q[1],ry:q[2],px:I,py:C,xAxisRotation:q[3],largeArcFlag:q[4],sweepFlag:q[5],cx:q[6],cy:q[7]}),st=_[_.length-1],_.forEach(function(F,U){U===0?X.push([I,C,F.x1,F.y1,F.x2,F.y2,F.x,F.y]):X.push([_[U-1].x,_[U-1].y,F.x1,F.y1,F.x2,F.y2,F.x,F.y]);}),I=st.x,C=st.y;break;case"Q":X.push(A.q2b(I,C,q[1],q[2],q[3],q[4])),I=q[3],C=q[4];break;case"q":X.push(A.q2b(I,C,I+q[1],C+q[2],q[3]+I,q[4]+C)),I+=q[3],C+=q[4];break;case"T":dt[0]==="Q"||dt[0]==="q"?(z=I+dt[3]-dt[1],Q=C+dt[4]-dt[2],X.push(A.q2b(I,C,z,Q,q[1],q[2]))):(dt[0]==="T"||dt[0]==="t")&&(X.push(A.q2b(I,C,I+I-z,C+C-Q,q[1],q[2])),z=I+I-z,Q=C+C-Q),I=q[1],C=q[2];break;case"t":dt[0]==="Q"||dt[0]==="q"?(z=I+dt[3]-dt[1],Q=C+dt[4]-dt[2],X.push(A.q2b(I,C,z,Q,I+q[1],C+q[2]))):(dt[0]==="T"||dt[0]==="t")&&(X.push(A.q2b(I,C,I+I-z,C+C-Q,I+q[1],C+q[2])),z=I+I-z,Q=C+C-Q),I+=q[1],C+=q[2];break;case"Z":Z=X[0][0],W=X[0][1],X.push([I,C,Z,W,Z,W,Z,W]);break;case"z":Z=X[0][0],W=X[0][1],X.push([I,C,Z,W,Z,W,Z,W]);break;}}return H;},A._upCurves=function(L,D){for(var I=0,C=0,B=L.length;I<D;I++)L.push(L[C].slice(0)),C++,C>B-1&&(C-=B);};function R(L,D,I,C,B,G,H,X,Z){return{left:b(L,D,I,C,B,G,H,X,Z),right:b(H,X,B,G,I,C,L,D,1-Z,!0)};}function b(L,D,I,C,B,G,H,X,Z,W){var z=(I-L)*Z+L,Q=(C-D)*Z+D,et=(B-I)*Z+I,_=(G-C)*Z+C,st=(H-B)*Z+B,q=(X-G)*Z+G,ht=(et-z)*Z+z,dt=(_-Q)*Z+Q,F=(st-et)*Z+et,U=(q-_)*Z+_,V=(F-ht)*Z+ht,J=(U-dt)*Z+dt;return W?[V,J,ht,dt,z,Q,L,D]:[L,D,z,Q,ht,dt,V,J];}A._splitCurves=function(L,D){for(var I=0,C=0;I<D;I++){var B=L[C],G=R(B[0],B[1],B[2],B[3],B[4],B[5],B[6],B[7],0.5);L.splice(C,1),L.splice(C,0,G.left,G.right),C+=2,C>=L.length-1&&(C=0);}};function P(L,D){for(var I=function I(G){var H=L[L.length-1],X=[];H.forEach(function(Z){X.push(Z.slice(0));}),L.push(X);},C=0;C<D;C++)I();}return A.lerp=function(L,D,I){return A._lerp(A.path2shapes(L),A.path2shapes(D),I);},A.MIM_CURVES_COUNT=100,A._preprocessing=function(L,D){var I=L.length,C=D.length,B=JSON.parse(JSON.stringify(L)),G=JSON.parse(JSON.stringify(D));return I>C?P(G,I-C):I<C&&P(B,C-I),B=d(B,G),B.forEach(function(H,X){var Z=H.length,W=G[X].length;Z>W?Z<A.MIM_CURVES_COUNT?(A._splitCurves(H,A.MIM_CURVES_COUNT-Z),A._splitCurves(G[X],A.MIM_CURVES_COUNT-W)):A._splitCurves(G[X],Z-W):Z<W&&(W<A.MIM_CURVES_COUNT?(A._splitCurves(H,A.MIM_CURVES_COUNT-Z),A._splitCurves(G[X],A.MIM_CURVES_COUNT-W)):A._splitCurves(H,W-Z));}),B.forEach(function(H,X){B[X]=l(H,G[X]);}),[B,G];},A._lerp=function(L,D,I){var C=[];return L.forEach(function(B,G){var H=[];B.forEach(function(X,Z){H.push(A.lerpCurve(X,D[G][Z],I));}),C.push(H);}),C;},A.animate=function(L){var D=A.path2shapes(L.from),I=A.path2shapes(L.to),C=A._preprocessing(D,I),B=/* @__PURE__ */new Date(),G=L.end||function(){},H=L.progress||function(){},X=L.begin||function(){},Z=L.easing||function(_){return _;},W=null,z=null,Q=L.time;X(D);var et=function _(){var st=/* @__PURE__ */new Date()-B;if(st>=Q){z=I,H(z,1),G(z),cancelAnimationFrame(W);return;}var q=Z(st/Q);z=A._lerp(C[0],C[1],q),H(z,q),W=requestAnimationFrame(_);};et();},A;});},/* 228 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return c;});var e=t(71),n=t(221),i=t(72);t(1).glMatrix.setMatrixArrayType(Array);var a=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_setAttribute"),s=Symbol["for"]("spritejs_getAttribute");var c=/*#__PURE__*/function(_e$default3){function c(h){var _this35;_classCallCheck(this,c);_this35=_callSuper(this,c,[h]),_this35[a]({d:"",normalize:!1,fillColor:void 0,fillRule:"nonzero",strokeColor:void 0,lineWidth:1,lineJoin:"miter",// 'miter' or 'bevel' or 'round'
|
|
310
|
-
lineCap:"butt",// 'butt' or 'square' or 'round'
|
|
311
|
-
roundSegments:20,// default roundSegment if lineJoin or lineCap is round
|
|
312
|
-
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,_e$default3);return _createClass(c,[{key:"d",get:function get(){return this[s]("d");},set:function set(h){this[o]("d",h);}},{key:"normalize",get:function get(){return this[s]("normalize");},set:function set(h){this[o]("normalize",!!h);}},{key:"fillColor",get:function get(){return this[s]("fillColor");},set:function set(h){this[o]("fillColor",Object(n.parseColor)(h));}},{key:"fillRule",get:function get(){return this[s]("fillRule");},set:function set(h){if(h!=null&&h!=="nonzero"&&h!=="evenodd")throw new TypeError("Invalid fill rule.");this[o]("fillRule",h);}},{key:"strokeColor",get:function get(){return this[s]("strokeColor");},set:function set(h){this[o]("strokeColor",Object(n.parseColor)(h));}},{key:"lineWidth",get:function get(){return this[s]("lineWidth");},set:function set(h){this[o]("lineWidth",Object(i.toNumber)(h));}},{key:"lineJoin",get:function get(){return this[s]("lineJoin");},set:function set(h){if(h!=null&&h!=="miter"&&h!=="bevel"&&h!=="round")throw new TypeError("Invalid lineJoin type.");this[o]("lineJoin",h);}},{key:"lineCap",get:function get(){return this[s]("lineCap");},set:function set(h){if(h!=null&&h!=="butt"&&h!=="square"&&h!=="round")throw new TypeError("Invalid lineCap type.");this[o]("lineCap",h);}},{key:"lineDash",get:function get(){return this[s]("lineDash");},set:function set(h){h=Object(i.toArray)(h,!0),h!=null&&!Array.isArray(h)&&(h=[h]),this[o]("lineDash",h?h.map(i.toNumber):null);}},{key:"lineDashOffset",get:function get(){return this[s]("lineDashOffset");},set:function set(h){this[o]("lineDashOffset",Object(i.toNumber)(h));}},{key:"miterLimit",get:function get(){return this[s]("miterLimit");},set:function set(h){this[o]("miterLimit",Object(i.toNumber)(h));}},{key:"roundSegments",get:function get(){return this[s]("roundSegments");},set:function set(h){this[o]("roundSegments",h);}},{key:"texture",get:function get(){return this[s]("texture");},set:function set(h){this[o]("texture",h);}},{key:"textureRect",get:function get(){return this[s]("textureRect");},set:function set(h){this[o]("textureRect",h);}},{key:"sourceRect",get:function get(){return this[s]("sourceRect");},set:function set(h){this[o]("sourceRect",h);}},{key:"textureRepeat",get:function get(){return this[s]("textureRepeat");},set:function set(h){this[o]("textureRepeat",!!h);}},{key:"clipPath",get:function get(){return this[s]("clipPath");},set:function set(h){this[o]("clipPath",h);}}]);}(e["default"]);},/* 229 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(226),n=t(213),i=t(230);t(1).glMatrix.setMatrixArrayType(Array);function a(s,c,p){return c in s?Object.defineProperty(s,c,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[c]=p,s;}var o=/*#__PURE__*/function(_e$default4){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default4);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var _this$attributes15=this.attributes,c=_this$attributes15.width,p=_this$attributes15.height;return c>0&&p>0&&_get(_getPrototypeOf(o.prototype),"isVisible",this);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"rect");},/* 230 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return p;});var e=t(228),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol["for"]("spritejs_setAttributeDefault"),a=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute"),s=Symbol["for"]("spritejs_declareAlias");function c(h){var v=h.width,y=h.height;return"M0 0L".concat(v," 0L").concat(v," ").concat(y,"L0 ").concat(y,"Z");}var p=/*#__PURE__*/function(_e$default5){function p(v){var _this36;_classCallCheck(this,p);_this36=_callSuper(this,p,[v]),_this36[i]({width:0,height:0/* size */}),_this36[s]("size");return _this36;}// readonly
|
|
313
|
-
_inherits(p,_e$default5);return _createClass(p,[{key:"d",get:function get(){return this[o]("d");},set:function set(v){}// eslint-disable-line no-empty-function
|
|
314
|
-
},{key:"width",get:function get(){return this[o]("width");},set:function set(v){if(v=Object(n.toNumber)(v),this[a]("width",v)){var y=c(this);this[a]("d",y);}}},{key:"height",get:function get(){return this[o]("height");},set:function set(v){if(v=Object(n.toNumber)(v),this[a]("height",v)){var y=c(this);this[a]("d",y);}}},{key:"size",get:function get(){return[this.width,this.height];},set:function set(v){v=Object(n.toArray)(v),Array.isArray(v)||(v=[v,v]),this.width=v[0],this.height=v[1];}}]);}(e["default"]);},/* 231 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(232),n=t(213),i=t(235);t(1).glMatrix.setMatrixArrayType(Array);function a(s,c,p){return c in s?Object.defineProperty(s,c,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[c]=p,s;}var o=/*#__PURE__*/function(_e$default6){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default6);return _createClass(o,[{key:"isVisible",get:function get(){var c=this.attributes.sides;return c[0]>0&&c[1]>0&&_get(_getPrototypeOf(o.prototype),"isVisible",this);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"triangle");},/* 232 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(226),n=t(213),i=t(233);t(1).glMatrix.setMatrixArrayType(Array);function a(s,c,p){return c in s?Object.defineProperty(s,c,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[c]=p,s;}var o=/*#__PURE__*/function(_e$default7){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default7);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var c=this.attributes.points;return c.length>0&&_get(_getPrototypeOf(o.prototype),"isVisible",this);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"polyline");},/* 233 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return h;});var e=t(228),n=t(72),i=t(234);t(1).glMatrix.setMatrixArrayType(Array);var a=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_setAttribute"),s=Symbol["for"]("spritejs_getAttribute"),c=Symbol["for"]("spritejs_declareAlias");function p(v){var y=v.points,M=v.smooth,T=v.smoothRange,m=v.close,x=[];for(var d=0;d<y.length;d+=2)x.push([y[d],y[d+1]]);var l="";return M?l=Object(i.makeSmoothCurveLine)(x,T):x.length&&(l="M".concat(x.map(function(d){return d.join(" ");}).join("L"))),l&&m&&(l+="Z"),l;}var h=/*#__PURE__*/function(_e$default8){function h(y){var _this37;_classCallCheck(this,h);_this37=_callSuper(this,h,[y]),_this37[a]({points:[],smooth:!1,smoothRange:[0],closeType:"none"// none | normal
|
|
315
|
-
/* close */}),_this37[c]("close");return _this37;}// readonly
|
|
316
|
-
_inherits(h,_e$default8);return _createClass(h,[{key:"d",get:function get(){return this[s]("d");},set:function set(y){}// eslint-disable-line no-empty-function
|
|
317
|
-
},{key:"close",get:function get(){return this.closeType!=="none";},set:function set(y){y=y?"normal":"none",this.closeType=y;}},{key:"closeType",get:function get(){return this[s]("closeType");},set:function set(y){if(y!=null&&y!=="none"&&y!=="normal")throw new TypeError("Invalid closeType type.");if(this[o]("closeType",y)){var M=p(this);this[o]("d",M);}}},{key:"smooth",get:function get(){return this[s]("smooth");},set:function set(y){if(this[o]("smooth",y)){var M=p(this);this[o]("d",M);}}},{key:"smoothRange",get:function get(){return this[s]("smoothRange");},set:function set(y){if(y&&!Array.isArray(y)&&(y=[y]),this[o]("smoothRange",y)&&this.smooth){var M=p(this);this[o]("d",M);}}},{key:"points",get:function get(){return this[s]("points");},set:function set(y){if(y=Object(n.toArray)(y),Array.isArray(y)&&(y=y.reduce(function(M,T){return Array.isArray(T)?[].concat(_toConsumableArray(M),_toConsumableArray(T.map(function(m){return Object(n.toNumber)(m);}))):[].concat(_toConsumableArray(M),[Object(n.toNumber)(T)]);},[])),this[o]("points",y)){var M=p(this);this[o]("d",M);}}}]);}(e["default"]);},/* 234 */ /***/function(u,r,t){t.r(r),t.d(r,"makeSmoothCurveLine",function(){return e;}),t(1).glMatrix.setMatrixArrayType(Array);function e(n){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[0];function a(c){var p=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.168;var h=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0.168;var v,y,M,T;if((n[c].x===n[c+1].x||n[c].y===n[c+1].y)&&(p=0,h=0),c<1?(v=n[0].x+(n[1].x-n[0].x)*p,y=n[0].y+(n[1].y-n[0].y)*p):(v=n[c].x+(n[c+1].x-n[c-1].x)*p,y=n[c].y+(n[c+1].y-n[c-1].y)*p),c>n.length-3){var m=n.length-1;M=n[m].x-(n[m].x-n[m-1].x)*h,T=n[m].y-(n[m].y-n[m-1].y)*h;}else M=n[c+1].x-(n[c+2].x-n[c].x)*h,T=n[c+1].y-(n[c+2].y-n[c].y)*h;return[{x:v,y:y},{x:M,y:T}];}n=n.map(function(_ref142){var _ref143=_slicedToArray(_ref142,2),c=_ref143[0],p=_ref143[1];return{x:c,y:p};});var o="",s=0;return n.forEach(function(c,p){if(p===0)o+="M".concat(c.x," ").concat(c.y);else{for(;p>i[s];)s++;if(s%2){var _a3=a(p-1),_a4=_slicedToArray(_a3,2),h=_a4[0],v=_a4[1];o+="C".concat([h.x,h.y,v.x,v.y,c.x,c.y].join(" "));}else o+="L".concat(c.x," ").concat(c.y);}}),o;}},/* 235 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return c;});var e=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol["for"]("spritejs_setAttributeDefault"),a=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute");function s(p){var _p$sides=_slicedToArray(p.sides,2),h=_p$sides[0],v=_p$sides[1];var y=p.angle%360;return y<0&&(y+=360),y=Math.PI*y/180,[0,0,h,0,v*Math.cos(y),v*Math.sin(y)];}var c=/*#__PURE__*/function(_e$default9){function c(h){var _this38;_classCallCheck(this,c);_this38=_callSuper(this,c,[h]),_this38[i]({sides:[0,0],angle:60,closeType:"normal"});return _this38;}// readonly
|
|
318
|
-
_inherits(c,_e$default9);return _createClass(c,[{key:"points",get:function get(){return _get(_getPrototypeOf(c.prototype),"points",this);},set:function set(h){}// eslint-disable-line no-empty-function
|
|
319
|
-
},{key:"sides",get:function get(){return this[o]("sides");},set:function set(h){if(h=Object(n.toArray)(h,!0),h!=null&&!Array.isArray(h)&&(h=[h,h]),this[a]("sides",h)){var v=s(this);_set(_getPrototypeOf(c.prototype),"points",v,this,true);}}},{key:"angle",get:function get(){return this[o]("angle");},set:function set(h){if(h=Object(n.toNumber)(h),this[a]("angle",h)){var v=s(this);_set(_getPrototypeOf(c.prototype),"points",v,this,true);}}}]);}(e["default"]);},/* 236 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(232),n=t(213),i=t(237);t(1).glMatrix.setMatrixArrayType(Array);function a(s,c,p){return c in s?Object.defineProperty(s,c,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[c]=p,s;}var o=/*#__PURE__*/function(_e$default10){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default10);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var c=this.attributes.sides;return c[0]>0&&c[1]>0&&_get(_getPrototypeOf(o.prototype),"isVisible",this);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"parallel");},/* 237 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return c;});var e=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol["for"]("spritejs_setAttributeDefault"),a=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute");function s(p){var _p$sides2=_slicedToArray(p.sides,2),h=_p$sides2[0],v=_p$sides2[1];var y=p.angle%360;y<0&&(y+=360),y=Math.PI*y/180;var M=v*Math.cos(y),T=v*Math.sin(y);return[0,0,h,0,M+h,T,M,T];}var c=/*#__PURE__*/function(_e$default11){function c(h){var _this39;_classCallCheck(this,c);_this39=_callSuper(this,c,[h]),_this39[i]({sides:[0,0],angle:90,closeType:"normal"});return _this39;}// readonly
|
|
320
|
-
_inherits(c,_e$default11);return _createClass(c,[{key:"points",get:function get(){return _get(_getPrototypeOf(c.prototype),"points",this);},set:function set(h){}// eslint-disable-line no-empty-function
|
|
321
|
-
},{key:"sides",get:function get(){return this[o]("sides");},set:function set(h){if(h=Object(n.toArray)(h,!0),h!=null&&!Array.isArray(h)&&(h=[h,h]),this[a]("sides",h)){var v=s(this);_set(_getPrototypeOf(c.prototype),"points",v,this,true);}}},{key:"angle",get:function get(){return this[o]("angle");},set:function set(h){if(h=Object(n.toNumber)(h),this[a]("angle",h)){var v=s(this);_set(_getPrototypeOf(c.prototype),"points",v,this,true);}}}]);}(e["default"]);},/* 238 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(232),n=t(213),i=t(239);t(1).glMatrix.setMatrixArrayType(Array);function a(s,c,p){return c in s?Object.defineProperty(s,c,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[c]=p,s;}var o=/*#__PURE__*/function(_e$default12){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default12);return _createClass(o);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"regular");},/* 239 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return c;});var e=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol["for"]("spritejs_setAttributeDefault"),a=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute");function s(p){var h=p.edges,v=p.radius,y=p.offsetAngle,M=Math.PI*y/180-0.5*Math.PI;if(h<3||v<=0)return[];var T=[];for(var m=0;m<h;m++){var _x45=m*2*Math.PI/h+M,_l20=v*Math.cos(_x45),d=v*Math.sin(_x45);T.push(_l20,d);}return T;}var c=/*#__PURE__*/function(_e$default13){function c(h){var _this40;_classCallCheck(this,c);_this40=_callSuper(this,c,[h]),_this40[i]({edges:3,radius:0,offsetAngle:0,closeType:"normal"});return _this40;}// readonly
|
|
322
|
-
_inherits(c,_e$default13);return _createClass(c,[{key:"points",get:function get(){return _get(_getPrototypeOf(c.prototype),"points",this);},set:function set(h){}// eslint-disable-line no-empty-function
|
|
323
|
-
},{key:"edges",get:function get(){return this[o]("edges");},set:function set(h){if(h=Object(n.toNumber)(h),this[a]("edges",h)){var v=s(this);_set(_getPrototypeOf(c.prototype),"points",v,this,true);}}},{key:"radius",get:function get(){return this[o]("radius");},set:function set(h){if(h=Object(n.toNumber)(h),this[a]("radius",h)){var v=s(this);_set(_getPrototypeOf(c.prototype),"points",v,this,true);}}},{key:"offsetAngle",get:function get(){return this[o]("offsetAngle");},set:function set(h){if(h=Object(n.toNumber)(h),this[a]("offsetAngle",h)){var v=s(this);_set(_getPrototypeOf(c.prototype),"points",v,this,true);}}}]);}(e["default"]);},/* 240 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(232),n=t(213),i=t(241);t(1).glMatrix.setMatrixArrayType(Array);function a(s,c,p){return c in s?Object.defineProperty(s,c,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[c]=p,s;}var o=/*#__PURE__*/function(_e$default14){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default14);return _createClass(o);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"star");},/* 241 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return c;});var e=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol["for"]("spritejs_setAttributeDefault"),a=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute");function s(p){var h=p.angles,v=p.innerRadius,y=p.outerRadius,M=p.offsetAngle,T=Math.PI*M/180-0.5*Math.PI;if(h<3||v<=0||y<=0)return[];var m=[];for(var _x46=0;_x46<h*2;_x46++){var _l21=_x46*Math.PI/h+T,d=_x46%2?v:y,f=d*Math.cos(_l21),g=d*Math.sin(_l21);m.push(f,g);}return m;}var c=/*#__PURE__*/function(_e$default15){function c(h){var _this41;_classCallCheck(this,c);_this41=_callSuper(this,c,[h]),_this41[i]({angles:5,innerRadius:0,outerRadius:0,/* radius */offsetAngle:0,closeType:"normal"});return _this41;}// readonly
|
|
324
|
-
_inherits(c,_e$default15);return _createClass(c,[{key:"points",get:function get(){return _get(_getPrototypeOf(c.prototype),"points",this);},set:function set(h){}// eslint-disable-line no-empty-function
|
|
325
|
-
},{key:"angles",get:function get(){return this[o]("angles");},set:function set(h){if(h=Object(n.toNumber)(h),this[a]("angles",h)){var v=s(this);_set(_getPrototypeOf(c.prototype),"points",v,this,true);}}},{key:"innerRadius",get:function get(){return this[o]("innerRadius");},set:function set(h){if(h=Object(n.toNumber)(h),this[a]("innerRadius",h)){var v=s(this);_set(_getPrototypeOf(c.prototype),"points",v,this,true);}}},{key:"outerRadius",get:function get(){return this[o]("outerRadius");},set:function set(h){if(h=Object(n.toNumber)(h),this[a]("outerRadius",h)){var v=s(this);_set(_getPrototypeOf(c.prototype),"points",v,this,true);}}},{key:"radius",get:function get(){return[this.innerRadius,this.outerRadius];},set:function set(h){h=Object(n.toArray)(h,!0),Array.isArray(h)||(h=[h,h]),this.innerRadius=h[0],this.outerRadius=h[1];}},{key:"offsetAngle",get:function get(){return this[o]("offsetAngle");},set:function set(h){if(h=Object(n.toNumber)(h),this[a]("offsetAngle",h)){var v=s(this);_set(_getPrototypeOf(c.prototype),"points",v,this,true);}}}]);}(e["default"]);},/* 242 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(226),n=t(213),i=t(243);t(1).glMatrix.setMatrixArrayType(Array);function a(s,c,p){return c in s?Object.defineProperty(s,c,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[c]=p,s;}var o=/*#__PURE__*/function(_e$default16){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default16);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var _this$attributes16=this.attributes,c=_this$attributes16.radiusX,p=_this$attributes16.radiusY,h=_this$attributes16.startAngle,v=_this$attributes16.endAngle;return c>0&&p>0&&h!==v&&_get(_getPrototypeOf(o.prototype),"isVisible",this);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"ellipse");},/* 243 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return h;});var e=t(12),n=t(228),i=t(72);t(1).glMatrix.setMatrixArrayType(Array);var a=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_setAttribute"),s=Symbol["for"]("spritejs_getAttribute"),c=Symbol["for"]("spritejs_declareAlias");function p(v){var y=v.radiusX,M=v.radiusY,T=v.startAngle,m=v.endAngle,x=v.direction,l=v.closeType,d=x==="anitclockwise",f=new e.Figure2D();return l==="sector"&&f.moveTo(0,0),f.ellipse(0,0,y,M,0,Math.PI*T/180,Math.PI*m/180,d),l!=="none"&&f.closePath(),f.path.reduce(function(A,R){return A+R.join(" ");},"");}var h=/*#__PURE__*/function(_n$default2){function h(y){var _this42;_classCallCheck(this,h);_this42=_callSuper(this,h,[y]),_this42[a]({radiusX:0,radiusY:0,/* radius */startAngle:0,endAngle:360,/* angle */direction:"clockwise",// clockwise | anticlockwise
|
|
326
|
-
closeType:"none"// none | sector | normal
|
|
327
|
-
}),_this42[c]("radius","angle");return _this42;}// readonly
|
|
328
|
-
_inherits(h,_n$default2);return _createClass(h,[{key:"d",get:function get(){return this[s]("d");},set:function set(y){}// eslint-disable-line no-empty-function
|
|
329
|
-
},{key:"radiusX",get:function get(){return this[s]("radiusX");},set:function set(y){if(y=Object(i.toNumber)(y),this[o]("radiusX",y)){var M=p(this);this[o]("d",M);}}},{key:"radiusY",get:function get(){return this[s]("radiusY");},set:function set(y){if(y=Object(i.toNumber)(y),this[o]("radiusY",y)){var M=p(this);this[o]("d",M);}}},{key:"radius",get:function get(){return[this.radiusX,this.radiusY];},set:function set(y){y=Object(i.toArray)(y,!0),Array.isArray(y)||(y=[y,y]),this.radiusX=y[0],this.radiusY=y[1];}},{key:"angle",get:function get(){return[this.startAngle,this.endAngle];},set:function set(y){y=Object(i.toArray)(y),Array.isArray(y)||(y=[y,y]),this.startAngle=y[0],this.endAngle=y[1];}},{key:"direction",get:function get(){return this[s]("direction");},set:function set(y){if(y!=null&&y!=="clockwise"&&y!=="anticlockwise")throw new TypeError("Invalid direction type.");this[o]("direction",y);}},{key:"startAngle",get:function get(){return this[s]("startAngle");},set:function set(y){if(y=Object(i.toNumber)(y),this[o]("startAngle",y)){var M=p(this);this[o]("d",M);}}},{key:"endAngle",get:function get(){return this[s]("endAngle");},set:function set(y){if(y=Object(i.toNumber)(y),this[o]("endAngle",y)){var M=p(this);this[o]("d",M);}}},{key:"closeType",get:function get(){return this[s]("closeType");},set:function set(y){if(y!=null&&y!=="none"&&y!=="sector"&&y!=="normal")throw new TypeError("Invalid closeType type.");if(this[o]("closeType",y)){var M=p(this);this[o]("d",M);}}}]);}(n["default"]);},/* 244 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(242),n=t(213),i=t(245);t(1).glMatrix.setMatrixArrayType(Array);function a(s,c,p){return c in s?Object.defineProperty(s,c,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[c]=p,s;}var o=/*#__PURE__*/function(_e$default17){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default17);return _createClass(o);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"arc");},/* 245 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return i;});var e=t(243),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=/*#__PURE__*/function(_e$default18){function i(){_classCallCheck(this,i);return _callSuper(this,i,arguments);}_inherits(i,_e$default18);return _createClass(i,[{key:"radius",get:function get(){return _get(_getPrototypeOf(i.prototype),"radiusX",this);},set:function set(o){o=Object(n.toNumber)(o),_set(_getPrototypeOf(i.prototype),"radiusX",o,this,true),_set(_getPrototypeOf(i.prototype),"radiusY",o,this,true);}}]);}(e["default"]);},/* 246 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(226),n=t(213),i=t(247);t(1).glMatrix.setMatrixArrayType(Array);function a(s,c,p){return c in s?Object.defineProperty(s,c,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[c]=p,s;}var o=/*#__PURE__*/function(_e$default19){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default19);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var _this$attributes17=this.attributes,c=_this$attributes17.innerRadius,p=_this$attributes17.outerRadius,h=_this$attributes17.startAngle,v=_this$attributes17.endAngle;return(c>0||p>0)&&h!==v&&_get(_getPrototypeOf(o.prototype),"isVisible",this);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"ring");},/* 247 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return h;});var e=t(12),n=t(228),i=t(72);t(1).glMatrix.setMatrixArrayType(Array);var a=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_setAttribute"),s=Symbol["for"]("spritejs_getAttribute"),c=Symbol["for"]("spritejs_declareAlias");function p(v){var _ref144;var y=v.innerRadius,M=v.outerRadius,T=v.startAngle,m=v.endAngle;var x=new e.Figure2D();if(T=Math.PI*T/180,m=Math.PI*m/180,y>M&&(_ref144=[M,y],y=_ref144[0],M=_ref144[1],_ref144),y<=0&&x.moveTo(0,0),x.arc(0,0,M,T,m,!1),y>0){var f=Math.PI*2;m<T&&(m=T+f+(m-T)%f),m-T>=f&&(m=T+f-1e-6),x.arc(0,0,y,m,T,!0);}return x.closePath(),x.path.reduce(function(f,g){return f+g.join(" ");},"");}var h=/*#__PURE__*/function(_n$default3){function h(y){var _this43;_classCallCheck(this,h);_this43=_callSuper(this,h,[y]),_this43[a]({innerRadius:0,outerRadius:0,/* radius */startAngle:0,endAngle:360/* angle */}),_this43[c]("radius","angle");return _this43;}// readonly
|
|
330
|
-
_inherits(h,_n$default3);return _createClass(h,[{key:"d",get:function get(){return this[s]("d");},set:function set(y){}// eslint-disable-line no-empty-function
|
|
331
|
-
},{key:"innerRadius",get:function get(){return this[s]("innerRadius");},set:function set(y){if(y=Object(i.toNumber)(y),this[o]("innerRadius",y)){var M=p(this);this[o]("d",M);}}},{key:"outerRadius",get:function get(){return this[s]("outerRadius");},set:function set(y){if(y=Object(i.toNumber)(y),this[o]("outerRadius",y)){var M=p(this);this[o]("d",M);}}},{key:"radius",get:function get(){return[this.innerRadius,this.outerRadius];},set:function set(y){y=Object(i.toArray)(y,!0),Array.isArray(y)||(y=[y,y]),this.innerRadius=y[0],this.outerRadius=y[1];}},{key:"startAngle",get:function get(){return this[s]("startAngle");},set:function set(y){if(y=Object(i.toNumber)(y),this[o]("startAngle",y)){var M=p(this);this[o]("d",M);}}},{key:"endAngle",get:function get(){return this[s]("endAngle");},set:function set(y){if(y=Object(i.toNumber)(y),this[o]("endAngle",y)){var M=p(this);this[o]("d",M);}}},{key:"angle",get:function get(){return[this.startAngle,this.endAngle];},set:function set(y){y=Object(i.toArray)(y),Array.isArray(y)||(y=[y,y]),this.startAngle=y[0],this.endAngle=y[1];}}]);}(n["default"]);},/* 248 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return M;});var e=t(12),n=t(218),i=t(219),a=t(249),o=t(213);t(1).glMatrix.setMatrixArrayType(Array);function s(T,m,x){return m in T?Object.defineProperty(T,m,{value:x,enumerable:!0,configurable:!0,writable:!0}):T[m]=x,T;}var c=Symbol("textImage"),p=Symbol("textImageTask"),h=Symbol("textureContext"),v=Symbol("updateTextureRect"),y=Symbol("textCanvas");var M=/*#__PURE__*/function(_i$default3){function M(){var _this44;var m=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,M);typeof m=="string"&&(m={text:m}),_this44=_callSuper(this,M,[m]);return _this44;}/* override */_inherits(M,_i$default3);return _createClass(M,[{key:"contentSize",get:function get(){var _get4=_get(_getPrototypeOf(M.prototype),"contentSize",this),_get5=_slicedToArray(_get4,2),m=_get5[0],x=_get5[1];var _this$attributes18=this.attributes,l=_this$attributes18.width,d=_this$attributes18.height;if(l==null||d==null){var f=this[c];f&&(l==null&&(m=f.rect[2]),d==null&&(x=f.rect[3]));}return[m,x];}},{key:"text",get:function get(){return this.attributes.text;},set:function set(m){this.attributes.text=m;}},{key:"textContent",get:function get(){return this.attributes.text;},set:function set(m){this.attributes.text=m;}},{key:"textImage",get:function get(){return this[c]||{};}},{key:"textImageReady",get:function get(){return this[p]||Promise.resolve();}/* override */},{key:"draw",value:function draw(m){_get(_getPrototypeOf(M.prototype),"draw",this).call(this,m);var x=this.mesh;if(x){var _l22=this[c];if(_l22){var d=x.texture;if(!d||this[h]&&this[h]!==this.renderer||_l22.needsUpdate?(_l22.needsUpdate=!1,Object(n.deleteTexture)(_l22.image,this.renderer),d=Object(n.createTexture)(_l22.image,this.renderer),this[v]=!0):d=x.uniforms.u_texSampler,this[v]){var _l22$rect$slice=_l22.rect.slice(2),_l22$rect$slice2=_slicedToArray(_l22$rect$slice,2),f=_l22$rect$slice2[0],g=_l22$rect$slice2[1],_this$contentSize4=_slicedToArray(this.contentSize,2),O=_this$contentSize4[0],A=_this$contentSize4[1],R=this.attributes.textAlign,b=this.attributes.verticalAlign;var P=0;R==="center"?P=(O-f)/2:(R==="right"||R==="end")&&(P=O-f);var L=this.attributes.fontSize,D=this.attributes.lineHeight;var I=0;b==="top"?I=(L-D)/2:b==="bottom"&&(I=(D-L)/2);var _this$attributes19=this.attributes,C=_this$attributes19.paddingLeft,B=_this$attributes19.paddingTop,G=this.attributes.borderWidth;P+=C+G,I+=B+G;var _this$attributes20=this.attributes,H=_this$attributes20.anchorX,X=_this$attributes20.anchorY;P-=this.offsetSize[0]*H,I-=this.offsetSize[1]*X,x.setTexture(d,{rect:[P,I,f,g]}),this[v]=!1,this[h]=this.renderer;}}}return m;}/* override */},{key:"onPropertyChange",value:function onPropertyChange(m,x,l){m==="text"||m==="fontSize"||m==="fontFamily"||m==="fontStyle"||m==="fontVariant"||m==="fontWeight"||m==="fontStretch"||m==="lineHeight"||m==="strokeColor"||m==="fillColor"||m==="strokeWidth"?this.updateText():((m==="textAlign"||m==="verticalAlign")&&(this[v]=!0),_get(_getPrototypeOf(M.prototype),"onPropertyChange",this).call(this,m,x,l));}/* override */},{key:"updateContours",value:function updateContours(){_get(_getPrototypeOf(M.prototype),"updateContours",this).call(this),this[v]=!0;}},{key:"updateText",value:function updateText(){var _this45=this;this[p]||(this[p]=Promise.resolve().then(function(){_this45[p]=null;var _this45$attributes=_this45.attributes,m=_this45$attributes.text,x=_this45$attributes.font,l=_this45$attributes.fillColor,d=_this45$attributes.strokeColor,f=_this45$attributes.strokeWidth,g=_this45.layer?_this45.layer.displayRatio:1;return _this45[y]=_this45[y]||e.ENV.createCanvas(1,1),_this45[c]=e.ENV.createText(m,{font:x,fillColor:l,strokeColor:d,strokeWidth:f,parseFont:e.parseFont,ratio:g,textCanvas:_this45[y]}),_this45[c].needsUpdate=!0,_this45.updateContours(),_this45.forceUpdate(),_this45[c];}));}}]);}(i["default"]);s(M,"Attr",a["default"]),o["default"].registerNode(M,"label");},/* 249 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return h;});var e=t(12),n=t(72),i=t(221),a=t(220);t(1).glMatrix.setMatrixArrayType(Array);var o=Symbol["for"]("spritejs_setAttributeDefault"),s=Symbol["for"]("spritejs_setAttribute"),c=Symbol["for"]("spritejs_getAttribute"),p=Symbol["for"]("spritejs_declareAlias");var h=/*#__PURE__*/function(_a$default2){function h(y){var _this46;_classCallCheck(this,h);_this46=_callSuper(this,h,[y]),_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[p]("font");return _this46;}_inherits(h,_a$default2);return _createClass(h,[{key:"text",get:function get(){return this[c]("text")||" ";},set:function set(y){this[s]("text",y);}},{key:"fontSize",get:function get(){return this[c]("fontSize");},set:function set(y){this[s]("fontSize",Object(n.toNumber)(y));}},{key:"fontFamily",get:function get(){return this[c]("fontFamily");},set:function set(y){this[s]("fontFamily",y);}},{key:"fontStyle",get:function get(){return this[c]("fontStyle");},set:function set(y){this[s]("fontStyle",y);}},{key:"fontVariant",get:function get(){return this[c]("fontVariant");},set:function set(y){this[s]("fontVariant",y);}},{key:"fontWeight",get:function get(){return this[c]("fontWeight");},set:function set(y){this[s]("fontWeight",y);}},{key:"fontStretch",get:function get(){return this[c]("fontStretch");},set:function set(y){this[s]("fontStretch",y);}},{key:"lineHeight",get:function get(){return this[c]("lineHeight")||this.fontSize;},set:function set(y){this[s]("lineHeight",Object(n.toNumber)(y));}},{key:"textAlign",get:function get(){return this[c]("textAlign");},set:function set(y){this[s]("textAlign",y);}},{key:"strokeColor",get:function get(){return this[c]("strokeColor");},set:function set(y){this[s]("strokeColor",Object(i.parseColor)(y));}},{key:"strokeWidth",get:function get(){return this[c]("strokeWidth");},set:function set(y){this[s]("strokeWidth",Object(n.toNumber)(y));}},{key:"verticalAlign",get:function get(){return this[c]("verticalAlign");},set:function set(y){this[s]("verticalAlign",y);}},{key:"fillColor",get:function get(){return this[c]("fillColor");},set:function set(y){this[s]("fillColor",Object(i.parseColor)(y));}},{key:"font",get:function get(){var y=this.fontStyle,M=this.fontVariant,T=this.fontWeight,m=this.fontStretch,x=this.fontSize,l=this.lineHeight,d=this.fontFamily;return"".concat(y," ").concat(M," ").concat(T," ").concat(m," ").concat(x,"px/").concat(l,"px ").concat(d);},set:function set(y){if(y==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(e.parseFont)(y);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;}}}]);}(a["default"]);},/* 250 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return y;});var e=t(12),n=t(219),i=t(251),a=t(213),o=t(252);t(1).glMatrix.setMatrixArrayType(Array);function s(M,T,m){return T in M?Object.defineProperty(M,T,{value:m,enumerable:!0,configurable:!0,writable:!0}):M[T]=m,M;}var c=Symbol("zOrder"),p=Symbol("ordered"),h=Symbol("children"),v=Symbol("sealed");var y=/*#__PURE__*/function(_n$default4){function y(){var _this47;var T=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,y);_this47=_callSuper(this,y,[T]),_this47[h]=[],_this47[p]=null,_this47[c]=0;return _this47;}_inherits(y,_n$default4);return _createClass(y,[{key:"childNodes",get:function get(){return this[h];}},{key:"children",get:function get(){return this[h];}},{key:"orderedChildren",get:function get(){return this[p]||(this[p]=_toConsumableArray(this[h]),this[p].sort(function(T,m){return T.zIndex-m.zIndex||T.zOrder-m.zOrder;})),this[p];}},{key:"append",value:function append(){var _this48=this;for(var _len12=arguments.length,T=new Array(_len12),_key12=0;_key12<_len12;_key12++){T[_key12]=arguments[_key12];}return T.map(function(m){return _this48.appendChild(m);});}},{key:"appendChild",value:function appendChild(T){return T.remove(),this[h].push(T),T.connect(this,this[c]++),this[p]&&(this[p].length&&T.zIndex<this[p][this[p].length-1].zIndex?this.reorder():this[p].push(T)),T;}/* override */ // get isVisible() {
|
|
332
|
-
// return this.attributes.opacity > 0 && this[_children].length > 0;
|
|
333
|
-
// }
|
|
334
|
-
/* override */},{key:"cloneNode",value:function cloneNode(){var T=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;var m=_get(_getPrototypeOf(y.prototype),"cloneNode",this).call(this);return T&&this[h].forEach(function(x){var l=x.cloneNode(T);m.appendChild(l);}),m;}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(T){var m=this.orderedChildren;for(var _x47=m.length-1;_x47>=0;_x47--)if(m[_x47].dispatchPointerEvent(T))return!0;return _get(_getPrototypeOf(y.prototype),"dispatchPointerEvent",this).call(this,T);}/* override */},{key:"draw",value:function draw(){var T=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];if(this.__cacheRenderMatrix=this.renderMatrix,_get(_getPrototypeOf(y.prototype),"draw",this).call(this,T),!this[v]&&this.attributes.display!=="none"){var m=this.orderedChildren;for(var _x48=0;_x48<m.length;_x48++)m[_x48].draw(T);}return this.__cacheRenderMatrix=null,T;}},{key:"getElementById",value:function getElementById(T){return Object(o.querySelector)("#".concat(T),this);}},{key:"getElementsByClassName",value:function getElementsByClassName(T){return Object(o.querySelectorAll)(".".concat(T),this);}},{key:"getElementsByName",value:function getElementsByName(T){return Object(o.querySelectorAll)("[name=\"".concat(T,"\"]"),this);}},{key:"getElementsByTagName",value:function getElementsByTagName(T){return Object(o.querySelectorAll)(T,this);}},{key:"insertBefore",value:function insertBefore(T,m){if(m==null)return this.appendChild(T);T.remove();var x=this[h].indexOf(m);if(x<0)throw new Error("Invalid reference node.");var l=m.zOrder;for(var d=x;d<this[h].length;d++){var f=this[h][d].zOrder,g=this[h][d];delete g.zOrder,Object.defineProperty(g,"zOrder",{value:f+1,writable:!1,configurable:!0});}if(this[h].splice(x,0,T),T.connect(this,l),this[p])if(T.zIndex!==m.zIndex)this.reorder();else{var _d12=this[p].indexOf(m);this[p].splice(_d12,0,T);}return T;}},{key:"querySelector",value:function querySelector(T){return Object(o.querySelector)(T,this);}},{key:"querySelectorAll",value:function querySelectorAll(T){return Object(o.querySelectorAll)(T,this);}},{key:"replaceChild",value:function replaceChild(T,m){T.remove();var x=this[h].indexOf(m);if(x<0)throw new Error("Invalid reference node.");if(this[h][x]=T,T.connect(this,m.zOrder),this[p])if(T.zIndex!==m.zIndex)this.reorder();else{var _l23=this[p].indexOf(m);this[p][_l23]=T;}return m.disconnect(this),T;}},{key:"removeAllChildren",value:function removeAllChildren(){var T=this[h];for(var m=T.length-1;m>=0;m--)T[m].remove();}},{key:"removeChild",value:function removeChild(T){var m=this[h].indexOf(T);if(m>=0){if(this[h].splice(m,1),this[p]){var _x49=this[p].indexOf(T);this[p].splice(_x49,1);}return T.disconnect(this),T;}return null;}},{key:"reorder",value:function reorder(){this[p]=null;}},{key:"seal",value:function seal(){function T(d,f){var g=[];for(var O=0;O<d.length;O++){var A=_toConsumableArray(d[O]);for(var R=1;R<A.length;R+=2){var b=A[R],P=A[R+1];A[R]=b*f[0]+P*f[2]+f[4],A[R+1]=b*f[1]+P*f[3]+f[5];}g.push(A);}return g;}var m=this.orderedChildren,x=new e.Figure2D(),l=this.localMatrix;for(var d=0;d<m.length;d++){var f=m[d];if(f instanceof y&&(f=f.seal()),f.clientBox){var g=f.clientBox.contours.path;g=T(g,f.localMatrix),x.addPath(g);}if(f.path){var _g8=f.path.contours.path;_g8=T(_g8,f.localMatrix),x.addPath(_g8);}}return this[v]=!0,this.clientBox=x,{clientBox:x,localMatrix:l};}/* override */},{key:"setResolution",value:function setResolution(_ref145){var T=_ref145.width,m=_ref145.height;_get(_getPrototypeOf(y.prototype),"setResolution",this).call(this,{width:T,height:m}),this[h].forEach(function(x){x.setResolution({width:T,height:m});});}/* override */},{key:"updateContours",value:function updateContours(){this[v]||_get(_getPrototypeOf(y.prototype),"updateContours",this).call(this);}}]);}(n["default"]);s(y,"Attr",i["default"]),a["default"].registerNode(y,"group");},/* 251 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return n;});var e=t(220);t(1).glMatrix.setMatrixArrayType(Array);var n=/*#__PURE__*/function(_e$default20){function n(){_classCallCheck(this,n);return _callSuper(this,n,arguments);}_inherits(n,_e$default20);return _createClass(n);}(e["default"]);},/* 252 */ /***/function(u,r,t){t.r(r),t.d(r,"querySelectorAll",function(){return v;}),t.d(r,"querySelector",function(){return y;}),t.d(r,"isMatched",function(){return M;}),t.d(r,"compile",function(){return T;});var e=t(221),n=t(213);t(1).glMatrix.setMatrixArrayType(Array);var i=t(253);function a(m){return m.nodeType===1||n["default"].isSpriteNode(m.nodeName);}function o(m){return Array.from(m.childNodes||[]);}function s(m){return n["default"].isSpriteNode(m.nodeName)?m.parent||m.canvas||m.container:m.parentElement;}function c(m){var x=m.length,l,d,f;for(;--x>-1;){for(l=d=m[x],m[x]=null,f=!0;d;){if(m.indexOf(d)>-1){f=!1,m.splice(x,1);break;}d=s(d);}f&&(m[x]=l);}return m;}var p={isTag:a,existsOne:function existsOne(m,x){return x.some(function(l){return a(l)?m(l)||p.existsOne(m,o(l)):!1;});},getSiblings:function getSiblings(m){var x=s(m);return x&&o(x);},getChildren:o,getParent:s,getAttributeValue:function getAttributeValue(m,x){if(m.nodeType===1&&x==="class"||x==="id")return m[x];if(this.hasAttrib(m,x)){var _l24=m.attributes[x];return Array.isArray(_l24)&&(_l24="[".concat(_l24.join(),"]")),String(_l24);}},hasAttrib:function hasAttrib(m,x){return m.attributes[x]!=null;},removeSubsets:c,getName:function getName(m){return m.tagName?m.tagName.toLowerCase():null;},findOne:function m(x,l){var d=null;for(var f=0,g=l.length;f<g&&!d;f++)if(x(l[f]))d=l[f];else{var O=o(l[f]);O&&O.length>0&&(d=m(x,O));}return d;},findAll:function m(x,l){var d=[];for(var f=0,g=l.length;f<g;f++){if(!a(l[f]))continue;x(l[f])&&d.push(l[f]);var O=o(l[f]);O&&(d=d.concat(m(x,O)));}return d;},getText:function m(x){return Array.isArray(x)?x.map(m).join(""):a(x)?m(o(x)):x.nodeType===3?x.nodeValue:n["default"].isSpriteNode(x.nodeName)?x.text:"";}};function h(m){if(typeof m!="string")return m;var x=m.match(/\[(bgcolor|fillColor|strokeColor|color)\s*=\s*['"]?\w+['"]?\]/g);return x&&(x=x.map(function(l){var d=l.slice(1,-1).split("="),f=Object(e.parseColor)(d[1].replace(/['"]/g,""));return[l,"[".concat(d[0],"=\"").concat(f,"\"]")];}),x.forEach(function(_ref146){var _ref147=_slicedToArray(_ref146,2),l=_ref147[0],d=_ref147[1];m=m.replace(l,d);})),x=m.match(/\[\w+\s*=\s*['"]\[.+?\]['"]\]/g),x&&(x=x.map(function(l){var d=l.slice(1,-1).split("="),f=d[1].slice(2,-2).split(/,/g).map(function(g){return g.trim();});return[l,"[".concat(d[0],"=\"[").concat(f,"]\"]")];}),x.forEach(function(_ref148){var _ref149=_slicedToArray(_ref148,2),l=_ref149[0],d=_ref149[1];m=m.replace(l,d);})),m;}function v(m,x){return i.selectAll(h(m),x,{adapter:p});}function y(m,x){return i.selectOne(h(m),x,{adapter:p});}function M(m,x){return i.is(m,h(x),{adapter:p});}function T(m){return i.compile(h(m),{adapter:p});}},/* 253 */ /***/function(u,r,t){u.exports=T;var e=t(254),n=t(273).falseFunc,i=t(274);function a(m){return function(l,d,f){return d=d||{},d.adapter=d.adapter||e,m(l,d,f);};}var o=a(i),s=a(i.compileUnsafe);function c(m){return function(l,d,f){return f=f||{},f.adapter=f.adapter||e,typeof l!="function"&&(l=s(l,f,d)),l.shouldTestNextSiblings&&(d=h(f&&f.context||d,f.adapter)),Array.isArray(d)?d=f.adapter.removeSubsets(d):d=f.adapter.getChildren(d),m(l,d,f);};}function p(m,x){var l=x.getSiblings(m);if(!Array.isArray(l))return[];for(l=l.slice(0);l.shift()!==m;);return l;}function h(m,x){Array.isArray(m)||(m=[m]);for(var l=m.slice(0),d=0,f=m.length;d<f;d++){var g=p(l[d],x);l.push.apply(l,g);}return l;}var v=c(function(x,l,d){return x===n||!l||l.length===0?[]:d.adapter.findAll(x,l);}),y=c(function(x,l,d){return x===n||!l||l.length===0?null:d.adapter.findOne(x,l);});function M(m,x,l){return l=l||{},l.adapter=l.adapter||e,(typeof x=="function"?x:o(x,l))(m);}function T(m,x,l){return v(m,x,l);}T.compile=o,T.filters=i.Pseudos.filters,T.pseudos=i.Pseudos.pseudos,T.selectAll=v,T.selectOne=y,T.is=M,T.parse=o,T.iterate=v,T._compileUnsafe=s,T._compileToken=i.compileToken;},/* 254 */ /***/function(u,r,t){var e=u.exports;[t(255),t(268),t(269),t(270),t(271),t(272)].forEach(function(n){Object.keys(n).forEach(function(i){e[i]=n[i].bind(e);});});},/* 255 */ /***/function(u,r,t){var e=t(256),n=t(257),i=e.isTag;u.exports={getInnerHTML:a,getOuterHTML:n,getText:o};function a(s,c){return s.children?s.children.map(function(p){return n(p,c);}).join(""):"";}function o(s){return Array.isArray(s)?s.map(o).join(""):i(s)?s.name==="br"?"\n":o(s.children):s.type===e.CDATA?o(s.children):s.type===e.Text?s.data:"";}},/* 256 */ /***/function(u,r){u.exports={Text:"text",//Text
|
|
335
|
-
Directive:"directive",//<? ... ?>
|
|
336
|
-
Comment:"comment",//<!-- ... -->
|
|
337
|
-
Script:"script",//<script> tags
|
|
338
|
-
Style:"style",//<style> tags
|
|
339
|
-
Tag:"tag",//Any tag
|
|
340
|
-
CDATA:"cdata",//<![CDATA[ ... ]]>
|
|
341
|
-
Doctype:"doctype",isTag:function isTag(t){return t.type==="tag"||t.type==="script"||t.type==="style";}};},/* 257 */ /***/function(u,r,t){var e=t(258),n=t(259),i=t(267);i.elementNames.__proto__=null,i.attributeNames.__proto__=null;var a={__proto__:null,style:!0,script:!0,xmp:!0,iframe:!0,noembed:!0,noframes:!0,plaintext:!0,noscript:!0};function o(m,x){if(m){var l="",d;for(var f in m)d=m[f],l&&(l+=" "),x.xmlMode==="foreign"&&(f=i.attributeNames[f]||f),l+=f,(d!==null&&d!==""||x.xmlMode)&&(l+='="'+(x.decodeEntities?n.encodeXML(d):d.replace(/\"/g,"""))+'"');return l;}}var s={__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(m,x){!Array.isArray(m)&&!m.cheerio&&(m=[m]),x=x||{};for(var l="",d=0;d<m.length;d++){var f=m[d];f.type==="root"?l+=c(f.children,x):e.isTag(f)?l+=h(f,x):f.type===e.Directive?l+=v(f):f.type===e.Comment?l+=T(f):f.type===e.CDATA?l+=M(f):l+=y(f,x);}return l;},p=["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"];function h(m,x){x.xmlMode==="foreign"&&(m.name=i.elementNames[m.name]||m.name,m.parent&&p.indexOf(m.parent.name)>=0&&(x=Object.assign({},x,{xmlMode:!1}))),!x.xmlMode&&["svg","math"].indexOf(m.name)>=0&&(x=Object.assign({},x,{xmlMode:"foreign"}));var l="<"+m.name,d=o(m.attribs,x);return d&&(l+=" "+d),x.xmlMode&&(!m.children||m.children.length===0)?l+="/>":(l+=">",m.children&&(l+=c(m.children,x)),(!s[m.name]||x.xmlMode)&&(l+="</"+m.name+">")),l;}function v(m){return"<"+m.data+">";}function y(m,x){var l=m.data||"";return x.decodeEntities&&!(m.parent&&m.parent.name in a)&&(l=n.encodeXML(l)),l;}function M(m){return"<![CDATA["+m.children[0].data+"]]>";}function T(m){return"<!--"+m.data+"-->";}},/* 258 */ /***/function(u,r,t){Object.defineProperty(r,"__esModule",{value:!0});function e(n){return n.type==="tag"||n.type==="script"||n.type==="style";}r.isTag=e,r.Text="text",r.Directive="directive",r.Comment="comment",r.Script="script",r.Style="style",r.Tag="tag",r.CDATA="cdata",r.Doctype="doctype";},/* 259 */ /***/function(u,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r.encode=r.decodeStrict=r.decode=void 0;var e=t(260),n=t(266);function i(p,h){return(!h||h<=0?e.decodeXML:e.decodeHTML)(p);}r.decode=i;function a(p,h){return(!h||h<=0?e.decodeXML:e.decodeHTMLStrict)(p);}r.decodeStrict=a;function o(p,h){return(!h||h<=0?n.encodeXML:n.encodeHTML)(p);}r.encode=o;var s=t(266);Object.defineProperty(r,"encodeXML",{enumerable:!0,get:function get(){return s.encodeXML;}}),Object.defineProperty(r,"encodeHTML",{enumerable:!0,get:function get(){return s.encodeHTML;}}),Object.defineProperty(r,"escape",{enumerable:!0,get:function get(){return s.escape;}}),Object.defineProperty(r,"encodeHTML4",{enumerable:!0,get:function get(){return s.encodeHTML;}}),Object.defineProperty(r,"encodeHTML5",{enumerable:!0,get:function get(){return s.encodeHTML;}});var c=t(260);Object.defineProperty(r,"decodeXML",{enumerable:!0,get:function get(){return c.decodeXML;}}),Object.defineProperty(r,"decodeHTML",{enumerable:!0,get:function get(){return c.decodeHTML;}}),Object.defineProperty(r,"decodeHTMLStrict",{enumerable:!0,get:function get(){return c.decodeHTMLStrict;}}),Object.defineProperty(r,"decodeHTML4",{enumerable:!0,get:function get(){return c.decodeHTML;}}),Object.defineProperty(r,"decodeHTML5",{enumerable:!0,get:function get(){return c.decodeHTML;}}),Object.defineProperty(r,"decodeHTML4Strict",{enumerable:!0,get:function get(){return c.decodeHTMLStrict;}}),Object.defineProperty(r,"decodeHTML5Strict",{enumerable:!0,get:function get(){return c.decodeHTMLStrict;}}),Object.defineProperty(r,"decodeXMLStrict",{enumerable:!0,get:function get(){return c.decodeXML;}});},/* 260 */ /***/function(u,r,t){var e=this&&this.__importDefault||function(h){return h&&h.__esModule?h:{"default":h};};Object.defineProperty(r,"__esModule",{value:!0}),r.decodeHTML=r.decodeHTMLStrict=r.decodeXML=void 0;var n=e(t(261)),i=e(t(262)),a=e(t(263)),o=e(t(264));r.decodeXML=s(a["default"]),r.decodeHTMLStrict=s(n["default"]);function s(h){var v=Object.keys(h).join("|"),y=p(h);v+="|#[xX][\\da-fA-F]+|#\\d+";var M=new RegExp("&(?:"+v+");","g");return function(T){return String(T).replace(M,y);};}var c=function c(h,v){return h<v?1:-1;};r.decodeHTML=function(){for(var h=Object.keys(i["default"]).sort(c),v=Object.keys(n["default"]).sort(c),y=0,M=0;y<v.length;y++)h[M]===v[y]?(v[y]+=";?",M++):v[y]+=";";var T=new RegExp("&(?:"+v.join("|")+"|#[xX][\\da-fA-F]+;?|#\\d+;?)","g"),m=p(n["default"]);function x(l){return l.substr(-1)!==";"&&(l+=";"),m(l);}return function(l){return String(l).replace(T,x);};}();function p(h){return function(y){if(y.charAt(1)==="#"){var M=y.charAt(2);return M==="X"||M==="x"?o["default"](parseInt(y.substr(3),16)):o["default"](parseInt(y.substr(2),10));}return h[y.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,r,t){var e=this&&this.__importDefault||function(a){return a&&a.__esModule?a:{"default":a};};Object.defineProperty(r,"__esModule",{value:!0});var n=e(t(265));function i(a){if(a>=55296&&a<=57343||a>1114111)return"�";a in n["default"]&&(a=n["default"][a]);var o="";return a>65535&&(a-=65536,o+=String.fromCharCode(a>>>10&1023|55296),a=56320|a&1023),o+=String.fromCharCode(a),o;}r["default"]=i;},/* 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,r,t){var e=this&&this.__importDefault||function(x){return x&&x.__esModule?x:{"default":x};};Object.defineProperty(r,"__esModule",{value:!0}),r.escape=r.encodeHTML=r.encodeXML=void 0;var n=e(t(263)),i=p(n["default"]),a=h(i);r.encodeXML=M(i,a);var o=e(t(261)),s=p(o["default"]),c=h(s);r.encodeHTML=M(s,c);function p(x){return Object.keys(x).sort().reduce(function(l,d){return l[x[d]]="&"+d+";",l;},{});}function h(x){for(var l=[],d=[],f=0,g=Object.keys(x);f<g.length;f++){var O=g[f];O.length===1?l.push("\\"+O):d.push(O);}l.sort();for(var A=0;A<l.length-1;A++){for(var R=A;R<l.length-1&&l[R].charCodeAt(1)+1===l[R+1].charCodeAt(1);)R+=1;var b=1+R-A;b<3||l.splice(A,b,l[A]+"-"+l[R]);}return d.unshift("["+l.join("")+"]"),new RegExp(d.join("|"),"g");}var v=/(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g;function y(x){return"&#x"+x.codePointAt(0).toString(16).toUpperCase()+";";}function M(x,l){return function(d){return d.replace(l,function(f){return x[f];}).replace(v,y);};}var T=h(i);function m(x){return x.replace(T,y).replace(v,y);}r.escape=m;},/* 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,r){var t=r.getChildren=function(n){return n.children;},e=r.getParent=function(n){return n.parent;};r.getSiblings=function(n){var i=e(n);return i?t(i):[n];},r.getAttributeValue=function(n,i){return n.attribs&&n.attribs[i];},r.hasAttrib=function(n,i){return!!n.attribs&&hasOwnProperty.call(n.attribs,i);},r.getName=function(n){return n.name;};},/* 269 */ /***/function(u,r){r.removeElement=function(t){if(t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t.parent){var e=t.parent.children;e.splice(e.lastIndexOf(t),1);}},r.replaceElement=function(t,e){var n=e.prev=t.prev;n&&(n.next=e);var i=e.next=t.next;i&&(i.prev=e);var a=e.parent=t.parent;if(a){var o=a.children;o[o.lastIndexOf(t)]=e;}},r.appendChild=function(t,e){if(e.parent=t,t.children.push(e)!==1){var n=t.children[t.children.length-2];n.next=e,e.prev=n,e.next=null;}},r.append=function(t,e){var n=t.parent,i=t.next;if(e.next=i,e.prev=t,t.next=e,e.parent=n,i){if(i.prev=e,n){var a=n.children;a.splice(a.lastIndexOf(i),0,e);}}else n&&n.children.push(e);},r.prepend=function(t,e){var n=t.parent;if(n){var i=n.children;i.splice(i.lastIndexOf(t),0,e);}t.prev&&(t.prev.next=e),e.parent=n,e.prev=t.prev,e.next=t,t.prev=e;};},/* 270 */ /***/function(u,r,t){var e=t(256).isTag;u.exports={filter:n,find:i,findOneChild:a,findOne:o,existsOne:s,findAll:c};function n(p,h,v,y){return Array.isArray(h)||(h=[h]),(typeof y!="number"||!isFinite(y))&&(y=1/0),i(p,h,v!==!1,y);}function i(p,h,v,y){for(var M=[],T,m=0,x=h.length;m<x&&!(p(h[m])&&(M.push(h[m]),--y<=0)||(T=h[m].children,v&&T&&T.length>0&&(T=i(p,T,v,y),M=M.concat(T),y-=T.length,y<=0)));m++);return M;}function a(p,h){for(var v=0,y=h.length;v<y;v++)if(p(h[v]))return h[v];return null;}function o(p,h){for(var v=null,y=0,M=h.length;y<M&&!v;y++)if(e(h[y]))p(h[y])?v=h[y]:h[y].children.length>0&&(v=o(p,h[y].children));else continue;return v;}function s(p,h){for(var v=0,y=h.length;v<y;v++)if(e(h[v])&&(p(h[v])||h[v].children.length>0&&s(p,h[v].children)))return!0;return!1;}function c(p,h){for(var v=[],y=h.slice();y.length;){var M=y.shift();e(M)&&(M.children&&M.children.length>0&&y.unshift.apply(y,M.children),p(M)&&v.push(M));}return v;}},/* 271 */ /***/function(u,r,t){var e=t(256),n=r.isTag=e.isTag;r.testElement=function(s,c){for(var p in s)if(s.hasOwnProperty(p)){if(p==="tag_name"){if(!n(c)||!s.tag_name(c.name))return!1;}else if(p==="tag_type"){if(!s.tag_type(c.type))return!1;}else if(p==="tag_contains"){if(n(c)||!s.tag_contains(c.data))return!1;}else if(!c.attribs||!s[p](c.attribs[p]))return!1;}return!0;};var i={tag_name:function tag_name(s){return typeof s=="function"?function(c){return n(c)&&s(c.name);}:s==="*"?n:function(c){return n(c)&&c.name===s;};},tag_type:function tag_type(s){return typeof s=="function"?function(c){return s(c.type);}:function(c){return c.type===s;};},tag_contains:function tag_contains(s){return typeof s=="function"?function(c){return!n(c)&&s(c.data);}:function(c){return!n(c)&&c.data===s;};}};function a(s,c){return typeof c=="function"?function(p){return p.attribs&&c(p.attribs[s]);}:function(p){return p.attribs&&p.attribs[s]===c;};}function o(s,c){return function(p){return s(p)||c(p);};}r.getElements=function(s,c,p,h){var v=Object.keys(s).map(function(y){var M=s[y];return y in i?i[y](M):a(y,M);});return v.length===0?[]:this.filter(v.reduce(o),c,p,h);},r.getElementById=function(s,c,p){return Array.isArray(c)||(c=[c]),this.findOne(a("id",s),c,p!==!1);},r.getElementsByTagName=function(s,c,p,h){return this.filter(i.tag_name(s),c,p,h);},r.getElementsByTagType=function(s,c,p,h){return this.filter(i.tag_type(s),c,p,h);};},/* 272 */ /***/function(u,r){r.removeSubsets=function(n){for(var i=n.length,a,o,s;--i>-1;){for(a=o=n[i],n[i]=null,s=!0;o;){if(n.indexOf(o)>-1){s=!1,n.splice(i,1);break;}o=o.parent;}s&&(n[i]=a);}return n;};var t={DISCONNECTED:1,PRECEDING:2,FOLLOWING:4,CONTAINS:8,CONTAINED_BY:16},e=r.compareDocumentPosition=function(n,i){var a=[],o=[],s,c,p,h,v,y;if(n===i)return 0;for(s=n;s;)a.unshift(s),s=s.parent;for(s=i;s;)o.unshift(s),s=s.parent;for(y=0;a[y]===o[y];)y++;return y===0?t.DISCONNECTED:(c=a[y-1],p=c.children,h=a[y],v=o[y],p.indexOf(h)>p.indexOf(v)?c===i?t.FOLLOWING|t.CONTAINED_BY:t.FOLLOWING:c===n?t.PRECEDING|t.CONTAINS:t.PRECEDING);};r.uniqueSort=function(n){var i=n.length,a,o;for(n=n.slice();--i>-1;)a=n[i],o=n.indexOf(a),o>-1&&o<i&&n.splice(i,1);return n.sort(function(s,c){var p=e(s,c);return p&t.PRECEDING?-1:p&t.FOLLOWING?1:0;}),n;};},/* 273 */ /***/function(u,r){u.exports={trueFunc:function trueFunc(){return!0;},falseFunc:function falseFunc(){return!1;}};},/* 274 */ /***/function(u,r,t){u.exports=v;var e=t(275).parse,n=t(273),i=t(278),a=t(279),o=t(280),s=t(282),c=n.trueFunc,p=n.falseFunc,h=s.filters;function v(P,L,D){var I=M(P,L,D);return y(I,L);}function y(P,L){var D=L.adapter;return function(C){return D.isTag(C)&&P(C);};}function M(P,L,D){var I=e(P,L);return g(I,L,D);}function T(P){return P.type==="pseudo"&&(P.name==="scope"||Array.isArray(P.data)&&P.data.some(function(L){return L.some(T);}));}var m={type:"descendant"},x={type:"_flexibleDescendant"},l={type:"pseudo",name:"scope"},d={};function f(P,L,D){var I=L.adapter,C=!!D&&!!D.length&&D.every(function(B){return B===d||!!I.getParent(B);});P.forEach(function(B){if(!(B.length>0&&O(B[0])&&B[0].type!=="descendant"))if(C&&!(Array.isArray(B)?B.some(T):T(B)))B.unshift(m);else return;B.unshift(l);});}function g(P,L,D){P=P.filter(function(G){return G.length>0;}),P.forEach(i);var I=Array.isArray(D);D=L&&L.context||D,D&&!I&&(D=[D]),f(P,L,D);var C=!1,B=P.map(function(G){if(G[0]&&G[1]&&G[0].name==="scope"){var H=G[1].type;I&&H==="descendant"?G[1]=x:(H==="adjacent"||H==="sibling")&&(C=!0);}return A(G,L,D);}).reduce(R,p);return B.shouldTestNextSiblings=C,B;}function O(P){return a[P.type]<0;}function A(P,L,D){return P.reduce(function(I,C){if(I===p)return I;if(!(C.type in o))throw new Error("Rule type "+C.type+" is not supported by css-select");return o[C.type](I,C,L,D);},L&&L.rootFunc||c);}function R(P,L){return L===p||P===c?P:P===p||L===c?L:function(I){return P(I)||L(I);};}function b(P){return P.some(O);}h.not=function(P,L,D,I){var C={xmlMode:!!(D&&D.xmlMode),strict:!!(D&&D.strict),adapter:D.adapter};if(C.strict&&(L.length>1||L.some(b)))throw new Error("complex selectors in :not aren't allowed in strict mode");var B=g(L,C,I);return B===p?P:B===c?p:function(H){return!B(H)&&P(H);};},h.has=function(P,L,D){var I=D.adapter,C={xmlMode:!!(D&&D.xmlMode),strict:!!(D&&D.strict),adapter:I},B=L.some(b)?[d]:null,G=g(L,C,B);return G===p?p:G===c?function(X){return I.getChildren(X).some(I.isTag)&&P(X);}:(G=y(G,D),B?function(X){return P(X)&&(B[0]=X,I.existsOne(G,I.getChildren(X)));}:function(X){return P(X)&&I.existsOne(G,I.getChildren(X));});},h.matches=function(P,L,D,I){var C={xmlMode:!!(D&&D.xmlMode),strict:!!(D&&D.strict),rootFunc:P,adapter:D.adapter};return g(L,C,I);},v.compileToken=g,v.compileUnsafe=M,v.Pseudos=s;},/* 275 */ /***/function(u,r,t){var e=this&&this.__createBinding||(Object.create?function(o,s,c,p){p===void 0&&(p=c),Object.defineProperty(o,p,{enumerable:!0,get:function get(){return s[c];}});}:function(o,s,c,p){p===void 0&&(p=c),o[p]=s[c];}),n=this&&this.__exportStar||function(o,s){for(var c in o)c!=="default"&&!s.hasOwnProperty(c)&&e(s,o,c);};Object.defineProperty(r,"__esModule",{value:!0}),n(t(276),r);var i=t(276);Object.defineProperty(r,"parse",{enumerable:!0,get:function get(){return i["default"];}});var a=t(277);Object.defineProperty(r,"stringify",{enumerable:!0,get:function get(){return a["default"];}});},/* 276 */ /***/function(u,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r["default"]=T;var e=/^[^\\]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/,n=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,i=/^\s*((?:\\.|[\w\u00b0-\uFFFF-])+)\s*(?:(\S?)=\s*(?:(['"])([^]*?)\3|(#?(?:\\.|[\w\u00b0-\uFFFF-])*)|)|)\s*(i)?\]/,a={undefined:"exists","":"equals","~":"element","^":"start",$:"end","*":"any","!":"not","|":"hyphen"},o={">":"child","<":"parent","~":"sibling","+":"adjacent"},s={"#":["id","equals"],".":["class","element"]},c=/* @__PURE__ */new Set(["has","not","matches"]),p=/* @__PURE__ */new Set(["contains","icontains"]),h=/* @__PURE__ */new Set(['"',"'"]);function v(l,d,f){var g=parseInt(d,16)-65536;return g!==g||f?d:g<0?// BMP codepoint
|
|
342
|
-
String.fromCharCode(g+65536):// Supplemental Plane codepoint (surrogate pair)
|
|
343
|
-
String.fromCharCode(g>>10|55296,g&1023|56320);}function y(l){return l.replace(n,v);}function M(l){return l===" "||l==="\n"||l===" "||l==="\f"||l==="\r";}function T(l,d){var f=[];if(l=m(f,""+l,d),l!=="")throw new Error("Unmatched selector: "+l);return f;}function m(l,d,f){var g=[],O=!1;function A(){var Q=d.match(e);if(!Q)throw new Error("Expected name, found "+d);var et=Q[0];return d=d.substr(et.length),y(et);}function R(Q){for(;M(d.charAt(Q));)Q++;d=d.substr(Q);}function b(Q){for(var et=0;d.charAt(--Q)==="\\";)et++;return(et&1)===1;}for(R(0);d!=="";){var P=d.charAt(0);if(M(P))O=!0,R(1);else if(P in o)g.push({type:o[P]}),O=!1,R(1);else if(P===","){if(g.length===0)throw new Error("Empty sub-selector");l.push(g),g=[],O=!1,R(1);}else if(O&&(g.length>0&&g.push({type:"descendant"}),O=!1),P==="*")d=d.substr(1),g.push({type:"universal"});else if(P in s){var L=s[P],D=L[0],I=L[1];d=d.substr(1),g.push({type:"attribute",name:D,action:I,value:A(),ignoreCase:!1});}else if(P==="["){d=d.substr(1);var C=d.match(i);if(!C)throw new Error("Malformed attribute selector: "+d);d=d.substr(C[0].length);var B=y(C[1]);(!f||("lowerCaseAttributeNames"in f?f.lowerCaseAttributeNames:!f.xmlMode))&&(B=B.toLowerCase()),g.push({type:"attribute",name:B,action:a[C[2]],value:y(C[4]||C[5]||""),ignoreCase:!!C[6]});}else if(P===":"){if(d.charAt(1)===":"){d=d.substr(2),g.push({type:"pseudo-element",name:A().toLowerCase()});continue;}d=d.substr(1);var G=A().toLowerCase(),C=null;if(d.charAt(0)==="(")if(c.has(G)){var H=d.charAt(1),X=h.has(H);if(d=d.substr(X?2:1),C=[],d=m(C,d,f),X){if(d.charAt(0)!==H)throw new Error("Unmatched quotes in :"+G);d=d.substr(1);}if(d.charAt(0)!==")")throw new Error("Missing closing parenthesis in :"+G+" ("+d+")");d=d.substr(1);}else{for(var Z=1,W=1;W>0&&Z<d.length;Z++)d.charAt(Z)==="("&&!b(Z)?W++:d.charAt(Z)===")"&&!b(Z)&&W--;if(W)throw new Error("Parenthesis not matched");if(C=d.substr(1,Z-2),d=d.substr(Z),p.has(G)){var H=C.charAt(0);H===C.slice(-1)&&h.has(H)&&(C=C.slice(1,-1)),C=y(C);}}g.push({type:"pseudo",name:G,data:C});}else if(e.test(d)){var z=A();(!f||("lowerCaseTags"in f?f.lowerCaseTags:!f.xmlMode))&&(z=z.toLowerCase()),g.push({type:"tag",name:z});}else return g.length&&g[g.length-1].type==="descendant"&&g.pop(),x(l,g),d;}return x(l,g),d;}function x(l,d){if(l.length>0&&d.length===0)throw new Error("Empty sub-selector");l.push(d);}},/* 277 */ /***/function(u,r,t){Object.defineProperty(r,"__esModule",{value:!0});var e={equals:"",element:"~",start:"^",end:"$",any:"*",not:"!",hyphen:"|"};function n(s){return s.map(i).join(", ");}r["default"]=n;function i(s){return s.map(a).join("");}function a(s){switch(s.type){case"child":return" > ";case"parent":return" < ";case"sibling":return" ~ ";case"adjacent":return" + ";case"descendant":return" ";case"universal":return"*";case"tag":return s.name;case"pseudo-element":return"::"+s.name;case"pseudo":return s.data===null?":"+s.name:typeof s.data=="string"?":"+s.name+"("+s.data+")":":"+s.name+"("+n(s.data)+")";case"attribute":return s.action==="exists"?"["+s.name+"]":s.name==="id"&&s.action==="equals"&&!s.ignoreCase?"#"+s.value:s.name==="class"&&s.action==="element"&&!s.ignoreCase?"."+s.value:"["+s.name+e[s.action]+"='"+s.value+"'"+(s.ignoreCase?"i":"")+"]";default:throw new Error("Unknown type");}}function o(s){return s;}},/* 278 */ /***/function(u,r,t){u.exports=i;var e=t(279),n={__proto__:null,exists:10,equals:8,not:7,start:6,end:6,any:5,hyphen:4,element:4};function i(o){for(var s=o.map(a),c=1;c<o.length;c++){var p=s[c];if(!(p<0))for(var h=c-1;h>=0&&p<s[h];h--){var v=o[h+1];o[h+1]=o[h],o[h]=v,s[h+1]=s[h],s[h]=p;}}}function a(o){var s=e[o.type];if(s===e.attribute)s=n[o.action],s===n.equals&&o.name==="id"&&(s=9),o.ignoreCase&&(s>>=1);else if(s===e.pseudo)if(!o.data)s=3;else if(o.name==="has"||o.name==="contains")s=0;else if(o.name==="matches"||o.name==="not"){s=0;for(var c=0;c<o.data.length;c++)if(o.data[c].length===1){var p=a(o.data[c][0]);if(p===0){s=0;break;}p>s&&(s=p);}o.data.length>1&&s>0&&(s-=1);}else s=1;return s;}},/* 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,r,t){var e=t(281),n=t(282);u.exports={__proto__:null,attribute:e.compile,pseudo:n.compile,//tags
|
|
344
|
-
tag:function tag(i,a,o){var s=a.name,c=o.adapter;return function(h){return c.getName(h)===s&&i(h);};},//traversal
|
|
345
|
-
descendant:function descendant(i,a,o){var s=(typeof WeakSet==="undefined"?"undefined":_typeof(WeakSet))<"u"?/* @__PURE__ */new WeakSet():null,c=o.adapter;return function(h){for(var v=!1;!v&&(h=c.getParent(h));)(!s||!s.has(h))&&(v=i(h),!v&&s&&s.add(h));return v;};},_flexibleDescendant:function _flexibleDescendant(i,a,o){var s=o.adapter;return function(p){for(var h=i(p);!h&&(p=s.getParent(p));)h=i(p);return h;};},parent:function parent(i,a,o){if(o&&o.strict)throw new Error("Parent selector isn't part of CSS3");var s=o.adapter;return function(h){return s.getChildren(h).some(c);};function c(p){return s.isTag(p)&&i(p);}},child:function child(i,a,o){var s=o.adapter;return function(p){var h=s.getParent(p);return!!h&&i(h);};},sibling:function sibling(i,a,o){var s=o.adapter;return function(p){for(var h=s.getSiblings(p),v=0;v<h.length;v++)if(s.isTag(h[v])){if(h[v]===p)break;if(i(h[v]))return!0;}return!1;};},adjacent:function adjacent(i,a,o){var s=o.adapter;return function(p){for(var h=s.getSiblings(p),v,y=0;y<h.length;y++)if(s.isTag(h[y])){if(h[y]===p)break;v=h[y];}return!!v&&i(v);};},universal:function universal(i){return i;}};},/* 281 */ /***/function(u,r,t){var e=t(273).falseFunc,n=/[-[\]{}()*+?.,\\^$|#\s]/g,i={__proto__:null,equals:function equals(a,o,s){var c=o.name,p=o.value,h=s.adapter;return o.ignoreCase?(p=p.toLowerCase(),function(y){var M=h.getAttributeValue(y,c);return M!=null&&M.toLowerCase()===p&&a(y);}):function(y){return h.getAttributeValue(y,c)===p&&a(y);};},hyphen:function hyphen(a,o,s){var c=o.name,p=o.value,h=p.length,v=s.adapter;return o.ignoreCase?(p=p.toLowerCase(),function(M){var T=v.getAttributeValue(M,c);return T!=null&&(T.length===h||T.charAt(h)==="-")&&T.substr(0,h).toLowerCase()===p&&a(M);}):function(M){var T=v.getAttributeValue(M,c);return T!=null&&T.substr(0,h)===p&&(T.length===h||T.charAt(h)==="-")&&a(M);};},element:function element(a,o,s){var c=o.name,p=o.value,h=s.adapter;if(/\s/.test(p))return e;p=p.replace(n,"\\$&");var v="(?:^|\\s)"+p+"(?:$|\\s)",y=o.ignoreCase?"i":"",M=new RegExp(v,y);return function(m){var x=h.getAttributeValue(m,c);return x!=null&&M.test(x)&&a(m);};},exists:function exists(a,o,s){var c=o.name,p=s.adapter;return function(v){return p.hasAttrib(v,c)&&a(v);};},start:function start(a,o,s){var c=o.name,p=o.value,h=p.length,v=s.adapter;return h===0?e:o.ignoreCase?(p=p.toLowerCase(),function(M){var T=v.getAttributeValue(M,c);return T!=null&&T.substr(0,h).toLowerCase()===p&&a(M);}):function(M){var T=v.getAttributeValue(M,c);return T!=null&&T.substr(0,h)===p&&a(M);};},end:function end(a,o,s){var c=o.name,p=o.value,h=-p.length,v=s.adapter;return h===0?e:o.ignoreCase?(p=p.toLowerCase(),function(M){var T=v.getAttributeValue(M,c);return T!=null&&T.substr(h).toLowerCase()===p&&a(M);}):function(M){var T=v.getAttributeValue(M,c);return T!=null&&T.substr(h)===p&&a(M);};},any:function any(a,o,s){var c=o.name,p=o.value,h=s.adapter;if(p==="")return e;if(o.ignoreCase){var v=new RegExp(p.replace(n,"\\$&"),"i");return function(M){var T=h.getAttributeValue(M,c);return T!=null&&v.test(T)&&a(M);};}return function(M){var T=h.getAttributeValue(M,c);return T!=null&&T.indexOf(p)>=0&&a(M);};},not:function not(a,o,s){var c=o.name,p=o.value,h=s.adapter;return p===""?function(y){return!!h.getAttributeValue(y,c)&&a(y);}:o.ignoreCase?(p=p.toLowerCase(),function(y){var M=h.getAttributeValue(y,c);return M!=null&&M.toLowerCase()!==p&&a(y);}):function(y){return h.getAttributeValue(y,c)!==p&&a(y);};}};u.exports={compile:function compile(a,o,s){if(s&&s.strict&&(o.ignoreCase||o.action==="not"))throw new Error("Unsupported attribute selector");return i[o.action](a,o,s);},rules:i};},/* 282 */ /***/function(u,r,t){var e=t(283),n=t(273),i=t(281),a=n.trueFunc,o=n.falseFunc,s=i.rules.equals;function c(x,l){var d={name:x,value:l};return function(g,O,A){return s(g,d,A);};}function p(x,l){return function(d){return!!l.getParent(d)&&x(d);};}var h={contains:function contains(x,l,d){var f=d.adapter;return function(O){return x(O)&&f.getText(O).indexOf(l)>=0;};},icontains:function icontains(x,l,d){var f=l.toLowerCase(),g=d.adapter;return function(A){return x(A)&&g.getText(A).toLowerCase().indexOf(f)>=0;};},//location specific methods
|
|
346
|
-
"nth-child":function nthChild(x,l,d){var f=e(l),g=d.adapter;return f===o?f:f===a?p(x,g):function(A){for(var R=g.getSiblings(A),b=0,P=0;b<R.length;b++)if(g.isTag(R[b])){if(R[b]===A)break;P++;}return f(P)&&x(A);};},"nth-last-child":function nthLastChild(x,l,d){var f=e(l),g=d.adapter;return f===o?f:f===a?p(x,g):function(A){for(var R=g.getSiblings(A),b=0,P=R.length-1;P>=0;P--)if(g.isTag(R[P])){if(R[P]===A)break;b++;}return f(b)&&x(A);};},"nth-of-type":function nthOfType(x,l,d){var f=e(l),g=d.adapter;return f===o?f:f===a?p(x,g):function(A){for(var R=g.getSiblings(A),b=0,P=0;P<R.length;P++)if(g.isTag(R[P])){if(R[P]===A)break;g.getName(R[P])===g.getName(A)&&b++;}return f(b)&&x(A);};},"nth-last-of-type":function nthLastOfType(x,l,d){var f=e(l),g=d.adapter;return f===o?f:f===a?p(x,g):function(A){for(var R=g.getSiblings(A),b=0,P=R.length-1;P>=0;P--)if(g.isTag(R[P])){if(R[P]===A)break;g.getName(R[P])===g.getName(A)&&b++;}return f(b)&&x(A);};},//TODO determine the actual root element
|
|
347
|
-
root:function root(x,l,d){var f=d.adapter;return function(g){return!f.getParent(g)&&x(g);};},scope:function scope(x,l,d,f){var g=d.adapter;if(!f||f.length===0)return h.root(x,l,d);function O(A,R){return typeof g.equals=="function"?g.equals(A,R):A===R;}return f.length===1?function(A){return O(f[0],A)&&x(A);}:function(A){return f.indexOf(A)>=0&&x(A);};},//jQuery extensions (others follow as pseudos)
|
|
348
|
-
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.
|
|
349
|
-
hover:function hover(x,l,d){var f=d.adapter;return typeof f.isHovered=="function"?function(O){return x(O)&&f.isHovered(O);}:o;},visited:function visited(x,l,d){var f=d.adapter;return typeof f.isVisited=="function"?function(O){return x(O)&&f.isVisited(O);}:o;},active:function active(x,l,d){var f=d.adapter;return typeof f.isActive=="function"?function(O){return x(O)&&f.isActive(O);}:o;}};function v(x,l){for(var d=0;x&&d<x.length;d++)if(l.isTag(x[d]))return x[d];}var y={empty:function empty(x,l){return!l.getChildren(x).some(function(d){return l.isTag(d)||d.type==="text";});},"first-child":function firstChild(x,l){return v(l.getSiblings(x),l)===x;},"last-child":function lastChild(x,l){for(var d=l.getSiblings(x),f=d.length-1;f>=0;f--){if(d[f]===x)return!0;if(l.isTag(d[f]))break;}return!1;},"first-of-type":function firstOfType(x,l){for(var d=l.getSiblings(x),f=0;f<d.length;f++)if(l.isTag(d[f])){if(d[f]===x)return!0;if(l.getName(d[f])===l.getName(x))break;}return!1;},"last-of-type":function lastOfType(x,l){for(var d=l.getSiblings(x),f=d.length-1;f>=0;f--)if(l.isTag(d[f])){if(d[f]===x)return!0;if(l.getName(d[f])===l.getName(x))break;}return!1;},"only-of-type":function onlyOfType(x,l){for(var d=l.getSiblings(x),f=0,g=d.length;f<g;f++)if(l.isTag(d[f])){if(d[f]===x)continue;if(l.getName(d[f])===l.getName(x))return!1;}return!0;},"only-child":function onlyChild(x,l){for(var d=l.getSiblings(x),f=0;f<d.length;f++)if(l.isTag(d[f])&&d[f]!==x)return!1;return!0;},//:matches(a, area, link)[href]
|
|
350
|
-
link:function link(x,l){return l.hasAttrib(x,"href");},//TODO: :any-link once the name is finalized (as an alias of :link)
|
|
351
|
-
//forms
|
|
352
|
-
//to consider: :target
|
|
353
|
-
//:matches([selected], select:not([multiple]):not(> option[selected]) > option:first-of-type)
|
|
354
|
-
selected:function selected(x,l){if(l.hasAttrib(x,"selected"))return!0;if(l.getName(x)!=="option")return!1;var d=l.getParent(x);if(!d||l.getName(d)!=="select"||l.hasAttrib(d,"multiple"))return!1;for(var f=l.getChildren(d),g=!1,O=0;O<f.length;O++)if(l.isTag(f[O]))if(f[O]===x)g=!0;else if(g){if(l.hasAttrib(f[O],"selected"))return!1;}else return!1;return g;},//https://html.spec.whatwg.org/multipage/scripting.html#disabled-elements
|
|
355
|
-
//:matches(
|
|
356
|
-
// :matches(button, input, select, textarea, menuitem, optgroup, option)[disabled],
|
|
357
|
-
// optgroup[disabled] > option),
|
|
358
|
-
// fieldset[disabled] * //TODO not child of first <legend>
|
|
359
|
-
//)
|
|
360
|
-
disabled:function disabled(x,l){return l.hasAttrib(x,"disabled");},enabled:function enabled(x,l){return!l.hasAttrib(x,"disabled");},//:matches(:matches(:radio, :checkbox)[checked], :selected) (TODO menuitem)
|
|
361
|
-
checked:function checked(x,l){return l.hasAttrib(x,"checked")||y.selected(x,l);},//:matches(input, select, textarea)[required]
|
|
362
|
-
required:function required(x,l){return l.hasAttrib(x,"required");},//:matches(input, select, textarea):not([required])
|
|
363
|
-
optional:function optional(x,l){return!l.hasAttrib(x,"required");},//jQuery extensions
|
|
364
|
-
//:not(:empty)
|
|
365
|
-
parent:function parent(x,l){return!y.empty(x,l);},//:matches(h1, h2, h3, h4, h5, h6)
|
|
366
|
-
header:M(["h1","h2","h3","h4","h5","h6"]),//:matches(button, input[type=button])
|
|
367
|
-
button:function button(x,l){var d=l.getName(x);return d==="button"||d==="input"&&l.getAttributeValue(x,"type")==="button";},//:matches(input, textarea, select, button)
|
|
368
|
-
input:M(["input","textarea","select","button"]),//input:matches(:not([type!='']), [type='text' i])
|
|
369
|
-
text:function text(x,l){var d;return l.getName(x)==="input"&&(!(d=l.getAttributeValue(x,"type"))||d.toLowerCase()==="text");}};function M(x){if((typeof Set==="undefined"?"undefined":_typeof(Set))<"u"){var l=new Set(x);return function(d,f){return l.has(f.getName(d));};}return function(d,f){return x.indexOf(f.getName(d))>=0;};}function T(x,l,d){if(d===null){if(x.length>2&&l!=="scope")throw new Error("pseudo-selector :"+l+" requires an argument");}else if(x.length===2)throw new Error("pseudo-selector :"+l+" doesn't have any arguments");}var m=/^(?:(?:nth|last|first|only)-(?:child|of-type)|root|empty|(?:en|dis)abled|checked|not)$/;u.exports={compile:function compile(x,l,d,f){var g=l.name,O=l.data,A=d.adapter;if(d&&d.strict&&!m.test(g))throw new Error(":"+g+" isn't part of CSS3");if(typeof h[g]=="function")return h[g](x,O,d,f);if(typeof y[g]=="function"){var R=y[g];return T(R,g,O),R===o?R:x===a?function(P){return R(P,A,O);}:function(P){return R(P,A,O)&&x(P);};}else throw new Error("unmatched pseudo-class :"+g);},filters:h,pseudos:y};},/* 283 */ /***/function(u,r,t){var e=t(284),n=t(285);u.exports=function(a){return n(e(a));},u.exports.parse=e,u.exports.compile=n;},/* 284 */ /***/function(u,r){u.exports=e;var t=/^([+\-]?\d*n)?\s*(?:([+\-]?)\s*(\d+))?$/;function e(n){if(n=n.trim().toLowerCase(),n==="even")return[2,0];if(n==="odd")return[2,1];var i=n.match(t);if(!i)throw new SyntaxError("n-th rule couldn't be parsed ('"+n+"')");var a;return i[1]?(a=parseInt(i[1],10),isNaN(a)&&(i[1].charAt(0)==="-"?a=-1:a=1)):a=0,[a,i[3]?parseInt((i[2]||"")+i[3],10):0];}},/* 285 */ /***/function(u,r,t){u.exports=a;var e=t(273),n=e.trueFunc,i=e.falseFunc;function a(o){var s=o[0],c=o[1]-1;if(c<0&&s<=0)return i;if(s===-1)return function(h){return h<=c;};if(s===0)return function(h){return h===c;};if(s===1)return c<0?n:function(h){return h>=c;};var p=c%s;return p<0&&(p+=s),s>1?function(h){return h>=c&&h%s===p;}:(s*=-1,function(h){return h<=c&&h%s===p;});}},/* 286 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return O;});var e=t(12),n=t(74),i=t(1),a=t(68),o=t(250),s=t(213),c=t(218);t(1).glMatrix.setMatrixArrayType(Array);function p(A,R){if(A==null)return{};var b=h(A,R),P,L;if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(A);for(L=0;L<D.length;L++)P=D[L],!(R.indexOf(P)>=0)&&Object.prototype.propertyIsEnumerable.call(A,P)&&(b[P]=A[P]);}return b;}function h(A,R){if(A==null)return{};var b={},P=Object.keys(A),L,D;for(D=0;D<P.length;D++)L=P[D],!(R.indexOf(L)>=0)&&(b[L]=A[L]);return b;}var v={antialias:!0,autoRender:!0,alpha:!0// for wx-miniprogram
|
|
370
|
-
},y=Symbol("autoRender"),M=Symbol("renderer"),T=Symbol("timeline"),m=Symbol("prepareRender"),x=Symbol("tickRender"),l=Symbol("pass"),d=Symbol("fbo"),f=Symbol("tickers"),g=Symbol("layerTransformInvert");var O=/*#__PURE__*/function(_o$default){function O(){var _this49;var R=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,O);if(_this49=_callSuper(this,O),!R.canvas){var _this49$getResolution=_this49.getResolution(),D=_this49$getResolution.width,I=_this49$getResolution.height,C=e.ENV.createCanvas(D,I,{offscreen:!!R.offscreen,id:R.id,extra:R.extra});C.style&&(C.style.position="absolute"),C.dataset&&(C.dataset.layerId=R.id),C.contextType&&(R.contextType=C.contextType),R.canvas=C;}var b=R.canvas,P=Object.assign({},v,R);_this49[y]=P.autoRender,delete R.autoRender;var L=P.Renderer||e.Renderer;_this49[M]=new L(b,P),_this49.options=R,_this49.id=R.id,_this49[l]=[],_this49.setResolution(b),_this49.canvas=b,_this49[T]=new n.Timeline(),_this49.__mouseCapturedTarget=null,_this49[g]=null;return _assertThisInitialized(_this49);}_inherits(O,_o$default);return _createClass(O,[{key:"autoRender",get:function get(){return this[y];}},{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(),R=_this$getResolution.height;return R/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[l];}},{key:"prepareRender",get:function get(){return this[m]?this[m]: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,R=_this$parent$options.left,b=_this$parent$options.top;return[R,b];}return[this.options.left|0,this.options.top|0];}},{key:"timeline",get:function get(){return this[T];}},{key:"width",get:function get(){var _this$getResolution2=this.getResolution(),R=_this$getResolution2.width;return R/this.displayRatio;}},{key:"localMatrix",get:function get(){var _this$attributes21=this.attributes,R=_this$attributes21.x,b=_this$attributes21.y;return[1,0,0,1,R,b];}},{key:"layerTransformInvert",get:function get(){if(this[g])return this[g];var R=this.transformMatrix;return R[0]===1&&R[1]===0&&R[2]===0&&R[3]===1&&R[4]===0&&R[5]===0?null:(this[g]=i.mat2d.invert(Array.of(0,0,0,0,0,0),R),this[g]);}},{key:"forceContextLoss",value:function forceContextLoss(){var R=this.renderer.glRenderer;if(R){var b=R.getExtension("WEBGL_lose_context");if(b)return b.loseContext(),!0;}return!1;}// isPointCollision(x, y) {
|
|
371
|
-
// return true;
|
|
372
|
-
// }
|
|
373
|
-
},{key:"addPass",value:function addPass(){var _ref150=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},R=_ref150.vertex,b=_ref150.fragment,P=_ref150.options,L=_ref150.uniforms;if(this.renderer.glRenderer){var _this$getResolution3=this.getResolution(),D=_this$getResolution3.width,I=_this$getResolution3.height,C=this.renderer.createPassProgram({vertex:R,fragment:b,options:P}),B=new e.Figure2D();B.rect(0,0,D/this.displayRatio,I/this.displayRatio);var G=new e.Mesh2D(B);return G.setUniforms(L),G.setProgram(C),this[l].push(G),this.forceUpdate(),G;}return null;}// delete unused texture to release memory.
|
|
374
|
-
},{key:"deleteTexture",value:function deleteTexture(R){return Object(c.deleteTexture)(R,this.renderer);}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(R){var b=R.type;if(b==="mousedown"||b==="mouseup"||b==="mousemove"){var C=this.__mouseCapturedTarget;if(C){if(C.layer===this)return C.dispatchEvent(R),!0;this.__mouseCapturedTarget=null;}}var P,L;var D=this.layerTransformInvert;if(D){P=R.x,L=R.y;var _C6=D,B=_C6[0]*P+_C6[2]*L+_C6[4],G=_C6[1]*P+_C6[3]*L+_C6[5];delete R.x,delete R.y,delete R.layerX,delete R.layerY,Object.defineProperties(R,{layerX:{value:B,configurable:!0},layerY:{value:G,configurable:!0},x:{value:B,configurable:!0},y:{value:G,configurable:!0}});}var I=_get(_getPrototypeOf(O.prototype),"dispatchPointerEvent",this).call(this,R);return D&&Object.defineProperties(R,{layerX:{value:P,configurable:!0},layerY:{value:L,configurable:!0},x:{value:P,configurable:!0},y:{value:L,configurable:!0}}),I;}/* override */},{key:"forceUpdate",value:function forceUpdate(){var _this50=this;if(!this[m])if(this.parent&&this.parent.hasOffscreenCanvas){this.parent.forceUpdate();var R=null;var b=new Promise(function(P){R=P;});b._resolve=R,this[m]=b;}else{var _R2=null,_b8=null;var P=new Promise(function(L){_R2=L,_this50[y]&&(_b8=Object(a.requestAnimationFrame)(function(){delete P._requestID,_this50.render();}));});P._resolve=_R2,P._requestID=_b8,this[m]=P;}}},{key:"getFBO",value:function getFBO(){var R=this.renderer.glRenderer,_this$getResolution4=this.getResolution(),b=_this$getResolution4.width,P=_this$getResolution4.height;return R&&(!this[d]||this[d].width!==b||this[d].height!==P)?(this[d]={width:b,height:P,target:R.createFBO(),buffer:R.createFBO(),swap:function swap(){var _ref151=[this.buffer,this.target];this.target=_ref151[0];this.buffer=_ref151[1];}},this[d]):this[d]?this[d]:null;}},{key:"updateGlobalTransform",value:function updateGlobalTransform(){if(this.layerTransformInvert){var R=this.renderer,b=R.__globalTransformMatrix||R.globalTransformMatrix;R.__globalTransformMatrix=b;var P=i.mat2d.fromValues(1,0,0,1,0,0);R.setGlobalTransform.apply(R,_toConsumableArray(i.mat2d.multiply(P,b,this.transformMatrix)));}}/* override */},{key:"onPropertyChange",value:function onPropertyChange(R,b,P){if(_get(_getPrototypeOf(O.prototype),"onPropertyChange",this).call(this,R,b,P),R==="zIndex"&&(this.canvas.style.zIndex=b),R==="transform"||R==="translate"||R==="rotate"||R==="scale"||R==="skew"){var L=this[g];if(this[g]=null,this.updateGlobalTransform(),L&&!this.layerTransformInvert){var D=this.renderer,I=D.__globalTransformMatrix||D.globalTransformMatrix;D.setGlobalTransform.apply(D,_toConsumableArray(I));}}}},{key:"_prepareRenderFinished",value:function _prepareRenderFinished(){this[m]&&(this[m]._requestID&&Object(a.cancelAnimationFrame)(this[m]._requestID),this[m]._resolve(),delete this[m]);}},{key:"render",value:function render(){var _this51=this;var _ref152=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref152$clear=_ref152.clear,R=_ref152$clear===void 0?!0:_ref152$clear;var b=this[l].length?this.getFBO():null;b&&this.renderer.glRenderer.bindFBO(b.target),R&&this[M].clear();var P=this.draw();if(P&&P.length&&(this.renderer.drawMeshes(P),this.canvas.draw&&this.canvas.draw()),b){var L=this.renderer.glRenderer,D=this[l].length,_this$getResolution5=this.getResolution(),I=_this$getResolution5.width,C=_this$getResolution5.height,B=[0,0,I/this.displayRatio,C/this.displayRatio];this[l].forEach(function(G,H){G.blend=!0,G.setTexture(b.target.texture,{rect:B}),H===D-1?L.bindFBO(null):(b.swap(),L.bindFBO(b.target)),_this51[M].clear(),_this51.renderer.drawMeshes([G]);});}this._prepareRenderFinished();}/* override */},{key:"setResolution",value:function setResolution(_ref153){var _this52=this;var R=_ref153.width,b=_ref153.height;var P=this.renderer,L=P.__globalTransformMatrix||P.globalTransformMatrix,D=L[4],I=L[5],C=L[0],_this$getResolution6=this.getResolution(),B=_this$getResolution6.width,G=_this$getResolution6.height;(B!==R||G!==b)&&(_get(_getPrototypeOf(O.prototype),"setResolution",this).call(this,{width:R,height:b}),this.canvas&&(this.canvas.width=R,this.canvas.height=b,P.updateResolution&&P.updateResolution()),this.attributes.size=[R,b],this[l].length&&this[l].forEach(function(W){var z=new e.Figure2D();z.rect(0,0,R/_this52.displayRatio,b/_this52.displayRatio),W.contours=z.contours;}));var _this$renderOffset=_slicedToArray(this.renderOffset,2),H=_this$renderOffset[0],X=_this$renderOffset[1],Z=this.displayRatio;(D!==H||I!==X||C!==Z)&&(P.setGlobalTransform(Z,0,0,Z,H,X),P.__globalTransformMatrix=null,this[g]=null,this.updateGlobalTransform(),this.forceUpdate());}/**
|
|
375
|
-
* tick(handler, {originTime = 0, playbackRate = 1.0, duration = Infinity})
|
|
376
|
-
* @param {*} handler
|
|
377
|
-
* @param {*} options
|
|
378
|
-
*/},{key:"tick",value:function tick(){var _this53=this;var R=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var b=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var _b$duration=b.duration,P=_b$duration===void 0?1/0:_b$duration,L=p(b,["duration"]);var D=this.timeline.fork(L),I=this;this[f]=this[f]||[],this[f].push({handler:R,duration:P});var C=function C(){var B=null,G=null;var H=function H(){var X=_this53[f].map(function(_ref154){var Z=_ref154.handler,W=_ref154.duration;var z=Math.min(1,D.currentTime/W);return{value:Z?Z(D.currentTime,z):null,p:z};});I[x]||(I[x]=Promise.resolve().then(function(){I[y]&&I.render(),delete I[x];for(var Z=X.length-1;Z>=0;Z--){var _X$Z=X[Z],W=_X$Z.value,z=_X$Z.p;(W===!1||z>=1)&&_this53[f].splice(Z,1);}_this53[f].length>0&&C();}));};if(_this53[m]&&_this53[m]._type!=="ticker"&&(Object(a.cancelAnimationFrame)(_this53[m]._requestID),delete _this53[m]),!_this53[m]){var X=new Promise(function(Z){B=Z,G=Object(a.requestAnimationFrame)(H);});X._resolve=B,X._requestID=G,X._type="ticker",_this53[m]=X;}};C();}},{key:"toGlobalPos",value:function toGlobalPos(R,b){if(this.layerTransformInvert){var B=this.transformMatrix;R=B[0]*R+B[2]*b+B[4],b=B[1]*R+B[3]*b+B[5];}var _this$getResolution7=this.getResolution(),P=_this$getResolution7.width,L=_this$getResolution7.height,D=this.renderOffset,I=[this.canvas.clientWidth,this.canvas.clientHeight];R=R*I[0]/P+D[0],b=b*I[1]/L+D[1];var C=this.displayRatio;return R*=C,b*=C,[R,b];}},{key:"toLocalPos",value:function toLocalPos(R,b){var _this$getResolution8=this.getResolution(),P=_this$getResolution8.width,L=_this$getResolution8.height,D=this.renderOffset,I=[this.canvas.clientWidth,this.canvas.clientHeight];R=R*P/I[0]-D[0],b=b*L/I[1]-D[1];var C=this.displayRatio;R/=C,b/=C;var B=this.layerTransformInvert;return B&&(R=B[0]*R+B[2]*b+B[4],b=B[1]*R+B[3]*b+B[5]),[R,b];}}]);}(o["default"]);s["default"].registerNode(O,"layer");},/* 287 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return m;});var e=t(224),n=t(288),i=t(213),a=t(252),o=t(72);t(1).glMatrix.setMatrixArrayType(Array);function s(x,l){if(x==null)return{};var d=c(x,l),f,g;if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(x);for(g=0;g<O.length;g++)f=O[g],!(l.indexOf(f)>=0)&&Object.prototype.propertyIsEnumerable.call(x,f)&&(d[f]=x[f]);}return d;}function c(x,l){if(x==null)return{};var d={},f=Object.keys(x),g,O;for(O=0;O<f.length;O++)g=f[O],!(l.indexOf(g)>=0)&&(d[g]=x[g]);return d;}function p(x,l,d){return l in x?Object.defineProperty(x,l,{value:d,enumerable:!0,configurable:!0,writable:!0}):x[l]=d,x;}var h="http://www.w3.org/2000/svg",v=Symbol["for"]("spritejs_setAttribute"),y=Symbol("root"),M=Symbol("task");function T(x){var l=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var d=x[y];if(d&&d.children[0]){var f=x.svg,g=x.layer?x.layer.displayRatio:1;if(!f.hasAttribute("data-original-width")){var R=f.getAttribute("width");R=R?Object(o.sizeToPixel)(R):300;var b=f.getAttribute("height");b=b?Object(o.sizeToPixel)(b):150,f.hasAttribute("viewBox")||f.setAttribute("viewBox","0 0 ".concat(Math.round(R)," ").concat(Math.round(b))),f.setAttribute("data-original-width",R),f.setAttribute("data-original-height",b);}var O=x.attributes.width||Number(f.getAttribute("data-original-width")),A=x.attributes.height||Number(f.getAttribute("data-original-height"));if(O*=g,A*=g,l&&x.attributes.flexible){var _R3=x.attributes.scale[0];if(O*=_R3,A*=_R3,f.setAttribute("width",O),f.setAttribute("height",A),O&&A&&x.textureImage){var _b9=x.textureImage.width,P=x.textureImage.height,L=x.clientSize;x.attributes.textureRect=[0,0,Math.round(L[0]*_b9/O),Math.round(L[1]*P/A)];}}else x[M]||(f.setAttribute("width",O),f.setAttribute("height",A),x[M]=Promise.resolve().then(function(){delete x[M];var R=d.innerHTML,b=new Blob([R],{type:"image/svg+xml"}),P=URL.createObjectURL(b),L=new Image();L.onload=function(){L.width&&L.height?(x.attributes[v]("texture",L),x.attributes.flexible&&(x.attributes.textureRect=null)):x.attributes[v]("texture",null);},L.src=P;}));}}var m=/*#__PURE__*/function(_e$default21){function m(){var _this54;var l=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,m);typeof l=="string"&&(l={svgText:l});var _l25=l,d=_l25.svgText,f=s(l,["svgText"]);if(_this54=_callSuper(this,m,[f]),_this54[y]=document.createElement("div"),d){_this54[y].innerHTML=d;var g=_this54[y].children[0];g?g.setAttribute("xmlns",h):(fetch(d).then(function(O){return O.text();}).then(function(O){_this54[y].innerHTML=O,(!_this54.observer||_this54.attributes.flexible)&&T(_assertThisInitialized(_this54));}),d=null);}if(!d){var _g9=document.createElementNS(h,"svg");_g9.setAttribute("xmlns",h),_this54[y].appendChild(_g9);}if(typeof MutationObserver=="function"){var _g10=new MutationObserver(function(O){T(_assertThisInitialized(_this54),!1);});_g10.observe(_this54[y],{attributes:!0,subtree:!0,characterData:!0,childList:!0}),_this54.observer=_g10;}return _assertThisInitialized(_this54);}_inherits(m,_e$default21);return _createClass(m,[{key:"children",get:function get(){return[this.svg];}},{key:"childNodes",get:function get(){return[this.svg];}},{key:"svg",get:function get(){return this[y]?this[y].children[0]:null;}/* override */},{key:"setResolution",value:function setResolution(_ref155){var l=_ref155.width,d=_ref155.height;_get(_getPrototypeOf(m.prototype),"setResolution",this).call(this,{width:l,height:d}),T(this);}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(l){var d=_get(_getPrototypeOf(m.prototype),"dispatchPointerEvent",this).call(this,l);if(d&&this.attributes.passEvents&&typeof MouseEvent=="function"){var f=l.x,g=l.y;var _this$getOffsetPositi=this.getOffsetPosition(f,g),_this$getOffsetPositi2=_slicedToArray(_this$getOffsetPositi,2),O=_this$getOffsetPositi2[0],A=_this$getOffsetPositi2[1];var R=l.originalEvent,b=this.attributes.anchor,P=this.clientSize;O=(O+b[0]*P[0])/2,A=(A+b[1]*P[1])/2;var L=l.type;if(L===R.type){var D=null;if(R instanceof MouseEvent)D=new MouseEvent(L,{screenX:O,screenY:A,clientX:O,clientY:A,bubbles:R.bubbles,button:R.button,buttons:R.buttons,cancelBubble:R.cancelBubble,cancelable:R.cancelable,currentTarget:R.currentTarget,fromElement:R.fromElement,relatedTarget:R.relatedTarget,returnValue:R.returnValue,srcElement:R.srcElement,target:R.target,toElement:R.toElement,// view: originalEvent.view,
|
|
379
|
-
which:R.witch});else if(R instanceof TouchEvent){var I=null;var C=R.changedTouches||[R];for(var B=0;B<C.length;B++){var G=C[B];if(l.identifier===G.identifier){I=G;break;}}if(I){var _B3=new Touch({identifier:I.identifier,target:I.target,clientX:O,clientY:A,screenX:O,screenY:A,pageX:O,pageY:A,radiusX:I.radiusX,radiusY:I.radiusY,rotationAngle:I.rotationAngle,force:I.force});D=new TouchEvent(L,{cancelable:R.cancelable,bubbles:R.bubbles,composed:R.composed,touches:[_B3],targetTouches:[_B3],changedTouches:[_B3]});}}else D=R;D&&this.svg.dispatchEvent(D);}}return d;}},{key:"getElementById",value:function getElementById(l){return Object(a.querySelector)("#".concat(l),this);}},{key:"getElementsByClassName",value:function getElementsByClassName(l){return Object(a.querySelectorAll)(".".concat(l),this);}},{key:"getElementsByName",value:function getElementsByName(l){return Object(a.querySelectorAll)("[name=\"".concat(l,"\"]"),this);}},{key:"getElementsByTagName",value:function getElementsByTagName(l){return Object(a.querySelectorAll)(l,this);}},{key:"querySelector",value:function querySelector(l){return Object(a.querySelector)(l,this);}},{key:"querySelectorAll",value:function querySelectorAll(l){return Object(a.querySelectorAll)(l,this);}/* override */},{key:"onPropertyChange",value:function onPropertyChange(l,d,f){_get(_getPrototypeOf(m.prototype),"onPropertyChange",this).call(this,l,d,f),l==="flexible"&&T(this),this.attributes.flexible&&(l==="width"||l==="height"||l==="scale"||l==="transform")&&T(this);}}]);}(e["default"]);p(m,"Attr",n["default"]),i["default"].registerNode(m,"spritesvg");},/* 288 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(225);t(1).glMatrix.setMatrixArrayType(Array);var n=Symbol["for"]("spritejs_getAttribute"),i=Symbol["for"]("spritejs_setAttribute"),a=Symbol["for"]("spritejs_setAttributeDefault");var o=/*#__PURE__*/function(_e$default22){function o(c){var _this55;_classCallCheck(this,o);_this55=_callSuper(this,o,[c]),_this55[a]({passEvents:!1,flexible:!1});return _this55;}// readonly
|
|
380
|
-
_inherits(o,_e$default22);return _createClass(o,[{key:"texture",get:function get(){return this[n]("texture");},set:function set(c){}// eslint-disable-line no-empty-function
|
|
381
|
-
},{key:"passEvents",get:function get(){return this[n]("passEvents");},set:function set(c){return this[i]("passEvents",c);}},{key:"flexible",get:function get(){return this[n]("flexible");},set:function set(c){return this[i]("flexible",c);}}]);}(e["default"]);},/* 289 */ /***/function(u,r,t){t.r(r);var e=t(12);t(1).glMatrix.setMatrixArrayType(Array);function n(c,p){var h=Object.keys(c);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(c);p&&(v=v.filter(function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable;})),h.push.apply(h,v);}return h;}function i(c){for(var p=1;p<arguments.length;p++){var h=arguments[p]!=null?arguments[p]:{};p%2?n(Object(h),!0).forEach(function(v){a(c,v,h[v]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(h)):n(Object(h)).forEach(function(v){Object.defineProperty(c,v,Object.getOwnPropertyDescriptor(h,v));});}return c;}function a(c,p,h){return p in c?Object.defineProperty(c,p,{value:h,enumerable:!0,configurable:!0,writable:!0}):c[p]=h,c;}var o=Symbol("inited");var s=null;typeof Worker=="function"&&(s=/*#__PURE__*/function(_Worker){function s(c){var _this56;_classCallCheck(this,s);if(c.worker===!0&&(c.worker="./".concat(c.id,".worker.js")),_this56=_callSuper(this,s,[c.worker]),_this56.options=c,!c.canvas){var _this56$getResolution=_this56.getResolution(),p=_this56$getResolution.width,h=_this56$getResolution.height,v=e.ENV.createCanvas(p,h,{offscreen:!1});v.style&&(v.style.position="absolute"),v.dataset&&(v.dataset.layerId=c.id),c.canvas=v;}_this56.canvas=c.canvas;return _assertThisInitialized(_this56);}_inherits(s,_Worker);return _createClass(s,[{key:"id",get:function get(){return this.options.id;}},{key:"setResolution",value:function setResolution(_ref156){var c=_ref156.width,p=_ref156.height;if(this[o])this.postMessage({type:"resolution_change",width:c,height:p});else{this.canvas.width=c,this.canvas.height=p;var h=this.options,v=h.canvas.transferControlToOffscreen(),y=i({},h);delete y.container,y.canvas=v,this.postMessage({type:"create",options:y},[v]),this[o]=!0;}}},{key:"getResolution",value:function getResolution(){if(this.canvas){var _this$canvas6=this.canvas,c=_this$canvas6.width,p=_this$canvas6.height;return{width:c,height:p};}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,p){Object.defineProperty(this,"parent",{value:c,writable:!1,configurable:!0}),Object.defineProperty(this,"zOrder",{value:p,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))),r["default"]=s;},/* 290 */ /***/function(u,r,t){t.r(r),function(e){t.d(r,"default",function(){return O;});var n=t(12),i=t(68),a=t(70),o=t(286),s=t(289),c=t(250),p=t(291),h=t(214),v=t(218),y=t(213);t(1).glMatrix.setMatrixArrayType(Array);var M=Symbol("enteredTargets");function T(A){return A.id=A.id||"_layer".concat(Math.random().toString(36).slice(2,12)),A.dataset||(A.dataset={}),A.dataset.layerId=A.id,A.connect=function(R,b){A.parent=R,Object.defineProperty(A,"zOrder",{value:b,writable:!1,configurable:!0});},A.disconnect=function(R){delete A.zOrder;},A.canvas=A,A.getResolution=function(){return{width:0,height:0};},A.setResolution=function(){return!1;},A.options={handleEvent:!1},A;}function m(A,R){var b=A.children;var P=null;for(var L=0;L<b.length;L++){var D=b[L];if((R===D||P!=null)&&(P=D),P&&P!==R&&!P.offscreen)return P.canvas;}return null;}function x(A,R){var _A$renderOffset=_slicedToArray(A.renderOffset,2),b=_A$renderOffset[0],P=_A$renderOffset[1],_A$getResolution=A.getResolution(),L=_A$getResolution.width,D=_A$getResolution.height,I=A.displayRatio;A.renderer.drawImage(R.canvas,-b/I,-P/I,L/I,D/I);}var l={};function d(A){var R=["mousedown","mouseup","mousemove","mousewheel","wheel","touchstart","touchend","touchmove","touchcancel","click","dblclick","longpress","tap","contextmenu"],b=A.container;b.addEventListener("mouseleave",function(P){var L=A[M];if(L.size){var D=new h["default"]("mouseleave");D.setOriginalEvent(P),_toConsumableArray(L).forEach(function(I){I.dispatchEvent(D);}),A[M].clear();}},{passive:!0}),R.forEach(function(P){b.addEventListener(P,function(L){var _A$options=A.options,D=_A$options.left,I=_A$options.top,C=_A$options.displayRatio,B=A.orderedChildren;Object(p["default"])(L,{offsetLeft:D,offsetTop:I,displayRatio:C}).forEach(function(H){var X=H.identifier;if(H.type==="touchmove"||H.type==="touchend"){var W=l[X];W&&W.dispatchEvent(H),H.type==="touchend"&&delete l[X];}else{for(var _W=B.length-1;_W>=0;_W--){var z=B[_W];if(z.options.handleEvent!==!1){if(z.dispatchPointerEvent(H)&&H.target!==z)break;H.cancelBubble=!1;}}if(H.target===B[0])for(var _W2=B.length-1;_W2>=0;_W2--){var _z=B[_W2];if(_z.options.handleEvent!==!1){H.target=_z;break;}}}var Z=H.target;if(H.type==="touchstart"&&(l[X]=H.target),H.type==="mousemove"){var _W3=A[M];var _z2;if(Z){var _=Z.ancestors||[];_z2=/* @__PURE__ */new Set([Z].concat(_toConsumableArray(_)));}else _z2=/* @__PURE__ */new Set();var Q=Object.entries(L);if(!_W3.has(Z)&&Z){var _3=new h["default"]("mouseenter");_3.setOriginalEvent(L),Q.forEach(function(_ref157){var _ref158=_slicedToArray(_ref157,2),q=_ref158[0],ht=_ref158[1];_3[q]=ht;}),_W3.add(Z),Z.dispatchEvent(_3);var st=Z.ancestors;st&&st.forEach(function(q){q instanceof a["default"]&&!_W3.has(q)&&(_W3.add(q),q.dispatchEvent(_3));});}var et=new h["default"]("mouseleave");et.setOriginalEvent(L),Q.forEach(function(_ref159){var _ref160=_slicedToArray(_ref159,2),_=_ref160[0],st=_ref160[1];et[_]=st;}),_toConsumableArray(_W3).forEach(function(_){_z2.has(_)||(_W3["delete"](_),_.dispatchEvent(et));});}});},{passive:P!=="contextmenu"});});}function f(A,R){if(R&&R.style){var b=A.width,P=A.height,L=A.mode,D=A.container;var I=D.clientWidth,C=D.clientHeight;b=b||I,P=P||C,L==="static"?(R.style.width="".concat(b,"px"),R.style.height="".concat(P,"px")):(R.style.top="0",R.style.left="0",R.style.width="".concat(I,"px"),R.style.height="".concat(C,"px"),R.style.transform="",R.style.webkitTransform="");}}var g=Symbol("offscreenLayerCount");var O=/*#__PURE__*/function(_c$default){/**
|
|
382
|
-
width
|
|
383
|
-
height
|
|
384
|
-
mode: 'static', 'scale', 'stickyWidth', 'stickyHeight', 'stickyTop', 'stickyBottom', 'stickyLeft', 'stickyRight'
|
|
385
|
-
*/function O(){var _this57;var R=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,O);if(_this57=_callSuper(this,O),!R.container)if(typeof n.ENV.Container=="function")R.container=new n.ENV.Container(R.width||300,R.height||150);else throw new Error("No container specified.");if(_this57.container=R.container,_this57.container.style&&(_this57.container.style.overflow||(_this57.container.style.overflow="hidden"),_this57.container.style.position||(_this57.container.style.position="relative")),_this57.options=R,R.displayRatio=R.displayRatio||1,R.mode=R.mode||"scale",R.left=0,R.top=0,R.autoResize=R.autoResize!==!1,R.autoResize){var b;if((typeof globalThis==="undefined"?"undefined":_typeof(globalThis))<"u"?b=globalThis:b=(typeof window==="undefined"?"undefined":_typeof(window))<"u"?window:e,b.addEventListener){var P=_assertThisInitialized(_this57);b.addEventListener("resize",function L(){(typeof document==="undefined"?"undefined":_typeof(document))<"u"&&document.contains(P.container)?P.resize():b.removeEventListener("resize",L);});}}_this57[M]=/* @__PURE__ */new Set(),_this57.setResolution(R),d(_assertThisInitialized(_this57)),_this57[g]=0;return _assertThisInitialized(_this57);}_inherits(O,_c$default);return _createClass(O,[{key:"hasOffscreenCanvas",get:function get(){return this[g]>0;}},{key:"displayRatio",get:function get(){return this.options.displayRatio;},set:function set(R){this.options.displayRatio!==R&&(this.options.displayRatio=R,this.resize());}},{key:"height",get:function get(){return this.options.height;},set:function set(R){this.options.height!==R&&(this.options.height=R,this.resize());}},{key:"mode",get:function get(){return this.options.mode;},set:function set(R){this.options.mode!==R&&(this.options.mode=R,this.resize());}},{key:"width",get:function get(){return this.options.width;}/* override */,set:function set(R){this.options.width!==R&&(this.options.width=R,this.resize());}},{key:"appendChild",value:function appendChild(R){!(R instanceof o["default"])&&!(R instanceof s["default"])&&T(R);var b=_get(_getPrototypeOf(O.prototype),"appendChild",this).call(this,R),P=R.canvas;return R.offscreen?this[g]++:this.container.appendChild(P),f(this.options,P),R.setResolution(this.getResolution()),b;}/* override */},{key:"forceUpdate",value:function forceUpdate(){var _this58=this;this.hasOffscreenCanvas&&!this._requestID&&(this._requestID=Object(i.requestAnimationFrame)(function(){delete _this58._requestID,_this58.render();}));}/* override */},{key:"insertBefore",value:function insertBefore(R,b){!(R instanceof o["default"])&&!(R instanceof s["default"])&&T(R);var P=_get(_getPrototypeOf(O.prototype),"insertBefore",this).call(this,R,b),L=R.canvas;if(!R.offscreen){var D=m(this,R);this.container.insertBefore(L,D);}return f(this.options,L),R.setResolution(this.getResolution()),P;}},{key:"layer",value:function layer(){var R=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=R;var P=this.orderedChildren;for(var I=0;I<P.length;I++)if(P[I].id===R)return P[I];var L=b.worker;var D;return L?D=new s["default"](b):D=new o["default"](b),this.appendChild(D),D;}},{key:"preload",value:function(){var _preload=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee20(){var _this59=this;var _len13,R,_key13,b,P,L,_loop2,D,_args21=arguments;return _regeneratorRuntime().wrap(function _callee20$(_context21){while(1)switch(_context21.prev=_context21.next){case 0:for(_len13=_args21.length,R=new Array(_len13),_key13=0;_key13<_len13;_key13++){R[_key13]=_args21[_key13];}b=[],P=[],L=[];_loop2=/*#__PURE__*/_regeneratorRuntime().mark(function _loop2(D){var I,C,B,G;return _regeneratorRuntime().wrap(function _loop2$(_context20){while(1)switch(_context20.prev=_context20.next){case 0:I=R[D];if(typeof I=="string")C=Object(v.loadTexture)(I);else if(Array.isArray(I))C=Object(v.loadFrames).apply(void 0,_toConsumableArray(I));else{B=I.id,G=I.src;C=Object(v.loadTexture)(G,B);}C instanceof Promise||(C=Promise.resolve(C)),P.push(C.then(function(B){b.push(B),L[D]=B;var G=new h["default"]({type:"preload",detail:{current:B,loaded:b,resources:R}});_this59.dispatchEvent(G);}));case 3:case"end":return _context20.stop();}},_loop2);});D=0;case 4:if(!(D<R.length)){_context21.next=9;break;}return _context21.delegateYield(_loop2(D),"t0",6);case 6:D++;_context21.next=4;break;case 9:_context21.next=11;return Promise.all(P);case 11:return _context21.abrupt("return",L);case 12:case"end":return _context21.stop();}},_callee20);}));function preload(){return _preload.apply(this,arguments);}return preload;}()/* override */},{key:"removeChild",value:function removeChild(R){var b=_get(_getPrototypeOf(O.prototype),"removeChild",this).call(this,R);if(b){R._prepareRenderFinished&&R._prepareRenderFinished();var P=R.canvas;P&&P.remove&&P.remove(),R.offscreen&&this[g]--;}return b;}// for offscreen mode rendering
|
|
386
|
-
},{key:"render",value:function render(){var R=this.orderedChildren;var b=null;var P=[];for(var L=0;L<R.length;L++){var D=R[L],I=P.length>0;if(D instanceof o["default"]&&!D.offscreen){if(!D.autoRender)I&&(console.warn("Some offscreen canvas will not be rendered."),P.length=0);else if(b=D,I){D.renderer.clear();for(var C=0;C<P.length;C++){var B=P[C];B.render(),x(D,B);}P.length=0,D.render({clear:!1});}else D.prepareRender&&D.render();}else D.offscreen?b?(D.prepareRender&&D.render(),x(b,D)):P.push(D):D instanceof s["default"]&&I&&(console.warn("Some offscreen canvas will not be rendered."),P.length=0);}}/* override */},{key:"replaceChild",value:function replaceChild(R,b){var P=_get(_getPrototypeOf(O.prototype),"replaceChild",this).call(this,R,b);b.canvas.remove&&b.canvas.remove(),b.offscreen&&this[g]--;var L=R.canvas;if(!R.offscreen){var D=m(this,R);this.container.insertBefore(L,D);}return f(this.options,L),R.setResolution(this.getResolution()),P;}},{key:"resize",value:function resize(){var R=this.options;this.children.forEach(function(b){f(R,b.canvas);}),this.setResolution(R),this.dispatchEvent({type:"resize"});}/* override */},{key:"setResolution",value:function setResolution(){var _R4,_b10;var _ref161=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},R=_ref161.width,b=_ref161.height;var P=this.container,L=P.clientWidth,D=P.clientHeight;(R==null||b==null)&&(R=(_R4=R)!==null&&_R4!==void 0?_R4:L,b=(_b10=b)!==null&&_b10!==void 0?_b10:D);var _this$options=this.options,I=_this$options.mode,C=_this$options.displayRatio;if(R*=C,b*=C,this.options.left=0,this.options.top=0,I==="stickyHeight"||I==="stickyLeft"||I==="stickyRight"){var B=R;R=L*b/D,I==="stickyHeight"&&(this.options.left=0.5*(R-B)),I==="stickyRight"&&(this.options.left=R-B);}else if(I==="stickyWidth"||I==="stickyTop"||I==="stickyBottom"){var _B4=b;b=D*R/L,I==="stickyWidth"&&(this.options.top=0.5*(b-_B4)),I==="stickyBottom"&&(this.options.top=b-_B4);}_get(_getPrototypeOf(O.prototype),"setResolution",this).call(this,{width:R,height:b});}},{key:"snapshot",value:function snapshot(){var _ref162=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref162$offscreen=_ref162.offscreen,R=_ref162$offscreen===void 0?!1:_ref162$offscreen,b=_ref162.layers;var P=R?"snapshotOffScreenCanvas":"snapshotCanvas",_this$getResolution9=this.getResolution(),L=_this$getResolution9.width,D=_this$getResolution9.height;this[P]=this[P]||n.ENV.createCanvas(L,D,{offscreen:R});var I=this[P].getContext("2d");b=b||this.orderedChildren,this[P].width=L,this[P].height=D;for(var C=0;C<b.length;C++){var B=b[C];if(!B.options.ignoreSnapshot){B.render&&B.render();var G=B.canvas;G&&G!==B&&I.drawImage(G,0,0,L,D);}}return this[P];}}]);}(c["default"]);(typeof document==="undefined"?"undefined":_typeof(document))<"u"&&(O.prototype.layer3d=function(A){var _this60=this;var R=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var b=R.url||"https://unpkg.com/sprite-extend-3d/dist/sprite-extend-3d.min.js";return new Promise(function(P,L){var D=document.createElement("script");D.async=!1,D.src=b,D.onload=function(){try{P(_this60.layer3d(A,R));}catch(I){L(I);}},document.documentElement.appendChild(D);});}),y["default"].registerNode(O,"scene");}.call(this,t(22));},/* 291 */ /***/function(u,r,t){t.r(r),t.d(r,"default",function(){return n;});var e=t(214);t(1).glMatrix.setMatrixArrayType(Array);function n(i){var _ref163=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref163$offsetTop=_ref163.offsetTop,a=_ref163$offsetTop===void 0?0:_ref163$offsetTop,_ref163$offsetLeft=_ref163.offsetLeft,o=_ref163$offsetLeft===void 0?0:_ref163$offsetLeft,_ref163$displayRatio=_ref163.displayRatio,s=_ref163$displayRatio===void 0?1:_ref163$displayRatio;var c,p;var h=[],_i$target$getBounding=i.target.getBoundingClientRect(),v=_i$target$getBounding.left,y=_i$target$getBounding.top,M=_i$target$getBounding.width,T=_i$target$getBounding.height,m=i.target.width,x=i.target.height,l=i.changedTouches||[i];for(var f=0;f<l.length;f++){var g=l[f],O=g.identifier,A=g.clientX,R=g.clientY;A!=null&&R!=null&&h.push({x:Math.round((A|0)-v),y:Math.round((R|0)-y),identifier:O});}h.length<=0&&h.push({x:c,y:p});var d=[];return h.forEach(function(f){f.x!=null&&f.y!=null&&(c=(f.x*m/M-o)/s,p=(f.y*x/T-a)/s);var g=new e["default"](i);Object.defineProperties(g,{layerX:{value:c,configurable:!0},layerY:{value:p,configurable:!0},originalX:{value:f.x},originalY:{value:f.y},x:{value:c,configurable:!0},y:{value:p,configurable:!0},identifier:{value:f.identifier}}),d.push(g);}),d;}}/******/]);Wt.version;Wt.Arc;Wt.Block;Wt.Cloud;Wt.Color;var yd=Wt.Ellipse;Wt.Gradient;var qt=Wt.Group,Sd=Wt.Label,xd=Wt.Layer;Wt.LayerWorker;Wt.Node;Wt.Parallel;var pe=Wt.Path,ae=Wt.Polyline,an=Wt.Rect;Wt.Regular;Wt.Ring;var Td=Wt.Scene,Md=Wt.Sprite;Wt.SpriteSvg;Wt.Star;Wt.Triangle;Wt.helpers;Wt.createElement;Wt.isSpriteNode;Wt.registerNode;Wt.requestAnimationFrame;Wt.cancelAnimationFrame;Wt.ENV;var Mt=/*#__PURE__*/function(_tt){function Mt(){var _this61;var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{x:0,y:0};var i=arguments.length>4&&arguments[4]!==undefined?arguments[4]:0;var a=arguments.length>5&&arguments[5]!==undefined?arguments[5]:0;_classCallCheck(this,Mt);_this61=_callSuper(this,Mt,[r,t,e]),_this61.x=r,_this61.y=t,_this61.z=e,_this61.v=n,_this61.t=i,_this61.a=a;return _this61;}_inherits(Mt,_tt);return _createClass(Mt,[{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(r){this.a=r;}},{key:"setT",value:function setT(r){this.t=r;}},{key:"setv",value:function setv(r){return this.v={x:r.x,y:r.y},this;}},{key:"set",value:function set(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.x;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.y;var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this.z;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:this.v;var i=arguments.length>4&&arguments[4]!==undefined?arguments[4]:this.t;var a=arguments.length>5&&arguments[5]!==undefined?arguments[5]:this.a;return this.x=r,this.y=t,this.z=e,this.v=n,this.t=i,this.a=a,this;}},{key:"clone",value:function clone(){var r=this.x,t=this.y,e=this.z,n=this.v,i=this.t,a=this.a,o={x:n.x,y:n.y};return new Mt(r,t,e,o,i,a);}},{key:"distance",value:function distance(r){return Mt.GetDistance(this,r);}},{key:"isNear",value:function isNear(r,t){return Mt.IsNear(this,r,t);}},{key:"getAngleByPoints",value:function getAngleByPoints(r,t){return Mt.GetAngleByPoints(r,this,t);}}],[{key:"Sub",value:function Sub(r,t){return new Mt(r.x-t.x,r.y-t.y);}},{key:"Add",value:function Add(r,t){return new Mt(r.x+t.x,r.y+t.y);}},{key:"GetDistance",value:function GetDistance(r,t){return Mt.Len(r.clone().sub(t));}},{key:"GetAngleByPoints",value:function GetAngleByPoints(r,t,e){var n=t.x-r.x,i=e.x-t.x,a=t.y-r.y,o=e.y-t.y;var s=0;var c=Math.sqrt(n*n+a*a),p=Math.sqrt(i*i+o*o);if(c&&p){var h=n*i+a*o;s=Math.acos(h/(c*p)),s=s/Math.PI*180;var v=n*o-a*i;v=v>0?1:-1,s=180+v*s;}return s;}},{key:"IsNear",value:function IsNear(r,t,e){return Mt.Len(r.clone().sub(t))<e;}},{key:"RotWith",value:function RotWith(r,t,e){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:2;var i=r.x-t.x,a=r.y-t.y,o=Math.sin(e),s=Math.cos(e),c=Math.pow(10,n),p=Math.floor((t.x+(i*s-a*o))*c)/c,h=Math.floor((t.y+(i*o+a*s))*c)/c;return new Mt(p,h);}/**
|
|
387
|
-
* 根据圆心和半径,获取圆上的等份点
|
|
388
|
-
* @param o 圆心
|
|
389
|
-
* @param radius 半径
|
|
390
|
-
* @param average 均分数
|
|
391
|
-
* @returns
|
|
392
|
-
*/},{key:"GetDotStroke",value:function GetDotStroke(r,t){var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:16;var n=new tt(1,1),i=Math.PI+1e-3,a=Mt.Add(r,Mt.Sub(r,n).uni().per().mul(-t)),o=[];for(var s=1/e,c=s;c<=1;c+=s)o.push(Mt.RotWith(a,r,i*2*c));return o;}/**
|
|
393
|
-
* 根据圆心和圆上的起始点,获取半圆上的等份点
|
|
394
|
-
* @param o 圆心
|
|
395
|
-
* @param p 圆弧起始点
|
|
396
|
-
* @param radian 1,逆时针180度 -1,顺时针
|
|
397
|
-
* @param average 均分数
|
|
398
|
-
* @returns
|
|
399
|
-
*/},{key:"GetSemicircleStroke",value:function GetSemicircleStroke(r,t){var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:-1;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:8;var i=e*(Math.PI+1e-3),a=[];for(var o=1/n,s=o;s<=1;s+=o)a.push(Mt.RotWith(t,r,i*s));return a;}}]);}(tt);function ue(u){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var t=u.length;if(t<2)return"";var e=u[0],n=u[1];if(t===2)return"M".concat(ve(e),"L").concat(ve(n));var i="";for(var a=2,o=t-1;a<o;a++)e=u[a],n=u[a+1],i+=me(e,n);return r?"M".concat(me(u[0],u[1]),"Q").concat(ve(u[1])).concat(me(u[1],u[2]),"T").concat(i).concat(me(u[t-1],u[0])).concat(me(u[0],u[1]),"Z"):"M".concat(ve(u[0]),"Q").concat(ve(u[1])).concat(me(u[1],u[2])).concat(u.length>3?"T":"").concat(i,"L").concat(ve(u[t-1]));}var Cr={exports:{}};Cr.exports;(function(u){var r=function(){var t=String.fromCharCode,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",i={};function a(s,c){if(!i[s]){i[s]={};for(var p=0;p<s.length;p++)i[s][s.charAt(p)]=p;}return i[s][c];}var o={compressToBase64:function compressToBase64(s){if(s==null)return"";var c=o._compress(s,6,function(p){return e.charAt(p);});switch(c.length%4){default:case 0:return c;case 1:return c+"===";case 2:return c+"==";case 3:return c+"=";}},decompressFromBase64:function decompressFromBase64(s){return s==null?"":s==""?null:o._decompress(s.length,32,function(c){return a(e,s.charAt(c));});},compressToUTF16:function compressToUTF16(s){return s==null?"":o._compress(s,15,function(c){return t(c+32);})+" ";},decompressFromUTF16:function decompressFromUTF16(s){return s==null?"":s==""?null:o._decompress(s.length,16384,function(c){return s.charCodeAt(c)-32;});},//compress into uint8array (UCS-2 big endian format)
|
|
400
|
-
compressToUint8Array:function compressToUint8Array(s){for(var c=o.compress(s),p=new Uint8Array(c.length*2),h=0,v=c.length;h<v;h++){var y=c.charCodeAt(h);p[h*2]=y>>>8,p[h*2+1]=y%256;}return p;},//decompress from uint8array (UCS-2 big endian format)
|
|
401
|
-
decompressFromUint8Array:function decompressFromUint8Array(s){if(s==null)return o.decompress(s);for(var c=new Array(s.length/2),p=0,h=c.length;p<h;p++)c[p]=s[p*2]*256+s[p*2+1];var v=[];return c.forEach(function(y){v.push(t(y));}),o.decompress(v.join(""));},//compress into a string that is already URI encoded
|
|
402
|
-
compressToEncodedURIComponent:function compressToEncodedURIComponent(s){return s==null?"":o._compress(s,6,function(c){return n.charAt(c);});},//decompress from an output of compressToEncodedURIComponent
|
|
403
|
-
decompressFromEncodedURIComponent:function decompressFromEncodedURIComponent(s){return s==null?"":s==""?null:(s=s.replace(/ /g,"+"),o._decompress(s.length,32,function(c){return a(n,s.charAt(c));}));},compress:function compress(s){return o._compress(s,16,function(c){return t(c);});},_compress:function _compress(s,c,p){if(s==null)return"";var h,v,y={},M={},T="",m="",x="",l=2,d=3,f=2,g=[],O=0,A=0,R;for(R=0;R<s.length;R+=1)if(T=s.charAt(R),Object.prototype.hasOwnProperty.call(y,T)||(y[T]=d++,M[T]=!0),m=x+T,Object.prototype.hasOwnProperty.call(y,m))x=m;else{if(Object.prototype.hasOwnProperty.call(M,x)){if(x.charCodeAt(0)<256){for(h=0;h<f;h++)O=O<<1,A==c-1?(A=0,g.push(p(O)),O=0):A++;for(v=x.charCodeAt(0),h=0;h<8;h++)O=O<<1|v&1,A==c-1?(A=0,g.push(p(O)),O=0):A++,v=v>>1;}else{for(v=1,h=0;h<f;h++)O=O<<1|v,A==c-1?(A=0,g.push(p(O)),O=0):A++,v=0;for(v=x.charCodeAt(0),h=0;h<16;h++)O=O<<1|v&1,A==c-1?(A=0,g.push(p(O)),O=0):A++,v=v>>1;}l--,l==0&&(l=Math.pow(2,f),f++),delete M[x];}else for(v=y[x],h=0;h<f;h++)O=O<<1|v&1,A==c-1?(A=0,g.push(p(O)),O=0):A++,v=v>>1;l--,l==0&&(l=Math.pow(2,f),f++),y[m]=d++,x=String(T);}if(x!==""){if(Object.prototype.hasOwnProperty.call(M,x)){if(x.charCodeAt(0)<256){for(h=0;h<f;h++)O=O<<1,A==c-1?(A=0,g.push(p(O)),O=0):A++;for(v=x.charCodeAt(0),h=0;h<8;h++)O=O<<1|v&1,A==c-1?(A=0,g.push(p(O)),O=0):A++,v=v>>1;}else{for(v=1,h=0;h<f;h++)O=O<<1|v,A==c-1?(A=0,g.push(p(O)),O=0):A++,v=0;for(v=x.charCodeAt(0),h=0;h<16;h++)O=O<<1|v&1,A==c-1?(A=0,g.push(p(O)),O=0):A++,v=v>>1;}l--,l==0&&(l=Math.pow(2,f),f++),delete M[x];}else for(v=y[x],h=0;h<f;h++)O=O<<1|v&1,A==c-1?(A=0,g.push(p(O)),O=0):A++,v=v>>1;l--,l==0&&(l=Math.pow(2,f),f++);}for(v=2,h=0;h<f;h++)O=O<<1|v&1,A==c-1?(A=0,g.push(p(O)),O=0):A++,v=v>>1;for(;;)if(O=O<<1,A==c-1){g.push(p(O));break;}else A++;return g.join("");},decompress:function decompress(s){return s==null?"":s==""?null:o._decompress(s.length,32768,function(c){return s.charCodeAt(c);});},_decompress:function _decompress(s,c,p){var h=[],v=4,y=4,M=3,T="",m=[],x,l,d,f,g,O,A,R={val:p(0),position:c,index:1};for(x=0;x<3;x+=1)h[x]=x;for(d=0,g=Math.pow(2,2),O=1;O!=g;)f=R.val&R.position,R.position>>=1,R.position==0&&(R.position=c,R.val=p(R.index++)),d|=(f>0?1:0)*O,O<<=1;switch(d){case 0:for(d=0,g=Math.pow(2,8),O=1;O!=g;)f=R.val&R.position,R.position>>=1,R.position==0&&(R.position=c,R.val=p(R.index++)),d|=(f>0?1:0)*O,O<<=1;A=t(d);break;case 1:for(d=0,g=Math.pow(2,16),O=1;O!=g;)f=R.val&R.position,R.position>>=1,R.position==0&&(R.position=c,R.val=p(R.index++)),d|=(f>0?1:0)*O,O<<=1;A=t(d);break;case 2:return"";}for(h[3]=A,l=A,m.push(A);;){if(R.index>s)return"";for(d=0,g=Math.pow(2,M),O=1;O!=g;)f=R.val&R.position,R.position>>=1,R.position==0&&(R.position=c,R.val=p(R.index++)),d|=(f>0?1:0)*O,O<<=1;switch(A=d){case 0:for(d=0,g=Math.pow(2,8),O=1;O!=g;)f=R.val&R.position,R.position>>=1,R.position==0&&(R.position=c,R.val=p(R.index++)),d|=(f>0?1:0)*O,O<<=1;h[y++]=t(d),A=y-1,v--;break;case 1:for(d=0,g=Math.pow(2,16),O=1;O!=g;)f=R.val&R.position,R.position>>=1,R.position==0&&(R.position=c,R.val=p(R.index++)),d|=(f>0?1:0)*O,O<<=1;h[y++]=t(d),A=y-1,v--;break;case 2:return m.join("");}if(v==0&&(v=Math.pow(2,M),M++),h[A])T=h[A];else if(A===y)T=l+l.charAt(0);else return null;m.push(T),h[y++]=l+T.charAt(0),v--,l=T,v==0&&(v=Math.pow(2,M),M++);}}};return o;}();u!=null?u.exports=r:(typeof angular==="undefined"?"undefined":_typeof(angular))<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return r;});})(Cr);var ni=Cr.exports;function Me(u){return JSON.parse(ni.decompress(u));}function _t(u){return ni.compress(JSON.stringify(u));}var ii=/*#__PURE__*/function(_yt){function ii(t){var _this62;_classCallCheck(this,ii);_this62=_callSuper(this,ii,[t]);rt(_this62,"canRotate",!0);rt(_this62,"scaleType",Gt.all);rt(_this62,"toolsType",gt.Pencil);rt(_this62,"syncTimestamp");rt(_this62,"syncIndex",0);rt(_this62,"tmpPoints",[]);rt(_this62,"MAX_REPEAR",10);/** 合并原始点的灵敏度 */rt(_this62,"uniThickness");rt(_this62,"workOptions");rt(_this62,"centerPos",[0,0]);_this62.workOptions=t.toolsOpt,_this62.uniThickness=_this62.MAX_REPEAR/_this62.workOptions.thickness/10,_this62.syncTimestamp=0;return _this62;}/** 批量合并消费本地数据,返回绘制结果 */_inherits(ii,_yt);return _createClass(ii,[{key:"combineConsume",value:function combineConsume(){var o;var t=(o=this.workId)==null?void 0:o.toString();if(this.tmpPoints.length<2)return{type:ft.None};var e=this.transformDataAll(!0),n={name:t};var i;var a=this.drawLayer||this.fullLayer;return e.length&&(i=this.draw({attrs:n,tasks:e,replaceId:t,layer:a})),{rect:i,type:ft.DrawWork,dataType:Tt.Local};}},{key:"setWorkOptions",value:function setWorkOptions(t){_get(_getPrototypeOf(ii.prototype),"setWorkOptions",this).call(this,t),this.syncTimestamp=Date.now();}},{key:"consume",value:function consume(t){var _this63=this;var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=t.drawCount,s=t.replaceId,c=e.workId,_this$transformData=this.transformData(e,!1),p=_this$transformData.tasks,h=_this$transformData.effects,v=_this$transformData.consumeIndex;this.syncIndex=Math.min(this.syncIndex,v,Math.max(0,this.tmpPoints.length-2));var y={name:c,id:o==null?void 0:o.toString()};var M,T=!1;var m=this.syncIndex;if(this.syncTimestamp===0&&(this.syncTimestamp=Date.now()),p.length&&(p[0].taskId-this.syncTimestamp>this.syncUnitTime&&(T=!0,this.syncTimestamp=p[0].taskId,this.syncIndex=this.tmpPoints.length),i||a)){var _l26=n?this.fullLayer:this.drawLayer||this.fullLayer;M=this.draw({attrs:y,tasks:p,effects:h,layer:_l26,replaceId:s});}if(i)return v>10&&this.tmpPoints.splice(0,v-10),{rect:M,type:ft.DrawWork,dataType:Tt.Local};var x=[];return this.tmpPoints.slice(m).forEach(function(l){x.push(l.x,l.y,_this63.computRadius(l.z,_this63.workOptions.thickness));}),_objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:ft.DrawWork,dataType:Tt.Local,rect:M,op:T?x:void 0,index:T?m*3:void 0,updateNodeOpt:{useAnimation:!0}});}},{key:"consumeAll",value:function consumeAll(t){var p;var e=this.workId;if(t.data){var _t$data=t.data,h=_t$data.op,v=_t$data.workState;h!=null&&h.length&&v===It.Done&&this.workOptions.strokeType===Lt.Stroke&&this.updateTempPointsWithPressureWhenDone(h);}var n=this.transformDataAll(!0),i={name:e};var a;var o=this.fullLayer;if(n.length&&(a=this.draw({attrs:i,tasks:n,replaceId:e,layer:o})),this.tmpPoints.length<2)return this.replace(o,e),{type:ft.RemoveNode,removeIds:[e],rect:a};var s=[];this.tmpPoints.map(function(h){s.push(h.x,h.y,h.z);}),this.syncTimestamp=0,delete this.workOptions.syncUnitTime;var c=_t(s);return(p=this.vNodes)==null||p.setInfo(e,{rect:a,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&yt.getCenterPos(a,o)}),_objectSpread(_objectSpread({},this.baseConsumeResult),{},{rect:a,type:ft.FullWork,dataType:Tt.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 p,h;var e=t.op,n=t.isFullWork,i=t.replaceId;this.tmpPoints.length=0;for(var v=0;v<e.length;v+=3){var y=new Mt(e[v],e[v+1],e[v+2]);if(this.tmpPoints.length>0){var M=this.tmpPoints[this.tmpPoints.length-1],T=tt.Sub(y,M).uni();y.setv(T);}this.tmpPoints.push(y);}if(this.tmpPoints.length<2)return;var a=this.transformDataAll(!0),o=(p=this.workId)==null?void 0:p.toString(),s={name:o};var c;if(o&&a.length){var _v2=n?this.fullLayer:this.drawLayer||this.fullLayer;c=this.draw({attrs:s,tasks:a,replaceId:i,layer:_v2}),(h=this.vNodes)==null||h.setInfo(o,{rect:c,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:c&&yt.getCenterPos(c,_v2)});}return c;}},{key:"transformDataAll",value:function transformDataAll(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;var e=this.filterSamePoints(this.tmpPoints,this.workOptions.thickness);return this.getTaskPoints(e,t&&this.workOptions.thickness||void 0);}},{key:"draw",value:function draw(t){var _this64=this;var e=t.attrs,n=t.tasks,i=t.replaceId,a=t.effects,o=t.layer,_this$workOptions=this.workOptions,s=_this$workOptions.strokeColor,c=_this$workOptions.strokeType,p=_this$workOptions.thickness,h=_this$workOptions.zIndex,v=_this$workOptions.scale,y=_this$workOptions.rotate,M=_this$workOptions.translate;a!=null&&a.size&&(a.forEach(function(f){var g;(g=o.getElementById(f+""))==null||g.remove();}),a.clear());var T;var m=[],x=o.worldPosition,l=o.worldScaling;for(var f=0;f<n.length;f++){var _n$f=n[f],g=_n$f.pos,O=_n$f.points,_this$computDrawPoint=this.computDrawPoints(O),A=_this$computDrawPoint.ps,R=_this$computDrawPoint.rect;var b=void 0;var P=O.length===1;c===Lt.Stroke||P?b=ue(A,!0):b=ue(A,!1);var L={pos:g,d:b,fillColor:c===Lt.Stroke||P?s:void 0,lineDash:c===Lt.Dotted&&!P?[1,p*2]:c===Lt.LongDotted&&!P?[p,p*2]:void 0,strokeColor:s,lineCap:c===Lt.Stroke||P?void 0:"round",lineWidth:c===Lt.Stroke||P?0:p};T=Ot(T,{x:Math.floor((R.x+g[0])*l[0]+x[0]-yt.SafeBorderPadding),y:Math.floor((R.y+g[1])*l[1]+x[1]-yt.SafeBorderPadding),w:Math.floor(R.w*l[0]+2*yt.SafeBorderPadding),h:Math.floor(R.h*l[1]+2*yt.SafeBorderPadding)}),m.push(L);}v&&(e.scale=v),y&&(e.rotate=y),M&&(e.translate=M);var d=new qt();if(T){this.centerPos=yt.getCenterPos(T,o),d.attr(_objectSpread(_objectSpread({},e),{},{normalize:!0,anchor:[0.5,0.5],bgcolor:c===Lt.Stroke?s:void 0,pos:this.centerPos,size:[(T.w-2*yt.SafeBorderPadding)/l[0],(T.h-2*yt.SafeBorderPadding)/l[1]],zIndex:h}));var _f11=m.map(function(g){return g.pos=[g.pos[0]-_this64.centerPos[0],g.pos[1]-_this64.centerPos[1]],new pe(g);});d.append.apply(d,_toConsumableArray(_f11)),c===Lt.Stroke&&d.seal(),this.replace(o,i||e.workId,d);}if(v||y||M){var _f12=d==null?void 0:d.getBoundingClientRect();if(_f12)return{x:Math.floor(_f12.x-yt.SafeBorderPadding),y:Math.floor(_f12.y-yt.SafeBorderPadding),w:Math.floor(_f12.width+yt.SafeBorderPadding*2),h:Math.floor(_f12.height+yt.SafeBorderPadding*2)};}return T;}},{key:"computDrawPoints",value:function computDrawPoints(t){return this.workOptions.strokeType===Lt.Stroke||t.length===1?this.computStroke(t):this.computNomal(t);}},{key:"computNomal",value:function computNomal(t){var e=this.workOptions.thickness;var n=t.map(function(i){return e=Math.max(e,i.radius),i.point;});return{ps:n,rect:Ut(n,e)};}},{key:"computStroke",value:function computStroke(t){return t.length===1?this.computDotStroke(t[0]):this.computLineStroke(t);}},{key:"computLineStroke",value:function computLineStroke(t){var e=[],n=[];for(var c=0;c<t.length;c++){var _t$c=t[c],p=_t$c.point,h=_t$c.radius;var v=p.v;c===0&&t.length>1&&(v=t[c+1].point.v);var y=tt.Per(v).mul(h);e.push(Mt.Sub(p,y)),n.push(Mt.Add(p,y));}var i=t[t.length-1],a=Mt.GetSemicircleStroke(i.point,e[e.length-1],-1,8),o=Mt.GetSemicircleStroke(t[0].point,n[0],-1,8),s=e.concat(a,n.reverse(),o);return{ps:s,rect:Ut(s)};}},{key:"computDotStroke",value:function computDotStroke(t){var e=t.point,n=t.radius,i={x:e.x-n,y:e.y-n,w:n*2,h:n*2};return{ps:Mt.GetDotStroke(e,n,8),rect:i};}},{key:"transformData",value:function transformData(t,e){var n=t.op,i=t.workState;var a=this.tmpPoints.length-1,o=[];if(n!=null&&n.length&&i){var _this$workOptions2=this.workOptions,s=_this$workOptions2.strokeType,c=_this$workOptions2.thickness,p=/* @__PURE__ */new Set();a=s===Lt.Stroke?this.updateTempPointsWithPressure(n,c,p):this.updateTempPoints(n,c,p);var h=e?this.tmpPoints:this.tmpPoints.slice(a);return o=this.getTaskPoints(h,c),{tasks:o,effects:p,consumeIndex:a};}return{tasks:o,consumeIndex:a};}/** 压力渐变公式 */},{key:"computRadius",value:function computRadius(t,e){return t*0.03*e+e*0.5;}},{key:"getMinZ",value:function getMinZ(t,e){return((e||Math.max(1,Math.floor(t*0.3)))-t*0.5)*100/t/3;}},{key:"getTaskPoints",value:function getTaskPoints(t,e){var h;var n=[];if(t.length===0)return[];var i=0,a=t[0].x,o=t[0].y,s=[a,o],c=[],p=t[0].t;for(;i<t.length;){var v=t[i],y=v.x-a,M=v.y-o,T=v.z,m=e?this.computRadius(T,e):T;if(c.push({point:new Mt(y,M,T,t[i].v),radius:m}),i>0&&i<t.length-1){var _x50=t[i].getAngleByPoints(t[i-1],t[i+1]);if(_x50<90||_x50>270){var _l27=(h=c.pop())==null?void 0:h.point.clone();_l27&&n.push({taskId:p,pos:s,points:[].concat(_toConsumableArray(c),[{point:_l27,radius:m}])}),a=t[i].x,o=t[i].y,s=[a,o];var d=v.x-a,f=v.y-o;c=[{point:new Mt(d,f,T),radius:m}],p=Date.now();}}i++;}return n.push({taskId:p,pos:s,points:c}),n;}},{key:"updateTempPointsWithPressure",value:function updateTempPointsWithPressure(t,e,n){var i=Date.now(),a=this.tmpPoints.length;var o=a;for(var c=0;c<t.length;c+=2){o=Math.min(o,a);var p=this.tmpPoints.length,h=new Mt(t[c],t[c+1]);if(p===0){this.tmpPoints.push(h);continue;}var v=p-1,y=this.tmpPoints[v],M=tt.Sub(h,y).uni();if(h.isNear(y,e)){if(y.z<this.MAX_REPEAR){if(y.setz(Math.min(y.z+1,this.MAX_REPEAR)),o=Math.min(o,v),p>1){var _x51=p-1;for(;_x51>0;){var _l28=this.tmpPoints[_x51].distance(this.tmpPoints[_x51-1]),d=Math.max(this.tmpPoints[_x51].z-this.uniThickness*_l28,0);if(this.tmpPoints[_x51-1].z>=d)break;this.tmpPoints[_x51-1].setz(d),o=Math.min(o,_x51-1),_x51--;}}}else o=1/0;continue;}h.setv(M);var T=h.distance(y),m=Math.max(y.z-this.uniThickness*T,0);p>1&&tt.Equals(M,y.v,0.02)&&(m>0||y.z<=0)&&(n&&y.t&&n.add(y.t),this.tmpPoints.pop(),o=Math.min(v,o)),h.setz(m),this.tmpPoints.push(h);}if(o===1/0)return this.tmpPoints.length;var s=a;if(o===a){s=Math.max(s-1,0);var _c3=this.tmpPoints[s].t;_c3&&(n==null||n.add(_c3));}else{var _c4=a-1;for(s=o;_c4>=0;){var _p4=this.tmpPoints[_c4].t;if(_p4&&(n==null||n.add(_p4),_c4<=o)){s=_c4,_c4=-1;break;}_c4--;}}return this.tmpPoints[s].setT(i),s;}},{key:"updateTempPoints",value:function updateTempPoints(t,e,n){var c;var i=Date.now(),a=this.tmpPoints.length;var o=a;for(var p=0;p<t.length;p+=2){var h=this.tmpPoints.length,v=new Mt(t[p],t[p+1]);if(h===0){this.tmpPoints.push(v);continue;}var y=h-1,M=this.tmpPoints[y],T=tt.Sub(v,M).uni();if(v.isNear(M,e/2)){o=Math.min(y,o);continue;}tt.Equals(T,M.v,0.02)&&(n&&M.t&&n.add(M.t),this.tmpPoints.pop(),o=Math.min(y,o)),v.setv(T),this.tmpPoints.push(v);}var s=a;if(o===a){s=Math.max(s-1,0);var _p5=this.tmpPoints[s].t;_p5&&(n==null||n.add(_p5));}else{var _p6=Math.min(a-1,o);for(s=o;_p6>=0;){var _h4=(c=this.tmpPoints[_p6])==null?void 0:c.t;if(_h4&&(n==null||n.add(_h4),_p6<=o)){s=_p6,_p6=-1;break;}_p6--;}}return this.tmpPoints[s].setT(i),s;}},{key:"updateTempPointsWithPressureWhenDone",value:function updateTempPointsWithPressureWhenDone(t){var e=this.workOptions.thickness,n=t.length,i=this.getMinZ(e);for(var a=0;a<n;a+=2){var o=this.tmpPoints.length,s=new Mt(t[a],t[a+1]);if(o===0){this.tmpPoints.push(s);continue;}var c=o-1,p=this.tmpPoints[c],h=tt.Sub(s,p).uni(),v=s.distance(p);if(o>1&&p.z===i)break;if(s.isNear(p,e/2)){if(n<3&&p.z<this.MAX_REPEAR&&(p.setz(Math.min(p.z+1,this.MAX_REPEAR)),o>1)){var M=o-1;for(;M>0;){var T=this.tmpPoints[M].distance(this.tmpPoints[M-1]),m=Math.max(this.tmpPoints[M].z-this.uniThickness*T,-e/4);if(this.tmpPoints[M-1].z>=m)break;this.tmpPoints[M-1].setz(m),M--;}}continue;}s.setv(h);var y=Math.max(p.z-this.uniThickness*v,i);o>1&&tt.Equals(h,p.v,0.02)&&p.z<=0&&this.tmpPoints.pop(),s.setz(y),this.tmpPoints.push(s);}}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var c,p;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=n.strokeType,s=i.get(e.name);return a&&(e.tagName==="GROUP"?j0(e)?e.setAttribute("bgcolor",a):e.children.forEach(function(h){h.setAttribute("strokeColor",a),h.getAttribute("fillColor")&&h.setAttribute("fillColor",a);}):(e.setAttribute("strokeColor",a),e.setAttribute("fillColor",a)),(c=s==null?void 0:s.opt)!=null&&c.strokeColor&&(s.opt.strokeColor=a)),o&&s!=null&&s.opt&&(p=s.opt)!=null&&p.strokeType&&(s.opt.strokeType=o),s&&i.setInfo(e.name,s),yt.updateNodeOpt(t);}}]);}(yt);var si=/*#__PURE__*/function(_yt2){function si(t){var _this65;_classCallCheck(this,si);_this65=_callSuper(this,si,[t]);rt(_this65,"toolsType",gt.LaserPen);rt(_this65,"canRotate",!1);rt(_this65,"scaleType",Gt.none);rt(_this65,"syncTimestamp");rt(_this65,"syncIndex",0);rt(_this65,"tmpPoints",[]);rt(_this65,"workOptions");rt(_this65,"consumeIndex",0);_this65.workOptions=t.toolsOpt,_this65.syncTimestamp=0;return _this65;}_inherits(si,_yt2);return _createClass(si,[{key:"combineConsume",value:function combineConsume(){}},{key:"setWorkOptions",value:function setWorkOptions(t){_get(_getPrototypeOf(si.prototype),"setWorkOptions",this).call(this,t),this.syncTimestamp=Date.now();}},{key:"consume",value:function consume(t){var e=t.data,n=t.isSubWorker,i=e.workId,a=e.op;if((a==null?void 0:a.length)===0)return{type:ft.None};if(this.updateTempPoints(a||[]),this.consumeIndex>this.tmpPoints.length-4)return{type:ft.None};var _this$workOptions3=this.workOptions,o=_this$workOptions3.strokeColor,s=_this$workOptions3.thickness,c=_this$workOptions3.strokeType,p=Ut(this.tmpPoints,s);var h=!1;var v=this.syncIndex,y=this.tmpPoints.slice(this.consumeIndex);this.consumeIndex=this.tmpPoints.length-1,this.syncTimestamp===0&&(this.syncTimestamp=Date.now());var M={name:i==null?void 0:i.toString(),opacity:1,lineDash:c===Lt.Dotted?[1,s*2]:c===Lt.LongDotted?[s,s*2]:void 0,strokeColor:o,lineCap:"round",lineWidth:s,anchor:[0.5,0.5]},T=this.getTaskPoints(y);if(T.length){var _x52=Date.now();_x52-this.syncTimestamp>this.syncUnitTime&&(h=!0,this.syncTimestamp=_x52,this.syncIndex=this.tmpPoints.length),n&&this.draw({attrs:M,tasks:T,isDot:!1,layer:this.drawLayer||this.fullLayer});}var m=[];return this.tmpPoints.slice(v).forEach(function(x){m.push(x.x,x.y);}),_objectSpread({rect:{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]},type:ft.DrawWork,dataType:Tt.Local,op:h?m:void 0,index:h?v*2:void 0},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var a;var t=(a=this.workId)==null?void 0:a.toString();var e;if(this.tmpPoints.length-1>this.consumeIndex){var o=this.tmpPoints.slice(this.consumeIndex);var s=o.length===1,_this$workOptions4=this.workOptions,c=_this$workOptions4.strokeColor,p=_this$workOptions4.thickness,h=_this$workOptions4.strokeType;if(s){var M=this.computDotStroke({point:o[0],radius:p/2});o=M.ps,e=M.rect;}else e=Ut(this.tmpPoints,p);var v={name:t==null?void 0:t.toString(),fillColor:s?c:void 0,opacity:1,lineDash:h===Lt.Dotted&&!s?[1,p*2]:h===Lt.LongDotted&&!s?[p,p*2]:void 0,strokeColor:c,lineCap:s?void 0:"round",lineWidth:s?0:p,anchor:[0.5,0.5]},y=this.getTaskPoints(o);y.length&&this.draw({attrs:v,tasks:y,isDot:s,layer:this.drawLayer||this.fullLayer});}var n=[];this.tmpPoints.forEach(function(o){n.push(o.x,o.y);});var i=_t(n);return _objectSpread({rect:e&&{x:e.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:e.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:e.w*this.fullLayer.worldScaling[0],h:e.h*this.fullLayer.worldScaling[1]},type:ft.FullWork,dataType:Tt.Local,ops:i,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 T;var e=t.op,n=t.replaceId,i=t.isFullWork,_this$workOptions5=this.workOptions,a=_this$workOptions5.strokeColor,o=_this$workOptions5.thickness,s=_this$workOptions5.strokeType;if(!e.length){var m=Ut(this.tmpPoints,o);return{x:m.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:m.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:m.w*this.fullLayer.worldScaling[0],h:m.h*this.fullLayer.worldScaling[1]};}var c=Math.max(0,this.tmpPoints.length-1);this.updateTempPoints(e||[]);var p,h=this.tmpPoints.slice(c);var v=h.length===1;if(v){var _m6=this.computDotStroke({point:h[0],radius:o/2});h=_m6.ps,p=_m6.rect;}else p=Ut(this.tmpPoints,o);var y={name:(T=this.workId)==null?void 0:T.toString(),fillColor:v?a:void 0,opacity:1,lineDash:s===Lt.Dotted&&!v?[1,o*2]:s===Lt.LongDotted&&!v?[o,o*2]:void 0,strokeColor:a,lineCap:v?void 0:"round",lineWidth:v?0:o,anchor:[0.5,0.5]},M=this.getTaskPoints(h);if(M.length){var _m7=i?this.fullLayer:this.drawLayer||this.fullLayer;this.draw({attrs:y,tasks:M,isDot:v,replaceId:n,layer:_m7});}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]};}},{key:"computDotStroke",value:function computDotStroke(t){var e=t.point,n=t.radius,i={x:e.x-n,y:e.y-n,w:n*2,h:n*2};return{ps:Mt.GetDotStroke(e,n,8),rect:i};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=this.tmpPoints.length;for(var n=0;n<t.length;n+=2){if(e){var i=this.tmpPoints.slice(-1)[0];i&&i.x===t[n]&&i.y===t[n+1]&&this.tmpPoints.pop();}this.tmpPoints.push(new Mt(t[n],t[n+1]));}}},{key:"draw",value:function(){var _draw2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee21(t){var _this66=this;var e,n,i,a,o,_iterator13,_step13,_loop3;return _regeneratorRuntime().wrap(function _callee21$(_context23){while(1)switch(_context23.prev=_context23.next){case 0:e=t.attrs,n=t.tasks,i=t.isDot,a=t.layer,o=this.workOptions.duration;_iterator13=_createForOfIteratorHelper(n);_context23.prev=2;_loop3=/*#__PURE__*/_regeneratorRuntime().mark(function _loop3(){var s,c,p,h,v,_this66$workOptions,y,M,T,_a$getResolution,m,_x54;return _regeneratorRuntime().wrap(function _loop3$(_context22){while(1)switch(_context22.prev=_context22.next){case 0:s=_step13.value;c=new pe(),p=s.pos,h=s.points;i?v=ue(h,!0):v=ue(h,!1),c.attr(_objectSpread(_objectSpread({},e),{},{pos:p,d:v}));_this66$workOptions=_this66.workOptions,y=_this66$workOptions.vertex,M=_this66$workOptions.fragment;if(y&&M){T=a.renderer.createProgram({vertex:y,fragment:M}),_a$getResolution=a.getResolution(),m=_a$getResolution.width,_x54=_a$getResolution.height;c.setUniforms({u_time:0,u_resolution:[m,_x54]}),c.setProgram(T);}a.appendChild(c),c.transition(o).attr({scale:i?[0.1,0.1]:[1,1],lineWidth:i?0:1}).then(function(){c.remove();});case 6:case"end":return _context22.stop();}},_loop3);});_iterator13.s();case 5:if((_step13=_iterator13.n()).done){_context23.next=9;break;}return _context23.delegateYield(_loop3(),"t0",7);case 7:_context23.next=5;break;case 9:_context23.next=14;break;case 11:_context23.prev=11;_context23.t1=_context23["catch"](2);_iterator13.e(_context23.t1);case 14:_context23.prev=14;_iterator13.f();return _context23.finish(14);case 17:case"end":return _context23.stop();}},_callee21,this,[[2,11,14,17]]);}));function draw(_x53){return _draw2.apply(this,arguments);}return draw;}()},{key:"getTaskPoints",value:function getTaskPoints(t){var c;var e=[];if(t.length===0)return[];var n=0,i=t[0].x,a=t[0].y,o=[i,a],s=[];for(;n<t.length;){var p=t[n],h=p.x-i,v=p.y-a;if(s.push(new Mt(h,v)),n>0&&n<t.length-1){var y=t[n].getAngleByPoints(t[n-1],t[n+1]);if(y<90||y>270){var M=(c=s.pop())==null?void 0:c.clone();M&&e.push({pos:o,points:[].concat(_toConsumableArray(s),[M])}),i=t[n].x,a=t[n].y,o=[i,a];var T=p.x-i,m=p.y-a;s=[new Mt(T,m)];}}n++;}return e.push({pos:o,points:s}),e;}},{key:"removeLocal",value:function removeLocal(){}},{key:"removeService",value:function removeService(t){var e;var n=[];return this.fullLayer.getElementsByName(t).forEach(function(i){if(i.name===t){var a=i.getBoundingClientRect();e=Ot(e,{x:a.x,y:a.y,w:a.width,h:a.height}),n.push(i);}}),n.length&&n.forEach(function(i){return i.remove();}),e;}}]);}(yt);var Od=Ge;Ge.polyline=Ge;Ge.polygon=Pd;function Ge(u,r,t){var e=u.length,n=Se(u[0],r),i=[],a,o,s,c,p;for(t||(t=[]),a=1;a<e;a++){for(o=u[a-1],s=u[a],c=p=Se(s,r);;)if(n|c){if(n&c)break;n?(o=gr(o,s,n,r),n=Se(o,r)):(s=gr(o,s,c,r),c=Se(s,r));}else{i.push(o),c!==p?(i.push(s),a<e-1&&(t.push(i),i=[])):a===e-1&&i.push(s);break;}n=p;}return i.length&&t.push(i),t;}function Pd(u,r){var t,e,n,i,a,o,s;for(e=1;e<=8;e*=2){for(t=[],n=u[u.length-1],i=!(Se(n,r)&e),a=0;a<u.length;a++)o=u[a],s=!(Se(o,r)&e),s!==i&&t.push(gr(n,o,e,r)),s&&t.push(o),n=o,i=s;if(u=t,!u.length)break;}return t;}function gr(u,r,t,e){return t&8?[u[0]+(r[0]-u[0])*(e[3]-u[1])/(r[1]-u[1]),e[3]]:// top
|
|
404
|
-
t&4?[u[0]+(r[0]-u[0])*(e[1]-u[1])/(r[1]-u[1]),e[1]]:// bottom
|
|
405
|
-
t&2?[e[2],u[1]+(r[1]-u[1])*(e[2]-u[0])/(r[0]-u[0])]:// right
|
|
406
|
-
t&1?[e[0],u[1]+(r[1]-u[1])*(e[0]-u[0])/(r[0]-u[0])]:// left
|
|
407
|
-
null;}function Se(u,r){var t=0;return u[0]<r[0]?t|=1:u[0]>r[2]&&(t|=2),u[1]<r[1]?t|=4:u[1]>r[3]&&(t|=8),t;}var Ed=/* @__PURE__ */he(Od);var xe=/*#__PURE__*/function(_yt3){function xe(t,e){var _this67;_classCallCheck(this,xe);_this67=_callSuper(this,xe,[t]);rt(_this67,"canRotate",!1);rt(_this67,"scaleType",Gt.none);rt(_this67,"toolsType",gt.Eraser);rt(_this67,"serviceWork");rt(_this67,"tmpPoints",[]);rt(_this67,"workOptions");rt(_this67,"worldPosition");rt(_this67,"worldScaling");rt(_this67,"eraserRect");rt(_this67,"eraserPolyline");_this67.serviceWork=e,_this67.workOptions=t.toolsOpt,_this67.worldPosition=_this67.fullLayer.worldPosition,_this67.worldScaling=_this67.fullLayer.worldScaling;return _this67;}_inherits(xe,_yt3);return _createClass(xe,[{key:"combineConsume",value:function combineConsume(){}},{key:"consumeService",value:function consumeService(){}},{key:"setWorkOptions",value:function setWorkOptions(t){_get(_getPrototypeOf(xe.prototype),"setWorkOptions",this).call(this,t);}},{key:"createEraserRect",value:function createEraserRect(t){var e=t[0]*this.worldScaling[0]+this.worldPosition[0],n=t[1]*this.worldScaling[1]+this.worldPosition[1],_xe$eraserSizes$this$=xe.eraserSizes[this.workOptions.thickness],i=_xe$eraserSizes$this$.width,a=_xe$eraserSizes$this$.height;this.eraserRect={x:e-i*0.5,y:n-a*0.5,w:i,h:a},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 _e3=new tt(this.tmpPoints[0],this.tmpPoints[1]),n=new tt(this.tmpPoints[2],this.tmpPoints[3]),i=tt.Sub(n,_e3).uni(),a=tt.Dist(_e3,n),_xe$eraserSizes$this$2=xe.eraserSizes[this.workOptions.thickness],o=_xe$eraserSizes$this$2.width,s=_xe$eraserSizes$this$2.height,c=Math.min(o,s),p=Math.round(a/c);if(p>1){var h=[];for(var v=0;v<p;v++){var y=tt.Mul(i,v*c);h.push(this.tmpPoints[0]+y.x,this.tmpPoints[1]+y.y);}return h.concat(t);}}return t;}},{key:"isNear",value:function isNear(t,e){var n=new tt(t[0],t[1]),i=new tt(e[0],e[1]),_xe$eraserSizes$this$3=xe.eraserSizes[this.workOptions.thickness],a=_xe$eraserSizes$this$3.width,o=_xe$eraserSizes$this$3.height;return tt.Dist(n,i)<Math.hypot(a,o)*0.5;}},{key:"cutPolyline",value:function cutPolyline(t,e){var n=[e],i=0;for(;i<t.length;){var s=t[i];if(s.length<2)break;n=a(n,s),i++;}return n;function a(s,c){var p=s;var _loop4=function _loop4(){var v=s[h],y=v.findIndex(function(M,T){return T<v.length-1?o([M,v[T+1]],[c[0],c[1]]):!1;});if(y!==-1&&y>-1){var M=[],T=v.slice(0,y+1);if(tt.Equals(v[y],c[0])||T.push(c[0].clone().setz(v[y].z)),T.length>1&&M.push(T),y+c.length-1<v.length-1){var m=y+c.length-1,_x55=v.slice(m),_l29=c[c.length-1];tt.Equals(v[m],_l29)||_x55.unshift(_l29.clone().setz(v[m].z)),_x55.length>1&&M.push(_x55);}return{v:(p.splice.apply(p,[h,1].concat(M)),p)};}},_ret;for(var h=0;h<s.length;h++){_ret=_loop4();if(_ret)return _ret.v;}return p;}function o(s,c){var p=tt.Sub(s[1],s[0]),h=tt.Sub(c[1],c[0]),v=tt.Sub(c[0],s[0]);return Math.abs(tt.Cpr(p,h))<0.1&&Math.abs(tt.Cpr(p,v))<0.1;}}},{key:"isSamePoint",value:function isSamePoint(t,e){return t[0]===e[0]&&t[1]===e[1];}},{key:"translateIntersect",value:function translateIntersect(t){var _this68=this;var e=[];for(var n=0;n<t.length;n++){var i=t[n].filter(function(s,c,p){return!(c>0&&_this68.isSamePoint(s,p[c-1]));}),a=[];var o=0;for(;o<i.length;){var s=i[o],c=new tt(s[0],s[1]);a.push(c),o++;}e.push(a);}return e;}},{key:"isLineEraser",value:function isLineEraser(t,e){return!(t===gt.Pencil&&!e);}},{key:"remove",value:function remove(t){var _this69=this;var e=t.curNodeMap,n=t.removeIds,i=t.newWorkDatas,a=this.workOptions.isLine;var o;var _iterator14=_createForOfIteratorHelper(e.entries()),_step14;try{for(_iterator14.s();!(_step14=_iterator14.n()).done;){var _step14$value=_slicedToArray(_step14.value,2),s=_step14$value[0],c=_step14$value[1];if(c.rect&&this.eraserRect&&this.eraserPolyline&&De(this.eraserRect,c.rect)){var p=c.op,h=c.toolsType,v=this.isLineEraser(h,a),y=[],M=[];for(var m=0;m<p.length;m+=3){var _x56=new tt(p[m]*this.worldScaling[0]+this.worldPosition[0],p[m+1]*this.worldScaling[1]+this.worldPosition[1],p[m+2]);M.push(_x56),y.push(new Mt(_x56.x,_x56.y));}var T=y.length&&Ut(y)||c.rect;if(De(T,this.eraserRect)){if(M.length>1){var _m8=Ed.polyline(M.map(function(x){return x.XY;}),this.eraserPolyline);if(_m8.length&&(n.add(c.name),!v)){var _x57=this.translateIntersect(_m8),_l30=this.cutPolyline(_x57,M);var _loop5=function _loop5(){var f="".concat(s,"_s_").concat(d),g=[];_l30[d].forEach(function(O){g.push((O.x-_this69.worldPosition[0])/_this69.worldScaling[0],(O.y-_this69.worldPosition[1])/_this69.worldScaling[1],O.z);}),c.opt&&c.toolsType&&_this69.vNodes&&(_this69.vNodes.setInfo(f,{rect:T,op:g,opt:c.opt,canRotate:c.canRotate,scaleType:c.scaleType,toolsType:c.toolsType}),i.set(f,{workId:f,op:g,opt:c.opt,toolsType:c.toolsType}));};for(var d=0;d<_l30.length;d++){_loop5();}}}else n.add(c.name);o=Ot(o,T);}}}}catch(err){_iterator14.e(err);}finally{_iterator14.f();}return n.forEach(function(s){var c;return(c=_this69.vNodes)==null?void 0:c["delete"](s);}),o&&(o.x-=yt.SafeBorderPadding,o.y-=yt.SafeBorderPadding,o.w+=yt.SafeBorderPadding*2,o.h+=yt.SafeBorderPadding*2),o;}},{key:"consume",value:function consume(t){var e=t.data.op;if(!e||e.length===0)return _objectSpread({type:ft.None},this.baseConsumeResult);var n=this.tmpPoints.length;if(n>1&&this.isNear([e[0],e[1]],[this.tmpPoints[n-2],this.tmpPoints[n-1]]))return _objectSpread({type:ft.None},this.baseConsumeResult);n===4&&(this.tmpPoints.shift(),this.tmpPoints.shift()),this.tmpPoints.push(e[0],e[1]);var i=this.computRectCenterPoints();var a;var o=/* @__PURE__ */new Set(),s=/* @__PURE__ */new Map();if(!this.vNodes)return _objectSpread({type:ft.None},this.baseConsumeResult);this.vNodes.setTarget();var c=this.getUnLockNodeMap(this.vNodes.getLastTarget());for(var p=0;p<i.length-1;p+=2){this.createEraserRect(i.slice(p,p+2));var h=this.remove({curNodeMap:c,removeIds:o,newWorkDatas:s});a=Ot(a,h);}if(this.vNodes.deleteLastTarget(),a&&o.size){var _iterator15=_createForOfIteratorHelper(s.keys()),_step15;try{for(_iterator15.s();!(_step15=_iterator15.n()).done;){var _p7=_step15.value;o.has(_p7)&&s["delete"](_p7);}}catch(err){_iterator15.e(err);}finally{_iterator15.f();}return{type:ft.RemoveNode,rect:a,removeIds:_toConsumableArray(o),newWorkDatas:s};}return _objectSpread({type:ft.None},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(t){return this.consume(t);}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}},{key:"getUnLockNodeMap",value:function getUnLockNodeMap(t){var e;if(this.serviceWork){var n=Xt(t),i=this.serviceWork.selectorWorkShapes,a=this.serviceWork.workShapes;var _iterator16=_createForOfIteratorHelper(i.values()),_step16;try{for(_iterator16.s();!(_step16=_iterator16.n()).done;){var o=_step16.value;if((e=o.selectIds)!=null&&e.length){var _iterator18=_createForOfIteratorHelper(o.selectIds),_step18;try{for(_iterator18.s();!(_step18=_iterator18.n()).done;){var s=_step18.value;n["delete"](s);}}catch(err){_iterator18.e(err);}finally{_iterator18.f();}}}}catch(err){_iterator16.e(err);}finally{_iterator16.f();}var _iterator17=_createForOfIteratorHelper(a.keys()),_step17;try{for(_iterator17.s();!(_step17=_iterator17.n()).done;){var _o3=_step17.value;n["delete"](_o3);}}catch(err){_iterator17.e(err);}finally{_iterator17.f();}return n;}return t;}}]);}(yt);// 来源于white-sdk
|
|
408
|
-
rt(xe,"eraserSizes",Object.freeze([Object.freeze({width:18,height:26}),Object.freeze({width:26,height:34}),Object.freeze({width:34,height:50})]));var se=xe;var Ad="__lodash_hash_undefined__";function Cd(u){return this.__data__.set(u,Ad),this;}var Rd=Cd;function Id(u){return this.__data__.has(u);}var Ld=Id,bd=wn,Dd=Rd,wd=Ld;function He(u){var r=-1,t=u==null?0:u.length;for(this.__data__=new bd();++r<t;)this.add(u[r]);}He.prototype.add=He.prototype.push=Dd;He.prototype.has=wd;var Rr=He;function Nd(u,r){for(var t=-1,e=u==null?0:u.length;++t<e;)if(r(u[t],t,u))return!0;return!1;}var Wd=Nd;function Bd(u,r){return u.has(r);}var Ir=Bd,Fd=Rr,Ud=Wd,jd=Ir,$d=1,zd=2;function Gd(u,r,t,e,n,i){var a=t&$d,o=u.length,s=r.length;if(o!=s&&!(a&&s>o))return!1;var c=i.get(u),p=i.get(r);if(c&&p)return c==r&&p==u;var h=-1,v=!0,y=t&zd?new Fd():void 0;for(i.set(u,r),i.set(r,u);++h<o;){var M=u[h],T=r[h];if(e)var m=a?e(T,M,h,r,u,i):e(M,T,h,u,r,i);if(m!==void 0){if(m)continue;v=!1;break;}if(y){if(!Ud(r,function(x,l){if(!jd(y,l)&&(M===x||n(M,x,t,e,i)))return y.push(l);})){v=!1;break;}}else if(!(M===T||n(M,T,t,e,i))){v=!1;break;}}return i["delete"](u),i["delete"](r),v;}var oi=Gd;function Hd(u){var r=-1,t=Array(u.size);return u.forEach(function(e,n){t[++r]=[n,e];}),t;}var Kd=Hd;function Vd(u){var r=-1,t=Array(u.size);return u.forEach(function(e){t[++r]=e;}),t;}var Lr=Vd,ln=Ne,cn=qn,Yd=vr,Xd=oi,Jd=Kd,Qd=Lr,Zd=1,kd=2,qd="[object Boolean]",_d="[object Date]",t0="[object Error]",e0="[object Map]",r0="[object Number]",n0="[object RegExp]",i0="[object Set]",s0="[object String]",o0="[object Symbol]",a0="[object ArrayBuffer]",l0="[object DataView]",fn=ln?ln.prototype:void 0,ir=fn?fn.valueOf:void 0;function c0(u,r,t,e,n,i,a){switch(t){case l0:if(u.byteLength!=r.byteLength||u.byteOffset!=r.byteOffset)return!1;u=u.buffer,r=r.buffer;case a0:return!(u.byteLength!=r.byteLength||!i(new cn(u),new cn(r)));case qd:case _d:case r0:return Yd(+u,+r);case t0:return u.name==r.name&&u.message==r.message;case n0:case s0:return u==r+"";case e0:var o=Jd;case i0:var s=e&Zd;if(o||(o=Qd),u.size!=r.size&&!s)return!1;var c=a.get(u);if(c)return c==r;e|=kd,a.set(u,r);var p=Xd(o(u),o(r),e,n,i,a);return a["delete"](u),p;case o0:if(ir)return ir.call(u)==ir.call(r);}return!1;}var f0=c0,un=Qn,u0=1,h0=Object.prototype,d0=h0.hasOwnProperty;function g0(u,r,t,e,n,i){var a=t&u0,o=un(u),s=o.length,c=un(r),p=c.length;if(s!=p&&!a)return!1;for(var h=s;h--;){var v=o[h];if(!(a?v in r:d0.call(r,v)))return!1;}var y=i.get(u),M=i.get(r);if(y&&M)return y==r&&M==u;var T=!0;i.set(u,r),i.set(r,u);for(var m=a;++h<s;){v=o[h];var x=u[v],l=r[v];if(e)var d=a?e(l,x,v,r,u,i):e(x,l,v,u,r,i);if(!(d===void 0?x===l||n(x,l,t,e,i):d)){T=!1;break;}m||(m=v=="constructor");}if(T&&!m){var f=u.constructor,g=r.constructor;f!=g&&"constructor"in u&&"constructor"in r&&!(typeof f=="function"&&f instanceof f&&typeof g=="function"&&g instanceof g)&&(T=!1);}return i["delete"](u),i["delete"](r),T;}var p0=g0,sr=Nn,v0=oi,m0=f0,y0=p0,hn=rr,dn=We,gn=yr,S0=zn,x0=1,pn="[object Arguments]",vn="[object Array]",Fe="[object Object]",T0=Object.prototype,mn=T0.hasOwnProperty;function M0(u,r,t,e,n,i){var a=dn(u),o=dn(r),s=a?vn:hn(u),c=o?vn:hn(r);s=s==pn?Fe:s,c=c==pn?Fe:c;var p=s==Fe,h=c==Fe,v=s==c;if(v&&gn(u)){if(!gn(r))return!1;a=!0,p=!1;}if(v&&!p)return i||(i=new sr()),a||S0(u)?v0(u,r,t,e,n,i):m0(u,r,s,t,e,n,i);if(!(t&x0)){var y=p&&mn.call(u,"__wrapped__"),M=h&&mn.call(r,"__wrapped__");if(y||M){var T=y?u.value():u,m=M?r.value():r;return i||(i=new sr()),n(T,m,t,e,i);}}return v?(i||(i=new sr()),y0(u,r,t,e,n,i)):!1;}var O0=M0,P0=O0,yn=re;function ai(u,r,t,e,n){return u===r?!0:u==null||r==null||!yn(u)&&!yn(r)?u!==u&&r!==r:P0(u,r,t,e,ai,n);}var E0=ai,A0=E0;function C0(u,r){return A0(u,r);}var R0=C0,fe=/* @__PURE__ */he(R0);var Qe=/*#__PURE__*/function(_yt4){function Qe(t){var _this70;_classCallCheck(this,Qe);_this70=_callSuper(this,Qe,[t]);rt(_this70,"toolsType",gt.Selector);rt(_this70,"tmpPoints",[]);rt(_this70,"workOptions");rt(_this70,"vNodes");rt(_this70,"selectIds");rt(_this70,"selectorColor");rt(_this70,"strokeColor");rt(_this70,"fillColor");rt(_this70,"oldSelectRect");rt(_this70,"canRotate",!1);rt(_this70,"canTextEdit",!1);rt(_this70,"canLock",!1);rt(_this70,"scaleType",Gt.all);rt(_this70,"toolsTypes");rt(_this70,"shapeOpt");rt(_this70,"textOpt");rt(_this70,"isLocked");rt(_this70,"thickness");rt(_this70,"strokeType");rt(_this70,"useStroke");_this70.workOptions=t.toolsOpt,_this70.vNodes=t.vNodes;return _this70;}_inherits(Qe,_yt4);return _createClass(Qe,[{key:"computSelector",value:function computSelector(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;var e=Ut(this.tmpPoints);if(e.w===0||e.h===0)return{selectIds:[],intersectRect:void 0,subNodeMap:/* @__PURE__ */new Map()};var _this$vNodes$getRectI=this.vNodes.getRectIntersectRange(e,t),n=_this$vNodes$getRectI.rectRange,i=_this$vNodes$getRectI.nodeRange;return{selectIds:_toConsumableArray(i.keys()),intersectRect:n,subNodeMap:i};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=this.tmpPoints.length,n=t.length;if(n>1){var i=new Mt(t[n-2]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],t[n-1]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[1]);e===2?this.tmpPoints.splice(1,1,i):this.tmpPoints.push(i);}}},{key:"drawSelector",value:function drawSelector(t){var _this71=this;var e=t.drawRect,n=t.subNodeMap,i=t.selectorId,a=t.layer,o=t.isService,s=new qt({pos:[e.x,e.y],anchor:[0,0],size:[e.w,e.h],id:i,name:i,zIndex:9999}),c=[];if(o){var p=new an({normalize:!0,pos:[e.w/2,e.h/2],lineWidth:1,strokeColor:this.selectorColor||this.workOptions.strokeColor,width:e.w,height:e.h,name:Qe.selectorBorderId});c.push(p);}n.forEach(function(p,h){var v=[p.rect.x+p.rect.w/2-e.x,p.rect.y+p.rect.h/2-e.y],y=new an({normalize:!0,pos:v,lineWidth:1,strokeColor:n.size>1?_this71.selectorColor||_this71.workOptions.strokeColor:void 0,width:p.rect.w,height:p.rect.h,id:"selector-".concat(h),name:"selector-".concat(h)});c.push(y);}),c&&s.append.apply(s,c),(a==null?void 0:a.parent).appendChild(s);}},{key:"draw",value:function draw(t,e,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!1;var s,c;var a=n.intersectRect,o=n.subNodeMap;(c=(s=e.parent)==null?void 0:s.getElementById(t))==null||c.remove(),a&&this.drawSelector({drawRect:a,subNodeMap:o,selectorId:t,layer:e,isService:i});}},{key:"getSelecteorInfo",value:function getSelecteorInfo(t){this.scaleType=Gt.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 e=/* @__PURE__ */new Set();var n,i=!0;var _iterator19=_createForOfIteratorHelper(t.values()),_step19;try{for(_iterator19.s();!(_step19=_iterator19.n()).done;){var a=_step19.value;var o=a.opt,s=a.canRotate,c=a.scaleType,p=a.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),p!==gt.Pencil&&(i=!1),o.strokeType&&(this.strokeType=o.strokeType),p===gt.SpeechBalloon&&(e.add(p),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.placement=o.placement),p===gt.Polygon&&(e.add(p),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.vertices=o.vertices),p===gt.Star&&(e.add(p),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.vertices=o.vertices,this.shapeOpt.innerRatio=o.innerRatio,this.shapeOpt.innerVerticeStep=o.innerVerticeStep),p===gt.Text&&(this.textOpt=o),t.size===1&&(this.textOpt&&(this.canTextEdit=!0),this.canRotate=s,this.scaleType=c),c===Gt.none&&(this.scaleType=c),p===gt.Image&&(n=a);}}catch(err){_iterator19.e(err);}finally{_iterator19.f();}i&&(this.useStroke=!0),e.size&&(this.toolsTypes=_toConsumableArray(e)),n&&(t.size===1?(this.canLock=!0,n.opt.locked&&(this.isLocked=!0,this.scaleType=Gt.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,e;if(this.scaleType===Gt.both&&((t=this.selectIds)==null?void 0:t.length)===1){var n=this.selectIds[0],i=(e=this.vNodes.get(n))==null?void 0:e.op;if(i){var a=[];for(var o=0;o<i.length;o+=3)a.push([i[o],i[o+1]]);return a;}}}},{key:"consume",value:function consume(t){var _t$data2=t.data,e=_t$data2.op,n=_t$data2.workState;var i=this.oldSelectRect;if(n===It.Start&&(i=this.unSelectedAllIds()),!(e!=null&&e.length)||!this.vNodes.curNodeMap.size)return{type:ft.None};this.updateTempPoints(e);var a=this.computSelector();if(this.selectIds&&fe(this.selectIds,a.selectIds))return{type:ft.None};this.selectIds=a.selectIds;var o=a.intersectRect;this.getSelecteorInfo(a.subNodeMap),this.draw(Nt,this.fullLayer,a),this.oldSelectRect=o;var s=this.getChildrenPoints();return _objectSpread({type:ft.Select,dataType:Tt.Local,rect:Ot(o,i),selectIds:a.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:s,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 e,n;var t=this.oldSelectRect;if(!((e=this.selectIds)!=null&&e.length)&&this.tmpPoints[0]&&this.selectSingleTool(this.tmpPoints[0].XY,Nt,!1),(n=this.selectIds)!=null&&n.length&&(t=this.selectedByIds(this.selectIds)),t){var i=this.getChildrenPoints();return _objectSpread({type:ft.Select,dataType:Tt.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:i,isLocked:this.isLocked,toolsTypes:this.toolsTypes,shapeOpt:this.shapeOpt,thickness:this.thickness,useStroke:this.useStroke,strokeType:this.strokeType},this.baseConsumeResult);}return{type:ft.None};}},{key:"consumeService",value:function consumeService(){}},{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 e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Nt;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;if(t.length===2){var i=t[0],a=t[1];var o;var _this$vNodes$getRectI2=this.vNodes.getRectIntersectRange({x:i,y:a,w:0,h:0},!1),s=_this$vNodes$getRectI2.nodeRange,c=_toConsumableArray(s.values()).sort(function(p,h){return(h.opt.zIndex||0)-(p.opt.zIndex||0);});var _iterator20=_createForOfIteratorHelper(c),_step20;try{for(_iterator20.s();!(_step20=_iterator20.n()).done;){var _p8=_step20.value;var _h5=this.fullLayer.getElementsByName(_p8.name);if(vi(_h5).find(function(y){return y.isPointCollision(i,a);})){o=_p8;break;}}}catch(err){_iterator20.e(err);}finally{_iterator20.f();}if(o){var p=o.name;if(!fe(this.oldSelectRect,o.rect)){var h=/* @__PURE__ */new Map([[p,o]]);this.getSelecteorInfo(h),this.draw(e,this.fullLayer,{intersectRect:o.rect,subNodeMap:h,selectIds:this.selectIds||[]},n);}this.selectIds=[p],this.oldSelectRect=o.rect;}}}},{key:"unSelectedAllIds",value:function unSelectedAllIds(){var t;var _iterator21=_createForOfIteratorHelper(this.vNodes.curNodeMap.entries()),_step21;try{for(_iterator21.s();!(_step21=_iterator21.n()).done;){var _step21$value=_slicedToArray(_step21.value,2),_e4=_step21$value[0],n=_step21$value[1];n.isSelected&&(t=Ot(t,n.rect),this.vNodes.unSelected(_e4));}}catch(err){_iterator21.e(err);}finally{_iterator21.f();}return t;}},{key:"unSelectedByIds",value:function unSelectedByIds(t){var e;var _iterator22=_createForOfIteratorHelper(t),_step22;try{for(_iterator22.s();!(_step22=_iterator22.n()).done;){var n=_step22.value;var i=this.vNodes.get(n);i&&i.isSelected&&(e=Ot(e,i.rect),this.vNodes.unSelected(n));}}catch(err){_iterator22.e(err);}finally{_iterator22.f();}return e;}},{key:"selectedByIds",value:function selectedByIds(t){var e;var _iterator23=_createForOfIteratorHelper(t),_step23;try{for(_iterator23.s();!(_step23=_iterator23.n()).done;){var n=_step23.value;var i=this.vNodes.get(n);i&&(e=Ot(e,i.rect),this.vNodes.selected(n));}}catch(err){_iterator23.e(err);}finally{_iterator23.f();}return e;}},{key:"getSelectorRect",value:function getSelectorRect(t,e){var o;var n;var i=(o=t.parent)==null?void 0:o.getElementById(e),a=i==null?void 0:i.getBoundingClientRect();return a&&(n=Ot(n,{x:Math.floor(a.x),y:Math.floor(a.y),w:Math.floor(a.width+1),h:Math.floor(a.height+1)})),n;}},{key:"isCanFillColor",value:function isCanFillColor(t){return t===gt.Ellipse||t===gt.Triangle||t===gt.Rectangle||t===gt.Polygon||t===gt.Star||t===gt.SpeechBalloon;}},{key:"updateSelector",value:function(){var _updateSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee22(t){var A,e,n,i,a,o,s,c,p,h,v,y,M,T,m,x,l,d,f,_iterator24,_step24,R,b,P,L,D,I,C,B,G,H,X,g,_R5,_b11,_P9,O;return _regeneratorRuntime().wrap(function _callee22$(_context24){while(1)switch(_context24.prev=_context24.next){case 0:e=t.updateSelectorOpt,n=t.selectIds,i=t.vNodes,a=t.willSerializeData,o=t.worker,s=t.scene,c=t.isMainThread,p=t.offset,h=this.fullLayer;if(h){_context24.next=3;break;}return _context24.abrupt("return");case 3:y=/* @__PURE__ */new Map(),M=e.originPoint,T=e.workState,m=e.angle,x=e.translate,l=e.dir,d=e.scale;p&&(x?e.translate=[x[0]+p[0],x[1]+p[1]]:e.translate=p);if(!(M||x||kt(m))){_context24.next=9;break;}if(!(T===It.Start&&n)){_context24.next=8;break;}return _context24.abrupt("return",(i.setTargetAssignKeys(n),{type:ft.Select,dataType:Tt.Local,selectRect:this.oldSelectRect,rect:this.oldSelectRect}));case 8:f=i.getLastTarget();case 9:if(!n){_context24.next=60;break;}_iterator24=_createForOfIteratorHelper(n);_context24.prev=11;_iterator24.s();case 13:if((_step24=_iterator24.n()).done){_context24.next=52;break;}R=_step24.value;b=i.get(R);if(!b){_context24.next=50;break;}P=b.toolsType,L=(h==null?void 0:h.getElementsByName(R))[0];if(!L){_context24.next=50;break;}D=!1,I=!1;C=_objectSpread({},e);B=void 0;if(!P){_context24.next=50;break;}C.thickness&&b.opt.thickness&&(D=b.opt.thickness!==C.thickness),C.strokeType&&(A=b.opt)!=null&&A.strokeType&&(I=b.opt.strokeType!==C.strokeType),B=f==null?void 0:f.get(R);G=pi(P);if(!(G==null||G.updateNodeOpt({node:L,opt:C,vNodes:i,willSerializeData:a,targetNode:B}),b&&o&&(a&&(C.angle||C.translate)||C.originPoint&&C.scenePoint&&C.scale||C.pointMap&&C.pointMap.has(R)||P===gt.Text&&(C.fontSize||C.translate||C.textInfos&&C.textInfos.get(R))||P===gt.Image&&(C.angle||C.translate||C.scale)||P===C.toolsType&&C.willRefresh||D||I))){_context24.next=49;break;}H=o.createWorkShapeNode({workId:R,toolsType:P,toolsOpt:b.opt});H==null||H.setWorkId(R);X=void 0;if(!(P===gt.Image&&s)){_context24.next=35;break;}_context24.next=32;return H.consumeServiceAsync({isFullWork:!0,replaceId:R,scene:s,isMainThread:c});case 32:X=_context24.sent;_context24.next=48;break;case 35:if(!(P===gt.Text)){_context24.next=41;break;}_context24.next=38;return H.consumeServiceAsync({isFullWork:!0,replaceId:R});case 38:X=_context24.sent;_context24.next=48;break;case 41:_context24.prev=41;X=H==null?void 0:H.consumeService({op:b.op,isFullWork:!0,replaceId:R});_context24.next=48;break;case 45:_context24.prev=45;_context24.t0=_context24["catch"](41);return _context24.abrupt("continue",50);case 48:X&&(b.rect=X);case 49:b&&(y.set(R,b),v=Ot(v,b.rect));case 50:_context24.next=13;break;case 52:_context24.next=57;break;case 54:_context24.prev=54;_context24.t1=_context24["catch"](11);_iterator24.e(_context24.t1);case 57:_context24.prev=57;_iterator24.f();return _context24.finish(57);case 60:f&&T===It.Done&&(i.deleteLastTarget(),f=void 0);g=v;if(!(M&&x&&d&&l&&g&&!p)){_context24.next=80;break;}_R5=[[g.x,g.y],[g.x+g.w,g.y],[g.x+g.w,g.y+g.h],[g.x,g.y+g.h]];_context24.t2=l;_context24.next=_context24.t2==="top"?67:_context24.t2==="topLeft"?67:_context24.t2==="left"?67:_context24.t2==="topRight"?69:_context24.t2==="right"?71:_context24.t2==="bottomRight"?71:_context24.t2==="bottom"?71:_context24.t2==="bottomLeft"?73:75;break;case 67:x[0]>0&&x[1]>0?_b11=_R5[0]:x[0]>0?_b11=_R5[3]:x[1]>0?_b11=_R5[1]:_b11=_R5[2];return _context24.abrupt("break",75);case 69:x[0]<0&&x[1]>0?_b11=_R5[1]:x[0]<0?_b11=_R5[2]:x[1]>0?_b11=_R5[0]:_b11=_R5[3];return _context24.abrupt("break",75);case 71:x[0]<0&&x[1]<0?_b11=_R5[2]:x[0]<0?_b11=_R5[1]:x[1]<0?_b11=_R5[3]:_b11=_R5[0];return _context24.abrupt("break",75);case 73:x[0]>0&&x[1]<0?_b11=_R5[3]:x[0]>0?_b11=_R5[0]:x[1]<0?_b11=_R5[2]:_b11=_R5[1];return _context24.abrupt("break",75);case 75:_P9=_b11&&[M[0]-_b11[0],M[1]-_b11[1]]||[0,0];if(fe(_P9,[0,0])){_context24.next=80;break;}_context24.next=79;return this.updateSelector(_objectSpread(_objectSpread({},t),{},{updateSelectorOpt:{},offset:_P9}));case 79:return _context24.abrupt("return",_context24.sent);case 80:this.getSelecteorInfo(y),this.draw(Nt,h,{selectIds:n||[],subNodeMap:y,intersectRect:g});O=Ot(this.oldSelectRect,g);return _context24.abrupt("return",(this.oldSelectRect=g,{type:ft.Select,dataType:Tt.Local,selectRect:g,renderRect:v,rect:Ot(O,g),selectIds:n}));case 83:case"end":return _context24.stop();}},_callee22,this,[[11,54,57,60],[41,45]]);}));function updateSelector(_x58){return _updateSelector.apply(this,arguments);}return updateSelector;}()},{key:"blurSelector",value:function blurSelector(){var t=this.unSelectedAllIds();return{type:ft.Select,dataType:Tt.Local,rect:t,selectIds:[],willSyncService:!0};}},{key:"getRightServiceId",value:function getRightServiceId(t){return t.replace(pr,"-");}},{key:"selectServiceNode",value:function selectServiceNode(t,e,n){var _this72=this;var i=e.selectIds,a=this.getRightServiceId(t),o=this.getSelectorRect(this.fullLayer,a);var s;var c=/* @__PURE__ */new Map();return i==null||i.forEach(function(p){var h=_this72.vNodes.get(p);h&&(s=Ot(s,h.rect),c.set(p,h));}),this.getSelecteorInfo(c),this.draw(a,this.fullLayer,{intersectRect:s,selectIds:i||[],subNodeMap:c},n),Ot(s,o);}},{key:"reRenderSelector",value:function reRenderSelector(){var _this73=this;var n;var t;var e=/* @__PURE__ */new Map();return(n=this.selectIds)==null||n.forEach(function(i){var a=_this73.vNodes.get(i);a&&(t=Ot(t,a.rect),e.set(i,a));},this),this.getSelecteorInfo(e),this.draw(Nt,this.fullLayer,{intersectRect:t,subNodeMap:e,selectIds:this.selectIds||[]}),this.oldSelectRect=t,t;}},{key:"updateSelectIds",value:function updateSelectIds(t){var a;var e;var n=(a=this.selectIds)==null?void 0:a.filter(function(o){return!t.includes(o);});if(n!=null&&n.length&&(e=this.unSelectedByIds(n)),t.length){var o=this.selectedByIds(t);e=Ot(e,o);}this.selectIds=t;var i=this.reRenderSelector();return{bgRect:e,selectRect:i};}},{key:"cursorHover",value:function cursorHover(t){var a,o;var e=this.oldSelectRect;this.selectIds=[];var n=(a=this.workId)==null?void 0:a.toString(),i=[t[0]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],t[1]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[1]];if(this.selectSingleTool(i,n,!0),this.oldSelectRect&&!fe(e,this.oldSelectRect))return{type:ft.CursorHover,dataType:Tt.Local,rect:Ot(e,this.oldSelectRect),selectorColor:this.selectorColor,willSyncService:!1};if((o=this.selectIds)!=null&&o.length||(this.oldSelectRect=void 0),e&&!this.oldSelectRect)return this.cursorBlur(),{type:ft.CursorHover,dataType:Tt.Local,rect:e,selectorColor:this.selectorColor,willSyncService:!1};}},{key:"cursorBlur",value:function cursorBlur(){var e,n;this.selectIds=[];var t=(e=this.workId)==null?void 0:e.toString();((n=this.fullLayer)==null?void 0:n.parent).children.forEach(function(i){i.name===t&&i.remove();});}}]);}(yt);rt(Qe,"selectorBorderId","selector-border");var Ke=Qe;var li=/*#__PURE__*/function(_yt5){function li(t){var _this74;_classCallCheck(this,li);_this74=_callSuper(this,li,[t]);rt(_this74,"canRotate",!1);rt(_this74,"scaleType",Gt.both);rt(_this74,"toolsType",gt.Arrow);rt(_this74,"tmpPoints",[]);rt(_this74,"workOptions");rt(_this74,"oldRect");rt(_this74,"arrowTipWidth");rt(_this74,"syncTimestamp");_this74.workOptions=t.toolsOpt,_this74.arrowTipWidth=_this74.workOptions.thickness*4,_this74.syncTimestamp=0,_this74.syncUnitTime=50;return _this74;}_inherits(li,_yt5);return _createClass(li,[{key:"consume",value:function consume(t){var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=this.workId,s=e.op,c=s==null?void 0:s.length;if(!c||c<2)return{type:ft.None};var p;if(this.tmpPoints.length===0?(this.tmpPoints=[new Mt(s[0],s[1])],p=!1):p=this.updateTempPoints(s),!p)return{type:ft.None};var h;if(i||a){var y=n?this.fullLayer:this.drawLayer||this.fullLayer;h=this.draw({workId:o,layer:y});}if(!i){var _y8=Date.now();return _y8-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_y8,_objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:ft.DrawWork,dataType:Tt.Local,op:this.tmpPoints.map(function(M){return[].concat(_toConsumableArray(M.XY),[0]);}).flat(1),isSync:!0,index:0})):{type:ft.None};}var v=Ot(h,this.oldRect);return this.oldRect=h,_objectSpread(_objectSpread({rect:v},this.baseConsumeResult),{},{type:ft.DrawWork,dataType:Tt.Local});}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:ft.RemoveNode,removeIds:[t]};var e=this.fullLayer,n=this.draw({workId:t,layer:e});this.oldRect=n;var i=this.tmpPoints.map(function(s){return[].concat(_toConsumableArray(s.XY),[0]);}).flat(1),a=_t(i);return(o=this.vNodes)==null||o.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:yt.getCenterPos(n,e)}),_objectSpread(_objectSpread({rect:n},this.baseConsumeResult),{},{type:ft.FullWork,dataType:Tt.Local,ops:a,isSync:!0});}},{key:"draw",value:function draw(t){var e=t.workId,n=t.layer,_this$workOptions6=this.workOptions,i=_this$workOptions6.strokeColor,a=_this$workOptions6.thickness,o=_this$workOptions6.zIndex,s=_this$workOptions6.scale,c=_this$workOptions6.rotate,p=_this$workOptions6.translate,h=_this$workOptions6.strokeType,v=n.worldPosition,y=n.worldScaling,_this$computDrawPoint2=this.computDrawPoints(a),M=_this$computDrawPoint2.points,T=_this$computDrawPoint2.pos,m=_this$computDrawPoint2.rect,x=_this$computDrawPoint2.isTriangle,l=_this$computDrawPoint2.trianglePoints,d=_this$computDrawPoint2.trianglePos,f=[m.x+m.w/2,m.y+m.h/2],g={pos:f,name:e,id:e,zIndex:o,anchor:[0.5,0.5],size:[m.w,m.h]};s&&(g.scale=s),c&&(g.rotate=c),p&&(g.translate=p);var O=new qt(g),A={points:l,pos:[d[0]-f[0],d[1]-f[1]],fillColor:i,strokeColor:i,lineWidth:0,normalize:!1},R=new ae(A);if(O.append(R),!x&&M&&T){var b={points:M,pos:[T[0]-f[0],T[1]-f[1]],fillColor:i,strokeColor:i,lineDash:h===Lt.Dotted&&!x?[1,a*2]:h===Lt.LongDotted&&!x?[a,a*2]:void 0,lineCap:h===Lt.Normal?void 0:"round",lineWidth:a,normalize:!1},P=new ae(b);O.append(P);}if(this.replace(n,e,O),s||c||p){var _b12=O.getBoundingClientRect();return{x:Math.floor(_b12.x-yt.SafeBorderPadding),y:Math.floor(_b12.y-yt.SafeBorderPadding),w:Math.floor(_b12.width+yt.SafeBorderPadding*2),h:Math.floor(_b12.height+yt.SafeBorderPadding*2)};}return{x:Math.floor(m.x*y[0]+v[0]-yt.SafeBorderPadding),y:Math.floor(m.y*y[1]+v[1]-yt.SafeBorderPadding),w:Math.floor(m.w*y[0]+2*yt.SafeBorderPadding),h:Math.floor(m.h*y[1]+2*yt.SafeBorderPadding)};}},{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 e=tt.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),n=tt.Per(e).mul(t/2),i=Mt.Sub(this.tmpPoints[0],n),a=Mt.Add(this.tmpPoints[0],n),o=tt.Mul(e,this.arrowTipWidth),s=tt.Sub(this.tmpPoints[1],o),c=Mt.Sub(s,n),p=Mt.Add(s,n),h=tt.Per(e).mul(t*1.5),v=Mt.Sub(s,h),y=Mt.Add(s,h),M=[this.tmpPoints[0],s],T=[v,this.tmpPoints[1],y],m=[i,a].concat(T,[c,p]);return{trianglePoints:T.map(function(x){return Mt.Sub(x,_this75.tmpPoints[1]).XY;}).flat(1),trianglePos:this.tmpPoints[1].XY,points:M.map(function(x){return Mt.Sub(x,_this75.tmpPoints[0]).XY;}).flat(1),rect:Ut(m),isTriangle:!1,pos:this.tmpPoints[0].XY};}},{key:"computTrianglePoints",value:function computTrianglePoints(){var _this76=this;var t=tt.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),e=this.tmpPoints[1].distance(this.tmpPoints[0]),n=tt.Per(t).mul(Math.floor(e*3/8)),i=Mt.Sub(this.tmpPoints[0],n),a=Mt.Add(this.tmpPoints[0],n),o=[i,this.tmpPoints[1],a];return{trianglePoints:o.map(function(s){return Mt.Sub(s,_this76.tmpPoints[1]).XY;}).flat(1),trianglePos:this.tmpPoints[1].XY,rect:Ut(o),isTriangle:!0};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new Mt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;if(i.isNear(n,a))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 s,c;var e=t.op,n=t.isFullWork,i=(s=this.workId)==null?void 0:s.toString();if(!i)return;this.tmpPoints.length=0;for(var p=0;p<e.length;p+=3)this.tmpPoints.push(new Mt(e[p],e[p+1],e[p+2]));var a=n?this.fullLayer:this.drawLayer||this.fullLayer,o=this.draw({workId:i,layer:a});return this.oldRect=o,(c=this.vNodes)==null||c.setInfo(i,{rect:o,op:e,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:yt.getCenterPos(o,a)}),o;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var c,p;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=n.strokeType,s=i.get(e.name);return a&&(e.setAttribute("strokeColor",a),e.setAttribute("fillColor",a),(c=s==null?void 0:s.opt)!=null&&c.strokeColor&&(s.opt.strokeColor=a),s&&i.setInfo(e.name,s)),o&&s!=null&&s.opt&&(p=s.opt)!=null&&p.strokeType&&(s.opt.strokeType=o),yt.updateNodeOpt(t);}}]);}(yt);var ci=/*#__PURE__*/function(_yt6){function ci(t){var _this77;_classCallCheck(this,ci);_this77=_callSuper(this,ci,[t]);rt(_this77,"canRotate",!1);rt(_this77,"scaleType",Gt.all);rt(_this77,"toolsType",gt.Ellipse);rt(_this77,"tmpPoints",[]);rt(_this77,"workOptions");rt(_this77,"oldRect");rt(_this77,"syncTimestamp");_this77.workOptions=t.toolsOpt,_this77.syncTimestamp=0,_this77.syncUnitTime=50;return _this77;}_inherits(ci,_yt6);return _createClass(ci,[{key:"consume",value:function consume(t){var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=this.workId,s=e.op,c=s==null?void 0:s.length;if(!c||c<2)return{type:ft.None};var p;if(this.tmpPoints.length===0?(this.tmpPoints=[new Mt(s[0],s[1])],p=!1):p=this.updateTempPoints(s),!p)return{type:ft.None};var h;if(i||a){var y=n?this.fullLayer:this.drawLayer||this.fullLayer;h=this.draw({workId:o,layer:y,isDrawing:!0});}if(!i){var _y9=Date.now();return _y9-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_y9,_objectSpread(_objectSpread({type:ft.DrawWork,dataType:Tt.Local},this.baseConsumeResult),{},{op:this.tmpPoints.map(function(M){return[].concat(_toConsumableArray(M.XY),[0]);}).flat(1),isSync:!0,index:0})):{type:ft.None};}var v=Ot(h,this.oldRect);return this.oldRect=h,_objectSpread({rect:v,type:ft.DrawWork,dataType:Tt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:ft.RemoveNode,removeIds:[t]};var e=this.fullLayer,n=this.draw({workId:t,layer:e,isDrawing:!1});this.oldRect=n;var i=this.tmpPoints.map(function(s){return[].concat(_toConsumableArray(s.XY),[0]);}).flat(1),a=_t(i);return(o=this.vNodes)==null||o.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:n&&yt.getCenterPos(n,e)}),_objectSpread(_objectSpread({rect:n,type:ft.FullWork,dataType:Tt.Local},this.baseConsumeResult),{},{ops:a,isSync:!0});}},{key:"draw",value:function draw(t){var e=t.workId,n=t.layer,i=t.isDrawing,_this$workOptions7=this.workOptions,a=_this$workOptions7.strokeColor,o=_this$workOptions7.fillColor,s=_this$workOptions7.thickness,c=_this$workOptions7.zIndex,p=_this$workOptions7.scale,h=_this$workOptions7.rotate,v=_this$workOptions7.translate,y=_this$workOptions7.strokeType,M=n.worldScaling,_this$computDrawPoint3=this.computDrawPoints(s),T=_this$computDrawPoint3.radius,m=_this$computDrawPoint3.rect,x=_this$computDrawPoint3.pos,l={pos:x,name:e,id:e,radius:T,lineWidth:s,fillColor:o!=="transparent"&&o||void 0,strokeColor:a,normalize:!0,lineJoin:"round",lineCap:"round",lineDash:y===Lt.Dotted?[1,s*2]:y===Lt.LongDotted?[s,s*2]:void 0},d={name:e,id:e,zIndex:c,pos:x,anchor:[0.5,0.5],size:[m.w,m.h]};p&&(d.scale=p),h&&(d.rotate=h),v&&(d.translate=v);var f=new qt(d);if(i){var A=new pe({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:a,lineWidth:1,scale:[1/M[0],1/M[1]]});f.append(A);}var g=new yd(_objectSpread(_objectSpread({},l),{},{pos:[0,0]}));f.append(g),this.replace(n,e,f);var O=f.getBoundingClientRect();return{x:Math.floor(O.x-yt.SafeBorderPadding),y:Math.floor(O.y-yt.SafeBorderPadding),w:Math.floor(O.width+yt.SafeBorderPadding*2),h:Math.floor(O.height+yt.SafeBorderPadding*2)};}},{key:"computDrawPoints",value:function computDrawPoints(t){var e=Ut(this.tmpPoints),n=Ut(this.tmpPoints,t),i=[Math.floor(e.x+e.w/2),Math.floor(e.y+e.h/2)];return{rect:n,pos:i,radius:[Math.floor(e.w/2),Math.floor(e.h/2)]};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new Mt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;if(i.isNear(n,a))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 s,c;var e=t.op,n=t.isFullWork,i=(s=this.workId)==null?void 0:s.toString();if(!i)return;this.tmpPoints.length=0;for(var p=0;p<e.length;p+=3)this.tmpPoints.push(new Mt(e[p],e[p+1],e[p+2]));var a=n?this.fullLayer:this.drawLayer||this.fullLayer,o=this.draw({workId:i,layer:a,isDrawing:!1});return this.oldRect=o,(c=this.vNodes)==null||c.setInfo(i,{rect:o,op:e,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:yt.getCenterPos(o,a)}),o;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var h,v,y;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=n.fillColor,s=n.strokeType,c=i.get(e.name);var p=e;return e.tagName==="GROUP"&&(p=e.children[0]),a&&(p.setAttribute("strokeColor",a),(h=c==null?void 0:c.opt)!=null&&h.strokeColor&&(c.opt.strokeColor=a)),o&&(o==="transparent"?p.setAttribute("fillColor","rgba(0,0,0,0)"):p.setAttribute("fillColor",o),(v=c==null?void 0:c.opt)!=null&&v.fillColor&&(c.opt.fillColor=o)),s&&c!=null&&c.opt&&(y=c.opt)!=null&&y.strokeType&&(c.opt.strokeType=s),c&&i.setInfo(e.name,c),yt.updateNodeOpt(t);}}]);}(yt);var I0=de,L0=re,b0="[object Boolean]";function D0(u){return u===!0||u===!1||L0(u)&&I0(u)==b0;}var w0=D0,oe=/* @__PURE__ */he(w0);var fi=/*#__PURE__*/function(_yt7){function fi(t){var _this78;_classCallCheck(this,fi);_this78=_callSuper(this,fi,[t]);rt(_this78,"canRotate",!0);rt(_this78,"scaleType",Gt.all);rt(_this78,"toolsType",gt.Rectangle);rt(_this78,"tmpPoints",[]);rt(_this78,"workOptions");rt(_this78,"oldRect");rt(_this78,"syncTimestamp");_this78.workOptions=t.toolsOpt,_this78.syncTimestamp=0,_this78.syncUnitTime=50;return _this78;}_inherits(fi,_yt7);return _createClass(fi,[{key:"transformData",value:function transformData(){var t=Ut(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 e=this.workOptions.thickness,n=[];var _iterator25=_createForOfIteratorHelper(t),_step25;try{for(_iterator25.s();!(_step25=_iterator25.n()).done;){var o=_step25.value;n.push(_construct(tt,_toConsumableArray(o)));}}catch(err){_iterator25.e(err);}finally{_iterator25.f();}var i=Ut(n,e),a=[i.x+i.w/2,i.y+i.h/2];return{rect:i,pos:a,points:n.map(function(o){return o.XY;}).flat(1)};}},{key:"consume",value:function consume(t){var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=this.workId,s=e.op,c=s==null?void 0:s.length;if(!c||c<2)return{type:ft.None};var p;if(this.tmpPoints.length===0?(this.tmpPoints=[new Mt(s[0],s[1])],p=!1):p=this.updateTempPoints(s),!p)return{type:ft.None};var h=this.transformData();var v;if(i||a){var M=n?this.fullLayer:this.drawLayer||this.fullLayer;v=this.draw({ps:h,workId:o,layer:M,isDrawing:!0});}if(!i){var _M2=Date.now();return _M2-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_M2,_objectSpread({type:ft.DrawWork,dataType:Tt.Local,op:h.flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:ft.None};}var y=Ot(v,this.oldRect);return this.oldRect=v,_objectSpread({rect:y,type:ft.DrawWork,dataType:Tt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var s;var t=this.workId;if(this.tmpPoints.length<2)return{type:ft.RemoveNode,removeIds:[t]};var e=this.transformData(),n=this.fullLayer,i=this.draw({ps:e,workId:t,layer:n,isDrawing:!1});this.oldRect=i;var a=e.flat(1),o=_t(a);return(s=this.vNodes)==null||s.setInfo(t,{rect:i,op:a,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:i&&yt.getCenterPos(i,n)}),_objectSpread({rect:i,type:ft.FullWork,dataType:Tt.Local,ops:o,isSync:!0},this.baseConsumeResult);}},{key:"draw",value:function draw(t){var e=t.workId,n=t.layer,i=t.isDrawing,a=t.ps,o=t.replaceId,_this$workOptions8=this.workOptions,s=_this$workOptions8.strokeColor,c=_this$workOptions8.fillColor,p=_this$workOptions8.thickness,h=_this$workOptions8.zIndex,v=_this$workOptions8.scale,y=_this$workOptions8.rotate,M=_this$workOptions8.translate,T=_this$workOptions8.textOpt,m=_this$workOptions8.strokeType,x=n.worldPosition,l=n.worldScaling,_this$computDrawPoint4=this.computDrawPoints(a),d=_this$computDrawPoint4.points,f=_this$computDrawPoint4.rect,g=_this$computDrawPoint4.pos,O={close:!0,normalize:!0,points:d,lineWidth:p,fillColor:c!=="transparent"&&c||void 0,strokeColor:s,lineJoin:"round",lineCap:"round",lineDash:m===Lt.Dotted?[1,p*2]:m===Lt.LongDotted?[p,p*2]:void 0},A={x:Math.floor(f.x*l[0]+x[0]-yt.SafeBorderPadding),y:Math.floor(f.y*l[1]+x[1]-yt.SafeBorderPadding),w:Math.floor(f.w*l[0]+2*yt.SafeBorderPadding),h:Math.floor(f.h*l[0]+2*yt.SafeBorderPadding)},R=new qt({name:e,id:e,zIndex:h,pos:g,anchor:[0.5,0.5],size:[f.w,f.h],scale:v,rotate:y,translate:M}),b=new ae(_objectSpread(_objectSpread({},O),{},{pos:[0,0]}));if(R.appendChild(b),i){var P=new pe({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:s,lineWidth:1,scale:[1/l[0],1/l[1]]});R.appendChild(P);}if(this.replace(n,o||e,R),v||y||M){var _P10=R.getBoundingClientRect();return{x:Math.floor(_P10.x-yt.SafeBorderPadding),y:Math.floor(_P10.y-yt.SafeBorderPadding),w:Math.floor(_P10.width+2*yt.SafeBorderPadding),h:Math.floor(_P10.height+2*yt.SafeBorderPadding)};}return A;}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new Mt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;if(i.isNear(n,a))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 p,h;var e=t.op,n=t.isFullWork,i=t.replaceId,a=(p=this.workId)==null?void 0:p.toString();if(!a)return;var o=[];for(var v=0;v<e.length;v+=3)o.push([e[v],e[v+1],e[v+2]]);var s=n?this.fullLayer:this.drawLayer||this.fullLayer,c=this.draw({ps:o,workId:a,layer:s,isDrawing:!1,replaceId:i});return this.oldRect=c,(h=this.vNodes)==null||h.setInfo(a,{rect:c,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:c&&yt.getCenterPos(c,s)}),c;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var l,d,f;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=n.fillColor,s=n.fontColor,c=n.fontBgColor,p=n.bold,h=n.italic,v=n.lineThrough,y=n.underline,M=n.fontSize,T=n.strokeType,m=i.get(e.name);var x=e;if(e.tagName==="GROUP"&&(x=e.children[0]),a&&(x.setAttribute("strokeColor",a),(l=m==null?void 0:m.opt)!=null&&l.strokeColor&&(m.opt.strokeColor=a)),o&&(o==="transparent"?x.setAttribute("fillColor","rgba(0,0,0,0)"):x.setAttribute("fillColor",o),(d=m==null?void 0:m.opt)!=null&&d.fillColor&&(m.opt.fillColor=o)),m!=null&&m.opt.textOpt){var g=m.opt.textOpt;s&&g.fontColor&&(g.fontColor=s),c&&g.fontBgColor&&(g.fontBgColor=c),p&&(g.bold=p),h&&(g.italic=h),oe(v)&&(g.lineThrough=v),oe(y)&&(g.underline=y),M&&(g.fontSize=M);}return T&&m!=null&&m.opt&&(f=m.opt)!=null&&f.strokeType&&(m.opt.strokeType=T),m&&i.setInfo(e.name,m),yt.updateNodeOpt(t);}}]);}(yt);var ui=/*#__PURE__*/function(_yt8){function ui(t){var _this79;_classCallCheck(this,ui);_this79=_callSuper(this,ui,[t]);rt(_this79,"canRotate",!1);rt(_this79,"scaleType",Gt.all);rt(_this79,"toolsType",gt.Star);rt(_this79,"tmpPoints",[]);rt(_this79,"workOptions");rt(_this79,"oldRect");rt(_this79,"syncTimestamp");_this79.workOptions=t.toolsOpt,_this79.syncTimestamp=0,_this79.syncUnitTime=50;return _this79;}_inherits(ui,_yt8);return _createClass(ui,[{key:"consume",value:function consume(t){var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=this.workId,s=e.op,c=s==null?void 0:s.length;if(!c||c<2)return{type:ft.None};var p;if(this.tmpPoints.length===0?(this.tmpPoints=[new Mt(s[0],s[1])],p=!1):p=this.updateTempPoints(s),!p)return{type:ft.None};var h;if(i||a){var y=n?this.fullLayer:this.drawLayer||this.fullLayer;h=this.draw({workId:o,layer:y,isDrawing:!0});}if(!i){var _y10=Date.now();return _y10-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_y10,_objectSpread({type:ft.DrawWork,dataType:Tt.Local,op:this.tmpPoints.map(function(M){return[].concat(_toConsumableArray(M.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:ft.None};}var v=Ot(h,this.oldRect);return this.oldRect=h,_objectSpread({rect:v,type:ft.DrawWork,dataType:Tt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:ft.RemoveNode,removeIds:[t]};var e=this.fullLayer,n=this.draw({workId:t,layer:e,isDrawing:!1});this.oldRect=n;var i=this.tmpPoints.map(function(s){return[].concat(_toConsumableArray(s.XY),[0]);}).flat(1),a=_t(i);return(o=this.vNodes)==null||o.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&yt.getCenterPos(n,e)}),_objectSpread({rect:n,type:ft.FullWork,dataType:Tt.Local,ops:a,isSync:!0},this.baseConsumeResult);}},{key:"draw",value:function draw(t){var e=t.workId,n=t.layer,i=t.isDrawing,_this$workOptions9=this.workOptions,a=_this$workOptions9.strokeColor,o=_this$workOptions9.fillColor,s=_this$workOptions9.thickness,c=_this$workOptions9.zIndex,p=_this$workOptions9.vertices,h=_this$workOptions9.innerVerticeStep,v=_this$workOptions9.innerRatio,y=_this$workOptions9.scale,M=_this$workOptions9.rotate,T=_this$workOptions9.translate,m=_this$workOptions9.strokeType,x=n.worldScaling,_this$computDrawPoint5=this.computDrawPoints(s,p,h,v),l=_this$computDrawPoint5.rect,d=_this$computDrawPoint5.pos,f=_this$computDrawPoint5.points,g={close:!0,points:f,lineWidth:s,fillColor:o!=="transparent"&&o||void 0,strokeColor:a,normalize:!0,lineJoin:"round",lineCap:"round",lineDash:m===Lt.Dotted?[1,s*2]:m===Lt.LongDotted?[s,s*2]:void 0},O={name:e,id:e,zIndex:c,pos:d,anchor:[0.5,0.5],size:[l.w,l.h]};y&&(O.scale=y),M&&(O.rotate=M),T&&(O.translate=T);var A=new qt(O);if(i){var P=new pe({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:a,lineWidth:1,scale:[1/x[0],1/x[1]]});A.append(P);}var R=new ae(_objectSpread(_objectSpread({},g),{},{pos:[0,0]}));A.append(R),this.replace(n,e,A);var b=A.getBoundingClientRect();return{x:Math.floor(b.x-yt.SafeBorderPadding),y:Math.floor(b.y-yt.SafeBorderPadding),w:Math.floor(b.width+yt.SafeBorderPadding*2),h:Math.floor(b.height+yt.SafeBorderPadding*2)};}},{key:"computDrawPoints",value:function computDrawPoints(t,e,n,i){var a=Ut(this.tmpPoints),o=[Math.floor(a.x+a.w/2),Math.floor(a.y+a.h/2)],s=yi(a.w,a.h),c=Math.floor(Math.min(a.w,a.h)/2),p=i*c,h=[],v=2*Math.PI/e;for(var M=0;M<e;M++){var T=M*v-0.5*Math.PI;var m=void 0,_x59=void 0;M%n===1?(m=p*s[0]*Math.cos(T),_x59=p*s[1]*Math.sin(T)):(m=c*s[0]*Math.cos(T),_x59=c*s[1]*Math.sin(T),h.push(m,_x59)),h.push(m,_x59);}return{rect:Ut(this.tmpPoints,t),pos:o,points:h};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new Mt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;if(i.isNear(n,a)||Mt.Sub(i,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 s,c;var e=t.op,n=t.isFullWork,i=(s=this.workId)==null?void 0:s.toString();if(!i)return;this.tmpPoints.length=0;for(var p=0;p<e.length;p+=3)this.tmpPoints.push(new Mt(e[p],e[p+1],e[p+2]));var a=n?this.fullLayer:this.drawLayer||this.fullLayer,o=this.draw({workId:i,layer:a,isDrawing:!1});return this.oldRect=o,(c=this.vNodes)==null||c.setInfo(i,{rect:o,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:o&&yt.getCenterPos(o,a)}),o;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var m;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=n.fillColor,s=n.toolsType,c=n.vertices,p=n.innerVerticeStep,h=n.innerRatio,v=n.strokeType,y=i.get(e.name),M=y==null?void 0:y.opt;var T=e;return e.tagName==="GROUP"&&(T=e.children[0]),a&&(T.setAttribute("strokeColor",a),M!=null&&M.strokeColor&&(M.strokeColor=a)),o&&(o==="transparent"?T.setAttribute("fillColor","rgba(0,0,0,0)"):T.setAttribute("fillColor",o),M!=null&&M.fillColor&&(M.fillColor=o)),s===gt.Star&&(c&&(M.vertices=c),p&&(M.innerVerticeStep=p),h&&(M.innerRatio=h)),v&&y!=null&&y.opt&&(m=y.opt)!=null&&m.strokeType&&(y.opt.strokeType=v),y&&i.setInfo(e.name,_objectSpread(_objectSpread({},y),{},{opt:M})),yt.updateNodeOpt(t);}}]);}(yt);var hi=/*#__PURE__*/function(_yt9){function hi(t){var _this80;_classCallCheck(this,hi);_this80=_callSuper(this,hi,[t]);rt(_this80,"canRotate",!1);rt(_this80,"scaleType",Gt.all);rt(_this80,"toolsType",gt.Polygon);rt(_this80,"tmpPoints",[]);rt(_this80,"workOptions");rt(_this80,"oldRect");rt(_this80,"syncTimestamp");_this80.workOptions=t.toolsOpt,_this80.syncTimestamp=0,_this80.syncUnitTime=50;return _this80;}_inherits(hi,_yt9);return _createClass(hi,[{key:"consume",value:function consume(t){var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=e.op,s=this.workId,c=o==null?void 0:o.length;if(!c||c<2)return{type:ft.None};var p;if(this.tmpPoints.length===0?(this.tmpPoints=[new Mt(o[0],o[1])],p=!1):p=this.updateTempPoints(o),!p)return{type:ft.None};var h;if(i||a){var y=n?this.fullLayer:this.drawLayer||this.fullLayer;h=this.draw({workId:s,layer:y,isDrawing:!0});}if(!i){var _y11=Date.now();return _y11-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_y11,_objectSpread({type:ft.DrawWork,dataType:Tt.Local,op:this.tmpPoints.map(function(M){return[].concat(_toConsumableArray(M.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:ft.None};}var v=Ot(h,this.oldRect);return this.oldRect=h,_objectSpread({rect:v,type:ft.DrawWork,dataType:Tt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:ft.RemoveNode,removeIds:[t]};var e=this.fullLayer,n=this.draw({workId:t,layer:e,isDrawing:!1});this.oldRect=n;var i=this.tmpPoints.map(function(s){return[].concat(_toConsumableArray(s.XY),[0]);}).flat(1),a=_t(i);return(o=this.vNodes)==null||o.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&yt.getCenterPos(n,e)}),_objectSpread({rect:n,type:ft.FullWork,dataType:Tt.Local,ops:a,isSync:!0},this.baseConsumeResult);}},{key:"draw",value:function draw(t){var e=t.workId,n=t.layer,i=t.isDrawing,_this$workOptions10=this.workOptions,a=_this$workOptions10.strokeColor,o=_this$workOptions10.fillColor,s=_this$workOptions10.thickness,c=_this$workOptions10.zIndex,p=_this$workOptions10.vertices,h=_this$workOptions10.scale,v=_this$workOptions10.rotate,y=_this$workOptions10.translate,M=_this$workOptions10.strokeType,T=n.worldScaling,_this$computDrawPoint6=this.computDrawPoints(s,p),m=_this$computDrawPoint6.rect,x=_this$computDrawPoint6.pos,l=_this$computDrawPoint6.points,d={close:!0,points:l,lineWidth:s,fillColor:o!=="transparent"&&o||void 0,strokeColor:a,normalize:!0,lineJoin:"round",lineCap:"round",lineDash:M===Lt.Dotted?[1,s*2]:M===Lt.LongDotted?[s,s*2]:void 0},f={name:e,id:e,zIndex:c,pos:x,anchor:[0.5,0.5],size:[m.w,m.h]};h&&(f.scale=h),v&&(f.rotate=v),y&&(f.translate=y);var g=new qt(f);if(i){var R=new pe({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:a,lineWidth:1,scale:[1/T[0],1/T[1]]});g.append(R);}var O=new ae(_objectSpread(_objectSpread({},d),{},{pos:[0,0]}));g.append(O),this.replace(n,e,g);var A=g.getBoundingClientRect();return{x:Math.floor(A.x-yt.SafeBorderPadding),y:Math.floor(A.y-yt.SafeBorderPadding),w:Math.floor(A.width+yt.SafeBorderPadding*2),h:Math.floor(A.height+yt.SafeBorderPadding*2)};}},{key:"computDrawPoints",value:function computDrawPoints(t,e){var n=Ut(this.tmpPoints),i=[Math.floor(n.x+n.w/2),Math.floor(n.y+n.h/2)],a=yi(n.w,n.h),o=Math.floor(Math.min(n.w,n.h)/2),s=[],c=2*Math.PI/e;for(var h=0;h<e;h++){var v=h*c-0.5*Math.PI,y=o*a[0]*Math.cos(v),M=o*a[1]*Math.sin(v);s.push(y,M);}return{rect:Ut(this.tmpPoints,t),pos:i,points:s};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new Mt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;if(i.isNear(n,a)||Mt.Sub(i,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 s,c;var e=t.op,n=t.isFullWork,i=(s=this.workId)==null?void 0:s.toString();if(!i)return;this.tmpPoints.length=0;for(var p=0;p<e.length;p+=3)this.tmpPoints.push(new Mt(e[p],e[p+1],e[p+2]));var a=n?this.fullLayer:this.drawLayer||this.fullLayer,o=this.draw({workId:i,layer:a,isDrawing:!1});return this.oldRect=o,(c=this.vNodes)==null||c.setInfo(i,{rect:o,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:o&&yt.getCenterPos(o,a)}),o;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var M;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=n.fillColor,s=n.toolsType,c=n.vertices,p=n.strokeType,h=i.get(e.name),v=h==null?void 0:h.opt;var y=e;return e.tagName==="GROUP"&&(y=e.children[0]),a&&(y.setAttribute("strokeColor",a),v!=null&&v.strokeColor&&(v.strokeColor=a)),o&&(o==="transparent"?y.setAttribute("fillColor","rgba(0,0,0,0)"):y.setAttribute("fillColor",o),v!=null&&v.fillColor&&(v.fillColor=o)),s===gt.Polygon&&c&&(v.vertices=c),p&&h!=null&&h.opt&&(M=h.opt)!=null&&M.strokeType&&(h.opt.strokeType=p),h&&i.setInfo(e.name,_objectSpread(_objectSpread({},h),{},{opt:v})),yt.updateNodeOpt(t);}}]);}(yt);var Zt=/*#__PURE__*/function(){function Zt(){_classCallCheck(this,Zt);}return _createClass(Zt,null,[{key:"bezier",value:function bezier(r,t){var e=[];for(var n=0;n<t.length;n+=4){var i=t[n],a=t[n+1],o=t[n+2],s=t[n+3];i&&a&&o&&s?e.push.apply(e,_toConsumableArray(Zt.getBezierPoints(r,i,a,o,s))):i&&a&&o?e.push.apply(e,_toConsumableArray(Zt.getBezierPoints(r,i,a,o))):i&&a?e.push.apply(e,_toConsumableArray(Zt.getBezierPoints(r,i,a))):i&&e.push(i);}return e;}/**
|
|
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 r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:10;var t=arguments.length>1?arguments[1]:undefined;var e=arguments.length>2?arguments[2]:undefined;var n=arguments.length>3?arguments[3]:undefined;var i=arguments.length>4?arguments[4]:undefined;var a=null;var o=[];!n&&!i?a=Zt.oneBezier:n&&!i?a=Zt.twoBezier:n&&i&&(a=Zt.threeBezier);for(var s=0;s<r;s++)a&&o.push(a(s/r,t,e,n,i));return i?o.push(i):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(r,t,e){var n=t.x+(e.x-t.x)*r,i=t.y+(e.y-t.y)*r;return new tt(n,i);}/**
|
|
424
|
-
* @desc 二阶贝塞尔
|
|
425
|
-
* @param {number} t 当前百分比
|
|
426
|
-
* @param {Array} p1 起点坐标
|
|
427
|
-
* @param {Array} p2 终点坐标
|
|
428
|
-
* @param {Array} cp 控制点
|
|
429
|
-
*/},{key:"twoBezier",value:function twoBezier(r,t,e,n){var i=(1-r)*(1-r)*t.x+2*r*(1-r)*e.x+r*r*n.x,a=(1-r)*(1-r)*t.y+2*r*(1-r)*e.y+r*r*n.y;return new tt(i,a);}/**
|
|
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(r,t,e,n,i){var a=t.x*(1-r)*(1-r)*(1-r)+3*e.x*r*(1-r)*(1-r)+3*n.x*r*r*(1-r)+i.x*r*r*r,o=t.y*(1-r)*(1-r)*(1-r)+3*e.y*r*(1-r)*(1-r)+3*n.y*r*r*(1-r)+i.y*r*r*r;return new tt(a,o);}}]);}();var di=/*#__PURE__*/function(_yt10){function di(t){var _this81;_classCallCheck(this,di);_this81=_callSuper(this,di,[t]);rt(_this81,"canRotate",!1);rt(_this81,"scaleType",Gt.all);rt(_this81,"toolsType",gt.SpeechBalloon);rt(_this81,"ratio",0.8);rt(_this81,"tmpPoints",[]);rt(_this81,"workOptions");rt(_this81,"oldRect");rt(_this81,"syncTimestamp");_this81.workOptions=t.toolsOpt,_this81.syncTimestamp=0,_this81.syncUnitTime=50;return _this81;}_inherits(di,_yt10);return _createClass(di,[{key:"consume",value:function consume(t){var y;var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=(y=e==null?void 0:e.workId)==null?void 0:y.toString();if(!o)return{type:ft.None};var s=e.op,c=s==null?void 0:s.length;if(!c||c<2)return{type:ft.None};var p;if(this.tmpPoints.length===0?(this.tmpPoints=[new Mt(s[0],s[1])],p=!1):p=this.updateTempPoints(s),!p)return{type:ft.None};var h;if(i||a){var M=n?this.fullLayer:this.drawLayer||this.fullLayer;h=this.draw({workId:o,layer:M,isDrawing:!0});}if(!i){var _M3=Date.now();return _M3-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_M3,_objectSpread({type:ft.DrawWork,dataType:Tt.Local,op:this.tmpPoints.map(function(T){return[].concat(_toConsumableArray(T.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:ft.None};}var v=Ot(h,this.oldRect);return this.oldRect=h,_objectSpread({rect:v,type:ft.DrawWork,dataType:Tt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:ft.RemoveNode,removeIds:[t]};var e=this.fullLayer,n=this.draw({workId:t,layer:e,isDrawing:!1});this.oldRect=n;var i=this.tmpPoints.map(function(s){return[].concat(_toConsumableArray(s.XY),[0]);}).flat(1),a=_t(i);return(o=this.vNodes)==null||o.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&yt.getCenterPos(n,e)}),_objectSpread({rect:n,type:ft.FullWork,dataType:Tt.Local,ops:a,isSync:!0},this.baseConsumeResult);}},{key:"draw",value:function draw(t){var e=t.workId,n=t.layer,_this$workOptions11=this.workOptions,i=_this$workOptions11.strokeColor,a=_this$workOptions11.fillColor,o=_this$workOptions11.thickness,s=_this$workOptions11.zIndex,c=_this$workOptions11.placement,p=_this$workOptions11.scale,h=_this$workOptions11.rotate,v=_this$workOptions11.translate,y=_this$workOptions11.strokeType,_this$computDrawPoint7=this.computDrawPoints(o,c),M=_this$computDrawPoint7.rect,T=_this$computDrawPoint7.pos,m=_this$computDrawPoint7.points,x={points:m.map(function(O){return O.XY;}),lineWidth:o,fillColor:a!=="transparent"&&a||void 0,strokeColor:i,normalize:!0,className:"".concat(T[0],",").concat(T[1]),close:!0,lineJoin:"round",lineCap:"round",lineDash:y===Lt.Dotted?[1,o*2]:y===Lt.LongDotted?[o,o*2]:void 0},l={name:e,id:e,zIndex:s,pos:T,anchor:[0.5,0.5],size:[M.w,M.h]};p&&(l.scale=p),h&&(l.rotate=h),v&&(l.translate=v);var d=new qt(l),f=new ae(_objectSpread(_objectSpread({},x),{},{pos:[0,0]}));d.append(f),this.replace(n,e,d);var g=d.getBoundingClientRect();return{x:Math.floor(g.x-yt.SafeBorderPadding),y:Math.floor(g.y-yt.SafeBorderPadding),w:Math.floor(g.width+yt.SafeBorderPadding*2),h:Math.floor(g.height+yt.SafeBorderPadding*2)};}},{key:"transformControlPoints",value:function transformControlPoints(t){var e=Ut(this.tmpPoints);switch(t){case"bottom":case"bottomLeft":case"bottomRight":{var n=e.y+e.h*this.ratio;return[new tt(e.x,e.y,0),new tt(e.x+e.w,e.y,0),new tt(e.x+e.w,n,0),new tt(e.x,n,0)];}case"top":case"topLeft":case"topRight":{var _n4=e.y+e.h*(1-this.ratio);return[new tt(e.x,_n4,0),new tt(e.x+e.w,_n4,0),new tt(e.x+e.w,e.y+e.h,0),new tt(e.x,e.y+e.h,0)];}case"left":case"leftBottom":case"leftTop":{var _n5=e.x+e.w*(1-this.ratio);return[new tt(_n5,e.y,0),new tt(e.x+e.w,e.y,0),new tt(e.x+e.w,e.y+e.h,0),new tt(_n5,e.y+e.h,0)];}case"right":case"rightBottom":case"rightTop":{var _n6=e.x+e.w*this.ratio;return[new tt(e.x,e.y,0),new tt(_n6,e.y,0),new tt(_n6,e.y+e.h,0),new tt(e.x,e.y+e.h,0)];}}}},{key:"computDrawPoints",value:function computDrawPoints(t,e){var n=Ut(this.tmpPoints),i=this.transformControlPoints(e),a=Math.floor(n.w*0.1),o=Math.floor(n.h*0.1),s=[],c=tt.Add(i[0],new tt(0,o,0)),p=tt.Add(i[0],new tt(a,0,0)),h=Zt.getBezierPoints(10,c,i[0],p),v=tt.Sub(i[1],new tt(a,0,0)),y=tt.Add(i[1],new tt(0,o,0)),M=Zt.getBezierPoints(10,v,i[1],y),T=tt.Sub(i[2],new tt(0,o,0)),m=tt.Sub(i[2],new tt(a,0,0)),x=Zt.getBezierPoints(10,T,i[2],m),l=tt.Add(i[3],new tt(a,0,0)),d=tt.Sub(i[3],new tt(0,o,0)),f=Zt.getBezierPoints(10,l,i[3],d),g=a*(1-this.ratio)*10,O=o*(1-this.ratio)*10;switch(e){case"bottom":{var b=tt.Sub(i[2],new tt(a*5-g/2,0,0)),P=tt.Sub(i[2],new tt(a*5,-O,0)),L=tt.Sub(i[2],new tt(a*5+g/2,0,0));s.push.apply(s,[P,L].concat(_toConsumableArray(f),_toConsumableArray(h),_toConsumableArray(M),_toConsumableArray(x),[b]));break;}case"bottomRight":{var _b13=tt.Sub(i[2],new tt(a*1.1,0,0)),_P11=tt.Sub(i[2],new tt(a*1.1+g/2,-O,0)),_L8=tt.Sub(i[2],new tt(a*1.1+g,0,0));s.push.apply(s,[_P11,_L8].concat(_toConsumableArray(f),_toConsumableArray(h),_toConsumableArray(M),_toConsumableArray(x),[_b13]));break;}case"bottomLeft":{var _b14=tt.Add(i[3],new tt(a*1.1+g,0,0)),_P12=tt.Add(i[3],new tt(a*1.1+g/2,O,0)),_L9=tt.Add(i[3],new tt(a*1.1,0,0));s.push.apply(s,[_P12,_L9].concat(_toConsumableArray(f),_toConsumableArray(h),_toConsumableArray(M),_toConsumableArray(x),[_b14]));break;}case"top":{var _b15=tt.Sub(i[1],new tt(a*5-g/2,0,0)),_P13=tt.Sub(i[1],new tt(a*5,O,0)),_L10=tt.Sub(i[1],new tt(a*5+g/2,0,0));s.push.apply(s,[_P13,_b15].concat(_toConsumableArray(M),_toConsumableArray(x),_toConsumableArray(f),_toConsumableArray(h),[_L10]));break;}case"topRight":{var _b16=tt.Sub(i[1],new tt(a*1.1,0,0)),_P14=tt.Sub(i[1],new tt(a*1.1+g/2,O,0)),_L11=tt.Sub(i[1],new tt(a*1.1+g,0,0));s.push.apply(s,[_P14,_b16].concat(_toConsumableArray(M),_toConsumableArray(x),_toConsumableArray(f),_toConsumableArray(h),[_L11]));break;}case"topLeft":{var _b17=tt.Add(i[0],new tt(a*1.1+g,0,0)),_P15=tt.Add(i[0],new tt(a*1.1+g/2,-O,0)),_L12=tt.Add(i[0],new tt(a*1.1,0,0));s.push.apply(s,[_P15,_b17].concat(_toConsumableArray(M),_toConsumableArray(x),_toConsumableArray(f),_toConsumableArray(h),[_L12]));break;}case"left":{var _b18=tt.Add(i[0],new tt(0,o*5-O/2,0)),_P16=tt.Add(i[0],new tt(-g,o*5,0)),_L13=tt.Add(i[0],new tt(0,o*5+O/2,0));s.push.apply(s,[_P16,_b18].concat(_toConsumableArray(h),_toConsumableArray(M),_toConsumableArray(x),_toConsumableArray(f),[_L13]));break;}case"leftTop":{var _b19=tt.Add(i[0],new tt(0,o*1.1,0)),_P17=tt.Add(i[0],new tt(-g,o*1.1+O/2,0)),_L14=tt.Add(i[0],new tt(0,o*1.1+O,0));s.push.apply(s,[_P17,_b19].concat(_toConsumableArray(h),_toConsumableArray(M),_toConsumableArray(x),_toConsumableArray(f),[_L14]));break;}case"leftBottom":{var _b20=tt.Sub(i[3],new tt(0,o*1.1+O,0)),_P18=tt.Sub(i[3],new tt(g,o*1.1+O/2,0)),_L15=tt.Sub(i[3],new tt(0,o*1.1,0));s.push.apply(s,[_P18,_b20].concat(_toConsumableArray(h),_toConsumableArray(M),_toConsumableArray(x),_toConsumableArray(f),[_L15]));break;}case"right":{var _b21=tt.Add(i[1],new tt(0,o*5-O/2,0)),_P19=tt.Add(i[1],new tt(g,o*5,0)),_L16=tt.Add(i[1],new tt(0,o*5+O/2,0));s.push.apply(s,[_P19,_L16].concat(_toConsumableArray(x),_toConsumableArray(f),_toConsumableArray(h),_toConsumableArray(M),[_b21]));break;}case"rightTop":{var _b22=tt.Add(i[1],new tt(0,o*1.1,0)),_P20=tt.Add(i[1],new tt(g,o*1.1+O/2,0)),_L17=tt.Add(i[1],new tt(0,o*1.1+O,0));s.push.apply(s,[_P20,_L17].concat(_toConsumableArray(x),_toConsumableArray(f),_toConsumableArray(h),_toConsumableArray(M),[_b22]));break;}case"rightBottom":{var _b23=tt.Sub(i[2],new tt(0,o*1.1+O,0)),_P21=tt.Sub(i[2],new tt(-g,o*1.1+O/2,0)),_L18=tt.Sub(i[2],new tt(0,o*1.1,0));s.push.apply(s,[_P21,_L18].concat(_toConsumableArray(x),_toConsumableArray(f),_toConsumableArray(h),_toConsumableArray(M),[_b23]));break;}}var A=Ut(this.tmpPoints,t),R=[Math.floor(A.x+A.w/2),Math.floor(A.y+A.h/2)];return{rect:A,pos:R,points:s};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new Mt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;if(i.isNear(n,a)||Mt.Sub(i,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 s,c;var e=t.op,n=t.isFullWork,i=(s=this.workId)==null?void 0:s.toString();if(!i)return;this.tmpPoints.length=0;for(var p=0;p<e.length;p+=3)this.tmpPoints.push(new Mt(e[p],e[p+1],e[p+2]));var a=n?this.fullLayer:this.drawLayer||this.fullLayer,o=this.draw({workId:i,layer:a,isDrawing:!1});return this.oldRect=o,(c=this.vNodes)==null||c.setInfo(i,{rect:o,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:o&&yt.getCenterPos(o,a)}),o;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var M;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=n.fillColor,s=n.toolsType,c=n.placement,p=n.strokeType,h=i.get(e.name),v=h==null?void 0:h.opt;var y=e;return e.tagName==="GROUP"&&(y=e.children[0]),a&&(y.setAttribute("strokeColor",a),v!=null&&v.strokeColor&&(v.strokeColor=a)),o&&(o==="transparent"?y.setAttribute("fillColor","rgba(0,0,0,0)"):y.setAttribute("fillColor",o),v!=null&&v.fillColor&&(v.fillColor=o)),s===gt.SpeechBalloon&&c&&(v.placement=c),p&&h!=null&&h.opt&&(M=h.opt)!=null&&M.strokeType&&(h.opt.strokeType=p),h&&i.setInfo(e.name,_objectSpread(_objectSpread({},h),{},{opt:v})),yt.updateNodeOpt(t);}}]);}(yt);var we=/*#__PURE__*/function(_yt11){function we(t){var _this82;_classCallCheck(this,we);_this82=_callSuper(this,we,[t]);rt(_this82,"canRotate",!0);rt(_this82,"scaleType",Gt.all);rt(_this82,"toolsType",gt.Image);rt(_this82,"tmpPoints",[]);rt(_this82,"workOptions");rt(_this82,"oldRect");_this82.workOptions=t.toolsOpt,_this82.scaleType=we.getScaleType(_this82.workOptions);return _this82;}_inherits(we,_yt11);return _createClass(we,[{key:"consume",value:function consume(){return{type:ft.None};}},{key:"consumeAll",value:function consumeAll(){return{type:ft.None};}},{key:"draw",value:function draw(t){var e=t.layer,n=t.workId,i=t.replaceId,a=t.imageBitmap,o=t.isMainThread,_this$workOptions12=this.workOptions,s=_this$workOptions12.centerX,c=_this$workOptions12.centerY,p=_this$workOptions12.width,h=_this$workOptions12.height,v=_this$workOptions12.rotate,y=_this$workOptions12.zIndex,M=!!e.parent.gl,T={anchor:[0.5,0.5],pos:[s,c],name:n,size:[p,h],zIndex:y,rotate:!o&&!M&&180+(v||0)||v,texture:a},m=new Md(T);this.replace(e,i||n,m);var x=m.getBoundingClientRect();if(x)return{x:Math.floor(x.x-yt.SafeBorderPadding),y:Math.floor(x.y-yt.SafeBorderPadding),w:Math.floor(x.width+yt.SafeBorderPadding*2),h:Math.floor(x.height+yt.SafeBorderPadding*2)};}},{key:"consumeService",value:function consumeService(){}},{key:"consumeServiceAsync",value:function(){var _consumeServiceAsync=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee23(t){var h,v,y,M,e,n,i,a,_this$workOptions13,o,s,c,p,T,m;return _regeneratorRuntime().wrap(function _callee23$(_context25){while(1)switch(_context25.prev=_context25.next){case 0:e=t.isFullWork,n=t.replaceId,i=t.scene,a=t.isMainThread,_this$workOptions13=this.workOptions,o=_this$workOptions13.src,s=_this$workOptions13.uuid,c=((h=this.workId)==null?void 0:h.toString())||s,p=e?this.fullLayer:this.drawLayer||this.fullLayer;if(!o){_context25.next=7;break;}_context25.next=4;return i.preload({id:s,src:this.workOptions.src});case 4:T=_context25.sent;m=this.draw({workId:c,layer:p,replaceId:n,imageBitmap:T[0],isMainThread:a});return _context25.abrupt("return",(this.oldRect=c&&((y=(v=this.vNodes)==null?void 0:v.get(c))==null?void 0:y.rect)||void 0,(M=this.vNodes)==null||M.setInfo(c,{rect:m,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:m&&yt.getCenterPos(m,p)}),m));case 7:case"end":return _context25.stop();}},_callee23,this);}));function consumeServiceAsync(_x60){return _consumeServiceAsync.apply(this,arguments);}return consumeServiceAsync;}()},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"getScaleType",value:function getScaleType(t){var e=t.uniformScale,n=t.rotate;return e!==!1||n&&Math.abs(n)%90>0?Gt.proportional:Gt.all;}},{key:"updateNodeOpt",value:function updateNodeOpt(t){var e=t.node,n=t.opt,i=t.vNodes,a=t.targetNode,o=n.translate,s=n.originPoint,c=n.scenePoint,p=n.scale,h=n.angle,v=n.isLocked,y=n.zIndex,M=a&&Xt(a)||i.get(e.name);if(!M)return;var T=e.parent;if(T){if(kt(y)&&(e.setAttribute("zIndex",y),M.opt.zIndex=y),oe(v)&&(M.opt.locked=v),s&&c&&p){var _M$opt=M.opt,m=_M$opt.centerX,_x61=_M$opt.centerY,_l31=_M$opt.width,d=_M$opt.height,f=_M$opt.uniformScale,g=f!==!1?[p[0],p[0]]:p,O=[m,_x61],A=[m,_x61];Dr(A,c,g,o);var R=[A[0]-O[0],A[1]-O[1]];M.centerPos=[M.centerPos[0]+R[0],M.centerPos[1]+R[1]],M.opt.width=Math.round(_l31*g[0]),M.opt.height=Math.round(d*g[1]),M.opt.centerX=A[0],M.opt.centerY=A[1];}else if(o)M.opt.centerX=M.opt.centerX+o[0],M.opt.centerY=M.opt.centerY+o[1],M.centerPos=[M.centerPos[0]+o[0],M.centerPos[1]+o[1]];else if(kt(h))if(M.opt.rotate=h,M.scaleType=we.getScaleType(M.opt),a){var _m9=mi(M.rect,h);M.rect=_m9;}else{var _m10=yt.getRectFromLayer(T,e.name);M.rect=_m10||M.rect;}return M&&i.setInfo(e.name,M),M==null?void 0:M.rect;}}}]);}(yt);var gi=/*#__PURE__*/function(_yt12){function gi(t){var _this83;_classCallCheck(this,gi);_this83=_callSuper(this,gi,[t]);rt(_this83,"canRotate",!1);rt(_this83,"scaleType",Gt.both);rt(_this83,"toolsType",gt.Straight);rt(_this83,"tmpPoints",[]);rt(_this83,"workOptions");rt(_this83,"oldRect");rt(_this83,"straightTipWidth");rt(_this83,"syncTimestamp");_this83.workOptions=t.toolsOpt,_this83.straightTipWidth=_this83.workOptions.thickness/2,_this83.syncTimestamp=0,_this83.syncUnitTime=50;return _this83;}_inherits(gi,_yt12);return _createClass(gi,[{key:"consume",value:function consume(t){var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=this.workId,s=e.op,c=s==null?void 0:s.length;if(!c||c<2)return{type:ft.None};var p;if(this.tmpPoints.length===0?(this.tmpPoints=[new Mt(s[0],s[1])],p=!1):p=this.updateTempPoints(s),!p)return{type:ft.None};var h;if(i||a){var y=n?this.fullLayer:this.drawLayer||this.fullLayer;h=this.draw({workId:o,layer:y});}if(!i){var _y12=Date.now();return _y12-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_y12,_objectSpread({type:ft.DrawWork,dataType:Tt.Local,op:this.tmpPoints.map(function(M){return[].concat(_toConsumableArray(M.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:ft.None};}var v=Ot(h,this.oldRect);return this.oldRect=h,_objectSpread({rect:v,type:ft.DrawWork,dataType:Tt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:ft.RemoveNode,removeIds:[t]};var e=this.fullLayer,n=this.draw({workId:t,layer:e});this.oldRect=n;var i=this.tmpPoints.map(function(s){return[].concat(_toConsumableArray(s.XY),[0]);}).flat(1),a=_t(i);return(o=this.vNodes)==null||o.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&yt.getCenterPos(n,e)}),_objectSpread({rect:n,type:ft.FullWork,dataType:Tt.Local,ops:a,isSync:!0},this.baseConsumeResult);}},{key:"draw",value:function draw(t){var e=t.workId,n=t.layer,_this$workOptions14=this.workOptions,i=_this$workOptions14.strokeColor,a=_this$workOptions14.thickness,o=_this$workOptions14.zIndex,s=_this$workOptions14.scale,c=_this$workOptions14.rotate,p=_this$workOptions14.translate,h=_this$workOptions14.strokeType,v=n.worldPosition,y=n.worldScaling,_this$computDrawPoint8=this.computDrawPoints(a,h),M=_this$computDrawPoint8.d,T=_this$computDrawPoint8.rect,m=_this$computDrawPoint8.isDot,x=[T.x+T.w/2,T.y+T.h/2],l={pos:x,name:e,id:e,d:M,fillColor:i,strokeColor:i,lineDash:h===Lt.Dotted&&!m?[1,a*2]:h===Lt.LongDotted&&!m?[a,a*2]:void 0,lineCap:h===Lt.Normal||m?void 0:"round",lineWidth:h===Lt.Normal||m?0:a,className:"".concat(x[0],",").concat(x[1]),normalize:!0,zIndex:o};s&&(l.scale=s),c&&(l.rotate=c),p&&(l.translate=p);var d=new pe(l);if(this.replace(n,e,d),c||s||p){var g=d.getBoundingClientRect();return{x:Math.floor(g.x-yt.SafeBorderPadding),y:Math.floor(g.y-yt.SafeBorderPadding),w:Math.floor(g.width+yt.SafeBorderPadding*2),h:Math.floor(g.height+yt.SafeBorderPadding*2)};}return{x:Math.floor(T.x*y[0]+v[0]-yt.SafeBorderPadding),y:Math.floor(T.y*y[1]+v[1]-yt.SafeBorderPadding),w:Math.floor(T.w*y[0]+2*yt.SafeBorderPadding),h:Math.floor(T.h*y[1]+2*yt.SafeBorderPadding)};}},{key:"computDrawPoints",value:function computDrawPoints(t,e){return this.tmpPoints[1].distance(this.tmpPoints[0])>this.straightTipWidth?this.computFullPoints(t,e):this.computDotPoints(t);}},{key:"computFullPoints",value:function computFullPoints(t,e){var n=tt.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),i=tt.Per(n).mul(t/2),a=Mt.Sub(this.tmpPoints[0],i),o=Mt.Add(this.tmpPoints[0],i),s=Mt.Sub(this.tmpPoints[1],i),c=Mt.Add(this.tmpPoints[1],i),p=Mt.GetSemicircleStroke(this.tmpPoints[1],s,-1,8),h=Mt.GetSemicircleStroke(this.tmpPoints[0],o,-1,8),v=[a,s].concat(_toConsumableArray(p),[c,o],_toConsumableArray(h));var y;return e!==Lt.Normal?y=ue(this.tmpPoints,!1):y=ue(v,!0),{d:y,rect:Ut(v),isDot:!1,pos:this.tmpPoints[0].XY};}},{key:"computDotPoints",value:function computDotPoints(t){var e=Mt.GetDotStroke(this.tmpPoints[0],t/2,8);return{d:ue(e,!0),rect:Ut(e),isDot:!0,pos:this.tmpPoints[0].XY};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new Mt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;if(i.isNear(n,a))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 s,c;var e=t.op,n=t.isFullWork,i=(s=this.workId)==null?void 0:s.toString();if(!i)return;this.tmpPoints.length=0;for(var p=0;p<e.length;p+=3)this.tmpPoints.push(new Mt(e[p],e[p+1],e[p+2]));var a=n?this.fullLayer:this.drawLayer||this.fullLayer,o=this.draw({workId:i,layer:a});return this.oldRect=o,(c=this.vNodes)==null||c.setInfo(i,{rect:o,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:o&&yt.getCenterPos(o,a)}),o;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var c,p;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=n.strokeType,s=i.get(e.name);return a&&(e.setAttribute("strokeColor",a),e.setAttribute("fillColor",a),(c=s==null?void 0:s.opt)!=null&&c.strokeColor&&(s.opt.strokeColor=a)),o&&s!=null&&s.opt&&(p=s.opt)!=null&&p.strokeType&&(s.opt.strokeType=o),s&&i.setInfo(e.name,s),yt.updateNodeOpt(t);}}]);}(yt);var ie=/*#__PURE__*/function(_yt13){function ie(t){var _this84;_classCallCheck(this,ie);_this84=_callSuper(this,ie,[t]);rt(_this84,"canRotate",!1);rt(_this84,"scaleType",Gt.proportional);rt(_this84,"toolsType",gt.Text);rt(_this84,"tmpPoints",[]);rt(_this84,"workOptions");rt(_this84,"oldRect");_this84.workOptions=t.toolsOpt;return _this84;}_inherits(ie,_yt13);return _createClass(ie,[{key:"consume",value:function consume(){return{type:ft.None};}},{key:"consumeAll",value:function consumeAll(){return{type:ft.None};}},{key:"consumeService",value:function consumeService(){}},{key:"draw",value:function(){var _draw3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee24(t){var e,n,i,_this$workOptions15,a,o,s,c,p,h,v,y,M,T,m,_x63;return _regeneratorRuntime().wrap(function _callee24$(_context26){while(1)switch(_context26.prev=_context26.next){case 0:e=t.workId,n=t.layer,i=t.isDrawLabel,_this$workOptions15=this.workOptions,a=_this$workOptions15.boxSize,o=_this$workOptions15.boxPoint,s=_this$workOptions15.zIndex,c=n.worldPosition,p=n.worldScaling;if(!(!o||!a)){_context26.next=3;break;}return _context26.abrupt("return");case 3:h={name:e,id:e,pos:[o[0],o[1]],anchor:[0,0],size:a,zIndex:s},v=new qt(h),y={x:o[0],y:o[1],w:a[0],h:a[1]},M={x:Math.floor(y.x*p[0]+c[0]),y:Math.floor(y.y*p[1]+c[1]),w:Math.floor(y.w*p[0])+2,h:Math.floor(y.h*p[1])+2};if(!(this.replace(n,e,v),i&&n&&this.workOptions.text)){_context26.next=11;break;}_context26.next=7;return ie.createLabels(this.workOptions,n,M);case 7:T=_context26.sent;m=T.labels;_x63=T.maxWidth;v.append.apply(v,_toConsumableArray(m)),M.w=Math.ceil(Math.max(_x63*n.worldScaling[0],M.w));case 11:return _context26.abrupt("return",M);case 12:case"end":return _context26.stop();}},_callee24,this);}));function draw(_x62){return _draw3.apply(this,arguments);}return draw;}()},{key:"consumeServiceAsync",value:function(){var _consumeServiceAsync2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee25(t){var c,p,h,v,e,n,i,a,o,s;return _regeneratorRuntime().wrap(function _callee25$(_context27){while(1)switch(_context27.prev=_context27.next){case 0:e=(c=this.workId)==null?void 0:c.toString();if(e){_context27.next=3;break;}return _context27.abrupt("return");case 3:n=t.isFullWork,i=t.replaceId,a=t.isDrawLabel;this.oldRect=i&&((h=(p=this.vNodes)==null?void 0:p.get(i))==null?void 0:h.rect)||void 0;o=n?this.fullLayer:this.drawLayer||this.fullLayer;_context27.next=8;return this.draw({workId:e,layer:o,isDrawLabel:_typeof(a)>"u"&&this.workOptions.workState===It.Done||a});case 8:s=_context27.sent;return _context27.abrupt("return",((v=this.vNodes)==null||v.setInfo(e,{rect:s,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:s&&yt.getCenterPos(s,o)}),s));case 10:case"end":return _context27.stop();}},_callee25,this);}));function consumeServiceAsync(_x64){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,e){var M,T,n,i,a,o,s,c,p,h,v,y;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(),i=t.fontColor,a=t.fontBgColor,o=t.bold,s=t.italic,c=t.lineThrough,p=t.underline,h=t.zIndex,v=(M=this.vNodes)==null?void 0:M.get(n);if(v){_context28.next=5;break;}return _context28.abrupt("return");case 5:i&&(v.opt.fontColor=i),a&&(v.opt.fontBgColor=a),o&&(v.opt.bold=o),s&&(v.opt.italic=s),oe(c)&&(v.opt.lineThrough=c),oe(p)&&(v.opt.underline=p),kt(h)&&(v.opt.zIndex=h),this.oldRect=v.rect;_context28.next=8;return this.draw({workId:n,layer:this.fullLayer,isDrawLabel:_typeof(e)>"u"&&this.workOptions.workState===It.Done||e});case 8:y=_context28.sent;return _context28.abrupt("return",((T=this.vNodes)==null||T.setInfo(n,{rect:y,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:y&&yt.getCenterPos(y,this.fullLayer)}),y));case 10:case"end":return _context28.stop();}},_callee26,this);}));function updataOptServiceAsync(_x65,_x66){return _updataOptServiceAsync.apply(this,arguments);}return updataOptServiceAsync;}()},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"getSafetySnippetRatio",value:function getSafetySnippetRatio(t){var e=(t==null?void 0:t.parent).displayRatio||1,n=Math.ceil(t.worldScaling[0]*10)/10;var i=n;return n>=0.2&&n<1?i=n*e:n<=2&&n>=1?i=n*e*1.6:n>2&&n<=3?i=n*e*1.4:n>3&&n<=4?i=n*e*0.8:n>4&&(i=n*e*0.6),Math.floor(i*1e3)/1e3;}},{key:"getSafetySnippetFontLength",value:function getSafetySnippetFontLength(t){return Math.floor(ie.textImageSnippetSize*3/4/t)||1;}},{key:"createLabels",value:function(){var _createLabels=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee27(t,e,n){var L,i,a,o,_ref164,s,c,p,h,v,y,M,T,m,x,l,d,f,g,O,A,R,b,P,D,I,C,B,G,H,X,Z,W,z,Q,_,st,q,ht,dt,F,U,V,J,et,_q2,_ht,_dt,_q3,_ht2,_4,_st2;return _regeneratorRuntime().wrap(function _callee27$(_context29){while(1)switch(_context29.prev=_context29.next){case 0:i=[],a=n.x,o=n.y,_ref164=(L=e.parent)==null?void 0:L.parent,s=_ref164.width,c=_ref164.height,p=Me(t.text),h=p.length,v=t.fontSize,y=t.lineHeight,M=t.bold,T=t.textAlign,m=t.italic,x=t.fontFamily,l=t.verticalAlign,d=t.fontColor,f=t.fontBgColor,g=t.underline,O=t.lineThrough,A=ie.getSafetySnippetRatio(e)||1,R=Math.floor(v*A),b=ie.getSafetySnippetFontLength(R);P=0;D=0;case 3:if(!(D<h)){_context29.next=33;break;}I=p[D],C=y||R*1.5;if(!I){_context29.next=30;break;}B=z0(I),G=[0,0],H=[0,v*1.2];l==="middle"&&(G[1]=D*v*1.2+5);X=[0,-v*0.15];G[0]=5;Z=Math.sin(Math.PI/180*20);W=0;z=[];Q=0;case 14:if(!(Q<B)){_context29.next=27;break;}T==="left"&&(X[0]=W),Q===0&&m==="italic"&&(X[0]=X[0]-Z/2*v);_=I.slice(Q,Q+b);st={anchor:[0,0],pos:X,text:_,fontFamily:x,fontSize:R,lineHeight:C,strokeColor:d,fontWeight:M,fillColor:d,textAlign:T,fontStyle:m,scale:[1/A,1/A]};q=new Sd(st);_context29.next=21;return q.textImageReady;case 21:ht=_context29.sent;dt=!0;if(ht){F=ht.rect&&ht.rect[2],U=ht.rect&&ht.rect[3];if(F&&U){V=F/A,J=U/A;W=V+W,m==="italic"&&(M==="bold"?W=W-Z*v*1.2:W=W-Z*v),((X[0]+G[0]+V)*e.worldScaling[0]+a<=0||(X[0]+G[0])*e.worldScaling[0]+a>=s||(X[1]+G[1]+J)*e.worldScaling[1]+o<=0||(X[1]+G[1])*e.worldScaling[1]+o>=c)&&(q.disconnect(),dt=!1),dt&&z.push(q);}}Q+=b;case 25:_context29.next=14;break;case 27:H[0]=W,m==="italic"&&(H[0]=H[0]+Z*v),P=Math.max(P,H[0]);et=!0;if(((G[0]+H[0])*e.worldScaling[0]+a<=0||G[0]*e.worldScaling[0]+a>=s||(G[1]+H[1])*e.worldScaling[0]+o<=0||G[1]*e.worldScaling[1]+o>=c)&&(et=!1),et){if(g){_q2=Math.floor(v/10),_ht={normalize:!1,pos:[0,v*1.1+_q2/2],lineWidth:_q2,points:[0,0,Math.ceil(H[0]),0],strokeColor:d,className:"underline"},_dt=new ae(_ht);z.push(_dt);}if(O){_q3={normalize:!1,pos:[0,v*1.2/2],lineWidth:Math.floor(v/10),points:[0,0,Math.ceil(H[0]),0],strokeColor:d,className:"lineThrough"},_ht2=new ae(_q3);z.push(_ht2);}_4={pos:G,anchor:[0,0],size:H,bgcolor:f},_st2=new qt(_4);_st2.append.apply(_st2,z),i.push(_st2);}case 30:D++;_context29.next=3;break;case 33:return _context29.abrupt("return",{labels:i,maxWidth:P});case 34:case"end":return _context29.stop();}},_callee27);}));function createLabels(_x67,_x68,_x69){return _createLabels.apply(this,arguments);}return createLabels;}()},{key:"updateNodeOpt",value:function updateNodeOpt(t){var e=t.node,n=t.opt,i=t.vNodes,a=t.targetNode,o=n.fontBgColor,s=n.fontColor,c=n.translate,p=n.originPoint,h=n.scenePoint,v=n.scale,y=n.bold,M=n.italic,T=n.lineThrough,m=n.underline,x=n.fontSize,l=n.textInfos,d=n.zIndex,f=a&&Xt(a)||i.get(e.name);if(!f||!e.parent)return;var O=f.opt;if(kt(d)&&(e.setAttribute("zIndex",d),f.opt.zIndex=d),s&&O.fontColor&&(O.fontColor=s,e.children.forEach(function(A){A.tagName==="GROUP"&&A.children.forEach(function(R){R.tagName==="LABEL"?(R.setAttribute("fillColor",s),R.setAttribute("strokeColor",s)):R.tagName==="POLYLINE"&&R.setAttribute("strokeColor",s);});})),o&&O.fontBgColor&&(O.fontBgColor=o,e.children.forEach(function(A){A.tagName==="GROUP"&&A.setAttribute("bgcolor",o);})),y&&(O.bold=y),M&&(O.italic=M),oe(T)&&(O.lineThrough=T),oe(m)&&(O.underline=m),x&&(O.fontSize=x),p&&h&&v&&a&&O.boxPoint){var A=l==null?void 0:l.get(e.name);if(A){var L=A.fontSize,D=A.boxSize;O.boxSize=D||O.boxSize,O.fontSize=L||O.fontSize;}var R=[O.boxPoint[0],O.boxPoint[1]];Dr(O.boxPoint,h,v,c);var b=[f.op[0],f.op[1]],P=[b[0]-R[0],b[1]-R[1]];f.centerPos=[f.centerPos[0]+P[0],f.centerPos[1]+P[1]];}else c&&O.boxPoint&&(O.boxPoint=[O.boxPoint[0]+c[0],O.boxPoint[1]+c[1]],f.centerPos=[f.centerPos[0]+c[0],f.centerPos[1]+c[1]]);return f&&i.setInfo(e.name,f),f==null?void 0:f.rect;}},{key:"getRectFromLayer",value:function getRectFromLayer(t,e){var n=t.getElementsByName(e)[0];if(n){var i=n.getBoundingClientRect();var a={x:Math.floor(i.x),y:Math.floor(i.y),w:Math.floor(i.width+2),h:Math.floor(i.height+2)};return n.children.forEach(function(o){if(o.tagName==="GROUP"){var s=n.getBoundingClientRect();a=Ot(a,{x:Math.floor(s.x),y:Math.floor(s.y),w:Math.floor(s.width+2),h:Math.floor(s.height+2)});}}),a;}}}]);}(yt);// 4k
|
|
437
|
-
rt(ie,"textImageSnippetSize",1024*4),rt(ie,"SafeBorderPadding",30);var Ve=ie;function pi(u){switch(u){case gt.Arrow:return li;case gt.Pencil:return ii;case gt.Straight:return gi;case gt.Ellipse:return ci;case gt.Polygon:case gt.Triangle:return hi;case gt.Star:case gt.Rhombus:return ui;case gt.Rectangle:return fi;case gt.SpeechBalloon:return di;case gt.Text:return Ve;case gt.LaserPen:return si;case gt.Eraser:return se;case gt.Selector:return Ke;case gt.Image:return we;}}function br(u,r){var t=u.toolsType,e=_objectWithoutProperties(u,_excluded);switch(t){case gt.Arrow:return new li(e);case gt.Pencil:return new ii(e);case gt.Straight:return new gi(e);case gt.Ellipse:return new ci(e);case gt.Polygon:case gt.Triangle:return new hi(e);case gt.Star:case gt.Rhombus:return new ui(e);case gt.Rectangle:return new fi(e);case gt.SpeechBalloon:return new di(e);case gt.Text:return new Ve(e);case gt.LaserPen:return new si(e);case gt.Eraser:return new se(e,r);case gt.Selector:return e.vNodes?new Ke(_objectSpread(_objectSpread({},e),{},{vNodes:e.vNodes,drawLayer:e.fullLayer})):void 0;case gt.Image:return new we(e);default:return;}}function vi(u){var r=[],t=["PATH","SPRITE","POLYLINE","RECT","ELLIPSE","LABEL"];var _iterator26=_createForOfIteratorHelper(u),_step26;try{for(_iterator26.s();!(_step26=_iterator26.n()).done;){var _e5=_step26.value;if(_e5.tagName==="GROUP"&&_e5.children.length)return vi(_e5.children);_e5.tagName&&t.includes(_e5.tagName)&&r.push(_e5);}}catch(err){_iterator26.e(err);}finally{_iterator26.f();}return r;}function Ot(u,r){if(u&&r){var t=Math.min(u.x,r.x),_e6=Math.min(u.y,r.y),n=Math.max(u.x+u.w,r.x+r.w),i=Math.max(u.y+u.h,r.y+r.h),a=n-t,o=i-_e6;return{x:t,y:_e6,w:a,h:o};}return r||u;}function Ut(u){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var t={x:0,y:0,w:0,h:0};var e=1/0,n=1/0,i=-1/0,a=-1/0;return u.forEach(function(o){var _o$XY=_slicedToArray(o.XY,2),s=_o$XY[0],c=_o$XY[1];e=Math.min(e,s-r),n=Math.min(n,c-r),i=Math.max(i,s+r),a=Math.max(a,c+r);}),t.x=e,t.y=n,t.w=i-e,t.h=a-n,t;}function De(u,r){return!(u.x+u.w<r.x||u.x>r.x+r.w||u.y+u.h<r.y||u.y>r.y+r.h);}function wt(u){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:10;return{x:Math.floor(u.x-r),y:Math.floor(u.y-r),w:Math.ceil(u.w+r*2),h:Math.ceil(u.h+r*2)};}function N0(u,r){return{x:u.x+r[0],y:u.y+r[1],w:u.w,h:u.h};}function W0(u,r){var t=new tt(u.x,u.y),e=new tt(u.x+u.w,u.y),n=new tt(u.x+u.w,u.y+u.h),i=new tt(u.x,u.y+u.h),a=new tt(u.x+u.w/2,u.y+u.h/2),o=Math.PI*r/180,s=tt.RotWith(t,a,o),c=tt.RotWith(e,a,o),p=tt.RotWith(n,a,o),h=tt.RotWith(i,a,o);return[s,c,p,h];}function mi(u,r){var t=W0(u,r);return Ut(t);}function B0(u,r,t){var e=new tt(r[0],r[1]);for(var n=0;n<u.length;n+=3){var i=new tt(u[n],u[n+1]),a=Math.PI*t/180,o=tt.RotWith(i,e,a);u[n]=o.x,u[n+1]=o.y;}}function Dr(u,r,t){var e=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[0,0];var n=new tt(r[0],r[1]);for(var i=0;i<u.length;i+=3){var a=new tt(u[i],u[i+1]),o=new tt(t[0],t[1]),s=tt.ScaleWOrigin(a,o,n);u[i]=s.x+e[0],u[i+1]=s.y+e[1];}}function F0(u,r){return u[0]>=r.x&&u[0]<=r.x+r.w&&u[1]>=r.y&&u[1]<=r.y+r.h;}function yi(u,r){var t=u<=r?1:u/r,e=r<=u?1:r/u;return[t,e];}function U0(u){var _iterator27=_createForOfIteratorHelper(u),_step27;try{for(_iterator27.s();!(_step27=_iterator27.n()).done;){var r=_step27.value;if(isNaN(r)||r===1/0||r===-1/0)return!1;}}catch(err){_iterator27.e(err);}finally{_iterator27.f();}return!0;}var j0=function j0(u){if(u.tagName==="GROUP"){var r=Object.getOwnPropertySymbols(u).find(function(t){return t.toString()==="Symbol(sealed)";});if(r&&u[r])return!0;}return!1;},$0=function $0(u){return!u.isHid;};function ve(u){return"".concat(Ye(u.x),",").concat(Ye(u.y)," ");}function me(u,r){return"".concat(Ye((u.x+r.x)/2),",").concat(Ye((u.y+r.y)/2)," ");}function Ye(u){return+u.toFixed(4);}var or=function or(u,r){return u.x+u.w<r.x||u.x>r.x+r.w||u.y+u.h<r.y||u.y>r.y+r.h?Te.outside:u.x>=r.x&&u.y>=r.y&&u.x+u.w<=r.x+r.w&&u.y+u.h<=r.y+r.h?Te.inside:Te.intersect;};function z0(u){var r=0;for(var t=0;t<u.length;t++){var _e7=u.charCodeAt(t);_e7>=1&&_e7<=126||65376<=_e7&&_e7<=65439?r++:r+=2;}return r;}var be="cursorhover",Sn=20,Xe="mainView";var G0=/*#__PURE__*/function(){function G0(r,t){_classCallCheck(this,G0);rt(this,"viewId");rt(this,"scene");rt(this,"fullLayer");rt(this,"curNodeMap",/* @__PURE__ */new Map());rt(this,"targetNodeMap",[]);rt(this,"highLevelIds");this.viewId=r,this.scene=t;}return _createClass(G0,[{key:"init",value:function init(r){this.fullLayer=r;}},{key:"get",value:function get(r){return this.curNodeMap.get(r);}},{key:"getNodesByType",value:function getNodesByType(r){var t=/* @__PURE__ */new Map();return this.curNodeMap.forEach(function(e,n){e.toolsType===r&&t.set(n,e);}),t;}},{key:"hasRenderNodes",value:function hasRenderNodes(){var r=!1;var _iterator28=_createForOfIteratorHelper(this.curNodeMap.values()),_step28;try{for(_iterator28.s();!(_step28=_iterator28.n()).done;){var t=_step28.value;$0(t)&&(r=!0);}}catch(err){_iterator28.e(err);}finally{_iterator28.f();}return r;}},{key:"has",value:function has(r){return this.curNodeMap.has(r);}},{key:"setInfo",value:function setInfo(r,t){var e=this.curNodeMap.get(r)||{name:r,rect:t.rect};t.rect&&(e.rect=Xt(t.rect)),t.op&&U0(t.op)&&(e.op=Xt(t.op)),t.canRotate&&(e.canRotate=t.canRotate),t.scaleType&&(e.scaleType=t.scaleType),t.opt&&(e.opt=Xt(t.opt)),t.toolsType&&(e.toolsType=t.toolsType),t.centerPos&&(e.centerPos=Xt(t.centerPos)),oe(t.isSelected)&&(e.isSelected=t.isSelected),e.rect?this.curNodeMap.set(r,e):this.curNodeMap["delete"](r);}},{key:"selected",value:function selected(r){this.setInfo(r,{isSelected:!0});}},{key:"unSelected",value:function unSelected(r){this.setInfo(r,{isSelected:!1});}},{key:"delete",value:function _delete(r){this.curNodeMap["delete"](r);}},{key:"clear",value:function clear(){this.curNodeMap.clear(),this.targetNodeMap.length=0;}},{key:"hasRectIntersectRange",value:function hasRectIntersectRange(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var _iterator29=_createForOfIteratorHelper(this.curNodeMap.values()),_step29;try{for(_iterator29.s();!(_step29=_iterator29.n()).done;){var _e8=_step29.value;if(De(r,_e8.rect)){if(t&&_e8.toolsType===gt.Image&&_e8.opt.locked||t&&_e8.toolsType===gt.Text&&(_e8.opt.workState===It.Doing||_e8.opt.workState===It.Start))continue;return!0;}}}catch(err){_iterator29.e(err);}finally{_iterator29.f();}return!1;}},{key:"getRectIntersectRange",value:function getRectIntersectRange(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var n;var i=/* @__PURE__ */new Map();var _iterator30=_createForOfIteratorHelper(this.curNodeMap.entries()),_step30;try{for(_iterator30.s();!(_step30=_iterator30.n()).done;){var _step30$value=_slicedToArray(_step30.value,2),a=_step30$value[0],o=_step30$value[1];if(De(r,o.rect)){if(t&&o.toolsType===gt.Image&&o.opt.locked||e&&o.toolsType===gt.Text&&(o.opt.workState===It.Doing||o.opt.workState===It.Start))continue;n=Ot(n,o.rect),i.set(a,o);}}}catch(err){_iterator30.e(err);}finally{_iterator30.f();}return{rectRange:n,nodeRange:i};}},{key:"getNodeRectFormShape",value:function getNodeRectFormShape(r,t){var e=pi(t.toolsType);return this.fullLayer&&(e==null?void 0:e.getRectFromLayer(this.fullLayer,r));}},{key:"updateNodeRect",value:function updateNodeRect(r){var t=this.curNodeMap.get(r);if(t){var _e9=this.getNodeRectFormShape(r,t);if(!_e9){this.curNodeMap["delete"](r);return;}t.rect=_e9,this.curNodeMap.set(r,t);}}},{key:"updateHighLevelNodesRect",value:function updateHighLevelNodesRect(r){this.highLevelIds=r;var _iterator31=_createForOfIteratorHelper(this.highLevelIds.keys()),_step31;try{for(_iterator31.s();!(_step31=_iterator31.n()).done;){var t=_step31.value;this.updateNodeRect(t);}}catch(err){_iterator31.e(err);}finally{_iterator31.f();}}},{key:"updateLowLevelNodesRect",value:function updateLowLevelNodesRect(){var r;var _iterator32=_createForOfIteratorHelper(this.curNodeMap.keys()),_step32;try{for(_iterator32.s();!(_step32=_iterator32.n()).done;){var t=_step32.value;(r=this.highLevelIds)!=null&&r.has(t)||this.updateNodeRect(t);}}catch(err){_iterator32.e(err);}finally{_iterator32.f();}}},{key:"clearHighLevelIds",value:function clearHighLevelIds(){this.highLevelIds=void 0;}},{key:"combineIntersectRect",value:function combineIntersectRect(r){var t=r;return this.curNodeMap.forEach(function(e){De(t,e.rect)&&(t=Ot(t,e.rect));}),t;}},{key:"setTargetAssignKeys",value:function setTargetAssignKeys(r){var t=/* @__PURE__ */new Map();var _iterator33=_createForOfIteratorHelper(r),_step33;try{for(_iterator33.s();!(_step33=_iterator33.n()).done;){var _e10=_step33.value;var n=this.curNodeMap.get(_e10);n&&t.set(_e10,Xt(n));}}catch(err){_iterator33.e(err);}finally{_iterator33.f();}return this.targetNodeMap.push(Xt(t)),this.targetNodeMap.length-1;}},{key:"setTarget",value:function setTarget(){return this.targetNodeMap.push(Xt(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(r){return this.targetNodeMap[r];}},{key:"deleteTarget",value:function deleteTarget(r){this.targetNodeMap.length=r;}},{key:"clearTarget",value:function clearTarget(){this.targetNodeMap.length=0;}}]);}();var Si=/*#__PURE__*/function(){function Si(r,t,e){_classCallCheck(this,Si);rt(this,"viewId");rt(this,"fullLayer");rt(this,"vNodes");rt(this,"dpr");rt(this,"contextType");rt(this,"opt");rt(this,"cameraOpt");rt(this,"scene");rt(this,"isSafari",!1);rt(this,"combinePostMsg",/* @__PURE__ */new Set());rt(this,"workerTaskId");rt(this,"protectedTask");rt(this,"delayPostDoneResolve");if(this.viewId=r,this.opt=t,this.dpr=t.dpr,this.contextType=this.getSupportContextType(e),!this.contextType)throw new Error("Sorry, your browser doesn't support canvas context type 2d or webgl");this.scene=this.createScene(t.offscreenCanvasOpt);var n=ne.bufferSize.full,i=ne.bufferSize.sub;this.fullLayer=this.createLayer("fullLayer",this.scene,_objectSpread(_objectSpread({},t.layerOpt),{},{bufferSize:this.viewId===Xe?n:i})),this.vNodes=new G0(r,this.scene);}return _createClass(Si,[{key:"setIsSafari",value:function setIsSafari(r){this.isSafari=r;}},{key:"on",value:function(){var _on=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee28(r){var t,e,n,i;return _regeneratorRuntime().wrap(function _callee28$(_context30){while(1)switch(_context30.prev=_context30.next){case 0:t=r.msgType,e=r.toolsType,n=r.opt;_context30.t0=t;_context30.next=_context30.t0===ft.UpdateCamera?4:_context30.t0===ft.Destroy?7:_context30.t0===ft.Clear?9:_context30.t0===ft.UpdateTools?12:14;break;case 4:_context30.next=6;return this.updateCamera(r);case 6:return _context30.abrupt("break",14);case 7:this.destroy();return _context30.abrupt("break",14);case 9:_context30.next=11;return this.clearAll();case 11:return _context30.abrupt("break",14);case 12:if(e&&n){i={toolsType:e,toolsOpt:n};this.localWork.setToolsOpt(i);}return _context30.abrupt("break",14);case 14:case"end":return _context30.stop();}},_callee28,this);}));function on(_x70){return _on.apply(this,arguments);}return on;}()},{key:"createLocalWork",value:function createLocalWork(r){var t=r.workId,e=r.opt,n=r.toolsType;t&&e&&(!this.localWork.getToolsOpt()&&n&&this.setToolsOpt({toolsType:n,toolsOpt:e}),this.setWorkOpt({workId:t,toolsOpt:e}));}},{key:"updateScene",value:function updateScene(r){this.scene.attr(_objectSpread({},r));var t=r.width,e=r.height;this.scene.container.width=t,this.scene.container.height=e,this.scene.width=t,this.scene.height=e,this.updateLayer({width:t,height:e});}},{key:"updateLayer",value:function updateLayer(r){var t=r.width,e=r.height;this.fullLayer&&(this.fullLayer.parent.setAttribute("width",t),this.fullLayer.parent.setAttribute("height",e),this.fullLayer.setAttribute("size",[t,e]),this.fullLayer.setAttribute("pos",[t*0.5,e*0.5]));}},{key:"getSupportContextType",value:function getSupportContextType(r){var t=new OffscreenCanvas(100,100),e=r===Je.Full&&this.viewId===Xe?[ye.Webgl2,ye.Webgl,ye.Canvas2d]:[ye.Canvas2d];for(var _i2=0,_e11=e;_i2<_e11.length;_i2++){var n=_e11[_i2];try{if(t.getContext(n))return n;}catch(_unused24){continue;}}}},{key:"createScene",value:function createScene(r){var t=r.width,e=r.height,n=new OffscreenCanvas(t,e);r.contextType&&delete r.contextType;var i=new Td(_objectSpread(_objectSpread({container:n,displayRatio:this.dpr,depth:!1,desynchronized:!0,failIfMajorPerformanceCaveat:!0},r),{},{contextType:this.contextType,id:this.viewId}));return i.setAttribute("id",this.viewId),i;}},{key:"createLayer",value:function createLayer(r,t,e){var n=e.width,i=e.height,a="offscreen-".concat(r),o=t.layer(a,e),s=new qt({anchor:[0.5,0.5],pos:[n*0.5,i*0.5],size:[n,i],name:"viewport",id:r});return o.append(s),s;}},{key:"clearAll",value:function(){var _clearAll=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee29(){var r;return _regeneratorRuntime().wrap(function _callee29$(_context31){while(1)switch(_context31.prev=_context31.next){case 0:this.fullLayer&&(this.fullLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),this.fullLayer.removeAllChildren()),this.localWork.destroy(),(r=this.serviceWork)==null||r.destroy();case 1:case"end":return _context31.stop();}},_callee29,this);}));function clearAll(){return _clearAll.apply(this,arguments);}return clearAll;}()},{key:"setToolsOpt",value:function setToolsOpt(r){this.localWork.setToolsOpt(r);}},{key:"setWorkOpt",value:function setWorkOpt(r){var t=r.workId,e=r.toolsOpt;t&&e&&this.localWork.setWorkOptions(t.toString(),e);}},{key:"destroy",value:function destroy(){var r;this.vNodes.clear(),this.fullLayer.remove(),this.scene.remove(),this.localWork.destroy(),(r=this.serviceWork)==null||r.destroy();}},{key:"post",value:function(){var _post=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee30(r){return _regeneratorRuntime().wrap(function _callee30$(_context32){while(1)switch(_context32.prev=_context32.next){case 0:this.combinePostMsg.add(r);_context32.next=3;return this.runBatchPostData();case 3:case"end":return _context32.stop();}},_callee30,this);}));function post(_x71){return _post.apply(this,arguments);}return post;}()},{key:"runBatchPostData",value:function(){var _runBatchPostData=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee31(){var _this85=this;return _regeneratorRuntime().wrap(function _callee31$(_context33){while(1)switch(_context33.prev=_context33.next){case 0:this.workerTaskId||(this.workerTaskId=requestAnimationFrame(this.combinePost.bind(this)));_context33.t0=this.type===Je.Full&&!this.delayPostDoneResolve;if(!_context33.t0){_context33.next=6;break;}_context33.next=5;return new Promise(function(t){_this85.delayPostDoneResolve=t;});case 5:_context33.t0=_context33.sent;case 6:_context33.t1=_context33.t0;if(!_context33.t1){_context33.next=9;break;}this.delayPostDoneResolve=void 0;case 9:case"end":return _context33.stop();}},_callee31,this);}));function runBatchPostData(){return _runBatchPostData.apply(this,arguments);}return runBatchPostData;}()},{key:"combinePostData",value:function combinePostData(){var i,a;this.workerTaskId=void 0;var r=[],t=[];var e;var n=/* @__PURE__ */new Set();var _iterator34=_createForOfIteratorHelper(this.combinePostMsg.values()),_step34;try{for(_iterator34.s();!(_step34=_iterator34.n()).done;){var o=_step34.value;if((i=o.render)!=null&&i.length){var _iterator35=_createForOfIteratorHelper(o.render),_step35;try{for(_iterator35.s();!(_step35=_iterator35.n()).done;){var s=_step35.value;var c=!1;if(s.workId&&n.add(s.workId),s.isClearAll&&(s.rect=this.getSceneRect(),s.isClear=!0,delete s.isClearAll),s.drawCanvas){var p=this.getLayer(s.drawCanvas);if(!p||!(p.parent instanceof xd))continue;if(p.parent.render(),s.isDrawAll){var h=this.getSceneRect();s.rect=h,delete s.isDrawAll;}}var _iterator36=_createForOfIteratorHelper(r),_step36;try{for(_iterator36.s();!(_step36=_iterator36.n()).done;){var _p9=_step36.value;if(s.viewId===_p9.viewId){s.isClear&&_p9.clearCanvas&&_p9.isClear&&_p9.clearCanvas===s.clearCanvas&&(_p9.rect=Ot(_p9.rect,s.rect),c=!0),_p9.drawCanvas&&_p9.drawCanvas===s.drawCanvas&&(_p9.rect=Ot(_p9.rect,s.rect),c=!0);continue;}}}catch(err){_iterator36.e(err);}finally{_iterator36.f();}c||(s.isClear&&!s.drawCanvas?r.unshift(s):r.push(s));}}catch(err){_iterator35.e(err);}finally{_iterator35.f();}}if((a=o.sp)!=null&&a.length){var _iterator37=_createForOfIteratorHelper(o.sp),_step37;try{for(_iterator37.s();!(_step37=_iterator37.n()).done;){var _s4=_step37.value;var _c5=!1;var _iterator38=_createForOfIteratorHelper(t),_step38;try{for(_iterator38.s();!(_step38=_iterator38.n()).done;){var _p10=_step38.value;if(fe(_s4,_p10)){_c5=!0;break;}}}catch(err){_iterator38.e(err);}finally{_iterator38.f();}_c5||t.push(_s4);}}catch(err){_iterator37.e(err);}finally{_iterator37.f();}}kt(o.drawCount)&&(e=o.drawCount);}}catch(err){_iterator34.e(err);}finally{_iterator34.f();}return this.combinePostMsg.clear(),{render:r,sp:t,drawCount:e,workIds:n};}},{key:"safariFixRect",value:function safariFixRect(r){if(r.w+r.x<=0||r.h+r.y<=0||r.w<=0||r.h<=0)return;var t=this.scene.width,e=this.scene.height,n={x:Math.floor(Math.max(0,r.x)),y:Math.floor(Math.max(0,r.y)),w:Math.floor(Math.min(t,r.w)),h:Math.floor(Math.min(e,r.h))};return n.x+n.w>t&&(n.w=Math.floor(t-n.x)),n.y+n.h>e&&(n.h=Math.floor(e-n.y)),n;}},{key:"getSceneRect",value:function getSceneRect(){var _this$scene=this.scene,r=_this$scene.width,t=_this$scene.height;return{x:0,y:0,w:Math.floor(r),h:Math.floor(t)};}}]);}();var xi=/*#__PURE__*/function(){function xi(r){_classCallCheck(this,xi);rt(this,"viewId");rt(this,"vNodes");rt(this,"thread");rt(this,"fullLayer");rt(this,"drawLayer");rt(this,"_post");rt(this,"tmpOpt");rt(this,"workShapes",/* @__PURE__ */new Map());rt(this,"drawCount",0);rt(this,"syncUnitTime",ne.syncOpt.interval);this.thread=r.thread,this.viewId=r.viewId,this.vNodes=r.vNodes,this.fullLayer=r.fullLayer,this.drawLayer=r.drawLayer,this._post=this.thread.post.bind(r.thread);}return _createClass(xi,[{key:"destroy",value:function destroy(){this.workShapes.clear();}},{key:"getWorkShapes",value:function getWorkShapes(){return this.workShapes;}},{key:"getWorkShape",value:function getWorkShape(r){return this.workShapes.get(r);}},{key:"createWorkShape",value:function createWorkShape(r,t){if(r&&this.tmpOpt){var _e12={toolsType:this.tmpOpt.toolsType,toolsOpt:t||this.tmpOpt.toolsOpt},n=this.createWorkShapeNode(_objectSpread(_objectSpread({},_e12),{},{workId:r}));n&&this.workShapes.set(r,n);}}},{key:"setWorkOptions",value:function setWorkOptions(r,t){var e=this.getWorkShape(r);e||this.createWorkShape(r,t),e==null||e.setWorkOptions(t);}},{key:"createWorkShapeNode",value:function createWorkShapeNode(r){var t;return br(_objectSpread(_objectSpread({},r),{},{vNodes:this.vNodes,fullLayer:this.fullLayer,drawLayer:this.drawLayer}),(t=this.thread)==null?void 0:t.serviceWork);}},{key:"setToolsOpt",value:function setToolsOpt(r){var t,e,n;((t=this.tmpOpt)==null?void 0:t.toolsType)!==r.toolsType&&(e=this.tmpOpt)!=null&&e.toolsType&&this.clearAllWorkShapesCache(),this.tmpOpt=r,(n=r.toolsOpt)!=null&&n.syncUnitTime&&(this.syncUnitTime=r.toolsOpt.syncUnitTime);}},{key:"getToolsOpt",value:function getToolsOpt(){return this.tmpOpt;}},{key:"clearWorkShapeNodeCache",value:function clearWorkShapeNodeCache(r){var t;(t=this.getWorkShape(r))==null||t.clearTmpPoints(),this.workShapes["delete"](r);}},{key:"clearAllWorkShapesCache",value:function clearAllWorkShapesCache(){this.workShapes.forEach(function(r){return r.clearTmpPoints();}),this.workShapes.clear();}},{key:"setFullWork",value:function setFullWork(r){var t=r.workId,e=r.opt,n=r.toolsType;if(t&&e&&n){var i=t.toString();var a;return t&&this.workShapes.has(i)?(a=this.workShapes.get(i),a==null||a.setWorkOptions(e)):a=this.createWorkShapeNode({toolsOpt:e,toolsType:n,workId:i}),a?(this.workShapes.set(i,a),a):void 0;}}}]);}();var H0=ee,K0=function K0(){return H0.Date.now();},V0=K0,Y0=/\s/;function X0(u){for(var r=u.length;r--&&Y0.test(u.charAt(r)););return r;}var J0=X0,Q0=J0,Z0=/^\s+/;function k0(u){return u&&u.slice(0,Q0(u)+1).replace(Z0,"");}var q0=k0,_0=de,tg=re,eg="[object Symbol]";function rg(u){return _typeof(u)=="symbol"||tg(u)&&_0(u)==eg;}var ng=rg,ig=q0,xn=le,sg=ng,Tn=NaN,og=/^[-+]0x[0-9a-f]+$/i,ag=/^0b[01]+$/i,lg=/^0o[0-7]+$/i,cg=parseInt;function fg(u){if(typeof u=="number")return u;if(sg(u))return Tn;if(xn(u)){var r=typeof u.valueOf=="function"?u.valueOf():u;u=xn(r)?r+"":r;}if(typeof u!="string")return u===0?u:+u;u=ig(u);var t=ag.test(u);return t||lg.test(u)?cg(u.slice(2),t?2:8):og.test(u)?Tn:+u;}var ug=fg,hg=le,ar=V0,Mn=ug,dg="Expected a function",gg=Math.max,pg=Math.min;function vg(u,r,t){var e,n,i,a,o,s,c=0,p=!1,h=!1,v=!0;if(typeof u!="function")throw new TypeError(dg);r=Mn(r)||0,hg(t)&&(p=!!t.leading,h="maxWait"in t,i=h?gg(Mn(t.maxWait)||0,r):i,v="trailing"in t?!!t.trailing:v);function y(O){var A=e,R=n;return e=n=void 0,c=O,a=u.apply(R,A),a;}function M(O){return c=O,o=setTimeout(x,r),p?y(O):a;}function T(O){var A=O-s,R=O-c,b=r-A;return h?pg(b,i-R):b;}function m(O){var A=O-s,R=O-c;return s===void 0||A>=r||A<0||h&&R>=i;}function x(){var O=ar();if(m(O))return l(O);o=setTimeout(x,T(O));}function l(O){return o=void 0,v&&e?y(O):(e=n=void 0,a);}function d(){o!==void 0&&clearTimeout(o),c=0,e=s=n=o=void 0;}function f(){return o===void 0?a:l(ar());}function g(){var O=ar(),A=m(O);if(e=arguments,n=this,s=O,A){if(o===void 0)return M(s);if(h)return clearTimeout(o),o=setTimeout(x,r),y(s);}return o===void 0&&(o=setTimeout(x,r)),a;}return g.cancel=d,g.flush=f,g;}var mg=vg,yg=mg,Sg=le,xg="Expected a function";function Tg(u,r,t){var e=!0,n=!0;if(typeof u!="function")throw new TypeError(xg);return Sg(t)&&(e="leading"in t?!!t.leading:e,n="trailing"in t?!!t.trailing:n),yg(u,r,{leading:e,maxWait:r,trailing:n});}var Mg=Tg,Og=/* @__PURE__ */he(Mg);function Pg(u){return u;}var Ti=Pg;function Eg(u,r,t){switch(t.length){case 0:return u.call(r);case 1:return u.call(r,t[0]);case 2:return u.call(r,t[0],t[1]);case 3:return u.call(r,t[0],t[1],t[2]);}return u.apply(r,t);}var Ag=Eg,Cg=Ag,On=Math.max;function Rg(u,r,t){return r=On(r===void 0?u.length-1:r,0),function(){for(var e=arguments,n=-1,i=On(e.length-r,0),a=Array(i);++n<i;)a[n]=e[r+n];n=-1;for(var o=Array(r+1);++n<r;)o[n]=e[n];return o[r]=t(a),Cg(u,this,o);};}var Ig=Rg;function Lg(u){return function(){return u;};}var bg=Lg,Dg=bg,Pn=Wn,wg=Ti,Ng=Pn?function(u,r){return Pn(u,"toString",{configurable:!0,enumerable:!1,value:Dg(r),writable:!0});}:wg,Wg=Ng,Bg=800,Fg=16,Ug=Date.now;function jg(u){var r=0,t=0;return function(){var e=Ug(),n=Fg-(e-t);if(t=e,n>0){if(++r>=Bg)return arguments[0];}else r=0;return u.apply(void 0,arguments);};}var $g=jg,zg=Wg,Gg=$g,Hg=Gg(zg),Kg=Hg,Vg=Ti,Yg=Ig,Xg=Kg;function Jg(u,r){return Xg(Yg(u,r,Vg),u+"");}var Qg=Jg;function Zg(u,r,t,e){for(var n=u.length,i=t+(e?1:-1);e?i--:++i<n;)if(r(u[i],i,u))return i;return-1;}var kg=Zg;function qg(u){return u!==u;}var _g=qg;function tp(u,r,t){for(var e=t-1,n=u.length;++e<n;)if(u[e]===r)return e;return-1;}var ep=tp,rp=kg,np=_g,ip=ep;function sp(u,r,t){return r===r?ip(u,r,t):rp(u,np,t);}var op=sp,ap=op;function lp(u,r){var t=u==null?0:u.length;return!!t&&ap(u,r,0)>-1;}var Mi=lp;function cp(u,r,t){for(var e=-1,n=u==null?0:u.length;++e<n;)if(t(r,u[e]))return!0;return!1;}var Oi=cp;function fp(u,r){for(var t=-1,e=u==null?0:u.length,n=Array(e);++t<e;)n[t]=r(u[t],t,u);return n;}var up=fp,hp=Rr,dp=Mi,gp=Oi,pp=up,vp=er,mp=Ir,yp=200;function Sp(u,r,t,e){var n=-1,i=dp,a=!0,o=u.length,s=[],c=r.length;if(!o)return s;t&&(r=pp(r,vp(t))),e?(i=gp,a=!1):r.length>=yp&&(i=mp,a=!1,r=new hp(r));t:for(;++n<o;){var p=u[n],h=t==null?p:t(p);if(p=e||p!==0?p:0,a&&h===h){for(var v=c;v--;)if(r[v]===h)continue t;s.push(p);}else i(r,h,e)||s.push(p);}return s;}var xp=Sp,En=Ne,Tp=jn,Mp=We,An=En?En.isConcatSpreadable:void 0;function Op(u){return Mp(u)||Tp(u)||!!(An&&u&&u[An]);}var Pp=Op,Ep=Er,Ap=Pp;function Pi(u,r,t,e,n){var i=-1,a=u.length;for(t||(t=Ap),n||(n=[]);++i<a;){var o=u[i];r>0&&t(o)?r>1?Pi(o,r-1,t,e,n):Ep(n,o):e||(n[n.length]=o);}return n;}var Cp=Pi;function Rp(){}var Ip=Rp,lr=Zn,Lp=Ip,bp=Lr,Dp=1/0,wp=lr&&1/bp(new lr([,-0]))[1]==Dp?function(u){return new lr(u);}:Lp,Np=wp,Wp=Rr,Bp=Mi,Fp=Oi,Up=Ir,jp=Np,$p=Lr,zp=200;function Gp(u,r,t){var e=-1,n=Bp,i=u.length,a=!0,o=[],s=o;if(t)a=!1,n=Fp;else if(i>=zp){var c=r?null:jp(u);if(c)return $p(c);a=!1,n=Up,s=new Wp();}else s=r?[]:o;t:for(;++e<i;){var p=u[e],h=r?r(p):p;if(p=t||p!==0?p:0,a&&h===h){for(var v=s.length;v--;)if(s[v]===h)continue t;r&&s.push(h),o.push(p);}else n(s,h,t)||(s!==o&&s.push(h),o.push(p));}return o;}var Hp=Gp,Kp=xp,Vp=Cp,Cn=Hp;function Yp(u,r,t){var e=u.length;if(e<2)return e?Cn(u[0]):[];for(var n=-1,i=Array(e);++n<e;)for(var a=u[n],o=-1;++o<e;)o!=n&&(i[n]=Kp(i[n]||a,u[o],r,t));return Cn(Vp(i,1),r,t);}var Xp=Yp,Jp=Tr,Qp=re;function Zp(u){return Qp(u)&&Jp(u);}var kp=Zp,qp=Kn,_p=Qg,tv=Xp,ev=kp,rv=_p(function(u){return tv(qp(u,ev));}),nv=rv,iv=/* @__PURE__ */he(nv);var sv=/*#__PURE__*/function(_xi){function sv(t){var _this86;_classCallCheck(this,sv);_this86=_callSuper(this,sv,[t]);rt(_this86,"combineUnitTime",ne.syncOpt.interval);rt(_this86,"combineTimerId");rt(_this86,"combineDrawResolve");rt(_this86,"combineDrawActiveId");rt(_this86,"drawWorkActiveId");rt(_this86,"effectSelectNodeData",/* @__PURE__ */new Set());rt(_this86,"batchEraserWorks",/* @__PURE__ */new Set());rt(_this86,"batchEraserRemoveNodes",/* @__PURE__ */new Set());rt(_this86,"batchEraserCombine",Og(function(){var t=_this86.updateBatchEraserCombineNode(_this86.batchEraserWorks,_this86.batchEraserRemoveNodes);_this86.batchEraserWorks.clear(),_this86.batchEraserRemoveNodes.clear(),t.length&&_this86._post({render:t});},100,{leading:!1}));return _this86;}_inherits(sv,_xi);return _createClass(sv,[{key:"consumeDraw",value:function(){var _consumeDraw=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee32(t,e){var _this87=this;var n,i,a,o,s,c,p,h;return _regeneratorRuntime().wrap(function _callee32$(_context34){while(1)switch(_context34.prev=_context34.next){case 0:n=t.op,i=t.workId,a=t.scenePath;if(!(n!=null&&n.length&&i)){_context34.next=47;break;}o=i.toString(),s=this.getWorkShape(o);if(s){_context34.next=5;break;}return _context34.abrupt("return");case 5:c=s.toolsType;if(!(c===gt.LaserPen)){_context34.next=8;break;}return _context34.abrupt("return");case 8:_context34.t0=this.combineDrawActiveId&&this.combineDrawActiveId!==o;if(!_context34.t0){_context34.next=13;break;}this.combineTimerId&&(clearTimeout(this.combineTimerId),this.combineTimerId=void 0,this.combineDrawResolve&&this.combineDrawResolve(!1),this.combineDrawActiveId=void 0);_context34.next=13;return this.consumeDrawAll({workId:this.combineDrawActiveId,scenePath:a,viewId:this.viewId,msgType:ft.DrawWork,dataType:Tt.Local},e);case 13:_context34.t1=this.drawWorkActiveId&&this.drawWorkActiveId!==o;if(!_context34.t1){_context34.next=18;break;}_context34.next=17;return this.consumeDrawAll({workId:this.drawWorkActiveId,scenePath:a,viewId:this.viewId,msgType:ft.DrawWork,dataType:Tt.Local},e);case 17:this.drawWorkActiveId=void 0;case 18:!this.drawWorkActiveId&&o!==Nt&&(this.drawWorkActiveId=o);p=s.consume({data:t,isFullWork:!0});_context34.t2=c;_context34.next=_context34.t2===gt.Selector?23:_context34.t2===gt.Eraser?29:_context34.t2===gt.Arrow?34:_context34.t2===gt.Straight?34:_context34.t2===gt.Ellipse?34:_context34.t2===gt.Rectangle?34:_context34.t2===gt.Star?34:_context34.t2===gt.Polygon?34:_context34.t2===gt.SpeechBalloon?34:_context34.t2===gt.Pencil?40:47;break;case 23:_context34.t3=p.type===ft.Select;if(!_context34.t3){_context34.next=28;break;}p.selectIds&&e.runReverseSelectWork(p.selectIds);_context34.next=28;return this.drawSelector(p);case 28:return _context34.abrupt("break",47);case 29:_context34.t4=p!=null&&p.rect;if(!_context34.t4){_context34.next=33;break;}_context34.next=33;return this.drawEraser(p);case 33:return _context34.abrupt("break",47);case 34:_context34.t5=p;if(!_context34.t5){_context34.next=39;break;}this.drawCount++;_context34.next=39;return this.drawPencil(p);case 39:return _context34.abrupt("break",47);case 40:if(!this.combineTimerId){h=Math.floor(this.syncUnitTime||this.combineUnitTime);new Promise(function(v){_this87.combineDrawActiveId=o,_this87.combineDrawResolve=v,_this87.combineTimerId=setTimeout(function(){_this87.combineTimerId=void 0,_this87.combineDrawResolve&&_this87.combineDrawResolve(!0);},h);}).then(function(v){v&&_this87.drawPencilCombine(o),_this87.combineDrawResolve=void 0;});}_context34.t6=p;if(!_context34.t6){_context34.next=46;break;}this.drawCount++;_context34.next=46;return this.drawPencil(p);case 46:return _context34.abrupt("break",47);case 47:case"end":return _context34.stop();}},_callee32,this);}));function consumeDraw(_x72,_x73){return _consumeDraw.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee33(t,e){var o,s,c,n,i,a,p,h,v,y,M,T;return _regeneratorRuntime().wrap(function _callee33$(_context35){while(1)switch(_context35.prev=_context35.next){case 0:this.combineTimerId&&(clearTimeout(this.combineTimerId),this.combineTimerId=void 0,this.combineDrawResolve&&this.combineDrawResolve(!1),this.combineDrawActiveId=void 0);n=t.workId,i=t.scenePath,a=t.isLockSentEventCursor;if(!n){_context35.next=35;break;}p=n.toString();this.drawWorkActiveId===p&&(this.drawWorkActiveId=void 0);h=this.workShapes.get(p);if(h){_context35.next=8;break;}return _context35.abrupt("return");case 8:v=h.toolsType;if(!(v===gt.LaserPen)){_context35.next=11;break;}return _context35.abrupt("return");case 11:y=this.workShapes.get(be),M=(o=y==null?void 0:y.selectIds)==null?void 0:o[0],T=h.consumeAll({data:t});_context35.t0=v;_context35.next=_context35.t0===gt.Selector?15:_context35.t0===gt.Eraser?21:_context35.t0===gt.Arrow?23:_context35.t0===gt.Straight?23:_context35.t0===gt.Ellipse?23:_context35.t0===gt.Rectangle?23:_context35.t0===gt.Star?23:_context35.t0===gt.Polygon?23:_context35.t0===gt.SpeechBalloon?23:_context35.t0===gt.Pencil?28:35;break;case 15:T.selectIds&&M&&(s=T.selectIds)!=null&&s.includes(M)&&y.cursorBlur();T.selectIds&&e.runReverseSelectWork(T.selectIds);_context35.next=19;return this.drawSelector(_objectSpread(_objectSpread({},T),{},{scenePath:i}));case 19:(c=h.selectIds)!=null&&c.length?h.clearTmpPoints():this.clearWorkShapeNodeCache(p);return _context35.abrupt("break",35);case 21:T!=null&&T.rect&&this.drawEraser(_objectSpread(_objectSpread({},T),{},{scenePath:i})),h.clearTmpPoints();return _context35.abrupt("break",35);case 23:_context35.next=25;return this.drawPencilFull(_objectSpread(_objectSpread({},T),{},{scenePath:i,isLockSentEventCursor:a}));case 25:this.drawCount=0;this.clearWorkShapeNodeCache(p);return _context35.abrupt("break",35);case 28:_context35.t1=T!=null&&T.rect;if(!_context35.t1){_context35.next=33;break;}_context35.next=32;return this.drawPencilFull(_objectSpread(_objectSpread({},T),{},{scenePath:i,isLockSentEventCursor:a}));case 32:this.drawCount=0;case 33:this.clearWorkShapeNodeCache(p);return _context35.abrupt("break",35);case 35:case"end":return _context35.stop();}},_callee33,this);}));function consumeDrawAll(_x74,_x75){return _consumeDrawAll.apply(this,arguments);}return consumeDrawAll;}()},{key:"workShapesDone",value:function(){var _workShapesDone=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee34(t,e){var _iterator39,_step39,n;return _regeneratorRuntime().wrap(function _callee34$(_context36){while(1)switch(_context36.prev=_context36.next){case 0:_iterator39=_createForOfIteratorHelper(this.workShapes.keys());_context36.prev=1;_iterator39.s();case 3:if((_step39=_iterator39.n()).done){_context36.next=9;break;}n=_step39.value;_context36.next=7;return this.consumeDrawAll({workId:n,scenePath:t,viewId:this.viewId,msgType:ft.DrawWork,dataType:Tt.Local},e);case 7:_context36.next=3;break;case 9:_context36.next=14;break;case 11:_context36.prev=11;_context36.t0=_context36["catch"](1);_iterator39.e(_context36.t0);case 14:_context36.prev=14;_iterator39.f();return _context36.finish(14);case 17:case"end":return _context36.stop();}},_callee34,this,[[1,11,14,17]]);}));function workShapesDone(_x76,_x77){return _workShapesDone.apply(this,arguments);}return workShapesDone;}()},{key:"consumeFull",value:function(){var _consumeFull=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee35(t,e){var a,o,n,i,s,c,p,h,v,y,M;return _regeneratorRuntime().wrap(function _callee35$(_context37){while(1)switch(_context37.prev=_context37.next){case 0:n=this.setFullWork(t),i=t.ops&&Me(t.ops)||t.op;if(!n){_context37.next=26;break;}s=(a=t.workId)==null?void 0:a.toString();if(s){_context37.next=5;break;}return _context37.abrupt("return");case 5:c=(o=this.vNodes.get(s))==null?void 0:o.rect;if(!(n.toolsType===gt.Image&&e)){_context37.next=13;break;}_context37.next=9;return n.consumeServiceAsync({scene:e,isFullWork:!0,replaceId:s});case 9:p=_context37.sent;h=(t==null?void 0:t.updateNodeOpt)&&n.updataOptService(t.updateNodeOpt);_context37.next=20;break;case 13:if(!(n.toolsType===gt.Text)){_context37.next=19;break;}_context37.next=16;return n.consumeServiceAsync({isFullWork:!0,replaceId:s});case 16:p=_context37.sent;_context37.next=20;break;case 19:p=n.consumeService({op:i,isFullWork:!0,replaceId:s}),h=(t==null?void 0:t.updateNodeOpt)&&n.updataOptService(t.updateNodeOpt);case 20:p=Ot(p,h);v=[],y=[];if(!(t.workId&&this.workShapes["delete"](t.workId.toString()),p&&t.willRefresh&&(c&&v.push({rect:wt(c),isClear:!0,clearCanvas:xt.Bg,viewId:this.viewId}),v.push({rect:wt(p),drawCanvas:xt.Bg,viewId:this.viewId})),t.willSyncService&&y.push({opt:t.opt,toolsType:t.toolsType,type:ft.FullWork,workId:t.workId,ops:t.ops,updateNodeOpt:t.updateNodeOpt,viewId:this.viewId}),v.length||y.length)){_context37.next=26;break;}M={render:v,sp:y};_context37.next=26;return this._post(M);case 26:case"end":return _context37.stop();}},_callee35,this);}));function consumeFull(_x78,_x79){return _consumeFull.apply(this,arguments);}return consumeFull;}()},{key:"commandDeleteText",value:function commandDeleteText(t){var e=this.vNodes.get(t);if(e&&e.toolsType===gt.Text)return{type:ft.TextUpdate,toolsType:gt.Text,workId:t,dataType:Tt.Local};}},{key:"removeSelector",value:function(){var _removeSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee36(t){var e,n,i,a,o,s,_iterator40,_step40,c,v,h;return _regeneratorRuntime().wrap(function _callee36$(_context38){while(1)switch(_context38.prev=_context38.next){case 0:e=t.willSyncService,n=[],i=[],a=[],o=this.workShapes.get(Nt);if(o){_context38.next=3;break;}return _context38.abrupt("return");case 3:s=o.selectIds&&_toConsumableArray(o.selectIds)||[];_iterator40=_createForOfIteratorHelper(s);try{for(_iterator40.s();!(_step40=_iterator40.n()).done;){c=_step40.value;if(this.vNodes.get(c)){v=this.commandDeleteText(c);v&&n.push(v);}h=this._removeWork(c);h.length&&i.push.apply(i,_toConsumableArray(h)),a.push(c);}}catch(err){_iterator40.e(err);}finally{_iterator40.f();}a.length&&n.push({type:ft.RemoveNode,removeIds:a});n.push({type:ft.Select,selectIds:[],willSyncService:e});_context38.next=10;return this.blurSelector();case 10:_context38.t0=i.length||n.length;if(!_context38.t0){_context38.next=14;break;}_context38.next=14;return this._post({render:i,sp:n});case 14:case"end":return _context38.stop();}},_callee36,this);}));function removeSelector(_x80){return _removeSelector.apply(this,arguments);}return removeSelector;}()},{key:"removeWork",value:function(){var _removeWork2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee37(t){var e,n,i;return _regeneratorRuntime().wrap(function _callee37$(_context39){while(1)switch(_context39.prev=_context39.next){case 0:e=t.workId,n=e==null?void 0:e.toString();if(!n){_context39.next=7;break;}i=this._removeWork(n);_context39.t0=i.length;if(!_context39.t0){_context39.next=7;break;}_context39.next=7;return this._post({render:i});case 7:case"end":return _context39.stop();}},_callee37,this);}));function removeWork(_x81){return _removeWork2.apply(this,arguments);}return removeWork;}()},{key:"removeNode",value:function removeNode(t){var i,a,o;var e=this.vNodes.get(t);e&&((i=this.fullLayer)==null||i.getElementsByName(t).forEach(function(s){s.remove();}),this.vNodes["delete"](t));var n=this.drawLayer&&yt.getRectFromLayer(this.drawLayer,t);if(n){var s=(a=this.drawLayer)==null?void 0:a.getElementsByName(t)[0];(o=this.drawLayer)==null||o.removeChild(s);}return this.getWorkShape(t)&&this.clearWorkShapeNodeCache(t),{fullRect:e==null?void 0:e.rect,drawRect:n};}},{key:"_removeWork",value:function _removeWork(t){var _this$removeNode=this.removeNode(t),e=_this$removeNode.fullRect,n=_this$removeNode.drawRect,i=[];return e&&i.push({rect:wt(e),clearCanvas:xt.Bg,isClear:!0,viewId:this.viewId},{rect:wt(e),drawCanvas:xt.Bg,viewId:this.viewId}),n&&i.push({rect:wt(n),clearCanvas:xt.Float,isClear:!0,viewId:this.viewId},{rect:wt(n),drawCanvas:xt.Float,viewId:this.viewId}),i;}},{key:"checkTextActive",value:function(){var _checkTextActive=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee38(t){var e,n,i,a,o,s,c,_iterator41,_step41,p,h,v,y,M;return _regeneratorRuntime().wrap(function _callee38$(_context40){while(1)switch(_context40.prev=_context40.next){case 0:e=t.op,n=t.viewId,i=t.dataType;if(!(e!=null&&e.length)){_context40.next=32;break;}s=e[0]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],c=e[1]*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1];_iterator41=_createForOfIteratorHelper(this.vNodes.curNodeMap.values());_context40.prev=4;_iterator41.s();case 6:if((_step41=_iterator41.n()).done){_context40.next=14;break;}p=_step41.value;h=p.rect,v=p.name,y=p.toolsType,M=p.opt;if(!(y===gt.Text&&M.workState===It.Done&&F0([s,c],h))){_context40.next=12;break;}a=v,o=this.setFullWork({workId:v,toolsType:y,opt:M});return _context40.abrupt("break",14);case 12:_context40.next=6;break;case 14:_context40.next=19;break;case 16:_context40.prev=16;_context40.t0=_context40["catch"](4);_iterator41.e(_context40.t0);case 19:_context40.prev=19;_iterator41.f();return _context40.finish(19);case 22:_context40.t1=a;if(!_context40.t1){_context40.next=32;break;}_context40.t2=o;if(!_context40.t2){_context40.next=28;break;}_context40.next=28;return o.consumeServiceAsync({isFullWork:!0,replaceId:o.getWorkId(),isDrawLabel:!1});case 28:_context40.next=30;return this.blurSelector({viewId:n,msgType:ft.Select,dataType:i,isSync:!0});case 30:_context40.next=32;return this._post({sp:[{type:ft.GetTextActive,toolsType:gt.Text,workId:a}]});case 32:case"end":return _context40.stop();}},_callee38,this,[[4,16,19,22]]);}));function checkTextActive(_x82){return _checkTextActive.apply(this,arguments);}return checkTextActive;}()},{key:"colloctEffectSelectWork",value:function(){var _colloctEffectSelectWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee39(t){var _this88=this;var e,n,i;return _regeneratorRuntime().wrap(function _callee39$(_context41){while(1)switch(_context41.prev=_context41.next){case 0:e=this.workShapes.get(Nt),n=t.workId,i=t.msgType;if(!(e&&n&&e.selectIds&&e.selectIds.includes(n.toString()))){_context41.next=6;break;}i===ft.RemoveNode?e.selectIds=e.selectIds.filter(function(a){return a!==n.toString();}):this.effectSelectNodeData.add(t);_context41.next=5;return this.runEffectSelectWork(!0).then(function(){var a;(a=_this88.effectSelectNodeData)==null||a.clear();});case 5:return _context41.abrupt("return");case 6:return _context41.abrupt("return",t);case 7:case"end":return _context41.stop();}},_callee39,this);}));function colloctEffectSelectWork(_x83){return _colloctEffectSelectWork.apply(this,arguments);}return colloctEffectSelectWork;}()},{key:"updateSelector",value:function(){var _updateSelector2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee40(t){var _this89=this;var T,e,n,i,a,o,s,c,p,h,v,y,M;return _regeneratorRuntime().wrap(function _callee40$(_context42){while(1)switch(_context42.prev=_context42.next){case 0:e=this.workShapes.get(Nt);if((T=e==null?void 0:e.selectIds)!=null&&T.length){_context42.next=3;break;}return _context42.abrupt("return");case 3:n=t.callback;i=_objectWithoutProperties(t,_excluded2);a=i.updateSelectorOpt;o=i.willSerializeData;s=i.scene;_context42.next=10;return e==null?void 0:e.updateSelector({updateSelectorOpt:a,selectIds:Xt(e.selectIds),vNodes:this.vNodes,willSerializeData:o,worker:this,scene:s});case 10:c=_context42.sent;p=/* @__PURE__ */new Map();c!=null&&c.selectIds&&(h=iv(e.selectIds,c.selectIds),c.selectIds.forEach(function(m){var x=_this89.vNodes.get(m);if(x){var _l32=x.toolsType,d=x.op,f=x.opt;p.set(m,{opt:f,toolsType:_l32,ops:(d==null?void 0:d.length)&&_t(d)||void 0});}}),e.selectIds=c.selectIds);v=[],y=[];c!=null&&c.rect&&v.push({rect:wt(c.rect),clearCanvas:xt.Bg,isClear:!0,viewId:this.viewId},{rect:wt(c.rect),drawCanvas:xt.Bg,viewId:this.viewId});M=n&&n({res:c,workShapeNode:e,param:i,postData:{render:v,sp:y},newServiceStore:p})||{render:v,sp:y};h&&M.sp.push({type:ft.RemoveNode,removeIds:h,viewId:this.viewId});_context42.t0=M.render.length||M.sp.length;if(!_context42.t0){_context42.next=21;break;}_context42.next=21;return this._post(M);case 21:case"end":return _context42.stop();}},_callee40,this);}));function updateSelector(_x84){return _updateSelector2.apply(this,arguments);}return updateSelector;}()},{key:"blurSelector",value:function(){var _blurSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee41(t){var i,e,n,a;return _regeneratorRuntime().wrap(function _callee41$(_context43){while(1)switch(_context43.prev=_context43.next){case 0:e=this.workShapes.get(Nt),n=e==null?void 0:e.blurSelector();if(!(this.clearWorkShapeNodeCache(Nt),((i=this.fullLayer)==null?void 0:i.parent).children.forEach(function(a){a.name===Nt&&a.remove();}),n)){_context43.next=6;break;}a=[];a.push(_objectSpread(_objectSpread({},n),{},{isSync:t==null?void 0:t.isSync}));_context43.next=6;return this._post({render:(n==null?void 0:n.rect)&&[{rect:wt(n.rect),clearCanvas:xt.Bg,isClear:!0,viewId:this.viewId},{rect:wt(n.rect),drawCanvas:xt.Bg,viewId:this.viewId}],sp:a});case 6:case"end":return _context43.stop();}},_callee41,this);}));function blurSelector(_x85){return _blurSelector.apply(this,arguments);}return blurSelector;}()},{key:"hasSelector",value:function hasSelector(){return this.workShapes.has(Nt);}},{key:"getSelector",value:function getSelector(){return this.workShapes.get(Nt);}},{key:"reRenderSelector",value:function(){var _reRenderSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee42(){var t,a,e,n,i,o,_args44=arguments;return _regeneratorRuntime().wrap(function _callee42$(_context44){while(1)switch(_context44.prev=_context44.next){case 0:t=_args44.length>0&&_args44[0]!==undefined?_args44[0]:!1;e=this.workShapes.get(Nt);if(e){_context44.next=4;break;}return _context44.abrupt("return");case 4:if(!(e&&!((a=e.selectIds)!=null&&a.length))){_context44.next=8;break;}_context44.next=7;return this.blurSelector();case 7:return _context44.abrupt("return");case 8:n=e.oldSelectRect,i=e.reRenderSelector();if(!i){_context44.next=13;break;}o=Ot(n,i)||i;_context44.next=13;return this._post({render:[{rect:wt(o),clearCanvas:xt.Bg,isClear:!0,viewId:this.viewId},{rect:wt(o),drawCanvas:xt.Bg,viewId:this.viewId}],sp:[{type:ft.Select,selectIds:e.selectIds,selectRect:i,willSyncService:t,viewId:this.viewId,points:e.getChildrenPoints(),textOpt:e.textOpt,selectorColor:e.selectorColor,strokeColor:e.strokeColor,fillColor:e.fillColor,canTextEdit:e.canTextEdit,canRotate:e.canRotate,scaleType:e.scaleType,opt:e.getWorkOptions()||void 0,canLock:e.canLock,isLocked:e.isLocked,toolsTypes:e.toolsTypes,shapeOpt:e.shapeOpt,thickness:e.thickness,useStroke:e.useStroke,strokeType:e.strokeType}]});case 13:case"end":return _context44.stop();}},_callee42,this);}));function reRenderSelector(){return _reRenderSelector.apply(this,arguments);}return reRenderSelector;}()},{key:"updateFullSelectWork",value:function(){var _updateFullSelectWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee43(t){var i,a,o,s,c,p,h,e,n,_e$updateSelectIds,v,y,M;return _regeneratorRuntime().wrap(function _callee43$(_context45){while(1)switch(_context45.prev=_context45.next){case 0:e=this.workShapes.get(Nt),n=t.selectIds;if(n!=null&&n.length){_context45.next=5;break;}_context45.next=4;return this.blurSelector(t);case 4:return _context45.abrupt("return");case 5:if(e){_context45.next=10;break;}!this.setFullWork(t)&&t.workId&&((i=this.tmpOpt)==null?void 0:i.toolsType)===gt.Selector&&this.createWorkShape(t.workId.toString());_context45.next=9;return this.updateFullSelectWork(t);case 9:return _context45.abrupt("return");case 10:if(!(e&&n!=null&&n.length)){_context45.next=16;break;}_e$updateSelectIds=e.updateSelectIds(n),v=_e$updateSelectIds.bgRect,y=_e$updateSelectIds.selectRect,M={render:[],sp:[]};v&&((a=M.render)==null||a.push({rect:wt(v),clearCanvas:xt.Bg,isClear:!0,viewId:this.viewId},{rect:wt(v),drawCanvas:xt.Bg,viewId:this.viewId}));(h=M.sp)==null||h.push(_objectSpread(_objectSpread({},t),{},{selectorColor:((o=t.opt)==null?void 0:o.strokeColor)||e.selectorColor,strokeColor:((s=t.opt)==null?void 0:s.strokeColor)||e.strokeColor,fillColor:((c=t.opt)==null?void 0:c.fillColor)||e.fillColor,textOpt:((p=t.opt)==null?void 0:p.textOpt)||e.textOpt,canTextEdit:e.canTextEdit,canRotate:e.canRotate,scaleType:e.scaleType,type:ft.Select,selectRect:y,points:e.getChildrenPoints(),willSyncService:(t==null?void 0:t.willSyncService)||!1,opt:(t==null?void 0:t.willSyncService)&&e.getWorkOptions()||void 0,canLock:e.canLock,isLocked:e.isLocked,toolsTypes:e.toolsTypes,shapeOpt:e.shapeOpt,thickness:e.thickness,useStroke:e.useStroke,strokeType:e.strokeType}));_context45.next=16;return this._post(M);case 16:case"end":return _context45.stop();}},_callee43,this);}));function updateFullSelectWork(_x86){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)),_get(_getPrototypeOf(sv.prototype),"destroy",this).call(this),this.effectSelectNodeData.clear(),this.batchEraserWorks.clear(),this.batchEraserRemoveNodes.clear();}},{key:"drawPencilCombine",value:function(){var _drawPencilCombine=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee44(t){var n,i,a,e,o,s;return _regeneratorRuntime().wrap(function _callee44$(_context46){while(1)switch(_context46.prev=_context46.next){case 0:e=(n=this.workShapes.get(t))==null?void 0:n.combineConsume();if(!e){_context46.next=6;break;}o={render:[],drawCount:this.drawCount};if(e!=null&&e.rect){s=wt(e.rect);(i=o.render)==null||i.push({rect:s,isClear:!0,clearCanvas:xt.Float,viewId:this.viewId}),(a=o.render)==null||a.push({rect:s,drawCanvas:xt.Float,viewId:this.viewId});}_context46.next=6;return this._post(o);case 6:case"end":return _context46.stop();}},_callee44,this);}));function drawPencilCombine(_x87){return _drawPencilCombine.apply(this,arguments);}return drawPencilCombine;}()},{key:"drawSelector",value:function(){var _drawSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee45(t){var n,e;return _regeneratorRuntime().wrap(function _callee45$(_context47){while(1)switch(_context47.prev=_context47.next){case 0:e={render:[],sp:[t]};t.rect&&((n=e.render)==null||n.push({rect:wt(t.rect),clearCanvas:xt.Bg,isClear:!0,viewId:this.viewId},{rect:wt(t.rect),drawCanvas:xt.Bg,viewId:this.viewId}));_context47.next=4;return this._post(e);case 4:case"end":return _context47.stop();}},_callee45,this);}));function drawSelector(_x88){return _drawSelector.apply(this,arguments);}return drawSelector;}()},{key:"drawEraser",value:function(){var _drawEraser=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee46(t){var _this90=this;var n,i,e,_iterator42,_step42,a,o;return _regeneratorRuntime().wrap(function _callee46$(_context48){while(1)switch(_context48.prev=_context48.next){case 0:e=[];if((n=t.newWorkDatas)!=null&&n.size){_iterator42=_createForOfIteratorHelper(t.newWorkDatas.values());try{for(_iterator42.s();!(_step42=_iterator42.n()).done;){a=_step42.value;o=a.workId.toString();this.batchEraserWorks.add(o),e.push({type:ft.FullWork,workId:o,ops:_t(a.op),opt:a.opt,toolsType:a.toolsType,updateNodeOpt:{useAnimation:!1}});}}catch(err){_iterator42.e(err);}finally{_iterator42.f();}delete t.newWorkDatas;}(i=t.removeIds)==null||i.forEach(function(a){_this90.batchEraserRemoveNodes.add(a);});e.push(t);_context48.next=6;return this._post({sp:e});case 6:this.batchEraserCombine();case 7:case"end":return _context48.stop();}},_callee46,this);}));function drawEraser(_x89){return _drawEraser.apply(this,arguments);}return drawEraser;}()},{key:"drawPencil",value:function(){var _drawPencil=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee47(t){return _regeneratorRuntime().wrap(function _callee47$(_context49){while(1)switch(_context49.prev=_context49.next){case 0:_context49.next=2;return this._post({drawCount:this.drawCount,sp:(t==null?void 0:t.op)&&[t]});case 2:case"end":return _context49.stop();}},_callee47,this);}));function drawPencil(_x90){return _drawPencil.apply(this,arguments);}return drawPencil;}()},{key:"drawPencilFull",value:function(){var _drawPencilFull=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee48(t){var n,e;return _regeneratorRuntime().wrap(function _callee48$(_context50){while(1)switch(_context50.prev=_context50.next){case 0:e={drawCount:1/0,render:[],sp:[t]};(n=e.render)==null||n.push({isClearAll:!0,clearCanvas:xt.Float,viewId:this.viewId},{rect:t.rect,isClear:!0,clearCanvas:xt.Bg,viewId:this.viewId},{rect:t.rect,drawCanvas:xt.Bg,viewId:this.viewId});_context50.next=4;return this._post(e);case 4:case"end":return _context50.stop();}},_callee48,this);}));function drawPencilFull(_x91){return _drawPencilFull.apply(this,arguments);}return drawPencilFull;}()},{key:"updateBatchEraserCombineNode",value:function updateBatchEraserCombineNode(t,e){var _this91=this;var n=[];var i;var _iterator43=_createForOfIteratorHelper(e.keys()),_step43;try{for(_iterator43.s();!(_step43=_iterator43.n()).done;){var a=_step43.value;this.fullLayer.getElementsByName(a).forEach(function(o){var s=o.getBoundingClientRect();i=Ot(i,{x:s.x-se.SafeBorderPadding,y:s.y-se.SafeBorderPadding,w:s.width+se.SafeBorderPadding*2,h:s.height+se.SafeBorderPadding*2}),o.remove();});}}catch(err){_iterator43.e(err);}finally{_iterator43.f();}return t.forEach(function(a){var o=_this91.vNodes.get(a);if(o)if(_this91.fullLayer.getElementsByName(a)[0])i=Ot(i,o.rect);else{var c=_this91.setFullWork(_objectSpread(_objectSpread({},o),{},{workId:a})),p=c&&c.consumeService({op:o.op,isFullWork:!0});p&&(o.rect=p,i=Ot(i,p));}}),i&&n.push({rect:i,isClear:!0,clearCanvas:xt.Bg,viewId:this.viewId},{rect:i,drawCanvas:xt.Bg,viewId:this.viewId}),n;}},{key:"runEffectSelectWork",value:function(){var _runEffectSelectWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee49(t){var e,n,i,_iterator44,_step44,a,o,s,c;return _regeneratorRuntime().wrap(function _callee49$(_context51){while(1)switch(_context51.prev=_context51.next){case 0:_iterator44=_createForOfIteratorHelper(this.effectSelectNodeData.values());_context51.prev=1;_iterator44.s();case 3:if((_step44=_iterator44.n()).done){_context51.next=23;break;}a=_step44.value;o=this.setFullWork(a);if(!o){_context51.next=21;break;}s=(e=o.getWorkId())==null?void 0:e.toString();if(!(o.toolsType===gt.Image)){_context51.next=13;break;}_context51.next=11;return o.consumeServiceAsync({scene:(i=(n=this.drawLayer)==null?void 0:n.parent)==null?void 0:i.parent,isFullWork:!0,replaceId:s});case 11:_context51.next=20;break;case 13:if(!(o.toolsType===gt.Text)){_context51.next=18;break;}_context51.next=16;return o.consumeServiceAsync({isFullWork:!0,replaceId:s});case 16:_context51.next=20;break;case 18:c=a.ops&&Me(a.ops);o.consumeService({op:c,isFullWork:!0,replaceId:s}),a!=null&&a.updateNodeOpt&&o.updataOptService(a.updateNodeOpt);case 20:a.workId&&this.workShapes["delete"](a.workId.toString());case 21:_context51.next=3;break;case 23:_context51.next=28;break;case 25:_context51.prev=25;_context51.t0=_context51["catch"](1);_iterator44.e(_context51.t0);case 28:_context51.prev=28;_iterator44.f();return _context51.finish(28);case 31:_context51.next=33;return this.reRenderSelector(t);case 33:case"end":return _context51.stop();}},_callee49,this,[[1,25,28,31]]);}));function runEffectSelectWork(_x92){return _runEffectSelectWork.apply(this,arguments);}return runEffectSelectWork;}()},{key:"cursorHover",value:function(){var _cursorHover=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee50(t){var o,e,n,i,a,s,c;return _regeneratorRuntime().wrap(function _callee50$(_context52){while(1)switch(_context52.prev=_context52.next){case 0:e=t.opt,n=t.toolsType,i=t.point,a=this.setFullWork({workId:be,toolsType:n,opt:e});if(!(a&&i)){_context52.next=8;break;}s=a.cursorHover(i),c={render:[]};_context52.t0=s&&s.type===ft.CursorHover&&s.rect;if(!_context52.t0){_context52.next=8;break;}(o=c.render)==null||o.push({rect:wt(s.rect),clearCanvas:xt.Bg,isClear:!0,viewId:this.viewId},{rect:wt(s.rect),drawCanvas:xt.Bg,viewId:this.viewId});_context52.next=8;return this._post(c);case 8:case"end":return _context52.stop();}},_callee50,this);}));function cursorHover(_x93){return _cursorHover.apply(this,arguments);}return cursorHover;}()},{key:"cursorBlur",value:function(){var _cursorBlur=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee51(){var n,t,e;return _regeneratorRuntime().wrap(function _callee51$(_context53){while(1)switch(_context53.prev=_context53.next){case 0:t=this.getWorkShape(be);_context53.t0=t&&(n=t.selectIds)!=null&&n.length;if(!_context53.t0){_context53.next=10;break;}e=t.oldSelectRect;t.cursorBlur();this.clearWorkShapeNodeCache(be);_context53.t1=e;if(!_context53.t1){_context53.next=10;break;}_context53.next=10;return this._post({render:[{rect:wt(e),clearCanvas:xt.Bg,isClear:!0,viewId:this.viewId},{rect:wt(e),drawCanvas:xt.Bg,viewId:this.viewId}]});case 10:this.fullLayer.parent.children.forEach(function(i){i.name==="Cursor_Hover_Id"&&i.remove();});case 11:case"end":return _context53.stop();}},_callee51,this);}));function cursorBlur(){return _cursorBlur.apply(this,arguments);}return cursorBlur;}()}]);}(xi);var ov=/*#__PURE__*/function(){function ov(r){_classCallCheck(this,ov);rt(this,"viewId");rt(this,"vNodes");rt(this,"fullLayer");rt(this,"drawLayer");rt(this,"workShapes",/* @__PURE__ */new Map());rt(this,"selectorWorkShapes",/* @__PURE__ */new Map());rt(this,"thread");rt(this,"animationId");rt(this,"willRunEffectSelectorIds",/* @__PURE__ */new Set());rt(this,"runEffectId");rt(this,"noAnimationRect");rt(this,"syncUnitTime",ne.syncOpt.interval);rt(this,"post");this.viewId=r.viewId,this.vNodes=r.vNodes,this.fullLayer=r.fullLayer,this.drawLayer=r.drawLayer,this.thread=r.thread,this.post=r.thread.post.bind(r.thread);}return _createClass(ov,[{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 _callee52(r){return _regeneratorRuntime().wrap(function _callee52$(_context54){while(1)switch(_context54.prev=_context54.next){case 0:this.activeWorkShape(r),this.runAnimation();case 1:case"end":return _context54.stop();}},_callee52,this);}));function consumeDraw(_x94){return _consumeDraw2.apply(this,arguments);}return consumeDraw;}()},{key:"consumeFull",value:function consumeFull(r){this.activeWorkShape(r),this.runAnimation();}},{key:"runSelectWork",value:function runSelectWork(r){this.activeSelectorShape(r);var t=r.workId,e=t==null?void 0:t.toString();e&&this.willRunEffectSelectorIds.add(e),this.runEffect();}},{key:"setNodeKey",value:function setNodeKey(r,t,e,n){return t.toolsType=e,t.node=br({workId:r,toolsType:e,toolsOpt:n,vNodes:this.vNodes,fullLayer:this.fullLayer,drawLayer:this.drawLayer},this),t;}},{key:"runReverseSelectWork",value:function runReverseSelectWork(r){var _this92=this;r.forEach(function(t){_this92.selectorWorkShapes.forEach(function(e,n){var i;if((i=e.selectIds)!=null&&i.length){var a=e.selectIds.indexOf(t);a>-1&&(e.selectIds.splice(a,1),_this92.willRunEffectSelectorIds.add(n));}});}),this.willRunEffectSelectorIds.size&&this.runEffect();}},{key:"removeWork",value:function(){var _removeWork3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee53(r){var t,e,n;return _regeneratorRuntime().wrap(function _callee53$(_context55){while(1)switch(_context55.prev=_context55.next){case 0:t=r.workId,e=t==null?void 0:t.toString();if(!e){_context55.next=10;break;}n=this.workShapes.get(e);if(!n){_context55.next=8;break;}this.workShapes["delete"](e);_context55.next=7;return this.removeNode(e,r,n==null?void 0:n.totalRect,!1);case 7:return _context55.abrupt("return");case 8:_context55.next=10;return this.removeNode(e,r);case 10:case"end":return _context55.stop();}},_callee53,this);}));function removeWork(_x95){return _removeWork3.apply(this,arguments);}return removeWork;}()},{key:"removeSelectWork",value:function removeSelectWork(r){var t=r.workId,e=t==null?void 0:t.toString();e&&(this.activeSelectorShape(r),this.willRunEffectSelectorIds.add(e)),this.runEffect();}},{key:"removeNode",value:function(){var _removeNode=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee54(r,t,e){var n,o,i,a,_args56=arguments;return _regeneratorRuntime().wrap(function _callee54$(_context56){while(1)switch(_context56.prev=_context56.next){case 0:n=_args56.length>3&&_args56[3]!==undefined?_args56[3]:!0;r.indexOf(Nt)>-1&&this.removeSelectWork(t);i=e;a=(o=this.vNodes.get(r))==null?void 0:o.rect;a&&(i=Ot(a,i));this.fullLayer.getElementsByName(r).forEach(function(s){s.remove();});this.drawLayer.getElementsByName(r).forEach(function(s){s.remove();});this.vNodes["delete"](r);_context56.t0=i;if(!_context56.t0){_context56.next=12;break;}_context56.next=12;return this.post({render:[{rect:wt(i),isClear:!0,clearCanvas:n?xt.Bg:xt.ServiceFloat,workerType:n?void 0:Tt.Service,viewId:this.viewId},{rect:wt(i),drawCanvas:n?xt.Bg:xt.ServiceFloat,workerType:n?void 0:Tt.Service,viewId:this.viewId}]});case 12:case"end":return _context56.stop();}},_callee54,this);}));function removeNode(_x96,_x97,_x98){return _removeNode.apply(this,arguments);}return removeNode;}()},{key:"activeWorkShape",value:function activeWorkShape(r){var y,M,T,m;var t=r.workId,e=r.opt,n=r.toolsType,i=r.type,a=r.updateNodeOpt,o=r.ops,s=r.op,c=r.useAnimation;if(!t)return;var p=t.toString(),h=(y=this.vNodes.get(p))==null?void 0:y.rect;if(!((M=this.workShapes)!=null&&M.has(p))){var _x99={toolsType:n,animationWorkData:s||[],animationIndex:0,type:i,updateNodeOpt:a,ops:o,useAnimation:_typeof(c)<"u"?c:_typeof(a==null?void 0:a.useAnimation)<"u"?a==null?void 0:a.useAnimation:!0,oldRect:h,isDiff:!1};n&&e&&(_x99=this.setNodeKey(p,_x99,n,e)),(T=this.workShapes)==null||T.set(p,_x99);}var v=(m=this.workShapes)==null?void 0:m.get(p);i&&(v.type=i),o&&(v.animationWorkData=Me(o),v.ops=o),a&&(v.updateNodeOpt=a),s&&(v.isDiff=this.hasDiffData(v.animationWorkData||[],s,v.toolsType),v.animationWorkData=s),v.node&&v.node.getWorkId()!==p&&v.node.setWorkId(p),h&&(v.oldRect=h),n&&e&&(e.syncUnitTime&&(this.syncUnitTime=e.syncUnitTime),v.toolsType!==n&&n&&e&&this.setNodeKey(p,v,n,e),v.node&&v.node.setWorkOptions(e));}},{key:"hasDiffData",value:function hasDiffData(r,t,e){var n=r.length;if(t.length<n)return!0;switch(e){case gt.Pencil:{for(var i=0;i<n;i+=3)if(t[i]!==r[i]||t[i+1]!==r[i+1])return!0;break;}case gt.LaserPen:{for(var _i3=0;_i3<n;_i3+=2)if(t[_i3]!==r[_i3]||t[_i3+1]!==r[_i3+1])return!0;break;}}return!1;}},{key:"animationDraw",value:function(){var _animationDraw=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee55(){var _this93=this;var n,i,a,o,s,c,p,h,v,y,M,T,m,x,l,d,f,g,O,A,R,b,P,L,D,I,C,B,G,H,X,r,t,e,_iterator45,_step45,_loop6;return _regeneratorRuntime().wrap(function _callee55$(_context58){while(1)switch(_context58.prev=_context58.next){case 0:this.animationId=void 0;r=!1;t={render:[]},e=/* @__PURE__ */new Map();_iterator45=_createForOfIteratorHelper(this.workShapes.entries());_context58.prev=4;_loop6=/*#__PURE__*/_regeneratorRuntime().mark(function _loop6(){var _step45$value,Z,W,z,Q,_z3,_Q,_z4,_Q2,et,_,_z5,_Q3,_z6,_Q4,_et3,_5,st,q,ht,_q4;return _regeneratorRuntime().wrap(function _loop6$(_context57){while(1)switch(_context57.prev=_context57.next){case 0:_step45$value=_slicedToArray(_step45.value,2),Z=_step45$value[0],W=_step45$value[1];_context57.t0=W.toolsType;_context57.next=_context57.t0===gt.Image?4:_context57.t0===gt.Text?11:_context57.t0===gt.Arrow?19:_context57.t0===gt.Straight?19:_context57.t0===gt.Rectangle?19:_context57.t0===gt.Ellipse?19:_context57.t0===gt.Star?19:_context57.t0===gt.Polygon?19:_context57.t0===gt.SpeechBalloon?19:_context57.t0===gt.Pencil?22:37;break;case 4:z=W.oldRect;z&&((n=t.render)==null||n.push({rect:z,isClear:!0,clearCanvas:xt.Bg,viewId:_this93.viewId}),(i=t.render)==null||i.push({rect:z,drawCanvas:xt.Bg,viewId:_this93.viewId}));_context57.next=8;return(o=W.node)==null?void 0:o.consumeServiceAsync({isFullWork:!0,scene:(a=_this93.fullLayer.parent)==null?void 0:a.parent});case 8:Q=_context57.sent;_this93.selectorWorkShapes.forEach(function(et,_){var st;(st=et.selectIds)!=null&&st.includes(Z)&&(_this93.willRunEffectSelectorIds.add(_),_this93.noAnimationRect=Ot(_this93.noAnimationRect,z),_this93.noAnimationRect=Ot(_this93.noAnimationRect,Q),_this93.runEffect());}),_this93.workShapes["delete"](Z),(s=t.render)==null||s.push({rect:Q,drawCanvas:xt.Bg,viewId:_this93.viewId});return _context57.abrupt("break",37);case 11:if(!W.node){_context57.next=18;break;}_z3=W.oldRect;_z3&&((c=t.render)==null||c.push({rect:_z3,isClear:!0,clearCanvas:xt.Bg,viewId:_this93.viewId}),(p=t.render)==null||p.push({rect:_z3,drawCanvas:xt.Bg,viewId:_this93.viewId}));_context57.next=16;return W.node.consumeServiceAsync({isFullWork:!0,replaceId:Z});case 16:_Q=_context57.sent;_this93.selectorWorkShapes.forEach(function(et,_){var st;(st=et.selectIds)!=null&&st.includes(Z)&&(_this93.willRunEffectSelectorIds.add(_),_this93.noAnimationRect=Ot(_this93.noAnimationRect,_z3),_this93.noAnimationRect=Ot(_this93.noAnimationRect,_Q),_this93.runEffect());}),(h=W.node)==null||h.clearTmpPoints(),_this93.workShapes["delete"](Z),(v=t.render)==null||v.push({rect:_Q,drawCanvas:xt.Bg,viewId:_this93.viewId});case 18:return _context57.abrupt("break",37);case 19:_z4=!!W.ops;if((y=W.animationWorkData)!=null&&y.length){_Q2=W.oldRect,et=W.node.oldRect;_Q2&&((M=t.render)==null||M.push({rect:_Q2,isClear:!0,clearCanvas:xt.Bg,viewId:_this93.viewId}),(T=t.render)==null||T.push({rect:_Q2,drawCanvas:xt.Bg,viewId:_this93.viewId})),et&&((m=t.render)==null||m.push({rect:et,isClear:!0,clearCanvas:xt.ServiceFloat,viewId:_this93.viewId}));_=(x=W.node)==null?void 0:x.consumeService({op:W.animationWorkData,isFullWork:_z4});e.set(Z,{workState:_Q2?W.ops?It.Done:It.Doing:It.Start,op:W.animationWorkData.filter(function(st,q){if(q%3!==2)return!0;}).slice(-2)}),_z4?(_this93.selectorWorkShapes.forEach(function(st,q){var ht;(ht=st.selectIds)!=null&&ht.includes(Z)&&(_this93.willRunEffectSelectorIds.add(q),_this93.noAnimationRect=Ot(_this93.noAnimationRect,_Q2),_this93.noAnimationRect=Ot(_this93.noAnimationRect,et),_this93.noAnimationRect=Ot(_this93.noAnimationRect,_),_this93.runEffect());}),(l=W.node)==null||l.clearTmpPoints(),_this93.workShapes["delete"](Z),(d=t.render)==null||d.push({rect:_,drawCanvas:xt.Bg,viewId:_this93.viewId})):(f=t.render)==null||f.push({rect:_,drawCanvas:xt.ServiceFloat,workerType:_z4?void 0:Tt.Service,viewId:_this93.viewId}),W.animationWorkData.length=0;}return _context57.abrupt("break",37);case 22:if(!(!W.useAnimation&&W.ops)){_context57.next=28;break;}_z5=(g=W.node)==null?void 0:g.consumeService({op:W.animationWorkData||[],isFullWork:!0,replaceId:Z});_Q3=(O=W.node)==null?void 0:O.updataOptService(W.updateNodeOpt);_z5=Ot(_z5,_Q3),(A=t.render)==null||A.push({isClear:!0,rect:Ot(W.oldRect,_z5),clearCanvas:xt.Bg,viewId:_this93.viewId}),(R=t.render)==null||R.push({rect:Ot(W.oldRect,_z5),drawCanvas:xt.Bg,viewId:_this93.viewId}),_this93.selectorWorkShapes.forEach(function(et,_){var st;(st=et.selectIds)!=null&&st.includes(Z)&&(_this93.willRunEffectSelectorIds.add(_),_this93.noAnimationRect=Ot(_this93.noAnimationRect,_z5),_this93.runEffect());}),(b=W.node)==null||b.clearTmpPoints(),_this93.workShapes["delete"](Z);_context57.next=36;break;case 28:if(!W.useAnimation){_context57.next=36;break;}if(!W.isDel){_context57.next=32;break;}(P=W.node)==null||P.clearTmpPoints(),_this93.workShapes["delete"](Z);return _context57.abrupt("break",37);case 32:_z6=3,_Q4=_this93.computNextAnimationIndex(W,_z6),_et3=W.isDiff?0:Math.max(0,(W.animationIndex||0)-_z6),_5=(W.animationWorkData||[]).slice(_et3,_Q4),st=(D=(L=W.node)==null?void 0:L.getWorkId())==null?void 0:D.toString();if((W.animationIndex||0)<_Q4||W.isDiff){q=(I=W.node)==null?void 0:I.consumeService({op:_5,isFullWork:!1});if((C=t.render)==null||C.push({rect:q,drawCanvas:xt.ServiceFloat,viewId:_this93.viewId}),W.animationIndex=_Q4,W.isDiff&&(W.isDiff=!1),_5.length){ht=_5.filter(function(dt,F){if(F%_z6!==_z6-1)return!0;}).slice(-2);e.set(Z,{workState:_et3===0?It.Start:_Q4===((B=W.animationWorkData)==null?void 0:B.length)?It.Done:It.Doing,op:ht});}}else if(W.ops){_q4=(G=W.node)==null?void 0:G.consumeService({op:W.animationWorkData||[],isFullWork:!0,replaceId:st});W.isDel=!0,(H=t.render)==null||H.push({isClear:!0,rect:_q4,clearCanvas:xt.ServiceFloat,viewId:_this93.viewId},{rect:_q4,drawCanvas:xt.ServiceFloat,viewId:_this93.viewId},{isClear:!0,rect:_q4,clearCanvas:xt.Bg,viewId:_this93.viewId},{rect:_q4,drawCanvas:xt.Bg,viewId:_this93.viewId}),e.set(Z,{workState:It.Done,op:_5.filter(function(ht,dt){if(dt%_z6!==_z6-1)return!0;}).slice(-2)});}r=!0;return _context57.abrupt("break",37);case 36:return _context57.abrupt("break",37);case 37:case"end":return _context57.stop();}},_loop6);});_iterator45.s();case 7:if((_step45=_iterator45.n()).done){_context58.next=11;break;}return _context58.delegateYield(_loop6(),"t0",9);case 9:_context58.next=7;break;case 11:_context58.next=16;break;case 13:_context58.prev=13;_context58.t1=_context58["catch"](4);_iterator45.e(_context58.t1);case 16:_context58.prev=16;_iterator45.f();return _context58.finish(16);case 19:r&&this.runAnimation();e.size&&(t.sp=[],e.forEach(function(Z,W){var z;(z=t.sp)==null||z.push({type:ft.Cursor,uid:W.split(pr)[0],op:Z.op,workState:Z.workState,viewId:_this93.viewId});}));_context58.t2=(X=t.render)!=null&&X.length;if(!_context58.t2){_context58.next=25;break;}_context58.next=25;return this.post(t);case 25:case"end":return _context58.stop();}},_callee55,this,[[4,13,16,19]]);}));function animationDraw(){return _animationDraw.apply(this,arguments);}return animationDraw;}()},{key:"runAnimation",value:function runAnimation(){this.animationId||(this.animationId=requestAnimationFrame(this.animationDraw.bind(this)));}},{key:"computNextAnimationIndex",value:function computNextAnimationIndex(r,t){var e=Math.floor((r.animationWorkData||[]).slice(r.animationIndex).length*32/t/this.syncUnitTime)*t;return Math.min((r.animationIndex||0)+(e||t),(r.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 _callee56(){var _this94=this;var r;return _regeneratorRuntime().wrap(function _callee56$(_context59){while(1)switch(_context59.prev=_context59.next){case 0:this.runEffectId=void 0;r=this.noAnimationRect;this.willRunEffectSelectorIds.forEach(function(t){var i,a;var e=_this94.selectorWorkShapes.get(t),n=e&&e.selectIds&&((i=e.node)==null?void 0:i.selectServiceNode(t,e,!0));r=Ot(r,n),(a=e==null?void 0:e.selectIds)!=null&&a.length||_this94.selectorWorkShapes["delete"](t);});_context59.t0=r;if(!_context59.t0){_context59.next=7;break;}_context59.next=7;return this.post({render:[{rect:wt(r),isClear:!0,clearCanvas:xt.Bg,viewId:this.viewId},{rect:wt(r),drawCanvas:xt.Bg,viewId:this.viewId}]});case 7:this.willRunEffectSelectorIds.clear();this.noAnimationRect=void 0;case 9:case"end":return _context59.stop();}},_callee56,this);}));function effectRunSelector(){return _effectRunSelector.apply(this,arguments);}return effectRunSelector;}()},{key:"activeSelectorShape",value:function activeSelectorShape(r){var c,p,h;var t=r.workId,e=r.opt,n=r.toolsType,i=r.type,a=r.selectIds;if(!t)return;var o=t.toString();if(!((c=this.selectorWorkShapes)!=null&&c.has(o))){var v={toolsType:n,selectIds:a,type:i,opt:e};n&&e&&(v=this.setNodeKey(o,v,n,e)),(p=this.selectorWorkShapes)==null||p.set(o,v);}var s=(h=this.selectorWorkShapes)==null?void 0:h.get(o);i&&(s.type=i),s.node&&s.node.getWorkId()!==o&&s.node.setWorkId(o),s.selectIds=a||[];}}]);}();var av=/*#__PURE__*/function(_xi2){function av(t){var _this95;_classCallCheck(this,av);_this95=_callSuper(this,av,[t]);rt(_this95,"drawWorkActiveId");return _this95;}_inherits(av,_xi2);return _createClass(av,[{key:"runFullWork",value:function(){var _runFullWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee57(t){var i,a,e,n,o,s,c;return _regeneratorRuntime().wrap(function _callee57$(_context60){while(1)switch(_context60.prev=_context60.next){case 0:e=this.setFullWork(t),n=t.ops&&Me(t.ops);if(!e){_context60.next=18;break;}c=(i=e.getWorkId())==null?void 0:i.toString();if(!(e.toolsType===gt.Image)){_context60.next=9;break;}_context60.next=6;return e.consumeServiceAsync({isFullWork:!0,scene:(a=this.fullLayer.parent)==null?void 0:a.parent});case 6:o=_context60.sent;_context60.next=16;break;case 9:if(!(e.toolsType===gt.Text)){_context60.next=15;break;}_context60.next=12;return e.consumeServiceAsync({isFullWork:!0,replaceId:c,isDrawLabel:!0});case 12:o=_context60.sent;_context60.next=16;break;case 15:o=e.consumeService({op:n,isFullWork:!0,replaceId:c}),s=(t==null?void 0:t.updateNodeOpt)&&e.updataOptService(t.updateNodeOpt);case 16:t.workId&&this.workShapes["delete"](t.workId.toString());return _context60.abrupt("return",Ot(o,s));case 18:case"end":return _context60.stop();}},_callee57,this);}));function runFullWork(_x100){return _runFullWork.apply(this,arguments);}return runFullWork;}()},{key:"runSelectWork",value:function runSelectWork(t){var n;var e=this.setFullWork(t);e&&(n=t.selectIds)!=null&&n.length&&t.workId&&e.selectServiceNode(t.workId.toString(),{selectIds:t.selectIds},!1);}},{key:"workShapesDone",value:function workShapesDone(){var _iterator46=_createForOfIteratorHelper(this.workShapes.keys()),_step46;try{for(_iterator46.s();!(_step46=_iterator46.n()).done;){var t=_step46.value;this.clearWorkShapeNodeCache(t);}}catch(err){_iterator46.e(err);}finally{_iterator46.f();}this.fullLayer.removeAllChildren();}},{key:"consumeDraw",value:function(){var _consumeDraw3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee58(t){var e,n,i,a,o;return _regeneratorRuntime().wrap(function _callee58$(_context61){while(1)switch(_context61.prev=_context61.next){case 0:e=t.workId,n=e==null?void 0:e.toString(),i=n&&this.workShapes.get(n);if(i){_context61.next=3;break;}return _context61.abrupt("return");case 3:_context61.t0=this.drawWorkActiveId&&this.drawWorkActiveId!==n;if(!_context61.t0){_context61.next=8;break;}_context61.next=7;return this.consumeDrawAll({workId:this.drawWorkActiveId,viewId:this.viewId,msgType:ft.DrawWork,dataType:Tt.Local});case 7:this.drawWorkActiveId=void 0;case 8:!this.drawWorkActiveId&&n!==Nt&&(this.drawWorkActiveId=n);a=i.toolsType,o=i.consume({data:t,drawCount:this.drawCount,isFullWork:!0,isSubWorker:!0});_context61.t1=a;_context61.next=_context61.t1===gt.Arrow?13:_context61.t1===gt.Straight?13:_context61.t1===gt.Ellipse?13:_context61.t1===gt.Rectangle?13:_context61.t1===gt.Star?13:_context61.t1===gt.Polygon?13:_context61.t1===gt.SpeechBalloon?13:_context61.t1===gt.Pencil?19:25;break;case 13:_context61.t2=o;if(!_context61.t2){_context61.next=18;break;}this.drawCount++;_context61.next=18;return this.drawArrow(o);case 18:return _context61.abrupt("break",25);case 19:_context61.t3=o;if(!_context61.t3){_context61.next=24;break;}this.drawCount++;_context61.next=24;return this.drawPencil(o,e==null?void 0:e.toString());case 24:return _context61.abrupt("break",25);case 25:case"end":return _context61.stop();}},_callee58,this);}));function consumeDraw(_x101){return _consumeDraw3.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee59(t){var e,n,i;return _regeneratorRuntime().wrap(function _callee59$(_context62){while(1)switch(_context62.prev=_context62.next){case 0:e=t.workId;if(!e){_context62.next=12;break;}n=e.toString();this.drawWorkActiveId===n&&(this.drawWorkActiveId=void 0);i=this.workShapes.get(n);if(i){_context62.next=7;break;}return _context62.abrupt("return");case 7:_context62.t0=i.toolsType;_context62.next=_context62.t0===gt.Arrow?10:_context62.t0===gt.Straight?10:_context62.t0===gt.Ellipse?10:_context62.t0===gt.Pencil?10:_context62.t0===gt.Rectangle?10:_context62.t0===gt.Star?10:_context62.t0===gt.Polygon?10:_context62.t0===gt.SpeechBalloon?10:12;break;case 10:this.drawCount=0,this.fullLayer.removeAllChildren(),this.clearWorkShapeNodeCache(n);return _context62.abrupt("break",12);case 12:case"end":return _context62.stop();}},_callee59,this);}));function consumeDrawAll(_x102){return _consumeDrawAll2.apply(this,arguments);}return consumeDrawAll;}()},{key:"removeWork",value:function(){var _removeWork4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee60(t){var e,n,i,a;return _regeneratorRuntime().wrap(function _callee60$(_context63){while(1)switch(_context63.prev=_context63.next){case 0:e=t.workId,n=e==null?void 0:e.toString();if(!n){_context63.next=8;break;}i=this.removeNode(n);if(!i){_context63.next=8;break;}a=[];a.push({rect:wt(i),clearCanvas:xt.Float,isClear:!0,viewId:this.viewId},{rect:wt(i),drawCanvas:xt.Float,viewId:this.viewId});_context63.next=8;return this._post({render:a});case 8:case"end":return _context63.stop();}},_callee60,this);}));function removeWork(_x103){return _removeWork4.apply(this,arguments);}return removeWork;}()},{key:"removeNode",value:function removeNode(t){var e=this.workShapes.has(t);var n;return e&&(this.fullLayer.getElementsByName(t).forEach(function(i){var a=i.getBoundingClientRect();n=Ot(n,{x:a.x-yt.SafeBorderPadding,y:a.y-yt.SafeBorderPadding,w:a.width+yt.SafeBorderPadding*2,h:a.height+yt.SafeBorderPadding*2}),i.remove();}),n&&this.clearWorkShapeNodeCache(t)),n;}},{key:"drawPencil",value:function(){var _drawPencil2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee61(t,e){return _regeneratorRuntime().wrap(function _callee61$(_context64){while(1)switch(_context64.prev=_context64.next){case 0:_context64.next=2;return this._post({drawCount:this.drawCount,render:[{rect:t==null?void 0:t.rect,workId:e,drawCanvas:xt.Float,viewId:this.viewId}],sp:(t==null?void 0:t.op)&&[t]});case 2:case"end":return _context64.stop();}},_callee61,this);}));function drawPencil(_x104,_x105){return _drawPencil2.apply(this,arguments);}return drawPencil;}()},{key:"drawArrow",value:function(){var _drawArrow=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee62(t){return _regeneratorRuntime().wrap(function _callee62$(_context65){while(1)switch(_context65.prev=_context65.next){case 0:_context65.next=2;return this._post({drawCount:this.drawCount,render:[{rect:(t==null?void 0:t.rect)&&wt(t.rect),isClear:!0,clearCanvas:xt.Float,viewId:this.viewId},{rect:(t==null?void 0:t.rect)&&wt(t.rect),drawCanvas:xt.Float,viewId:this.viewId}]});case 2:case"end":return _context65.stop();}},_callee62,this);}));function drawArrow(_x106){return _drawArrow.apply(this,arguments);}return drawArrow;}()}]);}(xi);var lv=/*#__PURE__*/function(){function lv(r){_classCallCheck(this,lv);rt(this,"viewId");rt(this,"vNodes");rt(this,"topLayer");rt(this,"thread");rt(this,"post");rt(this,"serviceWorkShapes",/* @__PURE__ */new Map());rt(this,"localWorkShapes",/* @__PURE__ */new Map());rt(this,"tmpOpt");rt(this,"syncUnitTime",ne.syncOpt.interval);rt(this,"animationId");this.viewId=r.viewId,this.vNodes=r.vNodes,this.topLayer=r.topLayer,this.thread=r.thread,this.post=r.thread.post.bind(r.thread);}return _createClass(lv,[{key:"canUseTopLayer",value:function canUseTopLayer(r){return r===gt.LaserPen;}},{key:"getWorkShape",value:function getWorkShape(r){return this.localWorkShapes.get(r);}},{key:"createWorkShape",value:function createWorkShape(r,t){if(r&&this.tmpOpt){var _e13={toolsType:this.tmpOpt.toolsType,toolsOpt:t||this.tmpOpt.toolsOpt},n=this.createWorkShapeNode(_objectSpread(_objectSpread({},_e13),{},{workId:r}));return n&&this.localWorkShapes.set(r,{node:n,toolsType:n.toolsType,workState:It.Start}),n;}}},{key:"setWorkOptions",value:function setWorkOptions(r,t){var n;var e=(n=this.localWorkShapes.get(r))==null?void 0:n.node;e||this.createWorkShape(r,t),e==null||e.setWorkOptions(t);}},{key:"createWorkShapeNode",value:function createWorkShapeNode(r){var t=r.toolsType;if(t===gt.LaserPen)return br(_objectSpread(_objectSpread({},r),{},{vNodes:this.vNodes,fullLayer:this.topLayer,drawLayer:this.topLayer}));}},{key:"clearAllWorkShapesCache",value:function clearAllWorkShapesCache(){this.localWorkShapes.forEach(function(r){var t;return(t=r.node)==null?void 0:t.clearTmpPoints();}),this.localWorkShapes.clear();}},{key:"setToolsOpt",value:function setToolsOpt(r){var t;this.tmpOpt=r,(t=r.toolsOpt)!=null&&t.syncUnitTime&&(this.syncUnitTime=r.toolsOpt.syncUnitTime);}},{key:"getToolsOpt",value:function getToolsOpt(){return this.tmpOpt;}},{key:"consumeDraw",value:function consumeDraw(r){var t=r.workId,e=r.dataType;if(e===Tt.Service)this.activeServiceWorkShape(r);else{var n=t==null?void 0:t.toString(),i=n&&this.localWorkShapes.get(n);if(!i)return;var a=i.node.consume({data:r,isFullWork:!1,isSubWorker:!0});a.rect&&(i.totalRect=Ot(a.rect,i.totalRect),i.result=a,i.workState=It.Doing,n&&this.localWorkShapes.set(n,i));}this.runAnimation();}},{key:"consumeDrawAll",value:function consumeDrawAll(r){var t=r.workId,e=r.dataType;if(e===Tt.Service)this.activeServiceWorkShape(r);else{var n=t==null?void 0:t.toString(),i=n&&this.localWorkShapes.get(n);if(!i)return;var a=i.node.consumeAll({data:r});i.totalRect=Ot(a.rect,i.totalRect),i.result=a,i.workState=It.Done,n&&this.localWorkShapes.set(n,i);}this.runAnimation();}},{key:"destroy",value:function destroy(){this.serviceWorkShapes.clear(),this.localWorkShapes.clear();}},{key:"setNodeKey",value:function setNodeKey(r,t,e,n){return t.toolsType=e,t.node=this.createWorkShapeNode({workId:r,toolsType:e,toolsOpt:n}),t;}},{key:"activeServiceWorkShape",value:function activeServiceWorkShape(r){var v,y;var t=r.workId,e=r.opt,n=r.toolsType,i=r.type,a=r.updateNodeOpt,o=r.ops,s=r.op;if(!t)return;var c=t.toString(),p=(v=this.vNodes.get(c))==null?void 0:v.rect;if(!((y=this.serviceWorkShapes)!=null&&y.has(c))){var M={toolsType:n,animationWorkData:s||[],animationIndex:0,type:i,updateNodeOpt:a,ops:o,oldRect:p};n&&e&&(M=this.setNodeKey(c,M,n,e)),this.serviceWorkShapes.set(c,M);}var h=this.serviceWorkShapes.get(c);i&&(h.type=i),o&&(h.animationWorkData=Me(o),h.ops=o),a&&(h.updateNodeOpt=a),s&&(h.animationWorkData=s),h.node&&h.node.getWorkId()!==c&&h.node.setWorkId(c),p&&(h.oldRect=p),n&&e&&(h.toolsType!==n&&n&&e&&this.setNodeKey(c,h,n,e),h.node&&h.node.setWorkOptions(e));}},{key:"computNextAnimationIndex",value:function computNextAnimationIndex(r,t){var e=Math.floor((r.animationWorkData||[]).slice(r.animationIndex).length*32/t/this.syncUnitTime)*t;return Math.min((r.animationIndex||0)+(e||t),(r.animationWorkData||[]).length);}},{key:"animationDraw",value:function(){var _animationDraw2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee63(){var _this96=this;var a,o,s,c,r,t,e,n,i,_iterator47,_step47,_step47$value,p,h,y,M,T,m,_iterator48,_step48,_step48$value,_p11,_h6,v,_y13,_M4,_T3,_m11;return _regeneratorRuntime().wrap(function _callee63$(_context66){while(1)switch(_context66.prev=_context66.next){case 0:this.animationId=void 0;r=!1;t=/* @__PURE__ */new Map(),e=[],n=[],i=[];_iterator47=_createForOfIteratorHelper(this.serviceWorkShapes.entries());_context66.prev=4;_iterator47.s();case 6:if((_step47=_iterator47.n()).done){_context66.next=20;break;}_step47$value=_slicedToArray(_step47.value,2),p=_step47$value[0],h=_step47$value[1];_context66.t0=h.toolsType;_context66.next=_context66.t0===gt.LaserPen?11:18;break;case 11:y=this.computNextAnimationIndex(h,8),M=Math.max(0,h.animationIndex||0),T=(h.animationWorkData||[]).slice(M,y);if((h.animationIndex||0)<y){m=(a=h.node)==null?void 0:a.consumeService({op:T,isFullWork:!1});h.totalRect=Ot(h.totalRect,m),h.animationIndex=y,T.length&&t.set(p,{workState:M===0?It.Start:y===((o=h.animationWorkData)==null?void 0:o.length)?It.Done:It.Doing,op:T.slice(-2)});}if(!(n.push({isClear:!0,rect:h.totalRect,clearCanvas:xt.TopFloat,viewId:this.viewId}),e.push({rect:h.totalRect,drawCanvas:xt.TopFloat,viewId:this.viewId}),h.isDel)){_context66.next=16;break;}(s=h.node)==null||s.clearTmpPoints(),this.serviceWorkShapes["delete"](p);return _context66.abrupt("break",18);case 16:h.ops&&h.animationIndex===((c=h.animationWorkData)==null?void 0:c.length)&&!h.isDel&&(this.topLayer.getElementsByName(p.toString())[0]||(h.isDel=!0,this.serviceWorkShapes.set(p,h))),r=!0;return _context66.abrupt("break",18);case 18:_context66.next=6;break;case 20:_context66.next=25;break;case 22:_context66.prev=22;_context66.t1=_context66["catch"](4);_iterator47.e(_context66.t1);case 25:_context66.prev=25;_iterator47.f();return _context66.finish(25);case 28:_iterator48=_createForOfIteratorHelper(this.localWorkShapes.entries());_context66.prev=29;_iterator48.s();case 31:if((_step48=_iterator48.n()).done){_context66.next=44;break;}_step48$value=_slicedToArray(_step48.value,2),_p11=_step48$value[0],_h6=_step48$value[1];v=_h6.result,_y13=_h6.toolsType,_M4=_h6.totalRect,_T3=_h6.isDel,_m11=_h6.workState;_context66.t2=_y13;_context66.next=_context66.t2===gt.LaserPen?37:42;break;case 37:if(!(_M4&&(n.push({isClear:!0,rect:_M4,clearCanvas:xt.TopFloat,viewId:this.viewId}),e.push({rect:_M4,drawCanvas:xt.TopFloat,viewId:this.viewId})),_T3)){_context66.next=40;break;}_h6.node.clearTmpPoints(),this.localWorkShapes["delete"](_p11),i.push({removeIds:[_p11.toString()],viewId:this.viewId,type:ft.RemoveNode});return _context66.abrupt("break",42);case 40:v&&((v.op||v.ops)&&i.push(v),_h6.result=void 0),!this.topLayer.getElementsByName(_p11.toString())[0]&&_m11===It.Done&&(_h6.isDel=!0,this.localWorkShapes.set(_p11,_h6)),r=!0;return _context66.abrupt("break",42);case 42:_context66.next=31;break;case 44:_context66.next=49;break;case 46:_context66.prev=46;_context66.t3=_context66["catch"](29);_iterator48.e(_context66.t3);case 49:_context66.prev=49;_iterator48.f();return _context66.finish(49);case 52:r&&this.runAnimation(),t.size&&t.forEach(function(p,h){i.push({type:ft.Cursor,uid:h.split(pr)[0],op:p.op,workState:p.workState,viewId:_this96.viewId});}),(e.length||n.length||i.length)&&this.post({render:[].concat(n,e),sp:i});case 53:case"end":return _context66.stop();}},_callee63,this,[[4,22,25,28],[29,46,49,52]]);}));function animationDraw(){return _animationDraw2.apply(this,arguments);}return animationDraw;}()},{key:"runAnimation",value:function runAnimation(){this.animationId||(this.animationId=requestAnimationFrame(this.animationDraw.bind(this)));}}]);}();var Je=/* @__PURE__ */function(u){return u.Full="full",u.Sub="sub",u;}(Je||{});var cv=/*#__PURE__*/function(){function cv(r,t){_classCallCheck(this,cv);rt(this,"_self");rt(this,"version",ri);rt(this,"type");rt(this,"workThreadMap",/* @__PURE__ */new Map());this._self=r,this.type=t,this.register();}return _createClass(cv,[{key:"init",value:function init(r){var t=r.viewId,e=r.dpr,n=r.offscreenCanvasOpt,i=r.layerOpt,a=r.isSafari;if(!e||!n||!i)return;var o;this.type==="full"&&(o=new fv(t,{dpr:e,offscreenCanvasOpt:n,layerOpt:i},this.post.bind(this))),this.type==="sub"&&(o=new uv(t,{dpr:e,offscreenCanvasOpt:n,layerOpt:i},this.post.bind(this))),o&&a&&o.setIsSafari(a),o&&r.cameraOpt&&o.setCameraOpt(r.cameraOpt),o&&this.workThreadMap.set(t,o);}},{key:"register",value:function register(){var _this97=this;onmessage=/*#__PURE__*/function(){var _ref165=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee64(r){var t,_iteratorAbruptCompletion,_didIteratorError,_iteratorError,_iterator,_step,_e14,n,i,a,o,_iterator49,_step49,_step49$value,c,p,h,_iterator50,_step50,_c6,s;return _regeneratorRuntime().wrap(function _callee64$(_context67){while(1)switch(_context67.prev=_context67.next){case 0:t=r.data;if(!t){_context67.next=51;break;}_iteratorAbruptCompletion=false;_didIteratorError=false;_context67.prev=4;_iterator=_asyncIterator(t.values());case 6:_context67.next=8;return _iterator.next();case 8:if(!(_iteratorAbruptCompletion=!(_step=_context67.sent).done)){_context67.next=35;break;}_e14=_step.value;n=_e14.msgType,i=_e14.viewId,a=_e14.tasksqueue,o=_e14.mainTasksqueueCount;if(!(n===ft.Console)){_context67.next=14;break;}console.log(_this97);return _context67.abrupt("continue",32);case 14:if(!(n===ft.Init)){_context67.next=17;break;}_this97.init(_e14);return _context67.abrupt("continue",32);case 17:if(!(n===ft.TasksQueue&&a!=null&&a.size)){_context67.next=22;break;}_iterator49=_createForOfIteratorHelper(_this97.workThreadMap.entries());try{for(_iterator49.s();!(_step49=_iterator49.n()).done;){_step49$value=_slicedToArray(_step49.value,2),c=_step49$value[0],p=_step49$value[1];h=a.get(c);h&&p.on(h);}}catch(err){_iterator49.e(err);}finally{_iterator49.f();}_this97.type==="full"&&kt(o)&&_this97.post({workerTasksqueueCount:o});return _context67.abrupt("continue",32);case 22:if(!(i===Ri)){_context67.next=26;break;}_iterator50=_createForOfIteratorHelper(_this97.workThreadMap.values());try{for(_iterator50.s();!(_step50=_iterator50.n()).done;){_c6=_step50.value;_c6.on(_e14),n===ft.Destroy&&_this97.workThreadMap["delete"](i);}}catch(err){_iterator50.e(err);}finally{_iterator50.f();}return _context67.abrupt("continue",32);case 26:s=_this97.workThreadMap.get(i);_context67.t0=s;if(!_context67.t0){_context67.next=32;break;}_context67.next=31;return s.on(_e14);case 31:n===ft.Destroy&&_this97.workThreadMap["delete"](i);case 32:_iteratorAbruptCompletion=false;_context67.next=6;break;case 35:_context67.next=41;break;case 37:_context67.prev=37;_context67.t1=_context67["catch"](4);_didIteratorError=true;_iteratorError=_context67.t1;case 41:_context67.prev=41;_context67.prev=42;if(!(_iteratorAbruptCompletion&&_iterator["return"]!=null)){_context67.next=46;break;}_context67.next=46;return _iterator["return"]();case 46:_context67.prev=46;if(!_didIteratorError){_context67.next=49;break;}throw _iteratorError;case 49:return _context67.finish(46);case 50:return _context67.finish(41);case 51:case"end":return _context67.stop();}},_callee64,null,[[4,37,41,51],[42,,46,50]]);}));return function onmessage(_x107){return _ref165.apply(this,arguments);};}();}},{key:"post",value:function post(r,t){t?this._self.postMessage(r,t):this._self.postMessage(r);}}]);}();var fv=/*#__PURE__*/function(_Si){function fv(t,e,n){var _this98;_classCallCheck(this,fv);_this98=_callSuper(this,fv,[t,e,"full"/* Full */]);rt(_this98,"type","full");rt(_this98,"serviceDrawLayer");rt(_this98,"localDrawLayer");rt(_this98,"snapshotFullLayer");rt(_this98,"methodBuilder");rt(_this98,"localWork");rt(_this98,"serviceWork");rt(_this98,"_post");rt(_this98,"taskUpdateCameraId");rt(_this98,"debounceUpdateCameraId");rt(_this98,"debounceUpdateCache",/* @__PURE__ */new Set());_this98._post=n;var i=ne.bufferSize.sub;_this98.serviceDrawLayer=_this98.createLayer("serviceDrawLayer",_this98.scene,_objectSpread(_objectSpread({},e.layerOpt),{},{bufferSize:i})),_this98.localDrawLayer=_this98.createLayer("localDrawLayer",_this98.scene,_objectSpread(_objectSpread({},e.layerOpt),{},{bufferSize:i}));var a={thread:_this98,viewId:_this98.viewId,vNodes:_this98.vNodes,fullLayer:_this98.fullLayer};_this98.localWork=new sv(_objectSpread(_objectSpread({},a),{},{drawLayer:_this98.localDrawLayer})),_this98.serviceWork=new ov(_objectSpread(_objectSpread({},a),{},{drawLayer:_this98.serviceDrawLayer})),_this98.methodBuilder=new ji([bt.CopyNode,bt.SetColorNode,bt.DeleteNode,bt.RotateNode,bt.ScaleNode,bt.TranslateNode,bt.ZIndexNode,bt.SetFontStyle,bt.SetPoint,bt.SetLock,bt.SetShapeOpt]).registerForWorker(_this98.localWork,_this98.serviceWork,_this98.scene),_this98.vNodes.init(_this98.fullLayer);return _this98;}_inherits(fv,_Si);return _createClass(fv,[{key:"combinePost",value:function(){var _combinePost=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee65(){var _this99=this;var a,o,_this$combinePostData,t,e,n,s,_iterator51,_step51,c,_this$vNodes$getRectI3,p,_p12,i;return _regeneratorRuntime().wrap(function _callee65$(_context68){while(1)switch(_context68.prev=_context68.next){case 0:_this$combinePostData=this.combinePostData(),t=_this$combinePostData.render,e=_objectWithoutProperties(_this$combinePostData,_excluded3);if(!(t!=null&&t.length)){_context68.next=29;break;}s=[];_iterator51=_createForOfIteratorHelper(t);_context68.prev=4;_iterator51.s();case 6:if((_step51=_iterator51.n()).done){_context68.next=20;break;}c=_step51.value;if(!c.rect){_context68.next=18;break;}if(c.drawCanvas===xt.Bg||c.clearCanvas===xt.Bg){_this$vNodes$getRectI3=this.vNodes.getRectIntersectRange(c.rect,!1,!0),p=_this$vNodes$getRectI3.rectRange;c.rect=Ot(c.rect,p)||c.rect;}if(!(c.rect=this.safariFixRect(Xt(c.rect)),!c.rect)){_context68.next=12;break;}return _context68.abrupt("continue",18);case 12:if(!(c.drawCanvas&&c.rect&&c.rect.w>0&&c.rect.h>0)){_context68.next=17;break;}_context68.next=15;return this.getRectImageBitmap(c);case 15:_p12=_context68.sent;c.imageBitmap=_p12,n||(n=[]),n.push(_p12);case 17:s.push(c);case 18:_context68.next=6;break;case 20:_context68.next=25;break;case 22:_context68.prev=22;_context68.t0=_context68["catch"](4);_iterator51.e(_context68.t0);case 25:_context68.prev=25;_iterator51.f();return _context68.finish(25);case 28:e.render=s;case 29:i=(a=e.sp)==null?void 0:a.filter(function(s){return s.type!==ft.None;});i!=null&&i.length?e.sp=i.map(function(s){return _objectSpread(_objectSpread({},s),{},{viewId:_this99.viewId});}):delete e.sp,e.drawCount===void 0&&delete e.drawCount,(e!=null&&e.drawCount||i!=null&&i.length||(o=e.render)!=null&&o.length)&&this._post(e,n),this.delayPostDoneResolve&&this.delayPostDoneResolve(!0);case 31:case"end":return _context68.stop();}},_callee65,this,[[4,22,25,28]]);}));function combinePost(){return _combinePost.apply(this,arguments);}return combinePost;}()},{key:"on",value:function(){var _on2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee66(t){var e,n,i,a,o;return _regeneratorRuntime().wrap(function _callee66$(_context69){while(1)switch(_context69.prev=_context69.next){case 0:if(!this.methodBuilder.consumeForWorker(t)){_context69.next=2;break;}return _context69.abrupt("return");case 2:e=t.msgType,n=t.dataType,i=t.workId,a=t.toolsType,o=t.workState;_context69.t0=e;_context69.next=_context69.t0===ft.CreateWork?6:_context69.t0===ft.DrawWork?8:_context69.t0===ft.Select?17:_context69.t0===ft.UpdateNode?24:_context69.t0===ft.FullWork?24:_context69.t0===ft.RemoveNode?26:_context69.t0===ft.GetTextActive?29:_context69.t0===ft.CursorHover?32:_context69.t0===ft.CursorBlur?35:38;break;case 6:a!==gt.LaserPen&&this.createLocalWork(t);return _context69.abrupt("break",38);case 8:_context69.t1=a!==gt.LaserPen;if(!_context69.t1){_context69.next=16;break;}if(!(o===It.Done&&n===Tt.Local)){_context69.next=15;break;}_context69.next=13;return this.consumeDrawAll(n,t);case 13:_context69.next=16;break;case 15:this.consumeDraw(n,t);case 16:return _context69.abrupt("break",38);case 17:if(!(i===Nt)){_context69.next=22;break;}_context69.next=20;return this.localWork.updateFullSelectWork(t);case 20:_context69.next=23;break;case 22:this.serviceWork.runSelectWork(t);case 23:return _context69.abrupt("return");case 24:this.consumeFull(n,t);return _context69.abrupt("return");case 26:_context69.next=28;return this.removeNode(t);case 28:return _context69.abrupt("return");case 29:_context69.next=31;return this.checkTextActive(t);case 31:return _context69.abrupt("return");case 32:_context69.next=34;return this.cursorHover(t);case 34:return _context69.abrupt("return");case 35:_context69.next=37;return this.cursorBlur();case 37:return _context69.abrupt("return");case 38:_context69.next=40;return _get(_getPrototypeOf(fv.prototype),"on",this).call(this,t);case 40:case"end":return _context69.stop();}},_callee66,this);}));function on(_x108){return _on2.apply(this,arguments);}return on;}()},{key:"removeNode",value:function(){var _removeNode2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee67(t){var _this100=this;var e,n,i,a,o,_iterator52,_step52,s;return _regeneratorRuntime().wrap(function _callee67$(_context70){while(1)switch(_context70.prev=_context70.next){case 0:e=t.dataType,n=t.workId,i=t.removeIds,a=[],o=i||[];if(!(n&&o.push(n.toString()),o.length)){_context70.next=6;break;}_iterator52=_createForOfIteratorHelper(o);try{for(_iterator52.s();!(_step52=_iterator52.n()).done;){s=_step52.value;s===Nt?a.push(this.localWork.removeSelector(t)):e===Tt.Local?a.push(this.localWork.removeWork(t).then(function(){_this100.localWork.colloctEffectSelectWork(t);})):e===Tt.Service&&a.push(this.serviceWork.removeWork(t).then(function(){_this100.localWork.colloctEffectSelectWork(t);}));}}catch(err){_iterator52.e(err);}finally{_iterator52.f();}_context70.next=6;return Promise.all(a);case 6:case"end":return _context70.stop();}},_callee67,this);}));function removeNode(_x109){return _removeNode2.apply(this,arguments);}return removeNode;}()},{key:"checkTextActive",value:function(){var _checkTextActive2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee68(t){var e;return _regeneratorRuntime().wrap(function _callee68$(_context71){while(1)switch(_context71.prev=_context71.next){case 0:e=t.dataType;_context71.t0=e===Tt.Local;if(!_context71.t0){_context71.next=5;break;}_context71.next=5;return this.localWork.checkTextActive(t);case 5:case"end":return _context71.stop();}},_callee68,this);}));function checkTextActive(_x110){return _checkTextActive2.apply(this,arguments);}return checkTextActive;}()},{key:"clearAll",value:function(){var _clearAll2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee69(){return _regeneratorRuntime().wrap(function _callee69$(_context72){while(1)switch(_context72.prev=_context72.next){case 0:this.vNodes.clear();_get(_getPrototypeOf(fv.prototype),"clearAll",this).call(this);this.localDrawLayer&&(this.localDrawLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),this.localDrawLayer.removeAllChildren());this.serviceDrawLayer&&(this.serviceDrawLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),this.serviceDrawLayer.removeAllChildren());_context72.next=6;return this.post({render:[{isClearAll:!0,clearCanvas:xt.Bg,viewId:this.viewId},{isClearAll:!0,clearCanvas:xt.ServiceFloat,viewId:this.viewId},{isClearAll:!0,clearCanvas:xt.Float,viewId:this.viewId}],sp:[{type:ft.Clear}]});case 6:case"end":return _context72.stop();}},_callee69,this);}));function clearAll(){return _clearAll2.apply(this,arguments);}return clearAll;}()},{key:"updateLayer",value:function updateLayer(t){var e=t.width,n=t.height;_get(_getPrototypeOf(fv.prototype),"updateLayer",this).call(this,t),this.localDrawLayer&&(this.localDrawLayer.parent.setAttribute("width",e),this.localDrawLayer.parent.setAttribute("height",n),this.localDrawLayer.setAttribute("size",[e,n]),this.localDrawLayer.setAttribute("pos",[e*0.5,n*0.5])),this.serviceDrawLayer&&(this.serviceDrawLayer.parent.setAttribute("width",e),this.serviceDrawLayer.parent.setAttribute("height",n),this.serviceDrawLayer.setAttribute("size",[e,n]),this.serviceDrawLayer.setAttribute("pos",[e*0.5,n*0.5]));}},{key:"setCameraOpt",value:function setCameraOpt(t){this.cameraOpt=t;var e=t.scale,n=t.centerX,i=t.centerY,a=t.width,o=t.height;(a!==this.scene.width||o!==this.scene.height)&&this.updateScene({width:a,height:o}),this.fullLayer&&(this.fullLayer.setAttribute("scale",[e,e]),this.fullLayer.setAttribute("translate",[-n,-i])),this.localDrawLayer&&(this.localDrawLayer.setAttribute("scale",[e,e]),this.localDrawLayer.setAttribute("translate",[-n,-i])),this.serviceDrawLayer&&(this.serviceDrawLayer.setAttribute("scale",[e,e]),this.serviceDrawLayer.setAttribute("translate",[-n,-i]));}},{key:"getLayer",value:function getLayer(t){switch(t){case xt.Bg:return this.fullLayer;case xt.ServiceFloat:return this.serviceDrawLayer;case xt.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 _callee70(t,e){var n;return _regeneratorRuntime().wrap(function _callee70$(_context73){while(1)switch(_context73.prev=_context73.next){case 0:_context73.next=2;return this.localWork.colloctEffectSelectWork(e);case 2:n=_context73.sent;_context73.t0=n&&t===Tt.Local;if(!_context73.t0){_context73.next=7;break;}_context73.next=7;return this.localWork.consumeFull(n,this.scene);case 7:n&&t===Tt.Service&&this.serviceWork.consumeFull(n);case 8:case"end":return _context73.stop();}},_callee70,this);}));function consumeFull(_x111,_x112){return _consumeFull2.apply(this,arguments);}return consumeFull;}()},{key:"consumeDraw",value:function(){var _consumeDraw4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee71(t,e){var n;return _regeneratorRuntime().wrap(function _callee71$(_context74){while(1)switch(_context74.prev=_context74.next){case 0:n=e.workId;_context74.t0=t===Tt.Local&&n;if(!_context74.t0){_context74.next=6;break;}this.localWork.getWorkShape(n.toString())||this.createLocalWork(e);_context74.next=6;return this.localWork.consumeDraw(e,this.serviceWork);case 6:t===Tt.Service&&this.serviceWork.consumeDraw(e);case 7:case"end":return _context74.stop();}},_callee71,this);}));function consumeDraw(_x113,_x114){return _consumeDraw4.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee72(t,e){var n;return _regeneratorRuntime().wrap(function _callee72$(_context75){while(1)switch(_context75.prev=_context75.next){case 0:n=e.workId;_context75.t0=t===Tt.Local&&n;if(!_context75.t0){_context75.next=6;break;}this.localWork.getWorkShape(n.toString())||this.createLocalWork(e);_context75.next=6;return this.localWork.consumeDrawAll(e,this.serviceWork);case 6:case"end":return _context75.stop();}},_callee72,this);}));function consumeDrawAll(_x115,_x116){return _consumeDrawAll3.apply(this,arguments);}return consumeDrawAll;}()},{key:"updateCamera",value:function(){var _updateCamera=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee73(t){var _this101=this;var a,e,n,i,o,v,_iterator53,_step53,_step53$value,y,M,s,_iterator54,_step54,_step54$value,_v7,_y18,_M8,c,p,_v3,_iterator55,_step55,_y14,h,_iterator56,_step56,_v4,_y15,_iterator57,_step57,_M5,_iterator58,_step58,_step58$value,_v6,_y17,_M7,T,m,_x119,_l34,d,f,g,O,_iterator59,_step59,_step59$value,_v5,_y16;return _regeneratorRuntime().wrap(function _callee73$(_context76){while(1)switch(_context76.prev=_context76.next){case 0:e=[],n=t.cameraOpt,i=t.scenePath;if(!(n&&!fe(this.cameraOpt,n))){_context76.next=37;break;}this.taskUpdateCameraId&&(clearTimeout(this.taskUpdateCameraId),this.taskUpdateCameraId=void 0);o=!!this.serviceDrawLayer.children.length;if(!i){_context76.next=27;break;}v=!1;_iterator53=_createForOfIteratorHelper(this.localWork.getWorkShapes().entries());_context76.prev=7;_iterator53.s();case 9:if((_step53=_iterator53.n()).done){_context76.next=16;break;}_step53$value=_slicedToArray(_step53.value,2),y=_step53$value[0],M=_step53$value[1];if(!(M.toolsType!==gt.Text&&M.toolsType!==gt.Eraser&&M.toolsType!==gt.Selector&&M.toolsType!==gt.LaserPen&&y!==be&&y!==Nt)){_context76.next=14;break;}v=!0;return _context76.abrupt("break",16);case 14:_context76.next=9;break;case 16:_context76.next=21;break;case 18:_context76.prev=18;_context76.t0=_context76["catch"](7);_iterator53.e(_context76.t0);case 21:_context76.prev=21;_iterator53.f();return _context76.finish(21);case 24:if(!v){_context76.next=27;break;}this.taskUpdateCameraId=setTimeout(function(){_this101.taskUpdateCameraId=void 0,_this101.updateCamera(t);},Sn);return _context76.abrupt("return");case 27:s=/* @__PURE__ */new Map();_iterator54=_createForOfIteratorHelper(this.vNodes.getNodesByType(gt.Text).entries());try{for(_iterator54.s();!(_step54=_iterator54.n()).done;){_step54$value=_slicedToArray(_step54.value,2),_v7=_step54$value[0],_y18=_step54$value[1];_M8=_y18.rect;s.set(_v7,Xt(_M8));}}catch(err){_iterator54.e(err);}finally{_iterator54.f();}c=new Set(s.keys());p=!1;if(this.localWork.hasSelector()){_v3=(a=this.localWork.getSelector())==null?void 0:a.selectIds;if(_v3){p=!0;_iterator55=_createForOfIteratorHelper(_v3);try{for(_iterator55.s();!(_step55=_iterator55.n()).done;){_y14=_step55.value;c.add(_y14);}}catch(err){_iterator55.e(err);}finally{_iterator55.f();}}}h=!1;if(this.serviceWork.selectorWorkShapes.size){_iterator56=_createForOfIteratorHelper(this.serviceWork.selectorWorkShapes.values());try{for(_iterator56.s();!(_step56=_iterator56.n()).done;){_v4=_step56.value;_y15=_v4.selectIds;if(_y15){h=!0;_iterator57=_createForOfIteratorHelper(_y15);try{for(_iterator57.s();!(_step57=_iterator57.n()).done;){_M5=_step57.value;c.add(_M5);}}catch(err){_iterator57.e(err);}finally{_iterator57.f();}}}}catch(err){_iterator56.e(err);}finally{_iterator56.f();}}if(this.setCameraOpt(n),this.vNodes.curNodeMap.size){this.vNodes.clearTarget(),this.vNodes.updateHighLevelNodesRect(c),this.debounceUpdateCameraId&&clearTimeout(this.debounceUpdateCameraId);_iterator58=_createForOfIteratorHelper(s.entries());try{for(_iterator58.s();!(_step58=_iterator58.n()).done;){_step58$value=_slicedToArray(_step58.value,2),_v6=_step58$value[0],_y17=_step58$value[1];_M7=this.vNodes.get(_v6);if(_M7){T=_y17,m=_M7.rect,_x119=this.getSceneRect(),_l34=or(T,_x119),d=or(m,_x119);f=!1;if((_l34!==d||T.w!==m.w||T.h!==m.h||d===Te.intersect)&&(f=!0),f){g=_M7.toolsType,O=_M7.opt;g===gt.Text&&O.workState===It.Done&&this.debounceUpdateCache.add(_v6);}}}}catch(err){_iterator58.e(err);}finally{_iterator58.f();}if(p&&this.localWork.reRenderSelector(),h){_iterator59=_createForOfIteratorHelper(this.serviceWork.selectorWorkShapes.entries());try{for(_iterator59.s();!(_step59=_iterator59.n()).done;){_step59$value=_slicedToArray(_step59.value,2),_v5=_step59$value[0],_y16=_step59$value[1];this.serviceWork.runSelectWork({workId:_v5,selectIds:_y16.selectIds,msgType:ft.Select,dataType:Tt.Service,viewId:this.viewId});}}catch(err){_iterator59.e(err);}finally{_iterator59.f();}}this.debounceUpdateCameraId=setTimeout(function(){var y;_this101.debounceUpdateCameraId=void 0;var v=[];var _iterator60=_createForOfIteratorHelper(_this101.debounceUpdateCache.values()),_step60;try{for(_iterator60.s();!(_step60=_iterator60.n()).done;){var _M6=_step60.value;if((y=_this101.fullLayer)==null?void 0:y.getElementsByName(_M6)[0]){var m=_this101.vNodes.get(_M6);if(m){var _x118=m.toolsType,_l33=m.opt,d=m.rect,f=_this101.localWork.setFullWork({toolsType:_x118,opt:_l33,workId:_M6});if(f){var g=_this101.getSceneRect(),O=or(d,g);v.push(f.consumeServiceAsync({isFullWork:!0,replaceId:_M6,isDrawLabel:O!==Te.outside}));}}}_this101.debounceUpdateCache["delete"](_M6);}}catch(err){_iterator60.e(err);}finally{_iterator60.f();}v.length?Promise.all(v).then(function(){var M=[];M.push({isClearAll:!0,clearCanvas:xt.Bg,viewId:_this101.viewId},{isDrawAll:!0,drawCanvas:xt.Bg,viewId:_this101.viewId}),M.length&&_this101.post({render:M}),_this101.vNodes.updateLowLevelNodesRect(),_this101.vNodes.clearHighLevelIds();}):(_this101.vNodes.updateLowLevelNodesRect(),_this101.vNodes.clearHighLevelIds());},Sn);}o&&e.push({isClearAll:!0,clearCanvas:xt.ServiceFloat,viewId:this.viewId}),this.vNodes.hasRenderNodes()&&e.push({isClearAll:!0,clearCanvas:xt.Bg,viewId:this.viewId},{isDrawAll:!0,drawCanvas:xt.Bg,viewId:this.viewId}),e.length&&this.post({render:e});case 37:case"end":return _context76.stop();}},_callee73,this,[[7,18,21,24]]);}));function updateCamera(_x117){return _updateCamera.apply(this,arguments);}return updateCamera;}()},{key:"getRectImageBitmap",value:function getRectImageBitmap(t){var e=t.rect,n=t.drawCanvas,i=Math.floor(e.x*this.dpr),a=Math.floor(e.y*this.dpr),o=Math.floor(e.w*this.dpr||1),s=Math.floor(e.h*this.dpr||1);return createImageBitmap(this.getOffscreen(n),i,a,o,s,{resizeQuality:"low"});}},{key:"cursorHover",value:function(){var _cursorHover2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee74(t){return _regeneratorRuntime().wrap(function _callee74$(_context77){while(1)switch(_context77.prev=_context77.next){case 0:_context77.next=2;return this.localWork.cursorHover(t);case 2:case"end":return _context77.stop();}},_callee74,this);}));function cursorHover(_x120){return _cursorHover2.apply(this,arguments);}return cursorHover;}()},{key:"cursorBlur",value:function(){var _cursorBlur2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee75(){return _regeneratorRuntime().wrap(function _callee75$(_context78){while(1)switch(_context78.prev=_context78.next){case 0:_context78.next=2;return this.localWork.cursorBlur();case 2:case"end":return _context78.stop();}},_callee75,this);}));function cursorBlur(){return _cursorBlur2.apply(this,arguments);}return cursorBlur;}()}]);}(Si);var uv=/*#__PURE__*/function(_Si2){function uv(t,e,n){var _this102;_classCallCheck(this,uv);_this102=_callSuper(this,uv,[t,e,"sub"/* Sub */]);rt(_this102,"type","sub");rt(_this102,"_post");rt(_this102,"topLayer");rt(_this102,"snapshotFullLayer");rt(_this102,"serviceWork");rt(_this102,"localWork");rt(_this102,"topLayerWork");_this102._post=n;var i=ne.bufferSize.sub;_this102.topLayer=_this102.createLayer("topLayer",_this102.scene,_objectSpread(_objectSpread({},e.layerOpt),{},{bufferSize:i}));var a={thread:_this102,viewId:_this102.viewId,vNodes:_this102.vNodes,fullLayer:_this102.fullLayer,topLayer:_this102.topLayer};_this102.localWork=new av(a),_this102.topLayerWork=new lv(a),_this102.vNodes.init(_this102.fullLayer);return _this102;}_inherits(uv,_Si2);return _createClass(uv,[{key:"combinePost",value:function(){var _combinePost2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee76(){var _this103=this;var a,o,s,_this$combinePostData2,t,e,n,c,_iterator61,_step61,p,h,_iterator62,_step62,_c7,i;return _regeneratorRuntime().wrap(function _callee76$(_context79){while(1)switch(_context79.prev=_context79.next){case 0:_this$combinePostData2=this.combinePostData(),t=_this$combinePostData2.render,e=_objectWithoutProperties(_this$combinePostData2,_excluded4);if(!(t!=null&&t.length)){_context79.next=28;break;}c=[];_iterator61=_createForOfIteratorHelper(t);_context79.prev=4;_iterator61.s();case 6:if((_step61=_iterator61.n()).done){_context79.next=19;break;}p=_step61.value;if(!p.rect){_context79.next=17;break;}if(!(p.rect=this.safariFixRect(Xt(p.rect)),!p.rect)){_context79.next=11;break;}return _context79.abrupt("continue",17);case 11:if(!(p.drawCanvas&&p.rect&&p.rect.w>0&&p.rect.h>0)){_context79.next=16;break;}_context79.next=14;return this.getRectImageBitmap(p);case 14:h=_context79.sent;p.imageBitmap=h,n||(n=[]),n.push(h);case 16:c.push(p);case 17:_context79.next=6;break;case 19:_context79.next=24;break;case 21:_context79.prev=21;_context79.t0=_context79["catch"](4);_iterator61.e(_context79.t0);case 24:_context79.prev=24;_iterator61.f();return _context79.finish(24);case 27:e.render=c;case 28:if((a=e.workIds)!=null&&a.size&&e.drawCount){_iterator62=_createForOfIteratorHelper(e.workIds.values());try{for(_iterator62.s();!(_step62=_iterator62.n()).done;){_c7=_step62.value;this.fullLayer.getElementsByName(_c7).forEach(function(p){p.id&&e.drawCount&&Number(p.id)<e.drawCount&&p.remove();});}}catch(err){_iterator62.e(err);}finally{_iterator62.f();}}i=(o=e.sp)==null?void 0:o.filter(function(c){return c.type!==ft.None;});i!=null&&i.length?e.sp=i.map(function(c){return _objectSpread(_objectSpread({},c),{},{viewId:_this103.viewId});}):delete e.sp,e.drawCount===void 0&&delete e.drawCount,(i!=null&&i.length||e.drawCount||(s=e==null?void 0:e.render)!=null&&s.length)&&this._post(e,n),this.delayPostDoneResolve&&this.delayPostDoneResolve(!0);case 31:case"end":return _context79.stop();}},_callee76,this,[[4,21,24,27]]);}));function combinePost(){return _combinePost2.apply(this,arguments);}return combinePost;}()},{key:"getLayer",value:function getLayer(t,e){if(e&&this.snapshotFullLayer)return this.snapshotFullLayer;switch(t){case xt.TopFloat:return this.topLayer;default:return this.fullLayer;}}},{key:"on",value:function(){var _on3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee77(t){var e,n,i,a,o,s;return _regeneratorRuntime().wrap(function _callee77$(_context80){while(1)switch(_context80.prev=_context80.next){case 0:e=t.msgType,n=t.toolsType,i=t.opt,a=t.dataType,o=t.workState;_context80.t0=e;_context80.next=_context80.t0===ft.UpdateTools?4:_context80.t0===ft.CreateWork?9:_context80.t0===ft.DrawWork?11:_context80.t0===ft.RemoveNode?18:_context80.t0===ft.FullWork?21:_context80.t0===ft.Snapshot?26:_context80.t0===ft.BoundingBox?33:40;break;case 4:if(!(n&&this.topLayerWork.canUseTopLayer(n)&&i)){_context80.next=8;break;}s={toolsType:n,toolsOpt:i};this.topLayerWork.setToolsOpt(s);return _context80.abrupt("return");case 8:return _context80.abrupt("break",40);case 9:this.createLocalWork(t);return _context80.abrupt("return");case 11:if(!(o===It.Done&&a===Tt.Local)){_context80.next=16;break;}_context80.next=14;return this.consumeDrawAll(a,t);case 14:_context80.next=17;break;case 16:this.consumeDraw(a,t);case 17:return _context80.abrupt("return");case 18:_context80.next=20;return this.removeNode(t);case 20:return _context80.abrupt("return");case 21:_context80.t1=n&&this.topLayerWork.canUseTopLayer(n);if(!_context80.t1){_context80.next=25;break;}_context80.next=25;return this.consumeDrawAll(a,t);case 25:return _context80.abrupt("return");case 26:this.snapshotFullLayer=this.createLayer("snapshotFullLayer",this.scene,_objectSpread(_objectSpread({},this.opt.layerOpt),{},{bufferSize:this.viewId===Xe?6e3:3e3}));_context80.t2=this.snapshotFullLayer;if(!_context80.t2){_context80.next=32;break;}_context80.next=31;return this.getSnapshot(t);case 31:this.snapshotFullLayer=void 0;case 32:return _context80.abrupt("return");case 33:this.snapshotFullLayer=this.createLayer("snapshotFullLayer",this.scene,_objectSpread(_objectSpread({},this.opt.layerOpt),{},{bufferSize:this.viewId===Xe?6e3:3e3}));_context80.t3=this.snapshotFullLayer;if(!_context80.t3){_context80.next=39;break;}_context80.next=38;return this.getBoundingRect(t);case 38:this.snapshotFullLayer=void 0;case 39:return _context80.abrupt("return");case 40:_context80.next=42;return _get(_getPrototypeOf(uv.prototype),"on",this).call(this,t);case 42:case"end":return _context80.stop();}},_callee77,this);}));function on(_x121){return _on3.apply(this,arguments);}return on;}()},{key:"createLocalWork",value:function createLocalWork(t){var e=t.workId,n=t.toolsType,i=t.opt;if(n&&this.topLayerWork.canUseTopLayer(n)&&e&&i){this.topLayerWork.getToolsOpt()||this.topLayerWork.setToolsOpt({toolsType:n,toolsOpt:i}),this.topLayerWork.setWorkOptions(e.toString(),i);return;}_get(_getPrototypeOf(uv.prototype),"createLocalWork",this).call(this,t);}},{key:"removeNode",value:function(){var _removeNode3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee78(t){var e;return _regeneratorRuntime().wrap(function _callee78$(_context81){while(1)switch(_context81.prev=_context81.next){case 0:e=t.dataType;_context81.t0=e===Tt.Local;if(!_context81.t0){_context81.next=5;break;}_context81.next=5;return this.localWork.removeWork(t);case 5:case"end":return _context81.stop();}},_callee78,this);}));function removeNode(_x122){return _removeNode3.apply(this,arguments);}return removeNode;}()},{key:"getOffscreen",value:function getOffscreen(t,e){return this.getLayer(t,e).parent.canvas;}},{key:"consumeDraw",value:function(){var _consumeDraw5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee79(t,e){var n,i;return _regeneratorRuntime().wrap(function _callee79$(_context82){while(1)switch(_context82.prev=_context82.next){case 0:n=e.workId,i=e.toolsType;if(!n){_context82.next=9;break;}if(!(i&&this.topLayerWork.canUseTopLayer(i))){_context82.next=5;break;}t===Tt.Local&&(this.topLayerWork.getWorkShape(n.toString())||this.createLocalWork(e)),this.topLayerWork.consumeDraw(e);return _context82.abrupt("return");case 5:this.localWork.getWorkShape(n.toString())||this.createLocalWork(e);_context82.next=8;return this.localWork.consumeDraw(e);case 8:return _context82.abrupt("return");case 9:case"end":return _context82.stop();}},_callee79,this);}));function consumeDraw(_x123,_x124){return _consumeDraw5.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee80(t,e){var n,i,a,o;return _regeneratorRuntime().wrap(function _callee80$(_context83){while(1)switch(_context83.prev=_context83.next){case 0:n=e.workId,i=e.toolsType,a=e.dataType;if(!n){_context83.next=8;break;}o=n.toString();if(!(i&&this.topLayerWork.canUseTopLayer(i))){_context83.next=6;break;}a===Tt.Local&&(this.topLayerWork.getWorkShape(o)||this.createLocalWork(e)),this.topLayerWork.consumeDrawAll(e);return _context83.abrupt("return");case 6:this.localWork.getWorkShape(o)||_get(_getPrototypeOf(uv.prototype),"createLocalWork",this).call(this,e),this.localWork.consumeDrawAll(e);return _context83.abrupt("return");case 8:case"end":return _context83.stop();}},_callee80,this);}));function consumeDrawAll(_x125,_x126){return _consumeDrawAll4.apply(this,arguments);}return consumeDrawAll;}()},{key:"clearAll",value:function(){var _clearAll3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee81(){return _regeneratorRuntime().wrap(function _callee81$(_context84){while(1)switch(_context84.prev=_context84.next){case 0:this.vNodes.clear();_get(_getPrototypeOf(uv.prototype),"clearAll",this).call(this);this.topLayer&&(this.topLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),this.topLayer.removeAllChildren());_context84.next=5;return this.post({render:[{isClearAll:!0,clearCanvas:xt.TopFloat,viewId:this.viewId}],sp:[{type:ft.Clear}]});case 5:case"end":return _context84.stop();}},_callee81,this);}));function clearAll(){return _clearAll3.apply(this,arguments);}return clearAll;}()},{key:"getRectImageBitmap",value:function getRectImageBitmap(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;var n=arguments.length>2?arguments[2]:undefined;var i=t.rect,a=t.drawCanvas,o=Math.floor(i.x*this.dpr),s=Math.floor(i.y*this.dpr),c=Math.floor(i.w*this.dpr||1),p=Math.floor(i.h*this.dpr||1);return createImageBitmap(this.getOffscreen(a,e),o,s,c,p,n);}},{key:"updateLayer",value:function updateLayer(t){var e=t.width,n=t.height;_get(_getPrototypeOf(uv.prototype),"updateLayer",this).call(this,t),this.topLayer&&(this.topLayer.parent.setAttribute("width",e),this.topLayer.parent.setAttribute("height",n),this.topLayer.setAttribute("size",[e,n]),this.topLayer.setAttribute("pos",[e*0.5,n*0.5])),this.snapshotFullLayer&&(this.snapshotFullLayer.parent.setAttribute("width",e),this.snapshotFullLayer.parent.setAttribute("height",n),this.snapshotFullLayer.setAttribute("size",[e,n]),this.snapshotFullLayer.setAttribute("pos",[e*0.5,n*0.5]));}},{key:"updateCamera",value:function(){var _updateCamera2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee82(t){var _this104=this;var e,n,i,a,_iterator63,_step63,_loop7;return _regeneratorRuntime().wrap(function _callee82$(_context86){while(1)switch(_context86.prev=_context86.next){case 0:e=[],n=t.cameraOpt;if(!(n&&!fe(this.cameraOpt,n))){_context86.next=25;break;}i=!!this.topLayerWork.localWorkShapes.size,a=!!this.localWork.getWorkShapes().size;if(!(a&&this.localWork.workShapesDone(),this.setCameraOpt(n),a&&e.push({isClearAll:!0,clearCanvas:xt.Float,viewId:this.viewId}),i)){_context86.next=21;break;}e.push({isClearAll:!0,clearCanvas:xt.TopFloat,viewId:this.viewId});_iterator63=_createForOfIteratorHelper(this.topLayerWork.localWorkShapes.entries());_context86.prev=6;_loop7=/*#__PURE__*/_regeneratorRuntime().mark(function _loop7(){var _step63$value,o,s,c;return _regeneratorRuntime().wrap(function _loop7$(_context85){while(1)switch(_context85.prev=_context85.next){case 0:_step63$value=_slicedToArray(_step63.value,2),o=_step63$value[0],s=_step63$value[1];if(s.totalRect){_this104.topLayer.getElementsByName(o.toString()).forEach(function(p){var h=p.getBoundingClientRect(),v=wt({x:h.x,y:h.y,w:h.width,h:h.height});c=Ot(c,v);}),s.totalRect=c,_this104.topLayerWork.localWorkShapes.set(o,s);}case 2:case"end":return _context85.stop();}},_loop7);});_iterator63.s();case 9:if((_step63=_iterator63.n()).done){_context86.next=13;break;}return _context86.delegateYield(_loop7(),"t0",11);case 11:_context86.next=9;break;case 13:_context86.next=18;break;case 15:_context86.prev=15;_context86.t1=_context86["catch"](6);_iterator63.e(_context86.t1);case 18:_context86.prev=18;_iterator63.f();return _context86.finish(18);case 21:_context86.t2=e.length;if(!_context86.t2){_context86.next=25;break;}_context86.next=25;return this.post({render:e});case 25:case"end":return _context86.stop();}},_callee82,this,[[6,15,18,21]]);}));function updateCamera(_x127){return _updateCamera2.apply(this,arguments);}return updateCamera;}()},{key:"setCameraOpt",value:function setCameraOpt(t,e){this.cameraOpt=t;var n=t.scale,i=t.centerX,a=t.centerY,o=t.width,s=t.height;(o!==this.scene.width||s!==this.scene.height)&&this.updateScene({width:o,height:s}),e?(e.setAttribute("scale",[n,n]),e.setAttribute("translate",[-i,-a])):(this.fullLayer.setAttribute("scale",[n,n]),this.fullLayer.setAttribute("translate",[-i,-a]),this.topLayer.setAttribute("scale",[n,n]),this.topLayer.setAttribute("translate",[-i,-a]));}},{key:"getSnapshot",value:function(){var _getSnapshot=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee83(t){var e,n,i,a,o,s,c,_i4,_Object$entries,_Object$entries$_i,h,v,y,M,p;return _regeneratorRuntime().wrap(function _callee83$(_context87){while(1)switch(_context87.prev=_context87.next){case 0:e=t.scenePath,n=t.scenes,i=t.cameraOpt,a=t.w,o=t.h;if(!(e&&n&&i&&this.snapshotFullLayer)){_context87.next=25;break;}s=Xt(this.cameraOpt);this.setCameraOpt(i,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)){_context87.next=20;break;}_Object$entries$_i=_slicedToArray(_Object$entries[_i4],2),h=_Object$entries$_i[0],v=_Object$entries$_i[1];if(!(v!=null&&v.type)){_context87.next=17;break;}_context87.t0=v==null?void 0:v.type;_context87.next=_context87.t0===ft.UpdateNode?11:_context87.t0===ft.FullWork?11:17;break;case 11:y=v.opt;_context87.next=14;return this.localWork.runFullWork(_objectSpread(_objectSpread({},v),{},{opt:y,workId:h,msgType:ft.FullWork,dataType:Tt.Service,viewId:this.viewId}));case 14:M=_context87.sent;c=Ot(c,M);return _context87.abrupt("break",17);case 17:_i4++;_context87.next=5;break;case 20:a&&o&&(p={resizeWidth:a,resizeHeight:o});_context87.next=23;return this.getSnapshotRender({scenePath:e,curCameraOpt:s,options:p});case 23:this.localWork.fullLayer=this.fullLayer;this.localWork.drawLayer=void 0;case 25:case"end":return _context87.stop();}},_callee83,this);}));function getSnapshot(_x128){return _getSnapshot.apply(this,arguments);}return getSnapshot;}()},{key:"getSnapshotRender",value:function(){var _getSnapshotRender=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee84(t){var o,s,e,n,i,a;return _regeneratorRuntime().wrap(function _callee84$(_context88){while(1)switch(_context88.prev=_context88.next){case 0:e=t.scenePath,n=t.curCameraOpt,i=t.options;((o=this.snapshotFullLayer)==null?void 0:o.parent).render();_context88.next=4;return this.getRectImageBitmap({rect:this.getSceneRect(),drawCanvas:xt.None},!0,i);case 4:a=_context88.sent;a&&(this._post({sp:[{type:ft.Snapshot,scenePath:e,imageBitmap:a,viewId:this.viewId}]},[a]),a.close(),(s=this.snapshotFullLayer)==null||s.removeAllChildren(),this.setCameraOpt(n,this.fullLayer));case 6:case"end":return _context88.stop();}},_callee84,this);}));function getSnapshotRender(_x129){return _getSnapshotRender.apply(this,arguments);}return getSnapshotRender;}()},{key:"getBoundingRect",value:function(){var _getBoundingRect=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee85(t){var e,n,i,a,o,_i5,_Object$entries2,_Object$entries2$_i,s,c,p;return _regeneratorRuntime().wrap(function _callee85$(_context89){while(1)switch(_context89.prev=_context89.next){case 0:e=t.scenePath,n=t.scenes,i=t.cameraOpt;if(!(e&&n&&i&&this.snapshotFullLayer)){_context89.next=27;break;}a=Xt(this.cameraOpt);this.setCameraOpt(i,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)){_context89.next=19;break;}_Object$entries2$_i=_slicedToArray(_Object$entries2[_i5],2),s=_Object$entries2$_i[0],c=_Object$entries2$_i[1];if(!(c!=null&&c.type)){_context89.next=16;break;}_context89.t0=c==null?void 0:c.type;_context89.next=_context89.t0===ft.UpdateNode?11:_context89.t0===ft.FullWork?11:16;break;case 11:_context89.next=13;return this.localWork.runFullWork(_objectSpread(_objectSpread({},c),{},{workId:s,msgType:ft.FullWork,dataType:Tt.Service,viewId:this.viewId}));case 13:p=_context89.sent;o=Ot(o,p);return _context89.abrupt("break",16);case 16:_i5++;_context89.next=5;break;case 19:_context89.t1=o;if(!_context89.t1){_context89.next=23;break;}_context89.next=23;return this.post({sp:[{type:ft.BoundingBox,scenePath:e,rect:o}]});case 23:this.localWork.fullLayer=this.fullLayer;this.localWork.drawLayer=void 0;this.snapshotFullLayer.removeAllChildren();this.setCameraOpt(a,this.fullLayer);case 27:case"end":return _context89.stop();}},_callee85,this);}));function getBoundingRect(_x130){return _getBoundingRect.apply(this,arguments);}return getBoundingRect;}()}]);}(Si);var Rn=self;Rn.full=new cv(Rn,Je.Full);
|