ice-entity-designer 0.0.13 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -4
- package/dist/index.cjs.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/types/er-component/Entity.d.ts +13 -5
- package/package.json +2 -2
package/dist/index.umd.js
CHANGED
|
@@ -22,4 +22,4 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).IED={})}(this,function(x){"use strict";function ownKeys$1(e,t){var n,i=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)),i}function _objectSpread2$1(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$1(Object(n),!0).forEach(function(t){_defineProperty$2(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys$1(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _classCallCheck$1(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties$1(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function _createClass$1(t,e,n){e&&_defineProperties$1(t.prototype,e),n&&_defineProperties$1(t,n),Object.defineProperty(t,"prototype",{writable:!1})}function _defineProperty$2(t,e,n){e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}function _inherits$1(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$1(t,e)}function _getPrototypeOf$1(t){return(_getPrototypeOf$1=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function _setPrototypeOf$1(t,e){return(_setPrototypeOf$1=Object.setPrototypeOf||function _setPrototypeOf(t,e){return t.__proto__=e,t})(t,e)}function _assertThisInitialized$1(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _createSuper$1(n){var i=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function _createSuperInternal(){var t,e=_getPrototypeOf$1(n);return function _possibleConstructorReturn$1(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$1(t)}(this,i?(t=_getPrototypeOf$1(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function _get$1(){return(_get$1="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(t,e,n){var i=function _superPropBase$1(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=_getPrototypeOf$1(t)););return t}(t,e);if(i)return(i=Object.getOwnPropertyDescriptor(i,e)).get?i.get.call(arguments.length<3?t:n):i.value}).apply(this,arguments)}function _arrayLikeToArray$1(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function ownKeys(e,t){var n,i=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)),i}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(n),!0).forEach(function(t){_defineProperty$1(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function _createClass(t,e,n){return e&&_defineProperties(t.prototype,e),n&&_defineProperties(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function _defineProperty$1(t,e,n){e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}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&&function _setPrototypeOf(t,e){(Object.setPrototypeOf||function _setPrototypeOf(t,e){return t.__proto__=e,t})(t,e)}(t,e)}function _getPrototypeOf(t){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _createSuper(n){var i=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function _createSuperInternal(){var t,e=_getPrototypeOf(n);return 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)}(this,i?(t=_getPrototypeOf(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function _get(){return(_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(t,e,n){var i=function _superPropBase(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=_getPrototypeOf(t)););return t}(t,e);if(i)return(i=Object.getOwnPropertyDescriptor(i,e)).get?i.get.call(arguments.length<3?t:n):i.value}).apply(this,arguments)}function _toConsumableArray(t){return function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}(t)||function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(n="Object"===n&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(t,e):void 0}}(t)||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 _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function p(t){var e=E.call(t,O),n=t[O];try{var i=!(t[O]=void 0)}catch(t){}var r=S.call(t);return i&&(e?t[O]=n:delete t[O]),r}function q(t){return I.call(t)}function s(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":($&&$ in Object(t)?p:q)(t)}function u(t){return null!=t&&"object"==typeof t}function y(t){return"string"==typeof t||!A(t)&&B(t)&&"[object String]"==M(t)}function z(t){return void 0===t}function R(t,e){return t===e||t!=t&&e!=e}function T(t,e){for(var n=t.length;n--;)if(tt(t[n][0],e))return n;return-1}var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t="object"==typeof t&&t&&t.Object===Object&&t,e="object"==typeof self&&self&&self.Object===Object&&self,e=t||e||Function("return this")(),n=e.Symbol,i=Object.prototype,E=i.hasOwnProperty,S=i.toString,O=n?n.toStringTag:void 0,I=Object.prototype.toString,$=n?n.toStringTag:void 0,i=Array.isArray,M=s,A=i,B=u,L="ICE_FRAME_EVENT",N="BEFORE_RENDER",D="AFTER_RENDER",H="BEFORE_ADD",V="AFTER_ADD",F="BEFORE_REMOVE",U="ROUND_FINISH",W="HOOK_MOUSEDOWN",G="HOOK_MOUSEMOVE",X="HOOK_MOUSEUP",J="BEFORE_RESIZE",c="AFTER_RESIZE",K="AFTER_ROTATE",Q="AFTER_MOVE",Z={linear:function linear(t,e,n,i){return t+(e-t)/n*(Date.now()-i)},easeInQuad:function easeInQuad(t,e,n,i){return t+(e-t)/n*((i=Date.now()-i)/n)*i},easeOutQuad:function easeOutQuad(t,e,n,i){return i=Date.now()-i,-(e-t)*(i/=n)*(i-2)+t},easeInOutQuad:function easeInOutQuad(t,e,n,i){return i=Date.now()-i,e-=t,(i/=n/2)<1?e/2*i*i+t:-e/2*(--i*(i-2)-1)+t},easeInQuart:function easeInQuart(t,e,n,i){return i=Date.now()-i,(e-t)*(i/=n)*i*i*i+t},easeOutQuart:function easeOutQuart(t,e,n,i){return-(e-t)*((e=(Date.now()-i)/n-1)*e*e*e-1)+t},easeInOutQuart:function easeInOutQuart(t,e,n,i){return i=Date.now()-i,e-=t,(i/=n/2)<1?e/2*i*i*i*i+t:-e/2*((i-=2)*i*i*i-2)+t},easeInCubic:function easeInCubic(t,e,n,i){return i=Date.now()-i,(e-t)*(i/=n)*i*i+t},easeOutCubic:function easeOutCubic(t,e,n,i){return(e-t)*((e=(Date.now()-i)/n-1)*e*e+1)+t},easeInOutCubic:function easeInOutCubic(t,e,n,i){return i=Date.now()-i,e-=t,(i/=n/2)<1?e/2*i*i*i+t:e/2*((i-=2)*i*i+2)+t}},Y=(_createClass(AnimationManager,[{key:"start",value:function start(){return this.ice.evtBus.on(L,this.frameEventHandler,this),this}},{key:"stop",value:function stop(){return this.ice.evtBus.off(L,this.frameEventHandler,this),this}},{key:"frameEventHandler",value:function frameEventHandler(t){for(var e=_toConsumableArray(this.animationMap.values()),n=0;n<e.length;n++){var i=e[n];i.state.interactive=!1,this.tween(i),i.state.interactive=!0}}},{key:"tween",value:function tween(t){var e,n={},i=t.props.animations,r=1;for(e in i){var o=i[e];if(o.finished){if(++r===Object.keys(i).length){this.remove(t);break}}else{var s=o.from,a=o.to,l=o.duration;a<(z(o.startTime)&&(o.startTime=Date.now()),z(o.easing)&&(o.easing="linear"),s=Z[o.easing](s,a,l,o.startTime))&&(s=a,o.finished=!0),n[e]=Math.floor(s)}}return t.setState(_objectSpread2({},n)),t}},{key:"add",value:function add(t){this.animationMap.set(t.props.id,t)}},{key:"remove",value:function remove(t){y(t)?this.animationMap.delete(t):this.animationMap.delete(t.props.id)}}]),AnimationManager),tt=R,et=T,nt=Array.prototype.splice,it=T,rt=T,ot=T;function AnimationManager(t){_classCallCheck(this,AnimationManager),_defineProperty$1(this,"animationMap",new Map),this.ice=t}function ListCache$4$1(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}ListCache$4$1.prototype.clear=function listCacheClear$1(){this.__data__=[],this.size=0},ListCache$4$1.prototype.delete=function listCacheDelete$1(t){var e=this.__data__;return!((t=et(e,t))<0||(t==e.length-1?e.pop():nt.call(e,t,1),--this.size,0))},ListCache$4$1.prototype.get=function listCacheGet$1(t){var e=this.__data__;return(t=it(e,t))<0?void 0:e[t][1]},ListCache$4$1.prototype.has=function listCacheHas$1(t){return-1<rt(this.__data__,t)},ListCache$4$1.prototype.set=function listCacheSet$1(t,e){var n=this.__data__,i=ot(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this};function ba(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ea(t){return!!lt(t)&&("[object Function]"==(t=at(t))||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t)}function ia(t){if(null!=t){try{return ht.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function ka(t){return!!ct&&ct in t}function ta(t,e){return function baseIsNative$1(t){return dt(t)&&!ka(t)&&(ut(t)?yt:ft).test(pt(t))}(t=function getValue$1(t,e){return null==t?void 0:t[e]}(t,e))?t:void 0}function Da(t){return t=this.has(t)&&delete this.__data__[t],this.size-=t?1:0,t}function Ea(t){var e,n=this.__data__;return gt?"__lodash_hash_undefined__"===(e=n[t])?void 0:e:mt.call(n,t)?n[t]:void 0}var r=ListCache$4$1,st=r,at=s,lt=ba,o=e["__core-js_shared__"],ct=(o=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+o:"",ht=Function.prototype.toString,ut=ea,dt=ba,pt=ia,ft=/^\[object .+?Constructor\]$/,o=Function.prototype,a=Object.prototype,o=o.toString,a=a.hasOwnProperty,yt=RegExp("^"+o.call(a).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),o=ta(e,"Map"),a=ta(Object,"create"),vt=a,gt=a,mt=Object.prototype.hasOwnProperty,bt=a,Ct=Object.prototype.hasOwnProperty,_t=a;function Hash$1$1(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}Hash$1$1.prototype.clear=function hashClear$1(){this.__data__=vt?vt(null):{},this.size=0},Hash$1$1.prototype.delete=Da,Hash$1$1.prototype.get=Ea,Hash$1$1.prototype.has=function hashHas$1(t){var e=this.__data__;return bt?void 0!==e[t]:Ct.call(e,t)},Hash$1$1.prototype.set=function hashSet$1(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=_t&&void 0===e?"__lodash_hash_undefined__":e,this};function Ia(t,e){return t=t.__data__,function isKeyable$1(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}(e)?t["string"==typeof e?"string":"hash"]:t.map}var kt=Hash$1$1,wt=r,Pt=o,xt=Ia,Et=Ia,St=Ia,Ot=Ia;function MapCache$1$1(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}MapCache$1$1.prototype.clear=function mapCacheClear$1(){this.size=0,this.__data__={hash:new kt,map:new(Pt||wt),string:new kt}},MapCache$1$1.prototype.delete=function mapCacheDelete$1(t){return t=xt(this,t).delete(t),this.size-=t?1:0,t},MapCache$1$1.prototype.get=function mapCacheGet$1(t){return Et(this,t).get(t)},MapCache$1$1.prototype.has=function mapCacheHas$1(t){return St(this,t).has(t)},MapCache$1$1.prototype.set=function mapCacheSet$1(t,e){var n=Ot(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this};function Sa(t){var e=this.__data__;return t=e.delete(t),this.size=e.size,t}function Ta(t){return this.__data__.get(t)}function Ua(t){return this.__data__.has(t)}var It=r,jt=o,$t=MapCache$1$1,Mt=r;function Stack$2(t){t=this.__data__=new Mt(t),this.size=t.size}Stack$2.prototype.clear=function stackClear$1(){this.__data__=new st,this.size=0},Stack$2.prototype.delete=Sa,Stack$2.prototype.get=Ta,Stack$2.prototype.has=Ua,Stack$2.prototype.set=function stackSet$1(t,e){var n=this.__data__;if(n instanceof It){var i=n.__data__;if(!jt||i.length<199)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new $t(i)}return n.set(t,e),this.size=n.size,this};function Za(t,e,n){"__proto__"==e&&zt?zt(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function a0(t,e,n){(void 0===n||Nt(t[e],n))&&(void 0!==n||e in t)||Rt(t,e,n)}function e0(t){var e=new t.constructor(t.byteLength);return new Ht(e).set(new Ht(t)),e}function g0(t,e){return e=e?Vt(t.buffer):t.buffer,new t.constructor(e,t.byteOffset,t.length)}function h0(t,e){var n=-1,i=t.length;for(e=e||Array(i);++n<i;)e[n]=t[n];return e}function l0(e,n){return function(t){return e(n(t))}}function o0(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||qt)}function s0(t){return"function"!=typeof t.constructor||Xt(t)?{}:Wt(Gt(t))}function v0(t){return Kt(t)&&"[object Arguments]"==Jt(t)}function B0(t){return"number"==typeof t&&-1<t&&t%1==0&&t<=9007199254740991}function E0(t){return null!=t&&ee(t.length)&&!te(t)}function V0(t){return ve(t)&&ye(t.length)&&!!m[pe(t)]}function W0(e){return function(t){return e(t)}}function bb(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}function fb(t,e,n){var i=t[e];Ce.call(t,e)&&be(i,n)&&(void 0!==n||e in t)||me(t,e,n)}function ib(t,e,n,i){var r=!n;n=n||{};for(var o=-1,s=e.length;++o<s;){var a=e[o],l=i?i(n[a],t[a],a,n,t):void 0;void 0===l&&(l=t[a]),(r?ke:_e)(n,a,l)}return n}function kb(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&xe.test(t))&&-1<t&&t%1==0&&t<e}function rb(t,e){var n,i=Oe(t),r=!i&&Se(t),o=!i&&!r&&Ie(t),s=!i&&!r&&!o&&Me(t),a=i||r||o||s,l=a?function baseTimes$1(t,e){for(var n=-1,i=Array(t);++n<t;)i[n]=e(n);return i}(t.length,String):[],c=l.length;for(n in t)!e&&!Ae.call(t,n)||a&&("length"==n||o&&("offset"==n||"parent"==n)||s&&("buffer"==n||"byteLength"==n||"byteOffset"==n)||je(n,c))||l.push(n);return l}function wb(t){if(!Be(t))return function nativeKeysIn$1(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e,n=Re(t),i=[];for(e in t)("constructor"!=e||!n&&Ne.call(t,e))&&i.push(e);return i}function yb(t){return Ve(t)?He(t,!0):wb(t)}function Sb(t,e,n,i,r,o,s){var a,l,c,h=ln(t,n),u=ln(e,n),d=s.get(u);d||((e=void 0===(d=o?o(h,u,n+"",t,e,s):void 0))&&(l=!(a=Ye(u))&&en(u),c=!a&&!l&&an(u),d=u,a||l||c?d=Ye(h)?h:tn(h)?Je(h):l?Ge(u,!(e=!1)):c?Xe(u,!(e=!1)):[]:sn(u)||Ze(u)?Ze(d=h)?d=function toPlainObject$1(t){return Ue(t,qe(t))}(h):rn(h)&&!nn(h)||(d=Ke(u)):e=!1),e&&(s.set(u,d),r(d,u,i,o,s),s.delete(u))),We(t,n,d)}function Wb(t){return t}function Xb(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Zb(t){return function(){return t}}function d1(o,s,a){return s=yn(void 0===s?o.length-1:s,0),function(){for(var t=arguments,e=-1,n=yn(t.length-s,0),i=Array(n);++e<n;)i[e]=t[s+e];for(var e=-1,r=Array(s+1);++e<s;)r[e]=t[e];return r[s]=a(i),Xb(o,this,r)}}function j1(i,r,o,s,a){i!==r&&un(r,function(t,e){var n;a=a||new cn,dn(t)?Sb(i,r,e,o,j1,s,a):(n=s?s(fn(i,e),t,e+"",i,r,a):void 0,hn(i,e,n=void 0===n?t:n))},pn)}var At,Bt,Lt,a=Stack$2,Tt=ta,r=function(){try{var t=Tt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),zt=r,Rt=Za,Nt=R,l=function createBaseFor$1(l){return function(t,e,n){for(var i=-1,r=Object(t),o=n(t),s=o.length;s--;){var a=o[l?s:++i];if(!1===e(r[a],a,r))break}return t}}(),Dt={exports:{}},Ht=(Lt=(d=(d=(h=(h=(f=Dt).exports)&&!h.nodeType&&h)&&f&&!f.nodeType&&f)&&d.exports===h?e.Buffer:void 0)?d.allocUnsafe:void 0,f.exports=function cloneBuffer(t,e){return e?t.slice():(e=t.length,e=Lt?Lt(e):new t.constructor(e),t.copy(e),e)},e.Uint8Array),Vt=e0,Ft=ba,Ut=Object.create,h=l0(Object.getPrototypeOf,Object),qt=Object.prototype,Wt=function(t){return Ft(t)?Ut?Ut(t):(object.prototype=t,t=new object,object.prototype=void 0,t):{}},Gt=h,Xt=o0,Jt=s,Kt=u,Qt=u,d=Object.prototype,Zt=d.hasOwnProperty,Yt=d.propertyIsEnumerable,f=v0(function(){return arguments}())?v0:function(t){return Qt(t)&&Zt.call(t,"callee")&&!Yt.call(t,"callee")},te=ea,ee=B0,ne=E0,oe=u,d={exports:{}},se=(b=((v=(v=(b=(b=(g=d).exports)&&!b.nodeType&&b)&&g&&!g.nodeType&&g)&&v.exports===b?e.Buffer:void 0)?v.isBuffer:void 0)||function stubFalse(){return!1},g.exports=b,s),ae=h,le=u,v=Function.prototype,g=Object.prototype,ce=v.toString,ue=g.hasOwnProperty,de=ce.call(Object),pe=s,ye=B0,ve=u,m={},b=(m["[object Float32Array]"]=m["[object Float64Array]"]=m["[object Int8Array]"]=m["[object Int16Array]"]=m["[object Int32Array]"]=m["[object Uint8Array]"]=m["[object Uint8ClampedArray]"]=m["[object Uint16Array]"]=m["[object Uint32Array]"]=!0,m["[object Arguments]"]=m["[object Array]"]=m["[object ArrayBuffer]"]=m["[object Boolean]"]=m["[object DataView]"]=m["[object Date]"]=m["[object Error]"]=m["[object Function]"]=m["[object Map]"]=m["[object Number]"]=m["[object Object]"]=m["[object RegExp]"]=m["[object Set]"]=m["[object String]"]=m["[object WeakMap]"]=!1,{exports:{}}),t=(At=(g=(g=(v=b).exports)&&!g.nodeType&&g)&&v&&!v.nodeType&&v,Bt=At&&At.exports===g&&t.process,g=function(){try{return At&&At.require&&At.require("util").types||Bt&&Bt.binding&&Bt.binding("util")}catch(t){}}(),v.exports=g,V0),v=W0,g=b.exports,g=g&&g.isTypedArray,v=g?v(g):t,me=Za,be=R,Ce=Object.prototype.hasOwnProperty,_e=fb,ke=Za,xe=/^(?:0|[1-9]\d*)$/,Se=f,Oe=i,Ie=d.exports,je=kb,Me=v,Ae=Object.prototype.hasOwnProperty,Be=ba,Re=o0,Ne=Object.prototype.hasOwnProperty,He=rb,Ve=E0,Ue=ib,qe=yb,We=a0,Ge=Dt.exports,Xe=g0,Je=h0,Ke=s0,Ze=f,Ye=i,tn=function isArrayLikeObject$1(t){return oe(t)&&ne(t)},en=d.exports,nn=ea,rn=ba,sn=function isPlainObject$1(t){return!(!le(t)||"[object Object]"!=se(t))&&(null===(t=ae(t))||"function"==typeof(t=ue.call(t,"constructor")&&t.constructor)&&t instanceof t&&ce.call(t)==de)},an=v,ln=bb,cn=a,hn=a0,un=l,dn=ba,pn=yb,fn=bb,yn=Math.max,vn=r,gn=Date.now,g=function shortOut$1(n){var i=0,r=0;return function(){var t=gn(),e=16-(t-r);if(r=t,0<e){if(800<=++i)return arguments[0]}else i=0;return n.apply(void 0,arguments)}}(vn?function(t,e){return vn(t,"toString",{configurable:!0,enumerable:!1,value:Zb(e),writable:!0})}:Wb),mn=Wb,bn=g,Cn=R,_n=E0,kn=kb,wn=ba,Pn=function createAssigner$1(a){return function baseRest$1(t,e){return bn(d1(t,e,mn),t+"")}(function(t,e){var n=-1,i=e.length,r=1<i?e[i-1]:void 0,o=2<i?e[2]:void 0,r=3<a.length&&"function"==typeof r?(i--,r):void 0;for(o&&function isIterateeCall$1(t,e,n){var i;if(wn(n))return i=typeof e,("number"==i?_n(n)&&kn(e,n.length):"string"==i&&e in n)&&Cn(n[e],t)}(e[0],e[1],o)&&(r=i<3?void 0:r,i=1),t=Object(t);++n<i;){var s=e[n];s&&a(t,s,n,r)}return t})}(function(t,e,n){j1(t,e,n)}),xn="undefined"!=typeof Float32Array?Float32Array:Array,En=Math.PI/180;function object(){}function toRadian(t){return t*En}function invert(t,e){var n=e[0],i=e[1],r=e[2],o=e[3],s=e[4],a=(e=e[5],n*o-i*r);return a?(t[0]=o*(a=1/a),t[1]=-i*a,t[2]=-r*a,t[3]=n*a,t[4]=(r*e-o*s)*a,t[5]=(i*s-n*e)*a,t):null}function multiply(t,e,n){var i=e[0],r=e[1],o=e[2],s=e[3],a=e[4],l=(e=e[5],n[0]),c=n[1],h=n[2],u=n[3],d=n[4];return n=n[5],t[0]=i*l+o*c,t[1]=r*l+s*c,t[2]=i*h+o*u,t[3]=r*h+s*u,t[4]=i*d+o*n+a,t[5]=r*d+s*n+e,t}function transformMat2d(t,e,n){var i=e[0];return e=e[1],t[0]=n[0]*i+n[2]*e+n[4],t[1]=n[1]*i+n[3]*e+n[5],t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)}),function create(){var t=new xn(2);xn!=Float32Array&&(t[0]=0,t[1]=0)}();function r1(t){if(!Sn(t))return On(t);var e,n=[];for(e in Object(t))In.call(t,e)&&"constructor"!=e&&n.push(e);return n}function v1(t){return(Mn(t)?jn:$n)(t)}function A1(){return[]}function H1(t,e){for(var n=-1,i=e.length,r=t.length;++n<i;)t[r+n]=e[n];return t}function R1(t,e,n){return e=e(t),Gn(t)?e:Wn(e,n(t))}function qc(t,e){return e=e?li(t.buffer):t.buffer,new t.constructor(e,t.byteOffset,t.byteLength)}function rc(t){var e=new t.constructor(t.source,ci.exec(t));return e.lastIndex=t.lastIndex,e}function Gc(t,e){for(var n=-1,i=null==t?0:t.length;++n<i&&!1!==e(t[n],n,t););return t}function Ic(t,e){return t&&An(e,Bn(e),t)}function Jc(t,e){return t&&Ln(e,Tn(e),t)}function Mc(t,e){return Nn(t,Dn(t),e)}function Nc(t,e){return Un(t,qn(t),e)}function Oc(t){return Xn(t,Kn,Jn)}function Pc(t){return Qn(t,Yn,Zn)}function Rc(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&ai.call(t,"index")&&(n.index=t.index,n.input=t.input),n}function Sc(t,e,n){var i=t.constructor;switch(e){case"[object ArrayBuffer]":return ui(t);case"[object Boolean]":case"[object Date]":return new i(+t);case"[object DataView]":return qc(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return di(t,n);case"[object Map]":return new i;case"[object Number]":case"[object String]":return new i(t);case"[object RegExp]":return rc(t);case"[object Set]":return new i;case"[object Symbol]":return function cloneSymbol$1(t){return hi?Object(hi.call(t)):{}}(t)}}function b2(t){return ji(t,5)}function o2(t){if(null==t)return!0;if(Li(t)&&(Bi(t)||"string"==typeof t||"function"==typeof t.splice||Ti(t)||Ri(t)||Ai(t)))return!t.length;var e,n=Mi(t);if("[object Map]"==n||"[object Set]"==n)return!t.size;if(zi(t))return!$i(t).length;for(e in t)if(Ni.call(t,e))return!1;return!0}var t=l0(Object.keys,Object),Sn=o0,On=t,In=Object.prototype.hasOwnProperty,jn=rb,$n=r1,Mn=E0,An=ib,Bn=v1,Ln=ib,Tn=yb,zn=Object.prototype.propertyIsEnumerable,Rn=Object.getOwnPropertySymbols,l=Rn?function(e){return null==e?[]:(e=Object(e),function arrayFilter$1(t,e){for(var n=-1,i=null==t?0:t.length,r=0,o=[];++n<i;){var s=t[n];e(s,n,t)&&(o[r++]=s)}return o}(Rn(e),function(t){return zn.call(e,t)}))}:A1,Nn=ib,Dn=l,Hn=H1,Vn=h,Fn=l,r=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)Hn(e,Fn(t)),t=Vn(t);return e}:A1,Un=ib,qn=r,Wn=H1,Gn=i,Xn=R1,Jn=l,Kn=v1,Qn=R1,Zn=r,Yn=yb,g=ta(e,"DataView"),t=o,h=ta(e,"Promise"),l=ta(e,"Set"),r=ta(e,"WeakMap"),ti=s,ei=ia,ni=ei(g),ii=ei(t),ri=ei(h),oi=ei(l),si=ei(r),o=ti,g=o=g&&"[object DataView]"!=o(new g(new ArrayBuffer(1)))||t&&"[object Map]"!=o(new t)||h&&"[object Promise]"!=o(h.resolve())||l&&"[object Set]"!=o(new l)||r&&"[object WeakMap]"!=o(new r)?function(t){var e=ti(t);if(t=(t="[object Object]"==e?t.constructor:void 0)?ei(t):"")switch(t){case ni:return"[object DataView]";case ii:return"[object Map]";case ri:return"[object Promise]";case oi:return"[object Set]";case si:return"[object WeakMap]"}return e}:o,ai=Object.prototype.hasOwnProperty,li=e0,ci=/\w*$/,t=n?n.prototype:void 0,hi=t?t.valueOf:void 0,ui=e0,di=g0,pi=g,fi=u,h=W0,l=b.exports,r=l&&l.isMap,o=r?h(r):function baseIsMap$1(t){return fi(t)&&"[object Map]"==pi(t)},yi=g,vi=u,t=W0,l=b.exports,h=l&&l.isSet,r=h?t(h):function baseIsSet$1(t){return vi(t)&&"[object Set]"==yi(t)},gi=a,mi=fb,bi=Dt.exports,Ci=h0,_i=g,ki=s0,wi=i,Pi=d.exports,xi=o,Ei=ba,Si=r,Oi=v1,Ii=yb,C={},ji=(C["[object Arguments]"]=C["[object Array]"]=C["[object ArrayBuffer]"]=C["[object DataView]"]=C["[object Boolean]"]=C["[object Date]"]=C["[object Float32Array]"]=C["[object Float64Array]"]=C["[object Int8Array]"]=C["[object Int16Array]"]=C["[object Int32Array]"]=C["[object Map]"]=C["[object Number]"]=C["[object Object]"]=C["[object RegExp]"]=C["[object Set]"]=C["[object String]"]=C["[object Symbol]"]=C["[object Uint8Array]"]=C["[object Uint8ClampedArray]"]=C["[object Uint16Array]"]=C["[object Uint32Array]"]=!0,C["[object Error]"]=C["[object Function]"]=C["[object WeakMap]"]=!1,function baseClone$1(n,i,r,t,e,o){var s,a=1&i,l=2&i,c=4&i;if(void 0!==(s=r?e?r(n,t,e,o):r(n):s))return s;if(!Ei(n))return n;if(t=wi(n)){if(s=Rc(n),!a)return Ci(n,s)}else{var h=_i(n),u="[object Function]"==h||"[object GeneratorFunction]"==h;if(Pi(n))return bi(n,a);if("[object Object]"==h||"[object Arguments]"==h||u&&!e){if(s=l||u?{}:ki(n),!a)return l?Nc(n,Jc(s,n)):Mc(n,Ic(s,n))}else{if(!C[h])return e?n:{};s=Sc(n,h,a)}}if(u=(o=o||new gi).get(n))return u;o.set(n,s),Si(n)?n.forEach(function(t){s.add(baseClone$1(t,i,r,t,n,o))}):xi(n)&&n.forEach(function(t,e){s.set(e,baseClone$1(t,i,r,e,n,o))});var d=t?void 0:(c?l?Pc:Oc:l?Ii:Oi)(n);return Gc(d||n,function(t,e){d&&(t=n[e=t]),mi(s,e,baseClone$1(t,i,r,e,n,o))}),s}),b=null,_=((b=window||global||{}).requestFrame=b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame||b.oRequestAnimationFrame||b.msRequestAnimationFrame,b),k=(_createClass(ICEEvent,[{key:"composedPath",value:function composedPath(){throw new Error("Method not implemented.")}},{key:"initEvent",value:function initEvent(t,e,n){throw new Error("Method not implemented.")}},{key:"preventDefault",value:function preventDefault(){throw new Error("Method not implemented.")}},{key:"stopImmediatePropagation",value:function stopImmediatePropagation(){throw new Error("Method not implemented.")}},{key:"stopPropagation",value:function stopPropagation(){throw new Error("Method not implemented.")}}]),ICEEvent),$i=r1,Mi=g,Ai=f,Bi=i,Li=E0,Ti=d.exports,zi=o0,Ri=v,Ni=Object.prototype.hasOwnProperty,l=(_createClass(ICEEventTarget,[{key:"on",value:function on(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:_;this.listeners[t]||(this.listeners[t]=[]),this.off(t,e,n),this.listeners[t].push({callback:e,scope:n})}},{key:"off",value:function off(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:_;if(i=this.listeners[t])for(var i=_toConsumableArray(i),r=0;r<i.length;r++){var o=i[r];if(o.callback===e&&o.scope===n)return void this.listeners[t].splice(r,1)}}},{key:"once",value:function once(e,n){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:_,r=this;r.on(e,function callback(t){r.off(e,callback,i),n.call(i,t)},i)}},{key:"trigger",value:function trigger(t){var e,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};if(o2(this.listeners[t]))return!1;if(this.suspendedEventNames.includes(t))return!1;n?((e=new k(n)).originalEvent=n.originalEvent||n,e.param=_objectSpread2({},i)):e=new k({type:t,timeStamp:Date.now(),param:_objectSpread2({},i)});for(var r=this.listeners[t],o=0;o<r.length;o++){var s=r[o];s.callback.call(s.scope,e)}return!0}},{key:"suspend",value:function suspend(t){t&&!this.suspendedEventNames.includes(t)&&this.suspendedEventNames.push(t)}},{key:"resume",value:function resume(e){this.suspendedEventNames.splice(this.suspendedEventNames.findIndex(function(t){return t===e}),1)}},{key:"purgeEvents",value:function purgeEvents(){this.listeners={},this.suspendedEventNames=[]}},{key:"hasListener",value:function hasListener(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:_;if(!this.listeners[t])return!1;var i=this.listeners[t];if(!i)return!1;for(var r=0;r<i.length;r++){var o=i[r];if(o.callback===e&&o.scope===n)return!0}return!1}}]),ICEEventTarget),Di=(l.prototype.addEventListener=l.prototype.on,l.prototype.removeEventListener=l.prototype.off,l.prototype.dispatchEvent=l.prototype.trigger,_createClass(GeoUtil,null,[{key:"calcRotateAngle",value:function calcRotateAngle(t,e,n,i){return t-=n,(((n=e-i)/(e=Math.hypot(t,n))<0?-1:1)*Math.acos(t/e)*180/Math.PI+360)%360}},{key:"calcRotateAngleFromMatrix",value:function calcRotateAngleFromMatrix(t){var e=0,n=t[0],i=(t=t[1],Math.hypot(n,t));return t/=i,e=Math.acos(n/i),t<0&&(e+=Math.PI/2),e*(180/Math.PI)}},{key:"calcScaleFromMatrix",value:function calcScaleFromMatrix(t){var e=t[0],n=t[1],i=t[2];return t=t[3],[Math.hypot(e,n)/e,Math.hypot(i,t)/t]}}]),GeoUtil),Hi=(_createClass(ICEBoundingBox,[{key:"containsPoint",value:function containsPoint(t){var e=(r=this.getMinAndMaxPoint()).minX,n=r.minY,i=r.maxX,r=r.maxY;if(t[0]<e||t[0]>i||t[1]<n||t[1]>r)return!1;for(var o=0,s=this.getBoundingLines(),a=0;a<s.length;a++){var l,c=s[a];t[1]>c.o[1]&&t[1]>c.d[1]||t[1]<c.o[1]&&t[1]<c.d[1]||(c.o[0]===c.d[0]&&c.o[0]>=t[0]?c.o[0]:(l=(c.d[1]-c.o[1])/(c.d[0]-c.o[0]),c.o[0]+(t[1]-c.o[1])/l))>t[0]&&o++}return 0!==o&&o%2==1}},{key:"getBoundingLines",value:function getBoundingLines(){return[{o:_toConsumableArray(this.tl),d:_toConsumableArray(this.tr)},{o:_toConsumableArray(this.tr),d:_toConsumableArray(this.br)},{o:_toConsumableArray(this.br),d:_toConsumableArray(this.bl)},{o:_toConsumableArray(this.bl),d:_toConsumableArray(this.tl)}]}},{key:"getMinAndMaxPoint",value:function getMinAndMaxPoint(){for(var t=this.tl[0],e=this.tl[1],n=this.tl[0],i=this.tl[1],r=[this.tr,this.bl,this.br],o=0;o<r.length;o++){var s=r[o];s[0]<t&&(t=s[0]),s[0]>n&&(n=s[0]),s[1]<e&&(e=s[1]),s[1]>i&&(i=s[1])}return{minX:t,minY:e,maxX:n,maxY:i}}},{key:"containsBox",value:function containsBox(t){return!1}},{key:"isIntersect",value:function isIntersect(t){var e=this.tl[0],n=this.br[0],i=this.tl[1],r=this.br[1],o=t.tl[0],s=t.br[0],a=t.tl[1];return t=t.br[1],!(s<e||t<i||n<o||r<a)}},{key:"transform",value:function transform(t){var e=transformMat2d([],this.tl,t),n=transformMat2d([],this.tr,t),i=transformMat2d([],this.bl,t),r=transformMat2d([],this.br,t);return t=transformMat2d([],this.center,t),new ICEBoundingBox([].concat(_toConsumableArray(e),_toConsumableArray(n),_toConsumableArray(i),_toConsumableArray(r),_toConsumableArray(t)))}},{key:"union",value:function union(t){return null}},{key:"width",get:function get(){var t=this.br[0]-this.bl[0],e=this.br[1]-this.bl[1];return Math.hypot(t,e)}},{key:"height",get:function get(){var t=this.br[0]-this.tr[0],e=this.br[1]-this.tr[1];return Math.hypot(t,e)}},{key:"left",get:function get(){return this.tl[0]},set:function set(t){throw new Error("Can not set left to ICEBoundingBox directly.")}},{key:"top",get:function get(){return this.tl[1]},set:function set(t){throw new Error("Can not set top to ICEBoundingBox directly.")}},{key:"centerX",get:function get(){return this.center[0]}},{key:"centerY",get:function get(){return this.center[1]}},{key:"centerPoint",get:function get(){return this.center}}],[{key:"fromDimension",value:function fromDimension(t,e,n,i){return new ICEBoundingBox([].concat([t,e],[t+n,e],[t,e+i],[t+n,e+i],[t+n/2,e+i/2]))}}]),ICEBoundingBox);function ICEBoundingBox(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[0,0,0,0,0,0,0,0,0,0];_classCallCheck(this,ICEBoundingBox),_defineProperty$1(this,"tl",[0,0]),_defineProperty$1(this,"tr",[0,0]),_defineProperty$1(this,"bl",[0,0]),_defineProperty$1(this,"br",[0,0]),_defineProperty$1(this,"tc",[0,0]),_defineProperty$1(this,"rc",[0,0]),_defineProperty$1(this,"bc",[0,0]),_defineProperty$1(this,"lc",[0,0]),_defineProperty$1(this,"center",[0,0]),this.tl=[t[0],t[1]],this.tr=[t[2],t[3]],this.bl=[t[4],t[5]],this.br=[t[6],t[7]],this.tc=[(this.tr[0]+this.tl[0])/2,(this.tr[1]+this.tl[1])/2],this.bc=[(this.br[0]+this.bl[0])/2,(this.br[1]+this.bl[1])/2],this.lc=[(this.bl[0]+this.tl[0])/2,(this.bl[1]+this.tl[1])/2],this.rc=[(this.br[0]+this.tr[0])/2,(this.br[1]+this.tr[1])/2],this.center=[t[8],t[9]]}function GeoUtil(){throw _classCallCheck(this,GeoUtil),new Error("GeoUtil is a static util class.")}function ICEEventTarget(){_classCallCheck(this,ICEEventTarget),_defineProperty$1(this,"listeners",{}),_defineProperty$1(this,"suspendedEventNames",[])}function ICEEvent(){var t,e,n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};for(t in _classCallCheck(this,ICEEvent),n)this[t]=n[t];for(e in i)this[e]=i[e]}function getVal(t,e){return e.split(".").reduce(function(t,e){return t[e]},t)}function flattenTree(t,e,n,i){for(var r=0<arguments.length&&void 0!==t?t:[],o=1<arguments.length&&void 0!==e?e:[],s=2<arguments.length&&void 0!==n?n:1,a=3<arguments.length&&void 0!==i?i:null,l=0;l<o.length;l++){var c=o[l];c._level=s,c._pid=a,r.push(c),flattenTree(r,c.childNodes||[],s+1,c.id)}return r}function x2(t){return null==t}function G2(t){return"symbol"==typeof t||lr(t)&&"[object Symbol]"==ar(t)}function H2(t){return t&&t.slice(0,function trimmedEndIndex$1(t){for(var e=t.length;e--&&or.test(t.charAt(e)););return e}(t)+1).replace(sr,"")}function O2(t){if("number"==typeof t)return t;if(hr(t))return NaN;if(cr(t)&&(e="function"==typeof t.valueOf?t.valueOf():t,t=cr(e)?e+"":e),"string"!=typeof t)return 0===t?t:+t;t=H2(t);var e=dr.test(t);return e||pr.test(t)?fr(t.slice(2),e?2:8):ur.test(t)?NaN:+t}function U2(t){if("string"==typeof t)return t;if(vr(t))return function arrayMap$1(t,e){for(var n=-1,i=null==t?0:t.length,r=Array(i);++n<i;)r[n]=e(t[n],n,t);return r}(t,U2)+"";if(gr(t))return mr?mr.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function V2(t){var e=(t=function toFinite$1(t){return t?(t=yr(t))===1/0||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}(t))%1;return t==t?e?t-e:t:0}function X2(t){return null==t?"":U2(t)}_inherits(ICEComponent,l),nr=_createSuper(ICEComponent),_createClass(ICEComponent,[{key:"initEvents",value:function initEvents(){this.on("mousedown",this.mouseDownEvtHandler,this),this.on("keydown",this.keyboardEvtHandler,this),this.on("keyup",this.keyboardEvtHandler,this)}},{key:"mouseDownEvtHandler",value:function mouseDownEvtHandler(t){this.state.interactive&&this.state.draggable&&(this.on("mousemove",this.mouseMoveEvtHandler,this),this.on("mouseup",this.mouseUpEvtHandler,this))}},{key:"mouseMoveEvtHandler",value:function mouseMoveEvtHandler(t){var e=t.movementX,n=t.movementY;return this.moveGlobalPosition(e,n,t),!0}},{key:"mouseUpEvtHandler",value:function mouseUpEvtHandler(t){this.off("mousemove",this.mouseMoveEvtHandler,this),this.off("mouseup",this.mouseUpEvtHandler,this)}},{key:"keyboardEvtHandler",value:function keyboardEvtHandler(t){switch(t.key){case"ArrowUp":this.moveGlobalPosition(0,-2,t);break;case"ArrowDown":this.moveGlobalPosition(0,2,t);break;case"ArrowLeft":this.moveGlobalPosition(-2,0,t);break;case"ArrowRight":this.moveGlobalPosition(2,0,t);break;case"Delete":(this.parentNode&&this.parentNode.removeChild?this.parentNode:this.ice).removeChild(this)}}},{key:"render",value:function render(){this.trigger(N),this.state.display&&(this.calcComponentParams(),this.applyStyleToCtx(),this.applyTransformToCtx(),this.doRender(),this.trigger(D),this.dirty=!1)}},{key:"applyStyleToCtx",value:function applyStyleToCtx(){var t,e=_objectSpread2(_objectSpread2({},this.props.style),this.state.style);for(t in e)this.ctx[t]=e[t]}},{key:"calcComponentParams",value:function calcComponentParams(){return{width:this.state.width,height:this.state.height}}},{key:"calcLocalOrigin",value:function calcLocalOrigin(){var t=[0,0],e=this.state.origin;return e&&"localCenter"!==e||(t[0]=this.state.width/2,t[1]=this.state.height/2),this.state.localOrigin=t}},{key:"calcAbsoluteOrigin",value:function calcAbsoluteOrigin(){var t=getVal(this,"state.transform.translate.0")+this.state.left,e=getVal(this,"state.transform.translate.1")+this.state.top,n=_toConsumableArray(this.calcLocalOrigin());return n[0]+=t,n[1]+=e,this.parentNode&&(n=transformMat2d([],n,[1,0,0,1,-this.parentNode.state.localOrigin[0],-this.parentNode.state.localOrigin[1]]),n=transformMat2d([],n,this.parentNode.state.composedMatrix)),this.state.absoluteOrigin=n}},{key:"calcLinearMatrix",value:function calcLinearMatrix(){var t=function create$1(){var t=new xn(6);return xn!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t}(),e=getVal(this,"state.transform.skew.0"),n=getVal(this,"state.transform.skew.1"),t=function scale(t,e,n){var i=e[0],r=e[1],o=e[2],s=e[3],a=e[4],l=(e=e[5],n[0]);return n=n[1],t[0]=i*l,t[1]=r*l,t[2]=o*n,t[3]=s*n,t[4]=a,t[5]=e,t}([],function rotate(t,e,n){var i=e[0],r=e[1],o=e[2],s=e[3],a=e[4],l=(e=e[5],Math.sin(n));return n=Math.cos(n),t[0]=i*n+o*l,t[1]=r*n+s*l,t[2]=i*-l+o*n,t[3]=r*-l+s*n,t[4]=a,t[5]=e,t}([],function skew(t,e,n,i){return n=Math.tan(n),i=Math.tan(i),t[0]=e[0],t[1]=e[1]+n,t[2]=e[2]+i,t[3]=e[3],t[4]=e[4],t[5]=e[5],t}([],t,e*En,n*En),toRadian(getVal(this,"state.transform.rotate"))),[getVal(this,"state.transform.scale.0"),getVal(this,"state.transform.scale.1")]);return this.state.linearMatrix=t}},{key:"calcAbsoluteLinearMatrix",value:function calcAbsoluteLinearMatrix(){for(var t=this,e=t.calcLinearMatrix();t.parentNode;)e=multiply([],t.parentNode.state.linearMatrix,e),t=t.parentNode;return this.state.absoluteLinearMatrix=e}},{key:"composeMatrix",value:function composeMatrix(){var t=multiply([],[1,0,0,1,(t=this.calcAbsoluteOrigin())[0],t[1]],this.calcAbsoluteLinearMatrix());return this.state.composedMatrix=t}},{key:"applyTransformToCtx",value:function applyTransformToCtx(){var t,e=this.dirty?this.composeMatrix():this.state.composedMatrix;(t=this.ctx).setTransform.apply(t,_toConsumableArray(e))}},{key:"doRender",value:function doRender(){var t;this.ctx.setTransform(1,0,0,1,0,0),this.ctx.lineWidth=1,this.state.showMinBoundingBox&&(t=this.getMinBoundingBox(),this.ctx.strokeStyle="#ff0000",this.ctx.fillStyle="rgba(0,0,0,0)",this.ctx.beginPath(),this.ctx.moveTo(t.tl[0],t.tl[1]),this.ctx.lineTo(t.tr[0],t.tr[1]),this.ctx.lineTo(t.br[0],t.br[1]),this.ctx.lineTo(t.bl[0],t.bl[1]),this.ctx.closePath(),this.ctx.stroke(),this.ctx.fill()),this.state.showMaxBoundingBox&&(t=this.getMaxBoundingBox(),this.ctx.strokeStyle="#0000ff",this.ctx.fillStyle="rgba(0,0,0,0)",this.ctx.beginPath(),this.ctx.moveTo(t.tl[0],t.tl[1]),this.ctx.lineTo(t.tr[0],t.tr[1]),this.ctx.lineTo(t.br[0],t.br[1]),this.ctx.lineTo(t.bl[0],t.bl[1]),this.ctx.closePath(),this.ctx.stroke(),this.ctx.fill())}},{key:"getMinBoundingBox",value:function getMinBoundingBox(){var t=0<arguments.length&&void 0!==arguments[0]&&arguments[0],e=this.state.localOrigin[0],n=this.state.localOrigin[1],i=this.state.width,r=this.state.height,e=new Hi([0-e,0-n,0-e+i,0-n,0-e,0-n+r,0-e+i,0-n+r,0,0]),i=t?this.composeMatrix():this.state.composedMatrix;return e.transform(i)}},{key:"getMaxBoundingBox",value:function getMaxBoundingBox(){var t=(i=(r=this.getMinBoundingBox(0<arguments.length&&void 0!==arguments[0]&&arguments[0])).getMinAndMaxPoint()).minX,e=i.minY,n=i.maxX,i=i.maxY,r=r.centerPoint;return new Hi([t,e,n,e,t,i,n,i,r[0],r[1]])}},{key:"setState",value:function setState(t){Pn(this.state,t),this.dirty=!0,this.ice&&(this.ice.dirty=!0)}},{key:"dirty",get:function get(){return this.__dirty},set:function set(t){this.__dirty=t}},{key:"setPosition",value:function setPosition(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:new k;this.trigger("BEFORE_MOVE",_objectSpread2(_objectSpread2({},n),{},{left:t,top:e})),this.setState({left:t,top:e}),this.trigger(Q,_objectSpread2(_objectSpread2({},n),{},{left:t,top:e}))}},{key:"moveGlobalPosition",value:function moveGlobalPosition(t,e){var n,i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:new k;this.parentNode&&(t=(n=transformMat2d([],[t,e],invert([],this.parentNode.state.absoluteLinearMatrix)))[0],e=n[1]),this.setPosition(this.state.left+t,this.state.top+e,_objectSpread2(_objectSpread2({},i),{},{tx:t,ty:e}))}},{key:"setGlobalPosition",value:function setGlobalPosition(t,e){var n,i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:new k;this.parentNode&&(t=(n=transformMat2d([],[t,e],invert([],this.parentNode.state.absoluteLinearMatrix)))[0],e=n[1]),this.setPosition(t,e,_objectSpread2(_objectSpread2({},i),{},{left:t,top:e}))}},{key:"setGlobalRotate",value:function setGlobalRotate(t){var e;this.parentNode&&(e=this.parentNode.state.absoluteLinearMatrix,t-=Di.calcRotateAngleFromMatrix(e)),this.setState({transform:{rotate:t}})}},{key:"localToGlobal",value:function localToGlobal(t,e){return transformMat2d([],t=[t,e],this.state.composedMatrix)}},{key:"globalToLocal",value:function globalToLocal(t,e){return transformMat2d([],t=[t,e],invert([],this.state.composedMatrix))}},{key:"getRotateAngle",value:function getRotateAngle(){var t=this.state.composedMatrix;return Di.calcRotateAngleFromMatrix(t)}},{key:"getLocalLeftTop",value:function getLocalLeftTop(){var t=this.getMinBoundingBox(!0),e=t.width,n=t.height;return{left:t.centerX-t.width/2,top:t.centerY-t.height/2,width:e,height:n}}},{key:"containsPoint",value:function containsPoint(t,e){return this.getMinBoundingBox().containsPoint([t,e])}},{key:"destory",value:function destory(){this.trigger(F,null,{component:this}),this.purgeEvents(),this.ice=null,this.ctx=null,this.root=null,this.evtBus=null,this.parentNode=null}}]);var Vi,Fi,Ui,qi,Wi,Gi,Xi,Ji,Ki,Qi,Zi,Yi,tr,er,nr,t=ICEComponent,h=(_defineProperty$1(t,"instanceCounter",0),_inherits(ICEPath,t),er=_createSuper(ICEPath),_createClass(ICEPath,[{key:"doRender",value:function doRender(){this.dirty&&(this.ctx.beginPath(),this.createPathObject()),this.state.closePath&&this.path2D.closePath(),this.state.fill&&this.ctx.fill(this.path2D),this.state.stroke&&this.ctx.stroke(this.path2D),_get(_getPrototypeOf(ICEPath.prototype),"doRender",this).call(this)}}]),ICEPath),a=(_inherits(ICERect,h),tr=_createSuper(ICERect),_createClass(ICERect,[{key:"createPathObject",value:function createPathObject(){return this.path2D=new Path2D,this.path2D.rect(0-this.state.localOrigin[0],0-this.state.localOrigin[1],this.state.width,this.state.height),this.path2D}}]),ICERect),Dt=(_inherits(ICEGroup,a),Yi=_createSuper(ICEGroup),_createClass(ICEGroup,[{key:"initEvents",value:function initEvents(){_get(_getPrototypeOf(ICEGroup.prototype),"initEvents",this).call(this),this.once(V,this.afterAddHandler,this)}},{key:"afterAddHandler",value:function afterAddHandler(){for(var t=0;t<this.childNodes.length;t++){var e=this.childNodes[t];this.syncChildEvents(e)}}},{key:"syncChildEvents",value:function syncChildEvents(t){t.trigger(H),t.ice=this.ice,t.ctx=this.ice.ctx,t.evtBus=this.ice.evtBus,t.trigger(V)}},{key:"addChild",value:function addChild(t){var e=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];-1===this.childNodes.indexOf(t)&&((t.parentNode=this).childNodes.push(t),this.dirty=e,this.ice&&(this.syncChildEvents(t),this.ice.dirty=e))}},{key:"addChildren",value:function addChildren(t){for(var e=0;e<t.length;e++){var n=t[e];this.addChild(n,!1)}this.dirty=!0,this.ice&&(this.ice.dirty=!0)}},{key:"removeChild",value:function removeChild(t){var e=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];t.destory(),this.childNodes.splice(this.childNodes.indexOf(t),1),this.dirty=e,this.ice&&(this.ice.dirty=e)}},{key:"removeChildren",value:function removeChildren(t){for(var e=0;e<t.length;e++){var n=t[e];this.removeChild(n,!1)}this.dirty=!0,this.ice&&(this.ice.dirty=!0)}},{key:"setState",value:function setState(t){Pn(this.state,t),this.dirty=!0,function setRecursively(t){if(t.dirty=!0,t.childNodes&&t.childNodes.length)for(var e=0;e<t.childNodes.length;e++)setRecursively(t.childNodes[e])}(this),this.ice&&(this.ice.dirty=!0)}},{key:"destory",value:function destory(){this.removeChildren(this.childNodes),_get(_getPrototypeOf(ICEGroup.prototype),"destory",this).call(this)}}]),ICEGroup),o=(_inherits(ICEControlPanel,Dt),Zi=_createSuper(ICEControlPanel),_createClass(ICEControlPanel,[{key:"doRender",value:function doRender(){_get(_getPrototypeOf(ICEControlPanel.prototype),"doRender",this).call(this),this.updateControlPositions()}},{key:"moveGlobalPosition",value:function moveGlobalPosition(t,e,n){_get(_getPrototypeOf(ICEControlPanel.prototype),"moveGlobalPosition",this).call(this,t,e,n),this._targetComponent&&this._targetComponent.moveGlobalPosition(t,e,n)}}]),ICEControlPanel),r=(_inherits(ICEEllipse,h),Qi=_createSuper(ICEEllipse),_createClass(ICEEllipse,[{key:"createPathObject",value:function createPathObject(){return this.path2D=new Path2D,this.path2D.ellipse(this.state.radiusX-this.state.localOrigin[0],this.state.radiusY-this.state.localOrigin[1],this.state.radiusX,this.state.radiusY,this.state.rotation,this.state.startAngle,this.state.endAngle,this.state.counterclockwise),this.path2D.closePath(),this.path2D}},{key:"setState",value:function setState(t){x2(t.radiusX)?x2(t.width)||(t.radiusX=t.width/2):t.width=2*t.radiusX,x2(t.radiusY)?x2(t.height)||(t.radiusY=t.height/2):t.height=2*t.radiusY,_get(_getPrototypeOf(ICEEllipse.prototype),"setState",this).call(this,t)}}]),ICEEllipse),b=(_inherits(ICECircle,r),Ki=_createSuper(ICECircle),_createClass(ICECircle)),ir=(_inherits(ICELinkHook,b),Ji=_createSuper(ICELinkHook),_createClass(ICELinkHook,[{key:"initEvents",value:function initEvents(){_get(_getPrototypeOf(ICELinkHook.prototype),"initEvents",this).call(this),this.on("mousedown",this.mosueDownHandler,this),this.on("mousemove",this.mosueMoveHandler,this),this.on("mouseup",this.mosueUpHandler,this),this.on(Q,this.resizeEvtHandler,this)}},{key:"keyboardEvtHandler",value:function keyboardEvtHandler(t){}},{key:"mosueDownHandler",value:function mosueDownHandler(t){this.evtBus.trigger(W,new k({target:this}))}},{key:"mosueMoveHandler",value:function mosueMoveHandler(t){this.evtBus.trigger(G,new k({target:this}))}},{key:"mosueUpHandler",value:function mosueUpHandler(t){this.evtBus.trigger(X,new k({target:this}))}},{key:"resizeEvtHandler",value:function resizeEvtHandler(t){var e;this.parentNode&&(e=this.props.position,this.parentNode.trigger(J,new k(t,{position:e})),this.parentNode.trigger(c,new k(t,{position:e})))}}]),ICELinkHook),rr=(_inherits(LineControlPanel,o),Xi=_createSuper(LineControlPanel),_createClass(LineControlPanel,[{key:"initControls",value:function initControls(){var t=this.state.width,e=this.state.height,n=this.controlSize/2;this.startControl=new ir({zIndex:10001001,display:!1,left:-n,top:-n,width:this.controlSize,height:this.controlSize,style:{strokeStyle:"#0c09d4",fillStyle:"#3ce92c",lineWidth:1},position:"start"}),this.addChild(this.startControl),this.endControl=new ir({zIndex:10001002,display:!1,left:t-n,top:e-n,width:this.controlSize,height:this.controlSize,style:{strokeStyle:"#0c09d4",fillStyle:"#3ce92c",lineWidth:1},position:"end"}),this.addChild(this.endControl)}},{key:"initEvents",value:function initEvents(){this.on(c,this.resizeEvtHandler,this)}},{key:"enable",value:function enable(){this.setState({display:!0}),this.resume(c),this.showHooks()}},{key:"disable",value:function disable(){this.setState({display:!1}),this.suspend(c),this.hideHooks()}},{key:"updateControlPositions",value:function updateControlPositions(){}},{key:"resizeEvtHandler",value:function resizeEvtHandler(t){if(this.targetComponent){var e=t.position,n=t.movementX,i=t.movementY,r=(t=this.targetComponent.state).points.length,o=t.points[0][0],s=t.points[0][1],a=t.points[r-1][0],l=t.points[r-1][1],n=(r=transformMat2d([],[n,i],invert([],t.absoluteLinearMatrix)))[0],i=r[1];switch(e){case"start":o+=n,s+=i;break;case"end":a+=n,l+=i}this.targetComponent.setState({startPoint:[o,s],endPoint:[a,l]})}}},{key:"updatePosition",value:function updatePosition(){var t,e,n;this.targetComponent&&(this.setState({left:0,top:-5,width:3,height:3,transform:{translate:[0,0],scale:[1,1],skew:[0,0],rotate:0}}),t=this.controlSize/2,n=this.targetComponent.state.points.length,e=this.targetComponent.state.points[0],n=this.targetComponent.state.points[n-1],e=[e[0],e[1]],n=[n[0],n[1]],this.startControl.setState({left:e[0]-t,top:e[1]-t}),this.endControl.setState({left:n[0]-t,top:n[1]-t}))}},{key:"targetComponent",get:function get(){return this._targetComponent},set:function set(t){var e=this;this._targetComponent&&this._targetComponent.off(Q,this.updatePosition,this),this._targetComponent=t,this._targetComponent&&this._targetComponent.on(Q,this.updatePosition,this),this._targetComponent&&this._targetComponent.once(F,function(){e.targetComponent=null,e.disable()},this),this.updatePosition()}},{key:"showHooks",value:function showHooks(){this.startControl.setState({display:!0}),this.endControl.setState({display:!0})}},{key:"hideHooks",value:function hideHooks(){this.startControl.setState({display:!1}),this.endControl.setState({display:!1})}}]),LineControlPanel),or=/\s/,sr=/^\s+/,ar=s,lr=u,cr=ba,hr=G2,ur=/^[-+]0x[0-9a-f]+$/i,dr=/^0b[01]+$/i,pr=/^0o[0-7]+$/i,fr=parseInt,yr=O2,vr=i,gr=G2,g=n?n.prototype:void 0,mr=g?g.toString:void 0,br=O2,Cr=e.isFinite,_r=Math.min,kr=function createRound$1(t){var r=Math[t];return function(t,e){var n,i;return t=br(t),(e=null==e?0:_r(V2(e),292))&&Cr(t)?(n=(X2(t)+"e").split("e"),i=r(n[0]+"e"+(+n[1]+e)),+((n=(X2(i)+"e").split("e"))[0]+"e"+(+n[1]-e))):r(t)}}("round"),wr=(_inherits(ResizeControl,a),Gi=_createSuper(ResizeControl),_createClass(ResizeControl,[{key:"initEvents",value:function initEvents(){_get(_getPrototypeOf(ResizeControl.prototype),"initEvents",this).call(this),this.on(Q,this.resizeEvtHandler,this)}},{key:"resizeEvtHandler",value:function resizeEvtHandler(t){if(this.parentNode){var e,n=t.quadrant,i=t.movementX,r=t.movementY,o=(e=this.parentNode.state).left,s=e.top,a=e.width,l=e.height,i=(e=transformMat2d([],[i,r],invert([],e.absoluteLinearMatrix)))[0],r=e[1];switch(n){case 1:o-=i,s+=r,a+=2*i,l-=2*r;break;case 2:o+=i,s+=r,a-=2*i,l-=2*r;break;case 3:o+=i,s-=r,a-=2*i,l+=2*r;break;case 4:o-=i,s-=r,a+=2*i,l+=2*r;break;case 5:s+=r,l-=2*r;break;case 6:s-=r,l+=2*r;break;case 7:o+=i,a-=2*i;break;case 8:o-=i,a+=2*i}e={top:s,left:o,width:Math.abs(a),height:Math.abs(l)},this.parentNode.trigger(J,new k(t,{quadrant:n})),this.parentNode.setState(e),this.parentNode.trigger(c,new k(t,{quadrant:n}))}}},{key:"moveGlobalPosition",value:function moveGlobalPosition(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:new k,i=0<t?1:-1,r=0<e?1:-1,o=(h=this.parentNode.state).localOrigin,s=h.width,a=h.height,l=(t=(h=transformMat2d([],[t,e],invert([],h.absoluteLinearMatrix)))[0],e=h[1],(h=this.state).left),c=h.top,h=h.quadrant,u=this.state.width/2,d=0;"x"===this.state.direction?d=0<(l=0===kr(l+=t)?.5*i:l)+u-o[0]?8:7:"y"===this.state.direction?d=0<(c=0===kr(c+=e)?.5*r:c)+u-o[1]?6:5:"xy"===this.state.direction&&(r=-a/2/(0===kr(r=-s/2)?.5*i:r),0===kr(s/=2)&&(s=.5*i),c+=e=2===h||4==h?r*(l+u-o[0]+t)-(c+u-o[1]):-a/2/s*(l+u-o[0]+t)-(c+u-o[1]),d=0<(l+=t)+u-o[0]?0<c+u-o[1]?4:1:0<c+u-o[1]?3:2),h!==d&&this.parentNode.toggleControlQuadrant(this,d),this.setPosition(l,c,new k(n,{left:l,top:c,tx:t,ty:e,quadrant:d}))}}]),ResizeControl),Pr=(_inherits(RotateControl,b),Wi=_createSuper(RotateControl),_createClass(RotateControl,[{key:"initEvents",value:function initEvents(){_get(_getPrototypeOf(RotateControl.prototype),"initEvents",this).call(this),this.on(Q,this.rotateEvtHandler,this)}},{key:"rotateEvtHandler",value:function rotateEvtHandler(t){var e;this.parentNode&&(e=this.parentNode.state.absoluteOrigin,t={transform:{rotate:Di.calcRotateAngle(t.offsetX,t.offsetY,e[0],e[1])+90}},this.parentNode.trigger("BEFORE_ROTATE",new k(t)),this.parentNode.setState(t),this.parentNode.trigger(K,new k(t)))}}]),RotateControl),xr=(_inherits(TransformControlPanel,o),qi=_createSuper(TransformControlPanel),_createClass(TransformControlPanel,[{key:"initControls",value:function initControls(){var t=this.state.width,e=this.state.height,n=t/2,i=e/2,r=this.resizeControlSize/2,o=[{direction:"xy",quadrant:2,position:[-r,-r]},{direction:"y",quadrant:5,position:[n-r,-r]},{direction:"xy",quadrant:1,position:[t-r,-r]},{direction:"x",quadrant:8,position:[t-r,i-r]},{direction:"xy",quadrant:4,position:[t-r,e-r]},{direction:"y",quadrant:6,position:[n-r,e-r]},{direction:"xy",quadrant:3,position:[-r,e-r]},{direction:"x",quadrant:7,position:[-r,i-r]}];this.resizeControlInstanceCache=[];for(var s=0;s<o.length;s++){var a=new wr({zIndex:10000002,display:!1,left:(a=o[s]).position[0],top:a.position[1],width:this.resizeControlSize,height:this.resizeControlSize,style:{strokeStyle:"#8b0000",fillStyle:"#CC3300",lineWidth:1},direction:a.direction,quadrant:a.quadrant});this.addChild(a),this.resizeControlInstanceCache.push(a)}t=this.state.width/2-this.rotateControlSize,n=-this.rotateControlffsetY,this.rotateControlInstance=new Pr({zIndex:10000003,display:!1,left:t,top:n,radius:this.rotateControlSize,style:{strokeStyle:"#8b0000",fillStyle:"#CC3300",lineWidth:1}}),this.addChild(this.rotateControlInstance)}},{key:"initEvents",value:function initEvents(){_get(_getPrototypeOf(TransformControlPanel.prototype),"initEvents",this).call(this),this.on(c,this.resizeEvtHandler,this),this.on(K,this.rotateEvtHandler,this),this.on("keydown",this.keyboardEvtHandler,this),this.on("keyup",this.keyboardEvtHandler,this)}},{key:"enable",value:function enable(){this.rotateControlInstance.setState({display:!0});for(var t=0;t<this.resizeControlInstanceCache.length;t++)this.resizeControlInstanceCache[t].setState({display:!0});this.setState({display:!0}),this.resume(c),this.resume(K),this.resume("keydown"),this.resume("keyup")}},{key:"disable",value:function disable(){this.rotateControlInstance.setState({display:!1});for(var t=0;t<this.resizeControlInstanceCache.length;t++)this.resizeControlInstanceCache[t].setState({display:!1});this.setState({display:!1}),this.suspend(c),this.suspend(K),this.suspend("keydown"),this.suspend("keyup")}},{key:"keyboardEvtHandler",value:function keyboardEvtHandler(t){this.targetComponent&&this.targetComponent.trigger(t.type,t,{component:this.targetComponent})}},{key:"rotateEvtHandler",value:function rotateEvtHandler(t){var e;this.targetComponent&&(e=this.state.transform.rotate,this.targetComponent.setGlobalRotate(e),this.targetComponent.trigger(K))}},{key:"resizeEvtHandler",value:function resizeEvtHandler(t){if(this.targetComponent){var e=t.quadrant,n=t.movementX,i=t.movementY,r=(t=this.targetComponent.state).left,o=t.top,s=t.width,a=t.height,n=(t=transformMat2d([],[n,i],invert([],t.absoluteLinearMatrix)))[0],i=t[1];switch(e){case 1:r-=n,o+=i,s+=2*n,a-=2*i;break;case 2:r+=n,o+=i,s-=2*n,a-=2*i;break;case 3:r+=n,o-=i,s-=2*n,a+=2*i;break;case 4:r-=n,o-=i,s+=2*n,a+=2*i;break;case 5:o+=i,a-=2*i;break;case 6:o-=i,a+=2*i;break;case 7:r+=n,s-=2*n;break;case 8:r-=n,s+=2*n}this.targetComponent.setState({left:r,top:o,width:Math.abs(s),height:Math.abs(a)}),this.targetComponent.trigger(c)}}},{key:"updateControlPositions",value:function updateControlPositions(){for(var t=this.state.width,e=this.state.height,n=t/2,i=e/2,r=this.resizeControlSize/2,o=0;o<this.resizeControlInstanceCache.length;o++){var s=this.resizeControlInstanceCache[o],a=[0,0];switch(s.state.quadrant){case 1:a=[t-r,-r];break;case 2:a=[-r,-r];break;case 3:a=[-r,e-r];break;case 4:a=[t-r,e-r];break;case 5:a=[n-r,-r];break;case 6:a=[n-r,e-r];break;case 7:a=[-r,i-r];break;case 8:a=[t-r,i-r]}s.setState({left:a[0],top:a[1]})}var l=this.state.width/2-this.rotateControlSize,c=-this.rotateControlffsetY;this.rotateControlInstance.setState({left:l,top:c})}},{key:"updatePanel",value:function updatePanel(){var t,e,n,i,r;this.targetComponent&&(t=this.targetComponent.getRotateAngle(),e=(r=this.targetComponent.getLocalLeftTop()).left,n=r.top,i=r.width,r=r.height,this.setState({left:e,top:n,width:i,height:r,transform:{rotate:t}}))}},{key:"targetComponent",get:function get(){return this._targetComponent},set:function set(t){var e=this;this._targetComponent&&this._targetComponent.off(Q,this.updatePanel,this),this._targetComponent=t,this._targetComponent&&this._targetComponent.on(Q,this.updatePanel,this),this._targetComponent&&this._targetComponent.once(F,function(){e.targetComponent=null,e.disable()},this),this.updatePanel()}},{key:"toggleControlQuadrant",value:function toggleControlQuadrant(t,e){for(var n=0;n<this.resizeControlInstanceCache.length;n++){var i=this.resizeControlInstanceCache[n];if(i.state.quadrant===e){var r=0;switch(e){case 1:r=3;break;case 2:r=4;break;case 3:r=1;break;case 4:r=2;break;case 5:r=6;break;case 6:r=5;break;case 7:r=8;break;case 8:r=7}i.setState({quadrant:r})}}t.setState({quadrant:e})}}]),TransformControlPanel),Er=(_createClass(ICEControlPanelManager,[{key:"start",value:function start(){return this.ice.evtBus.on("mousedown",this.mouseDownHandler,this),this}},{key:"stop",value:function stop(){return this.ice.evtBus.off("mousedown",this.mouseDownHandler,this),this}},{key:"mouseDownHandler",value:function mouseDownHandler(t){if(!(t=t.target).ice||!t.state.interactive||!t.state.transformable)return this.lineControlPanel.disable(),void this.transformControlPanel.disable();t&&(t.isControlPanel||t.parentNode&&t.parentNode.isControlPanel)||(this.ice.selectionList=[t],this.lineControlPanel.disable(),this.transformControlPanel.disable(),t.isLine?(this.lineControlPanel.targetComponent=t,this.lineControlPanel.enable()):(this.transformControlPanel.targetComponent=t,this.transformControlPanel.enable()))}}]),ICEControlPanelManager),Sr=[["mousedown","ICE_MOUSEDOWN"],["mouseup","ICE_MOUSEUP"],["mousemove","ICE_MOUSEMOVE"],["click","ICE_CLICK"],["dblclick","ICE_DBCLICK"],["contextmenu","ICE_CONTEXTMENU"]],Or=[["keydown","ICE_KEYDOWN"],["keyup","ICE_KEYUP"]],Ir=(_createClass(DOMEventDispatcher,[{key:"start",value:function start(){for(var i=this,r=null,o=[].concat(_toConsumableArray(Sr),_toConsumableArray(Or)),t=0;t<o.length;t++)!function J9(t){var e=(t=o[t])[0],n=t[1];i.ice.evtBus.on(n,function(t){i._stopped||((r="ICE_MOUSEMOVE"!==n&&-1===n.indexOf("KEY")?i.findTargetComponent(t):r)&&(t.target=r).trigger(e,t),i.ice.evtBus.trigger(e,t,{component:r}))})}(t);return this}},{key:"stopped",get:function get(){return this._stopped},set:function set(t){this._stopped=t}},{key:"findTargetComponent",value:function findTargetComponent(t){if(this._stopped)return null;var e=t.offsetX,n=t.offsetY,i=(t=flattenTree([],this.ice.childNodes),flattenTree([],this.ice.toolNodes)),r=[].concat(_toConsumableArray(t),_toConsumableArray(i));r.sort(function(t,e){return t.state.zIndex-e.state.zIndex});for(var o=0;o<r.length;o++){var s=r[o],a=(l=s.state).interactive,l=l.display;s.containsPoint(e,n)&&a&&l&&this.selectionCandidates.push(s)}return t=this.selectionCandidates.pop(),this.selectionCandidates=[],t}}]),DOMEventDispatcher),jr={evtBuses:[],start:function start(){if(_&&_.addEventListener){function dk(t){for(var n=jr.evtBuses[t],i=[].concat(_toConsumableArray(Sr),_toConsumableArray(Or)),e=0;e<i.length;e++)!function ik(t){var e=i[t];_.addEventListener(e[0],function(t){n.trigger(e[1],t)})}(e)}for(var t=0;t<jr.evtBuses.length;t++)dk(t)}},regitserEvtBus:function regitserEvtBus(t){jr.evtBuses.includes(t)||jr.evtBuses.push(t)},delEvtBus:function delEvtBus(t){jr.evtBuses.includes(t)&&jr.evtBuses.splice(jr.evtBuses.indexOf(t),1)}},$r=(_inherits(EventBus,l),Ui=_createSuper(EventBus),_createClass(EventBus)),Mr=(_createClass(GeoLine,[{key:"contains",value:function contains(t,e){var n=Math.hypot(this.endPoint.x-this.startPoint.x,this.endPoint.y-this.startPoint.y),i=Math.hypot(t-this.startPoint.x,e-this.startPoint.y);return n-3<=i+(t=Math.hypot(t-this.endPoint.x,e-this.endPoint.y))&&i+t<=n+3}}]),GeoLine),j=(_createClass(GeoPoint,[{key:"equals",value:function equals(t){return this.x==t.x&&this.y==t.y}},{key:"clone",value:function clone(){return new GeoPoint(this.x,this.y)}}],[{key:"load",value:function load(t){return new GeoPoint(Number(t.x),Number(t.y))}},{key:"cloneArray",value:function cloneArray(t){for(var e=[],n=0;n<t.length;n++)e.push(t[n].clone());return e}}]),GeoPoint),f=(_inherits(ICEDotPath,h),Fi=_createSuper(ICEDotPath),_createClass(ICEDotPath,[{key:"calcComponentParams",value:function calcComponentParams(){if(!this.dirty)return{width:this.state.width,height:this.state.height};this.calcDots();var t=this.calc4VertexPoints(),e=Math.abs(t[1][0]-t[0][0]),t=Math.abs(t[2][1]-t[0][1]);return this.state.width=e,this.state.height=t,{width:this.state.width,height:this.state.height}}},{key:"calcLocalOrigin",value:function calcLocalOrigin(){for(var t=_get(_getPrototypeOf(ICEDotPath.prototype),"calcLocalOrigin",this).call(this),e=0;e<this.state.dots.length;e++){var n=transformMat2d([],this.state.dots[e],[1,0,0,1,-t[0],-t[1]]);this.state.dots[e]=n}return t}},{key:"createPathObject",value:function createPathObject(){this.path2D=new Path2D,this.path2D.moveTo(this.state.dots[0][0],this.state.dots[0][1]);for(var t=1;t<this.state.dots.length;t++){var e=this.state.dots[t];this.path2D.lineTo(e[0],e[1])}return this.path2D}},{key:"calcDots",value:function calcDots(){return this.state.dots=[],this.state.dots}},{key:"calc4VertexPoints",value:function calc4VertexPoints(){for(var t=this.state.dots[0][0],e=this.state.dots[0][1],n=this.state.dots[0][0],i=this.state.dots[0][1],r=1;r<this.state.dots.length;r++){var o=this.state.dots[r];o[0]<t&&(t=o[0]),o[0]>n&&(n=o[0]),o[1]<e&&(e=o[1]),o[1]>i&&(i=o[1])}return[[t,e],[n,e],[t,i],[n,i]]}},{key:"getTransformedDots",value:function getTransformedDots(){for(var t=this.state.composedMatrix,e=this.state.dots,n=[],i=0;i<e.length;i++){var r=transformMat2d([],e[i],t);n.push(r)}return n}}]),ICEDotPath),d=(_inherits(ICEImage,t),Vi=_createSuper(ICEImage),_createClass(ICEImage,[{key:"doRender",value:function doRender(){var t,e;this.state.src&&(t=(e=this.ice.imageCache.setImage(this.state.src)).loaded,e=e.image,t&&this.ctx.drawImage(e,0-this.state.localOrigin[0],0-this.state.localOrigin[1],this.state.width,this.state.height)),_get(_getPrototypeOf(ICEImage.prototype),"doRender",this).call(this)}}]),ICEImage);function ICEImage(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck(this,ICEImage),Vi.call(this,_objectSpread2({width:100,height:100,src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALkAAAC2CAYAAACF+yyJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAtoSURBVHhe7Z3tj15FHYb9VxUVo7zFUBWC8YXoF9++GENMRAWRKAkxGj8pihpjFBVF1CBlKaUU+wK0pYVqt12fn+6xs7PXnDPzO3O2Z+a5r+T6ss995nm2vXf3vM68570vXNuTsmdVctm9KrnsXpVcdq9KLrtXJZfdq5LL7lXJZfeq5LJ7VXLZvSq57F6VXHavSi67VyWX3auSy+5VyWX3quSye1Vy2b0quexelVx2r0ouu1cll92rksvuVcll96rksntVctm9KrnsXpVcdq9KLrtXJZfdq5LL7lXJZfeq5LJ7VfIjcIy7j/M2sp4q+YKWQNvLOqrkC+nhodO7OJacp0q+gHO4/2UVvbYqeWXH+O2lG3sf29nd++Eb1/e/wtC40q9KXtGfX+Dy3v4PzpspKCt9quQVJSgXS1BO+lTJK0pQLvab/zz8F+CjL3FWlquSV/KBE7v79bwJ5VISlJPlquSV/AXsj1MuJUE5Wa5KXsmfvKWSr1WVvJJ2BiWGciljLm/2figny1XJK0pQLvbS4d15zEmfKnlFicfPXsdsKEE56VMlr+hdx7mwqV2P75/ji0dvboahvPSpkle2BjSu9KuSL+AcaDw5T5V8IT3QOHK+KvmCni/oOm0v66iSO/zz5Rv71cwr56Nn+ADzmUs3MB8bQq/LcVVyhzHvg0wsQbnYmCfPTZ+SlAdVyQv92mm4crPhzokHkgnKhaagrEyrkjtM8eAr6UfXCMoNpqCsHFcld5rC7g3PzVPOTPHZkR8imbbpkqeg7BKm+NXFw0Un4swH4CavgTuOaH6Wd/gYGbOt2GTJc8k5IJxrileuHjxzQoSv37uTHutWfh8x9zU4m0BTJd959+apu1z+tdmExgoN+euVvNN6oSnCe1aI4bUvneKDWWPI5PrhFw++F2VC6dG7HGistdpMyc/9u7zgA/bfSGMOxlBmyhT2qVOv29efSNykZYTj5xrz2Jn0KcdvOQs+QGOu0SZKbn+u5/LAyJ/ZGO/uQSnPvp3+waXxc4x57nL6L9Ncnh0Ze002UfIUlDVTUNYkKJdjDWjcHD938vBuD+XMFJQ1U1B2ba6+5HZWgaBsKPFwhdN7Oc6BxsuVoJxJUC6UuJi4V35Nrr7kBOVIYk6uRA80TonEnBxJUG5NquQbbZLNGMqVWgJtX2rMcNA7lTMoR9JRBOXWZHMlt4d+KUc+VTBNRIydzaFcqTnQdqXeVjBbAEE5ki5YUW5NNlfy+CLLmN876y+5QTmPYyc/Ke+RoJxJUC5lDGXWpHZX9iUo55WgnFeCciZBOfL5K4d/ZCm3JlXyfR+BBxso55WgnFeCciZBOZKg3Jpcfcl/nJiwnrKhqWt5x3byLwr98kK9BxQIynmNscn+KWemoGxo6uIVZdfk6ktupqCseW1sJ3gf2o6gnEeCch4vwPCUy4G2M/8OuykGZddmEyW3ZUjG+PSJ3f9etr+eUe6Y8H2I8PU5EpTzSISv0370FF8+tbv38c1fA/oBCgnfZ602UXJzSexGJXsPe7A4Jv4cXgnKeSTs6zXu+Rkj/hxrtZmSm15yt6Xc11+vc/80QTmPMXb7Qg60bS7xZ1izTZXcLLmn/Orm/zrc1vubLRzDK0G5Un9zsXxXxB7GDsewSUlLCLdtweZKPjh2f/m7Ublj/zhyiytBY5RKUK7UEuy7pjEGfwZXiENomxZstuQ1zIW2LfE1ezwpAeVLzIW23Ra3uuSDOdB2U9rzkDn8yfnwQQ73ahU5/SYv4Y3NJjQO6eGDI4vahqYmOBpjm5dM3KqSp66elnL3yPQQNaBxB2twttIdlq3YfcmXJHyfF96ZPpgdzvb84HzeD1s4/pJ8pvNJi7or+e8Lz5wQdrXPxqIFaGNy/zbEn9PM4W8ZVyvte7bxPhRNR+Hh7YL79Vuxq5J7ic+nx6ZmlcqBxoudA403+LuJ2yHGoPFadWtL/qnNb2kaY8wShlsFch2bIo6gMcYsvRBmD5zQOC26NSWvdbD1/oky2k1itF2uT8Py5SHfrVS+qYNw2qZVuyq5FSDkngVPmxGU80pQrpYhdqsyZVq1uwPPo5KgnFeCcnJaldwpQTmvBOXktCq5U4JyXgnKyWlVcqcE5bwSlJPTquROCcp5JSgnp1XJnRKU80pQTk6rkjslKOeVoJycViV3SlDOK0E5Oa1K7pSgnFeCcnJaldwpQTmvBOXktF2VPL6sP/Zww1wJynklKFfLkKm7Mluzq5KPUesGram7Be3mVtou119PTDGhG7TK3ZqSx3xy4VttHx1ZWpC05ztLoDHG1K22nehl6mkYPTTRtt0deP6hwuNvX3z1f7/l7bf9FLmTjMaf08zBVoiewiZLsvFqPP4WriLdi92VPPQoJ7zMeZB5WAJdDzIfrV2XPLbWlBR3aUqKptyqkseWcqagHB40udAybnXJB3Og7ab8ROY0cXaASNtPmXM4oGni9Js8C9q2xFOa8POW2mzJbdchhZ3yo20GS8/A0BilEpQrtQT7rmmMQVsIbAzapgWbK/lLmoT/gJ5J+L/62sGzKY/B8o5jhNu2YFMl95K7LeVaXE7lG6/nlZa2zSX+DGu2mZIvyTDbFV0hjD+HV4JyHgn7+lFeJ1izTZQ8Z4lDuzqpJQ5vEr6ec9U05guv7u7d//Lu3lsTPyfh+6zVJkqegrLmyDHp/6HtCMp5JCjn8SgWq039oFB2ba6+5LWXHS9ZjrvlZceP7XDOTEHZ0NRZKcquydWXnKAcSVDOfATOMFDOK0E5rwTlTIJyJEG5NamS70tQzitBOa8E5UyCcuRzlw//Nqfcmmyu5Ceu5l8Ctxv/YyhnEpTzOHZCj/IeCcqZBOVSxlBmTTZX8pLlPmjxVcqZMbYYLuVKzYG2K5XmTaecSVCOLHmftajdlY12qiyGcqWWQNuXGmM7Fjk5g3IkHXpSbk2q5AW5Ej3QOCUSc3IkQbk1ufqS33Hc9w9LfDuxjg9BuVznQOPlSlDOJCgXStg5esquydWX3ExBWTMFZU2CcjnWgMbN8fMn83e7UlDWTEHZtdlEyUtXRiPGpqCIsXs+KDdlKc+PXG6n8XOMsVN+lDPnYldBady12UTJTVvX3kvqAGwwhjJTphjem7CvP3EufYIxHD/XmO+MzP9iN6bNgcZco82U3Bx7wibF1AMUZshfRn7zpUxxJXhvYnjtK6fSj8kNmVzvjI5hKBP6sLPoNNZabarkg7l4dztKTHEyumhFhK8f20kX/VZ+HzH23Cptv2abLPlgCsouYQqbzzAnG2duHzn2+MiLB7NLaWt4Ekfxg7aUTZf8VpoitQ9MUM5M4VkqXarkLlM8ODITFUG5wRSUleOq5IWmJvaxAz7KDxKUC01BWZlWJXcYcxtkYgnKxcY8ea7egxzbokruMLynml6PtbnKiWcyZ84KodfluCr5gp5P73EcgraXdVTJF9IDjSPnq5Iv4BxoPDlPlbyyNaBxpV+VvKK2pCJxaZeL+zg8g2q8uRmG8tKnSl5RImdJQoJy0qdKXlGCcrEX4foS5aRPlbySdHMV5VLGlMxKIMdVySv504LpL0iCcrJclbyStEoD5VISlJPlquSVpIVtKZeSoJwsVyWvKEG5WHrWcpuXJKytSl5RgnKxBOWkT5W8ok8nVk+zNe8pb6agrPSpkld2DLu11hYB+NHE8uc0rvSrki/gHO5r8Gn4tauSL6SHh06r4Euoki9oCbS9rKNKfgSOcY9OFS6uSi67VyWX3auSy+5VyWX3quSye1Vy2b0quexelVx2r0ouu1cll92rksvuVcll96rksntVctm9KrnsXpVcdq9KLrtXJZfdq5LL7lXJZfeq5LJ7VXLZvSq57F6VXHavSi67VyWX3auSy+5VyWX3quSye1Vy2b0quezca3v/AeMnvtkH1pHJAAAAAElFTkSuQmCC"},t))}function ICEDotPath(t){return _classCallCheck(this,ICEDotPath),Fi.call(this,_objectSpread2({dots:[],closePath:!0},t))}function GeoPoint(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0;_classCallCheck(this,GeoPoint),this.x=t,this.y=e}function GeoLine(t,e){_classCallCheck(this,GeoLine),this.startPoint=t,this.endPoint=e}function EventBus(){return _classCallCheck(this,EventBus),Ui.call(this)}function DOMEventDispatcher(t){_classCallCheck(this,DOMEventDispatcher),_defineProperty$1(this,"selectionCandidates",[]),_defineProperty$1(this,"_stopped",!1),this.ice=t}function ICEControlPanelManager(t){_classCallCheck(this,ICEControlPanelManager),this.ice=t,this.transformControlPanel=new xr({left:500,top:100,width:100,height:100,style:{strokeStyle:"#8b0000",fillStyle:"rgba(255, 255, 49, 0.2)",lineWidth:1},transform:{rotate:45}}),this.ice.addTool(this.transformControlPanel),this.transformControlPanel.disable(),this.lineControlPanel=new rr({left:700,top:50,width:100,height:100,style:{strokeStyle:"rgba(255, 255, 49, 0)",fillStyle:"rgba(255, 255, 49, 0)",lineWidth:1}}),this.ice.addTool(this.lineControlPanel),this.lineControlPanel.disable()}function TransformControlPanel(t){return _classCallCheck(this,TransformControlPanel),_defineProperty$1(_assertThisInitialized(t=qi.call(this,_objectSpread2(_objectSpread2({},t),{},{zIndex:10000001,linkable:!1,showMinBoundingBox:!1,showMaxBoundingBox:!1}))),"rotateControlSize",8),_defineProperty$1(_assertThisInitialized(t),"rotateControlffsetY",60),_defineProperty$1(_assertThisInitialized(t),"resizeControlInstanceCache",[]),_defineProperty$1(_assertThisInitialized(t),"resizeControlSize",16),t.initControls(),t}function RotateControl(t){return _classCallCheck(this,RotateControl),Wi.call(this,_objectSpread2(_objectSpread2({},t),{},{linkable:!1}))}function ResizeControl(t){return _classCallCheck(this,ResizeControl),Gi.call(this,_objectSpread2(_objectSpread2({position:"l",direction:"x",quadrant:1},t),{},{linkable:!1}))}function LineControlPanel(t){return _classCallCheck(this,LineControlPanel),_defineProperty$1(_assertThisInitialized(t=Xi.call(this,_objectSpread2(_objectSpread2({},t),{},{zIndex:10001e3,linkable:!1,showMinBoundingBox:!1,showMaxBoundingBox:!1}))),"controlSize",16),t.initControls(),t}function ICELinkHook(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck(this,ICELinkHook),Ji.call(this,_objectSpread2({linkable:!1},t))}function ICECircle(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck(this,ICECircle),(t=_objectSpread2({radius:10},t)).radiusX=t.radius,t.radiusY=t.radius,Ki.call(this,t)}function ICEEllipse(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck(this,ICEEllipse),(t=_objectSpread2({radiusX:20,radiusY:10,rotation:0,startAngle:0,endAngle:2*Math.PI,counterclockwise:!0},t)).width=2*t.radiusX,t.height=2*t.radiusY,Qi.call(this,t)}function ICEControlPanel(t){return _classCallCheck(this,ICEControlPanel),_defineProperty$1(_assertThisInitialized(t=Zi.call(this,_objectSpread2(_objectSpread2({},t),{},{linkable:!1}))),"isControlPanel",!0),t}function ICEGroup(t){return _classCallCheck(this,ICEGroup),_defineProperty$1(_assertThisInitialized(t=Yi.call(this,t)),"parentNode",null),_defineProperty$1(_assertThisInitialized(t),"childNodes",[]),t}function ICERect(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck(this,ICERect),tr.call(this,_objectSpread2({width:10,height:10},t))}function ICEPath(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck(this,ICEPath),_defineProperty$1(_assertThisInitialized(t=er.call(this,_objectSpread2({closePath:!0},t))),"path2D",new Path2D),t}function ICEComponent(){var t,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck(this,ICEComponent),_defineProperty$1(_assertThisInitialized(t=nr.call(this)),"__dirty",!0),_defineProperty$1(_assertThisInitialized(t),"props",{id:"ICE_"+function uuid(){if(_.crypto)return _.crypto.randomUUID();var n=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=(n+16*Math.random())%16|0;return n=Math.floor(n/16),("x"==t?e:3&e|8).toString(16)})}(),left:0,top:0,width:0,height:0,style:{fillStyle:"red",strokeStyle:"blue",lineWidth:1},fill:!0,stroke:!0,animations:{},transform:{translate:[0,0],scale:[1,1],skew:[0,0],rotate:0},linearMatrix:[],composedMatrix:[],origin:"localCenter",localOrigin:[0,0],absoluteOrigin:[0,0],zIndex:ICEComponent.instanceCounter++,display:!0,draggable:!0,transformable:!0,interactive:!0,linkable:!0,showMinBoundingBox:!1,showMaxBoundingBox:!1}),_defineProperty$1(_assertThisInitialized(t),"state",{}),t.props=Pn(t.props,e),t.state=b2(t.props),t.root=_,t.initEvents(),t}_createClass(function ICEBezier(){_classCallCheck(this,ICEBezier)});_inherits(ICELinkSlot,b),Tr=_createSuper(ICELinkSlot),_createClass(ICELinkSlot,[{key:"initEvents",value:function initEvents(){_get(_getPrototypeOf(ICELinkSlot.prototype),"initEvents",this).call(this),this.once(N,this.beforeRenderHandler,this),this.once(F,this.beforeRemoveHandler,this)}},{key:"keyboardEvtHandler",value:function keyboardEvtHandler(t){}},{key:"beforeRenderHandler",value:function beforeRenderHandler(t){this.evtBus.on(W,this.hookMouseDownHandler,this),this.evtBus.on(G,this.hookMouseMoveHandler,this),this.evtBus.on(X,this.hookMouseUpHandler,this),this.evtBus.on("mouseup",this.globalMouseUpHandler,this)}},{key:"beforeRemoveHandler",value:function beforeRemoveHandler(t){this.evtBus.off(W,this.hookMouseDownHandler,this),this.evtBus.off(G,this.hookMouseMoveHandler,this),this.evtBus.off(X,this.hookMouseUpHandler,this),this.evtBus.off("mouseup",this.globalMouseUpHandler,this),this.hostComponent=null}},{key:"globalMouseUpHandler",value:function globalMouseUpHandler(){this.setState({display:!1})}},{key:"hookMouseDownHandler",value:function hookMouseDownHandler(t){this._hostComponent&&this.setState({display:!0})}},{key:"hookMouseMoveHandler",value:function hookMouseMoveHandler(t){t=t.target,this.isIntersectWithHook(t)?(this.setState({style:{fillStyle:"#fffb00"}}),t._currentAboveSlot=this,t.setState({style:{fillStyle:"#fffb00"}})):(this.setState({style:{fillStyle:"#3ce92c"}}),t._currentAboveSlot===this&&t.setState({style:{fillStyle:"#3ce92c"}}))}},{key:"hookMouseUpHandler",value:function hookMouseUpHandler(t){var e,n;this._hostComponent&&(e=(t=t.target).parentNode.targetComponent,n=t.state.position,this.isIntersectWithHook(t)?e&&e.setLink(n,this._hostComponent,this.props.position):e&&e.removeLink(n,this._hostComponent,this.props.position),this.setState({display:!1,style:{fillStyle:"#3ce92c"}}),t.setState({style:{fillStyle:"#3ce92c"}}))}},{key:"isIntersectWithHook",value:function isIntersectWithHook(t){var e=this.getMaxBoundingBox();return t=t.getMaxBoundingBox(),!!e.isIntersect(t)}},{key:"updatePosition",value:function updatePosition(){var t=this._hostComponent.getMinBoundingBox(),e=0,n=0;switch(this.state.position){case"T":e=t.tc[0]-this.state.radius,n=t.tc[1]-this.state.radius;break;case"R":e=t.rc[0]-this.state.radius,n=t.rc[1]-this.state.radius;break;case"B":e=t.bc[0]-this.state.radius,n=t.bc[1]-this.state.radius;break;case"L":e=t.lc[0]-this.state.radius,n=t.lc[1]-this.state.radius}this.setState({left:e,top:n})}},{key:"hostComponent",get:function get(){return this._hostComponent},set:function set(t){var e=this;this._hostComponent&&this._hostComponent.off(D,this.updatePosition,this),this._hostComponent=t,this._hostComponent&&this._hostComponent.on(D,this.updatePosition,this),this._hostComponent&&this._hostComponent.once(F,function(){e._hostComponent=null,e.setState({display:!1})},this),this._hostComponent&&this.setState({display:!0})}}]);var Ar,Br,Lr,Tr,zr,Rr=ICELinkSlot,Nr=(_inherits(ICEPolyLine,f),Lr=_createSuper(ICEPolyLine),_createClass(ICEPolyLine,[{key:"initEvents",value:function initEvents(){_get(_getPrototypeOf(ICEPolyLine.prototype),"initEvents",this).call(this),this.once(V,this.afterAddHandler,this)}},{key:"afterAddHandler",value:function afterAddHandler(t){this.evtBus.once(U,this.makeConnection,this)}},{key:"makeConnection",value:function makeConnection(){var t,e,n=this.state.links;n&&(n.start&&(t=n.start.id,e=n.start.position,t&&e&&(t=this.ice.findComponent(t),this.setLink("start",t,e))),n.end&&(t=n.end.id,e=n.end.position,t&&e&&(n=this.ice.findComponent(t),this.setLink("end",n,e)))),this.ice.dirty=!0}},{key:"setLink",value:function setLink(t,e,n){this.removeLink(t,e,n),this.links[t]={component:e,position:n},e.on(Q,this.followComponent,this),e.on(c,this.followComponent,this),e.on(K,this.followComponent,this),e.once(D,this.followComponent,this),this.followComponent();var i,r={};for(i in this.links){var o=this.links[i];o.component&&o.position&&(r[i]={id:o.component.props.id,position:o.position})}this.setState({links:_objectSpread2({},r),draggable:!1})}},{key:"removeLink",value:function removeLink(t,e,n){var i=this.links[t].component,r=this.links[t].position;i===e&&r===n&&(i&&i.off(Q,this.followComponent,this),i&&i.off(c,this.followComponent,this),i&&i.off(K,this.followComponent,this),this.links[t]={},this.state.links[t]={}),this.links.start.component||this.links.end.component||this.setState({draggable:!0})}},{key:"getLinkFromId",value:function getLinkFromId(){return this.state.links.start.id}},{key:"getLinkToId",value:function getLinkToId(){return this.state.links.end.id}},{key:"followComponent",value:function followComponent(t){for(var e in this.links){var n=this.links[e].position,i=this.links[e].component;if(n&&i){var r=i.getMinBoundingBox(),o=[0,0];switch(n){case"T":o=r.tc;break;case"R":o=r.rc;break;case"B":o=r.bc;break;case"L":o=r.lc}switch(e){case"start":this.setState({startPoint:_toConsumableArray(o)});break;case"end":this.setState({endPoint:_toConsumableArray(o)})}}}}},{key:"calcLocalOrigin",value:function calcLocalOrigin(){return this.state.localOrigin=[0,0]}},{key:"calcDots",value:function calcDots(){var t=this.state.left,e=this.state.top;this.state.dots=[];for(var n=0;n<this.state.points.length;n++){var i=(r=this.state.points[n])[0]-t,r=r[1]-e;this.state.dots.push([i,r])}return this.calcArrowPoints(),this.state.dots}},{key:"calcArrowPoints",value:function calcArrowPoints(){var t,e,n;"start"!==this.state.arrow&&"both"!==this.state.arrow||(n=_toConsumableArray(this.state.dots[0]),e=[_toConsumableArray(this.state.dots[0]),_toConsumableArray(this.state.dots[1])],e=this.doCalcArrowPoints(e),(t=this.state.dots).unshift.apply(t,_toConsumableArray(e)),this.state.dots.unshift(_toConsumableArray(n))),"end"!==this.state.arrow&&"both"!==this.state.arrow||(t=this.state.dots.length,e=_toConsumableArray(this.state.dots[t-1]),n=[_toConsumableArray(this.state.dots[t-1]),_toConsumableArray(this.state.dots[t-2])],n=this.doCalcArrowPoints(n),(t=this.state.dots).push.apply(t,_toConsumableArray(n)),this.state.dots.push(_toConsumableArray(e)))}},{key:"doCalcArrowPoints",value:function doCalcArrowPoints(t){var e=t[0],n=((t=t[1])[0]=t[0]-e[0],t[1]=t[1]-e[1],t[0]/Math.hypot.apply(Math,_toConsumableArray(t))),i=(t=t[1]/Math.hypot.apply(Math,_toConsumableArray(t)),Math.cos(this.state.arrowAngel)),r=Math.sin(this.state.arrowAngel),o=this.state.arrowLength*(n*i-t*r),s=this.state.arrowLength*(t*i+n*r),a=this.state.arrowLength*(n*i+t*r);return t=this.state.arrowLength*(t*i-n*r),[[o+=e[0],s+=e[1]],[a+=e[0],t+=e[1]]]}},{key:"addDot",value:function addDot(t,e){this.state.points.splice(e,0,t),this.state.dots.splice(e,0,[t[0],t[1]])}},{key:"rmDot",value:function rmDot(t){return!(this.state.points.length<3||(this.state.points.splice(t,1),this.state.dots.splice(t,1),0))}},{key:"calcComponentParams",value:function calcComponentParams(){if(!this.dirty)return{width:this.state.width,height:this.state.height};this.calcDots();var t=this.calc4VertexPoints(),e=Math.abs(t[1][0]-t[0][0]),n=this.state.style.lineWidth;return this.isDotsOnSameLine()||(n=Math.abs(t[2][1]-t[0][1])),this.state.width=e,this.state.height=n,{width:this.state.width,height:this.state.height}}},{key:"isDotsOnSameLine",value:function isDotsOnSameLine(){for(var t,e=this.state.points.length,n=kr(this.state.points[0][0],2),i=kr(this.state.points[0][1],2),r=0,o=[kr(this.state.points[e-1][0],2)-n,kr(this.state.points[e-1][1],2)-i],s=0;s<e;s++){var a=[(a=this.state.points[s])[0]-n,a[1]-i];0===(a=o[0]*a[1]-o[1]*a[0],(t=[])[0]=t[1]=0,t[2]=a,t[2])&&r++}return r===e}},{key:"calc4VertexPoints",value:function calc4VertexPoints(){return this.isDotsOnSameLine()?this.splitEndpointsTo4Points():_get(_getPrototypeOf(ICEPolyLine.prototype),"calc4VertexPoints",this).call(this)}},{key:"splitEndpointsTo4Points",value:function splitEndpointsTo4Points(){var t=this.state.points.length,e=this.state.points[t-1][0]-this.state.points[0][0],n=(t=this.state.points[t-1][1]-this.state.points[0][1],this.getRotateAngle()),i=this.state.height,r=Math.cos(n*Math.PI/180)*i/2,n=Math.sin(n*Math.PI/180)*i/2;return[[0+(r=kr(r,3)),0+(n=kr(n,3))],[0-r,0-n],[e+r,t+n],[e-r,t-n]]}},{key:"getMinBoundingBox",value:function getMinBoundingBox(){var t=this.state.localOrigin[0],e=this.state.localOrigin[1],n=this.calc4VertexPoints();return(t=new Hi([n[0][0]-t,n[0][1]-e,n[1][0]-t,n[1][1]-e,n[2][0]-t,n[2][1]-e,n[3][0]-t,n[3][1]-e,0,0])).transform(this.state.composedMatrix)}},{key:"setState",value:function setState(t){if(x2(t.width)||delete t.width,x2(t.height)||delete t.height,x2(t.transform)||delete t.transform,!x2(t.left))for(var e=t.left-this.state.points[0][0],n=0;n<this.state.points.length;n++)this.state.points[n][0]+=e;if(!x2(t.top))for(var i=t.top-this.state.points[0][1],r=0;r<this.state.points.length;r++)this.state.points[r][1]+=i;var o;x2(t.startPoint)||(this.state.points[0]=_toConsumableArray(t.startPoint),this.state.left=this.state.points[0][0],this.state.top=this.state.points[0][1]),x2(t.endPoint)||(o=this.state.points.length,this.state.points[o-1]=_toConsumableArray(t.endPoint)),_get(_getPrototypeOf(ICEPolyLine.prototype),"setState",this).call(this,t)}},{key:"getRotateAngle",value:function getRotateAngle(){var t,e;return this.isDotsOnSameLine()?(e=this.state.points.length,t=this.state.points[e-1][0]-this.state.points[0][0],e=this.state.points[e-1][1]-this.state.points[0][1],Di.calcRotateAngle(t,e,0,0)+90):_get(_getPrototypeOf(ICEPolyLine.prototype),"getRotateAngle",this).call(this)}},{key:"containsPoint",value:function containsPoint(t,e){for(var n=this.getLines(),i=0;i<n.length;i++){var r=(a=n[i]).o[0],o=a.o[1],s=a.d[0],a=a.d[1],l=Math.hypot(s-r,a-o);if(l-3<=(r=Math.hypot(r-t,o-e))+(o=Math.hypot(s-t,a-e))&&r+o<=l+3)return!0}return!1}},{key:"getLines",value:function getLines(){var t=[],e=this.getTransformedDots();if(!e||e.length<2)return t;for(var n=0;n<e.length-1;n++){var i={o:[e[n][0],e[n][1]],d:[e[n+1][0],e[n+1][1]]};t.push(i)}return t}},{key:"destory",value:function destory(){this.links.start&&this.removeLink("start",this.links.start.component,this.links.start.position),this.links.end&&this.removeLink("end",this.links.end.component,this.links.end.position),_get(_getPrototypeOf(ICEPolyLine.prototype),"destory",this).call(this)}}],[{key:"arrangeParam",value:function arrangeParam(t){var e=Pn({},{lineType:"solid",lineWidth:1,arrow:"none",arrowLength:15,arrowAngel:30*En,points:[],showMinBoundingBox:!1,showMaxBoundingBox:!1,links:{},style:{lineJoin:"round"}},t,{linkable:!1,closePath:!1,fill:!1}),n=e.points.length;return n<2&&(0===n?(e.points.push([0,0]),e.points.push([10,10])):1===n&&e.points.push([10,10])),(e=_objectSpread2(_objectSpread2({},e),{left:t.points[0][0],top:t.points[0][1],transform:{translate:[0,0],scale:[1,1],skew:[0,0],rotate:0}})).style.lineWidth<1&&(e.style.lineWidth=1),e}}]),ICEPolyLine),v=(_inherits(ICEVisioLink,Nr),Br=_createSuper(ICEVisioLink),_createClass(ICEVisioLink,[{key:"calcDots",value:function calcDots(){var t=this.interpolate(),e=this.state,n=e.left,i=e.top,r=t[0][2];this.state.points=[],this.state.dots=[];for(var o=0;o<r.length;o++){var s=r[o];this.state.points.push([s.x,s.y]),this.state.dots.push([s.x-n,s.y-i])}return this.calcArrowPoints(),this.state.dots}},{key:"interpolate",value:function interpolate(){var t=this.state.points.length,e=this.state.points[0][0],n=this.state.points[0][1],i=this.state.points[t-1][0],r=(t=this.state.points[t-1][1],new j(e,n)),o=new j(i,t),s=[],a=null,l=null,c=[],h=new Hi,u=new Hi;if(e=this.links.start.component){h=e.getMinBoundingBox(),s[0]=new j(r.x,h.tl[1]-this.state.escapeDistance),s[1]=new j(h.tr[0]+this.state.escapeDistance,r.y),s[2]=new j(r.x,h.br[1]+this.state.escapeDistance),s[3]=new j(h.tl[0]-this.state.escapeDistance,r.y);for(var a=s[0],d=1;d<s.length;d++)this.distance(r,s[d])<this.distance(r,a)&&(a=s[d])}if(n=this.links.end.component){u=n.getMinBoundingBox(),s[0]=new j(o.x,u.tl[1]-this.state.escapeDistance),s[1]=new j(u.tr[0]+this.state.escapeDistance,o.y),s[2]=new j(o.x,u.br[1]+this.state.escapeDistance),s[3]=new j(u.tl[0]-this.state.escapeDistance,o.y);for(var l=s[0],p=1;p<s.length;p++)this.distance(o,s[p])<this.distance(o,l)&&(l=s[p])}i=0,t=[r],a&&(t.push(a),i=1),l&&t.push(l),t.push(o),e=j.cloneArray(t),c.push(["s0","s0",e]),n=j.cloneArray(t),(e=j.cloneArray(n)).splice(i+1,0,new j(e[i].x,e[i+1].y)),c.push(["s1","s1_1",e]),(t=j.cloneArray(n)).splice(i+1,0,new j(t[i+1].x,t[i].y)),c.push(["s1","s1_2",t]);var e=j.cloneArray(n),t=new j((e[i].x+e[i+1].x)/2,e[i].y),f=new j((e[i].x+e[i+1].x)/2,e[i+1].y);e.splice(i+1,0,t,f),c.push(["s2","s2_1",e]),t=j.cloneArray(n),f=new j(t[i].x,(t[i].y+t[i+1].y)/2),e=new j(t[i+1].x,(t[i].y+t[i+1].y)/2),e=[(t.splice(i+1,0,f,e),c.push(["s2","s2_2",t]),(f=j.cloneArray(n))[i].x+20),f[i+1].x+20],h&&e.push(h.br[0]+20),u&&e.push(u.br[0]+20),t=this.max(e),e=new j(t,f[i].y),t=new j(t,f[i+1].y),t=[(f.splice(i+1,0,e,t),c.push(["s2","s2_3",f]),(e=j.cloneArray(n))[i].y-20),e[i+1].y-20],h&&t.push(h.tl[1]-20),u&&t.push(u.tl[1]-20),f=this.min(t),t=new j(e[i].x,f),f=new j(e[i+1].x,f),f=[(e.splice(i+1,0,t,f),c.push(["s2","s2_4",e]),(t=j.cloneArray(n))[i].x-20),t[i+1].x-20],h&&f.push(h.tl[0]-20),u&&f.push(u.tl[0]-20),e=this.min(f),f=new j(e,t[i].y),e=new j(e,t[i+1].y),e=[(t.splice(i+1,0,f,e),c.push(["s2","s2_5",t]),(f=j.cloneArray(n))[i].y+20),f[i+1].y+20],h&&e.push(h.tl[1]+h.height+20),u&&e.push(u.tl[1]+u.height+20),t=this.max(e),n=new j(f[i].x,t),e=new j(f[i+1].x,t),f.splice(i+1,0,n,e),c.push(["s2","s2_6",f]);for(var y=[],v=0;v<c.length;v++){var g=c[v][2];this.orthogonalPath(g)&&y.push(c[v])}if(c=y,!r.equals(o)){for(var m=[],b=0;b<c.length;b++){var C=c[b][2];this.forwardPath(C)&&m.push(c[b])}(c=m).length}for(var _=[],k=0;k<c.length;k++){var w=!1,P=c[k][2].slice();(u||h)&&(P=P.slice(1,P.length-1)),h&&(w=w||this.polylineIntersectsRectangle(P,h)),(w=u?w||this.polylineIntersectsRectangle(P,u):w)||_.push(c[k])}(c=0!=_.length?_:c).length;for(var x=c[0][2].length,E=[],S=0;S<c.length;S++)c[S][2].length==x&&E.push(c[S]);for(var c=E,O=0,I=0;I<c.length;I++)this.scorePath(c[O][2])<this.scorePath(c[I][2])&&(O=I);return[c[O]]}},{key:"orthogonalPath",value:function orthogonalPath(t){if(t.length<=1)return!0;for(var e=0;e<t.length-1;e++)if(t[e].x!=t[e+1].x&&t[e].y!=t[e+1].y)return!1;return!0}},{key:"lineIntersectsLine",value:function lineIntersectsLine(t,e){if(t.startPoint.x==t.endPoint.x&&e.startPoint.x==e.endPoint.x)return t.startPoint.x==e.startPoint.x&&(t.contains(e.startPoint.x,e.startPoint.y)||t.contains(e.endPoint.x,e.endPoint.y));if(t.startPoint.x==t.endPoint.x||e.startPoint.x==e.endPoint.x)return t.startPoint.x==t.endPoint.x&&(r=t,t=e,e=r),r=(t.endPoint.y-t.startPoint.y)/(t.endPoint.x-t.startPoint.x),n=t.startPoint.y-r*t.startPoint.x,i=e.startPoint.x,t.contains(i,r=r*i+n)&&e.contains(i,r);var n=(t.endPoint.y-t.startPoint.y)/(t.endPoint.x-t.startPoint.x),i=t.startPoint.y-n*t.startPoint.x,r=(e.endPoint.y-e.startPoint.y)/(e.endPoint.x-e.startPoint.x),o=e.startPoint.y-r*e.startPoint.x;return n==r?i==o&&(t.contains(e.startPoint.x,e.startPoint.y)||t.contains(e.endPoint.x,e.endPoint.y)):(r=n*(o=(o-i)/(n-r))+i,t.contains(o,r)&&e.contains(o,r))}},{key:"polylineIntersectsRectangle",value:function polylineIntersectsRectangle(t,e){var n=2<arguments.length&&void 0!==arguments[2]&&arguments[2],i=[];i.push(new Mr(new j(e.x1,e.y1),new j(e.x2,e.y1))),i.push(new Mr(new j(e.x2,e.y1),new j(e.x2,e.y2))),i.push(new Mr(new j(e.x2,e.y2),new j(e.x1,e.y2))),i.push(new Mr(new j(e.x1,e.y2),new j(e.x1,e.y1)));for(var r=0;r<t.length-1;r++)for(var o=new Mr(t[r],t[r+1]),s=0;s<i.length;s++)if(this.lineIntersectsLine(o,i[s]))return!0;if(n)for(var a=new Mr(t[t.length-1],t[0]),l=0;l<i.length;l++)if(this.lineIntersectsLine(a,i[l]))return!0;return!1}},{key:"scorePath",value:function scorePath(t){if(t.length<=2)return-1;for(var e=0,n=1;n<t.length-1;n++)if(t[n-1].x==t[n].x&&t[n].x==t[n+1].x){if(this.signum(t[n+1].y-t[n].y)!=this.signum(t[n].y-t[n-1].y))return-1;e++}else if(t[n-1].y==t[n].y&&t[n].y==t[n+1].y){if(this.signum(t[n+1].x-t[n].x)!=this.signum(t[n].x-t[n-1].x))return-1;e++}else e--;return e}},{key:"signum",value:function signum(t){return 0<t?1:t<0?-1:0}},{key:"forwardPath",value:function forwardPath(t){if(t.length<=2)return!0;for(var e=0;e<t.length-2;e++)if(t[e].x==t[e+1].x&&t[e+1].x==t[e+2].x){if(0!=this.signum(t[e+1].y-t[e].y)&&this.signum(t[e+1].y-t[e].y)==-1*this.signum(t[e+2].y-t[e+1].y))return!1}else if(t[e].y==t[e+1].y&&t[e+1].y==t[e+2].y&&0!=this.signum(t[e+1].x-t[e].x)&&this.signum(t[e+1].x-t[e].x)==-1*this.signum(t[e+2].x-t[e+1].x))return!1;return!0}},{key:"distance",value:function distance(t,e){return Math.hypot(e.x-t.x,e.y-t.y)}},{key:"max",value:function max(t){if(0==t.lenght)return NaN;for(var e=t[0],n=0;n<t.length;n++)e<t[n]&&(e=t[n]);return e}},{key:"min",value:function min(t){if(0==t.lenght)return NaN;for(var e=t[0],n=0;n<t.length;n++)e>t[n]&&(e=t[n]);return e}},{key:"addDot",value:function addDot(t,e){throw new Error("Can NOT add dot to ICEVisioLink mannually.")}},{key:"rmDot",value:function rmDot(t){throw new Error("Can NOT remove dot from ICEVisioLink mannually.")}}],[{key:"arrangeParam",value:function arrangeParam(t){return x2(t.startPoint)&&(t.startPoint=[0,0]),x2(t.endPoint)&&(t.endPoint=[10,10]),t.points=[_toConsumableArray(t.startPoint),_toConsumableArray(t.endPoint)],_objectSpread2({escapeDistance:30},t)}}]),ICEVisioLink),i=(_inherits(ICEIsogon,f),Ar=_createSuper(ICEIsogon),_createClass(ICEIsogon,[{key:"calcDots",value:function calcDots(){this.state.dots=[];for(var t=2*Math.PI/this.state.edges,e=this.state.radius,n=0;n<this.state.edges;n++){var i=t*n-toRadian(this.state.startAngle),r=Math.floor(e*Math.cos(i)+e),i=Math.floor(e*Math.sin(i)+e);this.state.dots.push([r,i])}return this.state.dots}},{key:"calcComponentParams",value:function calcComponentParams(){return this.dirty&&(this.calcDots(),this.state.width=2*this.state.radius,this.state.height=2*this.state.radius),{width:this.state.width,height:this.state.height}}},{key:"setState",value:function setState(t){x2(t.radius)?x2(t.width)?x2(t.height)||(t.radius=t.height/2):t.radius=t.width/2:(t.width=2*t.radius,t.height=2*t.radius),_get(_getPrototypeOf(ICEIsogon.prototype),"setState",this).call(this,t)}}]),ICEIsogon);function ICEIsogon(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck(this,ICEIsogon),(t=_objectSpread2({radius:10,edges:3,startAngle:90},t)).edges=Math.floor(3<=t.edges?t.edges:3),t.width=2*t.radius,t.height=2*t.radius,Ar.call(this,t)}function ICEVisioLink(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck(this,ICEVisioLink),t=ICEVisioLink.arrangeParam(t),Br.call(this,t)}function ICEPolyLine(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck(this,ICEPolyLine),t=ICEPolyLine.arrangeParam(t),_defineProperty$1(_assertThisInitialized(t=Lr.call(this,t)),"isLine",!0),_defineProperty$1(_assertThisInitialized(t),"links",{start:{},end:{}}),t}function ICELinkSlot(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck(this,ICELinkSlot),Tr.call(this,_objectSpread2({linkable:!1,draggable:!1,position:"T"},t))}function ICERose(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck(this,ICERose),(t=_objectSpread2({radius:50,leafNum:2,pointNumber:100},t)).leafNum=Math.floor(2<=t.leafNum?t.leafNum:2),t.width=2*t.radius,t.height=2*t.radius,zr.call(this,t)}_inherits(ICERose,f),zr=_createSuper(ICERose),_createClass(ICERose,[{key:"calcDots",value:function calcDots(){var t=this.state.radius,e=this.state.leafNum;this.state.dots=[];for(var n,i,r=Math.PI/this.state.pointNumber,o=0;n=t+t*Math.sin(e*o)*Math.cos(o),i=t+t*Math.sin(e*o)*Math.sin(o),this.state.dots.push([n,i]),!((o+=r)>=2*Math.PI););return this.state.dots}},{key:"calcComponentParams",value:function calcComponentParams(){return this.dirty&&(this.calcDots(),this.state.width=2*this.state.radius,this.state.height=2*this.state.radius),{width:this.state.width,height:this.state.height}}},{key:"setState",value:function setState(t){x2(t.radius)?x2(t.width)?x2(t.height)||(t.radius=t.height/2,t.width=t.height):(t.radius=t.width/2,t.height=t.width):(t.width=2*t.radius,t.height=2*t.radius),_get(_getPrototypeOf(ICERose.prototype),"setState",this).call(this,t)}}]);_inherits(ICEStar,f),Vr=_createSuper(ICEStar),_createClass(ICEStar,[{key:"calcDots",value:function calcDots(){this.state.dots=[];for(var t,e,n=toRadian(this.state.startAngle),i=Math.PI/this.state.spikes,r=this.state.outerRadius,o=this.state.innerRadius,s=0;s<this.state.spikes;s++)t=Math.cos(n)*r+r,e=Math.sin(n)*r+r,this.state.dots.push([t,e]),n+=i,t=Math.cos(n)*o+r,e=Math.sin(n)*o+r,this.state.dots.push([t,e]),n+=i;return this.state.dots}},{key:"calcComponentParams",value:function calcComponentParams(){return this.dirty&&(this.calcDots(),this.state.width=2*this.state.outerRadius,this.state.height=2*this.state.outerRadius),{width:this.state.width,height:this.state.height}}},{key:"setState",value:function setState(t){x2(t.outerRadius)?x2(t.width)?x2(t.height)||(t.outerRadius=t.height/2):t.outerRadius=t.width/2:(t.width=2*t.outerRadius,t.height=2*t.outerRadius),_get(_getPrototypeOf(ICEStar.prototype),"setState",this).call(this,t)}}]);var Dr,Hr,Vr,n=ICEStar,Fr="__ICE_UTILS_TEXT_MEASURE_DIV__",Ur=(_inherits(ICEText,t),Hr=_createSuper(ICEText),_createClass(ICEText,[{key:"calcComponentParams",value:function calcComponentParams(){return this.dirty?this.measureText():{width:this.state.width,height:this.state.height}}},{key:"measureText",value:function measureText(t){var e;try{if(!(e=this.root.document.getElementById(Fr))){(e=this.root.document.createElement("div")).setAttribute("id",Fr);var n,i={visibility:"hidden",position:"absolute",top:"0",left:"0",padding:"0",margin:"0",border:"none",fontFamily:this.state.style.fontFamily,fontWeight:this.state.style.fontWeight,fontSize:this.state.style.fontSize+"px"};for(n in i)e.style[n]=i[n];e.contenteditable=!1,this.root.document.body.appendChild(e)}e.innerHTML=this.state.text;var r=this.state.style,o=r.paddingTop,s=r.paddingBottom,a=r.paddingLeft,l=r.paddingRight,c={width:e.offsetWidth+a+l,height:e.offsetHeight+o+s};return this.props.width=c.width,this.props.height=c.height,this.state.width=c.width,this.state.height=c.height,{width:this.state.width,height:this.state.height}}catch(t){}}},{key:"doRender",value:function doRender(){this.dirty&&this.measureText();var t=this.state.style,e=(t.paddingTop,t.paddingBottom),n=t.paddingLeft;t.paddingRight,this.state.stroke&&this.ctx.strokeText(this.state.text,0-this.state.localOrigin[0]+n,0-this.state.localOrigin[1]+this.state.height-e,this.state.width),this.state.fill&&this.ctx.fillText(this.state.text,0-this.state.localOrigin[0]+n,0-this.state.localOrigin[1]+this.state.height-e,this.state.width),_get(_getPrototypeOf(ICEText.prototype),"doRender",this).call(this)}}],[{key:"arrangeParam",value:function arrangeParam(t){return(t=Pn({text:"",left:0,top:0,width:10,height:10,style:{fontWeight:"bold",fontSize:32,fontFamily:"Arial",lineWidth:1,textBaseline:"bottom",paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}},t)).style=_objectSpread2(_objectSpread2({},t.style),{},{font:"".concat(t.style.fontWeight," ").concat(t.style.fontSize,"px ").concat(t.style.fontFamily)}),t}}]),ICEText),qr={ICERect:a,ICECircle:b,ICEEllipse:r,ICEStar:n,ICEIsogon:i,ICEText:Ur,ICEImage:d,ICEGroup:Dt,ICEVisioLink:v,ICEPolyLine:Nr},w={evtBuses:[],stopped:!1,frameCallback:function frameCallback(){for(var t=0;t<w.evtBuses.length;t++){if(w.stopped)return;w.evtBuses[t].trigger(L)}w.stopped||_.requestFrame(w.frameCallback)},start:function start(){w.stopped=!1,_.requestFrame(w.frameCallback)},stop:function stop(){w.stopped=!0},pause:function pause(){},resume:function resume(){},regitserEvtBus:function regitserEvtBus(t){w.evtBuses.includes(t)||w.evtBuses.push(t)},delEvtBus:function delEvtBus(t){w.evtBuses.includes(t)&&w.evtBuses.splice(w.evtBuses.indexOf(t),1)}},Wr=(_createClass(ICELinkSlotManager,[{key:"start",value:function start(){return this.createLinkSlots(),this.ice.evtBus.on(G,this.hookMouseMoveHandler,this),this}},{key:"stop",value:function stop(){return this.ice.evtBus.off(G,this.hookMouseMoveHandler,this),this}},{key:"hookMouseMoveHandler",value:function hookMouseMoveHandler(t){for(var e=t.target.getMaxBoundingBox(),n=null,i=_toConsumableArray(this.ice.childNodes),r=0;r<i.length;r++){var o=i[r];if(o&&o.state.linkable&&o.getMaxBoundingBox().isIntersect(e)){n=o;break}}for(var s=0;s<this.ice._linkSlots.length;s++){var a=this.ice._linkSlots[s];a.hostComponent!==n&&(a.hostComponent=n)}}},{key:"createLinkSlots",value:function createLinkSlots(){var t,e,n,i;this.ice._linkSlots&&this.ice._linkSlots.length||(t=new Rr({zIndex:10000010,display:!1,transformable:!1,draggable:!1,radius:this.slotRadius,position:"T",style:{strokeStyle:"#0c09d4",fillStyle:"#3ce92c",lineWidth:1}}),this.ice.addTool(t),e=new Rr({zIndex:10000011,display:!1,transformable:!1,draggable:!1,radius:this.slotRadius,position:"R",style:{strokeStyle:"#0c09d4",fillStyle:"#3ce92c",lineWidth:1}}),this.ice.addTool(e),n=new Rr({zIndex:10000012,display:!1,transformable:!1,draggable:!1,radius:this.slotRadius,position:"B",style:{strokeStyle:"#0c09d4",fillStyle:"#3ce92c",lineWidth:1}}),this.ice.addTool(n),i=new Rr({zIndex:10000013,display:!1,transformable:!1,draggable:!1,radius:this.slotRadius,position:"L",style:{strokeStyle:"#0c09d4",fillStyle:"#3ce92c",lineWidth:1}}),this.ice.addTool(i),this.ice._linkSlots=[t,e,n,i])}}]),ICELinkSlotManager),Gr=(_createClass(Deserializer,[{key:"fromJSONObject",value:function fromJSONObject(t){for(var e=t.childNodes,n=0;n<e.length;n++)this.decodeRecursively(this.ice,e[n])}},{key:"fromJSONString",value:function fromJSONString(t){t=JSON.parse(t),this.fromJSONObject(t)}},{key:"decodeRecursively",value:function decodeRecursively(t,e){var n=new(this.ice.getType(e.type))(e.state),i=(t.addChild(n),e.childNodes);if(i&&i.length)for(var r=0;r<i.length;r++)this.decodeRecursively(n,i[r])}}]),Deserializer),Xr=(_createClass(Serializer,[{key:"toJSONString",value:function toJSONString(){return JSON.stringify(this.toJSONObject())}},{key:"toJSONObject",value:function toJSONObject(){for(var t={createTime:(new Date).toLocaleString(),lastModifyTime:(new Date).toLocaleString(),childNodes:[]},e=0;e<this.ice.childNodes.length;e++){var n=this.ice.childNodes[e];this.encodeRecursively(n,t)}return t}},{key:"encodeRecursively",value:function encodeRecursively(t,e){var n={state:t.state,type:t.constructor.name,childNodes:[]};if(e.childNodes.push(n),t.childNodes&&t.childNodes.length)for(var i=0;i<t.childNodes.length;i++)this.encodeRecursively(t.childNodes[i],n)}}]),Serializer),Jr=(_inherits(CanvasRenderer,l),Dr=_createSuper(CanvasRenderer),_createClass(CanvasRenderer,[{key:"start",value:function start(){return this.stopped=!1,this.ice.evtBus.on(L,this.frameEvtHandler,this),this}},{key:"stop",value:function stop(){return this.stopped=!0,this.ice.evtBus.off(L,this.frameEvtHandler,this),this}},{key:"frameEvtHandler",value:function frameEvtHandler(t){this.ice.dirty&&this.doRender()}},{key:"refreshQueue",value:function refreshQueue(){this.componentQueue=flattenTree([],this.ice.childNodes),this.componentQueue.sort(function(t,e){return t.state.zIndex-e.state.zIndex}),this.toolsQueue=flattenTree([],this.ice.toolNodes),this.toolsQueue.sort(function(t,e){return t.state.zIndex-e.state.zIndex})}},{key:"doRender",value:function doRender(){this.refreshQueue(),this.ice.ctx.clearRect(0,0,this.ice.canvasWidth,this.ice.canvasHeight);for(var t=0;t<this.componentQueue.length;t++){var e=this.componentQueue[t];e.root=this.ice.root,e.ctx=this.ice.ctx,e.evtBus=this.ice.evtBus,e.ice=this.ice,e.render()}for(var n=0;n<this.toolsQueue.length;n++){var i=this.toolsQueue[n];i.root=this.ice.root,i.ctx=this.ice.ctx,i.evtBus=this.ice.evtBus,i.ice=this.ice,i.render()}this.ice.dirty=!1,this.ice.evtBus.trigger(U)}}]),CanvasRenderer),Kr=(_createClass(ImageCache,[{key:"setImage",value:function setImage(t){var e=this,n=this.imageCache.get(t);return n||((n=new Image).onload=function(){e.ice.dirty=!0},n.onerror=function(){},n.src=t,this.imageCache.size>ImageCache.CACHE_SIZE&&this.imageCache.delete(this.imageCache.keys().next().value),this.imageCache.set(t,n)),{loaded:this.loaded(n),image:n}}},{key:"loaded",value:function loaded(t){return t.complete&&0<t.naturalWidth}}]),ImageCache);function ImageCache(t){_classCallCheck(this,ImageCache),_defineProperty$1(this,"imageCache",new Map),this.ice=t}function CanvasRenderer(t){var e;return _classCallCheck(this,CanvasRenderer),_defineProperty$1(_assertThisInitialized(e=Dr.call(this)),"stopped",!1),_defineProperty$1(_assertThisInitialized(e),"componentQueue",[]),_defineProperty$1(_assertThisInitialized(e),"toolsQueue",[]),e.ice=t,e}function Serializer(t){_classCallCheck(this,Serializer),this.ice=t}function Deserializer(t){_classCallCheck(this,Deserializer),this.ice=t}function ICELinkSlotManager(t){_classCallCheck(this,ICELinkSlotManager),_defineProperty$1(this,"slotRadius",10),this.ice=t}function ICEText(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck(this,ICEText),t=ICEText.arrangeParam(t),(t=Hr.call(this,t)).measureText(),t}function ICEStar(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck(this,ICEStar),(t=_objectSpread2({outerRadius:50,innerRadius:20,startAngle:90,spikes:5},t)).spikes=Math.floor(1<=t.spikes?t.spikes:1),t.width=2*t.outerRadius,t.height=2*t.outerRadius,Vr.call(this,t)}_defineProperty$1(Kr,"CACHE_SIZE",100),_createClass(function ICE(){_classCallCheck(this,ICE),_defineProperty$1(this,"childNodes",[]),_defineProperty$1(this,"toolNodes",[]),_defineProperty$1(this,"canvasWidth",0),_defineProperty$1(this,"canvasHeight",0),_defineProperty$1(this,"selectionList",[]),_defineProperty$1(this,"typeMapping",{}),_defineProperty$1(this,"__dirty",!0),_defineProperty$1(this,"_lastUpdateTime",Date.now())},[{key:"init",value:function init(t){if(!t)throw new Error("ICE.init() failed...");if(this.ctx===t)throw new Error("同一个 canvas 实例只能 init 一次...");for(var e in qr)this.typeMapping[e]=qr[e];return this.root=_,y(t)?(this.canvasEl=this.root.document.getElementById(t),this.canvasEl.oncontextmenu=function(t){t.preventDefault(),t.stopPropagation()},this.canvasWidth=this.canvasEl.width,this.canvasHeight=this.canvasEl.height,this.canvasBoundingClientRect=this.canvasEl.getBoundingClientRect(),this.ctx=this.canvasEl.getContext("2d")):this.ctx=t,this.evtBus=new $r,w.regitserEvtBus(this.evtBus),w.start(),jr.regitserEvtBus(this.evtBus),jr.start(),this.eventDispatcher=new Ir(this).start(),this.animationManager=new Y(this).start(),this.controlPanelManager=new Er(this).start(),this.renderer=new Jr(this).start(),this.linkSlotManager=new Wr(this).start(),this.serializer=new Xr(this),this.deserializer=new Gr(this),this.imageCache=new Kr(this),this}},{key:"addTool",value:function addTool(t){-1===this.childNodes.indexOf(t)&&(this.evtBus.trigger(H,null,{component:t}),t.trigger(H),t.ice=this,t.ctx=this.ctx,t.evtBus=this.evtBus,this.toolNodes.push(t),this.dirty=!0,this.evtBus.trigger(V,null,{component:t}),t.trigger(V))}},{key:"removeTool",value:function removeTool(t){this.evtBus.trigger(F,null,{component:t}),t.destory(),this.toolNodes.splice(this.toolNodes.indexOf(t),1),this.dirty=!0}},{key:"addChild",value:function addChild(t){var e=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];-1===this.childNodes.indexOf(t)&&(this.evtBus.trigger(H,null,{component:t}),t.trigger(H),t.ice=this,t.ctx=this.ctx,t.evtBus=this.evtBus,t.parentNode=null,this.childNodes.push(t),Object.keys(t.props.animations).length&&this.animationManager.add(t),this.dirty=e,this.evtBus.trigger(V,null,{component:t}),t.trigger(V))}},{key:"addChildren",value:function addChildren(t){for(var e=0;e<t.length;e++)this.addChild(t[e],!1);this.dirty=!0}},{key:"removeChild",value:function removeChild(t){var e=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];this.evtBus.trigger(F,null,{component:t}),t.destory(),this.childNodes.splice(this.childNodes.indexOf(t),1),this.dirty=e}},{key:"removeChildren",value:function removeChildren(t){for(var e=0;e<t.length;e++)this.removeChild(t[e],!1);this.dirty=!0}},{key:"clearAll",value:function clearAll(){this.removeChildren(_toConsumableArray(this.childNodes))}},{key:"findComponent",value:function findComponent(e){return this.childNodes.filter(function(t){return t.props.id===e})[0]}},{key:"dirty",get:function get(){return this.__dirty},set:function set(t){this.__dirty=t}},{key:"registerType",value:function registerType(t,e){this.typeMapping[t]=e}},{key:"getType",value:function getType(t){return this.typeMapping[t]}},{key:"toJSONString",value:function toJSONString(){return this.serializer.toJSONString()}},{key:"toJSONObject",value:function toJSONObject(){return this.serializer.toJSONObject()}},{key:"fromJSONObject",value:function fromJSONObject(t){var e=this;w.stop(),this.renderer.stop(),this.eventDispatcher.stopped=!0,this.animationManager.stop(),this.controlPanelManager.stop(),this.linkSlotManager.stop(),this.clearAll(),this.deserializer.fromJSONObject(t),w.start(),this.renderer.start(),this.animationManager.start(),this.controlPanelManager.start(),this.linkSlotManager.start(),setTimeout(function(){e.eventDispatcher.stopped=!1},300)}},{key:"fromJSONString",value:function fromJSONString(t){t=JSON.parse(t),this.fromJSONObject(t)}}]);function Cd(t){return null==t}function Ed(t,e){return t===e||t!=t&&e!=e}function Gd(t,e){for(var n=t.length;n--;)if(Qr(t[n][0],e))return n;return-1}function Nd(t){var e=this.__data__;return!((t=Zr(e,t))<0||(t==e.length-1?e.pop():Yr.call(e,t,1),--this.size,0))}function Od(t){var e=this.__data__;return(t=to(e,t))<0?void 0:e[t][1]}function Pd(t){return-1<eo(this.__data__,t)}function Qd(t,e){var n=this.__data__,i=no(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}var g="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Qr=Ed,Zr=Gd,Yr=Array.prototype.splice,to=Gd,eo=Gd,no=Gd;function ListCache$4(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}ListCache$4.prototype.clear=function listCacheClear$1(){this.__data__=[],this.size=0},ListCache$4.prototype.delete=Nd,ListCache$4.prototype.get=Od,ListCache$4.prototype.has=Pd,ListCache$4.prototype.set=Qd;function Td(){this.__data__=new io,this.size=0}function Ud(t){var e=this.__data__,t=e.delete(t);return this.size=e.size,t}function Vd(t){return this.__data__.get(t)}function Wd(t){return this.__data__.has(t)}function i3(t){return ao.call(t)}function k3(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":(co&&co in Object(t)?lo:i3)(t)}function l3(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function p3(t){return!!uo(t)&&("[object Function]"==(t=ho(t))||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t)}function E3(t){return!(!go(t)||vo(t))&&(yo(t)?Co:bo).test(mo(t))}function F3(t,e){return null==t?void 0:t[e]}function G3(t,e){return t=F3(t,e),E3(t)?t:void 0}function T3(t){return t=this.has(t)&&delete this.__data__[t],this.size-=t?1:0,t}function U3(t){var e,n=this.__data__;return ko?"__lodash_hash_undefined__"===(e=n[t])?void 0:e:wo.call(n,t)?n[t]:void 0}function V3(t){var e=this.__data__;return Po?void 0!==e[t]:xo.call(e,t)}function W3(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Eo&&void 0===e?"__lodash_hash_undefined__":e,this}var e=ListCache$4,io=e,o="object"==typeof g&&g&&g.Object===Object&&g,h="object"==typeof self&&self&&self.Object===Object&&self,f=o||h||Function("return this")(),t=f.Symbol,a=Object.prototype,ro=a.hasOwnProperty,oo=a.toString,so=t?t.toStringTag:void 0,ao=Object.prototype.toString,lo=function getRawTag$1(t){var e=ro.call(t,so),n=t[so];try{var i=!(t[so]=void 0)}catch(t){}var r=oo.call(t);return i&&(e?t[so]=n:delete t[so]),r},co=t?t.toStringTag:void 0,ho=k3,uo=l3,b=f["__core-js_shared__"],po=(r=/[^.]+$/.exec(b&&b.keys&&b.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",fo=Function.prototype.toString,yo=p3,vo=function isMasked$1(t){return!!po&&po in t},go=l3,mo=function toSource$1(t){if(null!=t){try{return fo.call(t)}catch(t){}try{return t+""}catch(t){}}return""},bo=/^\[object .+?Constructor\]$/,n=Function.prototype,i=Object.prototype,d=n.toString,l=i.hasOwnProperty,Co=RegExp("^"+d.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),g=G3(f,"Map"),h=G3(Object,"create"),_o=h,ko=h,wo=Object.prototype.hasOwnProperty,Po=h,xo=Object.prototype.hasOwnProperty,Eo=h;function Hash$1(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}Hash$1.prototype.clear=function hashClear$1(){this.__data__=_o?_o(null):{},this.size=0},Hash$1.prototype.delete=T3,Hash$1.prototype.get=U3,Hash$1.prototype.has=V3,Hash$1.prototype.set=W3;function $3(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}function _3(t,e){return t=t.__data__,$3(e)?t["string"==typeof e?"string":"hash"]:t.map}function fe(t){return t=jo(this,t).delete(t),this.size-=t?1:0,t}function ge(t){return $o(this,t).get(t)}function he(t){return Mo(this,t).has(t)}function ie(t,e){var n=Ao(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}var So=Hash$1,Oo=e,Io=g,jo=_3,$o=_3,Mo=_3,Ao=_3;function MapCache$1(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}MapCache$1.prototype.clear=function mapCacheClear$1(){this.size=0,this.__data__={hash:new So,map:new(Io||Oo),string:new So}},MapCache$1.prototype.delete=fe,MapCache$1.prototype.get=ge,MapCache$1.prototype.has=he,MapCache$1.prototype.set=ie;function re(t,e){var n=this.__data__;if(n instanceof Bo){var i=n.__data__;if(!Lo||i.length<199)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new To(i)}return n.set(t,e),this.size=n.size,this}var Bo=e,Lo=g,To=MapCache$1,zo=e,a=Ud,t=Vd,b=Wd;function Stack$1(t){t=this.__data__=new zo(t);this.size=t.size}Stack$1.prototype.clear=Td,Stack$1.prototype.delete=a,Stack$1.prototype.get=t,Stack$1.prototype.has=b,Stack$1.prototype.set=re;function we(t,e,n){"__proto__"==e&&Uo?Uo(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function ze(t,e,n){(void 0===n||Wo(t[e],n))&&(void 0!==n||e in t)||qo(t,e,n)}function De(t){var e=new t.constructor(t.byteLength);return new Go(e).set(new Go(t)),e}function Ee(t,e){return e=e?De(t.buffer):t.buffer,new t.constructor(e,t.byteOffset,t.length)}function Fe(t,e){var n=-1,i=t.length;for(e=e||Array(i);++n<i;)e[n]=t[n];return e}function Le(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Ko)}function Pe(t){return"function"!=typeof t.constructor||Yo(t)?{}:Qo(Zo(t))}function Qe(t){return null!=t&&"object"==typeof t}function Te(t){return es(t)&&"[object Arguments]"==ts(t)}function $e(t){return"number"==typeof t&&-1<t&&t%1==0&&t<=9007199254740991}function b4(t){return null!=t&&ss(t.length)&&!os(t)}function e4(t){return ls(t)&&as(t)}function p4(t){return!(!us(t)||"[object Object]"!=cs(t))&&(null===(t=hs(t))||"function"==typeof(t=ps.call(t,"constructor")&&t.constructor)&&t instanceof t&&ds.call(t)==fs)}function u4(t){return gs(t)&&vs(t.length)&&!!P[ys(t)]}function v4(e){return function(t){return e(t)}}function C4(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}function G4(t,e,n){var i=t[e];Cs.call(t,e)&&bs(i,n)&&(void 0!==n||e in t)||ms(t,e,n)}function K4(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&ks.test(t))&&-1<t&&t%1==0&&t<e}function L4(t,e){for(var n=-1,i=Array(t);++n<t;)i[n]=e(n);return i}function Y4(t){if(!Is(t))return $s(t);var e,n=js(t),i=[];for(e in t)("constructor"!=e||!n&&Ms.call(t,e))&&i.push(e);return i}function $4(t){return Bs(t)?As(t,!0):Y4(t)}function uf(t,e,n,i,r,o,s){var a,l,c,h=Ks(t,n),u=Ks(e,n),d=s.get(u);d?zs(t,n,d):((e=void 0===(d=o?o(h,u,n+"",t,e,s):void 0))&&(l=!(a=Fs(u))&&qs(u),c=!a&&!l&&Js(u),d=u,a||l||c?d=Fs(h)?h:Us(h)?Ds(h):l?Rs(u,!(e=!1)):c?Ns(u,!(e=!1)):[]:Xs(u)||Vs(u)?Vs(d=h)?d=Qs(h):Gs(h)&&!Ws(h)||(d=Hs(u)):e=!1),e&&(s.set(u,d),r(d,u,i,o,s),s.delete(u)),zs(t,n,d))}function zf(t){return t}function Af(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Df(t){return function(){return t}}function Pf(t,e){return da(ua(t,e,ha),t+"")}function Qf(t,e,n){if(!va(n))return!1;var i=typeof e;return!!("number"==i?fa(n)&&ya(e,n.length):"string"==i&&e in n)&&pa(n[e],t)}var Ro,No,Do,Ho,Vo,r=Stack$1,Fo=G3,n=function(){try{var t=Fo(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Uo=n,qo=we,Wo=Ed,i=function createBaseFor$1(l){return function(t,e,n){for(var i=-1,r=Object(t),o=n(t),s=o.length;s--;){var a=o[l?s:++i];if(!1===e(r[a],a,r))break}return t}}(),d={exports:{}},Go=(h=(h=(l=d).exports)&&!h.nodeType&&h,g=(g=h&&l&&!l.nodeType&&l)&&g.exports===h?f.Buffer:void 0,Ro=g?g.allocUnsafe:void 0,l.exports=function cloneBuffer(t,e){if(e)return t.slice();e=t.length,e=Ro?Ro(e):new t.constructor(e);return t.copy(e),e},f.Uint8Array),Xo=l3,Jo=Object.create,e=function(){function object(){}return function(t){if(!Xo(t))return{};if(Jo)return Jo(t);object.prototype=t;t=new object;return object.prototype=void 0,t}}(),a=function overArg$1(e,n){return function(t){return e(n(t))}}(Object.getPrototypeOf,Object),Ko=Object.prototype,Qo=e,Zo=a,Yo=Le,ts=k3,es=Qe,ns=Qe,t=Object.prototype,is=t.hasOwnProperty,rs=t.propertyIsEnumerable,b=Te(function(){return arguments}())?Te:function(t){return ns(t)&&is.call(t,"callee")&&!rs.call(t,"callee")},h=Array.isArray,os=p3,ss=$e,as=b4,ls=Qe,g={exports:{}},cs=(e=(e=(l=g).exports)&&!e.nodeType&&e,t=(t=e&&l&&!l.nodeType&&l)&&t.exports===e?f.Buffer:void 0,e=(t?t.isBuffer:void 0)||function stubFalse(){return!1},l.exports=e,k3),hs=a,us=Qe,f=Function.prototype,t=Object.prototype,ds=f.toString,ps=t.hasOwnProperty,fs=ds.call(Object),ys=k3,vs=$e,gs=Qe,P={},l=(P["[object Float32Array]"]=P["[object Float64Array]"]=P["[object Int8Array]"]=P["[object Int16Array]"]=P["[object Int32Array]"]=P["[object Uint8Array]"]=P["[object Uint8ClampedArray]"]=P["[object Uint16Array]"]=P["[object Uint32Array]"]=!0,P["[object Arguments]"]=P["[object Array]"]=P["[object ArrayBuffer]"]=P["[object Boolean]"]=P["[object DataView]"]=P["[object Date]"]=P["[object Error]"]=P["[object Function]"]=P["[object Map]"]=P["[object Number]"]=P["[object Object]"]=P["[object RegExp]"]=P["[object Set]"]=P["[object String]"]=P["[object WeakMap]"]=!1,{exports:{}}),f=(a=(a=(e=l).exports)&&!a.nodeType&&a,No=a&&e&&!e.nodeType&&e,Do=No&&No.exports===a&&o.process,a=function(){try{return No&&No.require&&No.require("util").types||Do&&Do.binding&&Do.binding("util")}catch(t){}}(),e.exports=a,u4),t=v4,o=l.exports,e=o&&o.isTypedArray,a=e?t(e):f,ms=we,bs=Ed,Cs=Object.prototype.hasOwnProperty,_s=we,ks=/^(?:0|[1-9]\d*)$/,ws=b,Ps=h,xs=g.exports,Es=K4,Ss=a,Os=Object.prototype.hasOwnProperty,Is=l3,js=Le,$s=function nativeKeysIn$1(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e},Ms=Object.prototype.hasOwnProperty,As=function arrayLikeKeys$1(t,e){var n,i=Ps(t),r=!i&&ws(t),o=!i&&!r&&xs(t),s=!i&&!r&&!o&&Ss(t),a=i||r||o||s,l=a?L4(t.length,String):[],c=l.length;for(n in t)!e&&!Os.call(t,n)||a&&("length"==n||o&&("offset"==n||"parent"==n)||s&&("buffer"==n||"byteLength"==n||"byteOffset"==n)||Es(n,c))||l.push(n);return l},Bs=b4,Ls=function copyObject$1(t,e,n,i){var r=!n;n=n||{};for(var o=-1,s=e.length;++o<s;){var a=e[o],l=i?i(n[a],t[a],a,n,t):void 0;void 0===l&&(l=t[a]),(r?_s:G4)(n,a,l)}return n},Ts=$4,zs=ze,Rs=d.exports,Ns=Ee,Ds=Fe,Hs=Pe,Vs=b,Fs=h,Us=e4,qs=g.exports,Ws=p3,Gs=l3,Xs=p4,Js=a,Ks=C4,Qs=function toPlainObject$1(t){return Ls(t,Ts(t))},Zs=r,Ys=ze,na=i,ra=l3,oa=$4,sa=C4,aa=Math.max,la=n,ca=Date.now,l=function shortOut$1(n){var i=0,r=0;return function(){var t=ca(),e=16-(t-r);if(r=t,0<e){if(800<=++i)return arguments[0]}else i=0;return n.apply(void 0,arguments)}}(la?function(t,e){return la(t,"toString",{configurable:!0,enumerable:!1,value:Df(e),writable:!0})}:zf),ha=zf,ua=function overRest$1(o,s,a){return s=aa(void 0===s?o.length-1:s,0),function(){for(var t=arguments,e=-1,n=aa(t.length-s,0),i=Array(n);++e<n;)i[e]=t[s+e];for(var e=-1,r=Array(s+1);++e<s;)r[e]=t[e];return r[s]=a(i),Af(o,this,r)}},da=l,pa=Ed,fa=b4,ya=K4,va=l3,ga=function baseMerge$1(i,r,o,s,a){i!==r&&na(r,function(t,e){var n;a=a||new Zs,ra(t)?uf(i,r,e,o,baseMerge$1,s,a):(n=s?s(sa(i,e),t,e+"",i,r,a):void 0,Ys(i,e,n=void 0===n?t:n))},oa)},ma=function createAssigner$1(a){return Pf(function(t,e){var n=-1,i=e.length,r=1<i?e[i-1]:void 0,o=2<i?e[2]:void 0,r=3<a.length&&"function"==typeof r?(i--,r):void 0;for(o&&Qf(e[0],e[1],o)&&(r=i<3?void 0:r,i=1),t=Object(t);++n<i;){var s=e[n];s&&a(t,s,n,r)}return t})}(function(t,e,n){ga(t,e,n)}),o=(_inherits$1(Entity,Dt),Vo=_createSuper$1(Entity),_createClass$1(Entity,[{key:"doRender",value:function doRender(){this.dirty&&this.syncEntityNameAndFields(),this.doLayout(),_get$1(_getPrototypeOf$1(Entity.prototype),"doRender",this).call(this)}},{key:"syncEntityNameAndFields",value:function syncEntityNameAndFields(){if(this.state.entityName&&(this.entityNameComponent&&this.removeChild(this.entityNameComponent),this.entityNameComponent=new Ur({left:0,top:0,text:this.state.entityName,style:{strokeStyle:"#222",fillStyle:"#222",fontSize:18,fontWeight:"bold",paddingTop:10,paddingLeft:10,paddingRight:10,paddingBottom:10},interactive:!1,stroke:!1,showMinBoundingBox:!1,showMaxBoundingBox:!1}),this.addChild(this.entityNameComponent),this.deviderLine&&this.removeChild(this.deviderLine),this.deviderLine=new Nr({left:0,top:0,points:[[0,0],[this.state.width,0]],style:{strokeStyle:"#333",fillStyle:"#333",lineWidth:2},interactive:!1}),this.addChild(this.deviderLine)),this.entityFieldsComponent.length&&(this.removeChildren(this.entityFieldsComponent),this.entityFieldsComponent.length=0),!Cd(this.state.fields)){for(var t=this.state.fields.length,e=0;e<t;e++){var n=this.state.fields[e],n=new Ur({left:0,top:0,text:"".concat(n.name," ").concat(n.type," ").concat(n.length),style:{strokeStyle:"#222",fillStyle:"#222",fontSize:18,fontWeight:"normal",paddingTop:10,paddingLeft:10,paddingRight:10,paddingBottom:e===t-1?10:0},interactive:!1,stroke:!1,showMinBoundingBox:!1,showMaxBoundingBox:!1});this.entityFieldsComponent.push(n)}this.addChildren(this.entityFieldsComponent)}}},{key:"doLayout",value:function doLayout(){var t=this.state.width,e=0,n=0;this.entityNameComponent&&(e=this.childNodes[0].state.height,t=Math.max(t,this.childNodes[0].state.width),n=e+=this.deviderLine.state.height);for(var i=0;i<this.entityFieldsComponent.length;i++){var r=this.entityFieldsComponent[i];r.setState({left:0,top:e}),e+=r.state.height,t=Math.max(t,r.state.width)}this.deviderLine&&this.deviderLine.setState({points:[[0,n],[t,n]]}),this.setState({height:Math.max(e,this.state.height),width:t})}},{key:"toEntityObject",value:function toEntityObject(){var n={name:this.state.entityName,columns:{}};return this.state.fields.forEach(function(t,e){n.columns[t.name]=_objectSpread2$1({},t)}),n}},{key:"setState",value:function setState(t){this.state=_objectSpread2$1(_objectSpread2$1({},this.state),t),this.dirty=!0,this.ice&&(this.ice.dirty=!0)}}],[{key:"arrangeParam",value:function arrangeParam(t){t=ma({entityName:"Entity Name",fields:[],style:{strokeStyle:"#000",fillStyle:"#00eeff"}},t,{transformable:!1});return Cd(t.entityName)&&(t.entityName="Entity Name"),Cd(t.fields)&&(t.fields=[]),t}}]),Entity),t=(_inherits$1(Relation,v),Ho=_createSuper$1(Relation),_createClass$1(Relation,[{key:"toEntityObject",value:function toEntityObject(){var t=this.state,e=t.title,n=t.relationType,t=t.referencedColumnName,i=this.links.start.component,r=this.links.end.component;return{title:e,fromId:i.state.id,fromName:i.state.entityName,toId:r.state.id,toName:r.state.entityName,relationType:n,referencedColumnName:t}}}]),Relation);function Relation(t){return _classCallCheck$1(this,Relation),Ho.call(this,_objectSpread2$1({title:"Relation",relationType:"one-to-one",referencedColumnName:"id"},t))}function Entity(t){_classCallCheck$1(this,Entity);var t=Entity.arrangeParam(t);return _defineProperty$2(_assertThisInitialized$1(t=Vo.call(this,t)),"entityFieldsComponent",[]),t}function camelCase(t,e){e=1<arguments.length&&void 0!==e&&e;return function toCamelCase(t,e){for(var n=0<arguments.length&&void 0!==t?t:[],i=1<arguments.length&&void 0!==e&&e,r="",o=0,s=n.length;o<s;o++){var a=n[o].toLowerCase();r+=a=!i&&0==o?a:a.substr(0,1).toUpperCase()+a.substr(1)}return r}(function toWords(t){return(t=function convertToString(t){return"string"==typeof(t=t||"")?t:String(t)}(t)).match(/[A-Z\xC0-\xD6\xD8-\xDE]?[a-z\xDF-\xF6\xF8-\xFF]+|[A-Z\xC0-\xD6\xD8-\xDE]+(?![a-z\xDF-\xF6\xF8-\xFF])|\d+/g)}(t),e)}var Ca=[],_a=[],wa={},Pa={},xa={};function sanitizeRule(t){return"string"==typeof t?new RegExp("^"+t+"$","i"):t}function restoreCase(t,e){return t===e?e:t===t.toLowerCase()?e.toLowerCase():t===t.toUpperCase()?e.toUpperCase():t[0]===t[0].toUpperCase()?e.charAt(0).toUpperCase()+e.substr(1).toLowerCase():e.toLowerCase()}function replace(i,r){return i.replace(r[0],function(t,e){var n=function interpolate(t,n){return t.replace(/\$(\d{1,2})/g,function(t,e){return n[e]||""})}(r[1],arguments);return restoreCase(""===t?i[e-1]:t,n)})}function sanitizeWord(t,e,n){if(!t.length||wa.hasOwnProperty(t))return e;for(var i=n.length;i--;){var r=n[i];if(r[0].test(e))return replace(e,r)}return e}function replaceWord(n,i,r){return function(t){var e=t.toLowerCase();return i.hasOwnProperty(e)?restoreCase(t,e):n.hasOwnProperty(e)?restoreCase(t,n[e]):sanitizeWord(e,t,r)}}function checkWord(e,n,i){return function(t){t=t.toLowerCase();return!!n.hasOwnProperty(t)||!e.hasOwnProperty(t)&&sanitizeWord(t,t,i)===t}}function pluralize(t,e,n){return(n?e+" ":"")+(1===e?pluralize.singular(t):pluralize.plural(t))}function toSchemaObject(t){for(var e=function _toConsumableArray$1(t){return function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray$1(t)}(t)||function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray$1(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(n="Object"===n&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray$1(t,e):void 0}}(t)||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.")}()}(t),n=[],i={},r=0;r<e.length;r++){var o=e[r];"Relation"===o.constructor.name?n.push(o):"Entity"===o.constructor.name&&(i[o.state.id]=o.toEntityObject())}for(var s=0;s<n.length;s++){var a=n[s].toEntityObject(),l=a.fromId,c=a.fromName,h=a.toId,u=a.toName,d=a.relationType,a=a.referencedColumnName,l=i[l],h=i[h];l&&h&&(l.relations||(l.relations={}),h.relations||(h.relations={}),"one-to-one"===d?(l.relations["".concat(camelCase(u))]={type:d,target:u,joinColumn:{target:u,referencedColumnName:a}},h.relations["".concat(camelCase(c))]={type:d,target:c}):"one-to-many"===d?l.relations["".concat(camelCase(u))]={type:d,target:u}:"many-to-one"===d?h.relations["".concat(camelCase(c))]={type:"one-to-many",target:c}:"many-to-many"===d&&(l.relations["".concat(pluralize(camelCase(u)))]={type:d,target:u,joinTable:{target:u}},h.relations["".concat(pluralize(camelCase(c)))]={type:d,target:c}))}var p,f=[];for(p in i)f.push(i[p]);return f}pluralize.plural=replaceWord(xa,Pa,Ca),pluralize.isPlural=checkWord(xa,Pa,Ca),pluralize.singular=replaceWord(Pa,xa,_a),pluralize.isSingular=checkWord(Pa,xa,_a),pluralize.addPluralRule=function(t,e){Ca.push([sanitizeRule(t),e])},pluralize.addSingularRule=function(t,e){_a.push([sanitizeRule(t),e])},pluralize.addUncountableRule=function(t){"string"!=typeof t?(pluralize.addPluralRule(t,"$0"),pluralize.addSingularRule(t,"$0")):wa[t.toLowerCase()]=!0},pluralize.addIrregularRule=function(t,e){e=e.toLowerCase(),t=t.toLowerCase(),xa[t]=e,Pa[e]=t},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach(function(t){return pluralize.addIrregularRule(t[0],t[1])}),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(function(t){return pluralize.addPluralRule(t[0],t[1])}),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(t){return pluralize.addSingularRule(t[0],t[1])}),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(pluralize.addUncountableRule),x.Entity=o,x.Relation=t,x.toSchemaObject=toSchemaObject,x.toSchemaString=function toSchemaString(t){return JSON.stringify(toSchemaObject(t))},Object.defineProperty(x,"__esModule",{value:!0})});
|
|
25
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).IED={})}(this,function(S){"use strict";function ownKeys$1(e,t){var n,i=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)),i}function _objectSpread2$1(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$1(Object(n),!0).forEach(function(t){_defineProperty$2(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys$1(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _classCallCheck$1(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties$1(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function _createClass$1(t,e,n){e&&_defineProperties$1(t.prototype,e),n&&_defineProperties$1(t,n),Object.defineProperty(t,"prototype",{writable:!1})}function _defineProperty$2(t,e,n){e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}function _inherits$1(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$1(t,e)}function _getPrototypeOf$1(t){return(_getPrototypeOf$1=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function _setPrototypeOf$1(t,e){return(_setPrototypeOf$1=Object.setPrototypeOf||function _setPrototypeOf(t,e){return t.__proto__=e,t})(t,e)}function _assertThisInitialized$1(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _createSuper$1(n){var i=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function _createSuperInternal(){var t,e=_getPrototypeOf$1(n);return function _possibleConstructorReturn$1(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$1(t)}(this,i?(t=_getPrototypeOf$1(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function _get$1(){return(_get$1="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(t,e,n){var i=function _superPropBase$1(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=_getPrototypeOf$1(t)););return t}(t,e);if(i)return(i=Object.getOwnPropertyDescriptor(i,e)).get?i.get.call(arguments.length<3?t:n):i.value}).apply(this,arguments)}function _arrayLikeToArray$1(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function ownKeys(e,t){var n,i=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)),i}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(n),!0).forEach(function(t){_defineProperty$1(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function _createClass(t,e,n){return e&&_defineProperties(t.prototype,e),n&&_defineProperties(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function _defineProperty$1(t,e,n){e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}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&&function _setPrototypeOf(t,e){(Object.setPrototypeOf||function _setPrototypeOf(t,e){return t.__proto__=e,t})(t,e)}(t,e)}function _getPrototypeOf(t){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _createSuper(n){var i=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function _createSuperInternal(){var t,e=_getPrototypeOf(n);return 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)}(this,i?(t=_getPrototypeOf(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function _get(){return(_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(t,e,n){var i=function _superPropBase(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=_getPrototypeOf(t)););return t}(t,e);if(i)return(i=Object.getOwnPropertyDescriptor(i,e)).get?i.get.call(arguments.length<3?t:n):i.value}).apply(this,arguments)}function _toConsumableArray(t){return function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}(t)||function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(n="Object"===n&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(t,e):void 0}}(t)||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 _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function p(t){var e=O.call(t,I),n=t[I];try{var i=!(t[I]=void 0)}catch(t){}var r=j.call(t);return i&&(e?t[I]=n:delete t[I]),r}function q(t){return M.call(t)}function s(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":(A&&A in Object(t)?p:q)(t)}function u(t){return null!=t&&"object"==typeof t}function y(t){return"string"==typeof t||!L(t)&&T(t)&&"[object String]"==B(t)}function z(t){return void 0===t}function P(t,e){return t===e||t!=t&&e!=e}function R(t,e){for(var n=t.length;n--;)if(Y(t[n][0],e))return n;return-1}var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t="object"==typeof t&&t&&t.Object===Object&&t,e="object"==typeof self&&self&&self.Object===Object&&self,e=t||e||Function("return this")(),n=e.Symbol,i=Object.prototype,O=i.hasOwnProperty,j=i.toString,I=n?n.toStringTag:void 0,M=Object.prototype.toString,A=n?n.toStringTag:void 0,i=Array.isArray,B=s,L=i,T=u,N="ICE_FRAME_EVENT",D="AFTER_RENDER",H="BEFORE_ADD",F="AFTER_ADD",V="BEFORE_REMOVE",U="ROUND_FINISH",J="HOOK_MOUSEMOVE",X="HOOK_MOUSEUP",W="BEFORE_RESIZE",c="AFTER_RESIZE",G="AFTER_ROTATE",K="AFTER_MOVE",Q={linear:function linear(t,e,n,i){return t+(e-t)/n*(Date.now()-i)},easeInQuad:function easeInQuad(t,e,n,i){return t+(e-t)/n*((i=Date.now()-i)/n)*i},easeOutQuad:function easeOutQuad(t,e,n,i){return i=Date.now()-i,-(e-t)*(i/=n)*(i-2)+t},easeInOutQuad:function easeInOutQuad(t,e,n,i){return i=Date.now()-i,e-=t,(i/=n/2)<1?e/2*i*i+t:-e/2*(--i*(i-2)-1)+t},easeInQuart:function easeInQuart(t,e,n,i){return i=Date.now()-i,(e-t)*(i/=n)*i*i*i+t},easeOutQuart:function easeOutQuart(t,e,n,i){return-(e-t)*((e=(Date.now()-i)/n-1)*e*e*e-1)+t},easeInOutQuart:function easeInOutQuart(t,e,n,i){return i=Date.now()-i,e-=t,(i/=n/2)<1?e/2*i*i*i*i+t:-e/2*((i-=2)*i*i*i-2)+t},easeInCubic:function easeInCubic(t,e,n,i){return i=Date.now()-i,(e-t)*(i/=n)*i*i+t},easeOutCubic:function easeOutCubic(t,e,n,i){return(e-t)*((e=(Date.now()-i)/n-1)*e*e+1)+t},easeInOutCubic:function easeInOutCubic(t,e,n,i){return i=Date.now()-i,e-=t,(i/=n/2)<1?e/2*i*i*i+t:e/2*((i-=2)*i*i+2)+t}},Z=(_createClass(AnimationManager,[{key:"start",value:function start(){return this.ice.evtBus.on(N,this.frameEventHandler,this),this}},{key:"stop",value:function stop(){return this.ice.evtBus.off(N,this.frameEventHandler,this),this}},{key:"frameEventHandler",value:function frameEventHandler(t){for(var e=_toConsumableArray(this.animationMap.values()),n=0;n<e.length;n++){var i=e[n];i.state.interactive=!1,this.tween(i),i.state.interactive=!0}}},{key:"tween",value:function tween(t){var e,n={},i=t.props.animations,r=1;for(e in i){var o=i[e];if(o.finished){if(++r===Object.keys(i).length){this.remove(t);break}}else{var s=o.from,a=o.to,l=o.duration;a<(z(o.startTime)&&(o.startTime=Date.now()),z(o.easing)&&(o.easing="linear"),s=Q[o.easing](s,a,l,o.startTime))&&(s=a,o.finished=!0),n[e]=Math.floor(s)}}return t.setState(_objectSpread2({},n)),t}},{key:"add",value:function add(t){this.animationMap.set(t.props.id,t)}},{key:"remove",value:function remove(t){y(t)?this.animationMap.delete(t):this.animationMap.delete(t.props.id)}}]),AnimationManager),Y=P,tt=R,et=Array.prototype.splice,nt=R,it=R,rt=R;function AnimationManager(t){_classCallCheck(this,AnimationManager),_defineProperty$1(this,"animationMap",new Map),this.ice=t}function ListCache$4$1(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}ListCache$4$1.prototype.clear=function listCacheClear$1(){this.__data__=[],this.size=0},ListCache$4$1.prototype.delete=function listCacheDelete$1(t){var e=this.__data__;return!((t=tt(e,t))<0||(t==e.length-1?e.pop():et.call(e,t,1),--this.size,0))},ListCache$4$1.prototype.get=function listCacheGet$1(t){var e=this.__data__;return(t=nt(e,t))<0?void 0:e[t][1]},ListCache$4$1.prototype.has=function listCacheHas$1(t){return-1<it(this.__data__,t)},ListCache$4$1.prototype.set=function listCacheSet$1(t,e){var n=this.__data__,i=rt(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this};function _(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ca(t){return!!at(t)&&("[object Function]"==(t=st(t))||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t)}function ga(t){if(null!=t){try{return ct.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function ia(t){return!!lt&< in t}function ra(t,e){return function baseIsNative$1(t){return ut(t)&&!ia(t)&&(ht(t)?pt:ft).test(dt(t))}(t=function getValue$1(t,e){return null==t?void 0:t[e]}(t,e))?t:void 0}function Ba(t){return t=this.has(t)&&delete this.__data__[t],this.size-=t?1:0,t}function Ca(t){var e,n=this.__data__;return gt?"__lodash_hash_undefined__"===(e=n[t])?void 0:e:vt.call(n,t)?n[t]:void 0}var r=ListCache$4$1,ot=r,st=s,at=_,o=e["__core-js_shared__"],lt=(o=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+o:"",ct=Function.prototype.toString,ht=ca,ut=_,dt=ga,ft=/^\[object .+?Constructor\]$/,o=Function.prototype,a=Object.prototype,o=o.toString,a=a.hasOwnProperty,pt=RegExp("^"+o.call(a).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),o=ra(e,"Map"),a=ra(Object,"create"),yt=a,gt=a,vt=Object.prototype.hasOwnProperty,mt=a,bt=Object.prototype.hasOwnProperty,Ct=a;function Hash$1$1(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}Hash$1$1.prototype.clear=function hashClear$1(){this.__data__=yt?yt(null):{},this.size=0},Hash$1$1.prototype.delete=Ba,Hash$1$1.prototype.get=Ca,Hash$1$1.prototype.has=function hashHas$1(t){var e=this.__data__;return mt?void 0!==e[t]:bt.call(e,t)},Hash$1$1.prototype.set=function hashSet$1(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Ct&&void 0===e?"__lodash_hash_undefined__":e,this};function Ga(t,e){return t=t.__data__,function isKeyable$1(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}(e)?t["string"==typeof e?"string":"hash"]:t.map}var _t=Hash$1$1,kt=r,wt=o,Pt=Ga,xt=Ga,Et=Ga,St=Ga;function MapCache$1$1(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}MapCache$1$1.prototype.clear=function mapCacheClear$1(){this.size=0,this.__data__={hash:new _t,map:new(wt||kt),string:new _t}},MapCache$1$1.prototype.delete=function mapCacheDelete$1(t){return t=Pt(this,t).delete(t),this.size-=t?1:0,t},MapCache$1$1.prototype.get=function mapCacheGet$1(t){return xt(this,t).get(t)},MapCache$1$1.prototype.has=function mapCacheHas$1(t){return Et(this,t).has(t)},MapCache$1$1.prototype.set=function mapCacheSet$1(t,e){var n=St(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this};function Qa(t){var e=this.__data__;return t=e.delete(t),this.size=e.size,t}function Ra(t){return this.__data__.get(t)}function Sa(t){return this.__data__.has(t)}var Ot=r,jt=o,It=MapCache$1$1,$t=r;function Stack$2(t){t=this.__data__=new $t(t),this.size=t.size}Stack$2.prototype.clear=function stackClear$1(){this.__data__=new ot,this.size=0},Stack$2.prototype.delete=Qa,Stack$2.prototype.get=Ra,Stack$2.prototype.has=Sa,Stack$2.prototype.set=function stackSet$1(t,e){var n=this.__data__;if(n instanceof Ot){var i=n.__data__;if(!jt||i.length<199)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new It(i)}return n.set(t,e),this.size=n.size,this};function Xa(t,e,n){"__proto__"==e&&Tt?Tt(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function $a(t,e,n){(void 0===n||Rt(t[e],n))&&(void 0!==n||e in t)||zt(t,e,n)}function c0(t){var e=new t.constructor(t.byteLength);return new Dt(e).set(new Dt(t)),e}function e0(t,e){return e=e?Ht(t.buffer):t.buffer,new t.constructor(e,t.byteOffset,t.length)}function f0(t,e){var n=-1,i=t.length;for(e=e||Array(i);++n<i;)e[n]=t[n];return e}function j0(e,n){return function(t){return e(n(t))}}function m0(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Ut)}function q0(t){return"function"!=typeof t.constructor||Xt(t)?{}:qt(Jt(t))}function t0(t){return Gt(t)&&"[object Arguments]"==Wt(t)}function z0(t){return"number"==typeof t&&-1<t&&t%1==0&&t<=9007199254740991}function C0(t){return null!=t&&te(t.length)&&!Yt(t)}function T0(t){return ve(t)&&ye(t.length)&&!!m[he(t)]}function U0(e){return function(t){return e(t)}}function _0(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}function db(t,e,n){var i=t[e];ke.call(t,e)&&be(i,n)&&(void 0!==n||e in t)||me(t,e,n)}function gb(t,e,n,i){var r=!n;n=n||{};for(var o=-1,s=e.length;++o<s;){var a=e[o],l=i?i(n[a],t[a],a,n,t):void 0;void 0===l&&(l=t[a]),(r?Pe:we)(n,a,l)}return n}function ib(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&Ee.test(t))&&-1<t&&t%1==0&&t<e}function pb(t,e){var n,i=je(t),r=!i&&Se(t),o=!i&&!r&&Ie(t),s=!i&&!r&&!o&&Me(t),a=i||r||o||s,l=a?function baseTimes$1(t,e){for(var n=-1,i=Array(t);++n<t;)i[n]=e(n);return i}(t.length,String):[],c=l.length;for(n in t)!e&&!Ae.call(t,n)||a&&("length"==n||o&&("offset"==n||"parent"==n)||s&&("buffer"==n||"byteLength"==n||"byteOffset"==n)||$e(n,c))||l.push(n);return l}function ub(t){if(!Le(t))return function nativeKeysIn$1(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e,n=Te(t),i=[];for(e in t)("constructor"!=e||!n&&ze.call(t,e))&&i.push(e);return i}function wb(t){return Fe(t)?He(t,!0):ub(t)}function Qb(t,e,n,i,r,o,s){var a,l,c,h=ln(t,n),u=ln(e,n),d=s.get(u);d||((e=void 0===(d=o?o(h,u,n+"",t,e,s):void 0))&&(l=!(a=Ze(u))&&en(u),c=!a&&!l&&an(u),d=u,a||l||c?d=Ze(h)?h:tn(h)?Ge(h):l?Xe(u,!(e=!1)):c?We(u,!(e=!1)):[]:sn(u)||Qe(u)?Qe(d=h)?d=function toPlainObject$1(t){return Ve(t,Ue(t))}(h):rn(h)&&!nn(h)||(d=Ke(u)):e=!1),e&&(s.set(u,d),r(d,u,i,o,s),s.delete(u))),qe(t,n,d)}function Ub(t){return t}function Vb(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Xb(t){return function(){return t}}function b1(o,s,a){return s=yn(void 0===s?o.length-1:s,0),function(){for(var t=arguments,e=-1,n=yn(t.length-s,0),i=Array(n);++e<n;)i[e]=t[s+e];for(var e=-1,r=Array(s+1);++e<s;)r[e]=t[e];return r[s]=a(i),Vb(o,this,r)}}function h1(i,r,o,s,a){i!==r&&un(r,function(t,e){var n;a=a||new cn,dn(t)?Qb(i,r,e,o,h1,s,a):(n=s?s(pn(i,e),t,e+"",i,r,a):void 0,hn(i,e,n=void 0===n?t:n))},fn)}var Mt,At,Bt,a=Stack$2,Lt=ra,r=function(){try{var t=Lt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Tt=r,zt=Xa,Rt=P,l=function createBaseFor$1(l){return function(t,e,n){for(var i=-1,r=Object(t),o=n(t),s=o.length;s--;){var a=o[l?s:++i];if(!1===e(r[a],a,r))break}return t}}(),Nt={exports:{}},Dt=(Bt=(d=(d=(h=(h=(f=Nt).exports)&&!h.nodeType&&h)&&f&&!f.nodeType&&f)&&d.exports===h?e.Buffer:void 0)?d.allocUnsafe:void 0,f.exports=function cloneBuffer(t,e){return e?t.slice():(e=t.length,e=Bt?Bt(e):new t.constructor(e),t.copy(e),e)},e.Uint8Array),Ht=c0,Ft=_,Vt=Object.create,h=j0(Object.getPrototypeOf,Object),Ut=Object.prototype,qt=function(t){return Ft(t)?Vt?Vt(t):(object.prototype=t,t=new object,object.prototype=void 0,t):{}},Jt=h,Xt=m0,Wt=s,Gt=u,Kt=u,d=Object.prototype,Qt=d.hasOwnProperty,Zt=d.propertyIsEnumerable,f=t0(function(){return arguments}())?t0:function(t){return Kt(t)&&Qt.call(t,"callee")&&!Zt.call(t,"callee")},Yt=ca,te=z0,ne=C0,ie=u,d={exports:{}},re=(b=((g=(g=(b=(b=(v=d).exports)&&!b.nodeType&&b)&&v&&!v.nodeType&&v)&&g.exports===b?e.Buffer:void 0)?g.isBuffer:void 0)||function stubFalse(){return!1},v.exports=b,s),oe=h,se=u,g=Function.prototype,v=Object.prototype,ae=g.toString,le=v.hasOwnProperty,ce=ae.call(Object),he=s,ye=z0,ve=u,m={},b=(m["[object Float32Array]"]=m["[object Float64Array]"]=m["[object Int8Array]"]=m["[object Int16Array]"]=m["[object Int32Array]"]=m["[object Uint8Array]"]=m["[object Uint8ClampedArray]"]=m["[object Uint16Array]"]=m["[object Uint32Array]"]=!0,m["[object Arguments]"]=m["[object Array]"]=m["[object ArrayBuffer]"]=m["[object Boolean]"]=m["[object DataView]"]=m["[object Date]"]=m["[object Error]"]=m["[object Function]"]=m["[object Map]"]=m["[object Number]"]=m["[object Object]"]=m["[object RegExp]"]=m["[object Set]"]=m["[object String]"]=m["[object WeakMap]"]=!1,{exports:{}}),t=(Mt=(v=(v=(g=b).exports)&&!v.nodeType&&v)&&g&&!g.nodeType&&g,At=Mt&&Mt.exports===v&&t.process,v=function(){try{return Mt&&Mt.require&&Mt.require("util").types||At&&At.binding&&At.binding("util")}catch(t){}}(),g.exports=v,T0),g=U0,v=b.exports,v=v&&v.isTypedArray,g=v?g(v):t,me=Xa,be=P,ke=Object.prototype.hasOwnProperty,we=db,Pe=Xa,Ee=/^(?:0|[1-9]\d*)$/,Se=f,je=i,Ie=d.exports,$e=ib,Me=g,Ae=Object.prototype.hasOwnProperty,Le=_,Te=m0,ze=Object.prototype.hasOwnProperty,He=pb,Fe=C0,Ve=gb,Ue=wb,qe=$a,Xe=Nt.exports,We=e0,Ge=f0,Ke=q0,Qe=f,Ze=i,tn=function isArrayLikeObject$1(t){return ie(t)&&ne(t)},en=d.exports,nn=ca,rn=_,sn=function isPlainObject$1(t){return!(!se(t)||"[object Object]"!=re(t))&&(null===(t=oe(t))||"function"==typeof(t=le.call(t,"constructor")&&t.constructor)&&t instanceof t&&ae.call(t)==ce)},an=g,ln=_0,cn=a,hn=$a,un=l,dn=_,fn=wb,pn=_0,yn=Math.max,gn=r,vn=Date.now,v=function shortOut$1(n){var i=0,r=0;return function(){var t=vn(),e=16-(t-r);if(r=t,0<e){if(800<=++i)return arguments[0]}else i=0;return n.apply(void 0,arguments)}}(gn?function(t,e){return gn(t,"toString",{configurable:!0,enumerable:!1,value:Xb(e),writable:!0})}:Ub),mn=Ub,bn=v,Cn=P,_n=C0,kn=ib,wn=_,Pn=function createAssigner$1(a){return function baseRest$1(t,e){return bn(b1(t,e,mn),t+"")}(function(t,e){var n=-1,i=e.length,r=1<i?e[i-1]:void 0,o=2<i?e[2]:void 0,r=3<a.length&&"function"==typeof r?(i--,r):void 0;for(o&&function isIterateeCall$1(t,e,n){var i;if(wn(n))return i=typeof e,("number"==i?_n(n)&&kn(e,n.length):"string"==i&&e in n)&&Cn(n[e],t)}(e[0],e[1],o)&&(r=i<3?void 0:r,i=1),t=Object(t);++n<i;){var s=e[n];s&&a(t,s,n,r)}return t})}(function(t,e,n){h1(t,e,n)}),xn="undefined"!=typeof Float32Array?Float32Array:Array,En=Math.PI/180;function object(){}function toRadian(t){return t*En}function invert(t,e){var n=e[0],i=e[1],r=e[2],o=e[3],s=e[4],a=(e=e[5],n*o-i*r);return a?(t[0]=o*(a=1/a),t[1]=-i*a,t[2]=-r*a,t[3]=n*a,t[4]=(r*e-o*s)*a,t[5]=(i*s-n*e)*a,t):null}function multiply(t,e,n){var i=e[0],r=e[1],o=e[2],s=e[3],a=e[4],l=(e=e[5],n[0]),c=n[1],h=n[2],u=n[3],d=n[4];return n=n[5],t[0]=i*l+o*c,t[1]=r*l+s*c,t[2]=i*h+o*u,t[3]=r*h+s*u,t[4]=i*d+o*n+a,t[5]=r*d+s*n+e,t}function transformMat2d(t,e,n){var i=e[0];return e=e[1],t[0]=n[0]*i+n[2]*e+n[4],t[1]=n[1]*i+n[3]*e+n[5],t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)}),function create(){var t=new xn(2);xn!=Float32Array&&(t[0]=0,t[1]=0)}();function p1(t){if(!Sn(t))return On(t);var e,n=[];for(e in Object(t))jn.call(t,e)&&"constructor"!=e&&n.push(e);return n}function t1(t){return(Mn(t)?In:$n)(t)}function y1(){return[]}function F1(t,e){for(var n=-1,i=e.length,r=t.length;++n<i;)t[r+n]=e[n];return t}function P1(t,e,n){return e=e(t),Xn(t)?e:Jn(e,n(t))}function oc(t,e){return e=e?li(t.buffer):t.buffer,new t.constructor(e,t.byteOffset,t.byteLength)}function pc(t){var e=new t.constructor(t.source,ci.exec(t));return e.lastIndex=t.lastIndex,e}function Ec(t,e){for(var n=-1,i=null==t?0:t.length;++n<i&&!1!==e(t[n],n,t););return t}function Gc(t,e){return t&&An(e,Bn(e),t)}function Hc(t,e){return t&&Ln(e,Tn(e),t)}function Kc(t,e){return Nn(t,Dn(t),e)}function Lc(t,e){return Un(t,qn(t),e)}function Mc(t){return Wn(t,Kn,Gn)}function Nc(t){return Qn(t,Yn,Zn)}function Pc(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&ai.call(t,"index")&&(n.index=t.index,n.input=t.input),n}function Qc(t,e,n){var i=t.constructor;switch(e){case"[object ArrayBuffer]":return ui(t);case"[object Boolean]":case"[object Date]":return new i(+t);case"[object DataView]":return oc(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return di(t,n);case"[object Map]":return new i;case"[object Number]":case"[object String]":return new i(t);case"[object RegExp]":return pc(t);case"[object Set]":return new i;case"[object Symbol]":return function cloneSymbol$1(t){return hi?Object(hi.call(t)):{}}(t)}}function _c(t){return Ii(t,5)}function m2(t){if(null==t)return!0;if(Li(t)&&(Bi(t)||"string"==typeof t||"function"==typeof t.splice||Ti(t)||Ri(t)||Ai(t)))return!t.length;var e,n=Mi(t);if("[object Map]"==n||"[object Set]"==n)return!t.size;if(zi(t))return!$i(t).length;for(e in t)if(Ni.call(t,e))return!1;return!0}var t=j0(Object.keys,Object),Sn=m0,On=t,jn=Object.prototype.hasOwnProperty,In=pb,$n=p1,Mn=C0,An=gb,Bn=t1,Ln=gb,Tn=wb,zn=Object.prototype.propertyIsEnumerable,Rn=Object.getOwnPropertySymbols,l=Rn?function(e){return null==e?[]:(e=Object(e),function arrayFilter$1(t,e){for(var n=-1,i=null==t?0:t.length,r=0,o=[];++n<i;){var s=t[n];e(s,n,t)&&(o[r++]=s)}return o}(Rn(e),function(t){return zn.call(e,t)}))}:y1,Nn=gb,Dn=l,Hn=F1,Fn=h,Vn=l,r=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)Hn(e,Vn(t)),t=Fn(t);return e}:y1,Un=gb,qn=r,Jn=F1,Xn=i,Wn=P1,Gn=l,Kn=t1,Qn=P1,Zn=r,Yn=wb,v=ra(e,"DataView"),t=o,h=ra(e,"Promise"),l=ra(e,"Set"),r=ra(e,"WeakMap"),ti=s,ei=ga,ni=ei(v),ii=ei(t),ri=ei(h),oi=ei(l),si=ei(r),o=ti,v=o=v&&"[object DataView]"!=o(new v(new ArrayBuffer(1)))||t&&"[object Map]"!=o(new t)||h&&"[object Promise]"!=o(h.resolve())||l&&"[object Set]"!=o(new l)||r&&"[object WeakMap]"!=o(new r)?function(t){var e=ti(t);if(t=(t="[object Object]"==e?t.constructor:void 0)?ei(t):"")switch(t){case ni:return"[object DataView]";case ii:return"[object Map]";case ri:return"[object Promise]";case oi:return"[object Set]";case si:return"[object WeakMap]"}return e}:o,ai=Object.prototype.hasOwnProperty,li=c0,ci=/\w*$/,t=n?n.prototype:void 0,hi=t?t.valueOf:void 0,ui=c0,di=e0,fi=v,pi=u,h=U0,l=b.exports,r=l&&l.isMap,o=r?h(r):function baseIsMap$1(t){return pi(t)&&"[object Map]"==fi(t)},yi=v,gi=u,t=U0,l=b.exports,h=l&&l.isSet,r=h?t(h):function baseIsSet$1(t){return gi(t)&&"[object Set]"==yi(t)},vi=a,mi=db,bi=Nt.exports,Ci=f0,_i=v,ki=q0,wi=i,Pi=d.exports,xi=o,Ei=_,Si=r,Oi=t1,ji=wb,C={},Ii=(C["[object Arguments]"]=C["[object Array]"]=C["[object ArrayBuffer]"]=C["[object DataView]"]=C["[object Boolean]"]=C["[object Date]"]=C["[object Float32Array]"]=C["[object Float64Array]"]=C["[object Int8Array]"]=C["[object Int16Array]"]=C["[object Int32Array]"]=C["[object Map]"]=C["[object Number]"]=C["[object Object]"]=C["[object RegExp]"]=C["[object Set]"]=C["[object String]"]=C["[object Symbol]"]=C["[object Uint8Array]"]=C["[object Uint8ClampedArray]"]=C["[object Uint16Array]"]=C["[object Uint32Array]"]=!0,C["[object Error]"]=C["[object Function]"]=C["[object WeakMap]"]=!1,function baseClone$1(n,i,r,t,e,o){var s,a=1&i,l=2&i,c=4&i;if(void 0!==(s=r?e?r(n,t,e,o):r(n):s))return s;if(!Ei(n))return n;if(t=wi(n)){if(s=Pc(n),!a)return Ci(n,s)}else{var h=_i(n),u="[object Function]"==h||"[object GeneratorFunction]"==h;if(Pi(n))return bi(n,a);if("[object Object]"==h||"[object Arguments]"==h||u&&!e){if(s=l||u?{}:ki(n),!a)return l?Lc(n,Hc(s,n)):Kc(n,Gc(s,n))}else{if(!C[h])return e?n:{};s=Qc(n,h,a)}}if(u=(o=o||new vi).get(n))return u;o.set(n,s),Si(n)?n.forEach(function(t){s.add(baseClone$1(t,i,r,t,n,o))}):xi(n)&&n.forEach(function(t,e){s.set(e,baseClone$1(t,i,r,e,n,o))});var d=t?void 0:(c?l?Nc:Mc:l?ji:Oi)(n);return Ec(d||n,function(t,e){d&&(t=n[e=t]),mi(s,e,baseClone$1(t,i,r,e,n,o))}),s}),b=null,k=((b=window||global||{}).requestFrame=b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame||b.oRequestAnimationFrame||b.msRequestAnimationFrame,b),w=(_createClass(ICEEvent,[{key:"composedPath",value:function composedPath(){throw new Error("Method not implemented.")}},{key:"initEvent",value:function initEvent(t,e,n){throw new Error("Method not implemented.")}},{key:"preventDefault",value:function preventDefault(){throw new Error("Method not implemented.")}},{key:"stopImmediatePropagation",value:function stopImmediatePropagation(){throw new Error("Method not implemented.")}},{key:"stopPropagation",value:function stopPropagation(){throw new Error("Method not implemented.")}}]),ICEEvent),$i=p1,Mi=v,Ai=f,Bi=i,Li=C0,Ti=d.exports,zi=m0,Ri=g,Ni=Object.prototype.hasOwnProperty,l=(_createClass(ICEEventTarget,[{key:"on",value:function on(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:k;this.listeners[t]||(this.listeners[t]=[]),this.off(t,e,n),this.listeners[t].push({callback:e,scope:n})}},{key:"off",value:function off(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:k;if(i=this.listeners[t])for(var i=_toConsumableArray(i),r=0;r<i.length;r++){var o=i[r];if(o.callback===e&&o.scope===n)return void this.listeners[t].splice(r,1)}}},{key:"once",value:function once(e,n){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:k,r=this;r.on(e,function callback(t){r.off(e,callback,i),n.call(i,t)},i)}},{key:"trigger",value:function trigger(t){var e,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};if(m2(this.listeners[t]))return!1;if(this.suspendedEventNames.includes(t))return!1;n?((e=new w(n)).originalEvent=n.originalEvent||n,e.param=_objectSpread2({},i)):e=new w({type:t,timeStamp:Date.now(),param:_objectSpread2({},i)});for(var r=this.listeners[t],o=0;o<r.length;o++){var s=r[o];s.callback.call(s.scope,e)}return!0}},{key:"suspend",value:function suspend(t){t&&!this.suspendedEventNames.includes(t)&&this.suspendedEventNames.push(t)}},{key:"resume",value:function resume(e){this.suspendedEventNames.splice(this.suspendedEventNames.findIndex(function(t){return t===e}),1)}},{key:"purgeEvents",value:function purgeEvents(){this.listeners={},this.suspendedEventNames=[]}},{key:"hasListener",value:function hasListener(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:k;if(!this.listeners[t])return!1;var i=this.listeners[t];if(!i)return!1;for(var r=0;r<i.length;r++){var o=i[r];if(o.callback===e&&o.scope===n)return!0}return!1}}]),ICEEventTarget),Di=(l.prototype.addEventListener=l.prototype.on,l.prototype.removeEventListener=l.prototype.off,l.prototype.dispatchEvent=l.prototype.trigger,_createClass(GeoUtil,null,[{key:"calcRotateAngle",value:function calcRotateAngle(t,e,n,i){return t-=n,(((n=e-i)/(e=Math.hypot(t,n))<0?-1:1)*Math.acos(t/e)*180/Math.PI+360)%360}},{key:"calcRotateAngleFromMatrix",value:function calcRotateAngleFromMatrix(t){var e=0,n=t[0],i=(t=t[1],Math.hypot(n,t));return t/=i,e=Math.acos(n/i),t<0&&(e+=Math.PI/2),e*(180/Math.PI)}},{key:"calcScaleFromMatrix",value:function calcScaleFromMatrix(t){var e=t[0],n=t[1],i=t[2];return t=t[3],[Math.hypot(e,n)/e,Math.hypot(i,t)/t]}}]),GeoUtil),Hi=(_createClass(ICEBoundingBox,[{key:"containsPoint",value:function containsPoint(t){var e=(r=this.getMinAndMaxPoint()).minX,n=r.minY,i=r.maxX,r=r.maxY;if(t[0]<e||t[0]>i||t[1]<n||t[1]>r)return!1;for(var o=0,s=this.getBoundingLines(),a=0;a<s.length;a++){var l,c=s[a];t[1]>c.o[1]&&t[1]>c.d[1]||t[1]<c.o[1]&&t[1]<c.d[1]||(c.o[0]===c.d[0]&&c.o[0]>=t[0]?c.o[0]:(l=(c.d[1]-c.o[1])/(c.d[0]-c.o[0]),c.o[0]+(t[1]-c.o[1])/l))>t[0]&&o++}return 0!==o&&o%2==1}},{key:"getBoundingLines",value:function getBoundingLines(){return[{o:_toConsumableArray(this.tl),d:_toConsumableArray(this.tr)},{o:_toConsumableArray(this.tr),d:_toConsumableArray(this.br)},{o:_toConsumableArray(this.br),d:_toConsumableArray(this.bl)},{o:_toConsumableArray(this.bl),d:_toConsumableArray(this.tl)}]}},{key:"getMinAndMaxPoint",value:function getMinAndMaxPoint(){for(var t=this.tl[0],e=this.tl[1],n=this.tl[0],i=this.tl[1],r=[this.tr,this.bl,this.br],o=0;o<r.length;o++){var s=r[o];s[0]<t&&(t=s[0]),s[0]>n&&(n=s[0]),s[1]<e&&(e=s[1]),s[1]>i&&(i=s[1])}return{minX:t,minY:e,maxX:n,maxY:i}}},{key:"containsBox",value:function containsBox(t){return!1}},{key:"isIntersect",value:function isIntersect(t){var e=this.tl[0],n=this.br[0],i=this.tl[1],r=this.br[1],o=t.tl[0],s=t.br[0],a=t.tl[1];return t=t.br[1],!(s<e||t<i||n<o||r<a)}},{key:"transform",value:function transform(t){var e=transformMat2d([],this.tl,t),n=transformMat2d([],this.tr,t),i=transformMat2d([],this.bl,t),r=transformMat2d([],this.br,t);return t=transformMat2d([],this.center,t),new ICEBoundingBox([].concat(_toConsumableArray(e),_toConsumableArray(n),_toConsumableArray(i),_toConsumableArray(r),_toConsumableArray(t)))}},{key:"union",value:function union(t){return null}},{key:"width",get:function get(){var t=this.br[0]-this.bl[0],e=this.br[1]-this.bl[1];return Math.hypot(t,e)}},{key:"height",get:function get(){var t=this.br[0]-this.tr[0],e=this.br[1]-this.tr[1];return Math.hypot(t,e)}},{key:"left",get:function get(){return this.tl[0]},set:function set(t){throw new Error("Can not set left to ICEBoundingBox directly.")}},{key:"top",get:function get(){return this.tl[1]},set:function set(t){throw new Error("Can not set top to ICEBoundingBox directly.")}},{key:"centerX",get:function get(){return this.center[0]}},{key:"centerY",get:function get(){return this.center[1]}},{key:"centerPoint",get:function get(){return this.center}}],[{key:"fromDimension",value:function fromDimension(t,e,n,i){return new ICEBoundingBox([].concat([t,e],[t+n,e],[t,e+i],[t+n,e+i],[t+n/2,e+i/2]))}}]),ICEBoundingBox);function ICEBoundingBox(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[0,0,0,0,0,0,0,0,0,0];_classCallCheck(this,ICEBoundingBox),_defineProperty$1(this,"tl",[0,0]),_defineProperty$1(this,"tr",[0,0]),_defineProperty$1(this,"bl",[0,0]),_defineProperty$1(this,"br",[0,0]),_defineProperty$1(this,"tc",[0,0]),_defineProperty$1(this,"rc",[0,0]),_defineProperty$1(this,"bc",[0,0]),_defineProperty$1(this,"lc",[0,0]),_defineProperty$1(this,"center",[0,0]),this.tl=[t[0],t[1]],this.tr=[t[2],t[3]],this.bl=[t[4],t[5]],this.br=[t[6],t[7]],this.tc=[(this.tr[0]+this.tl[0])/2,(this.tr[1]+this.tl[1])/2],this.bc=[(this.br[0]+this.bl[0])/2,(this.br[1]+this.bl[1])/2],this.lc=[(this.bl[0]+this.tl[0])/2,(this.bl[1]+this.tl[1])/2],this.rc=[(this.br[0]+this.tr[0])/2,(this.br[1]+this.tr[1])/2],this.center=[t[8],t[9]]}function GeoUtil(){throw _classCallCheck(this,GeoUtil),new Error("GeoUtil is a static util class.")}function ICEEventTarget(){_classCallCheck(this,ICEEventTarget),_defineProperty$1(this,"listeners",{}),_defineProperty$1(this,"suspendedEventNames",[])}function ICEEvent(){var t,e,n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};for(t in _classCallCheck(this,ICEEvent),n)this[t]=n[t];for(e in i)this[e]=i[e]}function getVal(t,e){return e.split(".").reduce(function(t,e){return t[e]},t)}function flattenTree(t,e,n,i){for(var r=0<arguments.length&&void 0!==t?t:[],o=1<arguments.length&&void 0!==e?e:[],s=2<arguments.length&&void 0!==n?n:1,a=3<arguments.length&&void 0!==i?i:null,l=0;l<o.length;l++){var c=o[l];c._level=s,c._pid=a,r.push(c),flattenTree(r,c.childNodes||[],s+1,c.id)}return r}function v2(t){return null==t}function E2(t){return"symbol"==typeof t||lr(t)&&"[object Symbol]"==ar(t)}function F2(t){return t&&t.slice(0,function trimmedEndIndex$1(t){for(var e=t.length;e--&&or.test(t.charAt(e)););return e}(t)+1).replace(sr,"")}function M2(t){if("number"==typeof t)return t;if(hr(t))return NaN;if(cr(t)&&(e="function"==typeof t.valueOf?t.valueOf():t,t=cr(e)?e+"":e),"string"!=typeof t)return 0===t?t:+t;t=F2(t);var e=dr.test(t);return e||fr.test(t)?pr(t.slice(2),e?2:8):ur.test(t)?NaN:+t}function S2(t){if("string"==typeof t)return t;if(gr(t))return function arrayMap$1(t,e){for(var n=-1,i=null==t?0:t.length,r=Array(i);++n<i;)r[n]=e(t[n],n,t);return r}(t,S2)+"";if(vr(t))return mr?mr.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function T2(t){var e=(t=function toFinite$1(t){return t?(t=yr(t))===1/0||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}(t))%1;return t==t?e?t-e:t:0}function V2(t){return null==t?"":S2(t)}_inherits(ICEComponent,l),nr=_createSuper(ICEComponent),_createClass(ICEComponent,[{key:"initEvents",value:function initEvents(){this.on("mousedown",this.mouseDownEvtHandler,this),this.on("keydown",this.keyboardEvtHandler,this),this.on("keyup",this.keyboardEvtHandler,this)}},{key:"mouseDownEvtHandler",value:function mouseDownEvtHandler(t){this.state.interactive&&this.state.draggable&&(this.on("mousemove",this.mouseMoveEvtHandler,this),this.on("mouseup",this.mouseUpEvtHandler,this))}},{key:"mouseMoveEvtHandler",value:function mouseMoveEvtHandler(t){var e=t.movementX,n=t.movementY;return this.moveGlobalPosition(e,n,t),!0}},{key:"mouseUpEvtHandler",value:function mouseUpEvtHandler(t){this.off("mousemove",this.mouseMoveEvtHandler,this),this.off("mouseup",this.mouseUpEvtHandler,this)}},{key:"keyboardEvtHandler",value:function keyboardEvtHandler(t){switch(t.key){case"ArrowUp":this.moveGlobalPosition(0,-2,t);break;case"ArrowDown":this.moveGlobalPosition(0,2,t);break;case"ArrowLeft":this.moveGlobalPosition(-2,0,t);break;case"ArrowRight":this.moveGlobalPosition(2,0,t);break;case"Delete":(this.parentNode&&this.parentNode.removeChild?this.parentNode:this.ice).removeChild(this)}}},{key:"render",value:function render(){this.trigger("BEFORE_RENDER"),this.state.display&&(this.calcComponentParams(),this.applyStyleToCtx(),this.applyTransformToCtx(),this.doRender(),this.trigger(D),this.dirty=!1)}},{key:"applyStyleToCtx",value:function applyStyleToCtx(){var t,e=_objectSpread2(_objectSpread2({},this.props.style),this.state.style);for(t in e)this.ctx[t]=e[t]}},{key:"calcComponentParams",value:function calcComponentParams(){return{width:this.state.width,height:this.state.height}}},{key:"calcLocalOrigin",value:function calcLocalOrigin(){var t=[0,0],e=this.state.origin;return e&&"localCenter"!==e||(t[0]=this.state.width/2,t[1]=this.state.height/2),this.state.localOrigin=t}},{key:"calcAbsoluteOrigin",value:function calcAbsoluteOrigin(){var t=getVal(this,"state.transform.translate.0")+this.state.left,e=getVal(this,"state.transform.translate.1")+this.state.top,n=_toConsumableArray(this.calcLocalOrigin());return n[0]+=t,n[1]+=e,this.parentNode&&(n=transformMat2d([],n,[1,0,0,1,-this.parentNode.state.localOrigin[0],-this.parentNode.state.localOrigin[1]]),n=transformMat2d([],n,this.parentNode.state.composedMatrix)),this.state.absoluteOrigin=n}},{key:"calcLinearMatrix",value:function calcLinearMatrix(){var t=function create$1(){var t=new xn(6);return xn!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t}(),e=getVal(this,"state.transform.skew.0"),n=getVal(this,"state.transform.skew.1"),t=function scale(t,e,n){var i=e[0],r=e[1],o=e[2],s=e[3],a=e[4],l=(e=e[5],n[0]);return n=n[1],t[0]=i*l,t[1]=r*l,t[2]=o*n,t[3]=s*n,t[4]=a,t[5]=e,t}([],function rotate(t,e,n){var i=e[0],r=e[1],o=e[2],s=e[3],a=e[4],l=(e=e[5],Math.sin(n));return n=Math.cos(n),t[0]=i*n+o*l,t[1]=r*n+s*l,t[2]=i*-l+o*n,t[3]=r*-l+s*n,t[4]=a,t[5]=e,t}([],function skew(t,e,n,i){return n=Math.tan(n),i=Math.tan(i),t[0]=e[0],t[1]=e[1]+n,t[2]=e[2]+i,t[3]=e[3],t[4]=e[4],t[5]=e[5],t}([],t,e*En,n*En),toRadian(getVal(this,"state.transform.rotate"))),[getVal(this,"state.transform.scale.0"),getVal(this,"state.transform.scale.1")]);return this.state.linearMatrix=t}},{key:"calcAbsoluteLinearMatrix",value:function calcAbsoluteLinearMatrix(){for(var t=this,e=t.calcLinearMatrix();t.parentNode;)e=multiply([],t.parentNode.state.linearMatrix,e),t=t.parentNode;return this.state.absoluteLinearMatrix=e}},{key:"composeMatrix",value:function composeMatrix(){var t=multiply([],[1,0,0,1,(t=this.calcAbsoluteOrigin())[0],t[1]],this.calcAbsoluteLinearMatrix());return this.state.composedMatrix=t}},{key:"applyTransformToCtx",value:function applyTransformToCtx(){var t,e=this.dirty?this.composeMatrix():this.state.composedMatrix;(t=this.ctx).setTransform.apply(t,_toConsumableArray(e))}},{key:"doRender",value:function doRender(){var t;this.ctx.setTransform(1,0,0,1,0,0),this.ctx.lineWidth=1,this.state.showMinBoundingBox&&(t=this.getMinBoundingBox(),this.ctx.strokeStyle="#ff0000",this.ctx.fillStyle="rgba(0,0,0,0)",this.ctx.beginPath(),this.ctx.moveTo(t.tl[0],t.tl[1]),this.ctx.lineTo(t.tr[0],t.tr[1]),this.ctx.lineTo(t.br[0],t.br[1]),this.ctx.lineTo(t.bl[0],t.bl[1]),this.ctx.closePath(),this.ctx.stroke(),this.ctx.fill()),this.state.showMaxBoundingBox&&(t=this.getMaxBoundingBox(),this.ctx.strokeStyle="#0000ff",this.ctx.fillStyle="rgba(0,0,0,0)",this.ctx.beginPath(),this.ctx.moveTo(t.tl[0],t.tl[1]),this.ctx.lineTo(t.tr[0],t.tr[1]),this.ctx.lineTo(t.br[0],t.br[1]),this.ctx.lineTo(t.bl[0],t.bl[1]),this.ctx.closePath(),this.ctx.stroke(),this.ctx.fill())}},{key:"getMinBoundingBox",value:function getMinBoundingBox(){var t=0<arguments.length&&void 0!==arguments[0]&&arguments[0],e=this.state.localOrigin[0],n=this.state.localOrigin[1],i=this.state.width,r=this.state.height,e=new Hi([0-e,0-n,0-e+i,0-n,0-e,0-n+r,0-e+i,0-n+r,0,0]),i=t?this.composeMatrix():this.state.composedMatrix;return e.transform(i)}},{key:"getMaxBoundingBox",value:function getMaxBoundingBox(){var t=(i=(r=this.getMinBoundingBox(0<arguments.length&&void 0!==arguments[0]&&arguments[0])).getMinAndMaxPoint()).minX,e=i.minY,n=i.maxX,i=i.maxY,r=r.centerPoint;return new Hi([t,e,n,e,t,i,n,i,r[0],r[1]])}},{key:"setState",value:function setState(t){Pn(this.state,t),this.dirty=!0,this.ice&&(this.ice.dirty=!0)}},{key:"dirty",get:function get(){return this.__dirty},set:function set(t){this.__dirty=t}},{key:"setPosition",value:function setPosition(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:new w;this.trigger("BEFORE_MOVE",_objectSpread2(_objectSpread2({},n),{},{left:t,top:e})),this.setState({left:t,top:e}),this.trigger(K,_objectSpread2(_objectSpread2({},n),{},{left:t,top:e}))}},{key:"moveGlobalPosition",value:function moveGlobalPosition(t,e){var n,i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:new w;this.parentNode&&(t=(n=transformMat2d([],[t,e],invert([],this.parentNode.state.absoluteLinearMatrix)))[0],e=n[1]),this.setPosition(this.state.left+t,this.state.top+e,_objectSpread2(_objectSpread2({},i),{},{tx:t,ty:e}))}},{key:"setGlobalPosition",value:function setGlobalPosition(t,e){var n,i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:new w;this.parentNode&&(t=(n=transformMat2d([],[t,e],invert([],this.parentNode.state.absoluteLinearMatrix)))[0],e=n[1]),this.setPosition(t,e,_objectSpread2(_objectSpread2({},i),{},{left:t,top:e}))}},{key:"setGlobalRotate",value:function setGlobalRotate(t){var e;this.parentNode&&(e=this.parentNode.state.absoluteLinearMatrix,t-=Di.calcRotateAngleFromMatrix(e)),this.setState({transform:{rotate:t}})}},{key:"localToGlobal",value:function localToGlobal(t,e){return transformMat2d([],t=[t,e],this.state.composedMatrix)}},{key:"globalToLocal",value:function globalToLocal(t,e){return transformMat2d([],t=[t,e],invert([],this.state.composedMatrix))}},{key:"getRotateAngle",value:function getRotateAngle(){var t=this.state.composedMatrix;return Di.calcRotateAngleFromMatrix(t)}},{key:"getLocalLeftTop",value:function getLocalLeftTop(){var t=this.getMinBoundingBox(!0),e=t.width,n=t.height;return{left:t.centerX-t.width/2,top:t.centerY-t.height/2,width:e,height:n}}},{key:"containsPoint",value:function containsPoint(t,e){return this.getMinBoundingBox().containsPoint([t,e])}},{key:"destory",value:function destory(){this.trigger(V,null,{component:this}),this.purgeEvents(),this.ice=null,this.ctx=null,this.root=null,this.evtBus=null,this.parentNode=null}}]);var Fi,Vi,Ui,qi,Ji,Xi,Wi,Gi,Ki,Qi,Zi,Yi,tr,er,nr,t=ICEComponent,h=(_defineProperty$1(t,"instanceCounter",0),_inherits(ICEPath,t),er=_createSuper(ICEPath),_createClass(ICEPath,[{key:"doRender",value:function doRender(){this.dirty&&(this.ctx.beginPath(),this.createPathObject()),this.state.closePath&&this.path2D.closePath(),this.state.fill&&this.ctx.fill(this.path2D),this.state.stroke&&this.ctx.stroke(this.path2D),_get(_getPrototypeOf(ICEPath.prototype),"doRender",this).call(this)}}]),ICEPath),a=(_inherits(ICERect,h),tr=_createSuper(ICERect),_createClass(ICERect,[{key:"createPathObject",value:function createPathObject(){return this.path2D=new Path2D,this.path2D.rect(0-this.state.localOrigin[0],0-this.state.localOrigin[1],this.state.width,this.state.height),this.path2D}}]),ICERect),Nt=(_inherits(ICEGroup,a),Yi=_createSuper(ICEGroup),_createClass(ICEGroup,[{key:"initEvents",value:function initEvents(){_get(_getPrototypeOf(ICEGroup.prototype),"initEvents",this).call(this),this.once(F,this.afterAddHandler,this)}},{key:"afterAddHandler",value:function afterAddHandler(){for(var t=0;t<this.childNodes.length;t++){var e=this.childNodes[t];this.syncChildEvents(e)}}},{key:"syncChildEvents",value:function syncChildEvents(t){t.trigger(H),t.ice=this.ice,t.ctx=this.ice.ctx,t.evtBus=this.ice.evtBus,t.trigger(F)}},{key:"addChild",value:function addChild(t){var e=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];-1===this.childNodes.indexOf(t)&&((t.parentNode=this).childNodes.push(t),this.dirty=e,this.ice&&(this.syncChildEvents(t),this.ice.dirty=e))}},{key:"addChildren",value:function addChildren(t){for(var e=0;e<t.length;e++){var n=t[e];this.addChild(n,!1)}this.dirty=!0,this.ice&&(this.ice.dirty=!0)}},{key:"removeChild",value:function removeChild(t){var e=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];t.destory(),this.childNodes.splice(this.childNodes.indexOf(t),1),this.dirty=e,this.ice&&(this.ice.dirty=e)}},{key:"removeChildren",value:function removeChildren(t){for(var e=0;e<t.length;e++){var n=t[e];this.removeChild(n,!1)}this.dirty=!0,this.ice&&(this.ice.dirty=!0)}},{key:"setState",value:function setState(t){Pn(this.state,t),this.dirty=!0,function setRecursively(t){if(t.dirty=!0,t.childNodes&&t.childNodes.length)for(var e=0;e<t.childNodes.length;e++)setRecursively(t.childNodes[e])}(this),this.ice&&(this.ice.dirty=!0)}},{key:"destory",value:function destory(){this.removeChildren(this.childNodes),_get(_getPrototypeOf(ICEGroup.prototype),"destory",this).call(this)}}]),ICEGroup),o=(_inherits(ICEControlPanel,Nt),Zi=_createSuper(ICEControlPanel),_createClass(ICEControlPanel,[{key:"doRender",value:function doRender(){_get(_getPrototypeOf(ICEControlPanel.prototype),"doRender",this).call(this),this.updateControlPositions()}},{key:"moveGlobalPosition",value:function moveGlobalPosition(t,e,n){_get(_getPrototypeOf(ICEControlPanel.prototype),"moveGlobalPosition",this).call(this,t,e,n),this._targetComponent&&this._targetComponent.moveGlobalPosition(t,e,n)}}]),ICEControlPanel),r=(_inherits(ICEEllipse,h),Qi=_createSuper(ICEEllipse),_createClass(ICEEllipse,[{key:"createPathObject",value:function createPathObject(){return this.path2D=new Path2D,this.path2D.ellipse(this.state.radiusX-this.state.localOrigin[0],this.state.radiusY-this.state.localOrigin[1],this.state.radiusX,this.state.radiusY,this.state.rotation,this.state.startAngle,this.state.endAngle,this.state.counterclockwise),this.path2D.closePath(),this.path2D}},{key:"setState",value:function setState(t){v2(t.radiusX)?v2(t.width)||(t.radiusX=t.width/2):t.width=2*t.radiusX,v2(t.radiusY)?v2(t.height)||(t.radiusY=t.height/2):t.height=2*t.radiusY,_get(_getPrototypeOf(ICEEllipse.prototype),"setState",this).call(this,t)}}]),ICEEllipse),b=(_inherits(ICECircle,r),Ki=_createSuper(ICECircle),_createClass(ICECircle)),ir=(_inherits(ICELinkHook,b),Gi=_createSuper(ICELinkHook),_createClass(ICELinkHook,[{key:"initEvents",value:function initEvents(){_get(_getPrototypeOf(ICELinkHook.prototype),"initEvents",this).call(this),this.on("mousedown",this.mosueDownHandler,this),this.on("mousemove",this.mosueMoveHandler,this),this.on("mouseup",this.mosueUpHandler,this),this.on(K,this.resizeEvtHandler,this)}},{key:"keyboardEvtHandler",value:function keyboardEvtHandler(t){}},{key:"mosueDownHandler",value:function mosueDownHandler(t){this.evtBus.trigger("HOOK_MOUSEDOWN",new w({target:this}))}},{key:"mosueMoveHandler",value:function mosueMoveHandler(t){this.evtBus.trigger(J,new w({target:this}))}},{key:"mosueUpHandler",value:function mosueUpHandler(t){this.evtBus.trigger(X,new w({target:this}))}},{key:"resizeEvtHandler",value:function resizeEvtHandler(t){var e;this.parentNode&&(e=this.props.position,this.parentNode.trigger(W,new w(t,{position:e})),this.parentNode.trigger(c,new w(t,{position:e})))}}]),ICELinkHook),rr=(_inherits(LineControlPanel,o),Wi=_createSuper(LineControlPanel),_createClass(LineControlPanel,[{key:"initControls",value:function initControls(){var t=this.state.width,e=this.state.height,n=this.controlSize/2;this.startControl=new ir({zIndex:10001001,display:!1,left:-n,top:-n,width:this.controlSize,height:this.controlSize,style:{strokeStyle:"#0c09d4",fillStyle:"#3ce92c",lineWidth:1},position:"start"}),this.addChild(this.startControl),this.endControl=new ir({zIndex:10001002,display:!1,left:t-n,top:e-n,width:this.controlSize,height:this.controlSize,style:{strokeStyle:"#0c09d4",fillStyle:"#3ce92c",lineWidth:1},position:"end"}),this.addChild(this.endControl)}},{key:"initEvents",value:function initEvents(){this.on(c,this.resizeEvtHandler,this)}},{key:"enable",value:function enable(){this.setState({display:!0}),this.resume(c),this.showHooks()}},{key:"disable",value:function disable(){this.setState({display:!1}),this.suspend(c),this.hideHooks()}},{key:"updateControlPositions",value:function updateControlPositions(){}},{key:"resizeEvtHandler",value:function resizeEvtHandler(t){if(this.targetComponent){var e=t.position,n=t.movementX,i=t.movementY,r=(t=this.targetComponent.state).points.length,o=t.points[0][0],s=t.points[0][1],a=t.points[r-1][0],l=t.points[r-1][1],n=(r=transformMat2d([],[n,i],invert([],t.absoluteLinearMatrix)))[0],i=r[1];switch(e){case"start":o+=n,s+=i;break;case"end":a+=n,l+=i}this.targetComponent.setState({startPoint:[o,s],endPoint:[a,l]})}}},{key:"updatePosition",value:function updatePosition(){var t,e,n;this.targetComponent&&(this.setState({left:0,top:-5,width:3,height:3,transform:{translate:[0,0],scale:[1,1],skew:[0,0],rotate:0}}),t=this.controlSize/2,n=this.targetComponent.state.points.length,e=this.targetComponent.state.points[0],n=this.targetComponent.state.points[n-1],e=[e[0],e[1]],n=[n[0],n[1]],this.startControl.setState({left:e[0]-t,top:e[1]-t}),this.endControl.setState({left:n[0]-t,top:n[1]-t}))}},{key:"targetComponent",get:function get(){return this._targetComponent},set:function set(t){var e=this;this._targetComponent&&this._targetComponent.off(K,this.updatePosition,this),this._targetComponent=t,this._targetComponent&&this._targetComponent.on(K,this.updatePosition,this),this._targetComponent&&this._targetComponent.once(V,function(){e.targetComponent=null,e.disable()},this),this.updatePosition()}},{key:"showHooks",value:function showHooks(){this.startControl.setState({display:!0}),this.endControl.setState({display:!0})}},{key:"hideHooks",value:function hideHooks(){this.startControl.setState({display:!1}),this.endControl.setState({display:!1})}}]),LineControlPanel),or=/\s/,sr=/^\s+/,ar=s,lr=u,cr=_,hr=E2,ur=/^[-+]0x[0-9a-f]+$/i,dr=/^0b[01]+$/i,fr=/^0o[0-7]+$/i,pr=parseInt,yr=M2,gr=i,vr=E2,v=n?n.prototype:void 0,mr=v?v.toString:void 0,br=M2,Cr=e.isFinite,_r=Math.min,kr=function createRound$1(t){var r=Math[t];return function(t,e){var n,i;return t=br(t),(e=null==e?0:_r(T2(e),292))&&Cr(t)?(n=(V2(t)+"e").split("e"),i=r(n[0]+"e"+(+n[1]+e)),+((n=(V2(i)+"e").split("e"))[0]+"e"+(+n[1]-e))):r(t)}}("round"),wr=(_inherits(ResizeControl,a),Xi=_createSuper(ResizeControl),_createClass(ResizeControl,[{key:"initEvents",value:function initEvents(){_get(_getPrototypeOf(ResizeControl.prototype),"initEvents",this).call(this),this.on(K,this.resizeEvtHandler,this)}},{key:"resizeEvtHandler",value:function resizeEvtHandler(t){if(this.parentNode){var e,n=t.quadrant,i=t.movementX,r=t.movementY,o=(e=this.parentNode.state).left,s=e.top,a=e.width,l=e.height,i=(e=transformMat2d([],[i,r],invert([],e.absoluteLinearMatrix)))[0],r=e[1];switch(n){case 1:o-=i,s+=r,a+=2*i,l-=2*r;break;case 2:o+=i,s+=r,a-=2*i,l-=2*r;break;case 3:o+=i,s-=r,a-=2*i,l+=2*r;break;case 4:o-=i,s-=r,a+=2*i,l+=2*r;break;case 5:s+=r,l-=2*r;break;case 6:s-=r,l+=2*r;break;case 7:o+=i,a-=2*i;break;case 8:o-=i,a+=2*i}e={top:s,left:o,width:Math.abs(a),height:Math.abs(l)},this.parentNode.trigger(W,new w(t,{quadrant:n})),this.parentNode.setState(e),this.parentNode.trigger(c,new w(t,{quadrant:n}))}}},{key:"moveGlobalPosition",value:function moveGlobalPosition(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:new w,i=0<t?1:-1,r=0<e?1:-1,o=(h=this.parentNode.state).localOrigin,s=h.width,a=h.height,l=(t=(h=transformMat2d([],[t,e],invert([],h.absoluteLinearMatrix)))[0],e=h[1],(h=this.state).left),c=h.top,h=h.quadrant,u=this.state.width/2,d=0;"x"===this.state.direction?d=0<(l=0===kr(l+=t)?.5*i:l)+u-o[0]?8:7:"y"===this.state.direction?d=0<(c=0===kr(c+=e)?.5*r:c)+u-o[1]?6:5:"xy"===this.state.direction&&(r=-a/2/(0===kr(r=-s/2)?.5*i:r),0===kr(s/=2)&&(s=.5*i),c+=e=2===h||4==h?r*(l+u-o[0]+t)-(c+u-o[1]):-a/2/s*(l+u-o[0]+t)-(c+u-o[1]),d=0<(l+=t)+u-o[0]?0<c+u-o[1]?4:1:0<c+u-o[1]?3:2),h!==d&&this.parentNode.toggleControlQuadrant(this,d),this.setPosition(l,c,new w(n,{left:l,top:c,tx:t,ty:e,quadrant:d}))}}]),ResizeControl),Pr=(_inherits(RotateControl,b),Ji=_createSuper(RotateControl),_createClass(RotateControl,[{key:"initEvents",value:function initEvents(){_get(_getPrototypeOf(RotateControl.prototype),"initEvents",this).call(this),this.on(K,this.rotateEvtHandler,this)}},{key:"rotateEvtHandler",value:function rotateEvtHandler(t){var e;this.parentNode&&(e=this.parentNode.state.absoluteOrigin,t={transform:{rotate:Di.calcRotateAngle(t.offsetX,t.offsetY,e[0],e[1])+90}},this.parentNode.trigger("BEFORE_ROTATE",new w(t)),this.parentNode.setState(t),this.parentNode.trigger(G,new w(t)))}}]),RotateControl),xr=(_inherits(TransformControlPanel,o),qi=_createSuper(TransformControlPanel),_createClass(TransformControlPanel,[{key:"initControls",value:function initControls(){var t=this.state.width,e=this.state.height,n=t/2,i=e/2,r=this.resizeControlSize/2,o=[{direction:"xy",quadrant:2,position:[-r,-r]},{direction:"y",quadrant:5,position:[n-r,-r]},{direction:"xy",quadrant:1,position:[t-r,-r]},{direction:"x",quadrant:8,position:[t-r,i-r]},{direction:"xy",quadrant:4,position:[t-r,e-r]},{direction:"y",quadrant:6,position:[n-r,e-r]},{direction:"xy",quadrant:3,position:[-r,e-r]},{direction:"x",quadrant:7,position:[-r,i-r]}];this.resizeControlInstanceCache=[];for(var s=0;s<o.length;s++){var a=new wr({zIndex:10000002,display:!1,left:(a=o[s]).position[0],top:a.position[1],width:this.resizeControlSize,height:this.resizeControlSize,style:{strokeStyle:"#8b0000",fillStyle:"#CC3300",lineWidth:1},direction:a.direction,quadrant:a.quadrant});this.addChild(a),this.resizeControlInstanceCache.push(a)}t=this.state.width/2-this.rotateControlSize,n=-this.rotateControlffsetY,this.rotateControlInstance=new Pr({zIndex:10000003,display:!1,left:t,top:n,radius:this.rotateControlSize,style:{strokeStyle:"#8b0000",fillStyle:"#CC3300",lineWidth:1}}),this.addChild(this.rotateControlInstance)}},{key:"initEvents",value:function initEvents(){_get(_getPrototypeOf(TransformControlPanel.prototype),"initEvents",this).call(this),this.on(c,this.resizeEvtHandler,this),this.on(G,this.rotateEvtHandler,this),this.on("keydown",this.keyboardEvtHandler,this),this.on("keyup",this.keyboardEvtHandler,this)}},{key:"enable",value:function enable(){this.rotateControlInstance.setState({display:!0});for(var t=0;t<this.resizeControlInstanceCache.length;t++)this.resizeControlInstanceCache[t].setState({display:!0});this.setState({display:!0}),this.resume(c),this.resume(G),this.resume("keydown"),this.resume("keyup")}},{key:"disable",value:function disable(){this.rotateControlInstance.setState({display:!1});for(var t=0;t<this.resizeControlInstanceCache.length;t++)this.resizeControlInstanceCache[t].setState({display:!1});this.setState({display:!1}),this.suspend(c),this.suspend(G),this.suspend("keydown"),this.suspend("keyup")}},{key:"keyboardEvtHandler",value:function keyboardEvtHandler(t){this.targetComponent&&this.targetComponent.trigger(t.type,t,{component:this.targetComponent})}},{key:"rotateEvtHandler",value:function rotateEvtHandler(t){var e;this.targetComponent&&(e=this.state.transform.rotate,this.targetComponent.setGlobalRotate(e),this.targetComponent.trigger(G))}},{key:"resizeEvtHandler",value:function resizeEvtHandler(t){if(this.targetComponent){var e=t.quadrant,n=t.movementX,i=t.movementY,r=(t=this.targetComponent.state).left,o=t.top,s=t.width,a=t.height,n=(t=transformMat2d([],[n,i],invert([],t.absoluteLinearMatrix)))[0],i=t[1];switch(e){case 1:r-=n,o+=i,s+=2*n,a-=2*i;break;case 2:r+=n,o+=i,s-=2*n,a-=2*i;break;case 3:r+=n,o-=i,s-=2*n,a+=2*i;break;case 4:r-=n,o-=i,s+=2*n,a+=2*i;break;case 5:o+=i,a-=2*i;break;case 6:o-=i,a+=2*i;break;case 7:r+=n,s-=2*n;break;case 8:r-=n,s+=2*n}this.targetComponent.setState({left:r,top:o,width:Math.abs(s),height:Math.abs(a)}),this.targetComponent.trigger(c)}}},{key:"updateControlPositions",value:function updateControlPositions(){for(var t=this.state.width,e=this.state.height,n=t/2,i=e/2,r=this.resizeControlSize/2,o=0;o<this.resizeControlInstanceCache.length;o++){var s=this.resizeControlInstanceCache[o],a=[0,0];switch(s.state.quadrant){case 1:a=[t-r,-r];break;case 2:a=[-r,-r];break;case 3:a=[-r,e-r];break;case 4:a=[t-r,e-r];break;case 5:a=[n-r,-r];break;case 6:a=[n-r,e-r];break;case 7:a=[-r,i-r];break;case 8:a=[t-r,i-r]}s.setState({left:a[0],top:a[1]})}var l=this.state.width/2-this.rotateControlSize,c=-this.rotateControlffsetY;this.rotateControlInstance.setState({left:l,top:c})}},{key:"updatePanel",value:function updatePanel(){var t,e,n,i,r;this.targetComponent&&(t=this.targetComponent.getRotateAngle(),e=(r=this.targetComponent.getLocalLeftTop()).left,n=r.top,i=r.width,r=r.height,this.setState({left:e,top:n,width:i,height:r,transform:{rotate:t}}))}},{key:"targetComponent",get:function get(){return this._targetComponent},set:function set(t){var e=this;this._targetComponent&&this._targetComponent.off(K,this.updatePanel,this),this._targetComponent=t,this._targetComponent&&this._targetComponent.on(K,this.updatePanel,this),this._targetComponent&&this._targetComponent.once(V,function(){e.targetComponent=null,e.disable()},this),this.updatePanel()}},{key:"toggleControlQuadrant",value:function toggleControlQuadrant(t,e){for(var n=0;n<this.resizeControlInstanceCache.length;n++){var i=this.resizeControlInstanceCache[n];if(i.state.quadrant===e){var r=0;switch(e){case 1:r=3;break;case 2:r=4;break;case 3:r=1;break;case 4:r=2;break;case 5:r=6;break;case 6:r=5;break;case 7:r=8;break;case 8:r=7}i.setState({quadrant:r})}}t.setState({quadrant:e})}}]),TransformControlPanel),Er=(_createClass(ICEControlPanelManager,[{key:"start",value:function start(){return this.ice.evtBus.on("mousedown",this.mouseDownHandler,this),this}},{key:"stop",value:function stop(){return this.ice.evtBus.off("mousedown",this.mouseDownHandler,this),this}},{key:"mouseDownHandler",value:function mouseDownHandler(t){if(!(t=t.target).ice||!t.state.interactive||!t.state.transformable)return this.lineControlPanel.disable(),void this.transformControlPanel.disable();t&&(t.isControlPanel||t.parentNode&&t.parentNode.isControlPanel)||(this.ice.selectionList=[t],this.lineControlPanel.disable(),this.transformControlPanel.disable(),t.isLine?(this.lineControlPanel.targetComponent=t,this.lineControlPanel.enable()):(this.transformControlPanel.targetComponent=t,this.transformControlPanel.enable()))}}]),ICEControlPanelManager),Sr=[["mousedown","ICE_MOUSEDOWN"],["mouseup","ICE_MOUSEUP"],["mousemove","ICE_MOUSEMOVE"],["click","ICE_CLICK"],["dblclick","ICE_DBCLICK"],["contextmenu","ICE_CONTEXTMENU"]],Or=[["keydown","ICE_KEYDOWN"],["keyup","ICE_KEYUP"]],jr=(_createClass(DOMEventDispatcher,[{key:"start",value:function start(){for(var i=this,r=null,o=[].concat(_toConsumableArray(Sr),_toConsumableArray(Or)),t=0;t<o.length;t++)!function fk(t){var e=(t=o[t])[0],n=t[1];i.ice.evtBus.on(n,function(t){i._stopped||((r="ICE_MOUSEMOVE"!==n&&-1===n.indexOf("KEY")?i.findTargetComponent(t):r)&&(t.target=r).trigger(e,t),i.ice.evtBus.trigger(e,t,{component:r}))})}(t);return this}},{key:"stopped",get:function get(){return this._stopped},set:function set(t){this._stopped=t}},{key:"findTargetComponent",value:function findTargetComponent(t){if(this._stopped)return null;var e=t.offsetX,n=t.offsetY,i=(t=flattenTree([],this.ice.childNodes),flattenTree([],this.ice.toolNodes)),r=[].concat(_toConsumableArray(t),_toConsumableArray(i));r.sort(function(t,e){return t.state.zIndex-e.state.zIndex});for(var o=0;o<r.length;o++){var s=r[o],a=(l=s.state).interactive,l=l.display;s.containsPoint(e,n)&&a&&l&&this.selectionCandidates.push(s)}return t=this.selectionCandidates.pop(),this.selectionCandidates=[],t}}]),DOMEventDispatcher),Ir={evtBuses:[],start:function start(){if(k&&k.addEventListener){function Bk(t){for(var n=Ir.evtBuses[t],i=[].concat(_toConsumableArray(Sr),_toConsumableArray(Or)),e=0;e<i.length;e++)!function Gk(t){var e=i[t];k.addEventListener(e[0],function(t){n.trigger(e[1],t)})}(e)}for(var t=0;t<Ir.evtBuses.length;t++)Bk(t)}},regitserEvtBus:function regitserEvtBus(t){Ir.evtBuses.includes(t)||Ir.evtBuses.push(t)},delEvtBus:function delEvtBus(t){Ir.evtBuses.includes(t)&&Ir.evtBuses.splice(Ir.evtBuses.indexOf(t),1)}},$r=(_inherits(EventBus,l),Ui=_createSuper(EventBus),_createClass(EventBus)),Mr=(_createClass(GeoLine,[{key:"contains",value:function contains(t,e){var n=Math.hypot(this.endPoint.x-this.startPoint.x,this.endPoint.y-this.startPoint.y),i=Math.hypot(t-this.startPoint.x,e-this.startPoint.y);return n-3<=i+(t=Math.hypot(t-this.endPoint.x,e-this.endPoint.y))&&i+t<=n+3}}]),GeoLine),$=(_createClass(GeoPoint,[{key:"equals",value:function equals(t){return this.x==t.x&&this.y==t.y}},{key:"clone",value:function clone(){return new GeoPoint(this.x,this.y)}}],[{key:"load",value:function load(t){return new GeoPoint(Number(t.x),Number(t.y))}},{key:"cloneArray",value:function cloneArray(t){for(var e=[],n=0;n<t.length;n++)e.push(t[n].clone());return e}}]),GeoPoint),f=(_inherits(ICEDotPath,h),Vi=_createSuper(ICEDotPath),_createClass(ICEDotPath,[{key:"calcComponentParams",value:function calcComponentParams(){if(!this.dirty)return{width:this.state.width,height:this.state.height};this.calcDots();var t=this.calc4VertexPoints(),e=Math.abs(t[1][0]-t[0][0]),t=Math.abs(t[2][1]-t[0][1]);return this.state.width=e,this.state.height=t,{width:this.state.width,height:this.state.height}}},{key:"calcLocalOrigin",value:function calcLocalOrigin(){for(var t=_get(_getPrototypeOf(ICEDotPath.prototype),"calcLocalOrigin",this).call(this),e=0;e<this.state.dots.length;e++){var n=transformMat2d([],this.state.dots[e],[1,0,0,1,-t[0],-t[1]]);this.state.dots[e]=n}return t}},{key:"createPathObject",value:function createPathObject(){this.path2D=new Path2D,this.path2D.moveTo(this.state.dots[0][0],this.state.dots[0][1]);for(var t=1;t<this.state.dots.length;t++){var e=this.state.dots[t];this.path2D.lineTo(e[0],e[1])}return this.path2D}},{key:"calcDots",value:function calcDots(){return this.state.dots=[],this.state.dots}},{key:"calc4VertexPoints",value:function calc4VertexPoints(){for(var t=this.state.dots[0][0],e=this.state.dots[0][1],n=this.state.dots[0][0],i=this.state.dots[0][1],r=1;r<this.state.dots.length;r++){var o=this.state.dots[r];o[0]<t&&(t=o[0]),o[0]>n&&(n=o[0]),o[1]<e&&(e=o[1]),o[1]>i&&(i=o[1])}return[[t,e],[n,e],[t,i],[n,i]]}},{key:"getTransformedDots",value:function getTransformedDots(){for(var t=this.state.composedMatrix,e=this.state.dots,n=[],i=0;i<e.length;i++){var r=transformMat2d([],e[i],t);n.push(r)}return n}}]),ICEDotPath),d=(_inherits(ICEImage,t),Fi=_createSuper(ICEImage),_createClass(ICEImage,[{key:"doRender",value:function doRender(){var t,e;this.state.src&&(t=(e=this.ice.imageCache.setImage(this.state.src)).loaded,e=e.image,t&&this.ctx.drawImage(e,0-this.state.localOrigin[0],0-this.state.localOrigin[1],this.state.width,this.state.height)),_get(_getPrototypeOf(ICEImage.prototype),"doRender",this).call(this)}}]),ICEImage);function ICEImage(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck(this,ICEImage),Fi.call(this,_objectSpread2({width:100,height:100,src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALkAAAC2CAYAAACF+yyJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAtoSURBVHhe7Z3tj15FHYb9VxUVo7zFUBWC8YXoF9++GENMRAWRKAkxGj8pihpjFBVF1CBlKaUU+wK0pYVqt12fn+6xs7PXnDPzO3O2Z+a5r+T6ss995nm2vXf3vM68570vXNuTsmdVctm9KrnsXpVcdq9KLrtXJZfdq5LL7lXJZfeq5LJ7VXLZvSq57F6VXHavSi67VyWX3auSy+5VyWX3quSye1Vy2b0quexelVx2r0ouu1cll92rksvuVcll96rksntVctm9KrnsXpVcdq9KLrtXJZfdq5LL7lXJZfeq5LJ7VfIjcIy7j/M2sp4q+YKWQNvLOqrkC+nhodO7OJacp0q+gHO4/2UVvbYqeWXH+O2lG3sf29nd++Eb1/e/wtC40q9KXtGfX+Dy3v4PzpspKCt9quQVJSgXS1BO+lTJK0pQLvab/zz8F+CjL3FWlquSV/KBE7v79bwJ5VISlJPlquSV/AXsj1MuJUE5Wa5KXsmfvKWSr1WVvJJ2BiWGciljLm/2figny1XJK0pQLvbS4d15zEmfKnlFicfPXsdsKEE56VMlr+hdx7mwqV2P75/ji0dvboahvPSpkle2BjSu9KuSL+AcaDw5T5V8IT3QOHK+KvmCni/oOm0v66iSO/zz5Rv71cwr56Nn+ADzmUs3MB8bQq/LcVVyhzHvg0wsQbnYmCfPTZ+SlAdVyQv92mm4crPhzokHkgnKhaagrEyrkjtM8eAr6UfXCMoNpqCsHFcld5rC7g3PzVPOTPHZkR8imbbpkqeg7BKm+NXFw0Un4swH4CavgTuOaH6Wd/gYGbOt2GTJc8k5IJxrileuHjxzQoSv37uTHutWfh8x9zU4m0BTJd959+apu1z+tdmExgoN+euVvNN6oSnCe1aI4bUvneKDWWPI5PrhFw++F2VC6dG7HGistdpMyc/9u7zgA/bfSGMOxlBmyhT2qVOv29efSNykZYTj5xrz2Jn0KcdvOQs+QGOu0SZKbn+u5/LAyJ/ZGO/uQSnPvp3+waXxc4x57nL6L9Ncnh0Ze002UfIUlDVTUNYkKJdjDWjcHD938vBuD+XMFJQ1U1B2ba6+5HZWgaBsKPFwhdN7Oc6BxsuVoJxJUC6UuJi4V35Nrr7kBOVIYk6uRA80TonEnBxJUG5NquQbbZLNGMqVWgJtX2rMcNA7lTMoR9JRBOXWZHMlt4d+KUc+VTBNRIydzaFcqTnQdqXeVjBbAEE5ki5YUW5NNlfy+CLLmN876y+5QTmPYyc/Ke+RoJxJUC5lDGXWpHZX9iUo55WgnFeCciZBOfL5K4d/ZCm3JlXyfR+BBxso55WgnFeCciZBOZKg3Jpcfcl/nJiwnrKhqWt5x3byLwr98kK9BxQIynmNscn+KWemoGxo6uIVZdfk6ktupqCseW1sJ3gf2o6gnEeCch4vwPCUy4G2M/8OuykGZddmEyW3ZUjG+PSJ3f9etr+eUe6Y8H2I8PU5EpTzSISv0370FF8+tbv38c1fA/oBCgnfZ602UXJzSexGJXsPe7A4Jv4cXgnKeSTs6zXu+Rkj/hxrtZmSm15yt6Xc11+vc/80QTmPMXb7Qg60bS7xZ1izTZXcLLmn/Orm/zrc1vubLRzDK0G5Un9zsXxXxB7GDsewSUlLCLdtweZKPjh2f/m7Ublj/zhyiytBY5RKUK7UEuy7pjEGfwZXiENomxZstuQ1zIW2LfE1ezwpAeVLzIW23Ra3uuSDOdB2U9rzkDn8yfnwQQ73ahU5/SYv4Y3NJjQO6eGDI4vahqYmOBpjm5dM3KqSp66elnL3yPQQNaBxB2twttIdlq3YfcmXJHyfF96ZPpgdzvb84HzeD1s4/pJ8pvNJi7or+e8Lz5wQdrXPxqIFaGNy/zbEn9PM4W8ZVyvte7bxPhRNR+Hh7YL79Vuxq5J7ic+nx6ZmlcqBxoudA403+LuJ2yHGoPFadWtL/qnNb2kaY8wShlsFch2bIo6gMcYsvRBmD5zQOC26NSWvdbD1/oky2k1itF2uT8Py5SHfrVS+qYNw2qZVuyq5FSDkngVPmxGU80pQrpYhdqsyZVq1uwPPo5KgnFeCcnJaldwpQTmvBOXktCq5U4JyXgnKyWlVcqcE5bwSlJPTquROCcp5JSgnp1XJnRKU80pQTk6rkjslKOeVoJycViV3SlDOK0E5Oa1K7pSgnFeCcnJaldwpQTmvBOXktF2VPL6sP/Zww1wJynklKFfLkKm7Mluzq5KPUesGram7Be3mVtou119PTDGhG7TK3ZqSx3xy4VttHx1ZWpC05ztLoDHG1K22nehl6mkYPTTRtt0deP6hwuNvX3z1f7/l7bf9FLmTjMaf08zBVoiewiZLsvFqPP4WriLdi92VPPQoJ7zMeZB5WAJdDzIfrV2XPLbWlBR3aUqKptyqkseWcqagHB40udAybnXJB3Og7ab8ROY0cXaASNtPmXM4oGni9Js8C9q2xFOa8POW2mzJbdchhZ3yo20GS8/A0BilEpQrtQT7rmmMQVsIbAzapgWbK/lLmoT/gJ5J+L/62sGzKY/B8o5jhNu2YFMl95K7LeVaXE7lG6/nlZa2zSX+DGu2mZIvyTDbFV0hjD+HV4JyHgn7+lFeJ1izTZQ8Z4lDuzqpJQ5vEr6ec9U05guv7u7d//Lu3lsTPyfh+6zVJkqegrLmyDHp/6HtCMp5JCjn8SgWq039oFB2ba6+5LWXHS9ZjrvlZceP7XDOTEHZ0NRZKcquydWXnKAcSVDOfATOMFDOK0E5rwTlTIJyJEG5NamS70tQzitBOa8E5UyCcuRzlw//Nqfcmmyu5Ceu5l8Ctxv/YyhnEpTzOHZCj/IeCcqZBOVSxlBmTTZX8pLlPmjxVcqZMbYYLuVKzYG2K5XmTaecSVCOLHmftajdlY12qiyGcqWWQNuXGmM7Fjk5g3IkHXpSbk2q5AW5Ej3QOCUSc3IkQbk1ufqS33Hc9w9LfDuxjg9BuVznQOPlSlDOJCgXStg5esquydWX3ExBWTMFZU2CcjnWgMbN8fMn83e7UlDWTEHZtdlEyUtXRiPGpqCIsXs+KDdlKc+PXG6n8XOMsVN+lDPnYldBady12UTJTVvX3kvqAGwwhjJTphjem7CvP3EufYIxHD/XmO+MzP9iN6bNgcZco82U3Bx7wibF1AMUZshfRn7zpUxxJXhvYnjtK6fSj8kNmVzvjI5hKBP6sLPoNNZabarkg7l4dztKTHEyumhFhK8f20kX/VZ+HzH23Cptv2abLPlgCsouYQqbzzAnG2duHzn2+MiLB7NLaWt4Ekfxg7aUTZf8VpoitQ9MUM5M4VkqXarkLlM8ODITFUG5wRSUleOq5IWmJvaxAz7KDxKUC01BWZlWJXcYcxtkYgnKxcY8ea7egxzbokruMLynml6PtbnKiWcyZ84KodfluCr5gp5P73EcgraXdVTJF9IDjSPnq5Iv4BxoPDlPlbyyNaBxpV+VvKK2pCJxaZeL+zg8g2q8uRmG8tKnSl5RImdJQoJy0qdKXlGCcrEX4foS5aRPlbySdHMV5VLGlMxKIMdVySv504LpL0iCcrJclbyStEoD5VISlJPlquSVpIVtKZeSoJwsVyWvKEG5WHrWcpuXJKytSl5RgnKxBOWkT5W8ok8nVk+zNe8pb6agrPSpkld2DLu11hYB+NHE8uc0rvSrki/gHO5r8Gn4tauSL6SHh06r4Euoki9oCbS9rKNKfgSOcY9OFS6uSi67VyWX3auSy+5VyWX3quSye1Vy2b0quexelVx2r0ouu1cll92rksvuVcll96rksntVctm9KrnsXpVcdq9KLrtXJZfdq5LL7lXJZfeq5LJ7VXLZvSq57F6VXHavSi67VyWX3auSy+5VyWX3quSye1Vy2b0quezca3v/AeMnvtkH1pHJAAAAAElFTkSuQmCC"},t))}function ICEDotPath(t){return _classCallCheck(this,ICEDotPath),Vi.call(this,_objectSpread2({dots:[],closePath:!0},t))}function GeoPoint(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0;_classCallCheck(this,GeoPoint),this.x=t,this.y=e}function GeoLine(t,e){_classCallCheck(this,GeoLine),this.startPoint=t,this.endPoint=e}function EventBus(){return _classCallCheck(this,EventBus),Ui.call(this)}function DOMEventDispatcher(t){_classCallCheck(this,DOMEventDispatcher),_defineProperty$1(this,"selectionCandidates",[]),_defineProperty$1(this,"_stopped",!1),this.ice=t}function ICEControlPanelManager(t){_classCallCheck(this,ICEControlPanelManager),this.ice=t,this.transformControlPanel=new xr({left:500,top:100,width:100,height:100,style:{strokeStyle:"#8b0000",fillStyle:"rgba(255, 255, 49, 0.2)",lineWidth:1},transform:{rotate:45}}),this.ice.addTool(this.transformControlPanel),this.transformControlPanel.disable(),this.lineControlPanel=new rr({left:700,top:50,width:100,height:100,style:{strokeStyle:"rgba(255, 255, 49, 0)",fillStyle:"rgba(255, 255, 49, 0)",lineWidth:1}}),this.ice.addTool(this.lineControlPanel),this.lineControlPanel.disable()}function TransformControlPanel(t){return _classCallCheck(this,TransformControlPanel),_defineProperty$1(_assertThisInitialized(t=qi.call(this,_objectSpread2(_objectSpread2({},t),{},{zIndex:10000001,linkable:!1,showMinBoundingBox:!1,showMaxBoundingBox:!1}))),"rotateControlSize",8),_defineProperty$1(_assertThisInitialized(t),"rotateControlffsetY",60),_defineProperty$1(_assertThisInitialized(t),"resizeControlInstanceCache",[]),_defineProperty$1(_assertThisInitialized(t),"resizeControlSize",16),t.initControls(),t}function RotateControl(t){return _classCallCheck(this,RotateControl),Ji.call(this,_objectSpread2(_objectSpread2({},t),{},{linkable:!1}))}function ResizeControl(t){return _classCallCheck(this,ResizeControl),Xi.call(this,_objectSpread2(_objectSpread2({position:"l",direction:"x",quadrant:1},t),{},{linkable:!1}))}function LineControlPanel(t){return _classCallCheck(this,LineControlPanel),_defineProperty$1(_assertThisInitialized(t=Wi.call(this,_objectSpread2(_objectSpread2({},t),{},{zIndex:10001e3,linkable:!1,showMinBoundingBox:!1,showMaxBoundingBox:!1}))),"controlSize",16),t.initControls(),t}function ICELinkHook(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck(this,ICELinkHook),Gi.call(this,_objectSpread2({linkable:!1},t))}function ICECircle(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck(this,ICECircle),(t=_objectSpread2({radius:10},t)).radiusX=t.radius,t.radiusY=t.radius,Ki.call(this,t)}function ICEEllipse(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck(this,ICEEllipse),(t=_objectSpread2({radiusX:20,radiusY:10,rotation:0,startAngle:0,endAngle:2*Math.PI,counterclockwise:!0},t)).width=2*t.radiusX,t.height=2*t.radiusY,Qi.call(this,t)}function ICEControlPanel(t){return _classCallCheck(this,ICEControlPanel),_defineProperty$1(_assertThisInitialized(t=Zi.call(this,_objectSpread2(_objectSpread2({},t),{},{linkable:!1}))),"isControlPanel",!0),t}function ICEGroup(t){return _classCallCheck(this,ICEGroup),_defineProperty$1(_assertThisInitialized(t=Yi.call(this,t)),"parentNode",null),_defineProperty$1(_assertThisInitialized(t),"childNodes",[]),t}function ICERect(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck(this,ICERect),tr.call(this,_objectSpread2({width:10,height:10},t))}function ICEPath(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck(this,ICEPath),_defineProperty$1(_assertThisInitialized(t=er.call(this,_objectSpread2({closePath:!0},t))),"path2D",new Path2D),t}function ICEComponent(){var t,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck(this,ICEComponent),_defineProperty$1(_assertThisInitialized(t=nr.call(this)),"__dirty",!0),_defineProperty$1(_assertThisInitialized(t),"props",{id:"ICE_"+function uuid(){if(k.crypto)return k.crypto.randomUUID();var n=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=(n+16*Math.random())%16|0;return n=Math.floor(n/16),("x"==t?e:3&e|8).toString(16)})}(),left:0,top:0,width:0,height:0,style:{fillStyle:"red",strokeStyle:"blue",lineWidth:1},fill:!0,stroke:!0,animations:{},transform:{translate:[0,0],scale:[1,1],skew:[0,0],rotate:0},linearMatrix:[],composedMatrix:[],origin:"localCenter",localOrigin:[0,0],absoluteOrigin:[0,0],zIndex:ICEComponent.instanceCounter++,display:!0,draggable:!0,transformable:!0,interactive:!0,linkable:!0,showMinBoundingBox:!1,showMaxBoundingBox:!1}),_defineProperty$1(_assertThisInitialized(t),"state",{}),t.props=Pn(t.props,e),t.state=_c(t.props),t.root=k,t.initEvents(),t}_createClass(function ICEBezier(){_classCallCheck(this,ICEBezier)});_inherits(ICELinkSlot,b),Tr=_createSuper(ICELinkSlot),_createClass(ICELinkSlot,[{key:"keyboardEvtHandler",value:function keyboardEvtHandler(t){}},{key:"destory",value:function destory(){this.hostComponent=null,_get(_getPrototypeOf(ICELinkSlot.prototype),"destory",this).call(this)}},{key:"updatePosition",value:function updatePosition(){var t=this._hostComponent.getMinBoundingBox(),e=0,n=0;switch(this.state.position){case"T":e=t.tc[0]-this.state.radius,n=t.tc[1]-this.state.radius;break;case"R":e=t.rc[0]-this.state.radius,n=t.rc[1]-this.state.radius;break;case"B":e=t.bc[0]-this.state.radius,n=t.bc[1]-this.state.radius;break;case"L":e=t.lc[0]-this.state.radius,n=t.lc[1]-this.state.radius}this.setState({left:e,top:n})}},{key:"hostComponent",get:function get(){return this._hostComponent},set:function set(t){var e=this;this._hostComponent&&this._hostComponent.off(D,this.updatePosition,this),this._hostComponent=t,this._hostComponent&&this._hostComponent.on(D,this.updatePosition,this),this._hostComponent&&this._hostComponent.once(V,function(){e._hostComponent=null,e.setState({display:!1})},this),this._hostComponent&&this.setState({display:!0})}}]);var Ar,Br,Lr,Tr,zr,Rr=ICELinkSlot,Nr=(_inherits(ICEPolyLine,f),Lr=_createSuper(ICEPolyLine),_createClass(ICEPolyLine,[{key:"initEvents",value:function initEvents(){_get(_getPrototypeOf(ICEPolyLine.prototype),"initEvents",this).call(this),this.once(F,this.afterAddHandler,this)}},{key:"afterAddHandler",value:function afterAddHandler(t){this.evtBus.once(U,this.syncConnections,this)}},{key:"syncConnections",value:function syncConnections(){this.removeLink("start"),this.removeLink("end");var t=this.state.links;t&&(t.start&&t.start.id&&t.start.position&&this.createLink(t.start.id,t.start.position),t.end&&t.end.id&&t.end.position&&this.createLink(t.end.id,t.end.position)),this.dirty=!0,this.ice.dirty=!0}},{key:"createLink",value:function createLink(t,e){(t=this.ice.findComponent(t))&&t.on(K,this.followComponent,this),t&&t.on(c,this.followComponent,this),t&&t.on(G,this.followComponent,this),t&&t.once(D,this.followComponent,this),t&&this.followComponent(),this.state.draggable=!1}},{key:"removeLink",value:function removeLink(t,e,n){var i;this.state.links&&this.state.links[t]&&(i=this.state.links[t].id,t=this.state.links[t].position,n=n||t,i===(e=e||i)&&t===n&&((e=this.ice.findComponent(i))&&e.off(K,this.followComponent,this),e&&e.off(c,this.followComponent,this),e&&e.off(G,this.followComponent,this)),t=!0,this.state.links.start&&this.state.links.start.id&&(t=!1),this.state.links.end&&this.state.links.end.id&&(t=!1),this.state.draggable=t)}},{key:"getLinkFromId",value:function getLinkFromId(){return this.state.links.start.id}},{key:"getLinkToId",value:function getLinkToId(){return this.state.links.end.id}},{key:"followComponent",value:function followComponent(t){for(var e in this.state.links)if(this.state.links[e]&&this.state.links[e].id&&this.state.links[e].position){var n=this.state.links[e].id,i=this.state.links[e].position;if(n=this.ice.findComponent(n)){var r=n.getMinBoundingBox(),o=[0,0];switch(i){case"T":o=r.tc;break;case"R":o=r.rc;break;case"B":o=r.bc;break;case"L":o=r.lc}switch(e){case"start":this.setState({startPoint:_toConsumableArray(o)});break;case"end":this.setState({endPoint:_toConsumableArray(o)})}}}}},{key:"calcLocalOrigin",value:function calcLocalOrigin(){return this.state.localOrigin=[0,0]}},{key:"calcDots",value:function calcDots(){var t=this.state.left,e=this.state.top;this.state.dots=[];for(var n=0;n<this.state.points.length;n++){var i=(r=this.state.points[n])[0]-t,r=r[1]-e;this.state.dots.push([i,r])}return this.calcArrowPoints(),this.state.dots}},{key:"calcArrowPoints",value:function calcArrowPoints(){var t,e,n;"start"!==this.state.arrow&&"both"!==this.state.arrow||(n=_toConsumableArray(this.state.dots[0]),e=[_toConsumableArray(this.state.dots[0]),_toConsumableArray(this.state.dots[1])],e=this.doCalcArrowPoints(e),(t=this.state.dots).unshift.apply(t,_toConsumableArray(e)),this.state.dots.unshift(_toConsumableArray(n))),"end"!==this.state.arrow&&"both"!==this.state.arrow||(t=this.state.dots.length,e=_toConsumableArray(this.state.dots[t-1]),n=[_toConsumableArray(this.state.dots[t-1]),_toConsumableArray(this.state.dots[t-2])],n=this.doCalcArrowPoints(n),(t=this.state.dots).push.apply(t,_toConsumableArray(n)),this.state.dots.push(_toConsumableArray(e)))}},{key:"doCalcArrowPoints",value:function doCalcArrowPoints(t){var e=t[0],n=((t=t[1])[0]=t[0]-e[0],t[1]=t[1]-e[1],t[0]/Math.hypot.apply(Math,_toConsumableArray(t))),i=(t=t[1]/Math.hypot.apply(Math,_toConsumableArray(t)),Math.cos(this.state.arrowAngel)),r=Math.sin(this.state.arrowAngel),o=this.state.arrowLength*(n*i-t*r),s=this.state.arrowLength*(t*i+n*r),a=this.state.arrowLength*(n*i+t*r);return t=this.state.arrowLength*(t*i-n*r),[[o+=e[0],s+=e[1]],[a+=e[0],t+=e[1]]]}},{key:"addDot",value:function addDot(t,e){this.state.points.splice(e,0,t),this.state.dots.splice(e,0,[t[0],t[1]])}},{key:"rmDot",value:function rmDot(t){return!(this.state.points.length<3||(this.state.points.splice(t,1),this.state.dots.splice(t,1),0))}},{key:"calcComponentParams",value:function calcComponentParams(){if(!this.dirty)return{width:this.state.width,height:this.state.height};this.calcDots();var t=this.calc4VertexPoints(),e=Math.abs(t[1][0]-t[0][0]),n=this.state.style.lineWidth;return this.isDotsOnSameLine()||(n=Math.abs(t[2][1]-t[0][1])),this.state.width=e,this.state.height=n,{width:this.state.width,height:this.state.height}}},{key:"isDotsOnSameLine",value:function isDotsOnSameLine(){for(var t,e=this.state.points.length,n=kr(this.state.points[0][0],2),i=kr(this.state.points[0][1],2),r=0,o=[kr(this.state.points[e-1][0],2)-n,kr(this.state.points[e-1][1],2)-i],s=0;s<e;s++){var a=[(a=this.state.points[s])[0]-n,a[1]-i];0===(a=o[0]*a[1]-o[1]*a[0],(t=[])[0]=t[1]=0,t[2]=a,t[2])&&r++}return r===e}},{key:"calc4VertexPoints",value:function calc4VertexPoints(){return this.isDotsOnSameLine()?this.splitEndpointsTo4Points():_get(_getPrototypeOf(ICEPolyLine.prototype),"calc4VertexPoints",this).call(this)}},{key:"splitEndpointsTo4Points",value:function splitEndpointsTo4Points(){var t=this.state.points.length,e=this.state.points[t-1][0]-this.state.points[0][0],n=(t=this.state.points[t-1][1]-this.state.points[0][1],this.getRotateAngle()),i=this.state.height,r=Math.cos(n*Math.PI/180)*i/2,n=Math.sin(n*Math.PI/180)*i/2;return[[0+(r=kr(r,3)),0+(n=kr(n,3))],[0-r,0-n],[e+r,t+n],[e-r,t-n]]}},{key:"getMinBoundingBox",value:function getMinBoundingBox(){var t=this.state.localOrigin[0],e=this.state.localOrigin[1],n=this.calc4VertexPoints();return(t=new Hi([n[0][0]-t,n[0][1]-e,n[1][0]-t,n[1][1]-e,n[2][0]-t,n[2][1]-e,n[3][0]-t,n[3][1]-e,0,0])).transform(this.state.composedMatrix)}},{key:"setState",value:function setState(t){if(v2(t.width)||delete t.width,v2(t.height)||delete t.height,v2(t.transform)||delete t.transform,!v2(t.left))for(var e=t.left-this.state.points[0][0],n=0;n<this.state.points.length;n++)this.state.points[n][0]+=e;if(!v2(t.top))for(var i=t.top-this.state.points[0][1],r=0;r<this.state.points.length;r++)this.state.points[r][1]+=i;var o;v2(t.startPoint)||(this.state.points[0]=_toConsumableArray(t.startPoint),this.state.left=this.state.points[0][0],this.state.top=this.state.points[0][1]),v2(t.endPoint)||(o=this.state.points.length,this.state.points[o-1]=_toConsumableArray(t.endPoint)),v2(t.links)||(Pn(this.state.links,t.links),this.syncConnections()),_get(_getPrototypeOf(ICEPolyLine.prototype),"setState",this).call(this,t)}},{key:"getRotateAngle",value:function getRotateAngle(){var t,e;return this.isDotsOnSameLine()?(e=this.state.points.length,t=this.state.points[e-1][0]-this.state.points[0][0],e=this.state.points[e-1][1]-this.state.points[0][1],Di.calcRotateAngle(t,e,0,0)+90):_get(_getPrototypeOf(ICEPolyLine.prototype),"getRotateAngle",this).call(this)}},{key:"containsPoint",value:function containsPoint(t,e){for(var n=this.getLines(),i=0;i<n.length;i++){var r=(a=n[i]).o[0],o=a.o[1],s=a.d[0],a=a.d[1],l=Math.hypot(s-r,a-o);if(l-3<=(r=Math.hypot(r-t,o-e))+(o=Math.hypot(s-t,a-e))&&r+o<=l+3)return!0}return!1}},{key:"getLines",value:function getLines(){var t=[],e=this.getTransformedDots();if(!e||e.length<2)return t;for(var n=0;n<e.length-1;n++){var i={o:[e[n][0],e[n][1]],d:[e[n+1][0],e[n+1][1]]};t.push(i)}return t}},{key:"destory",value:function destory(){this.removeLink("start"),this.removeLink("end"),_get(_getPrototypeOf(ICEPolyLine.prototype),"destory",this).call(this)}}],[{key:"arrangeParam",value:function arrangeParam(t){var e=Pn({},{lineType:"solid",lineWidth:1,arrow:"none",arrowLength:15,arrowAngel:30*En,points:[],showMinBoundingBox:!1,showMaxBoundingBox:!1,links:{},style:{lineJoin:"round"}},t,{linkable:!1,closePath:!1,fill:!1}),n=e.points.length;return n<2&&(0===n?(e.points.push([0,0]),e.points.push([10,10])):1===n&&e.points.push([10,10])),(e=_objectSpread2(_objectSpread2({},e),{left:t.points[0][0],top:t.points[0][1],transform:{translate:[0,0],scale:[1,1],skew:[0,0],rotate:0}})).style.lineWidth<1&&(e.style.lineWidth=1),e}}]),ICEPolyLine),g=(_inherits(ICEVisioLink,Nr),Br=_createSuper(ICEVisioLink),_createClass(ICEVisioLink,[{key:"calcDots",value:function calcDots(){var t=this.interpolate(),e=this.state,n=e.left,i=e.top,r=t[0][2];this.state.points=[],this.state.dots=[];for(var o=0;o<r.length;o++){var s=r[o];this.state.points.push([s.x,s.y]),this.state.dots.push([s.x-n,s.y-i])}return this.calcArrowPoints(),this.state.dots}},{key:"interpolate",value:function interpolate(){var t=this.state.points.length,e=this.state.points[0][0],n=this.state.points[0][1],i=this.state.points[t-1][0],r=(t=this.state.points[t-1][1],new $(e,n)),o=new $(i,t),s=[],a=null,l=null,c=[],h=new Hi,u=new Hi;if(p=this.ice&&this.state.links&&this.state.links.start&&this.state.links.start.id?this.ice.findComponent(this.state.links.start.id):p){h=p.getMinBoundingBox(),s[0]=new $(r.x,h.tl[1]-this.state.escapeDistance),s[1]=new $(h.tr[0]+this.state.escapeDistance,r.y),s[2]=new $(r.x,h.br[1]+this.state.escapeDistance),s[3]=new $(h.tl[0]-this.state.escapeDistance,r.y);for(var a=s[0],d=1;d<s.length;d++)this.distance(r,s[d])<this.distance(r,a)&&(a=s[d])}if(y=this.ice&&this.state.links&&this.state.links.end&&this.state.links.end.id?this.ice.findComponent(this.state.links.end.id):y){u=y.getMinBoundingBox(),s[0]=new $(o.x,u.tl[1]-this.state.escapeDistance),s[1]=new $(u.tr[0]+this.state.escapeDistance,o.y),s[2]=new $(o.x,u.br[1]+this.state.escapeDistance),s[3]=new $(u.tl[0]-this.state.escapeDistance,o.y);for(var l=s[0],f=1;f<s.length;f++)this.distance(o,s[f])<this.distance(o,l)&&(l=s[f])}e=0,n=[r],a&&(n.push(a),e=1),l&&n.push(l),n.push(o),i=$.cloneArray(n),c.push(["s0","s0",i]),t=$.cloneArray(n),(p=$.cloneArray(t)).splice(e+1,0,new $(p[e].x,p[e+1].y)),c.push(["s1","s1_1",p]),(y=$.cloneArray(t)).splice(e+1,0,new $(y[e+1].x,y[e].y)),c.push(["s1","s1_2",y]);var i=$.cloneArray(t),n=new $((i[e].x+i[e+1].x)/2,i[e].y),p=new $((i[e].x+i[e+1].x)/2,i[e+1].y),y=(i.splice(e+1,0,n,p),c.push(["s2","s2_1",i]),$.cloneArray(t));n=new $(y[e].x,(y[e].y+y[e+1].y)/2),p=new $(y[e+1].x,(y[e].y+y[e+1].y)/2),n=[(y.splice(e+1,0,n,p),c.push(["s2","s2_2",y]),(i=$.cloneArray(t))[e].x+20),i[e+1].x+20],h&&n.push(h.br[0]+20),u&&n.push(u.br[0]+20),p=this.max(n),y=new $(p,i[e].y),n=new $(p,i[e+1].y),y=[(i.splice(e+1,0,y,n),c.push(["s2","s2_3",i]),(p=$.cloneArray(t))[e].y-20),p[e+1].y-20],h&&y.push(h.tl[1]-20),u&&y.push(u.tl[1]-20),n=this.min(y),i=new $(p[e].x,n),y=new $(p[e+1].x,n),i=[(p.splice(e+1,0,i,y),c.push(["s2","s2_4",p]),(n=$.cloneArray(t))[e].x-20),n[e+1].x-20],h&&i.push(h.tl[0]-20),u&&i.push(u.tl[0]-20),y=this.min(i),p=new $(y,n[e].y),i=new $(y,n[e+1].y),p=[(n.splice(e+1,0,p,i),c.push(["s2","s2_5",n]),(y=$.cloneArray(t))[e].y+20),y[e+1].y+20],h&&p.push(h.tl[1]+h.height+20),u&&p.push(u.tl[1]+u.height+20),i=this.max(p),n=new $(y[e].x,i),t=new $(y[e+1].x,i),y.splice(e+1,0,n,t),c.push(["s2","s2_6",y]);for(var g=[],v=0;v<c.length;v++){var m=c[v][2];this.orthogonalPath(m)&&g.push(c[v])}if(c=g,!r.equals(o)){for(var b=[],C=0;C<c.length;C++){var _=c[C][2];this.forwardPath(_)&&b.push(c[C])}(c=b).length}for(var k=[],w=0;w<c.length;w++){var P=!1,x=c[w][2].slice();(u||h)&&(x=x.slice(1,x.length-1)),h&&(P=P||this.polylineIntersectsRectangle(x,h)),(P=u?P||this.polylineIntersectsRectangle(x,u):P)||k.push(c[w])}(c=0!=k.length?k:c).length;for(var E=c[0][2].length,S=[],O=0;O<c.length;O++)c[O][2].length==E&&S.push(c[O]);for(var c=S,j=0,I=0;I<c.length;I++)this.scorePath(c[j][2])<this.scorePath(c[I][2])&&(j=I);return[c[j]]}},{key:"orthogonalPath",value:function orthogonalPath(t){if(t.length<=1)return!0;for(var e=0;e<t.length-1;e++)if(t[e].x!=t[e+1].x&&t[e].y!=t[e+1].y)return!1;return!0}},{key:"lineIntersectsLine",value:function lineIntersectsLine(t,e){if(t.startPoint.x==t.endPoint.x&&e.startPoint.x==e.endPoint.x)return t.startPoint.x==e.startPoint.x&&(t.contains(e.startPoint.x,e.startPoint.y)||t.contains(e.endPoint.x,e.endPoint.y));if(t.startPoint.x==t.endPoint.x||e.startPoint.x==e.endPoint.x)return t.startPoint.x==t.endPoint.x&&(r=t,t=e,e=r),r=(t.endPoint.y-t.startPoint.y)/(t.endPoint.x-t.startPoint.x),n=t.startPoint.y-r*t.startPoint.x,i=e.startPoint.x,t.contains(i,r=r*i+n)&&e.contains(i,r);var n=(t.endPoint.y-t.startPoint.y)/(t.endPoint.x-t.startPoint.x),i=t.startPoint.y-n*t.startPoint.x,r=(e.endPoint.y-e.startPoint.y)/(e.endPoint.x-e.startPoint.x),o=e.startPoint.y-r*e.startPoint.x;return n==r?i==o&&(t.contains(e.startPoint.x,e.startPoint.y)||t.contains(e.endPoint.x,e.endPoint.y)):(r=n*(o=(o-i)/(n-r))+i,t.contains(o,r)&&e.contains(o,r))}},{key:"polylineIntersectsRectangle",value:function polylineIntersectsRectangle(t,e){var n=2<arguments.length&&void 0!==arguments[2]&&arguments[2],i=[];i.push(new Mr(new $(e.x1,e.y1),new $(e.x2,e.y1))),i.push(new Mr(new $(e.x2,e.y1),new $(e.x2,e.y2))),i.push(new Mr(new $(e.x2,e.y2),new $(e.x1,e.y2))),i.push(new Mr(new $(e.x1,e.y2),new $(e.x1,e.y1)));for(var r=0;r<t.length-1;r++)for(var o=new Mr(t[r],t[r+1]),s=0;s<i.length;s++)if(this.lineIntersectsLine(o,i[s]))return!0;if(n)for(var a=new Mr(t[t.length-1],t[0]),l=0;l<i.length;l++)if(this.lineIntersectsLine(a,i[l]))return!0;return!1}},{key:"scorePath",value:function scorePath(t){if(t.length<=2)return-1;for(var e=0,n=1;n<t.length-1;n++)if(t[n-1].x==t[n].x&&t[n].x==t[n+1].x){if(this.signum(t[n+1].y-t[n].y)!=this.signum(t[n].y-t[n-1].y))return-1;e++}else if(t[n-1].y==t[n].y&&t[n].y==t[n+1].y){if(this.signum(t[n+1].x-t[n].x)!=this.signum(t[n].x-t[n-1].x))return-1;e++}else e--;return e}},{key:"signum",value:function signum(t){return 0<t?1:t<0?-1:0}},{key:"forwardPath",value:function forwardPath(t){if(t.length<=2)return!0;for(var e=0;e<t.length-2;e++)if(t[e].x==t[e+1].x&&t[e+1].x==t[e+2].x){if(0!=this.signum(t[e+1].y-t[e].y)&&this.signum(t[e+1].y-t[e].y)==-1*this.signum(t[e+2].y-t[e+1].y))return!1}else if(t[e].y==t[e+1].y&&t[e+1].y==t[e+2].y&&0!=this.signum(t[e+1].x-t[e].x)&&this.signum(t[e+1].x-t[e].x)==-1*this.signum(t[e+2].x-t[e+1].x))return!1;return!0}},{key:"distance",value:function distance(t,e){return Math.hypot(e.x-t.x,e.y-t.y)}},{key:"max",value:function max(t){if(0==t.lenght)return NaN;for(var e=t[0],n=0;n<t.length;n++)e<t[n]&&(e=t[n]);return e}},{key:"min",value:function min(t){if(0==t.lenght)return NaN;for(var e=t[0],n=0;n<t.length;n++)e>t[n]&&(e=t[n]);return e}},{key:"addDot",value:function addDot(t,e){throw new Error("Can NOT add dot to ICEVisioLink mannually.")}},{key:"rmDot",value:function rmDot(t){throw new Error("Can NOT remove dot from ICEVisioLink mannually.")}}],[{key:"arrangeParam",value:function arrangeParam(t){return v2(t.startPoint)&&(t.startPoint=[0,0]),v2(t.endPoint)&&(t.endPoint=[10,10]),t.points=[_toConsumableArray(t.startPoint),_toConsumableArray(t.endPoint)],_objectSpread2({escapeDistance:30},t)}}]),ICEVisioLink),i=(_inherits(ICEIsogon,f),Ar=_createSuper(ICEIsogon),_createClass(ICEIsogon,[{key:"calcDots",value:function calcDots(){this.state.dots=[];for(var t=2*Math.PI/this.state.edges,e=this.state.radius,n=0;n<this.state.edges;n++){var i=t*n-toRadian(this.state.startAngle),r=Math.floor(e*Math.cos(i)+e),i=Math.floor(e*Math.sin(i)+e);this.state.dots.push([r,i])}return this.state.dots}},{key:"calcComponentParams",value:function calcComponentParams(){return this.dirty&&(this.calcDots(),this.state.width=2*this.state.radius,this.state.height=2*this.state.radius),{width:this.state.width,height:this.state.height}}},{key:"setState",value:function setState(t){v2(t.radius)?v2(t.width)?v2(t.height)||(t.radius=t.height/2):t.radius=t.width/2:(t.width=2*t.radius,t.height=2*t.radius),_get(_getPrototypeOf(ICEIsogon.prototype),"setState",this).call(this,t)}}]),ICEIsogon);function ICEIsogon(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck(this,ICEIsogon),(t=_objectSpread2({radius:10,edges:3,startAngle:90},t)).edges=Math.floor(3<=t.edges?t.edges:3),t.width=2*t.radius,t.height=2*t.radius,Ar.call(this,t)}function ICEVisioLink(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck(this,ICEVisioLink),t=ICEVisioLink.arrangeParam(t),Br.call(this,t)}function ICEPolyLine(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck(this,ICEPolyLine),t=ICEPolyLine.arrangeParam(t),_defineProperty$1(_assertThisInitialized(t=Lr.call(this,t)),"isLine",!0),t}function ICELinkSlot(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck(this,ICELinkSlot),Tr.call(this,_objectSpread2({linkable:!1,draggable:!1,position:"T"},t))}function ICERose(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck(this,ICERose),(t=_objectSpread2({radius:50,leafNum:2,pointNumber:100},t)).leafNum=Math.floor(2<=t.leafNum?t.leafNum:2),t.width=2*t.radius,t.height=2*t.radius,zr.call(this,t)}_inherits(ICERose,f),zr=_createSuper(ICERose),_createClass(ICERose,[{key:"calcDots",value:function calcDots(){var t=this.state.radius,e=this.state.leafNum;this.state.dots=[];for(var n,i,r=Math.PI/this.state.pointNumber,o=0;n=t+t*Math.sin(e*o)*Math.cos(o),i=t+t*Math.sin(e*o)*Math.sin(o),this.state.dots.push([n,i]),!((o+=r)>=2*Math.PI););return this.state.dots}},{key:"calcComponentParams",value:function calcComponentParams(){return this.dirty&&(this.calcDots(),this.state.width=2*this.state.radius,this.state.height=2*this.state.radius),{width:this.state.width,height:this.state.height}}},{key:"setState",value:function setState(t){v2(t.radius)?v2(t.width)?v2(t.height)||(t.radius=t.height/2,t.width=t.height):(t.radius=t.width/2,t.height=t.width):(t.width=2*t.radius,t.height=2*t.radius),_get(_getPrototypeOf(ICERose.prototype),"setState",this).call(this,t)}}]);_inherits(ICEStar,f),Fr=_createSuper(ICEStar),_createClass(ICEStar,[{key:"calcDots",value:function calcDots(){this.state.dots=[];for(var t,e,n=toRadian(this.state.startAngle),i=Math.PI/this.state.spikes,r=this.state.outerRadius,o=this.state.innerRadius,s=0;s<this.state.spikes;s++)t=Math.cos(n)*r+r,e=Math.sin(n)*r+r,this.state.dots.push([t,e]),n+=i,t=Math.cos(n)*o+r,e=Math.sin(n)*o+r,this.state.dots.push([t,e]),n+=i;return this.state.dots}},{key:"calcComponentParams",value:function calcComponentParams(){return this.dirty&&(this.calcDots(),this.state.width=2*this.state.outerRadius,this.state.height=2*this.state.outerRadius),{width:this.state.width,height:this.state.height}}},{key:"setState",value:function setState(t){v2(t.outerRadius)?v2(t.width)?v2(t.height)||(t.outerRadius=t.height/2):t.outerRadius=t.width/2:(t.width=2*t.outerRadius,t.height=2*t.outerRadius),_get(_getPrototypeOf(ICEStar.prototype),"setState",this).call(this,t)}}]);var Dr,Hr,Fr,n=ICEStar,Vr="__ICE_UTILS_TEXT_MEASURE_DIV__",Ur=(_inherits(ICEText,t),Hr=_createSuper(ICEText),_createClass(ICEText,[{key:"calcComponentParams",value:function calcComponentParams(){return this.dirty?this.measureText():{width:this.state.width,height:this.state.height}}},{key:"measureText",value:function measureText(t){var e;try{if(!(e=this.root.document.getElementById(Vr))){(e=this.root.document.createElement("div")).setAttribute("id",Vr);var n,i={visibility:"hidden",position:"absolute",top:"0",left:"0",padding:"0",margin:"0",border:"none",fontFamily:this.state.style.fontFamily,fontWeight:this.state.style.fontWeight,fontSize:this.state.style.fontSize+"px"};for(n in i)e.style[n]=i[n];e.contenteditable=!1,this.root.document.body.appendChild(e)}e.innerHTML=this.state.text;var r=this.state.style,o=r.paddingTop,s=r.paddingBottom,a=r.paddingLeft,l=r.paddingRight,c={width:e.offsetWidth+a+l,height:e.offsetHeight+o+s};return this.props.width=c.width,this.props.height=c.height,this.state.width=c.width,this.state.height=c.height,{width:this.state.width,height:this.state.height}}catch(t){}}},{key:"doRender",value:function doRender(){this.dirty&&this.measureText();var t=this.state.style,e=(t.paddingTop,t.paddingBottom),n=t.paddingLeft;t.paddingRight,this.state.stroke&&this.ctx.strokeText(this.state.text,0-this.state.localOrigin[0]+n,0-this.state.localOrigin[1]+this.state.height-e,this.state.width),this.state.fill&&this.ctx.fillText(this.state.text,0-this.state.localOrigin[0]+n,0-this.state.localOrigin[1]+this.state.height-e,this.state.width),_get(_getPrototypeOf(ICEText.prototype),"doRender",this).call(this)}}],[{key:"arrangeParam",value:function arrangeParam(t){return(t=Pn({text:"",left:0,top:0,width:10,height:10,style:{fontWeight:"bold",fontSize:32,fontFamily:"Arial",lineWidth:1,textBaseline:"bottom",paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}},t)).style=_objectSpread2(_objectSpread2({},t.style),{},{font:"".concat(t.style.fontWeight," ").concat(t.style.fontSize,"px ").concat(t.style.fontFamily)}),t}}]),ICEText),qr={ICERect:a,ICECircle:b,ICEEllipse:r,ICEStar:n,ICEIsogon:i,ICEText:Ur,ICEImage:d,ICEGroup:Nt,ICEVisioLink:g,ICEPolyLine:Nr},x={evtBuses:[],stopped:!1,frameCallback:function frameCallback(){for(var t=0;t<x.evtBuses.length;t++){if(x.stopped)return;x.evtBuses[t].trigger(N)}x.stopped||k.requestFrame(x.frameCallback)},start:function start(){x.stopped=!1,k.requestFrame(x.frameCallback)},stop:function stop(){x.stopped=!0},pause:function pause(){},resume:function resume(){},regitserEvtBus:function regitserEvtBus(t){x.evtBuses.includes(t)||x.evtBuses.push(t)},delEvtBus:function delEvtBus(t){x.evtBuses.includes(t)&&x.evtBuses.splice(x.evtBuses.indexOf(t),1)}},Jr=(_createClass(ICELinkSlotManager,[{key:"start",value:function start(){return this.createLinkSlots(),this.ice.evtBus.on(J,this.hookMouseMoveHandler,this),this.ice.evtBus.on(X,this.hookMouseUpHandler,this),this.ice.evtBus.on("mouseup",this.globalMouseUpHandler,this),this}},{key:"stop",value:function stop(){return this.ice.evtBus.off(J,this.hookMouseMoveHandler,this),this.ice.evtBus.off(X,this.hookMouseUpHandler,this),this.ice.evtBus.off("mouseup",this.globalMouseUpHandler,this),this}},{key:"hookMouseMoveHandler",value:function hookMouseMoveHandler(t){for(var e=t.target,n=e.getMaxBoundingBox(),i=null,r=_toConsumableArray(this.ice.childNodes),o=0;o<r.length;o++){var s=r[o];if(s&&s.state.linkable&&s.getMaxBoundingBox().isIntersect(n)){i=s;break}}if(i)for(var a=0;a<this.ice._linkSlots.length;a++){var l=this.ice._linkSlots[a];l.hostComponent!==i&&(l.hostComponent=i),l.setState({display:!0,style:{fillStyle:"#3ce92c"}}),e.setState({style:{fillStyle:"#3ce92c"}}),l.getMaxBoundingBox().isIntersect(n)&&(l.setState({style:{fillStyle:"#fffb00"}}),e.setState({style:{fillStyle:"#fffb00"}}))}}},{key:"hookMouseUpHandler",value:function hookMouseUpHandler(t){for(var e=(t=t.target).state.position,n=t.parentNode.targetComponent,i=t.getMaxBoundingBox(),r=!1,o=0;o<this.ice._linkSlots.length;o++){var s,a=this.ice._linkSlots[o];a.getMaxBoundingBox().isIntersect(i)&&(r=!0,(s={})[e]={id:a.hostComponent.state.id,position:a.state.position},n&&n.setState({links:s})),a.setState({display:!1,style:{fillStyle:"#3ce92c"}})}r||((t={})[e]=null,n&&n.setState({links:t}))}},{key:"globalMouseUpHandler",value:function globalMouseUpHandler(t){for(var e=0;e<this.ice._linkSlots.length;e++)this.ice._linkSlots[e].setState({display:!1,style:{fillStyle:"#3ce92c"}})}},{key:"createLinkSlots",value:function createLinkSlots(){var t,e,n,i;this.ice._linkSlots&&this.ice._linkSlots.length||(t=new Rr({zIndex:10000010,display:!1,transformable:!1,draggable:!1,radius:this.slotRadius,position:"T",style:{strokeStyle:"#0c09d4",fillStyle:"#3ce92c",lineWidth:1}}),this.ice.addTool(t),e=new Rr({zIndex:10000011,display:!1,transformable:!1,draggable:!1,radius:this.slotRadius,position:"R",style:{strokeStyle:"#0c09d4",fillStyle:"#3ce92c",lineWidth:1}}),this.ice.addTool(e),n=new Rr({zIndex:10000012,display:!1,transformable:!1,draggable:!1,radius:this.slotRadius,position:"B",style:{strokeStyle:"#0c09d4",fillStyle:"#3ce92c",lineWidth:1}}),this.ice.addTool(n),i=new Rr({zIndex:10000013,display:!1,transformable:!1,draggable:!1,radius:this.slotRadius,position:"L",style:{strokeStyle:"#0c09d4",fillStyle:"#3ce92c",lineWidth:1}}),this.ice.addTool(i),this.ice._linkSlots=[t,e,n,i])}}]),ICELinkSlotManager),Xr=(_createClass(Deserializer,[{key:"fromJSONObject",value:function fromJSONObject(t){for(var e=t.childNodes,n=0;n<e.length;n++)this.decodeRecursively(this.ice,e[n])}},{key:"fromJSONString",value:function fromJSONString(t){t=JSON.parse(t),this.fromJSONObject(t)}},{key:"decodeRecursively",value:function decodeRecursively(t,e){var n=new(this.ice.getType(e.type))(e.state),i=(t.addChild(n),e.childNodes);if(i&&i.length)for(var r=0;r<i.length;r++)this.decodeRecursively(n,i[r])}}]),Deserializer),Wr=(_createClass(Serializer,[{key:"toJSONString",value:function toJSONString(){return JSON.stringify(this.toJSONObject())}},{key:"toJSONObject",value:function toJSONObject(){for(var t={createTime:(new Date).toLocaleString(),lastModifyTime:(new Date).toLocaleString(),childNodes:[]},e=0;e<this.ice.childNodes.length;e++){var n=this.ice.childNodes[e];this.encodeRecursively(n,t)}return t}},{key:"encodeRecursively",value:function encodeRecursively(t,e){var n={state:t.state,type:t.constructor.name,childNodes:[]};if(e.childNodes.push(n),t.childNodes&&t.childNodes.length)for(var i=0;i<t.childNodes.length;i++)this.encodeRecursively(t.childNodes[i],n)}}]),Serializer),Gr=(_inherits(CanvasRenderer,l),Dr=_createSuper(CanvasRenderer),_createClass(CanvasRenderer,[{key:"start",value:function start(){return this.stopped=!1,this.ice.evtBus.on(N,this.frameEvtHandler,this),this}},{key:"stop",value:function stop(){return this.stopped=!0,this.ice.evtBus.off(N,this.frameEvtHandler,this),this}},{key:"frameEvtHandler",value:function frameEvtHandler(t){this.ice.dirty&&this.doRender()}},{key:"refreshQueue",value:function refreshQueue(){this.componentQueue=flattenTree([],this.ice.childNodes),this.componentQueue.sort(function(t,e){return t.state.zIndex-e.state.zIndex}),this.toolsQueue=flattenTree([],this.ice.toolNodes),this.toolsQueue.sort(function(t,e){return t.state.zIndex-e.state.zIndex})}},{key:"doRender",value:function doRender(){this.refreshQueue(),this.ice.ctx.clearRect(0,0,this.ice.canvasWidth,this.ice.canvasHeight);for(var t=0;t<this.componentQueue.length;t++){var e=this.componentQueue[t];e.root=this.ice.root,e.ctx=this.ice.ctx,e.evtBus=this.ice.evtBus,e.ice=this.ice,e.render()}for(var n=0;n<this.toolsQueue.length;n++){var i=this.toolsQueue[n];i.root=this.ice.root,i.ctx=this.ice.ctx,i.evtBus=this.ice.evtBus,i.ice=this.ice,i.render()}this.ice.dirty=!1,this.ice.evtBus.trigger(U)}}]),CanvasRenderer),Kr=(_createClass(ImageCache,[{key:"setImage",value:function setImage(t){var e=this,n=this.imageCache.get(t);return n||((n=new Image).onload=function(){e.ice.dirty=!0},n.onerror=function(){},n.src=t,this.imageCache.size>ImageCache.CACHE_SIZE&&this.imageCache.delete(this.imageCache.keys().next().value),this.imageCache.set(t,n)),{loaded:this.loaded(n),image:n}}},{key:"loaded",value:function loaded(t){return t.complete&&0<t.naturalWidth}}]),ImageCache);function ImageCache(t){_classCallCheck(this,ImageCache),_defineProperty$1(this,"imageCache",new Map),this.ice=t}function CanvasRenderer(t){var e;return _classCallCheck(this,CanvasRenderer),_defineProperty$1(_assertThisInitialized(e=Dr.call(this)),"stopped",!1),_defineProperty$1(_assertThisInitialized(e),"componentQueue",[]),_defineProperty$1(_assertThisInitialized(e),"toolsQueue",[]),e.ice=t,e}function Serializer(t){_classCallCheck(this,Serializer),this.ice=t}function Deserializer(t){_classCallCheck(this,Deserializer),this.ice=t}function ICELinkSlotManager(t){_classCallCheck(this,ICELinkSlotManager),_defineProperty$1(this,"slotRadius",10),this.ice=t}function ICEText(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck(this,ICEText),t=ICEText.arrangeParam(t),(t=Hr.call(this,t)).measureText(),t}function ICEStar(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck(this,ICEStar),(t=_objectSpread2({outerRadius:50,innerRadius:20,startAngle:90,spikes:5},t)).spikes=Math.floor(1<=t.spikes?t.spikes:1),t.width=2*t.outerRadius,t.height=2*t.outerRadius,Fr.call(this,t)}_defineProperty$1(Kr,"CACHE_SIZE",100),_createClass(function ICE(){_classCallCheck(this,ICE),_defineProperty$1(this,"childNodes",[]),_defineProperty$1(this,"toolNodes",[]),_defineProperty$1(this,"canvasWidth",0),_defineProperty$1(this,"canvasHeight",0),_defineProperty$1(this,"selectionList",[]),_defineProperty$1(this,"typeMapping",{}),_defineProperty$1(this,"__dirty",!0),_defineProperty$1(this,"_lastUpdateTime",Date.now())},[{key:"init",value:function init(t){if(!t)throw new Error("ICE.init() failed...");if(this.ctx===t)throw new Error("同一个 canvas 实例只能 init 一次...");for(var e in qr)this.typeMapping[e]=qr[e];return this.root=k,y(t)?(this.canvasEl=this.root.document.getElementById(t),this.canvasEl.oncontextmenu=function(t){t.preventDefault(),t.stopPropagation()},this.canvasWidth=this.canvasEl.width,this.canvasHeight=this.canvasEl.height,this.canvasBoundingClientRect=this.canvasEl.getBoundingClientRect(),this.ctx=this.canvasEl.getContext("2d")):this.ctx=t,this.evtBus=new $r,x.regitserEvtBus(this.evtBus),x.start(),Ir.regitserEvtBus(this.evtBus),Ir.start(),this.eventDispatcher=new jr(this).start(),this.animationManager=new Z(this).start(),this.controlPanelManager=new Er(this).start(),this.renderer=new Gr(this).start(),this.linkSlotManager=new Jr(this).start(),this.serializer=new Wr(this),this.deserializer=new Xr(this),this.imageCache=new Kr(this),this}},{key:"addTool",value:function addTool(t){-1===this.childNodes.indexOf(t)&&(this.evtBus.trigger(H,null,{component:t}),t.trigger(H),t.ice=this,t.ctx=this.ctx,t.evtBus=this.evtBus,this.toolNodes.push(t),this.dirty=!0,this.evtBus.trigger(F,null,{component:t}),t.trigger(F))}},{key:"removeTool",value:function removeTool(t){this.evtBus.trigger(V,null,{component:t}),t.destory(),this.toolNodes.splice(this.toolNodes.indexOf(t),1),this.dirty=!0}},{key:"addChild",value:function addChild(t){var e=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];-1===this.childNodes.indexOf(t)&&(this.evtBus.trigger(H,null,{component:t}),t.trigger(H),t.ice=this,t.ctx=this.ctx,t.evtBus=this.evtBus,t.parentNode=null,this.childNodes.push(t),Object.keys(t.props.animations).length&&this.animationManager.add(t),this.dirty=e,this.evtBus.trigger(F,null,{component:t}),t.trigger(F))}},{key:"addChildren",value:function addChildren(t){for(var e=0;e<t.length;e++)this.addChild(t[e],!1);this.dirty=!0}},{key:"removeChild",value:function removeChild(t){var e=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];this.evtBus.trigger(V,null,{component:t}),t.destory(),this.childNodes.splice(this.childNodes.indexOf(t),1),this.dirty=e}},{key:"removeChildren",value:function removeChildren(t){for(var e=0;e<t.length;e++)this.removeChild(t[e],!1);this.dirty=!0}},{key:"clearAll",value:function clearAll(){this.removeChildren(_toConsumableArray(this.childNodes))}},{key:"findComponent",value:function findComponent(e){return this.childNodes.filter(function(t){return t.props.id===e})[0]}},{key:"dirty",get:function get(){return this.__dirty},set:function set(t){this.__dirty=t}},{key:"registerType",value:function registerType(t,e){this.typeMapping[t]=e}},{key:"getType",value:function getType(t){return this.typeMapping[t]}},{key:"toJSONString",value:function toJSONString(){return this.serializer.toJSONString()}},{key:"toJSONObject",value:function toJSONObject(){return this.serializer.toJSONObject()}},{key:"fromJSONObject",value:function fromJSONObject(t){var e=this;x.stop(),this.renderer.stop(),this.eventDispatcher.stopped=!0,this.animationManager.stop(),this.controlPanelManager.stop(),this.linkSlotManager.stop(),this.clearAll(),this.deserializer.fromJSONObject(t),x.start(),this.renderer.start(),this.animationManager.start(),this.controlPanelManager.start(),this.linkSlotManager.start(),setTimeout(function(){e.eventDispatcher.stopped=!1},300)}},{key:"fromJSONString",value:function fromJSONString(t){t=JSON.parse(t),this.fromJSONObject(t)}}]);function Ad(t){return null==t}function Cd(t,e){return t===e||t!=t&&e!=e}function Ed(t,e){for(var n=t.length;n--;)if(Qr(t[n][0],e))return n;return-1}function Ld(t){var e=this.__data__;return!((t=Zr(e,t))<0||(t==e.length-1?e.pop():Yr.call(e,t,1),--this.size,0))}function Md(t){var e=this.__data__;return(t=to(e,t))<0?void 0:e[t][1]}function Nd(t){return-1<eo(this.__data__,t)}function Od(t,e){var n=this.__data__,i=no(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}var v="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Qr=Cd,Zr=Ed,Yr=Array.prototype.splice,to=Ed,eo=Ed,no=Ed;function ListCache$4(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}ListCache$4.prototype.clear=function listCacheClear$1(){this.__data__=[],this.size=0},ListCache$4.prototype.delete=Ld,ListCache$4.prototype.get=Md,ListCache$4.prototype.has=Nd,ListCache$4.prototype.set=Od;function Rd(){this.__data__=new io,this.size=0}function Sd(t){var e=this.__data__,t=e.delete(t);return this.size=e.size,t}function Td(t){return this.__data__.get(t)}function Ud(t){return this.__data__.has(t)}function g3(t){return ao.call(t)}function i3(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":(co&&co in Object(t)?lo:g3)(t)}function j3(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function n3(t){return!!uo(t)&&("[object Function]"==(t=ho(t))||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t)}function C3(t){return!(!vo(t)||go(t))&&(yo(t)?Co:bo).test(mo(t))}function D3(t,e){return null==t?void 0:t[e]}function E3(t,e){return t=D3(t,e),C3(t)?t:void 0}function R3(t){return t=this.has(t)&&delete this.__data__[t],this.size-=t?1:0,t}function S3(t){var e,n=this.__data__;return ko?"__lodash_hash_undefined__"===(e=n[t])?void 0:e:wo.call(n,t)?n[t]:void 0}function T3(t){var e=this.__data__;return Po?void 0!==e[t]:xo.call(e,t)}function U3(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Eo&&void 0===e?"__lodash_hash_undefined__":e,this}var e=ListCache$4,io=e,o="object"==typeof v&&v&&v.Object===Object&&v,h="object"==typeof self&&self&&self.Object===Object&&self,f=o||h||Function("return this")(),t=f.Symbol,a=Object.prototype,ro=a.hasOwnProperty,oo=a.toString,so=t?t.toStringTag:void 0,ao=Object.prototype.toString,lo=function getRawTag$1(t){var e=ro.call(t,so),n=t[so];try{var i=!(t[so]=void 0)}catch(t){}var r=oo.call(t);return i&&(e?t[so]=n:delete t[so]),r},co=t?t.toStringTag:void 0,ho=i3,uo=j3,b=f["__core-js_shared__"],fo=(r=/[^.]+$/.exec(b&&b.keys&&b.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",po=Function.prototype.toString,yo=n3,go=function isMasked$1(t){return!!fo&&fo in t},vo=j3,mo=function toSource$1(t){if(null!=t){try{return po.call(t)}catch(t){}try{return t+""}catch(t){}}return""},bo=/^\[object .+?Constructor\]$/,n=Function.prototype,i=Object.prototype,d=n.toString,l=i.hasOwnProperty,Co=RegExp("^"+d.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),v=E3(f,"Map"),h=E3(Object,"create"),_o=h,ko=h,wo=Object.prototype.hasOwnProperty,Po=h,xo=Object.prototype.hasOwnProperty,Eo=h;function Hash$1(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}Hash$1.prototype.clear=function hashClear$1(){this.__data__=_o?_o(null):{},this.size=0},Hash$1.prototype.delete=R3,Hash$1.prototype.get=S3,Hash$1.prototype.has=T3,Hash$1.prototype.set=U3;function Y3(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}function Z3(t,e){return t=t.__data__,Y3(e)?t["string"==typeof e?"string":"hash"]:t.map}function de(t){return t=Io(this,t).delete(t),this.size-=t?1:0,t}function ee(t){return $o(this,t).get(t)}function fe(t){return Mo(this,t).has(t)}function ge(t,e){var n=Ao(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}var So=Hash$1,Oo=e,jo=v,Io=Z3,$o=Z3,Mo=Z3,Ao=Z3;function MapCache$1(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}MapCache$1.prototype.clear=function mapCacheClear$1(){this.size=0,this.__data__={hash:new So,map:new(jo||Oo),string:new So}},MapCache$1.prototype.delete=de,MapCache$1.prototype.get=ee,MapCache$1.prototype.has=fe,MapCache$1.prototype.set=ge;function pe(t,e){var n=this.__data__;if(n instanceof Bo){var i=n.__data__;if(!Lo||i.length<199)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new To(i)}return n.set(t,e),this.size=n.size,this}var Bo=e,Lo=v,To=MapCache$1,zo=e,a=Sd,t=Td,b=Ud;function Stack$1(t){t=this.__data__=new zo(t);this.size=t.size}Stack$1.prototype.clear=Rd,Stack$1.prototype.delete=a,Stack$1.prototype.get=t,Stack$1.prototype.has=b,Stack$1.prototype.set=pe;function ue(t,e,n){"__proto__"==e&&Uo?Uo(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function xe(t,e,n){(void 0===n||Jo(t[e],n))&&(void 0!==n||e in t)||qo(t,e,n)}function Be(t){var e=new t.constructor(t.byteLength);return new Xo(e).set(new Xo(t)),e}function Ce(t,e){return e=e?Be(t.buffer):t.buffer,new t.constructor(e,t.byteOffset,t.length)}function De(t,e){var n=-1,i=t.length;for(e=e||Array(i);++n<i;)e[n]=t[n];return e}function Je(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Ko)}function Ne(t){return"function"!=typeof t.constructor||Yo(t)?{}:Qo(Zo(t))}function Oe(t){return null!=t&&"object"==typeof t}function Re(t){return es(t)&&"[object Arguments]"==ts(t)}function Ye(t){return"number"==typeof t&&-1<t&&t%1==0&&t<=9007199254740991}function _e(t){return null!=t&&ss(t.length)&&!os(t)}function c4(t){return ls(t)&&as(t)}function n4(t){return!(!us(t)||"[object Object]"!=cs(t))&&(null===(t=hs(t))||"function"==typeof(t=fs.call(t,"constructor")&&t.constructor)&&t instanceof t&&ds.call(t)==ps)}function s4(t){return vs(t)&&gs(t.length)&&!!E[ys(t)]}function t4(e){return function(t){return e(t)}}function A4(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}function E4(t,e,n){var i=t[e];Cs.call(t,e)&&bs(i,n)&&(void 0!==n||e in t)||ms(t,e,n)}function I4(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&ks.test(t))&&-1<t&&t%1==0&&t<e}function J4(t,e){for(var n=-1,i=Array(t);++n<t;)i[n]=e(n);return i}function W4(t){if(!js(t))return $s(t);var e,n=Is(t),i=[];for(e in t)("constructor"!=e||!n&&Ms.call(t,e))&&i.push(e);return i}function Y4(t){return Bs(t)?As(t,!0):W4(t)}function sf(t,e,n,i,r,o,s){var a,l,c,h=Ks(t,n),u=Ks(e,n),d=s.get(u);d?zs(t,n,d):((e=void 0===(d=o?o(h,u,n+"",t,e,s):void 0))&&(l=!(a=Vs(u))&&qs(u),c=!a&&!l&&Gs(u),d=u,a||l||c?d=Vs(h)?h:Us(h)?Ds(h):l?Rs(u,!(e=!1)):c?Ns(u,!(e=!1)):[]:Ws(u)||Fs(u)?Fs(d=h)?d=Qs(h):Xs(h)&&!Js(h)||(d=Hs(u)):e=!1),e&&(s.set(u,d),r(d,u,i,o,s),s.delete(u)),zs(t,n,d))}function xf(t){return t}function yf(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Bf(t){return function(){return t}}function Nf(t,e){return da(ua(t,e,ha),t+"")}function Of(t,e,n){if(!va(n))return!1;var i=typeof e;return!!("number"==i?pa(n)&&ya(e,n.length):"string"==i&&e in n)&&fa(n[e],t)}var Ro,No,Do,Ho,Fo,r=Stack$1,Vo=E3,n=function(){try{var t=Vo(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Uo=n,qo=ue,Jo=Cd,i=function createBaseFor$1(l){return function(t,e,n){for(var i=-1,r=Object(t),o=n(t),s=o.length;s--;){var a=o[l?s:++i];if(!1===e(r[a],a,r))break}return t}}(),d={exports:{}},Xo=(h=(h=(l=d).exports)&&!h.nodeType&&h,v=(v=h&&l&&!l.nodeType&&l)&&v.exports===h?f.Buffer:void 0,Ro=v?v.allocUnsafe:void 0,l.exports=function cloneBuffer(t,e){if(e)return t.slice();e=t.length,e=Ro?Ro(e):new t.constructor(e);return t.copy(e),e},f.Uint8Array),Wo=j3,Go=Object.create,e=function(){function object(){}return function(t){if(!Wo(t))return{};if(Go)return Go(t);object.prototype=t;t=new object;return object.prototype=void 0,t}}(),a=function overArg$1(e,n){return function(t){return e(n(t))}}(Object.getPrototypeOf,Object),Ko=Object.prototype,Qo=e,Zo=a,Yo=Je,ts=i3,es=Oe,ns=Oe,t=Object.prototype,is=t.hasOwnProperty,rs=t.propertyIsEnumerable,b=Re(function(){return arguments}())?Re:function(t){return ns(t)&&is.call(t,"callee")&&!rs.call(t,"callee")},h=Array.isArray,os=n3,ss=Ye,as=_e,ls=Oe,v={exports:{}},cs=(e=(e=(l=v).exports)&&!e.nodeType&&e,t=(t=e&&l&&!l.nodeType&&l)&&t.exports===e?f.Buffer:void 0,e=(t?t.isBuffer:void 0)||function stubFalse(){return!1},l.exports=e,i3),hs=a,us=Oe,f=Function.prototype,t=Object.prototype,ds=f.toString,fs=t.hasOwnProperty,ps=ds.call(Object),ys=i3,gs=Ye,vs=Oe,E={},l=(E["[object Float32Array]"]=E["[object Float64Array]"]=E["[object Int8Array]"]=E["[object Int16Array]"]=E["[object Int32Array]"]=E["[object Uint8Array]"]=E["[object Uint8ClampedArray]"]=E["[object Uint16Array]"]=E["[object Uint32Array]"]=!0,E["[object Arguments]"]=E["[object Array]"]=E["[object ArrayBuffer]"]=E["[object Boolean]"]=E["[object DataView]"]=E["[object Date]"]=E["[object Error]"]=E["[object Function]"]=E["[object Map]"]=E["[object Number]"]=E["[object Object]"]=E["[object RegExp]"]=E["[object Set]"]=E["[object String]"]=E["[object WeakMap]"]=!1,{exports:{}}),f=(a=(a=(e=l).exports)&&!a.nodeType&&a,No=a&&e&&!e.nodeType&&e,Do=No&&No.exports===a&&o.process,a=function(){try{return No&&No.require&&No.require("util").types||Do&&Do.binding&&Do.binding("util")}catch(t){}}(),e.exports=a,s4),t=t4,o=l.exports,e=o&&o.isTypedArray,a=e?t(e):f,ms=ue,bs=Cd,Cs=Object.prototype.hasOwnProperty,_s=ue,ks=/^(?:0|[1-9]\d*)$/,ws=b,Ps=h,xs=v.exports,Es=I4,Ss=a,Os=Object.prototype.hasOwnProperty,js=j3,Is=Je,$s=function nativeKeysIn$1(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e},Ms=Object.prototype.hasOwnProperty,As=function arrayLikeKeys$1(t,e){var n,i=Ps(t),r=!i&&ws(t),o=!i&&!r&&xs(t),s=!i&&!r&&!o&&Ss(t),a=i||r||o||s,l=a?J4(t.length,String):[],c=l.length;for(n in t)!e&&!Os.call(t,n)||a&&("length"==n||o&&("offset"==n||"parent"==n)||s&&("buffer"==n||"byteLength"==n||"byteOffset"==n)||Es(n,c))||l.push(n);return l},Bs=_e,Ls=function copyObject$1(t,e,n,i){var r=!n;n=n||{};for(var o=-1,s=e.length;++o<s;){var a=e[o],l=i?i(n[a],t[a],a,n,t):void 0;void 0===l&&(l=t[a]),(r?_s:E4)(n,a,l)}return n},Ts=Y4,zs=xe,Rs=d.exports,Ns=Ce,Ds=De,Hs=Ne,Fs=b,Vs=h,Us=c4,qs=v.exports,Js=n3,Xs=j3,Ws=n4,Gs=a,Ks=A4,Qs=function toPlainObject$1(t){return Ls(t,Ts(t))},Zs=r,Ys=xe,ta=i,ea=j3,na=Y4,oa=A4,sa=Math.max,aa=n,la=Date.now,l=function shortOut$1(n){var i=0,r=0;return function(){var t=la(),e=16-(t-r);if(r=t,0<e){if(800<=++i)return arguments[0]}else i=0;return n.apply(void 0,arguments)}}(aa?function(t,e){return aa(t,"toString",{configurable:!0,enumerable:!1,value:Bf(e),writable:!0})}:xf),ha=xf,ua=function overRest$1(o,s,a){return s=sa(void 0===s?o.length-1:s,0),function(){for(var t=arguments,e=-1,n=sa(t.length-s,0),i=Array(n);++e<n;)i[e]=t[s+e];for(var e=-1,r=Array(s+1);++e<s;)r[e]=t[e];return r[s]=a(i),yf(o,this,r)}},da=l,fa=Cd,pa=_e,ya=I4,va=j3,ma=function baseMerge$1(i,r,o,s,a){i!==r&&ta(r,function(t,e){var n;a=a||new Zs,ea(t)?sf(i,r,e,o,baseMerge$1,s,a):(n=s?s(oa(i,e),t,e+"",i,r,a):void 0,Ys(i,e,n=void 0===n?t:n))},na)},ba=function createAssigner$1(a){return Nf(function(t,e){var n=-1,i=e.length,r=1<i?e[i-1]:void 0,o=2<i?e[2]:void 0,r=3<a.length&&"function"==typeof r?(i--,r):void 0;for(o&&Of(e[0],e[1],o)&&(r=i<3?void 0:r,i=1),t=Object(t);++n<i;){var s=e[n];s&&a(t,s,n,r)}return t})}(function(t,e,n){ma(t,e,n)}),o=(_inherits$1(Entity,Nt),Fo=_createSuper$1(Entity),_createClass$1(Entity,[{key:"syncEntityNameAndFields",value:function syncEntityNameAndFields(){if(this.entityNameComponent&&this.removeChild(this.entityNameComponent),this.deviderLine&&this.removeChild(this.deviderLine),this.entityFieldsComponent.length&&(this.removeChildren(this.entityFieldsComponent),this.entityFieldsComponent.length=0),this.state.entityName&&(this.entityNameComponent=new Ur({left:0,top:0,text:this.state.entityName,style:{strokeStyle:"#222",fillStyle:"#222",fontSize:18,fontWeight:"bold",paddingTop:10,paddingLeft:10,paddingRight:10,paddingBottom:10},interactive:!1,stroke:!1,showMinBoundingBox:!1,showMaxBoundingBox:!1}),this.addChild(this.entityNameComponent),this.deviderLine=new Nr({left:0,top:0,points:[[0,0],[this.state.width,0]],style:{strokeStyle:"#333",fillStyle:"#333",lineWidth:2},interactive:!1}),this.addChild(this.deviderLine)),!Ad(this.state.fields)){for(var t=this.state.fields.length,e=0;e<t;e++){var n=this.state.fields[e],n=new Ur({left:0,top:0,text:"".concat(n.name," ").concat(n.type," ").concat(n.length),style:{strokeStyle:"#222",fillStyle:"#222",fontSize:18,fontWeight:"normal",paddingTop:10,paddingLeft:10,paddingRight:10,paddingBottom:e===t-1?10:0},interactive:!1,stroke:!1,showMinBoundingBox:!1,showMaxBoundingBox:!1});this.entityFieldsComponent.push(n)}this.addChildren(this.entityFieldsComponent)}}},{key:"calcComponentParams",value:function calcComponentParams(){var t=this.state.width,e=0,n=0;this.entityNameComponent&&(e=this.childNodes[0].state.height,t=Math.max(t,this.childNodes[0].state.width),n=e+=this.deviderLine.state.height);for(var i=0;i<this.entityFieldsComponent.length;i++){var r=this.entityFieldsComponent[i];r.setState({left:0,top:e}),e+=r.state.height,t=Math.max(t,r.state.width)}this.deviderLine&&this.deviderLine.setState({points:[[0,n],[t,n]]});var n=t,o=Math.max(e,this.state.height);return{width:this.state.width=n,height:this.state.height=o}}},{key:"toEntityObject",value:function toEntityObject(){var n={name:this.state.entityName,columns:{}};return this.state.fields.forEach(function(t,e){n.columns[t.name]=_objectSpread2$1({},t)}),n}},{key:"setState",value:function setState(t){var e=!1;Ad(t.fields)||(this.state.fields=t.fields,e=!0),Ad(t.entityName)||(this.state.entityName=t.entityName,e=!0),e&&this.syncEntityNameAndFields(),_get$1(_getPrototypeOf$1(Entity.prototype),"setState",this).call(this,t)}}],[{key:"arrangeParam",value:function arrangeParam(t){t=ba({entityName:"Entity Name",fields:[],style:{strokeStyle:"#000",fillStyle:"#00eeff"}},t,{transformable:!1});return Ad(t.entityName)&&(t.entityName="Entity Name"),Ad(t.fields)&&(t.fields=[]),t}}]),Entity),t=(_inherits$1(Relation,g),Ho=_createSuper$1(Relation),_createClass$1(Relation,[{key:"toEntityObject",value:function toEntityObject(){var t,e,n,i,r=this.state,o=r.title,s=r.relationType,r=r.referencedColumnName;return this.state.links&&this.state.links.start&&this.state.links.start.id&&(t=this.state.links.start.id,e=this.ice.findComponent(t).state.entityName),this.state.links&&this.state.links.end&&this.state.links.end.id&&(n=this.state.links.end.id,i=this.ice.findComponent(n).state.entityName),{title:o,fromId:t,fromName:e,toId:n,toName:i,relationType:s,referencedColumnName:r}}}]),Relation);function Relation(t){return _classCallCheck$1(this,Relation),Ho.call(this,_objectSpread2$1({title:"Relation",relationType:"one-to-one",referencedColumnName:"id"},t))}function Entity(t){_classCallCheck$1(this,Entity);var t=Entity.arrangeParam(t);return _defineProperty$2(_assertThisInitialized$1(t=Fo.call(this,t)),"entityFieldsComponent",[]),t.syncEntityNameAndFields(),t}function camelCase(t,e){e=1<arguments.length&&void 0!==e&&e;return function toCamelCase(t,e){for(var n=0<arguments.length&&void 0!==t?t:[],i=1<arguments.length&&void 0!==e&&e,r="",o=0,s=n.length;o<s;o++){var a=n[o].toLowerCase();r+=a=!i&&0==o?a:a.substr(0,1).toUpperCase()+a.substr(1)}return r}(function toWords(t){return(t=function convertToString(t){return"string"==typeof(t=t||"")?t:String(t)}(t)).match(/[A-Z\xC0-\xD6\xD8-\xDE]?[a-z\xDF-\xF6\xF8-\xFF]+|[A-Z\xC0-\xD6\xD8-\xDE]+(?![a-z\xDF-\xF6\xF8-\xFF])|\d+/g)}(t),e)}var _a=[],ka=[],wa={},Pa={},xa={};function sanitizeRule(t){return"string"==typeof t?new RegExp("^"+t+"$","i"):t}function restoreCase(t,e){return t===e?e:t===t.toLowerCase()?e.toLowerCase():t===t.toUpperCase()?e.toUpperCase():t[0]===t[0].toUpperCase()?e.charAt(0).toUpperCase()+e.substr(1).toLowerCase():e.toLowerCase()}function replace(i,r){return i.replace(r[0],function(t,e){var n=function interpolate(t,n){return t.replace(/\$(\d{1,2})/g,function(t,e){return n[e]||""})}(r[1],arguments);return restoreCase(""===t?i[e-1]:t,n)})}function sanitizeWord(t,e,n){if(!t.length||wa.hasOwnProperty(t))return e;for(var i=n.length;i--;){var r=n[i];if(r[0].test(e))return replace(e,r)}return e}function replaceWord(n,i,r){return function(t){var e=t.toLowerCase();return i.hasOwnProperty(e)?restoreCase(t,e):n.hasOwnProperty(e)?restoreCase(t,n[e]):sanitizeWord(e,t,r)}}function checkWord(e,n,i){return function(t){t=t.toLowerCase();return!!n.hasOwnProperty(t)||!e.hasOwnProperty(t)&&sanitizeWord(t,t,i)===t}}function pluralize(t,e,n){return(n?e+" ":"")+(1===e?pluralize.singular(t):pluralize.plural(t))}function toSchemaObject(t){for(var e=function _toConsumableArray$1(t){return function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray$1(t)}(t)||function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray$1(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(n="Object"===n&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray$1(t,e):void 0}}(t)||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.")}()}(t),n=[],i={},r=0;r<e.length;r++){var o=e[r];"Relation"===o.constructor.name?n.push(o):"Entity"===o.constructor.name&&(i[o.state.id]=o.toEntityObject())}for(var s=0;s<n.length;s++){var a=n[s].toEntityObject(),l=a.fromId,c=a.fromName,h=a.toId,u=a.toName,d=a.relationType,a=a.referencedColumnName,l=i[l],h=i[h];l&&h&&(l.relations||(l.relations={}),h.relations||(h.relations={}),"one-to-one"===d?(l.relations["".concat(camelCase(u))]={type:d,target:u,joinColumn:{target:u,referencedColumnName:a}},h.relations["".concat(camelCase(c))]={type:d,target:c}):"one-to-many"===d?l.relations["".concat(camelCase(u))]={type:d,target:u}:"many-to-one"===d?h.relations["".concat(camelCase(c))]={type:"one-to-many",target:c}:"many-to-many"===d&&(l.relations["".concat(pluralize(camelCase(u)))]={type:d,target:u,joinTable:{target:u}},h.relations["".concat(pluralize(camelCase(c)))]={type:d,target:c}))}var f,p=[];for(f in i)p.push(i[f]);return p}pluralize.plural=replaceWord(xa,Pa,_a),pluralize.isPlural=checkWord(xa,Pa,_a),pluralize.singular=replaceWord(Pa,xa,ka),pluralize.isSingular=checkWord(Pa,xa,ka),pluralize.addPluralRule=function(t,e){_a.push([sanitizeRule(t),e])},pluralize.addSingularRule=function(t,e){ka.push([sanitizeRule(t),e])},pluralize.addUncountableRule=function(t){"string"!=typeof t?(pluralize.addPluralRule(t,"$0"),pluralize.addSingularRule(t,"$0")):wa[t.toLowerCase()]=!0},pluralize.addIrregularRule=function(t,e){e=e.toLowerCase(),t=t.toLowerCase(),xa[t]=e,Pa[e]=t},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach(function(t){return pluralize.addIrregularRule(t[0],t[1])}),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(function(t){return pluralize.addPluralRule(t[0],t[1])}),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(t){return pluralize.addSingularRule(t[0],t[1])}),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(pluralize.addUncountableRule),S.Entity=o,S.Relation=t,S.toSchemaObject=toSchemaObject,S.toSchemaString=function toSchemaString(t){return JSON.stringify(toSchemaObject(t))},Object.defineProperty(S,"__esModule",{value:!0})});
|