webpackJsonp([5],{"/p1R":function(t,e){},"5R7W":function(t,e){},GRR7:function(t,e,i){"use strict";(function(t,r){var n,s,a;(this||window).Two=function(e){var n="undefined"!=typeof window?window:void 0!==t?t:null,s=Object.prototype.toString,a={_indexAmount:0,natural:{slice:Array.prototype.slice,indexOf:Array.prototype.indexOf,keys:Object.keys,bind:Function.prototype.bind,create:Object.create},identity:function(t){return t},isArguments:function(t){return"[object Arguments]"===s.call(t)},isFunction:function(t){return"[object Function]"===s.call(t)},isString:function(t){return"[object String]"===s.call(t)},isNumber:function(t){return"[object Number]"===s.call(t)},isDate:function(t){return"[object Date]"===s.call(t)},isRegExp:function(t){return"[object RegExp]"===s.call(t)},isError:function(t){return"[object Error]"===s.call(t)},isFinite:function(t){return isFinite(t)&&!isNaN(parseFloat(t))},isNaN:function(t){return a.isNumber(t)&&t!==+t},isBoolean:function(t){return!0===t||!1===t||"[object Boolean]"===s.call(t)},isNull:function(t){return null===t},isUndefined:function(t){return void 0===t},isEmpty:function(t){return null==t||(x&&(a.isArray(t)||a.isString(t)||a.isArguments(t))?0===t.length:0===a.keys(t).length)},isElement:function(t){return!(!t||1!==t.nodeType)},isArray:Array.isArray||function(t){return"[object Array]"===s.call(t)},isObject:function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},toArray:function(t){return t?a.isArray(t)?m.call(t):x(t)?a.map(t,a.identity):a.values(t):[]},range:function(t,e,i){null==e&&(e=t||0,t=0),i=i||1;for(var r=Math.max(Math.ceil((e-t)/i),0),n=Array(r),s=0;s=0&&i<=y},b={temp:n.document?n.document.createElement("div"):{},hasEventListeners:a.isFunction(n.addEventListener),bind:function(t,e,i,r){return this.hasEventListeners?t.addEventListener(e,i,!!r):t.attachEvent("on"+e,i),b},unbind:function(t,e,i,r){return b.hasEventListeners?t.removeEventListeners(e,i,!!r):t.detachEvent("on"+e,i),b},getRequestAnimationFrame:function(){var t,e=0,i=["ms","moz","webkit","o"],r=n.requestAnimationFrame;if(!r){for(var s=0;s0?t.transform.baseVal[0].matrix:t.getCTM?t.getCTM():null;if(a.isNull(f))break;var g=w.Utils.decomposeMatrix(f);e.translation.set(g.translateX,g.translateY),e.rotation=g.rotation,e.scale=new w.Vector(g.scaleX,g.scaleY);var _=parseFloat((h.x+"").replace("px")),p=parseFloat((h.y+"").replace("px"));_&&(e.translation.x=_),p&&(e.translation.y=p);break;case"viewBox":w.Utils.applySvgViewBox.call(this,e,o);break;case"visible":e.visible=o;break;case"stroke-linecap":e.cap=o;break;case"stroke-linejoin":e.join=o;break;case"stroke-miterlimit":e.miter=o;break;case"stroke-width":e.linewidth=parseFloat(o);break;case"opacity":case"stroke-opacity":case"fill-opacity":e instanceof w.Group||(e.opacity=parseFloat(o));break;case"fill":case"stroke":/url\(\#.*\)/i.test(o)?e[s]=this.getById(o.replace(/url\(\#(.*)\)/i,"$1")):e[s]=/none/i.test(o)?"transparent":o;break;case"id":e.id=o;break;case"class":case"className":e.classList=o.split(" ")}return h},read:{svg:function(t){var e=w.Utils.read.g.call(this,t);t.getAttribute("viewBox");return e},g:function(t){var e,i=new w.Group;e=w.Utils.getSvgStyles.call(this,t);for(var r=0,n=t.childNodes.length;r1&&(d=1);break;case"m":case"l":case"t":g.length>2&&(d=2);break;case"s":case"q":g.length>4&&(d=4);break;case"c":g.length>6&&(d=6);break;case"a":g.length>7&&(d=7)}if(d){for(a=0,l=g.length,c=0;a0)switch(u){case"m":o="l";break;case"M":o="L"}_.push(o+g.slice(a,a+d).join(" ")),c++}h=Array.prototype.concat.apply(h,_)}else h.push(t)});var d=[];if(a.each(h,function(t,e){var n,h,u,g,_,p,m,v,y,x,b,S,A=t[0],C=A.toLowerCase();switch(r=(r=(r=t.slice(1).trim()).replace(/(-?\d+(?:\.\d*)?)[eE]([+\-]?\d+)/g,function(t,e,i){return parseFloat(e)*f(10,i)})).split(/[\s,]+|(?=\s?[+\-])/),l=A===C,C){case"z":if(e>=c)o=!0;else{h=s.x,u=s.y,n=new w.Anchor(h,u,void 0,void 0,void 0,void 0,w.Commands.close);for(e=d.length-1;e>=0;e--){var k=d[e];if(/m/i.test(k.command)){s=k;break}}}break;case"m":case"l":i=void 0,h=parseFloat(r[0]),u=parseFloat(r[1]),n=new w.Anchor(h,u,void 0,void 0,void 0,void 0,/m/i.test(C)?w.Commands.move:w.Commands.line),l&&n.addSelf(s),s=n;break;case"h":case"v":var E=/h/i.test(C)?"x":"y",R=/x/i.test(E)?"y":"x";(n=new w.Anchor(void 0,void 0,void 0,void 0,void 0,void 0,w.Commands.line))[E]=parseFloat(r[0]),n[R]=s[R],l&&(n[E]+=s[E]),s=n;break;case"c":case"s":g=s.x,_=s.y,i||(i=new w.Vector),/c/i.test(C)?(p=parseFloat(r[0]),m=parseFloat(r[1]),v=parseFloat(r[2]),y=parseFloat(r[3]),x=parseFloat(r[4]),b=parseFloat(r[5])):(p=(S=M(s,i,l)).x,m=S.y,v=parseFloat(r[0]),y=parseFloat(r[1]),x=parseFloat(r[2]),b=parseFloat(r[3])),l&&(p+=g,m+=_,v+=g,y+=_,x+=g,b+=_),a.isObject(s.controls)||w.Anchor.AppendCurveProperties(s),s.controls.right.set(p-s.x,m-s.y),n=new w.Anchor(x,b,v-x,y-b,void 0,void 0,w.Commands.curve),s=n,i=n.controls.left;break;case"t":case"q":g=s.x,_=s.y,i||(i=new w.Vector),i.isZero()?(p=g,m=_):(p=i.x,m=i.y),/q/i.test(C)?(v=parseFloat(r[0]),y=parseFloat(r[1]),x=parseFloat(r[2]),b=parseFloat(r[3])):(v=(S=M(s,i,l)).x,y=S.y,x=parseFloat(r[0]),b=parseFloat(r[1])),l&&(p+=g,m+=_,v+=g,y+=_,x+=g,b+=_),a.isObject(s.controls)||w.Anchor.AppendCurveProperties(s),s.controls.right.set(p-s.x,m-s.y),n=new w.Anchor(x,b,v-x,y-b,void 0,void 0,w.Commands.curve),s=n,i=n.controls.left;break;case"a":g=s.x,_=s.y;var F=parseFloat(r[0]),O=parseFloat(r[1]),T=parseFloat(r[2]),P=parseFloat(r[3]),L=parseFloat(r[4]);x=parseFloat(r[5]),b=parseFloat(r[6]),l&&(x+=g,b+=_);var N=new w.Anchor(x,b);N.command=w.Commands.arc,N.rx=F,N.ry=O,N.xAxisRotation=T,N.largeArcFlag=P,N.sweepFlag=L,n=N,s=N,i=void 0}n&&(a.isArray(n)?d=d.concat(n):d.push(n))}),!(d.length<=1)){(n=new w.Path(d,o,void 0,!0).noStroke()).fill="black";var u=n.getBoundingClientRect(!0);return u.centroid={x:u.left+u.width/2,y:u.top+u.height/2},a.each(n.vertices,function(t){t.subSelf(u.centroid)}),n.translation.addSelf(u.centroid),w.Utils.applySvgAttributes.call(this,t,n,e),n}},circle:function(t,e){var i=parseFloat(t.getAttribute("cx")),r=parseFloat(t.getAttribute("cy")),n=parseFloat(t.getAttribute("r")),s=new w.Circle(i,r,n).noStroke();return s.fill="black",w.Utils.applySvgAttributes.call(this,t,s,e),s},ellipse:function(t,e){var i=parseFloat(t.getAttribute("cx")),r=parseFloat(t.getAttribute("cy")),n=parseFloat(t.getAttribute("rx")),s=parseFloat(t.getAttribute("ry")),a=new w.Ellipse(i,r,n,s).noStroke();return a.fill="black",w.Utils.applySvgAttributes.call(this,t,a,e),a},rect:function(t,e){var i=parseFloat(t.getAttribute("rx")),r=parseFloat(t.getAttribute("ry"));if(!a.isNaN(i)||!a.isNaN(r))return w.Utils.read["rounded-rect"](t);var n=parseFloat(t.getAttribute("x"))||0,s=parseFloat(t.getAttribute("y"))||0,o=parseFloat(t.getAttribute("width")),l=parseFloat(t.getAttribute("height")),h=o/2,c=l/2,d=new w.Rectangle(n+h,s+c,o,l).noStroke();return d.fill="black",w.Utils.applySvgAttributes.call(this,t,d,e),d},"rounded-rect":function(t,e){var i=parseFloat(t.getAttribute("x"))||0,r=parseFloat(t.getAttribute("y"))||0,n=parseFloat(t.getAttribute("rx"))||0,s=parseFloat(t.getAttribute("ry"))||0,a=parseFloat(t.getAttribute("width")),o=parseFloat(t.getAttribute("height")),l=a/2,h=o/2,c=new w.Vector(n,s),d=new w.RoundedRectangle(i+l,r+h,a,o,c).noStroke();return d.fill="black",w.Utils.applySvgAttributes.call(this,t,d,e),d},line:function(t,e){var i=parseFloat(t.getAttribute("x1")),r=parseFloat(t.getAttribute("y1")),n=parseFloat(t.getAttribute("x2")),s=parseFloat(t.getAttribute("y2")),a=new w.Line(i,r,n,s).noFill();return w.Utils.applySvgAttributes.call(this,t,a,e),a},lineargradient:function(t,e){for(var i=parseFloat(t.getAttribute("x1")),r=parseFloat(t.getAttribute("y1")),n=parseFloat(t.getAttribute("x2")),s=parseFloat(t.getAttribute("y2")),o=(n+i)/2,l=(s+r)/2,h=[],c=0;c1?d[1]:void 0;if(a.isNull(_))_=(d=!!p&&p.match(/stop\-opacity\:\s?([0-9\.\-]*)/))&&d.length>1?parseFloat(d[1]):1;h.push(new w.Gradient.Stop(f,g,_))}var m=new w.LinearGradient(i-o,r-l,n-o,s-l,h);return w.Utils.applySvgAttributes.call(this,t,m,e),m},radialgradient:function(t,e){var i=parseFloat(t.getAttribute("cx"))||0,r=parseFloat(t.getAttribute("cy"))||0,n=parseFloat(t.getAttribute("r")),s=parseFloat(t.getAttribute("fx")),o=parseFloat(t.getAttribute("fy"));a.isNaN(s)&&(s=i),a.isNaN(o)&&(o=r);for(var l=c(i+s)/2,h=c(r+o)/2,d=[],u=0;u1?f[1]:void 0;if(a.isNull(m))m=(f=!!v&&v.match(/stop\-opacity\:\s?([0-9\.\-]*)/))&&f.length>1?parseFloat(f[1]):1;d.push(new w.Gradient.Stop(_,p,m))}var y=new w.RadialGradient(i-l,r-h,n,d,s-l,o-h);return w.Utils.applySvgAttributes.call(this,t,y,e),y}},subdivide:function(t,e,i,r,n,s,a,o,l){var h=(l=l||w.Utils.Curve.RecursionLimit)+1;if(c(t-a)<.001&&c(e-o)<.001)return[new w.Anchor(a,o)];for(var d=[],u=0;u>1,c=1&r?s[l++]*t(o):0;l1?Array.prototype.push.apply(this,arguments):arguments[0]&&Array.isArray(arguments[0])&&Array.prototype.push.apply(this,arguments[0])},Error:function(t){this.name="two.js",this.message=t},Events:{on:function(t,e){return this._events||(this._events={}),(this._events[t]||(this._events[t]=[])).push(e),this},off:function(t,e){if(!this._events)return this;if(!t&&!e)return this._events={},this;for(var i=t?[t]:a.keys(this._events),r=0,n=i.length;r2&&(t=this.slice(arguments[0],arguments[0]+arguments.length-2),this.trigger(w.Events.insert,t),this.trigger(w.Events.order)),e},sort:function(){return Array.prototype.sort.apply(this,arguments),this.trigger(w.Events.order),this},reverse:function(){return Array.prototype.reverse.apply(this,arguments),this.trigger(w.Events.order),this}});w.Utils.getAnchorsFromArcData;var A=w.Utils.getControlPoints,C=(w.Utils.getCurveFromPoints,w.Utils.solveSegmentIntersection,w.Utils.decoupleShapes,w.Utils.mod),k=w.Utils.getBackingStoreRatio,E=w.Utils.getComponentOnCubicBezier,R=(w.Utils.getCurveLength,w.Utils.integrate),M=w.Utils.getReflection;function F(){var t=document.body.getBoundingClientRect(),e=this.width=t.width,i=this.height=t.height;this.renderer.setSize(e,i,this.ratio)}function O(t,e){this.width=t,this.height=e,this.trigger(w.Events.resize,t,e)}a.extend(w.prototype,w.Utils.Events,{constructor:w,appendTo:function(t){return t.appendChild(this.renderer.domElement),this},play:function(){return w.Utils.setPlaying.call(this,!0),T.init(),this.trigger(w.Events.play)},pause:function(){return this.playing=!1,this.trigger(w.Events.pause)},update:function(){var t=!!this._lastFrame,e=v.now();t&&(this.timeDelta=parseFloat((e-this._lastFrame).toFixed(3))),this._lastFrame=e;var i=this.width,r=this.height,n=this.renderer;return i===n.width&&r===n.height||n.setSize(i,r,this.ratio),this.trigger(w.Events.update,this.frameCount,this.timeDelta),this.render()},render:function(){return this.renderer.render(),this.trigger(w.Events.render,this.frameCount++)},add:function(t){var e=t;return e instanceof Array||(e=a.toArray(arguments)),this.scene.add(e),this},remove:function(t){var e=t;return e instanceof Array||(e=a.toArray(arguments)),this.scene.remove(e),this},clear:function(){return this.scene.remove(this.scene.children),this},makeLine:function(t,e,i,r){var n=new w.Line(t,e,i,r);return this.scene.add(n),n},makeRectangle:function(t,e,i,r){var n=new w.Rectangle(t,e,i,r);return this.scene.add(n),n},makeRoundedRectangle:function(t,e,i,r,n){var s=new w.RoundedRectangle(t,e,i,r,n);return this.scene.add(s),s},makeCircle:function(t,e,i){var r=new w.Circle(t,e,i);return this.scene.add(r),r},makeEllipse:function(t,e,i,r){var n=new w.Ellipse(t,e,i,r);return this.scene.add(n),n},makeStar:function(t,e,i,r,n){var s=new w.Star(t,e,i,r,n);return this.scene.add(s),s},makeCurve:function(t){var e=arguments.length,i=t;if(!a.isArray(t)){i=[];for(var r=0;r=4?(i=arguments[0]-arguments[2],r=arguments[1]-arguments[3],Math.atan2(r,i)):(i=t.x-e.x,r=t.y-e.y,Math.atan2(r,i))},distanceBetween:function(t,e){return Math.sqrt(i.distanceBetweenSquared(t,e))},distanceBetweenSquared:function(t,e){var i=t.x-e.x,r=t.y-e.y;return i*i+r*r},MakeObservable:function(i){i.bind=i.on=function(){return this._bound||(this._x=this.x,this._y=this.y,Object.defineProperty(this,"x",n),Object.defineProperty(this,"y",s),e.extend(this,r),this._bound=!0),t.Utils.Events.bind.apply(this,arguments),this}}}),e.extend(i.prototype,t.Utils.Events,{constructor:i,set:function(t,e){return this.x=t,this.y=e,this},copy:function(t){return this.x=t.x,this.y=t.y,this},clear:function(){return this.x=0,this.y=0,this},clone:function(){return new i(this.x,this.y)},add:function(t,i){return arguments.length<=0?this:(arguments.length<=1?e.isNumber(t)?(this.x+=t,this.y+=t):t&&e.isNumber(t.x)&&e.isNumber(t.y)&&(this.x+=t.x,this.y+=t.y):(this.x+=t,this.y+=i),this)},addSelf:function(t){return this.add.apply(this,arguments)},sub:function(t,i){return arguments.length<=0?this:(arguments.length<=1?e.isNumber(t)?(this.x-=t,this.y-=t):t&&e.isNumber(t.x)&&e.isNumber(t.y)&&(this.x-=t.x,this.y-=t.y):(this.x-=t,this.y-=i),this)},subtract:function(){return this.sub.apply(this,arguments)},subSelf:function(t){return this.sub.apply(this,arguments)},subtractSelf:function(t){return this.sub.apply(this,arguments)},multiply:function(t,i){return arguments.length<=0?this:(arguments.length<=1?e.isNumber(t)?(this.x*=t,this.y*=t):t&&e.isNumber(t.x)&&e.isNumber(t.y)&&(this.x*=t.x,this.y*=t.y):(this.x*=t,this.y*=i),this)},multiplySelf:function(t){return this.multiply.apply(this,arguments)},multiplyScalar:function(t){return this.multiply(t)},divide:function(t,i){return arguments.length<=0?this:(arguments.length<=1?e.isNumber(t)?(this.x/=t,this.y/=t):t&&e.isNumber(t.x)&&e.isNumber(t.y)&&(this.x/=t.x,this.y/=t.y):(this.x/=t,this.y/=i),e.isNaN(this.x)&&(this.x=0),e.isNaN(this.y)&&(this.y=0),this)},divideSelf:function(t){return this.divide.apply(this,arguments)},divideScalar:function(t){return this.divide(t)},negate:function(){return this.multiply(-1)},dot:function(t){return this.x*t.x+this.y*t.y},length:function(){return Math.sqrt(this.lengthSquared())},lengthSquared:function(){return this.x*this.x+this.y*this.y},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,i=this.y-t.y;return e*e+i*i},setLength:function(t){return this.normalize().multiplyScalar(t)},equals:function(t,e){return e=void 0===e?1e-4:e,this.distanceTo(t)0&&this.set(l)};n.extend(o,{Identity:[1,0,0,0,1,0,0,0,1],Multiply:function(e,i,r){if(i.length<=3){var n=e,s=i[0]||0,a=i[1]||0,o=i[2]||0;return{x:n[0]*s+n[1]*a+n[2]*o,y:n[3]*s+n[4]*a+n[5]*o,z:n[6]*s+n[7]*a+n[8]*o}}var l=e[0],h=e[1],c=e[2],d=e[3],u=e[4],f=e[5],g=e[6],_=e[7],p=e[8],m=i[0],v=i[1],y=i[2],x=i[3],b=i[4],w=i[5],S=i[6],A=i[7],C=i[8];return(r=r||new t.Array(9))[0]=l*m+h*x+c*S,r[1]=l*v+h*b+c*A,r[2]=l*y+h*w+c*C,r[3]=d*m+u*x+f*S,r[4]=d*v+u*b+f*A,r[5]=d*y+u*w+f*C,r[6]=g*m+_*x+p*S,r[7]=g*v+_*b+p*A,r[8]=g*y+_*w+p*C,r}}),n.extend(o.prototype,t.Utils.Events,{constructor:o,manual:!1,set:function(e){var i=e;return arguments.length>1&&(i=n.toArray(arguments)),this.elements[0]=i[0],this.elements[1]=i[1],this.elements[2]=i[2],this.elements[3]=i[3],this.elements[4]=i[4],this.elements[5]=i[5],this.elements[6]=i[6],this.elements[7]=i[7],this.elements[8]=i[8],this.trigger(t.Events.change)},identity:function(){return this.elements[0]=o.Identity[0],this.elements[1]=o.Identity[1],this.elements[2]=o.Identity[2],this.elements[3]=o.Identity[3],this.elements[4]=o.Identity[4],this.elements[5]=o.Identity[5],this.elements[6]=o.Identity[6],this.elements[7]=o.Identity[7],this.elements[8]=o.Identity[8],this.trigger(t.Events.change)},multiply:function(e,i,r,n,s,a,o,l,h){var c=arguments,d=c.length;if(d<=1)return this.elements[0]*=e,this.elements[1]*=e,this.elements[2]*=e,this.elements[3]*=e,this.elements[4]*=e,this.elements[5]*=e,this.elements[6]*=e,this.elements[7]*=e,this.elements[8]*=e,this.trigger(t.Events.change);if(d<=3)return e=e||0,i=i||0,r=r||0,{x:(s=this.elements)[0]*e+s[1]*i+s[2]*r,y:s[3]*e+s[4]*i+s[5]*r,z:s[6]*e+s[7]*i+s[8]*r};var u=this.elements,f=c,g=u[0],_=u[1],p=u[2],m=u[3],v=u[4],y=u[5],x=u[6],b=u[7],w=u[8],S=f[0],A=f[1],C=f[2],k=f[3],E=f[4],R=f[5],M=f[6],F=f[7],O=f[8];return this.elements[0]=g*S+_*k+p*M,this.elements[1]=g*A+_*E+p*F,this.elements[2]=g*C+_*R+p*O,this.elements[3]=m*S+v*k+y*M,this.elements[4]=m*A+v*E+y*F,this.elements[5]=m*C+v*R+y*O,this.elements[6]=x*S+b*k+w*M,this.elements[7]=x*A+b*E+w*F,this.elements[8]=x*C+b*R+w*O,this.trigger(t.Events.change)},inverse:function(e){var i=this.elements;e=e||new t.Matrix;var r=i[0],n=i[1],s=i[2],a=i[3],o=i[4],l=i[5],h=i[6],c=i[7],d=i[8],u=d*o-l*c,f=-d*a+l*h,g=c*a-o*h,_=r*u+n*f+s*g;return _?(_=1/_,e.elements[0]=u*_,e.elements[1]=(-d*n+s*c)*_,e.elements[2]=(l*n-s*o)*_,e.elements[3]=f*_,e.elements[4]=(d*r-s*h)*_,e.elements[5]=(-l*r+s*a)*_,e.elements[6]=g*_,e.elements[7]=(-c*r+n*h)*_,e.elements[8]=(o*r-n*a)*_,e):null},scale:function(t,e){return arguments.length<=1&&(e=t),this.multiply(t,0,0,0,e,0,0,0,1)},rotate:function(t){var r=e(t),n=i(t);return this.multiply(r,-n,0,n,r,0,0,0,1)},translate:function(t,e){return this.multiply(1,0,t,0,1,e,0,0,1)},skewX:function(t){var e=r(t);return this.multiply(1,e,0,0,1,0,0,0,1)},skewY:function(t){var e=r(t);return this.multiply(1,0,0,e,1,0,0,0,1)},toString:function(t){return a.length=0,this.toArray(t,a),a.join(" ")},toArray:function(t,e){var i=this.elements,r=!!e,n=s(i[0]),a=s(i[1]),o=s(i[2]),l=s(i[3]),h=s(i[4]),c=s(i[5]);if(t){var d=s(i[6]),u=s(i[7]),f=s(i[8]);return r?(e[0]=n,e[1]=l,e[2]=d,e[3]=a,e[4]=h,e[5]=u,e[6]=o,e[7]=c,void(e[8]=f)):[n,l,d,a,h,u,o,c,f]}return r?(e[0]=n,e[1]=l,e[2]=a,e[3]=h,e[4]=o,void(e[5]=c)):[n,l,a,h,o,c]},clone:function(){var e,i,r,n,s,a,o,l,h;e=this.elements[0],i=this.elements[1],r=this.elements[2],n=this.elements[3],s=this.elements[4],a=this.elements[5],o=this.elements[6],l=this.elements[7],h=this.elements[8];var c=new t.Matrix(e,i,r,n,s,a,o,l,h);return c.manual=this.manual,c}})}((void 0!==t?t:this||window).Two),function(t){var e=t.Utils.mod,i=t.Utils.toFixed,r=t.Utils,n={version:1.1,ns:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",alignments:{left:"start",center:"middle",right:"end"},createElement:function(t,e){var i=t,s=document.createElementNS(n.ns,i);return"svg"===i&&(e=r.defaults(e||{},{version:n.version})),r.isEmpty(e)||n.setAttributes(s,e),s},setAttributes:function(t,e){for(var i=Object.keys(e),r=0;r=o&&n&&(A.command===t.Commands.curve&&(R=s,m=A.controls&&A.controls.right||A,v=R.controls&&R.controls.left||R,A.relative?(d=i(m.x+A.x),u=i(m.y+A.y)):(d=i(m.x),u=i(m.y)),R.relative?(f=i(v.x+R.x),g=i(v.y+R.y)):(f=i(v.x),g=i(v.y)),c+=" C "+d+" "+u+" "+f+" "+g+" "+(M=i(R.x))+" "+(F=i(R.y))),A.command!==t.Commands.close&&(c+=" Z")),l+=c+" "}return l},getClip:function(t){var e=t._renderer.clip;if(!e){for(var i=t;i.parent;)i=i.parent;e=t._renderer.clip=n.createElement("clipPath"),i.defs.appendChild(e)}return e},group:{appendChild:function(t){var e=t._renderer.elem;if(e){var i=e.nodeName;!i||/(radial|linear)gradient/i.test(i)||t._clip||this.elem.appendChild(e)}},removeChild:function(t){var e=t._renderer.elem;e&&e.parentNode==this.elem&&(e.nodeName&&(t._clip||this.elem.removeChild(e)))},orderChild:function(t){this.elem.appendChild(t._renderer.elem)},renderChild:function(t){n[t._renderer.type].render.call(t,this)},render:function(t){if(this._update(),0===this._opacity&&!this._flagOpacity)return this;this._renderer.elem||(this._renderer.elem=n.createElement("g",{id:this.id}),t.appendChild(this._renderer.elem));var e=this._matrix.manual||this._flagMatrix,i={domElement:t,elem:this._renderer.elem};e&&this._renderer.elem.setAttribute("transform","matrix("+this._matrix.toString()+")");for(var r=0;r0&&(e["stroke-dasharray"]=this.dashes.join(" ")),this._renderer.elem?n.setAttributes(this._renderer.elem,e):(e.id=this.id,this._renderer.elem=n.createElement("path",e),t.appendChild(this._renderer.elem)),this._flagClip){var r=n.getClip(this),s=this._renderer.elem;this._clip?(s.removeAttribute("id"),r.setAttribute("id",this.id),r.appendChild(s)):(r.removeAttribute("id"),s.setAttribute("id",this.id),this.parent._renderer.elem.appendChild(s))}return this.flagReset()}},text:{render:function(t){this._update();var e={};if((this._matrix.manual||this._flagMatrix)&&(e.transform="matrix("+this._matrix.toString()+")"),this._flagFamily&&(e["font-family"]=this._family),this._flagSize&&(e["font-size"]=this._size),this._flagLeading&&(e["line-height"]=this._leading),this._flagAlignment&&(e["text-anchor"]=n.alignments[this._alignment]||this._alignment),this._flagBaseline&&(e["alignment-baseline"]=e["dominant-baseline"]=this._baseline),this._flagStyle&&(e["font-style"]=this._style),this._flagWeight&&(e["font-weight"]=this._weight),this._flagDecoration&&(e["text-decoration"]=this._decoration),this._fill&&this._fill._renderer&&(this._fill._update(),n[this._fill._renderer.type].render.call(this._fill,t,!0)),this._flagFill&&(e.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill),this._stroke&&this._stroke._renderer&&(this._stroke._update(),n[this._stroke._renderer.type].render.call(this._stroke,t,!0)),this._flagStroke&&(e.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke),this._flagLinewidth&&(e["stroke-width"]=this._linewidth),this._flagOpacity&&(e.opacity=this._opacity),this._flagClassName&&(e.class=this._className),this._flagVisible&&(e.visibility=this._visible?"visible":"hidden"),this.dashes&&this.dashes.length>0&&(e["stroke-dasharray"]=this.dashes.join(" ")),this._renderer.elem?n.setAttributes(this._renderer.elem,e):(e.id=this.id,this._renderer.elem=n.createElement("text",e),t.defs.appendChild(this._renderer.elem)),this._flagClip){var i=n.getClip(this),r=this._renderer.elem;this._clip?(r.removeAttribute("id"),i.setAttribute("id",this.id),i.appendChild(r)):(i.removeAttribute("id"),r.setAttribute("id",this.id),this.parent._renderer.elem.appendChild(r))}return this._flagValue&&(this._renderer.elem.textContent=this._value),this.flagReset()}},"linear-gradient":{render:function(t,e){e||this._update();var i={};if(this._flagEndPoints&&(i.x1=this.left._x,i.y1=this.left._y,i.x2=this.right._x,i.y2=this.right._y),this._flagSpread&&(i.spreadMethod=this._spread),this._renderer.elem?n.setAttributes(this._renderer.elem,i):(i.id=this.id,i.gradientUnits="userSpaceOnUse",this._renderer.elem=n.createElement("linearGradient",i),t.defs.appendChild(this._renderer.elem)),this._flagStops){var r=this._renderer.elem.childNodes.length!==this.stops.length;r&&(this._renderer.elem.childNodes.length=0);for(var s=0;s0&&(s.x*=-1),s.y>0&&(s.y*=-1)),(this._flagScale||this._flagLoaded||this._flagRepeat)&&(s.width=0,s.height=0,o)){switch(a.width=s.width=o.width,a.height=s.height=o.height,this._repeat){case"no-repeat":s.width+=1,s.height+=1}this._scale instanceof t.Vector?(s.width*=this._scale.x,s.height*=this._scale.y):(s.width*=this._scale,s.height*=this._scale)}return(this._flagScale||this._flagLoaded)&&(this._renderer.image?r.isEmpty(a)||n.setAttributes(this._renderer.image,a):this._renderer.image=n.createElement("image",a)),this._renderer.elem?r.isEmpty(s)||n.setAttributes(this._renderer.elem,s):(s.id=this.id,s.patternUnits="userSpaceOnUse",this._renderer.elem=n.createElement("pattern",s),e.defs.appendChild(this._renderer.elem)),this._renderer.elem&&this._renderer.image&&!this._renderer.appended&&(this._renderer.elem.appendChild(this._renderer.image),this._renderer.appended=!0),this.flagReset()}}},s=t[t.Types.svg]=function(e){this.domElement=e.domElement||n.createElement("svg"),this.scene=new t.Group,this.scene.parent=this,this.defs=n.createElement("defs"),this.domElement.appendChild(this.defs),this.domElement.defs=this.defs,this.domElement.style.overflow="hidden"};r.extend(s,{Utils:n}),r.extend(s.prototype,t.Utils.Events,{constructor:s,setSize:function(e,i){return this.width=e,this.height=i,n.setAttributes(this.domElement,{width:e,height:i}),this.trigger(t.Events.resize,e,i)},render:function(){return n.group.render.call(this.scene,this.domElement),this}})}((void 0!==t?t:this||window).Two),function(t){var e=t.Utils.mod,i=t.Utils.toFixed,r=t.Utils.getRatio,n=t.Utils,s=[],a=2*Math.PI,o=Math.max,l=Math.min,h=Math.abs,c=Math.sin,d=Math.cos,u=Math.acos,f=Math.sqrt,g=function(t){return 1==t[0]&&0==t[3]&&0==t[1]&&1==t[4]&&0==t[2]&&0==t[5]},_={isHidden:/(none|transparent)/i,alignments:{left:"start",middle:"center",right:"end"},shim:function(t,e){return t.tagName=t.nodeName=e||"canvas",t.nodeType=1,t.getAttribute=function(t){return this[t]},t.setAttribute=function(t,e){return this[t]=e,this},t},group:{renderChild:function(t){_[t._renderer.type].render.call(t,this.ctx,!0,this.clip)},render:function(t){this._update();var e=this._matrix.elements,i=this.parent;this._renderer.opacity=this._opacity*(i&&i._renderer?i._renderer.opacity:1);var r=g(e),n=this._mask;if(this._renderer.context||(this._renderer.context={}),this._renderer.context.ctx=t,r||(t.save(),t.transform(e[0],e[3],e[1],e[4],e[2],e[5])),n&&_[n._renderer.type].render.call(n,t,!0),this.opacity>0&&0!==this.scale)for(var s=0;s0&&r.setLineDash(z),r.beginPath();for(var q=0;q=S&&x&&(R=M,U=E.controls&&E.controls.right||t.Vector.zero,I=R.controls&&R.controls.left||t.Vector.zero,E._relative?(T=U.x+i(E.x),P=U.y+i(E.y)):(T=i(U.x),P=i(U.y)),R._relative?(F=I.x+i(R.x),O=I.y+i(R.y)):(F=i(I.x),O=i(I.y)),j=i(R.x),D=i(R.y),r.bezierCurveTo(T,P,F,O,j,D));break;case t.Commands.line:r.lineTo(j,D);break;case t.Commands.move:M=E,r.moveTo(j,D)}return x&&r.closePath(),z&&z.length>0&&r.setLineDash(s),B||l||(_.isHidden.test(u)||((G=u._renderer&&u._renderer.offset)&&(r.save(),r.translate(-u._renderer.offset.x,-u._renderer.offset.y),r.scale(u._renderer.scale.x,u._renderer.scale.y)),r.fill(),G&&r.restore()),_.isHidden.test(c)||((G=c._renderer&&c._renderer.offset)&&(r.save(),r.translate(-c._renderer.offset.x,-c._renderer.offset.y),r.scale(c._renderer.scale.x,c._renderer.scale.y),r.lineWidth=d/c._renderer.scale.x),r.stroke(),G&&r.restore())),V||r.restore(),B&&!l&&r.clip(),this.flagReset()}},text:{render:function(t,e,r){this._update();var s,a,o,l,h,c,d,u=this._matrix.elements,f=this._stroke,p=this._linewidth,m=this._fill,v=this._opacity*this.parent._renderer.opacity,y=this._visible,x=g(u),b=m._renderer&&m._renderer.offset&&f._renderer&&f._renderer.offset,w=this.dashes,S=this._clip;return e||y&&!S?(x||(t.save(),t.transform(u[0],u[3],u[1],u[4],u[2],u[5])),b||(t.font=[this._style,this._weight,this._size+"px/"+this._leading+"px",this._family].join(" ")),t.textAlign=_.alignments[this._alignment]||this._alignment,t.textBaseline=this._baseline,m&&(n.isString(m)?t.fillStyle=m:(_[m._renderer.type].render.call(m,t),t.fillStyle=m._renderer.effect)),f&&(n.isString(f)?t.strokeStyle=f:(_[f._renderer.type].render.call(f,t),t.strokeStyle=f._renderer.effect)),p&&(t.lineWidth=p),n.isNumber(v)&&(t.globalAlpha=v),w&&w.length>0&&t.setLineDash(w),S||r||(_.isHidden.test(m)||(m._renderer&&m._renderer.offset?(c=i(m._renderer.scale.x),d=i(m._renderer.scale.y),t.save(),t.translate(-i(m._renderer.offset.x),-i(m._renderer.offset.y)),t.scale(c,d),s=this._size/m._renderer.scale.y,a=this._leading/m._renderer.scale.y,t.font=[this._style,this._weight,i(s)+"px/",i(a)+"px",this._family].join(" "),o=m._renderer.offset.x/m._renderer.scale.x,l=m._renderer.offset.y/m._renderer.scale.y,t.fillText(this.value,i(o),i(l)),t.restore()):t.fillText(this.value,0,0)),_.isHidden.test(f)||(f._renderer&&f._renderer.offset?(c=i(f._renderer.scale.x),d=i(f._renderer.scale.y),t.save(),t.translate(-i(f._renderer.offset.x),-i(f._renderer.offset.y)),t.scale(c,d),s=this._size/f._renderer.scale.y,a=this._leading/f._renderer.scale.y,t.font=[this._style,this._weight,i(s)+"px/",i(a)+"px",this._family].join(" "),o=f._renderer.offset.x/f._renderer.scale.x,l=f._renderer.offset.y/f._renderer.scale.y,h=p/f._renderer.scale.x,t.lineWidth=i(h),t.strokeText(this.value,i(o),i(l)),t.restore()):t.strokeText(this.value,0,0))),x||t.restore(),S&&!r&&t.clip(),this.flagReset()):this}},"linear-gradient":{render:function(t){if(this._update(),!this._renderer.effect||this._flagEndPoints||this._flagStops){this._renderer.effect=t.createLinearGradient(this.left._x,this.left._y,this.right._x,this.right._y);for(var e=0;e1){var R=f(E);S=(s*=R)*s,A=(l*=R)*l}var M=S*k+A*C,F=f(o(0,(S*A-M)/M));u===g&&(F=-F);var O=F*s*w/l,T=-F*l*b/s,P=d(_)*O-c(_)*T+(r+p)/2,L=c(_)*O+d(_)*T+(n+v)/2,N=m(1,0,(b-O)/s,(w-T)/l);!function(i,r,n,s,o,l,h,c,d){var u=t.Utils.Curve.Tolerance.epsilon,f=h-l,g=Math.abs(f)0&&A.setLineDash(L),A.save(),A.scale(C,C),A.translate(D,B),A.beginPath();for(var V=0;V=U&&P&&(a=I,m=G.controls&&G.controls.right||t.Vector.zero,v=a.controls&&a.controls.left||t.Vector.zero,G._relative?(f=o(m.x+G.x),g=o(m.y+G.y)):(f=o(m.x),g=o(m.y)),a._relative?(d=o(v.x+a.x),u=o(v.y+a.y)):(d=o(v.x),u=o(v.y)),y=o(a.x),x=o(a.y),A.bezierCurveTo(f,g,d,u,y,x));break;case t.Commands.line:A.lineTo(y,x);break;case t.Commands.move:I=G,A.moveTo(y,x)}}P&&A.closePath(),c.isHidden.test(R)||((b=R._renderer&&R._renderer.offset)&&(A.save(),A.translate(-R._renderer.offset.x,-R._renderer.offset.y),A.scale(R._renderer.scale.x,R._renderer.scale.y)),A.fill(),b&&A.restore()),c.isHidden.test(k)||((b=k._renderer&&k._renderer.offset)&&(A.save(),A.translate(-k._renderer.offset.x,-k._renderer.offset.y),A.scale(k._renderer.scale.x,k._renderer.scale.y),A.lineWidth=E/k._renderer.scale.x),A.stroke(),b&&A.restore()),A.restore()},getBoundingClientRect:function(t,e,i){var r,n,s=1/0,a=-1/0,o=1/0,l=-1/0;t.forEach(function(t){var e,i,r,n,h,c,d=t.x,u=t.y,f=t.controls;o=Math.min(u,o),s=Math.min(d,s),a=Math.max(d,a),l=Math.max(u,l),t.controls&&(h=f.left,c=f.right,h&&c&&(e=t._relative?h.x+d:h.x,i=t._relative?h.y+u:h.y,r=t._relative?c.x+d:c.x,n=t._relative?c.y+u:c.y,e&&i&&r&&n&&(o=Math.min(i,n,o),s=Math.min(e,r,s),a=Math.max(e,r,a),l=Math.max(i,n,l))))}),h.isNumber(e)&&(o-=e,s-=e,a+=e,l+=e),r=a-s,n=l-o,i.top=o,i.left=s,i.right=a,i.bottom=l,i.width=r,i.height=n,i.centroid||(i.centroid={}),i.centroid.x=-s,i.centroid.y=-o},render:function(e,r,n){if(!this._visible||!this._opacity)return this;this._update();var a=this.parent,o=a._matrix.manual||a._flagMatrix,l=this._matrix.manual||this._flagMatrix,d=this._flagVertices||this._flagFill||this._fill instanceof t.LinearGradient&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof t.RadialGradient&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof t.Texture&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof t.LinearGradient&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof t.RadialGradient&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof t.Texture&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||a._flagOpacity||this._flagVisible||this._flagCap||this._flagJoin||this._flagMiter||this._flagScale||this.dashes&&this.dashes.length>0||!this._renderer.texture;return(o||l)&&(this._renderer.matrix||(this._renderer.matrix=new t.Array(9)),this._matrix.toArray(!0,s),i(s,a._renderer.matrix,this._renderer.matrix),this._renderer.scale=this._scale*a._renderer.scale),d?(this._renderer.rect||(this._renderer.rect={}),this._renderer.triangles||(this._renderer.triangles=new t.Array(12)),this._renderer.opacity=this._opacity*a._renderer.opacity,c.path.getBoundingClientRect(this._renderer.vertices,this._linewidth,this._renderer.rect),c.getTriangles(this._renderer.rect,this._renderer.triangles),c.updateBuffer.call(c,e,this,r),c.updateTexture.call(c,e,this)):(h.isString(this._fill)||this._fill._update(),h.isString(this._stroke)||this._stroke._update()),!this._clip||n?(e.bindBuffer(e.ARRAY_BUFFER,this._renderer.textureCoordsBuffer),e.vertexAttribPointer(r.textureCoords,2,e.FLOAT,!1,0,0),e.bindTexture(e.TEXTURE_2D,this._renderer.texture),e.uniformMatrix3fv(r.matrix,!1,this._renderer.matrix),e.bindBuffer(e.ARRAY_BUFFER,this._renderer.buffer),e.vertexAttribPointer(r.position,2,e.FLOAT,!1,0,0),e.drawArrays(e.TRIANGLES,0,6),this.flagReset()):void 0}},text:{updateCanvas:function(t){var e=this.canvas,i=this.ctx,r=t._renderer.scale,n=t._stroke,s=t._linewidth*r,a=t._fill,l=t._renderer.opacity||t._opacity,d=t.dashes;e.width=Math.max(Math.ceil(t._renderer.rect.width*r),1),e.height=Math.max(Math.ceil(t._renderer.rect.height*r),1);var u,f,g,_,p,m,v,y=t._renderer.rect.centroid,x=y.x,b=y.y,w=a._renderer&&a._renderer.offset&&n._renderer&&n._renderer.offset;i.clearRect(0,0,e.width,e.height),w||(i.font=[t._style,t._weight,t._size+"px/"+t._leading+"px",t._family].join(" ")),i.textAlign="center",i.textBaseline="middle",a&&(h.isString(a)?i.fillStyle=a:(c[a._renderer.type].render.call(a,i,t),i.fillStyle=a._renderer.effect)),n&&(h.isString(n)?i.strokeStyle=n:(c[n._renderer.type].render.call(n,i,t),i.strokeStyle=n._renderer.effect)),s&&(i.lineWidth=s),h.isNumber(l)&&(i.globalAlpha=l),d&&d.length>0&&i.setLineDash(d),i.save(),i.scale(r,r),i.translate(x,b),c.isHidden.test(a)||(a._renderer&&a._renderer.offset?(m=o(a._renderer.scale.x),v=o(a._renderer.scale.y),i.save(),i.translate(-o(a._renderer.offset.x),-o(a._renderer.offset.y)),i.scale(m,v),u=t._size/a._renderer.scale.y,f=t._leading/a._renderer.scale.y,i.font=[t._style,t._weight,o(u)+"px/",o(f)+"px",t._family].join(" "),g=a._renderer.offset.x/a._renderer.scale.x,_=a._renderer.offset.y/a._renderer.scale.y,i.fillText(t.value,o(g),o(_)),i.restore()):i.fillText(t.value,0,0)),c.isHidden.test(n)||(n._renderer&&n._renderer.offset?(m=o(n._renderer.scale.x),v=o(n._renderer.scale.y),i.save(),i.translate(-o(n._renderer.offset.x),-o(n._renderer.offset.y)),i.scale(m,v),u=t._size/n._renderer.scale.y,f=t._leading/n._renderer.scale.y,i.font=[t._style,t._weight,o(u)+"px/",o(f)+"px",t._family].join(" "),g=n._renderer.offset.x/n._renderer.scale.x,_=n._renderer.offset.y/n._renderer.scale.y,p=s/n._renderer.scale.x,i.lineWidth=o(p),i.strokeText(t.value,o(g),o(_)),i.restore()):i.strokeText(t.value,0,0)),i.restore()},getBoundingClientRect:function(t,e){var i=c.ctx;i.font=[t._style,t._weight,t._size+"px/"+t._leading+"px",t._family].join(" "),i.textAlign="center",i.textBaseline=t._baseline;var r=i.measureText(t._value).width,n=Math.max(t._size||t._leading);this._linewidth&&!c.isHidden.test(this._stroke)&&(n+=this._linewidth);var s=r/2,a=n/2;switch(c.alignments[t._alignment]||t._alignment){case c.alignments.left:e.left=0,e.right=r;break;case c.alignments.right:e.left=-r,e.right=0;break;default:e.left=-s,e.right=s}switch(t._baseline){case"bottom":e.top=-n,e.bottom=0;break;case"top":e.top=0,e.bottom=n;break;default:e.top=-a,e.bottom=a}e.width=r,e.height=n,e.centroid||(e.centroid={}),e.centroid.x=s,e.centroid.y=a},render:function(e,r,n){if(!this._visible||!this._opacity)return this;this._update();var a=this.parent,o=a._matrix.manual||a._flagMatrix,l=this._matrix.manual||this._flagMatrix,d=this._flagVertices||this._flagFill||this._fill instanceof t.LinearGradient&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof t.RadialGradient&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof t.Texture&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof t.LinearGradient&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof t.RadialGradient&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof t.Texture&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||a._flagOpacity||this._flagVisible||this._flagScale||this._flagValue||this._flagFamily||this._flagSize||this._flagLeading||this._flagAlignment||this._flagBaseline||this._flagStyle||this._flagWeight||this._flagDecoration||this.dashes&&this.dashes.length>0||!this._renderer.texture;return(o||l)&&(this._renderer.matrix||(this._renderer.matrix=new t.Array(9)),this._matrix.toArray(!0,s),i(s,a._renderer.matrix,this._renderer.matrix),this._renderer.scale=this._scale*a._renderer.scale),d?(this._renderer.rect||(this._renderer.rect={}),this._renderer.triangles||(this._renderer.triangles=new t.Array(12)),this._renderer.opacity=this._opacity*a._renderer.opacity,c.text.getBoundingClientRect(this,this._renderer.rect),c.getTriangles(this._renderer.rect,this._renderer.triangles),c.updateBuffer.call(c,e,this,r),c.updateTexture.call(c,e,this)):(h.isString(this._fill)||this._fill._update(),h.isString(this._stroke)||this._stroke._update()),!this._clip||n?(e.bindBuffer(e.ARRAY_BUFFER,this._renderer.textureCoordsBuffer),e.vertexAttribPointer(r.textureCoords,2,e.FLOAT,!1,0,0),e.bindTexture(e.TEXTURE_2D,this._renderer.texture),e.uniformMatrix3fv(r.matrix,!1,this._renderer.matrix),e.bindBuffer(e.ARRAY_BUFFER,this._renderer.buffer),e.vertexAttribPointer(r.position,2,e.FLOAT,!1,0,0),e.drawArrays(e.TRIANGLES,0,6),this.flagReset()):void 0}},"linear-gradient":{render:function(t,e){if(t.canvas.getContext("2d")){if(this._update(),!this._renderer.effect||this._flagEndPoints||this._flagStops){this._renderer.effect=t.createLinearGradient(this.left._x,this.left._y,this.right._x,this.right._y);for(var i=0;i=i)return i-r>=0;r+=s}return!1}function c(t,e){var i=t._length;if(e<=0)return 0;if(e>=i)return t._lengths.length-1;for(var r=0,n=0;r=e)return e-=n,Math.max(r-1,0)+e/t._lengths[r];n+=t._lengths[r]}return-1}function d(e,i,r){var n,s,a,o,l,h,c,d,u=i.controls&&i.controls.right,f=e.controls&&e.controls.left;return n=i.x,l=i.y,s=(u||i).x,h=(u||i).y,a=(f||e).x,c=(f||e).y,o=e.x,d=e.y,u&&i._relative&&(s+=i.x,h+=i.y),f&&e._relative&&(a+=e.x,c+=e.y),t.Utils.getCurveLength(n,l,s,h,a,c,o,d,r)}function u(e,i,r){var n,s,a,o,l,h,c,d,u=i.controls&&i.controls.right,f=e.controls&&e.controls.left;return n=i.x,l=i.y,s=(u||i).x,h=(u||i).y,a=(f||e).x,c=(f||e).y,o=e.x,d=e.y,u&&i._relative&&(s+=i.x,h+=i.y),f&&e._relative&&(a+=e.x,c+=e.y),t.Utils.subdivide(n,l,s,h,a,c,o,d,r)}o.extend(l,{Properties:["fill","stroke","linewidth","opacity","className","visible","cap","join","miter","closed","curved","automatic","beginning","ending"],Utils:{getCurveLength:d},FlagVertices:function(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)},BindVertices:function(e){for(var i=e.length;i--;)e[i].bind(t.Events.change,this._renderer.flagVertices);this._renderer.flagVertices()},UnbindVertices:function(e){for(var i=e.length;i--;)e[i].unbind(t.Events.change,this._renderer.flagVertices);this._renderer.flagVertices()},FlagFill:function(){this._flagFill=!0},FlagStroke:function(){this._flagStroke=!0},MakeObservable:function(e){t.Shape.MakeObservable(e),o.each(l.Properties.slice(2,9),t.Utils.defineProperty,e),Object.defineProperty(e,"fill",{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof t.Gradient||this._fill instanceof t.LinearGradient||this._fill instanceof t.RadialGradient||this._fill instanceof t.Texture)&&this._fill.unbind(t.Events.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof t.Gradient||this._fill instanceof t.LinearGradient||this._fill instanceof t.RadialGradient||this._fill instanceof t.Texture)&&this._fill.bind(t.Events.change,this._renderer.flagFill)}}),Object.defineProperty(e,"stroke",{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof t.Gradient||this._stroke instanceof t.LinearGradient||this._stroke instanceof t.RadialGradient||this._stroke instanceof t.Texture)&&this._stroke.unbind(t.Events.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof t.Gradient||this._stroke instanceof t.LinearGradient||this._stroke instanceof t.RadialGradient||this._stroke instanceof t.Texture)&&this._stroke.bind(t.Events.change,this._renderer.flagStroke)}}),Object.defineProperty(e,"length",{get:function(){return this._flagLength&&this._updateLength(),this._length}}),Object.defineProperty(e,"closed",{enumerable:!0,get:function(){return this._closed},set:function(t){this._closed=!!t,this._flagVertices=!0}}),Object.defineProperty(e,"curved",{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=!!t,this._flagVertices=!0}}),Object.defineProperty(e,"automatic",{enumerable:!0,get:function(){return this._automatic},set:function(t){if(t!==this._automatic){this._automatic=!!t;var e=this._automatic?"ignore":"listen";o.each(this.vertices,function(t){t[e]()})}}}),Object.defineProperty(e,"beginning",{enumerable:!0,get:function(){return this._beginning},set:function(t){this._beginning=t,this._flagVertices=!0}}),Object.defineProperty(e,"ending",{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}}),Object.defineProperty(e,"vertices",{enumerable:!0,get:function(){return this._collection},set:function(e){this._renderer.flagVertices;var i=this._renderer.bindVertices,r=this._renderer.unbindVertices;this._collection&&this._collection.unbind(t.Events.insert,i).unbind(t.Events.remove,r),e instanceof t.Utils.Collection?this._collection=e:this._collection=new t.Utils.Collection(e||[]),this._collection.bind(t.Events.insert,i).bind(t.Events.remove,r),i(this._collection)}}),Object.defineProperty(e,"clip",{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}})}}),o.extend(l.prototype,t.Shape.prototype,{_flagVertices:!0,_flagLength:!0,_flagFill:!0,_flagStroke:!0,_flagLinewidth:!0,_flagOpacity:!0,_flagVisible:!0,_flagClassName:!0,_flagCap:!0,_flagJoin:!0,_flagMiter:!0,_flagClip:!1,_length:0,_fill:"#fff",_stroke:"#000",_linewidth:1,_opacity:1,_className:"",_visible:!0,_cap:"round",_join:"round",_miter:4,_closed:!0,_curved:!1,_automatic:!0,_beginning:0,_ending:1,_clip:!1,constructor:l,clone:function(t){var e=new l;e.vertices=this.vertices;for(var i=0;i=y){this._closed?(r=t.Utils.mod(A,x),n=t.Utils.mod(A-1,x),0===A&&(r=n,n=A)):(r=A,n=Math.min(Math.max(A-1,0),b)),w=this.vertices[r],S=this.vertices[n],y-=k,e=0!==this._lengths[A]?y/this._lengths[A]:0;break}k+=this._lengths[A]}if(o.isNull(w)||o.isNull(S))return null;if(!w)return S;if(!S)return w;v=S.controls&&S.controls.right,m=w.controls&&w.controls.left,l=S.x,f=S.y,h=(v||S).x,g=(v||S).y,c=(m||w).x,_=(m||w).y,d=w.x,p=w.y,v&&S.relative&&(h+=S.x,g+=S.y),m&&w.relative&&(c+=w.x,_+=w.y),a=t.Utils.getComponentOnCubicBezier(e,l,h,c,d),u=t.Utils.getComponentOnCubicBezier(e,f,g,_,p);var E=t.Utils.lerp(l,h,e),R=t.Utils.lerp(f,g,e),M=t.Utils.lerp(h,c,e),F=t.Utils.lerp(g,_,e),O=t.Utils.lerp(c,d,e),T=t.Utils.lerp(_,p,e),P=t.Utils.lerp(E,M,e),L=t.Utils.lerp(R,F,e),N=t.Utils.lerp(M,O,e),U=t.Utils.lerp(F,T,e);return o.isObject(i)?(i.x=a,i.y=u,o.isObject(i.controls)||t.Anchor.AppendCurveProperties(i),i.controls.left.x=P,i.controls.left.y=L,i.controls.right.x=N,i.controls.right.y=U,o.isBoolean(i.relative)&&!i.relative||(i.controls.left.x-=a,i.controls.left.y-=u,i.controls.right.x-=a,i.controls.right.y-=u),i.t=e,i):((s=new t.Anchor(a,u,P-a,L-u,N-a,U-u,this._curved?t.Commands.curve:t.Commands.line)).t=e,s)},plot:function(){if(this.curved)return t.Utils.getCurveFromPoints(this._collection,this.closed),this;for(var e=0;e0&&(s[s.length-1].command=t.Commands.line),void(r=a);var h=u(a,r,e);s=s.concat(h),o.each(h,function(e,i){i<=0&&r.command===t.Commands.move?e.command=t.Commands.move:e.command=t.Commands.line}),l>=i&&(this._closed&&this._automatic?(h=u(a,r=a,e),s=s.concat(h),o.each(h,function(e,i){i<=0&&r.command===t.Commands.move?e.command=t.Commands.move:e.command=t.Commands.line})):n&&s.push(new t.Anchor(a.x,a.y)),s[s.length-1].command=n?t.Commands.close:t.Commands.line),r=a}},this),this._automatic=!1,this._curved=!1,this.vertices=s,this},_updateLength:function(e,i){i||this._update();var r=this.vertices.length,n=r-1,s=this.vertices[n],a=0;return o.isUndefined(this._lengths)&&(this._lengths=[]),o.each(this.vertices,function(i,r){if(r<=0||i.command===t.Commands.move)return s=i,void(this._lengths[r]=0);this._lengths[r]=d(i,s,e),this._lengths[r]=t.Utils.toFixed(this._lengths[r]),a+=this._lengths[r],s=i},this),this._length=a,this._flagLength=!1,this},_update:function(){if(this._flagVertices){this._automatic&&this.plot(),this._flagLength&&this._updateLength(void 0,!0);var e,i,s,a,o,l=this._collection.length,d=this._closed,u=Math.min(this._beginning,this._ending),f=Math.max(this._beginning,this._ending),g=c(this,u*this._length),_=c(this,f*this._length),p=r(g),m=n(_);this._renderer.vertices.length=0;for(var v=0;vm&&!i?((o=this._renderer.collection[v]).copy(this._collection[v]),this.getPointAt(f,o),o.command=this._renderer.collection[v].command,this._renderer.vertices.push(o),i=o,(s=this._collection[v-1])&&s.controls&&(o.controls.right.clear(),this._renderer.collection[v-1].controls.right.clear().lerp(s.controls.right,o.t))):v>=p&&v<=m&&(o=this._renderer.collection[v].copy(this._collection[v]),this._renderer.vertices.push(o),v===m&&h(this,f)?(i=o,!d&&i.controls&&i.controls.right.clear()):v===p&&h(this,u)&&((e=o).command=t.Commands.move,!d&&e.controls&&e.controls.left.clear()));p>0&&!e&&(v=p-1,(o=this._renderer.collection[v]).copy(this._collection[v]),this.getPointAt(u,o),o.command=t.Commands.move,this._renderer.vertices.unshift(o),e=o,(a=this._collection[v+1])&&a.controls&&(o.controls.left.clear(),this._renderer.collection[v+1].controls.left.copy(a.controls.left).lerp(t.Vector.zero,o.t)))}return t.Shape.prototype._update.apply(this,arguments),this},flagReset:function(){return this._flagVertices=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagCap=this._flagJoin=this._flagMiter=this._flagClassName=this._flagClip=!1,t.Shape.prototype.flagReset.call(this),this}}),l.MakeObservable(l.prototype)}((void 0!==t?t:this||window).Two),function(t){var e=t.Path,i=t.Utils,r=t.Line=function(i,r,n,s){e.call(this,[new t.Anchor(i,r),new t.Anchor(n,s)]),this.vertices[0].command=t.Commands.move,this.vertices[1].command=t.Commands.line,this.automatic=!1};i.extend(r.prototype,e.prototype),r.prototype.constructor=r,e.MakeObservable(r.prototype)}((void 0!==t?t:this||window).Two),function(t){var e=t.Path,i=t.Utils,r=t.Rectangle=function(i,r,n,s){e.call(this,[new t.Anchor,new t.Anchor,new t.Anchor,new t.Anchor],!0,!1,!0),this.width=n,this.height=s,this.origin=new t.Vector,this.translation.set(i,r),this._update()};i.extend(r,{Properties:["width","height"],MakeObservable:function(n){e.MakeObservable(n),i.each(r.Properties,t.Utils.defineProperty,n),Object.defineProperty(n,"origin",{enumerable:!0,get:function(){return this._origin},set:function(e){this._origin&&this._origin.unbind(t.Events.change,this._renderer.flagVertices),this._origin=e,this._origin.bind(t.Events.change,this._renderer.flagVertices),this._renderer.flagVertices()}})}}),i.extend(r.prototype,e.prototype,{_width:0,_height:0,_flagWidth:0,_flagHeight:0,_origin:null,constructor:r,_update:function(){if(this._flagWidth||this._flagHeight){var i=this._width/2,r=this._height/2;this.vertices[0].set(-i,-r).add(this._origin).command=t.Commands.move,this.vertices[1].set(i,-r).add(this._origin).command=t.Commands.line,this.vertices[2].set(i,r).add(this._origin).command=t.Commands.line,this.vertices[3].set(-i,r).add(this._origin).command=t.Commands.line,this.vertices[4]&&(this.vertices[4].set(-i,-r).add(this._origin).command=t.Commands.line)}return e.prototype._update.call(this),this},flagReset:function(){return this._flagWidth=this._flagHeight=!1,e.prototype.flagReset.call(this),this},clone:function(e){var n=new r(0,0,this.width,this.height);return n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,i.each(t.Path.Properties,function(t){n[t]=this[t]},this),e&&e.add(n),n}}),r.MakeObservable(r.prototype)}((void 0!==t?t:this||window).Two),function(t){var e=t.Path,i=2*Math.PI,r=Math.PI/2,n=Math.cos,s=Math.sin,a=t.Utils,o=4/3*Math.tan(Math.PI/8),l=t.Ellipse=function(i,r,n,s,o){a.isNumber(s)||(s=n);var l=o||5,h=a.map(a.range(l),function(e){return new t.Anchor},this);e.call(this,h,!0,!0,!0),this.width=2*n,this.height=2*s,this._update(),this.translation.set(i,r)};a.extend(l,{Properties:["width","height"],MakeObservable:function(i){e.MakeObservable(i),a.each(l.Properties,t.Utils.defineProperty,i)}}),a.extend(l.prototype,e.prototype,{_width:0,_height:0,_flagWidth:!1,_flagHeight:!1,constructor:l,_update:function(){if(this._flagWidth||this._flagHeight)for(var a=0,l=this.vertices.length,h=l-1;as&&(this.vertices.splice(s-1,o-s),o=s);for(var l=0;l=o?this.vertices.push(new t.Anchor(c,d)):this.vertices[l].set(c,d),this.vertices[l].command=0===l?t.Commands.move:t.Commands.line}}return e.prototype._update.call(this),this},flagReset:function(){return this._flagWidth=this._flagHeight=this._flagSides=!1,e.prototype.flagReset.call(this),this},clone:function(e){var i=new a(0,0,this.radius,this.sides);return i.translation.copy(this.translation),i.rotation=this.rotation,i.scale=this.scale,s.each(t.Path.Properties,function(t){i[t]=this[t]},this),e&&e.add(i),i}}),a.MakeObservable(a.prototype)}((void 0!==t?t:this||window).Two),function(t){var e=t.Path,i=(Math.PI,2*Math.PI),r=Math.PI/2,n=(Math.cos,Math.sin,Math.abs,t.Utils),s=t.ArcSegment=function(i,r,s,a,o,l,h){var c=h||3*t.Resolution,d=n.map(n.range(c),function(){return new t.Anchor});e.call(this,d,!0,!1,!0),this.innerRadius=s,this.outerRadius=a,this.startAngle=o,this.endAngle=l,this._update(),this.translation.set(i,r)};function a(t,e){for(;t<0;)t+=e;return t%e}n.extend(s,{Properties:["startAngle","endAngle","innerRadius","outerRadius"],MakeObservable:function(i){e.MakeObservable(i),n.each(s.Properties,t.Utils.defineProperty,i)}}),n.extend(s.prototype,e.prototype,{_flagStartAngle:!1,_flagEndAngle:!1,_flagInnerRadius:!1,_flagOuterRadius:!1,_startAngle:0,_endAngle:i,_innerRadius:0,_outerRadius:0,constructor:s,_update:function(){if(this._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){var n,s=this._startAngle,o=this._endAngle,l=this._innerRadius,h=this._outerRadius,c=a(s,i)===a(o,i),d=l>0,u=this.vertices,f=d?u.length/2:u.length,g=0;c?f--:d||(f-=2);for(var _=0,p=f-1;_s&&(this.vertices.splice(s-1,o-s),o=s);for(var l=0;l=o?this.vertices.push(new t.Anchor(d,u)):this.vertices[l].set(d,u),this.vertices[l].command=0===l?t.Commands.move:t.Commands.line}}return e.prototype._update.call(this),this},flagReset:function(){return this._flagInnerRadius=this._flagOuterRadius=this._flagSides=!1,e.prototype.flagReset.call(this),this},clone:function(e){var i=this.innerRadius,r=this.outerRadius,n=this.sides,o=new a(0,0,i,r,n);return o.translation.copy(this.translation),o.rotation=this.rotation,o.scale=this.scale,s.each(t.Path.Properties,function(t){o[t]=this[t]},this),e&&e.add(o),o}}),a.MakeObservable(a.prototype)}((void 0!==t?t:this||window).Two),function(t){var e=t.Path,i=t.Utils,r=t.RoundedRectangle=function(n,s,a,o,l){i.isUndefined(l)&&(l=Math.floor(Math.min(a,o)/12));var h=i.map(i.range(10),function(e){return new t.Anchor(0,0,0,0,0,0,0===e?t.Commands.move:t.Commands.curve)});e.call(this,h),this.closed=!0,this.automatic=!1,this._renderer.flagRadius=i.bind(r.FlagRadius,this),this.width=a,this.height=o,this.radius=l,this._update(),this.translation.set(n,s)};i.extend(r,{Properties:["width","height"],FlagRadius:function(){this._flagRadius=!0},MakeObservable:function(n){e.MakeObservable(n),i.each(r.Properties,t.Utils.defineProperty,n),Object.defineProperty(n,"radius",{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius instanceof t.Vector&&this._radius.unbind(t.Events.change,this._renderer.flagRadius),this._radius=e,this._radius instanceof t.Vector&&this._radius.bind(t.Events.change,this._renderer.flagRadius),this._flagRadius=!0}})}}),i.extend(r.prototype,e.prototype,{_width:0,_height:0,_radius:0,_flagWidth:!1,_flagHeight:!1,_flagRadius:!1,constructor:r,_update:function(){if(this._flagWidth||this._flagHeight||this._flagRadius){var i,r,n,s=this._width,a=this._height;this._radius instanceof t.Vector?(i=this._radius.x,r=this._radius.y):(i=this._radius,r=this._radius);var o=s/2,l=a/2;(n=this.vertices[0]).x=-(o-i),n.y=-l,(n=this.vertices[1]).x=o-i,n.y=-l,n.controls.left.clear(),n.controls.right.x=i,n.controls.right.y=0,(n=this.vertices[2]).x=o,n.y=-(l-r),n.controls.right.clear(),n.controls.left.clear(),(n=this.vertices[3]).x=o,n.y=l-r,n.controls.left.clear(),n.controls.right.x=0,n.controls.right.y=r,(n=this.vertices[4]).x=o-i,n.y=l,n.controls.right.clear(),n.controls.left.clear(),(n=this.vertices[5]).x=-(o-i),n.y=l,n.controls.left.clear(),n.controls.right.x=-i,n.controls.right.y=0,(n=this.vertices[6]).x=-o,n.y=l-r,n.controls.left.clear(),n.controls.right.clear(),(n=this.vertices[7]).x=-o,n.y=-(l-r),n.controls.left.clear(),n.controls.right.x=0,n.controls.right.y=-r,(n=this.vertices[8]).x=-(o-i),n.y=-l,n.controls.left.clear(),n.controls.right.clear(),(n=this.vertices[9]).copy(this.vertices[8])}return e.prototype._update.call(this),this},flagReset:function(){return this._flagWidth=this._flagHeight=this._flagRadius=!1,e.prototype.flagReset.call(this),this},clone:function(e){var n=this.width,s=this.height,a=this.radius,o=new r(0,0,n,s,a);return o.translation.copy(this.translation),o.rotation=this.rotation,o.scale=this.scale,i.each(t.Path.Properties,function(t){o[t]=this[t]},this),e&&e.add(o),o}}),r.MakeObservable(r.prototype)}((void 0!==t?t:this||window).Two),function(t){var e=t.root,i=t.Utils.getComputedMatrix,r=t.Utils,n=((e.document?e.document.createElement("canvas"):(console.warn("Two.js: Unable to create canvas for Two.Text measurements."),{getContext:r.identity})).getContext("2d"),t.Text=function(e,i,n,s){if(t.Shape.call(this),this._renderer.type="text",this._renderer.flagFill=r.bind(t.Text.FlagFill,this),this._renderer.flagStroke=r.bind(t.Text.FlagStroke,this),this.value=e,r.isNumber(i)&&(this.translation.x=i),r.isNumber(n)&&(this.translation.y=n),this.dashes=[],!r.isObject(s))return this;r.each(t.Text.Properties,function(t){t in s&&(this[t]=s[t])},this)});r.extend(t.Text,{Ratio:.6,Properties:["value","family","size","leading","alignment","linewidth","style","className","weight","decoration","baseline","opacity","visible","fill","stroke"],FlagFill:function(){this._flagFill=!0},FlagStroke:function(){this._flagStroke=!0},MakeObservable:function(e){t.Shape.MakeObservable(e),r.each(t.Text.Properties.slice(0,13),t.Utils.defineProperty,e),Object.defineProperty(e,"fill",{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof t.Gradient||this._fill instanceof t.LinearGradient||this._fill instanceof t.RadialGradient||this._fill instanceof t.Texture)&&this._fill.unbind(t.Events.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof t.Gradient||this._fill instanceof t.LinearGradient||this._fill instanceof t.RadialGradient||this._fill instanceof t.Texture)&&this._fill.bind(t.Events.change,this._renderer.flagFill)}}),Object.defineProperty(e,"stroke",{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof t.Gradient||this._stroke instanceof t.LinearGradient||this._stroke instanceof t.RadialGradient||this._stroke instanceof t.Texture)&&this._stroke.unbind(t.Events.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof t.Gradient||this._stroke instanceof t.LinearGradient||this._stroke instanceof t.RadialGradient||this._stroke instanceof t.Texture)&&this._stroke.bind(t.Events.change,this._renderer.flagStroke)}}),Object.defineProperty(e,"clip",{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}})}}),r.extend(t.Text.prototype,t.Shape.prototype,{_flagValue:!0,_flagFamily:!0,_flagSize:!0,_flagLeading:!0,_flagAlignment:!0,_flagBaseline:!0,_flagStyle:!0,_flagWeight:!0,_flagDecoration:!0,_flagFill:!0,_flagStroke:!0,_flagLinewidth:!0,_flagOpacity:!0,_flagClassName:!0,_flagVisible:!0,_flagClip:!1,_value:"",_family:"sans-serif",_size:13,_leading:17,_alignment:"center",_baseline:"middle",_style:"normal",_weight:500,_decoration:"none",_fill:"#000",_stroke:"transparent",_linewidth:1,_opacity:1,_className:"",_visible:!0,_clip:!1,constructor:t.Text,remove:function(){return this.parent?(this.parent.remove(this),this):this},clone:function(e){var i=new t.Text(this.value);return i.translation.copy(this.translation),i.rotation=this.rotation,i.scale=this.scale,r.each(t.Text.Properties,function(t){i[t]=this[t]},this),e&&e.add(i),i._update()},toObject:function(){var e={translation:this.translation.toObject(),rotation:this.rotation,scale:this.scale};return r.each(t.Text.Properties,function(t){e[t]=this[t]},this),e},noStroke:function(){return this.stroke="transparent",this},noFill:function(){return this.fill="transparent",this},getBoundingClientRect:function(t){var e,r,s,a,o,l;this._update(!0),e=t?this._matrix:i(this);var h=this.leading,c=this.value.length*this.size*n.Ratio;switch(this.alignment){case"left":s=0,a=c;break;case"right":s=-c,a=0;break;default:s=-c/2,a=c/2}switch(this.baseline){case"top":o=0,l=h;break;case"bottom":o=-h,l=0;break;default:o=-h/2,l=h/2}return{top:o=(r=e.multiply(s,o,1)).y,left:s=r.x,right:a=(r=e.multiply(a,l,1)).x,bottom:l=r.y,width:a-s,height:l-o}},flagReset:function(){return this._flagValue=this._flagFamily=this._flagSize=this._flagLeading=this._flagAlignment=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagClip=this._flagDecoration=this._flagClassName=this._flagBaseline=!1,t.Shape.prototype.flagReset.call(this),this}}),t.Text.MakeObservable(t.Text.prototype)}((void 0!==t?t:this||window).Two),function(t){var e=t.Utils,i=t.Stop=function(t,r,n){this._renderer={},this._renderer.type="stop",this.offset=e.isNumber(t)?t:i.Index<=0?0:1,this.opacity=e.isNumber(n)?n:1,this.color=e.isString(r)?r:i.Index<=0?"#fff":"#000",i.Index=(i.Index+1)%2};e.extend(i,{Index:0,Properties:["offset","opacity","color"],MakeObservable:function(t){e.each(i.Properties,function(t){var e="_"+t,i="_flag"+t.charAt(0).toUpperCase()+t.slice(1);Object.defineProperty(this,t,{enumerable:!0,get:function(){return this[e]},set:function(t){this[e]=t,this[i]=!0,this.parent&&(this.parent._flagStops=!0)}})},t)}}),e.extend(i.prototype,t.Utils.Events,{constructor:i,clone:function(){var t=new i;return e.each(i.Properties,function(e){t[e]=this[e]},this),t},toObject:function(){var t={};return e.each(i.Properties,function(e){t[e]=this[e]},this),t},flagReset:function(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,this}}),i.MakeObservable(i.prototype),i.prototype.constructor=i;var r=t.Gradient=function(i){this._renderer={},this._renderer.type="gradient",this.id=t.Identifier+t.uniqueId(),this.classList=[],this._renderer.flagStops=e.bind(r.FlagStops,this),this._renderer.bindStops=e.bind(r.BindStops,this),this._renderer.unbindStops=e.bind(r.UnbindStops,this),this.spread="pad",this.stops=i};e.extend(r,{Stop:i,Properties:["spread"],MakeObservable:function(i){e.each(r.Properties,t.Utils.defineProperty,i),Object.defineProperty(i,"stops",{enumerable:!0,get:function(){return this._stops},set:function(e){this._renderer.flagStops;var i=this._renderer.bindStops,r=this._renderer.unbindStops;this._stops&&this._stops.unbind(t.Events.insert,i).unbind(t.Events.remove,r),this._stops=new t.Utils.Collection((e||[]).slice(0)),this._stops.bind(t.Events.insert,i).bind(t.Events.remove,r),i(this._stops)}})},FlagStops:function(){this._flagStops=!0},BindStops:function(e){for(var i=e.length;i--;)e[i].bind(t.Events.change,this._renderer.flagStops),e[i].parent=this;this._renderer.flagStops()},UnbindStops:function(e){for(var i=e.length;i--;)e[i].unbind(t.Events.change,this._renderer.flagStops),delete e[i].parent;this._renderer.flagStops()}}),e.extend(r.prototype,t.Utils.Events,{_flagStops:!1,_flagSpread:!1,clone:function(i){var n=e.map(this.stops,function(t){return t.clone()}),s=new r(n);return e.each(t.Gradient.Properties,function(t){s[t]=this[t]},this),i&&i.add(s),s},toObject:function(){var t={stops:e.map(this.stops,function(t){return t.toObject()})};return e.each(r.Properties,function(e){t[e]=this[e]},this),t},_update:function(){return(this._flagSpread||this._flagStops)&&this.trigger(t.Events.change),this},flagReset:function(){return this._flagSpread=this._flagStops=!1,this}}),r.MakeObservable(r.prototype)}((void 0!==t?t:this||window).Two),function(t){var e=t.Utils,i=t.LinearGradient=function(r,n,s,a,o){t.Gradient.call(this,o),this._renderer.type="linear-gradient";var l=e.bind(i.FlagEndPoints,this);this.left=(new t.Vector).bind(t.Events.change,l),this.right=(new t.Vector).bind(t.Events.change,l),e.isNumber(r)&&(this.left.x=r),e.isNumber(n)&&(this.left.y=n),e.isNumber(s)&&(this.right.x=s),e.isNumber(a)&&(this.right.y=a)};e.extend(i,{Stop:t.Gradient.Stop,MakeObservable:function(e){t.Gradient.MakeObservable(e)},FlagEndPoints:function(){this._flagEndPoints=!0}}),e.extend(i.prototype,t.Gradient.prototype,{_flagEndPoints:!1,constructor:i,clone:function(r){var n=e.map(this.stops,function(t){return t.clone()}),s=new i(this.left._x,this.left._y,this.right._x,this.right._y,n);return e.each(t.Gradient.Properties,function(t){s[t]=this[t]},this),r&&r.add(s),s},toObject:function(){var e=t.Gradient.prototype.toObject.call(this);return e.left=this.left.toObject(),e.right=this.right.toObject(),e},_update:function(){return(this._flagEndPoints||this._flagSpread||this._flagStops)&&this.trigger(t.Events.change),this},flagReset:function(){return this._flagEndPoints=!1,t.Gradient.prototype.flagReset.call(this),this}}),i.MakeObservable(i.prototype)}((void 0!==t?t:this||window).Two),function(t){var e=t.Utils,i=t.RadialGradient=function(i,r,n,s,a,o){t.Gradient.call(this,s),this._renderer.type="radial-gradient",this.center=(new t.Vector).bind(t.Events.change,e.bind(function(){this._flagCenter=!0},this)),this.radius=e.isNumber(n)?n:20,this.focal=(new t.Vector).bind(t.Events.change,e.bind(function(){this._flagFocal=!0},this)),e.isNumber(i)&&(this.center.x=i),e.isNumber(r)&&(this.center.y=r),this.focal.copy(this.center),e.isNumber(a)&&(this.focal.x=a),e.isNumber(o)&&(this.focal.y=o)};e.extend(i,{Stop:t.Gradient.Stop,Properties:["radius"],MakeObservable:function(r){t.Gradient.MakeObservable(r),e.each(i.Properties,t.Utils.defineProperty,r)}}),e.extend(i.prototype,t.Gradient.prototype,{_flagRadius:!1,_flagCenter:!1,_flagFocal:!1,constructor:i,clone:function(r){var n=e.map(this.stops,function(t){return t.clone()}),s=new i(this.center._x,this.center._y,this._radius,n,this.focal._x,this.focal._y);return e.each(t.Gradient.Properties.concat(i.Properties),function(t){s[t]=this[t]},this),r&&r.add(s),s},toObject:function(){var r=t.Gradient.prototype.toObject.call(this);return e.each(i.Properties,function(t){r[t]=this[t]},this),r.center=this.center.toObject(),r.focal=this.focal.toObject(),r},_update:function(){return(this._flagRadius||this._flatCenter||this._flagFocal||this._flagSpread||this._flagStops)&&this.trigger(t.Events.change),this},flagReset:function(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,t.Gradient.prototype.flagReset.call(this),this}}),i.MakeObservable(i.prototype)}((void 0!==t?t:this||window).Two),function(t){var e,i=t.root,r=t.Utils,n={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff)$/i,effect:/texture|gradient/i};i.document&&(e=document.createElement("a"));var s=t.Texture=function(e,i){if(this._renderer={},this._renderer.type="texture",this._renderer.flagOffset=r.bind(s.FlagOffset,this),this._renderer.flagScale=r.bind(s.FlagScale,this),this.id=t.Identifier+t.uniqueId(),this.classList=[],this.offset=new t.Vector,r.isFunction(i)){var n=r.bind(function(){this.unbind(t.Events.load,n),r.isFunction(i)&&i()},this);this.bind(t.Events.load,n)}r.isString(e)?this.src=e:r.isElement(e)&&(this.image=e),this._update()};r.extend(s,{Properties:["src","loaded","repeat"],RegularExpressions:n,ImageRegistry:new t.Registry,getAbsoluteURL:function(t){return e?(e.href=t,e.href):t},loadHeadlessBuffer:new Function("texture","loaded",['var fs = require("fs");',"var buffer = fs.readFileSync(texture.src);","texture.image.src = buffer;","loaded();"].join("\n")),getImage:function(e){var r,a=s.getAbsoluteURL(e);return s.ImageRegistry.contains(a)?s.ImageRegistry.get(a):(t.Utils.Image?(r=new t.Utils.Image,t.CanvasRenderer.Utils.shim(r,"img")):i.document?r=n.video.test(a)?document.createElement("video"):document.createElement("img"):console.warn("Two.js: no prototypical image defined for Two.Texture"),r.crossOrigin="anonymous",r)},Register:{canvas:function(t,e){t._src="#"+t.id,s.ImageRegistry.add(t.src,t.image),r.isFunction(e)&&e()},img:function(e,i){var n=function(t){r.isFunction(e.image.removeEventListener)&&(e.image.removeEventListener("load",n,!1),e.image.removeEventListener("error",a,!1)),r.isFunction(i)&&i()},a=function(i){throw r.isFunction(e.image.removeEventListener)&&(e.image.removeEventListener("load",n,!1),e.image.removeEventListener("error",a,!1)),new t.Utils.Error("unable to load "+e.src)};r.isNumber(e.image.width)&&e.image.width>0&&r.isNumber(e.image.height)&&e.image.height>0?n():r.isFunction(e.image.addEventListener)&&(e.image.addEventListener("load",n,!1),e.image.addEventListener("error",a,!1)),e._src=s.getAbsoluteURL(e._src),e.image&&e.image.getAttribute("two-src")||(e.image.setAttribute("two-src",e.src),s.ImageRegistry.add(e.src,e.image),t.Utils.isHeadless?s.loadHeadlessBuffer(e,n):e.image.src=e.src)},video:function(e,i){var n=function(t){e.image.removeEventListener("canplaythrough",n,!1),e.image.removeEventListener("error",a,!1),e.image.width=e.image.videoWidth,e.image.height=e.image.videoHeight,e.image.play(),r.isFunction(i)&&i()},a=function(i){throw e.image.removeEventListener("canplaythrough",n,!1),e.image.removeEventListener("error",a,!1),new t.Utils.Error("unable to load "+e.src)};if(e._src=s.getAbsoluteURL(e._src),e.image.addEventListener("canplaythrough",n,!1),e.image.addEventListener("error",a,!1),!e.image||!e.image.getAttribute("two-src")){if(t.Utils.isHeadless)throw new t.Utils.Error("video textures are not implemented in headless environments.");e.image.setAttribute("two-src",e.src),s.ImageRegistry.add(e.src,e.image),e.image.src=e.src,e.image.loop=!0,e.image.load()}}},load:function(t,e){t.src;var i=t.image,r=i&&i.nodeName.toLowerCase();t._flagImage&&(/canvas/i.test(r)?s.Register.canvas(t,e):(t._src=i.getAttribute("two-src")||i.src,s.Register[r](t,e))),t._flagSrc&&(i||(t.image=s.getImage(t.src)),r=t.image.nodeName.toLowerCase(),s.Register[r](t,e))},FlagOffset:function(){this._flagOffset=!0},FlagScale:function(){this._flagScale=!0},MakeObservable:function(e){r.each(s.Properties,t.Utils.defineProperty,e),Object.defineProperty(e,"image",{enumerable:!0,get:function(){return this._image},set:function(t){var e;switch(t&&t.nodeName.toLowerCase()){case"canvas":e="#"+t.id;break;default:e=t.src}s.ImageRegistry.contains(e)?this._image=s.ImageRegistry.get(t.src):this._image=t,this._flagImage=!0}}),Object.defineProperty(e,"offset",{enumerable:!0,get:function(){return this._offset},set:function(e){this._offset&&this._offset.unbind(t.Events.change,this._renderer.flagOffset),this._offset=e,this._offset.bind(t.Events.change,this._renderer.flagOffset),this._flagOffset=!0}}),Object.defineProperty(e,"scale",{enumerable:!0,get:function(){return this._scale},set:function(e){this._scale instanceof t.Vector&&this._scale.unbind(t.Events.change,this._renderer.flagScale),this._scale=e,this._scale instanceof t.Vector&&this._scale.bind(t.Events.change,this._renderer.flagScale),this._flagScale=!0}})}}),r.extend(s.prototype,t.Utils.Events,t.Shape.prototype,{_flagSrc:!1,_flagImage:!1,_flagVideo:!1,_flagLoaded:!1,_flagRepeat:!1,_flagOffset:!1,_flagScale:!1,_src:"",_image:null,_loaded:!1,_repeat:"no-repeat",_scale:1,_offset:null,constructor:s,clone:function(){return new s(this.src)},toObject:function(){return{src:this.src,image:this.image}},_update:function(){return(this._flagSrc||this._flagImage)&&(this.trigger(t.Events.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,s.load(this,r.bind(function(){this.loaded=!0,this.trigger(t.Events.change).trigger(t.Events.load)},this)))),this._image&&this._image.readyState>=4&&(this._flagVideo=!0),this},flagReset:function(){return this._flagSrc=this._flagImage=this._flagLoaded=this._flagVideo=this._flagScale=this._flagOffset=!1,this}}),s.MakeObservable(s.prototype)}((void 0!==t?t:this||window).Two),function(t){var e=t.Utils,i=t.Path,r=t.Rectangle,n=t.Sprite=function(r,n,s,a,o,l){i.call(this,[new t.Anchor,new t.Anchor,new t.Anchor,new t.Anchor],!0),this.noStroke(),this.noFill(),r instanceof t.Texture?this.texture=r:e.isString(r)&&(this.texture=new t.Texture(r)),this.origin=new t.Vector,this._update(),this.translation.set(n||0,s||0),e.isNumber(a)&&(this.columns=a),e.isNumber(o)&&(this.rows=o),e.isNumber(l)&&(this.frameRate=l)};e.extend(n,{Properties:["texture","columns","rows","frameRate","index"],MakeObservable:function(i){r.MakeObservable(i),e.each(n.Properties,t.Utils.defineProperty,i)}}),e.extend(n.prototype,r.prototype,{_flagTexture:!1,_flagColumns:!1,_flagRows:!1,_flagFrameRate:!1,flagIndex:!1,_amount:1,_duration:0,_startTime:0,_playing:!1,_firstFrame:0,_lastFrame:0,_loop:!0,_texture:null,_columns:1,_rows:1,_frameRate:0,_index:0,_origin:null,constructor:n,play:function(t,i,r){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=e.performance.now(),e.isNumber(t)&&(this._firstFrame=t),e.isNumber(i)&&(this._lastFrame=i),e.isFunction(r)?this._onLastFrame=r:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this},pause:function(){return this._playing=!1,this},stop:function(){return this._playing=!1,this._index=0,this},clone:function(t){var e=new n(this.texture,this.translation.x,this.translation.y,this.columns,this.rows,this.frameRate);return this.playing&&(e.play(this._firstFrame,this._lastFrame),e._loop=this._loop),t&&t.add(e),e},_update:function(){var t,i,n,s,a,o,l,h,c,d=this._texture,u=this._columns,f=this._rows;if((this._flagColumns||this._flagRows)&&(this._amount=this._columns*this._rows),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._flagTexture&&(this.fill=this._texture),this._texture.loaded){t=(l=d.image.width)/u,i=(h=d.image.height)/f,s=this._amount,this.width!==t&&(this.width=t),this.height!==i&&(this.height=i),this._playing&&this._frameRate>0&&(e.isNaN(this._lastFrame)&&(this._lastFrame=s-1),n=e.performance.now()-this._startTime,a=1e3*((c=this._lastFrame+1)-this._firstFrame)/this._frameRate,this._loop?n%=a:n=Math.min(n,a),o=e.lerp(this._firstFrame,c,n/a),(o=Math.floor(o))!==this._index&&(this._index=o,o>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));var g=-t*(this._index%u)+(l-t)/2,_=-i*Math.floor(this._index/u)+(h-i)/2;g!==d.offset.x&&(d.offset.x=g),_!==d.offset.y&&(d.offset.y=_)}return r.prototype._update.call(this),this},flagReset:function(){return this._flagTexture=this._flagColumns=this._flagRows=this._flagFrameRate=!1,r.prototype.flagReset.call(this),this}}),n.MakeObservable(n.prototype)}((void 0!==t?t:this||window).Two),function(t){var e=t.Utils,i=t.Path,r=t.Rectangle,n=t.ImageSequence=function(r,s,a,o){i.call(this,[new t.Anchor,new t.Anchor,new t.Anchor,new t.Anchor],!0),this._renderer.flagTextures=e.bind(n.FlagTextures,this),this._renderer.bindTextures=e.bind(n.BindTextures,this),this._renderer.unbindTextures=e.bind(n.UnbindTextures,this),this.noStroke(),this.noFill(),this.textures=e.map(r,n.GenerateTexture,this),this.origin=new t.Vector,this._update(),this.translation.set(s||0,a||0),e.isNumber(o)?this.frameRate=o:this.frameRate=n.DefaultFrameRate};e.extend(n,{Properties:["frameRate","index"],DefaultFrameRate:30,FlagTextures:function(){this._flagTextures=!0},BindTextures:function(e){for(var i=e.length;i--;)e[i].bind(t.Events.change,this._renderer.flagTextures);this._renderer.flagTextures()},UnbindTextures:function(e){for(var i=e.length;i--;)e[i].unbind(t.Events.change,this._renderer.flagTextures);this._renderer.flagTextures()},MakeObservable:function(i){r.MakeObservable(i),e.each(n.Properties,t.Utils.defineProperty,i),Object.defineProperty(i,"textures",{enumerable:!0,get:function(){return this._textures},set:function(e){this._renderer.flagTextures;var i=this._renderer.bindTextures,r=this._renderer.unbindTextures;this._textures&&this._textures.unbind(t.Events.insert,i).unbind(t.Events.remove,r),this._textures=new t.Utils.Collection((e||[]).slice(0)),this._textures.bind(t.Events.insert,i).bind(t.Events.remove,r),i(this._textures)}})},GenerateTexture:function(i){return i instanceof t.Texture?i:e.isString(i)?new t.Texture(i):void 0}}),e.extend(n.prototype,r.prototype,{_flagTextures:!1,_flagFrameRate:!1,_flagIndex:!1,_amount:1,_duration:0,_index:0,_startTime:0,_playing:!1,_firstFrame:0,_lastFrame:0,_loop:!0,_textures:null,_frameRate:0,_origin:null,constructor:n,play:function(t,i,r){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=e.performance.now(),e.isNumber(t)&&(this._firstFrame=t),e.isNumber(i)&&(this._lastFrame=i),e.isFunction(r)?this._onLastFrame=r:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this},pause:function(){return this._playing=!1,this},stop:function(){return this._playing=!1,this._index=0,this},clone:function(t){var e=new n(this.textures,this.translation.x,this.translation.y,this.frameRate);return e._loop=this._loop,this._playing&&e.play(),t&&t.add(e),e},_update:function(){var i,n,s,a,o,l,h,c,d=this._textures;return this._flagTextures&&(this._amount=d.length),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._playing&&this._frameRate>0?(a=this._amount,e.isNaN(this._lastFrame)&&(this._lastFrame=a-1),s=e.performance.now()-this._startTime,o=1e3*((c=this._lastFrame+1)-this._firstFrame)/this._frameRate,this._loop?s%=o:s=Math.min(s,o),h=e.lerp(this._firstFrame,c,s/o),(h=Math.floor(h))!==this._index&&(this._index=h,(l=d[this._index]).loaded&&(i=l.image.width,n=l.image.height,this.width!==i&&(this.width=i),this.height!==n&&(this.height=n),this.fill=l,h>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()))):!this._flagIndex&&this.fill instanceof t.Texture||((l=d[this._index]).loaded&&(i=l.image.width,n=l.image.height,this.width!==i&&(this.width=i),this.height!==n&&(this.height=n)),this.fill=l),r.prototype._update.call(this),this},flagReset:function(){return this._flagTextures=this._flagFrameRate=!1,r.prototype.flagReset.call(this),this}}),n.MakeObservable(n.prototype)}((void 0!==t?t:this||window).Two),function(t){var e=Math.min,i=Math.max,r=t.Utils,n=function(){t.Utils.Collection.apply(this,arguments),Object.defineProperty(this,"_events",{value:{},enumerable:!1}),this.ids={},this.on(t.Events.insert,this.attach),this.on(t.Events.remove,this.detach),n.prototype.attach.apply(this,arguments)};n.prototype=new t.Utils.Collection,r.extend(n.prototype,{constructor:n,attach:function(t){for(var e=0;e=0?n.additions.splice(i,1):(n.subtractions.push(t),n._flagSubtractions=!0)),e?(t.parent=e,this.additions.push(t),void(this._flagAdditions=!0)):((i=r.indexOf(this.additions,t))>=0?this.additions.splice(i,1):(this.subtractions.push(t),this._flagSubtractions=!0),void delete t.parent))}r.extend(s,{Children:n,InsertChildren:function(t){for(var e=0;en+h?(l.beginning=1,l.ending=1):an&&sn&&a0;return e(r),i.preventDefault&&i.preventDefault(),!1}-1!==window.navigator.userAgent.indexOf("Firefox")?u(t,"DOMMouseScroll",i):u(t,"mousewheel",i)}(document.querySelector("#drawMap svg"),function(e){e?t.zoomSmall():t.zoomBig()}),f(this.mapLayer,0,function(e){t.mapLayer.translation.set(e.x,e.y),t.iconLayer.translation.set(e.x,e.y),t.svgMap.update(),t.$emit("dragMapLayerFn",e)})},zoomBig:function(){var t=this;this.mapLayer.scale+=.1,this.iconObjArr.map(function(e){e.translation.set(e.x*t.mapLayer.scale-t.iconSize.width/2,e.y*t.mapLayer.scale-t.iconSize.height/2)}),this.svgMap.update(),this.$emit("zoomMapLayerFn",this.mapLayer.scale)},zoomSmall:function(){var t=this;this.mapLayer.scale>.3?(this.mapLayer.scale-=.1,this.iconObjArr.map(function(e){e.translation.set(e.x*t.mapLayer.scale-t.iconSize.width/2,e.y*t.mapLayer.scale-t.iconSize.height/2)}),this.svgMap.update(),this.$emit("zoomMapLayerFn",this.mapLayer.scale)):this.$notify({group:"foo",type:"warn",title:"抱歉,真的不能再小了",text:"地图已经缩到最小,不能再小了"})},pantoHome:function(){var t=this;this.mapLayer.scale=1,this.iconObjArr.map(function(e){e.translation.set(1*e.x-t.iconSize.width/2,1*e.y-t.iconSize.height/2)}),this.mapLayer.translation.set(0,0),this.iconLayer.translation.set(0,0),this.svgMap.update()},iconListInit:function(t){var e=this;if(t&&this.svgMap&&this.mapLayer&&this.mapImg&&this.iconLayer){var i=[],r=[],n=[];this.iconObjArr=this.iconObjArr.reduce(function(e,i){return-1!==Object(d.c)(i.data.id,t,"id")?(e.push(i),n.push(i.data)):document.querySelector("#"+i._renderer.elem.id).remove(),e},[]);var s=!0,a=!1,o=void 0;try{for(var l,h=t[Symbol.iterator]();!(s=(l=h.next()).done);s=!0){var c=l.value;-1===Object(d.c)(c.id,n,"id")?r.push(c):i.push(c)}}catch(t){a=!0,o=t}finally{try{!s&&h.return&&h.return()}finally{if(a)throw o}}if(0===this.iconObjArr.length){var u=!0,f=!1,g=void 0;try{for(var _,p=t[Symbol.iterator]();!(u=(_=p.next()).done);u=!0){var m=_.value;this.drawIcon(m)}}catch(t){f=!0,g=t}finally{try{!u&&p.return&&p.return()}finally{if(f)throw g}}}else{var v=!0,y=!1,x=void 0;try{for(var b,w=r[Symbol.iterator]();!(v=(b=w.next()).done);v=!0){var S=b.value;this.drawIcon(S)}}catch(t){y=!0,x=t}finally{try{!v&&w.return&&w.return()}finally{if(y)throw x}}}var A=function(t){e.iconObjArr.map(function(e){if(t.id===e.data.id){var i=t&&t.position?JSON.parse(t.position):{x:0,y:0};e.data=t,e.x=i.x,e.y=i.y}})},C=!0,k=!1,E=void 0;try{for(var R,M=i[Symbol.iterator]();!(C=(R=M.next()).done);C=!0){A(R.value)}}catch(t){k=!0,E=t}finally{try{!C&&M.return&&M.return()}finally{if(k)throw E}}}},drawIcon:function(t){var e=this;if(!t||!t.position)return!1;var i=document.createElementNS("http://www.w3.org/2000/svg","image");i.href.baseVal=t&&t.icon?"/static/img/map/"+t.icon+".png":"/static/img/map/camera_device.png",i.setAttributeNS(null,"x",0),i.setAttributeNS(null,"y",-this.iconSize.height/2),i.setAttributeNS(null,"height",this.iconSize.height),i.setAttributeNS(null,"width",this.iconSize.width);var r=t&&t.position?JSON.parse(t.position):{x:0,y:0},n=this.svgMap.makeGroup(i);if(n.data=t,n.x=r.x,n.y=r.y,n.state="_unonline",n.translation.set(r.x*this.mapLayer.scale-this.iconSize.width/2,r.y*this.mapLayer.scale-this.iconSize.height/2),this.iconLayer.add(n),this.iconObjArr.push(n),this.svgMap.update(),document.querySelector("#"+n._renderer.elem.id).appendChild(i),document.querySelector("#"+n._renderer.elem.id).style.cursor="pointer",this.isIconEdit){var s=document.createElementNS("http://www.w3.org/2000/svg","image");s.href.baseVal="/static/img/map/mapDel.png",s.setAttributeNS(null,"x",this.iconSize.width-this.delIconSize),s.setAttributeNS(null,"y",-this.iconSize.height/2),s.setAttributeNS(null,"height",this.delIconSize),s.setAttributeNS(null,"width",this.delIconSize),document.querySelector("#"+n._renderer.elem.id).appendChild(s),u(s,"click",function(t){e.$emit("iconIteamDelFn",{data:n.data,id:n.data.id})}),f(n,0,function(t){n.translation.set(t.x,t.y),e.svgMap.update(),e.$emit("iconIteamDragFn",{x:(t.x+e.iconSize.width/2)/e.mapLayer.scale,y:(t.y+e.iconSize.height/2)/e.mapLayer.scale,iconGroup:n,data:n.data})})}else u(document.querySelector("#"+n._renderer.elem.id),"click",function(t){e.$emit("iconIteamFn",n)})},initIcon:function(t){if(!t)return!1;var e=[];this.unonlineDeviceList&&(e=this.unonlineDeviceList.map(function(t){return t.deviceId}));var i=t.data&&t.data.id?t.data.id:null,r=document.querySelector("#"+t._renderer.elem.id);this.unonlineDeviceList&&-1!==e.indexOf(i)?r&&"_unonline"!==t.state&&(t.state="_unonline",r.getElementsByTagNameNS("http://www.w3.org/2000/svg","image")[0].setAttributeNS(null,"href",t.data&&t.data.icon?"/static/img/map/"+t.data.icon+".png":"/static/img/map/camera_device.png")):r&&"_online"!==t.state&&(t.state="_online",r.getElementsByTagNameNS("http://www.w3.org/2000/svg","image")[0].setAttributeNS(null,"href",t.data&&t.data.icon?"/static/img/map/"+t.data.icon+"_online.png":"/static/img/map/camera_device.png"))}},created:function(){},mounted:function(){},watch:{mapInfo:{handler:function(t,e){var i=this;this.$nextTick(function(){i.svgMapInit()})},deep:!0,immediate:!0},iconArr:{handler:function(t,e){t&&t!==e&&this.iconListInit(t)},deep:!0,immediate:!0},alarmDeviceList:{handler:function(t,e){var i=this;if(t&&t!==e){var r=t.map(function(t){return t.deviceId});this.iconObjArr.map(function(t){var e=t.data&&t.data.id?t.data.id:null,n=document.querySelector("#"+t._renderer.elem.id);-1!==r.indexOf(e)?n&&"_alarm"!==t.state&&(t.state="_alarm",n.getElementsByTagNameNS("http://www.w3.org/2000/svg","image")[0].setAttributeNS(null,"href",t.data&&t.data.icon?"/static/img/map/"+t.data.icon+"_alarm.png":"/static/img/map/camera_device.png")):i.initIcon(t)})}},immediate:!0}}},_=i("XyMi");var p=function(t){i("5R7W")},m=Object(_.a)(g,function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"position-box pr p10"},[i("div",{ref:"drawMap",staticClass:"position-box",attrs:{id:"drawMap"}}),t._v(" "),i("b-button-group",{staticClass:"zoomBtnGroup",attrs:{vertical:"",size:"sm"}},[i("b-button",{attrs:{variant:"primary",title:"放大"},on:{click:t.zoomBig}},[i("span",{staticClass:"fa fa-plus"})]),t._v(" "),i("div",{staticClass:"border-top"}),t._v(" "),i("b-button",{attrs:{variant:"primary",title:"重置位置"},on:{click:t.pantoHome}},[i("span",{staticClass:"fa fa-circle"})]),t._v(" "),i("div",{staticClass:"border-top"}),t._v(" "),i("b-button",{attrs:{variant:"primary",title:"缩小"},on:{click:t.zoomSmall}},[i("span",{staticClass:"fa fa-minus"})])],1)],1)},[],!1,p,"data-v-4473dcf7",null).exports,v=i("Ls4C"),y={props:{index:{type:Number,default:0},w:{type:Number,default:100},h:{type:Number,default:100},data:{type:Object,default:null},tags:{type:Object,default:null},toDOMId:{type:String,default:""}},data:function(){return{grabEvents:["mousedown","touchstart"],moveEvents:["mousemove","touchmove"],releaseEvents:["mouseup","touchend"],isAdd:!1,isOnDowm:!1,boxContent:{},beginx:0,beginy:0,item:"",CloneDom:null}},mounted:function(){this.item=this.$refs.box,this.listenEvents()},methods:{_addGrabListeners:function(){var t=this;this.grabEvents.forEach(function(e){window.addEventListener(e,t._onMouseDown,{passive:!1})}),this.moveEvents.forEach(function(e){window.document.addEventListener(e,t._onMouseMove,{passive:!1})}),this.releaseEvents.forEach(function(e){window.document.addEventListener(e,t._onMouseUp,{passive:!1})})},listenEvents:function(){this._addGrabListeners()},_onMouseDown:function(t){this.boxContent=this._getContainerRect(this.item),this.isAdd=this._current(this.boxContent,t),!this.isOnDowm&&this.isAdd&&(this.isOnDowm=!0,this.$emit("down",{index:this.index,data:this.data,tags:this.tags}),this.beginx=t.clientX||t.changedTouches[0].clientX,this.beginy=t.clientY||t.changedTouches[0].clientY,this.CloneDom=this.item.cloneNode(!0),document.getElementsByTagName("body")[0].append(this.CloneDom),this.CloneDom.style.position="absolute",this.CloneDom.style.width=this.w+"px",this.CloneDom.style.height=this.h+"px",this.CloneDom.style.top=this.beginy-20+"px",this.CloneDom.style.left=this.beginx-20+"px",this.CloneDom.style.opacity=.4)},_onMouseMove:function(t){if(this.isOnDowm){var e=this._getContainerRect(this.item);this.boxContent=e;var i=t.clientX||t.changedTouches[0].clientX,r=t.clientY||t.changedTouches[0].clientY,n=i-this.beginx,s=r-this.beginy;if(this.beginy=r,this.beginx=i,this.isAdd&&this.CloneDom){var a=n+this.CloneDom.offsetLeft,o=s+this.CloneDom.offsetTop;this.CloneDom&&(this.CloneDom.style.position="absolute",this.CloneDom.style.top=o+"px",this.CloneDom.style.left=a+"px")}}},_onMouseUp:function(t){if(this.CloneDom&&document.getElementsByTagName("body")[0].removeChild(this.CloneDom),this.CloneDom=null,this.isOnDowm&&this.isAdd){var e=t.clientX||t.changedTouches[0].clientX,i=t.clientY||t.changedTouches[0].clientY;if(this.isOnDowm=!1,""!==this.toDOMId){var r=document.getElementById(this.toDOMId),n=this._getContainerRect(r);if(!(i>=n.top&&i<=n.bottom&&e>=n.left&&e<=n.right))return!1;e-=n.left,i-=n.top}this.$emit("_getContainerRect",{x:e,y:i,index:this.index,data:this.data,tags:this.tags})}return!1},_current:function(t,e){return t.left<=(e.clientX||e.changedTouches[0].clientX)&&t.right>=(e.clientX||e.changedTouches[0].clientX)&&t.top<=(e.clientY||e.changedTouches[0].clientY)&&t.bottom>=(e.clientY||e.changedTouches[0].clientY)},_getContainerRect:function(t){var e=t.getBoundingClientRect();return{left:e.left,right:e.right,top:e.top,bottom:e.bottom,width:e.width,height:e.height}},reset:function(){this.item.style.position&&(this.item.style.position="static")}}};var x=function(t){i("/p1R")},b=Object(_.a)(y,function(){var t=this.$createElement;return(this._self._c||t)("div",{ref:"box"},[this._t("default")],2)},[],!1,x,"data-v-f55f5b66",null).exports,w=Object.assign||function(t){for(var e=1;e