text: /*! svg.panzoom.js v1.2.1 MIT*/;!function(){"use strict";var t=function(t){return t.touches||(t.touches=[{clientX:t.clientX,clientY:t.clientY}]),t.touches};SVG.extend(SVG.Doc,SVG.Nested,{panZoom:function(o){if(this.off(".panZoom"),!1===o)return this;o=o||{};var e={doPanning:!0,doPinchZoom:!0,doWheelZoom:!0,zoomFactor:.03,zoomMin:Number.MIN_VALUE,zoomMax:Number.MAX_VALUE};for(var n in o)o.hasOwnProperty(n)&&(e[n]=o[n]);var i,a,s=e.zoomFactor,c=e.zoomMin,r=e.zoomMax,h=e.doWheelZoom,m=e.doPinchZoom,u=e.doPanning,l=!1,f=function(o){(a=t(o)).length<2||(o.preventDefault(),this.fire("pinchZoomStart",{event:o}).event().defaultPrevented||(this.off("touchstart.panZoom",f),l=!0,SVG.on(document,"touchmove.panZoom",v,this,{passive:!1}),SVG.on(document,"touchend.panZoom",p,this,{passive:!1})))},p=function(t){t.preventDefault(),l=!1,this.fire("pinchZoomEnd",{event:t}),SVG.off(document,"touchmove.panZoom",v),SVG.off(document,"touchend.panZoom",p),this.on("touchstart.panZoom",f)},v=function(o){o.preventDefault();var e=t(o),n=this.zoom(),i=Math.sqrt(Math.pow(a[0].clientX-a[1].clientX,2)+Math.pow(a[0].clientY-a[1].clientY,2))/Math.sqrt(Math.pow(e[0].clientX-e[1].clientX,2)+Math.pow(e[0].clientY-e[1].clientY,2));(n<c&&i>1||n>r&&i<1)&&(i=1);var s={x:e[0].clientX+.5*(e[1].clientX-e[0].clientX),y:e[0].clientY+.5*(e[1].clientY-e[0].clientY)},h={x:a[0].clientX+.5*(a[1].clientX-a[0].clientX),y:a[0].clientY+.5*(a[1].clientY-a[0].clientY)},m=this.point(s.x,s.y),u=this.point(2*s.x-h.x,2*s.y-h.y),l=new SVG.Box(this.viewbox()).transform((new SVG.Matrix).translate(m.x,m.y).scale(i,0,0).translate(-u.x,-u.y));this.viewbox(l),a=e,this.fire("zoom",{box:l,focus:u})},d=function(o){o.preventDefault(),this.off("mousedown.panZoom",d),a=t(o),l||(this.fire("panStart",{event:o}),i={x:a[0].clientX,y:a[0].clientY},SVG.on(document,"mousemove.panZoom",w,this),SVG.on(document,"mouseup.panZoom",x,this))},x=function(t){t.preventDefault(),this.fire("panEnd",{event:t}),SVG.off(document,"mousemove.panZoom",w),SVG.off(document,"mouseup.panZoom",x),this.on("mousedown.panZoom",d)},w=function(o){o.preventDefault();var e=t(o),n={x:e[0].clientX,y:e[0].clientY},a=this.point(n.x,n.y),s=this.point(i.x,i.y),c=[s.x-a.x,s.y-a.y],r=new SVG.Box(this.viewbox()).transform((new SVG.Matrix).translate(c[0],c[1]));this.viewbox(r),i=n};return h&&this.on("wheel.panZoom",function(t){if(t.preventDefault(),0!=t.deltaY){var o=this.zoom()-s*t.deltaY/Math.abs(t.deltaY),e=this.point(t.clientX,t.clientY);o>r&&(o=r),o<c&&(o=c),this.zoom(o,e)}}),m&&this.on("touchstart.panZoom",f,this,{passive:!1}),u&&this.on("mousedown.panZoom",d,this),this},zoom:function(t,o){var e=window.getComputedStyle(this.node),n=parseFloat(e.getPropertyValue("width")),i=parseFloat(e.getPropertyValue("height")),a=this.viewbox(),s=n/a.width,c=i/a.height,r=Math.min(s,c);if(null==t)return r;var h=r/t;h===1/0&&(h=Number.MIN_VALUE),o=o||new SVG.Point(n/2/s+a.x,i/2/c+a.y);var m=new SVG.Box(a).transform((new SVG.Matrix).scale(h,o.x,o.y));return this.fire("zoom",{box:m,focus:o}).event().defaultPrevented?this:this.viewbox(m)}}),SVG.extend(SVG.FX,{zoom:function(t,o){return this.add("zoom",[new SVG.Number(t)].concat(o||[]))}})}();