Skip to content

Instantly share code, notes, and snippets.

@rustyb
Created May 30, 2016 17:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rustyb/e6b1cbd7f6232beb0a8de80d339f0ea7 to your computer and use it in GitHub Desktop.
Save rustyb/e6b1cbd7f6232beb0a8de80d339f0ea7 to your computer and use it in GitHub Desktop.
!function t(e,i,n){function r(a,s){if(!i[a]){if(!e[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var c=i[a]={exports:{}};e[a][0].call(c.exports,function(t){var i=e[a][1][t];return r(i?i:t)},c,c.exports,t,e,i,n)}return i[a].exports}for(var o="function"==typeof require&&require,a=0;a<n.length;a++)r(n[a]);return r}({1:[function(t,e,i){function n(t){return t=Math.round(t),0>t?0:t>255?255:t}function r(t){return 0>t?0:t>1?1:t}function o(t){return n("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function a(t){return r("%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))}function s(t,e,i){return 0>i?i+=1:i>1&&(i-=1),1>6*i?t+(e-t)*i*6:1>2*i?e:2>3*i?t+(e-t)*(2/3-i)*6:t}function l(t){var e=t.replace(/ /g,"").toLowerCase();if(e in u)return u[e].slice();if("#"===e[0]){if(4===e.length){var i=parseInt(e.substr(1),16);return i>=0&&4095>=i?[(3840&i)>>4|(3840&i)>>8,240&i|(240&i)>>4,15&i|(15&i)<<4,1]:null}if(7===e.length){var i=parseInt(e.substr(1),16);return i>=0&&16777215>=i?[(16711680&i)>>16,(65280&i)>>8,255&i,1]:null}return null}var r=e.indexOf("("),l=e.indexOf(")");if(-1!==r&&l+1===e.length){var c=e.substr(0,r),h=e.substr(r+1,l-(r+1)).split(","),f=1;switch(c){case"rgba":if(4!==h.length)return null;f=a(h.pop());case"rgb":return 3!==h.length?null:[o(h[0]),o(h[1]),o(h[2]),f];case"hsla":if(4!==h.length)return null;f=a(h.pop());case"hsl":if(3!==h.length)return null;var d=(parseFloat(h[0])%360+360)%360/360,p=a(h[1]),m=a(h[2]),v=.5>=m?m*(p+1):m+p-m*p,y=2*m-v;return[n(255*s(y,v,d+1/3)),n(255*s(y,v,d)),n(255*s(y,v,d-1/3)),f];default:return null}}return null}var u={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],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{i.parseCSSColor=l}catch(c){}},{}],2:[function(t,e,i){"use strict";function n(t){return new Function("f","var p = (f && f.properties || {}); return "+r(t))}function r(t){if(!t)return"true";var e=t[0];if(t.length<=1)return"any"===e?"false":"true";var i="=="===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?l(t[1],t.slice(2)):"!in"===e?c(l(t[1],t.slice(2))):"has"===e?u(t[1]):"!has"===e?c(u([t[1]])):"true";return"("+i+")"}function o(t){return"$type"===t?"f.type":"p["+JSON.stringify(t)+"]"}function a(t,e,i,n){var r=o(t),a="$type"===t?f.indexOf(e):JSON.stringify(e);return(n?"typeof "+r+"=== typeof "+a+"&&":"")+r+i+a}function s(t,e){return t.map(r).join(e)}function l(t,e){"$type"===t&&(e=e.map(function(t){return f.indexOf(t)}));var i=JSON.stringify(e.sort(h)),n=o(t);return e.length<=200?i+".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+", "+i+",0,"+(e.length-1)+")"}function u(t){return JSON.stringify(t)+" in p"}function c(t){return"!("+t+")"}function h(t,e){return e>t?-1:t>e?1:0}e.exports=n;var f=["Unknown","Point","LineString","Polygon"]},{}],3:[function(t,e,i){function n(t){if("Polygon"===t.type)return r(t.coordinates);if("MultiPolygon"===t.type){for(var e=0,i=0;i<t.coordinates.length;i++)e+=r(t.coordinates[i]);return e}return null}function r(t){var e=0;if(t&&t.length>0){e+=Math.abs(o(t[0]));for(var i=1;i<t.length;i++)e-=Math.abs(o(t[i]))}return e}function o(t){var e=0;if(t.length>2){for(var i,n,r=0;r<t.length-1;r++)i=t[r],n=t[r+1],e+=a(n[0]-i[0])*(2+Math.sin(a(i[1]))+Math.sin(a(n[1])));e=e*s.RADIUS*s.RADIUS/2}return e}function a(t){return t*Math.PI/180}var s=t("wgs84");e.exports.geometry=n,e.exports.ring=o},{wgs84:174}],4:[function(t,e,i){function n(t,e){switch(t&&t.type||null){case"FeatureCollection":return t.features=t.features.map(r(n,e)),t;case"Feature":return t.geometry=n(t.geometry,e),t;case"Polygon":case"MultiPolygon":return o(t,e);default:return t}}function r(t,e){return function(i){return t(i,e)}}function o(t,e){return"Polygon"===t.type?t.coordinates=a(t.coordinates,e):"MultiPolygon"===t.type&&(t.coordinates=t.coordinates.map(r(a,e))),t}function a(t,e){e=!!e,t[0]=s(t[0],!e);for(var i=1;i<t.length;i++)t[i]=s(t[i],e);return t}function s(t,e){return l(t)===e?t:t.reverse()}function l(t){return u.ring(t)>=0}var u=t("geojson-area");e.exports=n},{"geojson-area":3}],5:[function(t,e,i){"use strict";function n(t,e,i,n,a,s,l,u){if(i/=e,n/=e,l>=i&&n>=u)return t;if(l>n||i>u)return null;for(var c=[],h=0;h<t.length;h++){var f=t[h],d=f.geometry,p=f.type,m,v;if(m=f.min[a],v=f.max[a],m>=i&&n>=v)c.push(f);else if(!(m>n||i>v)){var y=1===p?r(d,i,n,a):o(d,i,n,a,s,3===p);y.length&&c.push({geometry:y,type:p,tags:t[h].tags||null,min:f.min,max:f.max})}}return c.length?c:null}function r(t,e,i,n){for(var r=[],o=0;o<t.length;o++){var a=t[o],s=a[n];s>=e&&i>=s&&r.push(a)}return r}function o(t,e,i,n,r,o){for(var s=[],l=0;l<t.length;l++){var u=0,c=0,h=null,f=t[l],d=f.area,p=f.dist,m=f.length,v,y,_,g=[];for(y=0;m-1>y;y++)v=h||f[y],h=f[y+1],u=c||v[n],c=h[n],e>u?c>i?(g.push(r(v,h,e),r(v,h,i)),o||(g=a(s,g,d,p))):c>=e&&g.push(r(v,h,e)):u>i?e>c?(g.push(r(v,h,i),r(v,h,e)),o||(g=a(s,g,d,p))):i>=c&&g.push(r(v,h,i)):(g.push(v),e>c?(g.push(r(v,h,e)),o||(g=a(s,g,d,p))):c>i&&(g.push(r(v,h,i)),o||(g=a(s,g,d,p))));v=f[m-1],u=v[n],u>=e&&i>=u&&g.push(v),_=g[g.length-1],o&&_&&(g[0][0]!==_[0]||g[0][1]!==_[1])&&g.push(g[0]),a(s,g,d,p)}return s}function a(t,e,i,n){return e.length&&(e.area=i,e.dist=n,t.push(e)),[]}e.exports=n},{}],6:[function(t,e,i){"use strict";function n(t,e){var i=[];if("FeatureCollection"===t.type)for(var n=0;n<t.features.length;n++)r(i,t.features[n],e);else"Feature"===t.type?r(i,t,e):r(i,{geometry:t},e);return i}function r(t,e,i){var n=e.geometry,l=n.type,u=n.coordinates,c=e.properties,h,f,d;if("Point"===l)t.push(o(c,1,[s(u)]));else if("MultiPoint"===l)t.push(o(c,1,a(u)));else if("LineString"===l)t.push(o(c,2,[a(u,i)]));else if("MultiLineString"===l||"Polygon"===l){for(d=[],h=0;h<u.length;h++)d.push(a(u[h],i));t.push(o(c,"Polygon"===l?3:2,d))}else if("MultiPolygon"===l){for(d=[],h=0;h<u.length;h++)for(f=0;f<u[h].length;f++)d.push(a(u[h][f],i));t.push(o(c,3,d))}else{if("GeometryCollection"!==l)throw new Error("Input data is not a valid GeoJSON object.");for(h=0;h<n.geometries.length;h++)r(t,{geometry:n.geometries[h],properties:c},i)}}function o(t,e,i){var n={geometry:i,type:e,tags:t||null,min:[2,1],max:[-1,0]};return u(n),n}function a(t,e){for(var i=[],n=0;n<t.length;n++)i.push(s(t[n]));return e&&(h(i,e),l(i)),i}function s(t){var e=Math.sin(t[1]*Math.PI/180),i=t[0]/360+.5,n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n=-1>n?-1:n>1?1:n,[i,n,0]}function l(t){for(var e=0,i=0,n=0,r,o;n<t.length-1;n++)r=o||t[n],o=t[n+1],e+=r[0]*o[1]-o[0]*r[1],i+=Math.abs(o[0]-r[0])+Math.abs(o[1]-r[1]);t.area=Math.abs(e/2),t.dist=i}function u(t){var e=t.geometry,i=t.min,n=t.max;if(1===t.type)c(i,n,e);else for(var r=0;r<e.length;r++)c(i,n,e[r]);return t}function c(t,e,i){for(var n=0,r;n<i.length;n++)r=i[n],t[0]=Math.min(r[0],t[0]),e[0]=Math.max(r[0],e[0]),t[1]=Math.min(r[1],t[1]),e[1]=Math.max(r[1],e[1])}e.exports=n;var h=t("./simplify")},{"./simplify":8}],7:[function(t,e,i){"use strict";function n(t,e){return new r(t,e)}function r(t,e){e=this.options=l(Object.create(this.options),e);var i=e.debug;i&&console.time("preprocess data");var n=1<<e.maxZoom,r=c(t,e.tolerance/(n*e.extent));this.tiles={},this.tileCoords=[],i&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),r=d(r,e.buffer/e.extent,a),r.length&&this.splitTile(r,0,0,0),i&&(r.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function o(t,e,i){return 32*((1<<t)*i+e)+t}function a(t,e,i){return[i,(i-t[0])*(e[1]-t[1])/(e[0]-t[0])+t[1],1]}function s(t,e,i){return[(i-t[1])*(e[0]-t[0])/(e[1]-t[1])+t[0],i,1]}function l(t,e){for(var i in e)t[i]=e[i];return t}function u(t,e,i){var n=t.source;if(1!==n.length)return!1;var r=n[0];if(3!==r.type||r.geometry.length>1)return!1;var o=r.geometry[0].length;if(5!==o)return!1;for(var a=0;o>a;a++){var s=h.point(r.geometry[0][a],e,t.z2,t.x,t.y);if(s[0]!==-i&&s[0]!==e+i||s[1]!==-i&&s[1]!==e+i)return!1}return!0}e.exports=n;var c=t("./convert"),h=t("./transform"),f=t("./clip"),d=t("./wrap"),p=t("./tile");r.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,solidChildren:!1,tolerance:3,extent:4096,buffer:64,debug:0},r.prototype.splitTile=function(t,e,i,n,r,l,c){for(var h=[t,e,i,n],d=this.options,m=d.debug,v=null;h.length;){n=h.pop(),i=h.pop(),e=h.pop(),t=h.pop();var y=1<<e,_=o(e,i,n),g=this.tiles[_],x=e===d.maxZoom?0:d.tolerance/(y*d.extent);if(!g&&(m>1&&console.time("creation"),g=this.tiles[_]=p(t,y,i,n,x,e===d.maxZoom),this.tileCoords.push({z:e,x:i,y:n}),m)){m>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,i,n,g.numFeatures,g.numPoints,g.numSimplified),console.timeEnd("creation"));var b="z"+e;this.stats[b]=(this.stats[b]||0)+1,this.total++}if(g.source=t,r){if(e===d.maxZoom||e===r)continue;var w=1<<r-e;if(i!==Math.floor(l/w)||n!==Math.floor(c/w))continue}else if(e===d.indexMaxZoom||g.numPoints<=d.indexMaxPoints)continue;if(d.solidChildren||!u(g,d.extent,d.buffer)){g.source=null,m>1&&console.time("clipping");var M=.5*d.buffer/d.extent,S=.5-M,E=.5+M,T=1+M,I,D,z,P,L,F;I=D=z=P=null,L=f(t,y,i-M,i+E,0,a,g.min[0],g.max[0]),F=f(t,y,i+S,i+T,0,a,g.min[0],g.max[0]),L&&(I=f(L,y,n-M,n+E,1,s,g.min[1],g.max[1]),D=f(L,y,n+S,n+T,1,s,g.min[1],g.max[1])),F&&(z=f(F,y,n-M,n+E,1,s,g.min[1],g.max[1]),P=f(F,y,n+S,n+T,1,s,g.min[1],g.max[1])),m>1&&console.timeEnd("clipping"),I&&h.push(I,e+1,2*i,2*n),D&&h.push(D,e+1,2*i,2*n+1),z&&h.push(z,e+1,2*i+1,2*n),P&&h.push(P,e+1,2*i+1,2*n+1)}else r&&(v=e)}return v},r.prototype.getTile=function(t,e,i){var n=this.options,r=n.extent,a=n.debug,s=1<<t;e=(e%s+s)%s;var l=o(t,e,i);if(this.tiles[l])return h.tile(this.tiles[l],r);a>1&&console.log("drilling down to z%d-%d-%d",t,e,i);for(var c=t,f=e,d=i,p;!p&&c>0;)c--,f=Math.floor(f/2),d=Math.floor(d/2),p=this.tiles[o(c,f,d)];if(!p||!p.source)return null;if(a>1&&console.log("found parent tile z%d-%d-%d",c,f,d),u(p,r,n.buffer))return h.tile(p,r);a>1&&console.time("drilling down");var m=this.splitTile(p.source,c,f,d,t,e,i);if(a>1&&console.timeEnd("drilling down"),null!==m){var v=1<<t-m;l=o(m,Math.floor(e/v),Math.floor(i/v))}return this.tiles[l]?h.tile(this.tiles[l],r):null}},{"./clip":5,"./convert":6,"./tile":9,"./transform":10,"./wrap":11}],8:[function(t,e,i){"use strict";function n(t,e){var i=e*e,n=t.length,o=0,a=n-1,s=[],l,u,c,h;for(t[o][2]=1,t[a][2]=1;a;){for(u=0,l=o+1;a>l;l++)c=r(t[l],t[o],t[a]),c>u&&(h=l,u=c);u>i?(t[h][2]=u,s.push(o),s.push(h),o=h):(a=s.pop(),o=s.pop())}}function r(t,e,i){var n=e[0],r=e[1],o=i[0],a=i[1],s=t[0],l=t[1],u=o-n,c=a-r;if(0!==u||0!==c){var h=((s-n)*u+(l-r)*c)/(u*u+c*c);h>1?(n=o,r=a):h>0&&(n+=u*h,r+=c*h)}return u=s-n,c=l-r,u*u+c*c}e.exports=n},{}],9:[function(t,e,i){"use strict";function n(t,e,i,n,o,a){for(var s={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:i,y:n,z2:e,transformed:!1,min:[2,1],max:[-1,0]},l=0;l<t.length;l++){s.numFeatures++,r(s,t[l],o,a);var u=t[l].min,c=t[l].max;u[0]<s.min[0]&&(s.min[0]=u[0]),u[1]<s.min[1]&&(s.min[1]=u[1]),c[0]>s.max[0]&&(s.max[0]=c[0]),c[1]>s.max[1]&&(s.max[1]=c[1])}return s}function r(t,e,i,n){var r=e.geometry,o=e.type,a=[],s=i*i,l,u,c,h;if(1===o)for(l=0;l<r.length;l++)a.push(r[l]),t.numPoints++,t.numSimplified++;else for(l=0;l<r.length;l++)if(c=r[l],n||!(2===o&&c.dist<i||3===o&&c.area<s)){var f=[];for(u=0;u<c.length;u++)h=c[u],(n||h[2]>s)&&(f.push(h),t.numSimplified++),t.numPoints++;a.push(f)}else t.numPoints+=c.length;a.length&&t.features.push({geometry:a,type:o,tags:e.tags||null})}e.exports=n},{}],10:[function(t,e,i){"use strict";function n(t,e){if(t.transformed)return t;var i=t.z2,n=t.x,o=t.y,a,s,l;for(a=0;a<t.features.length;a++){var u=t.features[a],c=u.geometry,h=u.type;if(1===h)for(s=0;s<c.length;s++)c[s]=r(c[s],e,i,n,o);else for(s=0;s<c.length;s++){var f=c[s];for(l=0;l<f.length;l++)f[l]=r(f[l],e,i,n,o)}}return t.transformed=!0,t}function r(t,e,i,n,r){var o=Math.round(e*(t[0]*i-n)),a=Math.round(e*(t[1]*i-r));return[o,a]}i.tile=n,i.point=r},{}],11:[function(t,e,i){"use strict";function n(t,e,i){var n=t,o=a(t,1,-1-e,e,0,i,-1,2),s=a(t,1,1-e,2+e,0,i,-1,2);return(o||s)&&(n=a(t,1,-e,1+e,0,i,-1,2),o&&(n=r(o,1).concat(n)),s&&(n=n.concat(r(s,-1)))),n}function r(t,e){for(var i=[],n=0;n<t.length;n++){var r=t[n],a=r.type,s;if(1===a)s=o(r.geometry,e);else{s=[];for(var l=0;l<r.geometry.length;l++)s.push(o(r.geometry[l],e))}i.push({geometry:s,type:a,tags:r.tags,min:[r.min[0]+e,r.min[1]],max:[r.max[0]+e,r.max[1]]})}return i}function o(t,e){var i=[];i.area=t.area,i.dist=t.dist;for(var n=0;n<t.length;n++)i.push([t[n][0]+e,t[n][1],t[n][2]]);return i}var a=t("./clip");e.exports=n},{"./clip":5}],12:[function(t,e,i){i.glMatrix=t("./gl-matrix/common.js"),i.mat2=t("./gl-matrix/mat2.js"),i.mat2d=t("./gl-matrix/mat2d.js"),i.mat3=t("./gl-matrix/mat3.js"),i.mat4=t("./gl-matrix/mat4.js"),i.quat=t("./gl-matrix/quat.js"),i.vec2=t("./gl-matrix/vec2.js"),i.vec3=t("./gl-matrix/vec3.js"),i.vec4=t("./gl-matrix/vec4.js")},{"./gl-matrix/common.js":13,"./gl-matrix/mat2.js":14,"./gl-matrix/mat2d.js":15,"./gl-matrix/mat3.js":16,"./gl-matrix/mat4.js":17,"./gl-matrix/quat.js":18,"./gl-matrix/vec2.js":19,"./gl-matrix/vec3.js":20,"./gl-matrix/vec4.js":21}],13:[function(t,e,i){var n={};n.EPSILON=1e-6,n.ARRAY_TYPE="undefined"!=typeof Float32Array?Float32Array:Array,n.RANDOM=Math.random,n.ENABLE_SIMD=!1,n.SIMD_AVAILABLE=n.ARRAY_TYPE===Float32Array&&"SIMD"in this,n.USE_SIMD=n.ENABLE_SIMD&&n.SIMD_AVAILABLE,n.setMatrixArrayType=function(t){n.ARRAY_TYPE=t};var r=Math.PI/180;n.toRadian=function(t){return t*r},n.equals=function(t,e){return Math.abs(t-e)<=n.EPSILON*Math.max(1,Math.abs(t),Math.abs(e))},e.exports=n},{}],14:[function(t,e,i){var n=t("./common.js"),r={};r.create=function(){var t=new n.ARRAY_TYPE(4);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},r.clone=function(t){var e=new n.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},r.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},r.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},r.fromValues=function(t,e,i,r){var o=new n.ARRAY_TYPE(4);return o[0]=t,o[1]=e,o[2]=i,o[3]=r,o},r.set=function(t,e,i,n,r){return t[0]=e,t[1]=i,t[2]=n,t[3]=r,t},r.transpose=function(t,e){if(t===e){var i=e[1];t[1]=e[2],t[2]=i}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t},r.invert=function(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],a=i*o-r*n;return a?(a=1/a,t[0]=o*a,t[1]=-n*a,t[2]=-r*a,t[3]=i*a,t):null},r.adjoint=function(t,e){var i=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=i,t},r.determinant=function(t){return t[0]*t[3]-t[2]*t[1]},r.multiply=function(t,e,i){var n=e[0],r=e[1],o=e[2],a=e[3],s=i[0],l=i[1],u=i[2],c=i[3];return t[0]=n*s+o*l,t[1]=r*s+a*l,t[2]=n*u+o*c,t[3]=r*u+a*c,t},r.mul=r.multiply,r.rotate=function(t,e,i){var n=e[0],r=e[1],o=e[2],a=e[3],s=Math.sin(i),l=Math.cos(i);return t[0]=n*l+o*s,t[1]=r*l+a*s,t[2]=n*-s+o*l,t[3]=r*-s+a*l,t},r.scale=function(t,e,i){var n=e[0],r=e[1],o=e[2],a=e[3],s=i[0],l=i[1];return t[0]=n*s,t[1]=r*s,t[2]=o*l,t[3]=a*l,t},r.fromRotation=function(t,e){var i=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=i,t[2]=-i,t[3]=n,t},r.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t},r.str=function(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},r.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2))},r.LDU=function(t,e,i,n){return t[2]=n[2]/n[0],i[0]=n[0],i[1]=n[1],i[3]=n[3]-t[2]*i[1],[t,e,i]},r.add=function(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t[3]=e[3]+i[3],t},r.subtract=function(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t[3]=e[3]-i[3],t},r.sub=r.subtract,r.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},r.equals=function(t,e){var i=t[0],r=t[1],o=t[2],a=t[3],s=e[0],l=e[1],u=e[2],c=e[3];return Math.abs(i-s)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(r-l)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(o-u)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(u))&&Math.abs(a-c)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(c))},r.multiplyScalar=function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t},r.multiplyScalarAndAdd=function(t,e,i,n){return t[0]=e[0]+i[0]*n,t[1]=e[1]+i[1]*n,t[2]=e[2]+i[2]*n,t[3]=e[3]+i[3]*n,t},e.exports=r},{"./common.js":13}],15:[function(t,e,i){var n=t("./common.js"),r={};r.create=function(){var t=new n.ARRAY_TYPE(6);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},r.clone=function(t){var e=new n.ARRAY_TYPE(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},r.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},r.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},r.fromValues=function(t,e,i,r,o,a){var s=new n.ARRAY_TYPE(6);return s[0]=t,s[1]=e,s[2]=i,s[3]=r,s[4]=o,s[5]=a,s},r.set=function(t,e,i,n,r,o,a){return t[0]=e,t[1]=i,t[2]=n,t[3]=r,t[4]=o,t[5]=a,t},r.invert=function(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],a=e[4],s=e[5],l=i*o-n*r;return l?(l=1/l,t[0]=o*l,t[1]=-n*l,t[2]=-r*l,t[3]=i*l,t[4]=(r*s-o*a)*l,t[5]=(n*a-i*s)*l,t):null},r.determinant=function(t){return t[0]*t[3]-t[1]*t[2]},r.multiply=function(t,e,i){var n=e[0],r=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=i[0],c=i[1],h=i[2],f=i[3],d=i[4],p=i[5];return t[0]=n*u+o*c,t[1]=r*u+a*c,t[2]=n*h+o*f,t[3]=r*h+a*f,t[4]=n*d+o*p+s,t[5]=r*d+a*p+l,t},r.mul=r.multiply,r.rotate=function(t,e,i){var n=e[0],r=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=Math.sin(i),c=Math.cos(i);return t[0]=n*c+o*u,t[1]=r*c+a*u,t[2]=n*-u+o*c,t[3]=r*-u+a*c,t[4]=s,t[5]=l,t},r.scale=function(t,e,i){var n=e[0],r=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=i[0],c=i[1];return t[0]=n*u,t[1]=r*u,t[2]=o*c,t[3]=a*c,t[4]=s,t[5]=l,t},r.translate=function(t,e,i){var n=e[0],r=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=i[0],c=i[1];return t[0]=n,t[1]=r,t[2]=o,t[3]=a,t[4]=n*u+o*c+s,t[5]=r*u+a*c+l,t},r.fromRotation=function(t,e){var i=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=i,t[2]=-i,t[3]=n,t[4]=0,t[5]=0,t},r.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t},r.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t},r.str=function(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"},r.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+1)},r.add=function(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t[3]=e[3]+i[3],t[4]=e[4]+i[4],t[5]=e[5]+i[5],t},r.subtract=function(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t[3]=e[3]-i[3],t[4]=e[4]-i[4],t[5]=e[5]-i[5],t},r.sub=r.subtract,r.multiplyScalar=function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*i,t[5]=e[5]*i,t},r.multiplyScalarAndAdd=function(t,e,i,n){return t[0]=e[0]+i[0]*n,t[1]=e[1]+i[1]*n,t[2]=e[2]+i[2]*n,t[3]=e[3]+i[3]*n,t[4]=e[4]+i[4]*n,t[5]=e[5]+i[5]*n,t},r.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]},r.equals=function(t,e){var i=t[0],r=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=e[0],c=e[1],h=e[2],f=e[3],d=e[4],p=e[5];return Math.abs(i-u)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(r-c)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(o-h)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(h))&&Math.abs(a-f)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(f))&&Math.abs(s-d)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(d))&&Math.abs(l-p)<=n.EPSILON*Math.max(1,Math.abs(l),Math.abs(p))},e.exports=r},{"./common.js":13}],16:[function(t,e,i){var n=t("./common.js"),r={};r.create=function(){var t=new n.ARRAY_TYPE(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},r.fromMat4=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},r.clone=function(t){var e=new n.ARRAY_TYPE(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},r.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},r.fromValues=function(t,e,i,r,o,a,s,l,u){var c=new n.ARRAY_TYPE(9);return c[0]=t,c[1]=e,c[2]=i,c[3]=r,c[4]=o,c[5]=a,c[6]=s,c[7]=l,c[8]=u,c},r.set=function(t,e,i,n,r,o,a,s,l,u){return t[0]=e,t[1]=i,t[2]=n,t[3]=r,t[4]=o,t[5]=a,t[6]=s,t[7]=l,t[8]=u,t},r.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},r.transpose=function(t,e){if(t===e){var i=e[1],n=e[2],r=e[5];t[1]=e[3],t[2]=e[6],t[3]=i,t[5]=e[7],t[6]=n,t[7]=r}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},r.invert=function(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],a=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=c*a-s*u,f=-c*o+s*l,d=u*o-a*l,p=i*h+n*f+r*d;return p?(p=1/p,t[0]=h*p,t[1]=(-c*n+r*u)*p,t[2]=(s*n-r*a)*p,t[3]=f*p,t[4]=(c*i-r*l)*p,t[5]=(-s*i+r*o)*p,t[6]=d*p,t[7]=(-u*i+n*l)*p,t[8]=(a*i-n*o)*p,t):null},r.adjoint=function(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],a=e[4],s=e[5],l=e[6],u=e[7],c=e[8];return t[0]=a*c-s*u,t[1]=r*u-n*c,t[2]=n*s-r*a,t[3]=s*l-o*c,t[4]=i*c-r*l,t[5]=r*o-i*s,t[6]=o*u-a*l,t[7]=n*l-i*u,t[8]=i*a-n*o,t},r.determinant=function(t){var e=t[0],i=t[1],n=t[2],r=t[3],o=t[4],a=t[5],s=t[6],l=t[7],u=t[8];return e*(u*o-a*l)+i*(-u*r+a*s)+n*(l*r-o*s)},r.multiply=function(t,e,i){var n=e[0],r=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],f=i[0],d=i[1],p=i[2],m=i[3],v=i[4],y=i[5],_=i[6],g=i[7],x=i[8];return t[0]=f*n+d*a+p*u,t[1]=f*r+d*s+p*c,t[2]=f*o+d*l+p*h,t[3]=m*n+v*a+y*u,t[4]=m*r+v*s+y*c,t[5]=m*o+v*l+y*h,t[6]=_*n+g*a+x*u,t[7]=_*r+g*s+x*c,t[8]=_*o+g*l+x*h,t},r.mul=r.multiply,r.translate=function(t,e,i){var n=e[0],r=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],f=i[0],d=i[1];return t[0]=n,t[1]=r,t[2]=o,t[3]=a,t[4]=s,t[5]=l,t[6]=f*n+d*a+u,t[7]=f*r+d*s+c,t[8]=f*o+d*l+h,t},r.rotate=function(t,e,i){var n=e[0],r=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],f=Math.sin(i),d=Math.cos(i);return t[0]=d*n+f*a,t[1]=d*r+f*s,t[2]=d*o+f*l,t[3]=d*a-f*n,t[4]=d*s-f*r,t[5]=d*l-f*o,t[6]=u,t[7]=c,t[8]=h,t},r.scale=function(t,e,i){var n=i[0],r=i[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=r*e[3],t[4]=r*e[4],t[5]=r*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},r.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t},r.fromRotation=function(t,e){var i=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},r.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},r.fromMat2d=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t},r.fromQuat=function(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],a=i+i,s=n+n,l=r+r,u=i*a,c=n*a,h=n*s,f=r*a,d=r*s,p=r*l,m=o*a,v=o*s,y=o*l;return t[0]=1-h-p,t[3]=c-y,t[6]=f+v,t[1]=c+y,t[4]=1-u-p,t[7]=d-m,t[2]=f-v,t[5]=d+m,t[8]=1-u-h,t},r.normalFromMat4=function(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],a=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],f=e[10],d=e[11],p=e[12],m=e[13],v=e[14],y=e[15],_=i*s-n*a,g=i*l-r*a,x=i*u-o*a,b=n*l-r*s,w=n*u-o*s,M=r*u-o*l,S=c*m-h*p,E=c*v-f*p,T=c*y-d*p,I=h*v-f*m,D=h*y-d*m,z=f*y-d*v,P=_*z-g*D+x*I+b*T-w*E+M*S;return P?(P=1/P,t[0]=(s*z-l*D+u*I)*P,t[1]=(l*T-a*z-u*E)*P,t[2]=(a*D-s*T+u*S)*P,t[3]=(r*D-n*z-o*I)*P,t[4]=(i*z-r*T+o*E)*P,t[5]=(n*T-i*D-o*S)*P,t[6]=(m*M-v*w+y*b)*P,t[7]=(v*x-p*M-y*g)*P,t[8]=(p*w-m*x+y*_)*P,t):null},r.str=function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},r.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2))},r.add=function(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t[3]=e[3]+i[3],t[4]=e[4]+i[4],t[5]=e[5]+i[5],t[6]=e[6]+i[6],t[7]=e[7]+i[7],t[8]=e[8]+i[8],t},r.subtract=function(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t[3]=e[3]-i[3],t[4]=e[4]-i[4],t[5]=e[5]-i[5],t[6]=e[6]-i[6],t[7]=e[7]-i[7],t[8]=e[8]-i[8],t},r.sub=r.subtract,r.multiplyScalar=function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*i,t},r.multiplyScalarAndAdd=function(t,e,i,n){return t[0]=e[0]+i[0]*n,t[1]=e[1]+i[1]*n,t[2]=e[2]+i[2]*n,t[3]=e[3]+i[3]*n,t[4]=e[4]+i[4]*n,t[5]=e[5]+i[5]*n,t[6]=e[6]+i[6]*n,t[7]=e[7]+i[7]*n,t[8]=e[8]+i[8]*n,t},r.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},r.equals=function(t,e){var i=t[0],r=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],f=e[0],d=e[1],p=e[2],m=e[3],v=e[4],y=e[5],_=t[6],g=e[7],x=e[8];return Math.abs(i-f)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(r-d)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(d))&&Math.abs(o-p)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(a-m)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(s-v)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(v))&&Math.abs(l-y)<=n.EPSILON*Math.max(1,Math.abs(l),Math.abs(y))&&Math.abs(u-_)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(_))&&Math.abs(c-g)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(g))&&Math.abs(h-x)<=n.EPSILON*Math.max(1,Math.abs(h),Math.abs(x))},e.exports=r},{"./common.js":13}],17:[function(t,e,i){var n=t("./common.js"),r={scalar:{},SIMD:{}};r.create=function(){var t=new n.ARRAY_TYPE(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},r.clone=function(t){var e=new n.ARRAY_TYPE(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},r.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},r.fromValues=function(t,e,i,r,o,a,s,l,u,c,h,f,d,p,m,v){var y=new n.ARRAY_TYPE(16);return y[0]=t,y[1]=e,y[2]=i,y[3]=r,y[4]=o,y[5]=a,y[6]=s,y[7]=l,y[8]=u,y[9]=c,y[10]=h,y[11]=f,y[12]=d,y[13]=p,y[14]=m,y[15]=v,y},r.set=function(t,e,i,n,r,o,a,s,l,u,c,h,f,d,p,m,v){return t[0]=e,t[1]=i,t[2]=n,t[3]=r,t[4]=o,t[5]=a,t[6]=s,t[7]=l,t[8]=u,t[9]=c,t[10]=h,t[11]=f,t[12]=d,t[13]=p,t[14]=m,t[15]=v,t},r.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},r.scalar.transpose=function(t,e){if(t===e){var i=e[1],n=e[2],r=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=i,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=o,t[11]=e[14],t[12]=r,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t},r.SIMD.transpose=function(t,e){var i,n,r,o,a,s,l,u,c,h;return i=SIMD.Float32x4.load(e,0),n=SIMD.Float32x4.load(e,4),r=SIMD.Float32x4.load(e,8),o=SIMD.Float32x4.load(e,12),a=SIMD.Float32x4.shuffle(i,n,0,1,4,5),s=SIMD.Float32x4.shuffle(r,o,0,1,4,5),l=SIMD.Float32x4.shuffle(a,s,0,2,4,6),u=SIMD.Float32x4.shuffle(a,s,1,3,5,7),SIMD.Float32x4.store(t,0,l),SIMD.Float32x4.store(t,4,u),a=SIMD.Float32x4.shuffle(i,n,2,3,6,7),s=SIMD.Float32x4.shuffle(r,o,2,3,6,7),c=SIMD.Float32x4.shuffle(a,s,0,2,4,6),h=SIMD.Float32x4.shuffle(a,s,1,3,5,7),SIMD.Float32x4.store(t,8,c),SIMD.Float32x4.store(t,12,h),t},r.transpose=n.USE_SIMD?r.SIMD.transpose:r.scalar.transpose,r.scalar.invert=function(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],a=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],f=e[10],d=e[11],p=e[12],m=e[13],v=e[14],y=e[15],_=i*s-n*a,g=i*l-r*a,x=i*u-o*a,b=n*l-r*s,w=n*u-o*s,M=r*u-o*l,S=c*m-h*p,E=c*v-f*p,T=c*y-d*p,I=h*v-f*m,D=h*y-d*m,z=f*y-d*v,P=_*z-g*D+x*I+b*T-w*E+M*S;return P?(P=1/P,t[0]=(s*z-l*D+u*I)*P,t[1]=(r*D-n*z-o*I)*P,
t[2]=(m*M-v*w+y*b)*P,t[3]=(f*w-h*M-d*b)*P,t[4]=(l*T-a*z-u*E)*P,t[5]=(i*z-r*T+o*E)*P,t[6]=(v*x-p*M-y*g)*P,t[7]=(c*M-f*x+d*g)*P,t[8]=(a*D-s*T+u*S)*P,t[9]=(n*T-i*D-o*S)*P,t[10]=(p*w-m*x+y*_)*P,t[11]=(h*x-c*w-d*_)*P,t[12]=(s*E-a*I-l*S)*P,t[13]=(i*I-n*E+r*S)*P,t[14]=(m*g-p*b-v*_)*P,t[15]=(c*b-h*g+f*_)*P,t):null},r.SIMD.invert=function(t,e){var i,n,r,o,a,s,l,u,c,h,f=SIMD.Float32x4.load(e,0),d=SIMD.Float32x4.load(e,4),p=SIMD.Float32x4.load(e,8),m=SIMD.Float32x4.load(e,12);return a=SIMD.Float32x4.shuffle(f,d,0,1,4,5),n=SIMD.Float32x4.shuffle(p,m,0,1,4,5),i=SIMD.Float32x4.shuffle(a,n,0,2,4,6),n=SIMD.Float32x4.shuffle(n,a,1,3,5,7),a=SIMD.Float32x4.shuffle(f,d,2,3,6,7),o=SIMD.Float32x4.shuffle(p,m,2,3,6,7),r=SIMD.Float32x4.shuffle(a,o,0,2,4,6),o=SIMD.Float32x4.shuffle(o,a,1,3,5,7),a=SIMD.Float32x4.mul(r,o),a=SIMD.Float32x4.swizzle(a,1,0,3,2),s=SIMD.Float32x4.mul(n,a),l=SIMD.Float32x4.mul(i,a),a=SIMD.Float32x4.swizzle(a,2,3,0,1),s=SIMD.Float32x4.sub(SIMD.Float32x4.mul(n,a),s),l=SIMD.Float32x4.sub(SIMD.Float32x4.mul(i,a),l),l=SIMD.Float32x4.swizzle(l,2,3,0,1),a=SIMD.Float32x4.mul(n,r),a=SIMD.Float32x4.swizzle(a,1,0,3,2),s=SIMD.Float32x4.add(SIMD.Float32x4.mul(o,a),s),c=SIMD.Float32x4.mul(i,a),a=SIMD.Float32x4.swizzle(a,2,3,0,1),s=SIMD.Float32x4.sub(s,SIMD.Float32x4.mul(o,a)),c=SIMD.Float32x4.sub(SIMD.Float32x4.mul(i,a),c),c=SIMD.Float32x4.swizzle(c,2,3,0,1),a=SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(n,2,3,0,1),o),a=SIMD.Float32x4.swizzle(a,1,0,3,2),r=SIMD.Float32x4.swizzle(r,2,3,0,1),s=SIMD.Float32x4.add(SIMD.Float32x4.mul(r,a),s),u=SIMD.Float32x4.mul(i,a),a=SIMD.Float32x4.swizzle(a,2,3,0,1),s=SIMD.Float32x4.sub(s,SIMD.Float32x4.mul(r,a)),u=SIMD.Float32x4.sub(SIMD.Float32x4.mul(i,a),u),u=SIMD.Float32x4.swizzle(u,2,3,0,1),a=SIMD.Float32x4.mul(i,n),a=SIMD.Float32x4.swizzle(a,1,0,3,2),u=SIMD.Float32x4.add(SIMD.Float32x4.mul(o,a),u),c=SIMD.Float32x4.sub(SIMD.Float32x4.mul(r,a),c),a=SIMD.Float32x4.swizzle(a,2,3,0,1),u=SIMD.Float32x4.sub(SIMD.Float32x4.mul(o,a),u),c=SIMD.Float32x4.sub(c,SIMD.Float32x4.mul(r,a)),a=SIMD.Float32x4.mul(i,o),a=SIMD.Float32x4.swizzle(a,1,0,3,2),l=SIMD.Float32x4.sub(l,SIMD.Float32x4.mul(r,a)),u=SIMD.Float32x4.add(SIMD.Float32x4.mul(n,a),u),a=SIMD.Float32x4.swizzle(a,2,3,0,1),l=SIMD.Float32x4.add(SIMD.Float32x4.mul(r,a),l),u=SIMD.Float32x4.sub(u,SIMD.Float32x4.mul(n,a)),a=SIMD.Float32x4.mul(i,r),a=SIMD.Float32x4.swizzle(a,1,0,3,2),l=SIMD.Float32x4.add(SIMD.Float32x4.mul(o,a),l),c=SIMD.Float32x4.sub(c,SIMD.Float32x4.mul(n,a)),a=SIMD.Float32x4.swizzle(a,2,3,0,1),l=SIMD.Float32x4.sub(l,SIMD.Float32x4.mul(o,a)),c=SIMD.Float32x4.add(SIMD.Float32x4.mul(n,a),c),h=SIMD.Float32x4.mul(i,s),h=SIMD.Float32x4.add(SIMD.Float32x4.swizzle(h,2,3,0,1),h),h=SIMD.Float32x4.add(SIMD.Float32x4.swizzle(h,1,0,3,2),h),a=SIMD.Float32x4.reciprocalApproximation(h),h=SIMD.Float32x4.sub(SIMD.Float32x4.add(a,a),SIMD.Float32x4.mul(h,SIMD.Float32x4.mul(a,a))),(h=SIMD.Float32x4.swizzle(h,0,0,0,0))?(SIMD.Float32x4.store(t,0,SIMD.Float32x4.mul(h,s)),SIMD.Float32x4.store(t,4,SIMD.Float32x4.mul(h,l)),SIMD.Float32x4.store(t,8,SIMD.Float32x4.mul(h,u)),SIMD.Float32x4.store(t,12,SIMD.Float32x4.mul(h,c)),t):null},r.invert=n.USE_SIMD?r.SIMD.invert:r.scalar.invert,r.scalar.adjoint=function(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],a=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],f=e[10],d=e[11],p=e[12],m=e[13],v=e[14],y=e[15];return t[0]=s*(f*y-d*v)-h*(l*y-u*v)+m*(l*d-u*f),t[1]=-(n*(f*y-d*v)-h*(r*y-o*v)+m*(r*d-o*f)),t[2]=n*(l*y-u*v)-s*(r*y-o*v)+m*(r*u-o*l),t[3]=-(n*(l*d-u*f)-s*(r*d-o*f)+h*(r*u-o*l)),t[4]=-(a*(f*y-d*v)-c*(l*y-u*v)+p*(l*d-u*f)),t[5]=i*(f*y-d*v)-c*(r*y-o*v)+p*(r*d-o*f),t[6]=-(i*(l*y-u*v)-a*(r*y-o*v)+p*(r*u-o*l)),t[7]=i*(l*d-u*f)-a*(r*d-o*f)+c*(r*u-o*l),t[8]=a*(h*y-d*m)-c*(s*y-u*m)+p*(s*d-u*h),t[9]=-(i*(h*y-d*m)-c*(n*y-o*m)+p*(n*d-o*h)),t[10]=i*(s*y-u*m)-a*(n*y-o*m)+p*(n*u-o*s),t[11]=-(i*(s*d-u*h)-a*(n*d-o*h)+c*(n*u-o*s)),t[12]=-(a*(h*v-f*m)-c*(s*v-l*m)+p*(s*f-l*h)),t[13]=i*(h*v-f*m)-c*(n*v-r*m)+p*(n*f-r*h),t[14]=-(i*(s*v-l*m)-a*(n*v-r*m)+p*(n*l-r*s)),t[15]=i*(s*f-l*h)-a*(n*f-r*h)+c*(n*l-r*s),t},r.SIMD.adjoint=function(t,e){var i,n,r,o,a,s,l,u,c,h,f,d,p,i=SIMD.Float32x4.load(e,0),n=SIMD.Float32x4.load(e,4),r=SIMD.Float32x4.load(e,8),o=SIMD.Float32x4.load(e,12);return c=SIMD.Float32x4.shuffle(i,n,0,1,4,5),s=SIMD.Float32x4.shuffle(r,o,0,1,4,5),a=SIMD.Float32x4.shuffle(c,s,0,2,4,6),s=SIMD.Float32x4.shuffle(s,c,1,3,5,7),c=SIMD.Float32x4.shuffle(i,n,2,3,6,7),u=SIMD.Float32x4.shuffle(r,o,2,3,6,7),l=SIMD.Float32x4.shuffle(c,u,0,2,4,6),u=SIMD.Float32x4.shuffle(u,c,1,3,5,7),c=SIMD.Float32x4.mul(l,u),c=SIMD.Float32x4.swizzle(c,1,0,3,2),h=SIMD.Float32x4.mul(s,c),f=SIMD.Float32x4.mul(a,c),c=SIMD.Float32x4.swizzle(c,2,3,0,1),h=SIMD.Float32x4.sub(SIMD.Float32x4.mul(s,c),h),f=SIMD.Float32x4.sub(SIMD.Float32x4.mul(a,c),f),f=SIMD.Float32x4.swizzle(f,2,3,0,1),c=SIMD.Float32x4.mul(s,l),c=SIMD.Float32x4.swizzle(c,1,0,3,2),h=SIMD.Float32x4.add(SIMD.Float32x4.mul(u,c),h),p=SIMD.Float32x4.mul(a,c),c=SIMD.Float32x4.swizzle(c,2,3,0,1),h=SIMD.Float32x4.sub(h,SIMD.Float32x4.mul(u,c)),p=SIMD.Float32x4.sub(SIMD.Float32x4.mul(a,c),p),p=SIMD.Float32x4.swizzle(p,2,3,0,1),c=SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(s,2,3,0,1),u),c=SIMD.Float32x4.swizzle(c,1,0,3,2),l=SIMD.Float32x4.swizzle(l,2,3,0,1),h=SIMD.Float32x4.add(SIMD.Float32x4.mul(l,c),h),d=SIMD.Float32x4.mul(a,c),c=SIMD.Float32x4.swizzle(c,2,3,0,1),h=SIMD.Float32x4.sub(h,SIMD.Float32x4.mul(l,c)),d=SIMD.Float32x4.sub(SIMD.Float32x4.mul(a,c),d),d=SIMD.Float32x4.swizzle(d,2,3,0,1),c=SIMD.Float32x4.mul(a,s),c=SIMD.Float32x4.swizzle(c,1,0,3,2),d=SIMD.Float32x4.add(SIMD.Float32x4.mul(u,c),d),p=SIMD.Float32x4.sub(SIMD.Float32x4.mul(l,c),p),c=SIMD.Float32x4.swizzle(c,2,3,0,1),d=SIMD.Float32x4.sub(SIMD.Float32x4.mul(u,c),d),p=SIMD.Float32x4.sub(p,SIMD.Float32x4.mul(l,c)),c=SIMD.Float32x4.mul(a,u),c=SIMD.Float32x4.swizzle(c,1,0,3,2),f=SIMD.Float32x4.sub(f,SIMD.Float32x4.mul(l,c)),d=SIMD.Float32x4.add(SIMD.Float32x4.mul(s,c),d),c=SIMD.Float32x4.swizzle(c,2,3,0,1),f=SIMD.Float32x4.add(SIMD.Float32x4.mul(l,c),f),d=SIMD.Float32x4.sub(d,SIMD.Float32x4.mul(s,c)),c=SIMD.Float32x4.mul(a,l),c=SIMD.Float32x4.swizzle(c,1,0,3,2),f=SIMD.Float32x4.add(SIMD.Float32x4.mul(u,c),f),p=SIMD.Float32x4.sub(p,SIMD.Float32x4.mul(s,c)),c=SIMD.Float32x4.swizzle(c,2,3,0,1),f=SIMD.Float32x4.sub(f,SIMD.Float32x4.mul(u,c)),p=SIMD.Float32x4.add(SIMD.Float32x4.mul(s,c),p),SIMD.Float32x4.store(t,0,h),SIMD.Float32x4.store(t,4,f),SIMD.Float32x4.store(t,8,d),SIMD.Float32x4.store(t,12,p),t},r.adjoint=n.USE_SIMD?r.SIMD.adjoint:r.scalar.adjoint,r.determinant=function(t){var e=t[0],i=t[1],n=t[2],r=t[3],o=t[4],a=t[5],s=t[6],l=t[7],u=t[8],c=t[9],h=t[10],f=t[11],d=t[12],p=t[13],m=t[14],v=t[15],y=e*a-i*o,_=e*s-n*o,g=e*l-r*o,x=i*s-n*a,b=i*l-r*a,w=n*l-r*s,M=u*p-c*d,S=u*m-h*d,E=u*v-f*d,T=c*m-h*p,I=c*v-f*p,D=h*v-f*m;return y*D-_*I+g*T+x*E-b*S+w*M},r.SIMD.multiply=function(t,e,i){var n=SIMD.Float32x4.load(e,0),r=SIMD.Float32x4.load(e,4),o=SIMD.Float32x4.load(e,8),a=SIMD.Float32x4.load(e,12),s=SIMD.Float32x4.load(i,0),l=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(s,0,0,0,0),n),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(s,1,1,1,1),r),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(s,2,2,2,2),o),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(s,3,3,3,3),a))));SIMD.Float32x4.store(t,0,l);var u=SIMD.Float32x4.load(i,4),c=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(u,0,0,0,0),n),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(u,1,1,1,1),r),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(u,2,2,2,2),o),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(u,3,3,3,3),a))));SIMD.Float32x4.store(t,4,c);var h=SIMD.Float32x4.load(i,8),f=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(h,0,0,0,0),n),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(h,1,1,1,1),r),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(h,2,2,2,2),o),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(h,3,3,3,3),a))));SIMD.Float32x4.store(t,8,f);var d=SIMD.Float32x4.load(i,12),p=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(d,0,0,0,0),n),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(d,1,1,1,1),r),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(d,2,2,2,2),o),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(d,3,3,3,3),a))));return SIMD.Float32x4.store(t,12,p),t},r.scalar.multiply=function(t,e,i){var n=e[0],r=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],f=e[9],d=e[10],p=e[11],m=e[12],v=e[13],y=e[14],_=e[15],g=i[0],x=i[1],b=i[2],w=i[3];return t[0]=g*n+x*s+b*h+w*m,t[1]=g*r+x*l+b*f+w*v,t[2]=g*o+x*u+b*d+w*y,t[3]=g*a+x*c+b*p+w*_,g=i[4],x=i[5],b=i[6],w=i[7],t[4]=g*n+x*s+b*h+w*m,t[5]=g*r+x*l+b*f+w*v,t[6]=g*o+x*u+b*d+w*y,t[7]=g*a+x*c+b*p+w*_,g=i[8],x=i[9],b=i[10],w=i[11],t[8]=g*n+x*s+b*h+w*m,t[9]=g*r+x*l+b*f+w*v,t[10]=g*o+x*u+b*d+w*y,t[11]=g*a+x*c+b*p+w*_,g=i[12],x=i[13],b=i[14],w=i[15],t[12]=g*n+x*s+b*h+w*m,t[13]=g*r+x*l+b*f+w*v,t[14]=g*o+x*u+b*d+w*y,t[15]=g*a+x*c+b*p+w*_,t},r.multiply=n.USE_SIMD?r.SIMD.multiply:r.scalar.multiply,r.mul=r.multiply,r.scalar.translate=function(t,e,i){var n=i[0],r=i[1],o=i[2],a,s,l,u,c,h,f,d,p,m,v,y;return e===t?(t[12]=e[0]*n+e[4]*r+e[8]*o+e[12],t[13]=e[1]*n+e[5]*r+e[9]*o+e[13],t[14]=e[2]*n+e[6]*r+e[10]*o+e[14],t[15]=e[3]*n+e[7]*r+e[11]*o+e[15]):(a=e[0],s=e[1],l=e[2],u=e[3],c=e[4],h=e[5],f=e[6],d=e[7],p=e[8],m=e[9],v=e[10],y=e[11],t[0]=a,t[1]=s,t[2]=l,t[3]=u,t[4]=c,t[5]=h,t[6]=f,t[7]=d,t[8]=p,t[9]=m,t[10]=v,t[11]=y,t[12]=a*n+c*r+p*o+e[12],t[13]=s*n+h*r+m*o+e[13],t[14]=l*n+f*r+v*o+e[14],t[15]=u*n+d*r+y*o+e[15]),t},r.SIMD.translate=function(t,e,i){var n=SIMD.Float32x4.load(e,0),r=SIMD.Float32x4.load(e,4),o=SIMD.Float32x4.load(e,8),a=SIMD.Float32x4.load(e,12),s=SIMD.Float32x4(i[0],i[1],i[2],0);e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11]),n=SIMD.Float32x4.mul(n,SIMD.Float32x4.swizzle(s,0,0,0,0)),r=SIMD.Float32x4.mul(r,SIMD.Float32x4.swizzle(s,1,1,1,1)),o=SIMD.Float32x4.mul(o,SIMD.Float32x4.swizzle(s,2,2,2,2));var l=SIMD.Float32x4.add(n,SIMD.Float32x4.add(r,SIMD.Float32x4.add(o,a)));return SIMD.Float32x4.store(t,12,l),t},r.translate=n.USE_SIMD?r.SIMD.translate:r.scalar.translate,r.scalar.scale=function(t,e,i){var n=i[0],r=i[1],o=i[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},r.SIMD.scale=function(t,e,i){var n,r,o,a=SIMD.Float32x4(i[0],i[1],i[2],0);return n=SIMD.Float32x4.load(e,0),SIMD.Float32x4.store(t,0,SIMD.Float32x4.mul(n,SIMD.Float32x4.swizzle(a,0,0,0,0))),r=SIMD.Float32x4.load(e,4),SIMD.Float32x4.store(t,4,SIMD.Float32x4.mul(r,SIMD.Float32x4.swizzle(a,1,1,1,1))),o=SIMD.Float32x4.load(e,8),SIMD.Float32x4.store(t,8,SIMD.Float32x4.mul(o,SIMD.Float32x4.swizzle(a,2,2,2,2))),t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},r.scale=n.USE_SIMD?r.SIMD.scale:r.scalar.scale,r.rotate=function(t,e,i,r){var o=r[0],a=r[1],s=r[2],l=Math.sqrt(o*o+a*a+s*s),u,c,h,f,d,p,m,v,y,_,g,x,b,w,M,S,E,T,I,D,z,P,L,F;return Math.abs(l)<n.EPSILON?null:(l=1/l,o*=l,a*=l,s*=l,u=Math.sin(i),c=Math.cos(i),h=1-c,f=e[0],d=e[1],p=e[2],m=e[3],v=e[4],y=e[5],_=e[6],g=e[7],x=e[8],b=e[9],w=e[10],M=e[11],S=o*o*h+c,E=a*o*h+s*u,T=s*o*h-a*u,I=o*a*h-s*u,D=a*a*h+c,z=s*a*h+o*u,P=o*s*h+a*u,L=a*s*h-o*u,F=s*s*h+c,t[0]=f*S+v*E+x*T,t[1]=d*S+y*E+b*T,t[2]=p*S+_*E+w*T,t[3]=m*S+g*E+M*T,t[4]=f*I+v*D+x*z,t[5]=d*I+y*D+b*z,t[6]=p*I+_*D+w*z,t[7]=m*I+g*D+M*z,t[8]=f*P+v*L+x*F,t[9]=d*P+y*L+b*F,t[10]=p*P+_*L+w*F,t[11]=m*P+g*L+M*F,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},r.scalar.rotateX=function(t,e,i){var n=Math.sin(i),r=Math.cos(i),o=e[4],a=e[5],s=e[6],l=e[7],u=e[8],c=e[9],h=e[10],f=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*r+u*n,t[5]=a*r+c*n,t[6]=s*r+h*n,t[7]=l*r+f*n,t[8]=u*r-o*n,t[9]=c*r-a*n,t[10]=h*r-s*n,t[11]=f*r-l*n,t},r.SIMD.rotateX=function(t,e,i){var n=SIMD.Float32x4.splat(Math.sin(i)),r=SIMD.Float32x4.splat(Math.cos(i));e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);var o=SIMD.Float32x4.load(e,4),a=SIMD.Float32x4.load(e,8);return SIMD.Float32x4.store(t,4,SIMD.Float32x4.add(SIMD.Float32x4.mul(o,r),SIMD.Float32x4.mul(a,n))),SIMD.Float32x4.store(t,8,SIMD.Float32x4.sub(SIMD.Float32x4.mul(a,r),SIMD.Float32x4.mul(o,n))),t},r.rotateX=n.USE_SIMD?r.SIMD.rotateX:r.scalar.rotateX,r.scalar.rotateY=function(t,e,i){var n=Math.sin(i),r=Math.cos(i),o=e[0],a=e[1],s=e[2],l=e[3],u=e[8],c=e[9],h=e[10],f=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*r-u*n,t[1]=a*r-c*n,t[2]=s*r-h*n,t[3]=l*r-f*n,t[8]=o*n+u*r,t[9]=a*n+c*r,t[10]=s*n+h*r,t[11]=l*n+f*r,t},r.SIMD.rotateY=function(t,e,i){var n=SIMD.Float32x4.splat(Math.sin(i)),r=SIMD.Float32x4.splat(Math.cos(i));e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);var o=SIMD.Float32x4.load(e,0),a=SIMD.Float32x4.load(e,8);return SIMD.Float32x4.store(t,0,SIMD.Float32x4.sub(SIMD.Float32x4.mul(o,r),SIMD.Float32x4.mul(a,n))),SIMD.Float32x4.store(t,8,SIMD.Float32x4.add(SIMD.Float32x4.mul(o,n),SIMD.Float32x4.mul(a,r))),t},r.rotateY=n.USE_SIMD?r.SIMD.rotateY:r.scalar.rotateY,r.scalar.rotateZ=function(t,e,i){var n=Math.sin(i),r=Math.cos(i),o=e[0],a=e[1],s=e[2],l=e[3],u=e[4],c=e[5],h=e[6],f=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*r+u*n,t[1]=a*r+c*n,t[2]=s*r+h*n,t[3]=l*r+f*n,t[4]=u*r-o*n,t[5]=c*r-a*n,t[6]=h*r-s*n,t[7]=f*r-l*n,t},r.SIMD.rotateZ=function(t,e,i){var n=SIMD.Float32x4.splat(Math.sin(i)),r=SIMD.Float32x4.splat(Math.cos(i));e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);var o=SIMD.Float32x4.load(e,0),a=SIMD.Float32x4.load(e,4);return SIMD.Float32x4.store(t,0,SIMD.Float32x4.add(SIMD.Float32x4.mul(o,r),SIMD.Float32x4.mul(a,n))),SIMD.Float32x4.store(t,4,SIMD.Float32x4.sub(SIMD.Float32x4.mul(a,r),SIMD.Float32x4.mul(o,n))),t},r.rotateZ=n.USE_SIMD?r.SIMD.rotateZ:r.scalar.rotateZ,r.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t},r.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},r.fromRotation=function(t,e,i){var r=i[0],o=i[1],a=i[2],s=Math.sqrt(r*r+o*o+a*a),l,u,c;return Math.abs(s)<n.EPSILON?null:(s=1/s,r*=s,o*=s,a*=s,l=Math.sin(e),u=Math.cos(e),c=1-u,t[0]=r*r*c+u,t[1]=o*r*c+a*l,t[2]=a*r*c-o*l,t[3]=0,t[4]=r*o*c-a*l,t[5]=o*o*c+u,t[6]=a*o*c+r*l,t[7]=0,t[8]=r*a*c+o*l,t[9]=o*a*c-r*l,t[10]=a*a*c+u,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)},r.fromXRotation=function(t,e){var i=Math.sin(e),n=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n,t[6]=i,t[7]=0,t[8]=0,t[9]=-i,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},r.fromYRotation=function(t,e){var i=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=i,t[9]=0,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},r.fromZRotation=function(t,e){var i=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=i,t[2]=0,t[3]=0,t[4]=-i,t[5]=n,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},r.fromRotationTranslation=function(t,e,i){var n=e[0],r=e[1],o=e[2],a=e[3],s=n+n,l=r+r,u=o+o,c=n*s,h=n*l,f=n*u,d=r*l,p=r*u,m=o*u,v=a*s,y=a*l,_=a*u;return t[0]=1-(d+m),t[1]=h+_,t[2]=f-y,t[3]=0,t[4]=h-_,t[5]=1-(c+m),t[6]=p+v,t[7]=0,t[8]=f+y,t[9]=p-v,t[10]=1-(c+d),t[11]=0,t[12]=i[0],t[13]=i[1],t[14]=i[2],t[15]=1,t},r.getTranslation=function(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t},r.getRotation=function(t,e){var i=e[0]+e[5]+e[10],n=0;return i>0?(n=2*Math.sqrt(i+1),t[3]=.25*n,t[0]=(e[6]-e[9])/n,t[1]=(e[8]-e[2])/n,t[2]=(e[1]-e[4])/n):e[0]>e[5]&e[0]>e[10]?(n=2*Math.sqrt(1+e[0]-e[5]-e[10]),t[3]=(e[6]-e[9])/n,t[0]=.25*n,t[1]=(e[1]+e[4])/n,t[2]=(e[8]+e[2])/n):e[5]>e[10]?(n=2*Math.sqrt(1+e[5]-e[0]-e[10]),t[3]=(e[8]-e[2])/n,t[0]=(e[1]+e[4])/n,t[1]=.25*n,t[2]=(e[6]+e[9])/n):(n=2*Math.sqrt(1+e[10]-e[0]-e[5]),t[3]=(e[1]-e[4])/n,t[0]=(e[8]+e[2])/n,t[1]=(e[6]+e[9])/n,t[2]=.25*n),t},r.fromRotationTranslationScale=function(t,e,i,n){var r=e[0],o=e[1],a=e[2],s=e[3],l=r+r,u=o+o,c=a+a,h=r*l,f=r*u,d=r*c,p=o*u,m=o*c,v=a*c,y=s*l,_=s*u,g=s*c,x=n[0],b=n[1],w=n[2];return t[0]=(1-(p+v))*x,t[1]=(f+g)*x,t[2]=(d-_)*x,t[3]=0,t[4]=(f-g)*b,t[5]=(1-(h+v))*b,t[6]=(m+y)*b,t[7]=0,t[8]=(d+_)*w,t[9]=(m-y)*w,t[10]=(1-(h+p))*w,t[11]=0,t[12]=i[0],t[13]=i[1],t[14]=i[2],t[15]=1,t},r.fromRotationTranslationScaleOrigin=function(t,e,i,n,r){var o=e[0],a=e[1],s=e[2],l=e[3],u=o+o,c=a+a,h=s+s,f=o*u,d=o*c,p=o*h,m=a*c,v=a*h,y=s*h,_=l*u,g=l*c,x=l*h,b=n[0],w=n[1],M=n[2],S=r[0],E=r[1],T=r[2];return t[0]=(1-(m+y))*b,t[1]=(d+x)*b,t[2]=(p-g)*b,t[3]=0,t[4]=(d-x)*w,t[5]=(1-(f+y))*w,t[6]=(v+_)*w,t[7]=0,t[8]=(p+g)*M,t[9]=(v-_)*M,t[10]=(1-(f+m))*M,t[11]=0,t[12]=i[0]+S-(t[0]*S+t[4]*E+t[8]*T),t[13]=i[1]+E-(t[1]*S+t[5]*E+t[9]*T),t[14]=i[2]+T-(t[2]*S+t[6]*E+t[10]*T),t[15]=1,t},r.fromQuat=function(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],a=i+i,s=n+n,l=r+r,u=i*a,c=n*a,h=n*s,f=r*a,d=r*s,p=r*l,m=o*a,v=o*s,y=o*l;return t[0]=1-h-p,t[1]=c+y,t[2]=f-v,t[3]=0,t[4]=c-y,t[5]=1-u-p,t[6]=d+m,t[7]=0,t[8]=f+v,t[9]=d-m,t[10]=1-u-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},r.frustum=function(t,e,i,n,r,o,a){var s=1/(i-e),l=1/(r-n),u=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*l,t[6]=0,t[7]=0,t[8]=(i+e)*s,t[9]=(r+n)*l,t[10]=(a+o)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*u,t[15]=0,t},r.perspective=function(t,e,i,n,r){var o=1/Math.tan(e/2),a=1/(n-r);return t[0]=o/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(r+n)*a,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*r*n*a,t[15]=0,t},r.perspectiveFromFieldOfView=function(t,e,i,n){var r=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),l=2/(a+s),u=2/(r+o);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=-((a-s)*l*.5),t[9]=(r-o)*u*.5,t[10]=n/(i-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*i/(i-n),t[15]=0,t},r.ortho=function(t,e,i,n,r,o,a){var s=1/(e-i),l=1/(n-r),u=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+i)*s,t[13]=(r+n)*l,t[14]=(a+o)*u,t[15]=1,t},r.lookAt=function(t,e,i,o){var a,s,l,u,c,h,f,d,p,m,v=e[0],y=e[1],_=e[2],g=o[0],x=o[1],b=o[2],w=i[0],M=i[1],S=i[2];return Math.abs(v-w)<n.EPSILON&&Math.abs(y-M)<n.EPSILON&&Math.abs(_-S)<n.EPSILON?r.identity(t):(f=v-w,d=y-M,p=_-S,m=1/Math.sqrt(f*f+d*d+p*p),f*=m,d*=m,p*=m,a=x*p-b*d,s=b*f-g*p,l=g*d-x*f,m=Math.sqrt(a*a+s*s+l*l),m?(m=1/m,a*=m,s*=m,l*=m):(a=0,s=0,l=0),u=d*l-p*s,c=p*a-f*l,h=f*s-d*a,m=Math.sqrt(u*u+c*c+h*h),m?(m=1/m,u*=m,c*=m,h*=m):(u=0,c=0,h=0),t[0]=a,t[1]=u,t[2]=f,t[3]=0,t[4]=s,t[5]=c,t[6]=d,t[7]=0,t[8]=l,t[9]=h,t[10]=p,t[11]=0,t[12]=-(a*v+s*y+l*_),t[13]=-(u*v+c*y+h*_),t[14]=-(f*v+d*y+p*_),t[15]=1,t)},r.str=function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},r.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2)+Math.pow(t[9],2)+Math.pow(t[10],2)+Math.pow(t[11],2)+Math.pow(t[12],2)+Math.pow(t[13],2)+Math.pow(t[14],2)+Math.pow(t[15],2))},r.add=function(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t[3]=e[3]+i[3],t[4]=e[4]+i[4],t[5]=e[5]+i[5],t[6]=e[6]+i[6],t[7]=e[7]+i[7],t[8]=e[8]+i[8],t[9]=e[9]+i[9],t[10]=e[10]+i[10],t[11]=e[11]+i[11],t[12]=e[12]+i[12],t[13]=e[13]+i[13],t[14]=e[14]+i[14],t[15]=e[15]+i[15],t},r.subtract=function(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t[3]=e[3]-i[3],t[4]=e[4]-i[4],t[5]=e[5]-i[5],t[6]=e[6]-i[6],t[7]=e[7]-i[7],t[8]=e[8]-i[8],t[9]=e[9]-i[9],t[10]=e[10]-i[10],t[11]=e[11]-i[11],t[12]=e[12]-i[12],t[13]=e[13]-i[13],t[14]=e[14]-i[14],t[15]=e[15]-i[15],t},r.sub=r.subtract,r.multiplyScalar=function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*i,t[9]=e[9]*i,t[10]=e[10]*i,t[11]=e[11]*i,t[12]=e[12]*i,t[13]=e[13]*i,t[14]=e[14]*i,t[15]=e[15]*i,t},r.multiplyScalarAndAdd=function(t,e,i,n){return t[0]=e[0]+i[0]*n,t[1]=e[1]+i[1]*n,t[2]=e[2]+i[2]*n,t[3]=e[3]+i[3]*n,t[4]=e[4]+i[4]*n,t[5]=e[5]+i[5]*n,t[6]=e[6]+i[6]*n,t[7]=e[7]+i[7]*n,t[8]=e[8]+i[8]*n,t[9]=e[9]+i[9]*n,t[10]=e[10]+i[10]*n,t[11]=e[11]+i[11]*n,t[12]=e[12]+i[12]*n,t[13]=e[13]+i[13]*n,t[14]=e[14]+i[14]*n,t[15]=e[15]+i[15]*n,t},r.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},r.equals=function(t,e){var i=t[0],r=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],f=t[9],d=t[10],p=t[11],m=t[12],v=t[13],y=t[14],_=t[15],g=e[0],x=e[1],b=e[2],w=e[3],M=e[4],S=e[5],E=e[6],T=e[7],I=e[8],D=e[9],z=e[10],P=e[11],L=e[12],F=e[13],A=e[14],k=e[15];return Math.abs(i-g)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(g))&&Math.abs(r-x)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(x))&&Math.abs(o-b)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(b))&&Math.abs(a-w)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(s-M)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(l-S)<=n.EPSILON*Math.max(1,Math.abs(l),Math.abs(S))&&Math.abs(u-E)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(E))&&Math.abs(c-T)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(T))&&Math.abs(h-I)<=n.EPSILON*Math.max(1,Math.abs(h),Math.abs(I))&&Math.abs(f-D)<=n.EPSILON*Math.max(1,Math.abs(f),Math.abs(D))&&Math.abs(d-z)<=n.EPSILON*Math.max(1,Math.abs(d),Math.abs(z))&&Math.abs(p-P)<=n.EPSILON*Math.max(1,Math.abs(p),Math.abs(P))&&Math.abs(m-L)<=n.EPSILON*Math.max(1,Math.abs(m),Math.abs(L))&&Math.abs(v-F)<=n.EPSILON*Math.max(1,Math.abs(v),Math.abs(F))&&Math.abs(y-A)<=n.EPSILON*Math.max(1,Math.abs(y),Math.abs(A))&&Math.abs(_-k)<=n.EPSILON*Math.max(1,Math.abs(_),Math.abs(k))},e.exports=r},{"./common.js":13}],18:[function(t,e,i){var n=t("./common.js"),r=t("./mat3.js"),o=t("./vec3.js"),a=t("./vec4.js"),s={};s.create=function(){var t=new n.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},s.rotationTo=function(){var t=o.create(),e=o.fromValues(1,0,0),i=o.fromValues(0,1,0);return function(n,r,a){var l=o.dot(r,a);return-.999999>l?(o.cross(t,e,r),o.length(t)<1e-6&&o.cross(t,i,r),o.normalize(t,t),s.setAxisAngle(n,t,Math.PI),n):l>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(o.cross(t,r,a),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+l,s.normalize(n,n))}}(),s.setAxes=function(){var t=r.create();return function(e,i,n,r){return t[0]=n[0],t[3]=n[1],t[6]=n[2],t[1]=r[0],t[4]=r[1],t[7]=r[2],t[2]=-i[0],t[5]=-i[1],t[8]=-i[2],s.normalize(e,s.fromMat3(e,t))}}(),s.clone=a.clone,s.fromValues=a.fromValues,s.copy=a.copy,s.set=a.set,s.identity=function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},s.setAxisAngle=function(t,e,i){i=.5*i;var n=Math.sin(i);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(i),t},s.getAxisAngle=function(t,e){var i=2*Math.acos(e[3]),n=Math.sin(i/2);return 0!=n?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=1,t[1]=0,t[2]=0),i},s.add=a.add,s.multiply=function(t,e,i){var n=e[0],r=e[1],o=e[2],a=e[3],s=i[0],l=i[1],u=i[2],c=i[3];return t[0]=n*c+a*s+r*u-o*l,t[1]=r*c+a*l+o*s-n*u,t[2]=o*c+a*u+n*l-r*s,t[3]=a*c-n*s-r*l-o*u,t},s.mul=s.multiply,s.scale=a.scale,s.rotateX=function(t,e,i){i*=.5;var n=e[0],r=e[1],o=e[2],a=e[3],s=Math.sin(i),l=Math.cos(i);return t[0]=n*l+a*s,t[1]=r*l+o*s,t[2]=o*l-r*s,t[3]=a*l-n*s,t},s.rotateY=function(t,e,i){i*=.5;var n=e[0],r=e[1],o=e[2],a=e[3],s=Math.sin(i),l=Math.cos(i);return t[0]=n*l-o*s,t[1]=r*l+a*s,t[2]=o*l+n*s,t[3]=a*l-r*s,t},s.rotateZ=function(t,e,i){i*=.5;var n=e[0],r=e[1],o=e[2],a=e[3],s=Math.sin(i),l=Math.cos(i);return t[0]=n*l+r*s,t[1]=r*l-n*s,t[2]=o*l+a*s,t[3]=a*l-o*s,t},s.calculateW=function(t,e){var i=e[0],n=e[1],r=e[2];return t[0]=i,t[1]=n,t[2]=r,t[3]=Math.sqrt(Math.abs(1-i*i-n*n-r*r)),t},s.dot=a.dot,s.lerp=a.lerp,s.slerp=function(t,e,i,n){var r=e[0],o=e[1],a=e[2],s=e[3],l=i[0],u=i[1],c=i[2],h=i[3],f,d,p,m,v;return d=r*l+o*u+a*c+s*h,0>d&&(d=-d,l=-l,u=-u,c=-c,h=-h),1-d>1e-6?(f=Math.acos(d),p=Math.sin(f),m=Math.sin((1-n)*f)/p,v=Math.sin(n*f)/p):(m=1-n,v=n),t[0]=m*r+v*l,t[1]=m*o+v*u,t[2]=m*a+v*c,t[3]=m*s+v*h,t},s.sqlerp=function(){var t=s.create(),e=s.create();return function(i,n,r,o,a,l){return s.slerp(t,n,a,l),s.slerp(e,r,o,l),s.slerp(i,t,e,2*l*(1-l)),i}}(),s.invert=function(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],a=i*i+n*n+r*r+o*o,s=a?1/a:0;return t[0]=-i*s,t[1]=-n*s,t[2]=-r*s,t[3]=o*s,t},s.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},s.length=a.length,s.len=s.length,s.squaredLength=a.squaredLength,s.sqrLen=s.squaredLength,s.normalize=a.normalize,s.fromMat3=function(t,e){var i=e[0]+e[4]+e[8],n;if(i>0)n=Math.sqrt(i+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{var r=0;e[4]>e[0]&&(r=1),e[8]>e[3*r+r]&&(r=2);var o=(r+1)%3,a=(r+2)%3;n=Math.sqrt(e[3*r+r]-e[3*o+o]-e[3*a+a]+1),t[r]=.5*n,n=.5/n,t[3]=(e[3*o+a]-e[3*a+o])*n,t[o]=(e[3*o+r]+e[3*r+o])*n,t[a]=(e[3*a+r]+e[3*r+a])*n}return t},s.str=function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},s.exactEquals=a.exactEquals,s.equals=a.equals,e.exports=s},{"./common.js":13,"./mat3.js":16,"./vec3.js":20,"./vec4.js":21}],19:[function(t,e,i){var n=t("./common.js"),r={};r.create=function(){var t=new n.ARRAY_TYPE(2);return t[0]=0,t[1]=0,t},r.clone=function(t){var e=new n.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e},r.fromValues=function(t,e){var i=new n.ARRAY_TYPE(2);return i[0]=t,i[1]=e,i},r.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},r.set=function(t,e,i){return t[0]=e,t[1]=i,t},r.add=function(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t},r.subtract=function(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t},r.sub=r.subtract,r.multiply=function(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t},r.mul=r.multiply,r.divide=function(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t},r.div=r.divide,r.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},r.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},r.min=function(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t},r.max=function(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t},r.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},r.scale=function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t},r.scaleAndAdd=function(t,e,i,n){return t[0]=e[0]+i[0]*n,t[1]=e[1]+i[1]*n,t},r.distance=function(t,e){var i=e[0]-t[0],n=e[1]-t[1];return Math.sqrt(i*i+n*n)},r.dist=r.distance,r.squaredDistance=function(t,e){var i=e[0]-t[0],n=e[1]-t[1];return i*i+n*n},r.sqrDist=r.squaredDistance,r.length=function(t){var e=t[0],i=t[1];return Math.sqrt(e*e+i*i)},r.len=r.length,r.squaredLength=function(t){var e=t[0],i=t[1];return e*e+i*i},r.sqrLen=r.squaredLength,r.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},r.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},r.normalize=function(t,e){var i=e[0],n=e[1],r=i*i+n*n;return r>0&&(r=1/Math.sqrt(r),t[0]=e[0]*r,t[1]=e[1]*r),t},r.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},r.cross=function(t,e,i){var n=e[0]*i[1]-e[1]*i[0];return t[0]=t[1]=0,t[2]=n,t},r.lerp=function(t,e,i,n){var r=e[0],o=e[1];return t[0]=r+n*(i[0]-r),t[1]=o+n*(i[1]-o),t},r.random=function(t,e){e=e||1;var i=2*n.RANDOM()*Math.PI;return t[0]=Math.cos(i)*e,t[1]=Math.sin(i)*e,t},r.transformMat2=function(t,e,i){var n=e[0],r=e[1];return t[0]=i[0]*n+i[2]*r,t[1]=i[1]*n+i[3]*r,t},r.transformMat2d=function(t,e,i){var n=e[0],r=e[1];return t[0]=i[0]*n+i[2]*r+i[4],t[1]=i[1]*n+i[3]*r+i[5],t},r.transformMat3=function(t,e,i){var n=e[0],r=e[1];return t[0]=i[0]*n+i[3]*r+i[6],t[1]=i[1]*n+i[4]*r+i[7],t},r.transformMat4=function(t,e,i){var n=e[0],r=e[1];return t[0]=i[0]*n+i[4]*r+i[12],t[1]=i[1]*n+i[5]*r+i[13],t},r.forEach=function(){var t=r.create();return function(e,i,n,r,o,a){var s,l;for(i||(i=2),n||(n=0),l=r?Math.min(r*i+n,e.length):e.length,s=n;l>s;s+=i)t[0]=e[s],t[1]=e[s+1],o(t,t,a),e[s]=t[0],e[s+1]=t[1];return e}}(),r.str=function(t){return"vec2("+t[0]+", "+t[1]+")"},r.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]},r.equals=function(t,e){var i=t[0],r=t[1],o=e[0],a=e[1];return Math.abs(i-o)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(o))&&Math.abs(r-a)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))},e.exports=r},{"./common.js":13}],20:[function(t,e,i){var n=t("./common.js"),r={};r.create=function(){var t=new n.ARRAY_TYPE(3);return t[0]=0,t[1]=0,t[2]=0,t},r.clone=function(t){var e=new n.ARRAY_TYPE(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},r.fromValues=function(t,e,i){var r=new n.ARRAY_TYPE(3);return r[0]=t,r[1]=e,r[2]=i,r},r.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},r.set=function(t,e,i,n){return t[0]=e,t[1]=i,t[2]=n,t},r.add=function(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t},r.subtract=function(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t},r.sub=r.subtract,r.multiply=function(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t[2]=e[2]*i[2],t},r.mul=r.multiply,r.divide=function(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t[2]=e[2]/i[2],t},r.div=r.divide,r.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t},r.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t},r.min=function(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t[2]=Math.min(e[2],i[2]),t},r.max=function(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t[2]=Math.max(e[2],i[2]),t},r.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t},r.scale=function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t},r.scaleAndAdd=function(t,e,i,n){return t[0]=e[0]+i[0]*n,t[1]=e[1]+i[1]*n,t[2]=e[2]+i[2]*n,t},r.distance=function(t,e){var i=e[0]-t[0],n=e[1]-t[1],r=e[2]-t[2];return Math.sqrt(i*i+n*n+r*r)},r.dist=r.distance,r.squaredDistance=function(t,e){var i=e[0]-t[0],n=e[1]-t[1],r=e[2]-t[2];return i*i+n*n+r*r},r.sqrDist=r.squaredDistance,r.length=function(t){var e=t[0],i=t[1],n=t[2];return Math.sqrt(e*e+i*i+n*n)},r.len=r.length,r.squaredLength=function(t){var e=t[0],i=t[1],n=t[2];return e*e+i*i+n*n},r.sqrLen=r.squaredLength,r.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t},r.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t},r.normalize=function(t,e){var i=e[0],n=e[1],r=e[2],o=i*i+n*n+r*r;return o>0&&(o=1/Math.sqrt(o),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o),t},r.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},r.cross=function(t,e,i){var n=e[0],r=e[1],o=e[2],a=i[0],s=i[1],l=i[2];return t[0]=r*l-o*s,t[1]=o*a-n*l,t[2]=n*s-r*a,t},r.lerp=function(t,e,i,n){var r=e[0],o=e[1],a=e[2];return t[0]=r+n*(i[0]-r),t[1]=o+n*(i[1]-o),t[2]=a+n*(i[2]-a),t},r.hermite=function(t,e,i,n,r,o){var a=o*o,s=a*(2*o-3)+1,l=a*(o-2)+o,u=a*(o-1),c=a*(3-2*o);return t[0]=e[0]*s+i[0]*l+n[0]*u+r[0]*c,t[1]=e[1]*s+i[1]*l+n[1]*u+r[1]*c,t[2]=e[2]*s+i[2]*l+n[2]*u+r[2]*c,t},r.bezier=function(t,e,i,n,r,o){var a=1-o,s=a*a,l=o*o,u=s*a,c=3*o*s,h=3*l*a,f=l*o;return t[0]=e[0]*u+i[0]*c+n[0]*h+r[0]*f,t[1]=e[1]*u+i[1]*c+n[1]*h+r[1]*f,t[2]=e[2]*u+i[2]*c+n[2]*h+r[2]*f,t},r.random=function(t,e){e=e||1;var i=2*n.RANDOM()*Math.PI,r=2*n.RANDOM()-1,o=Math.sqrt(1-r*r)*e;return t[0]=Math.cos(i)*o,t[1]=Math.sin(i)*o,t[2]=r*e,t},r.transformMat4=function(t,e,i){var n=e[0],r=e[1],o=e[2],a=i[3]*n+i[7]*r+i[11]*o+i[15];return a=a||1,t[0]=(i[0]*n+i[4]*r+i[8]*o+i[12])/a,t[1]=(i[1]*n+i[5]*r+i[9]*o+i[13])/a,t[2]=(i[2]*n+i[6]*r+i[10]*o+i[14])/a,t},
r.transformMat3=function(t,e,i){var n=e[0],r=e[1],o=e[2];return t[0]=n*i[0]+r*i[3]+o*i[6],t[1]=n*i[1]+r*i[4]+o*i[7],t[2]=n*i[2]+r*i[5]+o*i[8],t},r.transformQuat=function(t,e,i){var n=e[0],r=e[1],o=e[2],a=i[0],s=i[1],l=i[2],u=i[3],c=u*n+s*o-l*r,h=u*r+l*n-a*o,f=u*o+a*r-s*n,d=-a*n-s*r-l*o;return t[0]=c*u+d*-a+h*-l-f*-s,t[1]=h*u+d*-s+f*-a-c*-l,t[2]=f*u+d*-l+c*-s-h*-a,t},r.rotateX=function(t,e,i,n){var r=[],o=[];return r[0]=e[0]-i[0],r[1]=e[1]-i[1],r[2]=e[2]-i[2],o[0]=r[0],o[1]=r[1]*Math.cos(n)-r[2]*Math.sin(n),o[2]=r[1]*Math.sin(n)+r[2]*Math.cos(n),t[0]=o[0]+i[0],t[1]=o[1]+i[1],t[2]=o[2]+i[2],t},r.rotateY=function(t,e,i,n){var r=[],o=[];return r[0]=e[0]-i[0],r[1]=e[1]-i[1],r[2]=e[2]-i[2],o[0]=r[2]*Math.sin(n)+r[0]*Math.cos(n),o[1]=r[1],o[2]=r[2]*Math.cos(n)-r[0]*Math.sin(n),t[0]=o[0]+i[0],t[1]=o[1]+i[1],t[2]=o[2]+i[2],t},r.rotateZ=function(t,e,i,n){var r=[],o=[];return r[0]=e[0]-i[0],r[1]=e[1]-i[1],r[2]=e[2]-i[2],o[0]=r[0]*Math.cos(n)-r[1]*Math.sin(n),o[1]=r[0]*Math.sin(n)+r[1]*Math.cos(n),o[2]=r[2],t[0]=o[0]+i[0],t[1]=o[1]+i[1],t[2]=o[2]+i[2],t},r.forEach=function(){var t=r.create();return function(e,i,n,r,o,a){var s,l;for(i||(i=3),n||(n=0),l=r?Math.min(r*i+n,e.length):e.length,s=n;l>s;s+=i)t[0]=e[s],t[1]=e[s+1],t[2]=e[s+2],o(t,t,a),e[s]=t[0],e[s+1]=t[1],e[s+2]=t[2];return e}}(),r.angle=function(t,e){var i=r.fromValues(t[0],t[1],t[2]),n=r.fromValues(e[0],e[1],e[2]);r.normalize(i,i),r.normalize(n,n);var o=r.dot(i,n);return o>1?0:Math.acos(o)},r.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},r.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},r.equals=function(t,e){var i=t[0],r=t[1],o=t[2],a=e[0],s=e[1],l=e[2];return Math.abs(i-a)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(a))&&Math.abs(r-s)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(o-l)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(l))},e.exports=r},{"./common.js":13}],21:[function(t,e,i){var n=t("./common.js"),r={};r.create=function(){var t=new n.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t},r.clone=function(t){var e=new n.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},r.fromValues=function(t,e,i,r){var o=new n.ARRAY_TYPE(4);return o[0]=t,o[1]=e,o[2]=i,o[3]=r,o},r.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},r.set=function(t,e,i,n,r){return t[0]=e,t[1]=i,t[2]=n,t[3]=r,t},r.add=function(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t[3]=e[3]+i[3],t},r.subtract=function(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t[3]=e[3]-i[3],t},r.sub=r.subtract,r.multiply=function(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t[2]=e[2]*i[2],t[3]=e[3]*i[3],t},r.mul=r.multiply,r.divide=function(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t[2]=e[2]/i[2],t[3]=e[3]/i[3],t},r.div=r.divide,r.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t},r.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t},r.min=function(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t[2]=Math.min(e[2],i[2]),t[3]=Math.min(e[3],i[3]),t},r.max=function(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t[2]=Math.max(e[2],i[2]),t[3]=Math.max(e[3],i[3]),t},r.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t},r.scale=function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t},r.scaleAndAdd=function(t,e,i,n){return t[0]=e[0]+i[0]*n,t[1]=e[1]+i[1]*n,t[2]=e[2]+i[2]*n,t[3]=e[3]+i[3]*n,t},r.distance=function(t,e){var i=e[0]-t[0],n=e[1]-t[1],r=e[2]-t[2],o=e[3]-t[3];return Math.sqrt(i*i+n*n+r*r+o*o)},r.dist=r.distance,r.squaredDistance=function(t,e){var i=e[0]-t[0],n=e[1]-t[1],r=e[2]-t[2],o=e[3]-t[3];return i*i+n*n+r*r+o*o},r.sqrDist=r.squaredDistance,r.length=function(t){var e=t[0],i=t[1],n=t[2],r=t[3];return Math.sqrt(e*e+i*i+n*n+r*r)},r.len=r.length,r.squaredLength=function(t){var e=t[0],i=t[1],n=t[2],r=t[3];return e*e+i*i+n*n+r*r},r.sqrLen=r.squaredLength,r.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},r.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t},r.normalize=function(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],a=i*i+n*n+r*r+o*o;return a>0&&(a=1/Math.sqrt(a),t[0]=i*a,t[1]=n*a,t[2]=r*a,t[3]=o*a),t},r.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},r.lerp=function(t,e,i,n){var r=e[0],o=e[1],a=e[2],s=e[3];return t[0]=r+n*(i[0]-r),t[1]=o+n*(i[1]-o),t[2]=a+n*(i[2]-a),t[3]=s+n*(i[3]-s),t},r.random=function(t,e){return e=e||1,t[0]=n.RANDOM(),t[1]=n.RANDOM(),t[2]=n.RANDOM(),t[3]=n.RANDOM(),r.normalize(t,t),r.scale(t,t,e),t},r.transformMat4=function(t,e,i){var n=e[0],r=e[1],o=e[2],a=e[3];return t[0]=i[0]*n+i[4]*r+i[8]*o+i[12]*a,t[1]=i[1]*n+i[5]*r+i[9]*o+i[13]*a,t[2]=i[2]*n+i[6]*r+i[10]*o+i[14]*a,t[3]=i[3]*n+i[7]*r+i[11]*o+i[15]*a,t},r.transformQuat=function(t,e,i){var n=e[0],r=e[1],o=e[2],a=i[0],s=i[1],l=i[2],u=i[3],c=u*n+s*o-l*r,h=u*r+l*n-a*o,f=u*o+a*r-s*n,d=-a*n-s*r-l*o;return t[0]=c*u+d*-a+h*-l-f*-s,t[1]=h*u+d*-s+f*-a-c*-l,t[2]=f*u+d*-l+c*-s-h*-a,t[3]=e[3],t},r.forEach=function(){var t=r.create();return function(e,i,n,r,o,a){var s,l;for(i||(i=4),n||(n=0),l=r?Math.min(r*i+n,e.length):e.length,s=n;l>s;s+=i)t[0]=e[s],t[1]=e[s+1],t[2]=e[s+2],t[3]=e[s+3],o(t,t,a),e[s]=t[0],e[s+1]=t[1],e[s+2]=t[2],e[s+3]=t[3];return e}}(),r.str=function(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},r.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},r.equals=function(t,e){var i=t[0],r=t[1],o=t[2],a=t[3],s=e[0],l=e[1],u=e[2],c=e[3];return Math.abs(i-s)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(r-l)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(o-u)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(u))&&Math.abs(a-c)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(c))},e.exports=r},{"./common.js":13}],22:[function(t,e,i){"use strict";function n(t,e,i){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var o=new Int32Array(this.arrayBuffer);t=o[0],e=o[1],i=o[2],this.d=e+2*i;for(var a=0;a<this.d*this.d;a++){var s=o[r+a],l=o[r+a+1];n.push(s===l?null:o.subarray(s,l))}var u=o[r+n.length],c=o[r+n.length+1];this.keys=o.subarray(u,c),this.bboxes=o.subarray(c),this.insert=this._insertReadonly}else{this.d=e+2*i;for(var h=0;h<this.d*this.d;h++)n.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=i,this.scale=e/t,this.uid=0;var f=i/e*t;this.min=-f,this.max=t+f}e.exports=n;var r=3;n.prototype.insert=function(t,e,i,n,r){this._forEachCell(e,i,n,r,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(i),this.bboxes.push(n),this.bboxes.push(r)},n.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},n.prototype._insertCell=function(t,e,i,n,r,o){this.cells[r].push(o)},n.prototype.query=function(t,e,i,n){var r=this.min,o=this.max;if(r>=t&&r>=e&&i>=o&&n>=o)return this.keys.slice();var a=[],s={};return this._forEachCell(t,e,i,n,this._queryCell,a,s),a},n.prototype._queryCell=function(t,e,i,n,r,o,a){var s=this.cells[r];if(null!==s)for(var l=this.keys,u=this.bboxes,c=0;c<s.length;c++){var h=s[c];if(void 0===a[h]){var f=4*h;t<=u[f+2]&&e<=u[f+3]&&i>=u[f+0]&&n>=u[f+1]?(a[h]=!0,o.push(l[h])):a[h]=!1}}},n.prototype._forEachCell=function(t,e,i,n,r,o,a){for(var s=this._convertToCellCoord(t),l=this._convertToCellCoord(e),u=this._convertToCellCoord(i),c=this._convertToCellCoord(n),h=s;u>=h;h++)for(var f=l;c>=f;f++){var d=this.d*f+h;if(r.call(this,t,e,i,n,d,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=r+this.cells.length+1+1,i=0,n=0;n<this.cells.length;n++)i+=this.cells[n].length;var o=new Int32Array(e+i+this.keys.length+this.bboxes.length);o[0]=this.extent,o[1]=this.n,o[2]=this.padding;for(var a=e,s=0;s<t.length;s++){var l=t[s];o[r+s]=a,o.set(l,a),a+=l.length}return o[r+t.length]=a,o.set(this.keys,a),a+=this.keys.length,o[r+t.length+1]=a,o.set(this.bboxes,a),a+=this.bboxes.length,o.buffer}},{}],23:[function(t,e,i){i.read=function(t,e,i,n,r){var o,a,s=8*r-n-1,l=(1<<s)-1,u=l>>1,c=-7,h=i?r-1:0,f=i?-1:1,d=t[e+h];for(h+=f,o=d&(1<<-c)-1,d>>=-c,c+=s;c>0;o=256*o+t[e+h],h+=f,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+t[e+h],h+=f,c-=8);if(0===o)o=1-u;else{if(o===l)return a?NaN:(d?-1:1)*(1/0);a+=Math.pow(2,n),o-=u}return(d?-1:1)*a*Math.pow(2,o-n)},i.write=function(t,e,i,n,r,o){var a,s,l,u=8*o-r-1,c=(1<<u)-1,h=c>>1,f=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,m=0>e||0===e&&0>1/e?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*(l=Math.pow(2,-a))<1&&(a--,l*=2),e+=a+h>=1?f/l:f*Math.pow(2,1-h),e*l>=2&&(a++,l/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(e*l-1)*Math.pow(2,r),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,r),a=0));r>=8;t[i+d]=255&s,d+=p,s/=256,r-=8);for(a=a<<r|s,u+=r;u>0;t[i+d]=255&a,d+=p,a/=256,u-=8);t[i+d-p]|=128*m}},{}],24:[function(t,e,i){"use strict";function n(t,e,i,n,o){return new r(t,e,i,n,o)}function r(t,e,i,n,r){e=e||o,i=i||a,r=r||Array,this.nodeSize=n||64,this.points=t,this.ids=new r(t.length),this.coords=new r(2*t.length);for(var l=0;l<t.length;l++)this.ids[l]=l,this.coords[2*l]=e(t[l]),this.coords[2*l+1]=i(t[l]);s(this.ids,this.coords,this.nodeSize,0,this.ids.length-1,0)}function o(t){return t[0]}function a(t){return t[1]}var s=t("./sort"),l=t("./range"),u=t("./within");e.exports=n,r.prototype={range:function(t,e,i,n){return l(this.ids,this.coords,t,e,i,n,this.nodeSize)},within:function(t,e,i){return u(this.ids,this.coords,t,e,i,this.nodeSize)}}},{"./range":25,"./sort":26,"./within":27}],25:[function(t,e,i){"use strict";function n(t,e,i,n,r,o,a){for(var s=[0,t.length-1,0],l=[],u,c;s.length;){var h=s.pop(),f=s.pop(),d=s.pop();if(a>=f-d)for(var p=d;f>=p;p++)u=e[2*p],c=e[2*p+1],u>=i&&r>=u&&c>=n&&o>=c&&l.push(t[p]);else{var m=Math.floor((d+f)/2);u=e[2*m],c=e[2*m+1],u>=i&&r>=u&&c>=n&&o>=c&&l.push(t[m]);var v=(h+1)%2;(0===h?u>=i:c>=n)&&(s.push(d),s.push(m-1),s.push(v)),(0===h?r>=u:o>=c)&&(s.push(m+1),s.push(f),s.push(v))}}return l}e.exports=n},{}],26:[function(t,e,i){"use strict";function n(t,e,i,o,a,s){if(!(i>=a-o)){var l=Math.floor((o+a)/2);r(t,e,l,o,a,s%2),n(t,e,i,o,l-1,s+1),n(t,e,i,l+1,a,s+1)}}function r(t,e,i,n,a,s){for(;a>n;){if(a-n>600){var l=a-n+1,u=i-n+1,c=Math.log(l),h=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*h*(l-h)/l)*(0>u-l/2?-1:1),d=Math.max(n,Math.floor(i-u*h/l+f)),p=Math.min(a,Math.floor(i+(l-u)*h/l+f));r(t,e,i,d,p,s)}var m=e[2*i+s],v=n,y=a;for(o(t,e,n,i),e[2*a+s]>m&&o(t,e,n,a);y>v;){for(o(t,e,v,y),v++,y--;e[2*v+s]<m;)v++;for(;e[2*y+s]>m;)y--}e[2*n+s]===m?o(t,e,n,y):(y++,o(t,e,y,a)),i>=y&&(n=y+1),y>=i&&(a=y-1)}}function o(t,e,i,n){a(t,i,n),a(e,2*i,2*n),a(e,2*i+1,2*n+1)}function a(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}e.exports=n},{}],27:[function(t,e,i){"use strict";function n(t,e,i,n,o,a){for(var s=[0,t.length-1,0],l=[],u=o*o;s.length;){var c=s.pop(),h=s.pop(),f=s.pop();if(a>=h-f)for(var d=f;h>=d;d++)r(e[2*d],e[2*d+1],i,n)<=u&&l.push(t[d]);else{var p=Math.floor((f+h)/2),m=e[2*p],v=e[2*p+1];r(m,v,i,n)<=u&&l.push(t[p]);var y=(c+1)%2;(0===c?m>=i-o:v>=n-o)&&(s.push(f),s.push(p-1),s.push(y)),(0===c?i+o>=m:n+o>=v)&&(s.push(p+1),s.push(h),s.push(y))}}return l}function r(t,e,i,n){var r=t-i,o=e-n;return r*r+o*o}e.exports=n},{}],28:[function(t,e,i){"use strict";function n(t,e){var i;if(c(t)){var s="object"==typeof t.stops[0][0],l=s||void 0!==t.property,u=s||!l,h=t.type||e||"exponential",f;if("exponential"===h)f=a;else if("interval"===h)f=o;else{if("categorical"!==h)throw new Error('Unknown function type "'+h+'"');f=r}if(s){for(var d={},p=[],m=0;m<t.stops.length;m++){var v=t.stops[m];void 0===d[v[0].zoom]&&(d[v[0].zoom]={zoom:v[0].zoom,type:t.type,property:t.property,stops:[]}),d[v[0].zoom].stops.push([v[0].value,v[1]])}for(var y in d)p.push([d[y].zoom,n(d[y])]);i=function(e,i){return a({stops:p,base:t.base},e)(e,i)},i.isFeatureConstant=!1,i.isZoomConstant=!1}else u?(i=function(e){return f(t,e)},i.isFeatureConstant=!0,i.isZoomConstant=!1):(i=function(e,i){return f(t,i[t.property])},i.isFeatureConstant=!1,i.isZoomConstant=!0)}else i=function(){return t},i.isFeatureConstant=!0,i.isZoomConstant=!0;return i}function r(t,e){for(var i=0;i<t.stops.length;i++)if(e===t.stops[i][0])return t.stops[i][1];return t.stops[0][1]}function o(t,e){for(var i=0;i<t.stops.length&&!(e<t.stops[i][0]);i++);return t.stops[Math.max(i-1,0)][1]}function a(t,e){for(var i=void 0!==t.base?t.base:1,n=0;;){if(n>=t.stops.length)break;if(e<=t.stops[n][0])break;n++}return 0===n?t.stops[n][1]:n===t.stops.length?t.stops[n-1][1]:s(e,i,t.stops[n-1][0],t.stops[n][0],t.stops[n-1][1],t.stops[n][1])}function s(t,e,i,n,r,o){return"function"==typeof r?function(){var a=r.apply(void 0,arguments),l=o.apply(void 0,arguments);return s(t,e,i,n,a,l)}:r.length?u(t,e,i,n,r,o):l(t,e,i,n,r,o)}function l(t,e,i,n,r,o){var a=n-i,s=t-i,l;return l=1===e?s/a:(Math.pow(e,s)-1)/(Math.pow(e,a)-1),r*(1-l)+o*l}function u(t,e,i,n,r,o){for(var a=[],s=0;s<r.length;s++)a[s]=l(t,e,i,n,r[s],o[s]);return a}function c(t){return"object"==typeof t&&t.stops}e.exports.isFunctionDefinition=c,e.exports.interpolated=function(t){return n(t,"exponential")},e.exports["piecewise-constant"]=function(t){return n(t,"interval")}},{}],29:[function(t,e,i){"use strict";function n(t){return!!(r()&&o()&&a()&&s()&&l()&&u()&&c(t&&t.failIfMajorPerformanceCaveat))}function r(){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 l(){return"JSON"in window&&"parse"in JSON&&"stringify"in JSON}function u(){return"Worker"in window}function c(t){return void 0===f[t]&&(f[t]=h(t)),f[t]}function h(t){var e=document.createElement("canvas"),i=Object.create(n.webGLContextAttributes);return i.failIfMajorPerformanceCaveat=t,e.probablySupportsContext?e.probablySupportsContext("webgl",i)||e.probablySupportsContext("experimental-webgl",i):e.supportsContext?e.supportsContext("webgl",i)||e.supportsContext("experimental-webgl",i):e.getContext("webgl",i)||e.getContext("experimental-webgl",i)}"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}},{}],30:[function(t,e,i){"use strict";function n(t,e){this.message=(t?t+": ":"")+r.apply(r,Array.prototype.slice.call(arguments,2)),null!==e&&void 0!==e&&e.__line__&&(this.line=e.__line__)}var r=t("util").format;e.exports=n},{util:181}],31:[function(t,e,i){"use strict";e.exports=function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)t[n]=i[n]}return t}},{}],32:[function(t,e,i){"use strict";e.exports=function n(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}},{}],33:[function(t,e,i){"use strict";e.exports=function n(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}},{}],34:[function(t,e,i){"use strict";var n=t("../error/validation_error"),r=t("../util/get_type"),o=t("../util/extend");e.exports=function a(e){var i=t("./validate_function"),a=t("./validate_object"),s={"*":function(){return[]},array:t("./validate_array"),"boolean":t("./validate_boolean"),number:t("./validate_number"),color:t("./validate_color"),constants:t("./validate_constants"),"enum":t("./validate_enum"),filter:t("./validate_filter"),"function":t("./validate_function"),layer:t("./validate_layer"),object:t("./validate_object"),source:t("./validate_source"),string:t("./validate_string")},l=e.value,u=e.valueSpec,c=e.key,h=e.styleSpec,f=e.style;if("string"===r(l)&&"@"===l[0]){if(h.$version>7)return[new n(c,l,"constants have been deprecated as of v8")];if(!(l in f.constants))return[new n(c,l,'constant "%s" not found',l)];e=o({},e,{value:f.constants[l]})}return u["function"]&&"object"===r(l)?i(e):u.type&&s[u.type]?s[u.type](e):a(o({},e,{valueSpec:u.type?h[u.type]:u}))}},{"../error/validation_error":30,"../util/extend":31,"../util/get_type":32,"./validate_array":35,"./validate_boolean":36,"./validate_color":37,"./validate_constants":38,"./validate_enum":39,"./validate_filter":40,"./validate_function":41,"./validate_layer":43,"./validate_number":45,"./validate_object":46,"./validate_source":48,"./validate_string":49}],35:[function(t,e,i){"use strict";var n=t("../util/get_type"),r=t("./validate"),o=t("../error/validation_error");e.exports=function a(t){var e=t.value,i=t.valueSpec,a=t.style,s=t.styleSpec,l=t.key,u=t.arrayElementValidator||r;if("array"!==n(e))return[new o(l,e,"array expected, %s found",n(e))];if(i.length&&e.length!==i.length)return[new o(l,e,"array length %d expected, length %d found",i.length,e.length)];if(i["min-length"]&&e.length<i["min-length"])return[new o(l,e,"array length at least %d expected, length %d found",i["min-length"],e.length)];var c={type:i.value};s.$version<7&&(c["function"]=i["function"]),"object"===n(i.value)&&(c=i.value);for(var h=[],f=0;f<e.length;f++)h=h.concat(u({array:e,arrayIndex:f,value:e[f],valueSpec:c,style:a,styleSpec:s,key:l+"["+f+"]"}));return h}},{"../error/validation_error":30,"../util/get_type":32,"./validate":34}],36:[function(t,e,i){"use strict";var n=t("../util/get_type"),r=t("../error/validation_error");e.exports=function o(t){var e=t.value,i=t.key,o=n(e);return"boolean"!==o?[new r(i,e,"boolean expected, %s found",o)]:[]}},{"../error/validation_error":30,"../util/get_type":32}],37:[function(t,e,i){"use strict";var n=t("../error/validation_error"),r=t("../util/get_type"),o=t("csscolorparser").parseCSSColor;e.exports=function a(t){var e=t.key,i=t.value,a=r(i);return"string"!==a?[new n(e,i,"color expected, %s found",a)]:null===o(i)?[new n(e,i,'color expected, "%s" found',i)]:[]}},{"../error/validation_error":30,"../util/get_type":32,csscolorparser:1}],38:[function(t,e,i){"use strict";var n=t("../error/validation_error"),r=t("../util/get_type");e.exports=function o(t){var e=t.key,i=t.value,o=t.styleSpec;if(o.$version>7)return i?[new n(e,i,"constants have been deprecated as of v8")]:[];var a=r(i);if("object"!==a)return[new n(e,i,"object expected, %s found",a)];var s=[];for(var l in i)"@"!==l[0]&&s.push(new n(e+"."+l,i[l],'constants must start with "@"'));return s}},{"../error/validation_error":30,"../util/get_type":32}],39:[function(t,e,i){"use strict";var n=t("../error/validation_error"),r=t("../util/unbundle_jsonlint");e.exports=function o(t){var e=t.key,i=t.value,o=t.valueSpec,a=[];return-1===o.values.indexOf(r(i))&&a.push(new n(e,i,"expected one of [%s], %s found",o.values.join(", "),i)),a}},{"../error/validation_error":30,"../util/unbundle_jsonlint":33}],40:[function(t,e,i){"use strict";var n=t("../error/validation_error"),r=t("./validate_enum"),o=t("../util/get_type"),a=t("../util/unbundle_jsonlint");e.exports=function s(t){var e=t.value,i=t.key,l=t.styleSpec,u,c=[];if("array"!==o(e))return[new n(i,e,"array expected, %s found",o(e))];if(e.length<1)return[new n(i,e,"filter array must have at least 1 element")];switch(c=c.concat(r({key:i+"[0]",value:e[0],valueSpec:l.filter_operator,style:t.style,styleSpec:t.styleSpec})),a(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&"$type"==e[1]&&c.push(new n(i,e,'"$type" cannot be use with operator "%s"',e[0]));case"==":case"!=":3!=e.length&&c.push(new n(i,e,'filter array for operator "%s" must have 3 elements',e[0]));case"in":case"!in":e.length>=2&&(u=o(e[1]),"string"!==u?c.push(new n(i+"[1]",e[1],"string expected, %s found",u)):"@"===e[1][0]&&c.push(new n(i+"[1]",e[1],"filter key cannot be a constant")));for(var h=2;h<e.length;h++)u=o(e[h]),"$type"==e[1]?c=c.concat(r({key:i+"["+h+"]",value:e[h],valueSpec:l.geometry_type,style:t.style,styleSpec:t.styleSpec})):"string"===u&&"@"===e[h][0]?c.push(new n(i+"["+h+"]",e[h],"filter value cannot be a constant")):"string"!==u&&"number"!==u&&"boolean"!==u&&c.push(new n(i+"["+h+"]",e[h],"string, number, or boolean expected, %s found",u));break;case"any":case"all":case"none":for(h=1;h<e.length;h++)c=c.concat(s({key:i+"["+h+"]",value:e[h],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":u=o(e[1]),2!==e.length?c.push(new n(i,e,'filter array for "%s" operator must have 2 elements',e[0])):"string"!==u?c.push(new n(i+"[1]",e[1],"string expected, %s found",u)):"@"===e[1][0]&&c.push(new n(i+"[1]",e[1],"filter key cannot be a constant"))}return c}},{"../error/validation_error":30,"../util/get_type":32,"../util/unbundle_jsonlint":33,"./validate_enum":39}],41:[function(t,e,i){"use strict";var n=t("../error/validation_error"),r=t("../util/get_type"),o=t("./validate"),a=t("./validate_object"),s=t("./validate_array"),l=t("./validate_number");e.exports=function u(t){function e(t){var e=[],o=t.value;return e=e.concat(s({key:t.key,value:o,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:i})),"array"===r(o)&&0===o.length&&e.push(new n(t.key,o,"array must have at least one stop")),e}function i(t){var e=[],i=t.value,s=t.key;if("array"!==r(i))return[new n(s,i,"array expected, %s found",r(i))];if(2!==i.length)return[new n(s,i,"array length %d expected, length %d found",2,i.length)];var d=r(i[0]);if(f||(f=d),d!==f)return[new n(s,i,"%s stop key type must match previous stop key type %s",d,f)];if("object"===d){if(void 0===i[0].zoom)return[new n(s,i,"object stop key must have zoom")];if(void 0===i[0].value)return[new n(s,i,"object stop key must have value")];e=e.concat(a({key:s+"[0]",value:i[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:l,value:u}}))}else{var p=!h.property;e=e.concat((p?l:u)({key:s+"[0]",value:i[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec}))}return e=e.concat(o({key:s+"[1]",value:i[1],valueSpec:c,style:t.style,styleSpec:t.styleSpec})),"number"===r(i[0])&&("piecewise-constant"===c["function"]&&i[0]%1!==0&&e.push(new n(s+"[0]",i[0],"zoom level for piecewise-constant functions must be an integer")),0!==t.arrayIndex&&i[0]<t.array[t.arrayIndex-1][0]&&e.push(new n(s+"[0]",i[0],"array stops must appear in ascending order"))),e}function u(t){var e=[],i=r(t.value);return"number"!==i&&"string"!==i&&"array"!==i&&e.push(new n(t.key,t.value,"property value must be a number, string or array")),e}var c=t.valueSpec,h=t.value,f;return a({key:t.key,value:t.value,valueSpec:t.styleSpec["function"],style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:e}})}},{"../error/validation_error":30,"../util/get_type":32,"./validate":34,"./validate_array":35,"./validate_number":45,"./validate_object":46}],42:[function(t,e,i){"use strict";var n=t("../error/validation_error"),r=t("./validate_string");e.exports=function(t){var e=t.value,i=t.key,o=r(t);return o.length?o:(-1===e.indexOf("{fontstack}")&&o.push(new n(i,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&o.push(new n(i,e,'"glyphs" url must include a "{range}" token')),o)}},{"../error/validation_error":30,"./validate_string":49}],43:[function(t,e,i){"use strict";var n=t("../error/validation_error"),r=t("../util/unbundle_jsonlint"),o=t("./validate_object"),a=t("./validate_filter"),s=t("./validate_paint_property"),l=t("./validate_layout_property"),u=t("../util/extend");e.exports=function c(t){var e=[],i=t.value,c=t.key,h=t.style,f=t.styleSpec;i.type||i.ref||e.push(new n(c,i,'either "type" or "ref" is required'));var d=r(i.type),p=r(i.ref);if(i.id)for(var m=0;m<t.arrayIndex;m++){var v=h.layers[m];r(v.id)===r(i.id)&&e.push(new n(c,i.id,'duplicate layer id "%s", previously used at line %d',i.id,v.id.__line__))}if("ref"in i){["type","source","source-layer","filter","layout"].forEach(function(t){t in i&&e.push(new n(c,i[t],'"%s" is prohibited for ref layers',t))});var y;h.layers.forEach(function(t){t.id==p&&(y=t)}),y?y.ref?e.push(new n(c,i.ref,"ref cannot reference another ref layer")):d=r(y.type):e.push(new n(c,i.ref,'ref layer "%s" not found',p))}else if("background"!==d)if(i.source){var _=h.sources[i.source];_?"vector"==_.type&&"raster"==d?e.push(new n(c,i.source,'layer "%s" requires a raster source',i.id)):"raster"==_.type&&"raster"!=d?e.push(new n(c,i.source,'layer "%s" requires a vector source',i.id)):"vector"!=_.type||i["source-layer"]||e.push(new n(c,i,'layer "%s" must specify a "source-layer"',i.id)):e.push(new n(c,i.source,'source "%s" not found',i.source))}else e.push(new n(c,i,'missing required property "source"'));return e=e.concat(o({key:c,value:i,valueSpec:f.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{filter:a,layout:function(t){return o({layer:i,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return l(u({layerType:d},t))}}})},paint:function(t){return o({layer:i,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return s(u({layerType:d},t))}}})}}}))}},{"../error/validation_error":30,"../util/extend":31,"../util/unbundle_jsonlint":33,"./validate_filter":40,"./validate_layout_property":44,"./validate_object":46,"./validate_paint_property":47}],44:[function(t,e,i){"use strict";var n=t("./validate"),r=t("../error/validation_error");e.exports=function o(t){var e=t.key,i=t.style,o=t.styleSpec,a=t.value,s=t.objectKey,l=o["layout_"+t.layerType];if(t.valueSpec||l[s]){var u=[];return"symbol"===t.layerType&&("icon-image"===s&&i&&!i.sprite?u.push(new r(e,a,'use of "icon-image" requires a style "sprite" property')):"text-field"===s&&i&&!i.glyphs&&u.push(new r(e,a,'use of "text-field" requires a style "glyphs" property'))),u.concat(n({key:t.key,value:a,valueSpec:t.valueSpec||l[s],style:i,styleSpec:o}))}return[new r(e,a,'unknown property "%s"',s)]}},{"../error/validation_error":30,"./validate":34}],45:[function(t,e,i){"use strict";var n=t("../util/get_type"),r=t("../error/validation_error");e.exports=function o(t){var e=t.key,i=t.value,o=t.valueSpec,a=n(i);return"number"!==a?[new r(e,i,"number expected, %s found",a)]:"minimum"in o&&i<o.minimum?[new r(e,i,"%s is less than the minimum value %s",i,o.minimum)]:"maximum"in o&&i>o.maximum?[new r(e,i,"%s is greater than the maximum value %s",i,o.maximum)]:[]}},{"../error/validation_error":30,"../util/get_type":32}],46:[function(t,e,i){"use strict";var n=t("../error/validation_error"),r=t("../util/get_type"),o=t("./validate");e.exports=function a(t){var e=t.key,i=t.value,a=t.valueSpec,s=t.objectElementValidators||{},l=t.style,u=t.styleSpec,c=[],h=r(i);if("object"!==h)return[new n(e,i,"object expected, %s found",h)];for(var f in i){var d=f.split(".")[0],p=a&&(a[d]||a["*"]),m=s[d]||s["*"];p||m?c=c.concat((m||o)({key:(e?e+".":e)+f,value:i[f],valueSpec:p,style:l,styleSpec:u,object:i,objectKey:f})):""!==e&&1!==e.split(".").length&&c.push(new n(e,i[f],'unknown property "%s"',f))}for(d in a)a[d].required&&void 0===a[d]["default"]&&void 0===i[d]&&c.push(new n(e,i,'missing required property "%s"',d));return c}},{"../error/validation_error":30,"../util/get_type":32,"./validate":34}],47:[function(t,e,i){"use strict";var n=t("./validate"),r=t("../error/validation_error");e.exports=function o(t){var e=t.key,i=t.style,o=t.styleSpec,a=t.value,s=t.objectKey,l=o["paint_"+t.layerType],u=s.match(/^(.*)-transition$/);return u&&l[u[1]]&&l[u[1]].transition?n({key:e,value:a,valueSpec:o.transition,style:i,styleSpec:o}):t.valueSpec||l[s]?n({key:t.key,value:a,valueSpec:t.valueSpec||l[s],style:i,styleSpec:o}):[new r(e,a,'unknown property "%s"',s)]}},{"../error/validation_error":30,"./validate":34}],48:[function(t,e,i){"use strict";var n=t("../error/validation_error"),r=t("../util/unbundle_jsonlint"),o=t("./validate_object"),a=t("./validate_enum");e.exports=function s(t){var e=t.value,i=t.key,s=t.styleSpec,l=t.style;if(!e.type)return[new n(i,e,'"type" is required')];var u=r(e.type);switch(u){case"vector":case"raster":var c=[];if(c=c.concat(o({key:i,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(i+"."+h,e[h],'a source with a "url" property may not include a "%s" property',h));return c;case"geojson":return o({key:i,value:e,valueSpec:s.source_geojson,style:l,styleSpec:s});case"video":return o({key:i,value:e,valueSpec:s.source_video,style:l,styleSpec:s});case"image":return o({key:i,value:e,valueSpec:s.source_image,style:l,styleSpec:s});default:return a({key:i+".type",value:e.type,valueSpec:{values:["vector","raster","geojson","video","image"]},style:l,styleSpec:s})}}},{"../error/validation_error":30,"../util/unbundle_jsonlint":33,"./validate_enum":39,"./validate_object":46}],49:[function(t,e,i){"use strict";var n=t("../util/get_type"),r=t("../error/validation_error");e.exports=function o(t){var e=t.value,i=t.key,o=n(e);return"string"!==o?[new r(i,e,"string expected, %s found",o)]:[]}},{"../error/validation_error":30,"../util/get_type":32}],50:[function(t,e,i){"use strict";function n(t,e){e=e||l;var i=[];return i=i.concat(s({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:u}})),e.$version>7&&t.constants&&(i=i.concat(a({key:"constants",value:t.constants,style:t,styleSpec:e}))),r(i)}function r(t){return[].concat(t).sort(function(t,e){return t.line-e.line})}function o(t){return function(){return r(t.apply(this,arguments))}}var a=t("./validate/validate_constants"),s=t("./validate/validate"),l=t("../reference/latest.min"),u=t("./validate/validate_glyphs_url");n.source=o(t("./validate/validate_source")),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":52,"./validate/validate":34,"./validate/validate_constants":38,"./validate/validate_filter":40,"./validate/validate_glyphs_url":42,"./validate/validate_layer":43,"./validate/validate_layout_property":44,"./validate/validate_paint_property":47,"./validate/validate_source":48}],51:[function(t,e,i){e.exports=t("./v8.json")},{"./v8.json":53}],52:[function(t,e,i){e.exports=t("./v8.min.json")},{"./v8.min.json":54}],53:[function(t,e,i){e.exports={$version:8,$root:{version:{required:!0,type:"enum",values:[8],doc:"Stylesheet version number. Must be 8.",example:8},name:{type:"string",doc:"A human-readable name for the style.",example:"Bright"},metadata:{type:"*",doc:"Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},center:{type:"array",value:"number",doc:"Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:[-73.9749,40.7736]},zoom:{type:"number",doc:"Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:12.5},bearing:{type:"number","default":0,period:360,units:"degrees",doc:"Default bearing, in degrees. The style bearing will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:29},pitch:{type:"number","default":0,units:"degrees",doc:"Default pitch, in degrees. Zero is perpendicular to the surface. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",
example:50},sources:{required:!0,type:"sources",doc:"Data source specifications.",example:{"mapbox-streets":{type:"vector",url:"mapbox://mapbox.mapbox-streets-v6"}}},sprite:{type:"string",doc:"A base URL for retrieving the sprite image and metadata. The extensions `.png`, `.json` and scale factor `@2x.png` will be automatically appended. This property is required if any layer uses the 'sprite-image' layout property.",example:"mapbox://sprites/mapbox/bright-v8"},glyphs:{type:"string",doc:"A URL template for loading signed-distance-field glyph sets in PBF format. The URL must include `{fontstack}` and `{range}` tokens. This property is required if any layer uses the 'text-field' layout property.",example:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},transition:{type:"transition",doc:"A global transition definition to use as a default across properties.",example:{duration:300,delay:0}},layers:{required:!0,type:"array",value:"layer",doc:"Layers will be drawn in the order of this array.",example:[{id:"water",source:"mapbox-streets","source-layer":"water",type:"fill",paint:{"fill-color":"#00ffff"}}]}},sources:{"*":{type:"source",doc:"Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For GeoJSON and video sources, a URL must be provided."}},source:["source_tile","source_geojson","source_video","source_image"],source_tile:{type:{required:!0,type:"enum",values:["vector","raster"],doc:"The data type of the tile source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<mapid>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},minzoom:{type:"number","default":0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number","default":22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number","default":512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},"*":{type:"*",doc:"Other keys to configure the data source."}},source_geojson:{type:{required:!0,type:"enum",values:["geojson"],doc:"The data type of the GeoJSON source."},data:{type:"*",doc:"A URL to a GeoJSON file, or inline GeoJSON."},maxzoom:{type:"number","default":14,doc:"Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels)."},buffer:{type:"number","default":64,doc:"Tile buffer size on each side (higher means fewer rendering artifacts near tile edges but slower performance)."},tolerance:{type:"number","default":3,doc:"Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance)."},cluster:{type:"boolean","default":!1,doc:"If the data is a collection of point features, setting this to true clusters the points by radius into groups."},clusterRadius:{type:"number","default":400,doc:"Radius of each cluster when clustering points, relative to 4096 tile."},clusterMaxZoom:{type:"number",doc:"Max zoom to cluster points on. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered)."}},source_video:{type:{required:!0,type:"enum",values:["video"],doc:"The data type of the video source."},urls:{required:!0,type:"array",value:"string",doc:"URLs to video content in order of preferred format."},coordinates:{required:!0,doc:"Corners of video specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},source_image:{type:{required:!0,type:"enum",values:["image"],doc:"The data type of the image source."},url:{required:!0,type:"string",doc:"URL that points to an image"},coordinates:{required:!0,doc:"Corners of image specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},layer:{id:{type:"string",doc:"Unique layer name.",required:!0},type:{type:"enum",values:["fill","line","symbol","circle","raster","background"],doc:"Rendering type of this layer."},metadata:{type:"*",doc:"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},ref:{type:"string",doc:"References another layer to copy `type`, `source`, `source-layer`, `minzoom`, `maxzoom`, `filter`, and `layout` properties from. This allows the layers to share processing and be more efficient."},source:{type:"string",doc:"Name of a source description to be used for this layer."},"source-layer":{type:"string",doc:"Layer to use from a vector tile source. Required if the source supports multiple layers."},minzoom:{type:"number",minimum:0,maximum:22,doc:"The minimum zoom level on which the layer gets parsed and appears on."},maxzoom:{type:"number",minimum:0,maximum:22,doc:"The maximum zoom level on which the layer gets parsed and appears on."},interactive:{type:"boolean",doc:"Enable querying of feature data from this layer for interactivity.","default":!1},filter:{type:"filter",doc:"A expression specifying conditions on source features. Only features that match the filter are displayed."},layout:{type:"layout",doc:"Layout properties for the layer."},paint:{type:"paint",doc:"Default paint properties for this layer."},"paint.*":{type:"paint",doc:"Class-specific paint properties for this layer. The class name is the part after the first dot."}},layout:["layout_fill","layout_line","layout_circle","layout_symbol","layout_raster","layout_background"],layout_background:{visibility:{type:"enum","function":"piecewise-constant",values:["visible","none"],"default":"visible",doc:"The display of this layer. `none` hides this layer."}},layout_fill:{visibility:{type:"enum","function":"piecewise-constant",values:["visible","none"],"default":"visible",doc:"The display of this layer. `none` hides this layer."}},layout_circle:{visibility:{type:"enum","function":"piecewise-constant",values:["visible","none"],"default":"visible",doc:"The display of this layer. `none` hides this layer."}},layout_line:{"line-cap":{type:"enum","function":"piecewise-constant",values:["butt","round","square"],"default":"butt",doc:"The display of line endings."},"line-join":{type:"enum","function":"piecewise-constant",values:["bevel","round","miter"],"default":"miter",doc:"The display of lines when joining."},"line-miter-limit":{type:"number","default":2,"function":"interpolated",doc:"Used to automatically convert miter joins to bevel joins for sharp angles.",requires:[{"line-join":"miter"}]},"line-round-limit":{type:"number","default":1.05,"function":"interpolated",doc:"Used to automatically convert round joins to miter joins for shallow angles.",requires:[{"line-join":"round"}]},visibility:{type:"enum","function":"piecewise-constant",values:["visible","none"],"default":"visible",doc:"The display of this layer. `none` hides this layer."}},layout_symbol:{"symbol-placement":{type:"enum","function":"piecewise-constant",values:["point","line"],"default":"point",doc:"Label placement relative to its geometry. `line` can only be used on LineStrings and Polygons."},"symbol-spacing":{type:"number","default":250,minimum:1,"function":"interpolated",units:"pixels",doc:"Distance between two symbol anchors.",requires:[{"symbol-placement":"line"}]},"symbol-avoid-edges":{type:"boolean","function":"piecewise-constant","default":!1,doc:"If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer."},"icon-allow-overlap":{type:"boolean","function":"piecewise-constant","default":!1,doc:"If true, the icon will be visible even if it collides with other previously drawn symbols.",requires:["icon-image"]},"icon-ignore-placement":{type:"boolean","function":"piecewise-constant","default":!1,doc:"If true, other symbols can be visible even if they collide with the icon.",requires:["icon-image"]},"icon-optional":{type:"boolean","function":"piecewise-constant","default":!1,doc:"If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.",requires:["icon-image","text-field"]},"icon-rotation-alignment":{type:"enum","function":"piecewise-constant",values:["map","viewport"],"default":"viewport",doc:"Orientation of icon when map is rotated.",requires:["icon-image"]},"icon-size":{type:"number","default":1,minimum:0,"function":"interpolated",doc:"Scale factor for icon. 1 is original size, 3 triples the size.",requires:["icon-image"]},"icon-image":{type:"string","function":"piecewise-constant",doc:"A string with {tokens} replaced, referencing the data property to pull from.",tokens:!0},"icon-rotate":{type:"number","default":0,period:360,"function":"interpolated",units:"degrees",doc:"Rotates the icon clockwise.",requires:["icon-image"]},"icon-padding":{type:"number","default":2,minimum:0,"function":"interpolated",units:"pixels",doc:"Size of the additional area around the icon bounding box used for detecting symbol collisions.",requires:["icon-image"]},"icon-keep-upright":{type:"boolean","function":"piecewise-constant","default":!1,doc:"If true, the icon may be flipped to prevent it from being rendered upside-down.",requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":"line"}]},"icon-offset":{type:"array",value:"number",length:2,"default":[0,0],"function":"interpolated",doc:"Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up.",requires:["icon-image"]},"text-rotation-alignment":{type:"enum","function":"piecewise-constant",values:["map","viewport"],"default":"viewport",doc:"Orientation of text when map is rotated.",requires:["text-field"]},"text-field":{type:"string","function":"piecewise-constant","default":"",tokens:!0,doc:"Value to use for a text label. Feature properties are specified using tokens like {field_name}."},"text-font":{type:"array",value:"string","function":"piecewise-constant","default":["Open Sans Regular","Arial Unicode MS Regular"],doc:"Font stack to use for displaying text.",requires:["text-field"]},"text-size":{type:"number","default":16,minimum:0,units:"pixels","function":"interpolated",doc:"Font size.",requires:["text-field"]},"text-max-width":{type:"number","default":10,minimum:0,units:"em","function":"interpolated",doc:"The maximum line width for text wrapping.",requires:["text-field"]},"text-line-height":{type:"number","default":1.2,units:"em","function":"interpolated",doc:"Text leading value for multi-line text.",requires:["text-field"]},"text-letter-spacing":{type:"number","default":0,units:"em","function":"interpolated",doc:"Text tracking amount.",requires:["text-field"]},"text-justify":{type:"enum","function":"piecewise-constant",values:["left","center","right"],"default":"center",doc:"Text justification options.",requires:["text-field"]},"text-anchor":{type:"enum","function":"piecewise-constant",values:["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"],"default":"center",doc:"Part of the text placed closest to the anchor.",requires:["text-field"]},"text-max-angle":{type:"number","default":45,units:"degrees","function":"interpolated",doc:"Maximum angle change between adjacent characters.",requires:["text-field",{"symbol-placement":"line"}]},"text-rotate":{type:"number","default":0,period:360,units:"degrees","function":"interpolated",doc:"Rotates the text clockwise.",requires:["text-field"]},"text-padding":{type:"number","default":2,minimum:0,units:"pixels","function":"interpolated",doc:"Size of the additional area around the text bounding box used for detecting symbol collisions.",requires:["text-field"]},"text-keep-upright":{type:"boolean","function":"piecewise-constant","default":!0,doc:"If true, the text may be flipped vertically to prevent it from being rendered upside-down.",requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":"line"}]},"text-transform":{type:"enum","function":"piecewise-constant",values:["none","uppercase","lowercase"],"default":"none",doc:"Specifies how to capitalize text, similar to the CSS `text-transform` property.",requires:["text-field"]},"text-offset":{type:"array",doc:"Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up.",value:"number",units:"ems","function":"interpolated",length:2,"default":[0,0],requires:["text-field"]},"text-allow-overlap":{type:"boolean","function":"piecewise-constant","default":!1,doc:"If true, the text will be visible even if it collides with other previously drawn symbols.",requires:["text-field"]},"text-ignore-placement":{type:"boolean","function":"piecewise-constant","default":!1,doc:"If true, other symbols can be visible even if they collide with the text.",requires:["text-field"]},"text-optional":{type:"boolean","function":"piecewise-constant","default":!1,doc:"If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.",requires:["text-field","icon-image"]},visibility:{type:"enum","function":"piecewise-constant",values:["visible","none"],"default":"visible",doc:"The display of this layer. `none` hides this layer."}},layout_raster:{visibility:{type:"enum","function":"piecewise-constant",values:["visible","none"],"default":"visible",doc:"The display of this layer. `none` hides this layer."}},filter:{type:"array",value:"*",doc:"A filter selects specific features from a layer."},filter_operator:{type:"enum",values:["==","!=",">",">=","<","<=","in","!in","all","any","none","has","!has"],doc:"The filter operator."},geometry_type:{type:"enum",values:["Point","LineString","Polygon"],doc:"The geometry type for the filter to select."},color_operation:{type:"enum",values:["lighten","saturate","spin","fade","mix"],doc:"A color operation to apply."},"function":{stops:{type:"array",required:!0,doc:"An array of stops.",value:"function_stop"},base:{type:"number","default":1,minimum:0,doc:"The exponential base of the interpolation curve. It controls the rate at which the result increases. Higher values make the result increase more towards the high end of the range. With `1` the stops are interpolated linearly."},property:{type:"string",doc:"The name of a global property or feature property to use as the function input.","default":"$zoom"},type:{type:"enum",values:["exponential","interval","categorical"],doc:"The interpolation strategy to use in function evaluation.","default":"exponential"}},function_stop:{type:"array",minimum:0,maximum:22,value:["number","color"],length:2,doc:"Zoom level and value pair."},paint:["paint_fill","paint_line","paint_circle","paint_symbol","paint_raster","paint_background"],paint_fill:{"fill-antialias":{type:"boolean","function":"piecewise-constant","default":!0,doc:"Whether or not the fill should be antialiased."},"fill-opacity":{type:"number","function":"interpolated","default":1,minimum:0,maximum:1,doc:"The opacity given to the fill color.",transition:!0},"fill-color":{type:"color","default":"#000000",doc:"The color of the fill.","function":"interpolated",transition:!0,requires:[{"!":"fill-pattern"}]},"fill-outline-color":{type:"color",doc:"The outline color of the fill. Matches the value of `fill-color` if unspecified.","function":"interpolated",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}]},"fill-translate":{type:"array",value:"number",length:2,"default":[0,0],"function":"interpolated",transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively."},"fill-translate-anchor":{type:"enum","function":"piecewise-constant",values:["map","viewport"],doc:"Control whether the translation is relative to the map (north) or viewport (screen)","default":"map",requires:["fill-translate"]},"fill-pattern":{type:"string","function":"piecewise-constant",transition:!0,doc:"Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512)."}},paint_line:{"line-opacity":{type:"number",doc:"The opacity at which the line will be drawn.","function":"interpolated","default":1,minimum:0,maximum:1,transition:!0},"line-color":{type:"color",doc:"The color with which the line will be drawn.","default":"#000000","function":"interpolated",transition:!0,requires:[{"!":"line-pattern"}]},"line-translate":{type:"array",value:"number",length:2,"default":[0,0],"function":"interpolated",transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively."},"line-translate-anchor":{type:"enum","function":"piecewise-constant",values:["map","viewport"],doc:"Control whether the translation is relative to the map (north) or viewport (screen)","default":"map",requires:["line-translate"]},"line-width":{type:"number","default":1,minimum:0,"function":"interpolated",transition:!0,units:"pixels",doc:"Stroke thickness."},"line-gap-width":{type:"number","default":0,minimum:0,doc:"Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.","function":"interpolated",transition:!0,units:"pixels"},"line-offset":{type:"number","default":0,doc:'The line\'s offset perpendicular to its direction. Values may be positive or negative, where positive indicates "rightwards" (if you were moving in the direction of the line) and negative indicates "leftwards."',"function":"interpolated",transition:!0,units:"pixels"},"line-blur":{type:"number","default":0,minimum:0,"function":"interpolated",transition:!0,units:"pixels",doc:"Blur applied to the line, in pixels."},"line-dasharray":{type:"array",value:"number","function":"piecewise-constant",doc:"Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width.",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}]},"line-pattern":{type:"string","function":"piecewise-constant",transition:!0,doc:"Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512)."}},paint_circle:{"circle-radius":{type:"number","default":5,minimum:0,"function":"interpolated",transition:!0,units:"pixels",doc:"Circle radius."},"circle-color":{type:"color","default":"#000000",doc:"The color of the circle.","function":"interpolated",transition:!0},"circle-blur":{type:"number","default":0,doc:"Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.","function":"interpolated",transition:!0},"circle-opacity":{type:"number",doc:"The opacity at which the circle will be drawn.","default":1,minimum:0,maximum:1,"function":"interpolated",transition:!0},"circle-translate":{type:"array",value:"number",length:2,"default":[0,0],"function":"interpolated",transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively."},"circle-translate-anchor":{type:"enum","function":"piecewise-constant",values:["map","viewport"],doc:"Control whether the translation is relative to the map (north) or viewport (screen)","default":"map",requires:["circle-translate"]}},paint_symbol:{"icon-opacity":{doc:"The opacity at which the icon will be drawn.",type:"number","default":1,minimum:0,maximum:1,"function":"interpolated",transition:!0,requires:["icon-image"]},"icon-color":{type:"color","default":"#000000","function":"interpolated",transition:!0,doc:"The color of the icon. This can only be used with sdf icons.",requires:["icon-image"]},"icon-halo-color":{type:"color","default":"rgba(0, 0, 0, 0)","function":"interpolated",transition:!0,doc:"The color of the icon's halo. Icon halos can only be used with sdf icons.",requires:["icon-image"]},"icon-halo-width":{type:"number","default":0,minimum:0,"function":"interpolated",transition:!0,units:"pixels",doc:"Distance of halo to the icon outline.",requires:["icon-image"]},"icon-halo-blur":{type:"number","default":0,minimum:0,"function":"interpolated",transition:!0,units:"pixels",doc:"Fade out the halo towards the outside.",requires:["icon-image"]},"icon-translate":{type:"array",value:"number",length:2,"default":[0,0],"function":"interpolated",transition:!0,units:"pixels",doc:"Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["icon-image"]},"icon-translate-anchor":{type:"enum","function":"piecewise-constant",values:["map","viewport"],doc:"Control whether the translation is relative to the map (north) or viewport (screen).","default":"map",requires:["icon-image","icon-translate"]},"text-opacity":{type:"number",doc:"The opacity at which the text will be drawn.","default":1,minimum:0,maximum:1,"function":"interpolated",transition:!0,requires:["text-field"]},"text-color":{type:"color",doc:"The color with which the text will be drawn.","default":"#000000","function":"interpolated",transition:!0,requires:["text-field"]},"text-halo-color":{type:"color","default":"rgba(0, 0, 0, 0)","function":"interpolated",transition:!0,doc:"The color of the text's halo, which helps it stand out from backgrounds.",requires:["text-field"]},"text-halo-width":{type:"number","default":0,minimum:0,"function":"interpolated",transition:!0,units:"pixels",doc:"Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.",requires:["text-field"]},"text-halo-blur":{type:"number","default":0,minimum:0,"function":"interpolated",transition:!0,units:"pixels",doc:"The halo's fadeout distance towards the outside.",requires:["text-field"]},"text-translate":{type:"array",value:"number",length:2,"default":[0,0],"function":"interpolated",transition:!0,units:"pixels",doc:"Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["text-field"]},"text-translate-anchor":{type:"enum","function":"piecewise-constant",values:["map","viewport"],doc:"Control whether the translation is relative to the map (north) or viewport (screen).","default":"map",requires:["text-field","text-translate"]}},paint_raster:{"raster-opacity":{type:"number",doc:"The opacity at which the image will be drawn.","default":1,minimum:0,maximum:1,"function":"interpolated",transition:!0},"raster-hue-rotate":{type:"number","default":0,period:360,"function":"interpolated",transition:!0,units:"degrees",doc:"Rotates hues around the color wheel."},"raster-brightness-min":{type:"number","function":"interpolated",doc:"Increase or reduce the brightness of the image. The value is the minimum brightness.","default":0,minimum:0,maximum:1,transition:!0},"raster-brightness-max":{type:"number","function":"interpolated",doc:"Increase or reduce the brightness of the image. The value is the maximum brightness.","default":1,minimum:0,maximum:1,transition:!0},"raster-saturation":{type:"number",doc:"Increase or reduce the saturation of the image.","default":0,minimum:-1,maximum:1,"function":"interpolated",transition:!0},"raster-contrast":{type:"number",doc:"Increase or reduce the contrast of the image.","default":0,minimum:-1,maximum:1,"function":"interpolated",transition:!0},"raster-fade-duration":{type:"number","default":300,minimum:0,"function":"interpolated",transition:!0,units:"milliseconds",doc:"Fade duration when a new tile is added."}},paint_background:{"background-color":{type:"color","default":"#000000",doc:"The color with which the background will be drawn.","function":"interpolated",transition:!0,requires:[{"!":"background-pattern"}]},"background-pattern":{type:"string","function":"piecewise-constant",transition:!0,doc:"Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512)."},"background-opacity":{type:"number","default":1,minimum:0,maximum:1,doc:"The opacity at which the background will be drawn.","function":"interpolated",transition:!0}},transition:{duration:{type:"number","default":300,minimum:0,units:"milliseconds",doc:"Time allotted for transitions to complete."},delay:{type:"number","default":0,minimum:0,units:"milliseconds",doc:"Length of time before a transition begins."}}}},{}],54:[function(t,e,i){e.exports={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number","default":0,period:360,units:"degrees"},pitch:{type:"number","default":0,units:"degrees"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_tile","source_geojson","source_video","source_image"],source_tile:{type:{required:!0,type:"enum",values:["vector","raster"]},url:{type:"string"},tiles:{type:"array",value:"string"},minzoom:{type:"number","default":0},maxzoom:{type:"number","default":22},tileSize:{type:"number","default":512,units:"pixels"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:["geojson"]},data:{type:"*"},maxzoom:{type:"number","default":14},buffer:{type:"number","default":64},tolerance:{type:"number","default":3},cluster:{type:"boolean","default":!1},clusterRadius:{type:"number","default":400},clusterMaxZoom:{type:"number"}},source_video:{type:{required:!0,type:"enum",values:["video"]},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:["image"]},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:["fill","line","symbol","circle","raster","background"]},metadata:{type:"*"},ref:{type:"string"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:22},maxzoom:{type:"number",minimum:0,maximum:22},interactive:{type:"boolean","default":!1},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"},"paint.*":{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_symbol","layout_raster","layout_background"],layout_background:{visibility:{type:"enum","function":"piecewise-constant",values:["visible","none"],"default":"visible"}},layout_fill:{visibility:{type:"enum","function":"piecewise-constant",values:["visible","none"],"default":"visible"}},layout_circle:{visibility:{type:"enum","function":"piecewise-constant",values:["visible","none"],"default":"visible"}},layout_line:{"line-cap":{type:"enum","function":"piecewise-constant",values:["butt","round","square"],"default":"butt"},"line-join":{type:"enum","function":"piecewise-constant",values:["bevel","round","miter"],"default":"miter"},"line-miter-limit":{type:"number","default":2,"function":"interpolated",requires:[{"line-join":"miter"}]},"line-round-limit":{type:"number","default":1.05,"function":"interpolated",requires:[{"line-join":"round"}]},visibility:{type:"enum","function":"piecewise-constant",values:["visible","none"],"default":"visible"}},layout_symbol:{"symbol-placement":{type:"enum","function":"piecewise-constant",values:["point","line"],"default":"point"},"symbol-spacing":{type:"number","default":250,minimum:1,"function":"interpolated",units:"pixels",requires:[{"symbol-placement":"line"}]},"symbol-avoid-edges":{type:"boolean","function":"piecewise-constant","default":!1},"icon-allow-overlap":{type:"boolean","function":"piecewise-constant","default":!1,requires:["icon-image"]},"icon-ignore-placement":{type:"boolean","function":"piecewise-constant","default":!1,requires:["icon-image"]},"icon-optional":{type:"boolean","function":"piecewise-constant","default":!1,requires:["icon-image","text-field"]},"icon-rotation-alignment":{type:"enum","function":"piecewise-constant",values:["map","viewport"],"default":"viewport",requires:["icon-image"]},"icon-size":{type:"number","default":1,minimum:0,"function":"interpolated",requires:["icon-image"]},"icon-image":{type:"string","function":"piecewise-constant",tokens:!0},"icon-rotate":{type:"number","default":0,period:360,"function":"interpolated",units:"degrees",requires:["icon-image"]},"icon-padding":{type:"number","default":2,minimum:0,"function":"interpolated",units:"pixels",requires:["icon-image"]},"icon-keep-upright":{type:"boolean","function":"piecewise-constant","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",requires:["icon-image"]},"text-rotation-alignment":{type:"enum","function":"piecewise-constant",values:["map","viewport"],"default":"viewport",requires:["text-field"]},"text-field":{type:"string","function":"piecewise-constant","default":"",tokens:!0},"text-font":{type:"array",value:"string","function":"piecewise-constant","default":["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"]},"text-size":{type:"number","default":16,minimum:0,units:"pixels","function":"interpolated",requires:["text-field"]},"text-max-width":{type:"number","default":10,minimum:0,units:"em","function":"interpolated",requires:["text-field"]},"text-line-height":{type:"number","default":1.2,units:"em","function":"interpolated",requires:["text-field"]},"text-letter-spacing":{type:"number","default":0,units:"em","function":"interpolated",requires:["text-field"]},"text-justify":{type:"enum","function":"piecewise-constant",values:["left","center","right"],"default":"center",requires:["text-field"]},"text-anchor":{type:"enum","function":"piecewise-constant",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",requires:["text-field",{"symbol-placement":"line"}]},"text-rotate":{type:"number","default":0,period:360,units:"degrees","function":"interpolated",requires:["text-field"]},"text-padding":{type:"number","default":2,minimum:0,units:"pixels","function":"interpolated",requires:["text-field"]},"text-keep-upright":{type:"boolean","function":"piecewise-constant","default":!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":"line"}]},"text-transform":{type:"enum","function":"piecewise-constant",values:["none","uppercase","lowercase"],"default":"none",requires:["text-field"]},"text-offset":{type:"array",value:"number",units:"ems","function":"interpolated",length:2,"default":[0,0],requires:["text-field"]},"text-allow-overlap":{type:"boolean","function":"piecewise-constant","default":!1,requires:["text-field"]},"text-ignore-placement":{type:"boolean","function":"piecewise-constant","default":!1,requires:["text-field"]},"text-optional":{type:"boolean","function":"piecewise-constant","default":!1,requires:["text-field","icon-image"]},visibility:{type:"enum","function":"piecewise-constant",values:["visible","none"],"default":"visible"}},layout_raster:{visibility:{type:"enum","function":"piecewise-constant",values:["visible","none"],"default":"visible"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:["==","!=",">",">=","<","<=","in","!in","all","any","none","has","!has"]
},geometry_type:{type:"enum",values:["Point","LineString","Polygon"]},color_operation:{type:"enum",values:["lighten","saturate","spin","fade","mix"]},"function":{stops:{type:"array",required:!0,value:"function_stop"},base:{type:"number","default":1,minimum:0},property:{type:"string","default":"$zoom"},type:{type:"enum",values:["exponential","interval","categorical"],"default":"exponential"}},function_stop:{type:"array",minimum:0,maximum:22,value:["number","color"],length:2},paint:["paint_fill","paint_line","paint_circle","paint_symbol","paint_raster","paint_background"],paint_fill:{"fill-antialias":{type:"boolean","function":"piecewise-constant","default":!0},"fill-opacity":{type:"number","function":"interpolated","default":1,minimum:0,maximum:1,transition:!0},"fill-color":{type:"color","default":"#000000","function":"interpolated",transition:!0,requires:[{"!":"fill-pattern"}]},"fill-outline-color":{type:"color","function":"interpolated",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}]},"fill-translate":{type:"array",value:"number",length:2,"default":[0,0],"function":"interpolated",transition:!0,units:"pixels"},"fill-translate-anchor":{type:"enum","function":"piecewise-constant",values:["map","viewport"],"default":"map",requires:["fill-translate"]},"fill-pattern":{type:"string","function":"piecewise-constant",transition:!0}},paint_line:{"line-opacity":{type:"number","function":"interpolated","default":1,minimum:0,maximum:1,transition:!0},"line-color":{type:"color","default":"#000000","function":"interpolated",transition:!0,requires:[{"!":"line-pattern"}]},"line-translate":{type:"array",value:"number",length:2,"default":[0,0],"function":"interpolated",transition:!0,units:"pixels"},"line-translate-anchor":{type:"enum","function":"piecewise-constant",values:["map","viewport"],"default":"map",requires:["line-translate"]},"line-width":{type:"number","default":1,minimum:0,"function":"interpolated",transition:!0,units:"pixels"},"line-gap-width":{type:"number","default":0,minimum:0,"function":"interpolated",transition:!0,units:"pixels"},"line-offset":{type:"number","default":0,"function":"interpolated",transition:!0,units:"pixels"},"line-blur":{type:"number","default":0,minimum:0,"function":"interpolated",transition:!0,units:"pixels"},"line-dasharray":{type:"array",value:"number","function":"piecewise-constant",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}]},"line-pattern":{type:"string","function":"piecewise-constant",transition:!0}},paint_circle:{"circle-radius":{type:"number","default":5,minimum:0,"function":"interpolated",transition:!0,units:"pixels"},"circle-color":{type:"color","default":"#000000","function":"interpolated",transition:!0},"circle-blur":{type:"number","default":0,"function":"interpolated",transition:!0},"circle-opacity":{type:"number","default":1,minimum:0,maximum:1,"function":"interpolated",transition:!0},"circle-translate":{type:"array",value:"number",length:2,"default":[0,0],"function":"interpolated",transition:!0,units:"pixels"},"circle-translate-anchor":{type:"enum","function":"piecewise-constant",values:["map","viewport"],"default":"map",requires:["circle-translate"]}},paint_symbol:{"icon-opacity":{type:"number","default":1,minimum:0,maximum:1,"function":"interpolated",transition:!0,requires:["icon-image"]},"icon-color":{type:"color","default":"#000000","function":"interpolated",transition:!0,requires:["icon-image"]},"icon-halo-color":{type:"color","default":"rgba(0, 0, 0, 0)","function":"interpolated",transition:!0,requires:["icon-image"]},"icon-halo-width":{type:"number","default":0,minimum:0,"function":"interpolated",transition:!0,units:"pixels",requires:["icon-image"]},"icon-halo-blur":{type:"number","default":0,minimum:0,"function":"interpolated",transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate":{type:"array",value:"number",length:2,"default":[0,0],"function":"interpolated",transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate-anchor":{type:"enum","function":"piecewise-constant",values:["map","viewport"],"default":"map",requires:["icon-image","icon-translate"]},"text-opacity":{type:"number","default":1,minimum:0,maximum:1,"function":"interpolated",transition:!0,requires:["text-field"]},"text-color":{type:"color","default":"#000000","function":"interpolated",transition:!0,requires:["text-field"]},"text-halo-color":{type:"color","default":"rgba(0, 0, 0, 0)","function":"interpolated",transition:!0,requires:["text-field"]},"text-halo-width":{type:"number","default":0,minimum:0,"function":"interpolated",transition:!0,units:"pixels",requires:["text-field"]},"text-halo-blur":{type:"number","default":0,minimum:0,"function":"interpolated",transition:!0,units:"pixels",requires:["text-field"]},"text-translate":{type:"array",value:"number",length:2,"default":[0,0],"function":"interpolated",transition:!0,units:"pixels",requires:["text-field"]},"text-translate-anchor":{type:"enum","function":"piecewise-constant",values:["map","viewport"],"default":"map",requires:["text-field","text-translate"]}},paint_raster:{"raster-opacity":{type:"number","default":1,minimum:0,maximum:1,"function":"interpolated",transition:!0},"raster-hue-rotate":{type:"number","default":0,period:360,"function":"interpolated",transition:!0,units:"degrees"},"raster-brightness-min":{type:"number","function":"interpolated","default":0,minimum:0,maximum:1,transition:!0},"raster-brightness-max":{type:"number","function":"interpolated","default":1,minimum:0,maximum:1,transition:!0},"raster-saturation":{type:"number","default":0,minimum:-1,maximum:1,"function":"interpolated",transition:!0},"raster-contrast":{type:"number","default":0,minimum:-1,maximum:1,"function":"interpolated",transition:!0},"raster-fade-duration":{type:"number","default":300,minimum:0,"function":"interpolated",transition:!0,units:"milliseconds"}},paint_background:{"background-color":{type:"color","default":"#000000","function":"interpolated",transition:!0,requires:[{"!":"background-pattern"}]},"background-pattern":{type:"string","function":"piecewise-constant",transition:!0},"background-opacity":{type:"number","default":1,minimum:0,maximum:1,"function":"interpolated",transition:!0}},transition:{duration:{type:"number","default":300,minimum:0,units:"milliseconds"},delay:{type:"number","default":0,minimum:0,units:"milliseconds"}}}},{}],55:[function(t,e,i){"use strict";function n(t){if(this.zoom=t.zoom,this.overscaling=t.overscaling,this.layer=t.layer,this.childLayers=t.childLayers,this.type=this.layer.type,this.features=[],this.id=this.layer.id,this.index=t.index,this.sourceLayer=this.layer.sourceLayer,this.sourceLayerIndex=t.sourceLayerIndex,this.minZoom=this.layer.minzoom,this.maxZoom=this.layer.maxzoom,this.paintAttributes=o(this),t.arrays){var e=this.childLayers;this.bufferGroups=c.mapObject(t.arrays,function(i,n){return i.map(function(i){var r=c.mapObject(i,function(e,i){return c.mapObject(e,function(e,r){var o=t.arrayTypes[n][i][r],a=o.members.length&&"vertices"===o.members[0].name?u.BufferType.ELEMENT:u.BufferType.VERTEX;return new u(e,o,a)})});r.vaos={},r.layout.element2&&(r.secondVaos={});for(var o=0;o<e.length;o++){var a=e[o].id;r.vaos[a]=new f,r.layout.element2&&(r.secondVaos[a]=new f)}return r})})}}function r(t){return new h({members:[{type:u.ELEMENT_ATTRIBUTE_TYPE,name:"vertices",components:t||3}]})}function o(t){var e={};for(var i in t.programInterfaces){for(var n=e[i]={},r=0;r<t.childLayers.length;r++){var o=t.childLayers[r];n[o.id]={attributes:[],uniforms:[]}}var l=t.programInterfaces[i];if(l.paintAttributes)for(var u=0;u<l.paintAttributes.length;u++)for(var h=l.paintAttributes[u],f=0;f<t.childLayers.length;f++){var d=t.childLayers[f],p=n[d.id];if(d.isPaintValueFeatureConstant(h.paintProperty))p.uniforms.push(h);else if(d.isPaintValueZoomConstant(h.paintProperty))p.attributes.push(h);else{for(var m=d.getPaintValueStopZoomLevels(h.paintProperty),v=0;v<m.length&&m[v]<t.zoom;)v++;for(var y=Math.max(0,Math.min(m.length-4,v-2)),_=[],g=0;4>g;g++)_.push(m[Math.min(y+g,m.length-1)]);var x=h.components;if(1===x)p.attributes.push(c.extend({},h,{getValue:a(h,_),isFunction:!0,components:4*x}));else for(var b=0;4>b;b++)p.attributes.push(c.extend({},h,{getValue:a(h,[_[b]]),isFunction:!0,name:h.name+b}));p.uniforms.push(c.extend({},h,{name:"u_"+h.name.slice(2)+"_t",getValue:s(h,y),components:1}))}}}return e}function a(t,e){return function(i,n,r){if(1===e.length)return t.getValue(i,c.extend({},n,{zoom:e[0]}),r);for(var o=[],a=0;a<e.length;a++){var s=e[a];o.push(t.getValue(i,c.extend({},n,{zoom:s}),r)[0])}return o}}function s(t,e){return function(i,n){var r=i.getPaintInterpolationT(t.paintProperty,n.zoom);return[Math.max(0,Math.min(4,r-e))]}}var l=t("feature-filter"),u=t("./buffer"),c=t("../util/util"),h=t("../util/struct_array"),f=t("../render/vertex_array_object");e.exports=n,n.create=function(e){var i={fill:t("./bucket/fill_bucket"),line:t("./bucket/line_bucket"),circle:t("./bucket/circle_bucket"),symbol:t("./bucket/symbol_bucket")};return new i[e.layer.type](e)},n.EXTENT=8192,n.prototype.populateBuffers=function(){this.createArrays(),this.recalculateStyleLayers();for(var t=0;t<this.features.length;t++)this.addFeature(this.features[t]);this.trimArrays()},n.prototype.makeRoomFor=function(t,e){var i=this.arrayGroups[t],n=i.length&&i[i.length-1];if(!n||n.layout.vertex.length+e>65535){var r=this.arrayTypes[t],o=r.layout.vertex,a=r.layout.element,s=r.layout.element2;n={index:i.length,layout:{},paint:{}},n.layout.vertex=new o,a&&(n.layout.element=new a),s&&(n.layout.element2=new s);for(var l=0;l<this.childLayers.length;l++){var u=this.childLayers[l].id,c=r.paint[u];n.paint[u]=new c}i.push(n)}return n},n.prototype.createArrays=function(){this.arrayGroups={},this.arrayTypes={};for(var t in this.programInterfaces){var e=this.programInterfaces[t],i=this.arrayTypes[t]={layout:{},paint:{}};if(this.arrayGroups[t]=[],e.vertexBuffer){var n=new h({members:this.programInterfaces[t].layoutAttributes,alignment:u.VERTEX_ATTRIBUTE_ALIGNMENT});i.layout.vertex=n;var o=this.paintAttributes[t];for(var a in o){var s=new h({members:o[a].attributes,alignment:u.VERTEX_ATTRIBUTE_ALIGNMENT});i.paint[a]=s}}if(e.elementBuffer){var l=r(e.elementBufferComponents);i.layout.element=l}if(e.elementBuffer2){var c=r(e.elementBuffer2Components);i.layout.element2=c}}},n.prototype.destroy=function(t){for(var e in this.bufferGroups)for(var i=this.bufferGroups[e],n=0;n<i.length;n++){var r=i[n];for(var o in r.paint)r.paint[o].destroy(t);for(var a in r.layout)r.layout[a].destroy(t);for(var s in r.vaos)r.vaos[s].destroy(t);for(var l in r.secondVaos)r.secondVaos[l].destroy(t)}},n.prototype.trimArrays=function(){for(var t in this.arrayGroups){var e=this.arrayGroups[t];for(var i in e.paint)e.paint[i].trim();for(var n in e.layout)e.layout[n].trim()}},n.prototype.setUniforms=function(t,e,i,n,r){for(var o=this.paintAttributes[e][n.id].uniforms,a=0;a<o.length;a++){var s=o[a],l=i[s.name];t["uniform"+s.components+"fv"](l,s.getValue(n,r))}},n.prototype.serialize=function(){return{layerId:this.layer.id,zoom:this.zoom,arrays:c.mapObject(this.arrayGroups,function(t){return t.map(function(t){return c.mapObject(t,function(t){return c.mapObject(t,function(t){return t.serialize()})})})}),arrayTypes:c.mapObject(this.arrayTypes,function(t){return c.mapObject(t,function(t){return c.mapObject(t,function(t){return t.serialize()})})}),childLayerIds:this.childLayers.map(function(t){return t.id})}},n.prototype.createFilter=function(){this.filter||(this.filter=l(this.layer.filter))};var d={lastIntegerZoom:1/0,lastIntegerZoomTime:0,lastZoom:0};n.prototype.recalculateStyleLayers=function(){for(var t=0;t<this.childLayers.length;t++)this.childLayers[t].recalculate(this.zoom,d)},n.prototype.getProgramMacros=function(t,e){for(var i=[],n=this.paintAttributes[t][e.id].attributes,r=0;r<n.length;r++){var o=n[r];i.push("ATTRIBUTE_"+(o.isFunction?"ZOOM_FUNCTION_":"")+o.name.toUpperCase())}return i},n.prototype.addPaintAttributes=function(t,e,i,n,r){for(var o=0;o<this.childLayers.length;o++)for(var a=this.childLayers[o],s=this.arrayGroups[t],l=n.index;l<s.length;l++){var u=s[l],c=u.layout.vertex.length,h=u.paint[a.id];h.resize(c);for(var f=this.paintAttributes[t][a.id].attributes,d=0;d<f.length;d++)for(var p=f[d],m=p.getValue(a,e,i),v=p.multiplier||1,y=p.components||1,_=r;c>_;_++)for(var g=h.get(_),x=0;y>x;x++){var b=y>1?p.name+x:p.name;g[b]=m[x]*v}}}},{"../render/vertex_array_object":81,"../util/struct_array":155,"../util/util":157,"./bucket/circle_bucket":56,"./bucket/fill_bucket":57,"./bucket/line_bucket":58,"./bucket/symbol_bucket":59,"./buffer":60,"feature-filter":2}],56:[function(t,e,i){"use strict";function n(){r.apply(this,arguments)}var r=t("../bucket"),o=t("../../util/util"),a=t("../load_geometry"),s=r.EXTENT;e.exports=n,n.prototype=o.inherit(r,{}),n.prototype.addCircleVertex=function(t,e,i,n,r){return t.emplaceBack(2*e+(n+1)/2,2*i+(r+1)/2)},n.prototype.programInterfaces={circle:{vertexBuffer:!0,elementBuffer:!0,layoutAttributes:[{name:"a_pos",components:2,type:"Int16"}],paintAttributes:[{name:"a_color",components:4,type:"Uint8",getValue:function(t,e,i){return o.premultiply(t.getPaintValue("circle-color",e,i))},multiplier:255,paintProperty:"circle-color"},{name:"a_radius",components:1,type:"Uint16",isLayerConstant:!1,getValue:function(t,e,i){return[t.getPaintValue("circle-radius",e,i)]},multiplier:10,paintProperty:"circle-radius"}]}},n.prototype.addFeature=function(t){for(var e={zoom:this.zoom},i=a(t),n=this.makeRoomFor("circle",0),r=n.layout.vertex.length,o=0;o<i.length;o++)for(var l=0;l<i[o].length;l++){var u=i[o][l].x,c=i[o][l].y;if(!(0>u||u>=s||0>c||c>=s)){var h=this.makeRoomFor("circle",4),f=h.layout.vertex,d=this.addCircleVertex(f,u,c,-1,-1);this.addCircleVertex(f,u,c,1,-1),this.addCircleVertex(f,u,c,1,1),this.addCircleVertex(f,u,c,-1,1),h.layout.element.emplaceBack(d,d+1,d+2),h.layout.element.emplaceBack(d,d+3,d+2)}}this.addPaintAttributes("circle",e,t.properties,n,r)}},{"../../util/util":157,"../bucket":55,"../load_geometry":62}],57:[function(t,e,i){"use strict";function n(){r.apply(this,arguments)}var r=t("../bucket"),o=t("../../util/util"),a=t("../load_geometry");e.exports=n,n.prototype=o.inherit(r,{}),n.prototype.programInterfaces={fill:{vertexBuffer:!0,elementBuffer:!0,elementBuffer2:!0,elementBuffer2Components:2,layoutAttributes:[{name:"a_pos",components:2,type:"Int16"}]}},n.prototype.addFeature=function(t){for(var e=a(t),i=0;i<e.length;i++)this.addFill(e[i])},n.prototype.addFill=function(t){if(!(t.length<3))for(var e=t.length,i=this.makeRoomFor("fill",e+1),n,r,o=0;o<t.length;o++){var a=t[o],s=i.layout.vertex.emplaceBack(a.x,a.y);0===o&&(n=s),o>=2&&(a.x!==t[0].x||a.y!==t[0].y)&&i.layout.element.emplaceBack(n,r,s),o>=1&&i.layout.element2.emplaceBack(r,s),r=s}}},{"../../util/util":157,"../bucket":55,"../load_geometry":62}],58:[function(t,e,i){"use strict";function n(){r.apply(this,arguments)}var r=t("../bucket"),o=t("../../util/util"),a=t("../load_geometry"),s=r.EXTENT,l=63,u=Math.cos(37.5*(Math.PI/180)),c=15,h=14,f=.5,d=Math.pow(2,h)/f;e.exports=n,n.prototype=o.inherit(r,{}),n.prototype.addLineVertex=function(t,e,i,n,r,o,a){return t.emplaceBack(e.x<<1|n,e.y<<1|r,Math.round(l*i.x)+128,Math.round(l*i.y)+128,(0===o?0:0>o?-1:1)+1|(a*f&63)<<2,a*f>>6)},n.prototype.programInterfaces={line:{vertexBuffer:!0,elementBuffer:!0,layoutAttributes:[{name:"a_pos",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}]}},n.prototype.addFeature=function(t){for(var e=a(t),i=0;i<e.length;i++)this.addLine(e[i],this.layer.layout["line-join"],this.layer.layout["line-cap"],this.layer.layout["line-miter-limit"],this.layer.layout["line-round-limit"])},n.prototype.addLine=function(t,e,i,n,r){for(var o=t.length;o>2&&t[o-1].equals(t[o-2]);)o--;if(!(t.length<2)){"bevel"===e&&(n=1.05);var a=c*(s/(512*this.overscaling)),l=t[0],h=t[o-1],f=l.equals(h);if(this.makeRoomFor("line",10*o),2!==o||!f){this.distance=0;var d=i,p=f?"butt":i,m=!0,v,y,_,g,x,b,w;this.e1=this.e2=this.e3=-1,f&&(v=t[o-2],x=l.sub(v)._unit()._perp());for(var M=0;o>M;M++)if(_=f&&M===o-1?t[1]:t[M+1],!_||!t[M].equals(_)){x&&(g=x),v&&(y=v),v=t[M],x=_?_.sub(v)._unit()._perp():g,g=g||x;var S=g.add(x)._unit(),E=S.x*x.x+S.y*x.y,T=1/E,I=u>E&&y&&_;if(I&&M>0){var D=v.dist(y);if(D>2*a){var z=v.sub(v.sub(y)._mult(a/D)._round());this.distance+=z.dist(y),this.addCurrentVertex(z,this.distance,g.mult(1),0,0,!1),y=z}}var P=y&&_,L=P?e:_?d:p;if(P&&"round"===L&&(r>T?L="miter":2>=T&&(L="fakeround")),"miter"===L&&T>n&&(L="bevel"),"bevel"===L&&(T>2&&(L="flipbevel"),n>T&&(L="miter")),y&&(this.distance+=v.dist(y)),"miter"===L)S._mult(T),this.addCurrentVertex(v,this.distance,S,0,0,!1);else if("flipbevel"===L){if(T>100)S=x.clone();else{var F=g.x*x.y-g.y*x.x>0?-1:1,A=T*g.add(x).mag()/g.sub(x).mag();S._perp()._mult(A*F)}this.addCurrentVertex(v,this.distance,S,0,0,!1),this.addCurrentVertex(v,this.distance,S.mult(-1),0,0,!1)}else if("bevel"===L||"fakeround"===L){var k=g.x*x.y-g.y*x.x>0,R=-Math.sqrt(T*T-1);if(k?(w=0,b=R):(b=0,w=R),m||this.addCurrentVertex(v,this.distance,g,b,w,!1),"fakeround"===L){for(var C=Math.floor(8*(.5-(E-.5))),O,j=0;C>j;j++)O=x.mult((j+1)/(C+1))._add(g)._unit(),this.addPieSliceVertex(v,this.distance,O,k);this.addPieSliceVertex(v,this.distance,S,k);for(var B=C-1;B>=0;B--)O=g.mult((B+1)/(C+1))._add(x)._unit(),this.addPieSliceVertex(v,this.distance,O,k)}_&&this.addCurrentVertex(v,this.distance,x,-b,-w,!1)}else"butt"===L?(m||this.addCurrentVertex(v,this.distance,g,0,0,!1),_&&this.addCurrentVertex(v,this.distance,x,0,0,!1)):"square"===L?(m||(this.addCurrentVertex(v,this.distance,g,1,1,!1),this.e1=this.e2=-1),_&&this.addCurrentVertex(v,this.distance,x,-1,-1,!1)):"round"===L&&(m||(this.addCurrentVertex(v,this.distance,g,0,0,!1),this.addCurrentVertex(v,this.distance,g,1,1,!0),this.e1=this.e2=-1),_&&(this.addCurrentVertex(v,this.distance,x,-1,-1,!0),this.addCurrentVertex(v,this.distance,x,0,0,!1)));if(I&&o-1>M){var N=v.dist(_);if(N>2*a){var q=v.add(_.sub(v)._mult(a/N)._round());this.distance+=q.dist(v),this.addCurrentVertex(q,this.distance,x.mult(1),0,0,!1),v=q}}m=!1}}}},n.prototype.addCurrentVertex=function(t,e,i,n,r,o){var a=o?1:0,s,l=this.arrayGroups.line[this.arrayGroups.line.length-1].layout,u=l.vertex,c=l.element;s=i.clone(),n&&s._sub(i.perp()._mult(n)),this.e3=this.addLineVertex(u,t,s,a,0,n,e),this.e1>=0&&this.e2>=0&&c.emplaceBack(this.e1,this.e2,this.e3),this.e1=this.e2,this.e2=this.e3,s=i.mult(-1),r&&s._sub(i.perp()._mult(r)),this.e3=this.addLineVertex(u,t,s,a,1,-r,e),this.e1>=0&&this.e2>=0&&c.emplaceBack(this.e1,this.e2,this.e3),this.e1=this.e2,this.e2=this.e3,e>d/2&&(this.distance=0,this.addCurrentVertex(t,this.distance,i,n,r,o))},n.prototype.addPieSliceVertex=function(t,e,i,n){var r=n?1:0;i=i.mult(n?-1:1);var o=this.arrayGroups.line[this.arrayGroups.line.length-1].layout,a=o.vertex,s=o.element;this.e3=this.addLineVertex(a,t,i,0,r,0,e),this.e1>=0&&this.e2>=0&&s.emplaceBack(this.e1,this.e2,this.e3),n?this.e2=this.e3:this.e1=this.e3}},{"../../util/util":157,"../bucket":55,"../load_geometry":62}],59:[function(t,e,i){"use strict";function n(t){s.apply(this,arguments),this.showCollisionBoxes=t.showCollisionBoxes,this.overscaling=t.overscaling,this.collisionBoxArray=t.collisionBoxArray,this.sdfIcons=t.sdfIcons,this.iconsNeedLinear=t.iconsNeedLinear,this.adjustedTextSize=t.adjustedTextSize,this.adjustedIconSize=t.adjustedIconSize,this.fontstack=t.fontstack}function r(t,e,i,n,r,o,a,s,l,u){return t.emplaceBack(e,i,Math.round(64*n),Math.round(64*r),o/4,a/4,10*(u||0),0,10*(s||0),10*Math.min(l||25,25))}function o(t,e,i,n,r,o,a,s,l,u,c,h,f,d,p,m,v){this.x=t.x,this.y=t.y,this.index=a,this.hasText=!!i,this.hasIcon=!!n,this.hasText&&(this.glyphQuads=o?b(t,i,h,e,r,d):[],this.textCollisionFeature=new _(s,e,t,l,u,c,i,h,f,d,!1)),this.hasIcon&&(this.iconQuads=o?w(t,n,p,e,r,v):[],this.iconCollisionFeature=new _(s,e,t,l,u,c,n,p,m,v,!0))}var a=t("point-geometry"),s=t("../bucket"),l=t("../../symbol/anchor"),u=t("../../symbol/get_anchors"),c=t("../../util/token"),h=t("../../symbol/quads"),f=t("../../symbol/shaping"),d=t("../../symbol/resolve_text"),p=t("../../symbol/mergelines"),m=t("../../symbol/clip_line"),v=t("../../util/util"),y=t("../load_geometry"),_=t("../../symbol/collision_feature"),g=f.shapeText,x=f.shapeIcon,b=h.getGlyphQuads,w=h.getIconQuads,M=s.EXTENT;e.exports=n,n.prototype=v.inherit(s,{}),n.prototype.serialize=function(){var t=s.prototype.serialize.apply(this);return t.sdfIcons=this.sdfIcons,t.iconsNeedLinear=this.iconsNeedLinear,t.adjustedTextSize=this.adjustedTextSize,t.adjustedIconSize=this.adjustedIconSize,t.fontstack=this.fontstack,t};var S=[{name:"a_pos",components:2,type:"Int16"},{name:"a_offset",components:2,type:"Int16"},{name:"a_data1",components:4,type:"Uint8"},{name:"a_data2",components:2,type:"Uint8"}];n.prototype.addCollisionBoxVertex=function(t,e,i,n,r){return t.emplaceBack(e.x,e.y,Math.round(i.x),Math.round(i.y),10*n,10*r)},n.prototype.programInterfaces={glyph:{vertexBuffer:!0,elementBuffer:!0,layoutAttributes:S},icon:{vertexBuffer:!0,elementBuffer:!0,layoutAttributes:S},collisionBox:{vertexBuffer:!0,layoutAttributes:[{name:"a_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"},{name:"a_data",components:2,type:"Uint8"}]}},n.prototype.populateBuffers=function(t,e,i){var n={lastIntegerZoom:1/0,lastIntegerZoomTime:0,lastZoom:0};this.adjustedTextMaxSize=this.layer.getLayoutValue("text-size",{zoom:18,zoomHistory:n}),this.adjustedTextSize=this.layer.getLayoutValue("text-size",{zoom:this.zoom+1,zoomHistory:n}),this.adjustedIconMaxSize=this.layer.getLayoutValue("icon-size",{zoom:18,zoomHistory:n}),this.adjustedIconSize=this.layer.getLayoutValue("icon-size",{zoom:this.zoom+1,zoomHistory:n});var r=512*this.overscaling;this.tilePixelRatio=M/r,this.compareText={},this.symbolInstances=[],this.iconsNeedLinear=!1;var o=this.layer.layout,a=this.features,s=this.textFeatures,l=.5,u=.5;switch(o["text-anchor"]){case"right":case"top-right":case"bottom-right":l=1;break;case"left":case"top-left":case"bottom-left":l=0}switch(o["text-anchor"]){case"bottom":case"bottom-right":case"bottom-left":u=1;break;case"top":case"top-right":case"top-left":u=0}for(var h="right"===o["text-justify"]?1:"left"===o["text-justify"]?0:.5,f=24,d=o["text-line-height"]*f,m="line"!==o["symbol-placement"]?o["text-max-width"]*f:0,v=o["text-letter-spacing"]*f,_=[o["text-offset"][0]*f,o["text-offset"][1]*f],b=this.fontstack=o["text-font"].join(","),w=[],S=0;S<a.length;S++)w.push(y(a[S]));if("line"===o["symbol-placement"]){var E=p(a,s,w);w=E.geometries,a=E.features,s=E.textFeatures}for(var T,I,D=0;D<a.length;D++)if(w[D]){if(T=s[D]?g(s[D],e[b],m,d,l,u,h,v,_):null,o["icon-image"]){var z=c(a[D].properties,o["icon-image"]),P=i[z];I=x(P,o),P&&(void 0===this.sdfIcons?this.sdfIcons=P.sdf:this.sdfIcons!==P.sdf&&console.warn("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),1!==P.pixelRatio&&(this.iconsNeedLinear=!0))}else I=null;(T||I)&&this.addFeature(w[D],T,I,a[D].index)}this.placeFeatures(t,this.showCollisionBoxes),this.trimArrays()},n.prototype.addFeature=function(t,e,i,n){var r=this.layer.layout,a=24,s=this.adjustedTextSize/a,c=void 0!==this.adjustedTextMaxSize?this.adjustedTextMaxSize:this.adjustedTextSize,h=this.tilePixelRatio*s,f=this.tilePixelRatio*c/a,d=this.tilePixelRatio*this.adjustedIconSize,p=this.tilePixelRatio*r["symbol-spacing"],v=r["symbol-avoid-edges"],y=r["text-padding"]*this.tilePixelRatio,_=r["icon-padding"]*this.tilePixelRatio,g=r["text-max-angle"]/180*Math.PI,x="map"===r["text-rotation-alignment"]&&"line"===r["symbol-placement"],b="map"===r["icon-rotation-alignment"]&&"line"===r["symbol-placement"],w=r["text-allow-overlap"]||r["icon-allow-overlap"]||r["text-ignore-placement"]||r["icon-ignore-placement"],S="line"===r["symbol-placement"],E=p/2;S&&(t=m(t,0,0,M,M));for(var T=0;T<t.length;T++){var I=t[T],D;D=S?u(I,p,g,e,i,a,f,this.overscaling,M):[new l(I[0].x,I[0].y,0)];for(var z=0,P=D.length;P>z;z++){var L=D[z];if(!(e&&S&&this.anchorIsTooClose(e.text,E,L))){var F=!(L.x<0||L.x>M||L.y<0||L.y>M);if(!v||F){var A=F||w;this.symbolInstances.push(new o(L,I,e,i,r,A,this.symbolInstances.length,this.collisionBoxArray,n,this.sourceLayerIndex,this.index,h,y,x,d,_,b))}}}}},n.prototype.anchorIsTooClose=function(t,e,i){var n=this.compareText;if(t in n){for(var r=n[t],o=r.length-1;o>=0;o--)if(i.dist(r[o])<e)return!0}else n[t]=[];return n[t].push(i),!1},n.prototype.placeFeatures=function(t,e){this.recalculateStyleLayers(),this.createArrays();var i=this.layer.layout,n=t.maxScale,r="map"===i["text-rotation-alignment"]&&"line"===i["symbol-placement"],o="map"===i["icon-rotation-alignment"]&&"line"===i["symbol-placement"],a=i["text-allow-overlap"]||i["icon-allow-overlap"]||i["text-ignore-placement"]||i["icon-ignore-placement"];if(a){var s=t.angle,l=Math.sin(s),u=Math.cos(s);this.symbolInstances.sort(function(t,e){var i=l*t.x+u*t.y|0,n=l*e.x+u*e.y|0;return i-n||e.index-t.index})}for(var c=0;c<this.symbolInstances.length;c++){var h=this.symbolInstances[c],f=h.hasText,d=h.hasIcon,p=i["text-optional"]||!f,m=i["icon-optional"]||!d,v=f?t.placeCollisionFeature(h.textCollisionFeature,i["text-allow-overlap"],i["symbol-avoid-edges"]):t.minScale,y=d?t.placeCollisionFeature(h.iconCollisionFeature,i["icon-allow-overlap"],i["symbol-avoid-edges"]):t.minScale;p||m?!m&&v?v=Math.max(y,v):!p&&y&&(y=Math.max(y,v)):y=v=Math.max(y,v),f&&(t.insertCollisionFeature(h.textCollisionFeature,v,i["text-ignore-placement"]),n>=v&&this.addSymbols("glyph",h.glyphQuads,v,i["text-keep-upright"],r,t.angle)),d&&(t.insertCollisionFeature(h.iconCollisionFeature,y,i["icon-ignore-placement"]),n>=y&&this.addSymbols("icon",h.iconQuads,y,i["icon-keep-upright"],o,t.angle))}e&&this.addToDebugBuffers(t)},n.prototype.addSymbols=function(t,e,i,n,o,a){for(var s=this.makeRoomFor(t,4*e.length),l=s.layout.element,u=s.layout.vertex,c=this.zoom,h=Math.max(Math.log(i)/Math.LN2+c,0),f=0;f<e.length;f++){var d=e[f],p=d.angle,m=(p+a+Math.PI)%(2*Math.PI);if(!(n&&o&&(m<=Math.PI/2||m>3*Math.PI/2))){var v=d.tl,y=d.tr,_=d.bl,g=d.br,x=d.tex,b=d.anchorPoint,w=Math.max(c+Math.log(d.minScale)/Math.LN2,h),M=Math.min(c+Math.log(d.maxScale)/Math.LN2,25);if(!(w>=M)){w===h&&(w=0);var S=r(u,b.x,b.y,v.x,v.y,x.x,x.y,w,M,h);r(u,b.x,b.y,y.x,y.y,x.x+x.w,x.y,w,M,h),r(u,b.x,b.y,_.x,_.y,x.x,x.y+x.h,w,M,h),r(u,b.x,b.y,g.x,g.y,x.x+x.w,x.y+x.h,w,M,h),l.emplaceBack(S,S+1,S+2),l.emplaceBack(S+1,S+2,S+3)}}}},n.prototype.updateIcons=function(t){this.recalculateStyleLayers();var e=this.layer.layout["icon-image"];if(e)for(var i=0;i<this.features.length;i++){var n=c(this.features[i].properties,e);n&&(t[n]=!0)}},n.prototype.updateFont=function(t){this.recalculateStyleLayers();var e=this.layer.layout["text-font"],i=t[e]=t[e]||{};this.textFeatures=d(this.features,this.layer.layout,i)},n.prototype.addToDebugBuffers=function(t){for(var e=this.makeRoomFor("collisionBox",0),i=e.layout.vertex,n=-t.angle,r=t.yStretch,o=0;o<this.symbolInstances.length;o++)for(var s=0;2>s;s++){var l=this.symbolInstances[o][0===s?"textCollisionFeature":"iconCollisionFeature"];if(l)for(var u=l.boxStartIndex;u<l.boxEndIndex;u++){var c=this.collisionBoxArray.get(u),h=c.anchorPoint,f=new a(c.x1,c.y1*r)._rotate(n),d=new a(c.x2,c.y1*r)._rotate(n),p=new a(c.x1,c.y2*r)._rotate(n),m=new a(c.x2,c.y2*r)._rotate(n),v=Math.max(0,Math.min(25,this.zoom+Math.log(c.maxScale)/Math.LN2)),y=Math.max(0,Math.min(25,this.zoom+Math.log(c.placementScale)/Math.LN2));this.addCollisionBoxVertex(i,h,f,v,y),this.addCollisionBoxVertex(i,h,d,v,y),this.addCollisionBoxVertex(i,h,d,v,y),this.addCollisionBoxVertex(i,h,m,v,y),this.addCollisionBoxVertex(i,h,m,v,y),this.addCollisionBoxVertex(i,h,p,v,y),this.addCollisionBoxVertex(i,h,p,v,y),this.addCollisionBoxVertex(i,h,f,v,y)}}}},{"../../symbol/anchor":111,"../../symbol/clip_line":113,"../../symbol/collision_feature":115,"../../symbol/get_anchors":117,"../../symbol/mergelines":120,"../../symbol/quads":121,"../../symbol/resolve_text":122,"../../symbol/shaping":123,"../../util/token":156,"../../util/util":157,"../bucket":55,"../load_geometry":62,"point-geometry":161}],60:[function(t,e,i){"use strict";function n(t,e,i){this.arrayBuffer=t.arrayBuffer,this.length=t.length,this.attributes=e.members,this.itemSize=e.bytesPerElement,this.type=i,this.arrayType=e}var r=t("assert");e.exports=n,n.prototype.bind=function(t){var e=t[this.type];this.buffer?t.bindBuffer(e,this.buffer):(this.buffer=t.createBuffer(),t.bindBuffer(e,this.buffer),t.bufferData(e,this.arrayBuffer,t.STATIC_DRAW),this.arrayBuffer=null)};var o={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT"};n.prototype.setVertexAttribPointers=function(t,e){for(var i=0;i<this.attributes.length;i++){var n=this.attributes[i],a=e[n.name];r(void 0!==a,'array member "'+n.name+'" name does not match shader attribute name'),t.vertexAttribPointer(a,n.components,t[o[n.type]],!1,this.arrayType.bytesPerElement,n.offset)}},n.prototype.destroy=function(t){this.buffer&&t.deleteBuffer(this.buffer)},n.BufferType={VERTEX:"ARRAY_BUFFER",ELEMENT:"ELEMENT_ARRAY_BUFFER"},n.ELEMENT_ATTRIBUTE_TYPE="Uint16",n.VERTEX_ATTRIBUTE_ALIGNMENT=4},{assert:176}],61:[function(t,e,i){"use strict";function n(t,e,i){if(t.grid){var n=t,r=e;t=n.coord,e=n.overscaling,this.grid=new p(n.grid),this.featureIndexArray=new S(n.featureIndexArray),this.rawTileData=r,this.bucketLayerIDs=n.bucketLayerIDs}else this.grid=new p(h,16,0),this.featureIndexArray=new S;this.coord=t,this.overscaling=e,this.x=t.x,this.y=t.y,this.z=t.z-Math.log(e)/Math.LN2,this.setCollisionTile(i)}function r(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function o(t,e){return e-t}function a(t){return t["line-gap-width"]>0?t["line-gap-width"]+2*t["line-width"]:t["line-width"]}function s(t,e,i,n,r){if(!e[0]&&!e[1])return t;e=u.convert(e),"viewport"===i&&e._rotate(-n);for(var o=[],a=0;a<t.length;a++){for(var s=t[a],l=[],c=0;c<s.length;c++)l.push(s[c].sub(e._mult(r)));o.push(l)}return o}function l(t,e){for(var i=[],n=new u(0,0),r=0;r<t.length;r++){for(var o=t[r],a=[],s=0;s<o.length;s++){var l=o[s-1],c=o[s],h=o[s+1],f=0===s?n:c.sub(l)._unit()._perp(),d=s===o.length-1?n:h.sub(c)._unit()._perp(),p=f._add(d)._unit(),m=p.x*d.x+p.y*d.y;p._mult(1/m),a.push(p._mult(e)._add(c))}i.push(a)}return i}var u=t("point-geometry"),c=t("./load_geometry"),h=t("./bucket").EXTENT,f=t("feature-filter"),d=t("../util/struct_array"),p=t("grid-index"),m=t("../util/dictionary_coder"),v=t("vector-tile"),y=t("pbf"),_=t("../util/vectortile_to_geojson"),g=t("../util/util").arraysIntersect,x=t("../util/intersection_tests"),b=x.multiPolygonIntersectsBufferedMultiPoint,w=x.multiPolygonIntersectsMultiPolygon,M=x.multiPolygonIntersectsBufferedMultiLine,S=new d({members:[{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]});e.exports=n,n.prototype.insert=function(t,e,i,n){var r=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(e,i,n);for(var o=c(t),a=0;a<o.length;a++){for(var s=o[a],l=[1/0,1/0,-(1/0),-(1/0)],u=0;u<s.length;u++){var h=s[u];l[0]=Math.min(l[0],h.x),l[1]=Math.min(l[1],h.y),l[2]=Math.max(l[2],h.x),l[3]=Math.max(l[3],h.y)}this.grid.insert(r,l[0],l[1],l[2],l[3])}},n.prototype.setCollisionTile=function(t){this.collisionTile=t},n.prototype.serialize=function(){var t={coord:this.coord,overscaling:this.overscaling,grid:this.grid.toArrayBuffer(),featureIndexArray:this.featureIndexArray.serialize(),bucketLayerIDs:this.bucketLayerIDs};return{data:t,transferables:[t.grid,t.featureIndexArray.arrayBuffer]}},n.prototype.query=function(t,e){this.vtLayers||(this.vtLayers=new v.VectorTile(new y(new Uint8Array(this.rawTileData))).layers,this.sourceLayerCoder=new m(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]));var i={},n=t.params||{},s=h/t.tileSize/t.scale,l=f(n.filter),c=0;for(var d in e){var p=e[d],_=p.paint,g=0;"line"===p.type?g=a(_)/2+Math.abs(_["line-offset"])+r(_["line-translate"]):"fill"===p.type?g=r(_["fill-translate"]):"circle"===p.type&&(g=_["circle-radius"]+r(_["circle-translate"])),
c=Math.max(c,g*s)}for(var x=t.queryGeometry.map(function(t){return t.map(function(t){return new u(t.x,t.y)})}),b=1/0,w=1/0,M=-(1/0),S=-(1/0),E=0;E<x.length;E++)for(var T=x[E],I=0;I<T.length;I++){var D=T[I];b=Math.min(b,D.x),w=Math.min(w,D.y),M=Math.max(M,D.x),S=Math.max(S,D.y)}var z=this.grid.query(b-c,w-c,M+c,S+c);z.sort(o),this.filterMatching(i,z,this.featureIndexArray,x,l,n.layers,e,t.bearing,s);var P=this.collisionTile.queryRenderedSymbols(b,w,M,S,t.scale);return P.sort(),this.filterMatching(i,P,this.collisionTile.collisionBoxArray,x,l,n.layers,e,t.bearing,s),i},n.prototype.filterMatching=function(t,e,i,n,r,o,u,h,f){for(var d,p=0;p<e.length;p++){var m=e[p];if(m!==d){d=m;var v=i.get(m),y=this.bucketLayerIDs[v.bucketIndex];if(!o||g(o,y)){var x=this.sourceLayerCoder.decode(v.sourceLayerIndex),S=this.vtLayers[x],E=S.feature(v.featureIndex);if(r(E))for(var T=null,I=0;I<y.length;I++){var D=y[I];if(!(o&&o.indexOf(D)<0)){var z=u[D];if(z){var P;if("symbol"!==z.type){T||(T=c(E));var L=z.paint;if("line"===z.type){P=s(n,L["line-translate"],L["line-translate-anchor"],h,f);var F=a(L)/2*f;if(L["line-offset"]&&(T=l(T,L["line-offset"]*f)),!M(P,T,F))continue}else if("fill"===z.type){if(P=s(n,L["fill-translate"],L["fill-translate-anchor"],h,f),!w(P,T))continue}else if("circle"===z.type){P=s(n,L["circle-translate"],L["circle-translate-anchor"],h,f);var A=L["circle-radius"]*f;if(!b(P,T,A))continue}}var k=new _(E,this.z,this.x,this.y);k.layer=z.serialize({includeRefProperties:!0});var R=t[D];void 0===R&&(R=t[D]=[]),R.push(k)}}}}}}}},{"../util/dictionary_coder":148,"../util/intersection_tests":152,"../util/struct_array":155,"../util/util":157,"../util/vectortile_to_geojson":158,"./bucket":55,"./load_geometry":62,"feature-filter":2,"grid-index":22,pbf:160,"point-geometry":161,"vector-tile":166}],62:[function(t,e,i){"use strict";var n=t("./bucket").EXTENT,r=-2*n,o=2*n-1,a=!1;e.exports=function s(t){for(var e=n/t.extent,i=t.loadGeometry(),s=0;s<i.length;s++)for(var l=i[s],u=0;u<l.length;u++){var c=l[u];c.x=Math.round(c.x*e),c.y=Math.round(c.y*e),a===!1&&(c.x<r||c.x>o||c.y<r||c.y>o)&&(console.warn("Geometry exceeds allowed extent, reduce your vector tile buffer size"),a=!0)}return i}},{"./bucket":55}],63:[function(t,e,i){"use strict";function n(t,e,i){this.column=t,this.row=e,this.zoom=i}e.exports=n,n.prototype={clone:function(){return new n(this.column,this.row,this.zoom)},zoomTo:function(t){return this.clone()._zoomTo(t)},sub:function(t){return this.clone()._sub(t)},_zoomTo:function(t){var e=Math.pow(2,t-this.zoom);return this.column*=e,this.row*=e,this.zoom=t,this},_sub:function(t){return t=t.zoomTo(this.zoom),this.column-=t.column,this.row-=t.row,this}}},{}],64:[function(t,e,i){"use strict";function n(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}e.exports=n;var r=t("../util/util").wrap;n.prototype.wrap=function(){return new n(r(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){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t}},{"../util/util":157}],65:[function(t,e,i){"use strict";function n(t,e){t&&(e?this.extend(t).extend(e):4===t.length?this.extend([t[0],t[1]]).extend([t[2],t[3]]):this.extend(t[0]).extend(t[1]))}e.exports=n;var r=t("./lng_lat");n.prototype={extend:function(t){var e=this._sw,i=this._ne,o,a;if(t instanceof r)o=t,a=t;else{if(!(t instanceof n))return t?this.extend(r.convert(t)||n.convert(t)):this;if(o=t._sw,a=t._ne,!o||!a)return this}return e||i?(e.lng=Math.min(o.lng,e.lng),e.lat=Math.min(o.lat,e.lat),i.lng=Math.max(a.lng,i.lng),i.lat=Math.max(a.lat,i.lat)):(this._sw=new r(o.lng,o.lat),this._ne=new r(a.lng,a.lat)),this},getCenter:function(){return new r((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},getSouthWest:function(){return this._sw},getNorthEast:function(){return this._ne},getNorthWest:function(){return new r(this.getWest(),this.getNorth())},getSouthEast:function(){return new r(this.getEast(),this.getSouth())},getWest:function(){return this._sw.lng},getSouth:function(){return this._sw.lat},getEast:function(){return this._ne.lng},getNorth:function(){return this._ne.lat},toArray:function(){return[this._sw.toArray(),this._ne.toArray()]},toString:function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"}},n.convert=function(t){return!t||t instanceof n?t:new n(t)}},{"./lng_lat":64}],66:[function(t,e,i){"use strict";function n(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 r(0,0),this.zoom=0,this.angle=0,this._altitude=1.5,this._pitch=0,this._unmodified=!0}var r=t("./lng_lat"),o=t("point-geometry"),a=t("./coordinate"),s=t("../util/util").wrap,l=t("../util/interpolate"),u=t("../source/tile_coord"),c=t("../data/bucket").EXTENT,h=t("gl-matrix"),f=h.vec4,d=h.mat4,p=h.mat2;e.exports=n,n.prototype={get minZoom(){return this._minZoom},set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},get maxZoom(){return this._maxZoom},set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},get worldSize(){return this.tileSize*this.scale},get centerPoint(){return this.size._div(2)},get size(){return new o(this.width,this.height)},get bearing(){return-this.angle/Math.PI*180},set bearing(t){var e=-s(t,-180,180)*Math.PI/180;this.angle!==e&&(this._unmodified=!1,this.angle=e,this._calcProjMatrix(),this.rotationMatrix=p.create(),p.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},get pitch(){return this._pitch/Math.PI*180},set pitch(t){var e=Math.min(60,t)/180*Math.PI;this._pitch!==e&&(this._unmodified=!1,this._pitch=e,this._calcProjMatrix())},get altitude(){return this._altitude},set altitude(t){var e=Math.max(.75,t);this._altitude!==e&&(this._unmodified=!1,this._altitude=e,this._calcProjMatrix())},get zoom(){return this._zoom},set zoom(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._calcProjMatrix(),this._constrain())},get center(){return this._center},set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._calcProjMatrix(),this._constrain())},resize:function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._calcProjMatrix(),this._constrain()},get unmodified(){return this._unmodified},zoomScale:function(t){return Math.pow(2,t)},scaleZoom:function(t){return Math.log(t)/Math.LN2},project:function(t,e){return new o(this.lngX(t.lng,e),this.latY(t.lat,e))},unproject:function(t,e){return new r(this.xLng(t.x,e),this.yLat(t.y,e))},get x(){return this.lngX(this.center.lng)},get y(){return this.latY(this.center.lat)},get point(){return new o(this.x,this.y)},lngX:function(t,e){return(180+t)*(e||this.worldSize)/360},latY:function(t,e){var i=180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360));return(180-i)*(e||this.worldSize)/360},xLng:function(t,e){return 360*t/(e||this.worldSize)-180},yLat:function(t,e){var i=180-360*t/(e||this.worldSize);return 360/Math.PI*Math.atan(Math.exp(i*Math.PI/180))-90},panBy:function(t){var e=this.centerPoint._add(t);this.center=this.pointLocation(e)},setLocationAtPoint:function(t,e){var i=this.locationCoordinate(t),n=this.pointCoordinate(e),r=this.pointCoordinate(this.centerPoint),o=n._sub(i);this._unmodified=!1,this.center=this.coordinateLocation(r._sub(o))},locationPoint:function(t){return this.coordinatePoint(this.locationCoordinate(t))},pointLocation:function(t){return this.coordinateLocation(this.pointCoordinate(t))},locationCoordinate:function(t){var e=this.zoomScale(this.tileZoom)/this.worldSize,i=r.convert(t);return new a(this.lngX(i.lng)*e,this.latY(i.lat)*e,this.tileZoom)},coordinateLocation:function(t){var e=this.zoomScale(t.zoom);return new r(this.xLng(t.column,e),this.yLat(t.row,e))},pointCoordinate:function(t){var e=0,i=this.coordinatePointMatrix(this.tileZoom);if(d.invert(i,i),!i)throw new Error("failed to invert matrix");var n=[t.x,t.y,0,1],r=[t.x,t.y,1,1];f.transformMat4(n,n,i),f.transformMat4(r,r,i);var o=n[3],s=r[3],u=n[0]/o,c=r[0]/s,h=n[1]/o,p=r[1]/s,m=n[2]/o,v=r[2]/s,y=m===v?0:(e-m)/(v-m);return new a(l(u,c,y),l(h,p,y),this.tileZoom)},coordinatePoint:function(t){var e=this.coordinatePointMatrix(t.zoom),i=[t.column,t.row,0,1];return f.transformMat4(i,i,e),new o(i[0]/i[3],i[1]/i[3])},coordinatePointMatrix:function(t){var e=d.copy(new Float64Array(16),this.projMatrix),i=this.worldSize/this.zoomScale(t);return d.scale(e,e,[i,i,1]),d.multiply(e,this.getPixelMatrix(),e),e},getPixelMatrix:function(){var t=d.create();return d.scale(t,t,[this.width/2,-this.height/2,1]),d.translate(t,t,[1,-1,0]),t},calculatePosMatrix:function(t,e){void 0===e&&(e=1/0),t instanceof u&&(t=t.toCoordinate(e));var i=Math.min(t.zoom,e),n=this.worldSize/Math.pow(2,i),r=new Float64Array(16);return d.identity(r),d.translate(r,r,[t.column*n,t.row*n,0]),d.scale(r,r,[n/c,n/c,1]),d.multiply(r,this.projMatrix,r),new Float32Array(r)},_constrain:function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,e,i,n,r,a,s,l,u=this.size,c=this._unmodified;this.latRange&&(t=this.latY(this.latRange[1]),e=this.latY(this.latRange[0]),r=e-t<u.y?u.y/(e-t):0),this.lngRange&&(i=this.lngX(this.lngRange[0]),n=this.lngX(this.lngRange[1]),a=n-i<u.x?u.x/(n-i):0);var h=Math.max(a||0,r||0);if(h)return this.center=this.unproject(new o(a?(n+i)/2:this.x,r?(e+t)/2:this.y)),this.zoom+=this.scaleZoom(h),this._unmodified=c,void(this._constraining=!1);if(this.latRange){var f=this.y,d=u.y/2;t>f-d&&(l=t+d),f+d>e&&(l=e-d)}if(this.lngRange){var p=this.x,m=u.x/2;i>p-m&&(s=i+m),p+m>n&&(s=n-m)}void 0===s&&void 0===l||(this.center=this.unproject(new o(void 0!==s?s:this.x,void 0!==l?l:this.y))),this._unmodified=c,this._constraining=!1}},_calcProjMatrix:function(){var t=new Float64Array(16),e=Math.atan(.5/this.altitude),i=Math.sin(e)*this.altitude/Math.sin(Math.PI/2-this._pitch-e),n=Math.cos(Math.PI/2-this._pitch)*i+this.altitude;d.perspective(t,2*Math.atan(this.height/2/this.altitude),this.width/this.height,.1,n),d.translate(t,t,[0,0,-this.altitude]),d.scale(t,t,[1,-1,1/this.height]),d.rotateX(t,t,this._pitch),d.rotateZ(t,t,this.angle),d.translate(t,t,[-this.x,-this.y,0]),this.projMatrix=t}}},{"../data/bucket":55,"../source/tile_coord":89,"../util/interpolate":151,"../util/util":157,"./coordinate":63,"./lng_lat":64,"gl-matrix":12,"point-geometry":161}],67:[function(t,e,i){"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 r(t,e,i,o){o=o||1;var a=[],s,l,u,c,h,f,d,p;for(s=0,l=t.length;l>s;s++)if(h=n[t[s]]){for(p=null,u=0,c=h[1].length;c>u;u+=2)-1===h[1][u]&&-1===h[1][u+1]?p=null:(f=e+h[1][u]*o,d=i-h[1][u+1]*o,p&&a.push(p.x,p.y,f,d),p={x:f,y:d});e+=h[0]*o}return a}},{}],68:[function(t,e,i){"use strict";var n=e.exports={};n.Map=t("./ui/map"),n.Control=t("./ui/control/control"),n.Navigation=t("./ui/control/navigation"),n.Geolocate=t("./ui/control/geolocate"),n.Attribution=t("./ui/control/attribution"),n.Popup=t("./ui/popup"),n.GeoJSONSource=t("./source/geojson_source"),n.VideoSource=t("./source/video_source"),n.ImageSource=t("./source/image_source"),n.Style=t("./style/style"),n.LngLat=t("./geo/lng_lat"),n.LngLatBounds=t("./geo/lng_lat_bounds"),n.Point=t("point-geometry"),n.Evented=t("./util/evented"),n.util=t("./util/util"),n.supported=t("./util/browser").supported;var r=t("./util/ajax");n.util.getJSON=r.getJSON,n.util.getArrayBuffer=r.getArrayBuffer;var o=t("./util/config");n.config=o,Object.defineProperty(n,"accessToken",{get:function(){return o.ACCESS_TOKEN},set:function(t){o.ACCESS_TOKEN=t}})},{"./geo/lng_lat":64,"./geo/lng_lat_bounds":65,"./source/geojson_source":82,"./source/image_source":84,"./source/video_source":92,"./style/style":98,"./ui/control/attribution":126,"./ui/control/control":127,"./ui/control/geolocate":128,"./ui/control/navigation":129,"./ui/map":139,"./ui/popup":140,"./util/ajax":142,"./util/browser":143,"./util/config":147,"./util/evented":149,"./util/util":157,"point-geometry":161}],69:[function(t,e,i){"use strict";function n(t,e,i){var n=t.gl,r=t.transform,l=a.premultiply(i.paint["background-color"]),u=i.paint["background-pattern"],c=i.paint["background-opacity"],h,f=u?t.spriteAtlas.getPosition(u.from,!0):null,d=u?t.spriteAtlas.getPosition(u.to,!0):null;if(t.setDepthSublayer(0),f&&d){if(t.isOpaquePass)return;h=t.useProgram("pattern"),n.uniform1i(h.u_image,0),n.uniform2fv(h.u_pattern_tl_a,f.tl),n.uniform2fv(h.u_pattern_br_a,f.br),n.uniform2fv(h.u_pattern_tl_b,d.tl),n.uniform2fv(h.u_pattern_br_b,d.br),n.uniform1f(h.u_opacity,c),n.uniform1f(h.u_mix,u.t),t.spriteAtlas.bind(n,!0),t.tileExtentPatternVAO.bind(n,h,t.tileExtentBuffer)}else{if(t.isOpaquePass!==(1===l[3]))return;h=t.useProgram("fill"),n.uniform4fv(h.u_color,l),n.uniform1f(h.u_opacity,c),t.tileExtentVAO.bind(n,h,t.tileExtentBuffer)}n.disable(n.STENCIL_TEST);for(var p=o.coveringTiles(r),m=0;m<p.length;m++){var v=p[m],y=512;if(f&&d){var _=[f.size[0]*u.fromScale,f.size[1]*u.fromScale],g=[d.size[0]*u.toScale,d.size[1]*u.toScale],x={coord:v,tileSize:y};n.uniform2fv(h.u_patternscale_a,[1/s(x,_[0],t.transform.tileZoom),1/s(x,_[1],t.transform.tileZoom)]),n.uniform2fv(h.u_patternscale_b,[1/s(x,g[0],t.transform.tileZoom),1/s(x,g[1],t.transform.tileZoom)]);var b=y*Math.pow(2,t.transform.tileZoom-v.z),w=b/_[0]%1*(v.x+v.w*Math.pow(2,v.z)),M=b/_[1]%1*v.y,S=b/g[0]%1*(v.x+v.w*Math.pow(2,v.z)),E=b/g[1]%1*v.y;n.uniform2fv(h.u_offset_a,[w,M]),n.uniform2fv(h.u_offset_b,[S,E])}n.uniformMatrix4fv(h.u_matrix,!1,t.transform.calculatePosMatrix(v)),n.drawArrays(n.TRIANGLE_STRIP,0,t.tileExtentBuffer.length)}n.stencilMask(0),n.stencilFunc(n.EQUAL,128,128)}var r=t("../source/tile_pyramid"),o=new r({tileSize:512}),a=t("../util/util"),s=t("../source/pixels_to_tile_units");e.exports=n},{"../source/pixels_to_tile_units":85,"../source/tile_pyramid":90,"../util/util":157}],70:[function(t,e,i){"use strict";function n(t,e,i,n){if(!t.isOpaquePass){var o=t.gl;t.setDepthSublayer(0),t.depthMask(!1),o.disable(o.STENCIL_TEST);for(var a=0;a<n.length;a++){var s=n[a],l=e.getTile(s),u=l.getBucket(i);if(u){var c=u.bufferGroups.circle;if(c){var h=t.useProgram("circle",u.getProgramMacros("circle",i));o.uniform2fv(h.u_extrude_scale,t.transform.pixelsToGLUnits),o.uniform1f(h.u_blur,i.paint["circle-blur"]),o.uniform1f(h.u_devicepixelratio,r.devicePixelRatio),o.uniform1f(h.u_opacity,i.paint["circle-opacity"]),o.uniformMatrix4fv(h.u_matrix,!1,t.translatePosMatrix(s.posMatrix,l,i.paint["circle-translate"],i.paint["circle-translate-anchor"])),u.setUniforms(o,"circle",h,i,{zoom:t.transform.zoom});for(var f=0;f<c.length;f++){var d=c[f];d.vaos[i.id].bind(o,h,d.layout.vertex,d.layout.element,d.paint[i.id]),o.drawElements(o.TRIANGLES,3*d.layout.element.length,o.UNSIGNED_SHORT,0)}}}}}}var r=t("../util/browser");e.exports=n},{"../util/browser":143}],71:[function(t,e,i){"use strict";function n(t,e,i,n){var r=t.gl;r.enable(r.STENCIL_TEST);for(var o=t.useProgram("collisionbox"),a=0;a<n.length;a++){var s=n[a],l=e.getTile(s),u=l.getBucket(i);if(u){var c=u.bufferGroups.collisionBox;if(c&&c.length){var h=c[0];0!==h.layout.vertex.length&&(r.uniformMatrix4fv(o.u_matrix,!1,s.posMatrix),t.enableTileClippingMask(s),t.lineWidth(1),r.uniform1f(o.u_scale,Math.pow(2,t.transform.zoom-l.coord.z)),r.uniform1f(o.u_zoom,10*t.transform.zoom),r.uniform1f(o.u_maxzoom,10*(l.coord.z+1)),h.vaos[i.id].bind(r,o,h.layout.vertex),r.drawArrays(r.LINES,0,h.layout.vertex.length))}}}}e.exports=n},{}],72:[function(t,e,i){"use strict";function n(t,e,i){if(!t.isOpaquePass&&t.options.debug)for(var n=0;n<i.length;n++)r(t,e,i[n])}function r(t,e,i){var n=t.gl;n.disable(n.STENCIL_TEST),t.lineWidth(1*a.devicePixelRatio);var r=i.posMatrix,h=t.useProgram("debug");n.uniformMatrix4fv(h.u_matrix,!1,r),n.uniform4f(h.u_color,1,0,0,1),t.debugVAO.bind(n,h,t.debugBuffer),n.drawArrays(n.LINE_STRIP,0,t.debugBuffer.length);for(var f=o(i.toString(),50,200,5),d=new t.PosArray,p=0;p<f.length;p+=2)d.emplaceBack(f[p],f[p+1]);var m=new u(d.serialize(),t.PosArray.serialize(),u.BufferType.VERTEX),v=new c;v.bind(n,h,m),n.uniform4f(h.u_color,1,1,1,1);for(var y=e.getTile(i).tileSize,_=l/(Math.pow(2,t.transform.zoom-i.z)*y),g=[[-1,-1],[-1,1],[1,-1],[1,1]],x=0;x<g.length;x++){var b=g[x];n.uniformMatrix4fv(h.u_matrix,!1,s.translate([],r,[_*b[0],_*b[1],0])),n.drawArrays(n.LINES,0,m.length)}n.uniform4f(h.u_color,0,0,0,1),n.uniformMatrix4fv(h.u_matrix,!1,r),n.drawArrays(n.LINES,0,m.length)}var o=t("../lib/debugtext"),a=t("../util/browser"),s=t("gl-matrix").mat4,l=t("../data/bucket").EXTENT,u=t("../data/buffer"),c=t("./vertex_array_object");e.exports=n},{"../data/bucket":55,"../data/buffer":60,"../lib/debugtext":67,"../util/browser":143,"./vertex_array_object":81,"gl-matrix":12}],73:[function(t,e,i){"use strict";function n(t,e,i,n){var a=t.gl;a.enable(a.STENCIL_TEST);var l=s.premultiply(i.paint["fill-color"]),u=i.paint["fill-pattern"],c=s.premultiply(i.paint["fill-outline-color"]),h=i.paint["fill-opacity"];if(u?!t.isOpaquePass:t.isOpaquePass===(1===l[3]&&1===h))for(var f=0;f<n.length;f++)r(t,e,i,n[f]);if(!t.isOpaquePass&&i.paint["fill-antialias"])if(c||!i.paint["fill-pattern"]){var d=t.useProgram("outline");t.lineWidth(2),t.depthMask(!1),c?t.setDepthSublayer(2):t.setDepthSublayer(0),a.uniform2f(d.u_world,a.drawingBufferWidth,a.drawingBufferHeight),a.uniform4fv(d.u_color,c?c:l),a.uniform1f(d.u_opacity,h);for(var p=0;p<n.length;p++)o(t,e,i,n[p])}else{var m=t.useProgram("outlinepattern");t.lineWidth(2),t.depthMask(!1),t.setDepthSublayer(0),a.uniform2f(m.u_world,a.drawingBufferWidth,a.drawingBufferHeight);for(var v=0;v<n.length;v++)o(t,e,i,n[v])}}function r(t,e,i,n){var r=e.getTile(n),o=r.getBucket(i);if(o){var l=o.bufferGroups.fill;if(l){var u=t.gl,c=s.premultiply(i.paint["fill-color"]),h=i.paint["fill-pattern"],f=i.paint["fill-opacity"],d=n.posMatrix,p=t.translatePosMatrix(d,r,i.paint["fill-translate"],i.paint["fill-translate-anchor"]);t.setDepthSublayer(1),u.stencilMask(7),u.clear(u.STENCIL_BUFFER_BIT),t.enableTileClippingMask(n),u.stencilOpSeparate(u.FRONT,u.KEEP,u.KEEP,u.INCR_WRAP),u.stencilOpSeparate(u.BACK,u.KEEP,u.KEEP,u.DECR_WRAP),u.colorMask(!1,!1,!1,!1),t.depthMask(!1);var m=t.useProgram("fill");u.uniformMatrix4fv(m.u_matrix,!1,p);for(var v=0;v<l.length;v++){var y=l[v];y.vaos[i.id].bind(u,m,y.layout.vertex,y.layout.element),u.drawElements(u.TRIANGLES,3*y.layout.element.length,u.UNSIGNED_SHORT,0)}u.colorMask(!0,!0,!0,!0),t.depthMask(!0),u.stencilOp(u.KEEP,u.KEEP,u.KEEP),u.stencilMask(0);var _;h?(_=t.useProgram("pattern"),a(h,f,r,n,t,_),u.activeTexture(u.TEXTURE0),t.spriteAtlas.bind(u,!0),t.tileExtentPatternVAO.bind(u,_,t.tileExtentBuffer)):(_=t.useProgram("fill"),u.uniform4fv(m.u_color,c),u.uniform1f(m.u_opacity,f),t.tileExtentVAO.bind(u,_,t.tileExtentBuffer)),u.uniformMatrix4fv(_.u_matrix,!1,d),u.stencilFunc(u.NOTEQUAL,0,7),u.drawArrays(u.TRIANGLE_STRIP,0,t.tileExtentBuffer.length),u.stencilMask(0)}}}function o(t,e,i,n){var r=e.getTile(n),o=r.getBucket(i);if(o){var s=t.gl,l=o.bufferGroups.fill,u=i.paint["fill-pattern"],c=i.paint["fill-opacity"],h=u?t.useProgram("outlinepattern"):t.useProgram("outline");s.uniformMatrix4fv(h.u_matrix,!1,t.translatePosMatrix(n.posMatrix,r,i.paint["fill-translate"],i.paint["fill-translate-anchor"])),u&&a(u,c,r,n,t,h),t.enableTileClippingMask(n);for(var f=0;f<l.length;f++){var d=l[f];d.secondVaos[i.id].bind(s,h,d.layout.vertex,d.layout.element2),s.drawElements(s.LINES,2*d.layout.element2.length,s.UNSIGNED_SHORT,0)}}}function a(t,e,i,n,r,o){var a=r.gl,s=r.spriteAtlas.getPosition(t.from,!0),u=r.spriteAtlas.getPosition(t.to,!0);if(s&&u){a.uniform1i(o.u_image,0),a.uniform2fv(o.u_pattern_tl_a,s.tl),a.uniform2fv(o.u_pattern_br_a,s.br),a.uniform2fv(o.u_pattern_tl_b,u.tl),a.uniform2fv(o.u_pattern_br_b,u.br),a.uniform1f(o.u_opacity,e),a.uniform1f(o.u_mix,t.t);var c=[s.size[0]*t.fromScale,s.size[1]*t.fromScale],h=[u.size[0]*t.toScale,u.size[1]*t.toScale];a.uniform2fv(o.u_patternscale_a,[1/l(i,c[0],r.transform.tileZoom),1/l(i,c[1],r.transform.tileZoom)]),a.uniform2fv(o.u_patternscale_b,[1/l(i,h[0],r.transform.tileZoom),1/l(i,h[1],r.transform.tileZoom)]);var f=i.tileSize*Math.pow(2,r.transform.tileZoom-i.coord.z),d=f/c[0]%1*(i.coord.x+n.w*Math.pow(2,i.coord.z)),p=f/c[1]%1*i.coord.y,m=f/h[0]%1*(i.coord.x+n.w*Math.pow(2,i.coord.z)),v=f/h[1]%1*i.coord.y;a.uniform2fv(o.u_offset_a,[d,p]),a.uniform2fv(o.u_offset_b,[m,v]),a.activeTexture(a.TEXTURE0),r.spriteAtlas.bind(a,!0)}}var s=t("../util/util"),l=t("../source/pixels_to_tile_units");e.exports=n},{"../source/pixels_to_tile_units":85,"../util/util":157}],74:[function(t,e,i){"use strict";var n=t("../util/browser"),r=t("gl-matrix").mat2,o=t("../util/util"),a=t("../source/pixels_to_tile_units");e.exports=function s(t,e,i,l){if(!t.isOpaquePass){t.setDepthSublayer(0),t.depthMask(!1);var u=t.gl;if(u.enable(u.STENCIL_TEST),!(i.paint["line-width"]<=0)){var c=1/n.devicePixelRatio,h=i.paint["line-blur"]+c,f=i.paint["line-width"]/2,d=-1,p=0,m=0;i.paint["line-gap-width"]>0&&(d=i.paint["line-gap-width"]/2+.5*c,f=i.paint["line-width"],p=d-c/2);var v=p+f+c/2+m,y=o.premultiply(i.paint["line-color"]),_=t.transform,g=r.create();r.scale(g,g,[1,Math.cos(_._pitch)]),r.rotate(g,g,t.transform.angle);var x=Math.sqrt(_.height*_.height/4*(1+_.altitude*_.altitude)),b=_.height/2*Math.tan(_._pitch),w=(x+b)/x-1,M=i.paint["line-dasharray"],S=i.paint["line-pattern"],E,T,I,D,z;if(M)E=t.useProgram("linesdfpattern"),u.uniform2fv(E.u_linewidth,[v,d]),u.uniform1f(E.u_blur,h),u.uniform4fv(E.u_color,y),u.uniform1f(E.u_opacity,i.paint["line-opacity"]),T=t.lineAtlas.getDash(M.from,"round"===i.layout["line-cap"]),I=t.lineAtlas.getDash(M.to,"round"===i.layout["line-cap"]),u.uniform1i(E.u_image,0),u.activeTexture(u.TEXTURE0),t.lineAtlas.bind(u),u.uniform1f(E.u_tex_y_a,T.y),u.uniform1f(E.u_tex_y_b,I.y),u.uniform1f(E.u_mix,M.t),u.uniform1f(E.u_extra,w),u.uniform1f(E.u_offset,-i.paint["line-offset"]),u.uniformMatrix2fv(E.u_antialiasingmatrix,!1,g);else if(S){if(D=t.spriteAtlas.getPosition(S.from,!0),z=t.spriteAtlas.getPosition(S.to,!0),!D||!z)return;E=t.useProgram("linepattern"),u.uniform1i(E.u_image,0),u.activeTexture(u.TEXTURE0),t.spriteAtlas.bind(u,!0),u.uniform2fv(E.u_linewidth,[v,d]),u.uniform1f(E.u_blur,h),u.uniform2fv(E.u_pattern_tl_a,D.tl),u.uniform2fv(E.u_pattern_br_a,D.br),u.uniform2fv(E.u_pattern_tl_b,z.tl),u.uniform2fv(E.u_pattern_br_b,z.br),u.uniform1f(E.u_fade,S.t),u.uniform1f(E.u_opacity,i.paint["line-opacity"]),u.uniform1f(E.u_extra,w),u.uniform1f(E.u_offset,-i.paint["line-offset"]),u.uniformMatrix2fv(E.u_antialiasingmatrix,!1,g)}else E=t.useProgram("line"),u.uniform2fv(E.u_linewidth,[v,d]),u.uniform1f(E.u_blur,h),u.uniform1f(E.u_extra,w),u.uniform1f(E.u_offset,-i.paint["line-offset"]),u.uniformMatrix2fv(E.u_antialiasingmatrix,!1,g),u.uniform4fv(E.u_color,y),u.uniform1f(E.u_opacity,i.paint["line-opacity"]);for(var P=0;P<l.length;P++){var L=l[P],F=e.getTile(L),A=F.getBucket(i);if(A){var k=A.bufferGroups.line;if(k){t.enableTileClippingMask(L);var R=t.translatePosMatrix(L.posMatrix,F,i.paint["line-translate"],i.paint["line-translate-anchor"]);u.uniformMatrix4fv(E.u_matrix,!1,R);var C=1/a(F,1,t.transform.zoom);if(M){var O=T.width*M.fromScale,j=I.width*M.toScale,B=[1/a(F,O,t.transform.tileZoom),-T.height/2],N=[1/a(F,j,t.transform.tileZoom),-I.height/2],q=t.lineAtlas.width/(256*Math.min(O,j)*n.devicePixelRatio)/2;u.uniform1f(E.u_ratio,C),u.uniform2fv(E.u_patternscale_a,B),u.uniform2fv(E.u_patternscale_b,N),u.uniform1f(E.u_sdfgamma,q)}else S?(u.uniform1f(E.u_ratio,C),u.uniform2fv(E.u_pattern_size_a,[a(F,D.size[0]*S.fromScale,t.transform.tileZoom),z.size[1]]),u.uniform2fv(E.u_pattern_size_b,[a(F,z.size[0]*S.toScale,t.transform.tileZoom),z.size[1]])):u.uniform1f(E.u_ratio,C);for(var U=0;U<k.length;U++){var V=k[U];V.vaos[i.id].bind(u,E,V.layout.vertex,V.layout.element),u.drawElements(u.TRIANGLES,3*V.layout.element.length,u.UNSIGNED_SHORT,0)}}}}}}}},{"../source/pixels_to_tile_units":85,"../util/browser":143,"../util/util":157,"gl-matrix":12}],75:[function(t,e,i){"use strict";function n(t,e,i,n){if(!t.isOpaquePass){var o=t.gl;o.enable(o.DEPTH_TEST),t.depthMask(!0),o.depthFunc(o.LESS);for(var a=n.length&&n[0].z,s=0;s<n.length;s++){var l=n[s];t.setDepthSublayer(l.z-a),r(t,e,i,l)}o.depthFunc(o.LEQUAL)}}function r(t,e,i,n){var r=t.gl;r.disable(r.STENCIL_TEST);var u=e.getTile(n),c=t.transform.calculatePosMatrix(n,e.maxzoom),h=t.useProgram("raster");r.uniformMatrix4fv(h.u_matrix,!1,c),r.uniform1f(h.u_brightness_low,i.paint["raster-brightness-min"]),r.uniform1f(h.u_brightness_high,i.paint["raster-brightness-max"]),r.uniform1f(h.u_saturation_factor,s(i.paint["raster-saturation"])),r.uniform1f(h.u_contrast_factor,a(i.paint["raster-contrast"])),r.uniform3fv(h.u_spin_weights,o(i.paint["raster-hue-rotate"]));
var f=u.source&&u.source._pyramid.findLoadedParent(n,0,{}),d=l(u,f,i,t.transform),p,m;r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,u.texture),f?(r.activeTexture(r.TEXTURE1),r.bindTexture(r.TEXTURE_2D,f.texture),p=Math.pow(2,f.coord.z-u.coord.z),m=[u.coord.x*p%1,u.coord.y*p%1]):d[1]=0,r.uniform2fv(h.u_tl_parent,m||[0,0]),r.uniform1f(h.u_scale_parent,p||1),r.uniform1f(h.u_buffer_scale,1),r.uniform1f(h.u_opacity0,d[0]),r.uniform1f(h.u_opacity1,d[1]),r.uniform1i(h.u_image0,0),r.uniform1i(h.u_image1,1);var v=u.boundsBuffer||t.rasterBoundsBuffer,y=u.boundsVAO||t.rasterBoundsVAO;y.bind(r,h,v),r.drawArrays(r.TRIANGLE_STRIP,0,v.length)}function o(t){t*=Math.PI/180;var e=Math.sin(t),i=Math.cos(t);return[(2*i+1)/3,(-Math.sqrt(3)*e-i+1)/3,(Math.sqrt(3)*e-i+1)/3]}function a(t){return t>0?1/(1-t):1+t}function s(t){return t>0?1-1/(1.001-t):-t}function l(t,e,i,n){var r=[1,0],o=i.paint["raster-fade-duration"];if(t.source&&o>0){var a=(new Date).getTime(),s=(a-t.timeAdded)/o,l=e?(a-e.timeAdded)/o:-1,c=t.source._pyramid.coveringZoomLevel(n),h=e?Math.abs(e.coord.z-c)>Math.abs(t.coord.z-c):!1;!e||h?(r[0]=u.clamp(s,0,1),r[1]=1-r[0]):(r[0]=u.clamp(1-l,0,1),r[1]=1-r[0])}var f=i.paint["raster-opacity"];return r[0]*=f,r[1]*=f,r}var u=t("../util/util"),c=t("../util/struct_array");e.exports=n,n.RasterBoundsArray=new c({members:[{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]})},{"../util/struct_array":155,"../util/util":157}],76:[function(t,e,i){"use strict";function n(t,e,i,n){if(!t.isOpaquePass){var o=!(i.layout["text-allow-overlap"]||i.layout["icon-allow-overlap"]||i.layout["text-ignore-placement"]||i.layout["icon-ignore-placement"]),a=t.gl;o?a.disable(a.STENCIL_TEST):a.enable(a.STENCIL_TEST),t.setDepthSublayer(0),t.depthMask(!1),a.disable(a.DEPTH_TEST),r(t,e,i,n,!1,i.paint["icon-translate"],i.paint["icon-translate-anchor"],i.layout["icon-rotation-alignment"],i.layout["icon-size"],i.paint["icon-halo-width"],i.paint["icon-halo-color"],i.paint["icon-halo-blur"],i.paint["icon-opacity"],i.paint["icon-color"]),r(t,e,i,n,!0,i.paint["text-translate"],i.paint["text-translate-anchor"],i.layout["text-rotation-alignment"],i.layout["text-size"],i.paint["text-halo-width"],i.paint["text-halo-color"],i.paint["text-halo-blur"],i.paint["text-opacity"],i.paint["text-color"]),a.enable(a.DEPTH_TEST),s(t,e,i,n)}}function r(t,e,i,n,r,a,s,u,c,h,f,d,p,m){f=l.premultiply(f),m=l.premultiply(m);for(var v=0;v<n.length;v++){var y=e.getTile(n[v]),_=y.getBucket(i);if(_){var g=_.bufferGroups,x=r?g.glyph:g.icon;x.length&&(t.enableTileClippingMask(n[v]),o(t,i,n[v].posMatrix,y,_,x,r,r||_.sdfIcons,!r&&_.iconsNeedLinear,r?_.adjustedTextSize:_.adjustedIconSize,_.fontstack,a,s,u,c,h,f,d,p,m))}}}function o(t,e,i,n,r,o,s,l,c,h,f,d,p,m,v,y,_,g,x,b){var w=t.gl,M=t.transform,S="map"===m,E=s?24:1,T=v/E,I,D,z;S?(D=u(n,1,t.transform.zoom)*T,z=1/Math.cos(M._pitch),I=[D,D]):(D=t.transform.altitude*T,z=1,I=[M.pixelsToGLUnits[0]*D,M.pixelsToGLUnits[1]*D]);var P=Math.sqrt(M.height*M.height/4*(1+M.altitude*M.altitude)),L=M.height/2*Math.tan(M._pitch),F=(P+L)/P-1;if(s||t.style.sprite.loaded()){var A=t.useProgram(l?"sdf":"icon");if(w.uniformMatrix4fv(A.u_matrix,!1,t.translatePosMatrix(i,n,d,p)),w.uniform1i(A.u_skewed,S),w.uniform1f(A.u_extra,F),w.uniform2fv(A.u_extrude_scale,I),w.activeTexture(w.TEXTURE0),w.uniform1i(A.u_texture,0),s){var k=f&&t.glyphSource.getGlyphAtlas(f);if(!k)return;k.updateTexture(w),w.uniform2f(A.u_texsize,k.width/4,k.height/4)}else{var R=t.options.rotating||t.options.zooming,C=1!==T||a.devicePixelRatio!==t.spriteAtlas.pixelRatio||c,O=S||t.transform.pitch;t.spriteAtlas.bind(w,l||R||C||O),w.uniform2f(A.u_texsize,t.spriteAtlas.width/4,t.spriteAtlas.height/4)}var j=Math.log(v/h)/Math.LN2||0;w.uniform1f(A.u_zoom,10*(t.transform.zoom-j)),w.activeTexture(w.TEXTURE1),t.frameHistory.bind(w),w.uniform1i(A.u_fadetexture,1);var B;if(l){var N=8,q=1.19,U=6,V=.105*E/v/a.devicePixelRatio;if(y){w.uniform1f(A.u_gamma,(g*q/T/N+V)*z),w.uniform4fv(A.u_color,_),w.uniform1f(A.u_opacity,x),w.uniform1f(A.u_buffer,(U-y/T)/N);for(var Z=0;Z<o.length;Z++)B=o[Z],B.vaos[e.id].bind(w,A,B.layout.vertex,B.layout.element),w.drawElements(w.TRIANGLES,3*B.layout.element.length,w.UNSIGNED_SHORT,0)}w.uniform1f(A.u_gamma,V*z),w.uniform4fv(A.u_color,b),w.uniform1f(A.u_opacity,x),w.uniform1f(A.u_buffer,.75);for(var G=0;G<o.length;G++)B=o[G],B.vaos[e.id].bind(w,A,B.layout.vertex,B.layout.element),w.drawElements(w.TRIANGLES,3*B.layout.element.length,w.UNSIGNED_SHORT,0)}else{w.uniform1f(A.u_opacity,x);for(var X=0;X<o.length;X++)B=o[X],B.vaos[e.id].bind(w,A,B.layout.vertex,B.layout.element),w.drawElements(w.TRIANGLES,3*B.layout.element.length,w.UNSIGNED_SHORT,0)}}}var a=t("../util/browser"),s=t("./draw_collision_debug"),l=t("../util/util"),u=t("../source/pixels_to_tile_units");e.exports=n},{"../source/pixels_to_tile_units":85,"../util/browser":143,"../util/util":157,"./draw_collision_debug":71}],77:[function(t,e,i){"use strict";function n(){this.changeTimes=new Float64Array(256),this.changeOpacities=new Uint8Array(256),this.opacities=new Uint8ClampedArray(256),this.array=new Uint8Array(this.opacities.buffer),this.fadeDuration=300,this.previousZoom=0,this.firstFrame=!0}e.exports=n,n.prototype.record=function(t){var e=Date.now();this.firstFrame&&(e=0,this.firstFrame=!1),t=Math.floor(10*t);var i;if(t<this.previousZoom)for(i=t+1;i<=this.previousZoom;i++)this.changeTimes[i]=e,this.changeOpacities[i]=this.opacities[i];else for(i=t;i>this.previousZoom;i--)this.changeTimes[i]=e,this.changeOpacities[i]=this.opacities[i];for(i=0;256>i;i++){var n=e-this.changeTimes[i],r=n/this.fadeDuration*255;t>=i?this.opacities[i]=this.changeOpacities[i]+r:this.opacities[i]=this.changeOpacities[i]-r}this.changed=!0,this.previousZoom=t},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))}},{}],78:[function(t,e,i){"use strict";function n(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={}}e.exports=n,n.prototype.setSprite=function(t){this.sprite=t},n.prototype.getDash=function(t,e){var i=t.join(",")+e;return this.positions[i]||(this.positions[i]=this.addDash(t,e)),this.positions[i]},n.prototype.addDash=function(t,e){var i=e?7:0,n=2*i+1,r=128;if(this.nextRow+n>this.height)return console.warn("LineAtlas out of space"),null;for(var o=0,a=0;a<t.length;a++)o+=t[a];for(var s=this.width/o,l=s/2,u=t.length%2===1,c=-i;i>=c;c++)for(var h=this.nextRow+i+c,f=this.width*h,d=u?-t[t.length-1]:0,p=t[0],m=1,v=0;v<this.width;v++){for(;v/s>p;)d=p,p+=t[m],u&&m===t.length-1&&(p+=t[0]),m++;var y=Math.abs(v-d*s),_=Math.abs(v-p*s),g=Math.min(y,_),x=m%2===1,b;if(e){var w=i?c/i*(l+1):0;if(x){var M=l-Math.abs(w);b=Math.sqrt(g*g+M*M)}else b=l-Math.sqrt(g*g+w*w)}else b=(x?1:-1)*g;this.data[3+4*(f+v)]=Math.max(0,Math.min(255,b+r))}var S={y:(this.nextRow+i+.5)/this.height,height:2*i/this.height,width:o};return this.nextRow+=n,this.dirty=!0,S},n.prototype.bind=function(t){this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width,this.height,t.RGBA,t.UNSIGNED_BYTE,this.data))):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width,this.height,0,t.RGBA,t.UNSIGNED_BYTE,this.data))}},{}],79:[function(t,e,i){"use strict";function n(t,e){this.gl=t,this.transform=e,this.reusableTextures={},this.preFbos={},this.frameHistory=new a,this.setup(),this.numSublayers=s.maxUnderzooming+s.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.lineWidthRange=t.getParameter(t.ALIASED_LINE_WIDTH_RANGE)}var r=t("../util/browser"),o=t("gl-matrix").mat4,a=t("./frame_history"),s=t("../source/tile_pyramid"),l=t("../data/bucket").EXTENT,u=t("../source/pixels_to_tile_units"),c=t("../util/util"),h=t("../util/struct_array"),f=t("../data/buffer"),d=t("./vertex_array_object"),p=t("./draw_raster").RasterBoundsArray;e.exports=n,c.extend(n.prototype,t("./painter/use_program")),n.prototype.resize=function(t,e){var i=this.gl;this.width=t*r.devicePixelRatio,this.height=e*r.devicePixelRatio,i.viewport(0,0,this.width,this.height)},n.prototype.setup=function(){var t=this.gl;t.verbose=!0,t.enable(t.BLEND),t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA),t.enable(t.STENCIL_TEST),t.enable(t.DEPTH_TEST),t.depthFunc(t.LEQUAL),this._depthMask=!1,t.depthMask(!1);var e=this.PosArray=new h({members:[{name:"a_pos",type:"Int16",components:2}]}),i=new e;i.emplaceBack(0,0),i.emplaceBack(l,0),i.emplaceBack(0,l),i.emplaceBack(l,l),this.tileExtentBuffer=new f(i.serialize(),e.serialize(),f.BufferType.VERTEX),this.tileExtentVAO=new d,this.tileExtentPatternVAO=new d;var n=new e;n.emplaceBack(0,0),n.emplaceBack(l,0),n.emplaceBack(l,l),n.emplaceBack(0,l),n.emplaceBack(0,0),this.debugBuffer=new f(n.serialize(),e.serialize(),f.BufferType.VERTEX),this.debugVAO=new d;var r=new p;r.emplaceBack(0,0,0,0),r.emplaceBack(l,0,32767,0),r.emplaceBack(0,l,0,32767),r.emplaceBack(l,l,32767,32767),this.rasterBoundsBuffer=new f(r.serialize(),p.serialize(),f.BufferType.VERTEX),this.rasterBoundsVAO=new d},n.prototype.clearColor=function(){var t=this.gl;t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT)},n.prototype.clearStencil=function(){var t=this.gl;t.clearStencil(0),t.stencilMask(255),t.clear(t.STENCIL_BUFFER_BIT)},n.prototype.clearDepth=function(){var t=this.gl;t.clearDepth(1),this.depthMask(!0),t.clear(t.DEPTH_BUFFER_BIT)},n.prototype._renderTileClippingMasks=function(t){var e=this.gl;e.colorMask(!1,!1,!1,!1),this.depthMask(!1),e.disable(e.DEPTH_TEST),e.enable(e.STENCIL_TEST),e.stencilMask(248),e.stencilOp(e.KEEP,e.KEEP,e.REPLACE);var i=1;this._tileClippingMaskIDs={};for(var n=0;n<t.length;n++){var r=t[n],o=this._tileClippingMaskIDs[r.id]=i++<<3;e.stencilFunc(e.ALWAYS,o,248);var a=this.useProgram("fill");e.uniformMatrix4fv(a.u_matrix,!1,r.posMatrix),this.tileExtentVAO.bind(e,a,this.tileExtentBuffer),e.drawArrays(e.TRIANGLE_STRIP,0,this.tileExtentBuffer.length)}e.stencilMask(0),e.colorMask(!0,!0,!0,!0),this.depthMask(!0),e.enable(e.DEPTH_TEST)},n.prototype.enableTileClippingMask=function(t){var e=this.gl;e.stencilFunc(e.EQUAL,this._tileClippingMaskIDs[t.id],248)},n.prototype.prepareBuffers=function(){},n.prototype.bindDefaultFramebuffer=function(){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,null)};var m={symbol:t("./draw_symbol"),circle:t("./draw_circle"),line:t("./draw_line"),fill:t("./draw_fill"),raster:t("./draw_raster"),background:t("./draw_background"),debug:t("./draw_debug")};n.prototype.render=function(t,e){this.style=t,this.options=e,this.lineAtlas=t.lineAtlas,this.spriteAtlas=t.spriteAtlas,this.spriteAtlas.setSprite(t.sprite),this.glyphSource=t.glyphSource,this.frameHistory.record(this.transform.zoom),this.prepareBuffers(),this.clearColor(),this.clearDepth(),this.showOverdrawInspector(e.showOverdrawInspector),this.depthRange=(t._order.length+2)*this.numSublayers*this.depthEpsilon,this.renderPass({isOpaquePass:!0}),this.renderPass({isOpaquePass:!1})},n.prototype.renderPass=function(t){var e=this.style._groups,i=t.isOpaquePass;this.currentLayer=i?this.style._order.length:-1;for(var n=0;n<e.length;n++){var r=e[i?e.length-1-n:n],o=this.style.sources[r.source],a,s=[];if(o){for(s=o.getVisibleCoordinates(),a=0;a<s.length;a++)s[a].posMatrix=this.transform.calculatePosMatrix(s[a],o.maxzoom);this.clearStencil(),o.prepare&&o.prepare(),o.isTileClipped&&this._renderTileClippingMasks(s)}for(i?(this._showOverdrawInspector||this.gl.disable(this.gl.BLEND),this.isOpaquePass=!0):(this.gl.enable(this.gl.BLEND),this.isOpaquePass=!1,s.reverse()),a=0;a<r.length;a++){var l=r[i?r.length-1-a:a];this.currentLayer+=i?-1:1,this.renderLayer(this,o,l,s)}o&&m.debug(this,o,s)}},n.prototype.depthMask=function(t){t!==this._depthMask&&(this._depthMask=t,this.gl.depthMask(t))},n.prototype.renderLayer=function(t,e,i,n){i.isHidden(this.transform.zoom)||("background"===i.type||n.length)&&(this.id=i.id,m[i.type](t,e,i,n))},n.prototype.setDepthSublayer=function(t){var e=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon,i=e-1+this.depthRange;this.gl.depthRange(i,e)},n.prototype.translatePosMatrix=function(t,e,i,n){if(!i[0]&&!i[1])return t;if("viewport"===n){var r=Math.sin(-this.transform.angle),a=Math.cos(-this.transform.angle);i=[i[0]*a-i[1]*r,i[0]*r+i[1]*a]}var s=[u(e,i[0],this.transform.zoom),u(e,i[1],this.transform.zoom),0],l=new Float32Array(16);return o.translate(l,t,s),l},n.prototype.saveTexture=function(t){var e=this.reusableTextures[t.size];e?e.push(t):this.reusableTextures[t.size]=[t]},n.prototype.getTexture=function(t){var e=this.reusableTextures[t];return e&&e.length>0?e.pop():null},n.prototype.lineWidth=function(t){this.gl.lineWidth(c.clamp(t,this.lineWidthRange[0],this.lineWidthRange[1]))},n.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 i=8,n=1/i;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)}}},{"../data/bucket":55,"../data/buffer":60,"../source/pixels_to_tile_units":85,"../source/tile_pyramid":90,"../util/browser":143,"../util/struct_array":155,"../util/util":157,"./draw_background":69,"./draw_circle":70,"./draw_debug":72,"./draw_fill":73,"./draw_line":74,"./draw_raster":75,"./draw_symbol":76,"./frame_history":77,"./painter/use_program":80,"./vertex_array_object":81,"gl-matrix":12}],80:[function(t,e,i){"use strict";var n=t("path"),r=t("assert"),o=t("../../util/util"),a={debug:{fragmentSource:"precision mediump float;\n\nuniform lowp vec4 u_color;\n\nvoid main() {\n gl_FragColor = u_color;\n}\n",vertexSource:"precision highp float;\n\nattribute 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:"precision mediump float;\n\nuniform lowp vec4 u_color;\nuniform lowp float u_opacity;\n\nvoid main() {\n gl_FragColor = u_color * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"precision highp float;\n\nattribute vec2 a_pos;\nuniform mat4 u_matrix;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n"},circle:{fragmentSource:"precision mediump float;\n\nuniform lowp float u_blur;\nuniform lowp float u_opacity;\n\nvarying lowp vec4 v_color;\nvarying vec2 v_extrude;\nvarying lowp float v_antialiasblur;\n\nvoid main() {\n float t = smoothstep(1.0 - max(u_blur, v_antialiasblur), 1.0, length(v_extrude));\n gl_FragColor = v_color * (1.0 - t) * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"precision highp float;\n\nuniform mat4 u_matrix;\nuniform vec2 u_extrude_scale;\nuniform float u_devicepixelratio;\n\nattribute vec2 a_pos;\n\n#ifdef ATTRIBUTE_A_COLOR\nattribute lowp vec4 a_color;\n#elif defined ATTRIBUTE_ZOOM_FUNCTION_A_COLOR0\nuniform lowp float u_color_t;\nattribute lowp vec4 a_color0;\nattribute lowp vec4 a_color1;\nattribute lowp vec4 a_color2;\nattribute lowp vec4 a_color3;\n#else\nuniform lowp vec4 a_color;\n#endif\n\n#ifdef ATTRIBUTE_A_RADIUS\nattribute mediump float a_radius;\n#elif defined ATTRIBUTE_ZOOM_FUNCTION_A_RADIUS\nuniform lowp float u_radius_t;\nattribute mediump vec4 a_radius;\n#else\nuniform mediump float a_radius;\n#endif\n\nvarying vec2 v_extrude;\nvarying lowp vec4 v_color;\nvarying lowp float v_antialiasblur;\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}\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\nvoid main(void) {\n\n#ifdef ATTRIBUTE_A_RADIUS\n mediump float radius = a_radius / 10.0;\n#elif defined ATTRIBUTE_ZOOM_FUNCTION_A_RADIUS\n mediump float radius = evaluate_zoom_function_1(a_radius, u_radius_t) / 10.0;\n#else\n mediump float radius = a_radius;\n#endif\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 * 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 // gl_Position is divided by gl_Position.w after this shader runs.\n // Multiply the extrude by it so that it isn't affected by it.\n gl_Position.xy += extrude * gl_Position.w;\n\n#ifdef ATTRIBUTE_A_COLOR\n v_color = a_color / 255.0;\n#elif defined ATTRIBUTE_ZOOM_FUNCTION_A_COLOR0\n v_color = evaluate_zoom_function_4(a_color0, a_color1, a_color2, a_color3, u_color_t) / 255.0;\n#else\n v_color = a_color;\n#endif\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 / u_devicepixelratio / radius;\n}\n"},line:{fragmentSource:"precision mediump float;\n\nuniform vec2 u_linewidth;\nuniform lowp vec4 u_color;\nuniform lowp float u_opacity;\nuniform float u_blur;\n\nvarying vec2 v_normal;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\nvoid main() {\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * u_linewidth.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_linewidth.t) or when fading out\n // (v_linewidth.s)\n float blur = u_blur * v_gamma_scale;\n float alpha = clamp(min(dist - (u_linewidth.t - blur), u_linewidth.s - dist) / blur, 0.0, 1.0);\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:"precision highp float;\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 float u_ratio;\nuniform mediump vec2 u_linewidth;\nuniform float u_extra;\nuniform mat2 u_antialiasingmatrix;\nuniform mediump float u_offset;\n\nvarying vec2 v_normal;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\nvoid main() {\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n\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 // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec4 dist = vec4(u_linewidth.s * a_extrude * scale, 0.0, 0.0);\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit of the position before scaling it with the\n // model/view matrix.\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist.xy) / u_ratio, 0.0, 1.0);\n\n // position of y on the screen\n float y = gl_Position.y / gl_Position.w;\n\n // how much features are squished in the y direction by the tilt\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\n\n // how much features are squished in all directions by the perspectiveness\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\n\n v_gamma_scale = perspective_scale * squish_scale;\n}\n"},linepattern:{fragmentSource:"precision mediump float;\n\nuniform vec2 u_linewidth;\nuniform float u_point;\nuniform float u_blur;\n\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_fade;\nuniform float u_opacity;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_normal;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\nvoid main() {\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * u_linewidth.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_linewidth.t) or when fading out\n // (v_linewidth.s)\n float blur = u_blur * v_gamma_scale;\n float alpha = clamp(min(dist - (u_linewidth.t - blur), u_linewidth.s - dist) / blur, 0.0, 1.0);\n\n float x_a = mod(v_linesofar / u_pattern_size_a.x, 1.0);\n float x_b = mod(v_linesofar / u_pattern_size_b.x, 1.0);\n float y_a = 0.5 + (v_normal.y * u_linewidth.s / u_pattern_size_a.y);\n float y_b = 0.5 + (v_normal.y * u_linewidth.s / u_pattern_size_b.y);\n vec2 pos = mix(u_pattern_tl_a, u_pattern_br_a, vec2(x_a, y_a));\n vec2 pos2 = mix(u_pattern_tl_b, u_pattern_br_b, vec2(x_b, y_b));\n\n vec4 color = mix(texture2D(u_image, pos), texture2D(u_image, pos2), u_fade);\n\n alpha *= u_opacity;\n\n gl_FragColor = color * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"precision highp float;\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform mediump vec2 u_linewidth;\nuniform float u_extra;\nuniform mat2 u_antialiasingmatrix;\nuniform mediump float u_offset;\n\nvarying vec2 v_normal;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\nvoid main() {\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n // We store the texture normals in the most insignificant bit\n // transform y so that 0 => -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 extrude = a_extrude * scale;\n mediump vec2 dist = u_linewidth.s * extrude;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit of the position before scaling it with the\n // model/view matrix.\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist.xy) / u_ratio, 0.0, 1.0);\n v_linesofar = a_linesofar;\n\n // position of y on the screen\n float y = gl_Position.y / gl_Position.w;\n\n // how much features are squished in the y direction by the tilt\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\n\n // how much features are squished in all directions by the perspectiveness\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\n\n v_gamma_scale = perspective_scale * squish_scale;\n}\n"},linesdfpattern:{fragmentSource:"precision mediump float;\n\nuniform vec2 u_linewidth;\nuniform lowp vec4 u_color;\nuniform lowp float u_opacity;\nuniform float u_blur;\nuniform sampler2D u_image;\nuniform float u_sdfgamma;\nuniform float u_mix;\n\nvarying vec2 v_normal;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\nvoid main() {\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * u_linewidth.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_linewidth.t) or when fading out\n // (v_linewidth.s)\n float blur = u_blur * v_gamma_scale;\n float alpha = clamp(min(dist - (u_linewidth.t - blur), u_linewidth.s - dist) / blur, 0.0, 1.0);\n\n float sdfdist_a = texture2D(u_image, v_tex_a).a;\n float sdfdist_b = texture2D(u_image, v_tex_b).a;\n float sdfdist = mix(sdfdist_a, sdfdist_b, u_mix);\n alpha *= smoothstep(0.5 - u_sdfgamma, 0.5 + u_sdfgamma, sdfdist);\n\n gl_FragColor = u_color * (alpha * u_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"precision highp float;\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump vec2 u_linewidth;\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 float u_extra;\nuniform mat2 u_antialiasingmatrix;\nuniform mediump float u_offset;\n\nvarying vec2 v_normal;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\nvoid main() {\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n // We store the texture normals in the most insignificant bit\n // transform y so that 0 => -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec4 dist = vec4(u_linewidth.s * a_extrude * scale, 0.0, 0.0);\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit of the position before scaling it with the\n // model/view matrix.\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist.xy) / u_ratio, 0.0, 1.0);\n\n v_tex_a = vec2(a_linesofar * u_patternscale_a.x, normal.y * u_patternscale_a.y + u_tex_y_a);\n v_tex_b = vec2(a_linesofar * u_patternscale_b.x, normal.y * u_patternscale_b.y + u_tex_y_b);\n\n // position of y on the screen\n float y = gl_Position.y / gl_Position.w;\n\n // how much features are squished in the y direction by the tilt\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\n\n // how much features are squished in all directions by the perspectiveness\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\n\n v_gamma_scale = perspective_scale * squish_scale;\n}\n"},outline:{fragmentSource:"precision mediump float;\n\nuniform lowp vec4 u_color;\nuniform lowp float u_opacity;\n\nvarying vec2 v_pos;\n\nvoid main() {\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = smoothstep(1.0, 0.0, dist);\n gl_FragColor = u_color * (alpha * u_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"precision highp float;\n\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos = (gl_Position.xy/gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},outlinepattern:{fragmentSource:"precision mediump float;\n\nuniform float u_opacity;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\nvoid main() {\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a, u_pattern_br_a, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b, u_pattern_br_b, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n // find distance to outline for alpha interpolation\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = smoothstep(1.0, 0.0, dist);\n \n\n gl_FragColor = mix(color1, color2, u_mix) * alpha * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"precision highp float;\n\nuniform vec2 u_patternscale_a;\nuniform vec2 u_patternscale_b;\nuniform vec2 u_offset_a;\nuniform vec2 u_offset_b;\n\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos_a = u_patternscale_a * a_pos + u_offset_a;\n v_pos_b = u_patternscale_b * a_pos + u_offset_b;\n v_pos = (gl_Position.xy/gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"
},pattern:{fragmentSource:"precision mediump float;\n\nuniform float u_opacity;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\nvoid main() {\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a, u_pattern_br_a, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b, u_pattern_br_b, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n gl_FragColor = mix(color1, color2, u_mix) * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"precision highp float;\n\nuniform mat4 u_matrix;\nuniform vec2 u_patternscale_a;\nuniform vec2 u_patternscale_b;\nuniform vec2 u_offset_a;\nuniform vec2 u_offset_b;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos_a = u_patternscale_a * a_pos + u_offset_a;\n v_pos_b = u_patternscale_b * a_pos + u_offset_b;\n}\n"},raster:{fragmentSource:"precision mediump float;\n\nuniform float u_opacity0;\nuniform float u_opacity1;\nuniform sampler2D u_image0;\nuniform sampler2D u_image1;\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nuniform float u_brightness_low;\nuniform float u_brightness_high;\n\nuniform float u_saturation_factor;\nuniform float u_contrast_factor;\nuniform vec3 u_spin_weights;\n\nvoid main() {\n\n // read and cross-fade colors from the main and parent tiles\n vec4 color0 = texture2D(u_image0, v_pos0);\n vec4 color1 = texture2D(u_image1, v_pos1);\n vec4 color = color0 * u_opacity0 + color1 * u_opacity1;\n vec3 rgb = color.rgb;\n\n // spin\n rgb = vec3(\n dot(rgb, u_spin_weights.xyz),\n dot(rgb, u_spin_weights.zxy),\n dot(rgb, u_spin_weights.yzx));\n\n // saturation\n float average = (color.r + color.g + color.b) / 3.0;\n rgb += (average - rgb) * u_saturation_factor;\n\n // contrast\n rgb = (rgb - 0.5) * u_contrast_factor + 0.5;\n\n // brightness\n vec3 u_high_vec = vec3(u_brightness_low, u_brightness_low, u_brightness_low);\n vec3 u_low_vec = vec3(u_brightness_high, u_brightness_high, u_brightness_high);\n\n gl_FragColor = vec4(mix(u_high_vec, u_low_vec, rgb), color.a);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"precision highp float;\n\nuniform mat4 u_matrix;\nuniform vec2 u_tl_parent;\nuniform float u_scale_parent;\nuniform float u_buffer_scale;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos0 = (((a_texture_pos / 32767.0) - 0.5) / u_buffer_scale ) + 0.5;\n v_pos1 = (v_pos0 * u_scale_parent) + u_tl_parent;\n}\n"},icon:{fragmentSource:"precision mediump float;\n\nuniform sampler2D u_texture;\nuniform sampler2D u_fadetexture;\nuniform lowp float u_opacity;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\n\nvoid main() {\n lowp float alpha = texture2D(u_fadetexture, v_fade_tex).a * u_opacity;\n gl_FragColor = texture2D(u_texture, v_tex) * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"precision highp float;\n\nattribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec4 a_data1;\nattribute vec4 a_data2;\n\n\n// matrix is for the vertex position, exmatrix is for rotating and projecting\n// the extrusion vector.\nuniform mat4 u_matrix;\n\nuniform mediump float u_zoom;\nuniform bool u_skewed;\nuniform float u_extra;\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_data1.xy;\n mediump float a_labelminzoom = a_data1[2];\n mediump vec2 a_zoom = a_data2.st;\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_skewed) {\n gl_Position = u_matrix * vec4(a_pos + extrude, 0, 1);\n gl_Position.z += z * gl_Position.w;\n } else {\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n }\n\n v_tex = a_tex / u_texsize;\n v_fade_tex = vec2(a_labelminzoom / 255.0, 0.0);\n}\n"},sdf:{fragmentSource:"precision mediump float;\n\nuniform sampler2D u_texture;\nuniform sampler2D u_fadetexture;\nuniform lowp vec4 u_color;\nuniform lowp float u_opacity;\nuniform lowp float u_buffer;\nuniform lowp float u_gamma;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\nvarying float v_gamma_scale;\n\nvoid main() {\n lowp float dist = texture2D(u_texture, v_tex).a;\n lowp float fade_alpha = texture2D(u_fadetexture, v_fade_tex).a;\n lowp float gamma = u_gamma * v_gamma_scale;\n lowp float alpha = smoothstep(u_buffer - gamma, u_buffer + gamma, dist) * fade_alpha;\n gl_FragColor = u_color * (alpha * u_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"precision highp float;\n\nattribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec4 a_data1;\nattribute vec4 a_data2;\n\n\n// matrix is for the vertex position, exmatrix is for rotating and projecting\n// the extrusion vector.\nuniform mat4 u_matrix;\n\nuniform mediump float u_zoom;\nuniform bool u_skewed;\nuniform float u_extra;\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_data1.xy;\n mediump float a_labelminzoom = a_data1[2];\n mediump vec2 a_zoom = a_data2.st;\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_skewed) {\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 // position of y on the screen\n float y = gl_Position.y / gl_Position.w;\n // how much features are squished in all directions by the perspectiveness\n float perspective_scale = 1.0 / (1.0 - y * u_extra);\n v_gamma_scale = perspective_scale;\n\n v_tex = a_tex / u_texsize;\n v_fade_tex = vec2(a_labelminzoom / 255.0, 0.0);\n}\n"},collisionbox:{fragmentSource:"precision mediump float;\n\nuniform float u_zoom;\nuniform float u_maxzoom;\n\nvarying float v_max_zoom;\nvarying float v_placement_zoom;\n\nvoid main() {\n\n float alpha = 0.5;\n\n gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0) * alpha;\n\n if (v_placement_zoom > u_zoom) {\n gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0) * alpha;\n }\n\n if (u_zoom >= v_max_zoom) {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0) * alpha * 0.25;\n }\n\n if (v_placement_zoom >= u_maxzoom) {\n gl_FragColor = vec4(0.0, 0.0, 1.0, 1.0) * alpha * 0.2;\n }\n}\n",vertexSource:"precision highp float;\n\nattribute vec2 a_pos;\nattribute vec2 a_extrude;\nattribute vec2 a_data;\n\nuniform mat4 u_matrix;\nuniform float u_scale;\n\nvarying float v_max_zoom;\nvarying float v_placement_zoom;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos + a_extrude / u_scale, 0.0, 1.0);\n\n v_max_zoom = a_data.x;\n v_placement_zoom = a_data.y;\n}\n"}};e.exports._createProgram=function(t,e){var i=this.gl,n=i.createProgram(),s=a[t],l="";if(e)for(var u=0;u<e.length;u++)l+="#define "+e[u]+"\n";var c=i.createShader(i.FRAGMENT_SHADER);i.shaderSource(c,l+s.fragmentSource),i.compileShader(c),r(i.getShaderParameter(c,i.COMPILE_STATUS),i.getShaderInfoLog(c)),i.attachShader(n,c);var h=i.createShader(i.VERTEX_SHADER);i.shaderSource(h,l+s.vertexSource),i.compileShader(h),r(i.getShaderParameter(h,i.COMPILE_STATUS),i.getShaderInfoLog(h)),i.attachShader(n,h),i.linkProgram(n),r(i.getProgramParameter(n,i.LINK_STATUS),i.getProgramInfoLog(n));for(var f={},d=i.getProgramParameter(n,i.ACTIVE_ATTRIBUTES),p=0;d>p;p++){var m=i.getActiveAttrib(n,p);f[m.name]=p}for(var v={},y=i.getProgramParameter(n,i.ACTIVE_UNIFORMS),_=0;y>_;_++){var g=i.getActiveUniform(n,_);v[g.name]=i.getUniformLocation(n,g.name)}return o.extend({program:n,definition:s,attributes:f,numAttributes:d},f,v)},e.exports._createProgramCached=function(t,e){this.cache=this.cache||{},this._showOverdrawInspector&&(e=e||[],e.push("OVERDRAW_INSPECTOR"));var i=JSON.stringify({name:t,macros:e});return this.cache[i]||(this.cache[i]=this._createProgram(t,e)),this.cache[i]},e.exports.useProgram=function(t,e){var i=this.gl,n=this._createProgramCached(t,e),r=this.currentProgram;return r!==n&&(i.useProgram(n.program),this.currentProgram=n),n}},{"../../util/util":157,assert:176,path:178}],81:[function(t,e,i){"use strict";function n(){this.boundProgram=null,this.boundVertexBuffer=null,this.boundVertexBuffer2=null,this.boundElementBuffer=null,this.vao=null}var r=t("assert");e.exports=n;var o=!1;n.prototype.bind=function(t,e,i,n,a){var s=t.extVertexArrayObject;if(void 0===s&&(s=t.extVertexArrayObject=t.getExtension("OES_vertex_array_object")),s?(this.vao||(this.vao=s.createVertexArrayOES()),s.bindVertexArrayOES(this.vao)):o||(console.warn("Not using VertexArrayObject extension."),o=!0),this.boundProgram)r(this.boundProgram===e,"trying to bind a VAO to a different shader"),r(this.boundVertexBuffer===i,"trying to bind a VAO to a different vertex buffer"),r(this.boundVertexBuffer2===a,"trying to bind a VAO to a different vertex buffer"),r(this.boundElementBuffer===n,"trying to bind a VAO to a different element buffer");else{var l=s?0:t.currentNumAttributes||0,u=e.numAttributes,c;for(c=l;u>c;c++)t.enableVertexAttribArray(c);if(!s){for(r(c>0),c=u;l>c;c++)t.disableVertexAttribArray(c);t.currentNumAttributes=u}i.bind(t),i.setVertexAttribPointers(t,e),a&&(a.bind(t),a.setVertexAttribPointers(t,e)),n&&n.bind(t),s&&(this.boundProgram=e,this.boundVertexBuffer=i,this.boundVertexBuffer2=a,this.boundElementBuffer=n)}},n.prototype.unbind=function(t){var e=t.extVertexArrayObject;e&&e.bindVertexArrayOES(null)},n.prototype.destroy=function(t){var e=t.extVertexArrayObject;e&&this.vao&&(e.deleteVertexArrayOES(this.vao),this.vao=null)}},{assert:176}],82:[function(t,e,i){"use strict";function n(t){t=t||{},this._data=t.data,void 0!==t.maxzoom&&(this.maxzoom=t.maxzoom);var e=u/this.tileSize;this.geojsonVtOptions={buffer:(void 0!==t.buffer?t.buffer:128)*e,tolerance:(void 0!==t.tolerance?t.tolerance:.375)*e,extent:u,maxZoom:this.maxzoom},this.cluster=t.cluster||!1,this.superclusterOptions={maxZoom:Math.min(t.clusterMaxZoom,this.maxzoom-1)||this.maxzoom-1,extent:u,radius:(t.clusterRadius||50)*e,log:!1},this._pyramid=new a({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!0,load:this._loadTile.bind(this),abort:this._abortTile.bind(this),unload:this._unloadTile.bind(this),add:this._addTile.bind(this),remove:this._removeTile.bind(this),redoPlacement:this._redoTilePlacement.bind(this)})}var r=t("../util/util"),o=t("../util/evented"),a=t("./tile_pyramid"),s=t("./source"),l=t("resolve-url"),u=t("../data/bucket").EXTENT;e.exports=n,n.prototype=r.inherit(o,{minzoom:0,maxzoom:18,tileSize:512,_dirty:!0,isTileClipped:!0,setData:function(t){return this._data=t,this._dirty=!0,this.fire("change"),this.map&&this.update(this.map.transform),this},onAdd:function(t){this.map=t},loaded:function(){return this._loaded&&this._pyramid.loaded()},update:function(t){this._dirty&&this._updateData(),this._loaded&&this._pyramid.update(this.used,t)},reload:function(){this._loaded&&this._pyramid.reload()},serialize:function(){return{type:"geojson",data:this._data}},getVisibleCoordinates:s._getVisibleCoordinates,getTile:s._getTile,queryRenderedFeatures:s._queryRenderedVectorFeatures,querySourceFeatures:s._querySourceFeatures,_updateData:function(){this._dirty=!1;var t={tileSize:this.tileSize,source:this.id,geojsonVtOptions:this.geojsonVtOptions,cluster:this.cluster,superclusterOptions:this.superclusterOptions},e=this._data;"string"==typeof e?t.url="undefined"!=typeof window?l(window.location.href,e):e:t.data=JSON.stringify(e),this.workerID=this.dispatcher.send("parse geojson",t,function(t){this._loaded=!0,t?this.fire("error",{error:t}):(this._pyramid.reload(),this.fire("change"))}.bind(this))},_loadTile:function(t){var e=t.coord.z>this.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,i={uid:t.uid,coord:t.coord,zoom:t.coord.z,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,overscaling:e,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID=this.dispatcher.send("load geojson tile",i,function(e,i){if(t.unloadVectorData(this.map.painter),!t.aborted){if(e)return void this.fire("tile.error",{tile:t});t.loadVectorData(i,this.map.style),t.redoWhenDone&&(t.redoWhenDone=!1,t.redoPlacement(this)),this.fire("tile.load",{tile:t})}}.bind(this),this.workerID)},_abortTile:function(t){t.aborted=!0},_addTile:function(t){this.fire("tile.add",{tile:t})},_removeTile:function(t){this.fire("tile.remove",{tile:t})},_unloadTile:function(t){t.unloadVectorData(this.map.painter),this.dispatcher.send("remove tile",{uid:t.uid,source:this.id},null,t.workerID)},redoPlacement:s.redoPlacement,_redoTilePlacement:function(t){t.redoPlacement(this)}})},{"../data/bucket":55,"../util/evented":149,"../util/util":157,"./source":87,"./tile_pyramid":90,"resolve-url":162}],83:[function(t,e,i){"use strict";function n(t){this.features=t,this.length=t.length,this.extent=s}function r(t){this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=s}var o=t("point-geometry"),a=t("vector-tile").VectorTileFeature,s=t("../data/bucket").EXTENT;e.exports=n,n.prototype.feature=function(t){return new r(this.features[t])},r.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var e=0;e<t.length;e++){for(var i=t[e],n=[],r=0;r<i.length;r++)n.push(new o(i[r][0],i[r][1]));this.geometry.push(n)}return this.geometry},r.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,i=-(1/0),n=1/0,r=-(1/0),o=0;o<t.length;o++)for(var a=t[o],s=0;s<a.length;s++){var l=a[s];e=Math.min(e,l.x),i=Math.max(i,l.x),n=Math.min(n,l.y),r=Math.max(r,l.y)}return[e,n,i,r]},r.prototype.toGeoJSON=a.prototype.toGeoJSON},{"../data/bucket":55,"point-geometry":161,"vector-tile":166}],84:[function(t,e,i){"use strict";function n(t){this.urls=t.urls,this.coordinates=t.coordinates,c.getImage(t.url,function(e,i){e||(this.image=i,this.image.addEventListener("load",function(){this.map._rerender()}.bind(this)),this._loaded=!0,this.map&&this.setCoordinates(t.coordinates))}.bind(this))}var r=t("../util/util"),o=t("./tile"),a=t("./tile_coord"),s=t("../geo/lng_lat"),l=t("point-geometry"),u=t("../util/evented"),c=t("../util/ajax"),h=t("../data/bucket").EXTENT,f=t("../render/draw_raster").RasterBoundsArray,d=t("../data/buffer"),p=t("../render/vertex_array_object");e.exports=n,n.prototype=r.inherit(u,{onAdd:function(t){this.map=t,this.image&&this.setCoordinates(this.coordinates)},setCoordinates:function(t){this.coordinates=t;var e=this.map,i=t.map(function(t){return e.transform.locationCoordinate(s.convert(t)).zoomTo(0)}),n=this.centerCoord=r.getCoordinatesCenter(i);n.column=Math.round(n.column),n.row=Math.round(n.row);var u=i.map(function(t){var e=t.zoomTo(n.zoom);return new l(Math.round((e.column-n.column)*h),Math.round((e.row-n.row)*h))}),c=32767,m=new f;return m.emplaceBack(u[0].x,u[0].y,0,0),m.emplaceBack(u[1].x,u[1].y,c,0),m.emplaceBack(u[3].x,u[3].y,0,c),m.emplaceBack(u[2].x,u[2].y,c,c),this.tile=new o(new a(n.zoom,n.column,n.row)),this.tile.buckets={},this.tile.boundsBuffer=new d(m.serialize(),f.serialize(),d.BufferType.VERTEX),this.tile.boundsVAO=new p,this.fire("change"),this},loaded:function(){return this.image&&this.image.complete},update:function(){},reload:function(){},prepare:function(){if(this._loaded&&this.loaded()){var t=this.map.painter,e=t.gl;this.tile.texture?(e.bindTexture(e.TEXTURE_2D,this.tile.texture),e.texSubImage2D(e.TEXTURE_2D,0,0,0,e.RGBA,e.UNSIGNED_BYTE,this.image)):(this.tile.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.tile.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,this.image))}},getVisibleCoordinates:function(){return this.tile?[this.tile.coord]:[]},getTile:function(){return this.tile},serialize:function(){return{type:"image",urls:this.urls,coordinates:this.coordinates}}})},{"../data/bucket":55,"../data/buffer":60,"../geo/lng_lat":64,"../render/draw_raster":75,"../render/vertex_array_object":81,"../util/ajax":142,"../util/evented":149,"../util/util":157,"./tile":88,"./tile_coord":89,"point-geometry":161}],85:[function(t,e,i){"use strict";var n=t("../data/bucket");e.exports=function(t,e,i){return e*(n.EXTENT/(t.tileSize*Math.pow(2,i-t.coord.z)))}},{"../data/bucket":55}],86:[function(t,e,i){"use strict";function n(t){r.extend(this,r.pick(t,["url","tileSize"])),s._loadTileJSON.call(this,t)}var r=t("../util/util"),o=t("../util/ajax"),a=t("../util/evented"),s=t("./source"),l=t("../util/mapbox").normalizeTileURL;e.exports=n,n.prototype=r.inherit(a,{minzoom:0,maxzoom:22,roundZoom:!0,tileSize:512,_loaded:!1,onAdd:function(t){this.map=t},loaded:function(){return this._pyramid&&this._pyramid.loaded()},update:function(t){this._pyramid&&this._pyramid.update(this.used,t,this.map.style.rasterFadeDuration)},reload:function(){},serialize:function(){return{type:"raster",url:this.url,tileSize:this.tileSize}},getVisibleCoordinates:s._getVisibleCoordinates,getTile:s._getTile,_loadTile:function(t){function e(e,i){if(delete t.request,!t.aborted){if(e)return t.errored=!0,void this.fire("tile.error",{tile:t,error:e});var n=this.map.painter.gl;t.texture=this.map.painter.getTexture(i.width),t.texture?(n.bindTexture(n.TEXTURE_2D,t.texture),n.texSubImage2D(n.TEXTURE_2D,0,0,0,n.RGBA,n.UNSIGNED_BYTE,i)):(t.texture=n.createTexture(),n.bindTexture(n.TEXTURE_2D,t.texture),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR_MIPMAP_NEAREST),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,i),t.texture.size=i.width),n.generateMipmap(n.TEXTURE_2D),t.timeAdded=(new Date).getTime(),this.map.animationLoop.set(this.style.rasterFadeDuration),t.source=this,t.loaded=!0,this.fire("tile.load",{tile:t})}}var i=l(t.coord.url(this.tiles),this.url,this.tileSize);t.request=o.getImage(i,e.bind(this))},_abortTile:function(t){t.aborted=!0,t.request&&(t.request.abort(),delete t.request)},_addTile:function(t){this.fire("tile.add",{tile:t})},_removeTile:function(t){this.fire("tile.remove",{tile:t})},_unloadTile:function(t){t.texture&&this.map.painter.saveTexture(t.texture)}})},{"../util/ajax":142,"../util/evented":149,"../util/mapbox":154,"../util/util":157,"./source":87}],87:[function(t,e,i){"use strict";function n(t,e){var i=t.tile.coord,n=e.tile.coord;return i.z-n.z||i.y-n.y||i.x-n.x}function r(t){for(var e=t[0]||{},i=1;i<t.length;i++){var n=t[i];for(var r in n){var o=n[r],a=e[r];if(void 0===a)a=e[r]=o;else for(var s=0;s<o.length;s++)a.push(o[s])}}return e}var o=t("../util/util"),a=t("../util/ajax"),s=t("../util/browser"),l=t("./tile_pyramid"),u=t("../util/mapbox").normalizeSourceURL,c=t("./tile_coord");i._loadTileJSON=function(t){var e=function(t,e){return t?void this.fire("error",{error:t}):(o.extend(this,o.pick(e,["tiles","minzoom","maxzoom","attribution"])),e.vector_layers&&(this.vectorLayers=e.vector_layers,this.vectorLayerIds=this.vectorLayers.map(function(t){return t.id})),this._pyramid=new l({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,roundZoom:this.roundZoom,reparseOverscaled:this.reparseOverscaled,load:this._loadTile.bind(this),abort:this._abortTile.bind(this),unload:this._unloadTile.bind(this),add:this._addTile.bind(this),remove:this._removeTile.bind(this),redoPlacement:this._redoTilePlacement?this._redoTilePlacement.bind(this):void 0}),void this.fire("load"))}.bind(this);t.url?a.getJSON(u(t.url),e):s.frame(e.bind(this,null,t))},i.redoPlacement=function(){if(this._pyramid)for(var t=this._pyramid.orderedIDs(),e=0;e<t.length;e++){var i=this._pyramid.getTile(t[e]);this._redoTilePlacement(i)}},i._getTile=function(t){return this._pyramid.getTile(t.id)},i._getVisibleCoordinates=function(){return this._pyramid?this._pyramid.renderedIDs().map(c.fromID):[]},i._queryRenderedVectorFeatures=function(t,e,i,o){if(!this._pyramid)return{};var a=this._pyramid.tilesIn(t);a.sort(n);for(var s=this.map.style._layers,l=[],u=0;u<a.length;u++){var c=a[u];c.tile.featureIndex&&l.push(c.tile.featureIndex.query({queryGeometry:c.queryGeometry,scale:c.scale,tileSize:c.tile.tileSize,bearing:o,params:e},s))}return r(l)},i._querySourceFeatures=function(t){if(!this._pyramid)return[];for(var e=this._pyramid,i=e.renderedIDs().map(function(t){return e.getTile(t)}),n=[],r={},o=0;o<i.length;o++){var a=i[o],s=new c(Math.min(a.sourceMaxZoom,a.coord.z),a.coord.x,a.coord.y,0).id;r[s]||(r[s]=!0,a.querySourceFeatures(n,t))}return n},i.create=function(e){var n={vector:t("./vector_tile_source"),raster:t("./raster_tile_source"),geojson:t("./geojson_source"),video:t("./video_source"),image:t("./image_source")};return i.is(e)?e:new n[e.type](e)},i.is=function(e){var i={vector:t("./vector_tile_source"),raster:t("./raster_tile_source"),geojson:t("./geojson_source"),video:t("./video_source"),image:t("./image_source")};for(var n in i)if(e instanceof i[n])return!0;return!1}},{"../util/ajax":142,"../util/browser":143,"../util/mapbox":154,"../util/util":157,"./geojson_source":82,"./image_source":84,"./raster_tile_source":86,"./tile_coord":89,"./tile_pyramid":90,"./vector_tile_source":91,"./video_source":92}],88:[function(t,e,i){"use strict";function n(t,e,i){this.coord=t,this.uid=o.uniqueId(),this.loaded=!1,this.isUnloaded=!1,this.uses=0,this.tileSize=e,this.sourceMaxZoom=i,this.buckets={}}function r(t,e){for(var i={},n=0;n<t.length;n++){var r=e.getLayer(t[n].layerId);if(r){var s=a.create(o.extend({layer:r,childLayers:t[n].childLayerIds.map(e.getLayer.bind(e)).filter(function(t){return t})},t[n]));i[s.id]=s}}return i}var o=t("../util/util"),a=t("../data/bucket"),s=t("../data/feature_index"),l=t("vector-tile"),u=t("pbf"),c=t("../util/vectortile_to_geojson"),h=t("feature-filter"),f=t("../symbol/collision_tile"),d=t("../symbol/collision_box");e.exports=n,n.prototype={loadVectorData:function(t,e){this.loaded=!0,t&&(this.collisionBoxArray=new d(t.collisionBoxArray),this.collisionTile=new f(t.collisionTile,this.collisionBoxArray),this.featureIndex=new s(t.featureIndex,t.rawTileData,this.collisionTile),this.rawTileData=t.rawTileData,this.buckets=r(t.buckets,e))},reloadSymbolData:function(t,e,i){if(!this.isUnloaded){this.collisionTile=new f(t.collisionTile,this.collisionBoxArray),this.featureIndex.setCollisionTile(this.collisionTile);for(var n in this.buckets){var a=this.buckets[n];"symbol"===a.type&&(a.destroy(e.gl),delete this.buckets[n])}o.extend(this.buckets,r(t.buckets,i))}},unloadVectorData:function(t){for(var e in this.buckets){var i=this.buckets[e];i.destroy(t.gl)}this.collisionBoxArray=null,this.collisionTile=null,this.featureIndex=null,this.rawTileData=null,this.buckets=null,this.loaded=!1,this.isUnloaded=!0},redoPlacement:function(t){function e(e,i){this.reloadSymbolData(i,t.map.painter,t.map.style),t.fire("tile.load",{tile:this}),this.redoingPlacement=!1,this.redoWhenDone&&(this.redoPlacement(t),this.redoWhenDone=!1)}return!this.loaded||this.redoingPlacement?void(this.redoWhenDone=!0):(this.redoingPlacement=!0,void t.dispatcher.send("redo placement",{uid:this.uid,source:t.id,angle:t.map.transform.angle,pitch:t.map.transform.pitch,showCollisionBoxes:t.map.showCollisionBoxes},e.bind(this),this.workerID))},getBucket:function(t){return this.buckets&&this.buckets[t.ref||t.id]},querySourceFeatures:function(t,e){if(this.rawTileData){this.vtLayers||(this.vtLayers=new l.VectorTile(new u(new Uint8Array(this.rawTileData))).layers);var i=this.vtLayers._geojsonTileLayer||this.vtLayers[e.sourceLayer];if(i)for(var n=h(e.filter),r={z:this.coord.z,x:this.coord.x,y:this.coord.y},o=0;o<i.length;o++){var a=i.feature(o);if(n(a)){var s=new c(a,this.coord.z,this.coord.x,this.coord.y);s.tile=r,t.push(s)}}}}}},{"../data/bucket":55,"../data/feature_index":61,"../symbol/collision_box":114,"../symbol/collision_tile":116,"../util/util":157,"../util/vectortile_to_geojson":158,"feature-filter":2,pbf:160,"vector-tile":166}],89:[function(t,e,i){"use strict";function n(t,e,i,n){s(!isNaN(t)&&t>=0&&t%1===0),s(!isNaN(e)&&e>=0&&e%1===0),s(!isNaN(i)&&i>=0&&i%1===0),isNaN(n)&&(n=0),this.z=+t,this.x=+e,this.y=+i,this.w=+n,n*=2,0>n&&(n=-1*n-1);var r=1<<this.z;this.id=32*(r*r*n+r*this.y+this.x)+this.z,this.posMatrix=null}function r(t,e){if(t.row>e.row){var i=t;t=e,e=i}return{x0:t.column,y0:t.row,x1:e.column,y1:e.row,dx:e.column-t.column,dy:e.row-t.row}}function o(t,e,i,n,r){var o=Math.max(i,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.dx<e.x1:t.x1-e.dy/t.dy*t.dx<e.x0){var s=t;t=e,e=s}for(var l=t.dx/t.dy,u=e.dx/e.dy,c=t.dx>0,h=e.dx<0,f=o;a>f;f++){var d=l*Math.max(0,Math.min(t.dy,f+c-t.y0))+t.x0,p=u*Math.max(0,Math.min(e.dy,f+h-e.y0))+e.x0;r(Math.floor(p),Math.ceil(d),f)}}function a(t,e,i,n,a,s){var l=r(t,e),u=r(e,i),c=r(i,t),h;l.dy>u.dy&&(h=l,l=u,u=h),l.dy>c.dy&&(h=l,l=c,c=h),u.dy>c.dy&&(h=u,u=c,c=h),l.dy&&o(c,l,n,a,s),u.dy&&o(c,u,n,a,s)}var s=t("assert"),l=t("../geo/coordinate");e.exports=n,n.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y},n.prototype.toCoordinate=function(t){var e=Math.min(this.z,t),i=Math.pow(2,e),n=this.y,r=this.x+i*this.w;return new l(r,n,e)},n.fromID=function(t){var e=t%32,i=1<<e,r=(t-e)/32,o=r%i,a=(r-o)/i%i,s=Math.floor(r/(i*i));return s%2!==0&&(s=-1*s-1),s/=2,new n(e,o,a,s)},n.prototype.url=function(t,e){return t[(this.x+this.y)%t.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",Math.min(this.z,e||this.z)).replace("{x}",this.x).replace("{y}",this.y)},n.prototype.parent=function(t){return 0===this.z?null:this.z>t?new n(this.z-1,this.x,this.y,this.w):new n(this.z-1,Math.floor(this.x/2),Math.floor(this.y/2),this.w)},n.prototype.wrapped=function(){return new n(this.z,this.x,this.y,0)},n.prototype.children=function(t){if(this.z>=t)return[new n(this.z+1,this.x,this.y,this.w)];var e=this.z+1,i=2*this.x,r=2*this.y;return[new n(e,i,r,this.w),new n(e,i+1,r,this.w),new n(e,i,r+1,this.w),new n(e,i+1,r+1,this.w)]},n.cover=function(t,e,i){function r(t,e,r){var a,l,u;if(r>=0&&o>=r)for(a=t;e>a;a++)l=(a%o+o)%o,u=new n(i,l,r,Math.floor(a/o)),s[u.id]=u}var o=1<<t,s={};return a(e[0],e[1],e[2],0,o,r),a(e[2],e[3],e[0],0,o,r),Object.keys(s).map(function(t){return s[t]})}},{"../geo/coordinate":63,assert:176}],90:[function(t,e,i){"use strict";function n(t){this.tileSize=t.tileSize,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,this.roundZoom=t.roundZoom,this.reparseOverscaled=t.reparseOverscaled,this._load=t.load,this._abort=t.abort,this._unload=t.unload,this._add=t.add,this._remove=t.remove,this._redoPlacement=t.redoPlacement,this._tiles={},this._cache=new u(0,function(t){return this._unload(t)}.bind(this)),this._filterRendered=this._filterRendered.bind(this)}function r(t,e,i){var n=i.zoomTo(Math.min(t.z,e));return{x:(n.column-(t.x+t.w*Math.pow(2,t.z)))*f,y:(n.row-t.y)*f}}function o(t,e){return t%32-e%32}var a=t("./tile"),s=t("./tile_coord"),l=t("point-geometry"),u=t("../util/lru_cache"),c=t("../geo/coordinate"),h=t("../util/util"),f=t("../data/bucket").EXTENT;e.exports=n,n.maxOverzooming=10,n.maxUnderzooming=3,n.prototype={loaded:function(){for(var t in this._tiles)if(!this._tiles[t].loaded&&!this._tiles[t].errored)return!1;return!0},orderedIDs:function(){return Object.keys(this._tiles).map(Number).sort(o)},renderedIDs:function(){return this.orderedIDs().filter(this._filterRendered)},_filterRendered:function(t){return this._tiles[t].loaded&&!this._coveredTiles[t]},reload:function(){this._cache.reset();for(var t in this._tiles)this._load(this._tiles[t])},getTile:function(t){return this._tiles[t]},getZoom:function(t){return t.zoom+Math.log(t.tileSize/this.tileSize)/Math.LN2},coveringZoomLevel:function(t){return(this.roundZoom?Math.round:Math.floor)(this.getZoom(t))},coveringTiles:function(t){var e=this.coveringZoomLevel(t),i=e;if(e<this.minzoom)return[];e>this.maxzoom&&(e=this.maxzoom);var n=t,r=n.locationCoordinate(n.center)._zoomTo(e),o=new l(r.column-.5,r.row-.5);return s.cover(e,[n.pointCoordinate(new l(0,0))._zoomTo(e),n.pointCoordinate(new l(n.width,0))._zoomTo(e),n.pointCoordinate(new l(n.width,n.height))._zoomTo(e),n.pointCoordinate(new l(0,n.height))._zoomTo(e)],this.reparseOverscaled?i:e).sort(function(t,e){return o.dist(t)-o.dist(e)})},findLoadedChildren:function(t,e,i){var n=!1;for(var r in this._tiles){var o=this._tiles[r];if(!(i[r]||!o.loaded||o.coord.z<=t.z||o.coord.z>e)){var a=Math.pow(2,Math.min(o.coord.z,this.maxzoom)-Math.min(t.z,this.maxzoom));if(Math.floor(o.coord.x/a)===t.x&&Math.floor(o.coord.y/a)===t.y)for(i[r]=!0,n=!0;o&&o.coord.z-1>t.z;){var s=o.coord.parent(this.maxzoom).id;o=this._tiles[s],o&&o.loaded&&(delete i[r],i[s]=!0)}}}return n},findLoadedParent:function(t,e,i){for(var n=t.z-1;n>=e;n--){t=t.parent(this.maxzoom);var r=this._tiles[t.id];if(r&&r.loaded)return i[t.id]=!0,r;if(this._cache.has(t.id))return this.addTile(t),i[t.id]=!0,this._tiles[t.id]}},updateCacheSize:function(t){var e=Math.ceil(t.width/t.tileSize)+1,i=Math.ceil(t.height/t.tileSize)+1,n=e*i,r=5;this._cache.setMaxSize(Math.floor(n*r))},update:function(t,e,i){var r,o,a;this.updateCacheSize(e);var l=(this.roundZoom?Math.round:Math.floor)(this.getZoom(e)),u=Math.max(l-n.maxOverzooming,this.minzoom),c=Math.max(l+n.maxUnderzooming,this.minzoom),f={},d=(new Date).getTime();this._coveredTiles={};var p=t?this.coveringTiles(e):[];for(r=0;r<p.length;r++)o=p[r],a=this.addTile(o),f[o.id]=!0,a.loaded||this.findLoadedChildren(o,c,f)||this.findLoadedParent(o,u,f);for(var m={},v=Object.keys(f),y=0;y<v.length;y++){var _=v[y];o=s.fromID(_),a=this._tiles[_],a&&a.timeAdded>d-(i||0)&&(this.findLoadedChildren(o,c,f)&&(f[_]=!0),this.findLoadedParent(o,u,m))}var g;for(g in m)f[g]||(this._coveredTiles[g]=!0);for(g in m)f[g]=!0;var x=h.keysDifference(this._tiles,f);for(r=0;r<x.length;r++)this.removeTile(+x[r]);this.transform=e},addTile:function(t){var e=this._tiles[t.id];if(e)return e;var i=t.wrapped();if(e=this._tiles[i.id],e||(e=this._cache.get(i.id),e&&this._redoPlacement&&this._redoPlacement(e)),!e){var n=t.z,r=n>this.maxzoom?Math.pow(2,n-this.maxzoom):1;e=new a(i,this.tileSize*r,this.maxzoom),this._load(e)}return e.uses++,this._tiles[t.id]=e,this._add(e,t),e},removeTile:function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._remove(e),e.uses>0||(e.loaded?this._cache.add(e.coord.wrapped().id,e):(this._abort(e),this._unload(e))))},clearTiles:function(){for(var t in this._tiles)this.removeTile(t);this._cache.reset()},tilesIn:function(t){for(var e={},i=this.orderedIDs(),n=1/0,o=1/0,a=-(1/0),l=-(1/0),u=t[0].zoom,h=0;h<t.length;h++){var d=t[h];
n=Math.min(n,d.column),o=Math.min(o,d.row),a=Math.max(a,d.column),l=Math.max(l,d.row)}for(var p=0;p<i.length;p++){var m=this._tiles[i[p]],v=s.fromID(i[p]),y=[r(v,m.sourceMaxZoom,new c(n,o,u)),r(v,m.sourceMaxZoom,new c(a,l,u))];if(y[0].x<f&&y[0].y<f&&y[1].x>=0&&y[1].y>=0){for(var _=[],g=0;g<t.length;g++)_.push(r(v,m.sourceMaxZoom,t[g]));var x=e[m.coord.id];void 0===x&&(x=e[m.coord.id]={tile:m,queryGeometry:[],scale:Math.pow(2,this.transform.zoom-m.coord.z)}),x.queryGeometry.push(_)}}var b=[];for(var w in e)b.push(e[w]);return b}}},{"../data/bucket":55,"../geo/coordinate":63,"../util/lru_cache":153,"../util/util":157,"./tile":88,"./tile_coord":89,"point-geometry":161}],91:[function(t,e,i){"use strict";function n(t){if(r.extend(this,r.pick(t,["url","tileSize"])),this._options=r.extend({type:"vector"},t),512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");a._loadTileJSON.call(this,t)}var r=t("../util/util"),o=t("../util/evented"),a=t("./source"),s=t("../util/mapbox").normalizeTileURL;e.exports=n,n.prototype=r.inherit(o,{minzoom:0,maxzoom:22,tileSize:512,reparseOverscaled:!0,_loaded:!1,isTileClipped:!0,onAdd:function(t){this.map=t},loaded:function(){return this._pyramid&&this._pyramid.loaded()},update:function(t){this._pyramid&&this._pyramid.update(this.used,t)},reload:function(){this._pyramid&&this._pyramid.reload()},serialize:function(){return r.extend({},this._options)},getVisibleCoordinates:a._getVisibleCoordinates,getTile:a._getTile,queryRenderedFeatures:a._queryRenderedVectorFeatures,querySourceFeatures:a._querySourceFeatures,_loadTile:function(t){var e=t.coord.z>this.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,i={url:s(t.coord.url(this.tiles,this.maxzoom),this.url),uid:t.uid,coord:t.coord,zoom:t.coord.z,tileSize:this.tileSize*e,source:this.id,overscaling:e,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID?(i.rawTileData=t.rawTileData,this.dispatcher.send("reload tile",i,this._tileLoaded.bind(this,t),t.workerID)):t.workerID=this.dispatcher.send("load tile",i,this._tileLoaded.bind(this,t))},_tileLoaded:function(t,e,i){if(!t.aborted){if(e)return t.errored=!0,void this.fire("tile.error",{tile:t,error:e});t.loadVectorData(i,this.map.style),t.redoWhenDone&&(t.redoWhenDone=!1,t.redoPlacement(this)),this.fire("tile.load",{tile:t}),this.fire("tile.stats",i.bucketStats)}},_abortTile:function(t){t.aborted=!0,this.dispatcher.send("abort tile",{uid:t.uid,source:this.id},null,t.workerID)},_addTile:function(t){this.fire("tile.add",{tile:t})},_removeTile:function(t){this.fire("tile.remove",{tile:t})},_unloadTile:function(t){t.unloadVectorData(this.map.painter),this.dispatcher.send("remove tile",{uid:t.uid,source:this.id},null,t.workerID)},redoPlacement:a.redoPlacement,_redoTilePlacement:function(t){t.redoPlacement(this)}})},{"../util/evented":149,"../util/mapbox":154,"../util/util":157,"./source":87}],92:[function(t,e,i){"use strict";function n(t){this.urls=t.urls,this.coordinates=t.coordinates,c.getVideo(t.urls,function(e,i){if(!e){this.video=i,this.video.loop=!0;var n;this.video.addEventListener("playing",function(){n=this.map.style.animationLoop.set(1/0),this.map._rerender()}.bind(this)),this.video.addEventListener("pause",function(){this.map.style.animationLoop.cancel(n)}.bind(this)),this._loaded=!0,this.map&&(this.video.play(),this.setCoordinates(t.coordinates))}}.bind(this))}var r=t("../util/util"),o=t("./tile"),a=t("./tile_coord"),s=t("../geo/lng_lat"),l=t("point-geometry"),u=t("../util/evented"),c=t("../util/ajax"),h=t("../data/bucket").EXTENT,f=t("../render/draw_raster").RasterBoundsArray,d=t("../data/buffer"),p=t("../render/vertex_array_object");e.exports=n,n.prototype=r.inherit(u,{roundZoom:!0,getVideo:function(){return this.video},onAdd:function(t){this.map=t,this.video&&(this.video.play(),this.setCoordinates(this.coordinates))},setCoordinates:function(t){this.coordinates=t;var e=this.map,i=t.map(function(t){return e.transform.locationCoordinate(s.convert(t)).zoomTo(0)}),n=this.centerCoord=r.getCoordinatesCenter(i);n.column=Math.round(n.column),n.row=Math.round(n.row);var u=i.map(function(t){var e=t.zoomTo(n.zoom);return new l(Math.round((e.column-n.column)*h),Math.round((e.row-n.row)*h))}),c=32767,m=new f;return m.emplaceBack(u[0].x,u[0].y,0,0),m.emplaceBack(u[1].x,u[1].y,c,0),m.emplaceBack(u[3].x,u[3].y,0,c),m.emplaceBack(u[2].x,u[2].y,c,c),this.tile=new o(new a(n.zoom,n.column,n.row)),this.tile.buckets={},this.tile.boundsBuffer=new d(m.serialize(),f.serialize(),d.BufferType.VERTEX),this.tile.boundsVAO=new p,this.fire("change"),this},loaded:function(){return this.video&&this.video.readyState>=2},update:function(){},reload:function(){},prepare:function(){if(this._loaded&&!(this.video.readyState<2)){var t=this.map.painter.gl;this.tile.texture?(t.bindTexture(t.TEXTURE_2D,this.tile.texture),t.texSubImage2D(t.TEXTURE_2D,0,0,0,t.RGBA,t.UNSIGNED_BYTE,this.video)):(this.tile.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.tile.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,this.video)),this._currentTime=this.video.currentTime}},getVisibleCoordinates:function(){return this.tile?[this.tile.coord]:[]},getTile:function(){return this.tile},serialize:function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}})},{"../data/bucket":55,"../data/buffer":60,"../geo/lng_lat":64,"../render/draw_raster":75,"../render/vertex_array_object":81,"../util/ajax":142,"../util/evented":149,"../util/util":157,"./tile":88,"./tile_coord":89,"point-geometry":161}],93:[function(t,e,i){"use strict";function n(t){this.self=t,this.actor=new o(t,this),this.loading={},this.loaded={},this.geoJSONIndexes={}}function r(t){var e={};for(var i in t){var n=t[i],r=n.ref||n.id,o=t[r];o.layout&&"none"===o.layout.visibility||(e[r]=e[r]||[],i===r?e[r].unshift(n):e[r].push(n))}return e}var o=t("../util/actor"),a=t("./worker_tile"),s=t("../style/style_layer"),l=t("../util/util"),u=t("../util/ajax"),c=t("vector-tile"),h=t("pbf"),f=t("supercluster"),d=t("geojson-vt"),p=t("geojson-rewind"),m=t("./geojson_wrapper"),v=t("vt-pbf");e.exports=function(t){return new n(t)},l.extend(n.prototype,{"set layers":function(t){function e(t){var e=s.create(t,t.ref&&i.layers[t.ref]);e.updatePaintTransitions({},{transition:!1}),i.layers[e.id]=e}this.layers={};for(var i=this,n=[],o=0;o<t.length;o++){var a=t[o];"fill"!==a.type&&"line"!==a.type&&"circle"!==a.type&&"symbol"!==a.type||(a.ref?n.push(o):e(a))}for(var l=0;l<n.length;l++)e(t[n[l]]);this.layerFamilies=r(this.layers)},"update layers":function(t){function e(t){var e=i.layers[t.ref];i.layers[t.id]?i.layers[t.id].set(t,e):i.layers[t.id]=s.create(t,e),i.layers[t.id].updatePaintTransitions({},{transition:!1})}var i=this,n,o;for(n in t)o=t[n],o.ref&&e(o);for(n in t)o=t[n],o.ref||e(o);this.layerFamilies=r(this.layers)},"load tile":function(t,e){function i(t,i){return delete this.loading[n][r],t?e(t):(o.data=new c.VectorTile(new h(new Uint8Array(i))),o.parse(o.data,this.layerFamilies,this.actor,i,e),this.loaded[n]=this.loaded[n]||{},void(this.loaded[n][r]=o))}var n=t.source,r=t.uid;this.loading[n]||(this.loading[n]={});var o=this.loading[n][r]=new a(t);o.xhr=u.getArrayBuffer(t.url,i.bind(this))},"reload tile":function(t,e){var i=this.loaded[t.source],n=t.uid;if(i&&i[n]){var r=i[n];r.parse(r.data,this.layerFamilies,this.actor,t.rawTileData,e)}},"abort tile":function(t){var e=this.loading[t.source],i=t.uid;e&&e[i]&&(e[i].xhr.abort(),delete e[i])},"remove tile":function(t){var e=this.loaded[t.source],i=t.uid;e&&e[i]&&delete e[i]},"redo placement":function(t,e){var i=this.loaded[t.source],n=this.loading[t.source],r=t.uid;if(i&&i[r]){var o=i[r],a=o.redoPlacement(t.angle,t.pitch,t.showCollisionBoxes);a.result&&e(null,a.result,a.transferables)}else n&&n[r]&&(n[r].angle=t.angle)},"parse geojson":function(t,e){var i=function(i,n){if(p(n,!0),i)return e(i);if("object"!=typeof n)return e(new Error("Input data is not a valid GeoJSON object."));try{this.geoJSONIndexes[t.source]=t.cluster?f(t.superclusterOptions).load(n.features):d(n,t.geojsonVtOptions)}catch(i){return e(i)}e(null)}.bind(this);if(t.url)u.getJSON(t.url,i);else{if("string"!=typeof t.data)return e(new Error("Input data is not a valid GeoJSON object."));i(null,JSON.parse(t.data))}},"load geojson tile":function(t,e){var i=t.source,n=t.coord;if(!this.geoJSONIndexes[i])return e(null,null);var r=this.geoJSONIndexes[i].getTile(Math.min(n.z,t.maxZoom),n.x,n.y),o=r?new a(t):void 0;if(this.loaded[i]=this.loaded[i]||{},this.loaded[i][t.uid]=o,!r)return e(null,null);var s=new m(r.features);s.name="_geojsonTileLayer";var l=v({layers:{_geojsonTileLayer:s}}).buffer;o.parse(s,this.layerFamilies,this.actor,l,e)}})},{"../style/style_layer":101,"../util/actor":141,"../util/ajax":142,"../util/util":157,"./geojson_wrapper":83,"./worker_tile":94,"geojson-rewind":4,"geojson-vt":7,pbf:160,supercluster:164,"vector-tile":166,"vt-pbf":170}],94:[function(t,e,i){"use strict";function n(t){this.coord=t.coord,this.uid=t.uid,this.zoom=t.zoom,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=t.overscaling,this.angle=t.angle,this.pitch=t.pitch,this.showCollisionBoxes=t.showCollisionBoxes}function r(t){for(var e in t.arrayGroups)for(var i=t.arrayGroups[e],n=0;n<i.length;n++){var r=i[n];for(var o in r){var a=r[o];for(var s in a)if(a[s].length>0)return!0}}return!1}function o(t){return t.serialize()}function a(t){var e=[];for(var i in t){var n=t[i];for(var r in n.arrayGroups)for(var o=n.arrayGroups[r],a=0;a<o.length;a++){var s=o[a];for(var l in s){var u=s[l];for(var c in u)e.push(u[c].arrayBuffer)}}}return e}function s(t){return t.id}var l=t("../data/feature_index"),u=t("../symbol/collision_tile"),c=t("../data/bucket"),h=t("../symbol/collision_box"),f=t("../util/dictionary_coder");e.exports=n,n.prototype.parse=function(t,e,i,n,d){function p(t,e){for(var i=0;i<t.length;i++){var n=t.feature(i);n.index=i;for(var r in e)e[r].filter(n)&&e[r].features.push(n)}}function m(t){if(t)return d(t);if(O++,2===O){for(var e=F.length-1;e>=0;e--)v(w,F[e]);y()}}function v(t,e){var i=Date.now();e.populateBuffers(_,C,R);var n=Date.now()-i;if("symbol"!==e.type)for(var r=0;r<e.features.length;r++){var o=e.features[r];g.insert(o,o.index,e.sourceLayerIndex,e.index)}e.features=null,b._total+=n,b[e.id]=(b[e.id]||0)+n}function y(){w.status="done",w.redoPlacementAfterDone&&(w.redoPlacement(w.angle,w.pitch,null),w.redoPlacementAfterDone=!1);var t=g.serialize(),e=_.serialize(),i=w.collisionBoxArray.serialize(),s=[n].concat(t.transferables).concat(e.transferables),l=L.filter(r);d(null,{buckets:l.map(o),bucketStats:b,featureIndex:t.data,collisionTile:e.data,collisionBoxArray:i,rawTileData:n},a(l).concat(s))}this.status="parsing",this.data=t,this.collisionBoxArray=new h;var _=new u(this.angle,this.pitch,this.collisionBoxArray),g=new l(this.coord,this.overscaling,_,t.layers),x=new f(t.layers?Object.keys(t.layers).sort():["_geojsonTileLayer"]),b={_total:0},w=this,M={},S={},E,T,I,D,z=0;for(var P in e)T=e[P][0],T.source===this.source&&(T.ref||T.minzoom&&this.zoom<T.minzoom||T.maxzoom&&this.zoom>=T.maxzoom||T.layout&&"none"===T.layout.visibility||t.layers&&!t.layers[T.sourceLayer]||(D=c.create({layer:T,index:z++,childLayers:e[P],zoom:this.zoom,overscaling:this.overscaling,showCollisionBoxes:this.showCollisionBoxes,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:x.encode(T.sourceLayer||"_geojsonTileLayer")}),D.createFilter(),M[T.id]=D,t.layers&&(I=T.sourceLayer,S[I]=S[I]||{},S[I][T.id]=D)));if(t.layers)for(I in S)T=t.layers[I],T&&p(T,S[I]);else p(t,M);var L=[],F=this.symbolBuckets=[],A=[];g.bucketLayerIDs={};for(var k in M)D=M[k],0!==D.features.length&&(g.bucketLayerIDs[D.index]=D.childLayers.map(s),L.push(D),"symbol"===D.type?F.push(D):A.push(D));var R={},C={},O=0;if(F.length>0){for(E=F.length-1;E>=0;E--)F[E].updateIcons(R),F[E].updateFont(C);for(var j in C)C[j]=Object.keys(C[j]).map(Number);R=Object.keys(R),i.send("get glyphs",{uid:this.uid,stacks:C},function(t,e){C=e,m(t)}),R.length?i.send("get icons",{icons:R},function(t,e){R=e,m(t)}):m()}for(E=A.length-1;E>=0;E--)v(this,A[E]);return 0===F.length?y():void 0},n.prototype.redoPlacement=function(t,e,i){if("done"!==this.status)return this.redoPlacementAfterDone=!0,this.angle=t,{};for(var n=new u(t,e,this.collisionBoxArray),s=this.symbolBuckets,l=s.length-1;l>=0;l--)s[l].placeFeatures(n,i);var c=n.serialize(),h=s.filter(r);return{result:{buckets:h.map(o),collisionTile:c.data},transferables:a(h).concat(c.transferables)}}},{"../data/bucket":55,"../data/feature_index":61,"../symbol/collision_box":114,"../symbol/collision_tile":116,"../util/dictionary_coder":148}],95:[function(t,e,i){"use strict";function n(){this.n=0,this.times=[]}e.exports=n,n.prototype.stopped=function(){return this.times=this.times.filter(function(t){return t.time>=(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})}},{}],96:[function(t,e,i){"use strict";function n(t){this.base=t,this.retina=s.devicePixelRatio>1;var e=this.retina?"@2x":"";a.getJSON(l(t,e,".json"),function(t,e){return t?void this.fire("error",{error:t}):(this.data=e,void(this.img&&this.fire("load")))}.bind(this)),a.getImage(l(t,e,".png"),function(t,e){if(t)return void this.fire("error",{error:t});for(var i=e.getData(),n=e.data=new Uint8Array(i.length),r=0;r<i.length;r+=4){var o=i[r+3]/255;n[r+0]=i[r+0]*o,n[r+1]=i[r+1]*o,n[r+2]=i[r+2]*o,n[r+3]=i[r+3]}this.img=e,this.data&&this.fire("load")}.bind(this))}function r(){}var o=t("../util/evented"),a=t("../util/ajax"),s=t("../util/browser"),l=t("../util/mapbox").normalizeSpriteURL;e.exports=n,n.prototype=Object.create(o),n.prototype.toJSON=function(){return this.base},n.prototype.loaded=function(){return!(!this.data||!this.img)},n.prototype.resize=function(){if(s.devicePixelRatio>1!==this.retina){var t=new n(this.base);t.on("load",function(){this.img=t.img,this.data=t.data,this.retina=t.retina}.bind(this))}},r.prototype={x:0,y:0,width:0,height:0,pixelRatio:1,sdf:!1},n.prototype.getSpritePosition=function(t){if(!this.loaded())return new r;var e=this.data&&this.data[t];return e&&this.img?e:new r}},{"../util/ajax":142,"../util/browser":143,"../util/evented":149,"../util/mapbox":154}],97:[function(t,e,i){"use strict";function n(t){if(l[t])return l[t];if(Array.isArray(t))return t;if(t&&t.stops)return s.extend({},t,{stops:t.stops.map(r)});if("string"==typeof t){var e=a(t);if(!e)throw new Error("Invalid color "+t);var i=o(e);return l[t]=i,i}throw new Error("Invalid color "+t)}function r(t){return[t[0],n(t[1])]}function o(t){return[t[0]/255,t[1]/255,t[2]/255,t[3]/1]}var a=t("csscolorparser").parseCSSColor,s=t("../util/util"),l={};e.exports=n},{"../util/util":157,csscolorparser:1}],98:[function(t,e,i){"use strict";function n(t,e){this.animationLoop=e||new m,this.dispatcher=new p(Math.max(d.hardwareConcurrency-1,1),this),this.spriteAtlas=new l(512,512),this.lineAtlas=new u(256,512),this._layers={},this._order=[],this._groups=[],this.sources={},this.zoomHistory={},c.bindAll(["_forwardSourceEvent","_forwardTileEvent","_forwardLayerEvent","_redoPlacement"],this),this._resetUpdates();var i=function(t,e){if(t)return void this.fire("error",{error:t});if(!v.emitErrors(this,v(e))){this._loaded=!0,this.stylesheet=e,this.updateClasses();var i=e.sources;for(var n in i)this.addSource(n,i[n]);e.sprite&&(this.sprite=new a(e.sprite),this.sprite.on("load",this.fire.bind(this,"change"))),this.glyphSource=new s(e.glyphs),this._resolve(),this.fire("load")}}.bind(this);"string"==typeof t?h.getJSON(f(t),i):d.frame(i.bind(this,null,t)),this.on("source.load",function(t){var e=t.source;if(e&&e.vectorLayerIds)for(var i in this._layers){var n=this._layers[i];n.source===e.id&&this._validateLayer(n)}})}var r=t("../util/evented"),o=t("./style_layer"),a=t("./image_sprite"),s=t("../symbol/glyph_source"),l=t("../symbol/sprite_atlas"),u=t("../render/line_atlas"),c=t("../util/util"),h=t("../util/ajax"),f=t("../util/mapbox").normalizeStyleURL,d=t("../util/browser"),p=t("../util/dispatcher"),m=t("./animation_loop"),v=t("./validate_style"),y=t("../source/source"),_=t("./style_spec"),g=t("./style_function");e.exports=n,n.prototype=c.inherit(r,{_loaded:!1,_validateLayer:function(t){var e=this.sources[t.source];t.sourceLayer&&e&&e.vectorLayerIds&&-1===e.vectorLayerIds.indexOf(t.sourceLayer)&&this.fire("error",{error:new Error('Source layer "'+t.sourceLayer+'" does not exist on source "'+e.id+'" as specified by style layer "'+t.id+'"')})},loaded:function(){if(!this._loaded)return!1;for(var t in this.sources)if(!this.sources[t].loaded())return!1;return!this.sprite||this.sprite.loaded()},_resolve:function(){var t,e;this._layers={},this._order=this.stylesheet.layers.map(function(t){return t.id});for(var i=0;i<this.stylesheet.layers.length;i++)e=this.stylesheet.layers[i],e.ref||(t=o.create(e),this._layers[t.id]=t,t.on("error",this._forwardLayerEvent));for(var n=0;n<this.stylesheet.layers.length;n++)if(e=this.stylesheet.layers[n],e.ref){var r=this.getLayer(e.ref);t=o.create(e,r),this._layers[t.id]=t,t.on("error",this._forwardLayerEvent)}this._groupLayers(),this._updateWorkerLayers()},_groupLayers:function(){var t;this._groups=[];for(var e=0;e<this._order.length;++e){var i=this._layers[this._order[e]];t&&i.source===t.source||(t=[],t.source=i.source,this._groups.push(t)),t.push(i)}},_updateWorkerLayers:function(t){this.dispatcher.broadcast(t?"update layers":"set layers",this._serializeLayers(t))},_serializeLayers:function(t){t=t||this._order;for(var e=[],i={includeRefProperties:!0},n=0;n<t.length;n++)e.push(this._layers[t[n]].serialize(i));return e},_applyClasses:function(t,e){if(this._loaded){t=t||[],e=e||{transition:!0};var i=this.stylesheet.transition||{},n=this._updates.allPaintProps?this._layers:this._updates.paintProps;for(var r in n){var o=this._layers[r],a=this._updates.paintProps[r];if(this._updates.allPaintProps||a.all)o.updatePaintTransitions(t,e,i,this.animationLoop);else for(var s in a)this._layers[r].updatePaintTransition(s,t,e,i,this.animationLoop)}}},_recalculate:function(t){for(var e in this.sources)this.sources[e].used=!1;this._updateZoomHistory(t),this.rasterFadeDuration=300;for(var i in this._layers){var n=this._layers[i];n.recalculate(t,this.zoomHistory),!n.isHidden(t)&&n.source&&(this.sources[n.source].used=!0)}var r=300;Math.floor(this.z)!==Math.floor(t)&&this.animationLoop.set(r),this.z=t,this.fire("zoom")},_updateZoomHistory:function(t){var e=this.zoomHistory;void 0===e.lastIntegerZoom&&(e.lastIntegerZoom=Math.floor(t),e.lastIntegerZoomTime=0,e.lastZoom=t),Math.floor(e.lastZoom)<Math.floor(t)?(e.lastIntegerZoom=Math.floor(t),e.lastIntegerZoomTime=Date.now()):Math.floor(e.lastZoom)>Math.floor(t)&&(e.lastIntegerZoom=Math.floor(t+1),e.lastIntegerZoomTime=Date.now()),e.lastZoom=t},_checkLoaded:function(){if(!this._loaded)throw new Error("Style is not done loading")},update:function(t,e){if(!this._updates.changed)return this;if(this._updates.allLayers)this._groupLayers(),this._updateWorkerLayers();else{var i=Object.keys(this._updates.layers);i.length&&this._updateWorkerLayers(i)}var n=Object.keys(this._updates.sources),r;for(r=0;r<n.length;r++)this._reloadSource(n[r]);for(r=0;r<this._updates.events.length;r++){var o=this._updates.events[r];this.fire(o[0],o[1])}return this._applyClasses(t,e),this._updates.changed&&this.fire("change"),this._resetUpdates(),this},_resetUpdates:function(){this._updates={events:[],layers:{},sources:{},paintProps:{}}},addSource:function(t,e){if(this._checkLoaded(),void 0!==this.sources[t])throw new Error("There is already a source with this ID");return!y.is(e)&&this._handleErrors(v.source,"sources."+t,e)?this:(e=y.create(e),this.sources[t]=e,e.id=t,e.style=this,e.dispatcher=this.dispatcher,e.on("load",this._forwardSourceEvent).on("error",this._forwardSourceEvent).on("change",this._forwardSourceEvent).on("tile.add",this._forwardTileEvent).on("tile.load",this._forwardTileEvent).on("tile.error",this._forwardTileEvent).on("tile.remove",this._forwardTileEvent).on("tile.stats",this._forwardTileEvent),this._updates.events.push(["source.add",{source:e}]),this._updates.changed=!0,this)},removeSource:function(t){if(this._checkLoaded(),void 0===this.sources[t])throw new Error("There is no source with this ID");var e=this.sources[t];return delete this.sources[t],e.off("load",this._forwardSourceEvent).off("error",this._forwardSourceEvent).off("change",this._forwardSourceEvent).off("tile.add",this._forwardTileEvent).off("tile.load",this._forwardTileEvent).off("tile.error",this._forwardTileEvent).off("tile.remove",this._forwardTileEvent).off("tile.stats",this._forwardTileEvent),this._updates.events.push(["source.remove",{source:e}]),this._updates.changed=!0,this},getSource:function(t){return this.sources[t]},addLayer:function(t,e){if(this._checkLoaded(),!(t instanceof o)){if(this._handleErrors(v.layer,"layers."+t.id,t,!1,{arrayIndex:-1}))return this;var i=t.ref&&this.getLayer(t.ref);t=o.create(t,i)}return this._validateLayer(t),t.on("error",this._forwardLayerEvent),this._layers[t.id]=t,this._order.splice(e?this._order.indexOf(e):1/0,0,t.id),this._updates.allLayers=!0,t.source&&(this._updates.sources[t.source]=!0),this._updates.events.push(["layer.add",{layer:t}]),this.updateClasses(t.id)},removeLayer:function(t){this._checkLoaded();var e=this._layers[t];if(void 0===e)throw new Error("There is no layer with this ID");for(var i in this._layers)this._layers[i].ref===t&&this.removeLayer(i);return e.off("error",this._forwardLayerEvent),delete this._layers[t],this._order.splice(this._order.indexOf(t),1),this._updates.allLayers=!0,this._updates.events.push(["layer.remove",{layer:e}]),this._updates.changed=!0,this},getLayer:function(t){return this._layers[t]},getReferentLayer:function(t){var e=this.getLayer(t);return e.ref&&(e=this.getLayer(e.ref)),e},setLayerZoomRange:function(t,e,i){this._checkLoaded();var n=this.getReferentLayer(t);return n.minzoom===e&&n.maxzoom===i?this:(null!=e&&(n.minzoom=e),null!=i&&(n.maxzoom=i),this._updateLayer(n))},setFilter:function(t,e){this._checkLoaded();var i=this.getReferentLayer(t);return this._handleErrors(v.filter,"layers."+i.id+".filter",e)?this:c.deepEqual(i.filter,e)?this:(i.filter=c.clone(e),this._updateLayer(i))},getFilter:function(t){return this.getReferentLayer(t).filter},setLayoutProperty:function(t,e,i){this._checkLoaded();var n=this.getReferentLayer(t);return c.deepEqual(n.getLayoutProperty(e),i)?this:(n.setLayoutProperty(e,i),this._updateLayer(n))},getLayoutProperty:function(t,e){return this.getReferentLayer(t).getLayoutProperty(e)},setPaintProperty:function(t,e,i,n){this._checkLoaded();var r=this.getLayer(t);if(c.deepEqual(r.getPaintProperty(e,n),i))return this;var o=r.isPaintValueFeatureConstant(e);r.setPaintProperty(e,i,n);var a=!(g.isFunctionDefinition(i)&&"$zoom"!==i.property&&void 0!==i.property);return a&&o||(this._updates.layers[t]=!0,r.source&&(this._updates.sources[r.source]=!0)),this.updateClasses(t,e)},getPaintProperty:function(t,e,i){return this.getLayer(t).getPaintProperty(e,i)},updateClasses:function(t,e){if(this._updates.changed=!0,t){var i=this._updates.paintProps;i[t]||(i[t]={}),i[t][e||"all"]=!0}else this._updates.allPaintProps=!0;return this},serialize:function(){return c.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:c.mapObject(this.sources,function(t){return t.serialize()}),layers:this._order.map(function(t){return this._layers[t].serialize()},this)},function(t){return void 0!==t})},_updateLayer:function(t){return this._updates.layers[t.id]=!0,t.source&&(this._updates.sources[t.source]=!0),this._updates.changed=!0,this},_flattenRenderedFeatures:function(t){for(var e=[],i=this._order.length-1;i>=0;i--)for(var n=this._order[i],r=0;r<t.length;r++){var o=t[r][n];if(o)for(var a=0;a<o.length;a++)e.push(o[a])}return e},queryRenderedFeatures:function(t,e,i,n){e&&e.filter&&this._handleErrors(v.filter,"queryRenderedFeatures.filter",e.filter,!0);var r=[];for(var o in this.sources){var a=this.sources[o];a.queryRenderedFeatures&&r.push(a.queryRenderedFeatures(t,e,i,n))}return this._flattenRenderedFeatures(r)},querySourceFeatures:function(t,e){e&&e.filter&&this._handleErrors(v.filter,"querySourceFeatures.filter",e.filter,!0);var i=this.getSource(t);return i&&i.querySourceFeatures?i.querySourceFeatures(e):[]},_handleErrors:function(t,e,i,n,r){var o=n?v.throwErrors:v.emitErrors,a=t.call(v,c.extend({key:e,style:this.serialize(),value:i,styleSpec:_},r));return o.call(v,this,a)},_remove:function(){this.dispatcher.remove()},_reloadSource:function(t){this.sources[t].reload()},_updateSources:function(t){for(var e in this.sources)this.sources[e].update(t)},_redoPlacement:function(){for(var t in this.sources)this.sources[t].redoPlacement&&this.sources[t].redoPlacement()},_forwardSourceEvent:function(t){this.fire("source."+t.type,c.extend({source:t.target},t))},_forwardTileEvent:function(t){this.fire(t.type,c.extend({source:t.target},t))},_forwardLayerEvent:function(t){this.fire("layer."+t.type,c.extend({layer:{id:t.target.id}},t))},"get sprite json":function(t,e){var i=this.sprite;i.loaded()?e(null,{sprite:i.data,retina:i.retina}):i.on("load",function(){e(null,{sprite:i.data,retina:i.retina})})},"get icons":function(t,e){var i=this.sprite,n=this.spriteAtlas;i.loaded()?(n.setSprite(i),n.addIcons(t.icons,e)):i.on("load",function(){n.setSprite(i),n.addIcons(t.icons,e)})},"get glyphs":function(t,e){function i(t,i,n){t&&console.error(t),o[n]=i,r--,0===r&&e(null,o)}var n=t.stacks,r=Object.keys(n).length,o={};for(var a in n)this.glyphSource.getSimpleGlyphs(a,n[a],t.uid,i)}})},{"../render/line_atlas":78,"../source/source":87,"../symbol/glyph_source":119,"../symbol/sprite_atlas":124,"../util/ajax":142,"../util/browser":143,"../util/dispatcher":145,"../util/evented":149,"../util/mapbox":154,"../util/util":157,"./animation_loop":95,"./image_sprite":96,"./style_function":100,"./style_layer":101,"./style_spec":108,"./validate_style":110}],99:[function(t,e,i){"use strict";function n(t,e){this.type=t.type,this.transitionable=t.transition,this.value=s.clone(e),this.isFunction=!!e.stops,this.json=JSON.stringify(this.value);var i="color"===this.type?a(this.value):e;if(this.calculate=o[t["function"]||"piecewise-constant"](i),this.isFeatureConstant=this.calculate.isFeatureConstant,this.isZoomConstant=this.calculate.isZoomConstant,"piecewise-constant"===t["function"]&&t.transition&&(this.calculate=r(this.calculate)),!this.isFeatureConstant&&!this.isZoomConstant){this.stopZoomLevels=[];for(var n=[],l=this.value.stops,u=0;u<this.value.stops.length;u++){var c=l[u][0].zoom;this.stopZoomLevels.indexOf(c)<0&&(this.stopZoomLevels.push(c),n.push([c,n.length]))}this.calculateInterpolationT=o.interpolated({stops:n,base:e.base})}}function r(t){return function(e,i){var n=e.zoom,r=e.zoomHistory,o=e.duration,a=n%1,s=Math.min((Date.now()-r.lastIntegerZoomTime)/o,1),l=1,u=1,c,h,f;return n>r.lastIntegerZoom?(c=a+(1-a)*s,l*=2,h=t({zoom:n-1},i),f=t({zoom:n},i)):(c=1-(1-s)*a,f=t({zoom:n},i),h=t({zoom:n+1},i),l/=2),{from:h,fromScale:l,to:f,toScale:u,t:c}}}var o=t("./style_function"),a=t("./parse_color"),s=t("../util/util");e.exports=n},{"../util/util":157,"./parse_color":97,"./style_function":100}],100:[function(t,e,i){"use strict";var n=t("mapbox-gl-function");i.interpolated=function(t){var e=n.interpolated(t),i=function(t,i){return e(t&&t.zoom,i||{})};return i.isFeatureConstant=e.isFeatureConstant,i.isZoomConstant=e.isZoomConstant,i},i["piecewise-constant"]=function(t){var e=n["piecewise-constant"](t),i=function(t,i){return e(t&&t.zoom,i||{})};return i.isFeatureConstant=e.isFeatureConstant,i.isZoomConstant=e.isZoomConstant,i},i.isFunctionDefinition=n.isFunctionDefinition},{"mapbox-gl-function":28}],101:[function(t,e,i){"use strict";function n(t,e){this.set(t,e)}function r(t){return t.value}var o=t("../util/util"),a=t("./style_transition"),s=t("./style_declaration"),l=t("./style_spec"),u=t("./validate_style"),c=t("./parse_color"),h=t("../util/evented");e.exports=n;var f="-transition";n.create=function(e,i){var n={background:t("./style_layer/background_style_layer"),circle:t("./style_layer/circle_style_layer"),fill:t("./style_layer/fill_style_layer"),line:t("./style_layer/line_style_layer"),raster:t("./style_layer/raster_style_layer"),symbol:t("./style_layer/symbol_style_layer")};return new n[(i||e).type](e,i)},n.prototype=o.inherit(h,{set:function(t,e){this.id=t.id,this.ref=t.ref,this.metadata=t.metadata,this.type=(e||t).type,this.source=(e||t).source,this.sourceLayer=(e||t)["source-layer"],this.minzoom=(e||t).minzoom,this.maxzoom=(e||t).maxzoom,this.filter=(e||t).filter,this.paint={},this.layout={},this._paintSpecifications=l["paint_"+this.type],this._layoutSpecifications=l["layout_"+this.type],this._paintTransitions={},this._paintTransitionOptions={},this._paintDeclarations={},this._layoutDeclarations={},this._layoutFunctions={};var i,n;for(var r in t){var o=r.match(/^paint(?:\.(.*))?$/);if(o){var a=o[1]||"";for(i in t[r])this.setPaintProperty(i,t[r][i],a)}}if(this.ref)this._layoutDeclarations=e._layoutDeclarations;else for(n in t.layout)this.setLayoutProperty(n,t.layout[n]);for(i in this._paintSpecifications)this.paint[i]=this.getPaintValue(i);for(n in this._layoutSpecifications)this._updateLayoutValue(n)},setLayoutProperty:function(t,e){if(null==e)delete this._layoutDeclarations[t];else{var i="layers."+this.id+".layout."+t;if(this._handleErrors(u.layoutProperty,i,t,e))return;this._layoutDeclarations[t]=new s(this._layoutSpecifications[t],e)}this._updateLayoutValue(t)},getLayoutProperty:function(t){return this._layoutDeclarations[t]&&this._layoutDeclarations[t].value},getLayoutValue:function(t,e,i){var n=this._layoutSpecifications[t],r=this._layoutDeclarations[t];return r?r.calculate(e,i):n["default"]},setPaintProperty:function(t,e,i){var n="layers."+this.id+(i?'["paint.'+i+'"].':".paint.")+t;if(o.endsWith(t,f))if(this._paintTransitionOptions[i||""]||(this._paintTransitionOptions[i||""]={}),null===e||void 0===e)delete this._paintTransitionOptions[i||""][t];else{if(this._handleErrors(u.paintProperty,n,t,e))return;this._paintTransitionOptions[i||""][t]=e}else if(this._paintDeclarations[i||""]||(this._paintDeclarations[i||""]={}),null===e||void 0===e)delete this._paintDeclarations[i||""][t];else{if(this._handleErrors(u.paintProperty,n,t,e))return;this._paintDeclarations[i||""][t]=new s(this._paintSpecifications[t],e)}},getPaintProperty:function(t,e){return e=e||"",o.endsWith(t,f)?this._paintTransitionOptions[e]&&this._paintTransitionOptions[e][t]:this._paintDeclarations[e]&&this._paintDeclarations[e][t]&&this._paintDeclarations[e][t].value},getPaintValue:function(t,e,i){var n=this._paintSpecifications[t],r=this._paintTransitions[t];return r?r.calculate(e,i):"color"===n.type&&n["default"]?c(n["default"]):n["default"]},getPaintValueStopZoomLevels:function(t){var e=this._paintTransitions[t];return e?e.declaration.stopZoomLevels:[]},getPaintInterpolationT:function(t,e){var i=this._paintTransitions[t];return i.declaration.calculateInterpolationT({zoom:e})},isPaintValueFeatureConstant:function(t){var e=this._paintTransitions[t];return e?e.declaration.isFeatureConstant:!0},isPaintValueZoomConstant:function(t){var e=this._paintTransitions[t];return e?e.declaration.isZoomConstant:!0},isHidden:function(t){return this.minzoom&&t<this.minzoom?!0:this.maxzoom&&t>=this.maxzoom?!0:"none"===this.layout.visibility?!0:0===this.paint[this.type+"-opacity"];
},updatePaintTransitions:function(t,e,i,n){for(var r=o.extend({},this._paintDeclarations[""]),a=0;a<t.length;a++)o.extend(r,this._paintDeclarations[t[a]]);var s;for(s in r)this._applyPaintDeclaration(s,r[s],e,i,n);for(s in this._paintTransitions)s in r||this._applyPaintDeclaration(s,null,e,i,n)},updatePaintTransition:function(t,e,i,n,r){for(var o=this._paintDeclarations[""][t],a=0;a<e.length;a++){var s=this._paintDeclarations[e[a]];s&&s[t]&&(o=s[t])}this._applyPaintDeclaration(t,o,i,n,r)},recalculate:function(t,e){for(var i in this._paintTransitions)this.paint[i]=this.getPaintValue(i,{zoom:t,zoomHistory:e});for(var n in this._layoutFunctions)this.layout[n]=this.getLayoutValue(n,{zoom:t,zoomHistory:e})},serialize:function(t){var e={id:this.id,ref:this.ref,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom};for(var i in this._paintDeclarations){var n=""===i?"paint":"paint."+i;e[n]=o.mapObject(this._paintDeclarations[i],r)}return(!this.ref||t&&t.includeRefProperties)&&o.extend(e,{type:this.type,source:this.source,"source-layer":this.sourceLayer,filter:this.filter,layout:o.mapObject(this._layoutDeclarations,r)}),o.filterObject(e,function(t,e){return void 0!==t&&!("layout"===e&&!Object.keys(t).length)})},_applyPaintDeclaration:function(t,e,i,n,r){var l=i.transition?this._paintTransitions[t]:void 0;if(null===e||void 0===e){var u=this._paintSpecifications[t];e=new s(u,u["default"])}if(!l||l.declaration.json!==e.json){var c=o.extend({duration:300,delay:0},n,this.getPaintProperty(t+f)),h=this._paintTransitions[t]=new a(e,l,c);h.instant()||(h.loopID=r.set(h.endTime-Date.now())),l&&r.cancel(l.loopID)}},_updateLayoutValue:function(t){var e=this._layoutDeclarations[t];e&&e.isFunction?this._layoutFunctions[t]=!0:(delete this._layoutFunctions[t],this.layout[t]=this.getLayoutValue(t))},_handleErrors:function(t,e,i,n){return u.emitErrors(this,t.call(u,{key:e,layerType:this.type,objectKey:i,value:n,styleSpec:l,style:{glyphs:!0,sprite:!0}}))}})},{"../util/evented":149,"../util/util":157,"./parse_color":97,"./style_declaration":99,"./style_layer/background_style_layer":102,"./style_layer/circle_style_layer":103,"./style_layer/fill_style_layer":104,"./style_layer/line_style_layer":105,"./style_layer/raster_style_layer":106,"./style_layer/symbol_style_layer":107,"./style_spec":108,"./style_transition":109,"./validate_style":110}],102:[function(t,e,i){"use strict";function n(){o.apply(this,arguments)}var r=t("../../util/util"),o=t("../style_layer");e.exports=n,n.prototype=r.inherit(o,{})},{"../../util/util":157,"../style_layer":101}],103:[function(t,e,i){"use strict";function n(){o.apply(this,arguments)}var r=t("../../util/util"),o=t("../style_layer");e.exports=n,n.prototype=r.inherit(o,{})},{"../../util/util":157,"../style_layer":101}],104:[function(t,e,i){"use strict";function n(){o.apply(this,arguments)}var r=t("../../util/util"),o=t("../style_layer");e.exports=n,n.prototype=r.inherit(o,{})},{"../../util/util":157,"../style_layer":101}],105:[function(t,e,i){"use strict";function n(){o.apply(this,arguments)}var r=t("../../util/util"),o=t("../style_layer");e.exports=n,n.prototype=r.inherit(o,{getPaintValue:function(t,e,i){var n=o.prototype.getPaintValue.apply(this,arguments);if(n&&"line-dasharray"===t){var r=Math.floor(e.zoom);this._flooredZoom!==r&&(this._flooredZoom=r,this._flooredLineWidth=this.getPaintValue("line-width",e,i)),n.fromScale*=this._flooredLineWidth,n.toScale*=this._flooredLineWidth}return n}})},{"../../util/util":157,"../style_layer":101}],106:[function(t,e,i){"use strict";function n(){o.apply(this,arguments)}var r=t("../../util/util"),o=t("../style_layer");e.exports=n,n.prototype=r.inherit(o,{})},{"../../util/util":157,"../style_layer":101}],107:[function(t,e,i){"use strict";function n(){o.apply(this,arguments)}var r=t("../../util/util"),o=t("../style_layer");e.exports=n,n.prototype=r.inherit(o,{isHidden:function(){if(o.prototype.isHidden.apply(this,arguments))return!0;var t=0===this.paint["text-opacity"]||!this.layout["text-field"],e=0===this.paint["icon-opacity"]||!this.layout["icon-image"];return!(!t||!e)},getLayoutValue:function(t,e,i){return("text-rotation-alignment"!==t||"line"!==this.getLayoutValue("symbol-placement",e,i)||this.getLayoutProperty("text-rotation-alignment"))&&("icon-rotation-alignment"!==t||"line"!==this.getLayoutValue("symbol-placement",e,i)||this.getLayoutProperty("icon-rotation-alignment"))?o.prototype.getLayoutValue.apply(this,arguments):"map"}})},{"../../util/util":157,"../style_layer":101}],108:[function(t,e,i){"use strict";e.exports=t("mapbox-gl-style-spec/reference/latest")},{"mapbox-gl-style-spec/reference/latest":51}],109:[function(t,e,i){"use strict";function n(t,e,i){this.declaration=t,this.startTime=this.endTime=(new Date).getTime();var n=t.type;"string"!==n&&"array"!==n||!t.transitionable?this.interp=a[n]:this.interp=r,this.oldTransition=e,this.duration=i.duration||0,this.delay=i.delay||0,this.instant()||(this.endTime=this.startTime+this.duration+this.delay,this.ease=o.easeCubicInOut),e&&e.endTime<=this.startTime&&delete e.oldTransition}function r(t,e,i){return{from:t.to,fromScale:t.toScale,to:e.to,toScale:e.toScale,t:i}}var o=t("../util/util"),a=t("../util/interpolate");e.exports=n,n.prototype.instant=function(){return!this.oldTransition||!this.interp||0===this.duration&&0===this.delay},n.prototype.calculate=function(t,e){var i=this.declaration.calculate(o.extend({},t,{duration:this.duration}),e);if(this.instant())return i;var n=t.time||Date.now();if(n<this.endTime){var r=this.oldTransition.calculate(o.extend({},t,{time:this.startTime}),e),a=this.ease((n-this.startTime-this.delay)/this.duration);i=this.interp(r,i,a)}return i}},{"../util/interpolate":151,"../util/util":157}],110:[function(t,e,i){"use strict";e.exports=t("mapbox-gl-style-spec/lib/validate_style.min"),e.exports.emitErrors=function n(t,e){if(e&&e.length){for(var i=0;i<e.length;i++)t.fire("error",{error:new Error(e[i].message)});return!0}return!1},e.exports.throwErrors=function r(t,e){if(e)for(var i=0;i<e.length;i++)throw new Error(e[i].message)}},{"mapbox-gl-style-spec/lib/validate_style.min":50}],111:[function(t,e,i){"use strict";function n(t,e,i,n){this.x=t,this.y=e,this.angle=i,void 0!==n&&(this.segment=n)}var r=t("point-geometry");e.exports=n,n.prototype=Object.create(r.prototype),n.prototype.clone=function(){return new n(this.x,this.y,this.angle,this.segment)}},{"point-geometry":161}],112:[function(t,e,i){"use strict";function n(t,e,i,n,r){if(void 0===e.segment)return!0;for(var o=e,a=e.segment+1,s=0;s>-i/2;){if(a--,0>a)return!1;s-=t[a].dist(o),o=t[a]}s+=t[a].dist(t[a+1]),a++;for(var l=[],u=0;i/2>s;){var c=t[a-1],h=t[a],f=t[a+1];if(!f)return!1;var d=c.angleTo(h)-h.angleTo(f);for(d=Math.abs((d+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:s,angleDelta:d}),u+=d;s-l[0].distance>n;)u-=l.shift().angleDelta;if(u>r)return!1;a++,s+=h.dist(f)}return!0}e.exports=n},{}],113:[function(t,e,i){"use strict";function n(t,e,i,n,o){for(var a=[],s=0;s<t.length;s++)for(var l=t[s],u,c=0;c<l.length-1;c++){var h=l[c],f=l[c+1];h.x<e&&f.x<e||(h.x<e?h=new r(e,h.y+(f.y-h.y)*((e-h.x)/(f.x-h.x)))._round():f.x<e&&(f=new r(e,h.y+(f.y-h.y)*((e-h.x)/(f.x-h.x)))._round()),h.y<i&&f.y<i||(h.y<i?h=new r(h.x+(f.x-h.x)*((i-h.y)/(f.y-h.y)),i)._round():f.y<i&&(f=new r(h.x+(f.x-h.x)*((i-h.y)/(f.y-h.y)),i)._round()),h.x>=n&&f.x>=n||(h.x>=n?h=new r(n,h.y+(f.y-h.y)*((n-h.x)/(f.x-h.x)))._round():f.x>=n&&(f=new r(n,h.y+(f.y-h.y)*((n-h.x)/(f.x-h.x)))._round()),h.y>=o&&f.y>=o||(h.y>=o?h=new r(h.x+(f.x-h.x)*((o-h.y)/(f.y-h.y)),o)._round():f.y>=o&&(f=new r(h.x+(f.x-h.x)*((o-h.y)/(f.y-h.y)),o)._round()),u&&h.equals(u[u.length-1])||(u=[h],a.push(u)),u.push(f)))))}return a}var r=t("point-geometry");e.exports=n},{"point-geometry":161}],114:[function(t,e,i){"use strict";var n=t("../util/struct_array"),r=t("../util/util"),o=t("point-geometry"),a=e.exports=new 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"}]});r.extendAll(a.prototype.StructType.prototype,{get anchorPoint(){return new o(this.anchorPointX,this.anchorPointY)}})},{"../util/struct_array":155,"../util/util":157,"point-geometry":161}],115:[function(t,e,i){"use strict";function n(t,e,i,n,r,o,a,s,l,u,c){var h=a.top*s-l,f=a.bottom*s+l,d=a.left*s-l,p=a.right*s+l;if(this.boxStartIndex=t.length,u){var m=f-h,v=p-d;if(m>0)if(m=Math.max(10*s,m),c){var y=e[i.segment+1].sub(e[i.segment])._unit()._mult(v),_=[i.sub(y),i.add(y)];this._addLineCollisionBoxes(t,_,i,0,v,m,n,r,o)}else this._addLineCollisionBoxes(t,e,i,i.segment,v,m,n,r,o)}else t.emplaceBack(i.x,i.y,d,h,p,f,1/0,n,r,o,0,0,0,0,0);this.boxEndIndex=t.length}e.exports=n,n.prototype._addLineCollisionBoxes=function(t,e,i,n,r,o,a,s,l){var u=o/2,c=Math.floor(r/u),h=-o/2,f=this.boxes,d=i,p=n+1,m=h;do{if(p--,0>p)return f;m-=e[p].dist(d),d=e[p]}while(m>-r/2);for(var v=e[p].dist(e[p+1]),y=0;c>y;y++){for(var _=-r/2+y*u;_>m+v;){if(m+=v,p++,p+1>=e.length)return f;v=e[p].dist(e[p+1])}var g=_-m,x=e[p],b=e[p+1],w=b.sub(x)._unit()._mult(g)._add(x)._round(),M=Math.max(Math.abs(_-h)-u/2,0),S=r/2/M;t.emplaceBack(w.x,w.y,-o/2,-o/2,o/2,o/2,S,a,s,l,0,0,0,0,0)}return f}},{}],116:[function(t,e,i){"use strict";function n(t,e,i){if("object"==typeof t){var n=t;i=e,t=n.angle,e=n.pitch,this.grid=new a(n.grid),this.ignoredGrid=new a(n.ignoredGrid)}else this.grid=new a(o,12,6),this.ignoredGrid=new a(o,12,0);this.angle=t,this.pitch=e;var r=Math.sin(t),s=Math.cos(t);if(this.rotationMatrix=[s,-r,r,s],this.reverseRotationMatrix=[s,r,-r,s],this.yStretch=1/Math.cos(e/180*Math.PI),this.yStretch=Math.pow(this.yStretch,1.3),this.collisionBoxArray=i,0===i.length){i.emplaceBack();var l=32767;i.emplaceBack(0,0,0,-l,0,l,l,0,0,0,0,0,0,0,0,0),i.emplaceBack(o,0,0,-l,0,l,l,0,0,0,0,0,0,0,0,0),i.emplaceBack(0,0,-l,0,l,0,l,0,0,0,0,0,0,0,0,0),i.emplaceBack(0,o,-l,0,l,0,l,0,0,0,0,0,0,0,0,0)}this.tempCollisionBox=i.get(0),this.edges=[i.get(1),i.get(2),i.get(3),i.get(4)]}var r=t("point-geometry"),o=t("../data/bucket").EXTENT,a=t("grid-index");e.exports=n,n.prototype.serialize=function(){var t={angle:this.angle,pitch:this.pitch,grid:this.grid.toArrayBuffer(),ignoredGrid:this.ignoredGrid.toArrayBuffer()};return{data:t,transferables:[t.grid,t.ignoredGrid]}},n.prototype.minScale=.25,n.prototype.maxScale=2,n.prototype.placeCollisionFeature=function(t,e,i){for(var n=this.collisionBoxArray,o=this.minScale,a=this.rotationMatrix,s=this.yStretch,l=t.boxStartIndex;l<t.boxEndIndex;l++){var u=n.get(l),c=u.anchorPoint._matMult(a),h=c.x,f=c.y,d=h+u.x1,p=f+u.y1*s,m=h+u.x2,v=f+u.y2*s;if(u.bbox0=d,u.bbox1=p,u.bbox2=m,u.bbox3=v,!e)for(var y=this.grid.query(d,p,m,v),_=0;_<y.length;_++){var g=n.get(y[_]),x=g.anchorPoint._matMult(a);if(o=this.getPlacementScale(o,c,u,x,g),o>=this.maxScale)return o}if(i){var b;if(this.angle){var w=this.reverseRotationMatrix,M=new r(u.x1,u.y1).matMult(w),S=new r(u.x2,u.y1).matMult(w),E=new r(u.x1,u.y2).matMult(w),T=new r(u.x2,u.y2).matMult(w);b=this.tempCollisionBox,b.anchorPointX=u.anchorPoint.x,b.anchorPointY=u.anchorPoint.y,b.x1=Math.min(M.x,S.x,E.x,T.x),b.y1=Math.min(M.y,S.x,E.x,T.x),b.x2=Math.max(M.x,S.x,E.x,T.x),b.y2=Math.max(M.y,S.x,E.x,T.x),b.maxScale=u.maxScale}else b=u;for(var I=0;I<this.edges.length;I++){var D=this.edges[I];if(o=this.getPlacementScale(o,u.anchorPoint,b,D.anchorPoint,D),o>=this.maxScale)return o}}}return o},n.prototype.queryRenderedSymbols=function(t,e,i,n,o){var a={},s=[],l=this.collisionBoxArray,u=this.rotationMatrix,c=new r(t,e)._matMult(u),h=this.tempCollisionBox;h.anchorX=c.x,h.anchorY=c.y,h.x1=0,h.y1=0,h.x2=i-t,h.y2=n-e,h.maxScale=o,o=h.maxScale;for(var f=[c.x+h.x1/o,c.y+h.y1/o*this.yStretch,c.x+h.x2/o,c.y+h.y2/o*this.yStretch],d=this.grid.query(f[0],f[1],f[2],f[3]),p=this.ignoredGrid.query(f[0],f[1],f[2],f[3]),m=0;m<p.length;m++)d.push(p[m]);for(var v=0;v<d.length;v++){var y=l.get(d[v]),_=y.sourceLayerIndex,g=y.featureIndex;if(void 0===a[_]&&(a[_]={}),!a[_][g]){var x=y.anchorPoint.matMult(u),b=this.getPlacementScale(this.minScale,c,h,x,y);b>=o&&(a[_][g]=!0,s.push(d[v]))}}return s},n.prototype.getPlacementScale=function(t,e,i,n,r){var o=e.x-n.x,a=e.y-n.y,s=(r.x1-i.x2)/o,l=(r.x2-i.x1)/o,u=(r.y1-i.y2)*this.yStretch/a,c=(r.y2-i.y1)*this.yStretch/a;(isNaN(s)||isNaN(l))&&(s=l=1),(isNaN(u)||isNaN(c))&&(u=c=1);var h=Math.min(Math.max(s,l),Math.max(u,c)),f=r.maxScale,d=i.maxScale;return h>f&&(h=f),h>d&&(h=d),h>t&&h>=r.placementScale&&(t=h),t},n.prototype.insertCollisionFeature=function(t,e,i){for(var n=i?this.ignoredGrid:this.grid,r=this.collisionBoxArray,o=t.boxStartIndex;o<t.boxEndIndex;o++){var a=r.get(o);a.placementScale=e,e<this.maxScale&&n.insert(o,a.bbox0,a.bbox1,a.bbox2,a.bbox3)}}},{"../data/bucket":55,"grid-index":22,"point-geometry":161}],117:[function(t,e,i){"use strict";function n(t,e,i,n,o,a,s,l,u){var c=n?.6*a*s:0,h=Math.max(n?n.right-n.left:0,o?o.right-o.left:0),f=0===t[0].x||t[0].x===u||0===t[0].y||t[0].y===u;e/4>e-h*s&&(e=h*s+e/4);var d=2*a,p=f?e/2*l%e:(h/2+d)*s*l%e;return r(t,p,e,c,i,h*s,f,!1,u)}function r(t,e,i,n,l,u,c,h,f){for(var d=u/2,p=0,m=0;m<t.length-1;m++)p+=t[m].dist(t[m+1]);for(var v=0,y=e-i,_=[],g=0;g<t.length-1;g++){for(var x=t[g],b=t[g+1],w=x.dist(b),M=b.angleTo(x);v+w>y+i;){y+=i;var S=(y-v)/w,E=o(x.x,b.x,S),T=o(x.y,b.y,S);if(E>=0&&f>E&&T>=0&&f>T&&y-d>=0&&p>=y+d){var I=new a(E,T,M,g)._round();n&&!s(t,I,u,n,l)||_.push(I)}}v+=w}return h||_.length||c||(_=r(t,v/2,i,n,l,u,c,!0,f)),_}var o=t("../util/interpolate"),a=t("../symbol/anchor"),s=t("./check_max_angle");e.exports=n},{"../symbol/anchor":111,"../util/interpolate":151,"./check_max_angle":112}],118:[function(t,e,i){"use strict";function n(t,e){this.width=t,this.height=e,this.bin=new r(t,e),this.index={},this.ids={},this.data=new Uint8Array(t*e)}var r=t("shelf-pack");e.exports=n,n.prototype.getGlyphs=function(){var t={},e,i,n;for(var r in this.ids)e=r.split("#"),i=e[0],n=e[1],t[i]||(t[i]=[]),t[i].push(n);return t},n.prototype.getRects=function(){var t={},e,i,n;for(var r in this.ids)e=r.split("#"),i=e[0],n=e[1],t[i]||(t[i]={}),t[i][n]=this.index[r];return t},n.prototype.addGlyph=function(t,e,i,n){if(!i)return null;var r=e+"#"+i.id;if(this.index[r])return this.ids[r].indexOf(t)<0&&this.ids[r].push(t),this.index[r];if(!i.bitmap)return null;var o=i.width+2*n,a=i.height+2*n,s=1,l=o+2*s,u=a+2*s;l+=4-l%4,u+=4-u%4;var c=this.bin.packOne(l,u);if(c||(this.resize(),c=this.bin.packOne(l,u)),!c)return console.warn("glyph bitmap overflow"),null;this.index[r]=c,this.ids[r]=[t];for(var h=this.data,f=i.bitmap,d=0;a>d;d++)for(var p=this.width*(c.y+d+s)+c.x+s,m=o*d,v=0;o>v;v++)h[p+v]=f[m+v];return this.dirty=!0,c},n.prototype.resize=function(){var t=this.width,e=this.height;if(!(t>512||e>512)){this.texture&&(this.gl&&this.gl.deleteTexture(this.texture),this.texture=null),this.width*=2,this.height*=2,this.bin.resize(this.width,this.height);for(var i=new ArrayBuffer(this.width*this.height),n,r,o=0;e>o;o++)n=new Uint8Array(this.data.buffer,e*o,t),r=new Uint8Array(i,e*o*2,t),r.set(n);this.data=new Uint8Array(i)}},n.prototype.bind=function(t){this.gl=t,this.texture?t.bindTexture(t.TEXTURE_2D,this.texture):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),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.texImage2D(t.TEXTURE_2D,0,t.ALPHA,this.width,this.height,0,t.ALPHA,t.UNSIGNED_BYTE,null))},n.prototype.updateTexture=function(t){this.bind(t),this.dirty&&(t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width,this.height,t.ALPHA,t.UNSIGNED_BYTE,this.data),this.dirty=!1)}},{"shelf-pack":163}],119:[function(t,e,i){"use strict";function n(t){this.url=t&&a(t),this.atlases={},this.stacks={},this.loading={}}function r(t,e,i){var n=1;this.advance=t.advance,this.left=t.left-i-n,this.top=t.top+i+n,this.rect=e}function o(t,e,i,n){return n=n||"abc",i.replace("{s}",n[t.length%n.length]).replace("{fontstack}",t).replace("{range}",e)}var a=t("../util/mapbox").normalizeGlyphsURL,s=t("../util/ajax").getArrayBuffer,l=t("../util/glyphs"),u=t("../symbol/glyph_atlas"),c=t("pbf");e.exports=n,n.prototype.getSimpleGlyphs=function(t,e,i,n){void 0===this.stacks[t]&&(this.stacks[t]={}),void 0===this.atlases[t]&&(this.atlases[t]=new u(128,128));for(var o={},a=this.stacks[t],s=this.atlases[t],l=3,c={},h=0,f,d=0;d<e.length;d++){var p=e[d];if(f=Math.floor(p/256),a[f]){var m=a[f].glyphs[p],v=s.addGlyph(i,t,m,l);m&&(o[p]=new r(m,v,l))}else void 0===c[f]&&(c[f]=[],h++),c[f].push(p)}h||n(void 0,o,t);var y=function(e,a,u){if(!e)for(var f=this.stacks[t][a]=u.stacks[0],d=0;d<c[a].length;d++){var p=c[a][d],m=f.glyphs[p],v=s.addGlyph(i,t,m,l);m&&(o[p]=new r(m,v,l))}h--,h||n(void 0,o,t)}.bind(this);for(var _ in c)this.loadRange(t,_,y)},n.prototype.loadRange=function(t,e,i){if(256*e>65535)return i("glyphs > 65535 not supported");void 0===this.loading[t]&&(this.loading[t]={});var n=this.loading[t];if(n[e])n[e].push(i);else{n[e]=[i];var r=256*e+"-"+(256*e+255),a=o(t,r,this.url);s(a,function(t,i){for(var r=!t&&new l(new c(new Uint8Array(i))),o=0;o<n[e].length;o++)n[e][o](t,e,r);delete n[e]})}},n.prototype.getGlyphAtlas=function(t){return this.atlases[t]}},{"../symbol/glyph_atlas":118,"../util/ajax":142,"../util/glyphs":150,"../util/mapbox":154,pbf:160}],120:[function(t,e,i){"use strict";e.exports=function(t,e,i){function n(n){u.push(t[n]),c.push(i[n]),h.push(e[n]),f++}function r(t,e,i){var n=l[t];return delete l[t],l[e]=n,c[n][0].pop(),c[n][0]=c[n][0].concat(i[0]),n}function o(t,e,i){var n=s[e];return delete s[e],s[t]=n,c[n][0].shift(),c[n][0]=i[0].concat(c[n][0]),n}function a(t,e,i){var n=i?e[0][e[0].length-1]:e[0][0];return t+":"+n.x+":"+n.y}var s={},l={},u=[],c=[],h=[],f=0,d;for(d=0;d<t.length;d++){var p=i[d],m=e[d];if(m){var v=a(m,p),y=a(m,p,!0);if(v in l&&y in s&&l[v]!==s[y]){var _=o(v,y,p),g=r(v,y,c[_]);delete s[v],delete l[y],l[a(m,c[g],!0)]=g,c[_]=null}else v in l?r(v,y,p):y in s?o(v,y,p):(n(d),s[v]=f-1,l[y]=f-1)}else n(d)}return{features:u,textFeatures:h,geometries:c}}},{}],121:[function(t,e,i){"use strict";function n(t,e,i,n,r,o,a,s,l){this.anchorPoint=t,this.tl=e,this.tr=i,this.bl=n,this.br=r,this.tex=o,this.angle=a,this.minScale=s,this.maxScale=l}function r(t,e,i,r,o,a){var u=e.image.rect,c=1,h=e.left-c,f=h+u.w/e.image.pixelRatio,d=e.top-c,p=d+u.h/e.image.pixelRatio,m=new s(h,d),v=new s(f,d),y=new s(f,p),_=new s(h,p),g=o["icon-rotate"]*Math.PI/180;if(a){var x=r[t.segment];if(t.y===x.y&&t.x===x.x&&t.segment+1<r.length){var b=r[t.segment+1];g+=Math.atan2(t.y-b.y,t.x-b.x)+Math.PI}else g+=Math.atan2(t.y-x.y,t.x-x.x)}if(g){var w=Math.sin(g),M=Math.cos(g),S=[M,-w,w,M];m=m.matMult(S),v=v.matMult(S),_=_.matMult(S),y=y.matMult(S)}return[new n(new s(t.x,t.y),m,v,_,y,e.image.rect,0,l,1/0)]}function o(t,e,i,r,o,u){for(var c=o["text-rotate"]*Math.PI/180,h=o["text-keep-upright"],f=e.positionedGlyphs,d=[],p=0;p<f.length;p++){var m=f[p],v=m.glyph,y=v.rect;if(y){var _=(m.x+v.advance/2)*i,g,x=l;u?(g=[],x=a(g,t,_,r,t.segment,!0),h&&(x=Math.min(x,a(g,t,_,r,t.segment,!1)))):g=[{anchorPoint:new s(t.x,t.y),offset:0,angle:0,maxScale:1/0,minScale:l}];for(var b=m.x+v.left,w=m.y-v.top,M=b+y.w,S=w+y.h,E=new s(b,w),T=new s(M,w),I=new s(b,S),D=new s(M,S),z=0;z<g.length;z++){var P=g[z],L=E,F=T,A=I,k=D,R=P.angle+c;if(R){var C=Math.sin(R),O=Math.cos(R),j=[O,-C,C,O];L=L.matMult(j),F=F.matMult(j),A=A.matMult(j),k=k.matMult(j)}var B=Math.max(P.minScale,x),N=(t.angle+c+P.offset+2*Math.PI)%(2*Math.PI);d.push(new n(P.anchorPoint,L,F,A,k,y,N,B,P.maxScale))}}}return d}function a(t,e,i,n,r,o){var a=!o;0>i&&(o=!o),o&&r++;var u=new s(e.x,e.y),c=n[r],h=1/0;i=Math.abs(i);for(var f=l;;){var d=u.dist(c),p=i/d,m=Math.atan2(c.y-u.y,c.x-u.x);if(o||(m+=Math.PI),a&&(m+=Math.PI),t.push({anchorPoint:u,offset:a?Math.PI:0,minScale:p,maxScale:h,angle:(m+2*Math.PI)%(2*Math.PI)}),f>=p)break;for(u=c;u.equals(c);)if(r+=o?1:-1,c=n[r],!c)return p;var v=c.sub(u)._unit();u=u.sub(v._mult(d)),h=p}return f}var s=t("point-geometry");e.exports={getIconQuads:r,getGlyphQuads:o};var l=.5},{"point-geometry":161}],122:[function(t,e,i){"use strict";function n(t,e,i){for(var n=[],o=0,a=t.length;a>o;o++){var s=r(t[o].properties,e["text-field"]);if(s){s=s.toString();var l=e["text-transform"];"uppercase"===l?s=s.toLocaleUpperCase():"lowercase"===l&&(s=s.toLocaleLowerCase());for(var u=0;u<s.length;u++)i[s.charCodeAt(u)]=!0;n[o]=s}else n[o]=null}return n}var r=t("../util/token");e.exports=n},{"../util/token":156}],123:[function(t,e,i){"use strict";function n(t,e,i,n){this.codePoint=t,this.x=e,this.y=i,this.glyph=n}function r(t,e,i,n,r,o){this.positionedGlyphs=t,this.text=e,this.top=i,this.bottom=n,this.left=r,this.right=o}function o(t,e,i,o,s,l,u,c,h){for(var f=[],d=new r(f,t,h[1],h[1],h[0],h[0]),p=-17,m=0,v=p,y=0;y<t.length;y++){var _=t.charCodeAt(y),g=e[_];g&&(f.push(new n(_,m,v,g)),m+=g.advance+c)}return f.length?(a(d,e,o,i,s,l,u,h),d):!1}function a(t,e,i,n,r,o,a,u){var c=null,d=0,p=0,m=0,v=0,y=t.positionedGlyphs;if(n)for(var _=0;_<y.length;_++){var g=y[_];if(g.x-=d,g.y+=i*m,g.x>n&&null!==c){var x=y[c+1].x;v=Math.max(x,v);for(var b=c+1;_>=b;b++)y[b].y+=i,y[b].x-=x;if(a){var w=c;h[y[c].codePoint]&&w--,s(y,e,p,w,a)}p=c+1,c=null,d+=x,m++}f[g.codePoint]&&(c=_)}var M=y[y.length-1],S=M.x+e[M.codePoint].advance;v=Math.max(v,S);var E=(m+1)*i;s(y,e,p,y.length-1,a),l(y,a,r,o,v,i,m,u),t.top+=-o*E,t.bottom=t.top+E,t.left+=-r*v,t.right=t.left+v}function s(t,e,i,n,r){for(var o=e[t[n].codePoint].advance,a=(t[n].x+o)*r,s=i;n>=s;s++)t[s].x-=a}function l(t,e,i,n,r,o,a,s){for(var l=(e-i)*r+s[0],u=(-n*(a+1)+.5)*o+s[1],c=0;c<t.length;c++)t[c].x+=l,t[c].y+=u}function u(t,e){if(!t||!t.rect)return null;var i=e["icon-offset"][0],n=e["icon-offset"][1],r=i-t.width/2,o=r+t.width,a=n-t.height/2,s=a+t.height;return new c(t,a,s,r,o)}function c(t,e,i,n,r){this.image=t,this.top=e,this.bottom=i,this.left=n,this.right=r}e.exports={shapeText:o,shapeIcon:u};var h={32:!0,8203:!0},f={32:!0,38:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0}},{}],124:[function(t,e,i){"use strict";function n(t,e){this.width=t,this.height=e,this.bin=new a(t,e),this.images={},this.data=!1,this.texture=0,this.filter=0,this.pixelRatio=1,this.dirty=!0}function r(t,e,i,n,r,o,a,s,l,u,c){var h=n*e+i,f=s*o+a,d,p;if(c)for(f-=o,p=-1;u>=p;p++,h=((p+u)%u+n)*e+i,f+=o)for(d=-1;l>=d;d++)r[f+d]=t[h+(d+l)%l];else for(p=0;u>p;p++,h+=e,f+=o)for(d=0;l>d;d++)r[f+d]=t[h+d]}function o(t,e,i,n,r){this.rect=t,this.width=e,this.height=i,this.sdf=n,this.pixelRatio=r}var a=t("shelf-pack"),s=t("../util/browser");e.exports=n,n.prototype.allocateImage=function(t,e){t/=this.pixelRatio,e/=this.pixelRatio;var i=2,n=t+i+(4-(t+i)%4),r=e+i+(4-(e+i)%4),o=this.bin.packOne(n,r);return o?o:(console.warn("SpriteAtlas out of space."),null)},n.prototype.getImage=function(t,e){if(this.images[t])return this.images[t];if(!this.sprite)return null;var i=this.sprite.getSpritePosition(t);if(!i.width||!i.height)return null;var n=this.allocateImage(i.width,i.height);if(!n)return null;var r=new o(n,i.width/i.pixelRatio,i.height/i.pixelRatio,i.sdf,i.pixelRatio/this.pixelRatio);return this.images[t]=r,this.copy(n,i,e),r},n.prototype.getPosition=function(t,e){var i=this.getImage(t,e),n=i&&i.rect;if(!n)return null;var r=i.width*i.pixelRatio,o=i.height*i.pixelRatio,a=1;return{size:[i.width,i.height],tl:[(n.x+a)/this.width,(n.y+a)/this.height],br:[(n.x+a+r)/this.width,(n.y+a+o)/this.height]}},n.prototype.allocate=function(){if(!this.data){var t=Math.floor(this.width*this.pixelRatio),e=Math.floor(this.height*this.pixelRatio);this.data=new Uint32Array(t*e);for(var i=0;i<this.data.length;i++)this.data[i]=0}},n.prototype.copy=function(t,e,i){if(this.sprite.img.data){var n=new Uint32Array(this.sprite.img.data.buffer);this.allocate();var o=this.data,a=1;r(n,this.sprite.img.width,e.x,e.y,o,this.width*this.pixelRatio,(t.x+a)*this.pixelRatio,(t.y+a)*this.pixelRatio,e.width,e.height,i),this.dirty=!0}},n.prototype.setSprite=function(t){t&&(this.pixelRatio=s.devicePixelRatio>1?2:1,this.canvas&&(this.canvas.width=this.width*this.pixelRatio,this.canvas.height=this.height*this.pixelRatio)),this.sprite=t},n.prototype.addIcons=function(t,e){for(var i=0;i<t.length;i++)this.getImage(t[i]);e(null,this.images)},n.prototype.bind=function(t,e){var i=!1;this.texture?t.bindTexture(t.TEXTURE_2D,this.texture):(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),i=!0);var n=e?t.LINEAR:t.NEAREST;n!==this.filter&&(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,n),this.filter=n),this.dirty&&(this.allocate(),i?t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width*this.pixelRatio,this.height*this.pixelRatio,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array(this.data.buffer)):t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width*this.pixelRatio,this.height*this.pixelRatio,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array(this.data.buffer)),this.dirty=!1)}},{"../util/browser":143,"shelf-pack":163}],125:[function(t,e,i){"use strict";var n=t("../util/util"),r=t("../util/interpolate"),o=t("../util/browser"),a=t("../geo/lng_lat"),s=t("../geo/lng_lat_bounds"),l=t("point-geometry"),u=e.exports=function(){};n.extend(u.prototype,{getCenter:function(){return this.transform.center},setCenter:function(t,e){return this.jumpTo({center:t},e),this},panBy:function(t,e,i){return this.panTo(this.transform.center,n.extend({offset:l.convert(t).mult(-1)},e),i),this},panTo:function(t,e,i){return this.easeTo(n.extend({center:t},e),i)},getZoom:function(){return this.transform.zoom},setZoom:function(t,e){return this.jumpTo({zoom:t},e),this},zoomTo:function(t,e,i){return this.easeTo(n.extend({zoom:t},e),i)},zoomIn:function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},zoomOut:function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},getBearing:function(){return this.transform.bearing},setBearing:function(t,e){return this.jumpTo({bearing:t},e),this},rotateTo:function(t,e,i){return this.easeTo(n.extend({bearing:t},e),i)},resetNorth:function(t,e){return this.rotateTo(0,n.extend({duration:1e3},t),e),this},snapToNorth:function(t,e){return Math.abs(this.getBearing())<this.options.bearingSnap?this.resetNorth(t,e):this},getPitch:function(){return this.transform.pitch},setPitch:function(t,e){return this.jumpTo({pitch:t},e),this},fitBounds:function(t,e,i){e=n.extend({padding:0,offset:[0,0],maxZoom:1/0},e),t=s.convert(t);var r=l.convert(e.offset),o=this.transform,a=o.project(t.getNorthWest()),u=o.project(t.getSouthEast()),c=u.sub(a),h=(o.width-2*e.padding-2*Math.abs(r.x))/c.x,f=(o.height-2*e.padding-2*Math.abs(r.y))/c.y;return e.center=o.unproject(a.add(u).div(2)),e.zoom=Math.min(o.scaleZoom(o.scale*Math.min(h,f)),e.maxZoom),e.bearing=0,e.linear?this.easeTo(e,i):this.flyTo(e,i)},jumpTo:function(t,e){this.stop();var i=this.transform,n=!1,r=!1,o=!1;return"zoom"in t&&i.zoom!==+t.zoom&&(n=!0,i.zoom=+t.zoom),"center"in t&&(i.center=a.convert(t.center)),"bearing"in t&&i.bearing!==+t.bearing&&(r=!0,i.bearing=+t.bearing),"pitch"in t&&i.pitch!==+t.pitch&&(o=!0,i.pitch=+t.pitch),this.fire("movestart",e).fire("move",e),n&&this.fire("zoomstart",e).fire("zoom",e).fire("zoomend",e),r&&this.fire("rotate",e),o&&this.fire("pitch",e),this.fire("moveend",e)},easeTo:function(t,e){this.stop(),t=n.extend({offset:[0,0],duration:500,easing:n.ease},t);var i=this.transform,o=l.convert(t.offset),s=this.getZoom(),u=this.getBearing(),c=this.getPitch(),h="zoom"in t?+t.zoom:s,f="bearing"in t?this._normalizeBearing(t.bearing,u):u,d="pitch"in t?+t.pitch:c,p,m;"center"in t?(p=a.convert(t.center),m=i.centerPoint.add(o)):"around"in t?(p=a.convert(t.around),m=i.locationPoint(p)):(m=i.centerPoint.add(o),p=i.pointLocation(m));var v=i.locationPoint(p);return t.animate===!1&&(t.duration=0),this.zooming=h!==s,this.rotating=u!==f,this.pitching=d!==c,t.noMoveStart||this.fire("movestart",e),this.zooming&&this.fire("zoomstart",e),clearTimeout(this._onEaseEnd),this._ease(function(t){this.zooming&&(i.zoom=r(s,h,t)),this.rotating&&(i.bearing=r(u,f,t)),this.pitching&&(i.pitch=r(c,d,t)),i.setLocationAtPoint(p,v.add(m.sub(v)._mult(t))),this.fire("move",e),this.zooming&&this.fire("zoom",e),this.rotating&&this.fire("rotate",e),this.pitching&&this.fire("pitch",e)},function(){t.delayEndEvents?this._onEaseEnd=setTimeout(this._easeToEnd.bind(this,e),t.delayEndEvents):this._easeToEnd(e)}.bind(this),t),this},_easeToEnd:function(t){this.zooming&&this.fire("zoomend",t),this.fire("moveend",t),this.zooming=!1,this.rotating=!1,this.pitching=!1},flyTo:function(t,e){function i(t){var e=(E*E-S*S+(t?-1:1)*z*z*T*T)/(2*(t?E:S)*z*T);return Math.log(Math.sqrt(e*e+1)-e)}function o(t){return(Math.exp(t)-Math.exp(-t))/2}function s(t){return(Math.exp(t)+Math.exp(-t))/2}function u(t){return o(t)/s(t)}this.stop(),t=n.extend({offset:[0,0],speed:1.2,curve:1.42,easing:n.ease},t);var c=this.transform,h=l.convert(t.offset),f=this.getZoom(),d=this.getBearing(),p=this.getPitch(),m="center"in t?a.convert(t.center):this.getCenter(),v="zoom"in t?+t.zoom:f,y="bearing"in t?this._normalizeBearing(t.bearing,d):d,_="pitch"in t?+t.pitch:p;Math.abs(c.center.lng)+Math.abs(m.lng)>180&&(c.center.lng>0&&m.lng<0?m.lng+=360:c.center.lng<0&&m.lng>0&&(m.lng-=360));var g=c.zoomScale(v-f),x=c.point,b="center"in t?c.project(m).sub(h.div(g)):x,w=c.worldSize,M=t.curve,S=Math.max(c.width,c.height),E=S/g,T=b.sub(x).mag();if("minZoom"in t){var I=n.clamp(Math.min(t.minZoom,f,v),c.minZoom,c.maxZoom),D=S/c.zoomScale(I-f);M=Math.sqrt(D/T*2)}var z=M*M,P=i(0),L=function(t){return s(P)/s(P+M*t)},F=function(t){return S*((s(P)*u(P+M*t)-o(P))/z)/T},A=(i(1)-P)/M;if(Math.abs(T)<1e-6){if(Math.abs(S-E)<1e-6)return this.easeTo(t);var k=S>E?-1:1;A=Math.abs(Math.log(E/S))/M,F=function(){return 0},L=function(t){return Math.exp(k*M*t)}}if("duration"in t)t.duration=+t.duration;else{var R="screenSpeed"in t?+t.screenSpeed/M:+t.speed;t.duration=1e3*A/R}return this.zooming=!0,d!==y&&(this.rotating=!0),p!==_&&(this.pitching=!0),this.fire("movestart",e),this.fire("zoomstart",e),this._ease(function(t){var i=t*A,n=F(i);c.zoom=f+c.scaleZoom(1/L(i)),c.center=c.unproject(x.add(b.sub(x).mult(n)),w),this.rotating&&(c.bearing=r(d,y,t)),this.pitching&&(c.pitch=r(p,_,t)),this.fire("move",e),this.fire("zoom",e),this.rotating&&this.fire("rotate",e),this.pitching&&this.fire("pitch",e)},function(){this.fire("zoomend",e),this.fire("moveend",e),this.zooming=!1,this.rotating=!1,this.pitching=!1},t),this},isEasing:function(){return!!this._abortFn},stop:function(){return this._abortFn&&(this._abortFn(),this._finishEase()),this},_ease:function(t,e,i){this._finishFn=e,this._abortFn=o.timed(function(e){t.call(this,i.easing(e)),1===e&&this._finishEase()},i.animate===!1?0:i.duration,this)},_finishEase:function(){delete this._abortFn;var t=this._finishFn;delete this._finishFn,t.call(this)},_normalizeBearing:function(t,e){t=n.wrap(t,-180,180);var i=Math.abs(t-e);return Math.abs(t-360-e)<i&&(t-=360),Math.abs(t+360-e)<i&&(t+=360),t},_updateEasing:function(t,e,i){var r;if(this.ease){var o=this.ease,a=(Date.now()-o.start)/o.duration,s=o.easing(a+.01)-o.easing(a),l=.27/Math.sqrt(s*s+1e-4)*.01,u=Math.sqrt(.0729-l*l);r=n.bezier(l,u,.25,1)}else r=i?n.bezier.apply(n,i):n.ease;return this.ease={start:(new Date).getTime(),to:Math.pow(2,e),duration:t,easing:r},r}})},{"../geo/lng_lat":64,"../geo/lng_lat_bounds":65,"../util/browser":143,"../util/interpolate":151,"../util/util":157,"point-geometry":161}],126:[function(t,e,i){"use strict";function n(t){a.setOptions(this,t)}var r=t("./control"),o=t("../../util/dom"),a=t("../../util/util");e.exports=n,
n.createAttributionString=function(t){var e=[];for(var i in t){var n=t[i];n.attribution&&e.indexOf(n.attribution)<0&&e.push(n.attribution)}return e.sort(function(t,e){return t.length-e.length}),e=e.filter(function(t,i){for(var n=i+1;n<e.length;n++)if(e[n].indexOf(t)>=0)return!1;return!0}),e.join(" | ")},n.prototype=a.inherit(r,{options:{position:"bottom-right"},onAdd:function(t){var e="mapboxgl-ctrl-attrib",i=this._container=o.create("div",e,t.getContainer());return this._update(),t.on("source.load",this._update.bind(this)),t.on("source.change",this._update.bind(this)),t.on("source.remove",this._update.bind(this)),t.on("moveend",this._updateEditLink.bind(this)),i},_update:function(){this._map.style&&(this._container.innerHTML=n.createAttributionString(this._map.style.sources)),this._editLink=this._container.getElementsByClassName("mapbox-improve-map")[0],this._updateEditLink()},_updateEditLink:function(){if(this._editLink){var t=this._map.getCenter();this._editLink.href="https://www.mapbox.com/map-feedback/#/"+t.lng+"/"+t.lat+"/"+Math.round(this._map.getZoom()+1)}}})},{"../../util/dom":146,"../../util/util":157,"./control":127}],127:[function(t,e,i){"use strict";function n(){}e.exports=n,n.prototype={addTo:function(t){this._map=t;var e=this._container=this.onAdd(t);if(this.options&&this.options.position){var i=this.options.position,n=t._controlCorners[i];e.className+=" mapboxgl-ctrl",-1!==i.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e)}return this},remove:function(){return this._container.parentNode.removeChild(this._container),this.onRemove&&this.onRemove(this._map),this._map=null,this}}},{}],128:[function(t,e,i){"use strict";function n(t){s.setOptions(this,t)}var r=t("./control"),o=t("../../util/browser"),a=t("../../util/dom"),s=t("../../util/util");e.exports=n;var l={enableHighAccuracy:!1,timeout:6e3};n.prototype=s.inherit(r,{options:{position:"top-right"},onAdd:function(t){var e="mapboxgl-ctrl",i=this._container=a.create("div",e+"-group",t.getContainer());return o.supportsGeolocation?(this._container.addEventListener("contextmenu",this._onContextMenu.bind(this)),this._geolocateButton=a.create("button",e+"-icon "+e+"-geolocate",this._container),this._geolocateButton.addEventListener("click",this._onClickGeolocate.bind(this)),i):i},_onContextMenu:function(t){t.preventDefault()},_onClickGeolocate:function(){navigator.geolocation.getCurrentPosition(this._success.bind(this),this._error.bind(this),l),this._timeoutId=setTimeout(this._finish.bind(this),1e4)},_success:function(t){this._map.jumpTo({center:[t.coords.longitude,t.coords.latitude],zoom:17,bearing:0,pitch:0}),this._finish()},_error:function(){this._finish()},_finish:function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}})},{"../../util/browser":143,"../../util/dom":146,"../../util/util":157,"./control":127}],129:[function(t,e,i){"use strict";function n(t){s.setOptions(this,t)}function r(t){return new MouseEvent(t.type,{button:2,buttons:2,bubbles:!0,cancelable:!0,detail:t.detail,view:t.view,screenX:t.screenX,screenY:t.screenY,clientX:t.clientX,clientY:t.clientY,movementX:t.movementX,movementY:t.movementY,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey})}var o=t("./control"),a=t("../../util/dom"),s=t("../../util/util");e.exports=n,n.prototype=s.inherit(o,{options:{position:"top-right"},onAdd:function(t){var e="mapboxgl-ctrl",i=this._container=a.create("div",e+"-group",t.getContainer());return this._container.addEventListener("contextmenu",this._onContextMenu.bind(this)),this._zoomInButton=this._createButton(e+"-icon "+e+"-zoom-in",t.zoomIn.bind(t)),this._zoomOutButton=this._createButton(e+"-icon "+e+"-zoom-out",t.zoomOut.bind(t)),this._compass=this._createButton(e+"-icon "+e+"-compass",t.resetNorth.bind(t)),this._compassArrow=a.create("div","arrow",this._compass),this._compass.addEventListener("mousedown",this._onCompassDown.bind(this)),this._onCompassMove=this._onCompassMove.bind(this),this._onCompassUp=this._onCompassUp.bind(this),t.on("rotate",this._rotateCompassArrow.bind(this)),this._rotateCompassArrow(),this._el=t.getCanvasContainer(),i},_onContextMenu:function(t){t.preventDefault()},_onCompassDown:function(t){0===t.button&&(a.disableDrag(),document.addEventListener("mousemove",this._onCompassMove),document.addEventListener("mouseup",this._onCompassUp),this._el.dispatchEvent(r(t)),t.stopPropagation())},_onCompassMove:function(t){0===t.button&&(this._el.dispatchEvent(r(t)),t.stopPropagation())},_onCompassUp:function(t){0===t.button&&(document.removeEventListener("mousemove",this._onCompassMove),document.removeEventListener("mouseup",this._onCompassUp),a.enableDrag(),this._el.dispatchEvent(r(t)),t.stopPropagation())},_createButton:function(t,e){var i=a.create("button",t,this._container);return i.addEventListener("click",function(){e()}),i},_rotateCompassArrow:function(){var t="rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassArrow.style.transform=t}})},{"../../util/dom":146,"../../util/util":157,"./control":127}],130:[function(t,e,i){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),a.bindHandlers(this)}var r=t("../../util/dom"),o=t("../../geo/lng_lat_bounds"),a=t("../../util/util");e.exports=n,n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onMouseDown,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onMouseDown),this._enabled=!1)},_onMouseDown:function(t){t.shiftKey&&0===t.button&&(document.addEventListener("mousemove",this._onMouseMove,!1),document.addEventListener("keydown",this._onKeyDown,!1),document.addEventListener("mouseup",this._onMouseUp,!1),r.disableDrag(),this._startPos=r.mousePos(this._el,t),this._active=!0)},_onMouseMove:function(t){var e=this._startPos,i=r.mousePos(this._el,t);this._box||(this._box=r.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var n=Math.min(e.x,i.x),o=Math.max(e.x,i.x),a=Math.min(e.y,i.y),s=Math.max(e.y,i.y);r.setTransform(this._box,"translate("+n+"px,"+a+"px)"),this._box.style.width=o-n+"px",this._box.style.height=s-a+"px"},_onMouseUp:function(t){if(0===t.button){var e=this._startPos,i=r.mousePos(this._el,t),n=new o(this._map.unproject(e),this._map.unproject(i));this._finish(),e.x===i.x&&e.y===i.y?this._fireEvent("boxzoomcancel",t):this._map.fitBounds(n,{linear:!0}).fire("boxzoomend",{originalEvent:t,boxZoomBounds:n})}},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t))},_finish:function(){this._active=!1,document.removeEventListener("mousemove",this._onMouseMove,!1),document.removeEventListener("keydown",this._onKeyDown,!1),document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.parentNode.removeChild(this._box),this._box=null),r.enableDrag()},_fireEvent:function(t,e){return this._map.fire(t,{originalEvent:e})}}},{"../../geo/lng_lat_bounds":65,"../../util/dom":146,"../../util/util":157}],131:[function(t,e,i){"use strict";function n(t){this._map=t,this._onDblClick=this._onDblClick.bind(this)}e.exports=n,n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._map.on("dblclick",this._onDblClick),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._map.off("dblclick",this._onDblClick),this._enabled=!1)},_onDblClick:function(t){this._map.zoomTo(this._map.getZoom()+(t.originalEvent.shiftKey?-1:1),{around:t.lngLat})}}},{}],132:[function(t,e,i){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),o.bindHandlers(this)}var r=t("../../util/dom"),o=t("../../util/util");e.exports=n;var a=.3,s=o.bezier(0,0,a,1),l=1400,u=2500;n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._el.addEventListener("touchstart",this._onDown),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._el.removeEventListener("touchstart",this._onDown),this._enabled=!1)},_onDown:function(t){this._ignoreEvent(t)||this.isActive()||(t.touches?(document.addEventListener("touchmove",this._onMove),document.addEventListener("touchend",this._onTouchEnd)):(document.addEventListener("mousemove",this._onMove),document.addEventListener("mouseup",this._onMouseUp)),this._active=!1,this._startPos=this._pos=r.mousePos(this._el,t),this._inertia=[[Date.now(),this._pos]])},_onMove:function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._fireEvent("dragstart",t),this._fireEvent("movestart",t));var e=r.mousePos(this._el,t),i=this._map;i.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),e]),i.transform.setLocationAtPoint(i.transform.pointLocation(this._pos),e),this._fireEvent("drag",t),this._fireEvent("move",t),this._pos=e,t.preventDefault()}},_onUp:function(t){if(this.isActive()){this._active=!1,this._fireEvent("dragend",t),this._drainInertiaBuffer();var e=function(){this._fireEvent("moveend",t)}.bind(this),i=this._inertia;if(i.length<2)return void e();var n=i[i.length-1],r=i[0],o=n[1].sub(r[1]),c=(n[0]-r[0])/1e3;if(0===c||n[1].equals(r[1]))return void e();var h=o.mult(a/c),f=h.mag();f>l&&(f=l,h._unit()._mult(f));var d=f/(u*a),p=h.mult(-d/2);this._map.panBy(p,{duration:1e3*d,easing:s,noMoveStart:!0},{originalEvent:t})}},_onMouseUp:function(t){this._ignoreEvent(t)||(this._onUp(t),document.removeEventListener("mousemove",this._onMove),document.removeEventListener("mouseup",this._onMouseUp))},_onTouchEnd:function(t){this._ignoreEvent(t)||(this._onUp(t),document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onTouchEnd))},_fireEvent:function(t,e){return this._map.fire(t,{originalEvent:e})},_ignoreEvent:function(t){var e=this._map;if(e.boxZoom&&e.boxZoom.isActive())return!0;if(e.dragRotate&&e.dragRotate.isActive())return!0;if(t.touches)return t.touches.length>1;if(t.ctrlKey)return!0;var i=1,n=0;return"mousemove"===t.type?t.buttons&0===i:t.button!==n},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now(),i=160;t.length>0&&e-t[0][0]>i;)t.shift()}}},{"../../util/dom":146,"../../util/util":157}],133:[function(t,e,i){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),a.bindHandlers(this)}var r=t("../../util/dom"),o=t("point-geometry"),a=t("../../util/util");e.exports=n;var s=.25,l=a.bezier(0,0,s,1),u=180,c=720;n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._enabled=!1)},_onDown:function(t){if(!this._ignoreEvent(t)&&!this.isActive()){document.addEventListener("mousemove",this._onMove),document.addEventListener("mouseup",this._onUp),this._active=!1,this._inertia=[[Date.now(),this._map.getBearing()]],this._startPos=this._pos=r.mousePos(this._el,t),this._center=this._map.transform.centerPoint;var e=this._startPos.sub(this._center),i=e.mag();200>i&&(this._center=this._startPos.add(new o(-200,0)._rotate(e.angle()))),t.preventDefault()}},_onMove:function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._fireEvent("rotatestart",t),this._fireEvent("movestart",t));var e=this._map;e.stop();var i=this._pos,n=r.mousePos(this._el,t),o=this._center,a=i.sub(o).angleWith(n.sub(o))/Math.PI*180,s=e.getBearing()-a,l=this._inertia,u=l[l.length-1];this._drainInertiaBuffer(),l.push([Date.now(),e._normalizeBearing(s,u[1])]),e.transform.bearing=s,this._fireEvent("rotate",t),this._fireEvent("move",t),this._pos=n}},_onUp:function(t){if(!this._ignoreEvent(t)&&(document.removeEventListener("mousemove",this._onMove),document.removeEventListener("mouseup",this._onUp),this.isActive())){this._active=!1,this._fireEvent("rotateend",t),this._drainInertiaBuffer();var e=this._map,i=e.getBearing(),n=this._inertia,r=function(){Math.abs(i)<e.options.bearingSnap?e.resetNorth({noMoveStart:!0},{originalEvent:t}):this._fireEvent("moveend",t)}.bind(this);if(n.length<2)return void r();var o=n[0],a=n[n.length-1],h=n[n.length-2],f=e._normalizeBearing(i,h[1]),d=a[1]-o[1],p=0>d?-1:1,m=(a[0]-o[0])/1e3;if(0===d||0===m)return void r();var v=Math.abs(d*(s/m));v>u&&(v=u);var y=v/(c*s),_=p*v*(y/2);f+=_,Math.abs(e._normalizeBearing(f,0))<e.options.bearingSnap&&(f=e._normalizeBearing(0,f)),e.rotateTo(f,{duration:1e3*y,easing:l,noMoveStart:!0},{originalEvent:t})}},_fireEvent:function(t,e){return this._map.fire(t,{originalEvent:e})},_ignoreEvent:function(t){var e=this._map;if(e.boxZoom&&e.boxZoom.isActive())return!0;if(e.dragPan&&e.dragPan.isActive())return!0;if(t.touches)return t.touches.length>1;var i=t.ctrlKey?1:2,n=t.ctrlKey?0:2;return"mousemove"===t.type?t.buttons&0===i:t.button!==n},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now(),i=160;t.length>0&&e-t[0][0]>i;)t.shift()}}},{"../../util/dom":146,"../../util/util":157,"point-geometry":161}],134:[function(t,e,i){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),this._onKeyDown=this._onKeyDown.bind(this)}e.exports=n;var r=80,o=2,a=5;n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=this._map,i={originalEvent:t};switch(t.keyCode){case 61:case 107:case 171:case 187:e.zoomTo(Math.round(e.getZoom())+(t.shiftKey?2:1),i);break;case 189:case 109:case 173:e.zoomTo(Math.round(e.getZoom())-(t.shiftKey?2:1),i);break;case 37:t.shiftKey?e.easeTo({bearing:e.getBearing()-o},i):(t.preventDefault(),e.panBy([-r,0],i));break;case 39:t.shiftKey?e.easeTo({bearing:e.getBearing()+o},i):(t.preventDefault(),e.panBy([r,0],i));break;case 38:t.shiftKey?e.easeTo({pitch:e.getPitch()+a},i):(t.preventDefault(),e.panBy([0,-r],i));break;case 40:t.shiftKey?e.easeTo({pitch:Math.max(e.getPitch()-a,0)},i):(t.preventDefault(),e.panBy([0,r],i))}}}}},{}],135:[function(t,e,i){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),a.bindHandlers(this)}var r=t("../../util/dom"),o=t("../../util/browser"),a=t("../../util/util");e.exports=n;var s="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",l=-1!==s.indexOf("firefox"),u=-1!==s.indexOf("safari")&&-1===s.indexOf("chrom");n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("wheel",this._onWheel,!1),this._el.addEventListener("mousewheel",this._onWheel,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("wheel",this._onWheel),this._el.removeEventListener("mousewheel",this._onWheel),this._enabled=!1)},_onWheel:function(t){var e;"wheel"===t.type?(e=t.deltaY,l&&t.deltaMode===window.WheelEvent.DOM_DELTA_PIXEL&&(e/=o.devicePixelRatio),t.deltaMode===window.WheelEvent.DOM_DELTA_LINE&&(e*=40)):"mousewheel"===t.type&&(e=-t.wheelDeltaY,u&&(e/=3));var i=o.now(),n=i-(this._time||0);this._pos=r.mousePos(this._el,t),this._time=i,0!==e&&e%4.000244140625===0?(this._type="wheel",e=Math.floor(e/4)):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()},_onTimeout:function(){this._type="wheel",this._zoom(-this._lastValue)},_zoom:function(t,e){if(0!==t){var i=this._map,n=2/(1+Math.exp(-Math.abs(t/100)));0>t&&0!==n&&(n=1/n);var r=i.ease?i.ease.to:i.transform.scale,o=i.transform.scaleZoom(r*n);i.zoomTo(o,{duration:0,around:i.unproject(this._pos),delayEndEvents:200},{originalEvent:e})}}}},{"../../util/browser":143,"../../util/dom":146,"../../util/util":157}],136:[function(t,e,i){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),o.bindHandlers(this)}var r=t("../../util/dom"),o=t("../../util/util");e.exports=n;var a=.15,s=o.bezier(0,0,a,1),l=12,u=2.5,c=.15,h=4;n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("touchstart",this._onStart,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("touchstart",this._onStart),this._enabled=!1)},disableRotation:function(){this._rotationDisabled=!0},enableRotation:function(){this._rotationDisabled=!1},_onStart:function(t){if(2===t.touches.length){var e=r.mousePos(this._el,t.touches[0]),i=r.mousePos(this._el,t.touches[1]);this._startVec=e.sub(i),this._startScale=this._map.transform.scale,this._startBearing=this._map.transform.bearing,this._gestureIntent=void 0,this._inertia=[],document.addEventListener("touchmove",this._onMove,!1),document.addEventListener("touchend",this._onEnd,!1)}},_onMove:function(t){if(2===t.touches.length){var e=r.mousePos(this._el,t.touches[0]),i=r.mousePos(this._el,t.touches[1]),n=e.add(i).div(2),o=e.sub(i),a=o.mag()/this._startVec.mag(),s=this._rotationDisabled?0:180*o.angleWith(this._startVec)/Math.PI,l=this._map;if(this._gestureIntent){var u={duration:0,around:l.unproject(n)};"rotate"===this._gestureIntent&&(u.bearing=this._startBearing+s),"zoom"!==this._gestureIntent&&"rotate"!==this._gestureIntent||(u.zoom=l.transform.scaleZoom(this._startScale*a)),l.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),a,n]),l.easeTo(u,{originalEvent:t})}else{var f=Math.abs(1-a)>c,d=Math.abs(s)>h;d?this._gestureIntent="rotate":f&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._startVec=o,this._startScale=l.transform.scale,this._startBearing=l.transform.bearing)}t.preventDefault()}},_onEnd:function(t){document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onEnd),this._drainInertiaBuffer();var e=this._inertia,i=this._map;if(e.length<2)return void i.snapToNorth({},{originalEvent:t});var n=e[e.length-1],r=e[0],o=i.transform.scaleZoom(this._startScale*n[1]),c=i.transform.scaleZoom(this._startScale*r[1]),h=o-c,f=(n[0]-r[0])/1e3,d=n[2];if(0===f||o===c)return void i.snapToNorth({},{originalEvent:t});var p=h*a/f;Math.abs(p)>u&&(p=p>0?u:-u);var m=1e3*Math.abs(p/(l*a)),v=o+p*m/2e3;0>v&&(v=0),i.easeTo({zoom:v,duration:m,easing:s,around:i.unproject(d)},{originalEvent:t})},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now(),i=160;t.length>2&&e-t[0][0]>i;)t.shift()}}},{"../../util/dom":146,"../../util/util":157}],137:[function(t,e,i){"use strict";function n(){r.bindAll(["_onHashChange","_updateHash"],this)}e.exports=n;var r=t("../util/util");n.prototype={addTo:function(t){return this._map=t,window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},remove:function(){return window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),delete this._map,this},_onHashChange:function(){var t=location.hash.replace("#","").split("/");return t.length>=3?(this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:+(t[3]||0)}),!0):!1},_updateHash:function(){var t=this._map.getCenter(),e=this._map.getZoom(),i=this._map.getBearing(),n=Math.max(0,Math.ceil(Math.log(e)/Math.LN2)),r="#"+Math.round(100*e)/100+"/"+t.lat.toFixed(n)+"/"+t.lng.toFixed(n)+(i?"/"+Math.round(10*i)/10:"");window.history.replaceState("","",r)}}},{"../util/util":157}],138:[function(t,e,i){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer();for(var e in r)t[e]=new r[e](t);a.bindHandlers(this)}var r={scrollZoom:t("./handler/scroll_zoom"),boxZoom:t("./handler/box_zoom"),dragRotate:t("./handler/drag_rotate"),dragPan:t("./handler/drag_pan"),keyboard:t("./handler/keyboard"),doubleClickZoom:t("./handler/dblclick_zoom"),touchZoomRotate:t("./handler/touch_zoom_rotate")},o=t("../util/dom"),a=t("../util/util"),s=t("point-geometry");e.exports=n,n.prototype={enable:function(){var t=this._map.options,e=this._el;for(var i in r)t[i]&&this._map[i].enable();e.addEventListener("mousedown",this._onMouseDown,!1),e.addEventListener("mouseup",this._onMouseUp,!1),e.addEventListener("mousemove",this._onMouseMove,!1),e.addEventListener("touchstart",this._onTouchStart,!1),e.addEventListener("touchend",this._onTouchEnd,!1),e.addEventListener("touchmove",this._onTouchMove,!1),e.addEventListener("touchcancel",this._onTouchCancel,!1),e.addEventListener("click",this._onClick,!1),e.addEventListener("dblclick",this._onDblClick,!1),e.addEventListener("contextmenu",this._onContextMenu,!1)},disable:function(){var t=this._map.options,e=this._el;for(var i in r)t[i]&&this._map[i].disable();e.removeEventListener("mousedown",this._onMouseDown),e.removeEventListener("mouseup",this._onMouseUp),e.removeEventListener("mousemove",this._onMouseMove),e.removeEventListener("touchstart",this._onTouchStart),e.removeEventListener("touchend",this._onTouchEnd),e.removeEventListener("touchmove",this._onTouchMove),e.removeEventListener("touchcancel",this._onTouchCancel),e.removeEventListener("click",this._onClick),e.removeEventListener("dblclick",this._onDblClick),e.removeEventListener("contextmenu",this._onContextMenu)},_onMouseDown:function(t){this._map.stop(),this._startPos=o.mousePos(this._el,t),this._fireMouseEvent("mousedown",t)},_onMouseUp:function(t){var e=this._map,i=e.dragRotate&&e.dragRotate.isActive();this._contextMenuEvent&&!i&&this._fireMouseEvent("contextmenu",this._contextMenuEvent),this._contextMenuEvent=null,this._fireMouseEvent("mouseup",t)},_onMouseMove:function(t){var e=this._map,i=this._el;if(!(e.dragPan&&e.dragPan.isActive()||e.dragRotate&&e.dragRotate.isActive())){for(var n=t.toElement||t.target;n&&n!==i;)n=n.parentNode;n===i&&this._fireMouseEvent("mousemove",t)}},_onTouchStart:function(t){this._map.stop(),this._fireTouchEvent("touchstart",t),!t.touches||t.touches.length>1||(this._tapped?(clearTimeout(this._tapped),this._tapped=null,this._fireMouseEvent("dblclick",t)):this._tapped=setTimeout(this._onTouchTimeout,300))},_onTouchMove:function(t){this._fireTouchEvent("touchmove",t)},_onTouchEnd:function(t){this._fireTouchEvent("touchend",t)},_onTouchCancel:function(t){this._fireTouchEvent("touchcancel",t)},_onTouchTimeout:function(){this._tapped=null},_onClick:function(t){var e=o.mousePos(this._el,t);e.equals(this._startPos)&&this._fireMouseEvent("click",t)},_onDblClick:function(t){this._fireMouseEvent("dblclick",t),t.preventDefault()},_onContextMenu:function(t){this._contextMenuEvent=t,t.preventDefault()},_fireMouseEvent:function(t,e){var i=o.mousePos(this._el,e);return this._map.fire(t,{lngLat:this._map.unproject(i),point:i,originalEvent:e})},_fireTouchEvent:function(t,e){var i=o.touchPos(this._el,e),n=i.reduce(function(t,e,i,n){return t.add(e.div(n.length))},new s(0,0));return this._map.fire(t,{lngLat:this._map.unproject(n),point:n,lngLats:i.map(function(t){return this._map.unproject(t)},this),points:i,originalEvent:e})}}},{"../util/dom":146,"../util/util":157,"./handler/box_zoom":130,"./handler/dblclick_zoom":131,"./handler/drag_pan":132,"./handler/drag_rotate":133,"./handler/keyboard":134,"./handler/scroll_zoom":135,"./handler/touch_zoom_rotate":136,"point-geometry":161}],139:[function(t,e,i){"use strict";function n(t){t.parentNode&&t.parentNode.removeChild(t)}var r=t("../util/canvas"),o=t("../util/util"),a=t("../util/browser"),s=t("../util/evented"),l=t("../util/dom"),u=t("../style/style"),c=t("../style/animation_loop"),h=t("../render/painter"),f=t("../geo/transform"),d=t("./hash"),p=t("./interaction"),m=t("./camera"),v=t("../geo/lng_lat"),y=t("../geo/lng_lat_bounds"),_=t("point-geometry"),g=t("./control/attribution"),x=0,b=20,w=e.exports=function(t){t=o.inherit(this.options,t),this._interactive=t.interactive,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,"string"==typeof t.container?this._container=document.getElementById(t.container):this._container=t.container,this.animationLoop=new c,this.transform=new f(t.minZoom,t.maxZoom),t.maxBounds&&this.setMaxBounds(t.maxBounds),o.bindAll(["_forwardStyleEvent","_forwardSourceEvent","_forwardLayerEvent","_forwardTileEvent","_onStyleLoad","_onStyleChange","_onSourceAdd","_onSourceRemove","_onSourceUpdate","_onWindowResize","onError","_update","_render"],this),this._setupContainer(),this._setupPainter(),this.on("move",this._update.bind(this,!1)),this.on("zoom",this._update.bind(this,!0)),this.on("moveend",function(){this.animationLoop.set(300),this._rerender()}.bind(this)),"undefined"!=typeof window&&window.addEventListener("resize",this._onWindowResize,!1),this.interaction=new p(this),t.interactive&&this.interaction.enable(),this._hash=t.hash&&(new d).addTo(this),this._hash&&this._hash._onHashChange()||this.jumpTo(t),this.stacks={},this._classes=[],this.resize(),t.classes&&this.setClasses(t.classes),t.style&&this.setStyle(t.style),t.attributionControl&&this.addControl(new g(t.attributionControl)),this.on("style.error",this.onError),this.on("source.error",this.onError),this.on("tile.error",this.onError),this.on("layer.error",this.onError)};o.extend(w.prototype,s),o.extend(w.prototype,m.prototype),o.extend(w.prototype,{options:{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},addControl:function(t){return t.addTo(this),this},addClass:function(t,e){return this._classes.indexOf(t)>=0||""===t?this:(this._classes.push(t),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},removeClass:function(t,e){var i=this._classes.indexOf(t);return 0>i||""===t?this:(this._classes.splice(i,1),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},setClasses:function(t,e){for(var i={},n=0;n<t.length;n++)""!==t[n]&&(i[t[n]]=!0);return this._classes=Object.keys(i),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0)},hasClass:function(t){return this._classes.indexOf(t)>=0},getClasses:function(){return this._classes},resize:function(){var t=0,e=0;return this._container&&(t=this._container.offsetWidth||400,e=this._container.offsetHeight||300),this._canvas.resize(t,e),this.transform.resize(t,e),this.painter.resize(t,e),this.fire("movestart").fire("move").fire("resize").fire("moveend")},getBounds:function(){var t=new y(this.transform.pointLocation(new _(0,0)),this.transform.pointLocation(this.transform.size));return(this.transform.angle||this.transform.pitch)&&(t.extend(this.transform.pointLocation(new _(this.transform.size.x,0))),t.extend(this.transform.pointLocation(new _(0,this.transform.size.y)))),t},setMaxBounds:function(t){if(t){var e=y.convert(t);this.transform.lngRange=[e.getWest(),e.getEast()],this.transform.latRange=[e.getSouth(),e.getNorth()],this.transform._constrain(),this._update()}else null!==t&&void 0!==t||(this.transform.lngRange=[],this.transform.latRange=[],this._update());return this},setMinZoom:function(t){if(t=null===t||void 0===t?x:t,t>=x&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t&&this.setZoom(t),this;throw new Error("minZoom must be between "+x+" and the current maxZoom, inclusive")},setMaxZoom:function(t){if(t=null===t||void 0===t?b:t,t>=this.transform.minZoom&&b>=t)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be between the current minZoom and "+b+", inclusive")},project:function(t){return this.transform.locationPoint(v.convert(t))},unproject:function(t){return this.transform.pointLocation(_.convert(t))},queryRenderedFeatures:function(t,e){t instanceof _||Array.isArray(t)||(e=t,t=void 0);var i=this._makeQueryGeometry(t);return this.style.queryRenderedFeatures(i,e,this.transform.zoom,this.transform.angle)},_makeQueryGeometry:function(t){void 0===t&&(t=[_.convert([0,0]),_.convert([this.transform.width,this.transform.height])]);var e,i=t instanceof _||"number"==typeof t[0];if(i){var n=_.convert(t);e=[n]}else{var r=[_.convert(t[0]),_.convert(t[1])];e=[r[0],new _(r[1].x,r[0].y),r[1],new _(r[0].x,r[1].y),r[0]]}return e=e.map(function(t){return this.transform.pointCoordinate(t)}.bind(this))},querySourceFeatures:function(t,e){return this.style.querySourceFeatures(t,e)},setStyle:function(t){return this.style&&(this.style.off("load",this._onStyleLoad).off("error",this._forwardStyleEvent).off("change",this._onStyleChange).off("source.add",this._onSourceAdd).off("source.remove",this._onSourceRemove).off("source.load",this._onSourceUpdate).off("source.error",this._forwardSourceEvent).off("source.change",this._onSourceUpdate).off("layer.add",this._forwardLayerEvent).off("layer.remove",this._forwardLayerEvent).off("layer.error",this._forwardLayerEvent).off("tile.add",this._forwardTileEvent).off("tile.remove",this._forwardTileEvent).off("tile.load",this._update).off("tile.error",this._forwardTileEvent).off("tile.stats",this._forwardTileEvent)._remove(),this.off("rotate",this.style._redoPlacement),this.off("pitch",this.style._redoPlacement)),t?(t instanceof u?this.style=t:this.style=new u(t,this.animationLoop),this.style.on("load",this._onStyleLoad).on("error",this._forwardStyleEvent).on("change",this._onStyleChange).on("source.add",this._onSourceAdd).on("source.remove",this._onSourceRemove).on("source.load",this._onSourceUpdate).on("source.error",this._forwardSourceEvent).on("source.change",this._onSourceUpdate).on("layer.add",this._forwardLayerEvent).on("layer.remove",this._forwardLayerEvent).on("layer.error",this._forwardLayerEvent).on("tile.add",this._forwardTileEvent).on("tile.remove",this._forwardTileEvent).on("tile.load",this._update).on("tile.error",this._forwardTileEvent).on("tile.stats",this._forwardTileEvent),this.on("rotate",this.style._redoPlacement),this.on("pitch",this.style._redoPlacement),this):(this.style=null,this)},getStyle:function(){return this.style.serialize()},addSource:function(t,e){return this.style.addSource(t,e),this._update(!0),this},removeSource:function(t){return this.style.removeSource(t),this._update(!0),this},getSource:function(t){return this.style.getSource(t)},addLayer:function(t,e){return this.style.addLayer(t,e),this._update(!0),this},removeLayer:function(t){return this.style.removeLayer(t),this._update(!0),this},getLayer:function(t){return this.style.getLayer(t)},setFilter:function(t,e){return this.style.setFilter(t,e),this._update(!0),this},setLayerZoomRange:function(t,e,i){return this.style.setLayerZoomRange(t,e,i),this._update(!0),this},getFilter:function(t){return this.style.getFilter(t)},setPaintProperty:function(t,e,i,n){return this.style.setPaintProperty(t,e,i,n),this._update(!0),this},getPaintProperty:function(t,e,i){return this.style.getPaintProperty(t,e,i)},setLayoutProperty:function(t,e,i){return this.style.setLayoutProperty(t,e,i),this._update(!0),this},getLayoutProperty:function(t,e){return this.style.getLayoutProperty(t,e)},getContainer:function(){return this._container},getCanvasContainer:function(){return this._canvasContainer},getCanvas:function(){return this._canvas.getElement()},_setupContainer:function(){var t=this._container;t.classList.add("mapboxgl-map");var e=this._canvasContainer=l.create("div","mapboxgl-canvas-container",t);
this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=new r(this,e);var i=this._controlContainer=l.create("div","mapboxgl-control-container",t),n=this._controlCorners={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(t){n[t]=l.create("div","mapboxgl-ctrl-"+t,i)})},_setupPainter:function(){var t=this._canvas.getWebGLContext({failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer});return t?void(this.painter=new h(t,this.transform)):void console.error("Failed to initialize WebGL")},_contextLost:function(t){t.preventDefault(),this._frameId&&a.cancelFrame(this._frameId),this.fire("webglcontextlost",{originalEvent:t})},_contextRestored:function(t){this._setupPainter(),this.resize(),this._update(),this.fire("webglcontextrestored",{originalEvent:t})},loaded:function(){return this._styleDirty||this._sourcesDirty?!1:!(!this.style||!this.style.loaded())},_update:function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this._rerender(),this):this},_render:function(){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,{debug:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,vertices:this.vertices,rotating:this.rotating,zooming:this.zooming}),this.fire("render"),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire("load")),this._frameId=null,this.animationLoop.stopped()||(this._styleDirty=!0),(this._sourcesDirty||this._repaint||!this.animationLoop.stopped())&&this._rerender(),this},remove:function(){this._hash&&this._hash.remove(),a.cancelFrame(this._frameId),this.setStyle(null),"undefined"!=typeof window&&window.removeEventListener("resize",this._onWindowResize,!1),n(this._canvasContainer),n(this._controlContainer),this._container.classList.remove("mapboxgl-map")},onError:function(t){console.error(t.error)},_rerender:function(){this.style&&!this._frameId&&(this._frameId=a.frame(this._render))},_forwardStyleEvent:function(t){this.fire("style."+t.type,o.extend({style:t.target},t))},_forwardSourceEvent:function(t){this.fire(t.type,o.extend({style:t.target},t))},_forwardLayerEvent:function(t){this.fire(t.type,o.extend({style:t.target},t))},_forwardTileEvent:function(t){this.fire(t.type,o.extend({style:t.target},t))},_onStyleLoad:function(t){this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this.style.update(this._classes,{transition:!1}),this._forwardStyleEvent(t)},_onStyleChange:function(t){this._update(!0),this._forwardStyleEvent(t)},_onSourceAdd:function(t){var e=t.source;e.onAdd&&e.onAdd(this),this._forwardSourceEvent(t)},_onSourceRemove:function(t){var e=t.source;e.onRemove&&e.onRemove(this),this._forwardSourceEvent(t)},_onSourceUpdate:function(t){this._update(),this._forwardSourceEvent(t)},_onWindowResize:function(){this.stop().resize()._update()}}),o.extendAll(w.prototype,{_showTileBoundaries:!1,get showTileBoundaries(){return this._showTileBoundaries},set showTileBoundaries(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},_showCollisionBoxes:!1,get showCollisionBoxes(){return this._showCollisionBoxes},set showCollisionBoxes(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,this.style._redoPlacement())},_showOverdrawInspector:!1,get showOverdrawInspector(){return this._showOverdrawInspector},set showOverdrawInspector(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},_repaint:!1,get repaint(){return this._repaint},set repaint(t){this._repaint=t,this._update()},_vertices:!1,get vertices(){return this._vertices},set vertices(t){this._vertices=t,this._update()}})},{"../geo/lng_lat":64,"../geo/lng_lat_bounds":65,"../geo/transform":66,"../render/painter":79,"../style/animation_loop":95,"../style/style":98,"../util/browser":143,"../util/canvas":144,"../util/dom":146,"../util/evented":149,"../util/util":157,"./camera":125,"./control/attribution":126,"./hash":137,"./interaction":138,"point-geometry":161}],140:[function(t,e,i){"use strict";function n(t){r.setOptions(this,t),r.bindAll(["_update","_onClickClose"],this)}e.exports=n;var r=t("../util/util"),o=t("../util/evented"),a=t("../util/dom"),s=t("../geo/lng_lat");n.prototype=r.inherit(o,{options:{closeButton:!0,closeOnClick:!0},addTo:function(t){return this._map=t,this._map.on("move",this._update),this.options.closeOnClick&&this._map.on("click",this._onClickClose),this._update(),this},remove:function(){return this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._container&&(this._container.parentNode.removeChild(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("click",this._onClickClose),delete this._map),this},getLngLat:function(){return this._lngLat},setLngLat:function(t){return this._lngLat=s.convert(t),this._update(),this},setText:function(t){return this.setDOMContent(document.createTextNode(t))},setHTML:function(t){var e=document.createDocumentFragment(),i=document.createElement("body"),n;for(i.innerHTML=t;;){if(n=i.firstChild,!n)break;e.appendChild(n)}return this.setDOMContent(e)},setDOMContent:function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},_createContent:function(){this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._content=a.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=a.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClickClose))},_update:function(){if(this._map&&this._lngLat&&this._content){this._container||(this._container=a.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=a.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content));var t=this._map.project(this._lngLat).round(),e=this.options.anchor;if(!e){var i=this._container.offsetWidth,n=this._container.offsetHeight;e=t.y<n?["top"]:t.y>this._map.transform.height-n?["bottom"]:[],t.x<i/2?e.push("left"):t.x>this._map.transform.width-i/2&&e.push("right"),e=0===e.length?"bottom":e.join("-")}var r={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%)"},o=this._container.classList;for(var s in r)o.remove("mapboxgl-popup-anchor-"+s);o.add("mapboxgl-popup-anchor-"+e),a.setTransform(this._container,r[e]+" translate("+t.x+"px,"+t.y+"px)")}},_onClickClose:function(){this.remove()}})},{"../geo/lng_lat":64,"../util/dom":146,"../util/evented":149,"../util/util":157}],141:[function(t,e,i){"use strict";function n(t,e){this.target=t,this.parent=e,this.callbacks={},this.callbackID=0,this.receive=this.receive.bind(this),this.target.addEventListener("message",this.receive,!1)}e.exports=n,n.prototype.receive=function(t){var e=t.data,i;if("<response>"===e.type)i=this.callbacks[e.id],delete this.callbacks[e.id],i(e.error||null,e.data);else if("undefined"!=typeof e.id){var n=e.id;this.parent[e.type](e.data,function(t,e,i){this.postMessage({type:"<response>",id:String(n),error:t?String(t):null,data:e},i)}.bind(this))}else this.parent[e.type](e.data)},n.prototype.send=function(t,e,i,n){var r=null;i&&(this.callbacks[r=this.callbackID++]=i),this.postMessage({type:t,id:String(r),data:e},n)},n.prototype.postMessage=function(t,e){this.target.postMessage(t,e)}},{}],142:[function(t,e,i){"use strict";function n(t){var e=document.createElement("a");return e.href=t,e.protocol===document.location.protocol&&e.host===document.location.host}i.getJSON=function(t,e){var i=new XMLHttpRequest;return i.open("GET",t,!0),i.setRequestHeader("Accept","application/json"),i.onerror=function(t){e(t)},i.onload=function(){if(i.status>=200&&i.status<300&&i.response){var t;try{t=JSON.parse(i.response)}catch(n){return e(n)}e(null,t)}else e(new Error(i.statusText))},i.send(),i},i.getArrayBuffer=function(t,e){var i=new XMLHttpRequest;return i.open("GET",t,!0),i.responseType="arraybuffer",i.onerror=function(t){e(t)},i.onload=function(){i.status>=200&&i.status<300&&i.response?e(null,i.response):e(new Error(i.statusText))},i.send(),i},i.getImage=function(t,e){return i.getArrayBuffer(t,function(t,i){if(t)return e(t);var n=new Image;n.onload=function(){e(null,n),(window.URL||window.webkitURL).revokeObjectURL(n.src)};var r=new Blob([new Uint8Array(i)],{type:"image/png"});return n.src=(window.URL||window.webkitURL).createObjectURL(r),n.getData=function(){var t=document.createElement("canvas"),e=t.getContext("2d");return t.width=n.width,t.height=n.height,e.drawImage(n,0,0),e.getImageData(0,0,n.width,n.height).data},n})},i.getVideo=function(t,e){var i=document.createElement("video");i.onloadstart=function(){e(null,i)};for(var r=0;r<t.length;r++){var o=document.createElement("source");n(t[r])||(i.crossOrigin="Anonymous"),o.src=t[r],i.appendChild(o)}return i.getData=function(){return i},i}},{}],143:[function(t,e,i){"use strict";e.exports.now=function(){return window.performance&&window.performance.now?window.performance.now.bind(window.performance):Date.now.bind(Date)}();var n=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame;i.frame=function(t){return n(t)};var r=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame;i.cancelFrame=function(t){r(t)},i.timed=function(t,n,r){function o(l){a||(l=e.exports.now(),l>=s+n?t.call(r,1):(t.call(r,(l-s)/n),i.frame(o)))}if(!n)return t.call(r,1),null;var a=!1,s=e.exports.now();return i.frame(o),function(){a=!0}},i.supported=t("mapbox-gl-js-supported"),i.hardwareConcurrency=navigator.hardwareConcurrency||8,Object.defineProperty(i,"devicePixelRatio",{get:function(){return window.devicePixelRatio}}),i.supportsWebp=!1;var o=document.createElement("img");o.onload=function(){i.supportsWebp=!0},o.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=",i.supportsGeolocation=!!navigator.geolocation},{"mapbox-gl-js-supported":29}],144:[function(t,e,i){"use strict";function n(t,e){this.canvas=document.createElement("canvas"),t&&e&&(this.canvas.style.position="absolute",this.canvas.classList.add("mapboxgl-canvas"),this.canvas.addEventListener("webglcontextlost",t._contextLost.bind(t),!1),this.canvas.addEventListener("webglcontextrestored",t._contextRestored.bind(t),!1),this.canvas.setAttribute("tabindex",0),e.appendChild(this.canvas))}var r=t("../util"),o=t("mapbox-gl-js-supported");e.exports=n,n.prototype.resize=function(t,e){var i=window.devicePixelRatio||1;this.canvas.width=i*t,this.canvas.height=i*e,this.canvas.style.width=t+"px",this.canvas.style.height=e+"px"},n.prototype.getWebGLContext=function(t){return t=r.extend({},t,o.webGLContextAttributes),this.canvas.getContext("webgl",t)||this.canvas.getContext("experimental-webgl",t)},n.prototype.getElement=function(){return this.canvas}},{"../util":157,"mapbox-gl-js-supported":29}],145:[function(t,e,i){"use strict";function n(e,i){this.actors=[],this.currentActor=0;for(var n=0;e>n;n++){var a=new o(t("../../source/worker")),s=new r(a,i);s.name="Worker "+n,this.actors.push(s)}}var r=t("../actor"),o=t("webworkify");e.exports=n,n.prototype={broadcast:function(t,e){for(var i=0;i<this.actors.length;i++)this.actors[i].send(t,e)},send:function(t,e,i,n,r){return("number"!=typeof n||isNaN(n))&&(n=this.currentActor=(this.currentActor+1)%this.actors.length),this.actors[n].send(t,e,i,r),n},remove:function(){for(var t=0;t<this.actors.length;t++)this.actors[t].target.terminate();this.actors=[]}}},{"../../source/worker":93,"../actor":141,webworkify:173}],146:[function(t,e,i){"use strict";function n(t){for(var e=0;e<t.length;e++)if(t[e]in a)return t[e]}function r(t){t.preventDefault(),t.stopPropagation(),window.removeEventListener("click",r,!0)}var o=t("point-geometry");i.create=function(t,e,i){var n=document.createElement(t);return e&&(n.className=e),i&&i.appendChild(n),n};var a=document.documentElement.style,s=n(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),l;i.disableDrag=function(){s&&(l=a[s],a[s]="none")},i.enableDrag=function(){s&&(a[s]=l)};var u=n(["transform","WebkitTransform"]);i.setTransform=function(t,e){t.style[u]=e},i.suppressClick=function(){window.addEventListener("click",r,!0),window.setTimeout(function(){window.removeEventListener("click",r,!0)},0)},i.mousePos=function(t,e){var i=t.getBoundingClientRect();return e=e.touches?e.touches[0]:e,new o(e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop)},i.touchPos=function(t,e){for(var i=t.getBoundingClientRect(),n=[],r=0;r<e.touches.length;r++)n.push(new o(e.touches[r].clientX-i.left-t.clientLeft,e.touches[r].clientY-i.top-t.clientTop));return n}},{"point-geometry":161}],147:[function(t,e,i){"use strict";e.exports={API_URL:"https://api.mapbox.com",REQUIRE_ACCESS_TOKEN:!0}},{}],148:[function(t,e,i){"use strict";function n(t){this._stringToNumber={},this._numberToString=[];for(var e=0;e<t.length;e++){var i=t[e];this._stringToNumber[i]=e,this._numberToString[e]=i}}var r=t("assert");e.exports=n,n.prototype.encode=function(t){return r(t in this._stringToNumber),this._stringToNumber[t]},n.prototype.decode=function(t){return r(t<this._numberToString.length),this._numberToString[t]}},{assert:176}],149:[function(t,e,i){"use strict";var n=t("./util"),r={on:function(t,e){return this._events=this._events||{},this._events[t]=this._events[t]||[],this._events[t].push(e),this},off:function(t,e){if(!t)return delete this._events,this;if(!this.listens(t))return this;if(e){var i=this._events[t].indexOf(e);i>=0&&this._events[t].splice(i,1),this._events[t].length||delete this._events[t]}else delete this._events[t];return this},once:function(t,e){var i=function(n){this.off(t,i),e.call(this,n)}.bind(this);return this.on(t,i),this},fire:function(t,e){if(!this.listens(t))return this;e=n.extend({},e),n.extend(e,{type:t,target:this});for(var i=this._events[t].slice(),r=0;r<i.length;r++)i[r].call(this,e);return this},listens:function(t){return!(!this._events||!this._events[t])}};e.exports=r},{"./util":157}],150:[function(t,e,i){"use strict";function n(t,e){this.stacks=t.readFields(r,[],e)}function r(t,e,i){if(1===t){var n=i.readMessage(o,{glyphs:{}});e.push(n)}}function o(t,e,i){if(1===t)e.name=i.readString();else if(2===t)e.range=i.readString();else if(3===t){var n=i.readMessage(a,{});e.glyphs[n.id]=n}}function a(t,e,i){1===t?e.id=i.readVarint():2===t?e.bitmap=i.readBytes():3===t?e.width=i.readVarint():4===t?e.height=i.readVarint():5===t?e.left=i.readSVarint():6===t?e.top=i.readSVarint():7===t&&(e.advance=i.readVarint())}e.exports=n},{}],151:[function(t,e,i){"use strict";function n(t,e,i){return t*(1-i)+e*i}e.exports=n,n.number=n,n.vec2=function(t,e,i){return[n(t[0],e[0],i),n(t[1],e[1],i)]},n.color=function(t,e,i){return[n(t[0],e[0],i),n(t[1],e[1],i),n(t[2],e[2],i),n(t[3],e[3],i)]},n.array=function(t,e,i){return t.map(function(t,r){return n(t,e[r],i)})}},{}],152:[function(t,e,i){"use strict";function n(t,e,i){for(var n=0;n<t.length;n++)for(var r=t[n],o=0;o<e.length;o++)for(var a=e[o],s=0;s<a.length;s++){var l=a[s];if(d(r,l))return!0;if(c(l,r,i))return!0}return!1}function r(t,e){if(1===t.length&&1===t[0].length)return f(e,t[0][0]);for(var i=0;i<e.length;i++)for(var n=e[i],r=0;r<n.length;r++)if(f(t,n[r]))return!0;for(var o=0;o<t.length;o++){for(var a=t[o],l=0;l<a.length;l++)if(f(e,a[l]))return!0;for(var u=0;u<e.length;u++)if(s(a,e[u]))return!0}return!1}function o(t,e,i){for(var n=0;n<e.length;n++)for(var r=e[n],o=0;o<t.length;o++){var s=t[o];if(s.length>=3)for(var l=0;l<r.length;l++)if(d(s,r[l]))return!0;if(a(s,r,i))return!0}return!1}function a(t,e,i){if(t.length>1){if(s(t,e))return!0;for(var n=0;n<e.length;n++)if(c(e[n],t,i))return!0}for(var r=0;r<t.length;r++)if(c(t[r],e,i))return!0;return!1}function s(t,e){for(var i=0;i<t.length-1;i++)for(var n=t[i],r=t[i+1],o=0;o<e.length-1;o++){var a=e[o],s=e[o+1];if(u(n,r,a,s))return!0}return!1}function l(t,e,i){return(i.y-t.y)*(e.x-t.x)>(e.y-t.y)*(i.x-t.x)}function u(t,e,i,n){return l(t,i,n)!==l(e,i,n)&&l(t,e,i)!==l(t,e,n)}function c(t,e,i){var n=i*i;if(1===e.length)return t.distSqr(e[0])<n;for(var r=1;r<e.length;r++){var o=e[r-1],a=e[r];if(h(t,o,a)<n)return!0}return!1}function h(t,e,i){var n=e.distSqr(i);if(0===n)return t.distSqr(e);var r=((t.x-e.x)*(i.x-e.x)+(t.y-e.y)*(i.y-e.y))/n;return 0>r?t.distSqr(e):r>1?t.distSqr(i):t.distSqr(i.sub(e)._mult(r)._add(e))}function f(t,e){for(var i=!1,n,r,o,a=0;a<t.length;a++){n=t[a];for(var s=0,l=n.length-1;s<n.length;l=s++)r=n[s],o=n[l],r.y>e.y!=o.y>e.y&&e.x<(o.x-r.x)*(e.y-r.y)/(o.y-r.y)+r.x&&(i=!i)}return i}function d(t,e){for(var i=!1,n=0,r=t.length-1;n<t.length;r=n++){var o=t[n],a=t[r];o.y>e.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(i=!i)}return i}e.exports={multiPolygonIntersectsBufferedMultiPoint:n,multiPolygonIntersectsMultiPolygon:r,multiPolygonIntersectsBufferedMultiLine:o}},{}],153:[function(t,e,i){"use strict";function n(t,e){this.max=t,this.onRemove=e,this.reset()}e.exports=n,n.prototype.reset=function(){for(var t in this.data)this.onRemove(this.data[t]);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 i=this.get(this.order[0]);i&&this.onRemove(i)}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){for(this.max=t;this.order.length>this.max;){var e=this.get(this.order[0]);e&&this.onRemove(e)}return this}},{}],154:[function(t,e,i){"use strict";function n(t,e,i){if(i=i||r.ACCESS_TOKEN,!i&&r.REQUIRE_ACCESS_TOKEN)throw new Error("An API access token is required to use Mapbox GL. See https://www.mapbox.com/developers/api/#access-tokens");if(t=t.replace(/^mapbox:\/\//,r.API_URL+e),t+=-1!==t.indexOf("?")?"&access_token=":"?access_token=",r.REQUIRE_ACCESS_TOKEN){if("s"===i[0])throw new Error("Use a public access token (pk.*) with Mapbox GL JS, not a secret access token (sk.*). See https://www.mapbox.com/developers/api/#access-tokens");t+=i}return t}var r=t("./config"),o=t("./browser");e.exports.normalizeStyleURL=function(t,e){if(!t.match(/^mapbox:\/\/styles\//))return t;var i=t.split("/"),r=i[3],o=i[4],a=i[5]?"/draft":"";return n("mapbox://"+r+"/"+o+a,"/styles/v1/",e)},e.exports.normalizeSourceURL=function(t,e){return t.match(/^mapbox:\/\//)?n(t+".json","/v4/",e)+"&secure":t},e.exports.normalizeGlyphsURL=function(t,e){if(!t.match(/^mapbox:\/\//))return t;var i=t.split("/")[3];return n("mapbox://"+i+"/{fontstack}/{range}.pbf","/fonts/v1/",e)},e.exports.normalizeSpriteURL=function(t,e,i,r){if(!t.match(/^mapbox:\/\/sprites\//))return t+e+i;var o=t.split("/"),a=o[3],s=o[4],l=o[5]?"/draft":"";return n("mapbox://"+a+"/"+s+l+"/sprite"+e+i,"/styles/v1/",r)},e.exports.normalizeTileURL=function(t,e,i){if(!e||!e.match(/^mapbox:\/\//))return t;t=t.replace(/([?&]access_token=)tk\.[^&]+/,"$1"+r.ACCESS_TOKEN);var n=o.supportsWebp?"webp":"$1";return t.replace(/\.((?:png|jpg)\d*)(?=$|\?)/,o.devicePixelRatio>=2||512===i?"@2x."+n:"."+n)}},{"./browser":143,"./config":147}],155:[function(t,e,i){"use strict";function n(t){function e(){f.apply(this,arguments)}function i(){d.apply(this,arguments),this.members=e.prototype.members}var n=JSON.stringify(t);if(v[n])return v[n];void 0===t.alignment&&(t.alignment=1),e.prototype=Object.create(f.prototype);var s=0,u=0,y=["Uint8"];return e.prototype.members=t.members.map(function(i){i={name:i.name,type:i.type,components:i.components||1},p(i.name.length),p(i.type in m),y.indexOf(i.type)<0&&y.push(i.type);var n=a(i.type);u=Math.max(u,n),i.offset=s=o(s,Math.max(t.alignment,n));for(var r=0;r<i.components;r++)Object.defineProperty(e.prototype,i.name+(1===i.components?"":r),{get:c(i,r),set:h(i,r)});return s+=n*i.components,i}),e.prototype.alignment=t.alignment,e.prototype.size=o(s,Math.max(u,t.alignment)),i.serialize=r,i.prototype=Object.create(d.prototype),i.prototype.StructType=e,i.prototype.bytesPerElement=e.prototype.size,i.prototype.emplaceBack=l(e.prototype.members,e.prototype.size),i.prototype._usedTypes=y,v[n]=i,i}function r(){return{members:this.prototype.StructType.prototype.members,alignment:this.prototype.StructType.prototype.alignment,bytesPerElement:this.prototype.bytesPerElement}}function o(t,e){return Math.ceil(t/e)*e}function a(t){return m[t].BYTES_PER_ELEMENT}function s(t){return t.toLowerCase()}function l(t,e){for(var i=[],n=[],r="var i = this.length;\nthis.resize(this.length + 1);\n",o=0;o<t.length;o++){var l=t[o],u=a(l.type);i.indexOf(u)<0&&(i.push(u),r+="var o"+u.toFixed(0)+" = i * "+(e/u).toFixed(0)+";\n");for(var c=0;c<l.components;c++){var h="v"+n.length,f="o"+u.toFixed(0)+" + "+(l.offset/u+c).toFixed(0);r+="this."+s(l.type)+"["+f+"] = "+h+";\n",n.push(h)}}return r+="return i;",new Function(n,r)}function u(t,e){var i="this._pos"+a(t.type).toFixed(0),n=(t.offset/a(t.type)+e).toFixed(0),r=i+" + "+n;return"this._structArray."+s(t.type)+"["+r+"]"}function c(t,e){return new Function([],"return "+u(t,e)+";")}function h(t,e){return new Function(["x"],u(t,e)+" = x;")}function f(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}function d(t){void 0!==t?(this.arrayBuffer=t.arrayBuffer,this.length=t.length,this.capacity=this.arrayBuffer.byteLength/this.bytesPerElement,this._refreshViews()):(this.capacity=-1,this.resize(0))}var p=t("assert");e.exports=n;var m={Int8:Int8Array,Uint8:Uint8Array,Uint8Clamped:Uint8ClampedArray,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array,Float64:Float64Array},v={};d.prototype.DEFAULT_CAPACITY=128,d.prototype.RESIZE_MULTIPLIER=5,d.prototype.serialize=function(){return this.trim(),{length:this.length,arrayBuffer:this.arrayBuffer}},d.prototype.get=function(t){return new this.StructType(this,t)},d.prototype.trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},d.prototype.resize=function(t){if(this.length=t,t>this.capacity){this.capacity=Math.max(t,Math.floor(this.capacity*this.RESIZE_MULTIPLIER),this.DEFAULT_CAPACITY),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},d.prototype._refreshViews=function(){for(var t=0;t<this._usedTypes.length;t++){var e=this._usedTypes[t];this[s(e)]=new m[e](this.arrayBuffer)}}},{assert:176}],156:[function(t,e,i){"use strict";function n(t,e){return e.replace(/{([^{}()\[\]<>$=:;.,^]+)}/g,function(e,i){return i in t?t[i]:""})}e.exports=n},{}],157:[function(t,e,i){"use strict";var n=t("unitbezier"),r=t("../geo/coordinate");i.easeCubicInOut=function(t){if(0>=t)return 0;if(t>=1)return 1;var e=t*t,i=e*t;return 4*(.5>t?i:3*(t-e)+i-.75)},i.bezier=function(t,e,i,r){var o=new n(t,e,i,r);return function(t){return o.solve(t)}},i.ease=i.bezier(.25,.1,.25,1),i.premultiply=function(t){if(!t)return null;var e=t[3];return[t[0]*e,t[1]*e,t[2]*e,e]},i.clamp=function(t,e,i){return Math.min(i,Math.max(e,t))},i.wrap=function(t,e,i){var n=i-e,r=((t-e)%n+n)%n+e;return r===e?i:r},i.coalesce=function(){for(var t=0;t<arguments.length;t++){var e=arguments[t];if(null!==e&&void 0!==e)return e}},i.asyncAll=function(t,e,i){if(!t.length)return i(null,[]);var n=t.length,r=new Array(t.length),o=null;t.forEach(function(t,a){e(t,function(t,e){t&&(o=t),r[a]=e,0===--n&&i(o,r)})})},i.keysDifference=function(t,e){var i=[];for(var n in t)n in e||i.push(n);return i},i.extend=function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)t[n]=i[n]}return t},i.extendAll=function(t,e){for(var i in e)Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(e,i));return t},i.inherit=function(t,e){var n="function"==typeof t?t.prototype:t,r=Object.create(n);return i.extendAll(r,e),r},i.pick=function(t,e){for(var i={},n=0;n<e.length;n++){var r=e[n];r in t&&(i[r]=t[r])}return i};var o=1;i.uniqueId=function(){return o++},i.debounce=function(t,e){var i,n;return function(){n=arguments,clearTimeout(i),i=setTimeout(function(){t.apply(null,n)},e)}},i.bindAll=function(t,e){t.forEach(function(t){e[t]=e[t].bind(e)})},i.bindHandlers=function(t){for(var e in t)"function"==typeof t[e]&&0===e.indexOf("_on")&&(t[e]=t[e].bind(t))},i.setOptions=function(t,e){t.hasOwnProperty("options")||(t.options=t.options?Object.create(t.options):{});for(var i in e)t.options[i]=e[i];return t.options},i.getCoordinatesCenter=function(t){for(var e=1/0,i=1/0,n=-(1/0),o=-(1/0),a=0;a<t.length;a++)e=Math.min(e,t[a].column),i=Math.min(i,t[a].row),n=Math.max(n,t[a].column),o=Math.max(o,t[a].row);var s=n-e,l=o-i,u=Math.max(s,l);return new r((e+n)/2,(i+o)/2,0).zoomTo(Math.floor(-Math.log(u)/Math.LN2))},i.endsWith=function(t,e){return-1!==t.indexOf(e,t.length-e.length)},i.startsWith=function(t,e){return 0===t.indexOf(e)},i.mapObject=function(t,e,i){var n={};for(var r in t)n[r]=e.call(i||this,t[r],r,t);return n},i.filterObject=function(t,e,i){var n={};for(var r in t)e.call(i||this,t[r],r,t)&&(n[r]=t[r]);return n},i.deepEqual=function a(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(var i=0;i<t.length;i++)if(!a(t[i],e[i]))return!1;return!0}if("object"==typeof t){if("object"!=typeof e)return!1;var n=Object.keys(t);if(n.length!==Object.keys(e).length)return!1;for(var r in t)if(!a(t[r],e[r]))return!1;return!0}return t===e},i.clone=function s(t){return Array.isArray(t)?t.map(i.clone):"object"==typeof t?i.mapObject(t,i.clone):t},i.arraysIntersect=function(t,e){for(var i=0;i<t.length;i++)if(e.indexOf(t[i])>=0)return!0;return!1}},{"../geo/coordinate":63,unitbezier:165}],158:[function(t,e,i){"use strict";function n(t,e,i,n){this._vectorTileFeature=t,t._z=e,t._x=i,t._y=n,this.properties=t.properties,t._id&&(this.id=t._id)}function r(t,e,i,n,r){for(var o=e*Math.pow(2,i),a=e*n,s=e*r,l=0;l<t.length;l++)for(var u=t[l],c=0;c<u.length;c++){var h=u[c],f=180-360*(h.y+s)/o;u[c]=[360*(h.x+a)/o-180,360/Math.PI*Math.atan(Math.exp(f*Math.PI/180))-90]}return t}var o=t("vector-tile").VectorTileFeature;e.exports=n,n.prototype={type:"Feature",get geometry(){if(void 0===this._geometry){var t=this._vectorTileFeature,e=r(t.loadGeometry(),t.extent,t._z,t._x,t._y),i=o.types[t.type];"Point"===i&&1===e.length?e=e[0][0]:"Point"===i?(e=e[0],i="MultiPoint"):"LineString"===i&&1===e.length?e=e[0]:"LineString"===i&&(i="MultiLineString"),this._geometry={type:i,coordinates:e},this._vectorTileFeature=null}return this._geometry},set geometry(t){this._geometry=t},toJSON:function(){var t={};for(var e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&(t[e]=this[e]);return t}}},{"vector-tile":166}],159:[function(t,e,i){"use strict";function n(t){var e;t&&t.length&&(e=t,t=e.length);var i=new Uint8Array(t||0);return e&&i.set(e),i.readUInt32LE=a.readUInt32LE,i.writeUInt32LE=a.writeUInt32LE,i.readInt32LE=a.readInt32LE,i.writeInt32LE=a.writeInt32LE,i.readFloatLE=a.readFloatLE,i.writeFloatLE=a.writeFloatLE,i.readDoubleLE=a.readDoubleLE,i.writeDoubleLE=a.writeDoubleLE,i.toString=a.toString,i.write=a.write,i.slice=a.slice,i.copy=a.copy,i._isBuffer=!0,i}function r(t){for(var e=t.length,i=[],n=0,r,o;e>n;n++){if(r=t.charCodeAt(n),r>55295&&57344>r){if(!o){r>56319||n+1===e?i.push(239,191,189):o=r;continue}if(56320>r){i.push(239,191,189),o=r;continue}r=o-55296<<10|r-56320|65536,o=null}else o&&(i.push(239,191,189),o=null);128>r?i.push(r):2048>r?i.push(r>>6|192,63&r|128):65536>r?i.push(r>>12|224,r>>6&63|128,63&r|128):i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}return i}e.exports=n;var o=t("ieee754"),a,s,l;a={readUInt32LE:function(t){return(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},writeUInt32LE:function(t,e){this[e]=t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24},readInt32LE:function(t){return(this[t]|this[t+1]<<8|this[t+2]<<16)+(this[t+3]<<24)},readFloatLE:function(t){return o.read(this,t,!0,23,4)},readDoubleLE:function(t){return o.read(this,t,!0,52,8)},writeFloatLE:function(t,e){return o.write(this,t,e,!0,23,4)},writeDoubleLE:function(t,e){return o.write(this,t,e,!0,52,8)},toString:function(t,e,i){var n="",r="";e=e||0,i=Math.min(this.length,i||this.length);for(var o=e;i>o;o++){var a=this[o];127>=a?(n+=decodeURIComponent(r)+String.fromCharCode(a),r=""):r+="%"+a.toString(16)}return n+=decodeURIComponent(r)},write:function(t,e){for(var i=t===s?l:r(t),n=0;n<i.length;n++)this[e+n]=i[n]},slice:function(t,e){return this.subarray(t,e)},copy:function(t,e){e=e||0;for(var i=0;i<this.length;i++)t[e+i]=this[i]}},a.writeInt32LE=a.writeUInt32LE,n.byteLength=function(t){return s=t,l=r(t),l.length},n.isBuffer=function(t){return!(!t||!t._isBuffer)}},{ieee754:23}],160:[function(t,e,i){(function(i){"use strict";function n(t){this.buf=v.isBuffer(t)?t:new v(t||0),this.pos=0,this.length=this.buf.length}function r(t,e){var i=e.buf,n;if(n=i[e.pos++],t+=268435456*(127&n),128>n)return t;if(n=i[e.pos++],t+=34359738368*(127&n),128>n)return t;if(n=i[e.pos++],t+=4398046511104*(127&n),128>n)return t;if(n=i[e.pos++],t+=562949953421312*(127&n),128>n)return t;if(n=i[e.pos++],t+=72057594037927940*(127&n),128>n)return t;if(n=i[e.pos++],t+=0x8000000000000000*(127&n),128>n)return t;throw new Error("Expected varint not more than 10 bytes")}function o(t,e){e.realloc(10);for(var i=e.pos+10;t>=1;){if(e.pos>=i)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,i){var n=16383>=e?1:2097151>=e?2:268435455>=e?3:Math.ceil(Math.log(e)/(7*Math.LN2));i.realloc(n);for(var r=i.pos-1;r>=t;r--)i.buf[r+n]=i.buf[r]}function s(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function l(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function u(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function c(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function h(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function f(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function d(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function p(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function m(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}e.exports=n;var v=i.Buffer||t("./buffer");n.Varint=0,n.Fixed64=1,n.Bytes=2,n.Fixed32=5;var y=4294967296,_=1/y,g=Math.pow(2,63);n.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var n=this.readVarint(),r=n>>3,o=this.pos;t(r,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)*y;return this.pos+=8,t},readSFixed64:function(){var t=this.buf.readUInt32LE(this.pos)+this.buf.readInt32LE(this.pos+4)*y;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=this.buf,e,i;return i=t[this.pos++],e=127&i,128>i?e:(i=t[this.pos++],e|=(127&i)<<7,128>i?e:(i=t[this.pos++],
e|=(127&i)<<14,128>i?e:(i=t[this.pos++],e|=(127&i)<<21,128>i?e:r(e,this))))},readVarint64:function(){var t=this.pos,e=this.readVarint();if(g>e)return e;for(var i=this.pos-2;255===this.buf[i];)i--;t>i&&(i=t),e=0;for(var n=0;i-t+1>n;n++){var r=127&~this.buf[t+n];e+=4>n?r<<7*n:r*Math.pow(2,7*n)}return-e-1},readSVarint:function(){var t=this.readVarint();return t%2===1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.buf.toString("utf8",this.pos,t);return this.pos=t,e},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.slice(this.pos,t);return this.pos=t,e},readPackedVarint:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readVarint());return e},readPackedSVarint:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(t){var e=7&t;if(e===n.Varint)for(;this.buf[this.pos++]>127;);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;e<this.pos+t;)e*=2;if(e!==this.length){var i=new v(e);this.buf.copy(i),this.buf=i,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.slice(0,this.length)},writeFixed32:function(t){this.realloc(4),this.buf.writeUInt32LE(t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),this.buf.writeInt32LE(t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),this.buf.writeInt32LE(-1&t,this.pos),this.buf.writeUInt32LE(Math.floor(t*_),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),this.buf.writeInt32LE(-1&t,this.pos),this.buf.writeInt32LE(Math.floor(t*_),this.pos+4),this.pos+=8},writeVarint:function(t){return t=+t,t>268435455?void o(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),void(127>=t||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),127>=t||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),127>=t||(this.buf[this.pos++]=t>>>7&127)))))},writeSVarint:function(t){this.writeVarint(0>t?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t);var e=v.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 i=0;e>i;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,e){this.pos++;var i=this.pos;t(e,this);var n=this.pos-i;n>=128&&a(i,n,this),this.pos=i-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,i){this.writeTag(t,n.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){this.writeMessage(t,s,e)},writePackedSVarint:function(t,e){this.writeMessage(t,l,e)},writePackedBoolean:function(t,e){this.writeMessage(t,h,e)},writePackedFloat:function(t,e){this.writeMessage(t,u,e)},writePackedDouble:function(t,e){this.writeMessage(t,c,e)},writePackedFixed32:function(t,e){this.writeMessage(t,f,e)},writePackedSFixed32:function(t,e){this.writeMessage(t,d,e)},writePackedFixed64:function(t,e){this.writeMessage(t,p,e)},writePackedSFixed64:function(t,e){this.writeMessage(t,m,e)},writeBytesField:function(t,e){this.writeTag(t,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 global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./buffer":159}],161:[function(t,e,i){"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,i=t.y-this.y;return e*e+i*i},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,i=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=i,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),i=Math.sin(t),n=e*this.x-i*this.y,r=i*this.x+e*this.y;return this.x=n,this.y=r,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}},{}],162:[function(t,e,i){void function(t,n){"function"==typeof define&&define.amd?define(n):"object"==typeof i?e.exports=n():t.resolveUrl=n()}(this,function(){function t(){var t=arguments.length;if(0===t)throw new Error("resolveUrl requires at least one argument; got none.");var e=document.createElement("base");if(e.href=arguments[0],1===t)return e.href;var i=document.getElementsByTagName("head")[0];i.insertBefore(e,i.firstChild);for(var n=document.createElement("a"),r,o=1;t>o;o++)n.href=arguments[o],r=n.href,e.href=r;return i.removeChild(e),r}return t})},{}],163:[function(t,e,i){"use strict";function n(t,e,i){i=i||{},this.w=t||64,this.h=e||64,this.autoResize=!!i.autoResize,this.shelves=[],this.stats={},this.count=function(t){this.stats[t]=(0|this.stats[t])+1}}function r(t,e,i){this.x=0,this.y=t,this.w=this.free=e,this.h=i}e.exports=n,n.prototype.pack=function(t,e){t=[].concat(t),e=e||{};for(var i=[],n,r,o,a=0;a<t.length;a++)if(n=t[a].w||t[a].width,r=t[a].h||t[a].height,n&&r){if(o=this.packOne(n,r),!o)continue;e.inPlace&&(t[a].x=o.x,t[a].y=o.y),i.push(o)}return i},n.prototype.packOne=function(t,e){for(var i=0,n={shelf:-1,waste:1/0},o,a,s=0;s<this.shelves.length;s++){if(o=this.shelves[s],i+=o.h,e===o.h&&t<=o.free)return this.count(e),o.alloc(t,e);e>o.h||t>o.free||e<o.h&&t<=o.free&&(a=o.h-e,a<n.waste&&(n.waste=a,n.shelf=s))}if(-1!==n.shelf)return o=this.shelves[n.shelf],this.count(e),o.alloc(t,e);if(e<=this.h-i&&t<=this.w)return o=new r(i,this.w,e),this.shelves.push(o),this.count(e),o.alloc(t,e);if(this.autoResize){var l,u,c,h;return l=u=this.h,c=h=this.w,(l>=c||t>c)&&(h=2*Math.max(t,c)),(c>l||e>l)&&(u=2*Math.max(e,l)),this.resize(h,u),this.packOne(t,e)}return null},n.prototype.clear=function(){this.shelves=[],this.stats={}},n.prototype.resize=function(t,e){if(t<this.w||e<this.h)return!1;this.w=t,this.h=e;for(var i=0;i<this.shelves.length;i++)this.shelves[i].resize(t);return!0},r.prototype.alloc=function(t,e){if(t>this.free||e>this.h)return null;var i=this.x;return this.x+=t,this.free-=t,{x:i,y:this.y,w:t,h:e,width:t,height:e}},r.prototype.resize=function(t){return t<this.w?!1:(this.free+=t-this.w,this.w=t,!0)}},{}],164:[function(t,e,i){"use strict";function n(t){return new r(t)}function r(t){this.options=d(Object.create(this.options),t),this.trees=new Array(this.options.maxZoom+1)}function o(t,e,i,n){return{x:t,y:e,zoom:1/0,id:n,numPoints:i}}function a(t,e){var i=t.geometry.coordinates;return o(u(i[0]),c(i[1]),1,e)}function s(t){return{type:"Feature",properties:l(t),geometry:{type:"Point",coordinates:[h(t.x),f(t.y)]}}}function l(t){var e=t.numPoints,i=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:i}}function u(t){return t/360+.5}function c(t){var e=Math.sin(t*Math.PI/180),i=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return 0>i?0:i>1?1:i}function h(t){return 360*(t-.5)}function f(t){var e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function d(t,e){for(var i in e)t[i]=e[i];return t}function p(t){return t.x}function m(t){return t.y}var v=t("kdbush");e.exports=n,r.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 i="prepare "+t.length+" points";e&&console.time(i),this.points=t;var n=t.map(a);e&&console.timeEnd(i);for(var r=this.options.maxZoom;r>=this.options.minZoom;r--){var o=+Date.now();this.trees[r+1]=v(n,p,m,this.options.nodeSize,Float32Array),n=this._cluster(n,r),e&&console.log("z%d: %d clusters in %dms",r,n.length,+Date.now()-o)}return this.trees[this.options.minZoom]=v(n,p,m,this.options.nodeSize,Float32Array),e&&console.timeEnd("total time"),this},getClusters:function(t,e){for(var i=this.trees[this._limitZoom(e)],n=i.range(u(t[0]),c(t[3]),u(t[2]),c(t[1])),r=[],o=0;o<n.length;o++){var a=i.points[n[o]];r.push(-1!==a.id?this.points[a.id]:s(a))}return r},getTile:function(t,e,i){var n=Math.pow(2,t),r=this.options.extent,o=this.options.radius/r,a=this.trees[this._limitZoom(t)],s=a.range((e-o)/n,(i-o)/n,(e+1+o)/n,(i+1+o)/n);if(!s.length)return null;for(var u={features:[]},c=0;c<s.length;c++){var h=a.points[s[c]],f={type:1,geometry:[[Math.round(r*(h.x*n-e)),Math.round(r*(h.y*n-i))]],tags:-1!==h.id?this.points[h.id].properties:l(h)};u.features.push(f)}return u},_limitZoom:function(t){return Math.max(this.options.minZoom,Math.min(t,this.options.maxZoom+1))},_cluster:function(t,e){for(var i=[],n=this.options.radius/(this.options.extent*Math.pow(2,e)),r=0;r<t.length;r++){var a=t[r];if(!(a.zoom<=e)){a.zoom=e;for(var s=this.trees[e+1],l=s.within(a.x,a.y,n),u=!1,c=a.numPoints,h=a.x*c,f=a.y*c,d=0;d<l.length;d++){var p=s.points[l[d]];e<p.zoom&&(u=!0,p.zoom=e,h+=p.x*p.numPoints,f+=p.y*p.numPoints,c+=p.numPoints)}i.push(u?o(h/c,f/c,c,-1):a)}}return i}}},{kdbush:24}],165:[function(t,e,i){function n(t,e,i,n){this.cx=3*t,this.bx=3*(i-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=i,this.p2y=n}e.exports=n,n.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},n.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},n.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},n.prototype.solveCurveX=function(t,e){"undefined"==typeof e&&(e=1e-6);var i,n,r,o,a;for(r=t,a=0;8>a;a++){if(o=this.sampleCurveX(r)-t,Math.abs(o)<e)return r;var s=this.sampleCurveDerivativeX(r);if(Math.abs(s)<1e-6)break;r-=o/s}if(i=0,n=1,r=t,i>r)return i;if(r>n)return n;for(;n>i;){if(o=this.sampleCurveX(r),Math.abs(o-t)<e)return r;t>o?i=r:n=r,r=.5*(n-i)+i}return r},n.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}},{}],166:[function(t,e,i){e.exports.VectorTile=t("./lib/vectortile.js"),e.exports.VectorTileFeature=t("./lib/vectortilefeature.js"),e.exports.VectorTileLayer=t("./lib/vectortilelayer.js")},{"./lib/vectortile.js":167,"./lib/vectortilefeature.js":168,"./lib/vectortilelayer.js":169}],167:[function(t,e,i){"use strict";function n(t,e){this.layers=t.readFields(r,{},e)}function r(t,e,i){if(3===t){var n=new o(i,i.readVarint()+i.pos);n.length&&(e[n.name]=n)}}var o=t("./vectortilelayer");e.exports=n},{"./vectortilelayer":169}],168:[function(t,e,i){"use strict";function n(t,e,i,n,o){this.properties={},this.extent=i,this.type=0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=o,t.readFields(r,this,e)}function r(t,e,i){1==t?e._id=i.readVarint():2==t?o(i,e):3==t?e.type=i.readVarint():4==t&&(e._geometry=i.pos)}function o(t,e){for(var i=t.readVarint()+t.pos;t.pos<i;){var n=e._keys[t.readVarint()],r=e._values[t.readVarint()];e.properties[n]=r}}function a(t){var e=t.length;if(1>=e)return[t];for(var i=[],n,r,o=0;e>o;o++){var a=s(t[o]);0!==a&&(void 0===r&&(r=0>a),r===0>a?(n&&i.push(n),n=[t[o]]):n.push(t[o]))}return n&&i.push(n),i}function s(t){for(var e=0,i=0,n=t.length,r=n-1,o,a;n>i;r=i++)o=t[i],a=t[r],e+=(a.x-o.x)*(o.y+a.y);return e}var l=t("point-geometry");e.exports=n,n.types=["Unknown","Point","LineString","Polygon"],n.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,i=1,n=0,r=0,o=0,a=[],s;t.pos<e;){if(!n){var u=t.readVarint();i=7&u,n=u>>3}if(n--,1===i||2===i)r+=t.readSVarint(),o+=t.readSVarint(),1===i&&(s&&a.push(s),s=[]),s.push(new l(r,o));else{if(7!==i)throw new Error("unknown command "+i);s&&s.push(s[0].clone())}}return s&&a.push(s),a},n.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,i=1,n=0,r=0,o=0,a=1/0,s=-(1/0),l=1/0,u=-(1/0);t.pos<e;){if(!n){var c=t.readVarint();i=7&c,n=c>>3}if(n--,1===i||2===i)r+=t.readSVarint(),o+=t.readSVarint(),a>r&&(a=r),r>s&&(s=r),l>o&&(l=o),o>u&&(u=o);else if(7!==i)throw new Error("unknown command "+i)}return[a,l,s,u]},n.prototype.toGeoJSON=function(t,e,i){function r(t){for(var e=0;e<t.length;e++){var i=t[e],n=180-360*(i.y+l)/o;t[e]=[360*(i.x+s)/o-180,360/Math.PI*Math.atan(Math.exp(n*Math.PI/180))-90]}}var o=this.extent*Math.pow(2,i),s=this.extent*t,l=this.extent*e,u=this.loadGeometry(),c=n.types[this.type],h,f;switch(this.type){case 1:var d=[];for(h=0;h<u.length;h++)d[h]=u[h][0];u=d,r(u);break;case 2:for(h=0;h<u.length;h++)r(u[h]);break;case 3:for(u=a(u),h=0;h<u.length;h++)for(f=0;f<u[h].length;f++)r(u[h][f])}1===u.length?u=u[0]:c="Multi"+c;var p={type:"Feature",geometry:{type:c,coordinates:u},properties:this.properties};return"_id"in this&&(p.id=this._id),p}},{"point-geometry":161}],169:[function(t,e,i){"use strict";function n(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(r,this,e),this.length=this._features.length}function r(t,e,i){15===t?e.version=i.readVarint():1===t?e.name=i.readString():5===t?e.extent=i.readVarint():2===t?e._features.push(i.pos):3===t?e._keys.push(i.readString()):4===t&&e._values.push(o(i))}function o(t){for(var e=null,i=t.readVarint()+t.pos;t.pos<i;){var n=t.readVarint()>>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(0>t||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":168}],170:[function(t,e,i){function n(t){var e=[];for(var i in t.layers)e.push(o(t.layers[i]));var n=new c;return h.tile.write({layers:e},n),n.finish()}function r(t){var e={};for(var i in t)e[i]=new f(t[i].features),e[i].name=i;return n({layers:e})}function o(t){for(var e={name:t.name||"",version:t.version||1,extent:t.extent||4096,keys:[],values:[],features:[]},i={},n={},r=0;r<t.length;r++){var o=t.feature(r);o.geometry=l(o.loadGeometry());var a=[];for(var s in o.properties){var c=i[s];"undefined"==typeof c&&(e.keys.push(s),c=e.keys.length-1,i[s]=c);var h=u(o.properties[s]),f=n[h.key];"undefined"==typeof f&&(e.values.push(h),f=e.values.length-1,n[h.key]=f),a.push(c),a.push(f)}o.tags=a,e.features.push(o)}return e}function a(t,e){return(e<<3)+(7&t)}function s(t){return t<<1^t>>31}function l(t){for(var e=[],i=0,n=0,r=t.length,o=0;r>o;o++){var l=t[o];e.push(a(1,1));for(var u=0;u<l.length;u++){1===u&&e.push(a(2,l.length-1));var c=l[u].x-i,h=l[u].y-n;e.push(s(c),s(h)),i+=c,n+=h}}return e}function u(t){var e,i=typeof t;return e="string"===i?{string_value:t}:"boolean"===i?{bool_value:t}:"number"===i?t!==(0|t)?{float_value:t}:0>t?{sint_value:t}:{uint_value:t}:{string_value:""+t},e.key=i+":"+t,e}var c=t("pbf"),h=t("./vector-tile-pb"),f=t("./lib/geojson_wrapper");e.exports=n,e.exports.fromVectorTileJs=n,e.exports.fromGeojsonVt=r,e.exports.GeoJSONWrapper=f},{"./lib/geojson_wrapper":171,"./vector-tile-pb":172,pbf:160}],171:[function(t,e,i){"use strict";function n(t){this.features=t,this.length=t.length}function r(t){this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=4096}var o=t("point-geometry"),a=t("vector-tile").VectorTileFeature;e.exports=n,n.prototype.feature=function(t){return new r(this.features[t])},r.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var e=0;e<t.length;e++){for(var i=t[e],n=[],r=0;r<i.length;r++)n.push(new o(i[r][0],i[r][1]));this.geometry.push(n)}return this.geometry},r.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,i=-(1/0),n=1/0,r=-(1/0),o=0;o<t.length;o++)for(var a=t[o],s=0;s<a.length;s++){var l=a[s];e=Math.min(e,l.x),i=Math.max(i,l.x),n=Math.min(n,l.y),r=Math.max(r,l.y)}return[e,n,i,r]},r.prototype.toGeoJSON=a.prototype.toGeoJSON},{"point-geometry":161,"vector-tile":166}],172:[function(t,e,i){"use strict";function n(t,e){return t.readFields(r,{layers:[]},e)}function r(t,e,i){3===t&&e.layers.push(f(i,i.readVarint()+i.pos))}function o(t,e){var i;if(void 0!==t.layers)for(i=0;i<t.layers.length;i++)e.writeMessage(3,p,t.layers[i])}function a(t,e){return t.readFields(s,{},e)}function s(t,e,i){1===t?e.string_value=i.readString():2===t?e.float_value=i.readFloat():3===t?e.double_value=i.readDouble():4===t?e.int_value=i.readVarint():5===t?e.uint_value=i.readVarint():6===t?e.sint_value=i.readSVarint():7===t&&(e.bool_value=i.readBoolean())}function l(t,e){void 0!==t.string_value&&e.writeStringField(1,t.string_value),void 0!==t.float_value&&e.writeFloatField(2,t.float_value),void 0!==t.double_value&&e.writeDoubleField(3,t.double_value),void 0!==t.int_value&&e.writeVarintField(4,t.int_value),void 0!==t.uint_value&&e.writeVarintField(5,t.uint_value),void 0!==t.sint_value&&e.writeSVarintField(6,t.sint_value),void 0!==t.bool_value&&e.writeBooleanField(7,t.bool_value)}function u(t,e){var i=t.readFields(c,{},e);return void 0===i.type&&(i.type="Unknown"),i}function c(t,e,i){1===t?e.id=i.readVarint():2===t?e.tags=i.readPackedVarint():3===t?e.type=i.readVarint():4===t&&(e.geometry=i.readPackedVarint())}function h(t,e){void 0!==t.id&&e.writeVarintField(1,t.id),void 0!==t.tags&&e.writePackedVarint(2,t.tags),void 0!==t.type&&e.writeVarintField(3,t.type),void 0!==t.geometry&&e.writePackedVarint(4,t.geometry)}function f(t,e){return t.readFields(d,{features:[],keys:[],values:[]},e)}function d(t,e,i){15===t?e.version=i.readVarint():1===t?e.name=i.readString():2===t?e.features.push(u(i,i.readVarint()+i.pos)):3===t?e.keys.push(i.readString()):4===t?e.values.push(a(i,i.readVarint()+i.pos)):5===t&&(e.extent=i.readVarint())}function p(t,e){void 0!==t.version&&e.writeVarintField(15,t.version),void 0!==t.name&&e.writeStringField(1,t.name);var i;if(void 0!==t.features)for(i=0;i<t.features.length;i++)e.writeMessage(2,h,t.features[i]);if(void 0!==t.keys)for(i=0;i<t.keys.length;i++)e.writeStringField(3,t.keys[i]);if(void 0!==t.values)for(i=0;i<t.values.length;i++)e.writeMessage(4,l,t.values[i]);void 0!==t.extent&&e.writeVarintField(5,t.extent)}var m=i.tile={read:n,write:o};m.GeomType={Unknown:0,Point:1,LineString:2,Polygon:3},m.value={read:a,write:l},m.feature={read:u,write:h},m.layer={read:f,write:p}},{}],173:[function(t,e,i){var n=arguments[3],r=arguments[4],o=arguments[5],a=JSON.stringify;e.exports=function(t,e){for(var i,s=Object.keys(o),l=0,u=s.length;u>l;l++){var c=s[l],h=o[c].exports;if(h===t||h&&h["default"]===t){i=c;break}}if(!i){i=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var f={},l=0,u=s.length;u>l;l++){var c=s[l];f[c]=c}r[i]=[Function(["require","module","exports"],"("+t+")(self)"),f]}var d=Math.floor(Math.pow(16,8)*Math.random()).toString(16),p={};p[i]=i,r[d]=[Function(["require"],"var f = require("+a(i)+");(f.default ? f.default : f)(self);"),p];var m="("+n+")({"+Object.keys(r).map(function(t){return a(t)+":["+r[t][0]+","+a(r[t][1])+"]"}).join(",")+"},{},["+a(d)+"])",v=window.URL||window.webkitURL||window.mozURL||window.msURL,y=new Blob([m],{type:"text/javascript"});if(e&&e.bare)return y;var _=v.createObjectURL(y),g=new Worker(_);return"function"==typeof v.revokeObjectURL&&v.revokeObjectURL(_),g}},{}],174:[function(t,e,i){e.exports.RADIUS=6378137,e.exports.FLATTENING=1/298.257223563,e.exports.POLAR_RADIUS=6356752.3142},{}],175:[function(t,e,i){var n=t("mapbox-gl");n.accessToken="pk.eyJ1IjoiZW50c29lIiwiYSI6ImNpb2xnNHcydTAwMXF3YW1iZmJjNXh1OGsifQ.frc5MlZWaMjTMbtaJbRZPw";var r=new n.Map({container:"map",style:"mapbox://styles/mapbox/streets-v8",center:[19.56,52.41],zoom:3.42,hash:!0,minZoom:2.5,attributionControl:!1})},{"mapbox-gl":68}],176:[function(t,e,i){function n(t,e){return d.isUndefined(e)?""+e:d.isNumber(e)&&!isFinite(e)?e.toString():d.isFunction(e)||d.isRegExp(e)?e.toString():e}function r(t,e){return d.isString(t)?t.length<e?t:t.slice(0,e):t}function o(t){return r(JSON.stringify(t.actual,n),128)+" "+t.operator+" "+r(JSON.stringify(t.expected,n),128)}function a(t,e,i,n,r){throw new v.AssertionError({message:i,actual:t,expected:e,operator:n,stackStartFunction:r})}function s(t,e){t||a(t,!0,e,"==",v.ok)}function l(t,e){if(t===e)return!0;if(d.isBuffer(t)&&d.isBuffer(e)){if(t.length!=e.length)return!1;for(var i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}return d.isDate(t)&&d.isDate(e)?t.getTime()===e.getTime():d.isRegExp(t)&&d.isRegExp(e)?t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase:d.isObject(t)||d.isObject(e)?c(t,e):t==e}function u(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function c(t,e){if(d.isNullOrUndefined(t)||d.isNullOrUndefined(e))return!1;if(t.prototype!==e.prototype)return!1;if(d.isPrimitive(t)||d.isPrimitive(e))return t===e;var i=u(t),n=u(e);if(i&&!n||!i&&n)return!1;if(i)return t=p.call(t),e=p.call(e),l(t,e);var r=y(t),o=y(e),a,s;if(r.length!=o.length)return!1;for(r.sort(),o.sort(),s=r.length-1;s>=0;s--)if(r[s]!=o[s])return!1;for(s=r.length-1;s>=0;s--)if(a=r[s],!l(t[a],e[a]))return!1;return!0}function h(t,e){return t&&e?"[object RegExp]"==Object.prototype.toString.call(e)?e.test(t):t instanceof e?!0:e.call({},t)===!0:!1}function f(t,e,i,n){var r;d.isString(i)&&(n=i,i=null);try{e()}catch(o){r=o}if(n=(i&&i.name?" ("+i.name+").":".")+(n?" "+n:"."),t&&!r&&a(r,i,"Missing expected exception"+n),!t&&h(r,i)&&a(r,i,"Got unwanted exception"+n),t&&r&&i&&!h(r,i)||!t&&r)throw r}var d=t("util/"),p=Array.prototype.slice,m=Object.prototype.hasOwnProperty,v=e.exports=s;v.AssertionError=function _(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=o(this),this.generatedMessage=!0);var e=t.stackStartFunction||a;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var i=new Error;if(i.stack){var n=i.stack,r=e.name,s=n.indexOf("\n"+r);if(s>=0){var l=n.indexOf("\n",s+1);n=n.substring(l+1)}this.stack=n}}},d.inherits(v.AssertionError,Error),v.fail=a,v.ok=s,v.equal=function g(t,e,i){t!=e&&a(t,e,i,"==",v.equal)},v.notEqual=function x(t,e,i){t==e&&a(t,e,i,"!=",v.notEqual)},v.deepEqual=function b(t,e,i){l(t,e)||a(t,e,i,"deepEqual",v.deepEqual)},v.notDeepEqual=function w(t,e,i){l(t,e)&&a(t,e,i,"notDeepEqual",v.notDeepEqual)},v.strictEqual=function M(t,e,i){t!==e&&a(t,e,i,"===",v.strictEqual)},v.notStrictEqual=function S(t,e,i){t===e&&a(t,e,i,"!==",v.notStrictEqual)},v["throws"]=function(t,e,i){f.apply(this,[!0].concat(p.call(arguments)))},v.doesNotThrow=function(t,e){f.apply(this,[!1].concat(p.call(arguments)))},v.ifError=function(t){if(t)throw t};var y=Object.keys||function(t){var e=[];for(var i in t)m.call(t,i)&&e.push(i);return e}},{"util/":181}],177:[function(t,e,i){"function"==typeof Object.create?e.exports=function n(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function r(t,e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}},{}],178:[function(t,e,i){(function(t){function e(t,e){for(var i=0,n=t.length-1;n>=0;n--){var r=t[n];"."===r?t.splice(n,1):".."===r?(t.splice(n,1),i++):i&&(t.splice(n,1),i--)}if(e)for(;i--;i)t.unshift("..");return t}function n(t,e){if(t.filter)return t.filter(e);for(var i=[],n=0;n<t.length;n++)e(t[n],n,t)&&i.push(t[n]);return i}var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,o=function(t){return r.exec(t).slice(1)};i.resolve=function(){for(var i="",r=!1,o=arguments.length-1;o>=-1&&!r;o--){var a=o>=0?arguments[o]:t.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(i=a+"/"+i,r="/"===a.charAt(0))}return i=e(n(i.split("/"),function(t){return!!t}),!r).join("/"),(r?"/":"")+i||"."},i.normalize=function(t){var r=i.isAbsolute(t),o="/"===a(t,-1);return t=e(n(t.split("/"),function(t){return!!t}),!r).join("/"),t||r||(t="."),t&&o&&(t+="/"),(r?"/":"")+t},i.isAbsolute=function(t){return"/"===t.charAt(0)},i.join=function(){var t=Array.prototype.slice.call(arguments,0);return i.normalize(n(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},i.relative=function(t,e){function n(t){for(var e=0;e<t.length&&""===t[e];e++);for(var i=t.length-1;i>=0&&""===t[i];i--);return e>i?[]:t.slice(e,i-e+1)}t=i.resolve(t).substr(1),e=i.resolve(e).substr(1);for(var r=n(t.split("/")),o=n(e.split("/")),a=Math.min(r.length,o.length),s=a,l=0;a>l;l++)if(r[l]!==o[l]){s=l;break}for(var u=[],l=s;l<r.length;l++)u.push("..");return u=u.concat(o.slice(s)),u.join("/")},i.sep="/",i.delimiter=":",i.dirname=function(t){var e=o(t),i=e[0],n=e[1];return i||n?(n&&(n=n.substr(0,n.length-1)),i+n):"."},i.basename=function(t,e){var i=o(t)[2];return e&&i.substr(-1*e.length)===e&&(i=i.substr(0,i.length-e.length)),i},i.extname=function(t){return o(t)[3]};var a="b"==="ab".substr(-1)?function(t,e,i){return t.substr(e,i)}:function(t,e,i){return 0>e&&(e=t.length+e),t.substr(e,i)}}).call(this,t("_process"))},{_process:179}],179:[function(t,e,i){function n(){u=!1,c.length?l=c.concat(l):h=-1,l.length&&r()}function r(){if(!u){var t=setTimeout(n);u=!0;for(var e=l.length;e;){for(c=l,l=[];++h<e;)c[h].run();h=-1,e=l.length}c=null,u=!1,clearTimeout(t)}}function o(t,e){this.fun=t,this.array=e}function a(){}var s=e.exports={},l=[],u=!1,c,h=-1;s.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];l.push(new o(t,e)),1!==l.length||u||setTimeout(r,0)},o.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={},s.on=a,s.addListener=a,s.once=a,s.off=a,s.removeListener=a,s.removeAllListeners=a,s.emit=a,s.binding=function(t){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(t){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},{}],180:[function(t,e,i){e.exports=function n(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],181:[function(t,e,i){(function(e,n){function r(t,e){var n={seen:[],stylize:a};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),m(e)?n.showHidden=e:e&&i._extend(n,e),b(n.showHidden)&&(n.showHidden=!1),b(n.depth)&&(n.depth=2),b(n.colors)&&(n.colors=!1),b(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=o),l(n,t,n.depth)}function o(t,e){var i=r.styles[e];return i?"["+r.colors[i][0]+"m"+t+"["+r.colors[i][1]+"m":t}function a(t,e){return t}function s(t){var e={};return t.forEach(function(t,i){e[t]=!0}),e}function l(t,e,n){if(t.customInspect&&e&&T(e.inspect)&&e.inspect!==i.inspect&&(!e.constructor||e.constructor.prototype!==e)){var r=e.inspect(n,t);return g(r)||(r=l(t,r,n)),r}var o=u(t,e);if(o)return o;var a=Object.keys(e),m=s(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(e)),E(e)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return c(e);if(0===a.length){if(T(e)){var v=e.name?": "+e.name:"";return t.stylize("[Function"+v+"]","special")}if(w(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(S(e))return t.stylize(Date.prototype.toString.call(e),"date");if(E(e))return c(e)}var y="",_=!1,x=["{","}"];if(p(e)&&(_=!0,x=["[","]"]),T(e)){var b=e.name?": "+e.name:"";y=" [Function"+b+"]"}if(w(e)&&(y=" "+RegExp.prototype.toString.call(e)),S(e)&&(y=" "+Date.prototype.toUTCString.call(e)),E(e)&&(y=" "+c(e)),0===a.length&&(!_||0==e.length))return x[0]+y+x[1];if(0>n)return w(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var M;return M=_?h(t,e,n,m,a):a.map(function(i){return f(t,e,n,m,i,_)}),t.seen.pop(),d(M,y,x)}function u(t,e){if(b(e))return t.stylize("undefined","undefined");if(g(e)){var i="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(i,"string")}return _(e)?t.stylize(""+e,"number"):m(e)?t.stylize(""+e,"boolean"):v(e)?t.stylize("null","null"):void 0}function c(t){return"["+Error.prototype.toString.call(t)+"]"}function h(t,e,i,n,r){for(var o=[],a=0,s=e.length;s>a;++a)L(e,String(a))?o.push(f(t,e,i,n,String(a),!0)):o.push("");return r.forEach(function(r){r.match(/^\d+$/)||o.push(f(t,e,i,n,r,!0))}),o}function f(t,e,i,n,r,o){var a,s,u;if(u=Object.getOwnPropertyDescriptor(e,r)||{value:e[r]},u.get?s=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(s=t.stylize("[Setter]","special")),L(n,r)||(a="["+r+"]"),s||(t.seen.indexOf(u.value)<0?(s=v(i)?l(t,u.value,null):l(t,u.value,i-1),s.indexOf("\n")>-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&&r.match(/^\d+$/))return s;a=JSON.stringify(""+r),
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 d(t,e,i){var n=0,r=t.reduce(function(t,e){return n++,e.indexOf("\n")>=0&&n++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);return r>60?i[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+i[1]:i[0]+e+" "+t.join(", ")+" "+i[1]}function p(t){return Array.isArray(t)}function m(t){return"boolean"==typeof t}function v(t){return null===t}function y(t){return null==t}function _(t){return"number"==typeof t}function g(t){return"string"==typeof t}function x(t){return"symbol"==typeof t}function b(t){return void 0===t}function w(t){return M(t)&&"[object RegExp]"===D(t)}function M(t){return"object"==typeof t&&null!==t}function S(t){return M(t)&&"[object Date]"===D(t)}function E(t){return M(t)&&("[object Error]"===D(t)||t instanceof Error)}function T(t){return"function"==typeof t}function I(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t}function D(t){return Object.prototype.toString.call(t)}function z(t){return 10>t?"0"+t.toString(10):t.toString(10)}function P(){var t=new Date,e=[z(t.getHours()),z(t.getMinutes()),z(t.getSeconds())].join(":");return[t.getDate(),R[t.getMonth()],e].join(" ")}function L(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var F=/%[sdj%]/g;i.format=function(t){if(!g(t)){for(var e=[],i=0;i<arguments.length;i++)e.push(r(arguments[i]));return e.join(" ")}for(var i=1,n=arguments,o=n.length,a=String(t).replace(F,function(t){if("%%"===t)return"%";if(i>=o)return t;switch(t){case"%s":return String(n[i++]);case"%d":return Number(n[i++]);case"%j":try{return JSON.stringify(n[i++])}catch(e){return"[Circular]"}default:return t}}),s=n[i];o>i;s=n[++i])a+=v(s)||!M(s)?" "+s:" "+r(s);return a},i.deprecate=function(t,r){function o(){if(!a){if(e.throwDeprecation)throw new Error(r);e.traceDeprecation?console.trace(r):console.error(r),a=!0}return t.apply(this,arguments)}if(b(n.process))return function(){return i.deprecate(t,r).apply(this,arguments)};if(e.noDeprecation===!0)return t;var a=!1;return o};var A={},k;i.debuglog=function(t){if(b(k)&&(k=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!A[t])if(new RegExp("\\b"+t+"\\b","i").test(k)){var n=e.pid;A[t]=function(){var e=i.format.apply(i,arguments);console.error("%s %d: %s",t,n,e)}}else A[t]=function(){};return A[t]},i.inspect=r,r.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},r.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},i.isArray=p,i.isBoolean=m,i.isNull=v,i.isNullOrUndefined=y,i.isNumber=_,i.isString=g,i.isSymbol=x,i.isUndefined=b,i.isRegExp=w,i.isObject=M,i.isDate=S,i.isError=E,i.isFunction=T,i.isPrimitive=I,i.isBuffer=t("./support/isBuffer");var R=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];i.log=function(){console.log("%s - %s",P(),i.format.apply(i,arguments))},i.inherits=t("inherits"),i._extend=function(t,e){if(!e||!M(e))return t;for(var i=Object.keys(e),n=i.length;n--;)t[i[n]]=e[i[n]];return t}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":180,_process:179,inherits:177}]},{},[175]);

Run the following to create the bundle:

browserify test/index.js | uglifyjs -c -m > test/bundle.js

<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>IE 11 test</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<script type="text/javascript">
if (navigator.appName == 'Microsoft Internet Explorer')
{
console.log('YOURE USING IE')
}
</script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.18.0/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
.z1 { z-index:1; }
.pin-topright { top:0; right:0; position: absolute;}
.pad1 { padding:10px; }
.pad2y { padding-top:10px; padding-bottom:10px; }
.fill-white {background-color: rgba(255,255,255,0.6); }
.block {display: block;}
</style>
</head>
<body>
<div id='legend' class='pin-topright z1 pad2y'>
<div class='pad1 fill-white'>
<div class="pad1">
<h3 class="block">IE 11 Test Map</h3>
</div>
</div>
</div>
<div id='map'></div>
<script type="text/javascript" src="./bundle.js"></script>
</body>
</html>
var mapboxgl = require('mapbox-gl');
mapboxgl.accessToken = 'pk.eyJ1IjoiZW50c29lIiwiYSI6ImNpb2xnNHcydTAwMXF3YW1iZmJjNXh1OGsifQ.frc5MlZWaMjTMbtaJbRZPw';
var map = new mapboxgl.Map({
container: 'map', // container id
style: 'mapbox://styles/mapbox/streets-v8', //stylesheet location
center: [19.56,52.41], // starting position
zoom: 3.42, // starting zoom
hash: true,
minZoom: 2.5,
attributionControl: false
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment