From b183d0cab92e2c439ffdbf4039d64ccdc9845d5e Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Wed, 18 Oct 2017 22:55:10 +0300 Subject: Add workaround for production build --- static/js/build.js | 4 ++-- static/js/build.js.map | 2 +- webpack.config.js | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/static/js/build.js b/static/js/build.js index 1a58eec..e6ae630 100644 --- a/static/js/build.js +++ b/static/js/build.js @@ -1,7 +1,7 @@ -!function(t){function e(i){if(r[i])return r[i].exports;var n=r[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,e),n.l=!0,n.exports}var r={};e.m=t,e.c=r,e.d=function(t,r,i){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/static/js/",e(e.s=2)}([function(t,e){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){(function(e){var r,r;!function(e){t.exports=e()}(function(){var t;return function t(e,i,n){function o(s,l){if(!i[s]){if(!e[s]){var u="function"==typeof r&&r;if(!l&&u)return r(s,!0);if(a)return a(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var p=i[s]={exports:{}};e[s][0].call(p.exports,function(t){var r=e[s][1][t];return o(r||t)},p,p.exports,t,e,i,n)}return i[s].exports}for(var a="function"==typeof r&&r,s=0;sn.maxh||t>n.maxw||r<=n.maxh&&t<=n.maxw&&(a=n.maxw*n.maxh-t*r)o.free)){if(r===o.h)return this.allocShelf(s,t,r,i);r>o.h||rh)&&(f=2*Math.max(t,h)),(cc)&&(p=2*Math.max(r,c)),this.resize(f,p),this.packOne(t,r,i)}return null},t.prototype.allocFreebin=function(t,e,r,i){var n=this.freebins.splice(t,1)[0];return n.id=i,n.w=e,n.h=r,n.refcount=0,this.bins[i]=n,this.ref(n),n},t.prototype.allocShelf=function(t,e,r,i){var n=this.shelves[t],o=n.alloc(e,r,i);return this.bins[i]=o,this.ref(o),o},t.prototype.shrink=function(){if(this.shelves.length>0){for(var t=0,e=0,r=0;rthis.free||e>this.h)return null;var n=this.x;return this.x+=t,this.free-=t,new r(i,n,this.y,t,e,t,this.h)},e.prototype.resize=function(t){return this.free+=t-this.w,this.w=t,!0},t})},{}],4:[function(t,e,r){"use strict";function i(t,e,r,i,n,o){this.fontSize=t||24,this.buffer=void 0===e?3:e,this.cutoff=i||.25,this.fontFamily=n||"sans-serif",this.fontWeight=o||"normal",this.radius=r||8;var a=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=a,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(a*a),this.gridInner=new Float64Array(a*a),this.f=new Float64Array(a),this.d=new Float64Array(a),this.z=new Float64Array(a+1),this.v=new Int16Array(a),this.middle=Math.round(a/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function n(t,e,r,i,n,a,s){for(var l=0;li)return i;for(;ro?r=n:i=n,n=.5*(i-r)+r}return n},i.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}},{}],6:[function(t,e,r){e.exports.VectorTile=t("./lib/vectortile.js"),e.exports.VectorTileFeature=t("./lib/vectortilefeature.js"),e.exports.VectorTileLayer=t("./lib/vectortilelayer.js")},{"./lib/vectortile.js":7,"./lib/vectortilefeature.js":8,"./lib/vectortilelayer.js":9}],7:[function(t,e,r){"use strict";function i(t,e){this.layers=t.readFields(n,{},e)}function n(t,e,r){if(3===t){var i=new o(r,r.readVarint()+r.pos);i.length&&(e[i.name]=i)}}var o=t("./vectortilelayer");e.exports=i},{"./vectortilelayer":9}],8:[function(t,e,r){"use strict";function i(t,e,r,i,o){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=i,this._values=o,t.readFields(n,this,e)}function n(t,e,r){1==t?e.id=r.readVarint():2==t?o(r,e):3==t?e.type=r.readVarint():4==t&&(e._geometry=r.pos)}function o(t,e){for(var r=t.readVarint()+t.pos;t.pos>3}if(n--,1===i||2===i)o+=t.readSVarint(),a+=t.readSVarint(),1===i&&(e&&s.push(e),e=[]),e.push(new l(o,a));else{if(7!==i)throw new Error("unknown command "+i);e&&e.push(e[0].clone())}}return e&&s.push(e),s},i.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,i=0,n=0,o=0,a=1/0,s=-1/0,l=1/0,u=-1/0;t.pos>3}if(i--,1===r||2===r)n+=t.readSVarint(),o+=t.readSVarint(),ns&&(s=n),ou&&(u=o);else if(7!==r)throw new Error("unknown command "+r)}return[a,l,s,u]},i.prototype.toGeoJSON=function(t,e,r){function n(t){for(var e=0;e>3;e=1===i?t.readString():2===i?t.readFloat():3===i?t.readDouble():4===i?t.readVarint64():5===i?t.readVarint():6===i?t.readSVarint():7===i?t.readBoolean():null}return e}var a=t("./vectortilefeature.js");e.exports=i,i.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new a(this._pbf,e,this.extent,this._keys,this._values)}},{"./vectortilefeature.js":8}],10:[function(e,r,i){!function(e,n){"object"==typeof i&&void 0!==r?n(i):"function"==typeof t&&t.amd?t(["exports"],n):n(e.WhooTS=e.WhooTS||{})}(this,function(t){function e(t,e,i,n,o,a){return a=a||{},t+"?"+["bbox="+r(i,n,o),"format="+(a.format||"image/png"),"service="+(a.service||"WMS"),"version="+(a.version||"1.1.1"),"request="+(a.request||"GetMap"),"srs="+(a.srs||"EPSG:3857"),"width="+(a.width||256),"height="+(a.height||256),"layers="+e].join("&")}function r(t,e,r){e=Math.pow(2,r)-e-1;var n=i(256*t,256*e,r),o=i(256*(t+1),256*(e+1),r);return n[0]+","+n[1]+","+o[0]+","+o[1]}function i(t,e,r){var i=2*Math.PI*6378137/256/Math.pow(2,r);return[t*i-2*Math.PI*6378137/2,e*i-2*Math.PI*6378137/2]}t.getURL=e,t.getTileBBox=r,t.getMercCoords=i,Object.defineProperty(t,"__esModule",{value:!0})})},{}],11:[function(t,e,r){"use strict";function i(t,e,r){r=r||2;var i=e&&e.length,o=i?e[0]*r:t.length,s=n(t,0,o,r,!0),l=[];if(!s)return l;var u,c,h,f,d,m,v;if(i&&(s=p(t,e,s,r)),t.length>80*r){u=h=t[0],c=f=t[1];for(var y=r;yh&&(h=d),m>f&&(f=m);v=Math.max(h-u,f-c)}return a(s,l,r,u,c,v),l}function n(t,e,r,i,n){var o,a;if(n===L(t,e,r,i)>0)for(o=e;o=e;o-=i)a=E(o,t[o],t[o+1],a);return a&&w(a,a.next)&&(k(a),a=a.next),a}function o(t,e){if(!t)return t;e||(e=t);var r,i=t;do{if(r=!1,i.steiner||!w(i,i.next)&&0!==b(i.prev,i,i.next))i=i.next;else{if(k(i),(i=e=i.prev)===i.next)return null;r=!0}}while(r||i!==e);return e}function a(t,e,r,i,n,p,h){if(t){!h&&p&&m(t,i,n,p);for(var f,d,v=t;t.prev!==t.next;)if(f=t.prev,d=t.next,p?l(t,i,n,p):s(t))e.push(f.i/r),e.push(t.i/r),e.push(d.i/r),k(t),t=d.next,v=d.next;else if((t=d)===v){h?1===h?(t=u(t,e,r),a(t,e,r,i,n,p,2)):2===h&&c(t,e,r,i,n,p):a(o(t),e,r,i,n,p,1);break}}}function s(t){var e=t.prev,r=t,i=t.next;if(b(e,r,i)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(_(e.x,e.y,r.x,r.y,i.x,i.y,n.x,n.y)&&b(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function l(t,e,r,i){var n=t.prev,o=t,a=t.next;if(b(n,o,a)>=0)return!1;for(var s=n.xo.x?n.x>a.x?n.x:a.x:o.x>a.x?o.x:a.x,c=n.y>o.y?n.y>a.y?n.y:a.y:o.y>a.y?o.y:a.y,p=y(s,l,e,r,i),h=y(u,c,e,r,i),f=t.nextZ;f&&f.z<=h;){if(f!==t.prev&&f!==t.next&&_(n.x,n.y,o.x,o.y,a.x,a.y,f.x,f.y)&&b(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(f=t.prevZ;f&&f.z>=p;){if(f!==t.prev&&f!==t.next&&_(n.x,n.y,o.x,o.y,a.x,a.y,f.x,f.y)&&b(f.prev,f,f.next)>=0)return!1;f=f.prevZ}return!0}function u(t,e,r){var i=t;do{var n=i.prev,o=i.next.next;!w(n,o)&&T(n,i,i.next,o)&&z(n,o)&&z(o,n)&&(e.push(n.i/r),e.push(i.i/r),e.push(o.i/r),k(i),k(i.next),i=t=o),i=i.next}while(i!==t);return i}function c(t,e,r,i,n,s){var l=t;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&x(l,u)){var c=C(l,u);return l=o(l,l.next),c=o(c,c.next),a(l,e,r,i,n,s),void a(c,e,r,i,n,s)}u=u.next}l=l.next}while(l!==t)}function p(t,e,r,i){var a,s,l,u,c,p=[];for(a=0,s=e.length;a=i.next.y){var s=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=n&&s>a){if(a=s,s===n){if(o===i.y)return i;if(o===i.next.y)return i.next}r=i.x=i.x&&i.x>=c&&_(or.x)&&z(i,t)&&(r=i,h=l),i=i.next;return r}function m(t,e,r,i){var n=t;do{null===n.z&&(n.z=y(n.x,n.y,e,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,v(n)}function v(t){var e,r,i,n,o,a,s,l,u=1;do{for(r=t,t=null,o=null,a=0;r;){for(a++,i=r,s=0,e=0;e0||l>0&&i;)0===s?(n=i,i=i.nextZ,l--):0!==l&&i?r.z<=i.z?(n=r,r=r.nextZ,s--):(n=i,i=i.nextZ,l--):(n=r,r=r.nextZ,s--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;r=i}o.nextZ=null,u*=2}while(a>1);return t}function y(t,e,r,i,n){return t=32767*(t-r)/n,e=32767*(e-i)/n,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function g(t){var e=t,r=t;do{e.x=0&&(t-a)*(i-s)-(r-a)*(e-s)>=0&&(r-a)*(o-s)-(n-a)*(i-s)>=0}function x(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!S(t,e)&&z(t,e)&&z(e,t)&&A(t,e)}function b(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function w(t,e){return t.x===e.x&&t.y===e.y}function T(t,e,r,i){return!!(w(t,e)&&w(r,i)||w(t,i)&&w(r,e))||b(t,e,r)>0!=b(t,e,i)>0&&b(r,i,t)>0!=b(r,i,e)>0}function S(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&T(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}function z(t,e){return b(t.prev,t,t.next)<0?b(t,e,t.next)>=0&&b(t,t.prev,e)>=0:b(t,e,t.prev)<0||b(t,t.next,e)<0}function A(t,e){var r=t,i=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==t);return i}function C(t,e){var r=new M(t.i,t.x,t.y),i=new M(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,o.next=i,i.prev=o,i}function E(t,e,r,i){var n=new M(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function k(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function M(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function L(t,e,r,i){for(var n=0,o=e,a=r-i;o0&&(i+=t[n-1].length,r.holes.push(i))}return r}},{}],12:[function(t,e,r){function i(t){if("Polygon"===t.type)return n(t.coordinates);if("MultiPolygon"===t.type){for(var e=0,r=0;r0){e+=Math.abs(o(t[0]));for(var r=1;r2){for(var r,i,n=0;n=0}var u=t("geojson-area");e.exports=i},{"geojson-area":12}],14:[function(t,e,r){"use strict";function i(t,e,r,i,a,l,u,c){if(r/=e,i/=e,u>=r&&c<=i)return t;if(u>i||c=r&&d<=i)p.push(m);else if(!(f>i||d=e&&s<=r&&n.push(a)}return n}function o(t,e,r,i,n,o){for(var s=[],l=0;lr?(x.push(n(u,d,e),n(u,d,r)),o||(x=a(s,x,v,y,g))):f>=e&&x.push(n(u,d,e)):h>r?fr&&(x.push(n(u,d,r)),o||(x=a(s,x,v,y,g))));u=m[_-1],h=u[i],h>=e&&h<=r&&x.push(u),p=x[x.length-1],o&&p&&(x[0][0]!==p[0]||x[0][1]!==p[1])&&x.push(x[0]),a(s,x,v,y,g)}return s}function a(t,e,r,i,n){return e.length&&(e.area=r,e.dist=i,void 0!==n&&(e.outer=n),t.push(e)),[]}e.exports=i;var s=t("./feature")},{"./feature":16}],15:[function(t,e,r){"use strict";function i(t,e){var r=[];if("FeatureCollection"===t.type)for(var i=0;i1?1:i,[r,i,0]}function s(t){for(var e,r,i=0,n=0,o=0;o1)return!1;var o=n.geometry[0].length;if(5!==o)return!1;for(var a=0;a1&&console.time("creation"),_=this.tiles[g]=d(t,y,r,i,x,e===f.maxZoom),this.tileCoords.push({z:e,x:r,y:i}),m)){m>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,i,_.numFeatures,_.numPoints,_.numSimplified),console.timeEnd("creation"));var b="z"+e;this.stats[b]=(this.stats[b]||0)+1,this.total++}if(_.source=t,n){if(e===f.maxZoom||e===n)continue;var w=1<1&&console.time("clipping");var T,S,z,A,C,E,k=.5*f.buffer/f.extent,M=.5-k,L=.5+k,I=1+k;T=S=z=A=null,C=h(t,y,r-k,r+L,0,a,_.min[0],_.max[0]),E=h(t,y,r+M,r+I,0,a,_.min[0],_.max[0]),C&&(T=h(C,y,i-k,i+L,1,s,_.min[1],_.max[1]),S=h(C,y,i+M,i+I,1,s,_.min[1],_.max[1])),E&&(z=h(E,y,i-k,i+L,1,s,_.min[1],_.max[1]),A=h(E,y,i+M,i+I,1,s,_.min[1],_.max[1])),m>1&&console.timeEnd("clipping"),t.length&&(p.push(T||[],e+1,2*r,2*i),p.push(S||[],e+1,2*r,2*i+1),p.push(z||[],e+1,2*r+1,2*i),p.push(A||[],e+1,2*r+1,2*i+1))}else n&&(v=e)}return v},n.prototype.getTile=function(t,e,r){var i=this.options,n=i.extent,a=i.debug,s=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var c,h=t,f=e,d=r;!c&&h>0;)h--,f=Math.floor(f/2),d=Math.floor(d/2),c=this.tiles[o(h,f,d)];if(!c||!c.source)return null;if(a>1&&console.log("found parent tile z%d-%d-%d",h,f,d),u(c,n,i.buffer))return p.tile(c,n);a>1&&console.time("drilling down");var m=this.splitTile(c.source,h,f,d,t,e,r);if(a>1&&console.timeEnd("drilling down"),null!==m){var v=1<i&&(a=r,i=o);i>s?(t[a][2]=i,p.push(u),p.push(a),u=a):(c=p.pop(),u=p.pop())}}function n(t,e,r){var i=e[0],n=e[1],o=r[0],a=r[1],s=t[0],l=t[1],u=o-i,c=a-n;if(0!==u||0!==c){var p=((s-i)*u+(l-n)*c)/(u*u+c*c);p>1?(i=o,n=a):p>0&&(i+=u*p,n+=c*p)}return u=s-i,c=l-n,u*u+c*c}e.exports=i},{}],19:[function(t,e,r){"use strict";function i(t,e,r,i,o,a){for(var s={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:i,z2:e,transformed:!1,min:[2,1],max:[-1,0]},l=0;ls.max[0]&&(s.max[0]=c[0]),c[1]>s.max[1]&&(s.max[1]=c[1])}return s}function n(t,e,r,i){var n,a,s,l,u=e.geometry,c=e.type,p=[],h=r*r;if(1===c)for(n=0;nh)&&(f.push(l),t.numSimplified++),t.numPoints++;3===c&&o(f,s.outer),p.push(f)}else t.numPoints+=s.length;if(p.length){var d={geometry:p,type:c,tags:e.tags||null};null!==e.id&&(d.id=e.id),t.features.push(d)}}function o(t,e){a(t)<0===e&&t.reverse()}function a(t){for(var e,r,i=0,n=0,o=t.length,a=o-1;n=u[h+0]&&i>=u[h+1]?(a[p]=!0,o.push(l[p])):a[p]=!1}}},i.prototype._forEachCell=function(t,e,r,i,n,o,a){for(var s=this._convertToCellCoord(t),l=this._convertToCellCoord(e),u=this._convertToCellCoord(r),c=this._convertToCellCoord(i),p=s;p<=u;p++)for(var h=l;h<=c;h++){var f=this.d*h+p;if(n.call(this,t,e,r,i,f,o,a))return}},i.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},i.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=n+this.cells.length+1+1,r=0,i=0;i>1,c=-7,p=r?n-1:0,h=r?-1:1,f=t[e+p];for(p+=h,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=256*o+t[e+p],p+=h,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=i;c>0;a=256*a+t[e+p],p+=h,c-=8);if(0===o)o=1-u;else{if(o===l)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,i),o-=u}return(f?-1:1)*a*Math.pow(2,o-i)},r.write=function(t,e,r,i,n,o){var a,s,l,u=8*o-n-1,c=(1<>1,h=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:o-1,d=i?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),e+=a+p>=1?h/l:h*Math.pow(2,1-p),e*l>=2&&(a++,l/=2),a+p>=c?(s=0,a=c):a+p>=1?(s=(e*l-1)*Math.pow(2,n),a+=p):(s=e*Math.pow(2,p-1)*Math.pow(2,n),a=0));n>=8;t[r+f]=255&s,f+=d,s/=256,n-=8);for(a=a<0;t[r+f]=255&a,f+=d,a/=256,u-=8);t[r+f-d]|=128*m}},{}],24:[function(t,e,r){"use strict";function i(t,e,r,i,o){return new n(t,e,r,i,o)}function n(t,e,r,i,n){e=e||o,r=r||a,n=n||Array,this.nodeSize=i||64,this.points=t,this.ids=new n(t.length),this.coords=new n(2*t.length);for(var l=0;l=r&&s<=n&&l>=i&&l<=o&&c.push(t[d]);else{var m=Math.floor((f+h)/2);s=e[2*m],l=e[2*m+1],s>=r&&s<=n&&l>=i&&l<=o&&c.push(t[m]);var v=(p+1)%2;(0===p?r<=s:i<=l)&&(u.push(f),u.push(m-1),u.push(v)),(0===p?n>=s:o>=l)&&(u.push(m+1),u.push(h),u.push(v))}}return c}e.exports=i},{}],26:[function(t,e,r){"use strict";function i(t,e,r,o,a,s){if(!(a-o<=r)){var l=Math.floor((o+a)/2);n(t,e,l,o,a,s%2),i(t,e,r,o,l-1,s+1),i(t,e,r,l+1,a,s+1)}}function n(t,e,r,i,a,s){for(;a>i;){if(a-i>600){var l=a-i+1,u=r-i+1,c=Math.log(l),p=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*p*(l-p)/l)*(u-l/2<0?-1:1);n(t,e,r,Math.max(i,Math.floor(r-u*p/l+h)),Math.min(a,Math.floor(r+(l-u)*p/l+h)),s)}var f=e[2*r+s],d=i,m=a;for(o(t,e,i,r),e[2*a+s]>f&&o(t,e,i,a);df;)m--}e[2*i+s]===f?o(t,e,i,m):(m++,o(t,e,m,a)),m<=r&&(i=m+1),r<=m&&(a=m-1)}}function o(t,e,r,i){a(t,r,i),a(e,2*r,2*i),a(e,2*r+1,2*i+1)}function a(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}e.exports=i},{}],27:[function(t,e,r){"use strict";function i(t,e,r,i,o,a){for(var s=[0,t.length-1,0],l=[],u=o*o;s.length;){var c=s.pop(),p=s.pop(),h=s.pop();if(p-h<=a)for(var f=h;f<=p;f++)n(e[2*f],e[2*f+1],r,i)<=u&&l.push(t[f]);else{var d=Math.floor((h+p)/2),m=e[2*d],v=e[2*d+1];n(m,v,r,i)<=u&&l.push(t[d]);var y=(c+1)%2;(0===c?r-o<=m:i-o<=v)&&(s.push(h),s.push(d-1),s.push(y)),(0===c?r+o>=m:i+o>=v)&&(s.push(d+1),s.push(p),s.push(y))}}return l}function n(t,e,r,i){var n=t-r,o=e-i;return n*n+o*o}e.exports=i},{}],28:[function(t,e,r){"use strict";function i(t){return!!(n()&&o()&&a()&&s()&&l()&&u()&&c()&&p(t&&t.failIfMajorPerformanceCaveat))}function n(){return"undefined"!=typeof window&&"undefined"!=typeof document}function o(){return Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray}function a(){return Function.prototype&&Function.prototype.bind}function s(){return Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions}function l(){return"JSON"in window&&"parse"in JSON&&"stringify"in JSON}function u(){return"Worker"in window}function c(){return"Uint8ClampedArray"in window}function p(t){return void 0===f[t]&&(f[t]=h(t)),f[t]}function h(t){var e=document.createElement("canvas"),r=Object.create(i.webGLContextAttributes);return r.failIfMajorPerformanceCaveat=t,e.probablySupportsContext?e.probablySupportsContext("webgl",r)||e.probablySupportsContext("experimental-webgl",r):e.supportsContext?e.supportsContext("webgl",r)||e.supportsContext("experimental-webgl",r):e.getContext("webgl",r)||e.getContext("experimental-webgl",r)}void 0!==e&&e.exports?e.exports=i:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=i);var f={};i.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}},{}],29:[function(t,e,r){"use strict";function i(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}function n(t,e,r){var i,n,o=r.buf;if(n=o[r.pos++],i=(112&n)>>4,n<128)return a(t,i,e);if(n=o[r.pos++],i|=(127&n)<<3,n<128)return a(t,i,e);if(n=o[r.pos++],i|=(127&n)<<10,n<128)return a(t,i,e);if(n=o[r.pos++],i|=(127&n)<<17,n<128)return a(t,i,e);if(n=o[r.pos++],i|=(127&n)<<24,n<128)return a(t,i,e);if(n=o[r.pos++],i|=(1&n)<<31,n<128)return a(t,i,e);throw new Error("Expected varint not more than 10 bytes")}function o(t){return t.type===i.Bytes?t.readVarint()+t.pos:t.pos+1}function a(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function s(t,e){var r,i;if(t>=0?(r=t%4294967296|0,i=t/4294967296|0):(r=~(-t%4294967296),i=~(-t/4294967296),4294967295^r?r=r+1|0:(r=0,i=i+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),l(r,i,e),u(i,e)}function l(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}function u(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}function c(t,e,r){var i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.ceil(Math.log(e)/(7*Math.LN2));r.realloc(i);for(var n=r.pos-1;n>=t;n--)r.buf[n+i]=r.buf[n]}function p(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function w(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function T(t,e,r){for(var i="",n=e;n239?4:o>223?3:o>191?2:1;if(n+s>r)break;var l,u,c;1===s?o<128&&(a=o):2===s?128==(192&(l=t[n+1]))&&(a=(31&o)<<6|63&l)<=127&&(a=null):3===s?(l=t[n+1],u=t[n+2],128==(192&l)&&128==(192&u)&&((a=(15&o)<<12|(63&l)<<6|63&u)<=2047||a>=55296&&a<=57343)&&(a=null)):4===s&&(l=t[n+1],u=t[n+2],c=t[n+3],128==(192&l)&&128==(192&u)&&128==(192&c)&&((a=(15&o)<<18|(63&l)<<12|(63&u)<<6|63&c)<=65535||a>=1114112)&&(a=null)),null===a?(a=65533,s=1):a>65535&&(a-=65536,i+=String.fromCharCode(a>>>10&1023|55296),a=56320|1023&a),i+=String.fromCharCode(a),n+=s}return i}function S(t,e,r){for(var i,n,o=0;o55295&&i<57344){if(!n){i>56319||o+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):n=i;continue}if(i<56320){t[r++]=239,t[r++]=191,t[r++]=189,n=i;continue}i=n-55296<<10|i-56320|65536,n=null}else n&&(t[r++]=239,t[r++]=191,t[r++]=189,n=null);i<128?t[r++]=i:(i<2048?t[r++]=i>>6|192:(i<65536?t[r++]=i>>12|224:(t[r++]=i>>18|240,t[r++]=i>>12&63|128),t[r++]=i>>6&63|128),t[r++]=63&i|128)}return r}e.exports=i;var z=t("ieee754");i.Varint=0,i.Fixed64=1,i.Bytes=2,i.Fixed32=5;i.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos>3,o=this.pos;this.type=7&i,t(n,e,this),this.pos===o&&this.skip(i)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=x(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=w(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=x(this.buf,this.pos)+4294967296*x(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=x(this.buf,this.pos)+4294967296*w(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=z.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=z.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,i=this.buf;return r=i[this.pos++],e=127&r,r<128?e:(r=i[this.pos++],e|=(127&r)<<7,r<128?e:(r=i[this.pos++],e|=(127&r)<<14,r<128?e:(r=i[this.pos++],e|=(127&r)<<21,r<128?e:(r=i[this.pos],e|=(15&r)<<28,n(e,t,this)))))},readVarint64:function(){return this.readVarint(!0)},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=T(this.buf,this.pos,t);return this.pos=t,e},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){var r=o(this);for(t=t||[];this.pos127;);else if(e===i.Bytes)this.pos=this.readVarint()+this.pos;else if(e===i.Fixed32)this.pos+=4;else{if(e!==i.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e268435455||t<0)return void s(t,this);this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127)))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=S(this.buf,t,this.pos);var r=this.pos-e;r>=128&&c(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),z.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),z.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&c(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i},writeMessage:function(t,e,r){this.writeTag(t,i.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){this.writeMessage(t,p,e)},writePackedSVarint:function(t,e){this.writeMessage(t,h,e)},writePackedBoolean:function(t,e){this.writeMessage(t,m,e)},writePackedFloat:function(t,e){this.writeMessage(t,f,e)},writePackedDouble:function(t,e){this.writeMessage(t,d,e)},writePackedFixed32:function(t,e){this.writeMessage(t,v,e)},writePackedSFixed32:function(t,e){this.writeMessage(t,y,e)},writePackedFixed64:function(t,e){this.writeMessage(t,g,e)},writePackedSFixed64:function(t,e){this.writeMessage(t,_,e)},writeBytesField:function(t,e){this.writeTag(t,i.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,i.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,i.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,i.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,i.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,i.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,i.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,i.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,i.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,i.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}},{ieee754:23}],30:[function(t,e,r){function i(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function o(t){if(p===setTimeout)return setTimeout(t,0);if((p===i||!p)&&setTimeout)return p=setTimeout,setTimeout(t,0);try{return p(t,0)}catch(e){try{return p.call(null,t,0)}catch(e){return p.call(this,t,0)}}}function a(t){if(h===clearTimeout)return clearTimeout(t);if((h===n||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(t);try{return h(t)}catch(e){try{return h.call(null,t)}catch(e){return h.call(this,t)}}}function s(){v&&d&&(v=!1,d.length?m=d.concat(m):y=-1,m.length&&l())}function l(){if(!v){var t=o(s);v=!0;for(var e=m.length;e;){for(d=m,m=[];++y1)for(var r=1;rr;){if(a-r>600){var l=a-r+1,u=e-r+1,c=Math.log(l),p=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*p*(l-p)/l)*(u-l/2<0?-1:1);i(t,e,Math.max(r,Math.floor(e-u*p/l+h)),Math.min(a,Math.floor(e+(l-u)*p/l+h)),s)}var f=t[e],d=r,m=a;for(n(t,r,e),s(t[a],f)>0&&n(t,r,a);d0;)m--}0===s(t[r],f)?n(t,r,m):(m++,n(t,m,a)),m<=e&&(r=m+1),e<=m&&(a=m-1)}}function n(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function o(t,e){return te?1:0}e.exports=i},{}],32:[function(t,e,r){"use strict";function i(t){return new n(t)}function n(t){this.options=f(Object.create(this.options),t),this.trees=new Array(this.options.maxZoom+1)}function o(t,e,r,i,n){return{x:t,y:e,zoom:1/0,id:i,properties:n,parentId:-1,numPoints:r}}function a(t,e){var r=t.geometry.coordinates;return{x:u(r[0]),y:c(r[1]),zoom:1/0,id:e,parentId:-1}}function s(t){return{type:"Feature",properties:l(t),geometry:{type:"Point",coordinates:[p(t.x),h(t.y)]}}}function l(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return f(f({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function u(t){return t/360+.5}function c(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function p(t){return 360*(t-.5)}function h(t){var e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function f(t,e){for(var r in e)t[r]=e[r];return t}function d(t){return t.x}function m(t){return t.y}var v=t("kdbush");e.exports=i,n.prototype={options:{minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,reduce:null,initial:function(){return{}},map:function(t){return t}},load:function(t){var e=this.options.log;e&&console.time("total time");var r="prepare "+t.length+" points";e&&console.time(r),this.points=t;var i=t.map(a);e&&console.timeEnd(r);for(var n=this.options.maxZoom;n>=this.options.minZoom;n--){var o=+Date.now();this.trees[n+1]=v(i,d,m,this.options.nodeSize,Float32Array),i=this._cluster(i,n),e&&console.log("z%d: %d clusters in %dms",n,i.length,+Date.now()-o)}return this.trees[this.options.minZoom]=v(i,d,m,this.options.nodeSize,Float32Array),e&&console.timeEnd("total time"),this},getClusters:function(t,e){for(var r=this.trees[this._limitZoom(e)],i=r.range(u(t[0]),c(t[3]),u(t[2]),c(t[1])),n=[],o=0;o0)for(var r=this.length>>1;r>=0;r--)this._down(r)}function n(t,e){return te?1:0}e.exports=i,i.prototype={push:function(t){this.data.push(t),this.length++,this._up(this.length-1)},pop:function(){if(0!==this.length){var t=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),t}},peek:function(){return this.data[0]},_up:function(t){for(var e=this.data,r=this.compare,i=e[t];t>0;){var n=t-1>>1,o=e[n];if(r(i,o)>=0)break;e[t]=o,t=n}e[t]=i},_down:function(t){for(var e=this.data,r=this.compare,i=this.length,n=i>>1,o=e[t];t=0)break;e[t]=l,t=a}e[t]=o}}},{}],34:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],35:[function(t,e,r){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],36:[function(t,r,i){(function(e,r){function n(t,e){var r={seen:[],stylize:a};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),m(e)?r.showHidden=e:e&&i._extend(r,e),b(r.showHidden)&&(r.showHidden=!1),b(r.depth)&&(r.depth=2),b(r.colors)&&(r.colors=!1),b(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=o),l(r,t,r.depth)}function o(t,e){var r=n.styles[e];return r?"["+n.colors[r][0]+"m"+t+"["+n.colors[r][1]+"m":t}function a(t,e){return t}function s(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}function l(t,e,r){if(t.customInspect&&e&&A(e.inspect)&&e.inspect!==i.inspect&&(!e.constructor||e.constructor.prototype!==e)){var n=e.inspect(r,t);return _(n)||(n=l(t,n,r)),n}var o=u(t,e);if(o)return o;var a=Object.keys(e),m=s(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(e)),z(e)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return c(e);if(0===a.length){if(A(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(z(e))return c(e)}var y="",g=!1,x=["{","}"];if(d(e)&&(g=!0,x=["[","]"]),A(e)&&(y=" [Function"+(e.name?": "+e.name:"")+"]"),w(e)&&(y=" "+RegExp.prototype.toString.call(e)),S(e)&&(y=" "+Date.prototype.toUTCString.call(e)),z(e)&&(y=" "+c(e)),0===a.length&&(!g||0==e.length))return x[0]+y+x[1];if(r<0)return w(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var b;return b=g?p(t,e,r,m,a):a.map(function(i){return h(t,e,r,m,i,g)}),t.seen.pop(),f(b,y,x)}function u(t,e){if(b(e))return t.stylize("undefined","undefined");if(_(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return g(e)?t.stylize(""+e,"number"):m(e)?t.stylize(""+e,"boolean"):v(e)?t.stylize("null","null"):void 0}function c(t){return"["+Error.prototype.toString.call(t)+"]"}function p(t,e,r,i,n){for(var o=[],a=0,s=e.length;a-1&&(s=o?s.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+s.split("\n").map(function(t){return" "+t}).join("\n"))):s=t.stylize("[Circular]","special")),b(a)){if(o&&n.match(/^\d+$/))return s;a=JSON.stringify(""+n),a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function f(t,e,r){var i=0;return t.reduce(function(t,e){return i++,e.indexOf("\n")>=0&&i++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}function d(t){return Array.isArray(t)}function m(t){return"boolean"==typeof t}function v(t){return null===t}function y(t){return null==t}function g(t){return"number"==typeof t}function _(t){return"string"==typeof t}function x(t){return"symbol"==typeof t}function b(t){return void 0===t}function w(t){return T(t)&&"[object RegExp]"===E(t)}function T(t){return"object"==typeof t&&null!==t}function S(t){return T(t)&&"[object Date]"===E(t)}function z(t){return T(t)&&("[object Error]"===E(t)||t instanceof Error)}function A(t){return"function"==typeof t}function C(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t}function E(t){return Object.prototype.toString.call(t)}function k(t){return t<10?"0"+t.toString(10):t.toString(10)}function M(){var t=new Date,e=[k(t.getHours()),k(t.getMinutes()),k(t.getSeconds())].join(":");return[t.getDate(),D[t.getMonth()],e].join(" ")}function L(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var I=/%[sdj%]/g;i.format=function(t){if(!_(t)){for(var e=[],r=0;r=o)return t;switch(t){case"%s":return String(i[r++]);case"%d":return Number(i[r++]);case"%j":try{return JSON.stringify(i[r++])}catch(t){return"[Circular]"}default:return t}}),s=i[r];r>31}function p(t,e){for(var r=t.loadGeometry(),i=t.type,n=0,o=0,a=r.length,s=0;s=d||p<0||p>=d)){var h=r.segments.prepareSegment(4,r.layoutVertexArray,r.indexArray),f=h.vertexLength;i(r.layoutVertexArray,c,p,-1,-1),i(r.layoutVertexArray,c,p,1,-1),i(r.layoutVertexArray,c,p,1,1),i(r.layoutVertexArray,c,p,-1,1),r.indexArray.emplaceBack(f,f+1,f+2),r.indexArray.emplaceBack(f,f+3,f+2),h.vertexLength+=4,h.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t.properties)},y.programInterface=m,e.exports=y},{"../../gl/index_buffer":61,"../../gl/vertex_buffer":62,"../extent":48,"../index_array_type":50,"../load_geometry":51,"../program_configuration":53,"../segment":55,"../vertex_array_type":56}],44:[function(t,e,r){"use strict";var i=t("../segment"),n=i.SegmentVector,o=t("../../gl/vertex_buffer"),a=t("../../gl/index_buffer"),s=t("../program_configuration"),l=s.ProgramConfigurationSet,u=t("../vertex_array_type"),c=t("../index_array_type"),p=c.LineIndexArray,h=c.TriangleIndexArray,f=t("../load_geometry"),d=t("earcut"),m=t("../../util/classify_rings"),v={layoutAttributes:[{name:"a_pos",components:2,type:"Int16"}],indexArrayType:h,indexArrayType2:p,paintAttributes:[{property:"fill-color"},{property:"fill-outline-color"},{property:"fill-opacity"}]},y=u(v.layoutAttributes),g=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.index=t.index,this.layoutVertexArray=new y(t.layoutVertexArray),this.indexArray=new h(t.indexArray),this.indexArray2=new p(t.indexArray2),this.programConfigurations=new l(v,t.layers,t.zoom,t.programConfigurations),this.segments=new n(t.segments),this.segments2=new n(t.segments2)};g.prototype.populate=function(t,e){for(var r=this,i=0,n=t;iv)||t.y===e.y&&(t.y<0||t.y>v)}var o=t("../segment"),a=o.SegmentVector,s=o.MAX_VERTEX_ARRAY_LENGTH,l=t("../../gl/vertex_buffer"),u=t("../../gl/index_buffer"),c=t("../program_configuration"),p=c.ProgramConfigurationSet,h=t("../vertex_array_type"),f=t("../index_array_type"),d=f.TriangleIndexArray,m=t("../load_geometry"),v=t("../extent"),y=t("earcut"),g=t("../../util/classify_rings"),_={layoutAttributes:[{name:"a_pos",components:2,type:"Int16"},{name:"a_normal",components:3,type:"Int16"},{name:"a_edgedistance",components:1,type:"Int16"}],indexArrayType:d,paintAttributes:[{property:"fill-extrusion-base"},{property:"fill-extrusion-height"},{property:"fill-extrusion-color"}]},x=Math.pow(2,13),b=h(_.layoutAttributes),w=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.index=t.index,this.layoutVertexArray=new b(t.layoutVertexArray),this.indexArray=new d(t.indexArray),this.programConfigurations=new p(_,t.layers,t.zoom,t.programConfigurations),this.segments=new a(t.segments)};w.prototype.populate=function(t,e){for(var r=this,i=0,n=t;i=1){var b=m[_-1];if(!n(x,b)){h.vertexLength+4>s&&(h=r.segments.prepareSegment(4,r.layoutVertexArray,r.indexArray));var w=x.sub(b)._perp()._unit();i(r.layoutVertexArray,x.x,x.y,w.x,w.y,0,0,v),i(r.layoutVertexArray,x.x,x.y,w.x,w.y,0,1,v),v+=b.dist(x),i(r.layoutVertexArray,b.x,b.y,w.x,w.y,0,0,v),i(r.layoutVertexArray,b.x,b.y,w.x,w.y,0,1,v);var T=h.vertexLength;r.indexArray.emplaceBack(T,T+1,T+2),r.indexArray.emplaceBack(T+1,T+2,T+3),h.vertexLength+=4,h.primitiveLength+=2}}}}h.vertexLength+u>s&&(h=r.segments.prepareSegment(u,r.layoutVertexArray,r.indexArray));for(var S=[],z=[],A=h.vertexLength,C=0,E=l;C>6)}var n=t("../segment"),o=n.SegmentVector,a=t("../../gl/vertex_buffer"),s=t("../../gl/index_buffer"),l=t("../program_configuration"),u=l.ProgramConfigurationSet,c=t("../vertex_array_type"),p=t("../index_array_type"),h=p.TriangleIndexArray,f=t("../load_geometry"),d=t("../extent"),m=t("@mapbox/vector-tile").VectorTileFeature.types,v=63,y=Math.cos(Math.PI/180*37.5),g=.5,_=Math.pow(2,14)/g,x={layoutAttributes:[{name:"a_pos_normal",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],paintAttributes:[{property:"line-color"},{property:"line-blur"},{property:"line-opacity"},{property:"line-gap-width",name:"gapwidth"},{property:"line-offset"},{property:"line-width"},{property:"line-width",name:"floorwidth",useIntegerZoom:!0}],indexArrayType:h},b=c(x.layoutAttributes),w=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.index=t.index,this.layoutVertexArray=new b(t.layoutVertexArray),this.indexArray=new h(t.indexArray),this.programConfigurations=new u(x,t.layers,t.zoom,t.programConfigurations),this.segments=new o(t.segments)};w.prototype.populate=function(t,e){for(var r=this,i=0,n=t;i=2&&t[u-1].equals(t[u-2]);)u--;for(var c=0;cc){var I=v.dist(T);if(I>2*p){var P=v.sub(v.sub(T)._mult(p/I)._round());a.distance+=P.dist(T),a.addCurrentVertex(P,a.distance,z.mult(1),0,0,!1,f),T=P}}var R=T&&S,D=R?r:S?x:b;if(R&&"round"===D&&(Mn&&(D="bevel"),"bevel"===D&&(M>2&&(D="flipbevel"),M100)E=A.clone().mult(-1);else{var O=z.x*A.y-z.y*A.x>0?-1:1,B=M*z.add(A).mag()/z.sub(A).mag();E._perp()._mult(B*O)}a.addCurrentVertex(v,a.distance,E,0,0,!1,f),a.addCurrentVertex(v,a.distance,E.mult(-1),0,0,!1,f)}else if("bevel"===D||"fakeround"===D){var F=z.x*A.y-z.y*A.x>0,j=-Math.sqrt(M*M-1);if(F?(_=0,g=j):(g=0,_=j),w||a.addCurrentVertex(v,a.distance,z,g,_,!1,f),"fakeround"===D){for(var V=Math.floor(8*(.5-(k-.5))),N=void 0,U=0;U=0;$--)N=z.mult(($+1)/(V+1))._add(A)._unit(),a.addPieSliceVertex(v,a.distance,N,F,f)}S&&a.addCurrentVertex(v,a.distance,A,-g,-_,!1,f)}else"butt"===D?(w||a.addCurrentVertex(v,a.distance,z,0,0,!1,f),S&&a.addCurrentVertex(v,a.distance,A,0,0,!1,f)):"square"===D?(w||(a.addCurrentVertex(v,a.distance,z,1,1,!1,f),a.e1=a.e2=-1),S&&a.addCurrentVertex(v,a.distance,A,-1,-1,!1,f)):"round"===D&&(w||(a.addCurrentVertex(v,a.distance,z,0,0,!1,f),a.addCurrentVertex(v,a.distance,z,1,1,!0,f),a.e1=a.e2=-1),S&&(a.addCurrentVertex(v,a.distance,A,-1,-1,!0,f),a.addCurrentVertex(v,a.distance,A,0,0,!1,f)));if(L&&C2*p){var Z=v.add(S.sub(v)._mult(p/q)._round());a.distance+=Z.dist(v),a.addCurrentVertex(Z,a.distance,A.mult(1),0,0,!1,f),v=Z}}w=!1}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,s)}},w.prototype.addCurrentVertex=function(t,e,r,n,o,a,s){var l,u=this.layoutVertexArray,c=this.indexArray;l=r.clone(),n&&l._sub(r.perp()._mult(n)),i(u,t,l,a,!1,n,e),this.e3=s.vertexLength++,this.e1>=0&&this.e2>=0&&(c.emplaceBack(this.e1,this.e2,this.e3),s.primitiveLength++),this.e1=this.e2,this.e2=this.e3,l=r.mult(-1),o&&l._sub(r.perp()._mult(o)),i(u,t,l,a,!0,-o,e),this.e3=s.vertexLength++,this.e1>=0&&this.e2>=0&&(c.emplaceBack(this.e1,this.e2,this.e3),s.primitiveLength++),this.e1=this.e2,this.e2=this.e3,e>_/2&&(this.distance=0,this.addCurrentVertex(t,this.distance,r,n,o,a,s))},w.prototype.addPieSliceVertex=function(t,e,r,n,o){r=r.mult(n?-1:1);var a=this.layoutVertexArray,s=this.indexArray;i(a,t,r,!1,n,0,e),this.e3=o.vertexLength++,this.e1>=0&&this.e2>=0&&(s.emplaceBack(this.e1,this.e2,this.e3),o.primitiveLength++),n?this.e2=this.e3:this.e1=this.e3},w.programInterface=x,e.exports=w},{"../../gl/index_buffer":61,"../../gl/vertex_buffer":62,"../extent":48,"../index_array_type":50,"../load_geometry":51,"../program_configuration":53,"../segment":55,"../vertex_array_type":56,"@mapbox/vector-tile":6}],47:[function(t,e,r){"use strict";function i(t,e,r,i,n,o,a,s){t.emplaceBack(e,r,Math.round(64*i),Math.round(64*n),o,a,s?s[0]:void 0,s?s[1]:void 0)}function n(t,e,r,i){var n=2*Math.PI,o=b((r+n)%n/n*255,10*i);t.emplaceBack(e.x,e.y,o),t.emplaceBack(e.x,e.y,o),t.emplaceBack(e.x,e.y,o),t.emplaceBack(e.x,e.y,o)}function o(t,e,r,i,n,o){return t.emplaceBack(e.x,e.y,r.x,r.y,Math.round(i.x),Math.round(i.y),10*n,10*o)}function a(t,e,r){var i={};if(i.isFeatureConstant=e.isLayoutValueFeatureConstant(r),i.isZoomConstant=e.isLayoutValueZoomConstant(r),i.isFeatureConstant&&(i.layoutSize=e.getLayoutValue(r,{zoom:t+1})),!i.isZoomConstant){for(var n=e.getLayoutValueStopZoomLevels(r),o=0;o_||a.y<0||a.y>_);if(!v||u){var c=u||z;n.addSymbolInstance(a,o,e,r,n.layers[0],c,n.collisionBoxArray,t.index,t.sourceLayerIndex,n.index,h,y,b,s,d,g,S,l,{zoom:n.zoom},t.properties,i)}};if("line"===A)for(var k=0,M=R(t.geometry,0,0,_,_);k=0;o--)if(r.dist(n[o])1*Math.PI/4&&T<=3*Math.PI/4||T>5*Math.PI/4&&T<=7*Math.PI/4,z=Boolean(p&L.vertical)&&S,A=0,C=e;AJ.MAX_INSTANCES&&D.warnOnce("Too many symbols being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),P>J.MAX_INSTANCES&&D.warnOnce("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907");var R=(r[L.vertical]?L.vertical:0)|(r[L.horizontal]?L.horizontal:0);this.symbolInstances.push({textBoxStartIndex:k,textBoxEndIndex:M,iconBoxStartIndex:I,iconBoxEndIndex:P,glyphQuads:S,iconQuads:T,textOffset:f,iconOffset:y,anchor:t,line:e,featureIndex:s,featureProperties:_,writingModes:R})},J.programInterfaces=X,J.MAX_INSTANCES=65535,J.addDynamicAttributes=n,e.exports=J},{"../../gl/index_buffer":61,"../../gl/vertex_buffer":62,"../../shaders/encode_attribute":85,"../../symbol/anchor":167,"../../symbol/clip_line":169,"../../symbol/collision_feature":171,"../../symbol/get_anchors":173,"../../symbol/mergelines":174,"../../symbol/quads":176,"../../symbol/shaping":177,"../../symbol/transform_text":179,"../../util/classify_rings":205,"../../util/find_pole_of_inaccessibility":211,"../../util/script_detection":218,"../../util/struct_array":220,"../../util/token":222,"../../util/util":223,"../../util/verticalize_punctuation":225,"../extent":48,"../index_array_type":50,"../load_geometry":51,"../program_configuration":53,"../segment":55,"../vertex_array_type":56,"@mapbox/point-geometry":2,"@mapbox/vector-tile":6}],48:[function(t,e,r){"use strict";e.exports=8192},{}],49:[function(t,e,r){"use strict";function i(t,e){return e-t}var n=(t("@mapbox/point-geometry"),t("./load_geometry")),o=t("./extent"),a=t("../style-spec/feature_filter"),s=t("../util/struct_array"),l=t("grid-index"),u=t("../util/dictionary_coder"),c=t("@mapbox/vector-tile"),p=t("pbf"),h=t("../util/vectortile_to_geojson"),f=t("../util/util").arraysIntersect,d=s({members:[{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]}),m=function(t,e,r,i){this.coord=t,this.overscaling=e,this.x=t.x,this.y=t.y,this.z=t.z-Math.log(e)/Math.LN2,this.grid=r||new l(o,16,0),this.featureIndexArray=i||new d};m.deserialize=function(t,e,r){var i=new m(t.coord,t.overscaling,new l(t.grid),new d(t.featureIndexArray));return i.rawTileData=e,i.bucketLayerIDs=t.bucketLayerIDs,i.setCollisionTile(r),i},m.prototype.insert=function(t,e,r,i,n){var o=this,a=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,i,n);for(var s=0;so.max||u.yo.max)&&i.warnOnce("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}},{"../util/util":223,"./extent":48}],52:[function(t,e,r){"use strict";var i=t("../util/struct_array"),n=i({members:[{name:"a_pos",type:"Int16",components:2}]});e.exports=n},{"../util/struct_array":220}],53:[function(t,e,r){"use strict";function i(t){return[a(255*t[0],255*t[1]),a(255*t[2],255*t[3])]}var n=t("./vertex_array_type"),o=t("../style-spec/function").interpolationFactor,a=t("../shaders/encode_attribute").packUint8ToFloat,s=t("../gl/vertex_buffer"),l=function(t,e,r,i){this.name=t,this.type=e,this.property=r,this.useIntegerZoom=i};l.prototype.defines=function(){return["#define HAS_UNIFORM_u_"+this.name]},l.prototype.populatePaintArray=function(){},l.prototype.setUniforms=function(t,e,r,i){var n=i.zoom,o=r.getPaintValue(this.property,{zoom:this.useIntegerZoom?Math.floor(n):n});"color"===this.type?t.uniform4fv(e.uniforms["u_"+this.name],o):t.uniform1f(e.uniforms["u_"+this.name],o)};var u=function(t,e,r){this.name=t,this.type=e,this.property=r};u.prototype.defines=function(){return[]},u.prototype.populatePaintArray=function(t,e,r,n,o,a){var s=this,l=t.getPaintValue(this.property,void 0,a);if("color"===this.type)for(var u=i(l),c=n;co&&n("Max vertices per segment is "+o+": bucket requested "+t),(!a||a.vertexLength+t>e.exports.MAX_VERTEX_ARRAY_LENGTH)&&(a={vertexOffset:r.length,primitiveOffset:i.length,vertexLength:0,primitiveLength:0},this.segments.push(a)),a},a.prototype.get=function(){return this.segments},a.prototype.destroy=function(){for(var t=this,e=0,r=t.segments;e90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};n.prototype.wrap=function(){return new n(i(this.lng,-180,180),this.lat)},n.prototype.toArray=function(){return[this.lng,this.lat]},n.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},n.prototype.toBounds=function(e){var r=360*e/40075017,i=r/Math.cos(Math.PI/180*this.lat);return new(t("./lng_lat_bounds"))(new n(this.lng-i,this.lat-r),new n(this.lng+i,this.lat+r))},n.convert=function(t){if(t instanceof n)return t;if(Array.isArray(t)&&2===t.length)return new n(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new n(Number(t.lng),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, or an array of [, ]")},e.exports=n},{"../util/util":223,"./lng_lat_bounds":59}],59:[function(t,e,r){"use strict";var i=t("./lng_lat"),n=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};n.prototype.setNorthEast=function(t){return this._ne=t instanceof i?new i(t.lng,t.lat):i.convert(t),this},n.prototype.setSouthWest=function(t){return this._sw=t instanceof i?new i(t.lng,t.lat):i.convert(t),this},n.prototype.extend=function(t){var e,r,o=this._sw,a=this._ne;if(t instanceof i)e=t,r=t;else{if(!(t instanceof n))return Array.isArray(t)?t.every(Array.isArray)?this.extend(n.convert(t)):this.extend(i.convert(t)):this;if(e=t._sw,r=t._ne,!e||!r)return this}return o||a?(o.lng=Math.min(e.lng,o.lng),o.lat=Math.min(e.lat,o.lat),a.lng=Math.max(r.lng,a.lng),a.lat=Math.max(r.lat,a.lat)):(this._sw=new i(e.lng,e.lat),this._ne=new i(r.lng,r.lat)),this},n.prototype.getCenter=function(){return new i((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},n.prototype.getSouthWest=function(){return this._sw},n.prototype.getNorthEast=function(){return this._ne},n.prototype.getNorthWest=function(){return new i(this.getWest(),this.getNorth())},n.prototype.getSouthEast=function(){return new i(this.getEast(),this.getSouth())},n.prototype.getWest=function(){return this._sw.lng},n.prototype.getSouth=function(){return this._sw.lat},n.prototype.getEast=function(){return this._ne.lng},n.prototype.getNorth=function(){return this._ne.lat},n.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},n.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},n.convert=function(t){return!t||t instanceof n?t:new n(t)},e.exports=n},{"./lng_lat":58}],60:[function(t,e,r){"use strict";var i=t("./lng_lat"),n=t("@mapbox/point-geometry"),o=t("./coordinate"),a=t("../util/util"),s=t("../style-spec/util/interpolate"),l=t("../source/tile_coord"),u=t("../data/extent"),c=t("@mapbox/gl-matrix"),p=c.vec4,h=c.mat4,f=c.mat2,d=function(t,e,r){this.tileSize=512,this._renderWorldCopies=void 0===r||r,this._minZoom=t||0,this._maxZoom=e||22,this.latRange=[-85.05113,85.05113],this.width=0,this.height=0,this._center=new i(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0},m={minZoom:{},maxZoom:{},renderWorldCopies:{},worldSize:{},centerPoint:{},size:{},bearing:{},pitch:{},fov:{},zoom:{},center:{},unmodified:{},x:{},y:{},point:{}};m.minZoom.get=function(){return this._minZoom},m.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},m.maxZoom.get=function(){return this._maxZoom},m.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},m.renderWorldCopies.get=function(){return this._renderWorldCopies},m.worldSize.get=function(){return this.tileSize*this.scale},m.centerPoint.get=function(){return this.size._div(2)},m.size.get=function(){return new n(this.width,this.height)},m.bearing.get=function(){return-this.angle/Math.PI*180},m.bearing.set=function(t){var e=-a.wrap(t,-180,180)*Math.PI/180;this.angle!==e&&(this._unmodified=!1,this.angle=e,this._calcMatrices(),this.rotationMatrix=f.create(),f.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},m.pitch.get=function(){return this._pitch/Math.PI*180},m.pitch.set=function(t){var e=a.clamp(t,0,60)/180*Math.PI;this._pitch!==e&&(this._unmodified=!1,this._pitch=e,this._calcMatrices())},m.fov.get=function(){return this._fov/Math.PI*180},m.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())},m.zoom.get=function(){return this._zoom},m.zoom.set=function(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._constrain(),this._calcMatrices())},m.center.get=function(){return this._center},m.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},d.prototype.coveringZoomLevel=function(t){return(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},d.prototype.getVisibleWrappedCoordinates=function(t){for(var e=this.pointCoordinate(new n(0,0),0),r=this.pointCoordinate(new n(this.width,0),0),i=Math.floor(e.column),o=Math.floor(r.column),a=[t],s=i;s<=o;s++)0!==s&&a.push(new l(t.z,t.x,t.y,s));return a},d.prototype.coveringTiles=function(t){var e=this.coveringZoomLevel(t),r=e;if(void 0!==t.minzoom&&et.maxzoom&&(e=t.maxzoom);var i=this.pointCoordinate(this.centerPoint,e),o=new n(i.column-.5,i.row-.5),a=[this.pointCoordinate(new n(0,0),e),this.pointCoordinate(new n(this.width,0),e),this.pointCoordinate(new n(this.width,this.height),e),this.pointCoordinate(new n(0,this.height),e)];return l.cover(e,a,t.reparseOverscaled?r:e,this._renderWorldCopies).sort(function(t,e){return o.dist(t)-o.dist(e)})},d.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},m.unmodified.get=function(){return this._unmodified},d.prototype.zoomScale=function(t){return Math.pow(2,t)},d.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},d.prototype.project=function(t){return new n(this.lngX(t.lng),this.latY(t.lat))},d.prototype.unproject=function(t){return new i(this.xLng(t.x),this.yLat(t.y))},m.x.get=function(){return this.lngX(this.center.lng)},m.y.get=function(){return this.latY(this.center.lat)},m.point.get=function(){return new n(this.x,this.y)},d.prototype.lngX=function(t){return(180+t)*this.worldSize/360},d.prototype.latY=function(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))*this.worldSize/360},d.prototype.xLng=function(t){return 360*t/this.worldSize-180},d.prototype.yLat=function(t){var e=180-360*t/this.worldSize;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90},d.prototype.setLocationAtPoint=function(t,e){var r=this.pointCoordinate(e)._sub(this.pointCoordinate(this.centerPoint));this.center=this.coordinateLocation(this.locationCoordinate(t)._sub(r)),this._renderWorldCopies&&(this.center=this.center.wrap())},d.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},d.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},d.prototype.locationCoordinate=function(t){return new o(this.lngX(t.lng)/this.tileSize,this.latY(t.lat)/this.tileSize,this.zoom).zoomTo(this.tileZoom)},d.prototype.coordinateLocation=function(t){var e=t.zoomTo(this.zoom);return new i(this.xLng(e.column*this.tileSize),this.yLat(e.row*this.tileSize))},d.prototype.pointCoordinate=function(t,e){void 0===e&&(e=this.tileZoom);var r=[t.x,t.y,0,1],i=[t.x,t.y,1,1];p.transformMat4(r,r,this.pixelMatrixInverse),p.transformMat4(i,i,this.pixelMatrixInverse);var n=r[3],a=i[3],l=r[0]/n,u=i[0]/a,c=r[1]/n,h=i[1]/a,f=r[2]/n,d=i[2]/a,m=f===d?0:(0-f)/(d-f);return new o(s(l,u,m)/this.tileSize,s(c,h,m)/this.tileSize,this.zoom)._zoomTo(e)},d.prototype.coordinatePoint=function(t){var e=t.zoomTo(this.zoom),r=[e.column*this.tileSize,e.row*this.tileSize,0,1];return p.transformMat4(r,r,this.pixelMatrix),new n(r[0]/r[3],r[1]/r[3])},d.prototype.calculatePosMatrix=function(t,e){var r=t.toCoordinate(e),i=this.worldSize/this.zoomScale(r.zoom),n=h.identity(new Float64Array(16));return h.translate(n,n,[r.column*i,r.row*i,0]),h.scale(n,n,[i/u,i/u,1]),h.multiply(n,this.projMatrix,n),new Float32Array(n)},d.prototype.cameraToTileDistance=function(t){var e=this.calculatePosMatrix(t.coord,t.sourceMaxZoom),r=[t.tileSize/2,t.tileSize/2,0,1];return p.transformMat4(r,r,e),r[3]},d.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,e,r,i,o=-90,a=90,s=-180,l=180,u=this.size,c=this._unmodified;if(this.latRange){var p=this.latRange;o=this.latY(p[1]),a=this.latY(p[0]),t=a-oa&&(i=a-m)}if(this.lngRange){var v=this.x,y=u.x/2;v-yl&&(r=l-y)}void 0===r&&void 0===i||(this.center=this.unproject(new n(void 0!==r?r:this.x,void 0!==i?i:this.y))),this._unmodified=c,this._constraining=!1}},d.prototype._calcMatrices=function(){if(this.height){this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var t=this._fov/2,e=Math.PI/2+this._pitch,r=Math.sin(t)*this.cameraToCenterDistance/Math.sin(Math.PI-e-t),i=Math.cos(Math.PI/2-this._pitch)*r+this.cameraToCenterDistance,n=1.01*i,o=new Float64Array(16);h.perspective(o,this._fov,this.width/this.height,1,n),h.scale(o,o,[1,-1,1]),h.translate(o,o,[0,0,-this.cameraToCenterDistance]),h.rotateX(o,o,this._pitch),h.rotateZ(o,o,this.angle),h.translate(o,o,[-this.x,-this.y,0]);var a=this.worldSize/(2*Math.PI*6378137*Math.abs(Math.cos(this.center.lat*(Math.PI/180))));if(h.scale(o,o,[1,1,a,1]),this.projMatrix=o,o=h.create(),h.scale(o,o,[this.width/2,-this.height/2,1]),h.translate(o,o,[1,-1,0]),this.pixelMatrix=h.multiply(new Float64Array(16),o,this.projMatrix),!(o=h.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=o}},Object.defineProperties(d.prototype,m),e.exports=d},{"../data/extent":48,"../source/tile_coord":101,"../style-spec/util/interpolate":127,"../util/util":223,"./coordinate":57,"./lng_lat":58,"@mapbox/gl-matrix":1,"@mapbox/point-geometry":2}],61:[function(t,e,r){"use strict";var i=function(t,e){this.gl=t,this.buffer=t.createBuffer(),void 0===t.extVertexArrayObject&&(t.extVertexArrayObject=t.getExtension("OES_vertex_array_object")),t.extVertexArrayObject&&t.extVertexArrayObject.bindVertexArrayOES(null),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.buffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,t.STATIC_DRAW),delete e.arrayBuffer};i.prototype.bind=function(){this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,this.buffer)},i.prototype.destroy=function(){this.buffer&&(this.gl.deleteBuffer(this.buffer),delete this.buffer)},e.exports=i},{}],62:[function(t,e,r){"use strict";var i={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},n=function(t,e,r){this.length=e.length,this.attributes=e.members,this.itemSize=e.bytesPerElement,this.dynamicDraw=r,this.gl=t,this.buffer=t.createBuffer(),this.gl.bindBuffer(t.ARRAY_BUFFER,this.buffer),this.gl.bufferData(t.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?t.DYNAMIC_DRAW:t.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};n.prototype.bind=function(){this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.buffer)},n.prototype.updateData=function(t){this.bind(),this.gl.bufferSubData(this.gl.ARRAY_BUFFER,0,t.arrayBuffer)},n.prototype.enableAttributes=function(t,e){for(var r=this,i=0;i":[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]]}},{"../data/extent":48,"../data/pos_array":52,"../gl/vertex_buffer":62,"../util/browser":202,"./vertex_array_object":84,"@mapbox/gl-matrix":1}],68:[function(t,e,r){"use strict";function i(t,e,r,i){var s=t.gl;s.enable(s.STENCIL_TEST);var l=!r.paint["fill-pattern"]&&r.isPaintValueFeatureConstant("fill-color")&&r.isPaintValueFeatureConstant("fill-opacity")&&1===r.paint["fill-color"][3]&&1===r.paint["fill-opacity"]?"opaque":"translucent";t.renderPass===l&&(t.setDepthSublayer(1),t.depthMask("opaque"===t.renderPass),n(t,e,r,i,o)),"translucent"===t.renderPass&&r.paint["fill-antialias"]&&(t.lineWidth(2),t.depthMask(!1),t.setDepthSublayer(r.getPaintProperty("fill-outline-color")?2:0),n(t,e,r,i,a))}function n(t,e,r,i,n){if(!l.isPatternMissing(r.paint["fill-pattern"],t))for(var o=!0,a=0,s=i;a0?1/(1-t):1+t}function a(t){return t>0?1-1/(1.001-t):-t}function s(t,e,r,i,n){var o=i.paint["raster-fade-duration"];if(o>0){var a=Date.now(),s=(a-t.timeAdded)/o,u=e?(a-e.timeAdded)/o:-1,c=r.getSource(),p=n.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),h=!e||Math.abs(e.coord.z-p)>Math.abs(t.coord.z-p),f=h&&t.refreshedUponExpiration?1:l.clamp(h?s:1-u,0,1);return t.refreshedUponExpiration&&s>=1&&(t.refreshedUponExpiration=!1),e?{opacity:1,mix:1-f}:{opacity:f,mix:0}}return{opacity:1,mix:0}}var l=t("../util/util"),u=t("../source/image_source");e.exports=i},{"../source/image_source":91,"../util/util":223}],72:[function(t,e,r){"use strict";function i(t,e,r,i){if("translucent"===t.renderPass){var o=!(r.layout["text-allow-overlap"]||r.layout["icon-allow-overlap"]||r.layout["text-ignore-placement"]||r.layout["icon-ignore-placement"]),a=t.gl;o?a.disable(a.STENCIL_TEST):a.enable(a.STENCIL_TEST),t.setDepthSublayer(0),t.depthMask(!1),n(t,e,r,i,!1,r.paint["icon-translate"],r.paint["icon-translate-anchor"],r.layout["icon-rotation-alignment"],r.layout["icon-pitch-alignment"],r.layout["icon-keep-upright"]),n(t,e,r,i,!0,r.paint["text-translate"],r.paint["text-translate-anchor"],r.layout["text-rotation-alignment"],r.layout["text-pitch-alignment"],r.layout["text-keep-upright"]),e.map.showCollisionBoxes&&l(t,e,r,i)}}function n(t,e,r,i,n,s,l,p,h,d){var m=t.gl,v=t.transform,y="map"===p,g="map"===h,_=y&&"line"===r.layout["symbol-placement"],x=y&&!g&&!_,b=g;b?m.enable(m.DEPTH_TEST):m.disable(m.DEPTH_TEST);for(var w,T=0,S=i;Tthis.previousZoom;n--)i.changeTimes[n]=t,i.changeOpacities[n]=i.opacities[n];for(n=0;n<256;n++){var o=t-i.changeTimes[n],a=255*(r?o/r:1);i.opacities[n]=n<=e?i.changeOpacities[n]+a:i.changeOpacities[n]-a}this.changed=!0,this.previousZoom=e},i.prototype.isVisible=function(t){return 0!==this.opacities[Math.floor(10*t)]},i.prototype.bind=function(t){this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.changed&&(t.texSubImage2D(t.TEXTURE_2D,0,0,0,256,1,t.ALPHA,t.UNSIGNED_BYTE,this.array),this.changed=!1)):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,256,1,0,t.ALPHA,t.UNSIGNED_BYTE,this.array))},e.exports=i},{}],74:[function(t,e,r){"use strict";function i(t){var e=a.create({width:0,height:0}),r={},i=new n(0,0,{autoResize:!0});for(var o in t){var l=t[o],u=r[o]={};for(var c in l){var p=l[+c];if(p&&0!==p.bitmap.width&&0!==p.bitmap.height){var h=i.packOne(p.bitmap.width+2*s,p.bitmap.height+2*s);a.resize(e,{width:i.w,height:i.h}),a.copy(p.bitmap,e,{x:0,y:0},{x:h.x+s,y:h.y+s},p.bitmap),u[c]={rect:h,metrics:p.metrics}}}}return i.shrink(),a.resize(e,{width:i.w,height:i.h}),{image:e,positions:r}}var n=t("@mapbox/shelf-pack"),o=t("../util/image"),a=o.AlphaImage,s=1;e.exports={makeGlyphAtlas:i}},{"../util/image":213,"@mapbox/shelf-pack":3}],75:[function(t,e,r){"use strict";var i=t("../style/load_glyph_range"),n=t("@mapbox/tiny-sdf"),o=t("../util/is_char_in_unicode_block"),a=t("../util/util"),s=a.asyncAll,l=t("../util/image"),u=l.AlphaImage,c=function(t,e){this.requestTransform=t,this.localIdeographFontFamily=e,this.entries={}};c.prototype.setURL=function(t){this.url=t},c.prototype.getGlyphs=function(t,e){var r=this,n=[];for(var o in t)for(var a=0,l=t[o];a65535)return void e(new Error("glyphs > 65535 not supported"));var u=a.requests[l];u||(u=a.requests[l]=[],i(n,l,r.url,r.requestTransform,function(t,e){if(e)for(var r in e)a.glyphs[+r]=e[+r];for(var i=0,n=u;ithis.height)return i.warnOnce("LineAtlas out of space"),null;for(var a=0,s=0;s=0;this.currentLayer--){var d=r.style._layers[o[r.currentLayer]];d.source!==(h&&h.id)&&(h=r.style.sourceCaches[d.source],f=[],h&&(r.clearStencil(),f=h.getVisibleCoordinates(),h.getSource().isTileClipped&&r._renderTileClippingMasks(f))),r.renderLayer(r,h,d,f)}this.renderPass="translucent";var m,v=[];for(this.gl.enable(this.gl.BLEND),this.currentLayer=0,this.currentLayer;this.currentLayer0?e.pop():null},x.prototype.lineWidth=function(t){this.gl.lineWidth(u.clamp(t,this.lineWidthRange[0],this.lineWidthRange[1]))},x.prototype.showOverdrawInspector=function(t){if(t||this._showOverdrawInspector){this._showOverdrawInspector=t;var e=this.gl;t?(e.blendFunc(e.CONSTANT_COLOR,e.ONE),e.blendColor(1/8,1/8,1/8,0),e.clearColor(0,0,0,1),e.clear(e.COLOR_BUFFER_BIT)):e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA)}},x.prototype._createProgramCached=function(t,e){this.cache=this.cache||{};var r=""+t+(e.cacheKey||"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new y(this.gl,v[t],e,this._showOverdrawInspector)),this.cache[r]},x.prototype.useProgram=function(t,e){var r=this.gl,i=this._createProgramCached(t,e||this.emptyProgramConfiguration);return this.currentProgram!==i&&(r.useProgram(i.program),this.currentProgram=i),i},e.exports=x},{"../data/extent":48,"../data/pos_array":52,"../data/program_configuration":53,"../data/raster_bounds_array":54,"../gl/vertex_buffer":62,"../shaders":86,"../source/pixels_to_tile_units":93,"../source/source_cache":98,"../util/browser":202,"../util/util":223,"./draw_background":64,"./draw_circle":65,"./draw_debug":67,"./draw_fill":68,"./draw_fill_extrusion":69,"./draw_line":70,"./draw_raster":71,"./draw_symbol":72,"./frame_history":73,"./program":81,"./render_texture":82,"./vertex_array_object":84,"@mapbox/gl-matrix":1}],80:[function(t,e,r){"use strict";var i=t("../source/pixels_to_tile_units");r.isPatternMissing=function(t,e){if(!t)return!1;var r=e.imageManager.getPattern(t.from),i=e.imageManager.getPattern(t.to);return!r||!i},r.prepare=function(t,e,r){var i=e.gl,n=e.imageManager.getPattern(t.from),o=e.imageManager.getPattern(t.to);i.uniform1i(r.uniforms.u_image,0),i.uniform2fv(r.uniforms.u_pattern_tl_a,n.tl),i.uniform2fv(r.uniforms.u_pattern_br_a,n.br),i.uniform2fv(r.uniforms.u_pattern_tl_b,o.tl),i.uniform2fv(r.uniforms.u_pattern_br_b,o.br);var a=e.imageManager.getPixelSize(),s=a.width,l=a.height;i.uniform2fv(r.uniforms.u_texsize,[s,l]),i.uniform1f(r.uniforms.u_mix,t.t),i.uniform2fv(r.uniforms.u_pattern_size_a,n.displaySize),i.uniform2fv(r.uniforms.u_pattern_size_b,o.displaySize),i.uniform1f(r.uniforms.u_scale_a,t.fromScale),i.uniform1f(r.uniforms.u_scale_b,t.toScale),i.activeTexture(i.TEXTURE0),e.imageManager.bind(i)},r.setTile=function(t,e,r){var n=e.gl;n.uniform1f(r.uniforms.u_tile_units_to_pixels,1/i(t,1,e.transform.tileZoom));var o=Math.pow(2,t.coord.z),a=t.tileSize*Math.pow(2,e.transform.tileZoom)/o,s=a*(t.coord.x+t.coord.w*o),l=a*t.coord.y;n.uniform2f(r.uniforms.u_pixel_coord_upper,s>>16,l>>16),n.uniform2f(r.uniforms.u_pixel_coord_lower,65535&s,65535&l)}},{"../source/pixels_to_tile_units":93}],81:[function(t,e,r){"use strict";var i=t("../util/browser"),n=t("../shaders"),o=t("../data/program_configuration"),a=(o.ProgramConfiguration,t("./vertex_array_object")),s=function(t,e,r,o){var a=this;this.gl=t,this.program=t.createProgram();var s=r.defines().concat("#define DEVICE_PIXEL_RATIO "+i.devicePixelRatio.toFixed(1));o&&s.push("#define OVERDRAW_INSPECTOR;");var l=s.concat(n.prelude.fragmentSource,e.fragmentSource).join("\n"),u=s.concat(n.prelude.vertexSource,e.vertexSource).join("\n"),c=t.createShader(t.FRAGMENT_SHADER);t.shaderSource(c,l),t.compileShader(c),t.attachShader(this.program,c);var p=t.createShader(t.VERTEX_SHADER);t.shaderSource(p,u),t.compileShader(p),t.attachShader(this.program,p);for(var h=r.interface?r.interface.layoutAttributes:[],f=0;f= v_max_zoom + v_perspective_zoom_adjust) {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0) * alpha * 0.25;\n }\n\n // Faded blue = the placement scale for this label is beyond the CollisionTile\n // max scale, so it's impossible for this label to show without collision detection\n // being run again (the label's glyphs haven't even been added to the symbol bucket)\n if (v_placement_zoom >= u_maxzoom) {\n gl_FragColor = vec4(0.0, 0.0, 1.0, 1.0) * alpha * 0.2;\n }\n}\n",vertexSource:"attribute vec2 a_pos;\nattribute vec2 a_anchor_pos;\nattribute vec2 a_extrude;\nattribute vec2 a_data;\n\nuniform mat4 u_matrix;\nuniform float u_scale;\nuniform float u_pitch;\nuniform float u_collision_y_stretch;\nuniform float u_camera_to_center_distance;\n\nvarying float v_max_zoom;\nvarying float v_placement_zoom;\nvarying float v_perspective_zoom_adjust;\nvarying vec2 v_fade_tex;\n\nvoid main() {\n vec4 projectedPoint = u_matrix * vec4(a_anchor_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n highp float collision_perspective_ratio = 1.0 + 0.5 * ((camera_to_anchor_distance / u_camera_to_center_distance) - 1.0);\n\n highp float incidence_stretch = camera_to_anchor_distance / (u_camera_to_center_distance * cos(u_pitch));\n highp float collision_adjustment = max(1.0, incidence_stretch / u_collision_y_stretch);\n\n gl_Position = u_matrix * vec4(a_pos + a_extrude * collision_perspective_ratio * collision_adjustment / u_scale, 0.0, 1.0);\n\n v_max_zoom = a_data.x;\n v_placement_zoom = a_data.y;\n\n v_perspective_zoom_adjust = floor(log2(collision_perspective_ratio * collision_adjustment) * 10.0);\n v_fade_tex = vec2((v_placement_zoom + v_perspective_zoom_adjust) / 255.0, 0.0);\n}\n"},debug:{fragmentSource:"uniform highp vec4 u_color;\n\nvoid main() {\n gl_FragColor = u_color;\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\nvoid main() {\n // We are using Int16 for texture position coordinates to give us enough precision for\n // fractional coordinates. We use 8192 to scale the texture coordinates in the buffer\n // as an arbitrarily high number to preserve adequate precision when rendering.\n // This is also the same value as the EXTENT we are using for our tile buffer pos coordinates,\n // so math for modifying either is consistent.\n gl_Position = u_matrix * vec4(a_pos, step(8192.0, a_pos.x), 1);\n}\n"},fill:{fragmentSource:"#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float opacity\n\n gl_FragColor = color * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n"},fillOutline:{fragmentSource:"#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_pos;\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = 1.0 - smoothstep(0.0, 1.0, dist);\n gl_FragColor = outline_color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos;\n\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},fillOutlinePattern:{fragmentSource:"uniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, 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_texsize, u_pattern_br_b / u_texsize, 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 = 1.0 - smoothstep(0.0, 1.0, dist);\n\n\n gl_FragColor = mix(color1, color2, u_mix) * alpha * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_world;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, a_pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, a_pos);\n\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},fillPattern:{fragmentSource:"uniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, 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_texsize, u_pattern_br_b / u_texsize, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n gl_FragColor = mix(color1, color2, u_mix) * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, a_pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, a_pos);\n}\n"},fillExtrusion:{fragmentSource:"varying vec4 v_color;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define highp vec4 color\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n #pragma mapbox: initialize highp vec4 color\n\n gl_FragColor = v_color;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec3 u_lightcolor;\nuniform lowp vec3 u_lightpos;\nuniform lowp float u_lightintensity;\n\nattribute vec2 a_pos;\nattribute vec3 a_normal;\nattribute float a_edgedistance;\n\nvarying vec4 v_color;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\n#pragma mapbox: define highp vec4 color\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n #pragma mapbox: initialize highp vec4 color\n\n base = max(0.0, base);\n height = max(0.0, height);\n\n float ed = a_edgedistance; // use each attrib in order to not trip a VAO assert\n float t = mod(a_normal.x, 2.0);\n\n gl_Position = u_matrix * vec4(a_pos, t > 0.0 ? height : base, 1);\n\n // Relative luminance (how dark/bright is the surface color?)\n float colorvalue = color.r * 0.2126 + color.g * 0.7152 + color.b * 0.0722;\n\n v_color = vec4(0.0, 0.0, 0.0, 1.0);\n\n // Add slight ambient lighting so no extrusions are totally black\n vec4 ambientlight = vec4(0.03, 0.03, 0.03, 1.0);\n color += ambientlight;\n\n // Calculate cos(theta), where theta is the angle between surface normal and diffuse light ray\n float directional = clamp(dot(a_normal / 16384.0, u_lightpos), 0.0, 1.0);\n\n // Adjust directional so that\n // the range of values for highlight/shading is narrower\n // with lower light intensity\n // and with lighter/brighter surface colors\n directional = mix((1.0 - u_lightintensity), max((1.0 - colorvalue + u_lightintensity), 1.0), directional);\n\n // Add gradient along z axis of side surfaces\n if (a_normal.y != 0.0) {\n directional *= clamp((t + base) * pow(height / 150.0, 0.5), mix(0.7, 0.98, 1.0 - u_lightintensity), 1.0);\n }\n\n // Assign final color based on surface + ambient light color, diffuse light directional, and light color\n // with lower bounds adjusted to hue of light\n // so that shading is tinted with the complementary (opposite) color to the light color\n v_color.r += clamp(color.r * directional * u_lightcolor.r, mix(0.0, 0.3, 1.0 - u_lightcolor.r), 1.0);\n v_color.g += clamp(color.g * directional * u_lightcolor.g, mix(0.0, 0.3, 1.0 - u_lightcolor.g), 1.0);\n v_color.b += clamp(color.b * directional * u_lightcolor.b, mix(0.0, 0.3, 1.0 - u_lightcolor.b), 1.0);\n}\n"},fillExtrusionPattern:{fragmentSource:"uniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec4 v_lighting;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, 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_texsize, u_pattern_br_b / u_texsize, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n vec4 mixedColor = mix(color1, color2, u_mix);\n\n gl_FragColor = mixedColor * v_lighting;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\nuniform float u_height_factor;\n\nuniform vec3 u_lightcolor;\nuniform lowp vec3 u_lightpos;\nuniform lowp float u_lightintensity;\n\nattribute vec2 a_pos;\nattribute vec3 a_normal;\nattribute float a_edgedistance;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec4 v_lighting;\nvarying float v_directional;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n\n base = max(0.0, base);\n height = max(0.0, height);\n\n float t = mod(a_normal.x, 2.0);\n float z = t > 0.0 ? height : base;\n\n gl_Position = u_matrix * vec4(a_pos, z, 1);\n\n vec2 pos = a_normal.x == 1.0 && a_normal.y == 0.0 && a_normal.z == 16384.0\n ? a_pos // extrusion top\n : vec2(a_edgedistance, z * u_height_factor); // extrusion side\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, pos);\n\n v_lighting = vec4(0.0, 0.0, 0.0, 1.0);\n float directional = clamp(dot(a_normal / 16383.0, u_lightpos), 0.0, 1.0);\n directional = mix((1.0 - u_lightintensity), max((0.5 + u_lightintensity), 1.0), directional);\n\n if (a_normal.y != 0.0) {\n directional *= clamp((t + base) * pow(height / 150.0, 0.5), mix(0.7, 0.98, 1.0 - u_lightintensity), 1.0);\n }\n\n v_lighting.rgb += clamp(directional * u_lightcolor, mix(vec3(0.0), vec3(0.3), 1.0 - u_lightcolor), vec3(1.0));\n}\n"},extrusionTexture:{fragmentSource:"uniform sampler2D u_image;\nuniform float u_opacity;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_FragColor = texture2D(u_image, v_pos) * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(0.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_world;\nattribute vec2 a_pos;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos * u_world, 0, 1);\n\n v_pos.x = a_pos.x;\n v_pos.y = 1.0 - a_pos.y;\n}\n"},line:{fragmentSource:"#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_width2;\nvarying vec2 v_normal;\nvarying float v_gamma_scale;\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump float gapwidth\n #pragma mapbox: initialize lowp float offset\n #pragma mapbox: initialize mediump float width\n\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n\n vec2 pos = a_pos_normal.xy;\n\n // x is 1 if it's a round cap, 0 otherwise\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = a_pos_normal.zw;\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases.\n // moved them into the shader for clarity and simplicity.\n gapwidth = gapwidth / 2.0;\n float halfwidth = width / 2.0;\n offset = -1.0 * offset;\n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + ANTIALIASING;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_width2 = vec2(outset, inset);\n}\n"},linePattern:{fragmentSource:"uniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_fade;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n float x_a = mod(v_linesofar / u_pattern_size_a.x, 1.0);\n float x_b = mod(v_linesofar / u_pattern_size_b.x, 1.0);\n float y_a = 0.5 + (v_normal.y * v_width2.s / u_pattern_size_a.y);\n float y_b = 0.5 + (v_normal.y * v_width2.s / u_pattern_size_b.y);\n vec2 pos_a = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, vec2(x_a, y_a));\n vec2 pos_b = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, vec2(x_b, y_b));\n\n vec4 color = mix(texture2D(u_image, pos_a), texture2D(u_image, pos_b), u_fade);\n\n gl_FragColor = color * alpha * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n\nvoid main() {\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize lowp float offset\n #pragma mapbox: initialize mediump float gapwidth\n #pragma mapbox: initialize mediump float width\n\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n vec2 pos = a_pos_normal.xy;\n\n // x is 1 if it's a round cap, 0 otherwise\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = a_pos_normal.zw;\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases.\n // moved them into the shader for clarity and simplicity.\n gapwidth = gapwidth / 2.0;\n float halfwidth = width / 2.0;\n offset = -1.0 * offset;\n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + ANTIALIASING;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_linesofar = a_linesofar;\n v_width2 = vec2(outset, inset);\n}\n"},lineSDF:{fragmentSource:"\nuniform sampler2D u_image;\nuniform float u_sdfgamma;\nuniform float u_mix;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump float width\n #pragma mapbox: initialize lowp float floorwidth\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n float sdfdist_a = texture2D(u_image, v_tex_a).a;\n float sdfdist_b = texture2D(u_image, v_tex_b).a;\n float sdfdist = mix(sdfdist_a, sdfdist_b, u_mix);\n alpha *= smoothstep(0.5 - u_sdfgamma / floorwidth, 0.5 + u_sdfgamma / floorwidth, sdfdist);\n\n gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_patternscale_a;\nuniform float u_tex_y_a;\nuniform vec2 u_patternscale_b;\nuniform float u_tex_y_b;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump float gapwidth\n #pragma mapbox: initialize lowp float offset\n #pragma mapbox: initialize mediump float width\n #pragma mapbox: initialize lowp float floorwidth\n\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n vec2 pos = a_pos_normal.xy;\n\n // x is 1 if it's a round cap, 0 otherwise\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = a_pos_normal.zw;\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases.\n // moved them into the shader for clarity and simplicity.\n gapwidth = gapwidth / 2.0;\n float halfwidth = width / 2.0;\n offset = -1.0 * offset;\n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + ANTIALIASING;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist =outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_tex_a = vec2(a_linesofar * u_patternscale_a.x / floorwidth, normal.y * u_patternscale_a.y + u_tex_y_a);\n v_tex_b = vec2(a_linesofar * u_patternscale_b.x / floorwidth, normal.y * u_patternscale_b.y + u_tex_y_b);\n\n v_width2 = vec2(outset, inset);\n}\n"},raster:{fragmentSource:"uniform float u_fade_t;\nuniform float u_opacity;\nuniform sampler2D u_image0;\nuniform sampler2D u_image1;\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nuniform float u_brightness_low;\nuniform float u_brightness_high;\n\nuniform float u_saturation_factor;\nuniform float u_contrast_factor;\nuniform vec3 u_spin_weights;\n\nvoid main() {\n\n // read and cross-fade colors from the main and parent tiles\n vec4 color0 = texture2D(u_image0, v_pos0);\n vec4 color1 = texture2D(u_image1, v_pos1);\n if (color0.a > 0.0) {\n color0.rgb = color0.rgb / color0.a;\n }\n if (color1.a > 0.0) {\n color1.rgb = color1.rgb / color1.a;\n }\n vec4 color = mix(color0, color1, u_fade_t);\n color.a *= u_opacity;\n vec3 rgb = color.rgb;\n\n // spin\n rgb = vec3(\n dot(rgb, u_spin_weights.xyz),\n dot(rgb, u_spin_weights.zxy),\n dot(rgb, u_spin_weights.yzx));\n\n // saturation\n float average = (color.r + color.g + color.b) / 3.0;\n rgb += (average - rgb) * u_saturation_factor;\n\n // contrast\n rgb = (rgb - 0.5) * u_contrast_factor + 0.5;\n\n // brightness\n vec3 u_high_vec = vec3(u_brightness_low, u_brightness_low, u_brightness_low);\n vec3 u_low_vec = vec3(u_brightness_high, u_brightness_high, u_brightness_high);\n\n gl_FragColor = vec4(mix(u_high_vec, u_low_vec, rgb) * color.a, color.a);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_tl_parent;\nuniform float u_scale_parent;\nuniform float u_buffer_scale;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n // We are using Int16 for texture position coordinates to give us enough precision for\n // fractional coordinates. We use 8192 to scale the texture coordinates in the buffer\n // as an arbitrarily high number to preserve adequate precision when rendering.\n // This is also the same value as the EXTENT we are using for our tile buffer pos coordinates,\n // so math for modifying either is consistent.\n v_pos0 = (((a_texture_pos / 8192.0) - 0.5) / u_buffer_scale ) + 0.5;\n v_pos1 = (v_pos0 * u_scale_parent) + u_tl_parent;\n}\n"},symbolIcon:{fragmentSource:"uniform sampler2D u_texture;\nuniform sampler2D u_fadetexture;\n\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n lowp float alpha = texture2D(u_fadetexture, v_fade_tex).a * 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:"const float PI = 3.141592653589793;\n\nattribute vec4 a_pos_offset;\nattribute vec4 a_data;\nattribute vec3 a_projected_pos;\n\nuniform bool u_is_size_zoom_constant;\nuniform bool u_is_size_feature_constant;\nuniform highp float u_size_t; // used to interpolate between zoom stops when size is a composite function\nuniform highp float u_size; // used when size is both zoom and feature constant\nuniform highp float u_camera_to_center_distance;\nuniform highp float u_pitch;\nuniform bool u_rotate_symbol;\nuniform highp float u_aspect_ratio;\nuniform highp float u_collision_y_stretch;\n\n#pragma mapbox: define lowp float opacity\n\nuniform mat4 u_matrix;\nuniform mat4 u_label_plane_matrix;\nuniform mat4 u_gl_coord_matrix;\n\nuniform bool u_is_text;\nuniform bool u_pitch_with_map;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n vec2 a_pos = a_pos_offset.xy;\n vec2 a_offset = a_pos_offset.zw;\n\n vec2 a_tex = a_data.xy;\n vec2 a_size = a_data.zw;\n\n highp vec2 angle_labelminzoom = unpack_float(a_projected_pos[2]);\n highp float segment_angle = -angle_labelminzoom[0] / 255.0 * 2.0 * PI;\n mediump float a_labelminzoom = angle_labelminzoom[1];\n\n float size;\n if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = mix(a_size[0], a_size[1], u_size_t) / 10.0;\n } else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = a_size[0] / 10.0;\n } else if (!u_is_size_zoom_constant && u_is_size_feature_constant) {\n size = u_size;\n } else {\n size = u_size;\n }\n\n vec4 projectedPoint = u_matrix * vec4(a_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n // See comments in symbol_sdf.vertex\n highp float distance_ratio = u_pitch_with_map ?\n camera_to_anchor_distance / u_camera_to_center_distance :\n u_camera_to_center_distance / camera_to_anchor_distance;\n highp float perspective_ratio = 0.5 + 0.5 * distance_ratio;\n\n size *= perspective_ratio;\n\n float fontScale = u_is_text ? size / 24.0 : size;\n\n highp float symbol_rotation = 0.0;\n if (u_rotate_symbol) {\n // See comments in symbol_sdf.vertex\n vec4 offsetProjectedPoint = u_matrix * vec4(a_pos + vec2(1, 0), 0, 1);\n\n vec2 a = projectedPoint.xy / projectedPoint.w;\n vec2 b = offsetProjectedPoint.xy / offsetProjectedPoint.w;\n\n symbol_rotation = atan((b.y - a.y) / u_aspect_ratio, b.x - a.x);\n }\n\n highp float angle_sin = sin(segment_angle + symbol_rotation);\n highp float angle_cos = cos(segment_angle + symbol_rotation);\n mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);\n\n vec4 projected_pos = u_label_plane_matrix * vec4(a_projected_pos.xy, 0.0, 1.0);\n gl_Position = u_gl_coord_matrix * vec4(projected_pos.xy / projected_pos.w + rotation_matrix * (a_offset / 64.0 * fontScale), 0.0, 1.0);\n\n v_tex = a_tex / u_texsize;\n // See comments in symbol_sdf.vertex\n highp float incidence_stretch = camera_to_anchor_distance / (u_camera_to_center_distance * cos(u_pitch));\n highp float collision_adjustment = max(1.0, incidence_stretch / u_collision_y_stretch);\n\n highp float collision_perspective_ratio = 1.0 + 0.5*((camera_to_anchor_distance / u_camera_to_center_distance) - 1.0);\n highp float perspective_zoom_adjust = floor(log2(collision_perspective_ratio * collision_adjustment) * 10.0);\n v_fade_tex = vec2((a_labelminzoom + perspective_zoom_adjust) / 255.0, 0.0);\n}\n"},symbolSDF:{fragmentSource:"#define SDF_PX 8.0\n#define EDGE_GAMMA 0.105/DEVICE_PIXEL_RATIO\n\nuniform bool u_is_halo;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n\nuniform sampler2D u_texture;\nuniform sampler2D u_fadetexture;\nuniform highp float u_gamma_scale;\nuniform bool u_is_text;\n\nvarying vec4 v_data0;\nvarying vec2 v_data1;\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 fill_color\n #pragma mapbox: initialize highp vec4 halo_color\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize lowp float halo_width\n #pragma mapbox: initialize lowp float halo_blur\n\n vec2 tex = v_data0.xy;\n vec2 fade_tex = v_data0.zw;\n float gamma_scale = v_data1.x;\n float size = v_data1.y;\n\n float fontScale = u_is_text ? size / 24.0 : size;\n\n lowp vec4 color = fill_color;\n highp float gamma = EDGE_GAMMA / (fontScale * u_gamma_scale);\n lowp float buff = (256.0 - 64.0) / 256.0;\n if (u_is_halo) {\n color = halo_color;\n gamma = (halo_blur * 1.19 / SDF_PX + EDGE_GAMMA) / (fontScale * u_gamma_scale);\n buff = (6.0 - halo_width / fontScale) / SDF_PX;\n }\n\n lowp float dist = texture2D(u_texture, tex).a;\n lowp float fade_alpha = texture2D(u_fadetexture, fade_tex).a;\n highp float gamma_scaled = gamma * gamma_scale;\n highp float alpha = smoothstep(buff - gamma_scaled, buff + gamma_scaled, dist) * fade_alpha;\n\n gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"const float PI = 3.141592653589793;\n\nattribute vec4 a_pos_offset;\nattribute vec4 a_data;\nattribute vec3 a_projected_pos;\n\n// contents of a_size vary based on the type of property value\n// used for {text,icon}-size.\n// For constants, a_size is disabled.\n// For source functions, we bind only one value per vertex: the value of {text,icon}-size evaluated for the current feature.\n// For composite functions:\n// [ text-size(lowerZoomStop, feature),\n// text-size(upperZoomStop, feature) ]\nuniform bool u_is_size_zoom_constant;\nuniform bool u_is_size_feature_constant;\nuniform highp float u_size_t; // used to interpolate between zoom stops when size is a composite function\nuniform highp float u_size; // used when size is both zoom and feature constant\n\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n\nuniform mat4 u_matrix;\nuniform mat4 u_label_plane_matrix;\nuniform mat4 u_gl_coord_matrix;\n\nuniform bool u_is_text;\nuniform bool u_pitch_with_map;\nuniform highp float u_pitch;\nuniform bool u_rotate_symbol;\nuniform highp float u_aspect_ratio;\nuniform highp float u_camera_to_center_distance;\nuniform highp float u_collision_y_stretch;\n\nuniform vec2 u_texsize;\n\nvarying vec4 v_data0;\nvarying vec2 v_data1;\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 fill_color\n #pragma mapbox: initialize highp vec4 halo_color\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize lowp float halo_width\n #pragma mapbox: initialize lowp float halo_blur\n\n vec2 a_pos = a_pos_offset.xy;\n vec2 a_offset = a_pos_offset.zw;\n\n vec2 a_tex = a_data.xy;\n vec2 a_size = a_data.zw;\n\n highp vec2 angle_labelminzoom = unpack_float(a_projected_pos[2]);\n highp float segment_angle = -angle_labelminzoom[0] / 255.0 * 2.0 * PI;\n mediump float a_labelminzoom = angle_labelminzoom[1];\n float size;\n\n if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = mix(a_size[0], a_size[1], u_size_t) / 10.0;\n } else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = a_size[0] / 10.0;\n } else if (!u_is_size_zoom_constant && u_is_size_feature_constant) {\n size = u_size;\n } else {\n size = u_size;\n }\n\n vec4 projectedPoint = u_matrix * vec4(a_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n // If the label is pitched with the map, layout is done in pitched space,\n // which makes labels in the distance smaller relative to viewport space.\n // We counteract part of that effect by multiplying by the perspective ratio.\n // If the label isn't pitched with the map, we do layout in viewport space,\n // which makes labels in the distance larger relative to the features around\n // them. We counteract part of that effect by dividing by the perspective ratio.\n highp float distance_ratio = u_pitch_with_map ?\n camera_to_anchor_distance / u_camera_to_center_distance :\n u_camera_to_center_distance / camera_to_anchor_distance;\n highp float perspective_ratio = 0.5 + 0.5 * distance_ratio;\n\n size *= perspective_ratio;\n\n float fontScale = u_is_text ? size / 24.0 : size;\n\n highp float symbol_rotation = 0.0;\n if (u_rotate_symbol) {\n // Point labels with 'rotation-alignment: map' are horizontal with respect to tile units\n // To figure out that angle in projected space, we draw a short horizontal line in tile\n // space, project it, and measure its angle in projected space.\n vec4 offsetProjectedPoint = u_matrix * vec4(a_pos + vec2(1, 0), 0, 1);\n\n vec2 a = projectedPoint.xy / projectedPoint.w;\n vec2 b = offsetProjectedPoint.xy / offsetProjectedPoint.w;\n\n symbol_rotation = atan((b.y - a.y) / u_aspect_ratio, b.x - a.x);\n }\n\n highp float angle_sin = sin(segment_angle + symbol_rotation);\n highp float angle_cos = cos(segment_angle + symbol_rotation);\n mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);\n\n vec4 projected_pos = u_label_plane_matrix * vec4(a_projected_pos.xy, 0.0, 1.0);\n gl_Position = u_gl_coord_matrix * vec4(projected_pos.xy / projected_pos.w + rotation_matrix * (a_offset / 64.0 * fontScale), 0.0, 1.0);\n float gamma_scale = gl_Position.w;\n\n vec2 tex = a_tex / u_texsize;\n // incidence_stretch is the ratio of how much y space a label takes up on a tile while drawn perpendicular to the viewport vs\n // how much space it would take up if it were drawn flat on the tile\n // Using law of sines, camera_to_anchor/sin(ground_angle) = camera_to_center/sin(incidence_angle)\n // sin(incidence_angle) = 1/incidence_stretch\n // Incidence angle 90 -> head on, sin(incidence_angle) = 1, no incidence stretch\n // Incidence angle 1 -> very oblique, sin(incidence_angle) =~ 0, lots of incidence stretch\n // ground_angle = u_pitch + PI/2 -> sin(ground_angle) = cos(u_pitch)\n // This 2D calculation is only exactly correct when gl_Position.x is in the center of the viewport,\n // but it's a close enough approximation for our purposes\n highp float incidence_stretch = camera_to_anchor_distance / (u_camera_to_center_distance * cos(u_pitch));\n // incidence_stretch only applies to the y-axis, but without re-calculating the collision tile, we can't\n // adjust the size of only one axis. So, we do a crude approximation at placement time to get the aspect ratio\n // about right, and then do the rest of the adjustment here: there will be some extra padding on the x-axis,\n // but hopefully not too much.\n // Never make the adjustment less than 1.0: instead of allowing collisions on the x-axis, be conservative on\n // the y-axis.\n highp float collision_adjustment = max(1.0, incidence_stretch / u_collision_y_stretch);\n\n // Floor to 1/10th zoom to dodge precision issues that can cause partially hidden labels\n highp float collision_perspective_ratio = 1.0 + 0.5*((camera_to_anchor_distance / u_camera_to_center_distance) - 1.0);\n highp float perspective_zoom_adjust = floor(log2(collision_perspective_ratio * collision_adjustment) * 10.0);\n vec2 fade_tex = vec2((a_labelminzoom + perspective_zoom_adjust) / 255.0, 0.0);\n\n v_data0 = vec4(tex.x, tex.y, fade_tex.x, fade_tex.y);\n v_data1 = vec2(gamma_scale, size);\n}\n"}},n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g;for(var o in i)!function(t){var e=i[t],r={};e.fragmentSource=e.fragmentSource.replace(n,function(t,e,i,n,o){return r[o]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+o+"\nvarying "+i+" "+n+" "+o+";\n#else\nuniform "+i+" "+n+" u_"+o+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+o+"\n "+i+" "+n+" "+o+" = u_"+o+";\n#endif\n"}),e.vertexSource=e.vertexSource.replace(n,function(t,e,i,n,o){var a="float"===n?"vec2":"vec4";return r[o]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+o+"\nuniform lowp float a_"+o+"_t;\nattribute "+i+" "+a+" a_"+o+";\nvarying "+i+" "+n+" "+o+";\n#else\nuniform "+i+" "+n+" u_"+o+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+o+" = unpack_mix_"+a+"(a_"+o+", a_"+o+"_t);\n#else\n "+i+" "+n+" "+o+" = u_"+o+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+o+"\nuniform lowp float a_"+o+"_t;\nattribute "+i+" "+a+" a_"+o+";\n#else\nuniform "+i+" "+n+" u_"+o+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+i+" "+n+" "+o+" = unpack_mix_"+a+"(a_"+o+", a_"+o+"_t);\n#else\n "+i+" "+n+" "+o+" = u_"+o+";\n#endif\n"})}(o);e.exports=i},{}],87:[function(t,e,r){"use strict";var i=t("./image_source"),n=t("../util/window"),o=function(t){function e(e,r,i,n){t.call(this,e,r,i,n),this.options=r,this.animate=void 0===r.animate||r.animate}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(){this.canvas=this.canvas||n.document.getElementById(this.options.canvas);var t=this.canvas.getContext(this.options.contextType);if(!t)return this.fire("error",new Error("Canvas context not found."));if(this.context=t,this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions())return this.fire("error",new Error("Canvas dimensions cannot be less than or equal to zero."));var e;this.play=function(){void 0===e&&(e=this.map.style.animationLoop.set(1/0),this.map._rerender())},this.pause=function(){void 0!==e&&(e=this.map.style.animationLoop.cancel(e))},this._finishLoading()},e.prototype.getCanvas=function(){return this.canvas},e.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},e.prototype.onRemove=function(){this.pause()},e.prototype.readCanvas=function(t){var e=this;if(this.context instanceof CanvasRenderingContext2D)this.canvasData=this.context.getImageData(0,0,this.width,this.height);else if(this.context instanceof WebGLRenderingContext){var r=this.context,i=new Uint8Array(this.width*this.height*4);r.readPixels(0,0,this.width,this.height,r.RGBA,r.UNSIGNED_BYTE,i),this.secondaryContext||(this.secondaryContext=n.document.createElement("canvas").getContext("2d")),this.canvasData&&!t||(this.canvasData=this.secondaryContext.createImageData(this.width,this.height));for(var o=this.height-1,a=0;o>=0;o--,a++)e.canvasData.data.set(i.subarray(o*e.width*4,(o+1)*e.width*4),a*e.width*4)}},e.prototype.prepare=function(){var t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){if((this.animate||!this.canvasData||t)&&this.readCanvas(t),!this.canvasData)return void this.fire("error",new Error("Could not read canvas data."));this._prepareImage(this.map.painter.gl,this.canvasData,t)}},e.prototype.serialize=function(){return{type:"canvas",canvas:this.canvas,coordinates:this.coordinates}},e.prototype._hasInvalidDimensions=function(){for(var t=this,e=0,r=[t.canvas.width,t.canvas.height];ethis.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,angle:this.map.transform.angle,pitch:this.map.transform.pitch,cameraToCenterDistance:this.map.transform.cameraToCenterDistance,cameraToTileDistance:this.map.transform.cameraToTileDistance(t),showCollisionBoxes:this.map.showCollisionBoxes};t.workerID=this.dispatcher.send(i,n,function(i,n){if(t.unloadVectorData(),!t.aborted)return i?e(i):(t.loadVectorData(n,r.map.painter),t.redoWhenDone&&(t.redoWhenDone=!1,t.redoPlacement(r)),e(null))},this.workerID)},e.prototype.abortTile=function(t){t.aborted=!0},e.prototype.unloadTile=function(t){t.unloadVectorData(),this.dispatcher.send("removeTile",{uid:t.uid,type:this.type,source:this.id},function(){},t.workerID)},e.prototype.onRemove=function(){this.dispatcher.broadcast("removeSource",{type:this.type,source:this.id},function(){})},e.prototype.serialize=function(){return o.extend({},this._options,{type:this.type,data:this._data})},e}(n);e.exports=c},{"../data/extent":48,"../util/ajax":201,"../util/browser":202,"../util/evented":210,"../util/util":223,"../util/window":204}],89:[function(t,e,r){"use strict";function i(t,e){var r=t.source,i=t.coord;if(!this._geoJSONIndexes[r])return e(null,null);var n=this._geoJSONIndexes[r].getTile(Math.min(i.z,t.maxZoom),i.x,i.y);if(!n)return e(null,null);var o=new a(n.features),l=s(o);0===l.byteOffset&&l.byteLength===l.buffer.byteLength||(l=new Uint8Array(l)),e(null,{vectorTile:o,rawData:l.buffer})}var n=t("../util/ajax"),o=t("geojson-rewind"),a=t("./geojson_wrapper"),s=t("vt-pbf"),l=t("supercluster"),u=t("geojson-vt"),c=t("./vector_tile_worker_source"),p=function(t){function e(e,r,n){t.call(this,e,r,i),n&&(this.loadGeoJSON=n),this._geoJSONIndexes={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.loadData=function(t,e){var r=this;this.loadGeoJSON(t,function(i,n){if(i||!n)return e(i);if("object"!=typeof n)return e(new Error("Input data is not a valid GeoJSON object."));o(n,!0);try{r._geoJSONIndexes[t.source]=t.cluster?l(t.superclusterOptions).load(n.features):u(n,t.geojsonVtOptions)}catch(i){return e(i)}r.loaded[t.source]={},e(null)})},e.prototype.reloadTile=function(e,r){var i=this.loaded[e.source],n=e.uid;return i&&i[n]?t.prototype.reloadTile.call(this,e,r):this.loadTile(e,r)},e.prototype.loadGeoJSON=function(t,e){if(t.request)n.getJSON(t.request,e);else{if("string"!=typeof t.data)return e(new Error("Input data is not a valid GeoJSON object."));try{return e(null,JSON.parse(t.data))}catch(t){return e(new Error("Input data is not a valid GeoJSON object."))}}},e.prototype.removeSource=function(t){this._geoJSONIndexes[t.source]&&delete this._geoJSONIndexes[t.source]},e}(c);e.exports=p},{"../util/ajax":201,"./geojson_wrapper":90,"./vector_tile_worker_source":103,"geojson-rewind":13,"geojson-vt":17,supercluster:32,"vt-pbf":37}],90:[function(t,e,r){"use strict";var i=t("@mapbox/point-geometry"),n=t("@mapbox/vector-tile").VectorTileFeature.prototype.toGeoJSON,o=t("../data/extent"),a=function(t){this._feature=t,this.extent=o,this.type=t.type,this.properties=t.tags,"id"in t&&!isNaN(t.id)&&(this.id=parseInt(t.id,10))};a.prototype.loadGeometry=function(){var t=this;if(1===this._feature.type){for(var e=[],r=0,n=t._feature.geometry;re)){var s=Math.pow(2,Math.min(a.coord.z,i._source.maxzoom)-Math.min(t.z,i._source.maxzoom));if(Math.floor(a.coord.x/s)===t.x&&Math.floor(a.coord.y/s)===t.y)for(r[o]=!0,n=!0;a&&a.coord.z-1>t.z;){var l=a.coord.parent(i._source.maxzoom);if(!l)break;(a=i._tiles[l.id])&&a.hasData()&&(delete r[o],r[l.id]=!0)}}}return n},e.prototype.findLoadedParent=function(t,e,r){for(var i=this,n=t.z-1;n>=e;n--){var o=t.parent(i._source.maxzoom);if(!o)return;t=o;var a=String(t.id),s=i._tiles[a];if(s&&s.hasData())return r[a]=!0,s;if(i._cache.has(a))return r[a]=!0,i._cache.getWithoutRemoving(a)}},e.prototype.updateCacheSize=function(t){var e=Math.ceil(t.width/t.tileSize)+1,r=Math.ceil(t.height/t.tileSize)+1,i=e*r,n=Math.floor(5*i),o="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,n):n;this._cache.setMaxSize(o)},e.prototype.update=function(t){var r=this;if(this.transform=t,this._sourceLoaded&&!this._paused){this.updateCacheSize(t),this._coveredTiles={};var i;this.used?this._source.coord?i=t.getVisibleWrappedCoordinates(this._source.coord):(i=t.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(i=i.filter(function(t){return r._source.hasTile(t)}))):i=[];var n=(this._source.roundZoom?Math.round:Math.floor)(this.getZoom(t)),a=Math.max(n-e.maxOverzooming,this._source.minzoom),s=Math.max(n+e.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(i,n),c={};if(o(this._source.type))for(var p=Object.keys(l),f=0;f=Date.now())){r._findLoadedChildren(m,s,l)&&(l[d]=!0);var y=r.findLoadedParent(m,a,c);y&&r._addTile(y.coord)}}var g;for(g in c)l[g]||(r._coveredTiles[g]=!0);for(g in c)l[g]=!0;for(var _=h.keysDifference(this._tiles,l),x=0;x<_.length;x++)r._removeTile(_[x])}},e.prototype._updateRetainedTiles=function(t,r){var i,n,o,a,s=this,l={},u={},c=Math.max(r-e.maxOverzooming,this._source.minzoom);for(i=0;is._source.maxzoom){var h=n.children(s._source.maxzoom)[0],f=s.getTile(h);f&&f.hasData()?l[h.id]=!0:a=!1}else for(var d=n.children(s._source.maxzoom),m=0;m=c;--g){var _=n.scaledTo(g,s._source.maxzoom);if(u[_.id])break;if(u[_.id]=!0,o=s.getTile(_),!o&&p&&(o=s._addTile(_)),o&&(l[_.id]=!0,p=o.wasRequested(),o.hasData()))break}}}return l},e.prototype._addTile=function(t){var e=this._tiles[t.id];if(e)return e;(e=this._cache.get(t.id))&&(e.redoPlacement(this._source),this._cacheTimers[t.id]&&(clearTimeout(this._cacheTimers[t.id]),delete this._cacheTimers[t.id],this._setTileReloadTimer(t.id,e)));var r=Boolean(e);if(!r){var i=t.z,n=i>this._source.maxzoom?Math.pow(2,i-this._source.maxzoom):1;e=new s(t,this._source.tileSize*n,this._source.maxzoom),this._loadTile(e,this._tileLoaded.bind(this,e,t.id,e.state))}return e?(e.uses++,this._tiles[t.id]=e,r||this._source.fire("dataloading",{tile:e,coord:e.coord,dataType:"source"}),e):null},e.prototype._setTileReloadTimer=function(t,e){var r=this,i=e.getExpiryTimeout();i&&(this._timers[t]=setTimeout(function(){r._reloadTile(t,"expired"),delete r._timers[t]},i))},e.prototype._setCacheInvalidationTimer=function(t,e){var r=this,i=e.getExpiryTimeout();i&&(this._cacheTimers[t]=setTimeout(function(){r._cache.remove(t),delete r._cacheTimers[t]},i))},e.prototype._removeTile=function(t){var e=this._tiles[t];if(e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),!(e.uses>0)))if(e.stopPlacementThrottler(),e.hasData()){var r=e.coord.wrapped().id;this._cache.add(r,e),this._setCacheInvalidationTimer(r,e)}else e.aborted=!0,this._abortTile(e),this._unloadTile(e)},e.prototype.clearTiles=function(){var t=this;this._shouldReloadOnResume=!1,this._paused=!1;for(var e in t._tiles)t._removeTile(e);this._cache.reset()},e.prototype.tilesIn=function(t){for(var e=this,r=[],n=this.getIds(),o=1/0,a=1/0,s=-1/0,l=-1/0,c=t[0].zoom,h=0;h=0&&g[1].y>=0){for(var _=[],x=0;xn)o=!1;else if(e)if(this.expirationTime=i.minX&&t.x=i.minY&&t.ye.row){var r=t;t=e,e=r}return{x0:t.column,y0:t.row,x1:e.column,y1:e.row,dx:e.column-t.column,dy:e.row-t.row}}function n(t,e,r,i,n){var o=Math.max(r,Math.floor(e.y0)),a=Math.min(i,Math.ceil(e.y1));if(t.x0===e.x0&&t.y0===e.y0?t.x0+e.dy/t.dy*t.dx0,p=e.dx<0,h=o;hc.dy&&(l=u,u=c,c=l),u.dy>p.dy&&(l=u,u=p,p=l),c.dy>p.dy&&(l=c,c=p,p=l),u.dy&&n(p,u,o,a,s),c.dy&&n(p,c,o,a,s)}function a(t,e,r){for(var i,n="",o=t;o>0;o--)i=1<t?new u(this.z-1,this.x,this.y,this.w):new u(this.z-1,Math.floor(this.x/2),Math.floor(this.y/2),this.w)},u.prototype.wrapped=function(){return new u(this.z,this.x,this.y,0)},u.prototype.children=function(t){if(this.z>=t)return[new u(this.z+1,this.x,this.y,this.w)];var e=this.z+1,r=2*this.x,i=2*this.y;return[new u(e,r,i,this.w),new u(e,r+1,i,this.w),new u(e,r,i+1,this.w),new u(e,r+1,i+1,this.w)]},u.prototype.scaledTo=function(t,e){return this.z>e?new u(t,this.x,this.y,this.w):t<=this.z?new u(t,this.x>>this.z-t,this.y>>this.z-t,this.w):new u(t,this.x<=0&&n<=a)for(o=t;othis.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,n=a(t.coord.url(this.tiles,this.maxzoom,this.scheme),this.url),o={request:this.map._transformRequest(n,l.Tile),uid:t.uid,coord:t.coord,zoom:t.coord.z,tileSize:this.tileSize*i,type:this.type,source:this.id,pixelRatio:u.devicePixelRatio,overscaling:i,angle:this.map.transform.angle,pitch:this.map.transform.pitch,cameraToCenterDistance:this.map.transform.cameraToCenterDistance,cameraToTileDistance:this.map.transform.cameraToTileDistance(t),showCollisionBoxes:this.map.showCollisionBoxes};t.workerID&&"expired"!==t.state?"loading"===t.state?t.reloadCallback=e:this.dispatcher.send("reloadTile",o,r.bind(this),t.workerID):t.workerID=this.dispatcher.send("loadTile",o,r.bind(this))},e.prototype.abortTile=function(t){this.dispatcher.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0,t.workerID)},e.prototype.unloadTile=function(t){t.unloadVectorData(),this.dispatcher.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0,t.workerID)},e}(i);e.exports=c},{"../util/ajax":201,"../util/browser":202,"../util/evented":210,"../util/mapbox":217,"../util/util":223,"./load_tilejson":92,"./tile_bounds":100}],103:[function(t,e,r){"use strict";function i(t,e){var r=n.getArrayBuffer(t.request,function(t,r){t?e(t):r&&e(null,{vectorTile:new o.VectorTile(new a(r.data)),rawData:r.data,cacheControl:r.cacheControl,expires:r.expires})});return function(){r.abort()}}var n=t("../util/ajax"),o=t("@mapbox/vector-tile"),a=t("pbf"),s=t("./worker_tile"),l=t("../util/util"),u=function(t,e,r){this.actor=t,this.layerIndex=e,this.loadVectorData=r||i,this.loading={},this.loaded={}};u.prototype.loadTile=function(t,e){var r=this,i=t.source,n=t.uid;this.loading[i]||(this.loading[i]={});var o=this.loading[i][n]=new s(t);o.abort=this.loadVectorData(t,function(t,a){if(delete r.loading[i][n],t||!a)return e(t);var s=a.rawData,u={};a.expires&&(u.expires=a.expires),a.cacheControl&&(u.cacheControl=a.cacheControl),o.vectorTile=a.vectorTile,o.parse(a.vectorTile,r.layerIndex,r.actor,function(t,r,i){if(t||!r)return e(t);e(null,l.extend({rawTileData:s},r,u),i)}),r.loaded[i]=r.loaded[i]||{},r.loaded[i][n]=o})},u.prototype.reloadTile=function(t,e){function r(t,r){if(this.reloadCallback){var i=this.reloadCallback;delete this.reloadCallback,this.parse(this.vectorTile,o.layerIndex,o.actor,i)}e(t,r)}var i=this.loaded[t.source],n=t.uid,o=this;if(i&&i[n]){var a=i[n];"parsing"===a.status?a.reloadCallback=e:"done"===a.status&&a.parse(a.vectorTile,this.layerIndex,this.actor,r.bind(a))}},u.prototype.abortTile=function(t){var e=this.loading[t.source],r=t.uid;e&&e[r]&&e[r].abort&&(e[r].abort(),delete e[r])},u.prototype.removeTile=function(t){var e=this.loaded[t.source],r=t.uid;e&&e[r]&&delete e[r]},u.prototype.redoPlacement=function(t,e){var r=this.loaded[t.source],i=this.loading[t.source],n=t.uid;if(r&&r[n]){var o=r[n],a=o.redoPlacement(t.angle,t.pitch,t.cameraToCenterDistance,t.cameraToTileDistance,t.showCollisionBoxes);a.result&&e(null,a.result,a.transferables)}else i&&i[n]&&(i[n].angle=t.angle)},e.exports=u},{"../util/ajax":201,"../util/util":223,"./worker_tile":106,"@mapbox/vector-tile":6,pbf:29}],104:[function(t,e,r){"use strict";var i=t("../util/ajax"),n=t("./image_source"),o=function(t){function e(e,r,i,n){t.call(this,e,r,i,n),this.roundZoom=!0,this.type="video",this.options=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(){var t=this,e=this.options;this.urls=e.urls,i.getVideo(e.urls,function(e,r){if(e)t.fire("error",{error:e});else if(r){t.video=r,t.video.loop=!0;var i;t.video.addEventListener("playing",function(){i=t.map.style.animationLoop.set(1/0),t.map._rerender()}),t.video.addEventListener("pause",function(){t.map.style.animationLoop.cancel(i)}),t.map&&t.video.play(),t._finishLoading()}})},e.prototype.getVideo=function(){return this.video},e.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},e.prototype.prepare=function(){0===Object.keys(this.tiles).length||this.video.readyState<2||this._prepareImage(this.map.painter.gl,this.video)},e.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},e}(n);e.exports=o},{"../util/ajax":201,"./image_source":91}],105:[function(t,e,r){"use strict";var i=t("../util/actor"),n=t("../style/style_layer_index"),o=t("./vector_tile_worker_source"),a=t("./geojson_worker_source"),s=t("./rtl_text_plugin"),l=function(t){var e=this;this.self=t,this.actor=new i(t,this),this.layerIndexes={},this.workerSourceTypes={vector:o,geojson:a},this.workerSources={},this.self.registerWorkerSource=function(t,r){if(e.workerSourceTypes[t])throw new Error('Worker source with name "'+t+'" already registered.');e.workerSourceTypes[t]=r},this.self.registerRTLTextPlugin=function(t){if(s.applyArabicShaping||s.processBidirectionalText)throw new Error("RTL text plugin already registered.");s.applyArabicShaping=t.applyArabicShaping,s.processBidirectionalText=t.processBidirectionalText}};l.prototype.setLayers=function(t,e){this.getLayerIndex(t).replace(e)},l.prototype.updateLayers=function(t,e){this.getLayerIndex(t).update(e.layers,e.removedIds,e.symbolOrder)},l.prototype.loadTile=function(t,e,r){this.getWorkerSource(t,e.type).loadTile(e,r)},l.prototype.reloadTile=function(t,e,r){this.getWorkerSource(t,e.type).reloadTile(e,r)},l.prototype.abortTile=function(t,e){this.getWorkerSource(t,e.type).abortTile(e)},l.prototype.removeTile=function(t,e){this.getWorkerSource(t,e.type).removeTile(e)},l.prototype.removeSource=function(t,e){var r=this.getWorkerSource(t,e.type);void 0!==r.removeSource&&r.removeSource(e)},l.prototype.redoPlacement=function(t,e,r){this.getWorkerSource(t,e.type).redoPlacement(e,r)},l.prototype.loadWorkerSource=function(t,e,r){try{this.self.importScripts(e.url),r()}catch(t){r(t)}},l.prototype.loadRTLTextPlugin=function(t,e,r){try{s.applyArabicShaping||s.processBidirectionalText||(this.self.importScripts(e),s.applyArabicShaping&&s.processBidirectionalText||r(new Error("RTL Text Plugin failed to import scripts from "+e)))}catch(t){r(t)}},l.prototype.getLayerIndex=function(t){var e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new n),e},l.prototype.getWorkerSource=function(t,e){var r=this;if(this.workerSources[t]||(this.workerSources[t]={}),!this.workerSources[t][e]){var i={send:function(e,i,n,o){r.actor.send(e,i,n,o,t)}};this.workerSources[t][e]=new this.workerSourceTypes[e](i,this.getLayerIndex(t))}return this.workerSources[t][e]},e.exports=function(t){return new l(t)}},{"../style/style_layer_index":164,"../util/actor":200,"./geojson_worker_source":89,"./rtl_text_plugin":96,"./vector_tile_worker_source":103}],106:[function(t,e,r){"use strict";function i(t,e){for(var r=0,i=t.layers;r=k.maxzoom||k.layout&&"none"===k.layout.visibility)){for(var M=0,L=E;M=0;I--){var P=y[e.symbolOrder[I]];P&&d.symbolBuckets.push(P)}var R,D,O,B=u.mapObject(g.glyphDependencies,function(t){return Object.keys(t).map(Number)});Object.keys(B).length?r.send("getGlyphs",{uid:this.uid,stacks:B},function(t,e){R||(R=t,D=e,h.call(d))}):D={};var F=Object.keys(g.iconDependencies);F.length?r.send("getImages",{icons:F},function(t,e){R||(R=t,O=e,h.call(d))}):O={},h.call(this)},d.prototype.redoPlacement=function(t,e,r,o,s){var l=this;if(this.angle=t,this.pitch=e,this.cameraToCenterDistance=r,this.cameraToTileDistance=o,"done"!==this.status)return{};for(var u=new a(this.angle,this.pitch,this.cameraToCenterDistance,this.cameraToTileDistance,this.collisionBoxArray),c=0,p=l.symbolBuckets;c0;)r[i]=arguments[i+2];this.message=(t?t+": ":"")+n.apply(n,r),null!==e&&void 0!==e&&e.__line__&&(this.line=e.__line__)}var n=t("util").format;e.exports=i},{util:36}],110:[function(t,e,r){"use strict";function i(t){return new Function("f","var p = (f && f.properties || {}); return "+n(t))}function n(t){if(!t)return"true";var e=t[0];return t.length<=1?"any"===e?"false":"true":"("+("=="===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")+")"}function o(t){return"$type"===t?"f.type":"$id"===t?"f.id":"p["+JSON.stringify(t)+"]"}function a(t,e,r,i){var n=o(t),a="$type"===t?h.indexOf(e):JSON.stringify(e);return(i?"typeof "+n+"=== typeof "+a+"&&":"")+n+r+a}function s(t,e){return t.map(n).join(e)}function l(t,e){"$type"===t&&(e=e.map(function(t){return h.indexOf(t)}));var r=JSON.stringify(e.sort(p)),i=o(t);return e.length<=200?r+".indexOf("+i+") !== -1":"function(v, a, i, j) {while (i <= j) { var m = (i + j) >> 1; if (a[m] === v) return true; if (a[m] > v) j = m - 1; else i = m + 1;}return false; }("+i+", "+r+",0,"+(e.length-1)+")"}function u(t){return"$id"===t?'"id" in f':JSON.stringify(t)+" in p"}function c(t){return"!("+t+")"}function p(t,e){return te?1:0}e.exports=i;var h=["Unknown","Point","LineString","Polygon"]},{}],111:[function(t,e,r){"use strict";function i(t){return t>y?Math.pow(t,1/3):t/v+d}function n(t){return t>m?t*t*t:v*(t-d)}function o(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function a(t){return t/=255,t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function s(t){var e=a(t[0]),r=a(t[1]),n=a(t[2]),o=i((.4124564*e+.3575761*r+.1804375*n)/p),s=i((.2126729*e+.7151522*r+.072175*n)/h);return[116*s-16,500*(o-s),200*(s-i((.0193339*e+.119192*r+.9503041*n)/f)),t[3]]}function l(t){var e=(t[0]+16)/116,r=isNaN(t[1])?e:e+t[1]/500,i=isNaN(t[2])?e:e-t[2]/200;return e=h*n(e),r=p*n(r),i=f*n(i),[o(3.2404542*r-1.5371385*e-.4985314*i),o(-.969266*r+1.8760108*e+.041556*i),o(.0556434*r-.2040259*e+1.0572252*i),t[3]]}function u(t){var e=s(t),r=e[0],i=e[1],n=e[2],o=Math.atan2(n,i)*_;return[o<0?o+360:o,Math.sqrt(i*i+n*n),r,t[3]]}function c(t){var e=t[0]*g,r=t[1];return l([t[2],Math.cos(e)*r,Math.sin(e)*r,t[3]])}var p=.95047,h=1,f=1.08883,d=4/29,m=6/29,v=3*m*m,y=m*m*m,g=Math.PI/180,_=180/Math.PI;e.exports={lab:{forward:s,reverse:l},hcl:{forward:u,reverse:c}}},{}],112:[function(t,e,r){"use strict";function i(t){return t}function n(t,e){var r,c="color"===e.type;if(p(t)){var h=t.stops&&"object"==typeof t.stops[0][0],v=h||void 0!==t.property,y=h||!v,g=t.type||("interpolated"===e.function?"exponential":"interval");c&&(t=m({},t),t.stops&&(t.stops=t.stops.map(function(t){return[t[0],d(t[1])]})),t.default?t.default=d(t.default):t.default=d(e.default));var _,x,b;if("exponential"===g)_=l;else if("interval"===g)_=s;else if("categorical"===g){_=a,x=Object.create(null);for(var w=0,T=t.stops;w=t.stops[i-1][0])return t.stops[i-1][1];var n=c(t.stops,r);return t.stops[n][1]}function l(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==v(r))return o(t.default,e.default);var a=t.stops.length;if(1===a)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[a-1][0])return t.stops[a-1][1];var s=c(t.stops,r),l=h(r,n,t.stops[s][0],t.stops[s+1][0]),u=t.stops[s][1],p=t.stops[s+1][1],f=y[e.type]||i;return"function"==typeof u?function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=u.apply(void 0,t),i=p.apply(void 0,t);if(void 0!==r&&void 0!==i)return f(r,i,l)}:f(u,p,l)}function u(t,e,r){return"color"===e.type?r=d(r):v(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),o(r,t.default,e.default)}function c(t,e){for(var r,i,n=t.length,o=0,a=n-1,s=0;o<=a;){if(s=Math.floor((o+a)/2),r=t[s][0],i=t[s+1][0],e===r||e>r&&ee&&(a=s-1)}return Math.max(s-1,0)}function p(t){return"object"==typeof t&&(t.stops||"identity"===t.type)}function h(t,e,r,i){var n=i-r,o=t-r;return 0===n?0:1===e?o/n:(Math.pow(e,o)-1)/(Math.pow(e,n)-1)}var f=t("./color_spaces"),d=t("../util/parse_color"),m=t("../util/extend"),v=t("../util/get_type"),y=t("../util/interpolate");e.exports=n,e.exports.isFunctionDefinition=p,e.exports.interpolationFactor=h,e.exports.findStopLessThanOrEqualTo=c},{"../util/extend":125,"../util/get_type":126,"../util/interpolate":127,"../util/parse_color":128,"./color_spaces":111}],113:[function(t,e,r){"use strict";function i(t){var e=typeof t;if("number"===e||"boolean"===e||"string"===e||void 0===t||null===t)return JSON.stringify(t);if(Array.isArray(t)){for(var r="[",n=0,o=t;n255?255:t}function n(t){return t<0?0:t>1?1:t}function o(t){return i("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function a(t){return n("%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))}function s(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}function l(t){var e=t.replace(/ /g,"").toLowerCase();if(e in u)return u[e].slice();if("#"===e[0]){if(4===e.length){var r=parseInt(e.substr(1),16);return r>=0&&r<=4095?[(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,1]:null}if(7===e.length){var r=parseInt(e.substr(1),16);return r>=0&&r<=16777215?[(16711680&r)>>16,(65280&r)>>8,255&r,1]:null}return null}var n=e.indexOf("("),l=e.indexOf(")");if(-1!==n&&l+1===e.length){var c=e.substr(0,n),p=e.substr(n+1,l-(n+1)).split(","),h=1;switch(c){case"rgba":if(4!==p.length)return null;h=a(p.pop());case"rgb":return 3!==p.length?null:[o(p[0]),o(p[1]),o(p[2]),h];case"hsla":if(4!==p.length)return null;h=a(p.pop());case"hsl":if(3!==p.length)return null;var f=(parseFloat(p[0])%360+360)%360/360,d=a(p[1]),m=a(p[2]),v=m<=.5?m*(d+1):m+d-m*d,y=2*m-v;return[i(255*s(y,v,f+1/3)),i(255*s(y,v,f)),i(255*s(y,v,f-1/3)),h];default:return null}}return null}var u={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};try{r.parseCSSColor=l}catch(t){}},{}],115:[function(t,e,r){function i(t){return!!t&&"object"==typeof t}function n(t,e){for(var r=-1,i=t.length;++ru))return!1;for(;++l-1&&t%1==0&&t<=c}function l(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function u(t){return!!t&&"object"==typeof t}var c=9007199254740991,p="[object Arguments]",h="[object Function]",f="[object GeneratorFunction]",d=Object.prototype,m=d.hasOwnProperty,v=d.toString,y=d.propertyIsEnumerable;e.exports=i},{}],119:[function(t,e,r){function i(t){return!!t&&"object"==typeof t}function n(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=v}function o(t){return a(t)&&f.call(t)==l}function a(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function s(t){return null!=t&&(o(t)?d.test(p.call(t)):i(t)&&u.test(t))}var l="[object Function]",u=/^\[object .+?Constructor\]$/,c=Object.prototype,p=Function.prototype.toString,h=c.hasOwnProperty,f=c.toString,d=RegExp("^"+p.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),m=function(t,e){var r=null==t?void 0:t[e];return s(r)?r:void 0}(Array,"isArray"),v=9007199254740991,y=m||function(t){return i(t)&&n(t.length)&&"[object Array]"==f.call(t)};e.exports=y},{}],120:[function(t,e,r){function i(t,e,r,i){r="function"==typeof r?o(r,i,3):void 0;var a=r?r(t,e):void 0;return void 0===a?n(t,e,r):!!a}var n=t("lodash._baseisequal"),o=t("lodash._bindcallback");e.exports=i},{"lodash._baseisequal":115,"lodash._bindcallback":116}],121:[function(t,e,r){function i(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=a}function n(t){return!!t&&"object"==typeof t}function o(t){return n(t)&&i(t.length)&&!!s[u.call(t)]}var a=9007199254740991,s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1;var l=Object.prototype,u=l.toString;e.exports=o},{}],122:[function(t,e,r){function i(t){return null!=t&&o(y(t))}function n(t,e){return t="number"==typeof t||h.test(t)?+t:-1,e=null==e?v:e,t>-1&&t%1==0&&t-1&&t%1==0&&t<=v}function a(t){for(var e=l(t),r=e.length,i=r&&t.length,a=!!i&&o(i)&&(p(t)||c(t)),s=-1,u=[];++s0;++i":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:22,value:["number","color"],length:2},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},transition:!1,"zoom-function":!0,"property-function":!1,function:"piecewise-constant"},position:{type:"array",default:[1.15,210,30],length:3,value:"number",transition:!0,function:"interpolated","zoom-function":!0,"property-function":!1},color:{type:"color",default:"#ffffff",function:"interpolated","zoom-function":!0,"property-function":!1,transition:!0},intensity:{type:"number",default:.5,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!1,transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_fill-extrusion","paint_symbol","paint_raster","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!0},"fill-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0},"fill-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"}]},"fill-outline-color":{type:"color",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}]},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels"},"fill-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["fill-translate"]},"fill-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!1,default:1,minimum:0,maximum:1,transition:!0},"fill-extrusion-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-extrusion-pattern"}]},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels"},"fill-extrusion-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"]},"fill-extrusion-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0},"fill-extrusion-height":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:0,minimum:0,units:"meters",transition:!0},"fill-extrusion-base":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:0,minimum:0,maximum:65535,units:"meters",transition:!0,requires:["fill-extrusion-height"]}},paint_line:{"line-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0},"line-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"line-pattern"}]},"line-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels"},"line-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["line-translate"]},"line-width":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-gap-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-offset":{type:"number",default:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-dasharray":{type:"array",value:"number",function:"piecewise-constant","zoom-function":!0,minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}]},"line-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-blur":{type:"number",default:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels"},"circle-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["circle-translate"]},"circle-pitch-scale":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map"},"circle-pitch-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"viewport"},"circle-stroke-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-stroke-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"]},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"]}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-hue-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,transition:!0,units:"degrees"},"raster-brightness-min":{type:"number",function:"interpolated","zoom-function":!0,default:0,minimum:0,maximum:1,transition:!0},"raster-brightness-max":{type:"number",function:"interpolated","zoom-function":!0,default:1,minimum:0,maximum:1,transition:!0},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-fade-duration":{type:"number",default:300,minimum:0,function:"interpolated","zoom-function":!0,transition:!0,units:"milliseconds"}},paint_background:{"background-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,transition:!0,requires:[{"!":"background-pattern"}]},"background-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}}}},{}],125:[function(t,e,r){"use strict";e.exports=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var i=0,n=e;i7)return[new i(c,l,"constants have been deprecated as of v8")];if(!(l in h.constants))return[new i(c,l,'constant "%s" not found',l)];e=o({},e,{value:h.constants[l]})}return u.function&&"object"===n(l)?r(e):u.type&&s[u.type]?s[u.type](e):a(o({},e,{valueSpec:u.type?p[u.type]:u}))}},{"../error/validation_error":109,"../util/extend":125,"../util/get_type":126,"./validate_array":132,"./validate_boolean":133,"./validate_color":134,"./validate_constants":135,"./validate_enum":136,"./validate_filter":137,"./validate_function":138,"./validate_layer":140,"./validate_light":142,"./validate_number":143,"./validate_object":144,"./validate_source":147,"./validate_string":148}],132:[function(t,e,r){"use strict";var i=t("../util/get_type"),n=t("./validate"),o=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.valueSpec,a=t.style,s=t.styleSpec,l=t.key,u=t.arrayElementValidator||n;if("array"!==i(e))return[new o(l,e,"array expected, %s found",i(e))];if(r.length&&e.length!==r.length)return[new o(l,e,"array length %d expected, length %d found",r.length,e.length)];if(r["min-length"]&&e.length7)return r?[new i(e,r,"constants have been deprecated as of v8")]:[];var o=n(r);if("object"!==o)return[new i(e,r,"object expected, %s found",o)];var a=[];for(var s in r)"@"!==s[0]&&a.push(new i(e+"."+s,r[s],'constants must start with "@"'));return a}},{"../error/validation_error":109,"../util/get_type":126}],136:[function(t,e,r){"use strict";var i=t("../error/validation_error"),n=t("../util/unbundle_jsonlint");e.exports=function(t){var e=t.key,r=t.value,o=t.valueSpec,a=[];return Array.isArray(o.values)?-1===o.values.indexOf(n(r))&&a.push(new i(e,r,"expected one of [%s], %s found",o.values.join(", "),r)):-1===Object.keys(o.values).indexOf(n(r))&&a.push(new i(e,r,"expected one of [%s], %s found",Object.keys(o.values).join(", "),r)),a}},{"../error/validation_error":109,"../util/unbundle_jsonlint":130}],137:[function(t,e,r){"use strict";var i=t("../error/validation_error"),n=t("./validate_enum"),o=t("../util/get_type"),a=t("../util/unbundle_jsonlint");e.exports=function t(e){var r,s=e.value,l=e.key,u=e.styleSpec,c=[];if("array"!==o(s))return[new i(l,s,"array expected, %s found",o(s))];if(s.length<1)return[new i(l,s,"filter array must have at least 1 element")];switch(c=c.concat(n({key:l+"[0]",value:s[0],valueSpec:u.filter_operator,style:e.style,styleSpec:e.styleSpec})),a(s[0])){case"<":case"<=":case">":case">=":s.length>=2&&"$type"===a(s[1])&&c.push(new i(l,s,'"$type" cannot be use with operator "%s"',s[0]));case"==":case"!=":3!==s.length&&c.push(new i(l,s,'filter array for operator "%s" must have 3 elements',s[0]));case"in":case"!in":s.length>=2&&"string"!==(r=o(s[1]))&&c.push(new i(l+"[1]",s[1],"string expected, %s found",r));for(var p=2;pu(r[0].zoom))return[new i(s,r[0].zoom,"stop zoom values must appear in ascending order")];u(r[0].zoom)!==d&&(d=u(r[0].zoom),f=void 0,y={}),e=e.concat(a({key:s+"[0]",value:r[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:l,value:c}}))}else e=e.concat(c({key:s+"[0]",value:r[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec}));return e.concat(o({key:s+"[1]",value:r[1],valueSpec:m,style:t.style,styleSpec:t.styleSpec}))}function c(t){var e=n(t.value),r=u(t.value);if(h){if(e!==h)return[new i(t.key,t.value,"%s stop domain type must match previous stop domain type %s",e,h)]}else h=e;if("number"!==e&&"string"!==e&&"boolean"!==e)return[new i(t.key,t.value,"stop domain value must be a number, string, or boolean")];if("number"!==e&&"categorical"!==v){var o="number expected, %s found";return m["property-function"]&&void 0===v&&(o+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new i(t.key,t.value,o,e)]}return"categorical"!==v||"number"!==e||isFinite(r)&&Math.floor(r)===r?"categorical"!==v&&"number"===e&&void 0!==f&&r=8&&(_&&!t.valueSpec["property-function"]?b.push(new i(t.key,t.value,"property functions not supported")):g&&!t.valueSpec["zoom-function"]&&b.push(new i(t.key,t.value,"zoom functions not supported"))),"categorical"!==v&&!x||void 0!==t.value.property||b.push(new i(t.key,t.value,'"property" property is required')),b}},{"../error/validation_error":109,"../util/get_type":126,"../util/unbundle_jsonlint":130,"./validate":131,"./validate_array":132,"./validate_number":143,"./validate_object":144}],139:[function(t,e,r){"use strict";var i=t("../error/validation_error"),n=t("./validate_string");e.exports=function(t){var e=t.value,r=t.key,o=n(t);return o.length?o:(-1===e.indexOf("{fontstack}")&&o.push(new i(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&o.push(new i(r,e,'"glyphs" url must include a "{range}" token')),o)}},{"../error/validation_error":109,"./validate_string":148}],140:[function(t,e,r){"use strict";var i=t("../error/validation_error"),n=t("../util/unbundle_jsonlint"),o=t("./validate_object"),a=t("./validate_filter"),s=t("./validate_paint_property"),l=t("./validate_layout_property"),u=t("../util/extend");e.exports=function(t){var e=[],r=t.value,c=t.key,p=t.style,h=t.styleSpec;r.type||r.ref||e.push(new i(c,r,'either "type" or "ref" is required'));var f=n(r.type),d=n(r.ref);if(r.id)for(var m=n(r.id),v=0;vo.maximum?[new n(e,r,"%s is greater than the maximum value %s",r,o.maximum)]:[]}},{"../error/validation_error":109,"../util/get_type":126}],144:[function(t,e,r){"use strict";var i=t("../error/validation_error"),n=t("../util/get_type"),o=t("./validate");e.exports=function(t){var e=t.key,r=t.value,a=t.valueSpec||{},s=t.objectElementValidators||{},l=t.style,u=t.styleSpec,c=[],p=n(r);if("object"!==p)return[new i(e,r,"object expected, %s found",p)];for(var h in r){var f=h.split(".")[0],d=a[f]||a["*"],m=void 0;if(s[f])m=s[f];else if(a[f])m=o;else if(s["*"])m=s["*"];else{if(!a["*"]){c.push(new i(e,r[h],'unknown property "%s"',h));continue}m=o}c=c.concat(m({key:(e?e+".":e)+h,value:r[h],valueSpec:d,style:l,styleSpec:u,object:r,objectKey:h}))}for(var v in a)a[v].required&&void 0===a[v].default&&void 0===r[v]&&c.push(new i(e,r,'missing required property "%s"',v));return c}},{"../error/validation_error":109,"../util/get_type":126,"./validate":131}],145:[function(t,e,r){"use strict";var i=t("./validate_property");e.exports=function(t){return i(t,"paint")}},{"./validate_property":146}],146:[function(t,e,r){"use strict";var i=t("./validate"),n=t("../error/validation_error"),o=t("../util/get_type");e.exports=function(t,e){var r=t.key,a=t.style,s=t.styleSpec,l=t.value,u=t.objectKey,c=s[e+"_"+t.layerType];if(!c)return[];var p=u.match(/^(.*)-transition$/);if("paint"===e&&p&&c[p[1]]&&c[p[1]].transition)return i({key:r,value:l,valueSpec:s.transition,style:a,styleSpec:s});var h=t.valueSpec||c[u];if(!h)return[new n(r,l,'unknown property "%s"',u)];var f;if("string"===o(l)&&h["property-function"]&&!h.tokens&&(f=/^{([^}]+)}$/.exec(l)))return[new n(r,l,'"%s" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": %s` }`.',u,JSON.stringify(f[1]))];var d=[];return"symbol"===t.layerType&&"text-field"===u&&a&&!a.glyphs&&d.push(new n(r,l,'use of "text-field" requires a style "glyphs" property')),d.concat(i({key:t.key,value:l,valueSpec:h,style:a,styleSpec:s}))}},{"../error/validation_error":109,"../util/get_type":126,"./validate":131}],147:[function(t,e,r){"use strict";var i=t("../error/validation_error"),n=t("../util/unbundle_jsonlint"),o=t("./validate_object"),a=t("./validate_enum");e.exports=function(t){var e=t.value,r=t.key,s=t.styleSpec,l=t.style;if(!e.type)return[new i(r,e,'"type" is required')];var u=n(e.type),c=[];switch(u){case"vector":case"raster":if(c=c.concat(o({key:r,value:e,valueSpec:s.source_tile,style:t.style,styleSpec:s})),"url"in e)for(var p in e)["type","url","tileSize"].indexOf(p)<0&&c.push(new i(r+"."+p,e[p],'a source with a "url" property may not include a "%s" property',p));return c;case"geojson":return o({key:r,value:e,valueSpec:s.source_geojson,style:l,styleSpec:s});case"video":return o({key:r,value:e,valueSpec:s.source_video,style:l,styleSpec:s});case"image":return o({key:r,value:e,valueSpec:s.source_image,style:l,styleSpec:s});case"canvas":return o({key:r,value:e,valueSpec:s.source_canvas,style:l,styleSpec:s});default:return a({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","geojson","video","image","canvas"]},style:l,styleSpec:s})}}},{"../error/validation_error":109,"../util/unbundle_jsonlint":130,"./validate_enum":136,"./validate_object":144}],148:[function(t,e,r){"use strict";var i=t("../util/get_type"),n=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.key,o=i(e);return"string"!==o?[new n(r,e,"string expected, %s found",o)]:[]}},{"../error/validation_error":109,"../util/get_type":126}],149:[function(t,e,r){"use strict";function i(t,e){e=e||l;var r=[];return r=r.concat(s({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:u,"*":function(){return[]}}})),e.$version>7&&t.constants&&(r=r.concat(a({key:"constants",value:t.constants,style:t,styleSpec:e}))),n(r)}function n(t){return[].concat(t).sort(function(t,e){return t.line-e.line})}function o(t){return function(){return n(t.apply(this,arguments))}}var a=t("./validate/validate_constants"),s=t("./validate/validate"),l=t("./reference/latest"),u=t("./validate/validate_glyphs_url");i.source=o(t("./validate/validate_source")),i.light=o(t("./validate/validate_light")),i.layer=o(t("./validate/validate_layer")),i.filter=o(t("./validate/validate_filter")),i.paintProperty=o(t("./validate/validate_paint_property")),i.layoutProperty=o(t("./validate/validate_layout_property")),e.exports=i},{"./reference/latest":123,"./validate/validate":131,"./validate/validate_constants":135,"./validate/validate_filter":137,"./validate/validate_glyphs_url":139,"./validate/validate_layer":140,"./validate/validate_layout_property":141,"./validate/validate_light":142,"./validate/validate_paint_property":145,"./validate/validate_source":147}],150:[function(t,e,r){"use strict";var i=function(){this.n=0,this.times=[]};i.prototype.stopped=function(){return this.times=this.times.filter(function(t){return t.time>=(new Date).getTime()}),!this.times.length},i.prototype.set=function(t){return this.times.push({id:this.n,time:t+(new Date).getTime()}),this.n++},i.prototype.cancel=function(t){this.times=this.times.filter(function(e){return e.id!==t})},e.exports=i},{}],151:[function(t,e,r){"use strict";var i=t("../style-spec/reference/latest"),n=t("../util/util"),o=t("../util/evented"),a=t("./validate_style"),s=t("./style_declaration"),l=t("./style_transition"),u=["anchor","color","position","intensity"],c=i.light,p=function(t){function e(e){t.call(this),this.set(e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){var e=this;if(!this._validate(a.light,t)){this._declarations={},this._transitions={},this._transitionOptions={},this.calculated={},t=n.extend({anchor:c.anchor.default,color:c.color.default,position:c.position.default,intensity:c.intensity.default},t);for(var r=0,i=u;r1?"@2x":"";i.getJSON(e(a(t,p,".json"),i.ResourceType.SpriteJSON),function(t,e){c||(c=t,s=e,o())}),i.getImage(e(a(t,p,".png"),i.ResourceType.SpriteImage),function(t,e){c||(c=t,u=e,o())})}},{"../util/ajax":201,"../util/browser":202,"../util/image":213,"../util/mapbox":217}],154:[function(t,e,r){"use strict";function i(t,e,r){1===t&&r.readMessage(n,e)}function n(t,e,r){if(3===t){var i=r.readMessage(o,{}),n=i.id,a=i.bitmap,l=i.width,c=i.height,p=i.left,h=i.top,f=i.advance;e.push({id:n,bitmap:s.create({width:l+2*u,height:c+2*u},a),metrics:{width:l,height:c,left:p,top:h,advance:f}})}}function o(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint())}var a=t("../util/image"),s=a.AlphaImage,l=t("pbf"),u=3;e.exports=function(t){return new l(t).readFields(i,[])},e.exports.GLYPH_PBF_BORDER=u},{"../util/image":213,pbf:29}],155:[function(t,e,r){"use strict";function i(t,e,r){return e.isPaintValueFeatureConstant(t)?e.paint[t]:r.programConfigurations.get(e.id).paintPropertyStatistics[t].max}function n(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function o(t,e,r,i,n){if(!e[0]&&!e[1])return t;var o=a.convert(e);"viewport"===r&&o._rotate(-i);for(var s=[],l=0;lMath.floor(t)&&(e.lastIntegerZoom=Math.floor(t+1),e.lastIntegerZoomTime=Date.now()),e.lastZoom=t},e.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},e.prototype.update=function(t,e){var r=this;if(this._changed){var i=Object.keys(this._updatedLayers),n=Object.keys(this._removedLayers);(i.length||n.length||this._updatedSymbolOrder)&&this._updateWorkerLayers(i,n);for(var o in r._updatedSources){var a=r._updatedSources[o];"reload"===a?r._reloadSource(o):"clear"===a&&r._clearSource(o)}this._applyClasses(t,e),this._resetUpdates(),this.fire("data",{dataType:"style"})}},e.prototype._updateWorkerLayers=function(t,e){var r=this,i=this._updatedSymbolOrder?this._order.filter(function(t){return"symbol"===r._layers[t].type}):null;this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(t),removedIds:e,symbolOrder:i})},e.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSymbolOrder=!1,this._updatedSources={},this._updatedPaintProps={},this._updatedAllPaintProps=!1},e.prototype.setState=function(t){var e=this;if(this._checkLoaded(),v.emitErrors(this,v(t)))return!1;t=c.clone(t),t.layers=S(t.layers);var r=z(this.serialize(),t).filter(function(t){return!(t.command in E)});if(0===r.length)return!1;var i=r.filter(function(t){return!(t.command in C)});if(i.length>0)throw new Error("Unimplemented: "+i.map(function(t){return t.command}).join(", ")+".");return r.forEach(function(t){"setTransition"!==t.command&&e[t.command].apply(e,t.args)}),this.stylesheet=t,!0},e.prototype.addImage=function(t,e){if(this.imageManager.getImage(t))return this.fire("error",{error:new Error("An image with this name already exists.")});this.imageManager.addImage(t,e),this.fire("data",{dataType:"style"})},e.prototype.removeImage=function(t){if(!this.imageManager.getImage(t))return this.fire("error",{error:new Error("No image with this name exists.")});this.imageManager.removeImage(t),this.fire("data",{dataType:"style"})},e.prototype.addSource=function(t,e,r){var i=this;if(this._checkLoaded(),void 0!==this.sourceCaches[t])throw new Error("There is already a source with this ID");if(!e.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(e).join(", ")+".");if(!(["vector","raster","geojson","video","image","canvas"].indexOf(e.type)>=0&&this._validate(v.source,"sources."+t,e,null,r))){var n=this.sourceCaches[t]=new x(t,e,this.dispatcher);n.style=this,n.setEventedParent(this,function(){return{isSourceLoaded:i.loaded(),source:n.serialize(),sourceId:t}}),n.onAdd(this.map),this._changed=!0}},e.prototype.removeSource=function(t){if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error("There is no source with this ID");var e=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],e.fire("data",{sourceDataType:"metadata",dataType:"source",sourceId:t}),e.setEventedParent(null),e.clearTiles(),e.onRemove&&e.onRemove(this.map),this._changed=!0},e.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},e.prototype.addLayer=function(t,e,r){this._checkLoaded();var i=t.id;if("object"==typeof t.source&&(this.addSource(i,t.source),t=c.clone(t),t=c.extend(t,{source:i})),!this._validate(v.layer,"layers."+i,t,{arrayIndex:-1},r)){var o=n.create(t);this._validateLayer(o),o.setEventedParent(this,{layer:{id:i}});var a=e?this._order.indexOf(e):this._order.length;if(this._order.splice(a,0,i),this._layers[i]=o,this._removedLayers[i]&&o.source){var s=this._removedLayers[i];delete this._removedLayers[i],s.type!==o.type?this._updatedSources[o.source]="clear":(this._updatedSources[o.source]="reload",this.sourceCaches[o.source].pause())}this._updateLayer(o),"symbol"===o.type&&(this._updatedSymbolOrder=!0),this.updateClasses(i)}},e.prototype.moveLayer=function(t,e){this._checkLoaded(),this._changed=!0;var r=this._layers[t];if(!r)return void this.fire("error",{error:new Error("The layer '"+t+"' does not exist in the map's style and cannot be moved.")});var i=this._order.indexOf(t);this._order.splice(i,1);var n=e?this._order.indexOf(e):this._order.length;this._order.splice(n,0,t),"symbol"===r.type&&(this._updatedSymbolOrder=!0,r.source&&!this._updatedSources[r.source]&&(this._updatedSources[r.source]="reload",this.sourceCaches[r.source].pause()))},e.prototype.removeLayer=function(t){this._checkLoaded();var e=this._layers[t];if(!e)return void this.fire("error",{error:new Error("The layer '"+t+"' does not exist in the map's style and cannot be removed.")});e.setEventedParent(null);var r=this._order.indexOf(t);this._order.splice(r,1),"symbol"===e.type&&(this._updatedSymbolOrder=!0),this._changed=!0,this._removedLayers[t]=e,delete this._layers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t]},e.prototype.getLayer=function(t){return this._layers[t]},e.prototype.setLayerZoomRange=function(t,e,r){this._checkLoaded();var i=this.getLayer(t);if(!i)return void this.fire("error",{error:new Error("The layer '"+t+"' does not exist in the map's style and cannot have zoom extent.")});i.minzoom===e&&i.maxzoom===r||(null!=e&&(i.minzoom=e),null!=r&&(i.maxzoom=r),this._updateLayer(i))},e.prototype.setFilter=function(t,e){this._checkLoaded();var r=this.getLayer(t);if(!r)return void this.fire("error",{error:new Error("The layer '"+t+"' does not exist in the map's style and cannot be filtered.")});null!==e&&void 0!==e&&this._validate(v.filter,"layers."+r.id+".filter",e)||c.deepEqual(r.filter,e)||(r.filter=c.clone(e),this._updateLayer(r))},e.prototype.getFilter=function(t){return c.clone(this.getLayer(t).filter)},e.prototype.setLayoutProperty=function(t,e,r){this._checkLoaded();var i=this.getLayer(t);if(!i)return void this.fire("error",{error:new Error("The layer '"+t+"' does not exist in the map's style and cannot be styled.")});c.deepEqual(i.getLayoutProperty(e),r)||(i.setLayoutProperty(e,r),this._updateLayer(i))},e.prototype.getLayoutProperty=function(t,e){return this.getLayer(t).getLayoutProperty(e)},e.prototype.setPaintProperty=function(t,e,r,i){this._checkLoaded();var n=this.getLayer(t);if(!n)return void this.fire("error",{error:new Error("The layer '"+t+"' does not exist in the map's style and cannot be styled.")});if(!c.deepEqual(n.getPaintProperty(e,i),r)){var o=n.isPaintValueFeatureConstant(e);n.setPaintProperty(e,r,i),!(r&&w.isFunctionDefinition(r)&&"$zoom"!==r.property&&void 0!==r.property)&&o||this._updateLayer(n),this.updateClasses(t,e)}},e.prototype.getPaintProperty=function(t,e,r){return this.getLayer(t).getPaintProperty(e,r)},e.prototype.getTransition=function(){return c.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},e.prototype.updateClasses=function(t,e){if(this._changed=!0,t){var r=this._updatedPaintProps;r[t]||(r[t]={}),r[t][e||"all"]=!0}else this._updatedAllPaintProps=!0},e.prototype.serialize=function(){var t=this;return c.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:c.mapObject(this.sourceCaches,function(t){return t.serialize()}),layers:this._order.map(function(e){return t._layers[e].serialize()})},function(t){return void 0!==t})},e.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},e.prototype._flattenRenderedFeatures=function(t){for(var e=this,r=[],i=this._order.length-1;i>=0;i--)for(var n=e._order[i],o=0,a=t;o=this.maxzoom)||"none"===this.layout.visibility},e.prototype.updatePaintTransitions=function(t,e,r,i,o){for(var a=this,s=n.extend({},this._paintDeclarations[""]),l=0;l0?e+2*t:t}function n(t,e){for(var r=[],i=new o(0,0),n=0;n=this.endTime)return i;var o=this.oldTransition.calculate(t,e,this.startTime),a=n.easeCubicInOut((r-this.startTime-this.delay)/this.duration);return this.interp(o,i,a)},s.prototype._calculateTargetValue=function(t,e){if(!this.zoomTransitioned)return this.declaration.calculate(t,e);var r=t.zoom,i=this.zoomHistory.lastIntegerZoom,n=r>i?2:.5,a=this.declaration.calculate({zoom:r>i?r-1:r+1},e),s=this.declaration.calculate({zoom:r},e),l=Math.min((Date.now()-this.zoomHistory.lastIntegerZoomTime)/this.duration,1),u=Math.abs(r-i),c=o(l,1,u);return void 0!==a&&void 0!==s?{from:a,fromScale:n,to:s,toScale:1,t:c}:void 0},e.exports=s},{"../style-spec/util/interpolate":127,"../util/util":223}],166:[function(t,e,r){"use strict";e.exports=t("../style-spec/validate_style.min"),e.exports.emitErrors=function(t,e){if(e&&e.length){for(var r=0,i=e;r-r/2;){if(--a<0)return!1;s-=t[a].dist(o),o=t[a]}s+=t[a].dist(t[a+1]),a++;for(var l=[],u=0;si;)u-=l.shift().angleDelta;if(u>n)return!1;a++,s+=p.dist(h)}return!0}e.exports=i},{}],169:[function(t,e,r){"use strict";function i(t,e,r,i,o){for(var a=[],s=0;s=i&&h.x>=i||(p.x>=i?p=new n(i,p.y+(h.y-p.y)*((i-p.x)/(h.x-p.x)))._round():h.x>=i&&(h=new n(i,p.y+(h.y-p.y)*((i-p.x)/(h.x-p.x)))._round()),p.y>=o&&h.y>=o||(p.y>=o?p=new n(p.x+(h.x-p.x)*((o-p.y)/(h.y-p.y)),o)._round():h.y>=o&&(h=new n(p.x+(h.x-p.x)*((o-p.y)/(h.y-p.y)),o)._round()),u&&p.equals(u[u.length-1])||(u=[p],a.push(u)),u.push(h)))))}return a}var n=t("@mapbox/point-geometry");e.exports=i},{"@mapbox/point-geometry":2}],170:[function(t,e,r){"use strict";var i=t("../util/struct_array"),n=t("@mapbox/point-geometry"),o=i({members:[{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"offsetX"},{type:"Int16",name:"offsetY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Float32",name:"unadjustedMaxScale"},{type:"Float32",name:"maxScale"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"},{type:"Int16",name:"bbox0"},{type:"Int16",name:"bbox1"},{type:"Int16",name:"bbox2"},{type:"Int16",name:"bbox3"},{type:"Float32",name:"placementScale"}]});Object.defineProperty(o.prototype.StructType.prototype,"anchorPoint",{get:function(){return new n(this.anchorPointX,this.anchorPointY)}}),e.exports=o},{"../util/struct_array":220,"@mapbox/point-geometry":2}],171:[function(t,e,r){"use strict";var i=function(t,e,r,i,n,o,a,s,l,u,c){var p=a.top*s-l,h=a.bottom*s+l,f=a.left*s-l,d=a.right*s+l;if(this.boxStartIndex=t.length,u){var m=h-p,v=d-f;if(m>0)if(m=Math.max(10*s,m),c){var y=e[r.segment+1].sub(e[r.segment])._unit()._mult(v),g=[r.sub(y),r.add(y)];this._addLineCollisionBoxes(t,g,r,0,v,m,i,n,o)}else this._addLineCollisionBoxes(t,e,r,r.segment,v,m,i,n,o)}else t.emplaceBack(r.x,r.y,0,0,f,p,d,h,1/0,1/0,i,n,o,0,0,0,0,0);this.boxEndIndex=t.length};i.prototype._addLineCollisionBoxes=function(t,e,r,i,n,o,a,s,l){var u=o/2,c=Math.floor(n/u),p=Math.floor(c/2),h=-o/2,f=r,d=i+1,m=h,v=-n/2,y=v-n/8;do{if(--d<0){if(m>v)return;d=0;break}m-=e[d].dist(f),f=e[d]}while(m>y);for(var g=e[d].dist(e[d+1]),_=-p;_n&&(b+=x-n),!(b=e.length)return;g=e[d].dist(e[d+1])}var w=b-m,T=e[d],S=e[d+1],z=S.sub(T)._unit()._mult(w)._add(T)._round(),A=Math.max(Math.abs(b-h)-u/2,0),C=n/2/A;(_<0||_>=c)&&(C=Math.min(C,.99)),t.emplaceBack(z.x,z.y,z.x-r.x,z.y-r.y,-o/2,-o/2,o/2,o/2,C,C,a,s,l,0,0,0,0,0)}}},e.exports=i},{}],172:[function(t,e,r){"use strict";var i=t("@mapbox/point-geometry"),n=t("../data/extent"),o=t("grid-index"),a=t("../util/intersection_tests"),s=function(t,e,r,i,a,s,l){void 0===s&&(s=new o(n,12,6)),void 0===l&&(l=new o(n,12,0)),this.angle=t,this.pitch=e,this.cameraToCenterDistance=r,this.cameraToTileDistance=i,this.grid=s,this.ignoredGrid=l,this.perspectiveRatio=1+.5*(i/r-1),this.minScale=.5/this.perspectiveRatio,this.maxScale=2/this.perspectiveRatio;var u=Math.sin(this.angle),c=Math.cos(this.angle);this.rotationMatrix=[c,-u,u,c],this.reverseRotationMatrix=[c,u,-u,c],this.yStretch=Math.max(1,i/(r*Math.cos(e/180*Math.PI))),this.collisionBoxArray=a,0===a.length&&(a.emplaceBack(),a.emplaceBack(0,0,0,0,0,-n,0,n,1/0,1/0,0,0,0,0,0,0,0,0,0),a.emplaceBack(n,0,0,0,0,-n,0,n,1/0,1/0,0,0,0,0,0,0,0,0,0),a.emplaceBack(0,0,0,0,-n,0,n,0,1/0,1/0,0,0,0,0,0,0,0,0,0),a.emplaceBack(0,n,0,0,-n,0,n,0,1/0,1/0,0,0,0,0,0,0,0,0,0)),this.tempCollisionBox=a.get(0),this.edges=[a.get(1),a.get(2),a.get(3),a.get(4)]};s.deserialize=function(t,e){return new s(t.angle,t.pitch,t.cameraToCenterDistance,t.cameraToTileDistance,e,new o(t.grid),new o(t.ignoredGrid))},s.prototype.serialize=function(t){var e=this.grid.toArrayBuffer(),r=this.ignoredGrid.toArrayBuffer();return t&&(t.push(e),t.push(r)),{angle:this.angle,pitch:this.pitch,cameraToCenterDistance:this.cameraToCenterDistance,cameraToTileDistance:this.cameraToTileDistance,grid:e,ignoredGrid:r}},s.prototype.placeCollisionFeature=function(t,e,r){for(var n=this,o=this.collisionBoxArray,a=this.minScale,s=this.rotationMatrix,l=this.yStretch,u=t.boxStartIndex;u=n.maxScale)return a}if(r){var C=void 0;if(n.angle){var E=n.reverseRotationMatrix,k=new i(c.x1,c.y1).matMult(E),M=new i(c.x2,c.y1).matMult(E),L=new i(c.x1,c.y2).matMult(E),I=new i(c.x2,c.y2).matMult(E);C=n.tempCollisionBox,C.anchorPointX=c.anchorPoint.x,C.anchorPointY=c.anchorPoint.y,C.x1=Math.min(k.x,M.x,L.x,I.x),C.y1=Math.min(k.y,M.x,L.x,I.x),C.x2=Math.max(k.x,M.x,L.x,I.x),C.y2=Math.max(k.y,M.x,L.x,I.x),C.maxScale=c.maxScale}else C=c;for(var P=0;P=n.maxScale)return a}}}return a},s.prototype.queryRenderedSymbols=function(t,e){var r={},n=[];if(0===t.length||0===this.grid.keys.length&&0===this.ignoredGrid.keys.length)return n;for(var o=this.collisionBoxArray,s=this.rotationMatrix,l=this.yStretch,u=[],c=1/0,p=1/0,h=-1/0,f=-1/0,d=0;dS.maxScale)){var C=S.anchorPoint.matMult(s),E=C.x+S.x1/b,k=C.y+S.y1/b*l,M=C.x+S.x2/b,L=C.y+S.y2/b*l,I=[new i(E,k),new i(M,k),new i(M,L),new i(E,L)];a.polygonIntersectsPolygon(u,I)&&(r[z][A]=!0,n.push(g[T]))}}return n},s.prototype.getPlacementScale=function(t,e,r,i,n){var o=e.x-i.x,a=e.y-i.y,s=(n.x1-r.x2)/o,l=(n.x2-r.x1)/o,u=(n.y1-r.y2)*this.yStretch/a,c=(n.y2-r.y1)*this.yStretch/a;(isNaN(s)||isNaN(l))&&(s=l=1),(isNaN(u)||isNaN(c))&&(u=c=1);var p=Math.min(Math.max(s,l),Math.max(u,c)),h=n.maxScale,f=r.maxScale;return p>h&&(p=h),p>f&&(p=f),p>t&&p>=n.placementScale&&(t=p),t},s.prototype.insertCollisionFeature=function(t,e,r){for(var i=this,n=r?this.ignoredGrid:this.grid,o=this.collisionBoxArray,a=t.boxStartIndex;a=1)&&n.insert(a,s.bbox0,s.bbox1,s.bbox2,s.bbox3)}},e.exports=s},{"../data/extent":48,"../util/intersection_tests":214,"@mapbox/point-geometry":2,"grid-index":22}],173:[function(t,e,r){"use strict";function i(t,e,r,i,o,a,s,l,u){var c=i?.6*a*s:0,p=Math.max(i?i.right-i.left:0,o?o.right-o.left:0),h=0===t[0].x||t[0].x===u||0===t[0].y||t[0].y===u;e-p*s=0&&z=0&&A=0&&y+f<=d){var C=new a(z,A,T,_);C._round(),i&&!s(t,C,u,i,l)||g.push(C)}}v+=w}return p||g.length||c||(g=n(t,v/2,r,i,l,u,c,!0,h)),g}var o=t("../style-spec/util/interpolate"),a=t("../symbol/anchor"),s=t("./check_max_angle");e.exports=i},{"../style-spec/util/interpolate":127,"../symbol/anchor":167,"./check_max_angle":168}],174:[function(t,e,r){"use strict";e.exports=function(t){function e(e){s.push(t[e]),l++}function r(t,e,r){var i=a[t];return delete a[t],a[e]=i,s[i].geometry[0].pop(),s[i].geometry[0]=s[i].geometry[0].concat(r[0]),i}function i(t,e,r){var i=o[e];return delete o[e],o[t]=i,s[i].geometry[0].shift(),s[i].geometry[0]=r[0].concat(s[i].geometry[0]),i}function n(t,e,r){var i=r?e[0][e[0].length-1]:e[0][0];return t+":"+i.x+":"+i.y}for(var o={},a={},s=[],l=0,u=0;u=-r[0]&&n<=r[0]&&o>=-r[1]&&o<=r[1]&&i.frameHistory.isVisible(e)}function s(t,e,r,i,n,s,u,c,f,d){var y=i?t.textSizeData:t.iconSizeData,g=v.evaluateSizeForZoom(y,r.transform,d,i),_=[256/r.width*2+1,256/r.height*2+1],x=i?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;x.clear();for(var b=t.lineVertexArray,w=i?t.placedGlyphArray:t.placedIconArray,T=0;T1){var w=t.glyphStartIndex+t.numGlyphs,T=l.get(t.glyphStartIndex).offsetX,S=l.get(w-1).offsetX,z=t.lineStartIndex,A=t.lineStartIndex+t.lineLength,C=c(_*T,x,b,r,d,m,t.segment,z,A,p,a,v);if(!C)return{notEnoughRoom:!0};var E=c(_*S,x,b,r,d,m,t.segment,z,A,p,a,v);if(!E)return{notEnoughRoom:!0};var k=o(C.point,s).point,M=o(E.point,s).point;if(i&&!r&&(t.vertical?k.yM.x))return{needsFlipping:!0};y=[C];for(var L=t.glyphStartIndex+1;L0?D.point:u(m,new h(R.x,R.y),P,1,n);if(t.vertical?O.y>P.y:O.x0?1:-1,y=0;i&&(v*=-1,y=Math.PI),v<0&&(y+=Math.PI);for(var g=v>0?l+s:l+s+1,_=n,x=n,b=0,w=0,T=Math.abs(m);b+w<=T;){if((g+=v)=c)return null;if(x=_,void 0===(_=d[g])){var S=o(p.get(g),f);_=S.signedDistanceFromCamera>0?d[g]=S.point:u(0===b?a:new h(p.get(g-v).x,p.get(g-v).y),new h(p.get(g).x,p.get(g).y),x,T-b+1,f)}b+=w,w=x.dist(_)}var z=(T-b)/w,A=_.sub(x),C=A.mult(z)._add(x);return C._add(A._unit()._perp()._mult(r*v)),{point:C,angle:y+Math.atan2(_.y-x.y,_.x-x.x)}}function p(t,e){for(var r=0;r1||(T?(clearTimeout(T),T=null,y("dblclick",e)):T=setTimeout(f,300))}function c(t){g("touchmove",t)}function p(t){g("touchend",t)}function h(t){g("touchcancel",t)}function f(){T=null}function d(t){i.mousePos(_,t).equals(w)&&y("click",t)}function m(t){y("dblclick",t),t.preventDefault()}function v(e){var r=t.dragRotate&&t.dragRotate.isActive();b||r?b&&(x=e):y("contextmenu",e),e.preventDefault()}function y(e,r){var n=i.mousePos(_,r);return t.fire(e,{lngLat:t.unproject(n),point:n,originalEvent:r})}function g(e,r){var o=i.touchPos(_,r),a=o.reduce(function(t,e,r,i){return t.add(e.div(i.length))},new n(0,0));return t.fire(e,{lngLat:t.unproject(a),point:a,lngLats:o.map(function(e){return t.unproject(e)},this),points:o,originalEvent:r})}var _=t.getCanvasContainer(),x=null,b=!1,w=null,T=null;for(var S in o)t[S]=new o[S](t,e),e.interactive&&e[S]&&t[S].enable(e[S]);_.addEventListener("mouseout",r,!1),_.addEventListener("mousedown",a,!1),_.addEventListener("mouseup",s,!1),_.addEventListener("mousemove",l,!1),_.addEventListener("touchstart",u,!1),_.addEventListener("touchend",p,!1),_.addEventListener("touchmove",c,!1),_.addEventListener("touchcancel",h,!1),_.addEventListener("click",d,!1),_.addEventListener("dblclick",m,!1),_.addEventListener("contextmenu",v,!1)}},{"../util/dom":209,"./handler/box_zoom":189,"./handler/dblclick_zoom":190,"./handler/drag_pan":191,"./handler/drag_rotate":192,"./handler/keyboard":193,"./handler/scroll_zoom":194,"./handler/touch_zoom_rotate":195,"@mapbox/point-geometry":2}],181:[function(t,e,r){"use strict";var i=t("../util/util"),n=t("../style-spec/util/interpolate"),o=t("../util/browser"),a=t("../geo/lng_lat"),s=t("../geo/lng_lat_bounds"),l=t("@mapbox/point-geometry"),u=t("../util/evented"),c=function(t){function e(e,r){t.call(this),this.moving=!1,this.transform=e,this._bearingSnap=r.bearingSnap}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCenter=function(){return this.transform.center},e.prototype.setCenter=function(t,e){return this.jumpTo({center:t},e)},e.prototype.panBy=function(t,e,r){return t=l.convert(t).mult(-1),this.panTo(this.transform.center,i.extend({offset:t},e),r)},e.prototype.panTo=function(t,e,r){return this.easeTo(i.extend({center:t},e),r)},e.prototype.getZoom=function(){return this.transform.zoom},e.prototype.setZoom=function(t,e){return this.jumpTo({zoom:t},e),this},e.prototype.zoomTo=function(t,e,r){return this.easeTo(i.extend({zoom:t},e),r)},e.prototype.zoomIn=function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},e.prototype.zoomOut=function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},e.prototype.getBearing=function(){return this.transform.bearing},e.prototype.setBearing=function(t,e){return this.jumpTo({bearing:t},e),this},e.prototype.rotateTo=function(t,e,r){return this.easeTo(i.extend({bearing:t},e),r)},e.prototype.resetNorth=function(t,e){return this.rotateTo(0,i.extend({duration:1e3},t),e),this},e.prototype.snapToNorth=function(t,e){return Math.abs(this.getBearing())e?1:0}),["bottom","left","right","top"]))return i.warnOnce("options.padding must be a positive number, or an Object with keys 'bottom', 'left', 'right', 'top'"),this;t=s.convert(t);var o=[e.padding.left-e.padding.right,e.padding.top-e.padding.bottom],a=Math.min(e.padding.right,e.padding.left),u=Math.min(e.padding.top,e.padding.bottom);e.offset=[e.offset[0]+o[0],e.offset[1]+o[1]];var c=l.convert(e.offset),p=this.transform,h=p.project(t.getNorthWest()),f=p.project(t.getSouthEast()),d=f.sub(h),m=(p.width-2*a-2*Math.abs(c.x))/d.x,v=(p.height-2*u-2*Math.abs(c.y))/d.y;return v<0||m<0?(i.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset."),this):(e.center=p.unproject(h.add(f).div(2)),e.zoom=Math.min(p.scaleZoom(p.scale*Math.min(m,v)),e.maxZoom),e.bearing=0,e.linear?this.easeTo(e,r):this.flyTo(e,r))},e.prototype.jumpTo=function(t,e){this.stop();var r=this.transform,i=!1,n=!1,o=!1;return"zoom"in t&&r.zoom!==+t.zoom&&(i=!0,r.zoom=+t.zoom),void 0!==t.center&&(r.center=a.convert(t.center)),"bearing"in t&&r.bearing!==+t.bearing&&(n=!0,r.bearing=+t.bearing),"pitch"in t&&r.pitch!==+t.pitch&&(o=!0,r.pitch=+t.pitch),this.fire("movestart",e).fire("move",e),i&&this.fire("zoomstart",e).fire("zoom",e).fire("zoomend",e),n&&this.fire("rotate",e),o&&this.fire("pitchstart",e).fire("pitch",e).fire("pitchend",e),this.fire("moveend",e)},e.prototype.easeTo=function(t,e){var r=this;this.stop(),t=i.extend({offset:[0,0],duration:500,easing:i.ease},t),!1===t.animate&&(t.duration=0),t.smoothEasing&&0!==t.duration&&(t.easing=this._smoothOutEasing(t.duration));var o=this.transform,s=this.getZoom(),u=this.getBearing(),c=this.getPitch(),p="zoom"in t?+t.zoom:s,h="bearing"in t?this._normalizeBearing(t.bearing,u):u,f="pitch"in t?+t.pitch:c,d=o.centerPoint.add(l.convert(t.offset)),m=o.pointLocation(d),v=a.convert(t.center||m);this._normalizeCenter(v);var y,g,_=o.project(m),x=o.project(v).sub(_),b=o.zoomScale(p-s);return t.around&&(y=a.convert(t.around),g=o.locationPoint(y)),this.zooming=p!==s,this.rotating=u!==h,this.pitching=f!==c,this._prepareEase(e,t.noMoveStart),clearTimeout(this._onEaseEnd),this._ease(function(t){if(this.zooming&&(o.zoom=n(s,p,t)),this.rotating&&(o.bearing=n(u,h,t)),this.pitching&&(o.pitch=n(c,f,t)),y)o.setLocationAtPoint(y,g);else{var r=o.zoomScale(o.zoom-s),i=p>s?Math.min(2,b):Math.max(.5,b),a=Math.pow(i,1-t),l=o.unproject(_.add(x.mult(t*a)).mult(r));o.setLocationAtPoint(o.renderWorldCopies?l.wrap():l,d)}this._fireMoveEvents(e)},function(){t.delayEndEvents?r._onEaseEnd=setTimeout(function(){return r._easeToEnd(e)},t.delayEndEvents):r._easeToEnd(e)},t),this},e.prototype._prepareEase=function(t,e){this.moving=!0,e||this.fire("movestart",t),this.zooming&&this.fire("zoomstart",t),this.pitching&&this.fire("pitchstart",t)},e.prototype._fireMoveEvents=function(t){this.fire("move",t),this.zooming&&this.fire("zoom",t),this.rotating&&this.fire("rotate",t),this.pitching&&this.fire("pitch",t)},e.prototype._easeToEnd=function(t){var e=this.zooming,r=this.pitching;this.moving=!1,this.zooming=!1,this.rotating=!1,this.pitching=!1,e&&this.fire("zoomend",t),r&&this.fire("pitchend",t),this.fire("moveend",t)},e.prototype.flyTo=function(t,e){function r(t){var e=(A*A-z*z+(t?-1:1)*M*M*C*C)/(2*(t?A:z)*M*C);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)}var c=this;this.stop(),t=i.extend({offset:[0,0],speed:1.2,curve:1.42,easing:i.ease},t);var p=this.transform,h=this.getZoom(),f=this.getBearing(),d=this.getPitch(),m="zoom"in t?i.clamp(+t.zoom,p.minZoom,p.maxZoom):h,v="bearing"in t?this._normalizeBearing(t.bearing,f):f,y="pitch"in t?+t.pitch:d,g=p.zoomScale(m-h),_=p.centerPoint.add(l.convert(t.offset)),x=p.pointLocation(_),b=a.convert(t.center||x);this._normalizeCenter(b);var w=p.project(x),T=p.project(b).sub(w),S=t.curve,z=Math.max(p.width,p.height),A=z/g,C=T.mag();if("minZoom"in t){var E=i.clamp(Math.min(t.minZoom,h,m),p.minZoom,p.maxZoom),k=z/p.zoomScale(E-h);S=Math.sqrt(k/C*2)}var M=S*S,L=r(0),I=function(t){return s(L)/s(L+S*t)},P=function(t){return z*((s(L)*u(L+S*t)-o(L))/M)/C},R=(r(1)-L)/S;if(Math.abs(C)<1e-6||isNaN(R)){if(Math.abs(z-A)<1e-6)return this.easeTo(t,e);var D=A180?-360:r<-180?360:0}},e.prototype._smoothOutEasing=function(t){var e=i.ease;if(this._prevEase){var r=this._prevEase,n=(Date.now()-r.start)/r.duration,o=r.easing(n+.01)-r.easing(n),a=.27/Math.sqrt(o*o+1e-4)*.01,s=Math.sqrt(.0729-a*a);e=i.bezier(a,s,.25,1)}return this._prevEase={start:(new Date).getTime(),duration:t,easing:e},e},e}(u);e.exports=c},{"../geo/lng_lat":58,"../geo/lng_lat_bounds":59,"../style-spec/util/interpolate":127,"../util/browser":202,"../util/evented":210,"../util/util":223,"@mapbox/point-geometry":2}],182:[function(t,e,r){"use strict";var i=t("../../util/dom"),n=t("../../util/util"),o=t("../../util/config"),a=function(t){this.options=t,n.bindAll(["_updateEditLink","_updateData","_updateCompact"],this)};a.prototype.getDefaultPosition=function(){return"bottom-right"},a.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=i.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},a.prototype.onRemove=function(){i.remove(this._container),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0},a.prototype._updateEditLink=function(){var t=this._editLink;t||(t=this._editLink=this._container.querySelector(".mapbox-improve-map"));var e=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:o.ACCESS_TOKEN}];if(t){var r=e.reduce(function(t,r,i){return r.value&&(t+=r.key+"="+r.value+(i=0)return!1;return!0}),this._container.innerHTML=t.join(" | "),this._editLink=null}},a.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact")},e.exports=a},{"../../util/config":206,"../../util/dom":209,"../../util/util":223}],183:[function(t,e,r){"use strict";var i=t("../../util/dom"),n=t("../../util/util"),o=t("../../util/window"),a=function(){this._fullscreen=!1,n.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in o.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in o.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in o.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in o.document&&(this._fullscreenchange="MSFullscreenChange"),this._className="mapboxgl-ctrl"};a.prototype.onAdd=function(t){return this._map=t,this._mapContainer=this._map.getContainer(),this._container=i.create("div",this._className+" mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._container.style.display="none",n.warnOnce("This device does not support fullscreen mode.")),this._container},a.prototype.onRemove=function(){i.remove(this._container),this._map=null,o.document.removeEventListener(this._fullscreenchange,this._changeIcon)},a.prototype._checkFullscreenSupport=function(){return!!(o.document.fullscreenEnabled||o.document.mozFullScreenEnabled||o.document.msFullscreenEnabled||o.document.webkitFullscreenEnabled)},a.prototype._setupUI=function(){var t=this._fullscreenButton=i.create("button",this._className+"-icon "+this._className+"-fullscreen",this._container);t.setAttribute("aria-label","Toggle fullscreen"),t.type="button",this._fullscreenButton.addEventListener("click",this._onClickFullscreen),o.document.addEventListener(this._fullscreenchange,this._changeIcon)},a.prototype._isFullscreen=function(){return this._fullscreen},a.prototype._changeIcon=function(){(o.document.fullscreenElement||o.document.mozFullScreenElement||o.document.webkitFullscreenElement||o.document.msFullscreenElement)===this._mapContainer!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle(this._className+"-shrink"),this._fullscreenButton.classList.toggle(this._className+"-fullscreen"))},a.prototype._onClickFullscreen=function(){this._isFullscreen()?o.document.exitFullscreen?o.document.exitFullscreen():o.document.mozCancelFullScreen?o.document.mozCancelFullScreen():o.document.msExitFullscreen?o.document.msExitFullscreen():o.document.webkitCancelFullScreen&&o.document.webkitCancelFullScreen():this._mapContainer.requestFullscreen?this._mapContainer.requestFullscreen():this._mapContainer.mozRequestFullScreen?this._mapContainer.mozRequestFullScreen():this._mapContainer.msRequestFullscreen?this._mapContainer.msRequestFullscreen():this._mapContainer.webkitRequestFullscreen&&this._mapContainer.webkitRequestFullscreen()},e.exports=a},{"../../util/dom":209,"../../util/util":223,"../../util/window":204}],184:[function(t,e,r){"use strict";function i(t){void 0!==n?t(n):void 0!==s.navigator.permissions?s.navigator.permissions.query({name:"geolocation"}).then(function(e){n="denied"!==e.state,t(n)}):(n=!!s.navigator.geolocation,t(n))}var n,o=t("../../util/evented"),a=t("../../util/dom"),s=t("../../util/window"),l=t("../../util/util"),u=t("../../geo/lng_lat"),c=t("../marker"),p={positionOptions:{enableHighAccuracy:!1,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showUserLocation:!0},h=function(t){function e(e){t.call(this),this.options=l.extend({},p,e),l.bindAll(["_onSuccess","_onError","_finish","_setupUI","_updateCamera","_updateMarker","_onClickGeolocate"],this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.onAdd=function(t){return this._map=t,this._container=a.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),i(this._setupUI),this._container},e.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(s.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker.remove(),a.remove(this._container),this._map=void 0},e.prototype._onSuccess=function(t){if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire("geolocate",t),this._finish()},e.prototype._updateCamera=function(t){var e=new u(t.coords.longitude,t.coords.latitude),r=t.coords.accuracy;this._map.fitBounds(e.toBounds(r),this.options.fitBoundsOptions,{geolocateSource:!0})},e.prototype._updateMarker=function(t){t?this._userLocationDotMarker.setLngLat([t.coords.longitude,t.coords.latitude]).addTo(this._map):this._userLocationDotMarker.remove()},e.prototype._onError=function(t){if(this.options.trackUserLocation)if(1===t.code)this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),void 0!==this._geolocationWatchID&&this._clearWatch();else switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire("error",t),this._finish()},e.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},e.prototype._setupUI=function(t){var e=this;!1!==t&&(this._container.addEventListener("contextmenu",function(t){return t.preventDefault()}),this._geolocateButton=a.create("button","mapboxgl-ctrl-icon mapboxgl-ctrl-geolocate",this._container),this._geolocateButton.type="button",this._geolocateButton.setAttribute("aria-label","Geolocate"),this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=a.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new c(this._dotElement),this.options.trackUserLocation&&(this._watchState="OFF")),this._geolocateButton.addEventListener("click",this._onClickGeolocate.bind(this)),this.options.trackUserLocation&&this._map.on("movestart",function(t){t.geolocateSource||"ACTIVE_LOCK"!==e._watchState||(e._watchState="BACKGROUND",e._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),e._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),e.fire("trackuserlocationend"))}))},e.prototype._onClickGeolocate=function(){if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire("trackuserlocationstart");break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire("trackuserlocationend");break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire("trackuserlocationstart")}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}"OFF"===this._watchState&&void 0!==this._geolocationWatchID?this._clearWatch():void 0===this._geolocationWatchID&&(this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._geolocationWatchID=s.navigator.geolocation.watchPosition(this._onSuccess,this._onError,this.options.positionOptions))}else s.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4)},e.prototype._clearWatch=function(){s.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},e}(o);e.exports=h},{"../../geo/lng_lat":58,"../../util/dom":209,"../../util/evented":210,"../../util/util":223,"../../util/window":204,"../marker":198}],185:[function(t,e,r){"use strict";var i=t("../../util/dom"),n=t("../../util/util"),o=function(){n.bindAll(["_updateLogo"],this)};o.prototype.onAdd=function(t){this._map=t,this._container=i.create("div","mapboxgl-ctrl");var e=i.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.href="https://www.mapbox.com/",e.setAttribute("aria-label","Mapbox logo"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._container},o.prototype.onRemove=function(){i.remove(this._container),this._map.off("sourcedata",this._updateLogo)},o.prototype.getDefaultPosition=function(){return"bottom-left"},o.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},o.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style.sourceCaches;for(var e in t)if(t[e].getSource().mapbox_logo)return!0;return!1}},e.exports=o},{"../../util/dom":209,"../../util/util":223}],186:[function(t,e,r){"use strict";var i=t("../../util/dom"),n=t("../../util/util"),o=t("../handler/drag_rotate"),a=function(){var t=this;n.bindAll(["_rotateCompassArrow"],this),this._container=i.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",function(t){return t.preventDefault()}),this._zoomInButton=this._createButton("mapboxgl-ctrl-icon mapboxgl-ctrl-zoom-in","Zoom In",function(){return t._map.zoomIn()}),this._zoomOutButton=this._createButton("mapboxgl-ctrl-icon mapboxgl-ctrl-zoom-out","Zoom Out",function(){return t._map.zoomOut()}),this._compass=this._createButton("mapboxgl-ctrl-icon mapboxgl-ctrl-compass","Reset North",function(){return t._map.resetNorth()}),this._compassArrow=i.create("span","mapboxgl-ctrl-compass-arrow",this._compass)};a.prototype._rotateCompassArrow=function(){var t="rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassArrow.style.transform=t},a.prototype.onAdd=function(t){return this._map=t,this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new o(t,{button:"left",element:this._compass,pitchWithRotate:!1}),this._handler.enable(),this._container},a.prototype.onRemove=function(){i.remove(this._container),this._map.off("rotate",this._rotateCompassArrow),delete this._map,this._handler.disable(),delete this._handler},a.prototype._createButton=function(t,e,r){var n=i.create("button",t,this._container);return n.type="button",n.setAttribute("aria-label",e),n.addEventListener("click",r),n},e.exports=a},{"../../util/dom":209,"../../util/util":223,"../handler/drag_rotate":192}],187:[function(t,e,r){"use strict";function i(t,e,r){var i=r&&r.maxWidth||100,a=t._container.clientHeight/2,s=o(t.unproject([0,a]),t.unproject([i,a]));if(r&&"imperial"===r.unit){var l=3.2808*s;l>5280?n(e,i,l/5280,"mi"):n(e,i,l,"ft")}else if(r&&"nautical"===r.unit){var u=s/1852;n(e,i,u,"nm")}else n(e,i,s,"m")}function n(t,e,r,i){var n=a(r),o=n/r;"m"===i&&n>=1e3&&(n/=1e3,i="km"),t.style.width=e*o+"px",t.innerHTML=n+i}function o(t,e){var r=Math.PI/180,i=t.lat*r,n=e.lat*r,o=Math.sin(i)*Math.sin(n)+Math.cos(i)*Math.cos(n)*Math.cos((e.lng-t.lng)*r);return 6371e3*Math.acos(Math.min(o,1))}function a(t){var e=Math.pow(10,(""+Math.floor(t)).length-1),r=t/e;return r=r>=10?10:r>=5?5:r>=3?3:r>=2?2:1,e*r}var s=t("../../util/dom"),l=t("../../util/util"),u=function(t){this.options=t,l.bindAll(["_onMove"],this)};u.prototype.getDefaultPosition=function(){return"bottom-left"},u.prototype._onMove=function(){i(this._map,this._container,this.options)},u.prototype.onAdd=function(t){return this._map=t,this._container=s.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},u.prototype.onRemove=function(){s.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},e.exports=u},{"../../util/dom":209,"../../util/util":223}],188:[function(t,e,r){"use strict"},{}],189:[function(t,e,r){"use strict";var i=t("../../util/dom"),n=t("../../geo/lng_lat_bounds"),o=t("../../util/util"),a=t("../../util/window"),s=function(t){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),o.bindAll(["_onMouseDown","_onMouseMove","_onMouseUp","_onKeyDown"],this)};s.prototype.isEnabled=function(){return!!this._enabled},s.prototype.isActive=function(){return!!this._active},s.prototype.enable=function(){this.isEnabled()||(this._map.dragPan&&this._map.dragPan.disable(),this._el.addEventListener("mousedown",this._onMouseDown,!1),this._map.dragPan&&this._map.dragPan.enable(),this._enabled=!0)},s.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onMouseDown),this._enabled=!1)},s.prototype._onMouseDown=function(t){t.shiftKey&&0===t.button&&(a.document.addEventListener("mousemove",this._onMouseMove,!1),a.document.addEventListener("keydown",this._onKeyDown,!1),a.document.addEventListener("mouseup",this._onMouseUp,!1),i.disableDrag(),this._startPos=i.mousePos(this._el,t),this._active=!0)},s.prototype._onMouseMove=function(t){var e=this._startPos,r=i.mousePos(this._el,t);this._box||(this._box=i.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var n=Math.min(e.x,r.x),o=Math.max(e.x,r.x),a=Math.min(e.y,r.y),s=Math.max(e.y,r.y);i.setTransform(this._box,"translate("+n+"px,"+a+"px)"),this._box.style.width=o-n+"px",this._box.style.height=s-a+"px"},s.prototype._onMouseUp=function(t){if(0===t.button){var e=this._startPos,r=i.mousePos(this._el,t),o=(new n).extend(this._map.unproject(e)).extend(this._map.unproject(r));this._finish(),e.x===r.x&&e.y===r.y?this._fireEvent("boxzoomcancel",t):this._map.fitBounds(o,{linear:!0}).fire("boxzoomend",{originalEvent:t,boxZoomBounds:o})}},s.prototype._onKeyDown=function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t))},s.prototype._finish=function(){this._active=!1,a.document.removeEventListener("mousemove",this._onMouseMove,!1),a.document.removeEventListener("keydown",this._onKeyDown,!1),a.document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box&&(i.remove(this._box),this._box=null),i.enableDrag()},s.prototype._fireEvent=function(t,e){return this._map.fire(t,{originalEvent:e})},e.exports=s},{"../../geo/lng_lat_bounds":59,"../../util/dom":209,"../../util/util":223,"../../util/window":204}],190:[function(t,e,r){"use strict";var i=t("../../util/util"),n=function(t){this._map=t,i.bindAll(["_onDblClick"],this)};n.prototype.isEnabled=function(){return!!this._enabled},n.prototype.enable=function(){this.isEnabled()||(this._map.on("dblclick",this._onDblClick),this._enabled=!0)},n.prototype.disable=function(){this.isEnabled()&&(this._map.off("dblclick",this._onDblClick),this._enabled=!1)},n.prototype._onDblClick=function(t){this._map.zoomTo(this._map.getZoom()+(t.originalEvent.shiftKey?-1:1),{around:t.lngLat},t)},e.exports=n},{"../../util/util":223}],191:[function(t,e,r){"use strict";var i=t("../../util/dom"),n=t("../../util/util"),o=t("../../util/window"),a=n.bezier(0,0,.3,1),s=function(t){this._map=t,this._el=t.getCanvasContainer(),n.bindAll(["_onDown","_onMove","_onUp","_onTouchEnd","_onMouseUp"],this)};s.prototype.isEnabled=function(){return!!this._enabled},s.prototype.isActive=function(){return!!this._active},s.prototype.enable=function(){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-drag-pan"),this._el.addEventListener("mousedown",this._onDown),this._el.addEventListener("touchstart",this._onDown),this._enabled=!0)},s.prototype.disable=function(){this.isEnabled()&&(this._el.classList.remove("mapboxgl-touch-drag-pan"),this._el.removeEventListener("mousedown",this._onDown),this._el.removeEventListener("touchstart",this._onDown),this._enabled=!1)},s.prototype._onDown=function(t){this._ignoreEvent(t)||this.isActive()||(t.touches?(o.document.addEventListener("touchmove",this._onMove),o.document.addEventListener("touchend",this._onTouchEnd)):(o.document.addEventListener("mousemove",this._onMove),o.document.addEventListener("mouseup",this._onMouseUp)),o.addEventListener("blur",this._onMouseUp),this._active=!1,this._startPos=this._pos=i.mousePos(this._el,t),this._inertia=[[Date.now(),this._pos]])},s.prototype._onMove=function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._map.moving=!0,this._fireEvent("dragstart",t),this._fireEvent("movestart",t));var e=i.mousePos(this._el,t),r=this._map;r.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),e]),r.transform.setLocationAtPoint(r.transform.pointLocation(this._pos),e),this._fireEvent("drag",t),this._fireEvent("move",t),this._pos=e,t.preventDefault()}},s.prototype._onUp=function(t){var e=this;if(this.isActive()){this._active=!1,this._fireEvent("dragend",t),this._drainInertiaBuffer();var r=function(){e._map.moving=!1,e._fireEvent("moveend",t)},i=this._inertia;if(i.length<2)return void r();var n=i[i.length-1],o=i[0],s=n[1].sub(o[1]),l=(n[0]-o[0])/1e3;if(0===l||n[1].equals(o[1]))return void r();var u=s.mult(.3/l),c=u.mag();c>1400&&(c=1400,u._unit()._mult(c));var p=c/750,h=u.mult(-p/2);this._map.panBy(h,{duration:1e3*p,easing:a,noMoveStart:!0},{originalEvent:t})}},s.prototype._onMouseUp=function(t){this._ignoreEvent(t)||(this._onUp(t),o.document.removeEventListener("mousemove",this._onMove),o.document.removeEventListener("mouseup",this._onMouseUp),o.removeEventListener("blur",this._onMouseUp))},s.prototype._onTouchEnd=function(t){this._ignoreEvent(t)||(this._onUp(t),o.document.removeEventListener("touchmove",this._onMove),o.document.removeEventListener("touchend",this._onTouchEnd))},s.prototype._fireEvent=function(t,e){return this._map.fire(t,{originalEvent:e})},s.prototype._ignoreEvent=function(t){var e=this._map;return!(!e.boxZoom||!e.boxZoom.isActive())||!(!e.dragRotate||!e.dragRotate.isActive())||(t.touches?t.touches.length>1:!!t.ctrlKey||"mousemove"!==t.type&&t.button&&0!==t.button)},s.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,e=Date.now();t.length>0&&e-t[0][0]>160;)t.shift()},e.exports=s},{"../../util/dom":209,"../../util/util":223,"../../util/window":204}],192:[function(t,e,r){"use strict";var i=t("../../util/dom"),n=t("../../util/util"),o=t("../../util/window"),a=n.bezier(0,0,.25,1),s=function(t,e){this._map=t,this._el=e.element||t.getCanvasContainer(),this._button=e.button||"right",this._bearingSnap=e.bearingSnap||0,this._pitchWithRotate=!1!==e.pitchWithRotate,n.bindAll(["_onDown","_onMove","_onUp"],this)};s.prototype.isEnabled=function(){return!!this._enabled},s.prototype.isActive=function(){return!!this._active},s.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._enabled=!0)},s.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._enabled=!1)},s.prototype._onDown=function(t){if(!(this._map.boxZoom&&this._map.boxZoom.isActive()||this._map.dragPan&&this._map.dragPan.isActive()||this.isActive())){if("right"===this._button){var e=t.ctrlKey?0:2,r=t.button;if(void 0!==o.InstallTrigger&&2===t.button&&t.ctrlKey&&o.navigator.platform.toUpperCase().indexOf("MAC")>=0&&(r=0),r!==e)return}else if(t.ctrlKey||0!==t.button)return;i.disableDrag(),o.document.addEventListener("mousemove",this._onMove,{capture:!0}),o.document.addEventListener("mouseup",this._onUp),o.addEventListener("blur",this._onUp),this._active=!1,this._inertia=[[Date.now(),this._map.getBearing()]],this._startPos=this._pos=i.mousePos(this._el,t),this._center=this._map.transform.centerPoint,t.preventDefault()}},s.prototype._onMove=function(t){this.isActive()||(this._active=!0,this._map.moving=!0,this._fireEvent("rotatestart",t),this._fireEvent("movestart",t),this._pitchWithRotate&&this._fireEvent("pitchstart",t));var e=this._map;e.stop();var r=this._pos,n=i.mousePos(this._el,t),o=.8*(r.x-n.x),a=-.5*(r.y-n.y),s=e.getBearing()-o,l=e.getPitch()-a,u=this._inertia,c=u[u.length-1];this._drainInertiaBuffer(),u.push([Date.now(),e._normalizeBearing(s,c[1])]),e.transform.bearing=s,this._pitchWithRotate&&(this._fireEvent("pitch",t),e.transform.pitch=l),this._fireEvent("rotate",t),this._fireEvent("move",t),this._pos=n},s.prototype._onUp=function(t){var e=this;if(o.document.removeEventListener("mousemove",this._onMove,{capture:!0}),o.document.removeEventListener("mouseup",this._onUp),o.removeEventListener("blur",this._onUp),i.enableDrag(),this.isActive()){this._active=!1,this._fireEvent("rotateend",t),this._drainInertiaBuffer();var r=this._map,n=r.getBearing(),s=this._inertia,l=function(){Math.abs(n)180&&(v=180);var y=v/180;h+=d*v*(y/2),Math.abs(r._normalizeBearing(h,0))0&&e-t[0][0]>160;)t.shift()},e.exports=s},{"../../util/dom":209,"../../util/util":223,"../../util/window":204}],193:[function(t,e,r){"use strict";function i(t){return t*(2-t)}var n=t("../../util/util"),o=function(t){this._map=t,this._el=t.getCanvasContainer(),n.bindAll(["_onKeyDown"],this)};o.prototype.isEnabled=function(){return!!this._enabled},o.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)},o.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)},o.prototype._onKeyDown=function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=0,r=0,n=0,o=0,a=0;switch(t.keyCode){case 61:case 107:case 171:case 187:e=1;break;case 189:case 109:case 173:e=-1;break;case 37:t.shiftKey?r=-1:(t.preventDefault(),o=-1);break;case 39:t.shiftKey?r=1:(t.preventDefault(),o=1);break;case 38:t.shiftKey?n=1:(t.preventDefault(),a=-1);break;case 40:t.shiftKey?n=-1:(a=1,t.preventDefault());break;default:return}var s=this._map,l=s.getZoom(),u={duration:300,delayEndEvents:500,easing:i,zoom:e?Math.round(l)+e*(t.shiftKey?2:1):l,bearing:s.getBearing()+15*r,pitch:s.getPitch()+10*n,offset:[100*-o,100*-a],center:s.getCenter()};s.easeTo(u,{originalEvent:t})}},e.exports=o},{"../../util/util":223}],194:[function(t,e,r){"use strict";var i=t("../../util/dom"),n=t("../../util/util"),o=t("../../util/browser"),a=t("../../util/window"),s=a.navigator.userAgent.toLowerCase(),l=-1!==s.indexOf("firefox"),u=-1!==s.indexOf("safari")&&-1===s.indexOf("chrom"),c=function(t){this._map=t,this._el=t.getCanvasContainer(),n.bindAll(["_onWheel","_onTimeout"],this)};c.prototype.isEnabled=function(){return!!this._enabled},c.prototype.enable=function(t){this.isEnabled()||(this._el.addEventListener("wheel",this._onWheel,!1),this._el.addEventListener("mousewheel",this._onWheel,!1),this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},c.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("wheel",this._onWheel),this._el.removeEventListener("mousewheel",this._onWheel),this._enabled=!1)},c.prototype._onWheel=function(t){var e=0;"wheel"===t.type?(e=t.deltaY,l&&t.deltaMode===a.WheelEvent.DOM_DELTA_PIXEL&&(e/=o.devicePixelRatio),t.deltaMode===a.WheelEvent.DOM_DELTA_LINE&&(e*=40)):"mousewheel"===t.type&&(e=-t.wheelDeltaY,u&&(e/=3));var r=o.now(),n=r-(this._time||0);this._pos=i.mousePos(this._el,t),this._time=r,0!==e&&e%4.000244140625==0?this._type="wheel":0!==e&&Math.abs(e)<4?this._type="trackpad":n>400?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40)):this._type||(this._type=Math.abs(n*e)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,e+=this._lastValue)),t.shiftKey&&e&&(e/=4),this._type&&this._zoom(-e,t),t.preventDefault()},c.prototype._onTimeout=function(){this._type="wheel",this._zoom(-this._lastValue)},c.prototype._zoom=function(t,e){if(0!==t){var r=this._map,i=2/(1+Math.exp(-Math.abs(t/100)));t<0&&0!==i&&(i=1/i);var n=r.ease?r.ease.to:r.transform.scale,o=r.transform.scaleZoom(n*i);r.zoomTo(o,{duration:"wheel"===this._type?200:0,around:this._aroundCenter?r.getCenter():r.unproject(this._pos),delayEndEvents:200,smoothEasing:!0},{originalEvent:e})}},e.exports=c},{"../../util/browser":202,"../../util/dom":209,"../../util/util":223,"../../util/window":204}],195:[function(t,e,r){"use strict";var i=t("../../util/dom"),n=t("../../util/util"),o=t("../../util/window"),a=n.bezier(0,0,.15,1),s=function(t){this._map=t,this._el=t.getCanvasContainer(),n.bindAll(["_onStart","_onMove","_onEnd"],this)};s.prototype.isEnabled=function(){return!!this._enabled},s.prototype.enable=function(t){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-zoom-rotate"),this._el.addEventListener("touchstart",this._onStart,!1),this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},s.prototype.disable=function(){this.isEnabled()&&(this._el.classList.remove("mapboxgl-touch-zoom-rotate"),this._el.removeEventListener("touchstart",this._onStart),this._enabled=!1)},s.prototype.disableRotation=function(){this._rotationDisabled=!0},s.prototype.enableRotation=function(){this._rotationDisabled=!1},s.prototype._onStart=function(t){if(2===t.touches.length){var e=i.mousePos(this._el,t.touches[0]),r=i.mousePos(this._el,t.touches[1]);this._startVec=e.sub(r),this._startScale=this._map.transform.scale,this._startBearing=this._map.transform.bearing,this._gestureIntent=void 0,this._inertia=[],o.document.addEventListener("touchmove",this._onMove,!1),o.document.addEventListener("touchend",this._onEnd,!1)}},s.prototype._onMove=function(t){if(2===t.touches.length){var e=i.mousePos(this._el,t.touches[0]),r=i.mousePos(this._el,t.touches[1]),n=e.add(r).div(2),o=e.sub(r),a=o.mag()/this._startVec.mag(),s=this._rotationDisabled?0:180*o.angleWith(this._startVec)/Math.PI,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 c=Math.abs(1-a)>.15;Math.abs(s)>10?this._gestureIntent="rotate":c&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._startVec=o,this._startScale=l.transform.scale,this._startBearing=l.transform.bearing)}t.preventDefault()}},s.prototype._onEnd=function(t){o.document.removeEventListener("touchmove",this._onMove),o.document.removeEventListener("touchend",this._onEnd),this._drainInertiaBuffer();var e=this._inertia,r=this._map;if(e.length<2)return void r.snapToNorth({},{originalEvent:t});var i=e[e.length-1],n=e[0],s=r.transform.scaleZoom(this._startScale*i[1]),l=r.transform.scaleZoom(this._startScale*n[1]),u=s-l,c=(i[0]-n[0])/1e3,p=i[2];if(0===c||s===l)return void r.snapToNorth({},{originalEvent:t});var h=.15*u/c;Math.abs(h)>2.5&&(h=h>0?2.5:-2.5);var f=1e3*Math.abs(h/(12*.15)),d=s+h*f/2e3;d<0&&(d=0),r.easeTo({zoom:d,duration:f,easing:a,around:this._aroundCenter?r.getCenter():r.unproject(p)},{originalEvent:t})},s.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,e=Date.now();t.length>2&&e-t[0][0]>160;)t.shift()},e.exports=s},{"../../util/dom":209,"../../util/util":223,"../../util/window":204}],196:[function(t,e,r){"use strict";var i=t("../util/util"),n=t("../util/window"),o=function(){i.bindAll(["_onHashChange","_updateHash"],this)};o.prototype.addTo=function(t){return this._map=t,n.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},o.prototype.remove=function(){return n.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),delete this._map,this},o.prototype.getHashString=function(t){var e=this._map.getCenter(),r=Math.round(100*this._map.getZoom())/100,i=Math.max(0,Math.ceil(Math.log(r)/Math.LN2)),n=Math.round(e.lng*Math.pow(10,i))/Math.pow(10,i),o=Math.round(e.lat*Math.pow(10,i))/Math.pow(10,i),a=this._map.getBearing(),s=this._map.getPitch(),l="";return l+=t?"#/"+n+"/"+o+"/"+r:"#"+r+"/"+o+"/"+n,(a||s)&&(l+="/"+Math.round(10*a)/10),s&&(l+="/"+Math.round(s)),l},o.prototype._onHashChange=function(){var t=n.location.hash.replace("#","").split("/");return t.length>=3&&(this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:+(t[3]||0),pitch:+(t[4]||0)}),!0)},o.prototype._updateHash=function(){var t=this.getHashString();n.history.replaceState("","",t)},e.exports=o},{"../util/util":223,"../util/window":204}],197:[function(t,e,r){"use strict";function i(t){t.parentNode&&t.parentNode.removeChild(t)}var n=t("../util/util"),o=t("../util/browser"),a=t("../util/window"),s=t("../util/window"),l=s.HTMLImageElement,u=t("../util/dom"),c=t("../util/ajax"),p=t("../style/style"),h=t("../style/animation_loop"),f=t("../render/painter"),d=t("../geo/transform"),m=t("./hash"),v=t("./bind_handlers"),y=t("./camera"),g=t("../geo/lng_lat"),_=t("../geo/lng_lat_bounds"),x=t("@mapbox/point-geometry"),b=t("./control/attribution_control"),w=t("./control/logo_control"),T=t("mapbox-gl-supported");t("./events");var S={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:0,maxZoom:22,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,bearingSnap:7,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,transformRequest:null},z=function(t){function e(e){var r=this;if(e=n.extend({},S,e),null!=e.minZoom&&null!=e.maxZoom&&e.minZoom>e.maxZoom)throw new Error("maxZoom must be greater than minZoom");var i=new d(e.minZoom,e.maxZoom,e.renderWorldCopies);t.call(this,i,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles;var o=e.transformRequest;if(this._transformRequest=o?function(t,e){return o(t,e)||{url:t}}:function(t){return{url:t}},"string"==typeof e.container){var s=a.document.getElementById(e.container);if(!s)throw new Error("Container '"+e.container+"' not found.");this._container=s}else this._container=e.container;this.animationLoop=new h,e.maxBounds&&this.setMaxBounds(e.maxBounds),n.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored","_update","_render","_onData","_onDataLoading"],this),this._setupContainer(),this._setupPainter(),this.on("move",this._update.bind(this,!1)),this.on("zoom",this._update.bind(this,!0)),this.on("moveend",function(){r.animationLoop.set(300),r._rerender()}),void 0!==a&&(a.addEventListener("online",this._onWindowOnline,!1),a.addEventListener("resize",this._onWindowResize,!1)),v(this,e),this._hash=e.hash&&(new m).addTo(this),this._hash&&this._hash._onHashChange()||this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),this._classes=[],this.resize(),e.classes&&this.setClasses(e.classes),e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new b),this.addControl(new w,e.logoPosition),this.on("style.load",function(){this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this.style.update(this._classes,{transition:!1})}),this.on("data",this._onData),this.on("dataloading",this._onDataLoading)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={showTileBoundaries:{},showCollisionBoxes:{},showOverdrawInspector:{},repaint:{},vertices:{}};return e.prototype.addControl=function(t,e){void 0===e&&t.getDefaultPosition&&(e=t.getDefaultPosition()),void 0===e&&(e="top-right");var r=t.onAdd(this),i=this._controlPositions[e];return-1!==e.indexOf("bottom")?i.insertBefore(r,i.firstChild):i.appendChild(r),this},e.prototype.removeControl=function(t){return t.onRemove(this),this},e.prototype.addClass=function(t,e){return n.warnOnce("Style classes are deprecated and will be removed in an upcoming release of Mapbox GL JS."),this._classes.indexOf(t)>=0||""===t?this:(this._classes.push(t),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},e.prototype.removeClass=function(t,e){n.warnOnce("Style classes are deprecated and will be removed in an upcoming release of Mapbox GL JS.");var r=this._classes.indexOf(t);return r<0||""===t?this:(this._classes.splice(r,1),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},e.prototype.setClasses=function(t,e){n.warnOnce("Style classes are deprecated and will be removed in an upcoming release of Mapbox GL JS.");for(var r={},i=0;i=0},e.prototype.getClasses=function(){return n.warnOnce("Style classes are deprecated and will be removed in an upcoming release of Mapbox GL JS."),this._classes},e.prototype.resize=function(){var t=this._containerDimensions(),e=t[0],r=t[1];return this._resizeCanvas(e,r),this.transform.resize(e,r),this.painter.resize(e,r),this.fire("movestart").fire("move").fire("resize").fire("moveend")},e.prototype.getBounds=function(){var t=new _(this.transform.pointLocation(new x(0,this.transform.height)),this.transform.pointLocation(new x(this.transform.width,0)));return(this.transform.angle||this.transform.pitch)&&(t.extend(this.transform.pointLocation(new x(this.transform.size.x,0))),t.extend(this.transform.pointLocation(new x(0,this.transform.size.y)))),t},e.prototype.getMaxBounds=function(){return this.transform.latRange&&2===this.transform.latRange.length&&this.transform.lngRange&&2===this.transform.lngRange.length?new _([this.transform.lngRange[0],this.transform.latRange[0]],[this.transform.lngRange[1],this.transform.latRange[1]]):null},e.prototype.setMaxBounds=function(t){if(t){var e=_.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=null,this.transform.latRange=null,this._update());return this},e.prototype.setMinZoom=function(t){if((t=null===t||void 0===t?0:t)>=0&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},e.prototype.getMaxZoom=function(){return this.transform.maxZoom},e.prototype.project=function(t){return this.transform.locationPoint(g.convert(t))},e.prototype.unproject=function(t){return this.transform.pointLocation(x.convert(t))},e.prototype.on=function(e,r,i){var o=this;if(void 0===i)return t.prototype.on.call(this,e,r);var a=function(){if("mouseenter"===e||"mouseover"===e){var t=!1;return{layer:r,listener:i,delegates:{mousemove:function(a){var s=o.getLayer(r)?o.queryRenderedFeatures(a.point,{layers:[r]}):[];s.length?t||(t=!0,i.call(o,n.extend({features:s},a,{type:e}))):t=!1},mouseout:function(){t=!1}}}}if("mouseleave"===e||"mouseout"===e){var a=!1;return{layer:r,listener:i,delegates:{mousemove:function(t){(o.getLayer(r)?o.queryRenderedFeatures(t.point,{layers:[r]}):[]).length?a=!0:a&&(a=!1,i.call(o,n.extend({},t,{type:e})))},mouseout:function(t){a&&(a=!1,i.call(o,n.extend({},t,{type:e})))}}}}var s=function(t){var e=o.getLayer(r)?o.queryRenderedFeatures(t.point,{layers:[r]}):[];e.length&&i.call(o,n.extend({features:e},t))};return{layer:r,listener:i,delegates:(l={},l[e]=s,l)};var l}();this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[e]=this._delegatedListeners[e]||[],this._delegatedListeners[e].push(a);for(var s in a.delegates)o.on(s,a.delegates[s]);return this},e.prototype.off=function(e,r,i){var n=this;if(void 0===i)return t.prototype.off.call(this,e,r);if(this._delegatedListeners&&this._delegatedListeners[e])for(var o=this._delegatedListeners[e],a=0;athis._map.transform.height-o?["bottom"]:[],t.xthis._map.transform.width-n/2&&e.push("right"),e=0===e.length?"bottom":e.join("-")}var s=t.add(r[e]).round(),l={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%)"},u=this._container.classList;for(var p in l)u.remove("mapboxgl-popup-anchor-"+p);u.add("mapboxgl-popup-anchor-"+e),a.setTransform(this._container,l[e]+" translate("+s.x+"px,"+s.y+"px)")}},e.prototype._onClickClose=function(){this.remove()},e}(o);e.exports=h},{"../geo/lng_lat":58,"../util/dom":209,"../util/evented":210,"../util/smart_wrap":219,"../util/util":223,"../util/window":204,"@mapbox/point-geometry":2}],200:[function(t,e,r){"use strict";var i=t("./util"),n=function(t,e,r){this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.callbackID=0,i.bindAll(["receive"],this),this.target.addEventListener("message",this.receive,!1)};n.prototype.send=function(t,e,r,i,n){var o=r?this.mapId+":"+this.callbackID++:null;r&&(this.callbacks[o]=r),this.target.postMessage({targetMapId:n,sourceMapId:this.mapId,type:t,id:String(o),data:e},i)},n.prototype.receive=function(t){var e,r=this,i=t.data,n=i.id;if(!i.targetMapId||this.mapId===i.targetMapId){var o=function(t,e,i){r.target.postMessage({sourceMapId:r.mapId,type:"",id:String(n),error:t?String(t):null,data:e},i)};if(""===i.type)e=this.callbacks[i.id],delete this.callbacks[i.id],e&&i.error?e(new Error(i.error)):e&&e(null,i.data);else if(void 0!==i.id&&this.parent[i.type])this.parent[i.type](i.sourceMapId,i.data,o);else if(void 0!==i.id&&this.parent.getWorkerSource){var a=i.type.split("."),s=this.parent.getWorkerSource(i.sourceMapId,a[0]);s[a[1]](i.data,o)}else this.parent[i.type](i.data)}},n.prototype.remove=function(){this.target.removeEventListener("message",this.receive,!1)},e.exports=n},{"./util":223}],201:[function(t,e,r){"use strict";function i(t){var e=new o.XMLHttpRequest;e.open("GET",t.url,!0);for(var r in t.headers)e.setRequestHeader(r,t.headers[r]);return e.withCredentials="include"===t.credentials,e}function n(t){var e=o.document.createElement("a");return e.href=t,e.protocol===o.document.location.protocol&&e.host===o.document.location.host}var o=t("./window"),a={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};r.ResourceType=a,"function"==typeof Object.freeze&&Object.freeze(a);var s=function(t){function e(e,r){t.call(this,e),this.status=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error);r.getJSON=function(t,e){var r=i(t);return r.setRequestHeader("Accept","application/json"),r.onerror=function(){e(new Error(r.statusText))},r.onload=function(){if(r.status>=200&&r.status<300&&r.response){var t;try{t=JSON.parse(r.response)}catch(t){return e(t)}e(null,t)}else e(new s(r.statusText,r.status))},r.send(),r},r.getArrayBuffer=function(t,e){var r=i(t);return r.responseType="arraybuffer",r.onerror=function(){e(new Error(r.statusText))},r.onload=function(){var t=r.response;if(0===t.byteLength&&200===r.status)return e(new Error("http status 200 returned without content."));r.status>=200&&r.status<300&&r.response?e(null,{data:t,cacheControl:r.getResponseHeader("Cache-Control"),expires:r.getResponseHeader("Expires")}):e(new s(r.statusText,r.status))},r.send(),r};r.getImage=function(t,e){return r.getArrayBuffer(t,function(t,r){if(t)e(t);else if(r){var i=new o.Image,n=o.URL||o.webkitURL;i.onload=function(){e(null,i),n.revokeObjectURL(i.src)};var a=new o.Blob([new Uint8Array(r.data)],{type:"image/png"});i.cacheControl=r.cacheControl,i.expires=r.expires,i.src=r.data.byteLength?n.createObjectURL(a):"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII="}})},r.getVideo=function(t,e){var r=o.document.createElement("video");r.onloadstart=function(){e(null,r)};for(var i=0;i=s+e?t.call(r,1):(t.call(r,(l-s)/e),o(i))}}if(!e)return t.call(r,1),null;var a=!1,s=n();return o(i),function(){a=!0}},getImageData:function(t){var e=i.document.createElement("canvas"),r=e.getContext("2d");if(!r)throw new Error("failed to create canvas 2d context");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0,t.width,t.height),r.getImageData(0,0,t.width,t.height)},hardwareConcurrency:i.navigator.hardwareConcurrency||4,get devicePixelRatio(){return i.devicePixelRatio},supportsWebp:!1};var s=i.document.createElement("img");s.onload=function(){e.exports.supportsWebp=!0},s.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="},{"./window":204}],203:[function(t,e,r){"use strict";var i=t("webworkify"),n=t("../window"),o=n.URL.createObjectURL(new i(t("../../source/worker"),{bare:!0}));e.exports=function(){return new n.Worker(o)}},{"../../source/worker":105,"../window":204,webworkify:39}],204:[function(t,e,r){"use strict";e.exports=self},{}],205:[function(t,e,r){"use strict";function i(t,e){return e.area-t.area}var n=t("quickselect"),o=t("./util").calculateSignedArea;e.exports=function(t,e){var r=t.length;if(r<=1)return[t];for(var a,s,l=[],u=0;u1)for(var p=0;p0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},a.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this},e.exports=a},{"./util":223}],211:[function(t,e,r){"use strict";function i(t,e){return e.max-t.max}function n(t,e,r,i){this.p=new l(t,e),this.h=r,this.d=o(this.p,i),this.max=this.d+this.h*Math.SQRT2}function o(t,e){for(var r=!1,i=1/0,n=0;nt.y!=p.y>t.y&&t.x<(p.x-c.x)*(t.y-c.y)/(p.y-c.y)+c.x&&(r=!r),i=Math.min(i,u(t,c,p))}return(r?1:-1)*Math.sqrt(i)}function a(t){for(var e=0,r=0,i=0,o=t[0],a=0,s=o.length,l=s-1;ac)&&(c=d.x),(!f||d.y>p)&&(p=d.y)}var m=c-o,v=p-u,y=Math.min(m,v),g=y/2,_=new s(null,i);if(0===y)return new l(o,u);for(var x=o;xw.d||!w.d)&&(w=S,r&&console.log("found best %d after %d probes",Math.round(1e4*S.d)/1e4,T)),S.max-w.d<=e||(g=S.h/2,_.push(new n(S.p.x-g,S.p.y-g,g,t)),_.push(new n(S.p.x+g,S.p.y-g,g,t)),_.push(new n(S.p.x-g,S.p.y+g,g,t)),_.push(new n(S.p.x+g,S.p.y+g,g,t)),T+=4)}return r&&(console.log("num probes: "+T),console.log("best distance: "+w.d)),w.p}},{"./intersection_tests":214,"@mapbox/point-geometry":2,tinyqueue:33}],212:[function(t,e,r){"use strict";var i,n=t("./worker_pool");e.exports=function(){return i||(i=new n),i}},{"./worker_pool":226}],213:[function(t,e,r){"use strict";function i(t,e,r){var i=t.width,n=t.height;if(r){if(r.length!==i*n*e)throw new RangeError("mismatched image size")}else r=new Uint8Array(i*n*e);return{width:i,height:n,data:r}}function n(t,e,r){var n=e.width,a=e.height;if(n===t.width&&a===t.height)return t;var s=i({width:n,height:a},r);o(t,s,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,n),height:Math.min(t.height,a)},r),t.width=n,t.height=a,t.data=s.data}function o(t,e,r,i,n,o){if(0===n.width||0===n.height)return e;if(n.width>t.width||n.height>t.height||r.x>t.width-n.width||r.y>t.height-n.height)throw new RangeError("out of range source coordinates for image copy");if(n.width>e.width||n.height>e.height||i.x>e.width-n.width||i.y>e.height-n.height)throw new RangeError("out of range destination coordinates for image copy");for(var a=t.data,s=e.data,l=0;l=3)for(var l=0;l1){if(l(t,e))return!0;for(var i=0;i1?t.distSqr(r):t.distSqr(r.sub(e)._mult(n)._add(e))}function h(t,e){for(var r,i,n,o=!1,a=0;ae.y!=n.y>e.y&&e.x<(n.x-i.x)*(e.y-i.y)/(n.y-i.y)+i.x&&(o=!o)}return o}function f(t,e){for(var r=!1,i=0,n=t.length-1;ie.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(r=!r)}return r}var d=t("./util"),m=d.isCounterClockwise;e.exports={multiPolygonIntersectsBufferedMultiPoint:n,multiPolygonIntersectsMultiPolygon:o,multiPolygonIntersectsBufferedMultiLine:a,polygonIntersectsPolygon:i,distToSegmentSquared:p}},{"./util":223}],215:[function(t,e,r){"use strict";var i={"Latin-1 Supplement":function(t){return t>=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};e.exports=i},{}],216:[function(t,e,r){"use strict";var i=function(t,e){this.max=t,this.onRemove=e,this.reset()};i.prototype.reset=function(){var t=this;for(var e in t.data)t.onRemove(t.data[e]);return this.data={},this.order=[],this},i.prototype.add=function(t,e){if(this.has(t))this.order.splice(this.order.indexOf(t),1),this.data[t]=e,this.order.push(t);else if(this.data[t]=e,this.order.push(t),this.order.length>this.max){var r=this.get(this.order[0]);r&&this.onRemove(r)}return this},i.prototype.has=function(t){return t in this.data},i.prototype.keys=function(){return this.order},i.prototype.get=function(t){if(!this.has(t))return null;var e=this.data[t];return delete this.data[t],this.order.splice(this.order.indexOf(t),1),e},i.prototype.getWithoutRemoving=function(t){return this.has(t)?this.data[t]:null},i.prototype.remove=function(t){if(!this.has(t))return this;var e=this.data[t];return delete this.data[t],this.onRemove(e),this.order.splice(this.order.indexOf(t),1),this},i.prototype.setMaxSize=function(t){var e=this;for(this.max=t;this.order.length>this.max;){var r=e.get(e.order[0]);r&&e.onRemove(r)}return this},e.exports=i},{}],217:[function(t,e,r){"use strict";function i(t,e){var r=a(l.API_URL);if(t.protocol=r.protocol,t.authority=r.authority,"/"!==r.path&&(t.path=""+r.path+t.path),!l.REQUIRE_ACCESS_TOKEN)return s(t);if(!(e=e||l.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+c);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+c);return t.params.push("access_token="+e),s(t)}function n(t){return 0===t.indexOf("mapbox:")}function o(t){for(var e=0;e=2||512===r?"@2x":"",c=u.supportsWebp?".webp":"$1";return i.path=i.path.replace(p,""+l+c),o(i.params),s(i)};var h=/^(\w+):\/\/([^\/?]*)(\/[^?]+)?\??(.+)?/},{"./browser":202,"./config":206}],218:[function(t,e,r){"use strict";var i=t("./is_char_in_unicode_block");e.exports.allowsIdeographicBreaking=function(t){for(var e=0,i=t;e=65097&&t<=65103)||i["CJK Compatibility Ideographs"](t)||i["CJK Compatibility"](t)||i["CJK Radicals Supplement"](t)||i["CJK Strokes"](t)||!(!i["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||i["CJK Unified Ideographs Extension A"](t)||i["CJK Unified Ideographs"](t)||i["Enclosed CJK Letters and Months"](t)||i["Hangul Compatibility Jamo"](t)||i["Hangul Jamo Extended-A"](t)||i["Hangul Jamo Extended-B"](t)||i["Hangul Jamo"](t)||i["Hangul Syllables"](t)||i.Hiragana(t)||i["Ideographic Description Characters"](t)||i.Kanbun(t)||i["Kangxi Radicals"](t)||i["Katakana Phonetic Extensions"](t)||i.Katakana(t)&&12540!==t||!(!i["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!i["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||i["Unified Canadian Aboriginal Syllabics"](t)||i["Unified Canadian Aboriginal Syllabics Extended"](t)||i["Vertical Forms"](t)||i["Yijing Hexagram Symbols"](t)||i["Yi Syllables"](t)||i["Yi Radicals"](t)))},r.charHasNeutralVerticalOrientation=function(t){return!!(i["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||i["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||i["Letterlike Symbols"](t)||i["Number Forms"](t)||i["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||i["Control Pictures"](t)&&9251!==t||i["Optical Character Recognition"](t)||i["Enclosed Alphanumerics"](t)||i["Geometric Shapes"](t)||i["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||i["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||i["CJK Symbols and Punctuation"](t)||i.Katakana(t)||i["Private Use Area"](t)||i["CJK Compatibility Forms"](t)||i["Small Form Variants"](t)||i["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)},r.charHasRotatedVerticalOrientation=function(t){return!(r.charHasUprightVerticalOrientation(t)||r.charHasNeutralVerticalOrientation(t))}},{"./is_char_in_unicode_block":215}],219:[function(t,e,r){"use strict";var i=t("../geo/lng_lat");e.exports=function(t,e,r){if(t=new i(t.lng,t.lat),e){var n=new i(t.lng-360,t.lat),o=new i(t.lng+360,t.lat),a=r.locationPoint(t).distSqr(e);r.locationPoint(n).distSqr(e)180;){var s=r.locationPoint(t);if(s.x>=0&&s.y>=0&&s.x<=r.width&&s.y<=r.height)break;t.lng>r.center.lng?t.lng-=360:t.lng+=360}return t}},{"../geo/lng_lat":58}],220:[function(t,e,r){"use strict";function i(t){var e=JSON.stringify(t);if(f[e])return f[e];var r=void 0===t.alignment?1:t.alignment,i=0,a=0,l=["Uint8"],c=t.members.map(function(t){l.indexOf(t.type)<0&&l.push(t.type);var e=o(t.type),s=i=n(i,Math.max(r,e)),u=t.components||1;return a=Math.max(a,e),i+=e*u,{name:t.name,type:t.type,components:u,offset:s}}),d=n(i,Math.max(a,r)),m=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(p);m.prototype.alignment=r,m.prototype.size=d;for(var v=0,y=c;v1&&(x+=_),x in m.prototype)throw new Error(x+" is a reserved name and cannot be used as a member name.");Object.defineProperty(m.prototype,x,u(g,_))}var b=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(h);return b.prototype.members=c,b.prototype.StructType=m,b.prototype.bytesPerElement=d,b.prototype.emplaceBack=s(c,d),b.prototype._usedTypes=l,f[e]=b,b}function n(t,e){return Math.ceil(t/e)*e}function o(t){return c[t].BYTES_PER_ELEMENT}function a(t){return t.toLowerCase()}function s(t,e){for(var r=[],i=[],n="var i = this.length;\nthis.resize(this.length + 1);\n",s=0,l=t;sthis.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},h.prototype._refreshViews=function(){for(var t=this,e=0,r=t._usedTypes;e=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)},r.bezier=function(t,e,r,n){var o=new i(t,e,r,n);return function(t){return o.solve(t)}},r.ease=r.bezier(.25,.1,.25,1),r.clamp=function(t,e,r){return Math.min(r,Math.max(e,t))},r.wrap=function(t,e,r){var i=r-e,n=((t-e)%i+i)%i+e;return n===e?r:n},r.asyncAll=function(t,e,r){if(!t.length)return r(null,[]);var i=t.length,n=new Array(t.length),o=null;t.forEach(function(t,a){e(t,function(t,e){t&&(o=t),n[a]=e,0==--i&&r(o,n)})})},r.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},r.keysDifference=function(t,e){var r=[];for(var i in t)i in e||r.push(i);return r},r.extend=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var i=0,n=e;i=0)return!0;return!1};var a={};r.warnOnce=function(t){a[t]||("undefined"!=typeof console&&console.warn(t),a[t]=!0)},r.isCounterClockwise=function(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)},r.calculateSignedArea=function(t){for(var e=0,r=0,i=t.length,n=i-1,o=void 0,a=void 0;r0||Math.abs(e.y-i.y)>0)&&Math.abs(r.calculateSignedArea(t))>.01},r.sphericalToCartesian=function(t){var e=t[0],r=t[1],i=t[2];return r+=90,r*=Math.PI/180,i*=Math.PI/180,[e*Math.cos(r)*Math.sin(i),e*Math.sin(r)*Math.sin(i),e*Math.cos(i)]},r.parseCacheControl=function(t){var e=/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,r={};if(t.replace(e,function(t,e,i,n){var o=i||n;return r[e]=!o||o.toLowerCase(),""}),r["max-age"]){var i=parseInt(r["max-age"],10);isNaN(i)?delete r["max-age"]:r["max-age"]=i}return r}},{"../geo/coordinate":57,"@mapbox/point-geometry":2,"@mapbox/unitbezier":5}],224:[function(t,e,r){"use strict";var i=function(t,e,r,i){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=r,t._y=i,this.properties=t.properties,null!=t.id&&(this.id=t.id)},n={geometry:{}};n.geometry.get=function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},n.geometry.set=function(t){this._geometry=t},i.prototype.toJSON=function(){var t=this,e={geometry:this.geometry};for(var r in t)"_geometry"!==r&&"_vectorTileFeature"!==r&&(e[r]=t[r]);return e},Object.defineProperties(i.prototype,n),e.exports=i},{}],225:[function(t,e,r){"use strict";var i=t("./script_detection");e.exports=function(t){for(var r="",n=0;n":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"}},{"./script_detection":218}],226:[function(t,e,r){"use strict";var i=t("./web_worker"),n=function(){this.active={}};n.prototype.acquire=function(e){var r=this;if(!this.workers){var n=t("../").workerCount;for(this.workers=[];this.workers.lengthi.maxh||t>i.maxw||r<=i.maxh&&t<=i.maxw&&(a=i.maxw*i.maxh-t*r)o.free)){if(r===o.h)return this.allocShelf(s,t,r,n);r>o.h||rh)&&(f=2*Math.max(t,h)),(cc)&&(p=2*Math.max(r,c)),this.resize(f,p),this.packOne(t,r,n)}return null},t.prototype.allocFreebin=function(t,e,r,n){var i=this.freebins.splice(t,1)[0];return i.id=n,i.w=e,i.h=r,i.refcount=0,this.bins[n]=i,this.ref(i),i},t.prototype.allocShelf=function(t,e,r,n){var i=this.shelves[t],o=i.alloc(e,r,n);return this.bins[n]=o,this.ref(o),o},t.prototype.shrink=function(){if(this.shelves.length>0){for(var t=0,e=0,r=0;rthis.free||e>this.h)return null;var i=this.x;return this.x+=t,this.free-=t,new r(n,i,this.y,t,e,t,this.h)},e.prototype.resize=function(t){return this.free+=t-this.w,this.w=t,!0},t})},{}],4:[function(t,e,r){"use strict";function n(t,e,r,n,i,o){this.fontSize=t||24,this.buffer=void 0===e?3:e,this.cutoff=n||.25,this.fontFamily=i||"sans-serif",this.fontWeight=o||"normal",this.radius=r||8;var a=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=a,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(a*a),this.gridInner=new Float64Array(a*a),this.f=new Float64Array(a),this.d=new Float64Array(a),this.z=new Float64Array(a+1),this.v=new Int16Array(a),this.middle=Math.round(a/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function i(t,e,r,n,i,a,s){for(var l=0;ln)return n;for(;ro?r=i:n=i,i=.5*(n-r)+r}return i},n.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}},{}],6:[function(t,e,r){e.exports.VectorTile=t("./lib/vectortile.js"),e.exports.VectorTileFeature=t("./lib/vectortilefeature.js"),e.exports.VectorTileLayer=t("./lib/vectortilelayer.js")},{"./lib/vectortile.js":7,"./lib/vectortilefeature.js":8,"./lib/vectortilelayer.js":9}],7:[function(t,e,r){"use strict";function n(t,e){this.layers=t.readFields(i,{},e)}function i(t,e,r){if(3===t){var n=new o(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}var o=t("./vectortilelayer");e.exports=n},{"./vectortilelayer":9}],8:[function(t,e,r){"use strict";function n(t,e,r,n,o){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=o,t.readFields(i,this,e)}function i(t,e,r){1==t?e.id=r.readVarint():2==t?o(r,e):3==t?e.type=r.readVarint():4==t&&(e._geometry=r.pos)}function o(t,e){for(var r=t.readVarint()+t.pos;t.pos>3}if(i--,1===n||2===n)o+=t.readSVarint(),a+=t.readSVarint(),1===n&&(e&&s.push(e),e=[]),e.push(new l(o,a));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&s.push(e),s},n.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,o=0,a=1/0,s=-1/0,l=1/0,u=-1/0;t.pos>3}if(n--,1===r||2===r)i+=t.readSVarint(),o+=t.readSVarint(),is&&(s=i),ou&&(u=o);else if(7!==r)throw new Error("unknown command "+r)}return[a,l,s,u]},n.prototype.toGeoJSON=function(t,e,r){function i(t){for(var e=0;e>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}var a=t("./vectortilefeature.js");e.exports=n,n.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new a(this._pbf,e,this.extent,this._keys,this._values)}},{"./vectortilefeature.js":8}],10:[function(e,r,n){!function(e,i){"object"==typeof n&&"undefined"!=typeof r?i(n):"function"==typeof t&&t.amd?t(["exports"],i):i(e.WhooTS=e.WhooTS||{})}(this,function(t){function e(t,e,n,i,o,a){return a=a||{},t+"?"+["bbox="+r(n,i,o),"format="+(a.format||"image/png"),"service="+(a.service||"WMS"),"version="+(a.version||"1.1.1"),"request="+(a.request||"GetMap"),"srs="+(a.srs||"EPSG:3857"),"width="+(a.width||256),"height="+(a.height||256),"layers="+e].join("&")}function r(t,e,r){e=Math.pow(2,r)-e-1;var i=n(256*t,256*e,r),o=n(256*(t+1),256*(e+1),r);return i[0]+","+i[1]+","+o[0]+","+o[1]}function n(t,e,r){var n=2*Math.PI*6378137/256/Math.pow(2,r);return[t*n-2*Math.PI*6378137/2,e*n-2*Math.PI*6378137/2]}t.getURL=e,t.getTileBBox=r,t.getMercCoords=n,Object.defineProperty(t,"__esModule",{value:!0})})},{}],11:[function(t,e,r){"use strict";function n(t,e,r){r=r||2;var n=e&&e.length,o=n?e[0]*r:t.length,s=i(t,0,o,r,!0),l=[];if(!s)return l;var u,c,h,f,d,m,v;if(n&&(s=p(t,e,s,r)),t.length>80*r){u=h=t[0],c=f=t[1];for(var y=r;yh&&(h=d),m>f&&(f=m);v=Math.max(h-u,f-c)}return a(s,l,r,u,c,v),l}function i(t,e,r,n,i){var o,a;if(i===L(t,e,r,n)>0)for(o=e;o=e;o-=n)a=E(o,t[o],t[o+1],a);return a&&w(a,a.next)&&(k(a),a=a.next),a}function o(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!w(n,n.next)&&0!==b(n.prev,n,n.next))n=n.next;else{if(k(n),(n=e=n.prev)===n.next)return null;r=!0}}while(r||n!==e);return e}function a(t,e,r,n,i,p,h){if(t){!h&&p&&m(t,n,i,p);for(var f,d,v=t;t.prev!==t.next;)if(f=t.prev,d=t.next,p?l(t,n,i,p):s(t))e.push(f.i/r),e.push(t.i/r),e.push(d.i/r),k(t),t=d.next,v=d.next;else if((t=d)===v){h?1===h?(t=u(t,e,r),a(t,e,r,n,i,p,2)):2===h&&c(t,e,r,n,i,p):a(o(t),e,r,n,i,p,1);break}}}function s(t){var e=t.prev,r=t,n=t.next;if(b(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(_(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&b(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function l(t,e,r,n){var i=t.prev,o=t,a=t.next;if(b(i,o,a)>=0)return!1;for(var s=i.xo.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,c=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,p=y(s,l,e,r,n),h=y(u,c,e,r,n),f=t.nextZ;f&&f.z<=h;){if(f!==t.prev&&f!==t.next&&_(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&b(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(f=t.prevZ;f&&f.z>=p;){if(f!==t.prev&&f!==t.next&&_(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&b(f.prev,f,f.next)>=0)return!1;f=f.prevZ}return!0}function u(t,e,r){var n=t;do{var i=n.prev,o=n.next.next;!w(i,o)&&T(i,n,n.next,o)&&z(i,o)&&z(o,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(o.i/r),k(n),k(n.next),n=t=o),n=n.next}while(n!==t);return n}function c(t,e,r,n,i,s){var l=t;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&x(l,u)){var c=C(l,u);return l=o(l,l.next),c=o(c,c.next),a(l,e,r,n,i,s),void a(c,e,r,n,i,s)}u=u.next}l=l.next}while(l!==t)}function p(t,e,r,n){var a,s,l,u,c,p=[];for(a=0,s=e.length;a=n.next.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>a){if(a=s,s===i){if(o===n.y)return n;if(o===n.next.y)return n.next}r=n.x=n.x&&n.x>=c&&_(or.x)&&z(n,t)&&(r=n,h=l),n=n.next;return r}function m(t,e,r,n){var i=t;do{null===i.z&&(i.z=y(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,v(i)}function v(t){var e,r,n,i,o,a,s,l,u=1;do{for(r=t,t=null,o=null,a=0;r;){for(a++,n=r,s=0,e=0;e0||l>0&&n;)0===s?(i=n,n=n.nextZ,l--):0!==l&&n?r.z<=n.z?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--):(i=r,r=r.nextZ,s--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;r=n}o.nextZ=null,u*=2}while(a>1);return t}function y(t,e,r,n,i){return t=32767*(t-r)/i,e=32767*(e-n)/i,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function g(t){var e=t,r=t;do{e.x=0&&(t-a)*(n-s)-(r-a)*(e-s)>=0&&(r-a)*(o-s)-(i-a)*(n-s)>=0}function x(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!S(t,e)&&z(t,e)&&z(e,t)&&A(t,e)}function b(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function w(t,e){return t.x===e.x&&t.y===e.y}function T(t,e,r,n){return!!(w(t,e)&&w(r,n)||w(t,n)&&w(r,e))||b(t,e,r)>0!=b(t,e,n)>0&&b(r,n,t)>0!=b(r,n,e)>0}function S(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&T(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}function z(t,e){return b(t.prev,t,t.next)<0?b(t,e,t.next)>=0&&b(t,t.prev,e)>=0:b(t,e,t.prev)<0||b(t,t.next,e)<0}function A(t,e){var r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}function C(t,e){var r=new M(t.i,t.x,t.y),n=new M(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function E(t,e,r,n){var i=new M(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function k(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function M(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function L(t,e,r,n){for(var i=0,o=e,a=r-n;o0&&(n+=t[i-1].length,r.holes.push(n))}return r}},{}],12:[function(t,e,r){function n(t){if("Polygon"===t.type)return i(t.coordinates);if("MultiPolygon"===t.type){for(var e=0,r=0;r0){e+=Math.abs(o(t[0]));for(var r=1;r2){for(var r,n,i=0;i=0}var u=t("geojson-area");e.exports=n},{"geojson-area":12}],14:[function(t,e,r){"use strict";function n(t,e,r,n,a,l,u,c){if(r/=e,n/=e,u>=r&&c<=n)return t;if(u>n||c=r&&d<=n)p.push(m);else if(!(f>n||d=e&&s<=r&&i.push(a)}return i}function o(t,e,r,n,i,o){for(var s=[],l=0;lr?(x.push(i(u,d,e),i(u,d,r)),o||(x=a(s,x,v,y,g))):f>=e&&x.push(i(u,d,e)):h>r?fr&&(x.push(i(u,d,r)),o||(x=a(s,x,v,y,g))));u=m[_-1],h=u[n],h>=e&&h<=r&&x.push(u),p=x[x.length-1],o&&p&&(x[0][0]!==p[0]||x[0][1]!==p[1])&&x.push(x[0]),a(s,x,v,y,g)}return s}function a(t,e,r,n,i){return e.length&&(e.area=r,e.dist=n,void 0!==i&&(e.outer=i),t.push(e)),[]}e.exports=n;var s=t("./feature")},{"./feature":16}],15:[function(t,e,r){"use strict";function n(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n1?1:n,[r,n,0]}function s(t){for(var e,r,n=0,i=0,o=0;o1)return!1;var o=i.geometry[0].length;if(5!==o)return!1;for(var a=0;a1&&console.time("creation"),_=this.tiles[g]=d(t,y,r,n,x,e===f.maxZoom),this.tileCoords.push({z:e,x:r,y:n}),m)){m>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,_.numFeatures,_.numPoints,_.numSimplified),console.timeEnd("creation"));var b="z"+e;this.stats[b]=(this.stats[b]||0)+1,this.total++}if(_.source=t,i){if(e===f.maxZoom||e===i)continue;var w=1<1&&console.time("clipping");var T,S,z,A,C,E,k=.5*f.buffer/f.extent,M=.5-k,L=.5+k,I=1+k;T=S=z=A=null,C=h(t,y,r-k,r+L,0,a,_.min[0],_.max[0]),E=h(t,y,r+M,r+I,0,a,_.min[0],_.max[0]),C&&(T=h(C,y,n-k,n+L,1,s,_.min[1],_.max[1]),S=h(C,y,n+M,n+I,1,s,_.min[1],_.max[1])),E&&(z=h(E,y,n-k,n+L,1,s,_.min[1],_.max[1]),A=h(E,y,n+M,n+I,1,s,_.min[1],_.max[1])),m>1&&console.timeEnd("clipping"),t.length&&(p.push(T||[],e+1,2*r,2*n),p.push(S||[],e+1,2*r,2*n+1),p.push(z||[],e+1,2*r+1,2*n),p.push(A||[],e+1,2*r+1,2*n+1))}else i&&(v=e)}return v},i.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,a=n.debug,s=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var c,h=t,f=e,d=r;!c&&h>0;)h--,f=Math.floor(f/2),d=Math.floor(d/2),c=this.tiles[o(h,f,d)];if(!c||!c.source)return null;if(a>1&&console.log("found parent tile z%d-%d-%d",h,f,d),u(c,i,n.buffer))return p.tile(c,i);a>1&&console.time("drilling down");var m=this.splitTile(c.source,h,f,d,t,e,r);if(a>1&&console.timeEnd("drilling down"),null!==m){var v=1<n&&(a=r,n=o);n>s?(t[a][2]=n,p.push(u),p.push(a),u=a):(c=p.pop(),u=p.pop())}}function i(t,e,r){var n=e[0],i=e[1],o=r[0],a=r[1],s=t[0],l=t[1],u=o-n,c=a-i;if(0!==u||0!==c){var p=((s-n)*u+(l-i)*c)/(u*u+c*c);p>1?(n=o,i=a):p>0&&(n+=u*p,i+=c*p)}return u=s-n,c=l-i,u*u+c*c}e.exports=n},{}],19:[function(t,e,r){"use strict";function n(t,e,r,n,o,a){for(var s={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:n,z2:e,transformed:!1,min:[2,1],max:[-1,0]},l=0;ls.max[0]&&(s.max[0]=c[0]),c[1]>s.max[1]&&(s.max[1]=c[1])}return s}function i(t,e,r,n){var i,a,s,l,u=e.geometry,c=e.type,p=[],h=r*r;if(1===c)for(i=0;ih)&&(f.push(l),t.numSimplified++),t.numPoints++;3===c&&o(f,s.outer),p.push(f)}else t.numPoints+=s.length;if(p.length){var d={geometry:p,type:c,tags:e.tags||null};null!==e.id&&(d.id=e.id),t.features.push(d)}}function o(t,e){a(t)<0===e&&t.reverse()}function a(t){for(var e,r,n=0,i=0,o=t.length,a=o-1;i=u[h+0]&&n>=u[h+1]?(a[p]=!0,o.push(l[p])):a[p]=!1}}},n.prototype._forEachCell=function(t,e,r,n,i,o,a){for(var s=this._convertToCellCoord(t),l=this._convertToCellCoord(e),u=this._convertToCellCoord(r),c=this._convertToCellCoord(n),p=s;p<=u;p++)for(var h=l;h<=c;h++){var f=this.d*h+p;if(i.call(this,t,e,r,n,f,o,a))return}},n.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},n.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=i+this.cells.length+1+1,r=0,n=0;n>1,c=-7,p=r?i-1:0,h=r?-1:1,f=t[e+p];for(p+=h,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=256*o+t[e+p],p+=h,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+t[e+p],p+=h,c-=8);if(0===o)o=1-u;else{if(o===l)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),o-=u}return(f?-1:1)*a*Math.pow(2,o-n)},r.write=function(t,e,r,n,i,o){var a,s,l,u=8*o-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,d=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),e+=a+p>=1?h/l:h*Math.pow(2,1-p),e*l>=2&&(a++,l/=2),a+p>=c?(s=0,a=c):a+p>=1?(s=(e*l-1)*Math.pow(2,i),a+=p):(s=e*Math.pow(2,p-1)*Math.pow(2,i),a=0));i>=8;t[r+f]=255&s,f+=d,s/=256,i-=8);for(a=a<0;t[r+f]=255&a,f+=d,a/=256,u-=8);t[r+f-d]|=128*m}},{}],24:[function(t,e,r){"use strict";function n(t,e,r,n,o){return new i(t,e,r,n,o)}function i(t,e,r,n,i){e=e||o,r=r||a,i=i||Array,this.nodeSize=n||64,this.points=t,this.ids=new i(t.length),this.coords=new i(2*t.length);for(var l=0;l=r&&s<=i&&l>=n&&l<=o&&c.push(t[d]);else{var m=Math.floor((f+h)/2);s=e[2*m],l=e[2*m+1],s>=r&&s<=i&&l>=n&&l<=o&&c.push(t[m]);var v=(p+1)%2;(0===p?r<=s:n<=l)&&(u.push(f),u.push(m-1),u.push(v)),(0===p?i>=s:o>=l)&&(u.push(m+1),u.push(h),u.push(v))}}return c}e.exports=n},{}],26:[function(t,e,r){"use strict";function n(t,e,r,o,a,s){if(!(a-o<=r)){var l=Math.floor((o+a)/2);i(t,e,l,o,a,s%2),n(t,e,r,o,l-1,s+1),n(t,e,r,l+1,a,s+1)}}function i(t,e,r,n,a,s){for(;a>n;){if(a-n>600){var l=a-n+1,u=r-n+1,c=Math.log(l),p=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*p*(l-p)/l)*(u-l/2<0?-1:1);i(t,e,r,Math.max(n,Math.floor(r-u*p/l+h)),Math.min(a,Math.floor(r+(l-u)*p/l+h)),s)}var f=e[2*r+s],d=n,m=a;for(o(t,e,n,r),e[2*a+s]>f&&o(t,e,n,a);df;)m--}e[2*n+s]===f?o(t,e,n,m):(m++,o(t,e,m,a)),m<=r&&(n=m+1),r<=m&&(a=m-1)}}function o(t,e,r,n){a(t,r,n),a(e,2*r,2*n),a(e,2*r+1,2*n+1)}function a(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}e.exports=n},{}],27:[function(t,e,r){"use strict";function n(t,e,r,n,o,a){for(var s=[0,t.length-1,0],l=[],u=o*o;s.length;){var c=s.pop(),p=s.pop(),h=s.pop();if(p-h<=a)for(var f=h;f<=p;f++)i(e[2*f],e[2*f+1],r,n)<=u&&l.push(t[f]);else{var d=Math.floor((h+p)/2),m=e[2*d],v=e[2*d+1];i(m,v,r,n)<=u&&l.push(t[d]);var y=(c+1)%2;(0===c?r-o<=m:n-o<=v)&&(s.push(h),s.push(d-1),s.push(y)),(0===c?r+o>=m:n+o>=v)&&(s.push(d+1),s.push(p),s.push(y))}}return l}function i(t,e,r,n){var i=t-r,o=e-n;return i*i+o*o}e.exports=n},{}],28:[function(t,e,r){"use strict";function n(t){return!!(i()&&o()&&a()&&s()&&l()&&u()&&c()&&p(t&&t.failIfMajorPerformanceCaveat))}function i(){return"undefined"!=typeof window&&"undefined"!=typeof document}function o(){return Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray}function a(){return Function.prototype&&Function.prototype.bind}function s(){return Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions}function l(){return"JSON"in window&&"parse"in JSON&&"stringify"in JSON}function u(){return"Worker"in window}function c(){return"Uint8ClampedArray"in window}function p(t){return void 0===f[t]&&(f[t]=h(t)),f[t]}function h(t){var e=document.createElement("canvas"),r=Object.create(n.webGLContextAttributes);return r.failIfMajorPerformanceCaveat=t,e.probablySupportsContext?e.probablySupportsContext("webgl",r)||e.probablySupportsContext("experimental-webgl",r):e.supportsContext?e.supportsContext("webgl",r)||e.supportsContext("experimental-webgl",r):e.getContext("webgl",r)||e.getContext("experimental-webgl",r)}"undefined"!=typeof e&&e.exports?e.exports=n:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=n);var f={};n.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}},{}],29:[function(t,e,r){"use strict";function n(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}function i(t,e,r){var n,i,o=r.buf;if(i=o[r.pos++],n=(112&i)>>4,i<128)return a(t,n,e);if(i=o[r.pos++],n|=(127&i)<<3,i<128)return a(t,n,e);if(i=o[r.pos++],n|=(127&i)<<10,i<128)return a(t,n,e);if(i=o[r.pos++],n|=(127&i)<<17,i<128)return a(t,n,e);if(i=o[r.pos++],n|=(127&i)<<24,i<128)return a(t,n,e);if(i=o[r.pos++],n|=(1&i)<<31,i<128)return a(t,n,e);throw new Error("Expected varint not more than 10 bytes")}function o(t){return t.type===n.Bytes?t.readVarint()+t.pos:t.pos+1}function a(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function s(t,e){var r,n;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(r=~(-t%4294967296),n=~(-t/4294967296),4294967295^r?r=r+1|0:(r=0,n=n+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),l(r,n,e),u(n,e)}function l(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}function u(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}function c(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.ceil(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function p(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function w(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function T(t,e,r){for(var n="",i=e;i239?4:o>223?3:o>191?2:1;if(i+s>r)break;var l,u,c;1===s?o<128&&(a=o):2===s?128==(192&(l=t[i+1]))&&(a=(31&o)<<6|63&l)<=127&&(a=null):3===s?(l=t[i+1],u=t[i+2],128==(192&l)&&128==(192&u)&&((a=(15&o)<<12|(63&l)<<6|63&u)<=2047||a>=55296&&a<=57343)&&(a=null)):4===s&&(l=t[i+1],u=t[i+2],c=t[i+3],128==(192&l)&&128==(192&u)&&128==(192&c)&&((a=(15&o)<<18|(63&l)<<12|(63&u)<<6|63&c)<=65535||a>=1114112)&&(a=null)),null===a?(a=65533,s=1):a>65535&&(a-=65536,n+=String.fromCharCode(a>>>10&1023|55296),a=56320|1023&a),n+=String.fromCharCode(a),i+=s}return n}function S(t,e,r){for(var n,i,o=0;o55295&&n<57344){if(!i){n>56319||o+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}e.exports=n;var z=t("ieee754");n.Varint=0,n.Fixed64=1,n.Bytes=2,n.Fixed32=5;n.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos>3,o=this.pos;this.type=7&n,t(i,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=x(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=w(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=x(this.buf,this.pos)+4294967296*x(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=x(this.buf,this.pos)+4294967296*w(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=z.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=z.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return r=n[this.pos++],e=127&r,r<128?e:(r=n[this.pos++],e|=(127&r)<<7,r<128?e:(r=n[this.pos++],e|=(127&r)<<14,r<128?e:(r=n[this.pos++],e|=(127&r)<<21,r<128?e:(r=n[this.pos],e|=(15&r)<<28,i(e,t,this)))))},readVarint64:function(){return this.readVarint(!0)},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=T(this.buf,this.pos,t);return this.pos=t,e},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){var r=o(this);for(t=t||[];this.pos127;);else if(e===n.Bytes)this.pos=this.readVarint()+this.pos;else if(e===n.Fixed32)this.pos+=4;else{if(e!==n.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e268435455||t<0)return void s(t,this);this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127)))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=S(this.buf,t,this.pos);var r=this.pos-e;r>=128&&c(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),z.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),z.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&c(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,n.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){this.writeMessage(t,p,e)},writePackedSVarint:function(t,e){this.writeMessage(t,h,e)},writePackedBoolean:function(t,e){this.writeMessage(t,m,e)},writePackedFloat:function(t,e){this.writeMessage(t,f,e)},writePackedDouble:function(t,e){this.writeMessage(t,d,e)},writePackedFixed32:function(t,e){this.writeMessage(t,v,e)},writePackedSFixed32:function(t,e){this.writeMessage(t,y,e)},writePackedFixed64:function(t,e){this.writeMessage(t,g,e)},writePackedSFixed64:function(t,e){this.writeMessage(t,_,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))}}},{ieee754:23}],30:[function(t,e,r){function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function o(t){if(p===setTimeout)return setTimeout(t,0);if((p===n||!p)&&setTimeout)return p=setTimeout,setTimeout(t,0);try{return p(t,0)}catch(e){try{return p.call(null,t,0)}catch(e){return p.call(this,t,0)}}}function a(t){if(h===clearTimeout)return clearTimeout(t);if((h===i||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(t);try{return h(t)}catch(e){try{return h.call(null,t)}catch(e){return h.call(this,t)}}}function s(){v&&d&&(v=!1,d.length?m=d.concat(m):y=-1,m.length&&l())}function l(){if(!v){var t=o(s);v=!0;for(var e=m.length;e;){for(d=m,m=[];++y1)for(var r=1;rr;){if(a-r>600){var l=a-r+1,u=e-r+1,c=Math.log(l),p=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*p*(l-p)/l)*(u-l/2<0?-1:1);n(t,e,Math.max(r,Math.floor(e-u*p/l+h)),Math.min(a,Math.floor(e+(l-u)*p/l+h)),s)}var f=t[e],d=r,m=a;for(i(t,r,e),s(t[a],f)>0&&i(t,r,a);d0;)m--}0===s(t[r],f)?i(t,r,m):(m++,i(t,m,a)),m<=e&&(r=m+1),e<=m&&(a=m-1)}}function i(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function o(t,e){return te?1:0}e.exports=n},{}],32:[function(t,e,r){"use strict";function n(t){return new i(t)}function i(t){this.options=f(Object.create(this.options),t),this.trees=new Array(this.options.maxZoom+1)}function o(t,e,r,n,i){return{x:t,y:e,zoom:1/0,id:n,properties:i,parentId:-1,numPoints:r}}function a(t,e){var r=t.geometry.coordinates;return{x:u(r[0]),y:c(r[1]),zoom:1/0,id:e,parentId:-1}}function s(t){return{type:"Feature",properties:l(t),geometry:{type:"Point",coordinates:[p(t.x),h(t.y)]}}}function l(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return f(f({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function u(t){return t/360+.5}function c(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function p(t){return 360*(t-.5)}function h(t){var e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function f(t,e){for(var r in e)t[r]=e[r];return t}function d(t){return t.x}function m(t){return t.y}var v=t("kdbush");e.exports=n,i.prototype={options:{minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,reduce:null,initial:function(){return{}},map:function(t){return t}},load:function(t){var e=this.options.log;e&&console.time("total time");var r="prepare "+t.length+" points";e&&console.time(r),this.points=t;var n=t.map(a);e&&console.timeEnd(r);for(var i=this.options.maxZoom;i>=this.options.minZoom;i--){var o=+Date.now();this.trees[i+1]=v(n,d,m,this.options.nodeSize,Float32Array),n=this._cluster(n,i),e&&console.log("z%d: %d clusters in %dms",i,n.length,+Date.now()-o)}return this.trees[this.options.minZoom]=v(n,d,m,this.options.nodeSize,Float32Array),e&&console.timeEnd("total time"),this},getClusters:function(t,e){for(var r=this.trees[this._limitZoom(e)],n=r.range(u(t[0]),c(t[3]),u(t[2]),c(t[1])),i=[],o=0;o0)for(var r=this.length>>1;r>=0;r--)this._down(r)}function i(t,e){return te?1:0}e.exports=n,n.prototype={push:function(t){this.data.push(t),this.length++,this._up(this.length-1)},pop:function(){if(0!==this.length){var t=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),t}},peek:function(){return this.data[0]},_up:function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var i=t-1>>1,o=e[i];if(r(n,o)>=0)break;e[t]=o,t=i}e[t]=n},_down:function(t){for(var e=this.data,r=this.compare,n=this.length,i=n>>1,o=e[t];t=0)break;e[t]=l,t=a}e[t]=o}}},{}],34:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],35:[function(t,e,r){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],36:[function(t,r,n){(function(e,r){function i(t,e){var r={seen:[],stylize:a};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),m(e)?r.showHidden=e:e&&n._extend(r,e),b(r.showHidden)&&(r.showHidden=!1),b(r.depth)&&(r.depth=2),b(r.colors)&&(r.colors=!1),b(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=o),l(r,t,r.depth)}function o(t,e){var r=i.styles[e];return r?"["+i.colors[r][0]+"m"+t+"["+i.colors[r][1]+"m":t}function a(t,e){return t}function s(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}function l(t,e,r){if(t.customInspect&&e&&A(e.inspect)&&e.inspect!==n.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(r,t);return _(i)||(i=l(t,i,r)),i}var o=u(t,e);if(o)return o;var a=Object.keys(e),m=s(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(e)),z(e)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return c(e);if(0===a.length){if(A(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(z(e))return c(e)}var y="",g=!1,x=["{","}"];if(d(e)&&(g=!0,x=["[","]"]),A(e)&&(y=" [Function"+(e.name?": "+e.name:"")+"]"),w(e)&&(y=" "+RegExp.prototype.toString.call(e)),S(e)&&(y=" "+Date.prototype.toUTCString.call(e)),z(e)&&(y=" "+c(e)),0===a.length&&(!g||0==e.length))return x[0]+y+x[1];if(r<0)return w(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var b;return b=g?p(t,e,r,m,a):a.map(function(n){return h(t,e,r,m,n,g)}),t.seen.pop(),f(b,y,x)}function u(t,e){if(b(e))return t.stylize("undefined","undefined");if(_(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return g(e)?t.stylize(""+e,"number"):m(e)?t.stylize(""+e,"boolean"):v(e)?t.stylize("null","null"):void 0}function c(t){return"["+Error.prototype.toString.call(t)+"]"}function p(t,e,r,n,i){for(var o=[],a=0,s=e.length;a-1&&(s=o?s.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+s.split("\n").map(function(t){return" "+t}).join("\n"))):s=t.stylize("[Circular]","special")),b(a)){if(o&&i.match(/^\d+$/))return s;a=JSON.stringify(""+i),a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function f(t,e,r){var n=0;return t.reduce(function(t,e){return n++,e.indexOf("\n")>=0&&n++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}function d(t){return Array.isArray(t)}function m(t){return"boolean"==typeof t}function v(t){return null===t}function y(t){return null==t}function g(t){return"number"==typeof t}function _(t){return"string"==typeof t}function x(t){return"symbol"==typeof t}function b(t){return void 0===t}function w(t){return T(t)&&"[object RegExp]"===E(t)}function T(t){return"object"==typeof t&&null!==t}function S(t){return T(t)&&"[object Date]"===E(t)}function z(t){return T(t)&&("[object Error]"===E(t)||t instanceof Error)}function A(t){return"function"==typeof t}function C(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t}function E(t){return Object.prototype.toString.call(t)}function k(t){return t<10?"0"+t.toString(10):t.toString(10)}function M(){var t=new Date,e=[k(t.getHours()),k(t.getMinutes()),k(t.getSeconds())].join(":");return[t.getDate(),D[t.getMonth()],e].join(" ")}function L(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var I=/%[sdj%]/g;n.format=function(t){if(!_(t)){for(var e=[],r=0;r=o)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}),s=n[r];r>31}function p(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,o=0,a=r.length,s=0;s=d||p<0||p>=d)){var h=r.segments.prepareSegment(4,r.layoutVertexArray,r.indexArray),f=h.vertexLength;n(r.layoutVertexArray,c,p,-1,-1),n(r.layoutVertexArray,c,p,1,-1),n(r.layoutVertexArray,c,p,1,1),n(r.layoutVertexArray,c,p,-1,1),r.indexArray.emplaceBack(f,f+1,f+2),r.indexArray.emplaceBack(f,f+3,f+2),h.vertexLength+=4,h.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t.properties)},y.programInterface=m,e.exports=y},{"../../gl/index_buffer":61,"../../gl/vertex_buffer":62,"../extent":48,"../index_array_type":50,"../load_geometry":51,"../program_configuration":53,"../segment":55,"../vertex_array_type":56}],44:[function(t,e,r){"use strict";var n=t("../segment"),i=n.SegmentVector,o=t("../../gl/vertex_buffer"),a=t("../../gl/index_buffer"),s=t("../program_configuration"),l=s.ProgramConfigurationSet,u=t("../vertex_array_type"),c=t("../index_array_type"),p=c.LineIndexArray,h=c.TriangleIndexArray,f=t("../load_geometry"),d=t("earcut"),m=t("../../util/classify_rings"),v={layoutAttributes:[{name:"a_pos",components:2,type:"Int16"}],indexArrayType:h,indexArrayType2:p,paintAttributes:[{property:"fill-color"},{property:"fill-outline-color"},{property:"fill-opacity"}]},y=u(v.layoutAttributes),g=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.index=t.index,this.layoutVertexArray=new y(t.layoutVertexArray),this.indexArray=new h(t.indexArray),this.indexArray2=new p(t.indexArray2),this.programConfigurations=new l(v,t.layers,t.zoom,t.programConfigurations),this.segments=new i(t.segments),this.segments2=new i(t.segments2)};g.prototype.populate=function(t,e){for(var r=this,n=0,i=t;nv)||t.y===e.y&&(t.y<0||t.y>v)}var o=t("../segment"),a=o.SegmentVector,s=o.MAX_VERTEX_ARRAY_LENGTH,l=t("../../gl/vertex_buffer"),u=t("../../gl/index_buffer"),c=t("../program_configuration"),p=c.ProgramConfigurationSet,h=t("../vertex_array_type"),f=t("../index_array_type"),d=f.TriangleIndexArray,m=t("../load_geometry"),v=t("../extent"),y=t("earcut"),g=t("../../util/classify_rings"),_={layoutAttributes:[{name:"a_pos",components:2,type:"Int16"},{name:"a_normal",components:3,type:"Int16"},{name:"a_edgedistance",components:1,type:"Int16"}],indexArrayType:d,paintAttributes:[{property:"fill-extrusion-base"},{property:"fill-extrusion-height"},{property:"fill-extrusion-color"}]},x=Math.pow(2,13),b=h(_.layoutAttributes),w=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.index=t.index,this.layoutVertexArray=new b(t.layoutVertexArray),this.indexArray=new d(t.indexArray),this.programConfigurations=new p(_,t.layers,t.zoom,t.programConfigurations),this.segments=new a(t.segments)};w.prototype.populate=function(t,e){for(var r=this,n=0,i=t;n=1){var b=m[_-1];if(!i(x,b)){h.vertexLength+4>s&&(h=r.segments.prepareSegment(4,r.layoutVertexArray,r.indexArray));var w=x.sub(b)._perp()._unit();n(r.layoutVertexArray,x.x,x.y,w.x,w.y,0,0,v),n(r.layoutVertexArray,x.x,x.y,w.x,w.y,0,1,v),v+=b.dist(x),n(r.layoutVertexArray,b.x,b.y,w.x,w.y,0,0,v),n(r.layoutVertexArray,b.x,b.y,w.x,w.y,0,1,v);var T=h.vertexLength;r.indexArray.emplaceBack(T,T+1,T+2),r.indexArray.emplaceBack(T+1,T+2,T+3),h.vertexLength+=4,h.primitiveLength+=2}}}}h.vertexLength+u>s&&(h=r.segments.prepareSegment(u,r.layoutVertexArray,r.indexArray));for(var S=[],z=[],A=h.vertexLength,C=0,E=l;C>6)}var i=t("../segment"),o=i.SegmentVector,a=t("../../gl/vertex_buffer"),s=t("../../gl/index_buffer"),l=t("../program_configuration"),u=l.ProgramConfigurationSet,c=t("../vertex_array_type"),p=t("../index_array_type"),h=p.TriangleIndexArray,f=t("../load_geometry"),d=t("../extent"),m=t("@mapbox/vector-tile").VectorTileFeature.types,v=63,y=Math.cos(Math.PI/180*37.5),g=.5,_=Math.pow(2,14)/g,x={layoutAttributes:[{name:"a_pos_normal",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],paintAttributes:[{property:"line-color"},{property:"line-blur"},{property:"line-opacity"},{property:"line-gap-width",name:"gapwidth"},{property:"line-offset"},{property:"line-width"},{property:"line-width",name:"floorwidth",useIntegerZoom:!0}],indexArrayType:h},b=c(x.layoutAttributes),w=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.index=t.index,this.layoutVertexArray=new b(t.layoutVertexArray),this.indexArray=new h(t.indexArray),this.programConfigurations=new u(x,t.layers,t.zoom,t.programConfigurations),this.segments=new o(t.segments)};w.prototype.populate=function(t,e){for(var r=this,n=0,i=t;n=2&&t[u-1].equals(t[u-2]);)u--;for(var c=0;cc){var I=v.dist(T);if(I>2*p){var P=v.sub(v.sub(T)._mult(p/I)._round());a.distance+=P.dist(T),a.addCurrentVertex(P,a.distance,z.mult(1),0,0,!1,f),T=P}}var R=T&&S,D=R?r:S?x:b;if(R&&"round"===D&&(Mi&&(D="bevel"),"bevel"===D&&(M>2&&(D="flipbevel"),M100)E=A.clone().mult(-1);else{var O=z.x*A.y-z.y*A.x>0?-1:1,B=M*z.add(A).mag()/z.sub(A).mag();E._perp()._mult(B*O)}a.addCurrentVertex(v,a.distance,E,0,0,!1,f),a.addCurrentVertex(v,a.distance,E.mult(-1),0,0,!1,f)}else if("bevel"===D||"fakeround"===D){var F=z.x*A.y-z.y*A.x>0,j=-Math.sqrt(M*M-1);if(F?(_=0,g=j):(g=0,_=j),w||a.addCurrentVertex(v,a.distance,z,g,_,!1,f),"fakeround"===D){for(var V=Math.floor(8*(.5-(k-.5))),N=void 0,U=0;U=0;$--)N=z.mult(($+1)/(V+1))._add(A)._unit(),a.addPieSliceVertex(v,a.distance,N,F,f)}S&&a.addCurrentVertex(v,a.distance,A,-g,-_,!1,f)}else"butt"===D?(w||a.addCurrentVertex(v,a.distance,z,0,0,!1,f),S&&a.addCurrentVertex(v,a.distance,A,0,0,!1,f)):"square"===D?(w||(a.addCurrentVertex(v,a.distance,z,1,1,!1,f),a.e1=a.e2=-1),S&&a.addCurrentVertex(v,a.distance,A,-1,-1,!1,f)):"round"===D&&(w||(a.addCurrentVertex(v,a.distance,z,0,0,!1,f),a.addCurrentVertex(v,a.distance,z,1,1,!0,f),a.e1=a.e2=-1),S&&(a.addCurrentVertex(v,a.distance,A,-1,-1,!0,f),a.addCurrentVertex(v,a.distance,A,0,0,!1,f)));if(L&&C2*p){var Z=v.add(S.sub(v)._mult(p/q)._round());a.distance+=Z.dist(v),a.addCurrentVertex(Z,a.distance,A.mult(1),0,0,!1,f),v=Z}}w=!1}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,s)}},w.prototype.addCurrentVertex=function(t,e,r,i,o,a,s){var l,u=this.layoutVertexArray,c=this.indexArray;l=r.clone(),i&&l._sub(r.perp()._mult(i)),n(u,t,l,a,!1,i,e),this.e3=s.vertexLength++,this.e1>=0&&this.e2>=0&&(c.emplaceBack(this.e1,this.e2,this.e3),s.primitiveLength++),this.e1=this.e2,this.e2=this.e3,l=r.mult(-1),o&&l._sub(r.perp()._mult(o)),n(u,t,l,a,!0,-o,e),this.e3=s.vertexLength++,this.e1>=0&&this.e2>=0&&(c.emplaceBack(this.e1,this.e2,this.e3),s.primitiveLength++),this.e1=this.e2,this.e2=this.e3,e>_/2&&(this.distance=0,this.addCurrentVertex(t,this.distance,r,i,o,a,s))},w.prototype.addPieSliceVertex=function(t,e,r,i,o){r=r.mult(i?-1:1);var a=this.layoutVertexArray,s=this.indexArray;n(a,t,r,!1,i,0,e),this.e3=o.vertexLength++,this.e1>=0&&this.e2>=0&&(s.emplaceBack(this.e1,this.e2,this.e3),o.primitiveLength++),i?this.e2=this.e3:this.e1=this.e3},w.programInterface=x,e.exports=w},{"../../gl/index_buffer":61,"../../gl/vertex_buffer":62,"../extent":48,"../index_array_type":50,"../load_geometry":51,"../program_configuration":53,"../segment":55,"../vertex_array_type":56,"@mapbox/vector-tile":6}],47:[function(t,e,r){"use strict";function n(t,e,r,n,i,o,a,s){t.emplaceBack(e,r,Math.round(64*n),Math.round(64*i),o,a,s?s[0]:void 0,s?s[1]:void 0)}function i(t,e,r,n){var i=2*Math.PI,o=b((r+i)%i/i*255,10*n);t.emplaceBack(e.x,e.y,o),t.emplaceBack(e.x,e.y,o),t.emplaceBack(e.x,e.y,o),t.emplaceBack(e.x,e.y,o)}function o(t,e,r,n,i,o){return t.emplaceBack(e.x,e.y,r.x,r.y,Math.round(n.x),Math.round(n.y),10*i,10*o)}function a(t,e,r){var n={};if(n.isFeatureConstant=e.isLayoutValueFeatureConstant(r),n.isZoomConstant=e.isLayoutValueZoomConstant(r),n.isFeatureConstant&&(n.layoutSize=e.getLayoutValue(r,{zoom:t+1})),!n.isZoomConstant){for(var i=e.getLayoutValueStopZoomLevels(r),o=0;o_||a.y<0||a.y>_);if(!v||u){var c=u||z;i.addSymbolInstance(a,o,e,r,i.layers[0],c,i.collisionBoxArray,t.index,t.sourceLayerIndex,i.index,h,y,b,s,d,g,S,l,{zoom:i.zoom},t.properties,n)}};if("line"===A)for(var k=0,M=R(t.geometry,0,0,_,_);k=0;o--)if(r.dist(i[o])1*Math.PI/4&&T<=3*Math.PI/4||T>5*Math.PI/4&&T<=7*Math.PI/4,z=Boolean(p&L.vertical)&&S,A=0,C=e;AJ.MAX_INSTANCES&&D.warnOnce("Too many symbols being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),P>J.MAX_INSTANCES&&D.warnOnce("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907");var R=(r[L.vertical]?L.vertical:0)|(r[L.horizontal]?L.horizontal:0);this.symbolInstances.push({textBoxStartIndex:k,textBoxEndIndex:M,iconBoxStartIndex:I,iconBoxEndIndex:P,glyphQuads:S,iconQuads:T,textOffset:f,iconOffset:y,anchor:t,line:e,featureIndex:s,featureProperties:_,writingModes:R})},J.programInterfaces=X,J.MAX_INSTANCES=65535,J.addDynamicAttributes=i,e.exports=J},{"../../gl/index_buffer":61,"../../gl/vertex_buffer":62,"../../shaders/encode_attribute":85,"../../symbol/anchor":167,"../../symbol/clip_line":169,"../../symbol/collision_feature":171,"../../symbol/get_anchors":173,"../../symbol/mergelines":174,"../../symbol/quads":176,"../../symbol/shaping":177,"../../symbol/transform_text":179,"../../util/classify_rings":205,"../../util/find_pole_of_inaccessibility":211,"../../util/script_detection":218,"../../util/struct_array":220,"../../util/token":222,"../../util/util":223,"../../util/verticalize_punctuation":225,"../extent":48,"../index_array_type":50,"../load_geometry":51,"../program_configuration":53,"../segment":55,"../vertex_array_type":56,"@mapbox/point-geometry":2,"@mapbox/vector-tile":6}],48:[function(t,e,r){"use strict";e.exports=8192},{}],49:[function(t,e,r){"use strict";function n(t,e){return e-t}var i=(t("@mapbox/point-geometry"),t("./load_geometry")),o=t("./extent"),a=t("../style-spec/feature_filter"),s=t("../util/struct_array"),l=t("grid-index"),u=t("../util/dictionary_coder"),c=t("@mapbox/vector-tile"),p=t("pbf"),h=t("../util/vectortile_to_geojson"),f=t("../util/util").arraysIntersect,d=s({members:[{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]}),m=function(t,e,r,n){this.coord=t,this.overscaling=e,this.x=t.x,this.y=t.y,this.z=t.z-Math.log(e)/Math.LN2,this.grid=r||new l(o,16,0),this.featureIndexArray=n||new d};m.deserialize=function(t,e,r){var n=new m(t.coord,t.overscaling,new l(t.grid),new d(t.featureIndexArray));return n.rawTileData=e,n.bucketLayerIDs=t.bucketLayerIDs,n.setCollisionTile(r),n},m.prototype.insert=function(t,e,r,n,i){var o=this,a=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,n,i);for(var s=0;so.max||u.yo.max)&&n.warnOnce("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}},{"../util/util":223,"./extent":48}],52:[function(t,e,r){"use strict";var n=t("../util/struct_array"),i=n({members:[{name:"a_pos",type:"Int16",components:2}]});e.exports=i},{"../util/struct_array":220}],53:[function(t,e,r){"use strict";function n(t){return[a(255*t[0],255*t[1]),a(255*t[2],255*t[3])]}var i=t("./vertex_array_type"),o=t("../style-spec/function").interpolationFactor,a=t("../shaders/encode_attribute").packUint8ToFloat,s=t("../gl/vertex_buffer"),l=function(t,e,r,n){this.name=t,this.type=e,this.property=r,this.useIntegerZoom=n};l.prototype.defines=function(){return["#define HAS_UNIFORM_u_"+this.name]},l.prototype.populatePaintArray=function(){},l.prototype.setUniforms=function(t,e,r,n){var i=n.zoom,o=r.getPaintValue(this.property,{zoom:this.useIntegerZoom?Math.floor(i):i});"color"===this.type?t.uniform4fv(e.uniforms["u_"+this.name],o):t.uniform1f(e.uniforms["u_"+this.name],o)};var u=function(t,e,r){this.name=t,this.type=e,this.property=r};u.prototype.defines=function(){return[]},u.prototype.populatePaintArray=function(t,e,r,i,o,a){var s=this,l=t.getPaintValue(this.property,void 0,a);if("color"===this.type)for(var u=n(l),c=i;co&&i("Max vertices per segment is "+o+": bucket requested "+t),(!a||a.vertexLength+t>e.exports.MAX_VERTEX_ARRAY_LENGTH)&&(a={vertexOffset:r.length,primitiveOffset:n.length,vertexLength:0,primitiveLength:0},this.segments.push(a)),a},a.prototype.get=function(){return this.segments},a.prototype.destroy=function(){for(var t=this,e=0,r=t.segments;e90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};i.prototype.wrap=function(){return new i(n(this.lng,-180,180),this.lat)},i.prototype.toArray=function(){return[this.lng,this.lat]},i.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},i.prototype.toBounds=function(e){var r=360*e/40075017,n=r/Math.cos(Math.PI/180*this.lat);return new(t("./lng_lat_bounds"))(new i(this.lng-n,this.lat-r),new i(this.lng+n,this.lat+r))},i.convert=function(t){if(t instanceof i)return t;if(Array.isArray(t)&&2===t.length)return new i(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new i(Number(t.lng),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, or an array of [, ]")},e.exports=i},{"../util/util":223,"./lng_lat_bounds":59}],59:[function(t,e,r){"use strict";var n=t("./lng_lat"),i=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};i.prototype.setNorthEast=function(t){return this._ne=t instanceof n?new n(t.lng,t.lat):n.convert(t),this},i.prototype.setSouthWest=function(t){return this._sw=t instanceof n?new n(t.lng,t.lat):n.convert(t),this},i.prototype.extend=function(t){var e,r,o=this._sw,a=this._ne;if(t instanceof n)e=t,r=t;else{if(!(t instanceof i))return Array.isArray(t)?t.every(Array.isArray)?this.extend(i.convert(t)):this.extend(n.convert(t)):this;if(e=t._sw,r=t._ne,!e||!r)return this}return o||a?(o.lng=Math.min(e.lng,o.lng),o.lat=Math.min(e.lat,o.lat),a.lng=Math.max(r.lng,a.lng),a.lat=Math.max(r.lat,a.lat)):(this._sw=new n(e.lng,e.lat),this._ne=new n(r.lng,r.lat)),this},i.prototype.getCenter=function(){return new n((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},i.prototype.getSouthWest=function(){return this._sw},i.prototype.getNorthEast=function(){return this._ne},i.prototype.getNorthWest=function(){return new n(this.getWest(),this.getNorth())},i.prototype.getSouthEast=function(){return new n(this.getEast(),this.getSouth())},i.prototype.getWest=function(){return this._sw.lng},i.prototype.getSouth=function(){return this._sw.lat},i.prototype.getEast=function(){return this._ne.lng},i.prototype.getNorth=function(){return this._ne.lat},i.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},i.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},i.convert=function(t){return!t||t instanceof i?t:new i(t)},e.exports=i},{"./lng_lat":58}],60:[function(t,e,r){"use strict";var n=t("./lng_lat"),i=t("@mapbox/point-geometry"),o=t("./coordinate"),a=t("../util/util"),s=t("../style-spec/util/interpolate"),l=t("../source/tile_coord"),u=t("../data/extent"),c=t("@mapbox/gl-matrix"),p=c.vec4,h=c.mat4,f=c.mat2,d=function(t,e,r){this.tileSize=512,this._renderWorldCopies=void 0===r||r,this._minZoom=t||0,this._maxZoom=e||22,this.latRange=[-85.05113,85.05113],this.width=0,this.height=0,this._center=new n(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0},m={minZoom:{},maxZoom:{},renderWorldCopies:{},worldSize:{},centerPoint:{},size:{},bearing:{},pitch:{},fov:{},zoom:{},center:{},unmodified:{},x:{},y:{},point:{}};m.minZoom.get=function(){return this._minZoom},m.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},m.maxZoom.get=function(){return this._maxZoom},m.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},m.renderWorldCopies.get=function(){return this._renderWorldCopies},m.worldSize.get=function(){return this.tileSize*this.scale},m.centerPoint.get=function(){return this.size._div(2)},m.size.get=function(){return new i(this.width,this.height)},m.bearing.get=function(){return-this.angle/Math.PI*180},m.bearing.set=function(t){var e=-a.wrap(t,-180,180)*Math.PI/180;this.angle!==e&&(this._unmodified=!1,this.angle=e,this._calcMatrices(),this.rotationMatrix=f.create(),f.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},m.pitch.get=function(){return this._pitch/Math.PI*180},m.pitch.set=function(t){var e=a.clamp(t,0,60)/180*Math.PI;this._pitch!==e&&(this._unmodified=!1,this._pitch=e,this._calcMatrices())},m.fov.get=function(){return this._fov/Math.PI*180},m.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())},m.zoom.get=function(){return this._zoom},m.zoom.set=function(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._constrain(),this._calcMatrices())},m.center.get=function(){return this._center},m.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},d.prototype.coveringZoomLevel=function(t){return(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},d.prototype.getVisibleWrappedCoordinates=function(t){for(var e=this.pointCoordinate(new i(0,0),0),r=this.pointCoordinate(new i(this.width,0),0),n=Math.floor(e.column),o=Math.floor(r.column),a=[t],s=n;s<=o;s++)0!==s&&a.push(new l(t.z,t.x,t.y,s));return a},d.prototype.coveringTiles=function(t){var e=this.coveringZoomLevel(t),r=e;if(void 0!==t.minzoom&&et.maxzoom&&(e=t.maxzoom);var n=this.pointCoordinate(this.centerPoint,e),o=new i(n.column-.5,n.row-.5),a=[this.pointCoordinate(new i(0,0),e),this.pointCoordinate(new i(this.width,0),e),this.pointCoordinate(new i(this.width,this.height),e),this.pointCoordinate(new i(0,this.height),e)];return l.cover(e,a,t.reparseOverscaled?r:e,this._renderWorldCopies).sort(function(t,e){return o.dist(t)-o.dist(e)})},d.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},m.unmodified.get=function(){return this._unmodified},d.prototype.zoomScale=function(t){return Math.pow(2,t)},d.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},d.prototype.project=function(t){return new i(this.lngX(t.lng),this.latY(t.lat))},d.prototype.unproject=function(t){return new n(this.xLng(t.x),this.yLat(t.y))},m.x.get=function(){return this.lngX(this.center.lng)},m.y.get=function(){return this.latY(this.center.lat)},m.point.get=function(){return new i(this.x,this.y)},d.prototype.lngX=function(t){return(180+t)*this.worldSize/360},d.prototype.latY=function(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))*this.worldSize/360},d.prototype.xLng=function(t){return 360*t/this.worldSize-180},d.prototype.yLat=function(t){var e=180-360*t/this.worldSize;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90},d.prototype.setLocationAtPoint=function(t,e){var r=this.pointCoordinate(e)._sub(this.pointCoordinate(this.centerPoint));this.center=this.coordinateLocation(this.locationCoordinate(t)._sub(r)),this._renderWorldCopies&&(this.center=this.center.wrap())},d.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},d.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},d.prototype.locationCoordinate=function(t){return new o(this.lngX(t.lng)/this.tileSize,this.latY(t.lat)/this.tileSize,this.zoom).zoomTo(this.tileZoom)},d.prototype.coordinateLocation=function(t){var e=t.zoomTo(this.zoom);return new n(this.xLng(e.column*this.tileSize),this.yLat(e.row*this.tileSize))},d.prototype.pointCoordinate=function(t,e){void 0===e&&(e=this.tileZoom);var r=[t.x,t.y,0,1],n=[t.x,t.y,1,1];p.transformMat4(r,r,this.pixelMatrixInverse),p.transformMat4(n,n,this.pixelMatrixInverse);var i=r[3],a=n[3],l=r[0]/i,u=n[0]/a,c=r[1]/i,h=n[1]/a,f=r[2]/i,d=n[2]/a,m=f===d?0:(0-f)/(d-f);return new o(s(l,u,m)/this.tileSize,s(c,h,m)/this.tileSize,this.zoom)._zoomTo(e)},d.prototype.coordinatePoint=function(t){var e=t.zoomTo(this.zoom),r=[e.column*this.tileSize,e.row*this.tileSize,0,1];return p.transformMat4(r,r,this.pixelMatrix),new i(r[0]/r[3],r[1]/r[3])},d.prototype.calculatePosMatrix=function(t,e){var r=t.toCoordinate(e),n=this.worldSize/this.zoomScale(r.zoom),i=h.identity(new Float64Array(16));return h.translate(i,i,[r.column*n,r.row*n,0]),h.scale(i,i,[n/u,n/u,1]),h.multiply(i,this.projMatrix,i),new Float32Array(i)},d.prototype.cameraToTileDistance=function(t){var e=this.calculatePosMatrix(t.coord,t.sourceMaxZoom),r=[t.tileSize/2,t.tileSize/2,0,1];return p.transformMat4(r,r,e),r[3]},d.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,e,r,n,o=-90,a=90,s=-180,l=180,u=this.size,c=this._unmodified;if(this.latRange){var p=this.latRange;o=this.latY(p[1]),a=this.latY(p[0]),t=a-oa&&(n=a-m)}if(this.lngRange){var v=this.x,y=u.x/2;v-yl&&(r=l-y)}void 0===r&&void 0===n||(this.center=this.unproject(new i(void 0!==r?r:this.x,void 0!==n?n:this.y))),this._unmodified=c,this._constraining=!1}},d.prototype._calcMatrices=function(){if(this.height){this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var t=this._fov/2,e=Math.PI/2+this._pitch,r=Math.sin(t)*this.cameraToCenterDistance/Math.sin(Math.PI-e-t),n=Math.cos(Math.PI/2-this._pitch)*r+this.cameraToCenterDistance,i=1.01*n,o=new Float64Array(16);h.perspective(o,this._fov,this.width/this.height,1,i),h.scale(o,o,[1,-1,1]),h.translate(o,o,[0,0,-this.cameraToCenterDistance]),h.rotateX(o,o,this._pitch),h.rotateZ(o,o,this.angle),h.translate(o,o,[-this.x,-this.y,0]);var a=this.worldSize/(2*Math.PI*6378137*Math.abs(Math.cos(this.center.lat*(Math.PI/180))));if(h.scale(o,o,[1,1,a,1]),this.projMatrix=o,o=h.create(),h.scale(o,o,[this.width/2,-this.height/2,1]),h.translate(o,o,[1,-1,0]),this.pixelMatrix=h.multiply(new Float64Array(16),o,this.projMatrix),!(o=h.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=o}},Object.defineProperties(d.prototype,m),e.exports=d},{"../data/extent":48,"../source/tile_coord":101,"../style-spec/util/interpolate":127,"../util/util":223,"./coordinate":57,"./lng_lat":58,"@mapbox/gl-matrix":1,"@mapbox/point-geometry":2}],61:[function(t,e,r){"use strict";var n=function(t,e){this.gl=t,this.buffer=t.createBuffer(),void 0===t.extVertexArrayObject&&(t.extVertexArrayObject=t.getExtension("OES_vertex_array_object")),t.extVertexArrayObject&&t.extVertexArrayObject.bindVertexArrayOES(null),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.buffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,t.STATIC_DRAW),delete e.arrayBuffer};n.prototype.bind=function(){this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,this.buffer)},n.prototype.destroy=function(){this.buffer&&(this.gl.deleteBuffer(this.buffer),delete this.buffer)},e.exports=n},{}],62:[function(t,e,r){"use strict";var n={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},i=function(t,e,r){this.length=e.length,this.attributes=e.members,this.itemSize=e.bytesPerElement,this.dynamicDraw=r,this.gl=t,this.buffer=t.createBuffer(),this.gl.bindBuffer(t.ARRAY_BUFFER,this.buffer),this.gl.bufferData(t.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?t.DYNAMIC_DRAW:t.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};i.prototype.bind=function(){this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.buffer)},i.prototype.updateData=function(t){this.bind(),this.gl.bufferSubData(this.gl.ARRAY_BUFFER,0,t.arrayBuffer)},i.prototype.enableAttributes=function(t,e){for(var r=this,n=0;n":[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]]}},{"../data/extent":48,"../data/pos_array":52,"../gl/vertex_buffer":62,"../util/browser":202,"./vertex_array_object":84,"@mapbox/gl-matrix":1}],68:[function(t,e,r){"use strict";function n(t,e,r,n){var s=t.gl;s.enable(s.STENCIL_TEST);var l=!r.paint["fill-pattern"]&&r.isPaintValueFeatureConstant("fill-color")&&r.isPaintValueFeatureConstant("fill-opacity")&&1===r.paint["fill-color"][3]&&1===r.paint["fill-opacity"]?"opaque":"translucent";t.renderPass===l&&(t.setDepthSublayer(1),t.depthMask("opaque"===t.renderPass),i(t,e,r,n,o)),"translucent"===t.renderPass&&r.paint["fill-antialias"]&&(t.lineWidth(2),t.depthMask(!1),t.setDepthSublayer(r.getPaintProperty("fill-outline-color")?2:0),i(t,e,r,n,a))}function i(t,e,r,n,i){if(!l.isPatternMissing(r.paint["fill-pattern"],t))for(var o=!0,a=0,s=n;a0?1/(1-t):1+t}function a(t){return t>0?1-1/(1.001-t):-t}function s(t,e,r,n,i){var o=n.paint["raster-fade-duration"];if(o>0){var a=Date.now(),s=(a-t.timeAdded)/o,u=e?(a-e.timeAdded)/o:-1,c=r.getSource(),p=i.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),h=!e||Math.abs(e.coord.z-p)>Math.abs(t.coord.z-p),f=h&&t.refreshedUponExpiration?1:l.clamp(h?s:1-u,0,1);return t.refreshedUponExpiration&&s>=1&&(t.refreshedUponExpiration=!1),e?{opacity:1,mix:1-f}:{opacity:f,mix:0}}return{opacity:1,mix:0}}var l=t("../util/util"),u=t("../source/image_source");e.exports=n},{"../source/image_source":91,"../util/util":223}],72:[function(t,e,r){"use strict";function n(t,e,r,n){if("translucent"===t.renderPass){var o=!(r.layout["text-allow-overlap"]||r.layout["icon-allow-overlap"]||r.layout["text-ignore-placement"]||r.layout["icon-ignore-placement"]),a=t.gl;o?a.disable(a.STENCIL_TEST):a.enable(a.STENCIL_TEST),t.setDepthSublayer(0),t.depthMask(!1),i(t,e,r,n,!1,r.paint["icon-translate"],r.paint["icon-translate-anchor"],r.layout["icon-rotation-alignment"],r.layout["icon-pitch-alignment"],r.layout["icon-keep-upright"]),i(t,e,r,n,!0,r.paint["text-translate"],r.paint["text-translate-anchor"],r.layout["text-rotation-alignment"],r.layout["text-pitch-alignment"],r.layout["text-keep-upright"]),e.map.showCollisionBoxes&&l(t,e,r,n)}}function i(t,e,r,n,i,s,l,p,h,d){var m=t.gl,v=t.transform,y="map"===p,g="map"===h,_=y&&"line"===r.layout["symbol-placement"],x=y&&!g&&!_,b=g;b?m.enable(m.DEPTH_TEST):m.disable(m.DEPTH_TEST);for(var w,T=0,S=n;Tthis.previousZoom;i--)n.changeTimes[i]=t,n.changeOpacities[i]=n.opacities[i];for(i=0;i<256;i++){var o=t-n.changeTimes[i],a=255*(r?o/r:1);n.opacities[i]=i<=e?n.changeOpacities[i]+a:n.changeOpacities[i]-a}this.changed=!0,this.previousZoom=e},n.prototype.isVisible=function(t){return 0!==this.opacities[Math.floor(10*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))},e.exports=n},{}],74:[function(t,e,r){"use strict";function n(t){var e=a.create({width:0,height:0}),r={},n=new i(0,0,{autoResize:!0});for(var o in t){var l=t[o],u=r[o]={};for(var c in l){var p=l[+c];if(p&&0!==p.bitmap.width&&0!==p.bitmap.height){var h=n.packOne(p.bitmap.width+2*s,p.bitmap.height+2*s);a.resize(e,{width:n.w,height:n.h}),a.copy(p.bitmap,e,{x:0,y:0},{x:h.x+s,y:h.y+s},p.bitmap),u[c]={rect:h,metrics:p.metrics}}}}return n.shrink(),a.resize(e,{width:n.w,height:n.h}),{image:e,positions:r}}var i=t("@mapbox/shelf-pack"),o=t("../util/image"),a=o.AlphaImage,s=1;e.exports={makeGlyphAtlas:n}},{"../util/image":213,"@mapbox/shelf-pack":3}],75:[function(t,e,r){"use strict";var n=t("../style/load_glyph_range"),i=t("@mapbox/tiny-sdf"),o=t("../util/is_char_in_unicode_block"),a=t("../util/util"),s=a.asyncAll,l=t("../util/image"),u=l.AlphaImage,c=function(t,e){this.requestTransform=t,this.localIdeographFontFamily=e,this.entries={}};c.prototype.setURL=function(t){this.url=t},c.prototype.getGlyphs=function(t,e){var r=this,i=[];for(var o in t)for(var a=0,l=t[o];a65535)return void e(new Error("glyphs > 65535 not supported"));var u=a.requests[l];u||(u=a.requests[l]=[],n(i,l,r.url,r.requestTransform,function(t,e){if(e)for(var r in e)a.glyphs[+r]=e[+r];for(var n=0,i=u;nthis.height)return n.warnOnce("LineAtlas out of space"),null;for(var a=0,s=0;s=0;this.currentLayer--){var d=r.style._layers[o[r.currentLayer]];d.source!==(h&&h.id)&&(h=r.style.sourceCaches[d.source],f=[],h&&(r.clearStencil(),f=h.getVisibleCoordinates(),h.getSource().isTileClipped&&r._renderTileClippingMasks(f))),r.renderLayer(r,h,d,f)}this.renderPass="translucent";var m,v=[];for(this.gl.enable(this.gl.BLEND),this.currentLayer=0,this.currentLayer;this.currentLayer0?e.pop():null},x.prototype.lineWidth=function(t){this.gl.lineWidth(u.clamp(t,this.lineWidthRange[0],this.lineWidthRange[1]))},x.prototype.showOverdrawInspector=function(t){if(t||this._showOverdrawInspector){this._showOverdrawInspector=t;var e=this.gl;t?(e.blendFunc(e.CONSTANT_COLOR,e.ONE),e.blendColor(1/8,1/8,1/8,0),e.clearColor(0,0,0,1),e.clear(e.COLOR_BUFFER_BIT)):e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA)}},x.prototype._createProgramCached=function(t,e){this.cache=this.cache||{};var r=""+t+(e.cacheKey||"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new y(this.gl,v[t],e,this._showOverdrawInspector)),this.cache[r]},x.prototype.useProgram=function(t,e){var r=this.gl,n=this._createProgramCached(t,e||this.emptyProgramConfiguration);return this.currentProgram!==n&&(r.useProgram(n.program),this.currentProgram=n),n},e.exports=x},{"../data/extent":48,"../data/pos_array":52,"../data/program_configuration":53,"../data/raster_bounds_array":54,"../gl/vertex_buffer":62,"../shaders":86,"../source/pixels_to_tile_units":93,"../source/source_cache":98,"../util/browser":202,"../util/util":223,"./draw_background":64,"./draw_circle":65,"./draw_debug":67,"./draw_fill":68,"./draw_fill_extrusion":69,"./draw_line":70,"./draw_raster":71,"./draw_symbol":72,"./frame_history":73,"./program":81,"./render_texture":82,"./vertex_array_object":84,"@mapbox/gl-matrix":1}],80:[function(t,e,r){"use strict";var n=t("../source/pixels_to_tile_units");r.isPatternMissing=function(t,e){if(!t)return!1;var r=e.imageManager.getPattern(t.from),n=e.imageManager.getPattern(t.to);return!r||!n},r.prepare=function(t,e,r){var n=e.gl,i=e.imageManager.getPattern(t.from),o=e.imageManager.getPattern(t.to);n.uniform1i(r.uniforms.u_image,0),n.uniform2fv(r.uniforms.u_pattern_tl_a,i.tl),n.uniform2fv(r.uniforms.u_pattern_br_a,i.br),n.uniform2fv(r.uniforms.u_pattern_tl_b,o.tl),n.uniform2fv(r.uniforms.u_pattern_br_b,o.br);var a=e.imageManager.getPixelSize(),s=a.width,l=a.height;n.uniform2fv(r.uniforms.u_texsize,[s,l]),n.uniform1f(r.uniforms.u_mix,t.t),n.uniform2fv(r.uniforms.u_pattern_size_a,i.displaySize),n.uniform2fv(r.uniforms.u_pattern_size_b,o.displaySize),n.uniform1f(r.uniforms.u_scale_a,t.fromScale),n.uniform1f(r.uniforms.u_scale_b,t.toScale),n.activeTexture(n.TEXTURE0),e.imageManager.bind(n)},r.setTile=function(t,e,r){var i=e.gl;i.uniform1f(r.uniforms.u_tile_units_to_pixels,1/n(t,1,e.transform.tileZoom));var o=Math.pow(2,t.coord.z),a=t.tileSize*Math.pow(2,e.transform.tileZoom)/o,s=a*(t.coord.x+t.coord.w*o),l=a*t.coord.y;i.uniform2f(r.uniforms.u_pixel_coord_upper,s>>16,l>>16),i.uniform2f(r.uniforms.u_pixel_coord_lower,65535&s,65535&l)}},{"../source/pixels_to_tile_units":93}],81:[function(t,e,r){"use strict";var n=t("../util/browser"),i=t("../shaders"),o=t("../data/program_configuration"),a=(o.ProgramConfiguration,t("./vertex_array_object")),s=function(t,e,r,o){var a=this;this.gl=t,this.program=t.createProgram();var s=r.defines().concat("#define DEVICE_PIXEL_RATIO "+n.devicePixelRatio.toFixed(1));o&&s.push("#define OVERDRAW_INSPECTOR;");var l=s.concat(i.prelude.fragmentSource,e.fragmentSource).join("\n"),u=s.concat(i.prelude.vertexSource,e.vertexSource).join("\n"),c=t.createShader(t.FRAGMENT_SHADER);t.shaderSource(c,l),t.compileShader(c),t.attachShader(this.program,c);var p=t.createShader(t.VERTEX_SHADER);t.shaderSource(p,u),t.compileShader(p),t.attachShader(this.program,p);for(var h=r.interface?r.interface.layoutAttributes:[],f=0;f= v_max_zoom + v_perspective_zoom_adjust) {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0) * alpha * 0.25;\n }\n\n // Faded blue = the placement scale for this label is beyond the CollisionTile\n // max scale, so it's impossible for this label to show without collision detection\n // being run again (the label's glyphs haven't even been added to the symbol bucket)\n if (v_placement_zoom >= u_maxzoom) {\n gl_FragColor = vec4(0.0, 0.0, 1.0, 1.0) * alpha * 0.2;\n }\n}\n",vertexSource:"attribute vec2 a_pos;\nattribute vec2 a_anchor_pos;\nattribute vec2 a_extrude;\nattribute vec2 a_data;\n\nuniform mat4 u_matrix;\nuniform float u_scale;\nuniform float u_pitch;\nuniform float u_collision_y_stretch;\nuniform float u_camera_to_center_distance;\n\nvarying float v_max_zoom;\nvarying float v_placement_zoom;\nvarying float v_perspective_zoom_adjust;\nvarying vec2 v_fade_tex;\n\nvoid main() {\n vec4 projectedPoint = u_matrix * vec4(a_anchor_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n highp float collision_perspective_ratio = 1.0 + 0.5 * ((camera_to_anchor_distance / u_camera_to_center_distance) - 1.0);\n\n highp float incidence_stretch = camera_to_anchor_distance / (u_camera_to_center_distance * cos(u_pitch));\n highp float collision_adjustment = max(1.0, incidence_stretch / u_collision_y_stretch);\n\n gl_Position = u_matrix * vec4(a_pos + a_extrude * collision_perspective_ratio * collision_adjustment / u_scale, 0.0, 1.0);\n\n v_max_zoom = a_data.x;\n v_placement_zoom = a_data.y;\n\n v_perspective_zoom_adjust = floor(log2(collision_perspective_ratio * collision_adjustment) * 10.0);\n v_fade_tex = vec2((v_placement_zoom + v_perspective_zoom_adjust) / 255.0, 0.0);\n}\n"},debug:{fragmentSource:"uniform highp vec4 u_color;\n\nvoid main() {\n gl_FragColor = u_color;\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\nvoid main() {\n // We are using Int16 for texture position coordinates to give us enough precision for\n // fractional coordinates. We use 8192 to scale the texture coordinates in the buffer\n // as an arbitrarily high number to preserve adequate precision when rendering.\n // This is also the same value as the EXTENT we are using for our tile buffer pos coordinates,\n // so math for modifying either is consistent.\n gl_Position = u_matrix * vec4(a_pos, step(8192.0, a_pos.x), 1);\n}\n"},fill:{fragmentSource:"#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float opacity\n\n gl_FragColor = color * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n"},fillOutline:{fragmentSource:"#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_pos;\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = 1.0 - smoothstep(0.0, 1.0, dist);\n gl_FragColor = outline_color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos;\n\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},fillOutlinePattern:{fragmentSource:"uniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, 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_texsize, u_pattern_br_b / u_texsize, 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 = 1.0 - smoothstep(0.0, 1.0, dist);\n\n\n gl_FragColor = mix(color1, color2, u_mix) * alpha * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_world;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, a_pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, a_pos);\n\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},fillPattern:{fragmentSource:"uniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, 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_texsize, u_pattern_br_b / u_texsize, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n gl_FragColor = mix(color1, color2, u_mix) * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, a_pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, a_pos);\n}\n"},fillExtrusion:{fragmentSource:"varying vec4 v_color;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define highp vec4 color\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n #pragma mapbox: initialize highp vec4 color\n\n gl_FragColor = v_color;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec3 u_lightcolor;\nuniform lowp vec3 u_lightpos;\nuniform lowp float u_lightintensity;\n\nattribute vec2 a_pos;\nattribute vec3 a_normal;\nattribute float a_edgedistance;\n\nvarying vec4 v_color;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\n#pragma mapbox: define highp vec4 color\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n #pragma mapbox: initialize highp vec4 color\n\n base = max(0.0, base);\n height = max(0.0, height);\n\n float ed = a_edgedistance; // use each attrib in order to not trip a VAO assert\n float t = mod(a_normal.x, 2.0);\n\n gl_Position = u_matrix * vec4(a_pos, t > 0.0 ? height : base, 1);\n\n // Relative luminance (how dark/bright is the surface color?)\n float colorvalue = color.r * 0.2126 + color.g * 0.7152 + color.b * 0.0722;\n\n v_color = vec4(0.0, 0.0, 0.0, 1.0);\n\n // Add slight ambient lighting so no extrusions are totally black\n vec4 ambientlight = vec4(0.03, 0.03, 0.03, 1.0);\n color += ambientlight;\n\n // Calculate cos(theta), where theta is the angle between surface normal and diffuse light ray\n float directional = clamp(dot(a_normal / 16384.0, u_lightpos), 0.0, 1.0);\n\n // Adjust directional so that\n // the range of values for highlight/shading is narrower\n // with lower light intensity\n // and with lighter/brighter surface colors\n directional = mix((1.0 - u_lightintensity), max((1.0 - colorvalue + u_lightintensity), 1.0), directional);\n\n // Add gradient along z axis of side surfaces\n if (a_normal.y != 0.0) {\n directional *= clamp((t + base) * pow(height / 150.0, 0.5), mix(0.7, 0.98, 1.0 - u_lightintensity), 1.0);\n }\n\n // Assign final color based on surface + ambient light color, diffuse light directional, and light color\n // with lower bounds adjusted to hue of light\n // so that shading is tinted with the complementary (opposite) color to the light color\n v_color.r += clamp(color.r * directional * u_lightcolor.r, mix(0.0, 0.3, 1.0 - u_lightcolor.r), 1.0);\n v_color.g += clamp(color.g * directional * u_lightcolor.g, mix(0.0, 0.3, 1.0 - u_lightcolor.g), 1.0);\n v_color.b += clamp(color.b * directional * u_lightcolor.b, mix(0.0, 0.3, 1.0 - u_lightcolor.b), 1.0);\n}\n"},fillExtrusionPattern:{fragmentSource:"uniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec4 v_lighting;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, 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_texsize, u_pattern_br_b / u_texsize, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n vec4 mixedColor = mix(color1, color2, u_mix);\n\n gl_FragColor = mixedColor * v_lighting;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\nuniform float u_height_factor;\n\nuniform vec3 u_lightcolor;\nuniform lowp vec3 u_lightpos;\nuniform lowp float u_lightintensity;\n\nattribute vec2 a_pos;\nattribute vec3 a_normal;\nattribute float a_edgedistance;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec4 v_lighting;\nvarying float v_directional;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n\n base = max(0.0, base);\n height = max(0.0, height);\n\n float t = mod(a_normal.x, 2.0);\n float z = t > 0.0 ? height : base;\n\n gl_Position = u_matrix * vec4(a_pos, z, 1);\n\n vec2 pos = a_normal.x == 1.0 && a_normal.y == 0.0 && a_normal.z == 16384.0\n ? a_pos // extrusion top\n : vec2(a_edgedistance, z * u_height_factor); // extrusion side\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, pos);\n\n v_lighting = vec4(0.0, 0.0, 0.0, 1.0);\n float directional = clamp(dot(a_normal / 16383.0, u_lightpos), 0.0, 1.0);\n directional = mix((1.0 - u_lightintensity), max((0.5 + u_lightintensity), 1.0), directional);\n\n if (a_normal.y != 0.0) {\n directional *= clamp((t + base) * pow(height / 150.0, 0.5), mix(0.7, 0.98, 1.0 - u_lightintensity), 1.0);\n }\n\n v_lighting.rgb += clamp(directional * u_lightcolor, mix(vec3(0.0), vec3(0.3), 1.0 - u_lightcolor), vec3(1.0));\n}\n"},extrusionTexture:{fragmentSource:"uniform sampler2D u_image;\nuniform float u_opacity;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_FragColor = texture2D(u_image, v_pos) * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(0.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_world;\nattribute vec2 a_pos;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos * u_world, 0, 1);\n\n v_pos.x = a_pos.x;\n v_pos.y = 1.0 - a_pos.y;\n}\n"},line:{fragmentSource:"#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_width2;\nvarying vec2 v_normal;\nvarying float v_gamma_scale;\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump float gapwidth\n #pragma mapbox: initialize lowp float offset\n #pragma mapbox: initialize mediump float width\n\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n\n vec2 pos = a_pos_normal.xy;\n\n // x is 1 if it's a round cap, 0 otherwise\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = a_pos_normal.zw;\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases.\n // moved them into the shader for clarity and simplicity.\n gapwidth = gapwidth / 2.0;\n float halfwidth = width / 2.0;\n offset = -1.0 * offset;\n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + ANTIALIASING;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_width2 = vec2(outset, inset);\n}\n"},linePattern:{fragmentSource:"uniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_fade;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n float x_a = mod(v_linesofar / u_pattern_size_a.x, 1.0);\n float x_b = mod(v_linesofar / u_pattern_size_b.x, 1.0);\n float y_a = 0.5 + (v_normal.y * v_width2.s / u_pattern_size_a.y);\n float y_b = 0.5 + (v_normal.y * v_width2.s / u_pattern_size_b.y);\n vec2 pos_a = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, vec2(x_a, y_a));\n vec2 pos_b = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, vec2(x_b, y_b));\n\n vec4 color = mix(texture2D(u_image, pos_a), texture2D(u_image, pos_b), u_fade);\n\n gl_FragColor = color * alpha * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n\nvoid main() {\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize lowp float offset\n #pragma mapbox: initialize mediump float gapwidth\n #pragma mapbox: initialize mediump float width\n\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n vec2 pos = a_pos_normal.xy;\n\n // x is 1 if it's a round cap, 0 otherwise\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = a_pos_normal.zw;\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases.\n // moved them into the shader for clarity and simplicity.\n gapwidth = gapwidth / 2.0;\n float halfwidth = width / 2.0;\n offset = -1.0 * offset;\n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + ANTIALIASING;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_linesofar = a_linesofar;\n v_width2 = vec2(outset, inset);\n}\n"},lineSDF:{fragmentSource:"\nuniform sampler2D u_image;\nuniform float u_sdfgamma;\nuniform float u_mix;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump float width\n #pragma mapbox: initialize lowp float floorwidth\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n float sdfdist_a = texture2D(u_image, v_tex_a).a;\n float sdfdist_b = texture2D(u_image, v_tex_b).a;\n float sdfdist = mix(sdfdist_a, sdfdist_b, u_mix);\n alpha *= smoothstep(0.5 - u_sdfgamma / floorwidth, 0.5 + u_sdfgamma / floorwidth, sdfdist);\n\n gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_patternscale_a;\nuniform float u_tex_y_a;\nuniform vec2 u_patternscale_b;\nuniform float u_tex_y_b;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump float gapwidth\n #pragma mapbox: initialize lowp float offset\n #pragma mapbox: initialize mediump float width\n #pragma mapbox: initialize lowp float floorwidth\n\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n vec2 pos = a_pos_normal.xy;\n\n // x is 1 if it's a round cap, 0 otherwise\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = a_pos_normal.zw;\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases.\n // moved them into the shader for clarity and simplicity.\n gapwidth = gapwidth / 2.0;\n float halfwidth = width / 2.0;\n offset = -1.0 * offset;\n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + ANTIALIASING;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist =outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_tex_a = vec2(a_linesofar * u_patternscale_a.x / floorwidth, normal.y * u_patternscale_a.y + u_tex_y_a);\n v_tex_b = vec2(a_linesofar * u_patternscale_b.x / floorwidth, normal.y * u_patternscale_b.y + u_tex_y_b);\n\n v_width2 = vec2(outset, inset);\n}\n"},raster:{fragmentSource:"uniform float u_fade_t;\nuniform float u_opacity;\nuniform sampler2D u_image0;\nuniform sampler2D u_image1;\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nuniform float u_brightness_low;\nuniform float u_brightness_high;\n\nuniform float u_saturation_factor;\nuniform float u_contrast_factor;\nuniform vec3 u_spin_weights;\n\nvoid main() {\n\n // read and cross-fade colors from the main and parent tiles\n vec4 color0 = texture2D(u_image0, v_pos0);\n vec4 color1 = texture2D(u_image1, v_pos1);\n if (color0.a > 0.0) {\n color0.rgb = color0.rgb / color0.a;\n }\n if (color1.a > 0.0) {\n color1.rgb = color1.rgb / color1.a;\n }\n vec4 color = mix(color0, color1, u_fade_t);\n color.a *= u_opacity;\n vec3 rgb = color.rgb;\n\n // spin\n rgb = vec3(\n dot(rgb, u_spin_weights.xyz),\n dot(rgb, u_spin_weights.zxy),\n dot(rgb, u_spin_weights.yzx));\n\n // saturation\n float average = (color.r + color.g + color.b) / 3.0;\n rgb += (average - rgb) * u_saturation_factor;\n\n // contrast\n rgb = (rgb - 0.5) * u_contrast_factor + 0.5;\n\n // brightness\n vec3 u_high_vec = vec3(u_brightness_low, u_brightness_low, u_brightness_low);\n vec3 u_low_vec = vec3(u_brightness_high, u_brightness_high, u_brightness_high);\n\n gl_FragColor = vec4(mix(u_high_vec, u_low_vec, rgb) * color.a, color.a);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_tl_parent;\nuniform float u_scale_parent;\nuniform float u_buffer_scale;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n // We are using Int16 for texture position coordinates to give us enough precision for\n // fractional coordinates. We use 8192 to scale the texture coordinates in the buffer\n // as an arbitrarily high number to preserve adequate precision when rendering.\n // This is also the same value as the EXTENT we are using for our tile buffer pos coordinates,\n // so math for modifying either is consistent.\n v_pos0 = (((a_texture_pos / 8192.0) - 0.5) / u_buffer_scale ) + 0.5;\n v_pos1 = (v_pos0 * u_scale_parent) + u_tl_parent;\n}\n"},symbolIcon:{fragmentSource:"uniform sampler2D u_texture;\nuniform sampler2D u_fadetexture;\n\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n lowp float alpha = texture2D(u_fadetexture, v_fade_tex).a * 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:"const float PI = 3.141592653589793;\n\nattribute vec4 a_pos_offset;\nattribute vec4 a_data;\nattribute vec3 a_projected_pos;\n\nuniform bool u_is_size_zoom_constant;\nuniform bool u_is_size_feature_constant;\nuniform highp float u_size_t; // used to interpolate between zoom stops when size is a composite function\nuniform highp float u_size; // used when size is both zoom and feature constant\nuniform highp float u_camera_to_center_distance;\nuniform highp float u_pitch;\nuniform bool u_rotate_symbol;\nuniform highp float u_aspect_ratio;\nuniform highp float u_collision_y_stretch;\n\n#pragma mapbox: define lowp float opacity\n\nuniform mat4 u_matrix;\nuniform mat4 u_label_plane_matrix;\nuniform mat4 u_gl_coord_matrix;\n\nuniform bool u_is_text;\nuniform bool u_pitch_with_map;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n vec2 a_pos = a_pos_offset.xy;\n vec2 a_offset = a_pos_offset.zw;\n\n vec2 a_tex = a_data.xy;\n vec2 a_size = a_data.zw;\n\n highp vec2 angle_labelminzoom = unpack_float(a_projected_pos[2]);\n highp float segment_angle = -angle_labelminzoom[0] / 255.0 * 2.0 * PI;\n mediump float a_labelminzoom = angle_labelminzoom[1];\n\n float size;\n if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = mix(a_size[0], a_size[1], u_size_t) / 10.0;\n } else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = a_size[0] / 10.0;\n } else if (!u_is_size_zoom_constant && u_is_size_feature_constant) {\n size = u_size;\n } else {\n size = u_size;\n }\n\n vec4 projectedPoint = u_matrix * vec4(a_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n // See comments in symbol_sdf.vertex\n highp float distance_ratio = u_pitch_with_map ?\n camera_to_anchor_distance / u_camera_to_center_distance :\n u_camera_to_center_distance / camera_to_anchor_distance;\n highp float perspective_ratio = 0.5 + 0.5 * distance_ratio;\n\n size *= perspective_ratio;\n\n float fontScale = u_is_text ? size / 24.0 : size;\n\n highp float symbol_rotation = 0.0;\n if (u_rotate_symbol) {\n // See comments in symbol_sdf.vertex\n vec4 offsetProjectedPoint = u_matrix * vec4(a_pos + vec2(1, 0), 0, 1);\n\n vec2 a = projectedPoint.xy / projectedPoint.w;\n vec2 b = offsetProjectedPoint.xy / offsetProjectedPoint.w;\n\n symbol_rotation = atan((b.y - a.y) / u_aspect_ratio, b.x - a.x);\n }\n\n highp float angle_sin = sin(segment_angle + symbol_rotation);\n highp float angle_cos = cos(segment_angle + symbol_rotation);\n mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);\n\n vec4 projected_pos = u_label_plane_matrix * vec4(a_projected_pos.xy, 0.0, 1.0);\n gl_Position = u_gl_coord_matrix * vec4(projected_pos.xy / projected_pos.w + rotation_matrix * (a_offset / 64.0 * fontScale), 0.0, 1.0);\n\n v_tex = a_tex / u_texsize;\n // See comments in symbol_sdf.vertex\n highp float incidence_stretch = camera_to_anchor_distance / (u_camera_to_center_distance * cos(u_pitch));\n highp float collision_adjustment = max(1.0, incidence_stretch / u_collision_y_stretch);\n\n highp float collision_perspective_ratio = 1.0 + 0.5*((camera_to_anchor_distance / u_camera_to_center_distance) - 1.0);\n highp float perspective_zoom_adjust = floor(log2(collision_perspective_ratio * collision_adjustment) * 10.0);\n v_fade_tex = vec2((a_labelminzoom + perspective_zoom_adjust) / 255.0, 0.0);\n}\n"},symbolSDF:{fragmentSource:"#define SDF_PX 8.0\n#define EDGE_GAMMA 0.105/DEVICE_PIXEL_RATIO\n\nuniform bool u_is_halo;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n\nuniform sampler2D u_texture;\nuniform sampler2D u_fadetexture;\nuniform highp float u_gamma_scale;\nuniform bool u_is_text;\n\nvarying vec4 v_data0;\nvarying vec2 v_data1;\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 fill_color\n #pragma mapbox: initialize highp vec4 halo_color\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize lowp float halo_width\n #pragma mapbox: initialize lowp float halo_blur\n\n vec2 tex = v_data0.xy;\n vec2 fade_tex = v_data0.zw;\n float gamma_scale = v_data1.x;\n float size = v_data1.y;\n\n float fontScale = u_is_text ? size / 24.0 : size;\n\n lowp vec4 color = fill_color;\n highp float gamma = EDGE_GAMMA / (fontScale * u_gamma_scale);\n lowp float buff = (256.0 - 64.0) / 256.0;\n if (u_is_halo) {\n color = halo_color;\n gamma = (halo_blur * 1.19 / SDF_PX + EDGE_GAMMA) / (fontScale * u_gamma_scale);\n buff = (6.0 - halo_width / fontScale) / SDF_PX;\n }\n\n lowp float dist = texture2D(u_texture, tex).a;\n lowp float fade_alpha = texture2D(u_fadetexture, fade_tex).a;\n highp float gamma_scaled = gamma * gamma_scale;\n highp float alpha = smoothstep(buff - gamma_scaled, buff + gamma_scaled, dist) * fade_alpha;\n\n gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"const float PI = 3.141592653589793;\n\nattribute vec4 a_pos_offset;\nattribute vec4 a_data;\nattribute vec3 a_projected_pos;\n\n// contents of a_size vary based on the type of property value\n// used for {text,icon}-size.\n// For constants, a_size is disabled.\n// For source functions, we bind only one value per vertex: the value of {text,icon}-size evaluated for the current feature.\n// For composite functions:\n// [ text-size(lowerZoomStop, feature),\n// text-size(upperZoomStop, feature) ]\nuniform bool u_is_size_zoom_constant;\nuniform bool u_is_size_feature_constant;\nuniform highp float u_size_t; // used to interpolate between zoom stops when size is a composite function\nuniform highp float u_size; // used when size is both zoom and feature constant\n\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n\nuniform mat4 u_matrix;\nuniform mat4 u_label_plane_matrix;\nuniform mat4 u_gl_coord_matrix;\n\nuniform bool u_is_text;\nuniform bool u_pitch_with_map;\nuniform highp float u_pitch;\nuniform bool u_rotate_symbol;\nuniform highp float u_aspect_ratio;\nuniform highp float u_camera_to_center_distance;\nuniform highp float u_collision_y_stretch;\n\nuniform vec2 u_texsize;\n\nvarying vec4 v_data0;\nvarying vec2 v_data1;\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 fill_color\n #pragma mapbox: initialize highp vec4 halo_color\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize lowp float halo_width\n #pragma mapbox: initialize lowp float halo_blur\n\n vec2 a_pos = a_pos_offset.xy;\n vec2 a_offset = a_pos_offset.zw;\n\n vec2 a_tex = a_data.xy;\n vec2 a_size = a_data.zw;\n\n highp vec2 angle_labelminzoom = unpack_float(a_projected_pos[2]);\n highp float segment_angle = -angle_labelminzoom[0] / 255.0 * 2.0 * PI;\n mediump float a_labelminzoom = angle_labelminzoom[1];\n float size;\n\n if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = mix(a_size[0], a_size[1], u_size_t) / 10.0;\n } else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = a_size[0] / 10.0;\n } else if (!u_is_size_zoom_constant && u_is_size_feature_constant) {\n size = u_size;\n } else {\n size = u_size;\n }\n\n vec4 projectedPoint = u_matrix * vec4(a_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n // If the label is pitched with the map, layout is done in pitched space,\n // which makes labels in the distance smaller relative to viewport space.\n // We counteract part of that effect by multiplying by the perspective ratio.\n // If the label isn't pitched with the map, we do layout in viewport space,\n // which makes labels in the distance larger relative to the features around\n // them. We counteract part of that effect by dividing by the perspective ratio.\n highp float distance_ratio = u_pitch_with_map ?\n camera_to_anchor_distance / u_camera_to_center_distance :\n u_camera_to_center_distance / camera_to_anchor_distance;\n highp float perspective_ratio = 0.5 + 0.5 * distance_ratio;\n\n size *= perspective_ratio;\n\n float fontScale = u_is_text ? size / 24.0 : size;\n\n highp float symbol_rotation = 0.0;\n if (u_rotate_symbol) {\n // Point labels with 'rotation-alignment: map' are horizontal with respect to tile units\n // To figure out that angle in projected space, we draw a short horizontal line in tile\n // space, project it, and measure its angle in projected space.\n vec4 offsetProjectedPoint = u_matrix * vec4(a_pos + vec2(1, 0), 0, 1);\n\n vec2 a = projectedPoint.xy / projectedPoint.w;\n vec2 b = offsetProjectedPoint.xy / offsetProjectedPoint.w;\n\n symbol_rotation = atan((b.y - a.y) / u_aspect_ratio, b.x - a.x);\n }\n\n highp float angle_sin = sin(segment_angle + symbol_rotation);\n highp float angle_cos = cos(segment_angle + symbol_rotation);\n mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);\n\n vec4 projected_pos = u_label_plane_matrix * vec4(a_projected_pos.xy, 0.0, 1.0);\n gl_Position = u_gl_coord_matrix * vec4(projected_pos.xy / projected_pos.w + rotation_matrix * (a_offset / 64.0 * fontScale), 0.0, 1.0);\n float gamma_scale = gl_Position.w;\n\n vec2 tex = a_tex / u_texsize;\n // incidence_stretch is the ratio of how much y space a label takes up on a tile while drawn perpendicular to the viewport vs\n // how much space it would take up if it were drawn flat on the tile\n // Using law of sines, camera_to_anchor/sin(ground_angle) = camera_to_center/sin(incidence_angle)\n // sin(incidence_angle) = 1/incidence_stretch\n // Incidence angle 90 -> head on, sin(incidence_angle) = 1, no incidence stretch\n // Incidence angle 1 -> very oblique, sin(incidence_angle) =~ 0, lots of incidence stretch\n // ground_angle = u_pitch + PI/2 -> sin(ground_angle) = cos(u_pitch)\n // This 2D calculation is only exactly correct when gl_Position.x is in the center of the viewport,\n // but it's a close enough approximation for our purposes\n highp float incidence_stretch = camera_to_anchor_distance / (u_camera_to_center_distance * cos(u_pitch));\n // incidence_stretch only applies to the y-axis, but without re-calculating the collision tile, we can't\n // adjust the size of only one axis. So, we do a crude approximation at placement time to get the aspect ratio\n // about right, and then do the rest of the adjustment here: there will be some extra padding on the x-axis,\n // but hopefully not too much.\n // Never make the adjustment less than 1.0: instead of allowing collisions on the x-axis, be conservative on\n // the y-axis.\n highp float collision_adjustment = max(1.0, incidence_stretch / u_collision_y_stretch);\n\n // Floor to 1/10th zoom to dodge precision issues that can cause partially hidden labels\n highp float collision_perspective_ratio = 1.0 + 0.5*((camera_to_anchor_distance / u_camera_to_center_distance) - 1.0);\n highp float perspective_zoom_adjust = floor(log2(collision_perspective_ratio * collision_adjustment) * 10.0);\n vec2 fade_tex = vec2((a_labelminzoom + perspective_zoom_adjust) / 255.0, 0.0);\n\n v_data0 = vec4(tex.x, tex.y, fade_tex.x, fade_tex.y);\n v_data1 = vec2(gamma_scale, size);\n}\n"}},i=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g;for(var o in n)!function(t){var e=n[t],r={};e.fragmentSource=e.fragmentSource.replace(i,function(t,e,n,i,o){return r[o]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+o+"\nvarying "+n+" "+i+" "+o+";\n#else\nuniform "+n+" "+i+" u_"+o+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+o+"\n "+n+" "+i+" "+o+" = u_"+o+";\n#endif\n"}),e.vertexSource=e.vertexSource.replace(i,function(t,e,n,i,o){var a="float"===i?"vec2":"vec4";return r[o]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+o+"\nuniform lowp float a_"+o+"_t;\nattribute "+n+" "+a+" a_"+o+";\nvarying "+n+" "+i+" "+o+";\n#else\nuniform "+n+" "+i+" u_"+o+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+o+" = unpack_mix_"+a+"(a_"+o+", a_"+o+"_t);\n#else\n "+n+" "+i+" "+o+" = u_"+o+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+o+"\nuniform lowp float a_"+o+"_t;\nattribute "+n+" "+a+" a_"+o+";\n#else\nuniform "+n+" "+i+" u_"+o+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+n+" "+i+" "+o+" = unpack_mix_"+a+"(a_"+o+", a_"+o+"_t);\n#else\n "+n+" "+i+" "+o+" = u_"+o+";\n#endif\n"})}(o);e.exports=n},{}],87:[function(t,e,r){"use strict";var n=t("./image_source"),i=t("../util/window"),o=function(t){function e(e,r,n,i){t.call(this,e,r,n,i),this.options=r,this.animate=void 0===r.animate||r.animate}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(){this.canvas=this.canvas||i.document.getElementById(this.options.canvas);var t=this.canvas.getContext(this.options.contextType);if(!t)return this.fire("error",new Error("Canvas context not found."));if(this.context=t,this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions())return this.fire("error",new Error("Canvas dimensions cannot be less than or equal to zero."));var e;this.play=function(){void 0===e&&(e=this.map.style.animationLoop.set(1/0),this.map._rerender())},this.pause=function(){void 0!==e&&(e=this.map.style.animationLoop.cancel(e))},this._finishLoading()},e.prototype.getCanvas=function(){return this.canvas},e.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},e.prototype.onRemove=function(){this.pause()},e.prototype.readCanvas=function(t){var e=this;if(this.context instanceof CanvasRenderingContext2D)this.canvasData=this.context.getImageData(0,0,this.width,this.height);else if(this.context instanceof WebGLRenderingContext){var r=this.context,n=new Uint8Array(this.width*this.height*4);r.readPixels(0,0,this.width,this.height,r.RGBA,r.UNSIGNED_BYTE,n),this.secondaryContext||(this.secondaryContext=i.document.createElement("canvas").getContext("2d")),this.canvasData&&!t||(this.canvasData=this.secondaryContext.createImageData(this.width,this.height));for(var o=this.height-1,a=0;o>=0;o--,a++)e.canvasData.data.set(n.subarray(o*e.width*4,(o+1)*e.width*4),a*e.width*4)}},e.prototype.prepare=function(){var t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){if((this.animate||!this.canvasData||t)&&this.readCanvas(t),!this.canvasData)return void this.fire("error",new Error("Could not read canvas data."));this._prepareImage(this.map.painter.gl,this.canvasData,t)}},e.prototype.serialize=function(){return{type:"canvas",canvas:this.canvas,coordinates:this.coordinates}},e.prototype._hasInvalidDimensions=function(){for(var t=this,e=0,r=[t.canvas.width,t.canvas.height];ethis.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,angle:this.map.transform.angle,pitch:this.map.transform.pitch,cameraToCenterDistance:this.map.transform.cameraToCenterDistance,cameraToTileDistance:this.map.transform.cameraToTileDistance(t),showCollisionBoxes:this.map.showCollisionBoxes};t.workerID=this.dispatcher.send(n,i,function(n,i){if(t.unloadVectorData(),!t.aborted)return n?e(n):(t.loadVectorData(i,r.map.painter),t.redoWhenDone&&(t.redoWhenDone=!1,t.redoPlacement(r)),e(null))},this.workerID)},e.prototype.abortTile=function(t){t.aborted=!0},e.prototype.unloadTile=function(t){t.unloadVectorData(),this.dispatcher.send("removeTile",{uid:t.uid,type:this.type,source:this.id},function(){},t.workerID)},e.prototype.onRemove=function(){this.dispatcher.broadcast("removeSource",{type:this.type,source:this.id},function(){})},e.prototype.serialize=function(){return o.extend({},this._options,{type:this.type,data:this._data})},e}(i);e.exports=c},{"../data/extent":48,"../util/ajax":201,"../util/browser":202,"../util/evented":210,"../util/util":223,"../util/window":204}],89:[function(t,e,r){"use strict";function n(t,e){var r=t.source,n=t.coord;if(!this._geoJSONIndexes[r])return e(null,null);var i=this._geoJSONIndexes[r].getTile(Math.min(n.z,t.maxZoom),n.x,n.y);if(!i)return e(null,null);var o=new a(i.features),l=s(o);0===l.byteOffset&&l.byteLength===l.buffer.byteLength||(l=new Uint8Array(l)),e(null,{vectorTile:o,rawData:l.buffer})}var i=t("../util/ajax"),o=t("geojson-rewind"),a=t("./geojson_wrapper"),s=t("vt-pbf"),l=t("supercluster"),u=t("geojson-vt"),c=t("./vector_tile_worker_source"),p=function(t){function e(e,r,i){t.call(this,e,r,n),i&&(this.loadGeoJSON=i),this._geoJSONIndexes={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.loadData=function(t,e){var r=this;this.loadGeoJSON(t,function(n,i){if(n||!i)return e(n);if("object"!=typeof i)return e(new Error("Input data is not a valid GeoJSON object."));o(i,!0);try{r._geoJSONIndexes[t.source]=t.cluster?l(t.superclusterOptions).load(i.features):u(i,t.geojsonVtOptions)}catch(n){return e(n)}r.loaded[t.source]={},e(null)})},e.prototype.reloadTile=function(e,r){var n=this.loaded[e.source],i=e.uid;return n&&n[i]?t.prototype.reloadTile.call(this,e,r):this.loadTile(e,r)},e.prototype.loadGeoJSON=function(t,e){if(t.request)i.getJSON(t.request,e);else{if("string"!=typeof t.data)return e(new Error("Input data is not a valid GeoJSON object."));try{return e(null,JSON.parse(t.data))}catch(t){return e(new Error("Input data is not a valid GeoJSON object."))}}},e.prototype.removeSource=function(t){this._geoJSONIndexes[t.source]&&delete this._geoJSONIndexes[t.source]},e}(c);e.exports=p},{"../util/ajax":201,"./geojson_wrapper":90,"./vector_tile_worker_source":103,"geojson-rewind":13,"geojson-vt":17,supercluster:32,"vt-pbf":37}],90:[function(t,e,r){"use strict";var n=t("@mapbox/point-geometry"),i=t("@mapbox/vector-tile").VectorTileFeature.prototype.toGeoJSON,o=t("../data/extent"),a=function(t){this._feature=t,this.extent=o,this.type=t.type,this.properties=t.tags,"id"in t&&!isNaN(t.id)&&(this.id=parseInt(t.id,10))};a.prototype.loadGeometry=function(){var t=this;if(1===this._feature.type){for(var e=[],r=0,i=t._feature.geometry;re)){var s=Math.pow(2,Math.min(a.coord.z,n._source.maxzoom)-Math.min(t.z,n._source.maxzoom));if(Math.floor(a.coord.x/s)===t.x&&Math.floor(a.coord.y/s)===t.y)for(r[o]=!0,i=!0;a&&a.coord.z-1>t.z;){var l=a.coord.parent(n._source.maxzoom);if(!l)break;(a=n._tiles[l.id])&&a.hasData()&&(delete r[o],r[l.id]=!0)}}}return i},e.prototype.findLoadedParent=function(t,e,r){for(var n=this,i=t.z-1;i>=e;i--){var o=t.parent(n._source.maxzoom);if(!o)return;t=o;var a=String(t.id),s=n._tiles[a];if(s&&s.hasData())return r[a]=!0,s;if(n._cache.has(a))return r[a]=!0,n._cache.getWithoutRemoving(a)}},e.prototype.updateCacheSize=function(t){var e=Math.ceil(t.width/t.tileSize)+1,r=Math.ceil(t.height/t.tileSize)+1,n=e*r,i=Math.floor(5*n),o="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,i):i;this._cache.setMaxSize(o)},e.prototype.update=function(t){var r=this;if(this.transform=t,this._sourceLoaded&&!this._paused){this.updateCacheSize(t),this._coveredTiles={};var n;this.used?this._source.coord?n=t.getVisibleWrappedCoordinates(this._source.coord):(n=t.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(n=n.filter(function(t){return r._source.hasTile(t)}))):n=[];var i=(this._source.roundZoom?Math.round:Math.floor)(this.getZoom(t)),a=Math.max(i-e.maxOverzooming,this._source.minzoom),s=Math.max(i+e.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(n,i),c={};if(o(this._source.type))for(var p=Object.keys(l),f=0;f=Date.now())){r._findLoadedChildren(m,s,l)&&(l[d]=!0);var y=r.findLoadedParent(m,a,c);y&&r._addTile(y.coord)}}var g;for(g in c)l[g]||(r._coveredTiles[g]=!0);for(g in c)l[g]=!0;for(var _=h.keysDifference(this._tiles,l),x=0;x<_.length;x++)r._removeTile(_[x])}},e.prototype._updateRetainedTiles=function(t,r){var n,i,o,a,s=this,l={},u={},c=Math.max(r-e.maxOverzooming,this._source.minzoom);for(n=0;ns._source.maxzoom){var h=i.children(s._source.maxzoom)[0],f=s.getTile(h);f&&f.hasData()?l[h.id]=!0:a=!1}else for(var d=i.children(s._source.maxzoom),m=0;m=c;--g){var _=i.scaledTo(g,s._source.maxzoom);if(u[_.id])break;if(u[_.id]=!0,o=s.getTile(_),!o&&p&&(o=s._addTile(_)),o&&(l[_.id]=!0,p=o.wasRequested(),o.hasData()))break}}}return l},e.prototype._addTile=function(t){var e=this._tiles[t.id];if(e)return e;(e=this._cache.get(t.id))&&(e.redoPlacement(this._source),this._cacheTimers[t.id]&&(clearTimeout(this._cacheTimers[t.id]),delete this._cacheTimers[t.id],this._setTileReloadTimer(t.id,e)));var r=Boolean(e);if(!r){var n=t.z,i=n>this._source.maxzoom?Math.pow(2,n-this._source.maxzoom):1;e=new s(t,this._source.tileSize*i,this._source.maxzoom),this._loadTile(e,this._tileLoaded.bind(this,e,t.id,e.state))}return e?(e.uses++,this._tiles[t.id]=e,r||this._source.fire("dataloading",{tile:e,coord:e.coord,dataType:"source"}),e):null},e.prototype._setTileReloadTimer=function(t,e){var r=this,n=e.getExpiryTimeout();n&&(this._timers[t]=setTimeout(function(){r._reloadTile(t,"expired"),delete r._timers[t]},n))},e.prototype._setCacheInvalidationTimer=function(t,e){var r=this,n=e.getExpiryTimeout();n&&(this._cacheTimers[t]=setTimeout(function(){r._cache.remove(t),delete r._cacheTimers[t]},n))},e.prototype._removeTile=function(t){var e=this._tiles[t];if(e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),!(e.uses>0)))if(e.stopPlacementThrottler(),e.hasData()){var r=e.coord.wrapped().id;this._cache.add(r,e),this._setCacheInvalidationTimer(r,e)}else e.aborted=!0,this._abortTile(e),this._unloadTile(e)},e.prototype.clearTiles=function(){var t=this;this._shouldReloadOnResume=!1,this._paused=!1;for(var e in t._tiles)t._removeTile(e);this._cache.reset()},e.prototype.tilesIn=function(t){for(var e=this,r=[],i=this.getIds(),o=1/0,a=1/0,s=-1/0,l=-1/0,c=t[0].zoom,h=0;h=0&&g[1].y>=0){for(var _=[],x=0;xi)o=!1;else if(e)if(this.expirationTime=n.minX&&t.x=n.minY&&t.ye.row){var r=t;t=e,e=r}return{x0:t.column,y0:t.row,x1:e.column,y1:e.row,dx:e.column-t.column,dy:e.row-t.row}}function i(t,e,r,n,i){var o=Math.max(r,Math.floor(e.y0)),a=Math.min(n,Math.ceil(e.y1));if(t.x0===e.x0&&t.y0===e.y0?t.x0+e.dy/t.dy*t.dx0,p=e.dx<0,h=o;hc.dy&&(l=u,u=c,c=l),u.dy>p.dy&&(l=u,u=p,p=l),c.dy>p.dy&&(l=c,c=p,p=l),u.dy&&i(p,u,o,a,s),c.dy&&i(p,c,o,a,s)}function a(t,e,r){for(var n,i="",o=t;o>0;o--)n=1<t?new u(this.z-1,this.x,this.y,this.w):new u(this.z-1,Math.floor(this.x/2),Math.floor(this.y/2),this.w)},u.prototype.wrapped=function(){return new u(this.z,this.x,this.y,0)},u.prototype.children=function(t){if(this.z>=t)return[new u(this.z+1,this.x,this.y,this.w)];var e=this.z+1,r=2*this.x,n=2*this.y;return[new u(e,r,n,this.w),new u(e,r+1,n,this.w),new u(e,r,n+1,this.w),new u(e,r+1,n+1,this.w)]},u.prototype.scaledTo=function(t,e){return this.z>e?new u(t,this.x,this.y,this.w):t<=this.z?new u(t,this.x>>this.z-t,this.y>>this.z-t,this.w):new u(t,this.x<=0&&i<=a)for(o=t;othis.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,i=a(t.coord.url(this.tiles,this.maxzoom,this.scheme),this.url),o={request:this.map._transformRequest(i,l.Tile),uid:t.uid,coord:t.coord,zoom:t.coord.z,tileSize:this.tileSize*n,type:this.type,source:this.id,pixelRatio:u.devicePixelRatio,overscaling:n,angle:this.map.transform.angle,pitch:this.map.transform.pitch,cameraToCenterDistance:this.map.transform.cameraToCenterDistance,cameraToTileDistance:this.map.transform.cameraToTileDistance(t),showCollisionBoxes:this.map.showCollisionBoxes};t.workerID&&"expired"!==t.state?"loading"===t.state?t.reloadCallback=e:this.dispatcher.send("reloadTile",o,r.bind(this),t.workerID):t.workerID=this.dispatcher.send("loadTile",o,r.bind(this))},e.prototype.abortTile=function(t){this.dispatcher.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0,t.workerID)},e.prototype.unloadTile=function(t){t.unloadVectorData(),this.dispatcher.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0,t.workerID)},e}(n);e.exports=c},{"../util/ajax":201,"../util/browser":202,"../util/evented":210,"../util/mapbox":217,"../util/util":223,"./load_tilejson":92,"./tile_bounds":100}],103:[function(t,e,r){"use strict";function n(t,e){var r=i.getArrayBuffer(t.request,function(t,r){t?e(t):r&&e(null,{vectorTile:new o.VectorTile(new a(r.data)),rawData:r.data,cacheControl:r.cacheControl,expires:r.expires})});return function(){r.abort()}}var i=t("../util/ajax"),o=t("@mapbox/vector-tile"),a=t("pbf"),s=t("./worker_tile"),l=t("../util/util"),u=function(t,e,r){this.actor=t,this.layerIndex=e,this.loadVectorData=r||n,this.loading={},this.loaded={}};u.prototype.loadTile=function(t,e){var r=this,n=t.source,i=t.uid;this.loading[n]||(this.loading[n]={});var o=this.loading[n][i]=new s(t);o.abort=this.loadVectorData(t,function(t,a){if(delete r.loading[n][i],t||!a)return e(t);var s=a.rawData,u={};a.expires&&(u.expires=a.expires),a.cacheControl&&(u.cacheControl=a.cacheControl),o.vectorTile=a.vectorTile,o.parse(a.vectorTile,r.layerIndex,r.actor,function(t,r,n){if(t||!r)return e(t);e(null,l.extend({rawTileData:s},r,u),n)}),r.loaded[n]=r.loaded[n]||{},r.loaded[n][i]=o})},u.prototype.reloadTile=function(t,e){function r(t,r){if(this.reloadCallback){var n=this.reloadCallback;delete this.reloadCallback,this.parse(this.vectorTile,o.layerIndex,o.actor,n)}e(t,r)}var n=this.loaded[t.source],i=t.uid,o=this;if(n&&n[i]){var a=n[i];"parsing"===a.status?a.reloadCallback=e:"done"===a.status&&a.parse(a.vectorTile,this.layerIndex,this.actor,r.bind(a))}},u.prototype.abortTile=function(t){var e=this.loading[t.source],r=t.uid;e&&e[r]&&e[r].abort&&(e[r].abort(),delete e[r])},u.prototype.removeTile=function(t){var e=this.loaded[t.source],r=t.uid;e&&e[r]&&delete e[r]},u.prototype.redoPlacement=function(t,e){var r=this.loaded[t.source],n=this.loading[t.source],i=t.uid;if(r&&r[i]){var o=r[i],a=o.redoPlacement(t.angle,t.pitch,t.cameraToCenterDistance,t.cameraToTileDistance,t.showCollisionBoxes);a.result&&e(null,a.result,a.transferables)}else n&&n[i]&&(n[i].angle=t.angle)},e.exports=u},{"../util/ajax":201,"../util/util":223,"./worker_tile":106,"@mapbox/vector-tile":6,pbf:29}],104:[function(t,e,r){"use strict";var n=t("../util/ajax"),i=t("./image_source"),o=function(t){function e(e,r,n,i){t.call(this,e,r,n,i),this.roundZoom=!0,this.type="video",this.options=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(){var t=this,e=this.options;this.urls=e.urls,n.getVideo(e.urls,function(e,r){if(e)t.fire("error",{error:e});else if(r){t.video=r,t.video.loop=!0;var n;t.video.addEventListener("playing",function(){n=t.map.style.animationLoop.set(1/0),t.map._rerender()}),t.video.addEventListener("pause",function(){t.map.style.animationLoop.cancel(n)}),t.map&&t.video.play(),t._finishLoading()}})},e.prototype.getVideo=function(){return this.video},e.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},e.prototype.prepare=function(){0===Object.keys(this.tiles).length||this.video.readyState<2||this._prepareImage(this.map.painter.gl,this.video)},e.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},e}(i);e.exports=o},{"../util/ajax":201,"./image_source":91}],105:[function(t,e,r){"use strict";var n=t("../util/actor"),i=t("../style/style_layer_index"),o=t("./vector_tile_worker_source"),a=t("./geojson_worker_source"),s=t("./rtl_text_plugin"),l=function(t){var e=this;this.self=t,this.actor=new n(t,this),this.layerIndexes={},this.workerSourceTypes={vector:o,geojson:a},this.workerSources={},this.self.registerWorkerSource=function(t,r){if(e.workerSourceTypes[t])throw new Error('Worker source with name "'+t+'" already registered.');e.workerSourceTypes[t]=r},this.self.registerRTLTextPlugin=function(t){if(s.applyArabicShaping||s.processBidirectionalText)throw new Error("RTL text plugin already registered.");s.applyArabicShaping=t.applyArabicShaping,s.processBidirectionalText=t.processBidirectionalText}};l.prototype.setLayers=function(t,e){this.getLayerIndex(t).replace(e)},l.prototype.updateLayers=function(t,e){this.getLayerIndex(t).update(e.layers,e.removedIds,e.symbolOrder)},l.prototype.loadTile=function(t,e,r){this.getWorkerSource(t,e.type).loadTile(e,r)},l.prototype.reloadTile=function(t,e,r){this.getWorkerSource(t,e.type).reloadTile(e,r)},l.prototype.abortTile=function(t,e){this.getWorkerSource(t,e.type).abortTile(e)},l.prototype.removeTile=function(t,e){this.getWorkerSource(t,e.type).removeTile(e)},l.prototype.removeSource=function(t,e){var r=this.getWorkerSource(t,e.type);void 0!==r.removeSource&&r.removeSource(e)},l.prototype.redoPlacement=function(t,e,r){this.getWorkerSource(t,e.type).redoPlacement(e,r)},l.prototype.loadWorkerSource=function(t,e,r){try{this.self.importScripts(e.url),r()}catch(t){r(t)}},l.prototype.loadRTLTextPlugin=function(t,e,r){try{s.applyArabicShaping||s.processBidirectionalText||(this.self.importScripts(e),s.applyArabicShaping&&s.processBidirectionalText||r(new Error("RTL Text Plugin failed to import scripts from "+e)))}catch(t){r(t)}},l.prototype.getLayerIndex=function(t){var e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new i),e},l.prototype.getWorkerSource=function(t,e){var r=this;if(this.workerSources[t]||(this.workerSources[t]={}),!this.workerSources[t][e]){var n={send:function(e,n,i,o){r.actor.send(e,n,i,o,t)}};this.workerSources[t][e]=new this.workerSourceTypes[e](n,this.getLayerIndex(t))}return this.workerSources[t][e]},e.exports=function(t){return new l(t)}},{"../style/style_layer_index":164,"../util/actor":200,"./geojson_worker_source":89,"./rtl_text_plugin":96,"./vector_tile_worker_source":103}],106:[function(t,e,r){"use strict";function n(t,e){for(var r=0,n=t.layers;r=k.maxzoom||k.layout&&"none"===k.layout.visibility)){for(var M=0,L=E;M=0;I--){var P=y[e.symbolOrder[I]];P&&d.symbolBuckets.push(P)}var R,D,O,B=u.mapObject(g.glyphDependencies,function(t){return Object.keys(t).map(Number)});Object.keys(B).length?r.send("getGlyphs",{uid:this.uid,stacks:B},function(t,e){R||(R=t,D=e,h.call(d))}):D={};var F=Object.keys(g.iconDependencies);F.length?r.send("getImages",{icons:F},function(t,e){R||(R=t,O=e,h.call(d))}):O={},h.call(this)},d.prototype.redoPlacement=function(t,e,r,o,s){var l=this;if(this.angle=t,this.pitch=e,this.cameraToCenterDistance=r,this.cameraToTileDistance=o,"done"!==this.status)return{};for(var u=new a(this.angle,this.pitch,this.cameraToCenterDistance,this.cameraToTileDistance,this.collisionBoxArray),c=0,p=l.symbolBuckets;c0;)r[n]=arguments[n+2];this.message=(t?t+": ":"")+i.apply(i,r),null!==e&&void 0!==e&&e.__line__&&(this.line=e.__line__)}var i=t("util").format;e.exports=n},{util:36}],110:[function(t,e,r){"use strict";function n(t){return new Function("f","var p = (f && f.properties || {}); return "+i(t))}function i(t){if(!t)return"true";var e=t[0];return t.length<=1?"any"===e?"false":"true":"("+("=="===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")+")"}function o(t){return"$type"===t?"f.type":"$id"===t?"f.id":"p["+JSON.stringify(t)+"]"}function a(t,e,r,n){var i=o(t),a="$type"===t?h.indexOf(e):JSON.stringify(e);return(n?"typeof "+i+"=== typeof "+a+"&&":"")+i+r+a}function s(t,e){return t.map(i).join(e)}function l(t,e){"$type"===t&&(e=e.map(function(t){return h.indexOf(t)}));var r=JSON.stringify(e.sort(p)),n=o(t);return e.length<=200?r+".indexOf("+n+") !== -1":"function(v, a, i, j) {while (i <= j) { var m = (i + j) >> 1; if (a[m] === v) return true; if (a[m] > v) j = m - 1; else i = m + 1;}return false; }("+n+", "+r+",0,"+(e.length-1)+")"}function u(t){return"$id"===t?'"id" in f':JSON.stringify(t)+" in p"}function c(t){return"!("+t+")"}function p(t,e){return te?1:0}e.exports=n;var h=["Unknown","Point","LineString","Polygon"]},{}],111:[function(t,e,r){"use strict";function n(t){return t>y?Math.pow(t,1/3):t/v+d}function i(t){return t>m?t*t*t:v*(t-d)}function o(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function a(t){return t/=255,t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function s(t){var e=a(t[0]),r=a(t[1]),i=a(t[2]),o=n((.4124564*e+.3575761*r+.1804375*i)/p),s=n((.2126729*e+.7151522*r+.072175*i)/h);return[116*s-16,500*(o-s),200*(s-n((.0193339*e+.119192*r+.9503041*i)/f)),t[3]]}function l(t){var e=(t[0]+16)/116,r=isNaN(t[1])?e:e+t[1]/500,n=isNaN(t[2])?e:e-t[2]/200;return e=h*i(e),r=p*i(r),n=f*i(n),[o(3.2404542*r-1.5371385*e-.4985314*n),o(-.969266*r+1.8760108*e+.041556*n),o(.0556434*r-.2040259*e+1.0572252*n),t[3]]}function u(t){var e=s(t),r=e[0],n=e[1],i=e[2],o=Math.atan2(i,n)*_;return[o<0?o+360:o,Math.sqrt(n*n+i*i),r,t[3]]}function c(t){var e=t[0]*g,r=t[1];return l([t[2],Math.cos(e)*r,Math.sin(e)*r,t[3]])}var p=.95047,h=1,f=1.08883,d=4/29,m=6/29,v=3*m*m,y=m*m*m,g=Math.PI/180,_=180/Math.PI;e.exports={lab:{forward:s,reverse:l},hcl:{forward:u,reverse:c}}},{}],112:[function(t,e,r){"use strict";function n(t){return t}function i(t,e){var r,c="color"===e.type;if(p(t)){var h=t.stops&&"object"==typeof t.stops[0][0],v=h||void 0!==t.property,y=h||!v,g=t.type||("interpolated"===e.function?"exponential":"interval");c&&(t=m({},t),t.stops&&(t.stops=t.stops.map(function(t){return[t[0],d(t[1])]})),t.default?t.default=d(t.default):t.default=d(e.default));var _,x,b;if("exponential"===g)_=l;else if("interval"===g)_=s;else if("categorical"===g){_=a,x=Object.create(null);for(var w=0,T=t.stops;w=t.stops[n-1][0])return t.stops[n-1][1];var i=c(t.stops,r);return t.stops[i][1]}function l(t,e,r){var i=void 0!==t.base?t.base:1;if("number"!==v(r))return o(t.default,e.default);var a=t.stops.length;if(1===a)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[a-1][0])return t.stops[a-1][1];var s=c(t.stops,r),l=h(r,i,t.stops[s][0],t.stops[s+1][0]),u=t.stops[s][1],p=t.stops[s+1][1],f=y[e.type]||n;return"function"==typeof u?function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=u.apply(void 0,t),n=p.apply(void 0,t);if(void 0!==r&&void 0!==n)return f(r,n,l)}:f(u,p,l)}function u(t,e,r){return"color"===e.type?r=d(r):v(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),o(r,t.default,e.default)}function c(t,e){for(var r,n,i=t.length,o=0,a=i-1,s=0;o<=a;){if(s=Math.floor((o+a)/2),r=t[s][0],n=t[s+1][0],e===r||e>r&&ee&&(a=s-1)}return Math.max(s-1,0)}function p(t){return"object"==typeof t&&(t.stops||"identity"===t.type)}function h(t,e,r,n){var i=n-r,o=t-r;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}var f=t("./color_spaces"),d=t("../util/parse_color"),m=t("../util/extend"),v=t("../util/get_type"),y=t("../util/interpolate");e.exports=i,e.exports.isFunctionDefinition=p,e.exports.interpolationFactor=h,e.exports.findStopLessThanOrEqualTo=c},{"../util/extend":125,"../util/get_type":126,"../util/interpolate":127,"../util/parse_color":128,"./color_spaces":111}],113:[function(t,e,r){"use strict";function n(t){var e=typeof t;if("number"===e||"boolean"===e||"string"===e||void 0===t||null===t)return JSON.stringify(t);if(Array.isArray(t)){for(var r="[",i=0,o=t;i255?255:t}function i(t){return t<0?0:t>1?1:t}function o(t){return n("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function a(t){return i("%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))}function s(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}function l(t){var e=t.replace(/ /g,"").toLowerCase();if(e in u)return u[e].slice();if("#"===e[0]){if(4===e.length){var r=parseInt(e.substr(1),16);return r>=0&&r<=4095?[(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,1]:null}if(7===e.length){var r=parseInt(e.substr(1),16);return r>=0&&r<=16777215?[(16711680&r)>>16,(65280&r)>>8,255&r,1]:null}return null}var i=e.indexOf("("),l=e.indexOf(")");if(-1!==i&&l+1===e.length){var c=e.substr(0,i),p=e.substr(i+1,l-(i+1)).split(","),h=1;switch(c){case"rgba":if(4!==p.length)return null;h=a(p.pop());case"rgb":return 3!==p.length?null:[o(p[0]),o(p[1]),o(p[2]),h];case"hsla":if(4!==p.length)return null;h=a(p.pop());case"hsl":if(3!==p.length)return null;var f=(parseFloat(p[0])%360+360)%360/360,d=a(p[1]),m=a(p[2]),v=m<=.5?m*(d+1):m+d-m*d,y=2*m-v;return[n(255*s(y,v,f+1/3)),n(255*s(y,v,f)),n(255*s(y,v,f-1/3)),h];default:return null}}return null}var u={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};try{r.parseCSSColor=l}catch(t){}},{}],115:[function(t,e,r){function n(t){return!!t&&"object"==typeof t}function i(t,e){for(var r=-1,n=t.length;++ru))return!1;for(;++l-1&&t%1==0&&t<=c}function l(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function u(t){return!!t&&"object"==typeof t}var c=9007199254740991,p="[object Arguments]",h="[object Function]",f="[object GeneratorFunction]",d=Object.prototype,m=d.hasOwnProperty,v=d.toString,y=d.propertyIsEnumerable;e.exports=n},{}],119:[function(t,e,r){function n(t){return!!t&&"object"==typeof t}function i(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=v}function o(t){return a(t)&&f.call(t)==l}function a(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function s(t){return null!=t&&(o(t)?d.test(p.call(t)):n(t)&&u.test(t))}var l="[object Function]",u=/^\[object .+?Constructor\]$/,c=Object.prototype,p=Function.prototype.toString,h=c.hasOwnProperty,f=c.toString,d=RegExp("^"+p.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),m=function(t,e){var r=null==t?void 0:t[e];return s(r)?r:void 0}(Array,"isArray"),v=9007199254740991,y=m||function(t){return n(t)&&i(t.length)&&"[object Array]"==f.call(t)};e.exports=y},{}],120:[function(t,e,r){function n(t,e,r,n){r="function"==typeof r?o(r,n,3):void 0;var a=r?r(t,e):void 0;return void 0===a?i(t,e,r):!!a}var i=t("lodash._baseisequal"),o=t("lodash._bindcallback");e.exports=n},{"lodash._baseisequal":115,"lodash._bindcallback":116}],121:[function(t,e,r){function n(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=a}function i(t){return!!t&&"object"==typeof t}function o(t){return i(t)&&n(t.length)&&!!s[u.call(t)]}var a=9007199254740991,s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1;var l=Object.prototype,u=l.toString;e.exports=o},{}],122:[function(t,e,r){function n(t){return null!=t&&o(y(t))}function i(t,e){return t="number"==typeof t||h.test(t)?+t:-1,e=null==e?v:e,t>-1&&t%1==0&&t-1&&t%1==0&&t<=v}function a(t){for(var e=l(t),r=e.length,n=r&&t.length,a=!!n&&o(n)&&(p(t)||c(t)),s=-1,u=[];++s0;++n":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:22,value:["number","color"],length:2},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},transition:!1,"zoom-function":!0,"property-function":!1,function:"piecewise-constant"},position:{type:"array",default:[1.15,210,30],length:3,value:"number",transition:!0,function:"interpolated","zoom-function":!0,"property-function":!1},color:{type:"color",default:"#ffffff",function:"interpolated","zoom-function":!0,"property-function":!1,transition:!0},intensity:{type:"number",default:.5,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!1,transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_fill-extrusion","paint_symbol","paint_raster","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!0},"fill-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0},"fill-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"}]},"fill-outline-color":{type:"color",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}]},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels"},"fill-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["fill-translate"]},"fill-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!1,default:1,minimum:0,maximum:1,transition:!0},"fill-extrusion-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-extrusion-pattern"}]},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels"},"fill-extrusion-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"]},"fill-extrusion-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0},"fill-extrusion-height":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:0,minimum:0,units:"meters",transition:!0},"fill-extrusion-base":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:0,minimum:0,maximum:65535,units:"meters",transition:!0,requires:["fill-extrusion-height"]}},paint_line:{"line-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0},"line-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"line-pattern"}]},"line-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels"},"line-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["line-translate"]},"line-width":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-gap-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-offset":{type:"number",default:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-dasharray":{type:"array",value:"number",function:"piecewise-constant","zoom-function":!0,minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}]},"line-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-blur":{type:"number",default:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels"},"circle-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["circle-translate"]},"circle-pitch-scale":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map"},"circle-pitch-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"viewport"},"circle-stroke-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-stroke-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"]},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"]}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-hue-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,transition:!0,units:"degrees"},"raster-brightness-min":{type:"number",function:"interpolated","zoom-function":!0,default:0,minimum:0,maximum:1,transition:!0},"raster-brightness-max":{type:"number",function:"interpolated","zoom-function":!0,default:1,minimum:0,maximum:1,transition:!0},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-fade-duration":{type:"number",default:300,minimum:0,function:"interpolated","zoom-function":!0,transition:!0,units:"milliseconds"}},paint_background:{"background-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,transition:!0,requires:[{"!":"background-pattern"}]},"background-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}}}},{}],125:[function(t,e,r){"use strict";e.exports=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n7)return[new n(c,l,"constants have been deprecated as of v8")];if(!(l in h.constants))return[new n(c,l,'constant "%s" not found',l)];e=o({},e,{value:h.constants[l]})}return u.function&&"object"===i(l)?r(e):u.type&&s[u.type]?s[u.type](e):a(o({},e,{valueSpec:u.type?p[u.type]:u}))}},{"../error/validation_error":109,"../util/extend":125,"../util/get_type":126,"./validate_array":132,"./validate_boolean":133,"./validate_color":134,"./validate_constants":135,"./validate_enum":136,"./validate_filter":137,"./validate_function":138,"./validate_layer":140,"./validate_light":142,"./validate_number":143,"./validate_object":144,"./validate_source":147,"./validate_string":148}],132:[function(t,e,r){"use strict";var n=t("../util/get_type"),i=t("./validate"),o=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.valueSpec,a=t.style,s=t.styleSpec,l=t.key,u=t.arrayElementValidator||i;if("array"!==n(e))return[new o(l,e,"array expected, %s found",n(e))];if(r.length&&e.length!==r.length)return[new o(l,e,"array length %d expected, length %d found",r.length,e.length)];if(r["min-length"]&&e.length7)return r?[new n(e,r,"constants have been deprecated as of v8")]:[];var o=i(r);if("object"!==o)return[new n(e,r,"object expected, %s found",o)];var a=[];for(var s in r)"@"!==s[0]&&a.push(new n(e+"."+s,r[s],'constants must start with "@"'));return a}},{"../error/validation_error":109,"../util/get_type":126}],136:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint");e.exports=function(t){var e=t.key,r=t.value,o=t.valueSpec,a=[];return Array.isArray(o.values)?-1===o.values.indexOf(i(r))&&a.push(new n(e,r,"expected one of [%s], %s found",o.values.join(", "),r)):-1===Object.keys(o.values).indexOf(i(r))&&a.push(new n(e,r,"expected one of [%s], %s found",Object.keys(o.values).join(", "),r)),a}},{"../error/validation_error":109,"../util/unbundle_jsonlint":130}],137:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("./validate_enum"),o=t("../util/get_type"),a=t("../util/unbundle_jsonlint");e.exports=function t(e){var r,s=e.value,l=e.key,u=e.styleSpec,c=[];if("array"!==o(s))return[new n(l,s,"array expected, %s found",o(s))];if(s.length<1)return[new n(l,s,"filter array must have at least 1 element")];switch(c=c.concat(i({key:l+"[0]",value:s[0],valueSpec:u.filter_operator,style:e.style,styleSpec:e.styleSpec})),a(s[0])){case"<":case"<=":case">":case">=":s.length>=2&&"$type"===a(s[1])&&c.push(new n(l,s,'"$type" cannot be use with operator "%s"',s[0]));case"==":case"!=":3!==s.length&&c.push(new n(l,s,'filter array for operator "%s" must have 3 elements',s[0]));case"in":case"!in":s.length>=2&&"string"!==(r=o(s[1]))&&c.push(new n(l+"[1]",s[1],"string expected, %s found",r));for(var p=2;pu(r[0].zoom))return[new n(s,r[0].zoom,"stop zoom values must appear in ascending order")];u(r[0].zoom)!==d&&(d=u(r[0].zoom),f=void 0,y={}),e=e.concat(a({key:s+"[0]",value:r[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:l,value:c}}))}else e=e.concat(c({key:s+"[0]",value:r[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec}));return e.concat(o({key:s+"[1]",value:r[1],valueSpec:m,style:t.style,styleSpec:t.styleSpec}))}function c(t){var e=i(t.value),r=u(t.value);if(h){if(e!==h)return[new n(t.key,t.value,"%s stop domain type must match previous stop domain type %s",e,h)]}else h=e;if("number"!==e&&"string"!==e&&"boolean"!==e)return[new n(t.key,t.value,"stop domain value must be a number, string, or boolean")];if("number"!==e&&"categorical"!==v){var o="number expected, %s found";return m["property-function"]&&void 0===v&&(o+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new n(t.key,t.value,o,e)]}return"categorical"!==v||"number"!==e||isFinite(r)&&Math.floor(r)===r?"categorical"!==v&&"number"===e&&void 0!==f&&r=8&&(_&&!t.valueSpec["property-function"]?b.push(new n(t.key,t.value,"property functions not supported")):g&&!t.valueSpec["zoom-function"]&&b.push(new n(t.key,t.value,"zoom functions not supported"))),"categorical"!==v&&!x||void 0!==t.value.property||b.push(new n(t.key,t.value,'"property" property is required')),b}},{"../error/validation_error":109,"../util/get_type":126,"../util/unbundle_jsonlint":130,"./validate":131,"./validate_array":132,"./validate_number":143,"./validate_object":144}],139:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("./validate_string");e.exports=function(t){var e=t.value,r=t.key,o=i(t);return o.length?o:(-1===e.indexOf("{fontstack}")&&o.push(new n(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&o.push(new n(r,e,'"glyphs" url must include a "{range}" token')),o)}},{"../error/validation_error":109,"./validate_string":148}],140:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint"),o=t("./validate_object"),a=t("./validate_filter"),s=t("./validate_paint_property"),l=t("./validate_layout_property"),u=t("../util/extend");e.exports=function(t){var e=[],r=t.value,c=t.key,p=t.style,h=t.styleSpec;r.type||r.ref||e.push(new n(c,r,'either "type" or "ref" is required'));var f=i(r.type),d=i(r.ref);if(r.id)for(var m=i(r.id),v=0;vo.maximum?[new i(e,r,"%s is greater than the maximum value %s",r,o.maximum)]:[]}},{"../error/validation_error":109,"../util/get_type":126}],144:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/get_type"),o=t("./validate");e.exports=function(t){var e=t.key,r=t.value,a=t.valueSpec||{},s=t.objectElementValidators||{},l=t.style,u=t.styleSpec,c=[],p=i(r);if("object"!==p)return[new n(e,r,"object expected, %s found",p)];for(var h in r){var f=h.split(".")[0],d=a[f]||a["*"],m=void 0;if(s[f])m=s[f];else if(a[f])m=o;else if(s["*"])m=s["*"];else{if(!a["*"]){c.push(new n(e,r[h],'unknown property "%s"',h));continue}m=o}c=c.concat(m({key:(e?e+".":e)+h,value:r[h],valueSpec:d,style:l,styleSpec:u,object:r,objectKey:h}))}for(var v in a)a[v].required&&void 0===a[v].default&&void 0===r[v]&&c.push(new n(e,r,'missing required property "%s"',v));return c}},{"../error/validation_error":109,"../util/get_type":126,"./validate":131}],145:[function(t,e,r){"use strict";var n=t("./validate_property");e.exports=function(t){return n(t,"paint")}},{"./validate_property":146}],146:[function(t,e,r){"use strict";var n=t("./validate"),i=t("../error/validation_error"),o=t("../util/get_type");e.exports=function(t,e){var r=t.key,a=t.style,s=t.styleSpec,l=t.value,u=t.objectKey,c=s[e+"_"+t.layerType];if(!c)return[];var p=u.match(/^(.*)-transition$/);if("paint"===e&&p&&c[p[1]]&&c[p[1]].transition)return n({key:r,value:l,valueSpec:s.transition,style:a,styleSpec:s});var h=t.valueSpec||c[u];if(!h)return[new i(r,l,'unknown property "%s"',u)];var f;if("string"===o(l)&&h["property-function"]&&!h.tokens&&(f=/^{([^}]+)}$/.exec(l)))return[new i(r,l,'"%s" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": %s` }`.',u,JSON.stringify(f[1]))];var d=[];return"symbol"===t.layerType&&"text-field"===u&&a&&!a.glyphs&&d.push(new i(r,l,'use of "text-field" requires a style "glyphs" property')),d.concat(n({key:t.key,value:l,valueSpec:h,style:a,styleSpec:s}))}},{"../error/validation_error":109,"../util/get_type":126,"./validate":131}],147:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint"),o=t("./validate_object"),a=t("./validate_enum");e.exports=function(t){var e=t.value,r=t.key,s=t.styleSpec,l=t.style;if(!e.type)return[new n(r,e,'"type" is required')];var u=i(e.type),c=[];switch(u){case"vector":case"raster":if(c=c.concat(o({key:r,value:e,valueSpec:s.source_tile,style:t.style,styleSpec:s})),"url"in e)for(var p in e)["type","url","tileSize"].indexOf(p)<0&&c.push(new n(r+"."+p,e[p],'a source with a "url" property may not include a "%s" property',p));return c;case"geojson":return o({key:r,value:e,valueSpec:s.source_geojson,style:l,styleSpec:s});case"video":return o({key:r,value:e,valueSpec:s.source_video,style:l,styleSpec:s});case"image":return o({key:r,value:e,valueSpec:s.source_image,style:l,styleSpec:s});case"canvas":return o({key:r,value:e,valueSpec:s.source_canvas,style:l,styleSpec:s});default:return a({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","geojson","video","image","canvas"]},style:l,styleSpec:s})}}},{"../error/validation_error":109,"../util/unbundle_jsonlint":130,"./validate_enum":136,"./validate_object":144}],148:[function(t,e,r){"use strict";var n=t("../util/get_type"),i=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.key,o=n(e);return"string"!==o?[new i(r,e,"string expected, %s found",o)]:[]}},{"../error/validation_error":109,"../util/get_type":126}],149:[function(t,e,r){"use strict";function n(t,e){e=e||l;var r=[];return r=r.concat(s({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:u,"*":function(){return[]}}})),e.$version>7&&t.constants&&(r=r.concat(a({key:"constants",value:t.constants,style:t,styleSpec:e}))),i(r)}function i(t){return[].concat(t).sort(function(t,e){return t.line-e.line})}function o(t){return function(){return i(t.apply(this,arguments))}}var a=t("./validate/validate_constants"),s=t("./validate/validate"),l=t("./reference/latest"),u=t("./validate/validate_glyphs_url");n.source=o(t("./validate/validate_source")),n.light=o(t("./validate/validate_light")),n.layer=o(t("./validate/validate_layer")),n.filter=o(t("./validate/validate_filter")),n.paintProperty=o(t("./validate/validate_paint_property")),n.layoutProperty=o(t("./validate/validate_layout_property")),e.exports=n},{"./reference/latest":123,"./validate/validate":131,"./validate/validate_constants":135,"./validate/validate_filter":137,"./validate/validate_glyphs_url":139,"./validate/validate_layer":140,"./validate/validate_layout_property":141,"./validate/validate_light":142,"./validate/validate_paint_property":145,"./validate/validate_source":147}],150:[function(t,e,r){"use strict";var n=function(){this.n=0,this.times=[]};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})},e.exports=n},{}],151:[function(t,e,r){"use strict";var n=t("../style-spec/reference/latest"),i=t("../util/util"),o=t("../util/evented"),a=t("./validate_style"),s=t("./style_declaration"),l=t("./style_transition"),u=["anchor","color","position","intensity"],c=n.light,p=function(t){function e(e){t.call(this),this.set(e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){var e=this;if(!this._validate(a.light,t)){this._declarations={},this._transitions={},this._transitionOptions={},this.calculated={},t=i.extend({anchor:c.anchor.default,color:c.color.default,position:c.position.default,intensity:c.intensity.default},t);for(var r=0,n=u;r1?"@2x":"";n.getJSON(e(a(t,p,".json"),n.ResourceType.SpriteJSON),function(t,e){c||(c=t,s=e,o())}),n.getImage(e(a(t,p,".png"),n.ResourceType.SpriteImage),function(t,e){c||(c=t,u=e,o())})}},{"../util/ajax":201,"../util/browser":202,"../util/image":213,"../util/mapbox":217}],154:[function(t,e,r){"use strict";function n(t,e,r){1===t&&r.readMessage(i,e)}function i(t,e,r){if(3===t){var n=r.readMessage(o,{}),i=n.id,a=n.bitmap,l=n.width,c=n.height,p=n.left,h=n.top,f=n.advance;e.push({id:i,bitmap:s.create({width:l+2*u,height:c+2*u},a),metrics:{width:l,height:c,left:p,top:h,advance:f}})}}function o(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint())}var a=t("../util/image"),s=a.AlphaImage,l=t("pbf"),u=3;e.exports=function(t){return new l(t).readFields(n,[])},e.exports.GLYPH_PBF_BORDER=u},{"../util/image":213,pbf:29}],155:[function(t,e,r){"use strict";function n(t,e,r){return e.isPaintValueFeatureConstant(t)?e.paint[t]:r.programConfigurations.get(e.id).paintPropertyStatistics[t].max}function i(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function o(t,e,r,n,i){if(!e[0]&&!e[1])return t;var o=a.convert(e);"viewport"===r&&o._rotate(-n);for(var s=[],l=0;lMath.floor(t)&&(e.lastIntegerZoom=Math.floor(t+1),e.lastIntegerZoomTime=Date.now()),e.lastZoom=t},e.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},e.prototype.update=function(t,e){var r=this;if(this._changed){var n=Object.keys(this._updatedLayers),i=Object.keys(this._removedLayers);(n.length||i.length||this._updatedSymbolOrder)&&this._updateWorkerLayers(n,i);for(var o in r._updatedSources){var a=r._updatedSources[o];"reload"===a?r._reloadSource(o):"clear"===a&&r._clearSource(o)}this._applyClasses(t,e),this._resetUpdates(),this.fire("data",{dataType:"style"})}},e.prototype._updateWorkerLayers=function(t,e){var r=this,n=this._updatedSymbolOrder?this._order.filter(function(t){return"symbol"===r._layers[t].type}):null;this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(t),removedIds:e,symbolOrder:n})},e.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSymbolOrder=!1,this._updatedSources={},this._updatedPaintProps={},this._updatedAllPaintProps=!1},e.prototype.setState=function(t){var e=this;if(this._checkLoaded(),v.emitErrors(this,v(t)))return!1;t=c.clone(t),t.layers=S(t.layers);var r=z(this.serialize(),t).filter(function(t){return!(t.command in E)});if(0===r.length)return!1;var n=r.filter(function(t){return!(t.command in C)});if(n.length>0)throw new Error("Unimplemented: "+n.map(function(t){return t.command}).join(", ")+".");return r.forEach(function(t){"setTransition"!==t.command&&e[t.command].apply(e,t.args)}),this.stylesheet=t,!0},e.prototype.addImage=function(t,e){if(this.imageManager.getImage(t))return this.fire("error",{error:new Error("An image with this name already exists.")});this.imageManager.addImage(t,e),this.fire("data",{dataType:"style"})},e.prototype.removeImage=function(t){if(!this.imageManager.getImage(t))return this.fire("error",{error:new Error("No image with this name exists.")});this.imageManager.removeImage(t),this.fire("data",{dataType:"style"})},e.prototype.addSource=function(t,e,r){var n=this;if(this._checkLoaded(),void 0!==this.sourceCaches[t])throw new Error("There is already a source with this ID");if(!e.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(e).join(", ")+".");if(!(["vector","raster","geojson","video","image","canvas"].indexOf(e.type)>=0&&this._validate(v.source,"sources."+t,e,null,r))){var i=this.sourceCaches[t]=new x(t,e,this.dispatcher);i.style=this,i.setEventedParent(this,function(){return{isSourceLoaded:n.loaded(),source:i.serialize(),sourceId:t}}),i.onAdd(this.map),this._changed=!0}},e.prototype.removeSource=function(t){if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error("There is no source with this ID");var e=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],e.fire("data",{sourceDataType:"metadata",dataType:"source",sourceId:t}),e.setEventedParent(null),e.clearTiles(),e.onRemove&&e.onRemove(this.map),this._changed=!0},e.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},e.prototype.addLayer=function(t,e,r){this._checkLoaded();var n=t.id;if("object"==typeof t.source&&(this.addSource(n,t.source),t=c.clone(t),t=c.extend(t,{source:n})),!this._validate(v.layer,"layers."+n,t,{arrayIndex:-1},r)){var o=i.create(t);this._validateLayer(o),o.setEventedParent(this,{layer:{id:n}});var a=e?this._order.indexOf(e):this._order.length;if(this._order.splice(a,0,n),this._layers[n]=o,this._removedLayers[n]&&o.source){var s=this._removedLayers[n];delete this._removedLayers[n],s.type!==o.type?this._updatedSources[o.source]="clear":(this._updatedSources[o.source]="reload",this.sourceCaches[o.source].pause())}this._updateLayer(o),"symbol"===o.type&&(this._updatedSymbolOrder=!0),this.updateClasses(n)}},e.prototype.moveLayer=function(t,e){this._checkLoaded(),this._changed=!0;var r=this._layers[t];if(!r)return void this.fire("error",{error:new Error("The layer '"+t+"' does not exist in the map's style and cannot be moved.")});var n=this._order.indexOf(t);this._order.splice(n,1);var i=e?this._order.indexOf(e):this._order.length;this._order.splice(i,0,t),"symbol"===r.type&&(this._updatedSymbolOrder=!0,r.source&&!this._updatedSources[r.source]&&(this._updatedSources[r.source]="reload",this.sourceCaches[r.source].pause()))},e.prototype.removeLayer=function(t){this._checkLoaded();var e=this._layers[t];if(!e)return void this.fire("error",{error:new Error("The layer '"+t+"' does not exist in the map's style and cannot be removed.")});e.setEventedParent(null);var r=this._order.indexOf(t);this._order.splice(r,1),"symbol"===e.type&&(this._updatedSymbolOrder=!0),this._changed=!0,this._removedLayers[t]=e,delete this._layers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t]},e.prototype.getLayer=function(t){return this._layers[t]},e.prototype.setLayerZoomRange=function(t,e,r){this._checkLoaded();var n=this.getLayer(t);if(!n)return void this.fire("error",{error:new Error("The layer '"+t+"' does not exist in the map's style and cannot have zoom extent.")});n.minzoom===e&&n.maxzoom===r||(null!=e&&(n.minzoom=e),null!=r&&(n.maxzoom=r),this._updateLayer(n))},e.prototype.setFilter=function(t,e){this._checkLoaded();var r=this.getLayer(t);if(!r)return void this.fire("error",{error:new Error("The layer '"+t+"' does not exist in the map's style and cannot be filtered.")});null!==e&&void 0!==e&&this._validate(v.filter,"layers."+r.id+".filter",e)||c.deepEqual(r.filter,e)||(r.filter=c.clone(e),this._updateLayer(r))},e.prototype.getFilter=function(t){return c.clone(this.getLayer(t).filter)},e.prototype.setLayoutProperty=function(t,e,r){this._checkLoaded();var n=this.getLayer(t);if(!n)return void this.fire("error",{error:new Error("The layer '"+t+"' does not exist in the map's style and cannot be styled.")});c.deepEqual(n.getLayoutProperty(e),r)||(n.setLayoutProperty(e,r),this._updateLayer(n))},e.prototype.getLayoutProperty=function(t,e){return this.getLayer(t).getLayoutProperty(e)},e.prototype.setPaintProperty=function(t,e,r,n){this._checkLoaded();var i=this.getLayer(t);if(!i)return void this.fire("error",{error:new Error("The layer '"+t+"' does not exist in the map's style and cannot be styled.")});if(!c.deepEqual(i.getPaintProperty(e,n),r)){var o=i.isPaintValueFeatureConstant(e);i.setPaintProperty(e,r,n),!(r&&w.isFunctionDefinition(r)&&"$zoom"!==r.property&&void 0!==r.property)&&o||this._updateLayer(i),this.updateClasses(t,e)}},e.prototype.getPaintProperty=function(t,e,r){return this.getLayer(t).getPaintProperty(e,r)},e.prototype.getTransition=function(){return c.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},e.prototype.updateClasses=function(t,e){if(this._changed=!0,t){var r=this._updatedPaintProps;r[t]||(r[t]={}),r[t][e||"all"]=!0}else this._updatedAllPaintProps=!0},e.prototype.serialize=function(){var t=this;return c.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:c.mapObject(this.sourceCaches,function(t){return t.serialize()}),layers:this._order.map(function(e){return t._layers[e].serialize()})},function(t){return void 0!==t})},e.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},e.prototype._flattenRenderedFeatures=function(t){for(var e=this,r=[],n=this._order.length-1;n>=0;n--)for(var i=e._order[n],o=0,a=t;o=this.maxzoom)||"none"===this.layout.visibility},e.prototype.updatePaintTransitions=function(t,e,r,n,o){for(var a=this,s=i.extend({},this._paintDeclarations[""]),l=0;l0?e+2*t:t}function i(t,e){for(var r=[],n=new o(0,0),i=0;i=this.endTime)return n;var o=this.oldTransition.calculate(t,e,this.startTime),a=i.easeCubicInOut((r-this.startTime-this.delay)/this.duration);return this.interp(o,n,a)},s.prototype._calculateTargetValue=function(t,e){if(!this.zoomTransitioned)return this.declaration.calculate(t,e);var r=t.zoom,n=this.zoomHistory.lastIntegerZoom,i=r>n?2:.5,a=this.declaration.calculate({zoom:r>n?r-1:r+1},e),s=this.declaration.calculate({zoom:r},e),l=Math.min((Date.now()-this.zoomHistory.lastIntegerZoomTime)/this.duration,1),u=Math.abs(r-n),c=o(l,1,u);return void 0!==a&&void 0!==s?{from:a,fromScale:i,to:s,toScale:1,t:c}:void 0},e.exports=s},{"../style-spec/util/interpolate":127,"../util/util":223}],166:[function(t,e,r){"use strict";e.exports=t("../style-spec/validate_style.min"),e.exports.emitErrors=function(t,e){if(e&&e.length){for(var r=0,n=e;r-r/2;){if(--a<0)return!1;s-=t[a].dist(o),o=t[a]}s+=t[a].dist(t[a+1]),a++;for(var l=[],u=0;sn;)u-=l.shift().angleDelta;if(u>i)return!1;a++,s+=p.dist(h)}return!0}e.exports=n},{}],169:[function(t,e,r){"use strict";function n(t,e,r,n,o){for(var a=[],s=0;s=n&&h.x>=n||(p.x>=n?p=new i(n,p.y+(h.y-p.y)*((n-p.x)/(h.x-p.x)))._round():h.x>=n&&(h=new i(n,p.y+(h.y-p.y)*((n-p.x)/(h.x-p.x)))._round()),p.y>=o&&h.y>=o||(p.y>=o?p=new i(p.x+(h.x-p.x)*((o-p.y)/(h.y-p.y)),o)._round():h.y>=o&&(h=new i(p.x+(h.x-p.x)*((o-p.y)/(h.y-p.y)),o)._round()),u&&p.equals(u[u.length-1])||(u=[p],a.push(u)),u.push(h)))))}return a}var i=t("@mapbox/point-geometry");e.exports=n},{"@mapbox/point-geometry":2}],170:[function(t,e,r){"use strict";var n=t("../util/struct_array"),i=t("@mapbox/point-geometry"),o=n({members:[{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"offsetX"},{type:"Int16",name:"offsetY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Float32",name:"unadjustedMaxScale"},{type:"Float32",name:"maxScale"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"},{type:"Int16",name:"bbox0"},{type:"Int16",name:"bbox1"},{type:"Int16",name:"bbox2"},{type:"Int16",name:"bbox3"},{type:"Float32",name:"placementScale"}]});Object.defineProperty(o.prototype.StructType.prototype,"anchorPoint",{get:function(){return new i(this.anchorPointX,this.anchorPointY)}}),e.exports=o},{"../util/struct_array":220,"@mapbox/point-geometry":2}],171:[function(t,e,r){"use strict";var n=function(t,e,r,n,i,o,a,s,l,u,c){var p=a.top*s-l,h=a.bottom*s+l,f=a.left*s-l,d=a.right*s+l;if(this.boxStartIndex=t.length,u){var m=h-p,v=d-f;if(m>0)if(m=Math.max(10*s,m),c){var y=e[r.segment+1].sub(e[r.segment])._unit()._mult(v),g=[r.sub(y),r.add(y)];this._addLineCollisionBoxes(t,g,r,0,v,m,n,i,o)}else this._addLineCollisionBoxes(t,e,r,r.segment,v,m,n,i,o)}else t.emplaceBack(r.x,r.y,0,0,f,p,d,h,1/0,1/0,n,i,o,0,0,0,0,0);this.boxEndIndex=t.length};n.prototype._addLineCollisionBoxes=function(t,e,r,n,i,o,a,s,l){var u=o/2,c=Math.floor(i/u),p=Math.floor(c/2),h=-o/2,f=r,d=n+1,m=h,v=-i/2,y=v-i/8;do{if(--d<0){if(m>v)return;d=0;break}m-=e[d].dist(f),f=e[d]}while(m>y);for(var g=e[d].dist(e[d+1]),_=-p;_i&&(b+=x-i),!(b=e.length)return;g=e[d].dist(e[d+1])}var w=b-m,T=e[d],S=e[d+1],z=S.sub(T)._unit()._mult(w)._add(T)._round(),A=Math.max(Math.abs(b-h)-u/2,0),C=i/2/A;(_<0||_>=c)&&(C=Math.min(C,.99)),t.emplaceBack(z.x,z.y,z.x-r.x,z.y-r.y,-o/2,-o/2,o/2,o/2,C,C,a,s,l,0,0,0,0,0)}}},e.exports=n},{}],172:[function(t,e,r){"use strict";var n=t("@mapbox/point-geometry"),i=t("../data/extent"),o=t("grid-index"),a=t("../util/intersection_tests"),s=function(t,e,r,n,a,s,l){void 0===s&&(s=new o(i,12,6)),void 0===l&&(l=new o(i,12,0)),this.angle=t,this.pitch=e,this.cameraToCenterDistance=r,this.cameraToTileDistance=n,this.grid=s,this.ignoredGrid=l,this.perspectiveRatio=1+.5*(n/r-1),this.minScale=.5/this.perspectiveRatio,this.maxScale=2/this.perspectiveRatio;var u=Math.sin(this.angle),c=Math.cos(this.angle);this.rotationMatrix=[c,-u,u,c],this.reverseRotationMatrix=[c,u,-u,c],this.yStretch=Math.max(1,n/(r*Math.cos(e/180*Math.PI))),this.collisionBoxArray=a,0===a.length&&(a.emplaceBack(),a.emplaceBack(0,0,0,0,0,-i,0,i,1/0,1/0,0,0,0,0,0,0,0,0,0),a.emplaceBack(i,0,0,0,0,-i,0,i,1/0,1/0,0,0,0,0,0,0,0,0,0),a.emplaceBack(0,0,0,0,-i,0,i,0,1/0,1/0,0,0,0,0,0,0,0,0,0),a.emplaceBack(0,i,0,0,-i,0,i,0,1/0,1/0,0,0,0,0,0,0,0,0,0)),this.tempCollisionBox=a.get(0),this.edges=[a.get(1),a.get(2),a.get(3),a.get(4)]};s.deserialize=function(t,e){return new s(t.angle,t.pitch,t.cameraToCenterDistance,t.cameraToTileDistance,e,new o(t.grid),new o(t.ignoredGrid))},s.prototype.serialize=function(t){var e=this.grid.toArrayBuffer(),r=this.ignoredGrid.toArrayBuffer();return t&&(t.push(e),t.push(r)),{angle:this.angle,pitch:this.pitch,cameraToCenterDistance:this.cameraToCenterDistance,cameraToTileDistance:this.cameraToTileDistance,grid:e,ignoredGrid:r}},s.prototype.placeCollisionFeature=function(t,e,r){for(var i=this,o=this.collisionBoxArray,a=this.minScale,s=this.rotationMatrix,l=this.yStretch,u=t.boxStartIndex;u=i.maxScale)return a}if(r){var C=void 0;if(i.angle){var E=i.reverseRotationMatrix,k=new n(c.x1,c.y1).matMult(E),M=new n(c.x2,c.y1).matMult(E),L=new n(c.x1,c.y2).matMult(E),I=new n(c.x2,c.y2).matMult(E);C=i.tempCollisionBox,C.anchorPointX=c.anchorPoint.x,C.anchorPointY=c.anchorPoint.y,C.x1=Math.min(k.x,M.x,L.x,I.x),C.y1=Math.min(k.y,M.x,L.x,I.x),C.x2=Math.max(k.x,M.x,L.x,I.x),C.y2=Math.max(k.y,M.x,L.x,I.x),C.maxScale=c.maxScale}else C=c;for(var P=0;P=i.maxScale)return a}}}return a},s.prototype.queryRenderedSymbols=function(t,e){var r={},i=[];if(0===t.length||0===this.grid.keys.length&&0===this.ignoredGrid.keys.length)return i;for(var o=this.collisionBoxArray,s=this.rotationMatrix,l=this.yStretch,u=[],c=1/0,p=1/0,h=-1/0,f=-1/0,d=0;dS.maxScale)){var C=S.anchorPoint.matMult(s),E=C.x+S.x1/b,k=C.y+S.y1/b*l,M=C.x+S.x2/b,L=C.y+S.y2/b*l,I=[new n(E,k),new n(M,k),new n(M,L),new n(E,L)];a.polygonIntersectsPolygon(u,I)&&(r[z][A]=!0,i.push(g[T]))}}return i},s.prototype.getPlacementScale=function(t,e,r,n,i){var o=e.x-n.x,a=e.y-n.y,s=(i.x1-r.x2)/o,l=(i.x2-r.x1)/o,u=(i.y1-r.y2)*this.yStretch/a,c=(i.y2-r.y1)*this.yStretch/a;(isNaN(s)||isNaN(l))&&(s=l=1),(isNaN(u)||isNaN(c))&&(u=c=1);var p=Math.min(Math.max(s,l),Math.max(u,c)),h=i.maxScale,f=r.maxScale;return p>h&&(p=h),p>f&&(p=f),p>t&&p>=i.placementScale&&(t=p),t},s.prototype.insertCollisionFeature=function(t,e,r){for(var n=this,i=r?this.ignoredGrid:this.grid,o=this.collisionBoxArray,a=t.boxStartIndex;a=1)&&i.insert(a,s.bbox0,s.bbox1,s.bbox2,s.bbox3)}},e.exports=s},{"../data/extent":48,"../util/intersection_tests":214,"@mapbox/point-geometry":2,"grid-index":22}],173:[function(t,e,r){"use strict";function n(t,e,r,n,o,a,s,l,u){var c=n?.6*a*s:0,p=Math.max(n?n.right-n.left:0,o?o.right-o.left:0),h=0===t[0].x||t[0].x===u||0===t[0].y||t[0].y===u;e-p*s=0&&z=0&&A=0&&y+f<=d){var C=new a(z,A,T,_);C._round(),n&&!s(t,C,u,n,l)||g.push(C)}}v+=w}return p||g.length||c||(g=i(t,v/2,r,n,l,u,c,!0,h)),g}var o=t("../style-spec/util/interpolate"),a=t("../symbol/anchor"),s=t("./check_max_angle");e.exports=n},{"../style-spec/util/interpolate":127,"../symbol/anchor":167,"./check_max_angle":168}],174:[function(t,e,r){"use strict";e.exports=function(t){function e(e){s.push(t[e]),l++}function r(t,e,r){var n=a[t];return delete a[t],a[e]=n,s[n].geometry[0].pop(),s[n].geometry[0]=s[n].geometry[0].concat(r[0]),n}function n(t,e,r){var n=o[e];return delete o[e],o[t]=n,s[n].geometry[0].shift(),s[n].geometry[0]=r[0].concat(s[n].geometry[0]),n}function i(t,e,r){var n=r?e[0][e[0].length-1]:e[0][0];return t+":"+n.x+":"+n.y}for(var o={},a={},s=[],l=0,u=0;u=-r[0]&&i<=r[0]&&o>=-r[1]&&o<=r[1]&&n.frameHistory.isVisible(e)}function s(t,e,r,n,i,s,u,c,f,d){var y=n?t.textSizeData:t.iconSizeData,g=v.evaluateSizeForZoom(y,r.transform,d,n),_=[256/r.width*2+1,256/r.height*2+1],x=n?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;x.clear();for(var b=t.lineVertexArray,w=n?t.placedGlyphArray:t.placedIconArray,T=0;T1){var w=t.glyphStartIndex+t.numGlyphs,T=l.get(t.glyphStartIndex).offsetX,S=l.get(w-1).offsetX,z=t.lineStartIndex,A=t.lineStartIndex+t.lineLength,C=c(_*T,x,b,r,d,m,t.segment,z,A,p,a,v);if(!C)return{notEnoughRoom:!0};var E=c(_*S,x,b,r,d,m,t.segment,z,A,p,a,v);if(!E)return{notEnoughRoom:!0};var k=o(C.point,s).point,M=o(E.point,s).point;if(n&&!r&&(t.vertical?k.yM.x))return{needsFlipping:!0};y=[C];for(var L=t.glyphStartIndex+1;L0?D.point:u(m,new h(R.x,R.y),P,1,i);if(t.vertical?O.y>P.y:O.x0?1:-1,y=0;n&&(v*=-1,y=Math.PI),v<0&&(y+=Math.PI);for(var g=v>0?l+s:l+s+1,_=i,x=i,b=0,w=0,T=Math.abs(m);b+w<=T;){if((g+=v)=c)return null;if(x=_,void 0===(_=d[g])){var S=o(p.get(g),f);_=S.signedDistanceFromCamera>0?d[g]=S.point:u(0===b?a:new h(p.get(g-v).x,p.get(g-v).y),new h(p.get(g).x,p.get(g).y),x,T-b+1,f)}b+=w,w=x.dist(_)}var z=(T-b)/w,A=_.sub(x),C=A.mult(z)._add(x);return C._add(A._unit()._perp()._mult(r*v)),{point:C,angle:y+Math.atan2(_.y-x.y,_.x-x.x)}}function p(t,e){for(var r=0;r1||(T?(clearTimeout(T),T=null,y("dblclick",e)):T=setTimeout(f,300))}function c(t){g("touchmove",t)}function p(t){g("touchend",t)}function h(t){g("touchcancel",t)}function f(){T=null}function d(t){n.mousePos(_,t).equals(w)&&y("click",t)}function m(t){y("dblclick",t),t.preventDefault()}function v(e){var r=t.dragRotate&&t.dragRotate.isActive();b||r?b&&(x=e):y("contextmenu",e),e.preventDefault()}function y(e,r){var i=n.mousePos(_,r);return t.fire(e,{lngLat:t.unproject(i),point:i,originalEvent:r})}function g(e,r){var o=n.touchPos(_,r),a=o.reduce(function(t,e,r,n){return t.add(e.div(n.length))},new i(0,0));return t.fire(e,{lngLat:t.unproject(a),point:a,lngLats:o.map(function(e){return t.unproject(e)},this),points:o,originalEvent:r})}var _=t.getCanvasContainer(),x=null,b=!1,w=null,T=null;for(var S in o)t[S]=new o[S](t,e),e.interactive&&e[S]&&t[S].enable(e[S]);_.addEventListener("mouseout",r,!1),_.addEventListener("mousedown",a,!1),_.addEventListener("mouseup",s,!1),_.addEventListener("mousemove",l,!1),_.addEventListener("touchstart",u,!1),_.addEventListener("touchend",p,!1),_.addEventListener("touchmove",c,!1),_.addEventListener("touchcancel",h,!1),_.addEventListener("click",d,!1),_.addEventListener("dblclick",m,!1),_.addEventListener("contextmenu",v,!1)}},{"../util/dom":209,"./handler/box_zoom":189,"./handler/dblclick_zoom":190,"./handler/drag_pan":191,"./handler/drag_rotate":192,"./handler/keyboard":193,"./handler/scroll_zoom":194,"./handler/touch_zoom_rotate":195,"@mapbox/point-geometry":2}],181:[function(t,e,r){"use strict";var n=t("../util/util"),i=t("../style-spec/util/interpolate"),o=t("../util/browser"),a=t("../geo/lng_lat"),s=t("../geo/lng_lat_bounds"),l=t("@mapbox/point-geometry"),u=t("../util/evented"),c=function(t){function e(e,r){t.call(this),this.moving=!1,this.transform=e,this._bearingSnap=r.bearingSnap}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCenter=function(){return this.transform.center},e.prototype.setCenter=function(t,e){return this.jumpTo({center:t},e)},e.prototype.panBy=function(t,e,r){return t=l.convert(t).mult(-1),this.panTo(this.transform.center,n.extend({offset:t},e),r)},e.prototype.panTo=function(t,e,r){return this.easeTo(n.extend({center:t},e),r)},e.prototype.getZoom=function(){return this.transform.zoom},e.prototype.setZoom=function(t,e){return this.jumpTo({zoom:t},e),this},e.prototype.zoomTo=function(t,e,r){return this.easeTo(n.extend({zoom:t},e),r)},e.prototype.zoomIn=function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},e.prototype.zoomOut=function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},e.prototype.getBearing=function(){return this.transform.bearing},e.prototype.setBearing=function(t,e){return this.jumpTo({bearing:t},e),this},e.prototype.rotateTo=function(t,e,r){return this.easeTo(n.extend({bearing:t},e),r)},e.prototype.resetNorth=function(t,e){return this.rotateTo(0,n.extend({duration:1e3},t),e),this},e.prototype.snapToNorth=function(t,e){return Math.abs(this.getBearing())e?1:0}),["bottom","left","right","top"]))return n.warnOnce("options.padding must be a positive number, or an Object with keys 'bottom', 'left', 'right', 'top'"),this;t=s.convert(t);var o=[e.padding.left-e.padding.right,e.padding.top-e.padding.bottom],a=Math.min(e.padding.right,e.padding.left),u=Math.min(e.padding.top,e.padding.bottom);e.offset=[e.offset[0]+o[0],e.offset[1]+o[1]];var c=l.convert(e.offset),p=this.transform,h=p.project(t.getNorthWest()),f=p.project(t.getSouthEast()),d=f.sub(h),m=(p.width-2*a-2*Math.abs(c.x))/d.x,v=(p.height-2*u-2*Math.abs(c.y))/d.y;return v<0||m<0?(n.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset."),this):(e.center=p.unproject(h.add(f).div(2)),e.zoom=Math.min(p.scaleZoom(p.scale*Math.min(m,v)),e.maxZoom),e.bearing=0,e.linear?this.easeTo(e,r):this.flyTo(e,r))},e.prototype.jumpTo=function(t,e){this.stop();var r=this.transform,n=!1,i=!1,o=!1;return"zoom"in t&&r.zoom!==+t.zoom&&(n=!0,r.zoom=+t.zoom),void 0!==t.center&&(r.center=a.convert(t.center)),"bearing"in t&&r.bearing!==+t.bearing&&(i=!0,r.bearing=+t.bearing),"pitch"in t&&r.pitch!==+t.pitch&&(o=!0,r.pitch=+t.pitch),this.fire("movestart",e).fire("move",e),n&&this.fire("zoomstart",e).fire("zoom",e).fire("zoomend",e),i&&this.fire("rotate",e),o&&this.fire("pitchstart",e).fire("pitch",e).fire("pitchend",e),this.fire("moveend",e)},e.prototype.easeTo=function(t,e){var r=this;this.stop(),t=n.extend({offset:[0,0],duration:500,easing:n.ease},t),!1===t.animate&&(t.duration=0),t.smoothEasing&&0!==t.duration&&(t.easing=this._smoothOutEasing(t.duration));var o=this.transform,s=this.getZoom(),u=this.getBearing(),c=this.getPitch(),p="zoom"in t?+t.zoom:s,h="bearing"in t?this._normalizeBearing(t.bearing,u):u,f="pitch"in t?+t.pitch:c,d=o.centerPoint.add(l.convert(t.offset)),m=o.pointLocation(d),v=a.convert(t.center||m);this._normalizeCenter(v);var y,g,_=o.project(m),x=o.project(v).sub(_),b=o.zoomScale(p-s);return t.around&&(y=a.convert(t.around),g=o.locationPoint(y)),this.zooming=p!==s,this.rotating=u!==h,this.pitching=f!==c,this._prepareEase(e,t.noMoveStart),clearTimeout(this._onEaseEnd),this._ease(function(t){if(this.zooming&&(o.zoom=i(s,p,t)),this.rotating&&(o.bearing=i(u,h,t)),this.pitching&&(o.pitch=i(c,f,t)),y)o.setLocationAtPoint(y,g);else{var r=o.zoomScale(o.zoom-s),n=p>s?Math.min(2,b):Math.max(.5,b),a=Math.pow(n,1-t),l=o.unproject(_.add(x.mult(t*a)).mult(r));o.setLocationAtPoint(o.renderWorldCopies?l.wrap():l,d)}this._fireMoveEvents(e)},function(){t.delayEndEvents?r._onEaseEnd=setTimeout(function(){return r._easeToEnd(e)},t.delayEndEvents):r._easeToEnd(e)},t),this},e.prototype._prepareEase=function(t,e){this.moving=!0,e||this.fire("movestart",t),this.zooming&&this.fire("zoomstart",t),this.pitching&&this.fire("pitchstart",t)},e.prototype._fireMoveEvents=function(t){this.fire("move",t),this.zooming&&this.fire("zoom",t),this.rotating&&this.fire("rotate",t),this.pitching&&this.fire("pitch",t)},e.prototype._easeToEnd=function(t){var e=this.zooming,r=this.pitching;this.moving=!1,this.zooming=!1,this.rotating=!1,this.pitching=!1,e&&this.fire("zoomend",t),r&&this.fire("pitchend",t),this.fire("moveend",t)},e.prototype.flyTo=function(t,e){function r(t){var e=(A*A-z*z+(t?-1:1)*M*M*C*C)/(2*(t?A:z)*M*C);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)}var c=this;this.stop(),t=n.extend({offset:[0,0],speed:1.2,curve:1.42,easing:n.ease},t);var p=this.transform,h=this.getZoom(),f=this.getBearing(),d=this.getPitch(),m="zoom"in t?n.clamp(+t.zoom,p.minZoom,p.maxZoom):h,v="bearing"in t?this._normalizeBearing(t.bearing,f):f,y="pitch"in t?+t.pitch:d,g=p.zoomScale(m-h),_=p.centerPoint.add(l.convert(t.offset)),x=p.pointLocation(_),b=a.convert(t.center||x);this._normalizeCenter(b);var w=p.project(x),T=p.project(b).sub(w),S=t.curve,z=Math.max(p.width,p.height),A=z/g,C=T.mag();if("minZoom"in t){var E=n.clamp(Math.min(t.minZoom,h,m),p.minZoom,p.maxZoom),k=z/p.zoomScale(E-h);S=Math.sqrt(k/C*2)}var M=S*S,L=r(0),I=function(t){return s(L)/s(L+S*t)},P=function(t){return z*((s(L)*u(L+S*t)-o(L))/M)/C},R=(r(1)-L)/S;if(Math.abs(C)<1e-6||isNaN(R)){if(Math.abs(z-A)<1e-6)return this.easeTo(t,e);var D=A180?-360:r<-180?360:0}},e.prototype._smoothOutEasing=function(t){var e=n.ease;if(this._prevEase){var r=this._prevEase,i=(Date.now()-r.start)/r.duration,o=r.easing(i+.01)-r.easing(i),a=.27/Math.sqrt(o*o+1e-4)*.01,s=Math.sqrt(.0729-a*a);e=n.bezier(a,s,.25,1)}return this._prevEase={start:(new Date).getTime(),duration:t,easing:e},e},e}(u);e.exports=c},{"../geo/lng_lat":58,"../geo/lng_lat_bounds":59,"../style-spec/util/interpolate":127,"../util/browser":202,"../util/evented":210,"../util/util":223,"@mapbox/point-geometry":2}],182:[function(t,e,r){"use strict";var n=t("../../util/dom"),i=t("../../util/util"),o=t("../../util/config"),a=function(t){this.options=t,i.bindAll(["_updateEditLink","_updateData","_updateCompact"],this)};a.prototype.getDefaultPosition=function(){return"bottom-right"},a.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=n.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},a.prototype.onRemove=function(){n.remove(this._container),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0},a.prototype._updateEditLink=function(){var t=this._editLink;t||(t=this._editLink=this._container.querySelector(".mapbox-improve-map"));var e=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:o.ACCESS_TOKEN}];if(t){var r=e.reduce(function(t,r,n){return r.value&&(t+=r.key+"="+r.value+(n=0)return!1;return!0}),this._container.innerHTML=t.join(" | "),this._editLink=null}},a.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact")},e.exports=a},{"../../util/config":206,"../../util/dom":209,"../../util/util":223}],183:[function(t,e,r){"use strict";var n=t("../../util/dom"),i=t("../../util/util"),o=t("../../util/window"),a=function(){this._fullscreen=!1,i.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in o.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in o.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in o.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in o.document&&(this._fullscreenchange="MSFullscreenChange"),this._className="mapboxgl-ctrl"};a.prototype.onAdd=function(t){return this._map=t,this._mapContainer=this._map.getContainer(),this._container=n.create("div",this._className+" mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._container.style.display="none",i.warnOnce("This device does not support fullscreen mode.")),this._container},a.prototype.onRemove=function(){n.remove(this._container),this._map=null,o.document.removeEventListener(this._fullscreenchange,this._changeIcon)},a.prototype._checkFullscreenSupport=function(){return!!(o.document.fullscreenEnabled||o.document.mozFullScreenEnabled||o.document.msFullscreenEnabled||o.document.webkitFullscreenEnabled)},a.prototype._setupUI=function(){var t=this._fullscreenButton=n.create("button",this._className+"-icon "+this._className+"-fullscreen",this._container);t.setAttribute("aria-label","Toggle fullscreen"),t.type="button",this._fullscreenButton.addEventListener("click",this._onClickFullscreen),o.document.addEventListener(this._fullscreenchange,this._changeIcon)},a.prototype._isFullscreen=function(){return this._fullscreen},a.prototype._changeIcon=function(){(o.document.fullscreenElement||o.document.mozFullScreenElement||o.document.webkitFullscreenElement||o.document.msFullscreenElement)===this._mapContainer!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle(this._className+"-shrink"),this._fullscreenButton.classList.toggle(this._className+"-fullscreen"))},a.prototype._onClickFullscreen=function(){this._isFullscreen()?o.document.exitFullscreen?o.document.exitFullscreen():o.document.mozCancelFullScreen?o.document.mozCancelFullScreen():o.document.msExitFullscreen?o.document.msExitFullscreen():o.document.webkitCancelFullScreen&&o.document.webkitCancelFullScreen():this._mapContainer.requestFullscreen?this._mapContainer.requestFullscreen():this._mapContainer.mozRequestFullScreen?this._mapContainer.mozRequestFullScreen():this._mapContainer.msRequestFullscreen?this._mapContainer.msRequestFullscreen():this._mapContainer.webkitRequestFullscreen&&this._mapContainer.webkitRequestFullscreen()},e.exports=a},{"../../util/dom":209,"../../util/util":223,"../../util/window":204}],184:[function(t,e,r){"use strict";function n(t){void 0!==i?t(i):void 0!==s.navigator.permissions?s.navigator.permissions.query({name:"geolocation"}).then(function(e){i="denied"!==e.state,t(i)}):(i=!!s.navigator.geolocation,t(i))}var i,o=t("../../util/evented"),a=t("../../util/dom"),s=t("../../util/window"),l=t("../../util/util"),u=t("../../geo/lng_lat"),c=t("../marker"),p={positionOptions:{enableHighAccuracy:!1,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showUserLocation:!0},h=function(t){function e(e){t.call(this),this.options=l.extend({},p,e),l.bindAll(["_onSuccess","_onError","_finish","_setupUI","_updateCamera","_updateMarker","_onClickGeolocate"],this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.onAdd=function(t){return this._map=t,this._container=a.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),n(this._setupUI),this._container},e.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(s.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker.remove(),a.remove(this._container),this._map=void 0},e.prototype._onSuccess=function(t){if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire("geolocate",t),this._finish()},e.prototype._updateCamera=function(t){var e=new u(t.coords.longitude,t.coords.latitude),r=t.coords.accuracy;this._map.fitBounds(e.toBounds(r),this.options.fitBoundsOptions,{geolocateSource:!0})},e.prototype._updateMarker=function(t){t?this._userLocationDotMarker.setLngLat([t.coords.longitude,t.coords.latitude]).addTo(this._map):this._userLocationDotMarker.remove()},e.prototype._onError=function(t){if(this.options.trackUserLocation)if(1===t.code)this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),void 0!==this._geolocationWatchID&&this._clearWatch();else switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire("error",t),this._finish()},e.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},e.prototype._setupUI=function(t){var e=this;!1!==t&&(this._container.addEventListener("contextmenu",function(t){return t.preventDefault()}),this._geolocateButton=a.create("button","mapboxgl-ctrl-icon mapboxgl-ctrl-geolocate",this._container),this._geolocateButton.type="button",this._geolocateButton.setAttribute("aria-label","Geolocate"),this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=a.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new c(this._dotElement),this.options.trackUserLocation&&(this._watchState="OFF")),this._geolocateButton.addEventListener("click",this._onClickGeolocate.bind(this)),this.options.trackUserLocation&&this._map.on("movestart",function(t){t.geolocateSource||"ACTIVE_LOCK"!==e._watchState||(e._watchState="BACKGROUND",e._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),e._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),e.fire("trackuserlocationend"))}))},e.prototype._onClickGeolocate=function(){if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire("trackuserlocationstart");break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire("trackuserlocationend");break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire("trackuserlocationstart")}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}"OFF"===this._watchState&&void 0!==this._geolocationWatchID?this._clearWatch():void 0===this._geolocationWatchID&&(this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._geolocationWatchID=s.navigator.geolocation.watchPosition(this._onSuccess,this._onError,this.options.positionOptions))}else s.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4)},e.prototype._clearWatch=function(){s.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},e}(o);e.exports=h},{"../../geo/lng_lat":58,"../../util/dom":209,"../../util/evented":210,"../../util/util":223,"../../util/window":204,"../marker":198}],185:[function(t,e,r){"use strict";var n=t("../../util/dom"),i=t("../../util/util"),o=function(){i.bindAll(["_updateLogo"],this)};o.prototype.onAdd=function(t){this._map=t,this._container=n.create("div","mapboxgl-ctrl");var e=n.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.href="https://www.mapbox.com/",e.setAttribute("aria-label","Mapbox logo"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._container},o.prototype.onRemove=function(){n.remove(this._container),this._map.off("sourcedata",this._updateLogo)},o.prototype.getDefaultPosition=function(){return"bottom-left"},o.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},o.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style.sourceCaches;for(var e in t)if(t[e].getSource().mapbox_logo)return!0;return!1}},e.exports=o},{"../../util/dom":209,"../../util/util":223}],186:[function(t,e,r){"use strict";var n=t("../../util/dom"),i=t("../../util/util"),o=t("../handler/drag_rotate"),a=function(){var t=this;i.bindAll(["_rotateCompassArrow"],this),this._container=n.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",function(t){return t.preventDefault()}),this._zoomInButton=this._createButton("mapboxgl-ctrl-icon mapboxgl-ctrl-zoom-in","Zoom In",function(){return t._map.zoomIn()}),this._zoomOutButton=this._createButton("mapboxgl-ctrl-icon mapboxgl-ctrl-zoom-out","Zoom Out",function(){return t._map.zoomOut()}),this._compass=this._createButton("mapboxgl-ctrl-icon mapboxgl-ctrl-compass","Reset North",function(){return t._map.resetNorth()}),this._compassArrow=n.create("span","mapboxgl-ctrl-compass-arrow",this._compass)};a.prototype._rotateCompassArrow=function(){var t="rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassArrow.style.transform=t},a.prototype.onAdd=function(t){return this._map=t,this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new o(t,{button:"left",element:this._compass,pitchWithRotate:!1}),this._handler.enable(),this._container},a.prototype.onRemove=function(){n.remove(this._container),this._map.off("rotate",this._rotateCompassArrow),delete this._map,this._handler.disable(),delete this._handler},a.prototype._createButton=function(t,e,r){var i=n.create("button",t,this._container);return i.type="button",i.setAttribute("aria-label",e),i.addEventListener("click",r),i},e.exports=a},{"../../util/dom":209,"../../util/util":223,"../handler/drag_rotate":192}],187:[function(t,e,r){"use strict";function n(t,e,r){var n=r&&r.maxWidth||100,a=t._container.clientHeight/2,s=o(t.unproject([0,a]),t.unproject([n,a]));if(r&&"imperial"===r.unit){var l=3.2808*s;l>5280?i(e,n,l/5280,"mi"):i(e,n,l,"ft")}else if(r&&"nautical"===r.unit){var u=s/1852;i(e,n,u,"nm")}else i(e,n,s,"m")}function i(t,e,r,n){var i=a(r),o=i/r;"m"===n&&i>=1e3&&(i/=1e3,n="km"),t.style.width=e*o+"px",t.innerHTML=i+n}function o(t,e){var r=Math.PI/180,n=t.lat*r,i=e.lat*r,o=Math.sin(n)*Math.sin(i)+Math.cos(n)*Math.cos(i)*Math.cos((e.lng-t.lng)*r);return 6371e3*Math.acos(Math.min(o,1))}function a(t){var e=Math.pow(10,(""+Math.floor(t)).length-1),r=t/e;return r=r>=10?10:r>=5?5:r>=3?3:r>=2?2:1,e*r}var s=t("../../util/dom"),l=t("../../util/util"),u=function(t){this.options=t,l.bindAll(["_onMove"],this)};u.prototype.getDefaultPosition=function(){return"bottom-left"},u.prototype._onMove=function(){n(this._map,this._container,this.options)},u.prototype.onAdd=function(t){return this._map=t,this._container=s.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},u.prototype.onRemove=function(){s.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},e.exports=u},{"../../util/dom":209,"../../util/util":223}],188:[function(t,e,r){"use strict"},{}],189:[function(t,e,r){"use strict";var n=t("../../util/dom"),i=t("../../geo/lng_lat_bounds"),o=t("../../util/util"),a=t("../../util/window"),s=function(t){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),o.bindAll(["_onMouseDown","_onMouseMove","_onMouseUp","_onKeyDown"],this)};s.prototype.isEnabled=function(){return!!this._enabled},s.prototype.isActive=function(){return!!this._active},s.prototype.enable=function(){this.isEnabled()||(this._map.dragPan&&this._map.dragPan.disable(),this._el.addEventListener("mousedown",this._onMouseDown,!1),this._map.dragPan&&this._map.dragPan.enable(),this._enabled=!0)},s.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onMouseDown),this._enabled=!1)},s.prototype._onMouseDown=function(t){t.shiftKey&&0===t.button&&(a.document.addEventListener("mousemove",this._onMouseMove,!1),a.document.addEventListener("keydown",this._onKeyDown,!1),a.document.addEventListener("mouseup",this._onMouseUp,!1),n.disableDrag(),this._startPos=n.mousePos(this._el,t),this._active=!0)},s.prototype._onMouseMove=function(t){var e=this._startPos,r=n.mousePos(this._el,t);this._box||(this._box=n.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var i=Math.min(e.x,r.x),o=Math.max(e.x,r.x),a=Math.min(e.y,r.y),s=Math.max(e.y,r.y);n.setTransform(this._box,"translate("+i+"px,"+a+"px)"),this._box.style.width=o-i+"px",this._box.style.height=s-a+"px"},s.prototype._onMouseUp=function(t){if(0===t.button){var e=this._startPos,r=n.mousePos(this._el,t),o=(new i).extend(this._map.unproject(e)).extend(this._map.unproject(r));this._finish(),e.x===r.x&&e.y===r.y?this._fireEvent("boxzoomcancel",t):this._map.fitBounds(o,{linear:!0}).fire("boxzoomend",{originalEvent:t,boxZoomBounds:o})}},s.prototype._onKeyDown=function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t))},s.prototype._finish=function(){this._active=!1,a.document.removeEventListener("mousemove",this._onMouseMove,!1),a.document.removeEventListener("keydown",this._onKeyDown,!1),a.document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box&&(n.remove(this._box),this._box=null),n.enableDrag()},s.prototype._fireEvent=function(t,e){return this._map.fire(t,{originalEvent:e})},e.exports=s},{"../../geo/lng_lat_bounds":59,"../../util/dom":209,"../../util/util":223,"../../util/window":204}],190:[function(t,e,r){"use strict";var n=t("../../util/util"),i=function(t){this._map=t,n.bindAll(["_onDblClick"],this)};i.prototype.isEnabled=function(){return!!this._enabled},i.prototype.enable=function(){this.isEnabled()||(this._map.on("dblclick",this._onDblClick),this._enabled=!0)},i.prototype.disable=function(){this.isEnabled()&&(this._map.off("dblclick",this._onDblClick),this._enabled=!1)},i.prototype._onDblClick=function(t){this._map.zoomTo(this._map.getZoom()+(t.originalEvent.shiftKey?-1:1),{around:t.lngLat},t)},e.exports=i},{"../../util/util":223}],191:[function(t,e,r){"use strict";var n=t("../../util/dom"),i=t("../../util/util"),o=t("../../util/window"),a=i.bezier(0,0,.3,1),s=function(t){this._map=t,this._el=t.getCanvasContainer(),i.bindAll(["_onDown","_onMove","_onUp","_onTouchEnd","_onMouseUp"],this)};s.prototype.isEnabled=function(){return!!this._enabled},s.prototype.isActive=function(){return!!this._active},s.prototype.enable=function(){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-drag-pan"),this._el.addEventListener("mousedown",this._onDown),this._el.addEventListener("touchstart",this._onDown),this._enabled=!0)},s.prototype.disable=function(){this.isEnabled()&&(this._el.classList.remove("mapboxgl-touch-drag-pan"),this._el.removeEventListener("mousedown",this._onDown),this._el.removeEventListener("touchstart",this._onDown),this._enabled=!1)},s.prototype._onDown=function(t){this._ignoreEvent(t)||this.isActive()||(t.touches?(o.document.addEventListener("touchmove",this._onMove),o.document.addEventListener("touchend",this._onTouchEnd)):(o.document.addEventListener("mousemove",this._onMove),o.document.addEventListener("mouseup",this._onMouseUp)),o.addEventListener("blur",this._onMouseUp),this._active=!1,this._startPos=this._pos=n.mousePos(this._el,t),this._inertia=[[Date.now(),this._pos]])},s.prototype._onMove=function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._map.moving=!0,this._fireEvent("dragstart",t),this._fireEvent("movestart",t));var e=n.mousePos(this._el,t),r=this._map;r.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),e]),r.transform.setLocationAtPoint(r.transform.pointLocation(this._pos),e),this._fireEvent("drag",t),this._fireEvent("move",t),this._pos=e,t.preventDefault()}},s.prototype._onUp=function(t){var e=this;if(this.isActive()){this._active=!1,this._fireEvent("dragend",t),this._drainInertiaBuffer();var r=function(){e._map.moving=!1,e._fireEvent("moveend",t)},n=this._inertia;if(n.length<2)return void r();var i=n[n.length-1],o=n[0],s=i[1].sub(o[1]),l=(i[0]-o[0])/1e3;if(0===l||i[1].equals(o[1]))return void r();var u=s.mult(.3/l),c=u.mag();c>1400&&(c=1400,u._unit()._mult(c));var p=c/750,h=u.mult(-p/2);this._map.panBy(h,{duration:1e3*p,easing:a,noMoveStart:!0},{originalEvent:t})}},s.prototype._onMouseUp=function(t){this._ignoreEvent(t)||(this._onUp(t),o.document.removeEventListener("mousemove",this._onMove),o.document.removeEventListener("mouseup",this._onMouseUp),o.removeEventListener("blur",this._onMouseUp))},s.prototype._onTouchEnd=function(t){this._ignoreEvent(t)||(this._onUp(t),o.document.removeEventListener("touchmove",this._onMove),o.document.removeEventListener("touchend",this._onTouchEnd))},s.prototype._fireEvent=function(t,e){return this._map.fire(t,{originalEvent:e})},s.prototype._ignoreEvent=function(t){var e=this._map;return!(!e.boxZoom||!e.boxZoom.isActive())||!(!e.dragRotate||!e.dragRotate.isActive())||(t.touches?t.touches.length>1:!!t.ctrlKey||"mousemove"!==t.type&&t.button&&0!==t.button)},s.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,e=Date.now();t.length>0&&e-t[0][0]>160;)t.shift()},e.exports=s},{"../../util/dom":209,"../../util/util":223,"../../util/window":204}],192:[function(t,e,r){"use strict";var n=t("../../util/dom"),i=t("../../util/util"),o=t("../../util/window"),a=i.bezier(0,0,.25,1),s=function(t,e){this._map=t,this._el=e.element||t.getCanvasContainer(),this._button=e.button||"right",this._bearingSnap=e.bearingSnap||0,this._pitchWithRotate=!1!==e.pitchWithRotate,i.bindAll(["_onDown","_onMove","_onUp"],this)};s.prototype.isEnabled=function(){return!!this._enabled},s.prototype.isActive=function(){return!!this._active},s.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._enabled=!0)},s.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._enabled=!1)},s.prototype._onDown=function(t){if(!(this._map.boxZoom&&this._map.boxZoom.isActive()||this._map.dragPan&&this._map.dragPan.isActive()||this.isActive())){if("right"===this._button){var e=t.ctrlKey?0:2,r=t.button;if(void 0!==o.InstallTrigger&&2===t.button&&t.ctrlKey&&o.navigator.platform.toUpperCase().indexOf("MAC")>=0&&(r=0),r!==e)return}else if(t.ctrlKey||0!==t.button)return;n.disableDrag(),o.document.addEventListener("mousemove",this._onMove,{capture:!0}),o.document.addEventListener("mouseup",this._onUp),o.addEventListener("blur",this._onUp),this._active=!1,this._inertia=[[Date.now(),this._map.getBearing()]],this._startPos=this._pos=n.mousePos(this._el,t),this._center=this._map.transform.centerPoint,t.preventDefault()}},s.prototype._onMove=function(t){this.isActive()||(this._active=!0,this._map.moving=!0,this._fireEvent("rotatestart",t),this._fireEvent("movestart",t),this._pitchWithRotate&&this._fireEvent("pitchstart",t));var e=this._map;e.stop();var r=this._pos,i=n.mousePos(this._el,t),o=.8*(r.x-i.x),a=-.5*(r.y-i.y),s=e.getBearing()-o,l=e.getPitch()-a,u=this._inertia,c=u[u.length-1];this._drainInertiaBuffer(),u.push([Date.now(),e._normalizeBearing(s,c[1])]),e.transform.bearing=s,this._pitchWithRotate&&(this._fireEvent("pitch",t),e.transform.pitch=l),this._fireEvent("rotate",t),this._fireEvent("move",t),this._pos=i},s.prototype._onUp=function(t){var e=this;if(o.document.removeEventListener("mousemove",this._onMove,{capture:!0}),o.document.removeEventListener("mouseup",this._onUp),o.removeEventListener("blur",this._onUp),n.enableDrag(),this.isActive()){this._active=!1,this._fireEvent("rotateend",t),this._drainInertiaBuffer();var r=this._map,i=r.getBearing(),s=this._inertia,l=function(){Math.abs(i)180&&(v=180);var y=v/180;h+=d*v*(y/2),Math.abs(r._normalizeBearing(h,0))0&&e-t[0][0]>160;)t.shift()},e.exports=s},{"../../util/dom":209,"../../util/util":223,"../../util/window":204}],193:[function(t,e,r){"use strict";function n(t){return t*(2-t)}var i=t("../../util/util"),o=function(t){this._map=t,this._el=t.getCanvasContainer(),i.bindAll(["_onKeyDown"],this)};o.prototype.isEnabled=function(){return!!this._enabled},o.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)},o.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)},o.prototype._onKeyDown=function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=0,r=0,i=0,o=0,a=0;switch(t.keyCode){case 61:case 107:case 171:case 187:e=1;break;case 189:case 109:case 173:e=-1;break;case 37:t.shiftKey?r=-1:(t.preventDefault(),o=-1);break;case 39:t.shiftKey?r=1:(t.preventDefault(),o=1);break;case 38:t.shiftKey?i=1:(t.preventDefault(),a=-1);break;case 40:t.shiftKey?i=-1:(a=1,t.preventDefault());break;default:return}var s=this._map,l=s.getZoom(),u={duration:300,delayEndEvents:500,easing:n,zoom:e?Math.round(l)+e*(t.shiftKey?2:1):l,bearing:s.getBearing()+15*r,pitch:s.getPitch()+10*i,offset:[100*-o,100*-a],center:s.getCenter()};s.easeTo(u,{originalEvent:t})}},e.exports=o},{"../../util/util":223}],194:[function(t,e,r){"use strict";var n=t("../../util/dom"),i=t("../../util/util"),o=t("../../util/browser"),a=t("../../util/window"),s=a.navigator.userAgent.toLowerCase(),l=-1!==s.indexOf("firefox"),u=-1!==s.indexOf("safari")&&-1===s.indexOf("chrom"),c=function(t){this._map=t,this._el=t.getCanvasContainer(),i.bindAll(["_onWheel","_onTimeout"],this)};c.prototype.isEnabled=function(){return!!this._enabled},c.prototype.enable=function(t){this.isEnabled()||(this._el.addEventListener("wheel",this._onWheel,!1),this._el.addEventListener("mousewheel",this._onWheel,!1),this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},c.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("wheel",this._onWheel),this._el.removeEventListener("mousewheel",this._onWheel),this._enabled=!1)},c.prototype._onWheel=function(t){var e=0;"wheel"===t.type?(e=t.deltaY,l&&t.deltaMode===a.WheelEvent.DOM_DELTA_PIXEL&&(e/=o.devicePixelRatio),t.deltaMode===a.WheelEvent.DOM_DELTA_LINE&&(e*=40)):"mousewheel"===t.type&&(e=-t.wheelDeltaY,u&&(e/=3));var r=o.now(),i=r-(this._time||0);this._pos=n.mousePos(this._el,t),this._time=r,0!==e&&e%4.000244140625==0?this._type="wheel":0!==e&&Math.abs(e)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40)):this._type||(this._type=Math.abs(i*e)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,e+=this._lastValue)),t.shiftKey&&e&&(e/=4),this._type&&this._zoom(-e,t),t.preventDefault()},c.prototype._onTimeout=function(){this._type="wheel",this._zoom(-this._lastValue)},c.prototype._zoom=function(t,e){if(0!==t){var r=this._map,n=2/(1+Math.exp(-Math.abs(t/100)));t<0&&0!==n&&(n=1/n);var i=r.ease?r.ease.to:r.transform.scale,o=r.transform.scaleZoom(i*n);r.zoomTo(o,{duration:"wheel"===this._type?200:0,around:this._aroundCenter?r.getCenter():r.unproject(this._pos),delayEndEvents:200,smoothEasing:!0},{originalEvent:e})}},e.exports=c},{"../../util/browser":202,"../../util/dom":209,"../../util/util":223,"../../util/window":204}],195:[function(t,e,r){"use strict";var n=t("../../util/dom"),i=t("../../util/util"),o=t("../../util/window"),a=i.bezier(0,0,.15,1),s=function(t){this._map=t,this._el=t.getCanvasContainer(),i.bindAll(["_onStart","_onMove","_onEnd"],this)};s.prototype.isEnabled=function(){return!!this._enabled},s.prototype.enable=function(t){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-zoom-rotate"),this._el.addEventListener("touchstart",this._onStart,!1),this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},s.prototype.disable=function(){this.isEnabled()&&(this._el.classList.remove("mapboxgl-touch-zoom-rotate"),this._el.removeEventListener("touchstart",this._onStart),this._enabled=!1)},s.prototype.disableRotation=function(){this._rotationDisabled=!0},s.prototype.enableRotation=function(){this._rotationDisabled=!1},s.prototype._onStart=function(t){if(2===t.touches.length){var e=n.mousePos(this._el,t.touches[0]),r=n.mousePos(this._el,t.touches[1]);this._startVec=e.sub(r),this._startScale=this._map.transform.scale,this._startBearing=this._map.transform.bearing,this._gestureIntent=void 0,this._inertia=[],o.document.addEventListener("touchmove",this._onMove,!1),o.document.addEventListener("touchend",this._onEnd,!1)}},s.prototype._onMove=function(t){if(2===t.touches.length){var e=n.mousePos(this._el,t.touches[0]),r=n.mousePos(this._el,t.touches[1]),i=e.add(r).div(2),o=e.sub(r),a=o.mag()/this._startVec.mag(),s=this._rotationDisabled?0:180*o.angleWith(this._startVec)/Math.PI,l=this._map;if(this._gestureIntent){var u={duration:0,around:l.unproject(i)};"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,i]),l.easeTo(u,{originalEvent:t})}else{var c=Math.abs(1-a)>.15;Math.abs(s)>10?this._gestureIntent="rotate":c&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._startVec=o,this._startScale=l.transform.scale,this._startBearing=l.transform.bearing)}t.preventDefault()}},s.prototype._onEnd=function(t){o.document.removeEventListener("touchmove",this._onMove),o.document.removeEventListener("touchend",this._onEnd),this._drainInertiaBuffer();var e=this._inertia,r=this._map;if(e.length<2)return void r.snapToNorth({},{originalEvent:t});var n=e[e.length-1],i=e[0],s=r.transform.scaleZoom(this._startScale*n[1]),l=r.transform.scaleZoom(this._startScale*i[1]),u=s-l,c=(n[0]-i[0])/1e3,p=n[2];if(0===c||s===l)return void r.snapToNorth({},{originalEvent:t});var h=.15*u/c;Math.abs(h)>2.5&&(h=h>0?2.5:-2.5);var f=1e3*Math.abs(h/(12*.15)),d=s+h*f/2e3;d<0&&(d=0),r.easeTo({zoom:d,duration:f,easing:a,around:this._aroundCenter?r.getCenter():r.unproject(p)},{originalEvent:t})},s.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,e=Date.now();t.length>2&&e-t[0][0]>160;)t.shift()},e.exports=s},{"../../util/dom":209,"../../util/util":223,"../../util/window":204}],196:[function(t,e,r){"use strict";var n=t("../util/util"),i=t("../util/window"),o=function(){n.bindAll(["_onHashChange","_updateHash"],this)};o.prototype.addTo=function(t){return this._map=t,i.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},o.prototype.remove=function(){return i.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),delete this._map,this},o.prototype.getHashString=function(t){var e=this._map.getCenter(),r=Math.round(100*this._map.getZoom())/100,n=Math.max(0,Math.ceil(Math.log(r)/Math.LN2)),i=Math.round(e.lng*Math.pow(10,n))/Math.pow(10,n),o=Math.round(e.lat*Math.pow(10,n))/Math.pow(10,n),a=this._map.getBearing(),s=this._map.getPitch(),l="";return l+=t?"#/"+i+"/"+o+"/"+r:"#"+r+"/"+o+"/"+i,(a||s)&&(l+="/"+Math.round(10*a)/10),s&&(l+="/"+Math.round(s)),l},o.prototype._onHashChange=function(){var t=i.location.hash.replace("#","").split("/");return t.length>=3&&(this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:+(t[3]||0),pitch:+(t[4]||0)}),!0)},o.prototype._updateHash=function(){var t=this.getHashString();i.history.replaceState("","",t)},e.exports=o},{"../util/util":223,"../util/window":204}],197:[function(t,e,r){"use strict";function n(t){t.parentNode&&t.parentNode.removeChild(t)}var i=t("../util/util"),o=t("../util/browser"),a=t("../util/window"),s=t("../util/window"),l=s.HTMLImageElement,u=t("../util/dom"),c=t("../util/ajax"),p=t("../style/style"),h=t("../style/animation_loop"),f=t("../render/painter"),d=t("../geo/transform"),m=t("./hash"),v=t("./bind_handlers"),y=t("./camera"),g=t("../geo/lng_lat"),_=t("../geo/lng_lat_bounds"),x=t("@mapbox/point-geometry"),b=t("./control/attribution_control"),w=t("./control/logo_control"),T=t("mapbox-gl-supported");t("./events");var S={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:0,maxZoom:22,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,bearingSnap:7,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,transformRequest:null},z=function(t){function e(e){var r=this;if(e=i.extend({},S,e),null!=e.minZoom&&null!=e.maxZoom&&e.minZoom>e.maxZoom)throw new Error("maxZoom must be greater than minZoom");var n=new d(e.minZoom,e.maxZoom,e.renderWorldCopies);t.call(this,n,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles;var o=e.transformRequest;if(this._transformRequest=o?function(t,e){return o(t,e)||{url:t}}:function(t){return{url:t}},"string"==typeof e.container){var s=a.document.getElementById(e.container);if(!s)throw new Error("Container '"+e.container+"' not found.");this._container=s}else this._container=e.container;this.animationLoop=new h,e.maxBounds&&this.setMaxBounds(e.maxBounds),i.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored","_update","_render","_onData","_onDataLoading"],this),this._setupContainer(),this._setupPainter(),this.on("move",this._update.bind(this,!1)),this.on("zoom",this._update.bind(this,!0)),this.on("moveend",function(){r.animationLoop.set(300),r._rerender()}),void 0!==a&&(a.addEventListener("online",this._onWindowOnline,!1),a.addEventListener("resize",this._onWindowResize,!1)),v(this,e),this._hash=e.hash&&(new m).addTo(this),this._hash&&this._hash._onHashChange()||this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),this._classes=[],this.resize(),e.classes&&this.setClasses(e.classes),e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new b),this.addControl(new w,e.logoPosition),this.on("style.load",function(){this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this.style.update(this._classes,{transition:!1})}),this.on("data",this._onData),this.on("dataloading",this._onDataLoading)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={showTileBoundaries:{},showCollisionBoxes:{},showOverdrawInspector:{},repaint:{},vertices:{}};return e.prototype.addControl=function(t,e){void 0===e&&t.getDefaultPosition&&(e=t.getDefaultPosition()),void 0===e&&(e="top-right");var r=t.onAdd(this),n=this._controlPositions[e];return-1!==e.indexOf("bottom")?n.insertBefore(r,n.firstChild):n.appendChild(r),this},e.prototype.removeControl=function(t){return t.onRemove(this),this},e.prototype.addClass=function(t,e){return i.warnOnce("Style classes are deprecated and will be removed in an upcoming release of Mapbox GL JS."),this._classes.indexOf(t)>=0||""===t?this:(this._classes.push(t),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},e.prototype.removeClass=function(t,e){i.warnOnce("Style classes are deprecated and will be removed in an upcoming release of Mapbox GL JS.");var r=this._classes.indexOf(t);return r<0||""===t?this:(this._classes.splice(r,1),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},e.prototype.setClasses=function(t,e){i.warnOnce("Style classes are deprecated and will be removed in an upcoming release of Mapbox GL JS.");for(var r={},n=0;n=0},e.prototype.getClasses=function(){return i.warnOnce("Style classes are deprecated and will be removed in an upcoming release of Mapbox GL JS."),this._classes},e.prototype.resize=function(){var t=this._containerDimensions(),e=t[0],r=t[1];return this._resizeCanvas(e,r),this.transform.resize(e,r),this.painter.resize(e,r),this.fire("movestart").fire("move").fire("resize").fire("moveend")},e.prototype.getBounds=function(){var t=new _(this.transform.pointLocation(new x(0,this.transform.height)),this.transform.pointLocation(new x(this.transform.width,0)));return(this.transform.angle||this.transform.pitch)&&(t.extend(this.transform.pointLocation(new x(this.transform.size.x,0))),t.extend(this.transform.pointLocation(new x(0,this.transform.size.y)))),t},e.prototype.getMaxBounds=function(){return this.transform.latRange&&2===this.transform.latRange.length&&this.transform.lngRange&&2===this.transform.lngRange.length?new _([this.transform.lngRange[0],this.transform.latRange[0]],[this.transform.lngRange[1],this.transform.latRange[1]]):null},e.prototype.setMaxBounds=function(t){if(t){var e=_.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=null,this.transform.latRange=null,this._update());return this},e.prototype.setMinZoom=function(t){if((t=null===t||void 0===t?0:t)>=0&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},e.prototype.getMaxZoom=function(){return this.transform.maxZoom},e.prototype.project=function(t){return this.transform.locationPoint(g.convert(t))},e.prototype.unproject=function(t){return this.transform.pointLocation(x.convert(t))},e.prototype.on=function(e,r,n){var o=this;if(void 0===n)return t.prototype.on.call(this,e,r);var a=function(){if("mouseenter"===e||"mouseover"===e){var t=!1;return{layer:r,listener:n,delegates:{mousemove:function(a){var s=o.getLayer(r)?o.queryRenderedFeatures(a.point,{layers:[r]}):[];s.length?t||(t=!0,n.call(o,i.extend({features:s},a,{type:e}))):t=!1},mouseout:function(){t=!1}}}}if("mouseleave"===e||"mouseout"===e){var a=!1;return{layer:r,listener:n,delegates:{mousemove:function(t){(o.getLayer(r)?o.queryRenderedFeatures(t.point,{layers:[r]}):[]).length?a=!0:a&&(a=!1,n.call(o,i.extend({},t,{type:e})))},mouseout:function(t){a&&(a=!1,n.call(o,i.extend({},t,{type:e})))}}}}var s=function(t){var e=o.getLayer(r)?o.queryRenderedFeatures(t.point,{layers:[r]}):[];e.length&&n.call(o,i.extend({features:e},t))};return{layer:r,listener:n,delegates:(l={},l[e]=s,l)};var l}();this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[e]=this._delegatedListeners[e]||[],this._delegatedListeners[e].push(a);for(var s in a.delegates)o.on(s,a.delegates[s]);return this},e.prototype.off=function(e,r,n){var i=this;if(void 0===n)return t.prototype.off.call(this,e,r);if(this._delegatedListeners&&this._delegatedListeners[e])for(var o=this._delegatedListeners[e],a=0;athis._map.transform.height-o?["bottom"]:[],t.xthis._map.transform.width-i/2&&e.push("right"),e=0===e.length?"bottom":e.join("-")}var s=t.add(r[e]).round(),l={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%)"},u=this._container.classList;for(var p in l)u.remove("mapboxgl-popup-anchor-"+p);u.add("mapboxgl-popup-anchor-"+e),a.setTransform(this._container,l[e]+" translate("+s.x+"px,"+s.y+"px)")}},e.prototype._onClickClose=function(){this.remove()},e}(o);e.exports=h},{"../geo/lng_lat":58,"../util/dom":209,"../util/evented":210,"../util/smart_wrap":219,"../util/util":223,"../util/window":204,"@mapbox/point-geometry":2}],200:[function(t,e,r){"use strict";var n=t("./util"),i=function(t,e,r){this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.callbackID=0,n.bindAll(["receive"],this),this.target.addEventListener("message",this.receive,!1)};i.prototype.send=function(t,e,r,n,i){var o=r?this.mapId+":"+this.callbackID++:null;r&&(this.callbacks[o]=r),this.target.postMessage({targetMapId:i,sourceMapId:this.mapId,type:t,id:String(o),data:e},n)},i.prototype.receive=function(t){var e,r=this,n=t.data,i=n.id;if(!n.targetMapId||this.mapId===n.targetMapId){var o=function(t,e,n){r.target.postMessage({sourceMapId:r.mapId,type:"",id:String(i),error:t?String(t):null,data:e},n)};if(""===n.type)e=this.callbacks[n.id],delete this.callbacks[n.id],e&&n.error?e(new Error(n.error)):e&&e(null,n.data);else if(void 0!==n.id&&this.parent[n.type])this.parent[n.type](n.sourceMapId,n.data,o);else if(void 0!==n.id&&this.parent.getWorkerSource){var a=n.type.split("."),s=this.parent.getWorkerSource(n.sourceMapId,a[0]);s[a[1]](n.data,o)}else this.parent[n.type](n.data)}},i.prototype.remove=function(){this.target.removeEventListener("message",this.receive,!1)},e.exports=i},{"./util":223}],201:[function(t,e,r){"use strict";function n(t){var e=new o.XMLHttpRequest;e.open("GET",t.url,!0);for(var r in t.headers)e.setRequestHeader(r,t.headers[r]);return e.withCredentials="include"===t.credentials,e}function i(t){var e=o.document.createElement("a");return e.href=t,e.protocol===o.document.location.protocol&&e.host===o.document.location.host}var o=t("./window"),a={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};r.ResourceType=a,"function"==typeof Object.freeze&&Object.freeze(a);var s=function(t){function e(e,r){t.call(this,e),this.status=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error);r.getJSON=function(t,e){var r=n(t);return r.setRequestHeader("Accept","application/json"),r.onerror=function(){e(new Error(r.statusText))},r.onload=function(){if(r.status>=200&&r.status<300&&r.response){var t;try{t=JSON.parse(r.response)}catch(t){return e(t)}e(null,t)}else e(new s(r.statusText,r.status))},r.send(),r},r.getArrayBuffer=function(t,e){var r=n(t);return r.responseType="arraybuffer",r.onerror=function(){e(new Error(r.statusText))},r.onload=function(){var t=r.response;if(0===t.byteLength&&200===r.status)return e(new Error("http status 200 returned without content."));r.status>=200&&r.status<300&&r.response?e(null,{data:t,cacheControl:r.getResponseHeader("Cache-Control"),expires:r.getResponseHeader("Expires")}):e(new s(r.statusText,r.status))},r.send(),r};r.getImage=function(t,e){return r.getArrayBuffer(t,function(t,r){if(t)e(t);else if(r){var n=new o.Image,i=o.URL||o.webkitURL;n.onload=function(){e(null,n),i.revokeObjectURL(n.src)};var a=new o.Blob([new Uint8Array(r.data)],{type:"image/png"});n.cacheControl=r.cacheControl,n.expires=r.expires,n.src=r.data.byteLength?i.createObjectURL(a):"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII="}})},r.getVideo=function(t,e){var r=o.document.createElement("video");r.onloadstart=function(){e(null,r)};for(var n=0;n=s+e?t.call(r,1):(t.call(r,(l-s)/e),o(n))}}if(!e)return t.call(r,1),null;var a=!1,s=i();return o(n),function(){a=!0}},getImageData:function(t){var e=n.document.createElement("canvas"),r=e.getContext("2d");if(!r)throw new Error("failed to create canvas 2d context");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0,t.width,t.height),r.getImageData(0,0,t.width,t.height)},hardwareConcurrency:n.navigator.hardwareConcurrency||4,get devicePixelRatio(){return n.devicePixelRatio},supportsWebp:!1};var s=n.document.createElement("img");s.onload=function(){e.exports.supportsWebp=!0},s.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="},{"./window":204}],203:[function(t,e,r){"use strict";var n=t("webworkify"),i=t("../window"),o=i.URL.createObjectURL(new n(t("../../source/worker"),{bare:!0}));e.exports=function(){return new i.Worker(o)}},{"../../source/worker":105,"../window":204,webworkify:39}],204:[function(t,e,r){"use strict";e.exports=self},{}],205:[function(t,e,r){"use strict";function n(t,e){return e.area-t.area}var i=t("quickselect"),o=t("./util").calculateSignedArea;e.exports=function(t,e){var r=t.length;if(r<=1)return[t];for(var a,s,l=[],u=0;u1)for(var p=0;p0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},a.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this},e.exports=a},{"./util":223}],211:[function(t,e,r){"use strict";function n(t,e){return e.max-t.max}function i(t,e,r,n){this.p=new l(t,e),this.h=r,this.d=o(this.p,n),this.max=this.d+this.h*Math.SQRT2}function o(t,e){for(var r=!1,n=1/0,i=0;it.y!=p.y>t.y&&t.x<(p.x-c.x)*(t.y-c.y)/(p.y-c.y)+c.x&&(r=!r),n=Math.min(n,u(t,c,p))}return(r?1:-1)*Math.sqrt(n)}function a(t){for(var e=0,r=0,n=0,o=t[0],a=0,s=o.length,l=s-1;ac)&&(c=d.x),(!f||d.y>p)&&(p=d.y)}var m=c-o,v=p-u,y=Math.min(m,v),g=y/2,_=new s(null,n);if(0===y)return new l(o,u);for(var x=o;xw.d||!w.d)&&(w=S,r&&console.log("found best %d after %d probes",Math.round(1e4*S.d)/1e4,T)),S.max-w.d<=e||(g=S.h/2,_.push(new i(S.p.x-g,S.p.y-g,g,t)),_.push(new i(S.p.x+g,S.p.y-g,g,t)),_.push(new i(S.p.x-g,S.p.y+g,g,t)),_.push(new i(S.p.x+g,S.p.y+g,g,t)),T+=4)}return r&&(console.log("num probes: "+T),console.log("best distance: "+w.d)),w.p}},{"./intersection_tests":214,"@mapbox/point-geometry":2,tinyqueue:33}],212:[function(t,e,r){"use strict";var n,i=t("./worker_pool");e.exports=function(){return n||(n=new i),n}},{"./worker_pool":226}],213:[function(t,e,r){"use strict";function n(t,e,r){var n=t.width,i=t.height;if(r){if(r.length!==n*i*e)throw new RangeError("mismatched image size")}else r=new Uint8Array(n*i*e);return{width:n,height:i,data:r}}function i(t,e,r){var i=e.width,a=e.height;if(i===t.width&&a===t.height)return t;var s=n({width:i,height:a},r);o(t,s,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,i),height:Math.min(t.height,a)},r),t.width=i,t.height=a,t.data=s.data}function o(t,e,r,n,i,o){if(0===i.width||0===i.height)return e;if(i.width>t.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var a=t.data,s=e.data,l=0;l=3)for(var l=0;l1){if(l(t,e))return!0;for(var n=0;n1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}function h(t,e){for(var r,n,i,o=!1,a=0;ae.y!=i.y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(o=!o)}return o}function f(t,e){for(var r=!1,n=0,i=t.length-1;ne.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(r=!r)}return r}var d=t("./util"),m=d.isCounterClockwise;e.exports={multiPolygonIntersectsBufferedMultiPoint:i,multiPolygonIntersectsMultiPolygon:o,multiPolygonIntersectsBufferedMultiLine:a,polygonIntersectsPolygon:n,distToSegmentSquared:p}},{"./util":223}],215:[function(t,e,r){"use strict";var n={"Latin-1 Supplement":function(t){return t>=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};e.exports=n},{}],216:[function(t,e,r){"use strict";var n=function(t,e){this.max=t,this.onRemove=e,this.reset()};n.prototype.reset=function(){var t=this;for(var e in t.data)t.onRemove(t.data[e]);return this.data={},this.order=[],this},n.prototype.add=function(t,e){if(this.has(t))this.order.splice(this.order.indexOf(t),1),this.data[t]=e,this.order.push(t);else if(this.data[t]=e,this.order.push(t),this.order.length>this.max){var r=this.get(this.order[0]);r&&this.onRemove(r)}return this},n.prototype.has=function(t){return t in this.data},n.prototype.keys=function(){return this.order},n.prototype.get=function(t){if(!this.has(t))return null;var e=this.data[t];return delete this.data[t],this.order.splice(this.order.indexOf(t),1),e},n.prototype.getWithoutRemoving=function(t){return this.has(t)?this.data[t]:null},n.prototype.remove=function(t){if(!this.has(t))return this;var e=this.data[t];return delete this.data[t],this.onRemove(e),this.order.splice(this.order.indexOf(t),1),this},n.prototype.setMaxSize=function(t){var e=this;for(this.max=t;this.order.length>this.max;){var r=e.get(e.order[0]);r&&e.onRemove(r)}return this},e.exports=n},{}],217:[function(t,e,r){"use strict";function n(t,e){var r=a(l.API_URL);if(t.protocol=r.protocol,t.authority=r.authority,"/"!==r.path&&(t.path=""+r.path+t.path),!l.REQUIRE_ACCESS_TOKEN)return s(t);if(!(e=e||l.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+c);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+c);return t.params.push("access_token="+e),s(t)}function i(t){return 0===t.indexOf("mapbox:")}function o(t){for(var e=0;e=2||512===r?"@2x":"",c=u.supportsWebp?".webp":"$1";return n.path=n.path.replace(p,""+l+c),o(n.params),s(n)};var h=/^(\w+):\/\/([^\/?]*)(\/[^?]+)?\??(.+)?/},{"./browser":202,"./config":206}],218:[function(t,e,r){"use strict";var n=t("./is_char_in_unicode_block");e.exports.allowsIdeographicBreaking=function(t){for(var e=0,n=t;e=65097&&t<=65103)||!!n["CJK Compatibility Ideographs"](t)||!!n["CJK Compatibility"](t)||!!n["CJK Radicals Supplement"](t)||!!n["CJK Strokes"](t)||!(!n["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||!!n["CJK Unified Ideographs Extension A"](t)||!!n["CJK Unified Ideographs"](t)||!!n["Enclosed CJK Letters and Months"](t)||!!n["Hangul Compatibility Jamo"](t)||!!n["Hangul Jamo Extended-A"](t)||!!n["Hangul Jamo Extended-B"](t)||!!n["Hangul Jamo"](t)||!!n["Hangul Syllables"](t)||!!n.Hiragana(t)||!!n["Ideographic Description Characters"](t)||!!n.Kanbun(t)||!!n["Kangxi Radicals"](t)||!!n["Katakana Phonetic Extensions"](t)||!(!n.Katakana(t)||12540===t)||!(!n["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!n["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||!!n["Unified Canadian Aboriginal Syllabics"](t)||!!n["Unified Canadian Aboriginal Syllabics Extended"](t)||!!n["Vertical Forms"](t)||!!n["Yijing Hexagram Symbols"](t)||!!n["Yi Syllables"](t)||!!n["Yi Radicals"](t))},r.charHasNeutralVerticalOrientation=function(t){return!(!n["Latin-1 Supplement"](t)||167!==t&&169!==t&&174!==t&&177!==t&&188!==t&&189!==t&&190!==t&&215!==t&&247!==t)||!(!n["General Punctuation"](t)||8214!==t&&8224!==t&&8225!==t&&8240!==t&&8241!==t&&8251!==t&&8252!==t&&8258!==t&&8263!==t&&8264!==t&&8265!==t&&8273!==t)||!!n["Letterlike Symbols"](t)||!!n["Number Forms"](t)||!(!n["Miscellaneous Technical"](t)||!(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215))||!(!n["Control Pictures"](t)||9251===t)||!!n["Optical Character Recognition"](t)||!!n["Enclosed Alphanumerics"](t)||!!n["Geometric Shapes"](t)||!(!n["Miscellaneous Symbols"](t)||t>=9754&&t<=9759)||!(!n["Miscellaneous Symbols and Arrows"](t)||!(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243))||!!n["CJK Symbols and Punctuation"](t)||!!n.Katakana(t)||!!n["Private Use Area"](t)||!!n["CJK Compatibility Forms"](t)||!!n["Small Form Variants"](t)||!!n["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t},r.charHasRotatedVerticalOrientation=function(t){return!(r.charHasUprightVerticalOrientation(t)||r.charHasNeutralVerticalOrientation(t))}},{"./is_char_in_unicode_block":215}],219:[function(t,e,r){"use strict";var n=t("../geo/lng_lat");e.exports=function(t,e,r){if(t=new n(t.lng,t.lat),e){var i=new n(t.lng-360,t.lat),o=new n(t.lng+360,t.lat),a=r.locationPoint(t).distSqr(e);r.locationPoint(i).distSqr(e)180;){var s=r.locationPoint(t);if(s.x>=0&&s.y>=0&&s.x<=r.width&&s.y<=r.height)break;t.lng>r.center.lng?t.lng-=360:t.lng+=360}return t}},{"../geo/lng_lat":58}],220:[function(t,e,r){"use strict";function n(t){var e=JSON.stringify(t);if(f[e])return f[e];var r=void 0===t.alignment?1:t.alignment,n=0,a=0,l=["Uint8"],c=t.members.map(function(t){l.indexOf(t.type)<0&&l.push(t.type);var e=o(t.type),s=n=i(n,Math.max(r,e)),u=t.components||1;return a=Math.max(a,e),n+=e*u,{name:t.name,type:t.type,components:u,offset:s}}),d=i(n,Math.max(a,r)),m=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(p);m.prototype.alignment=r,m.prototype.size=d;for(var v=0,y=c;v1&&(x+=_),x in m.prototype)throw new Error(x+" is a reserved name and cannot be used as a member name.");Object.defineProperty(m.prototype,x,u(g,_))}var b=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(h);return b.prototype.members=c,b.prototype.StructType=m,b.prototype.bytesPerElement=d,b.prototype.emplaceBack=s(c,d),b.prototype._usedTypes=l,f[e]=b,b}function i(t,e){return Math.ceil(t/e)*e}function o(t){return c[t].BYTES_PER_ELEMENT}function a(t){return t.toLowerCase()}function s(t,e){for(var r=[],n=[],i="var i = this.length;\nthis.resize(this.length + 1);\n",s=0,l=t;sthis.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},h.prototype._refreshViews=function(){for(var t=this,e=0,r=t._usedTypes;e=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)},r.bezier=function(t,e,r,i){var o=new n(t,e,r,i);return function(t){return o.solve(t)}},r.ease=r.bezier(.25,.1,.25,1),r.clamp=function(t,e,r){return Math.min(r,Math.max(e,t))},r.wrap=function(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i},r.asyncAll=function(t,e,r){if(!t.length)return r(null,[]);var n=t.length,i=new Array(t.length),o=null;t.forEach(function(t,a){e(t,function(t,e){t&&(o=t),i[a]=e,0==--n&&r(o,i)})})},r.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},r.keysDifference=function(t,e){var r=[];for(var n in t)n in e||r.push(n);return r},r.extend=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n=0)return!0;return!1};var a={};r.warnOnce=function(t){a[t]||("undefined"!=typeof console&&console.warn(t),a[t]=!0)},r.isCounterClockwise=function(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)},r.calculateSignedArea=function(t){for(var e=0,r=0,n=t.length,i=n-1,o=void 0,a=void 0;r0||Math.abs(e.y-n.y)>0)&&Math.abs(r.calculateSignedArea(t))>.01},r.sphericalToCartesian=function(t){var e=t[0],r=t[1],n=t[2];return r+=90,r*=Math.PI/180,n*=Math.PI/180,[e*Math.cos(r)*Math.sin(n),e*Math.sin(r)*Math.sin(n),e*Math.cos(n)]},r.parseCacheControl=function(t){var e=/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,r={};if(t.replace(e,function(t,e,n,i){var o=n||i;return r[e]=!o||o.toLowerCase(),""}),r["max-age"]){var n=parseInt(r["max-age"],10);isNaN(n)?delete r["max-age"]:r["max-age"]=n}return r}},{"../geo/coordinate":57,"@mapbox/point-geometry":2,"@mapbox/unitbezier":5}],224:[function(t,e,r){"use strict";var n=function(t,e,r,n){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=r,t._y=n,this.properties=t.properties,null!=t.id&&(this.id=t.id)},i={geometry:{}};i.geometry.get=function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},i.geometry.set=function(t){this._geometry=t},n.prototype.toJSON=function(){var t=this,e={geometry:this.geometry};for(var r in t)"_geometry"!==r&&"_vectorTileFeature"!==r&&(e[r]=t[r]);return e},Object.defineProperties(n.prototype,i),e.exports=n},{}],225:[function(t,e,r){"use strict";var n=t("./script_detection");e.exports=function(t){for(var r="",i=0;i":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"}},{"./script_detection":218}],226:[function(t,e,r){"use strict";var n=t("./web_worker"),i=function(){this.active={}};i.prototype.acquire=function(e){var r=this;if(!this.workers){var i=t("../").workerCount;for(this.workers=[];this.workers.length=0&&Math.floor(e)===e&&isFinite(t)}function h(t){return null==t?"":"object"==typeof t?JSON.stringify(t,null,2):String(t)}function f(t){var e=parseFloat(t);return isNaN(e)?t:e}function d(t,e){for(var r=Object.create(null),i=t.split(","),n=0;n-1)return t.splice(r,1)}}function v(t,e){return ro.call(t,e)}function y(t){var e=Object.create(null);return function(r){return e[r]||(e[r]=t(r))}}function g(t,e){function r(r){var i=arguments.length;return i?i>1?t.apply(e,arguments):t.call(e,r):t.call(e)}return r._length=t.length,r}function _(t,e){e=e||0;for(var r=t.length-e,i=new Array(r);r--;)i[r]=t[r+e];return i}function x(t,e){for(var r in e)t[r]=e[r];return t}function b(t){for(var e={},r=0;r0&&(a=mt(a,(e||"")+"_"+r),dt(a[0])&&dt(u)&&(c[l]=I(u.text+a[0].text),a.shift()),c.push.apply(c,a)):s(a)?dt(u)?c[l]=I(u.text+a):""!==a&&c.push(I(a)):dt(a)&&dt(u)?c[l]=I(u.text+a.text):(o(t._isVList)&&n(a.tag)&&i(a.key)&&n(e)&&(a.key="__vlist"+e+"_"+r+"__"),c.push(a)));return c}function vt(t,e){return(t.__esModule||Io&&"Module"===t[Symbol.toStringTag])&&(t=t.default),l(t)?e.extend(t):t}function yt(t,e,r,i,n){var o=jo();return o.asyncFactory=t,o.asyncMeta={data:e,context:r,children:i,tag:n},o}function gt(t,e,r){if(o(t.error)&&n(t.errorComp))return t.errorComp;if(n(t.resolved))return t.resolved;if(o(t.loading)&&n(t.loadingComp))return t.loadingComp;if(!n(t.contexts)){var a=t.contexts=[r],s=!0,u=function(){for(var t=0,e=a.length;tua&&na[r].id>t.id;)r--;na.splice(r+1,0,t)}else na.push(t);sa||(sa=!0,at(Ot))}}function Nt(t){ha.clear(),Ut(t,ha)}function Ut(t,e){var r,i,n=Array.isArray(t);if((n||l(t))&&Object.isExtensible(t)){if(t.__ob__){var o=t.__ob__.dep.id;if(e.has(o))return;e.add(o)}if(n)for(r=t.length;r--;)Ut(t[r],e);else for(i=Object.keys(t),r=i.length;r--;)Ut(t[i[r]],e)}}function $t(t,e,r){fa.get=function(){return this[e][r]},fa.set=function(t){this[e][r]=t},Object.defineProperty(t,r,fa)}function qt(t){t._watchers=[];var e=t.$options;e.props&&Zt(t,e.props),e.methods&&Jt(t,e.methods),e.data?Gt(t):B(t._data={},!0),e.computed&&Ht(t,e.computed),e.watch&&e.watch!==zo&&Yt(t,e.watch)}function Zt(t,e){var r=t.$options.propsData||{},i=t._props={},n=t.$options._propKeys=[],o=!t.$parent;$o.shouldConvert=o;for(var a in e)!function(o){n.push(o);var a=J(o,e,r,t);F(i,o,a),o in t||$t(t,"_props",o)}(a);$o.shouldConvert=!0}function Gt(t){var e=t.$options.data;e=t._data="function"==typeof e?Wt(e,t):e||{},u(e)||(e={});for(var r=Object.keys(e),i=t.$options.props,n=(t.$options.methods,r.length);n--;){var o=r[n];i&&v(i,o)||A(o)||$t(t,"_data",o)}B(e,!0)}function Wt(t,e){try{return t.call(e,e)}catch(t){return et(t,e,"data()"),{}}}function Ht(t,e){var r=t._computedWatchers=Object.create(null),i=Mo();for(var n in e){var o=e[n],a="function"==typeof o?o:o.get;i||(r[n]=new pa(t,a||w,w,da)),n in t||Xt(t,n,o)}}function Xt(t,e,r){var i=!Mo();"function"==typeof r?(fa.get=i?Kt(e):r,fa.set=w):(fa.get=r.get?i&&!1!==r.cache?Kt(e):r.get:w,fa.set=r.set?r.set:w),Object.defineProperty(t,e,fa)}function Kt(t){return function(){var e=this._computedWatchers&&this._computedWatchers[t];if(e)return e.dirty&&e.evaluate(),Do.target&&e.depend(),e.value}}function Jt(t,e){t.$options.props;for(var r in e)t[r]=null==e[r]?w:g(e[r],t)}function Yt(t,e){for(var r in e){var i=e[r];if(Array.isArray(i))for(var n=0;n=0||r.indexOf(t[n])<0)&&i.push(t[n]);return i}return t}function Me(t){this._init(t)}function Le(t){t.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;var r=_(arguments,1);return r.unshift(this),"function"==typeof t.install?t.install.apply(t,r):"function"==typeof t&&t.apply(null,r),e.push(t),this}}function Ie(t){t.mixin=function(t){return this.options=X(this.options,t),this}}function Pe(t){t.cid=0;var e=1;t.extend=function(t){t=t||{};var r=this,i=r.cid,n=t._Ctor||(t._Ctor={});if(n[i])return n[i];var o=t.name||r.options.name,a=function(t){this._init(t)};return a.prototype=Object.create(r.prototype),a.prototype.constructor=a,a.cid=e++,a.options=X(r.options,t),a.super=r,a.options.props&&Re(a),a.options.computed&&De(a),a.extend=r.extend,a.mixin=r.mixin,a.use=r.use,po.forEach(function(t){a[t]=r[t]}),o&&(a.options.components[o]=a),a.superOptions=r.options,a.extendOptions=t,a.sealedOptions=x({},a.options),n[i]=a,a}}function Re(t){var e=t.options.props;for(var r in e)$t(t.prototype,"_props",r)}function De(t){var e=t.options.computed;for(var r in e)Xt(t.prototype,r,e[r])}function Oe(t){po.forEach(function(e){t[e]=function(t,r){return r?("component"===e&&u(r)&&(r.name=r.name||t,r=this.options._base.extend(r)),"directive"===e&&"function"==typeof r&&(r={bind:r,update:r}),this.options[e+"s"][t]=r,r):this.options[e+"s"][t]}})}function Be(t){return t&&(t.Ctor.options.name||t.tag)}function Fe(t,e){return Array.isArray(t)?t.indexOf(e)>-1:"string"==typeof t?t.split(",").indexOf(e)>-1:!!c(t)&&t.test(e)}function je(t,e){var r=t.cache,i=t.keys,n=t._vnode;for(var o in r){var a=r[o];if(a){var s=Be(a.componentOptions);s&&!e(s)&&Ve(r,o,i,n)}}}function Ve(t,e,r,i){var n=t[e];n&&n!==i&&n.componentInstance.$destroy(),t[e]=null,m(r,e)}function Ne(t){for(var e=t.data,r=t,i=t;n(i.componentInstance);)i=i.componentInstance._vnode,i.data&&(e=Ue(i.data,e));for(;n(r=r.parent);)r.data&&(e=Ue(e,r.data));return $e(e.staticClass,e.class)}function Ue(t,e){return{staticClass:qe(t.staticClass,e.staticClass),class:n(t.class)?[t.class,e.class]:e.class}}function $e(t,e){return n(t)||n(e)?qe(t,Ze(e)):""}function qe(t,e){return t?e?t+" "+e:t:e||""}function Ze(t){return Array.isArray(t)?Ge(t):l(t)?We(t):"string"==typeof t?t:""}function Ge(t){for(var e,r="",i=0,o=t.length;i-1?Ga[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:Ga[t]=/HTMLUnknownElement/.test(e.toString())}function Ke(t){if("string"==typeof t){var e=document.querySelector(t);return e||document.createElement("div")}return t}function Je(t,e){var r=document.createElement(t);return"select"!==t?r:(e.data&&e.data.attrs&&void 0!==e.data.attrs.multiple&&r.setAttribute("multiple","multiple"),r)}function Ye(t,e){return document.createElementNS(Na[t],e)}function Qe(t){return document.createTextNode(t)}function tr(t){return document.createComment(t)}function er(t,e,r){t.insertBefore(e,r)}function rr(t,e){t.removeChild(e)}function ir(t,e){t.appendChild(e)}function nr(t){return t.parentNode}function or(t){return t.nextSibling}function ar(t){return t.tagName}function sr(t,e){t.textContent=e}function lr(t,e,r){t.setAttribute(e,r)}function ur(t,e){var r=t.data.ref;if(r){var i=t.context,n=t.componentInstance||t.elm,o=i.$refs;e?Array.isArray(o[r])?m(o[r],n):o[r]===n&&(o[r]=void 0):t.data.refInFor?Array.isArray(o[r])?o[r].indexOf(n)<0&&o[r].push(n):o[r]=[n]:o[r]=n}}function cr(t,e){return t.key===e.key&&(t.tag===e.tag&&t.isComment===e.isComment&&n(t.data)===n(e.data)&&pr(t,e)||o(t.isAsyncPlaceholder)&&t.asyncFactory===e.asyncFactory&&i(e.asyncFactory.error))}function pr(t,e){if("input"!==t.tag)return!0;var r,i=n(r=t.data)&&n(r=r.attrs)&&r.type,o=n(r=e.data)&&n(r=r.attrs)&&r.type;return i===o||Wa(i)&&Wa(o)}function hr(t,e,r){var i,o,a={};for(i=e;i<=r;++i)o=t[i].key,n(o)&&(a[o]=i);return a}function fr(t,e){(t.data.directives||e.data.directives)&&dr(t,e)}function dr(t,e){var r,i,n,o=t===Ka,a=e===Ka,s=mr(t.data.directives,t.context),l=mr(e.data.directives,e.context),u=[],c=[];for(r in l)i=s[r],n=l[r],i?(n.oldValue=i.value,yr(n,"update",e,t),n.def&&n.def.componentUpdated&&c.push(n)):(yr(n,"bind",e,t),n.def&&n.def.inserted&&u.push(n));if(u.length){var p=function(){for(var r=0;r=0&&" "===(v=t.charAt(m));m--);v&&is.test(v)||(c=!0)}}else void 0===o?(d=n+1,o=t.slice(0,n).trim()):e();if(void 0===o?o=t.slice(0,n).trim():0!==d&&e(),a)for(n=0;n-1?{exp:t.slice(0,Aa),key:'"'+t.slice(Aa+1)+'"'}:{exp:t,key:null};for(Sa=t,Aa=Ca=Ea=0;!Dr();)za=Rr(),Or(za)?Fr(za):91===za&&Br(za);return{exp:t.slice(0,Ca),key:t.slice(Ca+1,Ea)}}function Rr(){return Sa.charCodeAt(++Aa)}function Dr(){return Aa>=Ta}function Or(t){return 34===t||39===t}function Br(t){var e=1;for(Ca=Aa;!Dr();)if(t=Rr(),Or(t))Fr(t);else if(91===t&&e++,93===t&&e--,0===e){Ea=Aa;break}}function Fr(t){for(var e=t;!Dr()&&(t=Rr())!==e;);}function jr(t,e,r){ka=r;var i=e.value,n=e.modifiers,o=t.tag,a=t.attrsMap.type;if(t.component)return Lr(t,i,n),!1;if("select"===o)Ur(t,i,n);else if("input"===o&&"checkbox"===a)Vr(t,i,n);else if("input"===o&&"radio"===a)Nr(t,i,n);else if("input"===o||"textarea"===o)$r(t,i,n);else if(!fo.isReservedTag(o))return Lr(t,i,n),!1;return!0}function Vr(t,e,r){var i=r&&r.number,n=kr(t,"value")||"null",o=kr(t,"true-value")||"true",a=kr(t,"false-value")||"false";zr(t,"checked","Array.isArray("+e+")?_i("+e+","+n+")>-1"+("true"===o?":("+e+")":":_q("+e+","+o+")")),Er(t,"change","var $$a="+e+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+a+");if(Array.isArray($$a)){var $$v="+(i?"_n("+n+")":n)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+e+"=$$a.concat([$$v]))}else{$$i>-1&&("+e+"=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}}else{"+Ir(e,"$$c")+"}",null,!0)}function Nr(t,e,r){var i=r&&r.number,n=kr(t,"value")||"null";n=i?"_n("+n+")":n,zr(t,"checked","_q("+e+","+n+")"),Er(t,"change",Ir(e,n),null,!0)}function Ur(t,e,r){var i=r&&r.number,n='Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return '+(i?"_n(val)":"val")+"})",o="var $$selectedVal = "+n+";";o=o+" "+Ir(e,"$event.target.multiple ? $$selectedVal : $$selectedVal[0]"),Er(t,"change",o,null,!0)}function $r(t,e,r){var i=t.attrsMap.type,n=r||{},o=n.lazy,a=n.number,s=n.trim,l=!o&&"range"!==i,u=o?"change":"range"===i?ns:"input",c="$event.target.value";s&&(c="$event.target.value.trim()"),a&&(c="_n("+c+")");var p=Ir(e,c);l&&(p="if($event.target.composing)return;"+p),zr(t,"value","("+e+")"),Er(t,u,p,null,!0),(s||a)&&Er(t,"blur","$forceUpdate()")}function qr(t){if(n(t[ns])){var e=xo?"change":"input";t[e]=[].concat(t[ns],t[e]||[]),delete t[ns]}n(t[os])&&(t.change=[].concat(t[os],t.change||[]),delete t[os])}function Zr(t,e,r){var i=Ma;return function n(){null!==t.apply(null,arguments)&&Wr(e,n,r,i)}}function Gr(t,e,r,i,n){e=ot(e),r&&(e=Zr(e,t,i)),Ma.addEventListener(t,e,Ao?{capture:i,passive:n}:i)}function Wr(t,e,r,i){(i||Ma).removeEventListener(t,e._withTask||e,r)}function Hr(t,e){if(!i(t.data.on)||!i(e.data.on)){var r=e.data.on||{},n=t.data.on||{};Ma=e.elm,qr(r),lt(r,n,Gr,Wr,e.context)}}function Xr(t,e){if(!i(t.data.domProps)||!i(e.data.domProps)){var r,o,a=e.elm,s=t.data.domProps||{},l=e.data.domProps||{};n(l.__ob__)&&(l=e.data.domProps=x({},l));for(r in s)i(l[r])&&(a[r]="");for(r in l){if(o=l[r],"textContent"===r||"innerHTML"===r){if(e.children&&(e.children.length=0),o===s[r])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===r){a._value=o;var u=i(o)?"":String(o);Kr(a,u)&&(a.value=u)}else a[r]=o}}}function Kr(t,e){return!t.composing&&("OPTION"===t.tagName||Jr(t,e)||Yr(t,e))}function Jr(t,e){var r=!0;try{r=document.activeElement!==t}catch(t){}return r&&t.value!==e}function Yr(t,e){var r=t.value,i=t._vModifiers;return n(i)&&i.number?f(r)!==f(e):n(i)&&i.trim?r.trim()!==e.trim():r!==e}function Qr(t){var e=ti(t.style);return t.staticStyle?x(t.staticStyle,e):e}function ti(t){return Array.isArray(t)?b(t):"string"==typeof t?ls(t):t}function ei(t,e){var r,i={};if(e)for(var n=t;n.componentInstance;)n=n.componentInstance._vnode,n.data&&(r=Qr(n.data))&&x(i,r);(r=Qr(t.data))&&x(i,r);for(var o=t;o=o.parent;)o.data&&(r=Qr(o.data))&&x(i,r);return i}function ri(t,e){var r=e.data,o=t.data;if(!(i(r.staticStyle)&&i(r.style)&&i(o.staticStyle)&&i(o.style))){var a,s,l=e.elm,u=o.staticStyle,c=o.normalizedStyle||o.style||{},p=u||c,h=ti(e.data.style)||{};e.data.normalizedStyle=n(h.__ob__)?x({},h):h;var f=ei(e,!0);for(s in p)i(f[s])&&ps(l,s,"");for(s in f)(a=f[s])!==p[s]&&ps(l,s,null==a?"":a)}}function ii(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(/\s+/).forEach(function(e){return t.classList.add(e)}):t.classList.add(e);else{var r=" "+(t.getAttribute("class")||"")+" ";r.indexOf(" "+e+" ")<0&&t.setAttribute("class",(r+e).trim())}}function ni(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(/\s+/).forEach(function(e){return t.classList.remove(e)}):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{for(var r=" "+(t.getAttribute("class")||"")+" ",i=" "+e+" ";r.indexOf(i)>=0;)r=r.replace(i," ");r=r.trim(),r?t.setAttribute("class",r):t.removeAttribute("class")}}function oi(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&x(e,ms(t.name||"v")),x(e,t),e}return"string"==typeof t?ms(t):void 0}}function ai(t){Ts(function(){Ts(t)})}function si(t,e){var r=t._transitionClasses||(t._transitionClasses=[]);r.indexOf(e)<0&&(r.push(e),ii(t,e))}function li(t,e){t._transitionClasses&&m(t._transitionClasses,e),ni(t,e)}function ui(t,e,r){var i=ci(t,e),n=i.type,o=i.timeout,a=i.propCount;if(!n)return r();var s=n===ys?xs:ws,l=0,u=function(){t.removeEventListener(s,c),r()},c=function(e){e.target===t&&++l>=a&&u()};setTimeout(function(){l0&&(r=ys,c=a,p=o.length):e===gs?u>0&&(r=gs,c=u,p=l.length):(c=Math.max(a,u),r=c>0?a>u?ys:gs:null,p=r?r===ys?o.length:l.length:0),{type:r,timeout:c,propCount:p,hasTransform:r===ys&&Ss.test(i[_s+"Property"])}}function pi(t,e){for(;t.length1}function yi(t,e){!0!==e.data.show&&fi(e)}function gi(t,e,r){_i(t,e,r),(xo||wo)&&setTimeout(function(){_i(t,e,r)},0)}function _i(t,e,r){var i=e.value,n=t.multiple;if(!n||Array.isArray(i)){for(var o,a,s=0,l=t.options.length;s-1,a.selected!==o&&(a.selected=o);else if(T(bi(a),i))return void(t.selectedIndex!==s&&(t.selectedIndex=s));n||(t.selectedIndex=-1)}}function xi(t,e){return e.every(function(e){return!T(e,t)})}function bi(t){return"_value"in t?t._value:t.value}function wi(t){t.target.composing=!0}function Ti(t){t.target.composing&&(t.target.composing=!1,Si(t.target,"input"))}function Si(t,e){var r=document.createEvent("HTMLEvents");r.initEvent(e,!0,!0),t.dispatchEvent(r)}function zi(t){return!t.componentInstance||t.data&&t.data.transition?t:zi(t.componentInstance._vnode)}function Ai(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?Ai(xt(e.children)):t}function Ci(t){var e={},r=t.$options;for(var i in r.propsData)e[i]=t[i];var n=r._parentListeners;for(var o in n)e[no(o)]=n[o];return e}function Ei(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}function ki(t){for(;t=t.parent;)if(t.data.transition)return!0}function Mi(t,e){return e.key===t.key&&e.tag===t.tag}function Li(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function Ii(t){t.data.newPos=t.elm.getBoundingClientRect()}function Pi(t){var e=t.data.pos,r=t.data.newPos,i=e.left-r.left,n=e.top-r.top;if(i||n){t.data.moved=!0;var o=t.elm.style;o.transform=o.WebkitTransform="translate("+i+"px,"+n+"px)",o.transitionDuration="0s"}}function Ri(t,e){var r=e?Ns(e):js;if(r.test(t)){for(var i,n,o=[],a=r.lastIndex=0;i=r.exec(t);){n=i.index,n>a&&o.push(JSON.stringify(t.slice(a,n)));var s=br(i[1].trim());o.push("_s("+s+")"),a=n+i[0].length}return a=0&&a[n].lowerCasedTag!==s;n--);else n=0;if(n>=0){for(var l=a.length-1;l>=n;l--)e.end&&e.end(a[l].tag,r,i);a.length=n,o=n&&a[n-1].tag}else"br"===s?e.start&&e.start(t,[],!0,r,i):"p"===s&&(e.start&&e.start(t,[],!1,r,i),e.end&&e.end(t,r,i))}for(var n,o,a=[],s=e.expectHTML,l=e.isUnaryTag||lo,u=e.canBeLeftOpenTag||lo,c=0;t;){if(n=t,o&&dl(o)){var p=0,h=o.toLowerCase(),f=ml[h]||(ml[h]=new RegExp("([\\s\\S]*?)(]*>)","i")),d=t.replace(f,function(t,r,i){return p=i.length,dl(h)||"noscript"===h||(r=r.replace(//g,"$1").replace(//g,"$1")),xl(h,r)&&(r=r.slice(1)),e.chars&&e.chars(r),""});c+=t.length-d.length,t=d,i(h,c-p,c)}else{var m=t.indexOf("<");if(0===m){if(el.test(t)){var v=t.indexOf("--\x3e");if(v>=0){e.shouldKeepComment&&e.comment(t.substring(4,v)),r(v+3);continue}}if(rl.test(t)){var y=t.indexOf("]>");if(y>=0){r(y+2);continue}}var g=t.match(tl);if(g){r(g[0].length);continue}var _=t.match(Qs);if(_){var x=c;r(_[0].length),i(_[1],x,c);continue}var b=function(){var e=t.match(Js);if(e){var i={tagName:e[1],attrs:[],start:c};r(e[0].length);for(var n,o;!(n=t.match(Ys))&&(o=t.match(Hs));)r(o[0].length),i.attrs.push(o);if(n)return i.unarySlash=n[1],r(n[0].length),i.end=c,i}}();if(b){!function(t){var r=t.tagName,n=t.unarySlash;s&&("p"===o&&Ws(r)&&i(o),u(r)&&o===r&&i(r));for(var c=l(r)||!!n,p=t.attrs.length,h=new Array(p),f=0;f=0){for(T=t.slice(m);!(Qs.test(T)||Js.test(T)||el.test(T)||rl.test(T)||(S=T.indexOf("<",1))<0);)m+=S,T=t.slice(m);w=t.substring(0,m),r(m)}m<0&&(w=t,t=""),e.chars&&w&&e.chars(w)}if(t===n){e.chars&&e.chars(t);break}}i()}function Ni(t,e,r){return{type:1,tag:t,attrsList:e,attrsMap:an(e),parent:r,children:[]}}function Ui(t,e){function r(t){t.pre&&(s=!1),ul(t.tag)&&(l=!1)}nl=e.warn||Tr,ul=e.isPreTag||lo,cl=e.mustUseProp||lo,pl=e.getTagNamespace||lo,al=Sr(e.modules,"transformNode"),sl=Sr(e.modules,"preTransformNode"),ll=Sr(e.modules,"postTransformNode"),ol=e.delimiters;var i,n,o=[],a=!1!==e.preserveWhitespace,s=!1,l=!1;return Vi(t,{warn:nl,expectHTML:e.expectHTML,isUnaryTag:e.isUnaryTag,canBeLeftOpenTag:e.canBeLeftOpenTag,shouldDecodeNewlines:e.shouldDecodeNewlines,shouldKeepComment:e.comments,start:function(t,a,u){var c=n&&n.ns||pl(t);xo&&"svg"===c&&(a=un(a));var p=Ni(t,a,n);c&&(p.ns=c),ln(p)&&!Mo()&&(p.forbidden=!0);for(var h=0;h0,wo=_o&&_o.indexOf("edge/")>0,To=_o&&_o.indexOf("android")>0,So=_o&&/iphone|ipad|ipod|ios/.test(_o),zo=(_o&&/chrome\/\d+/.test(_o),{}.watch),Ao=!1;if(go)try{var Co={};Object.defineProperty(Co,"passive",{get:function(){Ao=!0}}),window.addEventListener("test-passive",null,Co)}catch(t){}var Eo,ko,Mo=function(){return void 0===Eo&&(Eo=!go&&void 0!==t&&"server"===t.process.env.VUE_ENV),Eo},Lo=go&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__,Io="undefined"!=typeof Symbol&&k(Symbol)&&"undefined"!=typeof Reflect&&k(Reflect.ownKeys);ko="undefined"!=typeof Set&&k(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var Po=w,Ro=0,Do=function(){this.id=Ro++,this.subs=[]};Do.prototype.addSub=function(t){this.subs.push(t)},Do.prototype.removeSub=function(t){m(this.subs,t)},Do.prototype.depend=function(){Do.target&&Do.target.addDep(this)},Do.prototype.notify=function(){for(var t=this.subs.slice(),e=0,r=t.length;e1?_(r):r;for(var i=_(arguments,1),n=0,o=r.length;nparseInt(this.max)&&Ve(n,o[0],o,this._vnode)),t.data.keepAlive=!0}return t}},wa={KeepAlive:ba};!function(t){var e={};e.get=function(){return fo},Object.defineProperty(t,"config",e),t.util={warn:Po,extend:x,mergeOptions:X,defineReactive:F},t.set=j,t.delete=V,t.nextTick=at,t.options=Object.create(null),po.forEach(function(e){t.options[e+"s"]=Object.create(null)}),t.options._base=t,x(t.options.components,wa),Le(t),Ie(t),Pe(t),Oe(t)}(Me),Object.defineProperty(Me.prototype,"$isServer",{get:Mo}),Object.defineProperty(Me.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Me.version="2.5.2";var Ta,Sa,za,Aa,Ca,Ea,ka,Ma,La,Ia=d("style,class"),Pa=d("input,textarea,option,select,progress"),Ra=function(t,e,r){return"value"===r&&Pa(t)&&"button"!==e||"selected"===r&&"option"===t||"checked"===r&&"input"===t||"muted"===r&&"video"===t},Da=d("contenteditable,draggable,spellcheck"),Oa=d("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),Ba="http://www.w3.org/1999/xlink",Fa=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},ja=function(t){return Fa(t)?t.slice(6,t.length):""},Va=function(t){return null==t||!1===t},Na={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},Ua=d("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot"),$a=d("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),qa=function(t){return"pre"===t},Za=function(t){return Ua(t)||$a(t)},Ga=Object.create(null),Wa=d("text,number,password,search,email,tel,url"),Ha=Object.freeze({createElement:Je,createElementNS:Ye,createTextNode:Qe,createComment:tr,insertBefore:er,removeChild:rr,appendChild:ir,parentNode:nr,nextSibling:or,tagName:ar,setTextContent:sr,setAttribute:lr}),Xa={create:function(t,e){ur(e)},update:function(t,e){t.data.ref!==e.data.ref&&(ur(t,!0),ur(e))},destroy:function(t){ur(t,!0)}},Ka=new Bo("",{},[]),Ja=["create","activate","update","remove","destroy"],Ya={create:fr,update:fr,destroy:function(t){fr(t,Ka)}},Qa=Object.create(null),ts=[Xa,Ya],es={create:gr,update:gr},rs={create:xr,update:xr},is=/[\w).+\-_$\]]/,ns="__r",os="__c",as={create:Hr,update:Hr},ss={create:Xr,update:Xr},ls=y(function(t){var e={},r=/;(?![^(]*\))/g,i=/:(.+)/;return t.split(r).forEach(function(t){if(t){var r=t.split(i);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}),us=/^--/,cs=/\s*!important$/,ps=function(t,e,r){if(us.test(e))t.style.setProperty(e,r);else if(cs.test(r))t.style.setProperty(e,r.replace(cs,""),"important");else{var i=fs(e);if(Array.isArray(r))for(var n=0,o=r.length;nd?(p=i(r[y+1])?null:r[y+1].elm,g(t,p,r,f,y,o)):f>y&&x(t,e,h,d)}function T(t,e,r,i){for(var o=r;o',r.innerHTML.indexOf(e)>0}("\n"," "),js=/\{\{((?:.|\n)+?)\}\}/g,Vs=/[-.*+?^${}()|[\]\/\\]/g,Ns=y(function(t){var e=t[0].replace(Vs,"\\$&"),r=t[1].replace(Vs,"\\$&");return new RegExp(e+"((?:.|\\n)+?)"+r,"g")}),Us={staticKeys:["staticClass"],transformNode:Di,genData:Oi},$s={staticKeys:["staticStyle"],transformNode:Bi,genData:Fi},qs={decode:function(t){return Bs=Bs||document.createElement("div"),Bs.innerHTML=t,Bs.textContent}},Zs=d("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),Gs=d("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),Ws=d("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),Hs=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,Xs="[a-zA-Z_][\\w\\-\\.]*",Ks="((?:"+Xs+"\\:)?"+Xs+")",Js=new RegExp("^<"+Ks),Ys=/^\s*(\/?)>/,Qs=new RegExp("^<\\/"+Ks+"[^>]*>"),tl=/^]+>/i,el=/^/g,"$1").replace(//g,"$1")),xl(h,r)&&(r=r.slice(1)),e.chars&&e.chars(r),""});c+=t.length-d.length,t=d,n(h,c-p,c)}else{var m=t.indexOf("<");if(0===m){if(el.test(t)){var v=t.indexOf("--\x3e");if(v>=0){e.shouldKeepComment&&e.comment(t.substring(4,v)),r(v+3);continue}}if(rl.test(t)){var y=t.indexOf("]>");if(y>=0){r(y+2);continue}}var g=t.match(tl);if(g){r(g[0].length);continue}var _=t.match(Qs);if(_){var x=c;r(_[0].length),n(_[1],x,c);continue}var b=function(){var e=t.match(Js);if(e){var n={tagName:e[1],attrs:[],start:c};r(e[0].length);for(var i,o;!(i=t.match(Ys))&&(o=t.match(Hs));)r(o[0].length),n.attrs.push(o);if(i)return n.unarySlash=i[1],r(i[0].length),n.end=c,n}}();if(b){!function(t){var r=t.tagName,i=t.unarySlash;s&&("p"===o&&Ws(r)&&n(o),u(r)&&o===r&&n(r));for(var c=l(r)||!!i,p=t.attrs.length,h=new Array(p),f=0;f=0){for(T=t.slice(m);!Qs.test(T)&&!Js.test(T)&&!el.test(T)&&!rl.test(T)&&!((S=T.indexOf("<",1))<0);)m+=S,T=t.slice(m);w=t.substring(0,m),r(m)}m<0&&(w=t,t=""),e.chars&&w&&e.chars(w)}if(t===i){e.chars&&e.chars(t);break}}n()}function Un(t,e,r){return{type:1,tag:t,attrsList:e,attrsMap:ai(e),parent:r,children:[]}}function $n(t,e){function r(t){t.pre&&(s=!1),ul(t.tag)&&(l=!1)}il=e.warn||Tr,ul=e.isPreTag||lo,cl=e.mustUseProp||lo,pl=e.getTagNamespace||lo,al=Sr(e.modules,"transformNode"),sl=Sr(e.modules,"preTransformNode"),ll=Sr(e.modules,"postTransformNode"),ol=e.delimiters;var n,i,o=[],a=!1!==e.preserveWhitespace,s=!1,l=!1;return Nn(t,{warn:il,expectHTML:e.expectHTML,isUnaryTag:e.isUnaryTag,canBeLeftOpenTag:e.canBeLeftOpenTag,shouldDecodeNewlines:e.shouldDecodeNewlines,shouldKeepComment:e.comments,start:function(t,a,u){var c=i&&i.ns||pl(t);xo&&"svg"===c&&(a=ui(a));var p=Un(t,a,i);c&&(p.ns=c),li(p)&&!Mo()&&(p.forbidden=!0);for(var h=0;h0,wo=_o&&_o.indexOf("edge/")>0,To=_o&&_o.indexOf("android")>0,So=_o&&/iphone|ipad|ipod|ios/.test(_o),zo=(_o&&/chrome\/\d+/.test(_o),{}.watch),Ao=!1;if(go)try{var Co={};Object.defineProperty(Co,"passive",{get:function(){Ao=!0}}),window.addEventListener("test-passive",null,Co)}catch(t){}var Eo,ko,Mo=function(){return void 0===Eo&&(Eo=!go&&"undefined"!==typeof t&&"server"===t.process.env.VUE_ENV),Eo},Lo=go&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__,Io="undefined"!==typeof Symbol&&k(Symbol)&&"undefined"!==typeof Reflect&&k(Reflect.ownKeys);ko="undefined"!==typeof Set&&k(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var Po=w,Ro=0,Do=function(){this.id=Ro++,this.subs=[]};Do.prototype.addSub=function(t){this.subs.push(t)},Do.prototype.removeSub=function(t){m(this.subs,t)},Do.prototype.depend=function(){Do.target&&Do.target.addDep(this)},Do.prototype.notify=function(){for(var t=this.subs.slice(),e=0,r=t.length;e1?_(r):r;for(var n=_(arguments,1),i=0,o=r.length;iparseInt(this.max)&&Ve(i,o[0],o,this._vnode)),t.data.keepAlive=!0}return t}},wa={KeepAlive:ba};!function(t){var e={};e.get=function(){return fo},Object.defineProperty(t,"config",e),t.util={warn:Po,extend:x,mergeOptions:X,defineReactive:F},t.set=j,t.delete=V,t.nextTick=at,t.options=Object.create(null),po.forEach(function(e){t.options[e+"s"]=Object.create(null)}),t.options._base=t,x(t.options.components,wa),Le(t),Ie(t),Pe(t),Oe(t)}(Me),Object.defineProperty(Me.prototype,"$isServer",{get:Mo}),Object.defineProperty(Me.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Me.version="2.5.2";var Ta,Sa,za,Aa,Ca,Ea,ka,Ma,La,Ia=d("style,class"),Pa=d("input,textarea,option,select,progress"),Ra=function(t,e,r){return"value"===r&&Pa(t)&&"button"!==e||"selected"===r&&"option"===t||"checked"===r&&"input"===t||"muted"===r&&"video"===t},Da=d("contenteditable,draggable,spellcheck"),Oa=d("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),Ba="http://www.w3.org/1999/xlink",Fa=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},ja=function(t){return Fa(t)?t.slice(6,t.length):""},Va=function(t){return null==t||!1===t},Na={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},Ua=d("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot"),$a=d("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),qa=function(t){return"pre"===t},Za=function(t){return Ua(t)||$a(t)},Ga=Object.create(null),Wa=d("text,number,password,search,email,tel,url"),Ha=Object.freeze({createElement:Je,createElementNS:Ye,createTextNode:Qe,createComment:tr,insertBefore:er,removeChild:rr,appendChild:nr,parentNode:ir,nextSibling:or,tagName:ar,setTextContent:sr,setAttribute:lr}),Xa={create:function(t,e){ur(e)},update:function(t,e){t.data.ref!==e.data.ref&&(ur(t,!0),ur(e))},destroy:function(t){ur(t,!0)}},Ka=new Bo("",{},[]),Ja=["create","activate","update","remove","destroy"],Ya={create:fr,update:fr,destroy:function(t){fr(t,Ka)}},Qa=Object.create(null),ts=[Xa,Ya],es={create:gr,update:gr},rs={create:xr,update:xr},ns=/[\w).+\-_$\]]/,is="__r",os="__c",as={create:Hr,update:Hr},ss={create:Xr,update:Xr},ls=y(function(t){var e={},r=/;(?![^(]*\))/g,n=/:(.+)/;return t.split(r).forEach(function(t){if(t){var r=t.split(n);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}),us=/^--/,cs=/\s*!important$/,ps=function(t,e,r){if(us.test(e))t.style.setProperty(e,r);else if(cs.test(r))t.style.setProperty(e,r.replace(cs,""),"important");else{var n=fs(e);if(Array.isArray(r))for(var i=0,o=r.length;id?(p=n(r[y+1])?null:r[y+1].elm,g(t,p,r,f,y,o)):f>y&&x(t,e,h,d)}function T(t,e,r,n){for(var o=r;o',r.innerHTML.indexOf(e)>0}("\n"," "),js=/\{\{((?:.|\n)+?)\}\}/g,Vs=/[-.*+?^${}()|[\]\/\\]/g,Ns=y(function(t){var e=t[0].replace(Vs,"\\$&"),r=t[1].replace(Vs,"\\$&");return new RegExp(e+"((?:.|\\n)+?)"+r,"g")}),Us={staticKeys:["staticClass"],transformNode:On,genData:Bn},$s={staticKeys:["staticStyle"],transformNode:Fn,genData:jn},qs={decode:function(t){return Bs=Bs||document.createElement("div"),Bs.innerHTML=t,Bs.textContent}},Zs=d("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),Gs=d("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),Ws=d("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),Hs=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,Xs="[a-zA-Z_][\\w\\-\\.]*",Ks="((?:"+Xs+"\\:)?"+Xs+")",Js=new RegExp("^<"+Ks),Ys=/^\s*(\/?)>/,Qs=new RegExp("^<\\/"+Ks+"[^>]*>"),tl=/^]+>/i,el=/^ ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)\n ? ((formatComponentName(vm[0])) + \"... (\" + (vm[1]) + \" recursive calls)\")\n : formatComponentName(vm))); })\n .join('\\n')\n } else {\n return (\"\\n\\n(found in \" + (formatComponentName(vm)) + \")\")\n }\n };\n}\n\n/* */\n\n\nvar uid = 0;\n\n/**\n * A dep is an observable that can have multiple\n * directives subscribing to it.\n */\nvar Dep = function Dep () {\n this.id = uid++;\n this.subs = [];\n};\n\nDep.prototype.addSub = function addSub (sub) {\n this.subs.push(sub);\n};\n\nDep.prototype.removeSub = function removeSub (sub) {\n remove(this.subs, sub);\n};\n\nDep.prototype.depend = function depend () {\n if (Dep.target) {\n Dep.target.addDep(this);\n }\n};\n\nDep.prototype.notify = function notify () {\n // stabilize the subscriber list first\n var subs = this.subs.slice();\n for (var i = 0, l = subs.length; i < l; i++) {\n subs[i].update();\n }\n};\n\n// the current target watcher being evaluated.\n// this is globally unique because there could be only one\n// watcher being evaluated at any time.\nDep.target = null;\nvar targetStack = [];\n\nfunction pushTarget (_target) {\n if (Dep.target) { targetStack.push(Dep.target); }\n Dep.target = _target;\n}\n\nfunction popTarget () {\n Dep.target = targetStack.pop();\n}\n\n/* */\n\nvar VNode = function VNode (\n tag,\n data,\n children,\n text,\n elm,\n context,\n componentOptions,\n asyncFactory\n) {\n this.tag = tag;\n this.data = data;\n this.children = children;\n this.text = text;\n this.elm = elm;\n this.ns = undefined;\n this.context = context;\n this.functionalContext = undefined;\n this.functionalOptions = undefined;\n this.functionalScopeId = undefined;\n this.key = data && data.key;\n this.componentOptions = componentOptions;\n this.componentInstance = undefined;\n this.parent = undefined;\n this.raw = false;\n this.isStatic = false;\n this.isRootInsert = true;\n this.isComment = false;\n this.isCloned = false;\n this.isOnce = false;\n this.asyncFactory = asyncFactory;\n this.asyncMeta = undefined;\n this.isAsyncPlaceholder = false;\n};\n\nvar prototypeAccessors = { child: { configurable: true } };\n\n// DEPRECATED: alias for componentInstance for backwards compat.\n/* istanbul ignore next */\nprototypeAccessors.child.get = function () {\n return this.componentInstance\n};\n\nObject.defineProperties( VNode.prototype, prototypeAccessors );\n\nvar createEmptyVNode = function (text) {\n if ( text === void 0 ) text = '';\n\n var node = new VNode();\n node.text = text;\n node.isComment = true;\n return node\n};\n\nfunction createTextVNode (val) {\n return new VNode(undefined, undefined, undefined, String(val))\n}\n\n// optimized shallow clone\n// used for static nodes and slot nodes because they may be reused across\n// multiple renders, cloning them avoids errors when DOM manipulations rely\n// on their elm reference.\nfunction cloneVNode (vnode, deep) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.isCloned = true;\n if (deep && vnode.children) {\n cloned.children = cloneVNodes(vnode.children);\n }\n return cloned\n}\n\nfunction cloneVNodes (vnodes, deep) {\n var len = vnodes.length;\n var res = new Array(len);\n for (var i = 0; i < len; i++) {\n res[i] = cloneVNode(vnodes[i], deep);\n }\n return res\n}\n\n/*\n * not type checking this file because flow doesn't play well with\n * dynamically accessing methods on Array prototype\n */\n\nvar arrayProto = Array.prototype;\nvar arrayMethods = Object.create(arrayProto);[\n 'push',\n 'pop',\n 'shift',\n 'unshift',\n 'splice',\n 'sort',\n 'reverse'\n]\n.forEach(function (method) {\n // cache original method\n var original = arrayProto[method];\n def(arrayMethods, method, function mutator () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var result = original.apply(this, args);\n var ob = this.__ob__;\n var inserted;\n switch (method) {\n case 'push':\n case 'unshift':\n inserted = args;\n break\n case 'splice':\n inserted = args.slice(2);\n break\n }\n if (inserted) { ob.observeArray(inserted); }\n // notify change\n ob.dep.notify();\n return result\n });\n});\n\n/* */\n\nvar arrayKeys = Object.getOwnPropertyNames(arrayMethods);\n\n/**\n * By default, when a reactive property is set, the new value is\n * also converted to become reactive. However when passing down props,\n * we don't want to force conversion because the value may be a nested value\n * under a frozen data structure. Converting it would defeat the optimization.\n */\nvar observerState = {\n shouldConvert: true\n};\n\n/**\n * Observer class that are attached to each observed\n * object. Once attached, the observer converts target\n * object's property keys into getter/setters that\n * collect dependencies and dispatches updates.\n */\nvar Observer = function Observer (value) {\n this.value = value;\n this.dep = new Dep();\n this.vmCount = 0;\n def(value, '__ob__', this);\n if (Array.isArray(value)) {\n var augment = hasProto\n ? protoAugment\n : copyAugment;\n augment(value, arrayMethods, arrayKeys);\n this.observeArray(value);\n } else {\n this.walk(value);\n }\n};\n\n/**\n * Walk through each property and convert them into\n * getter/setters. This method should only be called when\n * value type is Object.\n */\nObserver.prototype.walk = function walk (obj) {\n var keys = Object.keys(obj);\n for (var i = 0; i < keys.length; i++) {\n defineReactive(obj, keys[i], obj[keys[i]]);\n }\n};\n\n/**\n * Observe a list of Array items.\n */\nObserver.prototype.observeArray = function observeArray (items) {\n for (var i = 0, l = items.length; i < l; i++) {\n observe(items[i]);\n }\n};\n\n// helpers\n\n/**\n * Augment an target Object or Array by intercepting\n * the prototype chain using __proto__\n */\nfunction protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}\n\n/**\n * Augment an target Object or Array by defining\n * hidden properties.\n */\n/* istanbul ignore next */\nfunction copyAugment (target, src, keys) {\n for (var i = 0, l = keys.length; i < l; i++) {\n var key = keys[i];\n def(target, key, src[key]);\n }\n}\n\n/**\n * Attempt to create an observer instance for a value,\n * returns the new observer if successfully observed,\n * or the existing observer if the value already has one.\n */\nfunction observe (value, asRootData) {\n if (!isObject(value) || value instanceof VNode) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}\n\n/**\n * Define a reactive property on an Object.\n */\nfunction defineReactive (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (false) {\n customSetter();\n }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}\n\n/**\n * Set a property on an object. Adds the new property and\n * triggers change notification if the property doesn't\n * already exist.\n */\nfunction set (target, key, val) {\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.length = Math.max(target.length, key);\n target.splice(key, 1, val);\n return val\n }\n if (hasOwn(target, key)) {\n target[key] = val;\n return val\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"production\" !== 'production' && warn(\n 'Avoid adding reactive properties to a Vue instance or its root $data ' +\n 'at runtime - declare it upfront in the data option.'\n );\n return val\n }\n if (!ob) {\n target[key] = val;\n return val\n }\n defineReactive(ob.value, key, val);\n ob.dep.notify();\n return val\n}\n\n/**\n * Delete a property and trigger change if necessary.\n */\nfunction del (target, key) {\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"production\" !== 'production' && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}\n\n/**\n * Collect dependencies on array elements when the array is touched, since\n * we cannot intercept array element access like property getters.\n */\nfunction dependArray (value) {\n for (var e = (void 0), i = 0, l = value.length; i < l; i++) {\n e = value[i];\n e && e.__ob__ && e.__ob__.dep.depend();\n if (Array.isArray(e)) {\n dependArray(e);\n }\n }\n}\n\n/* */\n\n/**\n * Option overwriting strategies are functions that handle\n * how to merge a parent option value and a child option\n * value into the final value.\n */\nvar strats = config.optionMergeStrategies;\n\n/**\n * Options with restrictions\n */\nif (false) {\n strats.el = strats.propsData = function (parent, child, vm, key) {\n if (!vm) {\n warn(\n \"option \\\"\" + key + \"\\\" can only be used during instance \" +\n 'creation with the `new` keyword.'\n );\n }\n return defaultStrat(parent, child)\n };\n}\n\n/**\n * Helper that recursively merges two data objects together.\n */\nfunction mergeData (to, from) {\n if (!from) { return to }\n var key, toVal, fromVal;\n var keys = Object.keys(from);\n for (var i = 0; i < keys.length; i++) {\n key = keys[i];\n toVal = to[key];\n fromVal = from[key];\n if (!hasOwn(to, key)) {\n set(to, key, fromVal);\n } else if (isPlainObject(toVal) && isPlainObject(fromVal)) {\n mergeData(toVal, fromVal);\n }\n }\n return to\n}\n\n/**\n * Data\n */\nfunction mergeDataOrFn (\n parentVal,\n childVal,\n vm\n) {\n if (!vm) {\n // in a Vue.extend merge, both should be functions\n if (!childVal) {\n return parentVal\n }\n if (!parentVal) {\n return childVal\n }\n // when parentVal & childVal are both present,\n // we need to return a function that returns the\n // merged result of both functions... no need to\n // check if parentVal is a function here because\n // it has to be a function to pass previous merges.\n return function mergedDataFn () {\n return mergeData(\n typeof childVal === 'function' ? childVal.call(this) : childVal,\n typeof parentVal === 'function' ? parentVal.call(this) : parentVal\n )\n }\n } else if (parentVal || childVal) {\n return function mergedInstanceDataFn () {\n // instance merge\n var instanceData = typeof childVal === 'function'\n ? childVal.call(vm)\n : childVal;\n var defaultData = typeof parentVal === 'function'\n ? parentVal.call(vm)\n : parentVal;\n if (instanceData) {\n return mergeData(instanceData, defaultData)\n } else {\n return defaultData\n }\n }\n }\n}\n\nstrats.data = function (\n parentVal,\n childVal,\n vm\n) {\n if (!vm) {\n if (childVal && typeof childVal !== 'function') {\n \"production\" !== 'production' && warn(\n 'The \"data\" option should be a function ' +\n 'that returns a per-instance value in component ' +\n 'definitions.',\n vm\n );\n\n return parentVal\n }\n return mergeDataOrFn.call(this, parentVal, childVal)\n }\n\n return mergeDataOrFn(parentVal, childVal, vm)\n};\n\n/**\n * Hooks and props are merged as arrays.\n */\nfunction mergeHook (\n parentVal,\n childVal\n) {\n return childVal\n ? parentVal\n ? parentVal.concat(childVal)\n : Array.isArray(childVal)\n ? childVal\n : [childVal]\n : parentVal\n}\n\nLIFECYCLE_HOOKS.forEach(function (hook) {\n strats[hook] = mergeHook;\n});\n\n/**\n * Assets\n *\n * When a vm is present (instance creation), we need to do\n * a three-way merge between constructor options, instance\n * options and parent options.\n */\nfunction mergeAssets (\n parentVal,\n childVal,\n vm,\n key\n) {\n var res = Object.create(parentVal || null);\n if (childVal) {\n \"production\" !== 'production' && assertObjectType(key, childVal, vm);\n return extend(res, childVal)\n } else {\n return res\n }\n}\n\nASSET_TYPES.forEach(function (type) {\n strats[type + 's'] = mergeAssets;\n});\n\n/**\n * Watchers.\n *\n * Watchers hashes should not overwrite one\n * another, so we merge them as arrays.\n */\nstrats.watch = function (\n parentVal,\n childVal,\n vm,\n key\n) {\n // work around Firefox's Object.prototype.watch...\n if (parentVal === nativeWatch) { parentVal = undefined; }\n if (childVal === nativeWatch) { childVal = undefined; }\n /* istanbul ignore if */\n if (!childVal) { return Object.create(parentVal || null) }\n if (false) {\n assertObjectType(key, childVal, vm);\n }\n if (!parentVal) { return childVal }\n var ret = {};\n extend(ret, parentVal);\n for (var key$1 in childVal) {\n var parent = ret[key$1];\n var child = childVal[key$1];\n if (parent && !Array.isArray(parent)) {\n parent = [parent];\n }\n ret[key$1] = parent\n ? parent.concat(child)\n : Array.isArray(child) ? child : [child];\n }\n return ret\n};\n\n/**\n * Other object hashes.\n */\nstrats.props =\nstrats.methods =\nstrats.inject =\nstrats.computed = function (\n parentVal,\n childVal,\n vm,\n key\n) {\n if (childVal && \"production\" !== 'production') {\n assertObjectType(key, childVal, vm);\n }\n if (!parentVal) { return childVal }\n var ret = Object.create(null);\n extend(ret, parentVal);\n if (childVal) { extend(ret, childVal); }\n return ret\n};\nstrats.provide = mergeDataOrFn;\n\n/**\n * Default strategy.\n */\nvar defaultStrat = function (parentVal, childVal) {\n return childVal === undefined\n ? parentVal\n : childVal\n};\n\n/**\n * Validate component names\n */\nfunction checkComponents (options) {\n for (var key in options.components) {\n var lower = key.toLowerCase();\n if (isBuiltInTag(lower) || config.isReservedTag(lower)) {\n warn(\n 'Do not use built-in or reserved HTML elements as component ' +\n 'id: ' + key\n );\n }\n }\n}\n\n/**\n * Ensure all props option syntax are normalized into the\n * Object-based format.\n */\nfunction normalizeProps (options, vm) {\n var props = options.props;\n if (!props) { return }\n var res = {};\n var i, val, name;\n if (Array.isArray(props)) {\n i = props.length;\n while (i--) {\n val = props[i];\n if (typeof val === 'string') {\n name = camelize(val);\n res[name] = { type: null };\n } else if (false) {\n warn('props must be strings when using array syntax.');\n }\n }\n } else if (isPlainObject(props)) {\n for (var key in props) {\n val = props[key];\n name = camelize(key);\n res[name] = isPlainObject(val)\n ? val\n : { type: val };\n }\n } else if (false) {\n warn(\n \"Invalid value for option \\\"props\\\": expected an Array or an Object, \" +\n \"but got \" + (toRawType(props)) + \".\",\n vm\n );\n }\n options.props = res;\n}\n\n/**\n * Normalize all injections into Object-based format\n */\nfunction normalizeInject (options, vm) {\n var inject = options.inject;\n var normalized = options.inject = {};\n if (Array.isArray(inject)) {\n for (var i = 0; i < inject.length; i++) {\n normalized[inject[i]] = { from: inject[i] };\n }\n } else if (isPlainObject(inject)) {\n for (var key in inject) {\n var val = inject[key];\n normalized[key] = isPlainObject(val)\n ? extend({ from: key }, val)\n : { from: val };\n }\n } else if (false) {\n warn(\n \"Invalid value for option \\\"inject\\\": expected an Array or an Object, \" +\n \"but got \" + (toRawType(inject)) + \".\",\n vm\n );\n }\n}\n\n/**\n * Normalize raw function directives into object format.\n */\nfunction normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def = dirs[key];\n if (typeof def === 'function') {\n dirs[key] = { bind: def, update: def };\n }\n }\n }\n}\n\nfunction assertObjectType (name, value, vm) {\n if (!isPlainObject(value)) {\n warn(\n \"Invalid value for option \\\"\" + name + \"\\\": expected an Object, \" +\n \"but got \" + (toRawType(value)) + \".\",\n vm\n );\n }\n}\n\n/**\n * Merge two option objects into a new one.\n * Core utility used in both instantiation and inheritance.\n */\nfunction mergeOptions (\n parent,\n child,\n vm\n) {\n if (false) {\n checkComponents(child);\n }\n\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child, vm);\n normalizeInject(child, vm);\n normalizeDirectives(child);\n var extendsFrom = child.extends;\n if (extendsFrom) {\n parent = mergeOptions(parent, extendsFrom, vm);\n }\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n var options = {};\n var key;\n for (key in parent) {\n mergeField(key);\n }\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n function mergeField (key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n return options\n}\n\n/**\n * Resolve an asset.\n * This function is used because child instances need access\n * to assets defined in its ancestor chain.\n */\nfunction resolveAsset (\n options,\n type,\n id,\n warnMissing\n) {\n /* istanbul ignore if */\n if (typeof id !== 'string') {\n return\n }\n var assets = options[type];\n // check local registration variations first\n if (hasOwn(assets, id)) { return assets[id] }\n var camelizedId = camelize(id);\n if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }\n var PascalCaseId = capitalize(camelizedId);\n if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }\n // fallback to prototype chain\n var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];\n if (false) {\n warn(\n 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,\n options\n );\n }\n return res\n}\n\n/* */\n\nfunction validateProp (\n key,\n propOptions,\n propsData,\n vm\n) {\n var prop = propOptions[key];\n var absent = !hasOwn(propsData, key);\n var value = propsData[key];\n // handle boolean props\n if (isType(Boolean, prop.type)) {\n if (absent && !hasOwn(prop, 'default')) {\n value = false;\n } else if (!isType(String, prop.type) && (value === '' || value === hyphenate(key))) {\n value = true;\n }\n }\n // check default value\n if (value === undefined) {\n value = getPropDefaultValue(vm, prop, key);\n // since the default value is a fresh copy,\n // make sure to observe it.\n var prevShouldConvert = observerState.shouldConvert;\n observerState.shouldConvert = true;\n observe(value);\n observerState.shouldConvert = prevShouldConvert;\n }\n if (false) {\n assertProp(prop, key, value, vm, absent);\n }\n return value\n}\n\n/**\n * Get the default value of a prop.\n */\nfunction getPropDefaultValue (vm, prop, key) {\n // no default, return undefined\n if (!hasOwn(prop, 'default')) {\n return undefined\n }\n var def = prop.default;\n // warn against non-factory defaults for Object & Array\n if (false) {\n warn(\n 'Invalid default value for prop \"' + key + '\": ' +\n 'Props with type Object/Array must use a factory function ' +\n 'to return the default value.',\n vm\n );\n }\n // the raw prop value was also undefined from previous render,\n // return previous default value to avoid unnecessary watcher trigger\n if (vm && vm.$options.propsData &&\n vm.$options.propsData[key] === undefined &&\n vm._props[key] !== undefined\n ) {\n return vm._props[key]\n }\n // call factory function for non-Function types\n // a value is Function if its prototype is function even across different execution context\n return typeof def === 'function' && getType(prop.type) !== 'Function'\n ? def.call(vm)\n : def\n}\n\n/**\n * Assert whether a prop is valid.\n */\nfunction assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}\n\nvar simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;\n\nfunction assertType (value, type) {\n var valid;\n var expectedType = getType(type);\n if (simpleCheckRE.test(expectedType)) {\n var t = typeof value;\n valid = t === expectedType.toLowerCase();\n // for primitive wrapper objects\n if (!valid && t === 'object') {\n valid = value instanceof type;\n }\n } else if (expectedType === 'Object') {\n valid = isPlainObject(value);\n } else if (expectedType === 'Array') {\n valid = Array.isArray(value);\n } else {\n valid = value instanceof type;\n }\n return {\n valid: valid,\n expectedType: expectedType\n }\n}\n\n/**\n * Use function string name to check built-in types,\n * because a simple equality check will fail when running\n * across different vms / iframes.\n */\nfunction getType (fn) {\n var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : ''\n}\n\nfunction isType (type, fn) {\n if (!Array.isArray(fn)) {\n return getType(fn) === getType(type)\n }\n for (var i = 0, len = fn.length; i < len; i++) {\n if (getType(fn[i]) === getType(type)) {\n return true\n }\n }\n /* istanbul ignore next */\n return false\n}\n\n/* */\n\nfunction handleError (err, vm, info) {\n if (vm) {\n var cur = vm;\n while ((cur = cur.$parent)) {\n var hooks = cur.$options.errorCaptured;\n if (hooks) {\n for (var i = 0; i < hooks.length; i++) {\n try {\n var capture = hooks[i].call(cur, err, vm, info) === false;\n if (capture) { return }\n } catch (e) {\n globalHandleError(e, cur, 'errorCaptured hook');\n }\n }\n }\n }\n }\n globalHandleError(err, vm, info);\n}\n\nfunction globalHandleError (err, vm, info) {\n if (config.errorHandler) {\n try {\n return config.errorHandler.call(null, err, vm, info)\n } catch (e) {\n logError(e, null, 'config.errorHandler');\n }\n }\n logError(err, vm, info);\n}\n\nfunction logError (err, vm, info) {\n if (false) {\n warn((\"Error in \" + info + \": \\\"\" + (err.toString()) + \"\\\"\"), vm);\n }\n /* istanbul ignore else */\n if (inBrowser && typeof console !== 'undefined') {\n console.error(err);\n } else {\n throw err\n }\n}\n\n/* */\n/* globals MessageChannel */\n\nvar callbacks = [];\nvar pending = false;\n\nfunction flushCallbacks () {\n pending = false;\n var copies = callbacks.slice(0);\n callbacks.length = 0;\n for (var i = 0; i < copies.length; i++) {\n copies[i]();\n }\n}\n\n// Here we have async deferring wrappers using both micro and macro tasks.\n// In < 2.4 we used micro tasks everywhere, but there are some scenarios where\n// micro tasks have too high a priority and fires in between supposedly\n// sequential events (e.g. #4521, #6690) or even between bubbling of the same\n// event (#6566). However, using macro tasks everywhere also has subtle problems\n// when state is changed right before repaint (e.g. #6813, out-in transitions).\n// Here we use micro task by default, but expose a way to force macro task when\n// needed (e.g. in event handlers attached by v-on).\nvar microTimerFunc;\nvar macroTimerFunc;\nvar useMacroTask = false;\n\n// Determine (macro) Task defer implementation.\n// Technically setImmediate should be the ideal choice, but it's only available\n// in IE. The only polyfill that consistently queues the callback after all DOM\n// events triggered in the same loop is by using MessageChannel.\n/* istanbul ignore if */\nif (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {\n macroTimerFunc = function () {\n setImmediate(flushCallbacks);\n };\n} else if (typeof MessageChannel !== 'undefined' && (\n isNative(MessageChannel) ||\n // PhantomJS\n MessageChannel.toString() === '[object MessageChannelConstructor]'\n)) {\n var channel = new MessageChannel();\n var port = channel.port2;\n channel.port1.onmessage = flushCallbacks;\n macroTimerFunc = function () {\n port.postMessage(1);\n };\n} else {\n /* istanbul ignore next */\n macroTimerFunc = function () {\n setTimeout(flushCallbacks, 0);\n };\n}\n\n// Determine MicroTask defer implementation.\n/* istanbul ignore next, $flow-disable-line */\nif (typeof Promise !== 'undefined' && isNative(Promise)) {\n var p = Promise.resolve();\n microTimerFunc = function () {\n p.then(flushCallbacks);\n // in problematic UIWebViews, Promise.then doesn't completely break, but\n // it can get stuck in a weird state where callbacks are pushed into the\n // microtask queue but the queue isn't being flushed, until the browser\n // needs to do some other work, e.g. handle a timer. Therefore we can\n // \"force\" the microtask queue to be flushed by adding an empty timer.\n if (isIOS) { setTimeout(noop); }\n };\n} else {\n // fallback to macro\n microTimerFunc = macroTimerFunc;\n}\n\n/**\n * Wrap a function so that if any code inside triggers state change,\n * the changes are queued using a Task instead of a MicroTask.\n */\nfunction withMacroTask (fn) {\n return fn._withTask || (fn._withTask = function () {\n useMacroTask = true;\n var res = fn.apply(null, arguments);\n useMacroTask = false;\n return res\n })\n}\n\nfunction nextTick (cb, ctx) {\n var _resolve;\n callbacks.push(function () {\n if (cb) {\n try {\n cb.call(ctx);\n } catch (e) {\n handleError(e, ctx, 'nextTick');\n }\n } else if (_resolve) {\n _resolve(ctx);\n }\n });\n if (!pending) {\n pending = true;\n if (useMacroTask) {\n macroTimerFunc();\n } else {\n microTimerFunc();\n }\n }\n // $flow-disable-line\n if (!cb && typeof Promise !== 'undefined') {\n return new Promise(function (resolve) {\n _resolve = resolve;\n })\n }\n}\n\n/* */\n\nvar mark;\nvar measure;\n\nif (false) {\n var perf = inBrowser && window.performance;\n /* istanbul ignore if */\n if (\n perf &&\n perf.mark &&\n perf.measure &&\n perf.clearMarks &&\n perf.clearMeasures\n ) {\n mark = function (tag) { return perf.mark(tag); };\n measure = function (name, startTag, endTag) {\n perf.measure(name, startTag, endTag);\n perf.clearMarks(startTag);\n perf.clearMarks(endTag);\n perf.clearMeasures(name);\n };\n }\n}\n\n/* not type checking this file because flow doesn't play well with Proxy */\n\nvar initProxy;\n\nif (false) {\n var allowedGlobals = makeMap(\n 'Infinity,undefined,NaN,isFinite,isNaN,' +\n 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +\n 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +\n 'require' // for Webpack/Browserify\n );\n\n var warnNonPresent = function (target, key) {\n warn(\n \"Property or method \\\"\" + key + \"\\\" is not defined on the instance but \" +\n 'referenced during render. Make sure that this property is reactive, ' +\n 'either in the data option, or for class-based components, by ' +\n 'initializing the property. ' +\n 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',\n target\n );\n };\n\n var hasProxy =\n typeof Proxy !== 'undefined' &&\n Proxy.toString().match(/native code/);\n\n if (hasProxy) {\n var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');\n config.keyCodes = new Proxy(config.keyCodes, {\n set: function set (target, key, value) {\n if (isBuiltInModifier(key)) {\n warn((\"Avoid overwriting built-in modifier in config.keyCodes: .\" + key));\n return false\n } else {\n target[key] = value;\n return true\n }\n }\n });\n }\n\n var hasHandler = {\n has: function has (target, key) {\n var has = key in target;\n var isAllowed = allowedGlobals(key) || key.charAt(0) === '_';\n if (!has && !isAllowed) {\n warnNonPresent(target, key);\n }\n return has || !isAllowed\n }\n };\n\n var getHandler = {\n get: function get (target, key) {\n if (typeof key === 'string' && !(key in target)) {\n warnNonPresent(target, key);\n }\n return target[key]\n }\n };\n\n initProxy = function initProxy (vm) {\n if (hasProxy) {\n // determine which proxy handler to use\n var options = vm.$options;\n var handlers = options.render && options.render._withStripped\n ? getHandler\n : hasHandler;\n vm._renderProxy = new Proxy(vm, handlers);\n } else {\n vm._renderProxy = vm;\n }\n };\n}\n\n/* */\n\nvar normalizeEvent = cached(function (name) {\n var passive = name.charAt(0) === '&';\n name = passive ? name.slice(1) : name;\n var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first\n name = once$$1 ? name.slice(1) : name;\n var capture = name.charAt(0) === '!';\n name = capture ? name.slice(1) : name;\n return {\n name: name,\n once: once$$1,\n capture: capture,\n passive: passive\n }\n});\n\nfunction createFnInvoker (fns) {\n function invoker () {\n var arguments$1 = arguments;\n\n var fns = invoker.fns;\n if (Array.isArray(fns)) {\n var cloned = fns.slice();\n for (var i = 0; i < cloned.length; i++) {\n cloned[i].apply(null, arguments$1);\n }\n } else {\n // return handler return value for single handlers\n return fns.apply(null, arguments)\n }\n }\n invoker.fns = fns;\n return invoker\n}\n\nfunction updateListeners (\n on,\n oldOn,\n add,\n remove$$1,\n vm\n) {\n var name, cur, old, event;\n for (name in on) {\n cur = on[name];\n old = oldOn[name];\n event = normalizeEvent(name);\n if (isUndef(cur)) {\n \"production\" !== 'production' && warn(\n \"Invalid handler for event \\\"\" + (event.name) + \"\\\": got \" + String(cur),\n vm\n );\n } else if (isUndef(old)) {\n if (isUndef(cur.fns)) {\n cur = on[name] = createFnInvoker(cur);\n }\n add(event.name, cur, event.once, event.capture, event.passive);\n } else if (cur !== old) {\n old.fns = cur;\n on[name] = old;\n }\n }\n for (name in oldOn) {\n if (isUndef(on[name])) {\n event = normalizeEvent(name);\n remove$$1(event.name, oldOn[name], event.capture);\n }\n }\n}\n\n/* */\n\nfunction mergeVNodeHook (def, hookKey, hook) {\n var invoker;\n var oldHook = def[hookKey];\n\n function wrappedHook () {\n hook.apply(this, arguments);\n // important: remove merged hook to ensure it's called only once\n // and prevent memory leak\n remove(invoker.fns, wrappedHook);\n }\n\n if (isUndef(oldHook)) {\n // no existing hook\n invoker = createFnInvoker([wrappedHook]);\n } else {\n /* istanbul ignore if */\n if (isDef(oldHook.fns) && isTrue(oldHook.merged)) {\n // already a merged invoker\n invoker = oldHook;\n invoker.fns.push(wrappedHook);\n } else {\n // existing plain hook\n invoker = createFnInvoker([oldHook, wrappedHook]);\n }\n }\n\n invoker.merged = true;\n def[hookKey] = invoker;\n}\n\n/* */\n\nfunction extractPropsFromVNodeData (\n data,\n Ctor,\n tag\n) {\n // we are only extracting raw values here.\n // validation and default values are handled in the child\n // component itself.\n var propOptions = Ctor.options.props;\n if (isUndef(propOptions)) {\n return\n }\n var res = {};\n var attrs = data.attrs;\n var props = data.props;\n if (isDef(attrs) || isDef(props)) {\n for (var key in propOptions) {\n var altKey = hyphenate(key);\n if (false) {\n var keyInLowerCase = key.toLowerCase();\n if (\n key !== keyInLowerCase &&\n attrs && hasOwn(attrs, keyInLowerCase)\n ) {\n tip(\n \"Prop \\\"\" + keyInLowerCase + \"\\\" is passed to component \" +\n (formatComponentName(tag || Ctor)) + \", but the declared prop name is\" +\n \" \\\"\" + key + \"\\\". \" +\n \"Note that HTML attributes are case-insensitive and camelCased \" +\n \"props need to use their kebab-case equivalents when using in-DOM \" +\n \"templates. You should probably use \\\"\" + altKey + \"\\\" instead of \\\"\" + key + \"\\\".\"\n );\n }\n }\n checkProp(res, props, key, altKey, true) ||\n checkProp(res, attrs, key, altKey, false);\n }\n }\n return res\n}\n\nfunction checkProp (\n res,\n hash,\n key,\n altKey,\n preserve\n) {\n if (isDef(hash)) {\n if (hasOwn(hash, key)) {\n res[key] = hash[key];\n if (!preserve) {\n delete hash[key];\n }\n return true\n } else if (hasOwn(hash, altKey)) {\n res[key] = hash[altKey];\n if (!preserve) {\n delete hash[altKey];\n }\n return true\n }\n }\n return false\n}\n\n/* */\n\n// The template compiler attempts to minimize the need for normalization by\n// statically analyzing the template at compile time.\n//\n// For plain HTML markup, normalization can be completely skipped because the\n// generated render function is guaranteed to return Array. There are\n// two cases where extra normalization is needed:\n\n// 1. When the children contains components - because a functional component\n// may return an Array instead of a single root. In this case, just a simple\n// normalization is needed - if any child is an Array, we flatten the whole\n// thing with Array.prototype.concat. It is guaranteed to be only 1-level deep\n// because functional components already normalize their own children.\nfunction simpleNormalizeChildren (children) {\n for (var i = 0; i < children.length; i++) {\n if (Array.isArray(children[i])) {\n return Array.prototype.concat.apply([], children)\n }\n }\n return children\n}\n\n// 2. When the children contains constructs that always generated nested Arrays,\n// e.g.