diff options
author | barbushin <barbushin@gmail.com> | 2015-07-14 15:00:41 +0300 |
---|---|---|
committer | barbushin <barbushin@gmail.com> | 2015-07-14 15:00:41 +0300 |
commit | ae54b3f27c151bda1f32400bd44ba07abf29e248 (patch) | |
tree | 1e6834bf81125130a3b791f039013c8b56f02a68 /plugins/UserCountryMap | |
parent | f9f42f670b7d6861d35daf8efcc89e387552f5db (diff) |
Update to Kartograph 0.8.2
Diffstat (limited to 'plugins/UserCountryMap')
-rw-r--r-- | plugins/UserCountryMap/javascripts/realtime-map.js | 4 | ||||
-rw-r--r-- | plugins/UserCountryMap/javascripts/vendor/kartograph.min.js | 8 | ||||
-rw-r--r-- | plugins/UserCountryMap/javascripts/visitor-map.js | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/plugins/UserCountryMap/javascripts/realtime-map.js b/plugins/UserCountryMap/javascripts/realtime-map.js index 0881a198f2..6096ce3786 100644 --- a/plugins/UserCountryMap/javascripts/realtime-map.js +++ b/plugins/UserCountryMap/javascripts/realtime-map.js @@ -51,7 +51,7 @@ $('.RealTimeMap_map', $element).attr('id', this.uniqueId); // create the map - this.map = Kartograph.map('#' + this.uniqueId); + this.map = $K.map('#' + this.uniqueId); $element.focus(); }, @@ -376,7 +376,7 @@ if (firstRun) { // if we run this the first time, we initialiize the map symbols visitSymbols = map.addSymbols({ data: [], - type: Kartograph.Bubble, + type: $K.Bubble, /*title: function(d) { return visitRadius(d) > 15 && d.actions > 1 ? d.actions : ''; }, diff --git a/plugins/UserCountryMap/javascripts/vendor/kartograph.min.js b/plugins/UserCountryMap/javascripts/vendor/kartograph.min.js index 2a6e8ac636..daf986cfbd 100644 --- a/plugins/UserCountryMap/javascripts/vendor/kartograph.min.js +++ b/plugins/UserCountryMap/javascripts/vendor/kartograph.min.js @@ -1,5 +1,5 @@ /* - * Kartograph - a svg mapping library + * Kartograph 0.8.2 - a svg mapping library * Copyright (C) 2011-2013 Gregor Aisch * * This library is free software; you can redistribute it and/or @@ -16,6 +16,6 @@ * License along with this library. If not, see <http://www.gnu.org/licenses/>. * */ -(function(){function bS(){function h(a,b,c){f(a.point,b)<f(c.point,b)&&(c=a),a.left&&(c=h(a.left,b,c));if(a.right){var d=a.point[a.axis]-b[a.axis];d*d<f(c.point,b)&&(c=h(a.right,b,c))}return c}function g(a){return function(b,c){b=b[a],c=c[a];return b<c?-1:b>c?1:0}}function f(a,c){var d=0;for(var e=0;e<b.length;e++){var f=b[e],g=a[f]-c[f];d+=g*g}return d}function e(a,c){if(!!a.length){var d=b[c%b.length],f=a.length>>1;a.sort(g(d));return{axis:d,point:a[f],left:e(a.slice(0,f),c+1),right:e(a.slice(f+1),c+1)}}}var a={},b=["x","y"],c,d=[];a.axes=function(c){if(!arguments.length)return b;b=c;return a},a.points=function(b){if(!arguments.length)return d;d=b,c=null;return a},a.find=function(b){return h(a.root(),b,c).point},a.root=function(a){return c||(c=e(d,0))};return a}function bR(){var a={},b=[],c=1,d=1;a.size=function(b){if(!arguments.length)return d;d=b;return a},a.iterations=function(b){if(!arguments.length)return c;c=b;return a},a.add=function(c){b.push(c);return a},a.means=function(){var a=[],e={},f=Math.min(d,b.length);for(var g=0,h=2*f;g<h;g++){var i=b[~~(Math.random()*b.length)],j=i.x+"/"+i.y;if(!(j in e)){e[j]=1;if(a.push({x:i.x,y:i.y})>=f)break}}f=a.length;for(var k=0;k<c;k++){var l=bS().points(a);for(var g=0;g<f;g++){var m=a[g];m.sumX=0,m.sumY=0,m.size=0,m.points=[],m.indices=[]}for(var g=0;g<b.length;g++){var n=b[g],m=l.find(n);m.sumX+=n.x,m.sumY+=n.y,m.size++,m.points.push(n),m.indices.push(g)}for(var g=0;g<f;g++){var m=a[g];if(!m.size)continue;m.x=m.sumX/m.size,m.y=m.sumY/m.size}}return a};return a}var a,b,c,d,e,f,g,h,i,j,k,l,n,o,p,q,r,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,ba,bb,bc,bd,be,bf,bg,bh,bi,bj,bk,bl,bm,bn,bo,bp,bq,br,bs,bt,bu,bv,bw,bx,by,bz,bA,bB,bC,bD,bE,bF,bG,bH,bI,bJ,bK,bL,bM,bN={}.hasOwnProperty,bO=function(a,b){function d(){this.constructor=a}for(var c in b)bN.call(b,c)&&(a[c]=b[c]);d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype;return a},bP=function(a,b){return function(){return a.apply(b,arguments)}},bQ=[].indexOf||function(a){for(var b=0,c=this.length;b<c;b++)if(b in this&&this[b]===a)return b;return-1};bz=typeof exports!="undefined"&&exports!==null?exports:this,br=bz.$K=window.Kartograph=(bH=bz.Kartograph)!=null?bH:bz.Kartograph={},br.version="0.5.2",a=bz.jQuery,br.__verbose=!1,bB=function(a){try{return console.warn.apply(console,arguments)}catch(b){try{return opera.postError.apply(opera,arguments)}catch(b){return alert(Array.prototype.join.call(arguments," "))}}},bs=function(a){if(br.__verbose)try{return console.debug.apply(console,arguments)}catch(b){try{return opera.postError.apply(opera,arguments)}catch(b){return alert(Array.prototype.join.call(arguments," "))}}},(bI=(bF=String.prototype).trim)==null&&(bF.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),Array.prototype.indexOf||(Array.prototype.indexOf=function(a){"use strict";if(this==null)throw new TypeError;var b=Object(this),c=b.length>>>0;if(c===0)return-1;var d=0;arguments.length>0&&(d=Number(arguments[1]),d!=d?d=0:d!=0&&d!=Infinity&&d!=-Infinity&&(d=(d>0||-1)*Math.floor(Math.abs(d))));if(d>=c)return-1;var e=d>=0?d:Math.max(c-Math.abs(d),0);for(;e<c;e++)if(e in b&&b[e]===a)return e;return-1}),bE=function(){var a,b,c,d,e;a={},e="Boolean Number String Function Array Date RegExp Undefined Null".split(" ");for(c=0,d=e.length;c<d;c++)b=e[c],a["[object "+b+"]"]=b.toLowerCase();return function(b){var c;c=Object.prototype.toString.call(b);return a[c]||"object"}}(),d=function(){function a(a,b,c,d){var e;a==null&&(a=0),b==null&&(b=0),c==null&&(c=null),d==null&&(d=null),e=this,c===null?(e.xmin=Number.MAX_VALUE,e.xmax=Number.MAX_VALUE*-1):(e.xmin=e.left=a,e.xmax=e.right=a+c,e.width=c),d===null?(e.ymin=Number.MAX_VALUE,e.ymax=Number.MAX_VALUE*-1):(e.ymin=e.top=b,e.ymax=e.bottom=d+b,e.height=d);return}a.prototype.update=function(a,b){var c;b==null&&(b=a[1],a=a[0]),c=this,c.xmin=Math.min(c.xmin,a),c.ymin=Math.min(c.ymin,b),c.xmax=Math.max(c.xmax,a),c.ymax=Math.max(c.ymax,b),c.left=c.xmin,c.top=c.ymin,c.right=c.xmax,c.bottom=c.ymax,c.width=c.xmax-c.xmin,c.height=c.ymax-c.ymin;return this},a.prototype.intersects=function(a){return a.left<s.right&&a.right>s.left&&a.top<s.bottom&&a.bottom>s.top},a.prototype.inside=function(a,b){var c;c=this;return a>=c.left&&a<=c.right&&b>=c.top&&b<=c.bottom},a.prototype.join=function(a){var b;b=this,b.update(a.left,a.top),b.update(a.right,a.bottom);return this};return a}(),d.fromXML=function(a){var b,c,d,e;d=Number(a.getAttribute("x")),e=Number(a.getAttribute("y")),c=Number(a.getAttribute("w")),b=Number(a.getAttribute("h"));return new br.BBox(d,e,c,b)},br.BBox=d,(bJ=br.geom)==null&&(br.geom={}),(bK=(bG=br.geom).clipping)==null&&(bG.clipping={}),l=function(){function f(){}var a,b,c,d,e;b=0,c=1,d=2,a=4,e=8,f.prototype.compute_out_code=function(a,b,c){var d,e;e=this,d=e.INSIDE,b<a.left?d|=e.LEFT:b>a.right&&(d|=e.RIGHT),c<a.top?d|=e.TOP:c>a.bottom&&(d|=e.BOTTOM);return d},f.prototype.clip=function(a,b,c,d,e){var f,g,h,i,j,k,l;j=this,g=j.compute_out_code(a,b,c),h=j.compute_out_code(a,d,e),f=False;while(True){if(!(g|h)){f=True;break}if(g&h)break;i=code===0?h:g,i&j.TOP?(k=b+(d-b)*(a.top-c)/(e-c),l=a.top):i&j.BOTTOM?(k=b+(d-b)*(a.bottom-c)/(e-c),l=a.bottom):i&j.RIGHT?(l=c+(e-c)*(a.right-b)/(d-b),k=a.right):i&j.LEFT&&(l=c+(e-c)*(a.left-b)/(d-b),k=a.left),i===g?(b=k,c=l,g=j.compute_out_code(a,b,c)):(d=k,e=l,h=j.compute_out_code(a,d,e))}return f?[b,c,d,e]:null};return f}(),br.geom.clipping.CohenSutherland=l,B=function(){function b(b,c,d){var e,f;f=this,f.container=e=a(b),c==null&&(c=e.width()),d==null&&(d=e.height()),d===0&&(d="auto"),f.size={h:d,w:c},f.markers=[],f.pathById={},f.container.addClass("kartograph")}b.prototype.createSVGLayer=function(b){var c,d,e,f,g,h,i,j;f=this,(j=f._layerCnt)==null&&(f._layerCnt=0),e=f._layerCnt++,i=f.viewport,d=f.container,g=Raphael(d[0],i.width,i.height),h=a(g.canvas),h.css({position:"absolute",top:"0px",left:"0px","z-index":e+5}),d.css("position")==="static"&&d.css({position:"relative",height:i.height+"px"}),h.addClass(b),c=a("desc",g.canvas).text(),a("desc",g.canvas).text(c.replace("with ","with kartograph "+br.version+" and "));return g},b.prototype.createHTMLLayer=function(b){var c,d,e,f,g,h;f=this,g=f.viewport,c=f.container,(h=f._layerCnt)==null&&(f._layerCnt=0),e=f._layerCnt++,d=a('<div class="layer '+b+'" />'),d.css({position:"absolute",top:"0px",left:"0px",width:g.width+"px",height:g.height+"px","z-index":e+5}),c.append(d);return d},b.prototype.loadMap=function(b,c,d){var e,f,g,h;f=this,e=a.Deferred(),f.clear(),f.opts=d!=null?d:{},(h=(g=f.opts).zoom)==null&&(g.zoom=1),f.mapLoadCallback=c,f._loadMapDeferred=e,f._lastMapUrl=b,f.cacheMaps&&br.__mapCache[b]!=null?f._mapLoaded(br.__mapCache[b]):a.ajax({url:b,dataType:"text",success:f._mapLoaded,context:f,error:function(a,b,c){return bB(a,b,c)}});return e.promise()},b.prototype.setMap=function(a,b){var c,d,e;c=this,c.opts=b!=null?b:{},(e=(d=c.opts).zoom)==null&&(d.zoom=1),c._lastMapUrl="string",c._mapLoaded(a)},b.prototype._mapLoaded=function(b){var c,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s;h=this,h.cacheMaps&&((o=br.__mapCache)==null&&(br.__mapCache={}),br.__mapCache[h._lastMapUrl]=b);try{b=a(b)}catch(t){bB("something went horribly wrong while parsing svg"),h._loadMapDeferred.reject("could not parse svg");return}h.svgSrc=b,c=a("view",b),bs("got svg src",h.svgSrc),h.paper==null&&(m=h.size.w,f=h.size.h,f==="auto"&&(j=c.attr("w")/c.attr("h"),f=m/j),h.viewport=new d(0,0,m,f)),l=h.viewport,bs("got viewport",h.viewport),h.viewAB=e=br.View.fromXML(c[0]),bs("got first view",h.viewAB),i=(p=h.opts.padding)!=null?p:0,g=(q=h.opts.halign)!=null?q:"center",k=(r=h.opts.valign)!=null?r:"center",bs("got alignment",g,k),n=(s=h.opts.zoom)!=null?s:1,h.viewBC=new br.View(h.viewAB.asBBox(),l.width*n,l.height*n,i,g,k),bs("got second view",h.viewBC),h.proj=br.Proj.fromXML(a("proj",c)[0]),bs("got projection",h.proj),h.mapLoadCallback!=null&&h.mapLoadCallback(h),h._loadMapDeferred!=null&&h._loadMapDeferred.resolve(h)},b.prototype.addLayer=function(b,c){var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w;c==null&&(c={}),i=this,(u=i.layerIds)==null&&(i.layerIds=[]),(v=i.layers)==null&&(i.layers={}),i.paper==null&&(i.paper=i.createSVGLayer()),l=b,bE(c)==="object"?(h=c.name,j=c.key,o=c.title):c={},h==null&&(h=l),m=a("#"+l,i.svgSrc);if(m.length!==0){g=new L(h,j,i,c.filter),d=a("*",m[0]);for(q=0,s=d.length;q<s;q++)n=d[q],g.addPath(n,o);g.paths.length>0&&(i.layers[h]=g,i.layerIds.push(h)),e=["click","mouseenter","mouseleave","dblclick","mousedown","mouseup","mouseover","mouseout"];for(r=0,t=e.length;r<t;r++)f=e[r],bE(c[f])==="function"&&g.on(f,c[f]);if(c.styles!=null){w=c.styles;for(k in w)p=w[k],g.style(k,p)}c.tooltips!=null&&g.tooltips(c.tooltips);return i}},b.prototype.getLayer=function(a){var b;b=this;if(b.layers[a]==null){bB("could not find layer "+a);return null}return b.layers[a]},b.prototype.getLayerPath=function(a,b){var c,d;d=this,c=d.getLayer(a);if(c!=null)return bE(b)==="object"?c.getPaths(b)[0]:c.getPath(b);return null},b.prototype.onLayerEvent=function(a,b,c){var d;d=this,d.getLayer(c).on(a,b);return d},b.prototype.addMarker=function(a){var b,c;b=this,b.markers.push(a),c=b.viewBC.project(b.viewAB.project(b.proj.project(a.lonlat.lon,a.lonlat.lat)));return a.render(c[0],c[1],b.container,b.paper)},b.prototype.clearMarkers=function(){var a,b,c,d,e;b=this,e=b.markers;for(c=0,d=e.length;c<d;c++)a=e[c],a.clear();return b.markers=[]},b.prototype.fadeIn=function(a){var b,c,d,e,f,g,h,i,j,k,l;a==null&&(a={}),f=this,e=(i=a.layer)!=null?i:f.layerIds[f.layerIds.length-1],c=(j=a.duration)!=null?j:500,k=f.layers[e].pathsById,l=[];for(d in k)h=k[d],l.push(function(){var a,d,e;e=[];for(a=0,d=h.length;a<d;a++)g=h[a],bE(c)==="function"?b=c(g.data):b=c,g.svgPath.attr("opacity",0),e.push(g.svgPath.animate({opacity:1},b));return e}());return l},b.prototype.loadCoastline=function(){var b;b=this;return a.ajax({url:"coastline.json",success:b.renderCoastline,context:b})},b.prototype.resize=function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s;g=this,c=g.container,a==null&&(a=c.width()),b==null&&(b=c.height()),g.viewport=k=new br.BBox(0,0,a,b),g.paper!=null&&g.paper.setSize(k.width,k.height),k=g.viewport,h=(o=g.opts.padding)!=null?o:0,d=(p=g.opts.halign)!=null?p:"center",j=(q=g.opts.valign)!=null?q:"center",l=g.opts.zoom,g.viewBC=new br.View(g.viewAB.asBBox(),k.width*l,k.height*l,h,d,j),r=g.layers;for(e in r)f=r[e],f.setView(g.viewBC);if(g.symbolGroups!=null){s=g.symbolGroups;for(m=0,n=s.length;m<n;m++)i=s[m],i.onResize()}},b.prototype.lonlat2xy=function(a){var b,c;c=this,a.length===2&&(a=new br.LonLat(a[0],a[1])),a.length===3&&(a=new br.LonLat(a[0],a[1],a[2])),b=c.proj.project(a.lon,a.lat,a.alt);return c.viewBC.project(c.viewAB.project(b))},b.prototype.showZoomControls=function(){var a;a=this,a.zc=new S(a);return a},b.prototype.addSymbolGroup=function(a){var b,c;b=this,(c=b.symbolGroups)==null&&(b.symbolGroups=[]);return b.symbolGroups.push(a)},b.prototype.removeSymbols=function(a){var b,c,d,e,f,g;b=this;if(a!=null)return b.symbolGroups[a].remove();f=b.symbolGroups,g=[];for(d=0,e=f.length;d<e;d++)c=f[d],g.push(c.remove());return g},b.prototype.clear=function(){var b,c,d,e,f,g;c=this;if(c.layers!=null){for(b in c.layers)c.layers[b].remove();c.layers={},c.layerIds=[]}if(c.symbolGroups!=null){g=c.symbolGroups;for(e=0,f=g.length;e<f;e++)d=g[e],d.remove();c.symbolGroups=[]}if(c.paper!=null){a(c.paper.canvas).remove();return c.paper=void 0}},b.prototype.loadCSS=function(b,c){var d;d=this;if(a.browser.msie)return a.ajax({url:b,dataType:"text",success:function(a){d.styles=br.parsecss(a);return c()},error:function(a,c,d){return bB("error while loading "+b,a,c,d)}});a("body").append('<link rel="stylesheet" href="'+b+'" />');return c()},b.prototype.applyCSS=function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;e=this;if(e.styles==null)return a;(n=e._pathTypes)==null&&(e._pathTypes=["path","circle","rectangle","ellipse"]),(o=e._regardStyles)==null&&(e._regardStyles=["fill","stroke","fill-opacity","stroke-width","stroke-opacity"]);for(h in e.styles){f=h,p=f.split(",");for(j=0,l=p.length;j<l;j++){i=p[j],f=i.split(" "),f=f[f.length-1],f=f.split(":");if(f.length>1)continue;f=f[0].split("."),c=f.slice(1);if(c.length>0&&c.indexOf(b)<0)continue;f=f[0];if(e._pathTypes.indexOf(f)>=0&&f!==a.type)continue;g=e.styles[h],q=e._regardStyles;for(k=0,m=q.length;k<m;k++)d=q[k],g[d]!=null&&a.attr(d,g[d])}}return a},b.prototype.style=function(a,b,c,d,e){var f;f=this,a=f.getLayer(a);if(a!=null)return a.style(b,c,d,e)};return b}(),br.Kartograph=B,br.map=function(a,b,c){return new B(a,b,c)},br.__mapCache={},J=function(){function a(a,b,c){c==null&&(c=0),this.lon=Number(a),this.lat=Number(b),this.alt=Number(c)}a.prototype.distance=function(a){var b,c,d,e,f,g,h,i,j;j=this,b=6371,g=Math.PI/180,e=(a.lat-j.lat)*g,f=(a.lon-j.lon)*g,h=j.lat*g,i=a.lat*g,c=Math.sin(e/2)*Math.sin(e/2)+Math.sin(f/2)*Math.sin(f/2)*Math.cos(h)*Math.cos(i),d=2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c));return b*d};return a}(),F=function(a){function b(a,c,d){d==null&&(d=0),b.__super__.constructor.call(this,c,a,d)}bO(b,a);return b}(J),br.LonLat=J,br.LatLon=F,L=function(){function b(a,b,c,d){var e;e=this,e.id=a,e.path_id=b,e.paper=c.paper,e.view=c.viewBC,e.map=c,e.filter=d}b.prototype.addPath=function(a,b){var c,d,e,f,g,h,i;d=this,(g=d.paths)==null&&(d.paths=[]),c=new M(a,d.id,d.map,b);if(bE(d.filter)==="function"&&d.filter(c.data)===!1)c.remove();else{d.paths.push(c);if(d.path_id!=null){(h=d.pathsById)==null&&(d.pathsById={}),(i=(e=d.pathsById)[f=c.data[d.path_id]])==null&&(e[f]=[]);return d.pathsById[c.data[d.path_id]].push(c)}}},b.prototype.hasPath=function(a){var b;b=this;return b.pathsById!=null&&b.pathsById[a]!=null},b.prototype.getPathsData=function(){var a,b,c,d,e,f;a=this,c=[],f=a.paths;for(d=0,e=f.length;d<e;d++)b=f[d],c.push(b.data);return c},b.prototype.getPath=function(a){var b;b=this;return b.hasPath(a)?b.pathsById[a][0]:null},b.prototype.getPaths=function(a){var b,c,d,e,f,g,h,i;e=this,d=[];if(bE(a)==="object"){i=e.paths;for(g=0,h=i.length;g<h;g++){f=i[g],c=!0;for(b in a)c=c&&f.data[b]===a[b];c&&d.push(f)}}return d},b.prototype.setView=function(a){var b,c,d,e,f;b=this,f=b.paths;for(d=0,e=f.length;d<e;d++)c=f[d],c.setView(a);return b},b.prototype.remove=function(){var a,b,c,d,e,f;a=this,e=a.paths,f=[];for(c=0,d=e.length;c<d;c++)b=e[c],f.push(b.remove());return f},b.prototype.style=function(a,b,c,d){var e,f,g,h,i,j,k,l,m,n,o;j=this;if(bE(a)==="object"){for(i in a)l=a[i],j.style(i,l);return j}c==null&&(c=0),d==null&&(d=0),o=j.paths;for(m=0,n=o.length;m<n;m++)k=o[m],l=bx(b,k.data),h=bx(c,k.data),g=bx(d,k.data),h>0?(f={},f[a]=l,e=Raphael.animation(f,h*1e3),k.svgPath.animate(e.delay(g*1e3))):k.svgPath.attr(a,l);return j},b.prototype.on=function(b,c){var d,e,f,g,h,i,j;f=this,d=function(){function a(a,b,c){this.type=a,this.cb=b,this.layer=c,this.handle=bP(this.handle,this)}a.prototype.handle=function(a){var b;f=this,b=f.layer.map.pathById[a.target.getAttribute("id")];return f.cb(b.data,b.svgPath,a)};return a}(),e=new d(b,c,f),j=f.paths;for(h=0,i=j.length;h<i;h++)g=j[h],a(g.svgPath.node).bind(b,e.handle);return f},b.prototype.tooltips=function(b,c){var d,e,f,g,h,i,j;d=this,f=function(b,d){var e;e={position:{target:"mouse",viewport:a(window),adjust:{x:7,y:7}},show:{delay:c!=null?c:20},events:{show:function(b,c){return a(".qtip").filter(function(){return this!==c.elements.tooltip.get(0)}).hide()}},content:{}},d!=null?typeof d=="string"?e.content.text=d:a.isArray(d)&&(e.content.title=d[0],e.content.text=d[1]):e.content.text="n/a";return a(b.svgPath.node).qtip(e)},j=d.paths;for(h=0,i=j.length;h<i;h++)e=j[h],g=bx(b,e.data),f(e,g);return d},b.prototype.sort=function(a){var b,c,d,e,f,g;c=this,c.paths.sort(function(b,c){var d,e,f;d=a(b.data),e=a(c.data);return d===e?0:(f=d>e)!=null?f:{1:-1}}),b=!1,g=c.paths;for(e=0,f=g.length;e<f;e++)d=g[e],b&&d.svgPath.insertAfter(b.svgPath),b=d;return c};return b}(),bx=function(a,b){return bE(a)==="function"?a(b):a},bt=0,M=function(){function a(a,b,c,d){var e,f,g,h,i,j,k,l,m,n,o,p,q;h=this,i=c.paper,n=c.viewBC,h.path=j=br.geom.Path.fromSVG(a),h.vpath=n.projectPath(j),h.svgPath=h.vpath.toSVG(i),c.styles==null?h.svgPath.node.setAttribute("class",b):c.applyCSS(h.svgPath,b),l="path_"+bt++,h.svgPath.node.setAttribute("id",l),c.pathById[l]=h,f={};for(g=p=0,q=a.attributes.length-1;0<=q?p<=q:p>=q;g=0<=q?++p:--p)e=a.attributes[g],e.name.substr(0,5)==="data-"&&(m=e.value,o=Number(m),m.trim()!==""&&o===m&&!isNaN(o)&&(m=o),f[e.name.substr(5)]=m);h.data=f,bE(d)==="string"?k=d:bE(d)==="function"&&(k=d(f)),k!=null&&h.svgPath.attr("title",k)}a.prototype.setView=function(a){var b,c,d;b=this,c=a.projectPath(b.path),b.vpath=c;if(b.path.type==="path"){d=c.svgString();return b.svgPath.attr({path:d})}if(b.path.type==="circle")return b.svgPath.attr({cx:c.x,cy:c.y,r:c.r})},a.prototype.remove=function(){var a;a=this;return a.svgPath.remove()};return a}(),br.parsecss=function(a,b){var c,d,e,f,g,h,i,j;f={},a=bu(a),j=a.split("`b%");for(h=0,i=j.length;h<i;h++){c=j[h],c=c.split("%b`");if(c.length<2)continue;c[0]=by(c[0]),e=bw(c[1]);if(f[c[0]]!=null)for(d in e)g=e[d],f[c[0]][d]=g;else f[c[0]]=e}if(bE(b)==="function")b(f);else return f},bv={},bw=function(a){var b,c,d,e,f,g;d=bv[a].replace(/^{|}$/g,""),d=bu(d),c={},g=d.split(";");for(e=0,f=g.length;e<f;e++){b=g[e],b=b.split(":");if(b.length<2)continue;c[by(b[0])]=by(b.slice(1).join(":"))}return c},Z=/{[^{}]*}/,_=/\[[^\[\]]*\]|{[^{}]*}|\([^()]*\)|function(\s+\w+)?(\s*%b`\d+`b%){2}/,$=/(?:\/\*(?:[^\*]|\*[^\/])*\*\/)|(\\.|"(?:[^\\\"]|\\.|\\\n)*"|'(?:[^\\\']|\\.|\\\n)*')/g,ba=/%\w`(\d+)`\w%/,bA=0,bu=function(a,b){var c,d,e;a=a.replace($,function(a,b){var c;if(!b)return"";c="%s`"+ ++bA+"`s%",bv[bA]=b.replace(/^\\/,"");return c}),c=b?_:Z;while(d=c.exec(a))e="%b`"+ ++bA+"`b%",bv[bA]=d[0],a=a.replace(c,e);return a},by=function(a){var b;if(a==null)return a;while(b=ba.exec(a))a=a.replace(ba,bv[b[1]]);return a.trim()},(bL=br.geom)==null&&(br.geom={}),T=function(){function a(a,b,c){var d;c==null&&(c=!0),d=this,d.type=a,d.contours=b,d.closed=c}a.prototype.clipToBBox=function(a){throw"path clipping is not implemented yet"},a.prototype.toSVG=function(a){var b;b=this.svgString();return a.path(b)},a.prototype.svgString=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m;d=this,e="",c=d.closed?"Z M":"M",l=d.contours;for(h=0,j=l.length;h<j;h++){a=l[h],b=!0,e+=e===""?"M":c;for(i=0,k=a.length;i<k;i++)m=a[i],f=m[0],g=m[1],b||(e+="L"),e+=f+","+g,b=!1}d.closed&&(e+="Z");return e},a.prototype.area=function(){var a,b,c,d,e,f,g,h,i;d=this;if(d.areas!=null)return d._area;d.areas=[],d._area=0,h=d.contours;for(e=0,g=h.length;e<g;e++){b=h[e],a=0;for(c=f=0,i=b.length-2;0<=i?f<=i:f>=i;c=0<=i?++f:--f)a+=b[c][0]*b[c+1][1]-b[c+1][0]*b[c][1];a*=.5,a=a,d.areas.push(a),d._area+=a}return d._area},a.prototype.centroid=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K;p=this;if(p._centroid!=null)return p._centroid;c=p.area(),f=g=0;for(k=A=0,G=p.contours.length-1;0<=G?A<=G:A>=G;k=0<=G?++A:--A){e=p.contours[k],d=[],n=e.length;for(l=B=0,H=n-1;0<=H?B<=H:B>=H;l=0<=H?++B:--B){q=e[l],r=e[(l+1)%n],h=0,d.push(q),q[0]===r[0]&&(h=Math.abs(q[1]-r[1])),q[1]===r[1]&&(h=Math.abs(q[0]-r[0]));if(h>10){a=Math.floor(h*2);for(s=C=1,I=a-1;1<=I?C<=I:C>=I;s=1<=I?++C:--C)t=[q[0]+s/a*(r[0]-q[0]),q[1]+s/a*(r[1]-q[1])],d.push(t)}}b=p.areas[k],w=y=x=z=0,n=d.length,E=[],u=0;for(l=D=0,J=n-1;0<=J?D<=J:D>=J;l=0<=J?++D:--D)q=d[l],r=d[(l+1)%n],i=r[0]-q[0],j=r[1]-q[1],o=Math.sqrt(i*i+j*j),E.push(o),u+=o;for(l=F=0,K=n-1;0<=K?F<=K:F>=K;l=0<=K?++F:--F)q=d[l],v=E[l]/u,w+=v*q[0],y+=v*q[1];m=b/c,f+=w*m,g+=y*m}p._centroid=[f,g];return p._centroid},a.prototype.isInside=function(a,b){var c,d,e,f,g,h;f=this,c=f._bbox;if(a<c[0]||a>c[2]||b<c[1]||b>c[3])return!1;for(e=g=0,h=f.contours.length-1;0<=h?g<=h:g>=h;e=0<=h?++g:--g){d=f.contours[e];if(bC(d,[a,b]))return!0}return!1};return a}(),br.geom.Path=T,k=function(a){function b(a,c,d){this.x=a,this.y=c,this.r=d,b.__super__.constructor.call(this,"circle",null,!0)}bO(b,a),b.prototype.toSVG=function(a){var b;b=this;return a.circle(b.x,b.y,b.r)},b.prototype.centroid=function(){var a;a=this;return[a.x,a.y]},b.prototype.area=function(){var a;a=this;return Math.PI*a.r*m.r};return b}(T),br.geom.Circle=k,T.fromSVG=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o;e=[],m=a.nodeName,k=null;if(m==="path"){i=a.getAttribute("d").trim(),h=Raphael.parsePathString(i),b=h[h.length-1]==="Z",l=b?"Z M":"M",d=[];for(n=0,o=h.length;n<o;n++){c=h[n];if(c.length===0)continue;c[0]==="M"?(d.length>2&&(e.push(d),d=[]),d.push([c[1],c[2]])):c[0]==="L"?d.push([c[1],c[2]]):c[0]==="Z"&&d.length>2&&(e.push(d),d=[])}d.length>2&&(e.push(d),d=[]),k=new br.geom.Path(m,e,b)}else m==="circle"&&(f=a.getAttribute("cx"),g=a.getAttribute("cy"),j=a.getAttribute("r"),k=new br.geom.Circle(f,g,j));return k},G=function(){function a(a){this.points=a}a.prototype.clipToBBox=function(b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;l=this,c=(new br.geom.clipping.CohenSutherland).clip,k=[],f=[],e=!1;for(d=q=0,r=l.points.length-2;0<=r?q<=r:q>=r;d=0<=r?++q:--q){s=l.points[d],g=s[0],h=s[1],t=l.points[d+1],i=t[0],j=t[1];try{u=c(b,g,h,i,j),m=u[0],o=u[1],n=u[2],p=u[3],e=!0,k.push([m,o]),(i!==n||j!==o||d===len(l.points)-2)&&k.push([n,p])}catch(v){e&&k.length>1&&(f.push(new a(k)),k=[]),e=!1}}k.length>1&&f.push(new a(k));return f},a.prototype.toSVG=function(){var a,b,c,d,e,f,g,h;b=this,a=[],g=b.points;for(e=0,f=g.length;e<f;e++)h=g[e],c=h[0],d=h[1],a.push(c+","+d);return"M"+a.join("L")};return a}(),br.geom.Line=G,bC=function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;h=Math.PI,d=Math.atan2,k=h*2,g=a.length,c=0;for(f=p=0,q=g-1;0<=q?p<=q:p>=q;f=0<=q?++p:--p){l=a[f][0]-b[0],n=a[f][1]-b[1],m=a[(f+1)%g][0]-b[0],o=a[(f+1)%g][1]-b[1],i=d(n,l),j=d(o,m),e=j-i;while(e>h)e-=k;while(e<-h)e+=k;c+=e}return Math.abs(c)>=h},bD=br.proj={},Function.prototype.bind=function(a){var b;b=this;return function(){return b.apply(a,arguments)}},V=function(){function a(a){var b,c,d;b=this,b.lon0=(c=a.lon0)!=null?c:0,b.lat0=(d=a.lat0)!=null?d:0,b.PI=Math.PI,b.HALFPI=b.PI*.5,b.QUARTERPI=b.PI*.25,b.RAD=b.PI/180,b.DEG=180/b.PI,b.lam0=b.rad(this.lon0),b.phi0=b.rad(this.lat0),b.minLat=-90,b.maxLat=90}a.parameters=[],a.title="Projection",a.prototype.rad=function(a){return a*this.RAD},a.prototype.deg=function(a){return a*this.DEG},a.prototype.plot=function(a,b){var c,d,e,f,g,h,i,j,k,l,m;b==null&&(b=!0),f=[],c=!0;for(j=0,k=a.length;j<k;j++)l=a[j],e=l[0],d=l[1],g=this._visible(e,d),g&&(c=!1),m=this.project(e,d),h=m[0],i=m[1],!g&&b?f.push(this._truncate(h,i)):f.push([h,i]);return c?null:[f]},a.prototype.sea=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n;f=this,e=f.project.bind(this),d=[],a=f.lon0,f.lon0=0;for(c=g=-180;g<=180;c=++g)d.push(e(c,f.maxLat));for(b=h=k=f.maxLat,l=f.minLat;k<=l?h<=l:h>=l;b=k<=l?++h:--h)d.push(e(180,b));for(c=i=180;i>=-180;c=--i)d.push(e(c,f.minLat));for(b=j=m=f.minLat,n=f.maxLat;m<=n?j<=n:j>=n;b=m<=n?++j:--j)d.push(e(-180,b));f.lon0=a;return d},a.prototype.world_bbox=function(){var a,b,c,d,e,f;b=this.project.bind(this),d=this.sea(),a=new br.BBox;for(e=0,f=d.length;e<f;e++)c=d[e],a.update(c[0],c[1]);return a},a.prototype.toString=function(){var a;a=this;return"[Proj: "+a.name+"]"};return a}(),V.fromXML=function(a){var b,c,d,e,f,g,h;d=a.getAttribute("id"),e={};for(c=g=0,h=a.attributes.length-1;0<=h?g<=h:g>=h;c=0<=h?++g:--g)b=a.attributes[c],b.name!=="id"&&(e[b.name]=b.value);f=new br.proj[d](e),f.name=d;return f},br.Proj=V,o=function(a){function b(a){var c,d,e;a==null&&(a={}),c=this,c.flip=Number((d=a.flip)!=null?d:0),c.flip===1&&(a.lon0=(e=-a.lon0)!=null?e:0),b.__super__.constructor.call(this,a)}bO(b,a),b.parameters=["lon0","flip"],b.title="Cylindrical Projection",b.prototype._visible=function(a,b){return!0},b.prototype.clon=function(a){a-=this.lon0,a<-180?a+=360:a>180&&(a-=360);return a},b.prototype.ll=function(a,b){return this.flip===1?[-a,-b]:[a,b]};return b}(V),r=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}bO(b,a),b.title="Equirectangular Projection",b.prototype.project=function(a,b){var c;c=this.ll(a,b),a=c[0],b=c[1],a=this.clon(a);return[a*Math.cos(this.phi0)*1e3,b*-1*1e3]};return b}(o),bD.lonlat=r,i=function(a){function b(a){var c;b.__super__.constructor.call(this,a),this.lat1=(c=a.lat1)!=null?c:0,this.phi1=this.rad(this.lat1)}bO(b,a),b.parameters=["lon0","lat1","flip"],b.title="Cylindrical Equal Area",b.prototype.project=function(a,b){var c,d,e,f,g;g=this.ll(a,b),a=g[0],b=g[1],c=this.rad(this.clon(a)),d=this.rad(b*-1),e=c*Math.cos(this.phi1),f=Math.sin(d)/Math.cos(this.phi1);return[e*1e3,f*1e3]};return b}(o),bD.cea=i,u=function(a){function b(a){a.lat1=45,b.__super__.constructor.call(this,a)}bO(b,a),b.title="Gall-Peters Projection",b.parameters=["lon0","flip"];return b}(i),bD.gallpeters=u,y=function(a){function b(a){a.lat1=37.7,b.__super__.constructor.call(this,a)}bO(b,a),b.title="Hobo-Dyer Projection",b.parameters=["lon0","flip"];return b}(i),bD.hobodyer=y,f=function(a){function b(a){a.lat1=30,b.__super__.constructor.call(this,a)}bO(b,a),b.title="Behrmann Projection",b.parameters=["lon0","flip"];return b}(i),bD.behrmann=f,e=function(a){function b(a){a.lat1=50,b.__super__.constructor.call(this,a)}bO(b,a),b.title="Balthasart Projection",b.parameters=["lon0","flip"];return b}(i),bD.balthasart=e,N=function(a){function b(a){b.__super__.constructor.call(this,a),this.minLat=-85,this.maxLat=85}bO(b,a),b.title="Mercator Projection",b.prototype.project=function(a,b){var c,d,e,f,g,h,i;f=this,i=f.ll(a,b),a=i[0],b=i[1],d=Math,c=f.rad(f.clon(a)),e=f.rad(b*-1),g=c*1e3,h=d.log((1+d.sin(e))/d.cos(e))*1e3;return[g,h]};return b}(o),bD.mercator=N,X=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}bO(b,a),b.title="Pseudo-Cylindrical Projection";return b}(o),P=function(a){function b(a){var c;b.__super__.constructor.call(this,a),c=this,c.A0=.8707,c.A1=-0.131979,c.A2=-0.013791,c.A3=.003971,c.A4=-0.001529,c.B0=1.007226,c.B1=.015085,c.B2=-0.044475,c.B3=.028874,c.B4=-0.005916,c.C0=c.B0,c.C1=3*c.B1,c.C2=7*c.B2,c.C3=9*c.B3,c.C4=11*c.B4,c.EPS=1e-11,c.MAX_Y=.8707*.52*Math.PI;return}bO(b,a),b.title="Natural Earth Projection",b.prototype.project=function(a,b){var c,d,e,f,g,h,i,j;g=this,j=g.ll(a,b),a=j[0],b=j[1],c=g.rad(g.clon(a)),d=g.rad(b*-1),e=d*d,f=e*e,h=c*(g.A0+e*(g.A1+e*(g.A2+f*e*(g.A3+e*g.A4))))*180+500,i=d*(g.B0+e*(g.B1+f*(g.B2+g.B3*e+g.B4*f)))*180+270;return[h,i]};return b}(X),bD.naturalearth=P,bb=function(a){function b(a){var c;b.__super__.constructor.call(this,a),c=this,c.X=[1,-5.67239e-12,-0.0000715511,311028e-11,.9986,-0.000482241,-0.000024897,-0.00000133094,.9954,-0.000831031,-0.000044861,-9.86588e-7,.99,-0.00135363,-0.0000596598,367749e-11,.9822,-0.00167442,-0.0000044975,-0.00000572394,.973,-0.00214869,-0.0000903565,1.88767e-8,.96,-0.00305084,-0.0000900732,164869e-11,.9427,-0.00382792,-0.0000653428,-0.00000261493,.9216,-0.00467747,-0.000104566,48122e-10,.8962,-0.00536222,-0.0000323834,-0.00000543445,.8679,-0.00609364,-0.0001139,332521e-11,.835,-0.00698325,-0.0000640219,9.34582e-7,.7986,-0.00755337,-0.0000500038,9.35532e-7,.7597,-0.00798325,-0.0000359716,-0.00000227604,.7186,-0.00851366,-0.000070112,-0.00000863072,.6732,-0.00986209,-0.000199572,191978e-10,.6213,-0.010418,883948e-10,624031e-11,.5722,-0.00906601,181999e-9,624033e-11,.5322,0,0,0],c.Y=[0,.0124,3.72529e-10,1.15484e-9,.062,.0124001,1.76951e-8,-5.92321e-9,.124,.0123998,-7.09668e-8,2.25753e-8,.186,.0124008,2.66917e-7,-8.44523e-8,.248,.0123971,-9.99682e-7,3.15569e-7,.31,.0124108,373349e-11,-0.0000011779,.372,.0123598,-0.000013935,439588e-11,.434,.0125501,520034e-10,-0.0000100051,.4968,.0123198,-0.0000980735,922397e-11,.5571,.0120308,402857e-10,-0.0000052901,.6176,.0120369,-0.0000390662,7.36117e-7,.6769,.0117015,-0.0000280246,-8.54283e-7,.7346,.0113572,-0.0000408389,-5.18524e-7,.7903,.0109099,-0.0000486169,-0.0000010718,.8435,.0103433,-0.0000646934,5.36384e-9,.8936,.00969679,-0.0000646129,-0.00000854894,.9394,.00840949,-0.000192847,-0.00000421023,.9761,.00616525,-0.000256001,-0.00000421021,1,0,0,0],c.NODES=18,c.FXC=.8487,c.FYC=1.3523,c.C1=11.459155902616464,c.RC1=.08726646259971647,c.ONEEPS=1.000001,c.EPS=1e-8;return}bO(b,a),b.title="Robinson Projection",b.prototype._poly=function(a,b,c){return a[b]+c*(a[b+1]+c*(a[b+2]+c*a[b+3]))},b.prototype.project=function(a,b){var c,d,e,f,g,h,i,j;g=this,j=g.ll(a,b),a=j[0],b=j[1],a=g.clon(a),d=g.rad(a),e=g.rad(b*-1),f=Math.abs(e),c=Math.floor(f*g.C1),c>=g.NODES&&(c=g.NODES-1),f=g.deg(f-g.RC1*c),c*=4,h=1e3*g._poly(g.X,c,f)*g.FXC*d,i=1e3*g._poly(g.Y,c,f)*g.FYC,e<0&&(i=-i);return[h,i]};return b}(X),bD.robinson=bb,p=function(a){function b(a){var c;b.__super__.constructor.call(this,a),c=this,c.C_x=.4222382003157712,c.C_y=1.3265004281770023,c.RC_y=.7538633073600218,c.C_p=3.5707963267948966,c.RC_p=.2800495767557787,c.EPS=1e-7,c.NITER=6}bO(b,a),b.title="Eckert IV Projection",b.prototype.project=function(a,b){var c,d,e,f,g,h,i,j,k,l,m;h=this,m=h.ll(a,b),a=m[0],b=m[1],f=h.rad(h.clon(a)),g=h.rad(b*-1),i=h.C_p*Math.sin(g),c=g*g,g*=.895168+c*(.0218849+c*.00826809),e=h.NITER;while(e>0){d=Math.cos(g),j=Math.sin(g),c=(g+j*(d+2)-i)/(1+d*(d+2)-j*j),g-=c;if(Math.abs(c)<h.EPS)break;e-=1}e===0?(k=h.C_x*f,l=g<0?-h.C_y:h.C_y):(k=h.C_x*f*(1+Math.cos(g)),l=h.C_y*Math.sin(g));return[k,l]};return b}(X),bD.eckert4=p,be=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}bO(b,a),b.title="Sinusoidal Projection",b.prototype.project=function(a,b){var c,d,e,f,g,h;d=this,h=d.ll(a,b),a=h[0],b=h[1],c=d.rad(d.clon(a)),e=d.rad(b*-1),f=1032*c*Math.cos(e),g=1032*e;return[f,g]};return b}(X),bD.sinusoidal=be,O=function(a){function b(a,c,d,e,f){var g,h,i,j;c==null&&(c=1.5707963267948966),d==null&&(d=null),e==null&&(e=null),f==null&&(f=null),b.__super__.constructor.call(this,a),g=this,g.MAX_ITER=10,g.TOLERANCE=1e-7,c!=null?(h=c+c,j=Math.sin(c),i=Math.sqrt(Math.PI*2*j/(h+Math.sin(h))),g.cx=2*i/Math.PI,g.cy=i/j,g.cp=h+Math.sin(h)):d!=null&&e!=null&&typeof cz!="undefined"&&cz!==null?(g.cx=d,g.cy=e,g.cp=f):bB("kartograph.proj.Mollweide: either p or cx,cy,cp must be defined")}bO(b,a),b.title="Mollweide Projection",b.prototype.project=function(a,b){var c,d,e,f,g,h,i,j,k,l,m;h=this,m=h.ll(a,b),a=m[0],b=m[1],g=Math,c=g.abs,f=h.rad(h.clon(a)),i=h.rad(b),e=h.cp*g.sin(i),d=h.MAX_ITER;while(d!==0){j=(i+g.sin(i)-e)/(1+g.cos(i)),i-=j;if(c(j)<h.TOLERANCE)break;d-=1}d===0?i=i>=0?h.HALFPI:-h.HALFPI:i*=.5,k=1e3*h.cx*f*g.cos(i),l=1e3*h.cy*g.sin(i);return[k,l*-1]};return b}(X),bD.mollweide=O,bm=function(a){function b(a){b.__super__.constructor.call(this,a,1.0471975511965976)}bO(b,a),b.title="Wagner IV Projection";return b}(O),bD.wagner4=bm,bn=function(a){function b(a){b.__super__.constructor.call(this,a,null,.90977,1.65014,3.00896)}bO(b,a),b.title="Wagner V Projection";return b}(O),bD.wagner5=bn,K=function(a){function d(){return d.__super__.constructor.apply(this,arguments)}var b,c;bO(d,a),c=-89,b=89,d.parameters=["lon0","lat0","flip"],d.title="Loximuthal Projection (equidistant)",d.prototype.project=function(a,b){var c,d,e,f,g,h,i;e=this,i=e.ll(a,b),a=i[0],b=i[1],d=Math,c=e.rad(e.clon(a)),f=e.rad(b),f===e.phi0?g=c*d.cos(e.phi0):g=c*(f-e.phi0)/(d.log(d.tan(e.QUARTERPI+f*.5))-d.log(d.tan(e.QUARTERPI+e.phi0*.5))),g*=1e3,h=1e3*(f-e.phi0);return[g,h*-1]};return d}(X),bD.loximuthal=K,j=function(a){function g(){return g.__super__.constructor.apply(this,arguments)}var b,c,d,e,f;bO(g,a),g.title="Canters Modified Sinusoidal I",g.parameters=["lon0"],b=1.1966,c=-0.129,d=3*c,e=-0.0076,f=5*e,g.prototype.project=function(a,g){var h,i,j,k,l,m;h=this,m=h.ll(a,g),a=m[0],g=m[1],a=h.rad(h.clon(a)),g=h.rad(g),k=g*g,l=k*k,i=1e3*a*Math.cos(g)/(b+d*k+f*l),j=1e3*g*(b+c*k+e*l);return[i,j*-1]};return g}(X),bD.canters1=j,x=function(a){function o(a){o.__super__.constructor.call(this,a)}var b,c,d,e,f,g,h,i,j,k,l,m,n;bO(o,a),o.title="Hatano Projection",h=20,d=1e-7,i=1.000001,b=2.67595,c=2.43763,j=.3736990601468637,k=.4102345310814193,f=1.75859,g=1.93052,m=.5686373742600607,n=.5179951515653813,e=.85,l=1.1764705882352942,o.prototype.project=function(a,i){var j,k,l,m,n, -o,p,q,r,s;m=this,s=m.ll(a,i),a=s[0],i=s[1],l=m.rad(m.clon(a)),n=m.rad(i),j=Math.sin(n)*(n<0?c:b);for(k=r=h;r>=1;k=r+=-1){o=(n+Math.sin(n)-j)/(1+Math.cos(n)),n-=o;if(Math.abs(o)<d)break}p=1e3*e*l*Math.cos(n*=.5),q=1e3*Math.sin(n)*(n<0?g:f);return[p,q*-1]};return o}(X),bD.hatano=x,w=function(a){function b(a){var c;b.__super__.constructor.call(this,a),c=this,c.lat1=41.737,c.p1=new O,c.p0=new be}bO(b,a),b.title="Goode Homolosine Projection",b.parameters=["lon0"],b.prototype.project=function(a,b){var c,d;c=this,d=c.ll(a,b),a=d[0],b=d[1],a=c.clon(a);return Math.abs(b)>c.lat1?c.p1.project(a,b):c.p0.project(a,b)};return b}(X),bD.goodehomolosine=w,Q=function(a){function c(a){c.__super__.constructor.call(this,a),this.r=this.HALFPI*100}var b;bO(c,a),c.title="Nicolosi Globular Projection",c.parameters=["lon0"],b=1e-10,c.prototype._visible=function(a,b){var c;c=this,a=c.clon(a);return a>-90&&a<90},c.prototype.project=function(a,c){var d,e,f,g,h,i,j,k,l,m,n,o,p;h=this,p=h.ll(a,c),a=p[0],c=p[1],f=h.rad(h.clon(a)),j=h.rad(c),Math.abs(f)<b?(n=0,o=j):Math.abs(j)<b?(n=f,o=0):Math.abs(Math.abs(f)-h.HALFPI)<b?(n=f*Math.cos(j),o=h.HALFPI*Math.sin(j)):Math.abs(Math.abs(j)-h.HALFPI)<b?(n=0,o=j):(m=h.HALFPI/f-f/h.HALFPI,d=j/h.HALFPI,l=Math.sin(j),e=(1-d*d)/(l-d),k=m/e,k*=k,g=(m*l/e-.5*m)/(1+k),i=(l/k+.5*e)/(1+1/k),n=Math.cos(j),n=Math.sqrt(g*g+n*n/(1+k)),n=h.HALFPI*(g+(f<0?-n:n)),o=Math.sqrt(i*i-(l*l/k+e*l-1)/(1+1/k)),o=h.HALFPI*(i+(j<0?o:-o)));return[n*100,o*-100]},c.prototype.sea=function(){var a,b,c,d,e;b=[],d=this.r,a=Math;for(c=e=0;e<=360;c=++e)b.push([a.cos(this.rad(c))*d,a.sin(this.rad(c))*d]);return b},c.prototype.world_bbox=function(){var a;a=this.r;return new br.BBox(-a,-a,a*2,a*2)};return c}(X),bD.nicolosi=Q,c=function(a){function b(a,c){var d;c==null&&(c=1e3),b.__super__.constructor.call(this,a),d=this,d.r=c,d.elevation0=d.to_elevation(d.lat0),d.azimuth0=d.to_azimuth(d.lon0)}bO(b,a),b.parameters=["lon0","lat0"],b.title="Azimuthal Projection",b.prototype.to_elevation=function(a){var b;b=this;return(a+90)/180*b.PI-b.HALFPI},b.prototype.to_azimuth=function(a){var b;b=this;return(a+180)/360*b.PI*2-b.PI},b.prototype._visible=function(a,b){var c,d,e,f,g;g=this,f=Math,e=g.to_elevation(b),c=g.to_azimuth(a),d=f.sin(e)*f.sin(g.elevation0)+f.cos(g.elevation0)*f.cos(e)*f.cos(c-g.azimuth0);return d>=0},b.prototype._truncate=function(a,b){var c,d,e,f,g;c=Math,d=this.r,e=c.atan2(b-d,a-d),f=d+d*c.cos(e),g=d+d*c.sin(e);return[f,g]},b.prototype.sea=function(){var a,b,c,d,e;b=[],d=this.r,a=Math;for(c=e=0;e<=360;c=++e)b.push([d+a.cos(this.rad(c))*d,d+a.sin(this.rad(c))*d]);return b},b.prototype.world_bbox=function(){var a;a=this.r;return new br.BBox(0,0,a*2,a*2)};return b}(V),R=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}bO(b,a),b.title="Orthographic Projection",b.prototype.project=function(a,b){var c,d,e,f,g,h,i,j;f=this,e=Math,d=f.to_elevation(b),c=f.to_azimuth(a),h=f.r*e.cos(d)*e.sin(c-f.azimuth0),j=-f.r*(e.cos(f.elevation0)*e.sin(d)-e.sin(f.elevation0)*e.cos(d)*e.cos(c-f.azimuth0)),g=f.r+h,i=f.r+j;return[g,i]};return b}(c),bD.ortho=R,C=function(a){function b(a){b.__super__.constructor.call(this,a),this.scale=Math.sqrt(2)*.5}bO(b,a),b.title="Lambert Azimuthal Equal-Area Projection",b.prototype.project=function(a,b){var c,d,e,f,g,h,i,j,k,l;g=this.rad(b),e=this.rad(a),f=Math,h=f.sin,c=f.cos,d=f.pow(2/(1+h(this.phi0)*h(g)+c(this.phi0)*c(g)*c(e-this.lam0)),.5),d*=this.scale,j=this.r*d*c(g)*h(e-this.lam0),l=-this.r*d*(c(this.phi0)*h(g)-h(this.phi0)*c(g)*c(e-this.lam0)),i=this.r+j,k=this.r+l;return[i,k]};return b}(c),bD.laea=C,bh=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}bO(b,a),b.title="Stereographic Projection",b.prototype.project=function(a,b){var c,d,e,f,g,h,i,j,k,l,m;h=this.rad(b),f=this.rad(a),g=Math,i=g.sin,c=g.cos,e=.5,d=2*e/(1+i(this.phi0)*i(h)+c(this.phi0)*c(h)*c(f-this.lam0)),k=this.r*d*c(h)*i(f-this.lam0),m=-this.r*d*(c(this.phi0)*i(h)-i(this.phi0)*c(h)*c(f-this.lam0)),j=this.r+k,l=this.r+m;return[j,l]};return b}(c),bD.stereo=bh,bc=function(a){function b(a){var c,d,e,f,g,h,i,j,k,l;b.__super__.constructor.call(this,{lon0:0,lat0:0}),this.dist=(j=a.dist)!=null?j:3,this.up=this.rad((k=a.up)!=null?k:0),this.tilt=this.rad((l=a.tilt)!=null?l:0),this.scale=1,f=Number.MAX_VALUE,e=Number.MAX_VALUE*-1;for(c=h=0;h<=179;c=++h)for(d=i=0;i<=360;d=++i)g=this.project(d-180,c-90),f=Math.min(g[0],f),e=Math.max(g[0],e);this.scale=this.r*2/(e-f),b.__super__.constructor.call(this,a);return}bO(b,a),b.parameters=["lon0","lat0","tilt","dist","up"],b.title="Satellite Projection",b.prototype.project=function(a,b,c){var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x;c==null&&(c=0),m=this.rad(b),k=this.rad(a),l=Math,p=l.sin,f=l.cos,n=this.r,o=n*(c+6371)/3671,g=p(this.phi0)*p(m)+f(this.phi0)*f(m)*f(k-this.lam0),j=(this.dist-1)/(this.dist-g),j=(this.dist-1)/(this.dist-g),j*=this.scale,t=o*j*f(m)*p(k-this.lam0),w=-o*j*(f(this.phi0)*p(m)-p(this.phi0)*f(m)*f(k-this.lam0)),i=f(this.up),r=p(this.up),h=f(this.tilt),q=p(this.tilt),e=o*(this.dist-1),d=(w*i+t*r)*p(this.tilt/e)+h,u=(t*i-w*r)*f(this.tilt/d),x=(w*i+t*r)/d,s=n+u,v=n+x;return[s,v]},b.prototype._visible=function(a,b){var c,d,e,f;e=this.to_elevation(b),c=this.to_azimuth(a),f=Math,d=f.sin(e)*f.sin(this.elevation0)+f.cos(this.elevation0)*f.cos(e)*f.cos(c-this.azimuth0);return d>=1/this.dist},b.prototype.sea=function(){var a,b,c,d,e;b=[],d=this.r,a=Math;for(c=e=0;e<=360;c=++e)b.push([d+a.cos(this.rad(c))*d,d+a.sin(this.rad(c))*d]);return b};return b}(c),bD.satellite=bc,q=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}bO(b,a),b.title="Equidistant Azimuthal Projection",b.prototype.project=function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o;i=this,j=i.rad(b),g=i.rad(a),h=Math,k=h.sin,d=h.cos,e=k(this.phi0)*k(j)+d(this.phi0)*d(j)*d(g-this.lam0),c=h.acos(e),f=.325*c/k(c),m=this.r*f*d(j)*k(g-this.lam0),o=-this.r*f*(d(this.phi0)*k(j)-k(this.phi0)*d(j)*d(g-this.lam0)),l=this.r+m,n=this.r+o;return[l,n]},b.prototype._visible=function(a,b){return!0};return b}(c),bD.equi=q,b=function(a){function c(a){var b;b=this,a.lat0=0,c.__super__.constructor.call(this,a),b.lam0=0}var b;bO(c,a),c.title="Aitoff Projection",c.parameters=["lon0"],b=.6366197723675814,c.prototype.project=function(a,c){var d,e,f,g,h,i,j,k;g=this,k=g.ll(a,c),a=k[0],c=k[1],a=g.clon(a),f=g.rad(a),h=g.rad(c),d=.5*f,e=Math.acos(Math.cos(h)*Math.cos(d)),e!==0?(j=1/Math.sin(e),i=2*e*Math.cos(h)*Math.sin(d)*j,j*=e*Math.sin(h)):i=j=0,g.winkel&&(i=(i+f*b)*.5,j=(j+h)*.5);return[i*1e3,j*-1e3]},c.prototype._visible=function(a,b){return!0};return c}(X),bD.aitoff=b,bo=function(a){function b(a){b.__super__.constructor.call(this,a),this.winkel=!0}bO(b,a),b.title="Winkel Tripel Projection";return b}(b),bD.winkel3=bo,n=function(a){function b(a){var c,d,e;c=this,b.__super__.constructor.call(this,a),c.lat1=(d=a.lat1)!=null?d:30,c.phi1=c.rad(c.lat1),c.lat2=(e=a.lat2)!=null?e:50,c.phi2=c.rad(c.lat2)}bO(b,a),b.title="Conic Projection",b.parameters=["lon0","lat0","lat1","lat2"],b.prototype._visible=function(a,b){var c;c=this;return b>c.minLat&&b<c.maxLat},b.prototype._truncate=function(a,b){return[a,b]},b.prototype.clon=function(a){a-=this.lon0,a<-180?a+=360:a>180&&(a-=360);return a};return b}(V),D=function(a){function b(a){var c,d,e,f,g,h,i,j,k,l,m,n,o;k=this,b.__super__.constructor.call(this,a),g=Math,o=[g.sin,g.cos,g.abs,g.log,g.tan,g.pow],l=o[0],e=o[1],c=o[2],bs=o[3],n=o[4],i=o[5],k.n=h=m=l(k.phi1),f=e(k.phi1),j=c(k.phi1-k.phi2)>=1e-10,j&&(h=bs(f/e(k.phi2))/bs(n(k.QUARTERPI+.5*k.phi2)/n(k.QUARTERPI+.5*k.phi1))),k.c=d=f*i(n(k.QUARTERPI+.5*k.phi1),h)/h,c(c(k.phi0)-k.HALFPI)<1e-10?k.rho0=0:k.rho0=d*i(n(k.QUARTERPI+.5*k.phi0),-h),k.minLat=-60,k.maxLat=85}bO(b,a),b.title="Lambert Conformal Conic Projection",b.prototype.project=function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;l=this,i=l.rad(b),e=l.rad(l.clon(a)),g=Math,q=[g.sin,g.cos,g.abs,g.log,g.tan,g.pow],m=q[0],d=q[1],c=q[2],bs=q[3],n=q[4],j=q[5],h=l.n,c(c(i)-l.HALFPI)<1e-10?k=0:k=l.c*j(n(l.QUARTERPI+.5*i),-h),f=e*h,o=1e3*k*m(f),p=1e3*(l.rho0-k*d(f));return[o,p*-1]};return b}(n),bD.lcc=D,W=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}bO(b,a);return b}(n),bl=function(){function a(a,b,c,d,e,f){var g;g=this,g.bbox=a,g.width=b,g.padding=d!=null?d:0,g.halign=e!=null?e:"center",g.valign=f!=null?f:"center",g.height=c,g.scale=Math.min((b-d*2)/a.width,(c-d*2)/a.height)}a.prototype.project=function(a,b){var c,d,e,f,g,h,i;b==null&&(b=a[1],a=a[0]),e=this,f=e.scale,c=e.bbox,d=e.height,g=e.width,h=e.halign==="center"?(g-c.width*f)*.5:e.halign==="left"?e.padding*f:g-(c.width-e.padding)*f,i=e.valign==="center"?(d-c.height*f)*.5:e.valign==="top"?e.padding*f:0,a=(a-c.left)*f+h,b=(b-c.top)*f+i;return[a,b]},a.prototype.projectPath=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;e=this;if(a.type==="path"){d=[],b=[99999,99999,-99999,-99999],o=a.contours;for(k=0,m=o.length;k<m;k++){g=o[k],c=[];for(l=0,n=g.length;l<n;l++)p=g[l],i=p[0],j=p[1],q=e.project(i,j),i=q[0],j=q[1],c.push([i,j]),b[0]=Math.min(b[0],i),b[1]=Math.min(b[1],j),b[2]=Math.max(b[2],i),b[3]=Math.max(b[3],j);d.push(c)}f=new br.geom.Path(a.type,d,a.closed),f._bbox=b;return f}if(a.type==="circle"){r=e.project(a.x,a.y),i=r[0],j=r[1],h=a.r*e.scale;return new br.geom.Circle(i,j,h)}},a.prototype.asBBox=function(){var a;a=this;return new br.BBox(0,0,a.width,a.height)};return a}(),bl.fromXML=function(a){var b,c,e,f,g;g=Number(a.getAttribute("w")),e=Number(a.getAttribute("h")),f=Number(a.getAttribute("padding")),c=a.getElementsByTagName("bbox")[0],b=d.fromXML(c);return new br.View(b,g,e,f)},br.View=bl,br.Kartograph.prototype.dotgrid=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X;r=this,q=(T=a.layer)!=null?T:r.layerIds[r.layerIds.length-1];if(!r.layers.hasOwnProperty(q))bB('dotgrid error: layer "'+q+'" not found');else{p=r.layers[q],c=a.data,d=a.value,e=a.key,t={};if(e!=null&&bE(c)==="array")for(B=0,F=c.length;B<F;B++)w=c[B],o=w[e],t[String(o)]=w;else for(o in c)w=c[o],t[String(o)]=w;i=(U=a.style)!=null?U:{fill:"black",stroke:"none"},y=a.size,n=(V=a.gridsize)!=null?V:15,h=(W=p.dotgrid)!=null?W:p.dotgrid={gridsize:n,grid:[]};if(h.gridsize!==n){X=h.grid;for(C=0,G=X.length;C<G;C++)m=X[C],m.shape!=null&&(m.shape.remove(),m.shape=null)}if(n>0){if(h.grid.length===0)for(z=D=0,L=r.viewport.width;0<=L?D<=L:D>=L;z=D+=n)for(A=E=0,M=r.viewport.height;0<=M?E<=M:E>=M;A=E+=n){m={x:z+(Math.random()-.5)*n*.2,y:A+(Math.random()-.5)*n*.2,pathid:!1},l=!1,N=p.pathsById;for(o in N){u=N[o];for(J=0,H=u.length;J<H;J++){s=u[J];if(s.vpath.isInside(m.x,m.y)){l=!0,v=(O=t[o])!=null?O:null,x=y(v),m.pathid=o,m.shape=p.paper.circle(m.x,m.y,1);break}}if(l)break}h.grid.push(m)}P=h.grid;for(K=0,I=P.length;K<I;K++)m=P[K],m.pathid&&(v=(Q=t[m.pathid])!=null?Q:null,x=y(v),k=(R=a.duration)!=null?R:0,f=(S=a.delay)!=null?S:0,bE(f)==="function"?g=f(v):g=f,k>0&&Raphael.svg?(b=Raphael.animation({r:x*.5},k),m.shape.animate(b.delay(g))):m.shape.attr({r:x*.5}),bE(i)==="function"?j=i(v):j=i,m.shape.attr(j))}}},bq=(bM=br.filter)!=null?bM:br.filter={},bq.__knownFilter={},bq.__patternFills=0,L.prototype.SVG=function(a,b){var c,d;typeof a=="string"&&(a=window.document.createElementNS("http://www.w3.org/2000/svg",a));if(b)for(c in b)d=b[c],a.setAttribute(c,d);return a},br.Kartograph.prototype.addFilter=function(a,b,c){var d,e,f;c==null&&(c={}),f=this,d=window.document;if(br.filter[b]!=null)e=(new br.filter[b](c)).getFilter(a);else throw"unknown filter type "+b;return f.paper.defs.appendChild(e)},L.prototype.applyFilter=function(b){var c;c=this;return a("."+c.id,c.paper.canvas).attr({filter:"url(#"+b+")"})},L.prototype.applyTexture=function(a,b,c){var d,e,f,g,h,i;b==null&&(b=!1),c==null&&(c="#000"),e=this,bq.__patternFills+=1,h=e.paths,i=[];for(f=0,g=h.length;f<g;f++)d=h[f],!b||b(d.data)?i.push(d.svgPath.attr({fill:"url("+a+")"})):i.push(d.svgPath.attr("fill",c));return i},t=function(){function a(a){this.params=a!=null?a:{}}a.prototype.getFilter=function(a){var b,c;c=this,b=c.SVG("filter",{id:a}),c.buildFilter(b);return b},a.prototype._getFilter=function(){throw"not implemented"},a.prototype.SVG=function(a,b){var c,d;typeof a=="string"&&(a=window.document.createElementNS("http://www.w3.org/2000/svg",a));if(b)for(c in b)d=b[c],a.setAttribute(c,d);return a};return a}(),g=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}bO(b,a),b.prototype.buildFilter=function(a){var b,c,d;d=this,b=d.SVG,c=b("feGaussianBlur",{stdDeviation:d.params.size||4,result:"blur"});return a.appendChild(c)};return b}(t),bq.blur=g,v=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}bO(b,a),b.prototype.buildFilter=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o;g=this,c=(l=g.params.blur)!=null?l:4,i=(m=g.params.strength)!=null?m:1,d=(n=g.params.color)!=null?n:"#D1BEB0",typeof d=="string"&&(d=chroma.hex(d)),h=d.rgb,e=(o=g.params.inner)!=null?o:!1,f=(j=g.params.knockout)!=null?j:!1,b=(k=g.params.alpha)!=null?k:1,e?g.innerGlow(a,c,i,h,b,f):g.outerGlow(a,c,i,h,b,f)},b.prototype.outerGlow=function(a,b,c,d,e,f){var g,h,i,j,k,l,m;k=this,g=k.SVG,j=g("feColorMatrix",{"in":"SourceGraphic",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0",result:"mask"}),a.appendChild(j),c>0&&(m=g("feMorphology",{"in":"mask",radius:c,operator:"dilate",result:"mask"}),a.appendChild(m)),j=g("feColorMatrix",{"in":"mask",type:"matrix",values:"0 0 0 0 "+d[0]/255+" 0 0 0 0 "+d[1]/255+" 0 0 0 0 "+d[2]/255+" 0 0 0 1 0",result:"r0"}),a.appendChild(j),h=g("feGaussianBlur",{"in":"r0",stdDeviation:b,result:"r1"}),a.appendChild(h),i=g("feComposite",{operator:"out","in":"r1",in2:"mask",result:"comp"}),a.appendChild(i),l=g("feMerge"),f||l.appendChild(g("feMergeNode",{"in":"SourceGraphic"})),l.appendChild(g("feMergeNode",{"in":"r1"}));return a.appendChild(l)},b.prototype.innerGlow=function(a,b,c,d,e,f){var g,h,i,j,k,l,m;k=this,g=k.SVG,bs("innerglow"),j=g("feColorMatrix",{"in":"SourceGraphic",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 500 0",result:"mask"}),a.appendChild(j),m=g("feMorphology",{"in":"mask",radius:c,operator:"erode",result:"r1"}),a.appendChild(m),h=g("feGaussianBlur",{"in":"r1",stdDeviation:b,result:"r2"}),a.appendChild(h),j=g("feColorMatrix",{type:"matrix","in":"r2",values:"1 0 0 0 "+d[0]/255+" 0 1 0 0 "+d[1]/255+" 0 0 1 0 "+d[2]/255+" 0 0 0 -1 1",result:"r3"}),a.appendChild(j),i=g("feComposite",{operator:"in","in":"r3",in2:"mask",result:"comp"}),a.appendChild(i),l=g("feMerge"),f||l.appendChild(g("feMergeNode",{"in":"SourceGraphic"})),l.appendChild(g("feMergeNode",{"in":"comp"}));return a.appendChild(l)};return b}(t),bq.glow=v,br.Kartograph.prototype.addGeoPath=function(a,b,c){var d,e,f;b==null&&(b=[]),c==null&&(c=""),d=this,f=d.getGeoPathStr(a,b),e=d.paper.path(f),c!==""&&e.node.setAttribute("class",c);return e},br.Kartograph.prototype.getGeoPathStr=function(a,b){var c,d,e,f,g,h,i;b==null&&(b=[]),e=this,type(b)==="string"&&(b=b.split("")),b.length===0&&b.push("M"),f="";for(d in a){g=a[d],c=(i=b[d])!=null?i:"L",h=e.lonlat2xy(g);if(isNaN(h[0])||isNaN(h[1]))continue;f+=c+h[0]+","+h[1]}return f},br.Kartograph.prototype.addGeoPolygon=function(a,b){var c,d,e;e=this,c=["M"];for(d in a)c.push("L");c.push("Z");return e.addGeoPath(a,c,b)},S=function(){function b(b){this.zoomOut=bP(this.zoomOut,this),this.zoomIn=bP(this.zoomIn,this);var c,d,e,f,g,h,i,j;f=this,f.map=b,c=b.container,d=function(b,c){var d,e,f,g;c==null&&(c=[]),e=a('<div class="'+b+'" />');for(f=0,g=c.length;f<g;f++)d=c[f],e.append(d);return e},e=function(b){return a(b.target).addClass("md")},g=function(b){return a(b.target).removeClass("md")},j=d("plus"),j.mousedown(e),j.mouseup(g),j.click(f.zoomIn),i=d("minus"),i.mousedown(e),i.mouseup(g),i.click(f.zoomOut),h=d("zoom-control",[j,i]),c.append(h)}b.prototype.zoomIn=function(a){var b;b=this,b.map.opts.zoom+=1;return b.map.resize()},b.prototype.zoomOut=function(a){var b;b=this,b.map.opts.zoom-=1,b.map.opts.zoom<1&&(b.map.opts.zoom=1);return b.map.resize()};return b}(),bd=function(){function a(a,b,c){var d,e,f,g,h=this;a==null&&(a=[0,1]),b==null&&(b=null),c==null&&(c=null),this.rangedScale=bP(this.rangedScale,this),this.scale=bP(this.scale,this),e=this,g=[];for(d in a){if(bE(c)==="function"&&c(a[d])===!1)continue;b!=null?bE(b)==="function"?f=b(a[d]):f=a[d][b]:f=a[d],isNaN(f)||g.push(f)}g=g.sort(function(a,b){return a-b}),e.values=g,e._range=[0,1],e.rangedScale.range=function(a){e._range=a;return e.rangedScale}}a.prototype.scale=function(a){return a},a.prototype.rangedScale=function(a){var b,c;b=this,a=b.scale(a),c=b._range;return a*(c[1]-c[0])+c[0]};return a}(),H=function(a){function b(){this.scale=bP(this.scale,this);return b.__super__.constructor.apply(this,arguments)}bO(b,a),b.prototype.scale=function(a){var b,c;b=this,c=b.values;return(a-c[0])/(c[c.length-1]-c[0])};return b}(bd),I=function(a){function b(){this.scale=bP(this.scale,this);return b.__super__.constructor.apply(this,arguments)}bO(b,a),b.prototype.scale=function(a){var b,c;b=this,c=b.values,bs=Math.log;return(bs(a)-bs(c[0]))/(bs(c[c.length-1])-bs(c[0]))};return b}(bd),bf=function(a){function b(){this.scale=bP(this.scale,this);return b.__super__.constructor.apply(this,arguments)}bO(b,a),b.prototype.scale=function(a){var b,c;b=this,c=b.values;return Math.sqrt((a-c[0])/(c[c.length-1]-c[0]))};return b}(bd),Y=function(a){function b(){this.scale=bP(this.scale,this);return b.__super__.constructor.apply(this,arguments)}bO(b,a),b.prototype.scale=function(a){var b,c,d,e,f,g;d=this,g=d.values,c=g.length-1;for(b in g){f=g[Number(b)],e=g[Number(b)+1];if(a===f)return b/c;if(b<c&&a>f&&a<e)return b/c+(a-f)/(e-f)}};return b}(bd),br.scale={},br.scale.identity=function(a){return(new bd(domain,prop,bq)).rangedScale},br.scale.linear=function(a,b,c){return(new H(a,b,c)).rangedScale},br.scale.log=function(a,b,c){return(new I(a,b,c)).rangedScale},br.scale.sqrt=function(a,b,c){return(new bf(a,b,c)).rangedScale},br.scale.quantile=function(a,b,c){return(new Y(a,b,c)).rangedScale},bj=function(){function b(b){a=this,a.location=b.location,a.data=b.data,a.map=b.map,a.layers=b.layers,a.key=b.key,a.x=b.x,a.y=b.y}var a;a=null,b.prototype.init=function(){return a},b.prototype.overlaps=function(a){return!1},b.prototype.update=function(b){return a},b.prototype.nodes=function(){return[]},b.prototype.clear=function(){return a};return b}(),br.Symbol=bj,bk=function(){function c(a){this._initTooltips=bP(this._initTooltips,this),this._noverlap=bP(this._noverlap,this),this._kMeans=bP(this._kMeans,this);var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w;b=this,m=["data","location","type","map"],k=["filter","tooltip","click","delay","sortBy","clustering","aggregate","clusteringOpts","mouseenter","mouseleave"];for(n=0,r=m.length;n<r;n++){l=m[n];if(a[l]!=null)b[l]=a[l];else throw"SymbolGroup: missing argument '"+l+"'"}for(o=0,s=k.length;o<s;o++)l=k[o],a[l]!=null&&(b[l]=a[l]);d=b.type;if(d==null)bB("could not resolve symbol type",b.type);else{v=d.props;for(p=0,t=v.length;p<t;p++)l=v[p],a[l]!=null&&(b[l]=a[l]);b.layers={mapcanvas:b.map.paper},w=d.layers;for(q=0,u=w.length;q<u;q++)h=w[q],j=c._layerid++,g="sl_"+j,h.type==="svg"?i=b.map.createSVGLayer(g):h.type==="html"&&(i=b.map.createHTMLLayer(g)),b.layers[h.id]=i;b.symbols=[];for(f in b.data)e=b.data[f],bE(b.filter)==="function"?b.filter(e,f)&&b.add(e,f):b.add(e,f);b.layout(),b.render(),b.map.addSymbolGroup(b)}}var b;b=null,c.prototype.add=function(a,c){var d,e,f,g,h,i,j,k;b=this,d=b.type,e=b._evaluate(b.location,a,c),bE(e)==="array"&&(e=new br.LonLat(e[0],e[1])),g={layers:b.layers,location:e,data:a,key:c!=null?c:b.symbols.length,map:b.map},k=d.props;for(i=0,j=k.length;i<j;i++)f=k[i],b[f]!=null&&(g[f]=b._evaluate(b[f],a,c));h=new d(g),b.symbols.push(h);return h},c.prototype.layout=function(){var a,c,d,e,f,g,h,i,j,k;j=b.symbols;for(h=0,i=j.length;h<i;h++){f=j[h],c=f.location;if(bE(c)==="string"){k=c.split("."),a=k[0],e=k[1],d=b.map.getLayerPath(a,e);if(d!=null)g=b.map.viewBC.project(d.path.centroid());else{bB("could not find layer path "+a+"."+e);continue}}else g=b.map.lonlat2xy(c);f.x=g[0],f.y=g[1]}b.clustering==="k-means"?b._kMeans():b.clustering==="noverlap"&&b._noverlap();return b},c.prototype.render=function(){var c,d,e,f,g,h,i,j,k,l,m;b=this,b.sortBy&&(f="asc",bE(b.sortBy)==="string"&&(b.sortBy=b.sortBy.split(" ",2),e=b.sortBy[0],f=(k=b.sortBy[1])!=null?k:"asc"),b.symbols=b.symbols.sort(function(a,c){var d,g,h;bE(b.sortBy)==="function"?(g=b.sortBy(a.data,a),h=b.sortBy(c.data,c)):(g=a[e],h=c[e]);if(g===h)return 0;d=f==="asc"?1:-1;return g>h?1*d:-1*d})),l=b.symbols;for(g=0,i=l.length;g<i;g++){d=l[g],d.render(),m=d.nodes();for(h=0,j=m.length;h<j;h++)c=m[h],c.symbol=d}bE(b.tooltip)==="function"&&b._initTooltips(),a.each(["click","mouseenter","mouseleave"],function(e,f){var g,h,i,j;if(bE(b[f])==="function"){i=b.symbols,j=[];for(g=0,h=i.length;g<h;g++)d=i[g],j.push(function(){var e,g,h,i,j=this;h=d.nodes(),i=[];for(e=0,g=h.length;e<g;e++)c=h[e],i.push(a(c)[f](function(c){var d;d=c.target;while(!d.symbol)d=a(d).parent().get(0);c.stopPropagation();return b[f](d.symbol.data,d.symbol,c)}));return i}.call(this));return j}});return b},c.prototype.tooltips=function(a){b=this,b.tooltips=a,b._initTooltips();return b},c.prototype.remove=function(a){var c,d,e,f,g,h,i,j,k;b=this,d=[],i=b.symbols;for(g=0,h=i.length;g<h;g++){f=i[g];if(a!=null&&!a(f.data)){d.push(f);continue}try{f.clear()}catch(l){bB("error: symbolgroup.remove")}}if(a==null){j=b.layers,k=[];for(c in j)e=j[c],c!=="mapcanvas"?k.push(e.remove()):k.push(void 0);return k}return b.symbols=d},c.prototype._evaluate=function(a,b,c){var d;return bE(a)==="function"?d=a(b,c):d=a},c.prototype._kMeans=function(){var a,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x;b=this,(u=b.osymbols)==null&&(b.osymbols=b.symbols),a=b.type,b.clusteringOpts!=null&&(k=b.clusteringOpts.size),k==null&&(k=64),c=bR().iterations(16).size(k),v=b.osymbols;for(m=0,q=v.length;m<q;m++)j=v[m],c.add({x:j.x,y:j.y});g=c.means(),h=[];for(n=0,r=g.length;n<r;n++){f=g[n];if(f.size===0)continue;d=[],w=f.indices;for(o=0,s=w.length;o<s;o++)e=w[o],d.push(b.osymbols[e].data);d=b.aggregate(d),l={layers:b.layers,location:!1,data:d,map:b.map},x=a.props;for(p=0,t=x.length;p<t;p++)i=x[p],b[i]!=null&&(l[i]=b._evaluate(b[i],d));j=new a(l),j.x=f.x,j.y=f.y,h.push(j)}return b.symbols=h},c.prototype._noverlap=function(){var a,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V;b=this,(S=b.osymbols)==null&&(b.osymbols=b.symbols),j=3,a=b.type;if(bQ.call(a.props,"radius")<0)bB('noverlap layout only available for symbols with property "radius"');else{A=b.osymbols.slice(),b.clusteringOpts!=null&&(D=b.clusteringOpts.tolerance,n=b.clusteringOpts.maxRatio),D==null&&(D=.05),n==null&&(n=.8);for(h=H=0,T=j-1;0<=T?H<=T:H>=T;h=0<=T?++H:--H){A.sort(function(a,b){return b.radius-a.radius}),k=A.length,o=[];for(p=I=0,U=k-3;0<=U?I<=U:I>=U;p=0<=U?++I:--I){x=A[p];if(!x)continue;u=x.radius*(1-D),l=x.x-u,s=x.x+u,B=x.y-u,c=x.y+u,i=[];for(q=J=V=p+1,Q=k-2;V<=Q?J<=Q:J>=Q;q=V<=Q?++J:--J){y=A[q];if(!y)continue;v=y.radius,m=y.x-v,t=y.x+v,C=y.y-v,d=y.y+v,v/x.radius<n&&!(s<m||t<l)&&!(c<C||d<B)&&(f=y.x-x.x,g=y.y-x.y,f*f+g*g<(u+v)*(u+v)&&i.push(q))}if(i.length>0){e=[x.data],r=x.radius*x.radius;for(K=0,L=i.length;K<L;K++)h=i[K],e.push(A[h].data),r+=A[h].radius*A[h].radius;e=b.aggregate(e),z={layers:b.layers,location:!1,data:e,map:b.map},R=a.props;for(O=0,M=R.length;O<M;O++)p=R[O],b[p]!=null&&(z[p]=b._evaluate(b[p],e));w=new a(z),E=x.radius*x.radius/r,F=x.x*E,G=x.y*E;for(P=0,N=i.length;P<N;P++)h=i[P],y=A[h],E=y.radius*y.radius/r,F+=y.x*E,G+=y.y*E,A[h]=void 0;w.x=F,w.y=G,A[p]=void 0,o.push(w)}else o.push(x)}A=o}return b.symbols=A}},c.prototype._initTooltips=function(){var c,d,e,f,g,h,i,j,k,l,m;b=this,f=b.tooltip,l=b.symbols;for(h=0,j=l.length;h<j;h++){e=l[h],c={position:{target:"mouse",viewport:a(window),adjust:{x:7,y:7}},show:{delay:20},content:{},events:{show:function(b,c){return a(".qtip").filter(function(){return this!==c.elements.tooltip.get(0)}).hide()}}},g=f(e.data,e.key),bE(g)==="string"?c.content.text=g:bE(g)==="array"&&(c.content.title=g[0],c.content.text=g[1]),m=e.nodes();for(i=0,k=m.length;i<k;i++)d=m[i],a(d).qtip(c)}},c.prototype.onResize=function(){var a,c,d,e;b=this,b.layout(),e=b.symbols;for(c=0,d=e.length;c<d;c++)a=e[c],a.update()},c.prototype.update=function(a,c,d){var e,f,g,h,i,j,k,l;b=this,a==null&&(a={}),k=b.symbols;for(g=0,i=k.length;g<i;g++){f=k[g],l=b.type.props;for(h=0,j=l.length;h<j;h++)e=l[h],a[e]!=null?f[e]=b._evaluate(a[e],f.data):b[e]!=null&&(f[e]=b._evaluate(b[e],f.data));f.update(c,d)}return b};return c}(),bk._layerid=0,br.SymbolGroup=bk,br.Kartograph.prototype.addSymbols=function(a){a.map=this;return new bk(a)},br.dorlingLayout=function(b,c){var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;c==null&&(c=40),n=[],a.each(b.symbols,function(a,b){return n.push({i:a,x:b.path.attrs.cx,y:b.path.attrs.cy,r:b.path.attrs.r})}),n.sort(function(a,b){return b.r-a.r}),f=function(){var a,c,d;for(c=0,d=n.length;c<d;c++)a=n[c],b.symbols[a.i].path.attr({cx:a.x,cy:a.y})};for(o=r=1;1<=c?r<=c:r>=c;o=1<=c?++r:--r)for(l in n)for(m in n)if(m>l){d=n[l],e=n[m];if(d.x+d.r<e.x-e.r||d.x-d.r>e.x+e.r)continue;if(d.y+d.r<e.y-e.r||d.y-d.r>e.y+e.r)continue;i=d.x-e.x,j=d.y-e.y,h=i*i+j*j,p=d.r+e.r,q=p*p,h<q&&(g=Math.sqrt(h),k=10/g,d.x+=i*k*(1-d.r/p),d.y+=j*k*(1-d.r/p),e.x-=i*k*(1-e.r/p),e.y-=j*k*(1-e.r/p))}return f()},h=function(b){function c(a){this.nodes=bP(this.nodes,this),this.clear=bP(this.clear,this),this.update=bP(this.update,this),this.render=bP(this.render,this),this.overlaps=bP(this.overlaps,this);var b,d,e;b=this,c.__super__.constructor.call(this,a),b.radius=(d=a.radius)!=null?d:4,b.style=a.style,b.attrs=a.attrs,b.title=a.title,b["class"]=(e=a["class"])!=null?e:"bubble"}bO(c,b),c.prototype.overlaps=function(a){var b,c,d,e,f,g,h,i,j,k,l;d=this,k=[d.x,d.y,d.radius],g=k[0],i=k[1],e=k[2],l=[a.x,a.y,a.radius],h=l[0],j=l[1],f=l[2];if(g-e>h+f||g+e<h-f||i-e>j+f||i+e<j-f)return!1;b=g-h,c=i-j;return b*b+c*c>(e+f)*(e+f)?!1:!0},c.prototype.render=function(a){var b;b=this,b.path==null&&(b.path=b.layers.mapcanvas.circle(b.x,b.y,b.radius)),b.update(),b.map.applyCSS(b.path);return b},c.prototype.update=function(b,c){var d,e,f;b==null&&(b=!1),c==null&&(c="expo-out"),e=this,f=e.path,d={cx:e.x,cy:e.y,r:e.radius},e.attrs!=null&&(d=a.extend(d,e.attrs)),b?f.animate(d,b,c):f.attr(d),f.node!=null&&(e.style!=null&&f.node.setAttribute("style",e.style),e["class"]!=null&&f.node.setAttribute("class",e["class"])),e.title!=null&&f.attr("title",e.title);return e},c.prototype.clear=function(){var a;a=this,a.path.remove();return a},c.prototype.nodes=function(){var a;a=this;return[a.path.node]};return c}(bj),h.props=["radius","style","class","title","attrs"],h.layers=[],br.Bubble=h,A=function(b){function c(a){var b,d,e,f,g,h;b=this,c.__super__.constructor.call(this,a),b.icon=(e=a.icon)!=null?e:"",b.offset=(f=a.offset)!=null?f:[0,0],b.iconsize=(g=a.iconsize)!=null?g:[10,10],b["class"]=(h=a["class"])!=null?h:"",b.title=(d=a.title)!=null?d:""}bO(c,b),c.prototype.render=function(b){var c,d;d=this,c=d.map.container,d.img=a("<img />"),d.img.attr({src:d.icon,title:d.title,alt:d.title,width:d.iconsize[0],height:d.iconsize[1]}),d.img.addClass(d["class"]),d.img.css({position:"absolute","z-index":1e3,cursor:"pointer"}),d.img[0].symbol=d,c.append(d.img);return d.update()},c.prototype.update=function(){var a;a=this;return a.img.css({left:a.x+a.offset[0]+"px",top:a.y+a.offset[1]+"px"})},c.prototype.clear=function(){var a;a=this,a.img.remove();return a},c.prototype.nodes=function(){var a;a=this;return[a.img]};return c}(br.Symbol),A.props=["icon","offset","class","title","iconsize"],A.layers=[],br.Icon=A,bi=function(a){function b(a){var c,d,e,f,g;c=this,b.__super__.constructor.call(this,a),c.text=(d=a.text)!=null?d:"",c.style=(e=a.style)!=null?e:"",c["class"]=(f=a["class"])!=null?f:"",c.offset=(g=a.offset)!=null?g:[0,0]}bO(b,a),b.prototype.render=function(a){var b,c;c=this,c.lbl=b=c.layers.mapcanvas.text(c.x,c.y,c.text),c.update();return c},b.prototype.update=function(){var a;a=this,a.lbl.attr({x:a.x+a.offset[0],y:a.y+a.offset[1]}),a.lbl.node.setAttribute("style",a.style);return a.lbl.node.setAttribute("class",a["class"])},b.prototype.clear=function(){var a;a=this,a.lbl.remove();return a},b.prototype.nodes=function(){var a;a=this;return[a.lbl.node]};return b}(br.Symbol),bi.props=["text","style","class","offset"],bi.layers=[],br.Label=bi,z=function(b){function c(a){var b,d,e,f;b=this,c.__super__.constructor.call(this,a),b.text=(d=a.text)!=null?d:"",b.style=(e=a.style)!=null?e:"",b["class"]=(f=a["class"])!=null?f:""}bO(c,b),c.prototype.render=function(b){var c,d,e;e=this,c=a("<div>"+e.text+"</div>"),c.css({width:"50px",position:"absolute",left:"-25px","text-align":"center"}),e.lbl=d=a('<div class="label" />'),d.append(c),e.layers.lbl.append(d),c.css({height:c.height()+"px",top:c.height()*-0.4+"px"}),e.update();return e},c.prototype.update=function(){var a;a=this;return a.lbl.css({position:"absolute",left:a.x+"px",top:a.y+"px"})},c.prototype.clear=function(){var a;a=this,a.lbl.remove();return a},c.prototype.nodes=function(){var a;a=this;return[a.lbl[0]]};return c}(br.Symbol),z.props=["text","style","class"],z.layers=[{id:"lbl",type:"html"}],br.HtmlLabel=z,E=function(b){function c(a){this.nodes=bP(this.nodes,this),this.clear=bP(this.clear,this),this.update=bP(this.update,this),this.render=bP(this.render,this);var b,d,e;b=this,c.__super__.constructor.call(this,a),b.labelattrs=(d=a.labelattrs)!=null?d:{},b.buffer=a.buffer,b.center=(e=a.center)!=null?e:!0}bO(c,b),c.prototype.render=function(a){var b;b=this,b.title!=null&&String(b.title).trim()!==""&&(b.buffer&&(b.bufferlabel=b.layers.mapcanvas.text(b.x,b.y,b.title)),b.label=b.layers.mapcanvas.text(b.x,b.y,b.title)),c.__super__.render.call(this,a);return b},c.prototype.update=function(b,d){var e,f,g,h,i;b==null&&(b=!1),d==null&&(d="expo-out"),f=this,c.__super__.update.call(this,b,d),f.label!=null&&(g=f.map.viewport,e=a.extend({},f.labelattrs),h=f.x,i=f.y,f.center?i-=0:h>g.width*.5?(e["text-anchor"]="end",h-=f.radius+5):h<g.width*.5&&(e["text-anchor"]="start",h+=f.radius+5),e.x=h,e.y=i,f.buffer&&(f.bufferlabel.attr(e),f.bufferlabel.attr({stroke:"#fff",fill:"#fff","stroke-linejoin":"round","stroke-linecap":"round","stroke-width":6})),f.label.attr(e),f.label.toFront());return f},c.prototype.clear=function(){var a;a=this;return c.__super__.clear.apply(this,arguments)},c.prototype.nodes=function(){var a,b;a=this,b=c.__super__.nodes.apply(this,arguments),a.label&&b.push(a.label.node),a.bufferlabel&&b.push(a.bufferlabel.node);return b};return c}(h),E.props=["radius","style","class","title","labelattrs","buffer","center","attrs"],E.layers=[],br.LabeledBubble=E,U=function(a){function c(a){var d,e,f,g,h,i,j,k,l,m;b=this,c.__super__.constructor.call(this,a),b.radius=(j=a.radius)!=null?j:4,b.styles=(k=a.styles)!=null?k:"",b.colors=(l=a.colors)!=null?l:["#3cc","#c3c","#33c","#cc3"],b.titles=(m=a.titles)!=null?m:["","","","",""],b.values=(e=a.values)!=null?e:[],b.border=(f=a.border)!=null?f:!1,b.borderWidth=(g=a.borderWidth)!=null?g:2,b["class"]=(h=a["class"])!=null?h:"piechart",(i=(d=Raphael.fn).pieChart)==null&&(d.pieChart=bp)}var b;bO(c,a),b=null,c.prototype.overlaps=function(a){var c,d,e,f,g,h,i,j,k,l;k=[b.x,b.y,b.radius],g=k[0],i=k[1],e=k[2],l=[a.x,a.y,a.radius],h=l[0],j=l[1],f=l[2];if(g-e>h+f||g+e<h-f||i-e>j+f||i+e<j-f)return!1;c=g-h,d=i-j;return c*c+d*d>(e+f)*(e+f)?!1:!0},c.prototype.render=function(a){var c;b=this,b.border!=null&&(c=b.layers.mapcanvas.circle(b.x,b.y,b.radius+b.borderWidth).attr({stroke:"none",fill:b.border})),b.chart=b.layers.mapcanvas.pieChart(b.x,b.y,b.radius,b.values,b.titles,b.colors,"none"),b.chart.push(c);return b},c.prototype.update=function(a){var c;return},c.prototype.clear=function(){var a,c,d,e;b=this,e=b.chart;for(c=0,d=e.length;c<d;c++)a=e[c],a.remove();return b},c.prototype.nodes=function(){var a,c,d,e,f;e=b.chart,f=[];for(c=0,d=e.length;c<d;c++)a=e[c],f.push(a.node);return f};return c}(bj),U.props=["radius","values","styles","class","titles","colors","border","borderWidth"],U.layers=[],br.PieChart=U,bp=function(a,b,c,d,e,f,g){var h,i,j,k,l,m,n,o,p,q,r;if(isNaN(a)||isNaN(b)||isNaN(c))return[];k=this,m=Math.PI/180,i=k.set(),n=function(a,b,c,d,e,f){var g,h,i,j;g=a+c*Math.cos(-d*m),h=a+c*Math.cos(-e*m),i=b+c*Math.sin(-d*m),j=b+c*Math.sin(-e*m);return k.path(["M",a,b,"L",g,i,"A",c,c,0,+(e-d>180),0,h,j,"z"]).attr(f)},h=-270,o=0,l=function(e){var j,k,l,m,p,q,r;r=d[e],j=360*r/o,q=h+j*.5,k=f[e],m=500,l=30,p=n(a,b,c,h,h+j,{fill:k,stroke:g,"stroke-width":1}),p.mouseover(function(){p.stop().animate({transform:"s1.1 1.1 "+a+" "+b},m,"elastic")}),p.mouseout(function(){p.stop().animate({transform:""},m,"elastic")}),h+=j,i.push(p -)};for(q=0,r=d.length;q<r;q++)p=d[q],o+=p;for(j in d)l(j);return i},drawStackedBars=function(a,b,c,d,e,f,g,h){function k(a,b,c,d,e){return i.rect(a,b,c,d).attr(e)}var i=this,j=this.set(),l=0,m=0,n=function(f){var i=e[f],n=d*i/m,o=a-c*.5,p=b+d*.5-l,q=c,r=g[f],s=500,t=30,u=k(o,p-n,q,n,{fill:r,stroke:h,"stroke-width":1});l+=n,u.mouseover(function(){u.stop().animate({transform:"s1.1 1.1 "+a+" "+b},s,"elastic")}).mouseout(function(){u.stop().animate({transform:""},s,"elastic")}),j.push(u)};for(var o=0,p=e.length;o<p;o++)m+=e[o];for(o=0;o<p;o++)n(o);return j},bg=function(a){function b(a){var c,d,e,f,g,h,i,j,k,l;c=this,b.__super__.constructor.call(this,a),c.styles=(i=a.styles)!=null?i:"",c.colors=(j=a.colors)!=null?j:[],c.titles=(k=a.titles)!=null?k:["","","","",""],c.values=(l=a.values)!=null?l:[],c.width=(e=a.width)!=null?e:17,c.height=(f=a.height)!=null?f:30,c["class"]=(g=a["class"])!=null?g:"barchart",(h=(d=Raphael.fn).drawStackedBarChart)==null&&(d.drawStackedBarChart=drawStackedBars)}bO(b,a),b.prototype.overlaps=function(a){var b,c,d,e,f,g,h,i,j,k,l;d=this,k=[d.x,d.y,d.radius],g=k[0],i=k[1],e=k[2],l=[a.x,a.y,a.radius],h=l[0],j=l[1],f=l[2];if(g-e>h+f||g+e<h-f||i-e>j+f||i+e<j-f)return!1;b=g-h,c=i-j;return b*b+c*c>(e+f)*(e+f)?!1:!0},b.prototype.render=function(a){var b,c,d,e,f,g;d=this,e=d.width,c=d.height,f=d.x,g=d.y,b=d.layers.mapcanvas.rect(f-e*.5-2,g-c*.5-2,e+4,c+4).attr({stroke:"none",fill:"#fff"}),d.chart=d.layers.mapcanvas.drawStackedBarChart(d.x,d.y,d.width,d.height,d.values,d.titles,d.colors,"none"),d.chart.push(b);return d},b.prototype.update=function(){var a,b;a=this;return},b.prototype.clear=function(){var a,b,c,d,e;a=this,e=a.chart;for(c=0,d=e.length;c<d;c++)b=e[c],b.remove();a.chart=[];return a},b.prototype.nodes=function(){var a,b,c,d,e,f;b=this,e=b.chart,f=[];for(c=0,d=e.length;c<d;c++)a=e[c],f.push(a.node);return f};return b}(br.Symbol),bg.props=["values","styles","class","titles","colors","width","height"],bg.layers=[],br.StackedBarChart=bg}).call(this); +!function(){function t(){var t={},e=[],n=1,o=1;return t.size=function(r){return arguments.length?(o=r,t):o},t.iterations=function(r){return arguments.length?(n=r,t):n},t.add=function(r){return e.push(r),t},t.means=function(){for(var t=[],i={},a=Math.min(o,e.length),s=0,l=2*a;l>s;s++){var u=e[~~(Math.random()*e.length)],p=u.x+"/"+u.y;if(!(p in i)&&(i[p]=1,t.push({x:u.x,y:u.y})>=a))break}a=t.length;for(var h=0;n>h;h++){for(var c=r().points(t),s=0;a>s;s++){var f=t[s];f.sumX=0,f.sumY=0,f.size=0,f.points=[],f.indices=[]}for(var s=0;s<e.length;s++){var d=e[s],f=c.find(d);f.sumX+=d.x,f.sumY+=d.y,f.size++,f.points.push(d),f.indices.push(s)}for(var s=0;a>s;s++){var f=t[s];f.size&&(f.x=f.sumX/f.size,f.y=f.sumY/f.size)}}return t},t}function r(){function t(r,n){if(r.length){var o=a[n%a.length],i=r.length>>1;return r.sort(e(o)),{axis:o,point:r[i],left:t(r.slice(0,i),n+1),right:t(r.slice(i+1),n+1)}}}function r(t,r){for(var e=0,n=0;n<a.length;n++){var o=a[n],i=t[o]-r[o];e+=i*i}return e}function e(t){return function(r,e){return r=r[t],e=e[t],e>r?-1:r>e?1:0}}function n(t,e,o){if(r(t.point,e)<r(o.point,e)&&(o=t),t.left&&(o=n(t.left,e,o)),t.right){var i=t.point[t.axis]-e[t.axis];i*i<r(o.point,e)&&(o=n(t.right,e,o))}return o}var o,i={},a=["x","y"],s=[];return i.axes=function(t){return arguments.length?(a=t,i):a},i.points=function(t){return arguments.length?(s=t,o=null,i):s},i.find=function(t){return n(i.root(),t,o).point},i.root=function(){return o||(o=t(s,0))},i}var e,n,o,i,a,l,u,p,h,c,f,d,y,v,g,_,b,x,w,M,P,C,j,A,B,L,S,k,I,N,G,z,E,T,R,F,V,O,H,X,q,D,U,Q,Y,W,Z,$,K,J,tr,rr,er,nr,or,ir,ar,sr,lr,ur,pr,hr,cr,fr,dr,yr,mr,vr,gr,_r,br,xr,wr,Mr,Pr,Cr,jr,Ar,Br,Lr,Sr,kr,Ir,Nr,Gr,zr,Er,Tr,Rr,Fr,Vr,Or,Hr,Xr,qr,Dr,Ur,Qr,Yr,Wr,Zr,$r,Kr,Jr,te,re,ee,ne,oe,ie={}.hasOwnProperty,ae=function(t,r){function e(){this.constructor=t}for(var n in r)ie.call(r,n)&&(t[n]=r[n]);return e.prototype=r.prototype,t.prototype=new e,t.__super__=r.prototype,t},se=function(t,r){return function(){return t.apply(r,arguments)}},le=[].indexOf||function(t){for(var r=0,e=this.length;e>r;r++)if(r in this&&this[r]===t)return r;return-1};Br="undefined"!=typeof exports&&null!==exports?exports:this,br=Br.$K=null!=(Rr=Br.kartograph)?Rr:Br.kartograph={},br.version="0.8.1",e=Br.jQuery,br.__verbose=!1,Sr=function(){var t;try{return console.warn.apply(console,arguments)}catch(r){t=r;try{return opera.postError.apply(opera,arguments)}catch(r){return t=r,alert(Array.prototype.join.call(arguments," "))}}},xr=function(){var t;if(br.__verbose)try{return console.debug.apply(console,arguments)}catch(r){t=r;try{return opera.postError.apply(opera,arguments)}catch(r){return t=r,alert(Array.prototype.join.call(arguments," "))}}},null==(Fr=(Er=String.prototype).trim)&&(Er.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),Array.prototype.indexOf||(Array.prototype.indexOf=function(t){"use strict";if(null==this)throw new TypeError;var r=Object(this),e=r.length>>>0;if(0===e)return-1;var n=0;if(arguments.length>0&&(n=Number(arguments[1]),n!=n?n=0:0!=n&&1/0!=n&&n!=-1/0&&(n=(n>0||-1)*Math.floor(Math.abs(n)))),n>=e)return-1;for(var o=n>=0?n:Math.max(e-Math.abs(n),0);e>o;o++)if(o in r&&r[o]===t)return o;return-1}),zr=function(){var t,r,e,n,o;for(t={},o="Boolean Number String Function Array Date RegExp Undefined Null".split(" "),e=0,n=o.length;n>e;e++)r=o[e],t["[object "+r+"]"]=r.toLowerCase();return function(r){var e;return e=Object.prototype.toString.call(r),t[e]||"object"}}(),i=function(){function t(t,r,e,n){var o;null==t&&(t=0),null==r&&(r=0),null==e&&(e=null),null==n&&(n=null),o=this,null===e?(o.xmin=Number.MAX_VALUE,o.xmax=-1*Number.MAX_VALUE):(o.xmin=o.left=t,o.xmax=o.right=t+e,o.width=e),null===n?(o.ymin=Number.MAX_VALUE,o.ymax=-1*Number.MAX_VALUE):(o.ymin=o.top=r,o.ymax=o.bottom=n+r,o.height=n)}return t.prototype.update=function(t,r){var e;return null==r&&(r=t[1],t=t[0]),e=this,e.xmin=Math.min(e.xmin,t),e.ymin=Math.min(e.ymin,r),e.xmax=Math.max(e.xmax,t),e.ymax=Math.max(e.ymax,r),e.left=e.xmin,e.top=e.ymin,e.right=e.xmax,e.bottom=e.ymax,e.width=e.xmax-e.xmin,e.height=e.ymax-e.ymin,this},t.prototype.intersects=function(t){return t.left<s.right&&t.right>s.left&&t.top<s.bottom&&t.bottom>s.top},t.prototype.inside=function(t,r){var e;return e=this,t>=e.left&&t<=e.right&&r>=e.top&&r<=e.bottom},t.prototype.join=function(t){var r;return r=this,r.update(t.left,t.top),r.update(t.right,t.bottom),this},t}(),i.fromXML=function(t){var r,e,n,o;return n=Number(t.getAttribute("x")),o=Number(t.getAttribute("y")),e=Number(t.getAttribute("w")),r=Number(t.getAttribute("h")),new br.BBox(n,o,e,r)},br.BBox=i,null==(Zr=br.geom)&&(br.geom={}),null==(Kr=(Tr=br.geom).clipping)&&(Tr.clipping={}),d=function(){function t(){}var r,e,n,o,i;return e=0,n=1,o=2,r=4,i=8,t.prototype.compute_out_code=function(t,r,e){var n,o;return o=this,n=o.INSIDE,r<t.left?n|=o.LEFT:r>t.right&&(n|=o.RIGHT),e<t.top?n|=o.TOP:e>t.bottom&&(n|=o.BOTTOM),n},t.prototype.clip=function(t,r,e,n,o){var i,a,s,l,u,p,h;for(u=this,a=u.compute_out_code(t,r,e),s=u.compute_out_code(t,n,o),i=False;True;){if(!(a|s)){i=True;break}if(a&s)break;l=0===code?s:a,l&u.TOP?(p=r+(n-r)*(t.top-e)/(o-e),h=t.top):l&u.BOTTOM?(p=r+(n-r)*(t.bottom-e)/(o-e),h=t.bottom):l&u.RIGHT?(h=e+(o-e)*(t.right-r)/(n-r),p=t.right):l&u.LEFT&&(h=e+(o-e)*(t.left-r)/(n-r),p=t.left),l===a?(r=p,e=h,a=u.compute_out_code(t,r,e)):(n=p,o=h,s=u.compute_out_code(t,n,o))}return i?[r,e,n,o]:null},t}(),br.geom.clipping.CohenSutherland=d,S=function(){function t(t,r,n){var o,i;i=this,i.container=o=e(t),null==r&&(r=o.width()),null==n&&(n=o.height()),0===n&&(n="auto"),i.size={h:n,w:r},i.markers=[],i.pathById={},i.container.addClass("kartograph")}return t.prototype.createSVGLayer=function(t){var r,n,o,i,a,s,l,u;return i=this,null==(u=i._layerCnt)&&(i._layerCnt=0),o=i._layerCnt++,l=i.viewport,n=i.container,a=Raphael(n[0],l.width,l.height),s=e(a.canvas),s.css({position:"absolute",top:"0px",left:"0px","z-index":o+5}),"static"===n.css("position")&&n.css({position:"relative",height:l.height+"px"}),s.addClass(t),r=e("desc",a.canvas).text(),e("desc",a.canvas).text(r.replace("with ","with kartograph "+br.version+" and ")),a},t.prototype.createHTMLLayer=function(t){var r,n,o,i,a,s;return i=this,a=i.viewport,r=i.container,null==(s=i._layerCnt)&&(i._layerCnt=0),o=i._layerCnt++,n=e('<div class="layer '+t+'" />'),n.css({position:"absolute",top:"0px",left:"0px",width:a.width+"px",height:a.height+"px","z-index":o+5}),r.append(n),n},t.prototype.load=function(t,r,n){var o,i,a,s;return i=this,o=e.Deferred(),i.clear(),i.opts=null!=n?n:{},null==(s=(a=i.opts).zoom)&&(a.zoom=1),i.mapLoadCallback=r,i._loadMapDeferred=o,i._lastMapUrl=t,i.cacheMaps&&null!=br.__mapCache[t]?i._mapLoaded(br.__mapCache[t]):e.ajax({url:t,dataType:"text",success:i._mapLoaded,context:i,error:function(t,r,e){return Sr(t,r,e)}}),o.promise()},t.prototype.loadMap=function(){return this.load.apply(this,arguments)},t.prototype.setMap=function(t,r){var e,n,o;e=this,e.opts=null!=r?r:{},null==(o=(n=e.opts).zoom)&&(n.zoom=1),e._lastMapUrl="string",e._mapLoaded(t)},t.prototype._mapLoaded=function(t){var r,n,o,a,s,l,u,p,h,c,f,d,y,m,v,g,_;l=this,l.cacheMaps&&(null==(y=br.__mapCache)&&(br.__mapCache={}),br.__mapCache[l._lastMapUrl]=t);try{t=e(t)}catch(b){return o=b,Sr("something went horribly wrong while parsing svg"),l._loadMapDeferred.reject("could not parse svg"),void 0}l.svgSrc=t,r=e("view",t),null==l.paper&&(f=l.size.w,a=l.size.h,"auto"===a&&(p=r.attr("w")/r.attr("h"),a=f/p),l.viewport=new i(0,0,f,a)),c=l.viewport,l.viewAB=n=br.View.fromXML(r[0]),u=null!=(m=l.opts.padding)?m:0,s=null!=(v=l.opts.halign)?v:"center",h=null!=(g=l.opts.valign)?g:"center",d=null!=(_=l.opts.zoom)?_:1,l.viewBC=new br.View(l.viewAB.asBBox(),c.width*d,c.height*d,u,s,h),l.proj=br.Proj.fromXML(e("proj",r)[0]),null!=l.mapLoadCallback&&l.mapLoadCallback(l),null!=l._loadMapDeferred&&l._loadMapDeferred.resolve(l)},t.prototype.addLayer=function(t,r){var n,o,i,a,s,l,u,p,h,c,f,d,y,m,v,g,_;return null==r&&(r={}),u=this,null==(v=u.layerIds)&&(u.layerIds=[]),null==(g=u.layers)&&(u.layers={}),null==u.paper&&(u.paper=u.createSVGLayer()),d=t,"object"===zr(r)?(s=r.name,c=r.key,m=r.title):r={},l=u.paper,r.add_svg_layer&&(l=u.createSVGLayer()),null==s&&(s=d),y=e("#"+d,u.svgSrc),0!==y.length?(a=new V(s,c,u,r.filter,l),n=e("*",y[0]),f=n.length,o=null!=(_=r.chunks)?_:f,i=0,h=function(){var t,e,s,l,u,c;for(t=o*i,e=u=0;o>=0?o>u:u>o;e=o>=0?++u:--u)f>t+e&&a.addPath(n.get(t+e),m);if(null!=r.styles){c=r.styles;for(s in c)l=c[s],a.style(s,l)}return i++,f>i*o?setTimeout(h,0):p()},p=function(){var t,e,n,o;for(a.paths.length>0&&(u.layers[s]=a,u.layerIds.push(s)),t=["click","mouseenter","mouseleave","dblclick","mousedown","mouseup","mouseover","mouseout"],n=0,o=t.length;o>n;n++)e=t[n],"function"===zr(r[e])&&a.on(e,r[e]);return null!=r.tooltips&&a.tooltips(r.tooltips),null!=r.done?r.done():void 0},null!=r.chunks?setTimeout(h,0):h(),u):void 0},t.prototype.getLayer=function(t){var r;return r=this,null==r.layers[t]?(Sr("could not find layer "+t),null):r.layers[t]},t.prototype.getLayerPath=function(t,r){var e,n;return n=this,e=n.getLayer(t),null!=e?"object"===zr(r)?e.getPaths(r)[0]:e.getPath(r):null},t.prototype.onLayerEvent=function(t,r,e){var n;return n=this,n.getLayer(e).on(t,r),n},t.prototype.addMarker=function(t){var r,e;return r=this,r.markers.push(t),e=r.viewBC.project(r.viewAB.project(r.proj.project(t.lonlat.lon,t.lonlat.lat))),t.render(e[0],e[1],r.container,r.paper)},t.prototype.clearMarkers=function(){var t,r,e,n,o;for(r=this,o=r.markers,e=0,n=o.length;n>e;e++)t=o[e],t.clear();return r.markers=[]},t.prototype.fadeIn=function(t){var r,e,n,o,i,a,s,l,u,p,h;null==t&&(t={}),i=this,o=null!=(l=t.layer)?l:i.layerIds[i.layerIds.length-1],e=null!=(u=t.duration)?u:500,p=i.layers[o].pathsById,h=[];for(n in p)s=p[n],h.push(function(){var t,n,o;for(o=[],t=0,n=s.length;n>t;t++)a=s[t],r="function"===zr(e)?e(a.data):e,a.svgPath.attr("opacity",0),o.push(a.svgPath.animate({opacity:1},r));return o}());return h},t.prototype.loadCoastline=function(){var t;return t=this,e.ajax({url:"coastline.json",success:t.renderCoastline,context:t})},t.prototype.resize=function(t,r){var e,n,o,i,a,s,l,u,p,h,c,f,d,y,m,v,g;a=this,e=a.container,null==t&&(t=e.width()),null==r&&(r=e.height()),a.viewport=p=new br.BBox(0,0,t,r),null!=a.paper&&a.paper.setSize(p.width,p.height),p=a.viewport,s=null!=(d=a.opts.padding)?d:0,n=null!=(y=a.opts.halign)?y:"center",u=null!=(m=a.opts.valign)?m:"center",h=a.opts.zoom,a.viewBC=new br.View(a.viewAB.asBBox(),p.width*h,p.height*h,s,n,u),v=a.layers;for(o in v)i=v[o],i.setView(a.viewBC);if(null!=a.symbolGroups)for(g=a.symbolGroups,c=0,f=g.length;f>c;c++)l=g[c],l.onResize()},t.prototype.lonlat2xy=function(t){var r,e;return e=this,2===t.length&&(t=new br.LonLat(t[0],t[1])),3===t.length&&(t=new br.LonLat(t[0],t[1],t[2])),r=e.proj.project(t.lon,t.lat,t.alt),e.viewBC.project(e.viewAB.project(r))},t.prototype.addSymbolGroup=function(t){var r,e;return r=this,null==(e=r.symbolGroups)&&(r.symbolGroups=[]),r.symbolGroups.push(t)},t.prototype.removeSymbols=function(t){var r,e,n,o,i,a;if(r=this,null!=t)return r.symbolGroups[t].remove();for(i=r.symbolGroups,a=[],n=0,o=i.length;o>n;n++)e=i[n],a.push(e.remove());return a},t.prototype.clear=function(){var t,r,n,o,i,a;if(r=this,null!=r.layers){for(t in r.layers)r.layers[t].remove();r.layers={},r.layerIds=[]}if(null!=r.symbolGroups){for(a=r.symbolGroups,o=0,i=a.length;i>o;o++)n=a[o],n.remove();r.symbolGroups=[]}return null!=r.paper?(e(r.paper.canvas).remove(),r.paper=void 0):void 0},t.prototype.loadCSS=function(t,r){var n;return n=this,Raphael.svg?(e("body").append('<link rel="stylesheet" href="'+t+'" />'),r()):e.ajax({url:t,dataType:"text",success:function(t){return n.styles=br.parsecss(t),r()},error:function(r,e,n){return Sr("error while loading "+t,r,e,n)}})},t.prototype.applyCSS=function(t,r){var e,n,o,i,a,s,l,u,p,h,c,f,d,y,m;if(o=this,null==o.styles)return t;null==(f=o._pathTypes)&&(o._pathTypes=["path","circle","rectangle","ellipse"]),null==(d=o._regardStyles)&&(o._regardStyles=["fill","stroke","fill-opacity","stroke-width","stroke-opacity"]);for(s in o.styles)for(i=s,y=i.split(","),u=0,h=y.length;h>u;u++)if(l=y[u],i=l.split(" "),i=i[i.length-1],i=i.split(":"),!(i.length>1||(i=i[0].split("."),e=i.slice(1),e.length>0&&e.indexOf(r)<0||(i=i[0],o._pathTypes.indexOf(i)>=0&&i!==t.type))))for(a=o.styles[s],m=o._regardStyles,p=0,c=m.length;c>p;p++)n=m[p],null!=a[n]&&t.attr(n,a[n]);return t},t.prototype.style=function(t,r,e,n,o){var i;return i=this,t=i.getLayer(t),null!=t?t.style(r,e,n,o):void 0},t}(),L=br,Br.kartograph=function(t,r,e){return new S(t,r,e)},br.map=function(t,r,e){return new S(t,r,e)},br.__mapCache={},e.extend(Br.kartograph,L),R=function(){function t(t,r,e){null==e&&(e=0),this.lon=Number(t),this.lat=Number(r),this.alt=Number(e)}return t.prototype.distance=function(t){var r,e,n,o,i,a,s,l,u;return u=this,r=6371,a=Math.PI/180,o=(t.lat-u.lat)*a,i=(t.lon-u.lon)*a,s=u.lat*a,l=t.lat*a,e=Math.sin(o/2)*Math.sin(o/2)+Math.sin(i/2)*Math.sin(i/2)*Math.cos(s)*Math.cos(l),n=2*Math.atan2(Math.sqrt(e),Math.sqrt(1-e)),r*n},t}(),G=function(t){function r(t,e,n){null==n&&(n=0),r.__super__.constructor.call(this,e,t,n)}return ae(r,t),r}(R),br.LonLat=R,br.LatLon=G,V=function(){function t(t,r,e,n,o){var i;i=this,i.id=t,i.path_id=r,i.paper=null!=o?o:e.paper,i.view=e.viewBC,i.map=e,i.filter=n}return t.prototype.addPath=function(t,r){var e,n,o,i,a,s,l;return n=this,null==(a=n.paths)&&(n.paths=[]),e=new O(t,n.id,n,r),"function"===zr(n.filter)&&n.filter(e.data)===!1?(e.remove(),void 0):(n.paths.push(e),null!=n.path_id?(null==(s=n.pathsById)&&(n.pathsById={}),null==(l=(o=n.pathsById)[i=e.data[n.path_id]])&&(o[i]=[]),n.pathsById[e.data[n.path_id]].push(e)):void 0)},t.prototype.hasPath=function(t){var r;return r=this,null!=r.pathsById&&null!=r.pathsById[t]},t.prototype.getPathsData=function(){var t,r,e,n,o,i;for(t=this,e=[],i=t.paths,n=0,o=i.length;o>n;n++)r=i[n],e.push(r.data);return e},t.prototype.getPath=function(t){var r;return r=this,r.hasPath(t)?r.pathsById[t][0]:null},t.prototype.getPaths=function(t){var r,e,n,o,i,a,s,l;if(o=this,n=[],"object"===zr(t))for(l=o.paths,a=0,s=l.length;s>a;a++){i=l[a],e=!0;for(r in t)e=e&&i.data[r]===t[r];e&&n.push(i)}return n},t.prototype.setView=function(t){var r,e,n,o,i;for(r=this,i=r.paths,n=0,o=i.length;o>n;n++)e=i[n],e.setView(t);return r},t.prototype.remove=function(){var t,r,e,n,o,i;for(t=this,o=t.paths,i=[],e=0,n=o.length;n>e;e++)r=o[e],i.push(r.remove());return i},t.prototype.style=function(t,r,e,n){var o,i,a,s,l,u,p,h,c,f,d;if(u=this,"object"===zr(t)){for(l in t)h=t[l],u.style(l,h);return u}for(null==e&&(e=0),null==n&&(n=0),d=u.paths,c=0,f=d.length;f>c;c++)p=d[c],h=jr(r,p.data),s=jr(e,p.data),a=jr(n,p.data),s>0?(i={},i[t]=h,o=Raphael.animation(i,1e3*s),p.svgPath.animate(o.delay(1e3*a))):p.svgPath.attr(t,h);return u},t.prototype.on=function(t,r){var n,o,i,a,s,l,u;for(i=this,n=function(){function t(t,r,e){this.type=t,this.cb=r,this.layer=e,this.handle=se(this.handle,this)}return t.prototype.handle=function(t){var r;return i=this,r=i.layer.map.pathById[t.target.getAttribute("id")],i.cb(r.data,r.svgPath,t)},t}(),o=new n(t,r,i),u=i.paths,s=0,l=u.length;l>s;s++)a=u[s],e(a.svgPath.node).bind(t,o.handle);return i},t.prototype.tooltips=function(t,r){var n,o,i,a,s,l,u;for(n=this,i=function(t,n){var o;return o={position:{target:"mouse",viewport:e(window),adjust:{x:7,y:7}},show:{delay:null!=r?r:20},events:{show:function(t,r){return e(".qtip").filter(function(){return this!==r.elements.tooltip.get(0)}).hide()}},content:{}},null!=n?"string"==typeof n?o.content.text=n:e.isArray(n)&&(o.content.title=n[0],o.content.text=n[1]):o.content.text="n/a",e(t.svgPath.node).qtip(o)},u=n.paths,s=0,l=u.length;l>s;s++)o=u[s],a=jr(t,o.data),i(o,a);return n},t.prototype.sort=function(t){var r,e,n,o,i,a;for(e=this,e.paths.sort(function(r,e){var n,o,i;return n=t(r.data),o=t(e.data),n===o?0:null!=(i=n>o)?i:{1:-1}}),r=!1,a=e.paths,o=0,i=a.length;i>o;o++)n=a[o],r&&n.svgPath.insertAfter(r.svgPath),r=n;return e},t}(),jr=function(t,r){return"function"===zr(t)?t(r):t},wr=0,O=function(){function t(t,r,e,n){var o,i,a,s,l,u,p,h,c,f,d,y,m,v;for(l=this,u=e.paper,s=e.map,d=s.viewBC,l.path=p=br.geom.Path.fromSVG(t),l.vpath=d.projectPath(p),l.svgPath=l.vpath.toSVG(u),l.svgPath.data("path",l),null==s.styles?Raphael.svg&&l.svgPath.node.setAttribute("class",r):s.applyCSS(l.svgPath,r),c="path_"+wr++,l.svgPath.node.setAttribute("id",c),s.pathById[c]=l,i={},a=m=0,v=t.attributes.length-1;v>=0?v>=m:m>=v;a=v>=0?++m:--m)o=t.attributes[a],"data-"===o.name.substr(0,5)&&(f=o.value,y=Number(f),""===f.trim()||y!==f||isNaN(y)||(f=y),i[o.name.substr(5)]=f);l.data=i,"string"===zr(n)?h=n:"function"===zr(n)&&(h=n(i)),null!=h&&l.svgPath.attr("title",h)}return t.prototype.setView=function(t){var r,e,n;return r=this,e=t.projectPath(r.path),r.vpath=e,"path"===r.path.type?(n=e.svgString(),r.svgPath.attr({path:n})):"circle"===r.path.type?r.svgPath.attr({cx:e.x,cy:e.y,r:e.r}):void 0},t.prototype.remove=function(){var t;return t=this,t.svgPath.remove()},t}(),br.parsecss=function(t,r){var e,n,o,i,a,s,l,u;for(i={},t=Mr(t),u=t.split("`b%"),s=0,l=u.length;l>s;s++)if(e=u[s],e=e.split("%b`"),!(e.length<2))if(e[0]=Ar(e[0]),o=Cr(e[1]),null!=i[e[0]])for(n in o)a=o[n],i[e[0]][n]=a;else i[e[0]]=o;return"function"!==zr(r)?i:(r(i),void 0)},Pr={},Cr=function(t){var r,e,n,o,i,a;for(n=Pr[t].replace(/^{|}$/g,""),n=Mr(n),e={},a=n.split(";"),o=0,i=a.length;i>o;o++)r=a[o],r=r.split(":"),r.length<2||(e[Ar(r[0])]=Ar(r.slice(1).join(":")));return e},J=/{[^{}]*}/,rr=/\[[^\[\]]*\]|{[^{}]*}|\([^()]*\)|function(\s+\w+)?(\s*%b`\d+`b%){2}/,tr=/(?:\/\*(?:[^\*]|\*[^\/])*\*\/)|(\\.|"(?:[^\\\"]|\\.|\\\n)*"|'(?:[^\\\']|\\.|\\\n)*')/g,er=/%\w`(\d+)`\w%/,Lr=0,Mr=function(t,r){var e,n,o;for(t=t.replace(tr,function(t,r){var e;return r?(e="%s`"+ ++Lr+"`s%",Pr[Lr]=r.replace(/^\\/,""),e):""}),e=r?rr:J;n=e.exec(t);)o="%b`"+ ++Lr+"`b%",Pr[Lr]=n[0],t=t.replace(e,o);return t},Ar=function(t){var r;if(null==t)return t;for(;r=er.exec(t);)t=t.replace(er,Pr[r[1]]);return t.trim()},null==(Jr=br.geom)&&(br.geom={}),Q=function(){function t(t,r,e){var n,o,i,a;for(null==e&&(e=!0),o=this,o.type=t,o.contours=[],i=0,a=r.length;a>i;i++)n=r[i],Ir(n)||n.reverse(),o.contours.push(n);o.closed=e}return t.prototype.clipToBBox=function(){throw"path clipping is not implemented yet"},t.prototype.toSVG=function(t){var r;return r=this.svgString(),t.path(r)},t.prototype.svgString=function(){var t,r,e,n,o,i,a,s,l,u,p,h,c;for(n=this,o="",e=n.closed?"Z M":"M",h=n.contours,s=0,u=h.length;u>s;s++)for(t=h[s],r=!0,o+=""===o?"M":e,l=0,p=t.length;p>l;l++)c=t[l],i=c[0],a=c[1],r||(o+="L"),o+=i+","+a,r=!1;return n.closed&&(o+="Z"),o},t.prototype.area=function(){var t,r,e,n,o,i;if(e=this,null!=e.areas)return e._area;for(e.areas=[],e._area=0,i=e.contours,n=0,o=i.length;o>n;n++)r=i[n],t=kr(r),e.areas.push(t),e._area+=t;return e._area},t.prototype.centroid=function(){var t,r,e,n,o,i,a,s,l,u,p,h,c,f,d,y,m,v,g,_,b,x,w,M,P,C,j,A,B,L,S,k,I,N,G,z,E;if(y=this,null!=y._centroid)return y._centroid;for(e=y.area(),i=a=0,p=j=0,I=y.contours.length-1;I>=0?I>=j:j>=I;p=I>=0?++j:--j)if(o=y.contours[p],n=[],f=o.length,r=y.areas[p],c=r/e,0!==c){for(h=A=0,N=f-1;N>=0?N>=A:A>=N;h=N>=0?++A:--A)if(m=o[h],v=o[(h+1)%f],s=0,n.push(m),m[0]===v[0]&&(s=Math.abs(m[1]-v[1])),m[1]===v[1]&&(s=Math.abs(m[0]-v[0])),s>10)for(t=Math.floor(2*s),g=B=1,G=t-1;G>=1?G>=B:B>=G;g=G>=1?++B:--B)_=[m[0]+g/t*(v[0]-m[0]),m[1]+g/t*(v[1]-m[1])],n.push(_);for(w=P=M=C=0,f=n.length,S=[],b=0,h=L=0,z=f-1;z>=0?z>=L:L>=z;h=z>=0?++L:--L)m=n[h],v=n[(h+1)%f],l=v[0]-m[0],u=v[1]-m[1],d=Math.sqrt(l*l+u*u),S.push(d),b+=d;for(h=k=0,E=f-1;E>=0?E>=k:k>=E;h=E>=0?++k:--k)m=n[h],x=S[h]/b,w+=x*m[0],P+=x*m[1];i+=w*c,a+=P*c}return y._centroid=[i,a],y._centroid},t.prototype.isInside=function(t,r){var e,n,o,i,a,s;if(i=this,e=i._bbox,t<e[0]||t>e[2]||r<e[1]||r>e[3])return!1;for(o=a=0,s=i.contours.length-1;s>=0?s>=a:a>=s;o=s>=0?++a:--a)if(n=i.contours[o],Nr(n,[t,r]))return!0;return!1},t}(),br.geom.Path=Q,f=function(t){function r(t,e,n){this.x=t,this.y=e,this.r=n,r.__super__.constructor.call(this,"circle",null,!0)}return ae(r,t),r.prototype.toSVG=function(t){var r;return r=this,t.circle(r.x,r.y,r.r)},r.prototype.centroid=function(){var t;return t=this,[t.x,t.y]},r.prototype.area=function(){var t;return t=this,Math.PI*t.r*m.r},r}(Q),br.geom.Circle=f,Q.fromSVG=function(t){var r,e,n,o,i,a,s,l,u,p,h,c,f,d;if(o=[],c=t.nodeName,p=null,"path"===c){for(l=t.getAttribute("d").trim(),s=Raphael.parsePathString(l),r="Z"===s[s.length-1],h=r?"Z M":"M",n=[],f=0,d=s.length;d>f;f++)e=s[f],0!==e.length&&("M"===e[0]?(n.length>2&&(o.push(n),n=[]),n.push([e[1],e[2]])):"L"===e[0]?n.push([e[1],e[2]]):"Z"===e[0]&&n.length>2&&(o.push(n),n=[]));n.length>=2&&(o.push(n),n=[]),p=new br.geom.Path(c,o,r)}else"circle"===c&&(i=t.getAttribute("cx"),a=t.getAttribute("cy"),u=t.getAttribute("r"),p=new br.geom.Circle(i,a,u));return p},z=function(){function t(t){this.points=t}return t.prototype.clipToBBox=function(r){var e,n,o,i,a,s,l,u,p,h,c,f,d,y,m,v,g,_,b,x;for(c=this,e=(new br.geom.clipping.CohenSutherland).clip,h=[],a=[],i=!1,o=v=0,g=c.points.length-2;g>=0?g>=v:v>=g;o=g>=0?++v:--v){_=c.points[o],s=_[0],l=_[1],b=c.points[o+1],u=b[0],p=b[1];try{x=e(r,s,l,u,p),f=x[0],y=x[1],d=x[2],m=x[3],i=!0,h.push([f,y]),(u!==d||p!==y||o===len(c.points)-2)&&h.push([d,m])}catch(w){n=w,i&&h.length>1&&(a.push(new t(h)),h=[]),i=!1}}return h.length>1&&a.push(new t(h)),a},t.prototype.toSVG=function(){var t,r,e,n,o,i,a,s;for(r=this,t=[],a=r.points,o=0,i=a.length;i>o;o++)s=a[o],e=s[0],n=s[1],t.push(e+","+n);return"M"+t.join("L")},t}(),br.geom.Line=z,Nr=function(t,r){var e,n,o,i,a,s,l,u,p,h,c,f,d,y,m;for(s=Math.PI,n=Math.atan2,p=2*s,a=t.length,e=0,i=y=0,m=a-1;m>=0?m>=y:y>=m;i=m>=0?++y:--y){for(h=t[i][0]-r[0],f=t[i][1]-r[1],c=t[(i+1)%a][0]-r[0],d=t[(i+1)%a][1]-r[1],l=n(f,h),u=n(d,c),o=u-l;o>s;)o-=p;for(;-s>o;)o+=p;e+=o}return Math.abs(e)>=s},Ir=function(t){return kr(t)>0},kr=function(t){var r,e,n,o,i,a,s,l;for(n=0,e=t.length,r=l=0;e>=0?e>l:l>e;r=e>=0?++l:--l)o=t[r][0],a=t[r][1],i=t[(r+1)%e][0],s=t[(r+1)%e][1],n+=o*s-i*a;return n*=.5},Gr=br.proj={},Function.prototype.bind=function(t){var r;return r=this,function(){return r.apply(t,arguments)}},W=function(){function t(t){var r,e,n;r=this,r.lon0=null!=(e=t.lon0)?e:0,r.lat0=null!=(n=t.lat0)?n:0,r.PI=Math.PI,r.HALFPI=.5*r.PI,r.QUARTERPI=.25*r.PI,r.RAD=r.PI/180,r.DEG=180/r.PI,r.lam0=r.rad(this.lon0),r.phi0=r.rad(this.lat0),r.minLat=-90,r.maxLat=90}return t.parameters=[],t.title="Projection",t.prototype.rad=function(t){return t*this.RAD},t.prototype.deg=function(t){return t*this.DEG},t.prototype.plot=function(t,r){var e,n,o,i,a,s,l,u,p,h,c;for(null==r&&(r=!0),i=[],e=!0,u=0,p=t.length;p>u;u++)h=t[u],o=h[0],n=h[1],a=this._visible(o,n),a&&(e=!1),c=this.project(o,n),s=c[0],l=c[1],!a&&r?i.push(this._truncate(s,l)):i.push([s,l]);return e?null:[i]},t.prototype.sea=function(){var t,r,e,n,o,i,a,s,l,u,p,h,c,f;for(i=this,o=i.project.bind(this),n=[],t=i.lon0,i.lon0=0,e=a=-180;180>=a;e=++a)n.push(o(e,i.maxLat));for(r=s=p=i.maxLat,h=i.minLat;h>=p?h>=s:s>=h;r=h>=p?++s:--s)n.push(o(180,r));for(e=l=180;l>=-180;e=--l)n.push(o(e,i.minLat));for(r=u=c=i.minLat,f=i.maxLat;f>=c?f>=u:u>=f;r=f>=c?++u:--u)n.push(o(-180,r));return i.lon0=t,n},t.prototype.world_bbox=function(){var t,r,e,n,o,i;for(r=this.project.bind(this),n=this.sea(),t=new br.BBox,o=0,i=n.length;i>o;o++)e=n[o],t.update(e[0],e[1]);return t},t.prototype.toString=function(){var t;return t=this,"[Proj: "+t.name+"]"},t}(),W.fromXML=function(t){var r,e,n,o,i,a,s;for(n=t.getAttribute("id"),o={},e=a=0,s=t.attributes.length-1;s>=0?s>=a:a>=s;e=s>=0?++a:--a)r=t.attributes[e],"id"!==r.name&&(o[r.name]=r.value);return i=new br.proj[n](o),i.name=n,i},br.Proj=W,v=function(t){function r(t){var e,n,o;null==t&&(t={}),e=this,e.flip=Number(null!=(n=t.flip)?n:0),1===e.flip&&(t.lon0=null!=(o=-t.lon0)?o:0),r.__super__.constructor.call(this,t)}return ae(r,t),r.parameters=["lon0","flip"],r.title="Cylindrical Projection",r.prototype._visible=function(){return!0},r.prototype.clon=function(t){return t-=this.lon0,-180>t?t+=360:t>180&&(t-=360),t},r.prototype.ll=function(t,r){return 1===this.flip?[-t,-r]:[t,r]},r}(W),b=function(t){function r(){return te=r.__super__.constructor.apply(this,arguments)}return ae(r,t),r.title="Equirectangular Projection",r.prototype.project=function(t,r){var e;return e=this.ll(t,r),t=e[0],r=e[1],t=this.clon(t),[1e3*t*Math.cos(this.phi0),1e3*-1*r]},r}(v),Gr.lonlat=b,h=function(t){function r(t){var e;r.__super__.constructor.call(this,t),this.lat1=null!=(e=t.lat1)?e:0,this.phi1=this.rad(this.lat1)}return ae(r,t),r.parameters=["lon0","lat1","flip"],r.title="Cylindrical Equal Area",r.prototype.project=function(t,r){var e,n,o,i,a;return a=this.ll(t,r),t=a[0],r=a[1],e=this.rad(this.clon(t)),n=this.rad(-1*r),o=e*Math.cos(this.phi1),i=Math.sin(n)/Math.cos(this.phi1),[1e3*o,1e3*i]},r}(v),Gr.cea=h,w=function(t){function r(t){t.lat1=45,r.__super__.constructor.call(this,t)}return ae(r,t),r.title="Gall-Peters Projection",r.parameters=["lon0","flip"],r}(h),Gr.gallpeters=w,j=function(t){function r(t){t.lat1=37.7,r.__super__.constructor.call(this,t)}return ae(r,t),r.title="Hobo-Dyer Projection",r.parameters=["lon0","flip"],r}(h),Gr.hobodyer=j,l=function(t){function r(t){t.lat1=30,r.__super__.constructor.call(this,t)}return ae(r,t),r.title="Behrmann Projection",r.parameters=["lon0","flip"],r}(h),Gr.behrmann=l,a=function(t){function r(t){t.lat1=50,r.__super__.constructor.call(this,t)}return ae(r,t),r.title="Balthasart Projection",r.parameters=["lon0","flip"],r}(h),Gr.balthasart=a,H=function(t){function r(t){r.__super__.constructor.call(this,t),this.minLat=-85,this.maxLat=85}return ae(r,t),r.title="Mercator Projection",r.prototype.project=function(t,r){var e,n,o,i,a,s,l;return i=this,l=i.ll(t,r),t=l[0],r=l[1],n=Math,e=i.rad(i.clon(t)),o=i.rad(-1*r),a=1e3*e,s=1e3*n.log((1+n.sin(o))/n.cos(o)),[a,s]},r}(v),Gr.mercator=H,$=function(t){function r(){return re=r.__super__.constructor.apply(this,arguments)}return ae(r,t),r.title="Pseudo-Cylindrical Projection",r}(v),q=function(t){function r(t){var e;r.__super__.constructor.call(this,t),e=this,e.A0=.8707,e.A1=-.131979,e.A2=-.013791,e.A3=.003971,e.A4=-.001529,e.B0=1.007226,e.B1=.015085,e.B2=-.044475,e.B3=.028874,e.B4=-.005916,e.C0=e.B0,e.C1=3*e.B1,e.C2=7*e.B2,e.C3=9*e.B3,e.C4=11*e.B4,e.EPS=1e-11,e.MAX_Y=.8707*.52*Math.PI}return ae(r,t),r.title="Natural Earth Projection",r.prototype.project=function(t,r){var e,n,o,i,a,s,l,u;return a=this,u=a.ll(t,r),t=u[0],r=u[1],e=a.rad(a.clon(t)),n=a.rad(-1*r),o=n*n,i=o*o,s=180*e*(a.A0+o*(a.A1+o*(a.A2+i*o*(a.A3+o*a.A4))))+500,l=180*n*(a.B0+o*(a.B1+i*(a.B2+a.B3*o+a.B4*i)))+270,[s,l]},r}($),Gr.naturalearth=q,nr=function(t){function r(t){var e;r.__super__.constructor.call(this,t),e=this,e.X=[1,-5.67239e-12,-715511e-10,311028e-11,.9986,-482241e-9,-24897e-9,-133094e-11,.9954,-831031e-9,-44861e-9,-9.86588e-7,.99,-.00135363,-596598e-10,367749e-11,.9822,-.00167442,-44975e-10,-572394e-11,.973,-.00214869,-903565e-10,1.88767e-8,.96,-.00305084,-900732e-10,164869e-11,.9427,-.00382792,-653428e-10,-261493e-11,.9216,-.00467747,-104566e-9,48122e-10,.8962,-.00536222,-323834e-10,-543445e-11,.8679,-.00609364,-1139e-7,332521e-11,.835,-.00698325,-640219e-10,9.34582e-7,.7986,-.00755337,-500038e-10,9.35532e-7,.7597,-.00798325,-359716e-10,-227604e-11,.7186,-.00851366,-70112e-9,-863072e-11,.6732,-.00986209,-199572e-9,191978e-10,.6213,-.010418,883948e-10,624031e-11,.5722,-.00906601,181999e-9,624033e-11,.5322,0,0,0],e.Y=[0,.0124,3.72529e-10,1.15484e-9,.062,.0124001,1.76951e-8,-5.92321e-9,.124,.0123998,-7.09668e-8,2.25753e-8,.186,.0124008,2.66917e-7,-8.44523e-8,.248,.0123971,-9.99682e-7,3.15569e-7,.31,.0124108,373349e-11,-11779e-10,.372,.0123598,-13935e-9,439588e-11,.434,.0125501,520034e-10,-100051e-10,.4968,.0123198,-980735e-10,922397e-11,.5571,.0120308,402857e-10,-52901e-10,.6176,.0120369,-390662e-10,7.36117e-7,.6769,.0117015,-280246e-10,-8.54283e-7,.7346,.0113572,-408389e-10,-5.18524e-7,.7903,.0109099,-486169e-10,-10718e-10,.8435,.0103433,-646934e-10,5.36384e-9,.8936,.00969679,-646129e-10,-854894e-11,.9394,.00840949,-192847e-9,-421023e-11,.9761,.00616525,-256001e-9,-421021e-11,1,0,0,0],e.NODES=18,e.FXC=.8487,e.FYC=1.3523,e.C1=11.459155902616464,e.RC1=.08726646259971647,e.ONEEPS=1.000001,e.EPS=1e-8}return ae(r,t),r.title="Robinson Projection",r.prototype._poly=function(t,r,e){return t[r]+e*(t[r+1]+e*(t[r+2]+e*t[r+3]))},r.prototype.project=function(t,r){var e,n,o,i,a,s,l,u;return a=this,u=a.ll(t,r),t=u[0],r=u[1],t=a.clon(t),n=a.rad(t),o=a.rad(-1*r),i=Math.abs(o),e=Math.floor(i*a.C1),e>=a.NODES&&(e=a.NODES-1),i=a.deg(i-a.RC1*e),e*=4,s=1e3*a._poly(a.X,e,i)*a.FXC*n,l=1e3*a._poly(a.Y,e,i)*a.FYC,0>o&&(l=-l),[s,l]},r}($),Gr.robinson=nr,g=function(t){function r(t){var e;r.__super__.constructor.call(this,t),e=this,e.C_x=.4222382003157712,e.C_y=1.3265004281770023,e.RC_y=.7538633073600218,e.C_p=3.5707963267948966,e.RC_p=.2800495767557787,e.EPS=1e-7,e.NITER=6}return ae(r,t),r.title="Eckert IV Projection",r.prototype.project=function(t,r){var e,n,o,i,a,s,l,u,p,h,c;for(s=this,c=s.ll(t,r),t=c[0],r=c[1],i=s.rad(s.clon(t)),a=s.rad(-1*r),l=s.C_p*Math.sin(a),e=a*a,a*=.895168+e*(.0218849+.00826809*e),o=s.NITER;o>0&&(n=Math.cos(a),u=Math.sin(a),e=(a+u*(n+2)-l)/(1+n*(n+2)-u*u),a-=e,!(Math.abs(e)<s.EPS));)o-=1;return 0===o?(p=s.C_x*i,h=0>a?-s.C_y:s.C_y):(p=s.C_x*i*(1+Math.cos(a)),h=s.C_y*Math.sin(a)),[p,h]},r}($),Gr.eckert4=g,ar=function(t){function r(){return ee=r.__super__.constructor.apply(this,arguments)}return ae(r,t),r.title="Sinusoidal Projection",r.prototype.project=function(t,r){var e,n,o,i,a,s;return n=this,s=n.ll(t,r),t=s[0],r=s[1],e=n.rad(n.clon(t)),o=n.rad(-1*r),i=1032*e*Math.cos(o),a=1032*o,[i,a]},r}($),Gr.sinusoidal=ar,X=function(t){function r(t,e,n,o,i){var a,s,l,u;null==e&&(e=1.5707963267948966),null==n&&(n=null),null==o&&(o=null),null==i&&(i=null),r.__super__.constructor.call(this,t),a=this,a.MAX_ITER=10,a.TOLERANCE=1e-7,null!=e?(s=e+e,u=Math.sin(e),l=Math.sqrt(2*Math.PI*u/(s+Math.sin(s))),a.cx=2*l/Math.PI,a.cy=l/u,a.cp=s+Math.sin(s)):null!=n&&null!=o&&"undefined"!=typeof cz&&null!==cz?(a.cx=n,a.cy=o,a.cp=i):Sr("kartograph.proj.Mollweide: either p or cx,cy,cp must be defined")}return ae(r,t),r.title="Mollweide Projection",r.prototype.project=function(t,r){var e,n,o,i,a,s,l,u,p,h,c;for(s=this,c=s.ll(t,r),t=c[0],r=c[1],a=Math,e=a.abs,i=s.rad(s.clon(t)),l=s.rad(r),o=s.cp*a.sin(l),n=s.MAX_ITER;0!==n&&(u=(l+a.sin(l)-o)/(1+a.cos(l)),l-=u,!(e(u)<s.TOLERANCE));)n-=1;return 0===n?l=l>=0?s.HALFPI:-s.HALFPI:l*=.5,p=1e3*s.cx*i*a.cos(l),h=1e3*s.cy*a.sin(l),[p,-1*h]},r}($),Gr.mollweide=X,dr=function(t){function r(t){r.__super__.constructor.call(this,t,1.0471975511965976)}return ae(r,t),r.title="Wagner IV Projection",r}(X),Gr.wagner4=dr,yr=function(t){function r(t){r.__super__.constructor.call(this,t,null,.90977,1.65014,3.00896)}return ae(r,t),r.title="Wagner V Projection",r}(X),Gr.wagner5=yr,F=function(t){function r(){return ne=r.__super__.constructor.apply(this,arguments)}var e,n;return ae(r,t),n=-89,e=89,r.parameters=["lon0","lat0","flip"],r.title="Loximuthal Projection (equidistant)",r.prototype.project=function(t,r){var e,n,o,i,a,s,l;return o=this,l=o.ll(t,r),t=l[0],r=l[1],n=Math,e=o.rad(o.clon(t)),i=o.rad(r),a=i===o.phi0?e*n.cos(o.phi0):e*(i-o.phi0)/(n.log(n.tan(o.QUARTERPI+.5*i))-n.log(n.tan(o.QUARTERPI+.5*o.phi0))),a*=1e3,s=1e3*(i-o.phi0),[a,-1*s]},r}($),Gr.loximuthal=F,c=function(t){function r(){return oe=r.__super__.constructor.apply(this,arguments)}var e,n,o,i,a;return ae(r,t),r.title="Canters Modified Sinusoidal I",r.parameters=["lon0"],e=1.1966,n=-.129,o=3*n,i=-.0076,a=5*i,r.prototype.project=function(t,r){var s,l,u,p,h,c;return s=this,c=s.ll(t,r),t=c[0],r=c[1],t=s.rad(s.clon(t)),r=s.rad(r),p=r*r,h=p*p,l=1e3*t*Math.cos(r)/(e+o*p+a*h),u=1e3*r*(e+n*p+i*h),[l,-1*u]},r}($),Gr.canters1=c,C=function(t){function r(t){r.__super__.constructor.call(this,t)}var e,n,o,i,a,s,l,u,p,h,c,f,d;return ae(r,t),r.title="Hatano Projection",l=20,o=1e-7,u=1.000001,e=2.67595,n=2.43763,p=.3736990601468637,h=.4102345310814193,a=1.75859,s=1.93052,f=.5686373742600607,d=.5179951515653813,i=.85,c=1.1764705882352942,r.prototype.project=function(t,r){var u,p,h,c,f,d,y,m,v,g; +for(c=this,g=c.ll(t,r),t=g[0],r=g[1],h=c.rad(c.clon(t)),f=c.rad(r),u=Math.sin(f)*(0>f?n:e),p=v=l;v>=1&&(d=(f+Math.sin(f)-u)/(1+Math.cos(f)),f-=d,!(Math.abs(d)<o));p=v+=-1);return y=1e3*i*h*Math.cos(f*=.5),m=1e3*Math.sin(f)*(0>f?s:a),[y,-1*m]},r}($),Gr.hatano=C,P=function(t){function r(t){var e;r.__super__.constructor.call(this,t),e=this,e.lat1=41.737,e.p1=new X,e.p0=new ar}return ae(r,t),r.title="Goode Homolosine Projection",r.parameters=["lon0"],r.prototype.project=function(t,r){var e,n;return e=this,n=e.ll(t,r),t=n[0],r=n[1],t=e.clon(t),Math.abs(r)>e.lat1?e.p1.project(t,r):e.p0.project(t,r)},r}($),Gr.goodehomolosine=P,D=function(t){function r(t){r.__super__.constructor.call(this,t),this.r=100*this.HALFPI}var e;return ae(r,t),r.title="Nicolosi Globular Projection",r.parameters=["lon0"],e=1e-10,r.prototype._visible=function(t){var r;return r=this,t=r.clon(t),t>-90&&90>t},r.prototype.project=function(t,r){var n,o,i,a,s,l,u,p,h,c,f,d,y;return s=this,y=s.ll(t,r),t=y[0],r=y[1],i=s.rad(s.clon(t)),u=s.rad(r),Math.abs(i)<e?(f=0,d=u):Math.abs(u)<e?(f=i,d=0):Math.abs(Math.abs(i)-s.HALFPI)<e?(f=i*Math.cos(u),d=s.HALFPI*Math.sin(u)):Math.abs(Math.abs(u)-s.HALFPI)<e?(f=0,d=u):(c=s.HALFPI/i-i/s.HALFPI,n=u/s.HALFPI,h=Math.sin(u),o=(1-n*n)/(h-n),p=c/o,p*=p,a=(c*h/o-.5*c)/(1+p),l=(h/p+.5*o)/(1+1/p),f=Math.cos(u),f=Math.sqrt(a*a+f*f/(1+p)),f=s.HALFPI*(a+(0>i?-f:f)),d=Math.sqrt(l*l-(h*h/p+o*h-1)/(1+1/p)),d=s.HALFPI*(l+(0>u?d:-d))),[100*f,-100*d]},r.prototype.sea=function(){var t,r,e,n,o;for(r=[],n=this.r,t=Math,e=o=0;360>=o;e=++o)r.push([t.cos(this.rad(e))*n,t.sin(this.rad(e))*n]);return r},r.prototype.world_bbox=function(){var t;return t=this.r,new br.BBox(-t,-t,2*t,2*t)},r}($),Gr.nicolosi=D,o=function(t){function r(t,e){var n;null==e&&(e=1e3),r.__super__.constructor.call(this,t),n=this,n.r=e,n.elevation0=n.to_elevation(n.lat0),n.azimuth0=n.to_azimuth(n.lon0)}return ae(r,t),r.parameters=["lon0","lat0"],r.title="Azimuthal Projection",r.prototype.to_elevation=function(t){var r;return r=this,(t+90)/180*r.PI-r.HALFPI},r.prototype.to_azimuth=function(t){var r;return r=this,2*(t+180)/360*r.PI-r.PI},r.prototype._visible=function(t,r){var e,n,o,i,a;return a=this,i=Math,o=a.to_elevation(r),e=a.to_azimuth(t),n=i.sin(o)*i.sin(a.elevation0)+i.cos(a.elevation0)*i.cos(o)*i.cos(e-a.azimuth0),n>=0},r.prototype._truncate=function(t,r){var e,n,o,i,a;return e=Math,n=this.r,o=e.atan2(r-n,t-n),i=n+n*e.cos(o),a=n+n*e.sin(o),[i,a]},r.prototype.sea=function(){var t,r,e,n,o;for(r=[],n=this.r,t=Math,e=o=0;360>=o;e=++o)r.push([n+t.cos(this.rad(e))*n,n+t.sin(this.rad(e))*n]);return r},r.prototype.world_bbox=function(){var t;return t=this.r,new br.BBox(0,0,2*t,2*t)},r}(W),U=function(t){function r(){return Vr=r.__super__.constructor.apply(this,arguments)}return ae(r,t),r.title="Orthographic Projection",r.prototype.project=function(t,r){var e,n,o,i,a,s,l,u;return i=this,o=Math,n=i.to_elevation(r),e=i.to_azimuth(t),s=i.r*o.cos(n)*o.sin(e-i.azimuth0),u=-i.r*(o.cos(i.elevation0)*o.sin(n)-o.sin(i.elevation0)*o.cos(n)*o.cos(e-i.azimuth0)),a=i.r+s,l=i.r+u,[a,l]},r}(o),Gr.ortho=U,k=function(t){function r(t){r.__super__.constructor.call(this,t),this.scale=.5*Math.sqrt(2)}return ae(r,t),r.title="Lambert Azimuthal Equal-Area Projection",r.prototype.project=function(t,r){var e,n,o,i,a,s,l,u,p,h;return a=this.rad(r),o=this.rad(t),i=Math,s=i.sin,e=i.cos,n=i.pow(2/(1+s(this.phi0)*s(a)+e(this.phi0)*e(a)*e(o-this.lam0)),.5),n*=this.scale,u=this.r*n*e(a)*s(o-this.lam0),h=-this.r*n*(e(this.phi0)*s(a)-s(this.phi0)*e(a)*e(o-this.lam0)),l=this.r+u,p=this.r+h,[l,p]},r}(o),Gr.laea=k,ur=function(t){function r(){return Or=r.__super__.constructor.apply(this,arguments)}return ae(r,t),r.title="Stereographic Projection",r.prototype.project=function(t,r){var e,n,o,i,a,s,l,u,p,h,c;return s=this.rad(r),i=this.rad(t),a=Math,l=a.sin,e=a.cos,o=.5,n=2*o/(1+l(this.phi0)*l(s)+e(this.phi0)*e(s)*e(i-this.lam0)),p=this.r*n*e(s)*l(i-this.lam0),c=-this.r*n*(e(this.phi0)*l(s)-l(this.phi0)*e(s)*e(i-this.lam0)),u=this.r+p,h=this.r+c,[u,h]},r}(o),Gr.stereo=ur,or=function(t){function r(t){var e,n,o,i,a,s,l,u,p,h;for(r.__super__.constructor.call(this,{lon0:0,lat0:0}),this.dist=null!=(u=t.dist)?u:3,this.up=this.rad(null!=(p=t.up)?p:0),this.tilt=this.rad(null!=(h=t.tilt)?h:0),this.scale=1,i=Number.MAX_VALUE,o=-1*Number.MAX_VALUE,e=s=0;179>=s;e=++s)for(n=l=0;360>=l;n=++l)a=this.project(n-180,e-90),i=Math.min(a[0],i),o=Math.max(a[0],o);this.scale=2*this.r/(o-i),r.__super__.constructor.call(this,t)}return ae(r,t),r.parameters=["lon0","lat0","tilt","dist","up"],r.title="Satellite Projection",r.prototype.project=function(t,r,e){var n,o,i,a,s,l,u,p,h,c,f,d,y,m,v,g,_,b,x,w,M;return null==e&&(e=0),c=this.rad(r),p=this.rad(t),h=Math,y=h.sin,i=h.cos,f=this.r,d=f*(e+6371)/3671,a=y(this.phi0)*y(c)+i(this.phi0)*i(c)*i(p-this.lam0),u=(this.dist-1)/(this.dist-a),u=(this.dist-1)/(this.dist-a),u*=this.scale,_=d*u*i(c)*y(p-this.lam0),w=-d*u*(i(this.phi0)*y(c)-y(this.phi0)*i(c)*i(p-this.lam0)),l=i(this.up),v=y(this.up),s=i(this.tilt),m=y(this.tilt),o=d*(this.dist-1),n=(w*l+_*v)*y(this.tilt)/o+s,b=(_*l-w*v)*i(this.tilt)/n,M=(w*l+_*v)/n,g=f+b,x=f+M,[g,x]},r.prototype._visible=function(t,r){var e,n,o,i;return o=this.to_elevation(r),e=this.to_azimuth(t),i=Math,n=i.sin(o)*i.sin(this.elevation0)+i.cos(this.elevation0)*i.cos(o)*i.cos(e-this.azimuth0),n>=1/this.dist},r.prototype.sea=function(){var t,r,e,n,o;for(r=[],n=this.r,t=Math,e=o=0;360>=o;e=++o)r.push([n+t.cos(this.rad(e))*n,n+t.sin(this.rad(e))*n]);return r},r}(o),Gr.satellite=or,_=function(t){function r(){return Hr=r.__super__.constructor.apply(this,arguments)}return ae(r,t),r.title="Equidistant Azimuthal Projection",r.prototype.project=function(t,r){var e,n,o,i,a,s,l,u,p,h,c,f,d;return l=this,u=l.rad(r),a=l.rad(t),s=Math,p=s.sin,n=s.cos,o=p(this.phi0)*p(u)+n(this.phi0)*n(u)*n(a-this.lam0),e=s.acos(o),i=.325*e/p(e),c=this.r*i*n(u)*p(a-this.lam0),d=-this.r*i*(n(this.phi0)*p(u)-p(this.phi0)*n(u)*n(a-this.lam0)),h=this.r+c,f=this.r+d,[h,f]},r.prototype._visible=function(){return!0},r}(o),Gr.equi=_,n=function(t){function r(t){var e;e=this,t.lat0=0,r.__super__.constructor.call(this,t),e.lam0=0}var e;return ae(r,t),r.title="Aitoff Projection",r.parameters=["lon0"],e=.6366197723675814,r.prototype.project=function(t,r){var n,o,i,a,s,l,u,p;return a=this,p=a.ll(t,r),t=p[0],r=p[1],t=a.clon(t),i=a.rad(t),s=a.rad(r),n=.5*i,o=Math.acos(Math.cos(s)*Math.cos(n)),0!==o?(u=1/Math.sin(o),l=2*o*Math.cos(s)*Math.sin(n)*u,u*=o*Math.sin(s)):l=u=0,a.winkel&&(l=.5*(l+i*e),u=.5*(u+s)),[1e3*l,-1e3*u]},r.prototype._visible=function(){return!0},r}($),Gr.aitoff=n,mr=function(t){function r(t){r.__super__.constructor.call(this,t),this.winkel=!0}return ae(r,t),r.title="Winkel Tripel Projection",r}(n),Gr.winkel3=mr,y=function(t){function r(t){var e,n,o;e=this,r.__super__.constructor.call(this,t),e.lat1=null!=(n=t.lat1)?n:30,e.phi1=e.rad(e.lat1),e.lat2=null!=(o=t.lat2)?o:50,e.phi2=e.rad(e.lat2)}return ae(r,t),r.title="Conic Projection",r.parameters=["lon0","lat0","lat1","lat2"],r.prototype._visible=function(t,r){var e;return e=this,r>e.minLat&&r<e.maxLat},r.prototype._truncate=function(t,r){return[t,r]},r.prototype.clon=function(t){return t-=this.lon0,-180>t?t+=360:t>180&&(t-=360),t},r}(W),I=function(t){function r(t){var e,n,o,i,a,s,l,u,p,h,c,f,d;p=this,r.__super__.constructor.call(this,t),a=Math,d=[a.sin,a.cos,a.abs,a.log,a.tan,a.pow],h=d[0],o=d[1],e=d[2],xr=d[3],f=d[4],l=d[5],p.n=s=c=h(p.phi1),i=o(p.phi1),u=e(p.phi1-p.phi2)>=1e-10,u&&(s=xr(i/o(p.phi2))/xr(f(p.QUARTERPI+.5*p.phi2)/f(p.QUARTERPI+.5*p.phi1))),p.c=n=i*l(f(p.QUARTERPI+.5*p.phi1),s)/s,p.rho0=e(e(p.phi0)-p.HALFPI)<1e-10?0:n*l(f(p.QUARTERPI+.5*p.phi0),-s),p.minLat=-60,p.maxLat=85}return ae(r,t),r.title="Lambert Conformal Conic Projection",r.prototype.project=function(t,r){var e,n,o,i,a,s,l,u,p,h,c,f,d,y,m;return h=this,l=h.rad(r),o=h.rad(h.clon(t)),a=Math,m=[a.sin,a.cos,a.abs,a.log,a.tan,a.pow],c=m[0],n=m[1],e=m[2],xr=m[3],f=m[4],u=m[5],s=h.n,p=e(e(l)-h.HALFPI)<1e-10?0:h.c*u(f(h.QUARTERPI+.5*l),-s),i=o*s,d=1e3*p*c(i),y=1e3*(h.rho0-p*n(i)),[d,-1*y]},r}(y),Gr.lcc=I,Z=function(t){function r(){return Xr=r.__super__.constructor.apply(this,arguments)}return ae(r,t),r}(y),fr=function(){function t(t,r,e,n,o,i){var a;a=this,a.bbox=t,a.width=r,a.padding=null!=n?n:0,a.halign=null!=o?o:"center",a.valign=null!=i?i:"center",a.height=e,a.scale=Math.min((r-2*n)/t.width,(e-2*n)/t.height)}return t.prototype.project=function(t,r){var e,n,o,i,a,s,l;return null==r&&(r=t[1],t=t[0]),o=this,i=o.scale,e=o.bbox,n=o.height,a=o.width,s="center"===o.halign?.5*(a-e.width*i):"left"===o.halign?o.padding*i:a-(e.width-o.padding)*i,l="center"===o.valign?.5*(n-e.height*i):"top"===o.valign?o.padding*i:0,t=(t-e.left)*i+s,r=(r-e.top)*i+l,[t,r]},t.prototype.projectPath=function(t){var r,e,n,o,i,a,s,l,u,p,h,c,f,d,y,m,v;if(o=this,"path"===t.type){for(n=[],r=[99999,99999,-99999,-99999],d=t.contours,p=0,c=d.length;c>p;p++){for(a=d[p],e=[],h=0,f=a.length;f>h;h++)y=a[h],l=y[0],u=y[1],m=o.project(l,u),l=m[0],u=m[1],e.push([l,u]),r[0]=Math.min(r[0],l),r[1]=Math.min(r[1],u),r[2]=Math.max(r[2],l),r[3]=Math.max(r[3],u);n.push(e)}return i=new br.geom.Path(t.type,n,t.closed),i._bbox=r,i}return"circle"===t.type?(v=o.project(t.x,t.y),l=v[0],u=v[1],s=t.r*o.scale,new br.geom.Circle(l,u,s)):void 0},t.prototype.asBBox=function(){var t;return t=this,new br.BBox(0,0,t.width,t.height)},t}(),fr.fromXML=function(t){var r,e,n,o,a;return a=Number(t.getAttribute("w")),n=Number(t.getAttribute("h")),o=Number(t.getAttribute("padding")),e=t.getElementsByTagName("bbox")[0],r=i.fromXML(e),new br.View(r,a,n,o)},br.View=fr,S.prototype.dotgrid=function(t){var r,e,n,o,i,a,s,l,u,p,h,c,f,d,y,m,v,g,_,b,x,w,M,P,C,j,A,B,L,S,k,I,N,G,z,E,T,R,F,V,O,H,X,q,D,U,Q,Y,W;if(v=this,m=null!=(T=t.layer)?T:v.layerIds[v.layerIds.length-1],!v.layers.hasOwnProperty(m))return Sr('dotgrid error: layer "'+m+'" not found'),void 0;if(y=v.layers[m],e=t.data,n=t.value,o=t.key,_={},null!=o&&"array"===zr(e))for(A=0,k=e.length;k>A;A++)w=e[A],d=w[o],_[String(d)]=w;else for(d in e)w=e[d],_[String(d)]=w;if(l=null!=(R=t.style)?R:{fill:"black",stroke:"none"},P=t.size,f=null!=(F=t.gridsize)?F:15,s=null!=(V=y.dotgrid)?V:y.dotgrid={gridsize:f,grid:[]},s.gridsize!==f)for(O=s.grid,B=0,I=O.length;I>B;B++)c=O[B],null!=c.shape&&(c.shape.remove(),c.shape=null);if(f>0){if(0===s.grid.length)for(C=L=0,H=v.viewport.width;f>0?H>=L:L>=H;C=L+=f)for(j=S=0,X=v.viewport.height;f>0?X>=S:S>=X;j=S+=f){c={x:C+.2*(Math.random()-.5)*f,y:j+.2*(Math.random()-.5)*f,pathid:!1},h=!1,q=y.pathsById;for(d in q){for(b=q[d],z=0,N=b.length;N>z;z++)if(g=b[z],g.vpath.isInside(c.x,c.y)){h=!0,x=null!=(D=_[d])?D:null,M=P(x),c.pathid=d,c.shape=y.paper.circle(c.x,c.y,1);break}if(h)break}s.grid.push(c)}for(U=s.grid,E=0,G=U.length;G>E;E++)c=U[E],c.pathid&&(x=null!=(Q=_[c.pathid])?Q:null,M=P(x),p=null!=(Y=t.duration)?Y:0,i=null!=(W=t.delay)?W:0,a="function"===zr(i)?i(x):i,p>0&&Raphael.svg?(r=Raphael.animation({r:.5*M},p),c.shape.animate(r.delay(a))):c.shape.attr({r:.5*M}),u="function"===zr(l)?l(x):l,c.shape.attr(u))}},gr=null!=(qr=br.filter)?qr:br.filter={},gr.__knownFilter={},gr.__patternFills=0,V.prototype.SVG=function(t,r){var e,n;if("string"==typeof t&&(t=window.document.createElementNS("http://www.w3.org/2000/svg",t)),r)for(e in r)n=r[e],t.setAttribute(e,n);return t},S.prototype.addFilter=function(t,r,e){var n,o,i;if(null==e&&(e={}),i=this,n=window.document,null==br.filter[r])throw"unknown filter type "+r;return o=new br.filter[r](e).getFilter(t),i.paper.defs.appendChild(o)},V.prototype.applyFilter=function(t){var r;return r=this,e("."+r.id,r.paper.canvas).attr({filter:"url(#"+t+")"})},V.prototype.applyTexture=function(t,r,e){var n,o,i,a,s,l;for(null==r&&(r=!1),null==e&&(e="#000"),o=this,gr.__patternFills+=1,s=o.paths,l=[],i=0,a=s.length;a>i;i++)n=s[i],!r||r(n.data)?l.push(n.svgPath.attr({fill:"url("+t+")"})):l.push(n.svgPath.attr("fill",e));return l},x=function(){function t(t){this.params=null!=t?t:{}}return t.prototype.getFilter=function(t){var r,e;return e=this,r=e.SVG("filter",{id:t}),e.buildFilter(r),r},t.prototype._getFilter=function(){throw"not implemented"},t.prototype.SVG=function(t,r){var e,n;if("string"==typeof t&&(t=window.document.createElementNS("http://www.w3.org/2000/svg",t)),r)for(e in r)n=r[e],t.setAttribute(e,n);return t},t}(),u=function(t){function r(){return Dr=r.__super__.constructor.apply(this,arguments)}return ae(r,t),r.prototype.buildFilter=function(t){var r,e,n;return n=this,r=n.SVG,e=r("feGaussianBlur",{stdDeviation:n.params.size||4,result:"blur"}),t.appendChild(e)},r}(x),gr.blur=u,_r=function(t){var r,e,n,o;if(t.trim().match(/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/))return(4===t.length||7===t.length)&&(t=t.substr(1)),3===t.length&&(t=t.split(""),t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),o=parseInt(t,16),n=o>>16,e=255&o>>8,r=255&o,[n,e,r];throw'unknown color format: "'+t+'"'},M=function(t){function r(){return Ur=r.__super__.constructor.apply(this,arguments)}return ae(r,t),r.prototype.buildFilter=function(t){var r,e,n,o,i,a,s,l,u,p,h,c,f;i=this,e=null!=(l=i.params.blur)?l:4,s=null!=(u=i.params.strength)?u:1,a=null!=(p=i.params.color)?p:"#D1BEB0","string"===zr(a)&&(a=_r(a)),n=null!=(h=i.params.inner)?h:!1,o=null!=(c=i.params.knockout)?c:!1,r=null!=(f=i.params.alpha)?f:1,n?i.innerGlow(t,e,s,a,r,o):i.outerGlow(t,e,s,a,r,o)},r.prototype.outerGlow=function(t,r,e,n,o,i){var a,s,l,u,p,h,c;return p=this,a=p.SVG,u=a("feColorMatrix",{"in":"SourceGraphic",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0",result:"mask"}),t.appendChild(u),e>0&&(c=a("feMorphology",{"in":"mask",radius:e,operator:"dilate",result:"mask"}),t.appendChild(c)),u=a("feColorMatrix",{"in":"mask",type:"matrix",values:"0 0 0 0 "+n[0]/255+" 0 0 0 0 "+n[1]/255+" 0 0 0 0 "+n[2]/255+" 0 0 0 1 0",result:"r0"}),t.appendChild(u),s=a("feGaussianBlur",{"in":"r0",stdDeviation:r,result:"r1"}),t.appendChild(s),l=a("feComposite",{operator:"out","in":"r1",in2:"mask",result:"comp"}),t.appendChild(l),h=a("feMerge"),i||h.appendChild(a("feMergeNode",{"in":"SourceGraphic"})),h.appendChild(a("feMergeNode",{"in":"r1"})),t.appendChild(h)},r.prototype.innerGlow=function(t,r,e,n,o,i){var a,s,l,u,p,h,c;return p=this,a=p.SVG,xr("innerglow"),u=a("feColorMatrix",{"in":"SourceGraphic",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 500 0",result:"mask"}),t.appendChild(u),c=a("feMorphology",{"in":"mask",radius:e,operator:"erode",result:"r1"}),t.appendChild(c),s=a("feGaussianBlur",{"in":"r1",stdDeviation:r,result:"r2"}),t.appendChild(s),u=a("feColorMatrix",{type:"matrix","in":"r2",values:"1 0 0 0 "+n[0]/255+" 0 1 0 0 "+n[1]/255+" 0 0 1 0 "+n[2]/255+" 0 0 0 -1 1",result:"r3"}),t.appendChild(u),l=a("feComposite",{operator:"in","in":"r3",in2:"mask",result:"comp"}),t.appendChild(l),h=a("feMerge"),i||h.appendChild(a("feMergeNode",{"in":"SourceGraphic"})),h.appendChild(a("feMergeNode",{"in":"comp"})),t.appendChild(h)},r}(x),gr.glow=M,S.prototype.addGeoPath=function(t,r,e){var n,o,i;return null==r&&(r=[]),null==e&&(e=""),n=this,i=n.getGeoPathStr(t,r),o=n.paper.path(i),""!==e&&o.node.setAttribute("class",e),o},S.prototype.getGeoPathStr=function(t,r){var e,n,o,i,a,s,l;null==r&&(r=[]),o=this,"string"===zr(r)&&(r=r.split("")),0===r.length&&r.push("M"),i="";for(n in t)a=t[n],e=null!=(l=r[n])?l:"L",s=o.lonlat2xy(a),isNaN(s[0])||isNaN(s[1])||(i+=e+s[0]+","+s[1]);return i},S.prototype.addGeoPolygon=function(t,r){var e,n,o;o=this,e=["M"];for(n in t)e.push("L");return e.push("Z"),o.addGeoPath(t,e,r)},ir=function(){function t(t,r,e){var n,o,i,a;null==t&&(t=[0,1]),null==r&&(r=null),null==e&&(e=null),this.rangedScale=se(this.rangedScale,this),this.scale=se(this.scale,this),o=this,a=[];for(n in t)("function"!==zr(e)||e(t[n])!==!1)&&(i=null!=r?"function"===zr(r)?r(t[n]):t[n][r]:t[n],isNaN(i)||a.push(i));a=a.sort(function(t,r){return t-r}),o.values=a,o._range=[0,1],o.rangedScale.range=function(t){return o._range=t,o.rangedScale}}return t.prototype.scale=function(t){return t},t.prototype.rangedScale=function(t){var r,e;return r=this,t=r.scale(t),e=r._range,t*(e[1]-e[0])+e[0]},t}(),E=function(t){function r(){return this.scale=se(this.scale,this),Qr=r.__super__.constructor.apply(this,arguments)}return ae(r,t),r.prototype.scale=function(t){var r,e;return r=this,e=r.values,(t-e[0])/(e[e.length-1]-e[0])},r}(ir),T=function(t){function r(){return this.scale=se(this.scale,this),Yr=r.__super__.constructor.apply(this,arguments)}return ae(r,t),r.prototype.scale=function(t){var r,e;return r=this,e=r.values,xr=Math.log,(xr(t)-xr(e[0]))/(xr(e[e.length-1])-xr(e[0]))},r}(ir),sr=function(t){function r(){return this.scale=se(this.scale,this),Wr=r.__super__.constructor.apply(this,arguments)}return ae(r,t),r.prototype.scale=function(t){var r,e;return r=this,e=r.values,Math.sqrt((t-e[0])/(e[e.length-1]-e[0]))},r}(ir),K=function(t){function r(){return this.scale=se(this.scale,this),$r=r.__super__.constructor.apply(this,arguments)}return ae(r,t),r.prototype.scale=function(t){var r,e,n,o,i,a;n=this,a=n.values,e=a.length-1;for(r in a){if(i=a[Number(r)],o=a[Number(r)+1],t===i)return r/e;if(e>r&&t>i&&o>t)return r/e+(t-i)/(o-i)}},r}(ir),br.scale={},br.scale.identity=function(){return new ir(domain,prop,gr).rangedScale},br.scale.linear=function(t,r,e){return new E(t,r,e).rangedScale},br.scale.log=function(t,r,e){return new T(t,r,e).rangedScale},br.scale.sqrt=function(t,r,e){return new sr(t,r,e).rangedScale},br.scale.quantile=function(t,r,e){return new K(t,r,e).rangedScale},hr=function(){function t(t){r=this,r.location=t.location,r.data=t.data,r.map=t.map,r.layers=t.layers,r.key=t.key,r.x=t.x,r.y=t.y}var r;return r=null,t.prototype.init=function(){return r},t.prototype.overlaps=function(){return!1},t.prototype.update=function(){return r},t.prototype.nodes=function(){return[]},t.prototype.clear=function(){return r},t}(),br.Symbol=hr,cr=function(){function r(t){this._initTooltips=se(this._initTooltips,this),this._noverlap=se(this._noverlap,this),this._kMeans=se(this._kMeans,this);var e,o,i,a,s,l,u,p,h,c,f,d,y,m,v,g,_,b,x,w;for(n=this,c=["data","location","type","map"],p=["filter","tooltip","click","delay","sortBy","clustering","aggregate","clusteringOpts","mouseenter","mouseleave"],f=0,v=c.length;v>f;f++){if(h=c[f],null==t[h])throw"SymbolGroup: missing argument '"+h+"'";n[h]=t[h]}for(d=0,g=p.length;g>d;d++)h=p[d],null!=t[h]&&(n[h]=t[h]);if(e=n.type,null==e)return Sr("could not resolve symbol type",n.type),void 0;for(x=e.props,y=0,_=x.length;_>y;y++)h=x[y],null!=t[h]&&(n[h]=t[h]);for(n.layers={mapcanvas:n.map.paper},w=e.layers,m=0,b=w.length;b>m;m++)s=w[m],u=r._layerid++,a="sl_"+u,"svg"===s.type?l=n.map.createSVGLayer(a):"html"===s.type&&(l=n.map.createHTMLLayer(a)),n.layers[s.id]=l;n.symbols=[];for(i in n.data)o=n.data[i],"function"===zr(n.filter)?n.filter(o,i)&&n.add(o,i):n.add(o,i);n.layout(),n.render(),n.map.addSymbolGroup(n)}var n;return n=null,r.prototype.add=function(t,r){var e,o,i,a,s,l,u,p;for(n=this,e=n.type,o=n._evaluate(n.location,t,r),"array"===zr(o)&&(o=new br.LonLat(o[0],o[1])),a={layers:n.layers,location:o,data:t,key:null!=r?r:n.symbols.length,map:n.map},p=e.props,l=0,u=p.length;u>l;l++)i=p[l],null!=n[i]&&(a[i]=n._evaluate(n[i],t,r));return s=new e(a),n.symbols.push(s),s},r.prototype.layout=function(){var t,r,e,o,i,a,s,l,u,p;for(u=n.symbols,s=0,l=u.length;l>s;s++){if(i=u[s],r=i.location,"string"===zr(r)){if(p=r.split("."),t=p[0],o=p[1],e=n.map.getLayerPath(t,o),null==e){Sr("could not find layer path "+t+"."+o);continue}a=n.map.viewBC.project(e.path.centroid())}else a=n.map.lonlat2xy(r);i.x=a[0],i.y=a[1]}return"k-means"===n.clustering?n._kMeans():"noverlap"===n.clustering&&n._noverlap(),n},r.prototype.render=function(){var t,r,o,i,a,s,l,u,p,h,c;for(n=this,n.sortBy&&(i="asc","string"===zr(n.sortBy)&&(n.sortBy=n.sortBy.split(" ",2),o=n.sortBy[0],i=null!=(p=n.sortBy[1])?p:"asc"),n.symbols=n.symbols.sort(function(t,r){var e,a,s;return"function"===zr(n.sortBy)?(a=n.sortBy(t.data,t),s=n.sortBy(r.data,r)):(a=t[o],s=r[o]),a===s?0:(e="asc"===i?1:-1,a>s?1*e:-1*e)})),h=n.symbols,a=0,l=h.length;l>a;a++)for(r=h[a],r.render(),c=r.nodes(),s=0,u=c.length;u>s;s++)t=c[s],t.symbol=r;return"function"===zr(n.tooltip)&&n._initTooltips(),e.each(["click","mouseenter","mouseleave"],function(o,i){var a,s,l,u;if("function"===zr(n[i])){for(l=n.symbols,u=[],a=0,s=l.length;s>a;a++)r=l[a],u.push(function(){var o,a,s,l;for(s=r.nodes(),l=[],o=0,a=s.length;a>o;o++)t=s[o],l.push(e(t)[i](function(t){var r;for(r=t.target;!r.symbol;)r=e(r).parent().get(0);return t.stopPropagation(),n[i](r.symbol.data,r.symbol,t)}));return l}.call(this));return u}}),n},r.prototype.tooltips=function(t){return n=this,n.tooltips=t,n._initTooltips(),n},r.prototype.remove=function(t){var r,e,o,i,a,s,l,u,p,h;for(n=this,o=[],u=n.symbols,s=0,l=u.length;l>s;s++)if(a=u[s],null==t||t(a.data))try{a.clear()}catch(c){r=c,Sr("error: symbolgroup.remove")}else o.push(a);if(null==t){p=n.layers,h=[];for(e in p)i=p[e],"mapcanvas"!==e?h.push(i.remove()):h.push(void 0);return h}return n.symbols=o},r.prototype._evaluate=function(t,r,e){var n;return n="function"===zr(t)?t(r,e):t},r.prototype._kMeans=function(){var r,e,o,i,a,s,l,u,p,h,c,f,d,y,m,v,g,_,b,x,w,M,P;for(n=this,null==(x=n.osymbols)&&(n.osymbols=n.symbols),r=n.type,null!=n.clusteringOpts&&(h=n.clusteringOpts.size),null==h&&(h=64),e=t().iterations(16).size(h),w=n.osymbols,f=0,v=w.length;v>f;f++)p=w[f],e.add({x:p.x,y:p.y});for(s=e.means(),l=[],d=0,g=s.length;g>d;d++)if(a=s[d],0!==a.size){for(o=[],M=a.indices,y=0,_=M.length;_>y;y++)i=M[y],o.push(n.osymbols[i].data);for(o=n.aggregate(o),c={layers:n.layers,location:!1,data:o,map:n.map},P=r.props,m=0,b=P.length;b>m;m++)u=P[m],null!=n[u]&&(c[u]=n._evaluate(n[u],o));p=new r(c),p.x=a.x,p.y=a.y,l.push(p)}return n.symbols=l},r.prototype._noverlap=function(){var t,r,e,o,i,a,s,l,u,p,h,c,f,d,y,m,v,g,_,b,x,w,M,P,C,j,A,B,L,S,k,I,N,G,z,E,T,R,F,V,O,H,X,q,D,U,Q;if(n=this,null==(H=n.osymbols)&&(n.osymbols=n.symbols),u=3,t=n.type,le.call(t.props,"radius")<0)return Sr('noverlap layout only available for symbols with property "radius"'),void 0;for(j=n.osymbols.slice(),null!=n.clusteringOpts&&(L=n.clusteringOpts.tolerance,f=n.clusteringOpts.maxRatio),null==L&&(L=.05),null==f&&(f=.8),s=N=0,X=u-1;X>=0?X>=N:N>=X;s=X>=0?++N:--N){for(j.sort(function(t,r){return r.radius-t.radius}),p=j.length,d=[],y=G=0,q=p-3;q>=0?q>=G:G>=q;y=q>=0?++G:--G)if(M=j[y]){for(b=M.radius*(1-L),h=M.x-b,g=M.x+b,A=M.y-b,r=M.y+b,l=[],m=z=D=y+1,U=p-2;U>=D?U>=z:z>=U;m=U>=D?++z:--z)P=j[m],P&&(x=P.radius,c=P.x-x,_=P.x+x,B=P.y-x,e=P.y+x,x/M.radius<f&&(c>g||h>_||B>r||A>e||(i=P.x-M.x,a=P.y-M.y,(b+x)*(b+x)>i*i+a*a&&l.push(m))));if(l.length>0){for(o=[M.data],v=M.radius*M.radius,E=0,T=l.length;T>E;E++)s=l[E],o.push(j[s].data),v+=j[s].radius*j[s].radius;for(o=n.aggregate(o),C={layers:n.layers,location:!1,data:o,map:n.map},Q=t.props,V=0,R=Q.length;R>V;V++)y=Q[V],null!=n[y]&&(C[y]=n._evaluate(n[y],o));for(w=new t(C),S=M.radius*M.radius/v,k=M.x*S,I=M.y*S,O=0,F=l.length;F>O;O++)s=l[O],P=j[s],S=P.radius*P.radius/v,k+=P.x*S,I+=P.y*S,j[s]=void 0;w.x=k,w.y=I,j[y]=void 0,d.push(w)}else d.push(M)}j=d}return n.symbols=j},r.prototype._initTooltips=function(){var t,r,o,i,a,s,l,u,p,h,c;for(n=this,i=n.tooltip,h=n.symbols,s=0,u=h.length;u>s;s++)for(o=h[s],t={position:{target:"mouse",viewport:e(window),adjust:{x:7,y:7}},show:{delay:20},content:{},events:{show:function(t,r){return e(".qtip").filter(function(){return this!==r.elements.tooltip.get(0)}).hide()}}},a=i(o.data,o.key),"string"===zr(a)?t.content.text=a:"array"===zr(a)&&(t.content.title=a[0],t.content.text=a[1]),c=o.nodes(),l=0,p=c.length;p>l;l++)r=c[l],e(r).qtip(t)},r.prototype.onResize=function(){var t,r,e,o;for(n=this,n.layout(),o=n.symbols,r=0,e=o.length;e>r;r++)t=o[r],t.update()},r.prototype.update=function(t,r,e){var o,i,a,s,l,u,p,h;for(n=this,null==t&&(t={}),p=n.symbols,a=0,l=p.length;l>a;a++){for(i=p[a],h=n.type.props,s=0,u=h.length;u>s;s++)o=h[s],null!=t[o]?i[o]=n._evaluate(t[o],i.data):null!=n[o]&&(i[o]=n._evaluate(n[o],i.data));i.update(r,e)}return n},r}(),cr._layerid=0,br.SymbolGroup=cr,S.prototype.addSymbols=function(t){return t.map=this,new cr(t)},br.dorlingLayout=function(t,r){var n,o,i,a,s,l,u,p,h,c,f,d,y,m,v;for(null==r&&(r=40),f=[],e.each(t.symbols,function(t,r){return f.push({i:t,x:r.path.attrs.cx,y:r.path.attrs.cy,r:r.path.attrs.r})}),f.sort(function(t,r){return r.r-t.r}),i=function(){var r,e,n;for(e=0,n=f.length;n>e;e++)r=f[e],t.symbols[r.i].path.attr({cx:r.x,cy:r.y})},d=v=1;r>=1?r>=v:v>=r;d=r>=1?++v:--v)for(h in f)for(c in f)if(c>h){if(n=f[h],o=f[c],n.x+n.r<o.x-o.r||n.x-n.r>o.x+o.r)continue;if(n.y+n.r<o.y-o.r||n.y-n.r>o.y+o.r)continue;l=n.x-o.x,u=n.y-o.y,s=l*l+u*u,y=n.r+o.r,m=y*y,m>s&&(a=Math.sqrt(s),p=10/a,n.x+=l*p*(1-n.r/y),n.y+=u*p*(1-n.r/y),o.x-=l*p*(1-o.r/y),o.y-=u*p*(1-o.r/y))}return i()},p=function(t){function r(t){this.nodes=se(this.nodes,this),this.clear=se(this.clear,this),this.update=se(this.update,this),this.render=se(this.render,this),this.overlaps=se(this.overlaps,this);var e,n,o;e=this,r.__super__.constructor.call(this,t),e.radius=null!=(n=t.radius)?n:4,e.style=t.style,e.attrs=t.attrs,e.title=t.title,e["class"]=null!=(o=t["class"])?o:"bubble"}return ae(r,t),r.prototype.overlaps=function(t){var r,e,n,o,i,a,s,l,u,p,h;return n=this,p=[n.x,n.y,n.radius],a=p[0],l=p[1],o=p[2],h=[t.x,t.y,t.radius],s=h[0],u=h[1],i=h[2],a-o>s+i||s-i>a+o||l-o>u+i||u-i>l+o?!1:(r=a-s,e=l-u,r*r+e*e>(o+i)*(o+i)?!1:!0)},r.prototype.render=function(){var t;return t=this,null==t.path&&(t.path=t.layers.mapcanvas.circle(t.x,t.y,t.radius)),t.update(),t.map.applyCSS(t.path),t},r.prototype.update=function(t,r){var n,o,i;return null==t&&(t=!1),null==r&&(r="expo-out"),o=this,i=o.path,n={cx:o.x,cy:o.y,r:o.radius},null!=o.attrs&&(n=e.extend(n,o.attrs)),t?i.animate(n,t,r):i.attr(n),null!=i.node&&(null!=o.style&&i.node.setAttribute("style",o.style),null!=o["class"]&&i.node.setAttribute("class",o["class"])),null!=o.title&&i.attr("title",o.title),o},r.prototype.clear=function(){var t;return t=this,t.path.remove(),t},r.prototype.nodes=function(){var t;return t=this,[t.path.node]},r}(hr),p.props=["radius","style","class","title","attrs"],p.layers=[],br.Bubble=p,B=function(t){function r(t){var e,n,o,i,a,s;e=this,r.__super__.constructor.call(this,t),e.icon=null!=(n=t.icon)?n:"",e.offset=null!=(o=t.offset)?o:[0,0],e.iconsize=null!=(i=t.iconsize)?i:[10,10],e["class"]=null!=(a=t["class"])?a:"",e.title=null!=(s=t.title)?s:""}return ae(r,t),r.prototype.render=function(){var t,r;return r=this,t=r.map.container,r.img=e("<img />"),r.img.attr({src:r.icon,title:r.title,alt:r.title,width:r.iconsize[0],height:r.iconsize[1]}),r.img.addClass(r["class"]),r.img.css({position:"absolute","z-index":1e3,cursor:"pointer"}),r.img[0].symbol=r,t.append(r.img),r.update()},r.prototype.update=function(){var t;return t=this,t.img.css({left:t.x+t.offset[0]+"px",top:t.y+t.offset[1]+"px"})},r.prototype.clear=function(){var t;return t=this,t.img.remove(),t},r.prototype.nodes=function(){var t;return t=this,[t.img]},r}(br.Symbol),B.props=["icon","offset","class","title","iconsize"],B.layers=[],br.Icon=B,pr=function(t){function r(t){var e,n,o,i,a;e=this,r.__super__.constructor.call(this,t),e.text=null!=(n=t.text)?n:"",e.style=null!=(o=t.style)?o:"",e["class"]=null!=(i=t["class"])?i:"",e.offset=null!=(a=t.offset)?a:[0,0]}return ae(r,t),r.prototype.render=function(){var t,r;return r=this,r.lbl=t=r.layers.mapcanvas.text(r.x,r.y,r.text),r.update(),r},r.prototype.update=function(){var t;return t=this,t.lbl.attr({x:t.x+t.offset[0],y:t.y+t.offset[1]}),t.lbl.node.setAttribute("style",t.style),t.lbl.node.setAttribute("class",t["class"])},r.prototype.clear=function(){var t;return t=this,t.lbl.remove(),t},r.prototype.nodes=function(){var t;return t=this,[t.lbl.node]},r}(br.Symbol),pr.props=["text","style","class","offset"],pr.layers=[],br.Label=pr,A=function(t){function r(t){var e,n,o,i;e=this,r.__super__.constructor.call(this,t),e.text=null!=(n=t.text)?n:"",e.css=null!=(o=t.css)?o:"",e["class"]=null!=(i=t["class"])?i:""}return ae(r,t),r.prototype.render=function(){var t,r,n;return n=this,t=e("<div>"+n.text+"</div>"),t.css({width:"80px",position:"absolute",left:"-40px","text-align":"center"}),n.lbl=r=e('<div class="label" />'),r.append(t),n.layers.lbl.append(r),t.css({height:t.height()+"px",top:t.height()*-.4+"px"}),n.update(),n},r.prototype.update=function(){var t;return t=this,t.lbl.css({position:"absolute",left:t.x+"px",top:t.y+"px"}),t.lbl.css(t.css)},r.prototype.clear=function(){var t;return t=this,t.lbl.remove(),t},r.prototype.nodes=function(){var t;return t=this,[t.lbl[0]]},r}(br.Symbol),A.props=["text","css","class"],A.layers=[{id:"lbl",type:"html"}],br.HtmlLabel=A,N=function(t){function r(t){this.nodes=se(this.nodes,this),this.clear=se(this.clear,this),this.update=se(this.update,this),this.render=se(this.render,this);var e,n,o;e=this,r.__super__.constructor.call(this,t),e.labelattrs=null!=(n=t.labelattrs)?n:{},e.buffer=t.buffer,e.center=null!=(o=t.center)?o:!0}return ae(r,t),r.prototype.render=function(t){var e;return e=this,null!=e.title&&""!==String(e.title).trim()&&(e.buffer&&(e.bufferlabel=e.layers.mapcanvas.text(e.x,e.y,e.title)),e.label=e.layers.mapcanvas.text(e.x,e.y,e.title)),r.__super__.render.call(this,t),e},r.prototype.update=function(t,n){var o,i,a,s,l;return null==t&&(t=!1),null==n&&(n="expo-out"),i=this,r.__super__.update.call(this,t,n),null!=i.label&&(a=i.map.viewport,o=e.extend({},i.labelattrs),s=i.x,l=i.y,i.center?l-=0:s>.5*a.width?(o["text-anchor"]="end",s-=i.radius+5):s<.5*a.width&&(o["text-anchor"]="start",s+=i.radius+5),o.x=s,o.y=l,i.buffer&&(i.bufferlabel.attr(o),i.bufferlabel.attr({stroke:"#fff",fill:"#fff","stroke-linejoin":"round","stroke-linecap":"round","stroke-width":6})),i.label.attr(o),i.label.toFront()),i},r.prototype.clear=function(){var t;return t=this,r.__super__.clear.apply(this,arguments)},r.prototype.nodes=function(){var t,e;return t=this,e=r.__super__.nodes.apply(this,arguments),t.label&&e.push(t.label.node),t.bufferlabel&&e.push(t.bufferlabel.node),e},r}(p),N.props=["radius","style","class","title","labelattrs","buffer","center","attrs"],N.layers=[],br.LabeledBubble=N,Y=function(t){function r(t){var n,o,i,a,s,l,u,p,h,c;e=this,r.__super__.constructor.call(this,t),e.radius=null!=(o=t.radius)?o:4,e.styles=null!=(i=t.styles)?i:"",e.colors=null!=(a=t.colors)?a:["#3cc","#c3c","#33c","#cc3"],e.titles=null!=(s=t.titles)?s:["","","","",""],e.values=null!=(l=t.values)?l:[],e.border=null!=(u=t.border)?u:!1,e.borderWidth=null!=(p=t.borderWidth)?p:2,e["class"]=null!=(h=t["class"])?h:"piechart",null==(c=(n=Raphael.fn).pieChart)&&(n.pieChart=vr)}var e;return ae(r,t),e=null,r.prototype.overlaps=function(t){var r,n,o,i,a,s,l,u,p,h;return p=[e.x,e.y,e.radius],a=p[0],l=p[1],o=p[2],h=[t.x,t.y,t.radius],s=h[0],u=h[1],i=h[2],a-o>s+i||s-i>a+o||l-o>u+i||u-i>l+o?!1:(r=a-s,n=l-u,r*r+n*n>(o+i)*(o+i)?!1:!0)},r.prototype.render=function(){var t;return e=this,null!=e.border&&(t=e.layers.mapcanvas.circle(e.x,e.y,e.radius+e.borderWidth).attr({stroke:"none",fill:e.border})),e.chart=e.layers.mapcanvas.pieChart(e.x,e.y,e.radius,e.values,e.titles,e.colors,"none"),e.chart.push(t),e},r.prototype.update=function(){},r.prototype.clear=function(){var t,r,n,o;for(e=this,o=e.chart,r=0,n=o.length;n>r;r++)t=o[r],t.remove();return e},r.prototype.nodes=function(){var t,r,n,o,i;for(o=e.chart,i=[],r=0,n=o.length;n>r;r++)t=o[r],i.push(t.node);return i},r}(hr),Y.props=["radius","values","styles","class","titles","colors","border","borderWidth"],Y.layers=[],br.PieChart=Y,vr=function(t,r,e,n,o,i,a){var s,l,u,p,h,c,f,d,y,m,v;if(isNaN(t)||isNaN(r)||isNaN(e))return[];for(p=this,c=Math.PI/180,l=p.set(),f=function(t,r,e,n,o,i){var a,s,l,u;return a=t+e*Math.cos(-n*c),s=t+e*Math.cos(-o*c),l=r+e*Math.sin(-n*c),u=r+e*Math.sin(-o*c),p.path(["M",t,r,"L",a,l,"A",e,e,0,+(o-n>180),0,s,u,"z"]).attr(i)},s=-270,d=0,h=function(o){var u,p,h,c,y,m,v;v=n[o],u=360*v/d,m=s+.5*u,p=i[o],c=500,h=30,y=f(t,r,e,s,s+u,{fill:p,stroke:a,"stroke-width":1}),y.mouseover(function(){y.stop().animate({transform:"s1.1 1.1 "+t+" "+r},c,"elastic") +}),y.mouseout(function(){y.stop().animate({transform:""},c,"elastic")}),s+=u,l.push(y)},m=0,v=n.length;v>m;m++)y=n[m],d+=y;for(u in n)h(u);return l},drawStackedBars=function(t,r,e,n,o,i,a,s){function l(t,r,e,n,o){return u.rect(t,r,e,n).attr(o)}for(var u=this,p=this.set(),h=0,c=0,f=function(i){var u=o[i],f=n*u/c,d=t-.5*e,y=r+.5*n-h,m=e,v=a[i],g=500,_=l(d,y-f,m,f,{fill:v,stroke:s,"stroke-width":1});h+=f,_.mouseover(function(){_.stop().animate({transform:"s1.1 1.1 "+t+" "+r},g,"elastic")}).mouseout(function(){_.stop().animate({transform:""},g,"elastic")}),p.push(_)},d=0,y=o.length;y>d;d++)c+=o[d];for(d=0;y>d;d++)f(d);return p},lr=function(t){function r(t){var e,n,o,i,a,s,l,u,p,h;e=this,r.__super__.constructor.call(this,t),e.styles=null!=(o=t.styles)?o:"",e.colors=null!=(i=t.colors)?i:[],e.titles=null!=(a=t.titles)?a:["","","","",""],e.values=null!=(s=t.values)?s:[],e.width=null!=(l=t.width)?l:17,e.height=null!=(u=t.height)?u:30,e["class"]=null!=(p=t["class"])?p:"barchart",null==(h=(n=Raphael.fn).drawStackedBarChart)&&(n.drawStackedBarChart=drawStackedBars)}return ae(r,t),r.prototype.overlaps=function(t){var r,e,n,o,i,a,s,l,u,p,h;return n=this,p=[n.x,n.y,n.radius],a=p[0],l=p[1],o=p[2],h=[t.x,t.y,t.radius],s=h[0],u=h[1],i=h[2],a-o>s+i||s-i>a+o||l-o>u+i||u-i>l+o?!1:(r=a-s,e=l-u,r*r+e*e>(o+i)*(o+i)?!1:!0)},r.prototype.render=function(){var t,r,e,n,o,i;return e=this,n=e.width,r=e.height,o=e.x,i=e.y,t=e.layers.mapcanvas.rect(o-.5*n-2,i-.5*r-2,n+4,r+4).attr({stroke:"none",fill:"#fff"}),e.chart=e.layers.mapcanvas.drawStackedBarChart(e.x,e.y,e.width,e.height,e.values,e.titles,e.colors,"none"),e.chart.push(t),e},r.prototype.update=function(){var t;t=this},r.prototype.clear=function(){var t,r,e,n,o;for(t=this,o=t.chart,e=0,n=o.length;n>e;e++)r=o[e],r.remove();return t.chart=[],t},r.prototype.nodes=function(){var t,r,e,n,o,i;for(r=this,o=r.chart,i=[],e=0,n=o.length;n>e;e++)t=o[e],i.push(t.node);return i},r}(br.Symbol),lr.props=["values","styles","class","titles","colors","width","height"],lr.layers=[],br.StackedBarChart=lr}.call(this);
\ No newline at end of file diff --git a/plugins/UserCountryMap/javascripts/visitor-map.js b/plugins/UserCountryMap/javascripts/visitor-map.js index 4c506cecbc..60588220d9 100644 --- a/plugins/UserCountryMap/javascripts/visitor-map.js +++ b/plugins/UserCountryMap/javascripts/visitor-map.js @@ -77,7 +77,7 @@ } var mapContainer = $$('.UserCountryMap_map').get(0), - map = self.map = Kartograph.map(mapContainer), + map = self.map = $K.map(mapContainer), main = $$('.UserCountryMap_container'), worldTotalVisits = 0, width = main.width(), @@ -883,7 +883,7 @@ var is_rate = metric.substr(0, 3) != 'nb_' || metric == 'nb_actions_per_visit'; var citySymbols = map.addSymbols({ - type: Kartograph.LabeledBubble, + type: $K.LabeledBubble, data: cities, clustering: 'noverlap', clusteringOpts: { |