diff --git a/app/Http/Controllers/IndieAuthController.php b/app/Http/Controllers/IndieAuthController.php index a2c0f0e1..a66becca 100644 --- a/app/Http/Controllers/IndieAuthController.php +++ b/app/Http/Controllers/IndieAuthController.php @@ -4,7 +4,6 @@ namespace App\Http\Controllers; use IndieAuth\Client; use Illuminate\Http\Request; -use Illuminate\Http\Response; use App\Services\TokenService; use Illuminate\Cookie\CookieJar; use App\Services\IndieAuthService; @@ -52,7 +51,7 @@ class IndieAuthController extends Controller * @param \Illuminate\Http\Request $request * @return \Illuminate\Routing\RedirectResponse redirect */ - public function beginauth(Request $request) + public function start(Request $request) { $authorizationEndpoint = $this->indieAuthService->getAuthorizationEndpoint( $request->input('me'), @@ -69,7 +68,7 @@ class IndieAuthController extends Controller } } - return redirect('/notes/new')->withErrors('Unable to determine authorisation endpoint', 'indieauth'); + return redirect(route('micropub-client'))->withErrors('Unable to determine authorisation endpoint', 'indieauth'); } /** @@ -79,23 +78,24 @@ class IndieAuthController extends Controller * @param \Illuminate\Http\Rrequest $request * @return \Illuminate\Routing\RedirectResponse redirect */ - public function indieauth(Request $request) + public function callback(Request $request) { if ($request->session()->get('state') != $request->input('state')) { - return redirect('/notes/new')->withErrors( + return redirect(route('micropub-client'))->withErrors( 'Invalid state value returned from indieauth server', 'indieauth' ); } $tokenEndpoint = $this->indieAuthService->getTokenEndpoint($request->input('me'), $this->client); - $redirectURL = config('app.url') . '/indieauth'; - $clientId = config('app.url') . '/notes/new'; + if ($tokenEndpoint === false) { + return redirect(route('micropub-client'))->withErrors('Unable to determine token endpoint', 'indieauth'); + } $data = [ 'endpoint' => $tokenEndpoint, 'code' => $request->input('code'), 'me' => $request->input('me'), - 'redirect_url' => $redirectURL, - 'client_id' => $clientId, + 'redirect_url' => route('indieauth-callback'), + 'client_id' => route('micropub-client'), 'state' => $request->input('state'), ]; $token = $this->indieAuthService->getAccessToken($data, $this->client); @@ -104,10 +104,22 @@ class IndieAuthController extends Controller $request->session()->put('me', $token['me']); $request->session()->put('token', $token['access_token']); - return redirect('/notes/new'); + return redirect(route('micropub-client')); } - return redirect('/notes/new')->withErrors('Unable to get a token from the endpoint', 'indieauth'); + return redirect(route('micropub-client'))->withErrors('Unable to get a token from the endpoint', 'indieauth'); + } + + /** + * Log out the user, flush an session data, and overwrite any cookie data. + * + * @return \Illuminate\Routing\RedirectResponse redirect + */ + public function logout(Request $request) + { + $request->session()->flush(); + + return redirect(route('micropub-client'))->cookie('me', 'loggedout', 1); } /** @@ -140,25 +152,11 @@ class IndieAuthController extends Controller 'access_token' => $token, ]); - return (new Response($content, 200)) - ->header('Content-Type', 'application/x-www-form-urlencoded'); + return response($content) + ->header('Content-Type', 'application/x-www-form-urlencoded'); } $content = 'There was an error verifying the authorisation code.'; - return new Response($content, 400); - } - - /** - * Log out the user, flush an session data, and overwrite any cookie data. - * - * @param \Illuminate\Cookie\CookieJar $cookie - * @return \Illuminate\Routing\RedirectResponse redirect - */ - public function indieauthLogout(Request $request, CookieJar $cookie) - { - $request->session()->flush(); - $cookie->queue('me', 'loggedout', 5); - - return redirect('/notes/new'); + return response($content, 400); } } diff --git a/app/Http/Controllers/MicropubClientController.php b/app/Http/Controllers/MicropubClientController.php index 665cd45f..25336aa1 100644 --- a/app/Http/Controllers/MicropubClientController.php +++ b/app/Http/Controllers/MicropubClientController.php @@ -193,7 +193,7 @@ class MicropubClientController extends Controller * @param \Illuminate\Http\Request $request * @return mixed */ - public function postNewPlace(Request $request) + public function newPlace(Request $request) { if ($request->session()->has('token') === false) { return response()->json([ @@ -270,15 +270,10 @@ class MicropubClientController extends Controller * Make a request to the micropub endpoint requesting any nearby places. * * @param \Illuminate\Http\Request $request - * @param string $latitude - * @param string $longitude * @return \Illuminate\Http\Response */ - public function nearbyPlaces( - Request $request, - $latitude, - $longitude - ) { + public function nearbyPlaces(Request $request) + { if ($request->session()->has('token') === false) { return response()->json([ 'error' => true, @@ -298,7 +293,7 @@ class MicropubClientController extends Controller } try { - $query = 'geo:' . $latitude . ',' . $longitude; + $query = 'geo:' . $request->input('latitude') . ',' . $request->input('longitude'); if ($request->input('u') !== null) { $query .= ';u=' . $request->input('u'); } @@ -315,7 +310,7 @@ class MicropubClientController extends Controller ], 400); } - return (new Response($response->getBody(), 200)) + return response($response->getBody(), 200) ->header('Content-Type', 'application/json'); } diff --git a/app/Http/Controllers/MicropubController.php b/app/Http/Controllers/MicropubController.php index 2c344028..fa7c5a02 100644 --- a/app/Http/Controllers/MicropubController.php +++ b/app/Http/Controllers/MicropubController.php @@ -106,7 +106,7 @@ class MicropubController extends Controller * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ - public function getEndpoint(Request $request) + public function get(Request $request) { $httpAuth = $request->header('Authorization'); if (preg_match('/Bearer (.+)/', $httpAuth, $match)) { @@ -162,16 +162,11 @@ class MicropubController extends Controller ], ]); } - $content = 'No OAuth token sent with request.'; - $content = <<<'EOD' -{ - "response": "error", - "error": "no_token", - "error_description": "No token provided with request" -} -EOD; - return (new Response($content, 400)) - ->header('Content-Type', 'application/json'); + return response()->json([ + 'response' => 'error', + 'error' => 'no_token', + 'error_description' + ], 400); } } diff --git a/app/Services/IndieAuthService.php b/app/Services/IndieAuthService.php index cc7c775c..e44334b3 100644 --- a/app/Services/IndieAuthService.php +++ b/app/Services/IndieAuthService.php @@ -30,8 +30,8 @@ class IndieAuthService $domain = $client->normalizeMeURL($domain); $state = bin2hex(openssl_random_pseudo_bytes(16)); session(['state' => $state]); - $redirectURL = config('app.url') . '/indieauth'; - $clientId = config('app.url') . '/notes/new'; + $redirectURL = route('indieauth-callback'); + $clientId = route('micropub-client'); $scope = 'post'; $authorizationURL = $client->buildAuthorizationURL( $authEndpoint, diff --git a/public/assets/css/app.css.gz b/public/assets/css/app.css.gz index 2ab4e791..0440f211 100644 Binary files a/public/assets/css/app.css.gz and b/public/assets/css/app.css.gz differ diff --git a/public/assets/frontend/mapbox-gl.css.gz b/public/assets/frontend/mapbox-gl.css.gz index 691372b9..c93a4906 100644 Binary files a/public/assets/frontend/mapbox-gl.css.gz and b/public/assets/frontend/mapbox-gl.css.gz differ diff --git a/public/assets/frontend/normalize.css.gz b/public/assets/frontend/normalize.css.gz index 0930586f..3fd2df53 100644 Binary files a/public/assets/frontend/normalize.css.gz and b/public/assets/frontend/normalize.css.gz differ diff --git a/public/assets/js/links.js b/public/assets/js/links.js index 15c381b0..e184be76 100644 --- a/public/assets/js/links.js +++ b/public/assets/js/links.js @@ -1 +1 @@ -!function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var r={};return e.m=t,e.c=r,e.i=function(t){return t},e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=18)}({18:function(t,e){var r=/watch\?v=([A-Za-z0-9\-_]+)\b/,n=/https\:\/\/play\.spotify\.com\/(.*)\b/,o=document.querySelectorAll(".e-content"),a=!0,i=!1,u=void 0;try{for(var c,l=o[Symbol.iterator]();!(a=(c=l.next()).done);a=!0){var s=c.value,d=s.textContent.match(r);if(d){var f=document.createElement("div");f.classList.add("container");var p=document.createElement("iframe");p.classList.add("youtube"),p.setAttribute("src","https://www.youtube.com/embed/"+d[1]),p.setAttribute("frameborder",0),p.setAttribute("allowfullscreen","true"),f.appendChild(p),s.appendChild(f)}var m=s.textContent.match(n);if(m){var b=m[1].replace("/",":"),y=document.createElement("iframe");y.classList.add("spotify"),y.setAttribute("src","https://embed.spotify.com/?uri=spotify:"+b),y.setAttribute("frameborder",0),y.setAttribute("allowtransparency","true"),s.appendChild(y)}console.log(s.innerHTML)}}catch(t){i=!0,u=t}finally{try{!a&&l.return&&l.return()}finally{if(i)throw u}}}}); \ No newline at end of file +!function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var r={};return e.m=t,e.c=r,e.i=function(t){return t},e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=18)}({18:function(t,e){var r=/watch\?v=([A-Za-z0-9\-_]+)\b/,n=/https\:\/\/play\.spotify\.com\/(.*)\b/,o=document.querySelectorAll(".e-content"),a=!0,u=!1,i=void 0;try{for(var c,l=o[Symbol.iterator]();!(a=(c=l.next()).done);a=!0){var s=c.value,d=s.textContent.match(r);if(d){var f=document.createElement("div");f.classList.add("container");var p=document.createElement("iframe");p.classList.add("youtube"),p.setAttribute("src","https://www.youtube.com/embed/"+d[1]),p.setAttribute("frameborder",0),p.setAttribute("allowfullscreen","true"),f.appendChild(p),s.appendChild(f)}var m=s.textContent.match(n);if(m){var b=m[1].replace("/",":"),y=document.createElement("iframe");y.classList.add("spotify"),y.setAttribute("src","https://embed.spotify.com/?uri=spotify:"+b),y.setAttribute("frameborder",0),y.setAttribute("allowtransparency","true"),s.appendChild(y)}}}catch(t){u=!0,i=t}finally{try{!a&&l.return&&l.return()}finally{if(u)throw i}}}}); \ No newline at end of file diff --git a/public/assets/js/links.js.br b/public/assets/js/links.js.br index 78cdaec1..b78f8a8b 100644 Binary files a/public/assets/js/links.js.br and b/public/assets/js/links.js.br differ diff --git a/public/assets/js/links.js.gz b/public/assets/js/links.js.gz index 40e32ee5..c3df3ed8 100644 Binary files a/public/assets/js/links.js.gz and b/public/assets/js/links.js.gz differ diff --git a/public/assets/js/maps.js b/public/assets/js/maps.js index 268eeab5..eaf14d81 100644 --- a/public/assets/js/maps.js +++ b/public/assets/js/maps.js @@ -1,20 +1,21 @@ -!function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var r={};return e.m=t,e.c=r,e.i=function(t){return t},e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=19)}([function(t,e){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";function n(t){var e=/POINT\((.*)\)/.exec(t),r=e[1].split(" ")[0],n=e[1].split(" ")[1];return{latitude:n,longitude:r}}e.a=n},function(t,e,r){"use strict";function n(t){return Array.isArray(t)?t:Array.from(t)}function i(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=t.dataset.latitude,o=t.dataset.longitude,l=t.dataset.id,c=window["geojson"+l];if(null==c&&(c={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[o,i]},properties:{title:"Current Location",icon:"circle-stroked",uri:"current-location"}}]}),null!=n){var h=!0,f=!1,d=void 0;try{for(var m,y=n[Symbol.iterator]();!(h=(m=y.next()).done);h=!0){var v=m.value,g=r.i(s.a)(v.location).longitude,_=r.i(s.a)(v.location).latitude;c.features.push({type:"Feature",geometry:{type:"Point",coordinates:[g,_]},properties:{title:v.name,icon:"circle",uri:v.slug}})}}catch(t){f=!0,d=t}finally{try{!h&&y.return&&y.return()}finally{if(f)throw d}}}if(null!=e){e.coords.longitude,e.coords.latitude}var map=new a.a.Map({container:t,style:"mapbox://styles/mapbox/streets-v9",center:[o,i],zoom:15});if(null==e&&map.scrollZoom.disable(),map.addControl(new a.a.NavigationControl),t.appendChild(p(map)),map.on("load",function(){map.addSource("points",{type:"geojson",data:c}),map.addLayer({id:"points",interactive:!0,type:"symbol",source:"points",layout:{"icon-image":"{icon}-15","text-field":"{title}","text-offset":[0,1]}})}),null!=e&&map.on("click",function(t){var e=map.queryRenderedFeatures(t.point,{layer:["points"]});e.length&&(map.flyTo({center:e[0].geometry.coordinates}),r.i(u.a)(e[0].properties.uri))}),c.features&&c.features.length>1){var x=new a.a.LngLatBounds,b=!0,w=!1,E=void 0;try{for(var T,S=c.features[Symbol.iterator]();!(b=(T=S.next()).done);b=!0){var z=T.value;x.extend(z.geometry.coordinates)}}catch(t){w=!0,E=t}finally{try{!b&&S.return&&S.return()}finally{if(w)throw E}}map.fitBounds(x,{padding:65})}return map}var o=r(9),a=r.n(o),s=r(1),u=r(4);e.a=i,a.a.accessToken="pk.eyJ1Ijoiam9ubnliYXJuZXMiLCJhIjoiY2l2cDhjYW04MDAwcjJ0cG1uZnhqcm82ayJ9.qA2zeVA-nsoMh9IFrd5KQw";var l=function(t){return t.split("-").map(function(t){var e=n(t),r=e[0],i=e.slice(1);return r.toUpperCase()+i.join("").toLowerCase()}).join(" ")},c=function(map,t,e){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=document.createElement("input");n.setAttribute("id",e),n.setAttribute("type","radio"),n.setAttribute("name","toggle"),n.setAttribute("value",e),1==r&&n.setAttribute("checked","checked"),n.addEventListener("click",function(){map.setStyle("mapbox://styles/mapbox/"+e+"-v9")});var i=document.createElement("label");i.setAttribute("for",e),i.appendChild(document.createTextNode(l(e))),t.appendChild(n),t.appendChild(i)},p=function(map){var t=document.createElement("div");return t.classList.add("map-menu"),c(map,t,"streets",!0),c(map,t,"satellite-streets"),t}},,function(t,e,r){"use strict";function n(t){document.querySelector("select")&&("current-location"==t?document.querySelector('select [id="option-coords"]').selected=!0:document.querySelector('select [value="'+t+'"]').selected=!0)}e.a=n},function(t,e,r){"use strict";function n(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function i(t){return 3*t.length/4-n(t)}function o(t){var e,r,i,o,a,s,u=t.length;a=n(t),s=new p(3*u/4-a),i=a>0?u-4:u;var l=0;for(e=0,r=0;e>16&255,s[l++]=o>>8&255,s[l++]=255&o;return 2===a?(o=c[t.charCodeAt(e)]<<2|c[t.charCodeAt(e+1)]>>4,s[l++]=255&o):1===a&&(o=c[t.charCodeAt(e)]<<10|c[t.charCodeAt(e+1)]<<4|c[t.charCodeAt(e+2)]>>2,s[l++]=o>>8&255,s[l++]=255&o),s}function a(t){return l[t>>18&63]+l[t>>12&63]+l[t>>6&63]+l[63&t]}function s(t,e,r){for(var n,i=[],o=e;oc?c:u+a));return 1===n?(e=t[r-1],i+=l[e>>2],i+=l[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=l[e>>10],i+=l[e>>4&63],i+=l[e<<2&63],i+="="),o.push(i),o.join("")}e.byteLength=i,e.toByteArray=o,e.fromByteArray=u;for(var l=[],c=[],p="undefined"!=typeof Uint8Array?Uint8Array:Array,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=0,d=h.length;f=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|t}function y(t){return+t!=t&&(t=0),a.alloc(+t)}function v(t,e){if(a.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return G(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Y(t).length;default:if(n)return G(t).length;e=(""+e).toLowerCase(),n=!0}}function g(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,e>>>=0,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return C(this,e,r);case"utf8":case"utf-8":return P(this,e,r);case"ascii":return L(this,e,r);case"latin1":case"binary":return k(this,e,r);case"base64":return M(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function _(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function x(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=a.from(e,n)),a.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,i);if("number"==typeof e)return e&=255,a.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,i){function o(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}var a=1,s=t.length,u=e.length;if(void 0!==n&&(n=String(n).toLowerCase(),"ucs2"===n||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,r/=2}var l;if(i){var c=-1;for(l=r;ls&&(r=s-u),l=r;l>=0;l--){for(var p=!0,h=0;hi&&(n=i)):n=i;var o=e.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a239?4:o>223?3:o>191?2:1;if(i+s<=r){var u,l,c,p;switch(s){case 1:o<128&&(a=o);break;case 2:u=t[i+1],128===(192&u)&&(p=(31&o)<<6|63&u,p>127&&(a=p));break;case 3:u=t[i+1],l=t[i+2],128===(192&u)&&128===(192&l)&&(p=(15&o)<<12|(63&u)<<6|63&l,p>2047&&(p<55296||p>57343)&&(a=p));break;case 4:u=t[i+1],l=t[i+2],c=t[i+3],128===(192&u)&&128===(192&l)&&128===(192&c)&&(p=(15&o)<<18|(63&u)<<12|(63&l)<<6|63&c,p>65535&&p<1114112&&(a=p))}}null===a?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=s}return I(n)}function I(t){var e=t.length;if(e<=tt)return String.fromCharCode.apply(String,t);for(var r="",n=0;nn)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function O(t,e,r,n,i,o){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function B(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i>>8*(n?i:1-i)}function j(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i>>8*(n?i:3-i)&255}function F(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(t,e,r,n,i){return i||F(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),Q.write(t,e,r,n,23,4),r+4}function V(t,e,r,n,i){return i||F(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),Q.write(t,e,r,n,52,8),r+8}function N(t){if(t=q(t).replace(et,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function q(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Z(t){return t<16?"0"+t.toString(16):t.toString(16)}function G(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],a=0;a55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function X(t){for(var e=[],r=0;r>8,i=r%256,o.push(i),o.push(n);return o}function Y(t){return K.toByteArray(N(t))}function H(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function J(t){return t!==t}/*! +!function(t){function e(i){if(r[i])return r[i].exports;var n=r[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,e),n.l=!0,n.exports}var r={};return e.m=t,e.c=r,e.i=function(t){return t},e.d=function(t,r,i){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=19)}([function(t,e){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";function i(t){var e=/POINT\((.*)\)/.exec(t),r=e[1].split(" ")[0],i=e[1].split(" ")[1];return{latitude:i,longitude:r}}e.a=i},function(t,e,r){"use strict";function i(t){return Array.isArray(t)?t:Array.from(t)}function n(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=t.dataset.latitude,o=t.dataset.longitude,l=t.dataset.id,c=window["geojson"+l];if(null==c&&(c={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[o,n]},properties:{title:"Current Location",icon:"circle-stroked",uri:"current-location"}}]}),null!=i){var p=!0,f=!1,d=void 0;try{for(var m,y=i[Symbol.iterator]();!(p=(m=y.next()).done);p=!0){var v=m.value,g=r.i(s.a)(v.location).longitude,_=r.i(s.a)(v.location).latitude;c.features.push({type:"Feature",geometry:{type:"Point",coordinates:[g,_]},properties:{title:v.name,icon:"circle",uri:v.slug}})}}catch(t){f=!0,d=t}finally{try{!p&&y.return&&y.return()}finally{if(f)throw d}}}if(null!=e){e.coords.longitude,e.coords.latitude}var map=new a.a.Map({container:t,style:"mapbox://styles/mapbox/streets-v9",center:[o,n],zoom:15});if(null==e&&map.scrollZoom.disable(),map.addControl(new a.a.NavigationControl),t.appendChild(h(map)),map.on("load",function(){map.addSource("points",{type:"geojson",data:c}),map.addLayer({id:"points",interactive:!0,type:"symbol",source:"points",layout:{"icon-image":"{icon}-15","text-field":"{title}","text-offset":[0,1]}})}),null!=e&&map.on("click",function(t){var e=map.queryRenderedFeatures(t.point,{layer:["points"]});e.length&&(map.flyTo({center:e[0].geometry.coordinates}),r.i(u.a)(e[0].properties.uri))}),c.features&&c.features.length>1){var x=new a.a.LngLatBounds,b=!0,w=!1,E=void 0;try{for(var T,S=c.features[Symbol.iterator]();!(b=(T=S.next()).done);b=!0){var z=T.value;x.extend(z.geometry.coordinates)}}catch(t){w=!0,E=t}finally{try{!b&&S.return&&S.return()}finally{if(w)throw E}}map.fitBounds(x,{padding:65})}return map}var o=r(9),a=r.n(o),s=r(1),u=r(4);e.a=n,a.a.accessToken="pk.eyJ1Ijoiam9ubnliYXJuZXMiLCJhIjoiY2l2cDhjYW04MDAwcjJ0cG1uZnhqcm82ayJ9.qA2zeVA-nsoMh9IFrd5KQw";var l=function(t){return t.split("-").map(function(t){var e=i(t),r=e[0],n=e.slice(1);return r.toUpperCase()+n.join("").toLowerCase()}).join(" ")},c=function(map,t,e){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=document.createElement("input");i.setAttribute("id",e),i.setAttribute("type","radio"),i.setAttribute("name","toggle"),i.setAttribute("value",e),1==r&&i.setAttribute("checked","checked"),i.addEventListener("click",function(){map.setStyle("mapbox://styles/mapbox/"+e+"-v9")});var n=document.createElement("label");n.setAttribute("for",e),n.appendChild(document.createTextNode(l(e))),t.appendChild(i),t.appendChild(n)},h=function(map){var t=document.createElement("div");return t.classList.add("map-menu"),c(map,t,"streets",!0),c(map,t,"satellite-streets"),t}},,function(t,e,r){"use strict";function i(t){document.querySelector("select")&&("current-location"==t?document.querySelector('select [id="option-coords"]').selected=!0:document.querySelector('select [value="'+t+'"]').selected=!0)}e.a=i},function(t,e,r){"use strict";function i(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function n(t){return 3*t.length/4-i(t)}function o(t){var e,r,n,o,a,s,u=t.length;a=i(t),s=new h(3*u/4-a),n=a>0?u-4:u;var l=0;for(e=0,r=0;e>16&255,s[l++]=o>>8&255,s[l++]=255&o;return 2===a?(o=c[t.charCodeAt(e)]<<2|c[t.charCodeAt(e+1)]>>4,s[l++]=255&o):1===a&&(o=c[t.charCodeAt(e)]<<10|c[t.charCodeAt(e+1)]<<4|c[t.charCodeAt(e+2)]>>2,s[l++]=o>>8&255,s[l++]=255&o),s}function a(t){return l[t>>18&63]+l[t>>12&63]+l[t>>6&63]+l[63&t]}function s(t,e,r){for(var i,n=[],o=e;oc?c:u+a));return 1===i?(e=t[r-1],n+=l[e>>2],n+=l[e<<4&63],n+="=="):2===i&&(e=(t[r-2]<<8)+t[r-1],n+=l[e>>10],n+=l[e>>4&63],n+=l[e<<2&63],n+="="),o.push(n),o.join("")}e.byteLength=n,e.toByteArray=o,e.fromByteArray=u;for(var l=[],c=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=0,d=p.length;f=n())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n().toString(16)+" bytes");return 0|t}function y(t){return+t!=t&&(t=0),a.alloc(+t)}function v(t,e){if(a.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return G(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Y(t).length;default:if(i)return G(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,r){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,e>>>=0,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return k(this,e,r);case"utf8":case"utf-8":return P(this,e,r);case"ascii":return I(this,e,r);case"latin1":case"binary":return C(this,e,r);case"base64":return M(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function _(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function x(t,e,r,i,n){if(0===t.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof e&&(e=a.from(e,i)),a.isBuffer(e))return 0===e.length?-1:b(t,e,r,i,n);if("number"==typeof e)return e&=255,a.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,i,n){function o(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}var a=1,s=t.length,u=e.length;if(void 0!==i&&(i=String(i).toLowerCase(),"ucs2"===i||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,r/=2}var l;if(n){var c=-1;for(l=r;ls&&(r=s-u),l=r;l>=0;l--){for(var h=!0,p=0;pn&&(i=n)):i=n;var o=e.length;if(o%2!==0)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var a=0;a239?4:o>223?3:o>191?2:1;if(n+s<=r){var u,l,c,h;switch(s){case 1:o<128&&(a=o);break;case 2:u=t[n+1],128===(192&u)&&(h=(31&o)<<6|63&u,h>127&&(a=h));break;case 3:u=t[n+1],l=t[n+2],128===(192&u)&&128===(192&l)&&(h=(15&o)<<12|(63&u)<<6|63&l,h>2047&&(h<55296||h>57343)&&(a=h));break;case 4:u=t[n+1],l=t[n+2],c=t[n+3],128===(192&u)&&128===(192&l)&&128===(192&c)&&(h=(15&o)<<18|(63&u)<<12|(63&l)<<6|63&c,h>65535&&h<1114112&&(a=h))}}null===a?(a=65533,s=1):a>65535&&(a-=65536,i.push(a>>>10&1023|55296),a=56320|1023&a),i.push(a),n+=s}return L(i)}function L(t){var e=t.length;if(e<=tt)return String.fromCharCode.apply(String,t);for(var r="",i=0;ii)&&(r=i);for(var n="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function O(t,e,r,i,n,o){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||et.length)throw new RangeError("Index out of range")}function B(t,e,r,i){e<0&&(e=65535+e+1);for(var n=0,o=Math.min(t.length-r,2);n>>8*(i?n:1-n)}function j(t,e,r,i){e<0&&(e=4294967295+e+1);for(var n=0,o=Math.min(t.length-r,4);n>>8*(i?n:3-n)&255}function F(t,e,r,i,n,o){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(t,e,r,i,n){return n||F(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),Q.write(t,e,r,i,23,4),r+4}function V(t,e,r,i,n){return n||F(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),Q.write(t,e,r,i,52,8),r+8}function N(t){if(t=q(t).replace(et,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function q(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Z(t){return t<16?"0"+t.toString(16):t.toString(16)}function G(t,e){e=e||1/0;for(var r,i=t.length,n=null,o=[],a=0;a55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===i){(e-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function X(t){for(var e=[],r=0;r>8,n=r%256,o.push(n),o.push(i);return o}function Y(t){return K.toByteArray(N(t))}function H(t,e,r,i){for(var n=0;n=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function J(t){return t!==t}/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ -var K=r(5),Q=r(7),$=r(8);e.Buffer=a,e.SlowBuffer=y,e.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:n(),e.kMaxLength=i(),a.poolSize=8192,a._augment=function(t){return t.__proto__=a.prototype,t},a.from=function(t,e,r){return s(null,t,e,r)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0})),a.alloc=function(t,e,r){return l(null,t,e,r)},a.allocUnsafe=function(t){return c(null,t)},a.allocUnsafeSlow=function(t){return c(null,t)},a.isBuffer=function(t){return!(null==t||!t._isBuffer)},a.compare=function(t,e){if(!a.isBuffer(t)||!a.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},a.prototype.compare=function(t,e,r,n,i){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,s=r-e,u=Math.min(o,s),l=this.slice(n,i),c=t.slice(e,r),p=0;pi)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":return T(this,t,e,r);case"latin1":case"binary":return S(this,t,e,r);case"base64":return z(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var tt=4096;a.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),e0&&(i*=256);)n+=this[t+--e]*i;return n},a.prototype.readUInt8=function(t,e){return e||D(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,e){return e||D(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,e){return e||D(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,e){return e||D(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUInt32BE=function(t,e){return e||D(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||D(t,e,this.length);for(var n=this[t],i=1,o=0;++o=i&&(n-=Math.pow(2,8*e)),n},a.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||D(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},a.prototype.readInt8=function(t,e){return e||D(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},a.prototype.readInt16LE=function(t,e){e||D(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(t,e){e||D(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(t,e){return e||D(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return e||D(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return e||D(t,4,this.length),Q.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return e||D(t,4,this.length),Q.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return e||D(t,8,this.length),Q.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return e||D(t,8,this.length),Q.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e|=0,r|=0,!n){var i=Math.pow(2,8*r)-1;O(this,t,e,r,i,0)}var o=1,a=0;for(this[e]=255&t;++a=0&&(a*=256);)this[e+o]=t/a&255;return e+r},a.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},a.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):B(this,t,e,!0),e+2},a.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):B(this,t,e,!1),e+2},a.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):j(this,t,e,!0),e+4},a.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):j(this,t,e,!1),e+4},a.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);O(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o>0)-s&255;return e+r},a.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);O(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},a.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):B(this,t,e,!0),e+2},a.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):B(this,t,e,!1),e+2},a.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):j(this,t,e,!0),e+4},a.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):j(this,t,e,!1),e+4},a.prototype.writeFloatLE=function(t,e,r){return U(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return U(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return V(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return V(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var o;if("number"==typeof t)for(o=e;o>1,c=-7,p=r?i-1:0,h=r?-1:1,f=t[e+p];for(p+=h,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=256*o+t[e+p],p+=h,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+t[e+p],p+=h,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:(f?-1:1)*(1/0);a+=Math.pow(2,n),o-=l}return(f?-1:1)*a*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var a,s,u,l=8*o-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,d=n?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,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),e+=a+p>=1?h/u:h*Math.pow(2,1-p),e*u>=2&&(a++,u/=2),a+p>=c?(s=0,a=c):a+p>=1?(s=(e*u-1)*Math.pow(2,i),a+=p):(s=e*Math.pow(2,p-1)*Math.pow(2,i),a=0));i>=8;t[r+f]=255&s,f+=d,s/=256,i-=8);for(a=a<0;t[r+f]=255&a,f+=d,a/=256,l-=8);t[r+f-d]|=128*m}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){(function(e,r){var n,n;!function(e){t.exports=e()}(function(){var t;return function t(e,r,i){function o(s,u){if(!r[s]){if(!e[s]){var l="function"==typeof n&&n;if(!u&&l)return n(s,!0);if(a)return a(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var p=r[s]={exports:{}};e[s][0].call(p.exports,function(t){var r=e[s][1][t];return o(r?r:t)},p,p.exports,t,e,r,i)}return r[s].exports}for(var a="function"==typeof n&&n,s=0;sa.MAX_VERTEX_ARRAY_LENGTH)&&(e=new o(this.layoutVertexArray.length,this.elementArray.length),this.segments.push(e)),e},a.prototype.prepareSegment2=function(t){var e=this.segments2[this.segments2.length-1];return(!e||e.vertexLength+t>a.MAX_VERTEX_ARRAY_LENGTH)&&(e=new o(this.layoutVertexArray.length,this.elementArray2.length),this.segments2.push(e)),e},a.prototype.populatePaintArrays=function(t){var e=this;for(var r in this.layerData){var n=e.layerData[r];0!==n.paintVertexArray.bytesPerElement&&n.programConfiguration.populatePaintArray(n.layer,n.paintVertexArray,e.layoutVertexArray.length,e.globalProperties,t)}},a.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},a.prototype.serialize=function(t){return{layoutVertexArray:this.layoutVertexArray.serialize(t),elementArray:this.elementArray&&this.elementArray.serialize(t),elementArray2:this.elementArray2&&this.elementArray2.serialize(t),paintVertexArrays:n(this.layerData,t),segments:this.segments,segments2:this.segments2}},a.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,e.exports=a},{"./program_configuration":15}],2:[function(t,e,r){"use strict";var n=t("./array_group"),i=t("./buffer_group"),o=t("../util/util"),a=function(t,e){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.index=t.index,t.arrays?this.buffers=new i(e,t.layers,t.zoom,t.arrays):this.arrays=new n(e,t.layers,t.zoom)};a.prototype.populate=function(t,e){for(var r=this,n=0,i=t;n=u||h<0||h>=u)){var f=e.prepareSegment(4),d=f.vertexLength;n(e.layoutVertexArray,p,h,-1,-1),n(e.layoutVertexArray,p,h,1,-1),n(e.layoutVertexArray,p,h,1,1),n(e.layoutVertexArray,p,h,-1,1),e.elementArray.emplaceBack(d,d+1,d+2),e.elementArray.emplaceBack(d,d+3,d+2),f.vertexLength+=4,f.primitiveLength+=2}}e.populatePaintArrays(t.properties)},e}(i);e.exports=c},{"../bucket":2,"../element_array_type":10,"../extent":11,"../load_geometry":13,"../vertex_array_type":17}],4:[function(t,e,r){"use strict";var n=t("../bucket"),i=t("../vertex_array_type"),o=t("../element_array_type"),a=t("../load_geometry"),s=t("earcut"),u=t("../../util/classify_rings"),l=500,c={layoutVertexArrayType:i([{name:"a_pos",components:2,type:"Int16"}]),elementArrayType:o(3),elementArrayType2:o(2),paintAttributes:[{property:"fill-color",type:"Uint8"},{property:"fill-outline-color",type:"Uint8"},{property:"fill-opacity",type:"Uint8",multiplier:255}]},p=function(t){function e(e){t.call(this,e,c)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addFeature=function(t){for(var e=this.arrays,r=0,n=u(a(t),l);rl)||t.y===e.y&&(t.y<0||t.y>l)}var o=t("../bucket"),a=t("../vertex_array_type"),s=t("../element_array_type"),u=t("../load_geometry"),l=t("../extent"),c=t("earcut"),p=t("../../util/classify_rings"),h=500,f={layoutVertexArrayType:a([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal",components:3,type:"Int16"},{name:"a_edgedistance",components:1,type:"Int16"}]),elementArrayType:s(3),paintAttributes:[{property:"fill-extrusion-base",type:"Uint16"},{property:"fill-extrusion-height",type:"Uint16"},{property:"fill-extrusion-color",type:"Uint8"}]},d=Math.pow(2,13),m=function(t){function e(e){t.call(this,e,f)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addFeature=function(t){for(var e=this.arrays,r=0,o=p(u(t),h);r=1){var S=b[E-1];if(!i(T,S)){var z=T.sub(S)._perp()._unit();n(e.layoutVertexArray,T.x,T.y,z.x,z.y,0,0,w),n(e.layoutVertexArray,T.x,T.y,z.x,z.y,0,1,w),w+=S.dist(T),n(e.layoutVertexArray,S.x,S.y,z.x,z.y,0,0,w),n(e.layoutVertexArray,S.x,S.y,z.x,z.y,0,1,w);var A=m.vertexLength;e.elementArray.emplaceBack(A,A+1,A+2),e.elementArray.emplaceBack(A+1,A+2,A+3),m.vertexLength+=4,m.primitiveLength+=2}}y.push(T.x),y.push(T.y)}}}for(var M=c(y,v),P=0;P>6)}var i=t("../bucket"),o=t("../vertex_array_type"),a=t("../element_array_type"),s=t("../load_geometry"),u=t("../extent"),l=63,c=Math.cos(37.5*(Math.PI/180)),p=15,h=15,f=.5,d=Math.pow(2,h-1)/f,m={layoutVertexArrayType:o([{name:"a_pos",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}]),paintAttributes:[{property:"line-color",type:"Uint8"},{property:"line-blur",multiplier:10,type:"Uint8"},{property:"line-opacity",multiplier:10,type:"Uint8"},{property:"line-gap-width",multiplier:10,type:"Uint8",name:"a_gapwidth"},{property:"line-offset",multiplier:1,type:"Int8"}],elementArrayType:a()},y=function(t){function e(e){t.call(this,e,m)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addFeature=function(t){for(var e=this,r=this.layers[0].layout,n=r["line-join"],i=r["line-cap"],o=r["line-miter-limit"],a=r["line-round-limit"],u=0,l=s(t,h);u2&&t[s-1].equals(t[s-2]);)s--;if(!(t.length<2)){"bevel"===r&&(i=1.05);var l=p*(u/(512*this.overscaling)),h=t[0],f=t[s-1],d=h.equals(f),m=this.arrays,y=m.prepareSegment(10*s);if(2!==s||!d){this.distance=0;var v,g,_,x,b,w,E,T=n,S=d?"butt":n,z=!0;this.e1=this.e2=this.e3=-1,d&&(v=t[s-2],b=h.sub(v)._unit()._perp());for(var A=0;A0){var k=v.dist(g);if(k>2*l){var C=v.sub(v.sub(g)._mult(l/k)._round());a.distance+=C.dist(g),a.addCurrentVertex(C,a.distance,x.mult(1),0,0,!1,y),g=C}}var R=g&&_,D=R?r:_?T:S;if(R&&"round"===D&&(Ii&&(D="bevel"),"bevel"===D&&(I>2&&(D="flipbevel"),I100)M=b.clone();else{var O=x.x*b.y-x.y*b.x>0?-1:1,B=I*x.add(b).mag()/x.sub(b).mag();M._perp()._mult(B*O)}a.addCurrentVertex(v,a.distance,M,0,0,!1,y),a.addCurrentVertex(v,a.distance,M.mult(-1),0,0,!1,y)}else if("bevel"===D||"fakeround"===D){var j=x.x*b.y-x.y*b.x>0,F=-Math.sqrt(I*I-1);if(j?(E=0,w=F):(w=0,E=F),z||a.addCurrentVertex(v,a.distance,x,w,E,!1,y),"fakeround"===D){for(var U,V=Math.floor(8*(.5-(P-.5))),N=0;N=0;q--)U=x.mult((q+1)/(V+1))._add(b)._unit(),a.addPieSliceVertex(v,a.distance,U,j,y)}_&&a.addCurrentVertex(v,a.distance,b,-w,-E,!1,y)}else"butt"===D?(z||a.addCurrentVertex(v,a.distance,x,0,0,!1,y),_&&a.addCurrentVertex(v,a.distance,b,0,0,!1,y)):"square"===D?(z||(a.addCurrentVertex(v,a.distance,x,1,1,!1,y),a.e1=a.e2=-1),_&&a.addCurrentVertex(v,a.distance,b,-1,-1,!1,y)):"round"===D&&(z||(a.addCurrentVertex(v,a.distance,x,0,0,!1,y),a.addCurrentVertex(v,a.distance,x,1,1,!0,y),a.e1=a.e2=-1),_&&(a.addCurrentVertex(v,a.distance,b,-1,-1,!0,y),a.addCurrentVertex(v,a.distance,b,0,0,!1,y)));if(L&&A2*l){var G=v.add(_.sub(v)._mult(l/Z)._round());a.distance+=G.dist(v),a.addCurrentVertex(G,a.distance,b.mult(1),0,0,!1,y),v=G}}z=!1}m.populatePaintArrays(e)}}},e.prototype.addCurrentVertex=function(t,e,r,i,o,a,s){var u,l=a?1:0,c=this.arrays,p=c.layoutVertexArray,h=c.elementArray;u=r.clone(),i&&u._sub(r.perp()._mult(i)),n(p,t,u,l,0,i,e),this.e3=s.vertexLength++,this.e1>=0&&this.e2>=0&&(h.emplaceBack(this.e1,this.e2,this.e3),s.primitiveLength++),this.e1=this.e2,this.e2=this.e3,u=r.mult(-1),o&&u._sub(r.perp()._mult(o)),n(p,t,u,l,1,-o,e),this.e3=s.vertexLength++,this.e1>=0&&this.e2>=0&&(h.emplaceBack(this.e1,this.e2,this.e3),s.primitiveLength++),this.e1=this.e2,this.e2=this.e3,e>d/2&&(this.distance=0,this.addCurrentVertex(t,this.distance,r,i,o,a,s))},e.prototype.addPieSliceVertex=function(t,e,r,i,o){var a=i?1:0;r=r.mult(i?-1:1);var s=this.arrays,u=s.layoutVertexArray,l=s.elementArray;n(u,t,r,0,a,0,e),this.e3=o.vertexLength++,this.e1>=0&&this.e2>=0&&(l.emplaceBack(this.e1,this.e2,this.e3),o.primitiveLength++),i?this.e2=this.e3:this.e1=this.e3},e}(i);e.exports=y},{"../bucket":2,"../element_array_type":10,"../extent":11,"../load_geometry":13,"../vertex_array_type":17}],7:[function(t,e,r){"use strict";function n(t,e,r,n,i,o,a,s,u,l,c){t.emplaceBack(e,r,Math.round(64*n),Math.round(64*i),o/4,a/4,10*(l||0),c,10*(s||0),10*Math.min(u||25,25))}function i(t,e,r,n,i){return t.emplaceBack(e.x,e.y,Math.round(r.x),Math.round(r.y),10*n,10*i)}var o=t("point-geometry"),a=t("../array_group"),s=t("../buffer_group"),u=t("../vertex_array_type"),l=t("../element_array_type"),c=t("../extent"),p=t("../../symbol/anchor"),h=t("../../symbol/get_anchors"),f=t("../../util/token"),d=t("../../symbol/quads"),m=t("../../symbol/shaping"),y=t("../../symbol/resolve_text"),v=t("../../symbol/mergelines"),g=t("../../symbol/clip_line"),_=t("../../util/util"),x=t("../../util/script_detection"),b=t("../load_geometry"),w=t("../../symbol/collision_feature"),E=t("../../util/find_pole_of_inaccessibility"),T=t("../../util/classify_rings"),S=t("vector-tile").VectorTileFeature,z=m.shapeText,A=m.shapeIcon,M=m.WritingMode,P=d.getGlyphQuads,I=d.getIconQuads,L=l(),k=u([{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"}]),C={glyph:{layoutVertexArrayType:k,elementArrayType:L},icon:{layoutVertexArrayType:k,elementArrayType:L},collisionBox:{layoutVertexArrayType:u([{name:"a_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"},{name:"a_data",components:2,type:"Uint8"}]),elementArrayType:l(2)}},R=function(t){var e=this;if(this.collisionBoxArray=t.collisionBoxArray,this.symbolQuadsArray=t.symbolQuadsArray,this.symbolInstancesArray=t.symbolInstancesArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.index=t.index,this.sdfIcons=t.sdfIcons,this.iconsNeedLinear=t.iconsNeedLinear,this.adjustedTextSize=t.adjustedTextSize,this.adjustedIconSize=t.adjustedIconSize,this.fontstack=t.fontstack,t.arrays){this.buffers={};for(var r in t.arrays)t.arrays[r]&&(e.buffers[r]=new s(C[r],t.layers,t.zoom,t.arrays[r]))}};R.prototype.populate=function(t,e){var r=this,n=this.layers[0].layout,i=n["text-field"],o=n["text-font"],a=n["icon-image"],s=i&&o,u=a;if(this.features=[],s||u){for(var l=e.iconDependencies,c=e.glyphDependencies,p=c[o]=c[o]||{},h=0;hc||o.y<0||o.y>c);if(!m||a){var s=a||w;n.addSymbolInstance(o,i,e,r,n.layers[0],s,n.symbolInstancesArray.length,n.collisionBoxArray,t.index,t.sourceLayerIndex,n.index,u,y,x,f,v,b,{zoom:n.zoom},t.properties)}};if("line"===S)for(var P=0,I=g(t.geometry,0,0,c,c);P=0;o--)if(r.dist(i[o])7*Math.PI/4)continue}else if(o&&a&&y<=3*Math.PI/4||y>5*Math.PI/4)continue}else if(o&&a&&(y<=Math.PI/2||y>3*Math.PI/2))continue;var v=m.tl,g=m.tr,_=m.bl,x=m.br,b=m.tex,w=m.anchorPoint,E=Math.max(h+Math.log(m.minScale)/Math.LN2,f),T=Math.min(h+Math.log(m.maxScale)/Math.LN2,25);if(!(T<=E)){E===f&&(E=0);var S=Math.round(m.glyphAngle/(2*Math.PI)*256),z=t.prepareSegment(4),A=z.vertexLength;n(p,w.x,w.y,v.x,v.y,b.x,b.y,E,T,f,S),n(p,w.x,w.y,g.x,g.y,b.x+b.w,b.y,E,T,f,S),n(p,w.x,w.y,_.x,_.y,b.x,b.y+b.h,E,T,f,S),n(p,w.x,w.y,x.x,x.y,b.x+b.w,b.y+b.h,E,T,f,S),c.emplaceBack(A,A+1,A+2),c.emplaceBack(A+1,A+2,A+3),z.vertexLength+=4,z.primitiveLength+=2}}},R.prototype.addToDebugBuffers=function(t){for(var e=this,r=this.arrays.collisionBox,n=r.layoutVertexArray,a=r.elementArray,s=-t.angle,u=t.yStretch,l=this.symbolInstancesStartIndex;lR.MAX_QUADS&&_.warnOnce("Too many symbols being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),C>R.MAX_QUADS&&_.warnOnce("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907");var V=(r[M.vertical]?M.vertical:0)|(r[M.horizontal]?M.horizontal:0);return this.symbolInstancesArray.emplaceBack(D,O,F,U,L,C,B,j,t.x,t.y,a,V)},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,t.writingMode)},R.MAX_QUADS=65535,e.exports=R},{"../../symbol/anchor":73,"../../symbol/clip_line":75,"../../symbol/collision_feature":77,"../../symbol/get_anchors":79,"../../symbol/mergelines":82,"../../symbol/quads":83,"../../symbol/resolve_text":84,"../../symbol/shaping":85,"../../util/classify_rings":111,"../../util/find_pole_of_inaccessibility":117,"../../util/script_detection":124,"../../util/token":126,"../../util/util":127,"../array_group":1,"../buffer_group":9,"../element_array_type":10,"../extent":11,"../load_geometry":13,"../vertex_array_type":17,"point-geometry":194,"vector-tile":204}],8:[function(t,e,r){"use strict";var n={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT"},i=function(t,e,r){this.arrayBuffer=t.arrayBuffer,this.length=t.length,this.attributes=e.members,this.itemSize=e.bytesPerElement,this.type=r,this.arrayType=e};i.fromStructArray=function(t,e){return new i(t.serialize(),t.constructor.serialize(),e)},i.prototype.bind=function(t){var e=t[this.type];this.buffer?t.bindBuffer(e,this.buffer):(this.gl=t,this.buffer=t.createBuffer(),t.bindBuffer(e,this.buffer),t.bufferData(e,this.arrayBuffer,t.STATIC_DRAW),this.arrayBuffer=null)},i.prototype.setVertexAttribPointers=function(t,e,r){for(var i=this,o=0;o0?t["line-gap-width"]+2*t["line-width"]:t["line-width"]}function a(t,e,r,n,i){if(!e[0]&&!e[1])return t;e=u.convert(e),"viewport"===r&&e._rotate(-n);for(var o=[],a=0;ar.max||p.yr.max)&&i.warnOnce("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return s}},{"../util/util":127,"./extent":11}],14:[function(t,e,r){"use strict";var n=t("../util/struct_array"),i=n({members:[{name:"a_pos",type:"Int16",components:2}]});e.exports=i},{"../util/struct_array":125}],15:[function(t,e,r){"use strict";function n(t,e,r,n){if(!t.zoomStops)return e.getPaintValue(t.property,r,n);var i=t.zoomStops.map(function(i){return e.getPaintValue(t.property,a.extend({},r,{zoom:i}),n)});return 1===i.length?i[0]:i}function i(t,e){var r=t.property.replace(e.type+"-","").replace(/-/g,"_"),n="color"===e._paintSpecifications[t.property].type;return a.extend({name:"a_"+r,components:n?4:1,multiplier:n?255:1},t)}var o=t("./vertex_array_type"),a=t("../util/util"),s=function(){this.attributes=[],this.uniforms=[],this.interpolationUniforms=[],this.pragmas={vertex:{},fragment:{}},this.cacheKey=""};s.createDynamic=function(t,e,r){for(var n=new s,a=0,u=t;a90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};i.prototype.wrap=function(){return new i(n(this.lng,-180,180),this.lat)},i.prototype.toArray=function(){return[this.lng,this.lat]},i.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},i.convert=function(t){if(t instanceof i)return t;if(t&&t.hasOwnProperty("lng")&&t.hasOwnProperty("lat"))return new i(t.lng,t.lat);if(Array.isArray(t)&&2===t.length)return new i(t[0],t[1]);throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, or an array of [, ]")},e.exports=i},{"../util/util":127}],20:[function(t,e,r){"use strict";var n=t("./lng_lat"),i=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};i.prototype.setNorthEast=function(t){return this._ne=n.convert(t),this},i.prototype.setSouthWest=function(t){return this._sw=n.convert(t),this},i.prototype.extend=function(t){var e,r,o=this._sw,a=this._ne;if(t instanceof n)e=t,r=t;else{if(!(t instanceof i))return Array.isArray(t)?t.every(Array.isArray)?this.extend(i.convert(t)):this.extend(n.convert(t)):this;if(e=t._sw,r=t._ne,!e||!r)return this}return o||a?(o.lng=Math.min(e.lng,o.lng),o.lat=Math.min(e.lat,o.lat),a.lng=Math.max(r.lng,a.lng),a.lat=Math.max(r.lat,a.lat)):(this._sw=new n(e.lng,e.lat),this._ne=new n(r.lng,r.lat)),this},i.prototype.getCenter=function(){return new n((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},i.prototype.getSouthWest=function(){return this._sw},i.prototype.getNorthEast=function(){return this._ne},i.prototype.getNorthWest=function(){return new n(this.getWest(),this.getNorth())},i.prototype.getSouthEast=function(){return new n(this.getEast(),this.getSouth())},i.prototype.getWest=function(){return this._sw.lng},i.prototype.getSouth=function(){return this._sw.lat},i.prototype.getEast=function(){return this._ne.lng},i.prototype.getNorth=function(){return this._ne.lat},i.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},i.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},i.convert=function(t){return!t||t instanceof i?t:new i(t)},e.exports=i},{"./lng_lat":19}],21:[function(t,e,r){"use strict";var n=t("./lng_lat"),i=t("point-geometry"),o=t("./coordinate"),a=t("../util/util"),s=t("../util/interpolate"),u=t("../source/tile_coord"),l=t("../data/extent"),c=t("@mapbox/gl-matrix"),p=c.vec4,h=c.mat4,f=c.mat2,d=function(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 n(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0},m={minZoom:{},maxZoom:{},worldSize:{},centerPoint:{},size:{},bearing:{},pitch:{},fov:{},zoom:{},center:{},unmodified:{},x:{},y:{},point:{}};m.minZoom.get=function(){return this._minZoom},m.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},m.maxZoom.get=function(){return this._maxZoom},m.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},m.worldSize.get=function(){return this.tileSize*this.scale},m.centerPoint.get=function(){return this.size._div(2)},m.size.get=function(){return new i(this.width,this.height)},m.bearing.get=function(){return-this.angle/Math.PI*180},m.bearing.set=function(t){var e=-a.wrap(t,-180,180)*Math.PI/180;this.angle!==e&&(this._unmodified=!1,this.angle=e,this._calcMatrices(),this.rotationMatrix=f.create(),f.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},m.pitch.get=function(){return this._pitch/Math.PI*180},m.pitch.set=function(t){var e=a.clamp(t,0,60)/180*Math.PI;this._pitch!==e&&(this._unmodified=!1,this._pitch=e,this._calcMatrices())},m.fov.get=function(){return this._fov/Math.PI*180},m.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())},m.zoom.get=function(){return this._zoom},m.zoom.set=function(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._constrain(),this._calcMatrices())},m.center.get=function(){return this._center},m.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},d.prototype.coveringZoomLevel=function(t){return(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},d.prototype.coveringTiles=function(t){var e=this.coveringZoomLevel(t),r=e;if(et.maxzoom&&(e=t.maxzoom);var n=this.pointCoordinate(this.centerPoint,e),o=new i(n.column-.5,n.row-.5),a=[this.pointCoordinate(new i(0,0),e),this.pointCoordinate(new i(this.width,0),e),this.pointCoordinate(new i(this.width,this.height),e),this.pointCoordinate(new i(0,this.height),e)];return u.cover(e,a,t.reparseOverscaled?r:e).sort(function(t,e){return o.dist(t)-o.dist(e)})},d.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},m.unmodified.get=function(){return this._unmodified},d.prototype.zoomScale=function(t){return Math.pow(2,t)},d.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},d.prototype.project=function(t){return new i(this.lngX(t.lng),this.latY(t.lat))},d.prototype.unproject=function(t){return new n(this.xLng(t.x),this.yLat(t.y))},m.x.get=function(){return this.lngX(this.center.lng)},m.y.get=function(){return this.latY(this.center.lat)},m.point.get=function(){return new i(this.x,this.y)},d.prototype.lngX=function(t){return(180+t)*this.worldSize/360},d.prototype.latY=function(t){var e=180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360));return(180-e)*this.worldSize/360},d.prototype.xLng=function(t){return 360*t/this.worldSize-180},d.prototype.yLat=function(t){var e=180-360*t/this.worldSize;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90},d.prototype.setLocationAtPoint=function(t,e){var r=this.pointCoordinate(e)._sub(this.pointCoordinate(this.centerPoint));this.center=this.coordinateLocation(this.locationCoordinate(t)._sub(r))},d.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},d.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},d.prototype.locationCoordinate=function(t){return new o(this.lngX(t.lng)/this.tileSize,this.latY(t.lat)/this.tileSize,this.zoom).zoomTo(this.tileZoom)},d.prototype.coordinateLocation=function(t){var e=t.zoomTo(this.zoom);return new n(this.xLng(e.column*this.tileSize),this.yLat(e.row*this.tileSize))},d.prototype.pointCoordinate=function(t,e){void 0===e&&(e=this.tileZoom);var r=0,n=[t.x,t.y,0,1],i=[t.x,t.y,1,1];p.transformMat4(n,n,this.pixelMatrixInverse),p.transformMat4(i,i,this.pixelMatrixInverse);var a=n[3],u=i[3],l=n[0]/a,c=i[0]/u,h=n[1]/a,f=i[1]/u,d=n[2]/a,m=i[2]/u,y=d===m?0:(r-d)/(m-d);return new o(s(l,c,y)/this.tileSize,s(h,f,y)/this.tileSize,this.zoom)._zoomTo(e)},d.prototype.coordinatePoint=function(t){var e=t.zoomTo(this.zoom),r=[e.column*this.tileSize,e.row*this.tileSize,0,1];return p.transformMat4(r,r,this.pixelMatrix),new i(r[0]/r[3],r[1]/r[3])},d.prototype.calculatePosMatrix=function(t,e){var r=t.toCoordinate(e),n=this.worldSize/this.zoomScale(r.zoom),i=h.identity(new Float64Array(16));return h.translate(i,i,[r.column*n,r.row*n,0]),h.scale(i,i,[n/l,n/l,1]),h.multiply(i,this.projMatrix,i),new Float32Array(i)},d.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,e,r,n,o,a,s,u,l=this.size,c=this._unmodified;this.latRange&&(t=this.latY(this.latRange[1]),e=this.latY(this.latRange[0]),o=e-te&&(u=e-f)}if(this.lngRange){var d=this.x,m=l.x/2;d-mn&&(s=n-m)}void 0===s&&void 0===u||(this.center=this.unproject(new i(void 0!==s?s:this.x,void 0!==u?u:this.y))),this._unmodified=c,this._constraining=!1}},d.prototype._calcMatrices=function(){if(this.height){this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var t=this._fov/2,e=Math.PI/2+this._pitch,r=Math.sin(t)*this.cameraToCenterDistance/Math.sin(Math.PI-e-t),n=Math.cos(Math.PI/2-this._pitch)*r+this.cameraToCenterDistance,i=1.01*n,o=new Float64Array(16);h.perspective(o,this._fov,this.width/this.height,1,i),h.scale(o,o,[1,-1,1]),h.translate(o,o,[0,0,-this.cameraToCenterDistance]),h.rotateX(o,o,this._pitch),h.rotateZ(o,o,this.angle),h.translate(o,o,[-this.x,-this.y,0]);var a=this.worldSize/(2*Math.PI*6378137*Math.abs(Math.cos(this.center.lat*(Math.PI/180))));if(h.scale(o,o,[1,1,a,1]),this.projMatrix=o,o=h.create(),h.scale(o,o,[this.width/2,-this.height/2,1]),h.translate(o,o,[1,-1,0]),this.pixelMatrix=h.multiply(new Float64Array(16),o,this.projMatrix),o=h.invert(new Float64Array(16),this.pixelMatrix),!o)throw new Error("failed to invert matrix");this.pixelMatrixInverse=o}},Object.defineProperties(d.prototype,m),e.exports=d},{"../data/extent":11,"../source/tile_coord":51,"../util/interpolate":119,"../util/util":127,"./coordinate":18,"./lng_lat":19,"@mapbox/gl-matrix":131,"point-geometry":194}],22:[function(t,e,r){"use strict";var n,i=t("./util/worker_pool");e.exports=function(){return n||(n=new i),n}},{"./util/worker_pool":130}],23:[function(t,e,r){"use strict";var n={" ":[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,r,i){i=i||1;var o,a,s,u,l,c,p,h,f=[];for(o=0,a=t.length;o0?1/(1-t):1+t}function s(t){return t>0?1-1/(1.001-t):-t}function u(t,e,r,n){var i=[1,0],o=r.paint["raster-fade-duration"];if(t.sourceCache&&o>0){var a=Date.now(),s=(a-t.timeAdded)/o,u=e?(a-e.timeAdded)/o:-1,c=t.sourceCache.getSource(),p=n.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),h=!e||Math.abs(e.coord.z-p)>Math.abs(t.coord.z-p);i[0]=l.clamp(h?s:1-u,0,1),i[1]=e?1-i[0]:0}var f=r.paint["raster-opacity"];return i[0]*=f,i[1]*=f,i}var l=t("../util/util");e.exports=n},{"../util/util":127}],33:[function(t,e,r){"use strict";function n(t,e,r,n){if(!t.isOpaquePass){var o=!(r.layout["text-allow-overlap"]||r.layout["icon-allow-overlap"]||r.layout["text-ignore-placement"]||r.layout["icon-ignore-placement"]),a=t.gl;o?a.disable(a.STENCIL_TEST):a.enable(a.STENCIL_TEST),t.setDepthSublayer(0),t.depthMask(!1),i(t,e,r,n,!1,r.paint["icon-translate"],r.paint["icon-translate-anchor"],r.layout["icon-rotation-alignment"],r.layout["icon-rotation-alignment"],r.layout["icon-size"],r.paint["icon-halo-width"],r.paint["icon-halo-color"],r.paint["icon-halo-blur"],r.paint["icon-opacity"],r.paint["icon-color"]),i(t,e,r,n,!0,r.paint["text-translate"],r.paint["text-translate-anchor"],r.layout["text-rotation-alignment"],r.layout["text-pitch-alignment"],r.layout["text-size"],r.paint["text-halo-width"],r.paint["text-halo-color"],r.paint["text-halo-blur"],r.paint["text-opacity"],r.paint["text-color"]),e.map.showCollisionBoxes&&l(t,e,r,n)}}function i(t,e,r,n,i,s,u,l,c,p,h,f,d,m,y){if(i||!t.style.sprite||t.style.sprite.loaded()){var v=t.gl,g="map"===l,_="map"===c,x=_;x?v.enable(v.DEPTH_TEST):v.disable(v.DEPTH_TEST);for(var b,w=0,E=n;wthis.previousZoom;i--)n.changeTimes[i]=t,n.changeOpacities[i]=n.opacities[i];for(i=0;i<256;i++){var o=t-n.changeTimes[i],a=255*(r?o/r:1);i<=e?n.opacities[i]=n.changeOpacities[i]+a:n.opacities[i]=n.changeOpacities[i]-a}this.changed=!0,this.previousZoom=e},n.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))},e.exports=n},{}],35:[function(t,e,r){"use strict";var n=t("../util/util"),i=function(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={}};i.prototype.setSprite=function(t){this.sprite=t},i.prototype.getDash=function(t,e){var r=t.join(",")+e;return this.positions[r]||(this.positions[r]=this.addDash(t,e)),this.positions[r]},i.prototype.addDash=function(t,e){var r=this,i=e?7:0,o=2*i+1,a=128;if(this.nextRow+o>this.height)return n.warnOnce("LineAtlas out of space"),null;for(var s=0,u=0;u0?n.pop():null}},v.prototype.getViewportTexture=function(t,e){if(this.reusableTextures.viewport){var r=this.reusableTextures.viewport.texture;return r.width===t&&r.height===e?r:(this.gl.deleteTexture(r),void(this.reusableTextures.viewport.texture=null))}},v.prototype.lineWidth=function(t){this.gl.lineWidth(l.clamp(t,this.lineWidthRange[0],this.lineWidthRange[1]))},v.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 r=8,n=1/r;e.blendColor(n,n,n,0),e.clearColor(0,0,0,1),e.clear(e.COLOR_BUFFER_BIT)}else e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA)}},v.prototype.createProgram=function(t,e){var r=this.gl,i=r.createProgram(),o=m[t],a="#define MAPBOX_GL_JS\n#define DEVICE_PIXEL_RATIO "+n.devicePixelRatio.toFixed(1)+"\n";this._showOverdrawInspector&&(a+="#define OVERDRAW_INSPECTOR;\n");var s=r.createShader(r.FRAGMENT_SHADER);r.shaderSource(s,e.applyPragmas(a+m.prelude.fragmentSource+o.fragmentSource,"fragment")),r.compileShader(s),r.attachShader(i,s);var u=r.createShader(r.VERTEX_SHADER);r.shaderSource(u,e.applyPragmas(a+m.prelude.vertexSource+o.vertexSource,"vertex")),r.compileShader(u),r.attachShader(i,u),r.linkProgram(i);for(var l=r.getProgramParameter(i,r.ACTIVE_ATTRIBUTES),c={program:i,numAttributes:l},p=0;p>16,u>>16),i.uniform2f(r.u_pixel_coord_lower,65535&s,65535&u)}},{"../source/pixels_to_tile_units":45}],38:[function(t,e,r){"use strict";t("path");e.exports={prelude:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif\n\nfloat 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\n// The offset depends on how many pixels are between the world origin and 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 and the edge of the tile.\n// The glsl spec only guarantees 16 bits of 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:\nvec2 get_pattern_pos(const vec2 pixel_coord_upper, const vec2 pixel_coord_lower,\n const vec2 pattern_size, const float tile_units_to_pixels, const vec2 pos) {\n\n vec2 offset = mod(mod(mod(pixel_coord_upper, pattern_size) * 256.0, pattern_size) * 256.0 + pixel_coord_lower, pattern_size);\n return (tile_units_to_pixels * pos + offset) / pattern_size;\n}\n"},circle:{fragmentSource:"#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\n\nvarying vec2 v_extrude;\nvarying lowp float v_antialiasblur;\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize mediump float radius\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize lowp vec4 stroke_color\n #pragma mapbox: initialize mediump float stroke_width\n #pragma mapbox: initialize lowp float stroke_opacity\n\n float extrude_length = length(v_extrude);\n float antialiased_blur = -max(blur, v_antialiasblur);\n\n float opacity_t = smoothstep(0.0, antialiased_blur, extrude_length - 1.0);\n\n float color_t = stroke_width < 0.01 ? 0.0 : smoothstep(\n antialiased_blur,\n 0.0,\n extrude_length - radius / (radius + stroke_width)\n );\n\n gl_FragColor = opacity_t * mix(color * opacity, stroke_color * stroke_opacity, color_t);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform bool u_scale_with_map;\nuniform vec2 u_extrude_scale;\n\nattribute vec2 a_pos;\n\n#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\n\nvarying vec2 v_extrude;\nvarying lowp float v_antialiasblur;\n\nvoid main(void) {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize mediump float radius\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize lowp vec4 stroke_color\n #pragma mapbox: initialize mediump float stroke_width\n #pragma mapbox: initialize lowp float stroke_opacity\n\n // unencode the extrusion vector that we snuck into the a_pos vector\n v_extrude = vec2(mod(a_pos, 2.0) * 2.0 - 1.0);\n\n vec2 extrude = v_extrude * (radius + stroke_width) * u_extrude_scale;\n // multiply a_pos by 0.5, since we had it * 2 in order to sneak\n // in extrusion data\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5), 0, 1);\n\n if (u_scale_with_map) {\n gl_Position.xy += extrude;\n } else {\n gl_Position.xy += extrude * gl_Position.w;\n }\n\n // This is a minimum blur distance that serves as a faux-antialiasing for\n // the circle. since blur is a ratio of the circle's size and the intent is\n // to keep the blur at roughly 1px, the two are inversely related.\n v_antialiasblur = 1.0 / DEVICE_PIXEL_RATIO / (radius + stroke_width);\n}\n"},collisionBox:{fragmentSource:"uniform 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:"attribute 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"},debug:{fragmentSource:"uniform lowp vec4 u_color;\n\nvoid main() {\n gl_FragColor = u_color;\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, step(32767.0, a_pos.x), 1);\n}\n"},fill:{fragmentSource:"#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize lowp float opacity\n\n gl_FragColor = color * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\n#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n"},fillOutline:{fragmentSource:"#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:"attribute 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"},fillOutlinePattern:{fragmentSource:"uniform 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\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\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 // 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 * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_world;\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;\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, a_pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, a_pos);\n\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},fillPattern:{fragmentSource:"uniform 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\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\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) * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform 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\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, a_pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, a_pos);\n}\n"},fillExtrusion:{fragmentSource:"varying vec4 v_color;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 color\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n #pragma mapbox: initialize lowp vec4 color\n\n gl_FragColor = v_color;\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec3 u_lightcolor;\nuniform lowp vec3 u_lightpos;\nuniform lowp float u_lightintensity;\nuniform lowp vec4 u_outline_color;\n\nattribute vec2 a_pos;\nattribute vec3 a_normal;\nattribute float a_edgedistance;\n\nvarying vec4 v_color;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\n#pragma mapbox: define lowp vec4 color\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n #pragma mapbox: initialize lowp vec4 color\n\n float ed = a_edgedistance; // use each attrib in order to not trip a VAO assert\n float t = mod(a_normal.x, 2.0);\n\n gl_Position = u_matrix * vec4(a_pos, t > 0.0 ? height : base, 1);\n\n#ifdef OUTLINE\n color = u_outline_color;\n#endif\n\n // Relative luminance (how dark/bright is the surface color?)\n float colorvalue = color.r * 0.2126 + color.g * 0.7152 + color.b * 0.0722;\n\n v_color = vec4(0.0, 0.0, 0.0, 1.0);\n\n // Add slight ambient lighting so no extrusions are totally black\n vec4 ambientlight = vec4(0.03, 0.03, 0.03, 1.0);\n color += ambientlight;\n\n // Calculate cos(theta), where theta is the angle between surface normal and diffuse light ray\n float directional = clamp(dot(a_normal / 16384.0, u_lightpos), 0.0, 1.0);\n\n // Adjust directional so that\n // the range of values for highlight/shading is narrower\n // with lower light intensity\n // and with lighter/brighter surface colors\n directional = mix((1.0 - u_lightintensity), max((1.0 - colorvalue + u_lightintensity), 1.0), directional);\n\n // Add gradient along z axis of side surfaces\n if (a_normal.y != 0.0) {\n directional *= clamp((t + base) * pow(height / 150.0, 0.5), mix(0.7, 0.98, 1.0 - u_lightintensity), 1.0);\n }\n\n // Assign final color based on surface + ambient light color, diffuse light directional, and light color\n // with lower bounds adjusted to hue of light\n // so that shading is tinted with the complementary (opposite) color to the light color\n v_color.r += clamp(color.r * directional * u_lightcolor.r, mix(0.0, 0.3, 1.0 - u_lightcolor.r), 1.0);\n v_color.g += clamp(color.g * directional * u_lightcolor.g, mix(0.0, 0.3, 1.0 - u_lightcolor.g), 1.0);\n v_color.b += clamp(color.b * directional * u_lightcolor.b, mix(0.0, 0.3, 1.0 - u_lightcolor.b), 1.0);\n}\n"},fillExtrusionPattern:{fragmentSource:"uniform 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 vec4 v_lighting;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\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 vec4 mixedColor = mix(color1, color2, u_mix);\n\n gl_FragColor = mixedColor * v_lighting;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform 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;\nuniform float u_height_factor;\n\nuniform vec3 u_lightcolor;\nuniform lowp vec3 u_lightpos;\nuniform lowp float u_lightintensity;\n\nattribute vec2 a_pos;\nattribute vec3 a_normal;\nattribute float a_edgedistance;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec4 v_lighting;\nvarying float v_directional;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n\n float t = mod(a_normal.x, 2.0);\n float z = t > 0.0 ? height : base;\n\n gl_Position = u_matrix * vec4(a_pos, z, 1);\n\n vec2 pos = a_normal.x == 1.0 && a_normal.y == 0.0 && a_normal.z == 16384.0\n ? a_pos // extrusion top\n : vec2(a_edgedistance, z * u_height_factor); // extrusion side\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, pos);\n\n v_lighting = vec4(0.0, 0.0, 0.0, 1.0);\n float directional = clamp(dot(a_normal / 16383.0, u_lightpos), 0.0, 1.0);\n directional = mix((1.0 - u_lightintensity), max((0.5 + u_lightintensity), 1.0), directional);\n\n if (a_normal.y != 0.0) {\n directional *= clamp((t + base) * pow(height / 150.0, 0.5), mix(0.7, 0.98, 1.0 - u_lightintensity), 1.0);\n }\n\n v_lighting.rgb += clamp(directional * u_lightcolor, mix(vec3(0.0), vec3(0.3), 1.0 - u_lightcolor), vec3(1.0));\n}\n"},extrusionTexture:{fragmentSource:"uniform sampler2D u_texture;\nuniform float u_opacity;\n\nvarying vec2 v_pos;\n\nvoid main() {\n gl_FragColor = texture2D(u_texture, v_pos) * u_opacity;\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform int u_xdim;\nuniform int u_ydim;\nattribute vec2 a_pos;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n v_pos.x = a_pos.x / float(u_xdim);\n v_pos.y = 1.0 - a_pos.y / float(u_ydim);\n}\n"},line:{fragmentSource:"#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_width2;\nvarying vec2 v_normal;\nvarying float v_gamma_scale;\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\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\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform mediump float u_width;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump float gapwidth\n #pragma mapbox: initialize lowp float offset\n\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\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\n // these transformations used to be applied in the JS and native code bases. \n // moved them into the shader for clarity and simplicity. \n gapwidth = gapwidth / 2.0;\n float width = u_width / 2.0;\n offset = -1.0 * offset; \n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + width * (gapwidth > 0.0 ? 2.0 : 1.0) + 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 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit to get the position\n vec2 pos = floor(a_pos * 0.5);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_width2 = vec2(outset, inset);\n}\n"},linePattern:{fragmentSource:"uniform 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;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 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_width2.s / u_pattern_size_a.y);\n float y_b = 0.5 + (v_normal.y * v_width2.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 gl_FragColor = color * alpha * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"// 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\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 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_width;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n\nvoid main() {\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize lowp float offset\n #pragma mapbox: initialize mediump float gapwidth\n\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 // these transformations used to be applied in the JS and native code bases. \n // moved them into the shader for clarity and simplicity. \n gapwidth = gapwidth / 2.0;\n float width = u_width / 2.0;\n offset = -1.0 * offset; \n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + width * (gapwidth > 0.0 ? 2.0 : 1.0) + 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 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit to get the position\n vec2 pos = floor(a_pos * 0.5);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_linesofar = a_linesofar;\n v_width2 = vec2(outset, inset);\n}\n"},lineSDF:{fragmentSource:"\nuniform sampler2D u_image;\nuniform float u_sdfgamma;\nuniform float u_mix;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 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 = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n", -vertexSource:"// 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\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_patternscale_a;\nuniform float u_tex_y_a;\nuniform vec2 u_patternscale_b;\nuniform float u_tex_y_b;\nuniform vec2 u_gl_units_to_pixels;\nuniform mediump float u_width;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump float gapwidth\n #pragma mapbox: initialize lowp float offset\n\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 // these transformations used to be applied in the JS and native code bases. \n // moved them into the shader for clarity and simplicity. \n gapwidth = gapwidth / 2.0;\n float width = u_width / 2.0;\n offset = -1.0 * offset;\n \n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + width * (gapwidth > 0.0 ? 2.0 : 1.0) + 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 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit to get the position\n vec2 pos = floor(a_pos * 0.5);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\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 v_width2 = vec2(outset, inset);\n}\n"},raster:{fragmentSource:"uniform 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:"uniform 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"},symbolIcon:{fragmentSource:"uniform 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:"attribute 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"},symbolSDF:{fragmentSource:"uniform 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:"const 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;\n\n v_tex = a_tex / u_texsize;\n v_fade_tex = vec2(a_labelminzoom / 255.0, 0.0);\n}\n"}}},{path:191}],39:[function(t,e,r){"use strict";var n=function(){this.boundProgram=null,this.boundVertexBuffer=null,this.boundVertexBuffer2=null,this.boundElementBuffer=null,this.boundVertexOffset=null,this.vao=null};n.prototype.bind=function(t,e,r,n,i,o){void 0===t.extVertexArrayObject&&(t.extVertexArrayObject=t.getExtension("OES_vertex_array_object"));var a=!this.vao||this.boundProgram!==e||this.boundVertexBuffer!==r||this.boundVertexBuffer2!==i||this.boundElementBuffer!==n||this.boundVertexOffset!==o;!t.extVertexArrayObject||a?(this.freshBind(t,e,r,n,i,o),this.gl=t):t.extVertexArrayObject.bindVertexArrayOES(this.vao)},n.prototype.freshBind=function(t,e,r,n,i,o){var a,s=e.numAttributes;if(t.extVertexArrayObject)this.vao&&this.destroy(),this.vao=t.extVertexArrayObject.createVertexArrayOES(),t.extVertexArrayObject.bindVertexArrayOES(this.vao),a=0,this.boundProgram=e,this.boundVertexBuffer=r,this.boundVertexBuffer2=i,this.boundElementBuffer=n,this.boundVertexOffset=o;else{a=t.currentNumAttributes||0;for(var u=s;uthis.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,i={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("loadTile",i,function(n,i){if(t.unloadVectorData(),!t.aborted)return n?e(n):(t.loadVectorData(i,r.map.painter),t.redoWhenDone&&(t.redoWhenDone=!1,t.redoPlacement(r)),e(null))},this.workerID)},e.prototype.abortTile=function(t){t.aborted=!0},e.prototype.unloadTile=function(t){t.unloadVectorData(),this.dispatcher.send("removeTile",{uid:t.uid,type:this.type,source:this.id},function(){},t.workerID)},e.prototype.onRemove=function(){this.dispatcher.broadcast("removeSource",{type:this.type,source:this.id},function(){})},e.prototype.serialize=function(){return{type:this.type,data:this._data}},e}(i);e.exports=u},{"../data/extent":11,"../util/evented":116,"../util/util":127,"../util/window":110}],41:[function(t,e,r){"use strict";var n=t("../util/ajax"),i=t("geojson-rewind"),o=t("./geojson_wrapper"),a=t("vt-pbf"),s=t("supercluster"),u=t("geojson-vt"),l=t("./vector_tile_worker_source"),c=function(t){function e(e,r,n){t.call(this,e,r),n&&(this.loadGeoJSON=n),this._geoJSONIndexes={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.loadVectorData=function(t,e){var r=t.source,n=t.coord;if(!this._geoJSONIndexes[r])return e(null,null);var i=this._geoJSONIndexes[r].getTile(Math.min(n.z,t.maxZoom),n.x,n.y);if(!i)return e(null,null);var s=new o(i.features);s.name="_geojsonTileLayer";var u=a({layers:{_geojsonTileLayer:s}});0===u.byteOffset&&u.byteLength===u.buffer.byteLength||(u=new Uint8Array(u)),s.rawData=u.buffer,e(null,s)},e.prototype.loadData=function(t,e){var r=function(r,n){var o=this;return r?e(r):"object"!=typeof n?e(new Error("Input data is not a valid GeoJSON object.")):(i(n,!0),void this._indexData(n,t,function(r,n){return r?e(r):(o._geoJSONIndexes[t.source]=n,void e(null))}))}.bind(this);this.loadGeoJSON(t,r)},e.prototype.loadGeoJSON=function(t,e){if(t.url)n.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."))}}},e.prototype.removeSource=function(t){this._geoJSONIndexes[t.source]&&delete this._geoJSONIndexes[t.source]},e.prototype._indexData=function(t,e,r){try{e.cluster?r(null,s(e.superclusterOptions).load(t.features)):r(null,u(t,e.geojsonVtOptions))}catch(t){return r(t)}},e}(l);e.exports=c},{"../util/ajax":107,"./geojson_wrapper":42,"./vector_tile_worker_source":53,"geojson-rewind":137,"geojson-vt":141,supercluster:198,"vt-pbf":208}],42:[function(t,e,r){"use strict";var n=t("point-geometry"),i=t("vector-tile").VectorTileFeature,o=t("../data/extent"),a=function(t){var e=this;if(this.type=t.type,1===t.type){this.rawGeometry=[];for(var r=0;re)){var s=Math.pow(2,Math.min(a.coord.z,n._source.maxzoom)-Math.min(t.z,n._source.maxzoom));if(Math.floor(a.coord.x/s)===t.x&&Math.floor(a.coord.y/s)===t.y)for(r[o]=!0,i=!0;a&&a.coord.z-1>t.z;){var u=a.coord.parent(n._source.maxzoom).id;a=n._tiles[u],a&&a.hasData()&&(delete r[o],r[u]=!0)}}}return i},e.prototype.findLoadedParent=function(t,e,r){for(var n=this,i=t.z-1;i>=e;i--){t=t.parent(n._source.maxzoom);var o=n._tiles[t.id];if(o&&o.hasData())return r[t.id]=!0,o;if(n._cache.has(t.id))return n.addTile(t),r[t.id]=!0,n._tiles[t.id]}},e.prototype.updateCacheSize=function(t){var e=Math.ceil(t.width/t.tileSize)+1,r=Math.ceil(t.height/t.tileSize)+1,n=e*r,i=5;this._cache.setMaxSize(Math.floor(n*i))},e.prototype.update=function(t){var r=this;if(this._sourceLoaded){var n,i,o;this.updateCacheSize(t);var a=(this._source.roundZoom?Math.round:Math.floor)(this.getZoom(t)),s=Math.max(a-e.maxOverzooming,this._source.minzoom),l=Math.max(a+e.maxUnderzooming,this._source.minzoom),c={};this._coveredTiles={};var h;for(h=this.used?this._source.coord?[this._source.coord]:t.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}):[],n=0;n=Date.now()&&(r.findLoadedChildren(i,l,c)&&(c[y]=!0),r.findLoadedParent(i,s,f))}var v;for(v in f)c[v]||(r._coveredTiles[v]=!0);for(v in f)c[v]=!0;var g=p.keysDifference(this._tiles,c);for(n=0;nthis._source.maxzoom?Math.pow(2,n-this._source.maxzoom):1;e=new a(r,this._source.tileSize*i,this._source.maxzoom),this.loadTile(e,this._tileLoaded.bind(this,e))}return e.uses++,this._tiles[t.id]=e,this._source.fire("dataloading",{tile:e,coord:e.coord,dataType:"tile"}),e},e.prototype.removeTile=function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._source.fire("data",{tile:e,coord:e.coord,dataType:"tile"}),e.uses>0||(e.hasData()?this._cache.add(e.coord.wrapped().id,e):(e.aborted=!0,this.abortTile(e),this.unloadTile(e))))},e.prototype.clearTiles=function(){var t=this;for(var e in this._tiles)t.removeTile(e);this._cache.reset()},e.prototype.tilesIn=function(t){for(var e=this,r={},i=this.getIds(),o=1/0,a=1/0,s=-(1/0),l=-(1/0),p=t[0].zoom,f=0;f=0&&g[1].y>=0){for(var _=[],x=0;xe.row){var r=t;t=e,e=r}return{x0:t.column,y0:t.row,x1:e.column,y1:e.row,dx:e.column-t.column,dy:e.row-t.row}}function i(t,e,r,n,i){var o=Math.max(r,Math.floor(e.y0)),a=Math.min(n,Math.ceil(e.y1));if(t.x0===e.x0&&t.y0===e.y0?t.x0+e.dy/t.dy*t.dx0,p=e.dx<0,h=o;hc.dy&&(u=l,l=c,c=u),l.dy>p.dy&&(u=l,l=p,p=u),c.dy>p.dy&&(u=c,c=p,p=u),l.dy&&i(p,l,o,a,s),c.dy&&i(p,c,o,a,s)}function a(t,e,r){for(var n,i="",o=t;o>0;o--)n=1<t?new l(this.z-1,this.x,this.y,this.w):new l(this.z-1,Math.floor(this.x/2),Math.floor(this.y/2),this.w)},l.prototype.wrapped=function(){return new l(this.z,this.x,this.y,0)},l.prototype.children=function(t){if(this.z>=t)return[new l(this.z+1,this.x,this.y,this.w)];var e=this.z+1,r=2*this.x,n=2*this.y;return[new l(e,r,n,this.w),new l(e,r+1,n,this.w),new l(e,r,n+1,this.w),new l(e,r+1,n+1,this.w)]},l.cover=function(t,e,r){function n(t,e,n){var o,s,u;if(n>=0&&n<=i)for(o=t;othis.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,i={url:a(t.coord.url(this.tiles,this.maxzoom,this.scheme),this.url),uid:t.uid,coord:t.coord,zoom:t.coord.z,tileSize:this.tileSize*n,type:this.type,source:this.id,overscaling:n,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID?"loading"===t.state?t.reloadCallback=e:this.dispatcher.send("reloadTile",i,r.bind(this),t.workerID):t.workerID=this.dispatcher.send("loadTile",i,r.bind(this))},e.prototype.abortTile=function(t){this.dispatcher.send("abortTile",{uid:t.uid,type:this.type,source:this.id},null,t.workerID)},e.prototype.unloadTile=function(t){t.unloadVectorData(),this.dispatcher.send("removeTile",{uid:t.uid,type:this.type,source:this.id},null,t.workerID)},e}(n);e.exports=s},{"../util/evented":116,"../util/mapbox":123,"../util/util":127,"./load_tilejson":44}],53:[function(t,e,r){"use strict";var n=t("../util/ajax"),i=t("vector-tile"),o=t("pbf"),a=t("./worker_tile"),s=t("../util/util"),u=function(t,e,r){this.actor=t,this.layerIndex=e,r&&(this.loadVectorData=r),this.loading={},this.loaded={}};u.prototype.loadTile=function(t,e){function r(t,r){return delete this.loading[n][i],t?e(t):r?(o.vectorTile=r,o.parse(r,this.layerIndex,this.actor,function(t,n,i){return t?e(t):void e(null,s.extend({rawTileData:r.rawData},n),i)}),this.loaded[n]=this.loaded[n]||{},void(this.loaded[n][i]=o)):e(null,null)}var n=t.source,i=t.uid;this.loading[n]||(this.loading[n]={});var o=this.loading[n][i]=new a(t);o.abort=this.loadVectorData(t,r.bind(this))},u.prototype.reloadTile=function(t,e){function r(t,r){if(this.reloadCallback){var n=this.reloadCallback;delete this.reloadCallback,this.parse(this.vectorTile,o.layerIndex,o.actor,n)}e(t,r)}var n=this.loaded[t.source],i=t.uid,o=this;if(n&&n[i]){var a=n[i];"parsing"===a.status?a.reloadCallback=e:"done"===a.status&&a.parse(a.vectorTile,this.layerIndex,this.actor,r.bind(a))}},u.prototype.abortTile=function(t){var e=this.loading[t.source],r=t.uid;e&&e[r]&&e[r].abort&&(e[r].abort(),delete e[r])},u.prototype.removeTile=function(t){var e=this.loaded[t.source],r=t.uid;e&&e[r]&&delete e[r]},u.prototype.loadVectorData=function(t,e){function r(t,r){if(t)return e(t);var n=new i.VectorTile(new o(r));n.rawData=r,e(t,n)}var a=n.getArrayBuffer(t.url,r.bind(this));return function(){a.abort()}},u.prototype.redoPlacement=function(t,e){var r=this.loaded[t.source],n=this.loading[t.source],i=t.uid;if(r&&r[i]){var o=r[i],a=o.redoPlacement(t.angle,t.pitch,t.showCollisionBoxes);a.result&&e(null,a.result,a.transferables)}else n&&n[i]&&(n[i].angle=t.angle)},e.exports=u},{"../util/ajax":107,"../util/util":127,"./worker_tile":56,pbf:193,"vector-tile":204}],54:[function(t,e,r){"use strict";var n=t("../util/ajax"),i=t("./image_source"),o=function(t){function e(e,r,n,i){t.call(this,e,r,n,i),this.roundZoom=!0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._load=function(t){var e=this;this.urls=t.urls,n.getVideo(t.urls,function(t,r){if(t)return e.fire("error",{error:t});e.video=r,e.video.loop=!0;var n;e.video.addEventListener("playing",function(){n=e.map.style.animationLoop.set(1/0),e.map._rerender()}),e.video.addEventListener("pause",function(){e.map.style.animationLoop.cancel(n)}),e.map&&e.video.play(),e._finishLoading()})},e.prototype.getVideo=function(){return this.video},e.prototype.onAdd=function(t){this.map||(this.map=t,this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},e.prototype.prepare=function(){!this.tile||this.video.readyState<2||this._prepareImage(this.map.painter.gl,this.video)},e.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},e}(i);e.exports=o},{"../util/ajax":107,"./image_source":43}],55:[function(t,e,r){"use strict";var n=t("../util/actor"),i=t("../style/style_layer_index"),o=t("./vector_tile_worker_source"),a=t("./geojson_worker_source"),s=function(t){var e=this;this.self=t,this.actor=new n(t,this),this.layerIndexes={},this.workerSourceTypes={vector:o,geojson:a},this.workerSources={},this.self.registerWorkerSource=function(t,r){if(e.workerSourceTypes[t])throw new Error('Worker source with name "'+t+'" already registered.');e.workerSourceTypes[t]=r}};s.prototype.setLayers=function(t,e){this.getLayerIndex(t).replace(e)},s.prototype.updateLayers=function(t,e){this.getLayerIndex(t).update(e.layers,e.removedIds,e.symbolOrder)},s.prototype.loadTile=function(t,e,r){this.getWorkerSource(t,e.type).loadTile(e,r)},s.prototype.reloadTile=function(t,e,r){this.getWorkerSource(t,e.type).reloadTile(e,r)},s.prototype.abortTile=function(t,e){this.getWorkerSource(t,e.type).abortTile(e)},s.prototype.removeTile=function(t,e){this.getWorkerSource(t,e.type).removeTile(e)},s.prototype.removeSource=function(t,e){var r=this.getWorkerSource(t,e.type);void 0!==r.removeSource&&r.removeSource(e)},s.prototype.redoPlacement=function(t,e,r){this.getWorkerSource(t,e.type).redoPlacement(e,r)},s.prototype.loadWorkerSource=function(t,e,r){try{this.self.importScripts(e.url),r()}catch(t){r(t)}},s.prototype.getLayerIndex=function(t){var e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new i),e},s.prototype.getWorkerSource=function(t,e){var r=this;if(this.workerSources[t]||(this.workerSources[t]={}),!this.workerSources[t][e]){var n={send:function(e,n,i,o){r.actor.send(e,n,i,o,t)}};this.workerSources[t][e]=new this.workerSourceTypes[e](n,this.getLayerIndex(t))}return this.workerSources[t][e]},e.exports=function(t){return new s(t)}},{"../style/style_layer_index":69,"../util/actor":106,"./geojson_worker_source":41,"./vector_tile_worker_source":53}],56:[function(t,e,r){"use strict";function n(t,e){for(var r=0,n=t.layers;r=P.maxzoom||P.layout&&"none"===P.layout.visibility)){for(var I=0,L=M;I=0;D--){var O=y[e.symbolOrder[D]];O&&f.symbolBuckets.push(O)}if(0===this.symbolBuckets.length)return R(new a(this.angle,this.pitch,this.collisionBoxArray));var B=0,j=Object.keys(g.iconDependencies),F=l.mapObject(g.glyphDependencies,function(t){return Object.keys(t).map(Number)}),U=function(t){if(t)return h(t);if(B++,2===B){for(var e=new a(f.angle,f.pitch,f.collisionBoxArray),r=0,i=f.symbolBuckets;r=(new Date).getTime()}),!this.times.length},n.prototype.set=function(t){return this.times.push({id:this.n,time:t+(new Date).getTime()}),this.n++},n.prototype.cancel=function(t){this.times=this.times.filter(function(e){return e.id!==t})},e.exports=n},{}],58:[function(t,e,r){"use strict";var n=t("../util/evented"),i=t("../util/ajax"),o=t("../util/browser"),a=t("../util/mapbox").normalizeSpriteURL,s=function(){this.x=0,this.y=0,this.width=0,this.height=0,this.pixelRatio=1,this.sdf=!1},u=function(t){function e(e){var r=this;t.call(this),this.base=e,this.retina=o.devicePixelRatio>1;var n=this.retina?"@2x":"";i.getJSON(a(e,n,".json"),function(t,e){return t?void r.fire("error",{error:t}):(r.data=e,void(r.imgData&&r.fire("data",{dataType:"style"})))}),i.getImage(a(e,n,".png"),function(t,e){if(t)return void r.fire("error",{error:t});r.imgData=o.getImageData(e);for(var n=0;n1!==this.retina){var r=new e(this.base);r.on("data",function(){t.data=r.data,t.imgData=r.imgData,t.width=r.width,t.retina=r.retina})}},e.prototype.getSpritePosition=function(t){if(!this.loaded())return new s;var e=this.data&&this.data[t];return e&&this.imgData?e:new s},e}(n);e.exports=u},{"../util/ajax":107,"../util/browser":108,"../util/evented":116,"../util/mapbox":123}],59:[function(t,e,r){"use strict";var n=t("./style_spec"),i=t("../util/util"),o=t("../util/evented"),a=t("./validate_style"),s=t("./style_declaration"),u=t("./style_transition"),l="-transition",c=function(t){function e(e){t.call(this),this.properties=["anchor","color","position","intensity"],this._specifications=n.light,this.set(e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){var e=this;if(!this._validate(a.light,t)){this._declarations={},this._transitions={},this._transitionOptions={},this.calculated={},t=i.extend({anchor:this._specifications.anchor.default,color:this._specifications.color.default,position:this._specifications.position.default,intensity:this._specifications.intensity.default},t);for(var r=0,n=this.properties;rMath.floor(t)&&(e.lastIntegerZoom=Math.floor(t+1),e.lastIntegerZoomTime=Date.now()),e.lastZoom=t},e.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},e.prototype.update=function(t,e){var r=this;if(this._changed){var n=Object.keys(this._updatedLayers),i=Object.keys(this._removedLayers);(n.length||i.length||this._updatedSymbolOrder)&&this._updateWorkerLayers(n,i);for(var o in this._updatedSources){var a=r._updatedSources[o];"reload"===a?r._reloadSource(o):"clear"===a&&r._clearSource(o)}this._applyClasses(t,e),this._resetUpdates(),this.fire("data",{dataType:"style"})}},e.prototype._updateWorkerLayers=function(t,e){var r=this,n=this._updatedSymbolOrder?this._order.filter(function(t){return"symbol"===r._layers[t].type}):null;this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(t),removedIds:e,symbolOrder:n})},e.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSymbolOrder=!1,this._updatedSources={},this._updatedPaintProps={},this._updatedAllPaintProps=!1},e.prototype.setState=function(t){var e=this;if(this._checkLoaded(),y.emitErrors(this,y(t)))return!1;t=c.extend({},t),t.layers=E(t.layers);var r=T(this.serialize(),t).filter(function(t){return!(t.command in z)});if(0===r.length)return!1;var n=r.filter(function(t){return!(t.command in S)});if(n.length>0)throw new Error("Unimplemented: "+n.map(function(t){return t.command}).join(", ")+".");return r.forEach(function(t){"setTransition"!==t.command&&e[t.command].apply(e,t.args)}),this.stylesheet=t,!0},e.prototype.addSource=function(t,e,r){if(this._checkLoaded(),void 0!==this.sourceCaches[t])throw new Error("There is already a source with this ID");if(!e.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(e)+".");var n=["vector","raster","geojson","video","image"],i=n.indexOf(e.type)>=0;if(!i||!this._validate(y.source,"sources."+t,e,null,r)){var o=this.sourceCaches[t]=new _(t,e,this.dispatcher);o.style=this,o.setEventedParent(this,function(){return{isSourceLoaded:o.loaded(),source:o.serialize(),sourceId:t}}),o.onAdd(this.map),this._changed=!0}},e.prototype.removeSource=function(t){if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error("There is no source with this ID");var e=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],e.setEventedParent(null),e.clearTiles(),e.onRemove&&e.onRemove(this.map),this._changed=!0},e.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},e.prototype.addLayer=function(t,e,r){this._checkLoaded();var n=t.id;if(!this._validate(y.layer,"layers."+n,t,{arrayIndex:-1},r)){var o=i.create(t);this._validateLayer(o),o.setEventedParent(this,{layer:{id:n}});var a=e?this._order.indexOf(e):this._order.length;this._order.splice(a,0,n),this._layers[n]=o,this._removedLayers[n]&&(delete this._removedLayers[n],this._updatedSources[o.source]="clear"),this._updateLayer(o),"symbol"===o.type&&(this._updatedSymbolOrder=!0),this.updateClasses(n)}},e.prototype.moveLayer=function(t,e){this._checkLoaded(),this._changed=!0;var r=this._layers[t];if(!r)throw new Error("Layer not found: "+t);var n=this._order.indexOf(t);this._order.splice(n,1);var i=e?this._order.indexOf(e):this._order.length;this._order.splice(i,0,t),"symbol"===r.type&&(this._updatedSymbolOrder=!0,r.source&&!this._updatedSources[r.source]&&(this._updatedSources[r.source]="reload"))},e.prototype.removeLayer=function(t){this._checkLoaded();var e=this._layers[t];if(!e)throw new Error("Layer not found: "+t);e.setEventedParent(null);var r=this._order.indexOf(t);this._order.splice(r,1),"symbol"===e.type&&(this._updatedSymbolOrder=!0),this._changed=!0,this._removedLayers[t]=!0,delete this._layers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t]},e.prototype.getLayer=function(t){return this._layers[t]},e.prototype.setLayerZoomRange=function(t,e,r){this._checkLoaded();var n=this.getLayer(t);n.minzoom===e&&n.maxzoom===r||(null!=e&&(n.minzoom=e),null!=r&&(n.maxzoom=r),this._updateLayer(n))},e.prototype.setFilter=function(t,e){this._checkLoaded();var r=this.getLayer(t);null!==e&&void 0!==e&&this._validate(y.filter,"layers."+r.id+".filter",e)||c.deepEqual(r.filter,e)||(r.filter=c.clone(e),this._updateLayer(r))},e.prototype.getFilter=function(t){return c.clone(this.getLayer(t).filter)},e.prototype.setLayoutProperty=function(t,e,r){this._checkLoaded();var n=this.getLayer(t);c.deepEqual(n.getLayoutProperty(e),r)||(n.setLayoutProperty(e,r),this._updateLayer(n))},e.prototype.getLayoutProperty=function(t,e){return this.getLayer(t).getLayoutProperty(e)},e.prototype.setPaintProperty=function(t,e,r,n){this._checkLoaded();var i=this.getLayer(t);if(!c.deepEqual(i.getPaintProperty(e,n),r)){var o=i.isPaintValueFeatureConstant(e);i.setPaintProperty(e,r,n);var a=!(r&&b.isFunctionDefinition(r)&&"$zoom"!==r.property&&void 0!==r.property);a&&o||this._updateLayer(i),this.updateClasses(t,e)}},e.prototype.getPaintProperty=function(t,e,r){return this.getLayer(t).getPaintProperty(e,r)},e.prototype.getTransition=function(){return c.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},e.prototype.updateClasses=function(t,e){if(this._changed=!0,t){var r=this._updatedPaintProps;r[t]||(r[t]={}),r[t][e||"all"]=!0}else this._updatedAllPaintProps=!0},e.prototype.serialize=function(){var t=this;return c.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,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.sourceCaches,function(t){return t.serialize()}),layers:this._order.map(function(e){return t._layers[e].serialize()})},function(t){return void 0!==t})},e.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&(this._updatedSources[t.source]="reload"),this._changed=!0},e.prototype._flattenRenderedFeatures=function(t){for(var e=this,r=[],n=this._order.length-1;n>=0;n--)for(var i=e._order[n],o=0,a=t;o=this.maxzoom)||"none"===this.layout.visibility},e.prototype.updatePaintTransitions=function(t,e,r,n,o){for(var a=this,s=i.extend({},this._paintDeclarations[""]),u=0;u=this.endTime)return n;var o=this.oldTransition.calculate(t,e,this.startTime),a=i.easeCubicInOut((r-this.startTime-this.delay)/this.duration);return this.interp(o,n,a)},s.prototype._calculateTargetValue=function(t,e){if(!this.zoomTransitioned)return this.declaration.calculate(t,e);var r=t.zoom,n=this.zoomHistory.lastIntegerZoom,i=r>n?2:.5,a=this.declaration.calculate({zoom:r>n?r-1:r+1},e),s=this.declaration.calculate({zoom:r},e),u=Math.min((Date.now()-this.zoomHistory.lastIntegerZoomTime)/this.duration,1),l=Math.abs(r-n),c=o(u,1,l);return void 0!==a&&void 0!==s?{from:a,fromScale:i,to:s,toScale:1,t:c}:void 0},e.exports=s},{"../util/interpolate":119,"../util/util":127}],72:[function(t,e,r){"use strict";e.exports=t("mapbox-gl-style-spec/lib/validate_style.min"),e.exports.emitErrors=function(t,e){if(e&&e.length){for(var r=0;r-r/2;){if(a--,a<0)return!1;s-=t[a].dist(o),o=t[a]}s+=t[a].dist(t[a+1]),a++;for(var u=[],l=0;sn;)l-=u.shift().angleDelta;if(l>i)return!1;a++,s+=p.dist(h)}return!0}e.exports=n},{}],75:[function(t,e,r){"use strict";function n(t,e,r,n,o){for(var a=[],s=0;s=n&&h.x>=n||(p.x>=n?p=new i(n,p.y+(h.y-p.y)*((n-p.x)/(h.x-p.x)))._round():h.x>=n&&(h=new i(n,p.y+(h.y-p.y)*((n-p.x)/(h.x-p.x)))._round()),p.y>=o&&h.y>=o||(p.y>=o?p=new i(p.x+(h.x-p.x)*((o-p.y)/(h.y-p.y)),o)._round():h.y>=o&&(h=new i(p.x+(h.x-p.x)*((o-p.y)/(h.y-p.y)),o)._round()),u&&p.equals(u[u.length-1])||(u=[p],a.push(u)),u.push(h)))))}return a}var i=t("point-geometry");e.exports=n},{"point-geometry":194}],76:[function(t,e,r){"use strict";var n=t("../util/struct_array"),i=t("point-geometry"),o=n({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"}]});Object.defineProperty(o.prototype.StructType.prototype,"anchorPoint",{get:function(){return new i(this.anchorPointX,this.anchorPointY)}}),e.exports=o},{"../util/struct_array":125,"point-geometry":194}],77:[function(t,e,r){"use strict";var n=function(t,e,r,n,i,o,a,s,u,l,c){var p=a.top*s-u,h=a.bottom*s+u,f=a.left*s-u,d=a.right*s+u;if(this.boxStartIndex=t.length,l){var m=h-p,y=d-f;if(m>0)if(m=Math.max(10*s,m),c){var v=e[r.segment+1].sub(e[r.segment])._unit()._mult(y),g=[r.sub(v),r.add(v)];this._addLineCollisionBoxes(t,g,r,0,y,m,n,i,o)}else this._addLineCollisionBoxes(t,e,r,r.segment,y,m,n,i,o)}else t.emplaceBack(r.x,r.y,f,p,d,h,1/0,n,i,o,0,0,0,0,0);this.boxEndIndex=t.length};n.prototype._addLineCollisionBoxes=function(t,e,r,n,i,o,a,s,u){var l=o/2,c=Math.floor(i/l),p=-o/2,h=this.boxes,f=r,d=n+1,m=p;do{if(d--,d<0)return h;m-=e[d].dist(f),f=e[d]}while(m>-i/2);for(var y=e[d].dist(e[d+1]),v=0;v=e.length)return h;y=e[d].dist(e[d+1])}var _=g-m,x=e[d],b=e[d+1],w=b.sub(x)._unit()._mult(_)._add(x)._round(),E=Math.max(Math.abs(g-p)-l/2,0),T=i/2/E;t.emplaceBack(w.x,w.y,-o/2,-o/2,o/2,o/2,T,a,s,u,0,0,0,0,0)}return h},e.exports=n},{}],78:[function(t,e,r){"use strict";var n=t("point-geometry"),i=t("../data/extent"),o=t("grid-index"),a=t("../util/intersection_tests"),s=function(t,e,r){if("object"==typeof t){var n=t;r=e,t=n.angle,e=n.pitch,this.grid=new o(n.grid),this.ignoredGrid=new o(n.ignoredGrid)}else this.grid=new o(i,12,6),this.ignoredGrid=new o(i,12,0);this.minScale=.5,this.maxScale=2,this.angle=t,this.pitch=e;var a=Math.sin(t),s=Math.cos(t);if(this.rotationMatrix=[s,-a,a,s],this.reverseRotationMatrix=[s,a,-a,s],this.yStretch=1/Math.cos(e/180*Math.PI),this.yStretch=Math.pow(this.yStretch,1.3),this.collisionBoxArray=r,0===r.length){r.emplaceBack();var u=32767;r.emplaceBack(0,0,0,-u,0,u,u,0,0,0,0,0,0,0,0,0),r.emplaceBack(i,0,0,-u,0,u,u,0,0,0,0,0,0,0,0,0),r.emplaceBack(0,0,-u,0,u,0,u,0,0,0,0,0,0,0,0,0),r.emplaceBack(0,i,-u,0,u,0,u,0,0,0,0,0,0,0,0,0)}this.tempCollisionBox=r.get(0),this.edges=[r.get(1),r.get(2),r.get(3),r.get(4)]};s.prototype.serialize=function(t){var e=this.grid.toArrayBuffer(),r=this.ignoredGrid.toArrayBuffer();return t&&(t.push(e),t.push(r)),{angle:this.angle,pitch:this.pitch,grid:e,ignoredGrid:r}},s.prototype.placeCollisionFeature=function(t,e,r){for(var i=this,o=this.collisionBoxArray,a=this.minScale,s=this.rotationMatrix,u=this.yStretch,l=t.boxStartIndex;l=i.maxScale)return a}if(r){var w;if(i.angle){var E=i.reverseRotationMatrix,T=new n(c.x1,c.y1).matMult(E),S=new n(c.x2,c.y1).matMult(E),z=new n(c.x1,c.y2).matMult(E),A=new n(c.x2,c.y2).matMult(E);w=i.tempCollisionBox,w.anchorPointX=c.anchorPoint.x,w.anchorPointY=c.anchorPoint.y,w.x1=Math.min(T.x,S.x,z.x,A.x),w.y1=Math.min(T.y,S.x,z.x,A.x),w.x2=Math.max(T.x,S.x,z.x,A.x),w.y2=Math.max(T.y,S.x,z.x,A.x),w.maxScale=c.maxScale}else w=c;for(var M=0;M=i.maxScale)return a}}}return a},s.prototype.queryRenderedSymbols=function(t,e){var r={},i=[];if(0===t.length||0===this.grid.length&&0===this.ignoredGrid.length)return i;for(var o=this.collisionBoxArray,s=this.rotationMatrix,u=this.yStretch,l=[],c=1/0,p=1/0,h=-(1/0),f=-(1/0),d=0;dE.maxScale)){var z=E.anchorPoint.matMult(s),A=z.x+E.x1/e,M=z.y+E.y1/e*u,P=z.x+E.x2/e,I=z.y+E.y2/e*u,L=[new n(A,M),new n(P,M),new n(P,I),new n(A,I)];a.polygonIntersectsPolygon(l,L)&&(r[T][S]=!0,i.push(g[w]))}}return i},s.prototype.getPlacementScale=function(t,e,r,n,i){var o=e.x-n.x,a=e.y-n.y,s=(i.x1-r.x2)/o,u=(i.x2-r.x1)/o,l=(i.y1-r.y2)*this.yStretch/a,c=(i.y2-r.y1)*this.yStretch/a;(isNaN(s)||isNaN(u))&&(s=u=1),(isNaN(l)||isNaN(c))&&(l=c=1);var p=Math.min(Math.max(s,u),Math.max(l,c)),h=i.maxScale,f=r.maxScale;return p>h&&(p=h),p>f&&(p=f),p>t&&p>=i.placementScale&&(t=p),t},s.prototype.insertCollisionFeature=function(t,e,r){for(var n=this,i=r?this.ignoredGrid:this.grid,o=this.collisionBoxArray,a=t.boxStartIndex;a=0&&S=0&&z=0&&v+f<=d){var A=new a(S,z,E,_)._round();n&&!s(t,A,l,n,u)||g.push(A)}}y+=w}return p||g.length||c||(g=i(t,y/2,r,n,u,l,c,!0,h)),g}var o=t("../util/interpolate"),a=t("../symbol/anchor"),s=t("./check_max_angle");e.exports=n},{"../symbol/anchor":73,"../util/interpolate":119,"./check_max_angle":74}],80:[function(t,e,r){"use strict";var n=t("shelf-pack"),i=t("../util/util"),o=4,a=128,s=2048,u=function(){this.width=a,this.height=a,this.bin=new n(this.width,this.height),this.index={},this.ids={},this.data=new Uint8Array(this.width*this.height)};u.prototype.getGlyphs=function(){var t,e,r,n={};for(var i in this.ids)t=i.split("#"),e=t[0],r=t[1],n[e]||(n[e]=[]),n[e].push(r);return n},u.prototype.getRects=function(){var t,e,r,n=this,i={};for(var o in this.ids)t=o.split("#"),e=t[0],r=t[1],i[e]||(i[e]={}),i[e][r]=n.index[o];return i},u.prototype.addGlyph=function(t,e,r,n){var o=this;if(!r)return null;var a=e+"#"+r.id;if(this.index[a])return this.ids[a].indexOf(t)<0&&this.ids[a].push(t),this.index[a];if(!r.bitmap)return null;var s=r.width+2*n,u=r.height+2*n,l=1,c=s+2*l,p=u+2*l;c+=4-c%4,p+=4-p%4;var h=this.bin.packOne(c,p);if(h||(this.resize(),h=this.bin.packOne(c,p)),!h)return i.warnOnce("glyph bitmap overflow"),null;this.index[a]=h,this.ids[a]=[t];for(var f=this.data,d=r.bitmap,m=0;m=s||r>=s)){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),i=0;i65535)return r("glyphs > 65535 not supported");void 0===this.loading[t]&&(this.loading[t]={});var i=this.loading[t];if(i[e])i[e].push(r);else{i[e]=[r];var a=256*e+"-"+(256*e+255),u=n(t,a,this.url);o.getArrayBuffer(u,function(t,r){for(var n=!t&&new s(new l(r)),o=0;o1?2:1,this.canvas&&(this.canvas.width=this.width*this.pixelRatio,this.canvas.height=this.height*this.pixelRatio)),this.sprite=t},u.prototype.addIcons=function(t,e){for(var r=this,n=0;n1||(E?(clearTimeout(E),E=null,v("dblclick",e)):E=setTimeout(f,300))}function c(t){g("touchmove",t)}function p(t){g("touchend",t)}function h(t){g("touchcancel",t)}function f(){E=null}function d(t){var e=n.mousePos(_,t);e.equals(w)&&v("click",t)}function m(t){v("dblclick",t),t.preventDefault()}function y(e){var r=t.dragRotate&&t.dragRotate.isActive();b||r?b&&(x=e):v("contextmenu",e),e.preventDefault()}function v(e,r){var i=n.mousePos(_,r);return t.fire(e,{lngLat:t.unproject(i),point:i,originalEvent:r})}function g(e,r){var o=n.touchPos(_,r),a=o.reduce(function(t,e,r,n){return t.add(e.div(n.length))},new i(0,0));return t.fire(e,{lngLat:t.unproject(a),point:a,lngLats:o.map(function(e){return t.unproject(e)},this),points:o,originalEvent:r})}var _=t.getCanvasContainer(),x=null,b=!1,w=null,E=null;for(var T in o)t[T]=new o[T](t,e),e.interactive&&e[T]&&t[T].enable();_.addEventListener("mouseout",r,!1),_.addEventListener("mousedown",a,!1),_.addEventListener("mouseup",s,!1),_.addEventListener("mousemove",u,!1),_.addEventListener("touchstart",l,!1),_.addEventListener("touchend",p,!1),_.addEventListener("touchmove",c,!1),_.addEventListener("touchcancel",h,!1),_.addEventListener("click",d,!1),_.addEventListener("dblclick",m,!1),_.addEventListener("contextmenu",y,!1)}},{"../util/dom":115,"./handler/box_zoom":95,"./handler/dblclick_zoom":96,"./handler/drag_pan":97,"./handler/drag_rotate":98,"./handler/keyboard":99,"./handler/scroll_zoom":100,"./handler/touch_zoom_rotate":101,"point-geometry":194}],90:[function(t,e,r){"use strict";var n=t("../util/util"),i=t("../util/interpolate"),o=t("../util/browser"),a=t("../geo/lng_lat"),s=t("../geo/lng_lat_bounds"),u=t("point-geometry"),l=t("../util/evented"),c=function(t){function e(e,r){t.call(this),this.transform=e,this._bearingSnap=r.bearingSnap}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCenter=function(){return this.transform.center},e.prototype.setCenter=function(t,e){return this.jumpTo({center:t},e),this},e.prototype.panBy=function(t,e,r){return this.panTo(this.transform.center,n.extend({offset:u.convert(t).mult(-1)},e),r),this},e.prototype.panTo=function(t,e,r){return this.easeTo(n.extend({center:t},e),r)},e.prototype.getZoom=function(){return this.transform.zoom},e.prototype.setZoom=function(t,e){return this.jumpTo({zoom:t},e),this},e.prototype.zoomTo=function(t,e,r){return this.easeTo(n.extend({zoom:t},e),r)},e.prototype.zoomIn=function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},e.prototype.zoomOut=function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},e.prototype.getBearing=function(){return this.transform.bearing},e.prototype.setBearing=function(t,e){return this.jumpTo({bearing:t},e),this},e.prototype.rotateTo=function(t,e,r){return this.easeTo(n.extend({bearing:t},e),r)},e.prototype.resetNorth=function(t,e){return this.rotateTo(0,n.extend({duration:1e3},t),e),this},e.prototype.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 _=c.zoomScale(y-h),x=c.point,b="center"in t?c.project(m).sub(p.div(_)):x,w=t.curve,E=Math.max(c.width,c.height),T=E/_,S=b.sub(x).mag();if("minZoom"in t){var z=n.clamp(Math.min(t.minZoom,h,y),c.minZoom,c.maxZoom),A=E/c.zoomScale(z-h);w=Math.sqrt(A/S*2)}var M=w*w,P=r(0),I=function(t){return s(P)/s(P+w*t)},L=function(t){return E*((s(P)*l(P+w*t)-o(P))/M)/S},k=(r(1)-P)/w;if(Math.abs(S)<1e-6){if(Math.abs(E-T)<1e-6)return this.easeTo(t);var C=T=0)return!1;return!0}),this._container.innerHTML=t.join(" | "),this._editLink=null}},o.prototype._updateCompact=function(){var t=this._map.getCanvasContainer().offsetWidth<=640;this._container.classList[t?"add":"remove"]("compact")},e.exports=o},{"../../util/dom":115,"../../util/util":127}],92:[function(t,e,r){"use strict";function n(t){void 0!==i?t(i):void 0!==s.navigator.permissions?s.navigator.permissions.query({name:"geolocation"}).then(function(e){i="denied"!==e.state,t(i)}):(i=!!s.navigator.geolocation,t(i))}var i,o=t("../../util/evented"),a=t("../../util/dom"),s=t("../../util/window"),u=t("../../util/util"),l={enableHighAccuracy:!1,timeout:6e3},c="mapboxgl-ctrl",p=function(t){function e(e){t.call(this),this.options=e,u.bindAll(["_onSuccess","_onError","_finish","_setupUI"],this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.onAdd=function(t){return this._map=t,this._container=a.create("div",c+" "+c+"-group"),n(this._setupUI),this._container},e.prototype.onRemove=function(){this._container.parentNode.removeChild(this._container),this._map=void 0},e.prototype._onSuccess=function(t){this._map.jumpTo({center:[t.coords.longitude,t.coords.latitude],zoom:17,bearing:0,pitch:0}),this.fire("geolocate",t),this._finish()},e.prototype._onError=function(t){this.fire("error",t),this._finish()},e.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},e.prototype._setupUI=function(t){t!==!1&&(this._container.addEventListener("contextmenu",function(t){return t.preventDefault()}),this._geolocateButton=a.create("button",c+"-icon "+c+"-geolocate",this._container),this._geolocateButton.type="button",this._geolocateButton.setAttribute("aria-label","Geolocate"),this.options.watchPosition&&this._geolocateButton.setAttribute("aria-pressed",!1),this._geolocateButton.addEventListener("click",this._onClickGeolocate.bind(this)))},e.prototype._onClickGeolocate=function(){var t=u.extend(l,this.options&&this.options.positionOptions||{});this.options.watchPosition?void 0!==this._geolocationWatchID?(this._geolocateButton.classList.remove("watching"),this._geolocateButton.setAttribute("aria-pressed",!1),s.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0):(this._geolocateButton.classList.add("watching"),this._geolocateButton.setAttribute("aria-pressed",!0),this._geolocationWatchID=s.navigator.geolocation.watchPosition(this._onSuccess,this._onError,t)):(s.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,t),this._timeoutId=setTimeout(this._finish,1e4))},e}(o);e.exports=p},{"../../util/dom":115,"../../util/evented":116,"../../util/util":127,"../../util/window":110}],93:[function(t,e,r){"use strict";function n(t){return new o.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 i=t("../../util/dom"),o=t("../../util/window"),a=t("../../util/util"),s="mapboxgl-ctrl",u=function(){a.bindAll(["_rotateCompassArrow"],this)};u.prototype._rotateCompassArrow=function(){var t="rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassArrow.style.transform=t},u.prototype.onAdd=function(t){return this._map=t,this._container=i.create("div",s+" "+s+"-group",t.getContainer()),this._container.addEventListener("contextmenu",this._onContextMenu.bind(this)),this._zoomInButton=this._createButton(s+"-icon "+s+"-zoom-in","Zoom In",t.zoomIn.bind(t)),this._zoomOutButton=this._createButton(s+"-icon "+s+"-zoom-out","Zoom Out",t.zoomOut.bind(t)),this._compass=this._createButton(s+"-icon "+s+"-compass","Reset North",t.resetNorth.bind(t)),this._compassArrow=i.create("span","arrow",this._compass),this._compass.addEventListener("mousedown",this._onCompassDown.bind(this)),this._onCompassMove=this._onCompassMove.bind(this),this._onCompassUp=this._onCompassUp.bind(this),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._container},u.prototype.onRemove=function(){this._container.parentNode.removeChild(this._container),this._map.off("rotate",this._rotateCompassArrow),this._map=void 0},u.prototype._onContextMenu=function(t){t.preventDefault()},u.prototype._onCompassDown=function(t){0===t.button&&(i.disableDrag(),o.document.addEventListener("mousemove",this._onCompassMove),o.document.addEventListener("mouseup",this._onCompassUp),this._map.getCanvasContainer().dispatchEvent(n(t)),t.stopPropagation())},u.prototype._onCompassMove=function(t){0===t.button&&(this._map.getCanvasContainer().dispatchEvent(n(t)),t.stopPropagation())},u.prototype._onCompassUp=function(t){0===t.button&&(o.document.removeEventListener("mousemove",this._onCompassMove),o.document.removeEventListener("mouseup",this._onCompassUp),i.enableDrag(),this._map.getCanvasContainer().dispatchEvent(n(t)),t.stopPropagation())},u.prototype._createButton=function(t,e,r){var n=i.create("button",t,this._container);return n.type="button",n.setAttribute("aria-label",e),n.addEventListener("click",function(){r()}),n},e.exports=u},{"../../util/dom":115,"../../util/util":127,"../../util/window":110}],94:[function(t,e,r){"use strict";function n(t,e,r){var n=r&&r.maxWidth||100,a=t._container.clientHeight/2,s=o(t.unproject([0,a]),t.unproject([n,a]));if(r&&"imperial"===r.unit){var u=3.2808*s;if(u>5280){var l=u/5280;i(e,n,l,"mi")}else i(e,n,u,"ft")}else i(e,n,s,"m")}function i(t,e,r,n){var i=a(r),o=i/r;"m"===n&&i>=1e3&&(i/=1e3,n="km"),t.style.width=e*o+"px",t.innerHTML=i+n}function o(t,e){var r=6371e3,n=Math.PI/180,i=t.lat*n,o=e.lat*n,a=Math.sin(i)*Math.sin(o)+Math.cos(i)*Math.cos(o)*Math.cos((e.lng-t.lng)*n),s=r*Math.acos(Math.min(a,1));return s}function a(t){var e=Math.pow(10,(""+Math.floor(t)).length-1),r=t/e;return r=r>=10?10:r>=5?5:r>=3?3:r>=2?2:1,e*r}var s=t("../../util/dom"),u=t("../../util/util"),l=function(t){this.options=t,u.bindAll(["_onMove"],this)};l.prototype.getDefaultPosition=function(){return"bottom-left"},l.prototype._onMove=function(){n(this._map,this._container,this.options)},l.prototype.onAdd=function(t){return this._map=t,this._container=s.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},l.prototype.onRemove=function(){this._container.parentNode.removeChild(this._container),this._map.off("move",this._onMove),this._map=void 0},e.exports=l},{"../../util/dom":115,"../../util/util":127}],95:[function(t,e,r){"use strict";var n=t("../../util/dom"),i=t("../../geo/lng_lat_bounds"),o=t("../../util/util"),a=t("../../util/window"),s=function(t){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),o.bindAll(["_onMouseDown","_onMouseMove","_onMouseUp","_onKeyDown"],this)};s.prototype.isEnabled=function(){return!!this._enabled},s.prototype.isActive=function(){return!!this._active},s.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onMouseDown,!1),this._enabled=!0)},s.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onMouseDown),this._enabled=!1)},s.prototype._onMouseDown=function(t){t.shiftKey&&0===t.button&&(a.document.addEventListener("mousemove",this._onMouseMove,!1),a.document.addEventListener("keydown",this._onKeyDown,!1),a.document.addEventListener("mouseup",this._onMouseUp,!1),n.disableDrag(),this._startPos=n.mousePos(this._el,t),this._active=!0)},s.prototype._onMouseMove=function(t){var e=this._startPos,r=n.mousePos(this._el,t);this._box||(this._box=n.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var i=Math.min(e.x,r.x),o=Math.max(e.x,r.x),a=Math.min(e.y,r.y),s=Math.max(e.y,r.y);n.setTransform(this._box,"translate("+i+"px,"+a+"px)"),this._box.style.width=o-i+"px",this._box.style.height=s-a+"px"},s.prototype._onMouseUp=function(t){if(0===t.button){var e=this._startPos,r=n.mousePos(this._el,t),o=(new i).extend(this._map.unproject(e)).extend(this._map.unproject(r));this._finish(),e.x===r.x&&e.y===r.y?this._fireEvent("boxzoomcancel",t):this._map.fitBounds(o,{linear:!0}).fire("boxzoomend",{originalEvent:t,boxZoomBounds:o})}},s.prototype._onKeyDown=function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t))},s.prototype._finish=function(){this._active=!1,a.document.removeEventListener("mousemove",this._onMouseMove,!1),a.document.removeEventListener("keydown",this._onKeyDown,!1),a.document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.parentNode.removeChild(this._box),this._box=null),n.enableDrag()},s.prototype._fireEvent=function(t,e){return this._map.fire(t,{originalEvent:e})},e.exports=s},{"../../geo/lng_lat_bounds":20,"../../util/dom":115,"../../util/util":127,"../../util/window":110}],96:[function(t,e,r){"use strict";var n=function(t){this._map=t,this._onDblClick=this._onDblClick.bind(this)};n.prototype.isEnabled=function(){return!!this._enabled},n.prototype.enable=function(){this.isEnabled()||(this._map.on("dblclick",this._onDblClick),this._enabled=!0)},n.prototype.disable=function(){this.isEnabled()&&(this._map.off("dblclick",this._onDblClick),this._enabled=!1)},n.prototype._onDblClick=function(t){this._map.zoomTo(this._map.getZoom()+(t.originalEvent.shiftKey?-1:1),{around:t.lngLat},t)},e.exports=n},{}],97:[function(t,e,r){"use strict";var n=t("../../util/dom"),i=t("../../util/util"),o=t("../../util/window"),a=.3,s=i.bezier(0,0,a,1),u=1400,l=2500,c=function(t){this._map=t,this._el=t.getCanvasContainer(),i.bindAll(["_onDown","_onMove","_onUp","_onTouchEnd","_onMouseUp"],this)};c.prototype.isEnabled=function(){return!!this._enabled},c.prototype.isActive=function(){return!!this._active},c.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._el.addEventListener("touchstart",this._onDown),this._enabled=!0)},c.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._el.removeEventListener("touchstart",this._onDown),this._enabled=!1)},c.prototype._onDown=function(t){this._ignoreEvent(t)||this.isActive()||(t.touches?(o.document.addEventListener("touchmove",this._onMove),o.document.addEventListener("touchend",this._onTouchEnd)):(o.document.addEventListener("mousemove",this._onMove),o.document.addEventListener("mouseup",this._onMouseUp)),this._active=!1,this._startPos=this._pos=n.mousePos(this._el,t),this._inertia=[[Date.now(),this._pos]])},c.prototype._onMove=function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._fireEvent("dragstart",t),this._fireEvent("movestart",t));var e=n.mousePos(this._el,t),r=this._map;r.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),e]),r.transform.setLocationAtPoint(r.transform.pointLocation(this._pos),e), -this._fireEvent("drag",t),this._fireEvent("move",t),this._pos=e,t.preventDefault()}},c.prototype._onUp=function(t){var e=this;if(this.isActive()){this._active=!1,this._fireEvent("dragend",t),this._drainInertiaBuffer();var r=function(){return e._fireEvent("moveend",t)},n=this._inertia;if(n.length<2)return void r();var i=n[n.length-1],o=n[0],c=i[1].sub(o[1]),p=(i[0]-o[0])/1e3;if(0===p||i[1].equals(o[1]))return void r();var h=c.mult(a/p),f=h.mag();f>u&&(f=u,h._unit()._mult(f));var d=f/(l*a),m=h.mult(-d/2);this._map.panBy(m,{duration:1e3*d,easing:s,noMoveStart:!0},{originalEvent:t})}},c.prototype._onMouseUp=function(t){this._ignoreEvent(t)||(this._onUp(t),o.document.removeEventListener("mousemove",this._onMove),o.document.removeEventListener("mouseup",this._onMouseUp))},c.prototype._onTouchEnd=function(t){this._ignoreEvent(t)||(this._onUp(t),o.document.removeEventListener("touchmove",this._onMove),o.document.removeEventListener("touchend",this._onTouchEnd))},c.prototype._fireEvent=function(t,e){return this._map.fire(t,{originalEvent:e})},c.prototype._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 r=1,n=0;return"mousemove"===t.type?t.buttons&0===r:t.button!==n},c.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,e=Date.now(),r=160;t.length>0&&e-t[0][0]>r;)t.shift()},e.exports=c},{"../../util/dom":115,"../../util/util":127,"../../util/window":110}],98:[function(t,e,r){"use strict";var n=t("../../util/dom"),i=t("../../util/util"),o=t("../../util/window"),a=.25,s=i.bezier(0,0,a,1),u=180,l=720,c=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._bearingSnap=e.bearingSnap,this._pitchWithRotate=e.pitchWithRotate!==!1,i.bindAll(["_onDown","_onMove","_onUp"],this)};c.prototype.isEnabled=function(){return!!this._enabled},c.prototype.isActive=function(){return!!this._active},c.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._enabled=!0)},c.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._enabled=!1)},c.prototype._onDown=function(t){this._ignoreEvent(t)||this.isActive()||(o.document.addEventListener("mousemove",this._onMove),o.document.addEventListener("mouseup",this._onUp),this._active=!1,this._inertia=[[Date.now(),this._map.getBearing()]],this._startPos=this._pos=n.mousePos(this._el,t),this._center=this._map.transform.centerPoint,t.preventDefault())},c.prototype._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 r=this._pos,i=n.mousePos(this._el,t),o=.8*(r.x-i.x),a=(r.y-i.y)*-.5,s=e.getBearing()-o,u=e.getPitch()-a,l=this._inertia,c=l[l.length-1];this._drainInertiaBuffer(),l.push([Date.now(),e._normalizeBearing(s,c[1])]),e.transform.bearing=s,this._pitchWithRotate&&(e.transform.pitch=u),this._fireEvent("rotate",t),this._fireEvent("move",t),this._pos=i}},c.prototype._onUp=function(t){var e=this;if(!this._ignoreEvent(t)&&(o.document.removeEventListener("mousemove",this._onMove),o.document.removeEventListener("mouseup",this._onUp),this.isActive())){this._active=!1,this._fireEvent("rotateend",t),this._drainInertiaBuffer();var r=this._map,n=r.getBearing(),i=this._inertia,c=function(){Math.abs(n)u&&(g=u);var _=g/(l*a),x=y*g*(_/2);d+=x,Math.abs(r._normalizeBearing(d,0))1;var r=t.ctrlKey?1:2,n=t.ctrlKey?0:2,i=t.button;return"undefined"!=typeof InstallTrigger&&2===t.button&&t.ctrlKey&&o.navigator.platform.toUpperCase().indexOf("MAC")>=0&&(i=0),"mousemove"===t.type?t.buttons&0===r:i!==n},c.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,e=Date.now(),r=160;t.length>0&&e-t[0][0]>r;)t.shift()},e.exports=c},{"../../util/dom":115,"../../util/util":127,"../../util/window":110}],99:[function(t,e,r){"use strict";function n(t){return t*(2-t)}var i=100,o=15,a=10,s=function(t){this._map=t,this._el=t.getCanvasContainer(),this._onKeyDown=this._onKeyDown.bind(this)};s.prototype.isEnabled=function(){return!!this._enabled},s.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)},s.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)},s.prototype._onKeyDown=function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=0,r=0,s=0,u=0,l=0;switch(t.keyCode){case 61:case 107:case 171:case 187:e=1;break;case 189:case 109:case 173:e=-1;break;case 37:t.shiftKey?r=-1:(t.preventDefault(),u=-1);break;case 39:t.shiftKey?r=1:(t.preventDefault(),u=1);break;case 38:t.shiftKey?s=1:(t.preventDefault(),l=-1);break;case 40:t.shiftKey?s=-1:(l=1,t.preventDefault())}var c=this._map,p=c.getZoom(),h={duration:300,delayEndEvents:500,easing:n,zoom:e?Math.round(p)+e*(t.shiftKey?2:1):p,bearing:c.getBearing()+r*o,pitch:c.getPitch()+s*a,offset:[-u*i,-l*i],center:c.getCenter()};c.easeTo(h,{originalEvent:t})}},e.exports=s},{}],100:[function(t,e,r){"use strict";var n=t("../../util/dom"),i=t("../../util/util"),o=t("../../util/browser"),a=t("../../util/window"),s=a.navigator.userAgent.toLowerCase(),u=s.indexOf("firefox")!==-1,l=s.indexOf("safari")!==-1&&s.indexOf("chrom")===-1,c=function(t){this._map=t,this._el=t.getCanvasContainer(),i.bindAll(["_onWheel","_onTimeout"],this)};c.prototype.isEnabled=function(){return!!this._enabled},c.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("wheel",this._onWheel,!1),this._el.addEventListener("mousewheel",this._onWheel,!1),this._enabled=!0)},c.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("wheel",this._onWheel),this._el.removeEventListener("mousewheel",this._onWheel),this._enabled=!1)},c.prototype._onWheel=function(t){var e;"wheel"===t.type?(e=t.deltaY,u&&t.deltaMode===a.WheelEvent.DOM_DELTA_PIXEL&&(e/=o.devicePixelRatio),t.deltaMode===a.WheelEvent.DOM_DELTA_LINE&&(e*=40)):"mousewheel"===t.type&&(e=-t.wheelDeltaY,l&&(e/=3));var r=o.now(),i=r-(this._time||0);this._pos=n.mousePos(this._el,t),this._time=r,0!==e&&e%4.000244140625===0?this._type="wheel":0!==e&&Math.abs(e)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40)):this._type||(this._type=Math.abs(i*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()},c.prototype._onTimeout=function(){this._type="wheel",this._zoom(-this._lastValue)},c.prototype._zoom=function(t,e){if(0!==t){var r=this._map,n=2/(1+Math.exp(-Math.abs(t/100)));t<0&&0!==n&&(n=1/n);var i=r.ease?r.ease.to:r.transform.scale,o=r.transform.scaleZoom(i*n);r.zoomTo(o,{duration:"wheel"===this._type?200:0,around:r.unproject(this._pos),delayEndEvents:200,smoothEasing:!0},{originalEvent:e})}},e.exports=c},{"../../util/browser":108,"../../util/dom":115,"../../util/util":127,"../../util/window":110}],101:[function(t,e,r){"use strict";var n=t("../../util/dom"),i=t("../../util/util"),o=t("../../util/window"),a=.15,s=i.bezier(0,0,a,1),u=12,l=2.5,c=.15,p=4,h=function(t){this._map=t,this._el=t.getCanvasContainer(),i.bindAll(["_onStart","_onMove","_onEnd"],this)};h.prototype.isEnabled=function(){return!!this._enabled},h.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("touchstart",this._onStart,!1),this._enabled=!0)},h.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("touchstart",this._onStart),this._enabled=!1)},h.prototype.disableRotation=function(){this._rotationDisabled=!0},h.prototype.enableRotation=function(){this._rotationDisabled=!1},h.prototype._onStart=function(t){if(2===t.touches.length){var e=n.mousePos(this._el,t.touches[0]),r=n.mousePos(this._el,t.touches[1]);this._startVec=e.sub(r),this._startScale=this._map.transform.scale,this._startBearing=this._map.transform.bearing,this._gestureIntent=void 0,this._inertia=[],o.document.addEventListener("touchmove",this._onMove,!1),o.document.addEventListener("touchend",this._onEnd,!1)}},h.prototype._onMove=function(t){if(2===t.touches.length){var e=n.mousePos(this._el,t.touches[0]),r=n.mousePos(this._el,t.touches[1]),i=e.add(r).div(2),o=e.sub(r),a=o.mag()/this._startVec.mag(),s=this._rotationDisabled?0:180*o.angleWith(this._startVec)/Math.PI,u=this._map;if(this._gestureIntent){var l={duration:0,around:u.unproject(i)};"rotate"===this._gestureIntent&&(l.bearing=this._startBearing+s),"zoom"!==this._gestureIntent&&"rotate"!==this._gestureIntent||(l.zoom=u.transform.scaleZoom(this._startScale*a)),u.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),a,i]),u.easeTo(l,{originalEvent:t})}else{var h=Math.abs(1-a)>c,f=Math.abs(s)>p;f?this._gestureIntent="rotate":h&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._startVec=o,this._startScale=u.transform.scale,this._startBearing=u.transform.bearing)}t.preventDefault()}},h.prototype._onEnd=function(t){o.document.removeEventListener("touchmove",this._onMove),o.document.removeEventListener("touchend",this._onEnd),this._drainInertiaBuffer();var e=this._inertia,r=this._map;if(e.length<2)return void r.snapToNorth({},{originalEvent:t});var n=e[e.length-1],i=e[0],c=r.transform.scaleZoom(this._startScale*n[1]),p=r.transform.scaleZoom(this._startScale*i[1]),h=c-p,f=(n[0]-i[0])/1e3,d=n[2];if(0===f||c===p)return void r.snapToNorth({},{originalEvent:t});var m=h*a/f;Math.abs(m)>l&&(m=m>0?l:-l);var y=1e3*Math.abs(m/(u*a)),v=c+m*y/2e3;v<0&&(v=0),r.easeTo({zoom:v,duration:y,easing:s,around:r.unproject(d)},{originalEvent:t})},h.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,e=Date.now(),r=160;t.length>2&&e-t[0][0]>r;)t.shift()},e.exports=h},{"../../util/dom":115,"../../util/util":127,"../../util/window":110}],102:[function(t,e,r){"use strict";var n=t("../util/util"),i=t("../util/window"),o=function(){n.bindAll(["_onHashChange","_updateHash"],this)};o.prototype.addTo=function(t){return this._map=t,i.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},o.prototype.remove=function(){return i.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),delete this._map,this},o.prototype._onHashChange=function(){var t=i.location.hash.replace("#","").split("/");return t.length>=3&&(this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:+(t[3]||0),pitch:+(t[4]||0)}),!0)},o.prototype._updateHash=function(){var t=this._map.getCenter(),e=this._map.getZoom(),r=this._map.getBearing(),n=this._map.getPitch(),o=Math.max(0,Math.ceil(Math.log(e)/Math.LN2)),a="#"+Math.round(100*e)/100+"/"+t.lat.toFixed(o)+"/"+t.lng.toFixed(o);(r||n)&&(a+="/"+Math.round(10*r)/10),n&&(a+="/"+Math.round(n)),i.history.replaceState("","",a)},e.exports=o},{"../util/util":127,"../util/window":110}],103:[function(t,e,r){"use strict";function n(t){t.parentNode&&t.parentNode.removeChild(t)}var i=t("../util/util"),o=t("../util/browser"),a=t("../util/window"),s=t("../util/dom"),u=t("../style/style"),l=t("../style/animation_loop"),c=t("../render/painter"),p=t("../geo/transform"),h=t("./hash"),f=t("./bind_handlers"),d=t("./camera"),m=t("../geo/lng_lat"),y=t("../geo/lng_lat_bounds"),v=t("point-geometry"),g=t("./control/attribution_control"),_=t("mapbox-gl-supported"),x=0,b=20,w={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:x,maxZoom:b,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},E=function(t){function e(e){var r=this;e=i.extend({},w,e);var n=new p(e.minZoom,e.maxZoom);if(t.call(this,n,e),this._interactive=e.interactive,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,"string"==typeof e.container){if(this._container=a.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else this._container=e.container;this.animationLoop=new l,e.maxBounds&&this.setMaxBounds(e.maxBounds),i.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored","_update","_render","_onData","_onDataLoading"],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(){r.animationLoop.set(300),r._rerender()}),"undefined"!=typeof a&&(a.addEventListener("online",this._onWindowOnline,!1),a.addEventListener("resize",this._onWindowResize,!1)),f(this,e),this._hash=e.hash&&(new h).addTo(this),this._hash&&this._hash._onHashChange()||this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),this._classes=[],this.resize(),e.classes&&this.setClasses(e.classes),e.style&&this.setStyle(e.style),e.attributionControl&&this.addControl(new g),this.on("style.load",function(){this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this.style.update(this._classes,{transition:!1})}),this.on("data",this._onData),this.on("dataloading",this._onDataLoading)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={showTileBoundaries:{},showCollisionBoxes:{},showOverdrawInspector:{},repaint:{},vertices:{}};return e.prototype.addControl=function(t,e){void 0===e&&t.getDefaultPosition&&(e=t.getDefaultPosition()),void 0===e&&(e="top-right");var r=t.onAdd(this),n=this._controlPositions[e];return e.indexOf("bottom")!==-1?n.insertBefore(r,n.firstChild):n.appendChild(r),this},e.prototype.removeControl=function(t){return t.onRemove(this),this},e.prototype.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))},e.prototype.removeClass=function(t,e){var r=this._classes.indexOf(t);return r<0||""===t?this:(this._classes.splice(r,1),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},e.prototype.setClasses=function(t,e){for(var r={},n=0;n=0},e.prototype.getClasses=function(){return this._classes},e.prototype.resize=function(){var t=this._containerDimensions(),e=t[0],r=t[1];return this._resizeCanvas(e,r),this.transform.resize(e,r),this.painter.resize(e,r),this.fire("movestart").fire("move").fire("resize").fire("moveend")},e.prototype.getBounds=function(){var t=new y(this.transform.pointLocation(new v(0,this.transform.height)),this.transform.pointLocation(new v(this.transform.width,0)));return(this.transform.angle||this.transform.pitch)&&(t.extend(this.transform.pointLocation(new v(this.transform.size.x,0))),t.extend(this.transform.pointLocation(new v(0,this.transform.size.y)))),t},e.prototype.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},e.prototype.setMinZoom=function(t){if(t=null===t||void 0===t?x:t,t>=x&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},e.prototype.getMaxZoom=function(){return this.transform.maxZoom},e.prototype.project=function(t){return this.transform.locationPoint(m.convert(t))},e.prototype.unproject=function(t){return this.transform.pointLocation(v.convert(t))},e.prototype.queryRenderedFeatures=function(){function t(t){return t instanceof v||Array.isArray(t)}var e,r={};return 2===arguments.length?(e=arguments[0],r=arguments[1]):1===arguments.length&&t(arguments[0])?e=arguments[0]:1===arguments.length&&(r=arguments[0]),this.style.queryRenderedFeatures(this._makeQueryGeometry(e),r,this.transform.zoom,this.transform.angle)},e.prototype._makeQueryGeometry=function(t){var e=this;void 0===t&&(t=[v.convert([0,0]),v.convert([this.transform.width,this.transform.height])]);var r,n=t instanceof v||"number"==typeof t[0];if(n){var i=v.convert(t);r=[i]}else{var o=[v.convert(t[0]),v.convert(t[1])];r=[o[0],new v(o[1].x,o[0].y),o[1],new v(o[0].x,o[1].y),o[0]]}return r=r.map(function(t){return e.transform.pointCoordinate(t)})},e.prototype.querySourceFeatures=function(t,e){return this.style.querySourceFeatures(t,e)},e.prototype.setStyle=function(t,e){var r=(!e||e.diff!==!1)&&this.style&&t&&!(t instanceof u)&&"string"!=typeof t;if(r)try{return this.style.setState(t)&&this._update(!0),this}catch(t){i.warnOnce("Unable to perform style diff: "+(t.message||t.error||t)+". Rebuilding the style from scratch.")}return this.style&&(this.style.setEventedParent(null),this.style._remove(),this.off("rotate",this.style._redoPlacement),this.off("pitch",this.style._redoPlacement)),t?(t instanceof u?this.style=t:this.style=new u(t,this),this.style.setEventedParent(this,{style:this.style}),this.on("rotate",this.style._redoPlacement),this.on("pitch",this.style._redoPlacement),this):(this.style=null,this)},e.prototype.getStyle=function(){if(this.style)return this.style.serialize()},e.prototype.addSource=function(t,e){return this.style.addSource(t,e),this._update(!0),this},e.prototype.addSourceType=function(t,e,r){return this.style.addSourceType(t,e,r)},e.prototype.removeSource=function(t){return this.style.removeSource(t),this._update(!0),this},e.prototype.getSource=function(t){return this.style.getSource(t)},e.prototype.addLayer=function(t,e){return this.style.addLayer(t,e),this._update(!0),this},e.prototype.moveLayer=function(t,e){return this.style.moveLayer(t,e),this._update(!0),this},e.prototype.removeLayer=function(t){return this.style.removeLayer(t),this._update(!0),this},e.prototype.getLayer=function(t){return this.style.getLayer(t)},e.prototype.setFilter=function(t,e){return this.style.setFilter(t,e),this._update(!0),this},e.prototype.setLayerZoomRange=function(t,e,r){return this.style.setLayerZoomRange(t,e,r),this._update(!0),this},e.prototype.getFilter=function(t){return this.style.getFilter(t)},e.prototype.setPaintProperty=function(t,e,r,n){return this.style.setPaintProperty(t,e,r,n),this._update(!0),this},e.prototype.getPaintProperty=function(t,e,r){return this.style.getPaintProperty(t,e,r)},e.prototype.setLayoutProperty=function(t,e,r){return this.style.setLayoutProperty(t,e,r),this._update(!0),this},e.prototype.getLayoutProperty=function(t,e){return this.style.getLayoutProperty(t,e)},e.prototype.setLight=function(t){return this.style.setLight(t),this._update(!0),this},e.prototype.getLight=function(){return this.style.getLight()},e.prototype.getContainer=function(){return this._container},e.prototype.getCanvasContainer=function(){return this._canvasContainer},e.prototype.getCanvas=function(){return this._canvas},e.prototype._containerDimensions=function(){var t=0,e=0;return this._container&&(t=this._container.offsetWidth||400,e=this._container.offsetHeight||300),[t,e]},e.prototype._setupContainer=function(){var t=this._container;t.classList.add("mapboxgl-map");var e=this._canvasContainer=s.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=s.create("canvas","mapboxgl-canvas",e),this._canvas.style.position="absolute",this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",0),this._canvas.setAttribute("aria-label","Map");var r=this._containerDimensions();this._resizeCanvas(r[0],r[1]);var n=this._controlContainer=s.create("div","mapboxgl-control-container",t),i=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(t){i[t]=s.create("div","mapboxgl-ctrl-"+t,n)})},e.prototype._resizeCanvas=function(t,e){var r=a.devicePixelRatio||1;this._canvas.width=r*t,this._canvas.height=r*e,this._canvas.style.width=t+"px",this._canvas.style.height=e+"px"},e.prototype._setupPainter=function(){var t=i.extend({failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer},_.webGLContextAttributes),e=this._canvas.getContext("webgl",t)||this._canvas.getContext("experimental-webgl",t);return e?void(this.painter=new c(e,this.transform)):void this.fire("error",{error:new Error("Failed to initialize WebGL")})},e.prototype._contextLost=function(t){t.preventDefault(),this._frameId&&o.cancelFrame(this._frameId),this.fire("webglcontextlost",{originalEvent:t})},e.prototype._contextRestored=function(t){this._setupPainter(),this.resize(),this._update(),this.fire("webglcontextrestored",{originalEvent:t})},e.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!(!this.style||!this.style.loaded())},e.prototype._update=function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this._rerender(),this):this},e.prototype._render=function(){return 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,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,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(),this},e.prototype.remove=function(){this._hash&&this._hash.remove(),o.cancelFrame(this._frameId),this.setStyle(null),"undefined"!=typeof a&&a.removeEventListener("resize",this._onWindowResize,!1);var t=this.painter.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),n(this._canvasContainer),n(this._controlContainer),this._container.classList.remove("mapboxgl-map"),this.fire("remove")},e.prototype._rerender=function(){this.style&&!this._frameId&&(this._frameId=o.frame(this._render))},e.prototype._onWindowOnline=function(){this._update()},e.prototype._onWindowResize=function(){this._trackResize&&this.stop().resize()._update()},r.showTileBoundaries.get=function(){return!!this._showTileBoundaries},r.showTileBoundaries.set=function(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},r.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},r.showCollisionBoxes.set=function(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,this.style._redoPlacement())},r.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},r.showOverdrawInspector.set=function(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},r.repaint.get=function(){return!!this._repaint},r.repaint.set=function(t){this._repaint=t,this._update()},r.vertices.get=function(){return!!this._vertices},r.vertices.set=function(t){this._vertices=t,this._update()},e.prototype._onData=function(t){this._update("style"===t.dataType),this.fire(t.dataType+"data",t)},e.prototype._onDataLoading=function(t){this.fire(t.dataType+"dataloading",t)},Object.defineProperties(e.prototype,r),e}(d);e.exports=E},{"../geo/lng_lat":19,"../geo/lng_lat_bounds":20,"../geo/transform":21,"../render/painter":36,"../style/animation_loop":57,"../style/style":61,"../util/browser":108,"../util/dom":115,"../util/util":127,"../util/window":110,"./bind_handlers":89,"./camera":90,"./control/attribution_control":91,"./hash":102,"mapbox-gl-supported":190,"point-geometry":194}],104:[function(t,e,r){"use strict";var n=t("../util/dom"),i=t("../geo/lng_lat"),o=t("point-geometry"),a=function(t,e){this._offset=o.convert(e&&e.offset||[0,0]),this._update=this._update.bind(this),this._onMapClick=this._onMapClick.bind(this),t||(t=n.create("div")),t.classList.add("mapboxgl-marker"),this._element=t,this._popup=null};a.prototype.addTo=function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),this._update(),this._map.on("click",this._onMapClick),this},a.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map=null),n.remove(this._element),this._popup&&this._popup.remove(),this},a.prototype.getLngLat=function(){return this._lngLat},a.prototype.setLngLat=function(t){return this._lngLat=i.convert(t),this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},a.prototype.getElement=function(){return this._element},a.prototype.setPopup=function(t){return this._popup&&(this._popup.remove(),this._popup=null),t&&(this._popup=t,this._popup.setLngLat(this._lngLat)),this},a.prototype._onMapClick=function(t){var e=t.originalEvent.target,r=this._element;this._popup&&(e===r||r.contains(e))&&this.togglePopup()},a.prototype.getPopup=function(){return this._popup},a.prototype.togglePopup=function(){var t=this._popup;t&&(t.isOpen()?t.remove():t.addTo(this._map))},a.prototype._update=function(t){if(this._map){var e=this._map.project(this._lngLat)._add(this._offset);t&&"moveend"!==t.type||(e=e.round()),n.setTransform(this._element,"translate("+e.x+"px, "+e.y+"px)")}},e.exports=a},{"../geo/lng_lat":19,"../util/dom":115,"point-geometry":194}],105:[function(t,e,r){"use strict";function n(t){if(t){if("number"==typeof t){var e=Math.round(Math.sqrt(.5*Math.pow(t,2)));return{top:new l(0,t),"top-left":new l(e,e),"top-right":new l(-e,e),bottom:new l(0,-t),"bottom-left":new l(e,-e),"bottom-right":new l(-e,-e),left:new l(t,0),right:new l(-t,0)}}if(i(t)){var r=l.convert(t);return{top:r,"top-left":r,"top-right":r,bottom:r,"bottom-left":r,"bottom-right":r,left:r,right:r}}return{top:l.convert(t.top||[0,0]),"top-left":l.convert(t["top-left"]||[0,0]),"top-right":l.convert(t["top-right"]||[0,0]),bottom:l.convert(t.bottom||[0,0]),"bottom-left":l.convert(t["bottom-left"]||[0,0]),"bottom-right":l.convert(t["bottom-right"]||[0,0]),left:l.convert(t.left||[0,0]),right:l.convert(t.right||[0,0])}}return n(new l(0,0))}function i(t){return t instanceof l||Array.isArray(t)}var o=t("../util/util"),a=t("../util/evented"),s=t("../util/dom"),u=t("../geo/lng_lat"),l=t("point-geometry"),c=t("../util/window"),p={closeButton:!0,closeOnClick:!0},h=function(t){function e(e){t.call(this),this.options=o.extend(Object.create(p),e),o.bindAll(["_update","_onClickClose"],this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.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},e.prototype.isOpen=function(){return!!this._map},e.prototype.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},e.prototype.getLngLat=function(){return this._lngLat},e.prototype.setLngLat=function(t){return this._lngLat=u.convert(t),this._update(),this},e.prototype.setText=function(t){return this.setDOMContent(c.document.createTextNode(t))},e.prototype.setHTML=function(t){var e,r=c.document.createDocumentFragment(),n=c.document.createElement("body");for(n.innerHTML=t;e=n.firstChild,e;)r.appendChild(e);return this.setDOMContent(r)},e.prototype.setDOMContent=function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},e.prototype._createContent=function(){this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._content=s.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=s.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClickClose))},e.prototype._update=function(){if(this._map&&this._lngLat&&this._content){this._container||(this._container=s.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=s.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content));var t=this.options.anchor,e=n(this.options.offset),r=this._map.project(this._lngLat).round();if(!t){var i=this._container.offsetWidth,o=this._container.offsetHeight;t=r.y+e.bottom.ythis._map.transform.height-o?["bottom"]:[],r.xthis._map.transform.width-i/2&&t.push("right"),t=0===t.length?"bottom":t.join("-")}var a=r.add(e[t]),u={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%)"},l=this._container.classList;for(var c in u)l.remove("mapboxgl-popup-anchor-"+c);l.add("mapboxgl-popup-anchor-"+t),s.setTransform(this._container,u[t]+" translate("+a.x+"px,"+a.y+"px)")}},e.prototype._onClickClose=function(){this.remove()},e}(a);e.exports=h},{"../geo/lng_lat":19,"../util/dom":115,"../util/evented":116,"../util/util":127,"../util/window":110,"point-geometry":194}],106:[function(t,e,r){"use strict";var n=function(t,e,r){this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.callbackID=0,this.receive=this.receive.bind(this),this.target.addEventListener("message",this.receive,!1)};n.prototype.send=function(t,e,r,n,i){var o=r?this.mapId+":"+this.callbackID++:null;r&&(this.callbacks[o]=r),this.target.postMessage({targetMapId:i,sourceMapId:this.mapId,type:t,id:String(o),data:e},n)},n.prototype.receive=function(t){var e,r=this,n=t.data,i=n.id;if(!n.targetMapId||this.mapId===n.targetMapId){var o=function(t,e,n){r.target.postMessage({sourceMapId:r.mapId,type:"",id:String(i),error:t?String(t):null,data:e},n)};if(""===n.type)e=this.callbacks[n.id],delete this.callbacks[n.id],e&&e(n.error||null,n.data);else if("undefined"!=typeof n.id&&this.parent[n.type])this.parent[n.type](n.sourceMapId,n.data,o);else if("undefined"!=typeof n.id&&this.parent.getWorkerSource){var a=n.type.split("."),s=this.parent.getWorkerSource(n.sourceMapId,a[0]);s[a[1]](n.data,o)}else this.parent[n.type](n.data)}},n.prototype.remove=function(){ -this.target.removeEventListener("message",this.receive,!1)},e.exports=n},{}],107:[function(t,e,r){"use strict";function n(t){var e=i.document.createElement("a");return e.href=t,e.protocol===i.document.location.protocol&&e.host===i.document.location.host}var i=t("./window");r.getJSON=function(t,e){var r=new i.XMLHttpRequest;return r.open("GET",t,!0),r.setRequestHeader("Accept","application/json"),r.onerror=function(t){e(t)},r.onload=function(){if(r.status>=200&&r.status<300&&r.response){var t;try{t=JSON.parse(r.response)}catch(t){return e(t)}e(null,t)}else e(new Error(r.statusText))},r.send(),r},r.getArrayBuffer=function(t,e){var r=new i.XMLHttpRequest;return r.open("GET",t,!0),r.responseType="arraybuffer",r.onerror=function(t){e(t)},r.onload=function(){return 0===r.response.byteLength&&200===r.status?e(new Error("http status 200 returned without content.")):void(r.status>=200&&r.status<300&&r.response?e(null,r.response):e(new Error(r.statusText)))},r.send(),r};var o="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";r.getImage=function(t,e){return r.getArrayBuffer(t,function(t,r){if(t)return e(t);var n=new i.Image,a=i.URL||i.webkitURL;n.onload=function(){e(null,n),a.revokeObjectURL(n.src)};var s=new i.Blob([new Uint8Array(r)],{type:"image/png"});n.src=r.byteLength?a.createObjectURL(s):o})},r.getVideo=function(t,e){var r=i.document.createElement("video");r.onloadstart=function(){e(null,r)};for(var o=0;o=s+n?t.call(i,1):(t.call(i,(u-s)/n),r.frame(o)))}if(!n)return t.call(i,1),null;var a=!1,s=e.exports.now();return r.frame(o),function(){a=!0}},r.getImageData=function(t){var e=n.document.createElement("canvas"),r=e.getContext("2d");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0),r.getImageData(0,0,t.width,t.height).data},r.supported=t("mapbox-gl-supported"),r.hardwareConcurrency=n.navigator.hardwareConcurrency||4,Object.defineProperty(r,"devicePixelRatio",{get:function(){return n.devicePixelRatio}}),r.supportsWebp=!1;var a=n.document.createElement("img");a.onload=function(){r.supportsWebp=!0},a.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="},{"./window":110,"mapbox-gl-supported":190}],109:[function(t,e,r){"use strict";var n=t("webworkify"),i=t("../window"),o=i.URL.createObjectURL(new n(t("../../source/worker"),{bare:!0}));e.exports=function(){return new i.Worker(o)}},{"../../source/worker":55,"../window":110,webworkify:211}],110:[function(t,e,r){"use strict";e.exports=self},{}],111:[function(t,e,r){"use strict";function n(t,e){return e.area-t.area}var i=t("quickselect"),o=t("./util").calculateSignedArea;e.exports=function(t,e){var r=t.length;if(r<=1)return[t];for(var a,s,u=[],l=0;l1)for(var p=0;pt.y!=p.y>t.y&&t.x<(p.x-c.x)*(t.y-c.y)/(p.y-c.y)+c.x&&(r=!r),n=Math.min(n,l(t,c,p))}return(r?1:-1)*Math.sqrt(n)}function a(t){for(var e=0,r=0,n=0,o=t[0],a=0,s=o.length,u=s-1;al)&&(l=f.x),(!h||f.y>c)&&(c=f.y)}for(var d=l-o,m=c-u,y=Math.min(d,m),v=y/2,g=new s(null,n),_=o;_b.d&&(b=E,r&&console.log("found best %d after %d probes",Math.round(1e4*E.d)/1e4,w)),E.max-b.d<=e||(v=E.h/2,g.push(new i(E.p.x-v,E.p.y-v,v,t)),g.push(new i(E.p.x+v,E.p.y-v,v,t)),g.push(new i(E.p.x-v,E.p.y+v,v,t)),g.push(new i(E.p.x+v,E.p.y+v,v,t)),w+=4)}return r&&(console.log("num probes: "+w),console.log("best distance: "+b.d)),b.p}},{"./intersection_tests":120,"point-geometry":194,tinyqueue:199}],118:[function(t,e,r){"use strict";function n(t,e){this.stacks=t.readFields(i,[],e)}function i(t,e,r){if(1===t){var n=r.readMessage(o,{glyphs:{}});e.push(n)}}function o(t,e,r){if(1===t)e.name=r.readString();else if(2===t)e.range=r.readString();else if(3===t){var n=r.readMessage(a,{});e.glyphs[n.id]=n}}function a(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint())}e.exports=n},{}],119:[function(t,e,r){"use strict";function n(t,e,r){return t*(1-r)+e*r}e.exports=n,n.number=n,n.vec2=function(t,e,r){return[n(t[0],e[0],r),n(t[1],e[1],r)]},n.color=function(t,e,r){return[n(t[0],e[0],r),n(t[1],e[1],r),n(t[2],e[2],r),n(t[3],e[3],r)]},n.array=function(t,e,r){return t.map(function(t,i){return n(t,e[i],r)})}},{}],120:[function(t,e,r){"use strict";function n(t,e){for(var r=0;r=3)for(var u=0;u1){if(u(t,e))return!0;for(var n=0;n1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}function h(t,e){for(var r,n,i,o=!1,a=0;ae.y!=i.y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(o=!o)}return o}function f(t,e){for(var r=!1,n=0,i=t.length-1;ne.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(r=!r)}return r}var d=t("./util").isCounterClockwise;e.exports={multiPolygonIntersectsBufferedMultiPoint:i,multiPolygonIntersectsMultiPolygon:o,multiPolygonIntersectsBufferedMultiLine:a,polygonIntersectsPolygon:n,distToSegmentSquared:p}},{"./util":127}],121:[function(t,e,r){"use strict";var n={"Latin-1 Supplement":function(t){return t>=128&&t<=255},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};e.exports=n},{}],122:[function(t,e,r){"use strict";var n=function(t,e){this.max=t,this.onRemove=e,this.reset()};n.prototype.reset=function(){var t=this;for(var e in this.data)t.onRemove(t.data[e]);return this.data={},this.order=[],this},n.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 r=this.get(this.order[0]);r&&this.onRemove(r)}return this},n.prototype.has=function(t){return t in this.data},n.prototype.keys=function(){return this.order},n.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},n.prototype.setMaxSize=function(t){var e=this;for(this.max=t;this.order.length>this.max;){var r=e.get(e.order[0]);r&&e.onRemove(r)}return this},e.exports=n},{}],123:[function(t,e,r){"use strict";function n(t,e){var r=a(u.API_URL);if(t.protocol=r.protocol,t.authority=r.authority,!u.REQUIRE_ACCESS_TOKEN)return s(t);if(e=e||u.ACCESS_TOKEN,!e)throw new Error("An API access token is required to use Mapbox GL. "+c);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+c);return t.params.push("access_token="+e),s(t)}function i(t){return 0===t.indexOf("mapbox:")}function o(t){for(var e=0;e=2||512===r?"@2x":"",c=l.supportsWebp?".webp":"$1";return n.path=n.path.replace(p,""+u+c),o(n.params),s(n)};var h=/^(\w+):\/\/([^\/?]+)(\/[^?]+)?\??(.+)?/},{"./browser":108,"./config":112}],124:[function(t,e,r){"use strict";var n=t("./is_char_in_unicode_block");e.exports.allowsIdeographicBreaking=function(t){for(var e=0,n=t;e=65097&&t<=65103)||n["CJK Compatibility Ideographs"](t)||n["CJK Compatibility"](t)||n["CJK Radicals Supplement"](t)||n["CJK Strokes"](t)||!(!n["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||n["CJK Unified Ideographs Extension A"](t)||n["CJK Unified Ideographs"](t)||n["Enclosed CJK Letters and Months"](t)||n["Hangul Compatibility Jamo"](t)||n["Hangul Jamo Extended-A"](t)||n["Hangul Jamo Extended-B"](t)||n["Hangul Jamo"](t)||n["Hangul Syllables"](t)||n.Hiragana(t)||n["Ideographic Description Characters"](t)||n.Kanbun(t)||n["Kangxi Radicals"](t)||n["Katakana Phonetic Extensions"](t)||n.Katakana(t)&&12540!==t||!(!n["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!n["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||n["Unified Canadian Aboriginal Syllabics"](t)||n["Unified Canadian Aboriginal Syllabics Extended"](t)||n["Vertical Forms"](t)||n["Yijing Hexagram Symbols"](t)||n["Yi Syllables"](t)||n["Yi Radicals"](t)))},r.charHasNeutralVerticalOrientation=function(t){return!!(n["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||n["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||n["Letterlike Symbols"](t)||n["Number Forms"](t)||n["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||n["Control Pictures"](t)&&9251!==t||n["Optical Character Recognition"](t)||n["Enclosed Alphanumerics"](t)||n["Geometric Shapes"](t)||n["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||n["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||n["CJK Symbols and Punctuation"](t)||n.Katakana(t)||n["Private Use Area"](t)||n["CJK Compatibility Forms"](t)||n["Small Form Variants"](t)||n["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)},r.charHasRotatedVerticalOrientation=function(t){return!(r.charHasUprightVerticalOrientation(t)||r.charHasNeutralVerticalOrientation(t))}},{"./is_char_in_unicode_block":121}],125:[function(t,e,r){"use strict";function n(t){var e=JSON.stringify(t);if(y[e])return y[e];var r=void 0===t.alignment?1:t.alignment,n=0,a=0,u=["Uint8"],p=t.members.map(function(t){u.indexOf(t.type)<0&&u.push(t.type);var e=o(t.type),s=n=i(n,Math.max(r,e)),l=t.components||1;return a=Math.max(a,e),n+=e*l,{name:t.name,type:t.type,components:l,offset:s}}),f=i(n,Math.max(a,r)),d=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(h);d.prototype.alignment=r,d.prototype.size=f;for(var v=0,g=p;vthis.capacity){this.capacity=Math.max(t,Math.floor(this.capacity*d),f),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},m.prototype._refreshViews=function(){for(var t=this,e=0,r=this._usedTypes;e=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)},r.bezier=function(t,e,r,i){var o=new n(t,e,r,i);return function(t){return o.solve(t)}},r.ease=r.bezier(.25,.1,.25,1),r.clamp=function(t,e,r){return Math.min(r,Math.max(e,t))},r.wrap=function(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i},r.asyncAll=function(t,e,r){if(!t.length)return r(null,[]);var n=t.length,i=new Array(t.length),o=null;t.forEach(function(t,a){e(t,function(t,e){t&&(o=t),i[a]=e,0===--n&&r(o,i)})})},r.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},r.keysDifference=function(t,e){var r=[];for(var n in t)n in e||r.push(n);return r},r.extend=function(t,e,r,n){for(var i=arguments,o=1;o=0)return!0;return!1};var a={};r.warnOnce=function(t){a[t]||("undefined"!=typeof console&&console.warn(t),a[t]=!0)},r.isCounterClockwise=function(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)},r.calculateSignedArea=function(t){for(var e,r,n=0,i=0,o=t.length,a=o-1;i0||Math.abs(e.y-n.y)>0)&&Math.abs(r.calculateSignedArea(t))>.01},r.sphericalToCartesian=function(t){var e=t[0],r=t[1],n=t[2];return r+=90,r*=Math.PI/180,n*=Math.PI/180,[e*Math.cos(r)*Math.sin(n),e*Math.sin(r)*Math.sin(n),e*Math.cos(n)]}},{"../geo/coordinate":18,"point-geometry":194,unitbezier:200}],128:[function(t,e,r){"use strict";var n=function(t,e,r,n){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=r,t._y=n,this.properties=t.properties,null!=t.id&&(this.id=t.id)},i={geometry:{}};i.geometry.get=function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},i.geometry.set=function(t){this._geometry=t},n.prototype.toJSON=function(){var t=this,e={geometry:this.geometry};for(var r in this)"_geometry"!==r&&"_vectorTileFeature"!==r&&(e[r]=t[r]);return e},Object.defineProperties(n.prototype,i),e.exports=n},{}],129:[function(t,e,r){"use strict";var n=t("./script_detection");e.exports=function(t){for(var r="",i=0;i":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"}},{"./script_detection":124}],130:[function(t,e,r){"use strict";var n=t("./web_worker"),i=function(){this.active={}};i.prototype.acquire=function(e){var r=this;if(!this.workers){var i=t("../mapbox-gl").workerCount;for(this.workers=[];this.workers.length255?255:t}function i(t){return t<0?0:t>1?1:t}function o(t){return n("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function a(t){return i("%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))}function s(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}function u(t){var e=t.replace(/ /g,"").toLowerCase();if(e in l)return l[e].slice();if("#"===e[0]){if(4===e.length){var r=parseInt(e.substr(1),16);return r>=0&&r<=4095?[(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,1]:null}if(7===e.length){var r=parseInt(e.substr(1),16);return r>=0&&r<=16777215?[(16711680&r)>>16,(65280&r)>>8,255&r,1]:null}return null}var i=e.indexOf("("),u=e.indexOf(")");if(i!==-1&&u+1===e.length){var c=e.substr(0,i),p=e.substr(i+1,u-(i+1)).split(","),h=1;switch(c){case"rgba":if(4!==p.length)return null;h=a(p.pop());case"rgb":return 3!==p.length?null:[o(p[0]),o(p[1]),o(p[2]),h];case"hsla":if(4!==p.length)return null;h=a(p.pop());case"hsl":if(3!==p.length)return null;var f=(parseFloat(p[0])%360+360)%360/360,d=a(p[1]),m=a(p[2]),y=m<=.5?m*(d+1):m+d-m*d,v=2*m-y;return[n(255*s(v,y,f+1/3)),n(255*s(v,y,f)),n(255*s(v,y,f-1/3)),h];default:return null}}return null}var l={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{r.parseCSSColor=u}catch(t){}},{}],133:[function(t,e,r){"use strict";function n(t,e,r){r=r||2;var n=e&&e.length,o=n?e[0]*r:t.length,s=i(t,0,o,r,!0),u=[];if(!s)return u;var l,c,h,f,d,m,y;if(n&&(s=p(t,e,s,r)),t.length>80*r){l=h=t[0],c=f=t[1];for(var v=r;vh&&(h=d),m>f&&(f=m);y=Math.max(h-l,f-c)}return a(s,u,r,l,c,y),u}function i(t,e,r,n,i){var o,a;if(i===L(t,e,r,n)>0)for(o=e;o=e;o-=n)a=M(o,t[o],t[o+1],a);return a&&w(a,a.next)&&(P(a),a=a.next),a}function o(t,e){if(!t)return t;e||(e=t);var r,n=t;do if(r=!1,n.steiner||!w(n,n.next)&&0!==b(n.prev,n,n.next))n=n.next;else{if(P(n),n=e=n.prev,n===n.next)return null;r=!0}while(r||n!==e);return e}function a(t,e,r,n,i,p,h){if(t){!h&&p&&m(t,n,i,p);for(var f,d,y=t;t.prev!==t.next;)if(f=t.prev,d=t.next,p?u(t,n,i,p):s(t))e.push(f.i/r),e.push(t.i/r),e.push(d.i/r),P(t),t=d.next,y=d.next;else if(t=d,t===y){h?1===h?(t=l(t,e,r),a(t,e,r,n,i,p,2)):2===h&&c(t,e,r,n,i,p):a(o(t),e,r,n,i,p,1);break}}}function s(t){var e=t.prev,r=t,n=t.next;if(b(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(_(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&b(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function u(t,e,r,n){var i=t.prev,o=t,a=t.next;if(b(i,o,a)>=0)return!1;for(var s=i.xo.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,c=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,p=v(s,u,e,r,n),h=v(l,c,e,r,n),f=t.nextZ;f&&f.z<=h;){if(f!==t.prev&&f!==t.next&&_(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&b(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(f=t.prevZ;f&&f.z>=p;){if(f!==t.prev&&f!==t.next&&_(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&b(f.prev,f,f.next)>=0)return!1;f=f.prevZ}return!0}function l(t,e,r){var n=t;do{var i=n.prev,o=n.next.next;!w(i,o)&&E(i,n,n.next,o)&&S(i,o)&&S(o,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(o.i/r),P(n),P(n.next),n=t=o),n=n.next}while(n!==t);return n}function c(t,e,r,n,i,s){var u=t;do{for(var l=u.next.next;l!==u.prev;){if(u.i!==l.i&&x(u,l)){var c=A(u,l);return u=o(u,u.next),c=o(c,c.next),a(u,e,r,n,i,s),void a(c,e,r,n,i,s)}l=l.next}u=u.next}while(u!==t)}function p(t,e,r,n){var a,s,u,l,c,p=[];for(a=0,s=e.length;a=n.next.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>a){if(a=s,s===i){if(o===n.y)return n;if(o===n.next.y)return n.next}r=n.x=n.x&&n.x>=c&&_(or.x)&&S(n,t)&&(r=n,h=u)),n=n.next;return r}function m(t,e,r,n){var i=t;do null===i.z&&(i.z=v(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,y(i)}function y(t){var e,r,n,i,o,a,s,u,l=1;do{for(r=t,t=null,o=null,a=0;r;){for(a++,n=r,s=0,e=0;e0||u>0&&n;)0===s?(i=n,n=n.nextZ,u--):0!==u&&n?r.z<=n.z?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,u--):(i=r,r=r.nextZ,s--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;r=n}o.nextZ=null,l*=2}while(a>1);return t}function v(t,e,r,n,i){return t=32767*(t-r)/i,e=32767*(e-n)/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 g(t){var e=t,r=t;do e.x=0&&(t-a)*(n-s)-(r-a)*(e-s)>=0&&(r-a)*(o-s)-(i-a)*(n-s)>=0}function x(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!T(t,e)&&S(t,e)&&S(e,t)&&z(t,e)}function b(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function w(t,e){return t.x===e.x&&t.y===e.y}function E(t,e,r,n){return!!(w(t,e)&&w(r,n)||w(t,n)&&w(r,e))||b(t,e,r)>0!=b(t,e,n)>0&&b(r,n,t)>0!=b(r,n,e)>0}function T(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&E(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}function S(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 z(t,e){var r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do r.y>o!=r.next.y>o&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;while(r!==t);return n}function A(t,e){var r=new I(t.i,t.x,t.y),n=new I(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function M(t,e,r,n){var i=new I(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function P(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 I(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function L(t,e,r,n){for(var i=0,o=e,a=r-n;o0&&(n+=t[i-1].length,r.holes.push(n))}return r}},{}],134:[function(t,e,r){function n(t){var e,r,i,l,c,p;switch(typeof t){case"object":if(null===t)return null;if(o(t)){for(i="[",r=t.length-1,e=0;e-1&&(i+=n(t[e])),i+"]"}for(l=a(t).sort(),r=l.length,i="{",c=l[e=0],p=r>0&&void 0!==t[c];e15?"\\u00"+e.toString(16):"\\u000"+e.toString(16)}};e.exports=function(t){if(void 0!==t)return""+n(t)},e.exports.stringSearch=s,e.exports.stringReplace=u},{}],135:[function(t,e,r){"use strict";function n(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 r="=="===e?a(t[1],t[2],"===",!1):"!="===e?a(t[1],t[2],"!==",!1):"<"===e||">"===e||"<="===e||">="===e?a(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?u(t[1],t.slice(2)):"!in"===e?c(u(t[1],t.slice(2))):"has"===e?l(t[1]):"!has"===e?c(l([t[1]])):"true";return"("+r+")"}function o(t){return"$type"===t?"f.type":"$id"===t?"f.id":"p["+JSON.stringify(t)+"]"}function a(t,e,r,n){var i=o(t),a="$type"===t?h.indexOf(e):JSON.stringify(e);return(n?"typeof "+i+"=== typeof "+a+"&&":"")+i+r+a}function s(t,e){return t.map(i).join(e)}function u(t,e){"$type"===t&&(e=e.map(function(t){return h.indexOf(t)}));var r=JSON.stringify(e.sort(p)),n=o(t);return e.length<=200?r+".indexOf("+n+") !== -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; }("+n+", "+r+",0,"+(e.length-1)+")"}function l(t){return JSON.stringify(t)+" in p"}function c(t){return"!("+t+")"}function p(t,e){return te?1:0}e.exports=n;var h=["Unknown","Point","LineString","Polygon"]},{}],136:[function(t,e,r){function n(t){if("Polygon"===t.type)return i(t.coordinates);if("MultiPolygon"===t.type){for(var e=0,r=0;r0){e+=Math.abs(o(t[0]));for(var r=1;r2){for(var r,n,i=0;i=0}var l=t("geojson-area");e.exports=n},{"geojson-area":136}],138:[function(t,e,r){"use strict";function n(t,e,r,n,a,u,l,c){if(r/=e,n/=e,l>=r&&c<=n)return t;if(l>n||c=r&&d<=n)p.push(m);else if(!(f>n||d=e&&s<=r&&i.push(a)}return i}function o(t,e,r,n,i,o){for(var s=[],u=0;ur?(x.push(i(l,d,e),i(l,d,r)),o||(x=a(s,x,y,v,g))):f>=e&&x.push(i(l,d,e)):h>r?fr&&(x.push(i(l,d,r)),o||(x=a(s,x,y,v,g))));l=m[_-1],h=l[n],h>=e&&h<=r&&x.push(l),p=x[x.length-1],o&&p&&(x[0][0]!==p[0]||x[0][1]!==p[1])&&x.push(x[0]),a(s,x,y,v,g)}return s}function a(t,e,r,n,i){return e.length&&(e.area=r,e.dist=n,void 0!==i&&(e.outer=i),t.push(e)),[]}e.exports=n;var s=t("./feature")},{"./feature":140}],139:[function(t,e,r){"use strict";function n(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n1?1:n,[r,n,0]}function s(t){for(var e,r,n=0,i=0,o=0;o1)return!1;var o=i.geometry[0].length;if(5!==o)return!1;for(var a=0;a1&&console.time("creation"),_=this.tiles[g]=d(t,v,r,n,x,e===f.maxZoom),this.tileCoords.push({z:e,x:r,y:n}),m)){m>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,_.numFeatures,_.numPoints,_.numSimplified),console.timeEnd("creation"));var b="z"+e;this.stats[b]=(this.stats[b]||0)+1,this.total++}if(_.source=t,i){if(e===f.maxZoom||e===i)continue;var w=1<1&&console.time("clipping");var E,T,S,z,A,M,P=.5*f.buffer/f.extent,I=.5-P,L=.5+P,k=1+P;E=T=S=z=null,A=h(t,v,r-P,r+L,0,a,_.min[0],_.max[0]),M=h(t,v,r+I,r+k,0,a,_.min[0],_.max[0]),A&&(E=h(A,v,n-P,n+L,1,s,_.min[1],_.max[1]),T=h(A,v,n+I,n+k,1,s,_.min[1],_.max[1])),M&&(S=h(M,v,n-P,n+L,1,s,_.min[1],_.max[1]),z=h(M,v,n+I,n+k,1,s,_.min[1],_.max[1])),m>1&&console.timeEnd("clipping"),t.length&&(p.push(E||[],e+1,2*r,2*n),p.push(T||[],e+1,2*r,2*n+1),p.push(S||[],e+1,2*r+1,2*n),p.push(z||[],e+1,2*r+1,2*n+1))}else i&&(y=e)}return y},i.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,a=n.debug,s=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var c,h=t,f=e,d=r;!c&&h>0;)h--,f=Math.floor(f/2),d=Math.floor(d/2),c=this.tiles[o(h,f,d)];if(!c||!c.source)return null;if(a>1&&console.log("found parent tile z%d-%d-%d",h,f,d),l(c,i,n.buffer))return p.tile(c,i);a>1&&console.time("drilling down");var m=this.splitTile(c.source,h,f,d,t,e,r);if(a>1&&console.timeEnd("drilling down"),null!==m){var y=1<n&&(a=r,n=o);n>s?(t[a][2]=n,p.push(l),p.push(a),l=a):(c=p.pop(),l=p.pop())}}function i(t,e,r){var n=e[0],i=e[1],o=r[0],a=r[1],s=t[0],u=t[1],l=o-n,c=a-i;if(0!==l||0!==c){var p=((s-n)*l+(u-i)*c)/(l*l+c*c);p>1?(n=o,i=a):p>0&&(n+=l*p,i+=c*p)}return l=s-n,c=u-i,l*l+c*c}e.exports=n},{}],143:[function(t,e,r){"use strict";function n(t,e,r,n,o,a){for(var s={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:n,z2:e,transformed:!1,min:[2,1],max:[-1,0]},u=0;us.max[0]&&(s.max[0]=c[0]),c[1]>s.max[1]&&(s.max[1]=c[1])}return s}function i(t,e,r,n){var i,a,s,u,l=e.geometry,c=e.type,p=[],h=r*r;if(1===c)for(i=0;ih)&&(f.push(u),t.numSimplified++),t.numPoints++;3===c&&o(f,s.outer),p.push(f)}else t.numPoints+=s.length;if(p.length){var d={geometry:p,type:c,tags:e.tags||null};null!==e.id&&(d.id=e.id),t.features.push(d)}}function o(t,e){var r=a(t);r<0===e&&t.reverse()}function a(t){for(var e,r,n=0,i=0,o=t.length,a=o-1;i=l[h+0]&&n>=l[h+1]?(a[p]=!0,o.push(u[p])):a[p]=!1}}},n.prototype._forEachCell=function(t,e,r,n,i,o,a){for(var s=this._convertToCellCoord(t),u=this._convertToCellCoord(e),l=this._convertToCellCoord(r),c=this._convertToCellCoord(n),p=s;p<=l;p++)for(var h=u;h<=c;h++){var f=this.d*h+p;if(i.call(this,t,e,r,n,f,o,a))return}},n.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},n.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=i+this.cells.length+1+1,r=0,n=0;n>1,c=-7,p=r?i-1:0,h=r?-1:1,f=t[e+p];for(p+=h,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=256*o+t[e+p],p+=h,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+t[e+p],p+=h,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:(f?-1:1)*(1/0);a+=Math.pow(2,n),o-=l}return(f?-1:1)*a*Math.pow(2,o-n)},r.write=function(t,e,r,n,i,o){var a,s,u,l=8*o-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,d=n?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,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),e+=a+p>=1?h/u:h*Math.pow(2,1-p),e*u>=2&&(a++,u/=2),a+p>=c?(s=0,a=c):a+p>=1?(s=(e*u-1)*Math.pow(2,i),a+=p):(s=e*Math.pow(2,p-1)*Math.pow(2,i),a=0));i>=8;t[r+f]=255&s,f+=d,s/=256,i-=8);for(a=a<0;t[r+f]=255&a,f+=d,a/=256,l-=8);t[r+f-d]|=128*m}},{}],148:[function(t,e,r){"use strict";function n(t,e,r,n,o){return new i(t,e,r,n,o)}function i(t,e,r,n,i){e=e||o,r=r||a,i=i||Array,this.nodeSize=n||64,this.points=t,this.ids=new i(t.length),this.coords=new i(2*t.length);for(var u=0;u=r&&s<=i&&u>=n&&u<=o&&c.push(t[d]);else{var m=Math.floor((f+h)/2);s=e[2*m],u=e[2*m+1],s>=r&&s<=i&&u>=n&&u<=o&&c.push(t[m]);var y=(p+1)%2;(0===p?r<=s:n<=u)&&(l.push(f),l.push(m-1),l.push(y)),(0===p?i>=s:o>=u)&&(l.push(m+1),l.push(h),l.push(y))}}return c}e.exports=n},{}],150:[function(t,e,r){"use strict";function n(t,e,r,o,a,s){if(!(a-o<=r)){var u=Math.floor((o+a)/2);i(t,e,u,o,a,s%2),n(t,e,r,o,u-1,s+1),n(t,e,r,u+1,a,s+1)}}function i(t,e,r,n,a,s){for(;a>n;){if(a-n>600){var u=a-n+1,l=r-n+1,c=Math.log(u),p=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*p*(u-p)/u)*(l-u/2<0?-1:1),f=Math.max(n,Math.floor(r-l*p/u+h)),d=Math.min(a,Math.floor(r+(u-l)*p/u+h));i(t,e,r,f,d,s)}var m=e[2*r+s],y=n,v=a;for(o(t,e,n,r),e[2*a+s]>m&&o(t,e,n,a);ym;)v--}e[2*n+s]===m?o(t,e,n,v):(v++,o(t,e,v,a)),v<=r&&(n=v+1),r<=v&&(a=v-1)}}function o(t,e,r,n){a(t,r,n),a(e,2*r,2*n),a(e,2*r+1,2*n+1)}function a(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}e.exports=n},{}],151:[function(t,e,r){"use strict";function n(t,e,r,n,o,a){for(var s=[0,t.length-1,0],u=[],l=o*o;s.length;){var c=s.pop(),p=s.pop(),h=s.pop();if(p-h<=a)for(var f=h;f<=p;f++)i(e[2*f],e[2*f+1],r,n)<=l&&u.push(t[f]);else{var d=Math.floor((h+p)/2),m=e[2*d],y=e[2*d+1];i(m,y,r,n)<=l&&u.push(t[d]);var v=(c+1)%2;(0===c?r-o<=m:n-o<=y)&&(s.push(h),s.push(d-1),s.push(v)),(0===c?r+o>=m:n+o>=y)&&(s.push(d+1),s.push(p),s.push(v))}}return u}function i(t,e,r,n){var i=t-r,o=e-n;return i*i+o*o}e.exports=n},{}],152:[function(t,e,r){function n(t){return!!t&&"object"==typeof t}function i(t,e){for(var r=-1,n=t.length;++rl))return!1;for(;++u-1&&t%1==0&&t<=c}function u(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function l(t){return!!t&&"object"==typeof t}var c=9007199254740991,p="[object Arguments]",h="[object Function]",f="[object GeneratorFunction]",d=Object.prototype,m=d.hasOwnProperty,y=d.toString,v=d.propertyIsEnumerable;e.exports=n},{}],156:[function(t,e,r){function n(t){return!!t&&"object"==typeof t}function i(t,e){var r=null==t?void 0:t[e];return u(r)?r:void 0}function o(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=g}function a(t){return s(t)&&m.call(t)==c}function s(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function u(t){return null!=t&&(a(t)?y.test(f.call(t)):n(t)&&p.test(t))}var l="[object Array]",c="[object Function]",p=/^\[object .+?Constructor\]$/,h=Object.prototype,f=Function.prototype.toString,d=h.hasOwnProperty,m=h.toString,y=RegExp("^"+f.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),v=i(Array,"isArray"),g=9007199254740991,_=v||function(t){return n(t)&&o(t.length)&&m.call(t)==l};e.exports=_},{}],157:[function(t,e,r){function n(t,e,r,n){r="function"==typeof r?o(r,n,3):void 0;var a=r?r(t,e):void 0;return void 0===a?i(t,e,r):!!a}var i=t("lodash._baseisequal"),o=t("lodash._bindcallback");e.exports=n},{"lodash._baseisequal":152,"lodash._bindcallback":153}],158:[function(t,e,r){function n(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=a}function i(t){return!!t&&"object"==typeof t}function o(t){return i(t)&&n(t.length)&&!!L[C.call(t)]}var a=9007199254740991,s="[object Arguments]",u="[object Array]",l="[object Boolean]",c="[object Date]",p="[object Error]",h="[object Function]",f="[object Map]",d="[object Number]",m="[object Object]",y="[object RegExp]",v="[object Set]",g="[object String]",_="[object WeakMap]",x="[object ArrayBuffer]",b="[object DataView]",w="[object Float32Array]",E="[object Float64Array]",T="[object Int8Array]",S="[object Int16Array]",z="[object Int32Array]",A="[object Uint8Array]",M="[object Uint8ClampedArray]",P="[object Uint16Array]",I="[object Uint32Array]",L={};L[w]=L[E]=L[T]=L[S]=L[z]=L[A]=L[M]=L[P]=L[I]=!0,L[s]=L[u]=L[x]=L[l]=L[b]=L[c]=L[p]=L[h]=L[f]=L[d]=L[m]=L[y]=L[v]=L[g]=L[_]=!1;var k=Object.prototype,C=k.toString;e.exports=o},{}],159:[function(t,e,r){function n(t){return function(e){return null==e?void 0:e[t]}}function i(t){return null!=t&&a(g(t))}function o(t,e){return t="number"==typeof t||f.test(t)?+t:-1,e=null==e?v:e,t>-1&&t%1==0&&t-1&&t%1==0&&t<=v}function s(t){for(var e=l(t),r=e.length,n=r&&t.length,i=!!n&&a(n)&&(h(t)||p(t)),s=-1,u=[];++s0;++nv?Math.pow(t,1/3):t/y+d}function i(t){return t>m?t*t*t:y*(t-d)}function o(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function a(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function s(t){var e=a(t[0]),r=a(t[1]),i=a(t[2]),o=n((.4124564*e+.3575761*r+.1804375*i)/p),s=n((.2126729*e+.7151522*r+.072175*i)/h),u=n((.0193339*e+.119192*r+.9503041*i)/f);return[116*s-16,500*(o-s),200*(s-u),t[3]]}function u(t){var e=(t[0]+16)/116,r=isNaN(t[1])?e:e+t[1]/500,n=isNaN(t[2])?e:e-t[2]/200;return e=h*i(e),r=p*i(r),n=f*i(n),[o(3.2404542*r-1.5371385*e-.4985314*n),o(-.969266*r+1.8760108*e+.041556*n),o(.0556434*r-.2040259*e+1.0572252*n),t[3]]}function l(t){var e=s(t),r=e[0],n=e[1],i=e[2],o=Math.atan2(i,n)*_;return[o<0?o+360:o,Math.sqrt(n*n+i*i),r,t[3]]}function c(t){var e=t[0]*g,r=t[1],n=t[2];return u([n,Math.cos(e)*r,Math.sin(e)*r,t[3]])}var p=.95047,h=1,f=1.08883,d=4/29,m=6/29,y=3*m*m,v=m*m*m,g=Math.PI/180,_=180/Math.PI;e.exports={lab:{forward:s,reverse:u},hcl:{forward:l,reverse:c}}},{}],161:[function(t,e,r){"use strict";function n(t){return t}function i(t,e){var r;if(f(t)){var l,c=t.stops&&"object"==typeof t.stops[0][0],p=c||void 0!==t.property,h=c||!p,m=t.stops&&typeof(c?t.stops[0][0].property:t.stops[0][0]),y=t.type||e||("string"===m?"categorical":"exponential");if("exponential"===y)l=s;else if("interval"===y)l=a;else if("categorical"===y)l=o;else{if("identity"!==y)throw new Error('Unknown function type "'+y+'"');l=u}var v;if(t.colorSpace&&"rgb"!==t.colorSpace){if(!d[t.colorSpace])throw new Error("Unknown color space: "+t.colorSpace);var g=d[t.colorSpace];t=JSON.parse(JSON.stringify(t));for(var _=0;_=t.stops[r-1][0])return t.stops[r-1][1];var n=l(t.stops,e);return t.stops[n][1]}function s(t,e){var r=void 0!==t.base?t.base:1,n=t.stops.length;if(1===n)return t.stops[0][1];if(void 0===e||null===e)return t.stops[n-1][1];if(e<=t.stops[0][0])return t.stops[0][1];if(e>=t.stops[n-1][0])return t.stops[n-1][1];var i=l(t.stops,e);return c(e,r,t.stops[i][0],t.stops[i+1][0],t.stops[i][1],t.stops[i+1][1])}function u(t,e){return e}function l(t,e){for(var r,n=t.length,i=0,o=n-1,a=0;i<=o;){if(a=Math.floor((i+o)/2),r=t[a][0],r===e){a+=1;break}re&&(o=a-1)}return Math.max(a-1,0)}function c(t,e,r,n,i,o){return"function"==typeof i?function(){var a=i.apply(void 0,arguments),s=o.apply(void 0,arguments);return c(t,e,r,n,a,s)}:i.length?h(t,e,r,n,i,o):p(t,e,r,n,i,o)}function p(t,e,r,n,i,o){var a,s=n-r,u=t-r;return a=1===e?u/s:(Math.pow(e,u)-1)/(Math.pow(e,s)-1),i*(1-a)+o*a}function h(t,e,r,n,i,o){for(var a=[],s=0;s7)return[new n(c,u,"constants have been deprecated as of v8")];if(!(u in h.constants))return[new n(c,u,'constant "%s" not found',u)];e=o({},e,{value:h.constants[u]})}return l.function&&"object"===i(u)?r(e):l.type&&s[l.type]?s[l.type](e):a(o({},e,{valueSpec:l.type?p[l.type]:l}))}},{"../error/validation_error":164,"../util/extend":166,"../util/get_type":167,"./validate_array":171,"./validate_boolean":172,"./validate_color":173,"./validate_constants":174,"./validate_enum":175,"./validate_filter":176,"./validate_function":177,"./validate_layer":179,"./validate_light":181,"./validate_number":182,"./validate_object":183,"./validate_source":185,"./validate_string":186}],171:[function(t,e,r){"use strict";var n=t("../util/get_type"),i=t("./validate"),o=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.valueSpec,a=t.style,s=t.styleSpec,u=t.key,l=t.arrayElementValidator||i;if("array"!==n(e))return[new o(u,e,"array expected, %s found",n(e))];if(r.length&&e.length!==r.length)return[new o(u,e,"array length %d expected, length %d found",r.length,e.length)];if(r["min-length"]&&e.length7)return r?[new n(e,r,"constants have been deprecated as of v8")]:[];var a=i(r);if("object"!==a)return[new n(e,r,"object expected, %s found",a)];var s=[];for(var u in r)"@"!==u[0]&&s.push(new n(e+"."+u,r[u],'constants must start with "@"'));return s}},{"../error/validation_error":164,"../util/get_type":167}],175:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint");e.exports=function(t){var e=t.key,r=t.value,o=t.valueSpec,a=[];return Array.isArray(o.values)?o.values.indexOf(i(r))===-1&&a.push(new n(e,r,"expected one of [%s], %s found",o.values.join(", "),r)):Object.keys(o.values).indexOf(i(r))===-1&&a.push(new n(e,r,"expected one of [%s], %s found",Object.keys(o.values).join(", "),r)),a}},{"../error/validation_error":164,"../util/unbundle_jsonlint":169}],176:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("./validate_enum"),o=t("../util/get_type"),a=t("../util/unbundle_jsonlint");e.exports=function t(e){var r,s=e.value,u=e.key,l=e.styleSpec,c=[];if("array"!==o(s))return[new n(u,s,"array expected, %s found",o(s))];if(s.length<1)return[new n(u,s,"filter array must have at least 1 element")];switch(c=c.concat(i({key:u+"[0]",value:s[0],valueSpec:l.filter_operator,style:e.style,styleSpec:e.styleSpec})),a(s[0])){case"<":case"<=":case">":case">=":s.length>=2&&"$type"==s[1]&&c.push(new n(u,s,'"$type" cannot be use with operator "%s"',s[0]));case"==":case"!=":3!=s.length&&c.push(new n(u,s,'filter array for operator "%s" must have 3 elements',s[0]));case"in":case"!in":s.length>=2&&(r=o(s[1]),"string"!==r?c.push(new n(u+"[1]",s[1],"string expected, %s found",r)):"@"===s[1][0]&&c.push(new n(u+"[1]",s[1],"filter key cannot be a constant")));for(var p=2;p=8&&(m&&!t.valueSpec["property-function"]?v.push(new n(t.key,t.value,"property functions not supported")):d&&!t.valueSpec["zoom-function"]&&v.push(new n(t.key,t.value,"zoom functions not supported"))),v}},{"../error/validation_error":164,"../util/get_type":167,"../util/unbundle_jsonlint":169,"./validate":170,"./validate_array":171,"./validate_number":182,"./validate_object":183}],178:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("./validate_string");e.exports=function(t){var e=t.value,r=t.key,o=i(t);return o.length?o:(e.indexOf("{fontstack}")===-1&&o.push(new n(r,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&o.push(new n(r,e,'"glyphs" url must include a "{range}" token')),o)}},{"../error/validation_error":164,"./validate_string":186}],179:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint"),o=t("./validate_object"),a=t("./validate_filter"),s=t("./validate_paint_property"),u=t("./validate_layout_property"),l=t("../util/extend");e.exports=function(t){var e=[],r=t.value,c=t.key,p=t.style,h=t.styleSpec;r.type||r.ref||e.push(new n(c,r,'either "type" or "ref" is required'));var f=i(r.type),d=i(r.ref);if(r.id)for(var m=0;mo.maximum?[new i(e,r,"%s is greater than the maximum value %s",r,o.maximum)]:[]}},{"../error/validation_error":164,"../util/get_type":167}],183:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/get_type"),o=t("./validate");e.exports=function(t){var e=t.key,r=t.value,a=t.valueSpec||{},s=t.objectElementValidators||{},u=t.style,l=t.styleSpec,c=[],p=i(r);if("object"!==p)return[new n(e,r,"object expected, %s found",p)];for(var h in r){var f,d=h.split(".")[0],m=a[d]||a["*"];if(s[d])f=s[d];else if(a[d])f=o;else if(s["*"])f=s["*"];else{if(!a["*"]){c.push(new n(e,r[h],'unknown property "%s"',h));continue}f=o}c=c.concat(f({key:(e?e+".":e)+h,value:r[h],valueSpec:m,style:u,styleSpec:l,object:r,objectKey:h}))}for(d in a)a[d].required&&void 0===a[d].default&&void 0===r[d]&&c.push(new n(e,r,'missing required property "%s"',d));return c}},{"../error/validation_error":164,"../util/get_type":167,"./validate":170}],184:[function(t,e,r){"use strict";var n=t("./validate"),i=t("../error/validation_error");e.exports=function(t){var e=t.key,r=t.style,o=t.styleSpec,a=t.value,s=t.objectKey,u=o["paint_"+t.layerType];if(!u)return[];var l=s.match(/^(.*)-transition$/);return l&&u[l[1]]&&u[l[1]].transition?n({key:e,value:a,valueSpec:o.transition,style:r,styleSpec:o}):t.valueSpec||u[s]?n({key:t.key,value:a,valueSpec:t.valueSpec||u[s],style:r,styleSpec:o}):[new i(e,a,'unknown property "%s"',s)]}},{"../error/validation_error":164,"./validate":170}],185:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint"),o=t("./validate_object"),a=t("./validate_enum");e.exports=function(t){var e=t.value,r=t.key,s=t.styleSpec,u=t.style;if(!e.type)return[new n(r,e,'"type" is required')];var l=i(e.type);switch(l){case"vector":case"raster":var c=[];if(c=c.concat(o({key:r,value:e,valueSpec:s.source_tile,style:t.style,styleSpec:s})),"url"in e)for(var p in e)["type","url","tileSize"].indexOf(p)<0&&c.push(new n(r+"."+p,e[p],'a source with a "url" property may not include a "%s" property',p));return c;case"geojson":return o({key:r,value:e,valueSpec:s.source_geojson,style:u,styleSpec:s});case"video":return o({key:r,value:e,valueSpec:s.source_video,style:u,styleSpec:s});case"image":return o({key:r,value:e,valueSpec:s.source_image,style:u,styleSpec:s});default:return a({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","geojson","video","image"]},style:u,styleSpec:s})}}},{"../error/validation_error":164,"../util/unbundle_jsonlint":169,"./validate_enum":175,"./validate_object":183}],186:[function(t,e,r){"use strict";var n=t("../util/get_type"),i=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.key,o=n(e);return"string"!==o?[new i(r,e,"string expected, %s found",o)]:[]}},{"../error/validation_error":164,"../util/get_type":167}],187:[function(t,e,r){"use strict";function n(t,e){e=e||u;var r=[];return r=r.concat(s({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:l,"*":function(){return[]}}})),e.$version>7&&t.constants&&(r=r.concat(a({key:"constants",value:t.constants,style:t,styleSpec:e}))),i(r)}function i(t){return[].concat(t).sort(function(t,e){return t.line-e.line})}function o(t){return function(){return i(t.apply(this,arguments))}}var a=t("./validate/validate_constants"),s=t("./validate/validate"),u=t("../reference/latest.min"),l=t("./validate/validate_glyphs_url"); -n.source=o(t("./validate/validate_source")),n.light=o(t("./validate/validate_light")),n.layer=o(t("./validate/validate_layer")),n.filter=o(t("./validate/validate_filter")),n.paintProperty=o(t("./validate/validate_paint_property")),n.layoutProperty=o(t("./validate/validate_layout_property")),e.exports=n},{"../reference/latest.min":188,"./validate/validate":170,"./validate/validate_constants":174,"./validate/validate_filter":176,"./validate/validate_glyphs_url":178,"./validate/validate_layer":179,"./validate/validate_layout_property":180,"./validate/validate_light":181,"./validate/validate_paint_property":184,"./validate/validate_source":185}],188:[function(t,e,r){e.exports=t("./v8.min.json")},{"./v8.min.json":189}],189:[function(t,e,r){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"},light:{type:"light"},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:18},buffer:{type:"number",default:128,maximum:512,minimum:0},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},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:{},"fill-extrusion":{},raster:{},background:{}}},metadata:{type:"*"},ref:{type:"string"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"},"paint.*":{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_fill-extrusion","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_fill-extrusion":{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:{},auto:{}},default:"auto",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:{},width:{},height:{},both:{}},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","text-field",{"icon-text-fit":["both","width","height"]}]},"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:{},auto:{}},default:"auto",requires:["text-field"]},"text-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{map:{},viewport:{},auto:{}},default:"auto",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:"ems",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-line-height":{type:"number",default:1.2,units:"ems",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-letter-spacing":{type:"number",default:0,units:"ems",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:{}}},function:{stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"}},function_stop:{type:"array",minimum:0,maximum:22,value:["number","color"],length:2},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},transition:!1},position:{type:"array",default:[1.15,210,30],length:3,value:"number",transition:!0,function:"interpolated","zoom-function":!0,"property-function":!1},color:{type:"color",default:"#ffffff",function:"interpolated","zoom-function":!0,"property-function":!1,transition:!0},intensity:{type:"number",default:.5,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!1,transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_fill-extrusion","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_fill-extrusion":{"fill-extrusion-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!1,default:1,minimum:0,maximum:1,transition:!0},"fill-extrusion-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"}]},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!1,transition:!0,units:"pixels"},"fill-extrusion-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!1,values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"]},"fill-extrusion-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!1,transition:!0},"fill-extrusion-height":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:0,minimum:0,units:"meters",transition:!0},"fill-extrusion-base":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:0,minimum:0,units:"meters",transition:!0,requires:[{"<=":"fill-extrusion-height"}]}},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"},"circle-stroke-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-stroke-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0}},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"}}}},{}],190:[function(t,e,r){"use strict";function n(t){return!!(i()&&o()&&a()&&s()&&u()&&l()&&c()&&p(t&&t.failIfMajorPerformanceCaveat))}function i(){return"undefined"!=typeof window&&"undefined"!=typeof document}function o(){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 a(){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 u(){return"JSON"in window&&"parse"in JSON&&"stringify"in JSON}function l(){return"Worker"in window}function c(){return"Uint8ClampedArray"in window}function p(t){return void 0===f[t]&&(f[t]=h(t)),f[t]}function h(t){var e=document.createElement("canvas"),r=Object.create(n.webGLContextAttributes);return r.failIfMajorPerformanceCaveat=t,e.probablySupportsContext?e.probablySupportsContext("webgl",r)||e.probablySupportsContext("experimental-webgl",r):e.supportsContext?e.supportsContext("webgl",r)||e.supportsContext("experimental-webgl",r):e.getContext("webgl",r)||e.getContext("experimental-webgl",r)}"undefined"!=typeof e&&e.exports?e.exports=n:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=n);var f={};n.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}},{}],191:[function(t,e,r){(function(t){function e(t,e){for(var r=0,n=t.length-1;n>=0;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function n(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;n=-1&&!i;o--){var a=o>=0?arguments[o]:t.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(r=a+"/"+r,i="/"===a.charAt(0))}return r=e(n(r.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+r||"."},r.normalize=function(t){var i=r.isAbsolute(t),o="/"===a(t,-1);return t=e(n(t.split("/"),function(t){return!!t}),!i).join("/"),t||i||(t="."),t&&o&&(t+="/"),(i?"/":"")+t},r.isAbsolute=function(t){return"/"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(n(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},r.relative=function(t,e){function n(t){for(var e=0;e=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=r.resolve(t).substr(1),e=r.resolve(e).substr(1);for(var i=n(t.split("/")),o=n(e.split("/")),a=Math.min(i.length,o.length),s=a,u=0;u55295&&e<57344){if(!r){e>56319||o+1===n?i.push(239,191,189):r=e;continue}if(e<56320){i.push(239,191,189),r=e;continue}e=r-55296<<10|e-56320|65536,r=null}else r&&(i.push(239,191,189),r=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=n;var o,a,s,u=t("ieee754");o={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 u.read(this,t,!0,23,4)},readDoubleLE:function(t){return u.read(this,t,!0,52,8)},writeFloatLE:function(t,e){return u.write(this,t,e,!0,23,4)},writeDoubleLE:function(t,e){return u.write(this,t,e,!0,52,8)},toString:function(t,e,r){var n="",i="";e=e||0,r=Math.min(this.length,r||this.length);for(var o=e;o=1;){if(e.pos>=r)throw new Error("Given varint doesn't fit into 10 bytes");var n=255&t;e.buf[e.pos++]=n|(t>=128?128:0),t/=128}}function a(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.ceil(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function s(t,e){for(var r=0;r>3,o=this.pos;t(i,e,this),this.pos===o&&this.skip(n)}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,r=this.buf;return e=r[this.pos++],t=127&e,e<128?t:(e=r[this.pos++],t|=(127&e)<<7,e<128?t:(e=r[this.pos++],t|=(127&e)<<14,e<128?t:(e=r[this.pos++],t|=(127&e)<<21,e<128?t:i(t,this))))},readVarint64:function(){var t=this.pos,e=this.readVarint();if(e<_)return e;for(var r=this.pos-2;255===this.buf[r];)r--;r127;);else if(e===n.Bytes)this.pos=this.readVarint()+this.pos;else if(e===n.Fixed32)this.pos+=4;else{if(e!==n.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 o(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=y.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 r=0;r=128&&a(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,n.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){this.writeMessage(t,s,e)},writePackedSVarint:function(t,e){this.writeMessage(t,u,e)},writePackedBoolean:function(t,e){this.writeMessage(t,p,e)},writePackedFloat:function(t,e){this.writeMessage(t,l,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,f,e)},writePackedFixed64:function(t,e){this.writeMessage(t,d,e)},writePackedSFixed64:function(t,e){this.writeMessage(t,m,e)},writeBytesField:function(t,e){this.writeTag(t,n.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,n.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,n.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,n.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}}).call(this,"undefined"!=typeof r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./buffer":192}],194:[function(t,e,r){"use strict";function n(t,e){this.x=t,this.y=e}e.exports=n,n.prototype={clone:function(){return new n(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,r=t.y-this.y;return e*e+r*r},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,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,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),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t}},{}],195:[function(t,e,r){function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function o(t){if(p===setTimeout)return setTimeout(t,0);if((p===n||!p)&&setTimeout)return p=setTimeout,setTimeout(t,0);try{return p(t,0)}catch(e){try{return p.call(null,t,0)}catch(e){return p.call(this,t,0)}}}function a(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(){y&&d&&(y=!1,d.length?m=d.concat(m):v=-1,m.length&&u())}function u(){if(!y){var t=o(s);y=!0;for(var e=m.length;e;){for(d=m,m=[];++v1)for(var r=1;rr;){if(a-r>600){var u=a-r+1,l=e-r+1,c=Math.log(u),p=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*p*(u-p)/u)*(l-u/2<0?-1:1),f=Math.max(r,Math.floor(e-l*p/u+h)),d=Math.min(a,Math.floor(e+(u-l)*p/u+h));n(t,e,f,d,s)}var m=t[e],y=r,v=a;for(i(t,r,e),s(t[a],m)>0&&i(t,r,a);y0;)v--}0===s(t[r],m)?i(t,r,v):(v++,i(t,v,a)),v<=e&&(r=v+1),e<=v&&(a=v-1)}}function i(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function o(t,e){return te?1:0}e.exports=n},{}],197:[function(e,r,n){!function(e,i){"object"==typeof n&&"undefined"!=typeof r?r.exports=i():"function"==typeof t&&t.amd?t(i):e.ShelfPack=i()}(this,function(){function t(t,e,r){r=r||{},this.w=t||64,this.h=e||64,this.autoResize=!!r.autoResize,this.shelves=[],this.stats={},this.count=function(t){this.stats[t]=(0|this.stats[t])+1}}function e(t,e,r){this.x=0,this.y=t,this.w=this.free=e,this.h=r}return t.prototype.pack=function(t,e){t=[].concat(t),e=e||{};for(var r,n,i,o=[],a=0;a0){for(var s=0,u=0,l=0;ln.h||t>n.free||rc)&&(p=2*Math.max(t,c)),(uu)&&(l=2*Math.max(r,u)),this.resize(p,l),this.packOne(t,r)}return null},t.prototype.clear=function(){this.shelves=[],this.stats={}},t.prototype.resize=function(t,e){this.w=t,this.h=e;for(var r=0;rthis.free||e>this.h)return null;var r=this.x;return this.x+=t,this.free-=t,{x:r,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})},{}],198:[function(t,e,r){"use strict";function n(t){return new i(t)}function i(t){this.options=f(Object.create(this.options),t),this.trees=new Array(this.options.maxZoom+1)}function o(t,e,r,n){return{x:t,y:e,zoom:1/0,id:n,numPoints:r}}function a(t,e){var r=t.geometry.coordinates;return o(l(r[0]),c(r[1]),1,e)}function s(t){return{type:"Feature",properties:u(t),geometry:{type:"Point",coordinates:[p(t.x),h(t.y)]}}}function u(t){var e=t.numPoints,r=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:r}}function l(t){return t/360+.5}function c(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function p(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 f(t,e){for(var r in e)t[r]=e[r];return t}function d(t){return t.x}function m(t){return t.y}var y=t("kdbush");e.exports=n,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 r="prepare "+t.length+" points";e&&console.time(r),this.points=t;var n=t.map(a);e&&console.timeEnd(r);for(var i=this.options.maxZoom;i>=this.options.minZoom;i--){var o=+Date.now();this.trees[i+1]=y(n,d,m,this.options.nodeSize,Float32Array),n=this._cluster(n,i),e&&console.log("z%d: %d clusters in %dms",i,n.length,+Date.now()-o)}return this.trees[this.options.minZoom]=y(n,d,m,this.options.nodeSize,Float32Array),e&&console.timeEnd("total time"),this},getClusters:function(t,e){for(var r=this.trees[this._limitZoom(e)],n=r.range(l(t[0]),c(t[3]),l(t[2]),c(t[1])),i=[],o=0;o=0;r--)this._down(r)}function i(t,e){return te?1:0}function o(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}e.exports=n,n.prototype={push:function(t){this.data.push(t),this.length++,this._up(this.length-1)},pop:function(){var t=this.data[0];return this.data[0]=this.data[this.length-1],this.length--,this.data.pop(),this._down(0),t},peek:function(){return this.data[0]},_up:function(t){for(var e=this.data,r=this.compare;t>0;){var n=Math.floor((t-1)/2);if(!(r(e[t],e[n])<0))break;o(e,n,t),t=n}},_down:function(t){for(var e=this.data,r=this.compare,n=this.length;;){var i=2*t+1,a=i+1,s=t;if(in)return n;for(;ro?r=i:n=i,i=.5*(n-r)+r}return i},n.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}},{}],201:[function(t,e,r){"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 r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],202:[function(t,e,r){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:a};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=o),u(r,t,r.depth)}function o(t,e){var r=i.styles[e];return r?"["+i.colors[r][0]+"m"+t+"["+i.colors[r][1]+"m":t}function a(t,e){return t}function s(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}function u(t,e,r){if(t.customInspect&&e&&z(e.inspect)&&e.inspect!==n.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(r,t);return _(i)||(i=u(t,i,r)),i}var o=l(t,e);if(o)return o;var a=Object.keys(e),m=s(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(e)),S(e)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return c(e);if(0===a.length){if(z(e)){var y=e.name?": "+e.name:"";return t.stylize("[Function"+y+"]","special")}if(w(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(T(e))return t.stylize(Date.prototype.toString.call(e),"date");if(S(e))return c(e)}var v="",g=!1,x=["{","}"];if(d(e)&&(g=!0,x=["[","]"]),z(e)){var b=e.name?": "+e.name:"";v=" [Function"+b+"]"}if(w(e)&&(v=" "+RegExp.prototype.toString.call(e)),T(e)&&(v=" "+Date.prototype.toUTCString.call(e)),S(e)&&(v=" "+c(e)),0===a.length&&(!g||0==e.length))return x[0]+v+x[1];if(r<0)return w(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var E;return E=g?p(t,e,r,m,a):a.map(function(n){return h(t,e,r,m,n,g)}),t.seen.pop(),f(E,v,x)}function l(t,e){if(b(e))return t.stylize("undefined","undefined");if(_(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return g(e)?t.stylize(""+e,"number"):m(e)?t.stylize(""+e,"boolean"):y(e)?t.stylize("null","null"):void 0}function c(t){return"["+Error.prototype.toString.call(t)+"]"}function p(t,e,r,n,i){for(var o=[],a=0,s=e.length;a-1&&(s=o?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(a)){if(o&&i.match(/^\d+$/))return s;a=JSON.stringify(""+i),a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function f(t,e,r){var n=0,i=t.reduce(function(t,e){return n++,e.indexOf("\n")>=0&&n++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}function d(t){return Array.isArray(t)}function m(t){return"boolean"==typeof t}function y(t){return null===t}function v(t){return null==t}function g(t){return"number"==typeof t}function _(t){return"string"==typeof t}function x(t){return"symbol"==typeof t}function b(t){return void 0===t}function w(t){return E(t)&&"[object RegExp]"===M(t)}function E(t){return"object"==typeof t&&null!==t}function T(t){return E(t)&&"[object Date]"===M(t)}function S(t){return E(t)&&("[object Error]"===M(t)||t instanceof Error)}function z(t){return"function"==typeof t}function A(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t}function M(t){return Object.prototype.toString.call(t)}function P(t){return t<10?"0"+t.toString(10):t.toString(10)}function I(){var t=new Date,e=[P(t.getHours()),P(t.getMinutes()),P(t.getSeconds())].join(":");return[t.getDate(),D[t.getMonth()],e].join(" ")}function L(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var k=/%[sdj%]/g;n.format=function(t){if(!_(t)){for(var e=[],r=0;r=o)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}),s=n[r];r>3}if(i--,1===n||2===n)o+=t.readSVarint(),a+=t.readSVarint(),1===n&&(e&&s.push(e),e=[]),e.push(new u(o,a));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&s.push(e),s},n.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,o=0,a=1/0,s=-(1/0),u=1/0,l=-(1/0);t.pos>3}if(n--,1===r||2===r)i+=t.readSVarint(),o+=t.readSVarint(),is&&(s=i),ol&&(l=o);else if(7!==r)throw new Error("unknown command "+r)}return[a,u,s,l]},n.prototype.toGeoJSON=function(t,e,r){function i(t){for(var e=0;e>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}var a=t("./vectortilefeature.js");e.exports=n,n.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 a(this._pbf,e,this.extent,this._keys,this._values)}},{"./vectortilefeature.js":206}],208:[function(t,e,r){function n(t){var e=[];for(var r in t.layers)e.push(o(t.layers[r]));var n=new c;return p.tile.write({layers:e},n),n.finish()}function i(t){var e={};for(var r in t)e[r]=new h(t[r].features),e[r].name=r;return n({layers:e})}function o(t){for(var e={name:t.name||"",version:t.version||1,extent:t.extent||4096,keys:[],values:[],features:[]},r={},n={},i=0;i>31}function u(t){for(var e=[],r=0,n=0,i=t.length,o=0;o0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},a.prototype.compare=function(t,e,r,i,n){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,i>>>=0,n>>>=0,this===t)return 0;for(var o=n-i,s=r-e,u=Math.min(o,s),l=this.slice(i,n),c=t.slice(e,r),h=0;hn)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":return T(this,t,e,r);case"latin1":case"binary":return S(this,t,e,r);case"base64":return z(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var tt=4096;a.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),e0&&(n*=256);)i+=this[t+--e]*n;return i},a.prototype.readUInt8=function(t,e){return e||D(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,e){return e||D(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,e){return e||D(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,e){return e||D(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUInt32BE=function(t,e){return e||D(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||D(t,e,this.length);for(var i=this[t],n=1,o=0;++o=n&&(i-=Math.pow(2,8*e)),i},a.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||D(t,e,this.length);for(var i=e,n=1,o=this[t+--i];i>0&&(n*=256);)o+=this[t+--i]*n;return n*=128,o>=n&&(o-=Math.pow(2,8*e)),o},a.prototype.readInt8=function(t,e){return e||D(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},a.prototype.readInt16LE=function(t,e){e||D(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(t,e){e||D(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(t,e){return e||D(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return e||D(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return e||D(t,4,this.length),Q.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return e||D(t,4,this.length),Q.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return e||D(t,8,this.length),Q.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return e||D(t,8,this.length),Q.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,e,r,i){if(t=+t,e|=0,r|=0,!i){var n=Math.pow(2,8*r)-1;O(this,t,e,r,n,0)}var o=1,a=0;for(this[e]=255&t;++a=0&&(a*=256);)this[e+o]=t/a&255;return e+r},a.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},a.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):B(this,t,e,!0),e+2},a.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):B(this,t,e,!1),e+2},a.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):j(this,t,e,!0),e+4},a.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):j(this,t,e,!1),e+4},a.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e|=0,!i){var n=Math.pow(2,8*r-1);O(this,t,e,r,n-1,-n)}var o=0,a=1,s=0;for(this[e]=255&t;++o>0)-s&255;return e+r},a.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e|=0,!i){var n=Math.pow(2,8*r-1);O(this,t,e,r,n-1,-n)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},a.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):B(this,t,e,!0),e+2},a.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):B(this,t,e,!1),e+2},a.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):j(this,t,e,!0),e+4},a.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):j(this,t,e,!1),e+4},a.prototype.writeFloatLE=function(t,e,r){return U(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return U(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return V(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return V(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,i){if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e=0;--n)t[n+e]=this[n+r];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(n=0;n>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var o;if("number"==typeof t)for(o=e;o>1,c=-7,h=r?n-1:0,p=r?-1:1,f=t[e+h];for(h+=p,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=256*o+t[e+h],h+=p,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=i;c>0;a=256*a+t[e+h],h+=p,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:(f?-1:1)*(1/0);a+=Math.pow(2,i),o-=l}return(f?-1:1)*a*Math.pow(2,o-i)},e.write=function(t,e,r,i,n,o){var a,s,u,l=8*o-n-1,c=(1<>1,p=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:o-1,d=i?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,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),e+=a+h>=1?p/u:p*Math.pow(2,1-h),e*u>=2&&(a++,u/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(e*u-1)*Math.pow(2,n),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,n),a=0));n>=8;t[r+f]=255&s,f+=d,s/=256,n-=8);for(a=a<0;t[r+f]=255&a,f+=d,a/=256,l-=8);t[r+f-d]|=128*m}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){(function(e,r){var i,i;!function(e){t.exports=e()}(function(){var t;return function t(e,r,n){function o(s,u){if(!r[s]){if(!e[s]){var l="function"==typeof i&&i;if(!u&&l)return i(s,!0);if(a)return a(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var h=r[s]={exports:{}};e[s][0].call(h.exports,function(t){var r=e[s][1][t];return o(r?r:t)},h,h.exports,t,e,r,n)}return r[s].exports}for(var a="function"==typeof i&&i,s=0;sa.MAX_VERTEX_ARRAY_LENGTH)&&(e=new o(this.layoutVertexArray.length,this.elementArray.length),this.segments.push(e)),e},a.prototype.prepareSegment2=function(t){var e=this.segments2[this.segments2.length-1];return(!e||e.vertexLength+t>a.MAX_VERTEX_ARRAY_LENGTH)&&(e=new o(this.layoutVertexArray.length,this.elementArray2.length),this.segments2.push(e)),e},a.prototype.populatePaintArrays=function(t){var e=this;for(var r in this.layerData){var i=e.layerData[r];0!==i.paintVertexArray.bytesPerElement&&i.programConfiguration.populatePaintArray(i.layer,i.paintVertexArray,e.layoutVertexArray.length,e.globalProperties,t)}},a.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},a.prototype.serialize=function(t){return{layoutVertexArray:this.layoutVertexArray.serialize(t),elementArray:this.elementArray&&this.elementArray.serialize(t),elementArray2:this.elementArray2&&this.elementArray2.serialize(t),paintVertexArrays:i(this.layerData,t),segments:this.segments,segments2:this.segments2}},a.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,e.exports=a},{"./program_configuration":15}],2:[function(t,e,r){"use strict";var i=t("./array_group"),n=t("./buffer_group"),o=t("../util/util"),a=function(t,e){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.index=t.index,t.arrays?this.buffers=new n(e,t.layers,t.zoom,t.arrays):this.arrays=new i(e,t.layers,t.zoom)};a.prototype.populate=function(t,e){for(var r=this,i=0,n=t;i=u||p<0||p>=u)){var f=e.prepareSegment(4),d=f.vertexLength;i(e.layoutVertexArray,h,p,-1,-1),i(e.layoutVertexArray,h,p,1,-1),i(e.layoutVertexArray,h,p,1,1),i(e.layoutVertexArray,h,p,-1,1),e.elementArray.emplaceBack(d,d+1,d+2),e.elementArray.emplaceBack(d,d+3,d+2),f.vertexLength+=4,f.primitiveLength+=2}}e.populatePaintArrays(t.properties)},e}(n);e.exports=c},{"../bucket":2,"../element_array_type":10,"../extent":11,"../load_geometry":13,"../vertex_array_type":17}],4:[function(t,e,r){"use strict";var i=t("../bucket"),n=t("../vertex_array_type"),o=t("../element_array_type"),a=t("../load_geometry"),s=t("earcut"),u=t("../../util/classify_rings"),l=500,c={layoutVertexArrayType:n([{name:"a_pos",components:2,type:"Int16"}]),elementArrayType:o(3),elementArrayType2:o(2),paintAttributes:[{property:"fill-color",type:"Uint8"},{property:"fill-outline-color",type:"Uint8"},{property:"fill-opacity",type:"Uint8",multiplier:255}]},h=function(t){function e(e){t.call(this,e,c)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addFeature=function(t){for(var e=this.arrays,r=0,i=u(a(t),l);rl)||t.y===e.y&&(t.y<0||t.y>l)}var o=t("../bucket"),a=t("../vertex_array_type"),s=t("../element_array_type"),u=t("../load_geometry"),l=t("../extent"),c=t("earcut"),h=t("../../util/classify_rings"),p=500,f={layoutVertexArrayType:a([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal",components:3,type:"Int16"},{name:"a_edgedistance",components:1,type:"Int16"}]),elementArrayType:s(3),paintAttributes:[{property:"fill-extrusion-base",type:"Uint16"},{property:"fill-extrusion-height",type:"Uint16"},{property:"fill-extrusion-color",type:"Uint8"}]},d=Math.pow(2,13),m=function(t){function e(e){t.call(this,e,f)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addFeature=function(t){for(var e=this.arrays,r=0,o=h(u(t),p);r=1){var S=b[E-1];if(!n(T,S)){var z=T.sub(S)._perp()._unit();i(e.layoutVertexArray,T.x,T.y,z.x,z.y,0,0,w),i(e.layoutVertexArray,T.x,T.y,z.x,z.y,0,1,w),w+=S.dist(T),i(e.layoutVertexArray,S.x,S.y,z.x,z.y,0,0,w),i(e.layoutVertexArray,S.x,S.y,z.x,z.y,0,1,w);var A=m.vertexLength;e.elementArray.emplaceBack(A,A+1,A+2),e.elementArray.emplaceBack(A+1,A+2,A+3),m.vertexLength+=4,m.primitiveLength+=2}}y.push(T.x),y.push(T.y)}}}for(var M=c(y,v),P=0;P>6)}var n=t("../bucket"),o=t("../vertex_array_type"),a=t("../element_array_type"),s=t("../load_geometry"),u=t("../extent"),l=63,c=Math.cos(37.5*(Math.PI/180)),h=15,p=15,f=.5,d=Math.pow(2,p-1)/f,m={layoutVertexArrayType:o([{name:"a_pos",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}]),paintAttributes:[{property:"line-color",type:"Uint8"},{property:"line-blur",multiplier:10,type:"Uint8"},{property:"line-opacity",multiplier:10,type:"Uint8"},{property:"line-gap-width",multiplier:10,type:"Uint8",name:"a_gapwidth"},{property:"line-offset",multiplier:1,type:"Int8"}],elementArrayType:a()},y=function(t){function e(e){t.call(this,e,m)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addFeature=function(t){for(var e=this,r=this.layers[0].layout,i=r["line-join"],n=r["line-cap"],o=r["line-miter-limit"],a=r["line-round-limit"],u=0,l=s(t,p);u2&&t[s-1].equals(t[s-2]);)s--;if(!(t.length<2)){"bevel"===r&&(n=1.05);var l=h*(u/(512*this.overscaling)),p=t[0],f=t[s-1],d=p.equals(f),m=this.arrays,y=m.prepareSegment(10*s);if(2!==s||!d){this.distance=0;var v,g,_,x,b,w,E,T=i,S=d?"butt":i,z=!0;this.e1=this.e2=this.e3=-1,d&&(v=t[s-2],b=p.sub(v)._unit()._perp());for(var A=0;A0){var C=v.dist(g);if(C>2*l){var k=v.sub(v.sub(g)._mult(l/C)._round());a.distance+=k.dist(g),a.addCurrentVertex(k,a.distance,x.mult(1),0,0,!1,y),g=k}}var R=g&&_,D=R?r:_?T:S;if(R&&"round"===D&&(Ln&&(D="bevel"),"bevel"===D&&(L>2&&(D="flipbevel"),L100)M=b.clone().mult(-1);else{var O=x.x*b.y-x.y*b.x>0?-1:1,B=L*x.add(b).mag()/x.sub(b).mag();M._perp()._mult(B*O)}a.addCurrentVertex(v,a.distance,M,0,0,!1,y),a.addCurrentVertex(v,a.distance,M.mult(-1),0,0,!1,y)}else if("bevel"===D||"fakeround"===D){var j=x.x*b.y-x.y*b.x>0,F=-Math.sqrt(L*L-1);if(j?(E=0,w=F):(w=0,E=F),z||a.addCurrentVertex(v,a.distance,x,w,E,!1,y),"fakeround"===D){for(var U,V=Math.floor(8*(.5-(P-.5))),N=0;N=0;q--)U=x.mult((q+1)/(V+1))._add(b)._unit(),a.addPieSliceVertex(v,a.distance,U,j,y)}_&&a.addCurrentVertex(v,a.distance,b,-w,-E,!1,y)}else"butt"===D?(z||a.addCurrentVertex(v,a.distance,x,0,0,!1,y),_&&a.addCurrentVertex(v,a.distance,b,0,0,!1,y)):"square"===D?(z||(a.addCurrentVertex(v,a.distance,x,1,1,!1,y),a.e1=a.e2=-1),_&&a.addCurrentVertex(v,a.distance,b,-1,-1,!1,y)):"round"===D&&(z||(a.addCurrentVertex(v,a.distance,x,0,0,!1,y),a.addCurrentVertex(v,a.distance,x,1,1,!0,y),a.e1=a.e2=-1),_&&(a.addCurrentVertex(v,a.distance,b,-1,-1,!0,y),a.addCurrentVertex(v,a.distance,b,0,0,!1,y)));if(I&&A2*l){var G=v.add(_.sub(v)._mult(l/Z)._round());a.distance+=G.dist(v),a.addCurrentVertex(G,a.distance,b.mult(1),0,0,!1,y),v=G}}z=!1}m.populatePaintArrays(e)}}},e.prototype.addCurrentVertex=function(t,e,r,n,o,a,s){var u,l=a?1:0,c=this.arrays,h=c.layoutVertexArray,p=c.elementArray;u=r.clone(),n&&u._sub(r.perp()._mult(n)),i(h,t,u,l,0,n,e),this.e3=s.vertexLength++,this.e1>=0&&this.e2>=0&&(p.emplaceBack(this.e1,this.e2,this.e3),s.primitiveLength++),this.e1=this.e2,this.e2=this.e3,u=r.mult(-1),o&&u._sub(r.perp()._mult(o)),i(h,t,u,l,1,-o,e),this.e3=s.vertexLength++,this.e1>=0&&this.e2>=0&&(p.emplaceBack(this.e1,this.e2,this.e3),s.primitiveLength++),this.e1=this.e2,this.e2=this.e3,e>d/2&&(this.distance=0,this.addCurrentVertex(t,this.distance,r,n,o,a,s))},e.prototype.addPieSliceVertex=function(t,e,r,n,o){var a=n?1:0;r=r.mult(n?-1:1);var s=this.arrays,u=s.layoutVertexArray,l=s.elementArray;i(u,t,r,0,a,0,e),this.e3=o.vertexLength++,this.e1>=0&&this.e2>=0&&(l.emplaceBack(this.e1,this.e2,this.e3),o.primitiveLength++),n?this.e2=this.e3:this.e1=this.e3},e}(n);e.exports=y},{"../bucket":2,"../element_array_type":10,"../extent":11,"../load_geometry":13,"../vertex_array_type":17}],7:[function(t,e,r){"use strict";function i(t,e,r,i,n,o,a,s,u,l,c){t.emplaceBack(e,r,Math.round(64*i),Math.round(64*n),o/4,a/4,10*(l||0),c,10*(s||0),10*Math.min(u||25,25))}function n(t,e,r,i,n){return t.emplaceBack(e.x,e.y,Math.round(r.x),Math.round(r.y),10*i,10*n)}var o=t("point-geometry"),a=t("../array_group"),s=t("../buffer_group"),u=t("../vertex_array_type"),l=t("../element_array_type"),c=t("../extent"),h=t("../../symbol/anchor"),p=t("../../symbol/get_anchors"),f=t("../../util/token"),d=t("../../symbol/quads"),m=t("../../symbol/shaping"),y=t("../../symbol/resolve_text"),v=t("../../symbol/mergelines"),g=t("../../symbol/clip_line"),_=t("../../util/util"),x=t("../../util/script_detection"),b=t("../load_geometry"),w=t("../../symbol/collision_feature"),E=t("../../util/find_pole_of_inaccessibility"),T=t("../../util/classify_rings"),S=t("vector-tile").VectorTileFeature,z=t("../../source/rtl_text_plugin"),A=m.shapeText,M=m.shapeIcon,P=m.WritingMode,L=d.getGlyphQuads,I=d.getIconQuads,C=l(),k=u([{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"}]),R={glyph:{layoutVertexArrayType:k,elementArrayType:C},icon:{layoutVertexArrayType:k,elementArrayType:C},collisionBox:{layoutVertexArrayType:u([{name:"a_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"},{name:"a_data",components:2,type:"Uint8"}]),elementArrayType:l(2)}},D=function(t){var e=this;if(this.collisionBoxArray=t.collisionBoxArray,this.symbolQuadsArray=t.symbolQuadsArray,this.symbolInstancesArray=t.symbolInstancesArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.index=t.index,this.sdfIcons=t.sdfIcons,this.iconsNeedLinear=t.iconsNeedLinear,this.adjustedTextSize=t.adjustedTextSize,this.adjustedIconSize=t.adjustedIconSize,this.fontstack=t.fontstack,t.arrays){this.buffers={};for(var r in t.arrays)t.arrays[r]&&(e.buffers[r]=new s(R[r],t.layers,t.zoom,t.arrays[r]))}};D.prototype.populate=function(t,e){var r=this,i=this.layers[0].layout,n=i["text-field"],o=i["text-font"],a=i["icon-image"],s=n&&o,u=a;if(this.features=[],s||u){for(var l=e.iconDependencies,c=e.glyphDependencies,h=c[o]=c[o]||{},p=0;pc||o.y<0||o.y>c);if(!m||a){var s=a||w;i.addSymbolInstance(o,n,e,r,i.layers[0],s,i.symbolInstancesArray.length,i.collisionBoxArray,t.index,t.sourceLayerIndex,i.index,u,y,x,f,v,b,{zoom:i.zoom},t.properties)}};if("line"===S)for(var M=0,L=g(t.geometry,0,0,c,c);M=0;o--)if(r.dist(n[o])7*Math.PI/4)continue}else if(o&&a&&y<=3*Math.PI/4||y>5*Math.PI/4)continue}else if(o&&a&&(y<=Math.PI/2||y>3*Math.PI/2))continue;var v=m.tl,g=m.tr,_=m.bl,x=m.br,b=m.tex,w=m.anchorPoint,E=Math.max(p+Math.log(m.minScale)/Math.LN2,f),T=Math.min(p+Math.log(m.maxScale)/Math.LN2,25);if(!(T<=E)){E===f&&(E=0);var S=Math.round(m.glyphAngle/(2*Math.PI)*256),z=t.prepareSegment(4),A=z.vertexLength;i(h,w.x,w.y,v.x,v.y,b.x,b.y,E,T,f,S),i(h,w.x,w.y,g.x,g.y,b.x+b.w,b.y,E,T,f,S),i(h,w.x,w.y,_.x,_.y,b.x,b.y+b.h,E,T,f,S),i(h,w.x,w.y,x.x,x.y,b.x+b.w,b.y+b.h,E,T,f,S),c.emplaceBack(A,A+1,A+2),c.emplaceBack(A+1,A+2,A+3),z.vertexLength+=4,z.primitiveLength+=2}}},D.prototype.addToDebugBuffers=function(t){for(var e=this,r=this.arrays.collisionBox,i=r.layoutVertexArray,a=r.elementArray,s=-t.angle,u=t.yStretch,l=this.symbolInstancesStartIndex;lD.MAX_QUADS&&_.warnOnce("Too many symbols being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),k>D.MAX_QUADS&&_.warnOnce("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907");var V=(r[P.vertical]?P.vertical:0)|(r[P.horizontal]?P.horizontal:0);return this.symbolInstancesArray.emplaceBack(R,O,F,U,M,k,B,j,t.x,t.y,a,V)},D.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,t.writingMode)},D.MAX_QUADS=65535,e.exports=D},{"../../source/rtl_text_plugin":49,"../../symbol/anchor":75,"../../symbol/clip_line":77,"../../symbol/collision_feature":79,"../../symbol/get_anchors":81,"../../symbol/mergelines":84,"../../symbol/quads":85,"../../symbol/resolve_text":86,"../../symbol/shaping":87,"../../util/classify_rings":113,"../../util/find_pole_of_inaccessibility":119,"../../util/script_detection":126,"../../util/token":128,"../../util/util":129,"../array_group":1,"../buffer_group":9,"../element_array_type":10,"../extent":11,"../load_geometry":13,"../vertex_array_type":17,"point-geometry":197,"vector-tile":206}],8:[function(t,e,r){"use strict";var i={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT"},n=function(t,e,r){this.arrayBuffer=t.arrayBuffer,this.length=t.length,this.attributes=e.members,this.itemSize=e.bytesPerElement,this.type=r,this.arrayType=e};n.fromStructArray=function(t,e){return new n(t.serialize(),t.constructor.serialize(),e)},n.prototype.bind=function(t){var e=t[this.type];this.buffer?t.bindBuffer(e,this.buffer):(this.gl=t,this.buffer=t.createBuffer(),t.bindBuffer(e,this.buffer),t.bufferData(e,this.arrayBuffer,t.STATIC_DRAW),this.arrayBuffer=null)},n.prototype.setVertexAttribPointers=function(t,e,r){for(var n=this,o=0;o0?t["line-gap-width"]+2*t["line-width"]:t["line-width"]}function a(t,e,r,i,n){if(!e[0]&&!e[1])return t;e=u.convert(e),"viewport"===r&&e._rotate(-i);for(var o=[],a=0;ar.max||h.yr.max)&&n.warnOnce("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return s}},{"../util/util":129,"./extent":11}],14:[function(t,e,r){"use strict";var i=t("../util/struct_array"),n=i({members:[{name:"a_pos",type:"Int16",components:2}]});e.exports=n},{"../util/struct_array":127}],15:[function(t,e,r){"use strict";function i(t,e,r,i){if(!t.zoomStops)return e.getPaintValue(t.property,r,i);var n=t.zoomStops.map(function(n){return e.getPaintValue(t.property,a.extend({},r,{zoom:n}),i)});return 1===n.length?n[0]:n}function n(t,e){var r=t.property.replace(e.type+"-","").replace(/-/g,"_"),i="color"===e._paintSpecifications[t.property].type;return a.extend({name:"a_"+r,components:i?4:1,multiplier:i?255:1},t)}var o=t("./vertex_array_type"),a=t("../util/util"),s=function(){this.attributes=[],this.uniforms=[],this.interpolationUniforms=[],this.pragmas={vertex:{},fragment:{}},this.cacheKey=""};s.createDynamic=function(t,e,r){for(var i=new s,a=0,u=t;a90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};n.prototype.wrap=function(){return new n(i(this.lng,-180,180),this.lat)},n.prototype.toArray=function(){return[this.lng,this.lat]},n.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},n.convert=function(t){if(t instanceof n)return t;if(t&&t.hasOwnProperty("lng")&&t.hasOwnProperty("lat"))return new n(t.lng,t.lat);if(Array.isArray(t)&&2===t.length)return new n(t[0],t[1]);throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, or an array of [, ]")},e.exports=n},{"../util/util":129}],20:[function(t,e,r){"use strict";var i=t("./lng_lat"),n=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};n.prototype.setNorthEast=function(t){return this._ne=i.convert(t),this},n.prototype.setSouthWest=function(t){return this._sw=i.convert(t),this},n.prototype.extend=function(t){var e,r,o=this._sw,a=this._ne;if(t instanceof i)e=t,r=t;else{if(!(t instanceof n))return Array.isArray(t)?t.every(Array.isArray)?this.extend(n.convert(t)):this.extend(i.convert(t)):this;if(e=t._sw,r=t._ne,!e||!r)return this}return o||a?(o.lng=Math.min(e.lng,o.lng),o.lat=Math.min(e.lat,o.lat),a.lng=Math.max(r.lng,a.lng),a.lat=Math.max(r.lat,a.lat)):(this._sw=new i(e.lng,e.lat),this._ne=new i(r.lng,r.lat)),this},n.prototype.getCenter=function(){return new i((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},n.prototype.getSouthWest=function(){return this._sw},n.prototype.getNorthEast=function(){return this._ne},n.prototype.getNorthWest=function(){return new i(this.getWest(),this.getNorth())},n.prototype.getSouthEast=function(){return new i(this.getEast(),this.getSouth())},n.prototype.getWest=function(){return this._sw.lng},n.prototype.getSouth=function(){return this._sw.lat},n.prototype.getEast=function(){return this._ne.lng},n.prototype.getNorth=function(){return this._ne.lat},n.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},n.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},n.convert=function(t){return!t||t instanceof n?t:new n(t)},e.exports=n},{"./lng_lat":19}],21:[function(t,e,r){"use strict";var i=t("./lng_lat"),n=t("point-geometry"),o=t("./coordinate"),a=t("../util/util"),s=t("../util/interpolate"),u=t("../source/tile_coord"),l=t("../data/extent"),c=t("@mapbox/gl-matrix"),h=c.vec4,p=c.mat4,f=c.mat2,d=function(t,e,r){this.tileSize=512,this._renderWorldCopies=void 0===r||r,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._fov=.6435011087932844,this._pitch=0,this._unmodified=!0},m={minZoom:{},maxZoom:{},worldSize:{},centerPoint:{},size:{},bearing:{},pitch:{},fov:{},zoom:{},center:{},unmodified:{},x:{},y:{},point:{}};m.minZoom.get=function(){return this._minZoom},m.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},m.maxZoom.get=function(){return this._maxZoom},m.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},m.worldSize.get=function(){return this.tileSize*this.scale},m.centerPoint.get=function(){return this.size._div(2)},m.size.get=function(){return new n(this.width,this.height)},m.bearing.get=function(){return-this.angle/Math.PI*180},m.bearing.set=function(t){var e=-a.wrap(t,-180,180)*Math.PI/180;this.angle!==e&&(this._unmodified=!1,this.angle=e,this._calcMatrices(),this.rotationMatrix=f.create(),f.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},m.pitch.get=function(){return this._pitch/Math.PI*180},m.pitch.set=function(t){var e=a.clamp(t,0,60)/180*Math.PI;this._pitch!==e&&(this._unmodified=!1,this._pitch=e,this._calcMatrices())},m.fov.get=function(){return this._fov/Math.PI*180},m.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())},m.zoom.get=function(){return this._zoom},m.zoom.set=function(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._constrain(),this._calcMatrices())},m.center.get=function(){return this._center},m.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},d.prototype.coveringZoomLevel=function(t){return(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},d.prototype.coveringTiles=function(t){var e=this.coveringZoomLevel(t),r=e;if(et.maxzoom&&(e=t.maxzoom);var i=this.pointCoordinate(this.centerPoint,e),o=new n(i.column-.5,i.row-.5),a=[this.pointCoordinate(new n(0,0),e),this.pointCoordinate(new n(this.width,0),e),this.pointCoordinate(new n(this.width,this.height),e),this.pointCoordinate(new n(0,this.height),e)];return u.cover(e,a,t.reparseOverscaled?r:e,this._renderWorldCopies).sort(function(t,e){return o.dist(t)-o.dist(e)})},d.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},m.unmodified.get=function(){return this._unmodified},d.prototype.zoomScale=function(t){return Math.pow(2,t)},d.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},d.prototype.project=function(t){return new n(this.lngX(t.lng),this.latY(t.lat))},d.prototype.unproject=function(t){return new i(this.xLng(t.x),this.yLat(t.y))},m.x.get=function(){return this.lngX(this.center.lng)},m.y.get=function(){return this.latY(this.center.lat)},m.point.get=function(){return new n(this.x,this.y)},d.prototype.lngX=function(t){return(180+t)*this.worldSize/360},d.prototype.latY=function(t){var e=180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360));return(180-e)*this.worldSize/360},d.prototype.xLng=function(t){return 360*t/this.worldSize-180},d.prototype.yLat=function(t){var e=180-360*t/this.worldSize;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90},d.prototype.setLocationAtPoint=function(t,e){var r=this.pointCoordinate(e)._sub(this.pointCoordinate(this.centerPoint));this.center=this.coordinateLocation(this.locationCoordinate(t)._sub(r))},d.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},d.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},d.prototype.locationCoordinate=function(t){return new o(this.lngX(t.lng)/this.tileSize,this.latY(t.lat)/this.tileSize,this.zoom).zoomTo(this.tileZoom)},d.prototype.coordinateLocation=function(t){var e=t.zoomTo(this.zoom);return new i(this.xLng(e.column*this.tileSize),this.yLat(e.row*this.tileSize))},d.prototype.pointCoordinate=function(t,e){void 0===e&&(e=this.tileZoom);var r=0,i=[t.x,t.y,0,1],n=[t.x,t.y,1,1];h.transformMat4(i,i,this.pixelMatrixInverse),h.transformMat4(n,n,this.pixelMatrixInverse);var a=i[3],u=n[3],l=i[0]/a,c=n[0]/u,p=i[1]/a,f=n[1]/u,d=i[2]/a,m=n[2]/u,y=d===m?0:(r-d)/(m-d);return new o(s(l,c,y)/this.tileSize,s(p,f,y)/this.tileSize,this.zoom)._zoomTo(e)},d.prototype.coordinatePoint=function(t){var e=t.zoomTo(this.zoom),r=[e.column*this.tileSize,e.row*this.tileSize,0,1];return h.transformMat4(r,r,this.pixelMatrix),new n(r[0]/r[3],r[1]/r[3])},d.prototype.calculatePosMatrix=function(t,e){var r=t.toCoordinate(e),i=this.worldSize/this.zoomScale(r.zoom),n=p.identity(new Float64Array(16));return p.translate(n,n,[r.column*i,r.row*i,0]),p.scale(n,n,[i/l,i/l,1]),p.multiply(n,this.projMatrix,n),new Float32Array(n)},d.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,e,r,i,o,a,s,u,l=this.size,c=this._unmodified;this.latRange&&(t=this.latY(this.latRange[1]),e=this.latY(this.latRange[0]),o=e-te&&(u=e-f)}if(this.lngRange){var d=this.x,m=l.x/2;d-mi&&(s=i-m)}void 0===s&&void 0===u||(this.center=this.unproject(new n(void 0!==s?s:this.x,void 0!==u?u:this.y))),this._unmodified=c,this._constraining=!1}},d.prototype._calcMatrices=function(){if(this.height){this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var t=this._fov/2,e=Math.PI/2+this._pitch,r=Math.sin(t)*this.cameraToCenterDistance/Math.sin(Math.PI-e-t),i=Math.cos(Math.PI/2-this._pitch)*r+this.cameraToCenterDistance,n=1.01*i,o=new Float64Array(16);p.perspective(o,this._fov,this.width/this.height,1,n),p.scale(o,o,[1,-1,1]),p.translate(o,o,[0,0,-this.cameraToCenterDistance]),p.rotateX(o,o,this._pitch),p.rotateZ(o,o,this.angle),p.translate(o,o,[-this.x,-this.y,0]);var a=this.worldSize/(2*Math.PI*6378137*Math.abs(Math.cos(this.center.lat*(Math.PI/180))));if(p.scale(o,o,[1,1,a,1]),this.projMatrix=o,o=p.create(),p.scale(o,o,[this.width/2,-this.height/2,1]),p.translate(o,o,[1,-1,0]),this.pixelMatrix=p.multiply(new Float64Array(16),o,this.projMatrix),o=p.invert(new Float64Array(16),this.pixelMatrix),!o)throw new Error("failed to invert matrix");this.pixelMatrixInverse=o}},Object.defineProperties(d.prototype,m),e.exports=d},{"../data/extent":11,"../source/tile_coord":53,"../util/interpolate":121,"../util/util":129,"./coordinate":18,"./lng_lat":19,"@mapbox/gl-matrix":133,"point-geometry":197}],22:[function(t,e,r){"use strict";var i,n=t("./util/worker_pool");e.exports=function(){return i||(i=new n),i}},{"./util/worker_pool":132}],23:[function(t,e,r){"use strict";var i={" ":[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,r,n){n=n||1;var o,a,s,u,l,c,h,p,f=[];for(o=0,a=t.length;o0?1/(1-t):1+t}function s(t){return t>0?1-1/(1.001-t):-t}function u(t,e,r,i){var n=r.paint["raster-fade-duration"];if(t.sourceCache&&n>0){var o=Date.now(),a=(o-t.timeAdded)/n,s=e?(o-e.timeAdded)/n:-1,u=t.sourceCache.getSource(),c=i.coveringZoomLevel({tileSize:u.tileSize,roundZoom:u.roundZoom}),h=!e||Math.abs(e.coord.z-c)>Math.abs(t.coord.z-c),p=l.clamp(h?a:1-s,0,1);return e?{opacity:1,mix:1-p}:{opacity:p,mix:0}}return{opacity:1,mix:0}}var l=t("../util/util");e.exports=i},{"../util/util":129}],33:[function(t,e,r){"use strict";function i(t,e,r,i){if(!t.isOpaquePass){var o=!(r.layout["text-allow-overlap"]||r.layout["icon-allow-overlap"]||r.layout["text-ignore-placement"]||r.layout["icon-ignore-placement"]),a=t.gl;o?a.disable(a.STENCIL_TEST):a.enable(a.STENCIL_TEST),t.setDepthSublayer(0),t.depthMask(!1),n(t,e,r,i,!1,r.paint["icon-translate"],r.paint["icon-translate-anchor"],r.layout["icon-rotation-alignment"],r.layout["icon-rotation-alignment"],r.layout["icon-size"],r.paint["icon-halo-width"],r.paint["icon-halo-color"],r.paint["icon-halo-blur"],r.paint["icon-opacity"],r.paint["icon-color"]),n(t,e,r,i,!0,r.paint["text-translate"],r.paint["text-translate-anchor"],r.layout["text-rotation-alignment"],r.layout["text-pitch-alignment"],r.layout["text-size"],r.paint["text-halo-width"],r.paint["text-halo-color"],r.paint["text-halo-blur"],r.paint["text-opacity"],r.paint["text-color"]),e.map.showCollisionBoxes&&l(t,e,r,i)}}function n(t,e,r,i,n,s,u,l,c,h,p,f,d,m,y){if(n||!t.style.sprite||t.style.sprite.loaded()){var v=t.gl,g="map"===l,_="map"===c,x=_;x?v.enable(v.DEPTH_TEST):v.disable(v.DEPTH_TEST);for(var b,w,E=0,T=i;Ethis.previousZoom;n--)i.changeTimes[n]=t,i.changeOpacities[n]=i.opacities[n];for(n=0;n<256;n++){var o=t-i.changeTimes[n],a=255*(r?o/r:1);n<=e?i.opacities[n]=i.changeOpacities[n]+a:i.opacities[n]=i.changeOpacities[n]-a}this.changed=!0,this.previousZoom=e},i.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))},e.exports=i},{}],35:[function(t,e,r){"use strict";var i=t("../util/util"),n=function(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={}};n.prototype.setSprite=function(t){this.sprite=t},n.prototype.getDash=function(t,e){var r=t.join(",")+e;return this.positions[r]||(this.positions[r]=this.addDash(t,e)),this.positions[r]},n.prototype.addDash=function(t,e){var r=this,n=e?7:0,o=2*n+1,a=128;if(this.nextRow+o>this.height)return i.warnOnce("LineAtlas out of space"),null;for(var s=0,u=0;u0?e.pop():null},v.prototype.getViewportTexture=function(t,e){var r=this.reusableTextures.viewport;if(r)return r.width===t&&r.height===e?r:(this.gl.deleteTexture(r),void(this.reusableTextures.viewport=null))},v.prototype.lineWidth=function(t){this.gl.lineWidth(l.clamp(t,this.lineWidthRange[0],this.lineWidthRange[1]))},v.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 r=8,i=1/r;e.blendColor(i,i,i,0),e.clearColor(0,0,0,1),e.clear(e.COLOR_BUFFER_BIT)}else e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA)}},v.prototype.createProgram=function(t,e){var r=this.gl,n=r.createProgram(),o=m[t],a="#define MAPBOX_GL_JS\n#define DEVICE_PIXEL_RATIO "+i.devicePixelRatio.toFixed(1)+"\n";this._showOverdrawInspector&&(a+="#define OVERDRAW_INSPECTOR;\n");var s=r.createShader(r.FRAGMENT_SHADER);r.shaderSource(s,e.applyPragmas(a+m.prelude.fragmentSource+o.fragmentSource,"fragment")),r.compileShader(s),r.attachShader(n,s);var u=r.createShader(r.VERTEX_SHADER);r.shaderSource(u,e.applyPragmas(a+m.prelude.vertexSource+o.vertexSource,"vertex")),r.compileShader(u),r.attachShader(n,u),r.linkProgram(n);for(var l=r.getProgramParameter(n,r.ACTIVE_ATTRIBUTES),c={program:n,numAttributes:l},h=0;h>16,u>>16),n.uniform2f(r.u_pixel_coord_lower,65535&s,65535&u)}},{"../source/pixels_to_tile_units":46}],38:[function(t,e,r){"use strict";t("path");e.exports={prelude:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif\n\nfloat 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\n// The offset depends on how many pixels are between the world origin and 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 and the edge of the tile.\n// The glsl spec only guarantees 16 bits of 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:\nvec2 get_pattern_pos(const vec2 pixel_coord_upper, const vec2 pixel_coord_lower,\n const vec2 pattern_size, const float tile_units_to_pixels, const vec2 pos) {\n\n vec2 offset = mod(mod(mod(pixel_coord_upper, pattern_size) * 256.0, pattern_size) * 256.0 + pixel_coord_lower, pattern_size);\n return (tile_units_to_pixels * pos + offset) / pattern_size;\n}\n"},circle:{fragmentSource:"#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\n\nvarying vec2 v_extrude;\nvarying lowp float v_antialiasblur;\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize mediump float radius\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize lowp vec4 stroke_color\n #pragma mapbox: initialize mediump float stroke_width\n #pragma mapbox: initialize lowp float stroke_opacity\n\n float extrude_length = length(v_extrude);\n float antialiased_blur = -max(blur, v_antialiasblur);\n\n float opacity_t = smoothstep(0.0, antialiased_blur, extrude_length - 1.0);\n\n float color_t = stroke_width < 0.01 ? 0.0 : smoothstep(\n antialiased_blur,\n 0.0,\n extrude_length - radius / (radius + stroke_width)\n );\n\n gl_FragColor = opacity_t * mix(color * opacity, stroke_color * stroke_opacity, color_t);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform bool u_scale_with_map;\nuniform vec2 u_extrude_scale;\n\nattribute vec2 a_pos;\n\n#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\n\nvarying vec2 v_extrude;\nvarying lowp float v_antialiasblur;\n\nvoid main(void) {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize mediump float radius\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize lowp vec4 stroke_color\n #pragma mapbox: initialize mediump float stroke_width\n #pragma mapbox: initialize lowp float stroke_opacity\n\n // unencode the extrusion vector that we snuck into the a_pos vector\n v_extrude = vec2(mod(a_pos, 2.0) * 2.0 - 1.0);\n\n vec2 extrude = v_extrude * (radius + stroke_width) * u_extrude_scale;\n // multiply a_pos by 0.5, since we had it * 2 in order to sneak\n // in extrusion data\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5), 0, 1);\n\n if (u_scale_with_map) {\n gl_Position.xy += extrude;\n } else {\n gl_Position.xy += extrude * gl_Position.w;\n }\n\n // This is a minimum blur distance that serves as a faux-antialiasing for\n // the circle. since blur is a ratio of the circle's size and the intent is\n // to keep the blur at roughly 1px, the two are inversely related.\n v_antialiasblur = 1.0 / DEVICE_PIXEL_RATIO / (radius + stroke_width);\n}\n"},collisionBox:{fragmentSource:"uniform 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:"attribute 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"},debug:{fragmentSource:"uniform lowp vec4 u_color;\n\nvoid main() {\n gl_FragColor = u_color;\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, step(32767.0, a_pos.x), 1);\n}\n"},fill:{fragmentSource:"#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize lowp float opacity\n\n gl_FragColor = color * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\n#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n"},fillOutline:{fragmentSource:"#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:"attribute 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"},fillOutlinePattern:{fragmentSource:"uniform 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\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\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 // 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 * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_world;\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;\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, a_pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, a_pos);\n\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},fillPattern:{fragmentSource:"uniform 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\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\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) * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform 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\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, a_pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, a_pos);\n}\n"},fillExtrusion:{fragmentSource:"varying vec4 v_color;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 color\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n #pragma mapbox: initialize lowp vec4 color\n\n gl_FragColor = v_color;\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec3 u_lightcolor;\nuniform lowp vec3 u_lightpos;\nuniform lowp float u_lightintensity;\nuniform lowp vec4 u_outline_color;\n\nattribute vec2 a_pos;\nattribute vec3 a_normal;\nattribute float a_edgedistance;\n\nvarying vec4 v_color;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\n#pragma mapbox: define lowp vec4 color\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n #pragma mapbox: initialize lowp vec4 color\n\n float ed = a_edgedistance; // use each attrib in order to not trip a VAO assert\n float t = mod(a_normal.x, 2.0);\n\n gl_Position = u_matrix * vec4(a_pos, t > 0.0 ? height : base, 1);\n\n#ifdef OUTLINE\n color = u_outline_color;\n#endif\n\n // Relative luminance (how dark/bright is the surface color?)\n float colorvalue = color.r * 0.2126 + color.g * 0.7152 + color.b * 0.0722;\n\n v_color = vec4(0.0, 0.0, 0.0, 1.0);\n\n // Add slight ambient lighting so no extrusions are totally black\n vec4 ambientlight = vec4(0.03, 0.03, 0.03, 1.0);\n color += ambientlight;\n\n // Calculate cos(theta), where theta is the angle between surface normal and diffuse light ray\n float directional = clamp(dot(a_normal / 16384.0, u_lightpos), 0.0, 1.0);\n\n // Adjust directional so that\n // the range of values for highlight/shading is narrower\n // with lower light intensity\n // and with lighter/brighter surface colors\n directional = mix((1.0 - u_lightintensity), max((1.0 - colorvalue + u_lightintensity), 1.0), directional);\n\n // Add gradient along z axis of side surfaces\n if (a_normal.y != 0.0) {\n directional *= clamp((t + base) * pow(height / 150.0, 0.5), mix(0.7, 0.98, 1.0 - u_lightintensity), 1.0);\n }\n\n // Assign final color based on surface + ambient light color, diffuse light directional, and light color\n // with lower bounds adjusted to hue of light\n // so that shading is tinted with the complementary (opposite) color to the light color\n v_color.r += clamp(color.r * directional * u_lightcolor.r, mix(0.0, 0.3, 1.0 - u_lightcolor.r), 1.0);\n v_color.g += clamp(color.g * directional * u_lightcolor.g, mix(0.0, 0.3, 1.0 - u_lightcolor.g), 1.0);\n v_color.b += clamp(color.b * directional * u_lightcolor.b, mix(0.0, 0.3, 1.0 - u_lightcolor.b), 1.0);\n}\n"},fillExtrusionPattern:{fragmentSource:"uniform 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 vec4 v_lighting;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\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 vec4 mixedColor = mix(color1, color2, u_mix);\n\n gl_FragColor = mixedColor * v_lighting;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform 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;\nuniform float u_height_factor;\n\nuniform vec3 u_lightcolor;\nuniform lowp vec3 u_lightpos;\nuniform lowp float u_lightintensity;\n\nattribute vec2 a_pos;\nattribute vec3 a_normal;\nattribute float a_edgedistance;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec4 v_lighting;\nvarying float v_directional;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n\n float t = mod(a_normal.x, 2.0);\n float z = t > 0.0 ? height : base;\n\n gl_Position = u_matrix * vec4(a_pos, z, 1);\n\n vec2 pos = a_normal.x == 1.0 && a_normal.y == 0.0 && a_normal.z == 16384.0\n ? a_pos // extrusion top\n : vec2(a_edgedistance, z * u_height_factor); // extrusion side\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, pos);\n\n v_lighting = vec4(0.0, 0.0, 0.0, 1.0);\n float directional = clamp(dot(a_normal / 16383.0, u_lightpos), 0.0, 1.0);\n directional = mix((1.0 - u_lightintensity), max((0.5 + u_lightintensity), 1.0), directional);\n\n if (a_normal.y != 0.0) {\n directional *= clamp((t + base) * pow(height / 150.0, 0.5), mix(0.7, 0.98, 1.0 - u_lightintensity), 1.0);\n }\n\n v_lighting.rgb += clamp(directional * u_lightcolor, mix(vec3(0.0), vec3(0.3), 1.0 - u_lightcolor), vec3(1.0));\n}\n"},extrusionTexture:{fragmentSource:"uniform sampler2D u_texture;\nuniform float u_opacity;\n\nvarying vec2 v_pos;\n\nvoid main() {\n gl_FragColor = texture2D(u_texture, v_pos) * u_opacity;\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform int u_xdim;\nuniform int u_ydim;\nattribute vec2 a_pos;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n v_pos.x = a_pos.x / float(u_xdim);\n v_pos.y = 1.0 - a_pos.y / float(u_ydim);\n}\n"},line:{fragmentSource:"#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_width2;\nvarying vec2 v_normal;\nvarying float v_gamma_scale;\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\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\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform mediump float u_width;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump float gapwidth\n #pragma mapbox: initialize lowp float offset\n\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\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\n // these transformations used to be applied in the JS and native code bases. \n // moved them into the shader for clarity and simplicity. \n gapwidth = gapwidth / 2.0;\n float width = u_width / 2.0;\n offset = -1.0 * offset; \n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + width * (gapwidth > 0.0 ? 2.0 : 1.0) + 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 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit to get the position\n vec2 pos = floor(a_pos * 0.5);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_width2 = vec2(outset, inset);\n}\n"},linePattern:{fragmentSource:"uniform 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;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 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_width2.s / u_pattern_size_a.y);\n float y_b = 0.5 + (v_normal.y * v_width2.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 gl_FragColor = color * alpha * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"// 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\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 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_width;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n\nvoid main() {\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize lowp float offset\n #pragma mapbox: initialize mediump float gapwidth\n\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 // these transformations used to be applied in the JS and native code bases. \n // moved them into the shader for clarity and simplicity. \n gapwidth = gapwidth / 2.0;\n float width = u_width / 2.0;\n offset = -1.0 * offset; \n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + width * (gapwidth > 0.0 ? 2.0 : 1.0) + 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 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit to get the position\n vec2 pos = floor(a_pos * 0.5);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_linesofar = a_linesofar;\n v_width2 = vec2(outset, inset);\n}\n"},lineSDF:{fragmentSource:"\nuniform sampler2D u_image;\nuniform float u_sdfgamma;\nuniform float u_mix;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 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 = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n", +vertexSource:"// 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\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_patternscale_a;\nuniform float u_tex_y_a;\nuniform vec2 u_patternscale_b;\nuniform float u_tex_y_b;\nuniform vec2 u_gl_units_to_pixels;\nuniform mediump float u_width;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump float gapwidth\n #pragma mapbox: initialize lowp float offset\n\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 // these transformations used to be applied in the JS and native code bases. \n // moved them into the shader for clarity and simplicity. \n gapwidth = gapwidth / 2.0;\n float width = u_width / 2.0;\n offset = -1.0 * offset;\n \n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + width * (gapwidth > 0.0 ? 2.0 : 1.0) + 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 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit to get the position\n vec2 pos = floor(a_pos * 0.5);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\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 v_width2 = vec2(outset, inset);\n}\n"},raster:{fragmentSource:"uniform float u_fade_t;\nuniform float u_opacity;\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 = mix(color0, color1, u_fade_t);\n color.a *= u_opacity;\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, color.a);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform 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"},symbolIcon:{fragmentSource:"uniform 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:"attribute 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"},symbolSDF:{fragmentSource:"uniform 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:"const 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;\n\n v_tex = a_tex / u_texsize;\n v_fade_tex = vec2(a_labelminzoom / 255.0, 0.0);\n}\n"}}},{path:194}],39:[function(t,e,r){"use strict";var i=function(){this.boundProgram=null,this.boundVertexBuffer=null,this.boundVertexBuffer2=null,this.boundElementBuffer=null,this.boundVertexOffset=null,this.vao=null};i.prototype.bind=function(t,e,r,i,n,o){void 0===t.extVertexArrayObject&&(t.extVertexArrayObject=t.getExtension("OES_vertex_array_object"));var a=!this.vao||this.boundProgram!==e||this.boundVertexBuffer!==r||this.boundVertexBuffer2!==n||this.boundElementBuffer!==i||this.boundVertexOffset!==o;!t.extVertexArrayObject||a?(this.freshBind(t,e,r,i,n,o),this.gl=t):t.extVertexArrayObject.bindVertexArrayOES(this.vao)},i.prototype.freshBind=function(t,e,r,i,n,o){var a,s=e.numAttributes;if(t.extVertexArrayObject)this.vao&&this.destroy(),this.vao=t.extVertexArrayObject.createVertexArrayOES(),t.extVertexArrayObject.bindVertexArrayOES(this.vao),a=0,this.boundProgram=e,this.boundVertexBuffer=r,this.boundVertexBuffer2=n,this.boundElementBuffer=i,this.boundVertexOffset=o;else{a=t.currentNumAttributes||0;for(var u=s;uthis.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,n={type:this.type,uid:t.uid,coord:t.coord,zoom:t.coord.z,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,overscaling:i,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID=this.dispatcher.send("loadTile",n,function(i,n){if(t.unloadVectorData(),!t.aborted)return i?e(i):(t.loadVectorData(n,r.map.painter),t.redoWhenDone&&(t.redoWhenDone=!1,t.redoPlacement(r)),e(null))},this.workerID)},e.prototype.abortTile=function(t){t.aborted=!0},e.prototype.unloadTile=function(t){t.unloadVectorData(),this.dispatcher.send("removeTile",{uid:t.uid,type:this.type,source:this.id},function(){},t.workerID)},e.prototype.onRemove=function(){this.dispatcher.broadcast("removeSource",{type:this.type,source:this.id},function(){})},e.prototype.serialize=function(){return{type:this.type,data:this._data}},e}(n);e.exports=u},{"../data/extent":11,"../util/evented":118,"../util/util":129,"../util/window":112}],42:[function(t,e,r){"use strict";var i=t("../util/ajax"),n=t("geojson-rewind"),o=t("./geojson_wrapper"),a=t("vt-pbf"),s=t("supercluster"),u=t("geojson-vt"),l=t("./vector_tile_worker_source"),c=function(t){function e(e,r,i){t.call(this,e,r),i&&(this.loadGeoJSON=i),this._geoJSONIndexes={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.loadVectorData=function(t,e){var r=t.source,i=t.coord;if(!this._geoJSONIndexes[r])return e(null,null);var n=this._geoJSONIndexes[r].getTile(Math.min(i.z,t.maxZoom),i.x,i.y);if(!n)return e(null,null);var s=new o(n.features);s.name="_geojsonTileLayer";var u=a({layers:{_geojsonTileLayer:s}});0===u.byteOffset&&u.byteLength===u.buffer.byteLength||(u=new Uint8Array(u)),s.rawData=u.buffer,e(null,s)},e.prototype.loadData=function(t,e){var r=function(r,i){var o=this;return r?e(r):"object"!=typeof i?e(new Error("Input data is not a valid GeoJSON object.")):(n(i,!0),void this._indexData(i,t,function(r,i){return r?e(r):(o._geoJSONIndexes[t.source]=i,void e(null))}))}.bind(this);this.loadGeoJSON(t,r)},e.prototype.loadGeoJSON=function(t,e){if(t.url)i.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."))}}},e.prototype.removeSource=function(t){this._geoJSONIndexes[t.source]&&delete this._geoJSONIndexes[t.source]},e.prototype._indexData=function(t,e,r){try{e.cluster?r(null,s(e.superclusterOptions).load(t.features)):r(null,u(t,e.geojsonVtOptions))}catch(t){return r(t)}},e}(l);e.exports=c},{"../util/ajax":109,"./geojson_wrapper":43,"./vector_tile_worker_source":55,"geojson-rewind":140,"geojson-vt":144,supercluster:201,"vt-pbf":210}],43:[function(t,e,r){"use strict";var i=t("point-geometry"),n=t("vector-tile").VectorTileFeature,o=t("../data/extent"),a=function(t){var e=this;if(this.type=t.type,1===t.type){this.rawGeometry=[];for(var r=0;re)){var s=Math.pow(2,Math.min(a.coord.z,i._source.maxzoom)-Math.min(t.z,i._source.maxzoom));if(Math.floor(a.coord.x/s)===t.x&&Math.floor(a.coord.y/s)===t.y)for(r[o]=!0,n=!0;a&&a.coord.z-1>t.z;){var u=a.coord.parent(i._source.maxzoom).id;a=i._tiles[u],a&&a.hasData()&&(delete r[o],r[u]=!0)}}}return n},e.prototype.findLoadedParent=function(t,e,r){for(var i=this,n=t.z-1;n>=e;n--){t=t.parent(i._source.maxzoom);var o=i._tiles[t.id];if(o&&o.hasData())return r[t.id]=!0,o;if(i._cache.has(t.id))return r[t.id]=!0, +i._cache.get(t.id)}},e.prototype.updateCacheSize=function(t){var e=Math.ceil(t.width/t.tileSize)+1,r=Math.ceil(t.height/t.tileSize)+1,i=e*r,n=5;this._cache.setMaxSize(Math.floor(i*n))},e.prototype.update=function(t){var r=this;if(this._sourceLoaded){var i,n,a,s;this.updateCacheSize(t);var u=(this._source.roundZoom?Math.round:Math.floor)(this.getZoom(t)),c=Math.max(u-e.maxOverzooming,this._source.minzoom),h=Math.max(u+e.maxUnderzooming,this._source.minzoom),f={};this._coveredTiles={};var d;for(d=this.used?this._source.coord?[this._source.coord]:t.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}):[],i=0;i=Date.now())&&(r.findLoadedChildren(n,h,f)&&(f[g]=!0),s=r.findLoadedParent(n,c,m),s&&r.addTile(s.coord))}var _;for(_ in m)f[_]||(r._coveredTiles[_]=!0);for(_ in m)f[_]=!0;var x=p.keysDifference(this._tiles,f);for(i=0;ithis._source.maxzoom?Math.pow(2,i-this._source.maxzoom):1;e=new s(r,this._source.tileSize*n,this._source.maxzoom),this.loadTile(e,this._tileLoaded.bind(this,e,t.id))}return e.uses++,this._tiles[t.id]=e,this._source.fire("dataloading",{tile:e,coord:e.coord,dataType:"tile"}),e},e.prototype._setTileReloadTimer=function(t,e){var r=this,i=e.getExpiry();i&&(this._timers[t]=setTimeout(function(){r.reloadTile(t,"expired"),r._timers[t]=void 0},i-(new Date).getTime()))},e.prototype._setCacheInvalidationTimer=function(t,e){var r=this,i=e.getExpiry();i&&(this._cacheTimers[t]=setTimeout(function(){r._cache.remove(t),r._cacheTimers[t]=void 0},i-(new Date).getTime()))},e.prototype.removeTile=function(t){var e=this._tiles[t];if(e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),this._timers[t]=void 0),this._source.fire("data",{tile:e,coord:e.coord,dataType:"tile"}),!(e.uses>0)))if(e.hasData()){var r=e.coord.wrapped().id;this._cache.add(r,e),this._setCacheInvalidationTimer(r,e)}else e.aborted=!0,this.abortTile(e),this.unloadTile(e)},e.prototype.clearTiles=function(){var t=this;for(var e in this._tiles)t.removeTile(e);this._cache.reset()},e.prototype.tilesIn=function(t){for(var e=this,r={},n=this.getIds(),o=1/0,a=1/0,s=-(1/0),u=-(1/0),c=t[0].zoom,p=0;p=0&&g[1].y>=0){for(var _=[],x=0;xe.row){var r=t;t=e,e=r}return{x0:t.column,y0:t.row,x1:e.column,y1:e.row,dx:e.column-t.column,dy:e.row-t.row}}function n(t,e,r,i,n){var o=Math.max(r,Math.floor(e.y0)),a=Math.min(i,Math.ceil(e.y1));if(t.x0===e.x0&&t.y0===e.y0?t.x0+e.dy/t.dy*t.dx0,h=e.dx<0,p=o;pc.dy&&(u=l,l=c,c=u),l.dy>h.dy&&(u=l,l=h,h=u),c.dy>h.dy&&(u=c,c=h,h=u),l.dy&&n(h,l,o,a,s),c.dy&&n(h,c,o,a,s)}function a(t,e,r){for(var i,n="",o=t;o>0;o--)i=1<t?new l(this.z-1,this.x,this.y,this.w):new l(this.z-1,Math.floor(this.x/2),Math.floor(this.y/2),this.w)},l.prototype.wrapped=function(){return new l(this.z,this.x,this.y,0)},l.prototype.children=function(t){if(this.z>=t)return[new l(this.z+1,this.x,this.y,this.w)];var e=this.z+1,r=2*this.x,i=2*this.y;return[new l(e,r,i,this.w),new l(e,r+1,i,this.w),new l(e,r,i+1,this.w),new l(e,r+1,i+1,this.w)]},l.cover=function(t,e,r,i){function n(t,e,n){var o,u,c,h;if(n>=0&&n<=a)for(o=t;othis.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,n={url:a(t.coord.url(this.tiles,this.maxzoom,this.scheme),this.url),uid:t.uid,coord:t.coord,zoom:t.coord.z,tileSize:this.tileSize*i,type:this.type,source:this.id,overscaling:i,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID&&"expired"!==t.state?"loading"===t.state?t.reloadCallback=e:this.dispatcher.send("reloadTile",n,r.bind(this),t.workerID):t.workerID=this.dispatcher.send("loadTile",n,r.bind(this))},e.prototype.abortTile=function(t){this.dispatcher.send("abortTile",{uid:t.uid,type:this.type,source:this.id},null,t.workerID)},e.prototype.unloadTile=function(t){t.unloadVectorData(),this.dispatcher.send("removeTile",{uid:t.uid,type:this.type,source:this.id},null,t.workerID)},e}(i);e.exports=s},{"../util/evented":118,"../util/mapbox":125,"../util/util":129,"./load_tilejson":45}],55:[function(t,e,r){"use strict";var i=t("../util/ajax"),n=t("vector-tile"),o=t("pbf"),a=t("./worker_tile"),s=t("../util/util"),u=function(t,e,r){this.actor=t,this.layerIndex=e,r&&(this.loadVectorData=r),this.loading={},this.loaded={}};u.prototype.loadTile=function(t,e){function r(t,r){return delete this.loading[i][n],t?e(t):r?(o.vectorTile=r,o.parse(r,this.layerIndex,this.actor,function(t,i,n){if(t)return e(t);var o={};r.expires&&(o.expires=r.expires),r.cacheControl&&(o.cacheControl=r.cacheControl),e(null,s.extend({rawTileData:r.rawData},i,o),n)}),this.loaded[i]=this.loaded[i]||{},void(this.loaded[i][n]=o)):e(null,null)}var i=t.source,n=t.uid;this.loading[i]||(this.loading[i]={});var o=this.loading[i][n]=new a(t);o.abort=this.loadVectorData(t,r.bind(this))},u.prototype.reloadTile=function(t,e){function r(t,r){if(this.reloadCallback){var i=this.reloadCallback;delete this.reloadCallback,this.parse(this.vectorTile,o.layerIndex,o.actor,i)}e(t,r)}var i=this.loaded[t.source],n=t.uid,o=this;if(i&&i[n]){var a=i[n];"parsing"===a.status?a.reloadCallback=e:"done"===a.status&&a.parse(a.vectorTile,this.layerIndex,this.actor,r.bind(a))}},u.prototype.abortTile=function(t){var e=this.loading[t.source],r=t.uid;e&&e[r]&&e[r].abort&&(e[r].abort(),delete e[r])},u.prototype.removeTile=function(t){var e=this.loaded[t.source],r=t.uid;e&&e[r]&&delete e[r]},u.prototype.loadVectorData=function(t,e){function r(t,r){if(t)return e(t);var i=new n.VectorTile(new o(r.data));i.rawData=r.data,i.cacheControl=r.cacheControl,i.expires=r.expires,e(t,i)}var a=i.getArrayBuffer(t.url,r.bind(this));return function(){a.abort()}},u.prototype.redoPlacement=function(t,e){var r=this.loaded[t.source],i=this.loading[t.source],n=t.uid;if(r&&r[n]){var o=r[n],a=o.redoPlacement(t.angle,t.pitch,t.showCollisionBoxes);a.result&&e(null,a.result,a.transferables)}else i&&i[n]&&(i[n].angle=t.angle)},e.exports=u},{"../util/ajax":109,"../util/util":129,"./worker_tile":58,pbf:196,"vector-tile":206}],56:[function(t,e,r){"use strict";var i=t("../util/ajax"),n=t("./image_source"),o=function(t){function e(e,r,i,n){t.call(this,e,r,i,n),this.roundZoom=!0,this.type="video",this.options=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(){var t=this,e=this.options;this.urls=e.urls,i.getVideo(e.urls,function(e,r){if(e)return t.fire("error",{error:e});t.video=r,t.video.loop=!0;var i;t.video.addEventListener("playing",function(){i=t.map.style.animationLoop.set(1/0),t.map._rerender()}),t.video.addEventListener("pause",function(){t.map.style.animationLoop.cancel(i)}),t.map&&t.video.play(),t._finishLoading()})},e.prototype.getVideo=function(){return this.video},e.prototype.onAdd=function(t){this.map||(this.load(),this.map=t,this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},e.prototype.prepare=function(){!this.tile||this.video.readyState<2||this._prepareImage(this.map.painter.gl,this.video)},e.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},e}(n);e.exports=o},{"../util/ajax":109,"./image_source":44}],57:[function(t,e,r){"use strict";var i=t("../util/actor"),n=t("../style/style_layer_index"),o=t("./vector_tile_worker_source"),a=t("./geojson_worker_source"),s=t("./rtl_text_plugin"),u=function(t){var e=this;this.self=t,this.actor=new i(t,this),this.layerIndexes={},this.workerSourceTypes={vector:o,geojson:a},this.workerSources={},this.self.registerWorkerSource=function(t,r){if(e.workerSourceTypes[t])throw new Error('Worker source with name "'+t+'" already registered.');e.workerSourceTypes[t]=r},this.self.registerRTLTextPlugin=function(t){if(s.applyArabicShaping||s.processBidirectionalText)throw new Error("RTL text plugin already registered.");s.applyArabicShaping=t.applyArabicShaping,s.processBidirectionalText=t.processBidirectionalText}};u.prototype.setLayers=function(t,e){this.getLayerIndex(t).replace(e)},u.prototype.updateLayers=function(t,e){this.getLayerIndex(t).update(e.layers,e.removedIds,e.symbolOrder)},u.prototype.loadTile=function(t,e,r){this.getWorkerSource(t,e.type).loadTile(e,r)},u.prototype.reloadTile=function(t,e,r){this.getWorkerSource(t,e.type).reloadTile(e,r)},u.prototype.abortTile=function(t,e){this.getWorkerSource(t,e.type).abortTile(e)},u.prototype.removeTile=function(t,e){this.getWorkerSource(t,e.type).removeTile(e)},u.prototype.removeSource=function(t,e){var r=this.getWorkerSource(t,e.type);void 0!==r.removeSource&&r.removeSource(e)},u.prototype.redoPlacement=function(t,e,r){this.getWorkerSource(t,e.type).redoPlacement(e,r)},u.prototype.loadWorkerSource=function(t,e,r){try{this.self.importScripts(e.url),r()}catch(t){r(t)}},u.prototype.loadRTLTextPlugin=function(t,e,r){try{s.applyArabicShaping||s.processBidirectionalText||this.self.importScripts(e)}catch(t){r(t)}},u.prototype.getLayerIndex=function(t){var e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new n),e},u.prototype.getWorkerSource=function(t,e){var r=this;if(this.workerSources[t]||(this.workerSources[t]={}),!this.workerSources[t][e]){var i={send:function(e,i,n,o){r.actor.send(e,i,n,o,t)}};this.workerSources[t][e]=new this.workerSourceTypes[e](i,this.getLayerIndex(t))}return this.workerSources[t][e]},e.exports=function(t){return new u(t)}},{"../style/style_layer_index":71,"../util/actor":108,"./geojson_worker_source":42,"./rtl_text_plugin":49,"./vector_tile_worker_source":55}],58:[function(t,e,r){"use strict";function i(t,e){for(var r=0,i=t.layers;r=P.maxzoom||P.layout&&"none"===P.layout.visibility)){for(var L=0,I=M;L=0;D--){var O=y[e.symbolOrder[D]];O&&f.symbolBuckets.push(O)}if(0===this.symbolBuckets.length)return R(new a(this.angle,this.pitch,this.collisionBoxArray));var B=0,j=Object.keys(g.iconDependencies),F=l.mapObject(g.glyphDependencies,function(t){return Object.keys(t).map(Number)}),U=function(t){if(t)return p(t);if(B++,2===B){for(var e=new a(f.angle,f.pitch,f.collisionBoxArray),r=0,n=f.symbolBuckets;r=(new Date).getTime()}),!this.times.length},i.prototype.set=function(t){return this.times.push({id:this.n,time:t+(new Date).getTime()}),this.n++},i.prototype.cancel=function(t){this.times=this.times.filter(function(e){return e.id!==t})},e.exports=i},{}],60:[function(t,e,r){"use strict";var i=t("../util/evented"),n=t("../util/ajax"),o=t("../util/browser"),a=t("../util/mapbox").normalizeSpriteURL,s=function(){this.x=0,this.y=0,this.width=0,this.height=0,this.pixelRatio=1,this.sdf=!1},u=function(t){function e(e,r){var i=this;t.call(this),this.base=e,this.retina=o.devicePixelRatio>1,this.setEventedParent(r);var s=this.retina?"@2x":"";n.getJSON(a(e,s,".json"),function(t,e){return t?void i.fire("error",{error:t}):(i.data=e,void(i.imgData&&i.fire("data",{dataType:"style"})))}),n.getImage(a(e,s,".png"),function(t,e){if(t)return void i.fire("error",{error:t});i.imgData=o.getImageData(e);for(var r=0;r1!==this.retina){var r=new e(this.base);r.on("data",function(){t.data=r.data,t.imgData=r.imgData,t.width=r.width,t.retina=r.retina})}},e.prototype.getSpritePosition=function(t){if(!this.loaded())return new s;var e=this.data&&this.data[t];return e&&this.imgData?e:new s},e}(i);e.exports=u},{"../util/ajax":109,"../util/browser":110,"../util/evented":118,"../util/mapbox":125}],61:[function(t,e,r){"use strict";var i=t("./style_spec"),n=t("../util/util"),o=t("../util/evented"),a=t("./validate_style"),s=t("./style_declaration"),u=t("./style_transition"),l="-transition",c=function(t){function e(e){t.call(this),this.properties=["anchor","color","position","intensity"],this._specifications=i.light,this.set(e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){var e=this;if(!this._validate(a.light,t)){this._declarations={},this._transitions={},this._transitionOptions={},this.calculated={},t=n.extend({anchor:this._specifications.anchor.default,color:this._specifications.color.default,position:this._specifications.position.default,intensity:this._specifications.intensity.default},t);for(var r=0,i=this.properties;rMath.floor(t)&&(e.lastIntegerZoom=Math.floor(t+1),e.lastIntegerZoomTime=Date.now()),e.lastZoom=t},e.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},e.prototype.update=function(t,e){var r=this;if(this._changed){var i=Object.keys(this._updatedLayers),n=Object.keys(this._removedLayers);(i.length||n.length||this._updatedSymbolOrder)&&this._updateWorkerLayers(i,n);for(var o in this._updatedSources){var a=r._updatedSources[o];"reload"===a?r._reloadSource(o):"clear"===a&&r._clearSource(o)}this._applyClasses(t,e),this._resetUpdates(),this.fire("data",{dataType:"style"})}},e.prototype._updateWorkerLayers=function(t,e){var r=this,i=this._updatedSymbolOrder?this._order.filter(function(t){return"symbol"===r._layers[t].type}):null;this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(t),removedIds:e,symbolOrder:i})},e.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSymbolOrder=!1,this._updatedSources={},this._updatedPaintProps={}, +this._updatedAllPaintProps=!1},e.prototype.setState=function(t){var e=this;if(this._checkLoaded(),y.emitErrors(this,y(t)))return!1;t=c.extend({},t),t.layers=E(t.layers);var r=T(this.serialize(),t).filter(function(t){return!(t.command in A)});if(0===r.length)return!1;var i=r.filter(function(t){return!(t.command in z)});if(i.length>0)throw new Error("Unimplemented: "+i.map(function(t){return t.command}).join(", ")+".");return r.forEach(function(t){"setTransition"!==t.command&&e[t.command].apply(e,t.args)}),this.stylesheet=t,!0},e.prototype.addSource=function(t,e,r){if(this._checkLoaded(),void 0!==this.sourceCaches[t])throw new Error("There is already a source with this ID");if(!e.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(e)+".");var i=["vector","raster","geojson","video","image","canvas"],n=i.indexOf(e.type)>=0;if(!n||!this._validate(y.source,"sources."+t,e,null,r)){var o=this.sourceCaches[t]=new _(t,e,this.dispatcher);o.style=this,o.setEventedParent(this,function(){return{isSourceLoaded:o.loaded(),source:o.serialize(),sourceId:t}}),o.onAdd(this.map),this._changed=!0}},e.prototype.removeSource=function(t){if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error("There is no source with this ID");var e=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],e.setEventedParent(null),e.clearTiles(),e.onRemove&&e.onRemove(this.map),this._changed=!0},e.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},e.prototype.addLayer=function(t,e,r){this._checkLoaded();var i=t.id;if("object"==typeof t.source&&(this.addSource(i,t.source),t=c.extend(t,{source:i})),!this._validate(y.layer,"layers."+i,t,{arrayIndex:-1},r)){var o=n.create(t);this._validateLayer(o),o.setEventedParent(this,{layer:{id:i}});var a=e?this._order.indexOf(e):this._order.length;if(this._order.splice(a,0,i),this._layers[i]=o,this._removedLayers[i]&&o.source){var s=this._removedLayers[i];delete this._removedLayers[i],this._updatedSources[o.source]=s.type!==o.type?"clear":"reload"}this._updateLayer(o),"symbol"===o.type&&(this._updatedSymbolOrder=!0),this.updateClasses(i)}},e.prototype.moveLayer=function(t,e){this._checkLoaded(),this._changed=!0;var r=this._layers[t];if(!r)return void this.fire("error",{error:new Error("The layer '"+t+"' does not exist in the map's style and cannot be moved.")});var i=this._order.indexOf(t);this._order.splice(i,1);var n=e?this._order.indexOf(e):this._order.length;this._order.splice(n,0,t),"symbol"===r.type&&(this._updatedSymbolOrder=!0,r.source&&!this._updatedSources[r.source]&&(this._updatedSources[r.source]="reload"))},e.prototype.removeLayer=function(t){this._checkLoaded();var e=this._layers[t];if(!e)return void this.fire("error",{error:new Error("The layer '"+t+"' does not exist in the map's style and cannot be removed.")});e.setEventedParent(null);var r=this._order.indexOf(t);this._order.splice(r,1),"symbol"===e.type&&(this._updatedSymbolOrder=!0),this._changed=!0,this._removedLayers[t]=e,delete this._layers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t]},e.prototype.getLayer=function(t){return this._layers[t]},e.prototype.setLayerZoomRange=function(t,e,r){this._checkLoaded();var i=this.getLayer(t);return i?void(i.minzoom===e&&i.maxzoom===r||(null!=e&&(i.minzoom=e),null!=r&&(i.maxzoom=r),this._updateLayer(i))):void this.fire("error",{error:new Error("The layer '"+t+"' does not exist in the map's style and cannot have zoom extent.")})},e.prototype.setFilter=function(t,e){this._checkLoaded();var r=this.getLayer(t);return r?void(null!==e&&void 0!==e&&this._validate(y.filter,"layers."+r.id+".filter",e)||c.deepEqual(r.filter,e)||(r.filter=c.clone(e),this._updateLayer(r))):void this.fire("error",{error:new Error("The layer '"+t+"' does not exist in the map's style and cannot be filtered.")})},e.prototype.getFilter=function(t){return c.clone(this.getLayer(t).filter)},e.prototype.setLayoutProperty=function(t,e,r){this._checkLoaded();var i=this.getLayer(t);return i?void(c.deepEqual(i.getLayoutProperty(e),r)||(i.setLayoutProperty(e,r),this._updateLayer(i))):void this.fire("error",{error:new Error("The layer '"+t+"' does not exist in the map's style and cannot be styled.")})},e.prototype.getLayoutProperty=function(t,e){return this.getLayer(t).getLayoutProperty(e)},e.prototype.setPaintProperty=function(t,e,r,i){this._checkLoaded();var n=this.getLayer(t);if(!n)return void this.fire("error",{error:new Error("The layer '"+t+"' does not exist in the map's style and cannot be styled.")});if(!c.deepEqual(n.getPaintProperty(e,i),r)){var o=n.isPaintValueFeatureConstant(e);n.setPaintProperty(e,r,i);var a=!(r&&b.isFunctionDefinition(r)&&"$zoom"!==r.property&&void 0!==r.property);a&&o||this._updateLayer(n),this.updateClasses(t,e)}},e.prototype.getPaintProperty=function(t,e,r){return this.getLayer(t).getPaintProperty(e,r)},e.prototype.getTransition=function(){return c.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},e.prototype.updateClasses=function(t,e){if(this._changed=!0,t){var r=this._updatedPaintProps;r[t]||(r[t]={}),r[t][e||"all"]=!0}else this._updatedAllPaintProps=!0},e.prototype.serialize=function(){var t=this;return c.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,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.sourceCaches,function(t){return t.serialize()}),layers:this._order.map(function(e){return t._layers[e].serialize()})},function(t){return void 0!==t})},e.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&(this._updatedSources[t.source]="reload"),this._changed=!0},e.prototype._flattenRenderedFeatures=function(t){for(var e=this,r=[],i=this._order.length-1;i>=0;i--)for(var n=e._order[i],o=0,a=t;o=this.maxzoom)||"none"===this.layout.visibility},e.prototype.updatePaintTransitions=function(t,e,r,i,o){for(var a=this,s=n.extend({},this._paintDeclarations[""]),u=0;u=this.endTime)return i;var o=this.oldTransition.calculate(t,e,this.startTime),a=n.easeCubicInOut((r-this.startTime-this.delay)/this.duration);return this.interp(o,i,a)},s.prototype._calculateTargetValue=function(t,e){if(!this.zoomTransitioned)return this.declaration.calculate(t,e);var r=t.zoom,i=this.zoomHistory.lastIntegerZoom,n=r>i?2:.5,a=this.declaration.calculate({zoom:r>i?r-1:r+1},e),s=this.declaration.calculate({zoom:r},e),u=Math.min((Date.now()-this.zoomHistory.lastIntegerZoomTime)/this.duration,1),l=Math.abs(r-i),c=o(u,1,l);return void 0!==a&&void 0!==s?{from:a,fromScale:n,to:s,toScale:1,t:c}:void 0},e.exports=s},{"../util/interpolate":121,"../util/util":129}],74:[function(t,e,r){"use strict";e.exports=t("mapbox-gl-style-spec/lib/validate_style.min"),e.exports.emitErrors=function(t,e){if(e&&e.length){for(var r=0;r-r/2;){if(a--,a<0)return!1;s-=t[a].dist(o),o=t[a]}s+=t[a].dist(t[a+1]),a++;for(var u=[],l=0;si;)l-=u.shift().angleDelta;if(l>n)return!1;a++,s+=h.dist(p)}return!0}e.exports=i},{}],77:[function(t,e,r){"use strict";function i(t,e,r,i,o){for(var a=[],s=0;s=i&&p.x>=i||(h.x>=i?h=new n(i,h.y+(p.y-h.y)*((i-h.x)/(p.x-h.x)))._round():p.x>=i&&(p=new n(i,h.y+(p.y-h.y)*((i-h.x)/(p.x-h.x)))._round()),h.y>=o&&p.y>=o||(h.y>=o?h=new n(h.x+(p.x-h.x)*((o-h.y)/(p.y-h.y)),o)._round():p.y>=o&&(p=new n(h.x+(p.x-h.x)*((o-h.y)/(p.y-h.y)),o)._round()),u&&h.equals(u[u.length-1])||(u=[h],a.push(u)),u.push(p)))))}return a}var n=t("point-geometry");e.exports=i},{"point-geometry":197}],78:[function(t,e,r){"use strict";var i=t("../util/struct_array"),n=t("point-geometry"),o=i({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"}]});Object.defineProperty(o.prototype.StructType.prototype,"anchorPoint",{get:function(){return new n(this.anchorPointX,this.anchorPointY)}}),e.exports=o},{"../util/struct_array":127,"point-geometry":197}],79:[function(t,e,r){"use strict";var i=function(t,e,r,i,n,o,a,s,u,l,c){var h=a.top*s-u,p=a.bottom*s+u,f=a.left*s-u,d=a.right*s+u;if(this.boxStartIndex=t.length,l){var m=p-h,y=d-f;if(m>0)if(m=Math.max(10*s,m),c){var v=e[r.segment+1].sub(e[r.segment])._unit()._mult(y),g=[r.sub(v),r.add(v)];this._addLineCollisionBoxes(t,g,r,0,y,m,i,n,o)}else this._addLineCollisionBoxes(t,e,r,r.segment,y,m,i,n,o)}else t.emplaceBack(r.x,r.y,f,h,d,p,1/0,i,n,o,0,0,0,0,0);this.boxEndIndex=t.length};i.prototype._addLineCollisionBoxes=function(t,e,r,i,n,o,a,s,u){var l=o/2,c=Math.floor(n/l),h=-o/2,p=this.boxes,f=r,d=i+1,m=h;do{if(d--,d<0)return p;m-=e[d].dist(f),f=e[d]}while(m>-n/2);for(var y=e[d].dist(e[d+1]),v=0;v=e.length)return p;y=e[d].dist(e[d+1])}var _=g-m,x=e[d],b=e[d+1],w=b.sub(x)._unit()._mult(_)._add(x)._round(),E=Math.max(Math.abs(g-h)-l/2,0),T=n/2/E;t.emplaceBack(w.x,w.y,-o/2,-o/2,o/2,o/2,T,a,s,u,0,0,0,0,0)}return p},e.exports=i},{}],80:[function(t,e,r){"use strict";var i=t("point-geometry"),n=t("../data/extent"),o=t("grid-index"),a=t("../util/intersection_tests"),s=function(t,e,r){if("object"==typeof t){var i=t;r=e,t=i.angle,e=i.pitch,this.grid=new o(i.grid),this.ignoredGrid=new o(i.ignoredGrid)}else this.grid=new o(n,12,6),this.ignoredGrid=new o(n,12,0);this.minScale=.5,this.maxScale=2,this.angle=t,this.pitch=e;var a=Math.sin(t),s=Math.cos(t);if(this.rotationMatrix=[s,-a,a,s],this.reverseRotationMatrix=[s,a,-a,s],this.yStretch=1/Math.cos(e/180*Math.PI),this.yStretch=Math.pow(this.yStretch,1.3),this.collisionBoxArray=r,0===r.length){r.emplaceBack();var u=32767;r.emplaceBack(0,0,0,-u,0,u,u,0,0,0,0,0,0,0,0,0),r.emplaceBack(n,0,0,-u,0,u,u,0,0,0,0,0,0,0,0,0),r.emplaceBack(0,0,-u,0,u,0,u,0,0,0,0,0,0,0,0,0),r.emplaceBack(0,n,-u,0,u,0,u,0,0,0,0,0,0,0,0,0)}this.tempCollisionBox=r.get(0),this.edges=[r.get(1),r.get(2),r.get(3),r.get(4)]};s.prototype.serialize=function(t){var e=this.grid.toArrayBuffer(),r=this.ignoredGrid.toArrayBuffer();return t&&(t.push(e),t.push(r)),{angle:this.angle,pitch:this.pitch,grid:e,ignoredGrid:r}},s.prototype.placeCollisionFeature=function(t,e,r){for(var n=this,o=this.collisionBoxArray,a=this.minScale,s=this.rotationMatrix,u=this.yStretch,l=t.boxStartIndex;l=n.maxScale)return a}if(r){var w;if(n.angle){var E=n.reverseRotationMatrix,T=new i(c.x1,c.y1).matMult(E),S=new i(c.x2,c.y1).matMult(E),z=new i(c.x1,c.y2).matMult(E),A=new i(c.x2,c.y2).matMult(E);w=n.tempCollisionBox,w.anchorPointX=c.anchorPoint.x,w.anchorPointY=c.anchorPoint.y,w.x1=Math.min(T.x,S.x,z.x,A.x),w.y1=Math.min(T.y,S.x,z.x,A.x),w.x2=Math.max(T.x,S.x,z.x,A.x),w.y2=Math.max(T.y,S.x,z.x,A.x),w.maxScale=c.maxScale}else w=c;for(var M=0;M=n.maxScale)return a}}}return a},s.prototype.queryRenderedSymbols=function(t,e){var r={},n=[];if(0===t.length||0===this.grid.length&&0===this.ignoredGrid.length)return n;for(var o=this.collisionBoxArray,s=this.rotationMatrix,u=this.yStretch,l=[],c=1/0,h=1/0,p=-(1/0),f=-(1/0),d=0;dE.maxScale)){var z=E.anchorPoint.matMult(s),A=z.x+E.x1/e,M=z.y+E.y1/e*u,P=z.x+E.x2/e,L=z.y+E.y2/e*u,I=[new i(A,M),new i(P,M),new i(P,L),new i(A,L)];a.polygonIntersectsPolygon(l,I)&&(r[T][S]=!0,n.push(g[w]))}}return n},s.prototype.getPlacementScale=function(t,e,r,i,n){var o=e.x-i.x,a=e.y-i.y,s=(n.x1-r.x2)/o,u=(n.x2-r.x1)/o,l=(n.y1-r.y2)*this.yStretch/a,c=(n.y2-r.y1)*this.yStretch/a;(isNaN(s)||isNaN(u))&&(s=u=1),(isNaN(l)||isNaN(c))&&(l=c=1);var h=Math.min(Math.max(s,u),Math.max(l,c)),p=n.maxScale,f=r.maxScale;return h>p&&(h=p),h>f&&(h=f),h>t&&h>=n.placementScale&&(t=h),t},s.prototype.insertCollisionFeature=function(t,e,r){for(var i=this,n=r?this.ignoredGrid:this.grid,o=this.collisionBoxArray,a=t.boxStartIndex;a=0&&S=0&&z=0&&v+f<=d){var A=new a(S,z,E,_)._round();i&&!s(t,A,l,i,u)||g.push(A)}}y+=w}return h||g.length||c||(g=n(t,y/2,r,i,u,l,c,!0,p)),g}var o=t("../util/interpolate"),a=t("../symbol/anchor"),s=t("./check_max_angle");e.exports=i},{"../symbol/anchor":75,"../util/interpolate":121,"./check_max_angle":76}],82:[function(t,e,r){"use strict";var i=t("shelf-pack"),n=t("../util/util"),o=4,a=128,s=2048,u=function(){ +this.width=a,this.height=a,this.bin=new i(this.width,this.height),this.index={},this.ids={},this.data=new Uint8Array(this.width*this.height)};u.prototype.getGlyphs=function(){var t,e,r,i={};for(var n in this.ids)t=n.split("#"),e=t[0],r=t[1],i[e]||(i[e]=[]),i[e].push(r);return i},u.prototype.getRects=function(){var t,e,r,i=this,n={};for(var o in this.ids)t=o.split("#"),e=t[0],r=t[1],n[e]||(n[e]={}),n[e][r]=i.index[o];return n},u.prototype.addGlyph=function(t,e,r,i){var o=this;if(!r)return null;var a=e+"#"+r.id;if(this.index[a])return this.ids[a].indexOf(t)<0&&this.ids[a].push(t),this.index[a];if(!r.bitmap)return null;var s=r.width+2*i,u=r.height+2*i,l=1,c=s+2*l,h=u+2*l;c+=4-c%4,h+=4-h%4;var p=this.bin.packOne(c,h);if(p||(this.resize(),p=this.bin.packOne(c,h)),!p)return n.warnOnce("glyph bitmap overflow"),null;this.index[a]=p,this.ids[a]=[t];for(var f=this.data,d=r.bitmap,m=0;m=s||r>=s)){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 i=new ArrayBuffer(this.width*this.height),n=0;n65535)return r("glyphs > 65535 not supported");void 0===this.loading[t]&&(this.loading[t]={});var n=this.loading[t];if(n[e])n[e].push(r);else{n[e]=[r];var a=256*e+"-"+(256*e+255),u=i(t,a,this.url);o.getArrayBuffer(u,function(t,r){for(var i=!t&&new s(new l(r.data)),o=0;o1?2:1,this.canvas&&(this.canvas.width=this.width*this.pixelRatio,this.canvas.height=this.height*this.pixelRatio)),this.sprite=t},u.prototype.addIcons=function(t,e){for(var r=this,i=0;i1||(E?(clearTimeout(E),E=null,v("dblclick",e)):E=setTimeout(f,300))}function c(t){g("touchmove",t)}function h(t){g("touchend",t)}function p(t){g("touchcancel",t)}function f(){E=null}function d(t){var e=i.mousePos(_,t);e.equals(w)&&v("click",t)}function m(t){v("dblclick",t),t.preventDefault()}function y(e){var r=t.dragRotate&&t.dragRotate.isActive();b||r?b&&(x=e):v("contextmenu",e),e.preventDefault()}function v(e,r){var n=i.mousePos(_,r);return t.fire(e,{lngLat:t.unproject(n),point:n,originalEvent:r})}function g(e,r){var o=i.touchPos(_,r),a=o.reduce(function(t,e,r,i){return t.add(e.div(i.length))},new n(0,0));return t.fire(e,{lngLat:t.unproject(a),point:a,lngLats:o.map(function(e){return t.unproject(e)},this),points:o,originalEvent:r})}var _=t.getCanvasContainer(),x=null,b=!1,w=null,E=null;for(var T in o)t[T]=new o[T](t,e),e.interactive&&e[T]&&t[T].enable(e[T]);_.addEventListener("mouseout",r,!1),_.addEventListener("mousedown",a,!1),_.addEventListener("mouseup",s,!1),_.addEventListener("mousemove",u,!1),_.addEventListener("touchstart",l,!1),_.addEventListener("touchend",h,!1),_.addEventListener("touchmove",c,!1),_.addEventListener("touchcancel",p,!1),_.addEventListener("click",d,!1),_.addEventListener("dblclick",m,!1),_.addEventListener("contextmenu",y,!1)}},{"../util/dom":117,"./handler/box_zoom":97,"./handler/dblclick_zoom":98,"./handler/drag_pan":99,"./handler/drag_rotate":100,"./handler/keyboard":101,"./handler/scroll_zoom":102,"./handler/touch_zoom_rotate":103,"point-geometry":197}],92:[function(t,e,r){"use strict";var i=t("../util/util"),n=t("../util/interpolate"),o=t("../util/browser"),a=t("../geo/lng_lat"),s=t("../geo/lng_lat_bounds"),u=t("point-geometry"),l=t("../util/evented"),c=function(t){function e(e,r){t.call(this),this.moving=!1,this.transform=e,this._bearingSnap=r.bearingSnap}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCenter=function(){return this.transform.center},e.prototype.setCenter=function(t,e){return this.jumpTo({center:t},e),this},e.prototype.panBy=function(t,e,r){return this.panTo(this.transform.center,i.extend({offset:u.convert(t).mult(-1)},e),r),this},e.prototype.panTo=function(t,e,r){return this.easeTo(i.extend({center:t},e),r)},e.prototype.getZoom=function(){return this.transform.zoom},e.prototype.setZoom=function(t,e){return this.jumpTo({zoom:t},e),this},e.prototype.zoomTo=function(t,e,r){return this.easeTo(i.extend({zoom:t},e),r)},e.prototype.zoomIn=function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},e.prototype.zoomOut=function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},e.prototype.getBearing=function(){return this.transform.bearing},e.prototype.setBearing=function(t,e){return this.jumpTo({bearing:t},e),this},e.prototype.rotateTo=function(t,e,r){return this.easeTo(i.extend({bearing:t},e),r)},e.prototype.resetNorth=function(t,e){return this.rotateTo(0,i.extend({duration:1e3},t),e),this},e.prototype.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 _=c.zoomScale(y-p),x=c.point,b="center"in t?c.project(m).sub(h.div(_)):x,w=t.curve,E=Math.max(c.width,c.height),T=E/_,S=b.sub(x).mag();if("minZoom"in t){var z=i.clamp(Math.min(t.minZoom,p,y),c.minZoom,c.maxZoom),A=E/c.zoomScale(z-p);w=Math.sqrt(A/S*2)}var M=w*w,P=r(0),L=function(t){return s(P)/s(P+w*t)},I=function(t){return E*((s(P)*l(P+w*t)-o(P))/M)/S},C=(r(1)-P)/w;if(Math.abs(S)<1e-6){if(Math.abs(E-T)<1e-6)return this.easeTo(t);var k=T=0)return!1;return!0}),this._container.innerHTML=t.join(" | "),this._editLink=null}},o.prototype._updateCompact=function(){var t=this._map.getCanvasContainer().offsetWidth<=640;this._container.classList[t?"add":"remove"]("compact")},e.exports=o},{"../../util/dom":117,"../../util/util":129}],94:[function(t,e,r){"use strict";function i(t){void 0!==n?t(n):void 0!==s.navigator.permissions?s.navigator.permissions.query({name:"geolocation"}).then(function(e){n="denied"!==e.state,t(n)}):(n=!!s.navigator.geolocation,t(n))}var n,o=t("../../util/evented"),a=t("../../util/dom"),s=t("../../util/window"),u=t("../../util/util"),l={enableHighAccuracy:!1,timeout:6e3},c="mapboxgl-ctrl",h=function(t){function e(e){t.call(this),this.options=e||{},u.bindAll(["_onSuccess","_onError","_finish","_setupUI"],this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.onAdd=function(t){return this._map=t,this._container=a.create("div",c+" "+c+"-group"),i(this._setupUI),this._container},e.prototype.onRemove=function(){this._container.parentNode.removeChild(this._container),this._map=void 0},e.prototype._onSuccess=function(t){this._map.jumpTo({center:[t.coords.longitude,t.coords.latitude],zoom:17,bearing:0,pitch:0}),this.fire("geolocate",t),this._finish()},e.prototype._onError=function(t){this.fire("error",t),this._finish()},e.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},e.prototype._setupUI=function(t){t!==!1&&(this._container.addEventListener("contextmenu",function(t){return t.preventDefault()}),this._geolocateButton=a.create("button",c+"-icon "+c+"-geolocate",this._container),this._geolocateButton.type="button",this._geolocateButton.setAttribute("aria-label","Geolocate"),this.options.watchPosition&&this._geolocateButton.setAttribute("aria-pressed",!1),this._geolocateButton.addEventListener("click",this._onClickGeolocate.bind(this)))},e.prototype._onClickGeolocate=function(){var t=u.extend(l,this.options&&this.options.positionOptions||{});this.options.watchPosition?void 0!==this._geolocationWatchID?(this._geolocateButton.classList.remove("watching"),this._geolocateButton.setAttribute("aria-pressed",!1),s.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0):(this._geolocateButton.classList.add("watching"),this._geolocateButton.setAttribute("aria-pressed",!0),this._geolocationWatchID=s.navigator.geolocation.watchPosition(this._onSuccess,this._onError,t)):(s.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,t),this._timeoutId=setTimeout(this._finish,1e4))},e}(o);e.exports=h},{"../../util/dom":117,"../../util/evented":118,"../../util/util":129,"../../util/window":112}],95:[function(t,e,r){"use strict";function i(t){return new o.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 n=t("../../util/dom"),o=t("../../util/window"),a=t("../../util/util"),s="mapboxgl-ctrl",u=function(){a.bindAll(["_rotateCompassArrow"],this)};u.prototype._rotateCompassArrow=function(){var t="rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassArrow.style.transform=t},u.prototype.onAdd=function(t){return this._map=t,this._container=n.create("div",s+" "+s+"-group",t.getContainer()),this._container.addEventListener("contextmenu",this._onContextMenu.bind(this)),this._zoomInButton=this._createButton(s+"-icon "+s+"-zoom-in","Zoom In",t.zoomIn.bind(t)),this._zoomOutButton=this._createButton(s+"-icon "+s+"-zoom-out","Zoom Out",t.zoomOut.bind(t)),this._compass=this._createButton(s+"-icon "+s+"-compass","Reset North",t.resetNorth.bind(t)),this._compassArrow=n.create("span","arrow",this._compass),this._compass.addEventListener("mousedown",this._onCompassDown.bind(this)),this._onCompassMove=this._onCompassMove.bind(this),this._onCompassUp=this._onCompassUp.bind(this),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._container},u.prototype.onRemove=function(){this._container.parentNode.removeChild(this._container),this._map.off("rotate",this._rotateCompassArrow),this._map=void 0},u.prototype._onContextMenu=function(t){t.preventDefault()},u.prototype._onCompassDown=function(t){0===t.button&&(n.disableDrag(),o.document.addEventListener("mousemove",this._onCompassMove),o.document.addEventListener("mouseup",this._onCompassUp),this._map.getCanvasContainer().dispatchEvent(i(t)),t.stopPropagation())},u.prototype._onCompassMove=function(t){0===t.button&&(this._map.getCanvasContainer().dispatchEvent(i(t)),t.stopPropagation())},u.prototype._onCompassUp=function(t){0===t.button&&(o.document.removeEventListener("mousemove",this._onCompassMove),o.document.removeEventListener("mouseup",this._onCompassUp), +n.enableDrag(),this._map.getCanvasContainer().dispatchEvent(i(t)),t.stopPropagation())},u.prototype._createButton=function(t,e,r){var i=n.create("button",t,this._container);return i.type="button",i.setAttribute("aria-label",e),i.addEventListener("click",function(){r()}),i},e.exports=u},{"../../util/dom":117,"../../util/util":129,"../../util/window":112}],96:[function(t,e,r){"use strict";function i(t,e,r){var i=r&&r.maxWidth||100,a=t._container.clientHeight/2,s=o(t.unproject([0,a]),t.unproject([i,a]));if(r&&"imperial"===r.unit){var u=3.2808*s;if(u>5280){var l=u/5280;n(e,i,l,"mi")}else n(e,i,u,"ft")}else n(e,i,s,"m")}function n(t,e,r,i){var n=a(r),o=n/r;"m"===i&&n>=1e3&&(n/=1e3,i="km"),t.style.width=e*o+"px",t.innerHTML=n+i}function o(t,e){var r=6371e3,i=Math.PI/180,n=t.lat*i,o=e.lat*i,a=Math.sin(n)*Math.sin(o)+Math.cos(n)*Math.cos(o)*Math.cos((e.lng-t.lng)*i),s=r*Math.acos(Math.min(a,1));return s}function a(t){var e=Math.pow(10,(""+Math.floor(t)).length-1),r=t/e;return r=r>=10?10:r>=5?5:r>=3?3:r>=2?2:1,e*r}var s=t("../../util/dom"),u=t("../../util/util"),l=function(t){this.options=t,u.bindAll(["_onMove"],this)};l.prototype.getDefaultPosition=function(){return"bottom-left"},l.prototype._onMove=function(){i(this._map,this._container,this.options)},l.prototype.onAdd=function(t){return this._map=t,this._container=s.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},l.prototype.onRemove=function(){this._container.parentNode.removeChild(this._container),this._map.off("move",this._onMove),this._map=void 0},e.exports=l},{"../../util/dom":117,"../../util/util":129}],97:[function(t,e,r){"use strict";var i=t("../../util/dom"),n=t("../../geo/lng_lat_bounds"),o=t("../../util/util"),a=t("../../util/window"),s=function(t){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),o.bindAll(["_onMouseDown","_onMouseMove","_onMouseUp","_onKeyDown"],this)};s.prototype.isEnabled=function(){return!!this._enabled},s.prototype.isActive=function(){return!!this._active},s.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onMouseDown,!1),this._enabled=!0)},s.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onMouseDown),this._enabled=!1)},s.prototype._onMouseDown=function(t){t.shiftKey&&0===t.button&&(a.document.addEventListener("mousemove",this._onMouseMove,!1),a.document.addEventListener("keydown",this._onKeyDown,!1),a.document.addEventListener("mouseup",this._onMouseUp,!1),i.disableDrag(),this._startPos=i.mousePos(this._el,t),this._active=!0)},s.prototype._onMouseMove=function(t){var e=this._startPos,r=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 n=Math.min(e.x,r.x),o=Math.max(e.x,r.x),a=Math.min(e.y,r.y),s=Math.max(e.y,r.y);i.setTransform(this._box,"translate("+n+"px,"+a+"px)"),this._box.style.width=o-n+"px",this._box.style.height=s-a+"px"},s.prototype._onMouseUp=function(t){if(0===t.button){var e=this._startPos,r=i.mousePos(this._el,t),o=(new n).extend(this._map.unproject(e)).extend(this._map.unproject(r));this._finish(),e.x===r.x&&e.y===r.y?this._fireEvent("boxzoomcancel",t):this._map.fitBounds(o,{linear:!0}).fire("boxzoomend",{originalEvent:t,boxZoomBounds:o})}},s.prototype._onKeyDown=function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t))},s.prototype._finish=function(){this._active=!1,a.document.removeEventListener("mousemove",this._onMouseMove,!1),a.document.removeEventListener("keydown",this._onKeyDown,!1),a.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()},s.prototype._fireEvent=function(t,e){return this._map.fire(t,{originalEvent:e})},e.exports=s},{"../../geo/lng_lat_bounds":20,"../../util/dom":117,"../../util/util":129,"../../util/window":112}],98:[function(t,e,r){"use strict";var i=function(t){this._map=t,this._onDblClick=this._onDblClick.bind(this)};i.prototype.isEnabled=function(){return!!this._enabled},i.prototype.enable=function(){this.isEnabled()||(this._map.on("dblclick",this._onDblClick),this._enabled=!0)},i.prototype.disable=function(){this.isEnabled()&&(this._map.off("dblclick",this._onDblClick),this._enabled=!1)},i.prototype._onDblClick=function(t){this._map.zoomTo(this._map.getZoom()+(t.originalEvent.shiftKey?-1:1),{around:t.lngLat},t)},e.exports=i},{}],99:[function(t,e,r){"use strict";var i=t("../../util/dom"),n=t("../../util/util"),o=t("../../util/window"),a=.3,s=n.bezier(0,0,a,1),u=1400,l=2500,c=function(t){this._map=t,this._el=t.getCanvasContainer(),n.bindAll(["_onDown","_onMove","_onUp","_onTouchEnd","_onMouseUp"],this)};c.prototype.isEnabled=function(){return!!this._enabled},c.prototype.isActive=function(){return!!this._active},c.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._el.addEventListener("touchstart",this._onDown),this._enabled=!0)},c.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._el.removeEventListener("touchstart",this._onDown),this._enabled=!1)},c.prototype._onDown=function(t){this._ignoreEvent(t)||this.isActive()||(t.touches?(o.document.addEventListener("touchmove",this._onMove),o.document.addEventListener("touchend",this._onTouchEnd)):(o.document.addEventListener("mousemove",this._onMove),o.document.addEventListener("mouseup",this._onMouseUp)),this._active=!1,this._startPos=this._pos=i.mousePos(this._el,t),this._inertia=[[Date.now(),this._pos]])},c.prototype._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),r=this._map;r.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),e]),r.transform.setLocationAtPoint(r.transform.pointLocation(this._pos),e),this._fireEvent("drag",t),this._fireEvent("move",t),this._pos=e,t.preventDefault()}},c.prototype._onUp=function(t){var e=this;if(this.isActive()){this._active=!1,this._fireEvent("dragend",t),this._drainInertiaBuffer();var r=function(){return e._fireEvent("moveend",t)},i=this._inertia;if(i.length<2)return void r();var n=i[i.length-1],o=i[0],c=n[1].sub(o[1]),h=(n[0]-o[0])/1e3;if(0===h||n[1].equals(o[1]))return void r();var p=c.mult(a/h),f=p.mag();f>u&&(f=u,p._unit()._mult(f));var d=f/(l*a),m=p.mult(-d/2);this._map.panBy(m,{duration:1e3*d,easing:s,noMoveStart:!0},{originalEvent:t})}},c.prototype._onMouseUp=function(t){this._ignoreEvent(t)||(this._onUp(t),o.document.removeEventListener("mousemove",this._onMove),o.document.removeEventListener("mouseup",this._onMouseUp))},c.prototype._onTouchEnd=function(t){this._ignoreEvent(t)||(this._onUp(t),o.document.removeEventListener("touchmove",this._onMove),o.document.removeEventListener("touchend",this._onTouchEnd))},c.prototype._fireEvent=function(t,e){return this._map.fire(t,{originalEvent:e})},c.prototype._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 r=1,i=0;return"mousemove"===t.type?t.buttons&0===r:t.button!==i},c.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,e=Date.now(),r=160;t.length>0&&e-t[0][0]>r;)t.shift()},e.exports=c},{"../../util/dom":117,"../../util/util":129,"../../util/window":112}],100:[function(t,e,r){"use strict";var i=t("../../util/dom"),n=t("../../util/util"),o=t("../../util/window"),a=.25,s=n.bezier(0,0,a,1),u=180,l=720,c=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._bearingSnap=e.bearingSnap,this._pitchWithRotate=e.pitchWithRotate!==!1,n.bindAll(["_onDown","_onMove","_onUp"],this)};c.prototype.isEnabled=function(){return!!this._enabled},c.prototype.isActive=function(){return!!this._active},c.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._enabled=!0)},c.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._enabled=!1)},c.prototype._onDown=function(t){this._ignoreEvent(t)||this.isActive()||(o.document.addEventListener("mousemove",this._onMove),o.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,t.preventDefault())},c.prototype._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 r=this._pos,n=i.mousePos(this._el,t),o=.8*(r.x-n.x),a=(r.y-n.y)*-.5,s=e.getBearing()-o,u=e.getPitch()-a,l=this._inertia,c=l[l.length-1];this._drainInertiaBuffer(),l.push([Date.now(),e._normalizeBearing(s,c[1])]),e.transform.bearing=s,this._pitchWithRotate&&(e.transform.pitch=u),this._fireEvent("rotate",t),this._fireEvent("move",t),this._pos=n}},c.prototype._onUp=function(t){var e=this;if(!this._ignoreEvent(t)&&(o.document.removeEventListener("mousemove",this._onMove),o.document.removeEventListener("mouseup",this._onUp),this.isActive())){this._active=!1,this._fireEvent("rotateend",t),this._drainInertiaBuffer();var r=this._map,i=r.getBearing(),n=this._inertia,c=function(){Math.abs(i)u&&(g=u);var _=g/(l*a),x=y*g*(_/2);d+=x,Math.abs(r._normalizeBearing(d,0))1;var r=t.ctrlKey?1:2,i=t.ctrlKey?0:2,n=t.button;return"undefined"!=typeof InstallTrigger&&2===t.button&&t.ctrlKey&&o.navigator.platform.toUpperCase().indexOf("MAC")>=0&&(n=0),"mousemove"===t.type?t.buttons&0===r:n!==i},c.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,e=Date.now(),r=160;t.length>0&&e-t[0][0]>r;)t.shift()},e.exports=c},{"../../util/dom":117,"../../util/util":129,"../../util/window":112}],101:[function(t,e,r){"use strict";function i(t){return t*(2-t)}var n=100,o=15,a=10,s=function(t){this._map=t,this._el=t.getCanvasContainer(),this._onKeyDown=this._onKeyDown.bind(this)};s.prototype.isEnabled=function(){return!!this._enabled},s.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)},s.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)},s.prototype._onKeyDown=function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=0,r=0,s=0,u=0,l=0;switch(t.keyCode){case 61:case 107:case 171:case 187:e=1;break;case 189:case 109:case 173:e=-1;break;case 37:t.shiftKey?r=-1:(t.preventDefault(),u=-1);break;case 39:t.shiftKey?r=1:(t.preventDefault(),u=1);break;case 38:t.shiftKey?s=1:(t.preventDefault(),l=-1);break;case 40:t.shiftKey?s=-1:(l=1,t.preventDefault())}var c=this._map,h=c.getZoom(),p={duration:300,delayEndEvents:500,easing:i,zoom:e?Math.round(h)+e*(t.shiftKey?2:1):h,bearing:c.getBearing()+r*o,pitch:c.getPitch()+s*a,offset:[-u*n,-l*n],center:c.getCenter()};c.easeTo(p,{originalEvent:t})}},e.exports=s},{}],102:[function(t,e,r){"use strict";var i=t("../../util/dom"),n=t("../../util/util"),o=t("../../util/browser"),a=t("../../util/window"),s=a.navigator.userAgent.toLowerCase(),u=s.indexOf("firefox")!==-1,l=s.indexOf("safari")!==-1&&s.indexOf("chrom")===-1,c=function(t){this._map=t,this._el=t.getCanvasContainer(),n.bindAll(["_onWheel","_onTimeout"],this)};c.prototype.isEnabled=function(){return!!this._enabled},c.prototype.enable=function(t){this.isEnabled()||(this._el.addEventListener("wheel",this._onWheel,!1),this._el.addEventListener("mousewheel",this._onWheel,!1),this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},c.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("wheel",this._onWheel),this._el.removeEventListener("mousewheel",this._onWheel),this._enabled=!1)},c.prototype._onWheel=function(t){var e;"wheel"===t.type?(e=t.deltaY,u&&t.deltaMode===a.WheelEvent.DOM_DELTA_PIXEL&&(e/=o.devicePixelRatio),t.deltaMode===a.WheelEvent.DOM_DELTA_LINE&&(e*=40)):"mousewheel"===t.type&&(e=-t.wheelDeltaY,l&&(e/=3));var r=o.now(),n=r-(this._time||0);this._pos=i.mousePos(this._el,t),this._time=r,0!==e&&e%4.000244140625===0?this._type="wheel":0!==e&&Math.abs(e)<4?this._type="trackpad":n>400?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40)):this._type||(this._type=Math.abs(n*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()},c.prototype._onTimeout=function(){this._type="wheel",this._zoom(-this._lastValue)},c.prototype._zoom=function(t,e){if(0!==t){var r=this._map,i=2/(1+Math.exp(-Math.abs(t/100)));t<0&&0!==i&&(i=1/i);var n=r.ease?r.ease.to:r.transform.scale,o=r.transform.scaleZoom(n*i);r.zoomTo(o,{duration:"wheel"===this._type?200:0,around:this._aroundCenter?r.getCenter():r.unproject(this._pos),delayEndEvents:200,smoothEasing:!0},{originalEvent:e})}},e.exports=c},{"../../util/browser":110,"../../util/dom":117,"../../util/util":129,"../../util/window":112}],103:[function(t,e,r){"use strict";var i=t("../../util/dom"),n=t("../../util/util"),o=t("../../util/window"),a=.15,s=n.bezier(0,0,a,1),u=12,l=2.5,c=.15,h=4,p=function(t){this._map=t,this._el=t.getCanvasContainer(),n.bindAll(["_onStart","_onMove","_onEnd"],this)};p.prototype.isEnabled=function(){return!!this._enabled},p.prototype.enable=function(t){this.isEnabled()||(this._el.addEventListener("touchstart",this._onStart,!1),this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},p.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("touchstart",this._onStart),this._enabled=!1)},p.prototype.disableRotation=function(){this._rotationDisabled=!0},p.prototype.enableRotation=function(){this._rotationDisabled=!1},p.prototype._onStart=function(t){if(2===t.touches.length){var e=i.mousePos(this._el,t.touches[0]),r=i.mousePos(this._el,t.touches[1]);this._startVec=e.sub(r),this._startScale=this._map.transform.scale,this._startBearing=this._map.transform.bearing,this._gestureIntent=void 0,this._inertia=[],o.document.addEventListener("touchmove",this._onMove,!1),o.document.addEventListener("touchend",this._onEnd,!1)}},p.prototype._onMove=function(t){if(2===t.touches.length){var e=i.mousePos(this._el,t.touches[0]),r=i.mousePos(this._el,t.touches[1]),n=e.add(r).div(2),o=e.sub(r),a=o.mag()/this._startVec.mag(),s=this._rotationDisabled?0:180*o.angleWith(this._startVec)/Math.PI,u=this._map;if(this._gestureIntent){var l={duration:0,around:u.unproject(n)};"rotate"===this._gestureIntent&&(l.bearing=this._startBearing+s),"zoom"!==this._gestureIntent&&"rotate"!==this._gestureIntent||(l.zoom=u.transform.scaleZoom(this._startScale*a)),u.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),a,n]),u.easeTo(l,{originalEvent:t})}else{var p=Math.abs(1-a)>c,f=Math.abs(s)>h;f?this._gestureIntent="rotate":p&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._startVec=o,this._startScale=u.transform.scale,this._startBearing=u.transform.bearing)}t.preventDefault()}},p.prototype._onEnd=function(t){o.document.removeEventListener("touchmove",this._onMove),o.document.removeEventListener("touchend",this._onEnd),this._drainInertiaBuffer();var e=this._inertia,r=this._map;if(e.length<2)return void r.snapToNorth({},{originalEvent:t});var i=e[e.length-1],n=e[0],c=r.transform.scaleZoom(this._startScale*i[1]),h=r.transform.scaleZoom(this._startScale*n[1]),p=c-h,f=(i[0]-n[0])/1e3,d=i[2];if(0===f||c===h)return void r.snapToNorth({},{originalEvent:t});var m=p*a/f;Math.abs(m)>l&&(m=m>0?l:-l);var y=1e3*Math.abs(m/(u*a)),v=c+m*y/2e3;v<0&&(v=0),r.easeTo({zoom:v,duration:y,easing:s,around:this._aroundCenter?r.getCenter():r.unproject(d)},{originalEvent:t})},p.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,e=Date.now(),r=160;t.length>2&&e-t[0][0]>r;)t.shift()},e.exports=p},{"../../util/dom":117,"../../util/util":129,"../../util/window":112}],104:[function(t,e,r){"use strict";var i=t("../util/util"),n=t("../util/window"),o=function(){i.bindAll(["_onHashChange","_updateHash"],this)};o.prototype.addTo=function(t){return this._map=t,n.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},o.prototype.remove=function(){return n.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),delete this._map,this},o.prototype._onHashChange=function(){var t=n.location.hash.replace("#","").split("/");return t.length>=3&&(this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:+(t[3]||0),pitch:+(t[4]||0)}),!0)},o.prototype._updateHash=function(){var t=this._map.getCenter(),e=this._map.getZoom(),r=this._map.getBearing(),i=this._map.getPitch(),o=Math.max(0,Math.ceil(Math.log(e)/Math.LN2)),a="#"+Math.round(100*e)/100+"/"+t.lat.toFixed(o)+"/"+t.lng.toFixed(o);(r||i)&&(a+="/"+Math.round(10*r)/10),i&&(a+="/"+Math.round(i)),n.history.replaceState("","",a)},e.exports=o},{"../util/util":129,"../util/window":112}],105:[function(t,e,r){"use strict";function i(t){t.parentNode&&t.parentNode.removeChild(t)}var n=t("../util/util"),o=t("../util/browser"),a=t("../util/window"),s=t("../util/dom"),u=t("../style/style"),l=t("../style/animation_loop"),c=t("../render/painter"),h=t("../geo/transform"),p=t("./hash"),f=t("./bind_handlers"),d=t("./camera"),m=t("../geo/lng_lat"),y=t("../geo/lng_lat_bounds"),v=t("point-geometry"),g=t("./control/attribution_control"),_=t("mapbox-gl-supported"),x=0,b=20,w={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:x,maxZoom:b,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,renderWorldCopies:!0},E=function(t){function e(e){var r=this;e=n.extend({},w,e);var i=new h(e.minZoom,e.maxZoom,e.renderWorldCopies);if(t.call(this,i,e),this._interactive=e.interactive,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,"string"==typeof e.container){if(this._container=a.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else this._container=e.container;this.animationLoop=new l,e.maxBounds&&this.setMaxBounds(e.maxBounds),n.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored","_update","_render","_onData","_onDataLoading"],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(){r.animationLoop.set(300),r._rerender()}),"undefined"!=typeof a&&(a.addEventListener("online",this._onWindowOnline,!1),a.addEventListener("resize",this._onWindowResize,!1)),f(this,e),this._hash=e.hash&&(new p).addTo(this),this._hash&&this._hash._onHashChange()||this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),this._classes=[],this.resize(),e.classes&&this.setClasses(e.classes),e.style&&this.setStyle(e.style),e.attributionControl&&this.addControl(new g),this.on("style.load",function(){this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this.style.update(this._classes,{transition:!1})}),this.on("data",this._onData),this.on("dataloading",this._onDataLoading)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={showTileBoundaries:{},showCollisionBoxes:{},showOverdrawInspector:{},repaint:{},vertices:{}};return e.prototype.addControl=function(t,e){void 0===e&&t.getDefaultPosition&&(e=t.getDefaultPosition()),void 0===e&&(e="top-right");var r=t.onAdd(this),i=this._controlPositions[e];return e.indexOf("bottom")!==-1?i.insertBefore(r,i.firstChild):i.appendChild(r),this},e.prototype.removeControl=function(t){return t.onRemove(this),this},e.prototype.addClass=function(t,e){return n.warnOnce("Style classes are deprecated and will be removed in an upcoming release of Mapbox GL JS."),this._classes.indexOf(t)>=0||""===t?this:(this._classes.push(t),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},e.prototype.removeClass=function(t,e){n.warnOnce("Style classes are deprecated and will be removed in an upcoming release of Mapbox GL JS.");var r=this._classes.indexOf(t);return r<0||""===t?this:(this._classes.splice(r,1),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},e.prototype.setClasses=function(t,e){n.warnOnce("Style classes are deprecated and will be removed in an upcoming release of Mapbox GL JS.");for(var r={},i=0;i=0},e.prototype.getClasses=function(){return n.warnOnce("Style classes are deprecated and will be removed in an upcoming release of Mapbox GL JS."),this._classes},e.prototype.resize=function(){var t=this._containerDimensions(),e=t[0],r=t[1];this._resizeCanvas(e,r),this.transform.resize(e,r),this.painter.resize(e,r);var i=this.painter.gl,o=i.getParameter(i.MAX_RENDERBUFFER_SIZE)/2;return(this._canvas.width>o||this._canvas.height>o)&&n.warnOnce("Map is larger than maximum size supported by this system ("+o+"px by "+o+"px)."),this.fire("movestart").fire("move").fire("resize").fire("moveend")},e.prototype.getBounds=function(){var t=new y(this.transform.pointLocation(new v(0,this.transform.height)),this.transform.pointLocation(new v(this.transform.width,0)));return(this.transform.angle||this.transform.pitch)&&(t.extend(this.transform.pointLocation(new v(this.transform.size.x,0))),t.extend(this.transform.pointLocation(new v(0,this.transform.size.y)))),t},e.prototype.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},e.prototype.setMinZoom=function(t){if(t=null===t||void 0===t?x:t,t>=x&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},e.prototype.getMaxZoom=function(){return this.transform.maxZoom},e.prototype.project=function(t){return this.transform.locationPoint(m.convert(t))},e.prototype.unproject=function(t){return this.transform.pointLocation(v.convert(t))},e.prototype.queryRenderedFeatures=function(){function t(t){return t instanceof v||Array.isArray(t)}var e,r={};return 2===arguments.length?(e=arguments[0],r=arguments[1]):1===arguments.length&&t(arguments[0])?e=arguments[0]:1===arguments.length&&(r=arguments[0]),this.style.queryRenderedFeatures(this._makeQueryGeometry(e),r,this.transform.zoom,this.transform.angle)},e.prototype._makeQueryGeometry=function(t){var e=this;void 0===t&&(t=[v.convert([0,0]),v.convert([this.transform.width,this.transform.height])]);var r,i=t instanceof v||"number"==typeof t[0];if(i){var n=v.convert(t);r=[n]}else{var o=[v.convert(t[0]),v.convert(t[1])];r=[o[0],new v(o[1].x,o[0].y),o[1],new v(o[0].x,o[1].y),o[0]]}return r=r.map(function(t){return e.transform.pointCoordinate(t)})},e.prototype.querySourceFeatures=function(t,e){return this.style.querySourceFeatures(t,e)},e.prototype.setStyle=function(t,e){var r=(!e||e.diff!==!1)&&this.style&&t&&!(t instanceof u)&&"string"!=typeof t;if(r)try{return this.style.setState(t)&&this._update(!0),this}catch(t){n.warnOnce("Unable to perform style diff: "+(t.message||t.error||t)+". Rebuilding the style from scratch.")}return this.style&&(this.style.setEventedParent(null),this.style._remove(),this.off("rotate",this.style._redoPlacement),this.off("pitch",this.style._redoPlacement)),t?(t instanceof u?this.style=t:this.style=new u(t,this),this.style.setEventedParent(this,{style:this.style}),this.on("rotate",this.style._redoPlacement),this.on("pitch",this.style._redoPlacement),this):(this.style=null,this)},e.prototype.getStyle=function(){if(this.style)return this.style.serialize()},e.prototype.addSource=function(t,e){return this.style.addSource(t,e),this._update(!0),this},e.prototype.isSourceLoaded=function(t){var e=this.style&&this.style.sourceCaches[t];return void 0===e?void this.fire("error",{error:new Error("There is no source with ID '"+t+"'")}):e.loaded()},e.prototype.addSourceType=function(t,e,r){return this.style.addSourceType(t,e,r)},e.prototype.removeSource=function(t){return this.style.removeSource(t),this._update(!0),this},e.prototype.getSource=function(t){return this.style.getSource(t)},e.prototype.addLayer=function(t,e){return this.style.addLayer(t,e),this._update(!0),this},e.prototype.moveLayer=function(t,e){return this.style.moveLayer(t,e),this._update(!0),this},e.prototype.removeLayer=function(t){return this.style.removeLayer(t),this._update(!0),this},e.prototype.getLayer=function(t){return this.style.getLayer(t)},e.prototype.setFilter=function(t,e){return this.style.setFilter(t,e),this._update(!0),this},e.prototype.setLayerZoomRange=function(t,e,r){return this.style.setLayerZoomRange(t,e,r),this._update(!0),this},e.prototype.getFilter=function(t){return this.style.getFilter(t)},e.prototype.setPaintProperty=function(t,e,r,i){return this.style.setPaintProperty(t,e,r,i),this._update(!0),this},e.prototype.getPaintProperty=function(t,e,r){return this.style.getPaintProperty(t,e,r)},e.prototype.setLayoutProperty=function(t,e,r){return this.style.setLayoutProperty(t,e,r),this._update(!0),this},e.prototype.getLayoutProperty=function(t,e){return this.style.getLayoutProperty(t,e)},e.prototype.setLight=function(t){return this.style.setLight(t),this._update(!0),this},e.prototype.getLight=function(){return this.style.getLight()},e.prototype.getContainer=function(){return this._container},e.prototype.getCanvasContainer=function(){return this._canvasContainer},e.prototype.getCanvas=function(){return this._canvas},e.prototype._containerDimensions=function(){var t=0,e=0;return this._container&&(t=this._container.offsetWidth||400,e=this._container.offsetHeight||300),[t,e]},e.prototype._setupContainer=function(){var t=this._container;t.classList.add("mapboxgl-map");var e=this._canvasContainer=s.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=s.create("canvas","mapboxgl-canvas",e),this._canvas.style.position="absolute",this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",0),this._canvas.setAttribute("aria-label","Map");var r=this._containerDimensions();this._resizeCanvas(r[0],r[1]);var i=this._controlContainer=s.create("div","mapboxgl-control-container",t),n=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(t){n[t]=s.create("div","mapboxgl-ctrl-"+t,i)})},e.prototype._resizeCanvas=function(t,e){var r=a.devicePixelRatio||1;this._canvas.width=r*t,this._canvas.height=r*e,this._canvas.style.width=t+"px",this._canvas.style.height=e+"px"},e.prototype._setupPainter=function(){var t=n.extend({failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer},_.webGLContextAttributes),e=this._canvas.getContext("webgl",t)||this._canvas.getContext("experimental-webgl",t);return e?void(this.painter=new c(e,this.transform)):void this.fire("error",{error:new Error("Failed to initialize WebGL")})},e.prototype._contextLost=function(t){t.preventDefault(),this._frameId&&o.cancelFrame(this._frameId),this.fire("webglcontextlost",{originalEvent:t})},e.prototype._contextRestored=function(t){this._setupPainter(),this.resize(),this._update(),this.fire("webglcontextrestored",{originalEvent:t})},e.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!(!this.style||!this.style.loaded())},e.prototype._update=function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this._rerender(),this):this},e.prototype._render=function(){return 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,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,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(),this},e.prototype.remove=function(){this._hash&&this._hash.remove(),o.cancelFrame(this._frameId),this.setStyle(null),"undefined"!=typeof a&&a.removeEventListener("resize",this._onWindowResize,!1);var t=this.painter.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),i(this._canvasContainer),i(this._controlContainer),this._container.classList.remove("mapboxgl-map"),this.fire("remove")},e.prototype._rerender=function(){this.style&&!this._frameId&&(this._frameId=o.frame(this._render))},e.prototype._onWindowOnline=function(){this._update()},e.prototype._onWindowResize=function(){this._trackResize&&this.stop().resize()._update()},r.showTileBoundaries.get=function(){return!!this._showTileBoundaries},r.showTileBoundaries.set=function(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},r.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},r.showCollisionBoxes.set=function(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,this.style._redoPlacement())},r.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},r.showOverdrawInspector.set=function(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},r.repaint.get=function(){return!!this._repaint},r.repaint.set=function(t){this._repaint=t,this._update()},r.vertices.get=function(){return!!this._vertices},r.vertices.set=function(t){this._vertices=t,this._update()},e.prototype._onData=function(t){this._update("style"===t.dataType),this.fire(t.dataType+"data",t)},e.prototype._onDataLoading=function(t){this.fire(t.dataType+"dataloading",t)},Object.defineProperties(e.prototype,r),e}(d);e.exports=E},{"../geo/lng_lat":19, +"../geo/lng_lat_bounds":20,"../geo/transform":21,"../render/painter":36,"../style/animation_loop":59,"../style/style":63,"../util/browser":110,"../util/dom":117,"../util/util":129,"../util/window":112,"./bind_handlers":91,"./camera":92,"./control/attribution_control":93,"./hash":104,"mapbox-gl-supported":193,"point-geometry":197}],106:[function(t,e,r){"use strict";var i=t("../util/dom"),n=t("../geo/lng_lat"),o=t("point-geometry"),a=function(t,e){this._offset=o.convert(e&&e.offset||[0,0]),this._update=this._update.bind(this),this._onMapClick=this._onMapClick.bind(this),t||(t=i.create("div")),t.classList.add("mapboxgl-marker"),this._element=t,this._popup=null};a.prototype.addTo=function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),this._update(),this._map.on("click",this._onMapClick),this},a.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map=null),i.remove(this._element),this._popup&&this._popup.remove(),this},a.prototype.getLngLat=function(){return this._lngLat},a.prototype.setLngLat=function(t){return this._lngLat=n.convert(t),this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},a.prototype.getElement=function(){return this._element},a.prototype.setPopup=function(t){return this._popup&&(this._popup.remove(),this._popup=null),t&&(this._popup=t,this._popup.setLngLat(this._lngLat)),this},a.prototype._onMapClick=function(t){var e=t.originalEvent.target,r=this._element;this._popup&&(e===r||r.contains(e))&&this.togglePopup()},a.prototype.getPopup=function(){return this._popup},a.prototype.togglePopup=function(){var t=this._popup;t&&(t.isOpen()?t.remove():t.addTo(this._map))},a.prototype._update=function(t){if(this._map){var e=this._map.project(this._lngLat)._add(this._offset);t&&"moveend"!==t.type||(e=e.round()),i.setTransform(this._element,"translate("+e.x+"px, "+e.y+"px)")}},e.exports=a},{"../geo/lng_lat":19,"../util/dom":117,"point-geometry":197}],107:[function(t,e,r){"use strict";function i(t){if(t){if("number"==typeof t){var e=Math.round(Math.sqrt(.5*Math.pow(t,2)));return{top:new l(0,t),"top-left":new l(e,e),"top-right":new l(-e,e),bottom:new l(0,-t),"bottom-left":new l(e,-e),"bottom-right":new l(-e,-e),left:new l(t,0),right:new l(-t,0)}}if(n(t)){var r=l.convert(t);return{top:r,"top-left":r,"top-right":r,bottom:r,"bottom-left":r,"bottom-right":r,left:r,right:r}}return{top:l.convert(t.top||[0,0]),"top-left":l.convert(t["top-left"]||[0,0]),"top-right":l.convert(t["top-right"]||[0,0]),bottom:l.convert(t.bottom||[0,0]),"bottom-left":l.convert(t["bottom-left"]||[0,0]),"bottom-right":l.convert(t["bottom-right"]||[0,0]),left:l.convert(t.left||[0,0]),right:l.convert(t.right||[0,0])}}return i(new l(0,0))}function n(t){return t instanceof l||Array.isArray(t)}var o=t("../util/util"),a=t("../util/evented"),s=t("../util/dom"),u=t("../geo/lng_lat"),l=t("point-geometry"),c=t("../util/window"),h={closeButton:!0,closeOnClick:!0},p=function(t){function e(e){t.call(this),this.options=o.extend(Object.create(h),e),o.bindAll(["_update","_onClickClose"],this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.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},e.prototype.isOpen=function(){return!!this._map},e.prototype.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},e.prototype.getLngLat=function(){return this._lngLat},e.prototype.setLngLat=function(t){return this._lngLat=u.convert(t),this._update(),this},e.prototype.setText=function(t){return this.setDOMContent(c.document.createTextNode(t))},e.prototype.setHTML=function(t){var e,r=c.document.createDocumentFragment(),i=c.document.createElement("body");for(i.innerHTML=t;e=i.firstChild,e;)r.appendChild(e);return this.setDOMContent(r)},e.prototype.setDOMContent=function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},e.prototype._createContent=function(){this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._content=s.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=s.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClickClose))},e.prototype._update=function(){if(this._map&&this._lngLat&&this._content){this._container||(this._container=s.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=s.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content));var t=this.options.anchor,e=i(this.options.offset),r=this._map.project(this._lngLat).round();if(!t){var n=this._container.offsetWidth,o=this._container.offsetHeight;t=r.y+e.bottom.ythis._map.transform.height-o?["bottom"]:[],r.xthis._map.transform.width-n/2&&t.push("right"),t=0===t.length?"bottom":t.join("-")}var a=r.add(e[t]),u={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%)"},l=this._container.classList;for(var c in u)l.remove("mapboxgl-popup-anchor-"+c);l.add("mapboxgl-popup-anchor-"+t),s.setTransform(this._container,u[t]+" translate("+a.x+"px,"+a.y+"px)")}},e.prototype._onClickClose=function(){this.remove()},e}(a);e.exports=p},{"../geo/lng_lat":19,"../util/dom":117,"../util/evented":118,"../util/util":129,"../util/window":112,"point-geometry":197}],108:[function(t,e,r){"use strict";var i=function(t,e,r){this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.callbackID=0,this.receive=this.receive.bind(this),this.target.addEventListener("message",this.receive,!1)};i.prototype.send=function(t,e,r,i,n){var o=r?this.mapId+":"+this.callbackID++:null;r&&(this.callbacks[o]=r),this.target.postMessage({targetMapId:n,sourceMapId:this.mapId,type:t,id:String(o),data:e},i)},i.prototype.receive=function(t){var e,r=this,i=t.data,n=i.id;if(!i.targetMapId||this.mapId===i.targetMapId){var o=function(t,e,i){r.target.postMessage({sourceMapId:r.mapId,type:"",id:String(n),error:t?String(t):null,data:e},i)};if(""===i.type)e=this.callbacks[i.id],delete this.callbacks[i.id],e&&e(i.error||null,i.data);else if("undefined"!=typeof i.id&&this.parent[i.type])this.parent[i.type](i.sourceMapId,i.data,o);else if("undefined"!=typeof i.id&&this.parent.getWorkerSource){var a=i.type.split("."),s=this.parent.getWorkerSource(i.sourceMapId,a[0]);s[a[1]](i.data,o)}else this.parent[i.type](i.data)}},i.prototype.remove=function(){this.target.removeEventListener("message",this.receive,!1)},e.exports=i},{}],109:[function(t,e,r){"use strict";function i(t){var e=n.document.createElement("a");return e.href=t,e.protocol===n.document.location.protocol&&e.host===n.document.location.host}var n=t("./window");r.getJSON=function(t,e){var r=new n.XMLHttpRequest;return r.open("GET",t,!0),r.setRequestHeader("Accept","application/json"),r.onerror=function(t){e(t)},r.onload=function(){if(r.status>=200&&r.status<300&&r.response){var t;try{t=JSON.parse(r.response)}catch(t){return e(t)}e(null,t)}else e(new Error(r.statusText))},r.send(),r},r.getArrayBuffer=function(t,e){var r=new n.XMLHttpRequest;return r.open("GET",t,!0),r.responseType="arraybuffer",r.onerror=function(t){e(t)},r.onload=function(){return 0===r.response.byteLength&&200===r.status?e(new Error("http status 200 returned without content.")):void(r.status>=200&&r.status<300&&r.response?e(null,{data:r.response,cacheControl:r.getResponseHeader("Cache-Control"),expires:r.getResponseHeader("Expires")}):e(new Error(r.statusText)))},r.send(),r};var o="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";r.getImage=function(t,e){return r.getArrayBuffer(t,function(t,r){if(t)return e(t);var i=new n.Image,a=n.URL||n.webkitURL;i.onload=function(){e(null,i),a.revokeObjectURL(i.src)};var s=new n.Blob([new Uint8Array(r.data)],{type:"image/png"});i.cacheControl=r.cacheControl,i.expires=r.expires,i.src=r.data.byteLength?a.createObjectURL(s):o})},r.getVideo=function(t,e){var r=n.document.createElement("video");r.onloadstart=function(){e(null,r)};for(var o=0;o=s+i?t.call(n,1):(t.call(n,(u-s)/i),r.frame(o)))}if(!i)return t.call(n,1),null;var a=!1,s=e.exports.now();return r.frame(o),function(){a=!0}},r.getImageData=function(t){var e=i.document.createElement("canvas"),r=e.getContext("2d");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0),r.getImageData(0,0,t.width,t.height).data},r.supported=t("mapbox-gl-supported"),r.hardwareConcurrency=i.navigator.hardwareConcurrency||4,Object.defineProperty(r,"devicePixelRatio",{get:function(){return i.devicePixelRatio}}),r.supportsWebp=!1;var a=i.document.createElement("img");a.onload=function(){r.supportsWebp=!0},a.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="},{"./window":112,"mapbox-gl-supported":193}],111:[function(t,e,r){"use strict";var i=t("webworkify"),n=t("../window"),o=n.URL.createObjectURL(new i(t("../../source/worker"),{bare:!0}));e.exports=function(){return new n.Worker(o)}},{"../../source/worker":57,"../window":112,webworkify:213}],112:[function(t,e,r){"use strict";e.exports=self},{}],113:[function(t,e,r){"use strict";function i(t,e){return e.area-t.area}var n=t("quickselect"),o=t("./util").calculateSignedArea;e.exports=function(t,e){var r=t.length;if(r<=1)return[t];for(var a,s,u=[],l=0;l1)for(var h=0;ht.y!=h.y>t.y&&t.x<(h.x-c.x)*(t.y-c.y)/(h.y-c.y)+c.x&&(r=!r),i=Math.min(i,l(t,c,h))}return(r?1:-1)*Math.sqrt(i)}function a(t){for(var e=0,r=0,i=0,o=t[0],a=0,s=o.length,u=s-1;al)&&(l=f.x),(!p||f.y>c)&&(c=f.y)}for(var d=l-o,m=c-u,y=Math.min(d,m),v=y/2,g=new s(null,i),_=o;_b.d&&(b=E,r&&console.log("found best %d after %d probes",Math.round(1e4*E.d)/1e4,w)),E.max-b.d<=e||(v=E.h/2,g.push(new n(E.p.x-v,E.p.y-v,v,t)),g.push(new n(E.p.x+v,E.p.y-v,v,t)),g.push(new n(E.p.x-v,E.p.y+v,v,t)),g.push(new n(E.p.x+v,E.p.y+v,v,t)),w+=4)}return r&&(console.log("num probes: "+w),console.log("best distance: "+b.d)),b.p}},{"./intersection_tests":122,"point-geometry":197,tinyqueue:202}],120:[function(t,e,r){"use strict";function i(t,e){this.stacks=t.readFields(n,[],e)}function n(t,e,r){if(1===t){var i=r.readMessage(o,{glyphs:{}});e.push(i)}}function o(t,e,r){if(1===t)e.name=r.readString();else if(2===t)e.range=r.readString();else if(3===t){var i=r.readMessage(a,{});e.glyphs[i.id]=i}}function a(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint())}e.exports=i},{}],121:[function(t,e,r){"use strict";function i(t,e,r){return t*(1-r)+e*r}e.exports=i,i.number=i,i.vec2=function(t,e,r){return[i(t[0],e[0],r),i(t[1],e[1],r)]},i.color=function(t,e,r){return[i(t[0],e[0],r),i(t[1],e[1],r),i(t[2],e[2],r),i(t[3],e[3],r)]},i.array=function(t,e,r){return t.map(function(t,n){return i(t,e[n],r)})}},{}],122:[function(t,e,r){"use strict";function i(t,e){for(var r=0;r=3)for(var u=0;u1){if(u(t,e))return!0;for(var i=0;i1?t.distSqr(r):t.distSqr(r.sub(e)._mult(n)._add(e))}function p(t,e){for(var r,i,n,o=!1,a=0;ae.y!=n.y>e.y&&e.x<(n.x-i.x)*(e.y-i.y)/(n.y-i.y)+i.x&&(o=!o)}return o}function f(t,e){for(var r=!1,i=0,n=t.length-1;ie.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(r=!r)}return r}var d=t("./util").isCounterClockwise;e.exports={multiPolygonIntersectsBufferedMultiPoint:n,multiPolygonIntersectsMultiPolygon:o,multiPolygonIntersectsBufferedMultiLine:a,polygonIntersectsPolygon:i,distToSegmentSquared:h}},{"./util":129}],123:[function(t,e,r){"use strict";var i={"Latin-1 Supplement":function(t){return t>=128&&t<=255},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};e.exports=i},{}],124:[function(t,e,r){"use strict";var i=function(t,e){this.max=t,this.onRemove=e,this.reset()};i.prototype.reset=function(){var t=this;for(var e in this.data)t.onRemove(t.data[e]);return this.data={},this.order=[],this},i.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 r=this.get(this.order[0]);r&&this.onRemove(r)}return this},i.prototype.has=function(t){return t in this.data},i.prototype.keys=function(){return this.order},i.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},i.prototype.remove=function(t){if(!this.has(t))return this;var e=this.data[t];return delete this.data[t],this.onRemove(e),this.order.splice(this.order.indexOf(t),1),this},i.prototype.setMaxSize=function(t){var e=this;for(this.max=t;this.order.length>this.max;){var r=e.get(e.order[0]);r&&e.onRemove(r)}return this},e.exports=i},{}],125:[function(t,e,r){"use strict";function i(t,e){var r=a(u.API_URL);if(t.protocol=r.protocol,t.authority=r.authority,!u.REQUIRE_ACCESS_TOKEN)return s(t);if(e=e||u.ACCESS_TOKEN,!e)throw new Error("An API access token is required to use Mapbox GL. "+c);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+c);return t.params.push("access_token="+e),s(t)}function n(t){return 0===t.indexOf("mapbox:")}function o(t){for(var e=0;e=2||512===r?"@2x":"",c=l.supportsWebp?".webp":"$1";return i.path=i.path.replace(h,""+u+c),o(i.params),s(i)};var p=/^(\w+):\/\/([^\/?]+)(\/[^?]+)?\??(.+)?/},{"./browser":110,"./config":114}],126:[function(t,e,r){"use strict";var i=t("./is_char_in_unicode_block");e.exports.allowsIdeographicBreaking=function(t){for(var e=0,i=t;e=65097&&t<=65103)||i["CJK Compatibility Ideographs"](t)||i["CJK Compatibility"](t)||i["CJK Radicals Supplement"](t)||i["CJK Strokes"](t)||!(!i["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||i["CJK Unified Ideographs Extension A"](t)||i["CJK Unified Ideographs"](t)||i["Enclosed CJK Letters and Months"](t)||i["Hangul Compatibility Jamo"](t)||i["Hangul Jamo Extended-A"](t)||i["Hangul Jamo Extended-B"](t)||i["Hangul Jamo"](t)||i["Hangul Syllables"](t)||i.Hiragana(t)||i["Ideographic Description Characters"](t)||i.Kanbun(t)||i["Kangxi Radicals"](t)||i["Katakana Phonetic Extensions"](t)||i.Katakana(t)&&12540!==t||!(!i["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!i["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||i["Unified Canadian Aboriginal Syllabics"](t)||i["Unified Canadian Aboriginal Syllabics Extended"](t)||i["Vertical Forms"](t)||i["Yijing Hexagram Symbols"](t)||i["Yi Syllables"](t)||i["Yi Radicals"](t)))},r.charHasNeutralVerticalOrientation=function(t){return!!(i["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||i["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||i["Letterlike Symbols"](t)||i["Number Forms"](t)||i["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||i["Control Pictures"](t)&&9251!==t||i["Optical Character Recognition"](t)||i["Enclosed Alphanumerics"](t)||i["Geometric Shapes"](t)||i["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||i["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||i["CJK Symbols and Punctuation"](t)||i.Katakana(t)||i["Private Use Area"](t)||i["CJK Compatibility Forms"](t)||i["Small Form Variants"](t)||i["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)},r.charHasRotatedVerticalOrientation=function(t){return!(r.charHasUprightVerticalOrientation(t)||r.charHasNeutralVerticalOrientation(t))}},{"./is_char_in_unicode_block":123}],127:[function(t,e,r){"use strict";function i(t){var e=JSON.stringify(t);if(y[e])return y[e];var r=void 0===t.alignment?1:t.alignment,i=0,a=0,u=["Uint8"],h=t.members.map(function(t){u.indexOf(t.type)<0&&u.push(t.type);var e=o(t.type),s=i=n(i,Math.max(r,e)),l=t.components||1;return a=Math.max(a,e),i+=e*l,{name:t.name,type:t.type,components:l,offset:s}}),f=n(i,Math.max(a,r)),d=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(p);d.prototype.alignment=r,d.prototype.size=f;for(var v=0,g=h;vthis.capacity){this.capacity=Math.max(t,Math.floor(this.capacity*d),f),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},m.prototype._refreshViews=function(){for(var t=this,e=0,r=this._usedTypes;e=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)},r.bezier=function(t,e,r,n){var o=new i(t,e,r,n);return function(t){return o.solve(t)}},r.ease=r.bezier(.25,.1,.25,1),r.clamp=function(t,e,r){return Math.min(r,Math.max(e,t))},r.wrap=function(t,e,r){var i=r-e,n=((t-e)%i+i)%i+e;return n===e?r:n},r.asyncAll=function(t,e,r){if(!t.length)return r(null,[]);var i=t.length,n=new Array(t.length),o=null;t.forEach(function(t,a){e(t,function(t,e){t&&(o=t),n[a]=e,0===--i&&r(o,n)})})},r.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},r.keysDifference=function(t,e){var r=[];for(var i in t)i in e||r.push(i);return r},r.extend=function(t,e,r,i){for(var n=arguments,o=1;o=0)return!0;return!1};var a={};r.warnOnce=function(t){a[t]||("undefined"!=typeof console&&console.warn(t),a[t]=!0)},r.isCounterClockwise=function(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)},r.calculateSignedArea=function(t){for(var e,r,i=0,n=0,o=t.length,a=o-1;n0||Math.abs(e.y-i.y)>0)&&Math.abs(r.calculateSignedArea(t))>.01},r.sphericalToCartesian=function(t){var e=t[0],r=t[1],i=t[2];return r+=90,r*=Math.PI/180,i*=Math.PI/180,[e*Math.cos(r)*Math.sin(i),e*Math.sin(r)*Math.sin(i),e*Math.cos(i)]},r.parseCacheControl=function(t){var e=/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,r={};if(t.replace(e,function(t,e,i,n){var o=i||n;return r[e]=!o||o.toLowerCase(),""}),r["max-age"]){var i=parseInt(r["max-age"],10);isNaN(i)?delete r["max-age"]:r["max-age"]=i}return r}},{"../geo/coordinate":18,"@mapbox/unitbezier":134,"point-geometry":197}],130:[function(t,e,r){"use strict";var i=function(t,e,r,i){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=r,t._y=i,this.properties=t.properties,null!=t.id&&(this.id=t.id)},n={geometry:{}};n.geometry.get=function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},n.geometry.set=function(t){this._geometry=t},i.prototype.toJSON=function(){var t=this,e={geometry:this.geometry};for(var r in this)"_geometry"!==r&&"_vectorTileFeature"!==r&&(e[r]=t[r]);return e},Object.defineProperties(i.prototype,n),e.exports=i},{}],131:[function(t,e,r){"use strict";var i=t("./script_detection");e.exports=function(t){for(var r="",n=0;n":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"}},{"./script_detection":126}],132:[function(t,e,r){"use strict";var i=t("./web_worker"),n=function(){this.active={}};n.prototype.acquire=function(e){var r=this;if(!this.workers){var n=t("../mapbox-gl").workerCount;for(this.workers=[];this.workers.lengthi)return i;for(;ro?r=n:i=n,n=.5*(i-r)+r}return n},i.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}},{}],135:[function(t,e,r){function i(t){return t=Math.round(t),t<0?0:t>255?255:t}function n(t){return t<0?0:t>1?1:t}function o(t){return i("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function a(t){return n("%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))}function s(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}function u(t){var e=t.replace(/ /g,"").toLowerCase();if(e in l)return l[e].slice();if("#"===e[0]){if(4===e.length){var r=parseInt(e.substr(1),16);return r>=0&&r<=4095?[(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,1]:null}if(7===e.length){var r=parseInt(e.substr(1),16);return r>=0&&r<=16777215?[(16711680&r)>>16,(65280&r)>>8,255&r,1]:null}return null}var n=e.indexOf("("),u=e.indexOf(")");if(n!==-1&&u+1===e.length){var c=e.substr(0,n),h=e.substr(n+1,u-(n+1)).split(","),p=1;switch(c){case"rgba":if(4!==h.length)return null;p=a(h.pop());case"rgb":return 3!==h.length?null:[o(h[0]),o(h[1]),o(h[2]),p];case"hsla":if(4!==h.length)return null;p=a(h.pop());case"hsl":if(3!==h.length)return null;var f=(parseFloat(h[0])%360+360)%360/360,d=a(h[1]),m=a(h[2]),y=m<=.5?m*(d+1):m+d-m*d,v=2*m-y;return[i(255*s(v,y,f+1/3)),i(255*s(v,y,f)),i(255*s(v,y,f-1/3)),p];default:return null}}return null}var l={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{r.parseCSSColor=u}catch(t){}},{}],136:[function(t,e,r){"use strict";function i(t,e,r){r=r||2;var i=e&&e.length,o=i?e[0]*r:t.length,s=n(t,0,o,r,!0),u=[];if(!s)return u;var l,c,p,f,d,m,y;if(i&&(s=h(t,e,s,r)),t.length>80*r){l=p=t[0],c=f=t[1];for(var v=r;vp&&(p=d),m>f&&(f=m);y=Math.max(p-l,f-c)}return a(s,u,r,l,c,y),u}function n(t,e,r,i,n){var o,a;if(n===I(t,e,r,i)>0)for(o=e;o=e;o-=i)a=M(o,t[o],t[o+1],a);return a&&w(a,a.next)&&(P(a),a=a.next),a}function o(t,e){if(!t)return t;e||(e=t);var r,i=t;do if(r=!1,i.steiner||!w(i,i.next)&&0!==b(i.prev,i,i.next))i=i.next;else{if(P(i),i=e=i.prev,i===i.next)return null;r=!0}while(r||i!==e);return e}function a(t,e,r,i,n,h,p){if(t){!p&&h&&m(t,i,n,h);for(var f,d,y=t;t.prev!==t.next;)if(f=t.prev,d=t.next,h?u(t,i,n,h):s(t))e.push(f.i/r),e.push(t.i/r),e.push(d.i/r),P(t),t=d.next,y=d.next;else if(t=d,t===y){p?1===p?(t=l(t,e,r),a(t,e,r,i,n,h,2)):2===p&&c(t,e,r,i,n,h):a(o(t),e,r,i,n,h,1);break}}}function s(t){var e=t.prev,r=t,i=t.next;if(b(e,r,i)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(_(e.x,e.y,r.x,r.y,i.x,i.y,n.x,n.y)&&b(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function u(t,e,r,i){var n=t.prev,o=t,a=t.next;if(b(n,o,a)>=0)return!1;for(var s=n.xo.x?n.x>a.x?n.x:a.x:o.x>a.x?o.x:a.x,c=n.y>o.y?n.y>a.y?n.y:a.y:o.y>a.y?o.y:a.y,h=v(s,u,e,r,i),p=v(l,c,e,r,i),f=t.nextZ;f&&f.z<=p;){if(f!==t.prev&&f!==t.next&&_(n.x,n.y,o.x,o.y,a.x,a.y,f.x,f.y)&&b(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(f=t.prevZ;f&&f.z>=h;){if(f!==t.prev&&f!==t.next&&_(n.x,n.y,o.x,o.y,a.x,a.y,f.x,f.y)&&b(f.prev,f,f.next)>=0)return!1;f=f.prevZ}return!0}function l(t,e,r){var i=t;do{var n=i.prev,o=i.next.next;!w(n,o)&&E(n,i,i.next,o)&&S(n,o)&&S(o,n)&&(e.push(n.i/r),e.push(i.i/r),e.push(o.i/r),P(i),P(i.next),i=t=o),i=i.next}while(i!==t);return i}function c(t,e,r,i,n,s){var u=t;do{for(var l=u.next.next;l!==u.prev;){if(u.i!==l.i&&x(u,l)){var c=A(u,l);return u=o(u,u.next),c=o(c,c.next),a(u,e,r,i,n,s),void a(c,e,r,i,n,s)}l=l.next}u=u.next}while(u!==t)}function h(t,e,r,i){var a,s,u,l,c,h=[];for(a=0,s=e.length;a=i.next.y){var s=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=n&&s>a){if(a=s,s===n){if(o===i.y)return i;if(o===i.next.y)return i.next}r=i.x=i.x&&i.x>=c&&_(or.x)&&S(i,t)&&(r=i,p=u)),i=i.next;return r}function m(t,e,r,i){var n=t;do null===n.z&&(n.z=v(n.x,n.y,e,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,y(n)}function y(t){var e,r,i,n,o,a,s,u,l=1;do{for(r=t,t=null,o=null,a=0;r;){for(a++,i=r,s=0,e=0;e0||u>0&&i;)0===s?(n=i,i=i.nextZ,u--):0!==u&&i?r.z<=i.z?(n=r,r=r.nextZ,s--):(n=i,i=i.nextZ,u--):(n=r,r=r.nextZ,s--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;r=i}o.nextZ=null,l*=2}while(a>1);return t}function v(t,e,r,i,n){return t=32767*(t-r)/n,e=32767*(e-i)/n,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 g(t){var e=t,r=t;do e.x=0&&(t-a)*(i-s)-(r-a)*(e-s)>=0&&(r-a)*(o-s)-(n-a)*(i-s)>=0}function x(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!T(t,e)&&S(t,e)&&S(e,t)&&z(t,e)}function b(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function w(t,e){return t.x===e.x&&t.y===e.y}function E(t,e,r,i){return!!(w(t,e)&&w(r,i)||w(t,i)&&w(r,e))||b(t,e,r)>0!=b(t,e,i)>0&&b(r,i,t)>0!=b(r,i,e)>0}function T(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&E(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}function S(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 z(t,e){var r=t,i=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do r.y>o!=r.next.y>o&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next;while(r!==t);return i}function A(t,e){var r=new L(t.i,t.x,t.y),i=new L(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,o.next=i,i.prev=o,i}function M(t,e,r,i){var n=new L(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function P(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,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function I(t,e,r,i){for(var n=0,o=e,a=r-i;o0&&(i+=t[n-1].length,r.holes.push(i))}return r}},{}],137:[function(t,e,r){function i(t){var e,r,n,l,c,h;switch(typeof t){case"object":if(null===t)return null;if(o(t)){for(n="[",r=t.length-1,e=0;e-1&&(n+=i(t[e])),n+"]"}for(l=a(t).sort(),r=l.length,n="{",c=l[e=0],h=r>0&&void 0!==t[c];e15?"\\u00"+e.toString(16):"\\u000"+e.toString(16)}};e.exports=function(t){if(void 0!==t)return""+i(t)},e.exports.stringSearch=s,e.exports.stringReplace=u},{}],138:[function(t,e,r){"use strict";function i(t){return new Function("f","var p = (f && f.properties || {}); return "+n(t))}function n(t){if(!t)return"true";var e=t[0];if(t.length<=1)return"any"===e?"false":"true";var r="=="===e?a(t[1],t[2],"===",!1):"!="===e?a(t[1],t[2],"!==",!1):"<"===e||">"===e||"<="===e||">="===e?a(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?u(t[1],t.slice(2)):"!in"===e?c(u(t[1],t.slice(2))):"has"===e?l(t[1]):"!has"===e?c(l([t[1]])):"true";return"("+r+")"}function o(t){return"$type"===t?"f.type":"$id"===t?"f.id":"p["+JSON.stringify(t)+"]"}function a(t,e,r,i){var n=o(t),a="$type"===t?p.indexOf(e):JSON.stringify(e);return(i?"typeof "+n+"=== typeof "+a+"&&":"")+n+r+a}function s(t,e){return t.map(n).join(e)}function u(t,e){"$type"===t&&(e=e.map(function(t){return p.indexOf(t)}));var r=JSON.stringify(e.sort(h)),i=o(t);return e.length<=200?r+".indexOf("+i+") !== -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; }("+i+", "+r+",0,"+(e.length-1)+")"}function l(t){return JSON.stringify(t)+" in p"}function c(t){return"!("+t+")"}function h(t,e){return te?1:0}e.exports=i;var p=["Unknown","Point","LineString","Polygon"]},{}],139:[function(t,e,r){function i(t){if("Polygon"===t.type)return n(t.coordinates);if("MultiPolygon"===t.type){for(var e=0,r=0;r0){e+=Math.abs(o(t[0]));for(var r=1;r2){for(var r,i,n=0;n=0}var l=t("geojson-area");e.exports=i},{"geojson-area":139}],141:[function(t,e,r){"use strict";function i(t,e,r,i,a,u,l,c){if(r/=e,i/=e,l>=r&&c<=i)return t;if(l>i||c=r&&d<=i)h.push(m);else if(!(f>i||d=e&&s<=r&&n.push(a)}return n}function o(t,e,r,i,n,o){for(var s=[],u=0;ur?(x.push(n(l,d,e),n(l,d,r)),o||(x=a(s,x,y,v,g))):f>=e&&x.push(n(l,d,e)):p>r?fr&&(x.push(n(l,d,r)),o||(x=a(s,x,y,v,g))));l=m[_-1],p=l[i],p>=e&&p<=r&&x.push(l),h=x[x.length-1],o&&h&&(x[0][0]!==h[0]||x[0][1]!==h[1])&&x.push(x[0]),a(s,x,y,v,g)}return s}function a(t,e,r,i,n){return e.length&&(e.area=r,e.dist=i,void 0!==n&&(e.outer=n),t.push(e)),[]}e.exports=i;var s=t("./feature")},{"./feature":143}],142:[function(t,e,r){"use strict";function i(t,e){var r=[];if("FeatureCollection"===t.type)for(var i=0;i1?1:i,[r,i,0]}function s(t){for(var e,r,i=0,n=0,o=0;o1)return!1;var o=n.geometry[0].length;if(5!==o)return!1;for(var a=0;a1&&console.time("creation"),_=this.tiles[g]=d(t,v,r,i,x,e===f.maxZoom),this.tileCoords.push({z:e,x:r,y:i}),m)){m>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,i,_.numFeatures,_.numPoints,_.numSimplified),console.timeEnd("creation"));var b="z"+e;this.stats[b]=(this.stats[b]||0)+1,this.total++}if(_.source=t,n){if(e===f.maxZoom||e===n)continue;var w=1<1&&console.time("clipping");var E,T,S,z,A,M,P=.5*f.buffer/f.extent,L=.5-P,I=.5+P,C=1+P;E=T=S=z=null,A=p(t,v,r-P,r+I,0,a,_.min[0],_.max[0]),M=p(t,v,r+L,r+C,0,a,_.min[0],_.max[0]),A&&(E=p(A,v,i-P,i+I,1,s,_.min[1],_.max[1]),T=p(A,v,i+L,i+C,1,s,_.min[1],_.max[1])),M&&(S=p(M,v,i-P,i+I,1,s,_.min[1],_.max[1]),z=p(M,v,i+L,i+C,1,s,_.min[1],_.max[1])),m>1&&console.timeEnd("clipping"),t.length&&(h.push(E||[],e+1,2*r,2*i),h.push(T||[],e+1,2*r,2*i+1),h.push(S||[],e+1,2*r+1,2*i),h.push(z||[],e+1,2*r+1,2*i+1))}else n&&(y=e)}return y},n.prototype.getTile=function(t,e,r){var i=this.options,n=i.extent,a=i.debug,s=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var c,p=t,f=e,d=r;!c&&p>0;)p--,f=Math.floor(f/2),d=Math.floor(d/2),c=this.tiles[o(p,f,d)];if(!c||!c.source)return null;if(a>1&&console.log("found parent tile z%d-%d-%d",p,f,d),l(c,n,i.buffer))return h.tile(c,n);a>1&&console.time("drilling down");var m=this.splitTile(c.source,p,f,d,t,e,r); +if(a>1&&console.timeEnd("drilling down"),null!==m){var y=1<i&&(a=r,i=o);i>s?(t[a][2]=i,h.push(l),h.push(a),l=a):(c=h.pop(),l=h.pop())}}function n(t,e,r){var i=e[0],n=e[1],o=r[0],a=r[1],s=t[0],u=t[1],l=o-i,c=a-n;if(0!==l||0!==c){var h=((s-i)*l+(u-n)*c)/(l*l+c*c);h>1?(i=o,n=a):h>0&&(i+=l*h,n+=c*h)}return l=s-i,c=u-n,l*l+c*c}e.exports=i},{}],146:[function(t,e,r){"use strict";function i(t,e,r,i,o,a){for(var s={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:i,z2:e,transformed:!1,min:[2,1],max:[-1,0]},u=0;us.max[0]&&(s.max[0]=c[0]),c[1]>s.max[1]&&(s.max[1]=c[1])}return s}function n(t,e,r,i){var n,a,s,u,l=e.geometry,c=e.type,h=[],p=r*r;if(1===c)for(n=0;np)&&(f.push(u),t.numSimplified++),t.numPoints++;3===c&&o(f,s.outer),h.push(f)}else t.numPoints+=s.length;if(h.length){var d={geometry:h,type:c,tags:e.tags||null};null!==e.id&&(d.id=e.id),t.features.push(d)}}function o(t,e){var r=a(t);r<0===e&&t.reverse()}function a(t){for(var e,r,i=0,n=0,o=t.length,a=o-1;n=l[p+0]&&i>=l[p+1]?(a[h]=!0,o.push(u[h])):a[h]=!1}}},i.prototype._forEachCell=function(t,e,r,i,n,o,a){for(var s=this._convertToCellCoord(t),u=this._convertToCellCoord(e),l=this._convertToCellCoord(r),c=this._convertToCellCoord(i),h=s;h<=l;h++)for(var p=u;p<=c;p++){var f=this.d*p+h;if(n.call(this,t,e,r,i,f,o,a))return}},i.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},i.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=n+this.cells.length+1+1,r=0,i=0;i>1,c=-7,h=r?n-1:0,p=r?-1:1,f=t[e+h];for(h+=p,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=256*o+t[e+h],h+=p,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=i;c>0;a=256*a+t[e+h],h+=p,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:(f?-1:1)*(1/0);a+=Math.pow(2,i),o-=l}return(f?-1:1)*a*Math.pow(2,o-i)},r.write=function(t,e,r,i,n,o){var a,s,u,l=8*o-n-1,c=(1<>1,p=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:o-1,d=i?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,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),e+=a+h>=1?p/u:p*Math.pow(2,1-h),e*u>=2&&(a++,u/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(e*u-1)*Math.pow(2,n),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,n),a=0));n>=8;t[r+f]=255&s,f+=d,s/=256,n-=8);for(a=a<0;t[r+f]=255&a,f+=d,a/=256,l-=8);t[r+f-d]|=128*m}},{}],151:[function(t,e,r){"use strict";function i(t,e,r,i,o){return new n(t,e,r,i,o)}function n(t,e,r,i,n){e=e||o,r=r||a,n=n||Array,this.nodeSize=i||64,this.points=t,this.ids=new n(t.length),this.coords=new n(2*t.length);for(var u=0;u=r&&s<=n&&u>=i&&u<=o&&c.push(t[d]);else{var m=Math.floor((f+p)/2);s=e[2*m],u=e[2*m+1],s>=r&&s<=n&&u>=i&&u<=o&&c.push(t[m]);var y=(h+1)%2;(0===h?r<=s:i<=u)&&(l.push(f),l.push(m-1),l.push(y)),(0===h?n>=s:o>=u)&&(l.push(m+1),l.push(p),l.push(y))}}return c}e.exports=i},{}],153:[function(t,e,r){"use strict";function i(t,e,r,o,a,s){if(!(a-o<=r)){var u=Math.floor((o+a)/2);n(t,e,u,o,a,s%2),i(t,e,r,o,u-1,s+1),i(t,e,r,u+1,a,s+1)}}function n(t,e,r,i,a,s){for(;a>i;){if(a-i>600){var u=a-i+1,l=r-i+1,c=Math.log(u),h=.5*Math.exp(2*c/3),p=.5*Math.sqrt(c*h*(u-h)/u)*(l-u/2<0?-1:1),f=Math.max(i,Math.floor(r-l*h/u+p)),d=Math.min(a,Math.floor(r+(u-l)*h/u+p));n(t,e,r,f,d,s)}var m=e[2*r+s],y=i,v=a;for(o(t,e,i,r),e[2*a+s]>m&&o(t,e,i,a);ym;)v--}e[2*i+s]===m?o(t,e,i,v):(v++,o(t,e,v,a)),v<=r&&(i=v+1),r<=v&&(a=v-1)}}function o(t,e,r,i){a(t,r,i),a(e,2*r,2*i),a(e,2*r+1,2*i+1)}function a(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}e.exports=i},{}],154:[function(t,e,r){"use strict";function i(t,e,r,i,o,a){for(var s=[0,t.length-1,0],u=[],l=o*o;s.length;){var c=s.pop(),h=s.pop(),p=s.pop();if(h-p<=a)for(var f=p;f<=h;f++)n(e[2*f],e[2*f+1],r,i)<=l&&u.push(t[f]);else{var d=Math.floor((p+h)/2),m=e[2*d],y=e[2*d+1];n(m,y,r,i)<=l&&u.push(t[d]);var v=(c+1)%2;(0===c?r-o<=m:i-o<=y)&&(s.push(p),s.push(d-1),s.push(v)),(0===c?r+o>=m:i+o>=y)&&(s.push(d+1),s.push(h),s.push(v))}}return u}function n(t,e,r,i){var n=t-r,o=e-i;return n*n+o*o}e.exports=i},{}],155:[function(t,e,r){function i(t){return!!t&&"object"==typeof t}function n(t,e){for(var r=-1,i=t.length;++rl))return!1;for(;++u-1&&t%1==0&&t<=c}function u(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function l(t){return!!t&&"object"==typeof t}var c=9007199254740991,h="[object Arguments]",p="[object Function]",f="[object GeneratorFunction]",d=Object.prototype,m=d.hasOwnProperty,y=d.toString,v=d.propertyIsEnumerable;e.exports=i},{}],159:[function(t,e,r){function i(t){return!!t&&"object"==typeof t}function n(t,e){var r=null==t?void 0:t[e];return u(r)?r:void 0}function o(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=g}function a(t){return s(t)&&m.call(t)==c}function s(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function u(t){return null!=t&&(a(t)?y.test(f.call(t)):i(t)&&h.test(t))}var l="[object Array]",c="[object Function]",h=/^\[object .+?Constructor\]$/,p=Object.prototype,f=Function.prototype.toString,d=p.hasOwnProperty,m=p.toString,y=RegExp("^"+f.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),v=n(Array,"isArray"),g=9007199254740991,_=v||function(t){return i(t)&&o(t.length)&&m.call(t)==l};e.exports=_},{}],160:[function(t,e,r){function i(t,e,r,i){r="function"==typeof r?o(r,i,3):void 0;var a=r?r(t,e):void 0;return void 0===a?n(t,e,r):!!a}var n=t("lodash._baseisequal"),o=t("lodash._bindcallback");e.exports=i},{"lodash._baseisequal":155,"lodash._bindcallback":156}],161:[function(t,e,r){function i(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=a}function n(t){return!!t&&"object"==typeof t}function o(t){return n(t)&&i(t.length)&&!!I[k.call(t)]}var a=9007199254740991,s="[object Arguments]",u="[object Array]",l="[object Boolean]",c="[object Date]",h="[object Error]",p="[object Function]",f="[object Map]",d="[object Number]",m="[object Object]",y="[object RegExp]",v="[object Set]",g="[object String]",_="[object WeakMap]",x="[object ArrayBuffer]",b="[object DataView]",w="[object Float32Array]",E="[object Float64Array]",T="[object Int8Array]",S="[object Int16Array]",z="[object Int32Array]",A="[object Uint8Array]",M="[object Uint8ClampedArray]",P="[object Uint16Array]",L="[object Uint32Array]",I={};I[w]=I[E]=I[T]=I[S]=I[z]=I[A]=I[M]=I[P]=I[L]=!0,I[s]=I[u]=I[x]=I[l]=I[b]=I[c]=I[h]=I[p]=I[f]=I[d]=I[m]=I[y]=I[v]=I[g]=I[_]=!1;var C=Object.prototype,k=C.toString;e.exports=o},{}],162:[function(t,e,r){function i(t){return function(e){return null==e?void 0:e[t]}}function n(t){return null!=t&&a(g(t))}function o(t,e){return t="number"==typeof t||f.test(t)?+t:-1,e=null==e?v:e,t>-1&&t%1==0&&t-1&&t%1==0&&t<=v}function s(t){for(var e=l(t),r=e.length,i=r&&t.length,n=!!i&&a(i)&&(p(t)||h(t)),s=-1,u=[];++s0;++iv?Math.pow(t,1/3):t/y+d}function n(t){return t>m?t*t*t:y*(t-d)}function o(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function a(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function s(t){var e=a(t[0]),r=a(t[1]),n=a(t[2]),o=i((.4124564*e+.3575761*r+.1804375*n)/h),s=i((.2126729*e+.7151522*r+.072175*n)/p),u=i((.0193339*e+.119192*r+.9503041*n)/f);return[116*s-16,500*(o-s),200*(s-u),t[3]]}function u(t){var e=(t[0]+16)/116,r=isNaN(t[1])?e:e+t[1]/500,i=isNaN(t[2])?e:e-t[2]/200;return e=p*n(e),r=h*n(r),i=f*n(i),[o(3.2404542*r-1.5371385*e-.4985314*i),o(-.969266*r+1.8760108*e+.041556*i),o(.0556434*r-.2040259*e+1.0572252*i),t[3]]}function l(t){var e=s(t),r=e[0],i=e[1],n=e[2],o=Math.atan2(n,i)*_;return[o<0?o+360:o,Math.sqrt(i*i+n*n),r,t[3]]}function c(t){var e=t[0]*g,r=t[1],i=t[2];return u([i,Math.cos(e)*r,Math.sin(e)*r,t[3]])}var h=.95047,p=1,f=1.08883,d=4/29,m=6/29,y=3*m*m,v=m*m*m,g=Math.PI/180,_=180/Math.PI;e.exports={lab:{forward:s,reverse:u},hcl:{forward:l,reverse:c}}},{}],164:[function(t,e,r){"use strict";function i(t){return t}function n(t,e){var r;if(p(t)){var l,c=t.stops&&"object"==typeof t.stops[0][0],h=c||void 0!==t.property,d=c||!h,m=t.stops&&typeof(c?t.stops[0][0].property:t.stops[0][0]),y=t.type||e||("string"===m?"categorical":"exponential");if("exponential"===y)l=s;else if("interval"===y)l=a;else if("categorical"===y)l=o;else{if("identity"!==y)throw new Error('Unknown function type "'+y+'"');l=u}var v;if(t.colorSpace&&"rgb"!==t.colorSpace){if(!f[t.colorSpace])throw new Error("Unknown color space: "+t.colorSpace);var g=f[t.colorSpace];t=JSON.parse(JSON.stringify(t));for(var _=0;_=t.stops.length)&&!(e<=t.stops[i][0]);)i++;return 0===i?t.stops[i][1]:i===t.stops.length?t.stops[i-1][1]:l(e,r,t.stops[i-1][0],t.stops[i][0],t.stops[i-1][1],t.stops[i][1])}function u(t,e){return e}function l(t,e,r,i,n,o){return"function"==typeof n?function(){var a=n.apply(void 0,arguments),s=o.apply(void 0,arguments);return l(t,e,r,i,a,s)}:n.length?h(t,e,r,i,n,o):c(t,e,r,i,n,o)}function c(t,e,r,i,n,o){var a,s=i-r,u=t-r;return a=1===e?u/s:(Math.pow(e,u)-1)/(Math.pow(e,s)-1),n*(1-a)+o*a}function h(t,e,r,i,n,o){for(var a=[],s=0;s7)return[new i(c,u,"constants have been deprecated as of v8")];if(!(u in p.constants))return[new i(c,u,'constant "%s" not found',u)];e=o({},e,{value:p.constants[u]})}return l.function&&"object"===n(u)?r(e):l.type&&s[l.type]?s[l.type](e):a(o({},e,{valueSpec:l.type?h[l.type]:l}))}},{"../error/validation_error":167,"../util/extend":169,"../util/get_type":170,"./validate_array":174,"./validate_boolean":175,"./validate_color":176,"./validate_constants":177,"./validate_enum":178,"./validate_filter":179,"./validate_function":180,"./validate_layer":182,"./validate_light":184,"./validate_number":185,"./validate_object":186,"./validate_source":188,"./validate_string":189}],174:[function(t,e,r){"use strict";var i=t("../util/get_type"),n=t("./validate"),o=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.valueSpec,a=t.style,s=t.styleSpec,u=t.key,l=t.arrayElementValidator||n;if("array"!==i(e))return[new o(u,e,"array expected, %s found",i(e))];if(r.length&&e.length!==r.length)return[new o(u,e,"array length %d expected, length %d found",r.length,e.length)];if(r["min-length"]&&e.length7)return r?[new i(e,r,"constants have been deprecated as of v8")]:[];var a=n(r);if("object"!==a)return[new i(e,r,"object expected, %s found",a)];var s=[];for(var u in r)"@"!==u[0]&&s.push(new i(e+"."+u,r[u],'constants must start with "@"'));return s}},{"../error/validation_error":167,"../util/get_type":170}],178:[function(t,e,r){"use strict";var i=t("../error/validation_error"),n=t("../util/unbundle_jsonlint");e.exports=function(t){var e=t.key,r=t.value,o=t.valueSpec,a=[];return Array.isArray(o.values)?o.values.indexOf(n(r))===-1&&a.push(new i(e,r,"expected one of [%s], %s found",o.values.join(", "),r)):Object.keys(o.values).indexOf(n(r))===-1&&a.push(new i(e,r,"expected one of [%s], %s found",Object.keys(o.values).join(", "),r)),a}},{"../error/validation_error":167,"../util/unbundle_jsonlint":172}],179:[function(t,e,r){"use strict";var i=t("../error/validation_error"),n=t("./validate_enum"),o=t("../util/get_type"),a=t("../util/unbundle_jsonlint");e.exports=function t(e){var r,s=e.value,u=e.key,l=e.styleSpec,c=[];if("array"!==o(s))return[new i(u,s,"array expected, %s found",o(s))];if(s.length<1)return[new i(u,s,"filter array must have at least 1 element")];switch(c=c.concat(n({key:u+"[0]",value:s[0],valueSpec:l.filter_operator,style:e.style,styleSpec:e.styleSpec})),a(s[0])){case"<":case"<=":case">":case">=":s.length>=2&&"$type"==s[1]&&c.push(new i(u,s,'"$type" cannot be use with operator "%s"',s[0]));case"==":case"!=":3!=s.length&&c.push(new i(u,s,'filter array for operator "%s" must have 3 elements',s[0]));case"in":case"!in":s.length>=2&&(r=o(s[1]),"string"!==r?c.push(new i(u+"[1]",s[1],"string expected, %s found",r)):"@"===s[1][0]&&c.push(new i(u+"[1]",s[1],"filter key cannot be a constant")));for(var h=2;hl(r[0].zoom))return[new i(s,r[0].zoom,"stop zoom values must appear in ascending order")];l(r[0].zoom)!==f&&(f=l(r[0].zoom),p=void 0),e=e.concat(a({key:s+"[0]",value:r[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:u,value:c}}))}else e=e.concat(c({key:s+"[0]",value:r[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec}));return e=e.concat(o({key:s+"[1]",value:r[1],valueSpec:d,style:t.style,styleSpec:t.styleSpec})),"number"===n(r[0])&&"piecewise-constant"===d.function&&r[0]%1!==0&&e.push(new i(s+"[0]",r[0],"zoom level for piecewise-constant functions must be an integer")),e}function c(t){var e=n(t.value),r=l(t.value);if(h){if(e!==h)return[new i(t.key,t.value,"%s stop domain type must match previous stop domain type %s",e,h)]}else h=e,m||"string"!==e||(m="categorical");return"number"!==e&&"string"!==e?[new i(t.key,t.value,"property value must be a number or string")]:"number"!==e&&"categorical"!==m?[new i(t.key,t.value,"number expected, %s found",e)]:"categorical"!==m||"number"!==e||isFinite(r)&&Math.floor(r)===r?"number"===e&&void 0!==p&&r=8&&(g&&!t.valueSpec["property-function"]?x.push(new i(t.key,t.value,"property functions not supported")):v&&!t.valueSpec["zoom-function"]&&x.push(new i(t.key,t.value,"zoom functions not supported"))),"categorical"!==m&&!_||void 0!==t.value.property||x.push(new i(t.key,t.value,'"property" property is required')),x}},{"../error/validation_error":167,"../util/get_type":170,"../util/unbundle_jsonlint":172,"./validate":173,"./validate_array":174,"./validate_number":185,"./validate_object":186}],181:[function(t,e,r){"use strict";var i=t("../error/validation_error"),n=t("./validate_string");e.exports=function(t){var e=t.value,r=t.key,o=n(t);return o.length?o:(e.indexOf("{fontstack}")===-1&&o.push(new i(r,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&o.push(new i(r,e,'"glyphs" url must include a "{range}" token')),o)}},{"../error/validation_error":167,"./validate_string":189}],182:[function(t,e,r){"use strict";var i=t("../error/validation_error"),n=t("../util/unbundle_jsonlint"),o=t("./validate_object"),a=t("./validate_filter"),s=t("./validate_paint_property"),u=t("./validate_layout_property"),l=t("../util/extend");e.exports=function(t){var e=[],r=t.value,c=t.key,h=t.style,p=t.styleSpec;r.type||r.ref||e.push(new i(c,r,'either "type" or "ref" is required'));var f=n(r.type),d=n(r.ref);if(r.id)for(var m=0;mo.maximum?[new n(e,r,"%s is greater than the maximum value %s",r,o.maximum)]:[]}},{"../error/validation_error":167,"../util/get_type":170}],186:[function(t,e,r){"use strict";var i=t("../error/validation_error"),n=t("../util/get_type"),o=t("./validate");e.exports=function(t){var e=t.key,r=t.value,a=t.valueSpec||{},s=t.objectElementValidators||{},u=t.style,l=t.styleSpec,c=[],h=n(r);if("object"!==h)return[new i(e,r,"object expected, %s found",h)];for(var p in r){var f,d=p.split(".")[0],m=a[d]||a["*"];if(s[d])f=s[d];else if(a[d])f=o;else if(s["*"])f=s["*"];else{if(!a["*"]){c.push(new i(e,r[p],'unknown property "%s"',p));continue}f=o}c=c.concat(f({key:(e?e+".":e)+p,value:r[p],valueSpec:m,style:u,styleSpec:l,object:r,objectKey:p}))}for(d in a)a[d].required&&void 0===a[d].default&&void 0===r[d]&&c.push(new i(e,r,'missing required property "%s"',d));return c}},{"../error/validation_error":167,"../util/get_type":170,"./validate":173}],187:[function(t,e,r){"use strict";var i=t("./validate"),n=t("../error/validation_error");e.exports=function(t){var e=t.key,r=t.style,o=t.styleSpec,a=t.value,s=t.objectKey,u=o["paint_"+t.layerType];if(!u)return[];var l=s.match(/^(.*)-transition$/);return l&&u[l[1]]&&u[l[1]].transition?i({key:e,value:a,valueSpec:o.transition,style:r,styleSpec:o}):t.valueSpec||u[s]?i({key:t.key,value:a,valueSpec:t.valueSpec||u[s],style:r,styleSpec:o}):[new n(e,a,'unknown property "%s"',s)]}},{"../error/validation_error":167,"./validate":173}],188:[function(t,e,r){"use strict";var i=t("../error/validation_error"),n=t("../util/unbundle_jsonlint"),o=t("./validate_object"),a=t("./validate_enum");e.exports=function(t){var e=t.value,r=t.key,s=t.styleSpec,u=t.style;if(!e.type)return[new i(r,e,'"type" is required')];var l=n(e.type);switch(l){case"vector":case"raster":var c=[];if(c=c.concat(o({key:r,value:e,valueSpec:s.source_tile,style:t.style,styleSpec:s})),"url"in e)for(var h in e)["type","url","tileSize"].indexOf(h)<0&&c.push(new i(r+"."+h,e[h],'a source with a "url" property may not include a "%s" property',h));return c;case"geojson":return o({key:r,value:e,valueSpec:s.source_geojson,style:u,styleSpec:s});case"video":return o({key:r,value:e,valueSpec:s.source_video,style:u,styleSpec:s});case"image":return o({key:r,value:e,valueSpec:s.source_image,style:u,styleSpec:s});case"canvas":return o({key:r,value:e,valueSpec:s.source_canvas,style:u,styleSpec:s});default:return a({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","geojson","video","image","canvas"]},style:u,styleSpec:s})}}},{"../error/validation_error":167,"../util/unbundle_jsonlint":172,"./validate_enum":178,"./validate_object":186}],189:[function(t,e,r){"use strict";var i=t("../util/get_type"),n=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.key,o=i(e);return"string"!==o?[new n(r,e,"string expected, %s found",o)]:[]}},{"../error/validation_error":167,"../util/get_type":170}],190:[function(t,e,r){"use strict";function i(t,e){e=e||u;var r=[];return r=r.concat(s({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:l,"*":function(){return[]}}})),e.$version>7&&t.constants&&(r=r.concat(a({key:"constants",value:t.constants,style:t,styleSpec:e}))),n(r)}function n(t){return[].concat(t).sort(function(t,e){return t.line-e.line})}function o(t){return function(){return n(t.apply(this,arguments))}}var a=t("./validate/validate_constants"),s=t("./validate/validate"),u=t("../reference/latest.min"),l=t("./validate/validate_glyphs_url");i.source=o(t("./validate/validate_source")),i.light=o(t("./validate/validate_light")),i.layer=o(t("./validate/validate_layer")),i.filter=o(t("./validate/validate_filter")),i.paintProperty=o(t("./validate/validate_paint_property")),i.layoutProperty=o(t("./validate/validate_layout_property")),e.exports=i},{"../reference/latest.min":191,"./validate/validate":173,"./validate/validate_constants":177,"./validate/validate_filter":179,"./validate/validate_glyphs_url":181,"./validate/validate_layer":182,"./validate/validate_layout_property":183,"./validate/validate_light":184,"./validate/validate_paint_property":187,"./validate/validate_source":188}],191:[function(t,e,r){e.exports=t("./v8.min.json")},{"./v8.min.json":192}],192:[function(t,e,r){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"},light:{type:"light"},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_canvas"],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:18},buffer:{type:"number",default:128,maximum:512,minimum:0},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},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"}}},source_canvas:{type:{required:!0,type:"enum",values:{canvas:{}}},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}},animate:{type:"boolean",default:"true"},canvas:{type:"string",required:!0}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},"fill-extrusion":{},raster:{},background:{}}},metadata:{type:"*"},ref:{type:"string"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"},"paint.*":{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_fill-extrusion","layout_symbol","layout_raster","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},layout_fill:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},layout_circle:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},layout_line:{"line-cap":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{butt:{},round:{},square:{}},default:"butt"},"line-join":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{bevel:{},round:{},miter:{}},default:"miter"},"line-miter-limit":{type:"number",default:2,function:"interpolated","zoom-function":!0,requires:[{"line-join":"miter"}]},"line-round-limit":{type:"number",default:1.05,function:"interpolated","zoom-function":!0,requires:[{"line-join":"round"}]},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},layout_symbol:{"symbol-placement":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{point:{},line:{}},default:"point"},"symbol-spacing":{type:"number",default:250,minimum:1,function:"interpolated","zoom-function":!0,units:"pixels",requires:[{"symbol-placement":"line"}]},"symbol-avoid-edges":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1},"icon-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,requires:["icon-image"]},"icon-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,requires:["icon-image"]},"icon-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,requires:["icon-image","text-field"]},"icon-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"]},"icon-size":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,requires:["icon-image"]},"icon-text-fit":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{none:{},width:{},height:{},both:{}},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,requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}]},"icon-image":{type:"string",function:"piecewise-constant","zoom-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,units:"pixels",requires:["icon-image"]},"icon-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-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,values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"]},"text-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"]},"text-field":{type:"string",function:"piecewise-constant","zoom-function":!0,default:"",tokens:!0},"text-font":{type:"array",value:"string",function:"piecewise-constant","zoom-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,requires:["text-field"]},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",function:"interpolated","zoom-function":!0,requires:["text-field"]},"text-line-height":{type:"number",default:1.2,units:"ems",function:"interpolated","zoom-function":!0,requires:["text-field"]},"text-letter-spacing":{type:"number",default:0,units:"ems",function:"interpolated","zoom-function":!0,requires:["text-field"]},"text-justify":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{left:{},center:{},right:{}},default:"center",requires:["text-field"]},"text-anchor":{type:"enum",function:"piecewise-constant","zoom-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,requires:["text-field",{"symbol-placement":"line"}]},"text-rotate":{type:"number",default:0,period:360,units:"degrees",function:"interpolated","zoom-function":!0,requires:["text-field"]},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,requires:["text-field"]},"text-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":"line"}]},"text-transform":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"]},"text-offset":{type:"array",value:"number",units:"ems",function:"interpolated","zoom-function":!0,length:2,default:[0,0],requires:["text-field"]},"text-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,requires:["text-field"]},"text-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,requires:["text-field"]},"text-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,requires:["text-field","icon-image"]},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},layout_raster:{visibility:{type:"enum",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:{}}},function:{stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"}},function_stop:{type:"array",minimum:0,maximum:22,value:["number","color"],length:2},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},transition:!1},position:{type:"array",default:[1.15,210,30],length:3,value:"number",transition:!0,function:"interpolated","zoom-function":!0,"property-function":!1},color:{type:"color",default:"#ffffff",function:"interpolated","zoom-function":!0,"property-function":!1,transition:!0},intensity:{type:"number",default:.5,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!1,transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_fill-extrusion","paint_symbol","paint_raster","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",function:"piecewise-constant","zoom-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,transition:!0,units:"pixels"},"fill-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["fill-translate"]},"fill-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!1,default:1,minimum:0,maximum:1,transition:!0},"fill-extrusion-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-extrusion-pattern"}]},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels"},"fill-extrusion-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"]},"fill-extrusion-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0},"fill-extrusion-height":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:0,minimum:0,units:"meters",transition:!0},"fill-extrusion-base":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"]}},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,transition:!0,units:"pixels"},"line-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["line-translate"]},"line-width":{type:"number",default:1,minimum:0,function:"interpolated","zoom-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,minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}]},"line-pattern":{type:"string",function:"piecewise-constant","zoom-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,transition:!0,units:"pixels"},"circle-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["circle-translate"]},"circle-pitch-scale":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map"},"circle-stroke-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-stroke-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0,requires:["icon-image"]},"icon-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-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,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-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,transition:!0,requires:["text-field"]},"text-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,transition:!0,requires:["text-field"]},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,transition:!0,requires:["text-field"]},"text-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-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,transition:!0,units:"pixels",requires:["text-field"]},"text-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-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"}}}},{}],193:[function(t,e,r){"use strict";function i(t){return!!(n()&&o()&&a()&&s()&&u()&&l()&&c()&&h(t&&t.failIfMajorPerformanceCaveat))}function n(){return"undefined"!=typeof window&&"undefined"!=typeof document}function o(){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 a(){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 u(){return"JSON"in window&&"parse"in JSON&&"stringify"in JSON}function l(){return"Worker"in window}function c(){return"Uint8ClampedArray"in window}function h(t){return void 0===f[t]&&(f[t]=p(t)),f[t]}function p(t){var e=document.createElement("canvas"),r=Object.create(i.webGLContextAttributes);return r.failIfMajorPerformanceCaveat=t,e.probablySupportsContext?e.probablySupportsContext("webgl",r)||e.probablySupportsContext("experimental-webgl",r):e.supportsContext?e.supportsContext("webgl",r)||e.supportsContext("experimental-webgl",r):e.getContext("webgl",r)||e.getContext("experimental-webgl",r)}"undefined"!=typeof e&&e.exports?e.exports=i:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=i);var f={};i.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}},{}],194:[function(t,e,r){(function(t){function e(t,e){for(var r=0,i=t.length-1;i>=0;i--){var n=t[i];"."===n?t.splice(i,1):".."===n?(t.splice(i,1),r++):r&&(t.splice(i,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function i(t,e){if(t.filter)return t.filter(e);for(var r=[],i=0;i=-1&&!n;o--){var a=o>=0?arguments[o]:t.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(r=a+"/"+r,n="/"===a.charAt(0))}return r=e(i(r.split("/"),function(t){return!!t}),!n).join("/"),(n?"/":"")+r||"."},r.normalize=function(t){var n=r.isAbsolute(t),o="/"===a(t,-1);return t=e(i(t.split("/"),function(t){return!!t}),!n).join("/"),t||n||(t="."),t&&o&&(t+="/"),(n?"/":"")+t},r.isAbsolute=function(t){return"/"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(i(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},r.relative=function(t,e){function i(t){for(var e=0;e=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=r.resolve(t).substr(1),e=r.resolve(e).substr(1);for(var n=i(t.split("/")),o=i(e.split("/")),a=Math.min(n.length,o.length),s=a,u=0;u55295&&e<57344){if(!r){e>56319||o+1===i?n.push(239,191,189):r=e;continue}if(e<56320){n.push(239,191,189),r=e;continue}e=r-55296<<10|e-56320|65536,r=null}else r&&(n.push(239,191,189),r=null);e<128?n.push(e):e<2048?n.push(e>>6|192,63&e|128):e<65536?n.push(e>>12|224,e>>6&63|128,63&e|128):n.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}return n}e.exports=i;var o,a,s,u=t("ieee754");o={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 u.read(this,t,!0,23,4)},readDoubleLE:function(t){return u.read(this,t,!0,52,8)},writeFloatLE:function(t,e){return u.write(this,t,e,!0,23,4)},writeDoubleLE:function(t,e){return u.write(this,t,e,!0,52,8)},toString:function(t,e,r){var i="",n="";e=e||0,r=Math.min(this.length,r||this.length);for(var o=e;o=1;){if(e.pos>=r)throw new Error("Given varint doesn't fit into 10 bytes");var i=255&t;e.buf[e.pos++]=i|(t>=128?128:0),t/=128}}function a(t,e,r){var i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.ceil(Math.log(e)/(7*Math.LN2));r.realloc(i);for(var n=r.pos-1;n>=t;n--)r.buf[n+i]=r.buf[n]}function s(t,e){for(var r=0;r>3,o=this.pos;t(n,e,this),this.pos===o&&this.skip(i)}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,r=this.buf;return e=r[this.pos++],t=127&e,e<128?t:(e=r[this.pos++],t|=(127&e)<<7,e<128?t:(e=r[this.pos++],t|=(127&e)<<14,e<128?t:(e=r[this.pos++],t|=(127&e)<<21,e<128?t:n(t,this))))},readVarint64:function(){var t=this.pos,e=this.readVarint();if(e<_)return e;for(var r=this.pos-2;255===this.buf[r];)r--;r127;);else if(e===i.Bytes)this.pos=this.readVarint()+this.pos;else if(e===i.Fixed32)this.pos+=4;else{if(e!==i.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 o(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=y.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 r=0;r=128&&a(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i},writeMessage:function(t,e,r){this.writeTag(t,i.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){this.writeMessage(t,s,e)},writePackedSVarint:function(t,e){this.writeMessage(t,u,e)},writePackedBoolean:function(t,e){this.writeMessage(t,h,e)},writePackedFloat:function(t,e){this.writeMessage(t,l,e)},writePackedDouble:function(t,e){this.writeMessage(t,c,e)},writePackedFixed32:function(t,e){this.writeMessage(t,p,e)},writePackedSFixed32:function(t,e){this.writeMessage(t,f,e)},writePackedFixed64:function(t,e){this.writeMessage(t,d,e)},writePackedSFixed64:function(t,e){this.writeMessage(t,m,e)},writeBytesField:function(t,e){this.writeTag(t,i.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,i.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,i.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,i.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,i.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,i.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,i.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,i.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,i.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,i.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}}).call(this,"undefined"!=typeof r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./buffer":195}],197:[function(t,e,r){"use strict";function i(t,e){this.x=t,this.y=e}e.exports=i,i.prototype={clone:function(){return new i(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,r=t.y-this.y;return e*e+r*r},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,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,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),r=Math.sin(t),i=e*this.x-r*this.y,n=r*this.x+e*this.y;return this.x=i,this.y=n,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},i.convert=function(t){return t instanceof i?t:Array.isArray(t)?new i(t[0],t[1]):t}},{}],198:[function(t,e,r){function i(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function o(t){if(h===setTimeout)return setTimeout(t,0);if((h===i||!h)&&setTimeout)return h=setTimeout,setTimeout(t,0);try{return h(t,0)}catch(e){try{return h.call(null,t,0)}catch(e){return h.call(this,t,0)}}}function a(t){if(p===clearTimeout)return clearTimeout(t);if((p===n||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(t);try{return p(t)}catch(e){try{return p.call(null,t)}catch(e){return p.call(this,t)}}}function s(){y&&d&&(y=!1,d.length?m=d.concat(m):v=-1,m.length&&u())}function u(){if(!y){var t=o(s);y=!0;for(var e=m.length;e;){for(d=m,m=[];++v1)for(var r=1;rr;){if(a-r>600){var u=a-r+1,l=e-r+1,c=Math.log(u),h=.5*Math.exp(2*c/3),p=.5*Math.sqrt(c*h*(u-h)/u)*(l-u/2<0?-1:1),f=Math.max(r,Math.floor(e-l*h/u+p)),d=Math.min(a,Math.floor(e+(u-l)*h/u+p));i(t,e,f,d,s)}var m=t[e],y=r,v=a;for(n(t,r,e),s(t[a],m)>0&&n(t,r,a);y0;)v--}0===s(t[r],m)?n(t,r,v):(v++,n(t,v,a)),v<=e&&(r=v+1),e<=v&&(a=v-1)}}function n(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function o(t,e){return te?1:0}e.exports=i},{}],200:[function(e,r,i){!function(e,n){"object"==typeof i&&"undefined"!=typeof r?r.exports=n():"function"==typeof t&&t.amd?t(n):e.ShelfPack=n()}(this,function(){function t(t,e,r){r=r||{},this.w=t||64,this.h=e||64,this.autoResize=!!r.autoResize,this.shelves=[],this.stats={},this.count=function(t){this.stats[t]=(0|this.stats[t])+1}}function e(t,e,r){this.x=0,this.y=t,this.w=this.free=e,this.h=r}return t.prototype.pack=function(t,e){t=[].concat(t),e=e||{};for(var r,i,n,o=[],a=0;a0){for(var s=0,u=0,l=0;li.h||t>i.free||rc)&&(h=2*Math.max(t,c)),(uu)&&(l=2*Math.max(r,u)),this.resize(h,l),this.packOne(t,r)}return null},t.prototype.clear=function(){this.shelves=[],this.stats={}},t.prototype.resize=function(t,e){this.w=t,this.h=e;for(var r=0;rthis.free||e>this.h)return null;var r=this.x;return this.x+=t,this.free-=t,{x:r,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})},{}],201:[function(t,e,r){"use strict";function i(t){return new n(t)}function n(t){this.options=f(Object.create(this.options),t),this.trees=new Array(this.options.maxZoom+1)}function o(t,e,r,i){return{x:t,y:e,zoom:1/0,id:i,numPoints:r}}function a(t,e){var r=t.geometry.coordinates;return o(l(r[0]),c(r[1]),1,e)}function s(t){return{type:"Feature",properties:u(t),geometry:{type:"Point",coordinates:[h(t.x),p(t.y)]}}}function u(t){var e=t.numPoints,r=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:r}}function l(t){return t/360+.5}function c(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function h(t){return 360*(t-.5)}function p(t){var e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function f(t,e){for(var r in e)t[r]=e[r];return t}function d(t){return t.x}function m(t){return t.y}var y=t("kdbush");e.exports=i,n.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 r="prepare "+t.length+" points";e&&console.time(r),this.points=t;var i=t.map(a);e&&console.timeEnd(r);for(var n=this.options.maxZoom;n>=this.options.minZoom;n--){var o=+Date.now();this.trees[n+1]=y(i,d,m,this.options.nodeSize,Float32Array),i=this._cluster(i,n),e&&console.log("z%d: %d clusters in %dms",n,i.length,+Date.now()-o)}return this.trees[this.options.minZoom]=y(i,d,m,this.options.nodeSize,Float32Array),e&&console.timeEnd("total time"),this},getClusters:function(t,e){for(var r=this.trees[this._limitZoom(e)],i=r.range(l(t[0]),c(t[3]),l(t[2]),c(t[1])),n=[],o=0;o=0;r--)this._down(r)}function n(t,e){return te?1:0}function o(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}e.exports=i,i.prototype={push:function(t){this.data.push(t),this.length++,this._up(this.length-1)},pop:function(){var t=this.data[0];return this.data[0]=this.data[this.length-1],this.length--,this.data.pop(),this._down(0),t},peek:function(){return this.data[0]},_up:function(t){for(var e=this.data,r=this.compare;t>0;){var i=Math.floor((t-1)/2);if(!(r(e[t],e[i])<0))break;o(e,i,t),t=i}},_down:function(t){for(var e=this.data,r=this.compare,i=this.length;;){var n=2*t+1,a=n+1,s=t;if(n=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),m(e)?r.showHidden=e:e&&i._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=o),u(r,t,r.depth)}function o(t,e){var r=n.styles[e];return r?"["+n.colors[r][0]+"m"+t+"["+n.colors[r][1]+"m":t}function a(t,e){return t}function s(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}function u(t,e,r){if(t.customInspect&&e&&z(e.inspect)&&e.inspect!==i.inspect&&(!e.constructor||e.constructor.prototype!==e)){var n=e.inspect(r,t);return _(n)||(n=u(t,n,r)),n}var o=l(t,e);if(o)return o;var a=Object.keys(e),m=s(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(e)),S(e)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return c(e);if(0===a.length){if(z(e)){var y=e.name?": "+e.name:"";return t.stylize("[Function"+y+"]","special")}if(w(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(T(e))return t.stylize(Date.prototype.toString.call(e),"date");if(S(e))return c(e)}var v="",g=!1,x=["{","}"];if(d(e)&&(g=!0,x=["[","]"]),z(e)){var b=e.name?": "+e.name:"";v=" [Function"+b+"]"}if(w(e)&&(v=" "+RegExp.prototype.toString.call(e)),T(e)&&(v=" "+Date.prototype.toUTCString.call(e)),S(e)&&(v=" "+c(e)),0===a.length&&(!g||0==e.length))return x[0]+v+x[1];if(r<0)return w(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var E;return E=g?h(t,e,r,m,a):a.map(function(i){return p(t,e,r,m,i,g)}),t.seen.pop(),f(E,v,x)}function l(t,e){if(b(e))return t.stylize("undefined","undefined");if(_(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return g(e)?t.stylize(""+e,"number"):m(e)?t.stylize(""+e,"boolean"):y(e)?t.stylize("null","null"):void 0}function c(t){return"["+Error.prototype.toString.call(t)+"]"}function h(t,e,r,i,n){for(var o=[],a=0,s=e.length;a-1&&(s=o?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(a)){if(o&&n.match(/^\d+$/))return s;a=JSON.stringify(""+n),a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function f(t,e,r){var i=0,n=t.reduce(function(t,e){return i++,e.indexOf("\n")>=0&&i++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);return n>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}function d(t){return Array.isArray(t)}function m(t){return"boolean"==typeof t}function y(t){return null===t}function v(t){return null==t}function g(t){return"number"==typeof t}function _(t){return"string"==typeof t}function x(t){return"symbol"==typeof t}function b(t){return void 0===t}function w(t){return E(t)&&"[object RegExp]"===M(t)}function E(t){return"object"==typeof t&&null!==t}function T(t){return E(t)&&"[object Date]"===M(t)}function S(t){return E(t)&&("[object Error]"===M(t)||t instanceof Error)}function z(t){return"function"==typeof t}function A(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t}function M(t){return Object.prototype.toString.call(t)}function P(t){return t<10?"0"+t.toString(10):t.toString(10)}function L(){var t=new Date,e=[P(t.getHours()),P(t.getMinutes()),P(t.getSeconds())].join(":");return[t.getDate(),D[t.getMonth()],e].join(" ")}function I(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var C=/%[sdj%]/g;i.format=function(t){if(!_(t)){for(var e=[],r=0;r=o)return t;switch(t){case"%s":return String(i[r++]);case"%d":return Number(i[r++]);case"%j":try{return JSON.stringify(i[r++])}catch(t){return"[Circular]"}default:return t}}),s=i[r];r>3}if(n--,1===i||2===i)o+=t.readSVarint(),a+=t.readSVarint(),1===i&&(e&&s.push(e),e=[]),e.push(new u(o,a));else{if(7!==i)throw new Error("unknown command "+i);e&&e.push(e[0].clone())}}return e&&s.push(e),s},i.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,i=0,n=0,o=0,a=1/0,s=-(1/0),u=1/0,l=-(1/0);t.pos>3}if(i--,1===r||2===r)n+=t.readSVarint(),o+=t.readSVarint(),ns&&(s=n),ol&&(l=o);else if(7!==r)throw new Error("unknown command "+r)}return[a,u,s,l]},i.prototype.toGeoJSON=function(t,e,r){function n(t){for(var e=0;e>3;e=1===i?t.readString():2===i?t.readFloat():3===i?t.readDouble():4===i?t.readVarint64():5===i?t.readVarint():6===i?t.readSVarint():7===i?t.readBoolean():null}return e}var a=t("./vectortilefeature.js");e.exports=i,i.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 a(this._pbf,e,this.extent,this._keys,this._values)}},{"./vectortilefeature.js":208}],210:[function(t,e,r){function i(t){var e=[];for(var r in t.layers)e.push(o(t.layers[r]));var i=new c;return h.tile.write({layers:e},i),i.finish()}function n(t){var e={};for(var r in t)e[r]=new p(t[r].features),e[r].name=r;return i({layers:e})}function o(t){for(var e={name:t.name||"",version:t.version||1,extent:t.extent||4096,keys:[],values:[],features:[]},r={},i={},n=0;n>31}function u(t){for(var e=[],r=0,i=0,n=t.length,o=0;o1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=t.dataset.latitude,o=t.dataset.longitude,l=t.dataset.id,c=window["geojson"+l];if(null==c&&(c={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[o,i]},properties:{title:"Current Location",icon:"circle-stroked",uri:"current-location"}}]}),null!=n){var h=!0,f=!1,d=void 0;try{for(var m,y=n[Symbol.iterator]();!(h=(m=y.next()).done);h=!0){var v=m.value,g=r.i(s.a)(v.location).longitude,_=r.i(s.a)(v.location).latitude;c.features.push({type:"Feature",geometry:{type:"Point",coordinates:[g,_]},properties:{title:v.name,icon:"circle",uri:v.slug}})}}catch(t){f=!0,d=t}finally{try{!h&&y.return&&y.return()}finally{if(f)throw d}}}if(null!=e){e.coords.longitude,e.coords.latitude}var map=new a.a.Map({container:t,style:"mapbox://styles/mapbox/streets-v9",center:[o,i],zoom:15});if(null==e&&map.scrollZoom.disable(),map.addControl(new a.a.NavigationControl),t.appendChild(p(map)),map.on("load",function(){map.addSource("points",{type:"geojson",data:c}),map.addLayer({id:"points",interactive:!0,type:"symbol",source:"points",layout:{"icon-image":"{icon}-15","text-field":"{title}","text-offset":[0,1]}})}),null!=e&&map.on("click",function(t){var e=map.queryRenderedFeatures(t.point,{layer:["points"]});e.length&&(map.flyTo({center:e[0].geometry.coordinates}),r.i(u.a)(e[0].properties.uri))}),c.features&&c.features.length>1){var x=new a.a.LngLatBounds,b=!0,w=!1,E=void 0;try{for(var T,S=c.features[Symbol.iterator]();!(b=(T=S.next()).done);b=!0){var z=T.value;x.extend(z.geometry.coordinates)}}catch(t){w=!0,E=t}finally{try{!b&&S.return&&S.return()}finally{if(w)throw E}}map.fitBounds(x,{padding:65})}return map}var o=r(9),a=r.n(o),s=r(1),u=r(4);e.a=i,a.a.accessToken="pk.eyJ1Ijoiam9ubnliYXJuZXMiLCJhIjoiY2l2cDhjYW04MDAwcjJ0cG1uZnhqcm82ayJ9.qA2zeVA-nsoMh9IFrd5KQw";var l=function(t){return t.split("-").map(function(t){var e=n(t),r=e[0],i=e.slice(1);return r.toUpperCase()+i.join("").toLowerCase()}).join(" ")},c=function(map,t,e){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=document.createElement("input");n.setAttribute("id",e),n.setAttribute("type","radio"),n.setAttribute("name","toggle"),n.setAttribute("value",e),1==r&&n.setAttribute("checked","checked"),n.addEventListener("click",function(){map.setStyle("mapbox://styles/mapbox/"+e+"-v9")});var i=document.createElement("label");i.setAttribute("for",e),i.appendChild(document.createTextNode(l(e))),t.appendChild(n),t.appendChild(i)},p=function(map){var t=document.createElement("div");return t.classList.add("map-menu"),c(map,t,"streets",!0),c(map,t,"satellite-streets"),t}},function(t,e,r){(function(t){var n;!function(){"use strict";function i(){var t={parent:document.body,version:"1.0.12",defaultOkLabel:"Ok",okLabel:"Ok",defaultCancelLabel:"Cancel",cancelLabel:"Cancel",defaultMaxLogItems:2,maxLogItems:2,promptValue:"",promptPlaceholder:"",closeLogOnClick:!1,closeLogOnClickDefault:!1,delay:5e3,defaultDelay:5e3,logContainerClass:"alertify-logs",logContainerDefaultClass:"alertify-logs",dialogs:{buttons:{holder:"",ok:"",cancel:""},input:"",message:"

{{message}}

",log:"
{{message}}
"},defaultDialogs:{buttons:{holder:"",ok:"",cancel:""},input:"",message:"

{{message}}

",log:"
{{message}}
"},build:function(t){var e=this.dialogs.buttons.ok,r="
"+this.dialogs.message.replace("{{message}}",t.message);return"confirm"!==t.type&&"prompt"!==t.type||(e=this.dialogs.buttons.cancel+this.dialogs.buttons.ok),"prompt"===t.type&&(r+=this.dialogs.input),r=(r+this.dialogs.buttons.holder+"
").replace("{{buttons}}",e).replace("{{ok}}",this.okLabel).replace("{{cancel}}",this.cancelLabel)},setCloseLogOnClick:function(t){this.closeLogOnClick=!!t},close:function(t,e){this.closeLogOnClick&&t.addEventListener("click",function(){a(t)}),e=e&&!isNaN(+e)?+e:this.delay,0>e?a(t):e>0&&setTimeout(function(){a(t)},e)},dialog:function(t,e,r,n){return this.setup({type:e,message:t,onOkay:r,onCancel:n})},log:function(t,e,r){var n=document.querySelectorAll(".alertify-logs > div");if(n){var i=n.length-this.maxLogItems;if(i>=0)for(var o=0,a=i+1;a>o;o++)this.close(n[o],-1)}this.notify(t,e,r)},setLogPosition:function(t){this.logContainerClass="alertify-logs "+t},setupLogContainer:function(){var t=document.querySelector(".alertify-logs"),e=this.logContainerClass;return t||(t=document.createElement("div"),t.className=e,this.parent.appendChild(t)),t.className!==e&&(t.className=e),t},notify:function(e,r,n){var i=this.setupLogContainer(),o=document.createElement("div");o.className=r||"default",t.logTemplateMethod?o.innerHTML=t.logTemplateMethod(e):o.innerHTML=e,"function"==typeof n&&o.addEventListener("click",n),i.appendChild(o),setTimeout(function(){o.className+=" show"},10),this.close(o,this.delay)},setup:function(t){function e(e){"function"!=typeof e&&(e=function(){}),n&&n.addEventListener("click",function(n){t.onOkay&&"function"==typeof t.onOkay&&(o?t.onOkay(o.value,n):t.onOkay(n)),e(o?{buttonClicked:"ok",inputValue:o.value,event:n}:{buttonClicked:"ok",event:n}),a(r)}),i&&i.addEventListener("click",function(n){t.onCancel&&"function"==typeof t.onCancel&&t.onCancel(n),e({buttonClicked:"cancel",event:n}),a(r)}),o&&o.addEventListener("keyup",function(t){13===t.which&&n.click()})}var r=document.createElement("div");r.className="alertify hide",r.innerHTML=this.build(t);var n=r.querySelector(".ok"),i=r.querySelector(".cancel"),o=r.querySelector("input"),s=r.querySelector("label");o&&("string"==typeof this.promptPlaceholder&&(s?s.textContent=this.promptPlaceholder:o.placeholder=this.promptPlaceholder),"string"==typeof this.promptValue&&(o.value=this.promptValue));var u;return"function"==typeof Promise?u=new Promise(e):e(),this.parent.appendChild(r),setTimeout(function(){r.classList.remove("hide"),o&&t.type&&"prompt"===t.type?(o.select(),o.focus()):n&&n.focus()},100),u},okBtn:function(t){return this.okLabel=t,this},setDelay:function(t){return t=t||0,this.delay=isNaN(t)?this.defaultDelay:parseInt(t,10),this},cancelBtn:function(t){return this.cancelLabel=t,this},setMaxLogItems:function(t){this.maxLogItems=parseInt(t||this.defaultMaxLogItems)},theme:function(t){switch(t.toLowerCase()){case"bootstrap":this.dialogs.buttons.ok="",this.dialogs.buttons.cancel="",this.dialogs.input="";break;case"purecss":this.dialogs.buttons.ok="",this.dialogs.buttons.cancel="";break;case"mdl":case"material-design-light":this.dialogs.buttons.ok="",this.dialogs.buttons.cancel="",this.dialogs.input="
";break;case"angular-material":this.dialogs.buttons.ok="",this.dialogs.buttons.cancel="",this.dialogs.input="
";break;case"default":default:this.dialogs.buttons.ok=this.defaultDialogs.buttons.ok,this.dialogs.buttons.cancel=this.defaultDialogs.buttons.cancel,this.dialogs.input=this.defaultDialogs.input}},reset:function(){this.parent=document.body,this.theme("default"),this.okBtn(this.defaultOkLabel),this.cancelBtn(this.defaultCancelLabel),this.setMaxLogItems(),this.promptValue="",this.promptPlaceholder="",this.delay=this.defaultDelay,this.setCloseLogOnClick(this.closeLogOnClickDefault),this.setLogPosition("bottom left"),this.logTemplateMethod=null},injectCSS:function(){if(!document.querySelector("#alertifyCSS")){var t=document.getElementsByTagName("head")[0],e=document.createElement("style");e.type="text/css",e.id="alertifyCSS",e.innerHTML=".alertify-logs>*{padding:12px 24px;color:#fff;box-shadow:0 2px 5px 0 rgba(0,0,0,.2);border-radius:1px}.alertify-logs>*,.alertify-logs>.default{background:rgba(0,0,0,.8)}.alertify-logs>.error{background:rgba(244,67,54,.8)}.alertify-logs>.success{background:rgba(76,175,80,.9)}.alertify{position:fixed;background-color:rgba(0,0,0,.3);left:0;right:0;top:0;bottom:0;width:100%;height:100%;z-index:1}.alertify.hide{opacity:0;pointer-events:none}.alertify,.alertify.show{box-sizing:border-box;transition:all .33s cubic-bezier(.25,.8,.25,1)}.alertify,.alertify *{box-sizing:border-box}.alertify .dialog{padding:12px}.alertify .alert,.alertify .dialog{width:100%;margin:0 auto;position:relative;top:50%;transform:translateY(-50%)}.alertify .alert>*,.alertify .dialog>*{width:400px;max-width:95%;margin:0 auto;text-align:center;padding:12px;background:#fff;box-shadow:0 2px 4px -1px rgba(0,0,0,.14),0 4px 5px 0 rgba(0,0,0,.098),0 1px 10px 0 rgba(0,0,0,.084)}.alertify .alert .msg,.alertify .dialog .msg{padding:12px;margin-bottom:12px;margin:0;text-align:left}.alertify .alert input:not(.form-control),.alertify .dialog input:not(.form-control){margin-bottom:15px;width:100%;font-size:100%;padding:12px}.alertify .alert input:not(.form-control):focus,.alertify .dialog input:not(.form-control):focus{outline-offset:-2px}.alertify .alert nav,.alertify .dialog nav{text-align:right}.alertify .alert nav button:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button),.alertify .dialog nav button:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button){background:transparent;box-sizing:border-box;color:rgba(0,0,0,.87);position:relative;outline:0;border:0;display:inline-block;-ms-flex-align:center;-ms-grid-row-align:center;align-items:center;padding:0 6px;margin:6px 8px;line-height:36px;min-height:36px;white-space:nowrap;min-width:88px;text-align:center;text-transform:uppercase;font-size:14px;text-decoration:none;cursor:pointer;border:1px solid transparent;border-radius:2px}.alertify .alert nav button:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button):active,.alertify .alert nav button:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button):hover,.alertify .dialog nav button:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button):active,.alertify .dialog nav button:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button):hover{background-color:rgba(0,0,0,.05)}.alertify .alert nav button:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button):focus,.alertify .dialog nav button:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button):focus{border:1px solid rgba(0,0,0,.1)}.alertify .alert nav button.btn,.alertify .dialog nav button.btn{margin:6px 4px}.alertify-logs{position:fixed;z-index:1}.alertify-logs.bottom,.alertify-logs:not(.top){bottom:16px}.alertify-logs.left,.alertify-logs:not(.right){left:16px}.alertify-logs.left>*,.alertify-logs:not(.right)>*{float:left;transform:translateZ(0);height:auto}.alertify-logs.left>.show,.alertify-logs:not(.right)>.show{left:0}.alertify-logs.left>*,.alertify-logs.left>.hide,.alertify-logs:not(.right)>*,.alertify-logs:not(.right)>.hide{left:-110%}.alertify-logs.right{right:16px}.alertify-logs.right>*{float:right;transform:translateZ(0)}.alertify-logs.right>.show{right:0;opacity:1}.alertify-logs.right>*,.alertify-logs.right>.hide{right:-110%;opacity:0}.alertify-logs.top{top:0}.alertify-logs>*{box-sizing:border-box;transition:all .4s cubic-bezier(.25,.8,.25,1);position:relative;clear:both;backface-visibility:hidden;perspective:1000;max-height:0;margin:0;padding:0;overflow:hidden;opacity:0;pointer-events:none}.alertify-logs>.show{margin-top:12px;opacity:1;max-height:1000px;padding:12px;pointer-events:auto}",t.insertBefore(e,t.firstChild)}},removeCSS:function(){var t=document.querySelector("#alertifyCSS");t&&t.parentNode&&t.parentNode.removeChild(t)}};return t.injectCSS(),{_$$alertify:t,parent:function(e){t.parent=e},reset:function(){return t.reset(),this},alert:function(e,r,n){return t.dialog(e,"alert",r,n)||this},confirm:function(e,r,n){return t.dialog(e,"confirm",r,n)||this},prompt:function(e,r,n){return t.dialog(e,"prompt",r,n)||this},log:function(e,r){return t.log(e,"default",r),this},theme:function(e){return t.theme(e),this},success:function(e,r){return t.log(e,"success",r),this},error:function(e,r){return t.log(e,"error",r),this},cancelBtn:function(e){return t.cancelBtn(e),this},okBtn:function(e){return t.okBtn(e),this},delay:function(e){return t.setDelay(e),this},placeholder:function(e){return t.promptPlaceholder=e,this},defaultValue:function(e){return t.promptValue=e,this},maxLogItems:function(e){return t.setMaxLogItems(e),this},closeLogOnClick:function(e){return t.setCloseLogOnClick(!!e),this},logPosition:function(e){return t.setLogPosition(e||""),this},setLogTemplate:function(e){return t.logTemplateMethod=e,this},clearLogs:function(){return t.setupLogContainer().innerHTML="",this},version:t.version}}var o=500,a=function(t){if(t){var e=function(){t&&t.parentNode&&t.parentNode.removeChild(t)};t.classList.remove("show"),t.classList.add("hide"),t.addEventListener("transitionend",e),setTimeout(e,o)}};if("undefined"!=typeof t&&t&&t.exports){t.exports=function(){return new i};var s=new i;for(var u in s)t.exports[u]=s[u]}else n=function(){return new i}.call(e,r,e,t),!(void 0!==n&&(t.exports=n))}()}).call(e,r(17)(t))},function(t,e,r){"use strict";function n(t){document.querySelector("select")&&("current-location"==t?document.querySelector('select [id="option-coords"]').selected=!0:document.querySelector('select [value="'+t+'"]').selected=!0)}e.a=n},function(t,e,r){"use strict";function n(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function i(t){return 3*t.length/4-n(t)}function o(t){var e,r,i,o,a,s,u=t.length;a=n(t),s=new p(3*u/4-a),i=a>0?u-4:u;var l=0;for(e=0,r=0;e>16&255,s[l++]=o>>8&255,s[l++]=255&o;return 2===a?(o=c[t.charCodeAt(e)]<<2|c[t.charCodeAt(e+1)]>>4,s[l++]=255&o):1===a&&(o=c[t.charCodeAt(e)]<<10|c[t.charCodeAt(e+1)]<<4|c[t.charCodeAt(e+2)]>>2,s[l++]=o>>8&255,s[l++]=255&o),s}function a(t){return l[t>>18&63]+l[t>>12&63]+l[t>>6&63]+l[63&t]}function s(t,e,r){for(var n,i=[],o=e;oc?c:u+a));return 1===n?(e=t[r-1],i+=l[e>>2],i+=l[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=l[e>>10],i+=l[e>>4&63],i+=l[e<<2&63],i+="="),o.push(i),o.join("")}e.byteLength=i,e.toByteArray=o,e.fromByteArray=u;for(var l=[],c=[],p="undefined"!=typeof Uint8Array?Uint8Array:Array,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=0,d=h.length;f=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|t}function y(t){return+t!=t&&(t=0),a.alloc(+t)}function v(t,e){if(a.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return G(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Y(t).length;default:if(n)return G(t).length;e=(""+e).toLowerCase(),n=!0}}function g(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,e>>>=0,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return I(this,e,r);case"utf8":case"utf-8":return P(this,e,r);case"ascii":return k(this,e,r);case"latin1":case"binary":return C(this,e,r);case"base64":return M(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function _(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function x(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=a.from(e,n)),a.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,i);if("number"==typeof e)return e&=255,a.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,i){function o(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}var a=1,s=t.length,u=e.length;if(void 0!==n&&(n=String(n).toLowerCase(),"ucs2"===n||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,r/=2}var l;if(i){var c=-1;for(l=r;ls&&(r=s-u),l=r;l>=0;l--){for(var p=!0,h=0;hi&&(n=i)):n=i;var o=e.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a239?4:o>223?3:o>191?2:1;if(i+s<=r){var u,l,c,p;switch(s){case 1:o<128&&(a=o);break;case 2:u=t[i+1],128===(192&u)&&(p=(31&o)<<6|63&u,p>127&&(a=p));break;case 3:u=t[i+1],l=t[i+2],128===(192&u)&&128===(192&l)&&(p=(15&o)<<12|(63&u)<<6|63&l,p>2047&&(p<55296||p>57343)&&(a=p));break;case 4:u=t[i+1],l=t[i+2],c=t[i+3],128===(192&u)&&128===(192&l)&&128===(192&c)&&(p=(15&o)<<18|(63&u)<<12|(63&l)<<6|63&c,p>65535&&p<1114112&&(a=p))}}null===a?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=s}return L(n)}function L(t){var e=t.length;if(e<=tt)return String.fromCharCode.apply(String,t);for(var r="",n=0;nn)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function O(t,e,r,n,i,o){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function B(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i>>8*(n?i:1-i)}function j(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i>>8*(n?i:3-i)&255}function F(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(t,e,r,n,i){return i||F(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),Q.write(t,e,r,n,23,4),r+4}function N(t,e,r,n,i){return i||F(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),Q.write(t,e,r,n,52,8),r+8}function V(t){if(t=q(t).replace(et,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function q(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Z(t){return t<16?"0"+t.toString(16):t.toString(16)}function G(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],a=0;a55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function X(t){for(var e=[],r=0;r>8,i=r%256,o.push(i),o.push(n);return o}function Y(t){return K.toByteArray(V(t))}function H(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function J(t){return t!==t}/*! +!function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var r={};return e.m=t,e.c=r,e.i=function(t){return t},e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=20)}([function(t,e){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";function n(t){var e=/POINT\((.*)\)/.exec(t),r=e[1].split(" ")[0],n=e[1].split(" ")[1];return{latitude:n,longitude:r}}e.a=n},function(t,e,r){"use strict";function n(t){return Array.isArray(t)?t:Array.from(t)}function i(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=t.dataset.latitude,o=t.dataset.longitude,l=t.dataset.id,c=window["geojson"+l];if(null==c&&(c={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[o,i]},properties:{title:"Current Location",icon:"circle-stroked",uri:"current-location"}}]}),null!=n){var p=!0,f=!1,d=void 0;try{for(var m,y=n[Symbol.iterator]();!(p=(m=y.next()).done);p=!0){var v=m.value,g=r.i(s.a)(v.location).longitude,_=r.i(s.a)(v.location).latitude;c.features.push({type:"Feature",geometry:{type:"Point",coordinates:[g,_]},properties:{title:v.name,icon:"circle",uri:v.slug}})}}catch(t){f=!0,d=t}finally{try{!p&&y.return&&y.return()}finally{if(f)throw d}}}if(null!=e){e.coords.longitude,e.coords.latitude}var map=new a.a.Map({container:t,style:"mapbox://styles/mapbox/streets-v9",center:[o,i],zoom:15});if(null==e&&map.scrollZoom.disable(),map.addControl(new a.a.NavigationControl),t.appendChild(h(map)),map.on("load",function(){map.addSource("points",{type:"geojson",data:c}),map.addLayer({id:"points",interactive:!0,type:"symbol",source:"points",layout:{"icon-image":"{icon}-15","text-field":"{title}","text-offset":[0,1]}})}),null!=e&&map.on("click",function(t){var e=map.queryRenderedFeatures(t.point,{layer:["points"]});e.length&&(map.flyTo({center:e[0].geometry.coordinates}),r.i(u.a)(e[0].properties.uri))}),c.features&&c.features.length>1){var x=new a.a.LngLatBounds,b=!0,w=!1,E=void 0;try{for(var T,S=c.features[Symbol.iterator]();!(b=(T=S.next()).done);b=!0){var z=T.value;x.extend(z.geometry.coordinates)}}catch(t){w=!0,E=t}finally{try{!b&&S.return&&S.return()}finally{if(w)throw E}}map.fitBounds(x,{padding:65})}return map}var o=r(9),a=r.n(o),s=r(1),u=r(4);e.a=i,a.a.accessToken="pk.eyJ1Ijoiam9ubnliYXJuZXMiLCJhIjoiY2l2cDhjYW04MDAwcjJ0cG1uZnhqcm82ayJ9.qA2zeVA-nsoMh9IFrd5KQw";var l=function(t){return t.split("-").map(function(t){var e=n(t),r=e[0],i=e.slice(1);return r.toUpperCase()+i.join("").toLowerCase()}).join(" ")},c=function(map,t,e){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=document.createElement("input");n.setAttribute("id",e),n.setAttribute("type","radio"),n.setAttribute("name","toggle"),n.setAttribute("value",e),1==r&&n.setAttribute("checked","checked"),n.addEventListener("click",function(){map.setStyle("mapbox://styles/mapbox/"+e+"-v9")});var i=document.createElement("label");i.setAttribute("for",e),i.appendChild(document.createTextNode(l(e))),t.appendChild(n),t.appendChild(i)},h=function(map){var t=document.createElement("div");return t.classList.add("map-menu"),c(map,t,"streets",!0),c(map,t,"satellite-streets"),t}},function(t,e,r){(function(t){var n;!function(){"use strict";function i(){var t={parent:document.body,version:"1.0.12",defaultOkLabel:"Ok",okLabel:"Ok",defaultCancelLabel:"Cancel",cancelLabel:"Cancel",defaultMaxLogItems:2,maxLogItems:2,promptValue:"",promptPlaceholder:"",closeLogOnClick:!1,closeLogOnClickDefault:!1,delay:5e3,defaultDelay:5e3,logContainerClass:"alertify-logs",logContainerDefaultClass:"alertify-logs",dialogs:{buttons:{holder:"",ok:"",cancel:""},input:"",message:"

{{message}}

",log:"
{{message}}
"},defaultDialogs:{buttons:{holder:"",ok:"",cancel:""},input:"",message:"

{{message}}

",log:"
{{message}}
"},build:function(t){var e=this.dialogs.buttons.ok,r="
"+this.dialogs.message.replace("{{message}}",t.message);return"confirm"!==t.type&&"prompt"!==t.type||(e=this.dialogs.buttons.cancel+this.dialogs.buttons.ok),"prompt"===t.type&&(r+=this.dialogs.input),r=(r+this.dialogs.buttons.holder+"
").replace("{{buttons}}",e).replace("{{ok}}",this.okLabel).replace("{{cancel}}",this.cancelLabel)},setCloseLogOnClick:function(t){this.closeLogOnClick=!!t},close:function(t,e){this.closeLogOnClick&&t.addEventListener("click",function(){a(t)}),e=e&&!isNaN(+e)?+e:this.delay,0>e?a(t):e>0&&setTimeout(function(){a(t)},e)},dialog:function(t,e,r,n){return this.setup({type:e,message:t,onOkay:r,onCancel:n})},log:function(t,e,r){var n=document.querySelectorAll(".alertify-logs > div");if(n){var i=n.length-this.maxLogItems;if(i>=0)for(var o=0,a=i+1;a>o;o++)this.close(n[o],-1)}this.notify(t,e,r)},setLogPosition:function(t){this.logContainerClass="alertify-logs "+t},setupLogContainer:function(){var t=document.querySelector(".alertify-logs"),e=this.logContainerClass;return t||(t=document.createElement("div"),t.className=e,this.parent.appendChild(t)),t.className!==e&&(t.className=e),t},notify:function(e,r,n){var i=this.setupLogContainer(),o=document.createElement("div");o.className=r||"default",t.logTemplateMethod?o.innerHTML=t.logTemplateMethod(e):o.innerHTML=e,"function"==typeof n&&o.addEventListener("click",n),i.appendChild(o),setTimeout(function(){o.className+=" show"},10),this.close(o,this.delay)},setup:function(t){function e(e){"function"!=typeof e&&(e=function(){}),n&&n.addEventListener("click",function(n){t.onOkay&&"function"==typeof t.onOkay&&(o?t.onOkay(o.value,n):t.onOkay(n)),e(o?{buttonClicked:"ok",inputValue:o.value,event:n}:{buttonClicked:"ok",event:n}),a(r)}),i&&i.addEventListener("click",function(n){t.onCancel&&"function"==typeof t.onCancel&&t.onCancel(n),e({buttonClicked:"cancel",event:n}),a(r)}),o&&o.addEventListener("keyup",function(t){13===t.which&&n.click()})}var r=document.createElement("div");r.className="alertify hide",r.innerHTML=this.build(t);var n=r.querySelector(".ok"),i=r.querySelector(".cancel"),o=r.querySelector("input"),s=r.querySelector("label");o&&("string"==typeof this.promptPlaceholder&&(s?s.textContent=this.promptPlaceholder:o.placeholder=this.promptPlaceholder),"string"==typeof this.promptValue&&(o.value=this.promptValue));var u;return"function"==typeof Promise?u=new Promise(e):e(),this.parent.appendChild(r),setTimeout(function(){r.classList.remove("hide"),o&&t.type&&"prompt"===t.type?(o.select(),o.focus()):n&&n.focus()},100),u},okBtn:function(t){return this.okLabel=t,this},setDelay:function(t){return t=t||0,this.delay=isNaN(t)?this.defaultDelay:parseInt(t,10),this},cancelBtn:function(t){return this.cancelLabel=t,this},setMaxLogItems:function(t){this.maxLogItems=parseInt(t||this.defaultMaxLogItems)},theme:function(t){switch(t.toLowerCase()){case"bootstrap":this.dialogs.buttons.ok="",this.dialogs.buttons.cancel="",this.dialogs.input="";break;case"purecss":this.dialogs.buttons.ok="",this.dialogs.buttons.cancel="";break;case"mdl":case"material-design-light":this.dialogs.buttons.ok="",this.dialogs.buttons.cancel="",this.dialogs.input="
";break;case"angular-material":this.dialogs.buttons.ok="",this.dialogs.buttons.cancel="",this.dialogs.input="
";break;case"default":default:this.dialogs.buttons.ok=this.defaultDialogs.buttons.ok,this.dialogs.buttons.cancel=this.defaultDialogs.buttons.cancel,this.dialogs.input=this.defaultDialogs.input}},reset:function(){this.parent=document.body,this.theme("default"),this.okBtn(this.defaultOkLabel),this.cancelBtn(this.defaultCancelLabel),this.setMaxLogItems(),this.promptValue="",this.promptPlaceholder="",this.delay=this.defaultDelay,this.setCloseLogOnClick(this.closeLogOnClickDefault),this.setLogPosition("bottom left"),this.logTemplateMethod=null},injectCSS:function(){if(!document.querySelector("#alertifyCSS")){var t=document.getElementsByTagName("head")[0],e=document.createElement("style");e.type="text/css",e.id="alertifyCSS",e.innerHTML=".alertify-logs>*{padding:12px 24px;color:#fff;box-shadow:0 2px 5px 0 rgba(0,0,0,.2);border-radius:1px}.alertify-logs>*,.alertify-logs>.default{background:rgba(0,0,0,.8)}.alertify-logs>.error{background:rgba(244,67,54,.8)}.alertify-logs>.success{background:rgba(76,175,80,.9)}.alertify{position:fixed;background-color:rgba(0,0,0,.3);left:0;right:0;top:0;bottom:0;width:100%;height:100%;z-index:1}.alertify.hide{opacity:0;pointer-events:none}.alertify,.alertify.show{box-sizing:border-box;transition:all .33s cubic-bezier(.25,.8,.25,1)}.alertify,.alertify *{box-sizing:border-box}.alertify .dialog{padding:12px}.alertify .alert,.alertify .dialog{width:100%;margin:0 auto;position:relative;top:50%;transform:translateY(-50%)}.alertify .alert>*,.alertify .dialog>*{width:400px;max-width:95%;margin:0 auto;text-align:center;padding:12px;background:#fff;box-shadow:0 2px 4px -1px rgba(0,0,0,.14),0 4px 5px 0 rgba(0,0,0,.098),0 1px 10px 0 rgba(0,0,0,.084)}.alertify .alert .msg,.alertify .dialog .msg{padding:12px;margin-bottom:12px;margin:0;text-align:left}.alertify .alert input:not(.form-control),.alertify .dialog input:not(.form-control){margin-bottom:15px;width:100%;font-size:100%;padding:12px}.alertify .alert input:not(.form-control):focus,.alertify .dialog input:not(.form-control):focus{outline-offset:-2px}.alertify .alert nav,.alertify .dialog nav{text-align:right}.alertify .alert nav button:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button),.alertify .dialog nav button:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button){background:transparent;box-sizing:border-box;color:rgba(0,0,0,.87);position:relative;outline:0;border:0;display:inline-block;-ms-flex-align:center;-ms-grid-row-align:center;align-items:center;padding:0 6px;margin:6px 8px;line-height:36px;min-height:36px;white-space:nowrap;min-width:88px;text-align:center;text-transform:uppercase;font-size:14px;text-decoration:none;cursor:pointer;border:1px solid transparent;border-radius:2px}.alertify .alert nav button:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button):active,.alertify .alert nav button:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button):hover,.alertify .dialog nav button:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button):active,.alertify .dialog nav button:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button):hover{background-color:rgba(0,0,0,.05)}.alertify .alert nav button:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button):focus,.alertify .dialog nav button:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button):focus{border:1px solid rgba(0,0,0,.1)}.alertify .alert nav button.btn,.alertify .dialog nav button.btn{margin:6px 4px}.alertify-logs{position:fixed;z-index:1}.alertify-logs.bottom,.alertify-logs:not(.top){bottom:16px}.alertify-logs.left,.alertify-logs:not(.right){left:16px}.alertify-logs.left>*,.alertify-logs:not(.right)>*{float:left;transform:translateZ(0);height:auto}.alertify-logs.left>.show,.alertify-logs:not(.right)>.show{left:0}.alertify-logs.left>*,.alertify-logs.left>.hide,.alertify-logs:not(.right)>*,.alertify-logs:not(.right)>.hide{left:-110%}.alertify-logs.right{right:16px}.alertify-logs.right>*{float:right;transform:translateZ(0)}.alertify-logs.right>.show{right:0;opacity:1}.alertify-logs.right>*,.alertify-logs.right>.hide{right:-110%;opacity:0}.alertify-logs.top{top:0}.alertify-logs>*{box-sizing:border-box;transition:all .4s cubic-bezier(.25,.8,.25,1);position:relative;clear:both;backface-visibility:hidden;perspective:1000;max-height:0;margin:0;padding:0;overflow:hidden;opacity:0;pointer-events:none}.alertify-logs>.show{margin-top:12px;opacity:1;max-height:1000px;padding:12px;pointer-events:auto}",t.insertBefore(e,t.firstChild)}},removeCSS:function(){var t=document.querySelector("#alertifyCSS");t&&t.parentNode&&t.parentNode.removeChild(t)}};return t.injectCSS(),{_$$alertify:t,parent:function(e){t.parent=e},reset:function(){return t.reset(),this},alert:function(e,r,n){return t.dialog(e,"alert",r,n)||this},confirm:function(e,r,n){return t.dialog(e,"confirm",r,n)||this},prompt:function(e,r,n){return t.dialog(e,"prompt",r,n)||this},log:function(e,r){return t.log(e,"default",r),this},theme:function(e){return t.theme(e),this},success:function(e,r){return t.log(e,"success",r),this},error:function(e,r){return t.log(e,"error",r),this},cancelBtn:function(e){return t.cancelBtn(e),this},okBtn:function(e){return t.okBtn(e),this},delay:function(e){return t.setDelay(e),this},placeholder:function(e){return t.promptPlaceholder=e,this},defaultValue:function(e){return t.promptValue=e,this},maxLogItems:function(e){return t.setMaxLogItems(e),this},closeLogOnClick:function(e){return t.setCloseLogOnClick(!!e),this},logPosition:function(e){return t.setLogPosition(e||""),this},setLogTemplate:function(e){return t.logTemplateMethod=e,this},clearLogs:function(){return t.setupLogContainer().innerHTML="",this},version:t.version}}var o=500,a=function(t){if(t){var e=function(){t&&t.parentNode&&t.parentNode.removeChild(t)};t.classList.remove("show"),t.classList.add("hide"),t.addEventListener("transitionend",e),setTimeout(e,o)}};if("undefined"!=typeof t&&t&&t.exports){t.exports=function(){return new i};var s=new i;for(var u in s)t.exports[u]=s[u]}else n=function(){return new i}.call(e,r,e,t),!(void 0!==n&&(t.exports=n))}()}).call(e,r(17)(t))},function(t,e,r){"use strict";function n(t){document.querySelector("select")&&("current-location"==t?document.querySelector('select [id="option-coords"]').selected=!0:document.querySelector('select [value="'+t+'"]').selected=!0)}e.a=n},function(t,e,r){"use strict";function n(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function i(t){return 3*t.length/4-n(t)}function o(t){var e,r,i,o,a,s,u=t.length;a=n(t),s=new h(3*u/4-a),i=a>0?u-4:u;var l=0;for(e=0,r=0;e>16&255,s[l++]=o>>8&255,s[l++]=255&o;return 2===a?(o=c[t.charCodeAt(e)]<<2|c[t.charCodeAt(e+1)]>>4,s[l++]=255&o):1===a&&(o=c[t.charCodeAt(e)]<<10|c[t.charCodeAt(e+1)]<<4|c[t.charCodeAt(e+2)]>>2,s[l++]=o>>8&255,s[l++]=255&o),s}function a(t){return l[t>>18&63]+l[t>>12&63]+l[t>>6&63]+l[63&t]}function s(t,e,r){for(var n,i=[],o=e;oc?c:u+a));return 1===n?(e=t[r-1],i+=l[e>>2],i+=l[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=l[e>>10],i+=l[e>>4&63],i+=l[e<<2&63],i+="="),o.push(i),o.join("")}e.byteLength=i,e.toByteArray=o,e.fromByteArray=u;for(var l=[],c=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=0,d=p.length;f=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|t}function y(t){return+t!=t&&(t=0),a.alloc(+t)}function v(t,e){if(a.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return G(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(t).length;default:if(n)return G(t).length;e=(""+e).toLowerCase(),n=!0}}function g(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,e>>>=0,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return I(this,e,r);case"utf8":case"utf-8":return P(this,e,r);case"ascii":return C(this,e,r);case"latin1":case"binary":return k(this,e,r);case"base64":return M(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function _(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function x(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=a.from(e,n)),a.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,i);if("number"==typeof e)return e&=255,a.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,i){function o(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}var a=1,s=t.length,u=e.length;if(void 0!==n&&(n=String(n).toLowerCase(),"ucs2"===n||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,r/=2}var l;if(i){var c=-1;for(l=r;ls&&(r=s-u),l=r;l>=0;l--){for(var h=!0,p=0;pi&&(n=i)):n=i;var o=e.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a239?4:o>223?3:o>191?2:1;if(i+s<=r){var u,l,c,h;switch(s){case 1:o<128&&(a=o);break;case 2:u=t[i+1],128===(192&u)&&(h=(31&o)<<6|63&u,h>127&&(a=h));break;case 3:u=t[i+1],l=t[i+2],128===(192&u)&&128===(192&l)&&(h=(15&o)<<12|(63&u)<<6|63&l,h>2047&&(h<55296||h>57343)&&(a=h));break;case 4:u=t[i+1],l=t[i+2],c=t[i+3],128===(192&u)&&128===(192&l)&&128===(192&c)&&(h=(15&o)<<18|(63&u)<<12|(63&l)<<6|63&c,h>65535&&h<1114112&&(a=h))}}null===a?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=s}return L(n)}function L(t){var e=t.length;if(e<=tt)return String.fromCharCode.apply(String,t);for(var r="",n=0;nn)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function O(t,e,r,n,i,o){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function B(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i>>8*(n?i:1-i)}function j(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i>>8*(n?i:3-i)&255}function F(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(t,e,r,n,i){return i||F(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),Q.write(t,e,r,n,23,4),r+4}function N(t,e,r,n,i){return i||F(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),Q.write(t,e,r,n,52,8),r+8}function V(t){if(t=q(t).replace(et,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function q(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Z(t){return t<16?"0"+t.toString(16):t.toString(16)}function G(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],a=0;a55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function X(t){for(var e=[],r=0;r>8,i=r%256,o.push(i),o.push(n);return o}function H(t){return K.toByteArray(V(t))}function Y(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function J(t){return t!==t}/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ -var K=r(5),Q=r(7),$=r(8);e.Buffer=a,e.SlowBuffer=y,e.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:n(),e.kMaxLength=i(),a.poolSize=8192,a._augment=function(t){return t.__proto__=a.prototype,t},a.from=function(t,e,r){return s(null,t,e,r)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0})),a.alloc=function(t,e,r){return l(null,t,e,r)},a.allocUnsafe=function(t){return c(null,t)},a.allocUnsafeSlow=function(t){return c(null,t)},a.isBuffer=function(t){return!(null==t||!t._isBuffer)},a.compare=function(t,e){if(!a.isBuffer(t)||!a.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},a.prototype.compare=function(t,e,r,n,i){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,s=r-e,u=Math.min(o,s),l=this.slice(n,i),c=t.slice(e,r),p=0;pi)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":return T(this,t,e,r);case"latin1":case"binary":return S(this,t,e,r);case"base64":return z(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var tt=4096;a.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),e0&&(i*=256);)n+=this[t+--e]*i;return n},a.prototype.readUInt8=function(t,e){return e||D(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,e){return e||D(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,e){return e||D(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,e){return e||D(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUInt32BE=function(t,e){return e||D(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||D(t,e,this.length);for(var n=this[t],i=1,o=0;++o=i&&(n-=Math.pow(2,8*e)),n},a.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||D(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},a.prototype.readInt8=function(t,e){return e||D(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},a.prototype.readInt16LE=function(t,e){e||D(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(t,e){e||D(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(t,e){return e||D(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return e||D(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return e||D(t,4,this.length),Q.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return e||D(t,4,this.length),Q.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return e||D(t,8,this.length),Q.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return e||D(t,8,this.length),Q.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e|=0,r|=0,!n){var i=Math.pow(2,8*r)-1;O(this,t,e,r,i,0)}var o=1,a=0;for(this[e]=255&t;++a=0&&(a*=256);)this[e+o]=t/a&255;return e+r},a.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},a.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):B(this,t,e,!0),e+2},a.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):B(this,t,e,!1),e+2},a.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):j(this,t,e,!0),e+4},a.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):j(this,t,e,!1),e+4},a.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);O(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o>0)-s&255;return e+r},a.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);O(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},a.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):B(this,t,e,!0),e+2},a.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):B(this,t,e,!1),e+2},a.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):j(this,t,e,!0),e+4},a.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):j(this,t,e,!1),e+4},a.prototype.writeFloatLE=function(t,e,r){return U(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return U(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return N(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return N(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var o;if("number"==typeof t)for(o=e;o>1,c=-7,p=r?i-1:0,h=r?-1:1,f=t[e+p];for(p+=h,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=256*o+t[e+p],p+=h,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+t[e+p],p+=h,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:(f?-1:1)*(1/0);a+=Math.pow(2,n),o-=l}return(f?-1:1)*a*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var a,s,u,l=8*o-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,d=n?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,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),e+=a+p>=1?h/u:h*Math.pow(2,1-p),e*u>=2&&(a++,u/=2),a+p>=c?(s=0,a=c):a+p>=1?(s=(e*u-1)*Math.pow(2,i),a+=p):(s=e*Math.pow(2,p-1)*Math.pow(2,i),a=0));i>=8;t[r+f]=255&s,f+=d,s/=256,i-=8);for(a=a<0;t[r+f]=255&a,f+=d,a/=256,l-=8);t[r+f-d]|=128*m}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){(function(e,r){var n,n;!function(e){t.exports=e()}(function(){var t;return function t(e,r,i){function o(s,u){if(!r[s]){if(!e[s]){var l="function"==typeof n&&n;if(!u&&l)return n(s,!0);if(a)return a(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var p=r[s]={exports:{}};e[s][0].call(p.exports,function(t){var r=e[s][1][t];return o(r?r:t)},p,p.exports,t,e,r,i)}return r[s].exports}for(var a="function"==typeof n&&n,s=0;sa.MAX_VERTEX_ARRAY_LENGTH)&&(e=new o(this.layoutVertexArray.length,this.elementArray.length),this.segments.push(e)),e},a.prototype.prepareSegment2=function(t){var e=this.segments2[this.segments2.length-1];return(!e||e.vertexLength+t>a.MAX_VERTEX_ARRAY_LENGTH)&&(e=new o(this.layoutVertexArray.length,this.elementArray2.length),this.segments2.push(e)),e},a.prototype.populatePaintArrays=function(t){var e=this;for(var r in this.layerData){var n=e.layerData[r];0!==n.paintVertexArray.bytesPerElement&&n.programConfiguration.populatePaintArray(n.layer,n.paintVertexArray,e.layoutVertexArray.length,e.globalProperties,t)}},a.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},a.prototype.serialize=function(t){return{layoutVertexArray:this.layoutVertexArray.serialize(t),elementArray:this.elementArray&&this.elementArray.serialize(t),elementArray2:this.elementArray2&&this.elementArray2.serialize(t),paintVertexArrays:n(this.layerData,t),segments:this.segments,segments2:this.segments2}},a.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,e.exports=a},{"./program_configuration":15}],2:[function(t,e,r){"use strict";var n=t("./array_group"),i=t("./buffer_group"),o=t("../util/util"),a=function(t,e){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.index=t.index,t.arrays?this.buffers=new i(e,t.layers,t.zoom,t.arrays):this.arrays=new n(e,t.layers,t.zoom)};a.prototype.populate=function(t,e){for(var r=this,n=0,i=t;n=u||h<0||h>=u)){var f=e.prepareSegment(4),d=f.vertexLength;n(e.layoutVertexArray,p,h,-1,-1),n(e.layoutVertexArray,p,h,1,-1),n(e.layoutVertexArray,p,h,1,1),n(e.layoutVertexArray,p,h,-1,1),e.elementArray.emplaceBack(d,d+1,d+2),e.elementArray.emplaceBack(d,d+3,d+2),f.vertexLength+=4,f.primitiveLength+=2}}e.populatePaintArrays(t.properties)},e}(i);e.exports=c},{"../bucket":2,"../element_array_type":10,"../extent":11,"../load_geometry":13,"../vertex_array_type":17}],4:[function(t,e,r){"use strict";var n=t("../bucket"),i=t("../vertex_array_type"),o=t("../element_array_type"),a=t("../load_geometry"),s=t("earcut"),u=t("../../util/classify_rings"),l=500,c={layoutVertexArrayType:i([{name:"a_pos",components:2,type:"Int16"}]),elementArrayType:o(3),elementArrayType2:o(2),paintAttributes:[{property:"fill-color",type:"Uint8"},{property:"fill-outline-color",type:"Uint8"},{property:"fill-opacity",type:"Uint8",multiplier:255}]},p=function(t){function e(e){t.call(this,e,c)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addFeature=function(t){for(var e=this.arrays,r=0,n=u(a(t),l);rl)||t.y===e.y&&(t.y<0||t.y>l)}var o=t("../bucket"),a=t("../vertex_array_type"),s=t("../element_array_type"),u=t("../load_geometry"),l=t("../extent"),c=t("earcut"),p=t("../../util/classify_rings"),h=500,f={layoutVertexArrayType:a([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal",components:3,type:"Int16"},{name:"a_edgedistance",components:1,type:"Int16"}]),elementArrayType:s(3),paintAttributes:[{property:"fill-extrusion-base",type:"Uint16"},{property:"fill-extrusion-height",type:"Uint16"},{property:"fill-extrusion-color",type:"Uint8"}]},d=Math.pow(2,13),m=function(t){function e(e){t.call(this,e,f)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addFeature=function(t){for(var e=this.arrays,r=0,o=p(u(t),h);r=1){var S=b[E-1];if(!i(T,S)){var z=T.sub(S)._perp()._unit();n(e.layoutVertexArray,T.x,T.y,z.x,z.y,0,0,w),n(e.layoutVertexArray,T.x,T.y,z.x,z.y,0,1,w),w+=S.dist(T),n(e.layoutVertexArray,S.x,S.y,z.x,z.y,0,0,w),n(e.layoutVertexArray,S.x,S.y,z.x,z.y,0,1,w);var A=m.vertexLength;e.elementArray.emplaceBack(A,A+1,A+2),e.elementArray.emplaceBack(A+1,A+2,A+3),m.vertexLength+=4,m.primitiveLength+=2}}y.push(T.x),y.push(T.y)}}}for(var M=c(y,v),P=0;P>6)}var i=t("../bucket"),o=t("../vertex_array_type"),a=t("../element_array_type"),s=t("../load_geometry"),u=t("../extent"),l=63,c=Math.cos(37.5*(Math.PI/180)),p=15,h=15,f=.5,d=Math.pow(2,h-1)/f,m={layoutVertexArrayType:o([{name:"a_pos",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}]),paintAttributes:[{property:"line-color",type:"Uint8"},{property:"line-blur",multiplier:10,type:"Uint8"},{property:"line-opacity",multiplier:10,type:"Uint8"},{property:"line-gap-width",multiplier:10,type:"Uint8",name:"a_gapwidth"},{property:"line-offset",multiplier:1,type:"Int8"}],elementArrayType:a()},y=function(t){function e(e){t.call(this,e,m)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addFeature=function(t){for(var e=this,r=this.layers[0].layout,n=r["line-join"],i=r["line-cap"],o=r["line-miter-limit"],a=r["line-round-limit"],u=0,l=s(t,h);u2&&t[s-1].equals(t[s-2]);)s--;if(!(t.length<2)){"bevel"===r&&(i=1.05);var l=p*(u/(512*this.overscaling)),h=t[0],f=t[s-1],d=h.equals(f),m=this.arrays,y=m.prepareSegment(10*s);if(2!==s||!d){this.distance=0;var v,g,_,x,b,w,E,T=n,S=d?"butt":n,z=!0;this.e1=this.e2=this.e3=-1,d&&(v=t[s-2],b=h.sub(v)._unit()._perp());for(var A=0;A0){var C=v.dist(g);if(C>2*l){var I=v.sub(v.sub(g)._mult(l/C)._round());a.distance+=I.dist(g),a.addCurrentVertex(I,a.distance,x.mult(1),0,0,!1,y),g=I}}var R=g&&_,D=R?r:_?T:S;if(R&&"round"===D&&(Li&&(D="bevel"),"bevel"===D&&(L>2&&(D="flipbevel"),L100)M=b.clone();else{var O=x.x*b.y-x.y*b.x>0?-1:1,B=L*x.add(b).mag()/x.sub(b).mag();M._perp()._mult(B*O)}a.addCurrentVertex(v,a.distance,M,0,0,!1,y),a.addCurrentVertex(v,a.distance,M.mult(-1),0,0,!1,y)}else if("bevel"===D||"fakeround"===D){var j=x.x*b.y-x.y*b.x>0,F=-Math.sqrt(L*L-1);if(j?(E=0,w=F):(w=0,E=F),z||a.addCurrentVertex(v,a.distance,x,w,E,!1,y),"fakeround"===D){for(var U,N=Math.floor(8*(.5-(P-.5))),V=0;V=0;q--)U=x.mult((q+1)/(N+1))._add(b)._unit(),a.addPieSliceVertex(v,a.distance,U,j,y)}_&&a.addCurrentVertex(v,a.distance,b,-w,-E,!1,y)}else"butt"===D?(z||a.addCurrentVertex(v,a.distance,x,0,0,!1,y),_&&a.addCurrentVertex(v,a.distance,b,0,0,!1,y)):"square"===D?(z||(a.addCurrentVertex(v,a.distance,x,1,1,!1,y),a.e1=a.e2=-1),_&&a.addCurrentVertex(v,a.distance,b,-1,-1,!1,y)):"round"===D&&(z||(a.addCurrentVertex(v,a.distance,x,0,0,!1,y),a.addCurrentVertex(v,a.distance,x,1,1,!0,y),a.e1=a.e2=-1),_&&(a.addCurrentVertex(v,a.distance,b,-1,-1,!0,y),a.addCurrentVertex(v,a.distance,b,0,0,!1,y)));if(k&&A2*l){var G=v.add(_.sub(v)._mult(l/Z)._round());a.distance+=G.dist(v),a.addCurrentVertex(G,a.distance,b.mult(1),0,0,!1,y),v=G}}z=!1}m.populatePaintArrays(e)}}},e.prototype.addCurrentVertex=function(t,e,r,i,o,a,s){var u,l=a?1:0,c=this.arrays,p=c.layoutVertexArray,h=c.elementArray;u=r.clone(),i&&u._sub(r.perp()._mult(i)),n(p,t,u,l,0,i,e),this.e3=s.vertexLength++,this.e1>=0&&this.e2>=0&&(h.emplaceBack(this.e1,this.e2,this.e3),s.primitiveLength++),this.e1=this.e2,this.e2=this.e3,u=r.mult(-1),o&&u._sub(r.perp()._mult(o)),n(p,t,u,l,1,-o,e),this.e3=s.vertexLength++,this.e1>=0&&this.e2>=0&&(h.emplaceBack(this.e1,this.e2,this.e3),s.primitiveLength++),this.e1=this.e2,this.e2=this.e3,e>d/2&&(this.distance=0,this.addCurrentVertex(t,this.distance,r,i,o,a,s))},e.prototype.addPieSliceVertex=function(t,e,r,i,o){var a=i?1:0;r=r.mult(i?-1:1);var s=this.arrays,u=s.layoutVertexArray,l=s.elementArray;n(u,t,r,0,a,0,e),this.e3=o.vertexLength++,this.e1>=0&&this.e2>=0&&(l.emplaceBack(this.e1,this.e2,this.e3),o.primitiveLength++),i?this.e2=this.e3:this.e1=this.e3},e}(i);e.exports=y},{"../bucket":2,"../element_array_type":10,"../extent":11,"../load_geometry":13,"../vertex_array_type":17}],7:[function(t,e,r){"use strict";function n(t,e,r,n,i,o,a,s,u,l,c){t.emplaceBack(e,r,Math.round(64*n),Math.round(64*i),o/4,a/4,10*(l||0),c,10*(s||0),10*Math.min(u||25,25))}function i(t,e,r,n,i){return t.emplaceBack(e.x,e.y,Math.round(r.x),Math.round(r.y),10*n,10*i)}var o=t("point-geometry"),a=t("../array_group"),s=t("../buffer_group"),u=t("../vertex_array_type"),l=t("../element_array_type"),c=t("../extent"),p=t("../../symbol/anchor"),h=t("../../symbol/get_anchors"),f=t("../../util/token"),d=t("../../symbol/quads"),m=t("../../symbol/shaping"),y=t("../../symbol/resolve_text"),v=t("../../symbol/mergelines"),g=t("../../symbol/clip_line"),_=t("../../util/util"),x=t("../../util/script_detection"),b=t("../load_geometry"),w=t("../../symbol/collision_feature"),E=t("../../util/find_pole_of_inaccessibility"),T=t("../../util/classify_rings"),S=t("vector-tile").VectorTileFeature,z=m.shapeText,A=m.shapeIcon,M=m.WritingMode,P=d.getGlyphQuads,L=d.getIconQuads,k=l(),C=u([{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"}]),I={glyph:{layoutVertexArrayType:C,elementArrayType:k},icon:{layoutVertexArrayType:C,elementArrayType:k},collisionBox:{layoutVertexArrayType:u([{name:"a_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"},{name:"a_data",components:2,type:"Uint8"}]),elementArrayType:l(2)}},R=function(t){var e=this;if(this.collisionBoxArray=t.collisionBoxArray,this.symbolQuadsArray=t.symbolQuadsArray,this.symbolInstancesArray=t.symbolInstancesArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.index=t.index,this.sdfIcons=t.sdfIcons,this.iconsNeedLinear=t.iconsNeedLinear,this.adjustedTextSize=t.adjustedTextSize,this.adjustedIconSize=t.adjustedIconSize,this.fontstack=t.fontstack,t.arrays){this.buffers={};for(var r in t.arrays)t.arrays[r]&&(e.buffers[r]=new s(I[r],t.layers,t.zoom,t.arrays[r]))}};R.prototype.populate=function(t,e){var r=this,n=this.layers[0].layout,i=n["text-field"],o=n["text-font"],a=n["icon-image"],s=i&&o,u=a;if(this.features=[],s||u){for(var l=e.iconDependencies,c=e.glyphDependencies,p=c[o]=c[o]||{},h=0;hc||o.y<0||o.y>c);if(!m||a){var s=a||w;n.addSymbolInstance(o,i,e,r,n.layers[0],s,n.symbolInstancesArray.length,n.collisionBoxArray,t.index,t.sourceLayerIndex,n.index,u,y,x,f,v,b,{zoom:n.zoom},t.properties)}};if("line"===S)for(var P=0,L=g(t.geometry,0,0,c,c);P=0;o--)if(r.dist(i[o])7*Math.PI/4)continue}else if(o&&a&&y<=3*Math.PI/4||y>5*Math.PI/4)continue}else if(o&&a&&(y<=Math.PI/2||y>3*Math.PI/2))continue;var v=m.tl,g=m.tr,_=m.bl,x=m.br,b=m.tex,w=m.anchorPoint,E=Math.max(h+Math.log(m.minScale)/Math.LN2,f),T=Math.min(h+Math.log(m.maxScale)/Math.LN2,25);if(!(T<=E)){E===f&&(E=0);var S=Math.round(m.glyphAngle/(2*Math.PI)*256),z=t.prepareSegment(4),A=z.vertexLength;n(p,w.x,w.y,v.x,v.y,b.x,b.y,E,T,f,S),n(p,w.x,w.y,g.x,g.y,b.x+b.w,b.y,E,T,f,S),n(p,w.x,w.y,_.x,_.y,b.x,b.y+b.h,E,T,f,S),n(p,w.x,w.y,x.x,x.y,b.x+b.w,b.y+b.h,E,T,f,S),c.emplaceBack(A,A+1,A+2),c.emplaceBack(A+1,A+2,A+3),z.vertexLength+=4,z.primitiveLength+=2}}},R.prototype.addToDebugBuffers=function(t){for(var e=this,r=this.arrays.collisionBox,n=r.layoutVertexArray,a=r.elementArray,s=-t.angle,u=t.yStretch,l=this.symbolInstancesStartIndex;lR.MAX_QUADS&&_.warnOnce("Too many symbols being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),I>R.MAX_QUADS&&_.warnOnce("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907");var N=(r[M.vertical]?M.vertical:0)|(r[M.horizontal]?M.horizontal:0);return this.symbolInstancesArray.emplaceBack(D,O,F,U,k,I,B,j,t.x,t.y,a,N)},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,t.writingMode)},R.MAX_QUADS=65535,e.exports=R},{"../../symbol/anchor":73,"../../symbol/clip_line":75,"../../symbol/collision_feature":77,"../../symbol/get_anchors":79,"../../symbol/mergelines":82,"../../symbol/quads":83,"../../symbol/resolve_text":84,"../../symbol/shaping":85,"../../util/classify_rings":111,"../../util/find_pole_of_inaccessibility":117,"../../util/script_detection":124,"../../util/token":126,"../../util/util":127,"../array_group":1,"../buffer_group":9,"../element_array_type":10,"../extent":11,"../load_geometry":13,"../vertex_array_type":17,"point-geometry":194,"vector-tile":204}],8:[function(t,e,r){"use strict";var n={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT"},i=function(t,e,r){this.arrayBuffer=t.arrayBuffer,this.length=t.length,this.attributes=e.members,this.itemSize=e.bytesPerElement,this.type=r,this.arrayType=e};i.fromStructArray=function(t,e){return new i(t.serialize(),t.constructor.serialize(),e)},i.prototype.bind=function(t){var e=t[this.type];this.buffer?t.bindBuffer(e,this.buffer):(this.gl=t,this.buffer=t.createBuffer(),t.bindBuffer(e,this.buffer),t.bufferData(e,this.arrayBuffer,t.STATIC_DRAW),this.arrayBuffer=null)},i.prototype.setVertexAttribPointers=function(t,e,r){for(var i=this,o=0;o0?t["line-gap-width"]+2*t["line-width"]:t["line-width"]}function a(t,e,r,n,i){if(!e[0]&&!e[1])return t;e=u.convert(e),"viewport"===r&&e._rotate(-n);for(var o=[],a=0;ar.max||p.yr.max)&&i.warnOnce("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return s}},{"../util/util":127,"./extent":11}],14:[function(t,e,r){"use strict";var n=t("../util/struct_array"),i=n({members:[{name:"a_pos",type:"Int16",components:2}]});e.exports=i},{"../util/struct_array":125}],15:[function(t,e,r){"use strict";function n(t,e,r,n){if(!t.zoomStops)return e.getPaintValue(t.property,r,n);var i=t.zoomStops.map(function(i){return e.getPaintValue(t.property,a.extend({},r,{zoom:i}),n)});return 1===i.length?i[0]:i}function i(t,e){var r=t.property.replace(e.type+"-","").replace(/-/g,"_"),n="color"===e._paintSpecifications[t.property].type;return a.extend({name:"a_"+r,components:n?4:1,multiplier:n?255:1},t)}var o=t("./vertex_array_type"),a=t("../util/util"),s=function(){this.attributes=[],this.uniforms=[],this.interpolationUniforms=[],this.pragmas={vertex:{},fragment:{}},this.cacheKey=""};s.createDynamic=function(t,e,r){for(var n=new s,a=0,u=t;a90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};i.prototype.wrap=function(){return new i(n(this.lng,-180,180),this.lat)},i.prototype.toArray=function(){return[this.lng,this.lat]},i.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},i.convert=function(t){if(t instanceof i)return t;if(t&&t.hasOwnProperty("lng")&&t.hasOwnProperty("lat"))return new i(t.lng,t.lat);if(Array.isArray(t)&&2===t.length)return new i(t[0],t[1]);throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, or an array of [, ]")},e.exports=i},{"../util/util":127}],20:[function(t,e,r){"use strict";var n=t("./lng_lat"),i=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};i.prototype.setNorthEast=function(t){return this._ne=n.convert(t),this},i.prototype.setSouthWest=function(t){return this._sw=n.convert(t),this},i.prototype.extend=function(t){var e,r,o=this._sw,a=this._ne;if(t instanceof n)e=t,r=t;else{if(!(t instanceof i))return Array.isArray(t)?t.every(Array.isArray)?this.extend(i.convert(t)):this.extend(n.convert(t)):this;if(e=t._sw,r=t._ne,!e||!r)return this}return o||a?(o.lng=Math.min(e.lng,o.lng),o.lat=Math.min(e.lat,o.lat),a.lng=Math.max(r.lng,a.lng),a.lat=Math.max(r.lat,a.lat)):(this._sw=new n(e.lng,e.lat),this._ne=new n(r.lng,r.lat)),this},i.prototype.getCenter=function(){return new n((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},i.prototype.getSouthWest=function(){return this._sw},i.prototype.getNorthEast=function(){return this._ne},i.prototype.getNorthWest=function(){return new n(this.getWest(),this.getNorth())},i.prototype.getSouthEast=function(){return new n(this.getEast(),this.getSouth())},i.prototype.getWest=function(){return this._sw.lng},i.prototype.getSouth=function(){return this._sw.lat},i.prototype.getEast=function(){return this._ne.lng},i.prototype.getNorth=function(){return this._ne.lat},i.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},i.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},i.convert=function(t){return!t||t instanceof i?t:new i(t)},e.exports=i},{"./lng_lat":19}],21:[function(t,e,r){"use strict";var n=t("./lng_lat"),i=t("point-geometry"),o=t("./coordinate"),a=t("../util/util"),s=t("../util/interpolate"),u=t("../source/tile_coord"),l=t("../data/extent"),c=t("@mapbox/gl-matrix"),p=c.vec4,h=c.mat4,f=c.mat2,d=function(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 n(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0},m={minZoom:{},maxZoom:{},worldSize:{},centerPoint:{},size:{},bearing:{},pitch:{},fov:{},zoom:{},center:{},unmodified:{},x:{},y:{},point:{}};m.minZoom.get=function(){return this._minZoom},m.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},m.maxZoom.get=function(){return this._maxZoom},m.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},m.worldSize.get=function(){return this.tileSize*this.scale},m.centerPoint.get=function(){return this.size._div(2)},m.size.get=function(){return new i(this.width,this.height)},m.bearing.get=function(){return-this.angle/Math.PI*180},m.bearing.set=function(t){var e=-a.wrap(t,-180,180)*Math.PI/180;this.angle!==e&&(this._unmodified=!1,this.angle=e,this._calcMatrices(),this.rotationMatrix=f.create(),f.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},m.pitch.get=function(){return this._pitch/Math.PI*180},m.pitch.set=function(t){var e=a.clamp(t,0,60)/180*Math.PI;this._pitch!==e&&(this._unmodified=!1,this._pitch=e,this._calcMatrices())},m.fov.get=function(){return this._fov/Math.PI*180},m.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())},m.zoom.get=function(){return this._zoom},m.zoom.set=function(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._constrain(),this._calcMatrices())},m.center.get=function(){return this._center},m.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},d.prototype.coveringZoomLevel=function(t){return(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},d.prototype.coveringTiles=function(t){var e=this.coveringZoomLevel(t),r=e;if(et.maxzoom&&(e=t.maxzoom);var n=this.pointCoordinate(this.centerPoint,e),o=new i(n.column-.5,n.row-.5),a=[this.pointCoordinate(new i(0,0),e),this.pointCoordinate(new i(this.width,0),e),this.pointCoordinate(new i(this.width,this.height),e),this.pointCoordinate(new i(0,this.height),e)];return u.cover(e,a,t.reparseOverscaled?r:e).sort(function(t,e){return o.dist(t)-o.dist(e)})},d.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},m.unmodified.get=function(){return this._unmodified},d.prototype.zoomScale=function(t){return Math.pow(2,t)},d.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},d.prototype.project=function(t){return new i(this.lngX(t.lng),this.latY(t.lat))},d.prototype.unproject=function(t){return new n(this.xLng(t.x),this.yLat(t.y))},m.x.get=function(){return this.lngX(this.center.lng)},m.y.get=function(){return this.latY(this.center.lat)},m.point.get=function(){return new i(this.x,this.y)},d.prototype.lngX=function(t){return(180+t)*this.worldSize/360},d.prototype.latY=function(t){var e=180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360));return(180-e)*this.worldSize/360},d.prototype.xLng=function(t){return 360*t/this.worldSize-180},d.prototype.yLat=function(t){var e=180-360*t/this.worldSize;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90},d.prototype.setLocationAtPoint=function(t,e){var r=this.pointCoordinate(e)._sub(this.pointCoordinate(this.centerPoint));this.center=this.coordinateLocation(this.locationCoordinate(t)._sub(r))},d.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},d.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},d.prototype.locationCoordinate=function(t){return new o(this.lngX(t.lng)/this.tileSize,this.latY(t.lat)/this.tileSize,this.zoom).zoomTo(this.tileZoom)},d.prototype.coordinateLocation=function(t){var e=t.zoomTo(this.zoom);return new n(this.xLng(e.column*this.tileSize),this.yLat(e.row*this.tileSize))},d.prototype.pointCoordinate=function(t,e){void 0===e&&(e=this.tileZoom);var r=0,n=[t.x,t.y,0,1],i=[t.x,t.y,1,1];p.transformMat4(n,n,this.pixelMatrixInverse),p.transformMat4(i,i,this.pixelMatrixInverse);var a=n[3],u=i[3],l=n[0]/a,c=i[0]/u,h=n[1]/a,f=i[1]/u,d=n[2]/a,m=i[2]/u,y=d===m?0:(r-d)/(m-d);return new o(s(l,c,y)/this.tileSize,s(h,f,y)/this.tileSize,this.zoom)._zoomTo(e)},d.prototype.coordinatePoint=function(t){var e=t.zoomTo(this.zoom),r=[e.column*this.tileSize,e.row*this.tileSize,0,1];return p.transformMat4(r,r,this.pixelMatrix),new i(r[0]/r[3],r[1]/r[3])},d.prototype.calculatePosMatrix=function(t,e){var r=t.toCoordinate(e),n=this.worldSize/this.zoomScale(r.zoom),i=h.identity(new Float64Array(16));return h.translate(i,i,[r.column*n,r.row*n,0]),h.scale(i,i,[n/l,n/l,1]),h.multiply(i,this.projMatrix,i),new Float32Array(i)},d.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,e,r,n,o,a,s,u,l=this.size,c=this._unmodified;this.latRange&&(t=this.latY(this.latRange[1]),e=this.latY(this.latRange[0]),o=e-te&&(u=e-f)}if(this.lngRange){var d=this.x,m=l.x/2;d-mn&&(s=n-m)}void 0===s&&void 0===u||(this.center=this.unproject(new i(void 0!==s?s:this.x,void 0!==u?u:this.y))),this._unmodified=c,this._constraining=!1}},d.prototype._calcMatrices=function(){if(this.height){this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var t=this._fov/2,e=Math.PI/2+this._pitch,r=Math.sin(t)*this.cameraToCenterDistance/Math.sin(Math.PI-e-t),n=Math.cos(Math.PI/2-this._pitch)*r+this.cameraToCenterDistance,i=1.01*n,o=new Float64Array(16);h.perspective(o,this._fov,this.width/this.height,1,i),h.scale(o,o,[1,-1,1]),h.translate(o,o,[0,0,-this.cameraToCenterDistance]),h.rotateX(o,o,this._pitch),h.rotateZ(o,o,this.angle),h.translate(o,o,[-this.x,-this.y,0]);var a=this.worldSize/(2*Math.PI*6378137*Math.abs(Math.cos(this.center.lat*(Math.PI/180))));if(h.scale(o,o,[1,1,a,1]),this.projMatrix=o,o=h.create(),h.scale(o,o,[this.width/2,-this.height/2,1]),h.translate(o,o,[1,-1,0]),this.pixelMatrix=h.multiply(new Float64Array(16),o,this.projMatrix),o=h.invert(new Float64Array(16),this.pixelMatrix),!o)throw new Error("failed to invert matrix");this.pixelMatrixInverse=o}},Object.defineProperties(d.prototype,m),e.exports=d},{"../data/extent":11,"../source/tile_coord":51,"../util/interpolate":119,"../util/util":127,"./coordinate":18,"./lng_lat":19,"@mapbox/gl-matrix":131,"point-geometry":194}],22:[function(t,e,r){"use strict";var n,i=t("./util/worker_pool");e.exports=function(){return n||(n=new i),n}},{"./util/worker_pool":130}],23:[function(t,e,r){"use strict";var n={" ":[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,r,i){i=i||1;var o,a,s,u,l,c,p,h,f=[];for(o=0,a=t.length;o0?1/(1-t):1+t}function s(t){return t>0?1-1/(1.001-t):-t}function u(t,e,r,n){var i=[1,0],o=r.paint["raster-fade-duration"];if(t.sourceCache&&o>0){var a=Date.now(),s=(a-t.timeAdded)/o,u=e?(a-e.timeAdded)/o:-1,c=t.sourceCache.getSource(),p=n.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),h=!e||Math.abs(e.coord.z-p)>Math.abs(t.coord.z-p);i[0]=l.clamp(h?s:1-u,0,1),i[1]=e?1-i[0]:0}var f=r.paint["raster-opacity"];return i[0]*=f,i[1]*=f,i}var l=t("../util/util");e.exports=n},{"../util/util":127}],33:[function(t,e,r){"use strict";function n(t,e,r,n){if(!t.isOpaquePass){var o=!(r.layout["text-allow-overlap"]||r.layout["icon-allow-overlap"]||r.layout["text-ignore-placement"]||r.layout["icon-ignore-placement"]),a=t.gl;o?a.disable(a.STENCIL_TEST):a.enable(a.STENCIL_TEST),t.setDepthSublayer(0),t.depthMask(!1),i(t,e,r,n,!1,r.paint["icon-translate"],r.paint["icon-translate-anchor"],r.layout["icon-rotation-alignment"],r.layout["icon-rotation-alignment"],r.layout["icon-size"],r.paint["icon-halo-width"],r.paint["icon-halo-color"],r.paint["icon-halo-blur"],r.paint["icon-opacity"],r.paint["icon-color"]),i(t,e,r,n,!0,r.paint["text-translate"],r.paint["text-translate-anchor"],r.layout["text-rotation-alignment"],r.layout["text-pitch-alignment"],r.layout["text-size"],r.paint["text-halo-width"],r.paint["text-halo-color"],r.paint["text-halo-blur"],r.paint["text-opacity"],r.paint["text-color"]),e.map.showCollisionBoxes&&l(t,e,r,n)}}function i(t,e,r,n,i,s,u,l,c,p,h,f,d,m,y){if(i||!t.style.sprite||t.style.sprite.loaded()){var v=t.gl,g="map"===l,_="map"===c,x=_;x?v.enable(v.DEPTH_TEST):v.disable(v.DEPTH_TEST);for(var b,w=0,E=n;wthis.previousZoom;i--)n.changeTimes[i]=t,n.changeOpacities[i]=n.opacities[i];for(i=0;i<256;i++){var o=t-n.changeTimes[i],a=255*(r?o/r:1);i<=e?n.opacities[i]=n.changeOpacities[i]+a:n.opacities[i]=n.changeOpacities[i]-a}this.changed=!0,this.previousZoom=e},n.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))},e.exports=n},{}],35:[function(t,e,r){"use strict";var n=t("../util/util"),i=function(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={}};i.prototype.setSprite=function(t){this.sprite=t},i.prototype.getDash=function(t,e){var r=t.join(",")+e;return this.positions[r]||(this.positions[r]=this.addDash(t,e)),this.positions[r]},i.prototype.addDash=function(t,e){var r=this,i=e?7:0,o=2*i+1,a=128;if(this.nextRow+o>this.height)return n.warnOnce("LineAtlas out of space"),null;for(var s=0,u=0;u0?n.pop():null}},v.prototype.getViewportTexture=function(t,e){if(this.reusableTextures.viewport){var r=this.reusableTextures.viewport.texture;return r.width===t&&r.height===e?r:(this.gl.deleteTexture(r),void(this.reusableTextures.viewport.texture=null))}},v.prototype.lineWidth=function(t){this.gl.lineWidth(l.clamp(t,this.lineWidthRange[0],this.lineWidthRange[1]))},v.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 r=8,n=1/r;e.blendColor(n,n,n,0),e.clearColor(0,0,0,1),e.clear(e.COLOR_BUFFER_BIT)}else e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA)}},v.prototype.createProgram=function(t,e){var r=this.gl,i=r.createProgram(),o=m[t],a="#define MAPBOX_GL_JS\n#define DEVICE_PIXEL_RATIO "+n.devicePixelRatio.toFixed(1)+"\n";this._showOverdrawInspector&&(a+="#define OVERDRAW_INSPECTOR;\n");var s=r.createShader(r.FRAGMENT_SHADER);r.shaderSource(s,e.applyPragmas(a+m.prelude.fragmentSource+o.fragmentSource,"fragment")),r.compileShader(s),r.attachShader(i,s);var u=r.createShader(r.VERTEX_SHADER);r.shaderSource(u,e.applyPragmas(a+m.prelude.vertexSource+o.vertexSource,"vertex")),r.compileShader(u),r.attachShader(i,u),r.linkProgram(i);for(var l=r.getProgramParameter(i,r.ACTIVE_ATTRIBUTES),c={program:i,numAttributes:l},p=0;p>16,u>>16),i.uniform2f(r.u_pixel_coord_lower,65535&s,65535&u)}},{"../source/pixels_to_tile_units":45}],38:[function(t,e,r){"use strict";t("path");e.exports={prelude:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif\n\nfloat 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\n// The offset depends on how many pixels are between the world origin and 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 and the edge of the tile.\n// The glsl spec only guarantees 16 bits of 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:\nvec2 get_pattern_pos(const vec2 pixel_coord_upper, const vec2 pixel_coord_lower,\n const vec2 pattern_size, const float tile_units_to_pixels, const vec2 pos) {\n\n vec2 offset = mod(mod(mod(pixel_coord_upper, pattern_size) * 256.0, pattern_size) * 256.0 + pixel_coord_lower, pattern_size);\n return (tile_units_to_pixels * pos + offset) / pattern_size;\n}\n"},circle:{fragmentSource:"#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\n\nvarying vec2 v_extrude;\nvarying lowp float v_antialiasblur;\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize mediump float radius\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize lowp vec4 stroke_color\n #pragma mapbox: initialize mediump float stroke_width\n #pragma mapbox: initialize lowp float stroke_opacity\n\n float extrude_length = length(v_extrude);\n float antialiased_blur = -max(blur, v_antialiasblur);\n\n float opacity_t = smoothstep(0.0, antialiased_blur, extrude_length - 1.0);\n\n float color_t = stroke_width < 0.01 ? 0.0 : smoothstep(\n antialiased_blur,\n 0.0,\n extrude_length - radius / (radius + stroke_width)\n );\n\n gl_FragColor = opacity_t * mix(color * opacity, stroke_color * stroke_opacity, color_t);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform bool u_scale_with_map;\nuniform vec2 u_extrude_scale;\n\nattribute vec2 a_pos;\n\n#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\n\nvarying vec2 v_extrude;\nvarying lowp float v_antialiasblur;\n\nvoid main(void) {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize mediump float radius\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize lowp vec4 stroke_color\n #pragma mapbox: initialize mediump float stroke_width\n #pragma mapbox: initialize lowp float stroke_opacity\n\n // unencode the extrusion vector that we snuck into the a_pos vector\n v_extrude = vec2(mod(a_pos, 2.0) * 2.0 - 1.0);\n\n vec2 extrude = v_extrude * (radius + stroke_width) * u_extrude_scale;\n // multiply a_pos by 0.5, since we had it * 2 in order to sneak\n // in extrusion data\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5), 0, 1);\n\n if (u_scale_with_map) {\n gl_Position.xy += extrude;\n } else {\n gl_Position.xy += extrude * gl_Position.w;\n }\n\n // This is a minimum blur distance that serves as a faux-antialiasing for\n // the circle. since blur is a ratio of the circle's size and the intent is\n // to keep the blur at roughly 1px, the two are inversely related.\n v_antialiasblur = 1.0 / DEVICE_PIXEL_RATIO / (radius + stroke_width);\n}\n"},collisionBox:{fragmentSource:"uniform 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:"attribute 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"},debug:{fragmentSource:"uniform lowp vec4 u_color;\n\nvoid main() {\n gl_FragColor = u_color;\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, step(32767.0, a_pos.x), 1);\n}\n"},fill:{fragmentSource:"#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize lowp float opacity\n\n gl_FragColor = color * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\n#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n"},fillOutline:{fragmentSource:"#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:"attribute 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"},fillOutlinePattern:{fragmentSource:"uniform 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\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\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 // 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 * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_world;\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;\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, a_pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, a_pos);\n\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},fillPattern:{fragmentSource:"uniform 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\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\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) * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform 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\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, a_pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, a_pos);\n}\n"},fillExtrusion:{fragmentSource:"varying vec4 v_color;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 color\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n #pragma mapbox: initialize lowp vec4 color\n\n gl_FragColor = v_color;\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec3 u_lightcolor;\nuniform lowp vec3 u_lightpos;\nuniform lowp float u_lightintensity;\nuniform lowp vec4 u_outline_color;\n\nattribute vec2 a_pos;\nattribute vec3 a_normal;\nattribute float a_edgedistance;\n\nvarying vec4 v_color;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\n#pragma mapbox: define lowp vec4 color\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n #pragma mapbox: initialize lowp vec4 color\n\n float ed = a_edgedistance; // use each attrib in order to not trip a VAO assert\n float t = mod(a_normal.x, 2.0);\n\n gl_Position = u_matrix * vec4(a_pos, t > 0.0 ? height : base, 1);\n\n#ifdef OUTLINE\n color = u_outline_color;\n#endif\n\n // Relative luminance (how dark/bright is the surface color?)\n float colorvalue = color.r * 0.2126 + color.g * 0.7152 + color.b * 0.0722;\n\n v_color = vec4(0.0, 0.0, 0.0, 1.0);\n\n // Add slight ambient lighting so no extrusions are totally black\n vec4 ambientlight = vec4(0.03, 0.03, 0.03, 1.0);\n color += ambientlight;\n\n // Calculate cos(theta), where theta is the angle between surface normal and diffuse light ray\n float directional = clamp(dot(a_normal / 16384.0, u_lightpos), 0.0, 1.0);\n\n // Adjust directional so that\n // the range of values for highlight/shading is narrower\n // with lower light intensity\n // and with lighter/brighter surface colors\n directional = mix((1.0 - u_lightintensity), max((1.0 - colorvalue + u_lightintensity), 1.0), directional);\n\n // Add gradient along z axis of side surfaces\n if (a_normal.y != 0.0) {\n directional *= clamp((t + base) * pow(height / 150.0, 0.5), mix(0.7, 0.98, 1.0 - u_lightintensity), 1.0);\n }\n\n // Assign final color based on surface + ambient light color, diffuse light directional, and light color\n // with lower bounds adjusted to hue of light\n // so that shading is tinted with the complementary (opposite) color to the light color\n v_color.r += clamp(color.r * directional * u_lightcolor.r, mix(0.0, 0.3, 1.0 - u_lightcolor.r), 1.0);\n v_color.g += clamp(color.g * directional * u_lightcolor.g, mix(0.0, 0.3, 1.0 - u_lightcolor.g), 1.0);\n v_color.b += clamp(color.b * directional * u_lightcolor.b, mix(0.0, 0.3, 1.0 - u_lightcolor.b), 1.0);\n}\n"},fillExtrusionPattern:{fragmentSource:"uniform 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 vec4 v_lighting;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\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 vec4 mixedColor = mix(color1, color2, u_mix);\n\n gl_FragColor = mixedColor * v_lighting;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform 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;\nuniform float u_height_factor;\n\nuniform vec3 u_lightcolor;\nuniform lowp vec3 u_lightpos;\nuniform lowp float u_lightintensity;\n\nattribute vec2 a_pos;\nattribute vec3 a_normal;\nattribute float a_edgedistance;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec4 v_lighting;\nvarying float v_directional;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n\n float t = mod(a_normal.x, 2.0);\n float z = t > 0.0 ? height : base;\n\n gl_Position = u_matrix * vec4(a_pos, z, 1);\n\n vec2 pos = a_normal.x == 1.0 && a_normal.y == 0.0 && a_normal.z == 16384.0\n ? a_pos // extrusion top\n : vec2(a_edgedistance, z * u_height_factor); // extrusion side\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, pos);\n\n v_lighting = vec4(0.0, 0.0, 0.0, 1.0);\n float directional = clamp(dot(a_normal / 16383.0, u_lightpos), 0.0, 1.0);\n directional = mix((1.0 - u_lightintensity), max((0.5 + u_lightintensity), 1.0), directional);\n\n if (a_normal.y != 0.0) {\n directional *= clamp((t + base) * pow(height / 150.0, 0.5), mix(0.7, 0.98, 1.0 - u_lightintensity), 1.0);\n }\n\n v_lighting.rgb += clamp(directional * u_lightcolor, mix(vec3(0.0), vec3(0.3), 1.0 - u_lightcolor), vec3(1.0));\n}\n"},extrusionTexture:{fragmentSource:"uniform sampler2D u_texture;\nuniform float u_opacity;\n\nvarying vec2 v_pos;\n\nvoid main() {\n gl_FragColor = texture2D(u_texture, v_pos) * u_opacity;\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform int u_xdim;\nuniform int u_ydim;\nattribute vec2 a_pos;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n v_pos.x = a_pos.x / float(u_xdim);\n v_pos.y = 1.0 - a_pos.y / float(u_ydim);\n}\n"},line:{fragmentSource:"#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_width2;\nvarying vec2 v_normal;\nvarying float v_gamma_scale;\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\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\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform mediump float u_width;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump float gapwidth\n #pragma mapbox: initialize lowp float offset\n\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\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\n // these transformations used to be applied in the JS and native code bases. \n // moved them into the shader for clarity and simplicity. \n gapwidth = gapwidth / 2.0;\n float width = u_width / 2.0;\n offset = -1.0 * offset; \n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + width * (gapwidth > 0.0 ? 2.0 : 1.0) + 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 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit to get the position\n vec2 pos = floor(a_pos * 0.5);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_width2 = vec2(outset, inset);\n}\n"},linePattern:{fragmentSource:"uniform 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;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 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_width2.s / u_pattern_size_a.y);\n float y_b = 0.5 + (v_normal.y * v_width2.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 gl_FragColor = color * alpha * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"// 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\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 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_width;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n\nvoid main() {\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize lowp float offset\n #pragma mapbox: initialize mediump float gapwidth\n\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 // these transformations used to be applied in the JS and native code bases. \n // moved them into the shader for clarity and simplicity. \n gapwidth = gapwidth / 2.0;\n float width = u_width / 2.0;\n offset = -1.0 * offset; \n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + width * (gapwidth > 0.0 ? 2.0 : 1.0) + 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 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit to get the position\n vec2 pos = floor(a_pos * 0.5);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_linesofar = a_linesofar;\n v_width2 = vec2(outset, inset);\n}\n"},lineSDF:{fragmentSource:"\nuniform sampler2D u_image;\nuniform float u_sdfgamma;\nuniform float u_mix;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 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 = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n", -vertexSource:"// 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\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_patternscale_a;\nuniform float u_tex_y_a;\nuniform vec2 u_patternscale_b;\nuniform float u_tex_y_b;\nuniform vec2 u_gl_units_to_pixels;\nuniform mediump float u_width;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump float gapwidth\n #pragma mapbox: initialize lowp float offset\n\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 // these transformations used to be applied in the JS and native code bases. \n // moved them into the shader for clarity and simplicity. \n gapwidth = gapwidth / 2.0;\n float width = u_width / 2.0;\n offset = -1.0 * offset;\n \n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + width * (gapwidth > 0.0 ? 2.0 : 1.0) + 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 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit to get the position\n vec2 pos = floor(a_pos * 0.5);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\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 v_width2 = vec2(outset, inset);\n}\n"},raster:{fragmentSource:"uniform 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:"uniform 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"},symbolIcon:{fragmentSource:"uniform 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:"attribute 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"},symbolSDF:{fragmentSource:"uniform 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:"const 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;\n\n v_tex = a_tex / u_texsize;\n v_fade_tex = vec2(a_labelminzoom / 255.0, 0.0);\n}\n"}}},{path:191}],39:[function(t,e,r){"use strict";var n=function(){this.boundProgram=null,this.boundVertexBuffer=null,this.boundVertexBuffer2=null,this.boundElementBuffer=null,this.boundVertexOffset=null,this.vao=null};n.prototype.bind=function(t,e,r,n,i,o){void 0===t.extVertexArrayObject&&(t.extVertexArrayObject=t.getExtension("OES_vertex_array_object"));var a=!this.vao||this.boundProgram!==e||this.boundVertexBuffer!==r||this.boundVertexBuffer2!==i||this.boundElementBuffer!==n||this.boundVertexOffset!==o;!t.extVertexArrayObject||a?(this.freshBind(t,e,r,n,i,o),this.gl=t):t.extVertexArrayObject.bindVertexArrayOES(this.vao)},n.prototype.freshBind=function(t,e,r,n,i,o){var a,s=e.numAttributes;if(t.extVertexArrayObject)this.vao&&this.destroy(),this.vao=t.extVertexArrayObject.createVertexArrayOES(),t.extVertexArrayObject.bindVertexArrayOES(this.vao),a=0,this.boundProgram=e,this.boundVertexBuffer=r,this.boundVertexBuffer2=i,this.boundElementBuffer=n,this.boundVertexOffset=o;else{a=t.currentNumAttributes||0;for(var u=s;uthis.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,i={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("loadTile",i,function(n,i){if(t.unloadVectorData(),!t.aborted)return n?e(n):(t.loadVectorData(i,r.map.painter),t.redoWhenDone&&(t.redoWhenDone=!1,t.redoPlacement(r)),e(null))},this.workerID)},e.prototype.abortTile=function(t){t.aborted=!0},e.prototype.unloadTile=function(t){t.unloadVectorData(),this.dispatcher.send("removeTile",{uid:t.uid,type:this.type,source:this.id},function(){},t.workerID)},e.prototype.onRemove=function(){this.dispatcher.broadcast("removeSource",{type:this.type,source:this.id},function(){})},e.prototype.serialize=function(){return{type:this.type,data:this._data}},e}(i);e.exports=u},{"../data/extent":11,"../util/evented":116,"../util/util":127,"../util/window":110}],41:[function(t,e,r){"use strict";var n=t("../util/ajax"),i=t("geojson-rewind"),o=t("./geojson_wrapper"),a=t("vt-pbf"),s=t("supercluster"),u=t("geojson-vt"),l=t("./vector_tile_worker_source"),c=function(t){function e(e,r,n){t.call(this,e,r),n&&(this.loadGeoJSON=n),this._geoJSONIndexes={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.loadVectorData=function(t,e){var r=t.source,n=t.coord;if(!this._geoJSONIndexes[r])return e(null,null);var i=this._geoJSONIndexes[r].getTile(Math.min(n.z,t.maxZoom),n.x,n.y);if(!i)return e(null,null);var s=new o(i.features);s.name="_geojsonTileLayer";var u=a({layers:{_geojsonTileLayer:s}});0===u.byteOffset&&u.byteLength===u.buffer.byteLength||(u=new Uint8Array(u)),s.rawData=u.buffer,e(null,s)},e.prototype.loadData=function(t,e){var r=function(r,n){var o=this;return r?e(r):"object"!=typeof n?e(new Error("Input data is not a valid GeoJSON object.")):(i(n,!0),void this._indexData(n,t,function(r,n){return r?e(r):(o._geoJSONIndexes[t.source]=n,void e(null))}))}.bind(this);this.loadGeoJSON(t,r)},e.prototype.loadGeoJSON=function(t,e){if(t.url)n.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."))}}},e.prototype.removeSource=function(t){this._geoJSONIndexes[t.source]&&delete this._geoJSONIndexes[t.source]},e.prototype._indexData=function(t,e,r){try{e.cluster?r(null,s(e.superclusterOptions).load(t.features)):r(null,u(t,e.geojsonVtOptions))}catch(t){return r(t)}},e}(l);e.exports=c},{"../util/ajax":107,"./geojson_wrapper":42,"./vector_tile_worker_source":53,"geojson-rewind":137,"geojson-vt":141,supercluster:198,"vt-pbf":208}],42:[function(t,e,r){"use strict";var n=t("point-geometry"),i=t("vector-tile").VectorTileFeature,o=t("../data/extent"),a=function(t){var e=this;if(this.type=t.type,1===t.type){this.rawGeometry=[];for(var r=0;re)){var s=Math.pow(2,Math.min(a.coord.z,n._source.maxzoom)-Math.min(t.z,n._source.maxzoom));if(Math.floor(a.coord.x/s)===t.x&&Math.floor(a.coord.y/s)===t.y)for(r[o]=!0,i=!0;a&&a.coord.z-1>t.z;){var u=a.coord.parent(n._source.maxzoom).id;a=n._tiles[u],a&&a.hasData()&&(delete r[o],r[u]=!0)}}}return i},e.prototype.findLoadedParent=function(t,e,r){for(var n=this,i=t.z-1;i>=e;i--){t=t.parent(n._source.maxzoom);var o=n._tiles[t.id];if(o&&o.hasData())return r[t.id]=!0,o;if(n._cache.has(t.id))return n.addTile(t),r[t.id]=!0,n._tiles[t.id]}},e.prototype.updateCacheSize=function(t){var e=Math.ceil(t.width/t.tileSize)+1,r=Math.ceil(t.height/t.tileSize)+1,n=e*r,i=5;this._cache.setMaxSize(Math.floor(n*i))},e.prototype.update=function(t){var r=this;if(this._sourceLoaded){var n,i,o;this.updateCacheSize(t);var a=(this._source.roundZoom?Math.round:Math.floor)(this.getZoom(t)),s=Math.max(a-e.maxOverzooming,this._source.minzoom),l=Math.max(a+e.maxUnderzooming,this._source.minzoom),c={};this._coveredTiles={};var h;for(h=this.used?this._source.coord?[this._source.coord]:t.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}):[],n=0;n=Date.now()&&(r.findLoadedChildren(i,l,c)&&(c[y]=!0),r.findLoadedParent(i,s,f))}var v;for(v in f)c[v]||(r._coveredTiles[v]=!0);for(v in f)c[v]=!0;var g=p.keysDifference(this._tiles,c);for(n=0;nthis._source.maxzoom?Math.pow(2,n-this._source.maxzoom):1;e=new a(r,this._source.tileSize*i,this._source.maxzoom),this.loadTile(e,this._tileLoaded.bind(this,e))}return e.uses++,this._tiles[t.id]=e,this._source.fire("dataloading",{tile:e,coord:e.coord,dataType:"tile"}),e},e.prototype.removeTile=function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._source.fire("data",{tile:e,coord:e.coord,dataType:"tile"}),e.uses>0||(e.hasData()?this._cache.add(e.coord.wrapped().id,e):(e.aborted=!0,this.abortTile(e),this.unloadTile(e))))},e.prototype.clearTiles=function(){var t=this;for(var e in this._tiles)t.removeTile(e);this._cache.reset()},e.prototype.tilesIn=function(t){for(var e=this,r={},i=this.getIds(),o=1/0,a=1/0,s=-(1/0),l=-(1/0),p=t[0].zoom,f=0;f=0&&g[1].y>=0){for(var _=[],x=0;xe.row){var r=t;t=e,e=r}return{x0:t.column,y0:t.row,x1:e.column,y1:e.row,dx:e.column-t.column,dy:e.row-t.row}}function i(t,e,r,n,i){var o=Math.max(r,Math.floor(e.y0)),a=Math.min(n,Math.ceil(e.y1));if(t.x0===e.x0&&t.y0===e.y0?t.x0+e.dy/t.dy*t.dx0,p=e.dx<0,h=o;hc.dy&&(u=l,l=c,c=u),l.dy>p.dy&&(u=l,l=p,p=u),c.dy>p.dy&&(u=c,c=p,p=u),l.dy&&i(p,l,o,a,s),c.dy&&i(p,c,o,a,s)}function a(t,e,r){for(var n,i="",o=t;o>0;o--)n=1<t?new l(this.z-1,this.x,this.y,this.w):new l(this.z-1,Math.floor(this.x/2),Math.floor(this.y/2),this.w)},l.prototype.wrapped=function(){return new l(this.z,this.x,this.y,0)},l.prototype.children=function(t){if(this.z>=t)return[new l(this.z+1,this.x,this.y,this.w)];var e=this.z+1,r=2*this.x,n=2*this.y;return[new l(e,r,n,this.w),new l(e,r+1,n,this.w),new l(e,r,n+1,this.w),new l(e,r+1,n+1,this.w)]},l.cover=function(t,e,r){function n(t,e,n){var o,s,u;if(n>=0&&n<=i)for(o=t;othis.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,i={url:a(t.coord.url(this.tiles,this.maxzoom,this.scheme),this.url),uid:t.uid,coord:t.coord,zoom:t.coord.z,tileSize:this.tileSize*n,type:this.type,source:this.id,overscaling:n,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID?"loading"===t.state?t.reloadCallback=e:this.dispatcher.send("reloadTile",i,r.bind(this),t.workerID):t.workerID=this.dispatcher.send("loadTile",i,r.bind(this))},e.prototype.abortTile=function(t){this.dispatcher.send("abortTile",{uid:t.uid,type:this.type,source:this.id},null,t.workerID)},e.prototype.unloadTile=function(t){t.unloadVectorData(),this.dispatcher.send("removeTile",{uid:t.uid,type:this.type,source:this.id},null,t.workerID)},e}(n);e.exports=s},{"../util/evented":116,"../util/mapbox":123,"../util/util":127,"./load_tilejson":44}],53:[function(t,e,r){"use strict";var n=t("../util/ajax"),i=t("vector-tile"),o=t("pbf"),a=t("./worker_tile"),s=t("../util/util"),u=function(t,e,r){this.actor=t,this.layerIndex=e,r&&(this.loadVectorData=r),this.loading={},this.loaded={}};u.prototype.loadTile=function(t,e){function r(t,r){return delete this.loading[n][i],t?e(t):r?(o.vectorTile=r,o.parse(r,this.layerIndex,this.actor,function(t,n,i){return t?e(t):void e(null,s.extend({rawTileData:r.rawData},n),i)}),this.loaded[n]=this.loaded[n]||{},void(this.loaded[n][i]=o)):e(null,null)}var n=t.source,i=t.uid;this.loading[n]||(this.loading[n]={});var o=this.loading[n][i]=new a(t);o.abort=this.loadVectorData(t,r.bind(this))},u.prototype.reloadTile=function(t,e){function r(t,r){if(this.reloadCallback){var n=this.reloadCallback;delete this.reloadCallback,this.parse(this.vectorTile,o.layerIndex,o.actor,n)}e(t,r)}var n=this.loaded[t.source],i=t.uid,o=this;if(n&&n[i]){var a=n[i];"parsing"===a.status?a.reloadCallback=e:"done"===a.status&&a.parse(a.vectorTile,this.layerIndex,this.actor,r.bind(a))}},u.prototype.abortTile=function(t){var e=this.loading[t.source],r=t.uid;e&&e[r]&&e[r].abort&&(e[r].abort(),delete e[r])},u.prototype.removeTile=function(t){var e=this.loaded[t.source],r=t.uid;e&&e[r]&&delete e[r]},u.prototype.loadVectorData=function(t,e){function r(t,r){if(t)return e(t);var n=new i.VectorTile(new o(r));n.rawData=r,e(t,n)}var a=n.getArrayBuffer(t.url,r.bind(this));return function(){a.abort()}},u.prototype.redoPlacement=function(t,e){var r=this.loaded[t.source],n=this.loading[t.source],i=t.uid;if(r&&r[i]){var o=r[i],a=o.redoPlacement(t.angle,t.pitch,t.showCollisionBoxes);a.result&&e(null,a.result,a.transferables)}else n&&n[i]&&(n[i].angle=t.angle)},e.exports=u},{"../util/ajax":107,"../util/util":127,"./worker_tile":56,pbf:193,"vector-tile":204}],54:[function(t,e,r){"use strict";var n=t("../util/ajax"),i=t("./image_source"),o=function(t){function e(e,r,n,i){t.call(this,e,r,n,i),this.roundZoom=!0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._load=function(t){var e=this;this.urls=t.urls,n.getVideo(t.urls,function(t,r){if(t)return e.fire("error",{error:t});e.video=r,e.video.loop=!0;var n;e.video.addEventListener("playing",function(){n=e.map.style.animationLoop.set(1/0),e.map._rerender()}),e.video.addEventListener("pause",function(){e.map.style.animationLoop.cancel(n)}),e.map&&e.video.play(),e._finishLoading()})},e.prototype.getVideo=function(){return this.video},e.prototype.onAdd=function(t){this.map||(this.map=t,this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},e.prototype.prepare=function(){!this.tile||this.video.readyState<2||this._prepareImage(this.map.painter.gl,this.video)},e.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},e}(i);e.exports=o},{"../util/ajax":107,"./image_source":43}],55:[function(t,e,r){"use strict";var n=t("../util/actor"),i=t("../style/style_layer_index"),o=t("./vector_tile_worker_source"),a=t("./geojson_worker_source"),s=function(t){var e=this;this.self=t,this.actor=new n(t,this),this.layerIndexes={},this.workerSourceTypes={vector:o,geojson:a},this.workerSources={},this.self.registerWorkerSource=function(t,r){if(e.workerSourceTypes[t])throw new Error('Worker source with name "'+t+'" already registered.');e.workerSourceTypes[t]=r}};s.prototype.setLayers=function(t,e){this.getLayerIndex(t).replace(e)},s.prototype.updateLayers=function(t,e){this.getLayerIndex(t).update(e.layers,e.removedIds,e.symbolOrder)},s.prototype.loadTile=function(t,e,r){this.getWorkerSource(t,e.type).loadTile(e,r)},s.prototype.reloadTile=function(t,e,r){this.getWorkerSource(t,e.type).reloadTile(e,r)},s.prototype.abortTile=function(t,e){this.getWorkerSource(t,e.type).abortTile(e)},s.prototype.removeTile=function(t,e){this.getWorkerSource(t,e.type).removeTile(e)},s.prototype.removeSource=function(t,e){var r=this.getWorkerSource(t,e.type);void 0!==r.removeSource&&r.removeSource(e)},s.prototype.redoPlacement=function(t,e,r){this.getWorkerSource(t,e.type).redoPlacement(e,r)},s.prototype.loadWorkerSource=function(t,e,r){try{this.self.importScripts(e.url),r()}catch(t){r(t)}},s.prototype.getLayerIndex=function(t){var e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new i),e},s.prototype.getWorkerSource=function(t,e){var r=this;if(this.workerSources[t]||(this.workerSources[t]={}),!this.workerSources[t][e]){var n={send:function(e,n,i,o){r.actor.send(e,n,i,o,t)}};this.workerSources[t][e]=new this.workerSourceTypes[e](n,this.getLayerIndex(t))}return this.workerSources[t][e]},e.exports=function(t){return new s(t)}},{"../style/style_layer_index":69,"../util/actor":106,"./geojson_worker_source":41,"./vector_tile_worker_source":53}],56:[function(t,e,r){"use strict";function n(t,e){for(var r=0,n=t.layers;r=P.maxzoom||P.layout&&"none"===P.layout.visibility)){for(var L=0,k=M;L=0;D--){var O=y[e.symbolOrder[D]];O&&f.symbolBuckets.push(O)}if(0===this.symbolBuckets.length)return R(new a(this.angle,this.pitch,this.collisionBoxArray));var B=0,j=Object.keys(g.iconDependencies),F=l.mapObject(g.glyphDependencies,function(t){return Object.keys(t).map(Number)}),U=function(t){if(t)return h(t);if(B++,2===B){for(var e=new a(f.angle,f.pitch,f.collisionBoxArray),r=0,i=f.symbolBuckets;r=(new Date).getTime()}),!this.times.length},n.prototype.set=function(t){return this.times.push({id:this.n,time:t+(new Date).getTime()}),this.n++},n.prototype.cancel=function(t){this.times=this.times.filter(function(e){return e.id!==t})},e.exports=n},{}],58:[function(t,e,r){"use strict";var n=t("../util/evented"),i=t("../util/ajax"),o=t("../util/browser"),a=t("../util/mapbox").normalizeSpriteURL,s=function(){this.x=0,this.y=0,this.width=0,this.height=0,this.pixelRatio=1,this.sdf=!1},u=function(t){function e(e){var r=this;t.call(this),this.base=e,this.retina=o.devicePixelRatio>1;var n=this.retina?"@2x":"";i.getJSON(a(e,n,".json"),function(t,e){return t?void r.fire("error",{error:t}):(r.data=e,void(r.imgData&&r.fire("data",{dataType:"style"})))}),i.getImage(a(e,n,".png"),function(t,e){if(t)return void r.fire("error",{error:t});r.imgData=o.getImageData(e);for(var n=0;n1!==this.retina){var r=new e(this.base);r.on("data",function(){t.data=r.data,t.imgData=r.imgData,t.width=r.width,t.retina=r.retina})}},e.prototype.getSpritePosition=function(t){if(!this.loaded())return new s;var e=this.data&&this.data[t];return e&&this.imgData?e:new s},e}(n);e.exports=u},{"../util/ajax":107,"../util/browser":108,"../util/evented":116,"../util/mapbox":123}],59:[function(t,e,r){"use strict";var n=t("./style_spec"),i=t("../util/util"),o=t("../util/evented"),a=t("./validate_style"),s=t("./style_declaration"),u=t("./style_transition"),l="-transition",c=function(t){function e(e){t.call(this),this.properties=["anchor","color","position","intensity"],this._specifications=n.light,this.set(e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){var e=this;if(!this._validate(a.light,t)){this._declarations={},this._transitions={},this._transitionOptions={},this.calculated={},t=i.extend({anchor:this._specifications.anchor.default,color:this._specifications.color.default,position:this._specifications.position.default,intensity:this._specifications.intensity.default},t);for(var r=0,n=this.properties;rMath.floor(t)&&(e.lastIntegerZoom=Math.floor(t+1),e.lastIntegerZoomTime=Date.now()),e.lastZoom=t},e.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},e.prototype.update=function(t,e){var r=this;if(this._changed){var n=Object.keys(this._updatedLayers),i=Object.keys(this._removedLayers);(n.length||i.length||this._updatedSymbolOrder)&&this._updateWorkerLayers(n,i);for(var o in this._updatedSources){var a=r._updatedSources[o];"reload"===a?r._reloadSource(o):"clear"===a&&r._clearSource(o)}this._applyClasses(t,e),this._resetUpdates(),this.fire("data",{dataType:"style"})}},e.prototype._updateWorkerLayers=function(t,e){var r=this,n=this._updatedSymbolOrder?this._order.filter(function(t){return"symbol"===r._layers[t].type}):null;this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(t),removedIds:e,symbolOrder:n})},e.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSymbolOrder=!1,this._updatedSources={},this._updatedPaintProps={},this._updatedAllPaintProps=!1},e.prototype.setState=function(t){var e=this;if(this._checkLoaded(),y.emitErrors(this,y(t)))return!1;t=c.extend({},t),t.layers=E(t.layers);var r=T(this.serialize(),t).filter(function(t){return!(t.command in z)});if(0===r.length)return!1;var n=r.filter(function(t){return!(t.command in S)});if(n.length>0)throw new Error("Unimplemented: "+n.map(function(t){return t.command}).join(", ")+".");return r.forEach(function(t){"setTransition"!==t.command&&e[t.command].apply(e,t.args)}),this.stylesheet=t,!0},e.prototype.addSource=function(t,e,r){if(this._checkLoaded(),void 0!==this.sourceCaches[t])throw new Error("There is already a source with this ID");if(!e.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(e)+".");var n=["vector","raster","geojson","video","image"],i=n.indexOf(e.type)>=0;if(!i||!this._validate(y.source,"sources."+t,e,null,r)){var o=this.sourceCaches[t]=new _(t,e,this.dispatcher);o.style=this,o.setEventedParent(this,function(){return{isSourceLoaded:o.loaded(),source:o.serialize(),sourceId:t}}),o.onAdd(this.map),this._changed=!0}},e.prototype.removeSource=function(t){if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error("There is no source with this ID");var e=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],e.setEventedParent(null),e.clearTiles(),e.onRemove&&e.onRemove(this.map),this._changed=!0},e.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},e.prototype.addLayer=function(t,e,r){this._checkLoaded();var n=t.id;if(!this._validate(y.layer,"layers."+n,t,{arrayIndex:-1},r)){var o=i.create(t);this._validateLayer(o),o.setEventedParent(this,{layer:{id:n}});var a=e?this._order.indexOf(e):this._order.length;this._order.splice(a,0,n),this._layers[n]=o,this._removedLayers[n]&&(delete this._removedLayers[n],this._updatedSources[o.source]="clear"),this._updateLayer(o),"symbol"===o.type&&(this._updatedSymbolOrder=!0),this.updateClasses(n)}},e.prototype.moveLayer=function(t,e){this._checkLoaded(),this._changed=!0;var r=this._layers[t];if(!r)throw new Error("Layer not found: "+t);var n=this._order.indexOf(t);this._order.splice(n,1);var i=e?this._order.indexOf(e):this._order.length;this._order.splice(i,0,t),"symbol"===r.type&&(this._updatedSymbolOrder=!0,r.source&&!this._updatedSources[r.source]&&(this._updatedSources[r.source]="reload"))},e.prototype.removeLayer=function(t){this._checkLoaded();var e=this._layers[t];if(!e)throw new Error("Layer not found: "+t);e.setEventedParent(null);var r=this._order.indexOf(t);this._order.splice(r,1),"symbol"===e.type&&(this._updatedSymbolOrder=!0),this._changed=!0,this._removedLayers[t]=!0,delete this._layers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t]},e.prototype.getLayer=function(t){return this._layers[t]},e.prototype.setLayerZoomRange=function(t,e,r){this._checkLoaded();var n=this.getLayer(t);n.minzoom===e&&n.maxzoom===r||(null!=e&&(n.minzoom=e),null!=r&&(n.maxzoom=r),this._updateLayer(n))},e.prototype.setFilter=function(t,e){this._checkLoaded();var r=this.getLayer(t);null!==e&&void 0!==e&&this._validate(y.filter,"layers."+r.id+".filter",e)||c.deepEqual(r.filter,e)||(r.filter=c.clone(e),this._updateLayer(r))},e.prototype.getFilter=function(t){return c.clone(this.getLayer(t).filter)},e.prototype.setLayoutProperty=function(t,e,r){this._checkLoaded();var n=this.getLayer(t);c.deepEqual(n.getLayoutProperty(e),r)||(n.setLayoutProperty(e,r),this._updateLayer(n))},e.prototype.getLayoutProperty=function(t,e){return this.getLayer(t).getLayoutProperty(e)},e.prototype.setPaintProperty=function(t,e,r,n){this._checkLoaded();var i=this.getLayer(t);if(!c.deepEqual(i.getPaintProperty(e,n),r)){var o=i.isPaintValueFeatureConstant(e);i.setPaintProperty(e,r,n);var a=!(r&&b.isFunctionDefinition(r)&&"$zoom"!==r.property&&void 0!==r.property);a&&o||this._updateLayer(i),this.updateClasses(t,e)}},e.prototype.getPaintProperty=function(t,e,r){return this.getLayer(t).getPaintProperty(e,r)},e.prototype.getTransition=function(){return c.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},e.prototype.updateClasses=function(t,e){if(this._changed=!0,t){var r=this._updatedPaintProps;r[t]||(r[t]={}),r[t][e||"all"]=!0}else this._updatedAllPaintProps=!0},e.prototype.serialize=function(){var t=this;return c.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,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.sourceCaches,function(t){return t.serialize()}),layers:this._order.map(function(e){return t._layers[e].serialize()})},function(t){return void 0!==t})},e.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&(this._updatedSources[t.source]="reload"),this._changed=!0},e.prototype._flattenRenderedFeatures=function(t){for(var e=this,r=[],n=this._order.length-1;n>=0;n--)for(var i=e._order[n],o=0,a=t;o=this.maxzoom)||"none"===this.layout.visibility},e.prototype.updatePaintTransitions=function(t,e,r,n,o){for(var a=this,s=i.extend({},this._paintDeclarations[""]),u=0;u=this.endTime)return n;var o=this.oldTransition.calculate(t,e,this.startTime),a=i.easeCubicInOut((r-this.startTime-this.delay)/this.duration);return this.interp(o,n,a)},s.prototype._calculateTargetValue=function(t,e){if(!this.zoomTransitioned)return this.declaration.calculate(t,e);var r=t.zoom,n=this.zoomHistory.lastIntegerZoom,i=r>n?2:.5,a=this.declaration.calculate({zoom:r>n?r-1:r+1},e),s=this.declaration.calculate({zoom:r},e),u=Math.min((Date.now()-this.zoomHistory.lastIntegerZoomTime)/this.duration,1),l=Math.abs(r-n),c=o(u,1,l);return void 0!==a&&void 0!==s?{from:a,fromScale:i,to:s,toScale:1,t:c}:void 0},e.exports=s},{"../util/interpolate":119,"../util/util":127}],72:[function(t,e,r){"use strict";e.exports=t("mapbox-gl-style-spec/lib/validate_style.min"),e.exports.emitErrors=function(t,e){if(e&&e.length){for(var r=0;r-r/2;){if(a--,a<0)return!1;s-=t[a].dist(o),o=t[a]}s+=t[a].dist(t[a+1]),a++;for(var u=[],l=0;sn;)l-=u.shift().angleDelta;if(l>i)return!1;a++,s+=p.dist(h)}return!0}e.exports=n},{}],75:[function(t,e,r){"use strict";function n(t,e,r,n,o){for(var a=[],s=0;s=n&&h.x>=n||(p.x>=n?p=new i(n,p.y+(h.y-p.y)*((n-p.x)/(h.x-p.x)))._round():h.x>=n&&(h=new i(n,p.y+(h.y-p.y)*((n-p.x)/(h.x-p.x)))._round()),p.y>=o&&h.y>=o||(p.y>=o?p=new i(p.x+(h.x-p.x)*((o-p.y)/(h.y-p.y)),o)._round():h.y>=o&&(h=new i(p.x+(h.x-p.x)*((o-p.y)/(h.y-p.y)),o)._round()),u&&p.equals(u[u.length-1])||(u=[p],a.push(u)),u.push(h)))))}return a}var i=t("point-geometry");e.exports=n},{"point-geometry":194}],76:[function(t,e,r){"use strict";var n=t("../util/struct_array"),i=t("point-geometry"),o=n({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"}]});Object.defineProperty(o.prototype.StructType.prototype,"anchorPoint",{get:function(){return new i(this.anchorPointX,this.anchorPointY)}}),e.exports=o},{"../util/struct_array":125,"point-geometry":194}],77:[function(t,e,r){"use strict";var n=function(t,e,r,n,i,o,a,s,u,l,c){var p=a.top*s-u,h=a.bottom*s+u,f=a.left*s-u,d=a.right*s+u;if(this.boxStartIndex=t.length,l){var m=h-p,y=d-f;if(m>0)if(m=Math.max(10*s,m),c){var v=e[r.segment+1].sub(e[r.segment])._unit()._mult(y),g=[r.sub(v),r.add(v)];this._addLineCollisionBoxes(t,g,r,0,y,m,n,i,o)}else this._addLineCollisionBoxes(t,e,r,r.segment,y,m,n,i,o)}else t.emplaceBack(r.x,r.y,f,p,d,h,1/0,n,i,o,0,0,0,0,0);this.boxEndIndex=t.length};n.prototype._addLineCollisionBoxes=function(t,e,r,n,i,o,a,s,u){var l=o/2,c=Math.floor(i/l),p=-o/2,h=this.boxes,f=r,d=n+1,m=p;do{if(d--,d<0)return h;m-=e[d].dist(f),f=e[d]}while(m>-i/2);for(var y=e[d].dist(e[d+1]),v=0;v=e.length)return h;y=e[d].dist(e[d+1])}var _=g-m,x=e[d],b=e[d+1],w=b.sub(x)._unit()._mult(_)._add(x)._round(),E=Math.max(Math.abs(g-p)-l/2,0),T=i/2/E;t.emplaceBack(w.x,w.y,-o/2,-o/2,o/2,o/2,T,a,s,u,0,0,0,0,0)}return h},e.exports=n},{}],78:[function(t,e,r){"use strict";var n=t("point-geometry"),i=t("../data/extent"),o=t("grid-index"),a=t("../util/intersection_tests"),s=function(t,e,r){if("object"==typeof t){var n=t;r=e,t=n.angle,e=n.pitch,this.grid=new o(n.grid),this.ignoredGrid=new o(n.ignoredGrid)}else this.grid=new o(i,12,6),this.ignoredGrid=new o(i,12,0);this.minScale=.5,this.maxScale=2,this.angle=t,this.pitch=e;var a=Math.sin(t),s=Math.cos(t);if(this.rotationMatrix=[s,-a,a,s],this.reverseRotationMatrix=[s,a,-a,s],this.yStretch=1/Math.cos(e/180*Math.PI),this.yStretch=Math.pow(this.yStretch,1.3),this.collisionBoxArray=r,0===r.length){r.emplaceBack();var u=32767;r.emplaceBack(0,0,0,-u,0,u,u,0,0,0,0,0,0,0,0,0),r.emplaceBack(i,0,0,-u,0,u,u,0,0,0,0,0,0,0,0,0),r.emplaceBack(0,0,-u,0,u,0,u,0,0,0,0,0,0,0,0,0),r.emplaceBack(0,i,-u,0,u,0,u,0,0,0,0,0,0,0,0,0)}this.tempCollisionBox=r.get(0),this.edges=[r.get(1),r.get(2),r.get(3),r.get(4)]};s.prototype.serialize=function(t){var e=this.grid.toArrayBuffer(),r=this.ignoredGrid.toArrayBuffer();return t&&(t.push(e),t.push(r)),{angle:this.angle,pitch:this.pitch,grid:e,ignoredGrid:r}},s.prototype.placeCollisionFeature=function(t,e,r){for(var i=this,o=this.collisionBoxArray,a=this.minScale,s=this.rotationMatrix,u=this.yStretch,l=t.boxStartIndex;l=i.maxScale)return a}if(r){var w;if(i.angle){var E=i.reverseRotationMatrix,T=new n(c.x1,c.y1).matMult(E),S=new n(c.x2,c.y1).matMult(E),z=new n(c.x1,c.y2).matMult(E),A=new n(c.x2,c.y2).matMult(E);w=i.tempCollisionBox,w.anchorPointX=c.anchorPoint.x,w.anchorPointY=c.anchorPoint.y,w.x1=Math.min(T.x,S.x,z.x,A.x),w.y1=Math.min(T.y,S.x,z.x,A.x),w.x2=Math.max(T.x,S.x,z.x,A.x),w.y2=Math.max(T.y,S.x,z.x,A.x),w.maxScale=c.maxScale}else w=c;for(var M=0;M=i.maxScale)return a}}}return a},s.prototype.queryRenderedSymbols=function(t,e){var r={},i=[];if(0===t.length||0===this.grid.length&&0===this.ignoredGrid.length)return i;for(var o=this.collisionBoxArray,s=this.rotationMatrix,u=this.yStretch,l=[],c=1/0,p=1/0,h=-(1/0),f=-(1/0),d=0;dE.maxScale)){var z=E.anchorPoint.matMult(s),A=z.x+E.x1/e,M=z.y+E.y1/e*u,P=z.x+E.x2/e,L=z.y+E.y2/e*u,k=[new n(A,M),new n(P,M),new n(P,L),new n(A,L)];a.polygonIntersectsPolygon(l,k)&&(r[T][S]=!0,i.push(g[w]))}}return i},s.prototype.getPlacementScale=function(t,e,r,n,i){var o=e.x-n.x,a=e.y-n.y,s=(i.x1-r.x2)/o,u=(i.x2-r.x1)/o,l=(i.y1-r.y2)*this.yStretch/a,c=(i.y2-r.y1)*this.yStretch/a;(isNaN(s)||isNaN(u))&&(s=u=1),(isNaN(l)||isNaN(c))&&(l=c=1);var p=Math.min(Math.max(s,u),Math.max(l,c)),h=i.maxScale,f=r.maxScale;return p>h&&(p=h),p>f&&(p=f),p>t&&p>=i.placementScale&&(t=p),t},s.prototype.insertCollisionFeature=function(t,e,r){for(var n=this,i=r?this.ignoredGrid:this.grid,o=this.collisionBoxArray,a=t.boxStartIndex;a=0&&S=0&&z=0&&v+f<=d){var A=new a(S,z,E,_)._round();n&&!s(t,A,l,n,u)||g.push(A)}}y+=w}return p||g.length||c||(g=i(t,y/2,r,n,u,l,c,!0,h)),g}var o=t("../util/interpolate"),a=t("../symbol/anchor"),s=t("./check_max_angle");e.exports=n},{"../symbol/anchor":73,"../util/interpolate":119,"./check_max_angle":74}],80:[function(t,e,r){"use strict";var n=t("shelf-pack"),i=t("../util/util"),o=4,a=128,s=2048,u=function(){this.width=a,this.height=a,this.bin=new n(this.width,this.height),this.index={},this.ids={},this.data=new Uint8Array(this.width*this.height)};u.prototype.getGlyphs=function(){var t,e,r,n={};for(var i in this.ids)t=i.split("#"),e=t[0],r=t[1],n[e]||(n[e]=[]),n[e].push(r);return n},u.prototype.getRects=function(){var t,e,r,n=this,i={};for(var o in this.ids)t=o.split("#"),e=t[0],r=t[1],i[e]||(i[e]={}),i[e][r]=n.index[o];return i},u.prototype.addGlyph=function(t,e,r,n){var o=this;if(!r)return null;var a=e+"#"+r.id;if(this.index[a])return this.ids[a].indexOf(t)<0&&this.ids[a].push(t),this.index[a];if(!r.bitmap)return null;var s=r.width+2*n,u=r.height+2*n,l=1,c=s+2*l,p=u+2*l;c+=4-c%4,p+=4-p%4;var h=this.bin.packOne(c,p);if(h||(this.resize(),h=this.bin.packOne(c,p)),!h)return i.warnOnce("glyph bitmap overflow"),null;this.index[a]=h,this.ids[a]=[t];for(var f=this.data,d=r.bitmap,m=0;m=s||r>=s)){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),i=0;i65535)return r("glyphs > 65535 not supported");void 0===this.loading[t]&&(this.loading[t]={});var i=this.loading[t];if(i[e])i[e].push(r);else{i[e]=[r];var a=256*e+"-"+(256*e+255),u=n(t,a,this.url);o.getArrayBuffer(u,function(t,r){for(var n=!t&&new s(new l(r)),o=0;o1?2:1,this.canvas&&(this.canvas.width=this.width*this.pixelRatio,this.canvas.height=this.height*this.pixelRatio)),this.sprite=t},u.prototype.addIcons=function(t,e){for(var r=this,n=0;n1||(E?(clearTimeout(E),E=null,v("dblclick",e)):E=setTimeout(f,300))}function c(t){g("touchmove",t)}function p(t){g("touchend",t)}function h(t){g("touchcancel",t)}function f(){E=null}function d(t){var e=n.mousePos(_,t);e.equals(w)&&v("click",t)}function m(t){v("dblclick",t),t.preventDefault()}function y(e){var r=t.dragRotate&&t.dragRotate.isActive();b||r?b&&(x=e):v("contextmenu",e),e.preventDefault()}function v(e,r){var i=n.mousePos(_,r);return t.fire(e,{lngLat:t.unproject(i),point:i,originalEvent:r})}function g(e,r){var o=n.touchPos(_,r),a=o.reduce(function(t,e,r,n){return t.add(e.div(n.length))},new i(0,0));return t.fire(e,{lngLat:t.unproject(a),point:a,lngLats:o.map(function(e){return t.unproject(e)},this),points:o,originalEvent:r})}var _=t.getCanvasContainer(),x=null,b=!1,w=null,E=null;for(var T in o)t[T]=new o[T](t,e),e.interactive&&e[T]&&t[T].enable();_.addEventListener("mouseout",r,!1),_.addEventListener("mousedown",a,!1),_.addEventListener("mouseup",s,!1),_.addEventListener("mousemove",u,!1),_.addEventListener("touchstart",l,!1),_.addEventListener("touchend",p,!1),_.addEventListener("touchmove",c,!1),_.addEventListener("touchcancel",h,!1),_.addEventListener("click",d,!1),_.addEventListener("dblclick",m,!1),_.addEventListener("contextmenu",y,!1)}},{"../util/dom":115,"./handler/box_zoom":95,"./handler/dblclick_zoom":96,"./handler/drag_pan":97,"./handler/drag_rotate":98,"./handler/keyboard":99,"./handler/scroll_zoom":100,"./handler/touch_zoom_rotate":101,"point-geometry":194}],90:[function(t,e,r){"use strict";var n=t("../util/util"),i=t("../util/interpolate"),o=t("../util/browser"),a=t("../geo/lng_lat"),s=t("../geo/lng_lat_bounds"),u=t("point-geometry"),l=t("../util/evented"),c=function(t){function e(e,r){t.call(this),this.transform=e,this._bearingSnap=r.bearingSnap}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCenter=function(){return this.transform.center},e.prototype.setCenter=function(t,e){return this.jumpTo({center:t},e),this},e.prototype.panBy=function(t,e,r){return this.panTo(this.transform.center,n.extend({offset:u.convert(t).mult(-1)},e),r),this},e.prototype.panTo=function(t,e,r){return this.easeTo(n.extend({center:t},e),r)},e.prototype.getZoom=function(){return this.transform.zoom},e.prototype.setZoom=function(t,e){return this.jumpTo({zoom:t},e),this},e.prototype.zoomTo=function(t,e,r){return this.easeTo(n.extend({zoom:t},e),r)},e.prototype.zoomIn=function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},e.prototype.zoomOut=function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},e.prototype.getBearing=function(){return this.transform.bearing},e.prototype.setBearing=function(t,e){return this.jumpTo({bearing:t},e),this},e.prototype.rotateTo=function(t,e,r){return this.easeTo(n.extend({bearing:t},e),r)},e.prototype.resetNorth=function(t,e){return this.rotateTo(0,n.extend({duration:1e3},t),e),this},e.prototype.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 _=c.zoomScale(y-h),x=c.point,b="center"in t?c.project(m).sub(p.div(_)):x,w=t.curve,E=Math.max(c.width,c.height),T=E/_,S=b.sub(x).mag();if("minZoom"in t){var z=n.clamp(Math.min(t.minZoom,h,y),c.minZoom,c.maxZoom),A=E/c.zoomScale(z-h);w=Math.sqrt(A/S*2)}var M=w*w,P=r(0),L=function(t){return s(P)/s(P+w*t)},k=function(t){return E*((s(P)*l(P+w*t)-o(P))/M)/S},C=(r(1)-P)/w;if(Math.abs(S)<1e-6){if(Math.abs(E-T)<1e-6)return this.easeTo(t);var I=T=0)return!1;return!0}),this._container.innerHTML=t.join(" | "),this._editLink=null}},o.prototype._updateCompact=function(){var t=this._map.getCanvasContainer().offsetWidth<=640;this._container.classList[t?"add":"remove"]("compact")},e.exports=o},{"../../util/dom":115,"../../util/util":127}],92:[function(t,e,r){"use strict";function n(t){void 0!==i?t(i):void 0!==s.navigator.permissions?s.navigator.permissions.query({name:"geolocation"}).then(function(e){i="denied"!==e.state,t(i)}):(i=!!s.navigator.geolocation,t(i))}var i,o=t("../../util/evented"),a=t("../../util/dom"),s=t("../../util/window"),u=t("../../util/util"),l={enableHighAccuracy:!1,timeout:6e3},c="mapboxgl-ctrl",p=function(t){function e(e){t.call(this),this.options=e,u.bindAll(["_onSuccess","_onError","_finish","_setupUI"],this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.onAdd=function(t){return this._map=t,this._container=a.create("div",c+" "+c+"-group"),n(this._setupUI),this._container},e.prototype.onRemove=function(){this._container.parentNode.removeChild(this._container),this._map=void 0},e.prototype._onSuccess=function(t){this._map.jumpTo({center:[t.coords.longitude,t.coords.latitude],zoom:17,bearing:0,pitch:0}),this.fire("geolocate",t),this._finish()},e.prototype._onError=function(t){this.fire("error",t),this._finish()},e.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},e.prototype._setupUI=function(t){t!==!1&&(this._container.addEventListener("contextmenu",function(t){return t.preventDefault()}),this._geolocateButton=a.create("button",c+"-icon "+c+"-geolocate",this._container),this._geolocateButton.type="button",this._geolocateButton.setAttribute("aria-label","Geolocate"),this.options.watchPosition&&this._geolocateButton.setAttribute("aria-pressed",!1),this._geolocateButton.addEventListener("click",this._onClickGeolocate.bind(this)))},e.prototype._onClickGeolocate=function(){var t=u.extend(l,this.options&&this.options.positionOptions||{});this.options.watchPosition?void 0!==this._geolocationWatchID?(this._geolocateButton.classList.remove("watching"),this._geolocateButton.setAttribute("aria-pressed",!1),s.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0):(this._geolocateButton.classList.add("watching"),this._geolocateButton.setAttribute("aria-pressed",!0),this._geolocationWatchID=s.navigator.geolocation.watchPosition(this._onSuccess,this._onError,t)):(s.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,t),this._timeoutId=setTimeout(this._finish,1e4))},e}(o);e.exports=p},{"../../util/dom":115,"../../util/evented":116,"../../util/util":127,"../../util/window":110}],93:[function(t,e,r){"use strict";function n(t){return new o.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 i=t("../../util/dom"),o=t("../../util/window"),a=t("../../util/util"),s="mapboxgl-ctrl",u=function(){a.bindAll(["_rotateCompassArrow"],this)};u.prototype._rotateCompassArrow=function(){var t="rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassArrow.style.transform=t},u.prototype.onAdd=function(t){return this._map=t,this._container=i.create("div",s+" "+s+"-group",t.getContainer()),this._container.addEventListener("contextmenu",this._onContextMenu.bind(this)),this._zoomInButton=this._createButton(s+"-icon "+s+"-zoom-in","Zoom In",t.zoomIn.bind(t)),this._zoomOutButton=this._createButton(s+"-icon "+s+"-zoom-out","Zoom Out",t.zoomOut.bind(t)),this._compass=this._createButton(s+"-icon "+s+"-compass","Reset North",t.resetNorth.bind(t)),this._compassArrow=i.create("span","arrow",this._compass),this._compass.addEventListener("mousedown",this._onCompassDown.bind(this)),this._onCompassMove=this._onCompassMove.bind(this),this._onCompassUp=this._onCompassUp.bind(this),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._container},u.prototype.onRemove=function(){this._container.parentNode.removeChild(this._container),this._map.off("rotate",this._rotateCompassArrow),this._map=void 0},u.prototype._onContextMenu=function(t){t.preventDefault()},u.prototype._onCompassDown=function(t){0===t.button&&(i.disableDrag(),o.document.addEventListener("mousemove",this._onCompassMove),o.document.addEventListener("mouseup",this._onCompassUp),this._map.getCanvasContainer().dispatchEvent(n(t)),t.stopPropagation())},u.prototype._onCompassMove=function(t){0===t.button&&(this._map.getCanvasContainer().dispatchEvent(n(t)),t.stopPropagation())},u.prototype._onCompassUp=function(t){0===t.button&&(o.document.removeEventListener("mousemove",this._onCompassMove),o.document.removeEventListener("mouseup",this._onCompassUp),i.enableDrag(),this._map.getCanvasContainer().dispatchEvent(n(t)),t.stopPropagation())},u.prototype._createButton=function(t,e,r){var n=i.create("button",t,this._container);return n.type="button",n.setAttribute("aria-label",e),n.addEventListener("click",function(){r()}),n},e.exports=u},{"../../util/dom":115,"../../util/util":127,"../../util/window":110}],94:[function(t,e,r){"use strict";function n(t,e,r){var n=r&&r.maxWidth||100,a=t._container.clientHeight/2,s=o(t.unproject([0,a]),t.unproject([n,a]));if(r&&"imperial"===r.unit){var u=3.2808*s;if(u>5280){var l=u/5280;i(e,n,l,"mi")}else i(e,n,u,"ft")}else i(e,n,s,"m")}function i(t,e,r,n){var i=a(r),o=i/r;"m"===n&&i>=1e3&&(i/=1e3,n="km"),t.style.width=e*o+"px",t.innerHTML=i+n}function o(t,e){var r=6371e3,n=Math.PI/180,i=t.lat*n,o=e.lat*n,a=Math.sin(i)*Math.sin(o)+Math.cos(i)*Math.cos(o)*Math.cos((e.lng-t.lng)*n),s=r*Math.acos(Math.min(a,1));return s}function a(t){var e=Math.pow(10,(""+Math.floor(t)).length-1),r=t/e;return r=r>=10?10:r>=5?5:r>=3?3:r>=2?2:1,e*r}var s=t("../../util/dom"),u=t("../../util/util"),l=function(t){this.options=t,u.bindAll(["_onMove"],this)};l.prototype.getDefaultPosition=function(){return"bottom-left"},l.prototype._onMove=function(){n(this._map,this._container,this.options)},l.prototype.onAdd=function(t){return this._map=t,this._container=s.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},l.prototype.onRemove=function(){this._container.parentNode.removeChild(this._container),this._map.off("move",this._onMove),this._map=void 0},e.exports=l},{"../../util/dom":115,"../../util/util":127}],95:[function(t,e,r){"use strict";var n=t("../../util/dom"),i=t("../../geo/lng_lat_bounds"),o=t("../../util/util"),a=t("../../util/window"),s=function(t){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),o.bindAll(["_onMouseDown","_onMouseMove","_onMouseUp","_onKeyDown"],this)};s.prototype.isEnabled=function(){return!!this._enabled},s.prototype.isActive=function(){return!!this._active},s.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onMouseDown,!1),this._enabled=!0)},s.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onMouseDown),this._enabled=!1)},s.prototype._onMouseDown=function(t){t.shiftKey&&0===t.button&&(a.document.addEventListener("mousemove",this._onMouseMove,!1),a.document.addEventListener("keydown",this._onKeyDown,!1),a.document.addEventListener("mouseup",this._onMouseUp,!1),n.disableDrag(),this._startPos=n.mousePos(this._el,t),this._active=!0)},s.prototype._onMouseMove=function(t){var e=this._startPos,r=n.mousePos(this._el,t);this._box||(this._box=n.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var i=Math.min(e.x,r.x),o=Math.max(e.x,r.x),a=Math.min(e.y,r.y),s=Math.max(e.y,r.y);n.setTransform(this._box,"translate("+i+"px,"+a+"px)"),this._box.style.width=o-i+"px",this._box.style.height=s-a+"px"},s.prototype._onMouseUp=function(t){if(0===t.button){var e=this._startPos,r=n.mousePos(this._el,t),o=(new i).extend(this._map.unproject(e)).extend(this._map.unproject(r));this._finish(),e.x===r.x&&e.y===r.y?this._fireEvent("boxzoomcancel",t):this._map.fitBounds(o,{linear:!0}).fire("boxzoomend",{originalEvent:t,boxZoomBounds:o})}},s.prototype._onKeyDown=function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t))},s.prototype._finish=function(){this._active=!1,a.document.removeEventListener("mousemove",this._onMouseMove,!1),a.document.removeEventListener("keydown",this._onKeyDown,!1),a.document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.parentNode.removeChild(this._box),this._box=null),n.enableDrag()},s.prototype._fireEvent=function(t,e){return this._map.fire(t,{originalEvent:e})},e.exports=s},{"../../geo/lng_lat_bounds":20,"../../util/dom":115,"../../util/util":127,"../../util/window":110}],96:[function(t,e,r){"use strict";var n=function(t){this._map=t,this._onDblClick=this._onDblClick.bind(this)};n.prototype.isEnabled=function(){return!!this._enabled},n.prototype.enable=function(){this.isEnabled()||(this._map.on("dblclick",this._onDblClick),this._enabled=!0)},n.prototype.disable=function(){this.isEnabled()&&(this._map.off("dblclick",this._onDblClick),this._enabled=!1)},n.prototype._onDblClick=function(t){this._map.zoomTo(this._map.getZoom()+(t.originalEvent.shiftKey?-1:1),{around:t.lngLat},t)},e.exports=n},{}],97:[function(t,e,r){"use strict";var n=t("../../util/dom"),i=t("../../util/util"),o=t("../../util/window"),a=.3,s=i.bezier(0,0,a,1),u=1400,l=2500,c=function(t){this._map=t,this._el=t.getCanvasContainer(),i.bindAll(["_onDown","_onMove","_onUp","_onTouchEnd","_onMouseUp"],this)};c.prototype.isEnabled=function(){return!!this._enabled},c.prototype.isActive=function(){return!!this._active},c.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._el.addEventListener("touchstart",this._onDown),this._enabled=!0)},c.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._el.removeEventListener("touchstart",this._onDown),this._enabled=!1)},c.prototype._onDown=function(t){this._ignoreEvent(t)||this.isActive()||(t.touches?(o.document.addEventListener("touchmove",this._onMove),o.document.addEventListener("touchend",this._onTouchEnd)):(o.document.addEventListener("mousemove",this._onMove),o.document.addEventListener("mouseup",this._onMouseUp)),this._active=!1,this._startPos=this._pos=n.mousePos(this._el,t),this._inertia=[[Date.now(),this._pos]])},c.prototype._onMove=function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._fireEvent("dragstart",t),this._fireEvent("movestart",t));var e=n.mousePos(this._el,t),r=this._map;r.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),e]),r.transform.setLocationAtPoint(r.transform.pointLocation(this._pos),e), -this._fireEvent("drag",t),this._fireEvent("move",t),this._pos=e,t.preventDefault()}},c.prototype._onUp=function(t){var e=this;if(this.isActive()){this._active=!1,this._fireEvent("dragend",t),this._drainInertiaBuffer();var r=function(){return e._fireEvent("moveend",t)},n=this._inertia;if(n.length<2)return void r();var i=n[n.length-1],o=n[0],c=i[1].sub(o[1]),p=(i[0]-o[0])/1e3;if(0===p||i[1].equals(o[1]))return void r();var h=c.mult(a/p),f=h.mag();f>u&&(f=u,h._unit()._mult(f));var d=f/(l*a),m=h.mult(-d/2);this._map.panBy(m,{duration:1e3*d,easing:s,noMoveStart:!0},{originalEvent:t})}},c.prototype._onMouseUp=function(t){this._ignoreEvent(t)||(this._onUp(t),o.document.removeEventListener("mousemove",this._onMove),o.document.removeEventListener("mouseup",this._onMouseUp))},c.prototype._onTouchEnd=function(t){this._ignoreEvent(t)||(this._onUp(t),o.document.removeEventListener("touchmove",this._onMove),o.document.removeEventListener("touchend",this._onTouchEnd))},c.prototype._fireEvent=function(t,e){return this._map.fire(t,{originalEvent:e})},c.prototype._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 r=1,n=0;return"mousemove"===t.type?t.buttons&0===r:t.button!==n},c.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,e=Date.now(),r=160;t.length>0&&e-t[0][0]>r;)t.shift()},e.exports=c},{"../../util/dom":115,"../../util/util":127,"../../util/window":110}],98:[function(t,e,r){"use strict";var n=t("../../util/dom"),i=t("../../util/util"),o=t("../../util/window"),a=.25,s=i.bezier(0,0,a,1),u=180,l=720,c=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._bearingSnap=e.bearingSnap,this._pitchWithRotate=e.pitchWithRotate!==!1,i.bindAll(["_onDown","_onMove","_onUp"],this)};c.prototype.isEnabled=function(){return!!this._enabled},c.prototype.isActive=function(){return!!this._active},c.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._enabled=!0)},c.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._enabled=!1)},c.prototype._onDown=function(t){this._ignoreEvent(t)||this.isActive()||(o.document.addEventListener("mousemove",this._onMove),o.document.addEventListener("mouseup",this._onUp),this._active=!1,this._inertia=[[Date.now(),this._map.getBearing()]],this._startPos=this._pos=n.mousePos(this._el,t),this._center=this._map.transform.centerPoint,t.preventDefault())},c.prototype._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 r=this._pos,i=n.mousePos(this._el,t),o=.8*(r.x-i.x),a=(r.y-i.y)*-.5,s=e.getBearing()-o,u=e.getPitch()-a,l=this._inertia,c=l[l.length-1];this._drainInertiaBuffer(),l.push([Date.now(),e._normalizeBearing(s,c[1])]),e.transform.bearing=s,this._pitchWithRotate&&(e.transform.pitch=u),this._fireEvent("rotate",t),this._fireEvent("move",t),this._pos=i}},c.prototype._onUp=function(t){var e=this;if(!this._ignoreEvent(t)&&(o.document.removeEventListener("mousemove",this._onMove),o.document.removeEventListener("mouseup",this._onUp),this.isActive())){this._active=!1,this._fireEvent("rotateend",t),this._drainInertiaBuffer();var r=this._map,n=r.getBearing(),i=this._inertia,c=function(){Math.abs(n)u&&(g=u);var _=g/(l*a),x=y*g*(_/2);d+=x,Math.abs(r._normalizeBearing(d,0))1;var r=t.ctrlKey?1:2,n=t.ctrlKey?0:2,i=t.button;return"undefined"!=typeof InstallTrigger&&2===t.button&&t.ctrlKey&&o.navigator.platform.toUpperCase().indexOf("MAC")>=0&&(i=0),"mousemove"===t.type?t.buttons&0===r:i!==n},c.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,e=Date.now(),r=160;t.length>0&&e-t[0][0]>r;)t.shift()},e.exports=c},{"../../util/dom":115,"../../util/util":127,"../../util/window":110}],99:[function(t,e,r){"use strict";function n(t){return t*(2-t)}var i=100,o=15,a=10,s=function(t){this._map=t,this._el=t.getCanvasContainer(),this._onKeyDown=this._onKeyDown.bind(this)};s.prototype.isEnabled=function(){return!!this._enabled},s.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)},s.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)},s.prototype._onKeyDown=function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=0,r=0,s=0,u=0,l=0;switch(t.keyCode){case 61:case 107:case 171:case 187:e=1;break;case 189:case 109:case 173:e=-1;break;case 37:t.shiftKey?r=-1:(t.preventDefault(),u=-1);break;case 39:t.shiftKey?r=1:(t.preventDefault(),u=1);break;case 38:t.shiftKey?s=1:(t.preventDefault(),l=-1);break;case 40:t.shiftKey?s=-1:(l=1,t.preventDefault())}var c=this._map,p=c.getZoom(),h={duration:300,delayEndEvents:500,easing:n,zoom:e?Math.round(p)+e*(t.shiftKey?2:1):p,bearing:c.getBearing()+r*o,pitch:c.getPitch()+s*a,offset:[-u*i,-l*i],center:c.getCenter()};c.easeTo(h,{originalEvent:t})}},e.exports=s},{}],100:[function(t,e,r){"use strict";var n=t("../../util/dom"),i=t("../../util/util"),o=t("../../util/browser"),a=t("../../util/window"),s=a.navigator.userAgent.toLowerCase(),u=s.indexOf("firefox")!==-1,l=s.indexOf("safari")!==-1&&s.indexOf("chrom")===-1,c=function(t){this._map=t,this._el=t.getCanvasContainer(),i.bindAll(["_onWheel","_onTimeout"],this)};c.prototype.isEnabled=function(){return!!this._enabled},c.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("wheel",this._onWheel,!1),this._el.addEventListener("mousewheel",this._onWheel,!1),this._enabled=!0)},c.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("wheel",this._onWheel),this._el.removeEventListener("mousewheel",this._onWheel),this._enabled=!1)},c.prototype._onWheel=function(t){var e;"wheel"===t.type?(e=t.deltaY,u&&t.deltaMode===a.WheelEvent.DOM_DELTA_PIXEL&&(e/=o.devicePixelRatio),t.deltaMode===a.WheelEvent.DOM_DELTA_LINE&&(e*=40)):"mousewheel"===t.type&&(e=-t.wheelDeltaY,l&&(e/=3));var r=o.now(),i=r-(this._time||0);this._pos=n.mousePos(this._el,t),this._time=r,0!==e&&e%4.000244140625===0?this._type="wheel":0!==e&&Math.abs(e)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40)):this._type||(this._type=Math.abs(i*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()},c.prototype._onTimeout=function(){this._type="wheel",this._zoom(-this._lastValue)},c.prototype._zoom=function(t,e){if(0!==t){var r=this._map,n=2/(1+Math.exp(-Math.abs(t/100)));t<0&&0!==n&&(n=1/n);var i=r.ease?r.ease.to:r.transform.scale,o=r.transform.scaleZoom(i*n);r.zoomTo(o,{duration:"wheel"===this._type?200:0,around:r.unproject(this._pos),delayEndEvents:200,smoothEasing:!0},{originalEvent:e})}},e.exports=c},{"../../util/browser":108,"../../util/dom":115,"../../util/util":127,"../../util/window":110}],101:[function(t,e,r){"use strict";var n=t("../../util/dom"),i=t("../../util/util"),o=t("../../util/window"),a=.15,s=i.bezier(0,0,a,1),u=12,l=2.5,c=.15,p=4,h=function(t){this._map=t,this._el=t.getCanvasContainer(),i.bindAll(["_onStart","_onMove","_onEnd"],this)};h.prototype.isEnabled=function(){return!!this._enabled},h.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("touchstart",this._onStart,!1),this._enabled=!0)},h.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("touchstart",this._onStart),this._enabled=!1)},h.prototype.disableRotation=function(){this._rotationDisabled=!0},h.prototype.enableRotation=function(){this._rotationDisabled=!1},h.prototype._onStart=function(t){if(2===t.touches.length){var e=n.mousePos(this._el,t.touches[0]),r=n.mousePos(this._el,t.touches[1]);this._startVec=e.sub(r),this._startScale=this._map.transform.scale,this._startBearing=this._map.transform.bearing,this._gestureIntent=void 0,this._inertia=[],o.document.addEventListener("touchmove",this._onMove,!1),o.document.addEventListener("touchend",this._onEnd,!1)}},h.prototype._onMove=function(t){if(2===t.touches.length){var e=n.mousePos(this._el,t.touches[0]),r=n.mousePos(this._el,t.touches[1]),i=e.add(r).div(2),o=e.sub(r),a=o.mag()/this._startVec.mag(),s=this._rotationDisabled?0:180*o.angleWith(this._startVec)/Math.PI,u=this._map;if(this._gestureIntent){var l={duration:0,around:u.unproject(i)};"rotate"===this._gestureIntent&&(l.bearing=this._startBearing+s),"zoom"!==this._gestureIntent&&"rotate"!==this._gestureIntent||(l.zoom=u.transform.scaleZoom(this._startScale*a)),u.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),a,i]),u.easeTo(l,{originalEvent:t})}else{var h=Math.abs(1-a)>c,f=Math.abs(s)>p;f?this._gestureIntent="rotate":h&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._startVec=o,this._startScale=u.transform.scale,this._startBearing=u.transform.bearing)}t.preventDefault()}},h.prototype._onEnd=function(t){o.document.removeEventListener("touchmove",this._onMove),o.document.removeEventListener("touchend",this._onEnd),this._drainInertiaBuffer();var e=this._inertia,r=this._map;if(e.length<2)return void r.snapToNorth({},{originalEvent:t});var n=e[e.length-1],i=e[0],c=r.transform.scaleZoom(this._startScale*n[1]),p=r.transform.scaleZoom(this._startScale*i[1]),h=c-p,f=(n[0]-i[0])/1e3,d=n[2];if(0===f||c===p)return void r.snapToNorth({},{originalEvent:t});var m=h*a/f;Math.abs(m)>l&&(m=m>0?l:-l);var y=1e3*Math.abs(m/(u*a)),v=c+m*y/2e3;v<0&&(v=0),r.easeTo({zoom:v,duration:y,easing:s,around:r.unproject(d)},{originalEvent:t})},h.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,e=Date.now(),r=160;t.length>2&&e-t[0][0]>r;)t.shift()},e.exports=h},{"../../util/dom":115,"../../util/util":127,"../../util/window":110}],102:[function(t,e,r){"use strict";var n=t("../util/util"),i=t("../util/window"),o=function(){n.bindAll(["_onHashChange","_updateHash"],this)};o.prototype.addTo=function(t){return this._map=t,i.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},o.prototype.remove=function(){return i.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),delete this._map,this},o.prototype._onHashChange=function(){var t=i.location.hash.replace("#","").split("/");return t.length>=3&&(this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:+(t[3]||0),pitch:+(t[4]||0)}),!0)},o.prototype._updateHash=function(){var t=this._map.getCenter(),e=this._map.getZoom(),r=this._map.getBearing(),n=this._map.getPitch(),o=Math.max(0,Math.ceil(Math.log(e)/Math.LN2)),a="#"+Math.round(100*e)/100+"/"+t.lat.toFixed(o)+"/"+t.lng.toFixed(o);(r||n)&&(a+="/"+Math.round(10*r)/10),n&&(a+="/"+Math.round(n)),i.history.replaceState("","",a)},e.exports=o},{"../util/util":127,"../util/window":110}],103:[function(t,e,r){"use strict";function n(t){t.parentNode&&t.parentNode.removeChild(t)}var i=t("../util/util"),o=t("../util/browser"),a=t("../util/window"),s=t("../util/dom"),u=t("../style/style"),l=t("../style/animation_loop"),c=t("../render/painter"),p=t("../geo/transform"),h=t("./hash"),f=t("./bind_handlers"),d=t("./camera"),m=t("../geo/lng_lat"),y=t("../geo/lng_lat_bounds"),v=t("point-geometry"),g=t("./control/attribution_control"),_=t("mapbox-gl-supported"),x=0,b=20,w={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:x,maxZoom:b,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},E=function(t){function e(e){var r=this;e=i.extend({},w,e);var n=new p(e.minZoom,e.maxZoom);if(t.call(this,n,e),this._interactive=e.interactive,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,"string"==typeof e.container){if(this._container=a.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else this._container=e.container;this.animationLoop=new l,e.maxBounds&&this.setMaxBounds(e.maxBounds),i.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored","_update","_render","_onData","_onDataLoading"],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(){r.animationLoop.set(300),r._rerender()}),"undefined"!=typeof a&&(a.addEventListener("online",this._onWindowOnline,!1),a.addEventListener("resize",this._onWindowResize,!1)),f(this,e),this._hash=e.hash&&(new h).addTo(this),this._hash&&this._hash._onHashChange()||this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),this._classes=[],this.resize(),e.classes&&this.setClasses(e.classes),e.style&&this.setStyle(e.style),e.attributionControl&&this.addControl(new g),this.on("style.load",function(){this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this.style.update(this._classes,{transition:!1})}),this.on("data",this._onData),this.on("dataloading",this._onDataLoading)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={showTileBoundaries:{},showCollisionBoxes:{},showOverdrawInspector:{},repaint:{},vertices:{}};return e.prototype.addControl=function(t,e){void 0===e&&t.getDefaultPosition&&(e=t.getDefaultPosition()),void 0===e&&(e="top-right");var r=t.onAdd(this),n=this._controlPositions[e];return e.indexOf("bottom")!==-1?n.insertBefore(r,n.firstChild):n.appendChild(r),this},e.prototype.removeControl=function(t){return t.onRemove(this),this},e.prototype.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))},e.prototype.removeClass=function(t,e){var r=this._classes.indexOf(t);return r<0||""===t?this:(this._classes.splice(r,1),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},e.prototype.setClasses=function(t,e){for(var r={},n=0;n=0},e.prototype.getClasses=function(){return this._classes},e.prototype.resize=function(){var t=this._containerDimensions(),e=t[0],r=t[1];return this._resizeCanvas(e,r),this.transform.resize(e,r),this.painter.resize(e,r),this.fire("movestart").fire("move").fire("resize").fire("moveend")},e.prototype.getBounds=function(){var t=new y(this.transform.pointLocation(new v(0,this.transform.height)),this.transform.pointLocation(new v(this.transform.width,0)));return(this.transform.angle||this.transform.pitch)&&(t.extend(this.transform.pointLocation(new v(this.transform.size.x,0))),t.extend(this.transform.pointLocation(new v(0,this.transform.size.y)))),t},e.prototype.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},e.prototype.setMinZoom=function(t){if(t=null===t||void 0===t?x:t,t>=x&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},e.prototype.getMaxZoom=function(){return this.transform.maxZoom},e.prototype.project=function(t){return this.transform.locationPoint(m.convert(t))},e.prototype.unproject=function(t){return this.transform.pointLocation(v.convert(t))},e.prototype.queryRenderedFeatures=function(){function t(t){return t instanceof v||Array.isArray(t)}var e,r={};return 2===arguments.length?(e=arguments[0],r=arguments[1]):1===arguments.length&&t(arguments[0])?e=arguments[0]:1===arguments.length&&(r=arguments[0]),this.style.queryRenderedFeatures(this._makeQueryGeometry(e),r,this.transform.zoom,this.transform.angle)},e.prototype._makeQueryGeometry=function(t){var e=this;void 0===t&&(t=[v.convert([0,0]),v.convert([this.transform.width,this.transform.height])]);var r,n=t instanceof v||"number"==typeof t[0];if(n){var i=v.convert(t);r=[i]}else{var o=[v.convert(t[0]),v.convert(t[1])];r=[o[0],new v(o[1].x,o[0].y),o[1],new v(o[0].x,o[1].y),o[0]]}return r=r.map(function(t){return e.transform.pointCoordinate(t)})},e.prototype.querySourceFeatures=function(t,e){return this.style.querySourceFeatures(t,e)},e.prototype.setStyle=function(t,e){var r=(!e||e.diff!==!1)&&this.style&&t&&!(t instanceof u)&&"string"!=typeof t;if(r)try{return this.style.setState(t)&&this._update(!0),this}catch(t){i.warnOnce("Unable to perform style diff: "+(t.message||t.error||t)+". Rebuilding the style from scratch.")}return this.style&&(this.style.setEventedParent(null),this.style._remove(),this.off("rotate",this.style._redoPlacement),this.off("pitch",this.style._redoPlacement)),t?(t instanceof u?this.style=t:this.style=new u(t,this),this.style.setEventedParent(this,{style:this.style}),this.on("rotate",this.style._redoPlacement),this.on("pitch",this.style._redoPlacement),this):(this.style=null,this)},e.prototype.getStyle=function(){if(this.style)return this.style.serialize()},e.prototype.addSource=function(t,e){return this.style.addSource(t,e),this._update(!0),this},e.prototype.addSourceType=function(t,e,r){return this.style.addSourceType(t,e,r)},e.prototype.removeSource=function(t){return this.style.removeSource(t),this._update(!0),this},e.prototype.getSource=function(t){return this.style.getSource(t)},e.prototype.addLayer=function(t,e){return this.style.addLayer(t,e),this._update(!0),this},e.prototype.moveLayer=function(t,e){return this.style.moveLayer(t,e),this._update(!0),this},e.prototype.removeLayer=function(t){return this.style.removeLayer(t),this._update(!0),this},e.prototype.getLayer=function(t){return this.style.getLayer(t)},e.prototype.setFilter=function(t,e){return this.style.setFilter(t,e),this._update(!0),this},e.prototype.setLayerZoomRange=function(t,e,r){return this.style.setLayerZoomRange(t,e,r),this._update(!0),this},e.prototype.getFilter=function(t){return this.style.getFilter(t)},e.prototype.setPaintProperty=function(t,e,r,n){return this.style.setPaintProperty(t,e,r,n),this._update(!0),this},e.prototype.getPaintProperty=function(t,e,r){return this.style.getPaintProperty(t,e,r)},e.prototype.setLayoutProperty=function(t,e,r){return this.style.setLayoutProperty(t,e,r),this._update(!0),this},e.prototype.getLayoutProperty=function(t,e){return this.style.getLayoutProperty(t,e)},e.prototype.setLight=function(t){return this.style.setLight(t),this._update(!0),this},e.prototype.getLight=function(){return this.style.getLight()},e.prototype.getContainer=function(){return this._container},e.prototype.getCanvasContainer=function(){return this._canvasContainer},e.prototype.getCanvas=function(){return this._canvas},e.prototype._containerDimensions=function(){var t=0,e=0;return this._container&&(t=this._container.offsetWidth||400,e=this._container.offsetHeight||300),[t,e]},e.prototype._setupContainer=function(){var t=this._container;t.classList.add("mapboxgl-map");var e=this._canvasContainer=s.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=s.create("canvas","mapboxgl-canvas",e),this._canvas.style.position="absolute",this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",0),this._canvas.setAttribute("aria-label","Map");var r=this._containerDimensions();this._resizeCanvas(r[0],r[1]);var n=this._controlContainer=s.create("div","mapboxgl-control-container",t),i=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(t){i[t]=s.create("div","mapboxgl-ctrl-"+t,n)})},e.prototype._resizeCanvas=function(t,e){var r=a.devicePixelRatio||1;this._canvas.width=r*t,this._canvas.height=r*e,this._canvas.style.width=t+"px",this._canvas.style.height=e+"px"},e.prototype._setupPainter=function(){var t=i.extend({failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer},_.webGLContextAttributes),e=this._canvas.getContext("webgl",t)||this._canvas.getContext("experimental-webgl",t);return e?void(this.painter=new c(e,this.transform)):void this.fire("error",{error:new Error("Failed to initialize WebGL")})},e.prototype._contextLost=function(t){t.preventDefault(),this._frameId&&o.cancelFrame(this._frameId),this.fire("webglcontextlost",{originalEvent:t})},e.prototype._contextRestored=function(t){this._setupPainter(),this.resize(),this._update(),this.fire("webglcontextrestored",{originalEvent:t})},e.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!(!this.style||!this.style.loaded())},e.prototype._update=function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this._rerender(),this):this},e.prototype._render=function(){return 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,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,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(),this},e.prototype.remove=function(){this._hash&&this._hash.remove(),o.cancelFrame(this._frameId),this.setStyle(null),"undefined"!=typeof a&&a.removeEventListener("resize",this._onWindowResize,!1);var t=this.painter.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),n(this._canvasContainer),n(this._controlContainer),this._container.classList.remove("mapboxgl-map"),this.fire("remove")},e.prototype._rerender=function(){this.style&&!this._frameId&&(this._frameId=o.frame(this._render))},e.prototype._onWindowOnline=function(){this._update()},e.prototype._onWindowResize=function(){this._trackResize&&this.stop().resize()._update()},r.showTileBoundaries.get=function(){return!!this._showTileBoundaries},r.showTileBoundaries.set=function(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},r.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},r.showCollisionBoxes.set=function(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,this.style._redoPlacement())},r.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},r.showOverdrawInspector.set=function(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},r.repaint.get=function(){return!!this._repaint},r.repaint.set=function(t){this._repaint=t,this._update()},r.vertices.get=function(){return!!this._vertices},r.vertices.set=function(t){this._vertices=t,this._update()},e.prototype._onData=function(t){this._update("style"===t.dataType),this.fire(t.dataType+"data",t)},e.prototype._onDataLoading=function(t){this.fire(t.dataType+"dataloading",t)},Object.defineProperties(e.prototype,r),e}(d);e.exports=E},{"../geo/lng_lat":19,"../geo/lng_lat_bounds":20,"../geo/transform":21,"../render/painter":36,"../style/animation_loop":57,"../style/style":61,"../util/browser":108,"../util/dom":115,"../util/util":127,"../util/window":110,"./bind_handlers":89,"./camera":90,"./control/attribution_control":91,"./hash":102,"mapbox-gl-supported":190,"point-geometry":194}],104:[function(t,e,r){"use strict";var n=t("../util/dom"),i=t("../geo/lng_lat"),o=t("point-geometry"),a=function(t,e){this._offset=o.convert(e&&e.offset||[0,0]),this._update=this._update.bind(this),this._onMapClick=this._onMapClick.bind(this),t||(t=n.create("div")),t.classList.add("mapboxgl-marker"),this._element=t,this._popup=null};a.prototype.addTo=function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),this._update(),this._map.on("click",this._onMapClick),this},a.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map=null),n.remove(this._element),this._popup&&this._popup.remove(),this},a.prototype.getLngLat=function(){return this._lngLat},a.prototype.setLngLat=function(t){return this._lngLat=i.convert(t),this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},a.prototype.getElement=function(){return this._element},a.prototype.setPopup=function(t){return this._popup&&(this._popup.remove(),this._popup=null),t&&(this._popup=t,this._popup.setLngLat(this._lngLat)),this},a.prototype._onMapClick=function(t){var e=t.originalEvent.target,r=this._element;this._popup&&(e===r||r.contains(e))&&this.togglePopup()},a.prototype.getPopup=function(){return this._popup},a.prototype.togglePopup=function(){var t=this._popup;t&&(t.isOpen()?t.remove():t.addTo(this._map))},a.prototype._update=function(t){if(this._map){var e=this._map.project(this._lngLat)._add(this._offset);t&&"moveend"!==t.type||(e=e.round()),n.setTransform(this._element,"translate("+e.x+"px, "+e.y+"px)")}},e.exports=a},{"../geo/lng_lat":19,"../util/dom":115,"point-geometry":194}],105:[function(t,e,r){"use strict";function n(t){if(t){if("number"==typeof t){var e=Math.round(Math.sqrt(.5*Math.pow(t,2)));return{top:new l(0,t),"top-left":new l(e,e),"top-right":new l(-e,e),bottom:new l(0,-t),"bottom-left":new l(e,-e),"bottom-right":new l(-e,-e),left:new l(t,0),right:new l(-t,0)}}if(i(t)){var r=l.convert(t);return{top:r,"top-left":r,"top-right":r,bottom:r,"bottom-left":r,"bottom-right":r,left:r,right:r}}return{top:l.convert(t.top||[0,0]),"top-left":l.convert(t["top-left"]||[0,0]),"top-right":l.convert(t["top-right"]||[0,0]),bottom:l.convert(t.bottom||[0,0]),"bottom-left":l.convert(t["bottom-left"]||[0,0]),"bottom-right":l.convert(t["bottom-right"]||[0,0]),left:l.convert(t.left||[0,0]),right:l.convert(t.right||[0,0])}}return n(new l(0,0))}function i(t){return t instanceof l||Array.isArray(t)}var o=t("../util/util"),a=t("../util/evented"),s=t("../util/dom"),u=t("../geo/lng_lat"),l=t("point-geometry"),c=t("../util/window"),p={closeButton:!0,closeOnClick:!0},h=function(t){function e(e){t.call(this),this.options=o.extend(Object.create(p),e),o.bindAll(["_update","_onClickClose"],this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.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},e.prototype.isOpen=function(){return!!this._map},e.prototype.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},e.prototype.getLngLat=function(){return this._lngLat},e.prototype.setLngLat=function(t){return this._lngLat=u.convert(t),this._update(),this},e.prototype.setText=function(t){return this.setDOMContent(c.document.createTextNode(t))},e.prototype.setHTML=function(t){var e,r=c.document.createDocumentFragment(),n=c.document.createElement("body");for(n.innerHTML=t;e=n.firstChild,e;)r.appendChild(e);return this.setDOMContent(r)},e.prototype.setDOMContent=function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},e.prototype._createContent=function(){this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._content=s.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=s.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClickClose))},e.prototype._update=function(){if(this._map&&this._lngLat&&this._content){this._container||(this._container=s.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=s.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content));var t=this.options.anchor,e=n(this.options.offset),r=this._map.project(this._lngLat).round();if(!t){var i=this._container.offsetWidth,o=this._container.offsetHeight;t=r.y+e.bottom.ythis._map.transform.height-o?["bottom"]:[],r.xthis._map.transform.width-i/2&&t.push("right"),t=0===t.length?"bottom":t.join("-")}var a=r.add(e[t]),u={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%)"},l=this._container.classList;for(var c in u)l.remove("mapboxgl-popup-anchor-"+c);l.add("mapboxgl-popup-anchor-"+t),s.setTransform(this._container,u[t]+" translate("+a.x+"px,"+a.y+"px)")}},e.prototype._onClickClose=function(){this.remove()},e}(a);e.exports=h},{"../geo/lng_lat":19,"../util/dom":115,"../util/evented":116,"../util/util":127,"../util/window":110,"point-geometry":194}],106:[function(t,e,r){"use strict";var n=function(t,e,r){this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.callbackID=0,this.receive=this.receive.bind(this),this.target.addEventListener("message",this.receive,!1)};n.prototype.send=function(t,e,r,n,i){var o=r?this.mapId+":"+this.callbackID++:null;r&&(this.callbacks[o]=r),this.target.postMessage({targetMapId:i,sourceMapId:this.mapId,type:t,id:String(o),data:e},n)},n.prototype.receive=function(t){var e,r=this,n=t.data,i=n.id;if(!n.targetMapId||this.mapId===n.targetMapId){var o=function(t,e,n){r.target.postMessage({sourceMapId:r.mapId,type:"",id:String(i),error:t?String(t):null,data:e},n)};if(""===n.type)e=this.callbacks[n.id],delete this.callbacks[n.id],e&&e(n.error||null,n.data);else if("undefined"!=typeof n.id&&this.parent[n.type])this.parent[n.type](n.sourceMapId,n.data,o);else if("undefined"!=typeof n.id&&this.parent.getWorkerSource){var a=n.type.split("."),s=this.parent.getWorkerSource(n.sourceMapId,a[0]);s[a[1]](n.data,o)}else this.parent[n.type](n.data)}},n.prototype.remove=function(){ -this.target.removeEventListener("message",this.receive,!1)},e.exports=n},{}],107:[function(t,e,r){"use strict";function n(t){var e=i.document.createElement("a");return e.href=t,e.protocol===i.document.location.protocol&&e.host===i.document.location.host}var i=t("./window");r.getJSON=function(t,e){var r=new i.XMLHttpRequest;return r.open("GET",t,!0),r.setRequestHeader("Accept","application/json"),r.onerror=function(t){e(t)},r.onload=function(){if(r.status>=200&&r.status<300&&r.response){var t;try{t=JSON.parse(r.response)}catch(t){return e(t)}e(null,t)}else e(new Error(r.statusText))},r.send(),r},r.getArrayBuffer=function(t,e){var r=new i.XMLHttpRequest;return r.open("GET",t,!0),r.responseType="arraybuffer",r.onerror=function(t){e(t)},r.onload=function(){return 0===r.response.byteLength&&200===r.status?e(new Error("http status 200 returned without content.")):void(r.status>=200&&r.status<300&&r.response?e(null,r.response):e(new Error(r.statusText)))},r.send(),r};var o="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";r.getImage=function(t,e){return r.getArrayBuffer(t,function(t,r){if(t)return e(t);var n=new i.Image,a=i.URL||i.webkitURL;n.onload=function(){e(null,n),a.revokeObjectURL(n.src)};var s=new i.Blob([new Uint8Array(r)],{type:"image/png"});n.src=r.byteLength?a.createObjectURL(s):o})},r.getVideo=function(t,e){var r=i.document.createElement("video");r.onloadstart=function(){e(null,r)};for(var o=0;o=s+n?t.call(i,1):(t.call(i,(u-s)/n),r.frame(o)))}if(!n)return t.call(i,1),null;var a=!1,s=e.exports.now();return r.frame(o),function(){a=!0}},r.getImageData=function(t){var e=n.document.createElement("canvas"),r=e.getContext("2d");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0),r.getImageData(0,0,t.width,t.height).data},r.supported=t("mapbox-gl-supported"),r.hardwareConcurrency=n.navigator.hardwareConcurrency||4,Object.defineProperty(r,"devicePixelRatio",{get:function(){return n.devicePixelRatio}}),r.supportsWebp=!1;var a=n.document.createElement("img");a.onload=function(){r.supportsWebp=!0},a.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="},{"./window":110,"mapbox-gl-supported":190}],109:[function(t,e,r){"use strict";var n=t("webworkify"),i=t("../window"),o=i.URL.createObjectURL(new n(t("../../source/worker"),{bare:!0}));e.exports=function(){return new i.Worker(o)}},{"../../source/worker":55,"../window":110,webworkify:211}],110:[function(t,e,r){"use strict";e.exports=self},{}],111:[function(t,e,r){"use strict";function n(t,e){return e.area-t.area}var i=t("quickselect"),o=t("./util").calculateSignedArea;e.exports=function(t,e){var r=t.length;if(r<=1)return[t];for(var a,s,u=[],l=0;l1)for(var p=0;pt.y!=p.y>t.y&&t.x<(p.x-c.x)*(t.y-c.y)/(p.y-c.y)+c.x&&(r=!r),n=Math.min(n,l(t,c,p))}return(r?1:-1)*Math.sqrt(n)}function a(t){for(var e=0,r=0,n=0,o=t[0],a=0,s=o.length,u=s-1;al)&&(l=f.x),(!h||f.y>c)&&(c=f.y)}for(var d=l-o,m=c-u,y=Math.min(d,m),v=y/2,g=new s(null,n),_=o;_b.d&&(b=E,r&&console.log("found best %d after %d probes",Math.round(1e4*E.d)/1e4,w)),E.max-b.d<=e||(v=E.h/2,g.push(new i(E.p.x-v,E.p.y-v,v,t)),g.push(new i(E.p.x+v,E.p.y-v,v,t)),g.push(new i(E.p.x-v,E.p.y+v,v,t)),g.push(new i(E.p.x+v,E.p.y+v,v,t)),w+=4)}return r&&(console.log("num probes: "+w),console.log("best distance: "+b.d)),b.p}},{"./intersection_tests":120,"point-geometry":194,tinyqueue:199}],118:[function(t,e,r){"use strict";function n(t,e){this.stacks=t.readFields(i,[],e)}function i(t,e,r){if(1===t){var n=r.readMessage(o,{glyphs:{}});e.push(n)}}function o(t,e,r){if(1===t)e.name=r.readString();else if(2===t)e.range=r.readString();else if(3===t){var n=r.readMessage(a,{});e.glyphs[n.id]=n}}function a(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint())}e.exports=n},{}],119:[function(t,e,r){"use strict";function n(t,e,r){return t*(1-r)+e*r}e.exports=n,n.number=n,n.vec2=function(t,e,r){return[n(t[0],e[0],r),n(t[1],e[1],r)]},n.color=function(t,e,r){return[n(t[0],e[0],r),n(t[1],e[1],r),n(t[2],e[2],r),n(t[3],e[3],r)]},n.array=function(t,e,r){return t.map(function(t,i){return n(t,e[i],r)})}},{}],120:[function(t,e,r){"use strict";function n(t,e){for(var r=0;r=3)for(var u=0;u1){if(u(t,e))return!0;for(var n=0;n1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}function h(t,e){for(var r,n,i,o=!1,a=0;ae.y!=i.y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(o=!o)}return o}function f(t,e){for(var r=!1,n=0,i=t.length-1;ne.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(r=!r)}return r}var d=t("./util").isCounterClockwise;e.exports={multiPolygonIntersectsBufferedMultiPoint:i,multiPolygonIntersectsMultiPolygon:o,multiPolygonIntersectsBufferedMultiLine:a,polygonIntersectsPolygon:n,distToSegmentSquared:p}},{"./util":127}],121:[function(t,e,r){"use strict";var n={"Latin-1 Supplement":function(t){return t>=128&&t<=255},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};e.exports=n},{}],122:[function(t,e,r){"use strict";var n=function(t,e){this.max=t,this.onRemove=e,this.reset()};n.prototype.reset=function(){var t=this;for(var e in this.data)t.onRemove(t.data[e]);return this.data={},this.order=[],this},n.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 r=this.get(this.order[0]);r&&this.onRemove(r)}return this},n.prototype.has=function(t){return t in this.data},n.prototype.keys=function(){return this.order},n.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},n.prototype.setMaxSize=function(t){var e=this;for(this.max=t;this.order.length>this.max;){var r=e.get(e.order[0]);r&&e.onRemove(r)}return this},e.exports=n},{}],123:[function(t,e,r){"use strict";function n(t,e){var r=a(u.API_URL);if(t.protocol=r.protocol,t.authority=r.authority,!u.REQUIRE_ACCESS_TOKEN)return s(t);if(e=e||u.ACCESS_TOKEN,!e)throw new Error("An API access token is required to use Mapbox GL. "+c);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+c);return t.params.push("access_token="+e),s(t)}function i(t){return 0===t.indexOf("mapbox:")}function o(t){for(var e=0;e=2||512===r?"@2x":"",c=l.supportsWebp?".webp":"$1";return n.path=n.path.replace(p,""+u+c),o(n.params),s(n)};var h=/^(\w+):\/\/([^\/?]+)(\/[^?]+)?\??(.+)?/},{"./browser":108,"./config":112}],124:[function(t,e,r){"use strict";var n=t("./is_char_in_unicode_block");e.exports.allowsIdeographicBreaking=function(t){for(var e=0,n=t;e=65097&&t<=65103)||n["CJK Compatibility Ideographs"](t)||n["CJK Compatibility"](t)||n["CJK Radicals Supplement"](t)||n["CJK Strokes"](t)||!(!n["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||n["CJK Unified Ideographs Extension A"](t)||n["CJK Unified Ideographs"](t)||n["Enclosed CJK Letters and Months"](t)||n["Hangul Compatibility Jamo"](t)||n["Hangul Jamo Extended-A"](t)||n["Hangul Jamo Extended-B"](t)||n["Hangul Jamo"](t)||n["Hangul Syllables"](t)||n.Hiragana(t)||n["Ideographic Description Characters"](t)||n.Kanbun(t)||n["Kangxi Radicals"](t)||n["Katakana Phonetic Extensions"](t)||n.Katakana(t)&&12540!==t||!(!n["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!n["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||n["Unified Canadian Aboriginal Syllabics"](t)||n["Unified Canadian Aboriginal Syllabics Extended"](t)||n["Vertical Forms"](t)||n["Yijing Hexagram Symbols"](t)||n["Yi Syllables"](t)||n["Yi Radicals"](t)))},r.charHasNeutralVerticalOrientation=function(t){return!!(n["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||n["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||n["Letterlike Symbols"](t)||n["Number Forms"](t)||n["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||n["Control Pictures"](t)&&9251!==t||n["Optical Character Recognition"](t)||n["Enclosed Alphanumerics"](t)||n["Geometric Shapes"](t)||n["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||n["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||n["CJK Symbols and Punctuation"](t)||n.Katakana(t)||n["Private Use Area"](t)||n["CJK Compatibility Forms"](t)||n["Small Form Variants"](t)||n["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)},r.charHasRotatedVerticalOrientation=function(t){return!(r.charHasUprightVerticalOrientation(t)||r.charHasNeutralVerticalOrientation(t))}},{"./is_char_in_unicode_block":121}],125:[function(t,e,r){"use strict";function n(t){var e=JSON.stringify(t);if(y[e])return y[e];var r=void 0===t.alignment?1:t.alignment,n=0,a=0,u=["Uint8"],p=t.members.map(function(t){u.indexOf(t.type)<0&&u.push(t.type);var e=o(t.type),s=n=i(n,Math.max(r,e)),l=t.components||1;return a=Math.max(a,e),n+=e*l,{name:t.name,type:t.type,components:l,offset:s}}),f=i(n,Math.max(a,r)),d=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(h);d.prototype.alignment=r,d.prototype.size=f;for(var v=0,g=p;vthis.capacity){this.capacity=Math.max(t,Math.floor(this.capacity*d),f),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},m.prototype._refreshViews=function(){for(var t=this,e=0,r=this._usedTypes;e=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)},r.bezier=function(t,e,r,i){var o=new n(t,e,r,i);return function(t){return o.solve(t)}},r.ease=r.bezier(.25,.1,.25,1),r.clamp=function(t,e,r){return Math.min(r,Math.max(e,t))},r.wrap=function(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i},r.asyncAll=function(t,e,r){if(!t.length)return r(null,[]);var n=t.length,i=new Array(t.length),o=null;t.forEach(function(t,a){e(t,function(t,e){t&&(o=t),i[a]=e,0===--n&&r(o,i)})})},r.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},r.keysDifference=function(t,e){var r=[];for(var n in t)n in e||r.push(n);return r},r.extend=function(t,e,r,n){for(var i=arguments,o=1;o=0)return!0;return!1};var a={};r.warnOnce=function(t){a[t]||("undefined"!=typeof console&&console.warn(t),a[t]=!0)},r.isCounterClockwise=function(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)},r.calculateSignedArea=function(t){for(var e,r,n=0,i=0,o=t.length,a=o-1;i0||Math.abs(e.y-n.y)>0)&&Math.abs(r.calculateSignedArea(t))>.01},r.sphericalToCartesian=function(t){var e=t[0],r=t[1],n=t[2];return r+=90,r*=Math.PI/180,n*=Math.PI/180,[e*Math.cos(r)*Math.sin(n),e*Math.sin(r)*Math.sin(n),e*Math.cos(n)]}},{"../geo/coordinate":18,"point-geometry":194,unitbezier:200}],128:[function(t,e,r){"use strict";var n=function(t,e,r,n){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=r,t._y=n,this.properties=t.properties,null!=t.id&&(this.id=t.id)},i={geometry:{}};i.geometry.get=function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},i.geometry.set=function(t){this._geometry=t},n.prototype.toJSON=function(){var t=this,e={geometry:this.geometry};for(var r in this)"_geometry"!==r&&"_vectorTileFeature"!==r&&(e[r]=t[r]);return e},Object.defineProperties(n.prototype,i),e.exports=n},{}],129:[function(t,e,r){"use strict";var n=t("./script_detection");e.exports=function(t){for(var r="",i=0;i":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"}},{"./script_detection":124}],130:[function(t,e,r){"use strict";var n=t("./web_worker"),i=function(){this.active={}};i.prototype.acquire=function(e){var r=this;if(!this.workers){var i=t("../mapbox-gl").workerCount;for(this.workers=[];this.workers.length255?255:t}function i(t){return t<0?0:t>1?1:t}function o(t){return n("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function a(t){return i("%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))}function s(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}function u(t){var e=t.replace(/ /g,"").toLowerCase();if(e in l)return l[e].slice();if("#"===e[0]){if(4===e.length){var r=parseInt(e.substr(1),16);return r>=0&&r<=4095?[(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,1]:null}if(7===e.length){var r=parseInt(e.substr(1),16);return r>=0&&r<=16777215?[(16711680&r)>>16,(65280&r)>>8,255&r,1]:null}return null}var i=e.indexOf("("),u=e.indexOf(")");if(i!==-1&&u+1===e.length){var c=e.substr(0,i),p=e.substr(i+1,u-(i+1)).split(","),h=1;switch(c){case"rgba":if(4!==p.length)return null;h=a(p.pop());case"rgb":return 3!==p.length?null:[o(p[0]),o(p[1]),o(p[2]),h];case"hsla":if(4!==p.length)return null;h=a(p.pop());case"hsl":if(3!==p.length)return null;var f=(parseFloat(p[0])%360+360)%360/360,d=a(p[1]),m=a(p[2]),y=m<=.5?m*(d+1):m+d-m*d,v=2*m-y;return[n(255*s(v,y,f+1/3)),n(255*s(v,y,f)),n(255*s(v,y,f-1/3)),h];default:return null}}return null}var l={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{r.parseCSSColor=u}catch(t){}},{}],133:[function(t,e,r){"use strict";function n(t,e,r){r=r||2;var n=e&&e.length,o=n?e[0]*r:t.length,s=i(t,0,o,r,!0),u=[];if(!s)return u;var l,c,h,f,d,m,y;if(n&&(s=p(t,e,s,r)),t.length>80*r){l=h=t[0],c=f=t[1];for(var v=r;vh&&(h=d),m>f&&(f=m);y=Math.max(h-l,f-c)}return a(s,u,r,l,c,y),u}function i(t,e,r,n,i){var o,a;if(i===k(t,e,r,n)>0)for(o=e;o=e;o-=n)a=M(o,t[o],t[o+1],a);return a&&w(a,a.next)&&(P(a),a=a.next),a}function o(t,e){if(!t)return t;e||(e=t);var r,n=t;do if(r=!1,n.steiner||!w(n,n.next)&&0!==b(n.prev,n,n.next))n=n.next;else{if(P(n),n=e=n.prev,n===n.next)return null;r=!0}while(r||n!==e);return e}function a(t,e,r,n,i,p,h){if(t){!h&&p&&m(t,n,i,p);for(var f,d,y=t;t.prev!==t.next;)if(f=t.prev,d=t.next,p?u(t,n,i,p):s(t))e.push(f.i/r),e.push(t.i/r),e.push(d.i/r),P(t),t=d.next,y=d.next;else if(t=d,t===y){h?1===h?(t=l(t,e,r),a(t,e,r,n,i,p,2)):2===h&&c(t,e,r,n,i,p):a(o(t),e,r,n,i,p,1);break}}}function s(t){var e=t.prev,r=t,n=t.next;if(b(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(_(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&b(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function u(t,e,r,n){var i=t.prev,o=t,a=t.next;if(b(i,o,a)>=0)return!1;for(var s=i.xo.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,c=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,p=v(s,u,e,r,n),h=v(l,c,e,r,n),f=t.nextZ;f&&f.z<=h;){if(f!==t.prev&&f!==t.next&&_(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&b(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(f=t.prevZ;f&&f.z>=p;){if(f!==t.prev&&f!==t.next&&_(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&b(f.prev,f,f.next)>=0)return!1;f=f.prevZ}return!0}function l(t,e,r){var n=t;do{var i=n.prev,o=n.next.next;!w(i,o)&&E(i,n,n.next,o)&&S(i,o)&&S(o,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(o.i/r),P(n),P(n.next),n=t=o),n=n.next}while(n!==t);return n}function c(t,e,r,n,i,s){var u=t;do{for(var l=u.next.next;l!==u.prev;){if(u.i!==l.i&&x(u,l)){var c=A(u,l);return u=o(u,u.next),c=o(c,c.next),a(u,e,r,n,i,s),void a(c,e,r,n,i,s)}l=l.next}u=u.next}while(u!==t)}function p(t,e,r,n){var a,s,u,l,c,p=[];for(a=0,s=e.length;a=n.next.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>a){if(a=s,s===i){if(o===n.y)return n;if(o===n.next.y)return n.next}r=n.x=n.x&&n.x>=c&&_(or.x)&&S(n,t)&&(r=n,h=u)),n=n.next;return r}function m(t,e,r,n){var i=t;do null===i.z&&(i.z=v(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,y(i)}function y(t){var e,r,n,i,o,a,s,u,l=1;do{for(r=t,t=null,o=null,a=0;r;){for(a++,n=r,s=0,e=0;e0||u>0&&n;)0===s?(i=n,n=n.nextZ,u--):0!==u&&n?r.z<=n.z?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,u--):(i=r,r=r.nextZ,s--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;r=n}o.nextZ=null,l*=2}while(a>1);return t}function v(t,e,r,n,i){return t=32767*(t-r)/i,e=32767*(e-n)/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 g(t){var e=t,r=t;do e.x=0&&(t-a)*(n-s)-(r-a)*(e-s)>=0&&(r-a)*(o-s)-(i-a)*(n-s)>=0}function x(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!T(t,e)&&S(t,e)&&S(e,t)&&z(t,e)}function b(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function w(t,e){return t.x===e.x&&t.y===e.y}function E(t,e,r,n){return!!(w(t,e)&&w(r,n)||w(t,n)&&w(r,e))||b(t,e,r)>0!=b(t,e,n)>0&&b(r,n,t)>0!=b(r,n,e)>0}function T(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&E(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}function S(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 z(t,e){var r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do r.y>o!=r.next.y>o&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;while(r!==t);return n}function A(t,e){var r=new L(t.i,t.x,t.y),n=new L(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function M(t,e,r,n){var i=new L(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function P(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,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function k(t,e,r,n){for(var i=0,o=e,a=r-n;o0&&(n+=t[i-1].length,r.holes.push(n))}return r}},{}],134:[function(t,e,r){function n(t){var e,r,i,l,c,p;switch(typeof t){case"object":if(null===t)return null;if(o(t)){for(i="[",r=t.length-1,e=0;e-1&&(i+=n(t[e])),i+"]"}for(l=a(t).sort(),r=l.length,i="{",c=l[e=0],p=r>0&&void 0!==t[c];e15?"\\u00"+e.toString(16):"\\u000"+e.toString(16)}};e.exports=function(t){if(void 0!==t)return""+n(t)},e.exports.stringSearch=s,e.exports.stringReplace=u},{}],135:[function(t,e,r){"use strict";function n(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 r="=="===e?a(t[1],t[2],"===",!1):"!="===e?a(t[1],t[2],"!==",!1):"<"===e||">"===e||"<="===e||">="===e?a(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?u(t[1],t.slice(2)):"!in"===e?c(u(t[1],t.slice(2))):"has"===e?l(t[1]):"!has"===e?c(l([t[1]])):"true";return"("+r+")"}function o(t){return"$type"===t?"f.type":"$id"===t?"f.id":"p["+JSON.stringify(t)+"]"}function a(t,e,r,n){var i=o(t),a="$type"===t?h.indexOf(e):JSON.stringify(e);return(n?"typeof "+i+"=== typeof "+a+"&&":"")+i+r+a}function s(t,e){return t.map(i).join(e)}function u(t,e){"$type"===t&&(e=e.map(function(t){return h.indexOf(t)}));var r=JSON.stringify(e.sort(p)),n=o(t);return e.length<=200?r+".indexOf("+n+") !== -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; }("+n+", "+r+",0,"+(e.length-1)+")"}function l(t){return JSON.stringify(t)+" in p"}function c(t){return"!("+t+")"}function p(t,e){return te?1:0}e.exports=n;var h=["Unknown","Point","LineString","Polygon"]},{}],136:[function(t,e,r){function n(t){if("Polygon"===t.type)return i(t.coordinates);if("MultiPolygon"===t.type){for(var e=0,r=0;r0){e+=Math.abs(o(t[0]));for(var r=1;r2){for(var r,n,i=0;i=0}var l=t("geojson-area");e.exports=n},{"geojson-area":136}],138:[function(t,e,r){"use strict";function n(t,e,r,n,a,u,l,c){if(r/=e,n/=e,l>=r&&c<=n)return t;if(l>n||c=r&&d<=n)p.push(m);else if(!(f>n||d=e&&s<=r&&i.push(a)}return i}function o(t,e,r,n,i,o){for(var s=[],u=0;ur?(x.push(i(l,d,e),i(l,d,r)),o||(x=a(s,x,y,v,g))):f>=e&&x.push(i(l,d,e)):h>r?fr&&(x.push(i(l,d,r)),o||(x=a(s,x,y,v,g))));l=m[_-1],h=l[n],h>=e&&h<=r&&x.push(l),p=x[x.length-1],o&&p&&(x[0][0]!==p[0]||x[0][1]!==p[1])&&x.push(x[0]),a(s,x,y,v,g)}return s}function a(t,e,r,n,i){return e.length&&(e.area=r,e.dist=n,void 0!==i&&(e.outer=i),t.push(e)),[]}e.exports=n;var s=t("./feature")},{"./feature":140}],139:[function(t,e,r){"use strict";function n(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n1?1:n,[r,n,0]}function s(t){for(var e,r,n=0,i=0,o=0;o1)return!1;var o=i.geometry[0].length;if(5!==o)return!1;for(var a=0;a1&&console.time("creation"),_=this.tiles[g]=d(t,v,r,n,x,e===f.maxZoom),this.tileCoords.push({z:e,x:r,y:n}),m)){m>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,_.numFeatures,_.numPoints,_.numSimplified),console.timeEnd("creation"));var b="z"+e;this.stats[b]=(this.stats[b]||0)+1,this.total++}if(_.source=t,i){if(e===f.maxZoom||e===i)continue;var w=1<1&&console.time("clipping");var E,T,S,z,A,M,P=.5*f.buffer/f.extent,L=.5-P,k=.5+P,C=1+P;E=T=S=z=null,A=h(t,v,r-P,r+k,0,a,_.min[0],_.max[0]),M=h(t,v,r+L,r+C,0,a,_.min[0],_.max[0]),A&&(E=h(A,v,n-P,n+k,1,s,_.min[1],_.max[1]),T=h(A,v,n+L,n+C,1,s,_.min[1],_.max[1])),M&&(S=h(M,v,n-P,n+k,1,s,_.min[1],_.max[1]),z=h(M,v,n+L,n+C,1,s,_.min[1],_.max[1])),m>1&&console.timeEnd("clipping"),t.length&&(p.push(E||[],e+1,2*r,2*n),p.push(T||[],e+1,2*r,2*n+1),p.push(S||[],e+1,2*r+1,2*n),p.push(z||[],e+1,2*r+1,2*n+1))}else i&&(y=e)}return y},i.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,a=n.debug,s=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var c,h=t,f=e,d=r;!c&&h>0;)h--,f=Math.floor(f/2),d=Math.floor(d/2),c=this.tiles[o(h,f,d)];if(!c||!c.source)return null;if(a>1&&console.log("found parent tile z%d-%d-%d",h,f,d),l(c,i,n.buffer))return p.tile(c,i);a>1&&console.time("drilling down");var m=this.splitTile(c.source,h,f,d,t,e,r);if(a>1&&console.timeEnd("drilling down"),null!==m){var y=1<n&&(a=r,n=o);n>s?(t[a][2]=n,p.push(l),p.push(a),l=a):(c=p.pop(),l=p.pop())}}function i(t,e,r){var n=e[0],i=e[1],o=r[0],a=r[1],s=t[0],u=t[1],l=o-n,c=a-i;if(0!==l||0!==c){var p=((s-n)*l+(u-i)*c)/(l*l+c*c);p>1?(n=o,i=a):p>0&&(n+=l*p,i+=c*p)}return l=s-n,c=u-i,l*l+c*c}e.exports=n},{}],143:[function(t,e,r){"use strict";function n(t,e,r,n,o,a){for(var s={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:n,z2:e,transformed:!1,min:[2,1],max:[-1,0]},u=0;us.max[0]&&(s.max[0]=c[0]),c[1]>s.max[1]&&(s.max[1]=c[1])}return s}function i(t,e,r,n){var i,a,s,u,l=e.geometry,c=e.type,p=[],h=r*r;if(1===c)for(i=0;ih)&&(f.push(u),t.numSimplified++),t.numPoints++;3===c&&o(f,s.outer),p.push(f)}else t.numPoints+=s.length;if(p.length){var d={geometry:p,type:c,tags:e.tags||null};null!==e.id&&(d.id=e.id),t.features.push(d)}}function o(t,e){var r=a(t);r<0===e&&t.reverse()}function a(t){for(var e,r,n=0,i=0,o=t.length,a=o-1;i=l[h+0]&&n>=l[h+1]?(a[p]=!0,o.push(u[p])):a[p]=!1}}},n.prototype._forEachCell=function(t,e,r,n,i,o,a){for(var s=this._convertToCellCoord(t),u=this._convertToCellCoord(e),l=this._convertToCellCoord(r),c=this._convertToCellCoord(n),p=s;p<=l;p++)for(var h=u;h<=c;h++){var f=this.d*h+p;if(i.call(this,t,e,r,n,f,o,a))return}},n.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},n.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=i+this.cells.length+1+1,r=0,n=0;n>1,c=-7,p=r?i-1:0,h=r?-1:1,f=t[e+p];for(p+=h,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=256*o+t[e+p],p+=h,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+t[e+p],p+=h,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:(f?-1:1)*(1/0);a+=Math.pow(2,n),o-=l}return(f?-1:1)*a*Math.pow(2,o-n)},r.write=function(t,e,r,n,i,o){var a,s,u,l=8*o-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,d=n?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,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),e+=a+p>=1?h/u:h*Math.pow(2,1-p),e*u>=2&&(a++,u/=2),a+p>=c?(s=0,a=c):a+p>=1?(s=(e*u-1)*Math.pow(2,i),a+=p):(s=e*Math.pow(2,p-1)*Math.pow(2,i),a=0));i>=8;t[r+f]=255&s,f+=d,s/=256,i-=8);for(a=a<0;t[r+f]=255&a,f+=d,a/=256,l-=8);t[r+f-d]|=128*m}},{}],148:[function(t,e,r){"use strict";function n(t,e,r,n,o){return new i(t,e,r,n,o)}function i(t,e,r,n,i){e=e||o,r=r||a,i=i||Array,this.nodeSize=n||64,this.points=t,this.ids=new i(t.length),this.coords=new i(2*t.length);for(var u=0;u=r&&s<=i&&u>=n&&u<=o&&c.push(t[d]);else{var m=Math.floor((f+h)/2);s=e[2*m],u=e[2*m+1],s>=r&&s<=i&&u>=n&&u<=o&&c.push(t[m]);var y=(p+1)%2;(0===p?r<=s:n<=u)&&(l.push(f),l.push(m-1),l.push(y)),(0===p?i>=s:o>=u)&&(l.push(m+1),l.push(h),l.push(y))}}return c}e.exports=n},{}],150:[function(t,e,r){"use strict";function n(t,e,r,o,a,s){if(!(a-o<=r)){var u=Math.floor((o+a)/2);i(t,e,u,o,a,s%2),n(t,e,r,o,u-1,s+1),n(t,e,r,u+1,a,s+1)}}function i(t,e,r,n,a,s){for(;a>n;){if(a-n>600){var u=a-n+1,l=r-n+1,c=Math.log(u),p=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*p*(u-p)/u)*(l-u/2<0?-1:1),f=Math.max(n,Math.floor(r-l*p/u+h)),d=Math.min(a,Math.floor(r+(u-l)*p/u+h));i(t,e,r,f,d,s)}var m=e[2*r+s],y=n,v=a;for(o(t,e,n,r),e[2*a+s]>m&&o(t,e,n,a);ym;)v--}e[2*n+s]===m?o(t,e,n,v):(v++,o(t,e,v,a)),v<=r&&(n=v+1),r<=v&&(a=v-1)}}function o(t,e,r,n){a(t,r,n),a(e,2*r,2*n),a(e,2*r+1,2*n+1)}function a(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}e.exports=n},{}],151:[function(t,e,r){"use strict";function n(t,e,r,n,o,a){for(var s=[0,t.length-1,0],u=[],l=o*o;s.length;){var c=s.pop(),p=s.pop(),h=s.pop();if(p-h<=a)for(var f=h;f<=p;f++)i(e[2*f],e[2*f+1],r,n)<=l&&u.push(t[f]);else{var d=Math.floor((h+p)/2),m=e[2*d],y=e[2*d+1];i(m,y,r,n)<=l&&u.push(t[d]);var v=(c+1)%2;(0===c?r-o<=m:n-o<=y)&&(s.push(h),s.push(d-1),s.push(v)),(0===c?r+o>=m:n+o>=y)&&(s.push(d+1),s.push(p),s.push(v))}}return u}function i(t,e,r,n){var i=t-r,o=e-n;return i*i+o*o}e.exports=n},{}],152:[function(t,e,r){function n(t){return!!t&&"object"==typeof t}function i(t,e){for(var r=-1,n=t.length;++rl))return!1;for(;++u-1&&t%1==0&&t<=c}function u(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function l(t){return!!t&&"object"==typeof t}var c=9007199254740991,p="[object Arguments]",h="[object Function]",f="[object GeneratorFunction]",d=Object.prototype,m=d.hasOwnProperty,y=d.toString,v=d.propertyIsEnumerable;e.exports=n},{}],156:[function(t,e,r){function n(t){return!!t&&"object"==typeof t}function i(t,e){var r=null==t?void 0:t[e];return u(r)?r:void 0}function o(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=g}function a(t){return s(t)&&m.call(t)==c}function s(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function u(t){return null!=t&&(a(t)?y.test(f.call(t)):n(t)&&p.test(t))}var l="[object Array]",c="[object Function]",p=/^\[object .+?Constructor\]$/,h=Object.prototype,f=Function.prototype.toString,d=h.hasOwnProperty,m=h.toString,y=RegExp("^"+f.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),v=i(Array,"isArray"),g=9007199254740991,_=v||function(t){return n(t)&&o(t.length)&&m.call(t)==l};e.exports=_},{}],157:[function(t,e,r){function n(t,e,r,n){r="function"==typeof r?o(r,n,3):void 0;var a=r?r(t,e):void 0;return void 0===a?i(t,e,r):!!a}var i=t("lodash._baseisequal"),o=t("lodash._bindcallback");e.exports=n},{"lodash._baseisequal":152,"lodash._bindcallback":153}],158:[function(t,e,r){function n(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=a}function i(t){return!!t&&"object"==typeof t}function o(t){return i(t)&&n(t.length)&&!!k[I.call(t)]}var a=9007199254740991,s="[object Arguments]",u="[object Array]",l="[object Boolean]",c="[object Date]",p="[object Error]",h="[object Function]",f="[object Map]",d="[object Number]",m="[object Object]",y="[object RegExp]",v="[object Set]",g="[object String]",_="[object WeakMap]",x="[object ArrayBuffer]",b="[object DataView]",w="[object Float32Array]",E="[object Float64Array]",T="[object Int8Array]",S="[object Int16Array]",z="[object Int32Array]",A="[object Uint8Array]",M="[object Uint8ClampedArray]",P="[object Uint16Array]",L="[object Uint32Array]",k={};k[w]=k[E]=k[T]=k[S]=k[z]=k[A]=k[M]=k[P]=k[L]=!0,k[s]=k[u]=k[x]=k[l]=k[b]=k[c]=k[p]=k[h]=k[f]=k[d]=k[m]=k[y]=k[v]=k[g]=k[_]=!1;var C=Object.prototype,I=C.toString;e.exports=o},{}],159:[function(t,e,r){function n(t){return function(e){return null==e?void 0:e[t]}}function i(t){return null!=t&&a(g(t))}function o(t,e){return t="number"==typeof t||f.test(t)?+t:-1,e=null==e?v:e,t>-1&&t%1==0&&t-1&&t%1==0&&t<=v}function s(t){for(var e=l(t),r=e.length,n=r&&t.length,i=!!n&&a(n)&&(h(t)||p(t)),s=-1,u=[];++s0;++nv?Math.pow(t,1/3):t/y+d}function i(t){return t>m?t*t*t:y*(t-d)}function o(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function a(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function s(t){var e=a(t[0]),r=a(t[1]),i=a(t[2]),o=n((.4124564*e+.3575761*r+.1804375*i)/p),s=n((.2126729*e+.7151522*r+.072175*i)/h),u=n((.0193339*e+.119192*r+.9503041*i)/f);return[116*s-16,500*(o-s),200*(s-u),t[3]]}function u(t){var e=(t[0]+16)/116,r=isNaN(t[1])?e:e+t[1]/500,n=isNaN(t[2])?e:e-t[2]/200;return e=h*i(e),r=p*i(r),n=f*i(n),[o(3.2404542*r-1.5371385*e-.4985314*n),o(-.969266*r+1.8760108*e+.041556*n),o(.0556434*r-.2040259*e+1.0572252*n),t[3]]}function l(t){var e=s(t),r=e[0],n=e[1],i=e[2],o=Math.atan2(i,n)*_;return[o<0?o+360:o,Math.sqrt(n*n+i*i),r,t[3]]}function c(t){var e=t[0]*g,r=t[1],n=t[2];return u([n,Math.cos(e)*r,Math.sin(e)*r,t[3]])}var p=.95047,h=1,f=1.08883,d=4/29,m=6/29,y=3*m*m,v=m*m*m,g=Math.PI/180,_=180/Math.PI;e.exports={lab:{forward:s,reverse:u},hcl:{forward:l,reverse:c}}},{}],161:[function(t,e,r){"use strict";function n(t){return t}function i(t,e){var r;if(f(t)){var l,c=t.stops&&"object"==typeof t.stops[0][0],p=c||void 0!==t.property,h=c||!p,m=t.stops&&typeof(c?t.stops[0][0].property:t.stops[0][0]),y=t.type||e||("string"===m?"categorical":"exponential");if("exponential"===y)l=s;else if("interval"===y)l=a;else if("categorical"===y)l=o;else{if("identity"!==y)throw new Error('Unknown function type "'+y+'"');l=u}var v;if(t.colorSpace&&"rgb"!==t.colorSpace){if(!d[t.colorSpace])throw new Error("Unknown color space: "+t.colorSpace);var g=d[t.colorSpace];t=JSON.parse(JSON.stringify(t));for(var _=0;_=t.stops[r-1][0])return t.stops[r-1][1];var n=l(t.stops,e);return t.stops[n][1]}function s(t,e){var r=void 0!==t.base?t.base:1,n=t.stops.length;if(1===n)return t.stops[0][1];if(void 0===e||null===e)return t.stops[n-1][1];if(e<=t.stops[0][0])return t.stops[0][1];if(e>=t.stops[n-1][0])return t.stops[n-1][1];var i=l(t.stops,e);return c(e,r,t.stops[i][0],t.stops[i+1][0],t.stops[i][1],t.stops[i+1][1])}function u(t,e){return e}function l(t,e){for(var r,n=t.length,i=0,o=n-1,a=0;i<=o;){if(a=Math.floor((i+o)/2),r=t[a][0],r===e){a+=1;break}re&&(o=a-1)}return Math.max(a-1,0)}function c(t,e,r,n,i,o){return"function"==typeof i?function(){var a=i.apply(void 0,arguments),s=o.apply(void 0,arguments);return c(t,e,r,n,a,s)}:i.length?h(t,e,r,n,i,o):p(t,e,r,n,i,o)}function p(t,e,r,n,i,o){var a,s=n-r,u=t-r;return a=1===e?u/s:(Math.pow(e,u)-1)/(Math.pow(e,s)-1),i*(1-a)+o*a}function h(t,e,r,n,i,o){for(var a=[],s=0;s7)return[new n(c,u,"constants have been deprecated as of v8")];if(!(u in h.constants))return[new n(c,u,'constant "%s" not found',u)];e=o({},e,{value:h.constants[u]})}return l.function&&"object"===i(u)?r(e):l.type&&s[l.type]?s[l.type](e):a(o({},e,{valueSpec:l.type?p[l.type]:l}))}},{"../error/validation_error":164,"../util/extend":166,"../util/get_type":167,"./validate_array":171,"./validate_boolean":172,"./validate_color":173,"./validate_constants":174,"./validate_enum":175,"./validate_filter":176,"./validate_function":177,"./validate_layer":179,"./validate_light":181,"./validate_number":182,"./validate_object":183,"./validate_source":185,"./validate_string":186}],171:[function(t,e,r){"use strict";var n=t("../util/get_type"),i=t("./validate"),o=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.valueSpec,a=t.style,s=t.styleSpec,u=t.key,l=t.arrayElementValidator||i;if("array"!==n(e))return[new o(u,e,"array expected, %s found",n(e))];if(r.length&&e.length!==r.length)return[new o(u,e,"array length %d expected, length %d found",r.length,e.length)];if(r["min-length"]&&e.length7)return r?[new n(e,r,"constants have been deprecated as of v8")]:[];var a=i(r);if("object"!==a)return[new n(e,r,"object expected, %s found",a)];var s=[];for(var u in r)"@"!==u[0]&&s.push(new n(e+"."+u,r[u],'constants must start with "@"'));return s}},{"../error/validation_error":164,"../util/get_type":167}],175:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint");e.exports=function(t){var e=t.key,r=t.value,o=t.valueSpec,a=[];return Array.isArray(o.values)?o.values.indexOf(i(r))===-1&&a.push(new n(e,r,"expected one of [%s], %s found",o.values.join(", "),r)):Object.keys(o.values).indexOf(i(r))===-1&&a.push(new n(e,r,"expected one of [%s], %s found",Object.keys(o.values).join(", "),r)),a}},{"../error/validation_error":164,"../util/unbundle_jsonlint":169}],176:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("./validate_enum"),o=t("../util/get_type"),a=t("../util/unbundle_jsonlint");e.exports=function t(e){var r,s=e.value,u=e.key,l=e.styleSpec,c=[];if("array"!==o(s))return[new n(u,s,"array expected, %s found",o(s))];if(s.length<1)return[new n(u,s,"filter array must have at least 1 element")];switch(c=c.concat(i({key:u+"[0]",value:s[0],valueSpec:l.filter_operator,style:e.style,styleSpec:e.styleSpec})),a(s[0])){case"<":case"<=":case">":case">=":s.length>=2&&"$type"==s[1]&&c.push(new n(u,s,'"$type" cannot be use with operator "%s"',s[0]));case"==":case"!=":3!=s.length&&c.push(new n(u,s,'filter array for operator "%s" must have 3 elements',s[0]));case"in":case"!in":s.length>=2&&(r=o(s[1]),"string"!==r?c.push(new n(u+"[1]",s[1],"string expected, %s found",r)):"@"===s[1][0]&&c.push(new n(u+"[1]",s[1],"filter key cannot be a constant")));for(var p=2;p=8&&(m&&!t.valueSpec["property-function"]?v.push(new n(t.key,t.value,"property functions not supported")):d&&!t.valueSpec["zoom-function"]&&v.push(new n(t.key,t.value,"zoom functions not supported"))),v}},{"../error/validation_error":164,"../util/get_type":167,"../util/unbundle_jsonlint":169,"./validate":170,"./validate_array":171,"./validate_number":182,"./validate_object":183}],178:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("./validate_string");e.exports=function(t){var e=t.value,r=t.key,o=i(t);return o.length?o:(e.indexOf("{fontstack}")===-1&&o.push(new n(r,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&o.push(new n(r,e,'"glyphs" url must include a "{range}" token')),o)}},{"../error/validation_error":164,"./validate_string":186}],179:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint"),o=t("./validate_object"),a=t("./validate_filter"),s=t("./validate_paint_property"),u=t("./validate_layout_property"),l=t("../util/extend");e.exports=function(t){var e=[],r=t.value,c=t.key,p=t.style,h=t.styleSpec;r.type||r.ref||e.push(new n(c,r,'either "type" or "ref" is required'));var f=i(r.type),d=i(r.ref);if(r.id)for(var m=0;mo.maximum?[new i(e,r,"%s is greater than the maximum value %s",r,o.maximum)]:[]}},{"../error/validation_error":164,"../util/get_type":167}],183:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/get_type"),o=t("./validate");e.exports=function(t){var e=t.key,r=t.value,a=t.valueSpec||{},s=t.objectElementValidators||{},u=t.style,l=t.styleSpec,c=[],p=i(r);if("object"!==p)return[new n(e,r,"object expected, %s found",p)];for(var h in r){var f,d=h.split(".")[0],m=a[d]||a["*"];if(s[d])f=s[d];else if(a[d])f=o;else if(s["*"])f=s["*"];else{if(!a["*"]){c.push(new n(e,r[h],'unknown property "%s"',h));continue}f=o}c=c.concat(f({key:(e?e+".":e)+h,value:r[h],valueSpec:m,style:u,styleSpec:l,object:r,objectKey:h}))}for(d in a)a[d].required&&void 0===a[d].default&&void 0===r[d]&&c.push(new n(e,r,'missing required property "%s"',d));return c}},{"../error/validation_error":164,"../util/get_type":167,"./validate":170}],184:[function(t,e,r){"use strict";var n=t("./validate"),i=t("../error/validation_error");e.exports=function(t){var e=t.key,r=t.style,o=t.styleSpec,a=t.value,s=t.objectKey,u=o["paint_"+t.layerType];if(!u)return[];var l=s.match(/^(.*)-transition$/);return l&&u[l[1]]&&u[l[1]].transition?n({key:e,value:a,valueSpec:o.transition,style:r,styleSpec:o}):t.valueSpec||u[s]?n({key:t.key,value:a,valueSpec:t.valueSpec||u[s],style:r,styleSpec:o}):[new i(e,a,'unknown property "%s"',s)]}},{"../error/validation_error":164,"./validate":170}],185:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint"),o=t("./validate_object"),a=t("./validate_enum");e.exports=function(t){var e=t.value,r=t.key,s=t.styleSpec,u=t.style;if(!e.type)return[new n(r,e,'"type" is required')];var l=i(e.type);switch(l){case"vector":case"raster":var c=[];if(c=c.concat(o({key:r,value:e,valueSpec:s.source_tile,style:t.style,styleSpec:s})),"url"in e)for(var p in e)["type","url","tileSize"].indexOf(p)<0&&c.push(new n(r+"."+p,e[p],'a source with a "url" property may not include a "%s" property',p));return c;case"geojson":return o({key:r,value:e,valueSpec:s.source_geojson,style:u,styleSpec:s});case"video":return o({key:r,value:e,valueSpec:s.source_video,style:u,styleSpec:s});case"image":return o({key:r,value:e,valueSpec:s.source_image,style:u,styleSpec:s});default:return a({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","geojson","video","image"]},style:u,styleSpec:s})}}},{"../error/validation_error":164,"../util/unbundle_jsonlint":169,"./validate_enum":175,"./validate_object":183}],186:[function(t,e,r){"use strict";var n=t("../util/get_type"),i=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.key,o=n(e);return"string"!==o?[new i(r,e,"string expected, %s found",o)]:[]}},{"../error/validation_error":164,"../util/get_type":167}],187:[function(t,e,r){"use strict";function n(t,e){e=e||u;var r=[];return r=r.concat(s({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:l,"*":function(){return[]}}})),e.$version>7&&t.constants&&(r=r.concat(a({key:"constants",value:t.constants,style:t,styleSpec:e}))),i(r)}function i(t){return[].concat(t).sort(function(t,e){return t.line-e.line})}function o(t){return function(){return i(t.apply(this,arguments))}}var a=t("./validate/validate_constants"),s=t("./validate/validate"),u=t("../reference/latest.min"),l=t("./validate/validate_glyphs_url"); -n.source=o(t("./validate/validate_source")),n.light=o(t("./validate/validate_light")),n.layer=o(t("./validate/validate_layer")),n.filter=o(t("./validate/validate_filter")),n.paintProperty=o(t("./validate/validate_paint_property")),n.layoutProperty=o(t("./validate/validate_layout_property")),e.exports=n},{"../reference/latest.min":188,"./validate/validate":170,"./validate/validate_constants":174,"./validate/validate_filter":176,"./validate/validate_glyphs_url":178,"./validate/validate_layer":179,"./validate/validate_layout_property":180,"./validate/validate_light":181,"./validate/validate_paint_property":184,"./validate/validate_source":185}],188:[function(t,e,r){e.exports=t("./v8.min.json")},{"./v8.min.json":189}],189:[function(t,e,r){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"},light:{type:"light"},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:18},buffer:{type:"number",default:128,maximum:512,minimum:0},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},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:{},"fill-extrusion":{},raster:{},background:{}}},metadata:{type:"*"},ref:{type:"string"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"},"paint.*":{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_fill-extrusion","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_fill-extrusion":{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:{},auto:{}},default:"auto",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:{},width:{},height:{},both:{}},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","text-field",{"icon-text-fit":["both","width","height"]}]},"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:{},auto:{}},default:"auto",requires:["text-field"]},"text-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{map:{},viewport:{},auto:{}},default:"auto",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:"ems",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-line-height":{type:"number",default:1.2,units:"ems",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-letter-spacing":{type:"number",default:0,units:"ems",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:{}}},function:{stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"}},function_stop:{type:"array",minimum:0,maximum:22,value:["number","color"],length:2},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},transition:!1},position:{type:"array",default:[1.15,210,30],length:3,value:"number",transition:!0,function:"interpolated","zoom-function":!0,"property-function":!1},color:{type:"color",default:"#ffffff",function:"interpolated","zoom-function":!0,"property-function":!1,transition:!0},intensity:{type:"number",default:.5,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!1,transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_fill-extrusion","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_fill-extrusion":{"fill-extrusion-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!1,default:1,minimum:0,maximum:1,transition:!0},"fill-extrusion-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"}]},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!1,transition:!0,units:"pixels"},"fill-extrusion-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!1,values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"]},"fill-extrusion-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!1,transition:!0},"fill-extrusion-height":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:0,minimum:0,units:"meters",transition:!0},"fill-extrusion-base":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:0,minimum:0,units:"meters",transition:!0,requires:[{"<=":"fill-extrusion-height"}]}},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"},"circle-stroke-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-stroke-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0}},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"}}}},{}],190:[function(t,e,r){"use strict";function n(t){return!!(i()&&o()&&a()&&s()&&u()&&l()&&c()&&p(t&&t.failIfMajorPerformanceCaveat))}function i(){return"undefined"!=typeof window&&"undefined"!=typeof document}function o(){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 a(){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 u(){return"JSON"in window&&"parse"in JSON&&"stringify"in JSON}function l(){return"Worker"in window}function c(){return"Uint8ClampedArray"in window}function p(t){return void 0===f[t]&&(f[t]=h(t)),f[t]}function h(t){var e=document.createElement("canvas"),r=Object.create(n.webGLContextAttributes);return r.failIfMajorPerformanceCaveat=t,e.probablySupportsContext?e.probablySupportsContext("webgl",r)||e.probablySupportsContext("experimental-webgl",r):e.supportsContext?e.supportsContext("webgl",r)||e.supportsContext("experimental-webgl",r):e.getContext("webgl",r)||e.getContext("experimental-webgl",r)}"undefined"!=typeof e&&e.exports?e.exports=n:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=n);var f={};n.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}},{}],191:[function(t,e,r){(function(t){function e(t,e){for(var r=0,n=t.length-1;n>=0;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function n(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;n=-1&&!i;o--){var a=o>=0?arguments[o]:t.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(r=a+"/"+r,i="/"===a.charAt(0))}return r=e(n(r.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+r||"."},r.normalize=function(t){var i=r.isAbsolute(t),o="/"===a(t,-1);return t=e(n(t.split("/"),function(t){return!!t}),!i).join("/"),t||i||(t="."),t&&o&&(t+="/"),(i?"/":"")+t},r.isAbsolute=function(t){return"/"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(n(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},r.relative=function(t,e){function n(t){for(var e=0;e=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=r.resolve(t).substr(1),e=r.resolve(e).substr(1);for(var i=n(t.split("/")),o=n(e.split("/")),a=Math.min(i.length,o.length),s=a,u=0;u55295&&e<57344){if(!r){e>56319||o+1===n?i.push(239,191,189):r=e;continue}if(e<56320){i.push(239,191,189),r=e;continue}e=r-55296<<10|e-56320|65536,r=null}else r&&(i.push(239,191,189),r=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=n;var o,a,s,u=t("ieee754");o={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 u.read(this,t,!0,23,4)},readDoubleLE:function(t){return u.read(this,t,!0,52,8)},writeFloatLE:function(t,e){return u.write(this,t,e,!0,23,4)},writeDoubleLE:function(t,e){return u.write(this,t,e,!0,52,8)},toString:function(t,e,r){var n="",i="";e=e||0,r=Math.min(this.length,r||this.length);for(var o=e;o=1;){if(e.pos>=r)throw new Error("Given varint doesn't fit into 10 bytes");var n=255&t;e.buf[e.pos++]=n|(t>=128?128:0),t/=128}}function a(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.ceil(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function s(t,e){for(var r=0;r>3,o=this.pos;t(i,e,this),this.pos===o&&this.skip(n)}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,r=this.buf;return e=r[this.pos++],t=127&e,e<128?t:(e=r[this.pos++],t|=(127&e)<<7,e<128?t:(e=r[this.pos++],t|=(127&e)<<14,e<128?t:(e=r[this.pos++],t|=(127&e)<<21,e<128?t:i(t,this))))},readVarint64:function(){var t=this.pos,e=this.readVarint();if(e<_)return e;for(var r=this.pos-2;255===this.buf[r];)r--;r127;);else if(e===n.Bytes)this.pos=this.readVarint()+this.pos;else if(e===n.Fixed32)this.pos+=4;else{if(e!==n.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 o(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=y.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 r=0;r=128&&a(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,n.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){this.writeMessage(t,s,e)},writePackedSVarint:function(t,e){this.writeMessage(t,u,e)},writePackedBoolean:function(t,e){this.writeMessage(t,p,e)},writePackedFloat:function(t,e){this.writeMessage(t,l,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,f,e)},writePackedFixed64:function(t,e){this.writeMessage(t,d,e)},writePackedSFixed64:function(t,e){this.writeMessage(t,m,e)},writeBytesField:function(t,e){this.writeTag(t,n.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,n.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,n.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,n.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}}).call(this,"undefined"!=typeof r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./buffer":192}],194:[function(t,e,r){"use strict";function n(t,e){this.x=t,this.y=e}e.exports=n,n.prototype={clone:function(){return new n(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,r=t.y-this.y;return e*e+r*r},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,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,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),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t}},{}],195:[function(t,e,r){function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function o(t){if(p===setTimeout)return setTimeout(t,0);if((p===n||!p)&&setTimeout)return p=setTimeout,setTimeout(t,0);try{return p(t,0)}catch(e){try{return p.call(null,t,0)}catch(e){return p.call(this,t,0)}}}function a(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(){y&&d&&(y=!1,d.length?m=d.concat(m):v=-1,m.length&&u())}function u(){if(!y){var t=o(s);y=!0;for(var e=m.length;e;){for(d=m,m=[];++v1)for(var r=1;rr;){if(a-r>600){var u=a-r+1,l=e-r+1,c=Math.log(u),p=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*p*(u-p)/u)*(l-u/2<0?-1:1),f=Math.max(r,Math.floor(e-l*p/u+h)),d=Math.min(a,Math.floor(e+(u-l)*p/u+h));n(t,e,f,d,s)}var m=t[e],y=r,v=a;for(i(t,r,e),s(t[a],m)>0&&i(t,r,a);y0;)v--}0===s(t[r],m)?i(t,r,v):(v++,i(t,v,a)),v<=e&&(r=v+1),e<=v&&(a=v-1)}}function i(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function o(t,e){return te?1:0}e.exports=n},{}],197:[function(e,r,n){!function(e,i){"object"==typeof n&&"undefined"!=typeof r?r.exports=i():"function"==typeof t&&t.amd?t(i):e.ShelfPack=i()}(this,function(){function t(t,e,r){r=r||{},this.w=t||64,this.h=e||64,this.autoResize=!!r.autoResize,this.shelves=[],this.stats={},this.count=function(t){this.stats[t]=(0|this.stats[t])+1}}function e(t,e,r){this.x=0,this.y=t,this.w=this.free=e,this.h=r}return t.prototype.pack=function(t,e){t=[].concat(t),e=e||{};for(var r,n,i,o=[],a=0;a0){for(var s=0,u=0,l=0;ln.h||t>n.free||rc)&&(p=2*Math.max(t,c)),(uu)&&(l=2*Math.max(r,u)),this.resize(p,l),this.packOne(t,r)}return null},t.prototype.clear=function(){this.shelves=[],this.stats={}},t.prototype.resize=function(t,e){this.w=t,this.h=e;for(var r=0;rthis.free||e>this.h)return null;var r=this.x;return this.x+=t,this.free-=t,{x:r,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})},{}],198:[function(t,e,r){"use strict";function n(t){return new i(t)}function i(t){this.options=f(Object.create(this.options),t),this.trees=new Array(this.options.maxZoom+1)}function o(t,e,r,n){return{x:t,y:e,zoom:1/0,id:n,numPoints:r}}function a(t,e){var r=t.geometry.coordinates;return o(l(r[0]),c(r[1]),1,e)}function s(t){return{type:"Feature",properties:u(t),geometry:{type:"Point",coordinates:[p(t.x),h(t.y)]}}}function u(t){var e=t.numPoints,r=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:r}}function l(t){return t/360+.5}function c(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function p(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 f(t,e){for(var r in e)t[r]=e[r];return t}function d(t){return t.x}function m(t){return t.y}var y=t("kdbush");e.exports=n,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 r="prepare "+t.length+" points";e&&console.time(r),this.points=t;var n=t.map(a);e&&console.timeEnd(r);for(var i=this.options.maxZoom;i>=this.options.minZoom;i--){var o=+Date.now();this.trees[i+1]=y(n,d,m,this.options.nodeSize,Float32Array),n=this._cluster(n,i),e&&console.log("z%d: %d clusters in %dms",i,n.length,+Date.now()-o)}return this.trees[this.options.minZoom]=y(n,d,m,this.options.nodeSize,Float32Array),e&&console.timeEnd("total time"),this},getClusters:function(t,e){for(var r=this.trees[this._limitZoom(e)],n=r.range(l(t[0]),c(t[3]),l(t[2]),c(t[1])),i=[],o=0;o=0;r--)this._down(r)}function i(t,e){return te?1:0}function o(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}e.exports=n,n.prototype={push:function(t){this.data.push(t),this.length++,this._up(this.length-1)},pop:function(){var t=this.data[0];return this.data[0]=this.data[this.length-1],this.length--,this.data.pop(),this._down(0),t},peek:function(){return this.data[0]},_up:function(t){for(var e=this.data,r=this.compare;t>0;){var n=Math.floor((t-1)/2);if(!(r(e[t],e[n])<0))break;o(e,n,t),t=n}},_down:function(t){for(var e=this.data,r=this.compare,n=this.length;;){var i=2*t+1,a=i+1,s=t;if(in)return n;for(;ro?r=i:n=i,i=.5*(n-r)+r}return i},n.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}},{}],201:[function(t,e,r){"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 r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],202:[function(t,e,r){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:a};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=o),u(r,t,r.depth)}function o(t,e){var r=i.styles[e];return r?"["+i.colors[r][0]+"m"+t+"["+i.colors[r][1]+"m":t}function a(t,e){return t}function s(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}function u(t,e,r){if(t.customInspect&&e&&z(e.inspect)&&e.inspect!==n.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(r,t);return _(i)||(i=u(t,i,r)),i}var o=l(t,e);if(o)return o;var a=Object.keys(e),m=s(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(e)),S(e)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return c(e);if(0===a.length){if(z(e)){var y=e.name?": "+e.name:"";return t.stylize("[Function"+y+"]","special")}if(w(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(T(e))return t.stylize(Date.prototype.toString.call(e),"date");if(S(e))return c(e)}var v="",g=!1,x=["{","}"];if(d(e)&&(g=!0,x=["[","]"]),z(e)){var b=e.name?": "+e.name:"";v=" [Function"+b+"]"}if(w(e)&&(v=" "+RegExp.prototype.toString.call(e)),T(e)&&(v=" "+Date.prototype.toUTCString.call(e)),S(e)&&(v=" "+c(e)),0===a.length&&(!g||0==e.length))return x[0]+v+x[1];if(r<0)return w(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var E;return E=g?p(t,e,r,m,a):a.map(function(n){return h(t,e,r,m,n,g)}),t.seen.pop(),f(E,v,x)}function l(t,e){if(b(e))return t.stylize("undefined","undefined");if(_(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return g(e)?t.stylize(""+e,"number"):m(e)?t.stylize(""+e,"boolean"):y(e)?t.stylize("null","null"):void 0}function c(t){return"["+Error.prototype.toString.call(t)+"]"}function p(t,e,r,n,i){for(var o=[],a=0,s=e.length;a-1&&(s=o?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(a)){if(o&&i.match(/^\d+$/))return s;a=JSON.stringify(""+i),a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function f(t,e,r){var n=0,i=t.reduce(function(t,e){return n++,e.indexOf("\n")>=0&&n++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}function d(t){return Array.isArray(t)}function m(t){return"boolean"==typeof t}function y(t){return null===t}function v(t){return null==t}function g(t){return"number"==typeof t}function _(t){return"string"==typeof t}function x(t){return"symbol"==typeof t}function b(t){return void 0===t}function w(t){return E(t)&&"[object RegExp]"===M(t)}function E(t){return"object"==typeof t&&null!==t}function T(t){return E(t)&&"[object Date]"===M(t)}function S(t){return E(t)&&("[object Error]"===M(t)||t instanceof Error)}function z(t){return"function"==typeof t}function A(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t}function M(t){return Object.prototype.toString.call(t)}function P(t){return t<10?"0"+t.toString(10):t.toString(10)}function L(){var t=new Date,e=[P(t.getHours()),P(t.getMinutes()),P(t.getSeconds())].join(":");return[t.getDate(),D[t.getMonth()],e].join(" ")}function k(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var C=/%[sdj%]/g;n.format=function(t){if(!_(t)){for(var e=[],r=0;r=o)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}),s=n[r];r>3}if(i--,1===n||2===n)o+=t.readSVarint(),a+=t.readSVarint(),1===n&&(e&&s.push(e),e=[]),e.push(new u(o,a));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&s.push(e),s},n.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,o=0,a=1/0,s=-(1/0),u=1/0,l=-(1/0);t.pos>3}if(n--,1===r||2===r)i+=t.readSVarint(),o+=t.readSVarint(),is&&(s=i),ol&&(l=o);else if(7!==r)throw new Error("unknown command "+r)}return[a,u,s,l]},n.prototype.toGeoJSON=function(t,e,r){function i(t){for(var e=0;e>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}var a=t("./vectortilefeature.js");e.exports=n,n.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 a(this._pbf,e,this.extent,this._keys,this._values)}},{"./vectortilefeature.js":206}],208:[function(t,e,r){function n(t){var e=[];for(var r in t.layers)e.push(o(t.layers[r]));var n=new c;return p.tile.write({layers:e},n),n.finish()}function i(t){var e={};for(var r in t)e[r]=new h(t[r].features),e[r].name=r;return n({layers:e})}function o(t){for(var e={name:t.name||"",version:t.version||1,extent:t.extent||4096,keys:[],values:[],features:[]},r={},n={},i=0;i>31}function u(t){for(var e=[],r=0,n=0,i=t.length,o=0;o0&&(i=n.places);var map=r.i(a.a)(t,e,i),s=document.createElement("div"),c=l(map,e,i);s.appendChild(c);var p=r.i(u.a)(map);s.appendChild(p);var h=document.querySelector("fieldset");h.insertBefore(s,document.querySelector(".map"))}).catch(function(t){console.error(t)})}var i=r(3),o=r.n(i),a=r(2),s=r(1),u=r(14);e.a=n;var l=function(map,t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=document.createElement("select");n.setAttribute("name","location");var i=document.createElement("option");i.setAttribute("selected","selected"),i.setAttribute("value","no-location"),i.appendChild(document.createTextNode("Don’t send location")),n.appendChild(i);var o=document.createElement("option");if(o.setAttribute("id","option-coords"),o.setAttribute("value","geo:"+t.coords.latitude+","+t.coords.longitude),o.dataset.latitude=t.coords.latitude,o.dataset.longitude=t.coords.longitude,o.appendChild(document.createTextNode("Send co-ordinates")),n.appendChild(o),null!=e){var a=!0,u=!1,l=void 0;try{ -for(var c,p=e[Symbol.iterator]();!(a=(c=p.next()).done);a=!0){var h=c.value,f=r.i(s.a)(h.location),d=document.createElement("option");d.setAttribute("value",h.slug),d.dataset.latitude=f.latitude,d.dataset.longitude=f.longitude,d.appendChild(document.createTextNode(h.name)),n.appendChild(d)}}catch(t){u=!0,l=t}finally{try{!a&&p.return&&p.return()}finally{if(u)throw l}}}return n.addEventListener("change",function(){if("no-location"!==n.value){var t=n[n.selectedIndex].dataset.latitude,e=n[n.selectedIndex].dataset.longitude;map.flyTo({center:[e,t]})}}),n}},function(t,e,r){"use strict";function n(){var t=document.querySelector("fieldset"),e=document.createElement("div");e.classList.add("map"),t.appendChild(e),navigator.geolocation.getCurrentPosition(function(t){e.dataset.latitude=t.coords.latitude,e.dataset.longitude=t.coords.longitude,e.dataset.accuracy=t.coords.accuracy,r.i(i.a)(e,t)})}var i=r(12);e.a=n},function(t,e,r){"use strict";function n(map){var t=document.createElement("button");return t.setAttribute("type","button"),t.setAttribute("id","create-new-place"),t.appendChild(document.createTextNode("Create New Place?")),t.addEventListener("click",function(){var t=document.createElement("div"),e=document.createElement("label");e.setAttribute("for","place-name"),e.classList.add("place-label"),e.appendChild(document.createTextNode("Name:"));var n=document.createElement("input");n.setAttribute("placeholder","Name"),n.setAttribute("name","place-name"),n.setAttribute("id","place-name"),n.setAttribute("type","text"),t.appendChild(e),t.appendChild(n);var o=document.createElement("div"),a=document.createElement("label");a.setAttribute("for","place-description"),a.classList.add("place-label"),a.appendChild(document.createTextNode("Description:"));var s=document.createElement("input");s.setAttribute("placeholder","Description"),s.setAttribute("name","place-description"),s.setAttribute("id","place-description"),s.setAttribute("type","text"),o.appendChild(a),o.appendChild(s);var u=document.createElement("div"),l=document.createElement("label");l.setAttribute("for","place-latitude"),l.classList.add("place-label"),l.appendChild(document.createTextNode("Latitude:"));var c=document.createElement("input");c.setAttribute("name","place-latitude"),c.setAttribute("id","place-latitude"),c.setAttribute("type","text"),c.value=map.getCenter().lat,u.appendChild(l),u.appendChild(c);var p=document.createElement("div"),h=document.createElement("label");h.setAttribute("for","place-longitude"),h.classList.add("place-label"),h.appendChild(document.createTextNode("Longitude:"));var f=document.createElement("input");f.setAttribute("name","place-longitude"),f.setAttribute("id","place-longitude"),f.setAttribute("type","text"),f.value=map.getCenter().lng,p.appendChild(h),p.appendChild(f);var d=document.createElement("button");d.setAttribute("id","place-submit"),d.setAttribute("name","place-submit"),d.setAttribute("type","button"),d.appendChild(document.createTextNode("Submit New Place")),d.addEventListener("click",function(){r.i(i.a)(map)});var m=document.querySelector("fieldset");m.appendChild(t),m.appendChild(o),m.appendChild(u),m.appendChild(p),m.appendChild(d)}),t}var i=r(15);e.a=n},function(t,e,r){"use strict";function n(map){var t=new FormData;t.append("place-name",document.querySelector("#place-name").value),t.append("place-description",document.querySelector("#place-description").value),t.append("place-latitude",document.querySelector("#place-latitude").value),t.append("place-longitude",document.querySelector("#place-longitude").value),fetch("/places/new",{credentials:"same-origin",method:"post",body:t}).then(function(t){return t.json()}).then(function(t){if(t.error===!0)throw new Error(t.error_description);var e=document.querySelector("fieldset"),r=document.querySelectorAll(".place-label"),n=!0,i=!1,o=void 0;try{for(var a,s=r[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value;e.removeChild(u.parentNode)}}catch(t){i=!0,o=t}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}e.removeChild(document.querySelector("#place-submit"));var l=document.querySelector("#create-new-place");l.parentNode.removeChild(l);var c=map.getSource("points"),p=c._data.features.filter(function(t){return"Current Location"!=t.properties.title});p.push({type:"Feature",geometry:{type:"Point",coordinates:[t.longitude,t.latitude]},properties:{title:t.name,icon:"circle",uri:t.uri}});var h={type:"FeatureCollection",features:p};map.getSource("points").setData(h);var f=document.querySelector("select"),d=document.createElement("option");d.setAttribute("value",t.uri),d.appendChild(document.createTextNode(t.name)),d.dataset.latitude=t.latitude,d.dataset.longitude=t.longitude,f.appendChild(d),document.querySelector('select [value="'+t.uri+'"]').selected=!0}).catch(function(t){o.a.reset(),o.a.error(t)})}var i=r(3),o=r.n(i);e.a=n},function(t,e,r){/*! +var K=r(5),Q=r(7),$=r(8);e.Buffer=a,e.SlowBuffer=y,e.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:n(),e.kMaxLength=i(),a.poolSize=8192,a._augment=function(t){return t.__proto__=a.prototype,t},a.from=function(t,e,r){return s(null,t,e,r)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0})),a.alloc=function(t,e,r){return l(null,t,e,r)},a.allocUnsafe=function(t){return c(null,t)},a.allocUnsafeSlow=function(t){return c(null,t)},a.isBuffer=function(t){return!(null==t||!t._isBuffer)},a.compare=function(t,e){if(!a.isBuffer(t)||!a.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},a.prototype.compare=function(t,e,r,n,i){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,s=r-e,u=Math.min(o,s),l=this.slice(n,i),c=t.slice(e,r),h=0;hi)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":return T(this,t,e,r);case"latin1":case"binary":return S(this,t,e,r);case"base64":return z(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var tt=4096;a.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),e0&&(i*=256);)n+=this[t+--e]*i;return n},a.prototype.readUInt8=function(t,e){return e||D(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,e){return e||D(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,e){return e||D(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,e){return e||D(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUInt32BE=function(t,e){return e||D(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||D(t,e,this.length);for(var n=this[t],i=1,o=0;++o=i&&(n-=Math.pow(2,8*e)),n},a.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||D(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},a.prototype.readInt8=function(t,e){return e||D(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},a.prototype.readInt16LE=function(t,e){e||D(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(t,e){e||D(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(t,e){return e||D(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return e||D(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return e||D(t,4,this.length),Q.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return e||D(t,4,this.length),Q.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return e||D(t,8,this.length),Q.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return e||D(t,8,this.length),Q.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e|=0,r|=0,!n){var i=Math.pow(2,8*r)-1;O(this,t,e,r,i,0)}var o=1,a=0;for(this[e]=255&t;++a=0&&(a*=256);)this[e+o]=t/a&255;return e+r},a.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},a.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):B(this,t,e,!0),e+2},a.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):B(this,t,e,!1),e+2},a.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):j(this,t,e,!0),e+4},a.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):j(this,t,e,!1),e+4},a.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);O(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o>0)-s&255;return e+r},a.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);O(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},a.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):B(this,t,e,!0),e+2},a.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):B(this,t,e,!1),e+2},a.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):j(this,t,e,!0),e+4},a.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):j(this,t,e,!1),e+4},a.prototype.writeFloatLE=function(t,e,r){return U(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return U(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return N(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return N(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var o;if("number"==typeof t)for(o=e;o>1,c=-7,h=r?i-1:0,p=r?-1:1,f=t[e+h];for(h+=p,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=256*o+t[e+h],h+=p,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+t[e+h],h+=p,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:(f?-1:1)*(1/0);a+=Math.pow(2,n),o-=l}return(f?-1:1)*a*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var a,s,u,l=8*o-i-1,c=(1<>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,d=n?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,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),e+=a+h>=1?p/u:p*Math.pow(2,1-h),e*u>=2&&(a++,u/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(e*u-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[r+f]=255&s,f+=d,s/=256,i-=8);for(a=a<0;t[r+f]=255&a,f+=d,a/=256,l-=8);t[r+f-d]|=128*m}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){(function(e,r){var n,n;!function(e){t.exports=e()}(function(){var t;return function t(e,r,i){function o(s,u){if(!r[s]){if(!e[s]){var l="function"==typeof n&&n;if(!u&&l)return n(s,!0);if(a)return a(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var h=r[s]={exports:{}};e[s][0].call(h.exports,function(t){var r=e[s][1][t];return o(r?r:t)},h,h.exports,t,e,r,i)}return r[s].exports}for(var a="function"==typeof n&&n,s=0;sa.MAX_VERTEX_ARRAY_LENGTH)&&(e=new o(this.layoutVertexArray.length,this.elementArray.length),this.segments.push(e)),e},a.prototype.prepareSegment2=function(t){var e=this.segments2[this.segments2.length-1];return(!e||e.vertexLength+t>a.MAX_VERTEX_ARRAY_LENGTH)&&(e=new o(this.layoutVertexArray.length,this.elementArray2.length),this.segments2.push(e)),e},a.prototype.populatePaintArrays=function(t){var e=this;for(var r in this.layerData){var n=e.layerData[r];0!==n.paintVertexArray.bytesPerElement&&n.programConfiguration.populatePaintArray(n.layer,n.paintVertexArray,e.layoutVertexArray.length,e.globalProperties,t)}},a.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},a.prototype.serialize=function(t){return{layoutVertexArray:this.layoutVertexArray.serialize(t),elementArray:this.elementArray&&this.elementArray.serialize(t),elementArray2:this.elementArray2&&this.elementArray2.serialize(t),paintVertexArrays:n(this.layerData,t),segments:this.segments,segments2:this.segments2}},a.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,e.exports=a},{"./program_configuration":15}],2:[function(t,e,r){"use strict";var n=t("./array_group"),i=t("./buffer_group"),o=t("../util/util"),a=function(t,e){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.index=t.index,t.arrays?this.buffers=new i(e,t.layers,t.zoom,t.arrays):this.arrays=new n(e,t.layers,t.zoom)};a.prototype.populate=function(t,e){for(var r=this,n=0,i=t;n=u||p<0||p>=u)){var f=e.prepareSegment(4),d=f.vertexLength;n(e.layoutVertexArray,h,p,-1,-1),n(e.layoutVertexArray,h,p,1,-1),n(e.layoutVertexArray,h,p,1,1),n(e.layoutVertexArray,h,p,-1,1),e.elementArray.emplaceBack(d,d+1,d+2),e.elementArray.emplaceBack(d,d+3,d+2),f.vertexLength+=4,f.primitiveLength+=2}}e.populatePaintArrays(t.properties)},e}(i);e.exports=c},{"../bucket":2,"../element_array_type":10,"../extent":11,"../load_geometry":13,"../vertex_array_type":17}],4:[function(t,e,r){"use strict";var n=t("../bucket"),i=t("../vertex_array_type"),o=t("../element_array_type"),a=t("../load_geometry"),s=t("earcut"),u=t("../../util/classify_rings"),l=500,c={layoutVertexArrayType:i([{name:"a_pos",components:2,type:"Int16"}]),elementArrayType:o(3),elementArrayType2:o(2),paintAttributes:[{property:"fill-color",type:"Uint8"},{property:"fill-outline-color",type:"Uint8"},{property:"fill-opacity",type:"Uint8",multiplier:255}]},h=function(t){function e(e){t.call(this,e,c)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addFeature=function(t){for(var e=this.arrays,r=0,n=u(a(t),l);rl)||t.y===e.y&&(t.y<0||t.y>l)}var o=t("../bucket"),a=t("../vertex_array_type"),s=t("../element_array_type"),u=t("../load_geometry"),l=t("../extent"),c=t("earcut"),h=t("../../util/classify_rings"),p=500,f={layoutVertexArrayType:a([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal",components:3,type:"Int16"},{name:"a_edgedistance",components:1,type:"Int16"}]),elementArrayType:s(3),paintAttributes:[{property:"fill-extrusion-base",type:"Uint16"},{property:"fill-extrusion-height",type:"Uint16"},{property:"fill-extrusion-color",type:"Uint8"}]},d=Math.pow(2,13),m=function(t){function e(e){t.call(this,e,f)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addFeature=function(t){for(var e=this.arrays,r=0,o=h(u(t),p);r=1){var S=b[E-1];if(!i(T,S)){var z=T.sub(S)._perp()._unit();n(e.layoutVertexArray,T.x,T.y,z.x,z.y,0,0,w),n(e.layoutVertexArray,T.x,T.y,z.x,z.y,0,1,w),w+=S.dist(T),n(e.layoutVertexArray,S.x,S.y,z.x,z.y,0,0,w),n(e.layoutVertexArray,S.x,S.y,z.x,z.y,0,1,w);var A=m.vertexLength;e.elementArray.emplaceBack(A,A+1,A+2),e.elementArray.emplaceBack(A+1,A+2,A+3),m.vertexLength+=4,m.primitiveLength+=2}}y.push(T.x),y.push(T.y)}}}for(var M=c(y,v),P=0;P>6)}var i=t("../bucket"),o=t("../vertex_array_type"),a=t("../element_array_type"),s=t("../load_geometry"),u=t("../extent"),l=63,c=Math.cos(37.5*(Math.PI/180)),h=15,p=15,f=.5,d=Math.pow(2,p-1)/f,m={layoutVertexArrayType:o([{name:"a_pos",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}]),paintAttributes:[{property:"line-color",type:"Uint8"},{property:"line-blur",multiplier:10,type:"Uint8"},{property:"line-opacity",multiplier:10,type:"Uint8"},{property:"line-gap-width",multiplier:10,type:"Uint8",name:"a_gapwidth"},{property:"line-offset",multiplier:1,type:"Int8"}],elementArrayType:a()},y=function(t){function e(e){t.call(this,e,m)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addFeature=function(t){for(var e=this,r=this.layers[0].layout,n=r["line-join"],i=r["line-cap"],o=r["line-miter-limit"],a=r["line-round-limit"],u=0,l=s(t,p);u2&&t[s-1].equals(t[s-2]);)s--;if(!(t.length<2)){"bevel"===r&&(i=1.05);var l=h*(u/(512*this.overscaling)),p=t[0],f=t[s-1],d=p.equals(f),m=this.arrays,y=m.prepareSegment(10*s);if(2!==s||!d){this.distance=0;var v,g,_,x,b,w,E,T=n,S=d?"butt":n,z=!0;this.e1=this.e2=this.e3=-1,d&&(v=t[s-2],b=p.sub(v)._unit()._perp());for(var A=0;A0){var k=v.dist(g);if(k>2*l){var I=v.sub(v.sub(g)._mult(l/k)._round());a.distance+=I.dist(g),a.addCurrentVertex(I,a.distance,x.mult(1),0,0,!1,y),g=I}}var R=g&&_,D=R?r:_?T:S;if(R&&"round"===D&&(Li&&(D="bevel"),"bevel"===D&&(L>2&&(D="flipbevel"),L100)M=b.clone().mult(-1);else{var O=x.x*b.y-x.y*b.x>0?-1:1,B=L*x.add(b).mag()/x.sub(b).mag();M._perp()._mult(B*O)}a.addCurrentVertex(v,a.distance,M,0,0,!1,y),a.addCurrentVertex(v,a.distance,M.mult(-1),0,0,!1,y)}else if("bevel"===D||"fakeround"===D){var j=x.x*b.y-x.y*b.x>0,F=-Math.sqrt(L*L-1);if(j?(E=0,w=F):(w=0,E=F),z||a.addCurrentVertex(v,a.distance,x,w,E,!1,y),"fakeround"===D){for(var U,N=Math.floor(8*(.5-(P-.5))),V=0;V=0;q--)U=x.mult((q+1)/(N+1))._add(b)._unit(),a.addPieSliceVertex(v,a.distance,U,j,y)}_&&a.addCurrentVertex(v,a.distance,b,-w,-E,!1,y)}else"butt"===D?(z||a.addCurrentVertex(v,a.distance,x,0,0,!1,y),_&&a.addCurrentVertex(v,a.distance,b,0,0,!1,y)):"square"===D?(z||(a.addCurrentVertex(v,a.distance,x,1,1,!1,y),a.e1=a.e2=-1),_&&a.addCurrentVertex(v,a.distance,b,-1,-1,!1,y)):"round"===D&&(z||(a.addCurrentVertex(v,a.distance,x,0,0,!1,y),a.addCurrentVertex(v,a.distance,x,1,1,!0,y),a.e1=a.e2=-1),_&&(a.addCurrentVertex(v,a.distance,b,-1,-1,!0,y),a.addCurrentVertex(v,a.distance,b,0,0,!1,y)));if(C&&A2*l){var G=v.add(_.sub(v)._mult(l/Z)._round());a.distance+=G.dist(v),a.addCurrentVertex(G,a.distance,b.mult(1),0,0,!1,y),v=G}}z=!1}m.populatePaintArrays(e)}}},e.prototype.addCurrentVertex=function(t,e,r,i,o,a,s){var u,l=a?1:0,c=this.arrays,h=c.layoutVertexArray,p=c.elementArray;u=r.clone(),i&&u._sub(r.perp()._mult(i)),n(h,t,u,l,0,i,e),this.e3=s.vertexLength++,this.e1>=0&&this.e2>=0&&(p.emplaceBack(this.e1,this.e2,this.e3),s.primitiveLength++),this.e1=this.e2,this.e2=this.e3,u=r.mult(-1),o&&u._sub(r.perp()._mult(o)),n(h,t,u,l,1,-o,e),this.e3=s.vertexLength++,this.e1>=0&&this.e2>=0&&(p.emplaceBack(this.e1,this.e2,this.e3),s.primitiveLength++),this.e1=this.e2,this.e2=this.e3,e>d/2&&(this.distance=0,this.addCurrentVertex(t,this.distance,r,i,o,a,s))},e.prototype.addPieSliceVertex=function(t,e,r,i,o){var a=i?1:0;r=r.mult(i?-1:1);var s=this.arrays,u=s.layoutVertexArray,l=s.elementArray;n(u,t,r,0,a,0,e),this.e3=o.vertexLength++,this.e1>=0&&this.e2>=0&&(l.emplaceBack(this.e1,this.e2,this.e3),o.primitiveLength++),i?this.e2=this.e3:this.e1=this.e3},e}(i);e.exports=y},{"../bucket":2,"../element_array_type":10,"../extent":11,"../load_geometry":13,"../vertex_array_type":17}],7:[function(t,e,r){"use strict";function n(t,e,r,n,i,o,a,s,u,l,c){t.emplaceBack(e,r,Math.round(64*n),Math.round(64*i),o/4,a/4,10*(l||0),c,10*(s||0),10*Math.min(u||25,25))}function i(t,e,r,n,i){return t.emplaceBack(e.x,e.y,Math.round(r.x),Math.round(r.y),10*n,10*i)}var o=t("point-geometry"),a=t("../array_group"),s=t("../buffer_group"),u=t("../vertex_array_type"),l=t("../element_array_type"),c=t("../extent"),h=t("../../symbol/anchor"),p=t("../../symbol/get_anchors"),f=t("../../util/token"),d=t("../../symbol/quads"),m=t("../../symbol/shaping"),y=t("../../symbol/resolve_text"),v=t("../../symbol/mergelines"),g=t("../../symbol/clip_line"),_=t("../../util/util"),x=t("../../util/script_detection"),b=t("../load_geometry"),w=t("../../symbol/collision_feature"),E=t("../../util/find_pole_of_inaccessibility"),T=t("../../util/classify_rings"),S=t("vector-tile").VectorTileFeature,z=t("../../source/rtl_text_plugin"),A=m.shapeText,M=m.shapeIcon,P=m.WritingMode,L=d.getGlyphQuads,C=d.getIconQuads,k=l(),I=u([{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"}]),R={glyph:{layoutVertexArrayType:I,elementArrayType:k},icon:{layoutVertexArrayType:I,elementArrayType:k},collisionBox:{layoutVertexArrayType:u([{name:"a_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"},{name:"a_data",components:2,type:"Uint8"}]),elementArrayType:l(2)}},D=function(t){var e=this;if(this.collisionBoxArray=t.collisionBoxArray,this.symbolQuadsArray=t.symbolQuadsArray,this.symbolInstancesArray=t.symbolInstancesArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.index=t.index,this.sdfIcons=t.sdfIcons,this.iconsNeedLinear=t.iconsNeedLinear,this.adjustedTextSize=t.adjustedTextSize,this.adjustedIconSize=t.adjustedIconSize,this.fontstack=t.fontstack,t.arrays){this.buffers={};for(var r in t.arrays)t.arrays[r]&&(e.buffers[r]=new s(R[r],t.layers,t.zoom,t.arrays[r]))}};D.prototype.populate=function(t,e){var r=this,n=this.layers[0].layout,i=n["text-field"],o=n["text-font"],a=n["icon-image"],s=i&&o,u=a;if(this.features=[],s||u){for(var l=e.iconDependencies,c=e.glyphDependencies,h=c[o]=c[o]||{},p=0;pc||o.y<0||o.y>c);if(!m||a){var s=a||w;n.addSymbolInstance(o,i,e,r,n.layers[0],s,n.symbolInstancesArray.length,n.collisionBoxArray,t.index,t.sourceLayerIndex,n.index,u,y,x,f,v,b,{zoom:n.zoom},t.properties)}};if("line"===S)for(var M=0,L=g(t.geometry,0,0,c,c);M=0;o--)if(r.dist(i[o])7*Math.PI/4)continue}else if(o&&a&&y<=3*Math.PI/4||y>5*Math.PI/4)continue}else if(o&&a&&(y<=Math.PI/2||y>3*Math.PI/2))continue;var v=m.tl,g=m.tr,_=m.bl,x=m.br,b=m.tex,w=m.anchorPoint,E=Math.max(p+Math.log(m.minScale)/Math.LN2,f),T=Math.min(p+Math.log(m.maxScale)/Math.LN2,25);if(!(T<=E)){E===f&&(E=0);var S=Math.round(m.glyphAngle/(2*Math.PI)*256),z=t.prepareSegment(4),A=z.vertexLength;n(h,w.x,w.y,v.x,v.y,b.x,b.y,E,T,f,S),n(h,w.x,w.y,g.x,g.y,b.x+b.w,b.y,E,T,f,S),n(h,w.x,w.y,_.x,_.y,b.x,b.y+b.h,E,T,f,S),n(h,w.x,w.y,x.x,x.y,b.x+b.w,b.y+b.h,E,T,f,S),c.emplaceBack(A,A+1,A+2),c.emplaceBack(A+1,A+2,A+3),z.vertexLength+=4,z.primitiveLength+=2}}},D.prototype.addToDebugBuffers=function(t){for(var e=this,r=this.arrays.collisionBox,n=r.layoutVertexArray,a=r.elementArray,s=-t.angle,u=t.yStretch,l=this.symbolInstancesStartIndex;lD.MAX_QUADS&&_.warnOnce("Too many symbols being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),I>D.MAX_QUADS&&_.warnOnce("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907");var N=(r[P.vertical]?P.vertical:0)|(r[P.horizontal]?P.horizontal:0);return this.symbolInstancesArray.emplaceBack(R,O,F,U,M,I,B,j,t.x,t.y,a,N)},D.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,t.writingMode)},D.MAX_QUADS=65535,e.exports=D},{"../../source/rtl_text_plugin":49,"../../symbol/anchor":75,"../../symbol/clip_line":77,"../../symbol/collision_feature":79,"../../symbol/get_anchors":81,"../../symbol/mergelines":84,"../../symbol/quads":85,"../../symbol/resolve_text":86,"../../symbol/shaping":87,"../../util/classify_rings":113,"../../util/find_pole_of_inaccessibility":119,"../../util/script_detection":126,"../../util/token":128,"../../util/util":129,"../array_group":1,"../buffer_group":9,"../element_array_type":10,"../extent":11,"../load_geometry":13,"../vertex_array_type":17,"point-geometry":197,"vector-tile":206}],8:[function(t,e,r){"use strict";var n={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT"},i=function(t,e,r){this.arrayBuffer=t.arrayBuffer,this.length=t.length,this.attributes=e.members,this.itemSize=e.bytesPerElement,this.type=r,this.arrayType=e};i.fromStructArray=function(t,e){return new i(t.serialize(),t.constructor.serialize(),e)},i.prototype.bind=function(t){var e=t[this.type];this.buffer?t.bindBuffer(e,this.buffer):(this.gl=t,this.buffer=t.createBuffer(),t.bindBuffer(e,this.buffer),t.bufferData(e,this.arrayBuffer,t.STATIC_DRAW),this.arrayBuffer=null)},i.prototype.setVertexAttribPointers=function(t,e,r){for(var i=this,o=0;o0?t["line-gap-width"]+2*t["line-width"]:t["line-width"]}function a(t,e,r,n,i){if(!e[0]&&!e[1])return t;e=u.convert(e),"viewport"===r&&e._rotate(-n);for(var o=[],a=0;ar.max||h.yr.max)&&i.warnOnce("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return s}},{"../util/util":129,"./extent":11}],14:[function(t,e,r){"use strict";var n=t("../util/struct_array"),i=n({members:[{name:"a_pos",type:"Int16",components:2}]});e.exports=i},{"../util/struct_array":127}],15:[function(t,e,r){"use strict";function n(t,e,r,n){if(!t.zoomStops)return e.getPaintValue(t.property,r,n);var i=t.zoomStops.map(function(i){return e.getPaintValue(t.property,a.extend({},r,{zoom:i}),n)});return 1===i.length?i[0]:i}function i(t,e){var r=t.property.replace(e.type+"-","").replace(/-/g,"_"),n="color"===e._paintSpecifications[t.property].type;return a.extend({name:"a_"+r,components:n?4:1,multiplier:n?255:1},t)}var o=t("./vertex_array_type"),a=t("../util/util"),s=function(){this.attributes=[],this.uniforms=[],this.interpolationUniforms=[],this.pragmas={vertex:{},fragment:{}},this.cacheKey=""};s.createDynamic=function(t,e,r){for(var n=new s,a=0,u=t;a90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};i.prototype.wrap=function(){return new i(n(this.lng,-180,180),this.lat)},i.prototype.toArray=function(){return[this.lng,this.lat]},i.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},i.convert=function(t){if(t instanceof i)return t;if(t&&t.hasOwnProperty("lng")&&t.hasOwnProperty("lat"))return new i(t.lng,t.lat);if(Array.isArray(t)&&2===t.length)return new i(t[0],t[1]);throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, or an array of [, ]")},e.exports=i},{"../util/util":129}],20:[function(t,e,r){"use strict";var n=t("./lng_lat"),i=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};i.prototype.setNorthEast=function(t){return this._ne=n.convert(t),this},i.prototype.setSouthWest=function(t){return this._sw=n.convert(t),this},i.prototype.extend=function(t){var e,r,o=this._sw,a=this._ne;if(t instanceof n)e=t,r=t;else{if(!(t instanceof i))return Array.isArray(t)?t.every(Array.isArray)?this.extend(i.convert(t)):this.extend(n.convert(t)):this;if(e=t._sw,r=t._ne,!e||!r)return this}return o||a?(o.lng=Math.min(e.lng,o.lng),o.lat=Math.min(e.lat,o.lat),a.lng=Math.max(r.lng,a.lng),a.lat=Math.max(r.lat,a.lat)):(this._sw=new n(e.lng,e.lat),this._ne=new n(r.lng,r.lat)),this},i.prototype.getCenter=function(){return new n((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},i.prototype.getSouthWest=function(){return this._sw},i.prototype.getNorthEast=function(){return this._ne},i.prototype.getNorthWest=function(){return new n(this.getWest(),this.getNorth())},i.prototype.getSouthEast=function(){return new n(this.getEast(),this.getSouth())},i.prototype.getWest=function(){return this._sw.lng},i.prototype.getSouth=function(){return this._sw.lat},i.prototype.getEast=function(){return this._ne.lng},i.prototype.getNorth=function(){return this._ne.lat},i.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},i.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},i.convert=function(t){return!t||t instanceof i?t:new i(t)},e.exports=i},{"./lng_lat":19}],21:[function(t,e,r){"use strict";var n=t("./lng_lat"),i=t("point-geometry"),o=t("./coordinate"),a=t("../util/util"),s=t("../util/interpolate"),u=t("../source/tile_coord"),l=t("../data/extent"),c=t("@mapbox/gl-matrix"),h=c.vec4,p=c.mat4,f=c.mat2,d=function(t,e,r){this.tileSize=512,this._renderWorldCopies=void 0===r||r,this._minZoom=t||0,this._maxZoom=e||22,this.latRange=[-85.05113,85.05113],this.width=0,this.height=0,this._center=new n(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0},m={minZoom:{},maxZoom:{},worldSize:{},centerPoint:{},size:{},bearing:{},pitch:{},fov:{},zoom:{},center:{},unmodified:{},x:{},y:{},point:{}};m.minZoom.get=function(){return this._minZoom},m.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},m.maxZoom.get=function(){return this._maxZoom},m.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},m.worldSize.get=function(){return this.tileSize*this.scale},m.centerPoint.get=function(){return this.size._div(2)},m.size.get=function(){return new i(this.width,this.height)},m.bearing.get=function(){return-this.angle/Math.PI*180},m.bearing.set=function(t){var e=-a.wrap(t,-180,180)*Math.PI/180;this.angle!==e&&(this._unmodified=!1,this.angle=e,this._calcMatrices(),this.rotationMatrix=f.create(),f.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},m.pitch.get=function(){return this._pitch/Math.PI*180},m.pitch.set=function(t){var e=a.clamp(t,0,60)/180*Math.PI;this._pitch!==e&&(this._unmodified=!1,this._pitch=e,this._calcMatrices())},m.fov.get=function(){return this._fov/Math.PI*180},m.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())},m.zoom.get=function(){return this._zoom},m.zoom.set=function(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._constrain(),this._calcMatrices())},m.center.get=function(){return this._center},m.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},d.prototype.coveringZoomLevel=function(t){return(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},d.prototype.coveringTiles=function(t){var e=this.coveringZoomLevel(t),r=e;if(et.maxzoom&&(e=t.maxzoom);var n=this.pointCoordinate(this.centerPoint,e),o=new i(n.column-.5,n.row-.5),a=[this.pointCoordinate(new i(0,0),e),this.pointCoordinate(new i(this.width,0),e),this.pointCoordinate(new i(this.width,this.height),e),this.pointCoordinate(new i(0,this.height),e)];return u.cover(e,a,t.reparseOverscaled?r:e,this._renderWorldCopies).sort(function(t,e){return o.dist(t)-o.dist(e)})},d.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},m.unmodified.get=function(){return this._unmodified},d.prototype.zoomScale=function(t){return Math.pow(2,t)},d.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},d.prototype.project=function(t){return new i(this.lngX(t.lng),this.latY(t.lat))},d.prototype.unproject=function(t){return new n(this.xLng(t.x),this.yLat(t.y))},m.x.get=function(){return this.lngX(this.center.lng)},m.y.get=function(){return this.latY(this.center.lat)},m.point.get=function(){return new i(this.x,this.y)},d.prototype.lngX=function(t){return(180+t)*this.worldSize/360},d.prototype.latY=function(t){var e=180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360));return(180-e)*this.worldSize/360},d.prototype.xLng=function(t){return 360*t/this.worldSize-180},d.prototype.yLat=function(t){var e=180-360*t/this.worldSize;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90},d.prototype.setLocationAtPoint=function(t,e){var r=this.pointCoordinate(e)._sub(this.pointCoordinate(this.centerPoint));this.center=this.coordinateLocation(this.locationCoordinate(t)._sub(r))},d.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},d.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},d.prototype.locationCoordinate=function(t){return new o(this.lngX(t.lng)/this.tileSize,this.latY(t.lat)/this.tileSize,this.zoom).zoomTo(this.tileZoom)},d.prototype.coordinateLocation=function(t){var e=t.zoomTo(this.zoom);return new n(this.xLng(e.column*this.tileSize),this.yLat(e.row*this.tileSize))},d.prototype.pointCoordinate=function(t,e){void 0===e&&(e=this.tileZoom);var r=0,n=[t.x,t.y,0,1],i=[t.x,t.y,1,1];h.transformMat4(n,n,this.pixelMatrixInverse),h.transformMat4(i,i,this.pixelMatrixInverse);var a=n[3],u=i[3],l=n[0]/a,c=i[0]/u,p=n[1]/a,f=i[1]/u,d=n[2]/a,m=i[2]/u,y=d===m?0:(r-d)/(m-d);return new o(s(l,c,y)/this.tileSize,s(p,f,y)/this.tileSize,this.zoom)._zoomTo(e)},d.prototype.coordinatePoint=function(t){var e=t.zoomTo(this.zoom),r=[e.column*this.tileSize,e.row*this.tileSize,0,1];return h.transformMat4(r,r,this.pixelMatrix),new i(r[0]/r[3],r[1]/r[3])},d.prototype.calculatePosMatrix=function(t,e){var r=t.toCoordinate(e),n=this.worldSize/this.zoomScale(r.zoom),i=p.identity(new Float64Array(16));return p.translate(i,i,[r.column*n,r.row*n,0]),p.scale(i,i,[n/l,n/l,1]),p.multiply(i,this.projMatrix,i),new Float32Array(i)},d.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,e,r,n,o,a,s,u,l=this.size,c=this._unmodified;this.latRange&&(t=this.latY(this.latRange[1]),e=this.latY(this.latRange[0]),o=e-te&&(u=e-f)}if(this.lngRange){var d=this.x,m=l.x/2;d-mn&&(s=n-m)}void 0===s&&void 0===u||(this.center=this.unproject(new i(void 0!==s?s:this.x,void 0!==u?u:this.y))),this._unmodified=c,this._constraining=!1}},d.prototype._calcMatrices=function(){if(this.height){this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var t=this._fov/2,e=Math.PI/2+this._pitch,r=Math.sin(t)*this.cameraToCenterDistance/Math.sin(Math.PI-e-t),n=Math.cos(Math.PI/2-this._pitch)*r+this.cameraToCenterDistance,i=1.01*n,o=new Float64Array(16);p.perspective(o,this._fov,this.width/this.height,1,i),p.scale(o,o,[1,-1,1]),p.translate(o,o,[0,0,-this.cameraToCenterDistance]),p.rotateX(o,o,this._pitch),p.rotateZ(o,o,this.angle),p.translate(o,o,[-this.x,-this.y,0]);var a=this.worldSize/(2*Math.PI*6378137*Math.abs(Math.cos(this.center.lat*(Math.PI/180))));if(p.scale(o,o,[1,1,a,1]),this.projMatrix=o,o=p.create(),p.scale(o,o,[this.width/2,-this.height/2,1]),p.translate(o,o,[1,-1,0]),this.pixelMatrix=p.multiply(new Float64Array(16),o,this.projMatrix),o=p.invert(new Float64Array(16),this.pixelMatrix),!o)throw new Error("failed to invert matrix");this.pixelMatrixInverse=o}},Object.defineProperties(d.prototype,m),e.exports=d},{"../data/extent":11,"../source/tile_coord":53,"../util/interpolate":121,"../util/util":129,"./coordinate":18,"./lng_lat":19,"@mapbox/gl-matrix":133,"point-geometry":197}],22:[function(t,e,r){"use strict";var n,i=t("./util/worker_pool");e.exports=function(){return n||(n=new i),n}},{"./util/worker_pool":132}],23:[function(t,e,r){"use strict";var n={" ":[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,r,i){i=i||1;var o,a,s,u,l,c,h,p,f=[];for(o=0,a=t.length;o0?1/(1-t):1+t}function s(t){return t>0?1-1/(1.001-t):-t}function u(t,e,r,n){var i=r.paint["raster-fade-duration"];if(t.sourceCache&&i>0){var o=Date.now(),a=(o-t.timeAdded)/i,s=e?(o-e.timeAdded)/i:-1,u=t.sourceCache.getSource(),c=n.coveringZoomLevel({tileSize:u.tileSize,roundZoom:u.roundZoom}),h=!e||Math.abs(e.coord.z-c)>Math.abs(t.coord.z-c),p=l.clamp(h?a:1-s,0,1);return e?{opacity:1,mix:1-p}:{opacity:p,mix:0}}return{opacity:1,mix:0}}var l=t("../util/util");e.exports=n},{"../util/util":129}],33:[function(t,e,r){"use strict";function n(t,e,r,n){if(!t.isOpaquePass){var o=!(r.layout["text-allow-overlap"]||r.layout["icon-allow-overlap"]||r.layout["text-ignore-placement"]||r.layout["icon-ignore-placement"]),a=t.gl;o?a.disable(a.STENCIL_TEST):a.enable(a.STENCIL_TEST),t.setDepthSublayer(0),t.depthMask(!1),i(t,e,r,n,!1,r.paint["icon-translate"],r.paint["icon-translate-anchor"],r.layout["icon-rotation-alignment"],r.layout["icon-rotation-alignment"],r.layout["icon-size"],r.paint["icon-halo-width"],r.paint["icon-halo-color"],r.paint["icon-halo-blur"],r.paint["icon-opacity"],r.paint["icon-color"]),i(t,e,r,n,!0,r.paint["text-translate"],r.paint["text-translate-anchor"],r.layout["text-rotation-alignment"],r.layout["text-pitch-alignment"],r.layout["text-size"],r.paint["text-halo-width"],r.paint["text-halo-color"],r.paint["text-halo-blur"],r.paint["text-opacity"],r.paint["text-color"]),e.map.showCollisionBoxes&&l(t,e,r,n)}}function i(t,e,r,n,i,s,u,l,c,h,p,f,d,m,y){if(i||!t.style.sprite||t.style.sprite.loaded()){var v=t.gl,g="map"===l,_="map"===c,x=_;x?v.enable(v.DEPTH_TEST):v.disable(v.DEPTH_TEST);for(var b,w,E=0,T=n;Ethis.previousZoom;i--)n.changeTimes[i]=t,n.changeOpacities[i]=n.opacities[i];for(i=0;i<256;i++){var o=t-n.changeTimes[i],a=255*(r?o/r:1);i<=e?n.opacities[i]=n.changeOpacities[i]+a:n.opacities[i]=n.changeOpacities[i]-a}this.changed=!0,this.previousZoom=e},n.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))},e.exports=n},{}],35:[function(t,e,r){"use strict";var n=t("../util/util"),i=function(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={}};i.prototype.setSprite=function(t){this.sprite=t},i.prototype.getDash=function(t,e){var r=t.join(",")+e;return this.positions[r]||(this.positions[r]=this.addDash(t,e)),this.positions[r]},i.prototype.addDash=function(t,e){var r=this,i=e?7:0,o=2*i+1,a=128;if(this.nextRow+o>this.height)return n.warnOnce("LineAtlas out of space"),null;for(var s=0,u=0;u0?e.pop():null},v.prototype.getViewportTexture=function(t,e){var r=this.reusableTextures.viewport;if(r)return r.width===t&&r.height===e?r:(this.gl.deleteTexture(r),void(this.reusableTextures.viewport=null))},v.prototype.lineWidth=function(t){this.gl.lineWidth(l.clamp(t,this.lineWidthRange[0],this.lineWidthRange[1]))},v.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 r=8,n=1/r;e.blendColor(n,n,n,0),e.clearColor(0,0,0,1),e.clear(e.COLOR_BUFFER_BIT)}else e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA)}},v.prototype.createProgram=function(t,e){var r=this.gl,i=r.createProgram(),o=m[t],a="#define MAPBOX_GL_JS\n#define DEVICE_PIXEL_RATIO "+n.devicePixelRatio.toFixed(1)+"\n";this._showOverdrawInspector&&(a+="#define OVERDRAW_INSPECTOR;\n");var s=r.createShader(r.FRAGMENT_SHADER);r.shaderSource(s,e.applyPragmas(a+m.prelude.fragmentSource+o.fragmentSource,"fragment")),r.compileShader(s),r.attachShader(i,s);var u=r.createShader(r.VERTEX_SHADER);r.shaderSource(u,e.applyPragmas(a+m.prelude.vertexSource+o.vertexSource,"vertex")),r.compileShader(u),r.attachShader(i,u),r.linkProgram(i);for(var l=r.getProgramParameter(i,r.ACTIVE_ATTRIBUTES),c={program:i,numAttributes:l},h=0;h>16,u>>16),i.uniform2f(r.u_pixel_coord_lower,65535&s,65535&u)}},{"../source/pixels_to_tile_units":46}],38:[function(t,e,r){"use strict";t("path");e.exports={prelude:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif\n\nfloat 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\n// The offset depends on how many pixels are between the world origin and 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 and the edge of the tile.\n// The glsl spec only guarantees 16 bits of 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:\nvec2 get_pattern_pos(const vec2 pixel_coord_upper, const vec2 pixel_coord_lower,\n const vec2 pattern_size, const float tile_units_to_pixels, const vec2 pos) {\n\n vec2 offset = mod(mod(mod(pixel_coord_upper, pattern_size) * 256.0, pattern_size) * 256.0 + pixel_coord_lower, pattern_size);\n return (tile_units_to_pixels * pos + offset) / pattern_size;\n}\n"},circle:{fragmentSource:"#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\n\nvarying vec2 v_extrude;\nvarying lowp float v_antialiasblur;\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize mediump float radius\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize lowp vec4 stroke_color\n #pragma mapbox: initialize mediump float stroke_width\n #pragma mapbox: initialize lowp float stroke_opacity\n\n float extrude_length = length(v_extrude);\n float antialiased_blur = -max(blur, v_antialiasblur);\n\n float opacity_t = smoothstep(0.0, antialiased_blur, extrude_length - 1.0);\n\n float color_t = stroke_width < 0.01 ? 0.0 : smoothstep(\n antialiased_blur,\n 0.0,\n extrude_length - radius / (radius + stroke_width)\n );\n\n gl_FragColor = opacity_t * mix(color * opacity, stroke_color * stroke_opacity, color_t);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform bool u_scale_with_map;\nuniform vec2 u_extrude_scale;\n\nattribute vec2 a_pos;\n\n#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\n\nvarying vec2 v_extrude;\nvarying lowp float v_antialiasblur;\n\nvoid main(void) {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize mediump float radius\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize lowp vec4 stroke_color\n #pragma mapbox: initialize mediump float stroke_width\n #pragma mapbox: initialize lowp float stroke_opacity\n\n // unencode the extrusion vector that we snuck into the a_pos vector\n v_extrude = vec2(mod(a_pos, 2.0) * 2.0 - 1.0);\n\n vec2 extrude = v_extrude * (radius + stroke_width) * u_extrude_scale;\n // multiply a_pos by 0.5, since we had it * 2 in order to sneak\n // in extrusion data\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5), 0, 1);\n\n if (u_scale_with_map) {\n gl_Position.xy += extrude;\n } else {\n gl_Position.xy += extrude * gl_Position.w;\n }\n\n // This is a minimum blur distance that serves as a faux-antialiasing for\n // the circle. since blur is a ratio of the circle's size and the intent is\n // to keep the blur at roughly 1px, the two are inversely related.\n v_antialiasblur = 1.0 / DEVICE_PIXEL_RATIO / (radius + stroke_width);\n}\n"},collisionBox:{fragmentSource:"uniform 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:"attribute 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"},debug:{fragmentSource:"uniform lowp vec4 u_color;\n\nvoid main() {\n gl_FragColor = u_color;\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, step(32767.0, a_pos.x), 1);\n}\n"},fill:{fragmentSource:"#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize lowp float opacity\n\n gl_FragColor = color * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\n#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n"},fillOutline:{fragmentSource:"#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:"attribute 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"},fillOutlinePattern:{fragmentSource:"uniform 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\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\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 // 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 * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_world;\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;\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, a_pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, a_pos);\n\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},fillPattern:{fragmentSource:"uniform 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\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\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) * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform 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\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, a_pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, a_pos);\n}\n"},fillExtrusion:{fragmentSource:"varying vec4 v_color;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 color\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n #pragma mapbox: initialize lowp vec4 color\n\n gl_FragColor = v_color;\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec3 u_lightcolor;\nuniform lowp vec3 u_lightpos;\nuniform lowp float u_lightintensity;\nuniform lowp vec4 u_outline_color;\n\nattribute vec2 a_pos;\nattribute vec3 a_normal;\nattribute float a_edgedistance;\n\nvarying vec4 v_color;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\n#pragma mapbox: define lowp vec4 color\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n #pragma mapbox: initialize lowp vec4 color\n\n float ed = a_edgedistance; // use each attrib in order to not trip a VAO assert\n float t = mod(a_normal.x, 2.0);\n\n gl_Position = u_matrix * vec4(a_pos, t > 0.0 ? height : base, 1);\n\n#ifdef OUTLINE\n color = u_outline_color;\n#endif\n\n // Relative luminance (how dark/bright is the surface color?)\n float colorvalue = color.r * 0.2126 + color.g * 0.7152 + color.b * 0.0722;\n\n v_color = vec4(0.0, 0.0, 0.0, 1.0);\n\n // Add slight ambient lighting so no extrusions are totally black\n vec4 ambientlight = vec4(0.03, 0.03, 0.03, 1.0);\n color += ambientlight;\n\n // Calculate cos(theta), where theta is the angle between surface normal and diffuse light ray\n float directional = clamp(dot(a_normal / 16384.0, u_lightpos), 0.0, 1.0);\n\n // Adjust directional so that\n // the range of values for highlight/shading is narrower\n // with lower light intensity\n // and with lighter/brighter surface colors\n directional = mix((1.0 - u_lightintensity), max((1.0 - colorvalue + u_lightintensity), 1.0), directional);\n\n // Add gradient along z axis of side surfaces\n if (a_normal.y != 0.0) {\n directional *= clamp((t + base) * pow(height / 150.0, 0.5), mix(0.7, 0.98, 1.0 - u_lightintensity), 1.0);\n }\n\n // Assign final color based on surface + ambient light color, diffuse light directional, and light color\n // with lower bounds adjusted to hue of light\n // so that shading is tinted with the complementary (opposite) color to the light color\n v_color.r += clamp(color.r * directional * u_lightcolor.r, mix(0.0, 0.3, 1.0 - u_lightcolor.r), 1.0);\n v_color.g += clamp(color.g * directional * u_lightcolor.g, mix(0.0, 0.3, 1.0 - u_lightcolor.g), 1.0);\n v_color.b += clamp(color.b * directional * u_lightcolor.b, mix(0.0, 0.3, 1.0 - u_lightcolor.b), 1.0);\n}\n"},fillExtrusionPattern:{fragmentSource:"uniform 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 vec4 v_lighting;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\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 vec4 mixedColor = mix(color1, color2, u_mix);\n\n gl_FragColor = mixedColor * v_lighting;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform 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;\nuniform float u_height_factor;\n\nuniform vec3 u_lightcolor;\nuniform lowp vec3 u_lightpos;\nuniform lowp float u_lightintensity;\n\nattribute vec2 a_pos;\nattribute vec3 a_normal;\nattribute float a_edgedistance;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec4 v_lighting;\nvarying float v_directional;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n\n float t = mod(a_normal.x, 2.0);\n float z = t > 0.0 ? height : base;\n\n gl_Position = u_matrix * vec4(a_pos, z, 1);\n\n vec2 pos = a_normal.x == 1.0 && a_normal.y == 0.0 && a_normal.z == 16384.0\n ? a_pos // extrusion top\n : vec2(a_edgedistance, z * u_height_factor); // extrusion side\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, pos);\n\n v_lighting = vec4(0.0, 0.0, 0.0, 1.0);\n float directional = clamp(dot(a_normal / 16383.0, u_lightpos), 0.0, 1.0);\n directional = mix((1.0 - u_lightintensity), max((0.5 + u_lightintensity), 1.0), directional);\n\n if (a_normal.y != 0.0) {\n directional *= clamp((t + base) * pow(height / 150.0, 0.5), mix(0.7, 0.98, 1.0 - u_lightintensity), 1.0);\n }\n\n v_lighting.rgb += clamp(directional * u_lightcolor, mix(vec3(0.0), vec3(0.3), 1.0 - u_lightcolor), vec3(1.0));\n}\n"},extrusionTexture:{fragmentSource:"uniform sampler2D u_texture;\nuniform float u_opacity;\n\nvarying vec2 v_pos;\n\nvoid main() {\n gl_FragColor = texture2D(u_texture, v_pos) * u_opacity;\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform int u_xdim;\nuniform int u_ydim;\nattribute vec2 a_pos;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n v_pos.x = a_pos.x / float(u_xdim);\n v_pos.y = 1.0 - a_pos.y / float(u_ydim);\n}\n"},line:{fragmentSource:"#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_width2;\nvarying vec2 v_normal;\nvarying float v_gamma_scale;\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\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\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform mediump float u_width;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump float gapwidth\n #pragma mapbox: initialize lowp float offset\n\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\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\n // these transformations used to be applied in the JS and native code bases. \n // moved them into the shader for clarity and simplicity. \n gapwidth = gapwidth / 2.0;\n float width = u_width / 2.0;\n offset = -1.0 * offset; \n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + width * (gapwidth > 0.0 ? 2.0 : 1.0) + 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 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit to get the position\n vec2 pos = floor(a_pos * 0.5);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_width2 = vec2(outset, inset);\n}\n"},linePattern:{fragmentSource:"uniform 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;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 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_width2.s / u_pattern_size_a.y);\n float y_b = 0.5 + (v_normal.y * v_width2.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 gl_FragColor = color * alpha * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"// 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\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 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_width;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n\nvoid main() {\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize lowp float offset\n #pragma mapbox: initialize mediump float gapwidth\n\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 // these transformations used to be applied in the JS and native code bases. \n // moved them into the shader for clarity and simplicity. \n gapwidth = gapwidth / 2.0;\n float width = u_width / 2.0;\n offset = -1.0 * offset; \n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + width * (gapwidth > 0.0 ? 2.0 : 1.0) + 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 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit to get the position\n vec2 pos = floor(a_pos * 0.5);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_linesofar = a_linesofar;\n v_width2 = vec2(outset, inset);\n}\n"},lineSDF:{fragmentSource:"\nuniform sampler2D u_image;\nuniform float u_sdfgamma;\nuniform float u_mix;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 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 = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n", +vertexSource:"// 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\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_patternscale_a;\nuniform float u_tex_y_a;\nuniform vec2 u_patternscale_b;\nuniform float u_tex_y_b;\nuniform vec2 u_gl_units_to_pixels;\nuniform mediump float u_width;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump float gapwidth\n #pragma mapbox: initialize lowp float offset\n\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 // these transformations used to be applied in the JS and native code bases. \n // moved them into the shader for clarity and simplicity. \n gapwidth = gapwidth / 2.0;\n float width = u_width / 2.0;\n offset = -1.0 * offset;\n \n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + width * (gapwidth > 0.0 ? 2.0 : 1.0) + 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 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit to get the position\n vec2 pos = floor(a_pos * 0.5);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\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 v_width2 = vec2(outset, inset);\n}\n"},raster:{fragmentSource:"uniform float u_fade_t;\nuniform float u_opacity;\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 = mix(color0, color1, u_fade_t);\n color.a *= u_opacity;\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, color.a);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform 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"},symbolIcon:{fragmentSource:"uniform 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:"attribute 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"},symbolSDF:{fragmentSource:"uniform 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:"const 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;\n\n v_tex = a_tex / u_texsize;\n v_fade_tex = vec2(a_labelminzoom / 255.0, 0.0);\n}\n"}}},{path:194}],39:[function(t,e,r){"use strict";var n=function(){this.boundProgram=null,this.boundVertexBuffer=null,this.boundVertexBuffer2=null,this.boundElementBuffer=null,this.boundVertexOffset=null,this.vao=null};n.prototype.bind=function(t,e,r,n,i,o){void 0===t.extVertexArrayObject&&(t.extVertexArrayObject=t.getExtension("OES_vertex_array_object"));var a=!this.vao||this.boundProgram!==e||this.boundVertexBuffer!==r||this.boundVertexBuffer2!==i||this.boundElementBuffer!==n||this.boundVertexOffset!==o;!t.extVertexArrayObject||a?(this.freshBind(t,e,r,n,i,o),this.gl=t):t.extVertexArrayObject.bindVertexArrayOES(this.vao)},n.prototype.freshBind=function(t,e,r,n,i,o){var a,s=e.numAttributes;if(t.extVertexArrayObject)this.vao&&this.destroy(),this.vao=t.extVertexArrayObject.createVertexArrayOES(),t.extVertexArrayObject.bindVertexArrayOES(this.vao),a=0,this.boundProgram=e,this.boundVertexBuffer=r,this.boundVertexBuffer2=i,this.boundElementBuffer=n,this.boundVertexOffset=o;else{a=t.currentNumAttributes||0;for(var u=s;uthis.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,i={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("loadTile",i,function(n,i){if(t.unloadVectorData(),!t.aborted)return n?e(n):(t.loadVectorData(i,r.map.painter),t.redoWhenDone&&(t.redoWhenDone=!1,t.redoPlacement(r)),e(null))},this.workerID)},e.prototype.abortTile=function(t){t.aborted=!0},e.prototype.unloadTile=function(t){t.unloadVectorData(),this.dispatcher.send("removeTile",{uid:t.uid,type:this.type,source:this.id},function(){},t.workerID)},e.prototype.onRemove=function(){this.dispatcher.broadcast("removeSource",{type:this.type,source:this.id},function(){})},e.prototype.serialize=function(){return{type:this.type,data:this._data}},e}(i);e.exports=u},{"../data/extent":11,"../util/evented":118,"../util/util":129,"../util/window":112}],42:[function(t,e,r){"use strict";var n=t("../util/ajax"),i=t("geojson-rewind"),o=t("./geojson_wrapper"),a=t("vt-pbf"),s=t("supercluster"),u=t("geojson-vt"),l=t("./vector_tile_worker_source"),c=function(t){function e(e,r,n){t.call(this,e,r),n&&(this.loadGeoJSON=n),this._geoJSONIndexes={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.loadVectorData=function(t,e){var r=t.source,n=t.coord;if(!this._geoJSONIndexes[r])return e(null,null);var i=this._geoJSONIndexes[r].getTile(Math.min(n.z,t.maxZoom),n.x,n.y);if(!i)return e(null,null);var s=new o(i.features);s.name="_geojsonTileLayer";var u=a({layers:{_geojsonTileLayer:s}});0===u.byteOffset&&u.byteLength===u.buffer.byteLength||(u=new Uint8Array(u)),s.rawData=u.buffer,e(null,s)},e.prototype.loadData=function(t,e){var r=function(r,n){var o=this;return r?e(r):"object"!=typeof n?e(new Error("Input data is not a valid GeoJSON object.")):(i(n,!0),void this._indexData(n,t,function(r,n){return r?e(r):(o._geoJSONIndexes[t.source]=n,void e(null))}))}.bind(this);this.loadGeoJSON(t,r)},e.prototype.loadGeoJSON=function(t,e){if(t.url)n.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."))}}},e.prototype.removeSource=function(t){this._geoJSONIndexes[t.source]&&delete this._geoJSONIndexes[t.source]},e.prototype._indexData=function(t,e,r){try{e.cluster?r(null,s(e.superclusterOptions).load(t.features)):r(null,u(t,e.geojsonVtOptions))}catch(t){return r(t)}},e}(l);e.exports=c},{"../util/ajax":109,"./geojson_wrapper":43,"./vector_tile_worker_source":55,"geojson-rewind":140,"geojson-vt":144,supercluster:201,"vt-pbf":210}],43:[function(t,e,r){"use strict";var n=t("point-geometry"),i=t("vector-tile").VectorTileFeature,o=t("../data/extent"),a=function(t){var e=this;if(this.type=t.type,1===t.type){this.rawGeometry=[];for(var r=0;re)){var s=Math.pow(2,Math.min(a.coord.z,n._source.maxzoom)-Math.min(t.z,n._source.maxzoom));if(Math.floor(a.coord.x/s)===t.x&&Math.floor(a.coord.y/s)===t.y)for(r[o]=!0,i=!0;a&&a.coord.z-1>t.z;){var u=a.coord.parent(n._source.maxzoom).id;a=n._tiles[u],a&&a.hasData()&&(delete r[o],r[u]=!0)}}}return i},e.prototype.findLoadedParent=function(t,e,r){for(var n=this,i=t.z-1;i>=e;i--){t=t.parent(n._source.maxzoom);var o=n._tiles[t.id];if(o&&o.hasData())return r[t.id]=!0,o;if(n._cache.has(t.id))return r[t.id]=!0, +n._cache.get(t.id)}},e.prototype.updateCacheSize=function(t){var e=Math.ceil(t.width/t.tileSize)+1,r=Math.ceil(t.height/t.tileSize)+1,n=e*r,i=5;this._cache.setMaxSize(Math.floor(n*i))},e.prototype.update=function(t){var r=this;if(this._sourceLoaded){var n,i,a,s;this.updateCacheSize(t);var u=(this._source.roundZoom?Math.round:Math.floor)(this.getZoom(t)),c=Math.max(u-e.maxOverzooming,this._source.minzoom),h=Math.max(u+e.maxUnderzooming,this._source.minzoom),f={};this._coveredTiles={};var d;for(d=this.used?this._source.coord?[this._source.coord]:t.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}):[],n=0;n=Date.now())&&(r.findLoadedChildren(i,h,f)&&(f[g]=!0),s=r.findLoadedParent(i,c,m),s&&r.addTile(s.coord))}var _;for(_ in m)f[_]||(r._coveredTiles[_]=!0);for(_ in m)f[_]=!0;var x=p.keysDifference(this._tiles,f);for(n=0;nthis._source.maxzoom?Math.pow(2,n-this._source.maxzoom):1;e=new s(r,this._source.tileSize*i,this._source.maxzoom),this.loadTile(e,this._tileLoaded.bind(this,e,t.id))}return e.uses++,this._tiles[t.id]=e,this._source.fire("dataloading",{tile:e,coord:e.coord,dataType:"tile"}),e},e.prototype._setTileReloadTimer=function(t,e){var r=this,n=e.getExpiry();n&&(this._timers[t]=setTimeout(function(){r.reloadTile(t,"expired"),r._timers[t]=void 0},n-(new Date).getTime()))},e.prototype._setCacheInvalidationTimer=function(t,e){var r=this,n=e.getExpiry();n&&(this._cacheTimers[t]=setTimeout(function(){r._cache.remove(t),r._cacheTimers[t]=void 0},n-(new Date).getTime()))},e.prototype.removeTile=function(t){var e=this._tiles[t];if(e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),this._timers[t]=void 0),this._source.fire("data",{tile:e,coord:e.coord,dataType:"tile"}),!(e.uses>0)))if(e.hasData()){var r=e.coord.wrapped().id;this._cache.add(r,e),this._setCacheInvalidationTimer(r,e)}else e.aborted=!0,this.abortTile(e),this.unloadTile(e)},e.prototype.clearTiles=function(){var t=this;for(var e in this._tiles)t.removeTile(e);this._cache.reset()},e.prototype.tilesIn=function(t){for(var e=this,r={},i=this.getIds(),o=1/0,a=1/0,s=-(1/0),u=-(1/0),c=t[0].zoom,p=0;p=0&&g[1].y>=0){for(var _=[],x=0;xe.row){var r=t;t=e,e=r}return{x0:t.column,y0:t.row,x1:e.column,y1:e.row,dx:e.column-t.column,dy:e.row-t.row}}function i(t,e,r,n,i){var o=Math.max(r,Math.floor(e.y0)),a=Math.min(n,Math.ceil(e.y1));if(t.x0===e.x0&&t.y0===e.y0?t.x0+e.dy/t.dy*t.dx0,h=e.dx<0,p=o;pc.dy&&(u=l,l=c,c=u),l.dy>h.dy&&(u=l,l=h,h=u),c.dy>h.dy&&(u=c,c=h,h=u),l.dy&&i(h,l,o,a,s),c.dy&&i(h,c,o,a,s)}function a(t,e,r){for(var n,i="",o=t;o>0;o--)n=1<t?new l(this.z-1,this.x,this.y,this.w):new l(this.z-1,Math.floor(this.x/2),Math.floor(this.y/2),this.w)},l.prototype.wrapped=function(){return new l(this.z,this.x,this.y,0)},l.prototype.children=function(t){if(this.z>=t)return[new l(this.z+1,this.x,this.y,this.w)];var e=this.z+1,r=2*this.x,n=2*this.y;return[new l(e,r,n,this.w),new l(e,r+1,n,this.w),new l(e,r,n+1,this.w),new l(e,r+1,n+1,this.w)]},l.cover=function(t,e,r,n){function i(t,e,i){var o,u,c,h;if(i>=0&&i<=a)for(o=t;othis.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,i={url:a(t.coord.url(this.tiles,this.maxzoom,this.scheme),this.url),uid:t.uid,coord:t.coord,zoom:t.coord.z,tileSize:this.tileSize*n,type:this.type,source:this.id,overscaling:n,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID&&"expired"!==t.state?"loading"===t.state?t.reloadCallback=e:this.dispatcher.send("reloadTile",i,r.bind(this),t.workerID):t.workerID=this.dispatcher.send("loadTile",i,r.bind(this))},e.prototype.abortTile=function(t){this.dispatcher.send("abortTile",{uid:t.uid,type:this.type,source:this.id},null,t.workerID)},e.prototype.unloadTile=function(t){t.unloadVectorData(),this.dispatcher.send("removeTile",{uid:t.uid,type:this.type,source:this.id},null,t.workerID)},e}(n);e.exports=s},{"../util/evented":118,"../util/mapbox":125,"../util/util":129,"./load_tilejson":45}],55:[function(t,e,r){"use strict";var n=t("../util/ajax"),i=t("vector-tile"),o=t("pbf"),a=t("./worker_tile"),s=t("../util/util"),u=function(t,e,r){this.actor=t,this.layerIndex=e,r&&(this.loadVectorData=r),this.loading={},this.loaded={}};u.prototype.loadTile=function(t,e){function r(t,r){return delete this.loading[n][i],t?e(t):r?(o.vectorTile=r,o.parse(r,this.layerIndex,this.actor,function(t,n,i){if(t)return e(t);var o={};r.expires&&(o.expires=r.expires),r.cacheControl&&(o.cacheControl=r.cacheControl),e(null,s.extend({rawTileData:r.rawData},n,o),i)}),this.loaded[n]=this.loaded[n]||{},void(this.loaded[n][i]=o)):e(null,null)}var n=t.source,i=t.uid;this.loading[n]||(this.loading[n]={});var o=this.loading[n][i]=new a(t);o.abort=this.loadVectorData(t,r.bind(this))},u.prototype.reloadTile=function(t,e){function r(t,r){if(this.reloadCallback){var n=this.reloadCallback;delete this.reloadCallback,this.parse(this.vectorTile,o.layerIndex,o.actor,n)}e(t,r)}var n=this.loaded[t.source],i=t.uid,o=this;if(n&&n[i]){var a=n[i];"parsing"===a.status?a.reloadCallback=e:"done"===a.status&&a.parse(a.vectorTile,this.layerIndex,this.actor,r.bind(a))}},u.prototype.abortTile=function(t){var e=this.loading[t.source],r=t.uid;e&&e[r]&&e[r].abort&&(e[r].abort(),delete e[r])},u.prototype.removeTile=function(t){var e=this.loaded[t.source],r=t.uid;e&&e[r]&&delete e[r]},u.prototype.loadVectorData=function(t,e){function r(t,r){if(t)return e(t);var n=new i.VectorTile(new o(r.data));n.rawData=r.data,n.cacheControl=r.cacheControl,n.expires=r.expires,e(t,n)}var a=n.getArrayBuffer(t.url,r.bind(this));return function(){a.abort()}},u.prototype.redoPlacement=function(t,e){var r=this.loaded[t.source],n=this.loading[t.source],i=t.uid;if(r&&r[i]){var o=r[i],a=o.redoPlacement(t.angle,t.pitch,t.showCollisionBoxes);a.result&&e(null,a.result,a.transferables)}else n&&n[i]&&(n[i].angle=t.angle)},e.exports=u},{"../util/ajax":109,"../util/util":129,"./worker_tile":58,pbf:196,"vector-tile":206}],56:[function(t,e,r){"use strict";var n=t("../util/ajax"),i=t("./image_source"),o=function(t){function e(e,r,n,i){t.call(this,e,r,n,i),this.roundZoom=!0,this.type="video",this.options=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(){var t=this,e=this.options;this.urls=e.urls,n.getVideo(e.urls,function(e,r){if(e)return t.fire("error",{error:e});t.video=r,t.video.loop=!0;var n;t.video.addEventListener("playing",function(){n=t.map.style.animationLoop.set(1/0),t.map._rerender()}),t.video.addEventListener("pause",function(){t.map.style.animationLoop.cancel(n)}),t.map&&t.video.play(),t._finishLoading()})},e.prototype.getVideo=function(){return this.video},e.prototype.onAdd=function(t){this.map||(this.load(),this.map=t,this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},e.prototype.prepare=function(){!this.tile||this.video.readyState<2||this._prepareImage(this.map.painter.gl,this.video)},e.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},e}(i);e.exports=o},{"../util/ajax":109,"./image_source":44}],57:[function(t,e,r){"use strict";var n=t("../util/actor"),i=t("../style/style_layer_index"),o=t("./vector_tile_worker_source"),a=t("./geojson_worker_source"),s=t("./rtl_text_plugin"),u=function(t){var e=this;this.self=t,this.actor=new n(t,this),this.layerIndexes={},this.workerSourceTypes={vector:o,geojson:a},this.workerSources={},this.self.registerWorkerSource=function(t,r){if(e.workerSourceTypes[t])throw new Error('Worker source with name "'+t+'" already registered.');e.workerSourceTypes[t]=r},this.self.registerRTLTextPlugin=function(t){if(s.applyArabicShaping||s.processBidirectionalText)throw new Error("RTL text plugin already registered.");s.applyArabicShaping=t.applyArabicShaping,s.processBidirectionalText=t.processBidirectionalText}};u.prototype.setLayers=function(t,e){this.getLayerIndex(t).replace(e)},u.prototype.updateLayers=function(t,e){this.getLayerIndex(t).update(e.layers,e.removedIds,e.symbolOrder)},u.prototype.loadTile=function(t,e,r){this.getWorkerSource(t,e.type).loadTile(e,r)},u.prototype.reloadTile=function(t,e,r){this.getWorkerSource(t,e.type).reloadTile(e,r)},u.prototype.abortTile=function(t,e){this.getWorkerSource(t,e.type).abortTile(e)},u.prototype.removeTile=function(t,e){this.getWorkerSource(t,e.type).removeTile(e)},u.prototype.removeSource=function(t,e){var r=this.getWorkerSource(t,e.type);void 0!==r.removeSource&&r.removeSource(e)},u.prototype.redoPlacement=function(t,e,r){this.getWorkerSource(t,e.type).redoPlacement(e,r)},u.prototype.loadWorkerSource=function(t,e,r){try{this.self.importScripts(e.url),r()}catch(t){r(t)}},u.prototype.loadRTLTextPlugin=function(t,e,r){try{s.applyArabicShaping||s.processBidirectionalText||this.self.importScripts(e)}catch(t){r(t)}},u.prototype.getLayerIndex=function(t){var e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new i),e},u.prototype.getWorkerSource=function(t,e){var r=this;if(this.workerSources[t]||(this.workerSources[t]={}),!this.workerSources[t][e]){var n={send:function(e,n,i,o){r.actor.send(e,n,i,o,t)}};this.workerSources[t][e]=new this.workerSourceTypes[e](n,this.getLayerIndex(t))}return this.workerSources[t][e]},e.exports=function(t){return new u(t)}},{"../style/style_layer_index":71,"../util/actor":108,"./geojson_worker_source":42,"./rtl_text_plugin":49,"./vector_tile_worker_source":55}],58:[function(t,e,r){"use strict";function n(t,e){for(var r=0,n=t.layers;r=P.maxzoom||P.layout&&"none"===P.layout.visibility)){for(var L=0,C=M;L=0;D--){var O=y[e.symbolOrder[D]];O&&f.symbolBuckets.push(O)}if(0===this.symbolBuckets.length)return R(new a(this.angle,this.pitch,this.collisionBoxArray));var B=0,j=Object.keys(g.iconDependencies),F=l.mapObject(g.glyphDependencies,function(t){return Object.keys(t).map(Number)}),U=function(t){if(t)return p(t);if(B++,2===B){for(var e=new a(f.angle,f.pitch,f.collisionBoxArray),r=0,i=f.symbolBuckets;r=(new Date).getTime()}),!this.times.length},n.prototype.set=function(t){return this.times.push({id:this.n,time:t+(new Date).getTime()}),this.n++},n.prototype.cancel=function(t){this.times=this.times.filter(function(e){return e.id!==t})},e.exports=n},{}],60:[function(t,e,r){"use strict";var n=t("../util/evented"),i=t("../util/ajax"),o=t("../util/browser"),a=t("../util/mapbox").normalizeSpriteURL,s=function(){this.x=0,this.y=0,this.width=0,this.height=0,this.pixelRatio=1,this.sdf=!1},u=function(t){function e(e,r){var n=this;t.call(this),this.base=e,this.retina=o.devicePixelRatio>1,this.setEventedParent(r);var s=this.retina?"@2x":"";i.getJSON(a(e,s,".json"),function(t,e){return t?void n.fire("error",{error:t}):(n.data=e,void(n.imgData&&n.fire("data",{dataType:"style"})))}),i.getImage(a(e,s,".png"),function(t,e){if(t)return void n.fire("error",{error:t});n.imgData=o.getImageData(e);for(var r=0;r1!==this.retina){var r=new e(this.base);r.on("data",function(){t.data=r.data,t.imgData=r.imgData,t.width=r.width,t.retina=r.retina})}},e.prototype.getSpritePosition=function(t){if(!this.loaded())return new s;var e=this.data&&this.data[t];return e&&this.imgData?e:new s},e}(n);e.exports=u},{"../util/ajax":109,"../util/browser":110,"../util/evented":118,"../util/mapbox":125}],61:[function(t,e,r){"use strict";var n=t("./style_spec"),i=t("../util/util"),o=t("../util/evented"),a=t("./validate_style"),s=t("./style_declaration"),u=t("./style_transition"),l="-transition",c=function(t){function e(e){t.call(this),this.properties=["anchor","color","position","intensity"],this._specifications=n.light,this.set(e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){var e=this;if(!this._validate(a.light,t)){this._declarations={},this._transitions={},this._transitionOptions={},this.calculated={},t=i.extend({anchor:this._specifications.anchor.default,color:this._specifications.color.default,position:this._specifications.position.default,intensity:this._specifications.intensity.default},t);for(var r=0,n=this.properties;rMath.floor(t)&&(e.lastIntegerZoom=Math.floor(t+1),e.lastIntegerZoomTime=Date.now()),e.lastZoom=t},e.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},e.prototype.update=function(t,e){var r=this;if(this._changed){var n=Object.keys(this._updatedLayers),i=Object.keys(this._removedLayers);(n.length||i.length||this._updatedSymbolOrder)&&this._updateWorkerLayers(n,i);for(var o in this._updatedSources){var a=r._updatedSources[o];"reload"===a?r._reloadSource(o):"clear"===a&&r._clearSource(o)}this._applyClasses(t,e),this._resetUpdates(),this.fire("data",{dataType:"style"})}},e.prototype._updateWorkerLayers=function(t,e){var r=this,n=this._updatedSymbolOrder?this._order.filter(function(t){return"symbol"===r._layers[t].type}):null;this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(t),removedIds:e,symbolOrder:n})},e.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSymbolOrder=!1,this._updatedSources={},this._updatedPaintProps={}, +this._updatedAllPaintProps=!1},e.prototype.setState=function(t){var e=this;if(this._checkLoaded(),y.emitErrors(this,y(t)))return!1;t=c.extend({},t),t.layers=E(t.layers);var r=T(this.serialize(),t).filter(function(t){return!(t.command in A)});if(0===r.length)return!1;var n=r.filter(function(t){return!(t.command in z)});if(n.length>0)throw new Error("Unimplemented: "+n.map(function(t){return t.command}).join(", ")+".");return r.forEach(function(t){"setTransition"!==t.command&&e[t.command].apply(e,t.args)}),this.stylesheet=t,!0},e.prototype.addSource=function(t,e,r){if(this._checkLoaded(),void 0!==this.sourceCaches[t])throw new Error("There is already a source with this ID");if(!e.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(e)+".");var n=["vector","raster","geojson","video","image","canvas"],i=n.indexOf(e.type)>=0;if(!i||!this._validate(y.source,"sources."+t,e,null,r)){var o=this.sourceCaches[t]=new _(t,e,this.dispatcher);o.style=this,o.setEventedParent(this,function(){return{isSourceLoaded:o.loaded(),source:o.serialize(),sourceId:t}}),o.onAdd(this.map),this._changed=!0}},e.prototype.removeSource=function(t){if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error("There is no source with this ID");var e=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],e.setEventedParent(null),e.clearTiles(),e.onRemove&&e.onRemove(this.map),this._changed=!0},e.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},e.prototype.addLayer=function(t,e,r){this._checkLoaded();var n=t.id;if("object"==typeof t.source&&(this.addSource(n,t.source),t=c.extend(t,{source:n})),!this._validate(y.layer,"layers."+n,t,{arrayIndex:-1},r)){var o=i.create(t);this._validateLayer(o),o.setEventedParent(this,{layer:{id:n}});var a=e?this._order.indexOf(e):this._order.length;if(this._order.splice(a,0,n),this._layers[n]=o,this._removedLayers[n]&&o.source){var s=this._removedLayers[n];delete this._removedLayers[n],this._updatedSources[o.source]=s.type!==o.type?"clear":"reload"}this._updateLayer(o),"symbol"===o.type&&(this._updatedSymbolOrder=!0),this.updateClasses(n)}},e.prototype.moveLayer=function(t,e){this._checkLoaded(),this._changed=!0;var r=this._layers[t];if(!r)return void this.fire("error",{error:new Error("The layer '"+t+"' does not exist in the map's style and cannot be moved.")});var n=this._order.indexOf(t);this._order.splice(n,1);var i=e?this._order.indexOf(e):this._order.length;this._order.splice(i,0,t),"symbol"===r.type&&(this._updatedSymbolOrder=!0,r.source&&!this._updatedSources[r.source]&&(this._updatedSources[r.source]="reload"))},e.prototype.removeLayer=function(t){this._checkLoaded();var e=this._layers[t];if(!e)return void this.fire("error",{error:new Error("The layer '"+t+"' does not exist in the map's style and cannot be removed.")});e.setEventedParent(null);var r=this._order.indexOf(t);this._order.splice(r,1),"symbol"===e.type&&(this._updatedSymbolOrder=!0),this._changed=!0,this._removedLayers[t]=e,delete this._layers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t]},e.prototype.getLayer=function(t){return this._layers[t]},e.prototype.setLayerZoomRange=function(t,e,r){this._checkLoaded();var n=this.getLayer(t);return n?void(n.minzoom===e&&n.maxzoom===r||(null!=e&&(n.minzoom=e),null!=r&&(n.maxzoom=r),this._updateLayer(n))):void this.fire("error",{error:new Error("The layer '"+t+"' does not exist in the map's style and cannot have zoom extent.")})},e.prototype.setFilter=function(t,e){this._checkLoaded();var r=this.getLayer(t);return r?void(null!==e&&void 0!==e&&this._validate(y.filter,"layers."+r.id+".filter",e)||c.deepEqual(r.filter,e)||(r.filter=c.clone(e),this._updateLayer(r))):void this.fire("error",{error:new Error("The layer '"+t+"' does not exist in the map's style and cannot be filtered.")})},e.prototype.getFilter=function(t){return c.clone(this.getLayer(t).filter)},e.prototype.setLayoutProperty=function(t,e,r){this._checkLoaded();var n=this.getLayer(t);return n?void(c.deepEqual(n.getLayoutProperty(e),r)||(n.setLayoutProperty(e,r),this._updateLayer(n))):void this.fire("error",{error:new Error("The layer '"+t+"' does not exist in the map's style and cannot be styled.")})},e.prototype.getLayoutProperty=function(t,e){return this.getLayer(t).getLayoutProperty(e)},e.prototype.setPaintProperty=function(t,e,r,n){this._checkLoaded();var i=this.getLayer(t);if(!i)return void this.fire("error",{error:new Error("The layer '"+t+"' does not exist in the map's style and cannot be styled.")});if(!c.deepEqual(i.getPaintProperty(e,n),r)){var o=i.isPaintValueFeatureConstant(e);i.setPaintProperty(e,r,n);var a=!(r&&b.isFunctionDefinition(r)&&"$zoom"!==r.property&&void 0!==r.property);a&&o||this._updateLayer(i),this.updateClasses(t,e)}},e.prototype.getPaintProperty=function(t,e,r){return this.getLayer(t).getPaintProperty(e,r)},e.prototype.getTransition=function(){return c.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},e.prototype.updateClasses=function(t,e){if(this._changed=!0,t){var r=this._updatedPaintProps;r[t]||(r[t]={}),r[t][e||"all"]=!0}else this._updatedAllPaintProps=!0},e.prototype.serialize=function(){var t=this;return c.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,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.sourceCaches,function(t){return t.serialize()}),layers:this._order.map(function(e){return t._layers[e].serialize()})},function(t){return void 0!==t})},e.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&(this._updatedSources[t.source]="reload"),this._changed=!0},e.prototype._flattenRenderedFeatures=function(t){for(var e=this,r=[],n=this._order.length-1;n>=0;n--)for(var i=e._order[n],o=0,a=t;o=this.maxzoom)||"none"===this.layout.visibility},e.prototype.updatePaintTransitions=function(t,e,r,n,o){for(var a=this,s=i.extend({},this._paintDeclarations[""]),u=0;u=this.endTime)return n;var o=this.oldTransition.calculate(t,e,this.startTime),a=i.easeCubicInOut((r-this.startTime-this.delay)/this.duration);return this.interp(o,n,a)},s.prototype._calculateTargetValue=function(t,e){if(!this.zoomTransitioned)return this.declaration.calculate(t,e);var r=t.zoom,n=this.zoomHistory.lastIntegerZoom,i=r>n?2:.5,a=this.declaration.calculate({zoom:r>n?r-1:r+1},e),s=this.declaration.calculate({zoom:r},e),u=Math.min((Date.now()-this.zoomHistory.lastIntegerZoomTime)/this.duration,1),l=Math.abs(r-n),c=o(u,1,l);return void 0!==a&&void 0!==s?{from:a,fromScale:i,to:s,toScale:1,t:c}:void 0},e.exports=s},{"../util/interpolate":121,"../util/util":129}],74:[function(t,e,r){"use strict";e.exports=t("mapbox-gl-style-spec/lib/validate_style.min"),e.exports.emitErrors=function(t,e){if(e&&e.length){for(var r=0;r-r/2;){if(a--,a<0)return!1;s-=t[a].dist(o),o=t[a]}s+=t[a].dist(t[a+1]),a++;for(var u=[],l=0;sn;)l-=u.shift().angleDelta;if(l>i)return!1;a++,s+=h.dist(p)}return!0}e.exports=n},{}],77:[function(t,e,r){"use strict";function n(t,e,r,n,o){for(var a=[],s=0;s=n&&p.x>=n||(h.x>=n?h=new i(n,h.y+(p.y-h.y)*((n-h.x)/(p.x-h.x)))._round():p.x>=n&&(p=new i(n,h.y+(p.y-h.y)*((n-h.x)/(p.x-h.x)))._round()),h.y>=o&&p.y>=o||(h.y>=o?h=new i(h.x+(p.x-h.x)*((o-h.y)/(p.y-h.y)),o)._round():p.y>=o&&(p=new i(h.x+(p.x-h.x)*((o-h.y)/(p.y-h.y)),o)._round()),u&&h.equals(u[u.length-1])||(u=[h],a.push(u)),u.push(p)))))}return a}var i=t("point-geometry");e.exports=n},{"point-geometry":197}],78:[function(t,e,r){"use strict";var n=t("../util/struct_array"),i=t("point-geometry"),o=n({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"}]});Object.defineProperty(o.prototype.StructType.prototype,"anchorPoint",{get:function(){return new i(this.anchorPointX,this.anchorPointY)}}),e.exports=o},{"../util/struct_array":127,"point-geometry":197}],79:[function(t,e,r){"use strict";var n=function(t,e,r,n,i,o,a,s,u,l,c){var h=a.top*s-u,p=a.bottom*s+u,f=a.left*s-u,d=a.right*s+u;if(this.boxStartIndex=t.length,l){var m=p-h,y=d-f;if(m>0)if(m=Math.max(10*s,m),c){var v=e[r.segment+1].sub(e[r.segment])._unit()._mult(y),g=[r.sub(v),r.add(v)];this._addLineCollisionBoxes(t,g,r,0,y,m,n,i,o)}else this._addLineCollisionBoxes(t,e,r,r.segment,y,m,n,i,o)}else t.emplaceBack(r.x,r.y,f,h,d,p,1/0,n,i,o,0,0,0,0,0);this.boxEndIndex=t.length};n.prototype._addLineCollisionBoxes=function(t,e,r,n,i,o,a,s,u){var l=o/2,c=Math.floor(i/l),h=-o/2,p=this.boxes,f=r,d=n+1,m=h;do{if(d--,d<0)return p;m-=e[d].dist(f),f=e[d]}while(m>-i/2);for(var y=e[d].dist(e[d+1]),v=0;v=e.length)return p;y=e[d].dist(e[d+1])}var _=g-m,x=e[d],b=e[d+1],w=b.sub(x)._unit()._mult(_)._add(x)._round(),E=Math.max(Math.abs(g-h)-l/2,0),T=i/2/E;t.emplaceBack(w.x,w.y,-o/2,-o/2,o/2,o/2,T,a,s,u,0,0,0,0,0)}return p},e.exports=n},{}],80:[function(t,e,r){"use strict";var n=t("point-geometry"),i=t("../data/extent"),o=t("grid-index"),a=t("../util/intersection_tests"),s=function(t,e,r){if("object"==typeof t){var n=t;r=e,t=n.angle,e=n.pitch,this.grid=new o(n.grid),this.ignoredGrid=new o(n.ignoredGrid)}else this.grid=new o(i,12,6),this.ignoredGrid=new o(i,12,0);this.minScale=.5,this.maxScale=2,this.angle=t,this.pitch=e;var a=Math.sin(t),s=Math.cos(t);if(this.rotationMatrix=[s,-a,a,s],this.reverseRotationMatrix=[s,a,-a,s],this.yStretch=1/Math.cos(e/180*Math.PI),this.yStretch=Math.pow(this.yStretch,1.3),this.collisionBoxArray=r,0===r.length){r.emplaceBack();var u=32767;r.emplaceBack(0,0,0,-u,0,u,u,0,0,0,0,0,0,0,0,0),r.emplaceBack(i,0,0,-u,0,u,u,0,0,0,0,0,0,0,0,0),r.emplaceBack(0,0,-u,0,u,0,u,0,0,0,0,0,0,0,0,0),r.emplaceBack(0,i,-u,0,u,0,u,0,0,0,0,0,0,0,0,0)}this.tempCollisionBox=r.get(0),this.edges=[r.get(1),r.get(2),r.get(3),r.get(4)]};s.prototype.serialize=function(t){var e=this.grid.toArrayBuffer(),r=this.ignoredGrid.toArrayBuffer();return t&&(t.push(e),t.push(r)),{angle:this.angle,pitch:this.pitch,grid:e,ignoredGrid:r}},s.prototype.placeCollisionFeature=function(t,e,r){for(var i=this,o=this.collisionBoxArray,a=this.minScale,s=this.rotationMatrix,u=this.yStretch,l=t.boxStartIndex;l=i.maxScale)return a}if(r){var w;if(i.angle){var E=i.reverseRotationMatrix,T=new n(c.x1,c.y1).matMult(E),S=new n(c.x2,c.y1).matMult(E),z=new n(c.x1,c.y2).matMult(E),A=new n(c.x2,c.y2).matMult(E);w=i.tempCollisionBox,w.anchorPointX=c.anchorPoint.x,w.anchorPointY=c.anchorPoint.y,w.x1=Math.min(T.x,S.x,z.x,A.x),w.y1=Math.min(T.y,S.x,z.x,A.x),w.x2=Math.max(T.x,S.x,z.x,A.x),w.y2=Math.max(T.y,S.x,z.x,A.x),w.maxScale=c.maxScale}else w=c;for(var M=0;M=i.maxScale)return a}}}return a},s.prototype.queryRenderedSymbols=function(t,e){var r={},i=[];if(0===t.length||0===this.grid.length&&0===this.ignoredGrid.length)return i;for(var o=this.collisionBoxArray,s=this.rotationMatrix,u=this.yStretch,l=[],c=1/0,h=1/0,p=-(1/0),f=-(1/0),d=0;dE.maxScale)){var z=E.anchorPoint.matMult(s),A=z.x+E.x1/e,M=z.y+E.y1/e*u,P=z.x+E.x2/e,L=z.y+E.y2/e*u,C=[new n(A,M),new n(P,M),new n(P,L),new n(A,L)];a.polygonIntersectsPolygon(l,C)&&(r[T][S]=!0,i.push(g[w]))}}return i},s.prototype.getPlacementScale=function(t,e,r,n,i){var o=e.x-n.x,a=e.y-n.y,s=(i.x1-r.x2)/o,u=(i.x2-r.x1)/o,l=(i.y1-r.y2)*this.yStretch/a,c=(i.y2-r.y1)*this.yStretch/a;(isNaN(s)||isNaN(u))&&(s=u=1),(isNaN(l)||isNaN(c))&&(l=c=1);var h=Math.min(Math.max(s,u),Math.max(l,c)),p=i.maxScale,f=r.maxScale;return h>p&&(h=p),h>f&&(h=f),h>t&&h>=i.placementScale&&(t=h),t},s.prototype.insertCollisionFeature=function(t,e,r){for(var n=this,i=r?this.ignoredGrid:this.grid,o=this.collisionBoxArray,a=t.boxStartIndex;a=0&&S=0&&z=0&&v+f<=d){var A=new a(S,z,E,_)._round();n&&!s(t,A,l,n,u)||g.push(A)}}y+=w}return h||g.length||c||(g=i(t,y/2,r,n,u,l,c,!0,p)),g}var o=t("../util/interpolate"),a=t("../symbol/anchor"),s=t("./check_max_angle");e.exports=n},{"../symbol/anchor":75,"../util/interpolate":121,"./check_max_angle":76}],82:[function(t,e,r){"use strict";var n=t("shelf-pack"),i=t("../util/util"),o=4,a=128,s=2048,u=function(){ +this.width=a,this.height=a,this.bin=new n(this.width,this.height),this.index={},this.ids={},this.data=new Uint8Array(this.width*this.height)};u.prototype.getGlyphs=function(){var t,e,r,n={};for(var i in this.ids)t=i.split("#"),e=t[0],r=t[1],n[e]||(n[e]=[]),n[e].push(r);return n},u.prototype.getRects=function(){var t,e,r,n=this,i={};for(var o in this.ids)t=o.split("#"),e=t[0],r=t[1],i[e]||(i[e]={}),i[e][r]=n.index[o];return i},u.prototype.addGlyph=function(t,e,r,n){var o=this;if(!r)return null;var a=e+"#"+r.id;if(this.index[a])return this.ids[a].indexOf(t)<0&&this.ids[a].push(t),this.index[a];if(!r.bitmap)return null;var s=r.width+2*n,u=r.height+2*n,l=1,c=s+2*l,h=u+2*l;c+=4-c%4,h+=4-h%4;var p=this.bin.packOne(c,h);if(p||(this.resize(),p=this.bin.packOne(c,h)),!p)return i.warnOnce("glyph bitmap overflow"),null;this.index[a]=p,this.ids[a]=[t];for(var f=this.data,d=r.bitmap,m=0;m=s||r>=s)){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),i=0;i65535)return r("glyphs > 65535 not supported");void 0===this.loading[t]&&(this.loading[t]={});var i=this.loading[t];if(i[e])i[e].push(r);else{i[e]=[r];var a=256*e+"-"+(256*e+255),u=n(t,a,this.url);o.getArrayBuffer(u,function(t,r){for(var n=!t&&new s(new l(r.data)),o=0;o1?2:1,this.canvas&&(this.canvas.width=this.width*this.pixelRatio,this.canvas.height=this.height*this.pixelRatio)),this.sprite=t},u.prototype.addIcons=function(t,e){for(var r=this,n=0;n1||(E?(clearTimeout(E),E=null,v("dblclick",e)):E=setTimeout(f,300))}function c(t){g("touchmove",t)}function h(t){g("touchend",t)}function p(t){g("touchcancel",t)}function f(){E=null}function d(t){var e=n.mousePos(_,t);e.equals(w)&&v("click",t)}function m(t){v("dblclick",t),t.preventDefault()}function y(e){var r=t.dragRotate&&t.dragRotate.isActive();b||r?b&&(x=e):v("contextmenu",e),e.preventDefault()}function v(e,r){var i=n.mousePos(_,r);return t.fire(e,{lngLat:t.unproject(i),point:i,originalEvent:r})}function g(e,r){var o=n.touchPos(_,r),a=o.reduce(function(t,e,r,n){return t.add(e.div(n.length))},new i(0,0));return t.fire(e,{lngLat:t.unproject(a),point:a,lngLats:o.map(function(e){return t.unproject(e)},this),points:o,originalEvent:r})}var _=t.getCanvasContainer(),x=null,b=!1,w=null,E=null;for(var T in o)t[T]=new o[T](t,e),e.interactive&&e[T]&&t[T].enable(e[T]);_.addEventListener("mouseout",r,!1),_.addEventListener("mousedown",a,!1),_.addEventListener("mouseup",s,!1),_.addEventListener("mousemove",u,!1),_.addEventListener("touchstart",l,!1),_.addEventListener("touchend",h,!1),_.addEventListener("touchmove",c,!1),_.addEventListener("touchcancel",p,!1),_.addEventListener("click",d,!1),_.addEventListener("dblclick",m,!1),_.addEventListener("contextmenu",y,!1)}},{"../util/dom":117,"./handler/box_zoom":97,"./handler/dblclick_zoom":98,"./handler/drag_pan":99,"./handler/drag_rotate":100,"./handler/keyboard":101,"./handler/scroll_zoom":102,"./handler/touch_zoom_rotate":103,"point-geometry":197}],92:[function(t,e,r){"use strict";var n=t("../util/util"),i=t("../util/interpolate"),o=t("../util/browser"),a=t("../geo/lng_lat"),s=t("../geo/lng_lat_bounds"),u=t("point-geometry"),l=t("../util/evented"),c=function(t){function e(e,r){t.call(this),this.moving=!1,this.transform=e,this._bearingSnap=r.bearingSnap}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCenter=function(){return this.transform.center},e.prototype.setCenter=function(t,e){return this.jumpTo({center:t},e),this},e.prototype.panBy=function(t,e,r){return this.panTo(this.transform.center,n.extend({offset:u.convert(t).mult(-1)},e),r),this},e.prototype.panTo=function(t,e,r){return this.easeTo(n.extend({center:t},e),r)},e.prototype.getZoom=function(){return this.transform.zoom},e.prototype.setZoom=function(t,e){return this.jumpTo({zoom:t},e),this},e.prototype.zoomTo=function(t,e,r){return this.easeTo(n.extend({zoom:t},e),r)},e.prototype.zoomIn=function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},e.prototype.zoomOut=function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},e.prototype.getBearing=function(){return this.transform.bearing},e.prototype.setBearing=function(t,e){return this.jumpTo({bearing:t},e),this},e.prototype.rotateTo=function(t,e,r){return this.easeTo(n.extend({bearing:t},e),r)},e.prototype.resetNorth=function(t,e){return this.rotateTo(0,n.extend({duration:1e3},t),e),this},e.prototype.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 _=c.zoomScale(y-p),x=c.point,b="center"in t?c.project(m).sub(h.div(_)):x,w=t.curve,E=Math.max(c.width,c.height),T=E/_,S=b.sub(x).mag();if("minZoom"in t){var z=n.clamp(Math.min(t.minZoom,p,y),c.minZoom,c.maxZoom),A=E/c.zoomScale(z-p);w=Math.sqrt(A/S*2)}var M=w*w,P=r(0),L=function(t){return s(P)/s(P+w*t)},C=function(t){return E*((s(P)*l(P+w*t)-o(P))/M)/S},k=(r(1)-P)/w;if(Math.abs(S)<1e-6){if(Math.abs(E-T)<1e-6)return this.easeTo(t);var I=T=0)return!1;return!0}),this._container.innerHTML=t.join(" | "),this._editLink=null}},o.prototype._updateCompact=function(){var t=this._map.getCanvasContainer().offsetWidth<=640;this._container.classList[t?"add":"remove"]("compact")},e.exports=o},{"../../util/dom":117,"../../util/util":129}],94:[function(t,e,r){"use strict";function n(t){void 0!==i?t(i):void 0!==s.navigator.permissions?s.navigator.permissions.query({name:"geolocation"}).then(function(e){i="denied"!==e.state,t(i)}):(i=!!s.navigator.geolocation,t(i))}var i,o=t("../../util/evented"),a=t("../../util/dom"),s=t("../../util/window"),u=t("../../util/util"),l={enableHighAccuracy:!1,timeout:6e3},c="mapboxgl-ctrl",h=function(t){function e(e){t.call(this),this.options=e||{},u.bindAll(["_onSuccess","_onError","_finish","_setupUI"],this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.onAdd=function(t){return this._map=t,this._container=a.create("div",c+" "+c+"-group"),n(this._setupUI),this._container},e.prototype.onRemove=function(){this._container.parentNode.removeChild(this._container),this._map=void 0},e.prototype._onSuccess=function(t){this._map.jumpTo({center:[t.coords.longitude,t.coords.latitude],zoom:17,bearing:0,pitch:0}),this.fire("geolocate",t),this._finish()},e.prototype._onError=function(t){this.fire("error",t),this._finish()},e.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},e.prototype._setupUI=function(t){t!==!1&&(this._container.addEventListener("contextmenu",function(t){return t.preventDefault()}),this._geolocateButton=a.create("button",c+"-icon "+c+"-geolocate",this._container),this._geolocateButton.type="button",this._geolocateButton.setAttribute("aria-label","Geolocate"),this.options.watchPosition&&this._geolocateButton.setAttribute("aria-pressed",!1),this._geolocateButton.addEventListener("click",this._onClickGeolocate.bind(this)))},e.prototype._onClickGeolocate=function(){var t=u.extend(l,this.options&&this.options.positionOptions||{});this.options.watchPosition?void 0!==this._geolocationWatchID?(this._geolocateButton.classList.remove("watching"),this._geolocateButton.setAttribute("aria-pressed",!1),s.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0):(this._geolocateButton.classList.add("watching"),this._geolocateButton.setAttribute("aria-pressed",!0),this._geolocationWatchID=s.navigator.geolocation.watchPosition(this._onSuccess,this._onError,t)):(s.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,t),this._timeoutId=setTimeout(this._finish,1e4))},e}(o);e.exports=h},{"../../util/dom":117,"../../util/evented":118,"../../util/util":129,"../../util/window":112}],95:[function(t,e,r){"use strict";function n(t){return new o.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 i=t("../../util/dom"),o=t("../../util/window"),a=t("../../util/util"),s="mapboxgl-ctrl",u=function(){a.bindAll(["_rotateCompassArrow"],this)};u.prototype._rotateCompassArrow=function(){var t="rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassArrow.style.transform=t},u.prototype.onAdd=function(t){return this._map=t,this._container=i.create("div",s+" "+s+"-group",t.getContainer()),this._container.addEventListener("contextmenu",this._onContextMenu.bind(this)),this._zoomInButton=this._createButton(s+"-icon "+s+"-zoom-in","Zoom In",t.zoomIn.bind(t)),this._zoomOutButton=this._createButton(s+"-icon "+s+"-zoom-out","Zoom Out",t.zoomOut.bind(t)),this._compass=this._createButton(s+"-icon "+s+"-compass","Reset North",t.resetNorth.bind(t)),this._compassArrow=i.create("span","arrow",this._compass),this._compass.addEventListener("mousedown",this._onCompassDown.bind(this)),this._onCompassMove=this._onCompassMove.bind(this),this._onCompassUp=this._onCompassUp.bind(this),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._container},u.prototype.onRemove=function(){this._container.parentNode.removeChild(this._container),this._map.off("rotate",this._rotateCompassArrow),this._map=void 0},u.prototype._onContextMenu=function(t){t.preventDefault()},u.prototype._onCompassDown=function(t){0===t.button&&(i.disableDrag(),o.document.addEventListener("mousemove",this._onCompassMove),o.document.addEventListener("mouseup",this._onCompassUp),this._map.getCanvasContainer().dispatchEvent(n(t)),t.stopPropagation())},u.prototype._onCompassMove=function(t){0===t.button&&(this._map.getCanvasContainer().dispatchEvent(n(t)),t.stopPropagation())},u.prototype._onCompassUp=function(t){0===t.button&&(o.document.removeEventListener("mousemove",this._onCompassMove),o.document.removeEventListener("mouseup",this._onCompassUp), +i.enableDrag(),this._map.getCanvasContainer().dispatchEvent(n(t)),t.stopPropagation())},u.prototype._createButton=function(t,e,r){var n=i.create("button",t,this._container);return n.type="button",n.setAttribute("aria-label",e),n.addEventListener("click",function(){r()}),n},e.exports=u},{"../../util/dom":117,"../../util/util":129,"../../util/window":112}],96:[function(t,e,r){"use strict";function n(t,e,r){var n=r&&r.maxWidth||100,a=t._container.clientHeight/2,s=o(t.unproject([0,a]),t.unproject([n,a]));if(r&&"imperial"===r.unit){var u=3.2808*s;if(u>5280){var l=u/5280;i(e,n,l,"mi")}else i(e,n,u,"ft")}else i(e,n,s,"m")}function i(t,e,r,n){var i=a(r),o=i/r;"m"===n&&i>=1e3&&(i/=1e3,n="km"),t.style.width=e*o+"px",t.innerHTML=i+n}function o(t,e){var r=6371e3,n=Math.PI/180,i=t.lat*n,o=e.lat*n,a=Math.sin(i)*Math.sin(o)+Math.cos(i)*Math.cos(o)*Math.cos((e.lng-t.lng)*n),s=r*Math.acos(Math.min(a,1));return s}function a(t){var e=Math.pow(10,(""+Math.floor(t)).length-1),r=t/e;return r=r>=10?10:r>=5?5:r>=3?3:r>=2?2:1,e*r}var s=t("../../util/dom"),u=t("../../util/util"),l=function(t){this.options=t,u.bindAll(["_onMove"],this)};l.prototype.getDefaultPosition=function(){return"bottom-left"},l.prototype._onMove=function(){n(this._map,this._container,this.options)},l.prototype.onAdd=function(t){return this._map=t,this._container=s.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},l.prototype.onRemove=function(){this._container.parentNode.removeChild(this._container),this._map.off("move",this._onMove),this._map=void 0},e.exports=l},{"../../util/dom":117,"../../util/util":129}],97:[function(t,e,r){"use strict";var n=t("../../util/dom"),i=t("../../geo/lng_lat_bounds"),o=t("../../util/util"),a=t("../../util/window"),s=function(t){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),o.bindAll(["_onMouseDown","_onMouseMove","_onMouseUp","_onKeyDown"],this)};s.prototype.isEnabled=function(){return!!this._enabled},s.prototype.isActive=function(){return!!this._active},s.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onMouseDown,!1),this._enabled=!0)},s.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onMouseDown),this._enabled=!1)},s.prototype._onMouseDown=function(t){t.shiftKey&&0===t.button&&(a.document.addEventListener("mousemove",this._onMouseMove,!1),a.document.addEventListener("keydown",this._onKeyDown,!1),a.document.addEventListener("mouseup",this._onMouseUp,!1),n.disableDrag(),this._startPos=n.mousePos(this._el,t),this._active=!0)},s.prototype._onMouseMove=function(t){var e=this._startPos,r=n.mousePos(this._el,t);this._box||(this._box=n.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var i=Math.min(e.x,r.x),o=Math.max(e.x,r.x),a=Math.min(e.y,r.y),s=Math.max(e.y,r.y);n.setTransform(this._box,"translate("+i+"px,"+a+"px)"),this._box.style.width=o-i+"px",this._box.style.height=s-a+"px"},s.prototype._onMouseUp=function(t){if(0===t.button){var e=this._startPos,r=n.mousePos(this._el,t),o=(new i).extend(this._map.unproject(e)).extend(this._map.unproject(r));this._finish(),e.x===r.x&&e.y===r.y?this._fireEvent("boxzoomcancel",t):this._map.fitBounds(o,{linear:!0}).fire("boxzoomend",{originalEvent:t,boxZoomBounds:o})}},s.prototype._onKeyDown=function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t))},s.prototype._finish=function(){this._active=!1,a.document.removeEventListener("mousemove",this._onMouseMove,!1),a.document.removeEventListener("keydown",this._onKeyDown,!1),a.document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.parentNode.removeChild(this._box),this._box=null),n.enableDrag()},s.prototype._fireEvent=function(t,e){return this._map.fire(t,{originalEvent:e})},e.exports=s},{"../../geo/lng_lat_bounds":20,"../../util/dom":117,"../../util/util":129,"../../util/window":112}],98:[function(t,e,r){"use strict";var n=function(t){this._map=t,this._onDblClick=this._onDblClick.bind(this)};n.prototype.isEnabled=function(){return!!this._enabled},n.prototype.enable=function(){this.isEnabled()||(this._map.on("dblclick",this._onDblClick),this._enabled=!0)},n.prototype.disable=function(){this.isEnabled()&&(this._map.off("dblclick",this._onDblClick),this._enabled=!1)},n.prototype._onDblClick=function(t){this._map.zoomTo(this._map.getZoom()+(t.originalEvent.shiftKey?-1:1),{around:t.lngLat},t)},e.exports=n},{}],99:[function(t,e,r){"use strict";var n=t("../../util/dom"),i=t("../../util/util"),o=t("../../util/window"),a=.3,s=i.bezier(0,0,a,1),u=1400,l=2500,c=function(t){this._map=t,this._el=t.getCanvasContainer(),i.bindAll(["_onDown","_onMove","_onUp","_onTouchEnd","_onMouseUp"],this)};c.prototype.isEnabled=function(){return!!this._enabled},c.prototype.isActive=function(){return!!this._active},c.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._el.addEventListener("touchstart",this._onDown),this._enabled=!0)},c.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._el.removeEventListener("touchstart",this._onDown),this._enabled=!1)},c.prototype._onDown=function(t){this._ignoreEvent(t)||this.isActive()||(t.touches?(o.document.addEventListener("touchmove",this._onMove),o.document.addEventListener("touchend",this._onTouchEnd)):(o.document.addEventListener("mousemove",this._onMove),o.document.addEventListener("mouseup",this._onMouseUp)),this._active=!1,this._startPos=this._pos=n.mousePos(this._el,t),this._inertia=[[Date.now(),this._pos]])},c.prototype._onMove=function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._fireEvent("dragstart",t),this._fireEvent("movestart",t));var e=n.mousePos(this._el,t),r=this._map;r.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),e]),r.transform.setLocationAtPoint(r.transform.pointLocation(this._pos),e),this._fireEvent("drag",t),this._fireEvent("move",t),this._pos=e,t.preventDefault()}},c.prototype._onUp=function(t){var e=this;if(this.isActive()){this._active=!1,this._fireEvent("dragend",t),this._drainInertiaBuffer();var r=function(){return e._fireEvent("moveend",t)},n=this._inertia;if(n.length<2)return void r();var i=n[n.length-1],o=n[0],c=i[1].sub(o[1]),h=(i[0]-o[0])/1e3;if(0===h||i[1].equals(o[1]))return void r();var p=c.mult(a/h),f=p.mag();f>u&&(f=u,p._unit()._mult(f));var d=f/(l*a),m=p.mult(-d/2);this._map.panBy(m,{duration:1e3*d,easing:s,noMoveStart:!0},{originalEvent:t})}},c.prototype._onMouseUp=function(t){this._ignoreEvent(t)||(this._onUp(t),o.document.removeEventListener("mousemove",this._onMove),o.document.removeEventListener("mouseup",this._onMouseUp))},c.prototype._onTouchEnd=function(t){this._ignoreEvent(t)||(this._onUp(t),o.document.removeEventListener("touchmove",this._onMove),o.document.removeEventListener("touchend",this._onTouchEnd))},c.prototype._fireEvent=function(t,e){return this._map.fire(t,{originalEvent:e})},c.prototype._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 r=1,n=0;return"mousemove"===t.type?t.buttons&0===r:t.button!==n},c.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,e=Date.now(),r=160;t.length>0&&e-t[0][0]>r;)t.shift()},e.exports=c},{"../../util/dom":117,"../../util/util":129,"../../util/window":112}],100:[function(t,e,r){"use strict";var n=t("../../util/dom"),i=t("../../util/util"),o=t("../../util/window"),a=.25,s=i.bezier(0,0,a,1),u=180,l=720,c=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._bearingSnap=e.bearingSnap,this._pitchWithRotate=e.pitchWithRotate!==!1,i.bindAll(["_onDown","_onMove","_onUp"],this)};c.prototype.isEnabled=function(){return!!this._enabled},c.prototype.isActive=function(){return!!this._active},c.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._enabled=!0)},c.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._enabled=!1)},c.prototype._onDown=function(t){this._ignoreEvent(t)||this.isActive()||(o.document.addEventListener("mousemove",this._onMove),o.document.addEventListener("mouseup",this._onUp),this._active=!1,this._inertia=[[Date.now(),this._map.getBearing()]],this._startPos=this._pos=n.mousePos(this._el,t),this._center=this._map.transform.centerPoint,t.preventDefault())},c.prototype._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 r=this._pos,i=n.mousePos(this._el,t),o=.8*(r.x-i.x),a=(r.y-i.y)*-.5,s=e.getBearing()-o,u=e.getPitch()-a,l=this._inertia,c=l[l.length-1];this._drainInertiaBuffer(),l.push([Date.now(),e._normalizeBearing(s,c[1])]),e.transform.bearing=s,this._pitchWithRotate&&(e.transform.pitch=u),this._fireEvent("rotate",t),this._fireEvent("move",t),this._pos=i}},c.prototype._onUp=function(t){var e=this;if(!this._ignoreEvent(t)&&(o.document.removeEventListener("mousemove",this._onMove),o.document.removeEventListener("mouseup",this._onUp),this.isActive())){this._active=!1,this._fireEvent("rotateend",t),this._drainInertiaBuffer();var r=this._map,n=r.getBearing(),i=this._inertia,c=function(){Math.abs(n)u&&(g=u);var _=g/(l*a),x=y*g*(_/2);d+=x,Math.abs(r._normalizeBearing(d,0))1;var r=t.ctrlKey?1:2,n=t.ctrlKey?0:2,i=t.button;return"undefined"!=typeof InstallTrigger&&2===t.button&&t.ctrlKey&&o.navigator.platform.toUpperCase().indexOf("MAC")>=0&&(i=0),"mousemove"===t.type?t.buttons&0===r:i!==n},c.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,e=Date.now(),r=160;t.length>0&&e-t[0][0]>r;)t.shift()},e.exports=c},{"../../util/dom":117,"../../util/util":129,"../../util/window":112}],101:[function(t,e,r){"use strict";function n(t){return t*(2-t)}var i=100,o=15,a=10,s=function(t){this._map=t,this._el=t.getCanvasContainer(),this._onKeyDown=this._onKeyDown.bind(this)};s.prototype.isEnabled=function(){return!!this._enabled},s.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)},s.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)},s.prototype._onKeyDown=function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=0,r=0,s=0,u=0,l=0;switch(t.keyCode){case 61:case 107:case 171:case 187:e=1;break;case 189:case 109:case 173:e=-1;break;case 37:t.shiftKey?r=-1:(t.preventDefault(),u=-1);break;case 39:t.shiftKey?r=1:(t.preventDefault(),u=1);break;case 38:t.shiftKey?s=1:(t.preventDefault(),l=-1);break;case 40:t.shiftKey?s=-1:(l=1,t.preventDefault())}var c=this._map,h=c.getZoom(),p={duration:300,delayEndEvents:500,easing:n,zoom:e?Math.round(h)+e*(t.shiftKey?2:1):h,bearing:c.getBearing()+r*o,pitch:c.getPitch()+s*a,offset:[-u*i,-l*i],center:c.getCenter()};c.easeTo(p,{originalEvent:t})}},e.exports=s},{}],102:[function(t,e,r){"use strict";var n=t("../../util/dom"),i=t("../../util/util"),o=t("../../util/browser"),a=t("../../util/window"),s=a.navigator.userAgent.toLowerCase(),u=s.indexOf("firefox")!==-1,l=s.indexOf("safari")!==-1&&s.indexOf("chrom")===-1,c=function(t){this._map=t,this._el=t.getCanvasContainer(),i.bindAll(["_onWheel","_onTimeout"],this)};c.prototype.isEnabled=function(){return!!this._enabled},c.prototype.enable=function(t){this.isEnabled()||(this._el.addEventListener("wheel",this._onWheel,!1),this._el.addEventListener("mousewheel",this._onWheel,!1),this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},c.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("wheel",this._onWheel),this._el.removeEventListener("mousewheel",this._onWheel),this._enabled=!1)},c.prototype._onWheel=function(t){var e;"wheel"===t.type?(e=t.deltaY,u&&t.deltaMode===a.WheelEvent.DOM_DELTA_PIXEL&&(e/=o.devicePixelRatio),t.deltaMode===a.WheelEvent.DOM_DELTA_LINE&&(e*=40)):"mousewheel"===t.type&&(e=-t.wheelDeltaY,l&&(e/=3));var r=o.now(),i=r-(this._time||0);this._pos=n.mousePos(this._el,t),this._time=r,0!==e&&e%4.000244140625===0?this._type="wheel":0!==e&&Math.abs(e)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40)):this._type||(this._type=Math.abs(i*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()},c.prototype._onTimeout=function(){this._type="wheel",this._zoom(-this._lastValue)},c.prototype._zoom=function(t,e){if(0!==t){var r=this._map,n=2/(1+Math.exp(-Math.abs(t/100)));t<0&&0!==n&&(n=1/n);var i=r.ease?r.ease.to:r.transform.scale,o=r.transform.scaleZoom(i*n);r.zoomTo(o,{duration:"wheel"===this._type?200:0,around:this._aroundCenter?r.getCenter():r.unproject(this._pos),delayEndEvents:200,smoothEasing:!0},{originalEvent:e})}},e.exports=c},{"../../util/browser":110,"../../util/dom":117,"../../util/util":129,"../../util/window":112}],103:[function(t,e,r){"use strict";var n=t("../../util/dom"),i=t("../../util/util"),o=t("../../util/window"),a=.15,s=i.bezier(0,0,a,1),u=12,l=2.5,c=.15,h=4,p=function(t){this._map=t,this._el=t.getCanvasContainer(),i.bindAll(["_onStart","_onMove","_onEnd"],this)};p.prototype.isEnabled=function(){return!!this._enabled},p.prototype.enable=function(t){this.isEnabled()||(this._el.addEventListener("touchstart",this._onStart,!1),this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},p.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("touchstart",this._onStart),this._enabled=!1)},p.prototype.disableRotation=function(){this._rotationDisabled=!0},p.prototype.enableRotation=function(){this._rotationDisabled=!1},p.prototype._onStart=function(t){if(2===t.touches.length){var e=n.mousePos(this._el,t.touches[0]),r=n.mousePos(this._el,t.touches[1]);this._startVec=e.sub(r),this._startScale=this._map.transform.scale,this._startBearing=this._map.transform.bearing,this._gestureIntent=void 0,this._inertia=[],o.document.addEventListener("touchmove",this._onMove,!1),o.document.addEventListener("touchend",this._onEnd,!1)}},p.prototype._onMove=function(t){if(2===t.touches.length){var e=n.mousePos(this._el,t.touches[0]),r=n.mousePos(this._el,t.touches[1]),i=e.add(r).div(2),o=e.sub(r),a=o.mag()/this._startVec.mag(),s=this._rotationDisabled?0:180*o.angleWith(this._startVec)/Math.PI,u=this._map;if(this._gestureIntent){var l={duration:0,around:u.unproject(i)};"rotate"===this._gestureIntent&&(l.bearing=this._startBearing+s),"zoom"!==this._gestureIntent&&"rotate"!==this._gestureIntent||(l.zoom=u.transform.scaleZoom(this._startScale*a)),u.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),a,i]),u.easeTo(l,{originalEvent:t})}else{var p=Math.abs(1-a)>c,f=Math.abs(s)>h;f?this._gestureIntent="rotate":p&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._startVec=o,this._startScale=u.transform.scale,this._startBearing=u.transform.bearing)}t.preventDefault()}},p.prototype._onEnd=function(t){o.document.removeEventListener("touchmove",this._onMove),o.document.removeEventListener("touchend",this._onEnd),this._drainInertiaBuffer();var e=this._inertia,r=this._map;if(e.length<2)return void r.snapToNorth({},{originalEvent:t});var n=e[e.length-1],i=e[0],c=r.transform.scaleZoom(this._startScale*n[1]),h=r.transform.scaleZoom(this._startScale*i[1]),p=c-h,f=(n[0]-i[0])/1e3,d=n[2];if(0===f||c===h)return void r.snapToNorth({},{originalEvent:t});var m=p*a/f;Math.abs(m)>l&&(m=m>0?l:-l);var y=1e3*Math.abs(m/(u*a)),v=c+m*y/2e3;v<0&&(v=0),r.easeTo({zoom:v,duration:y,easing:s,around:this._aroundCenter?r.getCenter():r.unproject(d)},{originalEvent:t})},p.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,e=Date.now(),r=160;t.length>2&&e-t[0][0]>r;)t.shift()},e.exports=p},{"../../util/dom":117,"../../util/util":129,"../../util/window":112}],104:[function(t,e,r){"use strict";var n=t("../util/util"),i=t("../util/window"),o=function(){n.bindAll(["_onHashChange","_updateHash"],this)};o.prototype.addTo=function(t){return this._map=t,i.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},o.prototype.remove=function(){return i.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),delete this._map,this},o.prototype._onHashChange=function(){var t=i.location.hash.replace("#","").split("/");return t.length>=3&&(this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:+(t[3]||0),pitch:+(t[4]||0)}),!0)},o.prototype._updateHash=function(){var t=this._map.getCenter(),e=this._map.getZoom(),r=this._map.getBearing(),n=this._map.getPitch(),o=Math.max(0,Math.ceil(Math.log(e)/Math.LN2)),a="#"+Math.round(100*e)/100+"/"+t.lat.toFixed(o)+"/"+t.lng.toFixed(o);(r||n)&&(a+="/"+Math.round(10*r)/10),n&&(a+="/"+Math.round(n)),i.history.replaceState("","",a)},e.exports=o},{"../util/util":129,"../util/window":112}],105:[function(t,e,r){"use strict";function n(t){t.parentNode&&t.parentNode.removeChild(t)}var i=t("../util/util"),o=t("../util/browser"),a=t("../util/window"),s=t("../util/dom"),u=t("../style/style"),l=t("../style/animation_loop"),c=t("../render/painter"),h=t("../geo/transform"),p=t("./hash"),f=t("./bind_handlers"),d=t("./camera"),m=t("../geo/lng_lat"),y=t("../geo/lng_lat_bounds"),v=t("point-geometry"),g=t("./control/attribution_control"),_=t("mapbox-gl-supported"),x=0,b=20,w={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:x,maxZoom:b,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,renderWorldCopies:!0},E=function(t){function e(e){var r=this;e=i.extend({},w,e);var n=new h(e.minZoom,e.maxZoom,e.renderWorldCopies);if(t.call(this,n,e),this._interactive=e.interactive,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,"string"==typeof e.container){if(this._container=a.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else this._container=e.container;this.animationLoop=new l,e.maxBounds&&this.setMaxBounds(e.maxBounds),i.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored","_update","_render","_onData","_onDataLoading"],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(){r.animationLoop.set(300),r._rerender()}),"undefined"!=typeof a&&(a.addEventListener("online",this._onWindowOnline,!1),a.addEventListener("resize",this._onWindowResize,!1)),f(this,e),this._hash=e.hash&&(new p).addTo(this),this._hash&&this._hash._onHashChange()||this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),this._classes=[],this.resize(),e.classes&&this.setClasses(e.classes),e.style&&this.setStyle(e.style),e.attributionControl&&this.addControl(new g),this.on("style.load",function(){this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this.style.update(this._classes,{transition:!1})}),this.on("data",this._onData),this.on("dataloading",this._onDataLoading)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={showTileBoundaries:{},showCollisionBoxes:{},showOverdrawInspector:{},repaint:{},vertices:{}};return e.prototype.addControl=function(t,e){void 0===e&&t.getDefaultPosition&&(e=t.getDefaultPosition()),void 0===e&&(e="top-right");var r=t.onAdd(this),n=this._controlPositions[e];return e.indexOf("bottom")!==-1?n.insertBefore(r,n.firstChild):n.appendChild(r),this},e.prototype.removeControl=function(t){return t.onRemove(this),this},e.prototype.addClass=function(t,e){return i.warnOnce("Style classes are deprecated and will be removed in an upcoming release of Mapbox GL JS."),this._classes.indexOf(t)>=0||""===t?this:(this._classes.push(t),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},e.prototype.removeClass=function(t,e){i.warnOnce("Style classes are deprecated and will be removed in an upcoming release of Mapbox GL JS.");var r=this._classes.indexOf(t);return r<0||""===t?this:(this._classes.splice(r,1),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},e.prototype.setClasses=function(t,e){i.warnOnce("Style classes are deprecated and will be removed in an upcoming release of Mapbox GL JS.");for(var r={},n=0;n=0},e.prototype.getClasses=function(){return i.warnOnce("Style classes are deprecated and will be removed in an upcoming release of Mapbox GL JS."),this._classes},e.prototype.resize=function(){var t=this._containerDimensions(),e=t[0],r=t[1];this._resizeCanvas(e,r),this.transform.resize(e,r),this.painter.resize(e,r);var n=this.painter.gl,o=n.getParameter(n.MAX_RENDERBUFFER_SIZE)/2;return(this._canvas.width>o||this._canvas.height>o)&&i.warnOnce("Map is larger than maximum size supported by this system ("+o+"px by "+o+"px)."),this.fire("movestart").fire("move").fire("resize").fire("moveend")},e.prototype.getBounds=function(){var t=new y(this.transform.pointLocation(new v(0,this.transform.height)),this.transform.pointLocation(new v(this.transform.width,0)));return(this.transform.angle||this.transform.pitch)&&(t.extend(this.transform.pointLocation(new v(this.transform.size.x,0))),t.extend(this.transform.pointLocation(new v(0,this.transform.size.y)))),t},e.prototype.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},e.prototype.setMinZoom=function(t){if(t=null===t||void 0===t?x:t,t>=x&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},e.prototype.getMaxZoom=function(){return this.transform.maxZoom},e.prototype.project=function(t){return this.transform.locationPoint(m.convert(t))},e.prototype.unproject=function(t){return this.transform.pointLocation(v.convert(t))},e.prototype.queryRenderedFeatures=function(){function t(t){return t instanceof v||Array.isArray(t)}var e,r={};return 2===arguments.length?(e=arguments[0],r=arguments[1]):1===arguments.length&&t(arguments[0])?e=arguments[0]:1===arguments.length&&(r=arguments[0]),this.style.queryRenderedFeatures(this._makeQueryGeometry(e),r,this.transform.zoom,this.transform.angle)},e.prototype._makeQueryGeometry=function(t){var e=this;void 0===t&&(t=[v.convert([0,0]),v.convert([this.transform.width,this.transform.height])]);var r,n=t instanceof v||"number"==typeof t[0];if(n){var i=v.convert(t);r=[i]}else{var o=[v.convert(t[0]),v.convert(t[1])];r=[o[0],new v(o[1].x,o[0].y),o[1],new v(o[0].x,o[1].y),o[0]]}return r=r.map(function(t){return e.transform.pointCoordinate(t)})},e.prototype.querySourceFeatures=function(t,e){return this.style.querySourceFeatures(t,e)},e.prototype.setStyle=function(t,e){var r=(!e||e.diff!==!1)&&this.style&&t&&!(t instanceof u)&&"string"!=typeof t;if(r)try{return this.style.setState(t)&&this._update(!0),this}catch(t){i.warnOnce("Unable to perform style diff: "+(t.message||t.error||t)+". Rebuilding the style from scratch.")}return this.style&&(this.style.setEventedParent(null),this.style._remove(),this.off("rotate",this.style._redoPlacement),this.off("pitch",this.style._redoPlacement)),t?(t instanceof u?this.style=t:this.style=new u(t,this),this.style.setEventedParent(this,{style:this.style}),this.on("rotate",this.style._redoPlacement),this.on("pitch",this.style._redoPlacement),this):(this.style=null,this)},e.prototype.getStyle=function(){if(this.style)return this.style.serialize()},e.prototype.addSource=function(t,e){return this.style.addSource(t,e),this._update(!0),this},e.prototype.isSourceLoaded=function(t){var e=this.style&&this.style.sourceCaches[t];return void 0===e?void this.fire("error",{error:new Error("There is no source with ID '"+t+"'")}):e.loaded()},e.prototype.addSourceType=function(t,e,r){return this.style.addSourceType(t,e,r)},e.prototype.removeSource=function(t){return this.style.removeSource(t),this._update(!0),this},e.prototype.getSource=function(t){return this.style.getSource(t)},e.prototype.addLayer=function(t,e){return this.style.addLayer(t,e),this._update(!0),this},e.prototype.moveLayer=function(t,e){return this.style.moveLayer(t,e),this._update(!0),this},e.prototype.removeLayer=function(t){return this.style.removeLayer(t),this._update(!0),this},e.prototype.getLayer=function(t){return this.style.getLayer(t)},e.prototype.setFilter=function(t,e){return this.style.setFilter(t,e),this._update(!0),this},e.prototype.setLayerZoomRange=function(t,e,r){return this.style.setLayerZoomRange(t,e,r),this._update(!0),this},e.prototype.getFilter=function(t){return this.style.getFilter(t)},e.prototype.setPaintProperty=function(t,e,r,n){return this.style.setPaintProperty(t,e,r,n),this._update(!0),this},e.prototype.getPaintProperty=function(t,e,r){return this.style.getPaintProperty(t,e,r)},e.prototype.setLayoutProperty=function(t,e,r){return this.style.setLayoutProperty(t,e,r),this._update(!0),this},e.prototype.getLayoutProperty=function(t,e){return this.style.getLayoutProperty(t,e)},e.prototype.setLight=function(t){return this.style.setLight(t),this._update(!0),this},e.prototype.getLight=function(){return this.style.getLight()},e.prototype.getContainer=function(){return this._container},e.prototype.getCanvasContainer=function(){return this._canvasContainer},e.prototype.getCanvas=function(){return this._canvas},e.prototype._containerDimensions=function(){var t=0,e=0;return this._container&&(t=this._container.offsetWidth||400,e=this._container.offsetHeight||300),[t,e]},e.prototype._setupContainer=function(){var t=this._container;t.classList.add("mapboxgl-map");var e=this._canvasContainer=s.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=s.create("canvas","mapboxgl-canvas",e),this._canvas.style.position="absolute",this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",0),this._canvas.setAttribute("aria-label","Map");var r=this._containerDimensions();this._resizeCanvas(r[0],r[1]);var n=this._controlContainer=s.create("div","mapboxgl-control-container",t),i=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(t){i[t]=s.create("div","mapboxgl-ctrl-"+t,n)})},e.prototype._resizeCanvas=function(t,e){var r=a.devicePixelRatio||1;this._canvas.width=r*t,this._canvas.height=r*e,this._canvas.style.width=t+"px",this._canvas.style.height=e+"px"},e.prototype._setupPainter=function(){var t=i.extend({failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer},_.webGLContextAttributes),e=this._canvas.getContext("webgl",t)||this._canvas.getContext("experimental-webgl",t);return e?void(this.painter=new c(e,this.transform)):void this.fire("error",{error:new Error("Failed to initialize WebGL")})},e.prototype._contextLost=function(t){t.preventDefault(),this._frameId&&o.cancelFrame(this._frameId),this.fire("webglcontextlost",{originalEvent:t})},e.prototype._contextRestored=function(t){this._setupPainter(),this.resize(),this._update(),this.fire("webglcontextrestored",{originalEvent:t})},e.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!(!this.style||!this.style.loaded())},e.prototype._update=function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this._rerender(),this):this},e.prototype._render=function(){return 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,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,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(),this},e.prototype.remove=function(){this._hash&&this._hash.remove(),o.cancelFrame(this._frameId),this.setStyle(null),"undefined"!=typeof a&&a.removeEventListener("resize",this._onWindowResize,!1);var t=this.painter.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),n(this._canvasContainer),n(this._controlContainer),this._container.classList.remove("mapboxgl-map"),this.fire("remove")},e.prototype._rerender=function(){this.style&&!this._frameId&&(this._frameId=o.frame(this._render))},e.prototype._onWindowOnline=function(){this._update()},e.prototype._onWindowResize=function(){this._trackResize&&this.stop().resize()._update()},r.showTileBoundaries.get=function(){return!!this._showTileBoundaries},r.showTileBoundaries.set=function(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},r.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},r.showCollisionBoxes.set=function(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,this.style._redoPlacement())},r.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},r.showOverdrawInspector.set=function(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},r.repaint.get=function(){return!!this._repaint},r.repaint.set=function(t){this._repaint=t,this._update()},r.vertices.get=function(){return!!this._vertices},r.vertices.set=function(t){this._vertices=t,this._update()},e.prototype._onData=function(t){this._update("style"===t.dataType),this.fire(t.dataType+"data",t)},e.prototype._onDataLoading=function(t){this.fire(t.dataType+"dataloading",t)},Object.defineProperties(e.prototype,r),e}(d);e.exports=E},{"../geo/lng_lat":19, +"../geo/lng_lat_bounds":20,"../geo/transform":21,"../render/painter":36,"../style/animation_loop":59,"../style/style":63,"../util/browser":110,"../util/dom":117,"../util/util":129,"../util/window":112,"./bind_handlers":91,"./camera":92,"./control/attribution_control":93,"./hash":104,"mapbox-gl-supported":193,"point-geometry":197}],106:[function(t,e,r){"use strict";var n=t("../util/dom"),i=t("../geo/lng_lat"),o=t("point-geometry"),a=function(t,e){this._offset=o.convert(e&&e.offset||[0,0]),this._update=this._update.bind(this),this._onMapClick=this._onMapClick.bind(this),t||(t=n.create("div")),t.classList.add("mapboxgl-marker"),this._element=t,this._popup=null};a.prototype.addTo=function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),this._update(),this._map.on("click",this._onMapClick),this},a.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map=null),n.remove(this._element),this._popup&&this._popup.remove(),this},a.prototype.getLngLat=function(){return this._lngLat},a.prototype.setLngLat=function(t){return this._lngLat=i.convert(t),this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},a.prototype.getElement=function(){return this._element},a.prototype.setPopup=function(t){return this._popup&&(this._popup.remove(),this._popup=null),t&&(this._popup=t,this._popup.setLngLat(this._lngLat)),this},a.prototype._onMapClick=function(t){var e=t.originalEvent.target,r=this._element;this._popup&&(e===r||r.contains(e))&&this.togglePopup()},a.prototype.getPopup=function(){return this._popup},a.prototype.togglePopup=function(){var t=this._popup;t&&(t.isOpen()?t.remove():t.addTo(this._map))},a.prototype._update=function(t){if(this._map){var e=this._map.project(this._lngLat)._add(this._offset);t&&"moveend"!==t.type||(e=e.round()),n.setTransform(this._element,"translate("+e.x+"px, "+e.y+"px)")}},e.exports=a},{"../geo/lng_lat":19,"../util/dom":117,"point-geometry":197}],107:[function(t,e,r){"use strict";function n(t){if(t){if("number"==typeof t){var e=Math.round(Math.sqrt(.5*Math.pow(t,2)));return{top:new l(0,t),"top-left":new l(e,e),"top-right":new l(-e,e),bottom:new l(0,-t),"bottom-left":new l(e,-e),"bottom-right":new l(-e,-e),left:new l(t,0),right:new l(-t,0)}}if(i(t)){var r=l.convert(t);return{top:r,"top-left":r,"top-right":r,bottom:r,"bottom-left":r,"bottom-right":r,left:r,right:r}}return{top:l.convert(t.top||[0,0]),"top-left":l.convert(t["top-left"]||[0,0]),"top-right":l.convert(t["top-right"]||[0,0]),bottom:l.convert(t.bottom||[0,0]),"bottom-left":l.convert(t["bottom-left"]||[0,0]),"bottom-right":l.convert(t["bottom-right"]||[0,0]),left:l.convert(t.left||[0,0]),right:l.convert(t.right||[0,0])}}return n(new l(0,0))}function i(t){return t instanceof l||Array.isArray(t)}var o=t("../util/util"),a=t("../util/evented"),s=t("../util/dom"),u=t("../geo/lng_lat"),l=t("point-geometry"),c=t("../util/window"),h={closeButton:!0,closeOnClick:!0},p=function(t){function e(e){t.call(this),this.options=o.extend(Object.create(h),e),o.bindAll(["_update","_onClickClose"],this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.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},e.prototype.isOpen=function(){return!!this._map},e.prototype.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},e.prototype.getLngLat=function(){return this._lngLat},e.prototype.setLngLat=function(t){return this._lngLat=u.convert(t),this._update(),this},e.prototype.setText=function(t){return this.setDOMContent(c.document.createTextNode(t))},e.prototype.setHTML=function(t){var e,r=c.document.createDocumentFragment(),n=c.document.createElement("body");for(n.innerHTML=t;e=n.firstChild,e;)r.appendChild(e);return this.setDOMContent(r)},e.prototype.setDOMContent=function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},e.prototype._createContent=function(){this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._content=s.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=s.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClickClose))},e.prototype._update=function(){if(this._map&&this._lngLat&&this._content){this._container||(this._container=s.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=s.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content));var t=this.options.anchor,e=n(this.options.offset),r=this._map.project(this._lngLat).round();if(!t){var i=this._container.offsetWidth,o=this._container.offsetHeight;t=r.y+e.bottom.ythis._map.transform.height-o?["bottom"]:[],r.xthis._map.transform.width-i/2&&t.push("right"),t=0===t.length?"bottom":t.join("-")}var a=r.add(e[t]),u={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%)"},l=this._container.classList;for(var c in u)l.remove("mapboxgl-popup-anchor-"+c);l.add("mapboxgl-popup-anchor-"+t),s.setTransform(this._container,u[t]+" translate("+a.x+"px,"+a.y+"px)")}},e.prototype._onClickClose=function(){this.remove()},e}(a);e.exports=p},{"../geo/lng_lat":19,"../util/dom":117,"../util/evented":118,"../util/util":129,"../util/window":112,"point-geometry":197}],108:[function(t,e,r){"use strict";var n=function(t,e,r){this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.callbackID=0,this.receive=this.receive.bind(this),this.target.addEventListener("message",this.receive,!1)};n.prototype.send=function(t,e,r,n,i){var o=r?this.mapId+":"+this.callbackID++:null;r&&(this.callbacks[o]=r),this.target.postMessage({targetMapId:i,sourceMapId:this.mapId,type:t,id:String(o),data:e},n)},n.prototype.receive=function(t){var e,r=this,n=t.data,i=n.id;if(!n.targetMapId||this.mapId===n.targetMapId){var o=function(t,e,n){r.target.postMessage({sourceMapId:r.mapId,type:"",id:String(i),error:t?String(t):null,data:e},n)};if(""===n.type)e=this.callbacks[n.id],delete this.callbacks[n.id],e&&e(n.error||null,n.data);else if("undefined"!=typeof n.id&&this.parent[n.type])this.parent[n.type](n.sourceMapId,n.data,o);else if("undefined"!=typeof n.id&&this.parent.getWorkerSource){var a=n.type.split("."),s=this.parent.getWorkerSource(n.sourceMapId,a[0]);s[a[1]](n.data,o)}else this.parent[n.type](n.data)}},n.prototype.remove=function(){this.target.removeEventListener("message",this.receive,!1)},e.exports=n},{}],109:[function(t,e,r){"use strict";function n(t){var e=i.document.createElement("a");return e.href=t,e.protocol===i.document.location.protocol&&e.host===i.document.location.host}var i=t("./window");r.getJSON=function(t,e){var r=new i.XMLHttpRequest;return r.open("GET",t,!0),r.setRequestHeader("Accept","application/json"),r.onerror=function(t){e(t)},r.onload=function(){if(r.status>=200&&r.status<300&&r.response){var t;try{t=JSON.parse(r.response)}catch(t){return e(t)}e(null,t)}else e(new Error(r.statusText))},r.send(),r},r.getArrayBuffer=function(t,e){var r=new i.XMLHttpRequest;return r.open("GET",t,!0),r.responseType="arraybuffer",r.onerror=function(t){e(t)},r.onload=function(){return 0===r.response.byteLength&&200===r.status?e(new Error("http status 200 returned without content.")):void(r.status>=200&&r.status<300&&r.response?e(null,{data:r.response,cacheControl:r.getResponseHeader("Cache-Control"),expires:r.getResponseHeader("Expires")}):e(new Error(r.statusText)))},r.send(),r};var o="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";r.getImage=function(t,e){return r.getArrayBuffer(t,function(t,r){if(t)return e(t);var n=new i.Image,a=i.URL||i.webkitURL;n.onload=function(){e(null,n),a.revokeObjectURL(n.src)};var s=new i.Blob([new Uint8Array(r.data)],{type:"image/png"});n.cacheControl=r.cacheControl,n.expires=r.expires,n.src=r.data.byteLength?a.createObjectURL(s):o})},r.getVideo=function(t,e){var r=i.document.createElement("video");r.onloadstart=function(){e(null,r)};for(var o=0;o=s+n?t.call(i,1):(t.call(i,(u-s)/n),r.frame(o)))}if(!n)return t.call(i,1),null;var a=!1,s=e.exports.now();return r.frame(o),function(){a=!0}},r.getImageData=function(t){var e=n.document.createElement("canvas"),r=e.getContext("2d");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0),r.getImageData(0,0,t.width,t.height).data},r.supported=t("mapbox-gl-supported"),r.hardwareConcurrency=n.navigator.hardwareConcurrency||4,Object.defineProperty(r,"devicePixelRatio",{get:function(){return n.devicePixelRatio}}),r.supportsWebp=!1;var a=n.document.createElement("img");a.onload=function(){r.supportsWebp=!0},a.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="},{"./window":112,"mapbox-gl-supported":193}],111:[function(t,e,r){"use strict";var n=t("webworkify"),i=t("../window"),o=i.URL.createObjectURL(new n(t("../../source/worker"),{bare:!0}));e.exports=function(){return new i.Worker(o)}},{"../../source/worker":57,"../window":112,webworkify:213}],112:[function(t,e,r){"use strict";e.exports=self},{}],113:[function(t,e,r){"use strict";function n(t,e){return e.area-t.area}var i=t("quickselect"),o=t("./util").calculateSignedArea;e.exports=function(t,e){var r=t.length;if(r<=1)return[t];for(var a,s,u=[],l=0;l1)for(var h=0;ht.y!=h.y>t.y&&t.x<(h.x-c.x)*(t.y-c.y)/(h.y-c.y)+c.x&&(r=!r),n=Math.min(n,l(t,c,h))}return(r?1:-1)*Math.sqrt(n)}function a(t){for(var e=0,r=0,n=0,o=t[0],a=0,s=o.length,u=s-1;al)&&(l=f.x),(!p||f.y>c)&&(c=f.y)}for(var d=l-o,m=c-u,y=Math.min(d,m),v=y/2,g=new s(null,n),_=o;_b.d&&(b=E,r&&console.log("found best %d after %d probes",Math.round(1e4*E.d)/1e4,w)),E.max-b.d<=e||(v=E.h/2,g.push(new i(E.p.x-v,E.p.y-v,v,t)),g.push(new i(E.p.x+v,E.p.y-v,v,t)),g.push(new i(E.p.x-v,E.p.y+v,v,t)),g.push(new i(E.p.x+v,E.p.y+v,v,t)),w+=4)}return r&&(console.log("num probes: "+w),console.log("best distance: "+b.d)),b.p}},{"./intersection_tests":122,"point-geometry":197,tinyqueue:202}],120:[function(t,e,r){"use strict";function n(t,e){this.stacks=t.readFields(i,[],e)}function i(t,e,r){if(1===t){var n=r.readMessage(o,{glyphs:{}});e.push(n)}}function o(t,e,r){if(1===t)e.name=r.readString();else if(2===t)e.range=r.readString();else if(3===t){var n=r.readMessage(a,{});e.glyphs[n.id]=n}}function a(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint())}e.exports=n},{}],121:[function(t,e,r){"use strict";function n(t,e,r){return t*(1-r)+e*r}e.exports=n,n.number=n,n.vec2=function(t,e,r){return[n(t[0],e[0],r),n(t[1],e[1],r)]},n.color=function(t,e,r){return[n(t[0],e[0],r),n(t[1],e[1],r),n(t[2],e[2],r),n(t[3],e[3],r)]},n.array=function(t,e,r){return t.map(function(t,i){return n(t,e[i],r)})}},{}],122:[function(t,e,r){"use strict";function n(t,e){for(var r=0;r=3)for(var u=0;u1){if(u(t,e))return!0;for(var n=0;n1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}function p(t,e){for(var r,n,i,o=!1,a=0;ae.y!=i.y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(o=!o)}return o}function f(t,e){for(var r=!1,n=0,i=t.length-1;ne.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(r=!r)}return r}var d=t("./util").isCounterClockwise;e.exports={multiPolygonIntersectsBufferedMultiPoint:i,multiPolygonIntersectsMultiPolygon:o,multiPolygonIntersectsBufferedMultiLine:a,polygonIntersectsPolygon:n,distToSegmentSquared:h}},{"./util":129}],123:[function(t,e,r){"use strict";var n={"Latin-1 Supplement":function(t){return t>=128&&t<=255},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};e.exports=n},{}],124:[function(t,e,r){"use strict";var n=function(t,e){this.max=t,this.onRemove=e,this.reset()};n.prototype.reset=function(){var t=this;for(var e in this.data)t.onRemove(t.data[e]);return this.data={},this.order=[],this},n.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 r=this.get(this.order[0]);r&&this.onRemove(r)}return this},n.prototype.has=function(t){return t in this.data},n.prototype.keys=function(){return this.order},n.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},n.prototype.remove=function(t){if(!this.has(t))return this;var e=this.data[t];return delete this.data[t],this.onRemove(e),this.order.splice(this.order.indexOf(t),1),this},n.prototype.setMaxSize=function(t){var e=this;for(this.max=t;this.order.length>this.max;){var r=e.get(e.order[0]);r&&e.onRemove(r)}return this},e.exports=n},{}],125:[function(t,e,r){"use strict";function n(t,e){var r=a(u.API_URL);if(t.protocol=r.protocol,t.authority=r.authority,!u.REQUIRE_ACCESS_TOKEN)return s(t);if(e=e||u.ACCESS_TOKEN,!e)throw new Error("An API access token is required to use Mapbox GL. "+c);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+c);return t.params.push("access_token="+e),s(t)}function i(t){return 0===t.indexOf("mapbox:")}function o(t){for(var e=0;e=2||512===r?"@2x":"",c=l.supportsWebp?".webp":"$1";return n.path=n.path.replace(h,""+u+c),o(n.params),s(n)};var p=/^(\w+):\/\/([^\/?]+)(\/[^?]+)?\??(.+)?/},{"./browser":110,"./config":114}],126:[function(t,e,r){"use strict";var n=t("./is_char_in_unicode_block");e.exports.allowsIdeographicBreaking=function(t){for(var e=0,n=t;e=65097&&t<=65103)||n["CJK Compatibility Ideographs"](t)||n["CJK Compatibility"](t)||n["CJK Radicals Supplement"](t)||n["CJK Strokes"](t)||!(!n["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||n["CJK Unified Ideographs Extension A"](t)||n["CJK Unified Ideographs"](t)||n["Enclosed CJK Letters and Months"](t)||n["Hangul Compatibility Jamo"](t)||n["Hangul Jamo Extended-A"](t)||n["Hangul Jamo Extended-B"](t)||n["Hangul Jamo"](t)||n["Hangul Syllables"](t)||n.Hiragana(t)||n["Ideographic Description Characters"](t)||n.Kanbun(t)||n["Kangxi Radicals"](t)||n["Katakana Phonetic Extensions"](t)||n.Katakana(t)&&12540!==t||!(!n["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!n["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||n["Unified Canadian Aboriginal Syllabics"](t)||n["Unified Canadian Aboriginal Syllabics Extended"](t)||n["Vertical Forms"](t)||n["Yijing Hexagram Symbols"](t)||n["Yi Syllables"](t)||n["Yi Radicals"](t)))},r.charHasNeutralVerticalOrientation=function(t){return!!(n["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||n["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||n["Letterlike Symbols"](t)||n["Number Forms"](t)||n["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||n["Control Pictures"](t)&&9251!==t||n["Optical Character Recognition"](t)||n["Enclosed Alphanumerics"](t)||n["Geometric Shapes"](t)||n["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||n["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||n["CJK Symbols and Punctuation"](t)||n.Katakana(t)||n["Private Use Area"](t)||n["CJK Compatibility Forms"](t)||n["Small Form Variants"](t)||n["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)},r.charHasRotatedVerticalOrientation=function(t){return!(r.charHasUprightVerticalOrientation(t)||r.charHasNeutralVerticalOrientation(t))}},{"./is_char_in_unicode_block":123}],127:[function(t,e,r){"use strict";function n(t){var e=JSON.stringify(t);if(y[e])return y[e];var r=void 0===t.alignment?1:t.alignment,n=0,a=0,u=["Uint8"],h=t.members.map(function(t){u.indexOf(t.type)<0&&u.push(t.type);var e=o(t.type),s=n=i(n,Math.max(r,e)),l=t.components||1;return a=Math.max(a,e),n+=e*l,{name:t.name,type:t.type,components:l,offset:s}}),f=i(n,Math.max(a,r)),d=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(p);d.prototype.alignment=r,d.prototype.size=f;for(var v=0,g=h;vthis.capacity){this.capacity=Math.max(t,Math.floor(this.capacity*d),f),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},m.prototype._refreshViews=function(){for(var t=this,e=0,r=this._usedTypes;e=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)},r.bezier=function(t,e,r,i){var o=new n(t,e,r,i);return function(t){return o.solve(t)}},r.ease=r.bezier(.25,.1,.25,1),r.clamp=function(t,e,r){return Math.min(r,Math.max(e,t))},r.wrap=function(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i},r.asyncAll=function(t,e,r){if(!t.length)return r(null,[]);var n=t.length,i=new Array(t.length),o=null;t.forEach(function(t,a){e(t,function(t,e){t&&(o=t),i[a]=e,0===--n&&r(o,i)})})},r.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},r.keysDifference=function(t,e){var r=[];for(var n in t)n in e||r.push(n);return r},r.extend=function(t,e,r,n){for(var i=arguments,o=1;o=0)return!0;return!1};var a={};r.warnOnce=function(t){a[t]||("undefined"!=typeof console&&console.warn(t),a[t]=!0)},r.isCounterClockwise=function(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)},r.calculateSignedArea=function(t){for(var e,r,n=0,i=0,o=t.length,a=o-1;i0||Math.abs(e.y-n.y)>0)&&Math.abs(r.calculateSignedArea(t))>.01},r.sphericalToCartesian=function(t){var e=t[0],r=t[1],n=t[2];return r+=90,r*=Math.PI/180,n*=Math.PI/180,[e*Math.cos(r)*Math.sin(n),e*Math.sin(r)*Math.sin(n),e*Math.cos(n)]},r.parseCacheControl=function(t){var e=/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,r={};if(t.replace(e,function(t,e,n,i){var o=n||i;return r[e]=!o||o.toLowerCase(),""}),r["max-age"]){var n=parseInt(r["max-age"],10);isNaN(n)?delete r["max-age"]:r["max-age"]=n}return r}},{"../geo/coordinate":18,"@mapbox/unitbezier":134,"point-geometry":197}],130:[function(t,e,r){"use strict";var n=function(t,e,r,n){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=r,t._y=n,this.properties=t.properties,null!=t.id&&(this.id=t.id)},i={geometry:{}};i.geometry.get=function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},i.geometry.set=function(t){this._geometry=t},n.prototype.toJSON=function(){var t=this,e={geometry:this.geometry};for(var r in this)"_geometry"!==r&&"_vectorTileFeature"!==r&&(e[r]=t[r]);return e},Object.defineProperties(n.prototype,i),e.exports=n},{}],131:[function(t,e,r){"use strict";var n=t("./script_detection");e.exports=function(t){for(var r="",i=0;i":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"}},{"./script_detection":126}],132:[function(t,e,r){"use strict";var n=t("./web_worker"),i=function(){this.active={}};i.prototype.acquire=function(e){var r=this;if(!this.workers){var i=t("../mapbox-gl").workerCount;for(this.workers=[];this.workers.lengthn)return n;for(;ro?r=i:n=i,i=.5*(n-r)+r}return i},n.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}},{}],135:[function(t,e,r){function n(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 o(t){return n("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function a(t){return i("%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))}function s(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}function u(t){var e=t.replace(/ /g,"").toLowerCase();if(e in l)return l[e].slice();if("#"===e[0]){if(4===e.length){var r=parseInt(e.substr(1),16);return r>=0&&r<=4095?[(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,1]:null}if(7===e.length){var r=parseInt(e.substr(1),16);return r>=0&&r<=16777215?[(16711680&r)>>16,(65280&r)>>8,255&r,1]:null}return null}var i=e.indexOf("("),u=e.indexOf(")");if(i!==-1&&u+1===e.length){var c=e.substr(0,i),h=e.substr(i+1,u-(i+1)).split(","),p=1;switch(c){case"rgba":if(4!==h.length)return null;p=a(h.pop());case"rgb":return 3!==h.length?null:[o(h[0]),o(h[1]),o(h[2]),p];case"hsla":if(4!==h.length)return null;p=a(h.pop());case"hsl":if(3!==h.length)return null;var f=(parseFloat(h[0])%360+360)%360/360,d=a(h[1]),m=a(h[2]),y=m<=.5?m*(d+1):m+d-m*d,v=2*m-y;return[n(255*s(v,y,f+1/3)),n(255*s(v,y,f)),n(255*s(v,y,f-1/3)),p];default:return null}}return null}var l={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{r.parseCSSColor=u}catch(t){}},{}],136:[function(t,e,r){"use strict";function n(t,e,r){r=r||2;var n=e&&e.length,o=n?e[0]*r:t.length,s=i(t,0,o,r,!0),u=[];if(!s)return u;var l,c,p,f,d,m,y;if(n&&(s=h(t,e,s,r)),t.length>80*r){l=p=t[0],c=f=t[1];for(var v=r;vp&&(p=d),m>f&&(f=m);y=Math.max(p-l,f-c)}return a(s,u,r,l,c,y),u}function i(t,e,r,n,i){var o,a;if(i===C(t,e,r,n)>0)for(o=e;o=e;o-=n)a=M(o,t[o],t[o+1],a);return a&&w(a,a.next)&&(P(a),a=a.next),a}function o(t,e){if(!t)return t;e||(e=t);var r,n=t;do if(r=!1,n.steiner||!w(n,n.next)&&0!==b(n.prev,n,n.next))n=n.next;else{if(P(n),n=e=n.prev,n===n.next)return null;r=!0}while(r||n!==e);return e}function a(t,e,r,n,i,h,p){if(t){!p&&h&&m(t,n,i,h);for(var f,d,y=t;t.prev!==t.next;)if(f=t.prev,d=t.next,h?u(t,n,i,h):s(t))e.push(f.i/r),e.push(t.i/r),e.push(d.i/r),P(t),t=d.next,y=d.next;else if(t=d,t===y){p?1===p?(t=l(t,e,r),a(t,e,r,n,i,h,2)):2===p&&c(t,e,r,n,i,h):a(o(t),e,r,n,i,h,1);break}}}function s(t){var e=t.prev,r=t,n=t.next;if(b(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(_(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&b(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function u(t,e,r,n){var i=t.prev,o=t,a=t.next;if(b(i,o,a)>=0)return!1;for(var s=i.xo.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,c=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=v(s,u,e,r,n),p=v(l,c,e,r,n),f=t.nextZ;f&&f.z<=p;){if(f!==t.prev&&f!==t.next&&_(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&b(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(f=t.prevZ;f&&f.z>=h;){if(f!==t.prev&&f!==t.next&&_(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&b(f.prev,f,f.next)>=0)return!1;f=f.prevZ}return!0}function l(t,e,r){var n=t;do{var i=n.prev,o=n.next.next;!w(i,o)&&E(i,n,n.next,o)&&S(i,o)&&S(o,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(o.i/r),P(n),P(n.next),n=t=o),n=n.next}while(n!==t);return n}function c(t,e,r,n,i,s){var u=t;do{for(var l=u.next.next;l!==u.prev;){if(u.i!==l.i&&x(u,l)){var c=A(u,l);return u=o(u,u.next),c=o(c,c.next),a(u,e,r,n,i,s),void a(c,e,r,n,i,s)}l=l.next}u=u.next}while(u!==t)}function h(t,e,r,n){var a,s,u,l,c,h=[];for(a=0,s=e.length;a=n.next.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>a){if(a=s,s===i){if(o===n.y)return n;if(o===n.next.y)return n.next}r=n.x=n.x&&n.x>=c&&_(or.x)&&S(n,t)&&(r=n,p=u)),n=n.next;return r}function m(t,e,r,n){var i=t;do null===i.z&&(i.z=v(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,y(i)}function y(t){var e,r,n,i,o,a,s,u,l=1;do{for(r=t,t=null,o=null,a=0;r;){for(a++,n=r,s=0,e=0;e0||u>0&&n;)0===s?(i=n,n=n.nextZ,u--):0!==u&&n?r.z<=n.z?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,u--):(i=r,r=r.nextZ,s--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;r=n}o.nextZ=null,l*=2}while(a>1);return t}function v(t,e,r,n,i){return t=32767*(t-r)/i,e=32767*(e-n)/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 g(t){var e=t,r=t;do e.x=0&&(t-a)*(n-s)-(r-a)*(e-s)>=0&&(r-a)*(o-s)-(i-a)*(n-s)>=0}function x(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!T(t,e)&&S(t,e)&&S(e,t)&&z(t,e)}function b(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function w(t,e){return t.x===e.x&&t.y===e.y}function E(t,e,r,n){return!!(w(t,e)&&w(r,n)||w(t,n)&&w(r,e))||b(t,e,r)>0!=b(t,e,n)>0&&b(r,n,t)>0!=b(r,n,e)>0}function T(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&E(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}function S(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 z(t,e){var r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do r.y>o!=r.next.y>o&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;while(r!==t);return n}function A(t,e){var r=new L(t.i,t.x,t.y),n=new L(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function M(t,e,r,n){var i=new L(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function P(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,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function C(t,e,r,n){for(var i=0,o=e,a=r-n;o0&&(n+=t[i-1].length,r.holes.push(n))}return r}},{}],137:[function(t,e,r){function n(t){var e,r,i,l,c,h;switch(typeof t){case"object":if(null===t)return null;if(o(t)){for(i="[",r=t.length-1,e=0;e-1&&(i+=n(t[e])),i+"]"}for(l=a(t).sort(),r=l.length,i="{",c=l[e=0],h=r>0&&void 0!==t[c];e15?"\\u00"+e.toString(16):"\\u000"+e.toString(16)}};e.exports=function(t){if(void 0!==t)return""+n(t)},e.exports.stringSearch=s,e.exports.stringReplace=u},{}],138:[function(t,e,r){"use strict";function n(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 r="=="===e?a(t[1],t[2],"===",!1):"!="===e?a(t[1],t[2],"!==",!1):"<"===e||">"===e||"<="===e||">="===e?a(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?u(t[1],t.slice(2)):"!in"===e?c(u(t[1],t.slice(2))):"has"===e?l(t[1]):"!has"===e?c(l([t[1]])):"true";return"("+r+")"}function o(t){return"$type"===t?"f.type":"$id"===t?"f.id":"p["+JSON.stringify(t)+"]"}function a(t,e,r,n){var i=o(t),a="$type"===t?p.indexOf(e):JSON.stringify(e);return(n?"typeof "+i+"=== typeof "+a+"&&":"")+i+r+a}function s(t,e){return t.map(i).join(e)}function u(t,e){"$type"===t&&(e=e.map(function(t){return p.indexOf(t)}));var r=JSON.stringify(e.sort(h)),n=o(t);return e.length<=200?r+".indexOf("+n+") !== -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; }("+n+", "+r+",0,"+(e.length-1)+")"}function l(t){return JSON.stringify(t)+" in p"}function c(t){return"!("+t+")"}function h(t,e){return te?1:0}e.exports=n;var p=["Unknown","Point","LineString","Polygon"]},{}],139:[function(t,e,r){function n(t){if("Polygon"===t.type)return i(t.coordinates);if("MultiPolygon"===t.type){for(var e=0,r=0;r0){e+=Math.abs(o(t[0]));for(var r=1;r2){for(var r,n,i=0;i=0}var l=t("geojson-area");e.exports=n},{"geojson-area":139}],141:[function(t,e,r){"use strict";function n(t,e,r,n,a,u,l,c){if(r/=e,n/=e,l>=r&&c<=n)return t;if(l>n||c=r&&d<=n)h.push(m);else if(!(f>n||d=e&&s<=r&&i.push(a)}return i}function o(t,e,r,n,i,o){for(var s=[],u=0;ur?(x.push(i(l,d,e),i(l,d,r)),o||(x=a(s,x,y,v,g))):f>=e&&x.push(i(l,d,e)):p>r?fr&&(x.push(i(l,d,r)),o||(x=a(s,x,y,v,g))));l=m[_-1],p=l[n],p>=e&&p<=r&&x.push(l),h=x[x.length-1],o&&h&&(x[0][0]!==h[0]||x[0][1]!==h[1])&&x.push(x[0]),a(s,x,y,v,g)}return s}function a(t,e,r,n,i){return e.length&&(e.area=r,e.dist=n,void 0!==i&&(e.outer=i),t.push(e)),[]}e.exports=n;var s=t("./feature")},{"./feature":143}],142:[function(t,e,r){"use strict";function n(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n1?1:n,[r,n,0]}function s(t){for(var e,r,n=0,i=0,o=0;o1)return!1;var o=i.geometry[0].length;if(5!==o)return!1;for(var a=0;a1&&console.time("creation"),_=this.tiles[g]=d(t,v,r,n,x,e===f.maxZoom),this.tileCoords.push({z:e,x:r,y:n}),m)){m>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,_.numFeatures,_.numPoints,_.numSimplified),console.timeEnd("creation"));var b="z"+e;this.stats[b]=(this.stats[b]||0)+1,this.total++}if(_.source=t,i){if(e===f.maxZoom||e===i)continue;var w=1<1&&console.time("clipping");var E,T,S,z,A,M,P=.5*f.buffer/f.extent,L=.5-P,C=.5+P,k=1+P;E=T=S=z=null,A=p(t,v,r-P,r+C,0,a,_.min[0],_.max[0]),M=p(t,v,r+L,r+k,0,a,_.min[0],_.max[0]),A&&(E=p(A,v,n-P,n+C,1,s,_.min[1],_.max[1]),T=p(A,v,n+L,n+k,1,s,_.min[1],_.max[1])),M&&(S=p(M,v,n-P,n+C,1,s,_.min[1],_.max[1]),z=p(M,v,n+L,n+k,1,s,_.min[1],_.max[1])),m>1&&console.timeEnd("clipping"),t.length&&(h.push(E||[],e+1,2*r,2*n),h.push(T||[],e+1,2*r,2*n+1),h.push(S||[],e+1,2*r+1,2*n),h.push(z||[],e+1,2*r+1,2*n+1))}else i&&(y=e)}return y},i.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,a=n.debug,s=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var c,p=t,f=e,d=r;!c&&p>0;)p--,f=Math.floor(f/2),d=Math.floor(d/2),c=this.tiles[o(p,f,d)];if(!c||!c.source)return null;if(a>1&&console.log("found parent tile z%d-%d-%d",p,f,d),l(c,i,n.buffer))return h.tile(c,i);a>1&&console.time("drilling down");var m=this.splitTile(c.source,p,f,d,t,e,r); +if(a>1&&console.timeEnd("drilling down"),null!==m){var y=1<n&&(a=r,n=o);n>s?(t[a][2]=n,h.push(l),h.push(a),l=a):(c=h.pop(),l=h.pop())}}function i(t,e,r){var n=e[0],i=e[1],o=r[0],a=r[1],s=t[0],u=t[1],l=o-n,c=a-i;if(0!==l||0!==c){var h=((s-n)*l+(u-i)*c)/(l*l+c*c);h>1?(n=o,i=a):h>0&&(n+=l*h,i+=c*h)}return l=s-n,c=u-i,l*l+c*c}e.exports=n},{}],146:[function(t,e,r){"use strict";function n(t,e,r,n,o,a){for(var s={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:n,z2:e,transformed:!1,min:[2,1],max:[-1,0]},u=0;us.max[0]&&(s.max[0]=c[0]),c[1]>s.max[1]&&(s.max[1]=c[1])}return s}function i(t,e,r,n){var i,a,s,u,l=e.geometry,c=e.type,h=[],p=r*r;if(1===c)for(i=0;ip)&&(f.push(u),t.numSimplified++),t.numPoints++;3===c&&o(f,s.outer),h.push(f)}else t.numPoints+=s.length;if(h.length){var d={geometry:h,type:c,tags:e.tags||null};null!==e.id&&(d.id=e.id),t.features.push(d)}}function o(t,e){var r=a(t);r<0===e&&t.reverse()}function a(t){for(var e,r,n=0,i=0,o=t.length,a=o-1;i=l[p+0]&&n>=l[p+1]?(a[h]=!0,o.push(u[h])):a[h]=!1}}},n.prototype._forEachCell=function(t,e,r,n,i,o,a){for(var s=this._convertToCellCoord(t),u=this._convertToCellCoord(e),l=this._convertToCellCoord(r),c=this._convertToCellCoord(n),h=s;h<=l;h++)for(var p=u;p<=c;p++){var f=this.d*p+h;if(i.call(this,t,e,r,n,f,o,a))return}},n.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},n.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=i+this.cells.length+1+1,r=0,n=0;n>1,c=-7,h=r?i-1:0,p=r?-1:1,f=t[e+h];for(h+=p,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=256*o+t[e+h],h+=p,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+t[e+h],h+=p,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:(f?-1:1)*(1/0);a+=Math.pow(2,n),o-=l}return(f?-1:1)*a*Math.pow(2,o-n)},r.write=function(t,e,r,n,i,o){var a,s,u,l=8*o-i-1,c=(1<>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,d=n?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,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),e+=a+h>=1?p/u:p*Math.pow(2,1-h),e*u>=2&&(a++,u/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(e*u-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[r+f]=255&s,f+=d,s/=256,i-=8);for(a=a<0;t[r+f]=255&a,f+=d,a/=256,l-=8);t[r+f-d]|=128*m}},{}],151:[function(t,e,r){"use strict";function n(t,e,r,n,o){return new i(t,e,r,n,o)}function i(t,e,r,n,i){e=e||o,r=r||a,i=i||Array,this.nodeSize=n||64,this.points=t,this.ids=new i(t.length),this.coords=new i(2*t.length);for(var u=0;u=r&&s<=i&&u>=n&&u<=o&&c.push(t[d]);else{var m=Math.floor((f+p)/2);s=e[2*m],u=e[2*m+1],s>=r&&s<=i&&u>=n&&u<=o&&c.push(t[m]);var y=(h+1)%2;(0===h?r<=s:n<=u)&&(l.push(f),l.push(m-1),l.push(y)),(0===h?i>=s:o>=u)&&(l.push(m+1),l.push(p),l.push(y))}}return c}e.exports=n},{}],153:[function(t,e,r){"use strict";function n(t,e,r,o,a,s){if(!(a-o<=r)){var u=Math.floor((o+a)/2);i(t,e,u,o,a,s%2),n(t,e,r,o,u-1,s+1),n(t,e,r,u+1,a,s+1)}}function i(t,e,r,n,a,s){for(;a>n;){if(a-n>600){var u=a-n+1,l=r-n+1,c=Math.log(u),h=.5*Math.exp(2*c/3),p=.5*Math.sqrt(c*h*(u-h)/u)*(l-u/2<0?-1:1),f=Math.max(n,Math.floor(r-l*h/u+p)),d=Math.min(a,Math.floor(r+(u-l)*h/u+p));i(t,e,r,f,d,s)}var m=e[2*r+s],y=n,v=a;for(o(t,e,n,r),e[2*a+s]>m&&o(t,e,n,a);ym;)v--}e[2*n+s]===m?o(t,e,n,v):(v++,o(t,e,v,a)),v<=r&&(n=v+1),r<=v&&(a=v-1)}}function o(t,e,r,n){a(t,r,n),a(e,2*r,2*n),a(e,2*r+1,2*n+1)}function a(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}e.exports=n},{}],154:[function(t,e,r){"use strict";function n(t,e,r,n,o,a){for(var s=[0,t.length-1,0],u=[],l=o*o;s.length;){var c=s.pop(),h=s.pop(),p=s.pop();if(h-p<=a)for(var f=p;f<=h;f++)i(e[2*f],e[2*f+1],r,n)<=l&&u.push(t[f]);else{var d=Math.floor((p+h)/2),m=e[2*d],y=e[2*d+1];i(m,y,r,n)<=l&&u.push(t[d]);var v=(c+1)%2;(0===c?r-o<=m:n-o<=y)&&(s.push(p),s.push(d-1),s.push(v)),(0===c?r+o>=m:n+o>=y)&&(s.push(d+1),s.push(h),s.push(v))}}return u}function i(t,e,r,n){var i=t-r,o=e-n;return i*i+o*o}e.exports=n},{}],155:[function(t,e,r){function n(t){return!!t&&"object"==typeof t}function i(t,e){for(var r=-1,n=t.length;++rl))return!1;for(;++u-1&&t%1==0&&t<=c}function u(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function l(t){return!!t&&"object"==typeof t}var c=9007199254740991,h="[object Arguments]",p="[object Function]",f="[object GeneratorFunction]",d=Object.prototype,m=d.hasOwnProperty,y=d.toString,v=d.propertyIsEnumerable;e.exports=n},{}],159:[function(t,e,r){function n(t){return!!t&&"object"==typeof t}function i(t,e){var r=null==t?void 0:t[e];return u(r)?r:void 0}function o(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=g}function a(t){return s(t)&&m.call(t)==c}function s(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function u(t){return null!=t&&(a(t)?y.test(f.call(t)):n(t)&&h.test(t))}var l="[object Array]",c="[object Function]",h=/^\[object .+?Constructor\]$/,p=Object.prototype,f=Function.prototype.toString,d=p.hasOwnProperty,m=p.toString,y=RegExp("^"+f.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),v=i(Array,"isArray"),g=9007199254740991,_=v||function(t){return n(t)&&o(t.length)&&m.call(t)==l};e.exports=_},{}],160:[function(t,e,r){function n(t,e,r,n){r="function"==typeof r?o(r,n,3):void 0;var a=r?r(t,e):void 0;return void 0===a?i(t,e,r):!!a}var i=t("lodash._baseisequal"),o=t("lodash._bindcallback");e.exports=n},{"lodash._baseisequal":155,"lodash._bindcallback":156}],161:[function(t,e,r){function n(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=a}function i(t){return!!t&&"object"==typeof t}function o(t){return i(t)&&n(t.length)&&!!C[I.call(t)]}var a=9007199254740991,s="[object Arguments]",u="[object Array]",l="[object Boolean]",c="[object Date]",h="[object Error]",p="[object Function]",f="[object Map]",d="[object Number]",m="[object Object]",y="[object RegExp]",v="[object Set]",g="[object String]",_="[object WeakMap]",x="[object ArrayBuffer]",b="[object DataView]",w="[object Float32Array]",E="[object Float64Array]",T="[object Int8Array]",S="[object Int16Array]",z="[object Int32Array]",A="[object Uint8Array]",M="[object Uint8ClampedArray]",P="[object Uint16Array]",L="[object Uint32Array]",C={};C[w]=C[E]=C[T]=C[S]=C[z]=C[A]=C[M]=C[P]=C[L]=!0,C[s]=C[u]=C[x]=C[l]=C[b]=C[c]=C[h]=C[p]=C[f]=C[d]=C[m]=C[y]=C[v]=C[g]=C[_]=!1;var k=Object.prototype,I=k.toString;e.exports=o},{}],162:[function(t,e,r){function n(t){return function(e){return null==e?void 0:e[t]}}function i(t){return null!=t&&a(g(t))}function o(t,e){return t="number"==typeof t||f.test(t)?+t:-1,e=null==e?v:e,t>-1&&t%1==0&&t-1&&t%1==0&&t<=v}function s(t){for(var e=l(t),r=e.length,n=r&&t.length,i=!!n&&a(n)&&(p(t)||h(t)),s=-1,u=[];++s0;++nv?Math.pow(t,1/3):t/y+d}function i(t){return t>m?t*t*t:y*(t-d)}function o(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function a(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function s(t){var e=a(t[0]),r=a(t[1]),i=a(t[2]),o=n((.4124564*e+.3575761*r+.1804375*i)/h),s=n((.2126729*e+.7151522*r+.072175*i)/p),u=n((.0193339*e+.119192*r+.9503041*i)/f);return[116*s-16,500*(o-s),200*(s-u),t[3]]}function u(t){var e=(t[0]+16)/116,r=isNaN(t[1])?e:e+t[1]/500,n=isNaN(t[2])?e:e-t[2]/200;return e=p*i(e),r=h*i(r),n=f*i(n),[o(3.2404542*r-1.5371385*e-.4985314*n),o(-.969266*r+1.8760108*e+.041556*n),o(.0556434*r-.2040259*e+1.0572252*n),t[3]]}function l(t){var e=s(t),r=e[0],n=e[1],i=e[2],o=Math.atan2(i,n)*_;return[o<0?o+360:o,Math.sqrt(n*n+i*i),r,t[3]]}function c(t){var e=t[0]*g,r=t[1],n=t[2];return u([n,Math.cos(e)*r,Math.sin(e)*r,t[3]])}var h=.95047,p=1,f=1.08883,d=4/29,m=6/29,y=3*m*m,v=m*m*m,g=Math.PI/180,_=180/Math.PI;e.exports={lab:{forward:s,reverse:u},hcl:{forward:l,reverse:c}}},{}],164:[function(t,e,r){"use strict";function n(t){return t}function i(t,e){var r;if(p(t)){var l,c=t.stops&&"object"==typeof t.stops[0][0],h=c||void 0!==t.property,d=c||!h,m=t.stops&&typeof(c?t.stops[0][0].property:t.stops[0][0]),y=t.type||e||("string"===m?"categorical":"exponential");if("exponential"===y)l=s;else if("interval"===y)l=a;else if("categorical"===y)l=o;else{if("identity"!==y)throw new Error('Unknown function type "'+y+'"');l=u}var v;if(t.colorSpace&&"rgb"!==t.colorSpace){if(!f[t.colorSpace])throw new Error("Unknown color space: "+t.colorSpace);var g=f[t.colorSpace];t=JSON.parse(JSON.stringify(t));for(var _=0;_=t.stops.length)&&!(e<=t.stops[n][0]);)n++;return 0===n?t.stops[n][1]:n===t.stops.length?t.stops[n-1][1]:l(e,r,t.stops[n-1][0],t.stops[n][0],t.stops[n-1][1],t.stops[n][1])}function u(t,e){return e}function l(t,e,r,n,i,o){return"function"==typeof i?function(){var a=i.apply(void 0,arguments),s=o.apply(void 0,arguments);return l(t,e,r,n,a,s)}:i.length?h(t,e,r,n,i,o):c(t,e,r,n,i,o)}function c(t,e,r,n,i,o){var a,s=n-r,u=t-r;return a=1===e?u/s:(Math.pow(e,u)-1)/(Math.pow(e,s)-1),i*(1-a)+o*a}function h(t,e,r,n,i,o){for(var a=[],s=0;s7)return[new n(c,u,"constants have been deprecated as of v8")];if(!(u in p.constants))return[new n(c,u,'constant "%s" not found',u)];e=o({},e,{value:p.constants[u]})}return l.function&&"object"===i(u)?r(e):l.type&&s[l.type]?s[l.type](e):a(o({},e,{valueSpec:l.type?h[l.type]:l}))}},{"../error/validation_error":167,"../util/extend":169,"../util/get_type":170,"./validate_array":174,"./validate_boolean":175,"./validate_color":176,"./validate_constants":177,"./validate_enum":178,"./validate_filter":179,"./validate_function":180,"./validate_layer":182,"./validate_light":184,"./validate_number":185,"./validate_object":186,"./validate_source":188,"./validate_string":189}],174:[function(t,e,r){"use strict";var n=t("../util/get_type"),i=t("./validate"),o=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.valueSpec,a=t.style,s=t.styleSpec,u=t.key,l=t.arrayElementValidator||i;if("array"!==n(e))return[new o(u,e,"array expected, %s found",n(e))];if(r.length&&e.length!==r.length)return[new o(u,e,"array length %d expected, length %d found",r.length,e.length)];if(r["min-length"]&&e.length7)return r?[new n(e,r,"constants have been deprecated as of v8")]:[];var a=i(r);if("object"!==a)return[new n(e,r,"object expected, %s found",a)];var s=[];for(var u in r)"@"!==u[0]&&s.push(new n(e+"."+u,r[u],'constants must start with "@"'));return s}},{"../error/validation_error":167,"../util/get_type":170}],178:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint");e.exports=function(t){var e=t.key,r=t.value,o=t.valueSpec,a=[];return Array.isArray(o.values)?o.values.indexOf(i(r))===-1&&a.push(new n(e,r,"expected one of [%s], %s found",o.values.join(", "),r)):Object.keys(o.values).indexOf(i(r))===-1&&a.push(new n(e,r,"expected one of [%s], %s found",Object.keys(o.values).join(", "),r)),a}},{"../error/validation_error":167,"../util/unbundle_jsonlint":172}],179:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("./validate_enum"),o=t("../util/get_type"),a=t("../util/unbundle_jsonlint");e.exports=function t(e){var r,s=e.value,u=e.key,l=e.styleSpec,c=[];if("array"!==o(s))return[new n(u,s,"array expected, %s found",o(s))];if(s.length<1)return[new n(u,s,"filter array must have at least 1 element")];switch(c=c.concat(i({key:u+"[0]",value:s[0],valueSpec:l.filter_operator,style:e.style,styleSpec:e.styleSpec})),a(s[0])){case"<":case"<=":case">":case">=":s.length>=2&&"$type"==s[1]&&c.push(new n(u,s,'"$type" cannot be use with operator "%s"',s[0]));case"==":case"!=":3!=s.length&&c.push(new n(u,s,'filter array for operator "%s" must have 3 elements',s[0]));case"in":case"!in":s.length>=2&&(r=o(s[1]),"string"!==r?c.push(new n(u+"[1]",s[1],"string expected, %s found",r)):"@"===s[1][0]&&c.push(new n(u+"[1]",s[1],"filter key cannot be a constant")));for(var h=2;hl(r[0].zoom))return[new n(s,r[0].zoom,"stop zoom values must appear in ascending order")];l(r[0].zoom)!==f&&(f=l(r[0].zoom),p=void 0),e=e.concat(a({key:s+"[0]",value:r[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:u,value:c}}))}else e=e.concat(c({key:s+"[0]",value:r[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec}));return e=e.concat(o({key:s+"[1]",value:r[1],valueSpec:d,style:t.style,styleSpec:t.styleSpec})),"number"===i(r[0])&&"piecewise-constant"===d.function&&r[0]%1!==0&&e.push(new n(s+"[0]",r[0],"zoom level for piecewise-constant functions must be an integer")),e}function c(t){var e=i(t.value),r=l(t.value);if(h){if(e!==h)return[new n(t.key,t.value,"%s stop domain type must match previous stop domain type %s",e,h)]}else h=e,m||"string"!==e||(m="categorical");return"number"!==e&&"string"!==e?[new n(t.key,t.value,"property value must be a number or string")]:"number"!==e&&"categorical"!==m?[new n(t.key,t.value,"number expected, %s found",e)]:"categorical"!==m||"number"!==e||isFinite(r)&&Math.floor(r)===r?"number"===e&&void 0!==p&&r=8&&(g&&!t.valueSpec["property-function"]?x.push(new n(t.key,t.value,"property functions not supported")):v&&!t.valueSpec["zoom-function"]&&x.push(new n(t.key,t.value,"zoom functions not supported"))),"categorical"!==m&&!_||void 0!==t.value.property||x.push(new n(t.key,t.value,'"property" property is required')),x}},{"../error/validation_error":167,"../util/get_type":170,"../util/unbundle_jsonlint":172,"./validate":173,"./validate_array":174,"./validate_number":185,"./validate_object":186}],181:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("./validate_string");e.exports=function(t){var e=t.value,r=t.key,o=i(t);return o.length?o:(e.indexOf("{fontstack}")===-1&&o.push(new n(r,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&o.push(new n(r,e,'"glyphs" url must include a "{range}" token')),o)}},{"../error/validation_error":167,"./validate_string":189}],182:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint"),o=t("./validate_object"),a=t("./validate_filter"),s=t("./validate_paint_property"),u=t("./validate_layout_property"),l=t("../util/extend");e.exports=function(t){var e=[],r=t.value,c=t.key,h=t.style,p=t.styleSpec;r.type||r.ref||e.push(new n(c,r,'either "type" or "ref" is required'));var f=i(r.type),d=i(r.ref);if(r.id)for(var m=0;mo.maximum?[new i(e,r,"%s is greater than the maximum value %s",r,o.maximum)]:[]}},{"../error/validation_error":167,"../util/get_type":170}],186:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/get_type"),o=t("./validate");e.exports=function(t){var e=t.key,r=t.value,a=t.valueSpec||{},s=t.objectElementValidators||{},u=t.style,l=t.styleSpec,c=[],h=i(r);if("object"!==h)return[new n(e,r,"object expected, %s found",h)];for(var p in r){var f,d=p.split(".")[0],m=a[d]||a["*"];if(s[d])f=s[d];else if(a[d])f=o;else if(s["*"])f=s["*"];else{if(!a["*"]){c.push(new n(e,r[p],'unknown property "%s"',p));continue}f=o}c=c.concat(f({key:(e?e+".":e)+p,value:r[p],valueSpec:m,style:u,styleSpec:l,object:r,objectKey:p}))}for(d in a)a[d].required&&void 0===a[d].default&&void 0===r[d]&&c.push(new n(e,r,'missing required property "%s"',d));return c}},{"../error/validation_error":167,"../util/get_type":170,"./validate":173}],187:[function(t,e,r){"use strict";var n=t("./validate"),i=t("../error/validation_error");e.exports=function(t){var e=t.key,r=t.style,o=t.styleSpec,a=t.value,s=t.objectKey,u=o["paint_"+t.layerType];if(!u)return[];var l=s.match(/^(.*)-transition$/);return l&&u[l[1]]&&u[l[1]].transition?n({key:e,value:a,valueSpec:o.transition,style:r,styleSpec:o}):t.valueSpec||u[s]?n({key:t.key,value:a,valueSpec:t.valueSpec||u[s],style:r,styleSpec:o}):[new i(e,a,'unknown property "%s"',s)]}},{"../error/validation_error":167,"./validate":173}],188:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint"),o=t("./validate_object"),a=t("./validate_enum");e.exports=function(t){var e=t.value,r=t.key,s=t.styleSpec,u=t.style;if(!e.type)return[new n(r,e,'"type" is required')];var l=i(e.type);switch(l){case"vector":case"raster":var c=[];if(c=c.concat(o({key:r,value:e,valueSpec:s.source_tile,style:t.style,styleSpec:s})),"url"in e)for(var h in e)["type","url","tileSize"].indexOf(h)<0&&c.push(new n(r+"."+h,e[h],'a source with a "url" property may not include a "%s" property',h));return c;case"geojson":return o({key:r,value:e,valueSpec:s.source_geojson,style:u,styleSpec:s});case"video":return o({key:r,value:e,valueSpec:s.source_video,style:u,styleSpec:s});case"image":return o({key:r,value:e,valueSpec:s.source_image,style:u,styleSpec:s});case"canvas":return o({key:r,value:e,valueSpec:s.source_canvas,style:u,styleSpec:s});default:return a({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","geojson","video","image","canvas"]},style:u,styleSpec:s})}}},{"../error/validation_error":167,"../util/unbundle_jsonlint":172,"./validate_enum":178,"./validate_object":186}],189:[function(t,e,r){"use strict";var n=t("../util/get_type"),i=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.key,o=n(e);return"string"!==o?[new i(r,e,"string expected, %s found",o)]:[]}},{"../error/validation_error":167,"../util/get_type":170}],190:[function(t,e,r){"use strict";function n(t,e){e=e||u;var r=[];return r=r.concat(s({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:l,"*":function(){return[]}}})),e.$version>7&&t.constants&&(r=r.concat(a({key:"constants",value:t.constants,style:t,styleSpec:e}))),i(r)}function i(t){return[].concat(t).sort(function(t,e){return t.line-e.line})}function o(t){return function(){return i(t.apply(this,arguments))}}var a=t("./validate/validate_constants"),s=t("./validate/validate"),u=t("../reference/latest.min"),l=t("./validate/validate_glyphs_url");n.source=o(t("./validate/validate_source")),n.light=o(t("./validate/validate_light")),n.layer=o(t("./validate/validate_layer")),n.filter=o(t("./validate/validate_filter")),n.paintProperty=o(t("./validate/validate_paint_property")),n.layoutProperty=o(t("./validate/validate_layout_property")),e.exports=n},{"../reference/latest.min":191,"./validate/validate":173,"./validate/validate_constants":177,"./validate/validate_filter":179,"./validate/validate_glyphs_url":181,"./validate/validate_layer":182,"./validate/validate_layout_property":183,"./validate/validate_light":184,"./validate/validate_paint_property":187,"./validate/validate_source":188}],191:[function(t,e,r){e.exports=t("./v8.min.json")},{"./v8.min.json":192}],192:[function(t,e,r){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"},light:{type:"light"},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_canvas"],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:18},buffer:{type:"number",default:128,maximum:512,minimum:0},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},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"}}},source_canvas:{type:{required:!0,type:"enum",values:{canvas:{}}},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}},animate:{type:"boolean",default:"true"},canvas:{type:"string",required:!0}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},"fill-extrusion":{},raster:{},background:{}}},metadata:{type:"*"},ref:{type:"string"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"},"paint.*":{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_fill-extrusion","layout_symbol","layout_raster","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},layout_fill:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},layout_circle:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},layout_line:{"line-cap":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{butt:{},round:{},square:{}},default:"butt"},"line-join":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{bevel:{},round:{},miter:{}},default:"miter"},"line-miter-limit":{type:"number",default:2,function:"interpolated","zoom-function":!0,requires:[{"line-join":"miter"}]},"line-round-limit":{type:"number",default:1.05,function:"interpolated","zoom-function":!0,requires:[{"line-join":"round"}]},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},layout_symbol:{"symbol-placement":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{point:{},line:{}},default:"point"},"symbol-spacing":{type:"number",default:250,minimum:1,function:"interpolated","zoom-function":!0,units:"pixels",requires:[{"symbol-placement":"line"}]},"symbol-avoid-edges":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1},"icon-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,requires:["icon-image"]},"icon-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,requires:["icon-image"]},"icon-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,requires:["icon-image","text-field"]},"icon-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"]},"icon-size":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,requires:["icon-image"]},"icon-text-fit":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{none:{},width:{},height:{},both:{}},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,requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}]},"icon-image":{type:"string",function:"piecewise-constant","zoom-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,units:"pixels",requires:["icon-image"]},"icon-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-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,values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"]},"text-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"]},"text-field":{type:"string",function:"piecewise-constant","zoom-function":!0,default:"",tokens:!0},"text-font":{type:"array",value:"string",function:"piecewise-constant","zoom-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,requires:["text-field"]},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",function:"interpolated","zoom-function":!0,requires:["text-field"]},"text-line-height":{type:"number",default:1.2,units:"ems",function:"interpolated","zoom-function":!0,requires:["text-field"]},"text-letter-spacing":{type:"number",default:0,units:"ems",function:"interpolated","zoom-function":!0,requires:["text-field"]},"text-justify":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{left:{},center:{},right:{}},default:"center",requires:["text-field"]},"text-anchor":{type:"enum",function:"piecewise-constant","zoom-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,requires:["text-field",{"symbol-placement":"line"}]},"text-rotate":{type:"number",default:0,period:360,units:"degrees",function:"interpolated","zoom-function":!0,requires:["text-field"]},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,requires:["text-field"]},"text-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":"line"}]},"text-transform":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"]},"text-offset":{type:"array",value:"number",units:"ems",function:"interpolated","zoom-function":!0,length:2,default:[0,0],requires:["text-field"]},"text-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,requires:["text-field"]},"text-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,requires:["text-field"]},"text-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,requires:["text-field","icon-image"]},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},layout_raster:{visibility:{type:"enum",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:{}}},function:{stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"}},function_stop:{type:"array",minimum:0,maximum:22,value:["number","color"],length:2},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},transition:!1},position:{type:"array",default:[1.15,210,30],length:3,value:"number",transition:!0,function:"interpolated","zoom-function":!0,"property-function":!1},color:{type:"color",default:"#ffffff",function:"interpolated","zoom-function":!0,"property-function":!1,transition:!0},intensity:{type:"number",default:.5,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!1,transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_fill-extrusion","paint_symbol","paint_raster","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",function:"piecewise-constant","zoom-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,transition:!0,units:"pixels"},"fill-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["fill-translate"]},"fill-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!1,default:1,minimum:0,maximum:1,transition:!0},"fill-extrusion-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-extrusion-pattern"}]},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels"},"fill-extrusion-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"]},"fill-extrusion-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0},"fill-extrusion-height":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:0,minimum:0,units:"meters",transition:!0},"fill-extrusion-base":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"]}},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,transition:!0,units:"pixels"},"line-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["line-translate"]},"line-width":{type:"number",default:1,minimum:0,function:"interpolated","zoom-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,minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}]},"line-pattern":{type:"string",function:"piecewise-constant","zoom-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,transition:!0,units:"pixels"},"circle-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["circle-translate"]},"circle-pitch-scale":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map"},"circle-stroke-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-stroke-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0,requires:["icon-image"]},"icon-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-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,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-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,transition:!0,requires:["text-field"]},"text-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,transition:!0,requires:["text-field"]},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,transition:!0,requires:["text-field"]},"text-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-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,transition:!0,units:"pixels",requires:["text-field"]},"text-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-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"}}}},{}],193:[function(t,e,r){"use strict";function n(t){return!!(i()&&o()&&a()&&s()&&u()&&l()&&c()&&h(t&&t.failIfMajorPerformanceCaveat))}function i(){return"undefined"!=typeof window&&"undefined"!=typeof document}function o(){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 a(){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 u(){return"JSON"in window&&"parse"in JSON&&"stringify"in JSON}function l(){return"Worker"in window}function c(){return"Uint8ClampedArray"in window}function h(t){return void 0===f[t]&&(f[t]=p(t)),f[t]}function p(t){var e=document.createElement("canvas"),r=Object.create(n.webGLContextAttributes);return r.failIfMajorPerformanceCaveat=t,e.probablySupportsContext?e.probablySupportsContext("webgl",r)||e.probablySupportsContext("experimental-webgl",r):e.supportsContext?e.supportsContext("webgl",r)||e.supportsContext("experimental-webgl",r):e.getContext("webgl",r)||e.getContext("experimental-webgl",r)}"undefined"!=typeof e&&e.exports?e.exports=n:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=n);var f={};n.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}},{}],194:[function(t,e,r){(function(t){function e(t,e){for(var r=0,n=t.length-1;n>=0;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function n(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;n=-1&&!i;o--){var a=o>=0?arguments[o]:t.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(r=a+"/"+r,i="/"===a.charAt(0))}return r=e(n(r.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+r||"."},r.normalize=function(t){var i=r.isAbsolute(t),o="/"===a(t,-1);return t=e(n(t.split("/"),function(t){return!!t}),!i).join("/"),t||i||(t="."),t&&o&&(t+="/"),(i?"/":"")+t},r.isAbsolute=function(t){return"/"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(n(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},r.relative=function(t,e){function n(t){for(var e=0;e=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=r.resolve(t).substr(1),e=r.resolve(e).substr(1);for(var i=n(t.split("/")),o=n(e.split("/")),a=Math.min(i.length,o.length),s=a,u=0;u55295&&e<57344){if(!r){e>56319||o+1===n?i.push(239,191,189):r=e;continue}if(e<56320){i.push(239,191,189),r=e;continue}e=r-55296<<10|e-56320|65536,r=null}else r&&(i.push(239,191,189),r=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=n;var o,a,s,u=t("ieee754");o={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 u.read(this,t,!0,23,4)},readDoubleLE:function(t){return u.read(this,t,!0,52,8)},writeFloatLE:function(t,e){return u.write(this,t,e,!0,23,4)},writeDoubleLE:function(t,e){return u.write(this,t,e,!0,52,8)},toString:function(t,e,r){var n="",i="";e=e||0,r=Math.min(this.length,r||this.length);for(var o=e;o=1;){if(e.pos>=r)throw new Error("Given varint doesn't fit into 10 bytes");var n=255&t;e.buf[e.pos++]=n|(t>=128?128:0),t/=128}}function a(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.ceil(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function s(t,e){for(var r=0;r>3,o=this.pos;t(i,e,this),this.pos===o&&this.skip(n)}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,r=this.buf;return e=r[this.pos++],t=127&e,e<128?t:(e=r[this.pos++],t|=(127&e)<<7,e<128?t:(e=r[this.pos++],t|=(127&e)<<14,e<128?t:(e=r[this.pos++],t|=(127&e)<<21,e<128?t:i(t,this))))},readVarint64:function(){var t=this.pos,e=this.readVarint();if(e<_)return e;for(var r=this.pos-2;255===this.buf[r];)r--;r127;);else if(e===n.Bytes)this.pos=this.readVarint()+this.pos;else if(e===n.Fixed32)this.pos+=4;else{if(e!==n.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 o(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=y.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 r=0;r=128&&a(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,n.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){this.writeMessage(t,s,e)},writePackedSVarint:function(t,e){this.writeMessage(t,u,e)},writePackedBoolean:function(t,e){this.writeMessage(t,h,e)},writePackedFloat:function(t,e){this.writeMessage(t,l,e)},writePackedDouble:function(t,e){this.writeMessage(t,c,e)},writePackedFixed32:function(t,e){this.writeMessage(t,p,e)},writePackedSFixed32:function(t,e){this.writeMessage(t,f,e)},writePackedFixed64:function(t,e){this.writeMessage(t,d,e)},writePackedSFixed64:function(t,e){this.writeMessage(t,m,e)},writeBytesField:function(t,e){this.writeTag(t,n.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,n.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,n.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,n.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}}).call(this,"undefined"!=typeof r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./buffer":195}],197:[function(t,e,r){"use strict";function n(t,e){this.x=t,this.y=e}e.exports=n,n.prototype={clone:function(){return new n(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,r=t.y-this.y;return e*e+r*r},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,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,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),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t}},{}],198:[function(t,e,r){function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function o(t){if(h===setTimeout)return setTimeout(t,0);if((h===n||!h)&&setTimeout)return h=setTimeout,setTimeout(t,0);try{return h(t,0)}catch(e){try{return h.call(null,t,0)}catch(e){return h.call(this,t,0)}}}function a(t){if(p===clearTimeout)return clearTimeout(t);if((p===i||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(t);try{return p(t)}catch(e){try{return p.call(null,t)}catch(e){return p.call(this,t)}}}function s(){y&&d&&(y=!1,d.length?m=d.concat(m):v=-1,m.length&&u())}function u(){if(!y){var t=o(s);y=!0;for(var e=m.length;e;){for(d=m,m=[];++v1)for(var r=1;rr;){if(a-r>600){var u=a-r+1,l=e-r+1,c=Math.log(u),h=.5*Math.exp(2*c/3),p=.5*Math.sqrt(c*h*(u-h)/u)*(l-u/2<0?-1:1),f=Math.max(r,Math.floor(e-l*h/u+p)),d=Math.min(a,Math.floor(e+(u-l)*h/u+p));n(t,e,f,d,s)}var m=t[e],y=r,v=a;for(i(t,r,e),s(t[a],m)>0&&i(t,r,a);y0;)v--}0===s(t[r],m)?i(t,r,v):(v++,i(t,v,a)),v<=e&&(r=v+1),e<=v&&(a=v-1)}}function i(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function o(t,e){return te?1:0}e.exports=n},{}],200:[function(e,r,n){!function(e,i){"object"==typeof n&&"undefined"!=typeof r?r.exports=i():"function"==typeof t&&t.amd?t(i):e.ShelfPack=i()}(this,function(){function t(t,e,r){r=r||{},this.w=t||64,this.h=e||64,this.autoResize=!!r.autoResize,this.shelves=[],this.stats={},this.count=function(t){this.stats[t]=(0|this.stats[t])+1}}function e(t,e,r){this.x=0,this.y=t,this.w=this.free=e,this.h=r}return t.prototype.pack=function(t,e){t=[].concat(t),e=e||{};for(var r,n,i,o=[],a=0;a0){for(var s=0,u=0,l=0;ln.h||t>n.free||rc)&&(h=2*Math.max(t,c)),(uu)&&(l=2*Math.max(r,u)),this.resize(h,l),this.packOne(t,r)}return null},t.prototype.clear=function(){this.shelves=[],this.stats={}},t.prototype.resize=function(t,e){this.w=t,this.h=e;for(var r=0;rthis.free||e>this.h)return null;var r=this.x;return this.x+=t,this.free-=t,{x:r,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})},{}],201:[function(t,e,r){"use strict";function n(t){return new i(t)}function i(t){this.options=f(Object.create(this.options),t),this.trees=new Array(this.options.maxZoom+1)}function o(t,e,r,n){return{x:t,y:e,zoom:1/0,id:n,numPoints:r}}function a(t,e){var r=t.geometry.coordinates;return o(l(r[0]),c(r[1]),1,e)}function s(t){return{type:"Feature",properties:u(t),geometry:{type:"Point",coordinates:[h(t.x),p(t.y)]}}}function u(t){var e=t.numPoints,r=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:r}}function l(t){return t/360+.5}function c(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function h(t){return 360*(t-.5)}function p(t){var e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function f(t,e){for(var r in e)t[r]=e[r];return t}function d(t){return t.x}function m(t){return t.y}var y=t("kdbush");e.exports=n,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 r="prepare "+t.length+" points";e&&console.time(r),this.points=t;var n=t.map(a);e&&console.timeEnd(r);for(var i=this.options.maxZoom;i>=this.options.minZoom;i--){var o=+Date.now();this.trees[i+1]=y(n,d,m,this.options.nodeSize,Float32Array),n=this._cluster(n,i),e&&console.log("z%d: %d clusters in %dms",i,n.length,+Date.now()-o)}return this.trees[this.options.minZoom]=y(n,d,m,this.options.nodeSize,Float32Array),e&&console.timeEnd("total time"),this},getClusters:function(t,e){for(var r=this.trees[this._limitZoom(e)],n=r.range(l(t[0]),c(t[3]),l(t[2]),c(t[1])),i=[],o=0;o=0;r--)this._down(r)}function i(t,e){return te?1:0}function o(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}e.exports=n,n.prototype={push:function(t){this.data.push(t),this.length++,this._up(this.length-1)},pop:function(){var t=this.data[0];return this.data[0]=this.data[this.length-1],this.length--,this.data.pop(),this._down(0),t},peek:function(){return this.data[0]},_up:function(t){for(var e=this.data,r=this.compare;t>0;){var n=Math.floor((t-1)/2);if(!(r(e[t],e[n])<0))break;o(e,n,t),t=n}},_down:function(t){for(var e=this.data,r=this.compare,n=this.length;;){var i=2*t+1,a=i+1,s=t;if(i=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=o),u(r,t,r.depth)}function o(t,e){var r=i.styles[e];return r?"["+i.colors[r][0]+"m"+t+"["+i.colors[r][1]+"m":t}function a(t,e){return t}function s(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}function u(t,e,r){if(t.customInspect&&e&&z(e.inspect)&&e.inspect!==n.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(r,t);return _(i)||(i=u(t,i,r)),i}var o=l(t,e);if(o)return o;var a=Object.keys(e),m=s(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(e)),S(e)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return c(e);if(0===a.length){if(z(e)){var y=e.name?": "+e.name:"";return t.stylize("[Function"+y+"]","special")}if(w(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(T(e))return t.stylize(Date.prototype.toString.call(e),"date");if(S(e))return c(e)}var v="",g=!1,x=["{","}"];if(d(e)&&(g=!0,x=["[","]"]),z(e)){var b=e.name?": "+e.name:"";v=" [Function"+b+"]"}if(w(e)&&(v=" "+RegExp.prototype.toString.call(e)),T(e)&&(v=" "+Date.prototype.toUTCString.call(e)),S(e)&&(v=" "+c(e)),0===a.length&&(!g||0==e.length))return x[0]+v+x[1];if(r<0)return w(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var E;return E=g?h(t,e,r,m,a):a.map(function(n){return p(t,e,r,m,n,g)}),t.seen.pop(),f(E,v,x)}function l(t,e){if(b(e))return t.stylize("undefined","undefined");if(_(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return g(e)?t.stylize(""+e,"number"):m(e)?t.stylize(""+e,"boolean"):y(e)?t.stylize("null","null"):void 0}function c(t){return"["+Error.prototype.toString.call(t)+"]"}function h(t,e,r,n,i){for(var o=[],a=0,s=e.length;a-1&&(s=o?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(a)){if(o&&i.match(/^\d+$/))return s;a=JSON.stringify(""+i),a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function f(t,e,r){var n=0,i=t.reduce(function(t,e){return n++,e.indexOf("\n")>=0&&n++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}function d(t){return Array.isArray(t)}function m(t){return"boolean"==typeof t}function y(t){return null===t}function v(t){return null==t}function g(t){return"number"==typeof t}function _(t){return"string"==typeof t}function x(t){return"symbol"==typeof t}function b(t){return void 0===t}function w(t){return E(t)&&"[object RegExp]"===M(t)}function E(t){return"object"==typeof t&&null!==t}function T(t){return E(t)&&"[object Date]"===M(t)}function S(t){return E(t)&&("[object Error]"===M(t)||t instanceof Error)}function z(t){return"function"==typeof t}function A(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t}function M(t){return Object.prototype.toString.call(t)}function P(t){return t<10?"0"+t.toString(10):t.toString(10)}function L(){var t=new Date,e=[P(t.getHours()),P(t.getMinutes()),P(t.getSeconds())].join(":");return[t.getDate(),D[t.getMonth()],e].join(" ")}function C(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var k=/%[sdj%]/g;n.format=function(t){if(!_(t)){for(var e=[],r=0;r=o)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}),s=n[r];r>3}if(i--,1===n||2===n)o+=t.readSVarint(),a+=t.readSVarint(),1===n&&(e&&s.push(e),e=[]),e.push(new u(o,a));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&s.push(e),s},n.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,o=0,a=1/0,s=-(1/0),u=1/0,l=-(1/0);t.pos>3}if(n--,1===r||2===r)i+=t.readSVarint(),o+=t.readSVarint(),is&&(s=i),ol&&(l=o);else if(7!==r)throw new Error("unknown command "+r)}return[a,u,s,l]},n.prototype.toGeoJSON=function(t,e,r){function i(t){for(var e=0;e>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}var a=t("./vectortilefeature.js");e.exports=n,n.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 a(this._pbf,e,this.extent,this._keys,this._values)}},{"./vectortilefeature.js":208}],210:[function(t,e,r){function n(t){var e=[];for(var r in t.layers)e.push(o(t.layers[r]));var n=new c;return h.tile.write({layers:e},n),n.finish()}function i(t){var e={};for(var r in t)e[r]=new p(t[r].features),e[r].name=r;return n({layers:e})}function o(t){for(var e={name:t.name||"",version:t.version||1,extent:t.extent||4096,keys:[],values:[],features:[]},r={},n={},i=0;i>31}function u(t){for(var e=[],r=0,n=0,i=t.length,o=0;o0&&(i=n.places);var map=r.i(a.a)(t,e,i),s=document.createElement("div"),c=l(map,e,i);s.appendChild(c);var h=r.i(u.a)(map);s.appendChild(h);var p=document.querySelector("fieldset");p.insertBefore(s,document.querySelector(".map"))}).catch(function(t){console.error(t)})}var i=r(3),o=r.n(i),a=r(2),s=r(1),u=r(14);e.a=n;var l=function(map,t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=document.createElement("select");n.setAttribute("name","location");var i=document.createElement("option");i.setAttribute("selected","selected"),i.setAttribute("value","no-location"),i.appendChild(document.createTextNode("Don’t send location")),n.appendChild(i);var o=document.createElement("option");if(o.setAttribute("id","option-coords"),o.setAttribute("value","geo:"+t.coords.latitude+","+t.coords.longitude),o.dataset.latitude=t.coords.latitude,o.dataset.longitude=t.coords.longitude,o.appendChild(document.createTextNode("Send co-ordinates")),n.appendChild(o),null!=e){var a=!0,u=!1,l=void 0;try{for(var c,h=e[Symbol.iterator]();!(a=(c=h.next()).done);a=!0){var p=c.value,f=r.i(s.a)(p.location),d=document.createElement("option");d.setAttribute("value",p.slug),d.dataset.latitude=f.latitude,d.dataset.longitude=f.longitude,d.appendChild(document.createTextNode(p.name)),n.appendChild(d)}}catch(t){u=!0,l=t}finally{try{!a&&h.return&&h.return()}finally{if(u)throw l}}}return n.addEventListener("change",function(){if("no-location"!==n.value){var t=n[n.selectedIndex].dataset.latitude,e=n[n.selectedIndex].dataset.longitude;map.flyTo({center:[e,t]})}}),n}},function(t,e,r){"use strict";function n(){var t=document.querySelector("fieldset"),e=document.createElement("div");e.classList.add("map"),t.appendChild(e),navigator.geolocation.getCurrentPosition(function(t){e.dataset.latitude=t.coords.latitude,e.dataset.longitude=t.coords.longitude,e.dataset.accuracy=t.coords.accuracy,r.i(i.a)(e,t)})}var i=r(12);e.a=n},function(t,e,r){"use strict";function n(map){var t=document.createElement("button");return t.setAttribute("type","button"),t.setAttribute("id","create-new-place"),t.appendChild(document.createTextNode("Create New Place?")),t.addEventListener("click",function(){var t=document.createElement("div"),e=document.createElement("label");e.setAttribute("for","place-name"),e.classList.add("place-label"),e.appendChild(document.createTextNode("Name:"));var n=document.createElement("input");n.setAttribute("placeholder","Name"),n.setAttribute("name","place-name"),n.setAttribute("id","place-name"),n.setAttribute("type","text"),t.appendChild(e),t.appendChild(n);var o=document.createElement("div"),a=document.createElement("label");a.setAttribute("for","place-description"),a.classList.add("place-label"),a.appendChild(document.createTextNode("Description:"));var s=document.createElement("input");s.setAttribute("placeholder","Description"),s.setAttribute("name","place-description"),s.setAttribute("id","place-description"),s.setAttribute("type","text"),o.appendChild(a),o.appendChild(s);var u=document.createElement("div"),l=document.createElement("label");l.setAttribute("for","place-latitude"),l.classList.add("place-label"),l.appendChild(document.createTextNode("Latitude:"));var c=document.createElement("input");c.setAttribute("name","place-latitude"),c.setAttribute("id","place-latitude"),c.setAttribute("type","text"),c.value=map.getCenter().lat,u.appendChild(l),u.appendChild(c);var h=document.createElement("div"),p=document.createElement("label");p.setAttribute("for","place-longitude"),p.classList.add("place-label"),p.appendChild(document.createTextNode("Longitude:"));var f=document.createElement("input");f.setAttribute("name","place-longitude"),f.setAttribute("id","place-longitude"),f.setAttribute("type","text"),f.value=map.getCenter().lng,h.appendChild(p),h.appendChild(f);var d=document.createElement("button");d.setAttribute("id","place-submit"),d.setAttribute("name","place-submit"),d.setAttribute("type","button"),d.appendChild(document.createTextNode("Submit New Place")),d.addEventListener("click",function(){r.i(i.a)(map)});var m=document.querySelector("fieldset");m.appendChild(t),m.appendChild(o),m.appendChild(u),m.appendChild(h),m.appendChild(d)}),t}var i=r(15);e.a=n},function(t,e,r){"use strict";function n(map){var t=new FormData;t.append("place-name",document.querySelector("#place-name").value),t.append("place-description",document.querySelector("#place-description").value),t.append("place-latitude",document.querySelector("#place-latitude").value),t.append("place-longitude",document.querySelector("#place-longitude").value),fetch("/places/new",{credentials:"same-origin",method:"post",body:t}).then(function(t){return t.json()}).then(function(t){if(t.error===!0)throw new Error(t.error_description);var e=document.querySelector("fieldset"),r=document.querySelectorAll(".place-label"),n=!0,i=!1,o=void 0;try{for(var a,s=r[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value;e.removeChild(u.parentNode)}}catch(t){i=!0,o=t}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}e.removeChild(document.querySelector("#place-submit"));var l=document.querySelector("#create-new-place");l.parentNode.removeChild(l);var c=map.getSource("points"),h=c._data.features.filter(function(t){return"Current Location"!=t.properties.title});h.push({type:"Feature",geometry:{type:"Point",coordinates:[t.longitude,t.latitude]},properties:{title:t.name,icon:"circle",uri:t.uri}});var p={type:"FeatureCollection",features:h};map.getSource("points").setData(p);var f=document.querySelector("select"),d=document.createElement("option");d.setAttribute("value",t.uri),d.appendChild(document.createTextNode(t.name)),d.dataset.latitude=t.latitude,d.dataset.longitude=t.longitude,f.appendChild(d),document.querySelector('select [value="'+t.uri+'"]').selected=!0}).catch(function(t){o.a.reset(),o.a.error(t)})}var i=r(3),o=r.n(i);e.a=n},function(t,e,r){/*! * webStorage - A minimal Javascript wrapper to work with localStorage and sessionStorage * * @version v1.2.3 @@ -26,4 +26,4 @@ for(var c,p=e[Symbol.iterator]();!(a=(c=p.next()).done);a=!0){var h=c.value,f=r. * @homepage https://github.com/georapbox/webStorage#readme * @repository git+https://github.com/georapbox/webStorage.git */ -!function(e,r){t.exports=r()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var r=0;r { //position is output of navigator.geolocation call export default function addMapWithPlaces(div, position) { - fetch('/places/near/' + position.coords.latitude + '/' + position.coords.longitude + '?u=' + position.coords.accuracy, { + fetch('/micropub/places?latitude=' + position.coords.latitude + '&longitude=' + position.coords.longitude + '&u=' + position.coords.accuracy, { credentials: 'same-origin', method: 'get' }).then(function (response) { diff --git a/resources/assets/es6/newplace-micropub.js b/resources/assets/es6/newplace-micropub.js index 404f00bb..5db9323b 100644 --- a/resources/assets/es6/newplace-micropub.js +++ b/resources/assets/es6/newplace-micropub.js @@ -82,7 +82,7 @@ export default function makeNewPlaceForm(map) { formData.append('place-latitude', document.querySelector('#place-latitude').value); formData.append('place-longitude', document.querySelector('#place-longitude').value); //post the new place - fetch('/places/new', { + fetch('/micropub/places', { //send cookies with the request credentials: 'same-origin', method: 'post', diff --git a/resources/views/micropub/create.blade.php b/resources/views/micropub/create.blade.php index bc44d769..b1aeff9a 100644 --- a/resources/views/micropub/create.blade.php +++ b/resources/views/micropub/create.blade.php @@ -13,7 +13,7 @@ New Note «

{{ $errors->indieauth->first() }}

@endif @if($url === null) -
+
IndieAuth diff --git a/resources/views/templates/new-note-form.blade.php b/resources/views/templates/new-note-form.blade.php index 97e934af..ff9fae83 100644 --- a/resources/views/templates/new-note-form.blade.php +++ b/resources/views/templates/new-note-form.blade.php @@ -22,7 +22,7 @@ @if($syndication)
-