/** * plotly.js (mapbox - minified) v1.20.5 * Copyright 2012-2016, Plotly, Inc. * All rights reserved. * Licensed under the MIT license */ !function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.Plotly=t()}}(function(){var t;return function t(e,n,r){function i(o,s){if(!n[o]){if(!e[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(a)return a(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[o]={exports:{}};e[o][0].call(c.exports,function(t){var n=e[o][1][t];return i(n?n:t)},c,c.exports,t,e,n,r)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o=0;a--)if(o[a]!=s[a])return!1;for(a=o.length-1;a>=0;a--)if(i=o[a],!l(t[i],e[i]))return!1;return!0}function f(t,e){return!(!t||!e)&&("[object RegExp]"==Object.prototype.toString.call(e)?e.test(t):t instanceof e||e.call({},t)===!0)}function h(t,e,n,r){var i;d.isString(n)&&(r=n,n=null);try{e()}catch(t){i=t}if(r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),t&&!i&&o(i,n,"Missing expected exception"+r),!t&&f(i,n)&&o(i,n,"Got unwanted exception"+r),t&&i&&n&&!f(i,n)||!t&&i)throw i}var d=t("util/"),p=Array.prototype.slice,m=Object.prototype.hasOwnProperty,g=e.exports=s;g.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=a(this),this.generatedMessage=!0);var e=t.stackStartFunction||o;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var n=new Error;if(n.stack){var r=n.stack,i=e.name,s=r.indexOf("\n"+i);if(s>=0){var l=r.indexOf("\n",s+1);r=r.substring(l+1)}this.stack=r}}},d.inherits(g.AssertionError,Error),g.fail=o,g.ok=s,g.equal=function(t,e,n){t!=e&&o(t,e,n,"==",g.equal)},g.notEqual=function(t,e,n){t==e&&o(t,e,n,"!=",g.notEqual)},g.deepEqual=function(t,e,n){l(t,e)||o(t,e,n,"deepEqual",g.deepEqual)},g.notDeepEqual=function(t,e,n){l(t,e)&&o(t,e,n,"notDeepEqual",g.notDeepEqual)},g.strictEqual=function(t,e,n){t!==e&&o(t,e,n,"===",g.strictEqual)},g.notStrictEqual=function(t,e,n){t===e&&o(t,e,n,"!==",g.notStrictEqual)},g.throws=function(t,e,n){h.apply(this,[!0].concat(p.call(arguments)))},g.doesNotThrow=function(t,e){h.apply(this,[!1].concat(p.call(arguments)))},g.ifError=function(t){if(t)throw t};var v=Object.keys||function(t){var e=[];for(var n in t)m.call(t,n)&&e.push(n);return e}},{"util/":203}],7:[function(t,e,n){function r(t){return t=Math.round(t),t<0?0:t>255?255:t}function i(t){return t<0?0:t>1?1:t}function a(t){return r("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function o(t){return i("%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))}function s(t,e,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}function l(t){var e=t.replace(/ /g,"").toLowerCase();if(e in u)return u[e].slice();if("#"===e[0]){if(4===e.length){var n=parseInt(e.substr(1),16);return n>=0&&n<=4095?[(3840&n)>>4|(3840&n)>>8,240&n|(240&n)>>4,15&n|(15&n)<<4,1]:null}if(7===e.length){var n=parseInt(e.substr(1),16);return n>=0&&n<=16777215?[(16711680&n)>>16,(65280&n)>>8,255&n,1]:null}return null}var i=e.indexOf("("),l=e.indexOf(")");if(i!==-1&&l+1===e.length){var c=e.substr(0,i),f=e.substr(i+1,l-(i+1)).split(","),h=1;switch(c){case"rgba":if(4!==f.length)return null;h=o(f.pop());case"rgb":return 3!==f.length?null:[a(f[0]),a(f[1]),a(f[2]),h];case"hsla":if(4!==f.length)return null;h=o(f.pop());case"hsl":if(3!==f.length)return null;var d=(parseFloat(f[0])%360+360)%360/360,p=o(f[1]),m=o(f[2]),g=m<=.5?m*(p+1):m+p-m*p,v=2*m-g;return[r(255*s(v,g,d+1/3)),r(255*s(v,g,d)),r(255*s(v,g,d-1/3)),h];default:return null}}return null}var u={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};try{n.parseCSSColor=l}catch(t){}},{}],8:[function(e,n,r){!function(){function e(t){return t&&(t.ownerDocument||t.document||t).documentElement}function r(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}function i(t,e){return te?1:t>=e?0:NaN}function a(t){return null===t?NaN:+t}function o(t){return!isNaN(t)}function s(t){return{left:function(e,n,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=e.length);r>>1;t(e[a],n)<0?r=a+1:i=a}return r},right:function(e,n,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=e.length);r>>1;t(e[a],n)>0?i=a:r=a+1}return r}}}function l(t){return t.length}function u(t){for(var e=1;t*e%1;)e*=10;return e}function c(t,e){for(var n in e)Object.defineProperty(t.prototype,n,{value:e[n],enumerable:!1})}function f(){this._=Object.create(null)}function h(t){return(t+="")===bo||t[0]===wo?wo+t:t}function d(t){return(t+="")[0]===wo?t.slice(1):t}function p(t){return h(t)in this._}function m(t){return(t=h(t))in this._&&delete this._[t]}function g(){var t=[];for(var e in this._)t.push(d(e));return t}function v(){var t=0;for(var e in this._)++t;return t}function y(){for(var t in this._)return!1;return!0}function x(){this._=Object.create(null)}function _(t){return t}function b(t,e,n){return function(){var r=n.apply(e,arguments);return r===e?t:r}}function w(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var n=0,r=Mo.length;n=e&&(e=i+1);!(o=s[e])&&++e0&&(t=t.slice(0,s));var u=Po.get(t);return u&&(t=u,l=Q),s?e?i:r:e?M:a}function W(t,e){return function(n){var r=uo.event;uo.event=n,e[0]=this.__data__;try{t.apply(this,e)}finally{uo.event=r}}}function Q(t,e){var n=W(t,e);return function(t){var e=this,r=t.relatedTarget;r&&(r===e||8&r.compareDocumentPosition(e))||n.call(e,t)}}function J(t){var n=".dragsuppress-"+ ++Oo,i="click"+n,a=uo.select(r(t)).on("touchmove"+n,S).on("dragstart"+n,S).on("selectstart"+n,S);if(null==Co&&(Co=!("onselectstart"in t)&&w(t.style,"userSelect")),Co){var o=e(t).style,s=o[Co];o[Co]="none"}return function(t){if(a.on(n,null),Co&&(o[Co]=s),t){var e=function(){a.on(i,null)};a.on(i,function(){S(),e()},!0),setTimeout(e,0)}}}function $(t,e){e.changedTouches&&(e=e.changedTouches[0]);var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();if(Fo<0){var a=r(t);if(a.scrollX||a.scrollY){n=uo.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var o=n[0][0].getScreenCTM();Fo=!(o.f||o.e),n.remove()}}return Fo?(i.x=e.pageX,i.y=e.pageY):(i.x=e.clientX,i.y=e.clientY),i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}function K(){return uo.event.changedTouches[0].identifier}function tt(t){return t>0?1:t<0?-1:0}function et(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(e[1]-t[1])*(n[0]-t[0])}function nt(t){return t>1?0:t<-1?No:Math.acos(t)}function rt(t){return t>1?Vo:t<-1?-Vo:Math.asin(t)}function it(t){return((t=Math.exp(t))-1/t)/2}function at(t){return((t=Math.exp(t))+1/t)/2}function ot(t){return((t=Math.exp(2*t))-1)/(t+1)}function st(t){return(t=Math.sin(t/2))*t}function lt(){}function ut(t,e,n){return this instanceof ut?(this.h=+t,this.s=+e,void(this.l=+n)):arguments.length<2?t instanceof ut?new ut(t.h,t.s,t.l):Mt(""+t,kt,ut):new ut(t,e,n)}function ct(t,e,n){function r(t){return t>360?t-=360:t<0&&(t+=360),t<60?a+(o-a)*t/60:t<180?o:t<240?a+(o-a)*(240-t)/60:a}function i(t){return Math.round(255*r(t))}var a,o;return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:e<0?0:e>1?1:e,n=n<0?0:n>1?1:n,o=n<=.5?n*(1+e):n+e-n*e,a=2*n-o,new xt(i(t+120),i(t),i(t-120))}function ft(t,e,n){return this instanceof ft?(this.h=+t,this.c=+e,void(this.l=+n)):arguments.length<2?t instanceof ft?new ft(t.h,t.c,t.l):t instanceof dt?mt(t.l,t.a,t.b):mt((t=At((t=uo.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new ft(t,e,n)}function ht(t,e,n){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new dt(n,Math.cos(t*=Uo)*e,Math.sin(t)*e)}function dt(t,e,n){return this instanceof dt?(this.l=+t,this.a=+e,void(this.b=+n)):arguments.length<2?t instanceof dt?new dt(t.l,t.a,t.b):t instanceof ft?ht(t.h,t.c,t.l):At((t=xt(t)).r,t.g,t.b):new dt(t,e,n)}function pt(t,e,n){var r=(t+16)/116,i=r+e/500,a=r-n/200;return i=gt(i)*ts,r=gt(r)*es,a=gt(a)*ns,new xt(yt(3.2404542*i-1.5371385*r-.4985314*a),yt(-.969266*i+1.8760108*r+.041556*a),yt(.0556434*i-.2040259*r+1.0572252*a))}function mt(t,e,n){return t>0?new ft(Math.atan2(n,e)*Go,Math.sqrt(e*e+n*n),t):new ft(NaN,NaN,t)}function gt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function vt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function yt(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function xt(t,e,n){return this instanceof xt?(this.r=~~t,this.g=~~e,void(this.b=~~n)):arguments.length<2?t instanceof xt?new xt(t.r,t.g,t.b):Mt(""+t,xt,ct):new xt(t,e,n)}function _t(t){return new xt(t>>16,t>>8&255,255&t)}function bt(t){return _t(t)+""}function wt(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function Mt(t,e,n){var r,i,a,o=0,s=0,l=0;if(r=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(i=r[2].split(","),r[1]){case"hsl":return n(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(Tt(i[0]),Tt(i[1]),Tt(i[2]))}return(a=as.get(t))?e(a.r,a.g,a.b):(null==t||"#"!==t.charAt(0)||isNaN(a=parseInt(t.slice(1),16))||(4===t.length?(o=(3840&a)>>4,o|=o>>4,s=240&a,s|=s>>4,l=15&a,l|=l<<4):7===t.length&&(o=(16711680&a)>>16,s=(65280&a)>>8,l=255&a)),e(o,s,l))}function kt(t,e,n){var r,i,a=Math.min(t/=255,e/=255,n/=255),o=Math.max(t,e,n),s=o-a,l=(o+a)/2;return s?(i=l<.5?s/(o+a):s/(2-o-a),r=t==o?(e-n)/s+(e0&&l<1?0:r),new ut(r,i,l)}function At(t,e,n){t=St(t),e=St(e),n=St(n);var r=vt((.4124564*t+.3575761*e+.1804375*n)/ts),i=vt((.2126729*t+.7151522*e+.072175*n)/es),a=vt((.0193339*t+.119192*e+.9503041*n)/ns);return dt(116*i-16,500*(r-i),200*(i-a))}function St(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Tt(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}function zt(t){return"function"==typeof t?t:function(){return t}}function Et(t){return function(e,n,r){return 2===arguments.length&&"function"==typeof n&&(r=n,n=null),Lt(e,n,t,r)}}function Lt(t,e,n,r){function i(){var t,e=l.status;if(!e&&Dt(l)||e>=200&&e<300||304===e){try{t=n.call(a,l)}catch(t){return void o.error.call(a,t)}o.load.call(a,t)}else o.error.call(a,l)}var a={},o=uo.dispatch("beforesend","progress","load","error"),s={},l=new XMLHttpRequest,u=null;return!this.XDomainRequest||"withCredentials"in l||!/^(http(s)?:)?\/\//.test(t)||(l=new XDomainRequest),"onload"in l?l.onload=l.onerror=i:l.onreadystatechange=function(){l.readyState>3&&i()},l.onprogress=function(t){var e=uo.event;uo.event=t;try{o.progress.call(a,l)}finally{uo.event=e}},a.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?s[t]:(null==e?delete s[t]:s[t]=e+"",a)},a.mimeType=function(t){return arguments.length?(e=null==t?null:t+"",a):e},a.responseType=function(t){return arguments.length?(u=t,a):u},a.response=function(t){return n=t,a},["get","post"].forEach(function(t){a[t]=function(){return a.send.apply(a,[t].concat(fo(arguments)))}}),a.send=function(n,r,i){if(2===arguments.length&&"function"==typeof r&&(i=r,r=null),l.open(n,t,!0),null==e||"accept"in s||(s.accept=e+",*/*"),l.setRequestHeader)for(var c in s)l.setRequestHeader(c,s[c]);return null!=e&&l.overrideMimeType&&l.overrideMimeType(e),null!=u&&(l.responseType=u),null!=i&&a.on("error",i).on("load",function(t){i(null,t)}),o.beforesend.call(a,l),l.send(null==r?null:r),a},a.abort=function(){return l.abort(),a},uo.rebind(a,o,"on"),null==r?a:a.get(It(r))}function It(t){return 1===t.length?function(e,n){t(null==e?n:null)}:t}function Dt(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}function Pt(t,e,n){var r=arguments.length;r<2&&(e=0),r<3&&(n=Date.now());var i=n+e,a={c:t,t:i,n:null};return ss?ss.n=a:os=a,ss=a,ls||(us=clearTimeout(us),ls=1, cs(Ct)),a}function Ct(){var t=Ot(),e=Ft()-t;e>24?(isFinite(e)&&(clearTimeout(us),us=setTimeout(Ct,e)),ls=0):(ls=1,cs(Ct))}function Ot(){for(var t=Date.now(),e=os;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function Ft(){for(var t,e=os,n=1/0;e;)e.c?(e.t8?function(t){return t/n}:function(t){return t*n},symbol:t}}function Nt(t){var e=t.decimal,n=t.thousands,r=t.grouping,i=t.currency,a=r&&n?function(t,e){for(var i=t.length,a=[],o=0,s=r[0],l=0;i>0&&s>0&&(l+s+1>e&&(s=Math.max(1,e-l)),a.push(t.substring(i-=s,i+s)),!((l+=s+1)>e));)s=r[o=(o+1)%r.length];return a.reverse().join(n)}:_;return function(t){var n=hs.exec(t),r=n[1]||" ",o=n[2]||">",s=n[3]||"-",l=n[4]||"",u=n[5],c=+n[6],f=n[7],h=n[8],d=n[9],p=1,m="",g="",v=!1,y=!0;switch(h&&(h=+h.substring(1)),(u||"0"===r&&"="===o)&&(u=r="0",o="="),d){case"n":f=!0,d="g";break;case"%":p=100,g="%",d="f";break;case"p":p=100,g="%",d="r";break;case"b":case"o":case"x":case"X":"#"===l&&(m="0"+d.toLowerCase());case"c":y=!1;case"d":v=!0,h=0;break;case"s":p=-1,d="r"}"$"===l&&(m=i[0],g=i[1]),"r"!=d||h||(d="g"),null!=h&&("g"==d?h=Math.max(1,Math.min(21,h)):"e"!=d&&"f"!=d||(h=Math.max(0,Math.min(20,h)))),d=ds.get(d)||Bt;var x=u&&f;return function(t){var n=g;if(v&&t%1)return"";var i=t<0||0===t&&1/t<0?(t=-t,"-"):"-"===s?"":s;if(p<0){var l=uo.formatPrefix(t,h);t=l.scale(t),n=l.symbol+g}else t*=p;t=d(t,h);var _,b,w=t.lastIndexOf(".");if(w<0){var M=y?t.lastIndexOf("e"):-1;M<0?(_=t,b=""):(_=t.substring(0,M),b=t.substring(M))}else _=t.substring(0,w),b=e+t.substring(w+1);!u&&f&&(_=a(_,1/0));var k=m.length+_.length+b.length+(x?0:i.length),A=k"===o?A+i+t:"^"===o?A.substring(0,k>>=1)+i+t+A.substring(k):i+(x?t:A+t))+n}}}function Bt(t){return t+""}function qt(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Vt(t,e,n){function r(e){var n=t(e),r=a(n,1);return e-n1)for(;o=u)return-1;if(i=e.charCodeAt(s++),37===i){if(o=e.charAt(s++),a=E[o in vs?e.charAt(s++):o],!a||(r=a(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}function r(t,e,n){w.lastIndex=0;var r=w.exec(e.slice(n));return r?(t.w=M.get(r[0].toLowerCase()),n+r[0].length):-1}function i(t,e,n){_.lastIndex=0;var r=_.exec(e.slice(n));return r?(t.w=b.get(r[0].toLowerCase()),n+r[0].length):-1}function a(t,e,n){S.lastIndex=0;var r=S.exec(e.slice(n));return r?(t.m=T.get(r[0].toLowerCase()),n+r[0].length):-1}function o(t,e,n){k.lastIndex=0;var r=k.exec(e.slice(n));return r?(t.m=A.get(r[0].toLowerCase()),n+r[0].length):-1}function s(t,e,r){return n(t,z.c.toString(),e,r)}function l(t,e,r){return n(t,z.x.toString(),e,r)}function u(t,e,r){return n(t,z.X.toString(),e,r)}function c(t,e,n){var r=x.get(e.slice(n,n+=2).toLowerCase());return null==r?-1:(t.p=r,n)}var f=t.dateTime,h=t.date,d=t.time,p=t.periods,m=t.days,g=t.shortDays,v=t.months,y=t.shortMonths;e.utc=function(t){function n(t){try{ms=qt;var e=new ms;return e._=t,r(e)}finally{ms=Date}}var r=e(t);return n.parse=function(t){try{ms=qt;var e=r.parse(t);return e&&e._}finally{ms=Date}},n.toString=r.toString,n},e.multi=e.utc.multi=ce;var x=uo.map(),_=Zt(m),b=Xt(m),w=Zt(g),M=Xt(g),k=Zt(v),A=Xt(v),S=Zt(y),T=Xt(y);p.forEach(function(t,e){x.set(t.toLowerCase(),e)});var z={a:function(t){return g[t.getDay()]},A:function(t){return m[t.getDay()]},b:function(t){return y[t.getMonth()]},B:function(t){return v[t.getMonth()]},c:e(f),d:function(t,e){return Ht(t.getDate(),e,2)},e:function(t,e){return Ht(t.getDate(),e,2)},H:function(t,e){return Ht(t.getHours(),e,2)},I:function(t,e){return Ht(t.getHours()%12||12,e,2)},j:function(t,e){return Ht(1+ps.dayOfYear(t),e,3)},L:function(t,e){return Ht(t.getMilliseconds(),e,3)},m:function(t,e){return Ht(t.getMonth()+1,e,2)},M:function(t,e){return Ht(t.getMinutes(),e,2)},p:function(t){return p[+(t.getHours()>=12)]},S:function(t,e){return Ht(t.getSeconds(),e,2)},U:function(t,e){return Ht(ps.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Ht(ps.mondayOfYear(t),e,2)},x:e(h),X:e(d),y:function(t,e){return Ht(t.getFullYear()%100,e,2)},Y:function(t,e){return Ht(t.getFullYear()%1e4,e,4)},Z:le,"%":function(){return"%"}},E={a:r,A:i,b:a,B:o,c:s,d:ne,e:ne,H:ie,I:ie,j:re,L:se,m:ee,M:ae,p:c,S:oe,U:Wt,w:Yt,W:Qt,x:l,X:u,y:$t,Y:Jt,Z:Kt,"%":ue};return e}function Ht(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",a=i.length;return r+(a68?1900:2e3)}function ee(t,e,n){ys.lastIndex=0;var r=ys.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function ne(t,e,n){ys.lastIndex=0;var r=ys.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function re(t,e,n){ys.lastIndex=0;var r=ys.exec(e.slice(n,n+3));return r?(t.j=+r[0],n+r[0].length):-1}function ie(t,e,n){ys.lastIndex=0;var r=ys.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function ae(t,e,n){ys.lastIndex=0;var r=ys.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function oe(t,e,n){ys.lastIndex=0;var r=ys.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function se(t,e,n){ys.lastIndex=0;var r=ys.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function le(t){var e=t.getTimezoneOffset(),n=e>0?"-":"+",r=_o(e)/60|0,i=_o(e)%60;return n+Ht(r,"0",2)+Ht(i,"0",2)}function ue(t,e,n){xs.lastIndex=0;var r=xs.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function ce(t){for(var e=t.length,n=-1;++n=0?1:-1,s=o*n,l=Math.cos(e),u=Math.sin(e),c=a*u,f=i*l+c*Math.cos(s),h=c*o*Math.sin(s);As.add(Math.atan2(h,f)),r=t,i=l,a=u}var e,n,r,i,a;Ss.point=function(o,s){Ss.point=t,r=(e=o)*Uo,i=Math.cos(s=(n=s)*Uo/2+No/4),a=Math.sin(s)},Ss.lineEnd=function(){t(e,n)}}function ve(t){var e=t[0],n=t[1],r=Math.cos(n);return[r*Math.cos(e),r*Math.sin(e),Math.sin(n)]}function ye(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function xe(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function _e(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function be(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function we(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function Me(t){return[Math.atan2(t[1],t[0]),rt(t[2])]}function ke(t,e){return _o(t[0]-e[0])=0;--s)i.point((f=c[s])[0],f[1])}else r(d.x,d.p.x,-1,i);d=d.p}d=d.o,c=d.z,p=!p}while(!d.v);i.lineEnd()}}}function Pe(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r0){for(b||(a.polygonStart(),b=!0),a.lineStart();++o1&&2&e&&n.push(n.pop().concat(n.shift())),d.push(n.filter(Fe))}var d,p,m,g=e(a),v=i.invert(r[0],r[1]),y={point:o,lineStart:l,lineEnd:u,polygonStart:function(){y.point=c,y.lineStart=f,y.lineEnd=h,d=[],p=[]},polygonEnd:function(){y.point=o,y.lineStart=l,y.lineEnd=u,d=uo.merge(d);var t=Ve(v,p);d.length?(b||(a.polygonStart(),b=!0),De(d,je,t,n,a)):t&&(b||(a.polygonStart(),b=!0),a.lineStart(),n(null,null,1,a),a.lineEnd()),b&&(a.polygonEnd(),b=!1),d=p=null},sphere:function(){a.polygonStart(),a.lineStart(),n(null,null,1,a),a.lineEnd(),a.polygonEnd()}},x=Re(),_=e(x),b=!1;return y}}function Fe(t){return t.length>1}function Re(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,n){t.push([e,n])},lineEnd:M,buffer:function(){var n=e;return e=[],t=null,n},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function je(t,e){return((t=t.x)[0]<0?t[1]-Vo-Ro:Vo-t[1])-((e=e.x)[0]<0?e[1]-Vo-Ro:Vo-e[1])}function Ne(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,o){var s=a>0?No:-No,l=_o(a-n);_o(l-No)0?Vo:-Vo),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(a,r),e=0):i!==s&&l>=No&&(_o(n-i)Ro?Math.atan((Math.sin(e)*(a=Math.cos(r))*Math.sin(n)-Math.sin(r)*(i=Math.cos(e))*Math.sin(t))/(i*a*o)):(e+r)/2}function qe(t,e,n,r){var i;if(null==t)i=n*Vo,r.point(-No,i),r.point(0,i),r.point(No,i),r.point(No,0),r.point(No,-i),r.point(0,-i),r.point(-No,-i),r.point(-No,0),r.point(-No,i);else if(_o(t[0]-e[0])>Ro){var a=t[0]=0?1:-1,M=w*b,k=M>No,A=p*x;if(As.add(Math.atan2(A*w*Math.sin(M),m*_+A*Math.cos(M))),a+=k?b+w*Bo:b,k^h>=n^v>=n){var S=xe(ve(f),ve(t));we(S);var T=xe(i,S);we(T);var z=(k^b>=0?-1:1)*rt(T[2]);(r>z||r===z&&(S[0]||S[1]))&&(o+=k^b>=0?1:-1)}if(!g++)break;h=v,p=x,m=_,f=t}}return(a<-Ro||aa}function n(t){var n,a,l,u,c;return{lineStart:function(){u=l=!1,c=1},point:function(f,h){var d,p=[f,h],m=e(f,h),g=o?m?0:i(f,h):m?i(f+(f<0?No:-No),h):0;if(!n&&(u=l=m)&&t.lineStart(),m!==l&&(d=r(n,p),(ke(n,d)||ke(p,d))&&(p[0]+=Ro,p[1]+=Ro,m=e(p[0],p[1]))),m!==l)c=0,m?(t.lineStart(),d=r(p,n),t.point(d[0],d[1])):(d=r(n,p),t.point(d[0],d[1]),t.lineEnd()),n=d;else if(s&&n&&o^m){var v;g&a||!(v=r(p,n,!0))||(c=0,o?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1])))}!m||n&&ke(n,p)||t.point(p[0],p[1]),n=p,l=m,a=g},lineEnd:function(){l&&t.lineEnd(),n=null},clean:function(){return c|(u&&l)<<1}}}function r(t,e,n){var r=ve(t),i=ve(e),o=[1,0,0],s=xe(r,i),l=ye(s,s),u=s[0],c=l-u*u;if(!c)return!n&&t;var f=a*l/c,h=-a*u/c,d=xe(o,s),p=be(o,f),m=be(s,h);_e(p,m);var g=d,v=ye(p,g),y=ye(g,g),x=v*v-y*(ye(p,p)-1);if(!(x<0)){var _=Math.sqrt(x),b=be(g,(-v-_)/y);if(_e(b,p),b=Me(b),!n)return b;var w,M=t[0],k=e[0],A=t[1],S=e[1];k0^b[1]<(_o(b[0]-M)No^(M<=b[0]&&b[0]<=k)){var L=be(g,(-v+_)/y);return _e(L,p),[b,Me(L)]}}}function i(e,n){var r=o?t:No-t,i=0;return e<-r?i|=1:e>r&&(i|=2),n<-r?i|=4:n>r&&(i|=8),i}var a=Math.cos(t),o=a>0,s=_o(a)>Ro,l=vn(t,6*Uo);return Oe(e,n,l,o?[0,-t]:[-No,t-No])}function Ge(t,e,n,r){return function(i){var a,o=i.a,s=i.b,l=o.x,u=o.y,c=s.x,f=s.y,h=0,d=1,p=c-l,m=f-u;if(a=t-l,p||!(a>0)){if(a/=p,p<0){if(a0){if(a>d)return;a>h&&(h=a)}if(a=n-l,p||!(a<0)){if(a/=p,p<0){if(a>d)return;a>h&&(h=a)}else if(p>0){if(a0)){if(a/=m,m<0){if(a0){if(a>d)return;a>h&&(h=a)}if(a=r-u,m||!(a<0)){if(a/=m,m<0){if(a>d)return;a>h&&(h=a)}else if(m>0){if(a0&&(i.a={x:l+h*p,y:u+h*m}),d<1&&(i.b={x:l+d*p,y:u+d*m}),i}}}}}}function He(t,e,n,r){function i(r,i){return _o(r[0]-t)0?0:3:_o(r[0]-n)0?2:1:_o(r[1]-e)0?1:0:i>0?3:2}function a(t,e){return o(t.x,e.x)}function o(t,e){var n=i(t,1),r=i(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(s){function l(t){for(var e=0,n=g.length,r=t[1],i=0;ir&&et(u,a,t)>0&&++e:a[1]<=r&&et(u,a,t)<0&&--e,u=a;return 0!==e}function u(a,s,l,u){var c=0,f=0;if(null==a||(c=i(a,l))!==(f=i(s,l))||o(a,s)<0^l>0){do u.point(0===c||3===c?t:n,c>1?r:e);while((c=(c+l+4)%4)!==f)}else u.point(s[0],s[1])}function c(i,a){return t<=i&&i<=n&&e<=a&&a<=r}function f(t,e){c(t,e)&&s.point(t,e)}function h(){E.point=p,g&&g.push(v=[]),k=!0,M=!1,b=w=NaN}function d(){m&&(p(y,x),_&&M&&T.rejoin(),m.push(T.buffer())),E.point=f,M&&s.lineEnd()}function p(t,e){t=Math.max(-Bs,Math.min(Bs,t)),e=Math.max(-Bs,Math.min(Bs,e));var n=c(t,e);if(g&&v.push([t,e]),k)y=t,x=e,_=n,k=!1,n&&(s.lineStart(),s.point(t,e));else if(n&&M)s.point(t,e);else{var r={a:{x:b,y:w},b:{x:t,y:e}};z(r)?(M||(s.lineStart(),s.point(r.a.x,r.a.y)),s.point(r.b.x,r.b.y),n||s.lineEnd(),A=!1):n&&(s.lineStart(),s.point(t,e),A=!1)}b=t,w=e,M=n}var m,g,v,y,x,_,b,w,M,k,A,S=s,T=Re(),z=Ge(t,e,n,r),E={point:f,lineStart:h,lineEnd:d,polygonStart:function(){s=T,m=[],g=[],A=!0},polygonEnd:function(){s=S,m=uo.merge(m);var e=l([t,r]),n=A&&e,i=m.length;(n||i)&&(s.polygonStart(),n&&(s.lineStart(),u(null,null,1,s),s.lineEnd()),i&&De(m,a,e,u,s),s.polygonEnd()),m=g=v=null}};return E}}function Ze(t){var e=0,n=No/3,r=un(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*No/180,n=t[1]*No/180):[e/No*180,n/No*180]},i}function Xe(t,e){function n(t,e){var n=Math.sqrt(a-2*i*Math.sin(e))/i;return[n*Math.sin(t*=i),o-n*Math.cos(t)]}var r=Math.sin(t),i=(r+Math.sin(e))/2,a=1+r*(2*i-r),o=Math.sqrt(a)/i;return n.invert=function(t,e){var n=o-e;return[Math.atan2(t,n)/i,rt((a-(t*t+n*n)*i*i)/(2*i))]},n}function Ye(){function t(t,e){Vs+=i*t-r*e,r=t,i=e}var e,n,r,i;Xs.point=function(a,o){Xs.point=t,e=r=a,n=i=o},Xs.lineEnd=function(){t(e,n)}}function We(t,e){tHs&&(Hs=t),eZs&&(Zs=e)}function Qe(){function t(t,e){o.push("M",t,",",e,a)}function e(t,e){o.push("M",t,",",e),s.point=n}function n(t,e){o.push("L",t,",",e)}function r(){s.point=t}function i(){o.push("Z")}var a=Je(4.5),o=[],s={point:t,lineStart:function(){s.point=e},lineEnd:r,polygonStart:function(){s.lineEnd=i},polygonEnd:function(){s.lineEnd=r,s.point=t},pointRadius:function(t){return a=Je(t),s},result:function(){if(o.length){var t=o.join("");return o=[],t}}};return s}function Je(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function $e(t,e){Es+=t,Ls+=e,++Is}function Ke(){function t(t,r){var i=t-e,a=r-n,o=Math.sqrt(i*i+a*a);Ds+=o*(e+t)/2,Ps+=o*(n+r)/2,Cs+=o,$e(e=t,n=r)}var e,n;Ws.point=function(r,i){Ws.point=t,$e(e=r,n=i)}}function tn(){Ws.point=$e}function en(){function t(t,e){var n=t-r,a=e-i,o=Math.sqrt(n*n+a*a);Ds+=o*(r+t)/2,Ps+=o*(i+e)/2,Cs+=o,o=i*t-r*e,Os+=o*(r+t),Fs+=o*(i+e),Rs+=3*o,$e(r=t,i=e)}var e,n,r,i;Ws.point=function(a,o){Ws.point=t,$e(e=r=a,n=i=o)},Ws.lineEnd=function(){t(e,n)}}function nn(t){function e(e,n){t.moveTo(e+o,n),t.arc(e,n,o,0,Bo)}function n(e,n){t.moveTo(e,n),s.point=r}function r(e,n){t.lineTo(e,n)}function i(){s.point=e}function a(){t.closePath()}var o=4.5,s={point:e,lineStart:function(){s.point=n},lineEnd:i,polygonStart:function(){s.lineEnd=a},polygonEnd:function(){s.lineEnd=i,s.point=e},pointRadius:function(t){return o=t,s},result:M};return s}function rn(t){function e(t){return(s?r:n)(t)}function n(e){return sn(e,function(n,r){n=t(n,r),e.point(n[0],n[1])})}function r(e){function n(n,r){n=t(n,r),e.point(n[0],n[1])}function r(){x=NaN,k.point=a,e.lineStart()}function a(n,r){var a=ve([n,r]),o=t(n,r);i(x,_,y,b,w,M,x=o[0],_=o[1],y=n,b=a[0],w=a[1],M=a[2],s,e),e.point(x,_)}function o(){k.point=n,e.lineEnd()}function l(){r(),k.point=u,k.lineEnd=c}function u(t,e){a(f=t,h=e),d=x,p=_,m=b,g=w,v=M,k.point=a}function c(){i(x,_,y,b,w,M,d,p,f,m,g,v,s,e),k.lineEnd=o,o()}var f,h,d,p,m,g,v,y,x,_,b,w,M,k={point:n,lineStart:r,lineEnd:o,polygonStart:function(){e.polygonStart(),k.lineStart=l},polygonEnd:function(){e.polygonEnd(),k.lineStart=r}};return k}function i(e,n,r,s,l,u,c,f,h,d,p,m,g,v){var y=c-e,x=f-n,_=y*y+x*x;if(_>4*a&&g--){var b=s+d,w=l+p,M=u+m,k=Math.sqrt(b*b+w*w+M*M),A=Math.asin(M/=k),S=_o(_o(M)-1)a||_o((y*L+x*I)/_-.5)>.3||s*d+l*p+u*m0&&16,e):Math.sqrt(a)},e}function an(t){var e=rn(function(e,n){return t([e*Go,n*Go])});return function(t){return cn(e(t))}}function on(t){this.stream=t}function sn(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function ln(t){return un(function(){return t})()}function un(t){function e(t){return t=s(t[0]*Uo,t[1]*Uo),[t[0]*h+l,u-t[1]*h]}function n(t){return t=s.invert((t[0]-l)/h,(u-t[1])/h),t&&[t[0]*Go,t[1]*Go]}function r(){s=Le(o=dn(v,y,x),a);var t=a(m,g);return l=d-t[0]*h,u=p+t[1]*h,i()}function i(){return c&&(c.valid=!1,c=null),e}var a,o,s,l,u,c,f=rn(function(t,e){return t=a(t,e),[t[0]*h+l,u-t[1]*h]}),h=150,d=480,p=250,m=0,g=0,v=0,y=0,x=0,b=Ns,w=_,M=null,k=null;return e.stream=function(t){return c&&(c.valid=!1),c=cn(b(o,f(w(t)))),c.valid=!0,c},e.clipAngle=function(t){return arguments.length?(b=null==t?(M=t,Ns):Ue((M=+t)*Uo),i()):M},e.clipExtent=function(t){return arguments.length?(k=t,w=t?He(t[0][0],t[0][1],t[1][0],t[1][1]):_,i()):k},e.scale=function(t){return arguments.length?(h=+t,r()):h},e.translate=function(t){return arguments.length?(d=+t[0],p=+t[1],r()):[d,p]},e.center=function(t){return arguments.length?(m=t[0]%360*Uo,g=t[1]%360*Uo,r()):[m*Go,g*Go]},e.rotate=function(t){return arguments.length?(v=t[0]%360*Uo,y=t[1]%360*Uo,x=t.length>2?t[2]%360*Uo:0,r()):[v*Go,y*Go,x*Go]},uo.rebind(e,f,"precision"),function(){return a=t.apply(this,arguments),e.invert=a.invert&&n,r()}}function cn(t){return sn(t,function(e,n){t.point(e*Uo,n*Uo)})}function fn(t,e){return[t,e]}function hn(t,e){return[t>No?t-Bo:t<-No?t+Bo:t,e]}function dn(t,e,n){return t?e||n?Le(mn(t),gn(e,n)):mn(t):e||n?gn(e,n):hn}function pn(t){return function(e,n){return e+=t,[e>No?e-Bo:e<-No?e+Bo:e,n]}}function mn(t){var e=pn(t);return e.invert=pn(-t),e}function gn(t,e){function n(t,e){var n=Math.cos(e),s=Math.cos(t)*n,l=Math.sin(t)*n,u=Math.sin(e),c=u*r+s*i;return[Math.atan2(l*a-c*o,s*r-u*i),rt(c*a+l*o)]}var r=Math.cos(t),i=Math.sin(t),a=Math.cos(e),o=Math.sin(e);return n.invert=function(t,e){var n=Math.cos(e),s=Math.cos(t)*n,l=Math.sin(t)*n,u=Math.sin(e),c=u*a-l*o;return[Math.atan2(l*a+u*o,s*r+c*i),rt(c*r-s*i)]},n}function vn(t,e){var n=Math.cos(t),r=Math.sin(t);return function(i,a,o,s){var l=o*e;null!=i?(i=yn(n,i),a=yn(n,a),(o>0?ia)&&(i+=o*Bo)):(i=t+o*Bo,a=t-.5*l);for(var u,c=i;o>0?c>a:c0?e<-Vo+Ro&&(e=-Vo+Ro):e>Vo-Ro&&(e=Vo-Ro);var n=o/Math.pow(i(e),a);return[n*Math.sin(a*t),o-n*Math.cos(a*t)]}var r=Math.cos(t),i=function(t){return Math.tan(No/4+t/2)},a=t===e?Math.sin(t):Math.log(r/Math.cos(e))/Math.log(i(e)/i(t)),o=r*Math.pow(i(t),a)/a;return a?(n.invert=function(t,e){var n=o-e,r=tt(a)*Math.sqrt(t*t+n*n);return[Math.atan2(t,n)/a,2*Math.atan(Math.pow(o/r,1/a))-Vo]},n):zn}function Tn(t,e){function n(t,e){var n=a-e;return[n*Math.sin(i*t),a-n*Math.cos(i*t)]}var r=Math.cos(t),i=t===e?Math.sin(t):(r-Math.cos(e))/(e-t),a=r/i+t;return _o(i)1&&et(t[n[r-2]],t[n[r-1]],t[i])<=0;)--r;n[r++]=i}return n.slice(0,r)}function Cn(t,e){return t[0]-e[0]||t[1]-e[1]}function On(t,e,n){return(n[0]-e[0])*(t[1]-e[1])<(n[1]-e[1])*(t[0]-e[0])}function Fn(t,e,n,r){var i=t[0],a=n[0],o=e[0]-i,s=r[0]-a,l=t[1],u=n[1],c=e[1]-l,f=r[1]-u,h=(s*(l-u)-f*(i-a))/(f*o-s*c);return[i+h*o,l+h*c]}function Rn(t){var e=t[0],n=t[t.length-1];return!(e[0]-n[0]||e[1]-n[1])}function jn(){ar(this),this.edge=this.site=this.circle=null}function Nn(t){var e=ul.pop()||new jn;return e.site=t,e}function Bn(t){Qn(t),ol.remove(t),ul.push(t),ar(t)}function qn(t){var e=t.circle,n=e.x,r=e.cy,i={x:n,y:r},a=t.P,o=t.N,s=[t];Bn(t);for(var l=a;l.circle&&_o(n-l.circle.x)Ro)s=s.L;else{if(i=a-Gn(s,o),!(i>Ro)){r>-Ro?(e=s.P,n=s):i>-Ro?(e=s,n=s.N):e=n=s;break}if(!s.R){e=s;break}s=s.R}var l=Nn(t);if(ol.insert(e,l),e||n){if(e===n)return Qn(e),n=Nn(e.site),ol.insert(l,n),l.edge=n.edge=tr(e.site,l.site),Wn(e),void Wn(n);if(!n)return void(l.edge=tr(e.site,l.site));Qn(e),Qn(n);var u=e.site,c=u.x,f=u.y,h=t.x-c,d=t.y-f,p=n.site,m=p.x-c,g=p.y-f,v=2*(h*g-d*m),y=h*h+d*d,x=m*m+g*g,_={x:(g*y-d*x)/v+c,y:(h*x-m*y)/v+f};nr(n.edge,u,p,_),l.edge=tr(u,t,null,_),n.edge=tr(t,p,null,_),Wn(e),Wn(n)}}function Un(t,e){var n=t.site,r=n.x,i=n.y,a=i-e;if(!a)return r;var o=t.P;if(!o)return-(1/0);n=o.site;var s=n.x,l=n.y,u=l-e;if(!u)return s;var c=s-r,f=1/a-1/u,h=c/u;return f?(-h+Math.sqrt(h*h-2*f*(c*c/(-2*u)-l+u/2+i-a/2)))/f+r:(r+s)/2}function Gn(t,e){var n=t.N;if(n)return Un(n,e);var r=t.site;return r.y===e?r.x:1/0}function Hn(t){this.site=t,this.edges=[]}function Zn(t){for(var e,n,r,i,a,o,s,l,u,c,f=t[0][0],h=t[1][0],d=t[0][1],p=t[1][1],m=al,g=m.length;g--;)if(a=m[g],a&&a.prepare())for(s=a.edges,l=s.length,o=0;oRo||_o(i-n)>Ro)&&(s.splice(o,0,new rr(er(a.site,c,_o(r-f)Ro?{x:f,y:_o(e-f)Ro?{x:_o(n-p)Ro?{x:h,y:_o(e-h)Ro?{x:_o(n-d)=-jo)){var d=l*l+u*u,p=c*c+f*f,m=(f*d-u*p)/h,g=(l*p-c*d)/h,f=g+s,v=cl.pop()||new Yn;v.arc=t,v.site=i,v.x=m+o,v.y=f+Math.sqrt(m*m+g*g),v.cy=f,t.circle=v;for(var y=null,x=ll._;x;)if(v.y=s)return;if(h>p){if(a){if(a.y>=u)return}else a={x:g,y:l};n={x:g,y:u}}else{if(a){if(a.y1)if(h>p){if(a){if(a.y>=u)return}else a={x:(l-i)/r,y:l};n={x:(u-i)/r,y:u}}else{if(a){if(a.y=s)return}else a={x:o,y:r*o+i};n={x:s,y:r*s+i}}else{if(a){if(a.xa||f>o||h=_,M=n>=b,k=M<<1|w,A=k+4;ka&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(n=n[0])===(r=r[0])?s[o]?s[o]+=r:s[++o]=r:(s[++o]=null,l.push({i:o,x:xr(n,r)})),a=dl.lastIndex;return a=0&&!(n=uo.interpolators[r](t,e)););return n}function wr(t,e){var n,r=[],i=[],a=t.length,o=e.length,s=Math.min(t.length,e.length);for(n=0;n=1?1:t(e)}}function kr(t){return function(e){return 1-t(1-e)}}function Ar(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function Sr(t){return t*t}function Tr(t){return t*t*t}function zr(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,n=e*t;return 4*(t<.5?n:3*(t-e)+n-.75)}function Er(t){return function(e){return Math.pow(e,t)}}function Lr(t){return 1-Math.cos(t*Vo)}function Ir(t){return Math.pow(2,10*(t-1))}function Dr(t){return 1-Math.sqrt(1-t*t)}function Pr(t,e){var n;return arguments.length<2&&(e=.45),arguments.length?n=e/Bo*Math.asin(1/t):(t=1,n=e/4),function(r){return 1+t*Math.pow(2,-10*r)*Math.sin((r-n)*Bo/e)}}function Cr(t){return t||(t=1.70158),function(e){return e*e*((t+1)*e-t)}}function Or(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function Fr(t,e){t=uo.hcl(t),e=uo.hcl(e);var n=t.h,r=t.c,i=t.l,a=e.h-n,o=e.c-r,s=e.l-i;return isNaN(o)&&(o=0,r=isNaN(r)?e.c:r),isNaN(a)?(a=0,n=isNaN(n)?e.h:n):a>180?a-=360:a<-180&&(a+=360),function(t){return ht(n+a*t,r+o*t,i+s*t)+""}}function Rr(t,e){t=uo.hsl(t),e=uo.hsl(e);var n=t.h,r=t.s,i=t.l,a=e.h-n,o=e.s-r,s=e.l-i;return isNaN(o)&&(o=0,r=isNaN(r)?e.s:r),isNaN(a)?(a=0,n=isNaN(n)?e.h:n):a>180?a-=360:a<-180&&(a+=360),function(t){return ct(n+a*t,r+o*t,i+s*t)+""}}function jr(t,e){t=uo.lab(t),e=uo.lab(e);var n=t.l,r=t.a,i=t.b,a=e.l-n,o=e.a-r,s=e.b-i;return function(t){return pt(n+a*t,r+o*t,i+s*t)+""}}function Nr(t,e){return e-=t,function(n){return Math.round(t+e*n)}}function Br(t){var e=[t.a,t.b],n=[t.c,t.d],r=Vr(e),i=qr(e,n),a=Vr(Ur(n,e,-i))||0;e[0]*n[1]180?e+=360:e-t>180&&(t+=360),r.push({i:n.push(Gr(n)+"rotate(",null,")")-2,x:xr(t,e)})):e&&n.push(Gr(n)+"rotate("+e+")")}function Xr(t,e,n,r){t!==e?r.push({i:n.push(Gr(n)+"skewX(",null,")")-2,x:xr(t,e)}):e&&n.push(Gr(n)+"skewX("+e+")")}function Yr(t,e,n,r){if(t[0]!==e[0]||t[1]!==e[1]){var i=n.push(Gr(n)+"scale(",null,",",null,")");r.push({i:i-4,x:xr(t[0],e[0])},{i:i-2,x:xr(t[1],e[1])})}else 1===e[0]&&1===e[1]||n.push(Gr(n)+"scale("+e+")")}function Wr(t,e){var n=[],r=[];return t=uo.transform(t),e=uo.transform(e),Hr(t.translate,e.translate,n,r),Zr(t.rotate,e.rotate,n,r),Xr(t.skew,e.skew,n,r),Yr(t.scale,e.scale,n,r),t=e=null,function(t){for(var e,i=-1,a=r.length;++i=0;)n.push(i[r])}function li(t,e){for(var n=[t],r=[];null!=(t=n.pop());)if(r.push(t),(a=t.children)&&(i=a.length))for(var i,a,o=-1;++oi&&(r=n,i=e);return r}function xi(t){return t.reduce(_i,0)}function _i(t,e){return t+e[1]}function bi(t,e){return wi(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function wi(t,e){for(var n=-1,r=+t[0],i=(t[1]-r)/e,a=[];++n<=e;)a[n]=i*n+r;return a}function Mi(t){return[uo.min(t),uo.max(t)]}function ki(t,e){return t.value-e.value}function Ai(t,e){var n=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=n,n._pack_prev=e}function Si(t,e){t._pack_next=e,e._pack_prev=t}function Ti(t,e){var n=e.x-t.x,r=e.y-t.y,i=t.r+e.r;return.999*i*i>n*n+r*r}function zi(t){function e(t){c=Math.min(t.x-t.r,c),f=Math.max(t.x+t.r,f),h=Math.min(t.y-t.r,h),d=Math.max(t.y+t.r,d)}if((n=t.children)&&(u=n.length)){var n,r,i,a,o,s,l,u,c=1/0,f=-(1/0),h=1/0,d=-(1/0);if(n.forEach(Ei),r=n[0],r.x=-r.r,r.y=0,e(r),u>1&&(i=n[1],i.x=i.r,i.y=0,e(i),u>2))for(a=n[2],Di(r,i,a),e(a),Ai(r,a),r._pack_prev=a,Ai(a,i),i=r._pack_next,o=3;o=0;)e=i[a],e.z+=n,e.m+=n,n+=e.s+(r+=e.c)}function ji(t,e,n){return t.a.parent===e.parent?t.a:n}function Ni(t){return 1+uo.max(t,function(t){return t.y})}function Bi(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}function qi(t){var e=t.children;return e&&e.length?qi(e[0]):t}function Vi(t){var e,n=t.children;return n&&(e=n.length)?Vi(n[e-1]):t}function Ui(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Gi(t,e){var n=t.x+e[3],r=t.y+e[0],i=t.dx-e[1]-e[3],a=t.dy-e[0]-e[2];return i<0&&(n+=i/2,i=0),a<0&&(r+=a/2,a=0),{x:n,y:r,dx:i,dy:a}}function Hi(t){var e=t[0],n=t[t.length-1];return e2?Qi:Xi,l=r?Jr:Qr;return o=i(t,e,l,n),s=i(e,t,l,br),a}function a(t){return o(t)}var o,s;return a.invert=function(t){return s(t)},a.domain=function(e){return arguments.length?(t=e.map(Number),i()):t},a.range=function(t){return arguments.length?(e=t,i()):e},a.rangeRound=function(t){return a.range(t).interpolate(Nr)},a.clamp=function(t){return arguments.length?(r=t,i()):r},a.interpolate=function(t){return arguments.length?(n=t,i()):n},a.ticks=function(e){return ea(t,e)},a.tickFormat=function(e,n){return na(t,e,n)},a.nice=function(e){return Ki(t,e),i()},a.copy=function(){return Ji(t,e,n,r)},i()}function $i(t,e){return uo.rebind(t,e,"range","rangeRound","interpolate","clamp")}function Ki(t,e){return Yi(t,Wi(ta(t,e)[2])),Yi(t,Wi(ta(t,e)[2])),t}function ta(t,e){null==e&&(e=10);var n=Hi(t),r=n[1]-n[0],i=Math.pow(10,Math.floor(Math.log(r/e)/Math.LN10)),a=e/r*i;return a<=.15?i*=10:a<=.35?i*=5:a<=.75&&(i*=2),n[0]=Math.ceil(n[0]/i)*i,n[1]=Math.floor(n[1]/i)*i+.5*i,n[2]=i,n}function ea(t,e){return uo.range.apply(uo,ta(t,e))}function na(t,e,n){var r=ta(t,e);if(n){var i=hs.exec(n);if(i.shift(),"s"===i[8]){var a=uo.formatPrefix(Math.max(_o(r[0]),_o(r[1])));return i[7]||(i[7]="."+ra(a.scale(r[2]))),i[8]="f",n=uo.format(i.join("")),function(t){return n(a.scale(t))+a.symbol}}i[7]||(i[7]="."+ia(i[8],r)),n=i.join("")}else n=",."+ra(r[2])+"f";return uo.format(n)}function ra(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}function ia(t,e){var n=ra(e[2]);return t in Al?Math.abs(n-ra(Math.max(_o(e[0]),_o(e[1]))))+ +("e"!==t):n-2*("%"===t)}function aa(t,e,n,r){function i(t){return(n?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(e)}function a(t){return n?Math.pow(e,t):-Math.pow(e,-t)}function o(e){return t(i(e))}return o.invert=function(e){return a(t.invert(e))},o.domain=function(e){return arguments.length?(n=e[0]>=0,t.domain((r=e.map(Number)).map(i)),o):r},o.base=function(n){return arguments.length?(e=+n,t.domain(r.map(i)),o):e},o.nice=function(){var e=Yi(r.map(i),n?Math:Tl);return t.domain(e),r=e.map(a),o},o.ticks=function(){var t=Hi(r),o=[],s=t[0],l=t[1],u=Math.floor(i(s)),c=Math.ceil(i(l)),f=e%1?2:e;if(isFinite(c-u)){if(n){for(;u0;h--)o.push(a(u)*h);for(u=0;o[u]l;c--);o=o.slice(u,c)}return o},o.tickFormat=function(t,n){if(!arguments.length)return Sl;arguments.length<2?n=Sl:"function"!=typeof n&&(n=uo.format(n));var r=Math.max(1,e*t/o.ticks().length);return function(t){var o=t/a(Math.round(i(t)));return o*e0?s[n-1]:t[0],n0?0:1}function _a(t,e,n,r,i){var a=t[0]-e[0],o=t[1]-e[1],s=(i?r:-r)/Math.sqrt(a*a+o*o),l=s*o,u=-s*a,c=t[0]+l,f=t[1]+u,h=e[0]+l,d=e[1]+u,p=(c+h)/2,m=(f+d)/2,g=h-c,v=d-f,y=g*g+v*v,x=n-r,_=c*d-h*f,b=(v<0?-1:1)*Math.sqrt(Math.max(0,x*x*y-_*_)),w=(_*v-g*b)/y,M=(-_*g-v*b)/y,k=(_*v+g*b)/y,A=(-_*g+v*b)/y,S=w-p,T=M-m,z=k-p,E=A-m;return S*S+T*T>z*z+E*E&&(w=k,M=A),[[w-l,M-u],[w*n/x,M*n/x]]}function ba(t){function e(e){function o(){u.push("M",a(t(c),s))}for(var l,u=[],c=[],f=-1,h=e.length,d=zt(n),p=zt(r);++f1?t.join("L"):t+"Z"}function Ma(t){return t.join("L")+"Z"}function ka(t){for(var e=0,n=t.length,r=t[0],i=[r[0],",",r[1]];++e1&&i.push("H",r[0]),i.join("")}function Aa(t){for(var e=0,n=t.length,r=t[0],i=[r[0],",",r[1]];++e1){s=e[1],a=t[l],l++,r+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(a[0]-s[0])+","+(a[1]-s[1])+","+a[0]+","+a[1];for(var u=2;u9&&(i=3*e/Math.sqrt(i),o[s]=i*n,o[s+1]=i*r));for(s=-1;++s<=l;)i=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),a.push([i||0,o[s]*i||0]);return a}function qa(t){return t.length<3?wa(t):t[0]+La(t,Ba(t))}function Va(t){for(var e,n,r,i=-1,a=t.length;++i0;)d[--s].call(t,o);if(a>=1)return m.event&&m.event.end.call(t,t.__data__,e),--p.count?delete p[r]:delete t[n],1}var l,u,c,h,d,p=t[n]||(t[n]={active:0,count:0}),m=p[r];m||(l=i.time,u=Pt(a,0,l),m=p[r]={tween:new f,time:l,timer:u,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++p.count)}function no(t,e,n){t.attr("transform",function(t){var r=e(t);return"translate("+(isFinite(r)?r:n(t))+",0)"})}function ro(t,e,n){t.attr("transform",function(t){var r=e(t);return"translate(0,"+(isFinite(r)?r:n(t))+")"})}function io(t){return t.toISOString()}function ao(t,e,n){function r(e){return t(e)}function i(t,n){var r=t[1]-t[0],i=r/n,a=uo.bisect($l,i);return a==$l.length?[e.year,ta(t.map(function(t){return t/31536e6}),n)[2]]:a?e[i/$l[a-1]<$l[a]/i?a-1:a]:[eu,ta(t,n)[2]]}return r.invert=function(e){return oo(t.invert(e))},r.domain=function(e){return arguments.length?(t.domain(e),r):t.domain().map(oo)},r.nice=function(t,e){function n(n){return!isNaN(n)&&!t.range(n,oo(+n+1),e).length}var a=r.domain(),o=Hi(a),s=null==t?i(o,10):"number"==typeof t&&i(o,t);return s&&(t=s[0],e=s[1]),r.domain(Yi(a,e>1?{floor:function(e){for(;n(e=t.floor(e));)e=oo(e-1);return e},ceil:function(e){for(;n(e=t.ceil(e));)e=oo(+e+1);return e}}:t))},r.ticks=function(t,e){var n=Hi(r.domain()),a=null==t?i(n,10):"number"==typeof t?i(n,t):!t.range&&[{range:t},e];return a&&(t=a[0],e=a[1]),t.range(n[0],oo(+n[1]+1),e<1?1:e)},r.tickFormat=function(){return n},r.copy=function(){return ao(t.copy(),e,n)},$i(r,t)}function oo(t){return new Date(t)}function so(t){return JSON.parse(t.responseText)}function lo(t){var e=ho.createRange();return e.selectNode(ho.body),e.createContextualFragment(t.responseText)}var uo={version:"3.5.17"},co=[].slice,fo=function(t){return co.call(t)},ho=this.document;if(ho)try{fo(ho.documentElement.childNodes)[0].nodeType}catch(t){fo=function(t){for(var e=t.length,n=new Array(e);e--;)n[e]=t[e];return n}}if(Date.now||(Date.now=function(){return+new Date}),ho)try{ho.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var po=this.Element.prototype,mo=po.setAttribute,go=po.setAttributeNS,vo=this.CSSStyleDeclaration.prototype,yo=vo.setProperty;po.setAttribute=function(t,e){mo.call(this,t,e+"")},po.setAttributeNS=function(t,e,n){go.call(this,t,e,n+"")},vo.setProperty=function(t,e,n){yo.call(this,t,e+"",n)}}uo.ascending=i,uo.descending=function(t,e){return et?1:e>=t?0:NaN},uo.min=function(t,e){var n,r,i=-1,a=t.length;if(1===arguments.length){for(;++i=r){n=r;break}for(;++ir&&(n=r)}else{for(;++i=r){n=r;break}for(;++ir&&(n=r)}return n},uo.max=function(t,e){var n,r,i=-1,a=t.length;if(1===arguments.length){for(;++i=r){n=r;break}for(;++in&&(n=r)}else{for(;++i=r){n=r;break}for(;++in&&(n=r)}return n},uo.extent=function(t,e){var n,r,i,a=-1,o=t.length;if(1===arguments.length){for(;++a=r){n=i=r;break}for(;++ar&&(n=r),i=r){n=i=r;break}for(;++ar&&(n=r),i1)return l/(c-1)},uo.deviation=function(){var t=uo.variance.apply(this,arguments);return t?Math.sqrt(t):t};var xo=s(i);uo.bisectLeft=xo.left,uo.bisect=uo.bisectRight=xo.right,uo.bisector=function(t){return s(1===t.length?function(e,n){return i(t(e),n)}:t)},uo.shuffle=function(t,e,n){(a=arguments.length)<3&&(n=t.length,a<2&&(e=0));for(var r,i,a=n-e;a;)i=Math.random()*a--|0,r=t[a+e],t[a+e]=t[i+e],t[i+e]=r;return t},uo.permute=function(t,e){for(var n=e.length,r=new Array(n);n--;)r[n]=t[e[n]];return r},uo.pairs=function(t){for(var e,n=0,r=t.length-1,i=t[0],a=new Array(r<0?0:r);n=0;)for(r=t[i],e=r.length;--e>=0;)n[--o]=r[e];return n};var _o=Math.abs;uo.range=function(t,e,n){if(arguments.length<3&&(n=1,arguments.length<2&&(e=t,t=0)),(e-t)/n===1/0)throw new Error("infinite range");var r,i=[],a=u(_o(n)),o=-1;if(t*=a,e*=a,n*=a,n<0)for(;(r=t+n*++o)>e;)i.push(r/a);else for(;(r=t+n*++o)=a.length)return r?r.call(i,o):n?o.sort(n):o;for(var l,u,c,h,d=-1,p=o.length,m=a[s++],g=new f;++d=a.length)return t;var r=[],i=o[n++];return t.forEach(function(t,i){r.push({key:t,values:e(i,n)})}),i?r.sort(function(t,e){return i(t.key,e.key)}):r}var n,r,i={},a=[],o=[];return i.map=function(e,n){return t(n,e,0)},i.entries=function(n){return e(t(uo.map,n,0),0)},i.key=function(t){return a.push(t),i},i.sortKeys=function(t){return o[a.length-1]=t,i},i.sortValues=function(t){return n=t,i},i.rollup=function(t){return r=t,i},i},uo.set=function(t){var e=new x;if(t)for(var n=0,r=t.length;n=0&&(r=t.slice(n+1),t=t.slice(0,n)),t)return arguments.length<2?this[t].on(r):this[t].on(r,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(r,null);return this}},uo.event=null,uo.requote=function(t){return t.replace(ko,"\\$&")};var ko=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,Ao={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var n in e)t[n]=e[n]},So=function(t,e){return e.querySelector(t)},To=function(t,e){return e.querySelectorAll(t)},zo=function(t,e){var n=t.matches||t[w(t,"matchesSelector")];return(zo=function(t,e){return n.call(t,e)})(t,e)};"function"==typeof Sizzle&&(So=function(t,e){return Sizzle(t,e)[0]||null},To=Sizzle,zo=Sizzle.matchesSelector),uo.selection=function(){return uo.select(ho.documentElement)};var Eo=uo.selection.prototype=[];Eo.select=function(t){var e,n,r,i,a=[];t=L(t);for(var o=-1,s=this.length;++o=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),Io.hasOwnProperty(n)?{space:Io[n],local:t}:t}},Eo.attr=function(t,e){if(arguments.length<2){ if("string"==typeof t){var n=this.node();return t=uo.ns.qualify(t),t.local?n.getAttributeNS(t.space,t.local):n.getAttribute(t)}for(e in t)this.each(D(e,t[e]));return this}return this.each(D(t,e))},Eo.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node(),r=(t=O(t)).length,i=-1;if(e=n.classList){for(;++i=0;)(n=r[i])&&(a&&a!==n.nextSibling&&a.parentNode.insertBefore(n,a),a=n);return this},Eo.sort=function(t){t=G.apply(this,arguments);for(var e=-1,n=this.length;++e0&&(e=e.transition().duration(E)),e.call(t.event)}function s(){b&&b.domain(_.range().map(function(t){return(t-k.x)/k.k}).map(_.invert)),M&&M.domain(w.range().map(function(t){return(t-k.y)/k.k}).map(w.invert))}function l(t){L++||t({type:"zoomstart"})}function u(t){s(),t({type:"zoom",scale:k.k,translate:[k.x,k.y]})}function c(t){--L||(t({type:"zoomend"}),g=null)}function f(){function t(){s=1,a(uo.mouse(i),h),u(o)}function n(){f.on(D,null).on(P,null),d(s),c(o)}var i=this,o=O.of(i,arguments),s=0,f=uo.select(r(i)).on(D,t).on(P,n),h=e(uo.mouse(i)),d=J(i);Vl.call(i),l(o)}function h(){function t(){var t=uo.touches(p);return d=k.k,t.forEach(function(t){t.identifier in g&&(g[t.identifier]=e(t))}),t}function n(){var e=uo.event.target;uo.select(e).on(_,r).on(b,s),w.push(e);for(var n=uo.event.changedTouches,i=0,a=n.length;i1){var c=l[0],f=l[1],h=c[0]-f[0],d=c[1]-f[1];v=h*h+d*d}}function r(){var t,e,n,r,o=uo.touches(p);Vl.call(p);for(var s=0,l=o.length;s=u)return o;if(i)return i=!1,a;var e=c;if(34===t.charCodeAt(e)){for(var n=e;n++=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,ds=uo.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(t,e){return(t=uo.round(t,Rt(t,e))).toFixed(Math.max(0,Math.min(20,Rt(t*(1+1e-15),e))))}}),ps=uo.time={},ms=Date;qt.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){gs.setUTCDate.apply(this._,arguments)},setDay:function(){gs.setUTCDay.apply(this._,arguments)},setFullYear:function(){gs.setUTCFullYear.apply(this._,arguments)},setHours:function(){gs.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){gs.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){gs.setUTCMinutes.apply(this._,arguments)},setMonth:function(){gs.setUTCMonth.apply(this._,arguments)},setSeconds:function(){gs.setUTCSeconds.apply(this._,arguments)},setTime:function(){gs.setTime.apply(this._,arguments)}};var gs=Date.prototype;ps.year=Vt(function(t){return t=ps.day(t),t.setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),ps.years=ps.year.range,ps.years.utc=ps.year.utc.range,ps.day=Vt(function(t){var e=new ms(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),ps.days=ps.day.range,ps.days.utc=ps.day.utc.range,ps.dayOfYear=function(t){var e=ps.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,e){e=7-e;var n=ps[t]=Vt(function(t){return(t=ps.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var n=ps.year(t).getDay();return Math.floor((ps.dayOfYear(t)+(n+e)%7)/7)-(n!==e)});ps[t+"s"]=n.range,ps[t+"s"].utc=n.utc.range,ps[t+"OfYear"]=function(t){var n=ps.year(t).getDay();return Math.floor((ps.dayOfYear(t)+(n+e)%7)/7)}}),ps.week=ps.sunday,ps.weeks=ps.sunday.range,ps.weeks.utc=ps.sunday.utc.range,ps.weekOfYear=ps.sundayOfYear;var vs={"-":"",_:" ",0:"0"},ys=/^\s*\d+/,xs=/^%/;uo.locale=function(t){return{numberFormat:Nt(t),timeFormat:Gt(t)}};var _s=uo.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});uo.format=_s.numberFormat,uo.geo={},fe.prototype={s:0,t:0,add:function(t){he(t,this.t,bs),he(bs.s,this.s,this),this.s?this.t+=bs.t:this.s=bs.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var bs=new fe;uo.geo.stream=function(t,e){t&&ws.hasOwnProperty(t.type)?ws[t.type](t,e):de(t,e)};var ws={Feature:function(t,e){de(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++rd&&(d=e)}function e(e,n){var r=ve([e*Uo,n*Uo]);if(v){var i=xe(v,r),a=[i[1],-i[0],0],o=xe(a,i);we(o),o=Me(o);var l=e-p,u=l>0?1:-1,m=o[0]*Go*u,g=_o(l)>180;if(g^(u*pd&&(d=y)}else if(m=(m+360)%360-180,g^(u*pd&&(d=n);g?es(c,h)&&(h=e):s(e,h)>s(c,h)&&(c=e):h>=c?(eh&&(h=e)):e>p?s(c,e)>s(c,h)&&(h=e):s(e,h)>s(c,h)&&(c=e)}else t(e,n);v=r,p=e}function n(){b.point=e}function r(){_[0]=c,_[1]=h,b.point=t,v=null}function i(t,n){if(v){var r=t-p;y+=_o(r)>180?r+(r>0?360:-360):r}else m=t,g=n;Ss.point(t,n),e(t,n)}function a(){Ss.lineStart()}function o(){i(m,g),Ss.lineEnd(),_o(y)>Ro&&(c=-(h=180)),_[0]=c,_[1]=h,v=null}function s(t,e){return(e-=t)<0?e+360:e}function l(t,e){return t[0]-e[0]}function u(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:tRo?d=90:y<-Ro&&(f=-90),_[0]=c,_[1]=h}};return function(t){d=h=-(c=f=1/0),x=[],uo.geo.stream(t,b);var e=x.length;if(e){x.sort(l);for(var n,r=1,i=x[0],a=[i];rs(i[0],i[1])&&(i[1]=n[1]),s(n[0],i[1])>s(i[0],i[1])&&(i[0]=n[0])):a.push(i=n);for(var o,n,p=-(1/0),e=a.length-1,r=0,i=a[e];r<=e;i=n,++r)n=a[r],(o=s(i[1],n[0]))>p&&(p=o,c=n[0],h=i[1])}return x=_=null,c===1/0||f===1/0?[[NaN,NaN],[NaN,NaN]]:[[c,f],[h,d]]}}(),uo.geo.centroid=function(t){Ts=zs=Es=Ls=Is=Ds=Ps=Cs=Os=Fs=Rs=0,uo.geo.stream(t,js);var e=Os,n=Fs,r=Rs,i=e*e+n*n+r*r;return i=.12&&i<.234&&r>=-.425&&r<-.214?o:i>=.166&&i<.234&&r>=-.214&&r<-.115?s:a).invert(t)},t.stream=function(t){var e=a.stream(t),n=o.stream(t),r=s.stream(t);return{point:function(t,i){e.point(t,i),n.point(t,i),r.point(t,i)},sphere:function(){e.sphere(),n.sphere(),r.sphere()},lineStart:function(){e.lineStart(),n.lineStart(),r.lineStart()},lineEnd:function(){e.lineEnd(),n.lineEnd(),r.lineEnd()},polygonStart:function(){e.polygonStart(),n.polygonStart(),r.polygonStart()},polygonEnd:function(){e.polygonEnd(),n.polygonEnd(),r.polygonEnd()}}},t.precision=function(e){return arguments.length?(a.precision(e),o.precision(e),s.precision(e),t):a.precision()},t.scale=function(e){return arguments.length?(a.scale(e),o.scale(.35*e),s.scale(e),t.translate(a.translate())):a.scale()},t.translate=function(e){if(!arguments.length)return a.translate();var u=a.scale(),c=+e[0],f=+e[1];return n=a.translate(e).clipExtent([[c-.455*u,f-.238*u],[c+.455*u,f+.238*u]]).stream(l).point,r=o.translate([c-.307*u,f+.201*u]).clipExtent([[c-.425*u+Ro,f+.12*u+Ro],[c-.214*u-Ro,f+.234*u-Ro]]).stream(l).point,i=s.translate([c-.205*u,f+.212*u]).clipExtent([[c-.214*u+Ro,f+.166*u+Ro],[c-.115*u-Ro,f+.234*u-Ro]]).stream(l).point,t},t.scale(1070)};var qs,Vs,Us,Gs,Hs,Zs,Xs={point:M,lineStart:M,lineEnd:M,polygonStart:function(){Vs=0,Xs.lineStart=Ye},polygonEnd:function(){Xs.lineStart=Xs.lineEnd=Xs.point=M,qs+=_o(Vs/2)}},Ys={point:We,lineStart:M,lineEnd:M,polygonStart:M,polygonEnd:M},Ws={point:$e,lineStart:Ke,lineEnd:tn,polygonStart:function(){Ws.lineStart=en},polygonEnd:function(){Ws.point=$e,Ws.lineStart=Ke,Ws.lineEnd=tn}};uo.geo.path=function(){function t(t){return t&&("function"==typeof s&&a.pointRadius(+s.apply(this,arguments)),o&&o.valid||(o=i(a)),uo.geo.stream(t,o)),a.result()}function e(){return o=null,t}var n,r,i,a,o,s=4.5;return t.area=function(t){return qs=0,uo.geo.stream(t,i(Xs)),qs},t.centroid=function(t){return Es=Ls=Is=Ds=Ps=Cs=Os=Fs=Rs=0,uo.geo.stream(t,i(Ws)),Rs?[Os/Rs,Fs/Rs]:Cs?[Ds/Cs,Ps/Cs]:Is?[Es/Is,Ls/Is]:[NaN,NaN]},t.bounds=function(t){return Hs=Zs=-(Us=Gs=1/0),uo.geo.stream(t,i(Ys)),[[Us,Gs],[Hs,Zs]]},t.projection=function(t){return arguments.length?(i=(n=t)?t.stream||an(t):_,e()):n},t.context=function(t){return arguments.length?(a=null==(r=t)?new Qe:new nn(t),"function"!=typeof s&&a.pointRadius(s),e()):r},t.pointRadius=function(e){return arguments.length?(s="function"==typeof e?e:(a.pointRadius(+e),+e),t):s},t.projection(uo.geo.albersUsa()).context(null)},uo.geo.transform=function(t){return{stream:function(e){var n=new on(e);for(var r in t)n[r]=t[r];return n}}},on.prototype={point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},uo.geo.projection=ln,uo.geo.projectionMutator=un,(uo.geo.equirectangular=function(){return ln(fn)}).raw=fn.invert=fn,uo.geo.rotation=function(t){function e(e){return e=t(e[0]*Uo,e[1]*Uo),e[0]*=Go,e[1]*=Go,e}return t=dn(t[0]%360*Uo,t[1]*Uo,t.length>2?t[2]*Uo:0),e.invert=function(e){return e=t.invert(e[0]*Uo,e[1]*Uo),e[0]*=Go,e[1]*=Go,e},e},hn.invert=fn,uo.geo.circle=function(){function t(){var t="function"==typeof r?r.apply(this,arguments):r,e=dn(-t[0]*Uo,-t[1]*Uo,0).invert,i=[];return n(null,null,1,{point:function(t,n){i.push(t=e(t,n)),t[0]*=Go,t[1]*=Go}}),{type:"Polygon",coordinates:[i]}}var e,n,r=[0,0],i=6;return t.origin=function(e){return arguments.length?(r=e,t):r},t.angle=function(r){return arguments.length?(n=vn((e=+r)*Uo,i*Uo),t):e},t.precision=function(r){return arguments.length?(n=vn(e*Uo,(i=+r)*Uo),t):i},t.angle(90)},uo.geo.distance=function(t,e){var n,r=(e[0]-t[0])*Uo,i=t[1]*Uo,a=e[1]*Uo,o=Math.sin(r),s=Math.cos(r),l=Math.sin(i),u=Math.cos(i),c=Math.sin(a),f=Math.cos(a);return Math.atan2(Math.sqrt((n=f*o)*n+(n=u*c-l*f*s)*n),l*c+u*f*s)},uo.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:e()}}function e(){return uo.range(Math.ceil(a/g)*g,i,g).map(h).concat(uo.range(Math.ceil(u/v)*v,l,v).map(d)).concat(uo.range(Math.ceil(r/p)*p,n,p).filter(function(t){return _o(t%g)>Ro}).map(c)).concat(uo.range(Math.ceil(s/m)*m,o,m).filter(function(t){return _o(t%v)>Ro}).map(f))}var n,r,i,a,o,s,l,u,c,f,h,d,p=10,m=p,g=90,v=360,y=2.5;return t.lines=function(){return e().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[h(a).concat(d(l).slice(1),h(i).reverse().slice(1),d(u).reverse().slice(1))]}},t.extent=function(e){return arguments.length?t.majorExtent(e).minorExtent(e):t.minorExtent()},t.majorExtent=function(e){return arguments.length?(a=+e[0][0],i=+e[1][0],u=+e[0][1],l=+e[1][1],a>i&&(e=a,a=i,i=e),u>l&&(e=u,u=l,l=e),t.precision(y)):[[a,u],[i,l]]},t.minorExtent=function(e){return arguments.length?(r=+e[0][0],n=+e[1][0],s=+e[0][1],o=+e[1][1],r>n&&(e=r,r=n,n=e),s>o&&(e=s,s=o,o=e),t.precision(y)):[[r,s],[n,o]]},t.step=function(e){return arguments.length?t.majorStep(e).minorStep(e):t.minorStep()},t.majorStep=function(e){return arguments.length?(g=+e[0],v=+e[1],t):[g,v]},t.minorStep=function(e){return arguments.length?(p=+e[0],m=+e[1],t):[p,m]},t.precision=function(e){return arguments.length?(y=+e,c=xn(s,o,90),f=_n(r,n,y),h=xn(u,l,90),d=_n(a,i,y),t):y},t.majorExtent([[-180,-90+Ro],[180,90-Ro]]).minorExtent([[-180,-80-Ro],[180,80+Ro]])},uo.geo.greatArc=function(){function t(){return{type:"LineString",coordinates:[e||r.apply(this,arguments),n||i.apply(this,arguments)]}}var e,n,r=bn,i=wn;return t.distance=function(){return uo.geo.distance(e||r.apply(this,arguments),n||i.apply(this,arguments))},t.source=function(n){return arguments.length?(r=n,e="function"==typeof n?null:n,t):r},t.target=function(e){return arguments.length?(i=e,n="function"==typeof e?null:e,t):i},t.precision=function(){return arguments.length?t:0},t},uo.geo.interpolate=function(t,e){return Mn(t[0]*Uo,t[1]*Uo,e[0]*Uo,e[1]*Uo)},uo.geo.length=function(t){return Qs=0,uo.geo.stream(t,Js),Qs};var Qs,Js={sphere:M,point:M,lineStart:kn,lineEnd:M,polygonStart:M,polygonEnd:M},$s=An(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(uo.geo.azimuthalEqualArea=function(){return ln($s)}).raw=$s;var Ks=An(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},_);(uo.geo.azimuthalEquidistant=function(){return ln(Ks)}).raw=Ks,(uo.geo.conicConformal=function(){return Ze(Sn)}).raw=Sn,(uo.geo.conicEquidistant=function(){return Ze(Tn)}).raw=Tn;var tl=An(function(t){return 1/t},Math.atan);(uo.geo.gnomonic=function(){return ln(tl)}).raw=tl,zn.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Vo]},(uo.geo.mercator=function(){return En(zn)}).raw=zn;var el=An(function(){return 1},Math.asin);(uo.geo.orthographic=function(){return ln(el)}).raw=el;var nl=An(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(uo.geo.stereographic=function(){return ln(nl)}).raw=nl,Ln.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Vo]},(uo.geo.transverseMercator=function(){var t=En(Ln),e=t.center,n=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):(t=e(), [t[1],-t[0]])},t.rotate=function(t){return t?n([t[0],t[1],t.length>2?t[2]+90:90]):(t=n(),[t[0],t[1],t[2]-90])},n([0,0,90])}).raw=Ln,uo.geom={},uo.geom.hull=function(t){function e(t){if(t.length<3)return[];var e,i=zt(n),a=zt(r),o=t.length,s=[],l=[];for(e=0;e=0;--e)d.push(t[s[u[e]][2]]);for(e=+f;e=r&&u.x<=a&&u.y>=i&&u.y<=o?[[r,o],[a,o],[a,i],[r,i]]:[];c.point=t[s]}),e}function n(t){return t.map(function(t,e){return{x:Math.round(a(t,e)/Ro)*Ro,y:Math.round(o(t,e)/Ro)*Ro,i:e}})}var r=In,i=Dn,a=r,o=i,s=fl;return t?e(t):(e.links=function(t){return ur(n(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},e.triangles=function(t){var e=[];return ur(n(t)).cells.forEach(function(n,r){for(var i,a,o=n.site,s=n.edges.sort(Xn),l=-1,u=s.length,c=s[u-1].edge,f=c.l===o?c.r:c.l;++l=u,h=r>=c,d=h<<1|f;t.leaf=!1,t=t.nodes[d]||(t.nodes[d]=pr()),f?i=u:s=u,h?o=c:l=c,a(t,e,n,r,i,o,s,l)}var c,f,h,d,p,m,g,v,y,x=zt(s),_=zt(l);if(null!=e)m=e,g=n,v=r,y=i;else if(v=y=-(m=g=1/0),f=[],h=[],p=t.length,o)for(d=0;dv&&(v=c.x),c.y>y&&(y=c.y),f.push(c.x),h.push(c.y);else for(d=0;dv&&(v=b),w>y&&(y=w),f.push(b),h.push(w)}var M=v-m,k=y-g;M>k?y=g+M:v=m+k;var A=pr();if(A.add=function(t){a(A,t,+x(t,++d),+_(t,d),m,g,v,y)},A.visit=function(t){mr(t,A,m,g,v,y)},A.find=function(t){return gr(A,t[0],t[1],m,g,v,y)},d=-1,null==e){for(;++d=0?t.slice(0,e):t,r=e>=0?t.slice(e+1):"in";return n=ml.get(n)||pl,r=gl.get(r)||_,Mr(r(n.apply(null,co.call(arguments,1))))},uo.interpolateHcl=Fr,uo.interpolateHsl=Rr,uo.interpolateLab=jr,uo.interpolateRound=Nr,uo.transform=function(t){var e=ho.createElementNS(uo.ns.prefix.svg,"g");return(uo.transform=function(t){if(null!=t){e.setAttribute("transform",t);var n=e.transform.baseVal.consolidate()}return new Br(n?n.matrix:vl)})(t)},Br.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var vl={a:1,b:0,c:0,d:1,e:0,f:0};uo.interpolateTransform=Wr,uo.layout={},uo.layout.bundle=function(){return function(t){for(var e=[],n=-1,r=t.length;++n0?i=t:(n.c=null,n.t=NaN,n=null,u.end({type:"end",alpha:i=0})):t>0&&(u.start({type:"start",alpha:i=t}),n=Pt(l.tick)),l):i},l.start=function(){function t(t,r){if(!n){for(n=new Array(i),l=0;l=0;)o.push(c=u[l]),c.parent=a,c.depth=a.depth+1;r&&(a.value=0),a.children=u}else r&&(a.value=+r.call(t,a,a.depth)||0),delete a.children;return li(i,function(t){var n,i;e&&(n=t.children)&&n.sort(e),r&&(i=t.parent)&&(i.value+=t.value)}),s}var e=fi,n=ui,r=ci;return t.sort=function(n){return arguments.length?(e=n,t):e},t.children=function(e){return arguments.length?(n=e,t):n},t.value=function(e){return arguments.length?(r=e,t):r},t.revalue=function(e){return r&&(si(e,function(t){t.children&&(t.value=0)}),li(e,function(e){var n;e.children||(e.value=+r.call(t,e,e.depth)||0),(n=e.parent)&&(n.value+=e.value)})),e},t},uo.layout.partition=function(){function t(e,n,r,i){var a=e.children;if(e.x=n,e.y=e.depth*i,e.dx=r,e.dy=i,a&&(o=a.length)){var o,s,l,u=-1;for(r=e.value?r/e.value:0;++us&&(s=r),o.push(r)}for(n=0;n0)for(a=-1;++a=c[0]&&s<=c[1]&&(o=l[uo.bisect(f,s,1,d)-1],o.y+=p,o.push(t[a]));return l}var e=!0,n=Number,r=Mi,i=bi;return t.value=function(e){return arguments.length?(n=e,t):n},t.range=function(e){return arguments.length?(r=zt(e),t):r},t.bins=function(e){return arguments.length?(i="number"==typeof e?function(t){return wi(t,e)}:zt(e),t):i},t.frequency=function(n){return arguments.length?(e=!!n,t):e},t},uo.layout.pack=function(){function t(t,a){var o=n.call(this,t,a),s=o[0],l=i[0],u=i[1],c=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,li(s,function(t){t.r=+c(t.value)}),li(s,zi),r){var f=r*(e?1:Math.max(2*s.r/l,2*s.r/u))/2;li(s,function(t){t.r+=f}),li(s,zi),li(s,function(t){t.r-=f})}return Ii(s,l/2,u/2,e?1:1/Math.max(2*s.r/l,2*s.r/u)),o}var e,n=uo.layout.hierarchy().sort(ki),r=0,i=[1,1];return t.size=function(e){return arguments.length?(i=e,t):i},t.radius=function(n){return arguments.length?(e=null==n||"function"==typeof n?n:+n,t):e},t.padding=function(e){return arguments.length?(r=+e,t):r},oi(t,n)},uo.layout.tree=function(){function t(t,i){var c=o.call(this,t,i),f=c[0],h=e(f);if(li(h,n),h.parent.m=-h.z,si(h,r),u)si(f,a);else{var d=f,p=f,m=f;si(f,function(t){t.xp.x&&(p=t),t.depth>m.depth&&(m=t)});var g=s(d,p)/2-d.x,v=l[0]/(p.x+s(p,d)/2+g),y=l[1]/(m.depth||1);si(f,function(t){t.x=(t.x+g)*v,t.y=t.depth*y})}return c}function e(t){for(var e,n={A:null,children:[t]},r=[n];null!=(e=r.pop());)for(var i,a=e.children,o=0,s=a.length;o0&&(Fi(ji(o,t,n),t,r),u+=r,c+=r),f+=o.m,u+=i.m,h+=l.m,c+=a.m;o&&!Oi(a)&&(a.t=o,a.m+=f-c),i&&!Ci(l)&&(l.t=i,l.m+=u-h,n=t)}return n}function a(t){t.x*=l[0],t.y=t.depth*l[1]}var o=uo.layout.hierarchy().sort(null).value(null),s=Pi,l=[1,1],u=null;return t.separation=function(e){return arguments.length?(s=e,t):s},t.size=function(e){return arguments.length?(u=null==(l=e)?a:null,t):u?null:l},t.nodeSize=function(e){return arguments.length?(u=null==(l=e)?null:a,t):u?l:null},oi(t,o)},uo.layout.cluster=function(){function t(t,a){var o,s=e.call(this,t,a),l=s[0],u=0;li(l,function(t){var e=t.children;e&&e.length?(t.x=Bi(e),t.y=Ni(e)):(t.x=o?u+=n(t,o):0,t.y=0,o=t)});var c=qi(l),f=Vi(l),h=c.x-n(c,f)/2,d=f.x+n(f,c)/2;return li(l,i?function(t){t.x=(t.x-l.x)*r[0],t.y=(l.y-t.y)*r[1]}:function(t){t.x=(t.x-h)/(d-h)*r[0],t.y=(1-(l.y?t.y/l.y:1))*r[1]}),s}var e=uo.layout.hierarchy().sort(null).value(null),n=Pi,r=[1,1],i=!1;return t.separation=function(e){return arguments.length?(n=e,t):n},t.size=function(e){return arguments.length?(i=null==(r=e),t):i?null:r},t.nodeSize=function(e){return arguments.length?(i=null!=(r=e),t):i?r:null},oi(t,e)},uo.layout.treemap=function(){function t(t,e){for(var n,r,i=-1,a=t.length;++i0;)c.push(o=h[l-1]),c.area+=o.area,"squarify"!==d||(s=r(c,m))<=p?(h.pop(),p=s):(c.area-=c.pop().area,i(c,m,u,!1),m=Math.min(u.dx,u.dy),c.length=c.area=0,p=1/0);c.length&&(i(c,m,u,!0),c.length=c.area=0),a.forEach(e)}}function n(e){var r=e.children;if(r&&r.length){var a,o=f(e),s=r.slice(),l=[];for(t(s,o.dx*o.dy/e.value),l.area=0;a=s.pop();)l.push(a),l.area+=a.area,null!=a.z&&(i(l,a.z?o.dx:o.dy,o,!s.length),l.length=l.area=0);r.forEach(n)}}function r(t,e){for(var n,r=t.area,i=0,a=1/0,o=-1,s=t.length;++oi&&(i=n));return r*=r,e*=e,r?Math.max(e*i*p/r,r/(e*a*p)):1/0}function i(t,e,n,r){var i,a=-1,o=t.length,s=n.x,u=n.y,c=e?l(t.area/e):0;if(e==n.dx){for((r||c>n.dy)&&(c=n.dy);++an.dx)&&(c=n.dx);++a1);return t+e*n*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=uo.random.normal.apply(uo,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=uo.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,n=0;nf?0:1;if(u=qo)return e(u,d)+(t?e(t,1-d):"")+"Z";var p,m,g,v,y,x,_,b,w,M,k,A,S=0,T=0,z=[];if((v=(+l.apply(this,arguments)||0)/2)&&(g=a===Dl?Math.sqrt(t*t+u*u):+a.apply(this,arguments),d||(T*=-1),u&&(T=rt(g/u*Math.sin(v))),t&&(S=rt(g/t*Math.sin(v)))),u){y=u*Math.cos(c+T),x=u*Math.sin(c+T),_=u*Math.cos(f-T),b=u*Math.sin(f-T);var E=Math.abs(f-c-2*T)<=No?0:1;if(T&&xa(y,x,_,b)===d^E){var L=(c+f)/2;y=u*Math.cos(L),x=u*Math.sin(L),_=b=null}}else y=x=0;if(t){w=t*Math.cos(f-S),M=t*Math.sin(f-S),k=t*Math.cos(c+S),A=t*Math.sin(c+S);var I=Math.abs(c-f+2*S)<=No?0:1;if(S&&xa(w,M,k,A)===1-d^I){var D=(c+f)/2;w=t*Math.cos(D),M=t*Math.sin(D),k=A=null}}else w=M=0;if(h>Ro&&(p=Math.min(Math.abs(u-t)/2,+i.apply(this,arguments)))>.001){m=tNo)+",1 "+e}function i(t,e,n,r){return"Q 0,0 "+r}var a=bn,o=wn,s=Ga,l=ga,u=va;return t.radius=function(e){return arguments.length?(s=zt(e),t):s},t.source=function(e){return arguments.length?(a=zt(e),t):a},t.target=function(e){return arguments.length?(o=zt(e),t):o},t.startAngle=function(e){return arguments.length?(l=zt(e),t):l},t.endAngle=function(e){return arguments.length?(u=zt(e),t):u},t},uo.svg.diagonal=function(){function t(t,i){var a=e.call(this,t,i),o=n.call(this,t,i),s=(a.y+o.y)/2,l=[a,{x:a.x,y:s},{x:o.x,y:s},o];return l=l.map(r),"M"+l[0]+"C"+l[1]+" "+l[2]+" "+l[3]}var e=bn,n=wn,r=Ha;return t.source=function(n){return arguments.length?(e=zt(n),t):e},t.target=function(e){return arguments.length?(n=zt(e),t):n},t.projection=function(e){return arguments.length?(r=e,t):r},t},uo.svg.diagonal.radial=function(){var t=uo.svg.diagonal(),e=Ha,n=t.projection;return t.projection=function(t){return arguments.length?n(Za(e=t)):e},t},uo.svg.symbol=function(){function t(t,r){return(Rl.get(e.call(this,t,r))||Wa)(n.call(this,t,r))}var e=Ya,n=Xa;return t.type=function(n){return arguments.length?(e=zt(n),t):e},t.size=function(e){return arguments.length?(n=zt(e),t):n},t};var Rl=uo.map({circle:Wa,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*Nl)),n=e*Nl;return"M0,"+-e+"L"+n+",0 0,"+e+" "+-n+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/jl),n=e*jl/2;return"M0,"+n+"L"+e+","+-n+" "+-e+","+-n+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/jl),n=e*jl/2;return"M0,"+-n+"L"+e+","+n+" "+-e+","+n+"Z"}});uo.svg.symbolTypes=Rl.keys();var jl=Math.sqrt(3),Nl=Math.tan(30*Uo);Eo.transition=function(t){for(var e,n,r=Bl||++Gl,i=to(t),a=[],o=ql||{time:Date.now(),ease:zr,delay:0,duration:250},s=-1,l=this.length;++srect,.s>rect").attr("width",f[1]-f[0])}function i(t){t.select(".extent").attr("y",h[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",h[1]-h[0])}function a(){function a(){32==uo.event.keyCode&&(E||(x=null,I[0]-=f[1],I[1]-=h[1],E=2),S())}function m(){32==uo.event.keyCode&&2==E&&(I[0]+=f[1],I[1]+=h[1],E=0,S())}function g(){var t=uo.mouse(b),r=!1;_&&(t[0]+=_[0],t[1]+=_[1]),E||(uo.event.altKey?(x||(x=[(f[0]+f[1])/2,(h[0]+h[1])/2]),I[0]=f[+(t[0]80*n){u=h=t[0],c=d=t[1];for(var v=n;vh&&(h=p),m>d&&(d=m);g=Math.max(h-u,d-c)}return o(s,l,n,u,c,g),l}function i(t,e,n,r,i){var a,o;if(i===I(t,e,n,r)>0)for(a=e;a=e;a-=r)o=z(a,t[a],t[a+1],o);return o&&w(o,o.next)&&(E(o),o=o.next),o}function a(t,e){if(!t)return t;e||(e=t);var n,r=t;do if(n=!1,r.steiner||!w(r,r.next)&&0!==b(r.prev,r,r.next))r=r.next;else{if(E(r),r=e=r.prev,r===r.next)return null;n=!0}while(n||r!==e);return e}function o(t,e,n,r,i,f,h){if(t){!h&&f&&m(t,r,i,f);for(var d,p,g=t;t.prev!==t.next;)if(d=t.prev,p=t.next,f?l(t,r,i,f):s(t))e.push(d.i/n),e.push(t.i/n),e.push(p.i/n),E(t),t=p.next,g=p.next;else if(t=p,t===g){h?1===h?(t=u(t,e,n),o(t,e,n,r,i,f,2)):2===h&&c(t,e,n,r,i,f):o(a(t),e,n,r,i,f,1);break}}}function s(t){var e=t.prev,n=t,r=t.next;if(b(e,n,r)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(x(e.x,e.y,n.x,n.y,r.x,r.y,i.x,i.y)&&b(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function l(t,e,n,r){var i=t.prev,a=t,o=t.next;if(b(i,a,o)>=0)return!1;for(var s=i.xa.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,c=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,f=v(s,l,e,n,r),h=v(u,c,e,n,r),d=t.nextZ;d&&d.z<=h;){if(d!==t.prev&&d!==t.next&&x(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&b(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=t.prevZ;d&&d.z>=f;){if(d!==t.prev&&d!==t.next&&x(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&b(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function u(t,e,n){var r=t;do{var i=r.prev,a=r.next.next;!w(i,a)&&M(i,r,r.next,a)&&A(i,a)&&A(a,i)&&(e.push(i.i/n),e.push(r.i/n),e.push(a.i/n),E(r),E(r.next),r=t=a),r=r.next}while(r!==t);return r}function c(t,e,n,r,i,s){var l=t;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&_(l,u)){var c=T(l,u);return l=a(l,l.next),c=a(c,c.next),o(l,e,n,r,i,s),void o(c,e,n,r,i,s)}u=u.next}l=l.next}while(l!==t)}function f(t,e,n,r){var o,s,l,u,c,f=[];for(o=0,s=e.length;o=r.next.y){var s=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>o){if(o=s,s===i){if(a===r.y)return r;if(a===r.next.y)return r.next}n=r.x=r.x&&r.x>=c&&x(an.x)&&A(r,t)&&(n=r,h=l)),r=r.next;return n}function m(t,e,n,r){var i=t;do null===i.z&&(i.z=v(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,g(i)}function g(t){var e,n,r,i,a,o,s,l,u=1;do{for(n=t,t=null,a=null,o=0;n;){for(o++,r=n,s=0,e=0;e0||l>0&&r;)0===s?(i=r,r=r.nextZ,l--):0!==l&&r?n.z<=r.z?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,l--):(i=n,n=n.nextZ,s--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;n=r}a.nextZ=null,u*=2}while(o>1);return t}function v(t,e,n,r,i){return t=32767*(t-n)/i,e=32767*(e-r)/i,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function y(t){var e=t,n=t;do e.x=0&&(t-o)*(r-s)-(n-o)*(e-s)>=0&&(n-o)*(a-s)-(i-o)*(r-s)>=0}function _(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!k(t,e)&&A(t,e)&&A(e,t)&&S(t,e)}function b(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function w(t,e){return t.x===e.x&&t.y===e.y}function M(t,e,n,r){return!!(w(t,e)&&w(n,r)||w(t,r)&&w(n,e))||b(t,e,n)>0!=b(t,e,r)>0&&b(n,r,t)>0!=b(n,r,e)>0}function k(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&M(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function A(t,e){return b(t.prev,t,t.next)<0?b(t,e,t.next)>=0&&b(t,t.prev,e)>=0:b(t,e,t.prev)<0||b(t,t.next,e)<0}function S(t,e){var n=t,r=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do n.y>a!=n.next.y>a&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==t);return r}function T(t,e){var n=new L(t.i,t.x,t.y),r=new L(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function z(t,e,n,r){var i=new L(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function E(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function L(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function I(t,e,n,r){for(var i=0,a=e,o=n-r;a0&&(r+=t[i-1].length,n.holes.push(r))}return n}},{}],10:[function(e,n,r){(function(i,a){!function(e,i){"object"==typeof r&&"undefined"!=typeof n?n.exports=i():"function"==typeof t&&t.amd?t(i):e.ES6Promise=i()}(this,function(){"use strict";function t(t){return"function"==typeof t||"object"==typeof t&&null!==t}function n(t){return"function"==typeof t}function r(t){W=t}function o(t){Q=t}function s(){return function(){return i.nextTick(h)}}function l(){return function(){Y(h)}}function u(){var t=0,e=new K(h),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function c(){var t=new MessageChannel;return t.port1.onmessage=h,function(){return t.port2.postMessage(0)}}function f(){var t=setTimeout;return function(){return t(h,1)}}function h(){for(var t=0;t0&&this._events[t].length>n&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace())),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(t,e){function n(){this.removeListener(t,n),r||(r=!0,e.apply(this,arguments))}if(!i(e))throw TypeError("listener must be a function");var r=!1;return n.listener=e,this.on(t,n),this},r.prototype.removeListener=function(t,e){var n,r,a,s;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(n=this._events[t],a=n.length,r=-1,n===e||i(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(n)){for(s=a;s-- >0;)if(n[s]===e||n[s].listener&&n[s].listener===e){r=s;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},r.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[t],i(n))this.removeListener(t,n);else if(n)for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},r.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},r.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},r.listenerCount=function(t,e){return t.listenerCount(e)}},{}],12:[function(t,e,n){"use strict";function r(t){for(var e,n=t.length,r=0;r13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}e.exports=function(t){var e=typeof t;if("string"===e){var n=t;if(t=+t,0===t&&r(n))return!1}else if("number"!==e)return!1;return t-t<1}},{}],13:[function(t,e,n){"use strict";function r(t){return new Function("f","var p = (f && f.properties || {}); return "+i(t))}function i(t){if(!t)return"true";var e=t[0];if(t.length<=1)return"any"===e?"false":"true";var n="=="===e?o(t[1],t[2],"===",!1):"!="===e?o(t[1],t[2],"!==",!1):"<"===e||">"===e||"<="===e||">="===e?o(t[1],t[2],e,!0):"any"===e?s(t.slice(1),"||"):"all"===e?s(t.slice(1),"&&"):"none"===e?c(s(t.slice(1),"||")):"in"===e?l(t[1],t.slice(2)):"!in"===e?c(l(t[1],t.slice(2))):"has"===e?u(t[1]):"!has"===e?c(u([t[1]])):"true";return"("+n+")"}function a(t){return"$type"===t?"f.type":"$id"===t?"f.id":"p["+JSON.stringify(t)+"]"}function o(t,e,n,r){var i=a(t),o="$type"===t?h.indexOf(e):JSON.stringify(e);return(r?"typeof "+i+"=== typeof "+o+"&&":"")+i+n+o}function s(t,e){return t.map(i).join(e)}function l(t,e){"$type"===t&&(e=e.map(function(t){return h.indexOf(t)}));var n=JSON.stringify(e.sort(f)),r=a(t);return e.length<=200?n+".indexOf("+r+") !== -1":"function(v, a, i, j) {while (i <= j) { var m = (i + j) >> 1; if (a[m] === v) return true; if (a[m] > v) j = m - 1; else i = m + 1;}return false; }("+r+", "+n+",0,"+(e.length-1)+")"}function u(t){return JSON.stringify(t)+" in p"}function c(t){return"!("+t+")"}function f(t,e){return te?1:0}e.exports=r;var h=["Unknown","Point","LineString","Polygon"]},{}],14:[function(t,e,n){function r(t){if("Polygon"===t.type)return i(t.coordinates);if("MultiPolygon"===t.type){for(var e=0,n=0;n0){e+=Math.abs(a(t[0]));for(var n=1;n2){for(var n,r,i=0;i=0}var u=t("geojson-area");e.exports=r},{"geojson-area":14}],16:[function(t,e,n){"use strict";function r(t,e,n,r,o,l,u,c){if(n/=e,r/=e,u>=n&&c<=r)return t;if(u>r||c=n&&p<=r)f.push(m);else if(!(d>r||p=e&&s<=n&&i.push(o)}return i}function a(t,e,n,r,i,a){for(var s=[],l=0;ln?(_.push(i(u,p,e),i(u,p,n)),a||(_=o(s,_,g,v,y))):d>=e&&_.push(i(u,p,e)):h>n?dn&&(_.push(i(u,p,n)),a||(_=o(s,_,g,v,y))));u=m[x-1],h=u[r],h>=e&&h<=n&&_.push(u),f=_[_.length-1],a&&f&&(_[0][0]!==f[0]||_[0][1]!==f[1])&&_.push(_[0]),o(s,_,g,v,y)}return s}function o(t,e,n,r,i){return e.length&&(e.area=n,e.dist=r,void 0!==i&&(e.outer=i),t.push(e)),[]}e.exports=r;var s=t("./feature")},{"./feature":18}],17:[function(t,e,n){"use strict";function r(t,e){var n=[];if("FeatureCollection"===t.type)for(var r=0;r1?1:r,[n,r,0]}function s(t){for(var e,n,r=0,i=0,a=0;a1)return!1;var a=i.geometry[0].length;if(5!==a)return!1;for(var o=0;o1&&console.time("creation"),x=this.tiles[y]=p(t,v,n,r,_,e===d.maxZoom),this.tileCoords.push({z:e,x:n,y:r}),m)){m>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,n,r,x.numFeatures,x.numPoints,x.numSimplified),console.timeEnd("creation"));var b="z"+e;this.stats[b]=(this.stats[b]||0)+1,this.total++}if(x.source=t,i){if(e===d.maxZoom||e===i)continue;var w=1<1&&console.time("clipping");var M,k,A,S,T,z,E=.5*d.buffer/d.extent,L=.5-E,I=.5+E,D=1+E;M=k=A=S=null,T=h(t,v,n-E,n+I,0,o,x.min[0],x.max[0]),z=h(t,v,n+L,n+D,0,o,x.min[0],x.max[0]),T&&(M=h(T,v,r-E,r+I,1,s,x.min[1],x.max[1]),k=h(T,v,r+L,r+D,1,s,x.min[1],x.max[1])),z&&(A=h(z,v,r-E,r+I,1,s,x.min[1],x.max[1]),S=h(z,v,r+L,r+D,1,s,x.min[1],x.max[1])),m>1&&console.timeEnd("clipping"),t.length&&(f.push(M||[],e+1,2*n,2*r),f.push(k||[],e+1,2*n,2*r+1),f.push(A||[],e+1,2*n+1,2*r),f.push(S||[],e+1,2*n+1,2*r+1))}else i&&(g=e)}return g},i.prototype.getTile=function(t,e,n){var r=this.options,i=r.extent,o=r.debug,s=1<1&&console.log("drilling down to z%d-%d-%d",t,e,n);for(var c,h=t,d=e,p=n;!c&&h>0;)h--,d=Math.floor(d/2),p=Math.floor(p/2),c=this.tiles[a(h,d,p)];if(!c||!c.source)return null;if(o>1&&console.log("found parent tile z%d-%d-%d",h,d,p),u(c,i,r.buffer))return f.tile(c,i);o>1&&console.time("drilling down");var m=this.splitTile(c.source,h,d,p,t,e,n);if(o>1&&console.timeEnd("drilling down"),null!==m){var g=1<r&&(o=n,r=a);r>s?(t[o][2]=r,f.push(u),f.push(o),u=o):(c=f.pop(),u=f.pop())}}function i(t,e,n){var r=e[0],i=e[1],a=n[0],o=n[1],s=t[0],l=t[1],u=a-r,c=o-i;if(0!==u||0!==c){var f=((s-r)*u+(l-i)*c)/(u*u+c*c);f>1?(r=a,i=o):f>0&&(r+=u*f,i+=c*f)}return u=s-r,c=l-i,u*u+c*c}e.exports=r},{}],21:[function(t,e,n){"use strict";function r(t,e,n,r,a,o){for(var s={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:n,y:r,z2:e,transformed:!1,min:[2,1],max:[-1,0]},l=0;ls.max[0]&&(s.max[0]=c[0]),c[1]>s.max[1]&&(s.max[1]=c[1])}return s}function i(t,e,n,r){var i,o,s,l,u=e.geometry,c=e.type,f=[],h=n*n;if(1===c)for(i=0;ih)&&(d.push(l),t.numSimplified++),t.numPoints++;3===c&&a(d,s.outer),f.push(d)}else t.numPoints+=s.length;if(f.length){var p={geometry:f,type:c,tags:e.tags||null};null!==e.id&&(p.id=e.id),t.features.push(p)}}function a(t,e){var n=o(t);n<0===e&&t.reverse()}function o(t){for(var e,n,r=0,i=0,a=t.length,o=a-1;i0?(r=2*Math.sqrt(n+1),t[3]=.25*r,t[0]=(e[6]-e[9])/r,t[1]=(e[8]-e[2])/r,t[2]=(e[1]-e[4])/r):e[0]>e[5]&e[0]>e[10]?(r=2*Math.sqrt(1+e[0]-e[5]-e[10]),t[3]=(e[6]-e[9])/r,t[0]=.25*r,t[1]=(e[1]+e[4])/r,t[2]=(e[8]+e[2])/r):e[5]>e[10]?(r=2*Math.sqrt(1+e[5]-e[0]-e[10]),t[3]=(e[8]-e[2])/r,t[0]=(e[1]+e[4])/r,t[1]=.25*r,t[2]=(e[6]+e[9])/r):(r=2*Math.sqrt(1+e[10]-e[0]-e[5]),t[3]=(e[1]-e[4])/r,t[0]=(e[8]+e[2])/r,t[1]=(e[6]+e[9])/r,t[2]=.25*r),t},i.fromRotationTranslationScale=function(t,e,n,r){var i=e[0],a=e[1],o=e[2],s=e[3],l=i+i,u=a+a,c=o+o,f=i*l,h=i*u,d=i*c,p=a*u,m=a*c,g=o*c,v=s*l,y=s*u,x=s*c,_=r[0],b=r[1],w=r[2];return t[0]=(1-(p+g))*_,t[1]=(h+x)*_,t[2]=(d-y)*_,t[3]=0,t[4]=(h-x)*b,t[5]=(1-(f+g))*b,t[6]=(m+v)*b,t[7]=0,t[8]=(d+y)*w,t[9]=(m-v)*w,t[10]=(1-(f+p))*w,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},i.fromRotationTranslationScaleOrigin=function(t,e,n,r,i){var a=e[0],o=e[1],s=e[2],l=e[3],u=a+a,c=o+o,f=s+s,h=a*u,d=a*c,p=a*f,m=o*c,g=o*f,v=s*f,y=l*u,x=l*c,_=l*f,b=r[0],w=r[1],M=r[2],k=i[0],A=i[1],S=i[2];return t[0]=(1-(m+v))*b,t[1]=(d+_)*b,t[2]=(p-x)*b,t[3]=0,t[4]=(d-_)*w,t[5]=(1-(h+v))*w,t[6]=(g+y)*w,t[7]=0,t[8]=(p+x)*M,t[9]=(g-y)*M,t[10]=(1-(h+m))*M,t[11]=0,t[12]=n[0]+k-(t[0]*k+t[4]*A+t[8]*S),t[13]=n[1]+A-(t[1]*k+t[5]*A+t[9]*S),t[14]=n[2]+S-(t[2]*k+t[6]*A+t[10]*S),t[15]=1,t},i.fromQuat=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n+n,s=r+r,l=i+i,u=n*o,c=r*o,f=r*s,h=i*o,d=i*s,p=i*l,m=a*o,g=a*s,v=a*l;return t[0]=1-f-p,t[1]=c+v,t[2]=h-g,t[3]=0,t[4]=c-v,t[5]=1-u-p,t[6]=d+m,t[7]=0,t[8]=h+g,t[9]=d-m,t[10]=1-u-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},i.frustum=function(t,e,n,r,i,a,o){var s=1/(n-e),l=1/(i-r),u=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*l,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*l,t[10]=(o+a)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*u,t[15]=0,t},i.perspective=function(t,e,n,r,i){var a=1/Math.tan(e/2),o=1/(r-i);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(i+r)*o,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*i*r*o,t[15]=0,t},i.perspectiveFromFieldOfView=function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),l=2/(o+s),u=2/(i+a);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=-((o-s)*l*.5),t[9]=(i-a)*u*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},i.ortho=function(t,e,n,r,i,a,o){var s=1/(e-n),l=1/(r-i),u=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*l,t[14]=(o+a)*u,t[15]=1,t},i.lookAt=function(t,e,n,a){var o,s,l,u,c,f,h,d,p,m,g=e[0],v=e[1],y=e[2],x=a[0],_=a[1],b=a[2],w=n[0],M=n[1],k=n[2];return Math.abs(g-w).999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(a.cross(t,i,o),r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=1+l,s.normalize(r,r))}}(),s.setAxes=function(){var t=i.create();return function(e,n,r,i){return t[0]=r[0],t[3]=r[1],t[6]=r[2],t[1]=i[0],t[4]=i[1],t[7]=i[2],t[2]=-n[0],t[5]=-n[1],t[8]=-n[2],s.normalize(e,s.fromMat3(e,t))}}(),s.clone=o.clone,s.fromValues=o.fromValues,s.copy=o.copy,s.set=o.set,s.identity=function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},s.setAxisAngle=function(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t},s.getAxisAngle=function(t,e){var n=2*Math.acos(e[3]),r=Math.sin(n/2);return 0!=r?(t[0]=e[0]/r,t[1]=e[1]/r,t[2]=e[2]/r):(t[0]=1,t[1]=0,t[2]=0),n},s.add=o.add,s.multiply=function(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=n[0],l=n[1],u=n[2],c=n[3];return t[0]=r*c+o*s+i*u-a*l,t[1]=i*c+o*l+a*s-r*u,t[2]=a*c+o*u+r*l-i*s,t[3]=o*c-r*s-i*l-a*u,t},s.mul=s.multiply,s.scale=o.scale,s.rotateX=function(t,e,n){n*=.5;var r=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(n),l=Math.cos(n);return t[0]=r*l+o*s,t[1]=i*l+a*s,t[2]=a*l-i*s,t[3]=o*l-r*s,t},s.rotateY=function(t,e,n){n*=.5;var r=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(n),l=Math.cos(n);return t[0]=r*l-a*s,t[1]=i*l+o*s,t[2]=a*l+r*s,t[3]=o*l-i*s,t},s.rotateZ=function(t,e,n){n*=.5;var r=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(n),l=Math.cos(n);return t[0]=r*l+i*s,t[1]=i*l-r*s,t[2]=a*l+o*s,t[3]=o*l-a*s,t},s.calculateW=function(t,e){var n=e[0],r=e[1],i=e[2];return t[0]=n,t[1]=r,t[2]=i,t[3]=Math.sqrt(Math.abs(1-n*n-r*r-i*i)),t},s.dot=o.dot,s.lerp=o.lerp,s.slerp=function(t,e,n,r){var i,a,o,s,l,u=e[0],c=e[1],f=e[2],h=e[3],d=n[0],p=n[1],m=n[2],g=n[3];return a=u*d+c*p+f*m+h*g,a<0&&(a=-a,d=-d,p=-p,m=-m,g=-g),1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-r)*i)/o,l=Math.sin(r*i)/o):(s=1-r,l=r),t[0]=s*u+l*d,t[1]=s*c+l*p,t[2]=s*f+l*m,t[3]=s*h+l*g,t},s.sqlerp=function(){var t=s.create(),e=s.create();return function(n,r,i,a,o,l){return s.slerp(t,r,o,l),s.slerp(e,i,a,l),s.slerp(n,t,e,2*l*(1-l)),n}}(),s.invert=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n*n+r*r+i*i+a*a,s=o?1/o:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=a*s,t},s.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},s.length=o.length,s.len=s.length,s.squaredLength=o.squaredLength,s.sqrLen=s.squaredLength,s.normalize=o.normalize,s.fromMat3=function(t,e){var n,r=e[0]+e[4]+e[8];if(r>0)n=Math.sqrt(r+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;n=Math.sqrt(e[3*i+i]-e[3*a+a]-e[3*o+o]+1),t[i]=.5*n,n=.5/n,t[3]=(e[3*a+o]-e[3*o+a])*n,t[a]=(e[3*a+i]+e[3*i+a])*n,t[o]=(e[3*o+i]+e[3*i+o])*n}return t},s.str=function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},s.exactEquals=o.exactEquals,s.equals=o.equals,e.exports=s},{"./common.js":26,"./mat3.js":29,"./vec3.js":33,"./vec4.js":34}],32:[function(t,e,n){var r=t("./common.js"),i={};i.create=function(){var t=new r.ARRAY_TYPE(2);return t[0]=0,t[1]=0,t},i.clone=function(t){var e=new r.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e},i.fromValues=function(t,e){var n=new r.ARRAY_TYPE(2);return n[0]=t,n[1]=e,n},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},i.set=function(t,e,n){return t[0]=e,t[1]=n,t},i.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t},i.subtract=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t},i.sub=i.subtract,i.multiply=function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t},i.mul=i.multiply,i.divide=function(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t},i.div=i.divide,i.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},i.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},i.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t},i.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t},i.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},i.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t},i.scaleAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t},i.distance=function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(n*n+r*r)},i.dist=i.distance,i.squaredDistance=function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r},i.sqrDist=i.squaredDistance,i.length=function(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)},i.len=i.length,i.squaredLength=function(t){var e=t[0],n=t[1];return e*e+n*n},i.sqrLen=i.squaredLength,i.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},i.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},i.normalize=function(t,e){var n=e[0],r=e[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i),t},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},i.cross=function(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t},i.lerp=function(t,e,n,r){var i=e[0],a=e[1];return t[0]=i+r*(n[0]-i),t[1]=a+r*(n[1]-a),t},i.random=function(t,e){e=e||1;var n=2*r.RANDOM()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t},i.transformMat2=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t},i.transformMat2d=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t},i.transformMat3=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t},i.transformMat4=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t},i.forEach=function(){var t=i.create();return function(e,n,r,i,a,o){var s,l;for(n||(n=2),r||(r=0),l=i?Math.min(i*n+r,e.length):e.length,s=r;s0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},i.cross=function(t,e,n){var r=e[0],i=e[1],a=e[2],o=n[0],s=n[1],l=n[2];return t[0]=i*l-a*s,t[1]=a*o-r*l,t[2]=r*s-i*o,t},i.lerp=function(t,e,n,r){var i=e[0],a=e[1],o=e[2];return t[0]=i+r*(n[0]-i),t[1]=a+r*(n[1]-a),t[2]=o+r*(n[2]-o),t},i.hermite=function(t,e,n,r,i,a){var o=a*a,s=o*(2*a-3)+1,l=o*(a-2)+a,u=o*(a-1),c=o*(3-2*a);return t[0]=e[0]*s+n[0]*l+r[0]*u+i[0]*c,t[1]=e[1]*s+n[1]*l+r[1]*u+i[1]*c,t[2]=e[2]*s+n[2]*l+r[2]*u+i[2]*c,t},i.bezier=function(t,e,n,r,i,a){var o=1-a,s=o*o,l=a*a,u=s*o,c=3*a*s,f=3*l*o,h=l*a;return t[0]=e[0]*u+n[0]*c+r[0]*f+i[0]*h,t[1]=e[1]*u+n[1]*c+r[1]*f+i[1]*h,t[2]=e[2]*u+n[2]*c+r[2]*f+i[2]*h,t},i.random=function(t,e){e=e||1;var n=2*r.RANDOM()*Math.PI,i=2*r.RANDOM()-1,a=Math.sqrt(1-i*i)*e;return t[0]=Math.cos(n)*a,t[1]=Math.sin(n)*a,t[2]=i*e,t},i.transformMat4=function(t,e,n){var r=e[0],i=e[1],a=e[2],o=n[3]*r+n[7]*i+n[11]*a+n[15];return o=o||1,t[0]=(n[0]*r+n[4]*i+n[8]*a+n[12])/o,t[1]=(n[1]*r+n[5]*i+n[9]*a+n[13])/o,t[2]=(n[2]*r+n[6]*i+n[10]*a+n[14])/o,t},i.transformMat3=function(t,e,n){var r=e[0],i=e[1],a=e[2];return t[0]=r*n[0]+i*n[3]+a*n[6],t[1]=r*n[1]+i*n[4]+a*n[7],t[2]=r*n[2]+i*n[5]+a*n[8],t},i.transformQuat=function(t,e,n){var r=e[0],i=e[1],a=e[2],o=n[0],s=n[1],l=n[2],u=n[3],c=u*r+s*a-l*i,f=u*i+l*r-o*a,h=u*a+o*i-s*r,d=-o*r-s*i-l*a;return t[0]=c*u+d*-o+f*-l-h*-s,t[1]=f*u+d*-s+h*-o-c*-l,t[2]=h*u+d*-l+c*-s-f*-o,t},i.rotateX=function(t,e,n,r){var i=[],a=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],a[0]=i[0],a[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),a[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),t[0]=a[0]+n[0],t[1]=a[1]+n[1],t[2]=a[2]+n[2],t},i.rotateY=function(t,e,n,r){var i=[],a=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],a[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),a[1]=i[1],a[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),t[0]=a[0]+n[0],t[1]=a[1]+n[1],t[2]=a[2]+n[2],t},i.rotateZ=function(t,e,n,r){var i=[],a=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],a[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),a[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),a[2]=i[2],t[0]=a[0]+n[0],t[1]=a[1]+n[1],t[2]=a[2]+n[2],t},i.forEach=function(){var t=i.create();return function(e,n,r,i,a,o){var s,l;for(n||(n=3),r||(r=0),l=i?Math.min(i*n+r,e.length):e.length,s=r;s1?0:Math.acos(a)},i.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},i.equals=function(t,e){var n=t[0],i=t[1],a=t[2],o=e[0],s=e[1],l=e[2];return Math.abs(n-o)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-s)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-l)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(l))},e.exports=i},{"./common.js":26}],34:[function(t,e,n){var r=t("./common.js"),i={};i.create=function(){var t=new r.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t},i.clone=function(t){var e=new r.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},i.fromValues=function(t,e,n,i){var a=new r.ARRAY_TYPE(4);return a[0]=t,a[1]=e,a[2]=n,a[3]=i,a},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},i.set=function(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t},i.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t},i.subtract=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t},i.sub=i.subtract,i.multiply=function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t[3]=e[3]*n[3],t},i.mul=i.multiply,i.divide=function(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t[3]=e[3]/n[3],t},i.div=i.divide,i.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t},i.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t},i.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t[3]=Math.min(e[3],n[3]),t},i.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t[3]=Math.max(e[3],n[3]),t},i.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t},i.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t},i.scaleAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t},i.distance=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return Math.sqrt(n*n+r*r+i*i+a*a)},i.dist=i.distance,i.squaredDistance=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return n*n+r*r+i*i+a*a},i.sqrDist=i.squaredDistance,i.length=function(t){var e=t[0],n=t[1],r=t[2],i=t[3];return Math.sqrt(e*e+n*n+r*r+i*i)},i.len=i.length,i.squaredLength=function(t){var e=t[0],n=t[1],r=t[2],i=t[3];return e*e+n*n+r*r+i*i},i.sqrLen=i.squaredLength,i.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},i.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t},i.normalize=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n*n+r*r+i*i+a*a;return o>0&&(o=1/Math.sqrt(o),t[0]=n*o,t[1]=r*o,t[2]=i*o,t[3]=a*o),t},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},i.lerp=function(t,e,n,r){var i=e[0],a=e[1],o=e[2],s=e[3];return t[0]=i+r*(n[0]-i),t[1]=a+r*(n[1]-a),t[2]=o+r*(n[2]-o),t[3]=s+r*(n[3]-s),t},i.random=function(t,e){return e=e||1,t[0]=r.RANDOM(),t[1]=r.RANDOM(),t[2]=r.RANDOM(),t[3]=r.RANDOM(),i.normalize(t,t),i.scale(t,t,e),t},i.transformMat4=function(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*a+n[12]*o,t[1]=n[1]*r+n[5]*i+n[9]*a+n[13]*o,t[2]=n[2]*r+n[6]*i+n[10]*a+n[14]*o,t[3]=n[3]*r+n[7]*i+n[11]*a+n[15]*o,t},i.transformQuat=function(t,e,n){var r=e[0],i=e[1],a=e[2],o=n[0],s=n[1],l=n[2],u=n[3],c=u*r+s*a-l*i,f=u*i+l*r-o*a,h=u*a+o*i-s*r,d=-o*r-s*i-l*a;return t[0]=c*u+d*-o+f*-l-h*-s,t[1]=f*u+d*-s+h*-o-c*-l,t[2]=h*u+d*-l+c*-s-f*-o,t[3]=e[3],t},i.forEach=function(){var t=i.create();return function(e,n,r,i,a,o){var s,l;for(n||(n=4),r||(r=0),l=i?Math.min(i*n+r,e.length):e.length,s=r;s=u[h+0]&&r>=u[h+1]?(o[f]=!0,a.push(l[f])):o[f]=!1}}},r.prototype._forEachCell=function(t,e,n,r,i,a,o){for(var s=this._convertToCellCoord(t),l=this._convertToCellCoord(e),u=this._convertToCellCoord(n),c=this._convertToCellCoord(r),f=s;f<=u;f++)for(var h=l;h<=c;h++){var d=this.d*h+f;if(i.call(this,t,e,n,r,d,a,o))return}},r.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},r.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=i+this.cells.length+1+1,n=0,r=0;r>1,c=-7,f=n?i-1:0,h=n?-1:1,d=t[e+f];for(f+=h,a=d&(1<<-c)-1,d>>=-c,c+=s;c>0;a=256*a+t[e+f],f+=h,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=r;c>0;o=256*o+t[e+f],f+=h,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:(d?-1:1)*(1/0);o+=Math.pow(2,r),a-=u}return(d?-1:1)*o*Math.pow(2,a-r); },n.write=function(t,e,n,r,i,a){var o,s,l,u=8*a-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:a-1,p=r?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),e+=o+f>=1?h/l:h*Math.pow(2,1-f),e*l>=2&&(o++,l/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(e*l-1)*Math.pow(2,i),o+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;t[n+d]=255&s,d+=p,s/=256,i-=8);for(o=o<0;t[n+d]=255&o,d+=p,o/=256,u-=8);t[n+d-p]|=128*m}},{}],37:[function(t,e,n){"use strict";function r(t,e,n,r,a){return new i(t,e,n,r,a)}function i(t,e,n,r,i){e=e||a,n=n||o,i=i||Array,this.nodeSize=r||64,this.points=t,this.ids=new i(t.length),this.coords=new i(2*t.length);for(var l=0;l=n&&s<=i&&l>=r&&l<=a&&c.push(t[p]);else{var m=Math.floor((d+h)/2);s=e[2*m],l=e[2*m+1],s>=n&&s<=i&&l>=r&&l<=a&&c.push(t[m]);var g=(f+1)%2;(0===f?n<=s:r<=l)&&(u.push(d),u.push(m-1),u.push(g)),(0===f?i>=s:a>=l)&&(u.push(m+1),u.push(h),u.push(g))}}return c}e.exports=r},{}],39:[function(t,e,n){"use strict";function r(t,e,n,a,o,s){if(!(o-a<=n)){var l=Math.floor((a+o)/2);i(t,e,l,a,o,s%2),r(t,e,n,a,l-1,s+1),r(t,e,n,l+1,o,s+1)}}function i(t,e,n,r,o,s){for(;o>r;){if(o-r>600){var l=o-r+1,u=n-r+1,c=Math.log(l),f=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*f*(l-f)/l)*(u-l/2<0?-1:1),d=Math.max(r,Math.floor(n-u*f/l+h)),p=Math.min(o,Math.floor(n+(l-u)*f/l+h));i(t,e,n,d,p,s)}var m=e[2*n+s],g=r,v=o;for(a(t,e,r,n),e[2*o+s]>m&&a(t,e,r,o);gm;)v--}e[2*r+s]===m?a(t,e,r,v):(v++,a(t,e,v,o)),v<=n&&(r=v+1),n<=v&&(o=v-1)}}function a(t,e,n,r){o(t,n,r),o(e,2*n,2*r),o(e,2*n+1,2*r+1)}function o(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}e.exports=r},{}],40:[function(t,e,n){"use strict";function r(t,e,n,r,a,o){for(var s=[0,t.length-1,0],l=[],u=a*a;s.length;){var c=s.pop(),f=s.pop(),h=s.pop();if(f-h<=o)for(var d=h;d<=f;d++)i(e[2*d],e[2*d+1],n,r)<=u&&l.push(t[d]);else{var p=Math.floor((h+f)/2),m=e[2*p],g=e[2*p+1];i(m,g,n,r)<=u&&l.push(t[p]);var v=(c+1)%2;(0===c?n-a<=m:r-a<=g)&&(s.push(h),s.push(p-1),s.push(v)),(0===c?n+a>=m:r+a>=g)&&(s.push(p+1),s.push(f),s.push(v))}}return l}function i(t,e,n,r){var i=t-n,a=e-r;return i*i+a*a}e.exports=r},{}],41:[function(t,e,n){"use strict";function r(t,e){var n;if(f(t)){var l,u=t.stops&&"object"==typeof t.stops[0][0],c=u||void 0!==t.property,h=u||!c,d=t.type||e||"exponential";if("exponential"===d)l=o;else if("interval"===d)l=a;else if("categorical"===d)l=i;else{if("identity"!==d)throw new Error('Unknown function type "'+d+'"');l=s}if(u){for(var p={},m=[],g=0;g=t.stops.length)break;if(e<=t.stops[r][0])break;r++}return 0===r?t.stops[r][1]:r===t.stops.length?t.stops[r-1][1]:l(e,n,t.stops[r-1][0],t.stops[r][0],t.stops[r-1][1],t.stops[r][1])}function s(t,e){return e}function l(t,e,n,r,i,a){return"function"==typeof i?function(){var o=i.apply(void 0,arguments),s=a.apply(void 0,arguments);return l(t,e,n,r,o,s)}:i.length?c(t,e,n,r,i,a):u(t,e,n,r,i,a)}function u(t,e,n,r,i,a){var o,s=r-n,l=t-n;return o=1===e?l/s:(Math.pow(e,l)-1)/(Math.pow(e,s)-1),i*(1-o)+a*o}function c(t,e,n,r,i,a){for(var o=[],s=0;s -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit of the position before scaling it with the\n // model/view matrix.\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\n\n // position of y on the screen\n float y = gl_Position.y / gl_Position.w;\n\n // how much features are squished in the y direction by the tilt\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\n\n // how much features are squished in all directions by the perspectiveness\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\n\n v_linewidth = vec2(outset, inset);\n v_gamma_scale = perspective_scale * squish_scale;\n}\n"},linepattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_blur;\n\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_fade;\nuniform float u_opacity;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\nvoid main() {\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_linewidth.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_linewidth.t) or when fading out\n // (v_linewidth.s)\n float blur = u_blur * v_gamma_scale;\n float alpha = clamp(min(dist - (v_linewidth.t - blur), v_linewidth.s - dist) / blur, 0.0, 1.0);\n\n float x_a = mod(v_linesofar / u_pattern_size_a.x, 1.0);\n float x_b = mod(v_linesofar / u_pattern_size_b.x, 1.0);\n float y_a = 0.5 + (v_normal.y * v_linewidth.s / u_pattern_size_a.y);\n float y_b = 0.5 + (v_normal.y * v_linewidth.s / u_pattern_size_b.y);\n vec2 pos_a = mix(u_pattern_tl_a, u_pattern_br_a, vec2(x_a, y_a));\n vec2 pos_b = mix(u_pattern_tl_b, u_pattern_br_b, vec2(x_b, y_b));\n\n vec4 color = mix(texture2D(u_image, pos_a), texture2D(u_image, pos_b), u_fade);\n\n alpha *= u_opacity;\n\n gl_FragColor = color * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform mediump float u_linewidth;\nuniform mediump float u_gapwidth;\nuniform mediump float u_antialiasing;\nuniform mediump float u_extra;\nuniform mat2 u_antialiasingmatrix;\nuniform mediump float u_offset;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\nvoid main() {\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n // We store the texture normals in the most insignificant bit\n // transform y so that 0 => -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit of the position before scaling it with the\n // model/view matrix.\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\n v_linesofar = a_linesofar;\n\n // position of y on the screen\n float y = gl_Position.y / gl_Position.w;\n\n // how much features are squished in the y direction by the tilt\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\n\n // how much features are squished in all directions by the perspectiveness\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\n\n v_linewidth = vec2(outset, inset);\n v_gamma_scale = perspective_scale * squish_scale;\n}\n"},linesdfpattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform lowp vec4 u_color;\nuniform lowp float u_opacity;\n\nuniform float u_blur;\nuniform sampler2D u_image;\nuniform float u_sdfgamma;\nuniform float u_mix;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\nvoid main() {\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_linewidth.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_linewidth.t) or when fading out\n // (v_linewidth.s)\n float blur = u_blur * v_gamma_scale;\n float alpha = clamp(min(dist - (v_linewidth.t - blur), v_linewidth.s - dist) / blur, 0.0, 1.0);\n\n float sdfdist_a = texture2D(u_image, v_tex_a).a;\n float sdfdist_b = texture2D(u_image, v_tex_b).a;\n float sdfdist = mix(sdfdist_a, sdfdist_b, u_mix);\n alpha *= smoothstep(0.5 - u_sdfgamma, 0.5 + u_sdfgamma, sdfdist);\n\n gl_FragColor = u_color * (alpha * u_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform mediump float u_linewidth;\nuniform mediump float u_gapwidth;\nuniform mediump float u_antialiasing;\nuniform vec2 u_patternscale_a;\nuniform float u_tex_y_a;\nuniform vec2 u_patternscale_b;\nuniform float u_tex_y_b;\nuniform float u_extra;\nuniform mat2 u_antialiasingmatrix;\nuniform mediump float u_offset;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\nvoid main() {\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n // We store the texture normals in the most insignificant bit\n // transform y so that 0 => -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit of the position before scaling it with the\n // model/view matrix.\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\n\n v_tex_a = vec2(a_linesofar * u_patternscale_a.x, normal.y * u_patternscale_a.y + u_tex_y_a);\n v_tex_b = vec2(a_linesofar * u_patternscale_b.x, normal.y * u_patternscale_b.y + u_tex_y_b);\n\n // position of y on the screen\n float y = gl_Position.y / gl_Position.w;\n\n // how much features are squished in the y direction by the tilt\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\n\n // how much features are squished in all directions by the perspectiveness\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\n\n v_linewidth = vec2(outset, inset);\n v_gamma_scale = perspective_scale * squish_scale;\n}\n"},outline:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n#pragma mapbox: define lowp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_pos;\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = smoothstep(1.0, 0.0, dist);\n gl_FragColor = outline_color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},outlinepattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_opacity;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\nvoid main() {\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a, u_pattern_br_a, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b, u_pattern_br_b, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n // find distance to outline for alpha interpolation\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = smoothstep(1.0, 0.0, dist);\n \n\n gl_FragColor = mix(color1, color2, u_mix) * alpha * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n vec2 scaled_size_a = u_scale_a * u_pattern_size_a;\n vec2 scaled_size_b = u_scale_b * u_pattern_size_b;\n\n // the correct offset needs to be calculated.\n //\n // The offset depends on how many pixels are between the world origin and\n // the edge of the tile:\n // vec2 offset = mod(pixel_coord, size)\n //\n // At high zoom levels there are a ton of pixels between the world origin\n // and the edge of the tile. The glsl spec only guarantees 16 bits of\n // precision for highp floats. We need more than that.\n //\n // The pixel_coord is passed in as two 16 bit values:\n // pixel_coord_upper = floor(pixel_coord / 2^16)\n // pixel_coord_lower = mod(pixel_coord, 2^16)\n //\n // The offset is calculated in a series of steps that should preserve this precision:\n vec2 offset_a = mod(mod(mod(u_pixel_coord_upper, scaled_size_a) * 256.0, scaled_size_a) * 256.0 + u_pixel_coord_lower, scaled_size_a);\n vec2 offset_b = mod(mod(mod(u_pixel_coord_upper, scaled_size_b) * 256.0, scaled_size_b) * 256.0 + u_pixel_coord_lower, scaled_size_b);\n\n v_pos_a = (u_tile_units_to_pixels * a_pos + offset_a) / scaled_size_a;\n v_pos_b = (u_tile_units_to_pixels * a_pos + offset_b) / scaled_size_b;\n\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},pattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_opacity;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\nvoid main() {\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a, u_pattern_br_a, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b, u_pattern_br_b, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n gl_FragColor = mix(color1, color2, u_mix) * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n vec2 scaled_size_a = u_scale_a * u_pattern_size_a;\n vec2 scaled_size_b = u_scale_b * u_pattern_size_b;\n\n // the correct offset needs to be calculated.\n //\n // The offset depends on how many pixels are between the world origin and\n // the edge of the tile:\n // vec2 offset = mod(pixel_coord, size)\n //\n // At high zoom levels there are a ton of pixels between the world origin\n // and the edge of the tile. The glsl spec only guarantees 16 bits of\n // precision for highp floats. We need more than that.\n //\n // The pixel_coord is passed in as two 16 bit values:\n // pixel_coord_upper = floor(pixel_coord / 2^16)\n // pixel_coord_lower = mod(pixel_coord, 2^16)\n //\n // The offset is calculated in a series of steps that should preserve this precision:\n vec2 offset_a = mod(mod(mod(u_pixel_coord_upper, scaled_size_a) * 256.0, scaled_size_a) * 256.0 + u_pixel_coord_lower, scaled_size_a);\n vec2 offset_b = mod(mod(mod(u_pixel_coord_upper, scaled_size_b) * 256.0, scaled_size_b) * 256.0 + u_pixel_coord_lower, scaled_size_b);\n\n v_pos_a = (u_tile_units_to_pixels * a_pos + offset_a) / scaled_size_a;\n v_pos_b = (u_tile_units_to_pixels * a_pos + offset_b) / scaled_size_b;\n}\n"},raster:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_opacity0;\nuniform float u_opacity1;\nuniform sampler2D u_image0;\nuniform sampler2D u_image1;\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nuniform float u_brightness_low;\nuniform float u_brightness_high;\n\nuniform float u_saturation_factor;\nuniform float u_contrast_factor;\nuniform vec3 u_spin_weights;\n\nvoid main() {\n\n // read and cross-fade colors from the main and parent tiles\n vec4 color0 = texture2D(u_image0, v_pos0);\n vec4 color1 = texture2D(u_image1, v_pos1);\n vec4 color = color0 * u_opacity0 + color1 * u_opacity1;\n vec3 rgb = color.rgb;\n\n // spin\n rgb = vec3(\n dot(rgb, u_spin_weights.xyz),\n dot(rgb, u_spin_weights.zxy),\n dot(rgb, u_spin_weights.yzx));\n\n // saturation\n float average = (color.r + color.g + color.b) / 3.0;\n rgb += (average - rgb) * u_saturation_factor;\n\n // contrast\n rgb = (rgb - 0.5) * u_contrast_factor + 0.5;\n\n // brightness\n vec3 u_high_vec = vec3(u_brightness_low, u_brightness_low, u_brightness_low);\n vec3 u_low_vec = vec3(u_brightness_high, u_brightness_high, u_brightness_high);\n\n gl_FragColor = vec4(mix(u_high_vec, u_low_vec, rgb), color.a);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform mat4 u_matrix;\nuniform vec2 u_tl_parent;\nuniform float u_scale_parent;\nuniform float u_buffer_scale;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos0 = (((a_texture_pos / 32767.0) - 0.5) / u_buffer_scale ) + 0.5;\n v_pos1 = (v_pos0 * u_scale_parent) + u_tl_parent;\n}\n"},icon:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform sampler2D u_texture;\nuniform sampler2D u_fadetexture;\nuniform lowp float u_opacity;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\n\nvoid main() {\n lowp float alpha = texture2D(u_fadetexture, v_fade_tex).a * u_opacity;\n gl_FragColor = texture2D(u_texture, v_tex) * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_texture_pos;\nattribute vec4 a_data;\n\n\n// matrix is for the vertex position.\nuniform mat4 u_matrix;\n\nuniform mediump float u_zoom;\nuniform bool u_rotate_with_map;\nuniform vec2 u_extrude_scale;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\n\nvoid main() {\n vec2 a_tex = a_texture_pos.xy;\n mediump float a_labelminzoom = a_data[0];\n mediump vec2 a_zoom = a_data.pq;\n mediump float a_minzoom = a_zoom[0];\n mediump float a_maxzoom = a_zoom[1];\n\n // u_zoom is the current zoom level adjusted for the change in font size\n mediump float z = 2.0 - step(a_minzoom, u_zoom) - (1.0 - step(a_maxzoom, u_zoom));\n\n vec2 extrude = u_extrude_scale * (a_offset / 64.0);\n if (u_rotate_with_map) {\n gl_Position = u_matrix * vec4(a_pos + extrude, 0, 1);\n gl_Position.z += z * gl_Position.w;\n } else {\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n }\n\n v_tex = a_tex / u_texsize;\n v_fade_tex = vec2(a_labelminzoom / 255.0, 0.0);\n}\n" },sdf:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform sampler2D u_texture;\nuniform sampler2D u_fadetexture;\nuniform lowp vec4 u_color;\nuniform lowp float u_opacity;\nuniform lowp float u_buffer;\nuniform lowp float u_gamma;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\nvarying float v_gamma_scale;\n\nvoid main() {\n lowp float dist = texture2D(u_texture, v_tex).a;\n lowp float fade_alpha = texture2D(u_fadetexture, v_fade_tex).a;\n lowp float gamma = u_gamma * v_gamma_scale;\n lowp float alpha = smoothstep(u_buffer - gamma, u_buffer + gamma, dist) * fade_alpha;\n\n gl_FragColor = u_color * (alpha * u_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nconst float PI = 3.141592653589793;\n\nattribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_texture_pos;\nattribute vec4 a_data;\n\n\n// matrix is for the vertex position.\nuniform mat4 u_matrix;\n\nuniform mediump float u_zoom;\nuniform bool u_rotate_with_map;\nuniform bool u_pitch_with_map;\nuniform mediump float u_pitch;\nuniform mediump float u_bearing;\nuniform mediump float u_aspect_ratio;\nuniform vec2 u_extrude_scale;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\nvarying float v_gamma_scale;\n\nvoid main() {\n vec2 a_tex = a_texture_pos.xy;\n mediump float a_labelminzoom = a_data[0];\n mediump vec2 a_zoom = a_data.pq;\n mediump float a_minzoom = a_zoom[0];\n mediump float a_maxzoom = a_zoom[1];\n\n // u_zoom is the current zoom level adjusted for the change in font size\n mediump float z = 2.0 - step(a_minzoom, u_zoom) - (1.0 - step(a_maxzoom, u_zoom));\n\n // pitch-alignment: map\n // rotation-alignment: map | viewport\n if (u_pitch_with_map) {\n lowp float angle = u_rotate_with_map ? (a_data[1] / 256.0 * 2.0 * PI) : u_bearing;\n lowp float asin = sin(angle);\n lowp float acos = cos(angle);\n mat2 RotationMatrix = mat2(acos, asin, -1.0 * asin, acos);\n vec2 offset = RotationMatrix * a_offset;\n vec2 extrude = u_extrude_scale * (offset / 64.0);\n gl_Position = u_matrix * vec4(a_pos + extrude, 0, 1);\n gl_Position.z += z * gl_Position.w;\n // pitch-alignment: viewport\n // rotation-alignment: map\n } else if (u_rotate_with_map) {\n // foreshortening factor to apply on pitched maps\n // as a label goes from horizontal <=> vertical in angle\n // it goes from 0% foreshortening to up to around 70% foreshortening\n lowp float pitchfactor = 1.0 - cos(u_pitch * sin(u_pitch * 0.75));\n\n lowp float lineangle = a_data[1] / 256.0 * 2.0 * PI;\n\n // use the lineangle to position points a,b along the line\n // project the points and calculate the label angle in projected space\n // this calculation allows labels to be rendered unskewed on pitched maps\n vec4 a = u_matrix * vec4(a_pos, 0, 1);\n vec4 b = u_matrix * vec4(a_pos + vec2(cos(lineangle),sin(lineangle)), 0, 1);\n lowp float angle = atan((b[1]/b[3] - a[1]/a[3])/u_aspect_ratio, b[0]/b[3] - a[0]/a[3]);\n lowp float asin = sin(angle);\n lowp float acos = cos(angle);\n mat2 RotationMatrix = mat2(acos, -1.0 * asin, asin, acos);\n\n vec2 offset = RotationMatrix * (vec2((1.0-pitchfactor)+(pitchfactor*cos(angle*2.0)), 1.0) * a_offset);\n vec2 extrude = u_extrude_scale * (offset / 64.0);\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n gl_Position.z += z * gl_Position.w;\n // pitch-alignment: viewport\n // rotation-alignment: viewport\n } else {\n vec2 extrude = u_extrude_scale * (a_offset / 64.0);\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n }\n\n v_gamma_scale = (gl_Position.w - 0.5);\n\n v_tex = a_tex / u_texsize;\n v_fade_tex = vec2(a_labelminzoom / 255.0, 0.0);\n}\n"},collisionbox:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_zoom;\nuniform float u_maxzoom;\n\nvarying float v_max_zoom;\nvarying float v_placement_zoom;\n\nvoid main() {\n\n float alpha = 0.5;\n\n gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0) * alpha;\n\n if (v_placement_zoom > u_zoom) {\n gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0) * alpha;\n }\n\n if (u_zoom >= v_max_zoom) {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0) * alpha * 0.25;\n }\n\n if (v_placement_zoom >= u_maxzoom) {\n gl_FragColor = vec4(0.0, 0.0, 1.0, 1.0) * alpha * 0.2;\n }\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\nattribute vec2 a_extrude;\nattribute vec2 a_data;\n\nuniform mat4 u_matrix;\nuniform float u_scale;\n\nvarying float v_max_zoom;\nvarying float v_placement_zoom;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos + a_extrude / u_scale, 0.0, 1.0);\n\n v_max_zoom = a_data.x;\n v_placement_zoom = a_data.y;\n}\n"}},e.exports.util="float evaluate_zoom_function_1(const vec4 values, const float t) {\n if (t < 1.0) {\n return mix(values[0], values[1], t);\n } else if (t < 2.0) {\n return mix(values[1], values[2], t - 1.0);\n } else {\n return mix(values[2], values[3], t - 2.0);\n }\n}\nvec4 evaluate_zoom_function_4(const vec4 value0, const vec4 value1, const vec4 value2, const vec4 value3, const float t) {\n if (t < 1.0) {\n return mix(value0, value1, t);\n } else if (t < 2.0) {\n return mix(value1, value2, t - 1.0);\n } else {\n return mix(value2, value3, t - 2.0);\n }\n}\n"},{path:184}],43:[function(t,e,n){"use strict";function r(t,e){this.message=(t?t+": ":"")+i.apply(i,Array.prototype.slice.call(arguments,2)),null!==e&&void 0!==e&&e.__line__&&(this.line=e.__line__)}var i=t("util").format;e.exports=r},{util:203}],44:[function(t,e,n){"use strict";e.exports=function(t){for(var e=1;e7)return[new r(c,l,"constants have been deprecated as of v8")];if(!(l in h.constants))return[new r(c,l,'constant "%s" not found',l)];e=a({},e,{value:h.constants[l]})}return u.function&&"object"===i(l)?n(e):u.type&&s[u.type]?s[u.type](e):o(a({},e,{valueSpec:u.type?f[u.type]:u}))}},{"../error/validation_error":43,"../util/extend":44,"../util/get_type":45,"./validate_array":48,"./validate_boolean":49,"./validate_color":50,"./validate_constants":51,"./validate_enum":52,"./validate_filter":53,"./validate_function":54,"./validate_layer":56,"./validate_number":58,"./validate_object":59,"./validate_source":61,"./validate_string":62}],48:[function(t,e,n){"use strict";var r=t("../util/get_type"),i=t("./validate"),a=t("../error/validation_error");e.exports=function(t){var e=t.value,n=t.valueSpec,o=t.style,s=t.styleSpec,l=t.key,u=t.arrayElementValidator||i;if("array"!==r(e))return[new a(l,e,"array expected, %s found",r(e))];if(n.length&&e.length!==n.length)return[new a(l,e,"array length %d expected, length %d found",n.length,e.length)];if(n["min-length"]&&e.length7)return n?[new r(e,n,"constants have been deprecated as of v8")]:[];var o=i(n);if("object"!==o)return[new r(e,n,"object expected, %s found",o)];var s=[];for(var l in n)"@"!==l[0]&&s.push(new r(e+"."+l,n[l],'constants must start with "@"'));return s}},{"../error/validation_error":43,"../util/get_type":45}],52:[function(t,e,n){"use strict";var r=t("../error/validation_error"),i=t("../util/unbundle_jsonlint");e.exports=function(t){var e=t.key,n=t.value,a=t.valueSpec,o=[];return a.values.indexOf(i(n))===-1&&o.push(new r(e,n,"expected one of [%s], %s found",a.values.join(", "),n)),o}},{"../error/validation_error":43,"../util/unbundle_jsonlint":46}],53:[function(t,e,n){"use strict";var r=t("../error/validation_error"),i=t("./validate_enum"),a=t("../util/get_type"),o=t("../util/unbundle_jsonlint");e.exports=function t(e){var n,s=e.value,l=e.key,u=e.styleSpec,c=[];if("array"!==a(s))return[new r(l,s,"array expected, %s found",a(s))];if(s.length<1)return[new r(l,s,"filter array must have at least 1 element")];switch(c=c.concat(i({key:l+"[0]",value:s[0],valueSpec:u.filter_operator,style:e.style,styleSpec:e.styleSpec})),o(s[0])){case"<":case"<=":case">":case">=":s.length>=2&&"$type"==s[1]&&c.push(new r(l,s,'"$type" cannot be use with operator "%s"',s[0]));case"==":case"!=":3!=s.length&&c.push(new r(l,s,'filter array for operator "%s" must have 3 elements',s[0]));case"in":case"!in":s.length>=2&&(n=a(s[1]),"string"!==n?c.push(new r(l+"[1]",s[1],"string expected, %s found",n)):"@"===s[1][0]&&c.push(new r(l+"[1]",s[1],"filter key cannot be a constant")));for(var f=2;f=8&&(h&&!t.valueSpec["property-function"]?p.push(new r(t.key,t.value,"property functions not supported")):d&&!t.valueSpec["zoom-function"]&&p.push(new r(t.key,t.value,"zoom functions not supported"))),p}},{"../error/validation_error":43,"../util/get_type":45,"./validate":47,"./validate_array":48,"./validate_number":58,"./validate_object":59}],55:[function(t,e,n){"use strict";var r=t("../error/validation_error"),i=t("./validate_string");e.exports=function(t){var e=t.value,n=t.key,a=i(t);return a.length?a:(e.indexOf("{fontstack}")===-1&&a.push(new r(n,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&a.push(new r(n,e,'"glyphs" url must include a "{range}" token')),a)}},{"../error/validation_error":43,"./validate_string":62}],56:[function(t,e,n){"use strict";var r=t("../error/validation_error"),i=t("../util/unbundle_jsonlint"),a=t("./validate_object"),o=t("./validate_filter"),s=t("./validate_paint_property"),l=t("./validate_layout_property"),u=t("../util/extend");e.exports=function(t){var e=[],n=t.value,c=t.key,f=t.style,h=t.styleSpec;n.type||n.ref||e.push(new r(c,n,'either "type" or "ref" is required'));var d=i(n.type),p=i(n.ref);if(n.id)for(var m=0;ma.maximum?[new i(e,n,"%s is greater than the maximum value %s",n,a.maximum)]:[]}},{"../error/validation_error":43,"../util/get_type":45}],59:[function(t,e,n){"use strict";var r=t("../error/validation_error"),i=t("../util/get_type"),a=t("./validate");e.exports=function(t){var e=t.key,n=t.value,o=t.valueSpec,s=t.objectElementValidators||{},l=t.style,u=t.styleSpec,c=[],f=i(n);if("object"!==f)return[new r(e,n,"object expected, %s found",f)];for(var h in n){var d=h.split(".")[0],p=o&&(o[d]||o["*"]),m=s[d]||s["*"];p||m?c=c.concat((m||a)({key:(e?e+".":e)+h,value:n[h],valueSpec:p,style:l,styleSpec:u,object:n,objectKey:h})):""!==e&&1!==e.split(".").length&&c.push(new r(e,n[h],'unknown property "%s"',h))}for(d in o)o[d].required&&void 0===o[d].default&&void 0===n[d]&&c.push(new r(e,n,'missing required property "%s"',d));return c}},{"../error/validation_error":43,"../util/get_type":45,"./validate":47}],60:[function(t,e,n){"use strict";var r=t("./validate"),i=t("../error/validation_error");e.exports=function(t){var e=t.key,n=t.style,a=t.styleSpec,o=t.value,s=t.objectKey,l=a["paint_"+t.layerType],u=s.match(/^(.*)-transition$/);return u&&l[u[1]]&&l[u[1]].transition?r({key:e,value:o,valueSpec:a.transition,style:n,styleSpec:a}):t.valueSpec||l[s]?r({key:t.key,value:o,valueSpec:t.valueSpec||l[s],style:n,styleSpec:a}):[new i(e,o,'unknown property "%s"',s)]}},{"../error/validation_error":43,"./validate":47}],61:[function(t,e,n){"use strict";var r=t("../error/validation_error"),i=t("../util/unbundle_jsonlint"),a=t("./validate_object"),o=t("./validate_enum");e.exports=function(t){var e=t.value,n=t.key,s=t.styleSpec,l=t.style;if(!e.type)return[new r(n,e,'"type" is required')];var u=i(e.type);switch(u){case"vector":case"raster":var c=[];if(c=c.concat(a({key:n,value:e,valueSpec:s.source_tile,style:t.style,styleSpec:s})),"url"in e)for(var f in e)["type","url","tileSize"].indexOf(f)<0&&c.push(new r(n+"."+f,e[f],'a source with a "url" property may not include a "%s" property',f));return c;case"geojson":return a({key:n,value:e,valueSpec:s.source_geojson,style:l,styleSpec:s});case"video":return a({key:n,value:e,valueSpec:s.source_video,style:l,styleSpec:s});case"image":return a({key:n,value:e,valueSpec:s.source_image,style:l,styleSpec:s});default:return o({key:n+".type",value:e.type,valueSpec:{values:["vector","raster","geojson","video","image"]},style:l,styleSpec:s})}}},{"../error/validation_error":43,"../util/unbundle_jsonlint":46,"./validate_enum":52,"./validate_object":59}],62:[function(t,e,n){"use strict";var r=t("../util/get_type"),i=t("../error/validation_error");e.exports=function(t){var e=t.value,n=t.key,a=r(e);return"string"!==a?[new i(n,e,"string expected, %s found",a)]:[]}},{"../error/validation_error":43,"../util/get_type":45}],63:[function(t,e,n){"use strict";function r(t,e){e=e||l;var n=[];return n=n.concat(s({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:u}})),e.$version>7&&t.constants&&(n=n.concat(o({key:"constants",value:t.constants,style:t,styleSpec:e}))),i(n)}function i(t){return[].concat(t).sort(function(t,e){return t.line-e.line})}function a(t){return function(){return i(t.apply(this,arguments))}}var o=t("./validate/validate_constants"),s=t("./validate/validate"),l=t("../reference/latest.min"),u=t("./validate/validate_glyphs_url");r.source=a(t("./validate/validate_source")),r.layer=a(t("./validate/validate_layer")),r.filter=a(t("./validate/validate_filter")),r.paintProperty=a(t("./validate/validate_paint_property")),r.layoutProperty=a(t("./validate/validate_layout_property")),e.exports=r},{"../reference/latest.min":64,"./validate/validate":47,"./validate/validate_constants":51,"./validate/validate_filter":53,"./validate/validate_glyphs_url":55,"./validate/validate_layer":56,"./validate/validate_layout_property":57,"./validate/validate_paint_property":60,"./validate/validate_source":61}],64:[function(t,e,n){e.exports=t("./v8.min.json")},{"./v8.min.json":65}],65:[function(t,e,n){e.exports={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_tile","source_geojson","source_video","source_image"],source_tile:{type:{required:!0,type:"enum",values:["vector","raster"]},url:{type:"string"},tiles:{type:"array",value:"string"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:["geojson"]},data:{type:"*"},maxzoom:{type:"number",default:14},buffer:{type:"number",default:64},tolerance:{type:"number",default:3},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:400},clusterMaxZoom:{type:"number"}},source_video:{type:{required:!0,type:"enum",values:["video"]},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:["image"]},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:["fill","line","symbol","circle","raster","background"]},metadata:{type:"*"},ref:{type:"string"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:22},maxzoom:{type:"number",minimum:0,maximum:22},interactive:{type:"boolean",default:!1},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"},"paint.*":{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_symbol","layout_raster","layout_background"],layout_background:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_fill:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_circle:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_line:{"line-cap":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["butt","round","square"],default:"butt"},"line-join":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["bevel","round","miter"],default:"miter"},"line-miter-limit":{type:"number",default:2,function:"interpolated","zoom-function":!0,"property-function":!0,requires:[{"line-join":"miter"}]},"line-round-limit":{type:"number",default:1.05,function:"interpolated","zoom-function":!0,"property-function":!0,requires:[{"line-join":"round"}]},visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_symbol:{"symbol-placement":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["point","line"],default:"point"},"symbol-spacing":{type:"number",default:250,minimum:1,function:"interpolated","zoom-function":!0,"property-function":!0,units:"pixels",requires:[{"symbol-placement":"line"}]},"symbol-avoid-edges":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1},"icon-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image"]},"icon-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image"]},"icon-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image","text-field"]},"icon-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"viewport",requires:["icon-image"]},"icon-size":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image"]},"icon-text-fit":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!1,values:["none","both","width","height"],default:"none",requires:["icon-image","text-field"]},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image","icon-text-fit","text-field"]},"icon-image":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,tokens:!0},"icon-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,"property-function":!0,units:"degrees",requires:["icon-image"]},"icon-padding":{type:"number",default:2,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,units:"pixels",requires:["icon-image"]},"icon-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":"line"}]},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image"]},"text-pitch-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],requires:["text-field"]},"text-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"viewport",requires:["text-field"]},"text-field":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:"",tokens:!0},"text-font":{type:"array",value:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"]},"text-size":{type:"number",default:16,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-max-width":{type:"number",default:10,minimum:0,units:"em",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-line-height":{type:"number",default:1.2,units:"em",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-letter-spacing":{type:"number",default:0,units:"em",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-justify":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["left","center","right"],default:"center",requires:["text-field"]},"text-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"],default:"center",requires:["text-field"]},"text-max-angle":{type:"number",default:45,units:"degrees",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field",{"symbol-placement":"line"}]},"text-rotate":{type:"number",default:0,period:360,units:"degrees",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":"line"}]},"text-transform":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["none","uppercase","lowercase"],default:"none",requires:["text-field"]},"text-offset":{type:"array",value:"number",units:"ems",function:"interpolated","zoom-function":!0,"property-function":!0,length:2,default:[0,0],requires:["text-field"]},"text-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field"]},"text-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field"]},"text-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field","icon-image"]},visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_raster:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:["==","!=",">",">=","<","<=","in","!in","all","any","none","has","!has"]},geometry_type:{type:"enum",values:["Point","LineString","Polygon"]},color_operation:{type:"enum",values:["lighten","saturate","spin","fade","mix"]},function:{stops:{type:"array",required:!0,value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:["exponential","interval","categorical"],default:"exponential"}},function_stop:{type:"array",minimum:0,maximum:22,value:["number","color"],length:2},paint:["paint_fill","paint_line","paint_circle","paint_symbol","paint_raster","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!0},"fill-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0},"fill-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0, transition:!0,requires:[{"!":"fill-pattern"}]},"fill-outline-color":{type:"color",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}]},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"fill-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["fill-translate"]},"fill-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,transition:!0}},paint_line:{"line-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0},"line-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"line-pattern"}]},"line-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["line-translate"]},"line-width":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-gap-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-offset":{type:"number",default:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-dasharray":{type:"array",value:"number",function:"piecewise-constant","zoom-function":!0,"property-function":!0,minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}]},"line-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,transition:!0}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-blur":{type:"number",default:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["circle-translate"]},"circle-pitch-scale":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["icon-image","icon-translate"]},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["text-field","text-translate"]}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-hue-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,transition:!0,units:"degrees"},"raster-brightness-min":{type:"number",function:"interpolated","zoom-function":!0,default:0,minimum:0,maximum:1,transition:!0},"raster-brightness-max":{type:"number",function:"interpolated","zoom-function":!0,default:1,minimum:0,maximum:1,transition:!0},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-fade-duration":{type:"number",default:300,minimum:0,function:"interpolated","zoom-function":!0,transition:!0,units:"milliseconds"}},paint_background:{"background-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,transition:!0,requires:[{"!":"background-pattern"}]},"background-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}}}},{}],66:[function(t,e,n){"use strict";function r(t){return!!(i()&&a()&&o()&&s()&&l()&&u()&&c()&&f(t&&t.failIfMajorPerformanceCaveat))}function i(){return"undefined"!=typeof window&&"undefined"!=typeof document}function a(){return Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray}function o(){return Function.prototype&&Function.prototype.bind}function s(){return Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions}function l(){return"JSON"in window&&"parse"in JSON&&"stringify"in JSON}function u(){return"Worker"in window}function c(){return"Uint8ClampedArray"in window}function f(t){return void 0===d[t]&&(d[t]=h(t)),d[t]}function h(t){var e=document.createElement("canvas"),n=Object.create(r.webGLContextAttributes);return n.failIfMajorPerformanceCaveat=t,e.probablySupportsContext?e.probablySupportsContext("webgl",n)||e.probablySupportsContext("experimental-webgl",n):e.supportsContext?e.supportsContext("webgl",n)||e.supportsContext("experimental-webgl",n):e.getContext("webgl",n)||e.getContext("experimental-webgl",n)}"undefined"!=typeof e&&e.exports?e.exports=r:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=r);var d={};r.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}},{}],67:[function(t,e,n){"use strict";function r(t){var e=t.layoutVertexArrayType;this.layoutVertexArray=new e;var n=t.elementArrayType;n&&(this.elementArray=new n);var r=t.elementArrayType2;r&&(this.elementArray2=new r),this.paintVertexArrays=i.mapObject(t.paintVertexArrayTypes,function(t){return new t})}var i=t("../util/util");e.exports=r,r.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,r.prototype.hasCapacityFor=function(t){return this.layoutVertexArray.length+t<=r.MAX_VERTEX_ARRAY_LENGTH},r.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},r.prototype.trim=function(){this.layoutVertexArray.trim(),this.elementArray&&this.elementArray.trim(),this.elementArray2&&this.elementArray2.trim();for(var t in this.paintVertexArrays)this.paintVertexArrays[t].trim()},r.prototype.serialize=function(){return{layoutVertexArray:this.layoutVertexArray.serialize(),elementArray:this.elementArray&&this.elementArray.serialize(),elementArray2:this.elementArray2&&this.elementArray2.serialize(),paintVertexArrays:i.mapObject(this.paintVertexArrays,function(t){return t.serialize()})}},r.prototype.getTransferables=function(t){t.push(this.layoutVertexArray.arrayBuffer),this.elementArray&&t.push(this.elementArray.arrayBuffer),this.elementArray2&&t.push(this.elementArray2.arrayBuffer);for(var e in this.paintVertexArrays)t.push(this.paintVertexArrays[e].arrayBuffer)}},{"../util/util":181}],68:[function(t,e,n){"use strict";function r(t){if(this.zoom=t.zoom,this.overscaling=t.overscaling,this.layer=t.layer,this.childLayers=t.childLayers,this.type=this.layer.type,this.features=[],this.id=this.layer.id,this.index=t.index,this.sourceLayer=this.layer.sourceLayer,this.sourceLayerIndex=t.sourceLayerIndex,this.minZoom=this.layer.minzoom,this.maxZoom=this.layer.maxzoom,this.paintAttributes=i(this),t.arrays){var e=this.programInterfaces;this.bufferGroups=c.mapObject(t.arrays,function(n,r){var i=e[r],a=t.paintVertexArrayTypes[r];return n.map(function(t){return new u(t,{layoutVertexArrayType:i.layoutVertexArrayType.serialize(),elementArrayType:i.elementArrayType&&i.elementArrayType.serialize(),elementArrayType2:i.elementArrayType2&&i.elementArrayType2.serialize(),paintVertexArrayTypes:a})})})}}function i(t){var e={};for(var n in t.programInterfaces){for(var r=e[n]={},i=0;i1?p.name+b:p.name;_[w]=m[b]*g}}},r.VertexArrayType=function(t){return new f({members:t,alignment:4})},r.ElementArrayType=function(t){return new f({members:[{type:"Uint16",name:"vertices",components:t||3}]})}},{"../util/struct_array":179,"../util/util":181,"./array_group":67,"./bucket/circle_bucket":69,"./bucket/fill_bucket":70,"./bucket/line_bucket":71,"./bucket/symbol_bucket":72,"./buffer_group":74,assert:6,"feature-filter":13}],69:[function(t,e,n){"use strict";function r(){i.apply(this,arguments)}var i=t("../bucket"),a=t("../../util/util"),o=t("../load_geometry"),s=i.EXTENT;e.exports=r,r.prototype=a.inherit(i,{}),r.prototype.addCircleVertex=function(t,e,n,r,i){return t.emplaceBack(2*e+(r+1)/2,2*n+(i+1)/2)},r.prototype.programInterfaces={circle:{layoutVertexArrayType:new i.VertexArrayType([{name:"a_pos",components:2,type:"Int16"}]),elementArrayType:new i.ElementArrayType,paintAttributes:[{name:"a_color",components:4,type:"Uint8",getValue:function(t,e,n){return t.getPaintValue("circle-color",e,n)},multiplier:255,paintProperty:"circle-color"},{name:"a_radius",components:1,type:"Uint16",isLayerConstant:!1,getValue:function(t,e,n){return[t.getPaintValue("circle-radius",e,n)]},multiplier:10,paintProperty:"circle-radius"},{name:"a_blur",components:1,type:"Uint16",isLayerConstant:!1,getValue:function(t,e,n){return[t.getPaintValue("circle-blur",e,n)]},multiplier:10,paintProperty:"circle-blur"},{name:"a_opacity",components:1,type:"Uint16",isLayerConstant:!1,getValue:function(t,e,n){return[t.getPaintValue("circle-opacity",e,n)]},multiplier:255,paintProperty:"circle-opacity"}]}},r.prototype.addFeature=function(t){for(var e={zoom:this.zoom},n=o(t),r=this.prepareArrayGroup("circle",0),i=r.layoutVertexArray.length,a=0;a=s||c<0||c>=s)){var f=this.prepareArrayGroup("circle",4),h=f.layoutVertexArray,d=this.addCircleVertex(h,u,c,-1,-1);this.addCircleVertex(h,u,c,1,-1),this.addCircleVertex(h,u,c,1,1),this.addCircleVertex(h,u,c,-1,1),f.elementArray.emplaceBack(d,d+1,d+2),f.elementArray.emplaceBack(d,d+3,d+2)}}this.populatePaintArrays("circle",e,t.properties,r,i)}},{"../../util/util":181,"../bucket":68,"../load_geometry":76}],70:[function(t,e,n){"use strict";function r(){i.apply(this,arguments)}var i=t("../bucket"),a=t("../../util/util"),o=t("../load_geometry"),s=t("earcut"),l=t("../../util/classify_rings"),u=500;e.exports=r,r.prototype=a.inherit(i,{}),r.prototype.programInterfaces={fill:{layoutVertexArrayType:new i.VertexArrayType([{name:"a_pos",components:2,type:"Int16"}]),elementArrayType:new i.ElementArrayType(1),elementArrayType2:new i.ElementArrayType(2),paintAttributes:[{name:"a_color",components:4,type:"Uint8",getValue:function(t,e,n){return t.getPaintValue("fill-color",e,n)},multiplier:255,paintProperty:"fill-color"},{name:"a_outline_color",components:4,type:"Uint8",getValue:function(t,e,n){return t.getPaintValue("fill-outline-color",e,n)},multiplier:255,paintProperty:"fill-outline-color"},{name:"a_opacity",components:1,type:"Uint8",getValue:function(t,e,n){return[t.getPaintValue("fill-opacity",e,n)]},multiplier:255,paintProperty:"fill-opacity"}]}},r.prototype.addFeature=function(t){for(var e=o(t),n=l(e,u),r=this.prepareArrayGroup("fill",0),i=r.layoutVertexArray.length,a=0;a0&&a.push(i.length/2);for(var c=0;c=1&&r.elementArray2.emplaceBack(h-1,h),i.push(f.x),i.push(f.y)}}for(var d=s(i,a),p=0;p>6)},r.prototype.programInterfaces={line:{layoutVertexArrayType:new i.VertexArrayType([{name:"a_pos",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}]),elementArrayType:new i.ElementArrayType}},r.prototype.addFeature=function(t){for(var e=o(t,f),n=0;n2&&t[a-1].equals(t[a-2]);)a--;if(!(t.length<2)){"bevel"===e&&(r=1.05);var o=c*(s/(512*this.overscaling)),l=t[0],f=t[a-1],h=l.equals(f);if(this.prepareArrayGroup("line",10*a),2!==a||!h){this.distance=0;var d,p,m,g,v,y,x,_=n,b=h?"butt":n,w=!0;this.e1=this.e2=this.e3=-1,h&&(d=t[a-2],v=l.sub(d)._unit()._perp());for(var M=0;M0){var z=d.dist(p);if(z>2*o){var E=d.sub(d.sub(p)._mult(o/z)._round());this.distance+=E.dist(p),this.addCurrentVertex(E,this.distance,g.mult(1),0,0,!1),p=E}}var L=p&&m,I=L?e:m?_:b;if(L&&"round"===I&&(Sr&&(I="bevel"),"bevel"===I&&(S>2&&(I="flipbevel"),S100)k=v.clone();else{var D=g.x*v.y-g.y*v.x>0?-1:1,P=S*g.add(v).mag()/g.sub(v).mag();k._perp()._mult(P*D)}this.addCurrentVertex(d,this.distance,k,0,0,!1),this.addCurrentVertex(d,this.distance,k.mult(-1),0,0,!1)}else if("bevel"===I||"fakeround"===I){var C=g.x*v.y-g.y*v.x>0,O=-Math.sqrt(S*S-1);if(C?(x=0,y=O):(y=0,x=O),w||this.addCurrentVertex(d,this.distance,g,y,x,!1),"fakeround"===I){for(var F,R=Math.floor(8*(.5-(A-.5))),j=0;j=0;N--)F=g.mult((N+1)/(R+1))._add(v)._unit(),this.addPieSliceVertex(d,this.distance,F,C)}m&&this.addCurrentVertex(d,this.distance,v,-y,-x,!1)}else"butt"===I?(w||this.addCurrentVertex(d,this.distance,g,0,0,!1),m&&this.addCurrentVertex(d,this.distance,v,0,0,!1)):"square"===I?(w||(this.addCurrentVertex(d,this.distance,g,1,1,!1),this.e1=this.e2=-1),m&&this.addCurrentVertex(d,this.distance,v,-1,-1,!1)):"round"===I&&(w||(this.addCurrentVertex(d,this.distance,g,0,0,!1),this.addCurrentVertex(d,this.distance,g,1,1,!0),this.e1=this.e2=-1),m&&(this.addCurrentVertex(d,this.distance,v,-1,-1,!0),this.addCurrentVertex(d,this.distance,v,0,0,!1)));if(T&&M2*o){var q=d.add(m.sub(d)._mult(o/B)._round());this.distance+=q.dist(d),this.addCurrentVertex(q,this.distance,v.mult(1),0,0,!1),d=q}}w=!1}}}},r.prototype.addCurrentVertex=function(t,e,n,r,i,a){var o,s=a?1:0,l=this.arrayGroups.line[this.arrayGroups.line.length-1],u=l.layoutVertexArray,c=l.elementArray;o=n.clone(),r&&o._sub(n.perp()._mult(r)),this.e3=this.addLineVertex(u,t,o,s,0,r,e),this.e1>=0&&this.e2>=0&&c.emplaceBack(this.e1,this.e2,this.e3),this.e1=this.e2,this.e2=this.e3,o=n.mult(-1),i&&o._sub(n.perp()._mult(i)),this.e3=this.addLineVertex(u,t,o,s,1,-i,e),this.e1>=0&&this.e2>=0&&c.emplaceBack(this.e1,this.e2,this.e3),this.e1=this.e2,this.e2=this.e3,e>d/2&&(this.distance=0,this.addCurrentVertex(t,this.distance,n,r,i,a))},r.prototype.addPieSliceVertex=function(t,e,n,r){var i=r?1:0;n=n.mult(r?-1:1);var a=this.arrayGroups.line[this.arrayGroups.line.length-1],o=a.layoutVertexArray,s=a.elementArray;this.e3=this.addLineVertex(o,t,n,0,i,0,e),this.e1>=0&&this.e2>=0&&s.emplaceBack(this.e1,this.e2,this.e3),r?this.e2=this.e3:this.e1=this.e3}},{"../../util/util":181,"../bucket":68,"../load_geometry":76}],72:[function(t,e,n){"use strict";function r(t){o.apply(this,arguments),this.showCollisionBoxes=t.showCollisionBoxes,this.overscaling=t.overscaling,this.collisionBoxArray=t.collisionBoxArray,this.symbolQuadsArray=t.symbolQuadsArray,this.symbolInstancesArray=t.symbolInstancesArray,this.sdfIcons=t.sdfIcons,this.iconsNeedLinear=t.iconsNeedLinear,this.adjustedTextSize=t.adjustedTextSize,this.adjustedIconSize=t.adjustedIconSize,this.fontstack=t.fontstack}function i(t,e,n,r,i,a,o,s,l,u,c){return t.emplaceBack(e,n,Math.round(64*r),Math.round(64*i),a/4,o/4,10*(u||0),c,10*(s||0),10*Math.min(l||25,25))}var a=t("point-geometry"),o=t("../bucket"),s=t("../../symbol/anchor"),l=t("../../symbol/get_anchors"),u=t("../../util/token"),c=t("../../symbol/quads"),f=t("../../symbol/shaping"),h=t("../../symbol/resolve_text"),d=t("../../symbol/mergelines"),p=t("../../symbol/clip_line"),m=t("../../util/util"),g=t("../load_geometry"),v=t("../../symbol/collision_feature"),y=f.shapeText,x=f.shapeIcon,_=c.getGlyphQuads,b=c.getIconQuads,w=o.EXTENT;e.exports=r,r.MAX_QUADS=65535,r.prototype=m.inherit(o,{}),r.prototype.serialize=function(){var t=o.prototype.serialize.apply(this);return t.sdfIcons=this.sdfIcons,t.iconsNeedLinear=this.iconsNeedLinear,t.adjustedTextSize=this.adjustedTextSize,t.adjustedIconSize=this.adjustedIconSize,t.fontstack=this.fontstack,t};var M=new o.VertexArrayType([{name:"a_pos",components:2,type:"Int16"},{name:"a_offset",components:2,type:"Int16"},{name:"a_texture_pos",components:2,type:"Uint16"},{name:"a_data",components:4,type:"Uint8"}]),k=new o.ElementArrayType;r.prototype.addCollisionBoxVertex=function(t,e,n,r,i){return t.emplaceBack(e.x,e.y,Math.round(n.x),Math.round(n.y),10*r,10*i)},r.prototype.programInterfaces={glyph:{layoutVertexArrayType:M,elementArrayType:k},icon:{layoutVertexArrayType:M,elementArrayType:k},collisionBox:{layoutVertexArrayType:new o.VertexArrayType([{name:"a_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"},{name:"a_data",components:2,type:"Uint8"}])}},r.prototype.populateArrays=function(t,e,n){var r={lastIntegerZoom:1/0,lastIntegerZoomTime:0,lastZoom:0};this.adjustedTextMaxSize=this.layer.getLayoutValue("text-size",{zoom:18,zoomHistory:r}),this.adjustedTextSize=this.layer.getLayoutValue("text-size",{zoom:this.zoom+1,zoomHistory:r}),this.adjustedIconMaxSize=this.layer.getLayoutValue("icon-size",{zoom:18,zoomHistory:r}),this.adjustedIconSize=this.layer.getLayoutValue("icon-size",{zoom:this.zoom+1,zoomHistory:r});var i=512*this.overscaling;this.tilePixelRatio=w/i,this.compareText={},this.iconsNeedLinear=!1,this.symbolInstancesStartIndex=this.symbolInstancesArray.length;var a=this.layer.layout,o=this.features,s=this.textFeatures,l=.5,c=.5;switch(a["text-anchor"]){case"right":case"top-right":case"bottom-right":l=1;break;case"left":case"top-left":case"bottom-left":l=0}switch(a["text-anchor"]){case"bottom":case"bottom-right":case"bottom-left":c=1;break;case"top":case"top-right":case"top-left":c=0}for(var f="right"===a["text-justify"]?1:"left"===a["text-justify"]?0:.5,h=24,p=a["text-line-height"]*h,v="line"!==a["symbol-placement"]?a["text-max-width"]*h:0,_=a["text-letter-spacing"]*h,b=[a["text-offset"][0]*h,a["text-offset"][1]*h],M=this.fontstack=a["text-font"].join(","),k=[],A=0;Aw||L.y<0||L.y>w);if(!m||I){var D=I||b;this.addSymbolInstance(L,T,e,n,this.layer,D,this.symbolInstancesArray.length,this.collisionBoxArray,r.index,this.sourceLayerIndex,this.index,c,g,x,h,v,_,{zoom:this.zoom},r.properties)}}}}},r.prototype.anchorIsTooClose=function(t,e,n){var r=this.compareText;if(t in r){for(var i=r[t],a=i.length-1;a>=0;a--)if(n.dist(i[a])3*Math.PI/2))){var g=p.tl,v=p.tr,y=p.bl,x=p.br,_=p.tex,b=p.anchorPoint,w=Math.max(f+Math.log(p.minScale)/Math.LN2,h),M=Math.min(f+Math.log(p.maxScale)/Math.LN2,25);if(!(M<=w)){w===h&&(w=0);var k=Math.round(p.glyphAngle/(2*Math.PI)*256),A=i(c,b.x,b.y,g.x,g.y,_.x,_.y,w,M,h,k);i(c,b.x,b.y,v.x,v.y,_.x+_.w,_.y,w,M,h,k),i(c,b.x,b.y,y.x,y.y,_.x,_.y+_.h,w,M,h,k),i(c,b.x,b.y,x.x,x.y,_.x+_.w,_.y+_.h,w,M,h,k),u.emplaceBack(A,A+1,A+2),u.emplaceBack(A+1,A+2,A+3)}}}},r.prototype.updateIcons=function(t){this.recalculateStyleLayers();var e=this.layer.layout["icon-image"];if(e)for(var n=0;nr.MAX_QUADS&&m.warnOnce("Too many symbols being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),A>r.MAX_QUADS&&m.warnOnce("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),this.symbolInstancesArray.emplaceBack(P,C,O,F,k,A,S,T,t.x,t.y,s)},r.prototype.addSymbolQuad=function(t){return this.symbolQuadsArray.emplaceBack(t.anchorPoint.x,t.anchorPoint.y,t.tl.x,t.tl.y,t.tr.x,t.tr.y,t.bl.x,t.bl.y,t.br.x,t.br.y,t.tex.h,t.tex.w,t.tex.x,t.tex.y,t.anchorAngle,t.glyphAngle,t.maxScale,t.minScale)}},{"../../symbol/anchor":130,"../../symbol/clip_line":132,"../../symbol/collision_feature":134,"../../symbol/get_anchors":136,"../../symbol/mergelines":139,"../../symbol/quads":140,"../../symbol/resolve_text":141,"../../symbol/shaping":142,"../../util/token":180,"../../util/util":181,"../bucket":68,"../load_geometry":76,"point-geometry":187}],73:[function(t,e,n){"use strict";function r(t,e,n){this.arrayBuffer=t.arrayBuffer,this.length=t.length,this.attributes=e.members,this.itemSize=e.bytesPerElement,this.type=n,this.arrayType=e}e.exports=r,r.prototype.bind=function(t){var e=t[this.type];this.buffer?t.bindBuffer(e,this.buffer):(this.buffer=t.createBuffer(),t.bindBuffer(e,this.buffer),t.bufferData(e,this.arrayBuffer,t.STATIC_DRAW),this.arrayBuffer=null)};var i={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT"};r.prototype.setVertexAttribPointers=function(t,e){for(var n=0;n0?t["line-gap-width"]+2*t["line-width"]:t["line-width"]}function s(t,e,n,r,i){if(!e[0]&&!e[1])return t;e=u.convert(e),"viewport"===n&&e._rotate(-r);for(var a=[],o=0;on.max||h.yn.max)&&i.warnOnce("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return l}},{"../util/util":181,"./bucket":68,assert:6}],77:[function(t,e,n){"use strict";function r(t,e,n){this.column=t,this.row=e,this.zoom=n}e.exports=r,r.prototype={clone:function(){return new r(this.column,this.row,this.zoom)},zoomTo:function(t){return this.clone()._zoomTo(t)},sub:function(t){return this.clone()._sub(t)},_zoomTo:function(t){var e=Math.pow(2,t-this.zoom);return this.column*=e,this.row*=e,this.zoom=t,this},_sub:function(t){return t=t.zoomTo(this.zoom),this.column-=t.column,this.row-=t.row,this}}},{}],78:[function(t,e,n){"use strict";function r(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}e.exports=r;var i=t("../util/util").wrap;r.prototype.wrap=function(){return new r(i(this.lng,-180,180),this.lat)},r.prototype.toArray=function(){return[this.lng,this.lat]},r.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},r.convert=function(t){return t instanceof r?t:Array.isArray(t)?new r(t[0],t[1]):t}},{"../util/util":181}],79:[function(t,e,n){"use strict";function r(t,e){t&&(e?this.extend(t).extend(e):4===t.length?this.extend([t[0],t[1]]).extend([t[2],t[3]]):this.extend(t[0]).extend(t[1]))}e.exports=r;var i=t("./lng_lat");r.prototype={extend:function(t){var e,n,a=this._sw,o=this._ne;if(t instanceof i)e=t,n=t;else{if(!(t instanceof r))return t?this.extend(i.convert(t)||r.convert(t)):this;if(e=t._sw,n=t._ne,!e||!n)return this}return a||o?(a.lng=Math.min(e.lng,a.lng),a.lat=Math.min(e.lat,a.lat),o.lng=Math.max(n.lng,o.lng),o.lat=Math.max(n.lat,o.lat)):(this._sw=new i(e.lng,e.lat),this._ne=new i(n.lng,n.lat)),this},getCenter:function(){return new i((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},getSouthWest:function(){return this._sw},getNorthEast:function(){return this._ne},getNorthWest:function(){return new i(this.getWest(),this.getNorth())},getSouthEast:function(){return new i(this.getEast(),this.getSouth())},getWest:function(){return this._sw.lng},getSouth:function(){return this._sw.lat},getEast:function(){return this._ne.lng},getNorth:function(){return this._ne.lat},toArray:function(){return[this._sw.toArray(),this._ne.toArray()]},toString:function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"}},r.convert=function(t){return!t||t instanceof r?t:new r(t)}},{"./lng_lat":78}],80:[function(t,e,n){"use strict";function r(t,e){this.tileSize=512,this._minZoom=t||0,this._maxZoom=e||22,this.latRange=[-85.05113,85.05113],this.width=0,this.height=0,this._center=new i(0,0),this.zoom=0,this.angle=0,this._altitude=1.5,this._pitch=0,this._unmodified=!0}var i=t("./lng_lat"),a=t("point-geometry"),o=t("./coordinate"),s=t("../util/util").wrap,l=t("../util/interpolate"),u=t("../source/tile_coord"),c=t("../data/bucket").EXTENT,f=t("gl-matrix"),h=f.vec4,d=f.mat4,p=f.mat2;e.exports=r,r.prototype={get minZoom(){return this._minZoom},set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},get maxZoom(){return this._maxZoom},set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},get worldSize(){return this.tileSize*this.scale},get centerPoint(){return this.size._div(2)},get size(){return new a(this.width,this.height)},get bearing(){return-this.angle/Math.PI*180},set bearing(t){var e=-s(t,-180,180)*Math.PI/180;this.angle!==e&&(this._unmodified=!1,this.angle=e,this._calcMatrices(),this.rotationMatrix=p.create(),p.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},get pitch(){return this._pitch/Math.PI*180},set pitch(t){var e=Math.min(60,t)/180*Math.PI;this._pitch!==e&&(this._unmodified=!1,this._pitch=e,this._calcMatrices())},get altitude(){return this._altitude},set altitude(t){var e=Math.max(.75,t);this._altitude!==e&&(this._unmodified=!1,this._altitude=e,this._calcMatrices())},get zoom(){return this._zoom},set zoom(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._calcMatrices(),this._constrain())},get center(){return this._center},set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._calcMatrices(),this._constrain())},coveringZoomLevel:function(t){return(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},coveringTiles:function(t){var e=this.coveringZoomLevel(t),n=e;if(et.maxzoom&&(e=t.maxzoom);var r=this,i=r.locationCoordinate(r.center)._zoomTo(e),o=new a(i.column-.5,i.row-.5);return u.cover(e,[r.pointCoordinate(new a(0,0))._zoomTo(e),r.pointCoordinate(new a(r.width,0))._zoomTo(e),r.pointCoordinate(new a(r.width,r.height))._zoomTo(e),r.pointCoordinate(new a(0,r.height))._zoomTo(e)],t.reparseOverscaled?n:e).sort(function(t,e){return o.dist(t)-o.dist(e)})},resize:function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._calcMatrices(),this._constrain()},get unmodified(){return this._unmodified},zoomScale:function(t){return Math.pow(2,t)},scaleZoom:function(t){return Math.log(t)/Math.LN2},project:function(t,e){return new a(this.lngX(t.lng,e),this.latY(t.lat,e))},unproject:function(t,e){return new i(this.xLng(t.x,e),this.yLat(t.y,e))},get x(){return this.lngX(this.center.lng)},get y(){return this.latY(this.center.lat)},get point(){return new a(this.x,this.y)},lngX:function(t,e){return(180+t)*(e||this.worldSize)/360},latY:function(t,e){var n=180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360));return(180-n)*(e||this.worldSize)/360},xLng:function(t,e){return 360*t/(e||this.worldSize)-180},yLat:function(t,e){var n=180-360*t/(e||this.worldSize);return 360/Math.PI*Math.atan(Math.exp(n*Math.PI/180))-90},panBy:function(t){var e=this.centerPoint._add(t);this.center=this.pointLocation(e)},setLocationAtPoint:function(t,e){var n=this.locationCoordinate(t),r=this.pointCoordinate(e),i=this.pointCoordinate(this.centerPoint),a=r._sub(n);this._unmodified=!1,this.center=this.coordinateLocation(i._sub(a))},locationPoint:function(t){return this.coordinatePoint(this.locationCoordinate(t))},pointLocation:function(t){return this.coordinateLocation(this.pointCoordinate(t))},locationCoordinate:function(t){var e=this.zoomScale(this.tileZoom)/this.worldSize,n=i.convert(t);return new o(this.lngX(n.lng)*e,this.latY(n.lat)*e,this.tileZoom)},coordinateLocation:function(t){var e=this.zoomScale(t.zoom);return new i(this.xLng(t.column,e),this.yLat(t.row,e))},pointCoordinate:function(t){var e=0,n=[t.x,t.y,0,1],r=[t.x,t.y,1,1];h.transformMat4(n,n,this.pixelMatrixInverse),h.transformMat4(r,r,this.pixelMatrixInverse);var i=n[3],a=r[3],s=n[0]/i,u=r[0]/a,c=n[1]/i,f=r[1]/a,d=n[2]/i,p=r[2]/a,m=d===p?0:(e-d)/(p-d),g=this.worldSize/this.zoomScale(this.tileZoom);return new o(l(s,u,m)/g,l(c,f,m)/g,this.tileZoom)},coordinatePoint:function(t){var e=this.worldSize/this.zoomScale(t.zoom),n=[t.column*e,t.row*e,0,1];return h.transformMat4(n,n,this.pixelMatrix),new a(n[0]/n[3],n[1]/n[3])},calculatePosMatrix:function(t,e){void 0===e&&(e=1/0),t instanceof u&&(t=t.toCoordinate(e));var n=Math.min(t.zoom,e),r=this.worldSize/Math.pow(2,n),i=new Float64Array(16);return d.identity(i),d.translate(i,i,[t.column*r,t.row*r,0]),d.scale(i,i,[r/c,r/c,1]),d.multiply(i,this.projMatrix,i),new Float32Array(i)},_constrain:function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,e,n,r,i,o,s,l,u=this.size,c=this._unmodified;this.latRange&&(t=this.latY(this.latRange[1]),e=this.latY(this.latRange[0]),i=e-te&&(l=e-d)}if(this.lngRange){var p=this.x,m=u.x/2;p-mr&&(s=r-m)}void 0===s&&void 0===l||(this.center=this.unproject(new a(void 0!==s?s:this.x,void 0!==l?l:this.y))),this._unmodified=c,this._constraining=!1}},_calcMatrices:function(){if(this.height){var t=Math.atan(.5/this.altitude),e=Math.sin(t)*this.altitude/Math.sin(Math.PI/2-this._pitch-t),n=Math.cos(Math.PI/2-this._pitch)*e+this.altitude,r=new Float64Array(16);if(d.perspective(r,2*Math.atan(this.height/2/this.altitude),this.width/this.height,.1,n),d.translate(r,r,[0,0,-this.altitude]),d.scale(r,r,[1,-1,1/this.height]),d.rotateX(r,r,this._pitch),d.rotateZ(r,r,this.angle),d.translate(r,r,[-this.x,-this.y,0]),this.projMatrix=r,r=d.create(),d.scale(r,r,[this.width/2,-this.height/2,1]),d.translate(r,r,[1,-1,0]),this.pixelMatrix=d.multiply(new Float64Array(16),r,this.projMatrix),r=d.invert(new Float64Array(16),this.pixelMatrix),!r)throw new Error("failed to invert matrix");this.pixelMatrixInverse=r}}}},{"../data/bucket":68,"../source/tile_coord":108,"../util/interpolate":175,"../util/util":181,"./coordinate":77,"./lng_lat":78,"gl-matrix":25,"point-geometry":187}],81:[function(t,e,n){"use strict";var r={" ":[16,[]],"!":[10,[5,21,5,7,-1,-1,5,2,4,1,5,0,6,1,5,2]],'"':[16,[4,21,4,14,-1,-1,12,21,12,14]],"#":[21,[11,25,4,-7,-1,-1,17,25,10,-7,-1,-1,4,12,18,12,-1,-1,3,6,17,6]],$:[20,[8,25,8,-4,-1,-1,12,25,12,-4,-1,-1,17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],"%":[24,[21,21,3,0,-1,-1,8,21,10,19,10,17,9,15,7,14,5,14,3,16,3,18,4,20,6,21,8,21,10,20,13,19,16,19,19,20,21,21,-1,-1,17,7,15,6,14,4,14,2,16,0,18,0,20,1,21,3,21,5,19,7,17,7]],"&":[26,[23,12,23,13,22,14,21,14,20,13,19,11,17,6,15,3,13,1,11,0,7,0,5,1,4,2,3,4,3,6,4,8,5,9,12,13,13,14,14,16,14,18,13,20,11,21,9,20,8,18,8,16,9,13,11,10,16,3,18,1,20,0,22,0,23,1,23,2]],"'":[10,[5,19,4,20,5,21,6,20,6,18,5,16,4,15]],"(":[14,[11,25,9,23,7,20,5,16,4,11,4,7,5,2,7,-2,9,-5,11,-7]],")":[14,[3,25,5,23,7,20,9,16,10,11,10,7,9,2,7,-2,5,-5,3,-7]],"*":[16,[8,21,8,9,-1,-1,3,18,13,12,-1,-1,13,18,3,12]],"+":[26,[13,18,13,0,-1,-1,4,9,22,9]],",":[10,[6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"-":[26,[4,9,22,9]],".":[10,[5,2,4,1,5,0,6,1,5,2]],"/":[22,[20,25,2,-7]],0:[20,[9,21,6,20,4,17,3,12,3,9,4,4,6,1,9,0,11,0,14,1,16,4,17,9,17,12,16,17,14,20,11,21,9,21]],1:[20,[6,17,8,18,11,21,11,0]],2:[20,[4,16,4,17,5,19,6,20,8,21,12,21,14,20,15,19,16,17,16,15,15,13,13,10,3,0,17,0]],3:[20,[5,21,16,21,10,13,13,13,15,12,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],4:[20,[13,21,3,7,18,7,-1,-1,13,21,13,0]],5:[20,[15,21,5,21,4,12,5,13,8,14,11,14,14,13,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],6:[20,[16,18,15,20,12,21,10,21,7,20,5,17,4,12,4,7,5,3,7,1,10,0,11,0,14,1,16,3,17,6,17,7,16,10,14,12,11,13,10,13,7,12,5,10,4,7]],7:[20,[17,21,7,0,-1,-1,3,21,17,21]],8:[20,[8,21,5,20,4,18,4,16,5,14,7,13,11,12,14,11,16,9,17,7,17,4,16,2,15,1,12,0,8,0,5,1,4,2,3,4,3,7,4,9,6,11,9,12,13,13,15,14,16,16,16,18,15,20,12,21,8,21]],9:[20,[16,14,15,11,13,9,10,8,9,8,6,9,4,11,3,14,3,15,4,18,6,20,9,21,10,21,13,20,15,18,16,14,16,9,15,4,13,1,10,0,8,0,5,1,4,3]],":":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,5,2,4,1,5,0,6,1,5,2]],";":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"<":[24,[20,18,4,9,20,0]],"=":[26,[4,12,22,12,-1,-1,4,6,22,6]],">":[24,[4,18,20,9,4,0]],"?":[18,[3,16,3,17,4,19,5,20,7,21,11,21,13,20,14,19,15,17,15,15,14,13,13,12,9,10,9,7,-1,-1,9,2,8,1,9,0,10,1,9,2]],"@":[27,[18,13,17,15,15,16,12,16,10,15,9,14,8,11,8,8,9,6,11,5,14,5,16,6,17,8,-1,-1,12,16,10,14,9,11,9,8,10,6,11,5,-1,-1,18,16,17,8,17,6,19,5,21,5,23,7,24,10,24,12,23,15,22,17,20,19,18,20,15,21,12,21,9,20,7,19,5,17,4,15,3,12,3,9,4,6,5,4,7,2,9,1,12,0,15,0,18,1,20,2,21,3,-1,-1,19,16,18,8,18,6,19,5]],A:[18,[9,21,1,0,-1,-1,9,21,17,0,-1,-1,4,7,14,7]],B:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,-1,-1,4,11,13,11,16,10,17,9,18,7,18,4,17,2,16,1,13,0,4,0]],C:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5]],D:[21,[4,21,4,0,-1,-1,4,21,11,21,14,20,16,18,17,16,18,13,18,8,17,5,16,3,14,1,11,0,4,0]],E:[19,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11,-1,-1,4,0,17,0]],F:[18,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11]],G:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,18,8,-1,-1,13,8,18,8]],H:[22,[4,21,4,0,-1,-1,18,21,18,0,-1,-1,4,11,18,11]],I:[8,[4,21,4,0]],J:[16,[12,21,12,5,11,2,10,1,8,0,6,0,4,1,3,2,2,5,2,7]],K:[21,[4,21,4,0,-1,-1,18,21,4,7,-1,-1,9,12,18,0]],L:[17,[4,21,4,0,-1,-1,4,0,16,0]],M:[24,[4,21,4,0,-1,-1,4,21,12,0,-1,-1,20,21,12,0,-1,-1,20,21,20,0]],N:[22,[4,21,4,0,-1,-1,4,21,18,0,-1,-1,18,21,18,0]],O:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21]],P:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,14,17,12,16,11,13,10,4,10]],Q:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21,-1,-1,12,4,18,-2]],R:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,4,11,-1,-1,11,11,18,0]],S:[20,[17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],T:[16,[8,21,8,0,-1,-1,1,21,15,21]],U:[22,[4,21,4,6,5,3,7,1,10,0,12,0,15,1,17,3,18,6,18,21]],V:[18,[1,21,9,0,-1,-1,17,21,9,0]],W:[24,[2,21,7,0,-1,-1,12,21,7,0,-1,-1,12,21,17,0,-1,-1,22,21,17,0]],X:[20,[3,21,17,0,-1,-1,17,21,3,0]],Y:[18,[1,21,9,11,9,0,-1,-1,17,21,9,11]],Z:[20,[17,21,3,0,-1,-1,3,21,17,21,-1,-1,3,0,17,0]],"[":[14,[4,25,4,-7,-1,-1,5,25,5,-7,-1,-1,4,25,11,25,-1,-1,4,-7,11,-7]],"\\":[14,[0,21,14,-3]],"]":[14,[9,25,9,-7,-1,-1,10,25,10,-7,-1,-1,3,25,10,25,-1,-1,3,-7,10,-7]],"^":[16,[6,15,8,18,10,15,-1,-1,3,12,8,17,13,12,-1,-1,8,17,8,0]],_:[16,[0,-2,16,-2]],"`":[10,[6,21,5,20,4,18,4,16,5,15,6,16,5,17]],a:[19,[15,14,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],b:[19,[4,21,4,0,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],c:[18,[15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],d:[19,[15,21,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],e:[18,[3,8,15,8,15,10,14,12,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],f:[12,[10,21,8,21,6,20,5,17,5,0,-1,-1,2,14,9,14]],g:[19,[15,14,15,-2,14,-5,13,-6,11,-7,8,-7,6,-6,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],h:[19,[4,21,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],i:[8,[3,21,4,20,5,21,4,22,3,21,-1,-1,4,14,4,0]],j:[10,[5,21,6,20,7,21,6,22,5,21,-1,-1,6,14,6,-3,5,-6,3,-7,1,-7]],k:[17,[4,21,4,0,-1,-1,14,14,4,4,-1,-1,8,8,15,0]],l:[8,[4,21,4,0]],m:[30,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0,-1,-1,15,10,18,13,20,14,23,14,25,13,26,10,26,0]],n:[19,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],o:[19,[8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,16,6,16,8,15,11,13,13,11,14,8,14]],p:[19,[4,14,4,-7,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],q:[19,[15,14,15,-7,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],r:[13,[4,14,4,0,-1,-1,4,8,5,11,7,13,9,14,12,14]],s:[17,[14,11,13,13,10,14,7,14,4,13,3,11,4,9,6,8,11,7,13,6,14,4,14,3,13,1,10,0,7,0,4,1,3,3]],t:[12,[5,21,5,4,6,1,8,0,10,0,-1,-1,2,14,9,14]],u:[19,[4,14,4,4,5,1,7,0,10,0,12,1,15,4,-1,-1,15,14,15,0]],v:[16,[2,14,8,0,-1,-1,14,14,8,0]],w:[22,[3,14,7,0,-1,-1,11,14,7,0,-1,-1,11,14,15,0,-1,-1,19,14,15,0]],x:[17,[3,14,14,0,-1,-1,14,14,3,0]],y:[16,[2,14,8,0,-1,-1,14,14,8,0,6,-4,4,-6,2,-7,1,-7]],z:[17,[14,14,3,0,-1,-1,3,14,14,14,-1,-1,3,0,14,0]],"{":[14,[9,25,7,24,6,23,5,21,5,19,6,17,7,16,8,14,8,12,6,10,-1,-1,7,24,6,22,6,20,7,18,8,17,9,15,9,13,8,11,4,9,8,7,9,5,9,3,8,1,7,0,6,-2,6,-4,7,-6,-1,-1,6,8,8,6,8,4,7,2,6,1,5,-1,5,-3,6,-5,7,-6,9,-7]],"|":[8,[4,25,4,-7]],"}":[14,[5,25,7,24,8,23,9,21,9,19,8,17,7,16,6,14,6,12,8,10,-1,-1,7,24,8,22,8,20,7,18,6,17,5,15,5,13,6,11,10,9,6,7,5,5,5,3,6,1,7,0,8,-2,8,-4,7,-6,-1,-1,8,8,6,6,6,4,7,2,8,1,9,-1,9,-3,8,-5,7,-6,5,-7]],"~":[24,[3,6,3,8,4,11,6,12,8,12,10,11,14,8,16,7,18,7,20,8,21,10,-1,-1,3,8,4,10,6,11,8,11,10,10,14,7,16,6,18,6,20,7,21,10,21,12]]};e.exports=function(t,e,n,i){i=i||1;var a,o,s,l,u,c,f,h,d=[];for(a=0,o=t.length;a>16,b>>16),s.uniform2f(r.u_pixel_coord_lower,65535&_,65535&b)}s.uniformMatrix4fv(r.u_matrix,!1,t.transform.calculatePosMatrix(v)),s.drawArrays(s.TRIANGLE_STRIP,0,t.tileExtentBuffer.length)}s.stencilMask(0),s.stencilFunc(s.EQUAL,128,128)}var i=t("../source/pixels_to_tile_units"),a=t("./create_uniform_pragmas"),o=512;e.exports=r},{"../source/pixels_to_tile_units":102,"./create_uniform_pragmas":83}],85:[function(t,e,n){"use strict";function r(t,e,n,r){if(!t.isOpaquePass){var a=t.gl;t.setDepthSublayer(0),t.depthMask(!1),a.disable(a.STENCIL_TEST);for(var o=0;o>16,h>>16),o.uniform2f(a.u_pixel_coord_lower,65535&f,65535&h),o.activeTexture(o.TEXTURE0),i.spriteAtlas.bind(o,!0)}}var s=t("../source/pixels_to_tile_units");e.exports=r},{"../source/pixels_to_tile_units":102}],89:[function(t,e,n){"use strict";var r=t("../util/browser"),i=t("gl-matrix").mat2,a=t("../source/pixels_to_tile_units");e.exports=function(t,e,n,o){if(!t.isOpaquePass){t.setDepthSublayer(0),t.depthMask(!1);var s=t.gl;if(s.enable(s.STENCIL_TEST),!(n.paint["line-width"]<=0)){var l=1/r.devicePixelRatio,u=n.paint["line-blur"]+l,c=n.paint["line-color"],f=t.transform,h=i.create();i.scale(h,h,[1,Math.cos(f._pitch)]),i.rotate(h,h,t.transform.angle);var d,p,m,g,v,y=Math.sqrt(f.height*f.height/4*(1+f.altitude*f.altitude)),x=f.height/2*Math.tan(f._pitch),_=(y+x)/y-1,b=n.paint["line-dasharray"],w=n.paint["line-pattern"];if(b)d=t.useProgram("linesdfpattern"),s.uniform1f(d.u_linewidth,n.paint["line-width"]/2),s.uniform1f(d.u_gapwidth,n.paint["line-gap-width"]/2),s.uniform1f(d.u_antialiasing,l/2),s.uniform1f(d.u_blur,u),s.uniform4fv(d.u_color,c),s.uniform1f(d.u_opacity,n.paint["line-opacity"]),p=t.lineAtlas.getDash(b.from,"round"===n.layout["line-cap"]),m=t.lineAtlas.getDash(b.to,"round"===n.layout["line-cap"]),s.uniform1i(d.u_image,0),s.activeTexture(s.TEXTURE0),t.lineAtlas.bind(s),s.uniform1f(d.u_tex_y_a,p.y),s.uniform1f(d.u_tex_y_b,m.y),s.uniform1f(d.u_mix,b.t),s.uniform1f(d.u_extra,_),s.uniform1f(d.u_offset,-n.paint["line-offset"]),s.uniformMatrix2fv(d.u_antialiasingmatrix,!1,h);else if(w){if(g=t.spriteAtlas.getPosition(w.from,!0),v=t.spriteAtlas.getPosition(w.to,!0),!g||!v)return;d=t.useProgram("linepattern"),s.uniform1i(d.u_image,0),s.activeTexture(s.TEXTURE0),t.spriteAtlas.bind(s,!0),s.uniform1f(d.u_linewidth,n.paint["line-width"]/2),s.uniform1f(d.u_gapwidth,n.paint["line-gap-width"]/2),s.uniform1f(d.u_antialiasing,l/2),s.uniform1f(d.u_blur,u),s.uniform2fv(d.u_pattern_tl_a,g.tl),s.uniform2fv(d.u_pattern_br_a,g.br),s.uniform2fv(d.u_pattern_tl_b,v.tl),s.uniform2fv(d.u_pattern_br_b,v.br),s.uniform1f(d.u_fade,w.t),s.uniform1f(d.u_opacity,n.paint["line-opacity"]),s.uniform1f(d.u_extra,_),s.uniform1f(d.u_offset,-n.paint["line-offset"]),s.uniformMatrix2fv(d.u_antialiasingmatrix,!1,h)}else d=t.useProgram("line"),s.uniform1f(d.u_linewidth,n.paint["line-width"]/2),s.uniform1f(d.u_gapwidth,n.paint["line-gap-width"]/2),s.uniform1f(d.u_antialiasing,l/2),s.uniform1f(d.u_blur,u),s.uniform1f(d.u_extra,_),s.uniform1f(d.u_offset,-n.paint["line-offset"]),s.uniformMatrix2fv(d.u_antialiasingmatrix,!1,h),s.uniform4fv(d.u_color,c),s.uniform1f(d.u_opacity,n.paint["line-opacity"]);for(var M=0;M0?1/(1-t):1+t}function s(t){return t>0?1-1/(1.001-t):-t}function l(t,e,n,r){var i=[1,0],a=n.paint["raster-fade-duration"];if(t.source&&a>0){var o=(new Date).getTime(),s=(o-t.timeAdded)/a,l=e?(o-e.timeAdded)/a:-1,c=r.coveringZoomLevel(t.source),f=!!e&&Math.abs(e.coord.z-c)>Math.abs(t.coord.z-c);!e||f?(i[0]=u.clamp(s,0,1),i[1]=1-i[0]):(i[0]=u.clamp(1-l,0,1),i[1]=1-i[0])}var h=n.paint["raster-opacity"];return i[0]*=h,i[1]*=h,i}var u=t("../util/util"),c=t("../util/struct_array");e.exports=r,r.RasterBoundsArray=new c({members:[{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]})},{"../util/struct_array":179,"../util/util":181}],91:[function(t,e,n){"use strict";function r(t,e,n,r){if(!t.isOpaquePass){var a=!(n.layout["text-allow-overlap"]||n.layout["icon-allow-overlap"]||n.layout["text-ignore-placement"]||n.layout["icon-ignore-placement"]),o=t.gl;a?o.disable(o.STENCIL_TEST):o.enable(o.STENCIL_TEST),t.setDepthSublayer(0),t.depthMask(!1),o.disable(o.DEPTH_TEST),i(t,e,n,r,!1,n.paint["icon-translate"],n.paint["icon-translate-anchor"],n.layout["icon-rotation-alignment"],n.layout["icon-rotation-alignment"],n.layout["icon-size"],n.paint["icon-halo-width"],n.paint["icon-halo-color"],n.paint["icon-halo-blur"],n.paint["icon-opacity"],n.paint["icon-color"]),i(t,e,n,r,!0,n.paint["text-translate"],n.paint["text-translate-anchor"],n.layout["text-rotation-alignment"],n.layout["text-pitch-alignment"],n.layout["text-size"],n.paint["text-halo-width"],n.paint["text-halo-color"],n.paint["text-halo-blur"],n.paint["text-opacity"],n.paint["text-color"]),o.enable(o.DEPTH_TEST),e.map.showCollisionBoxes&&s(t,e,n,r)}}function i(t,e,n,r,i,o,s,l,u,c,f,h,d,p,m){for(var g=0;gthis.previousZoom;n--)this.changeTimes[n]=e,this.changeOpacities[n]=this.opacities[n];for(n=0;n<256;n++){var r=e-this.changeTimes[n],i=r/this.fadeDuration*255;n<=t?this.opacities[n]=this.changeOpacities[n]+i:this.opacities[n]=this.changeOpacities[n]-i}this.changed=!0,this.previousZoom=t},r.prototype.bind=function(t){this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.changed&&(t.texSubImage2D(t.TEXTURE_2D,0,0,0,256,1,t.ALPHA,t.UNSIGNED_BYTE,this.array),this.changed=!1)):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,256,1,0,t.ALPHA,t.UNSIGNED_BYTE,this.array))}},{}],93:[function(t,e,n){"use strict";function r(t,e){this.width=t,this.height=e,this.nextRow=0,this.bytes=4,this.data=new Uint8Array(this.width*this.height*this.bytes),this.positions={}}var i=t("../util/util");e.exports=r,r.prototype.setSprite=function(t){this.sprite=t},r.prototype.getDash=function(t,e){var n=t.join(",")+e;return this.positions[n]||(this.positions[n]=this.addDash(t,e)),this.positions[n]},r.prototype.addDash=function(t,e){var n=e?7:0,r=2*n+1,a=128;if(this.nextRow+r>this.height)return i.warnOnce("LineAtlas out of space"),null;for(var o=0,s=0;s0?e.pop():null},r.prototype.lineWidth=function(t){this.gl.lineWidth(c.clamp(t,this.lineWidthRange[0],this.lineWidthRange[1]))},r.prototype.showOverdrawInspector=function(t){if(t||this._showOverdrawInspector){this._showOverdrawInspector=t;var e=this.gl;if(t){e.blendFunc(e.CONSTANT_COLOR,e.ONE);var n=8,r=1/n;e.blendColor(r,r,r,0),e.clearColor(0,0,0,1),e.clear(e.COLOR_BUFFER_BIT)}else e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA)}}},{"../data/bucket":68,"../data/buffer":73,"../source/pixels_to_tile_units":102,"../source/source_cache":106,"../util/browser":165,"../util/struct_array":179,"../util/util":181,"./create_uniform_pragmas":83,"./draw_background":84,"./draw_circle":85,"./draw_debug":87,"./draw_fill":88,"./draw_line":89,"./draw_raster":90,"./draw_symbol":91,"./frame_history":92,"./painter/use_program":95,"./vertex_array_object":96,"gl-matrix":25}],95:[function(t,e,n){"use strict";function r(t,e){return t.replace(/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,function(t,n,r,i,a){return e[n][a].replace(/{type}/g,i).replace(/{precision}/g,r)})}var i=t("assert"),a=t("../../util/util"),o=t("mapbox-gl-shaders"),s=o.util;e.exports._createProgram=function(t,e,n,l){for(var u=this.gl,c=u.createProgram(),f=o[t],h="#define MAPBOX_GL_JS;\n",d=0;dthis.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,r={type:this.type,uid:t.uid,coord:t.coord,zoom:t.coord.z,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,overscaling:n,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID=this.dispatcher.send("load tile",r,function(n,r){if(t.unloadVectorData(this.map.painter),!t.aborted)return n?e(n):(t.loadVectorData(r,this.map.style),t.redoWhenDone&&(t.redoWhenDone=!1,t.redoPlacement(this)),e(null))}.bind(this),this.workerID)},abortTile:function(t){t.aborted=!0},unloadTile:function(t){t.unloadVectorData(this.map.painter),this.dispatcher.send("remove tile",{uid:t.uid,source:this.id},function(){},t.workerID)},serialize:function(){return{type:this.type,data:this._data}}})},{"../data/bucket":68,"../util/evented":173,"../util/util":181,"resolve-url":194}],98:[function(t,e,n){"use strict";function r(t,e,n){n&&(this.loadGeoJSON=n),f.call(this,t,e)}var i=t("../util/util"),a=t("../util/ajax"),o=t("geojson-rewind"),s=t("./geojson_wrapper"),l=t("vt-pbf"),u=t("supercluster"),c=t("geojson-vt"),f=t("./vector_tile_worker_source");e.exports=r,r.prototype=i.inherit(f,{_geoJSONIndexes:{},loadVectorData:function(t,e){var n=t.source,r=t.coord;if(!this._geoJSONIndexes[n])return e(null,null);var i=this._geoJSONIndexes[n].getTile(Math.min(r.z,t.maxZoom),r.x,r.y);if(!i)return e(null,null);var a=new s(i.features);a.name="_geojsonTileLayer";var o=l({layers:{_geojsonTileLayer:a}});0===o.byteOffset&&o.byteLength===o.buffer.byteLength||(o=new Uint8Array(o)),e(null,{tile:a,rawTileData:o.buffer})},loadData:function(t,e){var n=function(n,r){return n?e(n):"object"!=typeof r?e(new Error("Input data is not a valid GeoJSON object.")):(o(r,!0),void this._indexData(r,t,function(n,r){return n?e(n):(this._geoJSONIndexes[t.source]=r,void e(null))}.bind(this)))}.bind(this);this.loadGeoJSON(t,n)},loadGeoJSON:function(t,e){if(t.url)a.getJSON(t.url,e);else{if("string"!=typeof t.data)return e(new Error("Input data is not a valid GeoJSON object."));try{return e(null,JSON.parse(t.data))}catch(t){return e(new Error("Input data is not a valid GeoJSON object."))}}},_indexData:function(t,e,n){try{e.cluster?n(null,u(e.superclusterOptions).load(t.features)):n(null,c(t,e.geojsonVtOptions))}catch(t){return n(t)}}})},{"../util/ajax":164,"../util/util":181,"./geojson_wrapper":99,"./vector_tile_worker_source":110,"geojson-rewind":15,"geojson-vt":19,supercluster:196,"vt-pbf":208}],99:[function(t,e,n){"use strict";function r(t){this.features=t,this.length=t.length,this.extent=s}function i(t){if(this.type=t.type,1===t.type){this.rawGeometry=[];for(var e=0;ee)){var o=Math.pow(2,Math.min(a.coord.z,this.maxzoom)-Math.min(t.z,this.maxzoom));if(Math.floor(a.coord.x/o)===t.x&&Math.floor(a.coord.y/o)===t.y)for(n[i]=!0,r=!0;a&&a.coord.z-1>t.z;){var s=a.coord.parent(this.maxzoom).id;a=this._tiles[s],a&&a.isRenderable()&&(delete n[i],n[s]=!0)}}}return r},findLoadedParent:function(t,e,n){for(var r=t.z-1;r>=e;r--){t=t.parent(this.maxzoom);var i=this._tiles[t.id];if(i&&i.isRenderable())return n[t.id]=!0,i;if(this._cache.has(t.id))return this.addTile(t),n[t.id]=!0,this._tiles[t.id]}},updateCacheSize:function(t){var e=Math.ceil(t.width/t.tileSize)+1,n=Math.ceil(t.height/t.tileSize)+1,r=e*n,i=5;this._cache.setMaxSize(Math.floor(r*i))},update:function(t,e){if(this._sourceLoaded){var n,i,a;this.updateCacheSize(t);var o=(this.roundZoom?Math.round:Math.floor)(this.getZoom(t)),s=Math.max(o-r.maxOverzooming,this.minzoom),l=Math.max(o+r.maxUnderzooming,this.minzoom),c={},f=(new Date).getTime();this._coveredTiles={};var d=this.used?t.coveringTiles(this._source):[];for(n=0;nf-(e||0)&&(this.findLoadedChildren(i,l,c)&&(c[v]=!0),this.findLoadedParent(i,s,p))}var y;for(y in p)c[y]||(this._coveredTiles[y]=!0);for(y in p)c[y]=!0;var x=h.keysDifference(this._tiles,c);for(n=0;nthis.maxzoom?Math.pow(2,r-this.maxzoom):1;e=new s(n,this.tileSize*i,this.maxzoom),this.loadTile(e,this._tileLoaded.bind(this,e))}return e.uses++,this._tiles[t.id]=e,this.fire("tile.add",{tile:e}),this._source.fire("tile.add",{tile:e}),e},removeTile:function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this.fire("tile.remove",{tile:e}),this._source.fire("tile.remove",{tile:e}),e.uses>0||(e.isRenderable()?this._cache.add(e.coord.wrapped().id,e):(e.aborted=!0,this.abortTile(e),this.unloadTile(e))))},clearTiles:function(){for(var t in this._tiles)this.removeTile(t);this._cache.reset()},tilesIn:function(t){for(var e={},n=this.getIds(),r=1/0,a=1/0,o=-(1/0),s=-(1/0),l=t[0].zoom,c=0;c=0&&v[1].y>=0){for(var y=[],x=0;x=0&&t%1===0),l(!isNaN(e)&&e>=0&&e%1===0),l(!isNaN(n)&&n>=0&&n%1===0),isNaN(r)&&(r=0),this.z=+t,this.x=+e,this.y=+n,this.w=+r,r*=2,r<0&&(r=r*-1-1);var i=1<0;a--)r=1<e.row){var n=t;t=e,e=n}return{x0:t.column,y0:t.row,x1:e.column,y1:e.row,dx:e.column-t.column,dy:e.row-t.row}}function o(t,e,n,r,i){var a=Math.max(n,Math.floor(e.y0)),o=Math.min(r,Math.ceil(e.y1));if(t.x0===e.x0&&t.y0===e.y0?t.x0+e.dy/t.dy*t.dx0,f=e.dx<0,h=a;hc.dy&&(l=u,u=c,c=l),u.dy>f.dy&&(l=u,u=f,f=l),c.dy>f.dy&&(l=c,c=f,f=l),u.dy&&o(f,u,r,i,s),c.dy&&o(f,c,r,i,s)}var l=t("assert"),u=t("whoots-js"),c=t("../geo/coordinate");e.exports=r,r.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y},r.prototype.toCoordinate=function(t){var e=Math.min(this.z,t),n=Math.pow(2,e),r=this.y,i=this.x+n*this.w;return new c(i,r,e)},r.fromID=function(t){var e=t%32,n=1<t?new r(this.z-1,this.x,this.y,this.w):new r(this.z-1,Math.floor(this.x/2),Math.floor(this.y/2),this.w)},r.prototype.wrapped=function(){return new r(this.z,this.x,this.y,0)},r.prototype.children=function(t){if(this.z>=t)return[new r(this.z+1,this.x,this.y,this.w)];var e=this.z+1,n=2*this.x,i=2*this.y;return[new r(e,n,i,this.w),new r(e,n+1,i,this.w),new r(e,n,i+1,this.w),new r(e,n+1,i+1,this.w)]},r.cover=function(t,e,n){function i(t,e,i){var s,l,u;if(i>=0&&i<=a)for(s=t;sthis.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,i={url:s(t.coord.url(this.tiles,this.maxzoom,this.scheme),this.url),uid:t.uid,coord:t.coord,zoom:t.coord.z,tileSize:this.tileSize*r,source:this.id,overscaling:r,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID?"loading"===t.state?t.reloadCallback=e:(i.rawTileData=t.rawTileData,this.dispatcher.send("reload tile",i,n.bind(this),t.workerID)):t.workerID=this.dispatcher.send("load tile",i,n.bind(this))},abortTile:function(t){this.dispatcher.send("abort tile",{uid:t.uid,source:this.id},null,t.workerID)},unloadTile:function(t){t.unloadVectorData(this.map.painter),this.dispatcher.send("remove tile",{uid:t.uid,source:this.id},null,t.workerID)}})},{"../util/evented":173,"../util/mapbox":178,"../util/util":181,"./load_tilejson":101}],110:[function(t,e,n){"use strict";function r(t,e,n){this.actor=t,this.styleLayers=e,n&&(this.loadVectorData=n),this.loading={},this.loaded={}}var i=t("../util/ajax"),a=t("vector-tile"),o=t("pbf"),s=t("./worker_tile");e.exports=r,r.prototype={loadTile:function(t,e){function n(t,n){return delete this.loading[r][i],t?e(t):n?(a.data=n.tile,a.parse(a.data,this.styleLayers.getLayerFamilies(),this.actor,n.rawTileData,e),this.loaded[r]=this.loaded[r]||{},void(this.loaded[r][i]=a)):e(null,null)}var r=t.source,i=t.uid;this.loading[r]||(this.loading[r]={});var a=this.loading[r][i]=new s(t);a.abort=this.loadVectorData(t,n.bind(this))},reloadTile:function(t,e){var n=this.loaded[t.source],r=t.uid;if(n&&n[r]){var i=n[r];i.parse(i.data,this.styleLayers.getLayerFamilies(),this.actor,t.rawTileData,e)}},abortTile:function(t){var e=this.loading[t.source],n=t.uid;e&&e[n]&&e[n].abort&&(e[n].abort(),delete e[n])},removeTile:function(t){var e=this.loaded[t.source],n=t.uid;e&&e[n]&&delete e[n]},loadVectorData:function(t,e){function n(t,n){if(t)return e(t);var r=new a.VectorTile(new o(new Uint8Array(n)));e(t,{tile:r,rawTileData:n})}var r=i.getArrayBuffer(t.url,n.bind(this));return function(){r.abort()}},redoPlacement:function(t,e){var n=this.loaded[t.source],r=this.loading[t.source],i=t.uid;if(n&&n[i]){var a=n[i],o=a.redoPlacement(t.angle,t.pitch,t.showCollisionBoxes);o.result&&e(null,o.result,o.transferables)}else r&&r[i]&&(r[i].angle=t.angle)}}},{"../util/ajax":164,"./worker_tile":113,pbf:186,"vector-tile":204}],111:[function(t,e,n){"use strict";function r(t,e){this.id=t,this.urls=e.urls,this.coordinates=e.coordinates,u.getVideo(e.urls,function(t,n){if(t)return this.fire("error",{error:t});this.video=n,this.video.loop=!0;var r;this.video.addEventListener("playing",function(){r=this.map.style.animationLoop.set(1/0),this.map._rerender()}.bind(this)),this.video.addEventListener("pause",function(){this.map.style.animationLoop.cancel(r)}.bind(this)),this.map&&(this.video.play(),this.setCoordinates(e.coordinates)),this.fire("load")}.bind(this))}var i=t("../util/util"),a=t("./tile_coord"),o=t("../geo/lng_lat"),s=t("point-geometry"),l=t("../util/evented"),u=t("../util/ajax"),c=t("../data/bucket").EXTENT,f=t("../render/draw_raster").RasterBoundsArray,h=t("../data/buffer"),d=t("../render/vertex_array_object");e.exports=r,r.prototype=i.inherit(l,{minzoom:0,maxzoom:22,tileSize:512,roundZoom:!0,getVideo:function(){return this.video},onAdd:function(t){this.map||(this.map=t,this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},setCoordinates:function(t){this.coordinates=t;var e=this.map,n=t.map(function(t){return e.transform.locationCoordinate(o.convert(t)).zoomTo(0)}),r=this.centerCoord=i.getCoordinatesCenter(n);return r.column=Math.round(r.column),r.row=Math.round(r.row),this.minzoom=this.maxzoom=r.zoom,this._coord=new a(r.zoom,r.column,r.row),this._tileCoords=n.map(function(t){var e=t.zoomTo(r.zoom);return new s(Math.round((e.column-r.column)*c),Math.round((e.row-r.row)*c))}),this.fire("change"),this},_setTile:function(t){this._prepared=!1,this.tile=t;var e=32767,n=new f;n.emplaceBack(this._tileCoords[0].x,this._tileCoords[0].y,0,0),n.emplaceBack(this._tileCoords[1].x,this._tileCoords[1].y,e,0),n.emplaceBack(this._tileCoords[3].x,this._tileCoords[3].y,0,e),n.emplaceBack(this._tileCoords[2].x,this._tileCoords[2].y,e,e),this.tile.buckets={},this.tile.boundsBuffer=new h(n.serialize(),f.serialize(),h.BufferType.VERTEX),this.tile.boundsVAO=new d,this.tile.state="loaded"},prepare:function(){if(!(this.video.readyState<2)&&this.tile){var t=this.map.painter.gl;this._prepared?(t.bindTexture(t.TEXTURE_2D,this.tile.texture),t.texSubImage2D(t.TEXTURE_2D,0,0,0,t.RGBA,t.UNSIGNED_BYTE,this.video)):(this._prepared=!0,this.tile.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.tile.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,this.video)),this._currentTime=this.video.currentTime}},loadTile:function(t,e){this._coord&&this._coord.toString()===t.coord.toString()?(this._setTile(t),e(null)):(t.state="errored",e(null))},serialize:function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}})},{"../data/bucket":68,"../data/buffer":73,"../geo/lng_lat":78,"../render/draw_raster":90,"../render/vertex_array_object":96,"../util/ajax":164,"../util/evented":173,"../util/util":181,"./tile_coord":108,"point-geometry":187}],112:[function(t,e,n){"use strict";function r(t){this.self=t,this.actor=new a(t,this);var e={getLayers:function(){return this.layers}.bind(this),getLayerFamilies:function(){return this.layerFamilies}.bind(this)};this.workerSources={vector:new l(this.actor,e),geojson:new u(this.actor,e)},this.self.registerWorkerSource=function(t,n){if(this.workerSources[t])throw new Error('Worker source with name "'+t+'" already registered.');this.workerSources[t]=new n(this.actor,e)}.bind(this)}function i(t){var e={};for(var n in t){var r=t[n],i=r.ref||r.id,a=t[i];a.layout&&"none"===a.layout.visibility||(e[i]=e[i]||[],n===i?e[i].unshift(r):e[i].push(r))}return e}var a=t("../util/actor"),o=t("../style/style_layer"),s=t("../util/util"),l=t("./vector_tile_worker_source"),u=t("./geojson_worker_source");e.exports=function(t){return new r(t)},s.extend(r.prototype,{"set layers":function(t){function e(t){var e=o.create(t,t.ref&&n.layers[t.ref]);e.updatePaintTransitions({},{transition:!1}),n.layers[e.id]=e}this.layers={};for(var n=this,r=[],a=0;a=0;e--)x(z,C[e]);_()}}function x(t,e){if(e.populateArrays(A,j,R),"symbol"!==e.type)for(var n=0;n=w.maxzoom||w.layout&&"none"===w.layout.visibility||t.layers&&!t.layers[w.sourceLayer]||(k=c.create({layer:w,index:I++,childLayers:e[D],zoom:this.zoom,overscaling:this.overscaling,showCollisionBoxes:this.showCollisionBoxes,collisionBoxArray:this.collisionBoxArray,symbolQuadsArray:this.symbolQuadsArray,symbolInstancesArray:this.symbolInstancesArray,sourceLayerIndex:T.encode(w.sourceLayer||"_geojsonTileLayer")}),k.createFilter(),E[w.id]=k,t.layers&&(M=w.sourceLayer,L[M]=L[M]||{},L[M][w.id]=k)));if(t.layers)for(M in L)1===w.version&&d.warnOnce('Vector tile source "'+this.source+'" layer "'+M+'" does not use vector tile spec v2 and therefore may have some rendering errors.'),w=t.layers[M],w&&v(w,L[M]);else v(t,E);var P=[],C=this.symbolBuckets=[],O=[];S.bucketLayerIDs={};for(var F in E)k=E[F],0!==k.features.length&&(S.bucketLayerIDs[k.index]=k.childLayers.map(s),P.push(k),"symbol"===k.type?C.push(k):O.push(k));var R={},j={},N=0;if(C.length>0){for(b=C.length-1;b>=0;b--)C[b].updateIcons(R),C[b].updateFont(j);for(var B in j)j[B]=Object.keys(j[B]).map(Number);R=Object.keys(R),n.send("get glyphs",{uid:this.uid,stacks:j},function(t,e){j=e,y(t)}),R.length?n.send("get icons",{icons:R},function(t,e){R=e,y(t)}):y()}for(b=O.length-1;b>=0;b--)x(this,O[b]);if(0===C.length)return _()},r.prototype.redoPlacement=function(t,e,n){if("done"!==this.status)return this.redoPlacementAfterDone=!0,this.angle=t,{};for(var r=new u(t,e,this.collisionBoxArray),s=this.symbolBuckets,l=s.length-1;l>=0;l--)s[l].placeFeatures(r,n);var c=r.serialize(),f=s.filter(i);return{result:{buckets:f.map(a),collisionTile:c.data},transferables:o(f).concat(c.transferables)}}},{"../data/bucket":68,"../data/feature_index":75,"../symbol/collision_box":133,"../symbol/collision_tile":135,"../symbol/symbol_instances":144,"../symbol/symbol_quads":145,"../util/dictionary_coder":171,"../util/util":181}],114:[function(t,e,n){"use strict";function r(){this.n=0,this.times=[]}e.exports=r,r.prototype.stopped=function(){return this.times=this.times.filter(function(t){return t.time>=(new Date).getTime()}),!this.times.length},r.prototype.set=function(t){return this.times.push({id:this.n,time:t+(new Date).getTime()}),this.n++; },r.prototype.cancel=function(t){this.times=this.times.filter(function(e){return e.id!==t})}},{}],115:[function(t,e,n){"use strict";function r(t){this.base=t,this.retina=s.devicePixelRatio>1;var e=this.retina?"@2x":"";o.getJSON(l(t,e,".json"),function(t,e){return t?void this.fire("error",{error:t}):(this.data=e,void(this.img&&this.fire("load")))}.bind(this)),o.getImage(l(t,e,".png"),function(t,e){if(t)return void this.fire("error",{error:t});for(var n=e.getData(),r=e.data=new Uint8Array(n.length),i=0;i1!==this.retina){var t=new r(this.base);t.on("load",function(){this.img=t.img,this.data=t.data,this.retina=t.retina}.bind(this))}},i.prototype={x:0,y:0,width:0,height:0,pixelRatio:1,sdf:!1},r.prototype.getSpritePosition=function(t){if(!this.loaded())return new i;var e=this.data&&this.data[t];return e&&this.img?e:new i}},{"../util/ajax":164,"../util/browser":165,"../util/evented":173,"../util/mapbox":178}],116:[function(t,e,n){"use strict";var r=t("csscolorparser").parseCSSColor,i=t("../util/util"),a=t("./style_function"),o={};e.exports=function t(e){if(a.isFunctionDefinition(e))return i.extend({},e,{stops:e.stops.map(function(e){return[e[0],t(e[1])]})});if("string"==typeof e){if(!o[e]){var n=r(e);if(!n)throw new Error("Invalid color "+e);o[e]=[n[0]/255*n[3],n[1]/255*n[3],n[2]/255*n[3],n[3]]}return o[e]}throw new Error("Invalid color "+e)}},{"../util/util":181,"./style_function":119,csscolorparser:7}],117:[function(t,e,n){"use strict";function r(t,e,n){this.animationLoop=e||new m,this.dispatcher=new p(n||1,this),this.spriteAtlas=new l(1024,1024),this.lineAtlas=new u(256,512),this._layers={},this._order=[],this._groups=[],this.sources={},this.zoomHistory={},c.bindAll(["_forwardSourceEvent","_forwardTileEvent","_forwardLayerEvent","_redoPlacement"],this),this._resetUpdates();var r=function(t,e){if(t)return void this.fire("error",{error:t});if(!g.emitErrors(this,g(e))){this._loaded=!0,this.stylesheet=e,this.updateClasses();var n=e.sources;for(var r in n)this.addSource(r,n[r]);e.sprite&&(this.sprite=new o(e.sprite),this.sprite.on("load",this.fire.bind(this,"change"))),this.glyphSource=new s(e.glyphs),this._resolve(),this.fire("load")}}.bind(this);"string"==typeof t?f.getJSON(h(t),r):d.frame(r.bind(this,null,t)),this.on("source.load",function(t){var e=t.source;if(e&&e.vectorLayerIds)for(var n in this._layers){var r=this._layers[n];r.source===e.id&&this._validateLayer(r)}})}var i=t("../util/evented"),a=t("./style_layer"),o=t("./image_sprite"),s=t("../symbol/glyph_source"),l=t("../symbol/sprite_atlas"),u=t("../render/line_atlas"),c=t("../util/util"),f=t("../util/ajax"),h=t("../util/mapbox").normalizeStyleURL,d=t("../util/browser"),p=t("../util/dispatcher"),m=t("./animation_loop"),g=t("./validate_style"),v=t("../source/source"),y=t("../source/query_features"),x=t("../source/source_cache"),_=t("./style_spec"),b=t("./style_function");e.exports=r,r.prototype=c.inherit(i,{_loaded:!1,_validateLayer:function(t){var e=this.sources[t.source];t.sourceLayer&&e&&e.vectorLayerIds&&e.vectorLayerIds.indexOf(t.sourceLayer)===-1&&this.fire("error",{error:new Error('Source layer "'+t.sourceLayer+'" does not exist on source "'+e.id+'" as specified by style layer "'+t.id+'"')})},loaded:function(){if(!this._loaded)return!1;if(Object.keys(this._updates.sources).length)return!1;for(var t in this.sources)if(!this.sources[t].loaded())return!1;return!(this.sprite&&!this.sprite.loaded())},_resolve:function(){var t,e;this._layers={},this._order=this.stylesheet.layers.map(function(t){return t.id});for(var n=0;nMath.floor(t)&&(e.lastIntegerZoom=Math.floor(t+1),e.lastIntegerZoomTime=Date.now()),e.lastZoom=t},_checkLoaded:function(){if(!this._loaded)throw new Error("Style is not done loading")},update:function(t,e){if(!this._updates.changed)return this;if(this._updates.allLayers)this._groupLayers(),this._updateWorkerLayers();else{var n=Object.keys(this._updates.layers);n.length&&this._updateWorkerLayers(n)}var r,i=Object.keys(this._updates.sources);for(r=0;r=0;return r&&this._handleErrors(g.source,"sources."+t,e)?this:(e=new x(t,e,this.dispatcher),this.sources[t]=e,e.style=this,e.on("load",this._forwardSourceEvent).on("error",this._forwardSourceEvent).on("change",this._forwardSourceEvent).on("tile.add",this._forwardTileEvent).on("tile.load",this._forwardTileEvent).on("tile.error",this._forwardTileEvent).on("tile.remove",this._forwardTileEvent).on("tile.stats",this._forwardTileEvent),this._updates.events.push(["source.add",{source:e}]),this._updates.changed=!0,this)},removeSource:function(t){if(this._checkLoaded(),void 0===this.sources[t])throw new Error("There is no source with this ID");var e=this.sources[t];return delete this.sources[t],delete this._updates.sources[t],e.off("load",this._forwardSourceEvent).off("error",this._forwardSourceEvent).off("change",this._forwardSourceEvent).off("tile.add",this._forwardTileEvent).off("tile.load",this._forwardTileEvent).off("tile.error",this._forwardTileEvent).off("tile.remove",this._forwardTileEvent).off("tile.stats",this._forwardTileEvent),this._updates.events.push(["source.remove",{source:e}]),this._updates.changed=!0,this},getSource:function(t){return this.sources[t]&&this.sources[t].getSource()},addLayer:function(t,e){if(this._checkLoaded(),!(t instanceof a)){if(this._handleErrors(g.layer,"layers."+t.id,t,!1,{arrayIndex:-1}))return this;var n=t.ref&&this.getLayer(t.ref);t=a.create(t,n)}return this._validateLayer(t),t.on("error",this._forwardLayerEvent),this._layers[t.id]=t,this._order.splice(e?this._order.indexOf(e):1/0,0,t.id),this._updates.allLayers=!0,t.source&&(this._updates.sources[t.source]=!0),this._updates.events.push(["layer.add",{layer:t}]),this.updateClasses(t.id)},removeLayer:function(t){this._checkLoaded();var e=this._layers[t];if(void 0===e)throw new Error("There is no layer with this ID");for(var n in this._layers)this._layers[n].ref===t&&this.removeLayer(n);return e.off("error",this._forwardLayerEvent),delete this._layers[t],delete this._updates.layers[t],delete this._updates.paintProps[t],this._order.splice(this._order.indexOf(t),1),this._updates.allLayers=!0,this._updates.events.push(["layer.remove",{layer:e}]),this._updates.changed=!0,this},getLayer:function(t){return this._layers[t]},getReferentLayer:function(t){var e=this.getLayer(t);return e.ref&&(e=this.getLayer(e.ref)),e},setLayerZoomRange:function(t,e,n){this._checkLoaded();var r=this.getReferentLayer(t);return r.minzoom===e&&r.maxzoom===n?this:(null!=e&&(r.minzoom=e),null!=n&&(r.maxzoom=n),this._updateLayer(r))},setFilter:function(t,e){this._checkLoaded();var n=this.getReferentLayer(t);return null!==e&&this._handleErrors(g.filter,"layers."+n.id+".filter",e)?this:c.deepEqual(n.filter,e)?this:(n.filter=c.clone(e),this._updateLayer(n))},getFilter:function(t){return this.getReferentLayer(t).filter},setLayoutProperty:function(t,e,n){this._checkLoaded();var r=this.getReferentLayer(t);return c.deepEqual(r.getLayoutProperty(e),n)?this:(r.setLayoutProperty(e,n),this._updateLayer(r))},getLayoutProperty:function(t,e){return this.getReferentLayer(t).getLayoutProperty(e)},setPaintProperty:function(t,e,n,r){this._checkLoaded();var i=this.getLayer(t);if(c.deepEqual(i.getPaintProperty(e,r),n))return this;var a=i.isPaintValueFeatureConstant(e);i.setPaintProperty(e,n,r);var o=!(n&&b.isFunctionDefinition(n)&&"$zoom"!==n.property&&void 0!==n.property);return o&&a||(this._updates.layers[t]=!0,i.source&&(this._updates.sources[i.source]=!0)),this.updateClasses(t,e)},getPaintProperty:function(t,e,n){return this.getLayer(t).getPaintProperty(e,n)},updateClasses:function(t,e){if(this._updates.changed=!0,t){var n=this._updates.paintProps;n[t]||(n[t]={}),n[t][e||"all"]=!0}else this._updates.allPaintProps=!0;return this},serialize:function(){return c.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:c.mapObject(this.sources,function(t){return t.serialize()}),layers:this._order.map(function(t){return this._layers[t].serialize()},this)},function(t){return void 0!==t})},_updateLayer:function(t){return this._updates.layers[t.id]=!0,t.source&&(this._updates.sources[t.source]=!0),this._updates.changed=!0,this},_flattenRenderedFeatures:function(t){for(var e=[],n=this._order.length-1;n>=0;n--)for(var r=this._order[n],i=0;is.lastIntegerZoom?(r=u+(1-u)*c,f*=2,i=t({zoom:o-1},n),a=t({zoom:o},n)):(r=1-(1-c)*u,a=t({zoom:o},n),i=t({zoom:o+1},n),f/=2),void 0===i||void 0===a?void 0:{from:i,fromScale:f,to:a,toScale:h,t:r}}}var a=t("./style_function"),o=t("./parse_color"),s=t("../util/util");e.exports=r},{"../util/util":181,"./parse_color":116,"./style_function":119}],119:[function(t,e,n){"use strict";var r=t("mapbox-gl-function");n.interpolated=function(t){var e=r.interpolated(t),n=function(t,n){return e(t&&t.zoom,n||{})};return n.isFeatureConstant=e.isFeatureConstant,n.isZoomConstant=e.isZoomConstant,n},n["piecewise-constant"]=function(t){var e=r["piecewise-constant"](t),n=function(t,n){return e(t&&t.zoom,n||{})};return n.isFeatureConstant=e.isFeatureConstant,n.isZoomConstant=e.isZoomConstant,n},n.isFunctionDefinition=r.isFunctionDefinition},{"mapbox-gl-function":41}],120:[function(t,e,n){"use strict";function r(t,e){this.set(t,e)}function i(t){return t.value}var a=t("../util/util"),o=t("./style_transition"),s=t("./style_declaration"),l=t("./style_spec"),u=t("./validate_style"),c=t("./parse_color"),f=t("../util/evented");e.exports=r;var h="-transition";r.create=function(e,n){var r={background:t("./style_layer/background_style_layer"),circle:t("./style_layer/circle_style_layer"),fill:t("./style_layer/fill_style_layer"),line:t("./style_layer/line_style_layer"),raster:t("./style_layer/raster_style_layer"),symbol:t("./style_layer/symbol_style_layer")};return new r[(n||e).type](e,n)},r.prototype=a.inherit(f,{set:function(t,e){this.id=t.id,this.ref=t.ref,this.metadata=t.metadata,this.type=(e||t).type,this.source=(e||t).source,this.sourceLayer=(e||t)["source-layer"],this.minzoom=(e||t).minzoom,this.maxzoom=(e||t).maxzoom,this.filter=(e||t).filter,this.paint={},this.layout={},this._paintSpecifications=l["paint_"+this.type],this._layoutSpecifications=l["layout_"+this.type],this._paintTransitions={},this._paintTransitionOptions={},this._paintDeclarations={},this._layoutDeclarations={},this._layoutFunctions={};var n,r;for(var i in t){var a=i.match(/^paint(?:\.(.*))?$/);if(a){var o=a[1]||"";for(n in t[i])this.setPaintProperty(n,t[i][n],o)}}if(this.ref)this._layoutDeclarations=e._layoutDeclarations;else for(r in t.layout)this.setLayoutProperty(r,t.layout[r]);for(n in this._paintSpecifications)this.paint[n]=this.getPaintValue(n);for(r in this._layoutSpecifications)this._updateLayoutValue(r)},setLayoutProperty:function(t,e){if(null==e)delete this._layoutDeclarations[t];else{var n="layers."+this.id+".layout."+t;if(this._handleErrors(u.layoutProperty,n,t,e))return;this._layoutDeclarations[t]=new s(this._layoutSpecifications[t],e)}this._updateLayoutValue(t)},getLayoutProperty:function(t){return this._layoutDeclarations[t]&&this._layoutDeclarations[t].value},getLayoutValue:function(t,e,n){var r=this._layoutSpecifications[t],i=this._layoutDeclarations[t];return i?i.calculate(e,n):r.default},setPaintProperty:function(t,e,n){var r="layers."+this.id+(n?'["paint.'+n+'"].':".paint.")+t;if(a.endsWith(t,h))if(this._paintTransitionOptions[n||""]||(this._paintTransitionOptions[n||""]={}),null===e||void 0===e)delete this._paintTransitionOptions[n||""][t];else{if(this._handleErrors(u.paintProperty,r,t,e))return;this._paintTransitionOptions[n||""][t]=e}else if(this._paintDeclarations[n||""]||(this._paintDeclarations[n||""]={}),null===e||void 0===e)delete this._paintDeclarations[n||""][t];else{if(this._handleErrors(u.paintProperty,r,t,e))return;this._paintDeclarations[n||""][t]=new s(this._paintSpecifications[t],e)}},getPaintProperty:function(t,e){return e=e||"",a.endsWith(t,h)?this._paintTransitionOptions[e]&&this._paintTransitionOptions[e][t]:this._paintDeclarations[e]&&this._paintDeclarations[e][t]&&this._paintDeclarations[e][t].value},getPaintValue:function(t,e,n){var r=this._paintSpecifications[t],i=this._paintTransitions[t];return i?i.calculate(e,n):"color"===r.type&&r.default?c(r.default):r.default},getPaintValueStopZoomLevels:function(t){var e=this._paintTransitions[t];return e?e.declaration.stopZoomLevels:[]},getPaintInterpolationT:function(t,e){var n=this._paintTransitions[t];return n.declaration.calculateInterpolationT({zoom:e})},isPaintValueFeatureConstant:function(t){var e=this._paintTransitions[t];return!e||e.declaration.isFeatureConstant},isLayoutValueFeatureConstant:function(t){var e=this._layoutDeclarations[t];return!e||e.isFeatureConstant},isPaintValueZoomConstant:function(t){var e=this._paintTransitions[t];return!e||e.declaration.isZoomConstant},isHidden:function(t){return!!(this.minzoom&&t=this.maxzoom)||("none"===this.layout.visibility||0===this.paint[this.type+"-opacity"]))},updatePaintTransitions:function(t,e,n,r){for(var i=a.extend({},this._paintDeclarations[""]),o=0;o-n/2;){if(o--,o<0)return!1;s-=t[o].dist(a),a=t[o]}s+=t[o].dist(t[o+1]),o++;for(var l=[],u=0;sr;)u-=l.shift().angleDelta;if(u>i)return!1;o++,s+=f.dist(h)}return!0}e.exports=r},{}],132:[function(t,e,n){"use strict";function r(t,e,n,r,a){for(var o=[],s=0;s=r&&h.x>=r||(f.x>=r?f=new i(r,f.y+(h.y-f.y)*((r-f.x)/(h.x-f.x)))._round():h.x>=r&&(h=new i(r,f.y+(h.y-f.y)*((r-f.x)/(h.x-f.x)))._round()),f.y>=a&&h.y>=a||(f.y>=a?f=new i(f.x+(h.x-f.x)*((a-f.y)/(h.y-f.y)),a)._round():h.y>=a&&(h=new i(f.x+(h.x-f.x)*((a-f.y)/(h.y-f.y)),a)._round()),l&&f.equals(l[l.length-1])||(l=[f],o.push(l)),l.push(h)))))}return o}var i=t("point-geometry");e.exports=r},{"point-geometry":187}],133:[function(t,e,n){"use strict";var r=t("../util/struct_array"),i=t("../util/util"),a=t("point-geometry"),o=e.exports=new r({members:[{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Float32",name:"maxScale"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"},{type:"Int16",name:"bbox0"},{type:"Int16",name:"bbox1"},{type:"Int16",name:"bbox2"},{type:"Int16",name:"bbox3"},{type:"Float32",name:"placementScale"}]});i.extendAll(o.prototype.StructType.prototype,{get anchorPoint(){return new a(this.anchorPointX,this.anchorPointY)}})},{"../util/struct_array":179,"../util/util":181,"point-geometry":187}],134:[function(t,e,n){"use strict";function r(t,e,n,r,i,a,o,s,l,u,c){var f=o.top*s-l,h=o.bottom*s+l,d=o.left*s-l,p=o.right*s+l;if(this.boxStartIndex=t.length,u){var m=h-f,g=p-d;if(m>0)if(m=Math.max(10*s,m),c){var v=e[n.segment+1].sub(e[n.segment])._unit()._mult(g),y=[n.sub(v),n.add(v)];this._addLineCollisionBoxes(t,y,n,0,g,m,r,i,a)}else this._addLineCollisionBoxes(t,e,n,n.segment,g,m,r,i,a)}else t.emplaceBack(n.x,n.y,d,f,p,h,1/0,r,i,a,0,0,0,0,0);this.boxEndIndex=t.length}e.exports=r,r.prototype._addLineCollisionBoxes=function(t,e,n,r,i,a,o,s,l){var u=a/2,c=Math.floor(i/u),f=-a/2,h=this.boxes,d=n,p=r+1,m=f;do{if(p--,p<0)return h;m-=e[p].dist(d),d=e[p]}while(m>-i/2);for(var g=e[p].dist(e[p+1]),v=0;v=e.length)return h;g=e[p].dist(e[p+1])}var x=y-m,_=e[p],b=e[p+1],w=b.sub(_)._unit()._mult(x)._add(_)._round(),M=Math.max(Math.abs(y-f)-u/2,0),k=i/2/M;t.emplaceBack(w.x,w.y,-a/2,-a/2,a/2,a/2,k,o,s,l,0,0,0,0,0)}return h}},{}],135:[function(t,e,n){"use strict";function r(t,e,n){if("object"==typeof t){var r=t;n=e,t=r.angle,e=r.pitch,this.grid=new o(r.grid),this.ignoredGrid=new o(r.ignoredGrid)}else this.grid=new o(a,12,6),this.ignoredGrid=new o(a,12,0);this.angle=t,this.pitch=e;var i=Math.sin(t),s=Math.cos(t);if(this.rotationMatrix=[s,-i,i,s],this.reverseRotationMatrix=[s,i,-i,s],this.yStretch=1/Math.cos(e/180*Math.PI),this.yStretch=Math.pow(this.yStretch,1.3),this.collisionBoxArray=n,0===n.length){n.emplaceBack();var l=32767;n.emplaceBack(0,0,0,-l,0,l,l,0,0,0,0,0,0,0,0,0),n.emplaceBack(a,0,0,-l,0,l,l,0,0,0,0,0,0,0,0,0),n.emplaceBack(0,0,-l,0,l,0,l,0,0,0,0,0,0,0,0,0),n.emplaceBack(0,a,-l,0,l,0,l,0,0,0,0,0,0,0,0,0)}this.tempCollisionBox=n.get(0),this.edges=[n.get(1),n.get(2),n.get(3),n.get(4)]}var i=t("point-geometry"),a=t("../data/bucket").EXTENT,o=t("grid-index");e.exports=r,r.prototype.serialize=function(){var t={angle:this.angle,pitch:this.pitch,grid:this.grid.toArrayBuffer(),ignoredGrid:this.ignoredGrid.toArrayBuffer()};return{data:t,transferables:[t.grid,t.ignoredGrid]}},r.prototype.minScale=.25,r.prototype.maxScale=2,r.prototype.placeCollisionFeature=function(t,e,n){for(var r=this.collisionBoxArray,a=this.minScale,o=this.rotationMatrix,s=this.yStretch,l=t.boxStartIndex;l=this.maxScale)return a}if(n){var b;if(this.angle){var w=this.reverseRotationMatrix,M=new i(u.x1,u.y1).matMult(w),k=new i(u.x2,u.y1).matMult(w),A=new i(u.x1,u.y2).matMult(w),S=new i(u.x2,u.y2).matMult(w);b=this.tempCollisionBox,b.anchorPointX=u.anchorPoint.x,b.anchorPointY=u.anchorPoint.y,b.x1=Math.min(M.x,k.x,A.x,S.x),b.y1=Math.min(M.y,k.x,A.x,S.x),b.x2=Math.max(M.x,k.x,A.x,S.x),b.y2=Math.max(M.y,k.x,A.x,S.x),b.maxScale=u.maxScale}else b=u;for(var T=0;T=this.maxScale)return a}}}return a},r.prototype.queryRenderedSymbols=function(t,e,n,r,a){var o={},s=[],l=this.collisionBoxArray,u=this.rotationMatrix,c=new i(t,e)._matMult(u),f=this.tempCollisionBox;f.anchorX=c.x,f.anchorY=c.y,f.x1=0,f.y1=0,f.x2=n-t,f.y2=r-e,f.maxScale=a,a=f.maxScale;for(var h=[c.x+f.x1/a,c.y+f.y1/a*this.yStretch,c.x+f.x2/a,c.y+f.y2/a*this.yStretch],d=this.grid.query(h[0],h[1],h[2],h[3]),p=this.ignoredGrid.query(h[0],h[1],h[2],h[3]),m=0;m=a&&(o[y][x]=!0,s.push(d[g]))}}return s},r.prototype.getPlacementScale=function(t,e,n,r,i){var a=e.x-r.x,o=e.y-r.y,s=(i.x1-n.x2)/a,l=(i.x2-n.x1)/a,u=(i.y1-n.y2)*this.yStretch/o,c=(i.y2-n.y1)*this.yStretch/o;(isNaN(s)||isNaN(l))&&(s=l=1),(isNaN(u)||isNaN(c))&&(u=c=1);var f=Math.min(Math.max(s,l),Math.max(u,c)),h=i.maxScale,d=n.maxScale;return f>h&&(f=h),f>d&&(f=d),f>t&&f>=i.placementScale&&(t=f),t},r.prototype.insertCollisionFeature=function(t,e,n){for(var r=n?this.ignoredGrid:this.grid,i=this.collisionBoxArray,a=t.boxStartIndex;a=0&&A=0&&S=0&&v+d<=p){var T=new o(A,S,M,x)._round();r&&!s(t,T,u,r,l)||y.push(T)}}g+=w}return f||y.length||c||(y=i(t,g/2,n,r,l,u,c,!0,h)),y}var a=t("../util/interpolate"),o=t("../symbol/anchor"),s=t("./check_max_angle");e.exports=r},{"../symbol/anchor":130,"../util/interpolate":175,"./check_max_angle":131}],137:[function(t,e,n){"use strict";function r(){this.width=s,this.height=s,this.bin=new i(this.width,this.height),this.index={},this.ids={},this.data=new Uint8Array(this.width*this.height)}var i=t("shelf-pack"),a=t("../util/util"),o=4,s=128,l=2048;e.exports=r,r.prototype.getGlyphs=function(){var t,e,n,r={};for(var i in this.ids)t=i.split("#"),e=t[0],n=t[1],r[e]||(r[e]=[]),r[e].push(n);return r},r.prototype.getRects=function(){var t,e,n,r={};for(var i in this.ids)t=i.split("#"),e=t[0],n=t[1],r[e]||(r[e]={}),r[e][n]=this.index[i];return r},r.prototype.addGlyph=function(t,e,n,r){if(!n)return null;var i=e+"#"+n.id;if(this.index[i])return this.ids[i].indexOf(t)<0&&this.ids[i].push(t),this.index[i];if(!n.bitmap)return null;var o=n.width+2*r,s=n.height+2*r,l=1,u=o+2*l,c=s+2*l;u+=4-u%4,c+=4-c%4;var f=this.bin.packOne(u,c);if(f||(this.resize(),f=this.bin.packOne(u,c)),!f)return a.warnOnce("glyph bitmap overflow"),null;this.index[i]=f,this.ids[i]=[t];for(var h=this.data,d=n.bitmap,p=0;p=l||e>=l)){this.texture&&(this.gl&&this.gl.deleteTexture(this.texture),this.texture=null),this.width*=o,this.height*=o,this.bin.resize(this.width,this.height);for(var n=new ArrayBuffer(this.width*this.height),r=0;r65535)return n("glyphs > 65535 not supported");void 0===this.loading[t]&&(this.loading[t]={});var r=this.loading[t];if(r[e])r[e].push(n);else{r[e]=[n];var i=256*e+"-"+(256*e+255),o=a(t,i,this.url);s(o,function(t,n){for(var i=!t&&new l(new c(new Uint8Array(n))),a=0;ar&&null!==c){var _=v[c+1].x;g=Math.max(_,g);for(var b=c+1;b<=y;b++)v[b].y+=n,v[b].x-=_;if(o){var w=c;f[v[c].codePoint]&&w--,s(v,e,p,w,o)}p=c+1,c=null,d+=_,m++}h[x.codePoint]&&(c=y)}var M=v[v.length-1],k=M.x+e[M.codePoint].advance;g=Math.max(g,k);var A=(m+1)*n;s(v,e,p,v.length-1,o),l(v,o,i,a,g,n,m,u),t.top+=-a*A,t.bottom=t.top+A,t.left+=-i*g,t.right=t.left+g}function s(t,e,n,r,i){for(var a=e[t[r].codePoint].advance,o=(t[r].x+a)*i,s=n;s<=r;s++)t[s].x-=o}function l(t,e,n,r,i,a,o,s){for(var l=(e-n)*i+s[0],u=(-r*(o+1)+.5)*a+s[1],c=0;c1?2:1,this.canvas&&(this.canvas.width=this.width*this.pixelRatio,this.canvas.height=this.height*this.pixelRatio)),this.sprite=t},r.prototype.addIcons=function(t,e){for(var n=0;n1||(w?(clearTimeout(w),w=null,v("dblclick",e)):w=setTimeout(d,300))}function c(t){y("touchmove",t)}function f(t){y("touchend",t)}function h(t){y("touchcancel",t)}function d(){w=null}function p(t){var e=r.mousePos(x,t);e.equals(b)&&v("click",t)}function m(t){v("dblclick",t),t.preventDefault()}function g(t){_=t,t.preventDefault()}function v(e,n){var i=r.mousePos(x,n);return t.fire(e,{lngLat:t.unproject(i),point:i,originalEvent:n})}function y(e,n){var a=r.touchPos(x,n),o=a.reduce(function(t,e,n,r){return t.add(e.div(r.length))},new i(0,0));return t.fire(e,{lngLat:t.unproject(o),point:o,lngLats:a.map(function(e){return t.unproject(e)},this),points:a,originalEvent:n})}var x=t.getCanvasContainer(),_=null,b=null,w=null;for(var M in a)t[M]=new a[M](t,e),e.interactive&&e[M]&&t[M].enable();x.addEventListener("mouseout",n,!1),x.addEventListener("mousedown",o,!1),x.addEventListener("mouseup",s,!1),x.addEventListener("mousemove",l,!1),x.addEventListener("touchstart",u,!1),x.addEventListener("touchend",f,!1),x.addEventListener("touchmove",c,!1),x.addEventListener("touchcancel",h,!1),x.addEventListener("click",p,!1),x.addEventListener("dblclick",m,!1),x.addEventListener("contextmenu",g,!1)}},{"../util/dom":167,"./handler/box_zoom":152,"./handler/dblclick_zoom":153,"./handler/drag_pan":154,"./handler/drag_rotate":155,"./handler/keyboard":156,"./handler/scroll_zoom":157,"./handler/touch_zoom_rotate":158,"point-geometry":187}],147:[function(t,e,n){"use strict";var r=t("../util/util"),i=t("../util/interpolate"),a=t("../util/browser"),o=t("../geo/lng_lat"),s=t("../geo/lng_lat_bounds"),l=t("point-geometry"),u=e.exports=function(){};r.extend(u.prototype,{getCenter:function(){return this.transform.center},setCenter:function(t,e){return this.jumpTo({center:t},e),this},panBy:function(t,e,n){return this.panTo(this.transform.center,r.extend({offset:l.convert(t).mult(-1)},e),n),this},panTo:function(t,e,n){return this.easeTo(r.extend({center:t},e),n)},getZoom:function(){return this.transform.zoom},setZoom:function(t,e){return this.jumpTo({zoom:t},e),this},zoomTo:function(t,e,n){return this.easeTo(r.extend({zoom:t},e),n)},zoomIn:function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},zoomOut:function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},getBearing:function(){return this.transform.bearing},setBearing:function(t,e){return this.jumpTo({bearing:t},e),this},rotateTo:function(t,e,n){return this.easeTo(r.extend({bearing:t},e),n)},resetNorth:function(t,e){return this.rotateTo(0,r.extend({duration:1e3},t),e),this},snapToNorth:function(t,e){return Math.abs(this.getBearing())180&&(c.center.lng>0&&m.lng<0?m.lng+=360:c.center.lng<0&&m.lng>0&&(m.lng-=360));var x=c.zoomScale(g-h),_=c.point,b="center"in t?c.project(m).sub(f.div(x)):_,w=c.worldSize,M=t.curve,k=Math.max(c.width,c.height),A=k/x,S=b.sub(_).mag();if("minZoom"in t){var T=r.clamp(Math.min(t.minZoom,h,g),c.minZoom,c.maxZoom),z=k/c.zoomScale(T-h);M=Math.sqrt(z/S*2)}var E=M*M,L=n(0),I=function(t){return s(L)/s(L+M*t)},D=function(t){return k*((s(L)*u(L+M*t)-a(L))/E)/S},P=(n(1)-L)/M;if(Math.abs(S)<1e-6){if(Math.abs(k-A)<1e-6)return this.easeTo(t);var C=A=0)return!1;return!0}),e.join(" | ")},r.prototype=o.inherit(i,{options:{position:"bottom-right"},onAdd:function(t){var e="mapboxgl-ctrl-attrib",n=this._container=a.create("div",e,t.getContainer());return this._update(),t.on("source.load",this._update.bind(this)),t.on("source.change",this._update.bind(this)),t.on("source.remove",this._update.bind(this)),t.on("moveend",this._updateEditLink.bind(this)),n},_update:function(){this._map.style&&(this._container.innerHTML=r.createAttributionString(this._map.style.sources)),this._editLink=this._container.getElementsByClassName("mapbox-improve-map")[0],this._updateEditLink()},_updateEditLink:function(){if(this._editLink){var t=this._map.getCenter();this._editLink.href="https://www.mapbox.com/map-feedback/#/"+t.lng+"/"+t.lat+"/"+Math.round(this._map.getZoom()+1)}}})},{"../../util/dom":167,"../../util/util":181,"./control":149}],149:[function(t,e,n){"use strict";function r(){}var i=t("../../util/util"),a=t("../../util/evented");e.exports=r,r.prototype={addTo:function(t){this._map=t;var e=this._container=this.onAdd(t);if(this.options&&this.options.position){var n=this.options.position,r=t._controlCorners[n];e.className+=" mapboxgl-ctrl",n.indexOf("bottom")!==-1?r.insertBefore(e,r.firstChild):r.appendChild(e)}return this},remove:function(){return this._container.parentNode.removeChild(this._container),this.onRemove&&this.onRemove(this._map),this._map=null,this}},i.extend(r.prototype,a)},{"../../util/evented":173,"../../util/util":181}],150:[function(t,e,n){"use strict";function r(t){s.setOptions(this,t)}var i=t("./control"),a=t("../../util/browser"),o=t("../../util/dom"),s=t("../../util/util");e.exports=r;var l={enableHighAccuracy:!1,timeout:6e3};r.prototype=s.inherit(i,{options:{position:"top-right"},onAdd:function(t){var e="mapboxgl-ctrl",n=this._container=o.create("div",e+"-group",t.getContainer());return a.supportsGeolocation?(this._container.addEventListener("contextmenu",this._onContextMenu.bind(this)),this._geolocateButton=o.create("button",e+"-icon "+e+"-geolocate",this._container),this._geolocateButton.type="button",this._geolocateButton.addEventListener("click",this._onClickGeolocate.bind(this)),n):n},_onContextMenu:function(t){t.preventDefault()},_onClickGeolocate:function(){navigator.geolocation.getCurrentPosition(this._success.bind(this),this._error.bind(this),l),this._timeoutId=setTimeout(this._finish.bind(this),1e4)},_success:function(t){this._map.jumpTo({center:[t.coords.longitude,t.coords.latitude],zoom:17,bearing:0,pitch:0}),this.fire("geolocate",t),this._finish()},_error:function(t){this.fire("error",t),this._finish()},_finish:function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}})},{"../../util/browser":165,"../../util/dom":167,"../../util/util":181,"./control":149}],151:[function(t,e,n){"use strict";function r(t){s.setOptions(this,t)}function i(t){return new MouseEvent(t.type,{button:2,buttons:2,bubbles:!0,cancelable:!0,detail:t.detail,view:t.view,screenX:t.screenX,screenY:t.screenY,clientX:t.clientX,clientY:t.clientY,movementX:t.movementX,movementY:t.movementY,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey})}var a=t("./control"),o=t("../../util/dom"),s=t("../../util/util");e.exports=r,r.prototype=s.inherit(a,{options:{position:"top-right"},onAdd:function(t){var e="mapboxgl-ctrl",n=this._container=o.create("div",e+"-group",t.getContainer());return this._container.addEventListener("contextmenu",this._onContextMenu.bind(this)),this._zoomInButton=this._createButton(e+"-icon "+e+"-zoom-in",t.zoomIn.bind(t)),this._zoomOutButton=this._createButton(e+"-icon "+e+"-zoom-out",t.zoomOut.bind(t)),this._compass=this._createButton(e+"-icon "+e+"-compass",t.resetNorth.bind(t)),this._compassArrow=o.create("div","arrow",this._compass),this._compass.addEventListener("mousedown",this._onCompassDown.bind(this)),this._onCompassMove=this._onCompassMove.bind(this),this._onCompassUp=this._onCompassUp.bind(this),t.on("rotate",this._rotateCompassArrow.bind(this)),this._rotateCompassArrow(),this._el=t.getCanvasContainer(),n},_onContextMenu:function(t){t.preventDefault()},_onCompassDown:function(t){0===t.button&&(o.disableDrag(),document.addEventListener("mousemove",this._onCompassMove),document.addEventListener("mouseup",this._onCompassUp),this._el.dispatchEvent(i(t)),t.stopPropagation())},_onCompassMove:function(t){0===t.button&&(this._el.dispatchEvent(i(t)),t.stopPropagation())},_onCompassUp:function(t){0===t.button&&(document.removeEventListener("mousemove",this._onCompassMove),document.removeEventListener("mouseup",this._onCompassUp),o.enableDrag(),this._el.dispatchEvent(i(t)),t.stopPropagation())},_createButton:function(t,e){var n=o.create("button",t,this._container);return n.type="button",n.addEventListener("click",function(){e()}),n},_rotateCompassArrow:function(){var t="rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassArrow.style.transform=t}})},{"../../util/dom":167,"../../util/util":181,"./control":149}],152:[function(t,e,n){"use strict";function r(t){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),o.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../geo/lng_lat_bounds"),o=t("../../util/util");e.exports=r,r.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onMouseDown,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onMouseDown),this._enabled=!1)},_onMouseDown:function(t){t.shiftKey&&0===t.button&&(document.addEventListener("mousemove",this._onMouseMove,!1), document.addEventListener("keydown",this._onKeyDown,!1),document.addEventListener("mouseup",this._onMouseUp,!1),i.disableDrag(),this._startPos=i.mousePos(this._el,t),this._active=!0)},_onMouseMove:function(t){var e=this._startPos,n=i.mousePos(this._el,t);this._box||(this._box=i.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var r=Math.min(e.x,n.x),a=Math.max(e.x,n.x),o=Math.min(e.y,n.y),s=Math.max(e.y,n.y);i.setTransform(this._box,"translate("+r+"px,"+o+"px)"),this._box.style.width=a-r+"px",this._box.style.height=s-o+"px"},_onMouseUp:function(t){if(0===t.button){var e=this._startPos,n=i.mousePos(this._el,t),r=new a(this._map.unproject(e),this._map.unproject(n));this._finish(),e.x===n.x&&e.y===n.y?this._fireEvent("boxzoomcancel",t):this._map.fitBounds(r,{linear:!0}).fire("boxzoomend",{originalEvent:t,boxZoomBounds:r})}},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t))},_finish:function(){this._active=!1,document.removeEventListener("mousemove",this._onMouseMove,!1),document.removeEventListener("keydown",this._onKeyDown,!1),document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.parentNode.removeChild(this._box),this._box=null),i.enableDrag()},_fireEvent:function(t,e){return this._map.fire(t,{originalEvent:e})}}},{"../../geo/lng_lat_bounds":79,"../../util/dom":167,"../../util/util":181}],153:[function(t,e,n){"use strict";function r(t){this._map=t,this._onDblClick=this._onDblClick.bind(this)}e.exports=r,r.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._map.on("dblclick",this._onDblClick),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._map.off("dblclick",this._onDblClick),this._enabled=!1)},_onDblClick:function(t){this._map.zoomTo(this._map.getZoom()+(t.originalEvent.shiftKey?-1:1),{around:t.lngLat},t)}}},{}],154:[function(t,e,n){"use strict";function r(t){this._map=t,this._el=t.getCanvasContainer(),a.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/util");e.exports=r;var o=.3,s=a.bezier(0,0,o,1),l=1400,u=2500;r.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._el.addEventListener("touchstart",this._onDown),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._el.removeEventListener("touchstart",this._onDown),this._enabled=!1)},_onDown:function(t){this._ignoreEvent(t)||this.isActive()||(t.touches?(document.addEventListener("touchmove",this._onMove),document.addEventListener("touchend",this._onTouchEnd)):(document.addEventListener("mousemove",this._onMove),document.addEventListener("mouseup",this._onMouseUp)),this._active=!1,this._startPos=this._pos=i.mousePos(this._el,t),this._inertia=[[Date.now(),this._pos]])},_onMove:function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._fireEvent("dragstart",t),this._fireEvent("movestart",t));var e=i.mousePos(this._el,t),n=this._map;n.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),e]),n.transform.setLocationAtPoint(n.transform.pointLocation(this._pos),e),this._fireEvent("drag",t),this._fireEvent("move",t),this._pos=e,t.preventDefault()}},_onUp:function(t){if(this.isActive()){this._active=!1,this._fireEvent("dragend",t),this._drainInertiaBuffer();var e=function(){this._fireEvent("moveend",t)}.bind(this),n=this._inertia;if(n.length<2)return void e();var r=n[n.length-1],i=n[0],a=r[1].sub(i[1]),c=(r[0]-i[0])/1e3;if(0===c||r[1].equals(i[1]))return void e();var f=a.mult(o/c),h=f.mag();h>l&&(h=l,f._unit()._mult(h));var d=h/(u*o),p=f.mult(-d/2);this._map.panBy(p,{duration:1e3*d,easing:s,noMoveStart:!0},{originalEvent:t})}},_onMouseUp:function(t){this._ignoreEvent(t)||(this._onUp(t),document.removeEventListener("mousemove",this._onMove),document.removeEventListener("mouseup",this._onMouseUp))},_onTouchEnd:function(t){this._ignoreEvent(t)||(this._onUp(t),document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onTouchEnd))},_fireEvent:function(t,e){return this._map.fire(t,{originalEvent:e})},_ignoreEvent:function(t){var e=this._map;if(e.boxZoom&&e.boxZoom.isActive())return!0;if(e.dragRotate&&e.dragRotate.isActive())return!0;if(t.touches)return t.touches.length>1;if(t.ctrlKey)return!0;var n=1,r=0;return"mousemove"===t.type?t.buttons&0===n:t.button!==r},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now(),n=160;t.length>0&&e-t[0][0]>n;)t.shift()}}},{"../../util/dom":167,"../../util/util":181}],155:[function(t,e,n){"use strict";function r(t,e){this._map=t,this._el=t.getCanvasContainer(),this._bearingSnap=e.bearingSnap,o.bindHandlers(this)}var i=t("../../util/dom"),a=t("point-geometry"),o=t("../../util/util");e.exports=r;var s=.25,l=o.bezier(0,0,s,1),u=180,c=720;r.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._enabled=!1)},_onDown:function(t){if(!this._ignoreEvent(t)&&!this.isActive()){document.addEventListener("mousemove",this._onMove),document.addEventListener("mouseup",this._onUp),this._active=!1,this._inertia=[[Date.now(),this._map.getBearing()]],this._startPos=this._pos=i.mousePos(this._el,t),this._center=this._map.transform.centerPoint;var e=this._startPos.sub(this._center),n=e.mag();n<200&&(this._center=this._startPos.add(new a(-200,0)._rotate(e.angle()))),t.preventDefault()}},_onMove:function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._fireEvent("rotatestart",t),this._fireEvent("movestart",t));var e=this._map;e.stop();var n=this._pos,r=i.mousePos(this._el,t),a=this._center,o=n.sub(a).angleWith(r.sub(a))/Math.PI*180,s=e.getBearing()-o,l=this._inertia,u=l[l.length-1];this._drainInertiaBuffer(),l.push([Date.now(),e._normalizeBearing(s,u[1])]),e.transform.bearing=s,this._fireEvent("rotate",t),this._fireEvent("move",t),this._pos=r}},_onUp:function(t){if(!this._ignoreEvent(t)&&(document.removeEventListener("mousemove",this._onMove),document.removeEventListener("mouseup",this._onUp),this.isActive())){this._active=!1,this._fireEvent("rotateend",t),this._drainInertiaBuffer();var e=this._map,n=e.getBearing(),r=this._inertia,i=function(){Math.abs(n)u&&(g=u);var v=g/(c*s),y=p*g*(v/2);h+=y,Math.abs(e._normalizeBearing(h,0))1;var n=t.ctrlKey?1:2,r=t.ctrlKey?0:2;return"mousemove"===t.type?t.buttons&0===n:t.button!==r},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now(),n=160;t.length>0&&e-t[0][0]>n;)t.shift()}}},{"../../util/dom":167,"../../util/util":181,"point-geometry":187}],156:[function(t,e,n){"use strict";function r(t){this._map=t,this._el=t.getCanvasContainer(),this._onKeyDown=this._onKeyDown.bind(this)}e.exports=r;var i=80,a=2,o=5;r.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=this._map,n={originalEvent:t};if(!e.isEasing())switch(t.keyCode){case 61:case 107:case 171:case 187:e.zoomTo(Math.round(e.getZoom())+(t.shiftKey?2:1),n);break;case 189:case 109:case 173:e.zoomTo(Math.round(e.getZoom())-(t.shiftKey?2:1),n);break;case 37:t.shiftKey?e.easeTo({bearing:e.getBearing()-a},n):(t.preventDefault(),e.panBy([-i,0],n));break;case 39:t.shiftKey?e.easeTo({bearing:e.getBearing()+a},n):(t.preventDefault(),e.panBy([i,0],n));break;case 38:t.shiftKey?e.easeTo({pitch:e.getPitch()+o},n):(t.preventDefault(),e.panBy([0,-i],n));break;case 40:t.shiftKey?e.easeTo({pitch:Math.max(e.getPitch()-o,0)},n):(t.preventDefault(),e.panBy([0,i],n))}}}}},{}],157:[function(t,e,n){"use strict";function r(t){this._map=t,this._el=t.getCanvasContainer(),o.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/browser"),o=t("../../util/util");e.exports=r;var s="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",l=s.indexOf("firefox")!==-1,u=s.indexOf("safari")!==-1&&s.indexOf("chrom")===-1;r.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("wheel",this._onWheel,!1),this._el.addEventListener("mousewheel",this._onWheel,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("wheel",this._onWheel),this._el.removeEventListener("mousewheel",this._onWheel),this._enabled=!1)},_onWheel:function(t){var e;"wheel"===t.type?(e=t.deltaY,l&&t.deltaMode===window.WheelEvent.DOM_DELTA_PIXEL&&(e/=a.devicePixelRatio),t.deltaMode===window.WheelEvent.DOM_DELTA_LINE&&(e*=40)):"mousewheel"===t.type&&(e=-t.wheelDeltaY,u&&(e/=3));var n=a.now(),r=n-(this._time||0);this._pos=i.mousePos(this._el,t),this._time=n,0!==e&&e%4.000244140625===0?(this._type="wheel",e=Math.floor(e/4)):0!==e&&Math.abs(e)<4?this._type="trackpad":r>400?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40)):this._type||(this._type=Math.abs(r*e)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,e+=this._lastValue)),t.shiftKey&&e&&(e/=4),this._type&&this._zoom(-e,t),t.preventDefault()},_onTimeout:function(){this._type="wheel",this._zoom(-this._lastValue)},_zoom:function(t,e){if(0!==t){var n=this._map,r=2/(1+Math.exp(-Math.abs(t/100)));t<0&&0!==r&&(r=1/r);var i=n.ease?n.ease.to:n.transform.scale,a=n.transform.scaleZoom(i*r);n.zoomTo(a,{duration:0,around:n.unproject(this._pos),delayEndEvents:200},{originalEvent:e})}}}},{"../../util/browser":165,"../../util/dom":167,"../../util/util":181}],158:[function(t,e,n){"use strict";function r(t){this._map=t,this._el=t.getCanvasContainer(),a.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/util");e.exports=r;var o=.15,s=a.bezier(0,0,o,1),l=12,u=2.5,c=.15,f=4;r.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("touchstart",this._onStart,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("touchstart",this._onStart),this._enabled=!1)},disableRotation:function(){this._rotationDisabled=!0},enableRotation:function(){this._rotationDisabled=!1},_onStart:function(t){if(2===t.touches.length){var e=i.mousePos(this._el,t.touches[0]),n=i.mousePos(this._el,t.touches[1]);this._startVec=e.sub(n),this._startScale=this._map.transform.scale,this._startBearing=this._map.transform.bearing,this._gestureIntent=void 0,this._inertia=[],document.addEventListener("touchmove",this._onMove,!1),document.addEventListener("touchend",this._onEnd,!1)}},_onMove:function(t){if(2===t.touches.length){var e=i.mousePos(this._el,t.touches[0]),n=i.mousePos(this._el,t.touches[1]),r=e.add(n).div(2),a=e.sub(n),o=a.mag()/this._startVec.mag(),s=this._rotationDisabled?0:180*a.angleWith(this._startVec)/Math.PI,l=this._map;if(this._gestureIntent){var u={duration:0,around:l.unproject(r)};"rotate"===this._gestureIntent&&(u.bearing=this._startBearing+s),"zoom"!==this._gestureIntent&&"rotate"!==this._gestureIntent||(u.zoom=l.transform.scaleZoom(this._startScale*o)),l.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),o,r]),l.easeTo(u,{originalEvent:t})}else{var h=Math.abs(1-o)>c,d=Math.abs(s)>f;d?this._gestureIntent="rotate":h&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._startVec=a,this._startScale=l.transform.scale,this._startBearing=l.transform.bearing)}t.preventDefault()}},_onEnd:function(t){document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onEnd),this._drainInertiaBuffer();var e=this._inertia,n=this._map;if(e.length<2)return void n.snapToNorth({},{originalEvent:t});var r=e[e.length-1],i=e[0],a=n.transform.scaleZoom(this._startScale*r[1]),c=n.transform.scaleZoom(this._startScale*i[1]),f=a-c,h=(r[0]-i[0])/1e3,d=r[2];if(0===h||a===c)return void n.snapToNorth({},{originalEvent:t});var p=f*o/h;Math.abs(p)>u&&(p=p>0?u:-u);var m=1e3*Math.abs(p/(l*o)),g=a+p*m/2e3;g<0&&(g=0),n.easeTo({zoom:g,duration:m,easing:s,around:n.unproject(d)},{originalEvent:t})},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now(),n=160;t.length>2&&e-t[0][0]>n;)t.shift()}}},{"../../util/dom":167,"../../util/util":181}],159:[function(t,e,n){"use strict";function r(){i.bindAll(["_onHashChange","_updateHash"],this)}e.exports=r;var i=t("../util/util");r.prototype={addTo:function(t){return this._map=t,window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},remove:function(){return window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),delete this._map,this},_onHashChange:function(){var t=location.hash.replace("#","").split("/");return t.length>=3&&(this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:+(t[3]||0)}),!0)},_updateHash:function(){var t=this._map.getCenter(),e=this._map.getZoom(),n=this._map.getBearing(),r=Math.max(0,Math.ceil(Math.log(e)/Math.LN2)),i="#"+Math.round(100*e)/100+"/"+t.lat.toFixed(r)+"/"+t.lng.toFixed(r)+(n?"/"+Math.round(10*n)/10:"");window.history.replaceState("","",i)}}},{"../util/util":181}],160:[function(t,e,n){"use strict";function r(t){t.parentNode&&t.parentNode.removeChild(t)}var i=t("../util/canvas"),a=t("../util/util"),o=t("../util/browser"),s=t("../util/browser").window,l=t("../util/evented"),u=t("../util/dom"),c=t("../style/style"),f=t("../style/animation_loop"),h=t("../render/painter"),d=t("../geo/transform"),p=t("./hash"),m=t("./bind_handlers"),g=t("./camera"),v=t("../geo/lng_lat"),y=t("../geo/lng_lat_bounds"),x=t("point-geometry"),_=t("./control/attribution"),b=0,w=20,M={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:b,maxZoom:w,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,bearingSnap:7,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,workerCount:Math.max(o.hardwareConcurrency-1,1)},k=e.exports=function(t){if(t=a.extend({},M,t),t.workerCount<1)throw new Error("workerCount must an integer greater than or equal to 1.");this._interactive=t.interactive,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._trackResize=t.trackResize,this._workerCount=t.workerCount,this._bearingSnap=t.bearingSnap,"string"==typeof t.container?this._container=document.getElementById(t.container):this._container=t.container,this.animationLoop=new f,this.transform=new d(t.minZoom,t.maxZoom),t.maxBounds&&this.setMaxBounds(t.maxBounds),a.bindAll(["_forwardStyleEvent","_forwardSourceEvent","_forwardLayerEvent","_forwardTileEvent","_onStyleLoad","_onStyleChange","_onSourceAdd","_onSourceRemove","_onSourceUpdate","_onWindowOnline","_onWindowResize","_update","_render"],this),this._setupContainer(),this._setupPainter(),this.on("move",this._update.bind(this,!1)),this.on("zoom",this._update.bind(this,!0)),this.on("moveend",function(){this.animationLoop.set(300),this._rerender()}.bind(this)),"undefined"!=typeof s&&(s.addEventListener("online",this._onWindowOnline,!1),s.addEventListener("resize",this._onWindowResize,!1)),m(this,t),this._hash=t.hash&&(new p).addTo(this),this._hash&&this._hash._onHashChange()||this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}),this.stacks={},this._classes=[],this.resize(),t.classes&&this.setClasses(t.classes),t.style&&this.setStyle(t.style),t.attributionControl&&this.addControl(new _(t.attributionControl));var e=this.fire.bind(this,"error");this.on("style.error",e),this.on("source.error",e),this.on("tile.error",e),this.on("layer.error",e)};a.extend(k.prototype,l),a.extend(k.prototype,g.prototype),a.extend(k.prototype,{addControl:function(t){return t.addTo(this),this},addClass:function(t,e){return this._classes.indexOf(t)>=0||""===t?this:(this._classes.push(t),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},removeClass:function(t,e){var n=this._classes.indexOf(t);return n<0||""===t?this:(this._classes.splice(n,1),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},setClasses:function(t,e){for(var n={},r=0;r=0},getClasses:function(){return this._classes},resize:function(){var t=0,e=0;return this._container&&(t=this._container.offsetWidth||400,e=this._container.offsetHeight||300),this._canvas.resize(t,e),this.transform.resize(t,e),this.painter.resize(t,e),this.fire("movestart").fire("move").fire("resize").fire("moveend")},getBounds:function(){var t=new y(this.transform.pointLocation(new x(0,0)),this.transform.pointLocation(this.transform.size));return(this.transform.angle||this.transform.pitch)&&(t.extend(this.transform.pointLocation(new x(this.transform.size.x,0))),t.extend(this.transform.pointLocation(new x(0,this.transform.size.y)))),t},setMaxBounds:function(t){if(t){var e=y.convert(t);this.transform.lngRange=[e.getWest(),e.getEast()],this.transform.latRange=[e.getSouth(),e.getNorth()],this.transform._constrain(),this._update()}else null!==t&&void 0!==t||(this.transform.lngRange=[],this.transform.latRange=[],this._update());return this},setMinZoom:function(t){if(t=null===t||void 0===t?b:t,t>=b&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=this.transform.minZoom&&t<=w)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be between the current minZoom and "+w+", inclusive")},project:function(t){return this.transform.locationPoint(v.convert(t))},unproject:function(t){return this.transform.pointLocation(x.convert(t))},queryRenderedFeatures:function(){function t(t){return t instanceof x||Array.isArray(t)}var e,n={};return 2===arguments.length?(e=arguments[0],n=arguments[1]):1===arguments.length&&t(arguments[0])?e=arguments[0]:1===arguments.length&&(n=arguments[0]),this.style.queryRenderedFeatures(this._makeQueryGeometry(e),n,this.transform.zoom,this.transform.angle)},_makeQueryGeometry:function(t){void 0===t&&(t=[x.convert([0,0]),x.convert([this.transform.width,this.transform.height])]);var e,n=t instanceof x||"number"==typeof t[0];if(n){var r=x.convert(t);e=[r]}else{var i=[x.convert(t[0]),x.convert(t[1])];e=[i[0],new x(i[1].x,i[0].y),i[1],new x(i[0].x,i[1].y),i[0]]}return e=e.map(function(t){return this.transform.pointCoordinate(t)}.bind(this))},querySourceFeatures:function(t,e){return this.style.querySourceFeatures(t,e)},setStyle:function(t){return this.style&&(this.style.off("load",this._onStyleLoad).off("error",this._forwardStyleEvent).off("change",this._onStyleChange).off("source.add",this._onSourceAdd).off("source.remove",this._onSourceRemove).off("source.load",this._onSourceUpdate).off("source.error",this._forwardSourceEvent).off("source.change",this._onSourceUpdate).off("layer.add",this._forwardLayerEvent).off("layer.remove",this._forwardLayerEvent).off("layer.error",this._forwardLayerEvent).off("tile.add",this._forwardTileEvent).off("tile.remove",this._forwardTileEvent).off("tile.load",this._update).off("tile.error",this._forwardTileEvent).off("tile.stats",this._forwardTileEvent)._remove(),this.off("rotate",this.style._redoPlacement),this.off("pitch",this.style._redoPlacement)),t?(t instanceof c?this.style=t:this.style=new c(t,this.animationLoop,this._workerCount),this.style.on("load",this._onStyleLoad).on("error",this._forwardStyleEvent).on("change",this._onStyleChange).on("source.add",this._onSourceAdd).on("source.remove",this._onSourceRemove).on("source.load",this._onSourceUpdate).on("source.error",this._forwardSourceEvent).on("source.change",this._onSourceUpdate).on("layer.add",this._forwardLayerEvent).on("layer.remove",this._forwardLayerEvent).on("layer.error",this._forwardLayerEvent).on("tile.add",this._forwardTileEvent).on("tile.remove",this._forwardTileEvent).on("tile.load",this._update).on("tile.error",this._forwardTileEvent).on("tile.stats",this._forwardTileEvent),this.on("rotate",this.style._redoPlacement),this.on("pitch",this.style._redoPlacement),this):(this.style=null,this)},getStyle:function(){if(this.style)return this.style.serialize()},addSource:function(t,e){return this.style.addSource(t,e),this._update(!0),this},addSourceType:function(t,e,n){return this.style.addSourceType(t,e,n)},removeSource:function(t){return this.style.removeSource(t),this._update(!0),this},getSource:function(t){return this.style.getSource(t)},addLayer:function(t,e){return this.style.addLayer(t,e),this._update(!0),this},removeLayer:function(t){return this.style.removeLayer(t),this._update(!0),this},getLayer:function(t){return this.style.getLayer(t)},setFilter:function(t,e){return this.style.setFilter(t,e),this._update(!0),this},setLayerZoomRange:function(t,e,n){return this.style.setLayerZoomRange(t,e,n),this._update(!0),this},getFilter:function(t){return this.style.getFilter(t)},setPaintProperty:function(t,e,n,r){return this.style.setPaintProperty(t,e,n,r),this._update(!0),this},getPaintProperty:function(t,e,n){return this.style.getPaintProperty(t,e,n)},setLayoutProperty:function(t,e,n){return this.style.setLayoutProperty(t,e,n),this._update(!0),this},getLayoutProperty:function(t,e){return this.style.getLayoutProperty(t,e)},getContainer:function(){return this._container},getCanvasContainer:function(){return this._canvasContainer},getCanvas:function(){return this._canvas.getElement()},_setupContainer:function(){var t=this._container;t.classList.add("mapboxgl-map");var e=this._canvasContainer=u.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=new i(this,e);var n=this._controlContainer=u.create("div","mapboxgl-control-container",t),r=this._controlCorners={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(t){r[t]=u.create("div","mapboxgl-ctrl-"+t,n)})},_setupPainter:function(){var t=this._canvas.getWebGLContext({failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer});return t?void(this.painter=new h(t,this.transform)):void this.fire("error",{error:new Error("Failed to initialize WebGL")})},_contextLost:function(t){t.preventDefault(),this._frameId&&o.cancelFrame(this._frameId),this.fire("webglcontextlost",{originalEvent:t})},_contextRestored:function(t){this._setupPainter(),this.resize(),this._update(),this.fire("webglcontextrestored",{originalEvent:t})},loaded:function(){return!this._styleDirty&&!this._sourcesDirty&&!(!this.style||!this.style.loaded())},_update:function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this._rerender(),this):this},_render:function(){try{this.style&&this._styleDirty&&(this._styleDirty=!1,this.style.update(this._classes,this._classOptions),this._classOptions=null,this.style._recalculate(this.transform.zoom)),this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.painter.render(this.style,{debug:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,vertices:this.vertices,rotating:this.rotating,zooming:this.zooming}),this.fire("render"),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire("load")),this._frameId=null,this.animationLoop.stopped()||(this._styleDirty=!0),(this._sourcesDirty||this._repaint||this._styleDirty)&&this._rerender()}catch(t){this.fire("error",{error:t})}return this},remove:function(){this._hash&&this._hash.remove(),o.cancelFrame(this._frameId),this.setStyle(null),"undefined"!=typeof s&&s.removeEventListener("resize",this._onWindowResize,!1);var t=this.painter.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),r(this._canvasContainer),r(this._controlContainer),this._container.classList.remove("mapboxgl-map")},_rerender:function(){this.style&&!this._frameId&&(this._frameId=o.frame(this._render))},_forwardStyleEvent:function(t){this.fire("style."+t.type,a.extend({style:t.target},t))},_forwardSourceEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_forwardLayerEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_forwardTileEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_onStyleLoad:function(t){this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this.style.update(this._classes,{transition:!1}),this._forwardStyleEvent(t)},_onStyleChange:function(t){this._update(!0),this._forwardStyleEvent(t)},_onSourceAdd:function(t){var e=t.source;e.onAdd&&e.onAdd(this),this._forwardSourceEvent(t)},_onSourceRemove:function(t){var e=t.source;e.onRemove&&e.onRemove(this),this._forwardSourceEvent(t)},_onSourceUpdate:function(t){this._update(),this._forwardSourceEvent(t)},_onWindowOnline:function(){this._update()},_onWindowResize:function(){this._trackResize&&this.stop().resize()._update()}}),a.extendAll(k.prototype,{_showTileBoundaries:!1,get showTileBoundaries(){return this._showTileBoundaries},set showTileBoundaries(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},_showCollisionBoxes:!1,get showCollisionBoxes(){return this._showCollisionBoxes},set showCollisionBoxes(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,this.style._redoPlacement())},_showOverdrawInspector:!1,get showOverdrawInspector(){return this._showOverdrawInspector},set showOverdrawInspector(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},_repaint:!1,get repaint(){return this._repaint},set repaint(t){this._repaint=t,this._update()},_vertices:!1,get vertices(){return this._vertices},set vertices(t){this._vertices=t,this._update()}})},{"../geo/lng_lat":78,"../geo/lng_lat_bounds":79,"../geo/transform":80,"../render/painter":94,"../style/animation_loop":114,"../style/style":117,"../util/browser":165,"../util/canvas":166,"../util/dom":167,"../util/evented":173,"../util/util":181,"./bind_handlers":146,"./camera":147,"./control/attribution":148,"./hash":159,"point-geometry":187}],161:[function(t,e,n){"use strict";function r(t,e){t||(t=i.create("div")),t.classList.add("mapboxgl-marker"),this._el=t,this._offset=o.convert(e&&e.offset||[0,0]),this._update=this._update.bind(this)}e.exports=r;var i=t("../util/dom"),a=t("../geo/lng_lat"),o=t("point-geometry");r.prototype={addTo:function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._el),t.on("move",this._update),this._update(),this},remove:function(){this._map&&(this._map.off("move",this._update),this._map=null);var t=this._el.parentNode;return t&&t.removeChild(this._el),this},getLngLat:function(){return this._lngLat},setLngLat:function(t){return this._lngLat=a.convert(t),this._update(),this},getElement:function(){return this._el},_update:function(){if(this._map){var t=this._map.project(this._lngLat)._add(this._offset);i.setTransform(this._el,"translate("+t.x+"px,"+t.y+"px)")}}}},{"../geo/lng_lat":78,"../util/dom":167,"point-geometry":187}],162:[function(t,e,n){"use strict";function r(t){i.setOptions(this,t),i.bindAll(["_update","_onClickClose"],this)}e.exports=r;var i=t("../util/util"),a=t("../util/evented"),o=t("../util/dom"),s=t("../geo/lng_lat");r.prototype=i.inherit(a,{options:{closeButton:!0,closeOnClick:!0},addTo:function(t){return this._map=t,this._map.on("move",this._update),this.options.closeOnClick&&this._map.on("click",this._onClickClose),this._update(),this},remove:function(){return this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._container&&(this._container.parentNode.removeChild(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("click",this._onClickClose),delete this._map),this.fire("close"),this},getLngLat:function(){return this._lngLat},setLngLat:function(t){return this._lngLat=s.convert(t),this._update(),this},setText:function(t){return this.setDOMContent(document.createTextNode(t))},setHTML:function(t){var e,n=document.createDocumentFragment(),r=document.createElement("body");for(r.innerHTML=t;;){if(e=r.firstChild,!e)break;n.appendChild(e)}return this.setDOMContent(n)},setDOMContent:function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},_createContent:function(){this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._content=o.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=o.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClickClose))},_update:function(){if(this._map&&this._lngLat&&this._content){this._container||(this._container=o.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=o.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content));var t=this._map.project(this._lngLat).round(),e=this.options.anchor;if(!e){var n=this._container.offsetWidth,r=this._container.offsetHeight;e=t.ythis._map.transform.height-r?["bottom"]:[],t.xthis._map.transform.width-n/2&&e.push("right"),e=0===e.length?"bottom":e.join("-")}var i={top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"},a=this._container.classList;for(var s in i)a.remove("mapboxgl-popup-anchor-"+s);a.add("mapboxgl-popup-anchor-"+e),o.setTransform(this._container,i[e]+" translate("+t.x+"px,"+t.y+"px)")}},_onClickClose:function(){this.remove()}})},{"../geo/lng_lat":78,"../util/dom":167,"../util/evented":173,"../util/util":181}],163:[function(t,e,n){"use strict";function r(t,e){this.target=t,this.parent=e,this.callbacks={},this.callbackID=0,this.receive=this.receive.bind(this),this.target.addEventListener("message",this.receive,!1)}e.exports=r,r.prototype.receive=function(t){function e(t,e,n){this.postMessage({type:"",id:String(i),error:t?String(t):null,data:e},n)}var n,r=t.data,i=r.id;if(""===r.type)n=this.callbacks[r.id],delete this.callbacks[r.id],n&&n(r.error||null,r.data);else if("undefined"!=typeof r.id&&this.parent[r.type])this.parent[r.type](r.data,e.bind(this));else if("undefined"!=typeof r.id&&this.parent.workerSources){var a=r.type.split(".");this.parent.workerSources[a[0]][a[1]](r.data,e.bind(this)); }else this.parent[r.type](r.data)},r.prototype.send=function(t,e,n,r){var i=null;n&&(this.callbacks[i=this.callbackID++]=n),this.postMessage({type:t,id:String(i),data:e},r)},r.prototype.postMessage=function(t,e){this.target.postMessage(t,e)}},{}],164:[function(t,e,n){"use strict";function r(t){var e=document.createElement("a");return e.href=t,e.protocol===document.location.protocol&&e.host===document.location.host}n.getJSON=function(t,e){var n=new XMLHttpRequest;return n.open("GET",t,!0),n.setRequestHeader("Accept","application/json"),n.onerror=function(t){e(t)},n.onload=function(){if(n.status>=200&&n.status<300&&n.response){var t;try{t=JSON.parse(n.response)}catch(t){return e(t)}e(null,t)}else e(new Error(n.statusText))},n.send(),n},n.getArrayBuffer=function(t,e){var n=new XMLHttpRequest;return n.open("GET",t,!0),n.responseType="arraybuffer",n.onerror=function(t){e(t)},n.onload=function(){n.status>=200&&n.status<300&&n.response?e(null,n.response):e(new Error(n.statusText))},n.send(),n},n.getImage=function(t,e){return n.getArrayBuffer(t,function(t,n){if(t)return e(t);var r=new Image;r.onload=function(){e(null,r),(window.URL||window.webkitURL).revokeObjectURL(r.src)};var i=new Blob([new Uint8Array(n)],{type:"image/png"});return r.src=(window.URL||window.webkitURL).createObjectURL(i),r.getData=function(){var t=document.createElement("canvas"),e=t.getContext("2d");return t.width=r.width,t.height=r.height,e.drawImage(r,0,0),e.getImageData(0,0,r.width,r.height).data},r})},n.getVideo=function(t,e){var n=document.createElement("video");n.onloadstart=function(){e(null,n)};for(var i=0;i=s+r?t.call(i,1):(t.call(i,(l-s)/r),n.frame(a)))}if(!r)return t.call(i,1),null;var o=!1,s=e.exports.now();return n.frame(a),function(){o=!0}},n.supported=t("mapbox-gl-supported"),n.hardwareConcurrency=navigator.hardwareConcurrency||4,Object.defineProperty(n,"devicePixelRatio",{get:function(){return window.devicePixelRatio}}),n.supportsWebp=!1;var a=document.createElement("img");a.onload=function(){n.supportsWebp=!0},a.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=",n.supportsGeolocation=!!navigator.geolocation},{"mapbox-gl-supported":66}],166:[function(t,e,n){"use strict";function r(t,e){this.canvas=document.createElement("canvas"),t&&e&&(this.canvas.style.position="absolute",this.canvas.classList.add("mapboxgl-canvas"),this.canvas.addEventListener("webglcontextlost",t._contextLost.bind(t),!1),this.canvas.addEventListener("webglcontextrestored",t._contextRestored.bind(t),!1),this.canvas.setAttribute("tabindex",0),e.appendChild(this.canvas))}var i=t("../util"),a=t("mapbox-gl-supported");e.exports=r,r.prototype.resize=function(t,e){var n=window.devicePixelRatio||1;this.canvas.width=n*t,this.canvas.height=n*e,this.canvas.style.width=t+"px",this.canvas.style.height=e+"px"},r.prototype.getWebGLContext=function(t){return t=i.extend({},t,a.webGLContextAttributes),this.canvas.getContext("webgl",t)||this.canvas.getContext("experimental-webgl",t)},r.prototype.getElement=function(){return this.canvas}},{"../util":181,"mapbox-gl-supported":66}],167:[function(t,e,n){"use strict";function r(t){for(var e=0;e1)for(var f=0;f=0&&this._events[t].splice(n,1),this._events[t].length||delete this._events[t]}else delete this._events[t];return this},once:function(t,e){var n=function(r){this.off(t,n),e.call(this,r)}.bind(this);return this.on(t,n),this},fire:function(t,e){if(!this.listens(t))return r.endsWith(t,"error")&&console.error(e&&e.error||e||"Empty error event"),this;e=r.extend({},e),r.extend(e,{type:t,target:this});for(var n=this._events[t].slice(),i=0;i=3)for(var l=0;l1){if(s(t,e))return!0;for(var r=0;r(e.y-t.y)*(n.x-t.x)}function u(t,e,n,r){return l(t,n,r)!==l(e,n,r)&&l(t,e,n)!==l(t,e,r)}function c(t,e,n){var r=n*n;if(1===e.length)return t.distSqr(e[0])1?t.distSqr(n):t.distSqr(n.sub(e)._mult(i)._add(e))}function h(t,e){for(var n,r,i,a=!1,o=0;oe.y!=i.y>e.y&&e.x<(i.x-r.x)*(e.y-r.y)/(i.y-r.y)+r.x&&(a=!a)}return a}function d(t,e){for(var n=!1,r=0,i=t.length-1;re.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(n=!n)}return n}e.exports={multiPolygonIntersectsBufferedMultiPoint:r,multiPolygonIntersectsMultiPolygon:i,multiPolygonIntersectsBufferedMultiLine:a}},{}],177:[function(t,e,n){"use strict";function r(t,e){this.max=t,this.onRemove=e,this.reset()}e.exports=r,r.prototype.reset=function(){for(var t in this.data)this.onRemove(this.data[t]);return this.data={},this.order=[],this},r.prototype.add=function(t,e){if(this.has(t))this.order.splice(this.order.indexOf(t),1),this.data[t]=e,this.order.push(t);else if(this.data[t]=e,this.order.push(t),this.order.length>this.max){var n=this.get(this.order[0]);n&&this.onRemove(n)}return this},r.prototype.has=function(t){return t in this.data},r.prototype.keys=function(){return this.order},r.prototype.get=function(t){if(!this.has(t))return null;var e=this.data[t];return delete this.data[t],this.order.splice(this.order.indexOf(t),1),e},r.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this.get(this.order[0]);e&&this.onRemove(e)}return this}},{}],178:[function(t,e,n){"use strict";function r(t,e,n){if(n=n||o.ACCESS_TOKEN,!n&&o.REQUIRE_ACCESS_TOKEN)throw new Error("An API access token is required to use Mapbox GL. See https://www.mapbox.com/developers/api/#access-tokens");if(t=t.replace(/^mapbox:\/\//,o.API_URL+e),t+=t.indexOf("?")!==-1?"&access_token=":"?access_token=",o.REQUIRE_ACCESS_TOKEN){if("s"===n[0])throw new Error("Use a public access token (pk.*) with Mapbox GL JS, not a secret access token (sk.*). See https://www.mapbox.com/developers/api/#access-tokens");t+=n}return t}function i(t){return t?"?"+t:""}function a(t){return t.access_token&&"tk."===t.access_token.slice(0,3)?u.extend({},t,{access_token:o.ACCESS_TOKEN}):t}var o=t("./config"),s=t("./browser"),l=t("url"),u=t("./util");e.exports.normalizeStyleURL=function(t,e){var n=l.parse(t);return"mapbox:"!==n.protocol?t:r("mapbox:/"+n.pathname+i(n.query),"/styles/v1/",e)},e.exports.normalizeSourceURL=function(t,e){var n=l.parse(t);return"mapbox:"!==n.protocol?t:r(t+".json","/v4/",e)+"&secure"},e.exports.normalizeGlyphsURL=function(t,e){var n=l.parse(t);if("mapbox:"!==n.protocol)return t;var a=n.pathname.split("/")[1];return r("mapbox://"+a+"/{fontstack}/{range}.pbf"+i(n.query),"/fonts/v1/",e)},e.exports.normalizeSpriteURL=function(t,e,n,a){var o=l.parse(t);return"mapbox:"!==o.protocol?(o.pathname+=e+n,l.format(o)):r("mapbox:/"+o.pathname+"/sprite"+e+n+i(o.query),"/styles/v1/",a)},e.exports.normalizeTileURL=function(t,e,n){var r=l.parse(t,!0);if(!e)return t;var i=l.parse(e);if("mapbox:"!==i.protocol)return t;var o=s.supportsWebp?".webp":"$1",u=s.devicePixelRatio>=2||512===n?"@2x":"";return l.format({protocol:r.protocol,hostname:r.hostname,pathname:r.pathname.replace(/(\.(?:png|jpg)\d*)/,u+o),query:a(r.query)})}},{"./browser":165,"./config":170,"./util":181,url:199}],179:[function(t,e,n){"use strict";function r(t){function e(){h.apply(this,arguments)}function n(){d.apply(this,arguments),this.members=e.prototype.members}var r=JSON.stringify(t);if(g[r])return g[r];void 0===t.alignment&&(t.alignment=1),e.prototype=Object.create(h.prototype);var s=0,u=0,v=["Uint8"];return e.prototype.members=t.members.map(function(n){n={name:n.name,type:n.type,components:n.components||1},p(n.name.length),p(n.type in m),v.indexOf(n.type)<0&&v.push(n.type);var r=o(n.type);u=Math.max(u,r),n.offset=s=a(s,Math.max(t.alignment,r));for(var i=0;ithis.capacity){this.capacity=Math.max(t,Math.floor(this.capacity*this.RESIZE_MULTIPLIER),this.DEFAULT_CAPACITY),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},d.prototype._refreshViews=function(){for(var t=0;t=1)return 1;var e=t*t,n=e*t;return 4*(t<.5?n:3*(t-e)+n-.75)},n.bezier=function(t,e,n,i){var a=new r(t,e,n,i);return function(t){return a.solve(t)}},n.ease=n.bezier(.25,.1,.25,1),n.clamp=function(t,e,n){return Math.min(n,Math.max(e,t))},n.wrap=function(t,e,n){var r=n-e,i=((t-e)%r+r)%r+e;return i===e?n:i},n.coalesce=function(){for(var t=0;t=0)return!0;return!1};var o={};n.warnOnce=function(t){o[t]||("undefined"!=typeof console&&console.warn(t),o[t]=!0)}},{"../geo/coordinate":77,unitbezier:198}],182:[function(t,e,n){"use strict";function r(t,e,n,r){this._vectorTileFeature=t,t._z=e,t._x=n,t._y=r,this.properties=t.properties,null!=t.id&&(this.id=t.id)}e.exports=r,r.prototype={type:"Feature",get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},set geometry(t){this._geometry=t},toJSON:function(){var t={};for(var e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&"toJSON"!==e&&(t[e]=this[e]);return t}}},{}],183:[function(t,e,n){e.exports={_args:[[{raw:"mapbox-gl@^0.22.0",scope:null,escapedName:"mapbox-gl",name:"mapbox-gl",rawSpec:"^0.22.0",spec:">=0.22.0 <0.23.0",type:"range"},"/home/etienne/Documents/plotly/plotly.js"]],_from:"mapbox-gl@>=0.22.0 <0.23.0",_id:"mapbox-gl@0.22.1",_inCache:!0,_location:"/mapbox-gl",_nodeVersion:"4.4.5",_npmOperationalInternal:{host:"packages-12-west.internal.npmjs.com",tmp:"tmp/mapbox-gl-0.22.1.tgz_1471549891670_0.8762630566488951"},_npmUser:{name:"lucaswoj",email:"lucas@lucaswoj.com"},_npmVersion:"2.15.5",_phantomChildren:{},_requested:{raw:"mapbox-gl@^0.22.0",scope:null,escapedName:"mapbox-gl",name:"mapbox-gl",rawSpec:"^0.22.0",spec:">=0.22.0 <0.23.0",type:"range"},_requiredBy:["/"],_resolved:"https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-0.22.1.tgz",_shasum:"92a965547d4c2f24c22cbc487eeda48694cb627a",_shrinkwrap:null,_spec:"mapbox-gl@^0.22.0",_where:"/home/etienne/Documents/plotly/plotly.js",browser:{"./js/util/ajax.js":"./js/util/browser/ajax.js","./js/util/browser.js":"./js/util/browser/browser.js","./js/util/canvas.js":"./js/util/browser/canvas.js","./js/util/dom.js":"./js/util/browser/dom.js","./js/util/web_worker.js":"./js/util/browser/web_worker.js"},bugs:{url:"https://github.com/mapbox/mapbox-gl-js/issues"},dependencies:{csscolorparser:"^1.0.2",earcut:"^2.0.3","feature-filter":"^2.2.0","geojson-rewind":"^0.1.0","geojson-vt":"^2.4.0","gl-matrix":"^2.3.1","grid-index":"^1.0.0","mapbox-gl-function":"^1.2.1","mapbox-gl-shaders":"github:mapbox/mapbox-gl-shaders#de2ab007455aa2587c552694c68583f94c9f2747","mapbox-gl-style-spec":"github:mapbox/mapbox-gl-style-spec#83b1a3e5837d785af582efd5ed1a212f2df6a4ae","mapbox-gl-supported":"^1.2.0",pbf:"^1.3.2",pngjs:"^2.2.0","point-geometry":"^0.0.0",quickselect:"^1.0.0",request:"^2.39.0","resolve-url":"^0.2.1","shelf-pack":"^1.0.0",supercluster:"^2.0.1",unassertify:"^2.0.0",unitbezier:"^0.0.0","vector-tile":"^1.3.0","vt-pbf":"^2.0.2",webworkify:"^1.3.0","whoots-js":"^2.0.0"},description:"A WebGL interactive maps library",devDependencies:{"babel-preset-react":"^6.11.1",babelify:"^7.3.0",benchmark:"~2.1.0",browserify:"^13.0.0",clipboard:"^1.5.12","concat-stream":"1.5.1",coveralls:"^2.11.8",doctrine:"^1.2.1",documentation:"https://github.com/documentationjs/documentation/archive/bb41619c734e59ef3fbc3648610032efcfdaaace.tar.gz","documentation-theme-utils":"3.0.0",envify:"^3.4.0",eslint:"^2.5.3","eslint-config-mourner":"^2.0.0","eslint-plugin-html":"^1.5.1",gl:"^4.0.1",handlebars:"4.0.5","highlight.js":"9.3.0",istanbul:"^0.4.2","json-loader":"^0.5.4",lodash:"^4.13.1","mapbox-gl-test-suite":"github:mapbox/mapbox-gl-test-suite#7babab52fb02788ebbc38384139bf350e8e38552","memory-fs":"^0.3.0",minifyify:"^7.0.1","npm-run-all":"^3.0.0",nyc:"6.4.0",proxyquire:"^1.7.9",remark:"4.2.2","remark-html":"3.0.0",sinon:"^1.15.4",st:"^1.2.0",tap:"^5.7.0","transform-loader":"^0.2.3","unist-util-visit":"1.1.0",vinyl:"1.1.1","vinyl-fs":"2.4.3",watchify:"^3.7.0",webpack:"^1.13.1","webworkify-webpack":"^1.1.3"},directories:{},dist:{shasum:"92a965547d4c2f24c22cbc487eeda48694cb627a",tarball:"https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-0.22.1.tgz"},engines:{node:">=4.0.0"},gitHead:"13a9015341f0602ccb55c98c53079838ad4b70b5",homepage:"https://github.com/mapbox/mapbox-gl-js#readme",license:"BSD-3-Clause",main:"js/mapbox-gl.js",maintainers:[{name:"aaronlidman",email:"aaronlidman@gmail.com"},{name:"ajashton",email:"aj.ashton@gmail.com"},{name:"ansis",email:"ansis.brammanis@gmail.com"},{name:"bergwerkgis",email:"wb@bergwerk-gis.at"},{name:"bhousel",email:"bryan@mapbox.com"},{name:"bsudekum",email:"bobby@mapbox.com"},{name:"camilleanne",email:"camille@mapbox.com"},{name:"dnomadb",email:"damon@mapbox.com"},{name:"dthompson",email:"dthompson@gmail.com"},{name:"emilymcafee",email:"emily@mapbox.com"},{name:"flippmoke",email:"flippmoke@gmail.com"},{name:"freenerd",email:"spam@freenerd.de"},{name:"gretacb",email:"carol@mapbox.com"},{name:"ian29",email:"ian.villeda@gmail.com"},{name:"ianshward",email:"ian@mapbox.com"},{name:"ingalls",email:"nicholas.ingalls@gmail.com"},{name:"jfirebaugh",email:"john.firebaugh@gmail.com"},{name:"jrpruit1",email:"jake@jakepruitt.com"},{name:"karenzshea",email:"karen@mapbox.com"},{name:"kkaefer",email:"kkaefer@gmail.com"},{name:"lbud",email:"lauren@mapbox.com"},{name:"lucaswoj",email:"lucas@lucaswoj.com"},{name:"lxbarth",email:"alex@mapbox.com"},{name:"lyzidiamond",email:"lyzi@mapbox.com"},{name:"mapbox-admin",email:"accounts@mapbox.com"},{name:"mateov",email:"matt@mapbox.com"},{name:"mcwhittemore",email:"mcwhittemore@gmail.com"},{name:"miccolis",email:"jeff@miccolis.net"},{name:"mikemorris",email:"michael.patrick.morris@gmail.com"},{name:"morganherlocker",email:"morgan.herlocker@gmail.com"},{name:"mourner",email:"agafonkin@gmail.com"},{name:"nickidlugash",email:"nicki@mapbox.com"},{name:"rclark",email:"ryan.clark.j@gmail.com"},{name:"samanbb",email:"saman@mapbox.com"},{name:"sbma44",email:"tlee@mapbox.com"},{name:"scothis",email:"scothis@gmail.com"},{name:"sgillies",email:"sean@mapbox.com"},{name:"springmeyer",email:"dane@mapbox.com"},{name:"themarex",email:"patrick@mapbox.com"},{name:"tmcw",email:"tom@macwright.org"},{name:"tristen",email:"tristen.brown@gmail.com"},{name:"willwhite",email:"will@mapbox.com"},{name:"yhahn",email:"young@mapbox.com"}],name:"mapbox-gl",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git://github.com/mapbox/mapbox-gl-js.git"},scripts:{build:"npm run build-docs # invoked by publisher when publishing docs on the mb-pages branch","build-dev":"browserify js/mapbox-gl.js --debug --standalone mapboxgl > dist/mapbox-gl-dev.js && tap --no-coverage test/build/dev.test.js","build-docs":"documentation build --github --format html -c documentation.yml --theme ./docs/_theme --output docs/api/","build-min":"browserify js/mapbox-gl.js --debug -t unassertify --plugin [minifyify --map mapbox-gl.js.map --output dist/mapbox-gl.js.map] --standalone mapboxgl > dist/mapbox-gl.js && tap --no-coverage test/build/min.test.js","build-token":"browserify debug/access-token-src.js --debug -t envify > debug/access-token.js",lint:"eslint --ignore-path .gitignore js test bench docs/_posts/examples/*.html","open-changed-examples":"git diff --name-only mb-pages HEAD -- docs/_posts/examples/*.html | awk '{print \"http://127.0.0.1:4000/mapbox-gl-js/example/\" substr($0,33,length($0)-37)}' | xargs open",start:"run-p build-token watch-dev watch-bench start-server","start-bench":"run-p build-token watch-bench start-server","start-debug":"run-p build-token watch-dev start-server","start-docs":"npm run build-min && npm run build-docs && jekyll serve -w","start-server":"st --no-cache --localhost --port 9966 --index index.html .",test:"npm run lint && tap --reporter dot test/js/*/*.js test/build/webpack.test.js","test-suite":"node test/render.test.js && node test/query.test.js","watch-bench":"node bench/download-data.js && watchify bench/index.js --plugin [minifyify --no-map] -t [babelify --presets react] -t unassertify -t envify -o bench/bench.js -v","watch-dev":"watchify js/mapbox-gl.js --debug --standalone mapboxgl -o dist/mapbox-gl-dev.js -v"},version:"0.22.1"}},{}],184:[function(t,e,n){(function(t){function e(t,e){for(var n=0,r=t.length-1;r>=0;r--){var i=t[r];"."===i?t.splice(r,1):".."===i?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}function r(t,e){if(t.filter)return t.filter(e);for(var n=[],r=0;r=-1&&!i;a--){var o=a>=0?arguments[a]:t.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(n=o+"/"+n,i="/"===o.charAt(0))}return n=e(r(n.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+n||"."},n.normalize=function(t){var i=n.isAbsolute(t),a="/"===o(t,-1);return t=e(r(t.split("/"),function(t){return!!t}),!i).join("/"),t||i||(t="."),t&&a&&(t+="/"),(i?"/":"")+t},n.isAbsolute=function(t){return"/"===t.charAt(0)},n.join=function(){var t=Array.prototype.slice.call(arguments,0);return n.normalize(r(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},n.relative=function(t,e){function r(t){for(var e=0;e=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=n.resolve(t).substr(1),e=n.resolve(e).substr(1);for(var i=r(t.split("/")),a=r(e.split("/")),o=Math.min(i.length,a.length),s=o,l=0;l55295&&e<57344){if(!n){e>56319||a+1===r?i.push(239,191,189):n=e;continue}if(e<56320){i.push(239,191,189),n=e;continue}e=n-55296<<10|e-56320|65536,n=null}else n&&(i.push(239,191,189),n=null);e<128?i.push(e):e<2048?i.push(e>>6|192,63&e|128):e<65536?i.push(e>>12|224,e>>6&63|128,63&e|128):i.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}return i}e.exports=r;var a,o,s,l=t("ieee754");a={readUInt32LE:function(t){return(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},writeUInt32LE:function(t,e){this[e]=t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24},readInt32LE:function(t){return(this[t]|this[t+1]<<8|this[t+2]<<16)+(this[t+3]<<24)},readFloatLE:function(t){return l.read(this,t,!0,23,4)},readDoubleLE:function(t){return l.read(this,t,!0,52,8)},writeFloatLE:function(t,e){return l.write(this,t,e,!0,23,4)},writeDoubleLE:function(t,e){return l.write(this,t,e,!0,52,8)},toString:function(t,e,n){var r="",i="";e=e||0,n=Math.min(this.length,n||this.length);for(var a=e;a=1;){if(e.pos>=n)throw new Error("Given varint doesn't fit into 10 bytes");var r=255&t;e.buf[e.pos++]=r|(t>=128?128:0),t/=128}}function o(t,e,n){var r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.ceil(Math.log(e)/(7*Math.LN2));n.realloc(r);for(var i=n.pos-1;i>=t;i--)n.buf[i+r]=n.buf[i]}function s(t,e){for(var n=0;n>3,a=this.pos;t(i,e,this),this.pos===a&&this.skip(r)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=this.buf.readUInt32LE(this.pos);return this.pos+=4,t},readSFixed32:function(){var t=this.buf.readInt32LE(this.pos);return this.pos+=4,t},readFixed64:function(){var t=this.buf.readUInt32LE(this.pos)+this.buf.readUInt32LE(this.pos+4)*v;return this.pos+=8,t},readSFixed64:function(){var t=this.buf.readUInt32LE(this.pos)+this.buf.readInt32LE(this.pos+4)*v;return this.pos+=8,t},readFloat:function(){var t=this.buf.readFloatLE(this.pos);return this.pos+=4,t},readDouble:function(){var t=this.buf.readDoubleLE(this.pos);return this.pos+=8,t},readVarint:function(){var t,e,n=this.buf;return e=n[this.pos++],t=127&e,e<128?t:(e=n[this.pos++],t|=(127&e)<<7,e<128?t:(e=n[this.pos++],t|=(127&e)<<14,e<128?t:(e=n[this.pos++],t|=(127&e)<<21,e<128?t:i(t,this))))},readVarint64:function(){var t=this.pos,e=this.readVarint();if(e127;);else if(e===r.Bytes)this.pos=this.readVarint()+this.pos;else if(e===r.Fixed32)this.pos+=4;else{if(e!==r.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e268435455?void a(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),void(t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127)))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t);var e=g.byteLength(t);this.writeVarint(e),this.realloc(e),this.buf.write(t,this.pos),this.pos+=e},writeFloat:function(t){this.realloc(4),this.buf.writeFloatLE(t,this.pos),this.pos+=4},writeDouble:function(t){this.realloc(8),this.buf.writeDoubleLE(t,this.pos),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var n=0;n=128&&o(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,e,n){this.writeTag(t,r.Bytes),this.writeRawMessage(e,n)},writePackedVarint:function(t,e){this.writeMessage(t,s,e)},writePackedSVarint:function(t,e){this.writeMessage(t,l,e)},writePackedBoolean:function(t,e){this.writeMessage(t,f,e)},writePackedFloat:function(t,e){this.writeMessage(t,u,e)},writePackedDouble:function(t,e){this.writeMessage(t,c,e)},writePackedFixed32:function(t,e){this.writeMessage(t,h,e)},writePackedSFixed32:function(t,e){this.writeMessage(t,d,e)},writePackedFixed64:function(t,e){this.writeMessage(t,p,e)},writePackedSFixed64:function(t,e){this.writeMessage(t,m,e)},writeBytesField:function(t,e){this.writeTag(t,r.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,r.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,r.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,r.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,r.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,r.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,r.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,r.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,r.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,r.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./buffer":185}],187:[function(t,e,n){"use strict";function r(t,e){this.x=t,this.y=e}e.exports=r,r.prototype={clone:function(){return new r(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,n=t.y-this.y;return e*e+n*n},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,n=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=n,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),n=Math.sin(t),r=e*this.x-n*this.y,i=n*this.x+e*this.y;return this.x=r,this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},r.convert=function(t){return t instanceof r?t:Array.isArray(t)?new r(t[0],t[1]):t}},{}],188:[function(t,e,n){function r(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(t){if(f===setTimeout)return setTimeout(t,0);if((f===r||!f)&&setTimeout)return f=setTimeout,setTimeout(t,0);try{return f(t,0)}catch(e){try{return f.call(null,t,0)}catch(e){return f.call(this,t,0)}}}function o(t){if(h===clearTimeout)return clearTimeout(t);if((h===i||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(t);try{return h(t)}catch(e){try{return h.call(null,t)}catch(e){return h.call(this,t)}}}function s(){g&&p&&(g=!1,p.length?m=p.concat(m):v=-1,m.length&&l())}function l(){if(!g){var t=a(s);g=!0;for(var e=m.length;e;){for(p=m,m=[];++v1)for(var n=1;n1&&(r=n[0]+"@",t=n[1]),t=t.replace(P,".");var i=t.split("."),a=o(i,e).join(".");return r+a}function l(t){for(var e,n,r=[],i=0,a=t.length;i=55296&&e<=56319&&i65535&&(t-=65536,e+=R(t>>>10&1023|55296),t=56320|1023&t),e+=R(t)}).join("")}function c(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:M}function f(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function h(t,e,n){var r=0;for(t=n?F(t/T):t>>1,t+=F(t/e);t>O*A>>1;r+=M)t=F(t/O);return F(r+(O+1)*t/(t+S))}function d(t){var e,n,r,i,o,s,l,f,d,p,m=[],g=t.length,v=0,y=E,x=z;for(n=t.lastIndexOf(L),n<0&&(n=0),r=0;r=128&&a("not-basic"),m.push(t.charCodeAt(r));for(i=n>0?n+1:0;i=g&&a("invalid-input"),f=c(t.charCodeAt(i++)),(f>=M||f>F((w-v)/s))&&a("overflow"),v+=f*s,d=l<=x?k:l>=x+A?A:l-x,!(fF(w/p)&&a("overflow"),s*=p;e=m.length+1,x=h(v-o,e,0==o),F(v/e)>w-y&&a("overflow"),y+=F(v/e),v%=e,m.splice(v++,0,y)}return u(m)}function p(t){var e,n,r,i,o,s,u,c,d,p,m,g,v,y,x,_=[];for(t=l(t),g=t.length,e=E,n=0,o=z,s=0;s=e&&mF((w-n)/v)&&a("overflow"),n+=(u-e)*v,e=u,s=0;sw&&a("overflow"),m==e){for(c=n,d=M;p=d<=o?k:d>=o+A?A:d-o,!(c= 0x80 (not a basic code point)","invalid-input":"Invalid input"},O=M-k,F=Math.floor,R=String.fromCharCode;if(_={version:"1.4.1",ucs2:{decode:l,encode:u},decode:d,encode:p,toASCII:g,toUnicode:m},"function"==typeof t&&"object"==typeof t.amd&&t.amd)t("punycode",function(){return _});else if(v&&y)if(n.exports==v)y.exports=_;else for(b in _)_.hasOwnProperty(b)&&(v[b]=_[b]);else i.punycode=_}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],190:[function(t,e,n){"use strict";function r(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.exports=function(t,e,n,a){e=e||"&",n=n||"=";var o={};if("string"!=typeof t||0===t.length)return o;var s=/\+/g;t=t.split(e);var l=1e3;a&&"number"==typeof a.maxKeys&&(l=a.maxKeys);var u=t.length;l>0&&u>l&&(u=l);for(var c=0;c=0?(f=m.substr(0,g),h=m.substr(g+1)):(f=m,h=""),d=decodeURIComponent(f),p=decodeURIComponent(h),r(o,d)?i(o[d])?o[d].push(p):o[d]=[o[d],p]:o[d]=p}return o};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],191:[function(t,e,n){"use strict";function r(t,e){if(t.map)return t.map(e);for(var n=[],r=0;rn;){if(o-n>600){var l=o-n+1,u=e-n+1,c=Math.log(l),f=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*f*(l-f)/l)*(u-l/2<0?-1:1),d=Math.max(n,Math.floor(e-u*f/l+h)),p=Math.min(o,Math.floor(e+(l-u)*f/l+h));r(t,e,d,p,s)}var m=t[e],g=n,v=o;for(i(t,n,e),s(t[o],m)>0&&i(t,n,o);g0;)v--}0===s(t[n],m)?i(t,n,v):(v++,i(t,v,o)),v<=e&&(n=v+1),e<=v&&(o=v-1)}}function i(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function a(t,e){return te?1:0}e.exports=r},{}],194:[function(e,n,r){void function(e,i){"function"==typeof t&&t.amd?t(i):"object"==typeof r?n.exports=i():e.resolveUrl=i()}(this,function(){function t(){var t=arguments.length;if(0===t)throw new Error("resolveUrl requires at least one argument; got none.");var e=document.createElement("base");if(e.href=arguments[0],1===t)return e.href;var n=document.getElementsByTagName("head")[0];n.insertBefore(e,n.firstChild);for(var r,i=document.createElement("a"),a=1;a0){for(var s=0,l=0,u=0;ur.h||t>r.free||nc)&&(f=2*Math.max(t,c)),(ll)&&(u=2*Math.max(n,l)),this.resize(f,u),this.packOne(t,n)}return null},t.prototype.clear=function(){this.shelves=[],this.stats={}},t.prototype.resize=function(t,e){this.w=t,this.h=e;for(var n=0;nthis.free||e>this.h)return null;var n=this.x;return this.x+=t,this.free-=t,{x:n,y:this.y,w:t,h:e,width:t,height:e}},e.prototype.resize=function(t){return this.free+=t-this.w,this.w=t,!0},t})},{}],196:[function(t,e,n){"use strict";function r(t){return new i(t)}function i(t){this.options=d(Object.create(this.options),t),this.trees=new Array(this.options.maxZoom+1)}function a(t,e,n,r){return{x:t,y:e,zoom:1/0,id:r,numPoints:n}}function o(t,e){var n=t.geometry.coordinates;return a(u(n[0]),c(n[1]),1,e)}function s(t){return{type:"Feature",properties:l(t),geometry:{type:"Point",coordinates:[f(t.x),h(t.y)]}}}function l(t){var e=t.numPoints,n=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return{cluster:!0,point_count:e,point_count_abbreviated:n}}function u(t){return t/360+.5}function c(t){var e=Math.sin(t*Math.PI/180),n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n<0?0:n>1?1:n}function f(t){return 360*(t-.5)}function h(t){var e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function d(t,e){for(var n in e)t[n]=e[n];return t}function p(t){return t.x}function m(t){return t.y}var g=t("kdbush");e.exports=r,i.prototype={options:{minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1},load:function(t){var e=this.options.log;e&&console.time("total time");var n="prepare "+t.length+" points";e&&console.time(n),this.points=t;var r=t.map(o);e&&console.timeEnd(n);for(var i=this.options.maxZoom;i>=this.options.minZoom;i--){var a=+Date.now();this.trees[i+1]=g(r,p,m,this.options.nodeSize,Float32Array),r=this._cluster(r,i),e&&console.log("z%d: %d clusters in %dms",i,r.length,+Date.now()-a)}return this.trees[this.options.minZoom]=g(r,p,m,this.options.nodeSize,Float32Array),e&&console.timeEnd("total time"),this},getClusters:function(t,e){for(var n=this.trees[this._limitZoom(e)],r=n.range(u(t[0]),c(t[3]),u(t[2]),c(t[1])),i=[],a=0;a.5?l/(2-a-o):l/(a+o),a){case t:r=(e-n)/l+(e1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}var i,a,o;if(t=z(t,360),e=z(e,100),n=z(n,100),0===e)i=a=o=n;else{var s=n<.5?n*(1+e):n+e-n*e,l=2*n-s;i=r(l,s,t+1/3),a=r(l,s,t),o=r(l,s,t-1/3)}return{r:255*i,g:255*a,b:255*o}}function l(t,e,n){t=z(t,255),e=z(e,255),n=z(n,255);var r,i,a=H(t,e,n),o=G(t,e,n),s=a,l=a-o;if(i=0===a?0:l/a,a==o)r=0;else{switch(a){case t:r=(e-n)/l+(e>1)+720)%360;--e;)i.h=(i.h+a)%360,o.push(r(i));return o}function A(t,e){e=e||6;for(var n=r(t).toHsv(),i=n.h,a=n.s,o=n.v,s=[],l=1/e;e--;)s.push(r({h:i,s:a,v:o})),o=(o+l)%1;return s}function S(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}function T(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function z(t,n){I(t)&&(t="100%");var r=D(t);return t=G(n,H(0,parseFloat(t))),r&&(t=parseInt(t*n,10)/100),e.abs(t-n)<1e-6?1:t%n/parseFloat(n)}function E(t){return G(1,H(0,t))}function L(t){return parseInt(t,16)}function I(t){return"string"==typeof t&&t.indexOf(".")!=-1&&1===parseFloat(t)}function D(t){return"string"==typeof t&&t.indexOf("%")!=-1}function P(t){return 1==t.length?"0"+t:""+t}function C(t){return t<=1&&(t=100*t+"%"),t}function O(t){return e.round(255*parseFloat(t)).toString(16)}function F(t){return L(t)/255}function R(t){return!!W.CSS_UNIT.exec(t)}function j(t){t=t.replace(B,"").replace(q,"").toLowerCase();var e=!1;if(X[t])t=X[t],e=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=W.rgb.exec(t))?{r:n[1],g:n[2],b:n[3]}:(n=W.rgba.exec(t))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=W.hsl.exec(t))?{h:n[1],s:n[2],l:n[3]}:(n=W.hsla.exec(t))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=W.hsv.exec(t))?{h:n[1],s:n[2],v:n[3]}:(n=W.hsva.exec(t))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=W.hex8.exec(t))?{r:L(n[1]),g:L(n[2]),b:L(n[3]),a:F(n[4]),format:e?"name":"hex8"}:(n=W.hex6.exec(t))?{r:L(n[1]),g:L(n[2]),b:L(n[3]),format:e?"name":"hex"}:(n=W.hex4.exec(t))?{r:L(n[1]+""+n[1]),g:L(n[2]+""+n[2]),b:L(n[3]+""+n[3]),a:F(n[4]+""+n[4]),format:e?"name":"hex8"}:!!(n=W.hex3.exec(t))&&{r:L(n[1]+""+n[1]),g:L(n[2]+""+n[2]),b:L(n[3]+""+n[3]),format:e?"name":"hex"}}function N(t){var e,n;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),n=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA"),"small"!==n&&"large"!==n&&(n="small"),{level:e,size:n}}var B=/^\s+/,q=/\s+$/,V=0,U=e.round,G=e.min,H=e.max,Z=e.random;r.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,n,r,i,a,o,s=this.toRgb();return t=s.r/255,n=s.g/255,r=s.b/255,i=t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4),a=n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4),o=r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4),.2126*i+.7152*a+.0722*o},setAlpha:function(t){return this._a=T(t),this._roundA=U(100*this._a)/100,this},toHsv:function(){var t=l(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=l(this._r,this._g,this._b),e=U(360*t.h),n=U(100*t.s),r=U(100*t.v);return 1==this._a?"hsv("+e+", "+n+"%, "+r+"%)":"hsva("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var t=o(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=o(this._r,this._g,this._b),e=U(360*t.h),n=U(100*t.s),r=U(100*t.l);return 1==this._a?"hsl("+e+", "+n+"%, "+r+"%)":"hsla("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(t){return c(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return f(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:U(this._r),g:U(this._g),b:U(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+U(this._r)+", "+U(this._g)+", "+U(this._b)+")":"rgba("+U(this._r)+", "+U(this._g)+", "+U(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:U(100*z(this._r,255))+"%",g:U(100*z(this._g,255))+"%",b:U(100*z(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+U(100*z(this._r,255))+"%, "+U(100*z(this._g,255))+"%, "+U(100*z(this._b,255))+"%)":"rgba("+U(100*z(this._r,255))+"%, "+U(100*z(this._g,255))+"%, "+U(100*z(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(Y[c(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+h(this._r,this._g,this._b,this._a),n=e,i=this._gradientType?"GradientType = 1, ":"";if(t){var a=r(t);n="#"+h(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+e+",endColorstr="+n+")"},toString:function(t){var e=!!t;t=t||this._format;var n=!1,r=this._a<1&&this._a>=0,i=!e&&r&&("hex"===t||"hex6"===t||"hex3"===t||"hex4"===t||"hex8"===t||"name"===t);return i?"name"===t&&0===this._a?this.toName():this.toRgbString():("rgb"===t&&(n=this.toRgbString()),"prgb"===t&&(n=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(n=this.toHexString()),"hex3"===t&&(n=this.toHexString(!0)),"hex4"===t&&(n=this.toHex8String(!0)),"hex8"===t&&(n=this.toHex8String()),"name"===t&&(n=this.toName()),"hsl"===t&&(n=this.toHslString()),"hsv"===t&&(n=this.toHsvString()),n||this.toHexString())},clone:function(){return r(this.toString())},_applyModification:function(t,e){var n=t.apply(null,[this].concat([].slice.call(e)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(g,arguments)},brighten:function(){return this._applyModification(v,arguments)},darken:function(){return this._applyModification(y,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(p,arguments)},greyscale:function(){return this._applyModification(m,arguments)},spin:function(){return this._applyModification(x,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(k,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(M,arguments)},triad:function(){return this._applyCombination(b,arguments)},tetrad:function(){return this._applyCombination(w,arguments)}},r.fromRatio=function(t,e){if("object"==typeof t){var n={};for(var i in t)t.hasOwnProperty(i)&&("a"===i?n[i]=t[i]:n[i]=C(t[i]));t=n}return r(t,e)},r.equals=function(t,e){return!(!t||!e)&&r(t).toRgbString()==r(e).toRgbString()},r.random=function(){return r.fromRatio({r:Z(),g:Z(),b:Z()})},r.mix=function(t,e,n){n=0===n?0:n||50;var i=r(t).toRgb(),a=r(e).toRgb(),o=n/100,s={r:(a.r-i.r)*o+i.r,g:(a.g-i.g)*o+i.g,b:(a.b-i.b)*o+i.b,a:(a.a-i.a)*o+i.a};return r(s)},r.readability=function(t,n){var i=r(t),a=r(n);return(e.max(i.getLuminance(),a.getLuminance())+.05)/(e.min(i.getLuminance(),a.getLuminance())+.05)},r.isReadable=function(t,e,n){var i,a,o=r.readability(t,e);switch(a=!1,i=N(n),i.level+i.size){case"AAsmall":case"AAAlarge":a=o>=4.5; break;case"AAlarge":a=o>=3;break;case"AAAsmall":a=o>=7}return a},r.mostReadable=function(t,e,n){var i,a,o,s,l=null,u=0;n=n||{},a=n.includeFallbackColors,o=n.level,s=n.size;for(var c=0;cu&&(u=i,l=r(e[c]));return r.isReadable(t,l,{level:o,size:s})||!a?l:(n.includeFallbackColors=!1,r.mostReadable(t,["#fff","#000"],n))};var X=r.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Y=r.hexNames=S(X),W=function(){var t="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",n="(?:"+e+")|(?:"+t+")",r="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",i="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{CSS_UNIT:new RegExp(n),rgb:new RegExp("rgb"+r),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+r),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+r),hsva:new RegExp("hsva"+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();"undefined"!=typeof n&&n.exports?n.exports=r:"function"==typeof t&&t.amd?t(function(){return r}):window.tinycolor=r}(Math)},{}],198:[function(t,e,n){function r(t,e,n,r){this.cx=3*t,this.bx=3*(n-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(r-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=r,this.p2x=n,this.p2y=r}e.exports=r,r.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},r.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},r.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},r.prototype.solveCurveX=function(t,e){"undefined"==typeof e&&(e=1e-6);var n,r,i,a,o;for(i=t,o=0;o<8;o++){if(a=this.sampleCurveX(i)-t,Math.abs(a)r)return r;for(;na?n=i:r=i,i=.5*(r-n)+n}return i},r.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}},{}],199:[function(t,e,n){"use strict";function r(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function i(t,e,n){if(t&&u.isObject(t)&&t instanceof r)return t;var i=new r;return i.parse(t,e,n),i}function a(t){return u.isString(t)&&(t=i(t)),t instanceof r?t.format():r.prototype.format.call(t)}function o(t,e){return i(t,!1,!0).resolve(e)}function s(t,e){return t?i(t,!1,!0).resolveObject(e):e}var l=t("punycode"),u=t("./util");n.parse=i,n.resolve=o,n.resolveObject=s,n.format=a,n.Url=r;var c=/^([a-z0-9.+-]+:)/i,f=/:[0-9]*$/,h=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,d=["<",">",'"',"`"," ","\r","\n","\t"],p=["{","}","|","\\","^","`"].concat(d),m=["'"].concat(p),g=["%","/","?",";","#"].concat(m),v=["/","?","#"],y=255,x=/^[+a-z0-9A-Z_-]{0,63}$/,_=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,b={javascript:!0,"javascript:":!0},w={javascript:!0,"javascript:":!0},M={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},k=t("querystring");r.prototype.parse=function(t,e,n){if(!u.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var r=t.indexOf("?"),i=r!==-1&&r127?"x":C[F];if(!O.match(x)){var j=D.slice(0,T),N=D.slice(T+1),B=C.match(_);B&&(j.push(B[1]),N.unshift(B[2])),N.length&&(s="/"+N.join(".")+s),this.hostname=j.join(".");break}}}this.hostname.length>y?this.hostname="":this.hostname=this.hostname.toLowerCase(),I||(this.hostname=l.toASCII(this.hostname));var q=this.port?":"+this.port:"",V=this.hostname||"";this.host=V+q,this.href+=this.host,I&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!b[p])for(var T=0,P=m.length;T0)&&n.host.split("@");A&&(n.auth=A.shift(),n.host=n.hostname=A.shift())}return n.search=t.search,n.query=t.query,u.isNull(n.pathname)&&u.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!b.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var S=b.slice(-1)[0],T=(n.host||t.host||b.length>1)&&("."===S||".."===S)||""===S,z=0,E=b.length;E>=0;E--)S=b[E],"."===S?b.splice(E,1):".."===S?(b.splice(E,1),z++):z&&(b.splice(E,1),z--);if(!x&&!_)for(;z--;z)b.unshift("..");!x||""===b[0]||b[0]&&"/"===b[0].charAt(0)||b.unshift(""),T&&"/"!==b.join("/").substr(-1)&&b.push("");var L=""===b[0]||b[0]&&"/"===b[0].charAt(0);if(k){n.hostname=n.host=L?"":b.length?b.shift():"";var A=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@");A&&(n.auth=A.shift(),n.host=n.hostname=A.shift())}return x=x||n.host&&b.length,x&&!L&&b.unshift(""),b.length?n.pathname=b.join("/"):(n.pathname=null,n.path=null),u.isNull(n.pathname)&&u.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=t.auth||n.auth,n.slashes=n.slashes||t.slashes,n.href=n.format(),n},r.prototype.parseHost=function(){var t=this.host,e=f.exec(t);e&&(e=e[0],":"!==e&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{"./util":200,punycode:189,querystring:192}],200:[function(t,e,n){"use strict";e.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},{}],201:[function(t,e,n){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},{}],202:[function(t,e,n){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],203:[function(t,e,n){(function(e,r){function i(t,e){var r={seen:[],stylize:o};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),m(e)?r.showHidden=e:e&&n._extend(r,e),b(r.showHidden)&&(r.showHidden=!1),b(r.depth)&&(r.depth=2),b(r.colors)&&(r.colors=!1),b(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=a),l(r,t,r.depth)}function a(t,e){var n=i.styles[e];return n?"\x1b["+i.colors[n][0]+"m"+t+"\x1b["+i.colors[n][1]+"m":t}function o(t,e){return t}function s(t){var e={};return t.forEach(function(t,n){e[t]=!0}),e}function l(t,e,r){if(t.customInspect&&e&&S(e.inspect)&&e.inspect!==n.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(r,t);return x(i)||(i=l(t,i,r)),i}var a=u(t,e);if(a)return a;var o=Object.keys(e),m=s(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),A(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return c(e);if(0===o.length){if(S(e)){var g=e.name?": "+e.name:"";return t.stylize("[Function"+g+"]","special")}if(w(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(k(e))return t.stylize(Date.prototype.toString.call(e),"date");if(A(e))return c(e)}var v="",y=!1,_=["{","}"];if(p(e)&&(y=!0,_=["[","]"]),S(e)){var b=e.name?": "+e.name:"";v=" [Function"+b+"]"}if(w(e)&&(v=" "+RegExp.prototype.toString.call(e)),k(e)&&(v=" "+Date.prototype.toUTCString.call(e)),A(e)&&(v=" "+c(e)),0===o.length&&(!y||0==e.length))return _[0]+v+_[1];if(r<0)return w(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var M;return M=y?f(t,e,r,m,o):o.map(function(n){return h(t,e,r,m,n,y)}),t.seen.pop(),d(M,v,_)}function u(t,e){if(b(e))return t.stylize("undefined","undefined");if(x(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}return y(e)?t.stylize(""+e,"number"):m(e)?t.stylize(""+e,"boolean"):g(e)?t.stylize("null","null"):void 0}function c(t){return"["+Error.prototype.toString.call(t)+"]"}function f(t,e,n,r,i){for(var a=[],o=0,s=e.length;o-1&&(s=a?s.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+s.split("\n").map(function(t){return" "+t}).join("\n"))):s=t.stylize("[Circular]","special")),b(o)){if(a&&i.match(/^\d+$/))return s;o=JSON.stringify(""+i),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+s}function d(t,e,n){var r=0,i=t.reduce(function(t,e){return r++,e.indexOf("\n")>=0&&r++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?n[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+n[1]:n[0]+e+" "+t.join(", ")+" "+n[1]}function p(t){return Array.isArray(t)}function m(t){return"boolean"==typeof t}function g(t){return null===t}function v(t){return null==t}function y(t){return"number"==typeof t}function x(t){return"string"==typeof t}function _(t){return"symbol"==typeof t}function b(t){return void 0===t}function w(t){return M(t)&&"[object RegExp]"===z(t)}function M(t){return"object"==typeof t&&null!==t}function k(t){return M(t)&&"[object Date]"===z(t)}function A(t){return M(t)&&("[object Error]"===z(t)||t instanceof Error)}function S(t){return"function"==typeof t}function T(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t}function z(t){return Object.prototype.toString.call(t)}function E(t){return t<10?"0"+t.toString(10):t.toString(10)}function L(){var t=new Date,e=[E(t.getHours()),E(t.getMinutes()),E(t.getSeconds())].join(":");return[t.getDate(),O[t.getMonth()],e].join(" ")}function I(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var D=/%[sdj%]/g;n.format=function(t){if(!x(t)){for(var e=[],n=0;n=a)return t;switch(t){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"}default:return t}}),s=r[n];n>3}if(i--,1===r||2===r)a+=t.readSVarint(),o+=t.readSVarint(),1===r&&(e&&s.push(e),e=[]),e.push(new l(a,o));else{if(7!==r)throw new Error("unknown command "+r);e&&e.push(e[0].clone())}}return e&&s.push(e),s},r.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,n=1,r=0,i=0,a=0,o=1/0,s=-(1/0),l=1/0,u=-(1/0);t.pos>3}if(r--,1===n||2===n)i+=t.readSVarint(),a+=t.readSVarint(),is&&(s=i),au&&(u=a);else if(7!==n)throw new Error("unknown command "+n)}return[o,l,s,u]},r.prototype.toGeoJSON=function(t,e,n){function i(t){for(var e=0;e>3;e=1===r?t.readString():2===r?t.readFloat():3===r?t.readDouble():4===r?t.readVarint64():5===r?t.readVarint():6===r?t.readSVarint():7===r?t.readBoolean():null}return e}var o=t("./vectortilefeature.js");e.exports=r,r.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new o(this._pbf,e,this.extent,this._keys,this._values)}},{"./vectortilefeature.js":206}],208:[function(t,e,n){function r(t){var e=[];for(var n in t.layers)e.push(a(t.layers[n]));var r=new c;return f.tile.write({layers:e},r),r.finish()}function i(t){var e={};for(var n in t)e[n]=new h(t[n].features),e[n].name=n;return r({layers:e})}function a(t){for(var e={name:t.name||"",version:t.version||1,extent:t.extent||4096,keys:[],values:[],features:[]},n={},r={},i=0;i>31}function l(t){for(var e=[],n=0,r=0,i=t.length,a=0;a2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}rt.selectAll("tspan.line").attr({y:0,x:0});var r=J.select(".annotation-math-group"),i=!r.empty(),s=d.bBox((i?r:rt).node()),u=s.width,p=s.height,v=Math.round(u+2*tt),y=Math.round(p+2*tt);G._w=u,G._h=p;var _=!1;if(["x","y"].forEach(function(e){var r,i=G[e+"ref"]||e,a=f.getFromId(t,i),o=(Y+("x"===e?0:90))*Math.PI/180,s=v*Math.abs(Math.cos(o))+y*Math.abs(Math.sin(o)),l=G[e+"anchor"];if(a){var u=a.r2fraction(G[e]);if(!a.autorange&&(u<0||u>1)&&(G["a"+e+"ref"]===i?(u=a.r2fraction(G["a"+e]),(u<0||u>1)&&(_=!0)):_=!0,_))return;X[e]=a._offset+a.r2p(G[e]),r=.5}else r=G[e],"y"===e&&(r=1-r),X[e]="x"===e?I.l+I.w*r:I.t+I.h*r;var c=0;G["a"+e+"ref"]===i?X["aa"+e]=a._offset+a.r2p(G["a"+e]):(c=G.showarrow?G["a"+e]:s*n(r,l),X[e]+=c),G["_"+e+"type"]=a&&a.type,G["_"+e+"size"]=s,G["_"+e+"shift"]=c}),_)return void J.remove();var b,w;G.showarrow&&(b=G.axref===G.xref?X.x:c.constrain(X.x-G.ax,1,k.width-1),w=G.ayref===G.yref?X.y:c.constrain(X.y-G.ay,1,k.height-1)),X.x=c.constrain(X.x,1,k.width-1),X.y=c.constrain(X.y,1,k.height-1);var M=tt-s.top,A=tt-s.left;i?r.select("svg").attr({x:tt-1,y:tt}):(rt.attr({x:A,y:M}),rt.selectAll("tspan.line").attr({y:M,x:A})),et.call(d.setRect,$/2,$/2,v-$,y-$);var S=0,T=0;S=G.axref===G.xref?Math.round(X.aax-v/2):Math.round(X.x-v/2),T=G.ayref===G.yref?Math.round(X.aay-y/2):Math.round(X.y-y/2),J.call(c.setTranslate,S,T);var z="annotations["+e+"]",E=function(n,r){o.select(t).selectAll('.annotation-arrow-g[data-index="'+e+'"]').remove();var i,s;i=G.axref===G.xref?X.aax+n:X.x+n,s=G.ayref===G.yref?X.aay+r:X.y+r;var u=c.rotationXYMatrix(Y,i,s),f=c.apply2DTransform(u),d=c.apply2DTransform2(u),p=et.attr("width")/2,m=et.attr("height")/2,v=[[i-p,s-m,i-p,s+m],[i-p,s+m,i+p,s+m],[i+p,s+m,i+p,s-m],[i+p,s-m,i-p,s-m]].map(d);if(!v.reduce(function(t,e){return t^!!a(b,w,b+1e6,w+1e6,e[0],e[1],e[2],e[3])},!1)){v.forEach(function(t){var e=a(i,s,b,w,t[0],t[1],t[2],t[3]);e&&(i=e.x,s=e.y)});var y=G.arrowwidth,_=G.arrowcolor,M=W.append("g").style({opacity:h.opacity(_)}).classed("annotation-arrow-g",!0).attr("data-index",String(e)),k=M.append("path").attr("d","M"+i+","+s+"L"+b+","+w).style("stroke-width",y+"px").call(h.stroke,h.rgb(_));x(k,G.arrowhead,"end",G.arrowsize);var A=M.append("path").classed("annotation",!0).classed("anndrag",!0).attr({"data-index":String(e),d:"M3,3H-3V-3H3ZM0,0L"+(i-b)+","+(s-w),transform:"translate("+b+","+w+")"}).style("stroke-width",y+6+"px").call(h.stroke,"rgba(0,0,0,0)").call(h.fill,"rgba(0,0,0,0)");if(t._context.editable){var S,T,E;g.init({element:A.node(),prepFn:function(){var t=c.getTranslate(J);T=t.x,E=t.y,S={},H&&H.autorange&&(S[H._name+".autorange"]=!0),Z&&Z.autorange&&(S[Z._name+".autorange"]=!0)},moveFn:function(t,e){M.attr("transform","translate("+t+","+e+")");var n=f(T,E),r=n[0]+t,i=n[1]+e;J.call(c.setTranslate,r,i),S[z+".x"]=H?H.p2r(H.r2p(G.x)+t):(b+t-I.l)/I.w,S[z+".y"]=Z?Z.p2r(Z.r2p(G.y)+e):1-(w+e-I.t)/I.h,G.axref===G.xref&&(S[z+".ax"]=H?H.p2r(H.r2p(G.ax)+t):(b+t-I.l)/I.w),G.ayref===G.yref&&(S[z+".ay"]=Z?Z.p2r(Z.r2p(G.ay)+e):1-(w+e-I.t)/I.h),Q.attr({transform:"rotate("+Y+","+r+","+i+")"})},doneFn:function(e){if(e){l.relayout(t,S);var n=document.querySelector(".js-notes-box-panel");n&&n.redraw(n.selectedObj)}}})}}};G.showarrow&&E(0,0);var L=c.rotationXYMatrix(Y,X.x,X.y),D=c.apply2DTransform(L);if(t._context.editable){var P,C,O;g.init({element:J.node(),prepFn:function(){var t=c.getTranslate(J);P=t.x,C=t.y,O={}},moveFn:function(t,e){J.call(c.setTranslate,P+t,C+e);var n="pointer";if(G.showarrow)G.axref===G.xref?O[z+".ax"]=H.p2r(H.r2p(G.ax)+t):O[z+".ax"]=G.ax+t,G.ayref===G.yref?O[z+".ay"]=Z.p2r(Z.r2p(G.ay)+e):O[z+".ay"]=G.ay+e,E(t,e);else{if(H)O[z+".x"]=G.x+t/H._m;else{var r=G._xsize/I.w,i=G.x+G._xshift/I.w-r/2;O[z+".x"]=g.align(i+t/I.w,r,0,1,G.xanchor)}if(Z)O[z+".y"]=G.y+e/Z._m;else{var a=G._ysize/I.h,o=G.y-G._yshift/I.h-a/2;O[z+".y"]=g.align(o-e/I.h,a,0,1,G.yanchor)}H&&Z||(n=g.getCursor(H?.5:O[z+".x"],Z?.5:O[z+".y"],G.xanchor,G.yanchor))}var s=D(P,C),l=s[0]+t,u=s[1]+e;J.call(c.setTranslate,P+t,C+e),Q.attr({transform:"rotate("+Y+","+l+","+u+")"}),m(J,n)},doneFn:function(e){if(m(J),e){l.relayout(t,O);var n=document.querySelector(".js-notes-box-panel");n&&n.redraw(n.selectedObj)}}})}}var w,M=t.layout,k=t._fullLayout;if(!s(e)||e===-1){if(!e&&Array.isArray(u))return M.annotations=u,y(M,k),void r(t);if("remove"===u)return delete M.annotations,k.annotations=[],void r(t);if(n&&"add"!==u){for(w=0;we;w--)k._infolayer.selectAll('.annotation[data-index="'+(w-1)+'"]').attr("data-index",String(w)),i(t,w)}}k._infolayer.selectAll('.annotation[data-index="'+e+'"]').remove();var S=M.annotations[e],T=k.annotations[e];if(S){var z={};"string"==typeof n&&n?z[n]=u:c.isPlainObject(n)&&(z=n);var E=Object.keys(z);for(w=0;w4/3&&(R=V)}}else F&&(N&&(R<1/3?R+=q:R>2/3&&(R-=q)),R=(R-F.domain[0])/(F.domain[1]-F.domain[0]),R=F.fraction2r(R))}F&&F===O&&j&&("log"===j&&"log"!==F.type?R=Math.pow(10,R):"log"!==j&&"log"===F.type&&(R=R>0?Math.log(R)/Math.LN10:void 0)),S[C]=R}}var G={};v(S,G,k),k.annotations[e]=G;var H=f.getFromId(t,G.xref),Z=f.getFromId(t,G.yref),X={x:0,y:0},Y=+G.textangle||0,W=k._infolayer.append("g").classed("annotation",!0).attr("data-index",String(e)).style("opacity",G.opacity).on("click",function(){t._dragging=!1,t.emit("plotly_clickannotation",{index:e,annotation:S,fullAnnotation:G})}),Q=W.append("g").classed("annotation-text-g",!0).attr("data-index",String(e)),J=Q.append("g"),$=G.borderwidth,K=G.borderpad,tt=$+K,et=J.append("rect").attr("class","bg").style("stroke-width",$+"px").call(h.stroke,G.bordercolor).call(h.fill,G.bgcolor),nt=G.font,rt=J.append("text").classed("annotation",!0).attr("data-unformatted",G.text).text(G.text);t._context.editable?rt.call(p.makeEditable,J).call(_).on("edit",function(n){G.text=n,this.attr({"data-unformatted":G.text}),this.call(_);var r={};r["annotations["+e+"].text"]=G.text,H&&H.autorange&&(r[H._name+".autorange"]=!0),Z&&Z.autorange&&(r[Z._name+".autorange"]=!0),l.relayout(t,r)}):rt.call(_),Q.attr({transform:"rotate("+Y+","+X.x+","+X.y+")"}).call(d.setPosition,X.x,X.y)}}}function a(t,e,n,r,i,a,o,s){var l=n-t,u=i-t,c=o-i,f=r-e,h=a-e,d=s-a,p=l*d-c*f;if(0===p)return null;var m=(u*d-c*h)/p,g=(u*f-l*h)/p;return g<0||g>1||m<0||m>1?null:{x:t+l*m,y:e+f*m}}var o=t("d3"),s=t("fast-isnumeric"),l=t("../../plotly"),u=t("../../plots/plots"),c=t("../../lib"),f=t("../../plots/cartesian/axes"),h=t("../color"),d=t("../drawing"),p=t("../../lib/svg_text_utils"),m=t("../../lib/setcursor"),g=t("../dragelement"),v=t("./annotation_defaults"),y=t("./defaults"),x=t("./draw_arrow_head");e.exports={draw:r,drawOne:i}},{"../../lib":316,"../../lib/setcursor":326,"../../lib/svg_text_utils":328,"../../plotly":338,"../../plots/cartesian/axes":343,"../../plots/plots":374,"../color":223,"../dragelement":244,"../drawing":246,"./annotation_defaults":214,"./defaults":218,"./draw_arrow_head":220,d3:8,"fast-isnumeric":12}],220:[function(t,e,n){"use strict";var r=t("d3"),i=t("fast-isnumeric"),a=t("../color"),o=t("../drawing"),s=t("./arrow_paths");e.exports=function(t,e,n,l){i(l)||(l=1);var u=t.node(),c=s[e||0];if(c){"string"==typeof n&&n||(n="end");var f,h,d,p,m=(o.getPx(t,"stroke-width")||1)*l,g=t.style("stroke")||a.defaultLine,v=t.style("stroke-opacity")||1,y=n.indexOf("start")>=0,x=n.indexOf("end")>=0,_=c.backoff*m;if("line"===u.nodeName){if(f={x:+t.attr("x1"),y:+t.attr("y1")},h={x:+t.attr("x2"),y:+t.attr("y2")},d=Math.atan2(f.y-h.y,f.x-h.x),p=d+Math.PI,_){var b=_*Math.cos(d),w=_*Math.sin(d);y&&(f.x-=b,f.y-=w,t.attr({x1:f.x,y1:f.y})),x&&(h.x+=b,h.y+=w,t.attr({x2:h.x,y2:h.y}))}}else if("path"===u.nodeName){var M=u.getTotalLength(),k="";if(y){var A=u.getPointAtLength(0),S=u.getPointAtLength(.1);d=Math.atan2(A.y-S.y,A.x-S.x),f=u.getPointAtLength(Math.min(_,M)),_&&(k="0px,"+_+"px,")}if(x){var T=u.getPointAtLength(M),z=u.getPointAtLength(M-.1);if(p=Math.atan2(T.y-z.y,T.x-z.x),h=u.getPointAtLength(Math.max(0,M-_)),_){var E=k?2*_:_;k+=M-E+"px,"+M+"px"}}else k&&(k+=M+"px");k&&t.style("stroke-dasharray",k)}var L=function(n,i){e>5&&(i=0),r.select(u.parentElement).append("path").attr({class:t.attr("class"),d:c.path,transform:"translate("+n.x+","+n.y+")rotate("+180*i/Math.PI+")scale("+m+")"}).style({fill:g,opacity:v,"stroke-width":0})};y&&L(f,d),x&&L(h,p)}}},{"../color":223,"../drawing":246,"./arrow_paths":215,d3:8,"fast-isnumeric":12}],221:[function(t,e,n){"use strict";var r=t("./draw");e.exports={moduleType:"component",name:"annotations",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),calcAutorange:t("./calc_autorange"),draw:r.draw,drawOne:r.drawOne}},{"./attributes":216,"./calc_autorange":217,"./defaults":218,"./draw":219}],222:[function(t,e,n){"use strict";n.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],n.defaultLine="#444",n.lightLine="#eee",n.background="#fff",n.borderLine="#BEC8D9",n.lightFraction=1e3/11},{}],223:[function(t,e,n){"use strict";function r(t){if(a(t)||"string"!=typeof t)return t;var e=t.trim();if("rgb"!==e.substr(0,3))return t;var n=e.match(/^rgba?\s*\(([^()]*)\)$/);if(!n)return t;var r=n[1].trim().split(/\s*[\s,]\s*/),i="a"===e.charAt(3)&&4===r.length;if(!i&&3!==r.length)return t;for(var o=0;o=0))return t;if(3===o)r[o]>1&&(r[o]=1);else if(r[o]>=1)return t}var s=Math.round(255*r[0])+", "+Math.round(255*r[1])+", "+Math.round(255*r[2]);return i?"rgba("+s+", "+r[3]+")":"rgb("+s+")"}var i=t("tinycolor2"),a=t("fast-isnumeric"),o=e.exports={},s=t("./attributes");o.defaults=s.defaults,o.defaultLine=s.defaultLine,o.lightLine=s.lightLine,o.background=s.background,o.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},o.rgb=function(t){return o.tinyRGB(i(t))},o.opacity=function(t){return t?i(t).getAlpha():0},o.addOpacity=function(t,e){var n=i(t).toRgb();return"rgba("+Math.round(n.r)+", "+Math.round(n.g)+", "+Math.round(n.b)+", "+e+")"},o.combine=function(t,e){var n=i(t).toRgb();if(1===n.a)return i(t).toRgbString();var r=i(e||o.background).toRgb(),a=1===r.a?r:{r:255*(1-r.a)+r.r*r.a,g:255*(1-r.a)+r.g*r.a,b:255*(1-r.a)+r.b*r.a},s={r:a.r*(1-n.a)+n.r*n.a,g:a.g*(1-n.a)+n.g*n.a,b:a.b*(1-n.a)+n.b*n.a};return i(s).toRgbString()},o.contrast=function(t,e,n){var r=i(t),a=r.isLight()?r.darken(n):r.lighten(e);return a.toString()},o.stroke=function(t,e){var n=i(e);t.style({stroke:o.tinyRGB(n),"stroke-opacity":n.getAlpha()})},o.fill=function(t,e){var n=i(e);t.style({fill:o.tinyRGB(n),"fill-opacity":n.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,n,i,a,s=Object.keys(t);for(e=0;es&&(a[1]-=(st-s)/2)):n.node()&&!n.classed("js-placeholder")&&(st=d.bBox(e.node()).height),st){if(st+=5,"top"===b.titleside)K.domain[1]-=st/S.h,a[1]*=-1;else{K.domain[0]+=st/S.h;var u=Math.max(1,n.selectAll("tspan.line").size());a[1]+=(1-u)*s}e.attr("transform","translate("+a+")"),K.setScale()}}at.selectAll(".cbfills,.cblines,.cbaxis").attr("transform","translate(0,"+Math.round(S.h*(1-K.domain[1]))+")");var f=at.select(".cbfills").selectAll("rect.cbfill").data(L);f.enter().append("rect").classed("cbfill",!0).style("stroke","none"),f.exit().remove(),f.each(function(t,e){var n=[0===e?z[0]:(L[e]+L[e-1])/2,e===L.length-1?z[1]:(L[e]+L[e+1])/2].map(K.c2p).map(Math.round);e!==L.length-1&&(n[1]+=n[1]>n[0]?1:-1);var a=D(t).replace("e-",""),o=i(a).toHexString();r.select(this).attr({x:X,width:Math.max(B,2),y:r.min(n),height:Math.max(r.max(n)-r.min(n),2),fill:o})});var h=at.select(".cblines").selectAll("path.cbline").data(b.line.color&&b.line.width?E:[]);return h.enter().append("path").classed("cbline",!0),h.exit().remove(),h.each(function(t){r.select(this).attr("d","M"+X+","+(Math.round(K.c2p(t))+b.line.width/2%1)+"h"+B).call(d.lineGroupStyle,b.line.width,I(t),b.line.dash)}),K._axislayer.selectAll("g."+K._id+"tick,path").remove(),K._pos=X+B+(b.outlinewidth||0)/2-("outside"===b.ticks?1:0),K.side="right",c.syncOrAsync([function(){return l.doTicks(t,K,!0)},function(){if(["top","bottom"].indexOf(b.titleside)===-1){var e=K.titlefont.size,n=K._offset+K._length/2,i=S.l+(K.position||0)*S.w+("right"===K.side?10+e*(K.showticklabels?1:.5):-10-e*(K.showticklabels?.5:0));M("h"+K._id+"title",{avoid:{selection:r.select(t).selectAll("g."+K._id+"tick"),side:b.titleside,offsetLeft:S.l,offsetTop:S.t,maxShift:A.width},attributes:{x:i,y:n,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}}])}function M(e,n){var r,i=_();r=s.traceIs(i,"markerColorscale")?"marker.colorbar.title":"colorbar.title";var a={propContainer:K,propName:r,traceIndex:i.index,dfltName:"colorscale",containerGroup:at.select(".cbtitle")},o="h"===e.charAt(0)?e.substr(1):"h"+e;at.selectAll("."+o+",."+o+"-math-group").remove(),m.draw(t,e,f(a,n||{}))}function k(){var n=B+b.outlinewidth/2+d.bBox(K._axislayer.node()).width;if(R=ot.select("text"),R.node()&&!R.classed("js-placeholder")){var r,i=ot.select(".h"+K._id+"title-math-group").node();r=i&&["top","bottom"].indexOf(b.titleside)!==-1?d.bBox(i).width:d.bBox(ot.node()).right-X-S.l,n=Math.max(n,r)}var a=2*b.xpad+n+b.borderwidth+b.outlinewidth/2,s=Q-J;at.select(".cbbg").attr({x:X-b.xpad-(b.borderwidth+b.outlinewidth)/2,y:J-H,width:Math.max(a,2),height:Math.max(s+2*H,2)}).call(p.fill,b.bgcolor).call(p.stroke,b.bordercolor).style({"stroke-width":b.borderwidth}),at.selectAll(".cboutline").attr({x:X,y:J+b.ypad+("top"===b.titleside?st:0),width:Math.max(B,2),height:Math.max(s-2*b.ypad-st,2)}).call(p.stroke,b.outlinecolor).style({fill:"None","stroke-width":b.outlinewidth});var l=({center:.5,right:1}[b.xanchor]||0)*a;at.attr("transform","translate("+(S.l-l)+","+S.t+")"),o.autoMargin(t,e,{x:b.x,y:b.y,l:a*({right:1,center:.5}[b.xanchor]||0),r:a*({left:1,center:.5}[b.xanchor]||0),t:s*({bottom:1,middle:.5}[b.yanchor]||0),b:s*({top:1,middle:.5}[b.yanchor]||0)})}var A=t._fullLayout,S=A._size;if("function"!=typeof b.fillcolor&&"function"!=typeof b.line.color)return void A._infolayer.selectAll("g."+e).remove();var T,z=r.extent(("function"==typeof b.fillcolor?b.fillcolor:b.line.color).domain()),E=[],L=[],I="function"==typeof b.line.color?b.line.color:function(){return b.line.color},D="function"==typeof b.fillcolor?b.fillcolor:function(){return b.fillcolor},P=b.levels.end+b.levels.size/100,C=b.levels.size,O=1.001*z[0]-.001*z[1],F=1.001*z[1]-.001*z[0];for(T=b.levels.start;(T-P)*C<0;T+=C)T>O&&Tz[0]&&T1){var it=Math.pow(10,Math.floor(Math.log(rt)/Math.LN10));et*=it*c.roundUp(rt/it,[2,5,10]),(Math.abs(b.levels.start)/b.levels.size+1e-6)%1<2e-6&&(K.tick0=0)}K.dtick=et}K.domain=[W+Z,W+U-Z],K.setScale();var at=A._infolayer.selectAll("g."+e).data([0]);at.enter().append("g").classed(e,!0).each(function(){var t=r.select(this);t.append("rect").classed("cbbg",!0),t.append("g").classed("cbfills",!0),t.append("g").classed("cblines",!0),t.append("g").classed("cbaxis",!0).classed("crisp",!0),t.append("g").classed("cbtitleunshift",!0).append("g").classed("cbtitle",!0),t.append("rect").classed("cboutline",!0),t.select(".cbtitle").datum(0)}),at.attr("transform","translate("+Math.round(S.l)+","+Math.round(S.t)+")");var ot=at.select(".cbtitleunshift").attr("transform","translate(-"+Math.round(S.l)+",-"+Math.round(S.t)+")");K._axislayer=at.select(".cbaxis");var st=0;if(["top","bottom"].indexOf(b.titleside)!==-1){var lt,ut=S.l+(b.x+G)*S.w,ct=K.titlefont.size;lt="top"===b.titleside?(1-(W+U-Z))*S.h+S.t+3+.75*ct:(1-(W+Z))*S.h+S.t-3-.25*ct,M(K._id+"title",{attributes:{x:ut,y:lt,"text-anchor":"start"}})}var ft=c.syncOrAsync([o.previousPromises,w,o.previousPromises,k],t);if(ft&&ft.then&&(t._promises||[]).push(ft),t._context.editable){var ht,dt,pt;u.init({element:at.node(),prepFn:function(){ht=at.attr("transform"),h(at)},moveFn:function(t,e){at.attr("transform",ht+" translate("+t+","+e+")"),dt=u.align(Y+t/S.w,q,0,1,b.xanchor),pt=u.align(W-e/S.h,U,0,1,b.yanchor);var n=u.getCursor(dt,pt,b.xanchor,b.yanchor);h(at,n)},doneFn:function(e){h(at),e&&void 0!==dt&&void 0!==pt&&a.restyle(t,{"colorbar.x":dt,"colorbar.y":pt},_().index)}})}return ft}function _(){var n,r,i=e.substr(2);for(n=0;n=0?i.Reds:i.Blues,l.colorscale=h,s.reversescale&&(h=a(h)),s.colorscale=h)}},{"../../lib":316,"./flip_scale":234,"./scales":241}],230:[function(t,e,n){"use strict";var r=t("./attributes"),i=t("../../lib/extend").extendDeep;t("./scales.js");e.exports=function(t){return{color:{valType:"color",arrayOk:!0},colorscale:i({},r.colorscale,{}),cauto:i({},r.zauto,{}),cmax:i({},r.zmax,{}),cmin:i({},r.zmin,{}),autocolorscale:i({},r.autocolorscale,{}),reversescale:i({},r.reversescale,{})}}},{"../../lib/extend":312,"./attributes":228,"./scales.js":241}],231:[function(t,e,n){"use strict";var r=t("./scales");e.exports=r.RdBu},{"./scales":241}],232:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),i=t("../../lib"),a=t("../colorbar/has_colorbar"),o=t("../colorbar/defaults"),s=t("./is_valid_scale"),l=t("./flip_scale");e.exports=function(t,e,n,u,c){var f=c.prefix,h=c.cLetter,d=f.slice(0,f.length-1),p=f?i.nestedProperty(t,d).get()||{}:t,m=f?i.nestedProperty(e,d).get()||{}:e,g=p[h+"min"],v=p[h+"max"],y=p.colorscale,x=r(g)&&r(v)&&g=0;i--,a++)e=t[i],r[a]=[1-e[0],e[1]];return r}},{}],235:[function(t,e,n){"use strict";var r=t("./scales"),i=t("./default_scale"),a=t("./is_valid_scale_array");e.exports=function(t,e){function n(){try{t=r[t]||JSON.parse(t)}catch(n){t=e}}return e||(e=i),t?("string"==typeof t&&(n(),"string"==typeof t&&n()),a(t)?t:e):e}},{"./default_scale":231,"./is_valid_scale_array":239,"./scales":241}],236:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),i=t("../../lib"),a=t("./is_valid_scale");e.exports=function(t,e){var n=e?i.nestedProperty(t,e).get()||{}:t,o=n.color,s=!1;if(Array.isArray(o))for(var l=0;l4/3-s?o:s}},{}],243:[function(t,e,n){"use strict";var r=t("../../lib"),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,n,a){return t="left"===n?0:"center"===n?1:"right"===n?2:r.constrain(Math.floor(3*t),0,2),e="bottom"===a?0:"middle"===a?1:"top"===a?2:r.constrain(Math.floor(3*e),0,2),i[e][t]}},{"../../lib":316}],244:[function(t,e,n){"use strict";function r(){var t=document.createElement("div");t.className="dragcover";var e=t.style;return e.position="fixed",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background="none",document.body.appendChild(t),t}function i(t){t._dragging=!1,t._replotPending&&a.plot(t)}var a=t("../../plotly"),o=t("../../lib"),s=t("../../plots/cartesian/constants"),l=e.exports={};l.align=t("./align"),l.getCursor=t("./cursor");var u=t("./unhover");l.unhover=u.wrapped,l.unhoverRaw=u.raw,l.init=function(t){function e(e){return t.element.onmousemove=p,m._dragged=!1,m._dragging=!0,u=e.clientX,c=e.clientY,d=e.target,f=(new Date).getTime(),f-m._mouseDownTimev&&(g=Math.max(g-1,1)),t.doneFn&&t.doneFn(m._dragged,g),!m._dragged){var n=document.createEvent("MouseEvents");n.initEvent("click",!0,!0),d.dispatchEvent(n)}return i(m),m._dragged=!1,o.pauseEvent(e)}var u,c,f,h,d,p,m=o.getPlotDiv(t.element)||{},g=1,v=s.DBLCLICKDELAY;m._mouseDownTime||(m._mouseDownTime=0),p=t.element.onmousemove,t.setCursor&&(t.element.onmousemove=t.setCursor),t.element.onmousedown=e,t.element.style.pointerEvents="all"},l.coverSlip=r},{"../../lib":316,"../../plotly":338,"../../plots/cartesian/constants":348,"./align":242,"./cursor":243,"./unhover":245}],245:[function(t,e,n){"use strict";var r=t("../../lib/events"),i=e.exports={};i.wrapped=function(t,e,n){"string"==typeof t&&(t=document.getElementById(t)),t._hoverTimer&&(clearTimeout(t._hoverTimer),t._hoverTimer=void 0),i.raw(t,e,n)},i.raw=function(t,e){var n=t._fullLayout;e||(e={}),e.target&&r.triggerHandler(t,"plotly_beforehover",e)===!1||(n._hoverlayer.selectAll("g").remove(),e.target&&t._hoverdata&&t.emit("plotly_unhover",{points:t._hoverdata}),t._hoverdata=void 0)}},{"../../lib/events":311}],246:[function(t,e,n){"use strict";function r(t,e,n,r,i,a,o){if(s.traceIs(n,"symbols")){var u=p(n);e.attr("d",function(t){var e;e="various"===t.ms||"various"===a.size?3:d.isBubble(n)?u(t.ms):(a.size||6)/2,t.mrc=e;var r=m.symbolNumber(t.mx||a.symbol)||0,i=r%100;return t.om=r%200>=100,m.symbolFuncs[i](e)+(r>=200?y:"")}).style("opacity",function(t){return(t.mo+1||a.opacity+1)-1})}var c,f,h;t.so?(h=o.outlierwidth,f=o.outliercolor,c=a.outliercolor):(h=(t.mlw+1||o.width+1||(t.trace?t.trace.marker.line.width:0)+1)-1,f="mlc"in t?t.mlcc=i(t.mlc):Array.isArray(o.color)?l.defaultLine:o.color,c="mc"in t?t.mcc=r(t.mc):Array.isArray(a.color)?l.defaultLine:a.color||"rgba(0,0,0,0)"),t.om?e.call(l.stroke,c).style({"stroke-width":(h||1)+"px",fill:"none"}):(e.style("stroke-width",h+"px").call(l.fill,c),h&&e.call(l.stroke,f))}function i(t,e,n,r){var i=t[0]-e[0],o=t[1]-e[1],s=n[0]-e[0],l=n[1]-e[1],u=Math.pow(i*i+o*o,b/2),c=Math.pow(s*s+l*l,b/2),f=(c*c*i-u*u*s)*r,h=(c*c*o-u*u*l)*r,d=3*c*(u+c),p=3*u*(u+c);return[[a.round(e[0]+(d&&f/d),2),a.round(e[1]+(d&&h/d),2)],[a.round(e[0]-(p&&f/p),2),a.round(e[1]-(p&&h/p),2)]]}var a=t("d3"),o=t("fast-isnumeric"),s=t("../../registry"),l=t("../color"),u=t("../colorscale"),c=t("../../lib"),f=t("../../lib/svg_text_utils"),h=t("../../constants/xmlns_namespaces"),d=t("../../traces/scatter/subtypes"),p=t("../../traces/scatter/make_bubble_size_func"),m=e.exports={};m.font=function(t,e,n,r){e&&e.family&&(r=e.color,n=e.size,e=e.family),e&&t.style("font-family",e),n+1&&t.style("font-size",n+"px"),r&&t.call(l.fill,r)},m.setPosition=function(t,e,n){t.attr("x",e).attr("y",n)},m.setSize=function(t,e,n){t.attr("width",e).attr("height",n)},m.setRect=function(t,e,n,r,i){t.call(m.setPosition,e,n).call(m.setSize,r,i)},m.translatePoint=function(t,e,n,r){var i=t.xp||n.c2p(t.x),a=t.yp||r.c2p(t.y);o(i)&&o(a)?"text"===e.node().nodeName?e.attr("x",i).attr("y",a):e.attr("transform","translate("+i+","+a+")"):e.remove()},m.translatePoints=function(t,e,n,r){t.each(function(t){var i=a.select(this);m.translatePoint(t,i,e,n,r)})},m.getPx=function(t,e){return Number(t.style(e).replace(/px$/,""))},m.crispRound=function(t,e,n){return e&&o(e)?t._context.staticPlot?e:e<1?1:Math.round(e):n||0},m.singleLineStyle=function(t,e,n,r,i){e.style("fill","none");var a=(((t||[])[0]||{}).trace||{}).line||{},o=n||a.width||0,s=i||a.dash||"";l.stroke(e,r||a.color),m.dashLine(e,s,o)},m.lineGroupStyle=function(t,e,n,r){t.style("fill","none").each(function(t){var i=(((t||[])[0]||{}).trace||{}).line||{},o=e||i.width||0,s=r||i.dash||"";a.select(this).call(l.stroke,n||i.color).call(m.dashLine,s,o)})},m.dashLine=function(t,e,n){var r=Math.max(n,3);"solid"===e?e="":"dot"===e?e=r+"px,"+r+"px":"dash"===e?e=3*r+"px,"+3*r+"px":"longdash"===e?e=5*r+"px,"+5*r+"px":"dashdot"===e?e=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===e&&(e=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),t.style({"stroke-dasharray":e,"stroke-width":n+"px"})},m.fillGroupStyle=function(t){t.style("stroke-width",0).each(function(e){var n=a.select(this);try{n.call(l.fill,e[0].trace.fillcolor)}catch(e){c.error(e,t),n.remove()}})};var g=t("./symbol_defs");m.symbolNames=[],m.symbolFuncs=[],m.symbolNeedLines={},m.symbolNoDot={},m.symbolList=[],Object.keys(g).forEach(function(t){var e=g[t];m.symbolList=m.symbolList.concat([e.n,t,e.n+100,t+"-open"]),m.symbolNames[e.n]=t,m.symbolFuncs[e.n]=e.f,e.needLine&&(m.symbolNeedLines[e.n]=!0),e.noDot?m.symbolNoDot[e.n]=!0:m.symbolList=m.symbolList.concat([e.n+200,t+"-dot",e.n+300,t+"-open-dot"])});var v=m.symbolNames.length,y="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";m.symbolNumber=function(t){if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),t=m.symbolNames.indexOf(t),t>=0&&(t+=e)}return t%100>=v||t>=400?0:Math.floor(Math.max(t,0))},m.singlePointStyle=function(t,e,n){var i=n.marker,a=i.line,o=m.tryColorscale(i,""),s=m.tryColorscale(i,"line");r(t,e,n,o,s,i,a)},m.pointStyle=function(t,e){if(t.size()){var n=e.marker,r=m.tryColorscale(n,""),i=m.tryColorscale(n,"line");t.each(function(t){m.singlePointStyle(t,a.select(this),e,r,i)})}},m.tryColorscale=function(t,e){var n=e?c.nestedProperty(t,e).get():t,r=n.colorscale,i=n.color;return r&&Array.isArray(i)?u.makeColorScaleFunc(u.extractScale(r,n.cmin,n.cmax)):c.identity};var x={start:1,end:-1,middle:0,bottom:1,top:-1},_=1.3;m.textPointStyle=function(t,e){t.each(function(t){var n=a.select(this),r=t.tx||e.text;if(!r||Array.isArray(r))return void n.remove();var i=t.tp||e.textposition,s=i.indexOf("top")!==-1?"top":i.indexOf("bottom")!==-1?"bottom":"middle",l=i.indexOf("left")!==-1?"end":i.indexOf("right")!==-1?"start":"middle",u=t.ts||e.textfont.size,c=t.mrc?t.mrc/.8+1:0;u=o(u)&&u>0?u:0,n.call(m.font,t.tf||e.textfont.family,u,t.tc||e.textfont.color).attr("text-anchor",l).text(r).call(f.convertToTspans);var h=a.select(this.parentNode),d=n.selectAll("tspan.line"),p=((d[0].length||1)-1)*_+1,g=x[l]*c,v=.75*u+x[s]*c+(x[s]-1)*p*u/2;h.attr("transform","translate("+g+","+v+")"),p>1&&d.attr({x:n.attr("x"),y:n.attr("y")})})};var b=.5;m.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var n,r="M"+t[0],a=[];for(n=1;n=A&&(a.selectAll("[data-bb]").attr("data-bb",null),k=[]),t.setAttribute("data-bb",k.length),k.push(l),c.extendFlat({},l)},m.setClipUrl=function(t,e){if(!e)return void t.attr("clip-path",null);var n="#"+e,r=a.select("base");r.size()&&r.attr("href")&&(n=window.location.href+n),t.attr("clip-path","url("+n+")")}},{"../../constants/xmlns_namespaces":305,"../../lib":316,"../../lib/svg_text_utils":328,"../../registry":382,"../../traces/scatter/make_bubble_size_func":408,"../../traces/scatter/subtypes":413,"../color":223,"../colorscale":237,"./symbol_defs":247,d3:8,"fast-isnumeric":12}],247:[function(t,e,n){"use strict";var r=t("d3");e.exports={circle:{n:0,f:function(t){var e=r.round(t,2);return"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"}},square:{n:1,f:function(t){var e=r.round(t,2);return"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"}},diamond:{n:2,f:function(t){var e=r.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"Z"}},cross:{n:3,f:function(t){var e=r.round(.4*t,2),n=r.round(1.2*t,2);return"M"+n+","+e+"H"+e+"V"+n+"H-"+e+"V"+e+"H-"+n+"V-"+e+"H-"+e+"V-"+n+"H"+e+"V-"+e+"H"+n+"Z"}},x:{n:4,f:function(t){var e=r.round(.8*t/Math.sqrt(2),2),n="l"+e+","+e,i="l"+e+",-"+e,a="l-"+e+",-"+e,o="l-"+e+","+e;return"M0,"+e+n+i+a+i+a+o+a+o+n+o+n+"Z"}},"triangle-up":{n:5,f:function(t){var e=r.round(2*t/Math.sqrt(3),2),n=r.round(t/2,2),i=r.round(t,2);return"M-"+e+","+n+"H"+e+"L0,-"+i+"Z"}},"triangle-down":{n:6,f:function(t){var e=r.round(2*t/Math.sqrt(3),2),n=r.round(t/2,2),i=r.round(t,2);return"M-"+e+",-"+n+"H"+e+"L0,"+i+"Z"}},"triangle-left":{n:7,f:function(t){var e=r.round(2*t/Math.sqrt(3),2),n=r.round(t/2,2),i=r.round(t,2);return"M"+n+",-"+e+"V"+e+"L-"+i+",0Z"}},"triangle-right":{n:8,f:function(t){var e=r.round(2*t/Math.sqrt(3),2),n=r.round(t/2,2),i=r.round(t,2);return"M-"+n+",-"+e+"V"+e+"L"+i+",0Z"}},"triangle-ne":{n:9,f:function(t){var e=r.round(.6*t,2),n=r.round(1.2*t,2);return"M-"+n+",-"+e+"H"+e+"V"+n+"Z"}},"triangle-se":{n:10,f:function(t){var e=r.round(.6*t,2),n=r.round(1.2*t,2);return"M"+e+",-"+n+"V"+e+"H-"+n+"Z"}},"triangle-sw":{n:11,f:function(t){var e=r.round(.6*t,2),n=r.round(1.2*t,2);return"M"+n+","+e+"H-"+e+"V-"+n+"Z"}},"triangle-nw":{n:12,f:function(t){var e=r.round(.6*t,2),n=r.round(1.2*t,2);return"M-"+e+","+n+"V-"+e+"H"+n+"Z"}},pentagon:{n:13,f:function(t){var e=r.round(.951*t,2),n=r.round(.588*t,2),i=r.round(-t,2),a=r.round(t*-.309,2),o=r.round(.809*t,2);return"M"+e+","+a+"L"+n+","+o+"H-"+n+"L-"+e+","+a+"L0,"+i+"Z"}},hexagon:{n:14,f:function(t){var e=r.round(t,2),n=r.round(t/2,2),i=r.round(t*Math.sqrt(3)/2,2);return"M"+i+",-"+n+"V"+n+"L0,"+e+"L-"+i+","+n+"V-"+n+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=r.round(t,2),n=r.round(t/2,2),i=r.round(t*Math.sqrt(3)/2,2);return"M-"+n+","+i+"H"+n+"L"+e+",0L"+n+",-"+i+"H-"+n+"L-"+e+",0Z"}},octagon:{n:16,f:function(t){var e=r.round(.924*t,2),n=r.round(.383*t,2);return"M-"+n+",-"+e+"H"+n+"L"+e+",-"+n+"V"+n+"L"+n+","+e+"H-"+n+"L-"+e+","+n+"V-"+n+"Z"}},star:{n:17,f:function(t){var e=1.4*t,n=r.round(.225*e,2),i=r.round(.951*e,2),a=r.round(.363*e,2),o=r.round(.588*e,2),s=r.round(-e,2),l=r.round(e*-.309,2),u=r.round(.118*e,2),c=r.round(.809*e,2),f=r.round(.382*e,2);return"M"+n+","+l+"H"+i+"L"+a+","+u+"L"+o+","+c+"L0,"+f+"L-"+o+","+c+"L-"+a+","+u+"L-"+i+","+l+"H-"+n+"L0,"+s+"Z"}},hexagram:{n:18,f:function(t){var e=r.round(.66*t,2),n=r.round(.38*t,2),i=r.round(.76*t,2);return"M-"+i+",0l-"+n+",-"+e+"h"+i+"l"+n+",-"+e+"l"+n+","+e+"h"+i+"l-"+n+","+e+"l"+n+","+e+"h-"+i+"l-"+n+","+e+"l-"+n+",-"+e+"h-"+i+"Z"}},"star-triangle-up":{n:19,f:function(t){var e=r.round(t*Math.sqrt(3)*.8,2),n=r.round(.8*t,2),i=r.round(1.6*t,2),a=r.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M-"+e+","+n+o+e+","+n+o+"0,-"+i+o+"-"+e+","+n+"Z"}},"star-triangle-down":{n:20,f:function(t){var e=r.round(t*Math.sqrt(3)*.8,2),n=r.round(.8*t,2),i=r.round(1.6*t,2),a=r.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M"+e+",-"+n+o+"-"+e+",-"+n+o+"0,"+i+o+e+",-"+n+"Z"}},"star-square":{n:21,f:function(t){var e=r.round(1.1*t,2),n=r.round(2*t,2),i="A "+n+","+n+" 0 0 1 ";return"M-"+e+",-"+e+i+"-"+e+","+e+i+e+","+e+i+e+",-"+e+i+"-"+e+",-"+e+"Z"}},"star-diamond":{n:22,f:function(t){var e=r.round(1.4*t,2),n=r.round(1.9*t,2),i="A "+n+","+n+" 0 0 1 ";return"M-"+e+",0"+i+"0,"+e+i+e+",0"+i+"0,-"+e+i+"-"+e+",0Z"}},"diamond-tall":{n:23,f:function(t){var e=r.round(.7*t,2),n=r.round(1.4*t,2);return"M0,"+n+"L"+e+",0L0,-"+n+"L-"+e+",0Z"}},"diamond-wide":{n:24,f:function(t){var e=r.round(1.4*t,2),n=r.round(.7*t,2);return"M0,"+n+"L"+e+",0L0,-"+n+"L-"+e+",0Z"}},hourglass:{n:25,f:function(t){var e=r.round(t,2);return"M"+e+","+e+"H-"+e+"L"+e+",-"+e+"H-"+e+"Z"},noDot:!0},bowtie:{n:26,f:function(t){var e=r.round(t,2);return"M"+e+","+e+"V-"+e+"L-"+e+","+e+"V-"+e+"Z"},noDot:!0},"circle-cross":{n:27,f:function(t){var e=r.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(t){var e=r.round(t,2),n=r.round(t/Math.sqrt(2),2);return"M"+n+","+n+"L-"+n+",-"+n+"M"+n+",-"+n+"L-"+n+","+n+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(t){var e=r.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(t){var e=r.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(t){var e=r.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM0,-"+e+"V"+e+"M-"+e+",0H"+e},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(t){var e=r.round(1.3*t,2),n=r.round(.65*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM-"+n+",-"+n+"L"+n+","+n+"M-"+n+","+n+"L"+n+",-"+n},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(t){var e=r.round(1.4*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e},needLine:!0,noDot:!0},"x-thin":{n:34,f:function(t){var e=r.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0},asterisk:{n:35,f:function(t){var e=r.round(1.2*t,2),n=r.round(.85*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+n+","+n+"L-"+n+",-"+n+"M"+n+",-"+n+"L-"+n+","+n},needLine:!0,noDot:!0},hash:{n:36,f:function(t){var e=r.round(t/2,2),n=r.round(t,2);return"M"+e+","+n+"V-"+n+"m-"+n+",0V"+n+"M"+n+","+e+"H-"+n+"m0,-"+n+"H"+n},needLine:!0},"y-up":{n:37,f:function(t){var e=r.round(1.2*t,2),n=r.round(1.6*t,2),i=r.round(.8*t,2);return"M-"+e+","+i+"L0,0M"+e+","+i+"L0,0M0,-"+n+"L0,0"},needLine:!0,noDot:!0},"y-down":{n:38,f:function(t){var e=r.round(1.2*t,2),n=r.round(1.6*t,2),i=r.round(.8*t,2);return"M-"+e+",-"+i+"L0,0M"+e+",-"+i+"L0,0M0,"+n+"L0,0"},needLine:!0,noDot:!0},"y-left":{n:39,f:function(t){var e=r.round(1.2*t,2),n=r.round(1.6*t,2),i=r.round(.8*t,2);return"M"+i+","+e+"L0,0M"+i+",-"+e+"L0,0M-"+n+",0L0,0"},needLine:!0,noDot:!0},"y-right":{n:40,f:function(t){var e=r.round(1.2*t,2),n=r.round(1.6*t,2),i=r.round(.8*t,2);return"M-"+i+","+e+"L0,0M-"+i+",-"+e+"L0,0M"+n+",0L0,0"},needLine:!0,noDot:!0},"line-ew":{n:41,f:function(t){var e=r.round(1.4*t,2);return"M"+e+",0H-"+e},needLine:!0,noDot:!0},"line-ns":{n:42,f:function(t){var e=r.round(1.4*t,2);return"M0,"+e+"V-"+e},needLine:!0,noDot:!0},"line-ne":{n:43,f:function(t){var e=r.round(t,2);return"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0},"line-nw":{n:44,f:function(t){var e=r.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e},needLine:!0,noDot:!0}}},{d3:8}],248:[function(t,e,n){"use strict";e.exports={visible:{valType:"boolean"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"]},symmetric:{valType:"boolean"},array:{valType:"data_array"},arrayminus:{valType:"data_array"},value:{valType:"number",min:0,dflt:10},valueminus:{valType:"number",min:0,dflt:10},traceref:{valType:"integer",min:0,dflt:0},tracerefminus:{valType:"integer",min:0,dflt:0},copy_ystyle:{valType:"boolean"},copy_zstyle:{valType:"boolean"},color:{valType:"color"},thickness:{valType:"number",min:0,dflt:2},width:{valType:"number",min:0},_deprecated:{opacity:{valType:"number"}}}},{}],249:[function(t,e,n){"use strict";function r(t,e,n,r){var a=e["error_"+r]||{},l=a.visible&&["linear","log"].indexOf(n.type)!==-1,u=[];if(l){for(var c=s(a),f=0;f0;t.each(function(t){var e,f=t[0].trace,h=f.error_x||{},d=f.error_y||{};f.ids&&(e=function(t){return t.id});var p=o.hasMarkers(f)&&f.marker.maxdisplayed>0;if(d.visible||h.visible){var m=i.select(this).selectAll("g.errorbar").data(t,e);m.exit().remove(),m.style("opacity",1);var g=m.enter().append("g").classed("errorbar",!0);c&&g.style("opacity",0).transition().duration(n.duration).style("opacity",1),m.each(function(t){var e=i.select(this),o=r(t,l,u);if(!p||t.vis){var f;if(d.visible&&a(o.x)&&a(o.yh)&&a(o.ys)){var m=d.width;f="M"+(o.x-m)+","+o.yh+"h"+2*m+"m-"+m+",0V"+o.ys,o.noYS||(f+="m-"+m+",0h"+2*m);var g=e.select("path.yerror");s=!g.size(),s?g=e.append("path").classed("yerror",!0):c&&(g=g.transition().duration(n.duration).ease(n.easing)),g.attr("d",f)}if(h.visible&&a(o.y)&&a(o.xh)&&a(o.xs)){var v=(h.copy_ystyle?d:h).width;f="M"+o.xh+","+(o.y-v)+"v"+2*v+"m0,-"+v+"H"+o.xs,o.noXS||(f+="m0,-"+v+"v"+2*v);var y=e.select("path.xerror");s=!y.size(),s?y=e.append("path").classed("xerror",!0):c&&(y=y.transition().duration(n.duration).ease(n.easing)),y.attr("d",f)}}})}})}},{"../../traces/scatter/subtypes":413,d3:8,"fast-isnumeric":12}],254:[function(t,e,n){"use strict";var r=t("d3"),i=t("../color");e.exports=function(t){t.each(function(t){var e=t[0].trace,n=e.error_y||{},a=e.error_x||{},o=r.select(this);o.selectAll("path.yerror").style("stroke-width",n.thickness+"px").call(i.stroke,n.color),a.copy_ystyle&&(a=n),o.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(i.stroke,a.color)})}},{"../color":223,d3:8}],255:[function(t,e,n){"use strict";var r=t("../../plots/cartesian/constants");e.exports={_isLinkedToArray:"image",visible:{valType:"boolean",dflt:!0},source:{valType:"string"},layer:{valType:"enumerated",values:["below","above"],dflt:"above"},sizex:{valType:"number",dflt:0},sizey:{valType:"number",dflt:0},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain"},opacity:{valType:"number",min:0,max:1,dflt:1},x:{valType:"any",dflt:0},y:{valType:"any",dflt:0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top"},xref:{valType:"enumerated",values:["paper",r.idRegex.x.toString()],dflt:"paper"},yref:{valType:"enumerated",values:["paper",r.idRegex.y.toString()],dflt:"paper"}}},{"../../plots/cartesian/constants":348}],256:[function(t,e,n){"use strict";function r(t,e,n){function r(n,r){return i.coerce(t,e,s,n,r)}var o=r("source"),l=r("visible",!!o);if(!l)return e;r("layer"),r("x"),r("y"),r("xanchor"),r("yanchor"),r("sizex"),r("sizey"),r("sizing"),r("opacity");for(var u={_fullLayout:n},c=["x","y"],f=0;f<2;f++)a.coerceRef(t,e,u,c[f],"paper");return e}var i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("../../plots/array_container_defaults"),s=t("./attributes"),l="images";e.exports=function(t,e){var n={name:l,handleItemDefaults:r};o(t,e,n)}},{"../../lib":316,"../../plots/array_container_defaults":340,"../../plots/cartesian/axes":343,"./attributes":255}],257:[function(t,e,n){"use strict";var r=t("d3"),i=t("../drawing"),a=t("../../plots/cartesian/axes"),o=t("../../constants/xmlns_namespaces");e.exports=function(t){function e(e){var n=r.select(this);if(!this.img||this.img.src!==e.source){n.attr("xmlns",o.svg);var i=new Promise(function(t){function r(){n.remove(),t()}var i=new Image;this.img=i,i.setAttribute("crossOrigin","anonymous"),i.onerror=r,i.onload=function(){var t=document.createElement("canvas");t.width=this.width,t.height=this.height;var e=t.getContext("2d");e.drawImage(this,0,0);var r=t.toDataURL("image/png");n.attr("xlink:href",r)},n.on("error",r),n.on("load",t),i.src=e.source}.bind(this));t._promises.push(i)}}function n(e){var n=r.select(this),o=a.getFromId(t,e.xref),l=a.getFromId(t,e.yref),u=s._size,c=o?Math.abs(o.l2p(e.sizex)-o.l2p(0)):e.sizex*u.w,f=l?Math.abs(l.l2p(e.sizey)-l.l2p(0)):e.sizey*u.h,h=c*d.x[e.xanchor].offset,p=f*d.y[e.yanchor].offset,m=d.x[e.xanchor].sizing+d.y[e.yanchor].sizing,g=(o?o.r2p(e.x)+o._offset:e.x*u.w+u.l)+h,v=(l?l.r2p(e.y)+l._offset:u.h-e.y*u.h+u.t)+p;switch(e.sizing){case"fill":m+=" slice";break;case"stretch":m="none"}n.attr({x:g,y:v,width:c,height:f,preserveAspectRatio:m,opacity:e.opacity});var y=o?o._id:"",x=l?l._id:"",_=y+x;_&&n.call(i.setClipUrl,"clip"+s._uid+_)}for(var s=t._fullLayout,l=[],u=[],c=[],f=0;f=2/3},n.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},n.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3},n.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3}},{}],260:[function(t,e,n){"use strict";var r=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat;e.exports={bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.defaultLine},borderwidth:{valType:"number",min:0,dflt:0},font:a({},r,{}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"]},tracegroupgap:{valType:"number",min:0,dflt:10},x:{valType:"number",min:-2,max:3,dflt:1.02},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto"}}},{"../../lib/extend":312,"../../plots/font_attributes":363,"../color/attributes":222}],261:[function(t,e,n){"use strict";e.exports={scrollBarWidth:4,scrollBarHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4}},{}],262:[function(t,e,n){"use strict";var r=t("../../registry"),i=t("../../lib"),a=t("./attributes"),o=t("../../plots/layout_attributes"),s=t("./helpers");e.exports=function(t,e,n){function l(t,e){return i.coerce(d,p,a,t,e)}for(var u,c,f,h,d=t.legend||{},p=e.legend={},m=0,g="normal",v=0;v1);if(x!==!1){if(l("bgcolor",e.paper_bgcolor),l("bordercolor"),l("borderwidth"),i.coerceFont(l,"font",e.font),l("orientation"),"h"===p.orientation){var _=t.xaxis;_&&_.rangeslider&&_.rangeslider.visible?(u=0,f="left",c=1.1,h="bottom"):(u=0,f="left",c=-.1,h="top")}l("traceorder",g),s.isGrouped(e.legend)&&l("tracegroupgap"),l("x",u),l("xanchor",f),l("y",c),l("yanchor",h),i.noneOrAll(d,p,["x","y"]); }}},{"../../lib":316,"../../plots/layout_attributes":365,"../../registry":382,"./attributes":260,"./helpers":265}],263:[function(t,e,n){"use strict";function r(t,e){function n(n){v.convertToTspans(n,function(){n.selectAll("tspan.line").attr({x:n.attr("x")}),t.call(a,e)})}var r=t.data()[0][0],i=e._fullLayout,o=r.trace,s=d.traceIs(o,"pie"),l=o.index,u=s?r.label:o.name,f=t.selectAll("text.legendtext").data([0]);f.enter().append("text").classed("legendtext",!0),f.attr({x:40,y:0,"data-unformatted":u}).style("text-anchor","start").classed("user-select-none",!0).call(m.font,i.legend.font).text(u),e._context.editable&&!s?f.call(v.makeEditable).call(n).on("edit",function(t){this.attr({"data-unformatted":t}),this.text(t).call(n),this.text()||(t=" ");var i,a=r.trace._fullInput||{};if(["ohlc","candlestick"].indexOf(a.type)!==-1){var o=r.trace.transforms,s=o[o.length-1].direction;i=s+".legenditem.name"}else i="name";c.restyle(e,i,t,l)}):f.call(n)}function i(t,e){var n=e._fullLayout.hiddenlabels?e._fullLayout.hiddenlabels.slice():[],r=t.selectAll("rect").data([0]);r.enter().append("rect").classed("legendtoggle",!0).style("cursor","pointer").attr("pointer-events","all").call(g.fill,"rgba(0,0,0,0)"),r.on("click",function(){if(!e._dragged){var r,i,a=t.data()[0][0],o=e._fullData,s=a.trace,l=s.legendgroup,u=[];if(d.traceIs(s,"pie")){var f=a.label,h=n.indexOf(f);h===-1?n.push(f):n.splice(h,1),c.relayout(e,"hiddenlabels",n)}else{if(""===l)u=[s.index];else for(var p=0;ptspan"),h=c[0].length||1;n=s*h,r=u.node()&&m.bBox(u.node()).width;var d=s*(.3+(1-h)/2);u.attr("y",d),c.attr("y",d)}n=Math.max(n,16)+3,i.height=n,i.width=r}function o(t,e,n){var r=t._fullLayout,i=r.legend,a=i.borderwidth,o=b.isGrouped(i);if(b.isVertical(i))o&&e.each(function(t,e){f.setTranslate(this,0,e*i.tracegroupgap)}),i.width=0,i.height=0,n.each(function(t){var e=t[0],n=e.height,r=e.width;f.setTranslate(this,a,5+a+i.height+n/2),i.height+=n,i.width=Math.max(i.width,r)}),i.width+=45+2*a,i.height+=10+2*a,o&&(i.height+=(i._lgroupsLength-1)*i.tracegroupgap),i.width=Math.ceil(i.width),i.height=Math.ceil(i.height),n.each(function(e){var n=e[0],r=u.select(this).select(".legendtoggle");r.call(m.setRect,0,-n.height/2,(t._context.editable?0:i.width)+40,n.height)});else if(o){i.width=0,i.height=0;for(var s=[i.width],l=e.data(),c=0,h=l.length;cr.width-(r.margin.r+r.margin.l)&&(x=0,g+=v,i.height=i.height+v,v=0),f.setTranslate(this,a+x,5+a+e.height/2+g),i.width+=o+n,i.height=Math.max(i.height,e.height),x+=o+n,v=Math.max(e.height,v)}),i.width+=2*a,i.height+=10+2*a,i.width=Math.ceil(i.width),i.height=Math.ceil(i.height),n.each(function(e){var n=e[0],r=u.select(this).select(".legendtoggle");r.call(m.setRect,0,-n.height/2,t._context.editable?0:i.width,n.height)})}}function s(t){var e=t._fullLayout,n=e.legend,r="left";w.isRightAnchor(n)?r="right":w.isCenterAnchor(n)&&(r="center");var i="top";w.isBottomAnchor(n)?i="bottom":w.isMiddleAnchor(n)&&(i="middle"),h.autoMargin(t,"legend",{x:n.x,y:n.y,l:n.width*({right:1,center:.5}[r]||0),r:n.width*({left:1,center:.5}[r]||0),b:n.height*({top:1,middle:.5}[i]||0),t:n.height*({bottom:1,middle:.5}[i]||0)})}function l(t){var e=t._fullLayout,n=e.legend,r="left";w.isRightAnchor(n)?r="right":w.isCenterAnchor(n)&&(r="center"),h.autoMargin(t,"legend",{x:n.x,y:.5,l:n.width*({right:1,center:.5}[r]||0),r:n.width*({left:1,center:.5}[r]||0),b:0,t:0})}var u=t("d3"),c=t("../../plotly"),f=t("../../lib"),h=t("../../plots/plots"),d=t("../../registry"),p=t("../dragelement"),m=t("../drawing"),g=t("../color"),v=t("../../lib/svg_text_utils"),y=t("./constants"),x=t("./get_legend_data"),_=t("./style"),b=t("./helpers"),w=t("./anchor_utils");e.exports=function(t){function e(t,e){T.attr("data-scroll",e).call(f.setTranslate,0,e),z.call(m.setRect,N,t,y.scrollBarWidth,y.scrollBarHeight),A.select("rect").attr({y:v.borderwidth-e})}var n=t._fullLayout,a="legend"+n._uid;if(n._infolayer&&t.calcdata){var v=n.legend,b=n.showlegend&&x(t.calcdata,v),M=n.hiddenlabels||[];if(!n.showlegend||!b.length)return n._infolayer.selectAll(".legend").remove(),n._topdefs.select("#"+a).remove(),void h.autoMargin(t,"legend");var k=n._infolayer.selectAll("g.legend").data([0]);k.enter().append("g").attr({class:"legend","pointer-events":"all"});var A=n._topdefs.selectAll("#"+a).data([0]);A.enter().append("clipPath").attr("id",a).append("rect");var S=k.selectAll("rect.bg").data([0]);S.enter().append("rect").attr({class:"bg","shape-rendering":"crispEdges"}),S.call(g.stroke,v.bordercolor),S.call(g.fill,v.bgcolor),S.style("stroke-width",v.borderwidth+"px");var T=k.selectAll("g.scrollbox").data([0]);T.enter().append("g").attr("class","scrollbox");var z=k.selectAll("rect.scrollbar").data([0]);z.enter().append("rect").attr({class:"scrollbar",rx:20,ry:2,width:0,height:0}).call(g.fill,"#808BA4");var E=T.selectAll("g.groups").data(b);E.enter().append("g").attr("class","groups"),E.exit().remove();var L=E.selectAll("g.traces").data(f.identity);L.enter().append("g").attr("class","traces"),L.exit().remove(),L.call(_).style("opacity",function(t){var e=t[0].trace;return d.traceIs(e,"pie")?M.indexOf(t[0].label)!==-1?.5:1:"legendonly"===e.visible?.5:1}).each(function(){u.select(this).call(r,t).call(i,t)});var I=0!==k.enter().size();I&&(o(t,E,L),s(t));var D=0,P=n.width,C=0,O=n.height;o(t,E,L),v.height>O?l(t):s(t);var F=n._size,R=F.l+F.w*v.x,j=F.t+F.h*(1-v.y);w.isRightAnchor(v)?R-=v.width:w.isCenterAnchor(v)&&(R-=v.width/2),w.isBottomAnchor(v)?j-=v.height:w.isMiddleAnchor(v)&&(j-=v.height/2);var N=v.width,B=F.w;N>B?(R=F.l,N=B):(R+N>P&&(R=P-N),RV?(j=F.t,q=V):(j+q>O&&(j=O-q),jn[1])return n[1]}return i}function n(t){return t[0]}var r,i,a=t[0],o=a.trace,s=d.hasMarkers(o),u=d.hasText(o),h=d.hasLines(o);if(s||u||h){var p={},m={};s&&(p.mc=e("marker.color",n),p.mo=e("marker.opacity",c.mean,[.2,1]),p.ms=e("marker.size",c.mean,[2,16]),p.mlc=e("marker.line.color",n),p.mlw=e("marker.line.width",c.mean,[0,5]),m.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),h&&(m.line={width:e("line.width",n,[0,10])}),u&&(p.tx="Aa",p.tp=e("textposition",n),p.ts=10,p.tc=e("textfont.color",n),p.tf=e("textfont.family",n)),r=[c.minExtend(a,p)],i=c.minExtend(o,m)}var g=l.select(this).select("g.legendpoints"),v=g.selectAll("path.scatterpts").data(s?r:[]);v.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),v.exit().remove(),v.call(f.pointStyle,i),s&&(r[0].mrc=3);var y=g.selectAll("g.pointtext").data(u?r:[]);y.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),y.exit().remove(),y.selectAll("text").call(f.textPointStyle,i)}function a(t){var e=t[0].trace,n=e.marker||{},r=n.line||{},i=l.select(this).select("g.legendpoints").selectAll("path.legendbar").data(u.traceIs(e,"bar")?[t]:[]);i.enter().append("path").classed("legendbar",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),i.exit().remove(),i.each(function(t){var e=(t.mlw+1||r.width+1)-1,i=l.select(this);i.style("stroke-width",e+"px").call(h.fill,t.mc||n.color),e&&i.call(h.stroke,t.mlc||r.color)})}function o(t){var e=t[0].trace,n=l.select(this).select("g.legendpoints").selectAll("path.legendbox").data(u.traceIs(e,"box")&&e.visible?[t]:[]);n.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),n.exit().remove(),n.each(function(t){var n=(t.lw+1||e.line.width+1)-1,r=l.select(this);r.style("stroke-width",n+"px").call(h.fill,t.fc||e.fillcolor),n&&r.call(h.stroke,t.lc||e.line.color)})}function s(t){var e=t[0].trace,n=l.select(this).select("g.legendpoints").selectAll("path.legendpie").data(u.traceIs(e,"pie")&&e.visible?[t]:[]);n.enter().append("path").classed("legendpie",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),n.exit().remove(),n.size()&&n.call(p,t[0],e)}var l=t("d3"),u=t("../../registry"),c=t("../../lib"),f=t("../drawing"),h=t("../color"),d=t("../../traces/scatter/subtypes"),p=t("../../traces/pie/style_one");e.exports=function(t){t.each(function(t){var e=l.select(this),n=e.selectAll("g.legendfill").data([t]);n.enter().append("g").classed("legendfill",!0);var r=e.selectAll("g.legendlines").data([t]);r.enter().append("g").classed("legendlines",!0);var i=e.selectAll("g.legendsymbols").data([t]);i.enter().append("g").classed("legendsymbols",!0),i.style("opacity",t[0].trace.opacity),i.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)}).each(a).each(o).each(s).each(r).each(i)}},{"../../lib":316,"../../registry":382,"../../traces/pie/style_one":391,"../../traces/scatter/subtypes":413,"../color":223,"../drawing":246,d3:8}],268:[function(t,e,n){"use strict";function r(t,e){var n=e.currentTarget,r=n.getAttribute("data-attr"),i=n.getAttribute("data-val")||!0,a=t._fullLayout,o={};if("zoom"===r){for(var s,l,c="in"===i?.5:2,h=(1+c)/2,d=(1-c)/2,p=f.list(t,null,!0),m=0;m1)return r(["resetViews","toggleHover"]),o(g,n);c&&(r(["zoom3d","pan3d","orbitRotation","tableRotation"]),r(["resetCameraDefault3d","resetCameraLastSave3d"]),r(["hoverClosest3d"])),h&&(r(["zoomInGeo","zoomOutGeo","resetGeo"]),r(["hoverClosestGeo"]));var v=i(s),y=[];return((u||p)&&!v||m)&&(y=["zoom2d","pan2d"]),(u||m)&&a(l)&&(y.push("select2d"),y.push("lasso2d")),y.length&&r(y),!u&&!p||v||m||r(["zoomIn2d","zoomOut2d","autoScale2d","resetScale2d"]),u&&d?r(["toggleHover"]):p?r(["hoverClosestGl2d"]):u?r(["hoverClosestCartesian","hoverCompareCartesian"]):d&&r(["hoverClosestPie"]),o(g,n)}function i(t){for(var e=l.list({_fullLayout:t},null,!0),n=!0,r=0;r0);if(p){var m=i(e,n,l);c("x",m[0]),c("y",m[1]),a.noneOrAll(t,e,["x","y"]),c("xanchor"),c("yanchor"),a.coerceFont(c,"font",n.font);var g=c("bgcolor");c("activecolor",o.contrast(g,u.lightAmount,u.darkAmount)),c("bordercolor"),c("borderwidth")}}},{"../../lib":316,"../color":223,"./attributes":272,"./button_attributes":273,"./constants":274}],276:[function(t,e,n){"use strict";function r(t){for(var e=v.list(t,"x",!0),n=[],r=0;rp&&(p=h)));return p>=d?[d,p]:void 0}}var i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("./constants"),s=t("./helpers");e.exports=function(t){var e=t._fullLayout,n=i.filterVisible(e.shapes);if(n.length&&t._fullData.length)for(var s=0;se;a--)h(t,a).selectAll('[data-index="'+(a-1)+'"]').attr("data-index",a),i(t,a)}function c(t,e,n,r){function i(n){var r={"data-index":e,"fill-rule":"evenodd",d:p(t,E)},i=E.line.width?E.line.color:"rgba(0,0,0,0)",a=n.append("path").attr(r).style("opacity",E.opacity).call(b.stroke,i).call(b.fill,E.fillcolor).call(w.dashLine,E.line.dash,E.line.width);L&&a.call(w.setClipUrl,"clip"+t._fullLayout._uid+L),t._context.editable&&f(t,a,E,e)}var a,o;h(t,e).selectAll('[data-index="'+e+'"]').remove();var s=t.layout.shapes[e];if(s){var l={};"string"==typeof n&&n?l[n]=r:x.isPlainObject(n)&&(l=n);var u=Object.keys(l);for(a=0;aZ&&r>X&&!t.shiftKey?M.getCursor(i/n,1-a/r):"move";k(e,o),H=o.split("-")[0]}function a(e){N=_.getFromId(t,n.xref),B=_.getFromId(t,n.yref),q=S.getDataToPixel(t,N),V=S.getDataToPixel(t,B,!0),U=S.getPixelToData(t,N),G=S.getPixelToData(t,B,!0);var a="shapes["+r+"]";"path"===n.type?(R=n.path,j=a+".path"):(c=q(n.x0),f=V(n.y0),h=q(n.x1),d=V(n.y1),m=a+".x0",v=a+".y0",x=a+".x1",b=a+".y1"),cX&&(u[E]=n[P]=G(s),u[L]=n[C]=G(l)),f-c>Z&&(u[I]=n[O]=U(c),u[D]=n[F]=U(f))}e.attr("d",p(t,n))}var u,c,f,h,d,m,v,x,b,w,A,T,z,E,L,I,D,P,C,O,F,R,j,N,B,q,V,U,G,H,Z=10,X=10,Y={setCursor:i,element:e.node(),prepFn:a,doneFn:o},W=Y.element.getBoundingClientRect();M.init(Y)}function h(t,e){var n=t._fullLayout.shapes[e],r=t._fullLayout._shapeUpperLayer;return n?"below"===n.layer&&(r="paper"===n.xref&&"paper"===n.yref?t._fullLayout._shapeLowerLayer:t._fullLayout._shapeSubplotLayer):x.log("getShapeLayer: undefined shape: index",e),r}function d(t,e,n){var r=_.getFromId(t,n.id,"x")._id,i=_.getFromId(t,n.id,"y")._id,a="below"===e.layer,o=r===e.xref||i===e.yref,s=!!n.shapelayer;return a&&o&&s}function p(t,e){var n,r,i,a,o=e.type,s=_.getFromId(t,e.xref),l=_.getFromId(t,e.yref),u=t._fullLayout._size;if(s?(n=S.shapePositionToRange(s),r=function(t){return s._offset+s.r2p(n(t,!0))}):r=function(t){return u.l+u.w*t},l?(i=S.shapePositionToRange(l),a=function(t){return l._offset+l.r2p(i(t,!0))}):a=function(t){return u.t+u.h*(1-t)},"path"===o)return s&&"date"===s.type&&(r=S.decodeDate(r)),l&&"date"===l.type&&(a=S.decodeDate(a)),m(e.path,r,a);var c=r(e.x0),f=r(e.x1),h=a(e.y0),d=a(e.y1);if("line"===o)return"M"+c+","+h+"L"+f+","+d;if("rect"===o)return"M"+c+","+h+"H"+f+"V"+d+"H"+c+"Z";var p=(c+f)/2,g=(h+d)/2,v=Math.abs(p-c),y=Math.abs(g-h),x="A"+v+","+y,b=p+v+","+g,w=p+","+(g-y);return"M"+b+x+" 0 1,1 "+w+x+" 0 0,1 "+b+"Z"}function m(t,e,n){return t.replace(A.segmentRE,function(t){var r=0,i=t.charAt(0),a=A.paramIsX[i],o=A.paramIsY[i],s=A.numParams[i],l=t.substr(1).replace(A.paramRE,function(t){return a[r]?t=e(t):o[r]&&(t=n(t)),r++,r>s&&(t="X"),t});return r>s&&(l=l.replace(/[\s,]*X.*/,""),x.log("Ignoring extra params in segment "+t)),i+l})}function g(t,e,n){return t.replace(A.segmentRE,function(t){var r=0,i=t.charAt(0),a=A.paramIsX[i],o=A.paramIsY[i],s=A.numParams[i],l=t.substr(1).replace(A.paramRE,function(t){return r>=s?t:(a[r]?t=e(t):o[r]&&(t=n(t)),r++,t)});return i+l})}var v=t("fast-isnumeric"),y=t("../../plotly"),x=t("../../lib"),_=t("../../plots/cartesian/axes"),b=t("../color"),w=t("../drawing"),M=t("../dragelement"),k=t("../../lib/setcursor"),A=t("./constants"),S=t("./helpers"),T=t("./shape_defaults"),z=t("./defaults");e.exports={draw:r,drawOne:i}},{"../../lib":316,"../../lib/setcursor":326,"../../plotly":338,"../../plots/cartesian/axes":343,"../color":223,"../dragelement":244,"../drawing":246,"./constants":286,"./defaults":287,"./helpers":289,"./shape_defaults":291,"fast-isnumeric":12}],289:[function(t,e,n){"use strict";n.rangeToShapePosition=function(t){return"log"===t.type?t.r2d:function(t){return t}},n.shapePositionToRange=function(t){return"log"===t.type?t.d2r:function(t){return t}},n.decodeDate=function(t){return function(e){return e.replace&&(e=e.replace("_"," ")),t(e)}},n.encodeDate=function(t){return function(e){return t(e).replace(" ","_")}},n.getDataToPixel=function(t,e,r){var i,a=t._fullLayout._size;if(e){var o=n.shapePositionToRange(e);i=function(t){return e._offset+e.r2p(o(t,!0))},"date"===e.type&&(i=n.decodeDate(i))}else i=r?function(t){return a.t+a.h*(1-t)}:function(t){return a.l+a.w*t};return i},n.getPixelToData=function(t,e,r){var i,a=t._fullLayout._size;if(e){var o=n.rangeToShapePosition(e);i=function(t){return o(e.p2r(t-e._offset))}}else i=r?function(t){return 1-(t-a.t)/a.h}:function(t){return(t-a.l)/a.w};return i}},{}],290:[function(t,e,n){"use strict";var r=t("./draw");e.exports={moduleType:"component",name:"shapes",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),calcAutorange:t("./calc_autorange"),draw:r.draw,drawOne:r.drawOne}},{"./attributes":284,"./calc_autorange":285,"./defaults":287,"./draw":288}],291:[function(t,e,n){"use strict";var r=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./attributes"),o=t("./helpers");e.exports=function(t,e,n,s,l){function u(n,i){return r.coerce(t,e,a,n,i)}s=s||{},l=l||{};var c=u("visible",!l.itemIsNotPlainObject);if(!c)return e;u("layer"),u("opacity"),u("fillcolor"),u("line.color"),u("line.width"),u("line.dash");for(var f=t.path?"path":"rect",h=u("type",f),d=["x","y"],p=0;p<2;p++){var m=d[p],g={_fullLayout:n},v=i.coerceRef(t,e,g,m,"","paper");if("path"!==h){var y,x,_,b=.25,w=.75;"paper"!==v?(y=i.getFromId(g,v),_=o.rangeToShapePosition(y),x=o.shapePositionToRange(y)):x=_=r.identity;var M=m+"0",k=m+"1",A=t[M],S=t[k];t[M]=x(t[M],!0),t[k]=x(t[k],!0),i.coercePosition(e,g,u,v,M,b),i.coercePosition(e,g,u,v,k,w),e[M]=_(e[M]),e[k]=_(e[k]),t[M]=A,t[k]=S}}return"path"===h?u("path"):r.noneOrAll(t,e,["x0","x1","y0","y1"]),e}},{"../../lib":316,"../../plots/cartesian/axes":343,"./attributes":284,"./helpers":289}],292:[function(t,e,n){"use strict";var r=t("../../plots/font_attributes"),i=t("../../plots/pad_attributes"),a=t("../../lib/extend").extendFlat,o=t("../../lib/extend").extendDeep,s=t("../../plots/animation_attributes"),l=t("./constants"),u={_isLinkedToArray:"step",method:{valType:"enumerated",values:["restyle","relayout","animate","update"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"}};e.exports={_isLinkedToArray:"slider",visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:u,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:o({},i,{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:s.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:a({},r,{})},font:a({},r,{}),activebgcolor:{valType:"color",dflt:l.gripBgActiveColor},bgcolor:{valType:"color",dflt:l.railBgColor},bordercolor:{valType:"color",dflt:l.railBorderColor},borderwidth:{valType:"number",min:0,dflt:l.railBorderWidth},ticklen:{valType:"number",min:0,dflt:l.tickLength},tickcolor:{valType:"color",dflt:l.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:l.minorTickLength}}},{"../../lib/extend":312,"../../plots/animation_attributes":339,"../../plots/font_attributes":363,"../../plots/pad_attributes":373,"./constants":293}],293:[function(t,e,n){"use strict";e.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,fontSizeToHeight:1.3,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},{}],294:[function(t,e,n){"use strict";function r(t,e,n){function r(n,r){return a.coerce(t,e,s,n,r)}var o=i(t,e),l=r("visible",o.length>0);if(l){r("active"),r("x"),r("y"),a.noneOrAll(t,e,["x","y"]),r("xanchor"),r("yanchor"),r("len"),r("lenmode"),r("pad.t"),r("pad.r"),r("pad.b"),r("pad.l"),a.coerceFont(r,"font",n.font);var u=r("currentvalue.visible");u&&(r("currentvalue.xanchor"),r("currentvalue.prefix"),r("currentvalue.suffix"),r("currentvalue.offset"),a.coerceFont(r,"currentvalue.font",e.font)),r("transition.duration"),r("transition.easing"),r("bgcolor"),r("activebgcolor"),r("bordercolor"),r("borderwidth"),r("ticklen"),r("tickwidth"),r("tickcolor"),r("minorticklen")}}function i(t,e){function n(t,e){return a.coerce(r,i,c,t,e)}for(var r,i,o=t.steps||[],s=e.steps=[],l=0;l0&&(o=o.transition().duration(e.transition.duration).ease(e.transition.easing)),o.attr("transform","translate("+(a-.5*E.gripWidth)+","+e.currentValueTotalHeight+")")}}function v(t,e){return t.inputAreaStart+E.stepInset+(t.inputAreaLength-2*E.stepInset)*Math.min(1,Math.max(0,e))}function y(t,e){return Math.min(1,Math.max(0,(e-E.stepInset-t.inputAreaStart)/(t.inputAreaLength-2*E.stepInset-2*t.inputAreaStart)))}function x(t,e,n){var r=t.selectAll("rect."+E.railTouchRectClass).data([0]);r.enter().append("rect").classed(E.railTouchRectClass,!0).call(d,e,t,n).style("pointer-events","all"),r.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,E.tickOffset+n.ticklen+n.labelHeight)}).call(A.fill,n.bgcolor).attr("opacity",0),k.setTranslate(r,0,n.currentValueTotalHeight)}function _(t,e){var n=t.selectAll("rect."+E.railRectClass).data([0]);n.enter().append("rect").classed(E.railRectClass,!0);var r=e.inputAreaLength-2*E.railInset;n.attr({width:r,height:E.railWidth,rx:E.railRadius,ry:E.railRadius,"shape-rendering":"crispEdges"}).call(A.stroke,e.bordercolor).call(A.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),k.setTranslate(n,E.railInset,.5*(e.inputAreaWidth-E.railWidth)+e.currentValueTotalHeight)}function b(t){for(var e=t._fullLayout._pushmargin||{},n=Object.keys(e),r=0;r0?[0]:[]);if(s.enter().append("g").classed(E.containerClassName,!0).style("cursor","ew-resize"),s.exit().remove(),s.exit().size()&&b(t),0!==n.length){var l=s.selectAll("g."+E.groupClassName).data(n,i);l.enter().append("g").classed(E.groupClassName,!0),l.exit().each(function(e){w.select(this).remove(),e._commandObserver.remove(),delete e._commandObserver,M.autoMargin(t,E.autoMarginIdRoot+e._index)});for(var u=0;u0||h<0){var d={left:[-n,0],right:[n,0],top:[0,-n],bottom:[0,n]}[x.side];e.attr("transform","translate("+d+")")}}}function p(){T=0,z=!0,E=I,M._infolayer.select("."+e).attr({"data-unformatted":E}).text(E).on("mouseover.opacity",function(){r.select(this).transition().duration(100).style("opacity",1)}).on("mouseout.opacity",function(){r.select(this).transition().duration(1e3).style("opacity",0)})}var m=n.propContainer,g=n.propName,v=n.traceIndex,y=n.dfltName,x=n.avoid||{},_=n.attributes,b=n.transform,w=n.containerGroup,M=t._fullLayout,k=m.titlefont.family,A=m.titlefont.size,S=m.titlefont.color,T=1,z=!1,E=m.title.trim();""===E&&(T=0),E.match(/Click to enter .+ title/)&&(T=.2,z=!0),w||(w=M._infolayer.selectAll(".g-"+e).data([0]),w.enter().append("g").classed("g-"+e,!0));var L=w.selectAll("text").data([0]);L.enter().append("text"),L.text(E).attr("class",e),L.attr({"data-unformatted":E}).call(f);var I="Click to enter "+y+" title";t._context.editable?(E||p(),L.call(c.makeEditable).on("edit",function(e){void 0!==v?a.restyle(t,g,e,v):a.relayout(t,g,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(f)}).on("input",function(t){this.text(t||" ").attr(_).selectAll("tspan.line").attr(_)})):E&&!E.match(/Click to enter .+ title/)||L.remove(),L.classed("js-placeholder",z)}},{"../../lib":316,"../../lib/svg_text_utils":328,"../../plotly":338,"../../plots/plots":374,"../color":223,"../drawing":246,d3:8,"fast-isnumeric":12}],298:[function(t,e,n){"use strict";var r=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plots/pad_attributes"),s={_isLinkedToArray:"button",method:{valType:"enumerated",values:["restyle","relayout","animate","update"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""}};e.exports={_isLinkedToArray:"updatemenu",visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:s,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:a({},o,{}),font:a({},r,{}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1}}},{"../../lib/extend":312,"../../plots/font_attributes":363,"../../plots/pad_attributes":373,"../color/attributes":222}],299:[function(t,e,n){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,fontSizeToHeight:1.3,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF"}},{}],300:[function(t,e,n){"use strict";function r(t,e,n){function r(n,r){return a.coerce(t,e,s,n,r)}var o=i(t,e),l=r("visible",o.length>0);l&&(r("active"),r("direction"),r("type"),r("showactive"),r("x"),r("y"),a.noneOrAll(t,e,["x","y"]),r("xanchor"),r("yanchor"),r("pad.t"),r("pad.r"),r("pad.b"),r("pad.l"),a.coerceFont(r,"font",n.font),r("bgcolor",n.paper_bgcolor),r("bordercolor"),r("borderwidth"))}function i(t,e){function n(t,e){return a.coerce(r,i,c,t,e)}for(var r,i,o=t.buttons||[],s=e.buttons=[],l=0;l0?[0]:[]);if(u.enter().append("g").classed(S.containerClassName,!0).style("cursor","pointer"),u.exit().remove(),u.exit().size()&&y(t),0!==n.length){var c=u.selectAll("g."+S.headerGroupClassName).data(n,i);c.enter().append("g").classed(S.headerGroupClassName,!0);var f=u.selectAll("g."+S.dropdownButtonGroupClassName).data([0]);f.enter().append("g").classed(S.dropdownButtonGroupClassName,!0).style("pointer-events","all"),c.enter().size()&&f.call(v).attr(S.menuIndexAttrName,"-1"),c.exit().each(function(e){x.select(this).remove(),f.call(v).attr(S.menuIndexAttrName,"-1"),_.autoMargin(t,S.autoMarginIdRoot+e._index)});for(var h=0;h",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},unicodeToEntity:{"&":"amp","<":"lt",">":"gt",'"':"quot","'":"#x27","/":"#x2F"}}},{}],305:[function(t,e,n){"use strict";n.xmlns="http://www.w3.org/2000/xmlns/",n.svg="http://www.w3.org/2000/svg",n.xlink="http://www.w3.org/1999/xlink",n.svgAttrs={xmlns:n.svg,"xmlns:xlink":n.xlink}},{}],306:[function(t,e,n){"use strict";var r=t("./plotly");n.version="1.20.5",t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config"),n.plot=r.plot,n.newPlot=r.newPlot,n.restyle=r.restyle,n.relayout=r.relayout,n.redraw=r.redraw,n.update=r.update,n.extendTraces=r.extendTraces,n.prependTraces=r.prependTraces,n.addTraces=r.addTraces,n.deleteTraces=r.deleteTraces,n.moveTraces=r.moveTraces,n.purge=r.purge,n.setPlotConfig=t("./plot_api/set_plot_config"),n.register=t("./plot_api/register"),n.toImage=t("./plot_api/to_image"),n.downloadImage=t("./snapshot/download"),n.validate=t("./plot_api/validate"),n.addFrames=r.addFrames,n.deleteFrames=r.deleteFrames,n.animate=r.animate,n.register(t("./traces/scatter")),n.register([t("./components/legend"),t("./components/annotations"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector")]),n.Icons=t("../build/ploticon"),n.Plots=r.Plots,n.Fx=r.Fx,n.Snapshot=t("./snapshot"),n.PlotSchema=t("./plot_api/plot_schema"),n.Queue=t("./lib/queue"),n.d3=t("d3")},{"../build/plotcss":1,"../build/ploticon":2,"./components/annotations":221,"./components/images":258,"./components/legend":266,"./components/rangeselector":278,"./components/rangeslider":283,"./components/shapes":290,"./components/sliders":296,"./components/updatemenus":302,"./fonts/mathjax_config":307,"./lib/queue":324,"./plot_api/plot_schema":332,"./plot_api/register":333,"./plot_api/set_plot_config":334,"./plot_api/to_image":336,"./plot_api/validate":337,"./plotly":338,"./snapshot":387,"./snapshot/download":384,"./traces/scatter":403,d3:8,"es6-promise":10}],307:[function(t,e,n){"use strict";"undefined"!=typeof MathJax?(n.MathJax=!0,MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()):n.MathJax=!1},{}],308:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),i=t("../constants/numerical").BADNUM,a=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(a,"")),r(t)?Number(t):i}},{"../constants/numerical":303,"fast-isnumeric":12}],309:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),i=t("tinycolor2"),a=t("../components/colorscale/get_scale"),o=(Object.keys(t("../components/colorscale/scales")),t("./nested_property")),s=/^([2-9]|[1-9][0-9]+)$/;n.valObjects={data_array:{coerceFunction:function(t,e,n){Array.isArray(t)?e.set(t):void 0!==n&&e.set(n)}},enumerated:{coerceFunction:function(t,e,n,r){r.coerceNumber&&(t=+t),r.values.indexOf(t)===-1?e.set(n):e.set(t)}},boolean:{coerceFunction:function(t,e,n){t===!0||t===!1?e.set(t):e.set(n)}},number:{coerceFunction:function(t,e,n,i){!r(t)||void 0!==i.min&&ti.max?e.set(n):e.set(+t)}},integer:{coerceFunction:function(t,e,n,i){t%1||!r(t)||void 0!==i.min&&ti.max?e.set(n):e.set(+t)}},string:{coerceFunction:function(t,e,n,r){if("string"!=typeof t){var i="number"==typeof t;r.strict!==!0&&i?e.set(String(t)):e.set(n)}else r.noBlank&&!t?e.set(n):e.set(t)}},color:{coerceFunction:function(t,e,n){i(t).isValid()?e.set(t):e.set(n)}},colorscale:{coerceFunction:function(t,e,n){e.set(a(t,n))}},angle:{coerceFunction:function(t,e,n){"auto"===t?e.set("auto"):r(t)?(Math.abs(t)>180&&(t-=360*Math.round(t/360)),e.set(+t)):e.set(n)}},subplotid:{coerceFunction:function(t,e,n){var r=n.length;return"string"==typeof t&&t.substr(0,r)===n&&s.test(t.substr(r))?void e.set(t):void e.set(n)},validateFunction:function(t,e){var n=e.dflt,r=n.length;return t===n||"string"==typeof t&&!(t.substr(0,r)!==n||!s.test(t.substr(r)))}},flaglist:{coerceFunction:function(t,e,n,r){if("string"!=typeof t)return void e.set(n);if((r.extras||[]).indexOf(t)!==-1)return void e.set(t);for(var i=t.split("+"),a=0;a=d&&t<=p?t:l;if("string"!=typeof t&&"number"!=typeof t)return l;var e,r,i,o,s=String(t).trim().split(" ");if(s.length>2)return l;var u=s[0].split("-"),c=!0;""===u[0]&&(c=!1,u.splice(0,1));var m=u.length;if(m>3||3!==m&&s[1]||!m)return l;if(4===u[0].length)e=Number(u[0]);else{if(2!==u[0].length)return l;if(!c)return l;var g=(new Date).getFullYear();e=((Number(u[0])-g+70)%100+200)%100+g-70}if(!a(e))return l;var v=new Date(0,0,1);if(v.setFullYear(c?e:-e),u.length>1){if(r=Number(u[1])-1,u[1].length>2||!(r>=0&&r<=11))return l;if(v.setMonth(r),u.length>2){if(i=Number(u[2]),u[2].length>2||!(i>=1&&i<=31))return l;if(v.setDate(i),v.getDate()!==i)return l;if(s[1]){if(u=s[1].split(":"),u.length>3)return l;if(o=Number(u[0]),u[0].length>2||!u[0].length||!(o>=0&&o<=23))return l;if(v.setHours(o),v.getHours()!==o)return l;if(u.length>1)return i=v.getTime(),r=Number(u[1]),2===u[1].length&&r>=0&&r<=59?(i+=f*r,2===u.length?i:2!==u[2].split(".")[0].length?l:(t=Number(u[2]),t>=0&&t<60?i+t*h:l)):l}}}return v.getTime()},d=n.MIN_MS=n.dateTime2ms("-9999"),p=n.MAX_MS=n.dateTime2ms("9999-12-31 23:59:59.9999"),n.isDateTime=function(t){return n.dateTime2ms(t)!==l};var m=90*u,g=3*c,v=5*f;n.ms2DateTime=function(t,e){if("number"!=typeof t||!(t>=d&&t<=p))return l;e||(e=0);var n=new Date(Math.floor(t)),a=i.time.format("%Y-%m-%d")(n),o=e0&&(r.push(i),i=[])}return r.push(i),r},n.makeLine=function(t,e){var n={};return n=1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t},e&&(n.trace=e),n},n.makePolygon=function(t,e){var n={};if(1===t.length)n={type:"Polygon",coordinates:t};else{for(var r=new Array(t.length),i=0;in?Math.max(n,Math.min(e,t)):Math.max(e,Math.min(n,t))},i.bBoxIntersect=function(t,e,n){return n=n||0,t.left<=e.right+n&&e.left<=t.right+n&&t.top<=e.bottom+n&&e.top<=t.bottom+n},i.identity=function(t){return t},i.noop=function(){},i.randstr=function t(e,n,r){if(r||(r=16),void 0===n&&(n=24),n<=0)return"0";var i,a,o,s=Math.log(Math.pow(2,n))/Math.log(r),l="";for(i=2;s===1/0;i*=2)s=Math.log(Math.pow(2,n/i))/Math.log(r)*i;var u=s-Math.floor(s);for(i=0;i-1||c!==1/0&&c>=Math.pow(2,n)?t(e,n,r):l},i.OptionControl=function(t,e){t||(t={}),e||(e="opt");var n={};return n.optionList=[],n._newoption=function(r){r[e]=t,n[r.name]=r,n.optionList.push(r)},n["_"+e]=t,n},i.smooth=function(t,e){if(e=Math.round(e)||0,e<2)return t;var n,r,i,a,o=t.length,s=2*o,l=2*e-1,u=new Array(l),c=new Array(o);for(n=0;n=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*u[r];c[n]=a}return c},i.syncOrAsync=function(t,e,n){function r(){return i.syncOrAsync(t,e,n)}for(var a,o;t.length;)if(o=t.splice(0,1)[0],a=o(e),a&&a.then)return a.then(r).then(void 0,i.promiseError);return n&&n(e)},i.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},i.noneOrAll=function(t,e,n){if(t){var r,i,a=!1,o=!0;for(r=0;r1?i+o[1]:"";if(a&&(o.length>1||s.length>4||n))for(;r.test(s);)s=s.replace(r,"$1"+a+"$2");return s+l}},{"./clean_number":308,"./coerce":309,"./dates":310,"./extend":312,"./filter_unique":313,"./filter_visible":314,"./is_array":317,"./is_plain_object":318,"./loggers":319,"./matrix":320,"./nested_property":321,"./notifier":322,"./search":325,"./stats":327,d3:8}],317:[function(t,e,n){"use strict";e.exports=function(t){return Array.isArray(t)||ArrayBuffer.isView(t)}},{}],318:[function(t,e,n){"use strict";e.exports=function(t){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(t):"[object Object]"===Object.prototype.toString.call(t)&&Object.getPrototypeOf(t)===Object.prototype}},{}],319:[function(t,e,n){"use strict";var r=t("../plot_api/plot_config"),i=e.exports={};i.log=function(){if(r.logging>1){for(var t=["LOG:"],e=0;e0){for(var t=["WARN:"],e=0;e0){for(var t=["ERROR:"],e=0;e=0;e--){if(r=t[e],o=!1,h(r))for(n=r.length-1;n>=0;n--)u(r[n])?o?r[n]=void 0:r.pop():o=!0;else if("object"==typeof r&&null!==r)for(a=Object.keys(r),o=!1,n=a.length-1;n>=0;n--)u(r[a[n]])&&!i(r[a[n]],a[n])?delete r[a[n]]:o=!0;if(o)return}}function u(t){return void 0===t||null===t||"object"==typeof t&&(h(t)?!t.length:!Object.keys(t).length)}function c(t,e,n){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:n,obj:t}}var f=t("fast-isnumeric"),h=t("./is_array");e.exports=function(t,e){if(f(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var n,i,o,s=0,l=e.split(".");sa||rs)&&(!e||!u(t))}function n(t,e){var n=t[0],l=t[1];if(na||ls)return!1;var u,c,f,h,d,p=r.length,m=r[0][0],g=r[0][1],v=0;for(u=1;uMath.max(c,m)||l>Math.max(f,g)))if(lc||Math.abs(r(o,h))>i)return!0;return!1};i.filter=function(t,e){function n(n){t.push(n);var s=r.length,l=i;r.splice(o+1);for(var u=l+1;u1){var s=t.pop();n(s)}return{addPt:n,raw:t,filtered:r}}},{"./matrix":320}],324:[function(t,e,n){"use strict";function r(t,e){for(var n,r=[],a=0;aa.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--)))},o.startSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},o.stopSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},o.undo=function(t){var e,n;if(t.framework&&t.framework.isPolar)return void t.framework.undo();if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,n=0;n=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,n=0;ne}function o(t,e){return t>=e}var s=t("fast-isnumeric"),l=t("./loggers");n.findBin=function(t,e,n){if(s(e.start))return n?Math.ceil((t-e.start)/e.size)-1:Math.floor((t-e.start)/e.size);var u,c,f=0,h=e.length,d=0;for(c=e[e.length-1]>=e[0]?n?r:i:n?o:a;f90&&l.log("Long binary search..."),f-1},n.sorterAsc=function(t,e){return t-e},n.sorterDes=function(t,e){return e-t},n.distinctVals=function(t){var e=t.slice();e.sort(n.sorterAsc);for(var r=e.length-1,i=e[r]-e[0]||1,a=i/(r||1)/1e4,o=[e[0]],s=0;se[s]+a&&(i=Math.min(i,e[s+1]-e[s]),o.push(e[s+1]));return{vals:o,minDiff:i}},n.roundUp=function(t,e,n){for(var r,i=0,a=e.length-1,o=0,s=n?0:1,l=n?1:0,u=n?Math.ceil:Math.floor;it.length-1)return t[t.length-1];var n=e%1;return n*t[Math.ceil(e)]+(1-n)*t[Math.floor(e)]}},{"fast-isnumeric":12}],328:[function(t,e,n){"use strict";function r(t,e){return t.node().getBoundingClientRect()[e]}function i(t){return t.replace(/(<|<|<)/g,"\\lt ").replace(/(>|>|>)/g,"\\gt ")}function a(t,e,n){var r="math-output-"+h.randstr([],64),a=f.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(i(t));MathJax.Hub.Queue(["Typeset",MathJax.Hub,a.node()],function(){var e=f.select("body").select("#MathJax_SVG_glyphs");if(a.select(".MathJax_SVG").empty()||!a.select("svg").node())h.log("There was an error in the tex syntax.",t),n();else{var r=a.select("svg").node().getBoundingClientRect();n(a.select(".MathJax_SVG"),e,r)}a.remove()})}function o(t,e){for(var n=t||"",r=0;r]*>)/).map(function(t){var e=t.match(/<(\/?)([^ >]*)\s*(.*)>/i),r=e&&e[2].toLowerCase(),i=m[r];if(void 0!==i){var a=e[1],o=e[3],s=o.match(/^style\s*=\s*"([^"]+)"\s*/i);if("a"===r){if(a)return"";if("href"!==o.substr(0,4).toLowerCase())return"";var u=o.substr(4).replace(/["']/g,"").replace(/=/,""),c=document.createElement("a");return c.href=u,g.indexOf(c.protocol)===-1?"":''}if("br"===r)return"
";if(a)return"sup"===r?'':"sub"===r?'':"";var f=""}return n.xml_entity_encode(t).replace(/");i>0;i=e.indexOf("
",i+1))r.push(i);var a=0;r.forEach(function(t){for(var n=t+a,r=e.slice(0,n),i="",o=r.length-1;o>=0;o--){var s=r[o].match(/<(\/?).*>/i);if(s&&"
"!==r[o]){s[1]||(i=r[o]);break}}i&&(e.splice(n+1,0,i),e.splice(n,0,""),a+=2)});var o=e.join(""),u=o.split(/
/gi);return u.length>1&&(e=u.map(function(t,e){return''+t+""})),e.join("")}function c(t,e,n){var r,i,a,o=n.horizontalAlign,s=n.verticalAlign||"top",l=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return i="bottom"===s?function(){return l.bottom-r.height}:"middle"===s?function(){return l.top+(l.height-r.height)/2}:function(){return l.top},a="right"===o?function(){return l.right-r.width}:"center"===o?function(){return l.left+(l.width-r.width)/2}:function(){return l.left},function(){return r=this.node().getBoundingClientRect(),this.style({top:i()-u.top+"px",left:a()-u.left+"px","z-index":1e3}),this}}var f=t("d3"),h=t("../lib"),d=t("../constants/xmlns_namespaces"),p=t("../constants/string_mappings");f.selection.prototype.appendSVG=function(t){for(var e=['',t,""].join(""),n=(new DOMParser).parseFromString(e,"application/xml"),r=n.documentElement.firstChild;r;)this.node().appendChild(this.node().ownerDocument.importNode(r,!0)),r=r.nextSibling;return n.querySelector("parsererror")?(h.log(n.querySelector("parsererror div").textContent),null):f.select(this.node().lastChild)},n.html_entity_decode=function(t){var e=f.select("body").append("div").style({display:"none"}).html(""),n=t.replace(/(&[^;]*;)/gi,function(t){return"<"===t?"<":"&rt;"===t?">":e.html(t).text()});return e.remove(),n},n.xml_entity_encode=function(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")},n.convertToTspans=function(t,e){function n(){d.empty()||(p=s.attr("class")+"-math",d.select("svg."+p).remove()),t.text("").style({visibility:"inherit","white-space":"pre"}),c=t.appendSVG(o),c||t.text(i),t.select("a").size()&&t.style("pointer-events","all"),e&&e.call(s)}var i=t.text(),o=u(i),s=t,l=!s.attr("data-notex")&&o.match(/([^$]*)([$]+[^$]*[$]+)([^$]*)/),c=i,d=f.select(s.node().parentNode);if(!d.empty()){var p=s.attr("class")?s.attr("class").split(" ")[0]:"text";p+="-math",d.selectAll("svg."+p).remove(),d.selectAll("g."+p+"-group").remove(),t.style({visibility:null});for(var m=t.node();m&&m.removeAttribute;m=m.parentNode)m.removeAttribute("data-bb");if(l){var g=h.getPlotDiv(s.node());(g&&g._promises||[]).push(new Promise(function(t){s.style({visibility:"hidden"});var i={fontSize:parseInt(s.style("font-size"),10)};a(l[2],i,function(i,a,o){d.selectAll("svg."+p).remove(),d.selectAll("g."+p+"-group").remove();var l=i&&i.select("svg");if(!l||!l.node())return n(),void t();var u=d.append("g").classed(p+"-group",!0).attr({"pointer-events":"none"});u.node().appendChild(l.node()),a&&a.node()&&l.node().insertBefore(a.node().cloneNode(!0),l.node().firstChild),l.attr({class:p,height:o.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var c=s.style("fill")||"black";l.select("g").attr({fill:c,stroke:c});var f=r(l,"width"),h=r(l,"height"),m=+s.attr("x")-f*{start:0,middle:.5,end:1}[s.attr("text-anchor")||"start"],g=parseInt(s.style("font-size"),10)||r(s,"height"),v=-g/4;"y"===p[0]?(u.attr({transform:"rotate("+[-90,+s.attr("x"),+s.attr("y")]+") translate("+[-f/2,v-h/2]+")"}),l.attr({x:+s.attr("x"),y:+s.attr("y")})):"l"===p[0]?l.attr({x:s.attr("x"),y:v-h/2}):"a"===p[0]?l.attr({x:0,y:v}):l.attr({x:m,y:+s.attr("y")+v-h/2}),e&&e.call(s,u),t(u)})}))}else n();return t}};var m={sup:'font-size:70%" dy="-0.6em',sub:'font-size:70%" dy="0.3em',b:"font-weight:bold",i:"font-style:italic",a:"",span:"",br:"",em:"font-style:italic;font-weight:bold"},g=["http:","https:","mailto:"],v=new RegExp("]*)?/?>","g"),y=Object.keys(p.entityToUnicode).map(function(t){return{regExp:new RegExp("&"+t+";","g"),sub:p.entityToUnicode[t]}}),x=Object.keys(p.unicodeToEntity).map(function(t){return{regExp:new RegExp(t,"g"),sub:"&"+p.unicodeToEntity[t]+";"}});n.plainText=function(t){return(t||"").replace(v," ")},n.makeEditable=function(t,e,n){function r(){a(),o.style({opacity:0});var t,e=u.attr("class");t=e?"."+e.split(" ")[0]+"-math-group":"[class*=-math-group]",t&&f.select(o.node().parentNode).select(t).style({opacity:0})}function i(t){var e=t.node(),n=document.createRange();n.selectNodeContents(e);var r=window.getSelection();r.removeAllRanges(),r.addRange(n),e.focus()}function a(){var t=f.select(h.getPlotDiv(o.node())),e=t.select(".svg-container"),r=e.append("div");r.classed("plugin-editable editable",!0).style({position:"absolute","font-family":o.style("font-family")||"Arial","font-size":o.style("font-size")||12,color:n.fill||o.style("fill")||"black",opacity:1,"background-color":n.background||"transparent",outline:"#ffffff33 1px solid",margin:[-parseFloat(o.style("font-size"))/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(n.text||o.attr("data-unformatted")).call(c(o,e,n)).on("blur",function(){o.text(this.textContent).style({opacity:1});var t,e=f.select(this).attr("class");t=e?"."+e.split(" ")[0]+"-math-group":"[class*=-math-group]",t&&f.select(o.node().parentNode).select(t).style({opacity:0});var n=this.textContent;f.select(this).transition().duration(0).remove(),f.select(document).on("mouseup",null),s.edit.call(o,n)}).on("focus",function(){var t=this;f.select(document).on("mouseup",function(){return f.event.target!==t&&void(document.activeElement===r.node()&&r.node().blur())})}).on("keyup",function(){27===f.event.which?(o.style({opacity:1}),f.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),s.cancel.call(o,this.textContent)):(s.input.call(o,this.textContent),f.select(this).call(c(o,e,n)))}).on("keydown",function(){13===f.event.which&&this.blur()}).call(i)}n||(n={});var o=this,s=f.dispatch("edit","input","cancel"),l=f.select(this.node()).style({"pointer-events":"all"}),u=e||l;return e&&l.style({"pointer-events":"none"}),n.immediate?r():u.on("click",r),f.rebind(this,s,"on")}},{"../constants/string_mappings":304,"../constants/xmlns_namespaces":305,"../lib":316,d3:8}],329:[function(t,e,n){"use strict";function r(t,e){var n=t[e],r=e.charAt(0);n&&"paper"!==n&&(t[e]=f.cleanId(n,r))}function i(t){var e="middle",n="center";return t.indexOf("top")!==-1?e="top":t.indexOf("bottom")!==-1&&(e="bottom"),t.indexOf("left")!==-1?n="left":t.indexOf("right")!==-1&&(n="right"),e+" "+n}function a(t,e){return e in t&&"object"==typeof t[e]&&0===Object.keys(t[e]).length}var o=t("fast-isnumeric"),s=t("gl-mat4/fromQuat"),l=t("../registry"),u=t("../lib"),c=t("../plots/plots"),f=t("../plots/cartesian/axes"),h=t("../components/color");n.getGraphDiv=function(t){var e;if("string"==typeof t){if(e=document.getElementById(t),null===e)throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null===t||void 0===t)throw new Error("DOM element provided is null or undefined");return t},n.clearPromiseQueue=function(t){Array.isArray(t._promises)&&t._promises.length>0&&u.log("Clearing previous rejected promises from queue."),t._promises=[]},n.cleanLayout=function(t){var e,n;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1);var i=f.list({_fullLayout:t});for(e=0;e3?(g.x=1.02,g.xanchor="left"):g.x<-2&&(g.x=-.02,g.xanchor="right"),g.y>3?(g.y=1.02,g.yanchor="bottom"):g.y<-2&&(g.y=-.02,g.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var v=c.getSubplotIds(t,"gl3d");for(e=0;e=t.data.length||i<-t.data.length)throw new Error(n+" must be valid indices for gd.data.");if(e.indexOf(i,r+1)>-1||i>=0&&e.indexOf(-t.data.length+i)>-1||i<0&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+n+" must be unique.")}}function l(t,e,n){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),s(t,e,"currentIndices"),"undefined"==typeof n||Array.isArray(n)||(n=[n]),"undefined"!=typeof n&&s(t,n,"newIndices"),"undefined"!=typeof n&&e.length!==n.length)throw new Error("current and new indices must be of equal length.")}function u(t,e,n){var r,i;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),r=0;r=0&&lI.range[0]?[1,2]:[2,1]);else{var D=I.range[0],P=I.range[1];"log"===_?(D<=0&&P<=0&&n(T+".autorange",!0),D<=0?D=P/1e6:P<=0&&(P=D/1e6),n(T+".range[0]",Math.log(D)/Math.LN10),n(T+".range[1]",Math.log(P)/Math.LN10)):(n(T+".range[0]",Math.pow(10,D)),n(T+".range[1]",Math.pow(10,P)))}else n(T+".autorange",!0)}if("reverse"===A)z.range?z.range.reverse():(n(T+".autorange",!0),z.range=[1,0]),E.autorange?d.docalc=!0:d.doplot=!0;else if("annotations"===v.parts[0]||"shapes"===v.parts[0]){var C=v.parts[1],O=v.parts[0],F=a[O]||[],R=F[C]||{};2===v.parts.length&&(null===_&&(e[g]="remove"),"add"===e[g]||x.isPlainObject(e[g])?m[g]="remove":"remove"===e[g]?C===-1?(m[O]=F,delete m[g]):m[g]=R:x.log("???",e)),!r(R,"x")&&!r(R,"y")||x.containsAny(g,["color","opacity","align","dash"])||(d.docalc=!0);var j=w.getComponentMethod(O,"drawOne");j(t,C,v.parts.slice(2).join("."),e[g]),delete e[g]}else if(M.layoutArrayContainers.indexOf(v.parts[0])!==-1||"mapbox"===v.parts[0]&&"layers"===v.parts[1])L.manageArrayContainers(v,_,m),d.doplot=!0;else{var N=String(v.parts[1]||"");0===v.parts[0].indexOf("scene")?d.doplot=!0:0===v.parts[0].indexOf("geo")?d.doplot=!0:0===v.parts[0].indexOf("ternary")?d.doplot=!0:"paper_bgcolor"===g?d.doplot=!0:!o._has("gl2d")||g.indexOf("axis")===-1&&"plot_bgcolor"!==v.parts[0]?"hiddenlabels"===g?d.docalc=!0:v.parts[0].indexOf("legend")!==-1?d.dolegend=!0:g.indexOf("title")!==-1?d.doticks=!0:v.parts[0].indexOf("bgcolor")!==-1?d.dolayoutstyle=!0:v.parts.length>1&&x.containsAny(N,["tick","exponent","grid","zeroline"])?d.doticks=!0:g.indexOf(".linewidth")!==-1&&g.indexOf("axis")!==-1?d.doticks=d.dolayoutstyle=!0:v.parts.length>1&&N.indexOf("line")!==-1?d.dolayoutstyle=!0:v.parts.length>1&&"mirror"===N?d.doticks=d.dolayoutstyle=!0:"margin.pad"===g?d.doticks=d.dolayoutstyle=!0:"margin"===v.parts[0]||"autorange"===v.parts[1]||"rangemode"===v.parts[1]||"type"===v.parts[1]||"domain"===v.parts[1]||g.match(/^(bar|box|font)/)?d.docalc=!0:["hovermode","dragmode"].indexOf(g)!==-1?d.domodebar=!0:["hovermode","dragmode","height","width","autosize"].indexOf(g)===-1&&(d.doplot=!0):d.doplot=!0,v.set(_)}}}var B=t._fullLayout.width,q=t._fullLayout.height;M.supplyDefaults(t),t.layout.autosize&&M.plotAutoSize(t,t.layout,t._fullLayout);var V=e.height||e.width||t._fullLayout.width!==B||t._fullLayout.height!==q;return V&&(d.docalc=!0),(d.doplot||d.docalc)&&(d.layoutReplot=!0),{flags:d,undoit:m,redoit:p,eventData:x.extendDeep({},p)}}function m(t){var e=g.select(t),n=t._fullLayout;if(n._container=e.selectAll(".plot-container").data([0]),n._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0),n._paperdiv=n._container.selectAll(".svg-container").data([0]),n._paperdiv.enter().append("div").classed("svg-container",!0).style("position","relative"),n._glcontainer=n._paperdiv.selectAll(".gl-container").data([0]),n._glcontainer.enter().append("div").classed("gl-container",!0),n._geocontainer=n._paperdiv.selectAll(".geo-container").data([0]),n._geocontainer.enter().append("div").classed("geo-container",!0),n._paperdiv.selectAll(".main-svg").remove(),n._paper=n._paperdiv.insert("svg",":first-child").classed("main-svg",!0),n._toppaper=n._paperdiv.append("svg").classed("main-svg",!0),!n._uid){var r=[];g.selectAll("defs").each(function(){this.id&&r.push(this.id.split("-")[1])}),n._uid=x.randstr(r)}n._paperdiv.selectAll(".main-svg").attr(z.svgAttrs),n._defs=n._paper.append("defs").attr("id","defs-"+n._uid),n._topdefs=n._toppaper.append("defs").attr("id","topdefs-"+n._uid),n._draggers=n._paper.append("g").classed("draglayer",!0);var i=n._paper.append("g").classed("layer-below",!0);n._imageLowerLayer=i.append("g").classed("imagelayer",!0),n._shapeLowerLayer=i.append("g").classed("shapelayer",!0),n._cartesianlayer=n._paper.append("g").classed("cartesianlayer",!0),n._ternarylayer=n._paper.append("g").classed("ternarylayer",!0);var a=n._paper.append("g").classed("layer-above",!0);n._imageUpperLayer=a.append("g").classed("imagelayer",!0),n._shapeUpperLayer=a.append("g").classed("shapelayer",!0),n._pielayer=n._paper.append("g").classed("pielayer",!0),n._glimages=n._paper.append("g").classed("glimages",!0),n._geoimages=n._paper.append("g").classed("geoimages",!0),n._infolayer=n._toppaper.append("g").classed("infolayer",!0),n._zoomlayer=n._toppaper.append("g").classed("zoomlayer",!0),n._hoverlayer=n._toppaper.append("g").classed("hoverlayer",!0),t.emit("plotly_framework")}var g=t("d3"),v=t("fast-isnumeric"),y=t("../plotly"),x=t("../lib"),_=t("../lib/events"),b=t("../lib/queue"),w=t("../registry"),M=t("../plots/plots"),k=t("../plots/cartesian/graph_interact"),A=t("../plots/polar"),S=t("../components/drawing"),T=t("../components/errorbars"),z=t("../constants/xmlns_namespaces"),E=t("../lib/svg_text_utils"),L=t("./helpers"),I=t("./subroutines");y.plot=function(t,e,n,r){function o(){if(b)return y.addFrames(t,b)}function s(){for(var e=D._basePlotModules,n=0;n=s.length?s[0]:s[t]:s}function i(t){return Array.isArray(l)?t>=l.length?l[0]:l[t]:l}function a(t,e){var n=0;return function(){if(t&&++n===e)return t()}}if(t=L.getGraphDiv(t),!x.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before animating it. For more details, see https://plot.ly/javascript/animations/");var o=t._transitionData;o._frameQueue||(o._frameQueue=[]),n=M.supplyAnimationDefaults(n);var s=n.transition,l=n.frame;return void 0===o._frameWaitingCnt&&(o._frameWaitingCnt=0),new Promise(function(l,u){function c(){if(0!==o._frameQueue.length){for(;o._frameQueue.length;){var e=o._frameQueue.pop();e.onInterrupt&&e.onInterrupt()}t.emit("plotly_animationinterrupted",[])}}function f(e){if(0!==e.length){for(var s=0;so._timeToNext&&d()};e()}function m(t){return Array.isArray(s)?y>=s.length?t.transitionOpts=s[y]:t.transitionOpts=s[0]:t.transitionOpts=s,y++,t}var g,v,y=0,_=[],b=void 0===e||null===e,w=Array.isArray(e),k=!b&&!w&&x.isPlainObject(e);if(k)_.push({type:"object",data:m(x.extendFlat({},e))});else if(b||"string"==typeof e)for(g=0;g0&&T<_.length-1){var z=[];for(g=0;g<_.length;g++)v=_[g],("byname"!==_[g].type||g>T)&&z.push(v);_=z}}_.length>0?f(_):(t.emit("plotly_animated"),l())})},y.addFrames=function(t,e,n){if(t=L.getGraphDiv(t),null===e||void 0===e)return Promise.resolve();if(!x.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plot.ly/javascript/animations/");var r,i,a,o,s=t._transitionData._frames,l=t._transitionData._frameHash;if(!Array.isArray(e))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+e);var u=s.length+2*e.length,c=[];for(r=e.length-1;r>=0;r--)c.push({frame:M.supplyFrameDefaults(e[r]),index:n&&void 0!==n[r]&&null!==n[r]?n[r]:u+r});c.sort(function(t,e){return t.index>e.index?-1:t.index=0;r--){if(i=c[r].frame,!i.name)for(;l[i.name="frame "+t._transitionData._counter++];);if(l[i.name]){for(a=0;a=0;n--)r=e[n],a.push({type:"delete",index:r}),o.unshift({type:"insert",index:r,value:i[r]});var s=M.modifyFrames,l=M.modifyFrames,u=[t,o],c=[t,a];return b&&b.add(t,s,u,l,c),M.modifyFrames(t,a)},y.purge=function(t){t=L.getGraphDiv(t);var e=t._fullLayout||{},n=t._fullData||[];return M.cleanPlot([],{},n,e),M.purge(t),_.purge(t),e._container&&e._container.remove(),delete t._context,delete t._replotPending,delete t._mouseDownTime,delete t._hmpixcount,delete t._hmlumcount,t}},{"../components/drawing":246,"../components/errorbars":252,"../constants/xmlns_namespaces":305,"../lib":316,"../lib/events":311,"../lib/queue":324,"../lib/svg_text_utils":328,"../plotly":338,"../plots/cartesian/graph_interact":350,"../plots/plots":374,"../plots/polar":377,"../registry":382,"./helpers":329,"./subroutines":335,d3:8,"fast-isnumeric":12}],331:[function(t,e,n){"use strict";function r(t,n){try{t._fullLayout._paper.style("background",n)}catch(t){e.exports.logging>0&&console.error(t)}}e.exports={staticPlot:!1,editable:!1,autosizable:!1,queueLength:0,fillFrame:!1,frameMargins:0,scrollZoom:!1,doubleClick:"reset+autosize",showTips:!0,showLink:!1,sendData:!0,linkText:"Edit chart",showSources:!1,displayModeBar:"hover",modeBarButtonsToRemove:[],modeBarButtonsToAdd:[],modeBarButtons:!1,displaylogo:!0,plotGlPixelRatio:2,setBackground:r,topojsonURL:"https://cdn.plot.ly/",mapboxAccessToken:null,logging:!1,globalTransforms:[]}},{}],332:[function(t,e,n){"use strict";function r(t){var e,n;"area"===t?(e={attributes:y},n={}):(e=h.modules[t]._module,n=e.basePlotModule);var r={};r.type=null,b(r,p),b(r,e.attributes),n.attributes&&b(r,n.attributes),r.type=t;var i={meta:e.meta||{},attributes:o(r)};if(e.layoutAttributes){var a={};b(a,e.layoutAttributes),i.layoutAttributes=o(a)}return i}function i(){var t={};return b(t,m),Object.keys(h.subplotsRegistry).forEach(function(e){var n=h.subplotsRegistry[e];if(n.layoutAttributes)if("cartesian"===n.name)c(t,n,"xaxis"),c(t,n,"yaxis");else{var r="subplot"===n.attr?n.name:n.attr;c(t,n,r)}}),t=u(t),Object.keys(h.componentsRegistry).forEach(function(e){var n=h.componentsRegistry[e];n.layoutAttributes&&(Array.isArray(n.layoutNodes)?n.layoutNodes.forEach(function(e){f(t,n,e+n.name)}):f(t,n,n.name))}),{layoutAttributes:o(t)}}function a(t){var e=h.transformsRegistry[t];return{attributes:o(e.attributes)}}function o(t){return s(t),l(t),t}function s(t){function e(t){return{valType:"string"}}function r(t,r,i){n.isValObject(t)?"data_array"===t.valType?(t.role="data",i[r+"src"]=e(r)):t.arrayOk===!0&&(i[r+"src"]=e(r)):d.isPlainObject(t)&&(t.role="object")}n.crawl(t,r)}function l(t){function e(t,e,n){if(t){var r=t[M];r&&(delete t[M],n[e]={items:{}},n[e].items[r]=t,n[e].role="object")}}n.crawl(t,e)}function u(t){return _(t,{radialaxis:x.radialaxis,angularaxis:x.angularaxis}),_(t,x.layout),t}function c(t,e,n){var r=d.nestedProperty(t,n),i=b({},e.layoutAttributes);i[w]=!0,r.set(i)}function f(t,e,n){var r=d.nestedProperty(t,n),i=b(r.get()||{},e.layoutAttributes);r.set(i)}var h=t("../registry"),d=t("../lib"),p=t("../plots/attributes"),m=t("../plots/layout_attributes"),g=t("../plots/frame_attributes"),v=t("../plots/animation_attributes"),y=t("../plots/polar/area_attributes"),x=t("../plots/polar/axis_attributes"),_=d.extendFlat,b=d.extendDeep,w="_isSubplotObj",M="_isLinkedToArray",k="_deprecated",A=[w,M,k];n.IS_SUBPLOT_OBJ=w,n.IS_LINKED_TO_ARRAY=M,n.DEPRECATED=k,n.UNDERSCORE_ATTRS=A,n.get=function(){var t={};h.allTypes.concat("area").forEach(function(e){t[e]=r(e)});var e={};return Object.keys(h.transformsRegistry).forEach(function(t){e[t]=a(t)}),{defs:{valObjects:d.valObjects,metaKeys:A.concat(["description","role"])},traces:t,layout:i(),transforms:e,frames:o(g),animation:o(v)}},n.crawl=function(t,e,r){var i=r||0;Object.keys(t).forEach(function(r){var a=t[r];A.indexOf(r)===-1&&(e(a,r,t,i),n.isValObject(a)||d.isPlainObject(a)&&n.crawl(a,e,i+1))})},n.isValObject=function(t){return t&&void 0!==t.valType},n.findArrayAttributes=function(t){function e(e,n,o,s){a=a.slice(0,s).concat([n]);var l="data_array"===e.valType||e.arrayOk===!0;if(l){var u=r(a),c=d.nestedProperty(t,u).get();Array.isArray(c)&&i.push(u)}}function r(t){return t.join(".")}var i=[],a=[];if(n.crawl(t._module.attributes,e),t.transforms)for(var o=t.transforms,s=0;s1)};h(e.width)&&h(e.height)||r(new Error("Height and width should be pixel values."));var d=l(t,{format:"png",height:e.height,width:e.width}),p=d.gd;p.style.position="absolute",p.style.left="-5000px",document.body.appendChild(p);var m=s.getRedrawFunc(p);a.plot(p,d.data,d.layout,d.config).then(m).then(f).then(function(t){n(t)}).catch(function(t){r(t)})});return n}var i=t("fast-isnumeric"),a=t("../plotly"),o=t("../lib"),s=t("../snapshot/helpers"),l=t("../snapshot/cloneplot"),u=t("../snapshot/tosvg"),c=t("../snapshot/svgtoimg");e.exports=r},{"../lib":316,"../plotly":338,"../snapshot/cloneplot":383,"../snapshot/helpers":386,"../snapshot/svgtoimg":388,"../snapshot/tosvg":390,"fast-isnumeric":12}],337:[function(t,e,n){"use strict";function r(t,e,n,i,a,u){u=u||[];for(var c=Object.keys(t),h=0;h1&&l.push(o("object","layout"))),h.supplyDefaults(u);for(var c=u._fullData,g=n.length,v=0;vc&&e10||"01-01"!==r.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12===0?"y":"m";else if(e>=L&&i<=10||e>=15*L)t._tickround="d";else if(e>=D&&i<=16||e>=I)t._tickround="M";else if(e>=P&&i<=19||e>=D)t._tickround="S";else{var a=b.ms2DateTime(n+e).replace(/^-/,"").length;t._tickround=Math.max(i,a)-20}}else if(x(e)||"L"===e.charAt(0)){var o=t.range.map(t.r2d||Number);x(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var s=Math.max(Math.abs(o[0]),Math.abs(o[1])),l=Math.floor(Math.log(s)/Math.LN10+.01);Math.abs(l)>3&&("SI"===t.exponentformat||"B"===t.exponentformat?t._tickexponent=3*Math.round((l-1)/3):t._tickexponent=l)}else t._tickround=null}function o(t,e){var n=t.match(Y),r=new Date(e);if(n){var i=Math.min(+n[1]||6,6),a=String(e/1e3%1+2.0000005).substr(2,i).replace(/0+$/,"")||"0";return y.time.format(t.replace(Y,a))(r)}return y.time.format(t)(r)}function s(t,e,n){var r=t.tickfont||t._gd._fullLayout.font;return{x:e,dx:0,dy:0,text:n||"",fontSize:r.size,font:r.family,fontColor:r.color}}function l(t,e,n,r){var i,a,s=e.x,l=t._tickround,u=new Date(s);n&&t.hoverformat?a=o(t.hoverformat,s):t.tickformat?a=o(t.tickformat,s):(r&&(x(l)?l+=2:l={y:"m",m:"d",d:"M",M:"S",S:2}[l]),"y"===l?a=V(u):"m"===l?a=U(u):"d"===l?(i=V(u),a=G(u)):(i=H(u),a=Z(u),"M"!==l&&(a+=X(u),"S"!==l&&(a+=h(y.round(v(s/1e3,1),4),t,"none",n).substr(1))))),(n||"array"===t.tickmode)&&("00:00:00"===a||"00:00"===a?(a=i,i=""):8===a.length&&(a=a.replace(/:00$/,""))),i&&(n?"d"===l?a+=", "+i:a=i+(a?", "+a:""):t._inCalcTicks&&i===t._prevDateHead||(a+="
"+i,t._prevDateHead=i)),e.text=a}function u(t,e,n,r,i){var a=t.dtick,o=e.x;if(!r||"string"==typeof a&&"L"===a.charAt(0)||(a="L3"),t.tickformat||"string"==typeof a&&"L"===a.charAt(0))e.text=h(Math.pow(10,o),t,i,r);else if(x(a)||"D"===a.charAt(0)&&v(o+.01,1)<.1)if(["e","E","power"].indexOf(t.exponentformat)!==-1){var s=Math.round(o);0===s?e.text=1:1===s?e.text="10":s>1?e.text="10"+s+"":e.text="10\u2212"+-s+"",e.fontSize*=1.25}else e.text=h(Math.pow(10,o),t,"","fakehover"),"D1"===a&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6);else{if("D"!==a.charAt(0))throw"unrecognized dtick "+String(a);e.text=String(Math.round(Math.pow(10,v(o,1)))),e.fontSize*=.75}if("D1"===t.dtick){var l=String(e.text).charAt(0);"0"!==l&&"1"!==l||("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(o<0?.5:.25)))}}function c(t,e){var n=t._categories[Math.round(e.x)];void 0===n&&(n=""),e.text=String(n)}function f(t,e,n,r,i){"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide"),e.text=h(e.x,t,i,r)}function h(t,e,n,r){var i=t<0,o=e._tickround,s=n||e.exponentformat||"B",l=e._tickexponent,u=e.tickformat,c=e.separatethousands;if(r){var f={exponentformat:e.exponentformat,dtick:"none"===e.showexponent?e.dtick:x(t)?Math.abs(t)||1:1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};a(f),o=(Number(f._tickround)||0)+4,l=f._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return y.format(u)(t).replace(/-/g,"\u2212");var h=Math.pow(10,-o)/2;if("none"===s&&(l=0),t=Math.abs(t),t12||l<-15)?t+="e"+m:"E"===s?t+="E"+m:"power"===s?t+="\xd710"+m+"":"B"===s&&9===l?t+="B":"SI"!==s&&"B"!==s||(t+=W[l/3+5])}return i?"\u2212"+t:t}function d(t,e){var n,r,i=[];for(n=0;n1)for(r=1;r2e-6||((n-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},C.getAutoRange=function(t){var e,n=[],r=t._min[0].val,i=t._max[0].val;for(e=1;e0&&c>0&&f/c>h&&(l=o,u=s,h=f/c);if(r===i){var m=r-1,g=r+1;n="tozero"===t.rangemode?r<0?[m,0]:[0,g]:"nonnegative"===t.rangemode?[Math.max(0,m),Math.max(0,g)]:[m,g]}else h&&("linear"!==t.type&&"-"!==t.type||("tozero"===t.rangemode?(l.val>=0&&(l={val:0,pad:0}),u.val<=0&&(u={val:0,pad:0})):"nonnegative"===t.rangemode&&(l.val-h*l.pad<0&&(l={val:0,pad:0}),u.val<0&&(u={val:1,pad:0})),h=(u.val-l.val)/(t._length-l.pad-u.pad)),n=[l.val-h*l.pad,u.val+h*u.pad]);return n[0]===n[1]&&("tozero"===t.rangemode?n=n[0]<0?[n[0],0]:n[0]>0?[0,n[0]]:[0,1]:(n=[n[0]-1,n[0]+1],"nonnegative"===t.rangemode&&(n[0]=Math.max(0,n[0])))),d&&n.reverse(),n.map(t.l2r||Number)},C.doAutoRange=function(t){t._length||t.setScale();var e=t._min&&t._max&&t._min.length&&t._max.length;if(t.autorange&&e){t.range=C.getAutoRange(t);var n=t._gd.layout[t._name];n||(t._gd.layout[t._name]=n={}),n!==t&&(n.range=t.range.slice(),n.autorange=t.autorange)}},C.saveRangeInitial=function(t,e){for(var n=C.list(t,"",!0),r=!1,i=0;i=h?d=!1:s.val>=u&&s.pad<=h&&(t._min.splice(o,1),o--);d&&t._min.push({val:u,pad:y&&0===u?0:h})}if(r(c)){for(d=!0,o=0;o=c&&s.pad>=f?d=!1:s.val<=c&&s.pad<=f&&(t._max.splice(o,1),o--);d&&t._max.push({val:c,pad:y&&0===c?0:f})}}}if((t.autorange||t._needsExpand)&&e){t._min||(t._min=[]),t._max||(t._max=[]),n||(n={}),t._m||t.setScale();var a,o,s,l,u,c,f,h,d,p,m,g=e.length,v=n.padded?.05*t._length:0,y=n.tozero&&("linear"===t.type||"-"===t.type),_=r((t._m>0?n.ppadplus:n.ppadminus)||n.ppad||0),b=r((t._m>0?n.ppadminus:n.ppadplus)||n.ppad||0),w=r(n.vpadplus||n.vpad),M=r(n.vpadminus||n.vpad);for(a=0;a<6;a++)i(a);for(a=g-1;a>5;a--)i(a)}},C.autoBin=function(t,e,n,r){function i(t){return(1+100*(t-d)/f.dtick)%100<2}var a=b.aggNums(Math.min,null,t),o=b.aggNums(Math.max,null,t);if("category"===e.type)return{start:a-.5,end:o+.5,size:1};var s;if(n)s=(o-a)/n;else{var l=b.distinctVals(t),u=Math.pow(10,Math.floor(Math.log(l.minDiff)/Math.LN10)),c=u*b.roundUp(l.minDiff/u,[.9,1.9,4.9,9.9],!0);s=Math.max(c,2*b.stdev(t)/Math.pow(t.length,r?.25:.4))}var f;f="log"===e.type?{type:"linear",range:[a,o],r2l:Number}:{type:e.type,range:[a,o].map(e.l2r),r2l:e.r2l},C.autoTicks(f,s);var h,d=C.tickIncrement(C.tickFirst(f),f.dtick,"reverse");if("number"==typeof f.dtick){for(var p=0,m=0,g=0,v=0,y=0;y.3*_||i(a)||i(o))){var w=f.dtick/2;d+=d+w0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}if(t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),a(t),"array"===t.tickmode)return r(t);t._tmin=C.tickFirst(t);var o=e[1]=l:u<=l)&&(s.push(u),!(s.length>1e3));u=C.tickIncrement(u,t.dtick,o));t._tmax=s[s.length-1],t._prevDateHead="",t._inCalcTicks=!0;for(var c=new Array(s.length),f=0;fz?(e/=z,n=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="M"+12*i(e,n,F)):r>E?(e/=E,t.dtick="M"+i(e,1,R)):r>L?(t.dtick=i(e,L,N),t.tick0="2000-01-02"):r>I?t.dtick=i(e,I,R):r>D?t.dtick=i(e,D,j):r>P?t.dtick=i(e,P,j):(n=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=i(e,n,F))}else if("log"===t.type){t.tick0=0;var a=t.range.map(t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(a[1]-a[0])<1){var o=1.5*Math.abs((a[1]-a[0])/e);e=Math.abs(Math.pow(10,a[1])-Math.pow(10,a[0]))/o,n=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="L"+i(e,n,F)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):(t.tick0=0,n=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=i(e,n,F));if(0===t.dtick&&(t.dtick=1),!x(t.dtick)&&"string"!=typeof t.dtick){var s=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(s)}},C.tickIncrement=function(t,e,n){var r=n?-1:1;if(x(e))return t+r*e;var i=e.charAt(0),a=r*Number(e.substr(1));if("M"===i){var o=new Date(t);return o.setMonth(o.getMonth()+a)}if("L"===i)return Math.log(Math.pow(10,t)+a)/Math.LN10;if("D"===i){var s="D2"===e?q:B,l=t+.01*r,u=b.roundUp(v(l,1),s,n);return Math.floor(l)+Math.log(y.round(Math.pow(10,u),1))/Math.LN10}throw"unrecognized dtick "+String(e)},C.tickFirst=function(t){var e=t.r2l||Number,n=t.range.map(e),r=n[1]a:f1&&e2*r}function a(t){for(var e,n=Math.max(1,(t.length-1)/1e3),r=0,i=0,a=0;a2*r}var o=t("fast-isnumeric"),s=t("../../lib"),l=t("../../constants/numerical").BADNUM;e.exports=function(t){return i(t)?"date":a(t)?"category":r(t)?"linear":"-"}},{"../../constants/numerical":303,"../../lib":316,"fast-isnumeric":12}],345:[function(t,e,n){"use strict";function r(t,e){if("-"===t.type){var n=t._id,r=n.charAt(0);n.indexOf("scene")!==-1&&(n=r);var s=o(e,n,r);if(s){if("histogram"===s.type&&r==={v:"y",h:"x"}[s.orientation||"v"])return void(t.type="linear");if(a(s,r)){for(var l,c=i(s),f=[],h=0;h0;a&&(r="array");var o=n("categoryorder",r);"array"===o&&n("categoryarray"),a||"array"!==o||(e.categoryorder="trace")}}},{}],348:[function(t,e,n){"use strict";e.exports={idRegex:{x:/^x([2-9]|[1-9][0-9]+)?$/,y:/^y([2-9]|[1-9][0-9]+)?$/},attrRegex:{x:/^xaxis([2-9]|[1-9][0-9]+)?$/,y:/^yaxis([2-9]|[1-9][0-9]+)?$/},xAxisMatch:/^xaxis[0-9]*$/,yAxisMatch:/^yaxis[0-9]*$/,AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,DBLCLICKDELAY:300,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,MAXDIST:20,YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,BENDPX:1.5,REDRAWDELAY:50,DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],DFLTRANGEDATE:["2000-01-01","2001-01-01"]}},{}],349:[function(t,e,n){"use strict";function r(t,e){var n,r=t.range[e],i=Math.abs(r-t.range[1-e]);return"date"===t.type?r:"log"===t.type?(n=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,s.format("."+n+"g")(Math.pow(10,r))):(n=Math.floor(Math.log(Math.abs(r))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,s.format("."+String(n)+"g")(r))}function i(t,e){return t?"nsew"===t?"pan"===e?"move":"crosshair":t.toLowerCase()+"-resize":"pointer"}function a(t){s.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function o(t){var e=["lasso","select"];return e.indexOf(t)!==-1}var s=t("d3"),l=t("tinycolor2"),u=t("../../plotly"),c=t("../../registry"),f=t("../../lib"),h=t("../../lib/svg_text_utils"),d=t("../../components/color"),p=t("../../components/drawing"),m=t("../../lib/setcursor"),g=t("../../components/dragelement"),v=t("./axes"),y=t("./select"),x=t("./constants"),_=!0;e.exports=function(t,e,n,s,b,w,M,k){function A(t,e){for(var n=0;n.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+mt+", "+gt+")").attr("d",ut+"Z"),dt=pt.append("path").attr("class","zoombox-corners").style({fill:d.background,stroke:d.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+mt+", "+gt+")").attr("d","M0,0Z"),z()}function z(){pt.selectAll(".select-outline").remove()}function E(e,n){if(t._transitioningWithDuration)return!1;var r=Math.max(0,Math.min(U,e+at)),i=Math.max(0,Math.min(G,n+ot)),a=Math.abs(r-at),o=Math.abs(i-ot),s=Math.floor(Math.min(o,a,Z)/2);st.l=Math.min(at,r),st.r=Math.max(at,r),st.t=Math.min(ot,i),st.b=Math.max(ot,i),!K||o.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),dt.transition().style("opacity",1).duration(200),ct=!0)}function L(t,e,n){var r,i,a;for(r=0;rzoom back out","long"),_=!1)))}function D(e,n){var i=1===(M+k).length;if(e)R();else if(2!==n||i){if(1===n&&i){var a=M?V[0]:q[0],o="s"===M||"w"===k?0:1,s=a._name+".range["+o+"]",l=r(a,o),c="left",f="middle";if(a.fixedrange)return;M?(f="n"===M?"top":"bottom","right"===a.side&&(c="right")):"e"===k&&(c="right"),nt.call(h.makeEditable,null,{immediate:!0,background:N.paper_bgcolor,text:String(l),fill:a.tickfont?a.tickfont.color:"#444",horizontalAlign:c,verticalAlign:f}).on("edit",function(e){var n=a.d2r(e);void 0!==n&&u.relayout(t,s,n)})}}else F()}function P(e){function n(t,e,n){function r(e){return t.l2r(a+(e-a)*n)}if(!t.fixedrange){var i=t.range.map(t.r2l),a=i[0]+(i[1]-i[0])*e;t.range=i.map(r)}}if(t._context.scrollZoom||N._enablescrollzoom){if(t._transitioningWithDuration)return f.pauseEvent(e);var r=t.querySelector(".plotly");if(S(),!(r.scrollHeight-r.clientHeight>10||r.scrollWidth-r.clientWidth>10)){clearTimeout(yt);var i=-e.deltaY;if(isFinite(i)||(i=e.wheelDelta/10),!isFinite(i))return void f.log("Did not find wheel motion attributes: ",e);var a,o=Math.exp(-Math.min(Math.max(i,-20),20)/100),s=_t.draglayer.select(".nsewdrag").node().getBoundingClientRect(),l=(e.clientX-s.left)/s.width,u=vt[0]+vt[2]*l,c=(s.bottom-e.clientY)/s.height,h=vt[1]+vt[3]*(1-c);if(k){for(a=0;a=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function a(t,e,n){for(var r,a,o=1-e,s=0;s0;r--)n.push(e);return n}function i(t,e){for(var n=[],r=0;rY.width||X<0||X>Y.height)return b.unhoverRaw(t,e)}else Z="xpx"in e?e.xpx:k[0]._length/2,X="ypx"in e?e.ypx:A[0]._length/2;if(I="xval"in e?r(a,e.xval):i(k,Z),D="yval"in e?r(a,e.yval):i(A,X),!m(I[0])||!m(D[0]))return g.warn("Fx.hover failed",e,t),b.unhoverRaw(t,e)}var W=1/0;for(C=0;C1||F.hoverinfo.indexOf("name")!==-1?F.name:void 0,index:!1,distance:Math.min(W,M.MAXDIST),color:x.defaultLine,x0:void 0,x1:void 0,y0:void 0,y1:void 0,xLabelVal:void 0,yLabelVal:void 0,zLabelVal:void 0,text:void 0},o[R]&&(V.subplot=o[R]._subplot),U=G.length,"array"===N){var Q=e[C];"pointNumber"in Q?(V.index=Q.pointNumber,N="closest"):(N="","xval"in Q&&(B=Q.xval,N="x"),"yval"in Q&&(q=Q.yval,N=N?"closest":"y"))}else B=I[j],q=D[j];if(F._module&&F._module.hoverPoints){var J=F._module.hoverPoints(V,B,q,N);if(J)for(var $,K=0;KU&&(G.splice(0,U),W=G[0].distance)}if(0===G.length)return b.unhoverRaw(t,e);var tt="y"===L&&H.length>1;G.sort(function(t,e){return t.distance-e.distance});var et=x.combine(o.plot_bgcolor||x.background,o.paper_bgcolor),nt={hovermode:L,rotateLabels:tt,bgColor:et,container:o._hoverlayer,outerContainer:o._paperdiv},rt=u(G,nt);c(G,tt?"xa":"ya"),f(rt,tt);var it=t._hoverdata,at=[];for(P=0;P128?"#000":x.background;if(t.name&&void 0===t.zLabelVal){var c=document.createElement("p");c.innerHTML=t.name,n=c.textContent||"",n.length>15&&(n=n.substr(0,12)+"...")}void 0!==t.extraText&&(r+=t.extraText),void 0!==t.zLabel?(void 0!==t.xLabel&&(r+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(r+="y: "+t.yLabel+"
"),r+=(r?"z: ":"")+t.zLabel):A&&t[i+"Label"]===m?r=t[("x"===i?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(r=t.yLabel):r=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",t.text&&!Array.isArray(t.text)&&(r+=(r?"
":"")+t.text),""===r&&(""===n&&e.remove(),r=n);var f=e.select("text.nums").style("fill",u).call(_.setPosition,0,0).text(r).attr("data-notex",1).call(y.convertToTspans);f.selectAll("tspan.line").call(_.setPosition,0,0);var h=e.select("text.name"),g=0;n&&n!==r?(h.style("fill",l).text(n).call(_.setPosition,0,0).attr("data-notex",1).call(y.convertToTspans),h.selectAll("tspan.line").call(_.setPosition,0,0),g=h.node().getBoundingClientRect().width+2*P):(h.remove(),e.select("rect").remove()),e.select("path").style({fill:l,stroke:u});var v,M,S=f.node().getBoundingClientRect(),z=t.xa._offset+(t.x0+t.x1)/2,E=t.ya._offset+(t.y0+t.y1)/2,L=Math.abs(t.x1-t.x0),I=Math.abs(t.y1-t.y0),C=S.width+D+P+g;t.ty0=b-S.top,t.bx=S.width+2*P,t.by=S.height+2*P,t.anchor="start",t.txwidth=S.width,t.tx2width=g,t.offset=0,a?(t.pos=z,v=E+I/2+C<=k,M=E-I/2-C>=0,"top"!==t.idealAlign&&v||!M?v?(E+=I/2,t.anchor="start"):t.anchor="middle":(E-=I/2,t.anchor="end")):(t.pos=E,v=z+L/2+C<=w,M=z-L/2-C>=0,"left"!==t.idealAlign&&v||!M?v?(z+=L/2,t.anchor="start"):t.anchor="middle":(z-=L/2,t.anchor="end")),f.attr("text-anchor",t.anchor),g&&h.attr("text-anchor",t.anchor),e.attr("transform","translate("+z+","+E+")"+(a?"rotate("+T+")":""))}),E}function c(t,e){function n(t){var e=t[0],n=t[t.length-1];if(i=e.pmin-e.pos-e.dp+e.size,a=n.pos+n.dp+n.size-e.pmax,i>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=i;r=!1}if(!(a<.01)){if(i<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=a;r=!1}if(r){var u=0;for(o=0;oe.pmax&&u++;for(o=t.length-1;o>=0&&!(u<=0);o--)l=t[o],l.pos>e.pmax-1&&(l.del=!0,u--);for(o=0;o=0;s--)t[s].dp-=a;for(o=t.length-1;o>=0&&!(u<=0);o--)l=t[o],l.pos+l.dp+l.size>e.pmax&&(l.del=!0,u--)}}}for(var r,i,a,o,s,l,u,c=0,f=t.map(function(t,n){var r=t[e];return[{i:n,dp:0,pos:t.pos,posref:t.posref,size:t.by*("x"===r._id.charAt(0)?E:1)/2,pmin:r._offset,pmax:r._offset+r._length}]}).sort(function(t,e){return t[0].posref-e[0].posref});!r&&c<=t.length;){for(c++,r=!0,o=0;o.01&&p.pmin===m.pmin&&p.pmax===m.pmax){for(s=d.length-1;s>=0;s--)d[s].dp+=i;for(h.push.apply(h,d),f.splice(o+1,1),u=0,s=h.length-1;s>=0;s--)u+=h[s].dp;for(a=u/h.length,s=h.length-1;s>=0;s--)h[s].dp-=a;r=!1}else o++}f.forEach(n)}for(o=f.length-1;o>=0;o--){var g=f[o];for(s=g.length-1;s>=0;s--){var v=g[s],y=t[v.i];y.offset=v.dp,y.del=v.del}}}function f(t,e){t.each(function(t){var n=d.select(this);if(t.del)return void n.remove();var r="end"===t.anchor?-1:1,i=n.select("text.nums"),a={start:1,end:-1,middle:0}[t.anchor],o=a*(D+P),s=o+a*(t.txwidth+P),l=0,u=t.offset;"middle"===t.anchor&&(o-=t.tx2width/2,s-=t.tx2width/2),e&&(u*=-I,l=t.offset*L),n.select("path").attr("d","middle"===t.anchor?"M-"+t.bx/2+",-"+t.by/2+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(r*D+l)+","+(D+u)+"v"+(t.by/2-D)+"h"+r*t.bx+"v-"+t.by+"H"+(r*D+l)+"V"+(u-D)+"Z"),i.call(_.setPosition,o+l,u+t.ty0-t.by/2+P).selectAll("tspan.line").attr({x:i.attr("x"),y:i.attr("y")}),t.tx2width&&(n.select("text.name, text.name tspan.line").call(_.setPosition,s+a*P+l,u+t.ty0-t.by/2+P),n.select("rect").call(_.setRect,s+(a-1)*t.tx2width/2+l,u-t.by/2-1,t.tx2width,t.by+2))})}function h(t,e,n){if(!e.target)return!1;if(!n||n.length!==t._hoverdata.length)return!0;for(var r=n.length-1;r>=0;r--){var i=n[r],a=t._hoverdata[r];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber))return!0}return!1}var d=t("d3"),p=t("tinycolor2"),m=t("fast-isnumeric"),g=t("../../lib"),v=t("../../lib/events"),y=t("../../lib/svg_text_utils"),x=t("../../components/color"),_=t("../../components/drawing"),b=t("../../components/dragelement"),w=t("./axes"),M=t("./constants"),k=t("./dragbox"),A=t("../layout_attributes"),S=e.exports={};S.unhover=b.unhover,S.layoutAttributes={},S.supplyLayoutDefaults=function(t,e,n){function r(n,r){return g.coerce(t,e,A,n,r)}r("dragmode");var i;if(e._has("cartesian")){var a=e._isHoriz=S.isHoriz(n);i=a?"y":"x"}else i="closest";r("hovermode",i)},S.isHoriz=function(t){for(var e=!0,n=0;nt._lastHoverTime+M.HOVERMINTIME?(o(t,e,n),void(t._lastHoverTime=Date.now())):void(t._hoverTimer=setTimeout(function(){o(t,e,n),t._lastHoverTime=Date.now(),t._hoverTimer=void 0},M.HOVERMINTIME))},S.getDistanceFunction=function(t,e,n,r){return"closest"===t?r||a(e,n):"x"===t?e:n},S.getClosest=function(t,e,n){if(n.index!==!1)n.index>=0&&n.indexf[1]-.01&&(e.domain=[0,1]),i.noneOrAll(t.domain,e.domain,[0,1])}return e}},{"../../lib":316,"fast-isnumeric":12}],356:[function(t,e,n){"use strict";function r(t){return t._id}var i=t("../../lib/polygon"),a=t("../../components/color"),o=t("./axes"),s=t("./constants"),l=i.filter,u=i.tester,c=s.MINSELECT;e.exports=function(t,e,n,i,f){function h(t){var e="y"===t._id.charAt(0)?1:0;return function(n){return t.p2d(n[e])}}function d(t,e){return t-e}var p,m=i.gd._fullLayout._zoomlayer,g=i.element.getBoundingClientRect(),v=i.plotinfo.xaxis._offset,y=i.plotinfo.yaxis._offset,x=e-g.left,_=n-g.top,b=x,w=_,M="M"+x+","+_,k=i.xaxes[0]._length,A=i.yaxes[0]._length,S=i.xaxes.map(r),T=i.yaxes.map(r),z=i.xaxes.concat(i.yaxes);"lasso"===f&&(p=l([[x,_]],s.BENDPX));var E=m.selectAll("path.select-outline").data([1,2]);E.enter().append("path").attr("class",function(t){return"select-outline select-outline-"+t}).attr("transform","translate("+v+", "+y+")").attr("d",M+"Z");var L,I,D,P,C,O=m.append("path").attr("class","zoombox-corners").style({fill:a.background,stroke:a.defaultLine,"stroke-width":1}).attr("transform","translate("+v+", "+y+")").attr("d","M0,0Z"),F=[],R=i.gd,j=[];for(L=0;L0)return Math.log(e)/Math.LN10;if(e<=0&&n&&t.range&&2===t.range.length){var r=t.range[0],i=t.range[1];return.5*(r+i-3*f*Math.abs(r-i))}return l}function n(t){return Math.pow(10,t)}function o(t){return i(t)?(t=Number(t),t<-s||t>s?l:i(t)?Number(t):l):l}var f=10;t.c2l="log"===t.type?e:o,t.l2c="log"===t.type?n:o,t.l2d=function(e){return t.c2d(t.l2c(e))},t.p2d=function(e){return t.l2d(t.p2l(e))},t.cleanRange=function(e){e||(e="range");var n,r,o=t[e],l=(t._id||"x").charAt(0);if(r="date"===t.type?u.DFLTRANGEDATE:"y"===l?u.DFLTRANGEY:u.DFLTRANGEX,r=r.slice(),!o||2!==o.length)return void(t[e]=r);for("date"===t.type&&(o[0]=a.cleanDate(o[0]),o[1]=a.cleanDate(o[1])),n=0;n<2;n++)if("date"===t.type){if(!a.isDateTime(o[n])){t[e]=r;break}if(o[n]a.MAX_MS&&(o[n]=a.MAX_MS),t.r2l(o[0])===t.r2l(o[1])){var c=a.constrain(t.r2l(o[0]),a.MIN_MS+1e3,a.MAX_MS-1e3);o[0]=t.l2r(c-1e3),o[1]=t.l2r(c+1e3);break}}else{if(!i(o[n])){if(!i(o[1-n])){t[e]=r;break}o[n]=o[1-n]*(n?10:.1)}if(o[n]<-s?o[n]=-s:o[n]>s&&(o[n]=s),o[0]===o[1]){var f=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=f,o[1]+=f}}},t.fraction2r=function(e){var n=t.r2l(t.range[0]),r=t.r2l(t.range[1]);return t.l2r(n+e*(r-n))},t.r2fraction=function(e){var n=t.r2l(t.range[0]),r=t.r2l(t.range[1]);return(t.r2l(e)-n)/(r-n)},t.setScale=function(e){var n=t._gd._fullLayout._size,r=t._id.charAt(0);if(t._categories||(t._categories=[]),t.overlaying){var i=c.getFromId(t._gd,t.overlaying);t.domain=i.domain}var o=e&&t._r?"_r":"range";t.cleanRange(o);var s=t.r2l(t[o][0]),l=t.r2l(t[o][1]);if("y"===r?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(s-l),t._b=-t._m*l):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(l-s),t._b=-t._m*s),!isFinite(t._m)||!isFinite(t._b))throw a.notifier("Something went wrong with axis scaling","long"),t._gd._replotting=!1,new Error("axis scaling")},t.l2p=function(e){return i(e)?r.round(t._b+t._m*e,2):l},t.p2l=function(e){return(e-t._b)/t._m},t.c2p=function(e,n){return t.l2p(t.c2l(e,n))},t.p2c=function(e){return t.l2c(t.p2l(e))},t.r2p=function(e,n){return t.l2p(t.r2l(e,n))},t.p2r=function(e){return t.l2r(t.p2l(e))},t.r2c=function(e){return t.l2c(t.r2l(e))},t.c2r=function(e){return t.l2r(t.c2l(e))},["linear","log","-"].indexOf(t.type)!==-1?(t.c2d=o,t.d2c=a.cleanNumber,"log"===t.type?(t.d2l=function(e,n){return t.c2l(t.d2c(e),n)},t.d2r=t.d2l,t.r2d=t.l2d):(t.d2l=a.cleanNumber,t.d2r=a.cleanNumber,t.r2d=o),t.r2l=o,t.l2r=o):"date"===t.type?(t.c2d=a.ms2DateTime,t.d2c=function(t){var e=a.dateTime2ms(t);if(e===l){if(!i(t))return l;e=Number(t)}return a.constrain(e,a.MIN_MS,a.MAX_MS)},t.d2l=t.d2c,t.r2l=t.d2c,t.l2r=t.c2d,t.d2r=a.identity,t.r2d=a.identity,t.cleanr=function(e){return t.c2d(t.d2c(e))}):"category"===t.type&&(t.c2d=function(e){return t._categories[Math.round(e)]},t.d2c=function(e){null!==e&&void 0!==e&&t._categories.indexOf(e)===-1&&t._categories.push(e);var n=t._categories.indexOf(e);return n===-1?l:n},t.d2l_noadd=function(e){var n=t._categories.indexOf(e);return n!==-1?n:"number"==typeof e?e:void 0},t.d2l=t.d2c,t.r2l=o,t.l2r=o,t.d2r=t.d2c,t.r2d=t.c2d),t.makeCalcdata=function(e,n){var r,i,a;if(n in e)for(r=e[n],i=new Array(r.length),a=0;a0?Number(c):u;else if("string"!=typeof c)e.dtick=u;else{var f=c.charAt(0),h=c.substr(1);h=r(h)?Number(h):0,(h<=0||!("date"===o&&"M"===f&&h===Math.round(h)||"log"===o&&"L"===f||"log"===o&&"D"===f&&(1===h||2===h)))&&(e.dtick=u)}var d="date"===o?"2000-01-01":0,p=n("tick0",d);"date"===o?e.tick0=i.cleanDate(p,d):r(p)&&"D1"!==c&&"D2"!==c?e.tick0=Number(p):e.tick0=d}else{var m=n("tickvals");void 0===m?e.tickmode="auto":n("ticktext")}}},{"../../constants/numerical":303,"../../lib":316,"fast-isnumeric":12}],361:[function(t,e,n){"use strict";var r=t("d3"),i=t("../../plotly"),a=t("../../registry"),o=t("../../lib"),s=t("./axes"),l=/((x|y)([2-9]|[1-9][0-9]+)?)axis$/;e.exports=function(t,e,n,u){function c(t){var e,n,r,i,a,o={};for(e in t)if(n=e.split("."),r=n[0].match(l)){var s=r[1],u=s+"axis";if(i=y[u],a={},Array.isArray(t[e])?a.to=t[e].slice(0):Array.isArray(t[e].range)&&(a.to=t[e].range.slice(0)),!a.to)continue;a.axisName=u,a.length=i._length,x.push(s),o[s]=a}return o}function f(t,e,n){var r,i,a,o=t._plots,s=[];for(r in o){var l=o[r];if(s.indexOf(l)===-1){var u=l.xaxis._id,c=l.yaxis._id,f=l.xaxis.range,h=l.yaxis.range;l.xaxis._r=l.xaxis.range.slice(),l.yaxis._r=l.yaxis.range.slice(),i=n[u]?n[u].to:f,a=n[c]?n[c].to:h,f[0]===i[0]&&f[1]===i[1]&&h[0]===a[0]&&h[1]===a[1]||e.indexOf(u)===-1&&e.indexOf(c)===-1||s.push(l)}}return s}function h(e,n){function r(e,n){for(i=0;in.duration?(m(),S=window.cancelAnimationFrame(v)):S=window.requestAnimationFrame(v)}var y=t._fullLayout,x=[],_=c(e),b=Object.keys(_),w=f(y,b,_);if(!w.length)return!1;var M;u&&(M=u());var k,A,S,T=r.ease(n.easing);return t._transitionData._interruptCallbacks.push(function(){return window.cancelAnimationFrame(S),S=null,g()}),k=Date.now(),S=window.requestAnimationFrame(v),Promise.resolve()}},{"../../lib":316,"../../plotly":338,"../../registry":382,"./axes":343,d3:8}],362:[function(t,e,n){"use strict";function r(t,e,n){var r,i,a,o=!1;if("data"===e.type)r=t._fullData[null!==e.traces?e.traces[0]:0];else{if("layout"!==e.type)return!1;r=t._fullLayout}return i=u.nestedProperty(r,e.prop).get(),a=n[e.type]=n[e.type]||{},a.hasOwnProperty(e.prop)&&a[e.prop]!==i&&(o=!0),a[e.prop]=i,{changed:o,value:i}}function i(t,e){return Array.isArray(e[0])&&1===e[0].length&&"string"==typeof e[0][0]?[{type:"layout",prop:"_currentFrame",value:e[0][0]}]:[]}function a(t,e){var n=[],r=e[0],i={};if("string"==typeof r)i[r]=e[1];else{if(!u.isPlainObject(r))return n;i=r}return s(i,function(t,e,r){n.push({type:"layout",prop:t,value:r})},"",0),n}function o(t,e){var n,r,i,a,o=[];if(r=e[0],i=e[1],n=e[2],a={},"string"==typeof r)a[r]=i;else{if(!u.isPlainObject(r))return o;a=r,void 0===n&&(n=i)}return void 0===n&&(n=null),s(a,function(e,r,i){var a;if(Array.isArray(i)){var s=Math.min(i.length,t.data.length);n&&(s=Math.min(s,n.length)),a=[];for(var l=0;l0?".":"")+i;u.isPlainObject(a)?s(a,e,o,r+1):e(o,i,a)}})}var l=t("../plotly"),u=t("../lib");n.manageCommandObserver=function(t,e,i,a){var o={},s=!0;e&&e._commandObserver&&(o=e._commandObserver),o.cache||(o.cache={}),o.lookupTable={};var l=n.hasSimpleAPICommandBindings(t,i,o.lookupTable);if(e&&e._commandObserver){if(l)return o;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,o}if(l){r(t,l,o.cache),o.check=function(){if(s){var e=r(t,l,o.cache);return e.changed&&a&&void 0!==o.lookupTable[e.value]&&(o.disable(),Promise.resolve(a({value:e.value,type:l.type,prop:l.prop,traces:l.traces,index:o.lookupTable[e.value]})).then(o.enable,o.enable)),e.changed}};for(var c=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f0; }function a(t){var e={},n={};switch(t.type){case"circle":s.extendFlat(n,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":s.extendFlat(n,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity});break;case"fill":s.extendFlat(n,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var r=t.symbol,i=l(r.textposition,r.iconsize);s.extendFlat(e,{"icon-image":r.icon+"-15","icon-size":r.iconsize/10,"text-field":r.text,"text-size":r.textfont.size,"text-anchor":i.anchor,"text-offset":i.offset}),s.extendFlat(n,{"icon-color":t.color,"text-color":r.textfont.color,"text-opacity":t.opacity})}return{layout:e,paint:n}}function o(t){var e,n=t.sourcetype,r=t.source,i={type:n},a="string"==typeof r;return"geojson"===n?e="data":"vector"===n&&(e=a?"url":"tiles"),i[e]=r,i}var s=t("../../lib"),l=t("./convert_text_opts"),u=r.prototype;u.update=function(t){this.visible?this.needsNewSource(t)?(this.updateLayer(t),this.updateSource(t)):this.needsNewLayer(t)&&this.updateLayer(t):(this.updateSource(t),this.updateLayer(t)),this.updateStyle(t),this.visible=i(t)},u.needsNewSource=function(t){return this.sourceType!==t.sourcetype||this.source!==t.source||this.layerType!==t.type},u.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==t.below},u.updateSource=function(t){var e=this.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,i(t)){var n=o(t);e.addSource(this.idSource,n)}},u.updateLayer=function(t){var e=this.map;if(e.getLayer(this.idLayer)&&e.removeLayer(this.idLayer),this.layerType=t.type,i(t)){e.addLayer({id:this.idLayer,source:this.idSource,"source-layer":t.sourcelayer||"",type:t.type},t.below);var n={visibility:"visible"};this.mapbox.setOptions(this.idLayer,"setLayoutProperty",n)}},u.updateStyle=function(t){var e=a(t);i(t)&&(this.mapbox.setOptions(this.idLayer,"setLayoutProperty",e.layout),this.mapbox.setOptions(this.idLayer,"setPaintProperty",e.paint))},u.dispose=function(){var t=this.map;t.removeLayer(this.idLayer),t.removeSource(this.idSource)},e.exports=function(t,e,n){var i=new r(t,e);return i.update(n),i}},{"../../lib":316,"./convert_text_opts":367}],370:[function(t,e,n){"use strict";var r=t("../../lib"),i=t("../../components/color").defaultLine,a=t("../font_attributes"),o=t("../../traces/scatter/attributes").textposition;e.exports={domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],dflt:"basic"},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},layers:{_isLinkedToArray:"layer",sourcetype:{valType:"enumerated",values:["geojson","vector"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},type:{valType:"enumerated",values:["circle","line","fill","symbol"],dflt:"circle"},below:{valType:"string",dflt:""},color:{valType:"color",dflt:i},opacity:{valType:"number",min:0,max:1,dflt:1},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2}},fill:{outlinecolor:{valType:"color",dflt:i}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},textfont:r.extendDeep({},a,{family:{dflt:"Open Sans Regular, Arial Unicode MS Regular"}}),textposition:r.extendFlat({},o,{arrayOk:!1})}}}},{"../../components/color":223,"../../lib":316,"../../traces/scatter/attributes":393,"../font_attributes":363}],371:[function(t,e,n){"use strict";function r(t,e,n){n("accesstoken"),n("style"),n("center.lon"),n("center.lat"),n("zoom"),n("bearing"),n("pitch"),i(t,e),e._input=t}function i(t,e){function n(t,e){return a.coerce(r,i,s.layers,t,e)}for(var r,i,o=t.layers||[],l=e.layers=[],u=0;u=e.width-20?(a["text-anchor"]="start",a.x=5):(a["text-anchor"]="end",a.x=e._paper.attr("width")-7),n.attr(a);var o=n.select(".js-link-to-tool"),s=n.select(".js-link-spacer"),u=n.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&r(t,o),s.text(o.text()&&u.text()?" - ":"")},p.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",n=l.select(t).append("div").attr("id","hiddenform").style("display","none"),r=n.append("form").attr({action:e+"/external",method:"post",target:"_blank"}),i=r.append("input").attr({type:"text",name:"data"});return i.node().value=p.graphJson(t,!1,"keepdata"),r.node().submit(),n.remove(),t.emit("plotly_afterexport"),!1},p.supplyDefaults=function(t){var e,n=t._fullLayout||{},r=t._fullLayout={},a=t.layout||{},o=t._fullData||[],s=t._fullData=[],l=t.data||[];if(t._transitionData||p.createTransitionData(t),n._initialAutoSizeIsDone){var u=n.width,f=n.height;p.supplyLayoutGlobalDefaults(a,r),a.width||(r.width=u),a.height||(r.height=f)}else{p.supplyLayoutGlobalDefaults(a,r);var h=!a.width||!a.height,d=r.autosize,m=t._context&&t._context.autosizable,g=h&&(d||m);g?p.plotAutoSize(t,a,r):h&&p.sanitizeMargins(t),!d&&h&&(a.width=r.width,a.height=r.height)}r._initialAutoSizeIsDone=!0,r._dataLength=l.length,r._globalTransforms=(t._context||{}).globalTransforms,p.supplyDataDefaults(l,s,a,r),r._has=p._hasPlotType.bind(r);var v=r._modules;for(e=0;e0){var c=s(t._boundingBoxMargins),f=c.left+c.right,d=c.bottom+c.top,m=1-2*o,g=n._container&&n._container.node?n._container.node().getBoundingClientRect():{width:n.width,height:n.height};r=Math.round(m*(g.width-f)),i=Math.round(m*(g.height-d))}else{var v=l?window.getComputedStyle(t):{};r=parseFloat(v.width)||n.width,i=parseFloat(v.height)||n.height}var y=p.layoutAttributes.width.min,x=p.layoutAttributes.height.min;r1,b=!e.height&&Math.abs(n.height-i)>1;(b||_)&&(_&&(n.width=r),b&&(n.height=i)),t._initialAutoSize||(t._initialAutoSize={width:r,height:i}),p.sanitizeMargins(n)},p.supplyLayoutModuleDefaults=function(t,e,n,r){var i,a;c.Axes.supplyLayoutDefaults(t,e,n);var o=e._basePlotModules;for(i=0;i.5*r.width&&(n.l=n.r=0),n.b+n.t>.5*r.height&&(n.b=n.t=0),r._pushmargin[e]={l:{val:n.x,size:n.l+i},r:{val:n.x,size:n.r+i},b:{val:n.y,size:n.b+i},t:{val:n.y,size:n.t+i}}}else delete r._pushmargin[e];t._replotting||p.doAutoMargin(t)}},p.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var n=e._size,r=JSON.stringify(n),i=Math.max(e.margin.l||0,0),a=Math.max(e.margin.r||0,0),o=Math.max(e.margin.t||0,0),s=Math.max(e.margin.b||0,0),l=e._pushmargin;if(e.margin.autoexpand!==!1&&(l.base={l:{val:0,size:i},r:{val:1,size:a},t:{val:1,size:o},b:{val:0,size:s}},Object.keys(l).forEach(function(t){var n=l[t].l||{},r=l[t].b||{},c=n.val,f=n.size,h=r.val,d=r.size;Object.keys(l).forEach(function(t){if(u(f)&&l[t].r){var n=l[t].r.val,r=l[t].r.size;if(n>c){var p=(f*n+(r-e.width)*c)/(n-c),m=(r*(1-c)+(f-e.width)*(1-n))/(n-c);p>=0&&m>=0&&p+m>i+a&&(i=p,a=m)}}if(u(d)&&l[t].t){var g=l[t].t.val,v=l[t].t.size;if(g>h){var y=(d*g+(v-e.height)*h)/(g-h),x=(v*(1-h)+(d-e.height)*(1-g))/(g-h);y>=0&&x>=0&&y+x>s+o&&(s=y,o=x)}}})})),n.l=Math.round(i),n.r=Math.round(a),n.t=Math.round(o),n.b=Math.round(s),n.p=Math.round(e.margin.pad),n.w=Math.round(e.width)-n.l-n.r,n.h=Math.round(e.height)-n.t-n.b,!t._replotting&&"{}"!==r&&r!==JSON.stringify(e._size))return c.plot(t)},p.graphJson=function(t,e,n,r,i){function a(t){if("function"==typeof t)return null;if(h.isPlainObject(t)){var e,r,i={};for(e in t)if("function"!=typeof t[e]&&["_","["].indexOf(e.charAt(0))===-1){if("keepdata"===n){if("src"===e.substr(e.length-3))continue}else if("keepstream"===n){if(r=t[e+"src"],"string"==typeof r&&r.indexOf(":")>0&&!h.isPlainObject(t.stream))continue}else if("keepall"!==n&&(r=t[e+"src"],"string"==typeof r&&r.indexOf(":")>0))continue;i[e]=a(t[e])}return i}return Array.isArray(t)?t.map(a):h.isJSDate(t)?h.ms2DateTime(+t):t}(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&p.supplyDefaults(t);var o=i?t._fullData:t.data,s=i?t._fullLayout:t.layout,l={data:(o||[]).map(function(t){var n=a(t);return e&&delete n.fit,n})};return e||(l.layout=a(s)),t.framework&&t.framework.isPolar&&(l=t.framework.getConfig()),"object"===r?l:JSON.stringify(l)},p.modifyFrames=function(t,e){var n,r,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(n=0;n0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){b=!0}),i.redraw&&t._transitionData._interruptCallbacks.push(function(){return c.redraw(t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var o,s,l=0,u=0,d=t._fullLayout._basePlotModules,p=!1;if(n)for(s=0;s=0,E=z?f.angularAxis.domain:r.extent(k),L=Math.abs(k[1]-k[0]);S&&!A&&(L=0);var I=E.slice();T&&A&&(I[1]+=L);var D=f.angularAxis.ticksCount||4;D>8&&(D=D/(D/8)+D%8),f.angularAxis.ticksStep&&(D=(I[1]-I[0])/D);var P=f.angularAxis.ticksStep||(I[1]-I[0])/(D*(f.minorTicks+1));M&&(P=Math.max(Math.round(P),1)),I[2]||(I[2]=P);var C=r.range.apply(this,I);if(C=C.map(function(t,e){return parseFloat(t.toPrecision(12))}),s=r.scale.linear().domain(I.slice(0,2)).range("clockwise"===f.direction?[0,360]:[360,0]),c.layout.angularAxis.domain=s.domain(),c.layout.angularAxis.endPadding=T?L:0,e=r.select(this).select("svg.chart-root"),"undefined"==typeof e||e.empty()){var O="' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '",F=(new DOMParser).parseFromString(O,"application/xml"),R=this.appendChild(this.ownerDocument.importNode(F.documentElement,!0));e=r.select(R)}e.select(".guides-group").style({"pointer-events":"none"}),e.select(".angular.axis-group").style({"pointer-events":"none"}),e.select(".radial.axis-group").style({"pointer-events":"none"});var j,N=e.select(".chart-group"),B={fill:"none",stroke:f.tickColor},q={"font-size":f.font.size,"font-family":f.font.family,fill:f.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+f.font.outlineColor}).join(",")};if(f.showLegend){j=e.select(".legend-group").attr({transform:"translate("+[x,f.margin.top]+")"}).style({display:"block"});var V=d.map(function(t,e){var n=o.util.cloneJson(t);return n.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",n.visibleInLegend="undefined"==typeof t.visibleInLegend||t.visibleInLegend,n.color="LinePlot"===t.geometry?t.strokeColor:t.color,n});o.Legend().config({data:d.map(function(t,e){return t.name||"Element"+e}),legendConfig:a({},o.Legend.defaultConfig().legendConfig,{container:j,elements:V,reverseOrder:f.legend.reverseOrder})})();var U=j.node().getBBox();x=Math.min(f.width-U.width-f.margin.left-f.margin.right,f.height-f.margin.top-f.margin.bottom)/2,x=Math.max(10,x),b=[f.margin.left+x,f.margin.top+x],i.range([0,x]),c.layout.radialAxis.domain=i.domain(),j.attr("transform","translate("+[b[0]+x,b[1]-x]+")")}else j=e.select(".legend-group").style({display:"none"});e.attr({width:f.width,height:f.height}).style({opacity:f.opacity}),N.attr("transform","translate("+b+")").style({cursor:"crosshair"});var G=[(f.width-(f.margin.left+f.margin.right+2*x+(U?U.width:0)))/2,(f.height-(f.margin.top+f.margin.bottom+2*x))/2];if(G[0]=Math.max(0,G[0]),G[1]=Math.max(0,G[1]),e.select(".outer-group").attr("transform","translate("+G+")"),f.title){var H=e.select("g.title-group text").style(q).text(f.title),Z=H.node().getBBox();H.attr({x:b[0]-Z.width/2,y:b[1]-x-20})}var X=e.select(".radial.axis-group");if(f.radialAxis.gridLinesVisible){var Y=X.selectAll("circle.grid-circle").data(i.ticks(5));Y.enter().append("circle").attr({class:"grid-circle"}).style(B),Y.attr("r",i),Y.exit().remove()}X.select("circle.outside-circle").attr({r:x}).style(B);var W=e.select("circle.background-circle").attr({r:x}).style({fill:f.backgroundColor,stroke:f.stroke});if(f.radialAxis.visible){var Q=r.svg.axis().scale(i).ticks(5).tickSize(5);X.call(Q).attr({transform:"rotate("+f.radialAxis.orientation+")"}),X.selectAll(".domain").style(B),X.selectAll("g>text").text(function(t,e){return this.textContent+f.radialAxis.ticksSuffix}).style(q).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===f.radialAxis.tickOrientation?"rotate("+-f.radialAxis.orientation+") translate("+[0,q["font-size"]]+")":"translate("+[0,q["font-size"]]+")"}}),X.selectAll("g>line").style({stroke:"black"})}var J=e.select(".angular.axis-group").selectAll("g.angular-tick").data(C),$=J.enter().append("g").classed("angular-tick",!0);J.attr({transform:function(t,e){return"rotate("+l(t,e)+")"}}).style({display:f.angularAxis.visible?"block":"none"}),J.exit().remove(),$.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(f.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(f.minorTicks+1)==0)}).style(B),$.selectAll(".minor").style({stroke:f.minorTickColor}),J.select("line.grid-line").attr({x1:f.tickLength?x-f.tickLength:0,x2:x}).style({display:f.angularAxis.gridLinesVisible?"block":"none"}),$.append("text").classed("axis-text",!0).style(q);var K=J.select("text.axis-text").attr({x:x+f.labelOffset,dy:".35em",transform:function(t,e){var n=l(t,e),r=x+f.labelOffset,i=f.angularAxis.tickOrientation;return"horizontal"==i?"rotate("+-n+" "+r+" 0)":"radial"==i?n<270&&n>90?"rotate(180 "+r+" 0)":null:"rotate("+(n<=180&&n>0?-90:90)+" "+r+" 0)"}}).style({"text-anchor":"middle",display:f.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(f.minorTicks+1)!=0?"":M?M[t]+f.angularAxis.ticksSuffix:t+f.angularAxis.ticksSuffix}).style(q);f.angularAxis.rewriteTicks&&K.text(function(t,e){return e%(f.minorTicks+1)!=0?"":f.angularAxis.rewriteTicks(this.textContent,e)});var tt=r.max(N.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));j.attr({transform:"translate("+[x+tt,f.margin.top]+")"});var et=e.select("g.geometry-group").selectAll("g").size()>0,nt=e.select("g.geometry-group").selectAll("g.geometry").data(d);if(nt.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),nt.exit().remove(),d[0]||et){var rt=[];d.forEach(function(t,e){var n={};n.radialScale=i,n.angularScale=s,n.container=nt.filter(function(t,n){return n==e}),n.geometry=t.geometry,n.orientation=f.orientation,n.direction=f.direction,n.index=e,rt.push({data:t,geometryConfig:n})});var it=r.nest().key(function(t,e){return"undefined"!=typeof t.data.groupId||"unstacked"}).entries(rt),at=[];it.forEach(function(t,e){"unstacked"===t.key?at=at.concat(t.values.map(function(t,e){return[t]})):at.push(t.values)}),at.forEach(function(t,e){var n;n=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var r=t.map(function(t,e){return a(o[n].defaultConfig(),t)});o[n]().config(r)()})}var ot,st,lt=e.select(".guides-group"),ut=e.select(".tooltips-group"),ct=o.tooltipPanel().config({container:ut,fontSize:8})(),ft=o.tooltipPanel().config({container:ut,fontSize:8})(),ht=o.tooltipPanel().config({container:ut,hasTick:!0})();if(!A){var dt=lt.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});N.on("mousemove.angular-guide",function(t,e){var n=o.util.getMousePos(W).angle;dt.attr({x2:-x,transform:"rotate("+n+")"}).style({opacity:.5});var r=(n+180+360-f.orientation)%360;ot=s.invert(r);var i=o.util.convertToCartesian(x+12,n+180);ct.text(o.util.round(ot)).move([i[0]+b[0],i[1]+b[1]])}).on("mouseout.angular-guide",function(t,e){lt.select("line").style({opacity:0})})}var pt=lt.select("circle").style({stroke:"grey",fill:"none"});N.on("mousemove.radial-guide",function(t,e){var n=o.util.getMousePos(W).radius;pt.attr({r:n}).style({opacity:.5}),st=i.invert(o.util.getMousePos(W).radius);var r=o.util.convertToCartesian(n,f.radialAxis.orientation);ft.text(o.util.round(st)).move([r[0]+b[0],r[1]+b[1]])}).on("mouseout.radial-guide",function(t,e){pt.style({opacity:0}),ht.hide(),ct.hide(),ft.hide()}),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(t,n){var i=r.select(this),a=i.style("fill"),s="black",l=i.style("opacity")||1;if(i.attr({"data-opacity":l}),"none"!=a){i.attr({"data-fill":a}),s=r.hsl(a).darker().toString(),i.style({fill:s,opacity:1});var u={t:o.util.round(t[0]),r:o.util.round(t[1])};A&&(u.t=M[t[0]]);var c="t: "+u.t+", r: "+u.r,f=this.getBoundingClientRect(),h=e.node().getBoundingClientRect(),d=[f.left+f.width/2-G[0]-h.left,f.top+f.height/2-G[1]-h.top];ht.config({color:s}).text(c),ht.move(d)}else a=i.style("stroke"),i.attr({"data-stroke":a}),s=r.hsl(a).darker().toString(),i.style({stroke:s,opacity:1})}).on("mousemove.tooltip",function(t,e){return 0==r.event.which&&void(r.select(this).attr("data-fill")&&ht.show())}).on("mouseout.tooltip",function(t,e){ht.hide();var n=r.select(this),i=n.attr("data-fill");i?n.style({fill:i,opacity:n.attr("data-opacity")}):n.style({stroke:n.attr("data-stroke"),opacity:n.attr("data-opacity")})})}),h}var e,n,i,s,l={data:[],layout:{}},u={},c={},f=r.dispatch("hover"),h={};return h.render=function(e){return t(e),this},h.config=function(t){if(!arguments.length)return l;var e=o.util.cloneJson(t);return e.data.forEach(function(t,e){l.data[e]||(l.data[e]={}),a(l.data[e],o.Axis.defaultConfig().data[0]),a(l.data[e],t)}),a(l.layout,o.Axis.defaultConfig().layout),a(l.layout,e.layout),this},h.getLiveConfig=function(){return c},h.getinputConfig=function(){return u},h.radialScale=function(t){return i},h.angularScale=function(t){return s},h.svg=function(){return e},r.rebind(h,f,"on"),h},o.Axis.defaultConfig=function(t,e){var n={data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:r.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}};return n},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(t,e){for(var n in t)n in e&&(e[n]=t[n])},o.util._extend=function(t,e){for(var n in t)e[n]=t[n]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(t,e){var n=e||6,i=r.range(0,360+n,n).map(function(e,n){var r=e*Math.PI/180,i=t(r);return[e,i]});return i},o.util.dataFromEquation=function(t,e,n){var i=e||6,a=[],o=[];r.range(0,360+i,i).forEach(function(e,n){var r=e*Math.PI/180,i=t(r);a.push(e),o.push(i)});var s={t:a,r:o};return n&&(s.name=n),s},o.util.ensureArray=function(t,e){if("undefined"==typeof t)return null;var n=[].concat(t);return r.range(e).map(function(t,e){return n[e]||n[0]})},o.util.fillArrays=function(t,e,n){return e.forEach(function(e,r){t[e]=o.util.ensureArray(t[e],n)}),t},o.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},o.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var n=e.shift();return t[n]&&(!e.length||objHasKeys(t[n],e))},o.util.sumArrays=function(t,e){return r.zip(t,e).map(function(t,e){return r.sum(t)})},o.util.arrayLast=function(t){return t[t.length-1]},o.util.arrayEqual=function(t,e){for(var n=Math.max(t.length,e.length,1);n-- >=0&&t[n]===e[n];);return n===-2},o.util.flattenArray=function(t){for(var e=[];!o.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},o.util.deduplicate=function(t){return t.filter(function(t,e,n){return n.indexOf(t)==e})},o.util.convertToCartesian=function(t,e){var n=e*Math.PI/180,r=t*Math.cos(n),i=t*Math.sin(n);return[r,i]},o.util.round=function(t,e){var n=e||2,r=Math.pow(10,n);return Math.round(t*r)/r},o.util.getMousePos=function(t){var e=r.mouse(t.node()),n=e[0],i=e[1],a={};return a.x=n,a.y=i,a.pos=e,a.angle=180*(Math.atan2(i,n)+Math.PI)/Math.PI,a.radius=Math.sqrt(n*n+i*i),a},o.util.duplicatesCount=function(t){for(var e,n={},r={},i=0,a=t.length;i0)){var s=r.select(this.parentNode).selectAll("path.line").data([0]);s.enter().insert("path"),s.attr({class:"line",d:h(o),transform:function(e,n){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return g.fill(n,i,a)},"fill-opacity":0,stroke:function(t,e){return g.stroke(n,i,a)},"stroke-width":function(t,e){return g["stroke-width"](n,i,a)},"stroke-dasharray":function(t,e){return g["stroke-dasharray"](n,i,a)},opacity:function(t,e){return g.opacity(n,i,a)},display:function(t,e){return g.display(n,i,a)}})}};var d=t.angularScale.range(),p=Math.abs(d[1]-d[0])/l[0].length*Math.PI/180,m=r.svg.arc().startAngle(function(t){return-p/2}).endAngle(function(t){return p/2}).innerRadius(function(e){return t.radialScale(c+(e[2]||0))}).outerRadius(function(e){return t.radialScale(c+(e[2]||0))+t.radialScale(e[1])});f.arc=function(e,n,i){r.select(this).attr({class:"mark arc",d:m,transform:function(e,n){return"rotate("+(t.orientation+u(e[0])+90)+")"}})};var g={fill:function(t,n,r){return e[r].data.color},stroke:function(t,n,r){return e[r].data.strokeColor},"stroke-width":function(t,n,r){return e[r].data.strokeSize+"px"},"stroke-dasharray":function(t,n,r){return s[e[r].data.strokeDash]},opacity:function(t,n,r){return e[r].data.opacity},display:function(t,n,r){return"undefined"==typeof e[r].data.visible||e[r].data.visible?"block":"none"}},v=r.select(this).selectAll("g.layer").data(l);v.enter().append("g").attr({class:"layer"});var y=v.selectAll("path.mark").data(function(t,e){return t});y.enter().append("path").attr({class:"mark"}),y.style(g).each(f[t.geometryType]),y.exit().remove(),v.exit().remove()})}var e,n=[o.PolyChart.defaultConfig()],i=r.dispatch("hover"),s={solid:"none",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,e){n[e]||(n[e]={}),a(n[e],o.PolyChart.defaultConfig()),a(n[e],t)}),this):n},t.getColorScale=function(){return e},r.rebind(t,i,"on"),t},o.PolyChart.defaultConfig=function(){var t={data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:r.scale.category20()}};return t},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){var t={geometryConfig:{geometryType:"bar"}};return t},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){var t={geometryConfig:{geometryType:"arc"}};return t},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){var t={geometryConfig:{geometryType:"dot",dotType:"circle"}};return t},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){var t={geometryConfig:{geometryType:"line"}};return t},o.Legend=function(){function t(){var n=e.legendConfig,i=e.data.map(function(t,e){return[].concat(t).map(function(t,r){var i=a({},n.elements[e]);return i.name=t,i.color=[].concat(n.elements[e].color)[r],i})}),o=r.merge(i);o=o.filter(function(t,e){return n.elements[e]&&(n.elements[e].visibleInLegend||"undefined"==typeof n.elements[e].visibleInLegend)}),n.reverseOrder&&(o=o.reverse());var s=n.container;("string"==typeof s||s.nodeName)&&(s=r.select(s));var l=o.map(function(t,e){return t.color}),u=n.fontSize,c=null==n.isContinuous?"number"==typeof o[0]:n.isContinuous,f=c?n.height:u*o.length,h=s.classed("legend-group",!0),d=h.selectAll("svg").data([0]),p=d.enter().append("svg").attr({width:300,height:f+u,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});p.append("g").classed("legend-axis",!0),p.append("g").classed("legend-marks",!0);var m=r.range(o.length),g=r.scale[c?"linear":"ordinal"]().domain(m).range(l),v=r.scale[c?"linear":"ordinal"]().domain(m)[c?"range":"rangePoints"]([0,f]),y=function(t,e){var n=3*e;return"line"===t?"M"+[[-e/2,-e/12],[e/2,-e/12],[e/2,e/12],[-e/2,e/12]]+"Z":r.svg.symbolTypes.indexOf(t)!=-1?r.svg.symbol().type(t).size(n)():r.svg.symbol().type("square").size(n)()};if(c){var x=d.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);x.enter().append("stop"),x.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),d.append("rect").classed("legend-mark",!0).attr({height:n.height,width:n.colorBandWidth,fill:"url(#grad1)"})}else{var _=d.select(".legend-marks").selectAll("path.legend-mark").data(o);_.enter().append("path").classed("legend-mark",!0),_.attr({transform:function(t,e){return"translate("+[u/2,v(e)+u/2]+")"},d:function(t,e){var n=t.symbol;return y(n,u)},fill:function(t,e){return g(e)}}),_.exit().remove()}var b=r.svg.axis().scale(v).orient("right"),w=d.select("g.legend-axis").attr({transform:"translate("+[c?n.colorBandWidth:u,u/2]+")"}).call(b);return w.selectAll(".domain").style({fill:"none",stroke:"none"}),w.selectAll("line").style({fill:"none",stroke:c?n.textColor:"none"}),w.selectAll("text").style({fill:n.textColor,"font-size":n.fontSize}).text(function(t,e){return o[e].name}),t}var e=o.Legend.defaultConfig(),n=r.dispatch("hover");return t.config=function(t){return arguments.length?(a(e,t),this):e},r.rebind(t,n,"on"),t},o.Legend.defaultConfig=function(t,e){var n={data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}};return n},o.tooltipPanel=function(){var t,e,n,i={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},s="tooltip-"+o.tooltipPanel.uid++,l=10,u=function(){t=i.container.selectAll("g."+s).data([0]);var r=t.enter().append("g").classed(s,!0).style({"pointer-events":"none",display:"none"});return n=r.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=r.append("text").attr({dx:i.padding+l,dy:.3*+i.fontSize}),u};return u.text=function(a){var o=r.hsl(i.color).l,s=o>=.5?"#aaa":"white",c=o>=.5?"black":"white",f=a||"";e.style({fill:c,"font-size":i.fontSize+"px"}).text(f);var h=i.padding,d=e.node().getBBox(),p={fill:i.color,stroke:s,"stroke-width":"2px"},m=d.width+2*h+l,g=d.height+2*h;return n.attr({d:"M"+[[l,-g/2],[l,-g/4],[i.hasTick?0:l,0],[l,g/4],[l,g/2],[m,g/2],[m,-g/2]].join("L")+"Z"}).style(p),t.attr({transform:"translate("+[l,-g/2+2*h]+")"}),t.style({display:"block"}),u},u.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),u},u.hide=function(){if(t)return t.style({display:"none"}),u},u.show=function(){if(t)return t.style({display:"block"}),u},u.config=function(t){return a(i,t),u},u},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var t={};return t.convert=function(t,e){var n={};if(t.data&&(n.data=t.data.map(function(t,n){var r=a({},t),i=[[r,["marker","color"],["color"]],[r,["marker","opacity"],["opacity"]],[r,["marker","line","color"],["strokeColor"]],[r,["marker","line","dash"],["strokeDash"]],[r,["marker","line","width"],["strokeSize"]],[r,["marker","symbol"],["dotType"]],[r,["marker","size"],["dotSize"]],[r,["marker","barWidth"],["barWidth"]],[r,["line","interpolation"],["lineInterpolation"]],[r,["showlegend"],["visibleInLegend"]]];return i.forEach(function(t,n){o.util.translator.apply(null,t.concat(e))}),e||delete r.marker,e&&delete r.groupId,e?("LinePlot"===r.geometry?(r.type="scatter",r.dotVisible===!0?(delete r.dotVisible,r.mode="lines+markers"):r.mode="lines"):"DotPlot"===r.geometry?(r.type="scatter",r.mode="markers"):"AreaChart"===r.geometry?r.type="area":"BarChart"===r.geometry&&(r.type="bar"),delete r.geometry):("scatter"===r.type?"lines"===r.mode?r.geometry="LinePlot":"markers"===r.mode?r.geometry="DotPlot":"lines+markers"===r.mode&&(r.geometry="LinePlot",r.dotVisible=!0):"area"===r.type?r.geometry="AreaChart":"bar"===r.type&&(r.geometry="BarChart"),delete r.mode,delete r.type),r}),!e&&t.layout&&"stack"===t.layout.barmode)){var i=o.util.duplicates(n.data.map(function(t,e){return t.geometry}));n.data.forEach(function(t,e){var r=i.indexOf(t.geometry);r!=-1&&(n.data[e].groupId=r)})}if(t.layout){var s=a({},t.layout),l=[[s,["plot_bgcolor"],["backgroundColor"]],[s,["showlegend"],["showLegend"]],[s,["radialaxis"],["radialAxis"]],[s,["angularaxis"],["angularAxis"]],[s.angularaxis,["showline"],["gridLinesVisible"]],[s.angularaxis,["showticklabels"],["labelsVisible"]],[s.angularaxis,["nticks"],["ticksCount"]],[s.angularaxis,["tickorientation"],["tickOrientation"]],[s.angularaxis,["ticksuffix"],["ticksSuffix"]],[s.angularaxis,["range"],["domain"]],[s.angularaxis,["endpadding"],["endPadding"]],[s.radialaxis,["showline"],["gridLinesVisible"]],[s.radialaxis,["tickorientation"],["tickOrientation"]],[s.radialaxis,["ticksuffix"],["ticksSuffix"]],[s.radialaxis,["range"],["domain"]],[s.angularAxis,["showline"],["gridLinesVisible"]],[s.angularAxis,["showticklabels"],["labelsVisible"]],[s.angularAxis,["nticks"],["ticksCount"]],[s.angularAxis,["tickorientation"],["tickOrientation"]],[s.angularAxis,["ticksuffix"],["ticksSuffix"]],[s.angularAxis,["range"],["domain"]],[s.angularAxis,["endpadding"],["endPadding"]],[s.radialAxis,["showline"],["gridLinesVisible"]],[s.radialAxis,["tickorientation"],["tickOrientation"]],[s.radialAxis,["ticksuffix"],["ticksSuffix"]],[s.radialAxis,["range"],["domain"]],[s.font,["outlinecolor"],["outlineColor"]],[s.legend,["traceorder"],["reverseOrder"]],[s,["labeloffset"],["labelOffset"]],[s,["defaultcolorrange"],["defaultColorRange"]]];if(l.forEach(function(t,n){o.util.translator.apply(null,t.concat(e))}),e?("undefined"!=typeof s.tickLength&&(s.angularaxis.ticklen=s.tickLength,delete s.tickLength),s.tickColor&&(s.angularaxis.tickcolor=s.tickColor,delete s.tickColor)):(s.angularAxis&&"undefined"!=typeof s.angularAxis.ticklen&&(s.tickLength=s.angularAxis.ticklen),s.angularAxis&&"undefined"!=typeof s.angularAxis.tickcolor&&(s.tickColor=s.angularAxis.tickcolor)),s.legend&&"boolean"!=typeof s.legend.reverseOrder&&(s.legend.reverseOrder="normal"!=s.legend.reverseOrder),s.legend&&"boolean"==typeof s.legend.traceorder&&(s.legend.traceorder=s.legend.traceorder?"reversed":"normal",delete s.legend.reverseOrder),s.margin&&"undefined"!=typeof s.margin.t){var u=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],f={};r.entries(s.margin).forEach(function(t,e){f[c[u.indexOf(t.key)]]=t.value}),s.margin=f}e&&(delete s.needsEndSpacing,delete s.minorTickColor,delete s.minorTicks,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksStep,delete s.angularaxis.rewriteTicks,delete s.angularaxis.nticks,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksStep,delete s.radialaxis.rewriteTicks,delete s.radialaxis.nticks),n.layout=s}return n},t}},{"../../lib":316,d3:8}],379:[function(t,e,n){"use strict";var r=t("d3"),i=t("../../lib"),a=t("../../components/color"),o=t("./micropolar"),s=t("./undo_manager"),l=i.extendDeepAll,u=e.exports={};u.framework=function(t){function e(e,i){return i&&(f=i),r.select(r.select(f).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),n=n?l(n,e):e,a||(a=o.Axis()),c=o.adapter.plotly().convert(n),a.config(c).render(f),t.data=n.data,t.layout=n.layout,u.fillLayout(t),n}var n,i,a,c,f,h=new s;return e.isPolar=!0,e.svg=function(){return a.svg()},e.getConfig=function(){return n},e.getLiveConfig=function(){return o.adapter.plotly().convert(a.getLiveConfig(),!0)},e.getLiveScales=function(){return{t:a.angularScale(),r:a.radialScale()}},e.setUndoPoint=function(){var t=this,e=o.util.cloneJson(n);!function(e,n){h.add({undo:function(){n&&t(n)},redo:function(){t(e)}})}(e,i),i=o.util.cloneJson(e)},e.undo=function(){h.undo()},e.redo=function(){h.redo()},e},u.fillLayout=function(t){var e=r.select(t).selectAll(".plot-container"),n=e.selectAll(".svg-container"),i=t.framework&&t.framework.svg&&t.framework.svg(),o={width:800,height:600,paper_bgcolor:a.background,_container:e,_paperdiv:n,_paper:i};t._fullLayout=l(o,t.layout)}},{"../../components/color":223,"../../lib":316,"./micropolar":378,"./undo_manager":380,d3:8}],380:[function(t,e,n){"use strict";e.exports=function(){function t(t,e){return t?(i=!0,t[e](),i=!1,this):this}var e,n=[],r=-1,i=!1;return{add:function(t){return i?this:(n.splice(r+1,n.length-r),n.push(t),r=n.length-1,this)},setCallback:function(t){e=t},undo:function(){var i=n[r];return i?(t(i,"undo"),r-=1,e&&e(i.undo),this):this},redo:function(){var i=n[r+1];return i?(t(i,"redo"),r+=1,e&&e(i.redo),this):this},clear:function(){n=[],r=-1},hasUndo:function(){return r!==-1},hasRedo:function(){return r-1}var a=t("../lib"),o=t("../plots/plots"),s=a.extendFlat,l=a.extendDeep;e.exports=function(t,e){t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var n,a=t.data,u=t.layout,c=l([],a),f=l({},u,r(e.tileClass));if(e.width&&(f.width=e.width),e.height&&(f.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){f.annotations=[];var h=Object.keys(f);for(n=0;np&&h.splice(p,h.length-p),d.length>p&&d.splice(p,d.length-p);var m={padded:!0},g={padded:!0};if(o.hasMarkers(e)){if(n=e.marker,l=n.size,Array.isArray(l)){var v={type:"linear"};i.setConvert(v),l=v.makeCalcdata(e.marker,"size"),l.length>p&&l.splice(p,l.length-p)}var y,x=1.6*(e.marker.sizeref||1);y="area"===e.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/x),3)}:function(t){return Math.max((t||0)/x,3)},m.ppad=g.ppad=Array.isArray(l)?l.map(y):y(l)}s(e),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||h[0]===h[p-1]&&d[0]===d[p-1]?e.error_y.visible||["tonexty","tozeroy"].indexOf(e.fill)===-1&&(o.hasMarkers(e)||o.hasText(e))||(m.padded=!1,m.ppad=0):m.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||h[0]===h[p-1]&&d[0]===d[p-1]?["tonextx","tozerox"].indexOf(e.fill)!==-1&&(g.padded=!1):g.tozero=!0,i.expand(c,h,m),i.expand(f,d,g);var _=new Array(p);for(u=0;u=0;i--){var a=t[i];if("scatter"===a.type&&a.xaxis===n.xaxis&&a.yaxis===n.yaxis){a.opacity=void 0;break}}}}}},{}],396:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../components/colorscale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var n=e[0].trace,l=n.marker,u="cb"+n.uid;if(t._fullLayout._infolayer.selectAll("."+u).remove(),void 0===l||!l.showscale)return void a.autoMargin(t,u);var c=l.color,f=l.cmin,h=l.cmax;r(f)||(f=i.aggNums(Math.min,null,c)),r(h)||(h=i.aggNums(Math.max,null,c));var d=e[0].t.cb=s(t,u),p=o.makeColorScaleFunc(o.extractScale(l.colorscale,f,h),{noNumericCheck:!0});d.fillcolor(p).filllevels({start:f,end:h,size:(h-f)/254}).options(l.colorbar)()}},{"../../components/colorbar/draw":226,"../../components/colorscale":237,"../../lib":316,"../../plots/plots":374,"fast-isnumeric":12}],397:[function(t,e,n){"use strict";var r=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/calc"),a=t("./subtypes");e.exports=function(t){a.hasLines(t)&&r(t,"line")&&i(t,t.line.color,"line","c"),a.hasMarkers(t)&&(r(t,"marker")&&i(t,t.marker.color,"marker","c"),r(t,"marker.line")&&i(t,t.marker.line.color,"marker.line","c"))}},{"../../components/colorscale/calc":229,"../../components/colorscale/has_colorscale":236,"./subtypes":413}],398:[function(t,e,n){"use strict";e.exports={PTS_LINESONLY:20}},{}],399:[function(t,e,n){"use strict";var r=t("../../lib"),i=t("./attributes"),a=t("./constants"),o=t("./subtypes"),s=t("./xy_defaults"),l=t("./marker_defaults"),u=t("./line_defaults"),c=t("./line_shape_defaults"),f=t("./text_defaults"),h=t("./fillcolor_defaults"),d=t("../../components/errorbars/defaults");e.exports=function(t,e,n,p){function m(n,a){return r.coerce(t,e,i,n,a)}var g=s(t,e,m),v=gq!=P>=q&&(L=z[S-1][0],I=z[S][0],E=L+(I-L)*(q-D)/(P-D),R=Math.min(R,E),j=Math.max(j,E));R=Math.max(R,0),j=Math.min(j,h._length);var V=l.defaultLine;return l.opacity(f.fillcolor)?V=f.fillcolor:l.opacity((f.line||{}).color)&&(V=f.line.color),r.extendFlat(t,{distance:a.MAXDIST+10,x0:R,x1:j,y0:q,y1:q,color:V}),delete t.index,f.text&&!Array.isArray(f.text)?t.text=String(f.text):t.text=f.name,[t]}}}},{"../../components/color":223,"../../components/errorbars":252,"../../lib":316,"../../plots/cartesian/constants":348,"../../plots/cartesian/graph_interact":350,"./get_trace_color":401}],403:[function(t,e,n){"use strict";var r={},i=t("./subtypes");r.hasLines=i.hasLines,r.hasMarkers=i.hasMarkers,r.hasText=i.hasText,r.isBubble=i.isBubble,r.attributes=t("./attributes"),r.supplyDefaults=t("./defaults"),r.cleanData=t("./clean_data"),r.calc=t("./calc"),r.arraysToCalcdata=t("./arrays_to_calcdata"),r.plot=t("./plot"),r.colorbar=t("./colorbar"),r.style=t("./style"),r.hoverPoints=t("./hover"),r.selectPoints=t("./select"),r.animatable=!0,r.moduleType="trace",r.name="scatter",r.basePlotModule=t("../../plots/cartesian"),r.categories=["cartesian","symbols","markerColorscale","errorBarsOK","showLegend"],r.meta={},e.exports=r},{"../../plots/cartesian":351,"./arrays_to_calcdata":392,"./attributes":393,"./calc":394,"./clean_data":395,"./colorbar":396,"./defaults":399,"./hover":402,"./plot":410,"./select":411,"./style":412,"./subtypes":413}],404:[function(t,e,n){"use strict";var r=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/defaults");e.exports=function(t,e,n,a,o){var s=(t.marker||{}).color;if(o("line.color",n),r(t,"line"))i(t,e,a,o,{prefix:"line.",cLetter:"c"});else{var l=!Array.isArray(s)&&s||n;o("line.color",l)}o("line.width"),o("line.dash")}},{"../../components/colorscale/defaults":232,"../../components/colorscale/has_colorscale":236}],405:[function(t,e,n){"use strict";var r=t("../../constants/numerical").BADNUM;e.exports=function(t,e){function n(e){var n=w.c2p(t[e].x),i=M.c2p(t[e].y);return n!==r&&i!==r&&[n,i]}function i(t){var e=t[0]/w._length,n=t[1]/M._length;return(1+10*Math.max(0,-e,e-1,-n,n-1))*S}function a(t,e){var n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)}var o,s,l,u,c,f,h,d,p,m,g,v,y,x,_,b,w=e.xaxis,M=e.yaxis,k=e.simplify,A=e.connectGaps,S=e.baseTolerance,T=e.linear,z=[],E=.2,L=new Array(t.length),I=0;for(k||(S=E=-1),o=0;oi(f))break;l=f,y=m[0]*p[0]+m[1]*p[1],y>g?(g=y,u=f,d=!1):y=t.length||!f)break;L[I++]=f,s=f}}else L[I++]=u}z.push(L.slice(0,I))}return z}},{"../../constants/numerical":303}],406:[function(t,e,n){"use strict";e.exports=function(t,e,n){var r=n("line.shape");"spline"===r&&n("line.smoothing")}},{}],407:[function(t,e,n){"use strict";e.exports=function(t,e,n){for(var r,i,a=null,o=0;o0?Math.max(e,i):0}}},{"fast-isnumeric":12}],409:[function(t,e,n){"use strict";var r=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,n,s,l){var u,c=o.isBubble(t),f=(t.line||{}).color;f&&(n=f),l("marker.symbol"),l("marker.opacity",c?.7:1),l("marker.size"),l("marker.color",n),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),u=f&&!Array.isArray(f)&&e.marker.color!==f?f:c?r.background:r.defaultLine,l("marker.line.color",u),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",c?1:0),c&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode"))}},{"../../components/color":223,"../../components/colorscale/defaults":232,"../../components/colorscale/has_colorscale":236,"./subtypes":413}],410:[function(t,e,n){"use strict";function r(t,e){var n;e.selectAll("g.trace").each(function(t){var e=o.select(this);if(n=t[0].trace,n._nexttrace){if(n._nextFill=e.select(".js-fill.js-tonext"),!n._nextFill.size()){var r=":first-child";e.select(".js-fill.js-tozero").size()&&(r+=" + *"),n._nextFill=e.insert("path",r).attr("class","js-fill js-tonext")}}else e.selectAll(".js-fill.js-tonext").remove(),n._nextFill=null;n.fill&&("tozero"===n.fill.substr(0,6)||"toself"===n.fill||"to"===n.fill.substr(0,2)&&!n._prevtrace)?(n._ownFill=e.select(".js-fill.js-tozero"),n._ownFill.size()||(n._ownFill=e.insert("path",":first-child").attr("class","js-fill js-tozero"))):(e.selectAll(".js-fill.js-tozero").remove(),n._ownFill=null)})}function i(t,e,n,r,i,d,m){function g(t){return k?t.transition():t}function v(t){return t.filter(function(t){return t.vis})}function y(t){return t.id}function x(t){if(t.ids)return y}function _(){return!1}function b(t){var e,n,r=t[0].trace,i=o.select(this),a=c.hasMarkers(r),u=c.hasText(r),f=x(r),h=_,d=_;a&&(h=r.marker.maxdisplayed?v:s.identity),u&&(d=r.marker.maxdisplayed?v:s.identity),n=i.selectAll("path.point"),e=n.data(h,f);var p=e.enter().append("path").classed("point",!0);p.call(l.pointStyle,r).call(l.translatePoints,A,S,r),k&&p.style("opacity",0).transition().style("opacity",1),e.each(function(t){var e=g(o.select(this));l.translatePoint(t,e,A,S),l.singlePointStyle(t,e,r)}),k?e.exit().transition().style("opacity",0).remove():e.exit().remove(),n=i.selectAll("g"),e=n.data(d,f),e.enter().append("g").append("text"),e.each(function(t){var e=g(o.select(this).select("text"));l.translatePoint(t,e,A,S)}),e.selectAll("text").call(l.textPointStyle,r).each(function(t){var e=t.xp||A.c2p(t.x),n=t.yp||S.c2p(t.y);o.select(this).selectAll("tspan").each(function(){g(o.select(this)).attr({x:e,y:n})})}),e.exit().remove()}var w,M;a(t,e,n,r,i);var k=!!m&&m.duration>0,A=n.xaxis,S=n.yaxis,T=r[0].trace,z=T.line,E=o.select(d);if(E.call(u.plot,n,m),T.visible===!0){g(E).style("opacity",T.opacity);var L,I,D=T.fill.charAt(T.fill.length-1);"x"!==D&&"y"!==D&&(D=""),r[0].node3=E,f(r);var P="",C=[],O=T._prevtrace;O&&(P=O._prevRevpath||"",I=O._nextFill,C=O._polygons);var F,R,j,N,B,q,V,U,G,H="",Z="",X=[],Y=[],W=s.noop;if(L=T._ownFill,c.hasLines(T)||"none"!==T.fill){for(I&&I.datum(r),["hv","vh","hvh","vhv"].indexOf(z.shape)!==-1?(j=l.steps(z.shape),N=l.steps(z.shape.split("").reverse().join(""))):j=N="spline"===z.shape?function(t){var e=t[t.length-1];return t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),z.smoothing):l.smoothopen(t,z.smoothing)}:function(t){return"M"+t.join("L")},B=function(t){return N(t.reverse())},X=h(r,{xaxis:A,yaxis:S,connectGaps:T.connectgaps,baseTolerance:Math.max(z.width||1,3)/4,linear:"linear"===z.shape,simplify:z.simplify}),G=T._polygons=new Array(X.length),M=0;M1}),W=function(t){return function(e){if(F=j(e),R=B(e),H?D?(H+="L"+F.substr(1),Z=R+("L"+Z.substr(1))):(H+="Z"+F,Z=R+"Z"+Z):(H=F,Z=R),c.hasLines(T)&&e.length>1){var n=o.select(this);if(n.datum(r),t)g(n.style("opacity",0).attr("d",F).call(l.lineGroupStyle)).style("opacity",1);else{var i=g(n);i.attr("d",F),l.singleLineStyle(r,i)}}}}}var Q=E.selectAll(".js-line").data(Y);g(Q.exit()).style("opacity",0).remove(),Q.each(W(!1)),Q.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(W(!0)),X.length&&(L?q&&U&&(D?("y"===D?q[1]=U[1]=S.c2p(0,!0):"x"===D&&(q[0]=U[0]=A.c2p(0,!0)),g(L).attr("d","M"+U+"L"+q+"L"+H.substr(1))):g(L).attr("d",H+"Z")):"tonext"===T.fill.substr(0,6)&&H&&P&&("tonext"===T.fill?g(I).attr("d",H+"Z"+P+"Z"):g(I).attr("d",H+"L"+P.substr(1)+"Z"),T._polygons=T._polygons.concat(C)),T._prevRevpath=Z,T._prevPolygons=G);var J=E.selectAll(".points");w=J.data([r]),J.each(b),w.enter().append("g").classed("points",!0).each(b),w.exit().remove()}}function a(t,e,n,r,i){var a=n.xaxis,s=n.yaxis,l=o.extent(a.range.map(a.r2l).map(a.l2c)),u=o.extent(s.range.map(s.r2l).map(s.l2c)),f=r[0].trace;if(c.hasMarkers(f)){var h=f.marker.maxdisplayed;if(0!==h){var d=r.filter(function(t){return t.x>=l[0]&&t.x<=l[1]&&t.y>=u[0]&&t.y<=u[1]}),p=Math.ceil(d.length/h),m=0;i.forEach(function(t,n){var r=t[0].trace;c.hasMarkers(r)&&r.marker.maxdisplayed>0&&n0;for(c=p.selectAll("g.trace"),f=c.data(n,function(t){return t[0].trace.uid}),f.enter().append("g").attr("class",function(t){return"trace scatter trace"+t[0].trace.uid}).style("stroke-miterlimit",2),d(t,e,n),r(t,p),l=0,u=[];lr?1:-1}),g){s&&(h=s());var v=o.transition().duration(a.duration).ease(a.easing).each("end",function(){h&&h()}).each("interrupt",function(){h&&h()});v.each(function(){p.selectAll("g.trace").each(function(r,o){i(t,o,e,r,n,this,a)})})}else p.selectAll("g.trace").each(function(r,o){i(t,o,e,r,n,this,a)});m&&f.exit().remove(),p.selectAll("path:not([d])").remove()}},{"../../components/drawing":246,"../../components/errorbars":252,"../../lib":316,"../../lib/polygon":323,"./arrays_to_calcdata":392,"./line_points":405,"./link_traces":407,"./subtypes":413,d3:8}],411:[function(t,e,n){"use strict";var r=t("./subtypes"),i=.2;e.exports=function(t,e){var n,a,o,s,l=t.cd,u=t.xaxis,c=t.yaxis,f=[],h=l[0].trace,d=h.index,p=h.marker,m=!r.hasMarkers(h)&&!r.hasText(h);if(h.visible===!0&&!m){var g=Array.isArray(p.opacity)?1:p.opacity;if(e===!1)for(n=0;n0&&(v[y-1].gapAfter=!0)}return v}},{"../../components/colorscale":237,"../../lib":316,"../scatter/colorscale_calc":397,"../scatter/make_bubble_size_func":408,"../scatter/subtypes":413,"fast-isnumeric":12}],419:[function(t,e,n){"use strict";function r(){return{geojson:f.makeBlank(),layout:{visibility:"none"},paint:{}}}function i(t,e){function n(t,n,r,i){void 0===e[n][r]&&(e[n][r]=i),t[n]=e[n][r]}for(var r=t[0].trace,i=r.marker,a=Array.isArray(i.color),o=Array.isArray(i.size),s=[],l=0;l")}var i=t("../../plots/cartesian/graph_interact"),a=t("../scatter/get_trace_color");e.exports=function(t,e,n){function o(t){var e=t.lonlat,r=Math.abs(u.c2p(e)-u.c2p([d,e[1]])),i=Math.abs(c.c2p(e)-c.c2p([e[0],n])),a=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(r*r+i*i)-a,1-3/a)}var s=t.cd,l=s[0].trace,u=t.xa,c=t.ya;if(!s[0].placeholder){var f=e>=0?Math.floor((e+180)/360):Math.ceil((e-180)/360),h=360*f,d=e-h;if(i.getClosest(s,o,t),t.index!==!1){var p=s[t.index],m=p.lonlat,g=[m[0]+h,m[1]],v=u.c2p(g),y=c.c2p(g),x=p.mrc||1;return t.x0=v-x,t.x1=v+x,t.y0=y-x,t.y1=y+x,t.color=a(l,p),t.extraText=r(l,p),[t]}}}},{"../../plots/cartesian/graph_interact":350,"../scatter/get_trace_color":401}],423:[function(t,e,n){"use strict";var r={};r.attributes=t("./attributes"),r.supplyDefaults=t("./defaults"),r.colorbar=t("../scatter/colorbar"),r.calc=t("./calc"),r.hoverPoints=t("./hover"),r.eventData=t("./event_data"),r.plot=t("./plot"),r.moduleType="trace",r.name="scattermapbox",r.basePlotModule=t("../../plots/mapbox"),r.categories=["mapbox","gl","symbols","markerColorscale","showLegend"],r.meta={},e.exports=r},{"../../plots/mapbox":368,"../scatter/colorbar":396,"./attributes":417,"./calc":418,"./defaults":420,"./event_data":421,"./hover":422,"./plot":424}],424:[function(t,e,n){"use strict";function r(t,e){this.mapbox=t,this.map=t.map,this.uid=e,this.idSourceFill=e+"-source-fill",this.idSourceLine=e+"-source-line",this.idSourceCircle=e+"-source-circle",this.idSourceSymbol=e+"-source-symbol",this.idLayerFill=e+"-layer-fill",this.idLayerLine=e+"-layer-line",this.idLayerCircle=e+"-layer-circle",this.idLayerSymbol=e+"-layer-symbol",this.mapbox.initSource(this.idSourceFill),this.mapbox.initSource(this.idSourceLine),this.mapbox.initSource(this.idSourceCircle),this.mapbox.initSource(this.idSourceSymbol),this.map.addLayer({id:this.idLayerFill,source:this.idSourceFill,type:"fill"}),this.map.addLayer({id:this.idLayerLine,source:this.idSourceLine,type:"line"}),this.map.addLayer({id:this.idLayerCircle,source:this.idSourceCircle,type:"circle"}),this.map.addLayer({id:this.idLayerSymbol,source:this.idSourceSymbol,type:"symbol"})}function i(t){return"visible"===t.layout.visibility}var a=t("./convert"),o=r.prototype;o.update=function(t){var e=this.mapbox,n=a(t);e.setOptions(this.idLayerFill,"setLayoutProperty",n.fill.layout),e.setOptions(this.idLayerLine,"setLayoutProperty",n.line.layout),e.setOptions(this.idLayerCircle,"setLayoutProperty",n.circle.layout),e.setOptions(this.idLayerSymbol,"setLayoutProperty",n.symbol.layout),i(n.fill)&&(e.setSourceData(this.idSourceFill,n.fill.geojson),e.setOptions(this.idLayerFill,"setPaintProperty",n.fill.paint)),i(n.line)&&(e.setSourceData(this.idSourceLine,n.line.geojson),e.setOptions(this.idLayerLine,"setPaintProperty",n.line.paint)),i(n.circle)&&(e.setSourceData(this.idSourceCircle,n.circle.geojson),e.setOptions(this.idLayerCircle,"setPaintProperty",n.circle.paint)),i(n.symbol)&&(e.setSourceData(this.idSourceSymbol,n.symbol.geojson),e.setOptions(this.idLayerSymbol,"setPaintProperty",n.symbol.paint))},o.dispose=function(){var t=this.map;t.removeLayer(this.idLayerFill),t.removeLayer(this.idLayerLine),t.removeLayer(this.idLayerCircle),t.removeLayer(this.idLayerSymbol),t.removeSource(this.idSourceFill),t.removeSource(this.idSourceLine),t.removeSource(this.idSourceCircle),t.removeSource(this.idSourceSymbol)},e.exports=function(t,e){var n=e[0].trace,i=new r(t,n.uid);return i.update(e),i}},{"./convert":419}]},{},[4])(4)});