webpackJsonp([7],{"/p1R":function(t,e){},"5R7W":function(t,e){},GGQW:function(t,e,i){(function(i){var r,n,s,a;this.Two=function(n){var s="undefined"!=typeof window?window:void 0!==i?i:null,a=Object.prototype.toString,o={_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]"===a.call(t)},isFunction:function(t){return"[object Function]"===a.call(t)},isString:function(t){return"[object String]"===a.call(t)},isNumber:function(t){return"[object Number]"===a.call(t)},isDate:function(t){return"[object Date]"===a.call(t)},isRegExp:function(t){return"[object RegExp]"===a.call(t)},isError:function(t){return"[object Error]"===a.call(t)},isFinite:function(t){return isFinite(t)&&!isNaN(parseFloat(t))},isNaN:function(t){return o.isNumber(t)&&t!==+t},isBoolean:function(t){return!0===t||!1===t||"[object Boolean]"===a.call(t)},isNull:function(t){return null===t},isUndefined:function(t){return void 0===t},isEmpty:function(t){return null==t||(b&&(o.isArray(t)||o.isString(t)||o.isArguments(t))?0===t.length:0===o.keys(t).length)},isElement:function(t){return!(!t||1!==t.nodeType)},isArray:Array.isArray||function(t){return"[object Array]"===a.call(t)},isObject:function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},toArray:function(t){return t?o.isArray(t)?v.call(t):b(t)?o.map(t,o.identity):o.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<=x},w={temp:s.document?s.document.createElement("div"):{},hasEventListeners:o.isFunction(s.addEventListener),bind:function(t,e,i,r){return this.hasEventListeners?t.addEventListener(e,i,!!r):t.attachEvent("on"+e,i),w},unbind:function(t,e,i,r){return w.hasEventListeners?t.removeEventListeners(e,i,!!r):t.detachEvent("on"+e,i),w},getRequestAnimationFrame:function(){var t,e=0,i=["ms","moz","webkit","o"],r=s.requestAnimationFrame;if(!r){for(var n=0;n1&&(i=1);break;case"m":case"l":case"t":s.length>2&&(i=2);break;case"s":case"q":s.length>4&&(i=4);break;case"c":s.length>6&&(i=6)}if(i){for(var o=0,h=s.length,c=0;o0)switch(r){case"m":d="l";break;case"M":d="L"}a.push([d].concat(s.slice(o,o+i)).join(" ")),c++}l=Array.prototype.concat.apply(l,a)}else l.push(t)});var c=[];if(o.each(l,function(t,r){var l,d,u,f,g,p,m,v,y,x,b,w,A=t[0],E=A.toLowerCase();switch(i=(i=(i=t.slice(1).trim()).replace(/(-?\d+(?:\.\d*)?)[eE]([+\-]?\d+)/g,function(t,e,i){return parseFloat(e)*_(10,i)})).split(/[\s,]+|(?=\s?[+\-])/),a=A===E,E){case"z":r>=h?s=!0:(d=n.x,u=n.y,l=new S.Anchor(d,u,void 0,void 0,void 0,void 0,S.Commands.close));break;case"m":case"l":d=parseFloat(i[0]),u=parseFloat(i[1]),l=new S.Anchor(d,u,void 0,void 0,void 0,void 0,"m"===E?S.Commands.move:S.Commands.line),a&&l.addSelf(n),n=l;break;case"h":case"v":var k="x"===(q="h"===E?"x":"y")?"y":"x";(l=new S.Anchor(void 0,void 0,void 0,void 0,void 0,void 0,S.Commands.line))[q]=parseFloat(i[0]),l[k]=n[k],a&&(l[q]+=n[q]),n=l;break;case"c":case"s":f=n.x,g=n.y,e||(e=new S.Vector),"c"===E?(p=parseFloat(i[0]),m=parseFloat(i[1]),v=parseFloat(i[2]),y=parseFloat(i[3]),x=parseFloat(i[4]),b=parseFloat(i[5])):(p=(w=L(n,e,a)).x,m=w.y,v=parseFloat(i[0]),y=parseFloat(i[1]),x=parseFloat(i[2]),b=parseFloat(i[3])),a&&(p+=f,m+=g,v+=f,y+=g,x+=f,b+=g),o.isObject(n.controls)||S.Anchor.AppendCurveProperties(n),n.controls.right.set(p-n.x,m-n.y),l=new S.Anchor(x,b,v-x,y-b,void 0,void 0,S.Commands.curve),n=l,e=l.controls.left;break;case"t":case"q":f=n.x,g=n.y,e||(e=new S.Vector),e.isZero()?(p=f,m=g):(p=e.x,g=e.y),"q"===E?(v=parseFloat(i[0]),y=parseFloat(i[1]),x=parseFloat(i[1]),b=parseFloat(i[2])):(v=(w=L(n,e,a)).x,y=w.y,x=parseFloat(i[0]),b=parseFloat(i[1])),a&&(p+=f,m+=g,v+=f,y+=g,x+=f,b+=g),o.isObject(n.controls)||S.Anchor.AppendCurveProperties(n),n.controls.right.set(p-n.x,m-n.y),l=new S.Anchor(x,b,v-x,y-b,void 0,void 0,S.Commands.curve),n=l,e=l.controls.left;break;case"a":f=n.x,g=n.y;var C=parseFloat(i[0]),M=parseFloat(i[1]),F=parseFloat(i[2])*Math.PI/180,O=parseFloat(i[3]),T=parseFloat(i[4]);x=parseFloat(i[5]),b=parseFloat(i[6]),a&&(x+=f,b+=g);var P=(x-f)/2,U=(b-g)/2,I=P*Math.cos(F)+U*Math.sin(F),N=-P*Math.sin(F)+U*Math.cos(F),j=C*C,D=M*M,B=I*I,G=N*N,V=B/j+G/D;V>1&&(C*=Math.sqrt(V),M*=Math.sqrt(V));var z=Math.sqrt((j*D-j*G-D*B)/(j*G+D*B));o.isNaN(z)?z=0:O!=T&&z>0&&(z*=-1);var q,H=z*C*N/M,$=-z*M*I/C,X=H*Math.cos(F)-$*Math.sin(F)+(f+x)/2,Y=H*Math.sin(F)+$*Math.cos(F)+(g+b)/2,W=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2))},J=function(t,e){return(t[0]*e[0]+t[1]*e[1])/(W(t)*W(e))},K=(q=function(t,e){return(t[0]*e[1]=1&&(tt=0),O&&(tt=R(tt,2*Math.PI)),T&&tt>0&&(tt-=2*Math.PI);var et=S.Resolution,it=(new S.Matrix).translate(X,Y).rotate(F);(l=o.map(o.range(et),function(t){var e=(1-t/(et-1))*tt+K,i=C*Math.cos(e),r=M*Math.sin(e),n=it.multiply(i,r,1);return new S.Anchor(n.x,n.y,!1,!1,!1,!1,S.Commands.line)})).push(new S.Anchor(x,b,!1,!1,!1,!1,S.Commands.line)),n=l[l.length-1],e=n.controls.left}l&&(o.isArray(l)?c=c.concat(l):c.push(l))}),!(c.length<=1)){(r=new S.Path(c,s,void 0,!0).noStroke()).fill="black";var d=r.getBoundingClientRect(!0);return d.centroid={x:d.left+d.width/2,y:d.top+d.height/2},o.each(r.vertices,function(t){t.subSelf(d.centroid)}),r.translation.addSelf(d.centroid),S.Utils.applySvgAttributes.call(this,t,r)}},circle:function(t){var e=parseFloat(t.getAttribute("cx")),i=parseFloat(t.getAttribute("cy")),r=parseFloat(t.getAttribute("r")),n=new S.Circle(e,i,r).noStroke();return n.fill="black",S.Utils.applySvgAttributes.call(this,t,n)},ellipse:function(t){var e=parseFloat(t.getAttribute("cx")),i=parseFloat(t.getAttribute("cy")),r=parseFloat(t.getAttribute("rx")),n=parseFloat(t.getAttribute("ry")),s=new S.Ellipse(e,i,r,n).noStroke();return s.fill="black",S.Utils.applySvgAttributes.call(this,t,s)},rect:function(t){var e=parseFloat(t.getAttribute("x"))||0,i=parseFloat(t.getAttribute("y"))||0,r=parseFloat(t.getAttribute("width")),n=parseFloat(t.getAttribute("height")),s=r/2,a=n/2,o=new S.Rectangle(e+s,i+a,r,n).noStroke();return o.fill="black",S.Utils.applySvgAttributes.call(this,t,o)},line:function(t){var e=parseFloat(t.getAttribute("x1")),i=parseFloat(t.getAttribute("y1")),r=parseFloat(t.getAttribute("x2")),n=parseFloat(t.getAttribute("y2")),s=new S.Line(e,i,r,n).noFill();return S.Utils.applySvgAttributes.call(this,t,s)},lineargradient:function(t){for(var e=parseFloat(t.getAttribute("x1")),i=parseFloat(t.getAttribute("y1")),r=parseFloat(t.getAttribute("x2")),n=parseFloat(t.getAttribute("y2")),s=(r+e)/2,a=(n+i)/2,l=[],h=0;h1?c[1]:void 0;if(o.isNull(_))_=(c=!!g&&g.match(/stop\-opacity\:\s?([0-9\.\-]*)/))&&c.length>1?parseFloat(c[1]):1;l.push(new S.Gradient.Stop(u,f,_))}var p=new S.LinearGradient(e-s,i-a,r-s,n-a,l);return S.Utils.applySvgAttributes.call(this,t,p)},radialgradient:function(t){var e=parseFloat(t.getAttribute("cx"))||0,i=parseFloat(t.getAttribute("cy"))||0,r=parseFloat(t.getAttribute("r")),n=parseFloat(t.getAttribute("fx")),s=parseFloat(t.getAttribute("fy"));o.isNaN(n)&&(n=e),o.isNaN(s)&&(s=i);for(var a=Math.abs(e+n)/2,l=Math.abs(i+s)/2,h=[],c=0;c1?d[1]:void 0;if(o.isNull(g))g=(d=!!p&&p.match(/stop\-opacity\:\s?([0-9\.\-]*)/))&&d.length>1?parseFloat(d[1]):1;h.push(new S.Gradient.Stop(f,_,g))}var m=new S.RadialGradient(e-a,i-l,r,h,n-a,s-l);return S.Utils.applySvgAttributes.call(this,t,m)}},subdivide:function(t,e,i,r,n,s,a,l,h){var c=(h=h||S.Utils.Curve.RecursionLimit)+1;return t===a&&e===l?[new S.Anchor(a,l)]:o.map(o.range(0,c),function(o){var h=o/c,d=O(h,t,i,n,a),u=O(h,e,r,s,l);return new S.Anchor(d,u)})},getPointOnCubicBezier:function(t,e,i,r,n){var s=1-t;return s*s*s*e+3*s*s*t*i+3*s*t*t*r+t*t*t*n},getCurveLength:function(t,e,i,r,n,s,a,o,l){if(t===i&&e===r&&n===a&&s===o){var h=a-t,c=o-e;return d(h*h+c*c)}var u=9*(i-n)+3*(a-t),f=6*(t+n)-12*i,_=3*(i-t),g=9*(r-s)+3*(o-e),p=6*(e+s)-12*r,m=3*(r-e);return T(function(t){var e=(u*t+f)*t+_,i=(g*t+p)*t+m;return d(e*e+i*i)},0,1,l||S.Utils.Curve.RecursionLimit)},integrate:function(t,e,i,r){for(var n=S.Utils.Curve.abscissas[r-2],s=S.Utils.Curve.weights[r-2],a=.5*(i-e),o=a+e,l=0,h=r+1>>1,c=1&r?s[l++]*t(o):0;l=4?(i=arguments[0]-arguments[2],r=arguments[1]-arguments[3],c(r,i)):(i=t.x-e.x,r=t.y-e.y,c(r,i))},distanceBetweenSquared:function(t,e){var i=t.x-e.x,r=t.y-e.y;return i*i+r*r},distanceBetween:function(t,e){return d(k(t,e))},lerp:function(t,e,i){return i*(e-t)+t},toFixed:function(t){return Math.floor(1e3*t)/1e3},mod:function(t,e){for(;t<0;)t+=e;return t%e},Collection:function(){Array.call(this),arguments.length>1?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]:o.keys(this._events),r=0,n=i.length;r2&&(t=this.slice(arguments[0],arguments[0]+arguments.length-2),this.trigger(S.Events.insert,t),this.trigger(S.Events.order)),e},sort:function(){return Array.prototype.sort.apply(this,arguments),this.trigger(S.Events.order),this},reverse:function(){return Array.prototype.reverse.apply(this,arguments),this.trigger(S.Events.order),this}});var E=S.Utils.distanceBetween,k=(S.Utils.getAnchorsFromArcData,S.Utils.distanceBetweenSquared),C=(S.Utils.ratioBetween,S.Utils.angleBetween),M=S.Utils.getControlPoints,R=(S.Utils.getCurveFromPoints,S.Utils.solveSegmentIntersection,S.Utils.decoupleShapes,S.Utils.mod),F=S.Utils.getBackingStoreRatio,O=S.Utils.getPointOnCubicBezier,T=(S.Utils.getCurveLength,S.Utils.integrate),L=S.Utils.getReflection;function P(){var t=document.body.getBoundingClientRect(),e=this.width=t.width,i=this.height=t.height;this.renderer.setSize(e,i,this.ratio),this.trigger(S.Events.resize,e,i)}o.extend(S.prototype,S.Utils.Events,{appendTo:function(t){return t.appendChild(this.renderer.domElement),this},play:function(){return S.Utils.setPlaying.call(this,!0),this.trigger(S.Events.play)},pause:function(){return this.playing=!1,this.trigger(S.Events.pause)},update:function(){var t=!!this._lastFrame,e=y.now();this.frameCount++,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(S.Events.update,this.frameCount,this.timeDelta),this.render()},render:function(){return this.renderer.render(),this.trigger(S.Events.render,this.frameCount)},add:function(t){var e=t;return e instanceof Array||(e=o.toArray(arguments)),this.scene.add(e),this},remove:function(t){var e=t;return e instanceof Array||(e=o.toArray(arguments)),this.scene.remove(e),this},clear:function(){return this.scene.remove(o.toArray(this.scene.children)),this},makeLine:function(t,e,i,r){var n=new S.Line(t,e,i,r);return this.scene.add(n),n},makeRectangle:function(t,e,i,r){var n=new S.Rectangle(t,e,i,r);return this.scene.add(n),n},makeRoundedRectangle:function(t,e,i,r,n){var s=new S.RoundedRectangle(t,e,i,r,n);return this.scene.add(s),s},makeCircle:function(t,e,i){var r=new S.Circle(t,e,i);return this.scene.add(r),r},makeEllipse:function(t,e,i,r){var n=new S.Ellipse(t,e,i,r);return this.scene.add(n),n},makeStar:function(t,e,i,r,n){var s=new S.Star(t,e,i,r,n);return this.scene.add(s),s},makeCurve:function(t){var e=arguments.length,i=t;if(!o.isArray(t)){i=[];for(var r=0;r=o&&n&&(y._command===t.Commands.curve&&(S=s,m=y.controls&&y.controls.right||y,v=S.controls&&S.controls.left||S,y._relative?(d=i(m.x+y.x),u=i(m.y+y.y)):(d=i(m.x),u=i(m.y)),S._relative?(f=i(v.x+S.x),_=i(v.y+S.y)):(f=i(v.x),_=i(v.y)),c+=" C "+d+" "+u+" "+f+" "+_+" "+(A=i(S.x))+" "+(E=i(S.y))),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&&(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,{setSize:function(t,e){return this.width=t,this.height=e,n.setAttributes(this.domElement,{width:t,height:e}),this},render:function(){return n.group.render.call(this.scene,this.domElement),this}})}((void 0!==i?i:this).Two),function(t){var e=t.Utils.mod,i=t.Utils.toFixed,r=t.Utils.getRatio,n=t.Utils,s=function(t){return 1==t[0]&&0==t[3]&&0==t[1]&&1==t[4]&&0==t[2]&&0==t[5]},a={isHidden:/(none|transparent)/i,alignments:{left:"start",middle:"center",right:"end"},shim:function(t){return t.tagName="canvas",t.nodeType=1,t},group:{renderChild:function(t){a[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=s(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&&a[n._renderer.type].render.call(n,t,!0),this.opacity>0&&0!==this.scale)for(var o=0;o=b&&v&&(k=C,P=E.controls&&E.controls.right||t.Vector.zero,U=k.controls&&k.controls.left||t.Vector.zero,E._relative?(F=P.x+i(E._x),O=P.y+i(E._y)):(F=i(P.x),O=i(P.y)),k._relative?(M=U.x+i(k._x),R=U.y+i(k._y)):(M=i(U.x),R=i(U.y)),I=i(k._x),N=i(k._y),r.bezierCurveTo(F,O,M,R,I,N));break;case t.Commands.line:r.lineTo(I,N);break;case t.Commands.move:C=E,r.moveTo(I,N)}return v&&r.closePath(),j||l||(a.isHidden.test(u)||((B=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(),B&&r.restore()),a.isHidden.test(c)||((B=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(),B&&r.restore())),D||r.restore(),j&&!l&&r.clip(),this.flagReset()}},text:{render:function(t,e,r){this._update();var o,l,h,c,d,u,f,_=this._matrix.elements,g=this._stroke,p=this._linewidth,m=this._fill,v=this._opacity*this.parent._renderer.opacity,y=this._visible,x=s(_),b=m._renderer&&m._renderer.offset&&g._renderer&&g._renderer.offset,w=this._clip;return e||y&&!w?(x||(t.save(),t.transform(_[0],_[3],_[1],_[4],_[2],_[5])),b||(t.font=[this._style,this._weight,this._size+"px/"+this._leading+"px",this._family].join(" ")),t.textAlign=a.alignments[this._alignment]||this._alignment,t.textBaseline=this._baseline,m&&(n.isString(m)?t.fillStyle=m:(a[m._renderer.type].render.call(m,t),t.fillStyle=m._renderer.effect)),g&&(n.isString(g)?t.strokeStyle=g:(a[g._renderer.type].render.call(g,t),t.strokeStyle=g._renderer.effect)),p&&(t.lineWidth=p),n.isNumber(v)&&(t.globalAlpha=v),w||r||(a.isHidden.test(m)||(m._renderer&&m._renderer.offset?(u=i(m._renderer.scale.x),f=i(m._renderer.scale.y),t.save(),t.translate(-i(m._renderer.offset.x),-i(m._renderer.offset.y)),t.scale(u,f),o=this._size/m._renderer.scale.y,l=this._leading/m._renderer.scale.y,t.font=[this._style,this._weight,i(o)+"px/",i(l)+"px",this._family].join(" "),h=m._renderer.offset.x/m._renderer.scale.x,c=m._renderer.offset.y/m._renderer.scale.y,t.fillText(this.value,i(h),i(c)),t.restore()):t.fillText(this.value,0,0)),a.isHidden.test(g)||(g._renderer&&g._renderer.offset?(u=i(g._renderer.scale.x),f=i(g._renderer.scale.y),t.save(),t.translate(-i(g._renderer.offset.x),-i(g._renderer.offset.y)),t.scale(u,f),o=this._size/g._renderer.scale.y,l=this._leading/g._renderer.scale.y,t.font=[this._style,this._weight,i(o)+"px/",i(l)+"px",this._family].join(" "),h=g._renderer.offset.x/g._renderer.scale.x,c=g._renderer.offset.y/g._renderer.scale.y,d=p/g._renderer.scale.x,t.lineWidth=i(d),t.strokeText(this.value,i(h),i(c)),t.restore()):t.strokeText(this.value,0,0))),x||t.restore(),w&&!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;e=U&&L&&(a=I,p=b.controls&&b.controls.right||t.Vector.zero,m=a.controls&&a.controls.left||t.Vector.zero,b._relative?(u=o(p.x+b._x),f=o(p.y+b._y)):(u=o(p.x),f=o(p.y)),a._relative?(c=o(m.x+a._x),d=o(m.y+a._y)):(c=o(m.x),d=o(m.y)),v=o(a._x),y=o(a._y),A.bezierCurveTo(u,f,c,d,v,y));break;case t.Commands.line:A.lineTo(v,y);break;case t.Commands.move:I=b,A.moveTo(v,y)}L&&A.closePath(),h.isHidden.test(M)||((x=M._renderer&&M._renderer.offset)&&(A.save(),A.translate(-M._renderer.offset.x,-M._renderer.offset.y),A.scale(M._renderer.scale.x,M._renderer.scale.y)),A.fill(),x&&A.restore()),h.isHidden.test(k)||((x=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=C/k._renderer.scale.x),A.stroke(),x&&A.restore()),A.restore()},getBoundingClientRect:function(t,e,i){var r,n,s=1/0,a=-1/0,o=1/0,h=-1/0;t.forEach(function(t){var e,i,r,n,l,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),h=Math.max(u,h),t.controls&&(l=f.left,c=f.right,l&&c&&(e=t._relative?l.x+d:l.x,i=t._relative?l.y+u:l.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),h=Math.max(i,n,h))))}),l.isNumber(e)&&(o-=e,s-=e,a+=e,h+=e),r=a-s,n=h-o,i.top=o,i.left=s,i.right=a,i.bottom=h,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,c=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._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._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||a._flagOpacity||this._flagVisible||this._flagCap||this._flagJoin||this._flagMiter||this._flagScale||!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),c&&(this._renderer.rect||(this._renderer.rect={}),this._renderer.triangles||(this._renderer.triangles=new t.Array(12)),this._renderer.opacity=this._opacity*a._renderer.opacity,h.path.getBoundingClientRect(this._vertices,this._linewidth,this._renderer.rect),h.getTriangles(this._renderer.rect,this._renderer.triangles),h.updateBuffer.call(h,e,this,r),h.updateTexture.call(h,e,this)),!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,c=t._renderer.opacity||t._opacity;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 d,u,f,_,g,p,m,v=t._renderer.rect.centroid,y=v.x,x=v.y,b=a._renderer&&a._renderer.offset&&n._renderer&&n._renderer.offset;i.clearRect(0,0,e.width,e.height),b||(i.font=[t._style,t._weight,t._size+"px/"+t._leading+"px",t._family].join(" ")),i.textAlign="center",i.textBaseline="middle",a&&(l.isString(a)?i.fillStyle=a:(h[a._renderer.type].render.call(a,i,t),i.fillStyle=a._renderer.effect)),n&&(l.isString(n)?i.strokeStyle=n:(h[n._renderer.type].render.call(n,i,t),i.strokeStyle=n._renderer.effect)),s&&(i.lineWidth=s),l.isNumber(c)&&(i.globalAlpha=c),i.save(),i.scale(r,r),i.translate(y,x),h.isHidden.test(a)||(a._renderer&&a._renderer.offset?(p=o(a._renderer.scale.x),m=o(a._renderer.scale.y),i.save(),i.translate(-o(a._renderer.offset.x),-o(a._renderer.offset.y)),i.scale(p,m),d=t._size/a._renderer.scale.y,u=t._leading/a._renderer.scale.y,i.font=[t._style,t._weight,o(d)+"px/",o(u)+"px",t._family].join(" "),f=a._renderer.offset.x/a._renderer.scale.x,_=a._renderer.offset.y/a._renderer.scale.y,i.fillText(t.value,o(f),o(_)),i.restore()):i.fillText(t.value,0,0)),h.isHidden.test(n)||(n._renderer&&n._renderer.offset?(p=o(n._renderer.scale.x),m=o(n._renderer.scale.y),i.save(),i.translate(-o(n._renderer.offset.x),-o(n._renderer.offset.y)),i.scale(p,m),d=t._size/n._renderer.scale.y,u=t._leading/n._renderer.scale.y,i.font=[t._style,t._weight,o(d)+"px/",o(u)+"px",t._family].join(" "),f=n._renderer.offset.x/n._renderer.scale.x,_=n._renderer.offset.y/n._renderer.scale.y,g=s/n._renderer.scale.x,i.lineWidth=o(g),i.strokeText(t.value,o(f),o(_)),i.restore()):i.strokeText(t.value,0,0)),i.restore()},getBoundingClientRect:function(t,e){var i=h.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&&!h.isHidden.test(this._stroke)&&(n+=this._linewidth);var s=r/2,a=n/2;switch(h.alignments[t._alignment]||t._alignment){case h.alignments.left:e.left=0,e.right=r;break;case h.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,c=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._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._texture instanceof t.Texture&&this._texture._flagLoaded&&this._texture.loaded||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._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),c&&(this._renderer.rect||(this._renderer.rect={}),this._renderer.triangles||(this._renderer.triangles=new t.Array(12)),this._renderer.opacity=this._opacity*a._renderer.opacity,h.text.getBoundingClientRect(this,this._renderer.rect),h.getTriangles(this._renderer.rect,this._renderer.triangles),h.updateBuffer.call(h,e,this,r),h.updateTexture.call(h,e,this)),!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=v){this._closed?(r=t.Utils.mod(S,y),n=t.Utils.mod(S-1,y),0===S&&(r=n,n=S)):(r=S,n=Math.min(Math.max(S-1,0),x)),b=this.vertices[r],w=this.vertices[n],v-=E,0!==this._lengths[S]&&(e=v/this._lengths[S]);break}E+=this._lengths[S]}return a.isNull(b)||a.isNull(w)?null:(m=w.controls&&w.controls.right,p=b.controls&&b.controls.left,o=w.x,u=w.y,l=(m||w).x,f=(m||w).y,h=(p||b).x,_=(p||b).y,c=b.x,g=b.y,m&&w._relative&&(l+=w.x,f+=w.y),p&&b._relative&&(h+=b.x,_+=b.y),s=t.Utils.getPointOnCubicBezier(e,o,l,h,c),d=t.Utils.getPointOnCubicBezier(e,u,f,_,g),a.isObject(i)?(i.x=s,i.y=d,i):new t.Vector(s,d))},plot:function(){if(this.curved)return t.Utils.getCurveFromPoints(this._vertices,this.closed),this;for(var e=0;e0&&(s[s.length-1].command=t.Commands.line),void(r=o);var c=h(o,r,e);s=s.concat(c),a.each(c,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?(c=h(o,r=o,e),s=s.concat(c),a.each(c,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(o.x,o.y)),s[s.length-1].command=n?t.Commands.close:t.Commands.line),r=o}},this),this._automatic=!1,this._curved=!1,this.vertices=s,this},_updateLength:function(e){this._update();var i=this.vertices.length,r=i-1,n=this.vertices[r],s=this._closed||this.vertices[r]._command===t.Commands.close,o=0;return a.isUndefined(this._lengths)&&(this._lengths=[]),a.each(this.vertices,function(a,h){if(h<=0&&!s||a.command===t.Commands.move)return n=a,void(this._lengths[h]=0);this._lengths[h]=l(a,n,e),o+=this._lengths[h],h>=r&&s&&(n=this.vertices[(h+1)%i],this._lengths[h+1]=l(a,n,e),o+=this._lengths[h+1]),n=a},this),this._length=o,this},_update:function(){if(this._flagVertices){var e,i=this.vertices.length-1,n=r(this._beginning*i),s=r(this._ending*i);this._vertices.length=0;for(var a=n;as&&this.vertices.splice(s-1,a-s);for(var o=0;o=a?this.vertices.push(new t.Anchor(h,c)):this.vertices[o].set(h,c)}}return e.prototype._update.call(this),this},flagReset:function(){return this._flagWidth=this._flagHeight=this._flagSides=!1,e.prototype.flagReset.call(this),this}}),a.MakeObservable(a.prototype)}((void 0!==i?i:this).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=n.map(n.range(h||3*t.Resolution),function(){return new t.Anchor});e.call(this,c,!1,!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,_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,_=0;c?f--:d||(f-=2);for(var g=0,p=f-1;gs&&this.vertices.splice(s-1,a-s);for(var o=0;o=a?this.vertices.push(new t.Anchor(c,d)):this.vertices[o].set(c,d)}}return e.prototype._update.call(this),this},flagReset:function(){return this._flagInnerRadius=this._flagOuterRadius=this._flagSides=!1,e.prototype.flagReset.call(this),this}}),a.MakeObservable(a.prototype)}((void 0!==i?i:this).Two),function(t){var e=t.Path,i=t.Utils,r=t.RoundedRectangle=function(r,n,s,a,o){i.isNumber(o)||(o=Math.floor(Math.min(s,a)/12));var l=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)});l[l.length-1].command=t.Commands.close,e.call(this,l,!1,!1,!0),this.width=s,this.height=a,this.radius=o,this._update(),this.translation.set(r,n)};i.extend(r,{Properties:["width","height","radius"],MakeObservable:function(n){e.MakeObservable(n),i.each(r.Properties,t.Utils.defineProperty,n)}}),i.extend(r.prototype,e.prototype,{_width:0,_height:0,_radius:0,_flagWidth:!1,_flagHeight:!1,_flagRadius:!1,_update:function(){if(this._flagWidth||this._flagHeight||this._flagRadius){var t,i=this._width,r=this._height,n=Math.min(Math.max(this._radius,0),Math.min(i,r)),s=i/2,a=r/2;(t=this.vertices[0]).x=-(s-n),t.y=-a,(t=this.vertices[1]).x=s-n,t.y=-a,t.controls.left.clear(),t.controls.right.x=n,t.controls.right.y=0,(t=this.vertices[2]).x=s,t.y=-(a-n),t.controls.right.clear(),t.controls.left.clear(),(t=this.vertices[3]).x=s,t.y=a-n,t.controls.left.clear(),t.controls.right.x=0,t.controls.right.y=n,(t=this.vertices[4]).x=s-n,t.y=a,t.controls.right.clear(),t.controls.left.clear(),(t=this.vertices[5]).x=-(s-n),t.y=a,t.controls.left.clear(),t.controls.right.x=-n,t.controls.right.y=0,(t=this.vertices[6]).x=-s,t.y=a-n,t.controls.left.clear(),t.controls.right.clear(),(t=this.vertices[7]).x=-s,t.y=-(a-n),t.controls.left.clear(),t.controls.right.x=0,t.controls.right.y=-n,(t=this.vertices[8]).x=-(s-n),t.y=-a,t.controls.left.clear(),t.controls.right.clear(),(t=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}}),r.MakeObservable(r.prototype)}((void 0!==i?i:this).Two),function(t){var e=t.root,i=t.Utils.getComputedMatrix,r=t.Utils,n=((e.document?e.document.createElement("canvas"):{getContext:r.identity}).getContext("2d"),t.Text=function(e,i,s,a){if(t.Shape.call(this),this._renderer.type="text",this._renderer.flagFill=r.bind(n.FlagFill,this),this._renderer.flagStroke=r.bind(n.FlagStroke,this),this.value=e,r.isNumber(i)&&(this.translation.x=i),r.isNumber(s)&&(this.translation.y=s),!r.isObject(a))return this;r.each(t.Text.Properties,function(t){t in a&&(this[t]=a[t])},this)});r.extend(t.Text,{Properties:["value","family","size","leading","alignment","linewidth","style","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,12),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,_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,_visible:!0,_clip:!1,remove:function(){return this.parent?(this.parent.remove(this),this):this},clone:function(e){e=e||this.parent;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},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;return this._update(!0),{top:(e=(t?this._matrix:i(this)).multiply(0,0,1)).x,left:e.y,right:e.x,bottom:e.y,width:0,height:0}},flagReset:function(){return this._flagValue=this._flagFamily=this._flagSize=this._flagLeading=this._flagAlignment=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpaicty=this._flagVisible=this._flagClip=this._flagDecoration=this._flagBaseline=!1,t.Shape.prototype.flagReset.call(this),this}}),t.Text.MakeObservable(t.Text.prototype)}((void 0!==i?i:this).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,{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);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){i=i||this.parent;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!==i?i:this).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,clone:function(r){r=r||this.parent;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!==i?i:this).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,clone:function(r){r=r||this.parent;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!==i?i:this).Two),function(t){var e,i=t.Utils,r={video:/\.(mp4|webm)$/i,image:/\.(jpe?g|png|gif|tiff)$/i};this.document&&(e=document.createElement("a"));var n=t.Texture=function(e,r){if(this._renderer={},this._renderer.type="texture",this._renderer.flagOffset=i.bind(n.FlagOffset,this),this._renderer.flagScale=i.bind(n.FlagScale,this),this.id=t.Identifier+t.uniqueId(),this.classList=[],this.offset=new t.Vector,i.isFunction(r)){var s=i.bind(function(){this.unbind(t.Events.load,s),i.isFunction(r)&&r()},this);this.bind(t.Events.load,s)}i.isString(e)?this.src=e:i.isElement(e)&&(this.image=e),this._update()};i.extend(n,{Properties:["src","loaded","repeat"],ImageRegistry:new t.Registry,getAbsoluteURL:function(t){return e?(e.href=t,e.href):t},getImage:function(t){var e,i=n.getAbsoluteURL(t);return n.ImageRegistry.contains(i)?n.ImageRegistry.get(i):((e=r.video.test(i)?document.createElement("video"):document.createElement("img")).crossOrigin="anonymous",e)},Register:{canvas:function(t,e){t._src="#"+t.id,n.ImageRegistry.add(t.src,t.image),i.isFunction(e)&&e()},img:function(e,r){var s=function(t){e.image.removeEventListener("load",s,!1),e.image.removeEventListener("error",a,!1),i.isFunction(r)&&r()},a=function(i){throw e.image.removeEventListener("load",s,!1),e.image.removeEventListener("error",a,!1),new t.Utils.Error("unable to load "+e.src)};i.isNumber(e.image.width)&&e.image.width>0&&i.isNumber(e.image.height)&&e.image.height>0?s():(e.image.addEventListener("load",s,!1),e.image.addEventListener("error",a,!1)),e._src=n.getAbsoluteURL(e._src),e.image&&e.image.getAttribute("two-src")||(e.image.setAttribute("two-src",e.src),n.ImageRegistry.add(e.src,e.image),e.image.src=e.src)},video:function(e,r){var s=function(t){e.image.removeEventListener("load",s,!1),e.image.removeEventListener("error",a,!1),e.image.width=e.image.videoWidth,e.image.height=e.image.videoHeight,e.image.play(),i.isFunction(r)&&r()},a=function(i){throw e.image.removeEventListener("load",s,!1),e.image.removeEventListener("error",a,!1),new t.Utils.Error("unable to load "+e.src)};e._src=n.getAbsoluteURL(e._src),e.image.addEventListener("canplaythrough",s,!1),e.image.addEventListener("error",a,!1),e.image&&e.image.getAttribute("two-src")||(e.image.setAttribute("two-src",e.src),n.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)?n.Register.canvas(t,e):(t._src=i.getAttribute("two-src")||i.src,n.Register[r](t,e))),t._flagSrc&&(i||(t.image=n.getImage(t.src)),r=t.image.nodeName.toLowerCase(),n.Register[r](t,e))},FlagOffset:function(){this._flagOffset=!0},FlagScale:function(){this._flagScale=!0},MakeObservable:function(e){i.each(n.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}n.ImageRegistry.contains(e)?this._image=n.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}})}}),i.extend(n.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,clone:function(){return new n(this.src)},toObject:function(){return{src:this.src,image:this.image}},_update:function(){return(this._flagSrc||this._flagImage||this._flagVideo)&&(this.trigger(t.Events.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,n.load(this,i.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}}),n.MakeObservable(n.prototype)}((void 0!==i?i:this).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._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,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){t=t||this.parent;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 _=-t*(this._index%u)+(l-t)/2,g=-i*Math.floor(this._index/u)+(h-i)/2;_!==d.offset.x&&(d.offset.x=_),g!==d.offset.y&&(d.offset.y=g)}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!==i?i:this).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._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,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){t=t||this.parent;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!==i?i:this).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,n.prototype.constructor=n,r.extend(n.prototype,{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;e=0&&(i.splice(a,1),Object.defineProperty(e,"opacity",{enumerable:!0,get:function(){return this._opacity},set:function(t){this._flagOpacity=this._opacity!=t,this._opacity=t}})),t.Shape.MakeObservable(e),s.MakeGetterSetters(e,i),Object.defineProperty(e,"children",{enumerable:!0,get:function(){return this._children},set:function(e){var i=r.bind(s.InsertChildren,this),a=r.bind(s.RemoveChildren,this),o=r.bind(s.OrderChildren,this);this._children&&this._children.unbind(),this._children=new n(e),this._children.bind(t.Events.insert,i),this._children.bind(t.Events.remove,a),this._children.bind(t.Events.order,o)}}),Object.defineProperty(e,"mask",{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,t.clip||(t.clip=!0)}})},MakeGetterSetters:function(t,e){r.isArray(e)||(e=[e]),r.each(e,function(e){s.MakeGetterSetter(t,e)})},MakeGetterSetter:function(t,e){var i="_"+e;Object.defineProperty(t,e,{enumerable:!0,get:function(){return this[i]},set:function(t){this[i]=t,r.each(this.children,function(i){i[e]=t})}})}}),r.extend(s.prototype,t.Shape.prototype,{_flagAdditions:!1,_flagSubtractions:!1,_flagOrder:!1,_flagOpacity:!0,_flagMask:!1,_fill:"#fff",_stroke:"#000",_linewidth:1,_opacity:1,_visible:!0,_cap:"round",_join:"round",_miter:4,_closed:!0,_curved:!1,_automatic:!0,_beginning:0,_ending:1,_mask:null,clone:function(t){t=t||this.parent;var e=new s,i=r.map(this.children,function(t){return t.clone(e)});return e.add(i),e.opacity=this.opacity,this.mask&&(e.mask=this.mask),e.translation.copy(this.translation),e.rotation=this.rotation,e.scale=this.scale,t&&t.add(e),e},toObject:function(){var t={children:[],translation:this.translation.toObject(),rotation:this.rotation,scale:this.scale,opacity:this.opacity,mask:this.mask?this.mask.toObject():null};return r.each(this.children,function(e,i){t.children[i]=e.toObject()},this),t},corner:function(){var t=this.getBoundingClientRect(!0),e={x:t.left,y:t.top};return this.children.forEach(function(t){t.translation.subSelf(e)}),this},center:function(){var t=this.getBoundingClientRect(!0);return t.centroid={x:t.left+t.width/2,y:t.top+t.height/2},this.children.forEach(function(e){e.isShape&&e.translation.subSelf(t.centroid)}),this},getById:function(t){var e=function(t,i){if(t.id===i)return t;if(t.children)for(var r=t.children.length;r--;){var n=e(t.children[r],i);if(n)return n}};return e(this,t)||null},getByClassName:function(t){var e=[],i=function(t,r){return-1!=t.classList.indexOf(r)?e.push(t):t.children&&t.children.forEach(function(t){i(t,r)}),e};return i(this,t)},getByType:function(e){var i=[],r=function(e,n){for(var s in e.children)e.children[s]instanceof n?i.push(e.children[s]):e.children[s]instanceof t.Group&&r(e.children[s],n);return i};return r(this,e)},add:function(t){t=t instanceof Array?t.slice():r.toArray(arguments);for(var e=0;e0;return e(r),i.preventDefault&&i.preventDefault(),!1}-1!==window.navigator.userAgent.indexOf("Firefox")?f(t,"DOMMouseScroll",i):f(t,"mousewheel",i)}(document.querySelector("#drawMap svg"),function(e){e?t.zoomSmall():t.zoomBig()}),_(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(u.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(u.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 d=!0,f=!1,_=void 0;try{for(var g,p=t[Symbol.iterator]();!(d=(g=p.next()).done);d=!0){var m=g.value;this.drawIcon(m)}}catch(t){f=!0,_=t}finally{try{!d&&p.return&&p.return()}finally{if(f)throw _}}}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}})},E=!0,k=!1,C=void 0;try{for(var M,R=i[Symbol.iterator]();!(E=(M=R.next()).done);E=!0){A(M.value)}}catch(t){k=!0,C=t}finally{try{!E&&R.return&&R.return()}finally{if(k)throw C}}}},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),f(s,"click",function(t){e.$emit("iconIteamDelFn",{data:n.data,id:n.data.id})}),_(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 f(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}}},p=i("XyMi");var m=function(t){i("5R7W")},v=Object(p.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,m,"data-v-4473dcf7",null).exports,y=i("Ls4C"),x={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 b=function(t){i("/p1R")},w=Object(p.a)(x,function(){var t=this.$createElement;return(this._self._c||t)("div",{ref:"box"},[this._t("default")],2)},[],!1,b,"data-v-f55f5b66",null).exports,S=Object.assign||function(t){for(var e=1;e