!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.G=n():t.G=n()}(window,(function(){return function(t){var n={};function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var i in t)e.d(r,i,function(n){return t[n]}.bind(null,i));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=30)}([function(t,n,e){"use strict";e.r(n),e.d(n,"contains",(function(){return i})),e.d(n,"includes",(function(){return i})),e.d(n,"difference",(function(){return o})),e.d(n,"find",(function(){return m})),e.d(n,"findIndex",(function(){return x})),e.d(n,"firstValue",(function(){return b})),e.d(n,"flatten",(function(){return M})),e.d(n,"flattenDeep",(function(){return _})),e.d(n,"getRange",(function(){return C})),e.d(n,"pull",(function(){return j})),e.d(n,"pullAt",(function(){return B})),e.d(n,"reduce",(function(){return E})),e.d(n,"remove",(function(){return I})),e.d(n,"sortBy",(function(){return X})),e.d(n,"union",(function(){return q})),e.d(n,"uniq",(function(){return D})),e.d(n,"valuesOfKey",(function(){return Y})),e.d(n,"head",(function(){return N})),e.d(n,"last",(function(){return R})),e.d(n,"startsWith",(function(){return L})),e.d(n,"endsWith",(function(){return z})),e.d(n,"filter",(function(){return a})),e.d(n,"every",(function(){return W})),e.d(n,"some",(function(){return V})),e.d(n,"group",(function(){return Z})),e.d(n,"groupBy",(function(){return H})),e.d(n,"groupToMap",(function(){return Q})),e.d(n,"getWrapBehavior",(function(){return U})),e.d(n,"wrapBehavior",(function(){return $})),e.d(n,"number2color",(function(){return J})),e.d(n,"parseRadius",(function(){return tt})),e.d(n,"clamp",(function(){return nt})),e.d(n,"fixedBase",(function(){return et})),e.d(n,"isDecimal",(function(){return it})),e.d(n,"isEven",(function(){return at})),e.d(n,"isInteger",(function(){return ot})),e.d(n,"isNegative",(function(){return ut})),e.d(n,"isNumberEqual",(function(){return st})),e.d(n,"isOdd",(function(){return ct})),e.d(n,"isPositive",(function(){return ft})),e.d(n,"max",(function(){return P})),e.d(n,"maxBy",(function(){return ht})),e.d(n,"min",(function(){return A})),e.d(n,"minBy",(function(){return lt})),e.d(n,"mod",(function(){return pt})),e.d(n,"toDegree",(function(){return gt})),e.d(n,"toInteger",(function(){return vt})),e.d(n,"toRadian",(function(){return mt})),e.d(n,"forIn",(function(){return xt})),e.d(n,"has",(function(){return bt})),e.d(n,"hasKey",(function(){return Mt})),e.d(n,"hasValue",(function(){return _t})),e.d(n,"keys",(function(){return d})),e.d(n,"isMatch",(function(){return g})),e.d(n,"values",(function(){return wt})),e.d(n,"lowerCase",(function(){return At})),e.d(n,"lowerFirst",(function(){return Ct})),e.d(n,"substitute",(function(){return Ot})),e.d(n,"upperCase",(function(){return St})),e.d(n,"upperFirst",(function(){return kt})),e.d(n,"getType",(function(){return Tt})),e.d(n,"isArguments",(function(){return Bt})),e.d(n,"isArray",(function(){return h})),e.d(n,"isArrayLike",(function(){return r})),e.d(n,"isBoolean",(function(){return Et})),e.d(n,"isDate",(function(){return It})),e.d(n,"isError",(function(){return Ft})),e.d(n,"isFunction",(function(){return c})),e.d(n,"isFinite",(function(){return Xt})),e.d(n,"isNil",(function(){return f})),e.d(n,"isNull",(function(){return Dt})),e.d(n,"isNumber",(function(){return rt})),e.d(n,"isObject",(function(){return l})),e.d(n,"isObjectLike",(function(){return v})),e.d(n,"isPlainObject",(function(){return y})),e.d(n,"isPrototype",(function(){return Yt})),e.d(n,"isRegExp",(function(){return Nt})),e.d(n,"isString",(function(){return F})),e.d(n,"isType",(function(){return s})),e.d(n,"isUndefined",(function(){return Rt})),e.d(n,"isElement",(function(){return Lt})),e.d(n,"requestAnimationFrame",(function(){return zt})),e.d(n,"clearAnimationFrame",(function(){return Wt})),e.d(n,"augment",(function(){return Ht})),e.d(n,"clone",(function(){return Zt})),e.d(n,"debounce",(function(){return Ut})),e.d(n,"memoize",(function(){return $t})),e.d(n,"deepMix",(function(){return Jt})),e.d(n,"each",(function(){return p})),e.d(n,"extend",(function(){return tn})),e.d(n,"indexOf",(function(){return nn})),e.d(n,"isEmpty",(function(){return rn})),e.d(n,"isEqual",(function(){return on})),e.d(n,"isEqualWith",(function(){return un})),e.d(n,"map",(function(){return sn})),e.d(n,"mapValues",(function(){return fn})),e.d(n,"mix",(function(){return Gt})),e.d(n,"assign",(function(){return Gt})),e.d(n,"get",(function(){return hn})),e.d(n,"set",(function(){return ln})),e.d(n,"pick",(function(){return dn})),e.d(n,"omit",(function(){return gn})),e.d(n,"throttle",(function(){return vn})),e.d(n,"toArray",(function(){return yn})),e.d(n,"toString",(function(){return Pt})),e.d(n,"uniqueId",(function(){return xn})),e.d(n,"noop",(function(){return bn})),e.d(n,"identity",(function(){return Mn})),e.d(n,"size",(function(){return wn})),e.d(n,"Cache",(function(){return _n}));var r=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},i=function(t,n){return!!r(t)&&t.indexOf(n)>-1},a=function(t,n){if(!r(t))return t;for(var e=[],i=0;i-1;)S.call(t,a,1);return t},T=Array.prototype.splice,B=function(t,n){if(!r(t))return[];for(var e=t?n.length:0,i=e-1;e--;){var a=void 0,o=n[e];e!==i&&o===a||(a=o,T.call(t,o,1))}return t},E=function(t,n,e){if(!h(t)&&!y(t))return t;var r=e;return p(t,(function(t,e){r=n(r,t,e)})),r},I=function(t,n){var e=[];if(!r(t))return e;for(var i=-1,a=[],o=t.length;++in[i])return 1;if(t[i]e?e:t},et=function(t,n){var e=n.toString(),r=e.indexOf(".");if(-1===r)return Math.round(t);var i=e.substr(r+1).length;return i>20&&(i=20),parseFloat(t.toFixed(i))},rt=function(t){return s(t,"Number")},it=function(t){return rt(t)&&t%1!=0},at=function(t){return rt(t)&&t%2==0},ot=Number.isInteger?Number.isInteger:function(t){return rt(t)&&t%1==0},ut=function(t){return rt(t)&&t<0};function st(t,n,e){return void 0===e&&(e=1e-5),Math.abs(t-n)0},ht=function(t,n){if(h(t)){for(var e,r=-1/0,i=0;ir&&(e=a,r=o)}return e}},lt=function(t,n){if(h(t)){for(var e,r=1/0,i=0;in?(r&&(clearTimeout(r),r=null),u=c,o=t.apply(i,a),r||(i=a=null)):r||!1===e.trailing||(r=setTimeout(s,f)),o};return c.cancel=function(){clearTimeout(r),u=0,r=i=a=null},c},yn=function(t){return r(t)?Array.prototype.slice.call(t):[]},mn={},xn=function(t){return mn[t=t||"g"]?mn[t]+=1:mn[t]=1,t+mn[t]},bn=function(){},Mn=function(t){return t};function wn(t){return f(t)?0:r(t)?t.length:Object.keys(t).length}var _n=function(){function t(){this.map={}}return t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,n){var e=this.map[t];return void 0===e?n:e},t.prototype.set=function(t,n){this.map[t]=n},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(t){delete this.map[t]},t.prototype.size=function(){return Object.keys(this.map).length},t}()},function(t,n,e){"use strict";e.d(n,"b",(function(){return r})),e.d(n,"a",(function(){return i})),e.d(n,"c",(function(){return a}));var r=1e-6,i="undefined"!=typeof Float32Array?Float32Array:Array,a=Math.random;Math.PI;Math.hypot||(Math.hypot=function(){for(var t=0,n=arguments.length;n--;)t+=arguments[n]*arguments[n];return Math.sqrt(t)})},function(t,n,e){"use strict";e.r(n),e.d(n,"__extends",(function(){return i})),e.d(n,"__assign",(function(){return a})),e.d(n,"__rest",(function(){return o})),e.d(n,"__decorate",(function(){return u})),e.d(n,"__param",(function(){return s})),e.d(n,"__metadata",(function(){return c})),e.d(n,"__awaiter",(function(){return f})),e.d(n,"__generator",(function(){return h})),e.d(n,"__createBinding",(function(){return l})),e.d(n,"__exportStar",(function(){return p})),e.d(n,"__values",(function(){return d})),e.d(n,"__read",(function(){return g})),e.d(n,"__spread",(function(){return v})),e.d(n,"__spreadArrays",(function(){return y})),e.d(n,"__spreadArray",(function(){return m})),e.d(n,"__await",(function(){return x})),e.d(n,"__asyncGenerator",(function(){return b})),e.d(n,"__asyncDelegator",(function(){return M})),e.d(n,"__asyncValues",(function(){return w})),e.d(n,"__makeTemplateObject",(function(){return _})),e.d(n,"__importStar",(function(){return A})),e.d(n,"__importDefault",(function(){return C})),e.d(n,"__classPrivateFieldGet",(function(){return O})),e.d(n,"__classPrivateFieldSet",(function(){return S})); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ var r=function(t,n){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(t,n)};function i(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}r(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}var a=function(){return(a=Object.assign||function(t){for(var n,e=1,r=arguments.length;e=0;u--)(i=t[u])&&(o=(a<3?i(o):a>3?i(n,e,o):i(n,e))||o);return a>3&&o&&Object.defineProperty(n,e,o),o}function s(t,n){return function(e,r){n(e,r,t)}}function c(t,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,n)}function f(t,n,e,r){return new(e||(e=Promise))((function(i,a){function o(t){try{s(r.next(t))}catch(t){a(t)}}function u(t){try{s(r.throw(t))}catch(t){a(t)}}function s(t){var n;t.done?i(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(o,u)}s((r=r.apply(t,n||[])).next())}))}function h(t,n){var e,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(e)throw new TypeError("Generator is already executing.");for(;o;)try{if(e=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(t,n){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var r,i,a=e.call(t),o=[];try{for(;(void 0===n||n-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(e=a.return)&&e.call(a)}finally{if(i)throw i.error}}return o}function v(){for(var t=[],n=0;n1||u(t,n)}))})}function u(t,n){try{(e=i[t](n)).value instanceof x?Promise.resolve(e.value.v).then(s,c):f(a[0][2],e)}catch(t){f(a[0][3],t)}var e}function s(t){u("next",t)}function c(t){u("throw",t)}function f(t,n){t(n),a.shift(),a.length&&u(a[0][0],a[0][1])}}function M(t){var n,e;return n={},r("next"),r("throw",(function(t){throw t})),r("return"),n[Symbol.iterator]=function(){return this},n;function r(r,i){n[r]=t[r]?function(n){return(e=!e)?{value:x(t[r](n)),done:"return"===r}:i?i(n):n}:i}}function w(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,e=t[Symbol.asyncIterator];return e?e.call(t):(t=d(t),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(e){n[e]=t[e]&&function(n){return new Promise((function(r,i){(function(t,n,e,r){Promise.resolve(r).then((function(n){t({value:n,done:e})}),n)})(r,i,(n=t[e](n)).done,n.value)}))}}}function _(t,n){return Object.defineProperty?Object.defineProperty(t,"raw",{value:n}):t.raw=n,t}var P=Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n};function A(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)"default"!==e&&Object.prototype.hasOwnProperty.call(t,e)&&l(n,t,e);return P(n,t),n}function C(t){return t&&t.__esModule?t:{default:t}}function O(t,n,e,r){if("a"===e&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof n?t!==n||!r:!n.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===e?r:"a"===e?r.call(t):r?r.value:n.get(t)}function S(t,n,e,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof n?t!==n||!i:!n.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(t,e):i?i.value=e:n.set(t,e),e}},function(t,n,e){"use strict";e.r(n),e.d(n,"Quad",(function(){return y})),e.d(n,"Cubic",(function(){return _})),e.d(n,"Arc",(function(){return j})),e.d(n,"Line",(function(){return h})),e.d(n,"Polygon",(function(){return q})),e.d(n,"Polyline",(function(){return X})),e.d(n,"Util",(function(){return r}));var r={};e.r(r),e.d(r,"distance",(function(){return a})),e.d(r,"isNumberEqual",(function(){return o})),e.d(r,"getBBoxByArray",(function(){return u})),e.d(r,"getBBoxRange",(function(){return s})),e.d(r,"piMod",(function(){return c}));var i=e(0);function a(t,n,e,r){var i=t-e,a=n-r;return Math.sqrt(i*i+a*a)}function o(t,n){return Math.abs(t-n)<.001}function u(t,n){var e=Object(i.min)(t),r=Object(i.min)(n);return{x:e,y:r,width:Object(i.max)(t)-e,height:Object(i.max)(n)-r}}function s(t,n,e,r){return{minX:Object(i.min)([t,e]),maxX:Object(i.max)([t,e]),minY:Object(i.min)([n,r]),maxY:Object(i.max)([n,r])}}function c(t){return(t+2*Math.PI)%(2*Math.PI)}var f=e(7),h={box:function(t,n,e,r){return u([t,e],[n,r])},length:function(t,n,e,r){return a(t,n,e,r)},pointAt:function(t,n,e,r,i){return{x:(1-i)*t+i*e,y:(1-i)*n+i*r}},pointDistance:function(t,n,e,r,i,o){var u=(e-t)*(i-t)+(r-n)*(o-n);return u<0?a(t,n,i,o):u>(e-t)*(e-t)+(r-n)*(r-n)?a(e,r,i,o):this.pointToLine(t,n,e,r,i,o)},pointToLine:function(t,n,e,r,i,a){var o=[e-t,r-n];if(f.exactEquals(o,[0,0]))return Math.sqrt((i-t)*(i-t)+(a-n)*(a-n));var u=[-o[1],o[0]];f.normalize(u,u);var s=[i-t,a-n];return Math.abs(f.dot(s,u))},tangentAngle:function(t,n,e,r){return Math.atan2(r-n,e-t)}};function l(t,n,e,r,i,o){var u,s=1/0,c=[e,r],f=20;o&&o>200&&(f=o/10);for(var h=1/f,l=h/10,p=0;p<=f;p++){var d=p*h,g=[i.apply(null,t.concat([d])),i.apply(null,n.concat([d]))];(x=a(c[0],c[1],g[0],g[1]))=0&&x=0?[i]:[]}function g(t,n,e,r){return 2*(1-r)*(n-t)+2*r*(e-n)}function v(t,n,e,r,i,a,o){var u=p(t,e,i,o),s=p(n,r,a,o),c=h.pointAt(t,n,e,r,o),f=h.pointAt(e,r,i,a,o);return[[t,n,c.x,c.y,u,s],[u,s,f.x,f.y,i,a]]}var y={box:function(t,n,e,r,i,a){var o=d(t,e,i)[0],s=d(n,r,a)[0],c=[t,i],f=[n,a];return void 0!==o&&c.push(p(t,e,i,o)),void 0!==s&&f.push(p(n,r,a,s)),u(c,f)},length:function(t,n,e,r,i,o){return function t(n,e,r,i,o,u,s){if(0===s)return(a(n,e,r,i)+a(r,i,o,u)+a(n,e,o,u))/2;var c=v(n,e,r,i,o,u,.5),f=c[0],h=c[1];return f.push(s-1),h.push(s-1),t.apply(null,f)+t.apply(null,h)}(t,n,e,r,i,o,3)},nearestPoint:function(t,n,e,r,i,a,o,u){return l([t,e,i],[n,r,a],o,u,p)},pointDistance:function(t,n,e,r,i,o,u,s){var c=this.nearestPoint(t,n,e,r,i,o,u,s);return a(c.x,c.y,u,s)},interpolationAt:p,pointAt:function(t,n,e,r,i,a,o){return{x:p(t,e,i,o),y:p(n,r,a,o)}},divide:function(t,n,e,r,i,a,o){return v(t,n,e,r,i,a,o)},tangentAngle:function(t,n,e,r,i,a,o){var u=g(t,e,i,o),s=g(n,r,a,o);return c(Math.atan2(s,u))}};function m(t,n,e,r,i){var a=1-i;return a*a*a*t+3*n*i*a*a+3*e*i*i*a+r*i*i*i}function x(t,n,e,r,i){var a=1-i;return 3*(a*a*(n-t)+2*a*i*(e-n)+i*i*(r-e))}function b(t,n,e,r){var i,a,u,s=-3*t+9*n-9*e+3*r,c=6*t-12*n+6*e,f=3*n-3*t,h=[];if(o(s,0))o(c,0)||(i=-f/c)>=0&&i<=1&&h.push(i);else{var l=c*c-4*s*f;o(l,0)?h.push(-c/(2*s)):l>0&&(a=(-c-(u=Math.sqrt(l)))/(2*s),(i=(-c+u)/(2*s))>=0&&i<=1&&h.push(i),a>=0&&a<=1&&h.push(a))}return h}function M(t,n,e,r,i,a,o,u,s){var c=m(t,e,i,o,s),f=m(n,r,a,u,s),l=h.pointAt(t,n,e,r,s),p=h.pointAt(e,r,i,a,s),d=h.pointAt(i,a,o,u,s),g=h.pointAt(l.x,l.y,p.x,p.y,s),v=h.pointAt(p.x,p.y,d.x,d.y,s);return[[t,n,l.x,l.y,g.x,g.y,c,f],[c,f,v.x,v.y,d.x,d.y,o,u]]}function w(t,n,e,r,i,o,u,s,c){if(0===c)return function(t,n){for(var e=0,r=t.length,i=0;i0?e:-1*e}var A=function(t,n,e,r,i,a){var o=e,u=r;if(0===o||0===u)return{x:t,y:n};for(var s,c,f=i-t,h=a-n,l=Math.abs(f),p=Math.abs(h),d=o*o,g=u*u,v=Math.PI/4,y=0;y<4;y++){s=o*Math.cos(v),c=u*Math.sin(v);var m=(d-g)*Math.pow(Math.cos(v),3)/o,x=(g-d)*Math.pow(Math.sin(v),3)/u,b=s-m,M=c-x,w=l-m,_=p-x,A=Math.hypot(M,b),C=Math.hypot(_,w);v+=A*Math.asin((b*_-M*w)/(A*C))/Math.sqrt(d+g-s*s-c*c),v=Math.min(Math.PI/2,Math.max(0,v))}return{x:t+P(s,f),y:n+P(c,h)}};function C(t,n,e,r,i,a){return e*Math.cos(i)*Math.cos(a)-r*Math.sin(i)*Math.sin(a)+t}function O(t,n,e,r,i,a){return e*Math.sin(i)*Math.cos(a)+r*Math.cos(i)*Math.sin(a)+n}function S(t,n,e){return{x:t*Math.cos(e),y:n*Math.sin(e)}}function k(t,n,e){var r=Math.cos(e),i=Math.sin(e);return[t*r-n*i,t*i+n*r]}var j={box:function(t,n,e,r,i,a,o){for(var u=function(t,n,e){return Math.atan(-n/t*Math.tan(e))}(e,r,i),s=1/0,c=-1/0,f=[a,o],h=2*-Math.PI;h<=2*Math.PI;h+=Math.PI){var l=u+h;ac&&(c=p)}var d=function(t,n,e){return Math.atan(n/(t*Math.tan(e)))}(e,r,i),g=1/0,v=-1/0,y=[a,o];for(h=2*-Math.PI;h<=2*Math.PI;h+=Math.PI){var m=d+h;av&&(v=x)}return{x:s,y:g,width:c-s,height:v-g}},length:function(t,n,e,r,i,a,o){},nearestPoint:function(t,n,e,r,i,a,o,u,s){var c=k(u-t,s-n,-i),f=c[0],h=c[1],l=A(0,0,e,r,f,h),p=function(t,n,e,r){return(Math.atan2(r*t,e*n)+2*Math.PI)%(2*Math.PI)}(e,r,l.x,l.y);po&&(l=S(e,r,o));var d=k(l.x,l.y,i);return{x:d[0]+t,y:d[1]+n}},pointDistance:function(t,n,e,r,i,o,u,s,c){var f=this.nearestPoint(t,n,e,r,s,c);return a(f.x,f.y,s,c)},pointAt:function(t,n,e,r,i,a,o,u){var s=(o-a)*u+a;return{x:C(t,0,e,r,i,s),y:O(0,n,e,r,i,s)}},tangentAngle:function(t,n,e,r,i,a,o,u){var s=(o-a)*u+a,f=function(t,n,e,r,i,a,o,u){return-1*e*Math.cos(i)*Math.sin(u)-r*Math.sin(i)*Math.cos(u)}(0,0,e,r,i,0,0,s),h=function(t,n,e,r,i,a,o,u){return-1*e*Math.sin(i)*Math.sin(u)+r*Math.cos(i)*Math.cos(u)}(0,0,e,r,i,0,0,s);return c(Math.atan2(h,f))}};function T(t){for(var n=0,e=[],r=0;r1||n<0||t.length<2)return null;var e=T(t),r=e.segments,i=e.totalLength;if(0===i)return{x:t[0][0],y:t[0][1]};for(var a=0,o=null,u=0;u=a&&n<=a+l){var p=(n-a)/l;o=h.pointAt(c[0],c[1],f[0],f[1],p);break}a+=l}return o}function I(t,n){if(n>1||n<0||t.length<2)return 0;for(var e=T(t),r=e.segments,i=e.totalLength,a=0,o=0,u=0;u=a&&n<=a+h){o=Math.atan2(f[1]-c[1],f[0]-c[0]);break}a+=h}return o}function F(t,n,e){for(var r=1/0,i=0;i=t&&i<=t+e&&a>=n&&a<=n+r},n.intersectRect=function(t,n){return!(n.minX>t.maxX||n.maxXt.maxY||n.maxY0&&(a.isNil(i)||1===i||(t.globalAlpha=i),this.stroke(t)),this.afterDrawPath(t)},n.prototype.createPath=function(t){},n.prototype.afterDrawPath=function(t){},n.prototype.isInShape=function(t,n){var e=this.isStroke(),r=this.isFill(),i=this.getHitLineWidth();return this.isInStrokeOrPath(t,n,e,r,i)},n.prototype.isInStrokeOrPath=function(t,n,e,r,i){return!1},n.prototype.getHitLineWidth=function(){if(!this.isStroke())return 0;var t=this.attrs;return t.lineWidth+t.lineAppendWidth},n}(i.AbstractShape);n.default=f},function(t,n,e){"use strict";e.r(n),e.d(n,"Event",(function(){return Y})),e.d(n,"Base",(function(){return G})),e.d(n,"AbstractCanvas",(function(){return ie})),e.d(n,"AbstractGroup",(function(){return ae})),e.d(n,"AbstractShape",(function(){return oe})),e.d(n,"PathUtil",(function(){return r})),e.d(n,"getBBoxMethod",(function(){return ce})),e.d(n,"registerBBox",(function(){return se})),e.d(n,"getTextHeight",(function(){return ye})),e.d(n,"assembleFont",(function(){return me})),e.d(n,"isAllowCapture",(function(){return V})),e.d(n,"multiplyVec2",(function(){return Z})),e.d(n,"invert",(function(){return U})),e.d(n,"getOffScreenContext",(function(){return ve})),e.d(n,"version",(function(){return Me}));var r={};e.r(r),e.d(r,"catmullRomToBezier",(function(){return f})),e.d(r,"fillPath",(function(){return B})),e.d(r,"fillPathByDiff",(function(){return F})),e.d(r,"formatPath",(function(){return q})),e.d(r,"intersection",(function(){return k})),e.d(r,"parsePathArray",(function(){return m})),e.d(r,"parsePathString",(function(){return c})),e.d(r,"pathToAbsolute",(function(){return l})),e.d(r,"pathToCurve",(function(){return v})),e.d(r,"rectPath",(function(){return P}));var i={};e.r(i),e.d(i,"easeLinear",(function(){return _t})),e.d(i,"easeQuad",(function(){return Ct})),e.d(i,"easeQuadIn",(function(){return Pt})),e.d(i,"easeQuadOut",(function(){return At})),e.d(i,"easeQuadInOut",(function(){return Ct})),e.d(i,"easeCubic",(function(){return kt})),e.d(i,"easeCubicIn",(function(){return Ot})),e.d(i,"easeCubicOut",(function(){return St})),e.d(i,"easeCubicInOut",(function(){return kt})),e.d(i,"easePoly",(function(){return Bt})),e.d(i,"easePolyIn",(function(){return jt})),e.d(i,"easePolyOut",(function(){return Tt})),e.d(i,"easePolyInOut",(function(){return Bt})),e.d(i,"easeSin",(function(){return Dt})),e.d(i,"easeSinIn",(function(){return Ft})),e.d(i,"easeSinOut",(function(){return Xt})),e.d(i,"easeSinInOut",(function(){return Dt})),e.d(i,"easeExp",(function(){return Rt})),e.d(i,"easeExpIn",(function(){return Yt})),e.d(i,"easeExpOut",(function(){return Nt})),e.d(i,"easeExpInOut",(function(){return Rt})),e.d(i,"easeCircle",(function(){return Wt})),e.d(i,"easeCircleIn",(function(){return Lt})),e.d(i,"easeCircleOut",(function(){return zt})),e.d(i,"easeCircleInOut",(function(){return Wt})),e.d(i,"easeBounce",(function(){return Ht})),e.d(i,"easeBounceIn",(function(){return Gt})),e.d(i,"easeBounceOut",(function(){return Ht})),e.d(i,"easeBounceInOut",(function(){return Qt})),e.d(i,"easeBack",(function(){return $t})),e.d(i,"easeBackIn",(function(){return Zt})),e.d(i,"easeBackOut",(function(){return Ut})),e.d(i,"easeBackInOut",(function(){return $t})),e.d(i,"easeElastic",(function(){return tn})),e.d(i,"easeElasticIn",(function(){return Jt})),e.d(i,"easeElasticOut",(function(){return tn})),e.d(i,"easeElasticInOut",(function(){return nn}));var a=e(0),o="\t\n\v\f\r   ᠎              \u2028\u2029",u=new RegExp("([a-z])["+o+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+o+"]*,?["+o+"]*)+)","ig"),s=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+o+"]*,?["+o+"]*","ig"),c=function(t){if(!t)return null;if(Object(a.isArray)(t))return t;var n={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},e=[];return String(t).replace(u,(function(r,i,a){var o=[],u=i.toLowerCase();if(a.replace(s,(function(t,n){n&&o.push(+n)})),"m"===u&&o.length>2&&(e.push([i].concat(o.splice(0,2))),u="l",i="m"===i?"l":"L"),"o"===u&&1===o.length&&e.push([i,o[0]]),"r"===u)e.push([i].concat(o));else for(;o.length>=n[u]&&(e.push([i].concat(o.splice(0,n[u]))),n[u]););return t})),e},f=function(t,n){for(var e=[],r=0,i=t.length;i-2*!n>r;r+=2){var a=[{x:+t[r-2],y:+t[r-1]},{x:+t[r],y:+t[r+1]},{x:+t[r+2],y:+t[r+3]},{x:+t[r+4],y:+t[r+5]}];n?r?i-4===r?a[3]={x:+t[0],y:+t[1]}:i-2===r&&(a[2]={x:+t[0],y:+t[1]},a[3]={x:+t[2],y:+t[3]}):a[0]={x:+t[i-2],y:+t[i-1]}:i-4===r?a[3]=a[2]:r||(a[0]={x:+t[r],y:+t[r+1]}),e.push(["C",(-a[0].x+6*a[1].x+a[2].x)/6,(-a[0].y+6*a[1].y+a[2].y)/6,(a[1].x+6*a[2].x-a[3].x)/6,(a[1].y+6*a[2].y-a[3].y)/6,a[2].x,a[2].y])}return e},h=function(t,n,e,r,i){var a=[];if(null===i&&null===r&&(r=e),t=+t,n=+n,e=+e,r=+r,null!==i){var o=Math.PI/180,u=t+e*Math.cos(-r*o),s=t+e*Math.cos(-i*o);a=[["M",u,n+e*Math.sin(-r*o)],["A",e,e,0,+(i-r>180),0,s,n+e*Math.sin(-i*o)]]}else a=[["M",t,n],["m",0,-r],["a",e,r,0,1,1,0,2*r],["a",e,r,0,1,1,0,-2*r],["z"]];return a},l=function(t){if(!(t=c(t))||!t.length)return[["M",0,0]];var n,e,r=[],i=0,a=0,o=0,u=0,s=0;"M"===t[0][0]&&(o=i=+t[0][1],u=a=+t[0][2],s++,r[0]=["M",i,a]);for(var l=3===t.length&&"M"===t[0][0]&&"R"===t[1][0].toUpperCase()&&"Z"===t[2][0].toUpperCase(),p=void 0,d=void 0,g=s,v=t.length;g1&&(e*=w=Math.sqrt(w),r*=w);var _=e*e,P=r*r,A=(a===o?-1:1)*Math.sqrt(Math.abs((_*P-_*M*M-P*b*b)/(_*M*M+P*b*b)));p=A*e*M/r+(t+u)/2,d=A*-r*b/e+(n+s)/2,h=Math.asin(((n-d)/r).toFixed(9)),l=Math.asin(((s-d)/r).toFixed(9)),h=tl&&(h-=2*Math.PI),!o&&l>h&&(l-=2*Math.PI)}var C=l-h;if(Math.abs(C)>v){var O=l,S=u,k=s;l=h+v*(o&&l>h?1:-1),u=p+e*Math.cos(l),s=d+r*Math.sin(l),m=g(u,s,e,r,i,0,o,S,k,[l,O,p,d])}C=l-h;var j=Math.cos(h),T=Math.sin(h),B=Math.cos(l),E=Math.sin(l),I=Math.tan(C/4),F=4/3*e*I,X=4/3*r*I,D=[t,n],q=[t+F*T,n-X*j],Y=[u+F*E,s-X*B],N=[u,s];if(q[0]=2*D[0]-q[0],q[1]=2*D[1]-q[1],c)return[q,Y,N].concat(m);for(var R=[],L=0,z=(m=[q,Y,N].concat(m).join().split(",")).length;L7){t[n].shift();for(var a=t[n];a.length;)u[n]="A",i&&(s[n]="A"),t.splice(n++,0,["C"].concat(a.splice(0,6)));t.splice(n,1),e=Math.max(r.length,i&&i.length||0)}},y=function(t,n,a,o,u){t&&n&&"M"===t[u][0]&&"M"!==n[u][0]&&(n.splice(u,0,["M",o.x,o.y]),a.bx=0,a.by=0,a.x=t[u][1],a.y=t[u][2],e=Math.max(r.length,i&&i.length||0))};e=Math.max(r.length,i&&i.length||0);for(var m=0;m1?1:s<0?0:s)/2,f=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],h=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],l=0,p=0;p<12;p++){var d=c*f[p]+c,g=x(d,t,e,i,o),v=x(d,n,r,a,u),y=g*g+v*v;l+=h[p]*Math.sqrt(y)}return c*l},M=function(t,n,e,r,i,a,o,u){for(var s,c,f,h,l=[],p=[[],[]],d=0;d<2;++d)if(0===d?(c=6*t-12*e+6*i,s=-3*t+9*e-9*i+3*o,f=3*e-3*t):(c=6*n-12*r+6*a,s=-3*n+9*r-9*a+3*u,f=3*r-3*n),Math.abs(s)<1e-12){if(Math.abs(c)<1e-12)continue;(h=-f/c)>0&&h<1&&l.push(h)}else{var g=c*c-4*f*s,v=Math.sqrt(g);if(!(g<0)){var y=(-c+v)/(2*s);y>0&&y<1&&l.push(y);var m=(-c-v)/(2*s);m>0&&m<1&&l.push(m)}}for(var x,b=l.length,M=b;b--;)x=1-(h=l[b]),p[0][b]=x*x*x*t+3*x*x*h*e+3*x*h*h*i+h*h*h*o,p[1][b]=x*x*x*n+3*x*x*h*r+3*x*h*h*a+h*h*h*u;return p[0][M]=t,p[1][M]=n,p[0][M+1]=o,p[1][M+1]=u,p[0].length=p[1].length=M+2,{min:{x:Math.min.apply(0,p[0]),y:Math.min.apply(0,p[1])},max:{x:Math.max.apply(0,p[0]),y:Math.max.apply(0,p[1])}}},w=function(t,n,e,r,i,a,o,u){if(!(Math.max(t,e)Math.max(i,o)||Math.max(n,r)Math.max(a,u))){var s=(t-e)*(a-u)-(n-r)*(i-o);if(s){var c=((t*r-n*e)*(i-o)-(t-e)*(i*u-a*o))/s,f=((t*r-n*e)*(a-u)-(n-r)*(i*u-a*o))/s,h=+c.toFixed(2),l=+f.toFixed(2);if(!(h<+Math.min(t,e).toFixed(2)||h>+Math.max(t,e).toFixed(2)||h<+Math.min(i,o).toFixed(2)||h>+Math.max(i,o).toFixed(2)||l<+Math.min(n,r).toFixed(2)||l>+Math.max(n,r).toFixed(2)||l<+Math.min(a,u).toFixed(2)||l>+Math.max(a,u).toFixed(2)))return{x:c,y:f}}}},_=function(t,n,e){return n>=t.x&&n<=t.x+t.width&&e>=t.y&&e<=t.y+t.height},P=function(t,n,e,r,i){if(i)return[["M",+t+ +i,n],["l",e-2*i,0],["a",i,i,0,0,1,i,i],["l",0,r-2*i],["a",i,i,0,0,1,-i,i],["l",2*i-e,0],["a",i,i,0,0,1,-i,-i],["l",0,2*i-r],["a",i,i,0,0,1,i,-i],["z"]];var a=[["M",t,n],["l",e,0],["l",0,r],["l",-e,0],["z"]];return a.parsePathArray=m,a},A=function(t,n,e,r){return null===t&&(t=n=e=r=0),null===n&&(n=t.y,e=t.width,r=t.height,t=t.x),{x:t,y:n,width:e,w:e,height:r,h:r,x2:t+e,y2:n+r,cx:t+e/2,cy:n+r/2,r1:Math.min(e,r)/2,r2:Math.max(e,r)/2,r0:Math.sqrt(e*e+r*r)/2,path:P(t,n,e,r),vb:[t,n,e,r].join(" ")}},C=function(t,n,e,r,i,o,u,s){Object(a.isArray)(t)||(t=[t,n,e,r,i,o,u,s]);var c=M.apply(null,t);return A(c.min.x,c.min.y,c.max.x-c.min.x,c.max.y-c.min.y)},O=function(t,n,e,r,i,a,o,u,s){var c=1-s,f=Math.pow(c,3),h=Math.pow(c,2),l=s*s,p=l*s,d=t+2*s*(e-t)+l*(i-2*e+t),g=n+2*s*(r-n)+l*(a-2*r+n),v=e+2*s*(i-e)+l*(o-2*i+e),y=r+2*s*(a-r)+l*(u-2*a+r);return{x:f*t+3*h*s*e+3*c*s*s*i+p*o,y:f*n+3*h*s*r+3*c*s*s*a+p*u,m:{x:d,y:g},n:{x:v,y:y},start:{x:c*t+s*e,y:c*n+s*r},end:{x:c*i+s*o,y:c*a+s*u},alpha:90-180*Math.atan2(d-v,g-y)/Math.PI}},S=function(t,n,e){if(!function(t,n){return t=A(t),n=A(n),_(n,t.x,t.y)||_(n,t.x2,t.y)||_(n,t.x,t.y2)||_(n,t.x2,t.y2)||_(t,n.x,n.y)||_(t,n.x2,n.y)||_(t,n.x,n.y2)||_(t,n.x2,n.y2)||(t.xn.x||n.xt.x)&&(t.yn.y||n.yt.y)}(C(t),C(n)))return e?0:[];for(var r=~~(b.apply(0,t)/8),i=~~(b.apply(0,n)/8),a=[],o=[],u={},s=e?0:[],c=0;c=0&&x<=1&&M>=0&&M<=1&&(e?s+=1:s.push({x:m.x,y:m.y,t1:x,t2:M}))}}return s},k=function(t,n){return function(t,n,e){var r,i,a,o,u,s,c,f,h,l;t=v(t),n=v(n);for(var p=e?0:[],d=0,g=t.length;d=3&&(3===t.length&&n.push("Q"),n=n.concat(t[1])),2===t.length&&n.push("L"),n=n.concat(t[t.length-1])}))}(t,n,e));else{var i=[].concat(t);"M"===i[0]&&(i[0]="L");for(var a=0;a<=e-1;a++)r.push(i)}return r},B=function(t,n){if(1===t.length)return t;var e=t.length-1,r=n.length-1,i=e/r,a=[];if(1===t.length&&"M"===t[0][0]){for(var o=0;o=0;s--)o=a[s].index,"add"===a[s].type?t.splice(o,0,[].concat(t[o])):t.splice(o,1)}var h=i-(r=t.length);if(r0)){t[r]=n[r];break}e=X(e,t[r-1],1)}t[r]=["Q"].concat(e.reduce((function(t,n){return t.concat(n)}),[]));break;case"T":t[r]=["T"].concat(e[0]);break;case"C":if(e.length<3){if(!(r>0)){t[r]=n[r];break}e=X(e,t[r-1],2)}t[r]=["C"].concat(e.reduce((function(t,n){return t.concat(n)}),[]));break;case"S":if(e.length<2){if(!(r>0)){t[r]=n[r];break}e=X(e,t[r-1],1)}t[r]=["S"].concat(e.reduce((function(t,n){return t.concat(n)}),[]));break;default:t[r]=n[r]}return t},Y=function(){function t(t,n){this.bubbles=!0,this.target=null,this.currentTarget=null,this.delegateTarget=null,this.delegateObject=null,this.defaultPrevented=!1,this.propagationStopped=!1,this.shape=null,this.fromShape=null,this.toShape=null,this.propagationPath=[],this.type=t,this.name=t,this.originalEvent=n,this.timeStamp=n.timeStamp}return t.prototype.preventDefault=function(){this.defaultPrevented=!0,this.originalEvent.preventDefault&&this.originalEvent.preventDefault()},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t.prototype.toString=function(){return"[Event (type="+this.type+")]"},t.prototype.save=function(){},t.prototype.restore=function(){},t}(),N=e(2),R=function(){function t(){this._events={}}return t.prototype.on=function(t,n,e){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:n,once:!!e}),this},t.prototype.once=function(t,n){return this.on(t,n,!0),this},t.prototype.emit=function(t){for(var n=this,e=[],r=1;rt.delay&&Object(a.each)(n.toAttrs,(function(n,e){o.call(t.toAttrs,e)&&(delete t.toAttrs[e],delete t.fromAttrs[e])}))})),t}var rt=function(t){function n(n){var e=t.call(this,n)||this;e.attrs={};var r=e.getDefaultAttrs();return Object(a.mix)(r,n.attrs),e.attrs=r,e.initAttrs(r),e.initAnimate(),e}return Object(N.__extends)(n,t),n.prototype.getDefaultCfg=function(){return{visible:!0,capture:!0,zIndex:0}},n.prototype.getDefaultAttrs=function(){return{matrix:this.getDefaultMatrix(),opacity:1}},n.prototype.onCanvasChange=function(t){},n.prototype.initAttrs=function(t){},n.prototype.initAnimate=function(){this.set("animable",!0),this.set("animating",!1)},n.prototype.isGroup=function(){return!1},n.prototype.getParent=function(){return this.get("parent")},n.prototype.getCanvas=function(){return this.get("canvas")},n.prototype.attr=function(){for(var t,n=[],e=0;e0?r=et(r,x):e.addAnimator(this),r.push(x),this.set("animations",r),this.set("_pause",{isPaused:!1})}},n.prototype.stopAnimate=function(t){var n=this;void 0===t&&(t=!0);var e=this.get("animations");Object(a.each)(e,(function(e){t&&(e.onFrame?n.attr(e.onFrame(1)):n.attr(e.toAttrs)),e.callback&&e.callback()})),this.set("animating",!1),this.set("animations",[])},n.prototype.pauseAnimate=function(){var t=this.get("timeline"),n=this.get("animations"),e=t.getTime();return Object(a.each)(n,(function(t){t._paused=!0,t._pauseTime=e,t.pauseCallback&&t.pauseCallback()})),this.set("_pause",{isPaused:!0,pauseTime:e}),this},n.prototype.resumeAnimate=function(){var t=this.get("timeline").getTime(),n=this.get("animations"),e=this.get("_pause").pauseTime;return Object(a.each)(n,(function(n){n.startTime=n.startTime+(t-e),n._paused=!1,n._pauseTime=null,n.resumeCallback&&n.resumeCallback()})),this.set("_pause",{isPaused:!1}),this.set("animations",n),this},n.prototype.emitDelegation=function(t,n){var e,r=this,i=n.propagationPath;this.getEvents();"mouseenter"===t?e=n.fromShape:"mouseleave"===t&&(e=n.toShape);for(var o=function(t){var o=i[t],s=o.get("name");if(s){if((o.isGroup()||o.isCanvas&&o.isCanvas())&&e&&W(o,e))return"break";Object(a.isArray)(s)?Object(a.each)(s,(function(t){r.emitDelegateEvent(o,t,n)})):u.emitDelegateEvent(o,s,n)}},u=this,s=0;s0)}));return u.length>0?(Object(a.each)(u,(function(t){var n=t.getBBox();i.push(n.minX,n.maxX),o.push(n.minY,n.maxY)})),t=Object(a.min)(i),n=Object(a.max)(i),e=Object(a.min)(o),r=Object(a.max)(o)):(t=0,n=0,e=0,r=0),{x:t,y:e,minX:t,minY:e,maxX:n,maxY:r,width:n-t,height:r-e}},n.prototype.getCanvasBBox=function(){var t=1/0,n=-1/0,e=1/0,r=-1/0,i=[],o=[],u=this.getChildren().filter((function(t){return t.get("visible")&&(!t.isGroup()||t.isGroup()&&t.getChildren().length>0)}));return u.length>0?(Object(a.each)(u,(function(t){var n=t.getCanvasBBox();i.push(n.minX,n.maxX),o.push(n.minY,n.maxY)})),t=Object(a.min)(i),n=Object(a.max)(i),e=Object(a.min)(o),r=Object(a.max)(o)):(t=0,n=0,e=0,r=0),{x:t,y:e,minX:t,minY:e,maxX:n,maxY:r,width:n-t,height:r-e}},n.prototype.getDefaultCfg=function(){var n=t.prototype.getDefaultCfg.call(this);return n.children=[],n},n.prototype.onAttrChange=function(n,e,r){if(t.prototype.onAttrChange.call(this,n,e,r),"matrix"===n){var i=this.getTotalMatrix();this._applyChildrenMarix(i)}},n.prototype.applyMatrix=function(n){var e=this.getTotalMatrix();t.prototype.applyMatrix.call(this,n);var r=this.getTotalMatrix();r!==e&&this._applyChildrenMarix(r)},n.prototype._applyChildrenMarix=function(t){var n=this.getChildren();Object(a.each)(n,(function(n){n.applyMatrix(t)}))},n.prototype.addShape=function(){for(var t=[],n=0;n=0;a--){var o=t[a];if(V(o)&&(o.isGroup()?i=o.getShape(n,e,r):o.isHit(n,e)&&(i=o)),i)break}return i},n.prototype.add=function(t){var n=this.getCanvas(),e=this.getChildren(),r=this.get("timeline"),i=t.getParent();i&&function(t,n,e){void 0===e&&(e=!0),e?n.destroy():(n.set("parent",null),n.set("canvas",null)),L(t.getChildren(),n)}(i,t,!1),t.set("parent",this),n&&function t(n,e){if(n.set("canvas",e),n.isGroup()){var r=n.get("children");r.length&&r.forEach((function(n){t(n,e)}))}}(t,n),r&&function t(n,e){if(n.set("timeline",e),n.isGroup()){var r=n.get("children");r.length&&r.forEach((function(n){t(n,e)}))}}(t,r),e.push(t),t.onCanvasChange("add"),this._applyElementMatrix(t)},n.prototype._applyElementMatrix=function(t){var n=this.getTotalMatrix();n&&t.applyMatrix(n)},n.prototype.getChildren=function(){return this.get("children")},n.prototype.sort=function(){var t,n=this.getChildren();Object(a.each)(n,(function(t,n){return t._INDEX=n,t})),n.sort((t=function(t,n){return t.get("zIndex")-n.get("zIndex")},function(n,e){var r=t(n,e);return 0===r?n._INDEX-e._INDEX:r})),this.onCanvasChange("sort")},n.prototype.clear=function(){if(this.set("clearing",!0),!this.destroyed){for(var t=this.getChildren(),n=t.length-1;n>=0;n--)t[n].destroy();this.set("children",[]),this.onCanvasChange("clear"),this.set("clearing",!1)}},n.prototype.destroy=function(){this.get("destroyed")||(this.clear(),t.prototype.destroy.call(this))},n.prototype.getFirst=function(){return this.getChildByIndex(0)},n.prototype.getLast=function(){var t=this.getChildren();return this.getChildByIndex(t.length-1)},n.prototype.getChildByIndex=function(t){return this.getChildren()[t]},n.prototype.getCount=function(){return this.getChildren().length},n.prototype.contain=function(t){return this.getChildren().indexOf(t)>-1},n.prototype.removeChild=function(t,n){void 0===n&&(n=!0),this.contain(t)&&t.remove(n)},n.prototype.findAll=function(t){var n=[],e=this.getChildren();return Object(a.each)(e,(function(e){t(e)&&n.push(e),e.isGroup()&&(n=n.concat(e.findAll(t)))})),n},n.prototype.find=function(t){var n=null,e=this.getChildren();return Object(a.each)(e,(function(e){if(t(e)?n=e:e.isGroup()&&(n=e.find(t)),n)return!1})),n},n.prototype.findById=function(t){return this.find((function(n){return n.get("id")===t}))},n.prototype.findByClassName=function(t){return this.find((function(n){return n.get("className")===t}))},n.prototype.findAllByName=function(t){return this.findAll((function(n){return n.get("name")===t}))},n}(rt),st=0,ct=0,ft=0,ht=0,lt=0,pt=0,dt="object"==typeof performance&&performance.now?performance:Date,gt="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function vt(){return lt||(gt(yt),lt=dt.now()+pt)}function yt(){lt=0}function mt(){this._call=this._time=this._next=null}function xt(t,n,e){var r=new mt;return r.restart(t,n,e),r}function bt(){lt=(ht=dt.now())+pt,st=ct=0;try{!function(){vt(),++st;for(var t,n=at;n;)(t=lt-n._time)>=0&&n._call.call(null,t),n=n._next;--st}()}finally{st=0,function(){var t,n,e=at,r=1/0;for(;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:at=n);ot=t,wt(r)}(),lt=0}}function Mt(){var t=dt.now(),n=t-ht;n>1e3&&(pt-=n,ht=t)}function wt(t){st||(ct&&(ct=clearTimeout(ct)),t-lt>24?(t<1/0&&(ct=setTimeout(bt,t-dt.now()-pt)),ft&&(ft=clearInterval(ft))):(ft||(ht=dt.now(),ft=setInterval(Mt,1e3)),st=1,gt(bt)))}function _t(t){return+t}function Pt(t){return t*t}function At(t){return t*(2-t)}function Ct(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}function Ot(t){return t*t*t}function St(t){return--t*t*t+1}function kt(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}mt.prototype=xt.prototype={constructor:mt,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?vt():+e)+(null==n?0:+n),this._next||ot===this||(ot?ot._next=this:at=this,ot=this),this._call=t,this._time=e,wt()},stop:function(){this._call&&(this._call=null,this._time=1/0,wt())}};var jt=function t(n){function e(t){return Math.pow(t,n)}return n=+n,e.exponent=t,e}(3),Tt=function t(n){function e(t){return 1-Math.pow(1-t,n)}return n=+n,e.exponent=t,e}(3),Bt=function t(n){function e(t){return((t*=2)<=1?Math.pow(t,n):2-Math.pow(2-t,n))/2}return n=+n,e.exponent=t,e}(3),Et=Math.PI,It=Et/2;function Ft(t){return 1==+t?1:1-Math.cos(t*It)}function Xt(t){return Math.sin(t*It)}function Dt(t){return(1-Math.cos(Et*t))/2}function qt(t){return 1.0009775171065494*(Math.pow(2,-10*t)-.0009765625)}function Yt(t){return qt(1-+t)}function Nt(t){return 1-qt(t)}function Rt(t){return((t*=2)<=1?qt(1-t):2-qt(t-1))/2}function Lt(t){return 1-Math.sqrt(1-t*t)}function zt(t){return Math.sqrt(1- --t*t)}function Wt(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}var Vt=7.5625;function Gt(t){return 1-Ht(1-t)}function Ht(t){return(t=+t)<4/11?Vt*t*t:t<8/11?Vt*(t-=6/11)*t+3/4:t<10/11?Vt*(t-=9/11)*t+15/16:Vt*(t-=21/22)*t+63/64}function Qt(t){return((t*=2)<=1?1-Ht(1-t):Ht(t-1)+1)/2}var Zt=function t(n){function e(t){return(t=+t)*t*(n*(t-1)+t)}return n=+n,e.overshoot=t,e}(1.70158),Ut=function t(n){function e(t){return--t*t*((t+1)*n+t)+1}return n=+n,e.overshoot=t,e}(1.70158),$t=function t(n){function e(t){return((t*=2)<1?t*t*((n+1)*t-n):(t-=2)*t*((n+1)*t+n)+2)/2}return n=+n,e.overshoot=t,e}(1.70158),Kt=2*Math.PI,Jt=function t(n,e){var r=Math.asin(1/(n=Math.max(1,n)))*(e/=Kt);function i(t){return n*qt(- --t)*Math.sin((r-t)/e)}return i.amplitude=function(n){return t(n,e*Kt)},i.period=function(e){return t(n,e)},i}(1,.3),tn=function t(n,e){var r=Math.asin(1/(n=Math.max(1,n)))*(e/=Kt);function i(t){return 1-n*qt(t=+t)*Math.sin((t+r)/e)}return i.amplitude=function(n){return t(n,e*Kt)},i.period=function(e){return t(n,e)},i}(1,.3),nn=function t(n,e){var r=Math.asin(1/(n=Math.max(1,n)))*(e/=Kt);function i(t){return((t=2*t-1)<0?n*qt(-t)*Math.sin((r-t)/e):2-n*qt(t)*Math.sin((r+t)/e))/2}return i.amplitude=function(n){return t(n,e*Kt)},i.period=function(e){return t(n,e)},i}(1,.3),en=function(t,n,e){t.prototype=n.prototype=e,e.constructor=t};function rn(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function an(){}var on="\\s*([+-]?\\d+)\\s*",un="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",sn="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",cn=/^#([0-9a-f]{3,8})$/,fn=new RegExp("^rgb\\("+[on,on,on]+"\\)$"),hn=new RegExp("^rgb\\("+[sn,sn,sn]+"\\)$"),ln=new RegExp("^rgba\\("+[on,on,on,un]+"\\)$"),pn=new RegExp("^rgba\\("+[sn,sn,sn,un]+"\\)$"),dn=new RegExp("^hsl\\("+[un,sn,sn]+"\\)$"),gn=new RegExp("^hsla\\("+[un,sn,sn,un]+"\\)$"),vn={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function yn(){return this.rgb().formatHex()}function mn(){return this.rgb().formatRgb()}function xn(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=cn.exec(t))?(e=n[1].length,n=parseInt(n[1],16),6===e?bn(n):3===e?new Pn(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):8===e?Mn(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):4===e?Mn(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|240&n,((15&n)<<4|15&n)/255):null):(n=fn.exec(t))?new Pn(n[1],n[2],n[3],1):(n=hn.exec(t))?new Pn(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=ln.exec(t))?Mn(n[1],n[2],n[3],n[4]):(n=pn.exec(t))?Mn(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=dn.exec(t))?Sn(n[1],n[2]/100,n[3]/100,1):(n=gn.exec(t))?Sn(n[1],n[2]/100,n[3]/100,n[4]):vn.hasOwnProperty(t)?bn(vn[t]):"transparent"===t?new Pn(NaN,NaN,NaN,0):null}function bn(t){return new Pn(t>>16&255,t>>8&255,255&t,1)}function Mn(t,n,e,r){return r<=0&&(t=n=e=NaN),new Pn(t,n,e,r)}function wn(t){return t instanceof an||(t=xn(t)),t?new Pn((t=t.rgb()).r,t.g,t.b,t.opacity):new Pn}function _n(t,n,e,r){return 1===arguments.length?wn(t):new Pn(t,n,e,null==r?1:r)}function Pn(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function An(){return"#"+On(this.r)+On(this.g)+On(this.b)}function Cn(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function On(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Sn(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new jn(t,n,e,r)}function kn(t){if(t instanceof jn)return new jn(t.h,t.s,t.l,t.opacity);if(t instanceof an||(t=xn(t)),!t)return new jn;if(t instanceof jn)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),a=Math.max(n,e,r),o=NaN,u=a-i,s=(a+i)/2;return u?(o=n===a?(e-r)/u+6*(e0&&s<1?0:o,new jn(o,u,s,t.opacity)}function jn(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function Tn(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}function Bn(t,n,e,r,i){var a=t*t,o=a*t;return((1-3*t+3*a-o)*n+(4-6*a+3*o)*e+(1+3*t+3*a-3*o)*r+o*i)/6}en(an,xn,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:yn,formatHex:yn,formatHsl:function(){return kn(this).formatHsl()},formatRgb:mn,toString:mn}),en(Pn,_n,rn(an,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Pn(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Pn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:An,formatHex:An,formatRgb:Cn,toString:Cn})),en(jn,(function(t,n,e,r){return 1===arguments.length?kn(t):new jn(t,n,e,null==r?1:r)}),rn(an,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new jn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new jn(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new Pn(Tn(t>=240?t-240:t+120,i,r),Tn(t,i,r),Tn(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var En=function(t){return function(){return t}};function In(t,n){return function(e){return t+e*n}}function Fn(t){return 1==(t=+t)?Xn:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}(n,e,t):En(isNaN(n)?e:n)}}function Xn(t,n){var e=n-t;return e?In(t,e):En(isNaN(t)?n:t)}var Dn=function t(n){var e=Fn(n);function r(t,n){var r=e((t=_n(t)).r,(n=_n(n)).r),i=e(t.g,n.g),a=e(t.b,n.b),o=Xn(t.opacity,n.opacity);return function(n){return t.r=r(n),t.g=i(n),t.b=a(n),t.opacity=o(n),t+""}}return r.gamma=t,r}(1);function qn(t){return function(n){var e,r,i=n.length,a=new Array(i),o=new Array(i),u=new Array(i);for(e=0;e=1?(e=1,n-1):Math.floor(e*n),i=t[r],a=t[r+1],o=r>0?t[r-1]:2*i-a,u=ra&&(i=n.slice(a,i),u[o]?u[o]+=i:u[++o]=i),(e=e[0])===(r=r[0])?u[o]?u[o]+=r:u[++o]=r:(u[++o]=null,s.push({i:o,x:zn(e,r)})),a=Gn.lastIndex;return ad.length?(p=c(o[l]),d=c(i[l]),d=F(d,p),d=q(d,p),n.fromAttrs.path=d,n.toAttrs.path=p):n.pathFormatted||(p=c(o[l]),d=c(i[l]),d=q(d,p),n.fromAttrs.path=d,n.toAttrs.path=p,n.pathFormatted=!0),r[l]=[];for(var g=0;g0){for(var a=r.animators.length-1;a>=0;a--)if((t=r.animators[a]).destroyed)r.removeAnimator(a);else{if(!t.isAnimatePaused())for(var o=(n=t.get("animations")).length-1;o>=0;o--)e=n[o],Un(t,e,i)&&(n.splice(o,1),!1,e.callback&&e.callback());0===n.length&&r.removeAnimator(a)}r.canvas.get("autoDraw")||r.canvas.draw()}}))},t.prototype.addAnimator=function(t){this.animators.push(t)},t.prototype.removeAnimator=function(t){this.animators.splice(t,1)},t.prototype.isAnimating=function(){return!!this.animators.length},t.prototype.stop=function(){this.timer&&this.timer.stop()},t.prototype.stopAllAnimations=function(t){void 0===t&&(t=!0),this.animators.forEach((function(n){n.stopAnimate(t)})),this.animators=[],this.canvas.draw()},t.prototype.getTime=function(){return this.current},t}(),Kn=["mousedown","mouseup","dblclick","mouseout","mouseover","mousemove","mouseleave","mouseenter","touchstart","touchmove","touchend","dragenter","dragover","dragleave","drop","contextmenu","mousewheel"];function Jn(t,n,e){e.name=n,e.target=t,e.currentTarget=t,e.delegateTarget=t,t.emit(n,e)}function te(t,n,e){if(e.bubbles){var r=void 0,i=!1;if("mouseenter"===n?(r=e.fromShape,i=!0):"mouseleave"===n&&(i=!0,r=e.toShape),t.isCanvas()&&i)return;if(r&&W(t,r))return void(e.bubbles=!1);e.name=n,e.currentTarget=t,e.delegateTarget=t,t.emit(n,e)}}var ne=function(){function t(t){var n=this;this.draggingShape=null,this.dragging=!1,this.currentShape=null,this.mousedownShape=null,this.mousedownPoint=null,this._eventCallback=function(t){var e=t.type;n._triggerEvent(e,t)},this._onDocumentMove=function(t){if(n.canvas.get("el")!==t.target&&(n.dragging||n.currentShape)){var e=n._getPointInfo(t);n.dragging&&n._emitEvent("drag",t,e,n.draggingShape)}},this._onDocumentMouseUp=function(t){if(n.canvas.get("el")!==t.target&&n.dragging){var e=n._getPointInfo(t);n.draggingShape&&n._emitEvent("drop",t,e,null),n._emitEvent("dragend",t,e,n.draggingShape),n._afterDrag(n.draggingShape,e,t)}},this.canvas=t.canvas}return t.prototype.init=function(){this._bindEvents()},t.prototype._bindEvents=function(){var t=this,n=this.canvas.get("el");Object(a.each)(Kn,(function(e){n.addEventListener(e,t._eventCallback)})),document&&(document.addEventListener("mousemove",this._onDocumentMove),document.addEventListener("mouseup",this._onDocumentMouseUp))},t.prototype._clearEvents=function(){var t=this,n=this.canvas.get("el");Object(a.each)(Kn,(function(e){n.removeEventListener(e,t._eventCallback)})),document&&(document.removeEventListener("mousemove",this._onDocumentMove),document.removeEventListener("mouseup",this._onDocumentMouseUp))},t.prototype._getEventObj=function(t,n,e,r,i,a){var o=new Y(t,n);return o.fromShape=i,o.toShape=a,o.x=e.x,o.y=e.y,o.clientX=e.clientX,o.clientY=e.clientY,o.propagationPath.push(r),o},t.prototype._getShape=function(t,n){return this.canvas.getShape(t.x,t.y,n)},t.prototype._getPointInfo=function(t){var n=this.canvas,e=n.getClientByEvent(t),r=n.getPointByEvent(t);return{x:r.x,y:r.y,clientX:e.x,clientY:e.y}},t.prototype._triggerEvent=function(t,n){var e=this._getPointInfo(n),r=this._getShape(e,n),i=this["_on"+t],a=!1;if(i)i.call(this,e,r,n);else{var o=this.currentShape;"mouseenter"===t||"dragenter"===t||"mouseover"===t?(this._emitEvent(t,n,e,null,null,r),r&&this._emitEvent(t,n,e,r,null,r),"mouseenter"===t&&this.draggingShape&&this._emitEvent("dragenter",n,e,null)):"mouseleave"===t||"dragleave"===t||"mouseout"===t?(a=!0,o&&this._emitEvent(t,n,e,o,o,null),this._emitEvent(t,n,e,null,o,null),"mouseleave"===t&&this.draggingShape&&this._emitEvent("dragleave",n,e,null)):this._emitEvent(t,n,e,r,null,null)}if(a||(this.currentShape=r),r&&!r.get("destroyed")){var u=this.canvas;u.get("el").style.cursor=r.attr("cursor")||u.get("cursor")}},t.prototype._onmousedown=function(t,n,e){0===e.button&&(this.mousedownShape=n,this.mousedownPoint=t,this.mousedownTimeStamp=e.timeStamp),this._emitEvent("mousedown",e,t,n,null,null)},t.prototype._emitMouseoverEvents=function(t,n,e,r){var i=this.canvas.get("el");e!==r&&(e&&(this._emitEvent("mouseout",t,n,e,e,r),this._emitEvent("mouseleave",t,n,e,e,r),r&&!r.get("destroyed")||(i.style.cursor=this.canvas.get("cursor"))),r&&(this._emitEvent("mouseover",t,n,r,e,r),this._emitEvent("mouseenter",t,n,r,e,r)))},t.prototype._emitDragoverEvents=function(t,n,e,r,i){r?(r!==e&&(e&&this._emitEvent("dragleave",t,n,e,e,r),this._emitEvent("dragenter",t,n,r,e,r)),i||this._emitEvent("dragover",t,n,r)):e&&this._emitEvent("dragleave",t,n,e,e,r),i&&this._emitEvent("dragover",t,n,r)},t.prototype._afterDrag=function(t,n,e){t&&(t.set("capture",!0),this.draggingShape=null),this.dragging=!1;var r=this._getShape(n,e);r!==t&&this._emitMouseoverEvents(e,n,t,r),this.currentShape=r},t.prototype._onmouseup=function(t,n,e){if(0===e.button){var r=this.draggingShape;this.dragging?(r&&this._emitEvent("drop",e,t,n),this._emitEvent("dragend",e,t,r),this._afterDrag(r,t,e)):(this._emitEvent("mouseup",e,t,n),n===this.mousedownShape&&this._emitEvent("click",e,t,n),this.mousedownShape=null,this.mousedownPoint=null)}},t.prototype._ondragover=function(t,n,e){e.preventDefault();var r=this.currentShape;this._emitDragoverEvents(e,t,r,n,!0)},t.prototype._onmousemove=function(t,n,e){var r=this.canvas,i=this.currentShape,a=this.draggingShape;if(this.dragging)a&&this._emitDragoverEvents(e,t,i,n,!1),this._emitEvent("drag",e,t,a);else{var o=this.mousedownPoint;if(o){var u=this.mousedownShape,s=e.timeStamp-this.mousedownTimeStamp,c=o.clientX-t.clientX,f=o.clientY-t.clientY;s>120||c*c+f*f>40?u&&u.get("draggable")?((a=this.mousedownShape).set("capture",!1),this.draggingShape=a,this.dragging=!0,this._emitEvent("dragstart",e,t,a),this.mousedownShape=null,this.mousedownPoint=null):!u&&r.get("draggable")?(this.dragging=!0,this._emitEvent("dragstart",e,t,null),this.mousedownShape=null,this.mousedownPoint=null):(this._emitMouseoverEvents(e,t,i,n),this._emitEvent("mousemove",e,t,n)):(this._emitMouseoverEvents(e,t,i,n),this._emitEvent("mousemove",e,t,n))}else this._emitMouseoverEvents(e,t,i,n),this._emitEvent("mousemove",e,t,n)}},t.prototype._emitEvent=function(t,n,e,r,i,a){var o=this._getEventObj(t,n,e,r,i,a);if(r){o.shape=r,Jn(r,t,o);for(var u=r.getParent();u;)u.emitDelegation(t,o),o.propagationStopped||te(u,t,o),o.propagationPath.push(u),u=u.getParent()}else{Jn(this.canvas,t,o)}},t.prototype.destroy=function(){this._clearEvents(),this.canvas=null,this.currentShape=null,this.draggingShape=null,this.mousedownPoint=null,this.mousedownShape=null,this.mousedownTimeStamp=null},t}(),ee=Object(H.a)(),re=ee&&"firefox"===ee.name,ie=function(t){function n(n){var e=t.call(this,n)||this;return e.initContainer(),e.initDom(),e.initEvents(),e.initTimeline(),e}return Object(N.__extends)(n,t),n.prototype.getDefaultCfg=function(){var n=t.prototype.getDefaultCfg.call(this);return n.cursor="default",n.supportCSSTransform=!1,n},n.prototype.initContainer=function(){var t=this.get("container");Object(a.isString)(t)&&(t=document.getElementById(t),this.set("container",t))},n.prototype.initDom=function(){var t=this.createDom();this.set("el",t),this.get("container").appendChild(t),this.setDOMSize(this.get("width"),this.get("height"))},n.prototype.initEvents=function(){var t=new ne({canvas:this});t.init(),this.set("eventController",t)},n.prototype.initTimeline=function(){var t=new $n(this);this.set("timeline",t)},n.prototype.setDOMSize=function(t,n){var e=this.get("el");z&&(e.style.width=t+"px",e.style.height=n+"px")},n.prototype.changeSize=function(t,n){this.setDOMSize(t,n),this.set("width",t),this.set("height",n),this.onCanvasChange("changeSize")},n.prototype.getRenderer=function(){return this.get("renderer")},n.prototype.getCursor=function(){return this.get("cursor")},n.prototype.setCursor=function(t){this.set("cursor",t);var n=this.get("el");z&&n&&(n.style.cursor=t)},n.prototype.getPointByEvent=function(t){if(this.get("supportCSSTransform")){if(re&&!Object(a.isNil)(t.layerX)&&t.layerX!==t.offsetX)return{x:t.layerX,y:t.layerY};if(!Object(a.isNil)(t.offsetX))return{x:t.offsetX,y:t.offsetY}}var n=this.getClientByEvent(t),e=n.x,r=n.y;return this.getPointByClient(e,r)},n.prototype.getClientByEvent=function(t){var n=t;return t.touches&&(n="touchend"===t.type?t.changedTouches[0]:t.touches[0]),{x:n.clientX,y:n.clientY}},n.prototype.getPointByClient=function(t,n){var e=this.get("el").getBoundingClientRect();return{x:t-e.left,y:n-e.top}},n.prototype.getClientByPoint=function(t,n){var e=this.get("el").getBoundingClientRect();return{x:t+e.left,y:n+e.top}},n.prototype.draw=function(){},n.prototype.removeDom=function(){var t=this.get("el");t.parentNode.removeChild(t)},n.prototype.clearEvents=function(){this.get("eventController").destroy()},n.prototype.isCanvas=function(){return!0},n.prototype.getParent=function(){return null},n.prototype.destroy=function(){var n=this.get("timeline");this.get("destroyed")||(this.clear(),n&&n.stop(),this.clearEvents(),this.removeDom(),t.prototype.destroy.call(this))},n}(ut),ae=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return Object(N.__extends)(n,t),n.prototype.isGroup=function(){return!0},n.prototype.isEntityGroup=function(){return!1},n.prototype.clone=function(){for(var n=t.prototype.clone.call(this),e=this.getChildren(),r=0;r=t&&e.minY<=n&&e.maxY>=n},n.prototype.afterAttrsChange=function(n){t.prototype.afterAttrsChange.call(this,n),this.clearCacheBBox()},n.prototype.getBBox=function(){var t=this.cfg.bbox;return t||(t=this.calculateBBox(),this.set("bbox",t)),t},n.prototype.getCanvasBBox=function(){var t=this.cfg.canvasBBox;return t||(t=this.calculateCanvasBBox(),this.set("canvasBBox",t)),t},n.prototype.applyMatrix=function(n){t.prototype.applyMatrix.call(this,n),this.set("canvasBBox",null)},n.prototype.calculateCanvasBBox=function(){var t=this.getBBox(),n=this.getTotalMatrix(),e=t.minX,r=t.minY,i=t.maxX,a=t.maxY;if(n){var o=Z(n,[t.minX,t.minY]),u=Z(n,[t.maxX,t.minY]),s=Z(n,[t.minX,t.maxY]),c=Z(n,[t.maxX,t.maxY]);e=Math.min(o[0],u[0],s[0],c[0]),i=Math.max(o[0],u[0],s[0],c[0]),r=Math.min(o[1],u[1],s[1],c[1]),a=Math.max(o[1],u[1],s[1],c[1])}var f=this.attrs;if(f.shadowColor){var h=f.shadowBlur,l=void 0===h?0:h,p=f.shadowOffsetX,d=void 0===p?0:p,g=f.shadowOffsetY,v=void 0===g?0:g,y=e-l+d,m=i+l+d,x=r-l+v,b=a+l+v;e=Math.min(e,y),i=Math.max(i,m),r=Math.min(r,x),a=Math.max(a,b)}return{x:e,y:r,minX:e,minY:r,maxX:i,maxY:a,width:i-e,height:a-r}},n.prototype.clearCacheBBox=function(){this.set("bbox",null),this.set("canvasBBox",null)},n.prototype.isClipShape=function(){return this.get("isClipShape")},n.prototype.isInShape=function(t,n){return!1},n.prototype.isOnlyHitBox=function(){return!1},n.prototype.isHit=function(t,n){var e=this.get("startArrowShape"),r=this.get("endArrowShape"),i=[t,n,1],a=(i=this.invertFromMatrix(i))[0],o=i[1],u=this._isInBBox(a,o);if(this.isOnlyHitBox())return u;if(u&&!this.isClipped(a,o)){if(this.isInShape(a,o))return!0;if(e&&e.isHit(a,o))return!0;if(r&&r.isHit(a,o))return!0}return!1},n}(rt),ue=new Map;function se(t,n){ue.set(t,n)}function ce(t){return ue.get(t)}var fe=function(t){var n=t.attr();return{x:n.x,y:n.y,width:n.width,height:n.height}},he=function(t){var n=t.attr(),e=n.x,r=n.y,i=n.r;return{x:e-i,y:r-i,width:2*i,height:2*i}},le=e(3);function pe(t,n){return t&&n?{minX:Math.min(t.minX,n.minX),minY:Math.min(t.minY,n.minY),maxX:Math.max(t.maxX,n.maxX),maxY:Math.max(t.maxY,n.maxY)}:t||n}function de(t,n){var e=t.get("startArrowShape"),r=t.get("endArrowShape");return e&&(n=pe(n,e.getCanvasBBox())),r&&(n=pe(n,r.getCanvasBBox())),n}var ge=null;function ve(){if(!ge){var t=document.createElement("canvas");t.width=1,t.height=1,ge=t.getContext("2d")}return ge}function ye(t,n,e){var r=1;return Object(a.isString)(t)&&(r=t.split("\n").length),r>1?n*r+function(t,n){return n?n-t:.14*t}(n,e)*(r-1):n}function me(t){var n=t.fontSize,e=t.fontFamily,r=t.fontWeight;return[t.fontStyle,t.fontVariant,r,n+"px",e].join(" ").trim()}var xe=e(12);function be(t,n){var e=t.prePoint,r=t.currentPoint,i=t.nextPoint,o=Math.pow(r[0]-e[0],2)+Math.pow(r[1]-e[1],2),u=Math.pow(r[0]-i[0],2)+Math.pow(r[1]-i[1],2),s=Math.pow(e[0]-i[0],2)+Math.pow(e[1]-i[1],2),c=Math.acos((o+u-s)/(2*Math.sqrt(o)*Math.sqrt(u)));if(!c||0===Math.sin(c)||Object(a.isNumberEqual)(c,0))return{xExtra:0,yExtra:0};var f=Math.abs(Math.atan2(i[1]-r[1],i[0]-r[0])),h=Math.abs(Math.atan2(i[0]-r[0],i[1]-r[1]));return f=f>Math.PI/2?Math.PI-f:f,h=h>Math.PI/2?Math.PI-h:h,{xExtra:Math.cos(c/2-f)*(n/2*(1/Math.sin(c/2)))-n/2||0,yExtra:Math.cos(h-c/2)*(n/2*(1/Math.sin(c/2)))-n/2||0}}se("rect",fe),se("image",fe),se("circle",he),se("marker",he),se("polyline",(function(t){for(var n=t.attr().points,e=[],r=[],i=0;i0&&(i=1/Math.sqrt(i)),t[0]=n[0]*i,t[1]=n[1]*i,t}function O(t,n){return t[0]*n[0]+t[1]*n[1]}function S(t,n,e){var r=n[0]*e[1]-n[1]*e[0];return t[0]=t[1]=0,t[2]=r,t}function k(t,n,e,r){var i=n[0],a=n[1];return t[0]=i+r*(e[0]-i),t[1]=a+r*(e[1]-a),t}function j(t,n){n=n||1;var e=2*r.c()*Math.PI;return t[0]=Math.cos(e)*n,t[1]=Math.sin(e)*n,t}function T(t,n,e){var r=n[0],i=n[1];return t[0]=e[0]*r+e[2]*i,t[1]=e[1]*r+e[3]*i,t}function B(t,n,e){var r=n[0],i=n[1];return t[0]=e[0]*r+e[2]*i+e[4],t[1]=e[1]*r+e[3]*i+e[5],t}function E(t,n,e){var r=n[0],i=n[1];return t[0]=e[0]*r+e[3]*i+e[6],t[1]=e[1]*r+e[4]*i+e[7],t}function I(t,n,e){var r=n[0],i=n[1];return t[0]=e[0]*r+e[4]*i+e[12],t[1]=e[1]*r+e[5]*i+e[13],t}function F(t,n,e,r){var i=n[0]-e[0],a=n[1]-e[1],o=Math.sin(r),u=Math.cos(r);return t[0]=i*u-a*o+e[0],t[1]=i*o+a*u+e[1],t}function X(t,n){var e=t[0],r=t[1],i=n[0],a=n[1],o=Math.sqrt(e*e+r*r)*Math.sqrt(i*i+a*a),u=o&&(e*i+r*a)/o;return Math.acos(Math.min(Math.max(u,-1),1))}function D(t){return t[0]=0,t[1]=0,t}function q(t){return"vec2("+t[0]+", "+t[1]+")"}function Y(t,n){return t[0]===n[0]&&t[1]===n[1]}function N(t,n){var e=t[0],i=t[1],a=n[0],o=n[1];return Math.abs(e-a)<=r.b*Math.max(1,Math.abs(e),Math.abs(a))&&Math.abs(i-o)<=r.b*Math.max(1,Math.abs(i),Math.abs(o))}var R,L=w,z=f,W=h,V=l,G=b,H=M,Q=_,Z=(R=i(),function(t,n,e,r,i,a){var o,u;for(n||(n=2),e||(e=0),u=r?Math.min(r*n+e,t.length):t.length,o=e;ow?M:w,S=M>w?1:M/w,k=M>w?w/M:1;n.translate(x,b),n.rotate(A),n.scale(S,k),n.arc(0,0,O,_,P,1-C),n.scale(1/S,1/k),n.rotate(-A),n.translate(-x,-b)}break;case"Z":n.closePath()}if("Z"===d)c=f;else{var j=p.length;c=[p[j-2],p[j-1]]}}}},n.refreshElement=function(t,n){var e=t.get("canvas");e&&("remove"===n&&(t._cacheCanvasBBox=t.get("cacheCanvasBBox")),t.get("hasChanged")||(t.set("hasChanged",!0),t.cfg.parent&&t.cfg.parent.get("hasChanged")||(e.refreshElement(t,n,e),e.get("autoDraw")&&e.draw())))},n.getRefreshRegion=l,n.getMergedRegion=function(t){if(!t.length)return null;var n=[],e=[],i=[],a=[];return r.each(t,(function(t){var r=l(t);r&&(n.push(r.minX),e.push(r.minY),i.push(r.maxX),a.push(r.maxY))})),{minX:r.min(n),minY:r.min(e),maxX:r.max(i),maxY:r.max(a)}},n.mergeView=function(t,n){return t&&n&&o.intersectRect(t,n)?{minX:Math.max(t.minX,n.minX),minY:Math.max(t.minY,n.minY),maxX:Math.min(t.maxX,n.maxX),maxY:Math.min(t.maxY,n.maxY)}:null}},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.addEndArrow=n.addStartArrow=n.getShortenOffset=void 0;var r=e(2),i=e(8),a=Math.sin,o=Math.cos,u=Math.atan2,s=Math.PI;function c(t,n,e,r,c,f,h){var l=n.stroke,p=n.lineWidth,d=u(r-f,e-c),g=new i.Path({type:"path",canvas:t.get("canvas"),isArrowShape:!0,attrs:{path:"M"+10*o(s/6)+","+10*a(s/6)+" L0,0 L"+10*o(s/6)+",-"+10*a(s/6),stroke:l,lineWidth:p}});g.translate(c,f),g.rotateAtPoint(c,f,d),t.set(h?"startArrowShape":"endArrowShape",g)}function f(t,n,e,s,c,f,h){var l=n.startArrow,p=n.endArrow,d=n.stroke,g=n.lineWidth,v=h?l:p,y=v.d,m=v.fill,x=v.stroke,b=v.lineWidth,M=r.__rest(v,["d","fill","stroke","lineWidth"]),w=u(s-f,e-c);y&&(c-=o(w)*y,f-=a(w)*y);var _=new i.Path({type:"path",canvas:t.get("canvas"),isArrowShape:!0,attrs:r.__assign(r.__assign({},M),{stroke:x||d,lineWidth:b||g,fill:m})});_.translate(c,f),_.rotateAtPoint(c,f,w),t.set(h?"startArrowShape":"endArrowShape",_)}n.getShortenOffset=function(t,n,e,r,i){var s=u(r-n,e-t);return{dx:o(s)*i,dy:a(s)*i}},n.addStartArrow=function(t,n,e,r,i,a){"object"==typeof n.startArrow?f(t,n,e,r,i,a,!0):n.startArrow?c(t,n,e,r,i,a,!0):t.set("startArrowShape",null)},n.addEndArrow=function(t,n,e,r,i,a){"object"==typeof n.endArrow?f(t,n,e,r,i,a,!1):n.endArrow?c(t,n,e,r,i,a,!1):t.set("startArrowShape",null)}},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e(3);n.default=function(t,n,e,i,a,o,u){var s=Math.min(t,e),c=Math.max(t,e),f=Math.min(n,i),h=Math.max(n,i),l=a/2;return o>=s-l&&o<=c+l&&u>=f-l&&u<=h+l&&r.Line.pointToLine(t,n,e,i,o,u)<=a/2}},function(t,n,e){"use strict";e.r(n),e.d(n,"parsePath",(function(){return o})),e.d(n,"catmullRom2Bezier",(function(){return u})),e.d(n,"fillPath",(function(){return f})),e.d(n,"fillPathByDiff",(function(){return l})),e.d(n,"formatPath",(function(){return g})),e.d(n,"pathIntersection",(function(){return D})),e.d(n,"parsePathArray",(function(){return Y})),e.d(n,"parsePathString",(function(){return b})),e.d(n,"path2Curve",(function(){return O})),e.d(n,"path2Absolute",(function(){return _})),e.d(n,"reactPath",(function(){return v})),e.d(n,"getArcParams",(function(){return W})),e.d(n,"path2Segments",(function(){return G})),e.d(n,"getLineIntersect",(function(){return Q})),e.d(n,"isPolygonsIntersect",(function(){return tt})),e.d(n,"isPointInPolygon",(function(){return $}));var r=e(0),i=/[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/gi,a=/[^\s\,]+/gi;var o=function(t){var n=t||[];return Object(r.isArray)(n)?n:Object(r.isString)(n)?(n=n.match(i),Object(r.each)(n,(function(t,e){if((t=t.match(a))[0].length>1){var i=t[0].charAt(0);t.splice(1,0,t[0].substr(1)),t[0]=i}Object(r.each)(t,(function(n,e){isNaN(n)||(t[e]=+n)})),n[e]=t})),n):void 0};function u(t,n){for(var e=[],r=0,i=t.length;i-2*!n>r;r+=2){var a=[{x:+t[r-2],y:+t[r-1]},{x:+t[r],y:+t[r+1]},{x:+t[r+2],y:+t[r+3]},{x:+t[r+4],y:+t[r+5]}];n?r?i-4===r?a[3]={x:+t[0],y:+t[1]}:i-2===r&&(a[2]={x:+t[0],y:+t[1]},a[3]={x:+t[2],y:+t[3]}):a[0]={x:+t[i-2],y:+t[i-1]}:i-4===r?a[3]=a[2]:r||(a[0]={x:+t[r],y:+t[r+1]}),e.push(["C",(-a[0].x+6*a[1].x+a[2].x)/6,(-a[0].y+6*a[1].y+a[2].y)/6,(a[1].x+6*a[2].x-a[3].x)/6,(a[1].y+6*a[2].y-a[3].y)/6,a[2].x,a[2].y])}return e}function s(t,n){var e=[],r=[];return t.length&&function t(n,i){if(1===n.length)e.push(n[0]),r.push(n[0]);else{for(var a=[],o=0;o=3&&(3===t.length&&n.push("Q"),n=n.concat(t[1])),2===t.length&&n.push("L"),n=n.concat(t[t.length-1])}))}(t,n,e));else{var i=[].concat(t);"M"===i[0]&&(i[0]="L");for(var a=0;a<=e-1;a++)r.push(i)}return r}function f(t,n){if(1===t.length)return t;var e=t.length-1,r=n.length-1,i=e/r,a=[];if(1===t.length&&"M"===t[0][0]){for(var o=0;o=0;c--)u=o[c].index,"add"===o[c].type?t.splice(u,0,[].concat(t[u])):t.splice(u,1)}if((i=t.length)0)){t[r]=n[r];break}e=d(e,t[r-1],1)}t[r]=["Q"].concat(e.reduce((function(t,n){return t.concat(n)}),[]));break;case"T":t[r]=["T"].concat(e[0]);break;case"C":if(e.length<3){if(!(r>0)){t[r]=n[r];break}e=d(e,t[r-1],2)}t[r]=["C"].concat(e.reduce((function(t,n){return t.concat(n)}),[]));break;case"S":if(e.length<2){if(!(r>0)){t[r]=n[r];break}e=d(e,t[r-1],1)}t[r]=["S"].concat(e.reduce((function(t,n){return t.concat(n)}),[]));break;default:t[r]=n[r]}return t}function v(t,n,e,r,i){return i?[["M",+t+ +i,n],["l",e-2*i,0],["a",i,i,0,0,1,i,i],["l",0,r-2*i],["a",i,i,0,0,1,-i,i],["l",2*i-e,0],["a",i,i,0,0,1,-i,-i],["l",0,2*i-r],["a",i,i,0,0,1,i,-i],["z"]]:[["M",t,n],["l",e,0],["l",0,r],["l",-e,0],["z"]]}var y="\t\n\v\f\r   ᠎              \u2028\u2029",m=new RegExp("([a-z])["+y+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+y+"]*,?["+y+"]*)+)","ig"),x=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+y+"]*,?["+y+"]*","ig");function b(t){if(!t)return null;if(Object(r.isArray)(t))return t;var n={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},e=[];return String(t).replace(m,(function(t,r,i){var a=[],o=r.toLowerCase();if(i.replace(x,(function(t,n){n&&a.push(+n)})),"m"===o&&a.length>2&&(e.push([r].concat(a.splice(0,2))),o="l",r="m"===r?"l":"L"),"o"===o&&1===a.length&&e.push([r,a[0]]),"r"===o)e.push([r].concat(a));else for(;a.length>=n[o]&&(e.push([r].concat(a.splice(0,n[o]))),n[o]););return""})),e}var M=/[a-z]/;function w(t,n){return[n[0]+(n[0]-t[0]),n[1]+(n[1]-t[1])]}function _(t){var n=b(t);if(!n||!n.length)return[["M",0,0]];for(var e=!1,r=0;r=0){e=!0;break}}if(!e)return n;var a=[],o=0,u=0,s=0,c=0,f=0,h=n[0];"M"!==h[0]&&"m"!==h[0]||(s=o=+h[1],c=u=+h[2],f++,a[0]=["M",o,u]);r=f;for(var l=n.length;r1&&(e*=M=Math.sqrt(M),r*=M);var w=e*e,_=r*r,A=(a===o?-1:1)*Math.sqrt(Math.abs((w*_-w*b*b-_*x*x)/(w*b*b+_*x*x)));p=A*e*b/r+(t+u)/2,d=A*-r*x/e+(n+s)/2,h=Math.asin(Number(((n-d)/r).toFixed(9))),l=Math.asin(Number(((s-d)/r).toFixed(9))),h=tl&&(h-=2*Math.PI),!o&&l>h&&(l-=2*Math.PI)}var C=l-h;if(Math.abs(C)>g){var O=l,S=u,k=s;l=h+g*(o&&l>h?1:-1),u=p+e*Math.cos(l),s=d+r*Math.sin(l),y=P(u,s,e,r,i,0,o,S,k,[l,O,p,d])}C=l-h;var j=Math.cos(h),T=Math.sin(h),B=Math.cos(l),E=Math.sin(l),I=Math.tan(C/4),F=4/3*e*I,X=4/3*r*I,D=[t,n],q=[t+F*T,n-X*j],Y=[u+F*E,s-X*B],N=[u,s];if(q[0]=2*D[0]-q[0],q[1]=2*D[1]-q[1],c)return[q,Y,N].concat(y);for(var R=[],L=0,z=(y=[q,Y,N].concat(y).join().split(",")).length;L7){t[n].shift();for(var a=t[n];a.length;)u[n]="A",i&&(s[n]="A"),t.splice(n++,0,["C"].concat(a.splice(0,6)));t.splice(n,1),e=Math.max(r.length,i&&i.length||0)}},p=function(t,n,a,o,u){t&&n&&"M"===t[u][0]&&"M"!==n[u][0]&&(n.splice(u,0,["M",o.x,o.y]),a.bx=0,a.by=0,a.x=t[u][1],a.y=t[u][2],e=Math.max(r.length,i&&i.length||0))};e=Math.max(r.length,i&&i.length||0);for(var d=0;d1?1:s<0?0:s)/2,f=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],h=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],l=0,p=0;p<12;p++){var d=c*f[p]+c,g=S(d,t,e,i,o),v=S(d,n,r,a,u),y=g*g+v*v;l+=h[p]*Math.sqrt(y)}return c*l},j=function(t,n,e,r,i,a,o,u){for(var s,c,f,h,l=[],p=[[],[]],d=0;d<2;++d)if(0===d?(c=6*t-12*e+6*i,s=-3*t+9*e-9*i+3*o,f=3*e-3*t):(c=6*n-12*r+6*a,s=-3*n+9*r-9*a+3*u,f=3*r-3*n),Math.abs(s)<1e-12){if(Math.abs(c)<1e-12)continue;(h=-f/c)>0&&h<1&&l.push(h)}else{var g=c*c-4*f*s,v=Math.sqrt(g);if(!(g<0)){var y=(-c+v)/(2*s);y>0&&y<1&&l.push(y);var m=(-c-v)/(2*s);m>0&&m<1&&l.push(m)}}for(var x,b=l.length,M=b;b--;)x=1-(h=l[b]),p[0][b]=x*x*x*t+3*x*x*h*e+3*x*h*h*i+h*h*h*o,p[1][b]=x*x*x*n+3*x*x*h*r+3*x*h*h*a+h*h*h*u;return p[0][M]=t,p[1][M]=n,p[0][M+1]=o,p[1][M+1]=u,p[0].length=p[1].length=M+2,{min:{x:Math.min.apply(0,p[0]),y:Math.min.apply(0,p[1])},max:{x:Math.max.apply(0,p[0]),y:Math.max.apply(0,p[1])}}},T=function(t,n,e,r,i,a,o,u){if(!(Math.max(t,e)Math.max(i,o)||Math.max(n,r)Math.max(a,u))){var s=(t-e)*(a-u)-(n-r)*(i-o);if(s){var c=((t*r-n*e)*(i-o)-(t-e)*(i*u-a*o))/s,f=((t*r-n*e)*(a-u)-(n-r)*(i*u-a*o))/s,h=+c.toFixed(2),l=+f.toFixed(2);if(!(h<+Math.min(t,e).toFixed(2)||h>+Math.max(t,e).toFixed(2)||h<+Math.min(i,o).toFixed(2)||h>+Math.max(i,o).toFixed(2)||l<+Math.min(n,r).toFixed(2)||l>+Math.max(n,r).toFixed(2)||l<+Math.min(a,u).toFixed(2)||l>+Math.max(a,u).toFixed(2)))return{x:c,y:f}}}},B=function(t,n,e){return n>=t.x&&n<=t.x+t.width&&e>=t.y&&e<=t.y+t.height},E=function(t,n,e,r){return null===t&&(t=n=e=r=0),null===n&&(n=t.y,e=t.width,r=t.height,t=t.x),{x:t,y:n,width:e,w:e,height:r,h:r,x2:t+e,y2:n+r,cx:t+e/2,cy:n+r/2,r1:Math.min(e,r)/2,r2:Math.max(e,r)/2,r0:Math.sqrt(e*e+r*r)/2,path:v(t,n,e,r),vb:[t,n,e,r].join(" ")}},I=function(t,n,e,i,a,o,u,s){Object(r.isArray)(t)||(t=[t,n,e,i,a,o,u,s]);var c=j.apply(null,t);return E(c.min.x,c.min.y,c.max.x-c.min.x,c.max.y-c.min.y)},F=function(t,n,e,r,i,a,o,u,s){var c=1-s,f=Math.pow(c,3),h=Math.pow(c,2),l=s*s,p=l*s,d=t+2*s*(e-t)+l*(i-2*e+t),g=n+2*s*(r-n)+l*(a-2*r+n),v=e+2*s*(i-e)+l*(o-2*i+e),y=r+2*s*(a-r)+l*(u-2*a+r);return{x:f*t+3*h*s*e+3*c*s*s*i+p*o,y:f*n+3*h*s*r+3*c*s*s*a+p*u,m:{x:d,y:g},n:{x:v,y:y},start:{x:c*t+s*e,y:c*n+s*r},end:{x:c*i+s*o,y:c*a+s*u},alpha:90-180*Math.atan2(d-v,g-y)/Math.PI}},X=function(t,n,e){if(!function(t,n){return t=E(t),n=E(n),B(n,t.x,t.y)||B(n,t.x2,t.y)||B(n,t.x,t.y2)||B(n,t.x2,t.y2)||B(t,n.x,n.y)||B(t,n.x2,n.y)||B(t,n.x,n.y2)||B(t,n.x2,n.y2)||(t.xn.x||n.xt.x)&&(t.yn.y||n.yt.y)}(I(t),I(n)))return e?0:[];for(var r=~~(k.apply(0,t)/8),i=~~(k.apply(0,n)/8),a=[],o=[],u={},s=e?0:[],c=0;c=0&&x<=1&&b>=0&&b<=1&&(e?s++:s.push({x:m.x,y:m.y,t1:x,t2:b}))}}return s};function D(t,n){return function(t,n,e){var r,i,a,o,u,s,c,f,h,l;t=O(t),n=O(n);for(var p=e?0:[],d=0,g=t.length;d1&&(e*=Math.sqrt(d),i*=Math.sqrt(d));var g=e*e*(p*p)+i*i*(l*l),v=g?Math.sqrt((e*e*(i*i)-g)/g):1;o===u&&(v*=-1),isNaN(v)&&(v=0);var y=i?v*e*p/i:0,m=e?v*-i*l/e:0,x=(s+f)/2+Math.cos(a)*y-Math.sin(a)*m,b=(c+h)/2+Math.sin(a)*y+Math.cos(a)*m,M=[(l-y)/e,(p-m)/i],w=[(-1*l-y)/e,(-1*p-m)/i],_=L([1,0],M),P=L(M,w);return R(M,w)<=-1&&(P=Math.PI),R(M,w)>=1&&(P=0),0===u&&P>0&&(P-=2*Math.PI),1===u&&P<0&&(P+=2*Math.PI),{cx:x,cy:b,rx:z(t,[f,h])?0:e,ry:z(t,[f,h])?0:i,startAngle:_,endAngle:_+P,xRotation:a,arcFlag:o,sweepFlag:u}}function V(t,n){return[n[0]+(n[0]-t[0]),n[1]+(n[1]-t[1])]}function G(t){for(var n=[],e=null,r=null,i=null,a=0,u=(t=o(t)).length,s=0;s=n&&t<=e};function Q(t,n,e,r){var i=e.x-t.x,a=e.y-t.y,o=n.x-t.x,u=n.y-t.y,s=r.x-e.x,c=r.y-e.y,f=o*c-u*s,h=null;if(f*f>.001*(o*o+u*u)*(s*s+c*c)){var l=(i*c-a*s)/f,p=(i*u-a*o)/f;H(l,0,1)&&H(p,0,1)&&(h={x:t.x+l*o,y:t.y+l*u})}return h}function Z(t){return Math.abs(t)<1e-6?0:t<0?-1:1}function U(t,n,e){return(e[0]-t[0])*(n[1]-t[1])==(n[0]-t[0])*(e[1]-t[1])&&Math.min(t[0],n[0])<=e[0]&&e[0]<=Math.max(t[0],n[0])&&Math.min(t[1],n[1])<=e[1]&&e[1]<=Math.max(t[1],n[1])}function $(t,n,e){var r=!1,i=t.length;if(i<=2)return!1;for(var a=0;a0!=Z(u[1]-e)>0&&Z(n-(e-o[1])*(o[0]-u[0])/(o[1]-u[1])-o[0])<0&&(r=!r)}return r}function K(t){for(var n=[],e=t.length,r=0;r1){var o=t[0],u=t[e-1];n.push({from:{x:u[0],y:u[1]},to:{x:o[0],y:o[1]}})}return n}function J(t){var n=t.map((function(t){return t[0]})),e=t.map((function(t){return t[1]}));return{minX:Math.min.apply(null,n),maxX:Math.max.apply(null,n),minY:Math.min.apply(null,e),maxY:Math.max.apply(null,e)}}function tt(t,n){if(t.length<2||n.length<2)return!1;var e,i,a=J(t),o=J(n);if(e=a,(i=o).minX>e.maxX||i.maxXe.maxY||i.maxY0&&(a=1/Math.sqrt(a)),t[0]=n[0]*a,t[1]=n[1]*a,t[2]=n[2]*a,t}function O(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function S(t,n,e){var r=n[0],i=n[1],a=n[2],o=e[0],u=e[1],s=e[2];return t[0]=i*s-a*u,t[1]=a*o-r*s,t[2]=r*u-i*o,t}function k(t,n,e,r){var i=n[0],a=n[1],o=n[2];return t[0]=i+r*(e[0]-i),t[1]=a+r*(e[1]-a),t[2]=o+r*(e[2]-o),t}function j(t,n,e,r,i,a){var o=a*a,u=o*(2*a-3)+1,s=o*(a-2)+a,c=o*(a-1),f=o*(3-2*a);return t[0]=n[0]*u+e[0]*s+r[0]*c+i[0]*f,t[1]=n[1]*u+e[1]*s+r[1]*c+i[1]*f,t[2]=n[2]*u+e[2]*s+r[2]*c+i[2]*f,t}function T(t,n,e,r,i,a){var o=1-a,u=o*o,s=a*a,c=u*o,f=3*a*u,h=3*s*o,l=s*a;return t[0]=n[0]*c+e[0]*f+r[0]*h+i[0]*l,t[1]=n[1]*c+e[1]*f+r[1]*h+i[1]*l,t[2]=n[2]*c+e[2]*f+r[2]*h+i[2]*l,t}function B(t,n){n=n||1;var e=2*r.c()*Math.PI,i=2*r.c()-1,a=Math.sqrt(1-i*i)*n;return t[0]=Math.cos(e)*a,t[1]=Math.sin(e)*a,t[2]=i*n,t}function E(t,n,e){var r=n[0],i=n[1],a=n[2],o=e[3]*r+e[7]*i+e[11]*a+e[15];return o=o||1,t[0]=(e[0]*r+e[4]*i+e[8]*a+e[12])/o,t[1]=(e[1]*r+e[5]*i+e[9]*a+e[13])/o,t[2]=(e[2]*r+e[6]*i+e[10]*a+e[14])/o,t}function I(t,n,e){var r=n[0],i=n[1],a=n[2];return t[0]=r*e[0]+i*e[3]+a*e[6],t[1]=r*e[1]+i*e[4]+a*e[7],t[2]=r*e[2]+i*e[5]+a*e[8],t}function F(t,n,e){var r=e[0],i=e[1],a=e[2],o=e[3],u=n[0],s=n[1],c=n[2],f=i*c-a*s,h=a*u-r*c,l=r*s-i*u,p=i*l-a*h,d=a*f-r*l,g=r*h-i*f,v=2*o;return f*=v,h*=v,l*=v,p*=2,d*=2,g*=2,t[0]=u+f+p,t[1]=s+h+d,t[2]=c+l+g,t}function X(t,n,e,r){var i=[],a=[];return i[0]=n[0]-e[0],i[1]=n[1]-e[1],i[2]=n[2]-e[2],a[0]=i[0],a[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),a[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),t[0]=a[0]+e[0],t[1]=a[1]+e[1],t[2]=a[2]+e[2],t}function D(t,n,e,r){var i=[],a=[];return i[0]=n[0]-e[0],i[1]=n[1]-e[1],i[2]=n[2]-e[2],a[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),a[1]=i[1],a[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),t[0]=a[0]+e[0],t[1]=a[1]+e[1],t[2]=a[2]+e[2],t}function q(t,n,e,r){var i=[],a=[];return i[0]=n[0]-e[0],i[1]=n[1]-e[1],i[2]=n[2]-e[2],a[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),a[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),a[2]=i[2],t[0]=a[0]+e[0],t[1]=a[1]+e[1],t[2]=a[2]+e[2],t}function Y(t,n){var e=t[0],r=t[1],i=t[2],a=n[0],o=n[1],u=n[2],s=Math.sqrt(e*e+r*r+i*i)*Math.sqrt(a*a+o*o+u*u),c=s&&O(t,n)/s;return Math.acos(Math.min(Math.max(c,-1),1))}function N(t){return t[0]=0,t[1]=0,t[2]=0,t}function R(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function L(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]}function z(t,n){var e=t[0],i=t[1],a=t[2],o=n[0],u=n[1],s=n[2];return Math.abs(e-o)<=r.b*Math.max(1,Math.abs(e),Math.abs(o))&&Math.abs(i-u)<=r.b*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(a-s)<=r.b*Math.max(1,Math.abs(a),Math.abs(s))}var W,V=h,G=l,H=p,Q=M,Z=w,U=o,$=_,K=(W=i(),function(t,n,e,r,i,a){var o,u;for(n||(n=3),e||(e=0),u=r?Math.min(r*n+e,t.length):t.length,o=e;o=0;return e?i?2*Math.PI-r:r:i?r:2*Math.PI-r}function G(t,n,e){return e?(t[0]=n[1],t[1]=-1*n[0]):(t[0]=-1*n[1],t[1]=n[0]),t}},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.parseRadius=n.parseStyle=n.parsePattern=n.parseRadialGradient=n.parseLineGradient=void 0;var r=e(4),i=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,a=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,o=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,u=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;function s(t,n){var e=t.match(u);r.each(e,(function(t){var e=t.split(":");n.addColorStop(e[0],e[1])}))}function c(t,n,e){var r,a,o=i.exec(e),u=parseFloat(o[1])%360*(Math.PI/180),c=o[2],f=n.getBBox();u>=0&&u<.5*Math.PI?(r={x:f.minX,y:f.minY},a={x:f.maxX,y:f.maxY}):.5*Math.PI<=u&&u1&&(e*=Math.sqrt(v),i*=Math.sqrt(v));var y=e*e*(g*g)+i*i*(d*d),m=y?Math.sqrt((e*e*(i*i)-y)/y):1;s===c&&(m*=-1),isNaN(m)&&(m=0);var x=i?m*e*g/i:0,b=e?m*-i*d/e:0,M=(f+l)/2+Math.cos(u)*x-Math.sin(u)*b,w=(h+p)/2+Math.sin(u)*x+Math.cos(u)*b,_=[(d-x)/e,(g-b)/i],P=[(-1*d-x)/e,(-1*g-b)/i],A=o([1,0],_),C=o(_,P);return a(_,P)<=-1&&(C=Math.PI),a(_,P)>=1&&(C=0),0===c&&C>0&&(C-=2*Math.PI),1===c&&C<0&&(C+=2*Math.PI),{cx:M,cy:w,rx:r.isSamePoint(t,[l,p])?0:e,ry:r.isSamePoint(t,[l,p])?0:i,startAngle:A,endAngle:A+C,xRotation:u,arcFlag:s,sweepFlag:c}}},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e(6);n.default=function(t,n,e){var i=r.getOffScreenContext();return t.createPath(i),i.isPointInPath(n,e)}},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});function r(t){return Math.abs(t)<1e-6?0:t<0?-1:1}function i(t,n,e){return(e[0]-t[0])*(n[1]-t[1])==(n[0]-t[0])*(e[1]-t[1])&&Math.min(t[0],n[0])<=e[0]&&e[0]<=Math.max(t[0],n[0])&&Math.min(t[1],n[1])<=e[1]&&e[1]<=Math.max(t[1],n[1])}n.default=function(t,n,e){var a=!1,o=t.length;if(o<=2)return!1;for(var u=0;u0!=r(c[1]-e)>0&&r(n-(e-s[1])*(s[0]-c[0])/(s[1]-c[1])-s[0])<0&&(a=!a)}return a}},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e(4);n.default=function(t,n,e,i,a,o,u,s){var c=(Math.atan2(s-n,u-t)+2*Math.PI)%(2*Math.PI);if(ca)return!1;var f={x:t+e*Math.cos(c),y:n+e*Math.sin(c)};return r.distance(f.x,f.y,u,s)<=o/2}},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e(11);n.default=function(t,n,e,i,a){var o=t.length;if(o<2)return!1;for(var u=0;u1)for(var e=1;e=c-f&&h<=c+f)},n.prototype.createPath=function(t){var n=this.attr(),e=n.x,r=n.y,i=n.r;t.beginPath(),t.arc(e,r,i,0,2*Math.PI,!1),t.closePath()},n}(i.default);n.default=o},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e(2);function i(t,n,e,r){return t/(e*e)+n/(r*r)}var a=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(n,t),n.prototype.getDefaultAttrs=function(){var n=t.prototype.getDefaultAttrs.call(this);return r.__assign(r.__assign({},n),{x:0,y:0,rx:0,ry:0})},n.prototype.isInStrokeOrPath=function(t,n,e,r,a){var o=this.attr(),u=a/2,s=o.x,c=o.y,f=o.rx,h=o.ry,l=(t-s)*(t-s),p=(n-c)*(n-c);return r&&e?i(l,p,f+u,h+u)<=1:r?i(l,p,f,h)<=1:!!e&&(i(l,p,f-u,h-u)>=1&&i(l,p,f+u,h+u)<=1)},n.prototype.createPath=function(t){var n=this.attr(),e=n.x,r=n.y,i=n.rx,a=n.ry;if(t.beginPath(),t.ellipse)t.ellipse(e,r,i,a,0,0,2*Math.PI,!1);else{var o=i>a?i:a,u=i>a?1:i/a,s=i>a?a/i:1;t.save(),t.translate(e,r),t.scale(u,s),t.arc(0,0,o,0,2*Math.PI),t.restore(),t.closePath()}},n}(e(5).default);n.default=a},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e(2),i=e(5),a=e(4);function o(t){return t instanceof HTMLElement&&a.isString(t.nodeName)&&"CANVAS"===t.nodeName.toUpperCase()}var u=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(n,t),n.prototype.getDefaultAttrs=function(){var n=t.prototype.getDefaultAttrs.call(this);return r.__assign(r.__assign({},n),{x:0,y:0,width:0,height:0})},n.prototype.initAttrs=function(t){this._setImage(t.img)},n.prototype.isStroke=function(){return!1},n.prototype.isOnlyHitBox=function(){return!0},n.prototype._afterLoading=function(){if(!0===this.get("toDraw")){var t=this.get("canvas");t?t.draw():this.createPath(this.get("context"))}},n.prototype._setImage=function(t){var n=this,e=this.attrs;if(a.isString(t)){var r=new Image;r.onload=function(){if(n.destroyed)return!1;n.attr("img",r),n.set("loading",!1),n._afterLoading();var t=n.get("callback");t&&t.call(n)},r.crossOrigin="Anonymous",r.src=t,this.set("loading",!0)}else t instanceof Image?(e.width||(e.width=t.width),e.height||(e.height=t.height)):o(t)&&(e.width||(e.width=Number(t.getAttribute("width"))),e.height||(e.height,Number(t.getAttribute("height"))))},n.prototype.onAttrChange=function(n,e,r){t.prototype.onAttrChange.call(this,n,e,r),"img"===n&&this._setImage(e)},n.prototype.createPath=function(t){if(this.get("loading"))return this.set("toDraw",!0),void this.set("context",t);var n=this.attr(),e=n.x,r=n.y,i=n.width,u=n.height,s=n.sx,c=n.sy,f=n.swidth,h=n.sheight,l=n.img;(l instanceof Image||o(l))&&(a.isNil(s)||a.isNil(c)||a.isNil(f)||a.isNil(h)?t.drawImage(l,e,r,i,u):t.drawImage(l,s,c,f,h,e,r,i,u))},n}(i.default);n.default=u},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e(2),i=e(3),a=e(5),o=e(11),u=e(10),s=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(n,t),n.prototype.getDefaultAttrs=function(){var n=t.prototype.getDefaultAttrs.call(this);return r.__assign(r.__assign({},n),{x1:0,y1:0,x2:0,y2:0,startArrow:!1,endArrow:!1})},n.prototype.initAttrs=function(t){this.setArrow()},n.prototype.onAttrChange=function(n,e,r){t.prototype.onAttrChange.call(this,n,e,r),this.setArrow()},n.prototype.setArrow=function(){var t=this.attr(),n=t.x1,e=t.y1,r=t.x2,i=t.y2,a=t.startArrow,o=t.endArrow;a&&u.addStartArrow(this,t,r,i,n,e),o&&u.addEndArrow(this,t,n,e,r,i)},n.prototype.isInStrokeOrPath=function(t,n,e,r,i){if(!e||!i)return!1;var a=this.attr(),u=a.x1,s=a.y1,c=a.x2,f=a.y2;return o.default(u,s,c,f,i,t,n)},n.prototype.createPath=function(t){var n=this.attr(),e=n.x1,r=n.y1,i=n.x2,a=n.y2,o=n.startArrow,s=n.endArrow,c={dx:0,dy:0},f={dx:0,dy:0};o&&o.d&&(c=u.getShortenOffset(e,r,i,a,n.startArrow.d)),s&&s.d&&(f=u.getShortenOffset(e,r,i,a,n.endArrow.d)),t.beginPath(),t.moveTo(e+c.dx,r+c.dy),t.lineTo(i-f.dx,a-f.dy)},n.prototype.afterDrawPath=function(t){var n=this.get("startArrowShape"),e=this.get("endArrowShape");n&&n.draw(t),e&&e.draw(t)},n.prototype.getTotalLength=function(){var t=this.attr(),n=t.x1,e=t.y1,r=t.x2,a=t.y2;return i.Line.length(n,e,r,a)},n.prototype.getPoint=function(t){var n=this.attr(),e=n.x1,r=n.y1,a=n.x2,o=n.y2;return i.Line.pointAt(e,r,a,o,t)},n}(a.default);n.default=s},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e(2),i=e(0),a=e(12),o=e(5),u=e(4),s=e(9),c={circle:function(t,n,e){return[["M",t-e,n],["A",e,e,0,1,0,t+e,n],["A",e,e,0,1,0,t-e,n]]},square:function(t,n,e){return[["M",t-e,n-e],["L",t+e,n-e],["L",t+e,n+e],["L",t-e,n+e],["Z"]]},diamond:function(t,n,e){return[["M",t-e,n],["L",t,n-e],["L",t+e,n],["L",t,n+e],["Z"]]},triangle:function(t,n,e){var r=e*Math.sin(1/3*Math.PI);return[["M",t-e,n+r],["L",t,n-r],["L",t+e,n+r],["Z"]]},"triangle-down":function(t,n,e){var r=e*Math.sin(1/3*Math.PI);return[["M",t-e,n-r],["L",t+e,n-r],["L",t,n+r],["Z"]]}},f=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(n,t),n.prototype.initAttrs=function(t){this._resetParamsCache()},n.prototype._resetParamsCache=function(){this.set("paramsCache",{})},n.prototype.onAttrChange=function(n,e,r){t.prototype.onAttrChange.call(this,n,e,r),-1!==["symbol","x","y","r","radius"].indexOf(n)&&this._resetParamsCache()},n.prototype.isOnlyHitBox=function(){return!0},n.prototype._getR=function(t){return i.isNil(t.r)?t.radius:t.r},n.prototype._getPath=function(){var t,e,r=this.attr(),i=r.x,o=r.y,s=r.symbol||"circle",c=this._getR(r);if(u.isFunction(s))e=(t=s)(i,o,c),e=a.path2Absolute(e);else{if(!(t=n.Symbols[s]))return console.warn(s+" marker is not supported."),null;e=t(i,o,c)}return e},n.prototype.createPath=function(t){var n=this._getPath(),e=this.get("paramsCache");s.drawPath(this,t,{path:n},e)},n.Symbols=c,n}(o.default);n.default=f},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e(2),i=e(3),a=e(0),o=e(5),u=e(12),s=e(9),c=e(18),f=e(19),h=e(38),l=e(10);function p(t,n,e){for(var r=!1,i=0;i=r[0]&&t<=r[1]&&(n=(t-r[0])/(r[1]-r[0]),e=i)}));var u=o[e];if(a.isNil(u)||a.isNil(e))return null;var s=u.length,c=o[e+1];return i.Cubic.pointAt(u[s-2],u[s-1],c[1],c[2],c[3],c[4],c[5],c[6],n)},n.prototype._calculateCurve=function(){var t=this.attr().path;this.set("curve",h.default.pathToCurve(t))},n.prototype._setTcache=function(){var t,n,e,r,o=0,u=0,s=[],c=this.get("curve");c&&(a.each(c,(function(t,n){e=c[n+1],r=t.length,e&&(o+=i.Cubic.length(t[r-2],t[r-1],e[1],e[2],e[3],e[4],e[5],e[6])||0)})),this.set("totalLength",o),0!==o?(a.each(c,(function(a,f){e=c[f+1],r=a.length,e&&((t=[])[0]=u/o,n=i.Cubic.length(a[r-2],a[r-1],e[1],e[2],e[3],e[4],e[5],e[6]),u+=n||0,t[1]=u/o,s.push(t))})),this.set("tCache",s)):this.set("tCache",[]))},n.prototype.getStartTangent=function(){var t,n=this.getSegments();if(n.length>1){var e=n[0].currentPoint,r=n[1].currentPoint,i=n[1].startTangent;t=[],i?(t.push([e[0]-i[0],e[1]-i[1]]),t.push([e[0],e[1]])):(t.push([r[0],r[1]]),t.push([e[0],e[1]]))}return t},n.prototype.getEndTangent=function(){var t,n=this.getSegments(),e=n.length;if(e>1){var r=n[e-2].currentPoint,i=n[e-1].currentPoint,a=n[e-1].endTangent;t=[],a?(t.push([i[0]-a[0],i[1]-a[1]]),t.push([i[0],i[1]])):(t.push([r[0],r[1]]),t.push([i[0],i[1]]))}return t},n}(o.default);n.default=d},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e(2),i=e(6),a=e(3),o=e(3),u=e(15),s=e(13),c=e(4),f=e(11),h=e(20),l=u.ext.transform;n.default=r.__assign({hasArc:function(t){for(var n=!1,e=t.length,r=0;r0&&r.push(i),{polygons:e,polylines:r}},isPointInStroke:function(t,n,e,r,i){for(var u=!1,p=n/2,d=0;dP?_:P,j=l(null,[["t",-M,-w],["r",-O],["s",1/(_>P?1:_/P),1/(_>P?P/_:1)]]);s.transformMat3(S,S,j),u=h.default(0,0,k,A,C,n,S[0],S[1])}if(u)break}}return u}},i.PathUtil)},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e(2),i=e(5),a=e(21),o=e(19),u=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(n,t),n.prototype.isInStrokeOrPath=function(t,n,e,r,i){var u=this.attr().points,s=!1;return e&&(s=a.default(u,i,t,n,!0)),!s&&r&&(s=o.default(u,t,n)),s},n.prototype.createPath=function(t){var n=this.attr().points;if(!(n.length<2)){t.beginPath();for(var e=0;e=r[0]&&t<=r[1]&&(n=(t-r[0])/(r[1]-r[0]),e=i)})),i.Line.pointAt(r[e][0],r[e][1],r[e+1][0],r[e+1][1],n)},n.prototype._setTcache=function(){var t=this.attr().points;if(t&&0!==t.length){var n=this.getTotalLength();if(!(n<=0)){var e,r,a=0,u=[];o.each(t,(function(o,s){t[s+1]&&((e=[])[0]=a/n,r=i.Line.length(o[0],o[1],t[s+1][0],t[s+1][1]),a+=r,e[1]=a/n,u.push(e))})),this.set("tCache",u)}}},n.prototype.getStartTangent=function(){var t=this.attr().points,n=[];return n.push([t[1][0],t[1][1]]),n.push([t[0][0],t[0][1]]),n},n.prototype.getEndTangent=function(){var t=this.attr().points,n=t.length-1,e=[];return e.push([t[n-1][0],t[n-1][1]]),e.push([t[n][0],t[n][1]]),e},n}(u.default);n.default=f},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e(2),i=e(5),a=e(16),o=e(4),u=e(42),s=e(43),c=e(18),f=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(n,t),n.prototype.getDefaultAttrs=function(){var n=t.prototype.getDefaultAttrs.call(this);return r.__assign(r.__assign({},n),{x:0,y:0,width:0,height:0,radius:0})},n.prototype.isInStrokeOrPath=function(t,n,e,r,i){var a=this.attr(),f=a.x,h=a.y,l=a.width,p=a.height,d=a.radius;if(d){var g=!1;return e&&(g=s.default(f,h,l,p,d,i,t,n)),!g&&r&&(g=c.default(this,t,n)),g}var v=i/2;return r&&e?o.inBox(f-v,h-v,l+v,p+v,t,n):r?o.inBox(f,h,l,p,t,n):e?u.default(f,h,l,p,i,t,n):void 0},n.prototype.createPath=function(t){var n=this.attr(),e=n.x,r=n.y,i=n.width,o=n.height,u=n.radius;if(t.beginPath(),0===u)t.rect(e,r,i,o);else{var s=a.parseRadius(u),c=s[0],f=s[1],h=s[2],l=s[3];t.moveTo(e+c,r),t.lineTo(e+i-f,r),0!==f&&t.arc(e+i-f,r+f,f,-Math.PI/2,0),t.lineTo(e+i,r+o-h),0!==h&&t.arc(e+i-h,r+o-h,h,0,Math.PI/2),t.lineTo(e+l,r+o),0!==l&&t.arc(e+l,r+o-l,l,Math.PI/2,Math.PI),t.lineTo(e,r+c),0!==c&&t.arc(e+c,r+c,c,Math.PI,1.5*Math.PI),t.closePath()}},n}(i.default);n.default=f},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e(4);n.default=function(t,n,e,i,a,o,u){var s=a/2;return r.inBox(t-s,n-s,e,a,o,u)||r.inBox(t+e-s,n-s,a,i,o,u)||r.inBox(t+s,n+i-s,e,a,o,u)||r.inBox(t-s,n+s,a,i,o,u)}},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e(11),i=e(20);n.default=function(t,n,e,a,o,u,s,c){return r.default(t+o,n,t+e-o,n,u,s,c)||r.default(t+e,n+o,t+e,n+a-o,u,s,c)||r.default(t+e-o,n+a,t+o,n+a,u,s,c)||r.default(t,n+a-o,t,n+o,u,s,c)||i.default(t+e-o,n+o,o,1.5*Math.PI,2*Math.PI,u,s,c)||i.default(t+e-o,n+a-o,o,0,.5*Math.PI,u,s,c)||i.default(t+o,n+a-o,o,.5*Math.PI,Math.PI,u,s,c)||i.default(t+o,n+o,o,Math.PI,1.5*Math.PI,u,s,c)}},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e(2),i=e(5),a=e(4),o=e(6),u=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(n,t),n.prototype.getDefaultAttrs=function(){var n=t.prototype.getDefaultAttrs.call(this);return r.__assign(r.__assign({},n),{x:0,y:0,text:null,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom"})},n.prototype.isOnlyHitBox=function(){return!0},n.prototype.initAttrs=function(t){this._assembleFont(),t.text&&this._setText(t.text)},n.prototype._assembleFont=function(){var t=this.attrs;t.font=o.assembleFont(t)},n.prototype._setText=function(t){var n=null;a.isString(t)&&-1!==t.indexOf("\n")&&(n=t.split("\n")),this.set("textArr",n)},n.prototype.onAttrChange=function(n,e,r){t.prototype.onAttrChange.call(this,n,e,r),n.startsWith("font")&&this._assembleFont(),"text"===n&&this._setText(e)},n.prototype._getSpaceingY=function(){var t=this.attrs,n=t.lineHeight,e=1*t.fontSize;return n?n-e:.14*e},n.prototype._drawTextArr=function(t,n,e){var r,i=this.attrs,u=i.textBaseline,s=i.x,c=i.y,f=1*i.fontSize,h=this._getSpaceingY(),l=o.getTextHeight(i.text,i.fontSize,i.lineHeight);a.each(n,(function(n,i){r=c+i*(h+f)-l+f,"middle"===u&&(r+=l-f-(l-f)/2),"top"===u&&(r+=l-f),a.isNil(n)||(e?t.fillText(n,s,r):t.strokeText(n,s,r))}))},n.prototype._drawText=function(t,n){var e=this.attr(),r=e.x,i=e.y,o=this.get("textArr");if(o)this._drawTextArr(t,o,n);else{var u=e.text;a.isNil(u)||(n?t.fillText(u,r,i):t.strokeText(u,r,i))}},n.prototype.strokeAndFill=function(t){var n=this.attrs,e=n.lineWidth,r=n.opacity,i=n.strokeOpacity,o=n.fillOpacity;this.isStroke()&&e>0&&(a.isNil(i)||1===i||(t.globalAlpha=r),this.stroke(t)),this.isFill()&&(a.isNil(o)||1===o?this.fill(t):(t.globalAlpha=o,this.fill(t),t.globalAlpha=r)),this.afterDrawPath(t)},n.prototype.fill=function(t){this._drawText(t,!0)},n.prototype.stroke=function(t){this._drawText(t,!1)},n}(i.default);n.default=u},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),e(2).__exportStar(e(6),n)},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),e(2).__exportStar(e(6),n)},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e(2),i=e(6),a=e(48),o=e(8),u=e(14),s=e(4),c=e(9),f=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(n,t),n.prototype.getDefaultCfg=function(){var n=t.prototype.getDefaultCfg.call(this);return n.renderer="canvas",n.autoDraw=!0,n.localRefresh=!0,n.refreshElements=[],n.clipView=!0,n.quickHit=!1,n},n.prototype.onCanvasChange=function(t){"attr"!==t&&"sort"!==t&&"changeSize"!==t||(this.set("refreshElements",[this]),this.draw())},n.prototype.getShapeBase=function(){return o},n.prototype.getGroupBase=function(){return u.default},n.prototype.getPixelRatio=function(){var t=this.get("pixelRatio")||s.getPixelRatio();return t>=1?Math.ceil(t):1},n.prototype.getViewRange=function(){return{minX:0,minY:0,maxX:this.cfg.width,maxY:this.cfg.height}},n.prototype.createDom=function(){var t=document.createElement("canvas"),n=t.getContext("2d");return this.set("context",n),t},n.prototype.setDOMSize=function(n,e){t.prototype.setDOMSize.call(this,n,e);var r=this.get("context"),i=this.get("el"),a=this.getPixelRatio();i.width=a*n,i.height=a*e,a>1&&r.scale(a,a)},n.prototype.clear=function(){t.prototype.clear.call(this),this._clearFrame();var n=this.get("context"),e=this.get("el");n.clearRect(0,0,e.width,e.height)},n.prototype.getShape=function(n,e){return this.get("quickHit")?a.getShape(this,n,e):t.prototype.getShape.call(this,n,e,null)},n.prototype._getRefreshRegion=function(){var t,n=this.get("refreshElements"),e=this.getViewRange();n.length&&n[0]===this?t=e:(t=c.getMergedRegion(n))&&(t.minX=Math.floor(t.minX),t.minY=Math.floor(t.minY),t.maxX=Math.ceil(t.maxX),t.maxY=Math.ceil(t.maxY),t.maxY+=1,this.get("clipView")&&(t=c.mergeView(t,e)));return t},n.prototype.refreshElement=function(t){this.get("refreshElements").push(t)},n.prototype._clearFrame=function(){var t=this.get("drawFrame");t&&(s.clearAnimationFrame(t),this.set("drawFrame",null),this.set("refreshElements",[]))},n.prototype.draw=function(){var t=this.get("drawFrame");this.get("autoDraw")&&t||this._startDraw()},n.prototype._drawAll=function(){var t=this.get("context"),n=this.get("el"),e=this.getChildren();t.clearRect(0,0,n.width,n.height),c.applyAttrsToContext(t,this),c.drawChildren(t,e),this.set("refreshElements",[])},n.prototype._drawRegion=function(){var t=this.get("context"),n=this.get("refreshElements"),e=this.getChildren(),r=this._getRefreshRegion();r?(t.clearRect(r.minX,r.minY,r.maxX-r.minX,r.maxY-r.minY),t.save(),t.beginPath(),t.rect(r.minX,r.minY,r.maxX-r.minX,r.maxY-r.minY),t.clip(),c.applyAttrsToContext(t,this),c.checkRefresh(this,e,r),c.drawChildren(t,e,r),t.restore()):n.length&&c.clearChanged(n),s.each(n,(function(t){t.get("hasChanged")&&t.set("hasChanged",!1)})),this.set("refreshElements",[])},n.prototype._startDraw=function(){var t=this,n=this.get("drawFrame");n||(n=s.requestAnimationFrame((function(){t.get("localRefresh")?t._drawRegion():t._drawAll(),t.set("drawFrame",null)})),this.set("drawFrame",n))},n.prototype.skipDraw=function(){},n.prototype.removeDom=function(){var t=this.get("el");t.width=0,t.height=0,t.parentNode.removeChild(t)},n}(i.AbstractCanvas);n.default=f},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.getShape=void 0;var r=e(6);function i(t,n,e){var i=t.getTotalMatrix();if(i){var a=function(t,n){if(n){var e=r.invert(n);return r.multiplyVec2(e,t)}return t}([n,e,1],i);return[a[0],a[1]]}return[n,e]}function a(t,n,e){if(t.isCanvas&&t.isCanvas())return!0;if(!r.isAllowCapture(t)||!1===t.cfg.isInView)return!1;if(t.cfg.clipShape){var a=i(t,n,e),o=a[0],u=a[1];if(t.isClipped(o,u))return!1}var s=t.cfg.cacheCanvasBBox||t.getCanvasBBox();return n>=s.minX&&n<=s.maxX&&e>=s.minY&&e<=s.maxY}n.getShape=function t(n,e,r){if(!a(n,e,r))return null;for(var o=null,u=n.getChildren(),s=u.length-1;s>=0;s--){var c=u[s];if(c.isGroup())o=t(c,e,r);else if(a(c,e,r)){var f=c,h=i(c,e,r),l=h[0],p=h[1];f.isInShape(l,p)&&(o=c)}if(o)break}return o}}])})); //# sourceMappingURL=g.min.js.map