File: /home/pelakir/www/wp-content/plugins/persian-woocommerce-shipping/assets/maps/mapp/js/mapp.min.js
(function($){
function _hasAncestor(t,e){for(;(t=t.parentElement)&&!t.classList.contains(e););return t}!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.L={})}(this,function(t){"use strict";function l(t){var e,i,n,o;for(i=1,n=arguments.length;i<n;i++)for(e in o=arguments[i])t[e]=o[e];return t}function s(t,e){var i=Array.prototype.slice;if(t.bind)return t.bind.apply(t,i.call(arguments,1));var n=i.call(arguments,2);return function(){return t.apply(e,n.length?n.concat(i.call(arguments)):arguments)}}function u(t){return t._leaflet_id=t._leaflet_id||++Vt,t._leaflet_id}function e(t,e,i){var n,o,r,a;return a=function(){n=!1,o&&(r.apply(i,o),o=!1)},r=function(){n?o=arguments:(t.apply(i,arguments),setTimeout(a,e),n=!0)}}function i(t,e,i){var n=e[1],o=e[0],r=n-o;return t===n&&i?t:((t-o)%r+r)%r+o}function c(){return!1}function n(t,e){var i=Math.pow(10,e||5);return Math.round(t*i)/i}function o(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function h(t){return o(t).split(/\s+/)}function r(t,e){for(var i in t.hasOwnProperty("options")||(t.options=t.options?$t(t.options):{}),e)t.options[i]=e[i];return t.options}function a(t,e,i){var n=[];for(var o in t)n.push(encodeURIComponent(i?o.toUpperCase():o)+"="+encodeURIComponent(t[o]));return(e&&-1!==e.indexOf("?")?"&":"?")+n.join("&")}function p(t,n){return t.replace(Zt,function(t,e){var i=n[e];if(void 0===i)throw new Error("No value provided for variable "+t);return"function"==typeof i&&(i=i(n)),i})}function d(t,e){for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1}function f(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}function m(t){var e=+new Date,i=Math.max(0,16-(e-Ht));return Ht=e+i,window.setTimeout(t,i)}function x(t,e,i){if(!i||Wt!==m)return Wt.call(window,s(t,e));t.call(e)}function _(t){t&&Xt.call(window,t)}function g(){}function y(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e}function v(t,e,i){return t instanceof y?t:Gt(t)?new y(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new y(t.x,t.y):new y(t,e,i)}function b(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}function w(t,e){return!t||t instanceof b?t:new b(t,e)}function k(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}function T(t,e){return t instanceof k?t:new k(t,e)}function E(t,e,i){if(isNaN(t)||isNaN(e))throw new Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=+t,this.lng=+e,void 0!==i&&(this.alt=+i)}function M(t,e,i){return t instanceof E?t:Gt(t)&&"object"!=typeof t[0]?3===t.length?new E(t[0],t[1],t[2]):2===t.length?new E(t[0],t[1]):null:null==t?t:"object"==typeof t&&"lat"in t?new E(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===e?null:new E(t,e,i)}function C(t,e,i,n){if(Gt(t))return this._a=t[0],this._b=t[1],this._c=t[2],void(this._d=t[3]);this._a=t,this._b=e,this._c=i,this._d=n}function S(t,e,i,n){return new C(t,e,i,n)}function P(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function z(t,e){var i,n,o,r,a,s,l="";for(i=0,o=t.length;i<o;i++){for(n=0,r=(a=t[i]).length;n<r;n++)l+=(n?"L":"M")+(s=a[n]).x+" "+s.y;l+=e?Ue?"z":"x":""}return l||"M0 0"}function I(t){return 0<=navigator.userAgent.toLowerCase().indexOf(t)}function A(t,e,i,n){return"touchstart"===e?function(t,e,i){var n=s(function(t){if("mouse"!==t.pointerType&&t.pointerType!==t.MSPOINTER_TYPE_MOUSE&&t.pointerType!==t.MSPOINTER_TYPE_MOUSE){if(!(qe.indexOf(t.target.tagName)<0))return;H(t)}B(t,e)});t["_leaflet_touchstart"+i]=n,t.addEventListener($e,n,!1),We||(document.documentElement.addEventListener($e,D,!0),document.documentElement.addEventListener(Ve,O,!0),document.documentElement.addEventListener(Ze,R,!0),document.documentElement.addEventListener(Ge,R,!0),We=!0)}(t,i,n):"touchmove"===e?function(t,e,i){function n(t){(t.pointerType!==t.MSPOINTER_TYPE_MOUSE&&"mouse"!==t.pointerType||0!==t.buttons)&&B(t,e)}t["_leaflet_touchmove"+i]=n,t.addEventListener(Ve,n,!1)}(t,i,n):"touchend"===e&&function(t,e,i){function n(t){B(t,e)}t["_leaflet_touchend"+i]=n,t.addEventListener(Ze,n,!1),t.addEventListener(Ge,n,!1)}(t,i,n),this}function D(t){He[t.pointerId]=t,Xe++}function O(t){He[t.pointerId]&&(He[t.pointerId]=t)}function R(t){delete He[t.pointerId],Xe--}function B(t,e){for(var i in t.touches=[],He)t.touches.push(He[i]);t.changedTouches=[t],e(t)}function F(t,o,e){function i(t){var e;if(Ae){if(!fe||"mouse"===t.pointerType)return;e=Xe}else e=t.touches.length;if(!(1<e)){var i=Date.now(),n=i-(r||i);a=t.touches?t.touches[0]:t,s=0<n&&n<=250,r=i}}function n(t){if(s&&!a.cancelBubble){if(Ae){if(!fe||"mouse"===t.pointerType)return;var e,i,n={};for(i in a)e=a[i],n[i]=e&&e.bind?e.bind(a):e;a=n}a.type="dblclick",o(a),r=null}}var r,a,s=!1;return t[Ye+Ke+e]=i,t[Ye+Je+e]=n,t[Ye+"dblclick"+e]=o,t.addEventListener(Ke,i,!1),t.addEventListener(Je,n,!1),t.addEventListener("dblclick",o,!1),this}function U(t,e){var i=t[Ye+Ke+e],n=t[Ye+Je+e],o=t[Ye+"dblclick"+e];return t.removeEventListener(Ke,i,!1),t.removeEventListener(Je,n,!1),fe||t.removeEventListener("dblclick",o,!1),this}function N(t,e,i,n){if("object"==typeof e)for(var o in e)$(t,o,e[o],i);else for(var r=0,a=(e=h(e)).length;r<a;r++)$(t,e[r],i,n);return this}function j(t,e,i,n){if("object"==typeof e)for(var o in e)V(t,o,e[o],i);else if(e)for(var r=0,a=(e=h(e)).length;r<a;r++)V(t,e[r],i,n);else{for(var s in t[Qe])V(t,s,t[Qe][s]);delete t[Qe]}return this}function $(e,t,i,n){var o=t+u(i)+(n?"_"+u(n):"");if(e[Qe]&&e[Qe][o])return this;var r=function(t){return i.call(n||e,t||window.event)},a=r;Ae&&0===t.indexOf("touch")?A(e,t,r,o):!De||"dblclick"!==t||Ae&&ve?"addEventListener"in e?"mousewheel"===t?e.addEventListener("onwheel"in e?"wheel":"mousewheel",r,!1):"mouseenter"===t||"mouseleave"===t?(r=function(t){t=t||window.event,Q(e,t)&&a(t)},e.addEventListener("mouseenter"===t?"mouseover":"mouseout",r,!1)):("click"===t&&_e&&(r=function(t){!function(t,e){var i=t.timeStamp||t.originalEvent&&t.originalEvent.timeStamp,n=oe&&i-oe;n&&100<n&&n<500||t.target._simulatedClick&&!t._simulated?W(t):(oe=i,e(t))}(t,a)}),e.addEventListener(t,r,!1)):"attachEvent"in e&&e.attachEvent("on"+t,r):F(e,r,o),e[Qe]=e[Qe]||{},e[Qe][o]=r}function V(t,e,i,n){var o=e+u(i)+(n?"_"+u(n):""),r=t[Qe]&&t[Qe][o];if(!r)return this;Ae&&0===e.indexOf("touch")?function(t,e,i){var n=t["_leaflet_"+e+i];"touchstart"===e?t.removeEventListener($e,n,!1):"touchmove"===e?t.removeEventListener(Ve,n,!1):"touchend"===e&&(t.removeEventListener(Ze,n,!1),t.removeEventListener(Ge,n,!1))}(t,e,o):De&&"dblclick"===e&&U?U(t,o):"removeEventListener"in t?"mousewheel"===e?t.removeEventListener("onwheel"in t?"wheel":"mousewheel",r,!1):t.removeEventListener("mouseenter"===e?"mouseover":"mouseleave"===e?"mouseout":e,r,!1):"detachEvent"in t&&t.detachEvent("on"+e,r),t[Qe][o]=null}function Z(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,Y(t),this}function G(t){return $(t,"mousewheel",Z),this}function q(t){return N(t,"mousedown touchstart dblclick",Z),$(t,"click",J),this}function H(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function W(t){return H(t),Z(t),this}function X(t,e){if(!e)return new y(t.clientX,t.clientY);var i=e.getBoundingClientRect();return new y(t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop)}function K(t){return fe?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/ti:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}function J(t){ei[t.type]=!0}function Y(t){var e=ei[t.type];return ei[t.type]=!1,e}function Q(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(t){return!1}return i!==t}function tt(t){return"string"==typeof t?document.getElementById(t):t}function et(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!i||"auto"===i)&&document.defaultView){var n=document.defaultView.getComputedStyle(t,null);i=n?n[e]:null}return"auto"===i?null:i}function it(t,e,i){var n=document.createElement(t);return n.className=e||"",i&&i.appendChild(n),n}function nt(t){var e=t.parentNode;e&&e.removeChild(t)}function ot(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function rt(t){var e=t.parentNode;e.lastChild!==t&&e.appendChild(t)}function at(t){var e=t.parentNode;e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function st(t,e){if(void 0!==t.classList)return t.classList.contains(e);var i=ht(t);return 0<i.length&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(i)}function lt(t,e){if(void 0!==t.classList)for(var i=h(e),n=0,o=i.length;n<o;n++)t.classList.add(i[n]);else if(!st(t,e)){var r=ht(t);ct(t,(r?r+" ":"")+e)}}function ut(t,e){void 0!==t.classList?t.classList.remove(e):ct(t,o((" "+ht(t)+" ").replace(" "+e+" "," ")))}function ct(t,e){void 0===t.className.baseVal?t.className=e:t.className.baseVal=e}function ht(t){return void 0===t.className.baseVal?t.className:t.className.baseVal}function pt(t,e){"opacity"in t.style?t.style.opacity=e:"filter"in t.style&&function(t,e){var i=!1,n="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(n)}catch(t){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+n+"(opacity="+e+")"}(t,e)}function dt(t){for(var e=document.documentElement.style,i=0;i<t.length;i++)if(t[i]in e)return t[i];return!1}function ft(t,e,i){var n=e||new y(0,0);t.style[ni]=(Te?"translate("+n.x+"px,"+n.y+"px)":"translate3d("+n.x+"px,"+n.y+"px,0)")+(i?" scale("+i+")":"")}function mt(t,e){t._leaflet_pos=e,Ce?ft(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function _t(t){return t._leaflet_pos||new y(0,0)}function gt(){N(window,"dragstart",H)}function yt(){j(window,"dragstart",H)}function vt(t){for(;-1===t.tabIndex;)t=t.parentNode;t.style&&(xt(),ui=(li=t).style.outline,t.style.outline="none",N(window,"keydown",xt))}function xt(){li&&(li.style.outline=ui,ui=li=void 0,j(window,"keydown",xt))}function bt(t,e){if(!e||!t.length)return t.slice();var i=e*e;return function(t,e){var i=t.length,n=new(typeof Uint8Array!=void 0+""?Uint8Array:Array)(i);n[0]=n[i-1]=1,function t(e,i,n,o,r){var a,s,l,u=0;for(s=o+1;s<=r-1;s++)(l=Et(e[s],e[o],e[r],!0))>u&&(a=s,u=l);n<u&&(i[a]=1,t(e,i,n,o,a),t(e,i,n,a,r))}(t,n,e,0,i-1);var o,r=[];for(o=0;o<i;o++)n[o]&&r.push(t[o]);return r}(t=function(t,e){for(var i=[t[0]],n=1,o=0,r=t.length;n<r;n++)a=t[n],s=t[o],void 0,void 0,l=s.x-a.x,u=s.y-a.y,e<l*l+u*u&&(i.push(t[n]),o=n);var a,s,l,u;return o<r-1&&i.push(t[r-1]),i}(t,i),i)}function wt(t,e,i){return Math.sqrt(Et(t,e,i,!0))}function Lt(t,e,i,n,o){var r,a,s,l=n?yi:Tt(t,i),u=Tt(e,i);for(yi=u;;){if(!(l|u))return[t,e];if(l&u)return!1;s=Tt(a=kt(t,e,r=l||u,i,o),i),r===l?(t=a,l=s):(e=a,u=s)}}function kt(t,e,i,n,o){var r,a,s=e.x-t.x,l=e.y-t.y,u=n.min,c=n.max;return 8&i?(r=t.x+s*(c.y-t.y)/l,a=c.y):4&i?(r=t.x+s*(u.y-t.y)/l,a=u.y):2&i?(r=c.x,a=t.y+l*(c.x-t.x)/s):1&i&&(r=u.x,a=t.y+l*(u.x-t.x)/s),new y(r,a,o)}function Tt(t,e){var i=0;return t.x<e.min.x?i|=1:t.x>e.max.x&&(i|=2),t.y<e.min.y?i|=4:t.y>e.max.y&&(i|=8),i}function Et(t,e,i,n){var o,r=e.x,a=e.y,s=i.x-r,l=i.y-a,u=s*s+l*l;return 0<u&&(1<(o=((t.x-r)*s+(t.y-a)*l)/u)?(r=i.x,a=i.y):0<o&&(r+=s*o,a+=l*o)),s=t.x-r,l=t.y-a,n?s*s+l*l:new y(r,a)}function Mt(t){return!Gt(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function Ct(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Mt(t)}function St(t,e,i){var n,o,r,a,s,l,u,c,h,p=[1,4,2,8];for(o=0,u=t.length;o<u;o++)t[o]._code=Tt(t[o],e);for(a=0;a<4;a++){for(c=p[a],n=[],o=0,r=(u=t.length)-1;o<u;r=o++)s=t[o],l=t[r],s._code&c?l._code&c||((h=kt(l,s,c,e,i))._code=Tt(h,e),n.push(h)):(l._code&c&&((h=kt(l,s,c,e,i))._code=Tt(h,e),n.push(h)),n.push(s));t=n}return t}function Pt(t,e){var i,n,o,r,a="Feature"===t.type?t.geometry:t,s=a?a.coordinates:null,l=[],u=e&&e.pointToLayer,c=e&&e.coordsToLatLng||zt;if(!s&&!a)return null;switch(a.type){case"Point":return i=c(s),u?u(t,i):new Ni(i);case"MultiPoint":for(o=0,r=s.length;o<r;o++)i=c(s[o]),l.push(u?u(t,i):new Ni(i));return new Ri(l);case"LineString":case"MultiLineString":return n=It(s,"LineString"===a.type?0:1,c),new Zi(n,e);case"Polygon":case"MultiPolygon":return n=It(s,"Polygon"===a.type?1:2,c),new Gi(n,e);case"GeometryCollection":for(o=0,r=a.geometries.length;o<r;o++){var h=Pt({geometry:a.geometries[o],type:"Feature",properties:t.properties},e);h&&l.push(h)}return new Ri(l);default:throw new Error("Invalid GeoJSON object.")}}function zt(t){return new E(t[1],t[0],t[2])}function It(t,e,i){for(var n,o=[],r=0,a=t.length;r<a;r++)n=e?It(t[r],e-1,i):(i||zt)(t[r]),o.push(n);return o}function At(t,e){return e="number"==typeof e?e:6,void 0!==t.alt?[n(t.lng,e),n(t.lat,e),n(t.alt,e)]:[n(t.lng,e),n(t.lat,e)]}function Dt(t,e,i,n){for(var o=[],r=0,a=t.length;r<a;r++)o.push(e?Dt(t[r],e-1,i,n):At(t[r],n));return!e&&i&&o.push(o[0]),o}function Ot(t,e){return t.feature?l({},t.feature,{geometry:e}):Rt(e)}function Rt(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}function Bt(t,e){return new qi(t,e)}function Ft(t,e){return new nn(t,e)}function Ut(t){return Fe?new an(t):null}function Nt(t){return Ue||Ne?new cn(t):null}var jt=Object.freeze;Object.freeze=function(t){return t};var $t=Object.create||function(t){return Jt.prototype=t,new Jt},Vt=0,Zt=/\{ *([\w_\-]+) *\}/g,Gt=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},qt="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=",Ht=0,Wt=window.requestAnimationFrame||f("RequestAnimationFrame")||m,Xt=window.cancelAnimationFrame||f("CancelAnimationFrame")||f("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)},Kt=(Object.freeze||Object)({freeze:jt,extend:l,create:$t,bind:s,lastId:Vt,stamp:u,throttle:e,wrapNum:i,falseFn:c,formatNum:n,trim:o,splitWords:h,setOptions:r,getParamString:a,template:p,isArray:Gt,indexOf:d,emptyImageUrl:qt,requestFn:Wt,cancelFn:Xt,requestAnimFrame:x,cancelAnimFrame:_});function Jt(){}g.extend=function(t){function e(){this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()}var i=e.__super__=this.prototype,n=$t(i);for(var o in(n.constructor=e).prototype=n,this)this.hasOwnProperty(o)&&"prototype"!==o&&"__super__"!==o&&(e[o]=this[o]);return t.statics&&(l(e,t.statics),delete t.statics),t.includes&&(function(t){if(L&&L.Mixin){t=Gt(t)?t:[t];for(var e=0;e<t.length;e++)t[e]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}}(t.includes),l.apply(null,[n].concat(t.includes)),delete t.includes),n.options&&(t.options=l($t(n.options),t.options)),l(n,t),n._initHooks=[],n.callInitHooks=function(){if(!this._initHooksCalled){i.callInitHooks&&i.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=n._initHooks.length;t<e;t++)n._initHooks[t].call(this)}},e},g.include=function(t){return l(this.prototype,t),this},g.mergeOptions=function(t){return l(this.prototype.options,t),this},g.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i),this};var Yt={on:function(t,e,i){if("object"==typeof t)for(var n in t)this._on(n,t[n],e);else for(var o=0,r=(t=h(t)).length;o<r;o++)this._on(t[o],e,i);return this},off:function(t,e,i){if(t)if("object"==typeof t)for(var n in t)this._off(n,t[n],e);else for(var o=0,r=(t=h(t)).length;o<r;o++)this._off(t[o],e,i);else delete this._events;return this},_on:function(t,e,i){this._events=this._events||{};var n=this._events[t];n||(n=[],this._events[t]=n),i===this&&(i=void 0);for(var o={fn:e,ctx:i},r=n,a=0,s=r.length;a<s;a++)if(r[a].fn===e&&r[a].ctx===i)return;r.push(o)},_off:function(t,e,i){var n,o,r;if(this._events&&(n=this._events[t]))if(e){if(i===this&&(i=void 0),n)for(o=0,r=n.length;o<r;o++){var a=n[o];if(a.ctx===i&&a.fn===e)return a.fn=c,this._firingCount&&(this._events[t]=n=n.slice()),void n.splice(o,1)}}else{for(o=0,r=n.length;o<r;o++)n[o].fn=c;delete this._events[t]}},fire:function(t,e,i){if(!this.listens(t,i))return this;var n=l({},e,{type:t,target:this});if(this._events){var o=this._events[t];if(o){this._firingCount=this._firingCount+1||1;for(var r=0,a=o.length;r<a;r++){var s=o[r];s.fn.call(s.ctx||this,n)}this._firingCount--}}return i&&this._propagateEvent(n),this},listens:function(t,e){var i=this._events&&this._events[t];if(i&&i.length)return!0;if(e)for(var n in this._eventParents)if(this._eventParents[n].listens(t,e))return!0;return!1},once:function(t,e,i){if("object"==typeof t){for(var n in t)this.once(n,t[n],e);return this}var o=s(function(){this.off(t,e,i).off(t,o,i)},this);return this.on(t,e,i).on(t,o,i)},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[u(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[u(t)],this},_propagateEvent:function(t){for(var e in this._eventParents)this._eventParents[e].fire(t.type,l({layer:t.target},t),!0)}};Yt.addEventListener=Yt.on,Yt.removeEventListener=Yt.clearAllEventListeners=Yt.off,Yt.addOneTimeEventListener=Yt.once,Yt.fireEvent=Yt.fire,Yt.hasEventListeners=Yt.listens;var Qt=g.extend(Yt);y.prototype={clone:function(){return new y(this.x,this.y)},add:function(t){return this.clone()._add(v(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(v(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new y(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new y(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},distanceTo:function(t){var e=(t=v(t)).x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return(t=v(t)).x===this.x&&t.y===this.y},contains:function(t){return t=v(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+n(this.x)+", "+n(this.y)+")"}},b.prototype={extend:function(t){return t=v(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new y((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new y(this.min.x,this.max.y)},getTopRight:function(){return new y(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return(t="number"==typeof t[0]||t instanceof y?v(t):w(t))instanceof b?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=w(t);var e=this.min,i=this.max,n=t.min,o=t.max,r=o.x>=e.x&&n.x<=i.x,a=o.y>=e.y&&n.y<=i.y;return r&&a},overlaps:function(t){t=w(t);var e=this.min,i=this.max,n=t.min,o=t.max,r=o.x>e.x&&n.x<i.x,a=o.y>e.y&&n.y<i.y;return r&&a},isValid:function(){return!(!this.min||!this.max)}},k.prototype={extend:function(t){var e,i,n=this._southWest,o=this._northEast;if(t instanceof E)i=e=t;else{if(!(t instanceof k))return t?this.extend(M(t)||T(t)):this;if(e=t._southWest,i=t._northEast,!e||!i)return this}return n||o?(n.lat=Math.min(e.lat,n.lat),n.lng=Math.min(e.lng,n.lng),o.lat=Math.max(i.lat,o.lat),o.lng=Math.max(i.lng,o.lng)):(this._southWest=new E(e.lat,e.lng),this._northEast=new E(i.lat,i.lng)),this},pad:function(t){var e=this._southWest,i=this._northEast,n=Math.abs(e.lat-i.lat)*t,o=Math.abs(e.lng-i.lng)*t;return new k(new E(e.lat-n,e.lng-o),new E(i.lat+n,i.lng+o))},getCenter:function(){return new E((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new E(this.getNorth(),this.getWest())},getSouthEast:function(){return new E(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t="number"==typeof t[0]||t instanceof E||"lat"in t?M(t):T(t);var e,i,n=this._southWest,o=this._northEast;return t instanceof k?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=n.lat&&i.lat<=o.lat&&e.lng>=n.lng&&i.lng<=o.lng},intersects:function(t){t=T(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),r=o.lat>=e.lat&&n.lat<=i.lat,a=o.lng>=e.lng&&n.lng<=i.lng;return r&&a},overlaps:function(t){t=T(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),r=o.lat>e.lat&&n.lat<i.lat,a=o.lng>e.lng&&n.lng<i.lng;return r&&a},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,e){return!!t&&(t=T(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e))},isValid:function(){return!(!this._southWest||!this._northEast)}};var te,ee={latLngToPoint:function(t,e){var i=this.projection.project(t),n=this.scale(e);return this.transformation._transform(i,n)},pointToLatLng:function(t,e){var i=this.scale(e),n=this.transformation.untransform(t,i);return this.projection.unproject(n)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){if(this.infinite)return null;var e=this.projection.bounds,i=this.scale(t);return new b(this.transformation.transform(e.min,i),this.transformation.transform(e.max,i))},infinite:!(E.prototype={equals:function(t,e){return!!t&&(t=M(t),Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng))<=(void 0===e?1e-9:e))},toString:function(t){return"LatLng("+n(this.lat,t)+", "+n(this.lng,t)+")"},distanceTo:function(t){return ie.distance(this,M(t))},wrap:function(){return ie.wrapLatLng(this)},toBounds:function(t){var e=180*t/40075017,i=e/Math.cos(Math.PI/180*this.lat);return T([this.lat-e,this.lng-i],[this.lat+e,this.lng+i])},clone:function(){return new E(this.lat,this.lng,this.alt)}}),wrapLatLng:function(t){var e=this.wrapLng?i(t.lng,this.wrapLng,!0):t.lng;return new E(this.wrapLat?i(t.lat,this.wrapLat,!0):t.lat,e,t.alt)},wrapLatLngBounds:function(t){var e=t.getCenter(),i=this.wrapLatLng(e),n=e.lat-i.lat,o=e.lng-i.lng;if(0==n&&0==o)return t;var r=t.getSouthWest(),a=t.getNorthEast();return new k(new E(r.lat-n,r.lng-o),new E(a.lat-n,a.lng-o))}},ie=l({},ee,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var i=Math.PI/180,n=t.lat*i,o=e.lat*i,r=Math.sin(n)*Math.sin(o)+Math.cos(n)*Math.cos(o)*Math.cos((e.lng-t.lng)*i);return this.R*Math.acos(Math.min(r,1))}}),ne={R:6378137,MAX_LATITUDE:85.0511287798,project:function(t){var e=Math.PI/180,i=this.MAX_LATITUDE,n=Math.max(Math.min(i,t.lat),-i),o=Math.sin(n*e);return new y(this.R*t.lng*e,this.R*Math.log((1+o)/(1-o))/2)},unproject:function(t){var e=180/Math.PI;return new E((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:(te=6378137*Math.PI,new b([-te,-te],[te,te]))};C.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return e=e||1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return e=e||1,new y((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}};var oe,re,ae,se,le,ue=l({},ie,{code:"EPSG:3857",projection:ne,transformation:(le=.5/(Math.PI*ne.R),S(le,.5,-le,.5))}),ce=l({},ue,{code:"EPSG:900913"}),he=document.documentElement.style,pe="ActiveXObject"in window,de=pe&&!document.addEventListener,fe="msLaunchUri"in navigator&&!("documentMode"in document),me=I("webkit"),_e=I("android"),ge=I("android 2")||I("android 3"),ye=!!window.opera,ve=I("chrome"),xe=I("gecko")&&!me&&!ye&&!pe,be=!ve&&I("safari"),we=I("phantom"),Le="OTransition"in he,ke=0===navigator.platform.indexOf("Win"),Te=pe&&"transition"in he,Ee="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!ge,Me="MozPerspective"in he,Ce=!window.L_DISABLE_3D&&(Te||Ee||Me)&&!Le&&!we,Se="undefined"!=typeof orientation||I("mobile"),Pe=Se&&me,ze=Se&&Ee,Ie=!window.PointerEvent&&window.MSPointerEvent,Ae=!(!window.PointerEvent&&!Ie),De=!window.L_NO_TOUCH&&(Ae||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),Oe=Se&&ye,Re=Se&&xe,Be=1<(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI),Fe=!!document.createElement("canvas").getContext,Ue=!(!document.createElementNS||!P("svg").createSVGRect),Ne=!Ue&&function(){try{var t=document.createElement("div");t.innerHTML='<v:shape adj="1"/>';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(t){return!1}}(),je=(Object.freeze||Object)({ie:pe,ielt9:de,edge:fe,webkit:me,android:_e,android23:ge,opera:ye,chrome:ve,gecko:xe,safari:be,phantom:we,opera12:Le,win:ke,ie3d:Te,webkit3d:Ee,gecko3d:Me,any3d:Ce,mobile:Se,mobileWebkit:Pe,mobileWebkit3d:ze,msPointer:Ie,pointer:Ae,touch:De,mobileOpera:Oe,mobileGecko:Re,retina:Be,canvas:Fe,svg:Ue,vml:Ne}),$e=Ie?"MSPointerDown":"pointerdown",Ve=Ie?"MSPointerMove":"pointermove",Ze=Ie?"MSPointerUp":"pointerup",Ge=Ie?"MSPointerCancel":"pointercancel",qe=["INPUT","SELECT","OPTION"],He={},We=!1,Xe=0,Ke=Ie?"MSPointerDown":Ae?"pointerdown":"touchstart",Je=Ie?"MSPointerUp":Ae?"pointerup":"touchend",Ye="_leaflet_",Qe="_leaflet_events",ti=ke&&ve?2*window.devicePixelRatio:xe?window.devicePixelRatio:1,ei={},ii=(Object.freeze||Object)({on:N,off:j,stopPropagation:Z,disableScrollPropagation:G,disableClickPropagation:q,preventDefault:H,stop:W,getMousePosition:X,getWheelDelta:K,fakeStop:J,skipped:Y,isExternalTarget:Q,addListener:N,removeListener:j}),ni=dt(["transform","WebkitTransform","OTransform","MozTransform","msTransform"]),oi=dt(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),ri="webkitTransition"===oi||"OTransition"===oi?oi+"End":"transitionend";if("onselectstart"in document)re=function(){N(window,"selectstart",H)},ae=function(){j(window,"selectstart",H)};else{var ai=dt(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);re=function(){if(ai){var t=document.documentElement.style;se=t[ai],t[ai]="none"}},ae=function(){ai&&(document.documentElement.style[ai]=se,se=void 0)}}function si(t){return new di(t)}var li,ui,ci=(Object.freeze||Object)({TRANSFORM:ni,TRANSITION:oi,TRANSITION_END:ri,get:tt,getStyle:et,create:it,remove:nt,empty:ot,toFront:rt,toBack:at,hasClass:st,addClass:lt,removeClass:ut,setClass:ct,getClass:ht,setOpacity:pt,testProp:dt,setTransform:ft,setPosition:mt,getPosition:_t,disableTextSelection:re,enableTextSelection:ae,disableImageDrag:gt,enableImageDrag:yt,preventOutline:vt,restoreOutline:xt}),hi=Qt.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=_t(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=x(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,i=1e3*this._duration;e<i?this._runFrame(this._easeOut(e/i),t):(this._runFrame(1),this._complete())},_runFrame:function(t,e){var i=this._startPos.add(this._offset.multiplyBy(t));e&&i._round(),mt(this._el,i),this.fire("step")},_complete:function(){_(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),pi=Qt.extend({options:{crs:ue,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(t,e){e=r(this,e),this._initContainer(t),this._initLayout(),this._onResize=s(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),void 0!==e.zoom&&(this._zoom=this._limitZoom(e.zoom)),e.center&&void 0!==e.zoom&&this.setView(M(e.center),e.zoom,{reset:!0}),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this.callInitHooks(),this._zoomAnimated=oi&&Ce&&!Oe&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),N(this._proxy,ri,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,e,i){return e=void 0===e?this._zoom:this._limitZoom(e),t=this._limitCenter(M(t),e,this.options.maxBounds),i=i||{},this._stop(),this._loaded&&!i.reset&&!0!==i&&(void 0!==i.animate&&(i.zoom=l({animate:i.animate},i.zoom),i.pan=l({animate:i.animate,duration:i.duration},i.pan)),this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,i.zoom):this._tryAnimatedPan(t,i.pan))?clearTimeout(this._sizeTimer):this._resetView(t,e),this},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=t,this)},zoomIn:function(t,e){return t=t||(Ce?this.options.zoomDelta:1),this.setZoom(this._zoom+t,e)},zoomOut:function(t,e){return t=t||(Ce?this.options.zoomDelta:1),this.setZoom(this._zoom-t,e)},setZoomAround:function(t,e,i){var n=this.getZoomScale(e),o=this.getSize().divideBy(2),r=(t instanceof y?t:this.latLngToContainerPoint(t)).subtract(o).multiplyBy(1-1/n),a=this.containerPointToLatLng(o.add(r));return this.setView(a,e,{zoom:i})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():T(t);var i=v(e.paddingTopLeft||e.padding||[0,0]),n=v(e.paddingBottomRight||e.padding||[0,0]),o=this.getBoundsZoom(t,!1,i.add(n));if((o="number"==typeof e.maxZoom?Math.min(e.maxZoom,o):o)===1/0)return{center:t.getCenter(),zoom:o};var r=n.subtract(i).divideBy(2),a=this.project(t.getSouthWest(),o),s=this.project(t.getNorthEast(),o);return{center:this.unproject(a.add(s).divideBy(2).add(r),o),zoom:o}},fitBounds:function(t,e){if(!(t=T(t)).isValid())throw new Error("Bounds are not valid.");var i=this._getBoundsCenterZoom(t,e);return this.setView(i.center,i.zoom,e)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t,e){if(e=e||{},!(t=v(t).round()).x&&!t.y)return this.fire("moveend");if(!0!==e.animate&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new hi,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),!1!==e.animate){lt(this._mapPane,"leaflet-pan-anim");var i=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},flyTo:function(n,o,t){function e(t){var e=(p*p-h*h+(t?-1:1)*m*m*d*d)/(2*(t?p:h)*m*d),i=Math.sqrt(e*e+1)-e;return i<1e-9?-18:Math.log(i)}function i(t){return(Math.exp(t)-Math.exp(-t))/2}function r(t){return(Math.exp(t)+Math.exp(-t))/2}function a(t){return h*(r(_)*function(t){return i(t)/r(t)}(_+f*t)-i(_))/m}if(!1===(t=t||{}).animate||!Ce)return this.setView(n,o,t);this._stop();var s=this.project(this.getCenter()),l=this.project(n),u=this.getSize(),c=this._zoom;n=M(n),o=void 0===o?c:o;var h=Math.max(u.x,u.y),p=h*this.getZoomScale(c,o),d=l.distanceTo(s)||1,f=1.42,m=f*f,_=e(0),g=Date.now(),y=(e(1)-_)/f,v=t.duration?1e3*t.duration:1e3*y*.8;return this._moveStart(!0),function t(){var e=(Date.now()-g)/v,i=function(t){return 1-Math.pow(1-t,1.5)}(e)*y;e<=1?(this._flyToFrame=x(t,this),this._move(this.unproject(s.add(l.subtract(s).multiplyBy(a(i)/d)),c),this.getScaleZoom(h/function(t){return h*(r(_)/r(_+f*t))}(i),c),{flyTo:!0})):this._move(n,o)._moveEnd(!0)}.call(this),this},flyToBounds:function(t,e){var i=this._getBoundsCenterZoom(t,e);return this.flyTo(i.center,i.zoom,e)},setMaxBounds:function(t){return(t=T(t)).isValid()?(this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this.off("moveend",this._panInsideMaxBounds))},setMinZoom:function(t){return this.options.minZoom=t,this._loaded&&this.getZoom()<this.options.minZoom?this.setZoom(t):this},setMaxZoom:function(t){return this.options.maxZoom=t,this._loaded&&this.getZoom()>this.options.maxZoom?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),n=this._limitCenter(i,this._zoom,T(t));return i.equals(n)||this.panTo(n,e),this._enforcingBounds=!1,this},invalidateSize:function(t){if(!this._loaded)return this;t=l({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var i=this.getSize(),n=e.divideBy(2).round(),o=i.divideBy(2).round(),r=n.subtract(o);return r.x||r.y?(t.animate&&t.pan?this.panBy(r):(t.pan&&this._rawPanBy(r),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(s(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:i})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=l({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=s(this._handleGeolocationResponse,this),i=s(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})},_handleGeolocationResponse:function(t){var e=new E(t.coords.latitude,t.coords.longitude),i=e.toBounds(t.coords.accuracy),n=this._locateOptions;if(n.setView){var o=this.getBoundsZoom(i);this.setView(e,n.maxZoom?Math.min(o,n.maxZoom):o)}var r={latlng:e,bounds:i,timestamp:t.timestamp};for(var a in t.coords)"number"==typeof t.coords[a]&&(r[a]=t.coords[a]);this.fire("locationfound",r)},addHandler:function(t,e){if(!e)return this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){if(this._initEvents(!0),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(t){this._container._leaflet_id=void 0,this._containerId=void 0}var t;for(t in nt(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)nt(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var i=it("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=i),i},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new k(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=T(t),i=v(i||[0,0]);var n=this.getZoom()||0,o=this.getMinZoom(),r=this.getMaxZoom(),a=t.getNorthWest(),s=t.getSouthEast(),l=this.getSize().subtract(i),u=w(this.project(s,n),this.project(a,n)).getSize(),c=Ce?this.options.zoomSnap:1,h=l.x/u.x,p=l.y/u.y,d=e?Math.max(h,p):Math.min(h,p);return n=this.getScaleZoom(d,n),c&&(n=Math.round(n/(c/100))*(c/100),n=e?Math.ceil(n/c)*c:Math.floor(n/c)*c),Math.max(o,Math.min(r,n))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new y(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var i=this._getTopLeftPoint(t,e);return new b(i,i.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var i=this.options.crs;return e=void 0===e?this._zoom:e,i.scale(t)/i.scale(e)},getScaleZoom:function(t,e){var i=this.options.crs;e=void 0===e?this._zoom:e;var n=i.zoom(t*i.scale(e));return isNaN(n)?1/0:n},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(M(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(v(t),e)},layerPointToLatLng:function(t){var e=v(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project(M(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(M(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(T(t))},distance:function(t,e){return this.options.crs.distance(M(t),M(e))},containerPointToLayerPoint:function(t){return v(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return v(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(v(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(M(t)))},mouseEventToContainerPoint:function(t){return X(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=tt(t);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");N(e,"scroll",this._onScroll,this),this._containerId=u(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&Ce,lt(t,"leaflet-container"+(De?" leaflet-touch":"")+(Be?" leaflet-retina":"")+(de?" leaflet-oldie":"")+(be?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=et(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),mt(this._mapPane,new y(0,0)),this.createPane("tilePane"),this.createPane("shadowPane"),this.createPane("overlayPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(lt(t.markerPane,"leaflet-zoom-hide"),lt(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e){mt(this._mapPane,new y(0,0));var i=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var n=this._zoom!==e;this._moveStart(n)._move(t,e)._moveEnd(n),this.fire("viewreset"),i&&this.fire("load")},_moveStart:function(t){return t&&this.fire("zoomstart"),this.fire("movestart")},_move:function(t,e,i){void 0===e&&(e=this._zoom);var n=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),(n||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return _(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){mt(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={};var e=t?j:N;e((this._targets[u(this._container)]=this)._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),Ce&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){_(this._resizeRequest),this._resizeRequest=x(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i,n=[],o="mouseout"===e||"mouseover"===e,r=t.target||t.srcElement,a=!1;r;){if((i=this._targets[u(r)])&&("click"===e||"preclick"===e)&&!t._simulated&&this._draggableMoved(i)){a=!0;break}if(i&&i.listens(e,!0)){if(o&&!Q(r,t))break;if(n.push(i),o)break}if(r===this._container)break;r=r.parentNode}return n.length||a||o||!Q(r,t)||(n=[this]),n},_handleDOMEvent:function(t){if(this._loaded&&!Y(t)){var e=t.type;"mousedown"!==e&&"keypress"!==e||vt(t.target||t.srcElement),this._fireDOMEvent(t,e)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,i){if("click"===t.type){var n=l({},t);n.type="preclick",this._fireDOMEvent(n,n.type,i)}if(!t._stopped&&(i=(i||[]).concat(this._findEventTargets(t,e))).length){var o=i[0];"contextmenu"===e&&o.listens(e,!0)&&H(t);var r={originalEvent:t};if("keypress"!==t.type){var a=o.options&&"icon"in o.options;r.containerPoint=a?this.latLngToContainerPoint(o.getLatLng()):this.mouseEventToContainerPoint(t),r.layerPoint=this.containerPointToLayerPoint(r.containerPoint),r.latlng=a?o.getLatLng():this.layerPointToLatLng(r.layerPoint)}for(var s=0;s<i.length;s++)if(i[s].fire(e,r,!0),r.originalEvent._stopped||!1===i[s].options.bubblingMouseEvents&&-1!==d(this._mouseEvents,e))return}},_draggableMoved:function(t){return(t=t.dragging&&t.dragging.enabled()?t:this).dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,e=this._handlers.length;t<e;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,{target:this}):this.on("load",t,e),this},_getMapPanePos:function(){return _t(this._mapPane)||new y(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,e){return(t&&void 0!==e?this._getNewPixelOrigin(t,e):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,e,i){var n=this._getNewPixelOrigin(i,e);return this.project(t,e)._subtract(n)},_latLngBoundsToNewLayerBounds:function(t,e,i){var n=this._getNewPixelOrigin(i,e);return w([this.project(t.getSouthWest(),e)._subtract(n),this.project(t.getNorthWest(),e)._subtract(n),this.project(t.getSouthEast(),e)._subtract(n),this.project(t.getNorthEast(),e)._subtract(n)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,i){if(!i)return t;var n=this.project(t,e),o=this.getSize().divideBy(2),r=new b(n.subtract(o),n.add(o)),a=this._getBoundsOffset(r,i,e);return a.round().equals([0,0])?t:this.unproject(n.add(a),e)},_limitOffset:function(t,e){if(!e)return t;var i=this.getPixelBounds(),n=new b(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(n,e))},_getBoundsOffset:function(t,e,i){var n=w(this.project(e.getNorthEast(),i),this.project(e.getSouthWest(),i)),o=n.min.subtract(t.min),r=n.max.subtract(t.max);return new y(this._rebound(o.x,-r.x),this._rebound(o.y,-r.y))},_rebound:function(t,e){return 0<t+e?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom(),n=Ce?this.options.zoomSnap:1;return n&&(t=Math.round(t/n)*n),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){ut(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._floor();return!(!0!==(e&&e.animate)&&!this.getSize().contains(i)||(this.panBy(i,e),0))},_createAnimProxy:function(){var t=this._proxy=it("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(t){var e=ni,i=this._proxy.style[e];ft(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),i===this._proxy.style[e]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",function(){var t=this.getCenter(),e=this.getZoom();ft(this._proxy,this.project(t,e),this.getZoomScale(e,1))},this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){nt(this._proxy),delete this._proxy},_catchTransitionEnd:function(t){this._animatingZoom&&0<=t.propertyName.indexOf("transform")&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||!1===i.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/n);return!(!0!==i.animate&&!this.getSize().contains(o)||(x(function(){this._moveStart(!0)._animateZoom(t,e,!0)},this),0))},_animateZoom:function(t,e,i,n){i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,lt(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:n}),setTimeout(s(this._onZoomTransitionEnd,this),250)},_onZoomTransitionEnd:function(){this._animatingZoom&&(ut(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),x(function(){this._moveEnd(!0)},this))}}),di=g.extend({options:{position:"topright"},initialize:function(t){r(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),n=t._controlCorners[i];return lt(e,"leaflet-control"),-1!==i.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e),this},remove:function(){return this._map&&(nt(this._container),this.onRemove&&this.onRemove(this._map),this._map=null),this},_refocusOnMap:function(t){this._map&&t&&0<t.screenX&&0<t.screenY&&this._map.getContainer().focus()}});pi.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){function t(t,e){var i=o+t+" "+o+e;n[t+e]=it("div",i,r)}var n=this._controlCorners={},o="leaflet-",r=this._controlContainer=it("div",o+"control-container",this._container);t("top","left"),t("top","right"),t("bottom","left"),t("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)nt(this._controlCorners[t]);nt(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var fi=di.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,n){return i<n?-1:n<i?1:0}},initialize:function(t,e,i){for(var n in r(this,i),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,t)this._addLayer(t[n],n);for(n in e)this._addLayer(e[n],n,!0)},onAdd:function(t){this._initLayout(),this._update(),(this._map=t).on("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(t){return di.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._map?this._update():this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._map?this._update():this},removeLayer:function(t){t.off("add remove",this._onLayerChange,this);var e=this._getLayer(u(t));return e&&this._layers.splice(this._layers.indexOf(e),1),this._map?this._update():this},expand:function(){lt(this._container,"leaflet-control-layers-expanded"),this._form.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._form.clientHeight?(lt(this._form,"leaflet-control-layers-scrollbar"),this._form.style.height=t+"px"):ut(this._form,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return ut(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=it("div",t),i=this.options.collapsed;e.setAttribute("aria-haspopup",!0),q(e),G(e);var n=this._form=it("form",t+"-list");i&&(this._map.on("click",this.collapse,this),_e||N(e,{mouseenter:this.expand,mouseleave:this.collapse},this));var o=this._layersLink=it("a",t+"-toggle",e);o.href="#",o.title="Layers",De?(N(o,"click",W),N(o,"click",this.expand,this)):N(o,"focus",this.expand,this),i||this.expand(),this._baseLayersList=it("div",t+"-base",n),this._separator=it("div",t+"-separator",n),this._overlaysList=it("div",t+"-overlays",n),e.appendChild(n)},_getLayer:function(t){for(var e=0;e<this._layers.length;e++)if(this._layers[e]&&u(this._layers[e].layer)===t)return this._layers[e]},_addLayer:function(t,e,i){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:e,overlay:i}),this.options.sortLayers&&this._layers.sort(s(function(t,e){return this.options.sortFunction(t.layer,e.layer,t.name,e.name)},this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;ot(this._baseLayersList),ot(this._overlaysList),this._layerControlInputs=[];var t,e,i,n,o=0;for(i=0;i<this._layers.length;i++)n=this._layers[i],this._addItem(n),e=e||n.overlay,t=t||!n.overlay,o+=n.overlay?0:1;return this.options.hideSingleBase&&(t=t&&1<o,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(u(t.target)),i=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;i&&this._map.fire(i,e)},_createRadioElement:function(t,e){var i='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(e?' checked="checked"':"")+"/>",n=document.createElement("div");return n.innerHTML=i,n.firstChild},_addItem:function(t){var e,i=document.createElement("label"),n=this._map.hasLayer(t.layer);t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=n):e=this._createRadioElement("leaflet-base-layers",n),this._layerControlInputs.push(e),e.layerId=u(t.layer),N(e,"click",this._onInputClick,this);var o=document.createElement("span");o.innerHTML=" "+t.name;var r=document.createElement("div");return i.appendChild(r),r.appendChild(e),r.appendChild(o),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(i),this._checkDisabledLayers(),i},_onInputClick:function(){var t,e,i=this._layerControlInputs,n=[],o=[];this._handlingClick=!0;for(var r=i.length-1;0<=r;r--)t=i[r],e=this._getLayer(t.layerId).layer,t.checked?n.push(e):t.checked||o.push(e);for(r=0;r<o.length;r++)this._map.hasLayer(o[r])&&this._map.removeLayer(o[r]);for(r=0;r<n.length;r++)this._map.hasLayer(n[r])||this._map.addLayer(n[r]);this._handlingClick=!1,this._refocusOnMap()},_checkDisabledLayers:function(){for(var t,e,i=this._layerControlInputs,n=this._map.getZoom(),o=i.length-1;0<=o;o--)t=i[o],e=this._getLayer(t.layerId).layer,t.disabled=void 0!==e.options.minZoom&&n<e.options.minZoom||void 0!==e.options.maxZoom&&n>e.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expand:function(){return this.expand()},_collapse:function(){return this.collapse()}}),mi=di.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"−",zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=it("div",e+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,e+"-out",i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,n,o){var r=it("a",i,n);return r.innerHTML=t,r.href="#",r.title=e,r.setAttribute("role","button"),r.setAttribute("aria-label",e),q(r),N(r,"click",W),N(r,"click",o,this),N(r,"click",this._refocusOnMap,this),r},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";ut(this._zoomInButton,e),ut(this._zoomOutButton,e),!this._disabled&&t._zoom!==t.getMinZoom()||lt(this._zoomOutButton,e),!this._disabled&&t._zoom!==t.getMaxZoom()||lt(this._zoomInButton,e)}});pi.mergeOptions({zoomControl:!0}),pi.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new mi,this.addControl(this.zoomControl))});var _i=di.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e=it("div","leaflet-control-scale"),i=this.options;return this._addScales(i,"leaflet-control-scale-line",e),t.on(i.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),e},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=it("div",e,i)),t.imperial&&(this._iScale=it("div",e,i))},_update:function(){var t=this._map,e=t.getSize().y/2,i=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(i)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t),i=e<1e3?e+" m":e/1e3+" km";this._updateScale(this._mScale,i,e/t)},_updateImperial:function(t){var e,i,n,o=3.2808399*t;5280<o?(e=o/5280,i=this._getRoundNum(e),this._updateScale(this._iScale,i+" mi",i/e)):(n=this._getRoundNum(o),this._updateScale(this._iScale,n+" ft",n/o))},_updateScale:function(t,e,i){t.style.width=Math.round(this.options.maxWidth*i)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return e*(i=10<=i?10:5<=i?5:3<=i?3:2<=i?2:1)}}),gi=di.extend({options:{position:"bottomright",prefix:'<a href="http://leafletjs.com" title="A JS library for interactive maps">Leaflet</a>'},initialize:function(t){r(this,t),this._attributions={}},onAdd:function(t){for(var e in(t.attributionControl=this)._container=it("div","leaflet-control-attribution"),q(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),this._container},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t&&(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update()),this},removeAttribution:function(t){return t&&this._attributions[t]&&(this._attributions[t]--,this._update()),this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(" | ")}}});pi.mergeOptions({attributionControl:!0}),pi.addInitHook(function(){this.options.attributionControl&&(new gi).addTo(this)}),di.Layers=fi,di.Zoom=mi,di.Scale=_i,di.Attribution=gi,si.layers=function(t,e,i){return new fi(t,e,i)},si.zoom=function(t){return new mi(t)},si.scale=function(t){return new _i(t)},si.attribution=function(t){return new gi(t)};var yi,vi,xi=g.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled&&(this._enabled=!1,this.removeHooks()),this},enabled:function(){return!!this._enabled}}),bi={Events:Yt},wi=De?"touchstart mousedown":"mousedown",Li={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},ki={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},Ti=Qt.extend({options:{clickTolerance:3},initialize:function(t,e,i,n){r(this,n),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(N(this._dragStartTarget,wi,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Ti._dragging===this&&this.finishDrag(),j(this._dragStartTarget,wi,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(!t._simulated&&this._enabled&&(this._moved=!1,!st(this._element,"leaflet-zoom-anim")&&!(Ti._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||((Ti._dragging=this)._preventOutline&&vt(this._element),gt(),re(),this._moving)))){this.fire("down");var e=t.touches?t.touches[0]:t;this._startPoint=new y(e.clientX,e.clientY),N(document,ki[t.type],this._onMove,this),N(document,Li[t.type],this._onUp,this)}},_onMove:function(t){if(!t._simulated&&this._enabled)if(t.touches&&1<t.touches.length)this._moved=!0;else{var e=t.touches&&1===t.touches.length?t.touches[0]:t,i=new y(e.clientX,e.clientY).subtract(this._startPoint);(i.x||i.y)&&(Math.abs(i.x)+Math.abs(i.y)<this.options.clickTolerance||(H(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=_t(this._element).subtract(i),lt(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),lt(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(i),this._moving=!0,_(this._animRequest),this._lastEvent=t,this._animRequest=x(this._updatePosition,this,!0)))}},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),mt(this._element,this._newPos),this.fire("drag",t)},_onUp:function(t){!t._simulated&&this._enabled&&this.finishDrag()},finishDrag:function(){for(var t in ut(document.body,"leaflet-dragging"),this._lastTarget&&(ut(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),ki)j(document,ki[t],this._onMove,this),j(document,Li[t],this._onUp,this);yt(),ae(),this._moved&&this._moving&&(_(this._animRequest),this.fire("dragend",{distance:this._newPos.distanceTo(this._startPos)})),this._moving=!1,Ti._dragging=!1}}),Ei=(Object.freeze||Object)({simplify:bt,pointToSegmentDistance:wt,closestPointOnSegment:function(t,e,i){return Et(t,e,i)},clipSegment:Lt,_getEdgeIntersection:kt,_getBitCode:Tt,_sqClosestPointOnSegment:Et,isFlat:Mt,_flat:Ct}),Mi=(Object.freeze||Object)({clipPolygon:St}),Ci={project:function(t){return new y(t.lng,t.lat)},unproject:function(t){return new E(t.y,t.x)},bounds:new b([-180,-90],[180,90])},Si={R:6378137,R_MINOR:6356752.314245179,bounds:new b([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var e=Math.PI/180,i=this.R,n=t.lat*e,o=this.R_MINOR/i,r=Math.sqrt(1-o*o),a=r*Math.sin(n),s=Math.tan(Math.PI/4-n/2)/Math.pow((1-a)/(1+a),r/2);return n=-i*Math.log(Math.max(s,1e-10)),new y(t.lng*e*i,n)},unproject:function(t){for(var e,i=180/Math.PI,n=this.R,o=this.R_MINOR/n,r=Math.sqrt(1-o*o),a=Math.exp(-t.y/n),s=Math.PI/2-2*Math.atan(a),l=0,u=.1;l<15&&1e-7<Math.abs(u);l++)e=r*Math.sin(s),e=Math.pow((1-e)/(1+e),r/2),s+=u=Math.PI/2-2*Math.atan(a*e)-s;return new E(s*i,t.x*i/n)}},Pi=(Object.freeze||Object)({LonLat:Ci,Mercator:Si,SphericalMercator:ne}),zi=l({},ie,{code:"EPSG:3395",projection:Si,transformation:(vi=.5/(Math.PI*Si.R),S(vi,.5,-vi,.5))}),Ii=l({},ie,{code:"EPSG:4326",projection:Ci,transformation:S(1/180,1,-1/180,.5)}),Ai=l({},ee,{projection:Ci,transformation:S(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var i=e.lng-t.lng,n=e.lat-t.lat;return Math.sqrt(i*i+n*n)},infinite:!0});ee.Earth=ie,ee.EPSG3395=zi,ee.EPSG3857=ue,ee.EPSG900913=ce,ee.EPSG4326=Ii,ee.Simple=Ai;var Di=Qt.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[u(t)]=this},removeInteractiveTarget:function(t){return delete this._map._targets[u(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var i=this.getEvents();e.on(i,this),this.once("remove",function(){e.off(i,this)},this)}this.onAdd(e),this.getAttribution&&e.attributionControl&&e.attributionControl.addAttribution(this.getAttribution()),this.fire("add"),e.fire("layeradd",{layer:this})}}});pi.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=u(t);return this._layers[e]||((this._layers[e]=t)._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this},removeLayer:function(t){var e=u(t);return this._layers[e]&&(this._loaded&&t.onRemove(this),t.getAttribution&&this.attributionControl&&this.attributionControl.removeAttribution(t.getAttribution()),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null),this},hasLayer:function(t){return!!t&&u(t)in this._layers},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},_addLayers:function(t){for(var e=0,i=(t=t?Gt(t)?t:[t]:[]).length;e<i;e++)this.addLayer(t[e])},_addZoomLimit:function(t){!isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[u(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){var e=u(t);this._zoomBoundLayers[e]&&(delete this._zoomBoundLayers[e],this._updateZoomLevels())},_updateZoomLevels:function(){var t=1/0,e=-1/0,i=this._getZoomSpan();for(var n in this._zoomBoundLayers){var o=this._zoomBoundLayers[n].options;t=void 0===o.minZoom?t:Math.min(t,o.minZoom),e=void 0===o.maxZoom?e:Math.max(e,o.maxZoom)}this._layersMaxZoom=e===-1/0?void 0:e,this._layersMinZoom=t===1/0?void 0:t,i!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Oi=Di.extend({initialize:function(t){var e,i;if(this._layers={},t)for(e=0,i=t.length;e<i;e++)this.addLayer(t[e])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this},hasLayer:function(t){return!!t&&(t in this._layers||this.getLayerId(t)in this._layers)},clearLayers:function(){for(var t in this._layers)this.removeLayer(this._layers[t]);return this},invoke:function(t){var e,i,n=Array.prototype.slice.call(arguments,1);for(e in this._layers)(i=this._layers[e])[t]&&i[t].apply(i,n);return this},onAdd:function(t){for(var e in this._layers)t.addLayer(this._layers[e])},onRemove:function(t){for(var e in this._layers)t.removeLayer(this._layers[e])},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];for(var e in this._layers)t.push(this._layers[e]);return t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return u(t)}}),Ri=Oi.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),Oi.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.removeEventParent(this),Oi.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new k;for(var e in this._layers){var i=this._layers[e];t.extend(i.getBounds?i.getBounds():i.getLatLng())}return t}}),Bi=g.extend({initialize:function(t){r(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var i=this._getIconUrl(t);if(!i){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var n=this._createImg(i,e&&"IMG"===e.tagName?e:null);return this._setIconStyles(n,t),n},_setIconStyles:function(t,e){var i=this.options,n=i[e+"Size"];"number"==typeof n&&(n=[n,n]);var o=v(n),r=v("shadow"===e&&i.shadowAnchor||i.iconAnchor||o&&o.divideBy(2,!0));t.className="leaflet-marker-"+e+" "+(i.className||""),r&&(t.style.marginLeft=-r.x+"px",t.style.marginTop=-r.y+"px"),o&&(t.style.width=o.x+"px",t.style.height=o.y+"px")},_createImg:function(t,e){return(e=e||document.createElement("img")).src=t,e},_getIconUrl:function(t){return Be&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}}),Fi=Bi.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(t){return Fi.imagePath||(Fi.imagePath=this._detectIconPath()),(this.options.imagePath||Fi.imagePath)+Bi.prototype._getIconUrl.call(this,t)},_detectIconPath:function(){var t=it("div","leaflet-default-icon-path",document.body),e=et(t,"background-image")||et(t,"backgroundImage");return document.body.removeChild(t),null===e||0!==e.indexOf("url")?"":e.replace(/^url\([\"\']?/,"").replace(/marker-icon\.png[\"\']?\)$/,"")}}),Ui=xi.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new Ti(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),lt(t,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&ut(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup().fire("movestart").fire("dragstart")},_onDrag:function(t){var e=this._marker,i=e._shadow,n=_t(e._icon),o=e._map.layerPointToLatLng(n);i&&mt(i,n),e._latlng=o,t.latlng=o,t.oldLatLng=this._oldLatLng,e.fire("move",t).fire("drag",t)},_onDragEnd:function(t){delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),Ni=Di.extend({options:{icon:new Fi,interactive:!0,draggable:!1,keyboard:!0,title:"",alt:"",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",bubblingMouseEvents:!1},initialize:function(t,e){r(this,e),this._latlng=M(t)},onAdd:function(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(t){var e=this._latlng;return this._latlng=M(t),this.update(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),i=t.icon.createIcon(this._icon),n=!1;i!==this._icon&&(this._icon&&this._removeIcon(),n=!0,t.title&&(i.title=t.title),t.alt&&(i.alt=t.alt)),lt(i,e),t.keyboard&&(i.tabIndex="0"),this._icon=i,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex});var o=t.icon.createShadow(this._shadow),r=!1;o!==this._shadow&&(this._removeShadow(),r=!0),o&&(lt(o,e),o.alt=""),this._shadow=o,t.opacity<1&&this._updateOpacity(),n&&this.getPane().appendChild(this._icon),this._initInteraction(),o&&r&&this.getPane("shadowPane").appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),nt(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&nt(this._shadow),this._shadow=null},_setPos:function(t){mt(this._icon,t),this._shadow&&mt(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon.style.zIndex=this._zIndex+t},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(e)},_initInteraction:function(){if(this.options.interactive&&(lt(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Ui)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Ui(this),t&&this.dragging.enable()}},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;pt(this._icon,t),this._shadow&&pt(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor||[0,0]},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor||[0,0]}}),ji=Di.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(t){this._renderer=t.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(t){return r(this,t),this._renderer&&this._renderer._updateStyle(this),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(De?10:0)}}),$i=ji.extend({options:{fill:!0,radius:10},initialize:function(t,e){r(this,e),this._latlng=M(t),this._radius=this.options.radius},setLatLng:function(t){return this._latlng=M(t),this.redraw(),this.fire("move",{latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var e=t&&t.radius||this._radius;return ji.prototype.setStyle.call(this,t),this.setRadius(e),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,e=this._radiusY||t,i=this._clickTolerance(),n=[t+i,e+i];this._pxBounds=new b(this._point.subtract(n),this._point.add(n))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}}),Vi=$i.extend({initialize:function(t,e,i){if("number"==typeof e&&(e=l({},i,{radius:e})),r(this,e),this._latlng=M(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new k(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:ji.prototype.setStyle,_project:function(){var t=this._latlng.lng,e=this._latlng.lat,i=this._map,n=i.options.crs;if(n.distance===ie.distance){var o=Math.PI/180,r=this._mRadius/ie.R/o,a=i.project([e+r,t]),s=i.project([e-r,t]),l=a.add(s).divideBy(2),u=i.unproject(l).lat,c=Math.acos((Math.cos(r*o)-Math.sin(e*o)*Math.sin(u*o))/(Math.cos(e*o)*Math.cos(u*o)))/o;!isNaN(c)&&0!==c||(c=r/Math.cos(Math.PI/180*e)),this._point=l.subtract(i.getPixelOrigin()),this._radius=isNaN(c)?0:Math.max(Math.round(l.x-i.project([u,t-c]).x),1),this._radiusY=Math.max(Math.round(l.y-a.y),1)}else{var h=n.unproject(n.project(this._latlng).subtract([this._mRadius,0]));this._point=i.latLngToLayerPoint(this._latlng),this._radius=this._point.x-i.latLngToLayerPoint(h).x}this._updateBounds()}}),Zi=ji.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,e){r(this,e),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var e,i,n=1/0,o=null,r=Et,a=0,s=this._parts.length;a<s;a++)for(var l=this._parts[a],u=1,c=l.length;u<c;u++){var h=r(t,e=l[u-1],i=l[u],!0);h<n&&(n=h,o=r(t,e,i))}return o&&(o.distance=Math.sqrt(n)),o},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,i,n,o,r,a,s=this._rings[0],l=s.length;if(!l)return null;for(e=t=0;t<l-1;t++)e+=s[t].distanceTo(s[t+1])/2;if(0===e)return this._map.layerPointToLatLng(s[0]);for(n=t=0;t<l-1;t++)if(o=s[t],r=s[t+1],(n+=i=o.distanceTo(r))>e)return a=(n-e)/i,this._map.layerPointToLatLng([r.x-a*(r.x-o.x),r.y-a*(r.y-o.y)])},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=M(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new k,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return Mt(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],i=Mt(t),n=0,o=t.length;n<o;n++)i?(e[n]=M(t[n]),this._bounds.extend(e[n])):e[n]=this._convertLatLngs(t[n]);return e},_project:function(){var t=new b;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t);var e=this._clickTolerance(),i=new y(e,e);this._bounds.isValid()&&t.isValid()&&(t.min._subtract(i),t.max._add(i),this._pxBounds=t)},_projectLatlngs:function(t,e,i){var n,o,r=t[0]instanceof E,a=t.length;if(r){for(o=[],n=0;n<a;n++)o[n]=this._map.latLngToLayerPoint(t[n]),i.extend(o[n]);e.push(o)}else for(n=0;n<a;n++)this._projectLatlngs(t[n],e,i)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else{var e,i,n,o,r,a,s,l=this._parts;for(n=e=0,o=this._rings.length;e<o;e++)for(i=0,r=(s=this._rings[e]).length;i<r-1;i++)(a=Lt(s[i],s[i+1],t,i,!0))&&(l[n]=l[n]||[],l[n].push(a[0]),a[1]===s[i+1]&&i!==r-2||(l[n].push(a[1]),n++))}},_simplifyPoints:function(){for(var t=this._parts,e=this.options.smoothFactor,i=0,n=t.length;i<n;i++)t[i]=bt(t[i],e)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,e){var i,n,o,r,a,s,l=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(i=0,r=this._parts.length;i<r;i++)for(n=0,o=(a=(s=this._parts[i]).length)-1;n<a;o=n++)if((e||0!==n)&&wt(t,s[o],s[n])<=l)return!0;return!1}});Zi._flat=Ct;var Gi=Zi.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,i,n,o,r,a,s,l,u=this._rings[0],c=u.length;if(!c)return null;for(r=a=s=0,t=0,e=c-1;t<c;e=t++)i=u[t],n=u[e],o=i.y*n.x-n.y*i.x,a+=(i.x+n.x)*o,s+=(i.y+n.y)*o,r+=3*o;return l=0===r?u[0]:[a/r,s/r],this._map.layerPointToLatLng(l)},_convertLatLngs:function(t){var e=Zi.prototype._convertLatLngs.call(this,t),i=e.length;return 2<=i&&e[0]instanceof E&&e[0].equals(e[i-1])&&e.pop(),e},_setLatLngs:function(t){Zi.prototype._setLatLngs.call(this,t),Mt(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Mt(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,i=new y(e,e);if(t=new b(t.min.subtract(i),t.max.add(i)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var n,o=0,r=this._rings.length;o<r;o++)(n=St(this._rings[o],t,!0)).length&&this._parts.push(n)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var e,i,n,o,r,a,s,l,u=!1;if(!this._pxBounds.contains(t))return!1;for(o=0,s=this._parts.length;o<s;o++)for(r=0,a=(l=(e=this._parts[o]).length)-1;r<l;a=r++)i=e[r],n=e[a],i.y>t.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(u=!u);return u||Zi.prototype._containsPoint.call(this,t,!0)}}),qi=Ri.extend({initialize:function(t,e){r(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,n,o=Gt(t)?t:t.features;if(o){for(e=0,i=o.length;e<i;e++)((n=o[e]).geometries||n.geometry||n.features||n.coordinates)&&this.addData(n);return this}var r=this.options;if(r.filter&&!r.filter(t))return this;var a=Pt(t,r);return a?(a.feature=Rt(t),a.defaultOptions=a.options,this.resetStyle(a),r.onEachFeature&&r.onEachFeature(t,a),this.addLayer(a)):this},resetStyle:function(t){return t.options=l({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this},setStyle:function(e){return this.eachLayer(function(t){this._setLayerStyle(t,e)},this)},_setLayerStyle:function(t,e){"function"==typeof e&&(e=e(t.feature)),t.setStyle&&t.setStyle(e)}}),Hi={toGeoJSON:function(t){return Ot(this,{type:"Point",coordinates:At(this.getLatLng(),t)})}};Ni.include(Hi),Vi.include(Hi),$i.include(Hi),Zi.include({toGeoJSON:function(t){var e=!Mt(this._latlngs);return Ot(this,{type:(e?"Multi":"")+"LineString",coordinates:Dt(this._latlngs,e?1:0,!1,t)})}}),Gi.include({toGeoJSON:function(t){var e=!Mt(this._latlngs),i=e&&!Mt(this._latlngs[0]),n=Dt(this._latlngs,i?2:e?1:0,!0,t);return e||(n=[n]),Ot(this,{type:(i?"Multi":"")+"Polygon",coordinates:n})}}),Oi.include({toMultiPoint:function(e){var i=[];return this.eachLayer(function(t){i.push(t.toGeoJSON(e).geometry.coordinates)}),Ot(this,{type:"MultiPoint",coordinates:i})},toGeoJSON:function(n){var t=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===t)return this.toMultiPoint(n);var o="GeometryCollection"===t,r=[];return this.eachLayer(function(t){if(t.toGeoJSON){var e=t.toGeoJSON(n);if(o)r.push(e.geometry);else{var i=Rt(e);"FeatureCollection"===i.type?r.push.apply(r,i.features):r.push(i)}}}),o?Ot(this,{geometries:r,type:"GeometryCollection"}):{type:"FeatureCollection",features:r}}});var Wi=Bt,Xi=Di.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,i){this._url=t,this._bounds=T(e),r(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(lt(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){nt(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&rt(this._image),this},bringToBack:function(){return this._map&&at(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=T(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t=this._image=it("img","leaflet-image-layer "+(this._zoomAnimated?"leaflet-zoom-animated":"")+(this.options.className||""));t.onselectstart=c,t.onmousemove=c,t.onload=s(this.fire,this,"load"),t.onerror=s(this._overlayOnError,this,"error"),this.options.crossOrigin&&(t.crossOrigin=""),this.options.zIndex&&this._updateZIndex(),t.src=this._url,t.alt=this.options.alt},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),i=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;ft(this._image,i,e)},_reset:function(){var t=this._image,e=new b(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();mt(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){pt(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)}}),Ki=Xi.extend({options:{autoplay:!0,loop:!0},_initImage:function(){var t="VIDEO"===this._url.tagName,e=this._image=t?this._url:it("video");if(e.class=e.class||"",e.class+="leaflet-image-layer "+(this._zoomAnimated?"leaflet-zoom-animated":""),e.onselectstart=c,e.onmousemove=c,e.onloadeddata=s(this.fire,this,"load"),!t){Gt(this._url)||(this._url=[this._url]),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop;for(var i=0;i<this._url.length;i++){var n=it("source");n.src=this._url[i],e.appendChild(n)}}}}),Ji=Di.extend({options:{offset:[0,7],className:"",pane:"popupPane"},initialize:function(t,e){r(this,t),this._source=e},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&pt(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&pt(this._container,1),this.bringToFront()},onRemove:function(t){t._fadeAnimated?(pt(this._container,0),this._removeTimeout=setTimeout(s(nt,void 0,this._container),200)):nt(this._container)},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=M(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&rt(this._container),this},bringToBack:function(){return this._map&&at(this._container),this},_updateContent:function(){if(this._content){var t=this._contentNode,e="function"==typeof this._content?this._content(this._source||this):this._content;if("string"==typeof e)t.innerHTML=e;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(e)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=v(this.options.offset),i=this._getAnchor();this._zoomAnimated?mt(this._container,t.add(i)):e=e.add(t).add(i);var n=this._containerBottom=-e.y,o=this._containerLeft=-Math.round(this._containerWidth/2)+e.x;this._container.style.bottom=n+"px",this._container.style.left=o+"px"}},_getAnchor:function(){return[0,0]}}),Yi=Ji.extend({options:{maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,className:""},openOn:function(t){return t.openPopup(this),this},onAdd:function(t){Ji.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof ji||this._source.on("preclick",Z))},onRemove:function(t){Ji.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof ji||this._source.off("preclick",Z))},getEvents:function(){var t=Ji.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this._close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_close:function(){this._map&&this._map.closePopup(this)},_initLayout:function(){var t="leaflet-popup",e=this._container=it("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),i=this._wrapper=it("div",t+"-content-wrapper",e);if(this._contentNode=it("div",t+"-content",i),q(i),G(this._contentNode),N(i,"contextmenu",Z),this._tipContainer=it("div",t+"-tip-container",e),this._tip=it("div",t+"-tip",this._tipContainer),this.options.closeButton){var n=this._closeButton=it("a",t+"-close-button",e);n.href="#close",n.innerHTML="×",N(n,"click",this._onCloseButtonClick,this)}},_updateLayout:function(){var t=this._contentNode,e=t.style;e.width="",e.whiteSpace="nowrap";var i=t.offsetWidth;i=Math.min(i,this.options.maxWidth),i=Math.max(i,this.options.minWidth),e.width=i+1+"px",e.whiteSpace="",e.height="";var n=t.offsetHeight,o=this.options.maxHeight;o&&o<n?(e.height=o+"px",lt(t,"leaflet-popup-scrolled")):ut(t,"leaflet-popup-scrolled"),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();mt(this._container,e.add(i))},_adjustPan:function(){if(!(!this.options.autoPan||this._map._panAnim&&this._map._panAnim._inProgress)){var t=this._map,e=parseInt(et(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+e,n=this._containerWidth,o=new y(this._containerLeft,-i-this._containerBottom);o._add(_t(this._container));var r=t.layerPointToContainerPoint(o),a=v(this.options.autoPanPadding),s=v(this.options.autoPanPaddingTopLeft||a),l=v(this.options.autoPanPaddingBottomRight||a),u=t.getSize(),c=0,h=0;r.x+n+l.x>u.x&&(c=r.x+n-u.x+l.x),r.x-c-s.x<0&&(c=r.x-s.x),r.y+i+l.y>u.y&&(h=r.y+i-u.y+l.y),r.y-h-s.y<0&&(h=r.y-s.y),(c||h)&&t.fire("autopanstart").panBy([c,h])}},_onCloseButtonClick:function(t){this._close(),W(t)},_getAnchor:function(){return v(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}});pi.mergeOptions({closePopupOnClick:!0}),pi.include({openPopup:function(t,e,i){return t instanceof Yi||(t=new Yi(i).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:(this._popup&&this._popup.options.autoClose&&this.closePopup(),this._popup=t,this.addLayer(t))},closePopup:function(t){return t&&t!==this._popup||(t=this._popup,this._popup=null),t&&this.removeLayer(t),this}}),Di.include({bindPopup:function(t,e){return t instanceof Yi?(r(t,e),(this._popup=t)._source=this):(this._popup&&!e||(this._popup=new Yi(e,this)),this._popup.setContent(t)),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t,e){if(t instanceof Di||(e=t,t=this),t instanceof Ri)for(var i in this._layers){t=this._layers[i];break}return e||(e=t.getCenter?t.getCenter():t.getLatLng()),this._popup&&this._map&&(this._popup._source=t,this._popup.update(),this._map.openPopup(this._popup,e)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(t){return this._popup&&(this._popup._map?this.closePopup():this.openPopup(t)),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){var e=t.layer||t.target;this._popup&&this._map&&(W(t),e instanceof ji?this.openPopup(t.layer||t.target,t.latlng):this._map.hasLayer(this._popup)&&this._popup._source===e?this.closePopup():this.openPopup(e,t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var Qi=Ji.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(t){Ji.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&this._source.fire("tooltipopen",{tooltip:this},!0)},onRemove:function(t){Ji.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var t=Ji.prototype.getEvents.call(this);return De&&!this.options.permanent&&(t.preclick=this._close),t},_close:function(){this._map&&this._map.closeTooltip(this)},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=it("div",t)},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e=this._map,i=this._container,n=e.latLngToContainerPoint(e.getCenter()),o=e.layerPointToContainerPoint(t),r=this.options.direction,a=i.offsetWidth,s=i.offsetHeight,l=v(this.options.offset),u=this._getAnchor();t="top"===r?t.add(v(-a/2+l.x,-s+l.y+u.y,!0)):"bottom"===r?t.subtract(v(a/2-l.x,-l.y,!0)):"center"===r?t.subtract(v(a/2+l.x,s/2-u.y+l.y,!0)):"right"===r||"auto"===r&&o.x<n.x?(r="right",t.add(v(l.x+u.x,u.y-s/2+l.y,!0))):(r="left",t.subtract(v(a+u.x-l.x,s/2-u.y-l.y,!0))),ut(i,"leaflet-tooltip-right"),ut(i,"leaflet-tooltip-left"),ut(i,"leaflet-tooltip-top"),ut(i,"leaflet-tooltip-bottom"),lt(i,"leaflet-tooltip-"+r),mt(i,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&pt(this._container,t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(e)},_getAnchor:function(){return v(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}});pi.include({openTooltip:function(t,e,i){return t instanceof Qi||(t=new Qi(i).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:this.addLayer(t)},closeTooltip:function(t){return t&&this.removeLayer(t),this}}),Di.include({bindTooltip:function(t,e){return t instanceof Qi?(r(t,e),(this._tooltip=t)._source=this):(this._tooltip&&!e||(this._tooltip=new Qi(e,this)),this._tooltip.setContent(t)),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(t){if(t||!this._tooltipHandlersAdded){var e=t?"off":"on",i={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?i.add=this._openTooltip:(i.mouseover=this._openTooltip,i.mouseout=this.closeTooltip,this._tooltip.options.sticky&&(i.mousemove=this._moveTooltip),De&&(i.click=this._openTooltip)),this[e](i),this._tooltipHandlersAdded=!t}},openTooltip:function(t,e){if(t instanceof Di||(e=t,t=this),t instanceof Ri)for(var i in this._layers){t=this._layers[i];break}return e||(e=t.getCenter?t.getCenter():t.getLatLng()),this._tooltip&&this._map&&(this._tooltip._source=t,this._tooltip.update(),this._map.openTooltip(this._tooltip,e),this._tooltip.options.interactive&&this._tooltip._container&&(lt(this._tooltip._container,"leaflet-clickable"),this.addInteractiveTarget(this._tooltip._container))),this},closeTooltip:function(){return this._tooltip&&(this._tooltip._close(),this._tooltip.options.interactive&&this._tooltip._container&&(ut(this._tooltip._container,"leaflet-clickable"),this.removeInteractiveTarget(this._tooltip._container))),this},toggleTooltip:function(t){return this._tooltip&&(this._tooltip._map?this.closeTooltip():this.openTooltip(t)),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_openTooltip:function(t){var e=t.layer||t.target;this._tooltip&&this._map&&this.openTooltip(e,this._tooltip.options.sticky?t.latlng:void 0)},_moveTooltip:function(t){var e,i,n=t.latlng;this._tooltip.options.sticky&&t.originalEvent&&(e=this._map.mouseEventToContainerPoint(t.originalEvent),i=this._map.containerPointToLayerPoint(e),n=this._map.layerPointToLatLng(i)),this._tooltip.setLatLng(n)}});var tn=Bi.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var e=t&&"DIV"===t.tagName?t:document.createElement("div"),i=this.options;if(e.innerHTML=!1!==i.html?i.html:"",i.bgPos){var n=v(i.bgPos);e.style.backgroundPosition=-n.x+"px "+-n.y+"px"}return this._setIconStyles(e,"icon"),e},createShadow:function(){return null}});Bi.Default=Fi;var en=Di.extend({options:{tileSize:256,opacity:1,updateWhenIdle:Se,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(t){r(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView(),this._update()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),nt(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=null},bringToFront:function(){return this._map&&(rt(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(at(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){return this._map&&(this._removeAllTiles(),this._update()),this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=e(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof y?t:new y(t,t)},_updateZIndex:function(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var e,i=this.getPane().children,n=-t(-1/0,1/0),o=0,r=i.length;o<r;o++)e=i[o].style.zIndex,i[o]!==this._container&&e&&(n=t(n,+e));isFinite(n)&&(this.options.zIndex=n+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!de){pt(this._container,this.options.opacity);var t=+new Date,e=!1,i=!1;for(var n in this._tiles){var o=this._tiles[n];if(o.current&&o.loaded){var r=Math.min(1,(t-o.loaded)/200);pt(o.el,r),r<1?e=!0:(o.active?i=!0:this._onOpaqueTile(o),o.active=!0)}}i&&!this._noPrune&&this._pruneTiles(),e&&(_(this._fadeFrame),this._fadeFrame=x(this._updateOpacity,this))}},_onOpaqueTile:c,_initContainer:function(){this._container||(this._container=it("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this._tileZoom,e=this.options.maxZoom;if(void 0!==t){for(var i in this._levels)this._levels[i].el.children.length||i===t?(this._levels[i].el.style.zIndex=e-Math.abs(t-i),this._onUpdateLevel(i)):(nt(this._levels[i].el),this._removeTilesAtZoom(i),this._onRemoveLevel(i),delete this._levels[i]);var n=this._levels[t],o=this._map;return n||((n=this._levels[t]={}).el=it("div","leaflet-tile-container leaflet-zoom-animated",this._container),n.el.style.zIndex=e,n.origin=o.project(o.unproject(o.getPixelOrigin()),t).round(),n.zoom=t,this._setZoomTransform(n,o.getCenter(),o.getZoom()),n.el.offsetWidth,this._onCreateLevel(n)),this._level=n}},_onUpdateLevel:c,_onRemoveLevel:c,_onCreateLevel:c,_pruneTiles:function(){if(this._map){var t,e,i=this._map.getZoom();if(i>this.options.maxZoom||i<this.options.minZoom)this._removeAllTiles();else{for(t in this._tiles)(e=this._tiles[t]).retain=e.current;for(t in this._tiles)if((e=this._tiles[t]).current&&!e.active){var n=e.coords;this._retainParent(n.x,n.y,n.z,n.z-5)||this._retainChildren(n.x,n.y,n.z,n.z+2)}for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}}},_removeTilesAtZoom:function(t){for(var e in this._tiles)this._tiles[e].coords.z===t&&this._removeTile(e)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)nt(this._levels[t].el),this._onRemoveLevel(t),delete this._levels[t];this._removeAllTiles(),this._tileZoom=null},_retainParent:function(t,e,i,n){var o=Math.floor(t/2),r=Math.floor(e/2),a=i-1,s=new y(+o,+r);s.z=+a;var l=this._tileCoordsToKey(s),u=this._tiles[l];return u&&u.active?u.retain=!0:(u&&u.loaded&&(u.retain=!0),n<a&&this._retainParent(o,r,a,n))},_retainChildren:function(t,e,i,n){for(var o=2*t;o<2*t+2;o++)for(var r=2*e;r<2*e+2;r++){var a=new y(o,r);a.z=i+1;var s=this._tileCoordsToKey(a),l=this._tiles[s];l&&l.active?l.retain=!0:(l&&l.loaded&&(l.retain=!0),i+1<n&&this._retainChildren(o,r,i+1,n))}},_resetView:function(t){var e=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),e,e)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var e=this.options;return void 0!==e.minNativeZoom&&t<e.minNativeZoom?e.minNativeZoom:void 0!==e.maxNativeZoom&&e.maxNativeZoom<t?e.maxNativeZoom:t},_setView:function(t,e,i,n){var o=this._clampZoom(Math.round(e));(void 0!==this.options.maxZoom&&o>this.options.maxZoom||void 0!==this.options.minZoom&&o<this.options.minZoom)&&(o=void 0);var r=this.options.updateWhenZooming&&o!==this._tileZoom;n&&!r||(this._tileZoom=o,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==o&&this._update(t),i||this._pruneTiles(),this._noPrune=!!i),this._setZoomTransforms(t,e)},_setZoomTransforms:function(t,e){for(var i in this._levels)this._setZoomTransform(this._levels[i],t,e)},_setZoomTransform:function(t,e,i){var n=this._map.getZoomScale(i,t.zoom),o=t.origin.multiplyBy(n).subtract(this._map._getNewPixelOrigin(e,i)).round();Ce?ft(t.el,o,n):mt(t.el,o)},_resetGrid:function(){var t=this._map,e=t.options.crs,i=this._tileSize=this.getTileSize(),n=this._tileZoom,o=this._map.getPixelWorldBounds(this._tileZoom);o&&(this._globalTileRange=this._pxBoundsToTileRange(o)),this._wrapX=e.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,e.wrapLng[0]],n).x/i.x),Math.ceil(t.project([0,e.wrapLng[1]],n).x/i.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],n).y/i.x),Math.ceil(t.project([e.wrapLat[1],0],n).y/i.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(t){var e=this._map,i=e._animatingZoom?Math.max(e._animateToZoom,e.getZoom()):e.getZoom(),n=e.getZoomScale(i,this._tileZoom),o=e.project(t,this._tileZoom).floor(),r=e.getSize().divideBy(2*n);return new b(o.subtract(r),o.add(r))},_update:function(t){var e=this._map;if(e){var i=this._clampZoom(e.getZoom());if(void 0===t&&(t=e.getCenter()),void 0!==this._tileZoom){var n=this._getTiledPixelBounds(t),o=this._pxBoundsToTileRange(n),r=o.getCenter(),a=[],s=this.options.keepBuffer,l=new b(o.getBottomLeft().subtract([s,-s]),o.getTopRight().add([s,-s]));if(!(isFinite(o.min.x)&&isFinite(o.min.y)&&isFinite(o.max.x)&&isFinite(o.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var u in this._tiles){var c=this._tiles[u].coords;c.z===this._tileZoom&&l.contains(new y(c.x,c.y))||(this._tiles[u].current=!1)}if(1<Math.abs(i-this._tileZoom))this._setView(t,i);else{for(var h=o.min.y;h<=o.max.y;h++)for(var p=o.min.x;p<=o.max.x;p++){var d=new y(p,h);d.z=this._tileZoom,this._isValidTile(d)&&(this._tiles[this._tileCoordsToKey(d)]||a.push(d))}if(a.sort(function(t,e){return t.distanceTo(r)-e.distanceTo(r)}),0!==a.length){this._loading||(this._loading=!0,this.fire("loading"));var f=document.createDocumentFragment();for(p=0;p<a.length;p++)this._addTile(a[p],f);this._level.el.appendChild(f)}}}}},_isValidTile:function(t){var e=this._map.options.crs;if(!e.infinite){var i=this._globalTileRange;if(!e.wrapLng&&(t.x<i.min.x||t.x>i.max.x)||!e.wrapLat&&(t.y<i.min.y||t.y>i.max.y))return!1}if(!this.options.bounds)return!0;var n=this._tileCoordsToBounds(t);return T(this.options.bounds).overlaps(n)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToBounds:function(t){var e=this._map,i=this.getTileSize(),n=t.scaleBy(i),o=n.add(i),r=new k(e.unproject(n,t.z),e.unproject(o,t.z));return this.options.noWrap||e.wrapLatLngBounds(r),r},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),i=new y(+e[0],+e[1]);return i.z=+e[2],i},_removeTile:function(t){var e=this._tiles[t];e&&(nt(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){lt(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=c,t.onmousemove=c,de&&this.options.opacity<1&&pt(t,this.options.opacity),_e&&!ge&&(t.style.WebkitBackfaceVisibility="hidden")},_addTile:function(t,e){var i=this._getTilePos(t),n=this._tileCoordsToKey(t),o=this.createTile(this._wrapCoords(t),s(this._tileReady,this,t));this._initTile(o),this.createTile.length<2&&x(s(this._tileReady,this,t,null,o)),mt(o,i),this._tiles[n]={el:o,coords:t,current:!0},e.appendChild(o),this.fire("tileloadstart",{tile:o,coords:t})},_tileReady:function(t,e,i){if(this._map){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var n=this._tileCoordsToKey(t);(i=this._tiles[n])&&(i.loaded=+new Date,this._map._fadeAnimated?(pt(i.el,0),_(this._fadeFrame),this._fadeFrame=x(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(lt(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),de||!this._map._fadeAnimated?x(this._pruneTiles,this):setTimeout(s(this._pruneTiles,this),250)))}},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new y(this._wrapX?i(t.x,this._wrapX):t.x,this._wrapY?i(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new b(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}}),nn=en.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1},initialize:function(t,e){this._url=t,(e=r(this,e)).detectRetina&&Be&&0<e.maxZoom&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom++):(e.zoomOffset++,e.maxZoom--),e.minZoom=Math.max(0,e.minZoom)),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),_e||this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return N(i,"load",s(this._tileOnLoad,this,e,i)),N(i,"error",s(this._tileOnError,this,e,i)),this.options.crossOrigin&&(i.crossOrigin=""),i.alt="",i.setAttribute("role","presentation"),i.src=this.getTileUrl(t),i},getTileUrl:function(t){var e={r:Be?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var i=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=i),e["-y"]=i}return p(this._url,l(e,this.options))},_tileOnLoad:function(t,e){de?setTimeout(s(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var n=this.options.errorTileUrl;n&&e.src!==n&&(e.src=n),t(i,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,e=this.options.maxZoom;return this.options.zoomReverse&&(t=e-t),t+this.options.zoomOffset},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)this._tiles[t].coords.z!==this._tileZoom&&((e=this._tiles[t].el).onload=c,e.onerror=c,e.complete||(e.src=qt,nt(e)))}}),on=nn.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var i=l({},this.defaultWmsParams);for(var n in e)n in this.options||(i[n]=e[n]);e=r(this,e),i.width=i.height=e.tileSize*(e.detectRetina&&Be?2:1),this.wmsParams=i},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=1.3<=this._wmsVersion?"crs":"srs";this.wmsParams[e]=this._crs.code,nn.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToBounds(t),i=this._crs.project(e.getNorthWest()),n=this._crs.project(e.getSouthEast()),o=(1.3<=this._wmsVersion&&this._crs===Ii?[n.y,i.x,i.y,n.x]:[i.x,n.y,n.x,i.y]).join(","),r=nn.prototype.getTileUrl.call(this,t);return r+a(this.wmsParams,r,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+o},setParams:function(t,e){return l(this.wmsParams,t),e||this.redraw(),this}});nn.WMS=on,Ft.wms=function(t,e){return new on(t,e)};var rn=Di.extend({options:{padding:.1},initialize:function(t){r(this,t),u(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&<(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var i=this._map.getZoomScale(e,this._zoom),n=_t(this._container),o=this._map.getSize().multiplyBy(.5+this.options.padding),r=this._map.project(this._center,e),a=this._map.project(t,e).subtract(r),s=o.multiplyBy(-i).add(n).add(o).subtract(a);Ce?ft(this._container,s,i):mt(this._container,s)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),i=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new b(i,i.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),an=rn.extend({getEvents:function(){var t=rn.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){rn.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");N(t,"mousemove",e(this._onMouseMove,32,this),this),N(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),N(t,"mouseout",this._handleMouseOut,this),this._ctx=t.getContext("2d")},_destroyContainer:function(){delete this._ctx,nt(this._container),j(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){this._drawnLayers={},rn.prototype._update.call(this);var t=this._bounds,e=this._container,i=t.getSize(),n=Be?2:1;mt(e,t.min),e.width=n*i.x,e.height=n*i.y,e.style.width=i.x+"px",e.style.height=i.y+"px",Be&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){rn.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t);var e=(this._layers[u(t)]=t)._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,i=e.next,n=e.prev;i?i.prev=n:this._drawLast=n,n?n.next=i:this._drawFirst=i,delete t._order,delete this._layers[L.stamp(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if(t.options.dashArray){var e,i=t.options.dashArray.split(","),n=[];for(e=0;e<i.length;e++)n.push(Number(i[e]));t.options._dashArray=n}},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||x(this._redraw,this))},_extendRedrawBounds:function(t){if(t._pxBounds){var e=(t.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new b,this._redrawBounds.extend(t._pxBounds.min.subtract([e,e])),this._redrawBounds.extend(t._pxBounds.max.add([e,e]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var t=this._redrawBounds;if(t){var e=t.getSize();this._ctx.clearRect(t.min.x,t.min.y,e.x,e.y)}else this._ctx.clearRect(0,0,this._container.width,this._container.height)},_draw:function(){var t,e=this._redrawBounds;if(this._ctx.save(),e){var i=e.getSize();this._ctx.beginPath(),this._ctx.rect(e.min.x,e.min.y,i.x,i.y),this._ctx.clip()}this._drawing=!0;for(var n=this._drawFirst;n;n=n.next)t=n.layer,(!e||t._pxBounds&&t._pxBounds.intersects(e))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,e){if(this._drawing){var i,n,o,r,a=t._parts,s=a.length,l=this._ctx;if(s){for(this._drawnLayers[t._leaflet_id]=t,l.beginPath(),i=0;i<s;i++){for(n=0,o=a[i].length;n<o;n++)r=a[i][n],l[n?"lineTo":"moveTo"](r.x,r.y);e&&l.closePath()}this._fillStroke(l,t)}}},_updateCircle:function(t){if(this._drawing&&!t._empty()){var e=t._point,i=this._ctx,n=t._radius,o=(t._radiusY||n)/n;this._drawnLayers[t._leaflet_id]=t,1!=o&&(i.save(),i.scale(1,o)),i.beginPath(),i.arc(e.x,e.y/o,n,0,2*Math.PI,!1),1!=o&&i.restore(),this._fillStroke(i,t)}},_fillStroke:function(t,e){var i=e.options;i.fill&&(t.globalAlpha=i.fillOpacity,t.fillStyle=i.fillColor||i.color,t.fill(i.fillRule||"evenodd")),i.stroke&&0!==i.weight&&(t.setLineDash&&t.setLineDash(e.options&&e.options._dashArray||[]),t.globalAlpha=i.opacity,t.lineWidth=i.weight,t.strokeStyle=i.color,t.lineCap=i.lineCap,t.lineJoin=i.lineJoin,t.stroke())},_onClick:function(t){for(var e,i,n=this._map.mouseEventToLayerPoint(t),o=this._drawFirst;o;o=o.next)(e=o.layer).options.interactive&&e._containsPoint(n)&&!this._map._draggableMoved(e)&&(i=e);i&&(J(t),this._fireEvent([i],t))},_onMouseMove:function(t){if(this._map&&!this._map.dragging.moving()&&!this._map._animatingZoom){var e=this._map.mouseEventToLayerPoint(t);this._handleMouseHover(t,e)}},_handleMouseOut:function(t){var e=this._hoveredLayer;e&&(ut(this._container,"leaflet-interactive"),this._fireEvent([e],t,"mouseout"),this._hoveredLayer=null)},_handleMouseHover:function(t,e){for(var i,n,o=this._drawFirst;o;o=o.next)(i=o.layer).options.interactive&&i._containsPoint(e)&&(n=i);n!==this._hoveredLayer&&(this._handleMouseOut(t),n&&(lt(this._container,"leaflet-interactive"),this._fireEvent([n],t,"mouseover"),this._hoveredLayer=n)),this._hoveredLayer&&this._fireEvent([this._hoveredLayer],t)},_fireEvent:function(t,e,i){this._map._fireDOMEvent(e,i||e.type,t)},_bringToFront:function(t){var e=t._order,i=e.next,n=e.prev;i&&((i.prev=n)?n.next=i:i&&(this._drawFirst=i),e.prev=this._drawLast,(this._drawLast.next=e).next=null,this._drawLast=e,this._requestRedraw(t))},_bringToBack:function(t){var e=t._order,i=e.next,n=e.prev;n&&((n.next=i)?i.prev=n:n&&(this._drawLast=n),e.prev=null,e.next=this._drawFirst,this._drawFirst.prev=e,this._drawFirst=e,this._requestRedraw(t))}}),sn=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch(t){return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),ln={_initContainer:function(){this._container=it("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(rn.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=sn("shape");lt(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=sn("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[u(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;nt(e),t.removeInteractiveTarget(e),delete this._layers[u(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,n=t.options,o=t._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(e||(e=t._stroke=sn("stroke")),o.appendChild(e),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,n.dashArray?e.dashStyle=Gt(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=n.lineCap.replace("butt","flat"),e.joinstyle=n.lineJoin):e&&(o.removeChild(e),t._stroke=null),n.fill?(i||(i=t._fill=sn("fill")),o.appendChild(i),i.color=n.fillColor||n.color,i.opacity=n.fillOpacity):i&&(o.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),n=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+n+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){rt(t._container)},_bringToBack:function(t){at(t._container)}},un=Ne?sn:P,cn=rn.extend({getEvents:function(){var t=rn.prototype.getEvents.call(this);return t.zoomstart=this._onZoomStart,t},_initContainer:function(){this._container=un("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=un("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){nt(this._container),j(this._container),delete this._container,delete this._rootGroup},_onZoomStart:function(){this._update()},_update:function(){if(!this._map._animatingZoom||!this._bounds){rn.prototype._update.call(this);var t=this._bounds,e=t.getSize(),i=this._container;this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,i.setAttribute("width",e.x),i.setAttribute("height",e.y)),mt(i,t.min),i.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=un("path");t.options.className&<(e,t.options.className),t.options.interactive&<(e,"leaflet-interactive"),this._updateStyle(t),this._layers[u(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){nt(t._path),t.removeInteractiveTarget(t._path),delete this._layers[u(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,i=t.options;e&&(i.stroke?(e.setAttribute("stroke",i.color),e.setAttribute("stroke-opacity",i.opacity),e.setAttribute("stroke-width",i.weight),e.setAttribute("stroke-linecap",i.lineCap),e.setAttribute("stroke-linejoin",i.lineJoin),i.dashArray?e.setAttribute("stroke-dasharray",i.dashArray):e.removeAttribute("stroke-dasharray"),i.dashOffset?e.setAttribute("stroke-dashoffset",i.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),i.fill?(e.setAttribute("fill",i.fillColor||i.color),e.setAttribute("fill-opacity",i.fillOpacity),e.setAttribute("fill-rule",i.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,z(t._parts,e))},_updateCircle:function(t){var e=t._point,i=t._radius,n="a"+i+","+(t._radiusY||i)+" 0 1,0 ",o=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+n+2*i+",0 "+n+2*-i+",0 ";this._setPath(t,o)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){rt(t._path)},_bringToBack:function(t){at(t._path)}});Ne&&cn.include(ln),pi.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this.options.preferCanvas&&Ut()||Nt()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=cn&&Nt({pane:t})||an&&Ut({pane:t}),this._paneRenderers[t]=e),e}});var hn=Gi.extend({initialize:function(t,e){Gi.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=T(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});cn.create=un,cn.pointsToPath=z,qi.geometryToLayer=Pt,qi.coordsToLatLng=zt,qi.coordsToLatLngs=It,qi.latLngToCoords=At,qi.latLngsToCoords=Dt,qi.getFeature=Ot,qi.asFeature=Rt,pi.mergeOptions({boxZoom:!0});var pn=xi.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){N(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){j(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){nt(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),re(),gt(),this._startPoint=this._map.mouseEventToContainerPoint(t),N(document,{contextmenu:W,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=it("div","leaflet-zoom-box",this._container),lt(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new b(this._point,this._startPoint),i=e.getSize();mt(this._box,e.min),this._box.style.width=i.x+"px",this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(nt(this._box),ut(this._container,"leaflet-crosshair")),ae(),yt(),j(document,{contextmenu:W,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(s(this._resetState,this),0);var e=new k(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){27===t.keyCode&&this._finish()}});pi.addInitHook("addHandler","boxZoom",pn),pi.mergeOptions({doubleClickZoom:!0});var dn=xi.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom(),n=e.options.zoomDelta,o=t.originalEvent.shiftKey?i-n:i+n;"center"===e.options.doubleClickZoom?e.setZoom(o):e.setZoomAround(t.containerPoint,o)}});pi.addInitHook("addHandler","doubleClickZoom",dn),pi.mergeOptions({dragging:!0,inertia:!ge,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var fn=xi.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new Ti(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}lt(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){ut(this._map._container,"leaflet-grab"),ut(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=T(this._map.options.maxBounds);this._offsetLimit=w(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(i),this._times.push(e),50<e-this._times[0]&&(this._positions.shift(),this._times.shift())}this._map.fire("move",t).fire("drag",t)},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.x<e.min.x&&(t.x=this._viscousLimit(t.x,e.min.x)),t.y<e.min.y&&(t.y=this._viscousLimit(t.y,e.min.y)),t.x>e.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,r=(n+e+i)%t-e-i,a=Math.abs(o+i)<Math.abs(r+i)?o:r;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=a},_onDragEnd:function(t){var e=this._map,i=e.options,n=!i.inertia||this._times.length<2;if(e.fire("dragend",t),n)e.fire("moveend");else{var o=this._lastPos.subtract(this._positions[0]),r=(this._lastTime-this._times[0])/1e3,a=i.easeLinearity,s=o.multiplyBy(a/r),l=s.distanceTo([0,0]),u=Math.min(i.inertiaMaxSpeed,l),c=s.multiplyBy(u/l),h=u/(i.inertiaDeceleration*a),p=c.multiplyBy(-h/2).round();p.x||p.y?(p=e._limitOffset(p,e.options.maxBounds),x(function(){e.panBy(p,{duration:h,easeLinearity:a,noMoveStart:!0,animate:!0})})):e.fire("moveend")}}});pi.addInitHook("addHandler","dragging",fn),pi.mergeOptions({keyboard:!0,keyboardPanDelta:80});var mn=xi.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),N(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),j(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var t=document.body,e=document.documentElement,i=t.scrollTop||e.scrollTop,n=t.scrollLeft||e.scrollLeft;this._map._container.focus(),window.scrollTo(n,i)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){var e,i,n=this._panKeys={},o=this.keyCodes;for(e=0,i=o.left.length;e<i;e++)n[o.left[e]]=[-1*t,0];for(e=0,i=o.right.length;e<i;e++)n[o.right[e]]=[t,0];for(e=0,i=o.down.length;e<i;e++)n[o.down[e]]=[0,t];for(e=0,i=o.up.length;e<i;e++)n[o.up[e]]=[0,-1*t]},_setZoomDelta:function(t){var e,i,n=this._zoomKeys={},o=this.keyCodes;for(e=0,i=o.zoomIn.length;e<i;e++)n[o.zoomIn[e]]=t;for(e=0,i=o.zoomOut.length;e<i;e++)n[o.zoomOut[e]]=-t},_addHooks:function(){N(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){j(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e,i=t.keyCode,n=this._map;if(i in this._panKeys){if(n._panAnim&&n._panAnim._inProgress)return;e=this._panKeys[i],t.shiftKey&&(e=v(e).multiplyBy(3)),n.panBy(e),n.options.maxBounds&&n.panInsideBounds(n.options.maxBounds)}else if(i in this._zoomKeys)n.setZoom(n.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[i]);else{if(27!==i||!n._popup)return;n.closePopup()}W(t)}}});pi.addInitHook("addHandler","keyboard",mn),pi.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var _n=xi.extend({addHooks:function(){N(this._map._container,"mousewheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){j(this._map._container,"mousewheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var e=K(t),i=this._map.options.wheelDebounceTime;this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var n=Math.max(i-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(s(this._performZoom,this),n),W(t)},_performZoom:function(){var t=this._map,e=t.getZoom(),i=this._map.options.zoomSnap||0;t._stop();var n=this._delta/(4*this._map.options.wheelPxPerZoomLevel),o=4*Math.log(2/(1+Math.exp(-Math.abs(n))))/Math.LN2,r=i?Math.ceil(o/i)*i:o,a=t._limitZoom(e+(0<this._delta?r:-r))-e;this._delta=0,this._startTime=null,a&&("center"===t.options.scrollWheelZoom?t.setZoom(e+a):t.setZoomAround(this._lastMousePos,e+a))}});pi.addInitHook("addHandler","scrollWheelZoom",_n),pi.mergeOptions({tap:!0,tapTolerance:15});var gn=xi.extend({addHooks:function(){N(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){j(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if(H(t),this._fireClick=!0,1<t.touches.length)return this._fireClick=!1,void clearTimeout(this._holdTimeout);var e=t.touches[0],i=e.target;this._startPos=this._newPos=new y(e.clientX,e.clientY),i.tagName&&"a"===i.tagName.toLowerCase()&<(i,"leaflet-active"),this._holdTimeout=setTimeout(s(function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",e))},this),1e3),this._simulateEvent("mousedown",e),N(document,{touchmove:this._onMove,touchend:this._onUp},this)}},_onUp:function(t){if(clearTimeout(this._holdTimeout),j(document,{touchmove:this._onMove,touchend:this._onUp},this),this._fireClick&&t&&t.changedTouches){var e=t.changedTouches[0],i=e.target;i&&i.tagName&&"a"===i.tagName.toLowerCase()&&ut(i,"leaflet-active"),this._simulateEvent("mouseup",e),this._isTapValid()&&this._simulateEvent("click",e)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(t){var e=t.touches[0];this._newPos=new y(e.clientX,e.clientY),this._simulateEvent("mousemove",e)},_simulateEvent:function(t,e){var i=document.createEvent("MouseEvents");i._simulated=!0,e.target._simulatedClick=!0,i.initMouseEvent(t,!0,!0,window,1,e.screenX,e.screenY,e.clientX,e.clientY,!1,!1,!1,!1,0,null),e.target.dispatchEvent(i)}});De&&!Ae&&pi.addInitHook("addHandler","tap",gn),pi.mergeOptions({touchZoom:De&&!ge,bounceAtZoomLimits:!0});var yn=xi.extend({addHooks:function(){lt(this._map._container,"leaflet-touch-zoom"),N(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){ut(this._map._container,"leaflet-touch-zoom"),j(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(t.touches&&2===t.touches.length&&!e._animatingZoom&&!this._zooming){var i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),"center"!==e.options.touchZoom&&(this._pinchStartLatLng=e.containerPointToLatLng(i.add(n)._divideBy(2))),this._startDist=i.distanceTo(n),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),N(document,"touchmove",this._onTouchMove,this),N(document,"touchend",this._onTouchEnd,this),H(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]),o=i.distanceTo(n)/this._startDist;if(this._zoom=e.getScaleZoom(o,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoom<e.getMinZoom()&&o<1||this._zoom>e.getMaxZoom()&&1<o)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1==o)return}else{var r=i._add(n)._divideBy(2)._subtract(this._centerPoint);if(1==o&&0===r.x&&0===r.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(r),this._zoom)}this._moved||(e._moveStart(!0),this._moved=!0),_(this._animRequest);var a=s(e._move,e,this._center,this._zoom,{pinch:!0,round:!1});this._animRequest=x(a,this,!0),H(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,_(this._animRequest),j(document,"touchmove",this._onTouchMove),j(document,"touchend",this._onTouchEnd),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});pi.addInitHook("addHandler","touchZoom",yn),pi.BoxZoom=pn,pi.DoubleClickZoom=dn,pi.Drag=fn,pi.Keyboard=mn,pi.ScrollWheelZoom=_n,pi.Tap=gn,pi.TouchZoom=yn;var vn=window.L;window.L=t,Object.freeze=jt,t.version="1.2.0+HEAD.1ac320b",t.noConflict=function(){return window.L=vn,this},t.Control=di,t.control=si,t.Browser=je,t.Evented=Qt,t.Mixin=bi,t.Util=Kt,t.Class=g,t.Handler=xi,t.extend=l,t.bind=s,t.stamp=u,t.setOptions=r,t.DomEvent=ii,t.DomUtil=ci,t.PosAnimation=hi,t.Draggable=Ti,t.LineUtil=Ei,t.PolyUtil=Mi,t.Point=y,t.point=v,t.Bounds=b,t.bounds=w,t.Transformation=C,t.transformation=S,t.Projection=Pi,t.LatLng=E,t.latLng=M,t.LatLngBounds=k,t.latLngBounds=T,t.CRS=ee,t.GeoJSON=qi,t.geoJSON=Bt,t.geoJson=Wi,t.Layer=Di,t.LayerGroup=Oi,t.layerGroup=function(t){return new Oi(t)},t.FeatureGroup=Ri,t.featureGroup=function(t){return new Ri(t)},t.ImageOverlay=Xi,t.imageOverlay=function(t,e,i){return new Xi(t,e,i)},t.VideoOverlay=Ki,t.videoOverlay=function(t,e,i){return new Ki(t,e,i)},t.DivOverlay=Ji,t.Popup=Yi,t.popup=function(t,e){return new Yi(t,e)},t.Tooltip=Qi,t.tooltip=function(t,e){return new Qi(t,e)},t.Icon=Bi,t.icon=function(t){return new Bi(t)},t.DivIcon=tn,t.divIcon=function(t){return new tn(t)},t.Marker=Ni,t.marker=function(t,e){return new Ni(t,e)},t.TileLayer=nn,t.tileLayer=Ft,t.GridLayer=en,t.gridLayer=function(t){return new en(t)},t.SVG=cn,t.svg=Nt,t.Renderer=rn,t.Canvas=an,t.canvas=Ut,t.Path=ji,t.CircleMarker=$i,t.circleMarker=function(t,e){return new $i(t,e)},t.Circle=Vi,t.circle=function(t,e,i){return new Vi(t,e,i)},t.Polyline=Zi,t.polyline=function(t,e){return new Zi(t,e)},t.Polygon=Gi,t.polygon=function(t,e){return new Gi(t,e)},t.Rectangle=hn,t.rectangle=function(t,e){return new hn(t,e)},t.Map=pi,t.map=function(t,e){return new pi(t,e)}}),L.MapboxGL=L.Layer.extend({options:{updateInterval:32},initialize:function(t){if(L.setOptions(this,t),!t.accessToken)throw new Error("You should provide a Mapbox GL access token as a token option.");mapboxgl.accessToken=t.accessToken;var e,i,n,o,r,a,s;this._throttledUpdate=(e=L.Util.bind(this._update,this),i=this.options.updateInterval,s=function(){o=!1,r&&(a.apply(n,r),r=!1)},a=function(){o?r=arguments:(e.apply(n,arguments),setTimeout(s,i),o=!0)})},onAdd:function(t){this._glContainer||this._initContainer(),t._panes.tilePane.appendChild(this._glContainer),this._initGL(),this._offset=this._map.containerPointToLayerPoint([0,0]),t.options.zoomAnimation&&L.DomEvent.on(t._proxy,L.DomUtil.TRANSITION_END,this._transitionEnd,this)},onRemove:function(t){this._map.options.zoomAnimation&&L.DomEvent.off(this._map._proxy,L.DomUtil.TRANSITION_END,this._transitionEnd,this),t.getPanes().tilePane.removeChild(this._glContainer),this._glMap.remove(),this._glMap=null},getEvents:function(){return{move:this._throttledUpdate,zoomanim:this._animateZoom,zoom:this._pinchZoom,zoomstart:this._zoomStart,zoomend:this._zoomEnd}},_initContainer:function(){var t=this._glContainer=L.DomUtil.create("div","leaflet-gl-layer"),e=this._map.getSize();t.style.width=e.x+"px",t.style.height=e.y+"px"},_initGL:function(){var t=this._map.getCenter(),e=L.extend({},this.options,{container:this._glContainer,interactive:!1,center:[t.lng,t.lat],zoom:this._map.getZoom()-1,attributionControl:!1});this._glMap=new mapboxgl.Map(e),this._glMap.transform.latRange=null,this._glMap._canvas.canvas?this._glMap._actualCanvas=this._glMap._canvas.canvas:this._glMap._actualCanvas=this._glMap._canvas,L.DomUtil.addClass(this._glMap._actualCanvas,"leaflet-image-layer"),L.DomUtil.addClass(this._glMap._actualCanvas,"leaflet-zoom-animated")},_update:function(){if(this._offset=this._map.containerPointToLayerPoint([0,0]),!this._zooming){var t=this._map.getSize(),e=this._glContainer,i=this._glMap,n=this._map.containerPointToLayerPoint([0,0]);L.DomUtil.setPosition(e,n);var o=this._map.getCenter(),r=i.transform;r.center=mapboxgl.LngLat.convert([o.lng,o.lat]),r.zoom=this._map.getZoom()-1,i.transform.width!==t.x||i.transform.height!==t.y?(e.style.width=t.x+"px",e.style.height=t.y+"px",null!==i._resize&&void 0!==i._resize?i._resize():i.resize()):null!==i._update&&void 0!==i._update?i._update():i.update()}},_pinchZoom:function(){this._glMap.jumpTo({zoom:this._map.getZoom()-1,center:this._map.getCenter()})},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),i=this._map._latLngToNewLayerPoint(this._map.getBounds().getNorthWest(),t.zoom,t.center);L.DomUtil.setTransform(this._glMap._actualCanvas,i.subtract(this._offset),e)},_zoomStart:function(){this._zooming=!0},_zoomEnd:function(){var t=this._map.getZoomScale(this._map.getZoom()),e=this._map._latLngToNewLayerPoint(this._map.getBounds().getNorthWest(),this._map.getZoom(),this._map.getCenter());L.DomUtil.setTransform(this._glMap._actualCanvas,e.subtract(this._offset),t),this._zooming=!1},_transitionEnd:function(){L.Util.requestAnimFrame(function(){var t=this._map.getZoom(),e=this._map.getCenter(),i=this._map.latLngToContainerPoint(this._map.getBounds().getNorthWest());L.DomUtil.setTransform(this._glMap._actualCanvas,i,1),this._glMap.once("moveend",L.Util.bind(function(){this._zoomEnd()},this)),this._glMap.jumpTo({center:e,zoom:t-1})},this)}}),L.mapboxGL=function(t){return new L.MapboxGL(t)},function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).mapboxgl=e()}(this,function(){"use strict";var o,r,a;function t(t,e){if(o)if(r){var i="var sharedChunk = {}; ("+o+")(sharedChunk); ("+r+")(sharedChunk);",n={};o(n),(a=e(n)).workerUrl=window.URL.createObjectURL(new Blob([i],{type:"text/javascript"}))}else r=e;else o=e}return t(0,function(t){function e(t,e){return t(e={exports:{}},e.exports),e.exports}var a=i;function i(t,e,i,n){this.cx=3*t,this.bx=3*(i-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=i,this.p2y=n}i.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},i.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},i.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},i.prototype.solveCurveX=function(t,e){var i,n,o,r,a;for(void 0===e&&(e=1e-6),o=t,a=0;a<8;a++){if(r=this.sampleCurveX(o)-t,Math.abs(r)<e)return o;var s=this.sampleCurveDerivativeX(o);if(Math.abs(s)<1e-6)break;o-=r/s}if((o=t)<(i=0))return i;if(o>(n=1))return n;for(;i<n;){if(r=this.sampleCurveX(o),Math.abs(r-t)<e)return o;r<t?i=o:n=o,o=.5*(n-i)+i}return o},i.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var st=n;function n(t,e){this.x=t,this.y=e}function p(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(var i=0;i<t.length;i++)if(!p(t[i],e[i]))return!1;return!0}if("object"!=typeof t||null===t||null===e)return t===e;if("object"!=typeof e)return!1;if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var n in t)if(!p(t[n],e[n]))return!1;return!0}function o(t,e,i,n){var o=new a(t,e,i,n);return function(t){return o.solve(t)}}n.prototype={clone:function(){return new n(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,i=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=i,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),i=Math.sin(t),n=e*this.x-i*this.y,o=i*this.x+e*this.y;return this.x=n,this.y=o,this},_rotateAround:function(t,e){var i=Math.cos(t),n=Math.sin(t),o=e.x+i*(this.x-e.x)-n*(this.y-e.y),r=e.y+n*(this.x-e.x)+i*(this.y-e.y);return this.x=o,this.y=r,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t};var r=o(.25,.1,.25,1);function l(t,e,i){return Math.min(i,Math.max(e,t))}function s(t,e,i){var n=i-e,o=((t-e)%n+n)%n+e;return o===e?i:o}function f(t){for(var e=[],i=arguments.length-1;0<i--;)e[i]=arguments[i+1];for(var n=0,o=e;n<o.length;n+=1){var r=o[n];for(var a in r)t[a]=r[a]}return t}var u=1;function c(){return u++}function h(){return function t(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function d(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function m(t,e){t.forEach(function(t){e[t]&&(e[t]=e[t].bind(e))})}function _(t,e){return-1!==t.indexOf(e,t.length-e.length)}function g(t,e,i){var n={};for(var o in t)n[o]=e.call(i||this,t[o],o,t);return n}function y(t,e,i){var n={};for(var o in t)e.call(i||this,t[o],o,t)&&(n[o]=t[o]);return n}function v(t){return Array.isArray(t)?t.map(v):"object"==typeof t&&t?g(t,v):t}var x={};function lt(t){x[t]||("undefined"!=typeof console&&console.warn(t),x[t]=!0)}function b(t,e,i){return(i.y-t.y)*(e.x-t.x)>(e.y-t.y)*(i.x-t.x)}function w(t){for(var e=0,i=0,n=t.length,o=n-1,r=void 0,a=void 0;i<n;o=i++)r=t[i],e+=((a=t[o]).x-r.x)*(r.y+a.y);return e}function L(t){var r={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,function(t,e,i,n){var o=i||n;return r[e]=!o||o.toLowerCase(),""}),r["max-age"]){var e=parseInt(r["max-age"],10);isNaN(e)?delete r["max-age"]:r["max-age"]=e}return r}function k(t){try{var e=self[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var T,E,M,C=self.performance&&self.performance.now?self.performance.now.bind(self.performance):Date.now.bind(Date),S=self.requestAnimationFrame||self.mozRequestAnimationFrame||self.webkitRequestAnimationFrame||self.msRequestAnimationFrame,P=self.cancelAnimationFrame||self.mozCancelAnimationFrame||self.webkitCancelAnimationFrame||self.msCancelAnimationFrame,z={now:C,frame:function(t){var e=S(t);return{cancel:function(){return P(e)}}},getImageData:function(t){var e=self.document.createElement("canvas"),i=e.getContext("2d");if(!i)throw new Error("failed to create canvas 2d context");return e.width=t.width,e.height=t.height,i.drawImage(t,0,0,t.width,t.height),i.getImageData(0,0,t.width,t.height)},resolveURL:function(t){return T||(T=self.document.createElement("a")),T.href=t,T.href},hardwareConcurrency:self.navigator.hardwareConcurrency||4,get devicePixelRatio(){return self.devicePixelRatio}},I={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},A={supported:!1,testSupport:function(t){!D&&M&&(O?R(t):E=t)}},D=!1,O=!1;function R(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,M),t.isContextLost())return;A.supported=!0}catch(t){}t.deleteTexture(e),D=!0}self.document&&((M=self.document.createElement("img")).onload=function(){E&&R(E),O=!(E=null)},M.onerror=function(){D=!0,E=null},M.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");function B(t){this._transformRequestFn=t,this._createSkuToken()}var F="01";B.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",F,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},B.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},B.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},B.prototype.normalizeStyleURL=function(t,e){return Z(t,e)},B.prototype.normalizeGlyphsURL=function(t,e){return G(t,e)},B.prototype.normalizeSourceURL=function(t,e){return q(t,e)},B.prototype.normalizeSpriteURL=function(t,e,i,n){return H(t,e,i,n)},B.prototype.normalizeTileURL=function(t,e,i){return this._isSkuTokenExpired()&&this._createSkuToken(),X(t,e,i,this._skuToken)},B.prototype.canonicalizeTileURL=function(t){return J(t)},B.prototype.canonicalizeTileset=function(t,e){return Y(t,e)};var U="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes";function N(t,e){var i=tt(I.API_URL);if(t.protocol=i.protocol,t.authority=i.authority,"/"!==i.path&&(t.path=""+i.path+t.path),!I.REQUIRE_ACCESS_TOKEN)return et(t);if(!(e=e||I.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+U);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+U);return t.params.push("access_token="+e),et(t)}function j(t){return 0===t.indexOf("mapbox:")}var $=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function V(t){return $.test(t)}var Z=function(t,e){if(!j(t))return t;var i=tt(t);return i.path="/styles/v1"+i.path,N(i,e)},G=function(t,e){if(!j(t))return t;var i=tt(t);return i.path="/fonts/v1"+i.path,N(i,e)},q=function(t,e){if(!j(t))return t;var i=tt(t);return i.path="/v4/"+i.authority+".json",i.params.push("secure"),N(i,e)},H=function(t,e,i,n){var o=tt(t);return j(t)?(o.path="/styles/v1"+o.path+"/sprite"+e+i,N(o,n)):(o.path+=""+e+i,et(o))},W=/(\.(png|jpg)\d*)(?=$)/,X=function(t,e,i,n){if(!e||!j(e))return t;var o=tt(t),r=2<=z.devicePixelRatio||512===i?"@2x":"",a=A.supported?".webp":"$1";return o.path=o.path.replace(W,r+a),o.path="/v4"+o.path,I.REQUIRE_ACCESS_TOKEN&&I.ACCESS_TOKEN&&n&&o.params.push("sku="+n),N(o)},K=/\.[\w]+$/,J=function(t){var e=tt(t);if(!e.path.match(/(^\/v4\/)/)||!e.path.match(K))return t;var i="mapbox://tiles/";i+=e.path.replace("/v4/","");var n=e.params.filter(function(t){return!t.match(/^access_token=/)});return n.length&&(i+="?"+n.join("&")),i},Y=function(t,e){if(!j(e))return t.tiles||[];for(var i=[],n=0,o=t.tiles;n<o.length;n+=1){var r=o[n],a=J(r);i.push(a)}return i},Q=/^(\w+):\/\/([^\/?]*)(\/[^?]+)?\??(.+)?/;function tt(t){var e=t.match(Q);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function et(t){var e=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+e}function it(t){if(!t)return null;var e,i=t.split(".");if(!i||3!==i.length)return null;try{return JSON.parse((e=i[1],decodeURIComponent(self.atob(e).split("").map(function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)}).join(""))))}catch(t){return null}}function nt(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}nt.prototype.getStorageKey=function(t){var e,i=it(I.ACCESS_TOKEN),n="";return n=i&&i.u?(e=i.u,self.btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(t,e){return String.fromCharCode(Number("0x"+e))}))):I.ACCESS_TOKEN||"",t?"mapbox.eventData."+t+":"+n:"mapbox.eventData:"+n},nt.prototype.fetchEventData=function(){var t=k("localStorage"),e=this.getStorageKey(),i=this.getStorageKey("uuid");if(t)try{var n=self.localStorage.getItem(e);n&&(this.eventData=JSON.parse(n));var o=self.localStorage.getItem(i);o&&(this.anonId=o)}catch(t){lt("Unable to read from LocalStorage")}},nt.prototype.saveEventData=function(){var t=k("localStorage"),e=this.getStorageKey(),i=this.getStorageKey("uuid");if(t)try{self.localStorage.setItem(i,this.anonId),1<=Object.keys(this.eventData).length&&self.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){lt("Unable to write to LocalStorage")}},nt.prototype.processRequests=function(){},nt.prototype.postEvent=function(t,e,i){var n=this;if(I.EVENTS_URL){var o=tt(I.EVENTS_URL);o.params.push("access_token="+(I.ACCESS_TOKEN||""));var r={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.1.0",skuId:F,userId:this.anonId},a=e?f(r,e):r,s={url:et(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([a])};this.pendingRequest=At(s,function(t){n.pendingRequest=null,i(t),n.saveEventData(),n.processRequests()})}},nt.prototype.queueRequest=function(t){this.queue.push(t),this.processRequests()};var ot,rt,at,ut=((at=nt)&&(vt.__proto__=at),((vt.prototype=Object.create(at&&at.prototype)).constructor=vt).prototype.postMapLoadEvent=function(t,e,i){this.skuToken=i,I.EVENTS_URL&&I.ACCESS_TOKEN&&Array.isArray(t)&&t.some(function(t){return j(t)||V(t)})&&this.queueRequest({id:e,timestamp:Date.now()})},vt.prototype.processRequests=function(){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var t=this.queue.shift(),i=t.id,n=t.timestamp;i&&this.success[i]||(this.anonId||this.fetchEventData(),d(this.anonId)||(this.anonId=h()),this.postEvent(n,{skuToken:this.skuToken},function(t){t||i&&(e.success[i]=!0)}))}},vt),ct=((rt=nt)&&(yt.__proto__=rt),((yt.prototype=Object.create(rt&&rt.prototype)).constructor=yt).prototype.postTurnstileEvent=function(t){I.EVENTS_URL&&I.ACCESS_TOKEN&&Array.isArray(t)&&t.some(function(t){return j(t)||V(t)})&&this.queueRequest(Date.now())},yt.prototype.processRequests=function(){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var t=it(I.ACCESS_TOKEN),i=t?t.u:I.ACCESS_TOKEN,n=i!==this.eventData.tokenU;d(this.anonId)||(this.anonId=h(),n=!0);var o=this.queue.shift();if(this.eventData.lastSuccess){var r=new Date(this.eventData.lastSuccess),a=new Date(o),s=(o-this.eventData.lastSuccess)/864e5;n=n||1<=s||s<-1||r.getDate()!==a.getDate()}else n=!0;if(!n)return this.processRequests();this.postEvent(o,{"enabled.telemetry":!1},function(t){t||(e.eventData.lastSuccess=o,e.eventData.tokenU=i)})}},new yt),ht=ct.postTurnstileEvent.bind(ct),pt=new ut,dt=pt.postMapLoadEvent.bind(pt),ft="mapbox-tiles",mt=500,_t=50,gt=42e4;function yt(){rt.call(this,"appUserTurnstile")}function vt(){at.call(this,"map.load"),this.success={},this.skuToken=""}function xt(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}var bt=1/0,wt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(wt);var Lt,kt=((Lt=Error)&&(Tt.__proto__=Lt),((Tt.prototype=Object.create(Lt&&Lt.prototype)).constructor=Tt).prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},Tt);function Tt(t,e,i){401===e&&V(i)&&(t+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),Lt.call(this,t),this.status=e,this.url=i,this.name=this.constructor.name,this.message=t}function Et(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}var Mt=Et()?function(){return self.worker&&self.worker.referrer}:function(){var t=self.location.origin;if(t&&"null"!==t&&"file://"!==t)return t+self.location.pathname};function Ct(o,r){var t,e=new self.AbortController,a=new self.Request(o.url,{method:o.method||"GET",body:o.body,credentials:o.credentials,headers:o.headers,referrer:Mt(),signal:e.signal}),s=!1,l=0<(t=a.url).indexOf("sku=")&&V(t);"json"===o.type&&a.headers.set("Accept","application/json");function i(t,e,i){if(t&&"SecurityError"!==t.message&<(t),e&&i)return u(e);var n=Date.now();self.fetch(a).then(function(t){if(t.ok){var e=l?t.clone():null;return u(t,e,n)}return r(new kt(t.statusText,t.status,o.url))}).catch(function(t){20!==t.code&&r(new Error(t.message))})}var u=function(e,i,n){("arrayBuffer"===o.type?e.arrayBuffer():"json"===o.type?e.json():e.text()).then(function(t){i&&n&&function(i,t,e){if(self.caches){var n={status:t.status,statusText:t.statusText,headers:new self.Headers};t.headers.forEach(function(t,e){return n.headers.set(e,t)});var o=L(t.headers.get("Cache-Control")||"");o["no-store"]||(o["max-age"]&&n.headers.set("Expires",new Date(e+1e3*o["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-e<gt||function(t,e){if(void 0===ot)try{new Response(new ReadableStream),ot=!0}catch(t){ot=!1}ot?e(t.body):t.blob().then(e)}(t,function(t){var e=new self.Response(t,n);self.caches.open(ft).then(function(t){return t.put(xt(i.url),e)})}))}}(a,i,n),s=!0,r(null,t,e.headers.get("Cache-Control"),e.headers.get("Expires"))}).catch(function(t){return r(new Error(t.message))})};return l?function(o,r){if(!self.caches)return r(null);self.caches.open(ft).catch(r).then(function(n){n.match(o,{ignoreSearch:!0}).catch(r).then(function(t){var e=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")),i=L(t.headers.get("Cache-Control")||"");return e>Date.now()&&!i["no-cache"]}(t),i=xt(o.url);n.delete(i),e&&n.put(i,t.clone()),r(null,t,e)})})}(a,i):i(null,null),{cancel:function(){s||e.abort()}}}function St(t,e){if(!/^file:/.test(t.url)){if(self.fetch&&self.Request&&self.AbortController&&self.Request.prototype.hasOwnProperty("signal"))return Ct(t,e);if(Et()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e)}return function(e,i){var n=new self.XMLHttpRequest;for(var t in n.open(e.method||"GET",e.url,!0),"arrayBuffer"===e.type&&(n.responseType="arraybuffer"),e.headers)n.setRequestHeader(t,e.headers[t]);return"json"===e.type&&n.setRequestHeader("Accept","application/json"),n.withCredentials="include"===e.credentials,n.onerror=function(){i(new Error(n.statusText))},n.onload=function(){if((200<=n.status&&n.status<300||0===n.status)&&null!==n.response){var t=n.response;if("json"===e.type)try{t=JSON.parse(n.response)}catch(t){return i(t)}i(null,t,n.getResponseHeader("Cache-Control"),n.getResponseHeader("Expires"))}else i(new kt(n.statusText,n.status,e.url))},n.send(e.body),{cancel:function(){return n.abort()}}}(t,e)}function Pt(t,e){return St(f(t,{type:"arrayBuffer"}),e)}var zt,It,At=function(t,e){return St(f(t,{method:"POST"}),e)};zt=[],It=0;var Dt=function(t,s){if(It>=I.MAX_PARALLEL_IMAGE_REQUESTS){var e={requestParameters:t,callback:s,cancelled:!1,cancel:function(){this.cancelled=!0}};return zt.push(e),e}It++;function l(){if(!n)for(n=!0,It--;zt.length&&It<I.MAX_PARALLEL_IMAGE_REQUESTS;){var t=zt.shift(),e=t.requestParameters,i=t.callback;t.cancelled||(t.cancel=Dt(e,i).cancel)}}var n=!1,i=Pt(t,function(t,e,i,n){if(l(),t)s(t);else if(e){var o=new self.Image,r=self.URL||self.webkitURL;o.onload=function(){s(null,o),r.revokeObjectURL(o.src)},o.onerror=function(){return s(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var a=new self.Blob([new Uint8Array(e)],{type:"image/png"});o.cacheControl=i,o.expires=n,o.src=e.byteLength?r.createObjectURL(a):"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII="}});return{cancel:function(){i.cancel(),l()}}};function Ot(t,e,i){i[t]&&-1!==i[t].indexOf(e)||(i[t]=i[t]||[],i[t].push(e))}function Rt(t,e,i){if(i&&i[t]){var n=i[t].indexOf(e);-1!==n&&i[t].splice(n,1)}}function Bt(t,e){void 0===e&&(e={}),f(this,e),this.type=t}function Ft(){}var Ut,Nt=((Ut=Bt)&&(jt.__proto__=Ut),(jt.prototype=Object.create(Ut&&Ut.prototype)).constructor=jt);function jt(t,e){void 0===e&&(e={}),Ut.call(this,"error",f({error:t},e))}Ft.prototype.on=function(t,e){return this._listeners=this._listeners||{},Ot(t,e,this._listeners),this},Ft.prototype.off=function(t,e){return Rt(t,e,this._listeners),Rt(t,e,this._oneTimeListeners),this},Ft.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},Ot(t,e,this._oneTimeListeners),this},Ft.prototype.fire=function(t,e){"string"==typeof t&&(t=new Bt(t,e||{}));var i=t.type;if(this.listens(i)){for(var n=0,o=(t.target=this)._listeners&&this._listeners[i]?this._listeners[i].slice():[];n<o.length;n+=1)o[n].call(this,t);for(var r=0,a=this._oneTimeListeners&&this._oneTimeListeners[i]?this._oneTimeListeners[i].slice():[];r<a.length;r+=1){var s=a[r];Rt(i,s,this._oneTimeListeners),s.call(this,t)}var l=this._eventedParent;l&&(f(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),l.fire(t))}else t instanceof Nt&&console.error(t.error);return this},Ft.prototype.listens=function(t){return this._listeners&&this._listeners[t]&&0<this._listeners[t].length||this._oneTimeListeners&&this._oneTimeListeners[t]&&0<this._oneTimeListeners[t].length||this._eventedParent&&this._eventedParent.listens(t)};var $t={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!(Ft.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this})},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"string",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:[{"!":"text-offset"}],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:[{"!":"text-anchor"},{"!":"text-offset"},{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",requires:["text-field"],values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},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},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Zoom"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"string",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"string",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"string",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"string",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}}},Vt=function(t,e,i,n){this.message=(t?t+": ":"")+i,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)};function Zt(t){var e=t.key,i=t.value;return i?[new Vt(e,i,"constants have been deprecated as of v8")]:[]}function Gt(t){for(var e=[],i=arguments.length-1;0<i--;)e[i]=arguments[i+1];for(var n=0,o=e;n<o.length;n+=1){var r=o[n];for(var a in r)t[a]=r[a]}return t}function qt(t){return t instanceof Number||t instanceof String||t instanceof Boolean}function Ht(t){return qt(t)?t.valueOf():t}function Wt(t){if(Array.isArray(t))return t.map(Wt);if(t instanceof Object&&!qt(t)){var e={};for(var i in t)e[i]=Wt(t[i]);return e}return Ht(t)}function Xt(t,e){void 0===e&&(e=[]),this.parent=t,this.bindings={};for(var i=0,n=e;i<n.length;i+=1){var o=n[i],r=o[0],a=o[1];this.bindings[r]=a}}var Kt,Jt=((Kt=Error)&&(Yt.__proto__=Kt),(Yt.prototype=Object.create(Kt&&Kt.prototype)).constructor=Yt);function Yt(t,e){Kt.call(this,e),this.message=e,this.key=t}Xt.prototype.concat=function(t){return new Xt(this,t)},Xt.prototype.get=function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(t+" not found in scope.")},Xt.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)};var Qt={kind:"null"},te={kind:"number"},ee={kind:"string"},ie={kind:"boolean"},ne={kind:"color"},oe={kind:"object"},re={kind:"value"},ae={kind:"collator"},se={kind:"formatted"};function le(t,e){return{kind:"array",itemType:t,N:e}}function ue(t){if("array"!==t.kind)return t.kind;var e=ue(t.itemType);return"number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}var ce=[Qt,te,ee,ie,ne,se,oe,le(re)];function he(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!he(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var i=0,n=ce;i<n.length;i+=1)if(!he(n[i],e))return null}return"Expected "+ue(t)+" but found "+ue(e)+" instead."}var pe=e(function(t,e){var d={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]};function f(t){return(t=Math.round(t))<0?0:255<t?255:t}function i(t){return t<0?0:1<t?1:t}function m(t){return"%"===t[t.length-1]?f(parseFloat(t)/100*255):f(parseInt(t))}function _(t){return"%"===t[t.length-1]?i(parseFloat(t)/100):i(parseFloat(t))}function g(t,e,i){return i<0?i+=1:1<i&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}try{e.parseCSSColor=function(t){var e,i=t.replace(/ /g,"").toLowerCase();if(i in d)return d[i].slice();if("#"===i[0])return 4===i.length?0<=(e=parseInt(i.substr(1),16))&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===i.length&&0<=(e=parseInt(i.substr(1),16))&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var n=i.indexOf("("),o=i.indexOf(")");if(-1!==n&&o+1===i.length){var r=i.substr(0,n),a=i.substr(n+1,o-(n+1)).split(","),s=1;switch(r){case"rgba":if(4!==a.length)return null;s=_(a.pop());case"rgb":return 3!==a.length?null:[m(a[0]),m(a[1]),m(a[2]),s];case"hsla":if(4!==a.length)return null;s=_(a.pop());case"hsl":if(3!==a.length)return null;var l=(parseFloat(a[0])%360+360)%360/360,u=_(a[1]),c=_(a[2]),h=c<=.5?c*(u+1):c+u-c*u,p=2*c-h;return[f(255*g(p,h,l+1/3)),f(255*g(p,h,l)),f(255*g(p,h,l-1/3)),s];default:return null}}return null}}catch(t){}}).parseCSSColor,de=function(t,e,i,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=i,this.a=n};de.parse=function(t){if(t){if(t instanceof de)return t;if("string"==typeof t){var e=pe(t);if(e)return new de(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},de.prototype.toString=function(){var t=this.toArray(),e=t[0],i=t[1],n=t[2],o=t[3];return"rgba("+Math.round(e)+","+Math.round(i)+","+Math.round(n)+","+o+")"},de.prototype.toArray=function(){var t=this.r,e=this.g,i=this.b,n=this.a;return 0===n?[0,0,0,0]:[255*t/n,255*e/n,255*i/n,n]},de.black=new de(0,0,0,1),de.white=new de(1,1,1,1),de.transparent=new de(0,0,0,0),de.red=new de(1,0,0,1);var fe=function(t,e,i){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};fe.prototype.compare=function(t,e){return this.collator.compare(t,e)},fe.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};function me(t,e,i){this.text=t,this.scale=e,this.fontStack=i}var _e=function(t){this.sections=t};function ge(t,e,i,n){return"number"==typeof t&&0<=t&&t<=255&&"number"==typeof e&&0<=e&&e<=255&&"number"==typeof i&&0<=i&&i<=255?void 0===n||"number"==typeof n&&0<=n&&n<=1?null:"Invalid rgba value ["+[t,e,i,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof n?[t,e,i,n]:[t,e,i]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function ye(t){if(null===t)return Qt;if("string"==typeof t)return ee;if("boolean"==typeof t)return ie;if("number"==typeof t)return te;if(t instanceof de)return ne;if(t instanceof fe)return ae;if(t instanceof _e)return se;if(Array.isArray(t)){for(var e,i=t.length,n=0,o=t;n<o.length;n+=1){var r=ye(o[n]);if(e){if(e===r)continue;e=re;break}e=r}return le(e||re,i)}return oe}function ve(t){var e=typeof t;return null===t?"":"string"==e||"number"==e||"boolean"==e?String(t):t instanceof de||t instanceof _e?t.toString():JSON.stringify(t)}_e.fromString=function(t){return new _e([new me(t,null,null)])},_e.prototype.toString=function(){return this.sections.map(function(t){return t.text}).join("")},_e.prototype.serialize=function(){for(var t=["format"],e=0,i=this.sections;e<i.length;e+=1){var n=i[e];t.push(n.text);var o={};n.fontStack&&(o["text-font"]=["literal",n.fontStack.split(",")]),n.scale&&(o["font-scale"]=n.scale),t.push(o)}return t};function xe(t,e){this.type=t,this.value=e}xe.parse=function(t,e){if(2!==t.length)return e.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!function t(e){if(null===e)return!0;if("string"==typeof e)return!0;if("boolean"==typeof e)return!0;if("number"==typeof e)return!0;if(e instanceof de)return!0;if(e instanceof fe)return!0;if(e instanceof _e)return!0;if(Array.isArray(e)){for(var i=0,n=e;i<n.length;i+=1)if(!t(n[i]))return!1;return!0}if("object"!=typeof e)return!1;for(var o in e)if(!t(e[o]))return!1;return!0}(t[1]))return e.error("invalid value");var i=t[1],n=ye(i),o=e.expectedType;return"array"!==n.kind||0!==n.N||!o||"array"!==o.kind||"number"==typeof o.N&&0!==o.N||(n=o),new xe(n,i)},xe.prototype.evaluate=function(){return this.value},xe.prototype.eachChild=function(){},xe.prototype.possibleOutputs=function(){return[this.value]},xe.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof de?["rgba"].concat(this.value.toArray()):this.value instanceof _e?this.value.serialize():this.value};var be=function(t){this.name="ExpressionEvaluationError",this.message=t};be.prototype.toJSON=function(){return this.message};function we(t,e){this.type=t,this.args=e}var Le={string:ee,number:te,boolean:ie,object:oe};we.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var i,n=1,o=t[0];if("array"===o){var r,a;if(2<t.length){var s=t[1];if("string"!=typeof s||!(s in Le)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);r=Le[s],n++}else r=re;if(3<t.length){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);a=t[2],n++}i=le(r,a)}else i=Le[o];for(var l=[];n<t.length;n++){var u=e.parse(t[n],n,re);if(!u)return null;l.push(u)}return new we(i,l)},we.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var i=this.args[e].evaluate(t);if(!he(this.type,ye(i)))return i;if(e===this.args.length-1)throw new be("Expected value to be of type "+ue(this.type)+", but found "+ue(ye(i))+" instead.")}return null},we.prototype.eachChild=function(t){this.args.forEach(t)},we.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.args.map(function(t){return t.possibleOutputs()}))},we.prototype.serialize=function(){var t=this.type,e=[t.kind];if("array"===t.kind){var i=t.itemType;if("string"===i.kind||"number"===i.kind||"boolean"===i.kind){e.push(i.kind);var n=t.N;("number"==typeof n||1<this.args.length)&&e.push(n)}}return e.concat(this.args.map(function(t){return t.serialize()}))};function ke(t){this.type=se,this.sections=t}ke.parse=function(t,e){if(t.length<3)return e.error("Expected at least two arguments.");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");for(var i=[],n=1;n<t.length-1;n+=2){var o=e.parse(t[n],1,re);if(!o)return null;var r=o.type.kind;if("string"!==r&&"value"!==r&&"null"!==r)return e.error("Formatted text type must be 'string', 'value', or 'null'.");var a=t[n+1];if("object"!=typeof a||Array.isArray(a))return e.error("Format options argument must be an object.");var s=null;if(a["font-scale"]&&!(s=e.parse(a["font-scale"],1,te)))return null;var l=null;if(a["text-font"]&&!(l=e.parse(a["text-font"],1,le(ee))))return null;i.push({text:o,scale:s,font:l})}return new ke(i)},ke.prototype.evaluate=function(e){return new _e(this.sections.map(function(t){return new me(ve(t.text.evaluate(e)),t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null)}))},ke.prototype.eachChild=function(t){for(var e=0,i=this.sections;e<i.length;e+=1){var n=i[e];t(n.text),n.scale&&t(n.scale),n.font&&t(n.font)}},ke.prototype.possibleOutputs=function(){return[void 0]},ke.prototype.serialize=function(){for(var t=["format"],e=0,i=this.sections;e<i.length;e+=1){var n=i[e];t.push(n.text.serialize());var o={};n.scale&&(o["font-scale"]=n.scale.serialize()),n.font&&(o["text-font"]=n.font.serialize()),t.push(o)}return t};function Te(t,e){this.type=t,this.args=e}var Ee={"to-boolean":ie,"to-color":ne,"to-number":te,"to-string":ee};Te.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var i=t[0];if(("to-boolean"===i||"to-string"===i)&&2!==t.length)return e.error("Expected one argument.");for(var n=Ee[i],o=[],r=1;r<t.length;r++){var a=e.parse(t[r],r,re);if(!a)return null;o.push(a)}return new Te(n,o)},Te.prototype.evaluate=function(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){for(var e,i,n=0,o=this.args;n<o.length;n+=1){if(i=null,(e=o[n].evaluate(t))instanceof de)return e;if("string"==typeof e){var r=t.parseColor(e);if(r)return r}else if(Array.isArray(e)&&!(i=e.length<3||4<e.length?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":ge(e[0],e[1],e[2],e[3])))return new de(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new be(i||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"!==this.type.kind)return"formatted"===this.type.kind?_e.fromString(ve(this.args[0].evaluate(t))):ve(this.args[0].evaluate(t));for(var a=null,s=0,l=this.args;s<l.length;s+=1){if(null===(a=l[s].evaluate(t)))return 0;var u=Number(a);if(!isNaN(u))return u}throw new be("Could not convert "+JSON.stringify(a)+" to number.")},Te.prototype.eachChild=function(t){this.args.forEach(t)},Te.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.args.map(function(t){return t.possibleOutputs()}))},Te.prototype.serialize=function(){if("formatted"===this.type.kind)return new ke([{text:this.args[0],scale:null,font:null}]).serialize();var e=["to-"+this.type.kind];return this.eachChild(function(t){e.push(t.serialize())}),e};function Me(){this.globals=null,this.feature=null,this.featureState=null,this._parseColorCache={}}var Ce=["Unknown","Point","LineString","Polygon"];Me.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},Me.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?Ce[this.feature.type]:this.feature.type:null},Me.prototype.properties=function(){return this.feature&&this.feature.properties||{}},Me.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=de.parse(t)),e};var Se=function(t,e,i,n){this.name=t,this.type=e,this._evaluate=i,this.args=n};Se.prototype.evaluate=function(t){return this._evaluate(t,this.args)},Se.prototype.eachChild=function(t){this.args.forEach(t)},Se.prototype.possibleOutputs=function(){return[void 0]},Se.prototype.serialize=function(){return[this.name].concat(this.args.map(function(t){return t.serialize()}))},Se.parse=function(i,t){var e,n=i[0],o=Se.definitions[n];if(!o)return t.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0);for(var r=Array.isArray(o)?o[0]:o.type,a=Array.isArray(o)?[[o[1],o[2]]]:o.overloads,s=a.filter(function(t){var e=t[0];return!Array.isArray(e)||e.length===i.length-1}),l=null,u=0,c=s;u<c.length;u+=1){var h=c[u],p=h[0],d=h[1];l=new Oe(t.registry,t.path,null,t.scope);for(var f=[],m=!1,_=1;_<i.length;_++){var g=i[_],y=Array.isArray(p)?p[_-1]:p.type,v=l.parse(g,1+f.length,y);if(!v){m=!0;break}f.push(v)}if(!m)if(Array.isArray(p)&&p.length!==f.length)l.error("Expected "+p.length+" arguments, but found "+f.length+" instead.");else{for(var x=0;x<f.length;x++){var b=Array.isArray(p)?p[x]:p.type,w=f[x];l.concat(x+1).checkSubtype(b,w.type)}if(0===l.errors.length)return new Se(n,r,d,f)}}if(1===s.length)(e=t.errors).push.apply(e,l.errors);else{for(var L=(s.length?s:a).map(function(t){var e;return e=t[0],Array.isArray(e)?"("+e.map(ue).join(", ")+")":"("+ue(e.type)+"...)"}).join(" | "),k=[],T=1;T<i.length;T++){var E=t.parse(i[T],1+k.length);if(!E)return null;k.push(ue(E.type))}t.error("Expected arguments of type "+L+", but found ("+k.join(", ")+") instead.")}return null},Se.register=function(t,e){for(var i in Se.definitions=e)t[i]=Se};function Pe(t,e,i){this.type=ae,this.locale=i,this.caseSensitive=t,this.diacriticSensitive=e}function ze(t){if(t instanceof Se){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}var e=!0;return t.eachChild(function(t){e&&!ze(t)&&(e=!1)}),e}function Ie(t){if(t instanceof Se&&"feature-state"===t.name)return!1;var e=!0;return t.eachChild(function(t){e&&!Ie(t)&&(e=!1)}),e}function Ae(t,e){if(t instanceof Se&&0<=e.indexOf(t.name))return!1;var i=!0;return t.eachChild(function(t){i&&!Ae(t,e)&&(i=!1)}),i}Pe.parse=function(t,e){if(2!==t.length)return e.error("Expected one argument.");var i=t[1];if("object"!=typeof i||Array.isArray(i))return e.error("Collator options argument must be an object.");var n=e.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,ie);if(!n)return null;var o=e.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,ie);if(!o)return null;var r=null;return i.locale&&!(r=e.parse(i.locale,1,ee))?null:new Pe(n,o,r)},Pe.prototype.evaluate=function(t){return new fe(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},Pe.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},Pe.prototype.possibleOutputs=function(){return[void 0]},Pe.prototype.serialize=function(){var t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]};function De(t,e){this.type=e.type,this.name=t,this.boundExpression=e}De.parse=function(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");var i=t[1];return e.scope.has(i)?new De(i,e.scope.get(i)):e.error('Unknown variable "'+i+'". Make sure "'+i+'" has been bound in an enclosing "let" expression before using it.',1)},De.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},De.prototype.eachChild=function(){},De.prototype.possibleOutputs=function(){return[void 0]},De.prototype.serialize=function(){return["var",this.name]};var Oe=function(t,e,i,n,o){void 0===e&&(e=[]),void 0===n&&(n=new Xt),void 0===o&&(o=[]),this.registry=t,this.path=e,this.key=e.map(function(t){return"["+t+"]"}).join(""),this.scope=n,this.errors=o,this.expectedType=i};function Re(t,e){for(var i,n,o=t.length-1,r=0,a=o,s=0;r<=a;)if(i=t[s=Math.floor((r+a)/2)],n=t[s+1],i<=e){if(s===o||e<n)return s;r=s+1}else{if(!(e<i))throw new be("Input is not a number.");a=s-1}return 0}Oe.prototype.parse=function(t,e,i,n,o){return void 0===o&&(o={}),e?this.concat(e,i,n)._parse(t,o):this._parse(t,o)},Oe.prototype._parse=function(t,e){function i(t,e,i){return"assert"===i?new we(e,[t]):"coerce"===i?new Te(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=t[0];if("string"!=typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var o=this.registry[n];if(o){var r=o.parse(t,this);if(!r)return null;if(this.expectedType){var a=this.expectedType,s=r.type;if("string"!==a.kind&&"number"!==a.kind&&"boolean"!==a.kind&&"object"!==a.kind&&"array"!==a.kind||"value"!==s.kind)if("color"!==a.kind&&"formatted"!==a.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(a,s))return null}else r=i(r,a,e.typeAnnotation||"coerce");else r=i(r,a,e.typeAnnotation||"assert")}if(!(r instanceof xe)&&function e(t){if(t instanceof De)return e(t.boundExpression);if(t instanceof Se&&"error"===t.name)return!1;if(t instanceof Pe)return!1;var i=t instanceof Te||t instanceof we,n=!0;return t.eachChild(function(t){n=i?n&&e(t):n&&t instanceof xe}),!!n&&(ze(t)&&Ae(t,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]))}(r)){var l=new Me;try{r=new xe(r.type,r.evaluate(l))}catch(t){return this.error(t.message),null}}return r}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof t+" instead.")},Oe.prototype.concat=function(t,e,i){var n="number"==typeof t?this.path.concat(t):this.path,o=i?this.scope.concat(i):this.scope;return new Oe(this.registry,n,e||null,o,this.errors)},Oe.prototype.error=function(t){for(var e=[],i=arguments.length-1;0<i--;)e[i]=arguments[i+1];var n=""+this.key+e.map(function(t){return"["+t+"]"}).join("");this.errors.push(new Jt(n,t))},Oe.prototype.checkSubtype=function(t,e){var i=he(t,e);return i&&this.error(i),i};var Be=function(t,e,i){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,o=i;n<o.length;n+=1){var r=o[n],a=r[0],s=r[1];this.labels.push(a),this.outputs.push(s)}};function Fe(t,e,i){return t*(1-i)+e*i}Be.parse=function(t,e){if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");var i=e.parse(t[1],1,te);if(!i)return null;var n=[],o=null;e.expectedType&&"value"!==e.expectedType.kind&&(o=e.expectedType);for(var r=1;r<t.length;r+=2){var a=1===r?-1/0:t[r],s=t[r+1],l=r,u=r+1;if("number"!=typeof a)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',l);if(n.length&&n[n.length-1][0]>=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var c=e.parse(s,u,o);if(!c)return null;o=o||c.type,n.push([a,c])}return new Be(o,i,n)},Be.prototype.evaluate=function(t){var e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return i[0].evaluate(t);var o=e.length;return n>=e[o-1]?i[o-1].evaluate(t):i[Re(e,n)].evaluate(t)},Be.prototype.eachChild=function(t){t(this.input);for(var e=0,i=this.outputs;e<i.length;e+=1)t(i[e])},Be.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.outputs.map(function(t){return t.possibleOutputs()}))},Be.prototype.serialize=function(){for(var t=["step",this.input.serialize()],e=0;e<this.labels.length;e++)0<e&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var Ue=Object.freeze({number:Fe,color:function(t,e,i){return new de(Fe(t.r,e.r,i),Fe(t.g,e.g,i),Fe(t.b,e.b,i),Fe(t.a,e.a,i))},array:function(t,i,n){return t.map(function(t,e){return Fe(t,i[e],n)})}}),Ne=4/29,je=6/29,$e=3*je*je,Ve=je*je*je,Ze=Math.PI/180,Ge=180/Math.PI;function qe(t){return Ve<t?Math.pow(t,1/3):t/$e+Ne}function He(t){return je<t?t*t*t:$e*(t-Ne)}function We(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Xe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Ke(t){var e=Xe(t.r),i=Xe(t.g),n=Xe(t.b),o=qe((.4124564*e+.3575761*i+.1804375*n)/.95047),r=qe((.2126729*e+.7151522*i+.072175*n)/1);return{l:116*r-16,a:500*(o-r),b:200*(r-qe((.0193339*e+.119192*i+.9503041*n)/1.08883)),alpha:t.a}}function Je(t){var e=(t.l+16)/116,i=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*He(e),i=.95047*He(i),n=1.08883*He(n),new de(We(3.2404542*i-1.5371385*e-.4985314*n),We(-.969266*i+1.8760108*e+.041556*n),We(.0556434*i-.2040259*e+1.0572252*n),t.alpha)}var Ye={forward:Ke,reverse:Je,interpolate:function(t,e,i){return{l:Fe(t.l,e.l,i),a:Fe(t.a,e.a,i),b:Fe(t.b,e.b,i),alpha:Fe(t.alpha,e.alpha,i)}}},Qe={forward:function(t){var e=Ke(t),i=e.l,n=e.a,o=e.b,r=Math.atan2(o,n)*Ge;return{h:r<0?360+r:r,c:Math.sqrt(n*n+o*o),l:i,alpha:t.a}},reverse:function(t){var e=t.h*Ze,i=t.c;return Je({l:t.l,a:Math.cos(e)*i,b:Math.sin(e)*i,alpha:t.alpha})},interpolate:function(t,e,i){return{h:function(t,e,i){var n=e-t;return t+i*(180<n||n<-180?n-360*Math.round(n/360):n)}(t.h,e.h,i),c:Fe(t.c,e.c,i),l:Fe(t.l,e.l,i),alpha:Fe(t.alpha,e.alpha,i)}}},ti=Object.freeze({lab:Ye,hcl:Qe}),ei=function(t,e,i,n,o){this.type=t,this.operator=e,this.interpolation=i,this.input=n,this.labels=[],this.outputs=[];for(var r=0,a=o;r<a.length;r+=1){var s=a[r],l=s[0],u=s[1];this.labels.push(l),this.outputs.push(u)}};function ii(t,e,i,n){var o=n-i,r=t-i;return 0==o?0:1===e?r/o:(Math.pow(e,r)-1)/(Math.pow(e,o)-1)}ei.interpolationFactor=function(t,e,i,n){var o=0;if("exponential"===t.name)o=ii(e,t.base,i,n);else if("linear"===t.name)o=ii(e,1,i,n);else if("cubic-bezier"===t.name){var r=t.controlPoints;o=new a(r[0],r[1],r[2],r[3]).solve(ii(e,1,i,n))}return o},ei.parse=function(t,e){var i=t[0],n=t[1],o=t[2],r=t.slice(3);if(!Array.isArray(n)||0===n.length)return e.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){var a=n[1];if("number"!=typeof a)return e.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:a}}else{if("cubic-bezier"!==n[0])return e.error("Unknown interpolation type "+String(n[0]),1,0);var s=n.slice(1);if(4!==s.length||s.some(function(t){return"number"!=typeof t||t<0||1<t}))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(o=e.parse(o,2,te)))return null;var l=[],u=null;"interpolate-hcl"===i||"interpolate-lab"===i?u=ne:e.expectedType&&"value"!==e.expectedType.kind&&(u=e.expectedType);for(var c=0;c<r.length;c+=2){var h=r[c],p=r[c+1],d=c+3,f=c+4;if("number"!=typeof h)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',d);if(l.length&&l[l.length-1][0]>=h)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',d);var m=e.parse(p,f,u);if(!m)return null;u=u||m.type,l.push([h,m])}return"number"===u.kind||"color"===u.kind||"array"===u.kind&&"number"===u.itemType.kind&&"number"==typeof u.N?new ei(u,i,n,o,l):e.error("Type "+ue(u)+" is not interpolatable.")},ei.prototype.evaluate=function(t){var e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return i[0].evaluate(t);var o=e.length;if(n>=e[o-1])return i[o-1].evaluate(t);var r=Re(e,n),a=e[r],s=e[r+1],l=ei.interpolationFactor(this.interpolation,n,a,s),u=i[r].evaluate(t),c=i[r+1].evaluate(t);return"interpolate"===this.operator?Ue[this.type.kind.toLowerCase()](u,c,l):"interpolate-hcl"===this.operator?Qe.reverse(Qe.interpolate(Qe.forward(u),Qe.forward(c),l)):Ye.reverse(Ye.interpolate(Ye.forward(u),Ye.forward(c),l))},ei.prototype.eachChild=function(t){t(this.input);for(var e=0,i=this.outputs;e<i.length;e+=1)t(i[e])},ei.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.outputs.map(function(t){return t.possibleOutputs()}))},ei.prototype.serialize=function(){var t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var e=[this.operator,t,this.input.serialize()],i=0;i<this.labels.length;i++)e.push(this.labels[i],this.outputs[i].serialize());return e};var ni=function(t,e){this.type=t,this.args=e};ni.parse=function(t,e){if(t.length<2)return e.error("Expectected at least one argument.");var i=null,n=e.expectedType;n&&"value"!==n.kind&&(i=n);for(var o=[],r=0,a=t.slice(1);r<a.length;r+=1){var s=a[r],l=e.parse(s,1+o.length,i,void 0,{typeAnnotation:"omit"});if(!l)return null;i=i||l.type,o.push(l)}var u=n&&o.some(function(t){return he(n,t.type)});return new ni(u?re:i,o)},ni.prototype.evaluate=function(t){for(var e=null,i=0,n=this.args;i<n.length&&null===(e=n[i].evaluate(t));i+=1);return e},ni.prototype.eachChild=function(t){this.args.forEach(t)},ni.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.args.map(function(t){return t.possibleOutputs()}))},ni.prototype.serialize=function(){var e=["coalesce"];return this.eachChild(function(t){e.push(t.serialize())}),e};var oi=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};oi.prototype.evaluate=function(t){return this.result.evaluate(t)},oi.prototype.eachChild=function(t){for(var e=0,i=this.bindings;e<i.length;e+=1)t(i[e][1]);t(this.result)},oi.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found "+(t.length-1)+" instead.");for(var i=[],n=1;n<t.length-1;n+=2){var o=t[n];if("string"!=typeof o)return e.error("Expected string, but found "+typeof o+" instead.",n);if(/[^a-zA-Z0-9_]/.test(o))return e.error("Variable names must contain only alphanumeric characters or '_'.",n);var r=e.parse(t[n+1],n+1);if(!r)return null;i.push([o,r])}var a=e.parse(t[t.length-1],t.length-1,e.expectedType,i);return a?new oi(i,a):null},oi.prototype.possibleOutputs=function(){return this.result.possibleOutputs()},oi.prototype.serialize=function(){for(var t=["let"],e=0,i=this.bindings;e<i.length;e+=1){var n=i[e],o=n[0],r=n[1];t.push(o,r.serialize())}return t.push(this.result.serialize()),t};function ri(t,e,i){this.type=t,this.index=e,this.input=i}ri.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var i=e.parse(t[1],1,te),n=e.parse(t[2],2,le(e.expectedType||re));if(!i||!n)return null;var o=n.type;return new ri(o.itemType,i,n)},ri.prototype.evaluate=function(t){var e=this.index.evaluate(t),i=this.input.evaluate(t);if(e<0)throw new be("Array index out of bounds: "+e+" < 0.");if(e>=i.length)throw new be("Array index out of bounds: "+e+" > "+(i.length-1)+".");if(e!==Math.floor(e))throw new be("Array index must be an integer, but found "+e+" instead.");return i[e]},ri.prototype.eachChild=function(t){t(this.index),t(this.input)},ri.prototype.possibleOutputs=function(){return[void 0]},ri.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};function ai(t,e,i,n,o,r){this.inputType=t,this.type=e,this.input=i,this.cases=n,this.outputs=o,this.otherwise=r}ai.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var i,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var o={},r=[],a=2;a<t.length-1;a+=2){var s=t[a],l=t[a+1];Array.isArray(s)||(s=[s]);var u=e.concat(a);if(0===s.length)return u.error("Expected at least one branch label.");for(var c=0,h=s;c<h.length;c+=1){var p=h[c];if("number"!=typeof p&&"string"!=typeof p)return u.error("Branch labels must be numbers or strings.");if("number"==typeof p&&Math.abs(p)>Number.MAX_SAFE_INTEGER)return u.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof p&&Math.floor(p)!==p)return u.error("Numeric branch labels must be integer values.");if(i){if(u.checkSubtype(i,ye(p)))return null}else i=ye(p);if(void 0!==o[String(p)])return u.error("Branch labels must be unique.");o[String(p)]=r.length}var d=e.parse(l,a,n);if(!d)return null;n=n||d.type,r.push(d)}var f=e.parse(t[1],1,re);if(!f)return null;var m=e.parse(t[t.length-1],t.length-1,n);return m?"value"!==f.type.kind&&e.concat(1).checkSubtype(i,f.type)?null:new ai(i,n,f,o,r,m):null},ai.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(ye(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},ai.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},ai.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.outputs.map(function(t){return t.possibleOutputs()})).concat(this.otherwise.possibleOutputs())},ai.prototype.serialize=function(){for(var e=this,t=["match",this.input.serialize()],i=[],n={},o=0,r=Object.keys(this.cases).sort();o<r.length;o+=1){var a=r[o];void 0===(h=n[this.cases[a]])?(n[this.cases[a]]=i.length,i.push([this.cases[a],[a]])):i[h][1].push(a)}for(var s=function(t){return"number"===e.inputType.kind?Number(t):t},l=0,u=i;l<u.length;l+=1){var c=u[l],h=c[0],p=c[1];1===p.length?t.push(s(p[0])):t.push(p.map(s)),t.push(this.outputs[outputIndex$1].serialize())}return t.push(this.otherwise.serialize()),t};function si(t,e,i){this.type=t,this.branches=e,this.otherwise=i}function li(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function ui(t,e,i,n){return 0===n.compare(e,i)}function ci(s,l,u){var c="=="!==s&&"!="!==s;return a.parse=function(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");var i=t[0],n=e.parse(t[1],1,re);if(!n)return null;if(!li(i,n.type))return e.concat(1).error('"'+i+"\" comparisons are not supported for type '"+ue(n.type)+"'.");var o=e.parse(t[2],2,re);if(!o)return null;if(!li(i,o.type))return e.concat(2).error('"'+i+"\" comparisons are not supported for type '"+ue(o.type)+"'.");if(n.type.kind!==o.type.kind&&"value"!==n.type.kind&&"value"!==o.type.kind)return e.error("Cannot compare types '"+ue(n.type)+"' and '"+ue(o.type)+"'.");c&&("value"===n.type.kind&&"value"!==o.type.kind?n=new we(o.type,[n]):"value"!==n.type.kind&&"value"===o.type.kind&&(o=new we(n.type,[o])));var r=null;if(4===t.length){if("string"!==n.type.kind&&"string"!==o.type.kind&&"value"!==n.type.kind&&"value"!==o.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(r=e.parse(t[3],3,ae)))return null}return new a(n,o,r)},a.prototype.evaluate=function(t){var e=this.lhs.evaluate(t),i=this.rhs.evaluate(t);if(c&&this.hasUntypedArgument){var n=ye(e),o=ye(i);if(n.kind!==o.kind||"string"!==n.kind&&"number"!==n.kind)throw new be('Expected arguments for "'+s+'" to be (string, string) or (number, number), but found ('+n.kind+", "+o.kind+") instead.")}if(this.collator&&!c&&this.hasUntypedArgument){var r=ye(e),a=ye(i);if("string"!==r.kind||"string"!==a.kind)return l(t,e,i)}return this.collator?u(t,e,i,this.collator.evaluate(t)):l(t,e,i)},a.prototype.eachChild=function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)},a.prototype.possibleOutputs=function(){return[!0,!1]},a.prototype.serialize=function(){var e=[s];return this.eachChild(function(t){e.push(t.serialize())}),e},a;function a(t,e,i){this.type=ie,this.lhs=t,this.rhs=e,this.collator=i,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}}si.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found only "+(t.length-1)+".");if(t.length%2!=0)return e.error("Expected an odd number of arguments.");var i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(var n=[],o=1;o<t.length-1;o+=2){var r=e.parse(t[o],o,ie);if(!r)return null;var a=e.parse(t[o+1],o+1,i);if(!a)return null;n.push([r,a]),i=i||a.type}var s=e.parse(t[t.length-1],t.length-1,i);return s?new si(i,n,s):null},si.prototype.evaluate=function(t){for(var e=0,i=this.branches;e<i.length;e+=1){var n=i[e],o=n[0],r=n[1];if(o.evaluate(t))return r.evaluate(t)}return this.otherwise.evaluate(t)},si.prototype.eachChild=function(t){for(var e=0,i=this.branches;e<i.length;e+=1){var n=i[e],o=n[0],r=n[1];t(o),t(r)}t(this.otherwise)},si.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.branches.map(function(t){return t[0],t[1].possibleOutputs()})).concat(this.otherwise.possibleOutputs())},si.prototype.serialize=function(){var e=["case"];return this.eachChild(function(t){e.push(t.serialize())}),e};function hi(t,e,i,n,o){this.type=ee,this.number=t,this.locale=e,this.currency=i,this.minFractionDigits=n,this.maxFractionDigits=o}var pi=ci("==",function(t,e,i){return e===i},ui),di=ci("!=",function(t,e,i){return e!==i},function(t,e,i,n){return!ui(0,e,i,n)}),fi=ci("<",function(t,e,i){return e<i},function(t,e,i,n){return n.compare(e,i)<0}),mi=ci(">",function(t,e,i){return i<e},function(t,e,i,n){return 0<n.compare(e,i)}),_i=ci("<=",function(t,e,i){return e<=i},function(t,e,i,n){return n.compare(e,i)<=0}),gi=ci(">=",function(t,e,i){return i<=e},function(t,e,i,n){return 0<=n.compare(e,i)});hi.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var i=e.parse(t[1],1,te);if(!i)return null;var n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");var o=null;if(n.locale&&!(o=e.parse(n.locale,1,ee)))return null;var r=null;if(n.currency&&!(r=e.parse(n.currency,1,ee)))return null;var a=null;if(n["min-fraction-digits"]&&!(a=e.parse(n["min-fraction-digits"],1,te)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,te))?null:new hi(i,o,r,a,s)},hi.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},hi.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},hi.prototype.possibleOutputs=function(){return[void 0]},hi.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};function yi(t){this.type=te,this.input=t}yi.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var i=e.parse(t[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?e.error("Expected argument of type string or array, but found "+ue(i.type)+" instead."):new yi(i):null},yi.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new be("Expected value to be of type string or array, but found "+ue(ye(e))+" instead.")},yi.prototype.eachChild=function(t){t(this.input)},yi.prototype.possibleOutputs=function(){return[void 0]},yi.prototype.serialize=function(){var e=["length"];return this.eachChild(function(t){e.push(t.serialize())}),e};var vi={"==":pi,"!=":di,">":mi,"<":fi,">=":gi,"<=":_i,array:we,at:ri,boolean:we,case:si,coalesce:ni,collator:Pe,format:ke,interpolate:ei,"interpolate-hcl":ei,"interpolate-lab":ei,length:yi,let:oi,literal:xe,match:ai,number:we,"number-format":hi,object:we,step:Be,string:we,"to-boolean":Te,"to-color":Te,"to-number":Te,"to-string":Te,var:De};function xi(t,e){var i=e[0],n=e[1],o=e[2],r=e[3];i=i.evaluate(t),n=n.evaluate(t),o=o.evaluate(t);var a=r?r.evaluate(t):1,s=ge(i,n,o,a);if(s)throw new be(s);return new de(i/255*a,n/255*a,o/255*a,a)}function bi(t,e){return t in e}function wi(t,e){var i=e[t];return void 0===i?null:i}function Li(t){return{type:t}}function ki(t){return{result:"success",value:t}}function Ti(t){return{result:"error",value:t}}function Ei(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Mi(t){return!!t.expression&&-1<t.expression.parameters.indexOf("zoom")}function Ci(t){return!!t.expression&&t.expression.interpolated}function Si(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Pi(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function zi(t){return t}function Ii(t,e,i){return void 0!==t?t:void 0!==e?e:void 0!==i?i:void 0}function Ai(t,e,i,n,o){return Ii(typeof i===o?n[i]:void 0,t.default,e.default)}function Di(t,e,i){if("number"!==Si(i))return Ii(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[n-1][0])return t.stops[n-1][1];var o=Re(t.stops.map(function(t){return t[0]}),i);return t.stops[o][1]}function Oi(t,e,i){var n=void 0!==t.base?t.base:1;if("number"!==Si(i))return Ii(t.default,e.default);var o=t.stops.length;if(1===o)return t.stops[0][1];if(i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[o-1][0])return t.stops[o-1][1];var r,a,s,l,u,c=Re(t.stops.map(function(t){return t[0]}),i),h=(r=i,a=n,s=t.stops[c][0],l=t.stops[c+1][0]-s,u=r-s,0==l?0:1===a?u/l:(Math.pow(a,u)-1)/(Math.pow(a,l)-1)),p=t.stops[c][1],d=t.stops[c+1][1],f=Ue[e.type]||zi;if(t.colorSpace&&"rgb"!==t.colorSpace){var m=ti[t.colorSpace];f=function(t,e){return m.reverse(m.interpolate(m.forward(t),m.forward(e),h))}}return"function"==typeof p.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var i=p.evaluate.apply(void 0,t),n=d.evaluate.apply(void 0,t);if(void 0!==i&&void 0!==n)return f(i,n,h)}}:f(p,d,h)}function Ri(t,e,i){return"color"===e.type?i=de.parse(i):"formatted"===e.type?i=_e.fromString(i.toString()):Si(i)===e.type||"enum"===e.type&&e.values[i]||(i=void 0),Ii(i,t.default,e.default)}Se.register(vi,{error:[{kind:"error"},[ee],function(t,e){var i=e[0];throw new be(i.evaluate(t))}],typeof:[ee,[re],function(t,e){return ue(ye(e[0].evaluate(t)))}],"to-rgba":[le(te,4),[ne],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[ne,[te,te,te],xi],rgba:[ne,[te,te,te,te],xi],has:{type:ie,overloads:[[[ee],function(t,e){return bi(e[0].evaluate(t),t.properties())}],[[ee,oe],function(t,e){var i=e[0],n=e[1];return bi(i.evaluate(t),n.evaluate(t))}]]},get:{type:re,overloads:[[[ee],function(t,e){return wi(e[0].evaluate(t),t.properties())}],[[ee,oe],function(t,e){var i=e[0],n=e[1];return wi(i.evaluate(t),n.evaluate(t))}]]},"feature-state":[re,[ee],function(t,e){return wi(e[0].evaluate(t),t.featureState||{})}],properties:[oe,[],function(t){return t.properties()}],"geometry-type":[ee,[],function(t){return t.geometryType()}],id:[re,[],function(t){return t.id()}],zoom:[te,[],function(t){return t.globals.zoom}],"heatmap-density":[te,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[te,[],function(t){return t.globals.lineProgress||0}],accumulated:[re,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[te,Li(te),function(t,e){for(var i=0,n=0,o=e;n<o.length;n+=1)i+=o[n].evaluate(t);return i}],"*":[te,Li(te),function(t,e){for(var i=1,n=0,o=e;n<o.length;n+=1)i*=o[n].evaluate(t);return i}],"-":{type:te,overloads:[[[te,te],function(t,e){var i=e[0],n=e[1];return i.evaluate(t)-n.evaluate(t)}],[[te],function(t,e){return-e[0].evaluate(t)}]]},"/":[te,[te,te],function(t,e){var i=e[0],n=e[1];return i.evaluate(t)/n.evaluate(t)}],"%":[te,[te,te],function(t,e){var i=e[0],n=e[1];return i.evaluate(t)%n.evaluate(t)}],ln2:[te,[],function(){return Math.LN2}],pi:[te,[],function(){return Math.PI}],e:[te,[],function(){return Math.E}],"^":[te,[te,te],function(t,e){var i=e[0],n=e[1];return Math.pow(i.evaluate(t),n.evaluate(t))}],sqrt:[te,[te],function(t,e){var i=e[0];return Math.sqrt(i.evaluate(t))}],log10:[te,[te],function(t,e){var i=e[0];return Math.log(i.evaluate(t))/Math.LN10}],ln:[te,[te],function(t,e){var i=e[0];return Math.log(i.evaluate(t))}],log2:[te,[te],function(t,e){var i=e[0];return Math.log(i.evaluate(t))/Math.LN2}],sin:[te,[te],function(t,e){var i=e[0];return Math.sin(i.evaluate(t))}],cos:[te,[te],function(t,e){var i=e[0];return Math.cos(i.evaluate(t))}],tan:[te,[te],function(t,e){var i=e[0];return Math.tan(i.evaluate(t))}],asin:[te,[te],function(t,e){var i=e[0];return Math.asin(i.evaluate(t))}],acos:[te,[te],function(t,e){var i=e[0];return Math.acos(i.evaluate(t))}],atan:[te,[te],function(t,e){var i=e[0];return Math.atan(i.evaluate(t))}],min:[te,Li(te),function(e,t){return Math.min.apply(Math,t.map(function(t){return t.evaluate(e)}))}],max:[te,Li(te),function(e,t){return Math.max.apply(Math,t.map(function(t){return t.evaluate(e)}))}],abs:[te,[te],function(t,e){var i=e[0];return Math.abs(i.evaluate(t))}],round:[te,[te],function(t,e){var i=e[0].evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[te,[te],function(t,e){var i=e[0];return Math.floor(i.evaluate(t))}],ceil:[te,[te],function(t,e){var i=e[0];return Math.ceil(i.evaluate(t))}],"filter-==":[ie,[ee,re],function(t,e){var i=e[0],n=e[1];return t.properties()[i.value]===n.value}],"filter-id-==":[ie,[re],function(t,e){var i=e[0];return t.id()===i.value}],"filter-type-==":[ie,[ee],function(t,e){var i=e[0];return t.geometryType()===i.value}],"filter-<":[ie,[ee,re],function(t,e){var i=e[0],n=e[1],o=t.properties()[i.value],r=n.value;return typeof o==typeof r&&o<r}],"filter-id-<":[ie,[re],function(t,e){var i=e[0],n=t.id(),o=i.value;return typeof n==typeof o&&n<o}],"filter->":[ie,[ee,re],function(t,e){var i=e[0],n=e[1],o=t.properties()[i.value],r=n.value;return typeof o==typeof r&&r<o}],"filter-id->":[ie,[re],function(t,e){var i=e[0],n=t.id(),o=i.value;return typeof n==typeof o&&o<n}],"filter-<=":[ie,[ee,re],function(t,e){var i=e[0],n=e[1],o=t.properties()[i.value],r=n.value;return typeof o==typeof r&&o<=r}],"filter-id-<=":[ie,[re],function(t,e){var i=e[0],n=t.id(),o=i.value;return typeof n==typeof o&&n<=o}],"filter->=":[ie,[ee,re],function(t,e){var i=e[0],n=e[1],o=t.properties()[i.value],r=n.value;return typeof o==typeof r&&r<=o}],"filter-id->=":[ie,[re],function(t,e){var i=e[0],n=t.id(),o=i.value;return typeof n==typeof o&&o<=n}],"filter-has":[ie,[re],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[ie,[],function(t){return null!==t.id()}],"filter-type-in":[ie,[le(ee)],function(t,e){return 0<=e[0].value.indexOf(t.geometryType())}],"filter-id-in":[ie,[le(re)],function(t,e){return 0<=e[0].value.indexOf(t.id())}],"filter-in-small":[ie,[ee,le(re)],function(t,e){var i=e[0];return 0<=e[1].value.indexOf(t.properties()[i.value])}],"filter-in-large":[ie,[ee,le(re)],function(t,e){var i=e[0],n=e[1];return function(t,e,i,n){for(;i<=n;){var o=i+n>>1;if(e[o]===t)return!0;e[o]>t?n=o-1:i=1+o}return!1}(t.properties()[i.value],n.value,0,n.value.length-1)}],all:{type:ie,overloads:[[[ie,ie],function(t,e){var i=e[0],n=e[1];return i.evaluate(t)&&n.evaluate(t)}],[Li(ie),function(t,e){for(var i=0,n=e;i<n.length;i+=1)if(!n[i].evaluate(t))return!1;return!0}]]},any:{type:ie,overloads:[[[ie,ie],function(t,e){var i=e[0],n=e[1];return i.evaluate(t)||n.evaluate(t)}],[Li(ie),function(t,e){for(var i=0,n=e;i<n.length;i+=1)if(n[i].evaluate(t))return!0;return!1}]]},"!":[ie,[ie],function(t,e){return!e[0].evaluate(t)}],"is-supported-script":[ie,[ee],function(t,e){var i=e[0],n=t.globals&&t.globals.isSupportedScript;return!n||n(i.evaluate(t))}],upcase:[ee,[ee],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[ee,[ee],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[ee,Li(re),function(e,t){return t.map(function(t){return ve(t.evaluate(e))}).join("")}],"resolved-locale":[ee,[ae],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var Bi=function(t,e){var i;this.expression=t,this._warningHistory={},this._evaluator=new Me,this._defaultValue=e?"color"===(i=e).type&&Pi(i.default)?new de(0,0,0,0):"color"===i.type?de.parse(i.default)||null:void 0===i.default?null:i.default:null,this._enumValues=e&&"enum"===e.type?e.values:null};function Fi(t){return Array.isArray(t)&&0<t.length&&"string"==typeof t[0]&&t[0]in vi}function Ui(t,e){var i,n,o=new Oe(vi,[],e?(n={color:ne,string:ee,number:te,enum:ee,boolean:ie,formatted:se},"array"===(i=e).type?le(n[i.value]||re,i.length):n[i.type]):void 0),r=o.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return r?ki(new Bi(r,e)):Ti(o.errors)}Bi.prototype.evaluateWithoutErrorHandling=function(t,e,i){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=i,this.expression.evaluate(this._evaluator)},Bi.prototype.evaluate=function(t,e,i){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=i||null;try{var n=this.expression.evaluate(this._evaluator);if(null==n)return this._defaultValue;if(this._enumValues&&!(n in this._enumValues))throw new be("Expected value to be one of "+Object.keys(this._enumValues).map(function(t){return JSON.stringify(t)}).join(", ")+", but found "+JSON.stringify(n)+" instead.");return n}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Ni=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Ie(e.expression)};Ni.prototype.evaluateWithoutErrorHandling=function(t,e,i){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i)},Ni.prototype.evaluate=function(t,e,i){return this._styleExpression.evaluate(t,e,i)};var ji=function(t,e,i){this.kind=t,this.zoomStops=i.labels,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Ie(e.expression),i instanceof ei&&(this.interpolationType=i.interpolation)};function $i(t,e){if("error"===(t=Ui(t,e)).result)return t;var i=t.value.expression,n=ze(i);if(!n&&!Ei(e))return Ti([new Jt("","data expressions not supported")]);var o=Ae(i,["zoom"]);if(!o&&!Mi(e))return Ti([new Jt("","zoom expressions not supported")]);var r=function i(t){var n=null;if(t instanceof oi)n=i(t.result);else if(t instanceof ni)for(var e=0,o=t.args;e<o.length;e+=1){var r=o[e];if(n=i(r))break}else(t instanceof Be||t instanceof ei)&&t.input instanceof Se&&"zoom"===t.input.name&&(n=t);return n instanceof Jt||t.eachChild(function(t){var e=i(t);e instanceof Jt?n=e:!n&&e?n=new Jt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):n&&e&&n!==e&&(n=new Jt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),n}(i);return r||o?r instanceof Jt?Ti([r]):r instanceof ei&&!Ci(e)?Ti([new Jt("",'"interpolate" expressions cannot be used with this property')]):ki(r?new ji(n?"camera":"composite",t.value,r):new Ni(n?"constant":"source",t.value)):Ti([new Jt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}ji.prototype.evaluateWithoutErrorHandling=function(t,e,i){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i)},ji.prototype.evaluate=function(t,e,i){return this._styleExpression.evaluate(t,e,i)},ji.prototype.interpolationFactor=function(t,e,i){return this.interpolationType?ei.interpolationFactor(this.interpolationType,t,e,i):0};function Vi(t,e){this._parameters=t,this._specification=e,Gt(this,function t(n,o){var r,a,s,e="color"===o.type,i=n.stops&&"object"==typeof n.stops[0][0],l=i||void 0!==n.property,u=i||!l,c=n.type||(Ci(o)?"exponential":"interval");if(e&&((n=Gt({},n)).stops&&(n.stops=n.stops.map(function(t){return[t[0],de.parse(t[1])]})),n.default?n.default=de.parse(n.default):n.default=de.parse(o.default)),n.colorSpace&&"rgb"!==n.colorSpace&&!ti[n.colorSpace])throw new Error("Unknown color space: "+n.colorSpace);if("exponential"===c)r=Oi;else if("interval"===c)r=Di;else if("categorical"===c){r=Ai,a=Object.create(null);for(var h=0,p=n.stops;h<p.length;h+=1){var d=p[h];a[d[0]]=d[1]}s=typeof n.stops[0][0]}else{if("identity"!==c)throw new Error('Unknown function type "'+c+'"');r=Ri}if(i){for(var f={},m=[],_=0;_<n.stops.length;_++){var g=n.stops[_],y=g[0].zoom;void 0===f[y]&&(f[y]={zoom:y,type:n.type,property:n.property,default:n.default,stops:[]},m.push(y)),f[y].stops.push([g[0].value,g[1]])}for(var v=[],x=0,b=m;x<b.length;x+=1){var w=b[x];v.push([f[w].zoom,t(f[w],o)])}var L={name:"linear"};return{kind:"composite",interpolationType:L,interpolationFactor:ei.interpolationFactor.bind(void 0,L),zoomStops:v.map(function(t){return t[0]}),evaluate:function(t,e){var i=t.zoom;return Oi({stops:v,base:n.base},o,i).evaluate(i,e)}}}if(u){var k="exponential"===c?{name:"exponential",base:void 0!==n.base?n.base:1}:null;return{kind:"camera",interpolationType:k,interpolationFactor:ei.interpolationFactor.bind(void 0,k),zoomStops:n.stops.map(function(t){return t[0]}),evaluate:function(t){var e=t.zoom;return r(n,o,e,a,s)}}}return{kind:"source",evaluate:function(t,e){var i=e&&e.properties?e.properties[n.property]:void 0;return void 0===i?Ii(n.default,o.default):r(n,o,i,a,s)}}}(this._parameters,this._specification))}function Zi(t){var e=t.key,i=t.value,n=t.valueSpec||{},o=t.objectElementValidators||{},r=t.style,a=t.styleSpec,s=[],l=Si(i);if("object"!==l)return[new Vt(e,i,"object expected, "+l+" found")];for(var u in i){var c=u.split(".")[0],h=n[c]||n["*"],p=void 0;if(o[c])p=o[c];else if(n[c])p=mn;else if(o["*"])p=o["*"];else{if(!n["*"]){s.push(new Vt(e,i[u],'unknown property "'+u+'"'));continue}p=mn}s=s.concat(p({key:(e?e+".":e)+u,value:i[u],valueSpec:h,style:r,styleSpec:a,object:i,objectKey:u},i))}for(var d in n)o[d]||n[d].required&&void 0===n[d].default&&void 0===i[d]&&s.push(new Vt(e,i,'missing required property "'+d+'"'));return s}function Gi(t){var e=t.value,i=t.valueSpec,n=t.style,o=t.styleSpec,r=t.key,a=t.arrayElementValidator||mn;if("array"!==Si(e))return[new Vt(r,e,"array expected, "+Si(e)+" found")];if(i.length&&e.length!==i.length)return[new Vt(r,e,"array length "+i.length+" expected, length "+e.length+" found")];if(i["min-length"]&&e.length<i["min-length"])return[new Vt(r,e,"array length at least "+i["min-length"]+" expected, length "+e.length+" found")];var s={type:i.value,values:i.values};o.$version<7&&(s.function=i.function),"object"===Si(i.value)&&(s=i.value);for(var l=[],u=0;u<e.length;u++)l=l.concat(a({array:e,arrayIndex:u,value:e[u],valueSpec:s,style:n,styleSpec:o,key:r+"["+u+"]"}));return l}function qi(t){var e=t.key,i=t.value,n=t.valueSpec,o=Si(i);return"number"!==o?[new Vt(e,i,"number expected, "+o+" found")]:"minimum"in n&&i<n.minimum?[new Vt(e,i,i+" is less than the minimum value "+n.minimum)]:"maximum"in n&&i>n.maximum?[new Vt(e,i,i+" is greater than the maximum value "+n.maximum)]:[]}function Hi(t){var a,s,o,l=t.valueSpec,u=Ht(t.value.type),c={},e="categorical"!==u&&void 0===t.value.property,i=!e,r="array"===Si(t.value.stops)&&"array"===Si(t.value.stops[0])&&"object"===Si(t.value.stops[0][0]),n=Zi({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===u)return[new Vt(t.key,t.value,'identity function may not have a "stops" property')];var e=[],i=t.value;return e=e.concat(Gi({key:t.key,value:i,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===Si(i)&&0===i.length&&e.push(new Vt(t.key,i,"array must have at least one stop")),e},default:function(t){return mn({key:t.key,value:t.value,valueSpec:l,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===u&&e&&n.push(new Vt(t.key,t.value,'missing required property "property"')),"identity"===u||t.value.stops||n.push(new Vt(t.key,t.value,'missing required property "stops"')),"exponential"===u&&t.valueSpec.expression&&!Ci(t.valueSpec)&&n.push(new Vt(t.key,t.value,"exponential functions not supported")),8<=t.styleSpec.$version&&(i&&!Ei(t.valueSpec)?n.push(new Vt(t.key,t.value,"property functions not supported")):e&&!Mi(t.valueSpec)&&n.push(new Vt(t.key,t.value,"zoom functions not supported"))),"categorical"!==u&&!r||void 0!==t.value.property||n.push(new Vt(t.key,t.value,'"property" property is required')),n;function h(t){var e=[],i=t.value,n=t.key;if("array"!==Si(i))return[new Vt(n,i,"array expected, "+Si(i)+" found")];if(2!==i.length)return[new Vt(n,i,"array length 2 expected, length "+i.length+" found")];if(r){if("object"!==Si(i[0]))return[new Vt(n,i,"object expected, "+Si(i[0])+" found")];if(void 0===i[0].zoom)return[new Vt(n,i,"object stop key must have zoom")];if(void 0===i[0].value)return[new Vt(n,i,"object stop key must have value")];if(o&&o>Ht(i[0].zoom))return[new Vt(n,i[0].zoom,"stop zoom values must appear in ascending order")];Ht(i[0].zoom)!==o&&(o=Ht(i[0].zoom),s=void 0,c={}),e=e.concat(Zi({key:n+"[0]",value:i[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:qi,value:p}}))}else e=e.concat(p({key:n+"[0]",value:i[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},i));return Fi(Wt(i[1]))?e.concat([new Vt(n+"[1]",i[1],"expressions are not allowed in function stops.")]):e.concat(mn({key:n+"[1]",value:i[1],valueSpec:l,style:t.style,styleSpec:t.styleSpec}))}function p(t,e){var i=Si(t.value),n=Ht(t.value),o=null!==t.value?t.value:e;if(a){if(i!==a)return[new Vt(t.key,o,i+" stop domain type must match previous stop domain type "+a)]}else a=i;if("number"!==i&&"string"!==i&&"boolean"!==i)return[new Vt(t.key,o,"stop domain value must be a number, string, or boolean")];if("number"===i||"categorical"===u)return"categorical"!==u||"number"!==i||isFinite(n)&&Math.floor(n)===n?"categorical"!==u&&"number"===i&&void 0!==s&&n<s?[new Vt(t.key,o,"stop domain values must appear in ascending order")]:(s=n,"categorical"===u&&n in c?[new Vt(t.key,o,"stop domain values must be unique")]:(c[n]=!0,[])):[new Vt(t.key,o,"integer expected, found "+n)];var r="number expected, "+i+" found";return Ei(l)&&void 0===u&&(r+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Vt(t.key,o,r)]}}function Wi(e){var t=("property"===e.expressionContext?$i:Ui)(Wt(e.value),e.valueSpec);if("error"===t.result)return t.value.map(function(t){return new Vt(""+e.key+t.key,e.value,t.message)});var i=t.value.expression||t.value._styleExpression.expression;if("property"===e.expressionContext&&"text-font"===e.propertyKey&&-1!==i.possibleOutputs().indexOf(void 0))return[new Vt(e.key,e.value,'Invalid data expression for "'+e.propertyKey+'". Output values must be contained as literals within the expression.')];if("property"===e.expressionContext&&"layout"===e.propertyType&&!Ie(i))return[new Vt(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===e.expressionContext&&!Ie(i))return[new Vt(e.key,e.value,'"feature-state" data expressions are not supported with filters.')];if(e.expressionContext&&0===e.expressionContext.indexOf("cluster")){if(!Ae(i,["zoom","feature-state"]))return[new Vt(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===e.expressionContext&&!ze(i))return[new Vt(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Xi(t){var e=t.key,i=t.value,n=t.valueSpec,o=[];return Array.isArray(n.values)?-1===n.values.indexOf(Ht(i))&&o.push(new Vt(e,i,"expected one of ["+n.values.join(", ")+"], "+JSON.stringify(i)+" found")):-1===Object.keys(n.values).indexOf(Ht(i))&&o.push(new Vt(e,i,"expected one of ["+Object.keys(n.values).join(", ")+"], "+JSON.stringify(i)+" found")),o}function Ki(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return 2<=t.length&&"$id"!==t[1]&&"$type"!==t[1];case"in":case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,i=t.slice(1);e<i.length;e+=1){var n=i[e];if(!Ki(n)&&"boolean"!=typeof n)return!1}return!0;default:return!0}}Vi.deserialize=function(t){return new Vi(t._parameters,t._specification)};var Ji={type:"boolean",default:!(Vi.serialize=function(t){return{_parameters:t._parameters,_specification:t._specification}}),transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Yi(t){if(null==t)return function(){return!0};Ki(t)||(t=tn(t));var i=Ui(t,Ji);if("error"===i.result)throw new Error(i.value.map(function(t){return t.key+": "+t.message}).join(", "));return function(t,e){return i.value.evaluate(t,e)}}function Qi(t,e){return t<e?-1:e<t?1:0}function tn(t){if(!t)return!0;var e,i=t[0];return t.length<=1?"any"!==i:"=="===i?en(t[1],t[2],"=="):"!="===i?rn(en(t[1],t[2],"==")):"<"===i||">"===i||"<="===i||">="===i?en(t[1],t[2],i):"any"===i?(e=t.slice(1),["any"].concat(e.map(tn))):"all"===i?["all"].concat(t.slice(1).map(tn)):"none"===i?["all"].concat(t.slice(1).map(tn).map(rn)):"in"===i?nn(t[1],t.slice(2)):"!in"===i?rn(nn(t[1],t.slice(2))):"has"===i?on(t[1]):"!has"!==i||rn(on(t[1]))}function en(t,e,i){switch(t){case"$type":return["filter-type-"+i,e];case"$id":return["filter-id-"+i,e];default:return["filter-"+i,t,e]}}function nn(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return 200<e.length&&!e.some(function(t){return typeof t!=typeof e[0]})?["filter-in-large",t,["literal",e.sort(Qi)]]:["filter-in-small",t,["literal",e]]}}function on(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function rn(t){return["!",t]}function an(t){return Ki(Wt(t.value))?Wi(Gt({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var i=e.value,n=e.key;if("array"!==Si(i))return[new Vt(n,i,"array expected, "+Si(i)+" found")];var o,r=e.styleSpec,a=[];if(i.length<1)return[new Vt(n,i,"filter array must have at least 1 element")];switch(a=a.concat(Xi({key:n+"[0]",value:i[0],valueSpec:r.filter_operator,style:e.style,styleSpec:e.styleSpec})),Ht(i[0])){case"<":case"<=":case">":case">=":2<=i.length&&"$type"===Ht(i[1])&&a.push(new Vt(n,i,'"$type" cannot be use with operator "'+i[0]+'"'));case"==":case"!=":3!==i.length&&a.push(new Vt(n,i,'filter array for operator "'+i[0]+'" must have 3 elements'));case"in":case"!in":2<=i.length&&"string"!==(o=Si(i[1]))&&a.push(new Vt(n+"[1]",i[1],"string expected, "+o+" found"));for(var s=2;s<i.length;s++)o=Si(i[s]),"$type"===Ht(i[1])?a=a.concat(Xi({key:n+"["+s+"]",value:i[s],valueSpec:r.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==o&&"number"!==o&&"boolean"!==o&&a.push(new Vt(n+"["+s+"]",i[s],"string, number, or boolean expected, "+o+" found"));break;case"any":case"all":case"none":for(var l=1;l<i.length;l++)a=a.concat(t({key:n+"["+l+"]",value:i[l],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":o=Si(i[1]),2!==i.length?a.push(new Vt(n,i,'filter array for "'+i[0]+'" operator must have 2 elements')):"string"!==o&&a.push(new Vt(n+"[1]",i[1],"string expected, "+o+" found"))}return a}(t)}function sn(t,e){var i=t.key,n=t.style,o=t.styleSpec,r=t.value,a=t.objectKey,s=o[e+"_"+t.layerType];if(!s)return[];var l=a.match(/^(.*)-transition$/);if("paint"===e&&l&&s[l[1]]&&s[l[1]].transition)return mn({key:i,value:r,valueSpec:o.transition,style:n,styleSpec:o});var u,c=t.valueSpec||s[a];if(!c)return[new Vt(i,r,'unknown property "'+a+'"')];if("string"===Si(r)&&Ei(c)&&!c.tokens&&(u=/^{([^}]+)}$/.exec(r)))return[new Vt(i,r,'"'+a+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(u[1])+" }`.")];var h=[];return"symbol"===t.layerType&&("text-field"===a&&n&&!n.glyphs&&h.push(new Vt(i,r,'use of "text-field" requires a style "glyphs" property')),"text-font"===a&&Pi(Wt(r))&&"identity"===Ht(r.type)&&h.push(new Vt(i,r,'"text-font" does not support identity functions'))),h.concat(mn({key:t.key,value:r,valueSpec:c,style:n,styleSpec:o,expressionContext:"property",propertyType:e,propertyKey:a}))}function ln(t){return sn(t,"paint")}function un(t){return sn(t,"layout")}function cn(t){var e=[],i=t.value,n=t.key,o=t.style,r=t.styleSpec;i.type||i.ref||e.push(new Vt(n,i,'either "type" or "ref" is required'));var a,s=Ht(i.type),l=Ht(i.ref);if(i.id)for(var u=Ht(i.id),c=0;c<t.arrayIndex;c++){var h=o.layers[c];Ht(h.id)===u&&e.push(new Vt(n,i.id,'duplicate layer id "'+i.id+'", previously used at line '+h.id.__line__))}if("ref"in i)["type","source","source-layer","filter","layout"].forEach(function(t){t in i&&e.push(new Vt(n,i[t],'"'+t+'" is prohibited for ref layers'))}),o.layers.forEach(function(t){Ht(t.id)===l&&(a=t)}),a?a.ref?e.push(new Vt(n,i.ref,"ref cannot reference another ref layer")):s=Ht(a.type):e.push(new Vt(n,i.ref,'ref layer "'+l+'" not found'));else if("background"!==s)if(i.source){var p=o.sources&&o.sources[i.source],d=p&&Ht(p.type);p?"vector"===d&&"raster"===s?e.push(new Vt(n,i.source,'layer "'+i.id+'" requires a raster source')):"raster"===d&&"raster"!==s?e.push(new Vt(n,i.source,'layer "'+i.id+'" requires a vector source')):"vector"!==d||i["source-layer"]?"raster-dem"===d&&"hillshade"!==s?e.push(new Vt(n,i.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==s||!i.paint||!i.paint["line-gradient"]||"geojson"===d&&p.lineMetrics||e.push(new Vt(n,i,'layer "'+i.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):e.push(new Vt(n,i,'layer "'+i.id+'" must specify a "source-layer"')):e.push(new Vt(n,i.source,'source "'+i.source+'" not found'))}else e.push(new Vt(n,i,'missing required property "source"'));return e=e.concat(Zi({key:n,value:i,valueSpec:r.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return mn({key:n+".type",value:i.type,valueSpec:r.layer.type,style:t.style,styleSpec:t.styleSpec,object:i,objectKey:"type"})},filter:an,layout:function(t){return Zi({layer:i,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return un(Gt({layerType:s},t))}}})},paint:function(t){return Zi({layer:i,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return ln(Gt({layerType:s},t))}}})}}}))}function hn(t){var e=t.value,i=t.key,n=t.styleSpec,o=t.style;if(!e.type)return[new Vt(i,e,'"type" is required')];var r,a=Ht(e.type);switch(a){case"vector":case"raster":case"raster-dem":if(r=Zi({key:i,value:e,valueSpec:n["source_"+a.replace("-","_")],style:t.style,styleSpec:n}),"url"in e)for(var s in e)["type","url","tileSize"].indexOf(s)<0&&r.push(new Vt(i+"."+s,e[s],'a source with a "url" property may not include a "'+s+'" property'));return r;case"geojson":if(r=Zi({key:i,value:e,valueSpec:n.source_geojson,style:o,styleSpec:n}),e.cluster)for(var l in e.clusterProperties){var u=e.clusterProperties[l],c=u[0],h=u[1],p="string"==typeof c?[c,["accumulated"],["get",l]]:c;r.push.apply(r,Wi({key:i+"."+l+".map",value:h,expressionContext:"cluster-map"})),r.push.apply(r,Wi({key:i+"."+l+".reduce",value:p,expressionContext:"cluster-reduce"}))}return r;case"video":return Zi({key:i,value:e,valueSpec:n.source_video,style:o,styleSpec:n});case"image":return Zi({key:i,value:e,valueSpec:n.source_image,style:o,styleSpec:n});case"canvas":return[new Vt(i,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Xi({key:i+".type",value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:o,styleSpec:n})}}function pn(t){var e=t.value,i=t.styleSpec,n=i.light,o=t.style,r=[],a=Si(e);if(void 0===e)return r;if("object"!==a)return r.concat([new Vt("light",e,"object expected, "+a+" found")]);for(var s in e){var l=s.match(/^(.*)-transition$/);r=l&&n[l[1]]&&n[l[1]].transition?r.concat(mn({key:s,value:e[s],valueSpec:i.transition,style:o,styleSpec:i})):n[s]?r.concat(mn({key:s,value:e[s],valueSpec:n[s],style:o,styleSpec:i})):r.concat([new Vt(s,e[s],'unknown property "'+s+'"')])}return r}function dn(t){var e=t.value,i=t.key,n=Si(e);return"string"!==n?[new Vt(i,e,"string expected, "+n+" found")]:[]}var fn={"*":function(){return[]},array:Gi,boolean:function(t){var e=t.value,i=t.key,n=Si(e);return"boolean"!==n?[new Vt(i,e,"boolean expected, "+n+" found")]:[]},number:qi,color:function(t){var e=t.key,i=t.value,n=Si(i);return"string"!==n?[new Vt(e,i,"color expected, "+n+" found")]:null===pe(i)?[new Vt(e,i,'color expected, "'+i+'" found')]:[]},constants:Zt,enum:Xi,filter:an,function:Hi,layer:cn,object:Zi,source:hn,light:pn,string:dn,formatted:function(t){return 0===dn(t).length?[]:Wi(t)}};function mn(t){var e=t.value,i=t.valueSpec,n=t.styleSpec;return i.expression&&Pi(Ht(e))?Hi(t):i.expression&&Fi(Wt(e))?Wi(t):i.type&&fn[i.type]?fn[i.type](t):Zi(Gt({},t,{valueSpec:i.type?n[i.type]:i}))}function _n(t){var e=t.value,i=t.key,n=dn(t);return n.length||(-1===e.indexOf("{fontstack}")&&n.push(new Vt(i,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&n.push(new Vt(i,e,'"glyphs" url must include a "{range}" token'))),n}function gn(t,e){e=e||$t;var i=[];return i=i.concat(mn({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:_n,"*":function(){return[]}}})),t.constants&&(i=i.concat(Zt({key:"constants",value:t.constants,style:t,styleSpec:e}))),yn(i)}function yn(t){return[].concat(t).sort(function(t,e){return t.line-e.line})}function vn(i){return function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return yn(i.apply(this,t))}}gn.source=vn(hn),gn.light=vn(pn),gn.layer=vn(cn),gn.filter=vn(an),gn.paintProperty=vn(ln),gn.layoutProperty=vn(un);var xn=gn,bn=xn.light,wn=xn.paintProperty,Ln=xn.layoutProperty;function kn(t,e){var i=!1;if(e&&e.length)for(var n=0,o=e;n<o.length;n+=1){var r=o[n];t.fire(new Nt(new Error(r.message))),i=!0}return i}var Tn=Mn,En=3;function Mn(t,e,i){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var o=new Int32Array(this.arrayBuffer);t=o[0],e=o[1],i=o[2],this.d=e+2*i;for(var r=0;r<this.d*this.d;r++){var a=o[En+r],s=o[En+r+1];n.push(a===s?null:o.subarray(a,s))}var l=o[En+n.length],u=o[En+n.length+1];this.keys=o.subarray(l,u),this.bboxes=o.subarray(u),this.insert=this._insertReadonly}else{this.d=e+2*i;for(var c=0;c<this.d*this.d;c++)n.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=i,this.scale=e/t,this.uid=0;var h=i/e*t;this.min=-h,this.max=t+h}Mn.prototype.insert=function(t,e,i,n,o){this._forEachCell(e,i,n,o,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(i),this.bboxes.push(n),this.bboxes.push(o)},Mn.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},Mn.prototype._insertCell=function(t,e,i,n,o,r){this.cells[o].push(r)},Mn.prototype.query=function(t,e,i,n,o){var r=this.min,a=this.max;if(t<=r&&e<=r&&a<=i&&a<=n&&!o)return Array.prototype.slice.call(this.keys);var s=[];return this._forEachCell(t,e,i,n,this._queryCell,s,{},o),s},Mn.prototype._queryCell=function(t,e,i,n,o,r,a,s){var l=this.cells[o];if(null!==l)for(var u=this.keys,c=this.bboxes,h=0;h<l.length;h++){var p=l[h];if(void 0===a[p]){var d=4*p;(s?s(c[0+d],c[1+d],c[2+d],c[3+d]):t<=c[2+d]&&e<=c[3+d]&&i>=c[0+d]&&n>=c[1+d])?(a[p]=!0,r.push(u[p])):a[p]=!1}}},Mn.prototype._forEachCell=function(t,e,i,n,o,r,a,s){for(var l=this._convertToCellCoord(t),u=this._convertToCellCoord(e),c=this._convertToCellCoord(i),h=this._convertToCellCoord(n),p=l;p<=c;p++)for(var d=u;d<=h;d++){var f=this.d*d+p;if((!s||s(this._convertFromCellCoord(p),this._convertFromCellCoord(d),this._convertFromCellCoord(p+1),this._convertFromCellCoord(d+1)))&&o.call(this,t,e,i,n,f,r,a,s))return}},Mn.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},Mn.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},Mn.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=En+this.cells.length+1+1,i=0,n=0;n<this.cells.length;n++)i+=this.cells[n].length;var o=new Int32Array(e+i+this.keys.length+this.bboxes.length);o[0]=this.extent,o[1]=this.n,o[2]=this.padding;for(var r=e,a=0;a<t.length;a++){var s=t[a];o[En+a]=r,o.set(s,r),r+=s.length}return o[En+t.length]=r,o.set(this.keys,r),r+=this.keys.length,o[En+t.length+1]=r,o.set(this.bboxes,r),r+=this.bboxes.length,o.buffer};var Cn=self.ImageData,Sn={};function Pn(t,e,i){void 0===i&&(i={}),Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),Sn[t]={klass:e,omit:i.omit||[],shallow:i.shallow||[]}}for(var zn in Pn("Object",Object),Tn.serialize=function(t,e){var i=t.toArrayBuffer();return e&&e.push(i),{buffer:i}},Tn.deserialize=function(t){return new Tn(t.buffer)},Pn("Grid",Tn),Pn("Color",de),Pn("Error",Error),Pn("StylePropertyFunction",Vi),Pn("StyleExpression",Bi,{omit:["_evaluator"]}),Pn("ZoomDependentExpression",ji),Pn("ZoomConstantExpression",Ni),Pn("CompoundExpression",Se,{omit:["_evaluate"]}),vi)vi[zn]._classRegistryKey||Pn("Expression_"+zn,vi[zn]);function In(t,e){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp)return t;if(t instanceof ArrayBuffer)return e&&e.push(t),t;if(ArrayBuffer.isView(t)){var i=t;return e&&e.push(i.buffer),i}if(t instanceof Cn)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){for(var n=[],o=0,r=t;o<r.length;o+=1){var a=r[o];n.push(In(a,e))}return n}if("object"!=typeof t)throw new Error("can't serialize object of type "+typeof t);var s=t.constructor,l=s._classRegistryKey;if(!l)throw new Error("can't serialize object of unregistered class");var u=s.serialize?s.serialize(t,e):{};if(!s.serialize){for(var c in t)if(t.hasOwnProperty(c)&&!(0<=Sn[l].omit.indexOf(c))){var h=t[c];u[c]=0<=Sn[l].shallow.indexOf(c)?h:In(h,e)}t instanceof Error&&(u.message=t.message)}if(u.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==l&&(u.$name=l),u}function An(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||t instanceof ArrayBuffer||ArrayBuffer.isView(t)||t instanceof Cn)return t;if(Array.isArray(t))return t.map(An);if("object"!=typeof t)throw new Error("can't deserialize object of type "+typeof t);var e=t.$name||"Object",i=Sn[e].klass;if(!i)throw new Error("can't deserialize unregistered class "+e);if(i.deserialize)return i.deserialize(t);for(var n=Object.create(i.prototype),o=0,r=Object.keys(t);o<r.length;o+=1){var a=r[o];if("$name"!==a){var s=t[a];n[a]=0<=Sn[e].shallow.indexOf(a)?s:An(s)}}return n}function Dn(){this.first=!0}var On={"Latin-1 Supplement":function(t){return 128<=t&&t<=255},Arabic:function(t){return 1536<=t&&t<=1791},"Arabic Supplement":function(t){return 1872<=t&&t<=1919},"Arabic Extended-A":function(t){return 2208<=t&&t<=2303},"Hangul Jamo":function(t){return 4352<=t&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return 5120<=t&&t<=5759},Khmer:function(t){return 6016<=t&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return 6320<=t&&t<=6399},"General Punctuation":function(t){return 8192<=t&&t<=8303},"Letterlike Symbols":function(t){return 8448<=t&&t<=8527},"Number Forms":function(t){return 8528<=t&&t<=8591},"Miscellaneous Technical":function(t){return 8960<=t&&t<=9215},"Control Pictures":function(t){return 9216<=t&&t<=9279},"Optical Character Recognition":function(t){return 9280<=t&&t<=9311},"Enclosed Alphanumerics":function(t){return 9312<=t&&t<=9471},"Geometric Shapes":function(t){return 9632<=t&&t<=9727},"Miscellaneous Symbols":function(t){return 9728<=t&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return 11008<=t&&t<=11263},"CJK Radicals Supplement":function(t){return 11904<=t&&t<=12031},"Kangxi Radicals":function(t){return 12032<=t&&t<=12255},"Ideographic Description Characters":function(t){return 12272<=t&&t<=12287},"CJK Symbols and Punctuation":function(t){return 12288<=t&&t<=12351},Hiragana:function(t){return 12352<=t&&t<=12447},Katakana:function(t){return 12448<=t&&t<=12543},Bopomofo:function(t){return 12544<=t&&t<=12591},"Hangul Compatibility Jamo":function(t){return 12592<=t&&t<=12687},Kanbun:function(t){return 12688<=t&&t<=12703},"Bopomofo Extended":function(t){return 12704<=t&&t<=12735},"CJK Strokes":function(t){return 12736<=t&&t<=12783},"Katakana Phonetic Extensions":function(t){return 12784<=t&&t<=12799},"Enclosed CJK Letters and Months":function(t){return 12800<=t&&t<=13055},"CJK Compatibility":function(t){return 13056<=t&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return 13312<=t&&t<=19903},"Yijing Hexagram Symbols":function(t){return 19904<=t&&t<=19967},"CJK Unified Ideographs":function(t){return 19968<=t&&t<=40959},"Yi Syllables":function(t){return 40960<=t&&t<=42127},"Yi Radicals":function(t){return 42128<=t&&t<=42191},"Hangul Jamo Extended-A":function(t){return 43360<=t&&t<=43391},"Hangul Syllables":function(t){return 44032<=t&&t<=55215},"Hangul Jamo Extended-B":function(t){return 55216<=t&&t<=55295},"Private Use Area":function(t){return 57344<=t&&t<=63743},"CJK Compatibility Ideographs":function(t){return 63744<=t&&t<=64255},"Arabic Presentation Forms-A":function(t){return 64336<=t&&t<=65023},"Vertical Forms":function(t){return 65040<=t&&t<=65055},"CJK Compatibility Forms":function(t){return 65072<=t&&t<=65103},"Small Form Variants":function(t){return 65104<=t&&t<=65135},"Arabic Presentation Forms-B":function(t){return 65136<=t&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return 65280<=t&&t<=65519}};function Rn(t){for(var e=0,i=t;e<i.length;e+=1)if(Fn(i[e].charCodeAt(0)))return!0;return!1}function Bn(t){for(var e=0,i=t;e<i.length;e+=1)if(n=i[e].charCodeAt(0),On.Arabic(n)||On["Arabic Supplement"](n)||On["Arabic Extended-A"](n)||On["Arabic Presentation Forms-A"](n)||On["Arabic Presentation Forms-B"](n))return!1;var n;return!0}function Fn(t){return!!(746===t||747===t||!(t<4352)&&(On["Bopomofo Extended"](t)||On.Bopomofo(t)||On["CJK Compatibility Forms"](t)&&!(65097<=t&&t<=65103)||On["CJK Compatibility Ideographs"](t)||On["CJK Compatibility"](t)||On["CJK Radicals Supplement"](t)||On["CJK Strokes"](t)||!(!On["CJK Symbols and Punctuation"](t)||12296<=t&&t<=12305||12308<=t&&t<=12319||12336===t)||On["CJK Unified Ideographs Extension A"](t)||On["CJK Unified Ideographs"](t)||On["Enclosed CJK Letters and Months"](t)||On["Hangul Compatibility Jamo"](t)||On["Hangul Jamo Extended-A"](t)||On["Hangul Jamo Extended-B"](t)||On["Hangul Jamo"](t)||On["Hangul Syllables"](t)||On.Hiragana(t)||On["Ideographic Description Characters"](t)||On.Kanbun(t)||On["Kangxi Radicals"](t)||On["Katakana Phonetic Extensions"](t)||On.Katakana(t)&&12540!==t||!(!On["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||65306<=t&&t<=65310||65339===t||65341===t||65343===t||65371<=t&&t<=65503||65507===t||65512<=t&&t<=65519)||!(!On["Small Form Variants"](t)||65112<=t&&t<=65118||65123<=t&&t<=65126)||On["Unified Canadian Aboriginal Syllabics"](t)||On["Unified Canadian Aboriginal Syllabics Extended"](t)||On["Vertical Forms"](t)||On["Yijing Hexagram Symbols"](t)||On["Yi Syllables"](t)||On["Yi Radicals"](t)))}function Un(t){return!(Fn(t)||(e=t,On["Latin-1 Supplement"](e)&&(167===e||169===e||174===e||177===e||188===e||189===e||190===e||215===e||247===e)||On["General Punctuation"](e)&&(8214===e||8224===e||8225===e||8240===e||8241===e||8251===e||8252===e||8258===e||8263===e||8264===e||8265===e||8273===e)||On["Letterlike Symbols"](e)||On["Number Forms"](e)||On["Miscellaneous Technical"](e)&&(8960<=e&&e<=8967||8972<=e&&e<=8991||8996<=e&&e<=9e3||9003===e||9085<=e&&e<=9114||9150<=e&&e<=9165||9167===e||9169<=e&&e<=9179||9186<=e&&e<=9215)||On["Control Pictures"](e)&&9251!==e||On["Optical Character Recognition"](e)||On["Enclosed Alphanumerics"](e)||On["Geometric Shapes"](e)||On["Miscellaneous Symbols"](e)&&!(9754<=e&&e<=9759)||On["Miscellaneous Symbols and Arrows"](e)&&(11026<=e&&e<=11055||11088<=e&&e<=11097||11192<=e&&e<=11243)||On["CJK Symbols and Punctuation"](e)||On.Katakana(e)||On["Private Use Area"](e)||On["CJK Compatibility Forms"](e)||On["Small Form Variants"](e)||On["Halfwidth and Fullwidth Forms"](e)||8734===e||8756===e||8757===e||9984<=e&&e<=10087||10102<=e&&e<=10131||65532===e||65533===e));var e}function Nn(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Dn,this.transition={})}var jn,$n=!(Dn.prototype.update=function(t,e){var i=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=i,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=i,!0):(this.lastFloorZoom>i?(this.lastIntegerZoom=i+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<i&&(this.lastIntegerZoom=i,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=i,!0))}),Vn=null,Zn=!1,Gn=new Ft,qn={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Zn||null!=qn.applyArabicShaping}};Nn.prototype.isSupportedScript=function(t){return function(t,e){for(var i=0,n=t;i<n.length;i+=1)if(o=n[i].charCodeAt(0),!e&&(1424<=o&&o<=2303||On["Arabic Presentation Forms-A"](o)||On["Arabic Presentation Forms-B"](o))||2304<=o&&o<=3583||3840<=o&&o<=4255||On.Khmer(o))return!1;var o;return!0}(t,qn.isLoaded())},Nn.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},Nn.prototype.getCrossfadeParameters=function(){var t=this.zoom,e=t-Math.floor(t),i=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*i}:{fromScale:.5,toScale:1,t:1-(1-i)*e}};function Hn(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Pi(t))return new Vi(t,e);if(Fi(t)){var i=$i(t,e);if("error"===i.result)throw new Error(i.value.map(function(t){return t.key+": "+t.message}).join(", "));return i.value}var n=t;return"string"==typeof t&&"color"===e.type&&(n=de.parse(t)),{kind:"constant",evaluate:function(){return n}}}(void 0===e?t.specification.default:e,t.specification)}Hn.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},Hn.prototype.possiblyEvaluate=function(t){return this.property.possiblyEvaluate(this,t)};function Wn(t){this.property=t,this.value=new Hn(t,void 0)}Wn.prototype.transitioned=function(t,e){return new Kn(this.property,this.value,e,f({},t.transition,this.transition),t.now)},Wn.prototype.untransitioned=function(){return new Kn(this.property,this.value,null,{},0)};function Xn(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)}Xn.prototype.getValue=function(t){return v(this._values[t].value.value)},Xn.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Wn(this._values[t].property)),this._values[t].value=new Hn(this._values[t].property,null===e?void 0:v(e))},Xn.prototype.getTransition=function(t){return v(this._values[t].transition)},Xn.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Wn(this._values[t].property)),this._values[t].transition=v(e)||void 0},Xn.prototype.serialize=function(){for(var t={},e=0,i=Object.keys(this._values);e<i.length;e+=1){var n=i[e],o=this.getValue(n);void 0!==o&&(t[n]=o);var r=this.getTransition(n);void 0!==r&&(t[n+"-transition"]=r)}return t},Xn.prototype.transitioned=function(t,e){for(var i=new Jn(this._properties),n=0,o=Object.keys(this._values);n<o.length;n+=1){var r=o[n];i._values[r]=this._values[r].transitioned(t,e._values[r])}return i},Xn.prototype.untransitioned=function(){for(var t=new Jn(this._properties),e=0,i=Object.keys(this._values);e<i.length;e+=1){var n=i[e];t._values[n]=this._values[n].untransitioned()}return t};var Kn=function(t,e,i,n,o){this.property=t,this.value=e,this.begin=o+n.delay||0,this.end=this.begin+n.duration||0,t.specification.transition&&(n.delay||n.duration)&&(this.prior=i)};Kn.prototype.possiblyEvaluate=function(t){var e=t.now||0,i=this.value.possiblyEvaluate(t),n=this.prior;if(n){if(e>this.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(e<this.begin)return n.possiblyEvaluate(t);var o=(e-this.begin)/(this.end-this.begin);return this.property.interpolate(n.possiblyEvaluate(t),i,function(){if(o<=0)return 0;if(1<=o)return 1;var t=o*o,e=t*o;return 4*(o<.5?e:3*(o-t)+e-.75)}())}return i};var Jn=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};Jn.prototype.possiblyEvaluate=function(t){for(var e=new to(this._properties),i=0,n=Object.keys(this._values);i<n.length;i+=1){var o=n[i];e._values[o]=this._values[o].possiblyEvaluate(t)}return e},Jn.prototype.hasTransition=function(){for(var t=0,e=Object.keys(this._values);t<e.length;t+=1){var i=e[t];if(this._values[i].prior)return!0}return!1};function Yn(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)}Yn.prototype.getValue=function(t){return v(this._values[t].value)},Yn.prototype.setValue=function(t,e){this._values[t]=new Hn(this._values[t].property,null===e?void 0:v(e))},Yn.prototype.serialize=function(){for(var t={},e=0,i=Object.keys(this._values);e<i.length;e+=1){var n=i[e],o=this.getValue(n);void 0!==o&&(t[n]=o)}return t},Yn.prototype.possiblyEvaluate=function(t){for(var e=new to(this._properties),i=0,n=Object.keys(this._values);i<n.length;i+=1){var o=n[i];e._values[o]=this._values[o].possiblyEvaluate(t)}return e};function Qn(t,e,i){this.property=t,this.value=e,this.parameters=i}Qn.prototype.isConstant=function(){return"constant"===this.value.kind},Qn.prototype.constantOr=function(t){return"constant"===this.value.kind?this.value.value:t},Qn.prototype.evaluate=function(t,e){return this.property.evaluate(this.value,this.parameters,t,e)};var to=function(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)};to.prototype.get=function(t){return this._values[t]};function eo(t){this.specification=t}eo.prototype.possiblyEvaluate=function(t,e){return t.expression.evaluate(e)},eo.prototype.interpolate=function(t,e,i){var n=Ue[this.specification.type];return n?n(t,e,i):t};function io(t){this.specification=t}io.prototype.possiblyEvaluate=function(t,e){return"constant"===t.expression.kind||"camera"===t.expression.kind?new Qn(this,{kind:"constant",value:t.expression.evaluate(e)},e):new Qn(this,t.expression,e)},io.prototype.interpolate=function(t,e,i){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new Qn(this,{kind:"constant",value:void 0},t.parameters);var n=Ue[this.specification.type];return n?new Qn(this,{kind:"constant",value:n(t.value.value,e.value.value,i)},t.parameters):t},io.prototype.evaluate=function(t,e,i,n){return"constant"===t.kind?t.value:t.evaluate(e,i,n)};function no(t){this.specification=t}var oo,ro=((oo=io)&&(ao.__proto__=oo),((ao.prototype=Object.create(oo&&oo.prototype)).constructor=ao).prototype.possiblyEvaluate=function(t,e){if(void 0===t.value)return new Qn(this,{kind:"constant",value:void 0},e);if("constant"===t.expression.kind){var i=t.expression.evaluate(e),n=this._calculate(i,i,i,e);return new Qn(this,{kind:"constant",value:n},e)}if("camera"!==t.expression.kind)return new Qn(this,t.expression,e);var o=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e);return new Qn(this,{kind:"constant",value:o},e)},ao.prototype.evaluate=function(t,e,i,n){if("source"!==t.kind)return"composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},i,n),t.evaluate({zoom:Math.floor(e.zoom)},i,n),t.evaluate({zoom:Math.floor(e.zoom)+1},i,n),e):t.value;var o=t.evaluate(e,i,n);return this._calculate(o,o,o,e)},ao.prototype._calculate=function(t,e,i,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:i,to:e}},ao.prototype.interpolate=function(t){return t},ao);function ao(){oo.apply(this,arguments)}no.prototype.possiblyEvaluate=function(t,e){if(void 0!==t.value){if("constant"!==t.expression.kind)return this._calculate(t.expression.evaluate(new Nn(Math.floor(e.zoom-1),e)),t.expression.evaluate(new Nn(Math.floor(e.zoom),e)),t.expression.evaluate(new Nn(Math.floor(e.zoom+1),e)),e);var i=t.expression.evaluate(e);return this._calculate(i,i,i,e)}},no.prototype._calculate=function(t,e,i,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:i,to:e}},no.prototype.interpolate=function(t){return t};function so(t){this.specification=t}so.prototype.possiblyEvaluate=function(t,e){return!!t.expression.evaluate(e)},so.prototype.interpolate=function(){return!1};function lo(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},t){var i=t[e],n=this.defaultPropertyValues[e]=new Hn(i,void 0),o=this.defaultTransitionablePropertyValues[e]=new Wn(i);this.defaultTransitioningPropertyValues[e]=o.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}}Pn("DataDrivenProperty",io),Pn("DataConstantProperty",eo),Pn("CrossFadedDataDrivenProperty",ro),Pn("CrossFadedProperty",no),Pn("ColorRampProperty",so);function uo(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}function co(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}var ho,po=((ho=Ft)&&(mo.__proto__=ho),((mo.prototype=Object.create(ho&&ho.prototype)).constructor=mo).prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},mo.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},mo.prototype.setLayoutProperty=function(t,e,i){if(void 0===i&&(i={}),null!=e){var n="layers."+this.id+".layout."+t;if(this._validate(Ln,n,t,e,i))return}"visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e},mo.prototype.getPaintProperty=function(t){return _(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},mo.prototype.setPaintProperty=function(t,e,i){if(void 0===i&&(i={}),null!=e){var n="layers."+this.id+".paint."+t;if(this._validate(wn,n,t,e,i))return!1}if(_(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var o=this._transitionablePaint._values[t],r="cross-faded-data-driven"===o.property.specification["property-type"],a=o.value.isDataDriven();return this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t),this._transitionablePaint._values[t].value.isDataDriven()||a||r},mo.prototype._handleSpecialPaintPropertyUpdate=function(){},mo.prototype.isHidden=function(t){return!!(this.minzoom&&t<this.minzoom)||!!(this.maxzoom&&t>=this.maxzoom)||"none"===this.visibility},mo.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},mo.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},mo.prototype.recalculate=function(t){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t)),this.paint=this._transitioningPaint.possiblyEvaluate(t)},mo.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),y(t,function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)})},mo.prototype._validate=function(t,e,i,n,o){return void 0===o&&(o={}),(!o||!1!==o.validate)&&kn(this,t.call(xn,{key:e,layerType:this.type,objectKey:i,value:n,styleSpec:$t,style:{glyphs:!0,sprite:!0}}))},mo.prototype.is3D=function(){return!1},mo.prototype.isTileClipped=function(){return!1},mo.prototype.hasOffscreenPass=function(){return!1},mo.prototype.resize=function(){},mo.prototype.isStateDependent=function(){for(var t in this.paint._values){var e=this.paint.get(t);if(e instanceof Qn&&Ei(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},mo),fo={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};function mo(t,e){if(ho.call(this),this.id=t.id,this.type=t.type,this._featureFilter=function(){return!0},"custom"!==t.type&&(t=t,this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,"background"!==t.type&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter),e.layout&&(this._unevaluatedLayout=new Yn(e.layout)),e.paint)){for(var i in this._transitionablePaint=new Xn(e.paint),t.paint)this.setPaintProperty(i,t.paint[i],{validate:!1});for(var n in t.layout)this.setLayoutProperty(n,t.layout[n],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned()}}function _o(t,r){void 0===r&&(r=1);var a=0,s=0;return{members:t.map(function(t){var e,i=(e=t.type,fo[e].BYTES_PER_ELEMENT),n=a=go(a,Math.max(r,i)),o=t.components||1;return s=Math.max(s,i),a+=i*o,{name:t.name,type:t.type,components:o,offset:n}}),size:go(a,Math.max(s,r)),alignment:r}}function go(t,e){return Math.ceil(t/e)*e}co.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},co.deserialize=function(t){var e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e},co.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},co.prototype.clear=function(){this.length=0},co.prototype.resize=function(t){this.reserve(t),this.length=t},co.prototype.reserve=function(t){if(t>this.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)}},co.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var yo,vo=((yo=co)&&(xo.__proto__=yo),((xo.prototype=Object.create(yo&&yo.prototype)).constructor=xo).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},xo.prototype.emplaceBack=function(t,e){var i=this.length;return this.resize(i+1),this.emplace(i,t,e)},xo.prototype.emplace=function(t,e,i){var n=2*t;return this.int16[0+n]=e,this.int16[1+n]=i,t},xo);function xo(){yo.apply(this,arguments)}vo.prototype.bytesPerElement=4,Pn("StructArrayLayout2i4",vo);var bo,wo=((bo=co)&&(Lo.__proto__=bo),((Lo.prototype=Object.create(bo&&bo.prototype)).constructor=Lo).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},Lo.prototype.emplaceBack=function(t,e,i,n){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,i,n)},Lo.prototype.emplace=function(t,e,i,n,o){var r=4*t;return this.int16[0+r]=e,this.int16[1+r]=i,this.int16[2+r]=n,this.int16[3+r]=o,t},Lo);function Lo(){bo.apply(this,arguments)}wo.prototype.bytesPerElement=8,Pn("StructArrayLayout4i8",wo);var ko,To=((ko=co)&&(Eo.__proto__=ko),((Eo.prototype=Object.create(ko&&ko.prototype)).constructor=Eo).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},Eo.prototype.emplaceBack=function(t,e,i,n,o,r){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,i,n,o,r)},Eo.prototype.emplace=function(t,e,i,n,o,r,a){var s=6*t;return this.int16[0+s]=e,this.int16[1+s]=i,this.int16[2+s]=n,this.int16[3+s]=o,this.int16[4+s]=r,this.int16[5+s]=a,t},Eo);function Eo(){ko.apply(this,arguments)}To.prototype.bytesPerElement=12,Pn("StructArrayLayout2i4i12",To);var Mo,Co=((Mo=co)&&(So.__proto__=Mo),((So.prototype=Object.create(Mo&&Mo.prototype)).constructor=So).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},So.prototype.emplaceBack=function(t,e,i,n,o,r){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,i,n,o,r)},So.prototype.emplace=function(t,e,i,n,o,r,a){var s=4*t,l=8*t;return this.int16[0+s]=e,this.int16[1+s]=i,this.uint8[4+l]=n,this.uint8[5+l]=o,this.uint8[6+l]=r,this.uint8[7+l]=a,t},So);function So(){Mo.apply(this,arguments)}Co.prototype.bytesPerElement=8,Pn("StructArrayLayout2i4ub8",Co);var Po,zo=((Po=co)&&(Io.__proto__=Po),((Io.prototype=Object.create(Po&&Po.prototype)).constructor=Io).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},Io.prototype.emplaceBack=function(t,e,i,n,o,r,a,s){var l=this.length;return this.resize(l+1),this.emplace(l,t,e,i,n,o,r,a,s)},Io.prototype.emplace=function(t,e,i,n,o,r,a,s,l){var u=8*t;return this.uint16[0+u]=e,this.uint16[1+u]=i,this.uint16[2+u]=n,this.uint16[3+u]=o,this.uint16[4+u]=r,this.uint16[5+u]=a,this.uint16[6+u]=s,this.uint16[7+u]=l,t},Io);function Io(){Po.apply(this,arguments)}zo.prototype.bytesPerElement=16,Pn("StructArrayLayout8ui16",zo);var Ao,Do=((Ao=co)&&(Oo.__proto__=Ao),((Oo.prototype=Object.create(Ao&&Ao.prototype)).constructor=Oo).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},Oo.prototype.emplaceBack=function(t,e,i,n,o,r,a,s){var l=this.length;return this.resize(l+1),this.emplace(l,t,e,i,n,o,r,a,s)},Oo.prototype.emplace=function(t,e,i,n,o,r,a,s,l){var u=8*t;return this.int16[0+u]=e,this.int16[1+u]=i,this.int16[2+u]=n,this.int16[3+u]=o,this.uint16[4+u]=r,this.uint16[5+u]=a,this.uint16[6+u]=s,this.uint16[7+u]=l,t},Oo);function Oo(){Ao.apply(this,arguments)}Do.prototype.bytesPerElement=16,Pn("StructArrayLayout4i4ui16",Do);var Ro,Bo=((Ro=co)&&(Fo.__proto__=Ro),((Fo.prototype=Object.create(Ro&&Ro.prototype)).constructor=Fo).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},Fo.prototype.emplaceBack=function(t,e,i){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,i)},Fo.prototype.emplace=function(t,e,i,n){var o=3*t;return this.float32[0+o]=e,this.float32[1+o]=i,this.float32[2+o]=n,t},Fo);function Fo(){Ro.apply(this,arguments)}Bo.prototype.bytesPerElement=12,Pn("StructArrayLayout3f12",Bo);var Uo,No=((Uo=co)&&(jo.__proto__=Uo),((jo.prototype=Object.create(Uo&&Uo.prototype)).constructor=jo).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},jo.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},jo.prototype.emplace=function(t,e){var i=1*t;return this.uint32[0+i]=e,t},jo);function jo(){Uo.apply(this,arguments)}No.prototype.bytesPerElement=4,Pn("StructArrayLayout1ul4",No);var $o,Vo=(($o=co)&&(Zo.__proto__=$o),((Zo.prototype=Object.create($o&&$o.prototype)).constructor=Zo).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},Zo.prototype.emplaceBack=function(t,e,i,n,o,r,a,s,l,u,c){var h=this.length;return this.resize(h+1),this.emplace(h,t,e,i,n,o,r,a,s,l,u,c)},Zo.prototype.emplace=function(t,e,i,n,o,r,a,s,l,u,c,h){var p=12*t,d=6*t;return this.int16[0+p]=e,this.int16[1+p]=i,this.int16[2+p]=n,this.int16[3+p]=o,this.int16[4+p]=r,this.int16[5+p]=a,this.uint32[3+d]=s,this.uint16[8+p]=l,this.uint16[9+p]=u,this.int16[10+p]=c,this.int16[11+p]=h,t},Zo);function Zo(){$o.apply(this,arguments)}Vo.prototype.bytesPerElement=24,Pn("StructArrayLayout6i1ul2ui2i24",Vo);var Go,qo=((Go=co)&&(Ho.__proto__=Go),((Ho.prototype=Object.create(Go&&Go.prototype)).constructor=Ho).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},Ho.prototype.emplaceBack=function(t,e,i,n,o,r){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,i,n,o,r)},Ho.prototype.emplace=function(t,e,i,n,o,r,a){var s=6*t;return this.int16[0+s]=e,this.int16[1+s]=i,this.int16[2+s]=n,this.int16[3+s]=o,this.int16[4+s]=r,this.int16[5+s]=a,t},Ho);function Ho(){Go.apply(this,arguments)}qo.prototype.bytesPerElement=12,Pn("StructArrayLayout2i2i2i12",qo);var Wo,Xo=((Wo=co)&&(Ko.__proto__=Wo),((Ko.prototype=Object.create(Wo&&Wo.prototype)).constructor=Ko).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},Ko.prototype.emplaceBack=function(t,e,i,n){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,i,n)},Ko.prototype.emplace=function(t,e,i,n,o){var r=12*t,a=3*t;return this.uint8[0+r]=e,this.uint8[1+r]=i,this.float32[1+a]=n,this.float32[2+a]=o,t},Ko);function Ko(){Wo.apply(this,arguments)}Xo.prototype.bytesPerElement=12,Pn("StructArrayLayout2ub2f12",Xo);var Jo,Yo=((Jo=co)&&(Qo.__proto__=Jo),((Qo.prototype=Object.create(Jo&&Jo.prototype)).constructor=Qo).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},Qo.prototype.emplaceBack=function(t,e,i,n,o,r,a,s,l,u,c,h,p,d,f){var m=this.length;return this.resize(m+1),this.emplace(m,t,e,i,n,o,r,a,s,l,u,c,h,p,d,f)},Qo.prototype.emplace=function(t,e,i,n,o,r,a,s,l,u,c,h,p,d,f,m){var _=22*t,g=11*t,y=44*t;return this.int16[0+_]=e,this.int16[1+_]=i,this.uint16[2+_]=n,this.uint16[3+_]=o,this.uint32[2+g]=r,this.uint32[3+g]=a,this.uint32[4+g]=s,this.uint16[10+_]=l,this.uint16[11+_]=u,this.uint16[12+_]=c,this.float32[7+g]=h,this.float32[8+g]=p,this.uint8[36+y]=d,this.uint8[37+y]=f,this.uint32[10+g]=m,t},Qo);function Qo(){Jo.apply(this,arguments)}Yo.prototype.bytesPerElement=44,Pn("StructArrayLayout2i2ui3ul3ui2f2ub1ul44",Yo);var tr,er=((tr=co)&&(ir.__proto__=tr),((ir.prototype=Object.create(tr&&tr.prototype)).constructor=ir).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},ir.prototype.emplaceBack=function(t,e,i,n,o,r,a,s,l,u,c,h,p,d,f,m,_,g){var y=this.length;return this.resize(y+1),this.emplace(y,t,e,i,n,o,r,a,s,l,u,c,h,p,d,f,m,_,g)},ir.prototype.emplace=function(t,e,i,n,o,r,a,s,l,u,c,h,p,d,f,m,_,g,y){var v=22*t,x=11*t;return this.int16[0+v]=e,this.int16[1+v]=i,this.int16[2+v]=n,this.int16[3+v]=o,this.int16[4+v]=r,this.int16[5+v]=a,this.uint16[6+v]=s,this.uint16[7+v]=l,this.uint16[8+v]=u,this.uint16[9+v]=c,this.uint16[10+v]=h,this.uint16[11+v]=p,this.uint16[12+v]=d,this.uint16[13+v]=f,this.uint16[14+v]=m,this.uint32[8+x]=_,this.float32[9+x]=g,this.float32[10+x]=y,t},ir);function ir(){tr.apply(this,arguments)}er.prototype.bytesPerElement=44,Pn("StructArrayLayout6i9ui1ul2f44",er);var nr,or=((nr=co)&&(rr.__proto__=nr),((rr.prototype=Object.create(nr&&nr.prototype)).constructor=rr).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},rr.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},rr.prototype.emplace=function(t,e){var i=1*t;return this.float32[0+i]=e,t},rr);function rr(){nr.apply(this,arguments)}or.prototype.bytesPerElement=4,Pn("StructArrayLayout1f4",or);var ar,sr=((ar=co)&&(lr.__proto__=ar),((lr.prototype=Object.create(ar&&ar.prototype)).constructor=lr).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},lr.prototype.emplaceBack=function(t,e,i){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,i)},lr.prototype.emplace=function(t,e,i,n){var o=3*t;return this.int16[0+o]=e,this.int16[1+o]=i,this.int16[2+o]=n,t},lr);function lr(){ar.apply(this,arguments)}sr.prototype.bytesPerElement=6,Pn("StructArrayLayout3i6",sr);var ur,cr=((ur=co)&&(hr.__proto__=ur),((hr.prototype=Object.create(ur&&ur.prototype)).constructor=hr).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},hr.prototype.emplaceBack=function(t,e,i){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,i)},hr.prototype.emplace=function(t,e,i,n){var o=2*t,r=4*t;return this.uint32[0+o]=e,this.uint16[2+r]=i,this.uint16[3+r]=n,t},hr);function hr(){ur.apply(this,arguments)}cr.prototype.bytesPerElement=8,Pn("StructArrayLayout1ul2ui8",cr);var pr,dr=((pr=co)&&(fr.__proto__=pr),((fr.prototype=Object.create(pr&&pr.prototype)).constructor=fr).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},fr.prototype.emplaceBack=function(t,e,i){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,i)},fr.prototype.emplace=function(t,e,i,n){var o=3*t;return this.uint16[0+o]=e,this.uint16[1+o]=i,this.uint16[2+o]=n,t},fr);function fr(){pr.apply(this,arguments)}dr.prototype.bytesPerElement=6,Pn("StructArrayLayout3ui6",dr);var mr,_r=((mr=co)&&(gr.__proto__=mr),((gr.prototype=Object.create(mr&&mr.prototype)).constructor=gr).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},gr.prototype.emplaceBack=function(t,e){var i=this.length;return this.resize(i+1),this.emplace(i,t,e)},gr.prototype.emplace=function(t,e,i){var n=2*t;return this.uint16[0+n]=e,this.uint16[1+n]=i,t},gr);function gr(){mr.apply(this,arguments)}_r.prototype.bytesPerElement=4,Pn("StructArrayLayout2ui4",_r);var yr,vr=((yr=co)&&(xr.__proto__=yr),((xr.prototype=Object.create(yr&&yr.prototype)).constructor=xr).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},xr.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},xr.prototype.emplace=function(t,e){var i=1*t;return this.uint16[0+i]=e,t},xr);function xr(){yr.apply(this,arguments)}vr.prototype.bytesPerElement=2,Pn("StructArrayLayout1ui2",vr);var br,wr=((br=co)&&(Lr.__proto__=br),((Lr.prototype=Object.create(br&&br.prototype)).constructor=Lr).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},Lr.prototype.emplaceBack=function(t,e){var i=this.length;return this.resize(i+1),this.emplace(i,t,e)},Lr.prototype.emplace=function(t,e,i){var n=2*t;return this.float32[0+n]=e,this.float32[1+n]=i,t},Lr);function Lr(){br.apply(this,arguments)}wr.prototype.bytesPerElement=8,Pn("StructArrayLayout2f8",wr);var kr,Tr=((kr=co)&&(Er.__proto__=kr),((Er.prototype=Object.create(kr&&kr.prototype)).constructor=Er).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},Er.prototype.emplaceBack=function(t,e,i,n){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,i,n)},Er.prototype.emplace=function(t,e,i,n,o){var r=4*t;return this.float32[0+r]=e,this.float32[1+r]=i,this.float32[2+r]=n,this.float32[3+r]=o,t},Er);function Er(){kr.apply(this,arguments)}Tr.prototype.bytesPerElement=16,Pn("StructArrayLayout4f16",Tr);var Mr=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},radius:{configurable:!0},signedDistanceFromAnchor:{configurable:!0},anchorPoint:{configurable:!0}};return i.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},i.anchorPointX.set=function(t){this._structArray.int16[this._pos2+0]=t},i.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},i.anchorPointY.set=function(t){this._structArray.int16[this._pos2+1]=t},i.x1.get=function(){return this._structArray.int16[this._pos2+2]},i.x1.set=function(t){this._structArray.int16[this._pos2+2]=t},i.y1.get=function(){return this._structArray.int16[this._pos2+3]},i.y1.set=function(t){this._structArray.int16[this._pos2+3]=t},i.x2.get=function(){return this._structArray.int16[this._pos2+4]},i.x2.set=function(t){this._structArray.int16[this._pos2+4]=t},i.y2.get=function(){return this._structArray.int16[this._pos2+5]},i.y2.set=function(t){this._structArray.int16[this._pos2+5]=t},i.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},i.featureIndex.set=function(t){this._structArray.uint32[this._pos4+3]=t},i.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},i.sourceLayerIndex.set=function(t){this._structArray.uint16[this._pos2+8]=t},i.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},i.bucketIndex.set=function(t){this._structArray.uint16[this._pos2+9]=t},i.radius.get=function(){return this._structArray.int16[this._pos2+10]},i.radius.set=function(t){this._structArray.int16[this._pos2+10]=t},i.signedDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+11]},i.signedDistanceFromAnchor.set=function(t){this._structArray.int16[this._pos2+11]=t},i.anchorPoint.get=function(){return new st(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,i),e}(uo);Mr.prototype.size=24;var Cr,Sr=((Cr=Vo)&&(Pr.__proto__=Cr),((Pr.prototype=Object.create(Cr&&Cr.prototype)).constructor=Pr).prototype.get=function(t){return new Mr(this,t)},Pr);function Pr(){Cr.apply(this,arguments)}Pn("CollisionBoxArray",Sr);var zr=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0}};return i.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},i.anchorX.set=function(t){this._structArray.int16[this._pos2+0]=t},i.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},i.anchorY.set=function(t){this._structArray.int16[this._pos2+1]=t},i.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},i.glyphStartIndex.set=function(t){this._structArray.uint16[this._pos2+2]=t},i.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},i.numGlyphs.set=function(t){this._structArray.uint16[this._pos2+3]=t},i.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},i.vertexStartIndex.set=function(t){this._structArray.uint32[this._pos4+2]=t},i.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},i.lineStartIndex.set=function(t){this._structArray.uint32[this._pos4+3]=t},i.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},i.lineLength.set=function(t){this._structArray.uint32[this._pos4+4]=t},i.segment.get=function(){return this._structArray.uint16[this._pos2+10]},i.segment.set=function(t){this._structArray.uint16[this._pos2+10]=t},i.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},i.lowerSize.set=function(t){this._structArray.uint16[this._pos2+11]=t},i.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},i.upperSize.set=function(t){this._structArray.uint16[this._pos2+12]=t},i.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},i.lineOffsetX.set=function(t){this._structArray.float32[this._pos4+7]=t},i.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},i.lineOffsetY.set=function(t){this._structArray.float32[this._pos4+8]=t},i.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},i.writingMode.set=function(t){this._structArray.uint8[this._pos1+36]=t},i.hidden.get=function(){return this._structArray.uint8[this._pos1+37]},i.hidden.set=function(t){this._structArray.uint8[this._pos1+37]=t},i.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},i.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},Object.defineProperties(e.prototype,i),e}(uo);zr.prototype.size=44;var Ir,Ar=((Ir=Yo)&&(Dr.__proto__=Ir),((Dr.prototype=Object.create(Ir&&Ir.prototype)).constructor=Dr).prototype.get=function(t){return new zr(this,t)},Dr);function Dr(){Ir.apply(this,arguments)}Pn("PlacedSymbolArray",Ar);var Or=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},radialTextOffset:{configurable:!0}};return i.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},i.anchorX.set=function(t){this._structArray.int16[this._pos2+0]=t},i.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},i.anchorY.set=function(t){this._structArray.int16[this._pos2+1]=t},i.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},i.rightJustifiedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+2]=t},i.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},i.centerJustifiedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+3]=t},i.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},i.leftJustifiedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+4]=t},i.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},i.verticalPlacedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+5]=t},i.key.get=function(){return this._structArray.uint16[this._pos2+6]},i.key.set=function(t){this._structArray.uint16[this._pos2+6]=t},i.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+7]},i.textBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+7]=t},i.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+8]},i.textBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+8]=t},i.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},i.iconBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+9]=t},i.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},i.iconBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+10]=t},i.featureIndex.get=function(){return this._structArray.uint16[this._pos2+11]},i.featureIndex.set=function(t){this._structArray.uint16[this._pos2+11]=t},i.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+12]},i.numHorizontalGlyphVertices.set=function(t){this._structArray.uint16[this._pos2+12]=t},i.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+13]},i.numVerticalGlyphVertices.set=function(t){this._structArray.uint16[this._pos2+13]=t},i.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+14]},i.numIconVertices.set=function(t){this._structArray.uint16[this._pos2+14]=t},i.crossTileID.get=function(){return this._structArray.uint32[this._pos4+8]},i.crossTileID.set=function(t){this._structArray.uint32[this._pos4+8]=t},i.textBoxScale.get=function(){return this._structArray.float32[this._pos4+9]},i.textBoxScale.set=function(t){this._structArray.float32[this._pos4+9]=t},i.radialTextOffset.get=function(){return this._structArray.float32[this._pos4+10]},i.radialTextOffset.set=function(t){this._structArray.float32[this._pos4+10]=t},Object.defineProperties(e.prototype,i),e}(uo);Or.prototype.size=44;var Rr,Br=((Rr=er)&&(Fr.__proto__=Rr),((Fr.prototype=Object.create(Rr&&Rr.prototype)).constructor=Fr).prototype.get=function(t){return new Or(this,t)},Fr);function Fr(){Rr.apply(this,arguments)}Pn("SymbolInstanceArray",Br);var Ur=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={offsetX:{configurable:!0}};return i.offsetX.get=function(){return this._structArray.float32[this._pos4+0]},i.offsetX.set=function(t){this._structArray.float32[this._pos4+0]=t},Object.defineProperties(e.prototype,i),e}(uo);Ur.prototype.size=4;var Nr,jr=((Nr=or)&&($r.__proto__=Nr),(($r.prototype=Object.create(Nr&&Nr.prototype)).constructor=$r).prototype.getoffsetX=function(t){return this.float32[1*t+0]},$r.prototype.get=function(t){return new Ur(this,t)},$r);function $r(){Nr.apply(this,arguments)}Pn("GlyphOffsetArray",jr);var Vr=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={x:{configurable:!0},y:{configurable:!0},tileUnitDistanceFromAnchor:{configurable:!0}};return i.x.get=function(){return this._structArray.int16[this._pos2+0]},i.x.set=function(t){this._structArray.int16[this._pos2+0]=t},i.y.get=function(){return this._structArray.int16[this._pos2+1]},i.y.set=function(t){this._structArray.int16[this._pos2+1]=t},i.tileUnitDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+2]},i.tileUnitDistanceFromAnchor.set=function(t){this._structArray.int16[this._pos2+2]=t},Object.defineProperties(e.prototype,i),e}(uo);Vr.prototype.size=6;var Zr,Gr=((Zr=sr)&&(qr.__proto__=Zr),((qr.prototype=Object.create(Zr&&Zr.prototype)).constructor=qr).prototype.getx=function(t){return this.int16[3*t+0]},qr.prototype.gety=function(t){return this.int16[3*t+1]},qr.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},qr.prototype.get=function(t){return new Vr(this,t)},qr);function qr(){Zr.apply(this,arguments)}Pn("SymbolLineVertexArray",Gr);var Hr=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return i.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},i.featureIndex.set=function(t){this._structArray.uint32[this._pos4+0]=t},i.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},i.sourceLayerIndex.set=function(t){this._structArray.uint16[this._pos2+2]=t},i.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},i.bucketIndex.set=function(t){this._structArray.uint16[this._pos2+3]=t},Object.defineProperties(e.prototype,i),e}(uo);Hr.prototype.size=8;var Wr,Xr=((Wr=cr)&&(Kr.__proto__=Wr),((Kr.prototype=Object.create(Wr&&Wr.prototype)).constructor=Kr).prototype.get=function(t){return new Hr(this,t)},Kr);function Kr(){Wr.apply(this,arguments)}Pn("FeatureIndexArray",Xr);function Jr(t){void 0===t&&(t=[]),this.segments=t}var Yr=_o([{name:"a_pos",components:2,type:"Int16"}],4).members;function Qr(t,e){return 256*(t=l(Math.floor(t),0,255))+l(Math.floor(e),0,255)}Jr.prototype.prepareSegment=function(t,e,i,n){var o=this.segments[this.segments.length-1];return Jr.MAX_VERTEX_ARRAY_LENGTH<t&<("Max vertices per segment is "+Jr.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!o||o.vertexLength+t>Jr.MAX_VERTEX_ARRAY_LENGTH||o.sortKey!==n)&&(o={vertexOffset:e.length,primitiveOffset:i.length,vertexLength:0,primitiveLength:0},void 0!==n&&(o.sortKey=n),this.segments.push(o)),o},Jr.prototype.get=function(){return this.segments},Jr.prototype.destroy=function(){for(var t=0,e=this.segments;t<e.length;t+=1){var i=e[t];for(var n in i.vaos)i.vaos[n].destroy()}},Jr.simpleSegment=function(t,e,i,n){return new Jr([{vertexOffset:t,primitiveOffset:e,vertexLength:i,primitiveLength:n,vaos:{},sortKey:0}])},Jr.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Pn("SegmentVector",Jr);function ta(){this.ids=[],this.positions=[],this.indexed=!1}function ea(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}ta.prototype.add=function(t,e,i,n){this.ids.push(t),this.positions.push(e,i,n)},ta.prototype.getPositions=function(t){for(var e=0,i=this.ids.length-1;e<i;){var n=e+i>>1;this.ids[n]>=t?i=n:e=1+n}for(var o=[];this.ids[e]===t;){var r=this.positions[3*e],a=this.positions[3*e+1],s=this.positions[3*e+2];o.push({index:r,start:a,end:s}),e++}return o},ta.serialize=function(t,e){var i=new Float64Array(t.ids),n=new Uint32Array(t.positions);return function t(e,i,n,o){if(!(o<=n)){for(var r=e[n+o>>1],a=n-1,s=o+1;;){for(;e[++a]<r;);for(;e[--s]>r;);if(s<=a)break;ea(e,a,s),ea(i,3*a,3*s),ea(i,3*a+1,3*s+1),ea(i,3*a+2,3*s+2)}t(e,i,n,s),t(e,i,s+1,o)}}(i,n,0,i.length-1),e.push(i.buffer,n.buffer),{ids:i,positions:n}},ta.deserialize=function(t){var e=new ta;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e},Pn("FeaturePositionMap",ta);function ia(t,e){this.gl=t.gl,this.location=e}var na,oa,ra,aa,sa,la,ua,ca=((ua=ia)&&(ka.__proto__=ua),((ka.prototype=Object.create(ua&&ua.prototype)).constructor=ka).prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t))},ka),ha=((la=ia)&&(La.__proto__=la),((La.prototype=Object.create(la&&la.prototype)).constructor=La).prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))},La),pa=((sa=ia)&&(wa.__proto__=sa),((wa.prototype=Object.create(sa&&sa.prototype)).constructor=wa).prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]||(this.current=t,this.gl.uniform2f(this.location,t[0],t[1]))},wa),da=((aa=ia)&&(ba.__proto__=aa),((ba.prototype=Object.create(aa&&aa.prototype)).constructor=ba).prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]||(this.current=t,this.gl.uniform3f(this.location,t[0],t[1],t[2]))},ba),fa=((ra=ia)&&(xa.__proto__=ra),((xa.prototype=Object.create(ra&&ra.prototype)).constructor=xa).prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]&&t[3]===this.current[3]||(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))},xa),ma=((oa=ia)&&(va.__proto__=oa),((va.prototype=Object.create(oa&&oa.prototype)).constructor=va).prototype.set=function(t){t.r===this.current.r&&t.g===this.current.g&&t.b===this.current.b&&t.a===this.current.a||(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))},va),_a=new Float32Array(16),ga=((na=ia)&&(ya.__proto__=na),((ya.prototype=Object.create(na&&na.prototype)).constructor=ya).prototype.set=function(t){if(t[12]!==this.current[12]||t[0]!==this.current[0])return this.current=t,void this.gl.uniformMatrix4fv(this.location,!1,t);for(var e=1;e<16;e++)if(t[e]!==this.current[e]){this.current=t,this.gl.uniformMatrix4fv(this.location,!1,t);break}},ya);function ya(t,e){na.call(this,t,e),this.current=_a}function va(t,e){oa.call(this,t,e),this.current=de.transparent}function xa(t,e){ra.call(this,t,e),this.current=[0,0,0,0]}function ba(t,e){aa.call(this,t,e),this.current=[0,0,0]}function wa(t,e){sa.call(this,t,e),this.current=[0,0]}function La(t,e){la.call(this,t,e),this.current=0}function ka(t,e){ua.call(this,t,e),this.current=0}function Ta(t){return[Qr(255*t.r,255*t.g),Qr(255*t.b,255*t.a)]}function Ea(t,e,i){this.value=t,this.names=e,this.uniformNames=this.names.map(function(t){return"u_"+t}),this.type=i,this.maxValue=-1/0}Ea.prototype.defines=function(){return this.names.map(function(t){return"#define HAS_UNIFORM_u_"+t})},Ea.prototype.setConstantPatternPositions=function(){},Ea.prototype.populatePaintArray=function(){},Ea.prototype.updatePaintArray=function(){},Ea.prototype.upload=function(){},Ea.prototype.destroy=function(){},Ea.prototype.setUniforms=function(t,e,i,n){e.set(n.constantOr(this.value))},Ea.prototype.getBinding=function(t,e){return"color"===this.type?new ma(t,e):new ha(t,e)},Ea.serialize=function(t){var e=t.value,i=t.names,n=t.type;return{value:In(e),names:i,type:n}},Ea.deserialize=function(t){var e=t.value,i=t.names,n=t.type;return new Ea(An(e),i,n)};function Ma(t,e,i){this.value=t,this.names=e,this.uniformNames=this.names.map(function(t){return"u_"+t}),this.type=i,this.maxValue=-1/0,this.patternPositions={patternTo:null,patternFrom:null}}Ma.prototype.defines=function(){return this.names.map(function(t){return"#define HAS_UNIFORM_u_"+t})},Ma.prototype.populatePaintArray=function(){},Ma.prototype.updatePaintArray=function(){},Ma.prototype.upload=function(){},Ma.prototype.destroy=function(){},Ma.prototype.setConstantPatternPositions=function(t,e){this.patternPositions.patternTo=t.tlbr,this.patternPositions.patternFrom=e.tlbr},Ma.prototype.setUniforms=function(t,e,i,n,o){var r=this.patternPositions;"u_pattern_to"===o&&r.patternTo&&e.set(r.patternTo),"u_pattern_from"===o&&r.patternFrom&&e.set(r.patternFrom)},Ma.prototype.getBinding=function(t,e){return new fa(t,e)};function Ca(t,e,i,n){this.expression=t,this.names=e,this.type=i,this.uniformNames=this.names.map(function(t){return"a_"+t}),this.maxValue=-1/0,this.paintVertexAttributes=e.map(function(t){return{name:"a_"+t,type:"Float32",components:"color"===i?2:1,offset:0}}),this.paintVertexArray=new n}Ca.prototype.defines=function(){return[]},Ca.prototype.setConstantPatternPositions=function(){},Ca.prototype.populatePaintArray=function(t,e){var i=this.paintVertexArray,n=i.length;i.reserve(t);var o=this.expression.evaluate(new Nn(0),e,{});if("color"===this.type)for(var r=Ta(o),a=n;a<t;a++)i.emplaceBack(r[0],r[1]);else{for(var s=n;s<t;s++)i.emplaceBack(o);this.maxValue=Math.max(this.maxValue,o)}},Ca.prototype.updatePaintArray=function(t,e,i,n){var o=this.paintVertexArray,r=this.expression.evaluate({zoom:0},i,n);if("color"===this.type)for(var a=Ta(r),s=t;s<e;s++)o.emplace(s,a[0],a[1]);else{for(var l=t;l<e;l++)o.emplace(l,r);this.maxValue=Math.max(this.maxValue,r)}},Ca.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Ca.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},Ca.prototype.setUniforms=function(t,e){e.set(0)},Ca.prototype.getBinding=function(t,e){return new ha(t,e)};function Sa(t,e,i,n,o,r){this.expression=t,this.names=e,this.uniformNames=this.names.map(function(t){return"u_"+t+"_t"}),this.type=i,this.useIntegerZoom=n,this.zoom=o,this.maxValue=-1/0;var a=r;this.paintVertexAttributes=e.map(function(t){return{name:"a_"+t,type:"Float32",components:"color"===i?4:2,offset:0}}),this.paintVertexArray=new a}Sa.prototype.defines=function(){return[]},Sa.prototype.setConstantPatternPositions=function(){},Sa.prototype.populatePaintArray=function(t,e){var i=this.paintVertexArray,n=i.length;i.reserve(t);var o=this.expression.evaluate(new Nn(this.zoom),e,{}),r=this.expression.evaluate(new Nn(this.zoom+1),e,{});if("color"===this.type)for(var a=Ta(o),s=Ta(r),l=n;l<t;l++)i.emplaceBack(a[0],a[1],s[0],s[1]);else{for(var u=n;u<t;u++)i.emplaceBack(o,r);this.maxValue=Math.max(this.maxValue,o,r)}},Sa.prototype.updatePaintArray=function(t,e,i,n){var o=this.paintVertexArray,r=this.expression.evaluate({zoom:this.zoom},i,n),a=this.expression.evaluate({zoom:this.zoom+1},i,n);if("color"===this.type)for(var s=Ta(r),l=Ta(a),u=t;u<e;u++)o.emplace(u,s[0],s[1],l[0],l[1]);else{for(var c=t;c<e;c++)o.emplace(c,r,a);this.maxValue=Math.max(this.maxValue,r,a)}},Sa.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Sa.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},Sa.prototype.interpolationFactor=function(t){return this.useIntegerZoom?this.expression.interpolationFactor(Math.floor(t),this.zoom,this.zoom+1):this.expression.interpolationFactor(t,this.zoom,this.zoom+1)},Sa.prototype.setUniforms=function(t,e,i){e.set(this.interpolationFactor(i.zoom))},Sa.prototype.getBinding=function(t,e){return new ha(t,e)};function Pa(t,e,i,n,o,r,a){this.expression=t,this.names=e,this.type=i,this.uniformNames=this.names.map(function(t){return"u_"+t+"_t"}),this.useIntegerZoom=n,this.zoom=o,this.maxValue=-1/0,this.layerId=a,this.paintVertexAttributes=e.map(function(t){return{name:"a_"+t,type:"Uint16",components:4,offset:0}}),this.zoomInPaintVertexArray=new r,this.zoomOutPaintVertexArray=new r}Pa.prototype.defines=function(){return[]},Pa.prototype.setConstantPatternPositions=function(){},Pa.prototype.populatePaintArray=function(t,e,i){var n=this.zoomInPaintVertexArray,o=this.zoomOutPaintVertexArray,r=this.layerId,a=n.length;if(n.reserve(t),o.reserve(t),i&&e.patterns&&e.patterns[r]){var s=e.patterns[r],l=s.min,u=s.mid,c=s.max,h=i[l],p=i[u],d=i[c];if(!h||!p||!d)return;for(var f=a;f<t;f++)n.emplaceBack(p.tl[0],p.tl[1],p.br[0],p.br[1],h.tl[0],h.tl[1],h.br[0],h.br[1]),o.emplaceBack(p.tl[0],p.tl[1],p.br[0],p.br[1],d.tl[0],d.tl[1],d.br[0],d.br[1])}},Pa.prototype.updatePaintArray=function(t,e,i,n,o){var r=this.zoomInPaintVertexArray,a=this.zoomOutPaintVertexArray,s=this.layerId;if(o&&i.patterns&&i.patterns[s]){var l=i.patterns[s],u=l.min,c=l.mid,h=l.max,p=o[u],d=o[c],f=o[h];if(!p||!d||!f)return;for(var m=t;m<e;m++)r.emplace(m,d.tl[0],d.tl[1],d.br[0],d.br[1],p.tl[0],p.tl[1],p.br[0],p.br[1]),a.emplace(m,d.tl[0],d.tl[1],d.br[0],d.br[1],f.tl[0],f.tl[1],f.br[0],f.br[1])}},Pa.prototype.upload=function(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Pa.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()},Pa.prototype.setUniforms=function(t,e){e.set(0)},Pa.prototype.getBinding=function(t,e){return new ha(t,e)};function za(){this.binders={},this.cacheKey="",this._buffers=[],this._featureMap=new ta,this._bufferOffset=0}za.createDynamic=function(t,e,i){var n,o,r=new za,a=[];for(var s in t.paint._values)if(i(s)){var l=t.paint.get(s);if(l instanceof Qn&&Ei(l.property.specification)){var u=(n=s,o=t.type,{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from"],"fill-pattern":["pattern_to","pattern_from"],"fill-extrusion-pattern":["pattern_to","pattern_from"]}[n]||[n.replace(o+"-","").replace(/-/g,"_")]),c=l.property.specification.type,h=l.property.useIntegerZoom;if("cross-faded"===l.property.specification["property-type"]||"cross-faded-data-driven"===l.property.specification["property-type"])if("constant"===l.value.kind)r.binders[s]=new Ma(l.value.value,u,c),a.push("/u_"+s);else{var p=Aa(s,c,"source");r.binders[s]=new Pa(l.value,u,c,h,e,p,t.id),a.push("/a_"+s)}else if("constant"===l.value.kind)r.binders[s]=new Ea(l.value.value,u,c),a.push("/u_"+s);else if("source"===l.value.kind){var d=Aa(s,c,"source");r.binders[s]=new Ca(l.value,u,c,d),a.push("/a_"+s)}else{var f=Aa(s,c,"composite");r.binders[s]=new Sa(l.value,u,c,h,e,f),a.push("/z_"+s)}}}return r.cacheKey=a.sort().join(""),r},za.prototype.populatePaintArrays=function(t,e,i,n){for(var o in this.binders)this.binders[o].populatePaintArray(t,e,n);void 0!==e.id&&this._featureMap.add(+e.id,i,this._bufferOffset,t),this._bufferOffset=t},za.prototype.setConstantPatternPositions=function(t,e){for(var i in this.binders)this.binders[i].setConstantPatternPositions(t,e)},za.prototype.updatePaintArrays=function(t,e,i,n){var o=!1;for(var r in t)for(var a=0,s=this._featureMap.getPositions(+r);a<s.length;a+=1){var l=s[a],u=e.feature(l.index);for(var c in this.binders){var h=this.binders[c];if(!(h instanceof Ea||h instanceof Ma)&&!0===h.expression.isStateDependent){var p=i.paint.get(c);h.expression=p.value,h.updatePaintArray(l.start,l.end,u,t[r],n),o=!0}}}return o},za.prototype.defines=function(){var t=[];for(var e in this.binders)t.push.apply(t,this.binders[e].defines());return t},za.prototype.getPaintVertexBuffers=function(){return this._buffers},za.prototype.getUniforms=function(t,e){var i=[];for(var n in this.binders)for(var o=this.binders[n],r=0,a=o.uniformNames;r<a.length;r+=1){var s=a[r];if(e[s]){var l=o.getBinding(t,e[s]);i.push({name:s,property:n,binding:l})}}return i},za.prototype.setUniforms=function(t,e,i,n){for(var o=0,r=e;o<r.length;o+=1){var a=r[o],s=a.name,l=a.property,u=a.binding;this.binders[l].setUniforms(t,u,n,i.get(l),s)}},za.prototype.updatePatternPaintBuffers=function(t){var e=[];for(var i in this.binders){var n=this.binders[i];if(n instanceof Pa){var o=2===t.fromScale?n.zoomInPaintVertexBuffer:n.zoomOutPaintVertexBuffer;o&&e.push(o)}else(n instanceof Ca||n instanceof Sa)&&n.paintVertexBuffer&&e.push(n.paintVertexBuffer)}this._buffers=e},za.prototype.upload=function(t){for(var e in this.binders)this.binders[e].upload(t);var i=[];for(var n in this.binders){var o=this.binders[n];(o instanceof Ca||o instanceof Sa)&&o.paintVertexBuffer&&i.push(o.paintVertexBuffer)}this._buffers=i},za.prototype.destroy=function(){for(var t in this.binders)this.binders[t].destroy()};function Ia(t,e,i,n){void 0===n&&(n=function(){return!0}),this.programConfigurations={};for(var o=0,r=e;o<r.length;o+=1){var a=r[o];this.programConfigurations[a.id]=za.createDynamic(a,i,n),this.programConfigurations[a.id].layoutAttributes=t}this.needsUpload=!1}function Aa(t,e,i){var n={color:{source:wr,composite:Tr},number:{source:or,composite:wr}},o={"line-pattern":{source:zo,composite:zo},"fill-pattern":{source:zo,composite:zo},"fill-extrusion-pattern":{source:zo,composite:zo}}[t];return o&&o[i]||n[e][i]}Ia.prototype.populatePaintArrays=function(t,e,i,n){for(var o in this.programConfigurations)this.programConfigurations[o].populatePaintArrays(t,e,i,n);this.needsUpload=!0},Ia.prototype.updatePaintArrays=function(t,e,i,n){for(var o=0,r=i;o<r.length;o+=1){var a=r[o];this.needsUpload=this.programConfigurations[a.id].updatePaintArrays(t,e,a,n)||this.needsUpload}},Ia.prototype.get=function(t){return this.programConfigurations[t]},Ia.prototype.upload=function(t){if(this.needsUpload){for(var e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}},Ia.prototype.destroy=function(){for(var t in this.programConfigurations)this.programConfigurations[t].destroy()},Pn("ConstantBinder",Ea),Pn("CrossFadedConstantBinder",Ma),Pn("SourceExpressionBinder",Ca),Pn("CrossFadedCompositeBinder",Pa),Pn("CompositeExpressionBinder",Sa),Pn("ProgramConfiguration",za,{omit:["_buffers"]}),Pn("ProgramConfigurationSet",Ia);var Da=8192,Oa=(16,{min:-1*Math.pow(2,15),max:Math.pow(2,15)-1});function Ra(t){for(var e=Da/t.extent,i=t.loadGeometry(),n=0;n<i.length;n++)for(var o=i[n],r=0;r<o.length;r++){var a=o[r];a.x=Math.round(a.x*e),a.y=Math.round(a.y*e),(a.x<Oa.min||a.x>Oa.max||a.y<Oa.min||a.y>Oa.max)&<("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return i}function Ba(t,e,i,n,o){t.emplaceBack(2*e+(n+1)/2,2*i+(o+1)/2)}function Fa(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new vo,this.indexArray=new dr,this.segments=new Jr,this.programConfigurations=new Ia(Yr,t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter(function(t){return t.isStateDependent()}).map(function(t){return t.id})}function Ua(t,e){for(var i=0;i<t.length;i++)if(qa(e,t[i]))return!0;for(var n=0;n<e.length;n++)if(qa(t,e[n]))return!0;return!!$a(t,e)}function Na(t,e){if(1===t.length)return Ga(e,t[0]);for(var i=0;i<e.length;i++)for(var n=e[i],o=0;o<n.length;o++)if(qa(t,n[o]))return!0;for(var r=0;r<t.length;r++)if(Ga(e,t[r]))return!0;for(var a=0;a<e.length;a++)if($a(t,e[a]))return!0;return!1}function ja(t,e,i){if(1<t.length){if($a(t,e))return!0;for(var n=0;n<e.length;n++)if(Va(e[n],t,i))return!0}for(var o=0;o<t.length;o++)if(Va(t[o],e,i))return!0;return!1}function $a(t,e){if(0===t.length||0===e.length)return!1;for(var i=0;i<t.length-1;i++)for(var n=t[i],o=t[i+1],r=0;r<e.length-1;r++)if(a=n,s=o,l=e[r],u=e[r+1],b(a,l,u)!==b(s,l,u)&&b(a,s,l)!==b(a,s,u))return!0;var a,s,l,u;return!1}function Va(t,e,i){var n=i*i;if(1===e.length)return t.distSqr(e[0])<n;for(var o=1;o<e.length;o++)if(Za(t,e[o-1],e[o])<n)return!0;return!1}function Za(t,e,i){var n=e.distSqr(i);if(0===n)return t.distSqr(e);var o=((t.x-e.x)*(i.x-e.x)+(t.y-e.y)*(i.y-e.y))/n;return o<0?t.distSqr(e):1<o?t.distSqr(i):t.distSqr(i.sub(e)._mult(o)._add(e))}function Ga(t,e){for(var i,n,o,r=!1,a=0;a<t.length;a++)for(var s=0,l=(i=t[a]).length-1;s<i.length;l=s++)n=i[s],o=i[l],n.y>e.y!=o.y>e.y&&e.x<(o.x-n.x)*(e.y-n.y)/(o.y-n.y)+n.x&&(r=!r);return r}function qa(t,e){for(var i=!1,n=0,o=t.length-1;n<t.length;o=n++){var r=t[n],a=t[o];r.y>e.y!=a.y>e.y&&e.x<(a.x-r.x)*(e.y-r.y)/(a.y-r.y)+r.x&&(i=!i)}return i}function Ha(t,e,i){var n=i[0],o=i[2];if(t.x<n.x&&e.x<n.x||t.x>o.x&&e.x>o.x||t.y<n.y&&e.y<n.y||t.y>o.y&&e.y>o.y)return!1;var r=b(t,e,i[0]);return r!==b(t,e,i[1])||r!==b(t,e,i[2])||r!==b(t,e,i[3])}function Wa(t,e,i){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:i.programConfigurations.get(e.id).binders[t].maxValue}function Xa(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Ka(t,e,i,n,o){if(!e[0]&&!e[1])return t;var r=st.convert(e)._mult(o);"viewport"===i&&r._rotate(-n);for(var a=[],s=0;s<t.length;s++){var l=t[s];a.push(l.sub(r))}return a}Fa.prototype.populate=function(t,e){for(var i=0,n=t;i<n.length;i+=1){var o=n[i],r=o.feature,a=o.index,s=o.sourceLayerIndex;if(this.layers[0]._featureFilter(new Nn(this.zoom),r)){var l=Ra(r);this.addFeature(r,l,a),e.featureIndex.insert(r,l,a,s,this.index)}}},Fa.prototype.update=function(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i)},Fa.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Fa.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Fa.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Yr),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},Fa.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Fa.prototype.addFeature=function(t,e,i){for(var n=0,o=e;n<o.length;n+=1)for(var r=0,a=o[n];r<a.length;r+=1){var s=a[r],l=s.x,u=s.y;if(!(l<0||Da<=l||u<0||Da<=u)){var c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),h=c.vertexLength;Ba(this.layoutVertexArray,l,u,-1,-1),Ba(this.layoutVertexArray,l,u,1,-1),Ba(this.layoutVertexArray,l,u,1,1),Ba(this.layoutVertexArray,l,u,-1,1),this.indexArray.emplaceBack(h,h+1,h+2),this.indexArray.emplaceBack(h,h+3,h+2),c.vertexLength+=4,c.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,{})},Pn("CircleBucket",Fa,{omit:["layers"]});var Ja={paint:new lo({"circle-radius":new io($t.paint_circle["circle-radius"]),"circle-color":new io($t.paint_circle["circle-color"]),"circle-blur":new io($t.paint_circle["circle-blur"]),"circle-opacity":new io($t.paint_circle["circle-opacity"]),"circle-translate":new eo($t.paint_circle["circle-translate"]),"circle-translate-anchor":new eo($t.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new eo($t.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new eo($t.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new io($t.paint_circle["circle-stroke-width"]),"circle-stroke-color":new io($t.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new io($t.paint_circle["circle-stroke-opacity"])})},Ya="undefined"!=typeof Float32Array?Float32Array:Array;function Qa(){var t=new Ya(9);return Ya!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function ts(){var t=new Ya(3);return Ya!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function es(t,e,i){var n=new Ya(3);return n[0]=t,n[1]=e,n[2]=i,n}Math.PI;var is;function ns(t,e,i){var n=e[0],o=e[1],r=e[2],a=e[3];return t[0]=i[0]*n+i[4]*o+i[8]*r+i[12]*a,t[1]=i[1]*n+i[5]*o+i[9]*r+i[13]*a,t[2]=i[2]*n+i[6]*o+i[10]*r+i[14]*a,t[3]=i[3]*n+i[7]*o+i[11]*r+i[15]*a,t}function os(){var t=new Ya(4);return Ya!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}ts(),is=new Ya(4),Ya!=Float32Array&&(is[0]=0,is[1]=0,is[2]=0,is[3]=0);var rs;ts(),es(1,0,0),es(0,1,0),os(),os(),Qa(),rs=new Ya(2),Ya!=Float32Array&&(rs[0]=0,rs[1]=0);var as,ss=((as=po)&&(ls.__proto__=as),((ls.prototype=Object.create(as&&as.prototype)).constructor=ls).prototype.createBucket=function(t){return new Fa(t)},ls.prototype.queryRadius=function(t){var e=t;return Wa("circle-radius",this,e)+Wa("circle-stroke-width",this,e)+Xa(this.paint.get("circle-translate"))},ls.prototype.queryIntersectsFeature=function(t,e,i,n,o,r,a,s){for(var l=Ka(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),r.angle,a),u=this.paint.get("circle-radius").evaluate(e,i)+this.paint.get("circle-stroke-width").evaluate(e,i),c="map"===this.paint.get("circle-pitch-alignment"),h=c?l:function(t,e){return l.map(function(t){return us(t,e)})}(0,s),p=c?u*a:u,d=0,f=n;d<f.length;d+=1)for(var m=0,_=f[d];m<_.length;m+=1){var g=_[m],y=c?g:us(g,s),v=p,x=ns([],[g.x,g.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?v*=x[3]/r.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(v*=r.cameraToCenterDistance/x[3]),L=v,qa(b=h,w=y)||Va(w,b,L))return!0}var b,w,L;return!1},ls);function ls(t){as.call(this,t,Ja)}function us(t,e){var i=ns([],[t.x,t.y,0,1],e);return new st(i[0]/i[3],i[1]/i[3])}var cs,hs=((cs=Fa)&&(ps.__proto__=cs),(ps.prototype=Object.create(cs&&cs.prototype)).constructor=ps);function ps(){cs.apply(this,arguments)}function ds(t,e,i,n){var o=e.width,r=e.height;if(n){if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==o*r*i)throw new RangeError("mismatched image size")}else n=new Uint8Array(o*r*i);return t.width=o,t.height=r,t.data=n,t}function fs(t,e,i){var n=e.width,o=e.height;if(n!==t.width||o!==t.height){var r=ds({},{width:n,height:o},i);ms(t,r,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,n),height:Math.min(t.height,o)},i),t.width=n,t.height=o,t.data=r.data}}function ms(t,e,i,n,o,r){if(0===o.width||0===o.height)return e;if(o.width>t.width||o.height>t.height||i.x>t.width-o.width||i.y>t.height-o.height)throw new RangeError("out of range source coordinates for image copy");if(o.width>e.width||o.height>e.height||n.x>e.width-o.width||n.y>e.height-o.height)throw new RangeError("out of range destination coordinates for image copy");for(var a=t.data,s=e.data,l=0;l<o.height;l++)for(var u=((i.y+l)*t.width+i.x)*r,c=((n.y+l)*e.width+n.x)*r,h=0;h<o.width*r;h++)s[c+h]=a[u+h];return e}Pn("HeatmapBucket",hs,{omit:["layers"]});var _s=function(t,e){ds(this,t,1,e)};_s.prototype.resize=function(t){fs(this,t,1)},_s.prototype.clone=function(){return new _s({width:this.width,height:this.height},new Uint8Array(this.data))},_s.copy=function(t,e,i,n,o){ms(t,e,i,n,o,1)};function gs(t,e){ds(this,t,4,e)}gs.prototype.resize=function(t){fs(this,t,4)},gs.prototype.replace=function(t,e){e?this.data.set(t):t instanceof Uint8ClampedArray?this.data=new Uint8Array(t.buffer):this.data=t},gs.prototype.clone=function(){return new gs({width:this.width,height:this.height},new Uint8Array(this.data))},gs.copy=function(t,e,i,n,o){ms(t,e,i,n,o,4)},Pn("AlphaImage",_s),Pn("RGBAImage",gs);var ys={paint:new lo({"heatmap-radius":new io($t.paint_heatmap["heatmap-radius"]),"heatmap-weight":new io($t.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new eo($t.paint_heatmap["heatmap-intensity"]),"heatmap-color":new so($t.paint_heatmap["heatmap-color"]),"heatmap-opacity":new eo($t.paint_heatmap["heatmap-opacity"])})};function vs(t,e){for(var i=new Uint8Array(1024),n={},o=0,r=0;o<256;o++,r+=4){n[e]=o/255;var a=t.evaluate(n);i[r+0]=Math.floor(255*a.r/a.a),i[r+1]=Math.floor(255*a.g/a.a),i[r+2]=Math.floor(255*a.b/a.a),i[r+3]=Math.floor(255*a.a)}return new gs({width:256,height:1},i)}var xs,bs,ws=((bs=po)&&(Ss.__proto__=bs),((Ss.prototype=Object.create(bs&&bs.prototype)).constructor=Ss).prototype.createBucket=function(t){return new hs(t)},Ss.prototype._handleSpecialPaintPropertyUpdate=function(t){"heatmap-color"===t&&this._updateColorRamp()},Ss.prototype._updateColorRamp=function(){var t=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=vs(t,"heatmapDensity"),this.colorRampTexture=null},Ss.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},Ss.prototype.queryRadius=function(){return 0},Ss.prototype.queryIntersectsFeature=function(){return!1},Ss.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility},Ss),Ls={paint:new lo({"hillshade-illumination-direction":new eo($t.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new eo($t.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new eo($t.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new eo($t.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new eo($t.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new eo($t.paint_hillshade["hillshade-accent-color"])})},ks=((xs=po)&&(Cs.__proto__=xs),((Cs.prototype=Object.create(xs&&xs.prototype)).constructor=Cs).prototype.hasOffscreenPass=function(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility},Cs),Ts=_o([{name:"a_pos",components:2,type:"Int16"}],4).members,Es=Ps,Ms=Ps;function Cs(t){xs.call(this,t,Ls)}function Ss(t){bs.call(this,t,ys),this._updateColorRamp()}function Ps(t,e,i){i=i||2;var n,o,r,a,s,l,u,c=e&&e.length,h=c?e[0]*i:t.length,p=zs(t,0,h,i,!0),d=[];if(!p||p.next===p.prev)return d;if(c&&(p=function(t,e,i,n){var o,r,a,s=[];for(o=0,r=e.length;o<r;o++)(a=zs(t,e[o]*n,o<r-1?e[o+1]*n:t.length,n,!1))===a.next&&(a.steiner=!0),s.push(js(a));for(s.sort(Fs),o=0;o<s.length;o++)Us(s[o],i),i=Is(i,i.next);return i}(t,e,p,i)),t.length>80*i){n=r=t[0],o=a=t[1];for(var f=i;f<h;f+=i)(s=t[f])<n&&(n=s),(l=t[f+1])<o&&(o=l),r<s&&(r=s),a<l&&(a=l);u=0!==(u=Math.max(r-n,a-o))?1/u:0}return As(p,d,i,n,o,u),d}function zs(t,e,i,n,o){var r,a;if(o===0<Js(t,e,i,n))for(r=e;r<i;r+=n)a=Ws(r,t[r],t[r+1],a);else for(r=i-n;e<=r;r-=n)a=Ws(r,t[r],t[r+1],a);return a&&Zs(a,a.next)&&(Xs(a),a=a.next),a}function Is(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!Zs(n,n.next)&&0!==Vs(n.prev,n,n.next))n=n.next;else{if(Xs(n),(n=e=n.prev)===n.next)break;i=!0}}while(i||n!==e);return e}function As(t,e,i,n,o,r,a){if(t){!a&&r&&function(t,e,i,n){for(var o=t;null===o.z&&(o.z=Ns(o.x,o.y,e,i,n)),o.prevZ=o.prev,o.nextZ=o.next,(o=o.next)!==t;);o.prevZ.nextZ=null,o.prevZ=null,function(t){var e,i,n,o,r,a,s,l,u=1;do{for(i=t,r=t=null,a=0;i;){for(a++,n=i,e=s=0;e<u&&(s++,n=n.nextZ);e++);for(l=u;0<s||0<l&&n;)0!==s&&(0===l||!n||i.z<=n.z)?(i=(o=i).nextZ,s--):(n=(o=n).nextZ,l--),r?r.nextZ=o:t=o,o.prevZ=r,r=o;i=n}r.nextZ=null,u*=2}while(1<a)}(o)}(t,n,o,r);for(var s,l,u=t;t.prev!==t.next;)if(s=t.prev,l=t.next,r?Os(t,n,o,r):Ds(t))e.push(s.i/i),e.push(t.i/i),e.push(l.i/i),Xs(t),t=l.next,u=l.next;else if((t=l)===u){a?1===a?As(t=Rs(t,e,i),e,i,n,o,r,2):2===a&&Bs(t,e,i,n,o,r):As(Is(t),e,i,n,o,r,1);break}}}function Ds(t){var e=t.prev,i=t,n=t.next;if(0<=Vs(e,i,n))return!1;for(var o=t.next.next;o!==t.prev;){if($s(e.x,e.y,i.x,i.y,n.x,n.y,o.x,o.y)&&0<=Vs(o.prev,o,o.next))return!1;o=o.next}return!0}function Os(t,e,i,n){var o=t.prev,r=t,a=t.next;if(0<=Vs(o,r,a))return!1;for(var s=o.x<r.x?o.x<a.x?o.x:a.x:r.x<a.x?r.x:a.x,l=o.y<r.y?o.y<a.y?o.y:a.y:r.y<a.y?r.y:a.y,u=o.x>r.x?o.x>a.x?o.x:a.x:r.x>a.x?r.x:a.x,c=o.y>r.y?o.y>a.y?o.y:a.y:r.y>a.y?r.y:a.y,h=Ns(s,l,e,i,n),p=Ns(u,c,e,i,n),d=t.prevZ,f=t.nextZ;d&&d.z>=h&&f&&f.z<=p;){if(d!==t.prev&&d!==t.next&&$s(o.x,o.y,r.x,r.y,a.x,a.y,d.x,d.y)&&0<=Vs(d.prev,d,d.next))return!1;if(d=d.prevZ,f!==t.prev&&f!==t.next&&$s(o.x,o.y,r.x,r.y,a.x,a.y,f.x,f.y)&&0<=Vs(f.prev,f,f.next))return!1;f=f.nextZ}for(;d&&d.z>=h;){if(d!==t.prev&&d!==t.next&&$s(o.x,o.y,r.x,r.y,a.x,a.y,d.x,d.y)&&0<=Vs(d.prev,d,d.next))return!1;d=d.prevZ}for(;f&&f.z<=p;){if(f!==t.prev&&f!==t.next&&$s(o.x,o.y,r.x,r.y,a.x,a.y,f.x,f.y)&&0<=Vs(f.prev,f,f.next))return!1;f=f.nextZ}return!0}function Rs(t,e,i){var n=t;do{var o=n.prev,r=n.next.next;!Zs(o,r)&&Gs(o,n,n.next,r)&&qs(o,r)&&qs(r,o)&&(e.push(o.i/i),e.push(n.i/i),e.push(r.i/i),Xs(n),Xs(n.next),n=t=r),n=n.next}while(n!==t);return n}function Bs(t,e,i,n,o,r){var a,s,l=t;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&(s=u,(a=l).next.i!==s.i&&a.prev.i!==s.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&Gs(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(a,s)&&qs(a,s)&&qs(s,a)&&function(t,e){for(var i=t,n=!1,o=(t.x+e.x)/2,r=(t.y+e.y)/2;i.y>r!=i.next.y>r&&i.next.y!==i.y&&o<(i.next.x-i.x)*(r-i.y)/(i.next.y-i.y)+i.x&&(n=!n),(i=i.next)!==t;);return n}(a,s))){var c=Hs(l,u);return l=Is(l,l.next),c=Is(c,c.next),As(l,e,i,n,o,r),void As(c,e,i,n,o,r)}u=u.next}l=l.next}while(l!==t)}function Fs(t,e){return t.x-e.x}function Us(t,e){if(e=function(t,e){var i,n=e,o=t.x,r=t.y,a=-1/0;do{if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){var s=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=o&&a<s){if((a=s)===o){if(r===n.y)return n;if(r===n.next.y)return n.next}i=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!i)return null;if(o===a)return i.prev;var l,u=i,c=i.x,h=i.y,p=1/0;for(n=i.next;n!==u;)o>=n.x&&n.x>=c&&o!==n.x&&$s(r<h?o:a,r,c,h,r<h?a:o,r,n.x,n.y)&&((l=Math.abs(r-n.y)/(o-n.x))<p||l===p&&n.x>i.x)&&qs(n,t)&&(i=n,p=l),n=n.next;return i}(t,e)){var i=Hs(e,t);Is(i,i.next)}}function Ns(t,e,i,n,o){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*o)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*o)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function js(t){for(var e=t,i=t;(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),(e=e.next)!==t;);return i}function $s(t,e,i,n,o,r,a,s){return 0<=(o-a)*(e-s)-(t-a)*(r-s)&&0<=(t-a)*(n-s)-(i-a)*(e-s)&&0<=(i-a)*(r-s)-(o-a)*(n-s)}function Vs(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function Zs(t,e){return t.x===e.x&&t.y===e.y}function Gs(t,e,i,n){return!!(Zs(t,e)&&Zs(i,n)||Zs(t,n)&&Zs(i,e))||0<Vs(t,e,i)!=0<Vs(t,e,n)&&0<Vs(i,n,t)!=0<Vs(i,n,e)}function qs(t,e){return Vs(t.prev,t,t.next)<0?0<=Vs(t,e,t.next)&&0<=Vs(t,t.prev,e):Vs(t,e,t.prev)<0||Vs(t,t.next,e)<0}function Hs(t,e){var i=new Ks(t.i,t.x,t.y),n=new Ks(e.i,e.x,e.y),o=t.next,r=e.prev;return(t.next=e).prev=t,(i.next=o).prev=i,(n.next=i).prev=n,(r.next=n).prev=r,n}function Ws(t,e,i,n){var o=new Ks(t,e,i);return n?(o.next=n.next,(o.prev=n).next.prev=o,n.next=o):(o.prev=o).next=o,o}function Xs(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 Ks(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Js(t,e,i,n){for(var o=0,r=e,a=i-n;r<i;r+=n)o+=(t[a]-t[r])*(t[r+1]+t[a+1]),a=r;return o}function Ys(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function Qs(t,e){return t<e?-1:e<t?1:0}function tl(t,e){var i,n,o,r,a,s=t.length;if(s<=1)return[t];for(var l,u,c=[],h=0;h<s;h++){var p=w(t[h]);0!==p&&(t[h].area=Math.abs(p),void 0===u&&(u=p<0),u===p<0?(l&&c.push(l),l=[t[h]]):l.push(t[h]))}if(l&&c.push(l),1<e)for(var d=0;d<c.length;d++)c[d].length<=e||(i=c[d],n=e,o=1,r=c[d].length-1,a=el,function t(e,i,n,o,r){for(;n<o;){if(600<o-n){var a=o-n+1,s=i-n+1,l=Math.log(a),u=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*u*(a-u)/a)*(s-a/2<0?-1:1);t(e,i,Math.max(n,Math.floor(i-s*u/a+c)),Math.min(o,Math.floor(i+(a-s)*u/a+c)),r)}var h=e[i],p=n,d=o;for(Ys(e,n,i),0<r(e[o],h)&&Ys(e,n,o);p<d;){for(Ys(e,p,d),p++,d--;r(e[p],h)<0;)p++;for(;0<r(e[d],h);)d--}0===r(e[n],h)?Ys(e,n,d):Ys(e,++d,o),d<=i&&(n=d+1),i<=d&&(o=d-1)}}(i,n,o||0,r||i.length-1,a||Qs),c[d]=c[d].slice(0,e));return c}function el(t,e){return e.area-t.area}function il(t,e,i){for(var n=i.patternDependencies,o=!1,r=0,a=e;r<a.length;r+=1){var s=a[r].paint.get(t+"-pattern");s.isConstant()||(o=!0);var l=s.constantOr(null);l&&(o=!0,n[l.to]=!0,n[l.from]=!0)}return o}function nl(t,e,i,n,o){for(var r=o.patternDependencies,a=0,s=e;a<s.length;a+=1){var l=s[a],u=l.paint.get(t+"-pattern").value;if("constant"!==u.kind){var c=u.evaluate({zoom:n-1},i,{}),h=u.evaluate({zoom:n},i,{}),p=u.evaluate({zoom:n+1},i,{});r[c]=!0,r[h]=!0,r[p]=!0,i.patterns[l.id]={min:c,mid:h,max:p}}}return i}Ps.deviation=function(t,e,i,n){var o=e&&e.length,r=o?e[0]*i:t.length,a=Math.abs(Js(t,0,r,i));if(o)for(var s=0,l=e.length;s<l;s++){var u=e[s]*i,c=s<l-1?e[s+1]*i:t.length;a-=Math.abs(Js(t,u,c,i))}var h=0;for(s=0;s<n.length;s+=3){var p=n[s]*i,d=n[s+1]*i,f=n[s+2]*i;h+=Math.abs((t[p]-t[f])*(t[1+d]-t[1+p])-(t[p]-t[d])*(t[1+f]-t[1+p]))}return 0===a&&0===h?0:Math.abs((h-a)/a)},Ps.flatten=function(t){for(var e=t[0][0].length,i={vertices:[],holes:[],dimensions:e},n=0,o=0;o<t.length;o++){for(var r=0;r<t[o].length;r++)for(var a=0;a<e;a++)i.vertices.push(t[o][r][a]);0<o&&(n+=t[o-1].length,i.holes.push(n))}return i},Es.default=Ms;function ol(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new vo,this.indexArray=new dr,this.indexArray2=new _r,this.programConfigurations=new Ia(Ts,t.layers,t.zoom),this.segments=new Jr,this.segments2=new Jr,this.stateDependentLayerIds=this.layers.filter(function(t){return t.isStateDependent()}).map(function(t){return t.id})}ol.prototype.populate=function(t,e){this.features=[],this.hasPattern=il("fill",this.layers,e);for(var i=0,n=t;i<n.length;i+=1){var o=n[i],r=o.feature,a=o.index,s=o.sourceLayerIndex;if(this.layers[0]._featureFilter(new Nn(this.zoom),r)){var l=Ra(r),u={sourceLayerIndex:s,index:a,geometry:l,properties:r.properties,type:r.type,patterns:{}};void 0!==r.id&&(u.id=r.id),this.hasPattern?this.features.push(nl("fill",this.layers,u,this.zoom,e)):this.addFeature(u,l,a,{}),e.featureIndex.insert(r,l,a,s,this.index)}}},ol.prototype.update=function(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i)},ol.prototype.addFeatures=function(t,e){for(var i=0,n=this.features;i<n.length;i+=1){var o=n[i],r=o.geometry;this.addFeature(o,r,o.index,e)}},ol.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},ol.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},ol.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ts),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0},ol.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},ol.prototype.addFeature=function(t,e,i,n){for(var o=0,r=tl(e,500);o<r.length;o+=1){for(var a=r[o],s=0,l=0,u=a;l<u.length;l+=1)s+=u[l].length;for(var c=this.segments.prepareSegment(s,this.layoutVertexArray,this.indexArray),h=c.vertexLength,p=[],d=[],f=0,m=a;f<m.length;f+=1){var _=m[f];if(0!==_.length){_!==a[0]&&d.push(p.length/2);var g=this.segments2.prepareSegment(_.length,this.layoutVertexArray,this.indexArray2),y=g.vertexLength;this.layoutVertexArray.emplaceBack(_[0].x,_[0].y),this.indexArray2.emplaceBack(y+_.length-1,y),p.push(_[0].x),p.push(_[0].y);for(var v=1;v<_.length;v++)this.layoutVertexArray.emplaceBack(_[v].x,_[v].y),this.indexArray2.emplaceBack(y+v-1,y+v),p.push(_[v].x),p.push(_[v].y);g.vertexLength+=_.length,g.primitiveLength+=_.length}}for(var x=Es(p,d),b=0;b<x.length;b+=3)this.indexArray.emplaceBack(h+x[b],h+x[b+1],h+x[b+2]);c.vertexLength+=s,c.primitiveLength+=x.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,n)},Pn("FillBucket",ol,{omit:["layers","features"]});var rl,al={paint:new lo({"fill-antialias":new eo($t.paint_fill["fill-antialias"]),"fill-opacity":new io($t.paint_fill["fill-opacity"]),"fill-color":new io($t.paint_fill["fill-color"]),"fill-outline-color":new io($t.paint_fill["fill-outline-color"]),"fill-translate":new eo($t.paint_fill["fill-translate"]),"fill-translate-anchor":new eo($t.paint_fill["fill-translate-anchor"]),"fill-pattern":new ro($t.paint_fill["fill-pattern"])})},sl=((rl=po)&&(cl.__proto__=rl),((cl.prototype=Object.create(rl&&rl.prototype)).constructor=cl).prototype.recalculate=function(t){rl.prototype.recalculate.call(this,t);var e=this.paint._values["fill-outline-color"];"constant"===e.value.kind&&void 0===e.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},cl.prototype.createBucket=function(t){return new ol(t)},cl.prototype.queryRadius=function(){return Xa(this.paint.get("fill-translate"))},cl.prototype.queryIntersectsFeature=function(t,e,i,n,o,r,a){return Na(Ka(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),r.angle,a),n)},cl.prototype.isTileClipped=function(){return!0},cl),ll=_o([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,ul=hl;function cl(t){rl.call(this,t,al)}function hl(t,e,i,n,o){this.properties={},this.extent=i,this.type=0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=o,t.readFields(pl,this,e)}function pl(t,e,i){1==t?e.id=i.readVarint():2==t?function(t,e){for(var i=t.readVarint()+t.pos;t.pos<i;){var n=e._keys[t.readVarint()],o=e._values[t.readVarint()];e.properties[n]=o}}(i,e):3==t?e.type=i.readVarint():4==t&&(e._geometry=i.pos)}function dl(t){for(var e,i,n=0,o=0,r=t.length,a=r-1;o<r;a=o++)e=t[o],n+=((i=t[a]).x-e.x)*(e.y+i.y);return n}hl.types=["Unknown","Point","LineString","Polygon"],hl.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,i=t.readVarint()+t.pos,n=1,o=0,r=0,a=0,s=[];t.pos<i;){if(o<=0){var l=t.readVarint();n=7&l,o=l>>3}if(o--,1===n||2===n)r+=t.readSVarint(),a+=t.readSVarint(),1===n&&(e&&s.push(e),e=[]),e.push(new st(r,a));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&s.push(e),s},hl.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,i=1,n=0,o=0,r=0,a=1/0,s=-1/0,l=1/0,u=-1/0;t.pos<e;){if(n<=0){var c=t.readVarint();i=7&c,n=c>>3}if(n--,1===i||2===i)(o+=t.readSVarint())<a&&(a=o),s<o&&(s=o),(r+=t.readSVarint())<l&&(l=r),u<r&&(u=r);else if(7!==i)throw new Error("unknown command "+i)}return[a,l,s,u]},hl.prototype.toGeoJSON=function(t,e,i){var n,o,r=this.extent*Math.pow(2,i),a=this.extent*t,s=this.extent*e,l=this.loadGeometry(),u=hl.types[this.type];function c(t){for(var e=0;e<t.length;e++){var i=t[e],n=180-360*(i.y+s)/r;t[e]=[360*(i.x+a)/r-180,360/Math.PI*Math.atan(Math.exp(n*Math.PI/180))-90]}}switch(this.type){case 1:var h=[];for(n=0;n<l.length;n++)h[n]=l[n][0];c(l=h);break;case 2:for(n=0;n<l.length;n++)c(l[n]);break;case 3:for(l=function(t){var e=t.length;if(e<=1)return[t];for(var i,n,o=[],r=0;r<e;r++){var a=dl(t[r]);0!==a&&(void 0===n&&(n=a<0),n===a<0?(i&&o.push(i),i=[t[r]]):i.push(t[r]))}return i&&o.push(i),o}(l),n=0;n<l.length;n++)for(o=0;o<l[n].length;o++)c(l[n][o])}1===l.length?l=l[0]:u="Multi"+u;var p={type:"Feature",geometry:{type:u,coordinates:l},properties:this.properties};return"id"in this&&(p.id=this.id),p};var fl=ml;function ml(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(_l,this,e),this.length=this._features.length}function _l(t,e,i){15===t?e.version=i.readVarint():1===t?e.name=i.readString():5===t?e.extent=i.readVarint():2===t?e._features.push(i.pos):3===t?e._keys.push(i.readString()):4===t&&e._values.push(function(t){for(var e=null,i=t.readVarint()+t.pos;t.pos<i;){var n=t.readVarint()>>3;e=1==n?t.readString():2==n?t.readFloat():3==n?t.readDouble():4==n?t.readVarint64():5==n?t.readVarint():6==n?t.readSVarint():7==n?t.readBoolean():null}return e}(i))}function gl(t,e,i){if(3===t){var n=new fl(i,i.readVarint()+i.pos);n.length&&(e[n.name]=n)}}ml.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 ul(this._pbf,e,this.extent,this._keys,this._values)};var yl={VectorTile:function(t,e){this.layers=t.readFields(gl,{},e)},VectorTileFeature:ul,VectorTileLayer:fl},vl=yl.VectorTileFeature.types,xl=Math.pow(2,13);function bl(t,e,i,n,o,r,a,s){t.emplaceBack(e,i,2*Math.floor(n*xl)+a,o*xl*2,r*xl*2,Math.round(s))}function wl(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new To,this.indexArray=new dr,this.programConfigurations=new Ia(ll,t.layers,t.zoom),this.segments=new Jr,this.stateDependentLayerIds=this.layers.filter(function(t){return t.isStateDependent()}).map(function(t){return t.id})}wl.prototype.populate=function(t,e){this.features=[],this.hasPattern=il("fill-extrusion",this.layers,e);for(var i=0,n=t;i<n.length;i+=1){var o=n[i],r=o.feature,a=o.index,s=o.sourceLayerIndex;if(this.layers[0]._featureFilter(new Nn(this.zoom),r)){var l=Ra(r),u={sourceLayerIndex:s,index:a,geometry:l,properties:r.properties,type:r.type,patterns:{}};void 0!==r.id&&(u.id=r.id),this.hasPattern?this.features.push(nl("fill-extrusion",this.layers,u,this.zoom,e)):this.addFeature(u,l,a,{}),e.featureIndex.insert(r,l,a,s,this.index,!0)}}},wl.prototype.addFeatures=function(t,e){for(var i=0,n=this.features;i<n.length;i+=1){var o=n[i],r=o.geometry;this.addFeature(o,r,o.index,e)}},wl.prototype.update=function(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i)},wl.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},wl.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},wl.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ll),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},wl.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},wl.prototype.addFeature=function(t,e,i,n){for(var o=0,r=tl(e,500);o<r.length;o+=1){for(var a=r[o],s=0,l=0,u=a;l<u.length;l+=1)s+=u[l].length;for(var c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),h=0,p=a;h<p.length;h+=1){var d=p[h];if(0!==d.length&&!((A=d).every(function(t){return t.x<0})||A.every(function(t){return t.x>Da})||A.every(function(t){return t.y<0})||A.every(function(t){return t.y>Da})))for(var f=0,m=0;m<d.length;m++){var _=d[m];if(1<=m){var g=d[m-1];if(I=g,!((z=_).x===I.x&&(z.x<0||z.x>Da)||z.y===I.y&&(z.y<0||z.y>Da))){c.vertexLength+4>Jr.MAX_VERTEX_ARRAY_LENGTH&&(c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var y=_.sub(g)._perp()._unit(),v=g.dist(_);32768<f+v&&(f=0),bl(this.layoutVertexArray,_.x,_.y,y.x,y.y,0,0,f),bl(this.layoutVertexArray,_.x,_.y,y.x,y.y,0,1,f),f+=v,bl(this.layoutVertexArray,g.x,g.y,y.x,y.y,0,0,f),bl(this.layoutVertexArray,g.x,g.y,y.x,y.y,0,1,f);var x=c.vertexLength;this.indexArray.emplaceBack(x,x+2,x+1),this.indexArray.emplaceBack(x+1,x+2,x+3),c.vertexLength+=4,c.primitiveLength+=2}}}}if(c.vertexLength+s>Jr.MAX_VERTEX_ARRAY_LENGTH&&(c=this.segments.prepareSegment(s,this.layoutVertexArray,this.indexArray)),"Polygon"===vl[t.type]){for(var b=[],w=[],L=c.vertexLength,k=0,T=a;k<T.length;k+=1){var E=T[k];if(0!==E.length){E!==a[0]&&w.push(b.length/2);for(var M=0;M<E.length;M++){var C=E[M];bl(this.layoutVertexArray,C.x,C.y,0,0,1,1,0),b.push(C.x),b.push(C.y)}}}for(var S=Es(b,w),P=0;P<S.length;P+=3)this.indexArray.emplaceBack(L+S[P],L+S[P+2],L+S[P+1]);c.primitiveLength+=S.length/3,c.vertexLength+=s}}var z,I,A;this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,n)},Pn("FillExtrusionBucket",wl,{omit:["layers","features"]});var Ll,kl={paint:new lo({"fill-extrusion-opacity":new eo($t["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new io($t["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new eo($t["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new eo($t["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new ro($t["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new io($t["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new io($t["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new eo($t["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},Tl=((Ll=po)&&(El.__proto__=Ll),((El.prototype=Object.create(Ll&&Ll.prototype)).constructor=El).prototype.createBucket=function(t){return new wl(t)},El.prototype.queryRadius=function(){return Xa(this.paint.get("fill-extrusion-translate"))},El.prototype.is3D=function(){return!0},El.prototype.queryIntersectsFeature=function(t,e,i,n,o,r,a,s){var l=Ka(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),r.angle,a),u=this.paint.get("fill-extrusion-height").evaluate(e,i),c=this.paint.get("fill-extrusion-base").evaluate(e,i),h=function(t,e){for(var i=[],n=0,o=l;n<o.length;n+=1){var r=o[n],a=[r.x,r.y,0,1];ns(a,a,e),i.push(new st(a[0]/a[3],a[1]/a[3]))}return i}(0,s),p=function(t,e,i,n){for(var o=[],r=[],a=n[8]*e,s=n[9]*e,l=n[10]*e,u=n[11]*e,c=n[8]*i,h=n[9]*i,p=n[10]*i,d=n[11]*i,f=0,m=t;f<m.length;f+=1){for(var _=[],g=[],y=0,v=m[f];y<v.length;y+=1){var x=v[y],b=x.x,w=x.y,L=n[0]*b+n[4]*w+n[12],k=n[1]*b+n[5]*w+n[13],T=n[2]*b+n[6]*w+n[14],E=n[3]*b+n[7]*w+n[15],M=T+l,C=E+u,S=L+c,P=k+h,z=T+p,I=E+d,A=new st((L+a)/C,(k+s)/C);A.z=M/C,_.push(A);var D=new st(S/I,P/I);D.z=z/I,g.push(D)}o.push(_),r.push(g)}return[o,r]}(n,c,u,s);return function(t,e,i){var n=1/0;Na(i,e)&&(n=Cl(i,e[0]));for(var o=0;o<e.length;o++)for(var r=e[o],a=t[o],s=0;s<r.length-1;s++){var l=r[s],u=r[s+1],c=a[s],h=[l,u,a[s+1],c,l];Ua(i,h)&&(n=Math.min(n,Cl(i,h)))}return n!==1/0&&n}(p[0],p[1],h)},El);function El(t){Ll.call(this,t,kl)}function Ml(t,e){return t.x*e.x+t.y*e.y}function Cl(t,e){if(1===t.length){var i=e[0],n=e[1],o=e[3],r=t[0],a=n.sub(i),s=o.sub(i),l=r.sub(i),u=Ml(a,a),c=Ml(a,s),h=Ml(s,s),p=Ml(l,a),d=Ml(l,s),f=u*h-c*c,m=(h*p-c*d)/f,_=(u*d-c*p)/f,g=1-m-_;return i.z*g+n.z*m+o.z*_}for(var y=1/0,v=0,x=e;v<x.length;v+=1){var b=x[v];y=Math.min(y,b.z)}return y}var Sl=_o([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,Pl=yl.VectorTileFeature.types,zl=Math.cos(Math.PI/180*37.5),Il=Math.pow(2,14)/.5;function Al(t,e,i,n,o,r,a){t.emplaceBack((e.x<<1)+(n?1:0),(e.y<<1)+(o?1:0),Math.round(63*i.x)+128,Math.round(63*i.y)+128,1+(0===r?0:r<0?-1:1)|(.5*a&63)<<2,.5*a>>6)}function Dl(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=t.index,this.features=[],this.hasPattern=!1,this.layoutVertexArray=new Co,this.indexArray=new dr,this.programConfigurations=new Ia(Sl,t.layers,t.zoom),this.segments=new Jr,this.stateDependentLayerIds=this.layers.filter(function(t){return t.isStateDependent()}).map(function(t){return t.id})}function Ol(t,e){return(t/e.tileTotal*(e.end-e.start)+e.start)*(Il-1)}Dl.prototype.populate=function(t,e){this.features=[],this.hasPattern=il("line",this.layers,e);for(var i=0,n=t;i<n.length;i+=1){var o=n[i],r=o.feature,a=o.index,s=o.sourceLayerIndex;if(this.layers[0]._featureFilter(new Nn(this.zoom),r)){var l=Ra(r),u={sourceLayerIndex:s,index:a,geometry:l,properties:r.properties,type:r.type,patterns:{}};void 0!==r.id&&(u.id=r.id),this.hasPattern?this.features.push(nl("line",this.layers,u,this.zoom,e)):this.addFeature(u,l,a,{}),e.featureIndex.insert(r,l,a,s,this.index)}}},Dl.prototype.update=function(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i)},Dl.prototype.addFeatures=function(t,e){for(var i=0,n=this.features;i<n.length;i+=1){var o=n[i],r=o.geometry;this.addFeature(o,r,o.index,e)}},Dl.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Dl.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Dl.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Sl),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},Dl.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Dl.prototype.addFeature=function(t,e,i,n){for(var o=this.layers[0].layout,r=o.get("line-join").evaluate(t,{}),a=o.get("line-cap"),s=o.get("line-miter-limit"),l=o.get("line-round-limit"),u=0,c=e;u<c.length;u+=1){var h=c[u];this.addLine(h,t,r,a,s,l,i,n)}},Dl.prototype.addLine=function(t,e,i,n,o,r,a,s){var l=null;e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end")&&(l={start:e.properties.mapbox_clip_start,end:e.properties.mapbox_clip_end,tileTotal:void 0});for(var u="Polygon"===Pl[e.type],c=t.length;2<=c&&t[c-1].equals(t[c-2]);)c--;for(var h=0;h<c-1&&t[h].equals(t[h+1]);)h++;if(!(c<(u?3:2))){l&&(l.tileTotal=function(t,e,i){for(var n,o,r=0,a=h;a<i-1;a++)n=t[a],o=t[a+1],r+=n.dist(o);return r}(t,0,c)),"bevel"===i&&(o=1.05);var p,d,f,m=Da/(512*this.overscaling)*15,_=t[h],g=this.segments.prepareSegment(10*c,this.layoutVertexArray,this.indexArray),y=n,v=u?"butt":n,x=!(this.distance=0),b=void 0,w=void 0,L=void 0,k=void 0;this.e1=this.e2=this.e3=-1,u&&(p=t[c-2],k=_.sub(p)._unit()._perp());for(var T=h;T<c;T++)if(!(w=u&&T===c-1?t[h+1]:t[T+1])||!t[T].equals(w)){k&&(L=k),p&&(b=p),p=t[T],k=w?w.sub(p)._unit()._perp():L;var E=(L=L||k).add(k);0===E.x&&0===E.y||E._unit();var M=E.x*k.x+E.y*k.y,C=0!=M?1/M:1/0,S=M<zl&&b&&w;if(S&&h<T){var P=p.dist(b);if(2*m<P){var z=p.sub(p.sub(b)._mult(m/P)._round());this.distance+=z.dist(b),this.addCurrentVertex(z,this.distance,L.mult(1),0,0,!1,g,l),b=z}}var I=b&&w,A=I?i:w?y:v;if(I&&"round"===A&&(C<r?A="miter":C<=2&&(A="fakeround")),"miter"===A&&o<C&&(A="bevel"),"bevel"===A&&(2<C&&(A="flipbevel"),C<o&&(A="miter")),b&&(this.distance+=p.dist(b)),"miter"===A)E._mult(C),this.addCurrentVertex(p,this.distance,E,0,0,!1,g,l);else if("flipbevel"===A){if(100<C)E=k.clone().mult(-1);else{var D=0<L.x*k.y-L.y*k.x?-1:1,O=C*L.add(k).mag()/L.sub(k).mag();E._perp()._mult(O*D)}this.addCurrentVertex(p,this.distance,E,0,0,!1,g,l),this.addCurrentVertex(p,this.distance,E.mult(-1),0,0,!1,g,l)}else if("bevel"===A||"fakeround"===A){var R=0<L.x*k.y-L.y*k.x,B=-Math.sqrt(C*C-1);if(R?(f=0,d=B):(d=0,f=B),x||this.addCurrentVertex(p,this.distance,L,d,f,!1,g,l),"fakeround"===A){for(var F=Math.floor(8*(.5-(M-.5))),U=void 0,N=0;N<F;N++)U=k.mult((N+1)/(F+1))._add(L)._unit(),this.addPieSliceVertex(p,this.distance,U,R,g,l);this.addPieSliceVertex(p,this.distance,E,R,g,l);for(var j=F-1;0<=j;j--)U=L.mult((j+1)/(F+1))._add(k)._unit(),this.addPieSliceVertex(p,this.distance,U,R,g,l)}w&&this.addCurrentVertex(p,this.distance,k,-d,-f,!1,g,l)}else"butt"===A?(x||this.addCurrentVertex(p,this.distance,L,0,0,!1,g,l),w&&this.addCurrentVertex(p,this.distance,k,0,0,!1,g,l)):"square"===A?(x||(this.addCurrentVertex(p,this.distance,L,1,1,!1,g,l),this.e1=this.e2=-1),w&&this.addCurrentVertex(p,this.distance,k,-1,-1,!1,g,l)):"round"===A&&(x||(this.addCurrentVertex(p,this.distance,L,0,0,!1,g,l),this.addCurrentVertex(p,this.distance,L,1,1,!0,g,l),this.e1=this.e2=-1),w&&(this.addCurrentVertex(p,this.distance,k,-1,-1,!0,g,l),this.addCurrentVertex(p,this.distance,k,0,0,!1,g,l)));if(S&&T<c-1){var $=p.dist(w);if(2*m<$){var V=p.add(w.sub(p)._mult(m/$)._round());this.distance+=V.dist(p),this.addCurrentVertex(V,this.distance,k.mult(1),0,0,!1,g,l),p=V}}x=!1}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,s)}},Dl.prototype.addCurrentVertex=function(t,e,i,n,o,r,a,s){var l,u=this.layoutVertexArray,c=this.indexArray;s&&(e=Ol(e,s)),l=i.clone(),n&&l._sub(i.perp()._mult(n)),Al(u,t,l,r,!1,n,e),this.e3=a.vertexLength++,0<=this.e1&&0<=this.e2&&(c.emplaceBack(this.e1,this.e2,this.e3),a.primitiveLength++),this.e1=this.e2,this.e2=this.e3,l=i.mult(-1),o&&l._sub(i.perp()._mult(o)),Al(u,t,l,r,!0,-o,e),this.e3=a.vertexLength++,0<=this.e1&&0<=this.e2&&(c.emplaceBack(this.e1,this.e2,this.e3),a.primitiveLength++),this.e1=this.e2,this.e2=this.e3,Il/2<e&&!s&&(this.distance=0,this.addCurrentVertex(t,this.distance,i,n,o,r,a))},Dl.prototype.addPieSliceVertex=function(t,e,i,n,o,r){i=i.mult(n?-1:1);var a=this.layoutVertexArray,s=this.indexArray;r&&(e=Ol(e,r)),Al(a,t,i,!1,n,0,e),this.e3=o.vertexLength++,0<=this.e1&&0<=this.e2&&(s.emplaceBack(this.e1,this.e2,this.e3),o.primitiveLength++),n?this.e2=this.e3:this.e1=this.e3},Pn("LineBucket",Dl,{omit:["layers","features"]});var Rl,Bl=new lo({"line-cap":new eo($t.layout_line["line-cap"]),"line-join":new io($t.layout_line["line-join"]),"line-miter-limit":new eo($t.layout_line["line-miter-limit"]),"line-round-limit":new eo($t.layout_line["line-round-limit"])}),Fl={paint:new lo({"line-opacity":new io($t.paint_line["line-opacity"]),"line-color":new io($t.paint_line["line-color"]),"line-translate":new eo($t.paint_line["line-translate"]),"line-translate-anchor":new eo($t.paint_line["line-translate-anchor"]),"line-width":new io($t.paint_line["line-width"]),"line-gap-width":new io($t.paint_line["line-gap-width"]),"line-offset":new io($t.paint_line["line-offset"]),"line-blur":new io($t.paint_line["line-blur"]),"line-dasharray":new no($t.paint_line["line-dasharray"]),"line-pattern":new ro($t.paint_line["line-pattern"]),"line-gradient":new so($t.paint_line["line-gradient"])}),layout:Bl},Ul=((Rl=io)&&(Nl.__proto__=Rl),((Nl.prototype=Object.create(Rl&&Rl.prototype)).constructor=Nl).prototype.possiblyEvaluate=function(t,e){return e=new Nn(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,zoomHistory:e.zoomHistory,transition:e.transition}),Rl.prototype.possiblyEvaluate.call(this,t,e)},Nl.prototype.evaluate=function(t,e,i,n){return e=f({},e,{zoom:Math.floor(e.zoom)}),Rl.prototype.evaluate.call(this,t,e,i,n)},new Nl(Fl.paint.properties["line-width"].specification));function Nl(){Rl.apply(this,arguments)}Ul.useIntegerZoom=!0;var jl,$l=((jl=po)&&(Vl.__proto__=jl),((Vl.prototype=Object.create(jl&&jl.prototype)).constructor=Vl).prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&this._updateGradient()},Vl.prototype._updateGradient=function(){var t=this._transitionablePaint._values["line-gradient"].value.expression;this.gradient=vs(t,"lineProgress"),this.gradientTexture=null},Vl.prototype.recalculate=function(t){jl.prototype.recalculate.call(this,t),this.paint._values["line-floorwidth"]=Ul.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)},Vl.prototype.createBucket=function(t){return new Dl(t)},Vl.prototype.queryRadius=function(t){var e=t,i=Zl(Wa("line-width",this,e),Wa("line-gap-width",this,e)),n=Wa("line-offset",this,e);return i/2+Math.abs(n)+Xa(this.paint.get("line-translate"))},Vl.prototype.queryIntersectsFeature=function(t,e,i,n,o,r,a){var s=Ka(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),r.angle,a),l=a/2*Zl(this.paint.get("line-width").evaluate(e,i),this.paint.get("line-gap-width").evaluate(e,i)),u=this.paint.get("line-offset").evaluate(e,i);return u&&(n=function(t,e){for(var i=[],n=new st(0,0),o=0;o<t.length;o++){for(var r=t[o],a=[],s=0;s<r.length;s++){var l=r[s-1],u=r[s],c=r[s+1],h=0===s?n:u.sub(l)._unit()._perp(),p=s===r.length-1?n:c.sub(u)._unit()._perp(),d=h._add(p)._unit(),f=d.x*p.x+d.y*p.y;d._mult(1/f),a.push(d._mult(e)._add(u))}i.push(a)}return i}(n,u*a)),function(t,e,i){for(var n=0;n<e.length;n++){var o=e[n];if(3<=t.length)for(var r=0;r<o.length;r++)if(qa(t,o[r]))return!0;if(ja(t,o,i))return!0}return!1}(s,n,l)},Vl.prototype.isTileClipped=function(){return!0},Vl);function Vl(t){jl.call(this,t,Fl)}function Zl(t,e){return 0<e?e+2*t:t}var Gl=_o([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"}]),ql=_o([{name:"a_projected_pos",components:3,type:"Float32"}],4),Hl=(_o([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),_o([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Wl=(_o([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"},{type:"Int16",name:"radius"},{type:"Int16",name:"signedDistanceFromAnchor"}]),_o([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Xl=_o([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4);function Kl(t,o,r){return t.sections.forEach(function(t){var e,i,n;t.text=(e=t.text,i=r,"uppercase"===(n=o.layout.get("text-transform").evaluate(i,{}))?e=e.toLocaleUpperCase():"lowercase"===n&&(e=e.toLocaleLowerCase()),qn.applyArabicShaping&&(e=qn.applyArabicShaping(e)),e)}),t}_o([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"}]),_o([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"radialTextOffset"}]),_o([{type:"Float32",name:"offsetX"}]),_o([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Jl,Yl={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},Ql=((Jl=st)&&(tu.__proto__=Jl),((tu.prototype=Object.create(Jl&&Jl.prototype)).constructor=tu).prototype.clone=function(){return new tu(this.x,this.y,this.angle,this.segment)},tu);function tu(t,e,i,n){Jl.call(this,t,e),this.angle=i,void 0!==n&&(this.segment=n)}Pn("Anchor",Ql);var eu=256;function iu(t,e){var i=e.expression;if("constant"===i.kind)return{kind:"constant",layoutSize:i.evaluate(new Nn(t+1))};if("source"===i.kind)return{kind:"source"};for(var n=i.zoomStops,o=i.interpolationType,r=0;r<n.length&&n[r]<=t;)r++;for(var a=r=Math.max(0,r-1);a<n.length&&n[a]<t+1;)a++;a=Math.min(n.length-1,a);var s=n[r],l=n[a];return"composite"===i.kind?{kind:"composite",minZoom:s,maxZoom:l,interpolationType:o}:{kind:"camera",minZoom:s,maxZoom:l,minSize:i.evaluate(new Nn(s)),maxSize:i.evaluate(new Nn(l)),interpolationType:o}}function nu(t,e,i){var n=e.uSize,o=e.uSizeT,r=i.lowerSize,a=i.upperSize;return"source"===t.kind?r/eu:"composite"===t.kind?Fe(r/eu,a/eu,o):n}function ou(t,e){var i=0,n=0;if("constant"===t.kind)n=t.layoutSize;else if("source"!==t.kind){var o=t.interpolationType,r=t.minZoom,a=t.maxZoom,s=o?l(ei.interpolationFactor(o,e,r,a),0,1):0;"camera"===t.kind?n=Fe(t.minSize,t.maxSize,s):i=s}return{uSizeT:i,uSize:n}}var ru=Object.freeze({getSizeData:iu,evaluateSizeForFeature:nu,evaluateSizeForZoom:ou,SIZE_PACK_FACTOR:eu}),au=yl.VectorTileFeature.types,su=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function lu(t,e,i,n,o,r,a,s){t.emplaceBack(e,i,Math.round(32*n),Math.round(32*o),r,a,s?s[0]:0,s?s[1]:0)}function uu(t,e,i){t.emplaceBack(e.x,e.y,i),t.emplaceBack(e.x,e.y,i),t.emplaceBack(e.x,e.y,i),t.emplaceBack(e.x,e.y,i)}function cu(t){this.layoutVertexArray=new Do,this.indexArray=new dr,this.programConfigurations=t,this.segments=new Jr,this.dynamicLayoutVertexArray=new Bo,this.opacityVertexArray=new No,this.placedSymbolArray=new Ar}cu.prototype.upload=function(t,e,i,n){i&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Gl.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,ql.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,su,!0),this.opacityVertexBuffer.itemSize=1),(i||n)&&this.programConfigurations.upload(t)},cu.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},Pn("SymbolBuffers",cu);function hu(t,e,i){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new i,this.segments=new Jr,this.collisionVertexArray=new Xo}hu.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,Hl.members,!0)},hu.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},Pn("CollisionBuffers",hu);var pu=function(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1;var e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=iu(this.zoom,e["text-size"]),this.iconSizeData=iu(this.zoom,e["icon-size"]);var i=this.layers[0].layout,n=i.get("symbol-sort-key"),o=i.get("symbol-z-order");this.sortFeaturesByKey="viewport-y"!==o&&void 0!==n.constantOr(1);var r="viewport-y"===o||"auto"===o&&!this.sortFeaturesByKey;this.sortFeaturesByY=r&&(i.get("text-allow-overlap")||i.get("icon-allow-overlap")||i.get("text-ignore-placement")||i.get("icon-ignore-placement")),this.stateDependentLayerIds=this.layers.filter(function(t){return t.isStateDependent()}).map(function(t){return t.id}),this.sourceID=t.sourceID};pu.prototype.createArrays=function(){this.text=new cu(new Ia(Gl.members,this.layers,this.zoom,function(t){return/^text/.test(t)})),this.icon=new cu(new Ia(Gl.members,this.layers,this.zoom,function(t){return/^icon/.test(t)})),this.collisionBox=new hu(qo,Wl.members,_r),this.collisionCircle=new hu(qo,Xl.members,dr),this.glyphOffsetArray=new jr,this.lineVertexArray=new Gr,this.symbolInstances=new Br},pu.prototype.calculateGlyphDependencies=function(t,e,i,n){for(var o=0;o<t.length;o++)if(e[t.charCodeAt(o)]=!0,i&&n){var r=Yl[t.charAt(o)];r&&(e[r.charCodeAt(0)]=!0)}},pu.prototype.populate=function(t,e){var i=this.layers[0],n=i.layout,o=n.get("text-font"),r=n.get("text-field"),a=n.get("icon-image"),s=("constant"!==r.value.kind||0<r.value.value.toString().length)&&("constant"!==o.value.kind||0<o.value.value.length),l="constant"!==a.value.kind||a.value.value&&0<a.value.value.length,u=n.get("symbol-sort-key");if(this.features=[],s||l){for(var c=e.iconDependencies,h=e.glyphDependencies,p=new Nn(this.zoom),d=0,f=t;d<f.length;d+=1){var m=f[d],_=m.feature,g=m.index,y=m.sourceLayerIndex;if(i._featureFilter(p,_)){var v=void 0;if(s){var x=i.getValueAndResolveTokens("text-field",_);v=Kl(x instanceof _e?x:_e.fromString(x),i,_)}var b=void 0;if(l&&(b=i.getValueAndResolveTokens("icon-image",_)),v||b){var w=this.sortFeaturesByKey?u.evaluate(_,{}):void 0,L={text:v,icon:b,index:g,sourceLayerIndex:y,geometry:Ra(_),properties:_.properties,type:au[_.type],sortKey:w};if(void 0!==_.id&&(L.id=_.id),this.features.push(L),b&&(c[b]=!0),v)for(var k=o.evaluate(_,{}).join(","),T="map"===n.get("text-rotation-alignment")&&"point"!==n.get("symbol-placement"),E=0,M=v.sections;E<M.length;E+=1){var C=M[E],S=Rn(v.toString()),P=C.fontStack||k,z=h[P]=h[P]||{};this.calculateGlyphDependencies(C.text,z,T,S)}}}}"line"===n.get("symbol-placement")&&(this.features=function(e){var o={},r={},a=[],i=0;function t(t){a.push(e[t]),i++}function n(t,e,i){var n=r[t];return delete r[t],r[e]=n,a[n].geometry[0].pop(),a[n].geometry[0]=a[n].geometry[0].concat(i[0]),n}function s(t,e,i){var n=o[e];return delete o[e],o[t]=n,a[n].geometry[0].shift(),a[n].geometry[0]=i[0].concat(a[n].geometry[0]),n}function l(t,e,i){var n=i?e[0][e[0].length-1]:e[0][0];return t+":"+n.x+":"+n.y}for(var u=0;u<e.length;u++){var c=e[u],h=c.geometry,p=c.text?c.text.toString():null;if(p){var d=l(p,h),f=l(p,h,!0);if(d in r&&f in o&&r[d]!==o[f]){var m=s(d,f,h),_=n(d,f,a[m].geometry);delete o[d],delete r[f],r[l(p,a[_].geometry,!0)]=_,a[m].geometry=null}else d in r?n(d,f,h):f in o?s(d,f,h):(t(u),o[d]=i-1,r[f]=i-1)}else t(u)}return a.filter(function(t){return t.geometry})}(this.features)),this.sortFeaturesByKey&&this.features.sort(function(t,e){return t.sortKey-e.sortKey})}},pu.prototype.update=function(t,e,i){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,i),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,i))},pu.prototype.isEmpty=function(){return 0===this.symbolInstances.length},pu.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},pu.prototype.upload=function(t){this.uploaded||(this.collisionBox.upload(t),this.collisionCircle.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},pu.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.collisionBox.destroy(),this.collisionCircle.destroy()},pu.prototype.addToLineVertexArray=function(t,e){var i=this.lineVertexArray.length;if(void 0!==t.segment){for(var n=t.dist(e[t.segment+1]),o=t.dist(e[t.segment]),r={},a=t.segment+1;a<e.length;a++)r[a]={x:e[a].x,y:e[a].y,tileUnitDistanceFromAnchor:n},a<e.length-1&&(n+=e[a+1].dist(e[a]));for(var s=t.segment||0;0<=s;s--)r[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:o},0<s&&(o+=e[s-1].dist(e[s]));for(var l=0;l<e.length;l++){var u=r[l];this.lineVertexArray.emplaceBack(u.x,u.y,u.tileUnitDistanceFromAnchor)}}return{lineStartIndex:i,lineLength:this.lineVertexArray.length-i}},pu.prototype.addSymbols=function(t,e,i,n,o,r,a,s,l,u){for(var c=t.indexArray,h=t.layoutVertexArray,p=t.dynamicLayoutVertexArray,d=t.segments.prepareSegment(4*e.length,t.layoutVertexArray,t.indexArray,r.sortKey),f=this.glyphOffsetArray.length,m=d.vertexLength,_=0,g=e;_<g.length;_+=1){var y=g[_],v=y.tl,x=y.tr,b=y.bl,w=y.br,L=y.tex,k=d.vertexLength,T=y.glyphOffset[1];lu(h,s.x,s.y,v.x,T+v.y,L.x,L.y,i),lu(h,s.x,s.y,x.x,T+x.y,L.x+L.w,L.y,i),lu(h,s.x,s.y,b.x,T+b.y,L.x,L.y+L.h,i),lu(h,s.x,s.y,w.x,T+w.y,L.x+L.w,L.y+L.h,i),uu(p,s,0),c.emplaceBack(k,k+1,k+2),c.emplaceBack(k+1,k+2,k+3),d.vertexLength+=4,d.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(y.glyphOffset[0])}t.placedSymbolArray.emplaceBack(s.x,s.y,f,this.glyphOffsetArray.length-f,m,l,u,s.segment,i?i[0]:0,i?i[1]:0,n[0],n[1],a,!1,0),t.programConfigurations.populatePaintArrays(t.layoutVertexArray.length,r,r.index,{})},pu.prototype._addCollisionDebugVertex=function(t,e,i,n,o,r){return e.emplaceBack(0,0),t.emplaceBack(i.x,i.y,n,o,Math.round(r.x),Math.round(r.y))},pu.prototype.addCollisionDebugVertices=function(t,e,i,n,o,r,a,s){var l=o.segments.prepareSegment(4,o.layoutVertexArray,o.indexArray),u=l.vertexLength,c=o.layoutVertexArray,h=o.collisionVertexArray,p=a.anchorX,d=a.anchorY;if(this._addCollisionDebugVertex(c,h,r,p,d,new st(t,e)),this._addCollisionDebugVertex(c,h,r,p,d,new st(i,e)),this._addCollisionDebugVertex(c,h,r,p,d,new st(i,n)),this._addCollisionDebugVertex(c,h,r,p,d,new st(t,n)),l.vertexLength+=4,s){var f=o.indexArray;f.emplaceBack(u,u+1,u+2),f.emplaceBack(u,u+2,u+3),l.primitiveLength+=2}else{var m=o.indexArray;m.emplaceBack(u,u+1),m.emplaceBack(u+1,u+2),m.emplaceBack(u+2,u+3),m.emplaceBack(u+3,u),l.primitiveLength+=4}},pu.prototype.addDebugCollisionBoxes=function(t,e,i){for(var n=t;n<e;n++){var o=this.collisionBoxArray.get(n),r=o.x1,a=o.y1,s=o.x2,l=o.y2,u=0<o.radius;this.addCollisionDebugVertices(r,a,s,l,u?this.collisionCircle:this.collisionBox,o.anchorPoint,i,u)}},pu.prototype.generateCollisionDebugBuffers=function(){for(var t=0;t<this.symbolInstances.length;t++){var e=this.symbolInstances.get(t);this.addDebugCollisionBoxes(e.textBoxStartIndex,e.textBoxEndIndex,e),this.addDebugCollisionBoxes(e.iconBoxStartIndex,e.iconBoxEndIndex,e)}},pu.prototype._deserializeCollisionBoxesForSymbol=function(t,e,i,n,o){for(var r={},a=e;a<i;a++){var s=t.get(a);if(0===s.radius){r.textBox={x1:s.x1,y1:s.y1,x2:s.x2,y2:s.y2,anchorPointX:s.anchorPointX,anchorPointY:s.anchorPointY},r.textFeatureIndex=s.featureIndex;break}r.textCircles||(r.textCircles=[],r.textFeatureIndex=s.featureIndex),r.textCircles.push(s.anchorPointX,s.anchorPointY,s.radius,s.signedDistanceFromAnchor,1)}for(var l=n;l<o;l++){var u=t.get(l);if(0===u.radius){r.iconBox={x1:u.x1,y1:u.y1,x2:u.x2,y2:u.y2,anchorPointX:u.anchorPointX,anchorPointY:u.anchorPointY},r.iconFeatureIndex=u.featureIndex;break}}return r},pu.prototype.deserializeCollisionBoxes=function(t){this.collisionArrays=[];for(var e=0;e<this.symbolInstances.length;e++){var i=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,i.textBoxStartIndex,i.textBoxEndIndex,i.iconBoxStartIndex,i.iconBoxEndIndex))}},pu.prototype.hasTextData=function(){return 0<this.text.segments.get().length},pu.prototype.hasIconData=function(){return 0<this.icon.segments.get().length},pu.prototype.hasCollisionBoxData=function(){return 0<this.collisionBox.segments.get().length},pu.prototype.hasCollisionCircleData=function(){return 0<this.collisionCircle.segments.get().length},pu.prototype.addIndicesForPlacedTextSymbol=function(t){for(var e=this.text.placedSymbolArray.get(t),i=e.vertexStartIndex+4*e.numGlyphs,n=e.vertexStartIndex;n<i;n+=4)this.text.indexArray.emplaceBack(n,n+1,n+2),this.text.indexArray.emplaceBack(n+1,n+2,n+3)},pu.prototype.getSortedSymbolIndexes=function(t){if(this.sortedAngle===t&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;for(var e=Math.sin(t),i=Math.cos(t),n=[],o=[],r=[],a=0;a<this.symbolInstances.length;++a){r.push(a);var s=this.symbolInstances.get(a);n.push(0|Math.round(e*s.anchorX+i*s.anchorY)),o.push(s.featureIndex)}return r.sort(function(t,e){return n[t]-n[e]||o[e]-o[t]}),r},pu.prototype.sortFeatures=function(t){var n=this;if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(1<this.text.segments.get().length||1<this.icon.segments.get().length)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var e=0,i=this.symbolInstanceIndexes;e<i.length;e+=1){var o=i[e],r=this.symbolInstances.get(o);this.featureSortOrder.push(r.featureIndex),[r.rightJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.leftJustifiedTextSymbolIndex].forEach(function(t,e,i){0<=t&&i.indexOf(t)===e&&n.addIndicesForPlacedTextSymbol(t)}),0<=r.verticalPlacedTextSymbolIndex&&this.addIndicesForPlacedTextSymbol(r.verticalPlacedTextSymbolIndex);var a=this.icon.placedSymbolArray.get(o);if(a.numGlyphs){var s=a.vertexStartIndex;this.icon.indexArray.emplaceBack(s,s+1,s+2),this.icon.indexArray.emplaceBack(s+1,s+2,s+3)}}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Pn("SymbolBucket",pu,{omit:["layers","collisionBoxArray","features","compareText"]}),pu.MAX_GLYPHS=65535,pu.addDynamicAttributes=uu;var du,fu,mu,_u=new lo({"symbol-placement":new eo($t.layout_symbol["symbol-placement"]),"symbol-spacing":new eo($t.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new eo($t.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new io($t.layout_symbol["symbol-sort-key"]),"symbol-z-order":new eo($t.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new eo($t.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new eo($t.layout_symbol["icon-ignore-placement"]),"icon-optional":new eo($t.layout_symbol["icon-optional"]),"icon-rotation-alignment":new eo($t.layout_symbol["icon-rotation-alignment"]),"icon-size":new io($t.layout_symbol["icon-size"]),"icon-text-fit":new eo($t.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new eo($t.layout_symbol["icon-text-fit-padding"]),"icon-image":new io($t.layout_symbol["icon-image"]),"icon-rotate":new io($t.layout_symbol["icon-rotate"]),"icon-padding":new eo($t.layout_symbol["icon-padding"]),"icon-keep-upright":new eo($t.layout_symbol["icon-keep-upright"]),"icon-offset":new io($t.layout_symbol["icon-offset"]),"icon-anchor":new io($t.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new eo($t.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new eo($t.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new eo($t.layout_symbol["text-rotation-alignment"]),"text-field":new io($t.layout_symbol["text-field"]),"text-font":new io($t.layout_symbol["text-font"]),"text-size":new io($t.layout_symbol["text-size"]),"text-max-width":new io($t.layout_symbol["text-max-width"]),"text-line-height":new eo($t.layout_symbol["text-line-height"]),"text-letter-spacing":new io($t.layout_symbol["text-letter-spacing"]),"text-justify":new io($t.layout_symbol["text-justify"]),"text-radial-offset":new io($t.layout_symbol["text-radial-offset"]),"text-variable-anchor":new eo($t.layout_symbol["text-variable-anchor"]),"text-anchor":new io($t.layout_symbol["text-anchor"]),"text-max-angle":new eo($t.layout_symbol["text-max-angle"]),"text-rotate":new io($t.layout_symbol["text-rotate"]),"text-padding":new eo($t.layout_symbol["text-padding"]),"text-keep-upright":new eo($t.layout_symbol["text-keep-upright"]),"text-transform":new io($t.layout_symbol["text-transform"]),"text-offset":new io($t.layout_symbol["text-offset"]),"text-allow-overlap":new eo($t.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new eo($t.layout_symbol["text-ignore-placement"]),"text-optional":new eo($t.layout_symbol["text-optional"])}),gu={paint:new lo({"icon-opacity":new io($t.paint_symbol["icon-opacity"]),"icon-color":new io($t.paint_symbol["icon-color"]),"icon-halo-color":new io($t.paint_symbol["icon-halo-color"]),"icon-halo-width":new io($t.paint_symbol["icon-halo-width"]),"icon-halo-blur":new io($t.paint_symbol["icon-halo-blur"]),"icon-translate":new eo($t.paint_symbol["icon-translate"]),"icon-translate-anchor":new eo($t.paint_symbol["icon-translate-anchor"]),"text-opacity":new io($t.paint_symbol["text-opacity"]),"text-color":new io($t.paint_symbol["text-color"]),"text-halo-color":new io($t.paint_symbol["text-halo-color"]),"text-halo-width":new io($t.paint_symbol["text-halo-width"]),"text-halo-blur":new io($t.paint_symbol["text-halo-blur"]),"text-translate":new eo($t.paint_symbol["text-translate"]),"text-translate-anchor":new eo($t.paint_symbol["text-translate-anchor"])}),layout:_u},yu=((mu=po)&&(Tu.__proto__=mu),((Tu.prototype=Object.create(mu&&mu.prototype)).constructor=Tu).prototype.recalculate=function(t){mu.prototype.recalculate.call(this,t),"auto"===this.layout.get("icon-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"))},Tu.prototype.getValueAndResolveTokens=function(t,e){var i,n=this.layout.get(t).evaluate(e,{}),o=this._unevaluatedLayout._values[t];return o.isDataDriven()||Fi(o.value)?n:(i=e.properties,n.replace(/{([^{}]+)}/g,function(t,e){return e in i?String(i[e]):""}))},Tu.prototype.createBucket=function(t){return new pu(t)},Tu.prototype.queryRadius=function(){return 0},Tu.prototype.queryIntersectsFeature=function(){return!1},Tu),vu={paint:new lo({"background-color":new eo($t.paint_background["background-color"]),"background-pattern":new no($t.paint_background["background-pattern"]),"background-opacity":new eo($t.paint_background["background-opacity"])})},xu=((fu=po)&&(ku.__proto__=fu),(ku.prototype=Object.create(fu&&fu.prototype)).constructor=ku),bu={paint:new lo({"raster-opacity":new eo($t.paint_raster["raster-opacity"]),"raster-hue-rotate":new eo($t.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new eo($t.paint_raster["raster-brightness-min"]),"raster-brightness-max":new eo($t.paint_raster["raster-brightness-max"]),"raster-saturation":new eo($t.paint_raster["raster-saturation"]),"raster-contrast":new eo($t.paint_raster["raster-contrast"]),"raster-resampling":new eo($t.paint_raster["raster-resampling"]),"raster-fade-duration":new eo($t.paint_raster["raster-fade-duration"])})},wu=((du=po)&&(Lu.__proto__=du),(Lu.prototype=Object.create(du&&du.prototype)).constructor=Lu);function Lu(t){du.call(this,t,bu)}function ku(t){fu.call(this,t,vu)}function Tu(t){mu.call(this,t,gu)}var Eu,Mu=((Eu=po)&&(Su.__proto__=Eu),((Su.prototype=Object.create(Eu&&Eu.prototype)).constructor=Su).prototype.is3D=function(){return"3d"===this.implementation.renderingMode},Su.prototype.hasOffscreenPass=function(){return void 0!==this.implementation.prerender},Su.prototype.recalculate=function(){},Su.prototype.updateTransitions=function(){},Su.prototype.hasTransition=function(){},Su.prototype.serialize=function(){},Su.prototype.onAdd=function(t){this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)},Su.prototype.onRemove=function(t){this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)},Su),Cu={circle:ss,heatmap:ws,hillshade:ks,fill:sl,"fill-extrusion":Tl,line:$l,symbol:yu,background:xu,raster:wu};function Su(t){Eu.call(this,t,{}),this.implementation=t}function Pu(t){for(var e=0,i=0,n=0,o=t;n<o.length;n+=1){var r=o[n];e+=r.w*r.h,i=Math.max(i,r.w)}t.sort(function(t,e){return e.h-t.h});for(var a=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),i),h:1/0}],s=0,l=0,u=0,c=t;u<c.length;u+=1)for(var h=c[u],p=a.length-1;0<=p;p--){var d=a[p];if(!(h.w>d.w||h.h>d.h)){if(h.x=d.x,h.y=d.y,l=Math.max(l,h.y+h.h),s=Math.max(s,h.x+h.w),h.w===d.w&&h.h===d.h){var f=a.pop();p<a.length&&(a[p]=f)}else h.h===d.h?(d.x+=h.w,d.w-=h.w):(h.w===d.w||a.push({x:d.x+h.w,y:d.y,w:d.w-h.w,h:h.h}),d.y+=h.h,d.h-=h.h);break}}return{w:s,h:l,fill:e/(s*l)||0}}function zu(t,e){var i=e.pixelRatio,n=e.version;this.paddedRect=t,this.pixelRatio=i,this.version=n}var Iu={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};Iu.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},Iu.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},Iu.tlbr.get=function(){return this.tl.concat(this.br)},Iu.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(zu.prototype,Iu);function Au(t,e){var i={},n={};this.haveRenderCallbacks=[];var o=[];this.addImages(t,i,o),this.addImages(e,n,o);var r=Pu(o),a=r.w,s=r.h,l=new gs({width:a||1,height:s||1});for(var u in t){var c=t[u],h=i[u].paddedRect;gs.copy(c.data,l,{x:0,y:0},{x:h.x+1,y:h.y+1},c.data)}for(var p in e){var d=e[p],f=n[p].paddedRect,m=f.x+1,_=f.y+1,g=d.data.width,y=d.data.height;gs.copy(d.data,l,{x:0,y:0},{x:m,y:_},d.data),gs.copy(d.data,l,{x:0,y:y-1},{x:m,y:_-1},{width:g,height:1}),gs.copy(d.data,l,{x:0,y:0},{x:m,y:_+y},{width:g,height:1}),gs.copy(d.data,l,{x:g-1,y:0},{x:m-1,y:_},{width:1,height:y}),gs.copy(d.data,l,{x:0,y:0},{x:m+g,y:_},{width:1,height:y})}this.image=l,this.iconPositions=i,this.patternPositions=n}Au.prototype.addImages=function(t,e,i){for(var n in t){var o=t[n],r={x:0,y:0,w:o.data.width+2,h:o.data.height+2};i.push(r),e[n]=new zu(r,o),o.hasRenderCallback&&this.haveRenderCallbacks.push(n)}},Au.prototype.patchUpdatedImages=function(t,e){for(var i in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions[i],t.getImage(i),e),this.patchUpdatedImage(this.patternPositions[i],t.getImage(i),e)},Au.prototype.patchUpdatedImage=function(t,e,i){if(t&&e&&t.version!==e.version){t.version=e.version;var n=t.tl,o=n[0],r=n[1];i.update(e.data,void 0,{x:o,y:r})}},Pn("ImagePosition",zu),Pn("ImageAtlas",Au);function Du(t,e,i,n){this.context=t,this.format=i,this.texture=t.gl.createTexture(),this.update(e,n)}var Ou=self.HTMLImageElement,Ru=self.HTMLCanvasElement,Bu=self.HTMLVideoElement,Fu=self.ImageData;Du.prototype.update=function(t,e,i){var n=t.width,o=t.height,r=!(this.size&&this.size[0]===n&&this.size[1]===o||i),a=this.context,s=a.gl;if(this.useMipmap=Boolean(e&&e.useMipmap),s.bindTexture(s.TEXTURE_2D,this.texture),a.pixelStoreUnpackFlipY.set(!1),a.pixelStoreUnpack.set(1),a.pixelStoreUnpackPremultiplyAlpha.set(this.format===s.RGBA&&(!e||!1!==e.premultiply)),r)this.size=[n,o],t instanceof Ou||t instanceof Ru||t instanceof Bu||t instanceof Fu?s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,s.UNSIGNED_BYTE,t):s.texImage2D(s.TEXTURE_2D,0,this.format,n,o,0,this.format,s.UNSIGNED_BYTE,t.data);else{var l=i||{x:0,y:0},u=l.x,c=l.y;t instanceof Ou||t instanceof Ru||t instanceof Bu||t instanceof Fu?s.texSubImage2D(s.TEXTURE_2D,0,u,c,s.RGBA,s.UNSIGNED_BYTE,t):s.texSubImage2D(s.TEXTURE_2D,0,u,c,n,o,s.RGBA,s.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&s.generateMipmap(s.TEXTURE_2D)},Du.prototype.bind=function(t,e,i){var n=this.context.gl;n.bindTexture(n.TEXTURE_2D,this.texture),i!==n.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(i=n.LINEAR),t!==this.filter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,i||t),this.filter=t),e!==this.wrap&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,e),this.wrap=e)},Du.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},Du.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};function Uu(t,e,i,n,o){var r,a,s=8*o-n-1,l=(1<<s)-1,u=l>>1,c=-7,h=i?o-1:0,p=i?-1:1,d=t[e+h];for(h+=p,r=d&(1<<-c)-1,d>>=-c,c+=s;0<c;r=256*r+t[e+h],h+=p,c-=8);for(a=r&(1<<-c)-1,r>>=-c,c+=n;0<c;a=256*a+t[e+h],h+=p,c-=8);if(0===r)r=1-u;else{if(r===l)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),r-=u}return(d?-1:1)*a*Math.pow(2,r-n)}function Nu(t,e,i,n,o,r){var a,s,l,u=8*r-o-1,c=(1<<u)-1,h=c>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:r-1,f=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),2<=(e+=1<=a+h?p/l:p*Math.pow(2,1-h))*l&&(a++,l/=2),c<=a+h?(s=0,a=c):1<=a+h?(s=(e*l-1)*Math.pow(2,o),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,o),a=0));8<=o;t[i+d]=255&s,d+=f,s/=256,o-=8);for(a=a<<o|s,u+=o;0<u;t[i+d]=255&a,d+=f,a/=256,u-=8);t[i+d-f]|=128*m}var ju=$u;function $u(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 Vu(t){return t.type===$u.Bytes?t.readVarint()+t.pos:t.pos+1}function Zu(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Gu(t,e,i){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(n);for(var o=i.pos-1;t<=o;o--)i.buf[o+n]=i.buf[o]}function qu(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function Hu(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function Wu(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function Xu(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function Ku(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function Ju(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function Yu(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function Qu(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function tc(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function ec(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function ic(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function nc(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}$u.Varint=0,$u.Fixed64=1,$u.Bytes=2,$u.Fixed32=5,$u.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var n=this.readVarint(),o=n>>3,r=this.pos;this.type=7&n,t(o,e,this),this.pos===r&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=ec(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=nc(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=ec(this.buf,this.pos)+4294967296*ec(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=ec(this.buf,this.pos)+4294967296*nc(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=Uu(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Uu(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,n=this.buf;return e=127&(i=n[this.pos++]),i<128?e:(e|=(127&(i=n[this.pos++]))<<7,i<128?e:(e|=(127&(i=n[this.pos++]))<<14,i<128?e:(e|=(127&(i=n[this.pos++]))<<21,i<128?e:function(t,e,i){var n,o,r=i.buf;if(n=(112&(o=r[i.pos++]))>>4,o<128)return Zu(t,n,e);if(n|=(127&(o=r[i.pos++]))<<3,o<128)return Zu(t,n,e);if(n|=(127&(o=r[i.pos++]))<<10,o<128)return Zu(t,n,e);if(n|=(127&(o=r[i.pos++]))<<17,o<128)return Zu(t,n,e);if(n|=(127&(o=r[i.pos++]))<<24,o<128)return Zu(t,n,e);if(n|=(1&(o=r[i.pos++]))<<31,o<128)return Zu(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=n[this.pos]))<<28,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=function(t,e,i){for(var n="",o=e;o<i;){var r,a,s,l=t[o],u=null,c=239<l?4:223<l?3:191<l?2:1;if(i<o+c)break;1===c?l<128&&(u=l):2===c?128==(192&(r=t[o+1]))&&(u=(31&l)<<6|63&r)<=127&&(u=null):3===c?(r=t[o+1],a=t[o+2],128==(192&r)&&128==(192&a)&&((u=(15&l)<<12|(63&r)<<6|63&a)<=2047||55296<=u&&u<=57343)&&(u=null)):4===c&&(r=t[o+1],a=t[o+2],s=t[o+3],128==(192&r)&&128==(192&a)&&128==(192&s)&&((u=(15&l)<<18|(63&r)<<12|(63&a)<<6|63&s)<=65535||1114112<=u)&&(u=null)),null===u?(u=65533,c=1):65535<u&&(u-=65536,n+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),n+=String.fromCharCode(u),o+=c}return n}(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){if(this.type!==$u.Bytes)return t.push(this.readVarint(e));var i=Vu(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==$u.Bytes)return t.push(this.readSVarint());var e=Vu(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==$u.Bytes)return t.push(this.readBoolean());var e=Vu(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==$u.Bytes)return t.push(this.readFloat());var e=Vu(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==$u.Bytes)return t.push(this.readDouble());var e=Vu(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==$u.Bytes)return t.push(this.readFixed32());var e=Vu(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==$u.Bytes)return t.push(this.readSFixed32());var e=Vu(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==$u.Bytes)return t.push(this.readFixed64());var e=Vu(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==$u.Bytes)return t.push(this.readSFixed64());var e=Vu(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===$u.Varint)for(;127<this.buf[this.pos++];);else if(e===$u.Bytes)this.pos=this.readVarint()+this.pos;else if(e===$u.Fixed32)this.pos+=4;else{if(e!==$u.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var i=new Uint8Array(e);i.set(this.buf),this.buf=i,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),ic(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),ic(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),ic(this.buf,-1&t,this.pos),ic(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),ic(this.buf,-1&t,this.pos),ic(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(u){268435455<(u=+u||0)||u<0?function(t,e){var i,n,o,r,a,s,l;if(0<=u?(i=u%4294967296|0,n=u/4294967296|0):(n=~(-u/4294967296),4294967295^(i=~(-u%4294967296))?i=i+1|0:n=n+1|(i=0)),0x10000000000000000<=u||u<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),s=i,(l=e).buf[l.pos++]=127&s|128,s>>>=7,l.buf[l.pos++]=127&s|128,s>>>=7,l.buf[l.pos++]=127&s|128,s>>>=7,l.buf[l.pos++]=127&s|128,s>>>=7,l.buf[l.pos]=127&s,a=(7&(o=n))<<4,(r=e).buf[r.pos++]|=a|((o>>>=3)?128:0),o&&(r.buf[r.pos++]=127&o|((o>>>=7)?128:0),o&&(r.buf[r.pos++]=127&o|((o>>>=7)?128:0),o&&(r.buf[r.pos++]=127&o|((o>>>=7)?128:0),o&&(r.buf[r.pos++]=127&o|((o>>>=7)?128:0),o&&(r.buf[r.pos++]=127&o)))))}(0,this):(this.realloc(4),this.buf[this.pos++]=127&u|(127<u?128:0),u<=127||(this.buf[this.pos++]=127&(u>>>=7)|(127<u?128:0),u<=127||(this.buf[this.pos++]=127&(u>>>=7)|(127<u?128:0),u<=127||(this.buf[this.pos++]=u>>>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=function(t,e,i){for(var n,o,r=0;r<e.length;r++){if(55295<(n=e.charCodeAt(r))&&n<57344){if(!o){56319<n||r+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):o=n;continue}if(n<56320){t[i++]=239,t[i++]=191,t[i++]=189,o=n;continue}n=o-55296<<10|n-56320|65536,o=null}else o&&(t[i++]=239,t[i++]=191,t[i++]=189,o=null);n<128?t[i++]=n:(n<2048?t[i++]=n>>6|192:(n<65536?t[i++]=n>>12|224:(t[i++]=n>>18|240,t[i++]=n>>12&63|128),t[i++]=n>>6&63|128),t[i++]=63&n|128)}return i}(this.buf,t,this.pos);var i=this.pos-e;128<=i&&Gu(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),Nu(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Nu(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 i=0;i<e;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,e){this.pos++;var i=this.pos;t(e,this);var n=this.pos-i;128<=n&&Gu(i,n,this),this.pos=i-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,i){this.writeTag(t,$u.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,qu,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Hu,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Ku,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Wu,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Xu,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Ju,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Yu,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Qu,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,tc,e)},writeBytesField:function(t,e){this.writeTag(t,$u.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,$u.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,$u.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,$u.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,$u.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,$u.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,$u.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,$u.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,$u.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,$u.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var oc=3;function rc(t,e,i){1===t&&i.readMessage(ac,e)}function ac(t,e,i){if(3===t){var n=i.readMessage(sc,{}),o=n.id,r=n.bitmap,a=n.width,s=n.height,l=n.left,u=n.top,c=n.advance;e.push({id:o,bitmap:new _s({width:a+2*oc,height:s+2*oc},r),metrics:{width:a,height:s,left:l,top:u,advance:c}})}}function sc(t,e,i){1===t?e.id=i.readVarint():2===t?e.bitmap=i.readBytes():3===t?e.width=i.readVarint():4===t?e.height=i.readVarint():5===t?e.left=i.readSVarint():6===t?e.top=i.readSVarint():7===t&&(e.advance=i.readVarint())}function lc(t,e,i){this.target=t,this.parent=e,this.mapId=i,this.callbacks={},this.callbackID=0,m(["receive"],this),this.target.addEventListener("message",this.receive,!1)}var uc=oc;function cc(t,e,i){var n=2*Math.PI*6378137/256/Math.pow(2,i);return[t*n-2*Math.PI*6378137/2,e*n-2*Math.PI*6378137/2]}lc.prototype.send=function(t,e,i,n){var o=this,r=i?this.mapId+":"+this.callbackID++:null;i&&(this.callbacks[r]=i);var a=[];if(this.target.postMessage({targetMapId:n,sourceMapId:this.mapId,type:t,id:String(r),data:In(e,a)},a),i)return{cancel:function(){return o.target.postMessage({targetMapId:n,sourceMapId:o.mapId,type:"<cancel>",id:String(r)})}}},lc.prototype.receive=function(t){var e,n=this,i=t.data,o=i.id;if(!i.targetMapId||this.mapId===i.targetMapId){var r=function(t,e){delete n.callbacks[o];var i=[];n.target.postMessage({sourceMapId:n.mapId,type:"<response>",id:String(o),error:t?In(t):null,data:In(e,i)},i)};if("<response>"===i.type||"<cancel>"===i.type)e=this.callbacks[i.id],delete this.callbacks[i.id],e&&i.error?e(An(i.error)):e&&e(null,An(i.data));else if(void 0!==i.id&&this.parent[i.type]){this.callbacks[i.id]=null;var a=this.parent[i.type](i.sourceMapId,An(i.data),r);a&&null===this.callbacks[i.id]&&(this.callbacks[i.id]=a.cancel)}else if(void 0!==i.id&&this.parent.getWorkerSource){var s=i.type.split("."),l=An(i.data);this.parent.getWorkerSource(i.sourceMapId,s[0],l.source)[s[1]](l,r)}else this.parent[i.type](An(i.data))}},lc.prototype.remove=function(){this.target.removeEventListener("message",this.receive,!1)};function hc(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]))}hc.prototype.setNorthEast=function(t){return this._ne=t instanceof pc?new pc(t.lng,t.lat):pc.convert(t),this},hc.prototype.setSouthWest=function(t){return this._sw=t instanceof pc?new pc(t.lng,t.lat):pc.convert(t),this},hc.prototype.extend=function(t){var e,i,n=this._sw,o=this._ne;if(t instanceof pc)i=e=t;else{if(!(t instanceof hc))return Array.isArray(t)?t.every(Array.isArray)?this.extend(hc.convert(t)):this.extend(pc.convert(t)):this;if(e=t._sw,i=t._ne,!e||!i)return this}return n||o?(n.lng=Math.min(e.lng,n.lng),n.lat=Math.min(e.lat,n.lat),o.lng=Math.max(i.lng,o.lng),o.lat=Math.max(i.lat,o.lat)):(this._sw=new pc(e.lng,e.lat),this._ne=new pc(i.lng,i.lat)),this},hc.prototype.getCenter=function(){return new pc((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},hc.prototype.getSouthWest=function(){return this._sw},hc.prototype.getNorthEast=function(){return this._ne},hc.prototype.getNorthWest=function(){return new pc(this.getWest(),this.getNorth())},hc.prototype.getSouthEast=function(){return new pc(this.getEast(),this.getSouth())},hc.prototype.getWest=function(){return this._sw.lng},hc.prototype.getSouth=function(){return this._sw.lat},hc.prototype.getEast=function(){return this._ne.lng},hc.prototype.getNorth=function(){return this._ne.lat},hc.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},hc.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},hc.prototype.isEmpty=function(){return!(this._sw&&this._ne)},hc.convert=function(t){return!t||t instanceof hc?t:new hc(t)};var pc=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,90<this.lat||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};function dc(t){return 2*Math.PI*6378137*Math.cos(t*Math.PI/180)}function fc(t){return(180+t)/360}function mc(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function _c(t,e){return t/dc(e)}function gc(t){var e=180-360*t;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}pc.prototype.wrap=function(){return new pc(s(this.lng,-180,180),this.lat)},pc.prototype.toArray=function(){return[this.lng,this.lat]},pc.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},pc.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,i=e/Math.cos(Math.PI/180*this.lat);return new hc(new pc(this.lng-i,this.lat-e),new pc(this.lng+i,this.lat+e))},pc.convert=function(t){if(t instanceof pc)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new pc(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new pc(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")};function yc(t,e,i){void 0===i&&(i=0),this.x=+t,this.y=+e,this.z=+i}yc.fromLngLat=function(t,e){void 0===e&&(e=0);var i=pc.convert(t);return new yc(fc(i.lng),mc(i.lat),_c(e,i.lat))},yc.prototype.toLngLat=function(){return new pc(360*this.x-180,gc(this.y))},yc.prototype.toAltitude=function(){return this.z*dc(gc(this.y))};function vc(t,e,i){this.z=t,this.x=e,this.y=i,this.key=wc(0,t,e,i)}vc.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},vc.prototype.url=function(t,e){var i,n,o,r,a,s=(i=this.x,n=this.y,o=this.z,r=cc(256*i,256*(n=Math.pow(2,o)-n-1),o),a=cc(256*(i+1),256*(n+1),o),r[0]+","+r[1]+","+a[0]+","+a[1]),l=function(t,e,i){for(var n,o="",r=t;0<r;r--)o+=(e&(n=1<<r-1)?1:0)+(i&n?2:0);return o}(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String("tms"===e?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",l).replace("{bbox-epsg-3857}",s)},vc.prototype.getTilePoint=function(t){var e=Math.pow(2,this.z);return new st((t.x*e-this.x)*Da,(t.y*e-this.y)*Da)};function xc(t,e){this.wrap=t,this.canonical=e,this.key=wc(t,e.z,e.x,e.y)}function bc(t,e,i,n,o){this.overscaledZ=t,this.wrap=e,this.canonical=new vc(i,+n,+o),this.key=wc(e,t,n,o)}function wc(t,e,i,n){(t*=2)<0&&(t=-1*t-1);var o=1<<e;return 32*(o*o*t+o*n+i)+e}bc.prototype.equals=function(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)},bc.prototype.scaledTo=function(t){var e=this.canonical.z-t;return t>this.canonical.z?new bc(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new bc(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},bc.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>e&&t.canonical.y===this.canonical.y>>e},bc.prototype.children=function(t){if(this.overscaledZ>=t)return[new bc(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,i=2*this.canonical.x,n=2*this.canonical.y;return[new bc(e,this.wrap,e,i,n),new bc(e,this.wrap,e,1+i,n),new bc(e,this.wrap,e,i,1+n),new bc(e,this.wrap,e,1+i,1+n)]},bc.prototype.isLessThan=function(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))},bc.prototype.wrapped=function(){return new bc(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},bc.prototype.unwrapTo=function(t){return new bc(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)},bc.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},bc.prototype.toUnwrapped=function(){return new xc(this.wrap,this.canonical)},bc.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},bc.prototype.getTilePoint=function(t){return this.canonical.getTilePoint(new yc(t.x-this.wrap,t.y))},Pn("CanonicalTileID",vc),Pn("OverscaledTileID",bc,{omit:["posMatrix"]});function Lc(t,e,i){if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(i&&"mapbox"!==i&&"terrarium"!==i)return lt('"'+i+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');var n=this.dim=e.height;this.stride=this.dim+2,this.data=new Int32Array(this.stride*this.stride);for(var o=e.data,r="terrarium"===i?this._unpackTerrarium:this._unpackMapbox,a=0;a<n;a++)for(var s=0;s<n;s++){var l=4*(a*n+s);this.set(s,a,r(o[l],o[1+l],o[2+l]))}for(var u=0;u<n;u++)this.set(-1,u,this.get(0,u)),this.set(n,u,this.get(n-1,u)),this.set(u,-1,this.get(u,0)),this.set(u,n,this.get(u,n-1));this.set(-1,-1,this.get(0,0)),this.set(n,-1,this.get(n-1,0)),this.set(-1,n,this.get(0,n-1)),this.set(n,n,this.get(n-1,n-1))}Lc.prototype.set=function(t,e,i){this.data[this._idx(t,e)]=i+65536},Lc.prototype.get=function(t,e){return this.data[this._idx(t,e)]-65536},Lc.prototype._idx=function(t,e){if(t<-1||t>=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)},Lc.prototype._unpackMapbox=function(t,e,i){return(256*t*256+256*e+i)/10-1e4},Lc.prototype._unpackTerrarium=function(t,e,i){return 256*t+e+i/256-32768},Lc.prototype.getPixels=function(){return new gs({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Lc.prototype.backfillBorder=function(t,e,i){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var n=e*this.dim,o=e*this.dim+this.dim,r=i*this.dim,a=i*this.dim+this.dim;switch(e){case-1:n=o-1;break;case 1:o=n+1}switch(i){case-1:r=a-1;break;case 1:a=r+1}for(var s=-e*this.dim,l=-i*this.dim,u=r;u<a;u++)for(var c=n;c<o;c++)this.set(c,u,t.get(c+s,u+l))},Pn("DEMData",Lc);function kc(t){this._stringToNumber={},this._numberToString=[];for(var e=0;e<t.length;e++){var i=t[e];this._stringToNumber[i]=e,this._numberToString[e]=i}}var Tc=_o([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);kc.prototype.encode=function(t){return this._stringToNumber[t]},kc.prototype.decode=function(t){return this._numberToString[t]};function Ec(t,e,i,n){this.type="Feature",(this._vectorTileFeature=t)._z=e,t._x=i,t._y=n,this.properties=t.properties,null!=t.id&&(this.id=t.id)}var Mc={geometry:{configurable:!0}};Mc.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},Mc.geometry.set=function(t){this._geometry=t},Ec.prototype.toJSON=function(){var t={geometry:this.geometry};for(var e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&(t[e]=this[e]);return t},Object.defineProperties(Ec.prototype,Mc);function Cc(){this.state={},this.stateChanges={},this.deletedStates={}}Cc.prototype.updateState=function(t,e,i){var n=String(e);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][n]=this.stateChanges[t][n]||{},f(this.stateChanges[t][n],i),null===this.deletedStates[t])for(var o in this.deletedStates[t]={},this.state[t])o!==n&&(this.deletedStates[t][o]=null);else if(this.deletedStates[t]&&null===this.deletedStates[t][n])for(var r in this.deletedStates[t][n]={},this.state[t][n])i[r]||(this.deletedStates[t][n][r]=null);else for(var a in i)this.deletedStates[t]&&this.deletedStates[t][n]&&null===this.deletedStates[t][n][a]&&delete this.deletedStates[t][n][a]},Cc.prototype.removeFeatureState=function(t,e,i){if(null!==this.deletedStates[t]){var n=String(e);if(this.deletedStates[t]=this.deletedStates[t]||{},i&&void 0!==e&&0<=e)null!==this.deletedStates[t][n]&&(this.deletedStates[t][n]=this.deletedStates[t][n]||{},this.deletedStates[t][n][i]=null);else if(void 0!==e&&0<=e)if(this.stateChanges[t]&&this.stateChanges[t][n])for(i in this.deletedStates[t][n]={},this.stateChanges[t][n])this.deletedStates[t][n][i]=null;else this.deletedStates[t][n]=null;else this.deletedStates[t]=null}},Cc.prototype.getState=function(t,e){var i=String(e),n=this.state[t]||{},o=this.stateChanges[t]||{},r=f({},n[i],o[i]);if(null===this.deletedStates[t])return{};if(this.deletedStates[t]){var a=this.deletedStates[t][e];if(null===a)return{};for(var s in a)delete r[s]}return r},Cc.prototype.initializeTileState=function(t,e){t.setFeatureState(this.state,e)},Cc.prototype.coalesceChanges=function(t,e){var i={};for(var n in this.stateChanges){this.state[n]=this.state[n]||{};var o={};for(var r in this.stateChanges[n])this.state[n][r]||(this.state[n][r]={}),f(this.state[n][r],this.stateChanges[n][r]),o[r]=this.state[n][r];i[n]=o}for(var a in this.deletedStates){this.state[a]=this.state[a]||{};var s={};if(null===this.deletedStates[a])for(var l in this.state[a])s[l]={},this.state[a][l]={};else for(var u in this.deletedStates[a]){if(null===this.deletedStates[a][u])this.state[a][u]={};else for(var c=0,h=Object.keys(this.deletedStates[a][u]);c<h.length;c+=1){var p=h[c];delete this.state[a][u][p]}s[u]=this.state[a][u]}i[a]=i[a]||{},f(i[a],s)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(i).length)for(var d in t)t[d].setFeatureState(i,e)};function Sc(t,e,i){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=e||new Tn(Da,16,0),this.grid3D=new Tn(Da,16,0),this.featureIndexArray=i||new Xr}function Pc(t){for(var e=1/0,i=1/0,n=-1/0,o=-1/0,r=0,a=t;r<a.length;r+=1){var s=a[r];e=Math.min(e,s.x),i=Math.min(i,s.y),n=Math.max(n,s.x),o=Math.max(o,s.y)}return{minX:e,minY:i,maxX:n,maxY:o}}function zc(t,e){return e-t}Sc.prototype.insert=function(t,e,i,n,o,r){var a=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(i,n,o);for(var s=r?this.grid3D:this.grid,l=0;l<e.length;l++){for(var u=e[l],c=[1/0,1/0,-1/0,-1/0],h=0;h<u.length;h++){var p=u[h];c[0]=Math.min(c[0],p.x),c[1]=Math.min(c[1],p.y),c[2]=Math.max(c[2],p.x),c[3]=Math.max(c[3],p.y)}c[0]<Da&&c[1]<Da&&0<=c[2]&&0<=c[3]&&s.insert(a,c[0],c[1],c[2],c[3])}},Sc.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new yl.VectorTile(new ju(this.rawTileData)).layers,this.sourceLayerCoder=new kc(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Sc.prototype.query=function(o,r,a){var s=this;this.loadVTLayers();for(var l=o.params||{},u=Da/o.tileSize/o.scale,c=Yi(l.filter),h=o.queryGeometry,p=o.queryPadding*u,t=Pc(h),d=this.grid.query(t.minX-p,t.minY-p,t.maxX+p,t.maxY+p),e=Pc(o.cameraQueryGeometry),i=0,n=this.grid3D.query(e.minX-p,e.minY-p,e.maxX+p,e.maxY+p,function(t,e,i,n){return function(t,e,i,n,o){for(var r=0,a=t;r<a.length;r+=1){var s=a[r];if(e<=s.x&&i<=s.y&&n>=s.x&&o>=s.y)return!0}var l=[new st(e,i),new st(e,o),new st(n,o),new st(n,i)];if(2<t.length)for(var u=0,c=l;u<c.length;u+=1)if(qa(t,c[u]))return!0;for(var h=0;h<t.length-1;h++)if(Ha(t[h],t[h+1],l))return!0;return!1}(o.cameraQueryGeometry,t-p,e-p,i+p,n+p)});i<n.length;i+=1){var f=n[i];d.push(f)}d.sort(zc);for(var m,_={},g=function(t){var e=d[t];if(e!==m){m=e;var i=s.featureIndexArray.get(e),n=null;s.loadMatchingFeature(_,i.bucketIndex,i.sourceLayerIndex,i.featureIndex,c,l.layers,r,function(t,e){n||(n=Ra(t));var i={};return t.id&&(i=a.getState(e.sourceLayer||"_geojsonTileLayer",t.id)),e.queryIntersectsFeature(h,t,i,n,s.z,o.transform,u,o.pixelPosMatrix)})}},y=0;y<d.length;y++)g(y);return _},Sc.prototype.loadMatchingFeature=function(t,e,i,n,o,r,a,s){var l=this.bucketLayerIDs[e];if(!r||function(t,e){for(var i=0;i<t.length;i++)if(0<=e.indexOf(t[i]))return!0;return!1}(r,l)){var u=this.sourceLayerCoder.decode(i),c=this.vtLayers[u].feature(n);if(o(new Nn(this.tileID.overscaledZ),c))for(var h=0;h<l.length;h++){var p=l[h];if(!(r&&r.indexOf(p)<0)){var d=a[p];if(d){var f=!s||s(c,d);if(f){var m=new Ec(c,this.z,this.x,this.y);m.layer=d.serialize();var _=t[p];void 0===_&&(_=t[p]=[]),_.push({featureIndex:n,feature:m,intersectionZ:f})}}}}}},Sc.prototype.lookupSymbolFeatures=function(t,e,i,n,o,r){var a={};this.loadVTLayers();for(var s=Yi(n),l=0,u=t;l<u.length;l+=1){var c=u[l];this.loadMatchingFeature(a,e,i,c,s,o,r)}return a},Sc.prototype.hasLayer=function(t){for(var e=0,i=this.bucketLayerIDs;e<i.length;e+=1)for(var n=0,o=i[e];n<o.length;n+=1)if(t===o[n])return!0;return!1},Pn("FeatureIndex",Sc,{omit:["rawTileData","sourceLayerCoder"]});function Ic(t,e){this.tileID=t,this.uid=c(),this.uses=0,this.tileSize=e,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.expiredRequestCount=0,this.state="loading"}Ic.prototype.registerFadeDuration=function(t){var e=t+this.timeAdded;e<z.now()||this.fadeEndTime&&e<this.fadeEndTime||(this.fadeEndTime=e)},Ic.prototype.wasRequested=function(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state},Ic.prototype.loadVectorData=function(t,e,i){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){for(var n in t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(t,r){var a={};if(!r)return a;for(var e=function(){var t=l[s],i=t.layerIds.map(function(t){return r.getLayer(t)}).filter(Boolean);if(0!==i.length){t.layers=i,t.stateDependentLayerIds&&(t.stateDependentLayers=t.stateDependentLayerIds.map(function(e){return i.filter(function(t){return t.id===e})[0]}));for(var e=0,n=i;e<n.length;e+=1){var o=n[e];a[o.id]=t}}},s=0,l=t;s<l.length;s+=1)e();return a}(t.buckets,e.style),this.hasSymbolBuckets=!1,this.buckets){var o=this.buckets[n];if(o instanceof pu){if(this.hasSymbolBuckets=!0,!i)break;o.justReloaded=!0}}for(var r in this.queryPadding=0,this.buckets){var a=this.buckets[r];this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(r).queryRadius(a))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new Sr},Ic.prototype.unloadVectorData=function(){for(var t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},Ic.prototype.unloadDEMData=function(){this.dem=null,this.neighboringTiles=null,this.state="unloaded"},Ic.prototype.getBucket=function(t){return this.buckets[t.id]},Ic.prototype.upload=function(t){for(var e in this.buckets){var i=this.buckets[e];i.uploadPending()&&i.upload(t)}var n=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Du(t,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Du(t,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null)},Ic.prototype.prepare=function(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)},Ic.prototype.queryRenderedFeatures=function(t,e,i,n,o,r,a,s,l){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:i,cameraQueryGeometry:n,scale:o,tileSize:this.tileSize,pixelPosMatrix:l,transform:a,params:r,queryPadding:this.queryPadding*s},t,e):{}},Ic.prototype.querySourceFeatures=function(t,e){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData){var i=this.latestFeatureIndex.loadVTLayers(),n=e?e.sourceLayer:"",o=i._geojsonTileLayer||i[n];if(o)for(var r=Yi(e&&e.filter),a=this.tileID.canonical,s=a.z,l=a.x,u=a.y,c={z:s,x:l,y:u},h=0;h<o.length;h++){var p=o.feature(h);if(r(new Nn(this.tileID.overscaledZ),p)){var d=new Ec(p,s,l,u);d.tile=c,t.push(d)}}}},Ic.prototype.clearMask=function(){this.segments&&(this.segments.destroy(),delete this.segments),this.maskedBoundsBuffer&&(this.maskedBoundsBuffer.destroy(),delete this.maskedBoundsBuffer),this.maskedIndexBuffer&&(this.maskedIndexBuffer.destroy(),delete this.maskedIndexBuffer)},Ic.prototype.setMask=function(t,e){if(!p(this.mask,t)&&(this.mask=t,this.clearMask(),!p(t,{0:!0}))){var i=new wo,n=new dr;this.segments=new Jr,this.segments.prepareSegment(0,i,n);for(var o=Object.keys(t),r=0;r<o.length;r++){var a=t[+o[r]],s=Da>>a.z,l=new st(a.x*s,a.y*s),u=new st(l.x+s,l.y+s),c=this.segments.prepareSegment(4,i,n);i.emplaceBack(l.x,l.y,l.x,l.y),i.emplaceBack(u.x,l.y,u.x,l.y),i.emplaceBack(l.x,u.y,l.x,u.y),i.emplaceBack(u.x,u.y,u.x,u.y);var h=c.vertexLength;n.emplaceBack(h,h+1,h+2),n.emplaceBack(h+1,h+2,h+3),c.vertexLength+=4,c.primitiveLength+=2}this.maskedBoundsBuffer=e.createVertexBuffer(i,Tc.members),this.maskedIndexBuffer=e.createIndexBuffer(n)}},Ic.prototype.hasData=function(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state},Ic.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},Ic.prototype.setExpiryData=function(t){var e=this.expirationTime;if(t.cacheControl){var i=L(t.cacheControl);i["max-age"]&&(this.expirationTime=Date.now()+1e3*i["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){var n=Date.now(),o=!1;if(this.expirationTime>n)o=!1;else if(e)if(this.expirationTime<e)o=!0;else{var r=this.expirationTime-e;r?this.expirationTime=n+Math.max(r,3e4):o=!0}else o=!0;o?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},Ic.prototype.getExpiryTimeout=function(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)},Ic.prototype.setFeatureState=function(t,e){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&0!==Object.keys(t).length){var i=this.latestFeatureIndex.loadVTLayers();for(var n in this.buckets){var o=this.buckets[n],r=o.layers[0].sourceLayer||"_geojsonTileLayer",a=i[r],s=t[r];a&&s&&0!==Object.keys(s).length&&(o.update(s,a,this.imageAtlas&&this.imageAtlas.patternPositions||{}),e&&e.style&&(this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(n).queryRadius(o))))}}},Ic.prototype.holdingForFade=function(){return void 0!==this.symbolFadeHoldUntil},Ic.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<z.now()},Ic.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},Ic.prototype.setHoldDuration=function(t){this.symbolFadeHoldUntil=z.now()+t};var Ac=24,Dc={horizontal:1,vertical:2,horizontalOnly:3},Oc=function(){this.text="",this.sectionIndex=[],this.sections=[]};function Rc(t,e,i,n,o,r,a,s,l,u){var c,h=Oc.fromFeature(t,i);u===Dc.vertical&&h.verticalizePunctuation();var p=qn.processBidirectionalText,d=qn.processStyledBidirectionalText;if(p&&1===h.sections.length){c=[];for(var f=0,m=p(h.toString(),jc(h,s,n,e));f<m.length;f+=1){var _=m[f],g=new Oc;g.text=_,g.sections=h.sections;for(var y=0;y<_.length;y++)g.sectionIndex.push(0);c.push(g)}}else if(d){c=[];for(var v=0,x=d(h.text,h.sectionIndex,jc(h,s,n,e));v<x.length;v+=1){var b=x[v],w=new Oc;w.text=b[0],w.sectionIndex=b[1],w.sections=h.sections,c.push(w)}}else c=function(t,e){for(var i=[],n=t.text,o=0,r=0,a=e;r<a.length;r+=1){var s=a[r];i.push(t.substring(o,s)),o=s}return o<n.length&&i.push(t.substring(o,n.length)),i}(h,jc(h,s,n,e));var L=[],k={positionedGlyphs:L,text:h.toString(),top:l[1],bottom:l[1],left:l[0],right:l[0],writingMode:u,lineCount:c.length};return function(t,e,u,i,n,o,r,a){for(var s=0,l=-17,c=0,h=t.positionedGlyphs,p="right"===o?1:"left"===o?0:.5,d=0,f=u;d<f.length;d+=1){var m=f[d];m.trim();var _=m.getMaxScale();if(m.length()){for(var g=h.length,y=0;y<m.length();y++){var v=m.getSection(y),x=m.getCharCode(y),b=24*(_-v.scale),w=e[v.fontStack],L=w&&w[x];L&&(Fn(x)&&r!==Dc.horizontal?(h.push({glyph:x,x:s,y:b,vertical:!0,scale:v.scale,fontStack:v.fontStack}),s+=Ac*v.scale+a):(h.push({glyph:x,x:s,y:l+b,vertical:!1,scale:v.scale,fontStack:v.fontStack}),s+=L.metrics.advance*v.scale+a))}if(h.length!==g){var k=s-a;c=Math.max(k,c),Vc(h,e,g,h.length-1,p)}s=0,l+=i*_}else l+=i}var T=$c(n),E=T.horizontalAlign,M=T.verticalAlign;!function(t,e,i,n,o,r){for(var a=(p-E)*c,s=(-M*u.length+.5)*r,l=0;l<t.length;l++)t[l].x+=a,t[l].y+=s}(h,0,0,0,0,i);var C=l- -17;t.top+=-M*C,t.bottom=t.top+C,t.left+=-E*c,t.right=t.left+c}(k,e,c,o,r,a,u,s),!!L.length&&k}Oc.fromFeature=function(t,e){for(var i=new Oc,n=0;n<t.sections.length;n++){var o=t.sections[n];i.sections.push({scale:o.scale||1,fontStack:o.fontStack||e}),i.text+=o.text;for(var r=0;r<o.text.length;r++)i.sectionIndex.push(n)}return i},Oc.prototype.length=function(){return this.text.length},Oc.prototype.getSection=function(t){return this.sections[this.sectionIndex[t]]},Oc.prototype.getCharCode=function(t){return this.text.charCodeAt(t)},Oc.prototype.verticalizePunctuation=function(){this.text=function(t){for(var e="",i=0;i<t.length;i++){var n=t.charCodeAt(i+1)||null,o=t.charCodeAt(i-1)||null;n&&Un(n)&&!Yl[t[i+1]]||o&&Un(o)&&!Yl[t[i-1]]||!Yl[t[i]]?e+=t[i]:e+=Yl[t[i]]}return e}(this.text)},Oc.prototype.trim=function(){for(var t=0,e=0;e<this.text.length&&Bc[this.text.charCodeAt(e)];e++)t++;for(var i=this.text.length,n=this.text.length-1;0<=n&&t<=n&&Bc[this.text.charCodeAt(n)];n--)i--;this.text=this.text.substring(t,i),this.sectionIndex=this.sectionIndex.slice(t,i)},Oc.prototype.substring=function(t,e){var i=new Oc;return i.text=this.text.substring(t,e),i.sectionIndex=this.sectionIndex.slice(t,e),i.sections=this.sections,i},Oc.prototype.toString=function(){return this.text},Oc.prototype.getMaxScale=function(){var i=this;return this.sectionIndex.reduce(function(t,e){return Math.max(t,i.sections[e].scale)},0)};var Bc={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Fc={};function Uc(t,e,i,n){var o=Math.pow(t-e,2);return n?t<e?o/2:2*o:o+Math.abs(i)*i}function Nc(t,e,i,n,o,r){for(var a=null,s=Uc(e,i,o,r),l=0,u=n;l<u.length;l+=1){var c=u[l],h=Uc(e-c.x,i,o,r)+c.badness;h<=s&&(a=c,s=h)}return{index:t,x:e,priorBreak:a,badness:s}}function jc(t,e,i,n){if(!i)return[];if(!t)return[];for(var o,r=[],a=function(t,e,i,n){for(var o=0,r=0;r<t.length();r++){var a=t.getSection(r),s=n[a.fontStack],l=s&&s[t.getCharCode(r)];l&&(o+=l.metrics.advance*a.scale+e)}return o/Math.max(1,Math.ceil(o/i))}(t,e,i,n),s=0<=t.text.indexOf(""),l=0,u=0;u<t.length();u++){var c=t.getSection(u),h=t.getCharCode(u),p=n[c.fontStack],d=p&&p[h];if(d&&!Bc[h]&&(l+=d.metrics.advance*c.scale+e),u<t.length()-1){var f=!((o=h)<11904||!(On["Bopomofo Extended"](o)||On.Bopomofo(o)||On["CJK Compatibility Forms"](o)||On["CJK Compatibility Ideographs"](o)||On["CJK Compatibility"](o)||On["CJK Radicals Supplement"](o)||On["CJK Strokes"](o)||On["CJK Symbols and Punctuation"](o)||On["CJK Unified Ideographs Extension A"](o)||On["CJK Unified Ideographs"](o)||On["Enclosed CJK Letters and Months"](o)||On["Halfwidth and Fullwidth Forms"](o)||On.Hiragana(o)||On["Ideographic Description Characters"](o)||On["Kangxi Radicals"](o)||On["Katakana Phonetic Extensions"](o)||On.Katakana(o)||On["Vertical Forms"](o)||On["Yi Radicals"](o)||On["Yi Syllables"](o)));(Fc[h]||f)&&r.push(Nc(u+1,l,a,r,(m=h,_=t.getCharCode(u+1),g=void 0,g=0,10===m&&(g-=1e4),f&&s&&(g+=150),40!==m&&65288!==m||(g+=50),41!==_&&65289!==_||(g+=50),g),!1))}}var m,_,g;return function t(e){return e?t(e.priorBreak).concat(e.index):[]}(Nc(t.length(),l,a,r,0,!0))}function $c(t){var e=.5,i=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":i=1;break;case"top":case"top-right":case"top-left":i=0}return{horizontalAlign:e,verticalAlign:i}}function Vc(t,e,i,n,o){if(o){var r=t[n],a=e[r.fontStack],s=a&&a[r.glyph];if(s)for(var l=s.metrics.advance*r.scale,u=(t[n].x+l)*o,c=i;c<=n;c++)t[c].x-=u}}function Zc(t,e,i,n,o){if(void 0===e.segment)return!0;for(var r=e,a=e.segment+1,s=0;-i/2<s;){if(--a<0)return!1;s-=t[a].dist(r),r=t[a]}s+=t[a].dist(t[a+1]),a++;for(var l=[],u=0;s<i/2;){var c=t[a-1],h=t[a],p=t[a+1];if(!p)return!1;var d=c.angleTo(h)-h.angleTo(p);for(d=Math.abs((d+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:s,angleDelta:d}),u+=d;s-l[0].distance>n;)u-=l.shift().angleDelta;if(o<u)return!1;a++,s+=h.dist(p)}return!0}function Gc(t){for(var e=0,i=0;i<t.length-1;i++)e+=t[i].dist(t[i+1]);return e}function qc(t,e,i){return t?.6*e*i:0}function Hc(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function Wc(t,e,i,n,o,r){for(var a=qc(i,o,r),s=Hc(i,n)*r,l=0,u=Gc(t)/2,c=0;c<t.length-1;c++){var h=t[c],p=t[c+1],d=h.dist(p);if(u<l+d){var f=(u-l)/d,m=Fe(h.x,p.x,f),_=Fe(h.y,p.y,f),g=new Ql(m,_,p.angleTo(h),c);return g._round(),!a||Zc(t,g,s,a,e)?g:void 0}l+=d}}Fc[10]=!0,Fc[32]=!0,Fc[38]=!0,Fc[40]=!0,Fc[41]=!0,Fc[43]=!0,Fc[45]=!0,Fc[47]=!0,Fc[173]=!0,Fc[183]=!0,Fc[8203]=!0,Fc[8208]=!0,Fc[8211]=!0,Fc[8231]=!0;var Xc=function(t,e,i,n,o,r,a,s,l,u,c,h){var p=a.top*s-l,d=a.bottom*s+l,f=a.left*s-l,m=a.right*s+l;if(this.boxStartIndex=t.length,u){var _=d-p,g=m-f;0<_&&(_=Math.max(10*s,_),this._addLineCollisionCircles(t,e,i,i.segment,g,_,n,o,r,c))}else{if(h){var y=new st(f,p),v=new st(m,p),x=new st(f,d),b=new st(m,d),w=h*Math.PI/180;y._rotate(w),v._rotate(w),x._rotate(w),b._rotate(w),f=Math.min(y.x,v.x,x.x,b.x),m=Math.max(y.x,v.x,x.x,b.x),p=Math.min(y.y,v.y,x.y,b.y),d=Math.max(y.y,v.y,x.y,b.y)}t.emplaceBack(i.x,i.y,f,p,m,d,n,o,r,0,0)}this.boxEndIndex=t.length};Xc.prototype._addLineCollisionCircles=function(t,e,i,n,o,r,a,s,l,u){var c=r/2,h=Math.floor(o/c)||1,p=1+.4*Math.log(u)/Math.LN2,d=Math.floor(h*p/2),f=-r/2,m=i,_=n+1,g=f,y=-o/2,v=y-o/4;do{if(--_<0){if(y<g)return;_=0;break}g-=e[_].dist(m),m=e[_]}while(v<g);for(var x=e[_].dist(e[_+1]),b=-d;b<h+d;b++){var w=b*c,L=y+w;if(w<0&&(L+=w),o<w&&(L+=w-o),!(L<g)){for(;g+x<L;){if(g+=x,++_+1>=e.length)return;x=e[_].dist(e[_+1])}var k=L-g,T=e[_],E=e[_+1].sub(T)._unit()._mult(k)._add(T)._round(),M=Math.abs(L-f)<c?0:.8*(L-f);t.emplaceBack(E.x,E.y,-r/2,-r/2,r/2,r/2,a,s,l,r/2,M)}}};var Kc=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=Jc),this.data=t,this.length=this.data.length,this.compare=e,0<this.length)for(var i=(this.length>>1)-1;0<=i;i--)this._down(i)};function Jc(t,e){return t<e?-1:e<t?1:0}function Yc(t,e,i){void 0===e&&(e=1),void 0===i&&(i=!1);for(var n=1/0,o=1/0,r=-1/0,a=-1/0,s=t[0],l=0;l<s.length;l++){var u=s[l];(!l||u.x<n)&&(n=u.x),(!l||u.y<o)&&(o=u.y),(!l||u.x>r)&&(r=u.x),(!l||u.y>a)&&(a=u.y)}var c=r-n,h=a-o,p=Math.min(c,h),d=p/2,f=new Kc([],Qc);if(0===p)return new st(n,o);for(var m=n;m<r;m+=p)for(var _=o;_<a;_+=p)f.push(new th(m+d,_+d,d,t));for(var g=function(t){for(var e=0,i=0,n=0,o=t[0],r=0,a=o.length,s=a-1;r<a;s=r++){var l=o[r],u=o[s],c=l.x*u.y-u.x*l.y;i+=(l.x+u.x)*c,n+=(l.y+u.y)*c,e+=3*c}return new th(i/e,n/e,0,t)}(t),y=f.length;f.length;){var v=f.pop();(v.d>g.d||!g.d)&&(g=v,i&&console.log("found best %d after %d probes",Math.round(1e4*v.d)/1e4,y)),v.max-g.d<=e||(d=v.h/2,f.push(new th(v.p.x-d,v.p.y-d,d,t)),f.push(new th(v.p.x+d,v.p.y-d,d,t)),f.push(new th(v.p.x-d,v.p.y+d,d,t)),f.push(new th(v.p.x+d,v.p.y+d,d,t)),y+=4)}return i&&(console.log("num probes: "+y),console.log("best distance: "+g.d)),g.p}function Qc(t,e){return e.max-t.max}function th(t,e,i,n){this.p=new st(t,e),this.h=i,this.d=function(t,e){for(var i=!1,n=1/0,o=0;o<e.length;o++)for(var r=e[o],a=0,s=r.length,l=s-1;a<s;l=a++){var u=r[a],c=r[l];u.y>t.y!=c.y>t.y&&t.x<(c.x-u.x)*(t.y-u.y)/(c.y-u.y)+u.x&&(i=!i),n=Math.min(n,Za(t,u,c))}return(i?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}Kc.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},Kc.prototype.pop=function(){if(0!==this.length){var t=this.data[0];return this.length--,0<this.length&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),t}},Kc.prototype.peek=function(){return this.data[0]},Kc.prototype._up=function(t){for(var e=this.data,i=this.compare,n=e[t];0<t;){var o=t-1>>1,r=e[o];if(0<=i(n,r))break;e[t]=r,t=o}e[t]=n},Kc.prototype._down=function(t){for(var e=this.data,i=this.compare,n=this.length>>1,o=e[t];t<n;){var r=1+(t<<1),a=e[r],s=r+1;if(s<this.length&&i(e[s],a)<0&&(a=e[r=s]),0<=i(a,o))break;e[t]=a,t=r}e[t]=o};var eh=e(function(t){t.exports=function(t,e){var i,n,o,r,a,s,l,u;for(i=3&t.length,n=t.length-i,o=e,a=3432918353,s=461845907,u=0;u<n;)l=255&t.charCodeAt(u)|(255&t.charCodeAt(++u))<<8|(255&t.charCodeAt(++u))<<16|(255&t.charCodeAt(++u))<<24,++u,o=27492+(65535&(r=5*(65535&(o=(o^=l=(65535&(l=(l=(65535&l)*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|o>>>19))+((5*(o>>>16)&65535)<<16)&4294967295))+((58964+(r>>>16)&65535)<<16);switch(l=0,i){case 3:l^=(255&t.charCodeAt(u+2))<<16;case 2:l^=(255&t.charCodeAt(u+1))<<8;case 1:o^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(u)))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return o^=t.length,o=2246822507*(65535&(o^=o>>>16))+((2246822507*(o>>>16)&65535)<<16)&4294967295,o=3266489909*(65535&(o^=o>>>13))+((3266489909*(o>>>16)&65535)<<16)&4294967295,(o^=o>>>16)>>>0}}),ih=e(function(t){t.exports=function(t,e){for(var i,n=t.length,o=e^n,r=0;4<=n;)i=1540483477*(65535&(i=255&t.charCodeAt(r)|(255&t.charCodeAt(++r))<<8|(255&t.charCodeAt(++r))<<16|(255&t.charCodeAt(++r))<<24))+((1540483477*(i>>>16)&65535)<<16),o=1540483477*(65535&o)+((1540483477*(o>>>16)&65535)<<16)^(i=1540483477*(65535&(i^=i>>>24))+((1540483477*(i>>>16)&65535)<<16)),n-=4,++r;switch(n){case 3:o^=(255&t.charCodeAt(r+2))<<16;case 2:o^=(255&t.charCodeAt(r+1))<<8;case 1:o=1540483477*(65535&(o^=255&t.charCodeAt(r)))+((1540483477*(o>>>16)&65535)<<16)}return o=1540483477*(65535&(o^=o>>>13))+((1540483477*(o>>>16)&65535)<<16),(o^=o>>>15)>>>0}}),nh=eh,oh=eh,rh=ih;nh.murmur3=oh,nh.murmur2=rh;function ah(t,e){var i=0,n=0,o=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":n=o-7;break;case"bottom-right":case"bottom-left":n=7-o;break;case"bottom":n=7-e;break;case"top":n=e-7}switch(t){case"top-right":case"bottom-right":i=-o;break;case"top-left":case"bottom-left":i=o;break;case"left":i=e;break;case"right":i=-e}return[i,n]}function sh(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function lh(i,n,o,r,a,s,l){var t=s.layoutTextSize.evaluate(n,{}),e=s.layoutIconSize.evaluate(n,{}),u=s.textMaxSize.evaluate(n,{});void 0===u&&(u=t);function c(t,e){e.x<0||e.x>=Da||e.y<0||e.y>=Da||function(t,e,i,n,o,r,a,s,l,u,c,h,p,d,f,m,_,g,y,v,x){var b,w,L=t.addToLineVertexArray(e,i),k=0,T=0,E=0,M={},C=nh(""),S=(r.layout.get("text-radial-offset").evaluate(y,{})||0)*Ac;for(var P in n.horizontal){var z=n.horizontal[P];if(!b){C=nh(z.text);var I=r.layout.get("text-rotate").evaluate(y,{});b=new Xc(a,i,e,s,l,u,z,c,h,p,t.overscaling,I)}var A=1===z.lineCount;if(T+=ch(t,e,z,r,p,y,d,L,n.vertical?Dc.horizontal:Dc.horizontalOnly,A?Object.keys(n.horizontal):[P],M,v,x),A)break}n.vertical&&(E+=ch(t,e,n.vertical,r,p,y,d,L,Dc.vertical,["vertical"],M,v,x));var D=b?b.boxStartIndex:t.collisionBoxArray.length,O=b?b.boxEndIndex:t.collisionBoxArray.length;if(o){var R=function(t,e,i,n,o,r){var a,s,l,u,c=e.image,h=i.layout,p=e.top-1/c.pixelRatio,d=e.left-1/c.pixelRatio,f=e.bottom+1/c.pixelRatio,m=e.right+1/c.pixelRatio;if("none"!==h.get("icon-text-fit")&&o){var _=m-d,g=f-p,y=h.get("text-size").evaluate(r,{})/24,v=o.left*y,x=o.right*y,b=o.top*y,w=x-v,L=o.bottom*y-b,k=h.get("icon-text-fit-padding")[0],T=h.get("icon-text-fit-padding")[1],E=h.get("icon-text-fit-padding")[2],M=h.get("icon-text-fit-padding")[3],C="width"===h.get("icon-text-fit")?.5*(L-g):0,S="height"===h.get("icon-text-fit")?.5*(w-_):0,P="width"===h.get("icon-text-fit")||"both"===h.get("icon-text-fit")?w:_,z="height"===h.get("icon-text-fit")||"both"===h.get("icon-text-fit")?L:g;a=new st(v+S-M,b+C-k),s=new st(v+S+T+P,b+C-k),l=new st(v+S+T+P,b+C+E+z),u=new st(v+S-M,b+C+E+z)}else a=new st(d,p),s=new st(m,p),l=new st(m,f),u=new st(d,f);var I=i.layout.get("icon-rotate").evaluate(r,{})*Math.PI/180;if(I){var A=Math.sin(I),D=Math.cos(I),O=[D,-A,A,D];a._matMult(O),s._matMult(O),u._matMult(O),l._matMult(O)}return[{tl:a,tr:s,bl:u,br:l,tex:c.paddedRect,writingMode:void 0,glyphOffset:[0,0]}]}(0,o,r,0,hh(n.horizontal),y),B=r.layout.get("icon-rotate").evaluate(y,{});w=new Xc(a,i,e,s,l,u,o,f,m,!1,t.overscaling,B),k=4*R.length;var F=t.iconSizeData,U=null;"source"===F.kind?(U=[eu*r.layout.get("icon-size").evaluate(y,{})])[0]>uh&<(t.layerIds[0]+': Value for "icon-size" is >= 256. Reduce your "icon-size".'):"composite"===F.kind&&((U=[eu*x.compositeIconSizes[0].evaluate(y,{}),eu*x.compositeIconSizes[1].evaluate(y,{})])[0]>uh||U[1]>uh)&<(t.layerIds[0]+': Value for "icon-size" is >= 256. Reduce your "icon-size".'),t.addSymbols(t.icon,R,U,g,_,y,!1,e,L.lineStartIndex,L.lineLength)}var N=w?w.boxStartIndex:t.collisionBoxArray.length,j=w?w.boxEndIndex:t.collisionBoxArray.length;t.glyphOffsetArray.length>=pu.MAX_GLYPHS&<("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),t.symbolInstances.emplaceBack(e.x,e.y,0<=M.right?M.right:-1,0<=M.center?M.center:-1,0<=M.left?M.left:-1,M.vertical||-1,C,D,O,N,j,s,T,E,k,0,c,S)}(i,e,t,o,r,i.layers[0],i.collisionBoxArray,n.index,n.sourceLayerIndex,i.index,C,I,O,l,P,A,R,T,n,a,s)}var h,p,d,f,m,_,g,y,v,x,b,w,L,k=i.layers[0].layout,T=k.get("icon-offset").evaluate(n,{}),E=hh(o.horizontal),M=t/24,C=i.tilePixelRatio*M,S=i.tilePixelRatio*u/24,P=i.tilePixelRatio*e,z=i.tilePixelRatio*k.get("symbol-spacing"),I=k.get("text-padding")*i.tilePixelRatio,A=k.get("icon-padding")*i.tilePixelRatio,D=k.get("text-max-angle")/180*Math.PI,O="map"===k.get("text-rotation-alignment")&&"point"!==k.get("symbol-placement"),R="map"===k.get("icon-rotation-alignment")&&"point"!==k.get("symbol-placement"),B=k.get("symbol-placement"),F=z/2;if("line"===B)for(var U=0,N=function(t,e,i,n,o){for(var r=[],a=0;a<t.length;a++)for(var s=t[a],l=void 0,u=0;u<s.length-1;u++){var c=s[u],h=s[u+1];c.x<0&&h.x<0||(c.x<0?c=new st(0,c.y+(h.y-c.y)*((0-c.x)/(h.x-c.x)))._round():h.x<0&&(h=new st(0,c.y+(h.y-c.y)*((0-c.x)/(h.x-c.x)))._round()),c.y<0&&h.y<0||(c.y<0?c=new st(c.x+(h.x-c.x)*((0-c.y)/(h.y-c.y)),0)._round():h.y<0&&(h=new st(c.x+(h.x-c.x)*((0-c.y)/(h.y-c.y)),0)._round()),c.x>=n&&h.x>=n||(c.x>=n?c=new st(n,c.y+(h.y-c.y)*((n-c.x)/(h.x-c.x)))._round():h.x>=n&&(h=new st(n,c.y+(h.y-c.y)*((n-c.x)/(h.x-c.x)))._round()),c.y>=o&&h.y>=o||(c.y>=o?c=new st(c.x+(h.x-c.x)*((o-c.y)/(h.y-c.y)),o)._round():h.y>=o&&(h=new st(c.x+(h.x-c.x)*((o-c.y)/(h.y-c.y)),o)._round()),l&&c.equals(l[l.length-1])||(l=[c],r.push(l)),l.push(h)))))}return r}(n.geometry,0,0,Da,Da);U<N.length;U+=1)for(var j=N[U],$=0,V=(h=j,p=z,d=D,f=o.vertical||E,m=r,_=24,g=S,y=i.overscaling,v=Da,void 0,x=qc(f,_,g),b=Hc(f,m),w=b*g,L=0===h[0].x||h[0].x===v||0===h[0].y||h[0].y===v,p-w<p/4&&(p=w+p/4),function t(e,i,n,o,r,a,s,l,u){for(var c=a/2,h=Gc(e),p=0,d=i-n,f=[],m=0;m<e.length-1;m++){for(var _=e[m],g=e[m+1],y=_.dist(g),v=g.angleTo(_);d+n<p+y;){var x=((d+=n)-p)/y,b=Fe(_.x,g.x,x),w=Fe(_.y,g.y,x);if(0<=b&&b<u&&0<=w&&w<u&&0<=d-c&&d+c<=h){var L=new Ql(b,w,v,m);L._round(),o&&!Zc(e,L,a,o,r)||f.push(L)}}p+=y}return l||f.length||s||(f=t(e,p/2,n,o,r,a,s,!0,u)),f}(h,L?p/2*y%p:(b/2+2*_)*g*y%p,p,x,d,w,L,!1,v));$<V.length;$+=1){var Z=V[$];E&&ph(i,E.text,F,Z)||c(j,Z)}else if("line-center"===B)for(var G=0,q=n.geometry;G<q.length;G+=1){var H=q[G];if(1<H.length){var W=Wc(H,D,o.vertical||E,r,24,S);W&&c(H,W)}}else if("Polygon"===n.type)for(var X=0,K=tl(n.geometry,0);X<K.length;X+=1){var J=K[X],Y=Yc(J,16);c(J[0],new Ql(Y.x,Y.y,0))}else if("LineString"===n.type)for(var Q=0,tt=n.geometry;Q<tt.length;Q+=1){var et=tt[Q];c(et,new Ql(et[0].x,et[0].y,0))}else if("Point"===n.type)for(var it=0,nt=n.geometry;it<nt.length;it+=1)for(var ot=0,rt=nt[it];ot<rt.length;ot+=1){var at=rt[ot];c([at],new Ql(at.x,at.y,0))}}var uh=65535;function ch(t,e,i,A,n,o,r,a,s,l,u,c,h){var p=function(t,e,i,n,o,r,a){for(var s=A.layout.get("text-rotate").evaluate(r,{})*Math.PI/180,l=e.positionedGlyphs,u=[],c=0;c<l.length;c++){var h=l[c],p=a[h.fontStack],d=p&&p[h.glyph];if(d){var f=d.rect;if(f){var m=uc+1,_=d.metrics.advance*h.scale/2,g=o?[h.x+_,h.y]:[0,0],y=o?[0,0]:[h.x+_+i[0],h.y+i[1]],v=(d.metrics.left-m)*h.scale-_+y[0],x=(-d.metrics.top-m)*h.scale+y[1],b=v+f.w*h.scale,w=x+f.h*h.scale,L=new st(v,x),k=new st(b,x),T=new st(v,w),E=new st(b,w);if(o&&h.vertical){var M=new st(-_,_),C=-Math.PI/2,S=new st(5,0);L._rotateAround(C,M)._add(S),k._rotateAround(C,M)._add(S),T._rotateAround(C,M)._add(S),E._rotateAround(C,M)._add(S)}if(s){var P=Math.sin(s),z=Math.cos(s),I=[z,-P,P,z];L._matMult(I),k._matMult(I),T._matMult(I),E._matMult(I)}u.push({tl:L,tr:k,bl:T,br:E,tex:f,writingMode:e.writingMode,glyphOffset:g})}}}return u}(0,i,r,0,n,o,c),d=t.textSizeData,f=null;"source"===d.kind?(f=[eu*A.layout.get("text-size").evaluate(o,{})])[0]>uh&<(t.layerIds[0]+': Value for "text-size" is >= 256. Reduce your "text-size".'):"composite"===d.kind&&((f=[eu*h.compositeTextSizes[0].evaluate(o,{}),eu*h.compositeTextSizes[1].evaluate(o,{})])[0]>uh||f[1]>uh)&<(t.layerIds[0]+': Value for "text-size" is >= 256. Reduce your "text-size".'),t.addSymbols(t.text,p,f,r,n,o,s,e,a.lineStartIndex,a.lineLength);for(var m=0,_=l;m<_.length;m+=1)u[_[m]]=t.text.placedSymbolArray.length-1;return 4*p.length}function hh(t){for(var e in t)return t[e];return null}function ph(t,e,i,n){var o=t.compareText;if(e in o){for(var r=o[e],a=r.length-1;0<=a;a--)if(n.dist(r[a])<i)return!0}else o[e]=[];return o[e].push(n),!1}t.Actor=lc,t.AlphaImage=_s,t.CanonicalTileID=vc,t.CollisionBoxArray=Sr,t.Color=de,t.DEMData=Lc,t.DataConstantProperty=eo,t.DictionaryCoder=kc,t.EXTENT=Da,t.ErrorEvent=Nt,t.EvaluationParameters=Nn,t.Event=Bt,t.Evented=Ft,t.FeatureIndex=Sc,t.FillBucket=ol,t.FillExtrusionBucket=wl,t.ImageAtlas=Au,t.ImagePosition=zu,t.LineBucket=Dl,t.LngLat=pc,t.LngLatBounds=hc,t.MercatorCoordinate=yc,t.ONE_EM=Ac,t.OverscaledTileID=bc,t.Point=st,t.Point$1=st,t.ProgramConfiguration=za,t.Properties=lo,t.Protobuf=ju,t.RGBAImage=gs,t.RequestManager=B,t.ResourceType=wt,t.SegmentVector=Jr,t.SourceFeatureState=Cc,t.StructArrayLayout1ui2=vr,t.StructArrayLayout2i4=vo,t.StructArrayLayout2ui4=_r,t.StructArrayLayout3ui6=dr,t.StructArrayLayout4i8=wo,t.SymbolBucket=pu,t.Texture=Du,t.Tile=Ic,t.Transitionable=Xn,t.Uniform1f=ha,t.Uniform1i=ca,t.Uniform2f=pa,t.Uniform3f=da,t.Uniform4f=fa,t.UniformColor=ma,t.UniformMatrix4f=ga,t.UnwrappedTileID=xc,t.ValidationError=Vt,t.WritingMode=Dc,t.ZoomHistory=Dn,t.addDynamicAttributes=uu,t.asyncAll=function(t,e,n){if(!t.length)return n(null,[]);var o=t.length,r=new Array(t.length),a=null;t.forEach(function(t,i){e(t,function(t,e){t&&(a=t),r[i]=e,0==--o&&n(a,r)})})},t.bezier=o,t.bindAll=m,t.browser=z,t.cacheEntryPossiblyAdded=function(t){++bt>_t&&(t.send("enforceCacheSizeLimit",mt),bt=0)},t.clamp=l,t.clearTileCache=function(t){var e=self.caches.delete(ft);t&&e.catch(t).then(function(){return t()})},t.clone=function(t){var e=new Ya(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.clone$1=v,t.config=I,t.create=function(){var t=new Ya(16);return Ya!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.create$1=Qa,t.create$2=function(){var t=new Ya(4);return Ya!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=Ui,t.createLayout=_o,t.createStyleLayer=function(t){return"custom"===t.type?new Mu(t):new Cu[t.type](t)},t.deepEqual=p,t.ease=r,t.emitValidationErrors=kn,t.endsWith=_,t.enforceCacheSizeLimit=function(n){self.caches&&self.caches.open(ft).then(function(i){i.keys().then(function(t){for(var e=0;e<t.length-n;e++)i.delete(t[e])})})},t.evaluateRadialOffset=ah,t.evaluateSizeForFeature=nu,t.evaluateSizeForZoom=ou,t.evented=Gn,t.extend=f,t.featureFilter=Yi,t.filterObject=y,t.fromRotation=function(t,e){var i=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},t.getAnchorAlignment=$c,t.getAnchorJustification=sh,t.getArrayBuffer=Pt,t.getImage=Dt,t.getJSON=function(t,e){return St(f(t,{type:"json"}),e)},t.getReferrer=Mt,t.getVideo=function(t,e){var i,n,o=self.document.createElement("video");o.muted=!0,o.onloadstart=function(){e(null,o)};for(var r=0;r<t.length;r++){var a=self.document.createElement("source");i=t[r],n=void 0,(n=self.document.createElement("a")).href=i,n.protocol===self.document.location.protocol&&n.host===self.document.location.host||(o.crossOrigin="Anonymous"),a.src=t[r],o.appendChild(a)}return{cancel:function(){}}},t.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},t.invert=function(t,e){var i=e[0],n=e[1],o=e[2],r=e[3],a=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],p=e[10],d=e[11],f=e[12],m=e[13],_=e[14],g=e[15],y=i*s-n*a,v=i*l-o*a,x=i*u-r*a,b=n*l-o*s,w=n*u-r*s,L=o*u-r*l,k=c*m-h*f,T=c*_-p*f,E=c*g-d*f,M=h*_-p*m,C=h*g-d*m,S=p*g-d*_,P=y*S-v*C+x*M+b*E-w*T+L*k;return P?(P=1/P,t[0]=(s*S-l*C+u*M)*P,t[1]=(o*C-n*S-r*M)*P,t[2]=(m*L-_*w+g*b)*P,t[3]=(p*w-h*L-d*b)*P,t[4]=(l*E-a*S-u*T)*P,t[5]=(i*S-o*E+r*T)*P,t[6]=(_*x-f*L-g*v)*P,t[7]=(c*L-p*x+d*v)*P,t[8]=(a*C-s*E+u*k)*P,t[9]=(n*E-i*C-r*k)*P,t[10]=(f*w-m*x+g*y)*P,t[11]=(h*x-c*w-d*y)*P,t[12]=(s*T-a*M-l*k)*P,t[13]=(i*M-n*T+o*k)*P,t[14]=(m*v-f*b-_*y)*P,t[15]=(c*b-h*v+p*y)*P,t):null},t.isChar=On,t.isMapboxURL=j,t.keysDifference=function(t,e){var i=[];for(var n in t)n in e||i.push(n);return i},t.makeRequest=St,t.mapObject=g,t.mercatorXfromLng=fc,t.mercatorYfromLat=mc,t.mercatorZfromAltitude=_c,t.multiply=function(t,e,i){var n=e[0],o=e[1],r=e[2],a=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],p=e[9],d=e[10],f=e[11],m=e[12],_=e[13],g=e[14],y=e[15],v=i[0],x=i[1],b=i[2],w=i[3];return t[0]=v*n+x*s+b*h+w*m,t[1]=v*o+x*l+b*p+w*_,t[2]=v*r+x*u+b*d+w*g,t[3]=v*a+x*c+b*f+w*y,v=i[4],x=i[5],b=i[6],w=i[7],t[4]=v*n+x*s+b*h+w*m,t[5]=v*o+x*l+b*p+w*_,t[6]=v*r+x*u+b*d+w*g,t[7]=v*a+x*c+b*f+w*y,v=i[8],x=i[9],b=i[10],w=i[11],t[8]=v*n+x*s+b*h+w*m,t[9]=v*o+x*l+b*p+w*_,t[10]=v*r+x*u+b*d+w*g,t[11]=v*a+x*c+b*f+w*y,v=i[12],x=i[13],b=i[14],w=i[15],t[12]=v*n+x*s+b*h+w*m,t[13]=v*o+x*l+b*p+w*_,t[14]=v*r+x*u+b*d+w*g,t[15]=v*a+x*c+b*f+w*y,t},t.mvt=yl,t.number=Fe,t.ortho=function(t,e,i,n,o,r,a){var s=1/(e-i),l=1/(n-o),u=1/(r-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+i)*s,t[13]=(o+n)*l,t[14]=(a+r)*u,t[15]=1,t},t.parseGlyphPBF=function(t){return new ju(t).readFields(rc,[])},t.pbf=ju,t.performSymbolLayout=function(t,e,i,n,o,r){t.createArrays();var a=512*t.overscaling;t.tilePixelRatio=Da/a,t.compareText={},t.iconsNeedLinear=!1;var s,l,u,c,h,p,d,f,m,_,g,y=t.layers[0].layout,v=t.layers[0]._unevaluatedLayout._values,x={};if("composite"===t.textSizeData.kind){var b=t.textSizeData,w=b.minZoom,L=b.maxZoom;x.compositeTextSizes=[v["text-size"].possiblyEvaluate(new Nn(w)),v["text-size"].possiblyEvaluate(new Nn(L))]}if("composite"===t.iconSizeData.kind){var k=t.iconSizeData,T=k.minZoom,E=k.maxZoom;x.compositeIconSizes=[v["icon-size"].possiblyEvaluate(new Nn(T)),v["icon-size"].possiblyEvaluate(new Nn(E))]}x.layoutTextSize=v["text-size"].possiblyEvaluate(new Nn(t.zoom+1)),x.layoutIconSize=v["icon-size"].possiblyEvaluate(new Nn(t.zoom+1)),x.textMaxSize=v["text-size"].possiblyEvaluate(new Nn(18));for(var M=y.get("text-line-height")*Ac,C="map"===y.get("text-rotation-alignment")&&"point"!==y.get("symbol-placement"),S=y.get("text-keep-upright"),P=0,z=t.features;P<z.length;P+=1){var I=z[P],A=y.get("text-font").evaluate(I,{}).join(","),D=i,O={horizontal:{},vertical:void 0},R=I.text,B=[0,0];if(R){var F=R.toString(),U=y.get("text-letter-spacing").evaluate(I,{})*Ac,N=Bn(F)?U:0,j=y.get("text-anchor").evaluate(I,{}),$=y.get("text-variable-anchor"),V=y.get("text-radial-offset").evaluate(I,{});$||(B=V?ah(j,V*Ac):y.get("text-offset").evaluate(I,{}).map(function(t){return t*Ac}));var Z=C?"center":y.get("text-justify").evaluate(I,{}),G="point"===y.get("symbol-placement")?y.get("text-max-width").evaluate(I,{})*Ac:0;if(!C&&$)for(var q="auto"===Z?$.map(function(t){return sh(t)}):[Z],H=!1,W=0;W<q.length;W++){var X=q[W];if(!O.horizontal[X])if(H)O.horizontal[X]=O.horizontal[0];else{var K=Rc(R,e,A,G,M,"center",X,N,B,Dc.horizontal);K&&(H=1===(O.horizontal[X]=K).lineCount)}}else{"auto"===Z&&(Z=sh(j));var J=Rc(R,e,A,G,M,j,Z,N,B,Dc.horizontal);J&&(O.horizontal[Z]=J),Rn(F)&&C&&S&&(O.vertical=Rc(R,e,A,G,M,j,Z,N,B,Dc.vertical))}}var Y=void 0;if(I.icon){var Q=n[I.icon];Q&&(s=o[I.icon],l=y.get("icon-offset").evaluate(I,{}),u=y.get("icon-anchor").evaluate(I,{}),void 0,c=$c(u),h=c.horizontalAlign,p=c.verticalAlign,d=l[0],f=l[1],m=d-s.displaySize[0]*h,_=m+s.displaySize[0],g=f-s.displaySize[1]*p,Y={image:s,top:g,bottom:g+s.displaySize[1],left:m,right:_},void 0===t.sdfIcons?t.sdfIcons=Q.sdf:t.sdfIcons!==Q.sdf&<("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),Q.pixelRatio!==t.pixelRatio?t.iconsNeedLinear=!0:0!==y.get("icon-rotate").constantOr(1)&&(t.iconsNeedLinear=!0))}(Object.keys(O.horizontal).length||Y)&&lh(t,I,O,Y,D,x,B)}r&&t.generateCollisionDebugBuffers()},t.perspective=function(t,e,i,n,o){var r,a=1/Math.tan(e/2);return t[0]=a/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=o&&o!==1/0?(r=1/(n-o),t[10]=(o+n)*r,t[14]=2*o*n*r):(t[10]=-1,t[14]=-2*n),t},t.pick=function(t,e){for(var i={},n=0;n<e.length;n++){var o=e[n];o in t&&(i[o]=t[o])}return i},t.plugin=qn,t.polygonIntersectsPolygon=Ua,t.postMapLoadEvent=dt,t.postTurnstileEvent=ht,t.potpack=Pu,t.rasterBoundsAttributes=Tc,t.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],t.register=Pn,t.registerForPluginAvailability=function(t){return Vn?t({pluginURL:Vn,completionCallback:jn}):Gn.once("pluginAvailable",t),t},t.rotate=function(t,e,i){var n=e[0],o=e[1],r=e[2],a=e[3],s=Math.sin(i),l=Math.cos(i);return t[0]=n*l+r*s,t[1]=o*l+a*s,t[2]=n*-s+r*l,t[3]=o*-s+a*l,t},t.rotateX=function(t,e,i){var n=Math.sin(i),o=Math.cos(i),r=e[4],a=e[5],s=e[6],l=e[7],u=e[8],c=e[9],h=e[10],p=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=r*o+u*n,t[5]=a*o+c*n,t[6]=s*o+h*n,t[7]=l*o+p*n,t[8]=u*o-r*n,t[9]=c*o-a*n,t[10]=h*o-s*n,t[11]=p*o-l*n,t},t.rotateZ=function(t,e,i){var n=Math.sin(i),o=Math.cos(i),r=e[0],a=e[1],s=e[2],l=e[3],u=e[4],c=e[5],h=e[6],p=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=r*o+u*n,t[1]=a*o+c*n,t[2]=s*o+h*n,t[3]=l*o+p*n,t[4]=u*o-r*n,t[5]=c*o-a*n,t[6]=h*o-s*n,t[7]=p*o-l*n,t},t.scale=function(t,e,i){var n=i[0],o=i[1],r=i[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*o,t[5]=e[5]*o,t[6]=e[6]*o,t[7]=e[7]*o,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.setCacheLimits=function(t,e){mt=t,_t=e},t.setRTLTextPlugin=function(t,e){if($n)throw new Error("setRTLTextPlugin cannot be called multiple times.");$n=!0,Vn=z.resolveURL(t),jn=function(t){t?($n=!1,Vn=null,e&&e(t)):Zn=!0},Gn.fire(new Bt("pluginAvailable",{pluginURL:Vn,completionCallback:jn}))},t.sphericalToCartesian=function(t){var e=t[0],i=t[1],n=t[2];return i+=90,i*=Math.PI/180,n*=Math.PI/180,{x:e*Math.cos(i)*Math.sin(n),y:e*Math.sin(i)*Math.sin(n),z:e*Math.cos(n)}},t.styleSpec=$t,t.symbolSize=ru,t.transformMat3=function(t,e,i){var n=e[0],o=e[1],r=e[2];return t[0]=n*i[0]+o*i[3]+r*i[6],t[1]=n*i[1]+o*i[4]+r*i[7],t[2]=n*i[2]+o*i[5]+r*i[8],t},t.transformMat4=ns,t.translate=function(t,e,i){var n,o,r,a,s,l,u,c,h,p,d,f,m=i[0],_=i[1],g=i[2];return e===t?(t[12]=e[0]*m+e[4]*_+e[8]*g+e[12],t[13]=e[1]*m+e[5]*_+e[9]*g+e[13],t[14]=e[2]*m+e[6]*_+e[10]*g+e[14],t[15]=e[3]*m+e[7]*_+e[11]*g+e[15]):(n=e[0],o=e[1],r=e[2],a=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],p=e[9],d=e[10],f=e[11],t[0]=n,t[1]=o,t[2]=r,t[3]=a,t[4]=s,t[5]=l,t[6]=u,t[7]=c,t[8]=h,t[9]=p,t[10]=d,t[11]=f,t[12]=n*m+s*_+h*g+e[12],t[13]=o*m+l*_+p*g+e[13],t[14]=r*m+u*_+d*g+e[14],t[15]=a*m+c*_+f*g+e[15]),t},t.uniqueId=c,t.validateCustomStyleLayer=function(t){var e=[],i=t.id;return void 0===i&&e.push({message:"layers."+i+': missing required property "id"'}),void 0===t.render&&e.push({message:"layers."+i+': missing required method "render"'}),t.renderingMode&&"2d"!==t.renderingMode&&"3d"!==t.renderingMode&&e.push({message:"layers."+i+': property "renderingMode" must be either "2d" or "3d"'}),e},t.validateLight=bn,t.validateStyle=xn,t.values=function(t){var e=[];for(var i in t)e.push(t[i]);return e},t.vectorTile=yl,t.version="1.1.0",t.warnOnce=lt,t.webpSupported=A,t.window=self,t.wrap=s}),t(0,function(C){function l(t){var e=typeof t;if("number"==e||"boolean"==e||"string"==e||null==t)return JSON.stringify(t);if(Array.isArray(t)){for(var i="[",n=0,o=t;n<o.length;n+=1)i+=l(o[n])+",";return i+"]"}for(var r=Object.keys(t).sort(),a="{",s=0;s<r.length;s++)a+=JSON.stringify(r[s])+":"+l(t[r[s]])+",";return a+"}"}function y(t){for(var e="",i=0,n=C.refProperties;i<n.length;i+=1)e+="/"+l(t[n[i]]);return e}function i(t){this.keyCache={},t&&this.replace(t)}i.prototype.replace=function(t){this._layerConfigs={},this._layers={},this.update(t,[])},i.prototype.update=function(t,e){for(var i=this,n=0,o=t;n<o.length;n+=1){var r=o[n];this._layerConfigs[r.id]=r;var a=this._layers[r.id]=C.createStyleLayer(r);a._featureFilter=C.featureFilter(a.filter),this.keyCache[r.id]&&delete this.keyCache[r.id]}for(var s=0,l=e;s<l.length;s+=1){var u=l[s];delete this.keyCache[u],delete this._layerConfigs[u],delete this._layers[u]}this.familiesBySource={};for(var c=0,h=function(t,e){for(var i={},n=0;n<t.length;n++){var o=e&&e[t[n].id]||y(t[n]);e&&(e[t[n].id]=o);var r=i[o];r||(r=i[o]=[]),r.push(t[n])}var a=[];for(var s in i)a.push(i[s]);return a}(C.values(this._layerConfigs),this.keyCache);c<h.length;c+=1){var p=h[c].map(function(t){return i._layers[t.id]}),d=p[0];if("none"!==d.visibility){var f=d.source||"",m=this.familiesBySource[f];m||(m=this.familiesBySource[f]={});var _=d.sourceLayer||"_geojsonTileLayer",g=m[_];g||(g=m[_]=[]),g.push(p)}}};function S(t){var e={},i=[];for(var n in t){var o=t[n],r=e[n]={};for(var a in o){var s=o[+a];if(s&&0!==s.bitmap.width&&0!==s.bitmap.height){var l={x:0,y:0,w:s.bitmap.width+2,h:s.bitmap.height+2};i.push(l),r[a]={rect:l,metrics:s.metrics}}}}var u=C.potpack(i),c=u.w,h=u.h,p=new C.AlphaImage({width:c||1,height:h||1});for(var d in t){var f=t[d];for(var m in f){var _=f[+m];if(_&&0!==_.bitmap.width&&0!==_.bitmap.height){var g=e[d][m].rect;C.AlphaImage.copy(_.bitmap,p,{x:0,y:0},{x:g.x+1,y:g.y+1},_.bitmap)}}}this.image=p,this.positions=e}C.register("GlyphAtlas",S);function e(t){this.tileID=new C.OverscaledTileID(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.uid=t.uid,this.zoom=t.zoom,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=t.showCollisionBoxes,this.collectResourceTiming=!!t.collectResourceTiming,this.returnDependencies=!!t.returnDependencies}function P(t,e){for(var i=new C.EvaluationParameters(e),n=0,o=t;n<o.length;n+=1)o[n].recalculate(i)}e.prototype.parse=function(t,e,i,o){var n=this;this.status="parsing",this.data=t,this.collisionBoxArray=new C.CollisionBoxArray;var r=new C.DictionaryCoder(Object.keys(t.layers).sort()),a=new C.FeatureIndex(this.tileID);a.bucketLayerIDs=[];var s,l,u,c,h={},p={featureIndex:a,iconDependencies:{},patternDependencies:{},glyphDependencies:{}},d=e.familiesBySource[this.source];for(var f in d){var m=t.layers[f];if(m){1===m.version&&C.warnOnce('Vector tile source "'+this.source+'" layer "'+f+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var _=r.encode(f),g=[],y=0;y<m.length;y++){var v=m.feature(y);g.push({feature:v,index:y,sourceLayerIndex:_})}for(var x=0,b=d[f];x<b.length;x+=1){var w=b[x],L=w[0];L.minzoom&&this.zoom<Math.floor(L.minzoom)||L.maxzoom&&this.zoom>=L.maxzoom||"none"!==L.visibility&&(P(w,this.zoom),(h[L.id]=L.createBucket({index:a.bucketLayerIDs.length,layers:w,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:_,sourceID:this.source})).populate(g,p),a.bucketLayerIDs.push(w.map(function(t){return t.id})))}}}var k=C.mapObject(p.glyphDependencies,function(t){return Object.keys(t).map(Number)});Object.keys(k).length?i.send("getGlyphs",{uid:this.uid,stacks:k},function(t,e){s||(s=t,l=e,M.call(n))}):l={};var T=Object.keys(p.iconDependencies);T.length?i.send("getImages",{icons:T},function(t,e){s||(s=t,u=e,M.call(n))}):u={};var E=Object.keys(p.patternDependencies);function M(){if(s)return o(s);if(l&&u&&c){var t=new S(l),e=new C.ImageAtlas(u,c);for(var i in h){var n=h[i];n instanceof C.SymbolBucket?(P(n.layers,this.zoom),C.performSymbolLayout(n,l,t.positions,u,e.iconPositions,this.showCollisionBoxes)):n.hasPattern&&(n instanceof C.LineBucket||n instanceof C.FillBucket||n instanceof C.FillExtrusionBucket)&&(P(n.layers,this.zoom),n.addFeatures(p,e.patternPositions))}this.status="done",o(null,{buckets:C.values(h).filter(function(t){return!t.isEmpty()}),featureIndex:a,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:t.image,imageAtlas:e,glyphMap:this.returnDependencies?l:null,iconMap:this.returnDependencies?u:null,glyphPositions:this.returnDependencies?t.positions:null})}}E.length?i.send("getImages",{icons:E},function(t,e){s||(s=t,c=e,M.call(n))}):c={},M.call(this)};function t(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},h.mark(this._marks.start)}var n="undefined"!=typeof performance,h={getEntriesByName:function(t){return!!(n&&performance&&performance.getEntriesByName)&&performance.getEntriesByName(t)},mark:function(t){return!!(n&&performance&&performance.mark)&&performance.mark(t)},measure:function(t,e,i){return!!(n&&performance&&performance.measure)&&performance.measure(t,e,i)},clearMarks:function(t){return!!(n&&performance&&performance.clearMarks)&&performance.clearMarks(t)},clearMeasures:function(t){return!!(n&&performance&&performance.clearMeasures)&&performance.clearMeasures(t)}};function o(t,o){var e=C.getArrayBuffer(t.request,function(t,e,i,n){t?o(t):e&&o(null,{vectorTile:new C.vectorTile.VectorTile(new C.pbf(e)),rawData:e,cacheControl:i,expires:n})});return function(){e.cancel(),o()}}t.prototype.finish=function(){h.mark(this._marks.end);var t=h.getEntriesByName(this._marks.measure);return 0===t.length&&(h.measure(this._marks.measure,this._marks.start,this._marks.end),t=h.getEntriesByName(this._marks.measure),h.clearMarks(this._marks.start),h.clearMarks(this._marks.end),h.clearMeasures(this._marks.measure)),t},h.Performance=t;function r(t,e,i){this.actor=t,this.layerIndex=e,this.loadVectorData=i||o,this.loading={},this.loaded={}}r.prototype.loadTile=function(t,a){var s=this,l=t.uid;this.loading||(this.loading={});var u=!!(t&&t.request&&t.request.collectResourceTiming)&&new h.Performance(t.request),c=this.loading[l]=new e(t);c.abort=this.loadVectorData(t,function(t,e){if(delete s.loading[l],t||!e)return c.status="done",s.loaded[l]=c,a(t);var i=e.rawData,n={};e.expires&&(n.expires=e.expires),e.cacheControl&&(n.cacheControl=e.cacheControl);var o={};if(u){var r=u.finish();r&&(o.resourceTiming=JSON.parse(JSON.stringify(r)))}c.vectorTile=e.vectorTile,c.parse(e.vectorTile,s.layerIndex,s.actor,function(t,e){if(t||!e)return a(t);a(null,C.extend({rawTileData:i.slice(0)},e,n,o))}),s.loaded=s.loaded||{},s.loaded[l]=c})},r.prototype.reloadTile=function(t,n){var e=this.loaded,i=t.uid,o=this;if(e&&e[i]){var r=e[i];r.showCollisionBoxes=t.showCollisionBoxes;var a=function(t,e){var i=r.reloadCallback;i&&(delete r.reloadCallback,r.parse(r.vectorTile,o.layerIndex,o.actor,i)),n(t,e)};"parsing"===r.status?r.reloadCallback=a:"done"===r.status&&(r.vectorTile?r.parse(r.vectorTile,this.layerIndex,this.actor,a):a())}},r.prototype.abortTile=function(t,e){var i=this.loading,n=t.uid;i&&i[n]&&i[n].abort&&(i[n].abort(),delete i[n]),e()},r.prototype.removeTile=function(t,e){var i=this.loaded,n=t.uid;i&&i[n]&&delete i[n],e()};function a(){this.loaded={}}a.prototype.loadTile=function(t,e){var i=t.uid,n=t.encoding,o=t.rawImageData,r=new C.DEMData(i,o,n);this.loaded=this.loaded||{},e(null,this.loaded[i]=r)},a.prototype.removeTile=function(t){var e=this.loaded,i=t.uid;e&&e[i]&&delete e[i]};var u={RADIUS:6378137,FLATTENING:1/298.257223563,POLAR_RADIUS:6356752.3142};function s(t){var e=0;if(t&&0<t.length){e+=Math.abs(c(t[0]));for(var i=1;i<t.length;i++)e-=Math.abs(c(t[i]))}return e}function c(t){var e,i,n,o,r,a,s=0,l=t.length;if(2<l){for(a=0;a<l;a++)r=a===l-2?(n=l-2,o=l-1,0):a===l-1?(n=l-1,o=0,1):(o=(n=a)+1,a+2),e=t[n],i=t[o],s+=(p(t[r][0])-p(e[0]))*Math.sin(p(i[1]));s=s*u.RADIUS*u.RADIUS/2}return s}function p(t){return t*Math.PI/180}var d={geometry:function t(e){var i,n=0;switch(e.type){case"Polygon":return s(e.coordinates);case"MultiPolygon":for(i=0;i<e.coordinates.length;i++)n+=s(e.coordinates[i]);return n;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(i=0;i<e.geometries.length;i++)n+=t(e.geometries[i]);return n}},ring:c};function f(e,i){return function(t){return e(t,i)}}function m(t,e){e=!!e,t[0]=_(t[0],e);for(var i=1;i<t.length;i++)t[i]=_(t[i],!e);return t}function _(t,e){return i=t,0<=d.ring(i)===e?t:t.reverse();var i}function g(t){this._feature=t,this.extent=C.EXTENT,this.type=t.type,this.properties=t.tags,"id"in t&&!isNaN(t.id)&&(this.id=parseInt(t.id,10))}var v=C.vectorTile.VectorTileFeature.prototype.toGeoJSON;g.prototype.loadGeometry=function(){if(1===this._feature.type){for(var t=[],e=0,i=this._feature.geometry;e<i.length;e+=1){var n=i[e];t.push([new C.Point$1(n[0],n[1])])}return t}for(var o=[],r=0,a=this._feature.geometry;r<a.length;r+=1){for(var s=[],l=0,u=a[r];l<u.length;l+=1){var c=u[l];s.push(new C.Point$1(c[0],c[1]))}o.push(s)}return o},g.prototype.toGeoJSON=function(t,e,i){return v.call(this,t,e,i)};var x=function(t){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=C.EXTENT,this.length=t.length,this._features=t};x.prototype.feature=function(t){return new g(this._features[t])};var b=C.vectorTile.VectorTileFeature,w=L;function L(t,e){this.options=e||{},this.features=t,this.length=t.length}function k(t,e){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=e||4096}L.prototype.feature=function(t){return new k(this.features[t],this.options.extent)},k.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var e=0;e<t.length;e++){for(var i=t[e],n=[],o=0;o<i.length;o++)n.push(new C.Point$1(i[o][0],i[o][1]));this.geometry.push(n)}return this.geometry},k.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,i=-1/0,n=1/0,o=-1/0,r=0;r<t.length;r++)for(var a=t[r],s=0;s<a.length;s++){var l=a[s];e=Math.min(e,l.x),i=Math.max(i,l.x),n=Math.min(n,l.y),o=Math.max(o,l.y)}return[e,n,i,o]},k.prototype.toGeoJSON=b.prototype.toGeoJSON;var T=z,E=z,M=w;function z(t){var e=new C.pbf;return function(t,e){for(var i in t.layers)e.writeMessage(3,I,t.layers[i])}(t,e),e.finish()}function I(t,e){var i;e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);var n={keys:[],values:[],keycache:{},valuecache:{}};for(i=0;i<t.length;i++)n.feature=t.feature(i),e.writeMessage(2,A,n);var o=n.keys;for(i=0;i<o.length;i++)e.writeStringField(3,o[i]);var r=n.values;for(i=0;i<r.length;i++)e.writeMessage(4,F,r[i])}function A(t,e){var i=t.feature;void 0!==i.id&&e.writeVarintField(1,i.id),e.writeMessage(2,D,t),e.writeVarintField(3,i.type),e.writeMessage(4,B,i)}function D(t,e){var i=t.feature,n=t.keys,o=t.values,r=t.keycache,a=t.valuecache;for(var s in i.properties){var l=r[s];void 0===l&&(n.push(s),l=n.length-1,r[s]=l),e.writeVarint(l);var u=i.properties[s],c=typeof u;"string"!=c&&"boolean"!=c&&"number"!=c&&(u=JSON.stringify(u));var h=c+":"+u,p=a[h];void 0===p&&(o.push(u),p=o.length-1,a[h]=p),e.writeVarint(p)}}function O(t,e){return(e<<3)+(7&t)}function R(t){return t<<1^t>>31}function B(t,e){for(var i=t.loadGeometry(),n=t.type,o=0,r=0,a=i.length,s=0;s<a;s++){var l=i[s],u=1;1===n&&(u=l.length),e.writeVarint(O(1,u));for(var c=3===n?l.length-1:l.length,h=0;h<c;h++){1===h&&1!==n&&e.writeVarint(O(2,c-1));var p=l[h].x-o,d=l[h].y-r;e.writeVarint(R(p)),e.writeVarint(R(d)),o+=p,r+=d}3===n&&e.writeVarint(O(7,1))}}function F(t,e){var i=typeof t;"string"==i?e.writeStringField(1,t):"boolean"==i?e.writeBooleanField(7,t):"number"==i&&(t%1!=0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}function U(t,e,i,n){N(t,i,n),N(e,2*i,2*n),N(e,2*i+1,2*n+1)}function N(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function j(t,e,i,n){var o=t-i,r=e-n;return o*o+r*r}T.fromVectorTileJs=E,T.fromGeojsonVt=function(t,e){e=e||{};var i={};for(var n in t)i[n]=new w(t[n].features,e),i[n].name=n,i[n].version=e.version,i[n].extent=e.extent;return z({layers:i})},T.GeoJSONWrapper=M;function $(t){return t[0]}function V(t){return t[1]}function Z(t,e,i,n,o){void 0===e&&(e=$),void 0===i&&(i=V),void 0===n&&(n=64),void 0===o&&(o=Float64Array),this.nodeSize=n;for(var r=(this.points=t).length<65536?Uint16Array:Uint32Array,a=this.ids=new r(t.length),s=this.coords=new o(2*t.length),l=0;l<t.length;l++)s[2*(a[l]=l)]=e(t[l]),s[2*l+1]=i(t[l]);!function t(e,i,n,o,r,a){if(!(r-o<=n)){var s=o+r>>1;!function t(e,i,n,o,r,a){for(;o<r;){if(600<r-o){var s=r-o+1,l=n-o+1,u=Math.log(s),c=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*c*(s-c)/s)*(l-s/2<0?-1:1);t(e,i,n,Math.max(o,Math.floor(n-l*c/s+h)),Math.min(r,Math.floor(n+(s-l)*c/s+h)),a)}var p=i[2*n+a],d=o,f=r;for(U(e,i,o,n),i[2*r+a]>p&&U(e,i,o,r);d<f;){for(U(e,i,d,f),d++,f--;i[2*d+a]<p;)d++;for(;i[2*f+a]>p;)f--}i[2*o+a]===p?U(e,i,o,f):U(e,i,++f,r),f<=n&&(o=f+1),n<=f&&(r=f-1)}}(e,i,s,o,r,a%2),t(e,i,n,o,s-1,a+1),t(e,i,n,1+s,r,a+1)}}(a,s,n,0,a.length-1,0)}Z.prototype.range=function(t,e,i,n){return function(t,e,i,n,o,r,a){for(var s,l,u=[0,t.length-1,0],c=[];u.length;){var h=u.pop(),p=u.pop(),d=u.pop();if(p-d<=a)for(var f=d;f<=p;f++)s=e[2*f],l=e[2*f+1],i<=s&&s<=o&&n<=l&&l<=r&&c.push(t[f]);else{var m=Math.floor((d+p)/2);s=e[2*m],l=e[2*m+1],i<=s&&s<=o&&n<=l&&l<=r&&c.push(t[m]);var _=(h+1)%2;(0===h?i<=s:n<=l)&&(u.push(d),u.push(m-1),u.push(_)),(0===h?s<=o:l<=r)&&(u.push(m+1),u.push(p),u.push(_))}}return c}(this.ids,this.coords,t,e,i,n,this.nodeSize)};function G(t){this.options=J(Object.create(q),t),this.trees=new Array(this.options.maxZoom+1)}var q={minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!(Z.prototype.within=function(t,e,i){return function(t,e,i,n,o,r){for(var a=[0,t.length-1,0],s=[],l=o*o;a.length;){var u=a.pop(),c=a.pop(),h=a.pop();if(c-h<=r)for(var p=h;p<=c;p++)j(e[2*p],e[2*p+1],i,n)<=l&&s.push(t[p]);else{var d=Math.floor((h+c)/2),f=e[2*d],m=e[2*d+1];j(f,m,i,n)<=l&&s.push(t[d]);var _=(u+1)%2;(0===u?i-o<=f:n-o<=m)&&(a.push(h),a.push(d-1),a.push(_)),(0===u?f<=i+o:m<=n+o)&&(a.push(d+1),a.push(c),a.push(_))}}return s}(this.ids,this.coords,t,e,i,this.nodeSize)}),reduce:null,map:function(t){return t}};function H(t){return{type:"Feature",id:t.id,properties:W(t),geometry:{type:"Point",coordinates:[(n=t.x,360*(n-.5)),(e=t.y,i=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(i))/Math.PI-90)]}};var e,i,n}function W(t){var e=t.numPoints,i=1e4<=e?Math.round(e/1e3)+"k":1e3<=e?Math.round(e/100)/10+"k":e;return J(J({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:i})}function X(t){return t/360+.5}function K(t){var e=Math.sin(t*Math.PI/180),i=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return i<0?0:1<i?1:i}function J(t,e){for(var i in e)t[i]=e[i];return t}function Y(t){return t.x}function Q(t){return t.y}function tt(t,e,i,n,o,r){var a=o-i,s=r-n;if(0!==a||0!==s){var l=((t-i)*a+(e-n)*s)/(a*a+s*s);1<l?(i=o,n=r):0<l&&(i+=a*l,n+=s*l)}return(a=t-i)*a+(s=e-n)*s}function et(t,e,i,n){var o={id:void 0===t?null:t,type:e,geometry:i,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,i=t.type;if("Point"===i||"MultiPoint"===i||"LineString"===i)it(t,e);else if("Polygon"===i||"MultiLineString"===i)for(var n=0;n<e.length;n++)it(t,e[n]);else if("MultiPolygon"===i)for(n=0;n<e.length;n++)for(var o=0;o<e[n].length;o++)it(t,e[n][o])}(o),o}function it(t,e){for(var i=0;i<e.length;i+=3)t.minX=Math.min(t.minX,e[i]),t.minY=Math.min(t.minY,e[i+1]),t.maxX=Math.max(t.maxX,e[i]),t.maxY=Math.max(t.maxY,e[i+1])}function nt(t,e,i,n){if(e.geometry){var o=e.geometry.coordinates,r=e.geometry.type,a=Math.pow(i.tolerance/((1<<i.maxZoom)*i.extent),2),s=[],l=e.id;if(i.promoteId?l=e.properties[i.promoteId]:i.generateId&&(l=n||0),"Point"===r)ot(o,s);else if("MultiPoint"===r)for(var u=0;u<o.length;u++)ot(o[u],s);else if("LineString"===r)rt(o,s,a,!1);else if("MultiLineString"===r){if(i.lineMetrics){for(u=0;u<o.length;u++)s=[],rt(o[u],s,a,!1),t.push(et(l,"LineString",s,e.properties));return}at(o,s,a,!1)}else if("Polygon"===r)at(o,s,a,!0);else{if("MultiPolygon"!==r){if("GeometryCollection"!==r)throw new Error("Input data is not a valid GeoJSON object.");for(u=0;u<e.geometry.geometries.length;u++)nt(t,{id:l,geometry:e.geometry.geometries[u],properties:e.properties},i,n);return}for(u=0;u<o.length;u++){var c=[];at(o[u],c,a,!0),s.push(c)}}t.push(et(l,r,s,e.properties))}}function ot(t,e){e.push(st(t[0])),e.push(lt(t[1])),e.push(0)}function rt(t,e,i,n){for(var o,r,a=0,s=0;s<t.length;s++){var l=st(t[s][0]),u=lt(t[s][1]);e.push(l),e.push(u),e.push(0),0<s&&(a+=n?(o*u-l*r)/2:Math.sqrt(Math.pow(l-o,2)+Math.pow(u-r,2))),o=l,r=u}var c=e.length-3;e[2]=1,function t(e,i,n,o){for(var r,a=o,s=n-i>>1,l=n-i,u=e[i],c=e[i+1],h=e[n],p=e[n+1],d=i+3;d<n;d+=3){var f=tt(e[d],e[d+1],u,c,h,p);if(a<f)r=d,a=f;else if(f===a){var m=Math.abs(d-s);m<l&&(r=d,l=m)}}o<a&&(3<r-i&&t(e,i,r,o),e[r+2]=a,3<n-r&&t(e,r,n,o))}(e,0,c,i),e[2+c]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function at(t,e,i,n){for(var o=0;o<t.length;o++){var r=[];rt(t[o],r,i,n),e.push(r)}}function st(t){return t/360+.5}function lt(t){var e=Math.sin(t*Math.PI/180),i=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return i<0?0:1<i?1:i}function ut(t,e,i,n,o,r,a,s){if(n/=e,r>=(i/=e)&&a<n)return t;if(a<i||n<=r)return null;for(var l=[],u=0;u<t.length;u++){var c=t[u],h=c.geometry,p=c.type,d=0===o?c.minX:c.minY,f=0===o?c.maxX:c.maxY;if(i<=d&&f<n)l.push(c);else if(!(f<i||n<=d)){var m=[];if("Point"===p||"MultiPoint"===p)ct(h,m,i,n,o);else if("LineString"===p)ht(h,m,i,n,o,!1,s.lineMetrics);else if("MultiLineString"===p)dt(h,m,i,n,o,!1);else if("Polygon"===p)dt(h,m,i,n,o,!0);else if("MultiPolygon"===p)for(var _=0;_<h.length;_++){var g=[];dt(h[_],g,i,n,o,!0),g.length&&m.push(g)}if(m.length){if(s.lineMetrics&&"LineString"===p){for(_=0;_<m.length;_++)l.push(et(c.id,p,m[_],c.tags));continue}"LineString"!==p&&"MultiLineString"!==p||(1===m.length?(p="LineString",m=m[0]):p="MultiLineString"),"Point"!==p&&"MultiPoint"!==p||(p=3===m.length?"Point":"MultiPoint"),l.push(et(c.id,p,m,c.tags))}}}return l.length?l:null}function ct(t,e,i,n,o){for(var r=0;r<t.length;r+=3){var a=t[r+o];i<=a&&a<=n&&(e.push(t[r]),e.push(t[r+1]),e.push(t[r+2]))}}function ht(t,e,i,n,o,r,a){for(var s,l,u=pt(t),c=0===o?mt:_t,h=t.start,p=0;p<t.length-3;p+=3){var d=t[p],f=t[p+1],m=t[p+2],_=t[p+3],g=t[p+4],y=0===o?d:f,v=0===o?_:g,x=!1;a&&(s=Math.sqrt(Math.pow(d-_,2)+Math.pow(f-g,2))),y<i?i<v&&(l=c(u,d,f,_,g,i),a&&(u.start=h+s*l)):n<y?v<n&&(l=c(u,d,f,_,g,n),a&&(u.start=h+s*l)):ft(u,d,f,m),v<i&&i<=y&&(l=c(u,d,f,_,g,i),x=!0),n<v&&y<=n&&(l=c(u,d,f,_,g,n),x=!0),!r&&x&&(a&&(u.end=h+s*l),e.push(u),u=pt(t)),a&&(h+=s)}var b=t.length-3;d=t[b],f=t[b+1],m=t[b+2],(y=0===o?d:f)>=i&&y<=n&&ft(u,d,f,m),b=u.length-3,r&&3<=b&&(u[b]!==u[0]||u[b+1]!==u[1])&&ft(u,u[0],u[1],u[2]),u.length&&e.push(u)}function pt(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function dt(t,e,i,n,o,r){for(var a=0;a<t.length;a++)ht(t[a],e,i,n,o,r,!1)}function ft(t,e,i,n){t.push(e),t.push(i),t.push(n)}function mt(t,e,i,n,o,r){var a=(r-e)/(n-e);return t.push(r),t.push(i+(o-i)*a),t.push(1),a}function _t(t,e,i,n,o,r){var a=(r-i)/(o-i);return t.push(e+(n-e)*a),t.push(r),t.push(1),a}function gt(t,e){for(var i=[],n=0;n<t.length;n++){var o,r=t[n],a=r.type;if("Point"===a||"MultiPoint"===a||"LineString"===a)o=yt(r.geometry,e);else if("MultiLineString"===a||"Polygon"===a){o=[];for(var s=0;s<r.geometry.length;s++)o.push(yt(r.geometry[s],e))}else if("MultiPolygon"===a)for(o=[],s=0;s<r.geometry.length;s++){for(var l=[],u=0;u<r.geometry[s].length;u++)l.push(yt(r.geometry[s][u],e));o.push(l)}i.push(et(r.id,a,o,r.tags))}return i}function yt(t,e){var i=[];i.size=t.size,void 0!==t.start&&(i.start=t.start,i.end=t.end);for(var n=0;n<t.length;n+=3)i.push(t[n]+e,t[n+1],t[n+2]);return i}function vt(t,e){if(t.transformed)return t;var i,n,o,r=1<<t.z,a=t.x,s=t.y;for(i=0;i<t.features.length;i++){var l=t.features[i],u=l.geometry,c=l.type;if(l.geometry=[],1===c)for(n=0;n<u.length;n+=2)l.geometry.push(xt(u[n],u[n+1],e,r,a,s));else for(n=0;n<u.length;n++){var h=[];for(o=0;o<u[n].length;o+=2)h.push(xt(u[n][o],u[n][o+1],e,r,a,s));l.geometry.push(h)}}return t.transformed=!0,t}function xt(t,e,i,n,o,r){return[Math.round(i*(t*n-o)),Math.round(i*(e*n-r))]}function bt(t,e,i,n,o){for(var r=e===o.maxZoom?0:o.tolerance/((1<<e)*o.extent),a={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:i,y:n,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},s=0;s<t.length;s++){a.numFeatures++,wt(a,t[s],r,o);var l=t[s].minX,u=t[s].minY,c=t[s].maxX,h=t[s].maxY;l<a.minX&&(a.minX=l),u<a.minY&&(a.minY=u),c>a.maxX&&(a.maxX=c),h>a.maxY&&(a.maxY=h)}return a}function wt(t,e,i,n){var o=e.geometry,r=e.type,a=[];if("Point"===r||"MultiPoint"===r)for(var s=0;s<o.length;s+=3)a.push(o[s]),a.push(o[s+1]),t.numPoints++,t.numSimplified++;else if("LineString"===r)Lt(a,o,t,i,!1,!1);else if("MultiLineString"===r||"Polygon"===r)for(s=0;s<o.length;s++)Lt(a,o[s],t,i,"Polygon"===r,0===s);else if("MultiPolygon"===r)for(var l=0;l<o.length;l++){var u=o[l];for(s=0;s<u.length;s++)Lt(a,u[s],t,i,!0,0===s)}if(a.length){var c=e.tags||null;if("LineString"===r&&n.lineMetrics){for(var h in c={},e.tags)c[h]=e.tags[h];c.mapbox_clip_start=o.start/o.size,c.mapbox_clip_end=o.end/o.size}var p={geometry:a,type:"Polygon"===r||"MultiPolygon"===r?3:"LineString"===r||"MultiLineString"===r?2:1,tags:c};null!==e.id&&(p.id=e.id),t.features.push(p)}}function Lt(t,e,i,n,o,r){var a=n*n;if(0<n&&e.size<(o?a:n))i.numPoints+=e.length/3;else{for(var s=[],l=0;l<e.length;l+=3)(0===n||e[l+2]>a)&&(i.numSimplified++,s.push(e[l]),s.push(e[l+1])),i.numPoints++;o&&function(t,e){for(var i=0,n=0,o=t.length,r=o-2;n<o;r=n,n+=2)i+=(t[n]-t[r])*(t[n+1]+t[r+1]);if(0<i===e)for(n=0,o=t.length;n<o/2;n+=2){var a=t[n],s=t[n+1];t[n]=t[o-2-n],t[n+1]=t[o-1-n],t[o-2-n]=a,t[o-1-n]=s}}(s,r),t.push(s)}}function kt(t,e){var i=(e=this.options=function(t,e){for(var i in e)t[i]=e[i];return t}(Object.create(this.options),e)).debug;if(i&&console.time("preprocess data"),e.maxZoom<0||24<e.maxZoom)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var n,o,r,a,s,l,u=function(t,e){var i=[];if("FeatureCollection"===t.type)for(var n=0;n<t.features.length;n++)nt(i,t.features[n],e,n);else"Feature"===t.type?nt(i,t,e):nt(i,{geometry:t},e);return i}(t,e);this.tiles={},this.tileCoords=[],i&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(n=u,r=(o=e).buffer/o.extent,s=ut(a=n,1,-1-r,r,0,-1,2,o),l=ut(n,1,1-r,2+r,0,-1,2,o),(s||l)&&(a=ut(n,1,-r,1+r,0,-1,2,o)||[],s&&(a=gt(s,1).concat(a)),l&&(a=a.concat(gt(l,-1)))),u=a).length&&this.splitTile(u,0,0,0),i&&(u.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function Tt(t,e,i){return 32*((1<<t)*i+e)+t}function Et(t,e){var i=t.tileID.canonical;if(!this._geoJSONIndex)return e(null,null);var n=this._geoJSONIndex.getTile(i.z,i.x,i.y);if(!n)return e(null,null);var o=new x(n.features),r=T(o);0===r.byteOffset&&r.byteLength===r.buffer.byteLength||(r=new Uint8Array(r)),e(null,{vectorTile:o,rawData:r.buffer})}G.prototype.load=function(t){var e=this.options,i=e.log,n=e.minZoom,o=e.maxZoom,r=e.nodeSize;i&&console.time("total time");var a,s,l,u,c,h="prepare "+t.length+" points";i&&console.time(h),this.points=t;for(var p=[],d=0;d<t.length;d++)t[d].geometry&&p.push((a=t[d],s=d,void 0,l=a.geometry.coordinates,u=l[0],c=l[1],{x:X(u),y:K(c),zoom:1/0,index:s,parentId:-1}));this.trees[o+1]=new Z(p,Y,Q,r,Float32Array),i&&console.timeEnd(h);for(var f=o;n<=f;f--){var m=+Date.now();p=this._cluster(p,f),this.trees[f]=new Z(p,Y,Q,r,Float32Array),i&&console.log("z%d: %d clusters in %dms",f,p.length,+Date.now()-m)}return i&&console.timeEnd("total time"),this},G.prototype.getClusters=function(t,e){var i=((t[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,t[1])),o=180===t[2]?180:((t[2]+180)%360+360)%360-180,r=Math.max(-90,Math.min(90,t[3]));if(360<=t[2]-t[0])i=-180,o=180;else if(o<i){var a=this.getClusters([i,n,180,r],e),s=this.getClusters([-180,n,o,r],e);return a.concat(s)}for(var l=this.trees[this._limitZoom(e)],u=[],c=0,h=l.range(X(i),K(r),X(o),K(n));c<h.length;c+=1){var p=h[c],d=l.points[p];u.push(d.numPoints?H(d):this.points[d.index])}return u},G.prototype.getChildren=function(t){var e=t>>5,i=t%32,n="No cluster with the specified id.",o=this.trees[i];if(!o)throw new Error(n);var r=o.points[e];if(!r)throw new Error(n);for(var a=this.options.radius/(this.options.extent*Math.pow(2,i-1)),s=[],l=0,u=o.within(r.x,r.y,a);l<u.length;l+=1){var c=u[l],h=o.points[c];h.parentId===t&&s.push(h.numPoints?H(h):this.points[h.index])}if(0===s.length)throw new Error(n);return s},G.prototype.getLeaves=function(t,e,i){e=e||10,i=i||0;var n=[];return this._appendLeaves(n,t,e,i,0),n},G.prototype.getTile=function(t,e,i){var n=this.trees[this._limitZoom(t)],o=Math.pow(2,t),r=this.options,a=r.extent,s=r.radius/a,l=(i-s)/o,u=(i+1+s)/o,c={features:[]};return this._addTileFeatures(n.range((e-s)/o,l,(e+1+s)/o,u),n.points,e,i,o,c),0===e&&this._addTileFeatures(n.range(1-s/o,l,1,u),n.points,o,i,o,c),e===o-1&&this._addTileFeatures(n.range(0,l,s/o,u),n.points,-1,i,o,c),c.features.length?c:null},G.prototype.getClusterExpansionZoom=function(t){for(var e=t%32-1;e<=this.options.maxZoom;){var i=this.getChildren(t);if(e++,1!==i.length)break;t=i[0].properties.cluster_id}return e},G.prototype._appendLeaves=function(t,e,i,n,o){for(var r=0,a=this.getChildren(e);r<a.length;r+=1){var s=a[r],l=s.properties;if(l&&l.cluster?o+l.point_count<=n?o+=l.point_count:o=this._appendLeaves(t,l.cluster_id,i,n,o):o<n?o++:t.push(s),t.length===i)break}return o},G.prototype._addTileFeatures=function(t,e,i,n,o,r){for(var a=0,s=t;a<s.length;a+=1){var l=e[s[a]],u={type:1,geometry:[[Math.round(this.options.extent*(l.x*o-i)),Math.round(this.options.extent*(l.y*o-n))]],tags:l.numPoints?W(l):this.points[l.index].properties},c=l.numPoints?l.id:this.points[l.index].id;void 0!==c&&(u.id=c),r.features.push(u)}},G.prototype._limitZoom=function(t){return Math.max(this.options.minZoom,Math.min(t,this.options.maxZoom+1))},G.prototype._cluster=function(t,e){for(var i=[],n=this.options,o=n.radius,r=n.extent,a=n.reduce,s=o/(r*Math.pow(2,e)),l=0;l<t.length;l++){var u=t[l];if(!(u.zoom<=e)){u.zoom=e;for(var c=this.trees[e+1],h=c.within(u.x,u.y,s),p=u.numPoints||1,d=u.x*p,f=u.y*p,m=a?this._map(u,!0):null,_=(l<<5)+(e+1),g=0,y=h;g<y.length;g+=1){var v=y[g],x=c.points[v];if(!(x.zoom<=e)){x.zoom=e;var b=x.numPoints||1;d+=x.x*b,f+=x.y*b,p+=b,x.parentId=_,a&&a(m,this._map(x))}}1===p?i.push(u):(u.parentId=_,i.push({x:d/p,y:f/p,zoom:1/0,id:_,parentId:-1,numPoints:p,properties:m}))}}return i},kt.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!(G.prototype._map=function(t,e){if(t.numPoints)return e?J({},t.properties):t.properties;var i=this.points[t.index].properties,n=this.options.map(i);return e&&n===i?J({},n):n}),promoteId:null,generateId:!1,debug:0},kt.prototype.splitTile=function(t,e,i,n,o,r,a){for(var s=[t,e,i,n],l=this.options,u=l.debug;s.length;){n=s.pop(),i=s.pop(),e=s.pop(),t=s.pop();var c=1<<e,h=Tt(e,i,n),p=this.tiles[h];if(!p&&(1<u&&console.time("creation"),p=this.tiles[h]=bt(t,e,i,n,l),this.tileCoords.push({z:e,x:i,y:n}),u)){1<u&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,i,n,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));var d="z"+e;this.stats[d]=(this.stats[d]||0)+1,this.total++}if(p.source=t,o){if(e===l.maxZoom||e===o)continue;var f=1<<o-e;if(i!==Math.floor(r/f)||n!==Math.floor(a/f))continue}else if(e===l.indexMaxZoom||p.numPoints<=l.indexMaxPoints)continue;if(p.source=null,0!==t.length){1<u&&console.time("clipping");var m,_,g,y,v,x,b=.5*l.buffer/l.extent,w=.5-b,L=.5+b,k=1+b;m=_=g=y=null,v=ut(t,c,i-b,i+L,0,p.minX,p.maxX,l),x=ut(t,c,i+w,i+k,0,p.minX,p.maxX,l),t=null,v&&(m=ut(v,c,n-b,n+L,1,p.minY,p.maxY,l),_=ut(v,c,n+w,n+k,1,p.minY,p.maxY,l),v=null),x&&(g=ut(x,c,n-b,n+L,1,p.minY,p.maxY,l),y=ut(x,c,n+w,n+k,1,p.minY,p.maxY,l),x=null),1<u&&console.timeEnd("clipping"),s.push(m||[],e+1,2*i,2*n),s.push(_||[],e+1,2*i,2*n+1),s.push(g||[],e+1,2*i+1,2*n),s.push(y||[],e+1,2*i+1,2*n+1)}}},kt.prototype.getTile=function(t,e,i){var n=this.options,o=n.extent,r=n.debug;if(t<0||24<t)return null;var a=1<<t,s=Tt(t,e=(e%a+a)%a,i);if(this.tiles[s])return vt(this.tiles[s],o);1<r&&console.log("drilling down to z%d-%d-%d",t,e,i);for(var l,u=t,c=e,h=i;!l&&0<u;)u--,c=Math.floor(c/2),h=Math.floor(h/2),l=this.tiles[Tt(u,c,h)];return l&&l.source?(1<r&&console.log("found parent tile z%d-%d-%d",u,c,h),1<r&&console.time("drilling down"),this.splitTile(l.source,u,c,h,t,e,i),1<r&&console.timeEnd("drilling down"),this.tiles[s]?vt(this.tiles[s],o):null):null};var Mt,Ct=((Mt=r)&&(St.__proto__=Mt),((St.prototype=Object.create(Mt&&Mt.prototype)).constructor=St).prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},St.prototype._loadData=function(){var o=this;if(this._pendingCallback&&this._pendingLoadDataParams){var r=this._pendingCallback,a=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var s=!!(a&&a.request&&a.request.collectResourceTiming)&&new h.Performance(a.request);this.loadGeoJSON(a,function(t,e){if(t||!e)return r(t);if("object"!=typeof e)return r(new Error("Input data given to '"+a.source+"' is not a valid GeoJSON object."));!function t(e,i){switch(e&&e.type||null){case"FeatureCollection":return e.features=e.features.map(f(t,i)),e;case"GeometryCollection":return e.geometries=e.geometries.map(f(t,i)),e;case"Feature":return e.geometry=t(e.geometry,i),e;case"Polygon":case"MultiPolygon":return o=i,"Polygon"===(n=e).type?n.coordinates=m(n.coordinates,o):"MultiPolygon"===n.type&&(n.coordinates=n.coordinates.map(f(m,o))),n;default:return e}var n,o}(e,!0);try{o._geoJSONIndex=a.cluster?new G(function(t){var e=t.superclusterOptions,i=t.clusterProperties;if(!i||!e)return e;for(var r={},a={},s={accumulated:null,zoom:0},l={properties:null},u=Object.keys(i),n=0,o=u;n<o.length;n+=1){var c=o[n],h=i[c],p=h[0],d=h[1],f=C.createExpression(d),m=C.createExpression("string"==typeof p?[p,["accumulated"],["get",c]]:p);r[c]=f.value,a[c]=m.value}return e.map=function(t){l.properties=t;for(var e={},i=0,n=u;i<n.length;i+=1){var o=n[i];e[o]=r[o].evaluate(s,l)}return e},e.reduce=function(t,e){l.properties=e;for(var i=0,n=u;i<n.length;i+=1){var o=n[i];s.accumulated=t[o],t[o]=a[o].evaluate(s,l)}},e}(a)).load(e.features):new kt(e,a.geojsonVtOptions)}catch(t){return r(t)}o.loaded={};var i={};if(s){var n=s.finish();n&&(i.resourceTiming={},i.resourceTiming[a.source]=JSON.parse(JSON.stringify(n)))}r(null,i)})}},St.prototype.coalesce=function(){"Coalescing"===this._state?this._state="Idle":"NeedsLoadData"===this._state&&(this._state="Coalescing",this._loadData())},St.prototype.reloadTile=function(t,e){var i=this.loaded,n=t.uid;return i&&i[n]?Mt.prototype.reloadTile.call(this,t,e):this.loadTile(t,e)},St.prototype.loadGeoJSON=function(e,i){if(e.request)C.getJSON(e.request,i);else{if("string"!=typeof e.data)return i(new Error("Input data given to '"+e.source+"' is not a valid GeoJSON object."));try{return i(null,JSON.parse(e.data))}catch(t){return i(new Error("Input data given to '"+e.source+"' is not a valid GeoJSON object."))}}},St.prototype.removeSource=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),e()},St.prototype.getClusterExpansionZoom=function(t,e){e(null,this._geoJSONIndex.getClusterExpansionZoom(t.clusterId))},St.prototype.getClusterChildren=function(t,e){e(null,this._geoJSONIndex.getChildren(t.clusterId))},St.prototype.getClusterLeaves=function(t,e){e(null,this._geoJSONIndex.getLeaves(t.clusterId,t.limit,t.offset))},St);function St(t,e,i){Mt.call(this,t,e,Et),i&&(this.loadGeoJSON=i)}function Pt(t){var i=this;this.self=t,this.actor=new C.Actor(t,this),this.layerIndexes={},this.workerSourceTypes={vector:r,geojson:Ct},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(t,e){if(i.workerSourceTypes[t])throw new Error('Worker source with name "'+t+'" already registered.');i.workerSourceTypes[t]=e},this.self.registerRTLTextPlugin=function(t){if(C.plugin.isLoaded())throw new Error("RTL text plugin already registered.");C.plugin.applyArabicShaping=t.applyArabicShaping,C.plugin.processBidirectionalText=t.processBidirectionalText,C.plugin.processStyledBidirectionalText=t.processStyledBidirectionalText}}return Pt.prototype.setReferrer=function(t,e){this.referrer=e},Pt.prototype.setLayers=function(t,e,i){this.getLayerIndex(t).replace(e),i()},Pt.prototype.updateLayers=function(t,e,i){this.getLayerIndex(t).update(e.layers,e.removedIds),i()},Pt.prototype.loadTile=function(t,e,i){this.getWorkerSource(t,e.type,e.source).loadTile(e,i)},Pt.prototype.loadDEMTile=function(t,e,i){this.getDEMWorkerSource(t,e.source).loadTile(e,i)},Pt.prototype.reloadTile=function(t,e,i){this.getWorkerSource(t,e.type,e.source).reloadTile(e,i)},Pt.prototype.abortTile=function(t,e,i){this.getWorkerSource(t,e.type,e.source).abortTile(e,i)},Pt.prototype.removeTile=function(t,e,i){this.getWorkerSource(t,e.type,e.source).removeTile(e,i)},Pt.prototype.removeDEMTile=function(t,e){this.getDEMWorkerSource(t,e.source).removeTile(e)},Pt.prototype.removeSource=function(t,e,i){if(this.workerSources[t]&&this.workerSources[t][e.type]&&this.workerSources[t][e.type][e.source]){var n=this.workerSources[t][e.type][e.source];delete this.workerSources[t][e.type][e.source],void 0!==n.removeSource?n.removeSource(e,i):i()}},Pt.prototype.loadWorkerSource=function(t,e,i){try{this.self.importScripts(e.url),i()}catch(t){i(t.toString())}},Pt.prototype.loadRTLTextPlugin=function(t,e,i){try{C.plugin.isLoaded()||(this.self.importScripts(e),i(C.plugin.isLoaded()?null:new Error("RTL Text Plugin failed to import scripts from "+e)))}catch(t){i(t.toString())}},Pt.prototype.getLayerIndex=function(t){var e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new i),e},Pt.prototype.getWorkerSource=function(n,t,e){var o=this;if(this.workerSources[n]||(this.workerSources[n]={}),this.workerSources[n][t]||(this.workerSources[n][t]={}),!this.workerSources[n][t][e]){var i={send:function(t,e,i){o.actor.send(t,e,i,n)}};this.workerSources[n][t][e]=new this.workerSourceTypes[t](i,this.getLayerIndex(n))}return this.workerSources[n][t][e]},Pt.prototype.getDEMWorkerSource=function(t,e){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][e]||(this.demWorkerSources[t][e]=new a),this.demWorkerSources[t][e]},Pt.prototype.enforceCacheSizeLimit=function(t,e){C.enforceCacheSizeLimit(e)},"undefined"!=typeof WorkerGlobalScope&&void 0!==C.window&&C.window instanceof WorkerGlobalScope&&(C.window.worker=new Pt(C.window)),Pt}),t(0,function(mt){var i=mt.createCommonjsModule(function(t){function r(t){return!!("undefined"!=typeof window&&"undefined"!=typeof document&&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.prototype&&Function.prototype.bind&&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&&"JSON"in window&&"parse"in JSON&&"stringify"in JSON&&function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var t,e,i=new Blob([""],{type:"text/javascript"}),n=URL.createObjectURL(i);try{e=new Worker(n),t=!0}catch(e){t=!1}return e&&e.terminate(),URL.revokeObjectURL(n),t}()&&"Uint8ClampedArray"in window&&ArrayBuffer.isView&&(e=t&&t.failIfMajorPerformanceCaveat,void 0===a[e]&&(a[e]=(i=e,n=document.createElement("canvas"),(o=Object.create(r.webGLContextAttributes)).failIfMajorPerformanceCaveat=i,n.probablySupportsContext?n.probablySupportsContext("webgl",o)||n.probablySupportsContext("experimental-webgl",o):n.supportsContext?n.supportsContext("webgl",o)||n.supportsContext("experimental-webgl",o):n.getContext("webgl",o)||n.getContext("experimental-webgl",o))),a[e]));var e,i,n,o}t.exports?t.exports=r:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=r);var a={};r.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}}),y={create:function(t,e,i){var n=mt.window.document.createElement(t);return void 0!==e&&(n.className=e),i&&i.appendChild(n),n},createNS:function(t,e){return mt.window.document.createElementNS(t,e)}},n=mt.window.document.documentElement.style;function t(t){if(!n)return t[0];for(var e=0;e<t.length;e++)if(t[e]in n)return t[e];return t[0]}var e,o=t(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);y.disableDrag=function(){n&&o&&(e=n[o],n[o]="none")},y.enableDrag=function(){n&&o&&(n[o]=e)};var r=t(["transform","WebkitTransform"]),a=!(y.setTransform=function(t,e){t.style[r]=e});try{var s=Object.defineProperty({},"passive",{get:function(){a=!0}});mt.window.addEventListener("test",s,s),mt.window.removeEventListener("test",s,s)}catch(mt){a=!1}y.addEventListener=function(t,e,i,n){void 0===n&&(n={}),"passive"in n&&a?t.addEventListener(e,i,n):t.addEventListener(e,i,n.capture)},y.removeEventListener=function(t,e,i,n){void 0===n&&(n={}),"passive"in n&&a?t.removeEventListener(e,i,n):t.removeEventListener(e,i,n.capture)};var l=function(t){t.preventDefault(),t.stopPropagation(),mt.window.removeEventListener("click",l,!0)};y.suppressClick=function(){mt.window.addEventListener("click",l,!0),mt.window.setTimeout(function(){mt.window.removeEventListener("click",l,!0)},0)},y.mousePos=function(t,e){var i=t.getBoundingClientRect(),n=mt.window.TouchEvent&&e instanceof mt.window.TouchEvent?e.touches[0]:e;return new mt.Point(n.clientX-i.left-t.clientLeft,n.clientY-i.top-t.clientTop)},y.touchPos=function(t,e){for(var i=t.getBoundingClientRect(),n=[],o="touchend"===e.type?e.changedTouches:e.touches,r=0;r<o.length;r++)n.push(new mt.Point(o[r].clientX-i.left-t.clientLeft,o[r].clientY-i.top-t.clientTop));return n},y.mouseButton=function(t){return void 0!==mt.window.InstallTrigger&&2===t.button&&t.ctrlKey&&0<=mt.window.navigator.platform.toUpperCase().indexOf("MAC")?0:t.button},y.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var u,c=((u=mt.Evented)&&(h.__proto__=u),((h.prototype=Object.create(u&&u.prototype)).constructor=h).prototype.isLoaded=function(){return this.loaded},h.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t)){for(var e=0,i=this.requestors;e<i.length;e+=1){var n=i[e],o=n.ids,r=n.callback;this._notify(o,r)}this.requestors=[]}},h.prototype.getImage=function(t){return this.images[t]},h.prototype.addImage=function(t,e){this.images[t]=e},h.prototype.updateImage=function(t,e){var i=this.images[t];e.version=i.version+1,this.images[t]=e,this.updatedImages[t]=!0},h.prototype.removeImage=function(t){var e=this.images[t];delete this.images[t],delete this.patterns[t],e.userImage&&e.userImage.onRemove&&e.userImage.onRemove()},h.prototype.listImages=function(){return Object.keys(this.images)},h.prototype.getImages=function(t,e){var i=!0;if(!this.isLoaded())for(var n=0,o=t;n<o.length;n+=1){var r=o[n];this.images[r]||(i=!1)}this.isLoaded()||i?this._notify(t,e):this.requestors.push({ids:t,callback:e})},h.prototype._notify=function(t,e){for(var i={},n=0,o=t;n<o.length;n+=1){var r=o[n];this.images[r]||this.fire(new mt.Event("styleimagemissing",{id:r}));var a=this.images[r];a?i[r]={data:a.data.clone(),pixelRatio:a.pixelRatio,sdf:a.sdf,version:a.version,hasRenderCallback:Boolean(a.userImage&&a.userImage.render)}:mt.warnOnce('Image "'+r+'" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.')}e(null,i)},h.prototype.getPixelSize=function(){var t=this.atlasImage;return{width:t.width,height:t.height}},h.prototype.getPattern=function(t){var e=this.patterns[t],i=this.getImage(t);if(!i)return null;if(e&&e.position.version===i.version)return e.position;if(e)e.position.version=i.version;else{var n={w:i.data.width+2,h:i.data.height+2,x:0,y:0},o=new mt.ImagePosition(n,i);this.patterns[t]={bin:n,position:o}}return this._updatePatternAtlas(),this.patterns[t].position},h.prototype.bind=function(t){var e=t.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new mt.Texture(t,this.atlasImage,e.RGBA),this.atlasTexture.bind(e.LINEAR,e.CLAMP_TO_EDGE)},h.prototype._updatePatternAtlas=function(){var t=[];for(var e in this.patterns)t.push(this.patterns[e].bin);var i=mt.potpack(t),n=i.w,o=i.h,r=this.atlasImage;for(var a in r.resize({width:n||1,height:o||1}),this.patterns){var s=this.patterns[a].bin,l=s.x+1,u=s.y+1,c=this.images[a].data,h=c.width,p=c.height;mt.RGBAImage.copy(c,r,{x:0,y:0},{x:l,y:u},{width:h,height:p}),mt.RGBAImage.copy(c,r,{x:0,y:p-1},{x:l,y:u-1},{width:h,height:1}),mt.RGBAImage.copy(c,r,{x:0,y:0},{x:l,y:u+p},{width:h,height:1}),mt.RGBAImage.copy(c,r,{x:h-1,y:0},{x:l-1,y:u},{width:1,height:p}),mt.RGBAImage.copy(c,r,{x:0,y:0},{x:l+h,y:u},{width:1,height:p})}this.dirty=!0},h.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},h.prototype.dispatchRenderCallbacks=function(t){for(var e=0,i=t;e<i.length;e+=1){var n=i[e];if(!this.callbackDispatchedThisFrame[n]){this.callbackDispatchedThisFrame[n]=!0;var o=this.images[n];a=void 0,(a=(r=o).userImage)&&a.render&&a.render()&&(r.data.replace(new Uint8Array(a.data.buffer)),1)&&this.updateImage(n,o)}}var r,a},h);function h(){u.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new mt.RGBAImage({width:1,height:1}),this.dirty=!0}var p=f,d=1e20;function f(t,e,i,n,o,r){this.fontSize=t||24,this.buffer=void 0===e?3:e,this.cutoff=n||.25,this.fontFamily=o||"sans-serif",this.fontWeight=r||"normal",this.radius=i||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*(0<=navigator.userAgent.indexOf("Gecko/")?1.2:1))}function m(t,e,i,n,o,r,a){for(var s=0;s<e;s++){for(var l=0;l<i;l++)n[l]=t[l*e+s];for(_(n,o,r,a,i),l=0;l<i;l++)t[l*e+s]=o[l]}for(l=0;l<i;l++){for(s=0;s<e;s++)n[s]=t[l*e+s];for(_(n,o,r,a,e),s=0;s<e;s++)t[l*e+s]=Math.sqrt(o[s])}}function _(t,e,i,n,o){n[i[0]=0]=-d,n[1]=+d;for(var r=1,a=0;r<o;r++){for(var s=(t[r]+r*r-(t[i[a]]+i[a]*i[a]))/(2*r-2*i[a]);s<=n[a];)a--,s=(t[r]+r*r-(t[i[a]]+i[a]*i[a]))/(2*r-2*i[a]);i[++a]=r,n[a]=s,n[a+1]=+d}for(a=r=0;r<o;r++){for(;n[a+1]<r;)a++;e[r]=(r-i[a])*(r-i[a])+t[i[a]]}}f.prototype.draw=function(t){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(t,this.buffer,this.middle);for(var e=this.ctx.getImageData(0,0,this.size,this.size),i=new Uint8ClampedArray(this.size*this.size),n=0;n<this.size*this.size;n++){var o=e.data[4*n+3]/255;this.gridOuter[n]=1==o?0:0==o?d:Math.pow(Math.max(0,.5-o),2),this.gridInner[n]=1==o?d:0==o?0:Math.pow(Math.max(0,o-.5),2)}for(m(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),m(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),n=0;n<this.size*this.size;n++){var r=this.gridOuter[n]-this.gridInner[n];i[n]=Math.max(0,Math.min(255,Math.round(255-255*(r/this.radius+this.cutoff))))}return i};function g(t,e){this.requestManager=t,this.localIdeographFontFamily=e,this.entries={}}g.prototype.setURL=function(t){this.url=t},g.prototype.getGlyphs=function(t,u){var l=this,e=[];for(var i in t)for(var n=0,o=t[i];n<o.length;n+=1){var r=o[n];e.push({stack:i,id:r})}mt.asyncAll(e,function(t,i){var n=t.stack,o=t.id,r=l.entries[n];r||(r=l.entries[n]={glyphs:{},requests:{}});var e=r.glyphs[o];if(void 0===e)if(e=l._tinySDF(r,n,o))i(null,{stack:n,id:o,glyph:e});else{var a=Math.floor(o/256);if(65535<256*a)i(new Error("glyphs > 65535 not supported"));else{var s=r.requests[a];s||(s=r.requests[a]=[],g.loadGlyphRange(n,a,l.url,l.requestManager,function(t,e){if(e)for(var i in e)r.glyphs[+i]=e[+i];for(var n=0,o=s;n<o.length;n+=1)(0,o[n])(t,e);delete r.requests[a]})),s.push(function(t,e){t?i(t):e&&i(null,{stack:n,id:o,glyph:e[o]||null})})}}else i(null,{stack:n,id:o,glyph:e})},function(t,e){if(t)u(t);else if(e){for(var i={},n=0,o=e;n<o.length;n+=1){var r=o[n],a=r.stack,s=r.id,l=r.glyph;(i[a]||(i[a]={}))[s]=l&&{id:l.id,bitmap:l.bitmap.clone(),metrics:l.metrics}}u(null,i)}})},g.prototype._tinySDF=function(t,e,i){var n=this.localIdeographFontFamily;if(n&&(mt.isChar["CJK Unified Ideographs"](i)||mt.isChar["Hangul Syllables"](i)||mt.isChar.Hiragana(i)||mt.isChar.Katakana(i))){var o=t.tinySDF;if(!o){var r="400";/bold/i.test(e)?r="900":/medium/i.test(e)?r="500":/light/i.test(e)&&(r="200"),o=t.tinySDF=new g.TinySDF(24,3,8,.25,n,r)}return{id:i,bitmap:new mt.AlphaImage({width:30,height:30},o.draw(String.fromCharCode(i))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},g.loadGlyphRange=function(t,e,i,n,a){var o=256*e,r=255+o,s=n.transformRequest(n.normalizeGlyphsURL(i).replace("{fontstack}",t).replace("{range}",o+"-"+r),mt.ResourceType.Glyphs);mt.getArrayBuffer(s,function(t,e){if(t)a(t);else if(e){for(var i={},n=0,o=mt.parseGlyphPBF(e);n<o.length;n+=1){var r=o[n];i[r.id]=r}a(null,i)}})},g.TinySDF=p;function v(){this.specification=mt.styleSpec.light.position}v.prototype.possiblyEvaluate=function(t,e){return mt.sphericalToCartesian(t.expression.evaluate(e))},v.prototype.interpolate=function(t,e,i){return{x:mt.number(t.x,e.x,i),y:mt.number(t.y,e.y,i),z:mt.number(t.z,e.z,i)}};function x(t,e){this.width=t,this.height=e,this.nextRow=0,this.bytes=4,this.data=new Uint8Array(this.width*this.height*this.bytes),this.positions={}}var b,w=new mt.Properties({anchor:new mt.DataConstantProperty(mt.styleSpec.light.anchor),position:new v,color:new mt.DataConstantProperty(mt.styleSpec.light.color),intensity:new mt.DataConstantProperty(mt.styleSpec.light.intensity)}),L=((b=mt.Evented)&&(k.__proto__=b),((k.prototype=Object.create(b&&b.prototype)).constructor=k).prototype.getLight=function(){return this._transitionable.serialize()},k.prototype.setLight=function(t,e){if(void 0===e&&(e={}),!this._validate(mt.validateLight,t,e))for(var i in t){var n=t[i];mt.endsWith(i,"-transition")?this._transitionable.setTransition(i.slice(0,-"-transition".length),n):this._transitionable.setValue(i,n)}},k.prototype.updateTransitions=function(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)},k.prototype.hasTransition=function(){return this._transitioning.hasTransition()},k.prototype.recalculate=function(t){this.properties=this._transitioning.possiblyEvaluate(t)},k.prototype._validate=function(t,e,i){return(!i||!1!==i.validate)&&mt.emitValidationErrors(this,t.call(mt.validateStyle,mt.extend({value:e,style:{glyphs:!0,sprite:!0},styleSpec:mt.styleSpec})))},k);function k(t){b.call(this),this._transitionable=new mt.Transitionable(w),this.setLight(t),this._transitioning=this._transitionable.untransitioned()}x.prototype.getDash=function(t,e){var i=t.join(",")+String(e);return this.positions[i]||(this.positions[i]=this.addDash(t,e)),this.positions[i]},x.prototype.addDash=function(t,e){var i=e?7:0,n=2*i+1;if(this.nextRow+n>this.height)return mt.warnOnce("LineAtlas out of space"),null;for(var o=0,r=0;r<t.length;r++)o+=t[r];for(var a=this.width/o,s=a/2,l=t.length%2==1,u=-i;u<=i;u++)for(var c=this.nextRow+i+u,h=this.width*c,p=l?-t[t.length-1]:0,d=t[0],f=1,m=0;m<this.width;m++){for(;d<m/a;)p=d,d+=t[f],l&&f===t.length-1&&(d+=t[0]),f++;var _=Math.abs(m-p*a),g=Math.abs(m-d*a),y=Math.min(_,g),v=f%2==1,x=void 0;if(e){var b=i?u/i*(1+s):0;if(v){var w=s-Math.abs(b);x=Math.sqrt(y*y+w*w)}else x=s-Math.sqrt(y*y+b*b)}else x=(v?1:-1)*y;this.data[3+4*(h+m)]=Math.max(0,Math.min(255,x+128))}var L={y:(this.nextRow+i+.5)/this.height,height:2*i/this.height,width:o};return this.nextRow+=n,this.dirty=!0,L},x.prototype.bind=function(t){var e=t.gl;this.texture?(e.bindTexture(e.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,e.texSubImage2D(e.TEXTURE_2D,0,0,0,this.width,this.height,e.RGBA,e.UNSIGNED_BYTE,this.data))):(this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,this.width,this.height,0,e.RGBA,e.UNSIGNED_BYTE,this.data))};function T(t,e){this.workerPool=t,this.actors=[],this.currentActor=0,this.id=mt.uniqueId();for(var i=this.workerPool.acquire(this.id),n=0;n<i.length;n++){var o=i[n],r=new T.Actor(o,e,this.id);r.name="Worker "+n,this.actors.push(r)}}function E(n,o,r){function t(t,e){if(t)return r(t);if(e){var i=mt.pick(e,["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds"]);e.vector_layers&&(i.vectorLayers=e.vector_layers,i.vectorLayerIds=i.vectorLayers.map(function(t){return t.id})),n.url&&(i.tiles=o.canonicalizeTileset(i,n.url)),r(null,i)}}return n.url?mt.getJSON(o.transformRequest(o.normalizeSourceURL(n.url),mt.ResourceType.Source),t):mt.browser.frame(function(){return t(null,n)})}T.prototype.broadcast=function(i,n,t){t=t||function(){},mt.asyncAll(this.actors,function(t,e){t.send(i,n,e)},t)},T.prototype.send=function(t,e,i,n){return"number"==typeof n&&!isNaN(n)||(n=this.currentActor=(this.currentActor+1)%this.actors.length),this.actors[n].send(t,e,i),n},T.prototype.remove=function(){this.actors.forEach(function(t){t.remove()}),this.actors=[],this.workerPool.release(this.id)},T.Actor=mt.Actor;function M(t,e,i){this.bounds=mt.LngLatBounds.convert(this.validateBounds(t)),this.minzoom=e||0,this.maxzoom=i||24}M.prototype.validateBounds=function(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]},M.prototype.contains=function(t){var e=Math.pow(2,t.z),i=Math.floor(mt.mercatorXfromLng(this.bounds.getWest())*e),n=Math.floor(mt.mercatorYfromLat(this.bounds.getNorth())*e),o=Math.ceil(mt.mercatorXfromLng(this.bounds.getEast())*e),r=Math.ceil(mt.mercatorYfromLat(this.bounds.getSouth())*e);return t.x>=i&&t.x<o&&t.y>=n&&t.y<r};var C,S,P,z,I,A=((I=mt.Evented)&&($.__proto__=I),(($.prototype=Object.create(I&&I.prototype)).constructor=$).prototype.load=function(){var i=this;this.fire(new mt.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=E(this._options,this.map._requestManager,function(t,e){i._tileJSONRequest=null,t?i.fire(new mt.ErrorEvent(t)):e&&(mt.extend(i,e),e.bounds&&(i.tileBounds=new M(e.bounds,i.minzoom,i.maxzoom)),mt.postTurnstileEvent(e.tiles),mt.postMapLoadEvent(e.tiles,i.map._getMapId(),i.map._requestManager._skuToken),i.fire(new mt.Event("data",{dataType:"source",sourceDataType:"metadata"})),i.fire(new mt.Event("data",{dataType:"source",sourceDataType:"content"})))})},$.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},$.prototype.onAdd=function(t){this.map=t,this.load()},$.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},$.prototype.serialize=function(){return mt.extend({},this._options)},$.prototype.loadTile=function(i,n){var t=this.map._requestManager.normalizeTileURL(i.tileID.canonical.url(this.tiles,this.scheme),this.url,null),e={request:this.map._requestManager.transformRequest(t,mt.ResourceType.Tile),uid:i.uid,tileID:i.tileID,zoom:i.tileID.overscaledZ,tileSize:this.tileSize*i.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:mt.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes};function o(t,e){return i.aborted?n(null):t&&404!==t.status?n(t):(e&&e.resourceTiming&&(i.resourceTiming=e.resourceTiming),this.map._refreshExpiredTiles&&e&&i.setExpiryData(e),i.loadVectorData(e,this.map.painter),mt.cacheEntryPossiblyAdded(this.dispatcher),n(null),void(i.reloadCallback&&(this.loadTile(i,i.reloadCallback),i.reloadCallback=null)))}e.request.collectResourceTiming=this._collectResourceTiming,void 0===i.workerID||"expired"===i.state?i.workerID=this.dispatcher.send("loadTile",e,o.bind(this)):"loading"===i.state?i.reloadCallback=n:this.dispatcher.send("reloadTile",e,o.bind(this),i.workerID)},$.prototype.abortTile=function(t){this.dispatcher.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0,t.workerID)},$.prototype.unloadTile=function(t){t.unloadVectorData(),this.dispatcher.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0,t.workerID)},$.prototype.hasTransition=function(){return!1},$),D=((z=mt.Evented)&&(j.__proto__=z),((j.prototype=Object.create(z&&z.prototype)).constructor=j).prototype.load=function(){var i=this;this.fire(new mt.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=E(this._options,this.map._requestManager,function(t,e){i._tileJSONRequest=null,t?i.fire(new mt.ErrorEvent(t)):e&&(mt.extend(i,e),e.bounds&&(i.tileBounds=new M(e.bounds,i.minzoom,i.maxzoom)),mt.postTurnstileEvent(e.tiles),mt.postMapLoadEvent(e.tiles,i.map._getMapId(),i.map._requestManager._skuToken),i.fire(new mt.Event("data",{dataType:"source",sourceDataType:"metadata"})),i.fire(new mt.Event("data",{dataType:"source",sourceDataType:"content"})))})},j.prototype.onAdd=function(t){this.map=t,this.load()},j.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},j.prototype.serialize=function(){return mt.extend({},this._options)},j.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},j.prototype.loadTile=function(o,r){var a=this,t=this.map._requestManager.normalizeTileURL(o.tileID.canonical.url(this.tiles,this.scheme),this.url,this.tileSize);o.request=mt.getImage(this.map._requestManager.transformRequest(t,mt.ResourceType.Tile),function(t,e){if(delete o.request,o.aborted)o.state="unloaded",r(null);else if(t)o.state="errored",r(t);else if(e){a.map._refreshExpiredTiles&&o.setExpiryData(e),delete e.cacheControl,delete e.expires;var i=a.map.painter.context,n=i.gl;o.texture=a.map.painter.getTileTexture(e.width),o.texture?o.texture.update(e,{useMipmap:!0}):(o.texture=new mt.Texture(i,e,n.RGBA,{useMipmap:!0}),o.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE,n.LINEAR_MIPMAP_NEAREST),i.extTextureFilterAnisotropic&&n.texParameterf(n.TEXTURE_2D,i.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,i.extTextureFilterAnisotropicMax)),o.state="loaded",mt.cacheEntryPossiblyAdded(a.dispatcher),r(null)}})},j.prototype.abortTile=function(t,e){t.request&&(t.request.cancel(),delete t.request),e()},j.prototype.unloadTile=function(t,e){t.texture&&this.map.painter.saveTileTexture(t.texture),e()},j.prototype.hasTransition=function(){return!1},j),O=((P=D)&&(N.__proto__=P),((N.prototype=Object.create(P&&P.prototype)).constructor=N).prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},N.prototype.loadTile=function(o,r){var t=this.map._requestManager.normalizeTileURL(o.tileID.canonical.url(this.tiles,this.scheme),this.url,this.tileSize);o.request=mt.getImage(this.map._requestManager.transformRequest(t,mt.ResourceType.Tile),function(t,e){if(delete o.request,o.aborted)o.state="unloaded",r(null);else if(t)o.state="errored",r(t);else if(e){this.map._refreshExpiredTiles&&o.setExpiryData(e),delete e.cacheControl,delete e.expires;var i=mt.browser.getImageData(e),n={uid:o.uid,coord:o.tileID,source:this.id,rawImageData:i,encoding:this.encoding};o.workerID&&"expired"!==o.state||(o.workerID=this.dispatcher.send("loadDEMTile",n,function(t,e){t&&(o.state="errored",r(t)),e&&(o.dem=e,o.needsHillshadePrepare=!0,o.state="loaded",r(null))}.bind(this)))}}.bind(this)),o.neighboringTiles=this._getNeighboringTiles(o.tileID)},N.prototype._getNeighboringTiles=function(t){var e=t.canonical,i=Math.pow(2,e.z),n=(e.x-1+i)%i,o=0===e.x?t.wrap-1:t.wrap,r=(e.x+1+i)%i,a=e.x+1===i?t.wrap+1:t.wrap,s={};return s[new mt.OverscaledTileID(t.overscaledZ,o,e.z,n,e.y).key]={backfilled:!1},s[new mt.OverscaledTileID(t.overscaledZ,a,e.z,r,e.y).key]={backfilled:!1},0<e.y&&(s[new mt.OverscaledTileID(t.overscaledZ,o,e.z,n,e.y-1).key]={backfilled:!1},s[new mt.OverscaledTileID(t.overscaledZ,t.wrap,e.z,e.x,e.y-1).key]={backfilled:!1},s[new mt.OverscaledTileID(t.overscaledZ,a,e.z,r,e.y-1).key]={backfilled:!1}),e.y+1<i&&(s[new mt.OverscaledTileID(t.overscaledZ,o,e.z,n,e.y+1).key]={backfilled:!1},s[new mt.OverscaledTileID(t.overscaledZ,t.wrap,e.z,e.x,e.y+1).key]={backfilled:!1},s[new mt.OverscaledTileID(t.overscaledZ,a,e.z,r,e.y+1).key]={backfilled:!1}),s},N.prototype.unloadTile=function(t){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded",this.dispatcher.send("removeDEMTile",{uid:t.uid,source:this.id},void 0,t.workerID)},N),R=((S=mt.Evented)&&(U.__proto__=S),((U.prototype=Object.create(S&&S.prototype)).constructor=U).prototype.load=function(){var i=this;this.fire(new mt.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(t){if(t)i.fire(new mt.ErrorEvent(t));else{var e={dataType:"source",sourceDataType:"metadata"};i._collectResourceTiming&&i._resourceTiming&&0<i._resourceTiming.length&&(e.resourceTiming=i._resourceTiming,i._resourceTiming=[]),i.fire(new mt.Event("data",e))}})},U.prototype.onAdd=function(t){this.map=t,this.load()},U.prototype.setData=function(t){var i=this;return this._data=t,this.fire(new mt.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(t){if(t)i.fire(new mt.ErrorEvent(t));else{var e={dataType:"source",sourceDataType:"content"};i._collectResourceTiming&&i._resourceTiming&&0<i._resourceTiming.length&&(e.resourceTiming=i._resourceTiming,i._resourceTiming=[]),i.fire(new mt.Event("data",e))}}),this},U.prototype.getClusterExpansionZoom=function(t,e){return this.dispatcher.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e,this.workerID),this},U.prototype.getClusterChildren=function(t,e){return this.dispatcher.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e,this.workerID),this},U.prototype.getClusterLeaves=function(t,e,i,n){return this.dispatcher.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:i},n,this.workerID),this},U.prototype._updateWorkerData=function(i){var n=this,o=mt.extend({},this.workerOptions),t=this._data;"string"==typeof t?(o.request=this.map._requestManager.transformRequest(mt.browser.resolveURL(t),mt.ResourceType.Source),o.request.collectResourceTiming=this._collectResourceTiming):o.data=JSON.stringify(t),this.workerID=this.dispatcher.send(this.type+".loadData",o,function(t,e){n._removed||e&&e.abandoned||(n._loaded=!0,e&&e.resourceTiming&&e.resourceTiming[n.id]&&(n._resourceTiming=e.resourceTiming[n.id].slice(0)),n.dispatcher.send(n.type+".coalesce",{source:o.source},null,n.workerID),i(t))},this.workerID)},U.prototype.loadTile=function(i,n){var o=this,r=void 0===i.workerID?"loadTile":"reloadTile",t={type:this.type,uid:i.uid,tileID:i.tileID,zoom:i.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:mt.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes};i.workerID=this.dispatcher.send(r,t,function(t,e){return i.unloadVectorData(),i.aborted?n(null):t?n(t):(i.loadVectorData(e,o.map.painter,"reloadTile"==r),n(null))},this.workerID)},U.prototype.abortTile=function(t){t.aborted=!0},U.prototype.unloadTile=function(t){t.unloadVectorData(),this.dispatcher.send("removeTile",{uid:t.uid,type:this.type,source:this.id},null,t.workerID)},U.prototype.onRemove=function(){this._removed=!0,this.dispatcher.send("removeSource",{type:this.type,source:this.id},null,this.workerID)},U.prototype.serialize=function(){return mt.extend({},this._options,{type:this.type,data:this._data})},U.prototype.hasTransition=function(){return!1},U),B=((C=mt.Evented)&&(F.__proto__=C),((F.prototype=Object.create(C&&C.prototype)).constructor=F).prototype.load=function(i,n){var o=this;this.fire(new mt.Event("dataloading",{dataType:"source"})),this.url=this.options.url,mt.getImage(this.map._requestManager.transformRequest(this.url,mt.ResourceType.Image),function(t,e){t?o.fire(new mt.ErrorEvent(t)):e&&(o.image=e,i&&(o.coordinates=i),n&&n(),o._finishLoading())})},F.prototype.updateImage=function(t){var e=this;return this.image&&t.url&&(this.options.url=t.url,this.load(t.coordinates,function(){e.texture=null})),this},F.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new mt.Event("data",{dataType:"source",sourceDataType:"metadata"})))},F.prototype.onAdd=function(t){this.map=t,this.load()},F.prototype.setCoordinates=function(t){var e=this,p=(this.coordinates=t).map(mt.MercatorCoordinate.fromLngLat);this.tileID=function(){for(var t=1/0,e=1/0,i=-1/0,n=-1/0,o=0,r=p;o<r.length;o+=1){var a=r[o];t=Math.min(t,a.x),e=Math.min(e,a.y),i=Math.max(i,a.x),n=Math.max(n,a.y)}var s=i-t,l=n-e,u=Math.max(s,l),c=Math.max(0,Math.floor(-Math.log(u)/Math.LN2)),h=Math.pow(2,c);return new mt.CanonicalTileID(c,Math.floor((t+i)/2*h),Math.floor((e+n)/2*h))}(),this.minzoom=this.maxzoom=this.tileID.z;var i=p.map(function(t){return e.tileID.getTilePoint(t)._round()});return this._boundsArray=new mt.StructArrayLayout4i8,this._boundsArray.emplaceBack(i[0].x,i[0].y,0,0),this._boundsArray.emplaceBack(i[1].x,i[1].y,mt.EXTENT,0),this._boundsArray.emplaceBack(i[3].x,i[3].y,0,mt.EXTENT),this._boundsArray.emplaceBack(i[2].x,i[2].y,mt.EXTENT,mt.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new mt.Event("data",{dataType:"source",sourceDataType:"content"})),this},F.prototype.prepare=function(){if(0!==Object.keys(this.tiles).length&&this.image){var t=this.map.painter.context,e=t.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,mt.rasterBoundsAttributes.members)),this.boundsSegments||(this.boundsSegments=mt.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new mt.Texture(t,this.image,e.RGBA),this.texture.bind(e.LINEAR,e.CLAMP_TO_EDGE)),this.tiles){var n=this.tiles[i];"loaded"!==n.state&&(n.state="loaded",n.texture=this.texture)}}},F.prototype.loadTile=function(t,e){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t).buckets={}:t.state="errored",e(null)},F.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},F.prototype.hasTransition=function(){return!1},F);function F(t,e,i,n){C.call(this),this.id=t,this.dispatcher=i,this.coordinates=e.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this.setEventedParent(n),this.options=e}function U(t,e,i,n){S.call(this),this.id=t,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this.dispatcher=i,this.setEventedParent(n),this._data=e.data,this._options=mt.extend({},e),this._collectResourceTiming=e.collectResourceTiming,this._resourceTiming=[],void 0!==e.maxzoom&&(this.maxzoom=e.maxzoom),e.type&&(this.type=e.type),e.attribution&&(this.attribution=e.attribution);var o=mt.EXTENT/this.tileSize;this.workerOptions=mt.extend({source:this.id,cluster:e.cluster||!1,geojsonVtOptions:{buffer:(void 0!==e.buffer?e.buffer:128)*o,tolerance:(void 0!==e.tolerance?e.tolerance:.375)*o,extent:mt.EXTENT,maxZoom:this.maxzoom,lineMetrics:e.lineMetrics||!1,generateId:e.generateId||!1},superclusterOptions:{maxZoom:void 0!==e.clusterMaxZoom?Math.min(e.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,extent:mt.EXTENT,radius:(e.clusterRadius||50)*o,log:!1},clusterProperties:e.clusterProperties},e.workerOptions)}function N(t,e,i,n){P.call(this,t,e,i,n),this.type="raster-dem",this.maxzoom=22,this._options=mt.extend({},e),this.encoding=e.encoding||"mapbox"}function j(t,e,i,n){z.call(this),this.id=t,this.dispatcher=i,this.setEventedParent(n),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=mt.extend({},e),mt.extend(this,mt.pick(e,["url","scheme","tileSize"]))}function $(t,e,i,n){if(I.call(this),this.id=t,this.dispatcher=i,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,mt.extend(this,mt.pick(e,["url","scheme","tileSize"])),this._options=mt.extend({type:"vector"},e),this._collectResourceTiming=e.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(n)}var V,Z,G=((Z=B)&&(X.__proto__=Z),((X.prototype=Object.create(Z&&Z.prototype)).constructor=X).prototype.load=function(){var i=this,t=this.options;this.urls=[];for(var e=0,n=t.urls;e<n.length;e+=1){var o=n[e];this.urls.push(this.map._requestManager.transformRequest(o,mt.ResourceType.Source).url)}mt.getVideo(this.urls,function(t,e){t?i.fire(new mt.ErrorEvent(t)):e&&(i.video=e,i.video.loop=!0,i.video.addEventListener("playing",function(){i.map.triggerRepaint()}),i.map&&i.video.play(),i._finishLoading())})},X.prototype.getVideo=function(){return this.video},X.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},X.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var t=this.map.painter.context,e=t.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,mt.rasterBoundsAttributes.members)),this.boundsSegments||(this.boundsSegments=mt.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(e.LINEAR,e.CLAMP_TO_EDGE),e.texSubImage2D(e.TEXTURE_2D,0,0,0,e.RGBA,e.UNSIGNED_BYTE,this.video)):(this.texture=new mt.Texture(t,this.video,e.RGBA),this.texture.bind(e.LINEAR,e.CLAMP_TO_EDGE)),this.tiles){var n=this.tiles[i];"loaded"!==n.state&&(n.state="loaded",n.texture=this.texture)}}},X.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},X.prototype.hasTransition=function(){return this.video&&!this.video.paused},X),q=((V=B)&&(W.__proto__=V),((W.prototype=Object.create(V&&V.prototype)).constructor=W).prototype.load=function(){this.canvas||(this.canvas=this.options.canvas instanceof mt.window.HTMLCanvasElement?this.options.canvas:mt.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new mt.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},W.prototype.getCanvas=function(){return this.canvas},W.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},W.prototype.onRemove=function(){this.pause()},W.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){var e=this.map.painter.context,i=e.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,mt.rasterBoundsAttributes.members)),this.boundsSegments||(this.boundsSegments=mt.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new mt.Texture(e,this.canvas,i.RGBA,{premultiply:!0}),this.tiles){var o=this.tiles[n];"loaded"!==o.state&&(o.state="loaded",o.texture=this.texture)}}},W.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},W.prototype.hasTransition=function(){return this._playing},W.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];t<e.length;t+=1){var i=e[t];if(isNaN(i)||i<=0)return!0}return!1},W),H={vector:A,raster:D,"raster-dem":O,geojson:R,video:G,image:B,canvas:q};function W(t,e,i,n){V.call(this,t,e,i,n),e.coordinates?Array.isArray(e.coordinates)&&4===e.coordinates.length&&!e.coordinates.some(function(t){return!Array.isArray(t)||2!==t.length||t.some(function(t){return"number"!=typeof t})})||this.fire(new mt.ErrorEvent(new mt.ValidationError("sources."+t,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new mt.ErrorEvent(new mt.ValidationError("sources."+t,null,'missing required property "coordinates"'))),e.animate&&"boolean"!=typeof e.animate&&this.fire(new mt.ErrorEvent(new mt.ValidationError("sources."+t,null,'optional "animate" property must be a boolean value'))),e.canvas?"string"==typeof e.canvas||e.canvas instanceof mt.window.HTMLCanvasElement||this.fire(new mt.ErrorEvent(new mt.ValidationError("sources."+t,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new mt.ErrorEvent(new mt.ValidationError("sources."+t,null,'missing required property "canvas"'))),this.options=e,this.animate=void 0===e.animate||e.animate}function X(t,e,i,n){Z.call(this,t,e,i,n),this.roundZoom=!0,this.type="video",this.options=e}function K(n,t,e,i,o){var r,a,s,l=function(t,e,i){if(t)for(var n=0,o=t;n<o.length;n+=1){var r=e[o[n]];if(r&&r.source===i&&"fill-extrusion"===r.type)return!0}else for(var a in e){var s=e[a];if(s.source===i&&"fill-extrusion"===s.type)return!0}return!1}(i&&i.layers,t,n.id),u=o.maxPitchScaleFactor(),c=n.tilesIn(e,u,l);c.sort(J);for(var m=[],h=0,p=c;h<p.length;h+=1){var d=p[h];m.push({wrappedTileID:d.tileID.wrapped().key,queryResults:d.tile.queryRenderedFeatures(t,n._state,d.queryGeometry,d.cameraQueryGeometry,d.scale,i,o,u,(r=n.transform,a=d.tileID,void 0,s=mt.identity([]),mt.translate(s,s,[1,1,0]),mt.scale(s,s,[.5*r.width,.5*r.height,1]),mt.multiply(s,s,r.calculatePosMatrix(a.toUnwrapped()))))})}var f=function(){for(var t={},e={},i=0,n=m;i<n.length;i+=1){var o=n[i],r=o.queryResults,a=o.wrappedTileID,s=e[a]=e[a]||{};for(var l in r)for(var u=r[l],c=s[l]=s[l]||{},h=t[l]=t[l]||[],p=0,d=u;p<d.length;p+=1){var f=d[p];c[f.featureIndex]||(c[f.featureIndex]=!0,h.push(f))}}return t}();for(var _ in f)f[_].forEach(function(t){var e=t.feature,i=n.getFeatureState(e.layer["source-layer"],e.id);e.source=e.layer.source,e.layer["source-layer"]&&(e.sourceLayer=e.layer["source-layer"]),e.state=i});return f}function J(t,e){var i=t.tileID,n=e.tileID;return i.overscaledZ-n.overscaledZ||i.canonical.y-n.canonical.y||i.wrap-n.wrap||i.canonical.x-n.canonical.x}function Y(t,e){this.max=t,this.onRemove=e,this.reset()}Y.prototype.reset=function(){for(var t in this.data)for(var e=0,i=this.data[t];e<i.length;e+=1){var n=i[e];n.timeout&&clearTimeout(n.timeout),this.onRemove(n.value)}return this.data={},this.order=[],this},Y.prototype.add=function(t,e,i){var n=this,o=t.wrapped().key;void 0===this.data[o]&&(this.data[o]=[]);var r={value:e,timeout:void 0};if(void 0!==i&&(r.timeout=setTimeout(function(){n.remove(t,r)},i)),this.data[o].push(r),this.order.push(o),this.order.length>this.max){var a=this._getAndRemoveByKey(this.order[0]);a&&this.onRemove(a)}return this},Y.prototype.has=function(t){return t.wrapped().key in this.data},Y.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},Y.prototype._getAndRemoveByKey=function(t){var e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value},Y.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},Y.prototype.remove=function(t,e){if(!this.has(t))return this;var i=t.wrapped().key,n=void 0===e?0:this.data[i].indexOf(e),o=this.data[i][n];return this.data[i].splice(n,1),o.timeout&&clearTimeout(o.timeout),0===this.data[i].length&&delete this.data[i],this.onRemove(o.value),this.order.splice(this.order.indexOf(i),1),this},Y.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this};function Q(t,e,i){var n=(this.context=t).gl;this.buffer=n.createBuffer(),this.dynamicDraw=Boolean(i),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer}Q.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},Q.prototype.updateData=function(t){var e=this.context.gl;this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)},Q.prototype.destroy=function(){var t=this.context.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer)};function tt(t,e,i,n){this.length=e.length,this.attributes=i,this.itemSize=e.bytesPerElement,this.dynamicDraw=n;var o=(this.context=t).gl;this.buffer=o.createBuffer(),t.bindVertexBuffer.set(this.buffer),o.bufferData(o.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?o.DYNAMIC_DRAW:o.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer}var et={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};tt.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},tt.prototype.updateData=function(t){var e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)},tt.prototype.enableAttributes=function(t,e){for(var i=0;i<this.attributes.length;i++){var n=this.attributes[i],o=e.attributes[n.name];void 0!==o&&t.enableVertexAttribArray(o)}},tt.prototype.setVertexAttribPointers=function(t,e,i){for(var n=0;n<this.attributes.length;n++){var o=this.attributes[n],r=e.attributes[o.name];void 0!==r&&t.vertexAttribPointer(r,o.components,t[et[o.type]],!1,this.itemSize,o.offset+this.itemSize*(i||0))}},tt.prototype.destroy=function(){var t=this.context.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer)};function it(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}it.prototype.get=function(){return this.current},it.prototype.set=function(){},it.prototype.getDefault=function(){return this.default},it.prototype.setDefault=function(){this.set(this.default)};function nt(t,e,i){this.context=t,this.width=e,this.height=i;var n=t.gl,o=this.framebuffer=n.createFramebuffer();this.colorAttachment=new ge(t,o),this.depthAttachment=new ye(t,o)}var ot,rt,at,st,lt,ut,ct,ht,pt,dt,ft,_t,gt,yt,vt,xt,bt,wt,Lt,kt,Tt,Et,Mt,Ct,St,Pt,zt,It,At,Dt,Ot,Rt,Bt,Ft,Ut=((Ft=it)&&(Ye.__proto__=Ft),((Ye.prototype=Object.create(Ft&&Ft.prototype)).constructor=Ye).prototype.getDefault=function(){return mt.Color.transparent},Ye.prototype.set=function(t){var e=this.current;t.r===e.r&&t.g===e.g&&t.b===e.b&&t.a===e.a&&!this.dirty||(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)},Ye),Nt=((Bt=it)&&(Je.__proto__=Bt),((Je.prototype=Object.create(Bt&&Bt.prototype)).constructor=Je).prototype.getDefault=function(){return 1},Je.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.clearDepth(t),this.current=t,this.dirty=!1)},Je),jt=((Rt=it)&&(Ke.__proto__=Rt),((Ke.prototype=Object.create(Rt&&Rt.prototype)).constructor=Ke).prototype.getDefault=function(){return 0},Ke.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.clearStencil(t),this.current=t,this.dirty=!1)},Ke),$t=((Ot=it)&&(Xe.__proto__=Ot),((Xe.prototype=Object.create(Ot&&Ot.prototype)).constructor=Xe).prototype.getDefault=function(){return[!0,!0,!0,!0]},Xe.prototype.set=function(t){var e=this.current;t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&!this.dirty||(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)},Xe),Vt=((Dt=it)&&(We.__proto__=Dt),((We.prototype=Object.create(Dt&&Dt.prototype)).constructor=We).prototype.getDefault=function(){return!0},We.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.depthMask(t),this.current=t,this.dirty=!1)},We),Zt=((At=it)&&(He.__proto__=At),((He.prototype=Object.create(At&&At.prototype)).constructor=He).prototype.getDefault=function(){return 255},He.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.stencilMask(t),this.current=t,this.dirty=!1)},He),Gt=((It=it)&&(qe.__proto__=It),((qe.prototype=Object.create(It&&It.prototype)).constructor=qe).prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},qe.prototype.set=function(t){var e=this.current;t.func===e.func&&t.ref===e.ref&&t.mask===e.mask&&!this.dirty||(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)},qe),qt=((zt=it)&&(Ge.__proto__=zt),((Ge.prototype=Object.create(zt&&zt.prototype)).constructor=Ge).prototype.getDefault=function(){var t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]},Ge.prototype.set=function(t){var e=this.current;t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&!this.dirty||(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)},Ge),Ht=((Pt=it)&&(Ze.__proto__=Pt),((Ze.prototype=Object.create(Pt&&Pt.prototype)).constructor=Ze).prototype.getDefault=function(){return!1},Ze.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this.current=t,this.dirty=!1}},Ze),Wt=((St=it)&&(Ve.__proto__=St),((Ve.prototype=Object.create(St&&St.prototype)).constructor=Ve).prototype.getDefault=function(){return[0,1]},Ve.prototype.set=function(t){var e=this.current;t[0]===e[0]&&t[1]===e[1]&&!this.dirty||(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)},Ve),Xt=((Ct=it)&&($e.__proto__=Ct),(($e.prototype=Object.create(Ct&&Ct.prototype)).constructor=$e).prototype.getDefault=function(){return!1},$e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this.current=t,this.dirty=!1}},$e),Kt=((Mt=it)&&(je.__proto__=Mt),((je.prototype=Object.create(Mt&&Mt.prototype)).constructor=je).prototype.getDefault=function(){return this.gl.LESS},je.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.depthFunc(t),this.current=t,this.dirty=!1)},je),Jt=((Et=it)&&(Ne.__proto__=Et),((Ne.prototype=Object.create(Et&&Et.prototype)).constructor=Ne).prototype.getDefault=function(){return!1},Ne.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.BLEND):e.disable(e.BLEND),this.current=t,this.dirty=!1}},Ne),Yt=((Tt=it)&&(Ue.__proto__=Tt),((Ue.prototype=Object.create(Tt&&Tt.prototype)).constructor=Ue).prototype.getDefault=function(){var t=this.gl;return[t.ONE,t.ZERO]},Ue.prototype.set=function(t){var e=this.current;t[0]===e[0]&&t[1]===e[1]&&!this.dirty||(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)},Ue),Qt=((kt=it)&&(Fe.__proto__=kt),((Fe.prototype=Object.create(kt&&kt.prototype)).constructor=Fe).prototype.getDefault=function(){return mt.Color.transparent},Fe.prototype.set=function(t){var e=this.current;t.r===e.r&&t.g===e.g&&t.b===e.b&&t.a===e.a&&!this.dirty||(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)},Fe),te=((Lt=it)&&(Be.__proto__=Lt),((Be.prototype=Object.create(Lt&&Lt.prototype)).constructor=Be).prototype.getDefault=function(){return this.gl.FUNC_ADD},Be.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.blendEquation(t),this.current=t,this.dirty=!1)},Be),ee=((wt=it)&&(Re.__proto__=wt),((Re.prototype=Object.create(wt&&wt.prototype)).constructor=Re).prototype.getDefault=function(){return!1},Re.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),this.current=t,this.dirty=!1}},Re),ie=((bt=it)&&(Oe.__proto__=bt),((Oe.prototype=Object.create(bt&&bt.prototype)).constructor=Oe).prototype.getDefault=function(){return this.gl.BACK},Oe.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.cullFace(t),this.current=t,this.dirty=!1)},Oe),ne=((xt=it)&&(De.__proto__=xt),((De.prototype=Object.create(xt&&xt.prototype)).constructor=De).prototype.getDefault=function(){return this.gl.CCW},De.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.frontFace(t),this.current=t,this.dirty=!1)},De),oe=((vt=it)&&(Ae.__proto__=vt),((Ae.prototype=Object.create(vt&&vt.prototype)).constructor=Ae).prototype.getDefault=function(){return null},Ae.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.useProgram(t),this.current=t,this.dirty=!1)},Ae),re=((yt=it)&&(Ie.__proto__=yt),((Ie.prototype=Object.create(yt&&yt.prototype)).constructor=Ie).prototype.getDefault=function(){return this.gl.TEXTURE0},Ie.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.activeTexture(t),this.current=t,this.dirty=!1)},Ie),ae=((gt=it)&&(ze.__proto__=gt),((ze.prototype=Object.create(gt&>.prototype)).constructor=ze).prototype.getDefault=function(){var t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]},ze.prototype.set=function(t){var e=this.current;t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&!this.dirty||(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)},ze),se=((_t=it)&&(Pe.__proto__=_t),((Pe.prototype=Object.create(_t&&_t.prototype)).constructor=Pe).prototype.getDefault=function(){return null},Pe.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,t),this.current=t,this.dirty=!1}},Pe),le=((ft=it)&&(Se.__proto__=ft),((Se.prototype=Object.create(ft&&ft.prototype)).constructor=Se).prototype.getDefault=function(){return null},Se.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindRenderbuffer(e.RENDERBUFFER,t),this.current=t,this.dirty=!1}},Se),ue=((dt=it)&&(Ce.__proto__=dt),((Ce.prototype=Object.create(dt&&dt.prototype)).constructor=Ce).prototype.getDefault=function(){return null},Ce.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindTexture(e.TEXTURE_2D,t),this.current=t,this.dirty=!1}},Ce),ce=((pt=it)&&(Me.__proto__=pt),((Me.prototype=Object.create(pt&&pt.prototype)).constructor=Me).prototype.getDefault=function(){return null},Me.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindBuffer(e.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}},Me),he=((ht=it)&&(Ee.__proto__=ht),((Ee.prototype=Object.create(ht&&ht.prototype)).constructor=Ee).prototype.getDefault=function(){return null},Ee.prototype.set=function(t){var e=this.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1},Ee),pe=((ct=it)&&(Te.__proto__=ct),((Te.prototype=Object.create(ct&&ct.prototype)).constructor=Te).prototype.getDefault=function(){return null},Te.prototype.set=function(t){this.vao&&(t!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(t),this.current=t,this.dirty=!1)},Te),de=((ut=it)&&(ke.__proto__=ut),((ke.prototype=Object.create(ut&&ut.prototype)).constructor=ke).prototype.getDefault=function(){return 4},ke.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}},ke),fe=((lt=it)&&(Le.__proto__=lt),((Le.prototype=Object.create(lt&<.prototype)).constructor=Le).prototype.getDefault=function(){return!1},Le.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}},Le),me=((st=it)&&(we.__proto__=st),((we.prototype=Object.create(st&&st.prototype)).constructor=we).prototype.getDefault=function(){return!1},we.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}},we),_e=((at=it)&&(be.__proto__=at),((be.prototype=Object.create(at&&at.prototype)).constructor=be).prototype.getDefault=function(){return null},be),ge=((rt=_e)&&(xe.__proto__=rt),((xe.prototype=Object.create(rt&&rt.prototype)).constructor=xe).prototype.setDirty=function(){this.dirty=!0},xe.prototype.set=function(t){if(t!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var e=this.gl;e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}},xe),ye=((ot=_e)&&(ve.__proto__=ot),((ve.prototype=Object.create(ot&&ot.prototype)).constructor=ve).prototype.set=function(t){if(t!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var e=this.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1}},ve);function ve(){ot.apply(this,arguments)}function xe(){rt.apply(this,arguments)}function be(t,e){at.call(this,t),this.context=t,this.parent=e}function we(){st.apply(this,arguments)}function Le(){lt.apply(this,arguments)}function ke(){ut.apply(this,arguments)}function Te(t){ct.call(this,t),this.vao=t.extVertexArrayObject}function Ee(){ht.apply(this,arguments)}function Me(){pt.apply(this,arguments)}function Ce(){dt.apply(this,arguments)}function Se(){ft.apply(this,arguments)}function Pe(){_t.apply(this,arguments)}function ze(){gt.apply(this,arguments)}function Ie(){yt.apply(this,arguments)}function Ae(){vt.apply(this,arguments)}function De(){xt.apply(this,arguments)}function Oe(){bt.apply(this,arguments)}function Re(){wt.apply(this,arguments)}function Be(){Lt.apply(this,arguments)}function Fe(){kt.apply(this,arguments)}function Ue(){Tt.apply(this,arguments)}function Ne(){Et.apply(this,arguments)}function je(){Mt.apply(this,arguments)}function $e(){Ct.apply(this,arguments)}function Ve(){St.apply(this,arguments)}function Ze(){Pt.apply(this,arguments)}function Ge(){zt.apply(this,arguments)}function qe(){It.apply(this,arguments)}function He(){At.apply(this,arguments)}function We(){Dt.apply(this,arguments)}function Xe(){Ot.apply(this,arguments)}function Ke(){Rt.apply(this,arguments)}function Je(){Bt.apply(this,arguments)}function Ye(){Ft.apply(this,arguments)}nt.prototype.destroy=function(){var t=this.context.gl,e=this.colorAttachment.get();e&&t.deleteTexture(e);var i=this.depthAttachment.get();i&&t.deleteRenderbuffer(i),t.deleteFramebuffer(this.framebuffer)};var Qe=function(t,e,i){this.func=t,this.mask=e,this.range=i};Qe.ReadOnly=!1,Qe.ReadWrite=!0,Qe.disabled=new Qe(519,Qe.ReadOnly,[0,1]);var ti=function(t,e,i,n,o,r){this.test=t,this.ref=e,this.mask=i,this.fail=n,this.depthFail=o,this.pass=r};ti.disabled=new ti({func:519,mask:0},0,0,7680,7680,7680);function ei(t,e,i){this.blendFunction=t,this.blendColor=e,this.mask=i}ei.disabled=new ei(ei.Replace=[1,0],mt.Color.transparent,[!1,!1,!1,!1]),ei.unblended=new ei(ei.Replace,mt.Color.transparent,[!0,!0,!0,!0]),ei.alphaBlended=new ei([1,771],mt.Color.transparent,[!0,!0,!0,!0]);var ii=function(t,e,i){this.enable=t,this.mode=e,this.frontFace=i};ii.disabled=new ii(!1,1029,2305),ii.backCCW=new ii(!0,1029,2305);function ni(t){this.gl=t,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new Ut(this),this.clearDepth=new Nt(this),this.clearStencil=new jt(this),this.colorMask=new $t(this),this.depthMask=new Vt(this),this.stencilMask=new Zt(this),this.stencilFunc=new Gt(this),this.stencilOp=new qt(this),this.stencilTest=new Ht(this),this.depthRange=new Wt(this),this.depthTest=new Xt(this),this.depthFunc=new Kt(this),this.blend=new Jt(this),this.blendFunc=new Yt(this),this.blendColor=new Qt(this),this.blendEquation=new te(this),this.cullFace=new ee(this),this.cullFaceSide=new ie(this),this.frontFace=new ne(this),this.program=new oe(this),this.activeTexture=new re(this),this.viewport=new ae(this),this.bindFramebuffer=new se(this),this.bindRenderbuffer=new le(this),this.bindTexture=new ue(this),this.bindVertexBuffer=new ce(this),this.bindElementBuffer=new he(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new pe(this),this.pixelStoreUnpack=new de(this),this.pixelStoreUnpackPremultiplyAlpha=new fe(this),this.pixelStoreUnpackFlipY=new me(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=t.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&t.getExtension("OES_texture_half_float_linear")}ni.prototype.setDefault=function(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()},ni.prototype.setDirty=function(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0},ni.prototype.createIndexBuffer=function(t,e){return new Q(this,t,e)},ni.prototype.createVertexBuffer=function(t,e,i){return new tt(this,t,e,i)},ni.prototype.createRenderbuffer=function(t,e,i){var n=this.gl,o=n.createRenderbuffer();return this.bindRenderbuffer.set(o),n.renderbufferStorage(n.RENDERBUFFER,t,e,i),this.bindRenderbuffer.set(null),o},ni.prototype.createFramebuffer=function(t,e){return new nt(this,t,e)},ni.prototype.clear=function(t){var e=t.color,i=t.depth,n=this.gl,o=0;e&&(o|=n.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),void 0!==i&&(o|=n.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(i),this.depthMask.set(!0)),n.clear(o)},ni.prototype.setCullFace=function(t){!1===t.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))},ni.prototype.setDepthMode=function(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)},ni.prototype.setStencilMode=function(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)},ni.prototype.setColorMode=function(t){mt.deepEqual(t.blendFunction,ei.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(t.blendFunction),this.blendColor.set(t.blendColor)),this.colorMask.set(t.mask)},ni.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var oi,ri=((oi=mt.Evented)&&(ai.__proto__=oi),((ai.prototype=Object.create(oi&&oi.prototype)).constructor=ai).prototype.onAdd=function(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(t)},ai.prototype.onRemove=function(t){this._source&&this._source.onRemove&&this._source.onRemove(t)},ai.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;for(var t in this._tiles){var e=this._tiles[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}return!0},ai.prototype.getSource=function(){return this._source},ai.prototype.pause=function(){this._paused=!0},ai.prototype.resume=function(){if(this._paused){var t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform)}},ai.prototype._loadTile=function(t,e){return this._source.loadTile(t,e)},ai.prototype._unloadTile=function(t){if(this._source.unloadTile)return this._source.unloadTile(t,function(){})},ai.prototype._abortTile=function(t){if(this._source.abortTile)return this._source.abortTile(t,function(){})},ai.prototype.serialize=function(){return this._source.serialize()},ai.prototype.prepare=function(t){for(var e in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles){var i=this._tiles[e];i.upload(t),i.prepare(this.map.style.imageManager)}},ai.prototype.getIds=function(){return Object.keys(this._tiles).map(Number).sort(si)},ai.prototype.getRenderableIds=function(t){var a=this,e=[];for(var i in this._tiles)this._isIdRenderable(+i,t)&&e.push(+i);return t?e.sort(function(t,e){var i=a._tiles[t].tileID,n=a._tiles[e].tileID,o=new mt.Point(i.canonical.x,i.canonical.y)._rotate(a.transform.angle),r=new mt.Point(n.canonical.x,n.canonical.y)._rotate(a.transform.angle);return i.overscaledZ-n.overscaledZ||r.y-o.y||r.x-o.x}):e.sort(si)},ai.prototype.hasRenderableParent=function(t){var e=this.findLoadedParent(t,0);return!!e&&this._isIdRenderable(e.tileID.key)},ai.prototype._isIdRenderable=function(t,e){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(e||!this._tiles[t].holdingForFade())},ai.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var t in this._cache.reset(),this._tiles)"errored"!==this._tiles[t].state&&this._reloadTile(t,"reloading")},ai.prototype._reloadTile=function(t,e){var i=this._tiles[t];i&&("loading"!==i.state&&(i.state=e),this._loadTile(i,this._tileLoaded.bind(this,i,t,e)))},ai.prototype._tileLoaded=function(t,e,i,n){if(n)return t.state="errored",void(404!==n.status?this._source.fire(new mt.ErrorEvent(n,{tile:t})):this.update(this.transform));t.timeAdded=mt.browser.now(),"expired"===i&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(e,t),"raster-dem"===this.getSource().type&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),this._source.fire(new mt.Event("data",{dataType:"source",tile:t,coord:t.tileID}))},ai.prototype._backfillDEM=function(t){for(var e=this.getRenderableIds(),i=0;i<e.length;i++){var n=e[i];if(t.neighboringTiles&&t.neighboringTiles[n]){var o=this.getTileByID(n);r(t,o),r(o,t)}}function r(t,e){t.needsHillshadePrepare=!0;var i=e.tileID.canonical.x-t.tileID.canonical.x,n=e.tileID.canonical.y-t.tileID.canonical.y,o=Math.pow(2,t.tileID.canonical.z),r=e.tileID.key;0===i&&0==n||1<Math.abs(n)||(1<Math.abs(i)&&(1===Math.abs(i+o)?i+=o:1===Math.abs(i-o)&&(i-=o)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,i,n),t.neighboringTiles&&t.neighboringTiles[r]&&(t.neighboringTiles[r].backfilled=!0)))}},ai.prototype.getTile=function(t){return this.getTileByID(t.key)},ai.prototype.getTileByID=function(t){return this._tiles[t]},ai.prototype.getZoom=function(t){return t.zoom+t.scaleZoom(t.tileSize/this._source.tileSize)},ai.prototype._retainLoadedChildren=function(t,e,i,n){for(var o in this._tiles){var r=this._tiles[o];if(!(n[o]||!r.hasData()||r.tileID.overscaledZ<=e||r.tileID.overscaledZ>i)){for(var a=r.tileID;r&&r.tileID.overscaledZ>e+1;){var s=r.tileID.scaledTo(r.tileID.overscaledZ-1);(r=this._tiles[s.key])&&r.hasData()&&(a=s)}for(var l=a;l.overscaledZ>e;)if(t[(l=l.scaledTo(l.overscaledZ-1)).key]){n[a.key]=a;break}}}},ai.prototype.findLoadedParent=function(t,e){for(var i=t.overscaledZ-1;e<=i;i--){var n=t.scaledTo(i);if(!n)return;var o=String(n.key),r=this._tiles[o];if(r&&r.hasData())return r;if(this._cache.has(n))return this._cache.get(n)}},ai.prototype.updateCacheSize=function(t){var e=(Math.ceil(t.width/this._source.tileSize)+1)*(Math.ceil(t.height/this._source.tileSize)+1),i=Math.floor(5*e),n="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,i):i;this._cache.setMaxSize(n)},ai.prototype.handleWrapJump=function(t){var e=(t-(void 0===this._prevLng?t:this._prevLng))/360,i=Math.round(e);if(this._prevLng=t,i){var n={};for(var o in this._tiles){var r=this._tiles[o];r.tileID=r.tileID.unwrapTo(r.tileID.wrap+i),n[r.tileID.key]=r}for(var a in this._tiles=n,this._timers)clearTimeout(this._timers[a]),delete this._timers[a];for(var s in this._tiles){var l=this._tiles[s];this._setTileReloadTimer(s,l)}}},ai.prototype.update=function(t){var e=this;if(this.transform=t,this._sourceLoaded&&!this._paused){var i;this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?i=t.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(t){return new mt.OverscaledTileID(t.canonical.z,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y)}):(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 e._source.hasTile(t)}))):i=[];var n=(this._source.roundZoom?Math.round:Math.floor)(this.getZoom(t)),o=Math.max(n-ai.maxOverzooming,this._source.minzoom),r=Math.max(n+ai.maxUnderzooming,this._source.minzoom),a=this._updateRetainedTiles(i,n);if(li(this._source.type)){for(var s={},l={},u=0,c=Object.keys(a);u<c.length;u+=1){var h=c[u],p=a[h],d=this._tiles[h];if(d&&!(d.fadeEndTime&&d.fadeEndTime<=mt.browser.now())){var f=this.findLoadedParent(p,o);f&&(this._addTile(f.tileID),s[f.tileID.key]=f.tileID),l[h]=p}}for(var m in this._retainLoadedChildren(l,n,r,a),s)a[m]||(this._coveredTiles[m]=!0,a[m]=s[m])}for(var _ in a)this._tiles[_].clearFadeHold();for(var g=0,y=mt.keysDifference(this._tiles,a);g<y.length;g+=1){var v=y[g],x=this._tiles[v];x.hasSymbolBuckets&&!x.holdingForFade()?x.setHoldDuration(this.map._fadeDuration):x.hasSymbolBuckets&&!x.symbolFadeFinished()||this._removeTile(v)}}},ai.prototype.releaseSymbolFadeTiles=function(){for(var t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)},ai.prototype._updateRetainedTiles=function(t,e){for(var i={},n={},o=Math.max(e-ai.maxOverzooming,this._source.minzoom),r=Math.max(e+ai.maxUnderzooming,this._source.minzoom),a={},s=0,l=t;s<l.length;s+=1){var u=l[s],c=this._addTile(u);i[u.key]=u,c.hasData()||e<this._source.maxzoom&&(a[u.key]=u)}this._retainLoadedChildren(a,e,r,i);for(var h=0,p=t;h<p.length;h+=1){var d=p[h],f=this._tiles[d.key];if(!f.hasData()){if(e+1>this._source.maxzoom){var m=d.children(this._source.maxzoom)[0],_=this.getTile(m);if(_&&_.hasData()){i[m.key]=m;continue}}else{var g=d.children(this._source.maxzoom);if(i[g[0].key]&&i[g[1].key]&&i[g[2].key]&&i[g[3].key])continue}for(var y=f.wasRequested(),v=d.overscaledZ-1;o<=v;--v){var x=d.scaledTo(v);if(n[x.key])break;if(n[x.key]=!0,!(f=this.getTile(x))&&y&&(f=this._addTile(x)),f&&(i[x.key]=x,y=f.wasRequested(),f.hasData()))break}}}return i},ai.prototype._addTile=function(t){var e=this._tiles[t.key];if(e)return e;(e=this._cache.getAndRemove(t))&&(this._setTileReloadTimer(t.key,e),e.tileID=t,this._state.initializeTileState(e,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,e)));var i=Boolean(e);return i||(e=new mt.Tile(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(e,this._tileLoaded.bind(this,e,t.key,e.state))),e?(e.uses++,this._tiles[t.key]=e,i||this._source.fire(new mt.Event("dataloading",{tile:e,coord:e.tileID,dataType:"source"})),e):null},ai.prototype._setTileReloadTimer=function(t,e){var i=this;t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);var n=e.getExpiryTimeout();n&&(this._timers[t]=setTimeout(function(){i._reloadTile(t,"expired"),delete i._timers[t]},n))},ai.prototype._removeTile=function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),0<e.uses||(e.hasData()?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))},ai.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset()},ai.prototype.tilesIn=function(t,l,e){var u=this,c=[],h=this.transform;if(!h)return c;for(var i=e?h.getCameraQueryGeometry(t):t,p=t.map(function(t){return h.pointCoordinate(t)}),d=i.map(function(t){return h.pointCoordinate(t)}),f=this.getIds(),m=1/0,_=1/0,g=-1/0,y=-1/0,n=0,o=d;n<o.length;n+=1){var r=o[n];m=Math.min(m,r.x),_=Math.min(_,r.y),g=Math.max(g,r.x),y=Math.max(y,r.y)}for(var a=function(t){var e=u._tiles[f[t]];if(!e.holdingForFade()){var i=e.tileID,n=Math.pow(2,h.zoom-e.tileID.overscaledZ),o=l*e.queryPadding*mt.EXTENT/e.tileSize/n,r=[i.getTilePoint(new mt.MercatorCoordinate(m,_)),i.getTilePoint(new mt.MercatorCoordinate(g,y))];if(r[0].x-o<mt.EXTENT&&r[0].y-o<mt.EXTENT&&0<=r[1].x+o&&0<=r[1].y+o){var a=p.map(function(t){return i.getTilePoint(t)}),s=d.map(function(t){return i.getTilePoint(t)});c.push({tile:e,tileID:i,queryGeometry:a,cameraQueryGeometry:s,scale:n})}}},s=0;s<f.length;s++)a(s);return c},ai.prototype.getVisibleCoordinates=function(t){for(var e=this,i=this.getRenderableIds(t).map(function(t){return e._tiles[t].tileID}),n=0,o=i;n<o.length;n+=1){var r=o[n];r.posMatrix=this.transform.calculatePosMatrix(r.toUnwrapped())}return i},ai.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(li(this._source.type))for(var t in this._tiles){var e=this._tiles[t];if(void 0!==e.fadeEndTime&&e.fadeEndTime>=mt.browser.now())return!0}return!1},ai.prototype.setFeatureState=function(t,e,i){t=t||"_geojsonTileLayer",this._state.updateState(t,e,i)},ai.prototype.removeFeatureState=function(t,e,i){t=t||"_geojsonTileLayer",this._state.removeFeatureState(t,e,i)},ai.prototype.getFeatureState=function(t,e){return t=t||"_geojsonTileLayer",this._state.getState(t,e)},ai);function ai(t,e,i){var n=this;oi.call(this),this.id=t,this.dispatcher=i,this.on("data",function(t){"source"===t.dataType&&"metadata"===t.sourceDataType&&(n._sourceLoaded=!0),n._sourceLoaded&&!n._paused&&"source"===t.dataType&&"content"===t.sourceDataType&&(n.reload(),n.transform&&n.update(n.transform))}),this.on("error",function(){n._sourceErrored=!0}),this._source=function(t,e,i,n){var o=new H[e.type](t,e,i,n);if(o.id!==t)throw new Error("Expected Source id to be "+t+" instead of "+o.id);return mt.bindAll(["load","abort","unload","serialize","prepare"],o),o}(t,e,i,this),this._tiles={},this._cache=new Y(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._coveredTiles={},this._state=new mt.SourceFeatureState}function si(t,e){return t%32-e%32||e-t}function li(t){return"raster"===t||"image"===t||"video"===t}function ui(){return new mt.window.Worker(Lr.workerUrl)}ri.maxOverzooming=10,ri.maxUnderzooming=3;function ci(){this.active={}}ci.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length<ci.workerCount;)this.workers.push(new ui);return this.active[t]=!0,this.workers.slice()},ci.prototype.release=function(t){delete this.active[t],0===Object.keys(this.active).length&&(this.workers.forEach(function(t){t.terminate()}),this.workers=null)};var hi,pi=Math.floor(mt.browser.hardwareConcurrency/2);function di(t,e){var i={};for(var n in t)"ref"!==n&&(i[n]=t[n]);return mt.refProperties.forEach(function(t){t in e&&(i[t]=e[t])}),i}function fi(t){t=t.slice();for(var e=Object.create(null),i=0;i<t.length;i++)e[t[i].id]=t[i];for(var n=0;n<t.length;n++)"ref"in t[n]&&(t[n]=di(t[n],e[t[n].ref]));return t}ci.workerCount=Math.max(Math.min(pi,6),1);var mi={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function _i(t,e,i){i.push({command:mi.addSource,args:[t,e[t]]})}function gi(t,e,i){e.push({command:mi.removeSource,args:[t]}),i[t]=!0}function yi(t,e,i){var n;for(n in t[i])if(t[i].hasOwnProperty(n)&&"data"!==n&&!mt.deepEqual(t[i][n],e[i][n]))return!1;for(n in e[i])if(e[i].hasOwnProperty(n)&&"data"!==n&&!mt.deepEqual(t[i][n],e[i][n]))return!1;return!0}function vi(t,e,i,n,o,r){var a;for(a in e=e||{},t=t||{})t.hasOwnProperty(a)&&(mt.deepEqual(t[a],e[a])||i.push({command:r,args:[n,a,e[a],o]}));for(a in e)e.hasOwnProperty(a)&&!t.hasOwnProperty(a)&&(mt.deepEqual(t[a],e[a])||i.push({command:r,args:[n,a,e[a],o]}))}function xi(t){return t.id}function bi(t,e){return t[e.id]=e,t}function wi(t,e,i){var n=this.boxCells=[],o=this.circleCells=[];this.xCellCount=Math.ceil(t/i),this.yCellCount=Math.ceil(e/i);for(var r=0;r<this.xCellCount*this.yCellCount;r++)n.push([]),o.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=e,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/e,this.boxUid=0,this.circleUid=0}function Li(t,e,i,n,o){var r=mt.create();return e?(mt.scale(r,r,[1/o,1/o,1]),i||mt.rotateZ(r,r,n.angle)):mt.multiply(r,n.labelPlaneMatrix,t),r}function ki(t,e,i,n,o){if(e){var r=mt.clone(t);return mt.scale(r,r,[o,o,1]),i||mt.rotateZ(r,r,-n.angle),r}return n.glCoordMatrix}function Ti(t,e){var i=[t.x,t.y,0,1];Di(i,i,e);var n=i[3];return{point:new mt.Point(i[0]/n,i[1]/n),signedDistanceFromCamera:n}}function Ei(t,e,i,n,o,r,a,s){var l,u,c,h,p=n?t.textSizeData:t.iconSizeData,d=mt.evaluateSizeForZoom(p,i.transform.zoom),f=[256/i.width*2+1,256/i.height*2+1],m=n?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;m.clear();for(var _=t.lineVertexArray,g=n?t.text.placedSymbolArray:t.icon.placedSymbolArray,y=i.transform.width/i.transform.height,v=!1,x=0;x<g.length;x++){var b=g.get(x);if(b.hidden||b.writingMode===mt.WritingMode.vertical&&!v)Ai(b.numGlyphs,m);else{v=!1;var w=[b.anchorX,b.anchorY,0,1];if(mt.transformMat4(w,w,e),u=f,void 0,c=(l=w)[0]/l[3],h=l[1]/l[3],c>=-u[0]&&c<=u[0]&&h>=-u[1]&&h<=u[1]){var L=.5+w[3]/i.transform.cameraToCenterDistance*.5,k=mt.evaluateSizeForFeature(p,d,b),T=a?k*L:k/L,E=new mt.Point(b.anchorX,b.anchorY),M=Ti(E,o).point,C={},S=Si(b,T,!1,s,e,o,r,t.glyphOffsetArray,_,m,M,E,C,y);v=S.useVertical,(S.notEnoughRoom||v||S.needsFlipping&&Si(b,T,!0,s,e,o,r,t.glyphOffsetArray,_,m,M,E,C,y).notEnoughRoom)&&Ai(b.numGlyphs,m)}else Ai(b.numGlyphs,m)}}n?t.text.dynamicLayoutVertexBuffer.updateData(m):t.icon.dynamicLayoutVertexBuffer.updateData(m)}function Mi(t,e,i,n,o,r,a,s,l,u,c,h){var p=s.glyphStartIndex+s.numGlyphs,d=s.lineStartIndex,f=s.lineStartIndex+s.lineLength,m=e.getoffsetX(s.glyphStartIndex),_=e.getoffsetX(p-1),g=zi(t*m,i,n,o,r,a,s.segment,d,f,l,u,c,h);if(!g)return null;var y=zi(t*_,i,n,o,r,a,s.segment,d,f,l,u,c,h);return y?{first:g,last:y}:null}function Ci(t,e,i,n){return t===mt.WritingMode.horizontal&&Math.abs(i.y-e.y)>Math.abs(i.x-e.x)*n?{useVertical:!0}:(t===mt.WritingMode.vertical?e.y<i.y:e.x>i.x)?{needsFlipping:!0}:null}function Si(t,e,i,n,o,r,a,s,l,u,c,h,p,d){var f,m=e/24,_=t.lineOffsetX*m,g=t.lineOffsetY*m;if(1<t.numGlyphs){var y=t.glyphStartIndex+t.numGlyphs,v=t.lineStartIndex,x=t.lineStartIndex+t.lineLength,b=Mi(m,s,_,g,i,c,h,t,l,r,p,!1);if(!b)return{notEnoughRoom:!0};var w=Ti(b.first.point,a).point,L=Ti(b.last.point,a).point;if(n&&!i){var k=Ci(t.writingMode,w,L,d);if(k)return k}f=[b.first];for(var T=t.glyphStartIndex+1;T<y-1;T++)f.push(zi(m*s.getoffsetX(T),_,g,i,c,h,t.segment,v,x,l,r,p,!1));f.push(b.last)}else{if(n&&!i){var E=Ti(h,o).point,M=t.lineStartIndex+t.segment+1,C=new mt.Point(l.getx(M),l.gety(M)),S=Ti(C,o),P=0<S.signedDistanceFromCamera?S.point:Pi(h,C,E,1,o),z=Ci(t.writingMode,E,P,d);if(z)return z}var I=zi(m*s.getoffsetX(t.glyphStartIndex),_,g,i,c,h,t.segment,t.lineStartIndex,t.lineStartIndex+t.lineLength,l,r,p,!1);if(!I)return{notEnoughRoom:!0};f=[I]}for(var A=0,D=f;A<D.length;A+=1){var O=D[A];mt.addDynamicAttributes(u,O.point,O.angle)}return{}}function Pi(t,e,i,n,o){var r=Ti(t.add(t.sub(e)._unit()),o).point,a=i.sub(r);return i.add(a._mult(n/a.mag()))}function zi(t,e,i,n,o,r,a,s,l,u,c,h,p){var d=n?t-e:t+e,f=0<d?1:-1,m=0;n&&(f*=-1,m=Math.PI),f<0&&(m+=Math.PI);for(var _=0<f?s+a:s+a+1,g=_,y=o,v=o,x=0,b=0,w=Math.abs(d);x+b<=w;){if((_+=f)<s||l<=_)return null;if(v=y,void 0===(y=h[_])){var L=new mt.Point(u.getx(_),u.gety(_)),k=Ti(L,c);if(0<k.signedDistanceFromCamera)y=h[_]=k.point;else{var T=_-f;y=Pi(0===x?r:new mt.Point(u.getx(T),u.gety(T)),L,v,w-x+1,c)}}x+=b,b=v.dist(y)}var E=(w-x)/b,M=y.sub(v),C=M.mult(E)._add(v);return C._add(M._unit()._perp()._mult(i*f)),{point:C,angle:m+Math.atan2(y.y-v.y,y.x-v.x),tileDistance:p?{prevTileDistance:_-f===g?0:u.gettileUnitDistanceFromAnchor(_-f),lastSegmentViewportDistance:w-x}:null}}wi.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},wi.prototype.insert=function(t,e,i,n,o){this._forEachCell(e,i,n,o,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(i),this.bboxes.push(n),this.bboxes.push(o)},wi.prototype.insertCircle=function(t,e,i,n){this._forEachCell(e-n,i-n,e+n,i+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(i),this.circles.push(n)},wi.prototype._insertBoxCell=function(t,e,i,n,o,r){this.boxCells[o].push(r)},wi.prototype._insertCircleCell=function(t,e,i,n,o,r){this.circleCells[o].push(r)},wi.prototype._query=function(t,e,i,n,o,r){if(i<0||t>this.width||n<0||e>this.height)return!o&&[];var a=[];if(t<=0&&e<=0&&this.width<=i&&this.height<=n){if(o)return!0;for(var s=0;s<this.boxKeys.length;s++)a.push({key:this.boxKeys[s],x1:this.bboxes[4*s],y1:this.bboxes[4*s+1],x2:this.bboxes[4*s+2],y2:this.bboxes[4*s+3]});for(var l=0;l<this.circleKeys.length;l++){var u=this.circles[3*l],c=this.circles[3*l+1],h=this.circles[3*l+2];a.push({key:this.circleKeys[l],x1:u-h,y1:c-h,x2:u+h,y2:c+h})}return r?a.filter(r):a}var p={hitTest:o,seenUids:{box:{},circle:{}}};return this._forEachCell(t,e,i,n,this._queryCell,a,p,r),o?0<a.length:a},wi.prototype._queryCircle=function(t,e,i,n,o){var r=t-i,a=t+i,s=e-i,l=e+i;if(a<0||r>this.width||l<0||s>this.height)return!n&&[];var u=[],c={hitTest:n,circle:{x:t,y:e,radius:i},seenUids:{box:{},circle:{}}};return this._forEachCell(r,s,a,l,this._queryCellCircle,u,c,o),n?0<u.length:u},wi.prototype.query=function(t,e,i,n,o){return this._query(t,e,i,n,!1,o)},wi.prototype.hitTest=function(t,e,i,n,o){return this._query(t,e,i,n,!0,o)},wi.prototype.hitTestCircle=function(t,e,i,n){return this._queryCircle(t,e,i,!0,n)},wi.prototype._queryCell=function(t,e,i,n,o,r,a,s){var l=a.seenUids,u=this.boxCells[o];if(null!==u)for(var c=this.bboxes,h=0,p=u;h<p.length;h+=1){var d=p[h];if(!l.box[d]){l.box[d]=!0;var f=4*d;if(t<=c[2+f]&&e<=c[3+f]&&i>=c[0+f]&&n>=c[1+f]&&(!s||s(this.boxKeys[d]))){if(a.hitTest)return r.push(!0),!0;r.push({key:this.boxKeys[d],x1:c[f],y1:c[1+f],x2:c[2+f],y2:c[3+f]})}}}var m=this.circleCells[o];if(null!==m)for(var _=this.circles,g=0,y=m;g<y.length;g+=1){var v=y[g];if(!l.circle[v]){l.circle[v]=!0;var x=3*v;if(this._circleAndRectCollide(_[x],_[1+x],_[2+x],t,e,i,n)&&(!s||s(this.circleKeys[v]))){if(a.hitTest)return r.push(!0),!0;var b=_[x],w=_[1+x],L=_[2+x];r.push({key:this.circleKeys[v],x1:b-L,y1:w-L,x2:b+L,y2:w+L})}}}},wi.prototype._queryCellCircle=function(t,e,i,n,o,r,a,s){var l=a.circle,u=a.seenUids,c=this.boxCells[o];if(null!==c)for(var h=this.bboxes,p=0,d=c;p<d.length;p+=1){var f=d[p];if(!u.box[f]){u.box[f]=!0;var m=4*f;if(this._circleAndRectCollide(l.x,l.y,l.radius,h[0+m],h[1+m],h[2+m],h[3+m])&&(!s||s(this.boxKeys[f])))return r.push(!0),!0}}var _=this.circleCells[o];if(null!==_)for(var g=this.circles,y=0,v=_;y<v.length;y+=1){var x=v[y];if(!u.circle[x]){u.circle[x]=!0;var b=3*x;if(this._circlesCollide(g[b],g[1+b],g[2+b],l.x,l.y,l.radius)&&(!s||s(this.circleKeys[x])))return r.push(!0),!0}}},wi.prototype._forEachCell=function(t,e,i,n,o,r,a,s){for(var l=this._convertToXCellCoord(t),u=this._convertToYCellCoord(e),c=this._convertToXCellCoord(i),h=this._convertToYCellCoord(n),p=l;p<=c;p++)for(var d=u;d<=h;d++){var f=this.xCellCount*d+p;if(o.call(this,t,e,i,n,f,r,a,s))return}},wi.prototype._convertToXCellCoord=function(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))},wi.prototype._convertToYCellCoord=function(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))},wi.prototype._circlesCollide=function(t,e,i,n,o,r){var a=n-t,s=o-e,l=i+r;return a*a+s*s<l*l},wi.prototype._circleAndRectCollide=function(t,e,i,n,o,r,a){var s=(r-n)/2,l=Math.abs(t-(n+s));if(s+i<l)return!1;var u=(a-o)/2,c=Math.abs(e-(o+u));if(u+i<c)return!1;if(l<=s||c<=u)return!0;var h=l-s,p=c-u;return h*h+p*p<=i*i};var Ii=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Ai(t,e){for(var i=0;i<t;i++){var n=e.length;e.resize(n+4),e.float32.set(Ii,3*n)}}function Di(t,e,i){var n=e[0],o=e[1];return t[0]=i[0]*n+i[4]*o+i[12],t[1]=i[1]*n+i[5]*o+i[13],t[3]=i[3]*n+i[7]*o+i[15],t}function Oi(t,e,i){void 0===e&&(e=new wi(t.width+200,t.height+200,25)),void 0===i&&(i=new wi(t.width+200,t.height+200,25)),this.transform=t,this.grid=e,this.ignoredGrid=i,this.pitchfactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+100,this.screenBottomBoundary=t.height+100,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200}function Ri(t,e,i){t[e+4]=i?1:0}function Bi(t,e,i){return e*(mt.EXTENT/(t.tileSize*Math.pow(2,i-t.tileID.overscaledZ)))}Oi.prototype.placeCollisionBox=function(t,e,i,n,o){var r=this.projectAndGetPerspectiveRatio(n,t.anchorPointX,t.anchorPointY),a=i*r.perspectiveRatio,s=t.x1*a+r.point.x,l=t.y1*a+r.point.y,u=t.x2*a+r.point.x,c=t.y2*a+r.point.y;return!this.isInsideGrid(s,l,u,c)||!e&&this.grid.hitTest(s,l,u,c,o)?{box:[],offscreen:!1}:{box:[s,l,u,c],offscreen:this.isOffscreen(s,l,u,c)}},Oi.prototype.approximateTileDistance=function(t,e,i,n,o){var r=o?1:n/this.pitchfactor,a=t.lastSegmentViewportDistance*i;return t.prevTileDistance+a+(r-1)*a*Math.abs(Math.sin(e))},Oi.prototype.placeCollisionCircles=function(t,e,i,n,o,r,a,s,l,u,c,h,p){var d=[],f=this.projectAnchor(l,o.anchorX,o.anchorY),m=s/24,_=o.lineOffsetX*s,g=o.lineOffsetY*s,y=new mt.Point(o.anchorX,o.anchorY),v=Mi(m,a,_,g,!1,Ti(y,u).point,y,o,r,u,{},!0),x=!1,b=!1,w=!0,L=f.perspectiveRatio*n,k=1/(n*i),T=0,E=0;v&&(T=this.approximateTileDistance(v.first.tileDistance,v.first.angle,k,f.cameraDistance,h),E=this.approximateTileDistance(v.last.tileDistance,v.last.angle,k,f.cameraDistance,h));for(var M=0;M<t.length;M+=5){var C=t[M],S=t[M+1],P=t[M+2],z=t[M+3];if(!v||z<-T||E<z)Ri(t,M,!1);else{var I=this.projectPoint(l,C,S),A=P*L;if(0<d.length){var D=I.x-d[d.length-4],O=I.y-d[d.length-3];if(D*D+O*O<A*A*2&&M+8<t.length){var R=t[M+8];if(-T<R&&R<E){Ri(t,M,!1);continue}}}var B=M/5;d.push(I.x,I.y,A,B),Ri(t,M,!0);var F=I.x-A,U=I.y-A,N=I.x+A,j=I.y+A;if(w=w&&this.isOffscreen(F,U,N,j),b=b||this.isInsideGrid(F,U,N,j),!e&&this.grid.hitTestCircle(I.x,I.y,A,p)){if(!c)return{circles:[],offscreen:!1};x=!0}}}return{circles:x||!b?[]:d,offscreen:w}},Oi.prototype.queryRenderedSymbols=function(t){if(0===t.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};for(var e=[],i=1/0,n=1/0,o=-1/0,r=-1/0,a=0,s=t;a<s.length;a+=1){var l=s[a],u=new mt.Point(l.x+100,l.y+100);i=Math.min(i,u.x),n=Math.min(n,u.y),o=Math.max(o,u.x),r=Math.max(r,u.y),e.push(u)}for(var c={},h={},p=0,d=this.grid.query(i,n,o,r).concat(this.ignoredGrid.query(i,n,o,r));p<d.length;p+=1){var f=d[p],m=f.key;if(void 0===c[m.bucketInstanceId]&&(c[m.bucketInstanceId]={}),!c[m.bucketInstanceId][m.featureIndex]){var _=[new mt.Point(f.x1,f.y1),new mt.Point(f.x2,f.y1),new mt.Point(f.x2,f.y2),new mt.Point(f.x1,f.y2)];mt.polygonIntersectsPolygon(e,_)&&(c[m.bucketInstanceId][m.featureIndex]=!0,void 0===h[m.bucketInstanceId]&&(h[m.bucketInstanceId]=[]),h[m.bucketInstanceId].push(m.featureIndex))}}return h},Oi.prototype.insertCollisionBox=function(t,e,i,n,o){var r={bucketInstanceId:i,featureIndex:n,collisionGroupID:o};(e?this.ignoredGrid:this.grid).insert(r,t[0],t[1],t[2],t[3])},Oi.prototype.insertCollisionCircles=function(t,e,i,n,o){for(var r=e?this.ignoredGrid:this.grid,a={bucketInstanceId:i,featureIndex:n,collisionGroupID:o},s=0;s<t.length;s+=4)r.insertCircle(a,t[s],t[s+1],t[s+2])},Oi.prototype.projectAnchor=function(t,e,i){var n=[e,i,0,1];return Di(n,n,t),{perspectiveRatio:.5+this.transform.cameraToCenterDistance/n[3]*.5,cameraDistance:n[3]}},Oi.prototype.projectPoint=function(t,e,i){var n=[e,i,0,1];return Di(n,n,t),new mt.Point((n[0]/n[3]+1)/2*this.transform.width+100,(-n[1]/n[3]+1)/2*this.transform.height+100)},Oi.prototype.projectAndGetPerspectiveRatio=function(t,e,i){var n=[e,i,0,1];return Di(n,n,t),{point:new mt.Point((n[0]/n[3]+1)/2*this.transform.width+100,(-n[1]/n[3]+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/n[3]*.5}},Oi.prototype.isOffscreen=function(t,e,i,n){return i<100||t>=this.screenRightBoundary||n<100||e>this.screenBottomBoundary},Oi.prototype.isInsideGrid=function(t,e,i,n){return 0<=i&&t<this.gridRightBoundary&&0<=n&&e<this.gridBottomBoundary};function Fi(t,e,i,n){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):n&&i?1:0,this.placed=i}Fi.prototype.isHidden=function(){return 0===this.opacity&&!this.placed};function Ui(t,e,i,n,o){this.text=new Fi(t?t.text:null,e,i,o),this.icon=new Fi(t?t.icon:null,e,n,o)}Ui.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};function Ni(t,e,i){this.text=t,this.icon=e,this.skipFade=i}function ji(t,e,i,n,o){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=i,this.bucketIndex=n,this.tileID=o}function $i(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}}function Vi(t,e,i,n,o){var r=mt.getAnchorAlignment(t),a=-(r.horizontalAlign-.5)*e,s=-(r.verticalAlign-.5)*i,l=mt.evaluateRadialOffset(t,n);return new mt.Point(a+l[0]*o,s+l[1]*o)}$i.prototype.get=function(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){var e=++this.maxGroupID;this.collisionGroups[t]={ID:e,predicate:function(t){return t.collisionGroupID===e}}}return this.collisionGroups[t]};function Zi(t,e,i,n){this.transform=t.clone(),this.collisionIndex=new Oi(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=e,this.retainedQueryData={},this.collisionGroups=new $i(i),(this.prevPlacement=n)&&(n.prevPlacement=void 0)}function Gi(t,e,i,n,o){t.emplaceBack(e?1:0,i?1:0,n||0,o||0),t.emplaceBack(e?1:0,i?1:0,n||0,o||0),t.emplaceBack(e?1:0,i?1:0,n||0,o||0),t.emplaceBack(e?1:0,i?1:0,n||0,o||0)}Zi.prototype.placeLayerTile=function(t,e,i,n){var o=e.getBucket(t),r=e.latestFeatureIndex;if(o&&r&&t.id===o.layerIds[0]){var a=e.collisionBoxArray,s=o.layers[0].layout,l=Math.pow(2,this.transform.zoom-e.tileID.overscaledZ),u=e.tileSize/mt.EXTENT,c=this.transform.calculatePosMatrix(e.tileID.toUnwrapped()),h=Li(c,"map"===s.get("text-pitch-alignment"),"map"===s.get("text-rotation-alignment"),this.transform,Bi(e,1,this.transform.zoom)),p=Li(c,"map"===s.get("icon-pitch-alignment"),"map"===s.get("icon-rotation-alignment"),this.transform,Bi(e,1,this.transform.zoom));this.retainedQueryData[o.bucketInstanceId]=new ji(o.bucketInstanceId,r,o.sourceLayerIndex,o.index,e.tileID),this.placeLayerBucket(o,c,h,p,l,u,i,e.holdingForFade(),n,a)}},Zi.prototype.attemptAnchorPlacement=function(t,e,i,n,o,r,a,s,l,u,c,h,p,d){var f,m,_,g,y,v,x,b,w,L,k,T,E,M,C=Vi(t,i,n,o,r),S=this.collisionIndex.placeCollisionBox((m=e,_=C.x,g=C.y,y=a,v=s,x=this.transform.angle,b=m.x1,w=m.x2,L=m.y1,k=m.y2,T=m.anchorPointX,E=m.anchorPointY,M=new mt.Point(_,g),y&&M._rotate(v?x:-x),{x1:b+M.x,y1:L+M.y,x2:w+M.x,y2:k+M.y,anchorPointX:T,anchorPointY:E}),h,l,u,c.predicate);if(0<S.box.length)return this.prevPlacement&&this.prevPlacement.variableOffsets[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID].text&&(f=this.prevPlacement.variableOffsets[p.crossTileID].anchor),this.variableOffsets[p.crossTileID]={radialOffset:o,width:i,height:n,anchor:t,textBoxScale:r,prevAnchor:f},this.markUsedJustification(d,t,p),S},Zi.prototype.placeLayerBucket=function(T,E,M,t,C,S,P,z,I,e){var A=this,D=T.layers[0].layout,O=mt.evaluateSizeForZoom(T.textSizeData,this.transform.zoom),R=D.get("text-optional"),B=D.get("icon-optional"),F=D.get("text-allow-overlap"),i=D.get("icon-allow-overlap"),U=F&&(i||!T.hasIconData()||B),N=i&&(F||!T.hasTextData()||R),j=this.collisionGroups.get(T.sourceID),$="map"===D.get("text-rotation-alignment"),V="map"===D.get("text-pitch-alignment"),n="viewport-y"===D.get("symbol-z-order");!T.collisionArrays&&e&&T.deserializeCollisionBoxes(e);function o(t,e){if(!I[t.crossTileID])if(z)A.placements[t.crossTileID]=new Ni(!1,!1,!1);else{var i=!1,n=!1,o=!0,r=null,a=null,s=null,l=0,u=0;e.textFeatureIndex&&(l=e.textFeatureIndex);var c=e.textBox;if(c)if(D.get("text-variable-anchor")){var h=c.x2-c.x1,p=c.y2-c.y1,d=t.textBoxScale,f=D.get("text-variable-anchor");if(A.prevPlacement&&A.prevPlacement.variableOffsets[t.crossTileID]){var m=A.prevPlacement.variableOffsets[t.crossTileID];f[0]!==m.anchor&&(f=f.filter(function(t){return t!==m.anchor})).unshift(m.anchor)}for(var _=0,g=f;_<g.length;_+=1){var y=g[_];if(r=A.attemptAnchorPlacement(y,c,h,p,t.radialTextOffset,d,$,V,S,E,j,F,t,T)){i=!0;break}}if(!A.variableOffsets[t.crossTileID]&&A.prevPlacement){var v=A.prevPlacement.variableOffsets[t.crossTileID];v&&(A.variableOffsets[t.crossTileID]=v,A.markUsedJustification(T,v.anchor,t))}}else i=0<(r=A.collisionIndex.placeCollisionBox(c,D.get("text-allow-overlap"),S,E,j.predicate)).box.length;o=r&&r.offscreen;var x=e.textCircles;if(x){var b=T.text.placedSymbolArray.get(t.centerJustifiedTextSymbolIndex),w=mt.evaluateSizeForFeature(T.textSizeData,O,b);a=A.collisionIndex.placeCollisionCircles(x,D.get("text-allow-overlap"),C,S,b,T.lineVertexArray,T.glyphOffsetArray,w,E,M,P,V,j.predicate),i=D.get("text-allow-overlap")||0<a.circles.length,o=o&&a.offscreen}e.iconFeatureIndex&&(u=e.iconFeatureIndex),e.iconBox&&(n=0<(s=A.collisionIndex.placeCollisionBox(e.iconBox,D.get("icon-allow-overlap"),S,E,j.predicate)).box.length,o=o&&s.offscreen);var L=R||0===t.numHorizontalGlyphVertices&&0===t.numVerticalGlyphVertices,k=B||0===t.numIconVertices;L||k?k?L||(n=n&&i):i=n&&i:n=i=n&&i,i&&r&&A.collisionIndex.insertCollisionBox(r.box,D.get("text-ignore-placement"),T.bucketInstanceId,l,j.ID),n&&s&&A.collisionIndex.insertCollisionBox(s.box,D.get("icon-ignore-placement"),T.bucketInstanceId,u,j.ID),i&&a&&A.collisionIndex.insertCollisionCircles(a.circles,D.get("text-ignore-placement"),T.bucketInstanceId,l,j.ID),A.placements[t.crossTileID]=new Ni(i||U,n||N,o||T.justReloaded),I[t.crossTileID]=!0}}if(n)for(var r=T.getSortedSymbolIndexes(this.transform.angle),a=r.length-1;0<=a;--a){var s=r[a];o(T.symbolInstances.get(s),T.collisionArrays[s])}else for(var l=0;l<T.symbolInstances.length;++l)o(T.symbolInstances.get(l),T.collisionArrays[l]);T.justReloaded=!1},Zi.prototype.markUsedJustification=function(t,e,i){var n={left:i.leftJustifiedTextSymbolIndex,center:i.centerJustifiedTextSymbolIndex,right:i.rightJustifiedTextSymbolIndex},o=n[mt.getAnchorJustification(e)];for(var r in n){var a=n[r];0<=a&&(t.text.placedSymbolArray.get(a).crossTileID=0<=o&&a!==o?0:i.crossTileID)}},Zi.prototype.commit=function(t){this.commitTime=t;var e=this.prevPlacement,i=!1,n=e&&0!==this.fadeDuration?(this.commitTime-e.commitTime)/this.fadeDuration:1,o=e?e.opacities:{},r=e?e.variableOffsets:{};for(var a in this.placements){var s=this.placements[a],l=o[a];i=l?(this.opacities[a]=new Ui(l,n,s.text,s.icon),i||s.text!==l.text.placed||s.icon!==l.icon.placed):(this.opacities[a]=new Ui(null,n,s.text,s.icon,s.skipFade),i||s.text||s.icon)}for(var u in o){var c=o[u];if(!this.opacities[u]){var h=new Ui(c,n,!1,!1);h.isHidden()||(this.opacities[u]=h,i=i||c.text.placed||c.icon.placed)}}for(var p in r)this.variableOffsets[p]||!this.opacities[p]||this.opacities[p].isHidden()||(this.variableOffsets[p]=r[p]);i?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=e?e.lastPlacementChangeTime:t)},Zi.prototype.updateLayerOpacities=function(t,e){for(var i={},n=0,o=e;n<o.length;n+=1){var r=o[n],a=r.getBucket(t);a&&r.latestFeatureIndex&&t.id===a.layerIds[0]&&this.updateBucketOpacities(a,i,r.collisionBoxArray)}},Zi.prototype.updateBucketOpacities=function(e,t,i){e.hasTextData()&&e.text.opacityVertexArray.clear(),e.hasIconData()&&e.icon.opacityVertexArray.clear(),e.hasCollisionBoxData()&&e.collisionBox.collisionVertexArray.clear(),e.hasCollisionCircleData()&&e.collisionCircle.collisionVertexArray.clear();var n=e.layers[0].layout,o=new Ui(null,0,!1,!1,!0),r=n.get("text-allow-overlap"),a=n.get("icon-allow-overlap"),s=n.get("text-variable-anchor"),l="map"===n.get("text-rotation-alignment"),u="map"===n.get("text-pitch-alignment"),c=new Ui(null,0,r&&(a||!e.hasIconData()||n.get("icon-optional")),a&&(r||!e.hasTextData()||n.get("text-optional")),!0);!e.collisionArrays&&i&&(e.hasCollisionBoxData()||e.hasCollisionCircleData())&&e.deserializeCollisionBoxes(i);for(var h=0;h<e.symbolInstances.length;h++){var p=e.symbolInstances.get(h),d=p.numHorizontalGlyphVertices,f=p.numVerticalGlyphVertices,m=p.crossTileID,_=t[m],g=this.opacities[m];_?g=o:g||(g=c,this.opacities[m]=g),t[m]=!0;var y=0<d||0<f,v=0<p.numIconVertices;if(y){for(var x=Qi(g.text),b=(d+f)/4,w=0;w<b;w++)e.text.opacityVertexArray.emplaceBack(x);var L=g.text.isHidden()?1:0;[p.rightJustifiedTextSymbolIndex,p.centerJustifiedTextSymbolIndex,p.leftJustifiedTextSymbolIndex,p.verticalPlacedTextSymbolIndex].forEach(function(t){0<=t&&(e.text.placedSymbolArray.get(t).hidden=L)});var k=this.variableOffsets[p.crossTileID];k&&this.markUsedJustification(e,k.anchor,p)}if(v){for(var T=Qi(g.icon),E=0;E<p.numIconVertices/4;E++)e.icon.opacityVertexArray.emplaceBack(T);e.icon.placedSymbolArray.get(h).hidden=g.icon.isHidden()}if(e.hasCollisionBoxData()||e.hasCollisionCircleData()){var M=e.collisionArrays[h];if(M){if(M.textBox){var C=new mt.Point(0,0),S=!0;if(s){var P=this.variableOffsets[m];P?(C=Vi(P.anchor,P.width,P.height,P.radialOffset,P.textBoxScale),l&&C._rotate(u?this.transform.angle:-this.transform.angle)):S=!1}Gi(e.collisionBox.collisionVertexArray,g.text.placed,!S,C.x,C.y)}M.iconBox&&Gi(e.collisionBox.collisionVertexArray,g.icon.placed,!1);var z=M.textCircles;if(z&&e.hasCollisionCircleData())for(var I=0;I<z.length;I+=5){var A=_||0===z[I+4];Gi(e.collisionCircle.collisionVertexArray,g.text.placed,A)}}}}e.sortFeatures(this.transform.angle),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasCollisionBoxData()&&e.collisionBox.collisionVertexBuffer&&e.collisionBox.collisionVertexBuffer.updateData(e.collisionBox.collisionVertexArray),e.hasCollisionCircleData()&&e.collisionCircle.collisionVertexBuffer&&e.collisionCircle.collisionVertexBuffer.updateData(e.collisionCircle.collisionVertexArray)},Zi.prototype.symbolFadeChange=function(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration},Zi.prototype.hasTransitions=function(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration},Zi.prototype.stillRecent=function(t){return this.commitTime+this.fadeDuration>t},Zi.prototype.setStale=function(){this.stale=!0};var qi=Math.pow(2,25),Hi=Math.pow(2,24),Wi=Math.pow(2,17),Xi=Math.pow(2,16),Ki=Math.pow(2,9),Ji=Math.pow(2,8),Yi=Math.pow(2,1);function Qi(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,i=Math.floor(127*t.opacity);return i*qi+e*Hi+i*Wi+e*Xi+i*Ki+e*Ji+i*Yi+e}function tn(){this._currentTileIndex=0,this._seenCrossTileIDs={}}tn.prototype.continuePlacement=function(t,e,i,n,o){for(;this._currentTileIndex<t.length;){var r=t[this._currentTileIndex];if(e.placeLayerTile(n,r,i,this._seenCrossTileIDs),this._currentTileIndex++,o())return!0}};function en(t,e,i,n,o,r,a){this.placement=new Zi(t,o,r,a),this._currentPlacementIndex=e.length-1,this._forceFullPlacement=i,this._showCollisionBoxes=n,this._done=!1}en.prototype.isDone=function(){return this._done},en.prototype.continuePlacement=function(t,e,i){for(var n=this,o=mt.browser.now(),r=function(){var t=mt.browser.now()-o;return!n._forceFullPlacement&&2<t};0<=this._currentPlacementIndex;){var a=e[t[this._currentPlacementIndex]],s=this.placement.collisionIndex.transform.zoom;if("symbol"===a.type&&(!a.minzoom||a.minzoom<=s)&&(!a.maxzoom||a.maxzoom>s)){if(this._inProgressLayer||(this._inProgressLayer=new tn),this._inProgressLayer.continuePlacement(i[a.source],this.placement,this._showCollisionBoxes,a,r))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},en.prototype.commit=function(t){return this.placement.commit(t),this.placement};function nn(t,e,i){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=i;for(var n=0;n<e.length;n++){var o=e.get(n),r=o.key;this.indexedSymbolInstances[r]||(this.indexedSymbolInstances[r]=[]),this.indexedSymbolInstances[r].push({crossTileID:o.crossTileID,coord:this.getScaledCoordinates(o,t)})}}var on=512/mt.EXTENT/2;nn.prototype.getScaledCoordinates=function(t,e){var i=e.canonical.z-this.tileID.canonical.z,n=on/Math.pow(2,i);return{x:Math.floor((e.canonical.x*mt.EXTENT+t.anchorX)*n),y:Math.floor((e.canonical.y*mt.EXTENT+t.anchorY)*n)}},nn.prototype.findMatches=function(t,e,i){for(var n=this.tileID.canonical.z<e.canonical.z?1:Math.pow(2,this.tileID.canonical.z-e.canonical.z),o=0;o<t.length;o++){var r=t.get(o);if(!r.crossTileID){var a=this.indexedSymbolInstances[r.key];if(a)for(var s=this.getScaledCoordinates(r,e),l=0,u=a;l<u.length;l+=1){var c=u[l];if(Math.abs(c.coord.x-s.x)<=n&&Math.abs(c.coord.y-s.y)<=n&&!i[c.crossTileID]){i[c.crossTileID]=!0,r.crossTileID=c.crossTileID;break}}}}};function rn(){this.maxCrossTileID=0}rn.prototype.generate=function(){return++this.maxCrossTileID};function an(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}an.prototype.handleWrapJump=function(t){var e=Math.round((t-this.lng)/360);if(0!==e)for(var i in this.indexes){var n=this.indexes[i],o={};for(var r in n){var a=n[r];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+e),o[a.tileID.key]=a}this.indexes[i]=o}this.lng=t},an.prototype.addBucket=function(t,e,i){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===e.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(var n=0;n<e.symbolInstances.length;n++)e.symbolInstances.get(n).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});var o=this.usedCrossTileIDs[t.overscaledZ];for(var r in this.indexes){var a=this.indexes[r];if(Number(r)>t.overscaledZ)for(var s in a){var l=a[s];l.tileID.isChildOf(t)&&l.findMatches(e.symbolInstances,t,o)}else{var u=a[t.scaledTo(Number(r)).key];u&&u.findMatches(e.symbolInstances,t,o)}}for(var c=0;c<e.symbolInstances.length;c++){var h=e.symbolInstances.get(c);h.crossTileID||(h.crossTileID=i.generate(),o[h.crossTileID]=!0)}return void 0===this.indexes[t.overscaledZ]&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new nn(t,e.symbolInstances,e.bucketInstanceId),!0},an.prototype.removeBucketCrossTileIDs=function(t,e){for(var i in e.indexedSymbolInstances)for(var n=0,o=e.indexedSymbolInstances[i];n<o.length;n+=1){var r=o[n];delete this.usedCrossTileIDs[t][r.crossTileID]}},an.prototype.removeStaleBuckets=function(t){var e=!1;for(var i in this.indexes){var n=this.indexes[i];for(var o in n)t[n[o].bucketInstanceId]||(this.removeBucketCrossTileIDs(i,n[o]),delete n[o],e=!0)}return e};function sn(){this.layerIndexes={},this.crossTileIDs=new rn,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}sn.prototype.addLayer=function(t,e,i){var n=this.layerIndexes[t.id];void 0===n&&(n=this.layerIndexes[t.id]=new an);var o=!1,r={};n.handleWrapJump(i);for(var a=0,s=e;a<s.length;a+=1){var l=s[a],u=l.getBucket(t);u&&t.id===u.layerIds[0]&&(u.bucketInstanceId||(u.bucketInstanceId=++this.maxBucketInstanceId),n.addBucket(l.tileID,u,this.crossTileIDs)&&(o=!0),r[u.bucketInstanceId]=!0)}return n.removeStaleBuckets(r)&&(o=!0),o},sn.prototype.pruneUnusedLayers=function(t){var e={};for(var i in t.forEach(function(t){e[t]=!0}),this.layerIndexes)e[i]||delete this.layerIndexes[i]};function ln(t,e){return mt.emitValidationErrors(t,e&&e.filter(function(t){return"source.canvas"!==t.identifier}))}var un,cn=mt.pick(mi,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),hn=mt.pick(mi,["setCenter","setZoom","setBearing","setPitch"]),pn=((un=mt.Evented)&&(dn.__proto__=un),((dn.prototype=Object.create(un&&un.prototype)).constructor=dn).prototype.loadURL=function(t,e){var i=this;void 0===e&&(e={}),this.fire(new mt.Event("dataloading",{dataType:"style"}));var n="boolean"==typeof e.validate?e.validate:!mt.isMapboxURL(t);t=this.map._requestManager.normalizeStyleURL(t,e.accessToken);var o=this.map._requestManager.transformRequest(t,mt.ResourceType.Style);this._request=mt.getJSON(o,function(t,e){i._request=null,t?i.fire(new mt.ErrorEvent(t)):e&&i._load(e,n)})},dn.prototype.loadJSON=function(t,e){var i=this;void 0===e&&(e={}),this.fire(new mt.Event("dataloading",{dataType:"style"})),this._request=mt.browser.frame(function(){i._request=null,i._load(t,!1!==e.validate)})},dn.prototype._load=function(t,e){var i,n,h,p,d,f,o,r,a,s=this;if(!e||!ln(this,mt.validateStyle(t))){for(var l in this._loaded=!0,(this.stylesheet=t).sources)this.addSource(l,t.sources[l],{validate:!1});t.sprite?this._spriteRequest=(i=t.sprite,n=this.map._requestManager,h=function(t,e){if(s._spriteRequest=null,t)s.fire(new mt.ErrorEvent(t));else if(e)for(var i in e)s.imageManager.addImage(i,e[i]);s.imageManager.setLoaded(!0),s.fire(new mt.Event("data",{dataType:"style"}))},o=1<mt.browser.devicePixelRatio?"@2x":"",r=mt.getJSON(n.transformRequest(n.normalizeSpriteURL(i,o,".json"),mt.ResourceType.SpriteJSON),function(t,e){r=null,f||(f=t,p=e,g())}),a=mt.getImage(n.transformRequest(n.normalizeSpriteURL(i,o,".png"),mt.ResourceType.SpriteImage),function(t,e){a=null,f||(f=t,d=e,g())}),{cancel:function(){r&&(r.cancel(),r=null),a&&(a.cancel(),a=null)}}):this.imageManager.setLoaded(!0),this.glyphManager.setURL(t.glyphs);var u=fi(this.stylesheet.layers);this._order=u.map(function(t){return t.id}),this._layers={};for(var c=0,m=u;c<m.length;c+=1){var _=m[c];(_=mt.createStyleLayer(_)).setEventedParent(this,{layer:{id:_.id}}),this._layers[_.id]=_}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new L(this.stylesheet.light),this.fire(new mt.Event("data",{dataType:"style"})),this.fire(new mt.Event("style.load"))}function g(){if(f)h(f);else if(p&&d){var t=mt.browser.getImageData(d),e={};for(var i in p){var n=p[i],o=n.width,r=n.height,a=n.x,s=n.y,l=n.sdf,u=n.pixelRatio,c=new mt.RGBAImage({width:o,height:r});mt.RGBAImage.copy(t,c,{x:a,y:s},{x:0,y:0},{width:o,height:r}),e[i]={data:c,pixelRatio:u,sdf:l}}h(null,e)}}},dn.prototype._validateLayer=function(t){var e=this.sourceCaches[t.source];if(e){var i=t.sourceLayer;if(i){var n=e.getSource();("geojson"===n.type||n.vectorLayerIds&&-1===n.vectorLayerIds.indexOf(i))&&this.fire(new mt.ErrorEvent(new Error('Source layer "'+i+'" does not exist on source "'+n.id+'" as specified by style layer "'+t.id+'"')))}}},dn.prototype.loaded=function(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()},dn.prototype._serializeLayers=function(t){for(var e=[],i=0,n=t;i<n.length;i+=1){var o=n[i],r=this._layers[o];"custom"!==r.type&&e.push(r.serialize())}return e},dn.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(var e in this._layers)if(this._layers[e].hasTransition())return!0;return!1},dn.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},dn.prototype.update=function(t){if(this._loaded){var e=this._changed;if(this._changed){var i=Object.keys(this._updatedLayers),n=Object.keys(this._removedLayers);for(var o in(i.length||n.length)&&this._updateWorkerLayers(i,n),this._updatedSources){var r=this._updatedSources[o];"reload"===r?this._reloadSource(o):"clear"===r&&this._clearSource(o)}for(var a in this._updatedPaintProps)this._layers[a].updateTransitions(t);this.light.updateTransitions(t),this._resetUpdates()}for(var s in this.sourceCaches)this.sourceCaches[s].used=!1;for(var l=0,u=this._order;l<u.length;l+=1){var c=u[l],h=this._layers[c];h.recalculate(t),!h.isHidden(t.zoom)&&h.source&&(this.sourceCaches[h.source].used=!0)}this.light.recalculate(t),this.z=t.zoom,e&&this.fire(new mt.Event("data",{dataType:"style"}))}},dn.prototype._updateWorkerLayers=function(t,e){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(t),removedIds:e})},dn.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={}},dn.prototype.setState=function(t){var e=this;if(this._checkLoaded(),ln(this,mt.validateStyle(t)))return!1;(t=mt.clone$1(t)).layers=fi(t.layers);var i=function(t,e){if(!t)return[{command:mi.setStyle,args:[e]}];var i=[];try{if(!mt.deepEqual(t.version,e.version))return[{command:mi.setStyle,args:[e]}];mt.deepEqual(t.center,e.center)||i.push({command:mi.setCenter,args:[e.center]}),mt.deepEqual(t.zoom,e.zoom)||i.push({command:mi.setZoom,args:[e.zoom]}),mt.deepEqual(t.bearing,e.bearing)||i.push({command:mi.setBearing,args:[e.bearing]}),mt.deepEqual(t.pitch,e.pitch)||i.push({command:mi.setPitch,args:[e.pitch]}),mt.deepEqual(t.sprite,e.sprite)||i.push({command:mi.setSprite,args:[e.sprite]}),mt.deepEqual(t.glyphs,e.glyphs)||i.push({command:mi.setGlyphs,args:[e.glyphs]}),mt.deepEqual(t.transition,e.transition)||i.push({command:mi.setTransition,args:[e.transition]}),mt.deepEqual(t.light,e.light)||i.push({command:mi.setLight,args:[e.light]});var n={},o=[];!function(t,e,i,n){var o,r,a,s;for(o in e=e||{},t=t||{})t.hasOwnProperty(o)&&(e.hasOwnProperty(o)||gi(o,i,n));for(o in e)e.hasOwnProperty(o)&&(t.hasOwnProperty(o)?mt.deepEqual(t[o],e[o])||("geojson"===t[o].type&&"geojson"===e[o].type&&yi(t,e,o)?i.push({command:mi.setGeoJSONSourceData,args:[o,e[o].data]}):(a=e,gi(r=o,s=i,n),_i(r,a,s))):_i(o,e,i))}(t.sources,e.sources,o,n);var r=[];t.layers&&t.layers.forEach(function(t){n[t.source]?i.push({command:mi.removeLayer,args:[t.id]}):r.push(t)}),i=i.concat(o),function(t,e,i){e=e||[];var n,o,r,a,s,l,u,c=(t=t||[]).map(xi),h=e.map(xi),p=t.reduce(bi,{}),d=e.reduce(bi,{}),f=c.slice(),m=Object.create(null);for(o=n=0;n<c.length;n++)r=c[n],d.hasOwnProperty(r)?o++:(i.push({command:mi.removeLayer,args:[r]}),f.splice(f.indexOf(r,o),1));for(o=n=0;n<h.length;n++)r=h[h.length-1-n],f[f.length-1-n]!==r&&(p.hasOwnProperty(r)?(i.push({command:mi.removeLayer,args:[r]}),f.splice(f.lastIndexOf(r,f.length-o),1)):o++,l=f[f.length-n],i.push({command:mi.addLayer,args:[d[r],l]}),f.splice(f.length-n,0,r),m[r]=!0);for(n=0;n<h.length;n++)if(a=p[r=h[n]],s=d[r],!m[r]&&!mt.deepEqual(a,s))if(mt.deepEqual(a.source,s.source)&&mt.deepEqual(a["source-layer"],s["source-layer"])&&mt.deepEqual(a.type,s.type)){for(u in vi(a.layout,s.layout,i,r,null,mi.setLayoutProperty),vi(a.paint,s.paint,i,r,null,mi.setPaintProperty),mt.deepEqual(a.filter,s.filter)||i.push({command:mi.setFilter,args:[r,s.filter]}),mt.deepEqual(a.minzoom,s.minzoom)&&mt.deepEqual(a.maxzoom,s.maxzoom)||i.push({command:mi.setLayerZoomRange,args:[r,s.minzoom,s.maxzoom]}),a)a.hasOwnProperty(u)&&"layout"!==u&&"paint"!==u&&"filter"!==u&&"metadata"!==u&&"minzoom"!==u&&"maxzoom"!==u&&(0===u.indexOf("paint.")?vi(a[u],s[u],i,r,u.slice(6),mi.setPaintProperty):mt.deepEqual(a[u],s[u])||i.push({command:mi.setLayerProperty,args:[r,u,s[u]]}));for(u in s)s.hasOwnProperty(u)&&!a.hasOwnProperty(u)&&"layout"!==u&&"paint"!==u&&"filter"!==u&&"metadata"!==u&&"minzoom"!==u&&"maxzoom"!==u&&(0===u.indexOf("paint.")?vi(a[u],s[u],i,r,u.slice(6),mi.setPaintProperty):mt.deepEqual(a[u],s[u])||i.push({command:mi.setLayerProperty,args:[r,u,s[u]]}))}else i.push({command:mi.removeLayer,args:[r]}),l=f[f.lastIndexOf(r)+1],i.push({command:mi.addLayer,args:[s,l]})}(r,e.layers,i)}catch(t){console.warn("Unable to compute style diff:",t),i=[{command:mi.setStyle,args:[e]}]}return i}(this.serialize(),t).filter(function(t){return!(t.command in hn)});if(0===i.length)return!1;var n=i.filter(function(t){return!(t.command in cn)});if(0<n.length)throw new Error("Unimplemented: "+n.map(function(t){return t.command}).join(", ")+".");return i.forEach(function(t){"setTransition"!==t.command&&e[t.command].apply(e,t.args)}),this.stylesheet=t,!0},dn.prototype.addImage=function(t,e){if(this.getImage(t))return this.fire(new mt.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(t,e),this.fire(new mt.Event("data",{dataType:"style"}))},dn.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e)},dn.prototype.getImage=function(t){return this.imageManager.getImage(t)},dn.prototype.removeImage=function(t){if(!this.getImage(t))return this.fire(new mt.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(t),this.fire(new mt.Event("data",{dataType:"style"}))},dn.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},dn.prototype.addSource=function(t,e,i){var n=this;if(void 0===i&&(i={}),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(!(0<=["vector","raster","geojson","video","image"].indexOf(e.type)&&this._validate(mt.validateStyle.source,"sources."+t,e,null,i))){this.map&&this.map._collectResourceTiming&&(e.collectResourceTiming=!0);var o=this.sourceCaches[t]=new ri(t,e,this.dispatcher);o.style=this,o.setEventedParent(this,function(){return{isSourceLoaded:n.loaded(),source:o.serialize(),sourceId:t}}),o.onAdd(this.map),this._changed=!0}},dn.prototype.removeSource=function(t){if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error("There is no source with this ID");for(var e in this._layers)if(this._layers[e].source===t)return this.fire(new mt.ErrorEvent(new Error('Source "'+t+'" cannot be removed while layer "'+e+'" is using it.')));var i=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],i.fire(new mt.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),i.setEventedParent(null),i.clearTiles(),i.onRemove&&i.onRemove(this.map),this._changed=!0},dn.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},dn.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},dn.prototype.addLayer=function(t,e,i){void 0===i&&(i={}),this._checkLoaded();var n=t.id;if(this.getLayer(n))this.fire(new mt.ErrorEvent(new Error('Layer with id "'+n+'" already exists on this map')));else{var o;if("custom"===t.type){if(ln(this,mt.validateCustomStyleLayer(t)))return;o=mt.createStyleLayer(t)}else{if("object"==typeof t.source&&(this.addSource(n,t.source),t=mt.clone$1(t),t=mt.extend(t,{source:n})),this._validate(mt.validateStyle.layer,"layers."+n,t,{arrayIndex:-1},i))return;o=mt.createStyleLayer(t),this._validateLayer(o),o.setEventedParent(this,{layer:{id:n}})}var r=e?this._order.indexOf(e):this._order.length;if(e&&-1===r)this.fire(new mt.ErrorEvent(new Error('Layer with id "'+e+'" does not exist on this map.')));else{if(this._order.splice(r,0,n),this._layerOrderChanged=!0,this._layers[n]=o,this._removedLayers[n]&&o.source&&"custom"!==o.type){var a=this._removedLayers[n];delete this._removedLayers[n],a.type!==o.type?this._updatedSources[o.source]="clear":(this._updatedSources[o.source]="reload",this.sourceCaches[o.source].pause())}this._updateLayer(o),o.onAdd&&o.onAdd(this.map)}}},dn.prototype.moveLayer=function(t,e){if(this._checkLoaded(),this._changed=!0,this._layers[t]){if(t!==e){var i=this._order.indexOf(t);this._order.splice(i,1);var n=e?this._order.indexOf(e):this._order.length;e&&-1===n?this.fire(new mt.ErrorEvent(new Error('Layer with id "'+e+'" does not exist on this map.'))):(this._order.splice(n,0,t),this._layerOrderChanged=!0)}}else this.fire(new mt.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be moved.")))},dn.prototype.removeLayer=function(t){this._checkLoaded();var e=this._layers[t];if(e){e.setEventedParent(null);var i=this._order.indexOf(t);this._order.splice(i,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=e,delete this._layers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],e.onRemove&&e.onRemove(this.map)}else this.fire(new mt.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be removed.")))},dn.prototype.getLayer=function(t){return this._layers[t]},dn.prototype.setLayerZoomRange=function(t,e,i){this._checkLoaded();var n=this.getLayer(t);n?n.minzoom===e&&n.maxzoom===i||(null!=e&&(n.minzoom=e),null!=i&&(n.maxzoom=i),this._updateLayer(n)):this.fire(new mt.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot have zoom extent.")))},dn.prototype.setFilter=function(t,e,i){void 0===i&&(i={}),this._checkLoaded();var n=this.getLayer(t);if(n){if(!mt.deepEqual(n.filter,e))return null==e?(n.filter=void 0,void this._updateLayer(n)):void(this._validate(mt.validateStyle.filter,"layers."+n.id+".filter",e,null,i)||(n.filter=mt.clone$1(e),this._updateLayer(n)))}else this.fire(new mt.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be filtered.")))},dn.prototype.getFilter=function(t){return mt.clone$1(this.getLayer(t).filter)},dn.prototype.setLayoutProperty=function(t,e,i,n){void 0===n&&(n={}),this._checkLoaded();var o=this.getLayer(t);o?mt.deepEqual(o.getLayoutProperty(e),i)||(o.setLayoutProperty(e,i,n),this._updateLayer(o)):this.fire(new mt.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be styled.")))},dn.prototype.getLayoutProperty=function(t,e){var i=this.getLayer(t);if(i)return i.getLayoutProperty(e);this.fire(new mt.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style.")))},dn.prototype.setPaintProperty=function(t,e,i,n){void 0===n&&(n={}),this._checkLoaded();var o=this.getLayer(t);o?mt.deepEqual(o.getPaintProperty(e),i)||(o.setPaintProperty(e,i,n)&&this._updateLayer(o),this._changed=!0,this._updatedPaintProps[t]=!0):this.fire(new mt.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be styled.")))},dn.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},dn.prototype.setFeatureState=function(t,e){this._checkLoaded();var i=t.source,n=t.sourceLayer,o=this.sourceCaches[i],r=parseInt(t.id,10);if(void 0!==o){var a=o.getSource().type;"geojson"===a&&n?this.fire(new mt.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==a||n?isNaN(r)||r<0?this.fire(new mt.ErrorEvent(new Error("The feature id parameter must be provided and non-negative."))):o.setFeatureState(n,r,e):this.fire(new mt.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new mt.ErrorEvent(new Error("The source '"+i+"' does not exist in the map's style.")))},dn.prototype.removeFeatureState=function(t,e){this._checkLoaded();var i=t.source,n=this.sourceCaches[i];if(void 0!==n){var o=n.getSource().type,r="vector"===o?t.sourceLayer:void 0,a=parseInt(t.id,10);"vector"!==o||r?void 0!==t.id&&isNaN(a)||a<0?this.fire(new mt.ErrorEvent(new Error("The feature id parameter must be non-negative."))):e&&"string"!=typeof t.id&&"number"!=typeof t.id?this.fire(new mt.ErrorEvent(new Error("A feature id is requred to remove its specific state property."))):n.removeFeatureState(r,a,e):this.fire(new mt.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new mt.ErrorEvent(new Error("The source '"+i+"' does not exist in the map's style.")))},dn.prototype.getFeatureState=function(t){this._checkLoaded();var e=t.source,i=t.sourceLayer,n=this.sourceCaches[e],o=parseInt(t.id,10);if(void 0!==n)if("vector"!==n.getSource().type||i){if(!(isNaN(o)||o<0))return n.getFeatureState(i,o);this.fire(new mt.ErrorEvent(new Error("The feature id parameter must be provided and non-negative.")))}else this.fire(new mt.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));else this.fire(new mt.ErrorEvent(new Error("The source '"+e+"' does not exist in the map's style.")))},dn.prototype.getTransition=function(){return mt.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},dn.prototype.serialize=function(){return mt.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:mt.mapObject(this.sourceCaches,function(t){return t.serialize()}),layers:this._serializeLayers(this._order)},function(t){return void 0!==t})},dn.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},dn.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,i=function(t){return"fill-extrusion"===e._layers[t].type},n={},o=[],r=this._order.length-1;0<=r;r--){var a=this._order[r];if(i(a)){n[a]=r;for(var s=0,l=t;s<l.length;s+=1){var u=l[s][a];if(u)for(var c=0,h=u;c<h.length;c+=1){var p=h[c];o.push(p)}}}}o.sort(function(t,e){return e.intersectionZ-t.intersectionZ});for(var d=[],f=this._order.length-1;0<=f;f--){var m=this._order[f];if(i(m))for(var _=o.length-1;0<=_;_--){var g=o[_].feature;if(n[g.layer.id]<f)break;d.push(g),o.pop()}else for(var y=0,v=t;y<v.length;y+=1){var x=v[y][m];if(x)for(var b=0,w=x;b<w.length;b+=1){var L=w[b];d.push(L.feature)}}}return d},dn.prototype.queryRenderedFeatures=function(t,e,i){e&&e.filter&&this._validate(mt.validateStyle.filter,"queryRenderedFeatures.filter",e.filter,null,e);var n={};if(e&&e.layers){if(!Array.isArray(e.layers))return this.fire(new mt.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var o=0,r=e.layers;o<r.length;o+=1){var a=r[o],s=this._layers[a];if(!s)return this.fire(new mt.ErrorEvent(new Error("The layer '"+a+"' does not exist in the map's style and cannot be queried for features."))),[];n[s.source]=!0}}var l=[];for(var u in this.sourceCaches)e.layers&&!n[u]||l.push(K(this.sourceCaches[u],this._layers,t,e,i));return this.placement&&l.push(function(l,r,t,u,e,i){for(var c={},h=e.queryRenderedSymbols(t),n=[],o=0,a=Object.keys(h).map(Number);o<a.length;o+=1){var s=a[o];n.push(i[s])}n.sort(J);for(var p=function(){var o=f[d],t=o.featureIndex.lookupSymbolFeatures(h[o.bucketInstanceId],o.bucketIndex,o.sourceLayerIndex,u.filter,u.layers,l);for(var e in t){var i=c[e]=c[e]||[],n=t[e];n.sort(function(t,e){var i=o.featureSortOrder;if(i){var n=i.indexOf(t.featureIndex);return i.indexOf(e.featureIndex)-n}return e.featureIndex-t.featureIndex});for(var r=0,a=n;r<a.length;r+=1){var s=a[r];i.push(s)}}},d=0,f=n;d<f.length;d+=1)p();function m(o){c[o].forEach(function(t){var e=t.feature,i=l[o],n=r[i.source].getFeatureState(e.layer["source-layer"],e.id);e.source=e.layer.source,e.layer["source-layer"]&&(e.sourceLayer=e.layer["source-layer"]),e.state=n})}for(var _ in c)m(_);return c}(this._layers,this.sourceCaches,t,e,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(l)},dn.prototype.querySourceFeatures=function(t,e){e&&e.filter&&this._validate(mt.validateStyle.filter,"querySourceFeatures.filter",e.filter,null,e);var i=this.sourceCaches[t];return i?function(e,t){for(var i=e.getRenderableIds().map(function(t){return e.getTileByID(t)}),n=[],o={},r=0;r<i.length;r++){var a=i[r],s=a.tileID.canonical.key;o[s]||(o[s]=!0,a.querySourceFeatures(n,t))}return n}(i,e):[]},dn.prototype.addSourceType=function(t,e,i){return dn.getSourceType(t)?i(new Error('A source type called "'+t+'" already exists.')):(dn.setSourceType(t,e),e.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:e.workerSourceURL},i):i(null,null))},dn.prototype.getLight=function(){return this.light.getLight()},dn.prototype.setLight=function(t,e){void 0===e&&(e={}),this._checkLoaded();var i=this.light.getLight(),n=!1;for(var o in t)if(!mt.deepEqual(t[o],i[o])){n=!0;break}if(n){var r={now:mt.browser.now(),transition:mt.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,e),this.light.updateTransitions(r)}},dn.prototype._validate=function(t,e,i,n,o){return void 0===o&&(o={}),(!o||!1!==o.validate)&&ln(this,t.call(mt.validateStyle,mt.extend({key:e,style:this.serialize(),value:i,styleSpec:mt.styleSpec},n)))},dn.prototype._remove=function(){for(var t in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),mt.evented.off("pluginAvailable",this._rtlTextPluginCallback),this.sourceCaches)this.sourceCaches[t].clearTiles();this.dispatcher.remove()},dn.prototype._clearSource=function(t){this.sourceCaches[t].clearTiles()},dn.prototype._reloadSource=function(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload()},dn.prototype._updateSources=function(t){for(var e in this.sourceCaches)this.sourceCaches[e].update(t)},dn.prototype._generateCollisionBoxes=function(){for(var t in this.sourceCaches)this._reloadSource(t)},dn.prototype._updatePlacement=function(t,e,i,n){for(var o=!1,r=!1,a={},s=0,l=this._order;s<l.length;s+=1){var u=l[s],c=this._layers[u];if("symbol"===c.type){if(!a[c.source]){var h=this.sourceCaches[c.source];a[c.source]=h.getRenderableIds(!0).map(function(t){return h.getTileByID(t)}).sort(function(t,e){return e.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(e.tileID)?-1:1)})}var p=this.crossTileSymbolIndex.addLayer(c,a[c.source],t.center.lng);o=o||p}}this.crossTileSymbolIndex.pruneUnusedLayers(this._order);var d=this._layerOrderChanged||0===i;if((d||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(mt.browser.now()))&&(this.pauseablePlacement=new en(t,this._order,d,e,i,n,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,a),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(mt.browser.now()),r=!0),o&&this.pauseablePlacement.placement.setStale()),r||o)for(var f=0,m=this._order;f<m.length;f+=1){var _=m[f],g=this._layers[_];"symbol"===g.type&&this.placement.updateLayerOpacities(g,a[g.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(mt.browser.now())},dn.prototype._releaseSymbolFadeTiles=function(){for(var t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()},dn.prototype.getImages=function(t,e,i){this.imageManager.getImages(e.icons,i)},dn.prototype.getGlyphs=function(t,e,i){this.glyphManager.getGlyphs(e.stacks,i)},dn.prototype.getResource=function(t,e,i){return mt.makeRequest(e,i)},dn);function dn(t,e){var r=this;void 0===e&&(e={}),un.call(this),this.map=t,this.dispatcher=new T((hi||(hi=new ci),hi),this),this.imageManager=new c,this.imageManager.setEventedParent(this),this.glyphManager=new g(t._requestManager,e.localIdeographFontFamily),this.lineAtlas=new x(256,512),this.crossTileSymbolIndex=new sn,this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new mt.ZoomHistory,this._loaded=!1,this._resetUpdates(),this.dispatcher.broadcast("setReferrer",mt.getReferrer());var i=this;this._rtlTextPluginCallback=dn.registerForPluginAvailability(function(t){for(var e in i.dispatcher.broadcast("loadRTLTextPlugin",t.pluginURL,t.completionCallback),i.sourceCaches)i.sourceCaches[e].reload()}),this.on("data",function(t){if("source"===t.dataType&&"metadata"===t.sourceDataType){var e=r.sourceCaches[t.sourceId];if(e){var i=e.getSource();if(i&&i.vectorLayerIds)for(var n in r._layers){var o=r._layers[n];o.source===i.id&&r._validateLayer(o)}}}})}pn.getSourceType=function(t){return H[t]},pn.setSourceType=function(t,e){H[t]=e},pn.registerForPluginAvailability=mt.registerForPluginAvailability;var fn=mt.createLayout([{name:"a_pos",type:"Int16",components:2}]),mn=Nn("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}"),_n=Nn("uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),gn=Nn("uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);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);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);}"),yn=Nn("varying vec3 v_data;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,0,1);} else {gl_Position=u_matrix*vec4(circle_center,0,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}"),vn=Nn("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),xn=Nn("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}"),bn=Nn("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),wn=Nn("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),Ln=Nn("uniform float u_overscale_factor;varying float v_placed;varying float v_notUsed;varying float v_radius;varying vec2 v_extrude;varying vec2 v_extrude_scale;void main() {float alpha=0.5;vec4 color=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {color=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {color*=.2;}float extrude_scale_length=length(v_extrude_scale);float extrude_length=length(v_extrude)*extrude_scale_length;float stroke_width=15.0*extrude_scale_length/u_overscale_factor;float radius=v_radius*extrude_scale_length;float distance_to_edge=abs(extrude_length-radius);float opacity_t=smoothstep(-stroke_width,0.0,-distance_to_edge);gl_FragColor=opacity_t*color;}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;varying float v_radius;varying vec2 v_extrude;varying vec2 v_extrude_scale;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);highp float padding_factor=1.2;gl_Position.xy+=a_extrude*u_extrude_scale*padding_factor*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;v_radius=abs(a_extrude.y);v_extrude=a_extrude*padding_factor;v_extrude_scale=u_extrude_scale*u_camera_to_center_distance*collision_perspective_ratio;}"),kn=Nn("uniform highp vec4 u_color;void main() {gl_FragColor=u_color;}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),Tn=Nn("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),En=Nn("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),Mn=Nn("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec4 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float pixelRatio=u_scale.x;float tileRatio=u_scale.y;float fromScale=u_scale.z;float toScale=u_scale.w;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=vec2((pattern_br_a.x-pattern_tl_a.x)/pixelRatio,(pattern_br_a.y-pattern_tl_a.y)/pixelRatio);vec2 display_size_b=vec2((pattern_br_b.x-pattern_tl_b.x)/pixelRatio,(pattern_br_b.y-pattern_tl_b.y)/pixelRatio);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),Cn=Nn("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec4 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float pixelRatio=u_scale.x;float tileZoomRatio=u_scale.y;float fromScale=u_scale.z;float toScale=u_scale.w;vec2 display_size_a=vec2((pattern_br_a.x-pattern_tl_a.x)/pixelRatio,(pattern_br_a.y-pattern_tl_a.y)/pixelRatio);vec2 display_size_b=vec2((pattern_br_b.x-pattern_tl_b.x)/pixelRatio,(pattern_br_b.y-pattern_tl_b.y)/pixelRatio);gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),Sn=Nn("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),Pn=Nn("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec4 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float pixelRatio=u_scale.x;float tileRatio=u_scale.y;float fromScale=u_scale.z;float toScale=u_scale.w;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=vec2((pattern_br_a.x-pattern_tl_a.x)/pixelRatio,(pattern_br_a.y-pattern_tl_a.y)/pixelRatio);vec2 display_size_b=vec2((pattern_br_b.x-pattern_tl_b.x)/pixelRatio,(pattern_br_b.y-pattern_tl_b.y)/pixelRatio);base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),zn=Nn("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform float u_maxzoom;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;return (data.r+data.g*256.0+data.b*256.0*256.0)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggeration=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/ pow(2.0,(u_zoom-u_maxzoom)*exaggeration+19.2562-u_zoom);gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),In=Nn("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),An=Nn("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\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\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\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),Dn=Nn("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp float v_lineprogress;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,vec2(v_lineprogress,0.5));gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define MAX_LINE_DISTANCE 32767.0\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_lineprogress;\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\nvoid main() {\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\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_lineprogress=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0/MAX_LINE_DISTANCE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),On=Nn("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec4 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float pixelRatio=u_scale.x;float tileZoomRatio=u_scale.y;float fromScale=u_scale.z;float toScale=u_scale.w;vec2 display_size_a=vec2((pattern_br_a.x-pattern_tl_a.x)/pixelRatio,(pattern_br_a.y-pattern_tl_a.y)/pixelRatio);vec2 display_size_b=vec2((pattern_br_b.x-pattern_tl_b.x)/pixelRatio,(pattern_br_b.y-pattern_tl_b.y)/pixelRatio);vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x,1.0);float x_b=mod(v_linesofar/pattern_size_b.x,1.0);float y_a=0.5+(v_normal.y*clamp(v_width2.s,0.0,(pattern_size_a.y+2.0)/2.0)/pattern_size_a.y);float y_b=0.5+(v_normal.y*clamp(v_width2.s,0.0,(pattern_size_b.y+2.0)/2.0)/pattern_size_b.y);vec2 pos_a=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,vec2(x_a,y_a));vec2 pos_b=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,vec2(x_b,y_b));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;\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#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\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#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);}"),Rn=Nn("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\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\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\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\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\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\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),Bn=Nn("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),Fn=Nn("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size[0],a_size[1],u_size_t)/256.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size[0]/256.0;} else if (!u_is_size_zoom_constant && u_is_size_feature_constant) {size=u_size;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}"),Un=Nn("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\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\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\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\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\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\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size[0],a_size[1],u_size_t)/256.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size[0]/256.0;} else if (!u_is_size_zoom_constant && u_is_size_feature_constant) {size=u_size;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=vec2(tex.x,tex.y);v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}");function Nn(t,e){var i=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,s={};return{fragmentSource:t=t.replace(i,function(t,e,i,n,o){return s[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"}),vertexSource:e=e.replace(i,function(t,e,i,n,o){var r="float"===n?"vec2":"vec4",a=o.match(/color/)?"color":r;return s[o]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+o+"\nuniform lowp float u_"+o+"_t;\nattribute "+i+" "+r+" a_"+o+";\nvarying "+i+" "+n+" "+o+";\n#else\nuniform "+i+" "+n+" u_"+o+";\n#endif\n":"vec4"==a?"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+o+" = a_"+o+";\n#else\n "+i+" "+n+" "+o+" = u_"+o+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+o+" = unpack_mix_"+a+"(a_"+o+", u_"+o+"_t);\n#else\n "+i+" "+n+" "+o+" = u_"+o+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+o+"\nuniform lowp float u_"+o+"_t;\nattribute "+i+" "+r+" a_"+o+";\n#else\nuniform "+i+" "+n+" u_"+o+";\n#endif\n":"vec4"==a?"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+i+" "+n+" "+o+" = a_"+o+";\n#else\n "+i+" "+n+" "+o+" = u_"+o+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+i+" "+n+" "+o+" = unpack_mix_"+a+"(a_"+o+", u_"+o+"_t);\n#else\n "+i+" "+n+" "+o+" = u_"+o+";\n#endif\n"})}}function jn(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}var $n=Object.freeze({prelude:mn,background:_n,backgroundPattern:gn,circle:yn,clippingMask:vn,heatmap:xn,heatmapTexture:bn,collisionBox:wn,collisionCircle:Ln,debug:kn,fill:Tn,fillOutline:En,fillOutlinePattern:Mn,fillPattern:Cn,fillExtrusion:Sn,fillExtrusionPattern:Pn,hillshadePrepare:zn,hillshade:In,line:An,lineGradient:Dn,linePattern:On,lineSDF:Rn,raster:Bn,symbolIcon:Fn,symbolSDF:Un});jn.prototype.bind=function(t,e,i,n,o,r,a,s){this.context=t;for(var l=this.boundPaintVertexBuffers.length!==n.length,u=0;!l&&u<n.length;u++)this.boundPaintVertexBuffers[u]!==n[u]&&(l=!0);var c=!this.vao||this.boundProgram!==e||this.boundLayoutVertexBuffer!==i||l||this.boundIndexBuffer!==o||this.boundVertexOffset!==r||this.boundDynamicVertexBuffer!==a||this.boundDynamicVertexBuffer2!==s;!t.extVertexArrayObject||c?this.freshBind(e,i,n,o,r,a,s):(t.bindVertexArrayOES.set(this.vao),a&&a.bind(),o&&o.dynamicDraw&&o.bind(),s&&s.bind())},jn.prototype.freshBind=function(t,e,i,n,o,r,a){var s,l=t.numAttributes,u=this.context,c=u.gl;if(u.extVertexArrayObject)this.vao&&this.destroy(),this.vao=u.extVertexArrayObject.createVertexArrayOES(),u.bindVertexArrayOES.set(this.vao),s=0,this.boundProgram=t,this.boundLayoutVertexBuffer=e,this.boundPaintVertexBuffers=i,this.boundIndexBuffer=n,this.boundVertexOffset=o,this.boundDynamicVertexBuffer=r,this.boundDynamicVertexBuffer2=a;else{s=u.currentNumAttributes||0;for(var h=l;h<s;h++)c.disableVertexAttribArray(h)}e.enableAttributes(c,t);for(var p=0,d=i;p<d.length;p+=1)d[p].enableAttributes(c,t);r&&r.enableAttributes(c,t),a&&a.enableAttributes(c,t),e.bind(),e.setVertexAttribPointers(c,t,o);for(var f=0,m=i;f<m.length;f+=1){var _=m[f];_.bind(),_.setVertexAttribPointers(c,t,o)}r&&(r.bind(),r.setVertexAttribPointers(c,t,o)),n&&n.bind(),a&&(a.bind(),a.setVertexAttribPointers(c,t,o)),u.currentNumAttributes=l},jn.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};function Vn(t,e,i,n,o){var r=t.gl;this.program=r.createProgram();var a=i.defines();o&&a.push("#define OVERDRAW_INSPECTOR;");var s=a.concat(mn.fragmentSource,e.fragmentSource).join("\n"),l=a.concat(mn.vertexSource,e.vertexSource).join("\n"),u=r.createShader(r.FRAGMENT_SHADER);r.shaderSource(u,s),r.compileShader(u),r.attachShader(this.program,u);var c=r.createShader(r.VERTEX_SHADER);r.shaderSource(c,l),r.compileShader(c),r.attachShader(this.program,c);for(var h=i.layoutAttributes||[],p=0;p<h.length;p++)r.bindAttribLocation(this.program,p,h[p].name);r.linkProgram(this.program),this.numAttributes=r.getProgramParameter(this.program,r.ACTIVE_ATTRIBUTES),this.attributes={};for(var d={},f=0;f<this.numAttributes;f++){var m=r.getActiveAttrib(this.program,f);m&&(this.attributes[m.name]=r.getAttribLocation(this.program,m.name))}for(var _=r.getProgramParameter(this.program,r.ACTIVE_UNIFORMS),g=0;g<_;g++){var y=r.getActiveUniform(this.program,g);y&&(d[y.name]=r.getUniformLocation(this.program,y.name))}this.fixedUniforms=n(t,d),this.binderUniforms=i.getUniforms(t,d)}function Zn(t,e,i){var n=1/Bi(i,1,e.transform.tileZoom),o=Math.pow(2,i.tileID.overscaledZ),r=i.tileSize*Math.pow(2,e.transform.tileZoom)/o,a=r*(i.tileID.canonical.x+i.tileID.wrap*o),s=r*i.tileID.canonical.y;return{u_image:0,u_texsize:i.imageAtlasTexture.size,u_scale:[mt.browser.devicePixelRatio,n,t.fromScale,t.toScale],u_fade:t.t,u_pixel_coord_upper:[a>>16,s>>16],u_pixel_coord_lower:[65535&a,65535&s]}}Vn.prototype.draw=function(t,e,i,n,o,r,a,s,l,u,c,h,p,d,f,m){var _,g=t.gl;for(var y in t.program.set(this.program),t.setDepthMode(i),t.setStencilMode(n),t.setColorMode(o),t.setCullFace(r),this.fixedUniforms)this.fixedUniforms[y].set(a[y]);d&&d.setUniforms(t,this.binderUniforms,h,{zoom:p});for(var v=((_={})[g.LINES]=2,_[g.TRIANGLES]=3,_[g.LINE_STRIP]=1,_)[e],x=0,b=c.get();x<b.length;x+=1){var w=b[x],L=w.vaos||(w.vaos={});(L[s]||(L[s]=new jn)).bind(t,this,l,d?d.getPaintVertexBuffers():[],u,w.vertexOffset,f,m),g.drawElements(e,w.primitiveLength*v,g.UNSIGNED_SHORT,w.primitiveOffset*v*2)}};function Gn(t,e,i,n){var o=e.style.light,r=o.properties.get("position"),a=[r.x,r.y,r.z],s=mt.create$1();"viewport"===o.properties.get("anchor")&&mt.fromRotation(s,-e.transform.angle),mt.transformMat3(a,a,s);var l=o.properties.get("color");return{u_matrix:t,u_lightpos:a,u_lightintensity:o.properties.get("intensity"),u_lightcolor:[l.r,l.g,l.b],u_vertical_gradient:+i,u_opacity:n}}function qn(t){return{u_matrix:t}}function Hn(t,e,i,n){return mt.extend(qn(t),Zn(i,e,n))}function Wn(t,e,i,n){var o,r,a=t.transform;if("map"===n.paint.get("circle-pitch-alignment")){var s=Bi(i,1,a.zoom);o=!0,r=[s,s]}else o=!1,r=a.pixelsToGLUnits;return{u_camera_to_center_distance:a.cameraToCenterDistance,u_scale_with_map:+("map"===n.paint.get("circle-pitch-scale")),u_matrix:t.translatePosMatrix(e.posMatrix,i,n.paint.get("circle-translate"),n.paint.get("circle-translate-anchor")),u_pitch_with_map:+o,u_device_pixel_ratio:mt.browser.devicePixelRatio,u_extrude_scale:r}}function Xn(t,e){return{u_matrix:new mt.UniformMatrix4f(t,e.u_matrix),u_camera_to_center_distance:new mt.Uniform1f(t,e.u_camera_to_center_distance),u_pixels_to_tile_units:new mt.Uniform1f(t,e.u_pixels_to_tile_units),u_extrude_scale:new mt.Uniform2f(t,e.u_extrude_scale),u_overscale_factor:new mt.Uniform1f(t,e.u_overscale_factor)}}function Kn(t){return{u_matrix:t}}var Jn=function(t,e){return{u_matrix:t,u_color:e}},Yn=function(t,e,i){var n=i.paint.get("hillshade-shadow-color"),o=i.paint.get("hillshade-highlight-color"),r=i.paint.get("hillshade-accent-color"),a=i.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===i.paint.get("hillshade-illumination-anchor")&&(a-=t.transform.angle);var s=!t.options.moving;return{u_matrix:t.transform.calculatePosMatrix(e.tileID.toUnwrapped(),s),u_image:0,u_latrange:function(t,e){var i=Math.pow(2,e.canonical.z),n=e.canonical.y;return[new mt.MercatorCoordinate(0,n/i).toLngLat().lat,new mt.MercatorCoordinate(0,(n+1)/i).toLngLat().lat]}(0,e.tileID),u_light:[i.paint.get("hillshade-exaggeration"),a],u_shadow:n,u_highlight:o,u_accent:r}},Qn=function(t,e){var i=t.dem.stride,n=mt.create();return mt.ortho(n,0,mt.EXTENT,-mt.EXTENT,0,0,1),mt.translate(n,n,[0,-mt.EXTENT,0]),{u_matrix:n,u_image:1,u_dimension:[i,i],u_zoom:t.tileID.overscaledZ,u_maxzoom:e}};function to(t,e,i){var n=t.transform;return{u_matrix:io(t,e,i),u_ratio:1/Bi(e,1,n.zoom),u_device_pixel_ratio:mt.browser.devicePixelRatio,u_units_to_pixels:[1/n.pixelsToGLUnits[0],1/n.pixelsToGLUnits[1]]}}function eo(t,e){return 1/Bi(t,1,e.tileZoom)}function io(t,e,i){return t.translatePosMatrix(e.tileID.posMatrix,e,i.paint.get("line-translate"),i.paint.get("line-translate-anchor"))}function no(t,e,i,n,o){return{u_matrix:t,u_tl_parent:e,u_scale_parent:i,u_buffer_scale:1,u_fade_t:n.mix,u_opacity:n.opacity*o.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:o.paint.get("raster-brightness-min"),u_brightness_high:o.paint.get("raster-brightness-max"),u_saturation_factor:(a=o.paint.get("raster-saturation"),0<a?1-1/(1.001-a):-a),u_contrast_factor:(r=o.paint.get("raster-contrast"),0<r?1/(1-r):1+r),u_spin_weights:function(t){t*=Math.PI/180;var e=Math.sin(t),i=Math.cos(t);return[(2*i+1)/3,(-Math.sqrt(3)*e-i+1)/3,(Math.sqrt(3)*e-i+1)/3]}(o.paint.get("raster-hue-rotate"))};var r,a}function oo(t,e,i,n,o,r,a,s,l,u){var c=o.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:c.cameraToCenterDistance,u_pitch:c.pitch/360*2*Math.PI,u_rotate_symbol:+i,u_aspect_ratio:c.width/c.height,u_fade_change:o.options.fadeDuration?o.symbolFadeChange:1,u_matrix:r,u_label_plane_matrix:a,u_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+n,u_texsize:u,u_texture:0}}var ro={fillExtrusion:function(t,e){return{u_matrix:new mt.UniformMatrix4f(t,e.u_matrix),u_lightpos:new mt.Uniform3f(t,e.u_lightpos),u_lightintensity:new mt.Uniform1f(t,e.u_lightintensity),u_lightcolor:new mt.Uniform3f(t,e.u_lightcolor),u_vertical_gradient:new mt.Uniform1f(t,e.u_vertical_gradient),u_opacity:new mt.Uniform1f(t,e.u_opacity)}},fillExtrusionPattern:function(t,e){return{u_matrix:new mt.UniformMatrix4f(t,e.u_matrix),u_lightpos:new mt.Uniform3f(t,e.u_lightpos),u_lightintensity:new mt.Uniform1f(t,e.u_lightintensity),u_lightcolor:new mt.Uniform3f(t,e.u_lightcolor),u_vertical_gradient:new mt.Uniform1f(t,e.u_vertical_gradient),u_height_factor:new mt.Uniform1f(t,e.u_height_factor),u_image:new mt.Uniform1i(t,e.u_image),u_texsize:new mt.Uniform2f(t,e.u_texsize),u_pixel_coord_upper:new mt.Uniform2f(t,e.u_pixel_coord_upper),u_pixel_coord_lower:new mt.Uniform2f(t,e.u_pixel_coord_lower),u_scale:new mt.Uniform4f(t,e.u_scale),u_fade:new mt.Uniform1f(t,e.u_fade),u_opacity:new mt.Uniform1f(t,e.u_opacity)}},fill:function(t,e){return{u_matrix:new mt.UniformMatrix4f(t,e.u_matrix)}},fillPattern:function(t,e){return{u_matrix:new mt.UniformMatrix4f(t,e.u_matrix),u_image:new mt.Uniform1i(t,e.u_image),u_texsize:new mt.Uniform2f(t,e.u_texsize),u_pixel_coord_upper:new mt.Uniform2f(t,e.u_pixel_coord_upper),u_pixel_coord_lower:new mt.Uniform2f(t,e.u_pixel_coord_lower),u_scale:new mt.Uniform4f(t,e.u_scale),u_fade:new mt.Uniform1f(t,e.u_fade)}},fillOutline:function(t,e){return{u_matrix:new mt.UniformMatrix4f(t,e.u_matrix),u_world:new mt.Uniform2f(t,e.u_world)}},fillOutlinePattern:function(t,e){return{u_matrix:new mt.UniformMatrix4f(t,e.u_matrix),u_world:new mt.Uniform2f(t,e.u_world),u_image:new mt.Uniform1i(t,e.u_image),u_texsize:new mt.Uniform2f(t,e.u_texsize),u_pixel_coord_upper:new mt.Uniform2f(t,e.u_pixel_coord_upper),u_pixel_coord_lower:new mt.Uniform2f(t,e.u_pixel_coord_lower),u_scale:new mt.Uniform4f(t,e.u_scale),u_fade:new mt.Uniform1f(t,e.u_fade)}},circle:function(t,e){return{u_camera_to_center_distance:new mt.Uniform1f(t,e.u_camera_to_center_distance),u_scale_with_map:new mt.Uniform1i(t,e.u_scale_with_map),u_pitch_with_map:new mt.Uniform1i(t,e.u_pitch_with_map),u_extrude_scale:new mt.Uniform2f(t,e.u_extrude_scale),u_device_pixel_ratio:new mt.Uniform1f(t,e.u_device_pixel_ratio),u_matrix:new mt.UniformMatrix4f(t,e.u_matrix)}},collisionBox:Xn,collisionCircle:Xn,debug:function(t,e){return{u_color:new mt.UniformColor(t,e.u_color),u_matrix:new mt.UniformMatrix4f(t,e.u_matrix)}},clippingMask:function(t,e){return{u_matrix:new mt.UniformMatrix4f(t,e.u_matrix)}},heatmap:function(t,e){return{u_extrude_scale:new mt.Uniform1f(t,e.u_extrude_scale),u_intensity:new mt.Uniform1f(t,e.u_intensity),u_matrix:new mt.UniformMatrix4f(t,e.u_matrix)}},heatmapTexture:function(t,e){return{u_matrix:new mt.UniformMatrix4f(t,e.u_matrix),u_world:new mt.Uniform2f(t,e.u_world),u_image:new mt.Uniform1i(t,e.u_image),u_color_ramp:new mt.Uniform1i(t,e.u_color_ramp),u_opacity:new mt.Uniform1f(t,e.u_opacity)}},hillshade:function(t,e){return{u_matrix:new mt.UniformMatrix4f(t,e.u_matrix),u_image:new mt.Uniform1i(t,e.u_image),u_latrange:new mt.Uniform2f(t,e.u_latrange),u_light:new mt.Uniform2f(t,e.u_light),u_shadow:new mt.UniformColor(t,e.u_shadow),u_highlight:new mt.UniformColor(t,e.u_highlight),u_accent:new mt.UniformColor(t,e.u_accent)}},hillshadePrepare:function(t,e){return{u_matrix:new mt.UniformMatrix4f(t,e.u_matrix),u_image:new mt.Uniform1i(t,e.u_image),u_dimension:new mt.Uniform2f(t,e.u_dimension),u_zoom:new mt.Uniform1f(t,e.u_zoom),u_maxzoom:new mt.Uniform1f(t,e.u_maxzoom)}},line:function(t,e){return{u_matrix:new mt.UniformMatrix4f(t,e.u_matrix),u_ratio:new mt.Uniform1f(t,e.u_ratio),u_device_pixel_ratio:new mt.Uniform1f(t,e.u_device_pixel_ratio),u_units_to_pixels:new mt.Uniform2f(t,e.u_units_to_pixels)}},lineGradient:function(t,e){return{u_matrix:new mt.UniformMatrix4f(t,e.u_matrix),u_ratio:new mt.Uniform1f(t,e.u_ratio),u_device_pixel_ratio:new mt.Uniform1f(t,e.u_device_pixel_ratio),u_units_to_pixels:new mt.Uniform2f(t,e.u_units_to_pixels),u_image:new mt.Uniform1i(t,e.u_image)}},linePattern:function(t,e){return{u_matrix:new mt.UniformMatrix4f(t,e.u_matrix),u_texsize:new mt.Uniform2f(t,e.u_texsize),u_ratio:new mt.Uniform1f(t,e.u_ratio),u_device_pixel_ratio:new mt.Uniform1f(t,e.u_device_pixel_ratio),u_image:new mt.Uniform1i(t,e.u_image),u_units_to_pixels:new mt.Uniform2f(t,e.u_units_to_pixels),u_scale:new mt.Uniform4f(t,e.u_scale),u_fade:new mt.Uniform1f(t,e.u_fade)}},lineSDF:function(t,e){return{u_matrix:new mt.UniformMatrix4f(t,e.u_matrix),u_ratio:new mt.Uniform1f(t,e.u_ratio),u_device_pixel_ratio:new mt.Uniform1f(t,e.u_device_pixel_ratio),u_units_to_pixels:new mt.Uniform2f(t,e.u_units_to_pixels),u_patternscale_a:new mt.Uniform2f(t,e.u_patternscale_a),u_patternscale_b:new mt.Uniform2f(t,e.u_patternscale_b),u_sdfgamma:new mt.Uniform1f(t,e.u_sdfgamma),u_image:new mt.Uniform1i(t,e.u_image),u_tex_y_a:new mt.Uniform1f(t,e.u_tex_y_a),u_tex_y_b:new mt.Uniform1f(t,e.u_tex_y_b),u_mix:new mt.Uniform1f(t,e.u_mix)}},raster:function(t,e){return{u_matrix:new mt.UniformMatrix4f(t,e.u_matrix),u_tl_parent:new mt.Uniform2f(t,e.u_tl_parent),u_scale_parent:new mt.Uniform1f(t,e.u_scale_parent),u_buffer_scale:new mt.Uniform1f(t,e.u_buffer_scale),u_fade_t:new mt.Uniform1f(t,e.u_fade_t),u_opacity:new mt.Uniform1f(t,e.u_opacity),u_image0:new mt.Uniform1i(t,e.u_image0),u_image1:new mt.Uniform1i(t,e.u_image1),u_brightness_low:new mt.Uniform1f(t,e.u_brightness_low),u_brightness_high:new mt.Uniform1f(t,e.u_brightness_high),u_saturation_factor:new mt.Uniform1f(t,e.u_saturation_factor),u_contrast_factor:new mt.Uniform1f(t,e.u_contrast_factor),u_spin_weights:new mt.Uniform3f(t,e.u_spin_weights)}},symbolIcon:function(t,e){return{u_is_size_zoom_constant:new mt.Uniform1i(t,e.u_is_size_zoom_constant),u_is_size_feature_constant:new mt.Uniform1i(t,e.u_is_size_feature_constant),u_size_t:new mt.Uniform1f(t,e.u_size_t),u_size:new mt.Uniform1f(t,e.u_size),u_camera_to_center_distance:new mt.Uniform1f(t,e.u_camera_to_center_distance),u_pitch:new mt.Uniform1f(t,e.u_pitch),u_rotate_symbol:new mt.Uniform1i(t,e.u_rotate_symbol),u_aspect_ratio:new mt.Uniform1f(t,e.u_aspect_ratio),u_fade_change:new mt.Uniform1f(t,e.u_fade_change),u_matrix:new mt.UniformMatrix4f(t,e.u_matrix),u_label_plane_matrix:new mt.UniformMatrix4f(t,e.u_label_plane_matrix),u_coord_matrix:new mt.UniformMatrix4f(t,e.u_coord_matrix),u_is_text:new mt.Uniform1f(t,e.u_is_text),u_pitch_with_map:new mt.Uniform1i(t,e.u_pitch_with_map),u_texsize:new mt.Uniform2f(t,e.u_texsize),u_texture:new mt.Uniform1i(t,e.u_texture)}},symbolSDF:function(t,e){return{u_is_size_zoom_constant:new mt.Uniform1i(t,e.u_is_size_zoom_constant),u_is_size_feature_constant:new mt.Uniform1i(t,e.u_is_size_feature_constant),u_size_t:new mt.Uniform1f(t,e.u_size_t),u_size:new mt.Uniform1f(t,e.u_size),u_camera_to_center_distance:new mt.Uniform1f(t,e.u_camera_to_center_distance),u_pitch:new mt.Uniform1f(t,e.u_pitch),u_rotate_symbol:new mt.Uniform1i(t,e.u_rotate_symbol),u_aspect_ratio:new mt.Uniform1f(t,e.u_aspect_ratio),u_fade_change:new mt.Uniform1f(t,e.u_fade_change),u_matrix:new mt.UniformMatrix4f(t,e.u_matrix),u_label_plane_matrix:new mt.UniformMatrix4f(t,e.u_label_plane_matrix),u_coord_matrix:new mt.UniformMatrix4f(t,e.u_coord_matrix),u_is_text:new mt.Uniform1f(t,e.u_is_text),u_pitch_with_map:new mt.Uniform1i(t,e.u_pitch_with_map),u_texsize:new mt.Uniform2f(t,e.u_texsize),u_texture:new mt.Uniform1i(t,e.u_texture),u_gamma_scale:new mt.Uniform1f(t,e.u_gamma_scale),u_device_pixel_ratio:new mt.Uniform1f(t,e.u_device_pixel_ratio),u_is_halo:new mt.Uniform1f(t,e.u_is_halo)}},background:function(t,e){return{u_matrix:new mt.UniformMatrix4f(t,e.u_matrix),u_opacity:new mt.Uniform1f(t,e.u_opacity),u_color:new mt.UniformColor(t,e.u_color)}},backgroundPattern:function(t,e){return{u_matrix:new mt.UniformMatrix4f(t,e.u_matrix),u_opacity:new mt.Uniform1f(t,e.u_opacity),u_image:new mt.Uniform1i(t,e.u_image),u_pattern_tl_a:new mt.Uniform2f(t,e.u_pattern_tl_a),u_pattern_br_a:new mt.Uniform2f(t,e.u_pattern_br_a),u_pattern_tl_b:new mt.Uniform2f(t,e.u_pattern_tl_b),u_pattern_br_b:new mt.Uniform2f(t,e.u_pattern_br_b),u_texsize:new mt.Uniform2f(t,e.u_texsize),u_mix:new mt.Uniform1f(t,e.u_mix),u_pattern_size_a:new mt.Uniform2f(t,e.u_pattern_size_a),u_pattern_size_b:new mt.Uniform2f(t,e.u_pattern_size_b),u_scale_a:new mt.Uniform1f(t,e.u_scale_a),u_scale_b:new mt.Uniform1f(t,e.u_scale_b),u_pixel_coord_upper:new mt.Uniform2f(t,e.u_pixel_coord_upper),u_pixel_coord_lower:new mt.Uniform2f(t,e.u_pixel_coord_lower),u_tile_units_to_pixels:new mt.Uniform1f(t,e.u_tile_units_to_pixels)}}};function ao(t,e){for(var i=t.sort(function(t,e){return t.tileID.isLessThan(e.tileID)?-1:e.tileID.isLessThan(t.tileID)?1:0}),n=0;n<i.length;n++){var o={},r=i[n],a=i.slice(n+1);so(r.tileID.wrapped(),r.tileID,a,new mt.OverscaledTileID(0,r.tileID.wrap+1,0,0,0),o),r.setMask(o,e)}}function so(t,e,i,n,o){for(var r=0;r<i.length;r++){var a=i[r];if(n.isLessThan(a.tileID))break;if(e.key===a.tileID.key)return;if(a.tileID.isChildOf(e)){for(var s=e.children(1/0),l=0;l<s.length;l++)so(t,s[l],i.slice(r),n,o);return}}var u=e.overscaledZ-t.overscaledZ,c=new mt.CanonicalTileID(u,e.canonical.x-(t.canonical.x<<u),e.canonical.y-(t.canonical.y<<u));o[c.key]=o[c.key]||c}function lo(t,e,i,n,o){for(var r=t.context,a=r.gl,s=o?t.useProgram("collisionCircle"):t.useProgram("collisionBox"),l=0;l<n.length;l++){var u=n[l],c=e.getTile(u),h=c.getBucket(i);if(h){var p=o?h.collisionCircle:h.collisionBox;p&&s.draw(r,o?a.TRIANGLES:a.LINES,Qe.disabled,ti.disabled,t.colorModeForRenderPass(),ii.disabled,(d=u.posMatrix,f=t.transform,void 0,_=Bi(m=c,1,f.zoom),g=Math.pow(2,f.zoom-m.tileID.overscaledZ),y=m.tileID.overscaleFactor(),{u_matrix:d,u_camera_to_center_distance:f.cameraToCenterDistance,u_pixels_to_tile_units:_,u_extrude_scale:[f.pixelsToGLUnits[0]/(_*g),f.pixelsToGLUnits[1]/(_*g)],u_overscale_factor:y}),i.id,p.layoutVertexBuffer,p.indexBuffer,p.segments,null,t.transform.zoom,null,null,p.collisionVertexBuffer)}}var d,f,m,_,g,y}var uo=mt.identity(new Float32Array(16));function co(t,e,i,n,o,r,a,s,l,u){var c,h,p,d,f,m,_,g,y,v,x=t.text.placedSymbolArray,b=t.text.dynamicLayoutVertexArray;b.clear();for(var w=0;w<x.length;w++){var L=x.get(w),k=!L.hidden&&L.crossTileID?n[L.crossTileID]:null;if(k){var T=new mt.Point(L.anchorX,L.anchorY),E=Ti(T,i?s:a),M=.5+r.cameraToCenterDistance/E.signedDistanceFromCamera*.5,C=o.evaluateSizeForFeature(t.textSizeData,u,L)*M/mt.ONE_EM;i&&(C*=t.tilePixelRatio/l);for(var S=k.width,P=k.height,z=k.radialOffset,I=k.textBoxScale,A=(c=k.anchor,h=S,p=P,d=z,f=I,m=C,void 0,_=mt.getAnchorAlignment(c),g=-(_.horizontalAlign-.5)*h,y=-(_.verticalAlign-.5)*p,v=mt.evaluateRadialOffset(c,d),new mt.Point((g/f+v[0])*m,(y/f+v[1])*m)),D=i?Ti(T.add(A),a).point:E.point.add(e?A.rotate(-r.angle):A),O=0;O<L.numGlyphs;O++)mt.addDynamicAttributes(b,D,0)}else Ai(L.numGlyphs,b)}t.text.dynamicLayoutVertexBuffer.updateData(b)}function ho(t,e,i,n,o,r,a,s,l,u,c,h,p){for(var d,f,m=t.context,_=m.gl,g=t.transform,y="map"===s,v="map"===l,x=y&&"point"!==i.layout.get("symbol-placement"),b=y&&!v&&!x,w=void 0!==i.layout.get("symbol-sort-key").constantOr(1),L=t.depthModeForSublayer(0,Qe.ReadOnly),k=i.layout.get("text-variable-anchor"),T=[],E=0,M=n;E<M.length;E+=1){var C=M[E],S=e.getTile(C),P=S.getBucket(i);if(P){var z=o?P.text:P.icon;if(z&&z.segments.get().length){var I=z.programConfigurations.get(i.id),A=o||P.sdfIcons,D=o?P.textSizeData:P.iconSizeData;d||(d=t.useProgram(A?"symbolSDF":"symbolIcon",I),f=mt.evaluateSizeForZoom(D,g.zoom)),m.activeTexture.set(_.TEXTURE0);var O=void 0,R=void 0,B=void 0;if(o)R=S.glyphAtlasTexture,B=_.LINEAR,O=S.glyphAtlasTexture.size;else{var F=1!==i.layout.get("icon-size").constantOr(0)||P.iconsNeedLinear,U=v||0!==g.pitch;R=S.imageAtlasTexture,B=A||t.options.rotating||t.options.zooming||F||U?_.LINEAR:_.NEAREST,O=S.imageAtlasTexture.size}var N=Bi(S,1,t.transform.zoom),j=Li(C.posMatrix,v,y,t.transform,N),$=ki(C.posMatrix,v,y,t.transform,N);if(x)Ei(P,C.posMatrix,t,o,j,$,v,u);else if(o&&f&&k){var V=Math.pow(2,g.zoom-S.tileID.overscaledZ);co(P,y,v,p,mt.symbolSize,g,j,C.posMatrix,V,f)}var Z=t.translatePosMatrix(C.posMatrix,S,r,a),G=x||o&&k?uo:j,q=t.translatePosMatrix($,S,r,a,!0),H=A&&0!==i.paint.get(o?"text-halo-width":"icon-halo-width").constantOr(1),W={program:d,buffers:z,uniformValues:A?(Y=D.kind,Q=f,tt=b,et=v,it=t,nt=Z,ot=G,rt=q,at=o,st=O,lt=!0,void 0,ut=it.transform,mt.extend(oo(Y,Q,tt,et,it,nt,ot,rt,at,st),{u_gamma_scale:et?Math.cos(ut._pitch)*ut.cameraToCenterDistance:1,u_device_pixel_ratio:mt.browser.devicePixelRatio,u_is_halo:+lt})):oo(D.kind,f,b,v,t,Z,G,q,o,O),atlasTexture:R,atlasInterpolation:B,isSDF:A,hasHalo:H};if(w)for(var X=0,K=z.segments.get();X<K.length;X+=1){var J=K[X];T.push({segments:new mt.SegmentVector([J]),sortKey:J.sortKey,state:W})}else T.push({segments:z.segments,sortKey:0,state:W})}}}var Y,Q,tt,et,it,nt,ot,rt,at,st,lt,ut;w&&T.sort(function(t,e){return t.sortKey-e.sortKey});for(var ct=0,ht=T;ct<ht.length;ct+=1){var pt=ht[ct],dt=pt.state;if(dt.atlasTexture.bind(dt.atlasInterpolation,_.CLAMP_TO_EDGE),dt.isSDF){var ft=dt.uniformValues;dt.hasHalo&&(ft.u_is_halo=1,po(dt.buffers,pt.segments,i,t,dt.program,L,c,h,ft)),ft.u_is_halo=0}po(dt.buffers,pt.segments,i,t,dt.program,L,c,h,dt.uniformValues)}}function po(t,e,i,n,o,r,a,s,l){var u=n.context,c=u.gl;o.draw(u,c.TRIANGLES,r,a,s,ii.disabled,l,i.id,t.layoutVertexBuffer,t.indexBuffer,e,i.paint,n.transform.zoom,t.programConfigurations.get(i.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function fo(t,e,i,n,o,r,a){var s,l,u,c,h,p,d,f,m,_,g=t.context.gl,y=i.paint.get("fill-pattern"),v=y&&y.constantOr(1),x=i.getCrossfadeParameters();s=a?(l=v&&!i.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",g.LINES):(l=v?"fillPattern":"fill",g.TRIANGLES);for(var b=0,w=n;b<w.length;b+=1){var L=w[b],k=e.getTile(L);if(!v||k.patternsLoaded()){var T=k.getBucket(i);if(T){var E=T.programConfigurations.get(i.id),M=t.useProgram(l,E);v&&(t.context.activeTexture.set(g.TEXTURE0),k.imageAtlasTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE),E.updatePatternPaintBuffers(x));var C=y.constantOr(null);if(C&&k.imageAtlas){var S=k.imageAtlas.patternPositions[C.to],P=k.imageAtlas.patternPositions[C.from];S&&P&&E.setConstantPatternPositions(S,P)}var z=t.translatePosMatrix(L.posMatrix,k,i.paint.get("fill-translate"),i.paint.get("fill-translate-anchor"));if(a){c=T.indexBuffer2,h=T.segments2;var I=[g.drawingBufferWidth,g.drawingBufferHeight];u="fillOutlinePattern"===l&&v?(p=z,d=t,f=x,m=k,_=I,mt.extend(Hn(p,d,f,m),{u_world:_})):{u_matrix:z,u_world:I}}else c=T.indexBuffer,h=T.segments,u=v?Hn(z,t,x,k):qn(z);M.draw(t.context,s,o,t.stencilModeForClipping(L),r,ii.disabled,u,i.id,T.layoutVertexBuffer,c,h,i.paint,t.transform.zoom,E)}}}}function mo(t,e,i,n,o,r,a){for(var s=t.context,l=s.gl,u=i.paint.get("fill-extrusion-pattern"),c=u.constantOr(1),h=i.getCrossfadeParameters(),p=i.paint.get("fill-extrusion-opacity"),d=0,f=n;d<f.length;d+=1){var m=f[d],_=e.getTile(m),g=_.getBucket(i);if(g){var y=g.programConfigurations.get(i.id),v=t.useProgram(c?"fillExtrusionPattern":"fillExtrusion",y);c&&(t.context.activeTexture.set(l.TEXTURE0),_.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),y.updatePatternPaintBuffers(h));var x=u.constantOr(null);if(x&&_.imageAtlas){var b=_.imageAtlas.patternPositions[x.to],w=_.imageAtlas.patternPositions[x.from];b&&w&&y.setConstantPatternPositions(b,w)}var L=t.translatePosMatrix(m.posMatrix,_,i.paint.get("fill-extrusion-translate"),i.paint.get("fill-extrusion-translate-anchor")),k=i.paint.get("fill-extrusion-vertical-gradient"),T=c?(E=L,M=t,C=k,S=p,P=m,z=h,I=_,mt.extend(Gn(E,M,C,S),Zn(z,M,I),{u_height_factor:-Math.pow(2,P.overscaledZ)/I.tileSize/8})):Gn(L,t,k,p);v.draw(s,s.gl.TRIANGLES,o,r,a,ii.backCCW,T,i.id,g.layoutVertexBuffer,g.indexBuffer,g.segments,i.paint,t.transform.zoom,y)}}var E,M,C,S,P,z,I}function _o(t,e,i,n,o,r){var a=t.context,s=a.gl,l=e.fbo;if(l){var u=t.useProgram("hillshade");a.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,l.colorAttachment.get());var c=Yn(t,e,i);e.maskedBoundsBuffer&&e.maskedIndexBuffer&&e.segments?u.draw(a,s.TRIANGLES,n,o,r,ii.disabled,c,i.id,e.maskedBoundsBuffer,e.maskedIndexBuffer,e.segments):u.draw(a,s.TRIANGLES,n,o,r,ii.disabled,c,i.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}}function go(t,e,i,n,o,r,a){var s=t.context,l=s.gl;if(e.dem&&e.dem.data){var u=e.dem.dim,c=e.dem.stride,h=e.dem.getPixels();if(s.activeTexture.set(l.TEXTURE1),s.pixelStoreUnpackPremultiplyAlpha.set(!1),e.demTexture=e.demTexture||t.getTileTexture(c),e.demTexture){var p=e.demTexture;p.update(h,{premultiply:!1}),p.bind(l.NEAREST,l.CLAMP_TO_EDGE)}else e.demTexture=new mt.Texture(s,h,l.RGBA,{premultiply:!1}),e.demTexture.bind(l.NEAREST,l.CLAMP_TO_EDGE);s.activeTexture.set(l.TEXTURE0);var d=e.fbo;if(!d){var f=new mt.Texture(s,{width:u,height:u,data:null},l.RGBA);f.bind(l.LINEAR,l.CLAMP_TO_EDGE),(d=e.fbo=s.createFramebuffer(u,u)).colorAttachment.set(f.texture)}s.bindFramebuffer.set(d.framebuffer),s.viewport.set([0,0,u,u]),t.useProgram("hillshadePrepare").draw(s,l.TRIANGLES,o,r,a,ii.disabled,Qn(e,n),i.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments),e.needsHillshadePrepare=!1}}function yo(t,e,i,n,o){var r=n.paint.get("raster-fade-duration");if(0<r){var a=mt.browser.now(),s=(a-t.timeAdded)/r,l=e?(a-e.timeAdded)/r:-1,u=i.getSource(),c=o.coveringZoomLevel({tileSize:u.tileSize,roundZoom:u.roundZoom}),h=!e||Math.abs(e.tileID.overscaledZ-c)>Math.abs(t.tileID.overscaledZ-c),p=h&&t.refreshedUponExpiration?1:mt.clamp(h?s:1-l,0,1);return t.refreshedUponExpiration&&1<=s&&(t.refreshedUponExpiration=!1),e?{opacity:1,mix:1-p}:{opacity:p,mix:0}}return{opacity:1,mix:0}}function vo(t,e,i){var n=t.context,o=n.gl,r=i.posMatrix,a=t.useProgram("debug"),s=Qe.disabled,l=ti.disabled,u=t.colorModeForRenderPass(),c="$debug";a.draw(n,o.LINE_STRIP,s,l,u,ii.disabled,Jn(r,mt.Color.red),c,t.debugBuffer,t.tileBorderIndexBuffer,t.debugSegments);for(var h=e.getTileByID(i.key).latestRawTileData,p=h&&h.byteLength||0,d=Math.floor(p/1024),f=function(t,e,i,n){n=n||1;var o,r,a,s,l,u,c,h,p=[];for(o=0,r=t.length;o<r;o++)if(l=bo[t[o]]){for(h=null,a=0,s=l[1].length;a<s;a+=2)h=-1===l[1][a]&&-1===l[1][a+1]?null:(u=e+l[1][a]*n,c=200-l[1][a+1]*n,h&&p.push(h.x,h.y,u,c),{x:u,y:c});e+=l[0]*n}return p}(i.toString()+" "+d+"kb",50,0,5),m=new mt.StructArrayLayout2i4,_=new mt.StructArrayLayout2ui4,g=0;g<f.length;g+=2)m.emplaceBack(f[g],f[g+1]),_.emplaceBack(g,g+1);for(var y=n.createVertexBuffer(m,fn.members),v=n.createIndexBuffer(_),x=mt.SegmentVector.simpleSegment(0,0,m.length/2,m.length/2),b=e.getTile(i).tileSize,w=mt.EXTENT/(Math.pow(2,t.transform.zoom-i.overscaledZ)*b),L=[[-1,-1],[-1,1],[1,-1],[1,1]],k=0;k<L.length;k++){var T=L[k];a.draw(n,o.LINES,s,l,u,ii.disabled,Jn(mt.translate([],r,[w*T[0],w*T[1],0]),mt.Color.white),c,y,v,x)}a.draw(n,o.LINES,s,l,u,ii.disabled,Jn(r,mt.Color.black),c,y,v,x)}function xo(t,e){this.context=new ni(t),this.transform=e,this._tileTextures={},this.setup(),this.numSublayers=ri.maxUnderzooming+ri.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.depthRboNeedsClear=!0,this.emptyProgramConfiguration=new mt.ProgramConfiguration,this.crossTileSymbolIndex=new sn}var bo={" ":[16,[]],"!":[10,[5,21,5,7,-1,-1,5,2,4,1,5,0,6,1,5,2]],'"':[16,[4,21,4,14,-1,-1,12,21,12,14]],"#":[21,[11,25,4,-7,-1,-1,17,25,10,-7,-1,-1,4,12,18,12,-1,-1,3,6,17,6]],$:[20,[8,25,8,-4,-1,-1,12,25,12,-4,-1,-1,17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],"%":[24,[21,21,3,0,-1,-1,8,21,10,19,10,17,9,15,7,14,5,14,3,16,3,18,4,20,6,21,8,21,10,20,13,19,16,19,19,20,21,21,-1,-1,17,7,15,6,14,4,14,2,16,0,18,0,20,1,21,3,21,5,19,7,17,7]],"&":[26,[23,12,23,13,22,14,21,14,20,13,19,11,17,6,15,3,13,1,11,0,7,0,5,1,4,2,3,4,3,6,4,8,5,9,12,13,13,14,14,16,14,18,13,20,11,21,9,20,8,18,8,16,9,13,11,10,16,3,18,1,20,0,22,0,23,1,23,2]],"'":[10,[5,19,4,20,5,21,6,20,6,18,5,16,4,15]],"(":[14,[11,25,9,23,7,20,5,16,4,11,4,7,5,2,7,-2,9,-5,11,-7]],")":[14,[3,25,5,23,7,20,9,16,10,11,10,7,9,2,7,-2,5,-5,3,-7]],"*":[16,[8,21,8,9,-1,-1,3,18,13,12,-1,-1,13,18,3,12]],"+":[26,[13,18,13,0,-1,-1,4,9,22,9]],",":[10,[6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"-":[26,[4,9,22,9]],".":[10,[5,2,4,1,5,0,6,1,5,2]],"/":[22,[20,25,2,-7]],0:[20,[9,21,6,20,4,17,3,12,3,9,4,4,6,1,9,0,11,0,14,1,16,4,17,9,17,12,16,17,14,20,11,21,9,21]],1:[20,[6,17,8,18,11,21,11,0]],2:[20,[4,16,4,17,5,19,6,20,8,21,12,21,14,20,15,19,16,17,16,15,15,13,13,10,3,0,17,0]],3:[20,[5,21,16,21,10,13,13,13,15,12,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],4:[20,[13,21,3,7,18,7,-1,-1,13,21,13,0]],5:[20,[15,21,5,21,4,12,5,13,8,14,11,14,14,13,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],6:[20,[16,18,15,20,12,21,10,21,7,20,5,17,4,12,4,7,5,3,7,1,10,0,11,0,14,1,16,3,17,6,17,7,16,10,14,12,11,13,10,13,7,12,5,10,4,7]],7:[20,[17,21,7,0,-1,-1,3,21,17,21]],8:[20,[8,21,5,20,4,18,4,16,5,14,7,13,11,12,14,11,16,9,17,7,17,4,16,2,15,1,12,0,8,0,5,1,4,2,3,4,3,7,4,9,6,11,9,12,13,13,15,14,16,16,16,18,15,20,12,21,8,21]],9:[20,[16,14,15,11,13,9,10,8,9,8,6,9,4,11,3,14,3,15,4,18,6,20,9,21,10,21,13,20,15,18,16,14,16,9,15,4,13,1,10,0,8,0,5,1,4,3]],":":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,5,2,4,1,5,0,6,1,5,2]],";":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"<":[24,[20,18,4,9,20,0]],"=":[26,[4,12,22,12,-1,-1,4,6,22,6]],">":[24,[4,18,20,9,4,0]],"?":[18,[3,16,3,17,4,19,5,20,7,21,11,21,13,20,14,19,15,17,15,15,14,13,13,12,9,10,9,7,-1,-1,9,2,8,1,9,0,10,1,9,2]],"@":[27,[18,13,17,15,15,16,12,16,10,15,9,14,8,11,8,8,9,6,11,5,14,5,16,6,17,8,-1,-1,12,16,10,14,9,11,9,8,10,6,11,5,-1,-1,18,16,17,8,17,6,19,5,21,5,23,7,24,10,24,12,23,15,22,17,20,19,18,20,15,21,12,21,9,20,7,19,5,17,4,15,3,12,3,9,4,6,5,4,7,2,9,1,12,0,15,0,18,1,20,2,21,3,-1,-1,19,16,18,8,18,6,19,5]],A:[18,[9,21,1,0,-1,-1,9,21,17,0,-1,-1,4,7,14,7]],B:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,-1,-1,4,11,13,11,16,10,17,9,18,7,18,4,17,2,16,1,13,0,4,0]],C:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5]],D:[21,[4,21,4,0,-1,-1,4,21,11,21,14,20,16,18,17,16,18,13,18,8,17,5,16,3,14,1,11,0,4,0]],E:[19,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11,-1,-1,4,0,17,0]],F:[18,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11]],G:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,18,8,-1,-1,13,8,18,8]],H:[22,[4,21,4,0,-1,-1,18,21,18,0,-1,-1,4,11,18,11]],I:[8,[4,21,4,0]],J:[16,[12,21,12,5,11,2,10,1,8,0,6,0,4,1,3,2,2,5,2,7]],K:[21,[4,21,4,0,-1,-1,18,21,4,7,-1,-1,9,12,18,0]],L:[17,[4,21,4,0,-1,-1,4,0,16,0]],M:[24,[4,21,4,0,-1,-1,4,21,12,0,-1,-1,20,21,12,0,-1,-1,20,21,20,0]],N:[22,[4,21,4,0,-1,-1,4,21,18,0,-1,-1,18,21,18,0]],O:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21]],P:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,14,17,12,16,11,13,10,4,10]],Q:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21,-1,-1,12,4,18,-2]],R:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,4,11,-1,-1,11,11,18,0]],S:[20,[17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],T:[16,[8,21,8,0,-1,-1,1,21,15,21]],U:[22,[4,21,4,6,5,3,7,1,10,0,12,0,15,1,17,3,18,6,18,21]],V:[18,[1,21,9,0,-1,-1,17,21,9,0]],W:[24,[2,21,7,0,-1,-1,12,21,7,0,-1,-1,12,21,17,0,-1,-1,22,21,17,0]],X:[20,[3,21,17,0,-1,-1,17,21,3,0]],Y:[18,[1,21,9,11,9,0,-1,-1,17,21,9,11]],Z:[20,[17,21,3,0,-1,-1,3,21,17,21,-1,-1,3,0,17,0]],"[":[14,[4,25,4,-7,-1,-1,5,25,5,-7,-1,-1,4,25,11,25,-1,-1,4,-7,11,-7]],"\\":[14,[0,21,14,-3]],"]":[14,[9,25,9,-7,-1,-1,10,25,10,-7,-1,-1,3,25,10,25,-1,-1,3,-7,10,-7]],"^":[16,[6,15,8,18,10,15,-1,-1,3,12,8,17,13,12,-1,-1,8,17,8,0]],_:[16,[0,-2,16,-2]],"`":[10,[6,21,5,20,4,18,4,16,5,15,6,16,5,17]],a:[19,[15,14,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],b:[19,[4,21,4,0,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],c:[18,[15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],d:[19,[15,21,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],e:[18,[3,8,15,8,15,10,14,12,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],f:[12,[10,21,8,21,6,20,5,17,5,0,-1,-1,2,14,9,14]],g:[19,[15,14,15,-2,14,-5,13,-6,11,-7,8,-7,6,-6,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],h:[19,[4,21,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],i:[8,[3,21,4,20,5,21,4,22,3,21,-1,-1,4,14,4,0]],j:[10,[5,21,6,20,7,21,6,22,5,21,-1,-1,6,14,6,-3,5,-6,3,-7,1,-7]],k:[17,[4,21,4,0,-1,-1,14,14,4,4,-1,-1,8,8,15,0]],l:[8,[4,21,4,0]],m:[30,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0,-1,-1,15,10,18,13,20,14,23,14,25,13,26,10,26,0]],n:[19,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],o:[19,[8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,16,6,16,8,15,11,13,13,11,14,8,14]],p:[19,[4,14,4,-7,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],q:[19,[15,14,15,-7,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],r:[13,[4,14,4,0,-1,-1,4,8,5,11,7,13,9,14,12,14]],s:[17,[14,11,13,13,10,14,7,14,4,13,3,11,4,9,6,8,11,7,13,6,14,4,14,3,13,1,10,0,7,0,4,1,3,3]],t:[12,[5,21,5,4,6,1,8,0,10,0,-1,-1,2,14,9,14]],u:[19,[4,14,4,4,5,1,7,0,10,0,12,1,15,4,-1,-1,15,14,15,0]],v:[16,[2,14,8,0,-1,-1,14,14,8,0]],w:[22,[3,14,7,0,-1,-1,11,14,7,0,-1,-1,11,14,15,0,-1,-1,19,14,15,0]],x:[17,[3,14,14,0,-1,-1,14,14,3,0]],y:[16,[2,14,8,0,-1,-1,14,14,8,0,6,-4,4,-6,2,-7,1,-7]],z:[17,[14,14,3,0,-1,-1,3,14,14,14,-1,-1,3,0,14,0]],"{":[14,[9,25,7,24,6,23,5,21,5,19,6,17,7,16,8,14,8,12,6,10,-1,-1,7,24,6,22,6,20,7,18,8,17,9,15,9,13,8,11,4,9,8,7,9,5,9,3,8,1,7,0,6,-2,6,-4,7,-6,-1,-1,6,8,8,6,8,4,7,2,6,1,5,-1,5,-3,6,-5,7,-6,9,-7]],"|":[8,[4,25,4,-7]],"}":[14,[5,25,7,24,8,23,9,21,9,19,8,17,7,16,6,14,6,12,8,10,-1,-1,7,24,8,22,8,20,7,18,6,17,5,15,5,13,6,11,10,9,6,7,5,5,5,3,6,1,7,0,8,-2,8,-4,7,-6,-1,-1,8,8,6,6,6,4,7,2,8,1,9,-1,9,-3,8,-5,7,-6,5,-7]],"~":[24,[3,6,3,8,4,11,6,12,8,12,10,11,14,8,16,7,18,7,20,8,21,10,-1,-1,3,8,4,10,6,11,8,11,10,10,14,7,16,6,18,6,20,7,21,10,21,12]]},wo={symbol:function(t,e,i,n,o){if("translucent"===t.renderPass){var r=ti.disabled,a=t.colorModeForRenderPass();0!==i.paint.get("icon-opacity").constantOr(1)&&ho(t,e,i,n,!1,i.paint.get("icon-translate"),i.paint.get("icon-translate-anchor"),i.layout.get("icon-rotation-alignment"),i.layout.get("icon-pitch-alignment"),i.layout.get("icon-keep-upright"),r,a,o),0!==i.paint.get("text-opacity").constantOr(1)&&ho(t,e,i,n,!0,i.paint.get("text-translate"),i.paint.get("text-translate-anchor"),i.layout.get("text-rotation-alignment"),i.layout.get("text-pitch-alignment"),i.layout.get("text-keep-upright"),r,a,o),e.map.showCollisionBoxes&&(lo(s=t,l=e,u=i,c=n,!1),lo(s,l,u,c,!0))}var s,l,u,c},circle:function(t,e,i,n){if("translucent"===t.renderPass){var o=i.paint.get("circle-opacity"),r=i.paint.get("circle-stroke-width"),a=i.paint.get("circle-stroke-opacity");if(0!==o.constantOr(1)||0!==r.constantOr(1)&&0!==a.constantOr(1))for(var s=t.context,l=s.gl,u=t.depthModeForSublayer(0,Qe.ReadOnly),c=ti.disabled,h=t.colorModeForRenderPass(),p=0;p<n.length;p++){var d=n[p],f=e.getTile(d),m=f.getBucket(i);if(m){var _=m.programConfigurations.get(i.id);t.useProgram("circle",_).draw(s,l.TRIANGLES,u,c,h,ii.disabled,Wn(t,d,f,i),i.id,m.layoutVertexBuffer,m.indexBuffer,m.segments,i.paint,t.transform.zoom,_)}}}},heatmap:function(t,e,i,n){if(0!==i.paint.get("heatmap-opacity"))if("offscreen"===t.renderPass){var o=t.context,r=o.gl,a=t.depthModeForSublayer(0,Qe.ReadOnly),s=ti.disabled,l=new ei([r.ONE,r.ONE],mt.Color.transparent,[!0,!0,!0,!0]);!function(t,e,i){var n=t.gl;t.activeTexture.set(n.TEXTURE1),t.viewport.set([0,0,e.width/4,e.height/4]);var o=i.heatmapFbo;if(o)n.bindTexture(n.TEXTURE_2D,o.colorAttachment.get()),t.bindFramebuffer.set(o.framebuffer);else{var r=n.createTexture();n.bindTexture(n.TEXTURE_2D,r),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),o=i.heatmapFbo=t.createFramebuffer(e.width/4,e.height/4),function t(e,i,n,o){var r=e.gl;r.texImage2D(r.TEXTURE_2D,0,r.RGBA,i.width/4,i.height/4,0,r.RGBA,e.extTextureHalfFloat?e.extTextureHalfFloat.HALF_FLOAT_OES:r.UNSIGNED_BYTE,null),o.colorAttachment.set(n),e.extTextureHalfFloat&&r.checkFramebufferStatus(r.FRAMEBUFFER)!==r.FRAMEBUFFER_COMPLETE&&(e.extTextureHalfFloat=null,o.colorAttachment.setDirty(),t(e,i,n,o))}(t,e,r,o)}}(o,t,i),o.clear({color:mt.Color.transparent});for(var u=0;u<n.length;u++){var c=n[u];if(!e.hasRenderableParent(c)){var h=e.getTile(c),p=h.getBucket(i);if(p){var d=p.programConfigurations.get(i.id),f=t.useProgram("heatmap",d),m=t.transform.zoom;f.draw(o,r.TRIANGLES,a,s,l,ii.disabled,(_=c.posMatrix,g=h,y=m,v=i.paint.get("heatmap-intensity"),{u_matrix:_,u_extrude_scale:Bi(g,1,y),u_intensity:v}),i.id,p.layoutVertexBuffer,p.indexBuffer,p.segments,i.paint,t.transform.zoom,d)}}}o.viewport.set([0,0,t.width,t.height])}else"translucent"===t.renderPass&&(t.context.setColorMode(t.colorModeForRenderPass()),function(t,e){var i=t.context,n=i.gl,o=e.heatmapFbo;if(o){i.activeTexture.set(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,o.colorAttachment.get()),i.activeTexture.set(n.TEXTURE1);var r=e.colorRampTexture;r||(r=e.colorRampTexture=new mt.Texture(i,e.colorRamp,n.RGBA)),r.bind(n.LINEAR,n.CLAMP_TO_EDGE),t.useProgram("heatmapTexture").draw(i,n.TRIANGLES,Qe.disabled,ti.disabled,t.colorModeForRenderPass(),ii.disabled,function(t,e,i,n){var o=mt.create();mt.ortho(o,0,t.width,t.height,0,0,1);var r=t.context.gl;return{u_matrix:o,u_world:[r.drawingBufferWidth,r.drawingBufferHeight],u_image:i,u_color_ramp:n,u_opacity:e.paint.get("heatmap-opacity")}}(t,e,0,1),e.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments,e.paint,t.transform.zoom)}}(t,i));var _,g,y,v},line:function(t,e,i,n){if("translucent"===t.renderPass){var o=i.paint.get("line-opacity"),r=i.paint.get("line-width");if(0!==o.constantOr(1)&&0!==r.constantOr(1)){var a=t.depthModeForSublayer(0,Qe.ReadOnly),s=t.colorModeForRenderPass(),l=i.paint.get("line-dasharray"),u=i.paint.get("line-pattern"),c=u.constantOr(1),h=i.paint.get("line-gradient"),p=i.getCrossfadeParameters(),d=l?"lineSDF":c?"linePattern":h?"lineGradient":"line",f=t.context,m=f.gl,_=!0;if(h){f.activeTexture.set(m.TEXTURE0);var g=i.gradientTexture;if(!i.gradient)return;g||(g=i.gradientTexture=new mt.Texture(f,i.gradient,m.RGBA)),g.bind(m.LINEAR,m.CLAMP_TO_EDGE)}for(var y=0,v=n;y<v.length;y+=1){var x=v[y],b=e.getTile(x);if(!c||b.patternsLoaded()){var w=b.getBucket(i);if(w){var L=w.programConfigurations.get(i.id),k=t.context.program.get(),T=t.useProgram(d,L),E=_||T.program!==k,M=u.constantOr(null);if(M&&b.imageAtlas){var C=b.imageAtlas.patternPositions[M.to],S=b.imageAtlas.patternPositions[M.from];C&&S&&L.setConstantPatternPositions(C,S)}var P=l?(j=b,$=i,V=l,Z=p,q=void 0,G=(N=t).transform,q=N.lineAtlas,H=eo(j,G),W="round"===$.layout.get("line-cap"),X=q.getDash(V.from,W),K=q.getDash(V.to,W),J=X.width*Z.fromScale,Y=K.width*Z.toScale,mt.extend(to(N,j,$),{u_patternscale_a:[H/J,-X.height/2],u_patternscale_b:[H/Y,-K.height/2],u_sdfgamma:q.width/(256*Math.min(J,Y)*mt.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:X.y,u_tex_y_b:K.y,u_mix:Z.t})):c?(O=b,R=i,B=p,void 0,F=(D=t).transform,U=eo(O,F),{u_matrix:io(D,O,R),u_texsize:O.imageAtlasTexture.size,u_ratio:1/Bi(O,1,F.zoom),u_device_pixel_ratio:mt.browser.devicePixelRatio,u_image:0,u_scale:[mt.browser.devicePixelRatio,U,B.fromScale,B.toScale],u_fade:B.t,u_units_to_pixels:[1/F.pixelsToGLUnits[0],1/F.pixelsToGLUnits[1]]}):h?(z=t,I=b,A=i,mt.extend(to(z,I,A),{u_image:0})):to(t,b,i);l&&(E||t.lineAtlas.dirty)?(f.activeTexture.set(m.TEXTURE0),t.lineAtlas.bind(f)):c&&(f.activeTexture.set(m.TEXTURE0),b.imageAtlasTexture.bind(m.LINEAR,m.CLAMP_TO_EDGE),L.updatePatternPaintBuffers(p)),T.draw(f,m.TRIANGLES,a,t.stencilModeForClipping(x),s,ii.disabled,P,i.id,w.layoutVertexBuffer,w.indexBuffer,w.segments,i.paint,t.transform.zoom,L),_=!1}}}}}var z,I,A,D,O,R,B,F,U,N,j,$,V,Z,G,q,H,W,X,K,J,Y},fill:function(t,e,i,n){var o=i.paint.get("fill-color"),r=i.paint.get("fill-opacity");if(0!==r.constantOr(1)){var a=t.colorModeForRenderPass(),s=i.paint.get("fill-pattern"),l=t.opaquePassEnabledForLayer()&&!s.constantOr(1)&&1===o.constantOr(mt.Color.transparent).a&&1===r.constantOr(0)?"opaque":"translucent";if(t.renderPass===l){var u=t.depthModeForSublayer(1,"opaque"===t.renderPass?Qe.ReadWrite:Qe.ReadOnly);fo(t,e,i,n,u,a,!1)}if("translucent"===t.renderPass&&i.paint.get("fill-antialias")){var c=t.depthModeForSublayer(i.getPaintProperty("fill-outline-color")?2:0,Qe.ReadOnly);fo(t,e,i,n,c,a,!0)}}},"fill-extrusion":function(t,e,i,n){var o=i.paint.get("fill-extrusion-opacity");if(0!==o&&"translucent"===t.renderPass){var r=new Qe(t.context.gl.LEQUAL,Qe.ReadWrite,t.depthRangeFor3D);if(1!==o||i.paint.get("fill-extrusion-pattern").constantOr(1))mo(t,e,i,n,r,ti.disabled,ei.disabled),mo(t,e,i,n,r,t.stencilModeFor3D(),t.colorModeForRenderPass());else{var a=t.colorModeForRenderPass();mo(t,e,i,n,r,ti.disabled,a)}}},hillshade:function(t,e,i,n){if("offscreen"===t.renderPass||"translucent"===t.renderPass){for(var o=t.context,r=e.getSource().maxzoom,a=t.depthModeForSublayer(0,Qe.ReadOnly),s=ti.disabled,l=t.colorModeForRenderPass(),u=0,c=n;u<c.length;u+=1){var h=c[u],p=e.getTile(h);p.needsHillshadePrepare&&"offscreen"===t.renderPass?go(t,p,i,r,a,s,l):"translucent"===t.renderPass&&_o(t,p,i,a,s,l)}o.viewport.set([0,0,t.width,t.height])}},raster:function(t,e,i,n){if("translucent"===t.renderPass&&0!==i.paint.get("raster-opacity"))for(var o=t.context,r=o.gl,a=e.getSource(),s=t.useProgram("raster"),l=ti.disabled,u=t.colorModeForRenderPass(),c=n.length&&n[0].overscaledZ,h=!t.options.moving,p=0,d=n;p<d.length;p+=1){var f=d[p],m=t.depthModeForSublayer(f.overscaledZ-c,1===i.paint.get("raster-opacity")?Qe.ReadWrite:Qe.ReadOnly,r.LESS),_=e.getTile(f),g=t.transform.calculatePosMatrix(f.toUnwrapped(),h);_.registerFadeDuration(i.paint.get("raster-fade-duration"));var y=e.findLoadedParent(f,0),v=yo(_,y,e,i,t.transform),x=void 0,b=void 0,w="nearest"===i.paint.get("raster-resampling")?r.NEAREST:r.LINEAR;o.activeTexture.set(r.TEXTURE0),_.texture.bind(w,r.CLAMP_TO_EDGE,r.LINEAR_MIPMAP_NEAREST),o.activeTexture.set(r.TEXTURE1),y?(y.texture.bind(w,r.CLAMP_TO_EDGE,r.LINEAR_MIPMAP_NEAREST),x=Math.pow(2,y.tileID.overscaledZ-_.tileID.overscaledZ),b=[_.tileID.canonical.x*x%1,_.tileID.canonical.y*x%1]):_.texture.bind(w,r.CLAMP_TO_EDGE,r.LINEAR_MIPMAP_NEAREST);var L=no(g,b||[0,0],x||1,v,i);a instanceof B?s.draw(o,r.TRIANGLES,m,l,u,ii.disabled,L,i.id,a.boundsBuffer,t.quadTriangleIndexBuffer,a.boundsSegments):_.maskedBoundsBuffer&&_.maskedIndexBuffer&&_.segments?s.draw(o,r.TRIANGLES,m,l,u,ii.disabled,L,i.id,_.maskedBoundsBuffer,_.maskedIndexBuffer,_.segments,i.paint,t.transform.zoom):s.draw(o,r.TRIANGLES,m,l,u,ii.disabled,L,i.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}},background:function(t,e,i){var n,o,r,a,s,l,u,c,h,p,d,f,m,_,g,y,v,x,b,w=i.paint.get("background-color"),L=i.paint.get("background-opacity");if(0!==L){var k=t.context,T=k.gl,E=t.transform,M=E.tileSize,C=i.paint.get("background-pattern");if(!t.isPatternMissing(C)){var S=C||1!==w.a||1!==L?"translucent":"opaque";if(t.renderPass===S){var P=ti.disabled,z=t.depthModeForSublayer(0,"opaque"==S?Qe.ReadWrite:Qe.ReadOnly),I=t.colorModeForRenderPass(),A=t.useProgram(C?"backgroundPattern":"background"),D=E.coveringTiles({tileSize:M});C&&(k.activeTexture.set(T.TEXTURE0),t.imageManager.bind(t.context));for(var O=i.getCrossfadeParameters(),R=0,B=D;R<B.length;R+=1){var F=B[R],U=t.transform.calculatePosMatrix(F.toUnwrapped()),N=C?(n=U,o=L,r=t,a=C,s={tileID:F,tileSize:M},l=O,b=x=v=y=g=_=m=f=d=p=h=c=u=void 0,mt.extend((u=a,c=l,p=s,d=(h=r).imageManager.getPattern(u.from),f=h.imageManager.getPattern(u.to),m=h.imageManager.getPixelSize(),_=m.width,g=m.height,y=Math.pow(2,p.tileID.overscaledZ),v=p.tileSize*Math.pow(2,h.transform.tileZoom)/y,x=v*(p.tileID.canonical.x+p.tileID.wrap*y),b=v*p.tileID.canonical.y,{u_image:0,u_pattern_tl_a:d.tl,u_pattern_br_a:d.br,u_pattern_tl_b:f.tl,u_pattern_br_b:f.br,u_texsize:[_,g],u_mix:c.t,u_pattern_size_a:d.displaySize,u_pattern_size_b:f.displaySize,u_scale_a:c.fromScale,u_scale_b:c.toScale,u_tile_units_to_pixels:1/Bi(p,1,h.transform.tileZoom),u_pixel_coord_upper:[x>>16,b>>16],u_pixel_coord_lower:[65535&x,65535&b]}),{u_matrix:n,u_opacity:o})):{u_matrix:U,u_opacity:L,u_color:w};A.draw(k,T.TRIANGLES,z,P,I,ii.disabled,N,i.id,t.tileExtentBuffer,t.quadTriangleIndexBuffer,t.tileExtentSegments)}}}}},debug:function(t,e,i){for(var n=0;n<i.length;n++)vo(t,e,i[n])},custom:function(t,e,i){var n=t.context,o=i.implementation;if("offscreen"===t.renderPass){var r=o.prerender;r&&(t.setCustomLayerDefaults(),n.setColorMode(t.colorModeForRenderPass()),r.call(o,n.gl,t.transform.customLayerMatrix()),n.setDirty(),t.setBaseState())}else if("translucent"===t.renderPass){t.setCustomLayerDefaults(),n.setColorMode(t.colorModeForRenderPass()),n.setStencilMode(ti.disabled);var a="3d"===o.renderingMode?new Qe(t.context.gl.LEQUAL,Qe.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,Qe.ReadOnly);n.setDepthMode(a),o.render(n.gl,t.transform.customLayerMatrix()),n.setDirty(),t.setBaseState(),n.bindFramebuffer.set(null)}}};function Lo(t,e){if(t.y>e.y){var i=t;t=e,e=i}return{x0:t.x,y0:t.y,x1:e.x,y1:e.y,dx:e.x-t.x,dy:e.y-t.y}}function ko(t,e,i,n,o){var r=Math.max(i,Math.floor(e.y0)),a=Math.min(n,Math.ceil(e.y1));if(t.x0===e.x0&&t.y0===e.y0?t.x0+e.dy/t.dy*t.dx<e.x1:t.x1-e.dy/t.dy*t.dx<e.x0){var s=t;t=e,e=s}for(var l=t.dx/t.dy,u=e.dx/e.dy,c=0<t.dx,h=e.dx<0,p=r;p<a;p++){var d=l*Math.max(0,Math.min(t.dy,p+c-t.y0))+t.x0,f=u*Math.max(0,Math.min(e.dy,p+h-e.y0))+e.x0;o(Math.floor(f),Math.ceil(d),p)}}function To(t,e,i,n,o,r){var a,s=Lo(t,e),l=Lo(e,i),u=Lo(i,t);s.dy>l.dy&&(a=s,s=l,l=a),s.dy>u.dy&&(a=s,s=u,u=a),l.dy>u.dy&&(a=l,l=u,u=a),s.dy&&ko(u,s,n,o,r),l.dy&&ko(u,l,n,o,r)}xo.prototype.resize=function(t,e){var i=this.context.gl;if(this.width=t*mt.browser.devicePixelRatio,this.height=e*mt.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var n=0,o=this.style._order;n<o.length;n+=1){var r=o[n];this.style._layers[r].resize()}this.depthRbo&&(i.deleteRenderbuffer(this.depthRbo),this.depthRbo=null)},xo.prototype.setup=function(){var t=this.context,e=new mt.StructArrayLayout2i4;e.emplaceBack(0,0),e.emplaceBack(mt.EXTENT,0),e.emplaceBack(0,mt.EXTENT),e.emplaceBack(mt.EXTENT,mt.EXTENT),this.tileExtentBuffer=t.createVertexBuffer(e,fn.members),this.tileExtentSegments=mt.SegmentVector.simpleSegment(0,0,4,2);var i=new mt.StructArrayLayout2i4;i.emplaceBack(0,0),i.emplaceBack(mt.EXTENT,0),i.emplaceBack(0,mt.EXTENT),i.emplaceBack(mt.EXTENT,mt.EXTENT),this.debugBuffer=t.createVertexBuffer(i,fn.members),this.debugSegments=mt.SegmentVector.simpleSegment(0,0,4,5);var n=new mt.StructArrayLayout4i8;n.emplaceBack(0,0,0,0),n.emplaceBack(mt.EXTENT,0,mt.EXTENT,0),n.emplaceBack(0,mt.EXTENT,0,mt.EXTENT),n.emplaceBack(mt.EXTENT,mt.EXTENT,mt.EXTENT,mt.EXTENT),this.rasterBoundsBuffer=t.createVertexBuffer(n,mt.rasterBoundsAttributes.members),this.rasterBoundsSegments=mt.SegmentVector.simpleSegment(0,0,4,2);var o=new mt.StructArrayLayout2i4;o.emplaceBack(0,0),o.emplaceBack(1,0),o.emplaceBack(0,1),o.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(o,fn.members),this.viewportSegments=mt.SegmentVector.simpleSegment(0,0,4,2);var r=new mt.StructArrayLayout1ui2;r.emplaceBack(0),r.emplaceBack(1),r.emplaceBack(3),r.emplaceBack(2),r.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(r);var a=new mt.StructArrayLayout3ui6;a.emplaceBack(0,1,2),a.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(a);var s=this.context.gl;this.stencilClearMode=new ti({func:s.ALWAYS,mask:0},0,255,s.ZERO,s.ZERO,s.ZERO)},xo.prototype.clearStencil=function(){var t=this.context,e=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var i=mt.create();mt.ortho(i,0,this.width,this.height,0,0,1),mt.scale(i,i,[e.drawingBufferWidth,e.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(t,e.TRIANGLES,Qe.disabled,this.stencilClearMode,ei.disabled,ii.disabled,Kn(i),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},xo.prototype._renderTileClippingMasks=function(t,e){if(this.currentStencilSource!==t.source&&t.isTileClipped()&&e&&e.length){this.currentStencilSource=t.source;var i=this.context,n=i.gl;256<this.nextStencilID+e.length&&this.clearStencil(),i.setColorMode(ei.disabled),i.setDepthMode(Qe.disabled);var o=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var r=0,a=e;r<a.length;r+=1){var s=a[r],l=this._tileClippingMaskIDs[s.key]=this.nextStencilID++;o.draw(i,n.TRIANGLES,Qe.disabled,new ti({func:n.ALWAYS,mask:0},l,255,n.KEEP,n.KEEP,n.REPLACE),ei.disabled,ii.disabled,Kn(s.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},xo.prototype.stencilModeFor3D=function(){256<this.nextStencilID+1&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new ti({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},xo.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new ti({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},xo.prototype.colorModeForRenderPass=function(){var t=this.context.gl;return this._showOverdrawInspector?new ei([t.CONSTANT_COLOR,t.ONE],new mt.Color(1/8,1/8,1/8,0),[!0,!0,!0,!0]):"opaque"===this.renderPass?ei.unblended:ei.alphaBlended},xo.prototype.depthModeForSublayer=function(t,e,i){if(!this.opaquePassEnabledForLayer())return Qe.disabled;var n=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new Qe(i||this.context.gl.LEQUAL,e,[n,n])},xo.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},xo.prototype.render=function(t,e){this.style=t,this.options=e,this.lineAtlas=t.lineAtlas,this.imageManager=t.imageManager,this.glyphManager=t.glyphManager,this.symbolFadeChange=t.placement.symbolFadeChange(mt.browser.now()),this.imageManager.beginFrame();var i=this.style._order,n=this.style.sourceCaches;for(var o in n){var r=n[o];r.used&&r.prepare(this.context)}var a={},s={},l={};for(var u in n){var c=n[u];a[u]=c.getVisibleCoordinates(),s[u]=a[u].slice().reverse(),l[u]=c.getVisibleCoordinates(!0).reverse()}for(var h in n){var p=n[h],d=p.getSource();if("raster"===d.type||"raster-dem"===d.type){for(var f=[],m=0,_=a[h];m<_.length;m+=1){var g=_[m];f.push(p.getTile(g))}ao(f,this.context)}}this.opaquePassCutoff=1/0;for(var y=0;y<i.length;y++){var v=i[y];if(this.style._layers[v].is3D()){this.opaquePassCutoff=y;break}}this.renderPass="offscreen",this.depthRboNeedsClear=!0;for(var x=0,b=i;x<b.length;x+=1){var w=b[x],L=this.style._layers[w];if(L.hasOffscreenPass()&&!L.isHidden(this.transform.zoom)){var k=s[L.source];"custom"!==L.type&&!k.length||this.renderLayer(this,n[L.source],L,k)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:e.showOverdrawInspector?mt.Color.black:mt.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=e.showOverdrawInspector,this.depthRangeFor3D=[0,1-(t._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=i.length-1;0<=this.currentLayer;this.currentLayer--){var T=this.style._layers[i[this.currentLayer]],E=n[T.source],M=a[T.source];this._renderTileClippingMasks(T,M),this.renderLayer(this,E,T,M)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<i.length;this.currentLayer++){var C=this.style._layers[i[this.currentLayer]],S=n[C.source],P=("symbol"===C.type?l:s)[C.source];this._renderTileClippingMasks(C,a[C.source]),this.renderLayer(this,S,C,P)}if(this.options.showTileBoundaries)for(var z in n){wo.debug(this,n[z],a[z]);break}this.context.setDefault()},xo.prototype.setupOffscreenDepthRenderbuffer=function(){var t=this.context;this.depthRbo||(this.depthRbo=t.createRenderbuffer(t.gl.DEPTH_COMPONENT16,this.width,this.height))},xo.prototype.renderLayer=function(t,e,i,n){i.isHidden(this.transform.zoom)||"background"!==i.type&&"custom"!==i.type&&!n.length||(this.id=i.id,wo[i.type](t,e,i,n,this.style.placement.variableOffsets))},xo.prototype.translatePosMatrix=function(t,e,i,n,o){if(!i[0]&&!i[1])return t;var r=o?"map"===n?this.transform.angle:0:"viewport"===n?-this.transform.angle:0;if(r){var a=Math.sin(r),s=Math.cos(r);i=[i[0]*s-i[1]*a,i[0]*a+i[1]*s]}var l=[o?i[0]:Bi(e,i[0],this.transform.zoom),o?i[1]:Bi(e,i[1],this.transform.zoom),0],u=new Float32Array(16);return mt.translate(u,t,l),u},xo.prototype.saveTileTexture=function(t){var e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t]},xo.prototype.getTileTexture=function(t){var e=this._tileTextures[t];return e&&0<e.length?e.pop():null},xo.prototype.isPatternMissing=function(t){if(!t)return!1;var e=this.imageManager.getPattern(t.from),i=this.imageManager.getPattern(t.to);return!e||!i},xo.prototype.useProgram=function(t,e){void 0===e&&(e=this.emptyProgramConfiguration),this.cache=this.cache||{};var i=""+t+(e.cacheKey||"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[i]||(this.cache[i]=new Vn(this.context,$n[t],e,ro[t],this._showOverdrawInspector)),this.cache[i]},xo.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},xo.prototype.setBaseState=function(){var t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)};function Eo(t,e,i){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===i||i,this._minZoom=t||0,this._maxZoom=e||22,this.setMaxBounds(),this.width=0,this.height=0,this._center=new mt.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._posMatrixCache={},this._alignedPosMatrixCache={}}var Mo={minZoom:{configurable:!0},maxZoom:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerPoint:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};Eo.prototype.clone=function(){var t=new Eo(this._minZoom,this._maxZoom,this._renderWorldCopies);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t._center=this._center,t.zoom=this.zoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._unmodified=this._unmodified,t._calcMatrices(),t},Mo.minZoom.get=function(){return this._minZoom},Mo.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},Mo.maxZoom.get=function(){return this._maxZoom},Mo.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},Mo.renderWorldCopies.get=function(){return this._renderWorldCopies},Mo.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},Mo.worldSize.get=function(){return this.tileSize*this.scale},Mo.centerPoint.get=function(){return this.size._div(2)},Mo.size.get=function(){return new mt.Point(this.width,this.height)},Mo.bearing.get=function(){return-this.angle/Math.PI*180},Mo.bearing.set=function(t){var e=-mt.wrap(t,-180,180)*Math.PI/180;this.angle!==e&&(this._unmodified=!1,this.angle=e,this._calcMatrices(),this.rotationMatrix=mt.create$2(),mt.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},Mo.pitch.get=function(){return this._pitch/Math.PI*180},Mo.pitch.set=function(t){var e=mt.clamp(t,0,60)/180*Math.PI;this._pitch!==e&&(this._unmodified=!1,this._pitch=e,this._calcMatrices())},Mo.fov.get=function(){return this._fov/Math.PI*180},Mo.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())},Mo.zoom.get=function(){return this._zoom},Mo.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())},Mo.center.get=function(){return this._center},Mo.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},Eo.prototype.coveringZoomLevel=function(t){return(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},Eo.prototype.getVisibleUnwrappedCoordinates=function(t){var e=[new mt.UnwrappedTileID(0,t)];if(this._renderWorldCopies)for(var i=this.pointCoordinate(new mt.Point(0,0)),n=this.pointCoordinate(new mt.Point(this.width,0)),o=this.pointCoordinate(new mt.Point(this.width,this.height)),r=this.pointCoordinate(new mt.Point(0,this.height)),a=Math.floor(Math.min(i.x,n.x,o.x,r.x)),s=Math.floor(Math.max(i.x,n.x,o.x,r.x)),l=a-1;l<=s+1;l++)0!==l&&e.push(new mt.UnwrappedTileID(l,t));return e},Eo.prototype.coveringTiles=function(t){var e=this.coveringZoomLevel(t),i=e;if(void 0!==t.minzoom&&e<t.minzoom)return[];void 0!==t.maxzoom&&e>t.maxzoom&&(e=t.maxzoom);var n=mt.MercatorCoordinate.fromLngLat(this.center),o=Math.pow(2,e),r=new mt.Point(o*n.x-.5,o*n.y-.5);return function(s,t,l,u){void 0===u&&(u=!0);var c=1<<s,h={};function e(t,e,i){var n,o,r,a;if(0<=i&&i<=c)for(n=t;n<e;n++)o=Math.floor(n/c),r=(n%c+c)%c,0!==o&&!0!==u||(a=new mt.OverscaledTileID(l,o,s,r,i),h[a.key]=a)}var i=t.map(function(t){return new mt.Point(t.x,t.y)._mult(c)});return To(i[0],i[1],i[2],0,c,e),To(i[2],i[3],i[0],0,c,e),Object.keys(h).map(function(t){return h[t]})}(e,[this.pointCoordinate(new mt.Point(0,0)),this.pointCoordinate(new mt.Point(this.width,0)),this.pointCoordinate(new mt.Point(this.width,this.height)),this.pointCoordinate(new mt.Point(0,this.height))],t.reparseOverscaled?i:e,this._renderWorldCopies).sort(function(t,e){return r.dist(t.canonical)-r.dist(e.canonical)})},Eo.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},Mo.unmodified.get=function(){return this._unmodified},Eo.prototype.zoomScale=function(t){return Math.pow(2,t)},Eo.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},Eo.prototype.project=function(t){var e=mt.clamp(t.lat,-this.maxValidLatitude,this.maxValidLatitude);return new mt.Point(mt.mercatorXfromLng(t.lng)*this.worldSize,mt.mercatorYfromLat(e)*this.worldSize)},Eo.prototype.unproject=function(t){return new mt.MercatorCoordinate(t.x/this.worldSize,t.y/this.worldSize).toLngLat()},Mo.point.get=function(){return this.project(this.center)},Eo.prototype.setLocationAtPoint=function(t,e){var i=this.pointCoordinate(e),n=this.pointCoordinate(this.centerPoint),o=this.locationCoordinate(t),r=new mt.MercatorCoordinate(o.x-(i.x-n.x),o.y-(i.y-n.y));this.center=this.coordinateLocation(r),this._renderWorldCopies&&(this.center=this.center.wrap())},Eo.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},Eo.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},Eo.prototype.locationCoordinate=function(t){return mt.MercatorCoordinate.fromLngLat(t)},Eo.prototype.coordinateLocation=function(t){return t.toLngLat()},Eo.prototype.pointCoordinate=function(t){var e=[t.x,t.y,0,1],i=[t.x,t.y,1,1];mt.transformMat4(e,e,this.pixelMatrixInverse),mt.transformMat4(i,i,this.pixelMatrixInverse);var n=e[3],o=i[3],r=e[0]/n,a=i[0]/o,s=e[1]/n,l=i[1]/o,u=e[2]/n,c=i[2]/o,h=u==c?0:(0-u)/(c-u);return new mt.MercatorCoordinate(mt.number(r,a,h)/this.worldSize,mt.number(s,l,h)/this.worldSize)},Eo.prototype.coordinatePoint=function(t){var e=[t.x*this.worldSize,t.y*this.worldSize,0,1];return mt.transformMat4(e,e,this.pixelMatrix),new mt.Point(e[0]/e[3],e[1]/e[3])},Eo.prototype.getBounds=function(){return(new mt.LngLatBounds).extend(this.pointLocation(new mt.Point(0,0))).extend(this.pointLocation(new mt.Point(this.width,0))).extend(this.pointLocation(new mt.Point(this.width,this.height))).extend(this.pointLocation(new mt.Point(0,this.height)))},Eo.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new mt.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},Eo.prototype.setMaxBounds=function(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},Eo.prototype.calculatePosMatrix=function(t,e){void 0===e&&(e=!1);var i=t.key,n=e?this._alignedPosMatrixCache:this._posMatrixCache;if(n[i])return n[i];var o=t.canonical,r=this.worldSize/this.zoomScale(o.z),a=o.x+Math.pow(2,o.z)*t.wrap,s=mt.identity(new Float64Array(16));return mt.translate(s,s,[a*r,o.y*r,0]),mt.scale(s,s,[r/mt.EXTENT,r/mt.EXTENT,1]),mt.multiply(s,e?this.alignedProjMatrix:this.projMatrix,s),n[i]=new Float32Array(s),n[i]},Eo.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Eo.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,e,i,n,o=-90,r=90,a=-180,s=180,l=this.size,u=this._unmodified;if(this.latRange){var c=this.latRange;o=mt.mercatorYfromLat(c[1])*this.worldSize,t=(r=mt.mercatorYfromLat(c[0])*this.worldSize)-o<l.y?l.y/(r-o):0}if(this.lngRange){var h=this.lngRange;a=mt.mercatorXfromLng(h[0])*this.worldSize,e=(s=mt.mercatorXfromLng(h[1])*this.worldSize)-a<l.x?l.x/(s-a):0}var p=this.point,d=Math.max(e||0,t||0);if(d)return this.center=this.unproject(new mt.Point(e?(s+a)/2:p.x,t?(r+o)/2:p.y)),this.zoom+=this.scaleZoom(d),this._unmodified=u,void(this._constraining=!1);if(this.latRange){var f=p.y,m=l.y/2;f-m<o&&(n=o+m),r<f+m&&(n=r-m)}if(this.lngRange){var _=p.x,g=l.x/2;_-g<a&&(i=a+g),s<_+g&&(i=s-g)}void 0===i&&void 0===n||(this.center=this.unproject(new mt.Point(void 0!==i?i:p.x,void 0!==n?n:p.y))),this._unmodified=u,this._constraining=!1}},Eo.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,i=Math.sin(t)*this.cameraToCenterDistance/Math.sin(Math.PI-e-t),n=this.point,o=n.x,r=n.y,a=1.01*(Math.cos(Math.PI/2-this._pitch)*i+this.cameraToCenterDistance),s=new Float64Array(16);mt.perspective(s,this._fov,this.width/this.height,1,a),mt.scale(s,s,[1,-1,1]),mt.translate(s,s,[0,0,-this.cameraToCenterDistance]),mt.rotateX(s,s,this._pitch),mt.rotateZ(s,s,this.angle),mt.translate(s,s,[-o,-r,0]),this.mercatorMatrix=mt.scale([],s,[this.worldSize,this.worldSize,this.worldSize]),mt.scale(s,s,[1,1,mt.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=s;var l=this.width%2/2,u=this.height%2/2,c=Math.cos(this.angle),h=Math.sin(this.angle),p=o-Math.round(o)+c*l+h*u,d=r-Math.round(r)+c*u+h*l,f=new Float64Array(s);if(mt.translate(f,f,[.5<p?p-1:p,.5<d?d-1:d,0]),this.alignedProjMatrix=f,s=mt.create(),mt.scale(s,s,[this.width/2,-this.height/2,1]),mt.translate(s,s,[1,-1,0]),this.labelPlaneMatrix=s,s=mt.create(),mt.scale(s,s,[1,-1,1]),mt.translate(s,s,[-1,-1,0]),mt.scale(s,s,[2/this.width,2/this.height,1]),this.glCoordMatrix=s,this.pixelMatrix=mt.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(s=mt.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=s,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Eo.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var t=this.pointCoordinate(new mt.Point(0,0)),e=[t.x*this.worldSize,t.y*this.worldSize,0,1];return mt.transformMat4(e,e,this.pixelMatrix)[3]/this.cameraToCenterDistance},Eo.prototype.getCameraPoint=function(){var t=this._pitch,e=Math.tan(t)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new mt.Point(0,e))},Eo.prototype.getCameraQueryGeometry=function(t){var e=this.getCameraPoint();if(1===t.length)return[t[0],e];for(var i=e.x,n=e.y,o=e.x,r=e.y,a=0,s=t;a<s.length;a+=1){var l=s[a];i=Math.min(i,l.x),n=Math.min(n,l.y),o=Math.max(o,l.x),r=Math.max(r,l.y)}return[new mt.Point(i,n),new mt.Point(o,n),new mt.Point(o,r),new mt.Point(i,r),new mt.Point(i,n)]},Object.defineProperties(Eo.prototype,Mo);function Co(){var t,e,i,n;mt.bindAll(["_onHashChange","_updateHash"],this),this._updateHash=(t=this._updateHashUnthrottled.bind(this),e=!300,i=null,n=function(){i=null,e&&(t(),i=setTimeout(n,300),e=!1)},function(){return e=!0,i||n(),i})}Co.prototype.addTo=function(t){return this._map=t,mt.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},Co.prototype.remove=function(){return mt.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},Co.prototype.getHashString=function(t){var e=this._map.getCenter(),i=Math.round(100*this._map.getZoom())/100,n=Math.ceil((i*Math.LN2+Math.log(512/360/.5))/Math.LN10),o=Math.pow(10,n),r=Math.round(e.lng*o)/o,a=Math.round(e.lat*o)/o,s=this._map.getBearing(),l=this._map.getPitch(),u="";return u+=t?"#/"+r+"/"+a+"/"+i:"#"+i+"/"+a+"/"+r,(s||l)&&(u+="/"+Math.round(10*s)/10),l&&(u+="/"+Math.round(l)),u},Co.prototype._onHashChange=function(){var t=mt.window.location.hash.replace("#","").split("/");return 3<=t.length&&(this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:+(t[3]||0),pitch:+(t[4]||0)}),!0)},Co.prototype._updateHashUnthrottled=function(){var t=this.getHashString();try{mt.window.history.replaceState(mt.window.history.state,"",t)}catch(t){}};function So(t){this._map=t,this._el=t.getCanvasContainer(),this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,mt.bindAll(["_onWheel","_onTimeout","_onScrollFrame","_onScrollFinished"],this)}var Po=function(a){function t(t,e,i,n){void 0===n&&(n={});var o=y.mousePos(e.getCanvasContainer(),i),r=e.unproject(o);a.call(this,t,mt.extend({point:o,lngLat:r,originalEvent:i},n)),this._defaultPrevented=!1,this.target=e}a&&(t.__proto__=a);var e={defaultPrevented:{configurable:!0}};return((t.prototype=Object.create(a&&a.prototype)).constructor=t).prototype.preventDefault=function(){this._defaultPrevented=!0},e.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(t.prototype,e),t}(mt.Event),zo=function(s){function t(t,e,i){var n=y.touchPos(e.getCanvasContainer(),i),o=n.map(function(t){return e.unproject(t)}),r=n.reduce(function(t,e,i,n){return t.add(e.div(n.length))},new mt.Point(0,0)),a=e.unproject(r);s.call(this,t,{points:n,point:r,lngLats:o,lngLat:a,originalEvent:i}),this._defaultPrevented=!1}s&&(t.__proto__=s);var e={defaultPrevented:{configurable:!0}};return((t.prototype=Object.create(s&&s.prototype)).constructor=t).prototype.preventDefault=function(){this._defaultPrevented=!0},e.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(t.prototype,e),t}(mt.Event),Io=function(n){function t(t,e,i){n.call(this,t,{originalEvent:i}),this._defaultPrevented=!1}n&&(t.__proto__=n);var e={defaultPrevented:{configurable:!0}};return((t.prototype=Object.create(n&&n.prototype)).constructor=t).prototype.preventDefault=function(){this._defaultPrevented=!0},e.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(t.prototype,e),t}(mt.Event);So.prototype.setZoomRate=function(t){this._defaultZoomRate=t},So.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},So.prototype.isEnabled=function(){return!!this._enabled},So.prototype.isActive=function(){return!!this._active},So.prototype.isZooming=function(){return!!this._zooming},So.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},So.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},So.prototype.onWheel=function(t){if(this.isEnabled()){var e=t.deltaMode===mt.window.WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY,i=mt.browser.now(),n=i-(this._lastWheelEventTime||0);this._lastWheelEventTime=i,0!==e&&e%4.000244140625==0?this._type="wheel":0!==e&&Math.abs(e)<4?this._type="trackpad":400<n?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40,t)):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._lastWheelEvent=t,this._delta-=e,this.isActive()||this._start(t)),t.preventDefault()}},So.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this.isActive()||this._start(t)},So.prototype._start=function(t){if(this._delta){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0,this._map.fire(new mt.Event("movestart",{originalEvent:t})),this._map.fire(new mt.Event("zoomstart",{originalEvent:t}))),this._finishTimeout&&clearTimeout(this._finishTimeout);var e=y.mousePos(this._el,t);this._around=mt.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(e)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onScrollFrame))}},So.prototype._onScrollFrame=function(){var t=this;if(this._frameId=null,this.isActive()){var e=this._map.transform;if(0!==this._delta){var i="wheel"===this._type&&4.000244140625<Math.abs(this._delta)?this._wheelZoomRate:this._defaultZoomRate,n=2/(1+Math.exp(-Math.abs(this._delta*i)));this._delta<0&&0!==n&&(n=1/n);var o="number"==typeof this._targetZoom?e.zoomScale(this._targetZoom):e.scale;this._targetZoom=Math.min(e.maxZoom,Math.max(e.minZoom,e.scaleZoom(o*n))),"wheel"===this._type&&(this._startZoom=e.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var r="number"==typeof this._targetZoom?this._targetZoom:e.zoom,a=this._startZoom,s=this._easing,l=!1;if("wheel"===this._type&&a&&s){var u=Math.min((mt.browser.now()-this._lastWheelEventTime)/200,1),c=s(u);e.zoom=mt.number(a,r,c),u<1?this._frameId||(this._frameId=this._map._requestRenderFrame(this._onScrollFrame)):l=!0}else e.zoom=r,l=!0;e.setLocationAtPoint(this._around,this._aroundPoint),this._map.fire(new mt.Event("move",{originalEvent:this._lastWheelEvent})),this._map.fire(new mt.Event("zoom",{originalEvent:this._lastWheelEvent})),l&&(this._active=!1,this._finishTimeout=setTimeout(function(){t._zooming=!1,t._map.fire(new mt.Event("zoomend",{originalEvent:t._lastWheelEvent})),t._map.fire(new mt.Event("moveend",{originalEvent:t._lastWheelEvent})),delete t._targetZoom},200))}},So.prototype._smoothOutEasing=function(t){var e=mt.ease;if(this._prevEase){var i=this._prevEase,n=(mt.browser.now()-i.start)/i.duration,o=i.easing(.01+n)-i.easing(n),r=.27/Math.sqrt(o*o+1e-4)*.01,a=Math.sqrt(.0729-r*r);e=mt.bezier(r,a,.25,1)}return this._prevEase={start:mt.browser.now(),duration:t,easing:e},e};function Ao(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1,mt.bindAll(["_onMouseMove","_onMouseUp","_onKeyDown"],this)}Ao.prototype.isEnabled=function(){return!!this._enabled},Ao.prototype.isActive=function(){return!!this._active},Ao.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Ao.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Ao.prototype.onMouseDown=function(t){this.isEnabled()&&t.shiftKey&&0===t.button&&(mt.window.document.addEventListener("mousemove",this._onMouseMove,!1),mt.window.document.addEventListener("keydown",this._onKeyDown,!1),mt.window.document.addEventListener("mouseup",this._onMouseUp,!1),y.disableDrag(),this._startPos=this._lastPos=y.mousePos(this._el,t),this._active=!0)},Ao.prototype._onMouseMove=function(t){var e=y.mousePos(this._el,t);if(!(this._lastPos.equals(e)||!this._box&&e.dist(this._startPos)<this._clickTolerance)){var i=this._startPos;this._lastPos=e,this._box||(this._box=y.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var n=Math.min(i.x,e.x),o=Math.max(i.x,e.x),r=Math.min(i.y,e.y),a=Math.max(i.y,e.y);y.setTransform(this._box,"translate("+n+"px,"+r+"px)"),this._box.style.width=o-n+"px",this._box.style.height=a-r+"px"}},Ao.prototype._onMouseUp=function(t){if(0===t.button){var e=this._startPos,i=y.mousePos(this._el,t);this._finish(),y.suppressClick(),e.x===i.x&&e.y===i.y?this._fireEvent("boxzoomcancel",t):this._map.fitScreenCoordinates(e,i,this._map.getBearing(),{linear:!0}).fire(new mt.Event("boxzoomend",{originalEvent:t}))}},Ao.prototype._onKeyDown=function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t))},Ao.prototype._finish=function(){this._active=!1,mt.window.document.removeEventListener("mousemove",this._onMouseMove,!1),mt.window.document.removeEventListener("keydown",this._onKeyDown,!1),mt.window.document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box&&(y.remove(this._box),this._box=null),y.enableDrag(),delete this._startPos,delete this._lastPos},Ao.prototype._fireEvent=function(t,e){return this._map.fire(new mt.Event(t,{originalEvent:e}))};function Do(t,e){this._map=t,this._el=e.element||t.getCanvasContainer(),this._state="disabled",this._button=e.button||"right",this._bearingSnap=e.bearingSnap||0,this._pitchWithRotate=!1!==e.pitchWithRotate,mt.bindAll(["onMouseDown","_onMouseMove","_onMouseUp","_onBlur","_onDragFrame"],this)}var Oo=mt.bezier(0,0,.25,1);Do.prototype.isEnabled=function(){return"disabled"!==this._state},Do.prototype.isActive=function(){return"active"===this._state},Do.prototype.enable=function(){this.isEnabled()||(this._state="enabled")},Do.prototype.disable=function(){if(this.isEnabled())switch(this._state){case"active":this._state="disabled",this._unbind(),this._deactivate(),this._fireEvent("rotateend"),this._pitchWithRotate&&this._fireEvent("pitchend"),this._fireEvent("moveend");break;case"pending":this._state="disabled",this._unbind();break;default:this._state="disabled"}},Do.prototype.onMouseDown=function(t){if("enabled"===this._state){if("right"===this._button){if(this._eventButton=y.mouseButton(t),this._eventButton!==(t.ctrlKey?0:2))return}else{if(t.ctrlKey||0!==y.mouseButton(t))return;this._eventButton=0}y.disableDrag(),mt.window.document.addEventListener("mousemove",this._onMouseMove,{capture:!0}),mt.window.document.addEventListener("mouseup",this._onMouseUp),mt.window.addEventListener("blur",this._onBlur),this._state="pending",this._inertia=[[mt.browser.now(),this._map.getBearing()]],this._startPos=this._lastPos=y.mousePos(this._el,t),this._center=this._map.transform.centerPoint,t.preventDefault()}},Do.prototype._onMouseMove=function(t){var e=y.mousePos(this._el,t);this._lastPos.equals(e)||(this._lastMoveEvent=t,this._lastPos=e,"pending"===this._state&&(this._state="active",this._fireEvent("rotatestart",t),this._fireEvent("movestart",t),this._pitchWithRotate&&this._fireEvent("pitchstart",t)),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onDragFrame)))},Do.prototype._onDragFrame=function(){this._frameId=null;var t=this._lastMoveEvent;if(t){var e=this._map.transform,i=this._startPos,n=this._lastPos,o=.8*(i.x-n.x),r=-.5*(i.y-n.y),a=e.bearing-o,s=e.pitch-r,l=this._inertia,u=l[l.length-1];this._drainInertiaBuffer(),l.push([mt.browser.now(),this._map._normalizeBearing(a,u[1])]),e.bearing=a,this._pitchWithRotate&&(this._fireEvent("pitch",t),e.pitch=s),this._fireEvent("rotate",t),this._fireEvent("move",t),delete this._lastMoveEvent,this._startPos=this._lastPos}},Do.prototype._onMouseUp=function(t){if(y.mouseButton(t)===this._eventButton)switch(this._state){case"active":this._state="enabled",y.suppressClick(),this._unbind(),this._deactivate(),this._inertialRotate(t);break;case"pending":this._state="enabled",this._unbind()}},Do.prototype._onBlur=function(t){switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._fireEvent("rotateend",t),this._pitchWithRotate&&this._fireEvent("pitchend",t),this._fireEvent("moveend",t);break;case"pending":this._state="enabled",this._unbind()}},Do.prototype._unbind=function(){mt.window.document.removeEventListener("mousemove",this._onMouseMove,{capture:!0}),mt.window.document.removeEventListener("mouseup",this._onMouseUp),mt.window.removeEventListener("blur",this._onBlur),y.enableDrag()},Do.prototype._deactivate=function(){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._lastMoveEvent,delete this._startPos,delete this._lastPos},Do.prototype._inertialRotate=function(t){var e=this;this._fireEvent("rotateend",t),this._drainInertiaBuffer();function i(){Math.abs(o)<e._bearingSnap?n.resetNorth({noMoveStart:!0},{originalEvent:t}):e._fireEvent("moveend",t),e._pitchWithRotate&&e._fireEvent("pitchend",t)}var n=this._map,o=n.getBearing(),r=this._inertia;if(r.length<2)i();else{var a=r[0],s=r[r.length-1],l=r[r.length-2],u=n._normalizeBearing(o,l[1]),c=s[1]-a[1],h=c<0?-1:1,p=(s[0]-a[0])/1e3;if(0!=c&&0!=p){var d=Math.abs(.25/p*c);180<d&&(d=180);var f=d/180;u+=h*d*(f/2),Math.abs(n._normalizeBearing(u,0))<this._bearingSnap&&(u=n._normalizeBearing(0,u)),n.rotateTo(u,{duration:1e3*f,easing:Oo,noMoveStart:!0},{originalEvent:t})}else i()}},Do.prototype._fireEvent=function(t,e){return this._map.fire(new mt.Event(t,e?{originalEvent:e}:{}))},Do.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,e=mt.browser.now();0<t.length&&160<e-t[0][0];)t.shift()};function Ro(t,e){this._map=t,this._el=t.getCanvasContainer(),this._state="disabled",this._clickTolerance=e.clickTolerance||1,mt.bindAll(["_onMove","_onMouseUp","_onTouchEnd","_onBlur","_onDragFrame"],this)}var Bo=mt.bezier(0,0,.3,1);Ro.prototype.isEnabled=function(){return"disabled"!==this._state},Ro.prototype.isActive=function(){return"active"===this._state},Ro.prototype.enable=function(){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-drag-pan"),this._state="enabled")},Ro.prototype.disable=function(){if(this.isEnabled())switch(this._el.classList.remove("mapboxgl-touch-drag-pan"),this._state){case"active":this._state="disabled",this._unbind(),this._deactivate(),this._fireEvent("dragend"),this._fireEvent("moveend");break;case"pending":this._state="disabled",this._unbind();break;default:this._state="disabled"}},Ro.prototype.onMouseDown=function(t){"enabled"===this._state&&(t.ctrlKey||0!==y.mouseButton(t)||(y.addEventListener(mt.window.document,"mousemove",this._onMove,{capture:!0}),y.addEventListener(mt.window.document,"mouseup",this._onMouseUp),this._start(t)))},Ro.prototype.onTouchStart=function(t){"enabled"===this._state&&(1<t.touches.length||(y.addEventListener(mt.window.document,"touchmove",this._onMove,{capture:!0,passive:!1}),y.addEventListener(mt.window.document,"touchend",this._onTouchEnd),this._start(t)))},Ro.prototype._start=function(t){mt.window.addEventListener("blur",this._onBlur),this._state="pending",this._startPos=this._mouseDownPos=this._lastPos=y.mousePos(this._el,t),this._inertia=[[mt.browser.now(),this._startPos]]},Ro.prototype._onMove=function(t){t.preventDefault();var e=y.mousePos(this._el,t);this._lastPos.equals(e)||"pending"===this._state&&e.dist(this._mouseDownPos)<this._clickTolerance||(this._lastMoveEvent=t,this._lastPos=e,this._drainInertiaBuffer(),this._inertia.push([mt.browser.now(),this._lastPos]),"pending"===this._state&&(this._state="active",this._fireEvent("dragstart",t),this._fireEvent("movestart",t)),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onDragFrame)))},Ro.prototype._onDragFrame=function(){this._frameId=null;var t=this._lastMoveEvent;if(t){var e=this._map.transform;e.setLocationAtPoint(e.pointLocation(this._startPos),this._lastPos),this._fireEvent("drag",t),this._fireEvent("move",t),this._startPos=this._lastPos,delete this._lastMoveEvent}},Ro.prototype._onMouseUp=function(t){if(0===y.mouseButton(t))switch(this._state){case"active":this._state="enabled",y.suppressClick(),this._unbind(),this._deactivate(),this._inertialPan(t);break;case"pending":this._state="enabled",this._unbind()}},Ro.prototype._onTouchEnd=function(t){switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._inertialPan(t);break;case"pending":this._state="enabled",this._unbind()}},Ro.prototype._onBlur=function(t){switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._fireEvent("dragend",t),this._fireEvent("moveend",t);break;case"pending":this._state="enabled",this._unbind()}},Ro.prototype._unbind=function(){y.removeEventListener(mt.window.document,"touchmove",this._onMove,{capture:!0,passive:!1}),y.removeEventListener(mt.window.document,"touchend",this._onTouchEnd),y.removeEventListener(mt.window.document,"mousemove",this._onMove,{capture:!0}),y.removeEventListener(mt.window.document,"mouseup",this._onMouseUp),y.removeEventListener(mt.window,"blur",this._onBlur)},Ro.prototype._deactivate=function(){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._lastMoveEvent,delete this._startPos,delete this._mouseDownPos,delete this._lastPos},Ro.prototype._inertialPan=function(t){this._fireEvent("dragend",t),this._drainInertiaBuffer();var e=this._inertia;if(e.length<2)this._fireEvent("moveend",t);else{var i=e[e.length-1],n=e[0],o=i[1].sub(n[1]),r=(i[0]-n[0])/1e3;if(0==r||i[1].equals(n[1]))this._fireEvent("moveend",t);else{var a=o.mult(.3/r),s=a.mag();1400<s&&(s=1400,a._unit()._mult(s));var l=s/750,u=a.mult(-l/2);this._map.panBy(u,{duration:1e3*l,easing:Bo,noMoveStart:!0},{originalEvent:t})}}},Ro.prototype._fireEvent=function(t,e){return this._map.fire(new mt.Event(t,e?{originalEvent:e}:{}))},Ro.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,e=mt.browser.now();0<t.length&&160<e-t[0][0];)t.shift()};function Fo(t){this._map=t,this._el=t.getCanvasContainer(),mt.bindAll(["_onKeyDown"],this)}function Uo(t){return t*(2-t)}Fo.prototype.isEnabled=function(){return!!this._enabled},Fo.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)},Fo.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)},Fo.prototype._onKeyDown=function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=0,i=0,n=0,o=0,r=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?i=-1:(t.preventDefault(),o=-1);break;case 39:t.shiftKey?i=1:(t.preventDefault(),o=1);break;case 38:t.shiftKey?n=1:(t.preventDefault(),r=-1);break;case 40:t.shiftKey?n=-1:(r=1,t.preventDefault());break;default:return}var a=this._map,s=a.getZoom(),l={duration:300,delayEndEvents:500,easing:Uo,zoom:e?Math.round(s)+e*(t.shiftKey?2:1):s,bearing:a.getBearing()+15*i,pitch:a.getPitch()+10*n,offset:[100*-o,100*-r],center:a.getCenter()};a.easeTo(l,{originalEvent:t})}};function No(t){this._map=t,mt.bindAll(["_onDblClick","_onZoomEnd"],this)}No.prototype.isEnabled=function(){return!!this._enabled},No.prototype.isActive=function(){return!!this._active},No.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},No.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},No.prototype.onTouchStart=function(t){var e=this;if(this.isEnabled()&&!(1<t.points.length))if(this._tapped){var i=t.points[0],n=this._tappedPoint;if(n&&n.dist(i)<=30){t.originalEvent.preventDefault();var o=function(){e._tapped&&e._zoom(t),e._map.off("touchcancel",r),e._resetTapped()},r=function(){e._map.off("touchend",o),e._resetTapped()};this._map.once("touchend",o),this._map.once("touchcancel",r)}else this._resetTapped()}else this._tappedPoint=t.points[0],this._tapped=setTimeout(function(){e._tapped=null,e._tappedPoint=null},300)},No.prototype._resetTapped=function(){clearTimeout(this._tapped),this._tapped=null,this._tappedPoint=null},No.prototype.onDblClick=function(t){this.isEnabled()&&(t.originalEvent.preventDefault(),this._zoom(t))},No.prototype._zoom=function(t){this._active=!0,this._map.on("zoomend",this._onZoomEnd),this._map.zoomTo(this._map.getZoom()+(t.originalEvent.shiftKey?-1:1),{around:t.lngLat},t)},No.prototype._onZoomEnd=function(){this._active=!1,this._map.off("zoomend",this._onZoomEnd)};function jo(t){this._map=t,this._el=t.getCanvasContainer(),mt.bindAll(["_onMove","_onEnd","_onTouchFrame"],this)}var $o=mt.bezier(0,0,.15,1);jo.prototype.isEnabled=function(){return!!this._enabled},jo.prototype.enable=function(t){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-zoom-rotate"),this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around)},jo.prototype.disable=function(){this.isEnabled()&&(this._el.classList.remove("mapboxgl-touch-zoom-rotate"),this._enabled=!1)},jo.prototype.disableRotation=function(){this._rotationDisabled=!0},jo.prototype.enableRotation=function(){this._rotationDisabled=!1},jo.prototype.onStart=function(t){if(this.isEnabled()&&2===t.touches.length){var e=y.mousePos(this._el,t.touches[0]),i=y.mousePos(this._el,t.touches[1]),n=e.add(i).div(2);this._startVec=e.sub(i),this._startAround=this._map.transform.pointLocation(n),this._gestureIntent=void 0,this._inertia=[],y.addEventListener(mt.window.document,"touchmove",this._onMove,{passive:!1}),y.addEventListener(mt.window.document,"touchend",this._onEnd)}},jo.prototype._getTouchEventData=function(t){var e=y.mousePos(this._el,t.touches[0]),i=y.mousePos(this._el,t.touches[1]),n=e.sub(i);return{vec:n,center:e.add(i).div(2),scale:n.mag()/this._startVec.mag(),bearing:this._rotationDisabled?0:180*n.angleWith(this._startVec)/Math.PI}},jo.prototype._onMove=function(t){if(2===t.touches.length){var e=this._getTouchEventData(t),i=e.vec,n=e.scale,o=e.bearing;if(!this._gestureIntent){var r=this._rotationDisabled&&1!==n||.15<Math.abs(1-n);10<Math.abs(o)?this._gestureIntent="rotate":r&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._map.fire(new mt.Event(this._gestureIntent+"start",{originalEvent:t})),this._map.fire(new mt.Event("movestart",{originalEvent:t})),this._startVec=i)}this._lastTouchEvent=t,this._frameId||(this._frameId=this._map._requestRenderFrame(this._onTouchFrame)),t.preventDefault()}},jo.prototype._onTouchFrame=function(){this._frameId=null;var t=this._gestureIntent;if(t){var e=this._map.transform;this._startScale||(this._startScale=e.scale,this._startBearing=e.bearing);var i=this._getTouchEventData(this._lastTouchEvent),n=i.center,o=i.bearing,r=i.scale,a=e.pointLocation(n),s=e.locationPoint(a);"rotate"===t&&(e.bearing=this._startBearing+o),e.zoom=e.scaleZoom(this._startScale*r),e.setLocationAtPoint(this._startAround,s),this._map.fire(new mt.Event(t,{originalEvent:this._lastTouchEvent})),this._map.fire(new mt.Event("move",{originalEvent:this._lastTouchEvent})),this._drainInertiaBuffer(),this._inertia.push([mt.browser.now(),r,n])}},jo.prototype._onEnd=function(t){y.removeEventListener(mt.window.document,"touchmove",this._onMove,{passive:!1}),y.removeEventListener(mt.window.document,"touchend",this._onEnd);var e=this._gestureIntent,i=this._startScale;if(this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._gestureIntent,delete this._startScale,delete this._startBearing,delete this._lastTouchEvent,e){this._map.fire(new mt.Event(e+"end",{originalEvent:t})),this._drainInertiaBuffer();var n=this._inertia,o=this._map;if(n.length<2)o.snapToNorth({},{originalEvent:t});else{var r=n[n.length-1],a=n[0],s=o.transform.scaleZoom(i*r[1]),l=o.transform.scaleZoom(i*a[1]),u=s-l,c=(r[0]-a[0])/1e3,h=r[2];if(0!=c&&s!==l){var p=.15*u/c;2.5<Math.abs(p)&&(p=0<p?2.5:-2.5);var d=1e3*Math.abs(p/(12*.15)),f=s+p*d/2e3;f<0&&(f=0),o.easeTo({zoom:f,duration:d,easing:$o,around:this._aroundCenter?o.getCenter():o.unproject(h),noMoveStart:!0},{originalEvent:t})}else o.snapToNorth({},{originalEvent:t})}}},jo.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,e=mt.browser.now();2<t.length&&160<e-t[0][0];)t.shift()};function Vo(t){void 0===t&&(t={}),this.options=t,mt.bindAll(["_updateEditLink","_updateData","_updateCompact"],this)}var Zo,Go={scrollZoom:So,boxZoom:Ao,dragRotate:Do,dragPan:Ro,keyboard:Fo,doubleClickZoom:No,touchZoomRotate:jo},qo=((Zo=mt.Evented)&&(Ho.__proto__=Zo),((Ho.prototype=Object.create(Zo&&Zo.prototype)).constructor=Ho).prototype.getCenter=function(){return new mt.LngLat(this.transform.center.lng,this.transform.center.lat)},Ho.prototype.setCenter=function(t,e){return this.jumpTo({center:t},e)},Ho.prototype.panBy=function(t,e,i){return t=mt.Point.convert(t).mult(-1),this.panTo(this.transform.center,mt.extend({offset:t},e),i)},Ho.prototype.panTo=function(t,e,i){return this.easeTo(mt.extend({center:t},e),i)},Ho.prototype.getZoom=function(){return this.transform.zoom},Ho.prototype.setZoom=function(t,e){return this.jumpTo({zoom:t},e),this},Ho.prototype.zoomTo=function(t,e,i){return this.easeTo(mt.extend({zoom:t},e),i)},Ho.prototype.zoomIn=function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},Ho.prototype.zoomOut=function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},Ho.prototype.getBearing=function(){return this.transform.bearing},Ho.prototype.setBearing=function(t,e){return this.jumpTo({bearing:t},e),this},Ho.prototype.rotateTo=function(t,e,i){return this.easeTo(mt.extend({bearing:t},e),i)},Ho.prototype.resetNorth=function(t,e){return this.rotateTo(0,mt.extend({duration:1e3},t),e),this},Ho.prototype.snapToNorth=function(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this},Ho.prototype.getPitch=function(){return this.transform.pitch},Ho.prototype.setPitch=function(t,e){return this.jumpTo({pitch:t},e),this},Ho.prototype.cameraForBounds=function(t,e){return t=mt.LngLatBounds.convert(t),this._cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),0,e)},Ho.prototype._cameraForBoxAndBearing=function(t,e,i,n){if("number"==typeof(n=mt.extend({padding:{top:0,bottom:0,right:0,left:0},offset:[0,0],maxZoom:this.transform.maxZoom},n)).padding){var o=n.padding;n.padding={top:o,bottom:o,right:o,left:o}}if(mt.deepEqual(Object.keys(n.padding).sort(function(t,e){return t<e?-1:e<t?1:0}),["bottom","left","right","top"])){var r=this.transform,a=r.project(mt.LngLat.convert(t)),s=r.project(mt.LngLat.convert(e)),l=a.rotate(-i*Math.PI/180),u=s.rotate(-i*Math.PI/180),c=new mt.Point(Math.max(l.x,u.x),Math.max(l.y,u.y)),h=new mt.Point(Math.min(l.x,u.x),Math.min(l.y,u.y)),p=c.sub(h),d=(r.width-n.padding.left-n.padding.right)/p.x,f=(r.height-n.padding.top-n.padding.bottom)/p.y;if(!(f<0||d<0)){var m=Math.min(r.scaleZoom(r.scale*Math.min(d,f)),n.maxZoom),_=mt.Point.convert(n.offset),g=(n.padding.left-n.padding.right)/2,y=(n.padding.top-n.padding.bottom)/2,v=new mt.Point(_.x+g,_.y+y).mult(r.scale/r.zoomScale(m));return{center:r.unproject(a.add(s).div(2).sub(v)),zoom:m,bearing:i}}mt.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")}else mt.warnOnce("options.padding must be a positive number, or an Object with keys 'bottom', 'left', 'right', 'top'")},Ho.prototype.fitBounds=function(t,e,i){return this._fitInternal(this.cameraForBounds(t,e),e,i)},Ho.prototype.fitScreenCoordinates=function(t,e,i,n,o){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(mt.Point.convert(t)),this.transform.pointLocation(mt.Point.convert(e)),i,n),n,o)},Ho.prototype._fitInternal=function(t,e,i){return t?(e=mt.extend(t,e)).linear?this.easeTo(e,i):this.flyTo(e,i):this},Ho.prototype.jumpTo=function(t,e){this.stop();var i=this.transform,n=!1,o=!1,r=!1;return"zoom"in t&&i.zoom!==+t.zoom&&(n=!0,i.zoom=+t.zoom),void 0!==t.center&&(i.center=mt.LngLat.convert(t.center)),"bearing"in t&&i.bearing!==+t.bearing&&(o=!0,i.bearing=+t.bearing),"pitch"in t&&i.pitch!==+t.pitch&&(r=!0,i.pitch=+t.pitch),this.fire(new mt.Event("movestart",e)).fire(new mt.Event("move",e)),n&&this.fire(new mt.Event("zoomstart",e)).fire(new mt.Event("zoom",e)).fire(new mt.Event("zoomend",e)),o&&this.fire(new mt.Event("rotatestart",e)).fire(new mt.Event("rotate",e)).fire(new mt.Event("rotateend",e)),r&&this.fire(new mt.Event("pitchstart",e)).fire(new mt.Event("pitch",e)).fire(new mt.Event("pitchend",e)),this.fire(new mt.Event("moveend",e))},Ho.prototype.easeTo=function(t,r){var a=this;this.stop(),!1===(t=mt.extend({offset:[0,0],duration:500,easing:mt.ease},t)).animate&&(t.duration=0);var s=this.transform,l=this.getZoom(),u=this.getBearing(),c=this.getPitch(),h="zoom"in t?+t.zoom:l,p="bearing"in t?this._normalizeBearing(t.bearing,u):u,d="pitch"in t?+t.pitch:c,f=s.centerPoint.add(mt.Point.convert(t.offset)),e=s.pointLocation(f),i=mt.LngLat.convert(t.center||e);this._normalizeCenter(i);var m,_,g=s.project(e),y=s.project(i).sub(g),v=s.zoomScale(h-l);return t.around&&(m=mt.LngLat.convert(t.around),_=s.locationPoint(m)),this._zooming=h!==l,this._rotating=u!==p,this._pitching=d!==c,this._prepareEase(r,t.noMoveStart),clearTimeout(this._easeEndTimeoutID),this._ease(function(t){if(a._zooming&&(s.zoom=mt.number(l,h,t)),a._rotating&&(s.bearing=mt.number(u,p,t)),a._pitching&&(s.pitch=mt.number(c,d,t)),m)s.setLocationAtPoint(m,_);else{var e=s.zoomScale(s.zoom-l),i=l<h?Math.min(2,v):Math.max(.5,v),n=Math.pow(i,1-t),o=s.unproject(g.add(y.mult(t*n)).mult(e));s.setLocationAtPoint(s.renderWorldCopies?o.wrap():o,f)}a._fireMoveEvents(r)},function(){t.delayEndEvents?a._easeEndTimeoutID=setTimeout(function(){return a._afterEase(r)},t.delayEndEvents):a._afterEase(r)},t),this},Ho.prototype._prepareEase=function(t,e){this._moving=!0,e||this.fire(new mt.Event("movestart",t)),this._zooming&&this.fire(new mt.Event("zoomstart",t)),this._rotating&&this.fire(new mt.Event("rotatestart",t)),this._pitching&&this.fire(new mt.Event("pitchstart",t))},Ho.prototype._fireMoveEvents=function(t){this.fire(new mt.Event("move",t)),this._zooming&&this.fire(new mt.Event("zoom",t)),this._rotating&&this.fire(new mt.Event("rotate",t)),this._pitching&&this.fire(new mt.Event("pitch",t))},Ho.prototype._afterEase=function(t){var e=this._zooming,i=this._rotating,n=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,e&&this.fire(new mt.Event("zoomend",t)),i&&this.fire(new mt.Event("rotateend",t)),n&&this.fire(new mt.Event("pitchend",t)),this.fire(new mt.Event("moveend",t))},Ho.prototype.flyTo=function(t,o){var r=this;this.stop(),t=mt.extend({offset:[0,0],speed:1.2,curve:1.42,easing:mt.ease},t);var a=this.transform,s=this.getZoom(),l=this.getBearing(),u=this.getPitch(),c="zoom"in t?mt.clamp(+t.zoom,a.minZoom,a.maxZoom):s,h="bearing"in t?this._normalizeBearing(t.bearing,l):l,p="pitch"in t?+t.pitch:u,e=a.zoomScale(c-s),d=a.centerPoint.add(mt.Point.convert(t.offset)),i=a.pointLocation(d),f=mt.LngLat.convert(t.center||i);this._normalizeCenter(f);var m=a.project(i),_=a.project(f).sub(m),n=t.curve,g=Math.max(a.width,a.height),y=g/e,v=_.mag();if("minZoom"in t){var x=mt.clamp(Math.min(t.minZoom,s,c),a.minZoom,a.maxZoom),b=g/a.zoomScale(x-s);n=Math.sqrt(b/v*2)}var w=n*n;function L(t){var e=(y*y-g*g+(t?-1:1)*w*w*v*v)/(2*(t?y:g)*w*v);return Math.log(Math.sqrt(e*e+1)-e)}function k(t){return(Math.exp(t)-Math.exp(-t))/2}function T(t){return(Math.exp(t)+Math.exp(-t))/2}var E=L(0),M=function(t){return T(E)/T(E+n*t)},C=function(t){return g*((T(E)*(k(e=E+n*t)/T(e))-k(E))/w)/v;var e},S=(L(1)-E)/n;if(Math.abs(v)<1e-6||!isFinite(S)){if(Math.abs(g-y)<1e-6)return this.easeTo(t,o);var P=y<g?-1:1;S=Math.abs(Math.log(y/g))/n,C=function(){return 0},M=function(t){return Math.exp(P*n*t)}}if("duration"in t)t.duration=+t.duration;else{var z="screenSpeed"in t?+t.screenSpeed/n:+t.speed;t.duration=1e3*S/z}return t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=l!==h,this._pitching=p!==u,this._prepareEase(o,!1),this._ease(function(t){var e=t*S,i=1/M(e);a.zoom=1===t?c:s+a.scaleZoom(i),r._rotating&&(a.bearing=mt.number(l,h,t)),r._pitching&&(a.pitch=mt.number(u,p,t));var n=1===t?f:a.unproject(m.add(_.mult(C(e))).mult(i));a.setLocationAtPoint(a.renderWorldCopies?n.wrap():n,d),r._fireMoveEvents(o)},function(){return r._afterEase(o)},t),this},Ho.prototype.isEasing=function(){return!!this._easeFrameId},Ho.prototype.stop=function(){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var t=this._onEaseEnd;delete this._onEaseEnd,t.call(this)}return this},Ho.prototype._ease=function(t,e,i){!1===i.animate||0===i.duration?(t(1),e()):(this._easeStart=mt.browser.now(),this._easeOptions=i,this._onEaseFrame=t,this._onEaseEnd=e,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},Ho.prototype._renderFrameCallback=function(){var t=Math.min((mt.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},Ho.prototype._normalizeBearing=function(t,e){t=mt.wrap(t,-180,180);var i=Math.abs(t-e);return Math.abs(t-360-e)<i&&(t-=360),Math.abs(t+360-e)<i&&(t+=360),t},Ho.prototype._normalizeCenter=function(t){var e=this.transform;if(e.renderWorldCopies&&!e.lngRange){var i=t.lng-e.center.lng;t.lng+=180<i?-360:i<-180?360:0}},Ho);function Ho(t,e){Zo.call(this),this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=e.bearingSnap,mt.bindAll(["_renderFrameCallback"],this)}Vo.prototype.getDefaultPosition=function(){return"bottom-right"},Vo.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=y.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._innerContainer=y.create("div","mapboxgl-ctrl-attrib-inner",this._container),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),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},Vo.prototype.onRemove=function(){y.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0},Vo.prototype._updateEditLink=function(){var t=this._editLink;t||(t=this._editLink=this._container.querySelector(".mapbox-improve-map"));var n=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:mt.config.ACCESS_TOKEN}];if(t){var e=n.reduce(function(t,e,i){return e.value&&(t+=e.key+"="+e.value+(i<n.length-1?"&":"")),t},"?");t.href=mt.config.FEEDBACK_URL+"/"+e+(this._map._hash?this._map._hash.getHashString(!0):""),t.rel="noopener nofollow"}},Vo.prototype._updateData=function(t){!t||"metadata"!==t.sourceDataType&&"style"!==t.dataType||(this._updateAttributions(),this._updateEditLink())},Vo.prototype._updateAttributions=function(){if(this._map.style){var n=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?n=n.concat(this.options.customAttribution.map(function(t){return"string"!=typeof t?"":t})):"string"==typeof this.options.customAttribution&&n.push(this.options.customAttribution)),this._map.style.stylesheet){var t=this._map.style.stylesheet;this.styleOwner=t.owner,this.styleId=t.id}var e=this._map.style.sourceCaches;for(var i in e){var o=e[i];if(o.used){var r=o.getSource();r.attribution&&n.indexOf(r.attribution)<0&&n.push(r.attribution)}}n.sort(function(t,e){return t.length-e.length});var a=(n=n.filter(function(t,e){for(var i=e+1;i<n.length;i++)if(0<=n[i].indexOf(t))return!1;return!0})).join(" | ");a!==this._attribHTML&&(this._attribHTML=a,n.length?(this._innerContainer.innerHTML=a,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},Vo.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact")};function Wo(){mt.bindAll(["_updateLogo"],this),mt.bindAll(["_updateCompact"],this)}Wo.prototype.onAdd=function(t){this._map=t,this._container=y.create("div","mapboxgl-ctrl");var e=y.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label","Mapbox logo"),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},Wo.prototype.onRemove=function(){y.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},Wo.prototype.getDefaultPosition=function(){return"bottom-left"},Wo.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},Wo.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}},Wo.prototype._updateCompact=function(){var t=this._container.children;if(t.length){var e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact")}};function Xo(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}Xo.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},Xo.prototype.remove=function(t){for(var e=this._currentlyRunning,i=0,n=e?this._queue.concat(e):this._queue;i<n.length;i+=1){var o=n[i];if(o.id===t)return void(o.cancelled=!0)}},Xo.prototype.run=function(){var t=this._currentlyRunning=this._queue;this._queue=[];for(var e=0,i=t;e<i.length;e+=1){var n=i[e];if(!n.cancelled&&(n.callback(),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},Xo.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var Ko=mt.window.HTMLImageElement,Jo=mt.window.HTMLElement,Yo={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,clickTolerance:3,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,fadeDuration:300,crossSourceCollisions:!0},Qo=function(s){function t(t){var e=this;if(null!=(t=mt.extend({},Yo,t)).minZoom&&null!=t.maxZoom&&t.minZoom>t.maxZoom)throw new Error("maxZoom must be greater than minZoom");var i=new Eo(t.minZoom,t.maxZoom,t.renderWorldCopies);if(s.call(this,i,t),this._interactive=t.interactive,this._maxTileCacheSize=t.maxTileCacheSize,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._antialias=t.antialias,this._trackResize=t.trackResize,this._bearingSnap=t.bearingSnap,this._refreshExpiredTiles=t.refreshExpiredTiles,this._fadeDuration=t.fadeDuration,this._crossSourceCollisions=t.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=t.collectResourceTiming,this._renderTaskQueue=new Xo,this._controls=[],this._mapId=mt.uniqueId(),this._requestManager=new mt.RequestManager(t.transformRequest),"string"==typeof t.container){if(this._container=mt.window.document.getElementById(t.container),!this._container)throw new Error("Container '"+t.container+"' not found.")}else{if(!(t.container instanceof Jo))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=t.container}if(t.maxBounds&&this.setMaxBounds(t.maxBounds),mt.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",function(){return e._update(!1)}),this.on("moveend",function(){return e._update(!1)}),this.on("zoom",function(){return e._update(!0)}),void 0!==mt.window&&(mt.window.addEventListener("online",this._onWindowOnline,!1),mt.window.addEventListener("resize",this._onWindowResize,!1)),function(i,n){var o=i.getCanvasContainer(),r=null,a=!1,s=null;for(var t in Go)i[t]=new Go[t](i,n),n.interactive&&n[t]&&i[t].enable(n[t]);y.addEventListener(o,"mouseout",function(t){i.fire(new Po("mouseout",i,t))}),y.addEventListener(o,"mousedown",function(t){a=!0,s=y.mousePos(o,t);var e=new Po("mousedown",i,t);i.fire(e),e.defaultPrevented||(n.interactive&&!i.doubleClickZoom.isActive()&&i.stop(),i.boxZoom.onMouseDown(t),i.boxZoom.isActive()||i.dragPan.isActive()||i.dragRotate.onMouseDown(t),i.boxZoom.isActive()||i.dragRotate.isActive()||i.dragPan.onMouseDown(t))}),y.addEventListener(o,"mouseup",function(t){var e=i.dragRotate.isActive();r&&!e&&i.fire(new Po("contextmenu",i,r)),r=null,a=!1,i.fire(new Po("mouseup",i,t))}),y.addEventListener(o,"mousemove",function(t){if(!i.dragPan.isActive()&&!i.dragRotate.isActive()){for(var e=t.target;e&&e!==o;)e=e.parentNode;e===o&&i.fire(new Po("mousemove",i,t))}}),y.addEventListener(o,"mouseover",function(t){for(var e=t.target;e&&e!==o;)e=e.parentNode;e===o&&i.fire(new Po("mouseover",i,t))}),y.addEventListener(o,"touchstart",function(t){var e=new zo("touchstart",i,t);i.fire(e),e.defaultPrevented||(n.interactive&&i.stop(),i.boxZoom.isActive()||i.dragRotate.isActive()||i.dragPan.onTouchStart(t),i.touchZoomRotate.onStart(t),i.doubleClickZoom.onTouchStart(e))},{passive:!1}),y.addEventListener(o,"touchmove",function(t){i.fire(new zo("touchmove",i,t))},{passive:!1}),y.addEventListener(o,"touchend",function(t){i.fire(new zo("touchend",i,t))}),y.addEventListener(o,"touchcancel",function(t){i.fire(new zo("touchcancel",i,t))}),y.addEventListener(o,"click",function(t){var e=y.mousePos(o,t);(e.equals(s)||e.dist(s)<n.clickTolerance)&&i.fire(new Po("click",i,t))}),y.addEventListener(o,"dblclick",function(t){var e=new Po("dblclick",i,t);i.fire(e),e.defaultPrevented||i.doubleClickZoom.onDblClick(e)}),y.addEventListener(o,"contextmenu",function(t){var e=i.dragRotate.isActive();a||e?a&&(r=t):i.fire(new Po("contextmenu",i,t)),(i.dragRotate.isEnabled()||i.listens("contextmenu"))&&t.preventDefault()}),y.addEventListener(o,"wheel",function(t){n.interactive&&i.stop();var e=new Io("wheel",i,t);i.fire(e),e.defaultPrevented||i.scrollZoom.onWheel(t)},{passive:!1})}(this,t),this._hash=t.hash&&(new Co).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}),t.bounds&&(this.resize(),this.fitBounds(t.bounds,mt.extend({},t.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=t.localIdeographFontFamily,t.style&&this.setStyle(t.style,{localIdeographFontFamily:t.localIdeographFontFamily}),t.attributionControl&&this.addControl(new Vo({customAttribution:t.customAttribution})),this.addControl(new Wo,t.logoPosition),this.on("style.load",function(){e.transform.unmodified&&e.jumpTo(e.style.stylesheet)}),this.on("data",function(t){e._update("style"===t.dataType),e.fire(new mt.Event(t.dataType+"data",t))}),this.on("dataloading",function(t){e.fire(new mt.Event(t.dataType+"dataloading",t))})}s&&(t.__proto__=s);var e={showTileBoundaries:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0}};return((t.prototype=Object.create(s&&s.prototype)).constructor=t).prototype._getMapId=function(){return this._mapId},t.prototype.addControl=function(t,e){if(void 0===e&&t.getDefaultPosition&&(e=t.getDefaultPosition()),void 0===e&&(e="top-right"),!t||!t.onAdd)return this.fire(new mt.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var i=t.onAdd(this);this._controls.push(t);var n=this._controlPositions[e];return-1!==e.indexOf("bottom")?n.insertBefore(i,n.firstChild):n.appendChild(i),this},t.prototype.removeControl=function(t){if(!t||!t.onRemove)return this.fire(new mt.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var e=this._controls.indexOf(t);return-1<e&&this._controls.splice(e,1),t.onRemove(this),this},t.prototype.resize=function(t){var e=this._containerDimensions(),i=e[0],n=e[1];return this._resizeCanvas(i,n),this.transform.resize(i,n),this.painter.resize(i,n),this.fire(new mt.Event("movestart",t)).fire(new mt.Event("move",t)).fire(new mt.Event("resize",t)).fire(new mt.Event("moveend",t)),this},t.prototype.getBounds=function(){return this.transform.getBounds()},t.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},t.prototype.setMaxBounds=function(t){return this.transform.setMaxBounds(mt.LngLatBounds.convert(t)),this._update()},t.prototype.setMinZoom=function(t){if(0<=(t=null==t?0:t)&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t&&this.setZoom(t),this;throw new Error("minZoom must be between 0 and the current maxZoom, inclusive")},t.prototype.getMinZoom=function(){return this.transform.minZoom},t.prototype.setMaxZoom=function(t){if((t=null==t?22:t)>=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")},t.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},t.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},t.prototype.getMaxZoom=function(){return this.transform.maxZoom},t.prototype.project=function(t){return this.transform.locationPoint(mt.LngLat.convert(t))},t.prototype.unproject=function(t){return this.transform.pointLocation(mt.Point.convert(t))},t.prototype.isMoving=function(){return this._moving||this.dragPan.isActive()||this.dragRotate.isActive()||this.scrollZoom.isActive()},t.prototype.isZooming=function(){return this._zooming||this.scrollZoom.isZooming()},t.prototype.isRotating=function(){return this._rotating||this.dragRotate.isActive()},t.prototype.on=function(n,o,r){var a=this;if(void 0===r)return s.prototype.on.call(this,n,o);var t=function(){var t;if("mouseenter"===n||"mouseover"===n){var i=!1;return{layer:o,listener:r,delegates:{mousemove:function(t){var e=a.getLayer(o)?a.queryRenderedFeatures(t.point,{layers:[o]}):[];e.length?i||(i=!0,r.call(a,new Po(n,a,t.originalEvent,{features:e}))):i=!1},mouseout:function(){i=!1}}}}if("mouseleave"!==n&&"mouseout"!==n)return{layer:o,listener:r,delegates:(t={},t[n]=function(t){var e=a.getLayer(o)?a.queryRenderedFeatures(t.point,{layers:[o]}):[];e.length&&(t.features=e,r.call(a,t),delete t.features)},t)};var e=!1;return{layer:o,listener:r,delegates:{mousemove:function(t){(a.getLayer(o)?a.queryRenderedFeatures(t.point,{layers:[o]}):[]).length?e=!0:e&&(e=!1,r.call(a,new Po(n,a,t.originalEvent)))},mouseout:function(t){e&&(e=!1,r.call(a,new Po(n,a,t.originalEvent)))}}}}();for(var e in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[n]=this._delegatedListeners[n]||[],this._delegatedListeners[n].push(t),t.delegates)this.on(e,t.delegates[e]);return this},t.prototype.off=function(t,e,i){if(void 0===i)return s.prototype.off.call(this,t,e);if(this._delegatedListeners&&this._delegatedListeners[t])for(var n=this._delegatedListeners[t],o=0;o<n.length;o++){var r=n[o];if(r.layer===e&&r.listener===i){for(var a in r.delegates)this.off(a,r.delegates[a]);return n.splice(o,1),this}}return this},t.prototype.queryRenderedFeatures=function(t,e){if(!this.style)return[];var i;if(void 0!==e||void 0===t||t instanceof mt.Point||Array.isArray(t)||(e=t,t=void 0),e=e||{},(t=t||[[0,0],[this.transform.width,this.transform.height]])instanceof mt.Point||"number"==typeof t[0])i=[mt.Point.convert(t)];else{var n=mt.Point.convert(t[0]),o=mt.Point.convert(t[1]);i=[n,new mt.Point(o.x,n.y),o,new mt.Point(n.x,o.y),n]}return this.style.queryRenderedFeatures(i,e,this.transform)},t.prototype.querySourceFeatures=function(t,e){return this.style.querySourceFeatures(t,e)},t.prototype.setStyle=function(t,e){return!1!==(e=mt.extend({},{localIdeographFontFamily:Yo.localIdeographFontFamily},e)).diff&&e.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&t?(this._diffStyle(t,e),this):(this._localIdeographFontFamily=e.localIdeographFontFamily,this._updateStyle(t,e))},t.prototype._updateStyle=function(t,e){return this.style&&(this.style.setEventedParent(null),this.style._remove()),t?(this.style=new pn(this,e||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t):this.style.loadJSON(t)):delete this.style,this},t.prototype._diffStyle=function(t,i){var n=this;if("string"==typeof t){var e=this._requestManager.normalizeStyleURL(t),o=this._requestManager.transformRequest(e,mt.ResourceType.Style);mt.getJSON(o,function(t,e){t?n.fire(new mt.ErrorEvent(t)):e&&n._updateDiff(e,i)})}else"object"==typeof t&&this._updateDiff(t,i)},t.prototype._updateDiff=function(e,i){try{this.style.setState(e)&&this._update(!0)}catch(t){mt.warnOnce("Unable to perform style diff: "+(t.message||t.error||t)+". Rebuilding the style from scratch."),this._updateStyle(e,i)}},t.prototype.getStyle=function(){if(this.style)return this.style.serialize()},t.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():mt.warnOnce("There is no style added to the map.")},t.prototype.addSource=function(t,e){return this.style.addSource(t,e),this._update(!0)},t.prototype.isSourceLoaded=function(t){var e=this.style&&this.style.sourceCaches[t];if(void 0!==e)return e.loaded();this.fire(new mt.ErrorEvent(new Error("There is no source with ID '"+t+"'")))},t.prototype.areTilesLoaded=function(){var t=this.style&&this.style.sourceCaches;for(var e in t){var i=t[e]._tiles;for(var n in i){var o=i[n];if("loaded"!==o.state&&"errored"!==o.state)return!1}}return!0},t.prototype.addSourceType=function(t,e,i){return this.style.addSourceType(t,e,i)},t.prototype.removeSource=function(t){return this.style.removeSource(t),this._update(!0)},t.prototype.getSource=function(t){return this.style.getSource(t)},t.prototype.addImage=function(t,e,i){void 0===i&&(i={});var n=i.pixelRatio;void 0===n&&(n=1);var o=i.sdf;if(void 0===o&&(o=!1),e instanceof Ko){var r=mt.browser.getImageData(e),a=r.width,s=r.height,l=r.data;this.style.addImage(t,{data:new mt.RGBAImage({width:a,height:s},l),pixelRatio:n,sdf:o,version:0})}else{if(void 0===e.width||void 0===e.height)return this.fire(new mt.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));var u=e.width,c=e.height,h=e.data,p=e;this.style.addImage(t,{data:new mt.RGBAImage({width:u,height:c},new Uint8Array(h)),pixelRatio:n,sdf:o,version:0,userImage:p}),p.onAdd&&p.onAdd(this,t)}},t.prototype.updateImage=function(t,e){var i=this.style.getImage(t);if(!i)return this.fire(new mt.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var n=e instanceof Ko?mt.browser.getImageData(e):e,o=n.width,r=n.height,a=n.data;if(void 0===o||void 0===r)return this.fire(new mt.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(o!==i.data.width||r!==i.data.height)return this.fire(new mt.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image")));var s=!(e instanceof Ko);i.data.replace(a,s),this.style.updateImage(t,i)},t.prototype.hasImage=function(t){return t?!!this.style.getImage(t):(this.fire(new mt.ErrorEvent(new Error("Missing required image id"))),!1)},t.prototype.removeImage=function(t){this.style.removeImage(t)},t.prototype.loadImage=function(t,e){mt.getImage(this._requestManager.transformRequest(t,mt.ResourceType.Image),e)},t.prototype.listImages=function(){return this.style.listImages()},t.prototype.addLayer=function(t,e){return this.style.addLayer(t,e),this._update(!0)},t.prototype.moveLayer=function(t,e){return this.style.moveLayer(t,e),this._update(!0)},t.prototype.removeLayer=function(t){return this.style.removeLayer(t),this._update(!0)},t.prototype.getLayer=function(t){return this.style.getLayer(t)},t.prototype.setFilter=function(t,e,i){return void 0===i&&(i={}),this.style.setFilter(t,e,i),this._update(!0)},t.prototype.setLayerZoomRange=function(t,e,i){return this.style.setLayerZoomRange(t,e,i),this._update(!0)},t.prototype.getFilter=function(t){return this.style.getFilter(t)},t.prototype.setPaintProperty=function(t,e,i,n){return void 0===n&&(n={}),this.style.setPaintProperty(t,e,i,n),this._update(!0)},t.prototype.getPaintProperty=function(t,e){return this.style.getPaintProperty(t,e)},t.prototype.setLayoutProperty=function(t,e,i,n){return void 0===n&&(n={}),this.style.setLayoutProperty(t,e,i,n),this._update(!0)},t.prototype.getLayoutProperty=function(t,e){return this.style.getLayoutProperty(t,e)},t.prototype.setLight=function(t,e){return void 0===e&&(e={}),this.style.setLight(t,e),this._update(!0)},t.prototype.getLight=function(){return this.style.getLight()},t.prototype.setFeatureState=function(t,e){return this.style.setFeatureState(t,e),this._update()},t.prototype.removeFeatureState=function(t,e){return this.style.removeFeatureState(t,e),this._update()},t.prototype.getFeatureState=function(t){return this.style.getFeatureState(t)},t.prototype.getContainer=function(){return this._container},t.prototype.getCanvasContainer=function(){return this._canvasContainer},t.prototype.getCanvas=function(){return this._canvas},t.prototype._containerDimensions=function(){var t=0,e=0;return this._container&&(t=this._container.clientWidth||400,e=this._container.clientHeight||300),[t,e]},t.prototype._detectMissingCSS=function(){"rgb(250, 128, 114)"!==mt.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&mt.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")},t.prototype._setupContainer=function(){var t=this._container;t.classList.add("mapboxgl-map"),(this._missingCSSCanary=y.create("div","mapboxgl-canary",t)).style.visibility="hidden",this._detectMissingCSS();var e=this._canvasContainer=y.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=y.create("canvas","mapboxgl-canvas",e),this._canvas.style.position="absolute",this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map");var i=this._containerDimensions();this._resizeCanvas(i[0],i[1]);var n=this._controlContainer=y.create("div","mapboxgl-control-container",t),o=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(t){o[t]=y.create("div","mapboxgl-ctrl-"+t,n)})},t.prototype._resizeCanvas=function(t,e){var i=mt.window.devicePixelRatio||1;this._canvas.width=i*t,this._canvas.height=i*e,this._canvas.style.width=t+"px",this._canvas.style.height=e+"px"},t.prototype._setupPainter=function(){var t=mt.extend({},i.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),e=this._canvas.getContext("webgl",t)||this._canvas.getContext("experimental-webgl",t);e?(this.painter=new xo(e,this.transform),mt.webpSupported.testSupport(e)):this.fire(new mt.ErrorEvent(new Error("Failed to initialize WebGL")))},t.prototype._contextLost=function(t){t.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new mt.Event("webglcontextlost",{originalEvent:t}))},t.prototype._contextRestored=function(t){this._setupPainter(),this.resize(),this._update(),this.fire(new mt.Event("webglcontextrestored",{originalEvent:t}))},t.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},t.prototype._update=function(t){return this.style&&(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this.triggerRepaint()),this},t.prototype._requestRenderFrame=function(t){return this._update(),this._renderTaskQueue.add(t)},t.prototype._cancelRenderFrame=function(t){this._renderTaskQueue.remove(t)},t.prototype._render=function(){this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run();var t=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var e=this.transform.zoom,i=mt.browser.now();this.style.zoomHistory.update(e,i);var n=new mt.EvaluationParameters(e,{now:i,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),o=n.crossFadingFactor();1===o&&o===this._crossFadingFactor||(t=!0,this._crossFadingFactor=o),this.style.update(n)}return this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration}),this.fire(new mt.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new mt.Event("load"))),this.style&&(this.style.hasTransitions()||t)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this._sourcesDirty||this._repaint||this._styleDirty||this._placementDirty?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new mt.Event("idle")),this},t.prototype.remove=function(){this._hash&&this._hash.remove();for(var t=0,e=this._controls;t<e.length;t+=1)e[t].onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.setStyle(null),void 0!==mt.window&&(mt.window.removeEventListener("resize",this._onWindowResize,!1),mt.window.removeEventListener("online",this._onWindowOnline,!1));var i=this.painter.context.gl.getExtension("WEBGL_lose_context");i&&i.loseContext(),tr(this._canvasContainer),tr(this._controlContainer),tr(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this.fire(new mt.Event("remove"))},t.prototype.triggerRepaint=function(){var t=this;this.style&&!this._frame&&(this._frame=mt.browser.frame(function(){t._frame=null,t._render()}))},t.prototype._onWindowOnline=function(){this._update()},t.prototype._onWindowResize=function(){this._trackResize&&this.resize()._update()},e.showTileBoundaries.get=function(){return!!this._showTileBoundaries},e.showTileBoundaries.set=function(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},e.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},e.showCollisionBoxes.set=function(t){this._showCollisionBoxes!==t&&((this._showCollisionBoxes=t)?this.style._generateCollisionBoxes():this._update())},e.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},e.showOverdrawInspector.set=function(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},e.repaint.get=function(){return!!this._repaint},e.repaint.set=function(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())},e.vertices.get=function(){return!!this._vertices},e.vertices.set=function(t){this._vertices=t,this._update()},t.prototype._setCacheLimits=function(t,e){mt.setCacheLimits(t,e)},Object.defineProperties(t.prototype,e),t}(qo);function tr(t){t.parentNode&&t.parentNode.removeChild(t)}function er(t){var e=this;this.options=mt.extend({},ir,t),this._container=y.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",function(t){return t.preventDefault()}),this.options.showZoom&&(mt.bindAll(["_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-icon mapboxgl-ctrl-zoom-in","Zoom in",function(){return e._map.zoomIn()}),this._zoomOutButton=this._createButton("mapboxgl-ctrl-icon mapboxgl-ctrl-zoom-out","Zoom out",function(){return e._map.zoomOut()})),this.options.showCompass&&(mt.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-icon mapboxgl-ctrl-compass","Reset bearing to north",function(){return e._map.resetNorth()}),this._compassArrow=y.create("span","mapboxgl-ctrl-compass-arrow",this._compass))}var ir={showCompass:!0,showZoom:!0};function nr(t,e,i){if(t=new mt.LngLat(t.lng,t.lat),e){var n=new mt.LngLat(t.lng-360,t.lat),o=new mt.LngLat(t.lng+360,t.lat),r=i.locationPoint(t).distSqr(e);i.locationPoint(n).distSqr(e)<r?t=n:i.locationPoint(o).distSqr(e)<r&&(t=o)}for(;180<Math.abs(t.lng-i.center.lng);){var a=i.locationPoint(t);if(0<=a.x&&0<=a.y&&a.x<=i.width&&a.y<=i.height)break;t.lng>i.center.lng?t.lng-=360:t.lng+=360}return t}er.prototype._updateZoomButtons=function(){var t=this._map.getZoom();this._zoomInButton.classList.toggle("mapboxgl-ctrl-icon-disabled",t===this._map.getMaxZoom()),this._zoomOutButton.classList.toggle("mapboxgl-ctrl-icon-disabled",t===this._map.getMinZoom())},er.prototype._rotateCompassArrow=function(){var t="rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassArrow.style.transform=t},er.prototype.onAdd=function(t){return this._map=t,this.options.showZoom&&(this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Do(t,{button:"left",element:this._compass}),y.addEventListener(this._compass,"mousedown",this._handler.onMouseDown),this._handler.enable()),this._container},er.prototype.onRemove=function(){y.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this._map.off("rotate",this._rotateCompassArrow),y.removeEventListener(this._compass,"mousedown",this._handler.onMouseDown),this._handler.disable(),delete this._handler),delete this._map},er.prototype._createButton=function(t,e,i){var n=y.create("button",t,this._container);return n.type="button",n.title=e,n.setAttribute("aria-label",e),n.addEventListener("click",i),n};var or={center:"translate(-50%,-50%)",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%)"};function rr(t,e,i){var n=t.classList;for(var o in or)n.remove("mapboxgl-"+i+"-anchor-"+o);n.add("mapboxgl-"+i+"-anchor-"+e)}var ar,sr,lr=((sr=mt.Evented)&&(cr.__proto__=sr),((cr.prototype=Object.create(sr&&sr.prototype)).constructor=cr).prototype.addTo=function(t){return this.remove(),(this._map=t).getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},cr.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),delete this._map),y.remove(this._element),this._popup&&this._popup.remove(),this},cr.prototype.getLngLat=function(){return this._lngLat},cr.prototype.setLngLat=function(t){return this._lngLat=mt.LngLat.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},cr.prototype.getElement=function(){return this._element},cr.prototype.setPopup=function(t){if(this._popup&&(this._popup.remove(),this._popup=null),t){if(!("offset"in t.options)){var e=Math.sqrt(Math.pow(13.5,2)/2);t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[e,-1*(24.6+e)],"bottom-right":[-e,-1*(24.6+e)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=t,this._lngLat&&this._popup.setLngLat(this._lngLat)}return this},cr.prototype._onMapClick=function(t){var e=t.originalEvent.target,i=this._element;this._popup&&(e===i||i.contains(e))&&this.togglePopup()},cr.prototype.getPopup=function(){return this._popup},cr.prototype.togglePopup=function(){var t=this._popup;return t&&(t.isOpen()?t.remove():t.addTo(this._map)),this},cr.prototype._update=function(t){this._map&&(this._map.transform.renderWorldCopies&&(this._lngLat=nr(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset),t&&"moveend"!==t.type||(this._pos=this._pos.round()),y.setTransform(this._element,or[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px)"))},cr.prototype.getOffset=function(){return this._offset},cr.prototype.setOffset=function(t){return this._offset=mt.Point.convert(t),this._update(),this},cr.prototype._onMove=function(t){this._pos=t.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new mt.Event("dragstart"))),this.fire(new mt.Event("drag"))},cr.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new mt.Event("dragend")),this._state="inactive"},cr.prototype._addDragHandler=function(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},cr.prototype.setDraggable=function(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},cr.prototype.isDraggable=function(){return this._draggable},cr),ur={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showUserLocation:!0};function cr(t,e){if(sr.call(this),(t instanceof mt.window.HTMLElement||e)&&(t=mt.extend({element:t},e)),mt.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick"],this),this._anchor=t&&t.anchor||"center",this._color=t&&t.color||"#3FB1CE",this._draggable=t&&t.draggable||!1,this._state="inactive",t&&t.element)this._element=t.element,this._offset=mt.Point.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=y.create("div");var i=y.createNS("http://www.w3.org/2000/svg","svg");i.setAttributeNS(null,"display","block"),i.setAttributeNS(null,"height","41px"),i.setAttributeNS(null,"width","27px"),i.setAttributeNS(null,"viewBox","0 0 27 41");var n=y.createNS("http://www.w3.org/2000/svg","g");n.setAttributeNS(null,"stroke","none"),n.setAttributeNS(null,"stroke-width","1"),n.setAttributeNS(null,"fill","none"),n.setAttributeNS(null,"fill-rule","evenodd");var o=y.createNS("http://www.w3.org/2000/svg","g");o.setAttributeNS(null,"fill-rule","nonzero");var r=y.createNS("http://www.w3.org/2000/svg","g");r.setAttributeNS(null,"transform","translate(3.0, 29.0)"),r.setAttributeNS(null,"fill","#000000");for(var a=0,s=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];a<s.length;a+=1){var l=s[a],u=y.createNS("http://www.w3.org/2000/svg","ellipse");u.setAttributeNS(null,"opacity","0.04"),u.setAttributeNS(null,"cx","10.5"),u.setAttributeNS(null,"cy","5.80029008"),u.setAttributeNS(null,"rx",l.rx),u.setAttributeNS(null,"ry",l.ry),r.appendChild(u)}var c=y.createNS("http://www.w3.org/2000/svg","g");c.setAttributeNS(null,"fill",this._color);var h=y.createNS("http://www.w3.org/2000/svg","path");h.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),c.appendChild(h);var p=y.createNS("http://www.w3.org/2000/svg","g");p.setAttributeNS(null,"opacity","0.25"),p.setAttributeNS(null,"fill","#000000");var d=y.createNS("http://www.w3.org/2000/svg","path");d.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),p.appendChild(d);var f=y.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"transform","translate(6.0, 7.0)"),f.setAttributeNS(null,"fill","#FFFFFF");var m=y.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"transform","translate(8.0, 8.0)");var _=y.createNS("http://www.w3.org/2000/svg","circle");_.setAttributeNS(null,"fill","#000000"),_.setAttributeNS(null,"opacity","0.25"),_.setAttributeNS(null,"cx","5.5"),_.setAttributeNS(null,"cy","5.5"),_.setAttributeNS(null,"r","5.4999962");var g=y.createNS("http://www.w3.org/2000/svg","circle");g.setAttributeNS(null,"fill","#FFFFFF"),g.setAttributeNS(null,"cx","5.5"),g.setAttributeNS(null,"cy","5.5"),g.setAttributeNS(null,"r","5.4999962"),m.appendChild(_),m.appendChild(g),o.appendChild(r),o.appendChild(c),o.appendChild(p),o.appendChild(f),o.appendChild(m),i.appendChild(o),this._element.appendChild(i),this._offset=mt.Point.convert(t&&t.offset||[0,-14])}this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",function(t){t.preventDefault()}),rr(this._element,this._anchor,"marker"),this._popup=null}function hr(t){this.options=mt.extend({},fr,t),mt.bindAll(["_onMove","setUnit"],this)}var pr,dr=((pr=mt.Evented)&&(mr.__proto__=pr),((mr.prototype=Object.create(pr&&pr.prototype)).constructor=mr).prototype.onAdd=function(t){var e;return this._map=t,this._container=y.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),e=this._setupUI,void 0!==ar?e(ar):void 0!==mt.window.navigator.permissions?mt.window.navigator.permissions.query({name:"geolocation"}).then(function(t){ar="denied"!==t.state,e(ar)}):(ar=!!mt.window.navigator.geolocation,e(ar)),this._container},mr.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(mt.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),y.remove(this._container),this._map=void 0},mr.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(new mt.Event("geolocate",t)),this._finish()},mr.prototype._updateCamera=function(t){var e=new mt.LngLat(t.coords.longitude,t.coords.latitude),i=t.coords.accuracy,n=this._map.getBearing(),o=mt.extend({bearing:n},this.options.fitBoundsOptions);this._map.fitBounds(e.toBounds(i),o,{geolocateSource:!0})},mr.prototype._updateMarker=function(t){t?this._userLocationDotMarker.setLngLat([t.coords.longitude,t.coords.latitude]).addTo(this._map):this._userLocationDotMarker.remove()},mr.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(new mt.Event("error",t)),this._finish()},mr.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},mr.prototype._setupUI=function(t){var e=this;!1!==t?(this._container.addEventListener("contextmenu",function(t){return t.preventDefault()}),this._geolocateButton=y.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=y.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new lr(this._dotElement),this.options.trackUserLocation&&(this._watchState="OFF")),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,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(new mt.Event("trackuserlocationend")))})):mt.warnOnce("Geolocation support is not available, the GeolocateControl will not be visible.")},mr.prototype.trigger=function(){if(!this._setup)return mt.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new mt.Event("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(new mt.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new mt.Event("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=mt.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,this.options.positionOptions))}else mt.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},mr.prototype._clearWatch=function(){mt.window.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)},mr),fr={maxWidth:100,unit:"metric"};function mr(t){pr.call(this),this.options=mt.extend({},ur,t),mt.bindAll(["_onSuccess","_onError","_finish","_setupUI","_updateCamera","_updateMarker"],this)}function _r(t,e,i){var n,o,r,a,s,l,u=i&&i.maxWidth||100,c=t._container.clientHeight/2,h=(n=t.unproject([0,c]),o=t.unproject([u,c]),r=Math.PI/180,a=n.lat*r,s=o.lat*r,l=Math.sin(a)*Math.sin(s)+Math.cos(a)*Math.cos(s)*Math.cos((o.lng-n.lng)*r),6371e3*Math.acos(Math.min(l,1)));if(i&&"imperial"===i.unit){var p=3.2808*h;5280<p?gr(e,u,p/5280,"mi"):gr(e,u,p,"ft")}else i&&"nautical"===i.unit?gr(e,u,h/1852,"nm"):gr(e,u,h,"m")}function gr(t,e,i,n){var o,r,a,s,l,u=(o=i,(r=Math.pow(10,(""+Math.floor(o)).length-1))*(a=10<=(a=o/r)?10:5<=a?5:3<=a?3:2<=a?2:1<=a?1:(s=a,l=Math.pow(10,Math.ceil(-Math.log(s)/Math.LN10)),Math.round(s*l)/l))),c=u/i;"m"===n&&1e3<=u&&(u/=1e3,n="km"),t.style.width=e*c+"px",t.innerHTML=u+n}hr.prototype.getDefaultPosition=function(){return"bottom-left"},hr.prototype._onMove=function(){_r(this._map,this._container,this.options)},hr.prototype.onAdd=function(t){return this._map=t,this._container=y.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},hr.prototype.onRemove=function(){y.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},hr.prototype.setUnit=function(t){this.options.unit=t,_r(this._map,this._container,this.options)};function yr(t){this._fullscreen=!1,t&&t.container&&(t.container instanceof mt.window.HTMLElement?this._container=t.container:mt.warnOnce("Full screen control 'container' must be a DOM element.")),mt.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in mt.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in mt.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in mt.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in mt.window.document&&(this._fullscreenchange="MSFullscreenChange"),this._className="mapboxgl-ctrl"}yr.prototype.onAdd=function(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=y.create("div",this._className+" mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",mt.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},yr.prototype.onRemove=function(){y.remove(this._controlContainer),this._map=null,mt.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},yr.prototype._checkFullscreenSupport=function(){return!!(mt.window.document.fullscreenEnabled||mt.window.document.mozFullScreenEnabled||mt.window.document.msFullscreenEnabled||mt.window.document.webkitFullscreenEnabled)},yr.prototype._setupUI=function(){(this._fullscreenButton=y.create("button",this._className+"-icon "+this._className+"-fullscreen",this._controlContainer)).type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),mt.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},yr.prototype._updateTitle=function(){var t=this._isFullscreen()?"Exit fullscreen":"Enter fullscreen";this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},yr.prototype._isFullscreen=function(){return this._fullscreen},yr.prototype._changeIcon=function(){(mt.window.document.fullscreenElement||mt.window.document.mozFullScreenElement||mt.window.document.webkitFullscreenElement||mt.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle(this._className+"-shrink"),this._fullscreenButton.classList.toggle(this._className+"-fullscreen"),this._updateTitle())},yr.prototype._onClickFullscreen=function(){this._isFullscreen()?mt.window.document.exitFullscreen?mt.window.document.exitFullscreen():mt.window.document.mozCancelFullScreen?mt.window.document.mozCancelFullScreen():mt.window.document.msExitFullscreen?mt.window.document.msExitFullscreen():mt.window.document.webkitCancelFullScreen&&mt.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var vr,xr={closeButton:!0,closeOnClick:!0,className:"",maxWidth:"240px"},br=((vr=mt.Evented)&&(wr.__proto__=vr),((wr.prototype=Object.create(vr&&vr.prototype)).constructor=wr).prototype.addTo=function(t){var e=this;return this._map=t,this.options.closeOnClick&&this._map.on("click",this._onClickClose),this._map.on("remove",this.remove),this._update(),this._trackPointer?(this._map.on("mousemove",function(t){e._update(t.point)}),this._map.on("mouseup",function(t){e._update(t.point)}),this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new mt.Event("open")),this},wr.prototype.isOpen=function(){return!!this._map},wr.prototype.remove=function(){return this._content&&y.remove(this._content),this._container&&(y.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("click",this._onClickClose),this._map.off("remove",this.remove),this._map.off("mousemove"),delete this._map),this.fire(new mt.Event("close")),this},wr.prototype.getLngLat=function(){return this._lngLat},wr.prototype.setLngLat=function(t){return this._lngLat=mt.LngLat.convert(t),this._pos=null,this._map&&(this._map.on("move",this._update),this._map.off("mousemove"),this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this._trackPointer=!1,this._update(),this},wr.prototype.trackPointer=function(){var e=this;return this._trackPointer=!0,this._pos=null,this._map&&(this._map.off("move",this._update),this._map.on("mousemove",function(t){e._update(t.point)}),this._map.on("drag",function(t){e._update(t.point)}),this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},wr.prototype.getElement=function(){return this._container},wr.prototype.setText=function(t){return this.setDOMContent(mt.window.document.createTextNode(t))},wr.prototype.setHTML=function(t){var e,i=mt.window.document.createDocumentFragment(),n=mt.window.document.createElement("body");for(n.innerHTML=t;e=n.firstChild;)i.appendChild(e);return this.setDOMContent(i)},wr.prototype.getMaxWidth=function(){return this._container.style.maxWidth},wr.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},wr.prototype.setDOMContent=function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},wr.prototype._createContent=function(){this._content&&y.remove(this._content),this._content=y.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=y.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClickClose))},wr.prototype._update=function(t){var e=this,i=this._lngLat||this._trackPointer;if(this._map&&i&&this._content&&(this._container||(this._container=y.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=y.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(function(t){return e._container.classList.add(t)})),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=nr(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||t)){var n=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat),o=this.options.anchor,r=function t(e){if(e){if("number"==typeof e){var i=Math.round(Math.sqrt(.5*Math.pow(e,2)));return{center:new mt.Point(0,0),top:new mt.Point(0,e),"top-left":new mt.Point(i,i),"top-right":new mt.Point(-i,i),bottom:new mt.Point(0,-e),"bottom-left":new mt.Point(i,-i),"bottom-right":new mt.Point(-i,-i),left:new mt.Point(e,0),right:new mt.Point(-e,0)}}if(e instanceof mt.Point||Array.isArray(e)){var n=mt.Point.convert(e);return{center:n,top:n,"top-left":n,"top-right":n,bottom:n,"bottom-left":n,"bottom-right":n,left:n,right:n}}return{center:mt.Point.convert(e.center||[0,0]),top:mt.Point.convert(e.top||[0,0]),"top-left":mt.Point.convert(e["top-left"]||[0,0]),"top-right":mt.Point.convert(e["top-right"]||[0,0]),bottom:mt.Point.convert(e.bottom||[0,0]),"bottom-left":mt.Point.convert(e["bottom-left"]||[0,0]),"bottom-right":mt.Point.convert(e["bottom-right"]||[0,0]),left:mt.Point.convert(e.left||[0,0]),right:mt.Point.convert(e.right||[0,0])}}return t(new mt.Point(0,0))}(this.options.offset);if(!o){var a,s=this._container.offsetWidth,l=this._container.offsetHeight;a=n.y+r.bottom.y<l?["top"]:n.y>this._map.transform.height-l?["bottom"]:[],n.x<s/2?a.push("left"):n.x>this._map.transform.width-s/2&&a.push("right"),o=0===a.length?"bottom":a.join("-")}var u=n.add(r[o]).round();y.setTransform(this._container,or[o]+" translate("+u.x+"px,"+u.y+"px)"),rr(this._container,o,"popup")}},wr.prototype._onClickClose=function(){this.remove()},wr);function wr(t){vr.call(this),this.options=mt.extend(Object.create(xr),t),mt.bindAll(["_update","_onClickClose","remove"],this)}var Lr={version:mt.version,supported:i,setRTLTextPlugin:mt.setRTLTextPlugin,Map:Qo,NavigationControl:er,GeolocateControl:dr,AttributionControl:Vo,ScaleControl:hr,FullscreenControl:yr,Popup:br,Marker:lr,Style:pn,LngLat:mt.LngLat,LngLatBounds:mt.LngLatBounds,Point:mt.Point,MercatorCoordinate:mt.MercatorCoordinate,Evented:mt.Evented,config:mt.config,get accessToken(){return mt.config.ACCESS_TOKEN},set accessToken(t){mt.config.ACCESS_TOKEN=t},get baseApiUrl(){return mt.config.API_URL},set baseApiUrl(t){mt.config.API_URL=t},get workerCount(){return ci.workerCount},set workerCount(t){ci.workerCount=t},get maxParallelImageRequests(){return mt.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(t){mt.config.MAX_PARALLEL_IMAGE_REQUESTS=t},clearStorage:function(t){mt.clearTileCache(t)},workerUrl:""};return Lr}),a}),L.drawVersion="0.4.2",L.Draw={},L.drawLocal={draw:{toolbar:{actions:{title:"Cancel drawing",text:"Cancel"},finish:{title:"Finish drawing",text:"Finish"},undo:{title:"Delete last point drawn",text:"Delete last point"},buttons:{polyline:"Draw a polyline",polygon:"Draw a polygon",rectangle:"Draw a rectangle",circle:"Draw a circle",marker:"Draw a marker",circlemarker:"Draw a circlemarker"}},handlers:{circle:{tooltip:{start:"Click and drag to draw circle."},radius:"Radius"},circlemarker:{tooltip:{start:"Click map to place circle marker."}},marker:{tooltip:{start:"Click map to place marker."}},polygon:{tooltip:{start:"Click to start drawing shape.",cont:"Click to continue drawing shape.",end:"Click first point to close this shape."}},polyline:{error:"<strong>Error:</strong> shape edges cannot cross!",tooltip:{start:"Click to start drawing line.",cont:"Click to continue drawing line.",end:"Click last point to finish line."}},rectangle:{tooltip:{start:"Click and drag to draw rectangle."}},simpleshape:{tooltip:{end:"Release mouse to finish drawing."}}}},edit:{toolbar:{actions:{save:{title:"Save changes",text:"Save"},cancel:{title:"Cancel editing, discards all changes",text:"Cancel"},clearAll:{title:"Clear all layers",text:"Clear All"}},buttons:{edit:"Edit layers",editDisabled:"No layers to edit",remove:"Delete layers",removeDisabled:"No layers to delete"}},handlers:{edit:{tooltip:{text:"Drag handles or markers to edit features.",subtext:"Click cancel to undo changes."}},remove:{tooltip:{text:"Click on a feature to remove."}}}}},L.Draw.Event={},L.Draw.Event.CREATED="draw:created",L.Draw.Event.EDITED="draw:edited",L.Draw.Event.DELETED="draw:deleted",L.Draw.Event.DRAWSTART="draw:drawstart",L.Draw.Event.DRAWSTOP="draw:drawstop",L.Draw.Event.DRAWVERTEX="draw:drawvertex",L.Draw.Event.EDITSTART="draw:editstart",L.Draw.Event.EDITMOVE="draw:editmove",L.Draw.Event.EDITRESIZE="draw:editresize",L.Draw.Event.EDITVERTEX="draw:editvertex",L.Draw.Event.EDITSTOP="draw:editstop",L.Draw.Event.DELETESTART="draw:deletestart",L.Draw.Event.DELETESTOP="draw:deletestop",L.Draw.Event.TOOLBAROPENED="draw:toolbaropened",L.Draw.Event.TOOLBARCLOSED="draw:toolbarclosed",L.Toolbar=L.Class.extend({initialize:function(t){L.setOptions(this,t),this._modes={},this._actionButtons=[],this._activeMode=null;var e=L.version.split(".");1===parseInt(e[0],10)&&2<=parseInt(e[1],10)?L.Toolbar.include(L.Evented.prototype):L.Toolbar.include(L.Mixin.Events)},enabled:function(){return null!==this._activeMode},disable:function(){this.enabled()&&this._activeMode.handler.disable()},addToolbar:function(t){var e,i=L.DomUtil.create("div","leaflet-draw-section"),n=0,o=this._toolbarClass||"",r=this.getModeHandlers(t);for(this._toolbarContainer=L.DomUtil.create("div","leaflet-draw-toolbar leaflet-bar"),this._map=t,e=0;e<r.length;e++)r[e].enabled&&this._initModeHandler(r[e].handler,this._toolbarContainer,n++,o,r[e].title);if(n)return this._lastButtonIndex=--n,this._actionsContainer=L.DomUtil.create("ul","leaflet-draw-actions"),i.appendChild(this._toolbarContainer),i.appendChild(this._actionsContainer),i},removeToolbar:function(){for(var t in this._modes)this._modes.hasOwnProperty(t)&&(this._disposeButton(this._modes[t].button,this._modes[t].handler.enable,this._modes[t].handler),this._modes[t].handler.disable(),this._modes[t].handler.off("enabled",this._handlerActivated,this).off("disabled",this._handlerDeactivated,this));this._modes={};for(var e=0,i=this._actionButtons.length;e<i;e++)this._disposeButton(this._actionButtons[e].button,this._actionButtons[e].callback,this);this._actionButtons=[],this._actionsContainer=null},_initModeHandler:function(t,e,i,n,o){var r=t.type;this._modes[r]={},this._modes[r].handler=t,this._modes[r].button=this._createButton({type:r,title:o,className:n+"-"+r,container:e,callback:this._modes[r].handler.enable,context:this._modes[r].handler}),this._modes[r].buttonIndex=i,this._modes[r].handler.on("enabled",this._handlerActivated,this).on("disabled",this._handlerDeactivated,this)},_detectIOS:function(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream},_createButton:function(t){var e=L.DomUtil.create("a",t.className||"",t.container),i=L.DomUtil.create("span","sr-only",t.container);e.href="#",e.appendChild(i),t.title&&(e.title=t.title,i.innerHTML=t.title),t.text&&(e.innerHTML=t.text,i.innerHTML=t.text);var n=this._detectIOS()?"touchstart":"click";return L.DomEvent.on(e,"click",L.DomEvent.stopPropagation).on(e,"mousedown",L.DomEvent.stopPropagation).on(e,"dblclick",L.DomEvent.stopPropagation).on(e,"touchstart",L.DomEvent.stopPropagation).on(e,"click",L.DomEvent.preventDefault).on(e,n,t.callback,t.context),e},_disposeButton:function(t,e){var i=this._detectIOS()?"touchstart":"click";L.DomEvent.off(t,"click",L.DomEvent.stopPropagation).off(t,"mousedown",L.DomEvent.stopPropagation).off(t,"dblclick",L.DomEvent.stopPropagation).off(t,"touchstart",L.DomEvent.stopPropagation).off(t,"click",L.DomEvent.preventDefault).off(t,i,e)},_handlerActivated:function(t){this.disable(),this._activeMode=this._modes[t.handler],L.DomUtil.addClass(this._activeMode.button,"leaflet-draw-toolbar-button-enabled"),this._showActionsToolbar(),this.fire("enable")},_handlerDeactivated:function(){this._hideActionsToolbar(),L.DomUtil.removeClass(this._activeMode.button,"leaflet-draw-toolbar-button-enabled"),this._activeMode=null,this.fire("disable")},_createActions:function(t){var e,i,n,o,r=this._actionsContainer,a=this.getActions(t),s=a.length;for(i=0,n=this._actionButtons.length;i<n;i++)this._disposeButton(this._actionButtons[i].button,this._actionButtons[i].callback);for(this._actionButtons=[];r.firstChild;)r.removeChild(r.firstChild);for(var l=0;l<s;l++)"enabled"in a[l]&&!a[l].enabled||(e=L.DomUtil.create("li","",r),o=this._createButton({title:a[l].title,text:a[l].text,container:e,callback:a[l].callback,context:a[l].context}),this._actionButtons.push({button:o,callback:a[l].callback}))},_showActionsToolbar:function(){var t=this._activeMode.buttonIndex,e=this._lastButtonIndex,i=this._activeMode.button.offsetTop-1;this._createActions(this._activeMode.handler),this._actionsContainer.style.top=i+"px",0===t&&(L.DomUtil.addClass(this._toolbarContainer,"leaflet-draw-toolbar-notop"),L.DomUtil.addClass(this._actionsContainer,"leaflet-draw-actions-top")),t===e&&(L.DomUtil.addClass(this._toolbarContainer,"leaflet-draw-toolbar-nobottom"),L.DomUtil.addClass(this._actionsContainer,"leaflet-draw-actions-bottom")),this._actionsContainer.style.display="block",this._map.fire(L.Draw.Event.TOOLBAROPENED)},_hideActionsToolbar:function(){this._actionsContainer.style.display="none",L.DomUtil.removeClass(this._toolbarContainer,"leaflet-draw-toolbar-notop"),L.DomUtil.removeClass(this._toolbarContainer,"leaflet-draw-toolbar-nobottom"),L.DomUtil.removeClass(this._actionsContainer,"leaflet-draw-actions-top"),L.DomUtil.removeClass(this._actionsContainer,"leaflet-draw-actions-bottom"),this._map.fire(L.Draw.Event.TOOLBARCLOSED)}}),L.Draw=L.Draw||{},L.Draw.Tooltip=L.Class.extend({initialize:function(t){this._map=t,this._popupPane=t._panes.popupPane,this._visible=!1,this._container=t.options.drawControlTooltips?L.DomUtil.create("div","leaflet-draw-tooltip",this._popupPane):null,this._singleLineLabel=!1,this._map.on("mouseout",this._onMouseOut,this)},dispose:function(){this._map.off("mouseout",this._onMouseOut,this),this._container&&(this._popupPane.removeChild(this._container),this._container=null)},updateContent:function(t){return this._container&&(t.subtext=t.subtext||"",0!==t.subtext.length||this._singleLineLabel?0<t.subtext.length&&this._singleLineLabel&&(L.DomUtil.removeClass(this._container,"leaflet-draw-tooltip-single"),this._singleLineLabel=!1):(L.DomUtil.addClass(this._container,"leaflet-draw-tooltip-single"),this._singleLineLabel=!0),this._container.innerHTML=(0<t.subtext.length?'<span class="leaflet-draw-tooltip-subtext">'+t.subtext+"</span><br />":"")+"<span>"+t.text+"</span>",t.text||t.subtext?(this._visible=!0,this._container.style.visibility="inherit"):(this._visible=!1,this._container.style.visibility="hidden")),this},updatePosition:function(t){var e=this._map.latLngToLayerPoint(t),i=this._container;return this._container&&(this._visible&&(i.style.visibility="inherit"),L.DomUtil.setPosition(i,e)),this},showAsError:function(){return this._container&&L.DomUtil.addClass(this._container,"leaflet-error-draw-tooltip"),this},removeError:function(){return this._container&&L.DomUtil.removeClass(this._container,"leaflet-error-draw-tooltip"),this},_onMouseOut:function(){this._container&&(this._container.style.visibility="hidden")}}),function(){var a={km:2,ha:2,m:0,mi:2,ac:2,yd:0,ft:0,nm:2};L.GeometryUtil=L.extend(L.GeometryUtil||{},{geodesicArea:function(t){var e,i,n=t.length,o=0,r=Math.PI/180;if(2<n){for(var a=0;a<n;a++)e=t[a],o+=((i=t[(a+1)%n]).lng-e.lng)*r*(2+Math.sin(e.lat*r)+Math.sin(i.lat*r));o=6378137*o*6378137/2}return Math.abs(o)},formattedNumber:function(t,e){var i=parseFloat(t).toFixed(e),n=L.drawLocal.format&&L.drawLocal.format.numeric,o=n&&n.delimiters,r=o&&o.thousands,a=o&&o.decimal;if(r||a){var s=i.split(".");i=r?s[0].replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+r):s[0],a=a||".",1<s.length&&(i=i+a+s[1])}return i},readableArea:function(t,e,i){var n;i=L.Util.extend({},a,i);return e?(n=["ha","m"],type=typeof e,"string"===type?n=[e]:"boolean"!==type&&(n=e),1e6<=t&&-1!==n.indexOf("km")?L.GeometryUtil.formattedNumber(1e-6*t,i.km)+" km²":1e4<=t&&-1!==n.indexOf("ha")?L.GeometryUtil.formattedNumber(1e-4*t,i.ha)+" ha":L.GeometryUtil.formattedNumber(t,i.m)+" m²"):3097600<=(t/=.836127)?L.GeometryUtil.formattedNumber(t/3097600,i.mi)+" mi²":4840<=t?L.GeometryUtil.formattedNumber(t/4840,i.ac)+" acres":L.GeometryUtil.formattedNumber(t,i.yd)+" yd²"},readableDistance:function(t,e,i,n,o){var r;o=L.Util.extend({},a,o);switch(e?"string"==typeof e?e:"metric":i?"feet":n?"nauticalMile":"yards"){case"metric":r=1e3<t?L.GeometryUtil.formattedNumber(t/1e3,o.km)+" km":L.GeometryUtil.formattedNumber(t,o.m)+" m";break;case"feet":t*=3.28083,r=L.GeometryUtil.formattedNumber(t,o.ft)+" ft";break;case"nauticalMile":t*=.53996,r=L.GeometryUtil.formattedNumber(t/1e3,o.nm)+" nm";break;case"yards":default:r=1760<(t*=1.09361)?L.GeometryUtil.formattedNumber(t/1760,o.mi)+" miles":L.GeometryUtil.formattedNumber(t,o.yd)+" yd"}return r},isVersion07x:function(){var t=L.version.split(".");return 0===parseInt(t[0],10)&&7===parseInt(t[1],10)}})}(),L.LatLngUtil={cloneLatLngs:function(t){for(var e=[],i=0,n=t.length;i<n;i++)Array.isArray(t[i])?e.push(L.LatLngUtil.cloneLatLngs(t[i])):e.push(this.cloneLatLng(t[i]));return e},cloneLatLng:function(t){return L.latLng(t.lat,t.lng)}},L.Util.extend(L.LineUtil,{segmentsIntersect:function(t,e,i,n){return this._checkCounterclockwise(t,i,n)!==this._checkCounterclockwise(e,i,n)&&this._checkCounterclockwise(t,e,i)!==this._checkCounterclockwise(t,e,n)},_checkCounterclockwise:function(t,e,i){return(i.y-t.y)*(e.x-t.x)>(e.y-t.y)*(i.x-t.x)}}),L.Polygon.include({intersects:function(){var t,e,i,n,o=this._getProjectedPoints();return!this._tooFewPointsForIntersection()&&(!!L.Polyline.prototype.intersects.call(this)||(t=o.length,e=o[0],i=o[t-1],n=t-2,this._lineSegmentsIntersectsRange(i,e,n,1)))}}),L.Polyline.include({intersects:function(){var t,e,i,n=this._getProjectedPoints(),o=n?n.length:0;if(this._tooFewPointsForIntersection())return!1;for(t=o-1;3<=t;t--)if(e=n[t-1],i=n[t],this._lineSegmentsIntersectsRange(e,i,t-2))return!0;return!1},newLatLngIntersects:function(t,e){return!!this._map&&this.newPointIntersects(this._map.latLngToLayerPoint(t),e)},newPointIntersects:function(t,e){var i=this._getProjectedPoints(),n=i?i.length:0,o=i?i[n-1]:null,r=n-2;return!this._tooFewPointsForIntersection(1)&&this._lineSegmentsIntersectsRange(o,t,r,e?1:0)},_tooFewPointsForIntersection:function(t){var e=this._getProjectedPoints(),i=e?e.length:0;return!e||(i+=t||0)<=3},_lineSegmentsIntersectsRange:function(t,e,i,n){var o,r,a=this._getProjectedPoints();n=n||0;for(var s=i;n<s;s--)if(o=a[s-1],r=a[s],L.LineUtil.segmentsIntersect(t,e,o,r))return!0;return!1},_getProjectedPoints:function(){if(!this._defaultShape)return this._originalPoints;for(var t=[],e=this._defaultShape(),i=0;i<e.length;i++)t.push(this._map.latLngToLayerPoint(e[i]));return t}}),L.Map.mergeOptions({touchExtend:!0}),L.Map.TouchExtend=L.Handler.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane},addHooks:function(){L.DomEvent.on(this._container,"touchstart",this._onTouchStart,this),L.DomEvent.on(this._container,"touchend",this._onTouchEnd,this),L.DomEvent.on(this._container,"touchmove",this._onTouchMove,this),this._detectIE()?(L.DomEvent.on(this._container,"MSPointerDown",this._onTouchStart,this),L.DomEvent.on(this._container,"MSPointerUp",this._onTouchEnd,this),L.DomEvent.on(this._container,"MSPointerMove",this._onTouchMove,this),L.DomEvent.on(this._container,"MSPointerCancel",this._onTouchCancel,this)):(L.DomEvent.on(this._container,"touchcancel",this._onTouchCancel,this),L.DomEvent.on(this._container,"touchleave",this._onTouchLeave,this))},removeHooks:function(){L.DomEvent.off(this._container,"touchstart",this._onTouchStart),L.DomEvent.off(this._container,"touchend",this._onTouchEnd),L.DomEvent.off(this._container,"touchmove",this._onTouchMove),this._detectIE()?(L.DomEvent.off(this._container,"MSPointerDowm",this._onTouchStart),L.DomEvent.off(this._container,"MSPointerUp",this._onTouchEnd),L.DomEvent.off(this._container,"MSPointerMove",this._onTouchMove),L.DomEvent.off(this._container,"MSPointerCancel",this._onTouchCancel)):(L.DomEvent.off(this._container,"touchcancel",this._onTouchCancel),L.DomEvent.off(this._container,"touchleave",this._onTouchLeave))},_touchEvent:function(t,e){var i={};if(void 0!==t.touches){if(!t.touches.length)return;i=t.touches[0]}else{if("touch"!==t.pointerType)return;if(i=t,!this._filterClick(t))return}var n=this._map.mouseEventToContainerPoint(i),o=this._map.mouseEventToLayerPoint(i),r=this._map.layerPointToLatLng(o);this._map.fire(e,{latlng:r,layerPoint:o,containerPoint:n,pageX:i.pageX,pageY:i.pageY,originalEvent:t})},_filterClick:function(t){var e=t.timeStamp||t.originalEvent.timeStamp,i=L.DomEvent._lastClick&&e-L.DomEvent._lastClick;return i&&100<i&&i<500||t.target._simulatedClick&&!t._simulated?(L.DomEvent.stop(t),!1):(L.DomEvent._lastClick=e,!0)},_onTouchStart:function(t){if(this._map._loaded){this._touchEvent(t,"touchstart")}},_onTouchEnd:function(t){if(this._map._loaded){this._touchEvent(t,"touchend")}},_onTouchCancel:function(t){if(this._map._loaded){var e="touchcancel";this._detectIE()&&(e="pointercancel"),this._touchEvent(t,e)}},_onTouchLeave:function(t){if(this._map._loaded){this._touchEvent(t,"touchleave")}},_onTouchMove:function(t){if(this._map._loaded){this._touchEvent(t,"touchmove")}},_detectIE:function(){var t=window.navigator.userAgent,e=t.indexOf("MSIE ");if(0<e)return parseInt(t.substring(e+5,t.indexOf(".",e)),10);if(0<t.indexOf("Trident/")){var i=t.indexOf("rv:");return parseInt(t.substring(i+3,t.indexOf(".",i)),10)}var n=t.indexOf("Edge/");return 0<n&&parseInt(t.substring(n+5,t.indexOf(".",n)),10)}}),L.Map.addInitHook("addHandler","touchExtend",L.Map.TouchExtend),L.Marker.Touch=L.Marker.extend({_initInteraction:function(){return this.addInteractiveTarget?L.Marker.prototype._initInteraction.apply(this):this._initInteractionLegacy()},_initInteractionLegacy:function(){if(this.options.clickable){var t=this._icon,e=["dblclick","mousedown","mouseover","mouseout","contextmenu","touchstart","touchend","touchmove"];this._detectIE?e.concat(["MSPointerDown","MSPointerUp","MSPointerMove","MSPointerCancel"]):e.concat(["touchcancel"]),L.DomUtil.addClass(t,"leaflet-clickable"),L.DomEvent.on(t,"click",this._onMouseClick,this),L.DomEvent.on(t,"keypress",this._onKeyPress,this);for(var i=0;i<e.length;i++)L.DomEvent.on(t,e[i],this._fireMouseEvent,this);L.Handler.MarkerDrag&&(this.dragging=new L.Handler.MarkerDrag(this),this.options.draggable&&this.dragging.enable())}},_detectIE:function(){var t=window.navigator.userAgent,e=t.indexOf("MSIE ");if(0<e)return parseInt(t.substring(e+5,t.indexOf(".",e)),10);if(0<t.indexOf("Trident/")){var i=t.indexOf("rv:");return parseInt(t.substring(i+3,t.indexOf(".",i)),10)}var n=t.indexOf("Edge/");return 0<n&&parseInt(t.substring(n+5,t.indexOf(".",n)),10)}}),L.DrawToolbar=L.Toolbar.extend({statics:{TYPE:"draw"},options:{polyline:{},polygon:{},rectangle:{},circle:{},marker:{},circlemarker:{}},initialize:function(t){for(var e in this.options)this.options.hasOwnProperty(e)&&t[e]&&(t[e]=L.extend({},this.options[e],t[e]));this._toolbarClass="leaflet-draw-draw",L.Toolbar.prototype.initialize.call(this,t)},getModeHandlers:function(t){return[{enabled:this.options.polyline,handler:new L.Draw.Polyline(t,this.options.polyline),title:L.drawLocal.draw.toolbar.buttons.polyline},{enabled:this.options.polygon,handler:new L.Draw.Polygon(t,this.options.polygon),title:L.drawLocal.draw.toolbar.buttons.polygon},{enabled:this.options.rectangle,handler:new L.Draw.Rectangle(t,this.options.rectangle),title:L.drawLocal.draw.toolbar.buttons.rectangle},{enabled:this.options.circle,handler:new L.Draw.Circle(t,this.options.circle),title:L.drawLocal.draw.toolbar.buttons.circle},{enabled:this.options.marker,handler:new L.Draw.Marker(t,this.options.marker),title:L.drawLocal.draw.toolbar.buttons.marker},{enabled:this.options.circlemarker,handler:new L.Draw.CircleMarker(t,this.options.circlemarker),title:L.drawLocal.draw.toolbar.buttons.circlemarker}]},getActions:function(t){return[{enabled:t.completeShape,title:L.drawLocal.draw.toolbar.finish.title,text:L.drawLocal.draw.toolbar.finish.text,callback:t.completeShape,context:t},{enabled:t.deleteLastVertex,title:L.drawLocal.draw.toolbar.undo.title,text:L.drawLocal.draw.toolbar.undo.text,callback:t.deleteLastVertex,context:t},{title:L.drawLocal.draw.toolbar.actions.title,text:L.drawLocal.draw.toolbar.actions.text,callback:this.disable,context:this}]},setOptions:function(t){for(var e in L.setOptions(this,t),this._modes)this._modes.hasOwnProperty(e)&&t.hasOwnProperty(e)&&this._modes[e].handler.setOptions(t[e])}}),L.Draw=L.Draw||{},L.Draw.Feature=L.Handler.extend({initialize:function(t,e){this._map=t,this._container=t._container,this._overlayPane=t._panes.overlayPane,this._popupPane=t._panes.popupPane,e&&e.shapeOptions&&(e.shapeOptions=L.Util.extend({},this.options.shapeOptions,e.shapeOptions)),L.setOptions(this,e);var i=L.version.split(".");1===parseInt(i[0],10)&&2<=parseInt(i[1],10)?L.Draw.Feature.include(L.Evented.prototype):L.Draw.Feature.include(L.Mixin.Events)},enable:function(){this._enabled||(L.Handler.prototype.enable.call(this),this.fire("enabled",{handler:this.type}),this._map.fire(L.Draw.Event.DRAWSTART,{layerType:this.type}))},disable:function(){this._enabled&&(L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.DRAWSTOP,{layerType:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var t=this._map;t&&(L.DomUtil.disableTextSelection(),t.getContainer().focus(),this._tooltip=new L.Draw.Tooltip(this._map),L.DomEvent.on(this._container,"keyup",this._cancelDrawing,this))},removeHooks:function(){this._map&&(L.DomUtil.enableTextSelection(),this._tooltip.dispose(),this._tooltip=null,L.DomEvent.off(this._container,"keyup",this._cancelDrawing,this))},setOptions:function(t){L.setOptions(this,t)},_fireCreatedEvent:function(t){this._map.fire(L.Draw.Event.CREATED,{layer:t,layerType:this.type})},_cancelDrawing:function(t){27===t.keyCode&&(this._map.fire("draw:canceled",{layerType:this.type}),this.disable())}}),L.SimpleShape={},L.Draw.SimpleShape=L.Draw.Feature.extend({options:{repeatMode:!1},initialize:function(t,e){this._endLabelText=L.drawLocal.draw.handlers.simpleshape.tooltip.end,L.Draw.Feature.prototype.initialize.call(this,t,e)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._mapDraggable=this._map.dragging.enabled(),this._mapDraggable&&this._map.dragging.disable(),this._container.style.cursor="crosshair",this._tooltip.updateContent({text:this._initialLabelText}),this._map.on("mousedown",this._onMouseDown,this).on("mousemove",this._onMouseMove,this).on("touchstart",this._onMouseDown,this).on("touchmove",this._onMouseMove,this),document.addEventListener("touchstart",L.DomEvent.preventDefault,{passive:!1}))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._map&&(this._mapDraggable&&this._map.dragging.enable(),this._container.style.cursor="",this._map.off("mousedown",this._onMouseDown,this).off("mousemove",this._onMouseMove,this).off("touchstart",this._onMouseDown,this).off("touchmove",this._onMouseMove,this),L.DomEvent.off(document,"mouseup",this._onMouseUp,this),L.DomEvent.off(document,"touchend",this._onMouseUp,this),document.removeEventListener("touchstart",L.DomEvent.preventDefault),this._shape&&(this._map.removeLayer(this._shape),delete this._shape)),this._isDrawing=!1},_getTooltipText:function(){return{text:this._endLabelText}},_onMouseDown:function(t){this._isDrawing=!0,this._startLatLng=t.latlng,L.DomEvent.on(document,"mouseup",this._onMouseUp,this).on(document,"touchend",this._onMouseUp,this).preventDefault(t.originalEvent)},_onMouseMove:function(t){var e=t.latlng;this._tooltip.updatePosition(e),this._isDrawing&&(this._tooltip.updateContent(this._getTooltipText()),this._drawShape(e))},_onMouseUp:function(){this._shape&&this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable()}}),L.Draw.Polyline=L.Draw.Feature.extend({statics:{TYPE:"polyline"},Poly:L.Polyline,options:{allowIntersection:!0,repeatMode:!1,drawError:{color:"#b00b00",timeout:2500},icon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon"}),touchIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-touch-icon"}),guidelineDistance:20,maxGuideLineLength:4e3,shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!1,clickable:!0},metric:!0,feet:!0,nautic:!1,showLength:!0,zIndexOffset:2e3,factor:1,maxPoints:0},initialize:function(t,e){L.Browser.touch&&(this.options.icon=this.options.touchIcon),this.options.drawError.message=L.drawLocal.draw.handlers.polyline.error,e&&e.drawError&&(e.drawError=L.Util.extend({},this.options.drawError,e.drawError)),this.type=L.Draw.Polyline.TYPE,L.Draw.Feature.prototype.initialize.call(this,t,e)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._markers=[],this._markerGroup=new L.LayerGroup,this._map.addLayer(this._markerGroup),this._poly=new L.Polyline([],this.options.shapeOptions),this._tooltip.updateContent(this._getTooltipText()),this._mouseMarker||(this._mouseMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"leaflet-mouse-marker",iconAnchor:[20,20],iconSize:[40,40]}),opacity:0,zIndexOffset:this.options.zIndexOffset})),this._mouseMarker.on("mouseout",this._onMouseOut,this).on("mousemove",this._onMouseMove,this).on("mousedown",this._onMouseDown,this).on("mouseup",this._onMouseUp,this).addTo(this._map),this._map.on("mouseup",this._onMouseUp,this).on("mousemove",this._onMouseMove,this).on("zoomlevelschange",this._onZoomEnd,this).on("touchstart",this._onTouch,this).on("zoomend",this._onZoomEnd,this))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._clearHideErrorTimeout(),this._cleanUpShape(),this._map.removeLayer(this._markerGroup),delete this._markerGroup,delete this._markers,this._map.removeLayer(this._poly),delete this._poly,this._mouseMarker.off("mousedown",this._onMouseDown,this).off("mouseout",this._onMouseOut,this).off("mouseup",this._onMouseUp,this).off("mousemove",this._onMouseMove,this),this._map.removeLayer(this._mouseMarker),delete this._mouseMarker,this._clearGuides(),this._map.off("mouseup",this._onMouseUp,this).off("mousemove",this._onMouseMove,this).off("zoomlevelschange",this._onZoomEnd,this).off("zoomend",this._onZoomEnd,this).off("touchstart",this._onTouch,this).off("click",this._onTouch,this)},deleteLastVertex:function(){if(!(this._markers.length<=1)){var t=this._markers.pop(),e=this._poly,i=e.getLatLngs(),n=i.splice(-1,1)[0];this._poly.setLatLngs(i),this._markerGroup.removeLayer(t),e.getLatLngs().length<2&&this._map.removeLayer(e),this._vertexChanged(n,!1)}},addVertex:function(t){2<=this._markers.length&&!this.options.allowIntersection&&this._poly.newLatLngIntersects(t)?this._showErrorTooltip():(this._errorShown&&this._hideErrorTooltip(),this._markers.push(this._addMarker(t)),this._poly.addLatLng(t),2===this._poly.getLatLngs().length&&this._map.addLayer(this._poly),this._vertexChanged(t,!0))},completeShape:function(){this._markers.length<=1||(this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable())},_finishShape:function(){var t=this._poly._defaultShape?this._poly._defaultShape():this._poly.getLatLngs(),e=this._poly.newLatLngIntersects(t[t.length-1]);!this.options.allowIntersection&&e||!this._shapeIsValid()?this._showErrorTooltip():(this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable())},_shapeIsValid:function(){return!0},_onZoomEnd:function(){null!==this._markers&&this._updateGuide()},_onMouseMove:function(t){var e=this._map.mouseEventToLayerPoint(t.originalEvent),i=this._map.layerPointToLatLng(e);this._currentLatLng=i,this._updateTooltip(i),this._updateGuide(e),this._mouseMarker.setLatLng(i),L.DomEvent.preventDefault(t.originalEvent)},_vertexChanged:function(t,e){this._map.fire(L.Draw.Event.DRAWVERTEX,{layers:this._markerGroup}),this._updateFinishHandler(),this._updateRunningMeasure(t,e),this._clearGuides(),this._updateTooltip()},_onMouseDown:function(t){if(!this._clickHandled&&!this._touchHandled&&!this._disableMarkers){this._onMouseMove(t),this._clickHandled=!0,this._disableNewMarkers();var e=t.originalEvent,i=e.clientX,n=e.clientY;this._startPoint.call(this,i,n)}},_startPoint:function(t,e){this._mouseDownOrigin=L.point(t,e)},_onMouseUp:function(t){var e=t.originalEvent,i=e.clientX,n=e.clientY;this._endPoint.call(this,i,n,t),this._clickHandled=null},_endPoint:function(t,e,i){if(this._mouseDownOrigin){var n=L.point(t,e).distanceTo(this._mouseDownOrigin),o=this._calculateFinishDistance(i.latlng);1<this.options.maxPoints&&this.options.maxPoints==this._markers.length+1?(this.addVertex(i.latlng),this._finishShape()):o<10&&L.Browser.touch?this._finishShape():Math.abs(n)<9*(window.devicePixelRatio||1)&&this.addVertex(i.latlng),this._enableNewMarkers()}this._mouseDownOrigin=null},_onTouch:function(t){var e,i,n=t.originalEvent;!n.touches||!n.touches[0]||this._clickHandled||this._touchHandled||this._disableMarkers||(e=n.touches[0].clientX,i=n.touches[0].clientY,this._disableNewMarkers(),this._touchHandled=!0,this._startPoint.call(this,e,i),this._endPoint.call(this,e,i,t),this._touchHandled=null),this._clickHandled=null},_onMouseOut:function(){this._tooltip&&this._tooltip._onMouseOut.call(this._tooltip)},_calculateFinishDistance:function(t){var e;if(0<this._markers.length){var i;if(this.type===L.Draw.Polyline.TYPE)i=this._markers[this._markers.length-1];else{if(this.type!==L.Draw.Polygon.TYPE)return 1/0;i=this._markers[0]}var n=this._map.latLngToContainerPoint(i.getLatLng()),o=new L.Marker(t,{icon:this.options.icon,zIndexOffset:2*this.options.zIndexOffset}),r=this._map.latLngToContainerPoint(o.getLatLng());e=n.distanceTo(r)}else e=1/0;return e},_updateFinishHandler:function(){var t=this._markers.length;1<t&&this._markers[t-1].on("click",this._finishShape,this),2<t&&this._markers[t-2].off("click",this._finishShape,this)},_addMarker:function(t){var e=new L.Marker(t,{icon:this.options.icon,zIndexOffset:2*this.options.zIndexOffset});return this._markerGroup.addLayer(e),e},_updateGuide:function(t){var e=this._markers?this._markers.length:0;0<e&&(t=t||this._map.latLngToLayerPoint(this._currentLatLng),this._clearGuides(),this._drawGuide(this._map.latLngToLayerPoint(this._markers[e-1].getLatLng()),t))},_updateTooltip:function(t){var e=this._getTooltipText();t&&this._tooltip.updatePosition(t),this._errorShown||this._tooltip.updateContent(e)},_drawGuide:function(t,e){var i,n,o,r=Math.floor(Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))),a=this.options.guidelineDistance,s=this.options.maxGuideLineLength,l=s<r?r-s:a;for(this._guidesContainer||(this._guidesContainer=L.DomUtil.create("div","leaflet-draw-guides",this._overlayPane));l<r;l+=this.options.guidelineDistance)i=l/r,n={x:Math.floor(t.x*(1-i)+i*e.x),y:Math.floor(t.y*(1-i)+i*e.y)},(o=L.DomUtil.create("div","leaflet-draw-guide-dash",this._guidesContainer)).style.backgroundColor=this._errorShown?this.options.drawError.color:this.options.shapeOptions.color,L.DomUtil.setPosition(o,n)},_updateGuideColor:function(t){if(this._guidesContainer)for(var e=0,i=this._guidesContainer.childNodes.length;e<i;e++)this._guidesContainer.childNodes[e].style.backgroundColor=t},_clearGuides:function(){if(this._guidesContainer)for(;this._guidesContainer.firstChild;)this._guidesContainer.removeChild(this._guidesContainer.firstChild)},_getTooltipText:function(){var t,e=this.options.showLength;return L.Browser.touch&&(e=!1),0===this._markers.length?{text:L.drawLocal.draw.handlers.polyline.tooltip.start}:(t=e?this._getMeasurementString():"",1===this._markers.length?{text:L.drawLocal.draw.handlers.polyline.tooltip.cont,subtext:t}:{text:L.drawLocal.draw.handlers.polyline.tooltip.end,subtext:t})},_updateRunningMeasure:function(t,e){var i,n,o=this._markers.length;1===this._markers.length?this._measurementRunningTotal=0:(i=o-(e?2:1),n=L.GeometryUtil.isVersion07x()?t.distanceTo(this._markers[i].getLatLng())*(this.options.factor||1):this._map.distance(t,this._markers[i].getLatLng())*(this.options.factor||1),this._measurementRunningTotal+=n*(e?1:-1))},_getMeasurementString:function(){var t,e=this._currentLatLng,i=this._markers[this._markers.length-1].getLatLng();return t=L.GeometryUtil.isVersion07x()?i&&e&&e.distanceTo?this._measurementRunningTotal+e.distanceTo(i)*(this.options.factor||1):this._measurementRunningTotal||0:i&&e?this._measurementRunningTotal+this._map.distance(e,i)*(this.options.factor||1):this._measurementRunningTotal||0,L.GeometryUtil.readableDistance(t,this.options.metric,this.options.feet,this.options.nautic,this.options.precision)},_showErrorTooltip:function(){this._errorShown=!0,this._tooltip.showAsError().updateContent({text:this.options.drawError.message}),this._updateGuideColor(this.options.drawError.color),this._poly.setStyle({color:this.options.drawError.color}),this._clearHideErrorTimeout(),this._hideErrorTimeout=setTimeout(L.Util.bind(this._hideErrorTooltip,this),this.options.drawError.timeout)},_hideErrorTooltip:function(){this._errorShown=!1,this._clearHideErrorTimeout(),this._tooltip.removeError().updateContent(this._getTooltipText()),this._updateGuideColor(this.options.shapeOptions.color),this._poly.setStyle({color:this.options.shapeOptions.color})},_clearHideErrorTimeout:function(){this._hideErrorTimeout&&(clearTimeout(this._hideErrorTimeout),this._hideErrorTimeout=null)},_disableNewMarkers:function(){this._disableMarkers=!0},_enableNewMarkers:function(){setTimeout(function(){this._disableMarkers=!1}.bind(this),50)},_cleanUpShape:function(){1<this._markers.length&&this._markers[this._markers.length-1].off("click",this._finishShape,this)},_fireCreatedEvent:function(){var t=new this.Poly(this._poly.getLatLngs(),this.options.shapeOptions);L.Draw.Feature.prototype._fireCreatedEvent.call(this,t)}}),L.Draw.Marker=L.Draw.Feature.extend({statics:{TYPE:"marker"},options:{icon:new L.Icon.Default,repeatMode:!1,zIndexOffset:2e3},initialize:function(t,e){this.type=L.Draw.Marker.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.marker.tooltip.start,L.Draw.Feature.prototype.initialize.call(this,t,e)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._tooltip.updateContent({text:this._initialLabelText}),this._mouseMarker||(this._mouseMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"leaflet-mouse-marker",iconAnchor:[20,20],iconSize:[40,40]}),opacity:0,zIndexOffset:this.options.zIndexOffset})),this._mouseMarker.on("click",this._onClick,this).addTo(this._map),this._map.on("mousemove",this._onMouseMove,this),this._map.on("click",this._onTouch,this))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._map&&(this._marker&&(this._marker.off("click",this._onClick,this),this._map.off("click",this._onClick,this).off("click",this._onTouch,this).removeLayer(this._marker),delete this._marker),this._mouseMarker.off("click",this._onClick,this),this._map.removeLayer(this._mouseMarker),delete this._mouseMarker,this._map.off("mousemove",this._onMouseMove,this))},_onMouseMove:function(t){var e=t.latlng;this._tooltip.updatePosition(e),this._mouseMarker.setLatLng(e),this._marker?(e=this._mouseMarker.getLatLng(),this._marker.setLatLng(e)):(this._marker=this._addMarker(e),this._marker.on("click",this._onClick,this),this._map.on("click",this._onClick,this).addLayer(this._marker))},_addMarker:function(t){return new L.Marker(t,{icon:this.options.icon,zIndexOffset:this.options.zIndexOffset})},_onClick:function(){this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable()},_onTouch:function(t){this._onMouseMove(t),this._onClick()},_fireCreatedEvent:function(){var t=new L.Marker.Touch(this._marker.getLatLng(),{icon:this.options.icon});L.Draw.Feature.prototype._fireCreatedEvent.call(this,t)}}),L.Draw.Circle=L.Draw.SimpleShape.extend({statics:{TYPE:"circle"},options:{shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},showRadius:!0,metric:!0,feet:!0,nautic:!1},initialize:function(t,e){this.type=L.Draw.Circle.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.circle.tooltip.start,L.Draw.SimpleShape.prototype.initialize.call(this,t,e)},_drawShape:function(t){if(L.GeometryUtil.isVersion07x())var e=this._startLatLng.distanceTo(t);else e=this._map.distance(this._startLatLng,t);this._shape?this._shape.setRadius(e):(this._shape=new L.Circle(this._startLatLng,e,this.options.shapeOptions),this._map.addLayer(this._shape))},_fireCreatedEvent:function(){var t=new L.Circle(this._startLatLng,this._shape.getRadius(),this.options.shapeOptions);L.Draw.SimpleShape.prototype._fireCreatedEvent.call(this,t)},_onMouseMove:function(t){var e,i=t.latlng,n=this.options.showRadius,o=this.options.metric;if(this._tooltip.updatePosition(i),this._isDrawing){this._drawShape(i),e=this._shape.getRadius().toFixed(1);var r="";n&&(r=L.drawLocal.draw.handlers.circle.radius+": "+L.GeometryUtil.readableDistance(e,o,this.options.feet,this.options.nautic)),this._tooltip.updateContent({text:this._endLabelText,subtext:r})}}}),L.Draw.CircleMarker=L.Draw.Marker.extend({statics:{TYPE:"circlemarker"},options:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0,zIndexOffset:2e3},initialize:function(t,e){this.type=L.Draw.CircleMarker.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.circlemarker.tooltip.start,L.Draw.Feature.prototype.initialize.call(this,t,e)},_fireCreatedEvent:function(){var t=new L.CircleMarker(this._marker.getLatLng(),this.options);L.Draw.Feature.prototype._fireCreatedEvent.call(this,t)},_addMarker:function(t){return new L.CircleMarker(t,this.options)}}),L.Draw.Polygon=L.Draw.Polyline.extend({statics:{TYPE:"polygon"},Poly:L.Polygon,options:{showArea:!1,showLength:!1,shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},metric:!0,feet:!0,nautic:!1,precision:{}},initialize:function(t,e){L.Draw.Polyline.prototype.initialize.call(this,t,e),this.type=L.Draw.Polygon.TYPE},_updateFinishHandler:function(){var t=this._markers.length;1===t&&this._markers[0].on("click",this._finishShape,this),2<t&&(this._markers[t-1].on("dblclick",this._finishShape,this),3<t&&this._markers[t-2].off("dblclick",this._finishShape,this))},_getTooltipText:function(){var t,e;return 0===this._markers.length?t=L.drawLocal.draw.handlers.polygon.tooltip.start:e=(t=this._markers.length<3?L.drawLocal.draw.handlers.polygon.tooltip.cont:L.drawLocal.draw.handlers.polygon.tooltip.end,this._getMeasurementString()),{text:t,subtext:e}},_getMeasurementString:function(){var t=this._area,e="";return t||this.options.showLength?(this.options.showLength&&(e=L.Draw.Polyline.prototype._getMeasurementString.call(this)),t&&(e+="<br>"+L.GeometryUtil.readableArea(t,this.options.metric,this.options.precision)),e):null},_shapeIsValid:function(){return 3<=this._markers.length},_vertexChanged:function(t,e){var i;!this.options.allowIntersection&&this.options.showArea&&(i=this._poly.getLatLngs(),this._area=L.GeometryUtil.geodesicArea(i)),L.Draw.Polyline.prototype._vertexChanged.call(this,t,e)},_cleanUpShape:function(){var t=this._markers.length;0<t&&(this._markers[0].off("click",this._finishShape,this),2<t&&this._markers[t-1].off("dblclick",this._finishShape,this))}}),L.Draw.Rectangle=L.Draw.SimpleShape.extend({statics:{TYPE:"rectangle"},options:{shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,showArea:!0,clickable:!0},metric:!0},initialize:function(t,e){this.type=L.Draw.Rectangle.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.rectangle.tooltip.start,L.Draw.SimpleShape.prototype.initialize.call(this,t,e)},disable:function(){this._enabled&&(this._isCurrentlyTwoClickDrawing=!1,L.Draw.SimpleShape.prototype.disable.call(this))},_onMouseUp:function(t){this._shape||this._isCurrentlyTwoClickDrawing?this._isCurrentlyTwoClickDrawing&&!_hasAncestor(t.target,"leaflet-pane")||L.Draw.SimpleShape.prototype._onMouseUp.call(this):this._isCurrentlyTwoClickDrawing=!0},_drawShape:function(t){this._shape?this._shape.setBounds(new L.LatLngBounds(this._startLatLng,t)):(this._shape=new L.Rectangle(new L.LatLngBounds(this._startLatLng,t),this.options.shapeOptions),this._map.addLayer(this._shape))},_fireCreatedEvent:function(){var t=new L.Rectangle(this._shape.getBounds(),this.options.shapeOptions);L.Draw.SimpleShape.prototype._fireCreatedEvent.call(this,t)},_getTooltipText:function(){var t,e,i,n=L.Draw.SimpleShape.prototype._getTooltipText.call(this),o=this._shape,r=this.options.showArea;return o&&(t=this._shape._defaultShape?this._shape._defaultShape():this._shape.getLatLngs(),e=L.GeometryUtil.geodesicArea(t),i=r?L.GeometryUtil.readableArea(e,this.options.metric):""),{text:n.text,subtext:i}}}),L.EditToolbar=L.Toolbar.extend({statics:{TYPE:"edit"},options:{edit:{selectedPathOptions:{dashArray:"10, 10",fill:!0,fillColor:"#fe57a1",fillOpacity:.1,maintainColor:!1}},remove:{},poly:null,featureGroup:null},initialize:function(t){t.edit&&(void 0===t.edit.selectedPathOptions&&(t.edit.selectedPathOptions=this.options.edit.selectedPathOptions),t.edit.selectedPathOptions=L.extend({},this.options.edit.selectedPathOptions,t.edit.selectedPathOptions)),t.remove&&(t.remove=L.extend({},this.options.remove,t.remove)),t.poly&&(t.poly=L.extend({},this.options.poly,t.poly)),this._toolbarClass="leaflet-draw-edit",L.Toolbar.prototype.initialize.call(this,t),this._selectedFeatureCount=0},getModeHandlers:function(t){var e=this.options.featureGroup;return[{enabled:this.options.edit,handler:new L.EditToolbar.Edit(t,{featureGroup:e,selectedPathOptions:this.options.edit.selectedPathOptions,poly:this.options.poly}),title:L.drawLocal.edit.toolbar.buttons.edit},{enabled:this.options.remove,handler:new L.EditToolbar.Delete(t,{featureGroup:e}),title:L.drawLocal.edit.toolbar.buttons.remove}]},getActions:function(t){var e=[{title:L.drawLocal.edit.toolbar.actions.save.title,text:L.drawLocal.edit.toolbar.actions.save.text,callback:this._save,context:this},{title:L.drawLocal.edit.toolbar.actions.cancel.title,text:L.drawLocal.edit.toolbar.actions.cancel.text,callback:this.disable,context:this}];return t.removeAllLayers&&e.push({title:L.drawLocal.edit.toolbar.actions.clearAll.title,text:L.drawLocal.edit.toolbar.actions.clearAll.text,callback:this._clearAllLayers,context:this}),e},addToolbar:function(t){var e=L.Toolbar.prototype.addToolbar.call(this,t);return this._checkDisabled(),this.options.featureGroup.on("layeradd layerremove",this._checkDisabled,this),e},removeToolbar:function(){this.options.featureGroup.off("layeradd layerremove",this._checkDisabled,this),L.Toolbar.prototype.removeToolbar.call(this)},disable:function(){this.enabled()&&(this._activeMode.handler.revertLayers(),L.Toolbar.prototype.disable.call(this))},_save:function(){this._activeMode.handler.save(),this._activeMode&&this._activeMode.handler.disable()},_clearAllLayers:function(){this._activeMode.handler.removeAllLayers(),this._activeMode&&this._activeMode.handler.disable()},_checkDisabled:function(){var t,e=0!==this.options.featureGroup.getLayers().length;this.options.edit&&(t=this._modes[L.EditToolbar.Edit.TYPE].button,e?L.DomUtil.removeClass(t,"leaflet-disabled"):L.DomUtil.addClass(t,"leaflet-disabled"),t.setAttribute("title",e?L.drawLocal.edit.toolbar.buttons.edit:L.drawLocal.edit.toolbar.buttons.editDisabled)),this.options.remove&&(t=this._modes[L.EditToolbar.Delete.TYPE].button,e?L.DomUtil.removeClass(t,"leaflet-disabled"):L.DomUtil.addClass(t,"leaflet-disabled"),t.setAttribute("title",e?L.drawLocal.edit.toolbar.buttons.remove:L.drawLocal.edit.toolbar.buttons.removeDisabled))}}),L.EditToolbar.Edit=L.Handler.extend({statics:{TYPE:"edit"},initialize:function(t,e){if(L.Handler.prototype.initialize.call(this,t),L.setOptions(this,e),this._featureGroup=e.featureGroup,!(this._featureGroup instanceof L.FeatureGroup))throw new Error("options.featureGroup must be a L.FeatureGroup");this._uneditedLayerProps={},this.type=L.EditToolbar.Edit.TYPE;var i=L.version.split(".");1===parseInt(i[0],10)&&2<=parseInt(i[1],10)?L.EditToolbar.Edit.include(L.Evented.prototype):L.EditToolbar.Edit.include(L.Mixin.Events)},enable:function(){!this._enabled&&this._hasAvailableLayers()&&(this.fire("enabled",{handler:this.type}),this._map.fire(L.Draw.Event.EDITSTART,{handler:this.type}),L.Handler.prototype.enable.call(this),this._featureGroup.on("layeradd",this._enableLayerEdit,this).on("layerremove",this._disableLayerEdit,this))},disable:function(){this._enabled&&(this._featureGroup.off("layeradd",this._enableLayerEdit,this).off("layerremove",this._disableLayerEdit,this),L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.EDITSTOP,{handler:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var t=this._map;t&&(t.getContainer().focus(),this._featureGroup.eachLayer(this._enableLayerEdit,this),this._tooltip=new L.Draw.Tooltip(this._map),this._tooltip.updateContent({text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext}),t._editTooltip=this._tooltip,this._updateTooltip(),this._map.on("mousemove",this._onMouseMove,this).on("touchmove",this._onMouseMove,this).on("MSPointerMove",this._onMouseMove,this).on(L.Draw.Event.EDITVERTEX,this._updateTooltip,this))},removeHooks:function(){this._map&&(this._featureGroup.eachLayer(this._disableLayerEdit,this),this._uneditedLayerProps={},this._tooltip.dispose(),this._tooltip=null,this._map.off("mousemove",this._onMouseMove,this).off("touchmove",this._onMouseMove,this).off("MSPointerMove",this._onMouseMove,this).off(L.Draw.Event.EDITVERTEX,this._updateTooltip,this))},revertLayers:function(){this._featureGroup.eachLayer(function(t){this._revertLayer(t)},this)},save:function(){var e=new L.LayerGroup;this._featureGroup.eachLayer(function(t){t.edited&&(e.addLayer(t),t.edited=!1)}),this._map.fire(L.Draw.Event.EDITED,{layers:e})},_backupLayer:function(t){var e=L.Util.stamp(t);this._uneditedLayerProps[e]||(t instanceof L.Polyline||t instanceof L.Polygon||t instanceof L.Rectangle?this._uneditedLayerProps[e]={latlngs:L.LatLngUtil.cloneLatLngs(t.getLatLngs())}:t instanceof L.Circle?this._uneditedLayerProps[e]={latlng:L.LatLngUtil.cloneLatLng(t.getLatLng()),radius:t.getRadius()}:(t instanceof L.Marker||t instanceof L.CircleMarker)&&(this._uneditedLayerProps[e]={latlng:L.LatLngUtil.cloneLatLng(t.getLatLng())}))},_getTooltipText:function(){return{text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext}},_updateTooltip:function(){this._tooltip.updateContent(this._getTooltipText())},_revertLayer:function(t){var e=L.Util.stamp(t);t.edited=!1,this._uneditedLayerProps.hasOwnProperty(e)&&(t instanceof L.Polyline||t instanceof L.Polygon||t instanceof L.Rectangle?t.setLatLngs(this._uneditedLayerProps[e].latlngs):t instanceof L.Circle?(t.setLatLng(this._uneditedLayerProps[e].latlng),t.setRadius(this._uneditedLayerProps[e].radius)):(t instanceof L.Marker||t instanceof L.CircleMarker)&&t.setLatLng(this._uneditedLayerProps[e].latlng),t.fire("revert-edited",{layer:t}))},_enableLayerEdit:function(t){var e,i,n=t.layer||t.target||t;this._backupLayer(n),this.options.poly&&(i=L.Util.extend({},this.options.poly),n.options.poly=i),this.options.selectedPathOptions&&((e=L.Util.extend({},this.options.selectedPathOptions)).maintainColor&&(e.color=n.options.color,e.fillColor=n.options.fillColor),n.options.original=L.extend({},n.options),n.options.editing=e),n instanceof L.Marker?(n.editing&&n.editing.enable(),n.dragging.enable(),n.on("dragend",this._onMarkerDragEnd).on("touchmove",this._onTouchMove,this).on("MSPointerMove",this._onTouchMove,this).on("touchend",this._onMarkerDragEnd,this).on("MSPointerUp",this._onMarkerDragEnd,this)):n.editing.enable()},_disableLayerEdit:function(t){var e=t.layer||t.target||t;e.edited=!1,e.editing&&e.editing.disable(),delete e.options.editing,delete e.options.original,this._selectedPathOptions&&(e instanceof L.Marker?this._toggleMarkerHighlight(e):(e.setStyle(e.options.previousOptions),delete e.options.previousOptions)),e instanceof L.Marker?(e.dragging.disable(),e.off("dragend",this._onMarkerDragEnd,this).off("touchmove",this._onTouchMove,this).off("MSPointerMove",this._onTouchMove,this).off("touchend",this._onMarkerDragEnd,this).off("MSPointerUp",this._onMarkerDragEnd,this)):e.editing.disable()},_onMouseMove:function(t){this._tooltip.updatePosition(t.latlng)},_onMarkerDragEnd:function(t){var e=t.target;e.edited=!0,this._map.fire(L.Draw.Event.EDITMOVE,{layer:e})},_onTouchMove:function(t){var e=t.originalEvent.changedTouches[0],i=this._map.mouseEventToLayerPoint(e),n=this._map.layerPointToLatLng(i);t.target.setLatLng(n)},_hasAvailableLayers:function(){return 0!==this._featureGroup.getLayers().length}}),L.EditToolbar.Delete=L.Handler.extend({statics:{TYPE:"remove"},initialize:function(t,e){if(L.Handler.prototype.initialize.call(this,t),L.Util.setOptions(this,e),this._deletableLayers=this.options.featureGroup,!(this._deletableLayers instanceof L.FeatureGroup))throw new Error("options.featureGroup must be a L.FeatureGroup");this.type=L.EditToolbar.Delete.TYPE;var i=L.version.split(".");1===parseInt(i[0],10)&&2<=parseInt(i[1],10)?L.EditToolbar.Delete.include(L.Evented.prototype):L.EditToolbar.Delete.include(L.Mixin.Events)},enable:function(){!this._enabled&&this._hasAvailableLayers()&&(this.fire("enabled",{handler:this.type}),this._map.fire(L.Draw.Event.DELETESTART,{handler:this.type}),L.Handler.prototype.enable.call(this),this._deletableLayers.on("layeradd",this._enableLayerDelete,this).on("layerremove",this._disableLayerDelete,this))},disable:function(){this._enabled&&(this._deletableLayers.off("layeradd",this._enableLayerDelete,this).off("layerremove",this._disableLayerDelete,this),L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.DELETESTOP,{handler:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var t=this._map;t&&(t.getContainer().focus(),this._deletableLayers.eachLayer(this._enableLayerDelete,this),this._deletedLayers=new L.LayerGroup,this._tooltip=new L.Draw.Tooltip(this._map),this._tooltip.updateContent({text:L.drawLocal.edit.handlers.remove.tooltip.text}),this._map.on("mousemove",this._onMouseMove,this))},removeHooks:function(){this._map&&(this._deletableLayers.eachLayer(this._disableLayerDelete,this),this._deletedLayers=null,this._tooltip.dispose(),this._tooltip=null,this._map.off("mousemove",this._onMouseMove,this))},revertLayers:function(){this._deletedLayers.eachLayer(function(t){this._deletableLayers.addLayer(t),t.fire("revert-deleted",{layer:t})},this)},save:function(){this._map.fire(L.Draw.Event.DELETED,{layers:this._deletedLayers})},removeAllLayers:function(){this._deletableLayers.eachLayer(function(t){this._removeLayer({layer:t})},this),this.save()},_enableLayerDelete:function(t){(t.layer||t.target||t).on("click",this._removeLayer,this)},_disableLayerDelete:function(t){var e=t.layer||t.target||t;e.off("click",this._removeLayer,this),this._deletedLayers.removeLayer(e)},_removeLayer:function(t){var e=t.layer||t.target||t;this._deletableLayers.removeLayer(e),this._deletedLayers.addLayer(e),e.fire("deleted")},_onMouseMove:function(t){this._tooltip.updatePosition(t.latlng)},_hasAvailableLayers:function(){return 0!==this._deletableLayers.getLayers().length}}),L.Control.Draw=L.Control.extend({options:{position:"topleft",draw:{},edit:!1},initialize:function(t){if(L.version<"0.7")throw new Error("Leaflet.draw 0.2.3+ requires Leaflet 0.7.0+. Download latest from https://github.com/Leaflet/Leaflet/");var e;L.Control.prototype.initialize.call(this,t),this._toolbars={},L.DrawToolbar&&this.options.draw&&(e=new L.DrawToolbar(this.options.draw),this._toolbars[L.DrawToolbar.TYPE]=e,this._toolbars[L.DrawToolbar.TYPE].on("enable",this._toolbarEnabled,this)),L.EditToolbar&&this.options.edit&&(e=new L.EditToolbar(this.options.edit),this._toolbars[L.EditToolbar.TYPE]=e,this._toolbars[L.EditToolbar.TYPE].on("enable",this._toolbarEnabled,this)),L.toolbar=this},onAdd:function(t){var e,i=L.DomUtil.create("div","leaflet-draw"),n=!1,o="leaflet-draw-toolbar-top";for(var r in this._toolbars)this._toolbars.hasOwnProperty(r)&&(e=this._toolbars[r].addToolbar(t))&&(n||(L.DomUtil.hasClass(e,o)||L.DomUtil.addClass(e.childNodes[0],o),n=!0),i.appendChild(e));return i},onRemove:function(){for(var t in this._toolbars)this._toolbars.hasOwnProperty(t)&&this._toolbars[t].removeToolbar()},setDrawingOptions:function(t){for(var e in this._toolbars)this._toolbars[e]instanceof L.DrawToolbar&&this._toolbars[e].setOptions(t)},_toolbarEnabled:function(t){var e=t.target;for(var i in this._toolbars)this._toolbars[i]!==e&&this._toolbars[i].disable()}}),L.Map.mergeOptions({drawControlTooltips:!0,drawControl:!1}),L.Map.addInitHook(function(){this.options.drawControl&&(this.drawControl=new L.Control.Draw,this.addControl(this.drawControl))}),L.Edit=L.Edit||{},L.Edit.Poly=L.Handler.extend({initialize:function(t){this.latlngs=[t._latlngs],t._holes&&(this.latlngs=this.latlngs.concat(t._holes)),this._poly=t,this._poly.on("revert-edited",this._updateLatLngs,this)},_defaultShape:function(){return L.Polyline._flat?L.Polyline._flat(this._poly._latlngs)?this._poly._latlngs:this._poly._latlngs[0]:this._poly._latlngs},_eachVertexHandler:function(t){for(var e=0;e<this._verticesHandlers.length;e++)t(this._verticesHandlers[e])},addHooks:function(){this._initHandlers(),this._eachVertexHandler(function(t){t.addHooks()})},removeHooks:function(){this._eachVertexHandler(function(t){t.removeHooks()})},updateMarkers:function(){this._eachVertexHandler(function(t){t.updateMarkers()})},_initHandlers:function(){this._verticesHandlers=[];for(var t=0;t<this.latlngs.length;t++)this._verticesHandlers.push(new L.Edit.PolyVerticesEdit(this._poly,this.latlngs[t],this._poly.options.poly))},_updateLatLngs:function(t){this.latlngs=[t.layer._latlngs],t.layer._holes&&(this.latlngs=this.latlngs.concat(t.layer._holes))}}),L.Edit.PolyVerticesEdit=L.Handler.extend({options:{icon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon"}),touchIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-touch-icon"}),drawError:{color:"#b00b00",timeout:1e3}},initialize:function(t,e,i){L.Browser.touch&&(this.options.icon=this.options.touchIcon),this._poly=t,i&&i.drawError&&(i.drawError=L.Util.extend({},this.options.drawError,i.drawError)),this._latlngs=e,L.setOptions(this,i)},_defaultShape:function(){return L.Polyline._flat?L.Polyline._flat(this._latlngs)?this._latlngs:this._latlngs[0]:this._latlngs},addHooks:function(){var t=this._poly,e=t._path;t instanceof L.Polygon||(t.options.fill=!1,t.options.editing&&(t.options.editing.fill=!1)),e&&t.options.editing.className&&(t.options.original.className&&t.options.original.className.split(" ").forEach(function(t){L.DomUtil.removeClass(e,t)}),t.options.editing.className.split(" ").forEach(function(t){L.DomUtil.addClass(e,t)})),t.setStyle(t.options.editing),this._poly._map&&(this._map=this._poly._map,this._markerGroup||this._initMarkers(),this._poly._map.addLayer(this._markerGroup))},removeHooks:function(){var t=this._poly,e=t._path;e&&t.options.editing.className&&(t.options.editing.className.split(" ").forEach(function(t){L.DomUtil.removeClass(e,t)}),t.options.original.className&&t.options.original.className.split(" ").forEach(function(t){L.DomUtil.addClass(e,t)})),t.setStyle(t.options.original),t._map&&(t._map.removeLayer(this._markerGroup),delete this._markerGroup,delete this._markers)},updateMarkers:function(){this._markerGroup.clearLayers(),this._initMarkers()},_initMarkers:function(){this._markerGroup||(this._markerGroup=new L.LayerGroup),this._markers=[];var t,e,i,n,o,r,a=this._defaultShape();for(t=0,i=a.length;t<i;t++)(n=this._addMarker(a[t],t)).on("click",this._onMarkerClick,this),this._markers.push(n);for(t=0,e=i-1;t<i;e=t++)(0!==t||L.Polygon&&this._poly instanceof L.Polygon)&&(o=this._markers[e],r=this._markers[t],this._createMiddleMarker(o,r),this._updatePrevNext(o,r))},_addMarker:function(t,e){var i=new L.Marker.Touch(t,{draggable:!0,icon:this.options.icon});return i._origLatLng=t,i._index=e,i.on("dragstart",this._onMarkerDragStart,this).on("drag",this._onMarkerDrag,this).on("dragend",this._fireEdit,this).on("touchmove",this._onTouchMove,this).on("touchend",this._fireEdit,this).on("MSPointerMove",this._onTouchMove,this).on("MSPointerUp",this._fireEdit,this),this._markerGroup.addLayer(i),i},_onMarkerDragStart:function(){this._poly.fire("editstart")},_spliceLatLngs:function(){var t=this._defaultShape(),e=[].splice.apply(t,arguments);return this._poly._convertLatLngs(t,!0),this._poly.redraw(),e},_removeMarker:function(t){var e=t._index;this._markerGroup.removeLayer(t),this._markers.splice(e,1),this._spliceLatLngs(e,1),this._updateIndexes(e,-1),t.off("dragstart",this._onMarkerDragStart,this).off("drag",this._onMarkerDrag,this).off("dragend",this._fireEdit,this).off("touchmove",this._onMarkerDrag,this).off("touchend",this._fireEdit,this).off("click",this._onMarkerClick,this).off("MSPointerMove",this._onTouchMove,this).off("MSPointerUp",this._fireEdit,this)},_fireEdit:function(){this._poly.edited=!0,this._poly.fire("edit"),this._poly._map.fire(L.Draw.Event.EDITVERTEX,{layers:this._markerGroup,poly:this._poly})},_onMarkerDrag:function(t){var e=t.target,i=this._poly;if(L.extend(e._origLatLng,e._latlng),e._middleLeft&&e._middleLeft.setLatLng(this._getMiddleLatLng(e._prev,e)),e._middleRight&&e._middleRight.setLatLng(this._getMiddleLatLng(e,e._next)),i.options.poly){var n=i._map._editTooltip;if(!i.options.poly.allowIntersection&&i.intersects()){var o=i.options.color;i.setStyle({color:this.options.drawError.color}),0!==L.version.indexOf("0.7")&&e.dragging._draggable._onUp(t),this._onMarkerClick(t),n&&n.updateContent({text:L.drawLocal.draw.handlers.polyline.error}),setTimeout(function(){i.setStyle({color:o}),n&&n.updateContent({text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext})},1e3)}}this._poly.redraw(),this._poly.fire("editdrag")},_onMarkerClick:function(t){var e=L.Polygon&&this._poly instanceof L.Polygon?4:3,i=t.target;this._defaultShape().length<e||(this._removeMarker(i),this._updatePrevNext(i._prev,i._next),i._middleLeft&&this._markerGroup.removeLayer(i._middleLeft),i._middleRight&&this._markerGroup.removeLayer(i._middleRight),i._prev&&i._next?this._createMiddleMarker(i._prev,i._next):i._prev?i._next||(i._prev._middleRight=null):i._next._middleLeft=null,this._fireEdit())},_onTouchMove:function(t){var e=this._map.mouseEventToLayerPoint(t.originalEvent.touches[0]),i=this._map.layerPointToLatLng(e),n=t.target;L.extend(n._origLatLng,i),n._middleLeft&&n._middleLeft.setLatLng(this._getMiddleLatLng(n._prev,n)),n._middleRight&&n._middleRight.setLatLng(this._getMiddleLatLng(n,n._next)),this._poly.redraw(),this.updateMarkers()},_updateIndexes:function(e,i){this._markerGroup.eachLayer(function(t){t._index>e&&(t._index+=i)})},_createMiddleMarker:function(e,i){var n,o,t,r=this._getMiddleLatLng(e,i),a=this._addMarker(r);a.setOpacity(.6),e._middleRight=i._middleLeft=a,o=function(){a.off("touchmove",o,this);var t=i._index;a._index=t,a.off("click",n,this).on("click",this._onMarkerClick,this),r.lat=a.getLatLng().lat,r.lng=a.getLatLng().lng,this._spliceLatLngs(t,0,r),this._markers.splice(t,0,a),a.setOpacity(1),this._updateIndexes(t,1),i._index++,this._updatePrevNext(e,a),this._updatePrevNext(a,i),this._poly.fire("editstart")},t=function(){a.off("dragstart",o,this),a.off("dragend",t,this),a.off("touchmove",o,this),this._createMiddleMarker(e,a),this._createMiddleMarker(a,i)},n=function(){o.call(this),t.call(this),this._fireEdit()},a.on("click",n,this).on("dragstart",o,this).on("dragend",t,this).on("touchmove",o,this),this._markerGroup.addLayer(a)},_updatePrevNext:function(t,e){t&&(t._next=e),e&&(e._prev=t)},_getMiddleLatLng:function(t,e){var i=this._poly._map,n=i.project(t.getLatLng()),o=i.project(e.getLatLng());return i.unproject(n._add(o)._divideBy(2))}}),L.Polyline.addInitHook(function(){this.editing||(L.Edit.Poly&&(this.editing=new L.Edit.Poly(this),this.options.editable&&this.editing.enable()),this.on("add",function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()}),this.on("remove",function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()}))}),L.Edit=L.Edit||{},L.Edit.SimpleShape=L.Handler.extend({options:{moveIcon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-move"}),resizeIcon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-resize"}),touchMoveIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-move leaflet-touch-icon"}),touchResizeIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-resize leaflet-touch-icon"})},initialize:function(t,e){L.Browser.touch&&(this.options.moveIcon=this.options.touchMoveIcon,this.options.resizeIcon=this.options.touchResizeIcon),this._shape=t,L.Util.setOptions(this,e)},addHooks:function(){var t=this._shape;this._shape._map&&(this._map=this._shape._map,t.setStyle(t.options.editing),t._map&&(this._map=t._map,this._markerGroup||this._initMarkers(),this._map.addLayer(this._markerGroup)))},removeHooks:function(){var t=this._shape;if(t.setStyle(t.options.original),t._map){this._unbindMarker(this._moveMarker);for(var e=0,i=this._resizeMarkers.length;e<i;e++)this._unbindMarker(this._resizeMarkers[e]);this._resizeMarkers=null,this._map.removeLayer(this._markerGroup),delete this._markerGroup}this._map=null},updateMarkers:function(){this._markerGroup.clearLayers(),this._initMarkers()},_initMarkers:function(){this._markerGroup||(this._markerGroup=new L.LayerGroup),this._createMoveMarker(),this._createResizeMarker()},_createMoveMarker:function(){},_createResizeMarker:function(){},_addMarker:function(t,e){var i=new L.Marker.Touch(t,{draggable:!0,icon:e,zIndexOffset:10});return this._bindMarker(i),this._markerGroup.addLayer(i),i},_bindMarker:function(t){t.on("dragstart",this._onMarkerDragStart,this).on("drag",this._onMarkerDrag,this).on("dragend",this._onMarkerDragEnd,this).on("touchstart",this._onTouchStart,this).on("touchmove",this._onTouchMove,this).on("MSPointerMove",this._onTouchMove,this).on("touchend",this._onTouchEnd,this).on("MSPointerUp",this._onTouchEnd,this)},_unbindMarker:function(t){t.off("dragstart",this._onMarkerDragStart,this).off("drag",this._onMarkerDrag,this).off("dragend",this._onMarkerDragEnd,this).off("touchstart",this._onTouchStart,this).off("touchmove",this._onTouchMove,this).off("MSPointerMove",this._onTouchMove,this).off("touchend",this._onTouchEnd,this).off("MSPointerUp",this._onTouchEnd,this)},_onMarkerDragStart:function(t){t.target.setOpacity(0),this._shape.fire("editstart")},_fireEdit:function(){this._shape.edited=!0,this._shape.fire("edit")},_onMarkerDrag:function(t){var e=t.target,i=e.getLatLng();e===this._moveMarker?this._move(i):this._resize(i),this._shape.redraw(),this._shape.fire("editdrag")},_onMarkerDragEnd:function(t){t.target.setOpacity(1),this._fireEdit()},_onTouchStart:function(t){if(L.Edit.SimpleShape.prototype._onMarkerDragStart.call(this,t),"function"==typeof this._getCorners){var e=this._getCorners(),i=t.target,n=i._cornerIndex;i.setOpacity(0),this._oppositeCorner=e[(n+2)%4],this._toggleCornerMarkers(0,n)}this._shape.fire("editstart")},_onTouchMove:function(t){var e=this._map.mouseEventToLayerPoint(t.originalEvent.touches[0]),i=this._map.layerPointToLatLng(e);return t.target===this._moveMarker?this._move(i):this._resize(i),this._shape.redraw(),!1},_onTouchEnd:function(t){t.target.setOpacity(1),this.updateMarkers(),this._fireEdit()},_move:function(){},_resize:function(){}}),L.Edit=L.Edit||{},L.Edit.Rectangle=L.Edit.SimpleShape.extend({_createMoveMarker:function(){var t=this._shape.getBounds().getCenter();this._moveMarker=this._addMarker(t,this.options.moveIcon)},_createResizeMarker:function(){var t=this._getCorners();this._resizeMarkers=[];for(var e=0,i=t.length;e<i;e++)this._resizeMarkers.push(this._addMarker(t[e],this.options.resizeIcon)),this._resizeMarkers[e]._cornerIndex=e},_onMarkerDragStart:function(t){L.Edit.SimpleShape.prototype._onMarkerDragStart.call(this,t);var e=this._getCorners(),i=t.target._cornerIndex;this._oppositeCorner=e[(i+2)%4],this._toggleCornerMarkers(0,i)},_onMarkerDragEnd:function(t){var e,i=t.target;i===this._moveMarker&&(e=this._shape.getBounds().getCenter(),i.setLatLng(e)),this._toggleCornerMarkers(1),this._repositionCornerMarkers(),L.Edit.SimpleShape.prototype._onMarkerDragEnd.call(this,t)},_move:function(t){for(var e,i=this._shape._defaultShape?this._shape._defaultShape():this._shape.getLatLngs(),n=this._shape.getBounds().getCenter(),o=[],r=0,a=i.length;r<a;r++)e=[i[r].lat-n.lat,i[r].lng-n.lng],o.push([t.lat+e[0],t.lng+e[1]]);this._shape.setLatLngs(o),this._repositionCornerMarkers(),this._map.fire(L.Draw.Event.EDITMOVE,{layer:this._shape})},_resize:function(t){var e;this._shape.setBounds(L.latLngBounds(t,this._oppositeCorner)),e=this._shape.getBounds(),this._moveMarker.setLatLng(e.getCenter()),this._map.fire(L.Draw.Event.EDITRESIZE,{layer:this._shape})},_getCorners:function(){var t=this._shape.getBounds();return[t.getNorthWest(),t.getNorthEast(),t.getSouthEast(),t.getSouthWest()]},_toggleCornerMarkers:function(t){for(var e=0,i=this._resizeMarkers.length;e<i;e++)this._resizeMarkers[e].setOpacity(t)},_repositionCornerMarkers:function(){for(var t=this._getCorners(),e=0,i=this._resizeMarkers.length;e<i;e++)this._resizeMarkers[e].setLatLng(t[e])}}),L.Rectangle.addInitHook(function(){L.Edit.Rectangle&&(this.editing=new L.Edit.Rectangle(this),this.options.editable&&this.editing.enable())}),L.Edit=L.Edit||{},L.Edit.Marker=L.Handler.extend({initialize:function(t,e){this._marker=t,L.setOptions(this,e)},addHooks:function(){var t=this._marker;t.dragging.enable(),t.on("dragend",this._onDragEnd,t),this._toggleMarkerHighlight()},removeHooks:function(){var t=this._marker;t.dragging.disable(),t.off("dragend",this._onDragEnd,t),this._toggleMarkerHighlight()},_onDragEnd:function(t){var e=t.target;e.edited=!0,this._map.fire(L.Draw.Event.EDITMOVE,{layer:e})},_toggleMarkerHighlight:function(){var t=this._marker._icon;t&&(t.style.display="none",L.DomUtil.hasClass(t,"leaflet-edit-marker-selected")?(L.DomUtil.removeClass(t,"leaflet-edit-marker-selected"),this._offsetMarker(t,-4)):(L.DomUtil.addClass(t,"leaflet-edit-marker-selected"),this._offsetMarker(t,4)),t.style.display="")},_offsetMarker:function(t,e){var i=parseInt(t.style.marginTop,10)-e,n=parseInt(t.style.marginLeft,10)-e;t.style.marginTop=i+"px",t.style.marginLeft=n+"px"}}),L.Marker.addInitHook(function(){L.Edit.Marker&&(this.editing=new L.Edit.Marker(this),this.options.editable&&this.editing.enable())}),L.Edit=L.Edit||{},L.Edit.CircleMarker=L.Edit.SimpleShape.extend({_createMoveMarker:function(){var t=this._shape.getLatLng();this._moveMarker=this._addMarker(t,this.options.moveIcon)},_createResizeMarker:function(){this._resizeMarkers=[]},_move:function(t){if(this._resizeMarkers.length){var e=this._getResizeMarkerPoint(t);this._resizeMarkers[0].setLatLng(e)}this._shape.setLatLng(t),this._map.fire(L.Draw.Event.EDITMOVE,{layer:this._shape})}}),L.CircleMarker.addInitHook(function(){L.Edit.CircleMarker&&(this.editing=new L.Edit.CircleMarker(this),this.options.editable&&this.editing.enable()),this.on("add",function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()}),this.on("remove",function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()})}),L.Edit=L.Edit||{},L.Edit.Circle=L.Edit.CircleMarker.extend({_createResizeMarker:function(){var t=this._shape.getLatLng(),e=this._getResizeMarkerPoint(t);this._resizeMarkers=[],this._resizeMarkers.push(this._addMarker(e,this.options.resizeIcon))},_getResizeMarkerPoint:function(t){var e=this._shape._radius*Math.cos(Math.PI/4),i=this._map.project(t);return this._map.unproject([i.x+e,i.y-e])},_resize:function(t){var e=this._moveMarker.getLatLng();L.GeometryUtil.isVersion07x()?radius=e.distanceTo(t):radius=this._map.distance(e,t),this._map.fire(L.Draw.Event.EDITRESIZE,{layer:this._shape})}}),L.Circle.addInitHook(function(){L.Edit.Circle&&(this.editing=new L.Edit.Circle(this),this.options.editable&&this.editing.enable()),this.on("add",function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()}),this.on("remove",function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()})}),function(){"use strict";L.Marker.Measurement=L[L.Layer?"Layer":"Class"].extend({options:{pane:"markerPane"},initialize:function(t,e,i,n,o){L.setOptions(this,o),this._latlng=t,this._measurement=e,this._title=i,this._rotation=n},addTo:function(t){return t.addLayer(this),this},onAdd:function(t){this._map=t;var e=this.getPane?this.getPane():t.getPanes().markerPane,i=this._element=L.DomUtil.create("div","leaflet-zoom-animated leaflet-measure-path-measurement",e),n=L.DomUtil.create("div","",i);n.title=this._title,n.innerHTML=this._measurement,t.on("zoomanim",this._animateZoom,this),this._setPosition()},onRemove:function(t){t.off("zoomanim",this._animateZoom,this),(this.getPane?this.getPane():t.getPanes().markerPane).removeChild(this._element),this._map=null},_setPosition:function(){L.DomUtil.setPosition(this._element,this._map.latLngToLayerPoint(this._latlng)),this._element.style.transform+=" rotate("+this._rotation+"rad)"},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();L.DomUtil.setPosition(this._element,e),this._element.style.transform+=" rotate("+this._rotation+"rad)"}}),L.marker.measurement=function(t,e,i,n,o){return new L.Marker.Measurement(t,e,i,n,o)};function t(t){var e;return e=this._measurementOptions.imperial?404.685642<t?(t/=4046.85642,"ac"):(t/=.09290304,"ft²"):1e6<t?(t/=1e6,"km²"):"m²",t<100?t.toFixed(1)+" "+e:Math.round(t)+" "+e}function e(t,e,i){return i?function(){return e.apply(this,arguments),t.apply(this,arguments)}:function(){return t.apply(this,arguments),e.apply(this,arguments)}}var d=6378137;L.Polyline.include({showMeasurements:function(t){return!this._map||this._measurementLayer||(this._measurementOptions=L.extend({showOnHover:!1,minPixelDistance:30,showDistances:!0,showArea:!0,lang:{totalLength:"Total length",totalArea:"Total area",segmentLength:"Segment length"}},t||{}),this._measurementLayer=L.layerGroup().addTo(this._map),this.updateMeasurements(),this._map.on("zoomend",this.updateMeasurements,this)),this},hideMeasurements:function(){return this._map.off("zoomend",this.updateMeasurements,this),this._measurementLayer&&(this._map.removeLayer(this._measurementLayer),this._measurementLayer=null),this},onAdd:e(L.Polyline.prototype.onAdd,function(){this.options.showMeasurements&&this.showMeasurements(this.options.measurementOptions)}),onRemove:e(L.Polyline.prototype.onRemove,function(){this.hideMeasurements()},!0),setLatLngs:e(L.Polyline.prototype.setLatLngs,function(){return this.updateMeasurements()}),spliceLatLngs:e(L.Polyline.prototype.spliceLatLngs,function(){return this.updateMeasurements()}),formatDistance:function(t){var e,i;return e=this._measurementOptions.imperial?3e3<(i=t/.3048)?(t/=1609.344,"mi"):(t=i,"ft"):1e3<t?(t/=1e3,"km"):"m",t<100?t.toFixed(1)+" "+e:Math.round(t)+" "+e},formatArea:t,updateMeasurements:function(){if(!this._measurementLayer)return this;var t,e,i,n,o,r,a=this.getLatLngs(),s=this instanceof L.Polygon,l=this._measurementOptions,u=0;if(a&&a.length&&L.Util.isArray(a[0])&&(a=a[0]),this._measurementLayer.clearLayers(),this._measurementOptions.showDistances&&1<a.length){t=this._measurementOptions.formatDistance||L.bind(this.formatDistance,this);for(var c=1,h=a.length;s&&c<=h||c<h;c++)e=a[c-1],i=a[c%h],u+=r=e.distanceTo(i),n=this._map.latLngToLayerPoint(e),o=this._map.latLngToLayerPoint(i),n.distanceTo(o)>=l.minPixelDistance&&L.marker.measurement(this._map.layerPointToLatLng([(n.x+o.x)/2,(n.y+o.y)/2]),t(r),l.lang.segmentLength,this._getRotation(e,i),l).addTo(this._measurementLayer);s||L.marker.measurement(i,t(u),l.lang.totalLength,0,l).addTo(this._measurementLayer)}if(s&&l.showArea&&2<a.length){t=l.formatArea||L.bind(this.formatArea,this);var p=function(t){function e(t){return t*Math.PI/180}var i,n,o,r,a,s=0,l=t.length;if(2<l){for(var u=0;u<l;u++)a=u===l-2?(o=l-2,r=l-1,0):u===l-1?(o=l-1,r=0,1):(r=(o=u)+1,u+2),i=t[o],n=t[r],s+=(e(t[a].lng)-e(i.lng))*Math.sin(e(n.lat));s=s*d*d/2}return Math.abs(s)}(a);L.marker.measurement(this.getBounds().getCenter(),t(p),l.lang.totalArea,0,l).addTo(this._measurementLayer)}return this},_getRotation:function(t,e){var i=this._map.project(t),n=this._map.project(e);return Math.atan((n.y-i.y)/(n.x-i.x))}}),L.Polyline.addInitHook(function(){this.options.showMeasurements&&this.showMeasurements()}),L.Circle.include({showMeasurements:function(t){return!this._map||this._measurementLayer||(this._measurementOptions=L.extend({showOnHover:!1,showArea:!0,lang:{totalArea:"Total area"}},t||{}),this._measurementLayer=L.layerGroup().addTo(this._map),this.updateMeasurements(),this._map.on("zoomend",this.updateMeasurements,this)),this},hideMeasurements:function(){return this._map.on("zoomend",this.updateMeasurements,this),this._measurementLayer&&(this._map.removeLayer(this._measurementLayer),this._measurementLayer=null),this},onAdd:e(L.Circle.prototype.onAdd,function(){this.options.showMeasurements&&this.showMeasurements(this.options.measurementOptions)}),onRemove:e(L.Circle.prototype.onRemove,function(){this.hideMeasurements()},!0),setLatLng:e(L.Circle.prototype.setLatLng,function(){this.updateMeasurements()}),setRadius:e(L.Circle.prototype.setRadius,function(){this.updateMeasurements()}),formatArea:t,updateMeasurements:function(){if(this._measurementLayer){var t=this.getLatLng(),e=this._measurementOptions,i=e.formatArea||L.bind(this.formatArea,this);if(this._measurementLayer.clearLayers(),e.showArea){i=e.formatArea||L.bind(this.formatArea,this);var n=function(t){var e=t/d;return 2*Math.PI*d*d*(1-Math.cos(e))}(this.getRadius());L.marker.measurement(t,i(n),e.lang.totalArea,0,e).addTo(this._measurementLayer)}}}}),L.Circle.addInitHook(function(){this.options.showMeasurements&&this.showMeasurements()})}(),function(t,e){L.MarkerClusterGroup=L.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,clusterPane:L.Marker.prototype.options.pane,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,removeOutsideVisibleBounds:!0,animate:!0,animateAddingMarkers:!1,spiderfyDistanceMultiplier:1,spiderLegPolylineOptions:{weight:1.5,color:"#222",opacity:.5},chunkedLoading:!1,chunkInterval:200,chunkDelay:50,chunkProgress:null,polygonOptions:{}},initialize:function(t){L.Util.setOptions(this,t),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),this._featureGroup=L.featureGroup(),this._featureGroup.addEventParent(this),this._nonPointGroup=L.featureGroup(),this._nonPointGroup.addEventParent(this),this._inZoomAnimation=0,this._needsClustering=[],this._needsRemoving=[],this._currentShownBounds=null,this._queue=[],this._childMarkerEventHandlers={dragstart:this._childMarkerDragStart,move:this._childMarkerMoved,dragend:this._childMarkerDragEnd};var e=L.DomUtil.TRANSITION&&this.options.animate;L.extend(this,e?this._withAnimation:this._noAnimation),this._markerCluster=e?L.MarkerCluster:L.MarkerClusterNonAnimated},addLayer:function(t){if(t instanceof L.LayerGroup)return this.addLayers([t]);if(!t.getLatLng)return this._nonPointGroup.addLayer(t),this.fire("layeradd",{layer:t}),this;if(!this._map)return this._needsClustering.push(t),this.fire("layeradd",{layer:t}),this;if(this.hasLayer(t))return this;this._unspiderfy&&this._unspiderfy(),this._addLayer(t,this._maxZoom),this.fire("layeradd",{layer:t}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons();var e=t,i=this._zoom;if(t.__parent)for(;e.__parent._zoom>=i;)e=e.__parent;return this._currentShownBounds.contains(e.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(t,e):this._animationAddLayerNonAnimated(t,e)),this},removeLayer:function(t){return t instanceof L.LayerGroup?this.removeLayers([t]):(t.getLatLng?this._map?t.__parent&&(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(t)),this._removeLayer(t,!0),this.fire("layerremove",{layer:t}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),t.off(this._childMarkerEventHandlers,this),this._featureGroup.hasLayer(t)&&(this._featureGroup.removeLayer(t),t.clusterShow&&t.clusterShow())):(!this._arraySplice(this._needsClustering,t)&&this.hasLayer(t)&&this._needsRemoving.push({layer:t,latlng:t._latlng}),this.fire("layerremove",{layer:t})):(this._nonPointGroup.removeLayer(t),this.fire("layerremove",{layer:t})),this)},addLayers:function(o,r){if(!L.Util.isArray(o))return this.addLayer(o);var a,s=this._featureGroup,l=this._nonPointGroup,u=this.options.chunkedLoading,c=this.options.chunkInterval,h=this.options.chunkProgress,p=o.length,d=0,f=!0;if(this._map){var m=(new Date).getTime(),_=L.bind(function(){for(var t=(new Date).getTime();d<p;d++){if(u&&0==d%200){var e=(new Date).getTime()-t;if(c<e)break}if((a=o[d])instanceof L.LayerGroup)f&&(o=o.slice(),f=!1),this._extractNonGroupLayers(a,o),p=o.length;else if(a.getLatLng){if(!this.hasLayer(a)&&(this._addLayer(a,this._maxZoom),r||this.fire("layeradd",{layer:a}),a.__parent&&2===a.__parent.getChildCount())){var i=a.__parent.getAllChildMarkers(),n=i[0]===a?i[1]:i[0];s.removeLayer(n)}}else l.addLayer(a),r||this.fire("layeradd",{layer:a})}h&&h(d,p,(new Date).getTime()-m),d===p?(this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds)):setTimeout(_,this.options.chunkDelay)},this);_()}else for(var t=this._needsClustering;d<p;d++)(a=o[d])instanceof L.LayerGroup?(f&&(o=o.slice(),f=!1),this._extractNonGroupLayers(a,o),p=o.length):a.getLatLng?this.hasLayer(a)||t.push(a):l.addLayer(a);return this},removeLayers:function(t){var e,i,n=t.length,o=this._featureGroup,r=this._nonPointGroup,a=!0;if(!this._map){for(e=0;e<n;e++)(i=t[e])instanceof L.LayerGroup?(a&&(t=t.slice(),a=!1),this._extractNonGroupLayers(i,t),n=t.length):(this._arraySplice(this._needsClustering,i),r.removeLayer(i),this.hasLayer(i)&&this._needsRemoving.push({layer:i,latlng:i._latlng}),this.fire("layerremove",{layer:i}));return this}if(this._unspiderfy){this._unspiderfy();var s=t.slice(),l=n;for(e=0;e<l;e++)(i=s[e])instanceof L.LayerGroup?(this._extractNonGroupLayers(i,s),l=s.length):this._unspiderfyLayer(i)}for(e=0;e<n;e++)(i=t[e])instanceof L.LayerGroup?(a&&(t=t.slice(),a=!1),this._extractNonGroupLayers(i,t),n=t.length):i.__parent?(this._removeLayer(i,!0,!0),this.fire("layerremove",{layer:i}),o.hasLayer(i)&&(o.removeLayer(i),i.clusterShow&&i.clusterShow())):(r.removeLayer(i),this.fire("layerremove",{layer:i}));return this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds),this},clearLayers:function(){return this._map||(this._needsClustering=[],delete this._gridClusters,delete this._gridUnclustered),this._noanimationUnspiderfy&&this._noanimationUnspiderfy(),this._featureGroup.clearLayers(),this._nonPointGroup.clearLayers(),this.eachLayer(function(t){t.off(this._childMarkerEventHandlers,this),delete t.__parent},this),this._map&&this._generateInitialClusters(),this},getBounds:function(){var t=new L.LatLngBounds;this._topClusterLevel&&t.extend(this._topClusterLevel._bounds);for(var e=this._needsClustering.length-1;0<=e;e--)t.extend(this._needsClustering[e].getLatLng());return t.extend(this._nonPointGroup.getBounds()),t},eachLayer:function(t,e){var i,n,o,r=this._needsClustering.slice(),a=this._needsRemoving;for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(r),n=r.length-1;0<=n;n--){for(i=!0,o=a.length-1;0<=o;o--)if(a[o].layer===r[n]){i=!1;break}i&&t.call(e,r[n])}this._nonPointGroup.eachLayer(t,e)},getLayers:function(){var e=[];return this.eachLayer(function(t){e.push(t)}),e},getLayer:function(e){var i=null;return e=parseInt(e,10),this.eachLayer(function(t){L.stamp(t)===e&&(i=t)}),i},hasLayer:function(t){if(!t)return!1;var e,i=this._needsClustering;for(e=i.length-1;0<=e;e--)if(i[e]===t)return!0;for(e=(i=this._needsRemoving).length-1;0<=e;e--)if(i[e].layer===t)return!1;return!(!t.__parent||t.__parent._group!==this)||this._nonPointGroup.hasLayer(t)},zoomToShowLayer:function(t,e){"function"!=typeof e&&(e=function(){});var i=function(){!t._icon&&!t.__parent._icon||this._inZoomAnimation||(this._map.off("moveend",i,this),this.off("animationend",i,this),t._icon?e():t.__parent._icon&&(this.once("spiderfied",e,this),t.__parent.spiderfy()))};t._icon&&this._map.getBounds().contains(t.getLatLng())?e():t.__parent._zoom<Math.round(this._map._zoom)?(this._map.on("moveend",i,this),this._map.panTo(t.getLatLng())):(this._map.on("moveend",i,this),this.on("animationend",i,this),t.__parent.zoomToBounds())},onAdd:function(t){var e,i,n;if(this._map=t,!isFinite(this._map.getMaxZoom()))throw"Map has no maxZoom specified";for(this._featureGroup.addTo(t),this._nonPointGroup.addTo(t),this._gridClusters||this._generateInitialClusters(),this._maxLat=t.options.crs.projection.MAX_LATITUDE,e=0,i=this._needsRemoving.length;e<i;e++)(n=this._needsRemoving[e]).newlatlng=n.layer._latlng,n.layer._latlng=n.latlng;for(e=0,i=this._needsRemoving.length;e<i;e++)n=this._needsRemoving[e],this._removeLayer(n.layer,!0),n.layer._latlng=n.newlatlng;this._needsRemoving=[],this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds(),this._map.on("zoomend",this._zoomEnd,this),this._map.on("moveend",this._moveEnd,this),this._spiderfierOnAdd&&this._spiderfierOnAdd(),this._bindEvents(),i=this._needsClustering,this._needsClustering=[],this.addLayers(i,!0)},onRemove:function(t){t.off("zoomend",this._zoomEnd,this),t.off("moveend",this._moveEnd,this),this._unbindEvents(),this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim",""),this._spiderfierOnRemove&&this._spiderfierOnRemove(),delete this._maxLat,this._hideCoverage(),this._featureGroup.remove(),this._nonPointGroup.remove(),this._featureGroup.clearLayers(),this._map=null},getVisibleParent:function(t){for(var e=t;e&&!e._icon;)e=e.__parent;return e||null},_arraySplice:function(t,e){for(var i=t.length-1;0<=i;i--)if(t[i]===e)return t.splice(i,1),!0},_removeFromGridUnclustered:function(t,e){for(var i=this._map,n=this._gridUnclustered,o=Math.floor(this._map.getMinZoom());o<=e&&n[e].removeObject(t,i.project(t.getLatLng(),e));e--);},_childMarkerDragStart:function(t){t.target.__dragStart=t.target._latlng},_childMarkerMoved:function(t){if(!this._ignoreMove&&!t.target.__dragStart){var e=t.target._popup&&t.target._popup.isOpen();this._moveChild(t.target,t.oldLatLng,t.latlng),e&&t.target.openPopup()}},_moveChild:function(t,e,i){t._latlng=e,this.removeLayer(t),t._latlng=i,this.addLayer(t)},_childMarkerDragEnd:function(t){t.target.__dragStart&&this._moveChild(t.target,t.target.__dragStart,t.target._latlng),delete t.target.__dragStart},_removeLayer:function(t,e,i){var n=this._gridClusters,o=this._gridUnclustered,r=this._featureGroup,a=this._map,s=Math.floor(this._map.getMinZoom());e&&this._removeFromGridUnclustered(t,this._maxZoom);var l,u=t.__parent,c=u._markers;for(this._arraySplice(c,t);u&&(u._childCount--,u._boundsNeedUpdate=!0,!(u._zoom<s));)e&&u._childCount<=1?(l=u._markers[0]===t?u._markers[1]:u._markers[0],n[u._zoom].removeObject(u,a.project(u._cLatLng,u._zoom)),o[u._zoom].addObject(l,a.project(l.getLatLng(),u._zoom)),this._arraySplice(u.__parent._childClusters,u),u.__parent._markers.push(l),l.__parent=u.__parent,u._icon&&(r.removeLayer(u),i||r.addLayer(l))):u._iconNeedsUpdate=!0,u=u.__parent;delete t.__parent},_isOrIsParent:function(t,e){for(;e;){if(t===e)return!0;e=e.parentNode}return!1},fire:function(t,e,i){if(e&&e.layer instanceof L.MarkerCluster){if(e.originalEvent&&this._isOrIsParent(e.layer._icon,e.originalEvent.relatedTarget))return;t="cluster"+t}L.FeatureGroup.prototype.fire.call(this,t,e,i)},listens:function(t,e){return L.FeatureGroup.prototype.listens.call(this,t,e)||L.FeatureGroup.prototype.listens.call(this,"cluster"+t,e)},_defaultIconCreateFunction:function(t){var e=t.getChildCount(),i=" marker-cluster-";return i+=e<10?"small":e<100?"medium":"large",new L.DivIcon({html:"<div><span>"+e+"</span></div>",className:"marker-cluster"+i,iconSize:new L.Point(40,40)})},_bindEvents:function(){var t=this._map,e=this.options.spiderfyOnMaxZoom,i=this.options.showCoverageOnHover,n=this.options.zoomToBoundsOnClick;(e||n)&&this.on("clusterclick",this._zoomOrSpiderfy,this),i&&(this.on("clustermouseover",this._showCoverage,this),this.on("clustermouseout",this._hideCoverage,this),t.on("zoomend",this._hideCoverage,this))},_zoomOrSpiderfy:function(t){for(var e=t.layer,i=e;1===i._childClusters.length;)i=i._childClusters[0];i._zoom===this._maxZoom&&i._childCount===e._childCount&&this.options.spiderfyOnMaxZoom?e.spiderfy():this.options.zoomToBoundsOnClick&&e.zoomToBounds(),t.originalEvent&&13===t.originalEvent.keyCode&&this._map._container.focus()},_showCoverage:function(t){var e=this._map;this._inZoomAnimation||(this._shownPolygon&&e.removeLayer(this._shownPolygon),2<t.layer.getChildCount()&&t.layer!==this._spiderfied&&(this._shownPolygon=new L.Polygon(t.layer.getConvexHull(),this.options.polygonOptions),e.addLayer(this._shownPolygon)))},_hideCoverage:function(){this._shownPolygon&&(this._map.removeLayer(this._shownPolygon),this._shownPolygon=null)},_unbindEvents:function(){var t=this.options.spiderfyOnMaxZoom,e=this.options.showCoverageOnHover,i=this.options.zoomToBoundsOnClick,n=this._map;(t||i)&&this.off("clusterclick",this._zoomOrSpiderfy,this),e&&(this.off("clustermouseover",this._showCoverage,this),this.off("clustermouseout",this._hideCoverage,this),n.off("zoomend",this._hideCoverage,this))},_zoomEnd:function(){this._map&&(this._mergeSplitClusters(),this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds())},_moveEnd:function(){if(!this._inZoomAnimation){var t=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,t),this._topClusterLevel._recursivelyAddChildrenToMap(null,Math.round(this._map._zoom),t),this._currentShownBounds=t}},_generateInitialClusters:function(){var t=Math.ceil(this._map.getMaxZoom()),e=Math.floor(this._map.getMinZoom()),i=this.options.maxClusterRadius,n=i;"function"!=typeof i&&(n=function(){return i}),null!==this.options.disableClusteringAtZoom&&(t=this.options.disableClusteringAtZoom-1),this._maxZoom=t,this._gridClusters={},this._gridUnclustered={};for(var o=t;e<=o;o--)this._gridClusters[o]=new L.DistanceGrid(n(o)),this._gridUnclustered[o]=new L.DistanceGrid(n(o));this._topClusterLevel=new this._markerCluster(this,e-1)},_addLayer:function(t,e){var i,n,o=this._gridClusters,r=this._gridUnclustered,a=Math.floor(this._map.getMinZoom());for(this.options.singleMarkerMode&&this._overrideMarkerIcon(t),t.on(this._childMarkerEventHandlers,this);a<=e;e--){i=this._map.project(t.getLatLng(),e);var s=o[e].getNearObject(i);if(s)return s._addChild(t),void(t.__parent=s);if(s=r[e].getNearObject(i)){var l=s.__parent;l&&this._removeLayer(s,!1);var u=new this._markerCluster(this,e,s,t);o[e].addObject(u,this._map.project(u._cLatLng,e)),s.__parent=u;var c=t.__parent=u;for(n=e-1;n>l._zoom;n--)c=new this._markerCluster(this,n,c),o[n].addObject(c,this._map.project(s.getLatLng(),n));return l._addChild(c),void this._removeFromGridUnclustered(s,e)}r[e].addObject(t,i)}this._topClusterLevel._addChild(t),t.__parent=this._topClusterLevel},_refreshClustersIcons:function(){this._featureGroup.eachLayer(function(t){t instanceof L.MarkerCluster&&t._iconNeedsUpdate&&t._updateIcon()})},_enqueue:function(t){this._queue.push(t),this._queueTimeout||(this._queueTimeout=setTimeout(L.bind(this._processQueue,this),300))},_processQueue:function(){for(var t=0;t<this._queue.length;t++)this._queue[t].call(this);this._queue.length=0,clearTimeout(this._queueTimeout),this._queueTimeout=null},_mergeSplitClusters:function(){var t=Math.round(this._map._zoom);this._processQueue(),this._zoom<t&&this._currentShownBounds.intersects(this._getExpandedVisibleBounds())?(this._animationStart(),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,this._getExpandedVisibleBounds()),this._animationZoomIn(this._zoom,t)):this._zoom>t?(this._animationStart(),this._animationZoomOut(this._zoom,t)):this._moveEnd()},_getExpandedVisibleBounds:function(){return this.options.removeOutsideVisibleBounds?L.Browser.mobile?this._checkBoundsMaxLat(this._map.getBounds()):this._checkBoundsMaxLat(this._map.getBounds().pad(1)):this._mapBoundsInfinite},_checkBoundsMaxLat:function(t){var e=this._maxLat;return void 0!==e&&(t.getNorth()>=e&&(t._northEast.lat=1/0),t.getSouth()<=-e&&(t._southWest.lat=-1/0)),t},_animationAddLayerNonAnimated:function(t,e){if(e===t)this._featureGroup.addLayer(t);else if(2===e._childCount){e._addToMap();var i=e.getAllChildMarkers();this._featureGroup.removeLayer(i[0]),this._featureGroup.removeLayer(i[1])}else e._updateIcon()},_extractNonGroupLayers:function(t,e){var i,n=t.getLayers(),o=0;for(e=e||[];o<n.length;o++)(i=n[o])instanceof L.LayerGroup?this._extractNonGroupLayers(i,e):e.push(i);return e},_overrideMarkerIcon:function(t){return t.options.icon=this.options.iconCreateFunction({getChildCount:function(){return 1},getAllChildMarkers:function(){return[t]}})}}),L.MarkerClusterGroup.include({_mapBoundsInfinite:new L.LatLngBounds(new L.LatLng(-1/0,-1/0),new L.LatLng(1/0,1/0))}),L.MarkerClusterGroup.include({_noAnimation:{_animationStart:function(){},_animationZoomIn:function(t,e){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),t),this._topClusterLevel._recursivelyAddChildrenToMap(null,e,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationZoomOut:function(t,e){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),t),this._topClusterLevel._recursivelyAddChildrenToMap(null,e,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationAddLayer:function(t,e){this._animationAddLayerNonAnimated(t,e)}},_withAnimation:{_animationStart:function(){this._map._mapPane.className+=" leaflet-cluster-anim",this._inZoomAnimation++},_animationZoomIn:function(o,r){var a,s=this._getExpandedVisibleBounds(),l=this._featureGroup,t=Math.floor(this._map.getMinZoom());this._ignoreMove=!0,this._topClusterLevel._recursively(s,o,t,function(t){var e,i=t._latlng,n=t._markers;for(s.contains(i)||(i=null),t._isSingleParent()&&o+1===r?(l.removeLayer(t),t._recursivelyAddChildrenToMap(null,r,s)):(t.clusterHide(),t._recursivelyAddChildrenToMap(i,r,s)),a=n.length-1;0<=a;a--)e=n[a],s.contains(e._latlng)||l.removeLayer(e)}),this._forceLayout(),this._topClusterLevel._recursivelyBecomeVisible(s,r),l.eachLayer(function(t){t instanceof L.MarkerCluster||!t._icon||t.clusterShow()}),this._topClusterLevel._recursively(s,o,r,function(t){t._recursivelyRestoreChildPositions(r)}),this._ignoreMove=!1,this._enqueue(function(){this._topClusterLevel._recursively(s,o,t,function(t){l.removeLayer(t),t.clusterShow()}),this._animationEnd()})},_animationZoomOut:function(t,e){this._animationZoomOutSingle(this._topClusterLevel,t-1,e),this._topClusterLevel._recursivelyAddChildrenToMap(null,e,this._getExpandedVisibleBounds()),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),t,this._getExpandedVisibleBounds())},_animationAddLayer:function(t,e){var i=this,n=this._featureGroup;n.addLayer(t),e!==t&&(2<e._childCount?(e._updateIcon(),this._forceLayout(),this._animationStart(),t._setPos(this._map.latLngToLayerPoint(e.getLatLng())),t.clusterHide(),this._enqueue(function(){n.removeLayer(t),t.clusterShow(),i._animationEnd()})):(this._forceLayout(),i._animationStart(),i._animationZoomOutSingle(e,this._map.getMaxZoom(),this._zoom)))}},_animationZoomOutSingle:function(e,i,n){var o=this._getExpandedVisibleBounds(),r=Math.floor(this._map.getMinZoom());e._recursivelyAnimateChildrenInAndAddSelfToMap(o,r,i+1,n);var a=this;this._forceLayout(),e._recursivelyBecomeVisible(o,n),this._enqueue(function(){if(1===e._childCount){var t=e._markers[0];this._ignoreMove=!0,t.setLatLng(t.getLatLng()),this._ignoreMove=!1,t.clusterShow&&t.clusterShow()}else e._recursively(o,n,r,function(t){t._recursivelyRemoveChildrenFromMap(o,r,i+1)});a._animationEnd()})},_animationEnd:function(){this._map&&(this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim","")),this._inZoomAnimation--,this.fire("animationend")},_forceLayout:function(){L.Util.falseFn(e.body.offsetWidth)}}),L.markerClusterGroup=function(t){return new L.MarkerClusterGroup(t)},L.MarkerCluster=L.Marker.extend({initialize:function(t,e,i,n){L.Marker.prototype.initialize.call(this,i?i._cLatLng||i.getLatLng():new L.LatLng(0,0),{icon:this,pane:t.options.clusterPane}),this._group=t,this._zoom=e,this._markers=[],this._childClusters=[],this._childCount=0,this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._bounds=new L.LatLngBounds,i&&this._addChild(i),n&&this._addChild(n)},getAllChildMarkers:function(t){t=t||[];for(var e=this._childClusters.length-1;0<=e;e--)this._childClusters[e].getAllChildMarkers(t);for(var i=this._markers.length-1;0<=i;i--)t.push(this._markers[i]);return t},getChildCount:function(){return this._childCount},zoomToBounds:function(t){for(var e,i=this._childClusters.slice(),n=this._group._map,o=n.getBoundsZoom(this._bounds),r=this._zoom+1,a=n.getZoom();0<i.length&&r<o;){r++;var s=[];for(e=0;e<i.length;e++)s=s.concat(i[e]._childClusters);i=s}r<o?this._group._map.setView(this._latlng,r):o<=a?this._group._map.setView(this._latlng,a+1):this._group._map.fitBounds(this._bounds,t)},getBounds:function(){var t=new L.LatLngBounds;return t.extend(this._bounds),t},_updateIcon:function(){this._iconNeedsUpdate=!0,this._icon&&this.setIcon(this)},createIcon:function(){return this._iconNeedsUpdate&&(this._iconObj=this._group.options.iconCreateFunction(this),this._iconNeedsUpdate=!1),this._iconObj.createIcon()},createShadow:function(){return this._iconObj.createShadow()},_addChild:function(t,e){this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._setClusterCenter(t),t instanceof L.MarkerCluster?(e||(this._childClusters.push(t),t.__parent=this),this._childCount+=t._childCount):(e||this._markers.push(t),this._childCount++),this.__parent&&this.__parent._addChild(t,!0)},_setClusterCenter:function(t){this._cLatLng||(this._cLatLng=t._cLatLng||t._latlng)},_resetBounds:function(){var t=this._bounds;t._southWest&&(t._southWest.lat=1/0,t._southWest.lng=1/0),t._northEast&&(t._northEast.lat=-1/0,t._northEast.lng=-1/0)},_recalculateBounds:function(){var t,e,i,n,o=this._markers,r=this._childClusters,a=0,s=0,l=this._childCount;if(0!==l){for(this._resetBounds(),t=0;t<o.length;t++)i=o[t]._latlng,this._bounds.extend(i),a+=i.lat,s+=i.lng;for(t=0;t<r.length;t++)(e=r[t])._boundsNeedUpdate&&e._recalculateBounds(),this._bounds.extend(e._bounds),i=e._wLatLng,n=e._childCount,a+=i.lat*n,s+=i.lng*n;this._latlng=this._wLatLng=new L.LatLng(a/l,s/l),this._boundsNeedUpdate=!1}},_addToMap:function(t){t&&(this._backupLatlng=this._latlng,this.setLatLng(t)),this._group._featureGroup.addLayer(this)},_recursivelyAnimateChildrenIn:function(t,o,e){this._recursively(t,this._group._map.getMinZoom(),e-1,function(t){var e,i,n=t._markers;for(e=n.length-1;0<=e;e--)(i=n[e])._icon&&(i._setPos(o),i.clusterHide())},function(t){var e,i,n=t._childClusters;for(e=n.length-1;0<=e;e--)(i=n[e])._icon&&(i._setPos(o),i.clusterHide())})},_recursivelyAnimateChildrenInAndAddSelfToMap:function(e,i,n,o){this._recursively(e,o,i,function(t){t._recursivelyAnimateChildrenIn(e,t._group._map.latLngToLayerPoint(t.getLatLng()).round(),n),t._isSingleParent()&&n-1===o?(t.clusterShow(),t._recursivelyRemoveChildrenFromMap(e,i,n)):t.clusterHide(),t._addToMap()})},_recursivelyBecomeVisible:function(t,e){this._recursively(t,this._group._map.getMinZoom(),e,null,function(t){t.clusterShow()})},_recursivelyAddChildrenToMap:function(n,o,r){this._recursively(r,this._group._map.getMinZoom()-1,o,function(t){if(o!==t._zoom)for(var e=t._markers.length-1;0<=e;e--){var i=t._markers[e];r.contains(i._latlng)&&(n&&(i._backupLatlng=i.getLatLng(),i.setLatLng(n),i.clusterHide&&i.clusterHide()),t._group._featureGroup.addLayer(i))}},function(t){t._addToMap(n)})},_recursivelyRestoreChildPositions:function(t){for(var e=this._markers.length-1;0<=e;e--){var i=this._markers[e];i._backupLatlng&&(i.setLatLng(i._backupLatlng),delete i._backupLatlng)}if(t-1===this._zoom)for(var n=this._childClusters.length-1;0<=n;n--)this._childClusters[n]._restorePosition();else for(var o=this._childClusters.length-1;0<=o;o--)this._childClusters[o]._recursivelyRestoreChildPositions(t)},_restorePosition:function(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap:function(t,e,i,n){var o,r;this._recursively(t,e-1,i-1,function(t){for(r=t._markers.length-1;0<=r;r--)o=t._markers[r],n&&n.contains(o._latlng)||(t._group._featureGroup.removeLayer(o),o.clusterShow&&o.clusterShow())},function(t){for(r=t._childClusters.length-1;0<=r;r--)o=t._childClusters[r],n&&n.contains(o._latlng)||(t._group._featureGroup.removeLayer(o),o.clusterShow&&o.clusterShow())})},_recursively:function(t,e,i,n,o){var r,a,s=this._childClusters,l=this._zoom;if(e<=l&&(n&&n(this),o&&l===i&&o(this)),l<e||l<i)for(r=s.length-1;0<=r;r--)a=s[r],t.intersects(a._bounds)&&a._recursively(t,e,i,n,o)},_isSingleParent:function(){return 0<this._childClusters.length&&this._childClusters[0]._childCount===this._childCount}}),L.Marker.include({clusterHide:function(){return this.options.opacityWhenUnclustered=this.options.opacity||1,this.setOpacity(0)},clusterShow:function(){var t=this.setOpacity(this.options.opacity||this.options.opacityWhenUnclustered);return delete this.options.opacityWhenUnclustered,t}}),L.DistanceGrid=function(t){this._cellSize=t,this._sqCellSize=t*t,this._grid={},this._objectPoint={}},L.DistanceGrid.prototype={addObject:function(t,e){var i=this._getCoord(e.x),n=this._getCoord(e.y),o=this._grid,r=o[n]=o[n]||{},a=r[i]=r[i]||[],s=L.Util.stamp(t);this._objectPoint[s]=e,a.push(t)},updateObject:function(t,e){this.removeObject(t),this.addObject(t,e)},removeObject:function(t,e){var i,n,o=this._getCoord(e.x),r=this._getCoord(e.y),a=this._grid,s=a[r]=a[r]||{},l=s[o]=s[o]||[];for(delete this._objectPoint[L.Util.stamp(t)],i=0,n=l.length;i<n;i++)if(l[i]===t)return l.splice(i,1),1===n&&delete s[o],!0},eachObject:function(t,e){var i,n,o,r,a,s,l=this._grid;for(i in l)for(n in a=l[i])for(o=0,r=(s=a[n]).length;o<r;o++)t.call(e,s[o])&&(o--,r--)},getNearObject:function(t){var e,i,n,o,r,a,s,l,u=this._getCoord(t.x),c=this._getCoord(t.y),h=this._objectPoint,p=this._sqCellSize,d=null;for(e=c-1;e<=c+1;e++)if(o=this._grid[e])for(i=u-1;i<=u+1;i++)if(r=o[i])for(n=0,a=r.length;n<a;n++)s=r[n],((l=this._sqDist(h[L.Util.stamp(s)],t))<p||l<=p&&null===d)&&(p=l,d=s);return d},_getCoord:function(t){var e=Math.floor(t/this._cellSize);return isFinite(e)?e:t},_sqDist:function(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n}},L.QuickHull={getDistant:function(t,e){var i=e[1].lat-e[0].lat;return(e[0].lng-e[1].lng)*(t.lat-e[0].lat)+i*(t.lng-e[0].lng)},findMostDistantPointFromBaseLine:function(t,e){var i,n,o,r=0,a=null,s=[];for(i=e.length-1;0<=i;i--)n=e[i],0<(o=this.getDistant(n,t))&&(s.push(n),r<o&&(r=o,a=n));return{maxPoint:a,newPoints:s}},buildConvexHull:function(t,e){var i=[],n=this.findMostDistantPointFromBaseLine(t,e);return n.maxPoint?i=(i=i.concat(this.buildConvexHull([t[0],n.maxPoint],n.newPoints))).concat(this.buildConvexHull([n.maxPoint,t[1]],n.newPoints)):[t[0]]},getConvexHull:function(t){var e,i=!1,n=!1,o=!1,r=!1,a=null,s=null,l=null,u=null,c=null,h=null;for(e=t.length-1;0<=e;e--){var p=t[e];(!1===i||p.lat>i)&&(i=(a=p).lat),(!1===n||p.lat<n)&&(n=(s=p).lat),(!1===o||p.lng>o)&&(o=(l=p).lng),(!1===r||p.lng<r)&&(r=(u=p).lng)}return c=n!==i?(h=s,a):(h=u,l),[].concat(this.buildConvexHull([h,c],t),this.buildConvexHull([c,h],t))}},L.MarkerCluster.include({getConvexHull:function(){var t,e,i=this.getAllChildMarkers(),n=[];for(e=i.length-1;0<=e;e--)t=i[e].getLatLng(),n.push(t);return L.QuickHull.getConvexHull(n)}}),L.MarkerCluster.include({_2PI:2*Math.PI,_circleFootSeparation:25,_circleStartAngle:Math.PI/6,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy:function(){if(this._group._spiderfied!==this&&!this._group._inZoomAnimation){var t,e=this.getAllChildMarkers(),i=this._group._map.latLngToLayerPoint(this._latlng);this._group._unspiderfy(),this._group._spiderfied=this,t=e.length>=this._circleSpiralSwitchover?this._generatePointsSpiral(e.length,i):(i.y+=10,this._generatePointsCircle(e.length,i)),this._animationSpiderfy(e,t)}},unspiderfy:function(t){this._group._inZoomAnimation||(this._animationUnspiderfy(t),this._group._spiderfied=null)},_generatePointsCircle:function(t,e){var i,n,o=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+t)/this._2PI,r=this._2PI/t,a=[];for(i=(a.length=t)-1;0<=i;i--)n=this._circleStartAngle+i*r,a[i]=new L.Point(e.x+o*Math.cos(n),e.y+o*Math.sin(n))._round();return a},_generatePointsSpiral:function(t,e){var i,n=this._group.options.spiderfyDistanceMultiplier,o=n*this._spiralLengthStart,r=n*this._spiralFootSeparation,a=n*this._spiralLengthFactor*this._2PI,s=0,l=[];for(i=(l.length=t)-1;0<=i;i--)s+=r/o+5e-4*i,l[i]=new L.Point(e.x+o*Math.cos(s),e.y+o*Math.sin(s))._round(),o+=a/s;return l},_noanimationUnspiderfy:function(){var t,e,i=this._group,n=i._map,o=i._featureGroup,r=this.getAllChildMarkers();for(i._ignoreMove=!0,this.setOpacity(1),e=r.length-1;0<=e;e--)t=r[e],o.removeLayer(t),t._preSpiderfyLatlng&&(t.setLatLng(t._preSpiderfyLatlng),delete t._preSpiderfyLatlng),t.setZIndexOffset&&t.setZIndexOffset(0),t._spiderLeg&&(n.removeLayer(t._spiderLeg),delete t._spiderLeg);i.fire("unspiderfied",{cluster:this,markers:r}),i._ignoreMove=!1,i._spiderfied=null}}),L.MarkerClusterNonAnimated=L.MarkerCluster.extend({_animationSpiderfy:function(t,e){var i,n,o,r,a=this._group,s=a._map,l=a._featureGroup,u=this._group.options.spiderLegPolylineOptions;for(a._ignoreMove=!0,i=0;i<t.length;i++)r=s.layerPointToLatLng(e[i]),n=t[i],o=new L.Polyline([this._latlng,r],u),s.addLayer(o),n._spiderLeg=o,n._preSpiderfyLatlng=n._latlng,n.setLatLng(r),n.setZIndexOffset&&n.setZIndexOffset(1e6),l.addLayer(n);this.setOpacity(.3),a._ignoreMove=!1,a.fire("spiderfied",{cluster:this,markers:t})},_animationUnspiderfy:function(){this._noanimationUnspiderfy()}}),L.MarkerCluster.include({_animationSpiderfy:function(t,e){var i,n,o,r,a,s,l=this,u=this._group,c=u._map,h=u._featureGroup,p=this._latlng,d=c.latLngToLayerPoint(p),f=L.Path.SVG,m=L.extend({},this._group.options.spiderLegPolylineOptions),_=m.opacity;for(void 0===_&&(_=L.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity),f?(m.opacity=0,m.className=(m.className||"")+" leaflet-cluster-spider-leg"):m.opacity=_,u._ignoreMove=!0,i=0;i<t.length;i++)n=t[i],s=c.layerPointToLatLng(e[i]),o=new L.Polyline([p,s],m),c.addLayer(o),n._spiderLeg=o,f&&(a=(r=o._path).getTotalLength()+.1,r.style.strokeDasharray=a,r.style.strokeDashoffset=a),n.setZIndexOffset&&n.setZIndexOffset(1e6),n.clusterHide&&n.clusterHide(),h.addLayer(n),n._setPos&&n._setPos(d);for(u._forceLayout(),u._animationStart(),i=t.length-1;0<=i;i--)s=c.layerPointToLatLng(e[i]),(n=t[i])._preSpiderfyLatlng=n._latlng,n.setLatLng(s),n.clusterShow&&n.clusterShow(),f&&((r=(o=n._spiderLeg)._path).style.strokeDashoffset=0,o.setStyle({opacity:_}));this.setOpacity(.3),u._ignoreMove=!1,setTimeout(function(){u._animationEnd(),u.fire("spiderfied",{cluster:l,markers:t})},200)},_animationUnspiderfy:function(t){var e,i,n,o,r,a,s=this,l=this._group,u=l._map,c=l._featureGroup,h=t?u._latLngToNewLayerPoint(this._latlng,t.zoom,t.center):u.latLngToLayerPoint(this._latlng),p=this.getAllChildMarkers(),d=L.Path.SVG;for(l._ignoreMove=!0,l._animationStart(),this.setOpacity(1),i=p.length-1;0<=i;i--)(e=p[i])._preSpiderfyLatlng&&(e.closePopup(),e.setLatLng(e._preSpiderfyLatlng),delete e._preSpiderfyLatlng,a=!0,e._setPos&&(e._setPos(h),a=!1),e.clusterHide&&(e.clusterHide(),a=!1),a&&c.removeLayer(e),d&&(r=(o=(n=e._spiderLeg)._path).getTotalLength()+.1,o.style.strokeDashoffset=r,n.setStyle({opacity:0})));l._ignoreMove=!1,setTimeout(function(){var t=0;for(i=p.length-1;0<=i;i--)(e=p[i])._spiderLeg&&t++;for(i=p.length-1;0<=i;i--)(e=p[i])._spiderLeg&&(e.clusterShow&&e.clusterShow(),e.setZIndexOffset&&e.setZIndexOffset(0),1<t&&c.removeLayer(e),u.removeLayer(e._spiderLeg),delete e._spiderLeg);l._animationEnd(),l.fire("unspiderfied",{cluster:s,markers:p})},200)}}),L.MarkerClusterGroup.include({_spiderfied:null,unspiderfy:function(){this._unspiderfy.apply(this,arguments)},_spiderfierOnAdd:function(){this._map.on("click",this._unspiderfyWrapper,this),this._map.options.zoomAnimation&&this._map.on("zoomstart",this._unspiderfyZoomStart,this),this._map.on("zoomend",this._noanimationUnspiderfy,this),L.Browser.touch||this._map.getRenderer(this)},_spiderfierOnRemove:function(){this._map.off("click",this._unspiderfyWrapper,this),this._map.off("zoomstart",this._unspiderfyZoomStart,this),this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._map.off("zoomend",this._noanimationUnspiderfy,this),this._noanimationUnspiderfy()},_unspiderfyZoomStart:function(){this._map&&this._map.on("zoomanim",this._unspiderfyZoomAnim,this)},_unspiderfyZoomAnim:function(t){L.DomUtil.hasClass(this._map._mapPane,"leaflet-touching")||(this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy(t))},_unspiderfyWrapper:function(){this._unspiderfy()},_unspiderfy:function(t){this._spiderfied&&this._spiderfied.unspiderfy(t)},_noanimationUnspiderfy:function(){this._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer:function(t){t._spiderLeg&&(this._featureGroup.removeLayer(t),t.clusterShow&&t.clusterShow(),t.setZIndexOffset&&t.setZIndexOffset(0),this._map.removeLayer(t._spiderLeg),delete t._spiderLeg)}}),L.MarkerClusterGroup.include({refreshClusters:function(t){return t?t instanceof L.MarkerClusterGroup?t=t._topClusterLevel.getAllChildMarkers():t instanceof L.LayerGroup?t=t._layers:t instanceof L.MarkerCluster?t=t.getAllChildMarkers():t instanceof L.Marker&&(t=[t]):t=this._topClusterLevel.getAllChildMarkers(),this._flagParentsIconsNeedUpdate(t),this._refreshClustersIcons(),this.options.singleMarkerMode&&this._refreshSingleMarkerModeMarkers(t),this},_flagParentsIconsNeedUpdate:function(t){var e,i;for(e in t)for(i=t[e].__parent;i;)i._iconNeedsUpdate=!0,i=i.__parent},_refreshSingleMarkerModeMarkers:function(t){var e,i;for(e in t)i=t[e],this.hasLayer(i)&&i.setIcon(this._overrideMarkerIcon(i))}}),L.Marker.include({refreshIconOptions:function(t,e){var i=this.options.icon;return L.setOptions(i,t),this.setIcon(i),e&&this.__parent&&this.__parent._group.refreshClusters(this),this}})}(window,document),function(t){if("object"==typeof exports)module.exports=t();else if("function"==typeof define&&define.amd)define(t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.omnivore=t()}}(function(){return function o(r,a,s){function l(i,t){if(!a[i]){if(!r[i]){var e="function"==typeof require&&require;if(!t&&e)return e(i,!0);if(u)return u(i,!0);throw new Error("Cannot find module '"+i+"'")}var n=a[i]={exports:{}};r[i][0].call(n.exports,function(t){var e=r[i][1][t];return l(e||t)},n,n.exports,o,r,a,s)}return a[i].exports}for(var u="function"==typeof require&&require,t=0;t<s.length;t++)l(s[t]);return l}({1:[function(t,e){var a=t("corslite"),n=t("csv2geojson"),o=t("wellknown"),r=t("topojson"),s=t("togeojson");function l(t,e){"addData"in t&&t.addData(e),"setGeoJSON"in t&&t.setGeoJSON(e)}function u(t){var e="string"==typeof t?JSON.parse(t):t,i=[];for(var n in e.objects){var o=r.feature(e,e.objects[n]);i=o.features?i.concat(o.features):i.concat([o])}return i}function c(t,e,i){return i=i||L.geoJson(),e=e||{},n.csv2geojson(t,e,function(t,e){if(t)return i.fire("error",{error:t});l(i,e)}),i}function h(t,e,i){var n=f(t);return n?(l(i=i||L.geoJson(),s.gpx(n)),i):i.fire("error",{error:"Could not parse GPX"})}function p(t,e,i){var n=f(t);return n?(l(i=i||L.geoJson(),s.kml(n)),i):i.fire("error",{error:"Could not parse GPX"})}function d(t,e,i){return l(i=i||L.geoJson(),o(t)),i}function f(t){return"string"==typeof t?(new DOMParser).parseFromString(t,"text/xml"):t}e.exports.geojson=function(t,e,i){var n=i||L.geoJson();return a(t,function(t,e){if(t)return n.fire("error",{error:t});l(n,JSON.parse(e.responseText)),n.fire("ready")}),n},e.exports.topojson=function(t,e,i){var n=i||L.geoJson();return a(t,function(t,e){if(t)return n.fire("error",{error:t});l(n,u(e.responseText)),n.fire("ready")}),n},e.exports.topojson.parse=u,e.exports.csv=function(t,o,e){var r=e||L.geoJson();return a(t,function(t,e){var i;if(t)return r.fire("error",{error:t});function n(){i=!0}r.on("error",n),c(e.responseText,o,r),r.off("error",n),i||r.fire("ready")}),r},e.exports.csv.parse=c,e.exports.gpx=function(t,o,e){var r=e||L.geoJson();return a(t,function(t,e){var i;if(t)return r.fire("error",{error:t});function n(){i=!0}r.on("error",n),h(e.responseXML||e.responseText,o,r),r.off("error",n),i||r.fire("ready")}),r},e.exports.gpx.parse=h,e.exports.kml=function(t,o){var r=L.geoJson();return a(t,function(t,e){var i;if(t)return r.fire("error",{error:t});function n(){i=!0}r.on("error",n),p(e.responseXML||e.responseText,o,r),r.off("error",n),i||r.fire("ready")}),r},e.exports.kml.parse=p,e.exports.wkt=function(t,i,e){var n=e||L.geoJson();return a(t,function(t,e){if(t)return n.fire("error",{error:t});d(e.responseText,i,n),n.fire("ready")}),n},e.exports.wkt.parse=d},{corslite:5,csv2geojson:6,togeojson:9,topojson:10,wellknown:38}],2:[function(){},{}],3:[function(t,e){e.exports=t(2)},{}],4:[function(t,e){var i=e.exports={};i.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};if(e){var i=[];return window.addEventListener("message",function(t){var e=t.source;e!==window&&null!==e||"process-tick"!==t.data||(t.stopPropagation(),0<i.length&&i.shift()())},!0),function(t){i.push(t),window.postMessage("process-tick","*")}}return function(t){setTimeout(t,0)}}(),i.title="browser",i.browser=!0,i.env={},i.argv=[],i.binding=function(){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(){throw new Error("process.chdir is not supported")}},{}],5:[function(t,e){void 0!==e&&(e.exports=function(t,e,i){var n,o=!1;if(void 0===window.XMLHttpRequest)return e(Error("Browser not supported"));if(void 0===i){var r=t.match(/^\s*https?:\/\/[^\/]*/);i=r&&r[0]!==location.protocol+"//"+location.domain+(location.port?":"+location.port:"")}if(!i||"object"!=typeof window.XDomainRequest&&"function"!=typeof window.XDomainRequest)n=new window.XMLHttpRequest;else{n=new window.XDomainRequest;var a=e;e=function(){if(o)a.apply(this,arguments);else{var t=this,e=arguments;setTimeout(function(){a.apply(t,e)},0)}}}function s(){void 0===n.status||function(t){return 200<=t&&t<300||304===t}(n.status)?e.call(n,null,n):e.call(n,n,null)}return"onload"in n?n.onload=s:n.onreadystatechange=function(){4===n.readyState&&s()},n.onerror=function(t){e.call(this,t||!0,null),e=function(){}},n.onprogress=function(){},n.ontimeout=function(t){e.call(this,t,null),e=function(){}},n.onabort=function(t){e.call(this,t,null),e=function(){}},n.open("GET",t,!0),n.send(null),o=!0,n})},{}],6:[function(t,e){var y=t("dsv"),v=t("sexagesimal");function x(t){return!!t.match(/(Lat)(itude)?/gi)}function b(t){return!!t.match(/(L)(on|ng)(gitude)?/i)}function a(t){return"object"==typeof t?Object.keys(t).length:0}function w(o){var r=[];return[",",";","\t","|"].forEach(function(t){var e=y(t).parse(o);if(1<=e.length){for(var i=a(e[0]),n=0;n<e.length;n++)if(a(e[n])!==i)return;r.push({delimiter:t,arity:Object.keys(e[0]).length})}}),r.length?r.sort(function(t,e){return e.arity-t.arity})[0].delimiter:null}e.exports={isLon:b,isLat:x,csv:y.csv.parse,tsv:y.tsv.parse,dsv:y,auto:function(t){var e=w(t);return e?y(e).parse(t):null},csv2geojson:function(t,e,i){i||(i=e,e={}),e.delimiter=e.delimiter||",";var n=e.latfield||"",o=e.lonfield||"",r=[],a={type:"FeatureCollection",features:r};if("auto"===e.delimiter&&"string"==typeof t&&(e.delimiter=w(t),!e.delimiter))return i({type:"Error",message:"Could not autodetect delimiter"});var s="string"==typeof t?y(e.delimiter).parse(t):t;if(!s.length)return i(null,a);if(!n||!o){for(var l in s[0])!n&&x(l)&&(n=l),!o&&b(l)&&(o=l);if(!n||!o){var u=[];for(var c in s[0])u.push(c);return i({type:"Error",message:"Latitude and longitude fields not present",data:s,fields:u})}}for(var h=[],p=0;p<s.length;p++)if(void 0!==s[p][o]&&void 0!==s[p][o]){var d,f,m,_=s[p][o],g=s[p][n];(m=v(_,"EW"))&&(_=m),(m=v(g,"NS"))&&(g=m),d=parseFloat(_),f=parseFloat(g),isNaN(d)||isNaN(f)?h.push({message:"A row contained an invalid value for latitude or longitude",row:s[p]}):(e.includeLatLon||(delete s[p][o],delete s[p][n]),r.push({type:"Feature",properties:s[p],geometry:{type:"Point",coordinates:[parseFloat(d),parseFloat(f)]}}))}i(h.length?h:null,a)},toLine:function(t){for(var e=t.features,i={type:"Feature",geometry:{type:"LineString",coordinates:[]}},n=0;n<e.length;n++)i.geometry.coordinates.push(e[n].geometry.coordinates);return i.properties=e[0].properties,{type:"FeatureCollection",features:[i]}},toPolygon:function(t){for(var e=t.features,i={type:"Feature",geometry:{type:"Polygon",coordinates:[[]]}},n=0;n<e.length;n++)i.geometry.coordinates[0].push(e[n].geometry.coordinates);return i.properties=e[0].properties,{type:"FeatureCollection",features:[i]}}}},{dsv:7,sexagesimal:8}],7:[function(t,e){t("fs");e.exports=new Function('dsv.version = "0.0.3";\n\ndsv.tsv = dsv("\\t");\ndsv.csv = dsv(",");\n\nfunction dsv(delimiter) {\n var dsv = {},\n reFormat = new RegExp("[\\"" + delimiter + "\\n]"),\n delimiterCode = delimiter.charCodeAt(0);\n\n dsv.parse = function(text, f) {\n var o;\n return dsv.parseRows(text, function(row, i) {\n if (o) return o(row, i - 1);\n var a = new Function("d", "return {" + row.map(function(name, i) {\n return JSON.stringify(name) + ": d[" + i + "]";\n }).join(",") + "}");\n o = f ? function(row, i) { return f(a(row), i); } : a;\n });\n };\n\n dsv.parseRows = function(text, f) {\n var EOL = {}, // sentinel value for end-of-line\n EOF = {}, // sentinel value for end-of-file\n rows = [], // output rows\n N = text.length,\n I = 0, // current character index\n n = 0, // the current line number\n t, // the current token\n eol; // is the current token followed by EOL?\n\n function token() {\n if (I >= N) return EOF; // special case: end of file\n if (eol) return eol = false, EOL; // special case: end of line\n\n // special case: quotes\n var j = I;\n if (text.charCodeAt(j) === 34) {\n var i = j;\n while (i++ < N) {\n if (text.charCodeAt(i) === 34) {\n if (text.charCodeAt(i + 1) !== 34) break;\n ++i;\n }\n }\n I = i + 2;\n var c = text.charCodeAt(i + 1);\n if (c === 13) {\n eol = true;\n if (text.charCodeAt(i + 2) === 10) ++I;\n } else if (c === 10) {\n eol = true;\n }\n return text.substring(j + 1, i).replace(/""/g, "\\"");\n }\n\n // common case: find next delimiter or newline\n while (I < N) {\n var c = text.charCodeAt(I++), k = 1;\n if (c === 10) eol = true; // \\n\n else if (c === 13) { eol = true; if (text.charCodeAt(I) === 10) ++I, ++k; } // \\r|\\r\\n\n else if (c !== delimiterCode) continue;\n return text.substring(j, I - k);\n }\n\n // special case: last token before EOF\n return text.substring(j);\n }\n\n while ((t = token()) !== EOF) {\n var a = [];\n while (t !== EOL && t !== EOF) {\n a.push(t);\n t = token();\n }\n if (f && !(a = f(a, n++))) continue;\n rows.push(a);\n }\n\n return rows;\n };\n\n dsv.format = function(rows) {\n if (Array.isArray(rows[0])) return dsv.formatRows(rows); // deprecated; use formatRows\n var fieldSet = {}, fields = [];\n\n // Compute unique fields in order of discovery.\n rows.forEach(function(row) {\n for (var field in row) {\n if (!(field in fieldSet)) {\n fields.push(fieldSet[field] = field);\n }\n }\n });\n\n return [fields.map(formatValue).join(delimiter)].concat(rows.map(function(row) {\n return fields.map(function(field) {\n return formatValue(row[field]);\n }).join(delimiter);\n })).join("\\n");\n };\n\n dsv.formatRows = function(rows) {\n return rows.map(formatRow).join("\\n");\n };\n\n function formatRow(row) {\n return row.map(formatValue).join(delimiter);\n }\n\n function formatValue(text) {\n return reFormat.test(text) ? "\\"" + text.replace(/\\"/g, "\\"\\"") + "\\"" : text;\n }\n\n return dsv;\n}\n;return dsv')()},{fs:2}],8:[function(t,e){e.exports=function(t,e){if(e||(e="NSEW"),"string"!=typeof t)return null;var i=t.match(/^([0-9.]+)°? *(?:([0-9.]+)['’′‘] *)?(?:([0-9.]+)(?:''|"|”|″) *)?([NSEW])?/);return i?i[4]&&-1===e.indexOf(i[4])?null:((i[1]?parseFloat(i[1]):0)+(i[2]?parseFloat(i[2])/60:0)+(i[3]?parseFloat(i[3])/3600:0))*(i[4]&&"S"===i[4]||"W"===i[4]?-1:1):null}},{}],9:[function(i,e,a){(function(t){toGeoJSON=function(){"use strict";var u,e=/\s*/g,o=/^\s*|\s*$/g,r=/\s+/;function c(t){if(!t||!t.length)return 0;for(var e=0,i=0;e<t.length;e++)i=(i<<5)-i+t.charCodeAt(e)|0;return i}function _(t,e){return t.getElementsByTagName(e)}function h(t,e){return t.getAttribute(e)}function n(t,e){return parseFloat(h(t,e))}function g(t,e){var i=_(t,e);return i.length?i[0]:null}function p(t){for(var e=0,i=[];e<t.length;e++)i[e]=parseFloat(t[e]);return i}function y(t){return t&&function(t){t.normalize&&t.normalize()}(t),t&&t.firstChild&&t.firstChild.nodeValue}function v(t){return p(t.replace(e,"").split(","))}function x(t){for(var e=t.replace(o,"").split(r),i=[],n=0;n<e.length;n++)i.push(v(e[n]));return i}function d(t){var e=[n(t,"lon"),n(t,"lat")],i=g(t,"ele");return i&&e.push(parseFloat(y(i))),e}return"undefined"!=typeof XMLSerializer?u=new XMLSerializer:"object"!=typeof a||"object"!=typeof t||t.browser||(u=new(i("xmldom").XMLSerializer)),{kml:function(t,e){e=e||{};for(var i,n={type:"FeatureCollection",features:[]},d={},f=["Polygon","LineString","Point","Track"],o=_(t,"Placemark"),r=_(t,"Style"),a=0;a<r.length;a++)d["#"+h(r[a],"id")]=c((i=r[a],u.serializeToString(i))).toString(16);for(var s=0;s<o.length;s++)n.features=n.features.concat(l(o[s]));function m(t){for(var e=_(t,"coord"),i=[],n=0;n<e.length;n++)i.push(p(y(e[n]).split(" ")));return i}function l(t){var e,i=function t(e){var i,n,o,r,a,s=[];if(g(e,"MultiGeometry"))return t(g(e,"MultiGeometry"));if(g(e,"MultiTrack"))return t(g(e,"MultiTrack"));for(o=0;o<f.length;o++)if(n=_(e,f[o]))for(r=0;r<n.length;r++)if(i=n[r],"Point"==f[o])s.push({type:"Point",coordinates:v(y(g(i,"coordinates")))});else if("LineString"==f[o])s.push({type:"LineString",coordinates:x(y(g(i,"coordinates")))});else if("Polygon"==f[o]){var l=_(i,"LinearRing"),u=[];for(a=0;a<l.length;a++)u.push(x(y(g(l[a],"coordinates"))));s.push({type:"Polygon",coordinates:u})}else"Track"==f[o]&&s.push({type:"LineString",coordinates:m(i)});return s}(t),n={},o=y(g(t,"name")),r=y(g(t,"styleUrl")),a=y(g(t,"description")),s=g(t,"TimeSpan"),l=g(t,"ExtendedData");if(!i.length)return[];if(o&&(n.name=o),r&&d[r]&&(n.styleUrl=r,n.styleHash=d[r]),a&&(n.description=a),s){var u=y(g(s,"begin")),c=y(g(s,"end"));n.timespan={begin:u,end:c}}if(l){var h=_(l,"Data"),p=_(l,"SimpleData");for(e=0;e<h.length;e++)n[h[e].getAttribute("name")]=y(g(h[e],"value"));for(e=0;e<p.length;e++)n[p[e].getAttribute("name")]=y(p[e])}return[{type:"Feature",geometry:1===i.length?i[0]:{type:"GeometryCollection",geometries:i},properties:n}]}return n},gpx:function(t){var e,i=_(t,"trk"),n=_(t,"rte"),o=_(t,"wpt"),r={type:"FeatureCollection",features:[]};for(e=0;e<i.length;e++)r.features.push(a(i[e],"trkpt"));for(e=0;e<n.length;e++)r.features.push(a(n[e],"rtept"));for(e=0;e<o.length;e++)r.features.push(s(o[e]));function a(t,e){var i,n=_(t,e),o=[];for(i=0;i<n.length;i++)o.push(d(n[i]));return{type:"Feature",properties:l(t),geometry:{type:"LineString",coordinates:o}}}function s(t){var e=l(t);return e.sym=y(g(t,"sym")),{type:"Feature",properties:e,geometry:{type:"Point",coordinates:d(t)}}}function l(t){var e,i=["name","desc","author","copyright","link","time","keywords"],n={};for(e=0;e<i.length;e++)n[i[e]]=y(g(t,i[e]));return function(t){var e={};for(var i in t)t[i]&&(e[i]=t[i]);return e}(n)}return r}}}(),void 0!==e&&(e.exports=toGeoJSON)}).call(this,i("/Users/tmcw/src/leaflet-omnivore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"))},{"/Users/tmcw/src/leaflet-omnivore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":4,xmldom:3}],10:[function(t,e){var i=e.exports=t("./topojson");i.topology=t("./lib/topojson/topology"),i.simplify=t("./lib/topojson/simplify"),i.clockwise=t("./lib/topojson/clockwise"),i.filter=t("./lib/topojson/filter"),i.prune=t("./lib/topojson/prune"),i.bind=t("./lib/topojson/bind")},{"./lib/topojson/bind":11,"./lib/topojson/clockwise":14,"./lib/topojson/filter":18,"./lib/topojson/prune":21,"./lib/topojson/simplify":23,"./lib/topojson/topology":26,"./topojson":37}],11:[function(t,e){var n=t("./type");t("../../");function r(){}e.exports=function(t,o){var e=n({geometry:function(t){var e=t.properties,i=o[t.id];if(i)if(e)for(var n in i)e[n]=i[n];else for(var n in i){t.properties=i;break}this.defaults.geometry.call(this,t)},LineString:r,MultiLineString:r,Point:r,MultiPoint:r,Polygon:r,MultiPolygon:r});for(var i in t.objects)e.object(t.objects[i])}},{"../../":10,"./type":36}],12:[function(t,e){e.exports=function(t){var n=1/0,o=1/0,r=-1/0,a=-1/0;function e(t){t&&i.hasOwnProperty(t.type)&&i[t.type](t)}var i={GeometryCollection:function(t){t.geometries.forEach(e)},Point:function(t){s(t.coordinates)},MultiPoint:function(t){t.coordinates.forEach(s)},LineString:function(t){l(t.coordinates)},MultiLineString:function(t){t.coordinates.forEach(l)},Polygon:function(t){t.coordinates.forEach(l)},MultiPolygon:function(t){t.coordinates.forEach(u)}};function s(t){var e=t[0],i=t[1];e<n&&(n=e),r<e&&(r=e),i<o&&(o=i),a<i&&(a=i)}function l(t){t.forEach(s)}function u(t){t.forEach(l)}for(var c in t)e(t[c]);return[n,o,r,a]}},{}],13:[function(t,e,i){i.name="cartesian",i.formatDistance=function(t){return t.toString()},i.ringArea=function(t){var e=0,i=t.length,n=t[i-1][1]*t[0][0]-t[i-1][0]*t[0][1];for(;++e<i;)n+=t[e-1][1]*t[e][0]-t[e-1][0]*t[e][1];return.5*-n},i.absoluteArea=Math.abs,i.triangleArea=function(t){return Math.abs((t[0][0]-t[2][0])*(t[1][1]-t[0][1])-(t[0][0]-t[1][0])*(t[2][1]-t[0][1]))},i.distance=function(t,e,i,n){var o=t-i,r=e-n;return Math.sqrt(o*o+r*r)}},{}],14:[function(t,e){var a=t("./type"),s=t("./coordinate-systems"),l=t("../../");function u(l,u){return function(t){if(e=t.length){for(var e,i,n,o=new Array(e),r=-1/0,a=0;a<e;++a){var s;r<(s=Math.abs(o[a]=l(t[a])))&&(r=s,i=a)}i&&(n=t[i],t[i]=t[0],t[0]=n,n=o[i],o[i]=o[0],o[0]=n),o[0]<0&&u(t[0]);for(a=1;a<e;++a)0<o[a]&&u(t[a])}}}function c(){}e.exports=function(t,e){"Topology"===t.type?function(e,t){var i=null;t&&"coordinate-system"in t&&(i=s[t["coordinate-system"]]);var n=u(function(t){return i.ringArea(l.feature(e,{type:"Polygon",arcs:[t]}).geometry.coordinates[0])},function(t){var e=-1,i=t.length;t.reverse();for(;++e<i;)t[e]=~t[e]}),o=a({LineString:c,MultiLineString:c,Point:c,MultiPoint:c,Polygon:function(t){n(t.arcs)},MultiPolygon:function(t){t.arcs.forEach(n)}});for(var r in e.objects)o.object(e.objects[r])}(t,e):function(t,e){var i=null;e&&"coordinate-system"in e&&(i=s[e["coordinate-system"]]);var n=u(i.ringArea,function(t){t.reverse()});a({LineString:c,MultiLineString:c,Point:c,MultiPoint:c,Polygon:function(t){n(t.coordinates)},MultiPolygon:function(t){t.coordinates.forEach(n)}}).object(t)}(t,e)}},{"../../":10,"./coordinate-systems":16,"./type":36}],15:[function(t,e){e.exports=function(t,i){function e(t){var e=i(t);null==e?delete t.id:t.id=e}arguments.length<2&&(i=function(t){return t.id});var n,o={Feature:e,FeatureCollection:function(t){t.features.forEach(e)}};for(var r in t)(n=t[r])&&o.hasOwnProperty(n.type)&&o[n.type](n);return t}},{}],16:[function(t,e){e.exports={cartesian:t("./cartesian"),spherical:t("./spherical")}},{"./cartesian":13,"./spherical":24}],17:[function(t,e){e.exports=function(t){for(var e=t.arcs,i=-1,n=e.length;++i<n;)for(var o,r,a=e[i],s=0,l=a.length,u=a[0],c=u[0],h=u[1];++s<l;)o=(u=a[s])[0],r=u[1],a[s]=[o-c,r-h],c=o,h=r;return t}},{}],18:[function(t,e){var l=t("./type"),u=t("./prune"),c=t("./clockwise"),h=t("./coordinate-systems"),p=t("../../");function d(){}e.exports=function(o,t){var r,a=null,e=!0;t&&("coordinate-system"in t&&(a=h[t["coordinate-system"]]),"minimum-area"in t&&(r=+t["minimum-area"]),"force-clockwise"in t&&(e=!!t["force-clockwise"])),e&&c(o,t),0<r||(r=Number.MIN_VALUE);var i=l({LineString:d,MultiLineString:d,Point:d,MultiPoint:d,Polygon:function(t){t.arcs=t.arcs.filter(s),t.arcs.length||(t.type=null,delete t.arcs)},MultiPolygon:function(t){t.arcs=t.arcs.map(function(t){return t.filter(s)}).filter(function(t){return t.length}),t.arcs.length||(t.type=null,delete t.arcs)},GeometryCollection:function(t){this.defaults.GeometryCollection.call(this,t),t.geometries=t.geometries.filter(function(t){return null!=t.type}),t.geometries.length||(t.type=null,delete t.geometries)}});for(var n in o.objects)i.object(o.objects[n]);function s(t){var e={type:"Polygon",arcs:[t]},i=p.feature(o,e).geometry.coordinates[0],n=a.absoluteArea(a.ringArea(i));return r<=n}u(o,t)}},{"../../":10,"./clockwise":14,"./coordinate-systems":16,"./prune":21,"./type":36}],19:[function(t,e){e.exports=function(t){function e(t){var e=t.geometry;return null==e?t.type=null:(o(e),t.type=e.type,e.geometries?t.geometries=e.geometries:e.coordinates&&(t.coordinates=e.coordinates)),delete t.geometry,t}function o(t){return t?(r.hasOwnProperty(t.type)&&r[t.type](t),t):{type:null}}var i,n={Feature:e,FeatureCollection:function(t){return t.type="GeometryCollection",t.geometries=t.features,t.features.forEach(e),delete t.features,t}},r={GeometryCollection:function(t){for(var e=t.geometries,i=-1,n=e.length;++i<n;)e[i]=o(e[i])},MultiPoint:function(t){t.coordinates.length?t.coordinates.length<2&&(t.type="Point",t.coordinates=t.coordinates[0]):(t.type=null,delete t.coordinates)},LineString:function(t){t.coordinates.length||(t.type=null,delete t.coordinates)},MultiLineString:function(t){for(var e=t.coordinates,i=0,n=0,o=e.length;i<o;++i){var r=e[i];r.length&&(e[n++]=r)}n?n<2?(t.type="LineString",t.coordinates=e[0]):t.coordinates.length=n:(t.type=null,delete t.coordinates)},Polygon:function(t){for(var e=t.coordinates,i=0,n=0,o=e.length;i<o;++i){var r=e[i];r.length&&(e[n++]=r)}n?t.coordinates.length=n:(t.type=null,delete t.coordinates)},MultiPolygon:function(t){for(var e=t.coordinates,i=0,n=0,o=e.length;i<o;++i){for(var r=e[i],a=0,s=0,l=r.length;a<l;++a){var u=r[a];u.length&&(r[s++]=u)}s&&(r.length=s,e[n++]=r)}n?n<2?(t.type="Polygon",t.coordinates=e[0]):e.length=n:(t.type=null,delete t.coordinates)}};for(var a in t)t[a]=((i=t[a])&&n.hasOwnProperty(i.type)?n[i.type]:o)(i);return t}},{}],20:[function(t,e){e.exports=function(t,c){function o(t){return t?(e.hasOwnProperty(t.type)&&e[t.type](t),t):{type:null}}var e={GeometryCollection:function(t){for(var e=t.geometries,i=-1,n=e.length;++i<n;)e[i]=o(e[i])},Polygon:function(t){for(var e=t.coordinates,i=0,n=0,o=e.length;i<o;++i){var r=e[i];c(r)&&(e[n++]=r)}n?t.coordinates.length=n:(t.type=null,delete t.coordinates)},MultiPolygon:function(t){for(var e=t.coordinates,i=0,n=0,o=e.length;i<o;++i){for(var r=e[i],a=0,s=0,l=r.length;a<l;++a){var u=r[a];c(u)&&(r[s++]=u)}s&&(r.length=s,e[n++]=r)}n?n<2?(t.type="Polygon",t.coordinates=e[0]):e.length=n:(t.type=null,delete t.coordinates)}};for(var i in t)t[i]=o(t[i]);return t}},{}],21:[function(t,e){e.exports=function(t,e){var i=!1,n=t.objects,l=t.arcs,o=l.length,u=t.arcs=[],c=0,h=new Array(l.length);function r(t){t&&a.hasOwnProperty(t.type)&&a[t.type](t)}e&&"verbose"in e&&(i=!!e.verbose);var a={GeometryCollection:function(t){t.geometries.forEach(r)},LineString:function(t){s(t.arcs)},MultiLineString:function(t){t.arcs.forEach(s)},Polygon:function(t){t.arcs.forEach(s)},MultiPolygon:function(t){t.arcs.forEach(p)}};function s(t){for(var e=0,i=0,n=t.length;e<n;++e){var o,r=t[e],a=r<0&&(r=~r,!0),s=l[r];s.length<3&&!s[1][0]&&!s[1][1]||(null==(o=h[r])&&(h[r]=o=c++,u[o]=l[r]),t[i++]=a?~o:o)}!(t.length=i)&&n&&(null==(o=h[r])&&(h[r]=o=c++,u[o]=l[r]),t[0]=a?~o:o)}function p(t){t.forEach(s)}for(var d in n)r(n[d]);return i&&console.warn("prune: retained "+c+" / "+o+" arcs ("+Math.round(c/o*100)+"%)"),t}},{}],22:[function(t,e){e.exports=function(t,e,i){var c=isFinite(e[0])?e[0]:0,h=isFinite(e[1])?e[1]:0,n=isFinite(e[2])?e[2]:0,o=isFinite(e[3])?e[3]:0,p=n-c?(i-1)/(n-c):1,d=o-h?(i-1)/(o-h):1;function r(t){t&&a.hasOwnProperty(t.type)&&a[t.type](t)}var a={GeometryCollection:function(t){t.geometries.forEach(r)},Point:function(t){s(t.coordinates)},MultiPoint:function(t){t.coordinates.forEach(s)},LineString:function(t){var e=t.coordinates;l(e),e.length<2&&(e[1]=e[0])},MultiLineString:function(t){for(var e=t.coordinates,i=0,n=e.length;i<n;++i){var o=e[i];l(o),o.length<2&&(o[1]=o[0])}},Polygon:function(t){for(var e=t.coordinates,i=0,n=e.length;i<n;++i){var o=e[i];for(l(o);o.length<4;)o.push(o[0])}},MultiPolygon:function(t){for(var e=t.coordinates,i=0,n=e.length;i<n;++i)for(var o=e[i],r=0,a=o.length;r<a;++r){var s=o[r];for(l(s);s.length<4;)s.push(s[0])}}};function s(t){t[0]=Math.round((t[0]-c)*p),t[1]=Math.round((t[1]-h)*d)}function l(t){for(var e,i,n,o=0,r=1,a=t.length,s=t[0],l=s[0]=Math.round((s[0]-c)*p),u=s[1]=Math.round((s[1]-h)*d);++o<a;)s=t[o],i=Math.round((s[0]-c)*p),n=Math.round((s[1]-h)*d),i===l&&n===u||((e=t[r++])[0]=l=i,e[1]=u=n);t.length=r}for(var u in t)r(t[u]);return{scale:[1/p,1/d],translate:[c,h]}}},{}],23:[function(t,e){var u=t("../../"),c=t("./coordinate-systems");e.exports=function(t,e){var i,l=0,n=!1,o=null,r=t.arcs.reduce(function(t,e){return t+e.length},0),a=0;if(e&&("minimum-area"in e&&(l=+e["minimum-area"]),"coordinate-system"in e&&(o=c[e["coordinate-system"]]),"retain-proportion"in e&&(i=+e["retain-proportion"]),"verbose"in e&&(n=!!e.verbose)),u.presimplify(t,o.triangleArea),i){var s=[];t.arcs.forEach(function(t){t.forEach(function(t){s.push(t[2])})}),e["minimum-area"]=l=r?s.sort(function(t,e){return e-t})[Math.ceil((r-1)*i)]:0,n&&console.warn("simplification: effective minimum area "+l.toPrecision(3))}return t.arcs.forEach(t.transform?function(t){for(var e,i,n=0,o=0,r=-1,a=-1,s=t.length;++r<s;)(e=t[r])[2]>=l?((i=t[++a])[0]=e[0]+n,i[1]=e[1]+o,n=o=0):(n+=e[0],o+=e[1]);t.length=++a}:function(t){for(var e,i=-1,n=-1,o=t.length;++i<o;)(e=t[i])[2]>=l&&(t[++n]=e);t.length=++n}),t.arcs.forEach(function(t){for(var e=-1,i=t.length;++e<i;)t[e].length=2;a+=t.length}),n&&console.warn("simplification: retained "+a+" / "+r+" points ("+Math.round(a/r*100)+"%)"),t}},{"../../":10,"./coordinate-systems":16}],24:[function(t,e,i){var _=Math.PI,g=_/4,y=_/180;function r(t,e){var i,n=(e[0]-t[0])*y,o=Math.sin(n),r=Math.cos(n),a=Math.sin(t[1]*y),s=Math.cos(t[1]*y),l=Math.sin(e[1]*y),u=Math.cos(e[1]*y);return Math.atan2(Math.sqrt((i=u*o)*i+(i=s*l-a*u*r)*i),a*l+s*u*r)}function o(t){return(t=Math.sin(t/2))*t}i.name="spherical",i.formatDistance=function(t){var e=6371*t;return(1<e?e.toFixed(3)+"km":(1e3*e).toPrecision(3)+"m")+" ("+(180*t/Math.PI).toPrecision(3)+"°)"},i.ringArea=function(t){if(!t.length)return 0;for(var e=0,i=t[0],n=i[0]*y,o=i[1]*y/2+g,r=n,a=Math.cos(o),s=Math.sin(o),l=1,u=t.length;l<u;++l){i=t[l],n=i[0]*y,o=i[1]*y/2+g;var c=n-r,h=Math.cos(o),p=Math.sin(o),d=s*p,f=a*h+d*Math.cos(c),m=d*Math.sin(c);e+=Math.atan2(m,f),r=n,a=h,s=p}return 2*(_<e?e-2*_:e<-_?e+2*_:e)},i.absoluteArea=function(t){return t<0?t+4*_:t},i.triangleArea=function(t){var e=r(t[0],t[1]),i=r(t[1],t[2]),n=r(t[2],t[0]),o=(e+i+n)/2;return 4*Math.atan(Math.sqrt(Math.max(0,Math.tan(o/2)*Math.tan((o-e)/2)*Math.tan((o-i)/2)*Math.tan((o-n)/2))))},i.distance=function(t,e,i,n){return t*=y,e*=y,i*=y,n*=y,2*Math.asin(Math.sqrt(o(n-e)+Math.cos(e)*Math.cos(n)*o(i-t)))}},{}],25:[function(t,e){var p=t("./type");e.exports=function(t,e){var i=-180,L=i+.01,n=180,k=n-.01,o=-90,T=o+.01,r=90,E=r-.01;if(e){var a=e.scale[0],s=e.scale[1],l=e.translate[0],u=e.translate[1];i=Math.round((i-l)/a),n=Math.round((n-l)/a),o=Math.round((o-u)/s),r=Math.round((r-u)/s),L=Math.round((L-l)/a),k=Math.round((k-l)/a),T=Math.round((T-u)/s),E=Math.round((E-u)/s)}function M(t){return t<=T?[0,o]:E<=t?[0,r]:[i,t]}var c=p({polygon:function(t){for(var e=[],i=0,n=t.length;i<n;++i){var o=t[i],r=[];r.push(o);for(var a=0,s=o.length;a<s;++a){var l=o[a],u=l[0],c=l[1];if(u<=L||k<=u||c<=T||E<=c){for(var h=a+1;h<s;++h){var p=o[h],d=p[0],f=p[1];if(L<d&&d<k&&T<f&&f<E)break}if(h===a+1)continue;if(a){var m=o.slice(0,a+1);m[m.length-1]=M(c),r[r.length-1]=m}else r.pop();if(s<=h)break;r.push(o=o.slice(h-1)),o[0]=M(o[0][1]),a=-1,s=o.length}}var _={},g={};for(a=0,s=r.length;a<s;++a){var y=(x=r[a])[0],v=x[x.length-1];y[0]!==v[0]||y[1]!==v[1]?(x.index=a,_[y]=g[v]=x):(e.push(x),r[a]=null)}for(a=0;a<s;++a){var x;if(x=r[a]){y=x[0],v=x[x.length-1];var b=g[y],w=_[v];if(delete _[y],delete g[v],y[0]===v[0]&&y[1]===v[1]){e.push(x);continue}b?(delete g[y],delete _[b[0]],b.pop(),r[b.index]=null,x=b.concat(x),b===w?e.push(x):(x.index=s++,r.push(_[x[0]]=g[x[x.length-1]]=x))):w?(delete _[v],delete g[w[w.length-1]],x.pop(),(x=x.concat(w)).index=s++,r[w.index]=null,r.push(_[x[0]]=g[x[x.length-1]]=x)):(x.push(x[0]),e.push(x))}}}for(a=0,s=t.length=e.length;a<s;++a)t[a]=e[a]}});for(var h in t)c.object(t[h])}},{"./type":36}],26:[function(t,e){t("./type");var d=t("./stitch"),f=t("./coordinate-systems"),m=t("./topology/index"),_=t("./delta"),g=t("./geomify"),y=t("./prefilter"),v=t("./quantize"),x=t("./bounds"),b=t("./compute-id"),w=t("./transform-properties");e.exports=function(t,e){var i,n=1e4,o=function(t){return t.id},r=function(){},a=0,s=!0,l=!1,u=null;e&&("verbose"in e&&(l=!!e.verbose),"stitch-poles"in e&&(s=!!e["stitch-poles"]),"coordinate-system"in e&&(u=f[e["coordinate-system"]]),"minimum-area"in e&&(a=+e["minimum-area"]),"quantization"in e&&(n=+e.quantization),"id"in e&&(o=e.id),"property-transform"in e&&(r=e["property-transform"])),b(t,o),w(t,r),g(t);var c=x(t),h=c[0]<-180-1e-6||c[1]<-90-1e-6||c[2]>180+1e-6||c[3]>90+1e-6;if(u||(u=f[h?"cartesian":"spherical"],e&&(e["coordinate-system"]=u.name)),u===f.spherical){if(h)throw new Error("spherical coordinates outside of [±180°, ±90°]");c[0]<1e-6-180&&(c[0]=-180),c[1]<1e-6-90&&(c[1]=-90),c[2]>180-1e-6&&(c[2]=180),c[3]>90-1e-6&&(c[3]=90)}l&&console.warn("bounds: "+c.join(" ")+" ("+u.name+")"),a&&y(t,function(t){return u.absoluteArea(u.ringArea(t))>=a}),n&&(i=v(t,c,n),l&&console.warn("quantization: "+i.scale.map(function(t){return u.formatDistance(t/180*Math.PI)}).join(" "))),u===f.spherical&&s&&d(t,i);var p=m(t);return p.bbox=c,l&&console.warn("topology: "+p.arcs.length+" arcs, "+p.arcs.reduce(function(t,e){return t+e.length},0)+" points"),n&&(p.transform=i,_(p)),p}},{"./bounds":12,"./compute-id":15,"./coordinate-systems":16,"./delta":17,"./geomify":19,"./prefilter":20,"./quantize":22,"./stitch":25,"./topology/index":31,"./transform-properties":35,"./type":36}],27:[function(t,e){var _=t("./join");function g(t,e,i,n){o(t,e,i),o(t,e,e+n),o(t,e+n,i)}function o(t,e,i){for(var n,o=e+(i---e>>1);e<o;++e,--i)n=t[e],t[e]=t[i],t[i]=n}e.exports=function(t){for(var e=_(t),i=t.coordinates,n=t.lines,o=t.rings,r=0,a=n.length;r<a;++r)for(var s=n[r],l=s[0],u=s[1];++l<u;)if(e.get(i[l])){var c={0:l,1:s[1]};s[1]=l,s=s.next=c}for(r=0,a=o.length;r<a;++r)for(var h=o[r],p=h[0],d=p,f=h[1],m=e.get(i[p]);++d<f;)if(e.get(i[d]))if(m){c={0:d,1:h[1]};h[1]=d,h=h.next=c}else g(i,p,f,f-d),i[f]=i[p],m=!0,d=p;return t}},{"./join":32}],28:[function(t,e){t("./join");var y=t("./hashtable"),v=t("./point-hash"),x=t("./point-equal");e.exports=function(t){var c=t.coordinates,e=t.lines,i=t.rings,n=e.length+i.length;delete t.lines,delete t.rings;for(var o=0,r=e.length;o<r;++o)for(var a=e[o];a=a.next;)++n;for(o=0,r=i.length;o<r;++o)for(var s=i[o];s=s.next;)++n;var u=y(2*n,v,x),h=t.arcs=[];for(o=0,r=e.length;o<r;++o)for(a=e[o];l(a),a=a.next;);for(o=0,r=i.length;o<r;++o){if((s=i[o]).next)for(;l(s),s=s.next;);else p(s)}function l(t){var e,i,n,o;if(n=u.get(e=c[t[0]]))for(var r=0,a=n.length;r<a;++r){var s=n[r];if(d(s,t))return t[0]=s[0],void(t[1]=s[1])}if(o=u.get(i=c[t[1]]))for(r=0,a=o.length;r<a;++r){var l=o[r];if(f(l,t))return t[1]=l[0],void(t[0]=l[1])}n?n.push(t):u.set(e,[t]),o?o.push(t):u.set(i,[t]),h.push(t)}function p(t){var e,i;if(i=u.get(c[t[0]]))for(var n=0,o=i.length;n<o;++n){if(m(r=i[n],t))return t[0]=r[0],void(t[1]=r[1]);if(_(r,t))return t[0]=r[1],void(t[1]=r[0])}if(i=u.get(e=c[t[0]+g(t)]))for(n=0,o=i.length;n<o;++n){var r;if(m(r=i[n],t))return t[0]=r[0],void(t[1]=r[1]);if(_(r,t))return t[0]=r[1],void(t[1]=r[0])}i?i.push(t):u.set(e,[t]),h.push(t)}function d(t,e){var i=t[0],n=e[0],o=t[1];if(i-o!=n-e[1])return!1;for(;i<=o;++i,++n)if(!x(c[i],c[n]))return!1;return!0}function f(t,e){var i=t[0],n=e[0],o=t[1],r=e[1];if(i-o!=n-r)return!1;for(;i<=o;++i,--r)if(!x(c[i],c[r]))return!1;return!0}function m(t,e){var i=t[0],n=e[0],o=t[1]-i;if(o!=e[1]-n)return!1;for(var r=g(t),a=g(e),s=0;s<o;++s)if(!x(c[i+(s+r)%o],c[n+(s+a)%o]))return!1;return!0}function _(t,e){var i=t[0],n=e[0],o=t[1],r=e[1],a=o-i;if(a!=r-n)return!1;for(var s=g(t),l=a-g(e),u=0;u<a;++u)if(!x(c[i+(u+s)%a],c[r-(u+l)%a]))return!1;return!0}function g(t){for(var e=t[0],i=t[1],n=e,o=n,r=c[n];++n<i;){var a=c[n];(a[0]<r[0]||a[0]===r[0]&&a[1]<r[1])&&(o=n,r=a)}return o-e}return t}},{"./hashtable":30,"./join":32,"./point-equal":33,"./point-hash":34}],29:[function(t,e){e.exports=function(t){var o=-1,r=[],a=[],s=[];function e(t){t&&i.hasOwnProperty(t.type)&&i[t.type](t)}var i={GeometryCollection:function(t){t.geometries.forEach(e)},LineString:function(t){t.arcs=n(t.coordinates),delete t.coordinates},MultiLineString:function(t){t.arcs=t.coordinates.map(n),delete t.coordinates},Polygon:function(t){t.arcs=t.coordinates.map(l),delete t.coordinates},MultiPolygon:function(t){t.arcs=t.coordinates.map(u),delete t.coordinates}};function n(t){for(var e=0,i=t.length;e<i;++e)s[++o]=t[e];var n={0:o-i+1,1:o};return r.push(n),n}function l(t){for(var e=0,i=t.length;e<i;++e)s[++o]=t[e];var n={0:o-i+1,1:o};return a.push(n),n}function u(t){return t.map(l)}for(var c in t)e(t[c]);return{type:"Topology",coordinates:s,lines:r,rings:a,objects:t}}},{}],30:[function(t,e){e.exports=function(t,r,a){var s=new Array(t=1<<Math.ceil(Math.log(t)/Math.LN2)),l=t-1;function o(t,e){for(var i=r(t)&l,n=s[i],o=!i;null!=n;){if(a(n.key,t))return n.value=e;if(n=s[i=i+1&l],!i&&o++)throw new Error("full hashtable")}return s[i]={key:t,value:e},0,e}return{set:o,get:function(t,e){for(var i=r(t)&l,n=s[i],o=!i;null!=n;){if(a(n.key,t))return n.value;if(n=s[i=i+1&l],!i&&o++)break}return e},remove:function(t){for(var e=r(t)&l,i=s[e],n=!e;null!=i;){if(a(i.key,t))return(s[e]=null)!=(i=s[e=e+1&l])&&(0,s[e]=null,o(i.key,i.value)),0,!0;if(i=s[e=e+1&l],!e&&n++)break}return!1},keys:function(){for(var t=[],e=0,i=s.length;e<i;++e){var n=s[e];null!=n&&t.push(n.key)}return t}}}},{}],31:[function(t,e){var u=t("./hashtable"),c=t("./extract"),h=t("./cut"),p=t("./dedup");function d(t){var e,i=t[0],n=t[1];return n<i&&(e=i,i=n,n=e),i+31*n}function f(t,e){var i,n=t[0],o=t[1],r=e[0],a=e[1];return o<n&&(i=n,n=o,o=i),a<r&&(i=r,r=a,a=i),n===r&&o===a}e.exports=function(t){var e=p(h(c(t))),i=e.coordinates,n=u(e.arcs.length,d,f);function o(t){t&&r.hasOwnProperty(t.type)&&r[t.type](t)}t=e.objects,e.arcs=e.arcs.map(function(t,e){return n.set(t,e),i.slice(t[0],t[1]+1)}),delete e.coordinates,i=null;var r={GeometryCollection:function(t){t.geometries.forEach(o)},LineString:function(t){t.arcs=a(t.arcs)},MultiLineString:function(t){t.arcs=t.arcs.map(a)},Polygon:function(t){t.arcs=t.arcs.map(a)},MultiPolygon:function(t){t.arcs=t.arcs.map(s)}};function a(t){var e=[];do{var i=n.get(t);e.push(t[0]<t[1]?i:~i)}while(t=t.next);return e}function s(t){return t.map(a)}for(var l in t)o(t[l]);return e}},{"./cut":27,"./dedup":28,"./extract":29,"./hashtable":30}],32:[function(t,e){var v=t("./hashtable"),x=t("./point-hash"),b=t("./point-equal");e.exports=function(t){for(var o,e=t.coordinates,i=t.lines,n=t.rings,r=v(e.length,x,b),a=v(e.length,x,b),s=0,l=i.length;s<l;++s){var u=i[s],c=u[0],h=u[1],p=null,d=e[c],f=e[++c];for(o=v(h-c,x,b),a.set(d,!0);++c<=h;)y(p=d,d=f,f=e[c]);a.set(f,!0)}for(s=0,l=n.length;s<l;++s){var m=n[s],_=m[0]+1,g=m[1];p=e[g-1],d=e[_-1],f=e[_];for(o=v(g-_+1,x,b),y(p,d,f);++_<=g;)y(p=d,d=f,f=e[_])}function y(t,e,i){if(!o.get(e)){o.set(e,!0);var n=r.get(e);n?b(n[0],t)&&b(n[1],i)||b(n[0],i)&&b(n[1],t)||a.set(e,!0):r.set(e,[t,i])}}return a}},{"./hashtable":30,"./point-equal":33,"./point-hash":34}],33:[function(t,e){e.exports=function(t,e){return t[0]===e[0]&&t[1]===e[1]}},{}],34:[function(t,e){var i=new ArrayBuffer(8),n=new Float64Array(i),o=new Int32Array(i);function r(t){return n[0]=t,t=o[1]^o[0],t^=t>>>20^t>>>12,t^=t>>>7^t>>>4}e.exports=function(t){var e=r(t[0])+31*r(t[1])|0;return e<0?~e:e}},{}],35:[function(t,e){e.exports=function(t,r){function e(t){if(t.properties){var e=t.properties,i={},n=!0;for(var o in e)r(i,o,e[o])&&(n=!1);n?delete t.properties:t.properties=i}}arguments.length<2&&(r=function(){});var i,n={Feature:e,FeatureCollection:function(t){t.features.forEach(e)}};for(var o in t)(i=t[o])&&n.hasOwnProperty(i.type)&&n[i.type](i);return t}},{}],36:[function(t,e){e.exports=function(t){for(var e in i)e in t||(t[e]=i[e]);return t.defaults=i,t};var i={Feature:function(t){t.geometry&&this.geometry(t.geometry)},FeatureCollection:function(t){for(var e=t.features,i=-1,n=e.length;++i<n;)this.Feature(e[i])},GeometryCollection:function(t){for(var e=t.geometries,i=-1,n=e.length;++i<n;)this.geometry(e[i])},LineString:function(t){this.line(t.coordinates)},MultiLineString:function(t){for(var e=t.coordinates,i=-1,n=e.length;++i<n;)this.line(e[i])},MultiPoint:function(t){for(var e=t.coordinates,i=-1,n=e.length;++i<n;)this.point(e[i])},MultiPolygon:function(t){for(var e=t.coordinates,i=-1,n=e.length;++i<n;)this.polygon(e[i])},Point:function(t){this.point(t.coordinates)},Polygon:function(t){this.polygon(t.coordinates)},object:function(t){return null==t?null:o.hasOwnProperty(t.type)?this[t.type](t):this.geometry(t)},geometry:function(t){return null==t?null:n.hasOwnProperty(t.type)?this[t.type](t):null},point:function(){},line:function(t){for(var e=-1,i=t.length;++e<i;)this.point(t[e])},polygon:function(t){for(var e=-1,i=t.length;++e<i;)this.line(t[e])}},n={LineString:1,MultiLineString:1,MultiPoint:1,MultiPolygon:1,Point:1,Polygon:1,GeometryCollection:1},o={Feature:1,FeatureCollection:1}},{}],37:[function(t,e){!function(){var t={version:"1.4.6",mesh:function(t,e,i){var n=[];if(1<arguments.length){var o,r=[];function a(t){t<0&&(t=~t),(r[t]||(r[t]=[])).push(o)}function s(t){t.forEach(a)}function l(t){t.forEach(s)}var u={LineString:s,MultiLineString:l,Polygon:l,MultiPolygon:function(t){t.forEach(l)}};!function t(e){"GeometryCollection"===e.type?e.geometries.forEach(t):e.type in u&&u[(o=e).type](e.arcs)}(e),r.forEach(arguments.length<3?function(t,e){n.push(e)}:function(t,e){i(t[0],t[t.length-1])&&n.push(e)})}else for(var c=0,h=t.arcs.length;c<h;++c)n.push(c);return p(t,{type:"MultiLineString",arcs:function(l,t){var u={},c={};t.forEach(function(t){var e,i,n=function(t){var e=l.arcs[t],i=e[0],n=[0,0];return e.forEach(function(t){n[0]+=t[0],n[1]+=t[1]}),[i,n]}(t),o=n[0],r=n[1];if(e=c[o])if(delete c[e.end],e.push(t),e.end=r,i=u[r]){delete u[i.start];var a=i===e?e:e.concat(i);u[a.start=e.start]=c[a.end=i.end]=a}else if(i=c[r]){delete u[i.start],delete c[i.end];a=e.concat(i.map(function(t){return~t}).reverse());u[a.start=e.start]=c[a.end=i.start]=a}else u[e.start]=c[e.end]=e;else if(e=u[r])if(delete u[e.start],e.unshift(t),e.start=o,i=c[o]){delete c[i.end];var s=i===e?e:i.concat(e);u[s.start=i.start]=c[s.end=e.end]=s}else if(i=u[o]){delete u[i.start],delete c[i.end];s=i.map(function(t){return~t}).reverse().concat(e);u[s.start=i.end]=c[s.end=e.end]=s}else u[e.start]=c[e.end]=e;else if(e=u[o])if(delete u[e.start],e.unshift(~t),e.start=r,i=c[r]){delete c[i.end];s=i===e?e:i.concat(e);u[s.start=i.start]=c[s.end=e.end]=s}else if(i=u[r]){delete u[i.start],delete c[i.end];s=i.map(function(t){return~t}).reverse().concat(e);u[s.start=i.end]=c[s.end=e.end]=s}else u[e.start]=c[e.end]=e;else if(e=c[r])if(delete c[e.end],e.push(~t),e.end=o,i=c[o]){delete u[i.start];a=i===e?e:e.concat(i);u[a.start=e.start]=c[a.end=i.end]=a}else if(i=u[o]){delete u[i.start],delete c[i.end];a=e.concat(i.map(function(t){return~t}).reverse());u[a.start=e.start]=c[a.end=i.start]=a}else u[e.start]=c[e.end]=e;else u[(e=[t]).start=o]=c[e.end=r]=e});var e=[];for(var i in c)e.push(c[i]);return e}(t,n)})},feature:function(e,t){return"GeometryCollection"===t.type?{type:"FeatureCollection",features:t.geometries.map(function(t){return i(e,t)})}:i(e,t)},neighbors:function(t){var n={},e=t.map(function(){return[]});function i(t,i){t.forEach(function(t){t<0&&(t=~t);var e=n[t];e?e.push(i):n[t]=[i]})}function o(t,e){t.forEach(function(t){i(t,e)})}var r={LineString:i,MultiLineString:o,Polygon:o,MultiPolygon:function(t,e){t.forEach(function(t){o(t,e)})}};for(var a in t.forEach(function e(t,i){"GeometryCollection"===t.type?t.geometries.forEach(function(t){e(t,i)}):t.type in r&&r[t.type](t.arcs,i)}),n)for(var s=n[a],l=s.length,u=0;u<l;++u)for(var c=u+1;c<l;++c){var h,p=s[u],d=s[c];(h=e[p])[a=f(h,d)]!==d&&h.splice(a,0,d),(h=e[d])[a=f(h,p)]!==p&&h.splice(a,0,p)}return e},presimplify:function(t,o){var r,a=d(t.transform),e=function(t){if(!t)return m;var o,r,a=t.scale[0],s=t.scale[1],l=t.translate[0],u=t.translate[1];return function(t,e){e||(o=r=0);var i=(t[0]-l)/a|0,n=(t[1]-u)/s|0;t[0]=i-o,t[1]=n-r,o=i,r=n}}(t.transform),s=function(a){var t={},s=[];function n(t){for(var e=s[t];0<t;){var i=(t+1>>1)-1,n=s[i];if(0<=a(e,n))break;s[n.index=t]=n,s[e.index=t=i]=e}}function o(t){for(var e=s[t];;){var i=t+1<<1,n=i-1,o=t,r=s[o];if(n<s.length&&a(s[n],r)<0&&(r=s[o=n]),i<s.length&&a(s[i],r)<0&&(r=s[o=i]),o===t)break;s[r.index=t]=r,s[e.index=t=o]=e}}return t.push=function(){for(var t=0,e=arguments.length;t<e;++t){var i=arguments[t];n(i.index=s.push(i)-1)}return s.length},t.pop=function(){var t=s[0],e=s.pop();return s.length&&(s[e.index=0]=e,o(0)),t},t.remove=function(t){var e=t.index,i=s.pop();return e!==s.length&&(s[i.index=e]=i,(a(i,t)<0?n:o)(e)),e},t}(h),i=0;o||(o=c);t.arcs.forEach(function(t){var e=[];t.forEach(a);for(var i=1,n=t.length-1;i<n;++i)(r=t.slice(i-1,i+2))[1][2]=o(r),e.push(r),s.push(r);t[0][2]=t[n][2]=1/0;for(i=0,n=e.length;i<n;++i)(r=e[i]).previous=e[i-1],r.next=e[i+1]});for(;r=s.pop();){var n=r.previous,l=r.next;r[1][2]<i?r[1][2]=i:i=r[1][2],n&&(n.next=l,n[2]=r[2],u(n)),l&&(l.previous=n,l[0]=r[0],u(l))}function u(t){s.remove(t),t[1][2]=o(t),s.push(t)}return t.arcs.forEach(function(t){t.forEach(e)}),t}};function i(t,e){var i={type:"Feature",id:e.id,properties:e.properties||{},geometry:p(t,e)};return null==e.id&&delete i.id,i}function p(t,e){var a=d(t.transform),s=t.arcs;function o(t,e){e.length&&e.pop();for(var i,n=s[t<0?~t:t],o=0,r=n.length;o<r;++o)e.push(i=n[o].slice()),a(i,o);t<0&&function(t,e){var i,n=t.length,o=n-e;for(;o<--n;)i=t[o],t[o++]=t[n],t[n]=i}(e,r)}function i(t){return t=t.slice(),a(t,0),t}function n(t){for(var e=[],i=0,n=t.length;i<n;++i)o(t[i],e);return e.length<2&&e.push(e[0].slice()),e}function r(t){for(var e=n(t);e.length<4;)e.push(e[0].slice());return e}function l(t){return t.map(r)}var u={Point:function(t){return i(t.coordinates)},MultiPoint:function(t){return t.coordinates.map(i)},LineString:function(t){return n(t.arcs)},MultiLineString:function(t){return t.arcs.map(n)},Polygon:function(t){return l(t.arcs)},MultiPolygon:function(t){return t.arcs.map(l)}};return function t(e){var i=e.type;return"GeometryCollection"===i?{type:i,geometries:e.geometries.map(t)}:i in u?{type:i,coordinates:u[i](e)}:null}(e)}function f(t,e){for(var i=0,n=t.length;i<n;){var o=i+n>>>1;t[o]<e?i=1+o:n=o}return i}function c(t){return Math.abs((t[0][0]-t[2][0])*(t[1][1]-t[0][1])-(t[0][0]-t[1][0])*(t[2][1]-t[0][1]))}function h(t,e){return t[1][2]-e[1][2]}function d(t){if(!t)return m;var i,n,o=t.scale[0],r=t.scale[1],a=t.translate[0],s=t.translate[1];return function(t,e){e||(i=n=0),t[0]=(i+=t[0])*o+a,t[1]=(n+=t[1])*r+s}}function m(){}"object"==typeof e&&e.exports?e.exports=t:this.topojson=t}()},{}],38:[function(t,e){e.exports=function(i){var n=0;function o(t){var e=i.substring(n).match(t);return e?(n+=e[0].length,e[0]):null}function r(){o(/^\s*/)}function e(){r();for(var t,e=0,i=[],n=i;t=o(/^(\()/)||o(/^(\))/)||o(/^(\,)/)||a();){if("("==t)e++;else if(")"==t){if(0==--e)break}else t&&Array.isArray(t)&&t.length&&n.push(t);r()}return 0!==e?null:i}function a(){for(var t,e,i=[];e=o(/^[-+]?([0-9]*\.[0-9]+|[0-9]+)/)||o(/^(\,)/);)","==e?(i.push(t),t=[]):(t||(t=[]),t.push(parseFloat(e))),r();return t&&i.push(t),i.length?i:null}function s(){return function(){if(!o(/^(point)/i))return null;if(r(),!o(/^(\()/))return null;var t=a();return r(),o(/^(\))/)?{type:"Point",coordinates:t[0]}:null}()||function(){if(!o(/^(linestring)/i))return null;if(r(),!o(/^(\()/))return null;var t=a();return o(/^(\))/)?{type:"LineString",coordinates:t}:null}()||(o(/^(polygon)/i)?(r(),{type:"Polygon",coordinates:e()}):null)||function(){if(!o(/^(multipoint)/i))return null;r();var t=e();return r(),{type:"MultiPoint",coordinates:t[0]}}()||function(){if(!o(/^(multilinestring)/i))return null;r();var t=e();return r(),{type:"MultiLineString",coordinates:t}}()||(o(/^(multipolygon)/i)?(r(),{type:"MultiPolygon",coordinates:e()}):null)||function(){var t,e=[];if(!o(/^(geometrycollection)/i))return null;if(r(),!o(/^(\()/))return null;for(;t=s();)e.push(t),r(),o(/^(\,)/),r();return o(/^(\))/)?{type:"GeometryCollection",geometries:e}:null}()}return s()}},{}]},{},[1])(1)}),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define("leafletGestureHandling",["exports"],e):e(t.leafletGestureHandling={})}(this,function(t){"use strict";var o={ar:{touch:"استخدم إصبعين لتحريك الخريطة",scroll:"استخدم ctrl + scroll لتصغير/تكبير الخريطة",scrollMac:"يمكنك استخدام ⌘ + التمرير لتكبير/تصغير الخريطة"},de:{touch:"Verschieben der Karte mit zwei Fingern",scroll:"Verwende Strg+Scrollen zum Zoomen der Karte",scrollMac:"⌘"},en:{touch:"Use two fingers to move the map",scroll:"Use ctrl + scroll to zoom the map",scrollMac:"Use ⌘ + scroll to zoom the map"},"en-AU":{touch:"Use two fingers to move the map",scroll:"Use ctrl + scroll to zoom the map",scrollMac:"Use ⌘ + scroll to zoom the map"},"en-GB":{touch:"Use two fingers to move the map",scroll:"Use ctrl + scroll to zoom the map",scrollMac:"Use ⌘ + scroll to zoom the map"},es:{touch:"Para mover el mapa, utiliza dos dedos",scroll:"Mantén pulsada la tecla Ctrl mientras te desplazas para acercar o alejar el mapa",scrollMac:"Mantén pulsada la tecla ⌘ mientras te desplazas para acercar o alejar el mapa"},fa:{touch:"برای حرکت دادن نقشه از دو انگشت استفاده کنید.",scroll:"برای بزرگنمایی نقشه از ctrl + scroll استفاده کنید.",scrollMac:"برای بزرگنمایی نقشه، از ⌘ + پیمایش استفاده کنید."},fr:{touch:"Utilisez deux doigts pour déplacer la carte",scroll:"Vous pouvez zoomer sur la carte à l'aide de CTRL+Molette de défilement",scrollMac:"Vous pouvez zoomer sur la carte à l'aide de ⌘+Molette de défilement"},it:{touch:"Utilizza due dita per spostare la mappa",scroll:"Utilizza CTRL + scorrimento per eseguire lo zoom della mappa",scrollMac:"Utilizza ⌘ + scorrimento per eseguire lo zoom della mappa"},ru:{touch:"Чтобы переместить карту, проведите по ней двумя пальцами",scroll:"Чтобы изменить масштаб, прокручивайте карту, удерживая клавишу Ctrl.",scrollMac:"Чтобы изменить масштаб, нажмите ⌘ + прокрутка"},tr:{touch:"Haritada gezinmek için iki parmağınızı kullanın",scroll:"Haritayı yakınlaştırmak için ctrl + kaydırma kombinasyonunu kullanın",scrollMac:"Haritayı yakınlaştırmak için ⌘ tuşuna basıp ekranı kaydırın"}};L.Map.mergeOptions({gestureHandlingOptions:{text:{},locale:"en",duration:1e3}});var e=!1,i=L.Handler.extend({addHooks:function(){this._handleTouch=this._handleTouch.bind(this),this._setupPluginOptions(),this._setLanguageContent(),this._disableInteractions(),this._map._container.addEventListener("touchstart",this._handleTouch),this._map._container.addEventListener("touchmove",this._handleTouch),this._map._container.addEventListener("touchend",this._handleTouch),this._map._container.addEventListener("touchcancel",this._handleTouch),this._map._container.addEventListener("click",this._handleTouch),L.DomEvent.on(this._map._container,"mousewheel",this._handleScroll,this),L.DomEvent.on(this._map,"mouseover",this._handleMouseOver,this),L.DomEvent.on(this._map,"mouseout",this._handleMouseOut,this),L.DomEvent.on(this._map,"movestart",this._handleDragging,this),L.DomEvent.on(this._map,"move",this._handleDragging,this),L.DomEvent.on(this._map,"moveend",this._handleDragging,this)},removeHooks:function(){this._enableInteractions(),this._map._container.removeEventListener("touchstart",this._handleTouch),this._map._container.removeEventListener("touchmove",this._handleTouch),this._map._container.removeEventListener("touchend",this._handleTouch),this._map._container.removeEventListener("touchcancel",this._handleTouch),this._map._container.removeEventListener("click",this._handleTouch),L.DomEvent.off(this._map._container,"mousewheel",this._handleScroll,this),L.DomEvent.off(this._map,"mouseover",this._handleMouseOver,this),L.DomEvent.off(this._map,"mouseout",this._handleMouseOut,this),L.DomEvent.off(this._map,"movestart",this._handleDragging,this),L.DomEvent.off(this._map,"move",this._handleDragging,this),L.DomEvent.off(this._map,"moveend",this._handleDragging,this)},_handleDragging:function(t){"movestart"==t.type||"move"==t.type?e=!0:"moveend"==t.type&&(e=!1)},_disableInteractions:function(){this._map.dragging.disable(),this._map.scrollWheelZoom.disable(),this._map.tap&&this._map.tap.disable()},_enableInteractions:function(){this._map.dragging.enable(),this._map.scrollWheelZoom.enable(),this._map.tap&&this._map.tap.enable()},_setupPluginOptions:function(){this._map.options.gestureHandlingText&&(this._map.options.gestureHandlingOptions.text=this._map.options.gestureHandlingText)},_setLanguageContent:function(){var t;if(this._map.options.gestureHandlingOptions&&this._map.options.gestureHandlingOptions.text&&this._map.options.gestureHandlingOptions.text.touch&&this._map.options.gestureHandlingOptions.text.scroll&&this._map.options.gestureHandlingOptions.text.scrollMac)t=this._map.options.gestureHandlingOptions.text;else{var e=this._getUserLanguage();e||(e="en"),o[e]&&(t=o[e]),t||-1===e.indexOf("-")||(e=e.split("-")[0],t=o[e]),t||(t=o[e="en"])}var i=!1;0<=navigator.platform.toUpperCase().indexOf("MAC")&&(i=!0);var n=t.scroll;i&&(n=t.scrollMac),this._map._container.setAttribute("data-gesture-handling-touch-content",t.touch),this._map._container.setAttribute("data-gesture-handling-scroll-content",n)},_getUserLanguage:function(){return this._map.options.gestureHandlingOptions.locale?this._map.options.gestureHandlingOptions.locale:navigator.languages?navigator.languages[0]:navigator.language||navigator.userLanguage},_handleTouch:function(t){for(var e=["leaflet-control-minimap","leaflet-interactive","leaflet-popup-content","leaflet-popup-content-wrapper","leaflet-popup-close-button","leaflet-control-zoom-in","leaflet-control-zoom-out"],i=!1,n=0;n<e.length;n++)L.DomUtil.hasClass(t.target,e[n])&&(i=!0);i?L.DomUtil.hasClass(t.target,"leaflet-interactive")&&"touchmove"===t.type&&1===t.touches.length?(L.DomUtil.addClass(this._map._container,"leaflet-gesture-handling-touch-warning"),this._disableInteractions()):L.DomUtil.removeClass(this._map._container,"leaflet-gesture-handling-touch-warning"):"touchmove"===t.type||"touchstart"===t.type?1===t.touches.length?(L.DomUtil.addClass(this._map._container,"leaflet-gesture-handling-touch-warning"),this._disableInteractions()):(this._enableInteractions(),L.DomUtil.removeClass(this._map._container,"leaflet-gesture-handling-touch-warning")):L.DomUtil.removeClass(this._map._container,"leaflet-gesture-handling-touch-warning")},_isScrolling:!1,_handleScroll:function(t){t.metaKey||t.ctrlKey?(t.preventDefault(),L.DomUtil.removeClass(this._map._container,"leaflet-gesture-handling-scroll-warning"),this._map.scrollWheelZoom.enable()):(L.DomUtil.addClass(this._map._container,"leaflet-gesture-handling-scroll-warning"),this._map.scrollWheelZoom.disable(),clearTimeout(this._isScrolling),this._isScrolling=setTimeout(function(){for(var t=document.getElementsByClassName("leaflet-gesture-handling-scroll-warning"),e=0;e<t.length;e++)L.DomUtil.removeClass(t[e],"leaflet-gesture-handling-scroll-warning")},this._map.options.gestureHandlingOptions.duration))},_handleMouseOver:function(){this._enableInteractions()},_handleMouseOut:function(){e||this._disableInteractions()}});L.Map.addInitHook("addHandler","gestureHandling",i),t.GestureHandling=i,t.default=i,Object.defineProperty(t,"__esModule",{value:!0})}),function(l){"use strict";var t,r,a=Array.prototype.slice;(r=function(t){this.options=l.extend({},r.defaults,t),this.parser=this.options.parser,this.locale=this.options.locale,this.messageStore=this.options.messageStore,this.languages={},this.init()}).prototype={init:function(){var s=this;String.locale=s.locale,String.prototype.toLocaleString=function(){var t,e,i,n,o,r,a;for(i=this.valueOf(),n=s.locale,o=0;n;){e=(t=n.split("-")).length;do{if(r=t.slice(0,e).join("-"),a=s.messageStore.get(r,i))return a;e--}while(e);if("en"===n)break;n=l.i18n.fallbacks[s.locale]&&l.i18n.fallbacks[s.locale][o]||s.options.fallbackLocale,l.i18n.log("Trying fallback locale for "+s.locale+": "+n+" ("+i+")"),o++}return""}},destroy:function(){l.removeData(document,"i18n")},load:function(t,e){var i,n,o,r={};if(t||e||(t="i18n/"+l.i18n().locale+".json",e=l.i18n().locale),"string"!=typeof t||"json"===t.split(".").pop())return this.messageStore.load(t,e);for(r[e]=t+"/"+e+".json",i=(l.i18n.fallbacks[e]||[]).concat(this.options.fallbackLocale),n=0;n<i.length;n++)r[o=i[n]]=t+"/"+o+".json";return this.load(r)},parse:function(t,e){var i=t.toLocaleString();return this.parser.language=l.i18n.languages[l.i18n().locale]||l.i18n.languages.default,""===i&&(i=t),this.parser.parse(i,e)}},l.i18n=function(t,e){var i,n=l.data(document,"i18n"),o="object"==typeof t&&t;return o&&o.locale&&n&&n.locale!==o.locale&&(String.locale=n.locale=o.locale),n||(n=new r(o),l.data(document,"i18n",n)),"string"==typeof t?(i=void 0!==e?a.call(arguments,1):[],n.parse(t,i)):n},l.fn.i18n=function(){var a=l.data(document,"i18n");return a||(a=new r,l.data(document,"i18n",a)),String.locale=a.locale,this.each(function(){var t,e,i,n,o=l(this),r=o.data("i18n");r?(t=r.indexOf("["),e=r.indexOf("]"),-1!==t&&-1!==e&&t<e?(i=r.slice(t+1,e),n=r.slice(e+1),"html"===i?o.html(a.parse(n)):o.attr(i,a.parse(n))):o.text(a.parse(r))):o.find("[data-i18n]").i18n()})},String.locale=String.locale||l("html").attr("lang"),String.locale||(window.navigator,t=window.navigator,String.locale=t.language||t.userLanguage||""),l.i18n.languages={},l.i18n.messageStore=l.i18n.messageStore||{},l.i18n.parser={parse:function(t,n){return t.replace(/\$(\d+)/g,function(t,e){var i=parseInt(e,10)-1;return void 0!==n[i]?n[i]:"$"+e})},emitter:{}},l.i18n.fallbacks={},l.i18n.debug=!1,l.i18n.log=function(){window.console&&l.i18n.debug&&window.console.log.apply(window.console,arguments)},r.defaults={locale:String.locale,fallbackLocale:"en",parser:l.i18n.parser,messageStore:l.i18n.messageStore},l.i18n.constructor=r}(jQuery),function(r){"use strict";function t(){this.messages={},this.sources={}}t.prototype={load:function(t,e){var i=null,n=[],o=this;if("string"==typeof t)return r.i18n.log("Loading messages from: "+t),function(n){var o=r.Deferred();return r.getJSON(n).done(o.resolve).fail(function(t,e,i){r.i18n.log("Error in loading messages from "+n+" Exception: "+i),o.resolve()}),o.promise()}(t).done(function(t){o.set(e,t)}).promise();if(e)return o.set(e,t),r.Deferred().resolve();for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e=i,n.push(o.load(t[i],e)));return r.when.apply(r,n)},set:function(t,e){this.messages[t]?this.messages[t]=r.extend(this.messages[t],e):this.messages[t]=e},get:function(t,e){return this.messages[t]&&this.messages[t][e]}},r.extend(r.i18n.messageStore,new t)}(jQuery),function(t){"use strict";t.i18n=t.i18n||{},t.extend(t.i18n.fallbacks,{ab:["ru"],ace:["id"],aln:["sq"],als:["gsw","de"],an:["es"],anp:["hi"],arn:["es"],arz:["ar"],av:["ru"],ay:["es"],ba:["ru"],bar:["de"],"bat-smg":["sgs","lt"],bcc:["fa"],"be-x-old":["be-tarask"],bh:["bho"],bjn:["id"],bm:["fr"],bpy:["bn"],bqi:["fa"],bug:["id"],"cbk-zam":["es"],ce:["ru"],crh:["crh-latn"],"crh-cyrl":["ru"],csb:["pl"],cv:["ru"],"de-at":["de"],"de-ch":["de"],"de-formal":["de"],dsb:["de"],dtp:["ms"],egl:["it"],eml:["it"],ff:["fr"],fit:["fi"],"fiu-vro":["vro","et"],frc:["fr"],frp:["fr"],frr:["de"],fur:["it"],gag:["tr"],gan:["gan-hant","zh-hant","zh-hans"],"gan-hans":["zh-hans"],"gan-hant":["zh-hant","zh-hans"],gl:["pt"],glk:["fa"],gn:["es"],gsw:["de"],hif:["hif-latn"],hsb:["de"],ht:["fr"],ii:["zh-cn","zh-hans"],inh:["ru"],iu:["ike-cans"],jut:["da"],jv:["id"],kaa:["kk-latn","kk-cyrl"],kbd:["kbd-cyrl"],khw:["ur"],kiu:["tr"],kk:["kk-cyrl"],"kk-arab":["kk-cyrl"],"kk-latn":["kk-cyrl"],"kk-cn":["kk-arab","kk-cyrl"],"kk-kz":["kk-cyrl"],"kk-tr":["kk-latn","kk-cyrl"],kl:["da"],"ko-kp":["ko"],koi:["ru"],krc:["ru"],ks:["ks-arab"],ksh:["de"],ku:["ku-latn"],"ku-arab":["ckb"],kv:["ru"],lad:["es"],lb:["de"],lbe:["ru"],lez:["ru"],li:["nl"],lij:["it"],liv:["et"],lmo:["it"],ln:["fr"],ltg:["lv"],lzz:["tr"],mai:["hi"],"map-bms":["jv","id"],mg:["fr"],mhr:["ru"],min:["id"],mo:["ro"],mrj:["ru"],mwl:["pt"],myv:["ru"],mzn:["fa"],nah:["es"],nap:["it"],nds:["de"],"nds-nl":["nl"],"nl-informal":["nl"],no:["nb"],os:["ru"],pcd:["fr"],pdc:["de"],pdt:["de"],pfl:["de"],pms:["it"],pt:["pt-br"],"pt-br":["pt"],qu:["es"],qug:["qu","es"],rgn:["it"],rmy:["ro"],"roa-rup":["rup"],rue:["uk","ru"],ruq:["ruq-latn","ro"],"ruq-cyrl":["mk"],"ruq-latn":["ro"],sa:["hi"],sah:["ru"],scn:["it"],sg:["fr"],sgs:["lt"],sli:["de"],sr:["sr-ec"],srn:["nl"],stq:["de"],su:["id"],szl:["pl"],tcy:["kn"],tg:["tg-cyrl"],tt:["tt-cyrl","ru"],"tt-cyrl":["ru"],ty:["fr"],udm:["ru"],ug:["ug-arab"],uk:["ru"],vec:["it"],vep:["et"],vls:["nl"],vmf:["de"],vot:["fi"],vro:["et"],wa:["fr"],wo:["fr"],wuu:["zh-hans"],xal:["ru"],xmf:["ka"],yi:["he"],za:["zh-hans"],zea:["nl"],zh:["zh-hans"],"zh-classical":["lzh"],"zh-cn":["zh-hans"],"zh-hant":["zh-hans"],"zh-hk":["zh-hant","zh-hans"],"zh-min-nan":["nan"],"zh-mo":["zh-hk","zh-hant","zh-hans"],"zh-my":["zh-sg","zh-hans"],"zh-sg":["zh-hans"],"zh-tw":["zh-hant","zh-hans"],"zh-yue":["yue"]})}(jQuery),function(i){"use strict";function t(t){this.options=i.extend({},i.i18n.parser.defaults,t),this.language=i.i18n.languages[String.locale]||i.i18n.languages.default,this.emitter=i.i18n.parser.emitter}t.prototype={constructor:t,simpleParse:function(t,n){return t.replace(/\$(\d+)/g,function(t,e){var i=parseInt(e,10)-1;return void 0!==n[i]?n[i]:"$"+e})},parse:function(t,e){return t.indexOf("{{")<0?this.simpleParse(t,e):(this.emitter.language=i.i18n.languages[i.i18n().locale]||i.i18n.languages.default,this.emitter.emit(this.ast(t),e))},ast:function(n){var i,e,o,r,a,s,t,l,u,c,h,p,d,f,m,_,g,y,v,x,b=0;function w(i){return function(){var t,e;for(t=0;t<i.length;t++)if(null!==(e=i[t]()))return e;return null}}function L(t){var e,i,n=b,o=[];for(e=0;e<t.length;e++){if(null===(i=t[e]()))return b=n,null;o.push(i)}return o}function k(n,o){return function(){for(var t=b,e=[],i=o();null!==i;)e.push(i),i=o();return e.length<n?(b=t,null):e}}function T(e){var i=e.length;return function(){var t=null;return n.slice(b,b+i)===e&&(t=e,b+=i),t}}function E(e){return function(){var t=n.slice(b).match(e);return null===t?null:(b+=t[0].length,t[0])}}function M(){var t=L([o,r]);return null===t?null:t[1]}function C(){var t=L([a,s]);return null===t?null:["REPLACE",parseInt(t[1],10)-1]}function S(){var t,e=L([i,k(0,_)]);return null===e?null:1<(t=e[1]).length?["CONCAT"].concat(t):t[0]}function P(){var t=L([p,e,C]);return null===t?null:[t[0],t[2]]}function z(){var t=L([p,e,_]);return null===t?null:[t[0],t[2]]}function I(){var t=L([d,h,f]);return null===t?null:t[1]}if(i=T("|"),e=T(":"),o=T("\\"),r=E(/^./),a=T("$"),s=E(/^\d+/),t=E(/^[^{}\[\]$\\]/),l=E(/^[^{}\[\]$\\|]/),w([M,E(/^[^{}\[\]$\s]/)]),u=w([M,l]),c=w([M,t]),y=E(/^[ !"$&'()*,.\/0-9;=?@A-Z\^_`a-z~\x80-\xFF+\-]+/),v=function(t){return t.toString()},p=function(){var t=y();return null===t?null:v(t)},h=w([function(){var t=L([w([P,z]),k(0,S)]);return null===t?null:t[0].concat(t[1])},function(){var t=L([p,k(0,S)]);return null===t?null:[t[0]].concat(t[1])}]),d=T("{{"),f=T("}}"),m=w([I,C,function(){var t=k(1,c)();return null===t?null:t.join("")}]),_=w([I,C,function(){var t=k(1,u)();return null===t?null:t.join("")}]),null===(g=null===(x=k(0,m)())?null:["CONCAT"].concat(x))||b!==n.length)throw new Error("Parse error at position "+b.toString()+" in input: "+n);return g}},i.extend(i.i18n.parser,new t)}(jQuery),function(a){"use strict";function t(){this.language=a.i18n.languages[String.locale]||a.i18n.languages.default}t.prototype={constructor:t,emit:function(t,e){var i,n,o,r=this;switch(typeof t){case"string":case"number":i=t;break;case"object":if(n=a.map(t.slice(1),function(t){return r.emit(t,e)}),o=t[0].toLowerCase(),"function"!=typeof r[o])throw new Error('unknown operation "'+o+'"');i=r[o](n,e);break;case"undefined":i="";break;default:throw new Error("unexpected type in AST: "+typeof t)}return i},concat:function(t){var i="";return a.each(t,function(t,e){i+=e}),i},replace:function(t,e){var i=parseInt(t[0],10);return i<e.length?e[i]:"$"+(i+1)},plural:function(t){var e=parseFloat(this.language.convertNumber(t[0],10)),i=t.slice(1);return i.length?this.language.convertPlural(e,i):""},gender:function(t){var e=t[0],i=t.slice(1);return this.language.gender(e,i)},grammar:function(t){var e=t[0],i=t[1];return i&&e&&this.language.convertGrammar(i,e)}},a.extend(a.i18n.parser.emitter,new t)}(jQuery),function(t){"use strict";var i;i=new RegExp("(?:([A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁːˑˠ-ˤˮͰ-ͳͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-҂Ҋ-ԯԱ-Ֆՙ-՟ա-և։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ঀংঃঅ-ঌএঐও-নপ-রলশ-হঽ-ীেৈোৌৎৗড়ঢ়য়-ৡ০-ৱ৴-৺ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਾ-ੀਖ਼-ੜਫ਼੦-੯ੲ-ੴઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽ-ીૉોૌૐૠૡ૦-૰ૹଂଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽାୀେୈୋୌୗଡ଼ଢ଼ୟ-ୡ୦-୷ஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹாிுூெ-ைொ-ௌௐௗ௦-௲ఁ-ఃఅ-ఌఎ-ఐఒ-నప-హఽు-ౄౘ-ౚౠౡ౦-౯౿ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೄೆ-ೈೊೋೕೖೞೠೡ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ീെ-ൈൊ-ൌൎൗൟ-ൡ൦-൵൹-ൿංඃඅ-ඖක-නඳ-රලව-ෆා-ෑෘ-ෟ෦-෯ෲ-෴ก-ะาำเ-ๆ๏-๛ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆ໐-໙ໜ-ໟༀ-༗༚-༴༶༸༾-ཇཉ-ཬཿ྅ྈ-ྌ྾-࿅࿇-࿌࿎-࿚က-ာေးျြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃႄႇ-ႌႎ-ႜ႞-ჅჇჍა-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፠-፼ᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙿᚁ-ᚚᚠ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱ᜵᜶ᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳាើ-ៅះៈ។-៚ៜ០-៩᠐-᠙ᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᤣ-ᤦᤩ-ᤫᤰᤱᤳ-ᤸ᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧚ᨀ-ᨖᨙᨚ᨞-ᩕᩗᩡᩣᩤᩭ-ᩲ᪀-᪉᪐-᪙᪠-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-ᭋ᭐-᭪᭴-᭼ᮂ-ᮡᮦᮧ᮪ᮮ-ᯥᯧᯪ-ᯬᯮ᯲᯳᯼-ᰫᰴᰵ᰻-᱉ᱍ-᱿᳀-᳇᳓᳡ᳩ-ᳬᳮ-ᳳᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵰ⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〮〯〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎ㆐-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㋾㌀-㍶㍻-㏝㏠-㏾㐀-䶵一-鿕ꀀ-ꒌꓐ-ꘌꘐ-ꘫꙀ-ꙮꚀ-ꚝꚠ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꞭꞰ-ꞷꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꣽ꤀-ꤥ꤮-ꥆꥒ꥓꥟-ꥼꦃ-ꦲꦴꦵꦺꦻꦽ-꧍ꧏ-꧙꧞-ꧤꧦ-ꧾꨀ-ꨨꨯꨰꨳꨴꩀ-ꩂꩄ-ꩋꩍ꩐-꩙꩜-ꩻꩽ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫫꫮ-ꫵꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭥꭰ-ꯤꯦꯧꯩ-꯬꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ-舘並-龎ff-stﬓ-ﬗA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]|\ud800[\udc00-\udc0b]|\ud800[\udc0d-\udc26]|\ud800[\udc28-\udc3a]|𐀼|𐀽|\ud800[\udc3f-\udc4d]|\ud800[\udc50-\udc5d]|\ud800[\udc80-\udcfa]|𐄀|𐄂|\ud800[\udd07-\udd33]|\ud800[\udd37-\udd3f]|\ud800[\uddd0-\uddfc]|\ud800[\ude80-\ude9c]|\ud800[\udea0-\uded0]|\ud800[\udf00-\udf23]|\ud800[\udf30-\udf4a]|\ud800[\udf50-\udf75]|\ud800[\udf80-\udf9d]|\ud800[\udf9f-\udfc3]|\ud800[\udfc8-\udfd5]|\ud801[\udc00-\udc9d]|\ud801[\udca0-\udca9]|\ud801[\udd00-\udd27]|\ud801[\udd30-\udd63]|𐕯|\ud801[\ude00-\udf36]|\ud801[\udf40-\udf55]|\ud801[\udf60-\udf67]|𑀀|\ud804[\udc02-\udc37]|\ud804[\udc47-\udc4d]|\ud804[\udc66-\udc6f]|\ud804[\udc82-\udcb2]|𑂷|𑂸|\ud804[\udcbb-\udcc1]|\ud804[\udcd0-\udce8]|\ud804[\udcf0-\udcf9]|\ud804[\udd03-\udd26]|𑄬|\ud804[\udd36-\udd43]|\ud804[\udd50-\udd72]|\ud804[\udd74-\udd76]|\ud804[\udd82-\uddb5]|\ud804[\uddbf-\uddc9]|𑇍|\ud804[\uddd0-\udddf]|\ud804[\udde1-\uddf4]|\ud804[\ude00-\ude11]|\ud804[\ude13-\ude2e]|𑈲|𑈳|𑈵|\ud804[\ude38-\ude3d]|\ud804[\ude80-\ude86]|𑊈|\ud804[\ude8a-\ude8d]|\ud804[\ude8f-\ude9d]|\ud804[\ude9f-\udea9]|\ud804[\udeb0-\udede]|\ud804[\udee0-\udee2]|\ud804[\udef0-\udef9]|𑌂|𑌃|\ud804[\udf05-\udf0c]|𑌏|𑌐|\ud804[\udf13-\udf28]|\ud804[\udf2a-\udf30]|𑌲|𑌳|\ud804[\udf35-\udf39]|\ud804[\udf3d-\udf3f]|\ud804[\udf41-\udf44]|𑍇|𑍈|\ud804[\udf4b-\udf4d]|𑍐|𑍗|\ud804[\udf5d-\udf63]|\ud805[\udc80-\udcb2]|𑒹|\ud805[\udcbb-\udcbe]|𑓁|\ud805[\udcc4-\udcc7]|\ud805[\udcd0-\udcd9]|\ud805[\udd80-\uddb1]|\ud805[\uddb8-\uddbb]|𑖾|\ud805[\uddc1-\udddb]|\ud805[\ude00-\ude32]|𑘻|𑘼|𑘾|\ud805[\ude41-\ude44]|\ud805[\ude50-\ude59]|\ud805[\ude80-\udeaa]|𑚬|𑚮|𑚯|𑚶|\ud805[\udec0-\udec9]|\ud805[\udf00-\udf19]|𑜠|𑜡|𑜦|\ud805[\udf30-\udf3f]|\ud806[\udca0-\udcf2]|𑣿|\ud806[\udec0-\udef8]|\ud808[\udc00-\udf99]|\ud809[\udc00-\udc6e]|\ud809[\udc70-\udc74]|\ud809[\udc80-\udd43]|\ud80c[\udc00-\udfff]|\ud80d[\udc00-\udc2e]|\ud811[\udc00-\ude46]|\ud81a[\udc00-\ude38]|\ud81a[\ude40-\ude5e]|\ud81a[\ude60-\ude69]|𖩮|𖩯|\ud81a[\uded0-\udeed]|𖫵|\ud81a[\udf00-\udf2f]|\ud81a[\udf37-\udf45]|\ud81a[\udf50-\udf59]|\ud81a[\udf5b-\udf61]|\ud81a[\udf63-\udf77]|\ud81a[\udf7d-\udf8f]|\ud81b[\udf00-\udf44]|\ud81b[\udf50-\udf7e]|\ud81b[\udf93-\udf9f]|𛀀|𛀁|\ud82f[\udc00-\udc6a]|\ud82f[\udc70-\udc7c]|\ud82f[\udc80-\udc88]|\ud82f[\udc90-\udc99]|𛲜|𛲟|\ud834[\udc00-\udcf5]|\ud834[\udd00-\udd26]|\ud834[\udd29-\udd66]|\ud834[\udd6a-\udd72]|𝆃|𝆄|\ud834[\udd8c-\udda9]|\ud834[\uddae-\udde8]|\ud834[\udf60-\udf71]|\ud835[\udc00-\udc54]|\ud835[\udc56-\udc9c]|𝒞|𝒟|𝒢|𝒥|𝒦|\ud835[\udca9-\udcac]|\ud835[\udcae-\udcb9]|𝒻|\ud835[\udcbd-\udcc3]|\ud835[\udcc5-\udd05]|\ud835[\udd07-\udd0a]|\ud835[\udd0d-\udd14]|\ud835[\udd16-\udd1c]|\ud835[\udd1e-\udd39]|\ud835[\udd3b-\udd3e]|\ud835[\udd40-\udd44]|𝕆|\ud835[\udd4a-\udd50]|\ud835[\udd52-\udea5]|\ud835[\udea8-\udeda]|\ud835[\udedc-\udf14]|\ud835[\udf16-\udf4e]|\ud835[\udf50-\udf88]|\ud835[\udf8a-\udfc2]|\ud835[\udfc4-\udfcb]|\ud836[\udc00-\uddff]|\ud836[\ude37-\ude3a]|\ud836[\ude6d-\ude74]|\ud836[\ude76-\ude83]|\ud836[\ude85-\ude8b]|\ud83c[\udd10-\udd2e]|\ud83c[\udd30-\udd69]|\ud83c[\udd70-\udd9a]|\ud83c[\udde6-\ude02]|\ud83c[\ude10-\ude3a]|\ud83c[\ude40-\ude48]|🉐|🉑|[\ud840-\ud868][\udc00-\udfff]|\ud869[\udc00-\uded6]|\ud869[\udf00-\udfff]|[\ud86a-\ud86c][\udc00-\udfff]|\ud86d[\udc00-\udf34]|\ud86d[\udf40-\udfff]|\ud86e[\udc00-\udc1d]|\ud86e[\udc20-\udfff]|[\ud86f-\ud872][\udc00-\udfff]|\ud873[\udc00-\udea1]|\ud87e[\udc00-\ude1d]|[\udb80-\udbbe][\udc00-\udfff]|\udbbf[\udc00-\udffd]|[\udbc0-\udbfe][\udc00-\udfff]|\udbff[\udc00-\udffd])|([־׀׃׆-߀-ߪߴߵߺ-ࠕࠚࠤࠨ-ࡘ-࢟יִײַ-ﬨשׁ-ﭏ؈؋؍؛-ي٭-ٯٱ-ەۥۦۮۯۺ-ܐܒ-ܯ-ޥޱ-ࢠ-ﭐ-ﴽ﵀-﷏ﷰ-﷼﷾﷿ﹰ-]|\ud802[\udc00-\udd1e]|\ud802[\udd20-\ude00]||\ud802[\ude07-\ude0b]|\ud802[\ude10-\ude37]|\ud802[\ude3b-\ude3e]|\ud802[\ude40-\udee4]|\ud802[\udee7-\udf38]|\ud802[\udf40-\udfff]|\ud803[\udc00-\ude5f]|\ud803[\ude7f-\udfff]|\ud83a[\udc00-\udccf]|\ud83a[\udcd7-\udfff]|\ud83b[\udc00-\uddff]|\ud83b[\udf00-\udfff]|\ud83b[\udf00-\udfff]|\ud83b[\udf00-\udfff]|\ud83b[\udf00-\udfff]|\ud83b[\udf00-\udfff]|\ud83b[\udf00-\udfff]|\ud83b[\udf00-\udfff]|\ud83b[\udf00-\udfff]|\ud83b[\udf00-\udfff]|\ud83b[\udf00-\udfff]|\ud83b[\udf00-\udfff]|\ud83b[\udf00-\udfff]|\ud83b[\udf00-\udfff]|\ud83b[\ude00-\udeef]|\ud83b[\udef2-\udeff]))"),t.extend(t.i18n.parser.emitter,{bidi:function(t){var e=function(t){var e=t.match(i);return e?void 0===e[2]?"ltr":"rtl":null}(t[0]);return"ltr"===e?""+t[0]+"":"rtl"===e?""+t[0]+"":t[0]}})}(jQuery),function(l){"use strict";var t={pluralRules:{af:{one:"n = 1"},ak:{one:"n = 0..1"},am:{one:"i = 0 or n = 1"},ar:{zero:"n = 0",one:"n = 1",two:"n = 2",few:"n % 100 = 3..10",many:"n % 100 = 11..99"},ars:{zero:"n = 0",one:"n = 1",two:"n = 2",few:"n % 100 = 3..10",many:"n % 100 = 11..99"},as:{one:"i = 0 or n = 1"},asa:{one:"n = 1"},ast:{one:"i = 1 and v = 0"},az:{one:"n = 1"},be:{one:"n % 10 = 1 and n % 100 != 11",few:"n % 10 = 2..4 and n % 100 != 12..14",many:"n % 10 = 0 or n % 10 = 5..9 or n % 100 = 11..14"},bem:{one:"n = 1"},bez:{one:"n = 1"},bg:{one:"n = 1"},bh:{one:"n = 0..1"},bm:{},bn:{one:"i = 0 or n = 1"},bo:{},br:{one:"n % 10 = 1 and n % 100 != 11,71,91",two:"n % 10 = 2 and n % 100 != 12,72,92",few:"n % 10 = 3..4,9 and n % 100 != 10..19,70..79,90..99",many:"n != 0 and n % 1000000 = 0"},brx:{one:"n = 1"},bs:{one:"v = 0 and i % 10 = 1 and i % 100 != 11 or f % 10 = 1 and f % 100 != 11",few:"v = 0 and i % 10 = 2..4 and i % 100 != 12..14 or f % 10 = 2..4 and f % 100 != 12..14"},ca:{one:"i = 1 and v = 0"},ce:{one:"n = 1"},cgg:{one:"n = 1"},chr:{one:"n = 1"},ckb:{one:"n = 1"},cs:{one:"i = 1 and v = 0",few:"i = 2..4 and v = 0",many:"v != 0"},cy:{zero:"n = 0",one:"n = 1",two:"n = 2",few:"n = 3",many:"n = 6"},da:{one:"n = 1 or t != 0 and i = 0,1"},de:{one:"i = 1 and v = 0"},dsb:{one:"v = 0 and i % 100 = 1 or f % 100 = 1",two:"v = 0 and i % 100 = 2 or f % 100 = 2",few:"v = 0 and i % 100 = 3..4 or f % 100 = 3..4"},dv:{one:"n = 1"},dz:{},ee:{one:"n = 1"},el:{one:"n = 1"},en:{one:"i = 1 and v = 0"},eo:{one:"n = 1"},es:{one:"n = 1"},et:{one:"i = 1 and v = 0"},eu:{one:"n = 1"},fa:{one:"i = 0 or n = 1"},ff:{one:"i = 0,1"},fi:{one:"i = 1 and v = 0"},fil:{one:"v = 0 and i = 1,2,3 or v = 0 and i % 10 != 4,6,9 or v != 0 and f % 10 != 4,6,9"},fo:{one:"n = 1"},fr:{one:"i = 0,1"},fur:{one:"n = 1"},fy:{one:"i = 1 and v = 0"},ga:{one:"n = 1",two:"n = 2",few:"n = 3..6",many:"n = 7..10"},gd:{one:"n = 1,11",two:"n = 2,12",few:"n = 3..10,13..19"},gl:{one:"i = 1 and v = 0"},gsw:{one:"n = 1"},gu:{one:"i = 0 or n = 1"},guw:{one:"n = 0..1"},gv:{one:"v = 0 and i % 10 = 1",two:"v = 0 and i % 10 = 2",few:"v = 0 and i % 100 = 0,20,40,60,80",many:"v != 0"},ha:{one:"n = 1"},haw:{one:"n = 1"},he:{one:"i = 1 and v = 0",two:"i = 2 and v = 0",many:"v = 0 and n != 0..10 and n % 10 = 0"},hi:{one:"i = 0 or n = 1"},hr:{one:"v = 0 and i % 10 = 1 and i % 100 != 11 or f % 10 = 1 and f % 100 != 11",few:"v = 0 and i % 10 = 2..4 and i % 100 != 12..14 or f % 10 = 2..4 and f % 100 != 12..14"},hsb:{one:"v = 0 and i % 100 = 1 or f % 100 = 1",two:"v = 0 and i % 100 = 2 or f % 100 = 2",few:"v = 0 and i % 100 = 3..4 or f % 100 = 3..4"},hu:{one:"n = 1"},hy:{one:"i = 0,1"},id:{},ig:{},ii:{},in:{},is:{one:"t = 0 and i % 10 = 1 and i % 100 != 11 or t != 0"},it:{one:"i = 1 and v = 0"},iu:{one:"n = 1",two:"n = 2"},iw:{one:"i = 1 and v = 0",two:"i = 2 and v = 0",many:"v = 0 and n != 0..10 and n % 10 = 0"},ja:{},jbo:{},jgo:{one:"n = 1"},ji:{one:"i = 1 and v = 0"},jmc:{one:"n = 1"},jv:{},jw:{},ka:{one:"n = 1"},kab:{one:"i = 0,1"},kaj:{one:"n = 1"},kcg:{one:"n = 1"},kde:{},kea:{},kk:{one:"n = 1"},kkj:{one:"n = 1"},kl:{one:"n = 1"},km:{},kn:{one:"i = 0 or n = 1"},ko:{},ks:{one:"n = 1"},ksb:{one:"n = 1"},ksh:{zero:"n = 0",one:"n = 1"},ku:{one:"n = 1"},kw:{one:"n = 1",two:"n = 2"},ky:{one:"n = 1"},lag:{zero:"n = 0",one:"i = 0,1 and n != 0"},lb:{one:"n = 1"},lg:{one:"n = 1"},lkt:{},ln:{one:"n = 0..1"},lo:{},lt:{one:"n % 10 = 1 and n % 100 != 11..19",few:"n % 10 = 2..9 and n % 100 != 11..19",many:"f != 0"},lv:{zero:"n % 10 = 0 or n % 100 = 11..19 or v = 2 and f % 100 = 11..19",one:"n % 10 = 1 and n % 100 != 11 or v = 2 and f % 10 = 1 and f % 100 != 11 or v != 2 and f % 10 = 1"},mas:{one:"n = 1"},mg:{one:"n = 0..1"},mgo:{one:"n = 1"},mk:{one:"v = 0 and i % 10 = 1 or f % 10 = 1"},ml:{one:"n = 1"},mn:{one:"n = 1"},mo:{one:"i = 1 and v = 0",few:"v != 0 or n = 0 or n != 1 and n % 100 = 1..19"},mr:{one:"i = 0 or n = 1"},ms:{},mt:{one:"n = 1",few:"n = 0 or n % 100 = 2..10",many:"n % 100 = 11..19"},my:{},nah:{one:"n = 1"},naq:{one:"n = 1",two:"n = 2"},nb:{one:"n = 1"},nd:{one:"n = 1"},ne:{one:"n = 1"},nl:{one:"i = 1 and v = 0"},nn:{one:"n = 1"},nnh:{one:"n = 1"},no:{one:"n = 1"},nqo:{},nr:{one:"n = 1"},nso:{one:"n = 0..1"},ny:{one:"n = 1"},nyn:{one:"n = 1"},om:{one:"n = 1"},or:{one:"n = 1"},os:{one:"n = 1"},pa:{one:"n = 0..1"},pap:{one:"n = 1"},pl:{one:"i = 1 and v = 0",few:"v = 0 and i % 10 = 2..4 and i % 100 != 12..14",many:"v = 0 and i != 1 and i % 10 = 0..1 or v = 0 and i % 10 = 5..9 or v = 0 and i % 100 = 12..14"},prg:{zero:"n % 10 = 0 or n % 100 = 11..19 or v = 2 and f % 100 = 11..19",one:"n % 10 = 1 and n % 100 != 11 or v = 2 and f % 10 = 1 and f % 100 != 11 or v != 2 and f % 10 = 1"},ps:{one:"n = 1"},pt:{one:"n = 0..2 and n != 2"},"pt-PT":{one:"n = 1 and v = 0"},rm:{one:"n = 1"},ro:{one:"i = 1 and v = 0",few:"v != 0 or n = 0 or n != 1 and n % 100 = 1..19"},rof:{one:"n = 1"},root:{},ru:{one:"v = 0 and i % 10 = 1 and i % 100 != 11",few:"v = 0 and i % 10 = 2..4 and i % 100 != 12..14",many:"v = 0 and i % 10 = 0 or v = 0 and i % 10 = 5..9 or v = 0 and i % 100 = 11..14"},rwk:{one:"n = 1"},sah:{},saq:{one:"n = 1"},sdh:{one:"n = 1"},se:{one:"n = 1",two:"n = 2"},seh:{one:"n = 1"},ses:{},sg:{},sh:{one:"v = 0 and i % 10 = 1 and i % 100 != 11 or f % 10 = 1 and f % 100 != 11",few:"v = 0 and i % 10 = 2..4 and i % 100 != 12..14 or f % 10 = 2..4 and f % 100 != 12..14"},shi:{one:"i = 0 or n = 1",few:"n = 2..10"},si:{one:"n = 0,1 or i = 0 and f = 1"},sk:{one:"i = 1 and v = 0",few:"i = 2..4 and v = 0",many:"v != 0"},sl:{one:"v = 0 and i % 100 = 1",two:"v = 0 and i % 100 = 2",few:"v = 0 and i % 100 = 3..4 or v != 0"},sma:{one:"n = 1",two:"n = 2"},smi:{one:"n = 1",two:"n = 2"},smj:{one:"n = 1",two:"n = 2"},smn:{one:"n = 1",two:"n = 2"},sms:{one:"n = 1",two:"n = 2"},sn:{one:"n = 1"},so:{one:"n = 1"},sq:{one:"n = 1"},sr:{one:"v = 0 and i % 10 = 1 and i % 100 != 11 or f % 10 = 1 and f % 100 != 11",few:"v = 0 and i % 10 = 2..4 and i % 100 != 12..14 or f % 10 = 2..4 and f % 100 != 12..14"},ss:{one:"n = 1"},ssy:{one:"n = 1"},st:{one:"n = 1"},sv:{one:"i = 1 and v = 0"},sw:{one:"i = 1 and v = 0"},syr:{one:"n = 1"},ta:{one:"n = 1"},te:{one:"n = 1"},teo:{one:"n = 1"},th:{},ti:{one:"n = 0..1"},tig:{one:"n = 1"},tk:{one:"n = 1"},tl:{one:"v = 0 and i = 1,2,3 or v = 0 and i % 10 != 4,6,9 or v != 0 and f % 10 != 4,6,9"},tn:{one:"n = 1"},to:{},tr:{one:"n = 1"},ts:{one:"n = 1"},tzm:{one:"n = 0..1 or n = 11..99"},ug:{one:"n = 1"},uk:{one:"v = 0 and i % 10 = 1 and i % 100 != 11",few:"v = 0 and i % 10 = 2..4 and i % 100 != 12..14",many:"v = 0 and i % 10 = 0 or v = 0 and i % 10 = 5..9 or v = 0 and i % 100 = 11..14"},ur:{one:"i = 1 and v = 0"},uz:{one:"n = 1"},ve:{one:"n = 1"},vi:{},vo:{one:"n = 1"},vun:{one:"n = 1"},wa:{one:"n = 0..1"},wae:{one:"n = 1"},wo:{},xh:{one:"n = 1"},xog:{one:"n = 1"},yi:{one:"i = 1 and v = 0"},yo:{},yue:{},zh:{},zu:{one:"i = 0 or n = 1"}},convertPlural:function(t,e){var i,n,o,r,a=new RegExp("\\d+=","i");if(!e||0===e.length)return"";for(o=0;o<e.length;o++)if(r=e[o],a.test(r)){if(parseInt(r.slice(0,r.indexOf("=")),10)===t)return r.slice(r.indexOf("=")+1);e[o]=void 0}return e=l.map(e,function(t){if(void 0!==t)return t}),(i=this.pluralRules[l.i18n().locale])?(n=this.getPluralForm(t,i),e[n=Math.min(n,e.length-1)]):1===t?e[0]:e[1]},getPluralForm:function(t,e){var i,n=["zero","one","two","few","many","other"],o=0;for(i=0;i<n.length;i++)if(e[n[i]]){if(pluralRuleParser(e[n[i]],t))return o;o++}return o},convertNumber:function(t,e){var i,n,o,r,a,s;if(r=this.digitTransformTable(l.i18n().locale),a=String(t),s="",!r)return t;if(e){if(parseFloat(t,10)===t)return t;for(n in i=[],r)i[r[n]]=n;r=i}for(o=0;o<a.length;o++)r[a[o]]?s+=r[a[o]]:s+=a[o];return e?parseFloat(s,10):s},convertGrammar:function(t){return t},gender:function(t,e){if(!e||0===e.length)return"";for(;e.length<2;)e.push(e[e.length-1]);return"male"===t?e[0]:"female"===t?e[1]:3===e.length?e[2]:e[0]},digitTransformTable:function(t){var e={ar:"٠١٢٣٤٥٦٧٨٩",fa:"۰۱۲۳۴۵۶۷۸۹",ml:"൦൧൨൩൪൫൬൭൮൯",kn:"೦೧೨೩೪೫೬೭೮೯",lo:"໐໑໒໓໔໕໖໗໘໙",or:"୦୧୨୩୪୫୬୭୮୯",kh:"០១២៣៤៥៦៧៨៩",pa:"੦੧੨੩੪੫੬੭੮੯",gu:"૦૧૨૩૪૫૬૭૮૯",hi:"०१२३४५६७८९",my:"၀၁၂၃၄၅၆၇၈၉",ta:"௦௧௨௩௪௫௬௭௮௯",te:"౦౧౨౩౪౫౬౭౮౯",th:"๐๑๒๓๔๕๖๗๘๙",bo:"༠༡༢༣༤༥༦༧༨༩"};return!!e[t]&&e[t].split("")}};l.extend(l.i18n.languages,{default:t})}(jQuery),function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?t(require("jquery")):t(jQuery)}(function(p){"use strict";var o;p.support.htmlMenuitem="HTMLMenuItemElement"in window,p.support.htmlCommand="HTMLCommandElement"in window,p.support.eventSelectstart="onselectstart"in document.documentElement,p.ui&&p.widget||(p.cleanData=(o=p.cleanData,function(t){var e,i,n;for(n=0;null!=t[n];n++){i=t[n];try{(e=p._data(i,"events"))&&e.remove&&p(i).triggerHandler("remove")}catch(t){}}o(t)}));var s=null,h=!1,d=p(window),f=0,m={},_={},g={},y={selector:null,appendTo:null,trigger:"right",autoHide:!1,delay:200,reposition:!0,hideOnSecondTrigger:!1,selectableSubMenu:!1,classNames:{hover:"context-menu-hover",disabled:"context-menu-disabled",visible:"context-menu-visible",notSelectable:"context-menu-not-selectable",icon:"context-menu-icon",iconEdit:"context-menu-icon-edit",iconCut:"context-menu-icon-cut",iconCopy:"context-menu-icon-copy",iconPaste:"context-menu-icon-paste",iconDelete:"context-menu-icon-delete",iconAdd:"context-menu-icon-add",iconQuit:"context-menu-icon-quit",iconLoadingClass:"context-menu-icon-loading"},determinePosition:function(t){if(p.ui&&p.ui.position)t.css("display","block").position({my:"center top",at:"center bottom",of:this,offset:"0 5",collision:"fit"}).css("display","none");else{var e=this.offset();e.top+=this.outerHeight(),e.left+=this.outerWidth()/2-t.outerWidth()/2,t.css(e)}},position:function(t,e,i){var n;if(e||i){if("maintain"===e&&"maintain"===i)n=t.$menu.position();else{var o=t.$menu.offsetParent().offset();n={top:i-o.top,left:e-o.left}}var r=d.scrollTop()+d.height(),a=d.scrollLeft()+d.width(),s=t.$menu.outerHeight(),l=t.$menu.outerWidth();n.top+s>r&&(n.top-=s),n.top<0&&(n.top=0),n.left+l>a&&(n.left-=l),n.left<0&&(n.left=0),t.$menu.css(n)}else t.determinePosition.call(this,t.$menu)},positionSubmenu:function(t){if(void 0!==t)if(p.ui&&p.ui.position)t.css("display","block").position({my:"left top-5",at:"right top",of:this,collision:"flipfit fit"}).css("display","");else{var e={top:-9,left:this.outerWidth()-5};t.css(e)}},zIndex:1,animation:{duration:50,show:"slideDown",hide:"slideUp"},events:{show:p.noop,hide:p.noop,activated:p.noop},callback:null,items:{}},r={timer:null,pageX:null,pageY:null},v={abortevent:function(t){t.preventDefault(),t.stopImmediatePropagation()},contextmenu:function(t){var e=p(this);if("right"===t.data.trigger&&(t.preventDefault(),t.stopImmediatePropagation()),!("right"!==t.data.trigger&&"demand"!==t.data.trigger&&t.originalEvent||!(void 0===t.mouseButton||!t.data||"left"===t.data.trigger&&0===t.mouseButton||"right"===t.data.trigger&&2===t.mouseButton)||e.hasClass("context-menu-active")||e.hasClass("context-menu-disabled"))){if(s=e,t.data.build){var i=t.data.build(s,t);if(!1===i)return;if(t.data=p.extend(!0,{},y,t.data,i||{}),!t.data.items||p.isEmptyObject(t.data.items))throw window.console&&(console.error||console.log).call(console,"No items specified to show in contextMenu"),new Error("No Items specified");t.data.$trigger=s,x.create(t.data)}var n=!1;for(var o in t.data.items){if(t.data.items.hasOwnProperty(o))(p.isFunction(t.data.items[o].visible)?t.data.items[o].visible.call(p(t.currentTarget),o,t.data):void 0===t.data.items[o]||!t.data.items[o].visible||!0===t.data.items[o].visible)&&(n=!0)}n&&x.show.call(e,t.data,t.pageX,t.pageY)}},click:function(t){t.preventDefault(),t.stopImmediatePropagation(),p(this).trigger(p.Event("contextmenu",{data:t.data,pageX:t.pageX,pageY:t.pageY}))},mousedown:function(t){var e=p(this);s&&s.length&&!s.is(e)&&s.data("contextMenu").$menu.trigger("contextmenu:hide"),2===t.button&&(s=e.data("contextMenuActive",!0))},mouseup:function(t){var e=p(this);e.data("contextMenuActive")&&s&&s.length&&s.is(e)&&!e.hasClass("context-menu-disabled")&&(t.preventDefault(),t.stopImmediatePropagation(),(s=e).trigger(p.Event("contextmenu",{data:t.data,pageX:t.pageX,pageY:t.pageY}))),e.removeData("contextMenuActive")},mouseenter:function(t){var e=p(this),i=p(t.relatedTarget),n=p(document);i.is(".context-menu-list")||i.closest(".context-menu-list").length||s&&s.length||(r.pageX=t.pageX,r.pageY=t.pageY,r.data=t.data,n.on("mousemove.contextMenuShow",v.mousemove),r.timer=setTimeout(function(){r.timer=null,n.off("mousemove.contextMenuShow"),(s=e).trigger(p.Event("contextmenu",{data:r.data,pageX:r.pageX,pageY:r.pageY}))},t.data.delay))},mousemove:function(t){r.pageX=t.pageX,r.pageY=t.pageY},mouseleave:function(t){var e=p(t.relatedTarget);if(!e.is(".context-menu-list")&&!e.closest(".context-menu-list").length){try{clearTimeout(r.timer)}catch(t){}r.timer=null}},layerClick:function(o){var r,a,s=p(this).data("contextMenuRoot"),l=o.button,u=o.pageX,c=o.pageY;o.preventDefault(),setTimeout(function(){var t,e="left"===s.trigger&&0===l||"right"===s.trigger&&2===l;if(document.elementFromPoint&&s.$layer){if(s.$layer.hide(),(r=document.elementFromPoint(u-d.scrollLeft(),c-d.scrollTop())).isContentEditable){var i=document.createRange(),n=window.getSelection();i.selectNode(r),i.collapse(!0),n.removeAllRanges(),n.addRange(i)}p(r).trigger(o),s.$layer.show()}if(s.hideOnSecondTrigger&&e&&null!==s.$menu&&void 0!==s.$menu)s.$menu.trigger("contextmenu:hide");else{if(s.reposition&&e)if(document.elementFromPoint){if(s.$trigger.is(r))return void s.position.call(s.$trigger,s,u,c)}else if(a=s.$trigger.offset(),t=p(window),a.top+=t.scrollTop(),a.top<=o.pageY&&(a.left+=t.scrollLeft(),a.left<=o.pageX&&(a.bottom=a.top+s.$trigger.outerHeight(),a.bottom>=o.pageY&&(a.right=a.left+s.$trigger.outerWidth(),a.right>=o.pageX))))return void s.position.call(s.$trigger,s,u,c);r&&e&&s.$trigger.one("contextmenu:hidden",function(){p(r).contextMenu({x:u,y:c,button:l})}),null!=s&&null!==s.$menu&&void 0!==s.$menu&&s.$menu.trigger("contextmenu:hide")}},50)},keyStop:function(t,e){e.isInput||t.preventDefault(),t.stopPropagation()},key:function(t){var e={};s&&(e=s.data("contextMenu")||{}),void 0===e.zIndex&&(e.zIndex=0);var i=0,n=function(t){""!==t.style.zIndex?i=t.style.zIndex:null!==t.offsetParent&&void 0!==t.offsetParent?n(t.offsetParent):null!==t.parentElement&&void 0!==t.parentElement&&n(t.parentElement)};if(n(t.target),!(e.$menu&&parseInt(i,10)>parseInt(e.$menu.css("zIndex"),10))){switch(t.keyCode){case 9:case 38:if(v.keyStop(t,e),e.isInput){if(9===t.keyCode&&t.shiftKey)return t.preventDefault(),e.$selected&&e.$selected.find("input, textarea, select").blur(),void(null!==e.$menu&&void 0!==e.$menu&&e.$menu.trigger("prevcommand"));if(38===t.keyCode&&"checkbox"===e.$selected.find("input, textarea, select").prop("type"))return void t.preventDefault()}else if(9!==t.keyCode||t.shiftKey)return void(null!==e.$menu&&void 0!==e.$menu&&e.$menu.trigger("prevcommand"));break;case 40:if(v.keyStop(t,e),!e.isInput)return void(null!==e.$menu&&void 0!==e.$menu&&e.$menu.trigger("nextcommand"));if(9===t.keyCode)return t.preventDefault(),e.$selected&&e.$selected.find("input, textarea, select").blur(),void(null!==e.$menu&&void 0!==e.$menu&&e.$menu.trigger("nextcommand"));if(40===t.keyCode&&"checkbox"===e.$selected.find("input, textarea, select").prop("type"))return void t.preventDefault();break;case 37:if(v.keyStop(t,e),e.isInput||!e.$selected||!e.$selected.length)break;if(e.$selected.parent().hasClass("context-menu-root"))break;var o=e.$selected.parent().parent();return e.$selected.trigger("contextmenu:blur"),void(e.$selected=o);case 39:if(v.keyStop(t,e),e.isInput||!e.$selected||!e.$selected.length)break;var r=e.$selected.data("contextMenu")||{};if(r.$menu&&e.$selected.hasClass("context-menu-submenu"))return e.$selected=null,r.$selected=null,void r.$menu.trigger("nextcommand");break;case 35:case 36:return e.$selected&&e.$selected.find("input, textarea, select").length?void 0:((e.$selected&&e.$selected.parent()||e.$menu).children(":not(."+e.classNames.disabled+", ."+e.classNames.notSelectable+")")[36===t.keyCode?"first":"last"]().trigger("contextmenu:focus"),void t.preventDefault());case 13:if(v.keyStop(t,e),e.isInput){if(e.$selected&&!e.$selected.is("textarea, select"))return void t.preventDefault();break}return void(void 0!==e.$selected&&null!==e.$selected&&e.$selected.trigger("mouseup"));case 32:case 33:case 34:return void v.keyStop(t,e);case 27:return v.keyStop(t,e),void(null!==e.$menu&&void 0!==e.$menu&&e.$menu.trigger("contextmenu:hide"));default:var a=String.fromCharCode(t.keyCode).toUpperCase();if(e.accesskeys&&e.accesskeys[a])return void e.accesskeys[a].$node.trigger(e.accesskeys[a].$menu?"contextmenu:focus":"mouseup")}t.stopPropagation(),void 0!==e.$selected&&null!==e.$selected&&e.$selected.trigger(t)}},prevItem:function(t){t.stopPropagation();var e=p(this).data("contextMenu")||{},i=p(this).data("contextMenuRoot")||{};if(e.$selected){var n=e.$selected;(e=e.$selected.parent().data("contextMenu")||{}).$selected=n}for(var o=e.$menu.children(),r=e.$selected&&e.$selected.prev().length?e.$selected.prev():o.last(),a=r;r.hasClass(i.classNames.disabled)||r.hasClass(i.classNames.notSelectable)||r.is(":hidden");)if((r=r.prev().length?r.prev():o.last()).is(a))return;e.$selected&&v.itemMouseleave.call(e.$selected.get(0),t),v.itemMouseenter.call(r.get(0),t);var s=r.find("input, textarea, select");s.length&&s.focus()},nextItem:function(t){t.stopPropagation();var e=p(this).data("contextMenu")||{},i=p(this).data("contextMenuRoot")||{};if(e.$selected){var n=e.$selected;(e=e.$selected.parent().data("contextMenu")||{}).$selected=n}for(var o=e.$menu.children(),r=e.$selected&&e.$selected.next().length?e.$selected.next():o.first(),a=r;r.hasClass(i.classNames.disabled)||r.hasClass(i.classNames.notSelectable)||r.is(":hidden");)if((r=r.next().length?r.next():o.first()).is(a))return;e.$selected&&v.itemMouseleave.call(e.$selected.get(0),t),v.itemMouseenter.call(r.get(0),t);var s=r.find("input, textarea, select");s.length&&s.focus()},focusInput:function(){var t=p(this).closest(".context-menu-item"),e=t.data(),i=e.contextMenu,n=e.contextMenuRoot;n.$selected=i.$selected=t,n.isInput=i.isInput=!0},blurInput:function(){var t=p(this).closest(".context-menu-item").data(),e=t.contextMenu;t.contextMenuRoot.isInput=e.isInput=!1},menuMouseenter:function(){p(this).data().contextMenuRoot.hovering=!0},menuMouseleave:function(t){var e=p(this).data().contextMenuRoot;e.$layer&&e.$layer.is(t.relatedTarget)&&(e.hovering=!1)},itemMouseenter:function(t){var e=p(this),i=e.data(),n=i.contextMenu,o=i.contextMenuRoot;o.hovering=!0,t&&o.$layer&&o.$layer.is(t.relatedTarget)&&(t.preventDefault(),t.stopImmediatePropagation()),(n.$menu?n:o).$menu.children("."+o.classNames.hover).trigger("contextmenu:blur").children(".hover").trigger("contextmenu:blur"),e.hasClass(o.classNames.disabled)||e.hasClass(o.classNames.notSelectable)?n.$selected=null:e.trigger("contextmenu:focus")},itemMouseleave:function(t){var e=p(this),i=e.data(),n=i.contextMenu,o=i.contextMenuRoot;if(o!==n&&o.$layer&&o.$layer.is(t.relatedTarget))return void 0!==o.$selected&&null!==o.$selected&&o.$selected.trigger("contextmenu:blur"),t.preventDefault(),t.stopImmediatePropagation(),void(o.$selected=n.$selected=n.$node);n&&n.$menu&&n.$menu.hasClass("context-menu-visible")||e.trigger("contextmenu:blur")},itemClick:function(t){var e,i=p(this),n=i.data(),o=n.contextMenu,r=n.contextMenuRoot,a=n.contextMenuKey;if(!(!o.items[a]||i.is("."+r.classNames.disabled+", .context-menu-separator, ."+r.classNames.notSelectable)||i.is(".context-menu-submenu")&&!1===r.selectableSubMenu)){if(t.preventDefault(),t.stopImmediatePropagation(),p.isFunction(o.callbacks[a])&&Object.prototype.hasOwnProperty.call(o.callbacks,a))e=o.callbacks[a];else{if(!p.isFunction(r.callback))return;e=r.callback}!1!==e.call(r.$trigger,a,r,t)?r.$menu.trigger("contextmenu:hide"):r.$menu.parent().length&&x.update.call(r.$trigger,r)}},inputClick:function(t){t.stopImmediatePropagation()},hideMenu:function(t,e){var i=p(this).data("contextMenuRoot");x.hide.call(i.$trigger,i,e&&e.force)},focusItem:function(t){t.stopPropagation();var e=p(this),i=e.data(),n=i.contextMenu,o=i.contextMenuRoot;e.hasClass(o.classNames.disabled)||e.hasClass(o.classNames.notSelectable)||(e.addClass([o.classNames.hover,o.classNames.visible].join(" ")).parent().find(".context-menu-item").not(e).removeClass(o.classNames.visible).filter("."+o.classNames.hover).trigger("contextmenu:blur"),n.$selected=o.$selected=e,n&&n.$node&&n.$node.hasClass("context-menu-submenu")&&n.$node.addClass(o.classNames.hover),n.$node&&o.positionSubmenu.call(n.$node,n.$menu))},blurItem:function(t){t.stopPropagation();var e=p(this),i=e.data(),n=i.contextMenu,o=i.contextMenuRoot;n.autoHide&&e.removeClass(o.classNames.visible),e.removeClass(o.classNames.hover),n.$selected=null}},x={show:function(i,t,e){var n=p(this),o={};if(p("#context-menu-layer").trigger("mousedown"),i.$trigger=n,!1!==i.events.show.call(n,i)){if(x.update.call(n,i),i.position.call(n,i,t,e),i.zIndex){var r=i.zIndex;"function"==typeof i.zIndex&&(r=i.zIndex.call(n,i)),o.zIndex=function(t){for(var e=0,i=t;e=Math.max(e,parseInt(i.css("z-index"),10)||0),(i=i.parent())&&i.length&&!(-1<"html body".indexOf(i.prop("nodeName").toLowerCase())););return e}(n)+r}x.layer.call(i.$menu,i,o.zIndex),i.$menu.find("ul").css("zIndex",o.zIndex+1),i.$menu.css(o)[i.animation.show](i.animation.duration,function(){n.trigger("contextmenu:visible"),x.activated(i),i.events.activated()}),n.data("contextMenu",i).addClass("context-menu-active"),p(document).off("keydown.contextMenu").on("keydown.contextMenu",v.key),i.autoHide&&p(document).on("mousemove.contextMenuAutoHide",function(t){var e=n.offset();e.right=e.left+n.outerWidth(),e.bottom=e.top+n.outerHeight(),!i.$layer||i.hovering||t.pageX>=e.left&&t.pageX<=e.right&&t.pageY>=e.top&&t.pageY<=e.bottom||setTimeout(function(){i.hovering||null===i.$menu||void 0===i.$menu||i.$menu.trigger("contextmenu:hide")},50)})}else s=null},hide:function(e,t){var i=p(this);if(e||(e=i.data("contextMenu")||{}),t||!e.events||!1!==e.events.hide.call(i,e)){if(i.removeData("contextMenu").removeClass("context-menu-active"),e.$layer){setTimeout((n=e.$layer,function(){n.remove()}),10);try{delete e.$layer}catch(t){e.$layer=null}}var n;s=null,e.$menu.find("."+e.classNames.hover).trigger("contextmenu:blur"),e.$selected=null,e.$menu.find("."+e.classNames.visible).removeClass(e.classNames.visible),p(document).off(".contextMenuAutoHide").off("keydown.contextMenu"),e.$menu&&e.$menu[e.animation.hide](e.animation.duration,function(){e.build&&(e.$menu.remove(),p.each(e,function(t){switch(t){case"ns":case"selector":case"build":case"trigger":return!0;default:e[t]=void 0;try{delete e[t]}catch(t){}return!0}})),setTimeout(function(){i.trigger("contextmenu:hidden")},10)})}},create:function(u,c){function h(t){var e=p("<span></span>");if(t._accesskey)t._beforeAccesskey&&e.append(document.createTextNode(t._beforeAccesskey)),p("<span></span>").addClass("context-menu-accesskey").text(t._accesskey).appendTo(e),t._afterAccesskey&&e.append(document.createTextNode(t._afterAccesskey));else if(t.isHtmlName){if(void 0!==t.accesskey)throw new Error("accesskeys are not compatible with HTML names and cannot be used together in the same item");e.html(t.name)}else e.text(t.name);return e}void 0===c&&(c=u),u.$menu=p('<ul class="context-menu-list"></ul>').addClass(u.className||"").data({contextMenu:u,contextMenuRoot:c}),p.each(["callbacks","commands","inputs"],function(t,e){u[e]={},c[e]||(c[e]={})}),c.accesskeys||(c.accesskeys={}),p.each(u.items,function(i,n){var t=p('<li class="context-menu-item"></li>').addClass(n.className||""),e=null,o=null;if(t.on("click",p.noop),"string"!=typeof n&&"cm_separator"!==n.type||(n={type:"cm_seperator"}),n.$node=t.data({contextMenu:u,contextMenuRoot:c,contextMenuKey:i}),void 0!==n.accesskey)for(var r,a=function(t){for(var e,i=t.split(/\s+/),n=[],o=0;e=i[o];o++)e=e.charAt(0).toUpperCase(),n.push(e);return n}(n.accesskey),s=0;r=a[s];s++)if(!c.accesskeys[r]){var l=(c.accesskeys[r]=n).name.match(new RegExp("^(.*?)("+r+")(.*)$","i"));l&&(n._beforeAccesskey=l[1],n._accesskey=l[2],n._afterAccesskey=l[3]);break}if(n.type&&g[n.type])g[n.type].call(t,n,u,c),p.each([u,c],function(t,e){e.commands[i]=n,!p.isFunction(n.callback)||void 0!==e.callbacks[i]&&void 0!==u.type||(e.callbacks[i]=n.callback)});else{switch("cm_seperator"===n.type?t.addClass("context-menu-separator "+c.classNames.notSelectable):"html"===n.type?t.addClass("context-menu-html "+c.classNames.notSelectable):"sub"===n.type||(n.type?(e=p("<label></label>").appendTo(t),h(n).appendTo(e),t.addClass("context-menu-input"),u.hasTypes=!0,p.each([u,c],function(t,e){e.commands[i]=n,e.inputs[i]=n})):n.items&&(n.type="sub")),n.type){case"cm_seperator":break;case"text":o=p('<input type="text" value="1" name="" />').attr("name","context-menu-input-"+i).val(n.value||"").appendTo(e);break;case"textarea":o=p('<textarea name=""></textarea>').attr("name","context-menu-input-"+i).val(n.value||"").appendTo(e),n.height&&o.height(n.height);break;case"checkbox":o=p('<input type="checkbox" value="1" name="" />').attr("name","context-menu-input-"+i).val(n.value||"").prop("checked",!!n.selected).prependTo(e);break;case"radio":o=p('<input type="radio" value="1" name="" />').attr("name","context-menu-input-"+n.radio).val(n.value||"").prop("checked",!!n.selected).prependTo(e);break;case"select":o=p('<select name=""></select>').attr("name","context-menu-input-"+i).appendTo(e),n.options&&(p.each(n.options,function(t,e){p("<option></option>").val(t).text(e).appendTo(o)}),o.val(n.selected));break;case"sub":h(n).appendTo(t),n.appendTo=n.$node,t.data("contextMenu",n).addClass("context-menu-submenu"),n.callback=null,"function"==typeof n.items.then?x.processPromises(n,c,n.items):x.create(n,c);break;case"html":p(n.html).appendTo(t);break;default:p.each([u,c],function(t,e){e.commands[i]=n,!p.isFunction(n.callback)||void 0!==e.callbacks[i]&&void 0!==u.type||(e.callbacks[i]=n.callback)}),h(n).appendTo(t)}n.type&&"sub"!==n.type&&"html"!==n.type&&"cm_seperator"!==n.type&&(o.on("focus",v.focusInput).on("blur",v.blurInput),n.events&&o.on(n.events,u)),n.icon&&(p.isFunction(n.icon)?n._icon=n.icon.call(this,this,t,i,n):"string"==typeof n.icon&&"fa-"===n.icon.substring(0,3)?n._icon=c.classNames.icon+" "+c.classNames.icon+"--fa fa "+n.icon:n._icon=c.classNames.icon+" "+c.classNames.icon+"-"+n.icon,t.addClass(n._icon))}n.$input=o,n.$label=e,t.appendTo(u.$menu),!u.hasTypes&&p.support.eventSelectstart&&t.on("selectstart.disableTextSelect",v.abortevent)}),u.$node||u.$menu.css("display","none").addClass("context-menu-root"),u.$menu.appendTo(u.appendTo||document.body)},resize:function(t,e){var i;t.css({position:"absolute",display:"block"}),t.data("width",(i=t.get(0)).getBoundingClientRect?Math.ceil(i.getBoundingClientRect().width):t.outerWidth()+1),t.css({position:"static",minWidth:"0px",maxWidth:"100000px"}),t.find("> li > ul").each(function(){x.resize(p(this),!0)}),e||t.find("ul").addBack().css({position:"",display:"",minWidth:"",maxWidth:""}).outerWidth(function(){return p(this).data("width")})},update:function(o,r){var a=this;void 0===r&&(r=o,x.resize(o.$menu)),o.$menu.children().each(function(){var t=p(this),e=t.data("contextMenuKey"),i=o.items[e],n=p.isFunction(i.disabled)&&i.disabled.call(a,e,r)||!0===i.disabled;if(t[(p.isFunction(i.visible)?i.visible.call(a,e,r):void 0===i.visible||!0===i.visible)?"show":"hide"](),t[n?"addClass":"removeClass"](r.classNames.disabled),p.isFunction(i.icon)&&(t.removeClass(i._icon),i._icon=i.icon.call(this,a,t,e,i),t.addClass(i._icon)),i.type)switch(t.find("input, select, textarea").prop("disabled",n),i.type){case"text":case"textarea":i.$input.val(i.value||"");break;case"checkbox":case"radio":i.$input.val(i.value||"").prop("checked",!!i.selected);break;case"select":i.$input.val((0===i.selected?"0":i.selected)||"")}i.$menu&&x.update.call(a,i,r)})},layer:function(t,e){var i=t.$layer=p('<div id="context-menu-layer"></div>').css({height:d.height(),width:d.width(),display:"block",position:"fixed","z-index":e,top:0,left:0,opacity:0,filter:"alpha(opacity=0)","background-color":"#000"}).data("contextMenuRoot",t).insertBefore(this).on("contextmenu",v.abortevent).on("mousedown",v.layerClick);return void 0===document.body.style.maxWidth&&i.css({position:"absolute",height:p(document).height()}),i},processPromises:function(t,e,i){function n(t,e,i){void 0===i?(i={error:{name:"No items and no error item",icon:"context-menu-icon context-menu-icon-quit"}},window.console&&(console.error||console.log).call(console,'When you reject a promise, provide an "items" object, equal to normal sub-menu items')):"string"==typeof i&&(i={error:{name:i}}),o(t,e,i)}function o(t,e,i){void 0!==e.$menu&&e.$menu.is(":visible")&&(t.$node.removeClass(e.classNames.iconLoadingClass),t.items=i,x.create(t,e,!0),x.update(t,e),e.positionSubmenu.call(t.$node,t.$menu))}t.$node.addClass(e.classNames.iconLoadingClass),i.then(function(t,e,i){void 0===i&&n(void 0),o(t,e,i)}.bind(this,t,e),n.bind(this,t,e))},activated:function(t){var e=t.$menu,i=e.offset(),n=p(window).height(),o=p(window).scrollTop(),r=e.height();n<r?e.css({height:n+"px","overflow-x":"hidden","overflow-y":"auto",top:o+"px"}):(i.top<o||i.top+r>o+n)&&e.css({top:"0px"})}};function l(t){return t.id&&p('label[for="'+t.id+'"]').val()||t.name}p.fn.contextMenu=function(t){var e=this,i=t;if(0<this.length)if(void 0===t)this.first().trigger("contextmenu");else if(void 0!==t.x&&void 0!==t.y)this.first().trigger(p.Event("contextmenu",{pageX:t.x,pageY:t.y,mouseButton:t.button}));else if("hide"===t){var n=this.first().data("contextMenu")?this.first().data("contextMenu").$menu:null;n&&n.trigger("contextmenu:hide")}else"destroy"===t?p.contextMenu("destroy",{context:this}):p.isPlainObject(t)?(t.context=this,p.contextMenu("create",t)):t?this.removeClass("context-menu-disabled"):t||this.addClass("context-menu-disabled");else p.each(_,function(){this.selector===e.selector&&(i.data=this,p.extend(i.data,{trigger:"demand"}))}),v.contextmenu.call(i.target,i);return this},p.contextMenu=function(t,e){"string"!=typeof t&&(e=t,t="create"),"string"==typeof e?e={selector:e}:void 0===e&&(e={});var i=p.extend(!0,{},y,e||{}),n=p(document),o=n,r=!1;switch(i.context&&i.context.length?(o=p(i.context).first(),i.context=o.get(0),r=!p(i.context).is(document)):i.context=document,t){case"update":if(r)x.update(o);else for(var a in _)_.hasOwnProperty(a)&&x.update(_[a]);break;case"create":if(!i.selector)throw new Error("No selector specified");if(i.selector.match(/.context-menu-(list|item|input)($|\s)/))throw new Error('Cannot bind to selector "'+i.selector+'" as it contains a reserved className');if(!i.build&&(!i.items||p.isEmptyObject(i.items)))throw new Error("No Items specified");if(f++,i.ns=".contextMenu"+f,r||(m[i.selector]=i.ns),(_[i.ns]=i).trigger||(i.trigger="right"),!h){var s="click"===i.itemClickEvent?"click.contextMenu":"mouseup.contextMenu",l={"contextmenu:focus.contextMenu":v.focusItem,"contextmenu:blur.contextMenu":v.blurItem,"contextmenu.contextMenu":v.abortevent,"mouseenter.contextMenu":v.itemMouseenter,"mouseleave.contextMenu":v.itemMouseleave};l[s]=v.itemClick,n.on({"contextmenu:hide.contextMenu":v.hideMenu,"prevcommand.contextMenu":v.prevItem,"nextcommand.contextMenu":v.nextItem,"contextmenu.contextMenu":v.abortevent,"mouseenter.contextMenu":v.menuMouseenter,"mouseleave.contextMenu":v.menuMouseleave},".context-menu-list").on("mouseup.contextMenu",".context-menu-input",v.inputClick).on(l,".context-menu-item"),h=!0}switch(o.on("contextmenu"+i.ns,i.selector,i,v.contextmenu),r&&o.on("remove"+i.ns,function(){p(this).contextMenu("destroy")}),i.trigger){case"hover":o.on("mouseenter"+i.ns,i.selector,i,v.mouseenter).on("mouseleave"+i.ns,i.selector,i,v.mouseleave);break;case"left":o.on("click"+i.ns,i.selector,i,v.click);break;case"touchstart":o.on("touchstart"+i.ns,i.selector,i,v.click)}i.build||x.create(i);break;case"destroy":var u;if(r){var c=i.context;p.each(_,function(t,e){if(!e)return!0;if(!p(c).is(e.selector))return!0;(u=p(".context-menu-list").filter(":visible")).length&&u.data().contextMenuRoot.$trigger.is(p(e.context).find(e.selector))&&u.trigger("contextmenu:hide",{force:!0});try{_[e.ns].$menu&&_[e.ns].$menu.remove(),delete _[e.ns]}catch(t){_[e.ns]=null}return p(e.context).off(e.ns),!0})}else if(i.selector){if(m[i.selector]){(u=p(".context-menu-list").filter(":visible")).length&&u.data().contextMenuRoot.$trigger.is(i.selector)&&u.trigger("contextmenu:hide",{force:!0});try{_[m[i.selector]].$menu&&_[m[i.selector]].$menu.remove(),delete _[m[i.selector]]}catch(t){_[m[i.selector]]=null}n.off(m[i.selector])}}else n.off(".contextMenu .contextMenuAutoHide"),p.each(_,function(t,e){p(e.context).off(e.ns)}),m={},f=0,h=!(_={}),p("#context-menu-layer, .context-menu-list").remove();break;case"html5":(!p.support.htmlCommand&&!p.support.htmlMenuitem||"boolean"==typeof e&&e)&&p('menu[type="context"]').each(function(){this.id&&p.contextMenu({selector:"[contextmenu="+this.id+"]",items:p.contextMenu.fromMenu(this)})}).css("display","none");break;default:throw new Error('Unknown operation "'+t+'"')}return this},p.contextMenu.setInputValues=function(t,i){void 0===i&&(i={}),p.each(t.inputs,function(t,e){switch(e.type){case"text":case"textarea":e.value=i[t]||"";break;case"checkbox":e.selected=!!i[t];break;case"radio":e.selected=(i[e.radio]||"")===e.value;break;case"select":e.selected=i[t]||""}})},p.contextMenu.getInputValues=function(t,i){return void 0===i&&(i={}),p.each(t.inputs,function(t,e){switch(e.type){case"text":case"textarea":case"select":i[t]=e.$input.val();break;case"checkbox":i[t]=e.$input.prop("checked");break;case"radio":e.$input.prop("checked")&&(i[e.radio]=e.value)}}),i},p.contextMenu.fromMenu=function(t){var e={};return function r(a,t,s){return s||(s=0),t.each(function(){var t,e,i=p(this),n=this,o=this.nodeName.toLowerCase();switch("label"===o&&i.find("input, textarea, select").length&&(t=i.text(),o=(n=(i=i.children().first()).get(0)).nodeName.toLowerCase()),o){case"menu":e={name:i.attr("label"),items:{}},s=r(e.items,i.children(),s);break;case"a":case"button":e={name:i.text(),disabled:!!i.attr("disabled"),callback:function(){i.get(0).click()}};break;case"menuitem":case"command":switch(i.attr("type")){case void 0:case"command":case"menuitem":e={name:i.attr("label"),disabled:!!i.attr("disabled"),icon:i.attr("icon"),callback:function(){i.get(0).click()}};break;case"checkbox":e={type:"checkbox",disabled:!!i.attr("disabled"),name:i.attr("label"),selected:!!i.attr("checked")};break;case"radio":e={type:"radio",disabled:!!i.attr("disabled"),name:i.attr("label"),radio:i.attr("radiogroup"),value:i.attr("id"),selected:!!i.attr("checked")};break;default:e=void 0}break;case"hr":e="-------";break;case"input":switch(i.attr("type")){case"text":e={type:"text",name:t||l(n),disabled:!!i.attr("disabled"),value:i.val()};break;case"checkbox":e={type:"checkbox",name:t||l(n),disabled:!!i.attr("disabled"),selected:!!i.attr("checked")};break;case"radio":e={type:"radio",name:t||l(n),disabled:!!i.attr("disabled"),radio:!!i.attr("name"),value:i.val(),selected:!!i.attr("checked")};break;default:e=void 0}break;case"select":e={type:"select",name:t||l(n),disabled:!!i.attr("disabled"),selected:i.val(),options:{}},i.children().each(function(){e.options[this.value]=p(this).text()});break;case"textarea":e={type:"textarea",name:t||l(n),disabled:!!i.attr("disabled"),value:i.val()};break;case"label":break;default:e={type:"html",html:i.clone(!0)}}e&&(a["key"+ ++s]=e)}),s}(e,p(t).children()),e},p.contextMenu.defaults=y,p.contextMenu.types=g,p.contextMenu.handle=v,p.contextMenu.op=x,p.contextMenu.menus=_}),function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Navigo",[],e):"object"==typeof exports?exports.Navigo=e():t.Navigo=e()}(this,function(){return o={},i.m=n=[function(t,e){"use strict";function s(){return!("undefined"==typeof window||!window.history||!window.history.pushState)}function l(t,e,i){this.root=null,this._routes=[],this._useHash=e,this._hash=void 0===i?"#":i,this._paused=!1,this._destroyed=!1,this._lastRouteResolved=null,this._notFoundHandler=null,this._defaultHandler=null,this._usePushState=!e&&s(),this._onLocationChange=this._onLocationChange.bind(this),this._genericHooks=null,this._historyAPIUpdateMethod="pushState",t?this.root=e?t.replace(/\/$/,"/"+this._hash):t.replace(/\/$/,""):e&&(this.root=this._cLoc().split(this._hash)[0].replace(/\/$/,"/"+this._hash)),this._listen(),this.updatePageLinks()}function u(t){return t instanceof RegExp?t:t.replace(/\/+$/,"").replace(/^\/+/,"^/")}function i(t){return t.replace(/\/$/,"").split("/").length}function r(t,e){return i(e)-i(t)}function n(a,t){return(1<arguments.length&&void 0!==t?t:[]).map(function(t){var e=function(t){var n=[];return{regexp:t instanceof RegExp?t:new RegExp(t.replace(l.PARAMETER_REGEXP,function(t,e,i){return n.push(i),l.REPLACE_VARIABLE_REGEXP}).replace(l.WILDCARD_REGEXP,l.REPLACE_WILDCARD)+l.FOLLOWED_BY_SLASH_REGEXP,l.MATCH_REGEXP_FLAGS),paramNames:n}}(u(t.route)),i=e.regexp,n=e.paramNames,o=a.replace(/^\/+/,"/").match(i),r=function(t,n){return 0===n.length?null:t?t.slice(1,t.length).reduce(function(t,e,i){return null===t&&(t={}),t[n[i]]=decodeURIComponent(e),t},null):null}(o,n);return!!o&&{match:o,route:t,params:r}}).filter(function(t){return t})}function c(t,e){return n(t,e)[0]||!1}function o(e,t){var i=t.map(function(t){return""===t.route||"*"===t.route?e:e.split(new RegExp(t.route+"($|/)"))[0]}),n=u(e);return 1<i.length?i.reduce(function(t,e){return t.length>e.length&&(t=e),t},i[0]):1===i.length?i[0]:n}function h(t,e,i){function n(t){return t.split(/\?(.*)?$/)[0]}var o;return void 0===i&&(i="#"),s()&&!e?n(t).split(i)[0]:n(1<(o=t.split(i)).length?o[1]:o[0])}function p(e,i,n){return i&&"object"===(void 0===i?"undefined":a(i))?void(i.before?i.before(function(t){0<arguments.length&&void 0!==t&&!t||(e(),i.after&&i.after(n))},n):i.after&&(e(),i.after&&i.after(n))):void e()}Object.defineProperty(e,"__esModule",{value:!0});var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};l.prototype={helpers:{match:c,root:o,clean:u,getOnlyURL:h},navigate:function(t,e){var i;return t=t||"",this._usePushState?(i=(i=(e?"":this._getRoot()+"/")+t.replace(/^\/+/,"/")).replace(/([^:])(\/{2,})/g,"$1/"),history[this._historyAPIUpdateMethod]({},"",i),this.resolve()):"undefined"!=typeof window&&(t=t.replace(new RegExp("^"+this._hash),""),window.location.href=window.location.href.replace(/#$/,"").replace(new RegExp(this._hash+".*$"),"")+this._hash+t),this},on:function(){for(var e=this,t=arguments.length,i=Array(t),n=0;n<t;n++)i[n]=arguments[n];if("function"==typeof i[0])this._defaultHandler={handler:i[0],hooks:i[1]};else if(2<=i.length)if("/"===i[0]){var o=i[1];"object"===a(i[1])&&(o=i[1].uses),this._defaultHandler={handler:o,hooks:i[2]}}else this._add(i[0],i[1],i[2]);else if("object"===a(i[0])){Object.keys(i[0]).sort(r).forEach(function(t){e.on(t,i[0][t])})}return this},off:function(i){return null!==this._defaultHandler&&i===this._defaultHandler.handler?this._defaultHandler=null:null!==this._notFoundHandler&&i===this._notFoundHandler.handler&&(this._notFoundHandler=null),this._routes=this._routes.reduce(function(t,e){return e.handler!==i&&t.push(e),t},[]),this},notFound:function(t,e){return this._notFoundHandler={handler:t,hooks:e},this},resolve:function(t){var e,i,n=this,o=(t||this._cLoc()).replace(this._getRoot(),"");this._useHash&&(o=o.replace(new RegExp("^/"+this._hash),"/"));var r=function(t){return t.split(/\?(.*)?$/).slice(1).join("")}(t||this._cLoc()),a=h(o,this._useHash,this._hash);return!this._paused&&(this._lastRouteResolved&&a===this._lastRouteResolved.url&&r===this._lastRouteResolved.query?(this._lastRouteResolved.hooks&&this._lastRouteResolved.hooks.already&&this._lastRouteResolved.hooks.already(this._lastRouteResolved.params),!1):(i=c(a,this._routes))?(this._callLeave(),this._lastRouteResolved={url:a,query:r,hooks:i.route.hooks,params:i.params,name:i.route.name},e=i.route.handler,p(function(){p(function(){i.route.route instanceof RegExp?e.apply(void 0,function(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)}(i.match.slice(1,i.match.length))):e(i.params,r)},i.route.hooks,i.params,n._genericHooks)},this._genericHooks,i.params),i):this._defaultHandler&&(""===a||"/"===a||a===this._hash||function(t,e,i){if(s()&&!e)return!1;if(!t.match(i))return!1;var n=t.split(i);return n.length<2||""===n[1]}(a,this._useHash,this._hash))?(p(function(){p(function(){n._callLeave(),n._lastRouteResolved={url:a,query:r,hooks:n._defaultHandler.hooks},n._defaultHandler.handler(r)},n._defaultHandler.hooks)},this._genericHooks),!0):(this._notFoundHandler&&p(function(){p(function(){n._callLeave(),n._lastRouteResolved={url:a,query:r,hooks:n._notFoundHandler.hooks},n._notFoundHandler.handler(r)},n._notFoundHandler.hooks)},this._genericHooks),!1))},destroy:function(){this._routes=[],this._destroyed=!0,clearTimeout(this._listeningInterval),"undefined"!=typeof window&&(window.removeEventListener("popstate",this._onLocationChange),window.removeEventListener("hashchange",this._onLocationChange))},updatePageLinks:function(){var n=this;"undefined"!=typeof document&&this._findLinks().forEach(function(i){i.hasListenerAttached||(i.addEventListener("click",function(t){var e=n.getLinkPath(i);n._destroyed||(t.preventDefault(),n.navigate(e.replace(/\/+$/,"").replace(/^\/+/,"/")))}),i.hasListenerAttached=!0)})},generate:function(n,t){var o=1<arguments.length&&void 0!==t?t:{},e=this._routes.reduce(function(t,e){var i;if(e.name===n)for(i in t=e.route,o)t=t.toString().replace(":"+i,o[i]);return t},"");return this._useHash?this._hash+e:e},link:function(t){return this._getRoot()+t},pause:function(t){var e=!(0<arguments.length&&void 0!==t)||t;this._paused=e,this._historyAPIUpdateMethod=e?"replaceState":"pushState"},resume:function(){this.pause(!1)},historyAPIUpdateMethod:function(t){return void 0===t?this._historyAPIUpdateMethod:this._historyAPIUpdateMethod=t},disableIfAPINotAvailable:function(){s()||this.destroy()},lastRouteResolved:function(){return this._lastRouteResolved},getLinkPath:function(t){return t.pathname||t.getAttribute("href")},hooks:function(t){this._genericHooks=t},_add:function(t,e,i){var n=1<arguments.length&&void 0!==e?e:null,o=2<arguments.length&&void 0!==i?i:null;return"string"==typeof t&&(t=encodeURI(t)),"object"===(void 0===n?"undefined":a(n))?this._routes.push({route:t,handler:n.uses,name:n.as,hooks:o||n.hooks}):this._routes.push({route:t,handler:n,hooks:o}),this._add},_getRoot:function(){return null!==this.root||(this.root=o(this._cLoc().split("?")[0],this._routes)),this.root},_listen:function(){var t=this;if(this._usePushState)window.addEventListener("popstate",this._onLocationChange);else if("undefined"!=typeof window&&"onhashchange"in window)window.addEventListener("hashchange",this._onLocationChange);else{var e=this._cLoc(),i=void 0,n=void 0;(n=function(){i=t._cLoc(),e!==i&&(e=i,t.resolve()),t._listeningInterval=setTimeout(n,200)})()}},_cLoc:function(){return"undefined"!=typeof window?void 0!==window.__NAVIGO_WINDOW_LOCATION_MOCK__?window.__NAVIGO_WINDOW_LOCATION_MOCK__:u(window.location.href):""},_findLinks:function(){return[].slice.call(document.querySelectorAll("[data-navigo]"))},_onLocationChange:function(){this.resolve()},_callLeave:function(){this._lastRouteResolved&&this._lastRouteResolved.hooks&&this._lastRouteResolved.hooks.leave&&this._lastRouteResolved.hooks.leave()}},l.PARAMETER_REGEXP=/([:*])(\w+)/g,l.WILDCARD_REGEXP=/\*/g,l.REPLACE_VARIABLE_REGEXP="([^/]+)",l.REPLACE_WILDCARD="(?:.*)",l.FOLLOWED_BY_SLASH_REGEXP="(?:/$|$)",l.MATCH_REGEXP_FLAGS="",e.default=l,t.exports=e.default}],i.c=o,i.p="",i(0);function i(t){if(o[t])return o[t].exports;var e=o[t]={exports:{},id:t,loaded:!1};return n[t].call(e.exports,e,e.exports,i),e.loaded=!0,e.exports}var n,o}),function(t,e){"function"==typeof define&&define.amd?define(["jquery"],function(t){return e(t)}):"object"==typeof exports?module.exports=e(require("jquery")):e(jQuery)}(0,function(E){function e(t){this.$container,this.constraints=null,this.__$tooltip,this.__init(t)}function r(e,i){var n=!0;return E.each(e,function(t){return void 0===i[t]||e[t]!==i[t]?n=!1:void 0}),n}function c(t){var e=t.attr("id"),i=e?M.window.document.getElementById(e):null;return i?i===t[0]:E.contains(M.window.document.body,t[0])}function t(){this.__$emitterPrivate=E({}),this.__$emitterPublic=E({}),this.__instancesLatestArr=[],this.__plugins={},this._env=M}var h={animation:"fade",animationDuration:350,content:null,contentAsHTML:!1,contentCloning:!1,debug:!0,delay:300,delayTouch:[300,500],functionInit:null,functionBefore:null,functionReady:null,functionAfter:null,functionFormat:null,IEmin:6,interactive:!1,multiple:!1,parent:null,plugins:["sideTip"],repositionOnScroll:!1,restoration:"none",selfDestruction:!0,theme:[],timer:0,trackerInterval:500,trackOrigin:!1,trackTooltip:!1,trigger:"hover",triggerClose:{click:!1,mouseleave:!1,originClick:!1,scroll:!1,tap:!1,touchleave:!1},triggerOpen:{click:!1,mouseenter:!1,tap:!1,touchstart:!1},updateAnimation:"rotate",zIndex:9999999},o="undefined"!=typeof window?window:null,M={hasTouchCapability:!(!o||!("ontouchstart"in o||o.DocumentTouch&&o.document instanceof o.DocumentTouch||o.navigator.maxTouchPoints)),hasTransitions:function(){if(!o)return!1;var t=(o.document.body||o.document.documentElement).style,e="transition",i=["Moz","Webkit","Khtml","O","ms"];if("string"==typeof t[e])return!0;e=e.charAt(0).toUpperCase()+e.substr(1);for(var n=0;n<i.length;n++)if("string"==typeof t[i[n]+e])return!0;return!1}(),IE:!1,semVer:"4.2.5",window:o};t.prototype={__bridge:function(t,e,i){if(!e[i]){function n(){}n.prototype=t;var o=new n;o.__init&&o.__init(e),E.each(t,function(t){0!=t.indexOf("__")&&(e[t]?h.debug&&console.log("The "+t+" method of the "+i+" plugin conflicts with another plugin or native methods"):(e[t]=function(){return o[t].apply(o,Array.prototype.slice.apply(arguments))},e[t].bridged=o))}),e[i]=o}return this},__setWindow:function(t){return M.window=t,this},_getRuler:function(t){return new e(t)},_off:function(){return this.__$emitterPrivate.off.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_on:function(){return this.__$emitterPrivate.on.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_one:function(){return this.__$emitterPrivate.one.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_plugin:function(t){if("string"==typeof t){var i=t,n=null;return 0<i.indexOf(".")?n=this.__plugins[i]:E.each(this.__plugins,function(t,e){return e.name.substring(e.name.length-i.length-1)=="."+i?(n=e,!1):void 0}),n}if(t.name.indexOf(".")<0)throw new Error("Plugins must be namespaced");return(this.__plugins[t.name]=t).core&&this.__bridge(t.core,this,t.name),this},_trigger:function(){var t=Array.prototype.slice.apply(arguments);return"string"==typeof t[0]&&(t[0]={type:t[0]}),this.__$emitterPrivate.trigger.apply(this.__$emitterPrivate,t),this.__$emitterPublic.trigger.apply(this.__$emitterPublic,t),this},instances:function(t){var n=[];return E(t||".tooltipstered").each(function(){var i=E(this),t=i.data("tooltipster-ns");t&&E.each(t,function(t,e){n.push(i.data(e))})}),n},instancesLatest:function(){return this.__instancesLatestArr},off:function(){return this.__$emitterPublic.off.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},on:function(){return this.__$emitterPublic.on.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},one:function(){return this.__$emitterPublic.one.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},origins:function(t){return E((t?t+" ":"")+".tooltipstered").toArray()},setDefaults:function(t){return E.extend(h,t),this},triggerHandler:function(){return this.__$emitterPublic.triggerHandler.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this}},E.tooltipster=new t,E.Tooltipster=function(t,e){this.__callbacks={close:[],open:[]},this.__closingTime,this.__Content,this.__contentBcr,this.__destroyed=!1,this.__$emitterPrivate=E({}),this.__$emitterPublic=E({}),this.__enabled=!0,this.__garbageCollector,this.__Geometry,this.__lastPosition,this.__namespace="tooltipster-"+Math.round(1e6*Math.random()),this.__options,this.__$originParents,this.__pointerIsOverOrigin=!1,this.__previousThemes=[],this.__state="closed",this.__timeouts={close:[],open:null},this.__touchEvents=[],this.__tracker=null,this._$origin,this._$tooltip,this.__init(t,e)},E.Tooltipster.prototype={__init:function(t,e){var i=this;if(i._$origin=E(t),i.__options=E.extend(!0,{},h,e),i.__optionsFormat(),!M.IE||M.IE>=i.__options.IEmin){var n=null;if(void 0===i._$origin.data("tooltipster-initialTitle")&&(void 0===(n=i._$origin.attr("title"))&&(n=null),i._$origin.data("tooltipster-initialTitle",n)),null!==i.__options.content)i.__contentSet(i.__options.content);else{var o,r=i._$origin.attr("data-tooltip-content");r&&(o=E(r)),o&&o[0]?i.__contentSet(o.first()):i.__contentSet(n)}i._$origin.removeAttr("title").addClass("tooltipstered"),i.__prepareOrigin(),i.__prepareGC(),E.each(i.__options.plugins,function(t,e){i._plug(e)}),M.hasTouchCapability&&E(M.window.document.body).on("touchmove."+i.__namespace+"-triggerOpen",function(t){i._touchRecordEvent(t)}),i._on("created",function(){i.__prepareTooltip()})._on("repositioned",function(t){i.__lastPosition=t.position})}else i.__options.disabled=!0},__contentInsert:function(){var t=this,e=t._$tooltip.find(".tooltipster-content"),i=t.__Content;return t._trigger({type:"format",content:t.__Content,format:function(t){i=t}}),t.__options.functionFormat&&(i=t.__options.functionFormat.call(t,t,{origin:t._$origin[0]},t.__Content)),"string"!=typeof i||t.__options.contentAsHTML?e.empty().append(i):e.text(i),t},__contentSet:function(t){return t instanceof E&&this.__options.contentCloning&&(t=t.clone(!0)),this.__Content=t,this._trigger({type:"updated",content:t}),this},__destroyError:function(){throw new Error("This tooltip has been destroyed and cannot execute your method call.")},__geometry:function(){var t=this._$origin,e=this._$origin.is("area");if(e){var i=this._$origin.parent().attr("name");t=E('img[usemap="#'+i+'"]')}var n=t[0].getBoundingClientRect(),o=E(M.window.document),r=E(M.window),a=t,s={available:{document:null,window:null},document:{size:{height:o.height(),width:o.width()}},window:{scroll:{left:M.window.scrollX||M.window.document.documentElement.scrollLeft,top:M.window.scrollY||M.window.document.documentElement.scrollTop},size:{height:r.height(),width:r.width()}},origin:{fixedLineage:!1,offset:{},size:{height:n.bottom-n.top,width:n.right-n.left},usemapImage:e?t[0]:null,windowOffset:{bottom:n.bottom,left:n.left,right:n.right,top:n.top}}};if(e){var l=this._$origin.attr("shape"),u=this._$origin.attr("coords");if(u&&(u=u.split(","),E.map(u,function(t,e){u[e]=parseInt(t)})),"default"!=l)switch(l){case"circle":var c=u[0],h=u[1],p=u[2],d=h-p,f=c-p;s.origin.size.height=2*p,s.origin.size.width=s.origin.size.height,s.origin.windowOffset.left+=f,s.origin.windowOffset.top+=d;break;case"rect":var m=u[0],_=u[1],g=u[2],y=u[3];s.origin.size.height=y-_,s.origin.size.width=g-m,s.origin.windowOffset.left+=m,s.origin.windowOffset.top+=_;break;case"poly":for(var v=0,x=0,b=0,w=0,L="even",k=0;k<u.length;k++){var T=u[k];L="even"==L?(b<T&&(b=T,0===k&&(v=b)),T<v&&(v=T),"odd"):(w<T&&(w=T,1==k&&(x=w)),T<x&&(x=T),"even")}s.origin.size.height=w-x,s.origin.size.width=b-v,s.origin.windowOffset.left+=v,s.origin.windowOffset.top+=x}}for(this._trigger({type:"geometry",edit:function(t){s.origin.size.height=t.height,s.origin.windowOffset.left=t.left,s.origin.windowOffset.top=t.top,s.origin.size.width=t.width},geometry:{height:s.origin.size.height,left:s.origin.windowOffset.left,top:s.origin.windowOffset.top,width:s.origin.size.width}}),s.origin.windowOffset.right=s.origin.windowOffset.left+s.origin.size.width,s.origin.windowOffset.bottom=s.origin.windowOffset.top+s.origin.size.height,s.origin.offset.left=s.origin.windowOffset.left+s.window.scroll.left,s.origin.offset.top=s.origin.windowOffset.top+s.window.scroll.top,s.origin.offset.bottom=s.origin.offset.top+s.origin.size.height,s.origin.offset.right=s.origin.offset.left+s.origin.size.width,s.available.document={bottom:{height:s.document.size.height-s.origin.offset.bottom,width:s.document.size.width},left:{height:s.document.size.height,width:s.origin.offset.left},right:{height:s.document.size.height,width:s.document.size.width-s.origin.offset.right},top:{height:s.origin.offset.top,width:s.document.size.width}},s.available.window={bottom:{height:Math.max(s.window.size.height-Math.max(s.origin.windowOffset.bottom,0),0),width:s.window.size.width},left:{height:s.window.size.height,width:Math.max(s.origin.windowOffset.left,0)},right:{height:s.window.size.height,width:Math.max(s.window.size.width-Math.max(s.origin.windowOffset.right,0),0)},top:{height:Math.max(s.origin.windowOffset.top,0),width:s.window.size.width}};"html"!=a[0].tagName.toLowerCase();){if("fixed"==a.css("position")){s.origin.fixedLineage=!0;break}a=a.parent()}return s},__optionsFormat:function(){return"number"==typeof this.__options.animationDuration&&(this.__options.animationDuration=[this.__options.animationDuration,this.__options.animationDuration]),"number"==typeof this.__options.delay&&(this.__options.delay=[this.__options.delay,this.__options.delay]),"number"==typeof this.__options.delayTouch&&(this.__options.delayTouch=[this.__options.delayTouch,this.__options.delayTouch]),"string"==typeof this.__options.theme&&(this.__options.theme=[this.__options.theme]),null===this.__options.parent?this.__options.parent=E(M.window.document.body):"string"==typeof this.__options.parent&&(this.__options.parent=E(this.__options.parent)),"hover"==this.__options.trigger?(this.__options.triggerOpen={mouseenter:!0,touchstart:!0},this.__options.triggerClose={mouseleave:!0,originClick:!0,touchleave:!0}):"click"==this.__options.trigger&&(this.__options.triggerOpen={click:!0,tap:!0},this.__options.triggerClose={click:!0,tap:!0}),this._trigger("options"),this},__prepareGC:function(){var t=this;return t.__options.selfDestruction?t.__garbageCollector=setInterval(function(){var e=(new Date).getTime();t.__touchEvents=E.grep(t.__touchEvents,function(t){return 6e4<e-t.time}),c(t._$origin)||t.close(function(){t.destroy()})},2e4):clearInterval(t.__garbageCollector),t},__prepareOrigin:function(){var e=this;if(e._$origin.off("."+e.__namespace+"-triggerOpen"),M.hasTouchCapability&&e._$origin.on("touchstart."+e.__namespace+"-triggerOpen touchend."+e.__namespace+"-triggerOpen touchcancel."+e.__namespace+"-triggerOpen",function(t){e._touchRecordEvent(t)}),e.__options.triggerOpen.click||e.__options.triggerOpen.tap&&M.hasTouchCapability){var t="";e.__options.triggerOpen.click&&(t+="click."+e.__namespace+"-triggerOpen "),e.__options.triggerOpen.tap&&M.hasTouchCapability&&(t+="touchend."+e.__namespace+"-triggerOpen"),e._$origin.on(t,function(t){e._touchIsMeaningfulEvent(t)&&e._open(t)})}if(e.__options.triggerOpen.mouseenter||e.__options.triggerOpen.touchstart&&M.hasTouchCapability){t="";e.__options.triggerOpen.mouseenter&&(t+="mouseenter."+e.__namespace+"-triggerOpen "),e.__options.triggerOpen.touchstart&&M.hasTouchCapability&&(t+="touchstart."+e.__namespace+"-triggerOpen"),e._$origin.on(t,function(t){!e._touchIsTouchEvent(t)&&e._touchIsEmulatedEvent(t)||(e.__pointerIsOverOrigin=!0,e._openShortly(t))})}if(e.__options.triggerClose.mouseleave||e.__options.triggerClose.touchleave&&M.hasTouchCapability){t="";e.__options.triggerClose.mouseleave&&(t+="mouseleave."+e.__namespace+"-triggerOpen "),e.__options.triggerClose.touchleave&&M.hasTouchCapability&&(t+="touchend."+e.__namespace+"-triggerOpen touchcancel."+e.__namespace+"-triggerOpen"),e._$origin.on(t,function(t){e._touchIsMeaningfulEvent(t)&&(e.__pointerIsOverOrigin=!1)})}return e},__prepareTooltip:function(){var i=this,t=i.__options.interactive?"auto":"";return i._$tooltip.attr("id",i.__namespace).css({"pointer-events":t,zIndex:i.__options.zIndex}),E.each(i.__previousThemes,function(t,e){i._$tooltip.removeClass(e)}),E.each(i.__options.theme,function(t,e){i._$tooltip.addClass(e)}),i.__previousThemes=E.merge([],i.__options.theme),i},__scrollHandler:function(t){var e=this;if(e.__options.triggerClose.scroll)e._close(t);else if(c(e._$origin)&&c(e._$tooltip)){var a=null;if(t.target===M.window.document)e.__Geometry.origin.fixedLineage||e.__options.repositionOnScroll&&e.reposition(t);else{a=e.__geometry();var s=!1;if("fixed"!=e._$origin.css("position")&&e.__$originParents.each(function(t,e){var i=E(e),n=i.css("overflow-x"),o=i.css("overflow-y");if("visible"!=n||"visible"!=o){var r=e.getBoundingClientRect();if("visible"!=n&&(a.origin.windowOffset.left<r.left||a.origin.windowOffset.right>r.right))return!(s=!0);if("visible"!=o&&(a.origin.windowOffset.top<r.top||a.origin.windowOffset.bottom>r.bottom))return!(s=!0)}return"fixed"!=i.css("position")&&void 0}),s)e._$tooltip.css("visibility","hidden");else if(e._$tooltip.css("visibility","visible"),e.__options.repositionOnScroll)e.reposition(t);else{var i=a.origin.offset.left-e.__Geometry.origin.offset.left,n=a.origin.offset.top-e.__Geometry.origin.offset.top;e._$tooltip.css({left:e.__lastPosition.coord.left+i,top:e.__lastPosition.coord.top+n})}}e._trigger({type:"scroll",event:t,geo:a})}return e},__stateSet:function(t){return this.__state=t,this._trigger({type:"state",state:t}),this},__timeoutsClear:function(){return clearTimeout(this.__timeouts.open),this.__timeouts.open=null,E.each(this.__timeouts.close,function(t,e){clearTimeout(e)}),this.__timeouts.close=[],this},__trackerStart:function(){var n=this,o=n._$tooltip.find(".tooltipster-content");return n.__options.trackTooltip&&(n.__contentBcr=o[0].getBoundingClientRect()),n.__tracker=setInterval(function(){if(c(n._$origin)&&c(n._$tooltip)){if(n.__options.trackOrigin){var t=n.__geometry(),e=!1;r(t.origin.size,n.__Geometry.origin.size)&&(n.__Geometry.origin.fixedLineage?r(t.origin.windowOffset,n.__Geometry.origin.windowOffset)&&(e=!0):r(t.origin.offset,n.__Geometry.origin.offset)&&(e=!0)),e||(n.__options.triggerClose.mouseleave?n._close():n.reposition())}if(n.__options.trackTooltip){var i=o[0].getBoundingClientRect();i.height===n.__contentBcr.height&&i.width===n.__contentBcr.width||(n.reposition(),n.__contentBcr=i)}}else n._close()},n.__options.trackerInterval),n},_close:function(i,t,e){var n=this,o=!0;if(n._trigger({type:"close",event:i,stop:function(){o=!1}}),o||e){t&&n.__callbacks.close.push(t),n.__callbacks.open=[],n.__timeoutsClear();function r(){E.each(n.__callbacks.close,function(t,e){e.call(n,n,{event:i,origin:n._$origin[0]})}),n.__callbacks.close=[]}if("closed"!=n.__state){var a=!0,s=(new Date).getTime()+n.__options.animationDuration[1];if("disappearing"==n.__state&&s>n.__closingTime&&0<n.__options.animationDuration[1]&&(a=!1),a){n.__closingTime=s,"disappearing"!=n.__state&&n.__stateSet("disappearing");function l(){clearInterval(n.__tracker),n._trigger({type:"closing",event:i}),n._$tooltip.off("."+n.__namespace+"-triggerClose").removeClass("tooltipster-dying"),E(M.window).off("."+n.__namespace+"-triggerClose"),n.__$originParents.each(function(t,e){E(e).off("scroll."+n.__namespace+"-triggerClose")}),n.__$originParents=null,E(M.window.document.body).off("."+n.__namespace+"-triggerClose"),n._$origin.off("."+n.__namespace+"-triggerClose"),n._off("dismissable"),n.__stateSet("closed"),n._trigger({type:"after",event:i}),n.__options.functionAfter&&n.__options.functionAfter.call(n,n,{event:i,origin:n._$origin[0]}),r()}M.hasTransitions?(n._$tooltip.css({"-moz-animation-duration":n.__options.animationDuration[1]+"ms","-ms-animation-duration":n.__options.animationDuration[1]+"ms","-o-animation-duration":n.__options.animationDuration[1]+"ms","-webkit-animation-duration":n.__options.animationDuration[1]+"ms","animation-duration":n.__options.animationDuration[1]+"ms","transition-duration":n.__options.animationDuration[1]+"ms"}),n._$tooltip.clearQueue().removeClass("tooltipster-show").addClass("tooltipster-dying"),0<n.__options.animationDuration[1]&&n._$tooltip.delay(n.__options.animationDuration[1]),n._$tooltip.queue(l)):n._$tooltip.stop().fadeOut(n.__options.animationDuration[1],l)}}else r()}return n},_off:function(){return this.__$emitterPrivate.off.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_on:function(){return this.__$emitterPrivate.on.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_one:function(){return this.__$emitterPrivate.one.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_open:function(t,e){var i=this;if(!i.__destroying&&c(i._$origin)&&i.__enabled){var n=!0;if("closed"==i.__state&&(i._trigger({type:"before",event:t,stop:function(){n=!1}}),n&&i.__options.functionBefore&&(n=i.__options.functionBefore.call(i,i,{event:t,origin:i._$origin[0]}))),!1!==n&&null!==i.__Content){e&&i.__callbacks.open.push(e),i.__callbacks.close=[],i.__timeoutsClear();function o(){"stable"!=i.__state&&i.__stateSet("stable"),E.each(i.__callbacks.open,function(t,e){e.call(i,i,{origin:i._$origin[0],tooltip:i._$tooltip[0]})}),i.__callbacks.open=[]}var r;if("closed"!==i.__state)r=0,"disappearing"===i.__state?(i.__stateSet("appearing"),M.hasTransitions?(i._$tooltip.clearQueue().removeClass("tooltipster-dying").addClass("tooltipster-show"),0<i.__options.animationDuration[0]&&i._$tooltip.delay(i.__options.animationDuration[0]),i._$tooltip.queue(o)):i._$tooltip.stop().fadeIn(o)):"stable"==i.__state&&o();else{if(i.__stateSet("appearing"),r=i.__options.animationDuration[0],i.__contentInsert(),i.reposition(t,!0),M.hasTransitions?(i._$tooltip.addClass("tooltipster-"+i.__options.animation).addClass("tooltipster-initial").css({"-moz-animation-duration":i.__options.animationDuration[0]+"ms","-ms-animation-duration":i.__options.animationDuration[0]+"ms","-o-animation-duration":i.__options.animationDuration[0]+"ms","-webkit-animation-duration":i.__options.animationDuration[0]+"ms","animation-duration":i.__options.animationDuration[0]+"ms","transition-duration":i.__options.animationDuration[0]+"ms"}),setTimeout(function(){"closed"!=i.__state&&(i._$tooltip.addClass("tooltipster-show").removeClass("tooltipster-initial"),0<i.__options.animationDuration[0]&&i._$tooltip.delay(i.__options.animationDuration[0]),i._$tooltip.queue(o))},0)):i._$tooltip.css("display","none").fadeIn(i.__options.animationDuration[0],o),i.__trackerStart(),E(M.window).on("resize."+i.__namespace+"-triggerClose",function(t){var e=E(document.activeElement);(e.is("input")||e.is("textarea"))&&E.contains(i._$tooltip[0],e[0])||i.reposition(t)}).on("scroll."+i.__namespace+"-triggerClose",function(t){i.__scrollHandler(t)}),i.__$originParents=i._$origin.parents(),i.__$originParents.each(function(t,e){E(e).on("scroll."+i.__namespace+"-triggerClose",function(t){i.__scrollHandler(t)})}),i.__options.triggerClose.mouseleave||i.__options.triggerClose.touchleave&&M.hasTouchCapability){i._on("dismissable",function(t){t.dismissable?t.delay?(u=setTimeout(function(){i._close(t.event)},t.delay),i.__timeouts.close.push(u)):i._close(t):clearTimeout(u)});var a=i._$origin,s="",l="",u=null;i.__options.interactive&&(a=a.add(i._$tooltip)),i.__options.triggerClose.mouseleave&&(s+="mouseenter."+i.__namespace+"-triggerClose ",l+="mouseleave."+i.__namespace+"-triggerClose "),i.__options.triggerClose.touchleave&&M.hasTouchCapability&&(s+="touchstart."+i.__namespace+"-triggerClose",l+="touchend."+i.__namespace+"-triggerClose touchcancel."+i.__namespace+"-triggerClose"),a.on(l,function(t){if(i._touchIsTouchEvent(t)||!i._touchIsEmulatedEvent(t)){var e="mouseleave"==t.type?i.__options.delay:i.__options.delayTouch;i._trigger({delay:e[1],dismissable:!0,event:t,type:"dismissable"})}}).on(s,function(t){!i._touchIsTouchEvent(t)&&i._touchIsEmulatedEvent(t)||i._trigger({dismissable:!1,event:t,type:"dismissable"})})}i.__options.triggerClose.originClick&&i._$origin.on("click."+i.__namespace+"-triggerClose",function(t){i._touchIsTouchEvent(t)||i._touchIsEmulatedEvent(t)||i._close(t)}),(i.__options.triggerClose.click||i.__options.triggerClose.tap&&M.hasTouchCapability)&&setTimeout(function(){if("closed"!=i.__state){var t="",e=E(M.window.document.body);i.__options.triggerClose.click&&(t+="click."+i.__namespace+"-triggerClose "),i.__options.triggerClose.tap&&M.hasTouchCapability&&(t+="touchend."+i.__namespace+"-triggerClose"),e.on(t,function(t){i._touchIsMeaningfulEvent(t)&&(i._touchRecordEvent(t),i.__options.interactive&&E.contains(i._$tooltip[0],t.target)||i._close(t))}),i.__options.triggerClose.tap&&M.hasTouchCapability&&e.on("touchstart."+i.__namespace+"-triggerClose",function(t){i._touchRecordEvent(t)})}},0),i._trigger("ready"),i.__options.functionReady&&i.__options.functionReady.call(i,i,{origin:i._$origin[0],tooltip:i._$tooltip[0]})}if(0<i.__options.timer){u=setTimeout(function(){i._close()},i.__options.timer+r);i.__timeouts.close.push(u)}}}return i},_openShortly:function(t){var e=this,i=!0;if("stable"!=e.__state&&"appearing"!=e.__state&&!e.__timeouts.open&&(e._trigger({type:"start",event:t,stop:function(){i=!1}}),i)){var n=0==t.type.indexOf("touch")?e.__options.delayTouch:e.__options.delay;n[0]?e.__timeouts.open=setTimeout(function(){e.__timeouts.open=null,e.__pointerIsOverOrigin&&e._touchIsMeaningfulEvent(t)?(e._trigger("startend"),e._open(t)):e._trigger("startcancel")},n[0]):(e._trigger("startend"),e._open(t))}return e},_optionsExtract:function(t,e){var i=this,n=E.extend(!0,{},e),o=i.__options[t];return o||(o={},E.each(e,function(t){var e=i.__options[t];void 0!==e&&(o[t]=e)})),E.each(n,function(t,e){void 0!==o[t]&&("object"!=typeof e||e instanceof Array||null==e||"object"!=typeof o[t]||o[t]instanceof Array||null==o[t]?n[t]=o[t]:E.extend(n[t],o[t]))}),n},_plug:function(t){var e=E.tooltipster._plugin(t);if(!e)throw new Error('The "'+t+'" plugin is not defined');return e.instance&&E.tooltipster.__bridge(e.instance,this,e.name),this},_touchIsEmulatedEvent:function(t){for(var e=!1,i=(new Date).getTime(),n=this.__touchEvents.length-1;0<=n;n--){var o=this.__touchEvents[n];if(!(i-o.time<500))break;o.target===t.target&&(e=!0)}return e},_touchIsMeaningfulEvent:function(t){return this._touchIsTouchEvent(t)&&!this._touchSwiped(t.target)||!this._touchIsTouchEvent(t)&&!this._touchIsEmulatedEvent(t)},_touchIsTouchEvent:function(t){return 0==t.type.indexOf("touch")},_touchRecordEvent:function(t){return this._touchIsTouchEvent(t)&&(t.time=(new Date).getTime(),this.__touchEvents.push(t)),this},_touchSwiped:function(t){for(var e=!1,i=this.__touchEvents.length-1;0<=i;i--){var n=this.__touchEvents[i];if("touchmove"==n.type){e=!0;break}if("touchstart"==n.type&&t===n.target)break}return e},_trigger:function(){var t=Array.prototype.slice.apply(arguments);return"string"==typeof t[0]&&(t[0]={type:t[0]}),t[0].instance=this,t[0].origin=this._$origin?this._$origin[0]:null,t[0].tooltip=this._$tooltip?this._$tooltip[0]:null,this.__$emitterPrivate.trigger.apply(this.__$emitterPrivate,t),E.tooltipster._trigger.apply(E.tooltipster,t),this.__$emitterPublic.trigger.apply(this.__$emitterPublic,t),this},_unplug:function(e){var i=this;if(i[e]){var t=E.tooltipster._plugin(e);t.instance&&E.each(t.instance,function(t){i[t]&&i[t].bridged===i[e]&&delete i[t]}),i[e].__destroy&&i[e].__destroy(),delete i[e]}return i},close:function(t){return this.__destroyed?this.__destroyError():this._close(null,t),this},content:function(t){var e=this;if(void 0===t)return e.__Content;if(e.__destroyed)e.__destroyError();else if(e.__contentSet(t),null!==e.__Content){if("closed"!==e.__state&&(e.__contentInsert(),e.reposition(),e.__options.updateAnimation))if(M.hasTransitions){var i=e.__options.updateAnimation;e._$tooltip.addClass("tooltipster-update-"+i),setTimeout(function(){"closed"!=e.__state&&e._$tooltip.removeClass("tooltipster-update-"+i)},1e3)}else e._$tooltip.fadeTo(200,.5,function(){"closed"!=e.__state&&e._$tooltip.fadeTo(200,1)})}else e._close();return e},destroy:function(){var e=this;if(e.__destroyed)e.__destroyError();else{"closed"!=e.__state?e.option("animationDuration",0)._close(null,null,!0):e.__timeoutsClear(),e._trigger("destroy"),e.__destroyed=!0,e._$origin.removeData(e.__namespace).off("."+e.__namespace+"-triggerOpen"),E(M.window.document.body).off("."+e.__namespace+"-triggerOpen");var t=e._$origin.data("tooltipster-ns");if(t)if(1===t.length){var i=null;"previous"==e.__options.restoration?i=e._$origin.data("tooltipster-initialTitle"):"current"==e.__options.restoration&&(i="string"==typeof e.__Content?e.__Content:E("<div></div>").append(e.__Content).html()),i&&e._$origin.attr("title",i),e._$origin.removeClass("tooltipstered"),e._$origin.removeData("tooltipster-ns").removeData("tooltipster-initialTitle")}else t=E.grep(t,function(t){return t!==e.__namespace}),e._$origin.data("tooltipster-ns",t);e._trigger("destroyed"),e._off(),e.off(),e.__Content=null,e.__$emitterPrivate=null,e.__$emitterPublic=null,e.__options.parent=null,e._$origin=null,e._$tooltip=null,E.tooltipster.__instancesLatestArr=E.grep(E.tooltipster.__instancesLatestArr,function(t){return e!==t}),clearInterval(e.__garbageCollector)}return e},disable:function(){return this.__destroyed?this.__destroyError():(this._close(),this.__enabled=!1),this},elementOrigin:function(){return this.__destroyed?void this.__destroyError():this._$origin[0]},elementTooltip:function(){return this._$tooltip?this._$tooltip[0]:null},enable:function(){return this.__enabled=!0,this},hide:function(t){return this.close(t)},instance:function(){return this},off:function(){return this.__destroyed||this.__$emitterPublic.off.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},on:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.on.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},one:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.one.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},open:function(t){return this.__destroyed?this.__destroyError():this._open(null,t),this},option:function(t,e){return void 0===e?this.__options[t]:(this.__destroyed?this.__destroyError():(this.__options[t]=e,this.__optionsFormat(),0<=E.inArray(t,["trigger","triggerClose","triggerOpen"])&&this.__prepareOrigin(),"selfDestruction"===t&&this.__prepareGC()),this)},reposition:function(t,e){var i=this;return i.__destroyed?i.__destroyError():"closed"!=i.__state&&c(i._$origin)&&(e||c(i._$tooltip))&&(e||i._$tooltip.detach(),i.__Geometry=i.__geometry(),i._trigger({type:"reposition",event:t,helper:{geo:i.__Geometry}})),i},show:function(t){return this.open(t)},status:function(){return{destroyed:this.__destroyed,enabled:this.__enabled,open:"closed"!==this.__state,state:this.__state}},triggerHandler:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.triggerHandler.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this}},E.fn.tooltipster=function(){var o=Array.prototype.slice.apply(arguments),n="You are using a single HTML element as content for several tooltips. You probably want to set the contentCloning option to TRUE.";if(0===this.length)return this;if("string"==typeof o[0]){var r="#*$~&";return this.each(function(){var t=E(this).data("tooltipster-ns"),e=t?E(this).data(t[0]):null;if(!e)throw new Error("You called Tooltipster's \""+o[0]+'" method on an uninitialized element');if("function"!=typeof e[o[0]])throw new Error('Unknown method "'+o[0]+'"');1<this.length&&"content"==o[0]&&(o[1]instanceof E||"object"==typeof o[1]&&null!=o[1]&&o[1].tagName)&&!e.__options.contentCloning&&e.__options.debug&&console.log(n);var i=e[o[0]](o[1],o[2]);return i!==e||"instance"===o[0]?(r=i,!1):void 0}),"#*$~&"!==r?r:this}E.tooltipster.__instancesLatestArr=[];var t=o[0]&&void 0!==o[0].multiple,a=t&&o[0].multiple||!t&&h.multiple,e=o[0]&&void 0!==o[0].content,i=e&&o[0].content||!e&&h.content,s=o[0]&&void 0!==o[0].contentCloning,l=s&&o[0].contentCloning||!s&&h.contentCloning,u=o[0]&&void 0!==o[0].debug,c=u&&o[0].debug||!u&&h.debug;return 1<this.length&&(i instanceof E||"object"==typeof i&&null!=i&&i.tagName)&&!l&&c&&console.log(n),this.each(function(){var t=!1,e=E(this),i=e.data("tooltipster-ns"),n=null;i?a?t=!0:c&&(console.log("Tooltipster: one or more tooltips are already attached to the element below. Ignoring."),console.log(this)):t=!0,t&&(n=new E.Tooltipster(this,o[0]),i||(i=[]),i.push(n.__namespace),e.data("tooltipster-ns",i),e.data(n.__namespace,n),n.__options.functionInit&&n.__options.functionInit.call(n,n,{origin:this}),n._trigger("init")),E.tooltipster.__instancesLatestArr.push(n)}),this},e.prototype={__init:function(t){this.__$tooltip=t,this.__$tooltip.css({left:0,overflow:"hidden",position:"absolute",top:0}).find(".tooltipster-content").css("overflow","auto"),this.$container=E('<div class="tooltipster-ruler"></div>').append(this.__$tooltip).appendTo(M.window.document.body)},__forceRedraw:function(){var t=this.__$tooltip.parent();this.__$tooltip.detach(),this.__$tooltip.appendTo(t)},constrain:function(t,e){return this.constraints={width:t,height:e},this.__$tooltip.css({display:"block",height:"",overflow:"auto",width:t}),this},destroy:function(){this.__$tooltip.detach().find(".tooltipster-content").css({display:"",overflow:""}),this.$container.remove()},free:function(){return this.constraints=null,this.__$tooltip.css({display:"",height:"",overflow:"visible",width:""}),this},measure:function(){this.__forceRedraw();var t=this.__$tooltip[0].getBoundingClientRect(),e={size:{height:t.height||t.bottom-t.top,width:t.width||t.right-t.left}};if(this.constraints){var i=this.__$tooltip.find(".tooltipster-content"),n=this.__$tooltip.outerHeight(),o=i[0].getBoundingClientRect(),r={height:n<=this.constraints.height,width:t.width<=this.constraints.width&&o.width>=i[0].scrollWidth-1};e.fits=r.height&&r.width}return M.IE&&M.IE<=11&&e.size.width!==M.window.document.documentElement.clientWidth&&(e.size.width=Math.ceil(e.size.width)+1),e}};var i=navigator.userAgent.toLowerCase();-1!=i.indexOf("msie")?M.IE=parseInt(i.split("msie")[1]):-1!==i.toLowerCase().indexOf("trident")&&-1!==i.indexOf(" rv:11")?M.IE=11:-1!=i.toLowerCase().indexOf("edge/")&&(M.IE=parseInt(i.toLowerCase().split("edge/")[1]));var n="tooltipster.sideTip";return E.tooltipster._plugin({name:n,instance:{__defaults:function(){return{arrow:!0,distance:6,functionPosition:null,maxWidth:null,minIntersection:16,minWidth:0,position:null,side:"top",viewportAware:!0}},__init:function(t){var e=this;e.__instance=t,e.__namespace="tooltipster-sideTip-"+Math.round(1e6*Math.random()),e.__previousState="closed",e.__options,e.__optionsFormat(),e.__instance._on("state."+e.__namespace,function(t){"closed"==t.state?e.__close():"appearing"==t.state&&"closed"==e.__previousState&&e.__create(),e.__previousState=t.state}),e.__instance._on("options."+e.__namespace,function(){e.__optionsFormat()}),e.__instance._on("reposition."+e.__namespace,function(t){e.__reposition(t.event,t.helper)})},__close:function(){this.__instance.content()instanceof E&&this.__instance.content().detach(),this.__instance._$tooltip.remove(),this.__instance._$tooltip=null},__create:function(){var t=E('<div class="tooltipster-base tooltipster-sidetip"><div class="tooltipster-box"><div class="tooltipster-content"></div></div><div class="tooltipster-arrow"><div class="tooltipster-arrow-uncropped"><div class="tooltipster-arrow-border"></div><div class="tooltipster-arrow-background"></div></div></div></div>');this.__options.arrow||t.find(".tooltipster-box").css("margin",0).end().find(".tooltipster-arrow").hide(),this.__options.minWidth&&t.css("min-width",this.__options.minWidth+"px"),this.__options.maxWidth&&t.css("max-width",this.__options.maxWidth+"px"),this.__instance._$tooltip=t,this.__instance._trigger("created")},__destroy:function(){this.__instance._off("."+self.__namespace)},__optionsFormat:function(){var t=this;if(t.__options=t.__instance._optionsExtract(n,t.__defaults()),t.__options.position&&(t.__options.side=t.__options.position),"object"!=typeof t.__options.distance&&(t.__options.distance=[t.__options.distance]),t.__options.distance.length<4&&(void 0===t.__options.distance[1]&&(t.__options.distance[1]=t.__options.distance[0]),void 0===t.__options.distance[2]&&(t.__options.distance[2]=t.__options.distance[0]),void 0===t.__options.distance[3]&&(t.__options.distance[3]=t.__options.distance[1]),t.__options.distance={top:t.__options.distance[0],right:t.__options.distance[1],bottom:t.__options.distance[2],left:t.__options.distance[3]}),"string"==typeof t.__options.side){t.__options.side=[t.__options.side,{top:"bottom",right:"left",bottom:"top",left:"right"}[t.__options.side]],"left"==t.__options.side[0]||"right"==t.__options.side[0]?t.__options.side.push("top","bottom"):t.__options.side.push("right","left")}6===E.tooltipster._env.IE&&!0!==t.__options.arrow&&(t.__options.arrow=!1)},__reposition:function(l,u){var e,c=this,h=c.__targetFind(u),p=[];c.__instance._$tooltip.detach();var i=c.__instance._$tooltip.clone(),d=E.tooltipster._getRuler(i),f=!1,t=c.__instance.option("animation");switch(t&&i.removeClass("tooltipster-"+t),E.each(["window","document"],function(t,o){var r=null;if(c.__instance._trigger({container:o,helper:u,satisfied:f,takeTest:function(t){r=t},results:p,type:"positionTest"}),1==r||0!=r&&0==f&&("window"!=o||c.__options.viewportAware))for(t=0;t<c.__options.side.length;t++){var a={horizontal:0,vertical:0},s=c.__options.side[t];"top"==s||"bottom"==s?a.vertical=c.__options.distance[s]:a.horizontal=c.__options.distance[s],c.__sideChange(i,s),E.each(["natural","constrained"],function(t,e){if(r=null,c.__instance._trigger({container:o,event:l,helper:u,mode:e,results:p,satisfied:f,side:s,takeTest:function(t){r=t},type:"positionTest"}),1==r||0!=r&&0==f){var i={container:o,distance:a,fits:null,mode:e,outerSize:null,side:s,size:null,target:h[s],whole:null},n=("natural"==e?d.free():d.constrain(u.geo.available[o][s].width-a.horizontal,u.geo.available[o][s].height-a.vertical)).measure();if(i.size=n.size,i.outerSize={height:n.size.height+a.vertical,width:n.size.width+a.horizontal},"natural"==e?u.geo.available[o][s].width>=i.outerSize.width&&u.geo.available[o][s].height>=i.outerSize.height?i.fits=!0:i.fits=!1:i.fits=n.fits,"window"==o&&(i.fits?i.whole="top"==s||"bottom"==s?u.geo.origin.windowOffset.right>=c.__options.minIntersection&&u.geo.window.size.width-u.geo.origin.windowOffset.left>=c.__options.minIntersection:u.geo.origin.windowOffset.bottom>=c.__options.minIntersection&&u.geo.window.size.height-u.geo.origin.windowOffset.top>=c.__options.minIntersection:i.whole=!1),p.push(i),i.whole)f=!0;else if("natural"==i.mode&&(i.fits||i.size.width<=u.geo.available[o][s].width))return!1}})}}),c.__instance._trigger({edit:function(t){p=t},event:l,helper:u,results:p,type:"positionTested"}),p.sort(function(t,e){return t.whole&&!e.whole?-1:!t.whole&&e.whole?1:t.whole&&e.whole?(i=c.__options.side.indexOf(t.side))<(n=c.__options.side.indexOf(e.side))?-1:n<i?1:"natural"==t.mode?-1:1:t.fits&&!e.fits?-1:!t.fits&&e.fits?1:t.fits&&e.fits?(i=c.__options.side.indexOf(t.side))<(n=c.__options.side.indexOf(e.side))?-1:n<i?1:"natural"==t.mode?-1:1:"document"==t.container&&"bottom"==t.side&&"natural"==t.mode?-1:1;var i,n}),(e=p[0]).coord={},e.side){case"left":case"right":e.coord.top=Math.floor(e.target-e.size.height/2);break;case"bottom":case"top":e.coord.left=Math.floor(e.target-e.size.width/2)}switch(e.side){case"left":e.coord.left=u.geo.origin.windowOffset.left-e.outerSize.width;break;case"right":e.coord.left=u.geo.origin.windowOffset.right+e.distance.horizontal;break;case"top":e.coord.top=u.geo.origin.windowOffset.top-e.outerSize.height;break;case"bottom":e.coord.top=u.geo.origin.windowOffset.bottom+e.distance.vertical}"window"==e.container?"top"==e.side||"bottom"==e.side?e.coord.left<0?0<=u.geo.origin.windowOffset.right-this.__options.minIntersection?e.coord.left=0:e.coord.left=u.geo.origin.windowOffset.right-this.__options.minIntersection-1:e.coord.left>u.geo.window.size.width-e.size.width&&(u.geo.origin.windowOffset.left+this.__options.minIntersection<=u.geo.window.size.width?e.coord.left=u.geo.window.size.width-e.size.width:e.coord.left=u.geo.origin.windowOffset.left+this.__options.minIntersection+1-e.size.width):e.coord.top<0?0<=u.geo.origin.windowOffset.bottom-this.__options.minIntersection?e.coord.top=0:e.coord.top=u.geo.origin.windowOffset.bottom-this.__options.minIntersection-1:e.coord.top>u.geo.window.size.height-e.size.height&&(u.geo.origin.windowOffset.top+this.__options.minIntersection<=u.geo.window.size.height?e.coord.top=u.geo.window.size.height-e.size.height:e.coord.top=u.geo.origin.windowOffset.top+this.__options.minIntersection+1-e.size.height):(e.coord.left>u.geo.window.size.width-e.size.width&&(e.coord.left=u.geo.window.size.width-e.size.width),e.coord.left<0&&(e.coord.left=0)),c.__sideChange(i,e.side),u.tooltipClone=i[0],u.tooltipParent=c.__instance.option("parent").parent[0],u.mode=e.mode,u.whole=e.whole,u.origin=c.__instance._$origin[0],u.tooltip=c.__instance._$tooltip[0],delete e.container,delete e.fits,delete e.mode,delete e.outerSize,delete e.whole,e.distance=e.distance.horizontal||e.distance.vertical;var n,o,r,a=E.extend(!0,{},e);if(c.__instance._trigger({edit:function(t){e=t},event:l,helper:u,position:a,type:"position"}),c.__options.functionPosition){var s=c.__options.functionPosition.call(c,c.__instance,u,a);s&&(e=s)}d.destroy(),o="top"==e.side||"bottom"==e.side?(n={prop:"left",val:e.target-e.coord.left},e.size.width-this.__options.minIntersection):(n={prop:"top",val:e.target-e.coord.top},e.size.height-this.__options.minIntersection),n.val<this.__options.minIntersection?n.val=this.__options.minIntersection:n.val>o&&(n.val=o),r=u.geo.origin.fixedLineage?u.geo.origin.windowOffset:{left:u.geo.origin.windowOffset.left+u.geo.window.scroll.left,top:u.geo.origin.windowOffset.top+u.geo.window.scroll.top},e.coord={left:r.left+(e.coord.left-u.geo.origin.windowOffset.left),top:r.top+(e.coord.top-u.geo.origin.windowOffset.top)},c.__sideChange(c.__instance._$tooltip,e.side),u.geo.origin.fixedLineage?c.__instance._$tooltip.css("position","fixed"):c.__instance._$tooltip.css("position",""),c.__instance._$tooltip.css({left:e.coord.left,top:e.coord.top,height:e.size.height,width:e.size.width}).find(".tooltipster-arrow").css({left:"",top:""}).css(n.prop,n.val),c.__instance._$tooltip.appendTo(c.__instance.option("parent")),c.__instance._trigger({type:"repositioned",event:l,position:e})},__sideChange:function(t,e){t.removeClass("tooltipster-bottom").removeClass("tooltipster-left").removeClass("tooltipster-right").removeClass("tooltipster-top").addClass("tooltipster-"+e)},__targetFind:function(t){var e={},i=this.__instance._$origin[0].getClientRects();1<i.length&&1==this.__instance._$origin.css("opacity")&&(this.__instance._$origin.css("opacity",.99),i=this.__instance._$origin[0].getClientRects(),this.__instance._$origin.css("opacity",1));if(i.length<2)e.top=Math.floor(t.geo.origin.windowOffset.left+t.geo.origin.size.width/2),e.bottom=e.top,e.left=Math.floor(t.geo.origin.windowOffset.top+t.geo.origin.size.height/2),e.right=e.left;else{var n=i[0];e.top=Math.floor(n.left+(n.right-n.left)/2),n=2<i.length?i[Math.ceil(i.length/2)-1]:i[0],e.right=Math.floor(n.top+(n.bottom-n.top)/2),n=i[i.length-1],e.bottom=Math.floor(n.left+(n.right-n.left)/2),n=2<i.length?i[Math.ceil((i.length+1)/2)-1]:i[i.length-1],e.left=Math.floor(n.top+(n.bottom-n.top)/2)}return e}}}),E}),("function"==typeof define&&define.amd?define:function(t,e){"undefined"!=typeof module&&module.exports?module.exports=e(require("jquery")):window.toastr=e(window.jQuery)})(["jquery"],function(_){return L=0,t={clear:function(t,e){var i=v();b||g(i),n(t,i,e)||function(t){for(var e=b.children(),i=e.length-1;0<=i;i--)n(_(e[i]),t)}(i)},remove:function(t){var e=v();return b||g(e),t&&0===_(":focus",t).length?void x(t):void(b.children().length&&b.remove())},error:function(t,e,i){return o({type:uWd.error,iconClass:v().iconClasses.error,message:t,optionsOverride:i,title:e})},getContainer:g,info:function(t,e,i){return o({type:uWd.info,iconClass:v().iconClasses.info,message:t,optionsOverride:i,title:e})},options:{},subscribe:function(t){e=t},success:function(t,e,i){return o({type:uWd.success,iconClass:v().iconClasses.success,message:t,optionsOverride:i,title:e})},version:"2.1.3",warning:function(t,e,i){return o({type:uWd.warning,iconClass:v().iconClasses.warning,message:t,optionsOverride:i,title:e})}};function g(t,e){return t||(t=v()),(b=_("#"+t.containerId)).length||e&&(b=function(t){return(b=_("<div/>").attr("id",t.containerId).addClass(t.positionClass)).appendTo(_(t.target)),b}(t)),b}function n(t,e,i){var n=!(!i||!i.force)&&i.force;return!(!t||!n&&0!==_(":focus",t).length||(t[e.hideMethod]({duration:e.hideDuration,easing:e.hideEasing,complete:function(){x(t)}}),0))}function y(t){e&&e(t)}function o(e){function i(t){return null==t&&(t=""),t.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function n(t){var e=t&&!1!==a.closeMethod?a.closeMethod:a.hideMethod,i=t&&!1!==a.closeDuration?a.closeDuration:a.hideDuration,n=t&&!1!==a.closeEasing?a.closeEasing:a.hideEasing;if(!_(":focus",u).length||t)return clearTimeout(f.intervalId),u[e]({duration:i,easing:n,complete:function(){x(u),clearTimeout(l),a.onHidden&&"hidden"!==m.state&&a.onHidden(),m.state="hidden",m.endTime=new Date,y(m)}})}function t(){(0<a.timeOut||0<a.extendedTimeOut)&&(l=setTimeout(n,a.extendedTimeOut),f.maxHideTime=parseFloat(a.extendedTimeOut),f.hideEta=(new Date).getTime()+f.maxHideTime)}function o(){clearTimeout(l),f.hideEta=0,u.stop(!0,!0)[a.showMethod]({duration:a.showDuration,easing:a.showEasing})}function r(){var t=(f.hideEta-(new Date).getTime())/f.maxHideTime*100;p.width(t+"%")}var a=v(),s=e.iconClass||a.iconClass;if(void 0!==e.optionsOverride&&(a=_.extend(a,e.optionsOverride),s=e.optionsOverride.iconClass||s),!function(t,e){if(t.preventDuplicates){if(e.message===w)return!0;w=e.message}return!1}(a,e)){L++,b=g(a,!0);var l=null,u=_("<div/>"),c=_("<div/>"),h=_("<div/>"),p=_("<div/>"),d=_(a.closeHtml),f={intervalId:null,hideEta:null,maxHideTime:null},m={toastId:L,state:"visible",startTime:new Date,options:a,map:e};return e.iconClass&&u.addClass(a.toastClass).addClass(s),function(){if(e.title){var t=e.title;a.escapeHtml&&(t=i(e.title)),c.append(t).addClass(a.titleClass),u.append(c)}}(),function(){if(e.message){var t=e.message;a.escapeHtml&&(t=i(e.message)),h.append(t).addClass(a.messageClass),u.append(h)}}(),a.closeButton&&(d.addClass(a.closeClass).attr("role","button"),u.prepend(d)),a.progressBar&&(p.addClass(a.progressClass),u.prepend(p)),a.rtl&&u.addClass("rtl"),a.newestOnTop?b.prepend(u):b.append(u),function(){var t="";switch(e.iconClass){case"toast-success":case"toast-info":t="polite";break;default:t="assertive"}u.attr("aria-live",t)}(),u.hide(),u[a.showMethod]({duration:a.showDuration,easing:a.showEasing,complete:a.onShown}),0<a.timeOut&&(l=setTimeout(n,a.timeOut),f.maxHideTime=parseFloat(a.timeOut),f.hideEta=(new Date).getTime()+f.maxHideTime,a.progressBar&&(f.intervalId=setInterval(r,10))),a.closeOnHover&&u.hover(o,t),!a.onclick&&a.tapToDismiss&&u.click(n),a.closeButton&&d&&d.click(function(t){t.stopPropagation?t.stopPropagation():void 0!==t.cancelBubble&&!0!==t.cancelBubble&&(t.cancelBubble=!0),a.onCloseClick&&a.onCloseClick(t),n(!0)}),a.onclick&&u.click(function(t){a.onclick(t),n()}),y(m),a.debug&&console&&console.log(m),u}}function v(){return _.extend({},{tapToDismiss:!0,toastClass:"toast",containerId:"toast-container",debug:!1,showMethod:"fadeIn",showDuration:300,showEasing:"swing",onShown:void 0,hideMethod:"fadeOut",hideDuration:1e3,hideEasing:"swing",onHidden:void 0,closeMethod:!1,closeDuration:!1,closeEasing:!1,closeOnHover:!0,extendedTimeOut:1e3,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},iconClass:"toast-info",positionClass:"toast-top-right",timeOut:5e3,titleClass:"toast-title",messageClass:"toast-message",escapeHtml:!1,target:"body",closeHtml:'<button type="button">×</button>',closeClass:"toast-close-button",newestOnTop:!0,preventDuplicates:!1,progressBar:!1,progressClass:"toast-progress",rtl:!1},t.options)}function x(t){b||(b=g()),t.is(":visible")||(t.remove(),t=null,0===b.children().length&&(b.remove(),w=void 0))}var b,e,w,L,t}),function(l,i,o,s){function a(t,e){this.settings=null,this.options=l.extend({},a.Defaults,e),this.$element=l(t),this._handlers={},this._plugins={},this._supress={},this._current=null,this._speed=null,this._coordinates=[],this._breakpoint=null,this._width=null,this._items=[],this._clones=[],this._mergers=[],this._widths=[],this._invalidated={},this._pipe=[],this._drag={time:null,target:null,pointer:null,stage:{start:null,current:null},direction:null},this._states={current:{},tags:{initializing:["busy"],animating:["busy"],dragging:["interacting"]}},l.each(["onResize","onThrottledResize"],l.proxy(function(t,e){this._handlers[e]=l.proxy(this[e],this)},this)),l.each(a.Plugins,l.proxy(function(t,e){this._plugins[t.charAt(0).toLowerCase()+t.slice(1)]=new e(this)},this)),l.each(a.Workers,l.proxy(function(t,e){this._pipe.push({filter:e.filter,run:l.proxy(e.run,this)})},this)),this.setup(),this.initialize()}a.Defaults={items:3,loop:!1,center:!1,rewind:!1,checkVisibility:!0,mouseDrag:!0,touchDrag:!0,pullDrag:!0,freeDrag:!1,margin:0,stagePadding:0,merge:!1,mergeFit:!0,autoWidth:!1,startPosition:0,rtl:!1,smartSpeed:250,fluidSpeed:!1,dragEndSpeed:!1,responsive:{},responsiveRefreshRate:200,responsiveBaseElement:i,fallbackEasing:"swing",slideTransition:"",info:!1,nestedItemSelector:!1,itemElement:"div",stageElement:"div",refreshClass:"owl-refresh",loadedClass:"owl-loaded",loadingClass:"owl-loading",rtlClass:"owl-rtl",responsiveClass:"owl-responsive",dragClass:"owl-drag",itemClass:"owl-item",stageClass:"owl-stage",stageOuterClass:"owl-stage-outer",grabClass:"owl-grab"},a.Width={Default:"default",Inner:"inner",Outer:"outer"},a.Type={Event:"event",State:"state"},a.Plugins={},a.Workers=[{filter:["width","settings"],run:function(){this._width=this.$element.width()}},{filter:["width","items","settings"],run:function(t){t.current=this._items&&this._items[this.relative(this._current)]}},{filter:["items","settings"],run:function(){this.$stage.children(".cloned").remove()}},{filter:["width","items","settings"],run:function(t){var e=this.settings.margin||"",i=!this.settings.autoWidth,n=this.settings.rtl,o={width:"auto","margin-left":n?e:"","margin-right":n?"":e};i||this.$stage.children().css(o),t.css=o}},{filter:["width","items","settings"],run:function(t){var e=(this.width()/this.settings.items).toFixed(3)-this.settings.margin,i=null,n=this._items.length,o=!this.settings.autoWidth,r=[];for(t.items={merge:!1,width:e};n--;)i=this._mergers[n],i=this.settings.mergeFit&&Math.min(i,this.settings.items)||i,t.items.merge=1<i||t.items.merge,r[n]=o?e*i:this._items[n].width();this._widths=r}},{filter:["items","settings"],run:function(){var t=[],e=this._items,i=this.settings,n=Math.max(2*i.items,4),o=2*Math.ceil(e.length/2),r=i.loop&&e.length?i.rewind?n:Math.max(n,o):0,a="",s="";for(r/=2;0<r;)t.push(this.normalize(t.length/2,!0)),a+=e[t[t.length-1]][0].outerHTML,t.push(this.normalize(e.length-1-(t.length-1)/2,!0)),s=e[t[t.length-1]][0].outerHTML+s,r-=1;this._clones=t,l(a).addClass("cloned").appendTo(this.$stage),l(s).addClass("cloned").prependTo(this.$stage)}},{filter:["width","items","settings"],run:function(){for(var t=this.settings.rtl?1:-1,e=this._clones.length+this._items.length,i=-1,n=0,o=0,r=[];++i<e;)n=r[i-1]||0,o=this._widths[this.relative(i)]+this.settings.margin,r.push(n+o*t);this._coordinates=r}},{filter:["width","items","settings"],run:function(){var t=this.settings.stagePadding,e=this._coordinates,i={width:Math.ceil(Math.abs(e[e.length-1]))+2*t,"padding-left":t||"","padding-right":t||""};this.$stage.css(i)}},{filter:["width","items","settings"],run:function(t){var e=this._coordinates.length,i=!this.settings.autoWidth,n=this.$stage.children();if(i&&t.items.merge)for(;e--;)t.css.width=this._widths[this.relative(e)],n.eq(e).css(t.css);else i&&(t.css.width=t.items.width,n.css(t.css))}},{filter:["items"],run:function(){this._coordinates.length<1&&this.$stage.removeAttr("style")}},{filter:["width","items","settings"],run:function(t){t.current=t.current?this.$stage.children().index(t.current):0,t.current=Math.max(this.minimum(),Math.min(this.maximum(),t.current)),this.reset(t.current)}},{filter:["position"],run:function(){this.animate(this.coordinates(this._current))}},{filter:["width","position","items","settings"],run:function(){var t,e,i,n,o=this.settings.rtl?1:-1,r=2*this.settings.stagePadding,a=this.coordinates(this.current())+r,s=a+this.width()*o,l=[];for(i=0,n=this._coordinates.length;i<n;i++)t=this._coordinates[i-1]||0,e=Math.abs(this._coordinates[i])+r*o,(this.op(t,"<=",a)&&this.op(t,">",s)||this.op(e,"<",a)&&this.op(e,">",s))&&l.push(i);this.$stage.children(".active").removeClass("active"),this.$stage.children(":eq("+l.join("), :eq(")+")").addClass("active"),this.$stage.children(".center").removeClass("center"),this.settings.center&&this.$stage.children().eq(this.current()).addClass("center")}}],a.prototype.initializeStage=function(){this.$stage=this.$element.find("."+this.settings.stageClass),this.$stage.length||(this.$element.addClass(this.options.loadingClass),this.$stage=l("<"+this.settings.stageElement+">",{class:this.settings.stageClass}).wrap(l("<div/>",{class:this.settings.stageOuterClass})),this.$element.append(this.$stage.parent()))},a.prototype.initializeItems=function(){var t=this.$element.find(".owl-item");if(t.length)return this._items=t.get().map(function(t){return l(t)}),this._mergers=this._items.map(function(){return 1}),void this.refresh();this.replace(this.$element.children().not(this.$stage.parent())),this.isVisible()?this.refresh():this.invalidate("width"),this.$element.removeClass(this.options.loadingClass).addClass(this.options.loadedClass)},a.prototype.initialize=function(){var t,e,i;this.enter("initializing"),this.trigger("initialize"),this.$element.toggleClass(this.settings.rtlClass,this.settings.rtl),this.settings.autoWidth&&!this.is("pre-loading")&&(t=this.$element.find("img"),e=this.settings.nestedItemSelector?"."+this.settings.nestedItemSelector:s,i=this.$element.children(e).width(),t.length&&i<=0&&this.preloadAutoWidthImages(t));this.initializeStage(),this.initializeItems(),this.registerEventHandlers(),this.leave("initializing"),this.trigger("initialized")},a.prototype.isVisible=function(){return!this.settings.checkVisibility||this.$element.is(":visible")},a.prototype.setup=function(){var e=this.viewport(),t=this.options.responsive,i=-1,n=null;t?(l.each(t,function(t){t<=e&&i<t&&(i=Number(t))}),"function"==typeof(n=l.extend({},this.options,t[i])).stagePadding&&(n.stagePadding=n.stagePadding()),delete n.responsive,n.responsiveClass&&this.$element.attr("class",this.$element.attr("class").replace(new RegExp("("+this.options.responsiveClass+"-)\\S+\\s","g"),"$1"+i))):n=l.extend({},this.options),this.trigger("change",{property:{name:"settings",value:n}}),this._breakpoint=i,this.settings=n,this.invalidate("settings"),this.trigger("changed",{property:{name:"settings",value:this.settings}})},a.prototype.optionsLogic=function(){this.settings.autoWidth&&(this.settings.stagePadding=!1,this.settings.merge=!1)},a.prototype.prepare=function(t){var e=this.trigger("prepare",{content:t});return e.data||(e.data=l("<"+this.settings.itemElement+"/>").addClass(this.options.itemClass).append(t)),this.trigger("prepared",{content:e.data}),e.data},a.prototype.update=function(){for(var t=0,e=this._pipe.length,i=l.proxy(function(t){return this[t]},this._invalidated),n={};t<e;)(this._invalidated.all||0<l.grep(this._pipe[t].filter,i).length)&&this._pipe[t].run(n),t++;this._invalidated={},this.is("valid")||this.enter("valid")},a.prototype.width=function(t){switch(t=t||a.Width.Default){case a.Width.Inner:case a.Width.Outer:return this._width;default:return this._width-2*this.settings.stagePadding+this.settings.margin}},a.prototype.refresh=function(){this.enter("refreshing"),this.trigger("refresh"),this.setup(),this.optionsLogic(),this.$element.addClass(this.options.refreshClass),this.update(),this.$element.removeClass(this.options.refreshClass),this.leave("refreshing"),this.trigger("refreshed")},a.prototype.onThrottledResize=function(){i.clearTimeout(this.resizeTimer),this.resizeTimer=i.setTimeout(this._handlers.onResize,this.settings.responsiveRefreshRate)},a.prototype.onResize=function(){return!!this._items.length&&this._width!==this.$element.width()&&!!this.isVisible()&&(this.enter("resizing"),this.trigger("resize").isDefaultPrevented()?(this.leave("resizing"),!1):(this.invalidate("width"),this.refresh(),this.leave("resizing"),void this.trigger("resized")))},a.prototype.registerEventHandlers=function(){l.support.transition&&this.$stage.on(l.support.transition.end+".owl.core",l.proxy(this.onTransitionEnd,this)),!1!==this.settings.responsive&&this.on(i,"resize",this._handlers.onThrottledResize),this.settings.mouseDrag&&(this.$element.addClass(this.options.dragClass),this.$stage.on("mousedown.owl.core",l.proxy(this.onDragStart,this)),this.$stage.on("dragstart.owl.core selectstart.owl.core",function(){return!1})),this.settings.touchDrag&&(this.$stage.on("touchstart.owl.core",l.proxy(this.onDragStart,this)),this.$stage.on("touchcancel.owl.core",l.proxy(this.onDragEnd,this)))},a.prototype.onDragStart=function(t){var e=null;3!==t.which&&(e=l.support.transform?{x:(e=this.$stage.css("transform").replace(/.*\(|\)| /g,"").split(","))[16===e.length?12:4],y:e[16===e.length?13:5]}:(e=this.$stage.position(),{x:this.settings.rtl?e.left+this.$stage.width()-this.width()+this.settings.margin:e.left,y:e.top}),this.is("animating")&&(l.support.transform?this.animate(e.x):this.$stage.stop(),this.invalidate("position")),this.$element.toggleClass(this.options.grabClass,"mousedown"===t.type),this.speed(0),this._drag.time=(new Date).getTime(),this._drag.target=l(t.target),this._drag.stage.start=e,this._drag.stage.current=e,this._drag.pointer=this.pointer(t),l(o).on("mouseup.owl.core touchend.owl.core",l.proxy(this.onDragEnd,this)),l(o).one("mousemove.owl.core touchmove.owl.core",l.proxy(function(t){var e=this.difference(this._drag.pointer,this.pointer(t));l(o).on("mousemove.owl.core touchmove.owl.core",l.proxy(this.onDragMove,this)),Math.abs(e.x)<Math.abs(e.y)&&this.is("valid")||(t.preventDefault(),this.enter("dragging"),this.trigger("drag"))},this)))},a.prototype.onDragMove=function(t){var e=null,i=null,n=null,o=this.difference(this._drag.pointer,this.pointer(t)),r=this.difference(this._drag.stage.start,o);this.is("dragging")&&(t.preventDefault(),this.settings.loop?(e=this.coordinates(this.minimum()),i=this.coordinates(this.maximum()+1)-e,r.x=((r.x-e)%i+i)%i+e):(e=this.settings.rtl?this.coordinates(this.maximum()):this.coordinates(this.minimum()),i=this.settings.rtl?this.coordinates(this.minimum()):this.coordinates(this.maximum()),n=this.settings.pullDrag?-1*o.x/5:0,r.x=Math.max(Math.min(r.x,e+n),i+n)),this._drag.stage.current=r,this.animate(r.x))},a.prototype.onDragEnd=function(t){var e=this.difference(this._drag.pointer,this.pointer(t)),i=this._drag.stage.current,n=0<e.x^this.settings.rtl?"left":"right";l(o).off(".owl.core"),this.$element.removeClass(this.options.grabClass),(0!==e.x&&this.is("dragging")||!this.is("valid"))&&(this.speed(this.settings.dragEndSpeed||this.settings.smartSpeed),this.current(this.closest(i.x,0!==e.x?n:this._drag.direction)),this.invalidate("position"),this.update(),this._drag.direction=n,(3<Math.abs(e.x)||300<(new Date).getTime()-this._drag.time)&&this._drag.target.one("click.owl.core",function(){return!1})),this.is("dragging")&&(this.leave("dragging"),this.trigger("dragged"))},a.prototype.closest=function(i,n){var o=-1,r=this.width(),a=this.coordinates();return this.settings.freeDrag||l.each(a,l.proxy(function(t,e){return"left"===n&&e-30<i&&i<e+30?o=t:"right"===n&&e-r-30<i&&i<e-r+30?o=t+1:this.op(i,"<",e)&&this.op(i,">",a[t+1]!==s?a[t+1]:e-r)&&(o="left"===n?t+1:t),-1===o},this)),this.settings.loop||(this.op(i,">",a[this.minimum()])?o=i=this.minimum():this.op(i,"<",a[this.maximum()])&&(o=i=this.maximum())),o},a.prototype.animate=function(t){var e=0<this.speed();this.is("animating")&&this.onTransitionEnd(),e&&(this.enter("animating"),this.trigger("translate")),l.support.transform3d&&l.support.transition?this.$stage.css({transform:"translate3d("+t+"px,0px,0px)",transition:this.speed()/1e3+"s"+(this.settings.slideTransition?" "+this.settings.slideTransition:"")}):e?this.$stage.animate({left:t+"px"},this.speed(),this.settings.fallbackEasing,l.proxy(this.onTransitionEnd,this)):this.$stage.css({left:t+"px"})},a.prototype.is=function(t){return this._states.current[t]&&0<this._states.current[t]},a.prototype.current=function(t){if(t===s)return this._current;if(0===this._items.length)return s;if(t=this.normalize(t),this._current!==t){var e=this.trigger("change",{property:{name:"position",value:t}});e.data!==s&&(t=this.normalize(e.data)),this._current=t,this.invalidate("position"),this.trigger("changed",{property:{name:"position",value:this._current}})}return this._current},a.prototype.invalidate=function(t){return"string"===l.type(t)&&(this._invalidated[t]=!0,this.is("valid")&&this.leave("valid")),l.map(this._invalidated,function(t,e){return e})},a.prototype.reset=function(t){(t=this.normalize(t))!==s&&(this._speed=0,this._current=t,this.suppress(["translate","translated"]),this.animate(this.coordinates(t)),this.release(["translate","translated"]))},a.prototype.normalize=function(t,e){var i=this._items.length,n=e?0:this._clones.length;return!this.isNumeric(t)||i<1?t=s:(t<0||i+n<=t)&&(t=((t-n/2)%i+i)%i+n/2),t},a.prototype.relative=function(t){return t-=this._clones.length/2,this.normalize(t,!0)},a.prototype.maximum=function(t){var e,i,n,o=this.settings,r=this._coordinates.length;if(o.loop)r=this._clones.length/2+this._items.length-1;else if(o.autoWidth||o.merge){if(e=this._items.length)for(i=this._items[--e].width(),n=this.$element.width();e--&&!((i+=this._items[e].width()+this.settings.margin)>n););r=e+1}else r=o.center?this._items.length-1:this._items.length-o.items;return t&&(r-=this._clones.length/2),Math.max(r,0)},a.prototype.minimum=function(t){return t?0:this._clones.length/2},a.prototype.items=function(t){return t===s?this._items.slice():(t=this.normalize(t,!0),this._items[t])},a.prototype.mergers=function(t){return t===s?this._mergers.slice():(t=this.normalize(t,!0),this._mergers[t])},a.prototype.clones=function(i){function n(t){return t%2==0?o+t/2:e-(t+1)/2}var e=this._clones.length/2,o=e+this._items.length;return i===s?l.map(this._clones,function(t,e){return n(e)}):l.map(this._clones,function(t,e){return t===i?n(e):null})},a.prototype.speed=function(t){return t!==s&&(this._speed=t),this._speed},a.prototype.coordinates=function(t){var e,i=1,n=t-1;return t===s?l.map(this._coordinates,l.proxy(function(t,e){return this.coordinates(e)},this)):(this.settings.center?(this.settings.rtl&&(i=-1,n=t+1),e=this._coordinates[t],e+=(this.width()-e+(this._coordinates[n]||0))/2*i):e=this._coordinates[n]||0,e=Math.ceil(e))},a.prototype.duration=function(t,e,i){return 0===i?0:Math.min(Math.max(Math.abs(e-t),1),6)*Math.abs(i||this.settings.smartSpeed)},a.prototype.to=function(t,e){var i=this.current(),n=null,o=t-this.relative(i),r=(0<o)-(o<0),a=this._items.length,s=this.minimum(),l=this.maximum();this.settings.loop?(!this.settings.rewind&&Math.abs(o)>a/2&&(o+=-1*r*a),(n=(((t=i+o)-s)%a+a)%a+s)!==t&&n-o<=l&&0<n-o&&(i=n-o,t=n,this.reset(i))):t=this.settings.rewind?(t%(l+=1)+l)%l:Math.max(s,Math.min(l,t)),this.speed(this.duration(i,t,e)),this.current(t),this.isVisible()&&this.update()},a.prototype.next=function(t){t=t||!1,this.to(this.relative(this.current())+1,t)},a.prototype.prev=function(t){t=t||!1,this.to(this.relative(this.current())-1,t)},a.prototype.onTransitionEnd=function(t){if(t!==s&&(t.stopPropagation(),(t.target||t.srcElement||t.originalTarget)!==this.$stage.get(0)))return!1;this.leave("animating"),this.trigger("translated")},a.prototype.viewport=function(){var t;return this.options.responsiveBaseElement!==i?t=l(this.options.responsiveBaseElement).width():i.innerWidth?t=i.innerWidth:o.documentElement&&o.documentElement.clientWidth?t=o.documentElement.clientWidth:console.warn("Can not detect viewport width."),t},a.prototype.replace=function(t){this.$stage.empty(),this._items=[],t&&(t=t instanceof jQuery?t:l(t)),this.settings.nestedItemSelector&&(t=t.find("."+this.settings.nestedItemSelector)),t.filter(function(){return 1===this.nodeType}).each(l.proxy(function(t,e){e=this.prepare(e),this.$stage.append(e),this._items.push(e),this._mergers.push(1*e.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)},this)),this.reset(this.isNumeric(this.settings.startPosition)?this.settings.startPosition:0),this.invalidate("items")},a.prototype.add=function(t,e){var i=this.relative(this._current);e=e===s?this._items.length:this.normalize(e,!0),t=t instanceof jQuery?t:l(t),this.trigger("add",{content:t,position:e}),t=this.prepare(t),0===this._items.length||e===this._items.length?(0===this._items.length&&this.$stage.append(t),0!==this._items.length&&this._items[e-1].after(t),this._items.push(t),this._mergers.push(1*t.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)):(this._items[e].before(t),this._items.splice(e,0,t),this._mergers.splice(e,0,1*t.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)),this._items[i]&&this.reset(this._items[i].index()),this.invalidate("items"),this.trigger("added",{content:t,position:e})},a.prototype.remove=function(t){(t=this.normalize(t,!0))!==s&&(this.trigger("remove",{content:this._items[t],position:t}),this._items[t].remove(),this._items.splice(t,1),this._mergers.splice(t,1),this.invalidate("items"),this.trigger("removed",{content:null,position:t}))},a.prototype.preloadAutoWidthImages=function(t){t.each(l.proxy(function(t,e){this.enter("pre-loading"),e=l(e),l(new Image).one("load",l.proxy(function(t){e.attr("src",t.target.src),e.css("opacity",1),this.leave("pre-loading"),this.is("pre-loading")||this.is("initializing")||this.refresh()},this)).attr("src",e.attr("src")||e.attr("data-src")||e.attr("data-src-retina"))},this))},a.prototype.destroy=function(){for(var t in this.$element.off(".owl.core"),this.$stage.off(".owl.core"),l(o).off(".owl.core"),!1!==this.settings.responsive&&(i.clearTimeout(this.resizeTimer),this.off(i,"resize",this._handlers.onThrottledResize)),this._plugins)this._plugins[t].destroy();this.$stage.children(".cloned").remove(),this.$stage.unwrap(),this.$stage.children().contents().unwrap(),this.$stage.children().unwrap(),this.$stage.remove(),this.$element.removeClass(this.options.refreshClass).removeClass(this.options.loadingClass).removeClass(this.options.loadedClass).removeClass(this.options.rtlClass).removeClass(this.options.dragClass).removeClass(this.options.grabClass).attr("class",this.$element.attr("class").replace(new RegExp(this.options.responsiveClass+"-\\S+\\s","g"),"")).removeData("owl.carousel")},a.prototype.op=function(t,e,i){var n=this.settings.rtl;switch(e){case"<":return n?i<t:t<i;case">":return n?t<i:i<t;case">=":return n?t<=i:i<=t;case"<=":return n?i<=t:t<=i}},a.prototype.on=function(t,e,i,n){t.addEventListener?t.addEventListener(e,i,n):t.attachEvent&&t.attachEvent("on"+e,i)},a.prototype.off=function(t,e,i,n){t.removeEventListener?t.removeEventListener(e,i,n):t.detachEvent&&t.detachEvent("on"+e,i)},a.prototype.trigger=function(t,e,i){var n={item:{count:this._items.length,index:this.current()}},o=l.camelCase(l.grep(["on",t,i],function(t){return t}).join("-").toLowerCase()),r=l.Event([t,"owl",i||"carousel"].join(".").toLowerCase(),l.extend({relatedTarget:this},n,e));return this._supress[t]||(l.each(this._plugins,function(t,e){e.onTrigger&&e.onTrigger(r)}),this.register({type:a.Type.Event,name:t}),this.$element.trigger(r),this.settings&&"function"==typeof this.settings[o]&&this.settings[o].call(this,r)),r},a.prototype.enter=function(t){l.each([t].concat(this._states.tags[t]||[]),l.proxy(function(t,e){this._states.current[e]===s&&(this._states.current[e]=0),this._states.current[e]++},this))},a.prototype.leave=function(t){l.each([t].concat(this._states.tags[t]||[]),l.proxy(function(t,e){this._states.current[e]--},this))},a.prototype.register=function(i){if(i.type===a.Type.Event){if(l.event.special[i.name]||(l.event.special[i.name]={}),!l.event.special[i.name].owl){var e=l.event.special[i.name]._default;l.event.special[i.name]._default=function(t){return!e||!e.apply||t.namespace&&-1!==t.namespace.indexOf("owl")?t.namespace&&-1<t.namespace.indexOf("owl"):e.apply(this,arguments)},l.event.special[i.name].owl=!0}}else i.type===a.Type.State&&(this._states.tags[i.name]?this._states.tags[i.name]=this._states.tags[i.name].concat(i.tags):this._states.tags[i.name]=i.tags,this._states.tags[i.name]=l.grep(this._states.tags[i.name],l.proxy(function(t,e){return l.inArray(t,this._states.tags[i.name])===e},this)))},a.prototype.suppress=function(t){l.each(t,l.proxy(function(t,e){this._supress[e]=!0},this))},a.prototype.release=function(t){l.each(t,l.proxy(function(t,e){delete this._supress[e]},this))},a.prototype.pointer=function(t){var e={x:null,y:null};return(t=(t=t.originalEvent||t||i.event).touches&&t.touches.length?t.touches[0]:t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t).pageX?(e.x=t.pageX,e.y=t.pageY):(e.x=t.clientX,e.y=t.clientY),e},a.prototype.isNumeric=function(t){return!isNaN(parseFloat(t))},a.prototype.difference=function(t,e){return{x:t.x-e.x,y:t.y-e.y}},l.fn.owlCarousel=function(e){var n=Array.prototype.slice.call(arguments,1);return this.each(function(){var t=l(this),i=t.data("owl.carousel");i||(i=new a(this,"object"==typeof e&&e),t.data("owl.carousel",i),l.each(["next","prev","to","destroy","refresh","replace","add","remove"],function(t,e){i.register({type:a.Type.Event,name:e}),i.$element.on(e+".owl.carousel.core",l.proxy(function(t){t.namespace&&t.relatedTarget!==this&&(this.suppress([e]),i[e].apply(this,[].slice.call(arguments,1)),this.release([e]))},i))})),"string"==typeof e&&"_"!==e.charAt(0)&&i[e].apply(i,n)})},l.fn.owlCarousel.Constructor=a}(window.Zepto||window.jQuery,window,document),function(e,i){var n=function(t){this._core=t,this._interval=null,this._visible=null,this._handlers={"initialized.owl.carousel":e.proxy(function(t){t.namespace&&this._core.settings.autoRefresh&&this.watch()},this)},this._core.options=e.extend({},n.Defaults,this._core.options),this._core.$element.on(this._handlers)};n.Defaults={autoRefresh:!0,autoRefreshInterval:500},n.prototype.watch=function(){this._interval||(this._visible=this._core.isVisible(),this._interval=i.setInterval(e.proxy(this.refresh,this),this._core.settings.autoRefreshInterval))},n.prototype.refresh=function(){this._core.isVisible()!==this._visible&&(this._visible=!this._visible,this._core.$element.toggleClass("owl-hidden",!this._visible),this._visible&&this._core.invalidate("width")&&this._core.refresh())},n.prototype.destroy=function(){var t,e;for(t in i.clearInterval(this._interval),this._handlers)this._core.$element.off(t,this._handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},e.fn.owlCarousel.Constructor.Plugins.AutoRefresh=n}(window.Zepto||window.jQuery,window,document),function(s,r){var e=function(t){this._core=t,this._loaded=[],this._handlers={"initialized.owl.carousel change.owl.carousel resized.owl.carousel":s.proxy(function(t){if(t.namespace&&this._core.settings&&this._core.settings.lazyLoad&&(t.property&&"position"==t.property.name||"initialized"==t.type)){var e=this._core.settings,i=e.center&&Math.ceil(e.items/2)||e.items,n=e.center&&-1*i||0,o=(t.property&&void 0!==t.property.value?t.property.value:this._core.current())+n,r=this._core.clones().length,a=s.proxy(function(t,e){this.load(e)},this);for(0<e.lazyLoadEager&&(i+=e.lazyLoadEager,e.loop&&(o-=e.lazyLoadEager,i++));n++<i;)this.load(r/2+this._core.relative(o)),r&&s.each(this._core.clones(this._core.relative(o)),a),o++}},this)},this._core.options=s.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers)};e.Defaults={lazyLoad:!1,lazyLoadEager:0},e.prototype.load=function(t){var e=this._core.$stage.children().eq(t),i=e&&e.find(".owl-lazy");!i||-1<s.inArray(e.get(0),this._loaded)||(i.each(s.proxy(function(t,e){var i,n=s(e),o=1<r.devicePixelRatio&&n.attr("data-src-retina")||n.attr("data-src")||n.attr("data-srcset");this._core.trigger("load",{element:n,url:o},"lazy"),n.is("img")?n.one("load.owl.lazy",s.proxy(function(){n.css("opacity",1),this._core.trigger("loaded",{element:n,url:o},"lazy")},this)).attr("src",o):n.is("source")?n.one("load.owl.lazy",s.proxy(function(){this._core.trigger("loaded",{element:n,url:o},"lazy")},this)).attr("srcset",o):((i=new Image).onload=s.proxy(function(){n.css({"background-image":'url("'+o+'")',opacity:"1"}),this._core.trigger("loaded",{element:n,url:o},"lazy")},this),i.src=o)},this)),this._loaded.push(e.get(0)))},e.prototype.destroy=function(){var t,e;for(t in this.handlers)this._core.$element.off(t,this.handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},s.fn.owlCarousel.Constructor.Plugins.Lazy=e}(window.Zepto||window.jQuery,window,document),function(a,i){var n=function(t){this._core=t,this._previousHeight=null,this._handlers={"initialized.owl.carousel refreshed.owl.carousel":a.proxy(function(t){t.namespace&&this._core.settings.autoHeight&&this.update()},this),"changed.owl.carousel":a.proxy(function(t){t.namespace&&this._core.settings.autoHeight&&"position"===t.property.name&&this.update()},this),"loaded.owl.lazy":a.proxy(function(t){t.namespace&&this._core.settings.autoHeight&&t.element.closest("."+this._core.settings.itemClass).index()===this._core.current()&&this.update()},this)},this._core.options=a.extend({},n.Defaults,this._core.options),this._core.$element.on(this._handlers),this._intervalId=null;var e=this;a(i).on("load",function(){e._core.settings.autoHeight&&e.update()}),a(i).resize(function(){e._core.settings.autoHeight&&(null!=e._intervalId&&clearTimeout(e._intervalId),e._intervalId=setTimeout(function(){e.update()},250))})};n.Defaults={autoHeight:!1,autoHeightClass:"owl-height"},n.prototype.update=function(){var t=this._core._current,e=t+this._core.settings.items,i=this._core.settings.lazyLoad,n=this._core.$stage.children().toArray().slice(t,e),o=[],r=0;a.each(n,function(t,e){o.push(a(e).height())}),(r=Math.max.apply(null,o))<=1&&i&&this._previousHeight&&(r=this._previousHeight),this._previousHeight=r,this._core.$stage.parent().height(r).addClass(this._core.settings.autoHeightClass)},n.prototype.destroy=function(){var t,e;for(t in this._handlers)this._core.$element.off(t,this._handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},a.fn.owlCarousel.Constructor.Plugins.AutoHeight=n}(window.Zepto||window.jQuery,window,document),function(c,t,e){var i=function(t){this._core=t,this._videos={},this._playing=null,this._handlers={"initialized.owl.carousel":c.proxy(function(t){t.namespace&&this._core.register({type:"state",name:"playing",tags:["interacting"]})},this),"resize.owl.carousel":c.proxy(function(t){t.namespace&&this._core.settings.video&&this.isInFullScreen()&&t.preventDefault()},this),"refreshed.owl.carousel":c.proxy(function(t){t.namespace&&this._core.is("resizing")&&this._core.$stage.find(".cloned .owl-video-frame").remove()},this),"changed.owl.carousel":c.proxy(function(t){t.namespace&&"position"===t.property.name&&this._playing&&this.stop()},this),"prepared.owl.carousel":c.proxy(function(t){if(t.namespace){var e=c(t.content).find(".owl-video");e.length&&(e.css("display","none"),this.fetch(e,c(t.content)))}},this)},this._core.options=c.extend({},i.Defaults,this._core.options),this._core.$element.on(this._handlers),this._core.$element.on("click.owl.video",".owl-video-play-icon",c.proxy(function(t){this.play(t)},this))};i.Defaults={video:!1,videoHeight:!1,videoWidth:!1},i.prototype.fetch=function(t,e){var i=t.attr("data-vimeo-id")?"vimeo":t.attr("data-vzaar-id")?"vzaar":"youtube",n=t.attr("data-vimeo-id")||t.attr("data-youtube-id")||t.attr("data-vzaar-id"),o=t.attr("data-width")||this._core.settings.videoWidth,r=t.attr("data-height")||this._core.settings.videoHeight,a=t.attr("href");if(!a)throw new Error("Missing video URL.");if(-1<(n=a.match(/(http:|https:|)\/\/(player.|www.|app.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com|be\-nocookie\.com)|vzaar\.com)\/(video\/|videos\/|embed\/|channels\/.+\/|groups\/.+\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/))[3].indexOf("youtu"))i="youtube";else if(-1<n[3].indexOf("vimeo"))i="vimeo";else{if(!(-1<n[3].indexOf("vzaar")))throw new Error("Video URL not supported.");i="vzaar"}n=n[6],this._videos[a]={type:i,id:n,width:o,height:r},e.attr("data-video",a),this.thumbnail(t,this._videos[a])},i.prototype.thumbnail=function(e,t){function i(t){'<div class="owl-video-play-icon"></div>',n=u.lazyLoad?c("<div/>",{class:"owl-video-tn "+l,srcType:t}):c("<div/>",{class:"owl-video-tn",style:"opacity:1;background-image:url("+t+")"}),e.after(n),e.after('<div class="owl-video-play-icon"></div>')}var n,o,r=t.width&&t.height?"width:"+t.width+"px;height:"+t.height+"px;":"",a=e.find("img"),s="src",l="",u=this._core.settings;if(e.wrap(c("<div/>",{class:"owl-video-wrapper",style:r})),this._core.settings.lazyLoad&&(s="data-src",l="owl-lazy"),a.length)return i(a.attr(s)),a.remove(),!1;"youtube"===t.type?(o="//img.youtube.com/vi/"+t.id+"/hqdefault.jpg",i(o)):"vimeo"===t.type?c.ajax({type:"GET",url:"//vimeo.com/api/v2/video/"+t.id+".json",jsonp:"callback",dataType:"jsonp",success:function(t){o=t[0].thumbnail_large,i(o)}}):"vzaar"===t.type&&c.ajax({type:"GET",url:"//vzaar.com/api/videos/"+t.id+".json",jsonp:"callback",dataType:"jsonp",success:function(t){o=t.framegrab_url,i(o)}})},i.prototype.stop=function(){this._core.trigger("stop",null,"video"),this._playing.find(".owl-video-frame").remove(),this._playing.removeClass("owl-video-playing"),this._playing=null,this._core.leave("playing"),this._core.trigger("stopped",null,"video")},i.prototype.play=function(t){var e,i=c(t.target).closest("."+this._core.settings.itemClass),n=this._videos[i.attr("data-video")],o=n.width||"100%",r=n.height||this._core.$stage.height();this._playing||(this._core.enter("playing"),this._core.trigger("play",null,"video"),i=this._core.items(this._core.relative(i.index())),this._core.reset(i.index()),(e=c('<iframe frameborder="0" allowfullscreen mozallowfullscreen webkitAllowFullScreen ></iframe>')).attr("height",r),e.attr("width",o),"youtube"===n.type?e.attr("src","//www.youtube.com/embed/"+n.id+"?autoplay=1&rel=0&v="+n.id):"vimeo"===n.type?e.attr("src","//player.vimeo.com/video/"+n.id+"?autoplay=1"):"vzaar"===n.type&&e.attr("src","//view.vzaar.com/"+n.id+"/player?autoplay=true"),c(e).wrap('<div class="owl-video-frame" />').insertAfter(i.find(".owl-video")),this._playing=i.addClass("owl-video-playing"))},i.prototype.isInFullScreen=function(){var t=e.fullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement;return t&&c(t).parent().hasClass("owl-video-frame")},i.prototype.destroy=function(){var t,e;for(t in this._core.$element.off("click.owl.video"),this._handlers)this._core.$element.off(t,this._handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},c.fn.owlCarousel.Constructor.Plugins.Video=i}(window.Zepto||window.jQuery,window,document),function(a){var e=function(t){this.core=t,this.core.options=a.extend({},e.Defaults,this.core.options),this.swapping=!0,this.previous=void 0,this.next=void 0,this.handlers={"change.owl.carousel":a.proxy(function(t){t.namespace&&"position"==t.property.name&&(this.previous=this.core.current(),this.next=t.property.value)},this),"drag.owl.carousel dragged.owl.carousel translated.owl.carousel":a.proxy(function(t){t.namespace&&(this.swapping="translated"==t.type)},this),"translate.owl.carousel":a.proxy(function(t){t.namespace&&this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)&&this.swap()},this)},this.core.$element.on(this.handlers)};e.Defaults={animateOut:!1,animateIn:!1},e.prototype.swap=function(){if(1===this.core.settings.items&&a.support.animation&&a.support.transition){this.core.speed(0);var t,e=a.proxy(this.clear,this),i=this.core.$stage.children().eq(this.previous),n=this.core.$stage.children().eq(this.next),o=this.core.settings.animateIn,r=this.core.settings.animateOut;this.core.current()!==this.previous&&(r&&(t=this.core.coordinates(this.previous)-this.core.coordinates(this.next),i.one(a.support.animation.end,e).css({left:t+"px"}).addClass("animated owl-animated-out").addClass(r)),o&&n.one(a.support.animation.end,e).addClass("animated owl-animated-in").addClass(o))}},e.prototype.clear=function(t){a(t.target).css({left:""}).removeClass("animated owl-animated-out owl-animated-in").removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut),this.core.onTransitionEnd()},e.prototype.destroy=function(){var t,e;for(t in this.handlers)this.core.$element.off(t,this.handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},a.fn.owlCarousel.Constructor.Plugins.Animate=e}(window.Zepto||window.jQuery,window,document),function(n,o,e){var i=function(t){this._core=t,this._call=null,this._time=0,this._timeout=0,this._paused=!0,this._handlers={"changed.owl.carousel":n.proxy(function(t){t.namespace&&"settings"===t.property.name?this._core.settings.autoplay?this.play():this.stop():t.namespace&&"position"===t.property.name&&this._paused&&(this._time=0)},this),"initialized.owl.carousel":n.proxy(function(t){t.namespace&&this._core.settings.autoplay&&this.play()},this),"play.owl.autoplay":n.proxy(function(t,e,i){t.namespace&&this.play(e,i)},this),"stop.owl.autoplay":n.proxy(function(t){t.namespace&&this.stop()},this),"mouseover.owl.autoplay":n.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"mouseleave.owl.autoplay":n.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.play()},this),"touchstart.owl.core":n.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"touchend.owl.core":n.proxy(function(){this._core.settings.autoplayHoverPause&&this.play()},this)},this._core.$element.on(this._handlers),this._core.options=n.extend({},i.Defaults,this._core.options)};i.Defaults={autoplay:!1,autoplayTimeout:5e3,autoplayHoverPause:!1,autoplaySpeed:!1},i.prototype._next=function(t){this._call=o.setTimeout(n.proxy(this._next,this,t),this._timeout*(Math.round(this.read()/this._timeout)+1)-this.read()),this._core.is("interacting")||e.hidden||this._core.next(t||this._core.settings.autoplaySpeed)},i.prototype.read=function(){return(new Date).getTime()-this._time},i.prototype.play=function(t,e){var i;this._core.is("rotating")||this._core.enter("rotating"),t=t||this._core.settings.autoplayTimeout,i=Math.min(this._time%(this._timeout||t),t),this._paused?(this._time=this.read(),this._paused=!1):o.clearTimeout(this._call),this._time+=this.read()%t-i,this._timeout=t,this._call=o.setTimeout(n.proxy(this._next,this,e),t-i)},i.prototype.stop=function(){this._core.is("rotating")&&(this._time=0,this._paused=!0,o.clearTimeout(this._call),this._core.leave("rotating"))},i.prototype.pause=function(){this._core.is("rotating")&&!this._paused&&(this._time=this.read(),this._paused=!0,o.clearTimeout(this._call))},i.prototype.destroy=function(){var t,e;for(t in this.stop(),this._handlers)this._core.$element.off(t,this._handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},n.fn.owlCarousel.Constructor.Plugins.autoplay=i}(window.Zepto||window.jQuery,window,document),function(r){"use strict";var e=function(t){this._core=t,this._initialized=!1,this._pages=[],this._controls={},this._templates=[],this.$element=this._core.$element,this._overrides={next:this._core.next,prev:this._core.prev,to:this._core.to},this._handlers={"prepared.owl.carousel":r.proxy(function(t){t.namespace&&this._core.settings.dotsData&&this._templates.push('<div class="'+this._core.settings.dotClass+'">'+r(t.content).find("[data-dot]").addBack("[data-dot]").attr("data-dot")+"</div>")},this),"added.owl.carousel":r.proxy(function(t){t.namespace&&this._core.settings.dotsData&&this._templates.splice(t.position,0,this._templates.pop())},this),"remove.owl.carousel":r.proxy(function(t){t.namespace&&this._core.settings.dotsData&&this._templates.splice(t.position,1)},this),"changed.owl.carousel":r.proxy(function(t){t.namespace&&"position"==t.property.name&&this.draw()},this),"initialized.owl.carousel":r.proxy(function(t){t.namespace&&!this._initialized&&(this._core.trigger("initialize",null,"navigation"),this.initialize(),this.update(),this.draw(),this._initialized=!0,this._core.trigger("initialized",null,"navigation"))},this),"refreshed.owl.carousel":r.proxy(function(t){t.namespace&&this._initialized&&(this._core.trigger("refresh",null,"navigation"),this.update(),this.draw(),this._core.trigger("refreshed",null,"navigation"))},this)},this._core.options=r.extend({},e.Defaults,this._core.options),this.$element.on(this._handlers)};e.Defaults={nav:!1,navText:['<span aria-label="Previous">‹</span>','<span aria-label="Next">›</span>'],navSpeed:!1,navElement:'button type="button" role="presentation"',navContainer:!1,navContainerClass:"owl-nav",navClass:["owl-prev","owl-next"],slideBy:1,dotClass:"owl-dot",dotsClass:"owl-dots",dots:!0,dotsEach:!1,dotsData:!1,dotsSpeed:!1,dotsContainer:!1},e.prototype.initialize=function(){var t,i=this._core.settings;for(t in this._controls.$relative=(i.navContainer?r(i.navContainer):r("<div>").addClass(i.navContainerClass).appendTo(this.$element)).addClass("disabled"),this._controls.$previous=r("<"+i.navElement+">").addClass(i.navClass[0]).html(i.navText[0]).prependTo(this._controls.$relative).on("click",r.proxy(function(){this.prev(i.navSpeed)},this)),this._controls.$next=r("<"+i.navElement+">").addClass(i.navClass[1]).html(i.navText[1]).appendTo(this._controls.$relative).on("click",r.proxy(function(){this.next(i.navSpeed)},this)),i.dotsData||(this._templates=[r('<button role="button">').addClass(i.dotClass).append(r("<span>")).prop("outerHTML")]),this._controls.$absolute=(i.dotsContainer?r(i.dotsContainer):r("<div>").addClass(i.dotsClass).appendTo(this.$element)).addClass("disabled"),this._controls.$absolute.on("click","button",r.proxy(function(t){var e=r(t.target).parent().is(this._controls.$absolute)?r(t.target).index():r(t.target).parent().index();t.preventDefault(),this.to(e,i.dotsSpeed)},this)),this._overrides)this._core[t]=r.proxy(this[t],this)},e.prototype.destroy=function(){var t,e,i,n,o;for(t in o=this._core.settings,this._handlers)this.$element.off(t,this._handlers[t]);for(e in this._controls)"$relative"===e&&o.navContainer?this._controls[e].html(""):this._controls[e].remove();for(n in this.overides)this._core[n]=this._overrides[n];for(i in Object.getOwnPropertyNames(this))"function"!=typeof this[i]&&(this[i]=null)},e.prototype.update=function(){var t,e,i=this._core.clones().length/2,n=i+this._core.items().length,o=this._core.maximum(!0),r=this._core.settings,a=r.center||r.autoWidth||r.dotsData?1:r.dotsEach||r.items;if("page"!==r.slideBy&&(r.slideBy=Math.min(r.slideBy,r.items)),r.dots||"page"==r.slideBy)for(this._pages=[],t=i,e=0;t<n;t++){if(a<=e||0===e){if(this._pages.push({start:Math.min(o,t-i),end:t-i+a-1}),Math.min(o,t-i)===o)break;e=0,0}e+=this._core.mergers(this._core.relative(t))}},e.prototype.draw=function(){var t,e=this._core.settings,i=this._core.items().length<=e.items,n=this._core.relative(this._core.current()),o=e.loop||e.rewind;this._controls.$relative.toggleClass("disabled",!e.nav||i),e.nav&&(this._controls.$previous.toggleClass("disabled",!o&&n<=this._core.minimum(!0)),this._controls.$next.toggleClass("disabled",!o&&n>=this._core.maximum(!0))),this._controls.$absolute.toggleClass("disabled",!e.dots||i),e.dots&&(t=this._pages.length-this._controls.$absolute.children().length,e.dotsData&&0!=t?this._controls.$absolute.html(this._templates.join("")):0<t?this._controls.$absolute.append(new Array(1+t).join(this._templates[0])):t<0&&this._controls.$absolute.children().slice(t).remove(),this._controls.$absolute.find(".active").removeClass("active"),this._controls.$absolute.children().eq(r.inArray(this.current(),this._pages)).addClass("active"))},e.prototype.onTrigger=function(t){var e=this._core.settings;t.page={index:r.inArray(this.current(),this._pages),count:this._pages.length,size:e&&(e.center||e.autoWidth||e.dotsData?1:e.dotsEach||e.items)}},e.prototype.current=function(){var e=this._core.relative(this._core.current());return r.grep(this._pages,r.proxy(function(t){return t.start<=e&&t.end>=e},this)).pop()},e.prototype.getPosition=function(t){var e,i,n=this._core.settings;return"page"==n.slideBy?(e=r.inArray(this.current(),this._pages),i=this._pages.length,t?++e:--e,e=this._pages[(e%i+i)%i].start):(e=this._core.relative(this._core.current()),i=this._core.items().length,t?e+=n.slideBy:e-=n.slideBy),e},e.prototype.next=function(t){r.proxy(this._overrides.to,this._core)(this.getPosition(!0),t)},e.prototype.prev=function(t){r.proxy(this._overrides.to,this._core)(this.getPosition(!1),t)},e.prototype.to=function(t,e,i){var n;!i&&this._pages.length?(n=this._pages.length,r.proxy(this._overrides.to,this._core)(this._pages[(t%n+n)%n].start,e)):r.proxy(this._overrides.to,this._core)(t,e)},r.fn.owlCarousel.Constructor.Plugins.Navigation=e}(window.Zepto||window.jQuery,window,document),function(n,o){"use strict";var e=function(t){this._core=t,this._hashes={},this.$element=this._core.$element,this._handlers={"initialized.owl.carousel":n.proxy(function(t){t.namespace&&"URLHash"===this._core.settings.startPosition&&n(o).trigger("hashchange.owl.navigation")},this),"prepared.owl.carousel":n.proxy(function(t){if(t.namespace){var e=n(t.content).find("[data-hash]").addBack("[data-hash]").attr("data-hash");if(!e)return;this._hashes[e]=t.content}},this),"changed.owl.carousel":n.proxy(function(t){if(t.namespace&&"position"===t.property.name){var i=this._core.items(this._core.relative(this._core.current())),e=n.map(this._hashes,function(t,e){return t===i?e:null}).join();if(!e||o.location.hash.slice(1)===e)return;o.location.hash=e}},this)},this._core.options=n.extend({},e.Defaults,this._core.options),this.$element.on(this._handlers),n(o).on("hashchange.owl.navigation",n.proxy(function(){var t=o.location.hash.substring(1),e=this._core.$stage.children(),i=this._hashes[t]&&e.index(this._hashes[t]);void 0!==i&&i!==this._core.current()&&this._core.to(this._core.relative(i),!1,!0)},this))};e.Defaults={URLhashListener:!1},e.prototype.destroy=function(){var t,e;for(t in n(o).off("hashchange.owl.navigation"),this._handlers)this._core.$element.off(t,this._handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},n.fn.owlCarousel.Constructor.Plugins.Hash=e}(window.Zepto||window.jQuery,window,document),function(o,t,e,r){function i(t,i){var n=!1,e=t.charAt(0).toUpperCase()+t.slice(1);return o.each((t+" "+s.join(e+" ")+e).split(" "),function(t,e){if(a[e]!==r)return n=!i||e,!1}),n}function n(t){return i(t,!0)}var a=o("<support>").get(0).style,s="Webkit Moz O ms".split(" "),l={transition:{end:{WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"}},animation:{end:{WebkitAnimation:"webkitAnimationEnd",MozAnimation:"animationend",OAnimation:"oAnimationEnd",animation:"animationend"}}},u=function(){return!!i("transform")},c=function(){return!!i("perspective")},h=function(){return!!i("animation")};!function(){return!!i("transition")}()||(o.support.transition=new String(n("transition")),o.support.transition.end=l.transition.end[o.support.transition]),h()&&(o.support.animation=new String(n("animation")),o.support.animation.end=l.animation.end[o.support.animation]),u()&&(o.support.transform=new String(n("transform")),o.support.transform3d=c())}(window.Zepto||window.jQuery,window,document),function(t){t.fn.massToggleDisplay=function(){return this.each(function(){t(".mass-hide").not(this).removeClass("display-block").addClass("display-none"),t(this).toggleClass("display-block").toggleClass("display-none")})}}(jQuery),function(t){t.fn.toggleDisplay=function(){return this.each(function(){t(this).toggleClass("display-none").toggleClass("display-block")})}}(jQuery),function(t){t.fn.showDisplay=function(){return this.each(function(){t(this).removeClass("display-none").addClass("display-block")})}}(jQuery),function(t){t.fn.hideDisplay=function(){return this.each(function(){t(this).removeClass("display-block").addClass("display-none")})}}(jQuery),function(t){t.fn.massToggleVisibility=function(){return this.each(function(){t(".mass-hide").not(this).each(function(){t(this).hasClass("is-active")?t(this).toggleClass("is-active"):t(this).removeClass("is-visible").addClass("is-invisible")}),t(this).toggleClass("is-visible")})}}(jQuery),function(t){t.fn.toggleVisibility=function(){return this.each(function(){t(this).toggleClass("is-invisible").toggleClass("is-visible")})}}(jQuery),function(t){t.fn.showVisibility=function(){return this.each(function(){t(this).removeClass("is-invisible").addClass("is-visible")})}}(jQuery),function(t){t.fn.hideVisibility=function(){return this.each(function(){t(this).removeClass("is-visible").addClass("is-invisible")})}}(jQuery),function(i){i.clearButton={add:function(){},check:function(){},listen:function(){}},i.clearButton.add=function(t){var e=i.extend({selector:".has-clear"},t);i(e.selector).append('<div class="clear"></div>'),i(e.selector).each(function(){i.clearButton.check(),i.clearButton.listen()})},i.clearButton.check=function(t){var e=i.extend({selector:".has-clear"},t);i(e.selector).each(function(){var t=i(this).find(".clear");0<i(this).find("input").val().length?t.css({display:"block"}):t.css({display:"none"})})},i.clearButton.listen=function(t){var e=i.extend({selector:".has-clear"},t);i(e.selector).each(function(){var t=i(this).find(".clear"),e=i(this).find("input");e.on("keyup",function(){i.clearButton.check()}),t.on("click",function(){e.val(""),i.clearButton.check()})})}}(jQuery),function(l){l.toggleSelect=function(t){var e,i=l.extend({before:function(){},after:function(){},change:function(){},selector:".toggle-select"},t),n=l(i.selector),o=n.find("ul");i.before(),n.append('<div class="icon-toggle-select"></div>');var r=n.find(".icon-toggle-select");n.append('<ul class="open is-invisible"></ul>');var a=l(i.selector).find(".open");return a.html(o.html()),o.addClass("closed"),l(window).on("click",function(){a.hideVisibility()}),o.add(r).on("click",function(t){t.preventDefault(),t.stopPropagation(),a.toggleVisibility()}),a.find("li").on("click",function(t){t.preventDefault(),t.stopPropagation(),function(t){o.find("li").removeClass("is-active"),a.find("li").removeClass("is-active"),o.find("li").filter('[data-value="'+t+'"]').addClass("is-active"),a.find("li").filter('[data-value="'+t+'"]').addClass("is-active"),a.hideVisibility(),s(),i.change(e)}(l(this).attr("data-value"))}),s(),i.after(),e;function s(){e=o.find("li.is-active").attr("data-value")}}}(jQuery);var polyline={};function py2_round(t){return Math.floor(Math.abs(t)+.5)*Math.sign(t)}function encode(t,e,i){var n=(t=py2_round(t*i))-(e=py2_round(e*i));n<<=1,t-e<0&&(n=~n);for(var o="";32<=n;)o+=String.fromCharCode(63+(32|31&n)),n>>=5;return o+=String.fromCharCode(n+63)}function flipped(t){for(var e=[],i=0;i<t.length;i++)e.push(t[i].slice().reverse());return e}function callAjax(t,e,i){var n;(n=new XMLHttpRequest).responseType="blob",n.onreadystatechange=function(){4==n.readyState&&200==n.status&&e(n.response)},n.open("GET",t,!0);var o=!0,r=!1,a=void 0;try{for(var s,l=i[Symbol.iterator]();!(o=(s=l.next()).done);o=!0){var u=s.value;n.setRequestHeader(u.header,u.value)}}catch(t){r=!0,a=t}finally{try{o||null==l.return||l.return()}finally{if(r)throw a}}n.send()}function Mapp(t){var e;this.settings=$.extend(!0,{before:function(){},after:function(){},mode:"production",element:"#app",boxZoom:!1,minZoom:1,maxZoom:18,presets:{latlng:{lat:0,lng:0},zoom:6},renderer:"",i18n:{},locale:"fa",apiKey:void 0,dragging:!0,gestureHandling:!1,userAgent:"web-maps/1.4.2"},t),this.settings.apiKey||console.warn("%cMap.ir %c| No API-Key is Provided or it's invalid. Please contact our support: support@map.ir","font-weight: bold;",""),this.id="mapp-"+this.settings.element.replace("#",""),this.popupOptions={closeButton:!1},this.groups={},this.clusters={},this.history={features:{markers:JSON.parse(localStorage.getItem("markerHistory"))||[],polygons:JSON.parse(localStorage.getItem("polygonHistory"))||[],polylines:JSON.parse(localStorage.getItem("polylineHistory"))||[]}},this.currentPanel,this.presets={locale:localStorage.getItem("locale")||this.settings.locale,layers:{base:JSON.parse(localStorage.getItem("static-baselayer")),over:JSON.parse(localStorage.getItem("static-overlayers"))},search:{type:localStorage.getItem("searchType")}},this.directions={direct:"fa"===this.presets.locale||"ar"===this.presets.locale?"right":"left",reverse:"fa"===this.presets.locale||"ar"===this.presets.locale?"left":"right"},this.env=$.env({mode:this.settings.mode}),this.states={user:{},current:{},click:{},contextmenu:{},mouse:{}},this.states.current=Object.assign({},$.extend(this.settings.presets,this.states.current)),this.states.mouse=Object.assign({},$.extend(this.settings.presets,this.states.current)),this.states.click=Object.assign({},$.extend(this.settings.presets,this.states.current)),this.states.contextmenu=Object.assign({},$.extend(this.settings.presets,this.states.current)),this.dom={html:$("html"),body:$("body"),container:{},map:{},loader:{},overlay:{},panels:{},footer:{element:{},triggers:{left:{},right:{}}},anchors:{top:{direct:{},middle:{},reverse:{}},center:{direct:{},middle:{},reverse:{}},bottom:{direct:{},middle:{},reverse:{}}}};var i='<div class="mapp-container"><div id="'+this.id+'" class="mapp-map"></div><div class="mapp-anchor top position-direct direct item-set horizontal"></div><div class="mapp-anchor top position-middle direct item-set horizontal"></div><div class="mapp-anchor top position-reverse reverse item-set horizontal"></div><div class="mapp-anchor center position-direct"></div><div class="mapp-anchor center position-middle"></div><div class="mapp-anchor center position-reverse"></div><div class="mapp-anchor bottom position-direct direct item-set horizontal"></div><div class="mapp-anchor bottom position-middle reverse item-set vertical"><a class="mapp-logo" href="http://corp.map.ir"></a></div><div class="mapp-anchor bottom position-reverse reverse item-set horizontal"></div><div class="mapp-footer"><div class="item-set vertical centered triggers right"></div><div class="item-set vertical centered triggers left"></div><div class="contents"></div></div><div class="mapp-overlay is-invisible"></div></div><div class="mapp-loader is-visible"></div>';$(this.settings.element).append(i),this.dom.container=$(this.settings.element).find(".mapp-container"),this.dom.map=$(this.settings.element).find(".mapp-map"),this.dom.loader=$(this.settings.element).find(".mapp-loader"),this.dom.overlay=$(this.settings.element).find(".mapp-overlay"),this.dom.footer.element=$(this.settings.element).find(".mapp-footer"),this.dom.footer.triggers.left=this.dom.footer.element.find(".triggers.left"),this.dom.footer.triggers.right=this.dom.footer.element.find(".triggers.right"),this.dom.anchors.top.direct=$(this.settings.element).find(".top.position-direct"),this.dom.anchors.top.middle=$(this.settings.element).find(".top.position-middle"),this.dom.anchors.top.reverse=$(this.settings.element).find(".top.position-reverse"),this.dom.anchors.center.direct=$(this.settings.element).find(".center.position-direct"),this.dom.anchors.center.middle=$(this.settings.element).find(".center.position-middle"),this.dom.anchors.center.reverse=$(this.settings.element).find(".center.position-reverse"),this.dom.anchors.bottom.direct=$(this.settings.element).find(".bottom.position-direct"),this.dom.anchors.bottom.middle=$(this.settings.element).find(".bottom.position-middle"),this.dom.anchors.bottom.reverse=$(this.settings.element).find(".bottom.position-reverse"),$(".mapp-container").parent().css({overflow:"hidden",position:"relative"}),this.dom.container.attr("data-locale",this.presets.locale),this.settings.gestureHandling&&(this.settings.gestureHandlingOptions=$.extend(!0,{duration:1e3,locale:this.presets.locale},t.gestureHandlingOptions)),this.map=L.map(this.id,{attributionControl:!1,boxZoom:this.settings.boxZoom,minZoom:this.settings.minZoom,maxZoom:this.settings.maxZoom,zoomControl:!1,worldCopyJump:!0,renderer:"svg"===this.settings.renderer?L.svg():"canvas"===this.settings.renderer?L.canvas():void 0,dragging:this.settings.dragging,gestureHandling:this.settings.gestureHandling,gestureHandlingOptions:this.settings.gestureHandlingOptions}),this.map.setView(this.states.current.latlng,this.states.current.zoom),L.Icon.Default.imagePath=mappWd+"assets/images/",e=this,$.i18n().load(this.settings.i18n),$.i18n().load({fa:mappWd+"assets/languages/fa.json",en:mappWd+"assets/languages/en.json"}).done(function(){e.settings.before(),e.loadMap({before:function(){$.i18n({locale:e.presets.locale})},after:function(){e.setLocale({locale:e.presets.locale,after:function(){e.applyTooltips()}})}}),e.settings.after()})}function reverseCoordinates(t){var e="array"===$.type(t[0][0])?t[0]:t;return $.each(e,function(t,e){e.reverse()}),t}function getMappWd(t){$("body").append('<div class="mapp-path-finder"></div>');var e=document.querySelector(".mapp-path-finder"),i=(e instanceof Element&&(e.currentStyle||window.getComputedStyle(e,!1)).backgroundImage||"").slice(4,-1).replace(/"/g,""),n=i.substring(0,i.lastIndexOf(t))+"/";return $(".mapp-path-finder").remove(),n}polyline.decode=function(t,e){for(var i,n=0,o=0,r=0,a=[],s=0,l=0,u=null,c=Math.pow(10,e||5);n<t.length;){for(u=null,l=s=0;l|=(31&(u=t.charCodeAt(n++)-63))<<s,s+=5,32<=u;);for(i=1&l?~(l>>1):l>>1,s=l=0;l|=(31&(u=t.charCodeAt(n++)-63))<<s,s+=5,32<=u;);o+=i,r+=1&l?~(l>>1):l>>1,a.push([o/c,r/c])}return a},polyline.encode=function(t,e){if(!t.length)return"";for(var i=Math.pow(10,e||5),n=encode(t[0][0],0,i)+encode(t[0][1],0,i),o=1;o<t.length;o++){var r=t[o],a=t[o-1];n+=encode(r[0],a[0],i),n+=encode(r[1],a[1],i)}return n},polyline.fromGeoJSON=function(t,e){if(t&&"Feature"===t.type&&(t=t.geometry),!t||"LineString"!==t.type)throw new Error("Input must be a GeoJSON LineString");return polyline.encode(flipped(t.coordinates),e)},polyline.toGeoJSON=function(t,e){return{type:"LineString",coordinates:flipped(polyline.decode(t,e))}},"object"==typeof module&&module.exports&&(module.exports=polyline),function(a,h,p){function d(t,e){return typeof t===e}function f(t){return"function"!=typeof h.createElement?h.createElement(t):y?h.createElementNS.call(h,"http://www.w3.org/2000/svg",t):h.createElement.apply(h,arguments)}function m(t){return t.replace(/([a-z])-([a-z])/g,function(t,e,i){return e+i.toUpperCase()}).replace(/^-/,"")}function s(t,e){return function(){return t.apply(e,arguments)}}function o(t){return t.replace(/([A-Z])/g,function(t,e){return"-"+e.toLowerCase()}).replace(/^ms-/,"-ms-")}function r(t,e,i,n){var o,r,a,s,l="modernizr",u=f("div"),c=function(){var t=h.body;return t||((t=f(y?"svg":"body")).fake=!0),t}();if(parseInt(i,10))for(;i--;)(a=f("div")).id=n?n[i]:l+(i+1),u.appendChild(a);return(o=f("style")).type="text/css",o.id="s"+l,(c.fake?c:u).appendChild(o),c.appendChild(u),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(h.createTextNode(t)),u.id=l,c.fake&&(c.style.background="",c.style.overflow="hidden",s=g.style.overflow,g.style.overflow="hidden",g.appendChild(c)),r=e(u,t),c.fake?(c.parentNode.removeChild(c),g.style.overflow=s,g.offsetHeight):u.parentNode.removeChild(u),!!r}function _(t,e){var i=t.length;if("CSS"in a&&"supports"in a.CSS){for(;i--;)if(a.CSS.supports(o(t[i]),e))return!0;return!1}if("CSSSupportsRule"in a){for(var n=[];i--;)n.push("("+o(t[i])+":"+e+")");return r("@supports ("+(n=n.join(" or "))+") { #modernizr { position: absolute; } }",function(t){return"absolute"==function(t,e,i){var n;if("getComputedStyle"in a){n=getComputedStyle.call(a,t,e);var o=a.console;if(null!==n)i&&(n=n.getPropertyValue(i));else if(o){o[o.error?"error":"log"].call(o,"getComputedStyle returning null, its possible modernizr test results are inaccurate")}}else n=!e&&t.currentStyle&&t.currentStyle[i];return n}(t,null,"position")})}return p}function n(t,e,i,n,o){var r=t.charAt(0).toUpperCase()+t.slice(1),a=(t+" "+w.join(r+" ")+r).split(" ");return d(e,"string")||d(e,"undefined")?function(t,e,i,n){function o(){a&&(delete E.style,delete E.modElem)}if(n=!d(n,"undefined")&&n,!d(i,"undefined")){var r=_(t,i);if(!d(r,"undefined"))return r}for(var a,s,l,u,c,h=["modernizr","tspan","samp"];!E.style&&h.length;)a=!0,E.modElem=f(h.shift()),E.style=E.modElem.style;for(l=t.length,s=0;s<l;s++)if(u=t[s],c=E.style[u],!~(""+u).indexOf("-")||(u=m(u)),E.style[u]!==p){if(n||d(i,"undefined"))return o(),"pfx"!=e||u;try{E.style[u]=i}catch(t){}if(E.style[u]!=c)return o(),"pfx"!=e||u}return o(),!1}(a,e,n,o):function(t,e,i){var n;for(var o in t)if(t[o]in e)return!1===i?t[o]:d(n=e[t[o]],"function")?s(n,i||e):n;return!1}(a=(t+" "+k.join(r+" ")+r).split(" "),e,i)}function e(t,e,i){return n(t,p,p,e,i)}var l=[],u=[],t={_version:"3.5.0",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(t,e){var i=this;setTimeout(function(){e(i[t])},0)},addTest:function(t,e,i){u.push({name:t,fn:e,options:i})},addAsyncTest:function(t){u.push({name:null,fn:t})}},c=function(){};c.prototype=t,(c=new c).addTest("geolocation","geolocation"in navigator),c.addTest("history",function(){var t=navigator.userAgent;return(-1===t.indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone")||"file:"===location.protocol)&&(a.history&&"pushState"in a.history)}),c.addTest("svg",!!h.createElementNS&&!!h.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect),c.addTest("atobbtoa","atob"in a&&"btoa"in a,{aliases:["atob-btoa"]});var g=h.documentElement,y="svg"===g.nodeName.toLowerCase();c.addTest("canvas",function(){var t=f("canvas");return!(!t.getContext||!t.getContext("2d"))}),c.addTest("webgl",function(){var t=f("canvas"),e="probablySupportsContext"in t?"probablySupportsContext":"supportsContext";return e in t?t[e]("webgl")||t[e]("experimental-webgl"):"WebGLRenderingContext"in a});var v=t._config.usePrefixes?" -webkit- -moz- -o- -ms- ".split(" "):["",""];t._prefixes=v;var i="CSS"in a&&"supports"in a.CSS,x="supportsCSS"in a;c.addTest("supports",i||x);var b="Moz O ms Webkit",w=t._config.usePrefixes?b.split(" "):[];t._cssomPrefixes=w;function L(t){var e,i=v.length,n=a.CSSRule;if(void 0===n)return p;if(!t)return!1;if((e=(t=t.replace(/^@/,"")).replace(/-/g,"_").toUpperCase()+"_RULE")in n)return"@"+t;for(var o=0;o<i;o++){var r=v[o];if(r.toUpperCase()+"_"+e in n)return"@-"+r.toLowerCase()+"-"+t}return!1}t.atRule=L;var k=t._config.usePrefixes?b.toLowerCase().split(" "):[];t._domPrefixes=k;var T={elem:f("modernizr")};c._q.push(function(){delete T.elem});var E={style:T.elem.style};c._q.unshift(function(){delete E.style}),t.testAllProps=n;var M=t.prefixed=function(t,e,i){return 0===t.indexOf("@")?L(t):(-1!=t.indexOf("-")&&(t=m(t)),e?n(t,e,i):n(t,"pfx"))};c.addTest("fullscreen",!(!M("exitFullscreen",h,!1)&&!M("cancelFullScreen",h,!1))),t.testAllProps=e,c.addTest("cssfilters",function(){if(c.supports)return e("filter","blur(2px)");var t=f("a");return t.style.cssText=v.join("filter:blur(2px); "),!!t.style.length&&(h.documentMode===p||9<h.documentMode)}),c.addTest("cssmask",e("maskRepeat","repeat-x",!0)),function(){var t,e,i,n,o,r;for(var a in u)if(u.hasOwnProperty(a)){if(t=[],(e=u[a]).name&&(t.push(e.name.toLowerCase()),e.options&&e.options.aliases&&e.options.aliases.length))for(i=0;i<e.options.aliases.length;i++)t.push(e.options.aliases[i].toLowerCase());for(n=d(e.fn,"function")?e.fn():e.fn,o=0;o<t.length;o++)1===(r=t[o].split(".")).length?c[r[0]]=n:(!c[r[0]]||c[r[0]]instanceof Boolean||(c[r[0]]=new Boolean(c[r[0]])),c[r[0]][r[1]]=n),l.push((n?"":"no-")+r.join("-"))}}(),function(t){var e=g.className,i=c._config.classPrefix||"";if(y&&(e=e.baseVal),c._config.enableJSClass){var n=new RegExp("(^|\\s)"+i+"no-js(\\s|$)");e=e.replace(n,"$1"+i+"js$2")}c._config.enableClasses&&(e+=" "+i+t.join(" "+i),y?g.className.baseVal=e:g.className=e)}(l),delete t.addTest,delete t.addAsyncTest;for(var C=0;C<c._q.length;C++)c._q[C]();a.Modernizr=c}(window,document),L.TileLayer.WMSHeader=L.TileLayer.WMS.extend({initialize:function(t,e,i){L.TileLayer.WMS.prototype.initialize.call(this,t,e),i.push({header:"Mapir-SDK",value:"web-maps/1.4.2"}),this.headers=i},createTile:function(t,e){var i=this.getTileUrl(t),n=document.createElement("img");return callAjax(i,function(t){n.src=URL.createObjectURL(t),e(null,n)},this.headers),n}}),L.TileLayer.wmsHeader=function(t,e,i){return new L.TileLayer.WMSHeader(t,e,i)},Mapp.prototype.getInstance=function(){return this},Mapp.prototype.updateStateUser=function(t){this.states.user.bounds=this.map.getBounds(),this.states.user.latlng=t||this.map.getCenter(),this.states.user.zoom=this.map.getZoom()},Mapp.prototype.updateStateCurrent=function(){this.states.current.bounds=this.map.getBounds(),this.states.current.latlng=this.map.getCenter(),this.states.current.zoom=this.map.getZoom()},Mapp.prototype.updateStateClick=function(t){this.states.click.bounds=this.map.getBounds(),this.states.click.latlng=t||this.map.getCenter(),this.states.click.zoom=this.map.getZoom()},Mapp.prototype.updateStateMouse=function(t){this.states.mouse.bounds=this.map.getBounds(),this.states.mouse.latlng=t||this.map.getCenter(),this.states.mouse.zoom=this.map.getZoom()},Mapp.prototype.updateStateContextmenu=function(t){this.states.contextmenu.bounds=this.map.getBounds(),this.states.contextmenu.latlng=t||this.map.getCenter(),this.states.contextmenu.zoom=this.map.getZoom()},Mapp.prototype.applyTooltips=function(){$(this.settings.element).find(".tooltip-bottom").not(".tooltipstered").tooltipster({theme:"tooltipster-shadow",animation:"fade",delay:500,trigger:"hover",side:["bottom","top",this.directions.direct,this.directions.reverse]}),$(this.settings.element).find(".tooltip-right").not(".tooltipstered").tooltipster({theme:"tooltipster-shadow",animation:"fade",delay:500,trigger:"hover",side:[this.directions.direct,this.directions.reverse,"bottom","top"]}),$(this.settings.element).find(".tooltip-top").not(".tooltipstered").tooltipster({theme:"tooltipster-shadow",animation:"fade",delay:500,trigger:"hover",side:["top","bottom",this.directions.direct,this.directions.reverse]}),$(this.settings.element).find(".tooltip-left").not(".tooltipstered").tooltipster({theme:"tooltipster-shadow",animation:"fade",delay:500,trigger:"hover",side:[this.directions.reverse,this.directions.direct,"bottom","top"]})},Mapp.prototype.destroyTooltips=function(){$(this.settings.element).find(".tooltipstered").tooltipster("destroy")},Mapp.prototype.loadMap=function(t){var e,i=$.extend(!0,{before:function(){},after:function(){}},t);e=this,i.before(),this.map.on("zoomend",function(){e.updateStateCurrent()}),this.map.on("moveend",function(){e.updateStateCurrent()}),this.map.on("click",function(t){e.updateStateClick(t.latlng)}),this.map.on("mousemove",function(t){e.updateStateMouse(t.latlng)}),this.map.on("contextmenu",function(t){e.updateStateContextmenu(t.latlng)}),this.updateStateCurrent(),this.updateStateClick(),this.updateStateMouse(),this.updateStateContextmenu(),this.map.on("popupopen",function(t){e.getFeatureInfoFromPopupOpen(t);$(".mapp-map").i18n(),e.applyTooltips()}),$.clearButton.add(),this.dom.overlay.on("click",function(t){e.dom.overlay.hideVisibility(),e.wipeModal(),e.closePanels(t)}),i.after()},Mapp.prototype.setLocale=function(t){var e=$.extend(!0,{before:function(){},after:function(){},locale:this.presets.locale},t);e.before(),this.replaceResource({before:function(){$(".mapp-container").css("display","none"),$(".mapp-loader").showVisibility()},after:function(){$(".mapp-container").css("display","block"),$(".mapp-loader").hideVisibility()},locale:e.locale}),localStorage.setItem("locale",this.presets.locale=e.locale),$.i18n({locale:e.locale}),$("title").i18n(),$(this.settings.element).i18n(),this.dom.html.attr("data-locale",e.locale),this.directions.direct="fa"===this.presets.locale||"ar"===this.presets.locale?"right":"left",this.directions.reverse="fa"===this.presets.locale||"ar"===this.presets.locale?"left":"right",e.after()},Mapp.prototype.openPanel=function(t){var e=$.extend(!0,{event:{},type:"",overlay:!0},t);this.wipeModal(),this.closePanels(e.event),this.currentPanel=e.type,$(this.settings.element).find(".panel-aside").hideVisibility(),this.dom.panels[e.type].element.showVisibility(),this.dom.container.addClass("is-active"),e.overlay&&this.dom.overlay.showVisibility()},Mapp.prototype.closePanels=function(t){t.preventDefault(),t.stopPropagation(),$(this.settings.element).find(".panel-aside").hideVisibility(),this.dom.container.removeClass("is-active")},Mapp.prototype.generateURL=function(t){var e=$.extend(!0,{before:function(){},after:function(){},lat:0,lng:0,zoom:6,domain:"none"},t);e.before();var i="/#/lat/"+e.lat.toFixed(5)+"/lng/"+e.lng.toFixed(5)+"/z/"+e.zoom;return"none"===e.domain&&(i=i),"href"===e.domain&&(i=this.env.href+i),i=i.replace(/\/\/#/g,"/#"),e.after(),i},Mapp.prototype.generateLatlngHtml=function(t){var e=$.extend(!0,{before:function(){},after:function(){},lat:0,lng:0,type:"inline"},t);e.before();var i="";return"comma"===e.type&&(i=e.lat.toFixed(5)+", "+e.lng.toFixed(5)),"inline"===e.type&&(i='<span class="latlng-string data-i18n="'+e.lat.toFixed(5)+", "+e.lng.toFixed(5)+'"></span>'),"block"===e.type&&(i='<div class="latlng-string"><span data-i18n="mapp-latitude"></span>: '+e.lat.toFixed(5)+'<br /><span data-i18n="mapp-longitude"></span>: '+e.lng.toFixed(5)+"</div>"),e.after(),i},Mapp.prototype.generateDmsHtml=function(t){var e=$.extend(!0,{before:function(){},after:function(){},lat:0,lng:0,type:"inline"},t);e.before();var i="",n=this.degreeToDms(e.lat),o=this.degreeToDms(e.lng),r=n.degree+"°"+n.minute+"'"+n.second+'"',a=o.degree+"°"+o.minute+"'"+o.second+'"';return"comma"===e.type&&(i=r+", "+a),"inline"===e.type&&(i='<span class="latlng-string data-i18n="'+r+", "+a+'"></span>'),"block"===e.type&&(i='<div class="latlng-string"><span data-i18n="mapp-latitude"></span>: '+r+'<br /><span data-i18n="mapp-longitude"></span>: '+a+"</div>"),e.after(),i},Mapp.prototype.generatePopupHtml=function(t){var e=$.extend(!0,{title:{html:"",i18n:""},description:{html:"",i18n:""},class:"",featureGroup:"",featureId:""},t);return e.class=""===e.class?' class="feature-popup"':' class="feature-popup feature-popup-'+e.class+'"',e.featureGroup=""===e.featureGroup?"":' data-feature-group="'+e.featureGroup+'"',e.featureId=""===e.featureId?"":' data-feature-id="'+e.featureId+'"',e.title.i18n=""===e.title.i18n?"":' data-i18n="'+e.title.i18n+'"',e.description.i18n=""===e.description.i18n?"":' data-i18n="'+e.description.i18n+'"',"<div"+e.class+e.featureGroup+e.featureId+'><header class="popup-header"'+e.title.i18n+">"+e.title.html+'</header><div class="popup-contents"'+e.description.i18n+"><p>"+e.description.html+"</p></div></div>"},Mapp.prototype.getFeatureInfoFromPopupOpen=function(t){var e,i,n=t.popup._source;return{feature:n,featureGroup:e=void 0!==n.options.featureGroup?n.options.featureGroup:void 0!==n.options.icon&&void 0!==n.options.icon.options.featureGroup?n.options.icon.options.featureGroup:"unset",featureId:i=void 0!==n.options.featureId?n.options.featureId:void 0!==n.options.icon&&void 0!==n.options.icon.options.featureId?n.options.icon.options.featureId:"unset",popup:$('[data-feature-group="'+e+'"][data-feature-id="'+i+'"]')}},Mapp.prototype.getFeatureInfoFromMarkerClick=function(t){var e=t.target,i=void 0!==e.options.featureGroup?e.options.featureGroup:e.options.icon.options.featureGroup,n=void 0!==e.options.featureId?e.options.featureId:e.options.icon.options.featureId;return{feature:e,featureGroup:i,featureId:n,popup:$('[data-feature-group="'+i+'"][data-feature-id="'+n+'"]')}},Mapp.prototype.isUserSignedIn=function(){return!0},Mapp.prototype.addOptionTriggerWrapper=function(){this.dom.anchors.top.direct.append('<div class="triggers-wrapper margined-large"><div class="item-set horizontal is-boxed triggers"></div></div>')},Mapp.prototype.inform=function(t){var e=$.extend(!0,{appMode:"development",mode:"development",type:"toast",message:"",parent:$(this.settings.element)},t);if(e.appMode===e.mode&&("log"===e.type&&console.log(e.message),"alert"===e.type&&alert(e.message),"toast"===e.type)){toastr.options={closeButton:!1,debug:!1,newestOnTop:!1,progressBar:!1,positionClass:"toast-bottom-right",preventDuplicates:!0,onclick:null,showDuration:"1000",hideDuration:"1000",timeOut:"2000",extendedTimeOut:"2000",showEasing:"swing",hideEasing:"linear",showMethod:"fadeIn",hideMethod:"fadeOut"},toastr.info(e.message,"");var i=$("#toast-container");$("#toast-container").remove(),e.parent.append(i)}},Mapp.prototype.copyToClipboard=function(t){var e=$.extend(!0,{text:""},t),i=$("<input>");$("body").append(i),i.val(e.text).select(),document.execCommand("copy"),i.remove(),this.inform({type:"toast",message:$.i18n("mapp-clipboard")})},Mapp.prototype.replaceResource=function(t){var i=$.extend(!0,{before:function(){},after:function(){},locale:this.presets.locale},t);i.before();var n=$("head"),e=$('link[data-locale="true"]');0===e.length&&i.after(),$.each(e,function(){$(this).remove();var t=$(this).attr("href").replace(/\/(fa|en|ar)\//g,"/"+i.locale+"/"),e='<link type="text/css" rel="stylesheet" href="'+t+'" data-locale="true">';n.append(e),$('link[href="'+t+'"]').on("load",function(){setTimeout(function(){i.after()},500)})})};var mappWd=getMappWd("/assets/images/");Mapp.prototype.latlngToDistance=function(t,e){lat1=t.lat,lng1=t.lng,lat2=e.lat,lng2=e.lng;var i=Math.PI*parseFloat(lat1)/180,n=Math.PI*parseFloat(lat2)/180,o=lng1-lng2,r=Math.PI*o/180,a=Math.sin(i)*Math.sin(n)+Math.cos(i)*Math.cos(n)*Math.cos(r);return a=60*(a=180*(a=Math.acos(a))/Math.PI)*1.1515,(a*=1.609344).toFixed(1)},Mapp.prototype.degreeToDms=function(t){var e=Math.floor(t),i=60*(t-e),n=Math.floor(i),o=60*(i-n),r=Math.round(o);return 60==r&&(n++,r=0),60==n&&(e++,n=0),{degree:e,minute:n,second:r}},Mapp.prototype.icons={blue:{iconUrl:mappWd+"assets/images/marker-default-blue.svg",iconSize:[40,40],iconAnchor:[20,40],popupAnchor:[0,-40]},red:{iconUrl:mappWd+"assets/images/marker-default-red.svg",iconSize:[40,40],iconAnchor:[20,40],popupAnchor:[0,-40]},green:{iconUrl:mappWd+"assets/images/marker-default-green.svg",iconSize:[40,40],iconAnchor:[20,40],popupAnchor:[0,-40]}},Mapp.prototype.styles={default:{polyline:{stroke:!0,color:"#FB8C00",weight:3,opacity:.75,smoothFactor:1,fill:!1,fillColor:"#FFFFFF",fillOpacity:.6,clickable:!0},polygon:{stroke:!0,color:"#FB8C00",weight:3,opacity:.75,smoothFactor:1,fill:!0,fillColor:"#FFFFFF",fillOpacity:.6,clickable:!0}}},Mapp.prototype.ajax=function(t){var e=$.extend(!0,{mode:"production",task:"",url:"",urlParams:"",type:"",headers:{"Mapir-SDK":this.settings.userAgent},contentType:"application/json; charset=utf-8",processData:!0},t);e.headers["x-api-key"]=this.settings.apiKey;var i=this;this.inProgress=this.inProgress||{},!0!==this.inProgress[e.task]?(this.inProgress[e.task]=!0,e.url="development"===e.mode?"/test/"+e.url:e.url+e.urlParams,e.type="development"===e.mode?"GET":e.type,$.ajax(e).then(function(){i.inProgress[e.task]=!1})):this.inform({type:"toast",message:$.i18n("mapp-task-in-progress")})},Mapp.prototype.layers={base:{all:{},layers:{},keys:[],active:""},over:{all:{},layers:{},keys:[],active:[]}},Mapp.prototype.renderBaseLayer=function(t){void 0!==this.layers.base.layers[this.layers.base.active]&&""!==this.layers.base.layers[this.layers.base.active]&&(this.layers.base.layers[this.layers.base.active].removeFrom(this.map),delete this.layers.base.layers[this.layers.base.active]),"vector"===this.layers.base.all[t].type?(mapboxgl.setRTLTextPlugin("https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.0/mapbox-gl-rtl-text.js"),this.layers.base.layers[t]=L.mapboxGL(this.layers.base.all[t]).addTo(this.map)):this.layers.base.layers[t]=L.TileLayer.wmsHeader(this.layers.base.all[t].server,{layers:this.layers.base.all[t].layers,format:this.layers.base.all[t].format,minZoom:this.settings.minZoom,maxZoom:this.settings.maxZoom},[{header:"x-api-key",value:this.settings.apiKey}]).addTo(this.map),this.layers.base.active=Object.keys(this.layers.base.layers),localStorage.setItem("static-baselayer",JSON.stringify(this.layers.base.active))},Mapp.prototype.renderOverLayer=function(t){void 0===this.layers.over.layers[t]?this.layers.over.layers[t]=L.TileLayer.wmsHeader(this.layerOptions.over[t].server,{layers:this.layerOptions.over[t].layers,format:this.layerOptions.over[t].format,minZoom:this.settings.minZoom,maxZoom:this.settings.maxZoom,pane:t},[{header:"x-api-key",value:this.settings.apiKey}]).addTo(this.map):(this.layers.over.layers[t].removeFrom(this.map),delete this.layers.over.layers[t]),this.layers.over.active=Object.keys(this.layers.over.layers),localStorage.setItem("static-overlayers",JSON.stringify(this.layers.over.active))},Mapp.prototype.setBaseLayers=function(){this.layers.base.all="object"===$.type(this.layerOptions.base)?this.layerOptions.base:{},this.layers.base.keys="object"===$.type(this.layerOptions.base)?Object.keys(this.layerOptions.base):[],this.renderBaseLayer(this.presets.layers.base||this.layers.base.keys[0])},Mapp.prototype.setOverLayers=function(){this.layers.over.all="object"===$.type(this.layerOptions.over)?this.layerOptions.over:{},this.layers.over.keys="object"===$.type(this.layerOptions.over)?Object.keys(this.layerOptions.over):[],$.each(this.layerOptions.over,function(t){this.map.createPane(t)}),$.each(this.presets.layers.over,function(t,e){this.renderOverLayer(e)})},Mapp.prototype.setLayers=function(){this.setBaseLayers(),this.setOverLayers()},Mapp.prototype.implementBaseLayers=function(t){var e=$.extend(!0,{},t),i=this,n="",o=0;$.each(e.layers,function(t,e){o+=1,n+='<label class="round bullet small"><input type="radio" name="static-baselayer" value="'+t+'"><span data-i18n="'+e.i18n+'"></span></label>'}),n='<div class="flex-wrapper">'+n+"</div>",1<o&&($(".panel-aside.options form").append('<div class="title has-icon small icon-baselayer" data-i18n="mapp-baselayers"></div>'),$(".panel-aside.options form").append(n));var r=this.presets.layers.base||this.layers.base.keys[0];$('input[name="static-baselayer"][value="'+r+'"]').prop("checked",!0),$('input[name="static-baselayer"]').on("change",function(){i.renderBaseLayer($(this).val())})},Mapp.prototype.implementOverLayers=function(t){var e=$.extend(!0,{layers:{}},t),i="",n=0;$.each(e.layers,function(t,e){n+=1,i+='<label class="bullet small"><input type="checkbox" name="static-overlayer" value="'+t+'"><span data-i18n="'+e.i18n+'"></span></label>'}),i='<div class="flex-wrapper">'+i+"</div>",1<n&&($(".panel-aside.options form").append('<div class="title has-icon small icon-overlayer" data-i18n="mapp-overlayers"></div>'),$(".panel-aside.options form").append(i)),$.each(this.presets.layers.over,function(t,e){$('input[name="static-overlayer"][value="'+e+'"]').prop("checked",!0)}),$('input[name="static-overlayer"]').on("change",function(){this.renderOverLayer($(this).val())})},Mapp.prototype.implementLayers=function(){this.implementBaseLayers({layers:this.layerOptions.base}),this.implementOverLayers({layers:this.layerOptions.over})},Mapp.prototype.layerOptions={},Mapp.prototype.addLayers=function(t){this.layerOptions=$.extend(!0,{base:{default:{server:this.env.url.defaultBaselayer,layers:"Shiveh:Shiveh",format:"image/png",i18n:"mapp-default"}},over:{}},t),this.setLayers(),this.implementLayers()},Mapp.prototype.addVectorLayers=function(t){var e=this,i=this.settings.apiKey;this.layerOptions=$.extend(!0,{base:{default:{accessToken:"no-token",style:"https://map.ir/vector/styles/main/mapir-xyz-style.json",transformRequest:function(t){return{url:t,headers:{"x-api-key":i,"Mapir-SDK":e.settings.userAgent}}},type:"vector"}},over:{}},t),this.setLayers(),this.implementLayers()},Mapp.prototype.addLogo=function(t){var e=$.extend(!0,{url:""},t),i='<a href="#" id="'+this.id+'-logo" style="background-image: url('+e.url+')" class="mapp-logo desktop tablet mobile"></a>';""!==e.url&&this.dom.anchors.bottom.middle.append(i),$("#"+this.id+"-logo").attr("href",this.env.domain)},Mapp.prototype.addZoomControls=function(t){var e;$.extend(!0,{},t);this.dom.footer.triggers.left.append('<div class="icon-background is-lighter is-rounded is-boxed margined-small"><a data-i18n="[title]mapp-tooltip-zoom-in" href="#" class="icon is-small icon-zoom-in desktop tooltip-right"></a></div><div class="icon-background is-lighter is-rounded is-boxed margined-large"><a data-i18n="[title]mapp-tooltip-zoom-out" href="#" class="icon is-small icon-zoom-out desktop tooltip-right"></a></div>');var i=$(this.settings.element).find(".icon-zoom-in"),n=$(this.settings.element).find(".icon-zoom-out");e=this,i.on("click",function(t){t.preventDefault(),t.stopPropagation(),e.map.zoomIn()}),n.on("click",function(t){t.preventDefault(),t.stopPropagation(),e.map.zoomOut()})},Mapp.prototype.icons.geolocation={iconUrl:mappWd+"assets/images/marker-default-red.svg",iconSize:[40,40],iconAnchor:[20,40],popupAnchor:[0,-40]},Mapp.prototype.addGeolocation=function(t){var e,i=$.extend(!0,{history:!1,onLoad:!1,onLoadCallback:function(){},callback:function(){}},t);this.dom.footer.triggers.right.append('<div class="icon-background is-lighter is-rounded is-boxed margined-small"><a data-i18n="[title]mapp-tooltip-geolocation" href="#" class="icon is-large icon-geolocation tablet mobile tooltip-left"></a></div>'),this.dom.footer.triggers.left.append('<div class="icon-background is-lighter is-rounded is-boxed margined-large"><a data-i18n="[title]mapp-tooltip-geolocation" href="#" class="icon is-large icon-geolocation desktop tooltip-right"></a></div>');var n=$(this.settings.element).find(".icon-geolocation");e=this,n.on("click",function(t){t.preventDefault(),t.stopPropagation(),e.getUserLocation({success:i.callback})}),i.onLoad&&this.getUserLocation({success:function(){i.onLoadCallback(),i.callback()}})},Mapp.prototype.getUserLocation=function(t){var e,i=$.extend(!0,{success:function(){},error:function(){},pan:!0,marker:!0},t);this.map.locate({}),(e=this).map.on("locationfound",function(t){e.updateStateUser(t.latlng),e.geolocationSuccess({event:t,pan:i.pan,marker:i.marker}),i.success()}),this.map.on("locationerror",function(t){e.geolocationError({event:t}),i.error()})},Mapp.prototype.geolocationSuccess=function(t){var e=$.extend(!0,{event:{},pan:!0,marker:!0},t);e.event.accuracy;e.pan&&(this.map.setView(e.event.latlng,16),this.updateStateCurrent()),e.marker&&this.addMarker({name:"geolocation",latlng:this.states.user.latlng,icon:this.icons.geolocation,popup:{title:{html:'<span data-i18n="mapp-my-location"></span>',i18n:""},description:{html:this.generateLatlngHtml({lat:parseFloat(this.states.user.latlng.lat),lng:parseFloat(this.states.user.latlng.lng),type:"block"}),i18n:""},open:!0},pan:!1,history:!1})},Mapp.prototype.geolocationError=function(t){$.extend(!0,{event:{}},t)},Mapp.prototype.showModal=function(t){var e,i=$.extend(!0,{before:function(){},after:function(){},type:"center",parent:$(this.settings.element).find(".mapp-container"),html:{header:"",contents:"",footer:""},overlay:!1,timeout:!1,class:"",closeButton:!0},t);i.before(),(e=this).wipeModal(),this.modals=this.modals||{center:{},bottom:{},corner:{},cover:{}};var n="mapp-modal-"+i.type,o='<div class="mapp-modal '+n+" "+i.class+' is-invisible" data-modal-type="'+i.type+'"><header></header><div class="contents"></div><footer></footer></div>';i.parent.append(o),this.modals[i.type].element=$(this.settings.element).find("."+n),this.modals[i.type].header=this.modals[i.type].element.find("header").html(i.html.header),this.modals[i.type].contents=this.modals[i.type].element.find(".contents").html(i.html.contents),this.modals[i.type].footer=this.modals[i.type].element.find("footer").html(i.html.footer),this.modals[i.type].options=i,this.modals[i.type].element.i18n(),this.modals[i.type].element.showVisibility(),i.overlay&&this.dom.overlay.showVisibility(),i.closeButton&&(this.modals[i.type].header.append('<div class="close"></div>'),this.modals[i.type].close=this.modals[i.type].header.find(".close"),this.modals[i.type].close.on("click",function(t){t.stopPropagation(),e.hideModal({type:i.type})})),!1!==i.timeout&&(this.modalTimer=setTimeout(function(){e.hideModal({type:i.type})},i.timeout)),i.after()},Mapp.prototype.hideModal=function(t){var e=$.extend(!0,{type:"center"},t);this.dom.overlay.hideVisibility(),clearTimeout(this.modalTimer),void 0!==this.modals[e.type].element&&(this.modals[e.type].element.remove(),this.modals[e.type].options=void 0)},Mapp.prototype.wipeModal=function(){var e=this;$.each(this.modals,function(t){e.hideModal({type:t})})},Mapp.prototype.initializeFeatures=function(t){$.extend(!0,{},t);this.features=this.features||{markers:{items:{},options:{}},polygons:{items:{},options:{}},polylines:{items:{},options:{}}},this.groups.features=this.groups.features||{markers:L.layerGroup(),polygons:L.layerGroup(),polylines:L.layerGroup()},this.history.features=this.history.features||{markers:[],polygons:[],polylines:[]}},Mapp.prototype.addListenersToToolbarForFeatures=function(t){var e=$.extend(!0,{shapeId:"",shapeGroup:"",shapeOptions:{}},t),i=$(this.settings.element).find('[data-feature-group="'+e.shapeGroup+'"][data-feature-id="'+e.shapeId+'"]');$.each(e.shapeOptions.toolbar,function(t,e){i.find("li."+e.class).on("click",function(){e.callback(this)})})},Mapp.prototype.generateFeaturePopup=function(t){var e=$.extend(!0,{popup:{title:{html:"",i18n:""},description:{html:"",i18n:""},custom:!1,class:""},featureGroup:"",featureId:"",editable:!1,toolbar:{}},t),i="";$.each(e.toolbar,function(t,e){i+='<li data-i18n="[title]'+e.i18n+'" class="'+e.class+' tooltip-bottom"></li>'});var n="";!1===e.popup.custom?(""===e.popup.title.html&&""===e.popup.title.i18n||(n+='<header class="popup-header" data-i18n="'+e.popup.title.i18n+'">'+e.popup.title.html+"</header>"),""===e.popup.description.html&&""===e.popup.description.i18n||(n+='<div class="popup-contents" data-i18n="'+e.popup.description.i18n+'">'+e.popup.description.html+"</div>"),""!==i&&(n+='<ul class="popup-toolbar small">'+i+"</ul>")):n=e.popup.custom;var o='data-feature-group="'+e.featureGroup+'" data-feature-id="'+e.featureId+'"';return n='<div class="feature-popup '+e.popup.class+'" '+o+">"+n+"</div>"},Mapp.prototype.addMarker=function(t){this.initializeFeatures();var n,e=$.extend({before:function(){},after:function(){},name:"marker",latlng:{},icon:this.icons.blue,popup:{title:{html:"",i18n:""},description:{html:"",i18n:""},custom:!1,class:"",open:!0},pan:!1,draggable:!1,history:!1,on:{click:function(){},contextmenu:function(){}},group:this.groups.features.markers,type:"marker",renderer:"svg",radius:10},t);this.addListenersToMapForFeaturesMarkers(),e.group.addTo(this.map),n=this,e.toolbar=t.toolbar||[{i18n:"mapp-close",class:"icon-close",callback:function(){n.removeMarker({name:e.name})}},{i18n:"mapp-share",class:"icon-share",callback:function(t){var e=$(t).closest(".feature-popup").attr("data-feature-id"),i=n.generateURL({lat:parseFloat(n.features.markers.options[e].latlng.lat),lng:parseFloat(n.features.markers.options[e].latlng.lng),zoom:n.states.current.zoom,domain:"href"});n.copyToClipboard({text:i})}},{i18n:"mapp-copy",class:"icon-copy",callback:function(t){var e=$(t).closest(".feature-popup").attr("data-feature-id"),i=n.generateLatlngHtml({lat:parseFloat(n.features.markers.options[e].latlng.lat),lng:parseFloat(n.features.markers.options[e].latlng.lng),type:"comma"});n.copyToClipboard({text:i})}}],e.before(),this.removeMarker({name:e.name}),(this.features.markers.options[e.name]=e).renderer="svg"===e.renderer?L.svg():"canvas"===e.renderer?L.canvas():void 0,"marker"===e.type&&(this.features.markers.items[e.name]=L.marker([e.latlng.lat,e.latlng.lng],{icon:L.icon(e.icon),draggable:e.draggable,featureGroup:"features-marker",featureId:e.name})),"circle"===e.type&&(this.features.markers.items[e.name]=L.circle([e.latlng.lat,e.latlng.lng],{style:this.styles.default.polygon,featureGroup:"features-marker",featureId:e.name,renderer:e.renderer,radius:e.radius})),"circle-marker"===e.type&&(this.features.markers.items[e.name]=L.circleMarker([e.latlng.lat,e.latlng.lng],{style:this.styles.default.polygon,featureGroup:"features-marker",featureId:e.name,renderer:e.renderer,radius:e.radius})),this.features.markers.items[e.name].addTo(e.group);var i={name:e.name,latlng:e.latlng,icon:e.icon,popup:e.popup};if(!1!==e.pan&&this.map.panTo(e.latlng),!1!==e.history&&this.pushMarkerToHistory(i),!1!==e.popup){var o=this.generateFeaturePopup({popup:e.popup,featureGroup:"features-marker",featureId:e.name,toolbar:e.toolbar});this.features.markers.items[e.name].bindPopup(o,this.popupOptions),e.popup.open&&this.features.markers.items[e.name].openPopup()}return this.features.markers.items[e.name].on("click",e.on.click),this.features.markers.items[e.name].on("contextmenu",e.on.contextmenu),e.after(),this.features.markers.items[e.name]},Mapp.prototype.removeMarker=function(t){var e=$.extend(!0,{group:this.groups.features.markers,name:"marker"},t);void 0!==this.features.markers.items[e.name]&&void 0!==this.features.markers.options[e.name]&&(e.group.removeLayer(this.features.markers.items[e.name]),this.features.markers.items[e.name].remove(),delete this.features.markers.items[e.name],delete this.features.markers.options[e.name])},Mapp.prototype.removeMarkers=function(t){var e=$.extend(!0,{group:this.groups.features.markers},t);void 0!==e.group&&(e.group.clearLayers(),this.features.markers.items={},this.features.markers.options={})},Mapp.prototype.pushMarkerToHistory=function(e){e.latlng.lat=parseFloat(e.latlng.lat),e.latlng.lng=parseFloat(e.latlng.lng),this.history.features.markers=this.history.features.markers.filter(function(t){return JSON.stringify(t)!==JSON.stringify(e)}),this.history.features.markers.push(e),localStorage.setItem("markerHistory",JSON.stringify(this.history.features.markers))},Mapp.prototype.addListenersToMapForFeaturesMarkers=function(){var i=this;this.map.on("popupopen",function(t){var e=i.getFeatureInfoFromPopupOpen(t);"features-marker"===e.featureGroup&&i.addListenersToToolbarForFeatures({shapeId:e.featureId,shapeGroup:e.featureGroup,shapeOptions:i.features.markers.options[e.featureId]})})},Mapp.prototype.addPolygon=function(t){this.initializeFeatures();var e,i=$.extend({before:function(){},after:function(){},name:"polygon",coordinates:[],style:this.styles.default.polygon,popup:{title:{html:"",i18n:""},description:{html:"",i18n:""},custom:!1,class:"",open:!0},fit:!1,history:!1,on:{click:function(){},contextmenu:function(){}},group:this.groups.features.polygons,renderer:"svg"},t);this.addListenersToMapForFeaturesPolygons(),i.group.addTo(this.map),e=this,i.toolbar=t.toolbar||[{i18n:"mapp-close",class:"icon-close",callback:function(){e.removePolygon({name:i.name})}}],i.before(),this.removePolygon({name:i.name}),(this.features.polygons.options[i.name]=i).renderer="svg"===i.renderer?L.svg():"canvas"===i.renderer?L.canvas():void 0;var n=Object.assign({},i.style);n.featureGroup="features-polygon",n.featureId=i.name,n.renderer=i.renderer,this.features.polygons.items[i.name]=L.polygon(i.coordinates,n),this.features.polygons.items[i.name].addTo(i.group);var o={name:i.name,coordinates:i.coordinates,style:i.style,popup:i.popup};if(!1!==i.fit&&this.map.fitBounds(i.coordinates),!1!==i.history&&this.pushPolygonToHistory(o),!1!==i.popup){var r=this.generateFeaturePopup({popup:i.popup,featureGroup:"features-polygon",featureId:i.name,toolbar:i.toolbar});this.features.polygons.items[i.name].bindPopup(r,this.popupOptions),i.popup.open&&this.features.polygons.items[i.name].openPopup()}return this.features.polygons.items[i.name].on("click",i.on.click),this.features.polygons.items[i.name].on("contextmenu",i.on.contextmenu),i.after(),this.features.polygons.items[i.name]},Mapp.prototype.removePolygon=function(t){var e=$.extend(!0,{group:this.groups.features.polygons,name:"polygon"},t);void 0!==this.features.polygons.items[e.name]&&void 0!==this.features.polygons.options[e.name]&&(e.group.removeLayer(this.features.polygons.items[e.name]),this.features.polygons.items[e.name].remove(),delete this.features.polygons.items[e.name],delete this.features.polygons.options[e.name])},Mapp.prototype.removePolygons=function(t){var e=$.extend(!0,{group:this.groups.features.polygons},t);void 0!==e.group&&(e.group.clearLayers(),this.features.polygons.items={},this.features.polygons.options={})},Mapp.prototype.pushPolygonToHistory=function(e){this.history.features.polygons=this.history.features.polygons.filter(function(t){return JSON.stringify(t)!==JSON.stringify(e)}),this.history.features.polygons.push(e),localStorage.setItem("polygonHistory",JSON.stringify(this.history.features.polygons))},Mapp.prototype.addListenersToMapForFeaturesPolygons=function(){var i=this;this.map.on("popupopen",function(t){var e=i.getFeatureInfoFromPopupOpen(t);"features-polygon"===e.featureGroup&&i.addListenersToToolbarForFeatures({shapeId:e.featureId,shapeGroup:e.featureGroup,shapeOptions:i.features.polygons.options[e.featureId]})})},Mapp.prototype.addPolyline=function(t){this.initializeFeatures();var e,i=$.extend({before:function(){},after:function(){},name:"polyline",coordinates:[],style:this.styles.default.polyline,popup:{title:{html:"",i18n:""},description:{html:"",i18n:""},custom:!1,class:"",open:!0},fit:!1,history:!1,on:{click:function(){},contextmenu:function(){}},group:this.groups.features.polylines,renderer:"svg"},t);this.addListenersToMapForFeaturesPolylines(),i.group.addTo(this.map),e=this,i.toolbar=t.toolbar||[{i18n:"mapp-close",class:"icon-close",callback:function(){e.removePolyline({name:i.name})}}],i.before(),this.removePolyline({name:i.name}),(this.features.polylines.options[i.name]=i).renderer="svg"===i.renderer?L.svg():"canvas"===i.renderer?L.canvas():void 0;var n=Object.assign({},i.style);n.featureGroup="features-polyline",n.featureId=i.name,n.renderer=i.renderer,this.features.polylines.items[i.name]=L.polyline(i.coordinates,n),this.features.polylines.items[i.name].addTo(i.group);var o={name:i.name,coordinates:i.coordinates,style:i.style,popup:i.popup};if(!1!==i.fit&&this.map.fitBounds(i.coordinates),!1!==i.history&&this.pushPolylineToHistory(o),!1!==i.popup){var r=this.generateFeaturePopup({popup:i.popup,featureGroup:"features-polyline",featureId:i.name,toolbar:i.toolbar});this.features.polylines.items[i.name].bindPopup(r,this.popupOptions),i.popup.open&&this.features.polylines.items[i.name].openPopup()}return this.features.polylines.items[i.name].on("click",i.on.click),this.features.polylines.items[i.name].on("contextmenu",i.on.contextmenu),i.after(),this.features.polylines.items[i.name]},Mapp.prototype.removePolyline=function(t){var e=$.extend(!0,{group:this.groups.features.polylines,name:"polyline"},t);void 0!==this.features.polylines.items[e.name]&&void 0!==this.features.polylines.options[e.name]&&(e.group.removeLayer(this.features.polylines.items[e.name]),this.features.polylines.items[e.name].remove(),delete this.features.polylines.items[e.name],delete this.features.polylines.options[e.name])},Mapp.prototype.removePolylines=function(t){var e=$.extend(!0,{group:this.groups.features.polylines},t);void 0!==e.group&&(e.group.clearLayers(),this.features.polylines.items={},this.features.polylines.options={})},Mapp.prototype.pushPolylineToHistory=function(e){this.history.features.polylines=this.history.features.polylines.filter(function(t){return JSON.stringify(t)!==JSON.stringify(e)}),this.history.features.polylines.push(e),localStorage.setItem("polylineHistory",JSON.stringify(this.history.features.polylines))},Mapp.prototype.addListenersToMapForFeaturesPolylines=function(){var i=this;this.map.on("popupopen",function(t){var e=i.getFeatureInfoFromPopupOpen(t);"features-polyline"===e.featureGroup&&i.addListenersToToolbarForFeatures({shapeId:e.featureId,shapeGroup:e.featureGroup,shapeOptions:i.features.polylines.options[e.featureId]})})},Mapp.prototype.icons.editor={iconUrl:mappWd+"assets/images/marker-default-blue.svg",iconSize:[40,40],iconAnchor:[20,40],popupAnchor:[0,-40]},Mapp.prototype.styles.editor={polyline:{stroke:!0,color:"#4584f0",weight:5,opacity:.75,smoothFactor:1,fill:!1,fillColor:"#FFFFFF",fillOpacity:.3,clickable:!0},polygon:{stroke:!0,color:"#4584f0",weight:5,opacity:.75,smoothFactor:1,fill:!0,fillColor:"#FFFFFF",fillOpacity:.3,clickable:!0}},Mapp.prototype.initializeEditor=function(t){$.extend(!0,{},t);this.dom.editor={},this.editor=this.editor||{points:{options:{},features:[],geometries:[]},polylines:{options:{},features:[],geometries:[]},polygons:{options:{},features:[],geometries:[]}},this.groups.editor=this.groups.editor||{points:L.layerGroup(),polygons:L.layerGroup(),polylines:L.layerGroup()},this.clusters.editor=this.clusters.editor||{points:L.markerClusterGroup()};0===$(this.settings.element).find(".mapp-editor").length&&this.dom.anchors.center.reverse.append('<div class="triggers-wrapper mapp-editor"><div class="item-set vertical is-boxed triggers"></div></div>'),this.dom.editor.element=$(this.settings.element).find(".mapp-editor .triggers")},Mapp.prototype.addListenersToToolbarForEditor=function(t){var e=$.extend(!0,{shapeId:"",shapeGroup:"",shapeOptions:{}},t),i=$(this.settings.element).find('[data-feature-group="'+e.shapeGroup+'"][data-feature-id="'+e.shapeId+'"]');$.each(e.shapeOptions.toolbar,function(t,e){i.find("li."+e.class).on("click",function(){e.callback(this)})})},Mapp.prototype.generateEditorPopup=function(t){var e=$.extend(!0,{popup:{title:{html:"",i18n:""},description:{html:"",i18n:""},custom:!1},class:"",featureGroup:"",featureId:"",editable:!1,toolbar:{}},t),i="";$.each(e.toolbar,function(t,e){i+='<li data-i18n="[title]'+e.i18n+'" class="'+e.class+' tooltip-bottom"></li>'});var n="";if(!1===e.popup.custom){if(""!==e.popup.title.html||""!==e.popup.title.i18n)n+='<header class="popup-header">'+(e.editable?'<input data-i18n="[value]'+e.popup.title.html+'">':'<span data-i18n="">'+e.popup.title.html+"</span>")+"</header>";if(""!==e.popup.description.html||""!==e.popup.description.i18n)n+='<div class="popup-contents">'+(e.editable?'<textarea data-i18n="'+e.popup.description.html+'"></textarea>':'<p data-i18n="">'+e.popup.description.html+"</p>")+'<input class="icon-url" type="hidden"></div>';""!==i&&(n+='<ul class="popup-toolbar small">'+i+"</ul>")}else n=e.popup.custom;var o='data-feature-group="'+e.featureGroup+'" data-feature-id="'+e.featureId+'"';return n='<div class="feature-popup feature-popup-custom '+e.class+'" '+o+">"+n+"</div>"},Mapp.prototype.pointEditor=function(t){var o,r=$.extend(!0,{geoJson:{type:"FeatureCollection",features:[]},modules:{cluster:!1,create:!1,drag:!1,delete:!1,get:!1,editText:!1,editIcon:!1},on:{click:!1,contextmenu:!1,change:function(){},create:function(){},drag:function(){},delete:function(){},get:function(){},editText:function(){},editIcon:function(){}},icons:[{name:"Blue",class:"marker-blue",url:mappWd+"dist/assets/images/marker-default-blue.svg"},{name:"Red",class:"marker-red",url:mappWd+"dist/assets/images/marker-default-red.svg"},{name:"Green",class:"marker-green",url:mappWd+"dist/assets/images/marker-default-green.svg"}],type:"marker",renderer:"svg",radius:10},t);this.initializeEditor(),this.addListenersToMapForEditorPoints(),r.modules.cluster?this.clusters.editor.points.addTo(this.map):this.groups.editor.points.addTo(this.map),r.renderer="svg"===r.renderer?L.svg():"canvas"===r.renderer?L.canvas():void 0,(o=this).map.on("draw:created",function(t){var e=t.layerType;t.layer;"editor-points"===(void 0!==t.layer.options.featureGroup?t.layer.options.featureGroup:t.layer.options.icon.options.featureGroup)&&"marker"===e&&(i(),o.addEditorPoint(t.layer.toGeoJSON()),r.on.create(o.editor.points.geometries[o.editor.points.geometries.length-1]),r.on.change())}),r.toolbar=[],r.modules.get&&r.toolbar.push({i18n:"mapp-get",class:"icon-get",callback:function(t){var e=$(t).closest(".feature-popup").attr("data-feature-id");r.on.get(o.editor.points.geometries[e])}}),r.modules.delete&&r.toolbar.push({i18n:"mapp-delete",class:"icon-delete",callback:function(t){var e=$(t).closest(".feature-popup").attr("data-feature-id"),i=o.deleteEditorPoint(e);r.on.delete(i),r.on.change()}}),r.modules.editText&&r.toolbar.push({i18n:"mapp-edit",class:"icon-edit",callback:function(t){var e=$(t).closest(".feature-popup").attr("data-feature-id");o.editor.points.geometries[e].properties.title=$(o.settings.element).find(t).closest(".feature-popup").find("header input").val(),o.editor.points.geometries[e].properties.description=$(o.settings.element).find(t).closest(".feature-popup").find(".popup-contents textarea").val();var i=o.generateEditorPopup({popup:{title:{html:o.editor.points.geometries[e].properties.title,i18n:""},description:{html:o.editor.points.geometries[e].properties.description,i18n:""}},class:"",featureGroup:"editor-points",featureId:e,editable:o.editor.points.options.modules.editText,toolbar:o.editor.points.options.toolbar});o.editor.points.features[e].setPopupContent(i),o.addListenersToToolbarForEditor({shapeId:e,shapeGroup:"editor-points",shapeOptions:o.editor.points.options}),$(o.settings.element).i18n(),r.on.editText(o.editor.points.geometries[e]),r.on.change()}}),r.modules.editIcon&&"marker"===r.type&&r.toolbar.push({i18n:"mapp-icon",class:"icon-icon",callback:function(e){var i=$(e).closest(".feature-popup").attr("data-feature-id"),n="";$.each(r.icons,function(t){var e=r.icons[t].url?"background-image:url("+r.icons[t].url+")":"";n+='<li title="'+r.icons[t].title+'" class="'+r.icons[t].class+'" data-url="'+r.icons[t].url+'" style="'+e+'"></li>'}),n='<ul class="gallery-icons">'+n+"</ul>",o.showModal({before:function(){},after:function(){},type:"center",parent:o.dom.container,html:{header:$.i18n("mapp-select-icon"),contents:n,footer:""},overlay:!0,timeout:!1,class:"large"}),$(o.settings.element).find(".gallery-icons li").on("click",function(){$(o.settings.element).find(e).closest(".feature-popup").find(".icon-url").val($(this).attr("data-url")),o.hideModal({type:"center"}),o.editor.points.geometries[i].properties.icon=$(o.settings.element).find(e).closest(".feature-popup").find(".icon-url").val();var t=o.editor.points.features[i].options.icon.options;t.iconUrl=o.editor.points.geometries[i].properties.icon,o.editor.points.features[i].setIcon(L.icon(t)),r.on.editIcon(o.editor.points.geometries[i]),r.on.change()})}}),(this.editor.points.options=r).modules.create&&(this.dom.editor.element.append('<div class="icon-background is-lighter"><div data-i18n="[title]mapp-tooltip-add-point" class="icon is-large icon-editor-create-point tooltip-right"></div></div>'),this.dom.editor.element.i18n());var i=function(){$(o.settings.element).find(".icon-editor-create-point").on("click",function(t){t.preventDefault(),t.stopPropagation(),$(this).off("click");var e=o.icons.editor;e.featureGroup="editor-points",e.featureId=o.editor.points.geometries.length,new L.Draw.Marker(o.map,{icon:L.icon(e)}).enable()})};return i(),$.each(r.geoJson.features,function(t,e){r.geoJson.features[t].properties.dms={north:o.degreeToDms(r.geoJson.features[t].geometry.coordinates[1]),west:o.degreeToDms(r.geoJson.features[t].geometry.coordinates[0])},o.drawEditorPoint(t,e)}),o.editor.points.geometries=r.geoJson.features,this.getAllEditorPoints()},Mapp.prototype.getAllEditorPoints=function(){return this.editor.points.geometries},Mapp.prototype.getInViewEditorPoints=function(){var n=[],o=this.map.getBounds();return $.each(this.editor.points.geometries,function(t,e){var i={lat:e.geometry.coordinates[1],lng:e.geometry.coordinates[0]};o.contains(i)&&n.push(e)}),n},Mapp.prototype.getEditorPoint=function(t){return this.editor.points.geometries[t]},Mapp.prototype.deleteEditorPoint=function(t){var e=this.editor.points.geometries[t];return this.groups.editor.points.removeLayer(this.editor.points.features[t]),this.clusters.editor.points.removeLayer(this.editor.points.features[t]),this.editor.points.features[t].remove(),delete this.editor.points.geometries[t],delete this.editor.points.features[t],e},Mapp.prototype.addEditorPoint=function(t){var e=this.editor.points.geometries.length;return t.properties=$.extend({title:"mapp-editor-new-title",description:"mapp-editor-new-description",icon:"/assets/images/marker-default-blue.svg"},t.properties),this.editor.points.geometries[e]=t,this.drawEditorPoint(e,t),e},Mapp.prototype.drawEditorPoint=function(i,t){var n=this.editor.points.options;if("marker"===n.type){var e={iconUrl:t.properties.icon,iconSize:[40,40],iconAnchor:[20,40],popupAnchor:[0,-40]};this.editor.points.features[i]=L.marker([t.geometry.coordinates[1],t.geometry.coordinates[0]],{icon:L.icon(e),draggable:n.modules.drag,featureGroup:"editor-points",featureId:i})}"circle"===n.type&&(this.editor.points.features[i]=L.circle([t.geometry.coordinates[1],t.geometry.coordinates[0]],{style:this.styles.editor.polygon,featureGroup:"editor-points",featureId:i,renderer:n.renderer,radius:n.radius})),"circle-marker"===n.type&&(this.editor.points.features[i]=L.circleMarker([t.geometry.coordinates[1],t.geometry.coordinates[0]],{style:this.styles.editor.polygon,featureGroup:"editor-points",featureId:i,renderer:n.renderer,radius:n.radius})),this.editor.points.features[i].addTo(this.groups.editor.points),this.editor.points.features[i].addTo(this.clusters.editor.points);var o=this.generateEditorPopup({popup:{title:{html:t.properties.title,i18n:""},description:{html:t.properties.description,i18n:""}},class:"",featureGroup:"editor-points",featureId:i,editable:n.modules.editText,toolbar:n.toolbar});this.editor.points.features[i].bindPopup(o,this.popupOptions),(_this=this).editor.points.features[i].on("click",function(t){t.originalEvent.stopPropagation();var e=_this.getFeatureInfoFromMarkerClick(t);"function"===$.type(n.on.click)&&n.on.click(e)}),this.editor.points.features[i].on("contextmenu",function(t){t.originalEvent.stopPropagation();var e=_this.getFeatureInfoFromMarkerClick(t);"function"===$.type(n.on.contextmenu)&&n.on.contextmenu(e)}),n.modules.drag&&this.editor.points.features[i].on("dragend",function(t){var e=t.target;_this.editor.points.features[i]=e,_this.editor.points.geometries[i].geometry=e.toGeoJSON().geometry,_this.editor.points.geometries[i].properties.dms={north:_this.degreeToDms(e.getLatLng().lat),west:_this.degreeToDms(e.getLatLng().lng)},n.on.drag(_this.editor.points.geometries[i]),n.on.change()})},Mapp.prototype.addListenersToMapForEditorPoints=function(){var i=this;this.map.on("popupopen",function(t){var e=i.getFeatureInfoFromPopupOpen(t);"editor-points"===e.featureGroup&&i.addListenersToToolbarForEditor({shapeId:e.featureId,shapeGroup:e.featureGroup,shapeOptions:i.editor.points.options})})},Mapp.prototype.polygonEditor=function(t){var n,o=$.extend(!0,{geoJson:{type:"FeatureCollection",features:[]},modules:{create:!1,delete:!1,get:!1,editText:!1},on:{click:!1,contextmenu:!1,change:function(){},create:function(){},delete:function(){},get:function(){},editText:function(){}},renderer:"svg"},t);this.initializeEditor(),this.addListenersToMapForEditorPolygons(),this.groups.editor.polygons.addTo(this.map),o.renderer="svg"===o.renderer?L.svg():"canvas"===o.renderer?L.canvas():void 0,(n=this).map.on("draw:created",function(t){var e=t.layerType;t.layer;"editor-polygons"===(void 0!==t.layer.options.featureGroup?t.layer.options.featureGroup:t.layer.options.icon.options.featureGroup)&&"polygon"===e&&(i(),n.addEditorPolygon(t.layer.toGeoJSON()),o.on.create(n.editor.polygons.geometries[n.editor.polygons.geometries.length-1]),o.on.change())}),o.toolbar=[],o.modules.get&&o.toolbar.push({i18n:"mapp-get",class:"icon-get",callback:function(t){var e=$(t).closest(".feature-popup").attr("data-feature-id");o.on.get(n.editor.polygons.geometries[e])}}),o.modules.delete&&o.toolbar.push({i18n:"mapp-delete",class:"icon-delete",callback:function(t){var e=$(t).closest(".feature-popup").attr("data-feature-id"),i=n.deleteEditorPolygon(e);o.on.delete(i),o.on.change()}}),o.modules.editText&&o.toolbar.push({i18n:"mapp-edit",class:"icon-edit",callback:function(t){var e=$(t).closest(".feature-popup").attr("data-feature-id");n.editor.polygons.geometries[e].properties.title=$(n.settings.element).find(t).closest(".feature-popup").find("header input").val(),n.editor.polygons.geometries[e].properties.description=$(n.settings.element).find(t).closest(".feature-popup").find(".popup-contents textarea").val();var i=n.generateEditorPopup({popup:{title:{html:n.editor.polygons.geometries[e].properties.title,i18n:""},description:{html:n.editor.polygons.geometries[e].properties.description,i18n:""}},class:"",featureGroup:"editor-polygons",featureId:e,editable:n.editor.polygons.options.modules.editText,toolbar:n.editor.polygons.options.toolbar});n.editor.polygons.features[e].setPopupContent(i),n.addListenersToToolbarForEditor({shapeId:e,shapeGroup:"editor-polygons",shapeOptions:n.editor.polygons.options}),$(n.settings.element).i18n(),o.on.editText(n.editor.polygons.geometries[e]),o.on.change()}}),(this.editor.polygons.options=o).modules.create&&(this.dom.editor.element.append('<div class="icon-background is-lighter"><div data-i18n="[title]mapp-tooltip-add-polygon" class="icon is-large icon-editor-create-polygon tooltip-right"></div></div>'),this.dom.editor.element.i18n());var i=function(){$(n.settings.element).find(".icon-editor-create-polygon").on("click",function(t){t.preventDefault(),t.stopPropagation(),$(this).off("click");var e=n.styles.editor.polygon;e.featureGroup="editor-polygons",e.featureId=n.editor.polygons.geometries.length,new L.Draw.Polygon(n.map,{shapeOptions:e}).enable()})};return i(),$.each(o.geoJson.features,function(t,e){n.drawEditorPolygon(t,e)}),n.editor.polygons.geometries=o.geoJson.features,this.getAllEditorPolygons()},Mapp.prototype.getAllEditorPolygons=function(){return this.editor.polygons.geometries},Mapp.prototype.getEditorPolygon=function(t){return this.editor.polygons.geometries[t]},Mapp.prototype.deleteEditorPolygon=function(t){var e=this.editor.polygons.geometries[t];return this.groups.editor.polygons.removeLayer(this.editor.polygons.features[t]),this.editor.polygons.features[t].remove(),delete this.editor.polygons.geometries[t],delete this.editor.polygons.features[t],e},Mapp.prototype.addEditorPolygon=function(t){var e=this.editor.polygons.geometries.length;return t.properties=$.extend({title:"mapp-editor-new-title",description:"mapp-editor-new-description"},t.properties),this.editor.polygons.geometries[e]=t,this.drawEditorPolygon(e,t),e},Mapp.prototype.drawEditorPolygon=function(i,t){var n=this.editor.polygons.options;this.editor.polygons.features[i]=L.geoJSON(t,{onEachFeature:function(){},style:this.styles.editor.polygon,featureGroup:"editor-polygons",featureId:i,renderer:n.renderer}),this.editor.polygons.features[i].addTo(this.groups.editor.polygons);var e=this.generateEditorPopup({popup:{title:{html:t.properties.title,i18n:""},description:{html:t.properties.description,i18n:""}},class:"",featureGroup:"editor-polygons",featureId:i,editable:n.modules.editText,toolbar:n.toolbar});this.editor.polygons.features[i].bindPopup(e,this.popupOptions),(_this=this).editor.polygons.features[i].on("click",function(t){t.originalEvent.stopPropagation();var e=_this.getFeatureInfoFromMarkerClick(t);"function"===$.type(n.on.click)&&n.on.click(e)}),this.editor.polygons.features[i].on("contextmenu",function(t){t.originalEvent.stopPropagation();var e=_this.getFeatureInfoFromMarkerClick(t);"function"===$.type(n.on.contextmenu)&&n.on.contextmenu(e)}),n.modules.drag&&this.editor.polygons.features[i].on("dragend",function(t){var e=t.target;_this.editor.polygons.features[i]=e,_this.editor.polygons.geometries[i].geometry=e.toGeoJSON().geometry,_this.editor.polygons.geometries[i].properties.dms={north:_this.degreeToDms(e.getLatLng().lat),west:_this.degreeToDms(e.getLatLng().lng)},n.on.drag(_this.editor.polygons.geometries[i]),n.on.change()})},Mapp.prototype.addListenersToMapForEditorPolygons=function(){var i=this;this.map.on("popupopen",function(t){var e=i.getFeatureInfoFromPopupOpen(t);"editor-polygons"===e.featureGroup&&i.addListenersToToolbarForEditor({shapeId:e.featureId,shapeGroup:e.featureGroup,shapeOptions:i.editor.polygons.options})})},Mapp.prototype.polylineEditor=function(t){var n,o=$.extend(!0,{geoJson:{type:"FeatureCollection",features:[]},modules:{create:!1,delete:!1,get:!1,editText:!1},on:{click:!1,contextmenu:!1,change:function(){},create:function(){},delete:function(){},get:function(){},editText:function(){}},renderer:"svg"},t);this.initializeEditor(),this.addListenersToMapForEditorPolylines(),this.groups.editor.polylines.addTo(this.map),o.renderer="svg"===o.renderer?L.svg():"canvas"===o.renderer?L.canvas():void 0,(n=this).map.on("draw:created",function(t){var e=t.layerType;t.layer;"editor-polylines"===(void 0!==t.layer.options.featureGroup?t.layer.options.featureGroup:t.layer.options.icon.options.featureGroup)&&"polyline"===e&&(i(),n.addEditorPolyline(t.layer.toGeoJSON()),o.on.create(n.editor.polylines.geometries[n.editor.polylines.geometries.length-1]),o.on.change())}),o.toolbar=[],o.modules.get&&o.toolbar.push({i18n:"mapp-get",class:"icon-get",callback:function(t){var e=$(t).closest(".feature-popup").attr("data-feature-id");o.on.get(n.editor.polylines.geometries[e])}}),o.modules.delete&&o.toolbar.push({i18n:"mapp-delete",class:"icon-delete",callback:function(t){var e=$(t).closest(".feature-popup").attr("data-feature-id"),i=n.deleteEditorPolyline(e);o.on.delete(i),o.on.change()}}),o.modules.editText&&o.toolbar.push({i18n:"mapp-edit",class:"icon-edit",callback:function(t){var e=$(t).closest(".feature-popup").attr("data-feature-id");n.editor.polylines.geometries[e].properties.title=$(n.settings.element).find(t).closest(".feature-popup").find("header input").val(),n.editor.polylines.geometries[e].properties.description=$(n.settings.element).find(t).closest(".feature-popup").find(".popup-contents textarea").val();var i=n.generateEditorPopup({popup:{title:{html:n.editor.polylines.geometries[e].properties.title,i18n:""},description:{html:n.editor.polylines.geometries[e].properties.description,i18n:""}},class:"",featureGroup:"editor-polylines",featureId:e,editable:n.editor.polylines.options.modules.editText,toolbar:n.editor.polylines.options.toolbar});n.editor.polylines.features[e].setPopupContent(i),n.addListenersToToolbarForEditor({shapeId:e,shapeGroup:"editor-polylines",shapeOptions:n.editor.polylines.options}),$(n.settings.element).i18n(),o.on.editText(n.editor.polylines.geometries[e]),o.on.change()}}),(this.editor.polylines.options=o).modules.create&&(this.dom.editor.element.append('<div class="icon-background is-lighter"><div data-i18n="[title]mapp-tooltip-add-polyline" class="icon is-large icon-editor-create-polyline tooltip-right"></div></div>'),this.dom.editor.element.i18n());var i=function(){$(n.settings.element).find(".icon-editor-create-polyline").on("click",function(t){t.preventDefault(),t.stopPropagation(),$(this).off("click");var e=n.styles.editor.polyline;e.featureGroup="editor-polylines",e.featureId=n.editor.polylines.geometries.length,new L.Draw.Polyline(n.map,{shapeOptions:e}).enable()})};return i(),$.each(o.geoJson.features,function(t,e){n.drawEditorPolyline(t,e)}),n.editor.polylines.geometries=o.geoJson.features,this.getAllEditorPolylines()},Mapp.prototype.getAllEditorPolylines=function(){return this.editor.polylines.geometries},Mapp.prototype.getEditorPolyline=function(t){return this.editor.polylines.geometries[t]},Mapp.prototype.deleteEditorPolyline=function(t){var e=this.editor.polylines.geometries[t];return this.groups.editor.polylines.removeLayer(this.editor.polylines.features[t]),this.editor.polylines.features[t].remove(),delete this.editor.polylines.geometries[t],delete this.editor.polylines.features[t],e},Mapp.prototype.addEditorPolyline=function(t){var e=this.editor.polylines.geometries.length;return t.properties=$.extend({title:"mapp-editor-new-title",description:"mapp-editor-new-description"},t.properties),this.editor.polylines.geometries[e]=t,this.drawEditorPolyline(e,t),e},Mapp.prototype.drawEditorPolyline=function(i,t){var n=this.editor.polylines.options;this.editor.polylines.features[i]=L.geoJSON(t,{onEachFeature:function(){},style:this.styles.editor.polyline,featureGroup:"editor-polylines",featureId:i,renderer:n.renderer}),this.editor.polylines.features[i].addTo(this.groups.editor.polylines);var e=this.generateEditorPopup({popup:{title:{html:t.properties.title,i18n:""},description:{html:t.properties.description,i18n:""}},class:"",featureGroup:"editor-polylines",featureId:i,editable:n.modules.editText,toolbar:n.toolbar});this.editor.polylines.features[i].bindPopup(e,this.popupOptions),(_this=this).editor.polylines.features[i].on("click",function(t){t.originalEvent.stopPropagation();var e=_this.getFeatureInfoFromMarkerClick(t);"function"===$.type(n.on.click)&&n.on.click(e)}),this.editor.polylines.features[i].on("contextmenu",function(t){t.originalEvent.stopPropagation();var e=_this.getFeatureInfoFromMarkerClick(t);"function"===$.type(n.on.contextmenu)&&n.on.contextmenu(e)}),n.modules.drag&&this.editor.polylines.features[i].on("dragend",function(t){var e=t.target;_this.editor.polylines.features[i]=e,_this.editor.polylines.geometries[i].geometry=e.toGeoJSON().geometry,_this.editor.polylines.geometries[i].properties.dms={north:_this.degreeToDms(e.getLatLng().lat),west:_this.degreeToDms(e.getLatLng().lng)},n.on.drag(_this.editor.polylines.geometries[i]),n.on.change()})},Mapp.prototype.addListenersToMapForEditorPolylines=function(){var i=this;this.map.on("popupopen",function(t){var e=i.getFeatureInfoFromPopupOpen(t);"editor-polylines"===e.featureGroup&&i.addListenersToToolbarForEditor({shapeId:e.featureId,shapeGroup:e.featureGroup,shapeOptions:i.editor.polylines.options})})},Mapp.prototype.icons.dynamicUrl={iconUrl:mappWd+"assets/images/marker-default-blue.svg",iconSize:[40,40],iconAnchor:[20,40],popupAnchor:[0,-40]},Mapp.prototype.dynamicUrl=function(t){var e=$.extend(!0,{marker:!1},t);this.enableRouter();var i=this;this.map.setView([i.states.current.latlng.lat,i.states.current.latlng.lng],i.states.current.zoom),this.map.on("zoomend",function(){i.updateUrl()}),this.map.on("moveend",function(){i.updateUrl()}),!0===e.marker&&this.addMarker({name:"dynamicUrl",latlng:i.states.current.latlng,icon:this.icons.dynamicUrl,popup:{title:{html:'<span data-i18n="mapp-dynamic-url-marker-title"></span>',i18n:""},description:{html:i.generateLatlngHtml({lat:parseFloat(i.states.current.latlng.lat),lng:parseFloat(i.states.current.latlng.lng),type:"block"}),i18n:""},open:!1},pan:!1})},Mapp.prototype.updateUrl=function(){this.updateStateCurrent();var t=this.generateURL({lat:this.states.current.latlng.lat,lng:this.states.current.latlng.lng,zoom:this.states.current.zoom,domain:"href"});history.pushState("","",t)},Mapp.prototype.enableRouter=function(){var t=new Navigo(null,!0,"#"),e=this;t.on("lat/:lat/lng/:lng/z/:z",function(t){e.states.current.latlng={lat:parseFloat(t.lat),lng:parseFloat(t.lng)},e.states.current.zoom=t.z}).resolve()},Mapp.prototype.addFullscreen=function(t){var i,e=$.extend(!0,{compact:!0},t);if(Modernizr.fullscreen){this.dom.fullscreen={},this.dom.anchors.top.direct.find(".triggers-wrapper").length||this.addOptionTriggerWrapper();void 0!==this.dom.search&&!0===e.compact?this.dom.search.wrapper.find(".first").after('<div class="icon-background"><a data-i18n="[title]mapp-tooltip-fullscreen" href="#" class="icon is-small icon-fullscreen tooltip-bottom"></a></div><div class="spacer"></div>'):this.dom.anchors.top.direct.find(".triggers").append('<div class="icon-background is-lighter"><a data-i18n="[title]mapp-tooltip-fullscreen" href="#" class="icon is-large icon-fullscreen desktop tooltip-bottom"></a></div>'),this.dom.fullscreen.open=$(this.settings.element).find(".icon-fullscreen"),(i=this).dom.fullscreen.open.on("click",function(t){t.preventDefault(),t.stopPropagation();var e=document.querySelector(i.settings.element);document.fullscreenEnabled&&!document.fullscreenElement?e.requestFullscreen():document.exitFullscreen&&document.exitFullscreen(),document.webkitFullscreenEnabled&&!document.webkitFullscreenElement?e.webkitRequestFullscreen():document.webkitExitFullscreen&&document.webkitExitFullscreen(),document.mozFullScreenEnabled&&!document.mozFullScreenElement?e.mozRequestFullScreen():document.mozCancelFullScreen&&document.mozCancelFullScreen(),document.msFullscreenEnabled&&!document.msFullscreenElement?e.msRequestFullscreen():document.msExitFullscreen&&document.msExitFullscreen()})}},Mapp.prototype.addMenu=function(t){var e,i=$.extend(!0,{compact:!0},t);this.dom.panels.menu={},this.dom.anchors.top.direct.find(".triggers-wrapper").length||this.addOptionTriggerWrapper();void 0!==this.dom.search&&!0===i.compact?this.dom.search.wrapper.find(".first").after('<div class="icon-background"><a data-i18n="[title]mapp-tooltip-options" href="#" class="icon is-small icon-menu tooltip-bottom"></a></div><div class="spacer"></div>'):this.dom.anchors.top.direct.find(".triggers").append('<div class="icon-background is-lighter"><a data-i18n="[title]mapp-tooltip-options" href="#" class="icon is-large icon-menu tooltip-bottom"></a></div>');this.dom.overlay.before('<aside class="panel-aside options is-invisible"><header><div data-i18n="mapp-options"></div></header><section><form class="form"></form></section><footer></footer></aside>'),this.dom.panels.menu.open=$(this.settings.element).find(".icon-menu"),this.dom.panels.menu.element=$(this.settings.element).find(".panel-aside.options"),(e=this).dom.panels.menu.open.on("click",function(t){e.openPanel({event:t,type:"menu",modal:!0})})},Mapp.prototype.file={formats:["csv","gpx","kml","wkt","topojson","geojson","polyline"]},Mapp.prototype.addFile=function(t){var e=$.extend(!0,{url:"",format:"kml",pan:!1},t);if(this.groups.file=this.groups.file||L.featureGroup().addTo(this.map),this.removeFile(),this.file.formats.includes(e.format)){var i=this;omnivore[e.format](e.url).on("ready",function(){e.pan&&i.map.fitBounds(i.groups.file.getBounds())}).addTo(this.groups.file)}},Mapp.prototype.removeFile=function(t){$.extend(!0,{},t);this.groups.file.clearLayers()},Mapp.prototype.addFileUploader=function(t){var n,e=$.extend({formats:this.file.formats},t);this.dom.file={};var i='<div><input type="file" style="visibility: hidden;" class="file-uploader" accept="'+e.formats.map(function(t){return"."+t}).join(",")+'"></div>';this.dom.footer.triggers.right.append('<div class="icon-background is-lighter is-rounded is-boxed margined-small"><a data-i18n="[title]mapp-tooltip-upload" href="#" class="icon is-large icon-uploader tablet mobile tooltip-left"></a></div>'),this.dom.footer.triggers.left.append('<div class="icon-background is-lighter is-rounded is-boxed margined-large"><a data-i18n="[title]mapp-tooltip-upload" href="#" class="icon is-large icon-uploader desktop tooltip-right"></a></div>'),$(this.settings.element).append(i),this.dom.file.trigger=$(this.settings.element).find(".icon-uploader"),this.dom.file.input=$(this.settings.element).find(".file-uploader"),(n=this).dom.file.trigger.on("click",function(t){t.preventDefault(),t.stopPropagation(),n.dom.file.input.trigger("click")}),this.dom.file.input.on("change",function(t){t.preventDefault(),t.stopPropagation();var e=n.dom.file.input[0].files[0],i=new FileReader;i.onload=function(t){n.addFile({url:t.target.result,format:"kml"})},i.readAsDataURL(e)})},Mapp.prototype.addLocale=function(t){var e,i=$.extend(!0,{locales:{fa:{i18n:"mapp-persian"},en:{i18n:"mapp-english"}}},t),n="";$.each(i.locales,function(t,e){n+='<label class="round bullet small"><input type="radio" name="locale" value="'+t+'"><span class="checkmark" data-i18n="'+e.i18n+'"></span></label>'}),n='<div class="title has-icon small icon-locale" data-i18n="mapp-language"></div><div class="flex-wrapper">'+n+"</div>",$(this.settings.element).find("aside.options form").append(n),$(this.settings.element).find('input[name="locale"][value="'+this.presets.locale+'"]').prop("checked",!0),e=this,$(this.settings.element).find('input[name="locale"]').on("change",function(){e.setLocale({locale:$(this).val(),before:function(){e.destroyTooltips()},after:function(){e.applyTooltips()}})})},Mapp.prototype.addContextmenu=function(t){var e,i=$.extend(!0,{here:!1,start:!1,end:!1,tag:!1,bookmark:!1,ticket:!1,distance:!1,area:!1,copy:!1,share:!1,static:!1,print:!1},t),n={};e=this,i.here&&(n.here={name:'<div class="icon-background"><div class="icon icon-here"></div></div><em data-i18n="mapp-contextmenu-here"></em>',isHtmlName:!0,className:"has-line",icon:"none",callback:function(){e.showReverseGeocode({state:e.states.contextmenu}),e.map.panTo(e.states.contextmenu.latlng)}}),i.start&&(n.start={name:'<div class="icon-background"><div class="icon icon-start"></div></div><em data-i18n="mapp-contextmenu-start"></em>',isHtmlName:!0,callback:function(){e.routeStart=e.states.contextmenu.latlng,e.addMarker({name:"route-start-temp",latlng:e.routeStart,icon:e.icons.green,popup:!1}),e.drawRoute({after:function(){e.removeMarker({name:"route-start-temp"}),e.removeMarker({name:"route-end-temp"})},start:this.routeStart,end:this.routeEnd,fit:!0})}}),i.end&&(n.end={name:'<div class="icon-background"><div class="icon icon-end"></div></div><em data-i18n="mapp-contextmenu-end"></em>',isHtmlName:!0,className:"has-line",callback:function(){e.routeEnd=e.states.contextmenu.latlng,e.addMarker({name:"route-end-temp",latlng:e.routeEnd,icon:e.icons.green,popup:!1}),e.drawRoute({after:function(){e.removeMarker({name:"route-start-temp"}),e.removeMarker({name:"route-end-temp"})},start:this.routeStart,end:this.routeEnd,fit:!0})}}),i.tag&&this.isUserSignedIn()&&(n.tag={name:'<div class="icon-background"><div class="icon icon-tag"></div></div><em data-i18n="mapp-contextmenu-tag"></em>',isHtmlName:!0,callback:function(){}}),i.bookmark&&this.isUserSignedIn()&&(n.bookmark={name:'<div class="icon-background"><div class="icon icon-bookmark"></div></div><em data-i18n="mapp-contextmenu-bookmark"></em>',isHtmlName:!0,callback:function(){}}),i.ticket&&(n.ticket={name:'<div class="icon-background"><div class="icon icon-here"></div></div><em data-i18n="mapp-contextmenu-ticket"></em>',isHtmlName:!0,className:"has-line",icon:"ticket",callback:function(){}}),i.distance&&(n.distance={name:'<div class="icon-background"><div class="icon icon-distance"></div></div><em data-i18n="mapp-contextmenu-distance"></em>',isHtmlName:!0,callback:function(){e.measurement();var t=e.styles.measurement.polyline;t.featureGroup="measurement",t.featureId="not set",new L.Draw.Polyline(e.map,{shapeOptions:t}).enable()}}),i.area&&(n.area={name:'<div class="icon-background"><div class="icon icon-area"></div></div><em data-i18n="mapp-contextmenu-area"></em>',isHtmlName:!0,className:"has-line",callback:function(){e.measurement();var t=e.styles.measurement.polygon;t.featureGroup="measurement",t.featureId="not set",new L.Draw.Polygon(e.map,{shapeOptions:t}).enable()}}),i.copy&&(n.copy={name:'<div class="icon-background"><div class="icon icon-copy"></div></div><em data-i18n="mapp-contextmenu-copy"></em>',isHtmlName:!0,callback:function(){var t=e.generateLatlngHtml({lat:e.states.contextmenu.latlng.lat,lng:e.states.contextmenu.latlng.lng,type:"comma"});e.copyToClipboard({text:t})}}),i.share&&(n.share={name:'<div class="icon-background"><div class="icon icon-share"></div></div><em data-i18n="mapp-contextmenu-share"></em>',isHtmlName:!0,callback:function(){var t=e.generateURL({lat:e.states.contextmenu.latlng.lat,lng:e.states.contextmenu.latlng.lng,zoom:e.states.contextmenu.zoom,domain:"href"});e.copyToClipboard({text:t})}}),i.static&&(n.static={name:'<div class="icon-background"><div class="icon icon-static-map"></div></div><em data-i18n="mapp-contextmenu-static-map"></em>',isHtmlName:!0,callback:function(){e.openStaticMap({state:e.states.contextmenu,width:600,height:400,color:"red"})}}),i.print&&(n.print={name:'<div class="icon-background"><div class="icon icon-print"></div></div><em data-i18n="mapp-contextmenu-print"></em>',isHtmlName:!0,callback:function(){}}),$.contextMenu({selector:"#"+this.id,animation:{duration:300,show:"fadeIn",hide:"fadeOut"},items:n,events:{show:function(){$(".context-menu-list").i18n()}}})},Mapp.prototype.styles.measurement={polyline:{stroke:!0,color:"#FB8C00",weight:3,opacity:.75,smoothFactor:1,fill:!1,fillColor:"#FFFFFF",fillOpacity:.3,clickable:!0,dashArray:"10 5"},polygon:{stroke:!0,color:"#FB8C00",weight:3,opacity:.75,smoothFactor:1,fill:!0,fillColor:"#FFFFFF",fillOpacity:.3,clickable:!0,dashArray:"10 5"}},Mapp.prototype.measurement=function(t){var o;$.extend(!0,{},t);this.groups.measurement=this.groups.measurement||L.layerGroup().addTo(this.map),(o=this).map.on("draw:created",function(t){var e=t.layerType,i=t.layer,n=void 0!==t.layer.options.featureGroup?t.layer.options.featureGroup:t.layer.options.icon.options.featureGroup;if("measurement"===n&&"polyline"===e){o.addPolyline({name:"measurement-polyline",coordinates:i._latlngs,styles:o.styles.measurement.polyline,popup:!1,on:{click:function(){o.removePolyline("measurement-polyline")}},addTo:o.groups.measurement});o.features.polylines.items["measurement-polyline"].showMeasurements()}if("measurement"===n&&"polygon"===e){o.addPolygon({name:"measurement-polygon",coordinates:i._latlngs,styles:o.styles.measurement.polygon,popup:!1,on:{click:function(){o.removePolygon("measurement-polygon")}},addTo:o.groups.measurement});o.features.polygons.items["measurement-polygon"].showMeasurements()}})},Mapp.prototype.icons.reverseGeocode={iconUrl:mappWd+"assets/images/marker-default-green.svg",iconSize:[40,40],iconAnchor:[20,40],popupAnchor:[0,-40]},Mapp.prototype.findReverseGeocode=function(t){var e=$.extend(!0,{before:function(){},after:function(){},state:this.states.user.length?this.states.user:this.states.current},t);e.before();var i={lat:e.state.latlng.lat,lon:e.state.latlng.lng};this.ajax({mode:this.env.mode,task:"reverseGeocode",url:this.env.url.search.reverse,urlParams:"",type:"GET",data:i,dataType:"json",success:function(t){e.after(t)}})},Mapp.prototype.showReverseGeocode=function(t){var o,r=$.extend(!0,{state:this.states.user.length?this.states.user:this.states.current},t);(o=this).findReverseGeocode({after:function(t){var e="bottom",i=$.i18n("mapp-where-is-here"),n=t.address_compact+"<br/>"+o.generateLatlngHtml({lat:r.state.latlng.lat,lng:r.state.latlng.lng,type:"block"});o.showModal({before:function(){},after:function(){o.modals[e].element.find(".trigger-copy").on("click",function(t){t.preventDefault(),t.stopPropagation();var e=o.generateLatlngHtml({lat:r.state.latlng.lat,lng:r.state.latlng.lng,type:"comma"});o.copyToClipboard({text:e})}),o.modals[e].element.find(".trigger-share").on("click",function(t){t.preventDefault(),t.stopPropagation();var e=o.generateURL({lat:r.state.latlng.lat,lng:r.state.latlng.lng,zoom:r.state.zoom,domain:"href"});o.copyToClipboard({text:e})})},type:e,html:{header:i,contents:n,footer:'<div class="flex-wrapper"><div class="trigger-share"><a class="is-iconed is-large" href="#"><span class="icon-background"><em class="icon icon-share"></em></span><span class="icon-title" data-i18n="mapp-share"></span></a></div><div class="trigger-copy"><a class="is-iconed is-large" href="#"><span class="icon-background"><em class="icon icon-copy"></em></span><span class="icon-title" data-i18n="mapp-copy"></span></a></div></div>'},overlay:!1,class:"large"})},state:r.state})},Mapp.prototype.markReverseGeocode=function(t){var e,i=$.extend(!0,{state:this.states.user.length?this.states.user:this.states.current},t);(e=this).findReverseGeocode({after:function(t){e.addMarker({name:"reverse-geocode",popup:{title:{html:$.i18n("mapp-contextmenu-here"),i18n:""},description:{html:t.address_compact,i18n:""},open:!0},icon:e.icons.reverseGeocode,latlng:i.state.latlng,pan:!0})},state:i.state})},Mapp.prototype.getStaticMap=function(t){var e=$.extend(!0,{state:this.states.current,width:600,height:400,label:" ",color:"red"},t),i={async:!0,crossDomain:!0,url:this.env.url.static+"?width="+e.width+"&height="+e.height+"&zoom_level="+e.state.zoom+"&markers=color:"+e.color+"|label:"+e.label+"|"+e.state.latlng.lng+","+e.state.latlng.lat,method:"GET",headers:{"x-api-key":this.settings.apiKey,"Mapir-SDK":"web-maps/1.4.2"},xhrFields:{responseType:"blob"}};return $.ajax(i)},Mapp.prototype.openStaticMap=function(t){var e=$.extend(!0,{before:function(){},after:function(){},state:this.states.current,width:600,height:400,label:" ",color:"red"},t);e.before(),this.getStaticMap({state:e.state,width:e.width,height:e.height,label:e.label,color:e.color}).done(function(t){var e=window.URL||window.webkitURL;window.open(e.createObjectURL(t),"_blank")}),e.after()},Mapp.prototype.addDynamicLocation=function(t){var e,i=$.extend(!0,{format:"dms",source:"center"},t);this.dom.anchors.bottom.middle.prepend('<div class="mapp-location desktop tablet mobile"><div class="item-set horizontal is-boxed wrapper"><div class="icon-background is-secondary"><span data-i18n="[title]mapp-tooltip-copy" class="icon is-large icon-copy tooltip-right"></span></div><input readonly="readonly"></div></div>');var n=$(this.settings.element).find(".mapp-location"),o=n.find("input"),r=n.find(".icon-copy");e=this,r.on("click",function(){e.copyToClipboard({text:o.val()})}),"center"===i.source&&(this.map.on("zoomend",function(){e.updateStateCurrent(),e.updateDynamicLocation(i,e.states.current.latlng)}),this.map.on("moveend",function(){e.updateStateCurrent(),e.updateDynamicLocation(i,e.states.current.latlng)})),"mouse"===i.source&&this.map.on("mousemove",function(t){e.updateStateMouse(t.latlng),e.updateDynamicLocation(i,e.states.mouse.latlng)}),"click"===i.source&&this.map.on("click",function(t){e.updateStateClick(t.latlng),e.updateDynamicLocation(i,e.states.click.latlng)}),"contextmenu"===i.source&&this.map.on("contextmenu",function(t){e.updateStateContextmenu(t.latlng),e.updateDynamicLocation(i,e.states.contextmenu.latlng)}),this.updateStateCurrent(),this.updateDynamicLocation(i,this.states.current.latlng)},Mapp.prototype.updateDynamicLocation=function(t,e){var i="Bad type...";"latlng"===t.format&&(i=this.generateLatlngHtml({lat:e.lat,lng:e.lng,type:"comma"})),"dms"===t.format&&(i=this.generateDmsHtml({lat:e.lat,lng:e.lng,type:"comma"})),$(this.settings.element).find(".mapp-location input").val(i)},Mapp.prototype.icons.around={iconUrl:mappWd+"assets/images/marker-default-blue.svg",iconSize:[40,40],iconAnchor:[20,40],popupAnchor:[0,-40]},Mapp.prototype.icons.poi={restaurant:{iconUrl:mappWd+"assets/images/marker-restaurant.svg",iconSize:[30,30],iconAnchor:[15,15],popupAnchor:[0,-15]},bank:{iconUrl:mappWd+"assets/images/marker-bank.svg",iconSize:[30,30],iconAnchor:[15,15],popupAnchor:[0,-15]},cafe:{iconUrl:mappWd+"assets/images/marker-cafe.svg",iconSize:[30,30],iconAnchor:[15,15],popupAnchor:[0,-15]},library:{iconUrl:mappWd+"assets/images/marker-library.svg",iconSize:[30,30],iconAnchor:[15,15],popupAnchor:[0,-15]},hotel:{iconUrl:mappWd+"assets/images/marker-hotel.svg",iconSize:[30,30],iconAnchor:[15,15],popupAnchor:[0,-15]},mosque:{iconUrl:mappWd+"assets/images/marker-mosque.svg",iconSize:[30,30],iconAnchor:[15,15],popupAnchor:[0,-15]},hospital:{iconUrl:mappWd+"assets/images/marker-hospital.svg",iconSize:[30,30],iconAnchor:[15,15],popupAnchor:[0,-15]},metro:{iconUrl:mappWd+"assets/images/marker-metro.svg",iconSize:[30,30],iconAnchor:[15,15],popupAnchor:[0,-15]},drugstore:{iconUrl:mappWd+"assets/images/marker-drugstore.svg",iconSize:[30,30],iconAnchor:[15,15],popupAnchor:[0,-15]},parking:{iconUrl:mappWd+"assets/images/marker-parking.svg",iconSize:[30,30],iconAnchor:[15,15],popupAnchor:[0,-15]},university:{iconUrl:mappWd+"assets/images/marker-university.svg",iconSize:[30,30],iconAnchor:[15,15],popupAnchor:[0,-15]},mall:{iconUrl:mappWd+"assets/images/marker-mall.svg",iconSize:[30,30],iconAnchor:[15,15],popupAnchor:[0,-15]},gasStation:{iconUrl:mappWd+"assets/images/marker-gas-station.svg",iconSize:[30,30],iconAnchor:[15,15],popupAnchor:[0,-15]}},Mapp.prototype.styles.search={polyline:{stroke:!0,color:"#FB8C00",weight:3,opacity:.75,smoothFactor:1,fill:!1,fillColor:"#FFFFFF",fillOpacity:.3,clickable:!0,dashArray:"10 5"},polygon:{stroke:!0,color:"#FB8C00",weight:3,opacity:.75,smoothFactor:1,fill:!0,fillColor:"#FFFFFF",fillOpacity:.3,clickable:!0,dashArray:"10 5"}},Mapp.prototype.addSearch=function(t){var o;this.setSearch(),this.search.options=$.extend(!0,{counts:{geocode:5,poi:10},history:!1},t),this.dom.search={},(o=this).groups.search=this.groups.search||L.layerGroup().addTo(this.map);this.dom.anchors.top.direct.append('<div class="mapp-search is-boxed"><div class="wrapper item-set horizontal"><div class="first"></div><div class="has-clear"><input type="text" name="" data-i18n="[placeholder]mapp-search"></div><button class="" type="button" name="button" data-i18n="mapp-go"></button><div class="last"></div></div><div class="more display-none"><ul><li class="icon-background tooltip-bottom" data-i18n="[title]mapp-tooltip-search-area"><span class="icon is-large icon-polygon"></span></li><li class="icon-background tooltip-bottom" data-i18n="[title]mapp-tooltip-search-near"><span class="icon is-large icon-marker"></span></li></ul></div><div class="icon-background icon-background-more"><a data-i18n="[title]mapp-tooltip-search-options" href="#" class="icon icon-more tooltip-bottom"></a></div><div class="autocomplete is-invisible is-boxed"></div><div class="suggestions is-invisible is-boxed"><div class="owl-carousel owl-theme"><div class="item icon-background tooltip-bottom" data-i18n="[title]mapp-poi-restaurant" data-value="رستوران" data-icon="restaurant"><span class="icon is-large icon-restaurant"></span></div><div class="item icon-background tooltip-bottom" data-i18n="[title]mapp-poi-bank" data-value="بانک" data-icon="bank"><span class="icon is-large icon-bank"></span></div><div class="item icon-background tooltip-bottom" data-i18n="[title]mapp-poi-cafe" data-value="کافه" data-icon="cafe"><span class="icon is-large icon-cafe"></span></div><div class="item icon-background tooltip-bottom" data-i18n="[title]mapp-poi-library" data-value="کتابخانه" data-icon="library"><span class="icon is-large icon-library"></span></div><div class="item icon-background tooltip-bottom" data-i18n="[title]mapp-poi-hotel" data-value="هتل" data-icon="hotel"><span class="icon is-large icon-hotel"></span></div><div class="item icon-background tooltip-bottom" data-i18n="[title]mapp-poi-mosque" data-value="مسجد" data-icon="mosque"><span class="icon is-large icon-mosque"></span></div><div class="item icon-background tooltip-bottom" data-i18n="[title]mapp-poi-mall" data-value="فروشگاه" data-icon="mall"><span class="icon is-large icon-mall"></span></div><div class="item icon-background tooltip-bottom" data-i18n="[title]mapp-poi-hospital" data-value="بیمارستان" data-icon="hospital"><span class="icon is-large icon-hospital"></span></div><div class="item icon-background tooltip-bottom" data-i18n="[title]mapp-poi-metro" data-value="مترو" data-icon="metro"><span class="icon is-large icon-metro"></span></div><div class="item icon-background tooltip-bottom" data-i18n="[title]mapp-poi-drugstore" data-value="داروخانه" data-icon="drugstore"><span class="icon is-large icon-drugstore"></span></div><div class="item icon-background tooltip-bottom" data-i18n="[title]mapp-poi-parking" data-value="پارکینگ" data-icon="parking"><span class="icon is-large icon-parking"></span></div><div class="item icon-background tooltip-bottom" data-i18n="[title]mapp-poi-gas-station" data-value="پمپ بنزین" data-icon="gasStation"><span class="icon is-large icon-gas-station"></span></div><div class="item icon-background tooltip-bottom" data-i18n="[title]mapp-poi-university" data-value="دانشگاه" data-icon="university"><span class="icon is-large icon-university"></span></div></div></div></div>'),$(".owl-carousel").owlCarousel({rtl:!0,loop:!1,margin:0,nav:!1,dots:!1,responsive:{0:{items:6},480:{items:6},600:{items:8},840:{items:8},1440:{items:8}}}),this.dom.search.element=$(this.settings.element).find(".mapp-search"),this.dom.search.input=this.dom.search.element.find("input"),this.dom.search.button=this.dom.search.element.find("button"),this.dom.search.more=this.dom.search.element.find(".more"),this.dom.search.polygon=this.dom.search.element.find(".icon-polygon"),this.dom.search.marker=this.dom.search.element.find(".icon-marker"),this.dom.search.moreTrigger=this.dom.search.element.find(".icon-more"),this.dom.search.wrapper=this.dom.search.element.find(".wrapper"),this.dom.search.autocomplete=this.dom.search.element.find(".autocomplete"),this.dom.search.suggestions=this.dom.search.element.find(".suggestions"),this.dom.search.suggestions.showVisibility(),this.dom.search.suggestions.find(".item").on("click",function(){o.switchSearchToPoi({last:{query:$(this).attr("data-value"),icon:o.icons.poi[$(this).attr("data-icon")]}}),o.doSearch({query:o.search.poi.last.query,icon:o.search.poi.last.icon})}),$(this.settings.element).on("click",function(){o.dom.search.autocomplete.hideVisibility(),o.dom.search.suggestions.showVisibility()}),this.dom.search.element.on("click",function(t){t.stopPropagation()}),this.dom.search.input.on("focus",function(t){t.stopPropagation()}),this.dom.search.input.on("click",function(t){t.preventDefault(),t.stopPropagation(),o.switchSearchToAddress()}),this.dom.search.moreTrigger.on("click",function(t){t.preventDefault(),t.stopPropagation(),o.dom.search.more.toggleDisplay(),o.dom.search.wrapper.toggleClass("is-active")}),this.dom.search.button.on("click",function(t){t.preventDefault(),t.stopPropagation(),""!==o.dom.search.input.val()&&"address"===o.search.type&&o.doSearch({query:o.dom.search.input.val()})}),this.dom.search.input.on("keypress",function(t){13==t.keyCode&&(t.preventDefault(),t.stopPropagation(),$(o.settings.element).find(".mapp-search .clear").on("click",function(){o.clearSearch()}),""!==o.dom.search.input.val()&&"address"===o.search.type&&o.doSearch({query:o.dom.search.input.val()}))}),this.map.on("draw:created",function(t){var e=t.layerType,i=t.layer,n=void 0!==t.layer.options.featureGroup?t.layer.options.featureGroup:t.layer.options.icon.options.featureGroup;"search-points"===n&&"marker"===e&&(o.addMarker({name:"search-point",latlng:i._latlng,icon:o.icons.around,popup:{title:{html:'<span data-i18n="mapp-search-marker-title"></span>'},open:!1},pan:!1,draggable:!0}),o.updatePoiSearch(),o.features.markers.items["search-point"].on("dragend",function(){o.updatePoiSearch()})),"search-polygons"===n&&"polygon"===e&&(o.addPolygon({name:"search-polygon",coordinates:i._latlngs,styles:o.styles.search.polygon,popup:{title:{html:'<span data-i18n="mapp-search-polygon-title"></span>'},open:!1},bound:!1}),o.updatePoiSearch())}),this.dom.search.polygon.on("click",function(t){t.preventDefault(),t.stopPropagation();var e=o.styles.search.polygon;e.featureGroup="search-polygons",e.featureId="not set",new L.Draw.Polygon(o.map,{shapeOptions:e}).enable()}),this.dom.search.marker.on("click",function(t){t.preventDefault(),t.stopPropagation();var e=o.icons.around;e.featureGroup="search-points",e.featureId="not set",new L.Draw.Marker(o.map,{icon:L.icon(e)}).enable()})},Mapp.prototype.setSearch=function(t){var e=$.extend(!0,{before:function(){},after:function(){},value:"address"},t);e.before(),this.search=this.search||{poi:{last:{icon:"",query:""}},type:""},this.search.type=e.value,localStorage.setItem("searchType",this.search.type),e.after()},Mapp.prototype.getSearch=function(t){$.extend(!0,{},t);return void 0===this.search&&this.setSearch(),this.search.type},Mapp.prototype.clearSearch=function(t){$.extend(!0,{},t);this.dom.search.input.val(""),this.groups.search.clearLayers()},Mapp.prototype.doSearch=function(t){var a,n=$.extend(!0,{before:function(){},after:function(){},query:"",icon:this.icons.search,autocompleteParent:this.dom.search.autocomplete},t);a=this,n.before();var e=this.features&&this.features.markers&&this.features.markers.items["search-point"]?this.features.markers.items["search-point"].getLatLng():this.states.current.latlng,i={type:"Point",coordinates:[parseFloat(e.lng),parseFloat(e.lat)]},o={type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[[[this.states.current.bounds._southWest.lng,this.states.current.bounds._southWest.lat],[this.states.current.bounds._southWest.lng,this.states.current.bounds._northEast.lat],[this.states.current.bounds._northEast.lng,this.states.current.bounds._northEast.lat],[this.states.current.bounds._northEast.lng,this.states.current.bounds._southWest.lat],[this.states.current.bounds._southWest.lng,this.states.current.bounds._southWest.lat]]]}},r=void 0!==this.features.polygons.items["search-polygon"]?this.features.polygons.items["search-polygon"].toGeoJSON():o;if("address"===this.search.type&&n.query.match(/(\d+) *[-{1}| {1}|,{1}] *(\d+)/)){var s=n.query.replace(/ {1,}/,"-").replace(/,{1,}/,"-").replace(/-{1,}/,"-").split("-"),l={lat:s[0],lng:s[1]},u={html:a.generateLatlngHtml({lat:parseFloat(l.lat),lng:parseFloat(l.lng),type:"comma"}),i18n:""};this.makeSearchMarker({title:u,latlng:l,icon:"icon-point"})}else if("address"===this.search.type){var c={text:n.query,geom:{type:"Polygon",coordinates:r.geometry.coordinates[0]},location:i,type:"",$skip:0,$top:this.search.options.counts.geocode};this.ajax({mode:this.env.mode,task:"search",url:this.env.url.search.geocode,urlParams:"",type:"POST",data:JSON.stringify(c),dataType:"json",contentType:"application/json; charset=utf-8",processData:!1,success:function(t){var r="";$.each(t.value,function(t,e){if(!(t>=a.search.options.counts.geocode)){var i=[];""!==e.title&&i.push(e.Title);var n=i.join($.i18n("mapp-comma")+" "),o={name:"search",latlng:{lat:e.Coordinate.lat,lng:e.Coordinate.lon},fclass:e.FClass,popup:{title:{html:n,i18n:""},description:{html:"",i18n:""}}};o.description='<div class="description">'+e.City+"</div>",void 0!==a.states.user.latlng&&(o.description+='<div class="description">'+a.latlngToDistance(a.states.user.latlng,o.latlng)+$.i18n("mapp-km")+"</div>"),r=a.generateAutocompleteItem(r,o)}}),r="<ul>"+r+"</ul>",n.autocompleteParent.html(r).showVisibility(),n.autocompleteParent.find("li").on("click",function(){a.dom.search.autocomplete.hideVisibility(),a.makeMarkerFromAutocomplete($(this))})}})}else if("poi"===this.search.type){c={text:n.query,geom:{type:"Polygon",coordinates:r.geometry.coordinates[0]},location:i,type:"",$skip:0,$top:this.search.options.counts.poi};this.ajax({mode:this.env.mode,task:"search",url:this.env.url.search.poi,urlParams:"",type:"POST",data:JSON.stringify(c),dataType:"json",contentType:"application/json; charset=utf-8",processData:!1,beforeSend:function(){},success:function(t){a.groups.search.clearLayers(),$.each(t.value,function(t,e){var i={lat:e.Coordinate.lat,lng:e.Coordinate.lon};e.title;a.addMarker({name:"poi"+t,popup:{title:{html:'<span data-i18n="mapp-search"></span>'}},latlng:i,icon:n.icon,group:a.groups.search})})}})}n.after()},Mapp.prototype.updatePoiSearch=function(){""!==this.search.poi.last.query&&""!==this.search.poi.last.icon&&this.doSearch({query:this.search.poi.last.query,icon:this.search.poi.last.icon})},Mapp.prototype.switchSearchToAddress=function(t){$.extend(!0,{},t);var e=this;"poi"===this.search.type&&this.clearSearch(),this.setSearch({value:"address"}),this.dom.search.autocomplete.hideVisibility(),this.dom.search.suggestions.hideVisibility(),$.clearButton.check(),this.search.options.history&&0<this.history.features.markers.length&&(this.dom.search.autocomplete.showVisibility(),this.dom.search.autocomplete.html(this.getAutocompleteHistory()),this.dom.search.autocomplete.i18n(),this.dom.search.autocomplete.find("li").on("click",function(){e.dom.search.autocomplete.hideVisibility(),e.makeMarkerFromAutocomplete($(this))}))},Mapp.prototype.switchSearchToPoi=function(t){var e=$.extend(!0,{last:{query:"",icon:this.icons.search}},t),i=this;this.setSearch({value:"poi"}),this.search.poi.last.query=e.last.query,this.search.poi.last.icon=e.last.icon,this.dom.search.input.val(this.search.poi.last.query),$.clearButton.check(),$(this.settings.element).find(".mapp-search .clear").on("click",function(){i.clearSearch()})},Mapp.prototype.generateAutocompleteItem=function(t,e){var i=$.extend(!0,{name:"",latlng:{lat:"",lng:""},fclass:"",popup:{title:{html:"",i18n:""},description:{html:"",i18n:""}}},e);return t+='<li data-title="'+i.popup.title.html+'" data-lat="'+i.latlng.lat+'" data-lng="'+i.latlng.lng+'"><div class="icon-background"><div class="icon" data-fclass="'+i.fclass+'"></div></div><div class="value" data-i18n="'+i.popup.title.i18n+'">'+i.popup.title.html+"</div></li>"},Mapp.prototype.makeMarkerFromAutocomplete=function(t){var e={lat:t.attr("data-lat"),lng:t.attr("data-lng")},i={html:t.attr("data-title"),i18n:""},n=t.find(".value").attr("data-i18n"),o=t.attr("data-icon");this.makeSearchMarker({title:i,i18n:n,latlng:e,icon:o})},Mapp.prototype.makeSearchMarker=function(t){var e,i=$.extend(!0,{title:{},i18n:{},latlng:{},icon:"icon-point"},t);(e=this).findReverseGeocode({after:function(t){e.addMarker({name:"search",popup:{title:i.title,description:{html:t.address_compact},open:!0},latlng:i.latlng,icon:e.icons.search,pan:!0,history:e.search.options.history,group:e.groups.search})},state:{latlng:i.latlng}})},Mapp.prototype.getAutocompleteHistory=function(){var i,n="";return i=this,$.each(this.history.features.markers.reverse(),function(t,e){t>=i.search.options.counts.geocode||(n=i.generateAutocompleteItem(n,e))}),n="<ul>"+n+"</ul>",this.history.features.markers.reverse(),n},Mapp.prototype.routeStart=void 0,Mapp.prototype.routeEnd=void 0,Mapp.prototype.drawRoute=function(t){this.icons.circle={white:{iconUrl:mappWd+"assets/images/marker-circle-white.svg",iconSize:[8,8],iconAnchor:[4,4],popupAnchor:[0,-4]}};var o=$.extend(!0,{before:function(){},after:function(){},start:this.routeStart,end:this.routeEnd,mode:"car",draggable:!0,styles:{core:{weight:3,opacity:1},shadow:{weight:11,opacity:.3}},colors:["#F44336","#FF9800","#607D8B"],select:{enabled:!0,color:"#2196F3"},fit:!0},t);if("undefined"!==$.type(o.start)&&"undefined"!==$.type(o.end)){"object"===$.type(o.start)&&(o.start=[o.start.lat,o.start.lng]),"object"===$.type(o.end)&&(o.end=[o.end.lat,o.end.lng]),o.mode="foot"===o.mode?"foot":"bicycle"===o.mode?"bicycle":"route",this.groups.route=this.groups.route||{whole:L.featureGroup(),icons:L.featureGroup().addTo(this.map),nodes:[],lines:[]};var r,a=this,s=[];return o.before(),this.ajax({mode:this.env.mode,task:"route",url:this.env.url.route+"/"+o.mode+"/v1/driving/"+[o.start[1],o.start[0]].join(",")+";"+[o.end[1],o.end[0]].join(","),type:"GET",data:{alternatives:!0,steps:!0,overview:"false",hints:";"},dataType:"json",success:function(e){if("Ok"===e.code){a.removeRoute();function t(){a.removeRoute(),a.routeStart=o.start=i.getLatLng(),a.routeEnd=o.end=n.getLatLng(),a.drawRoute(o)}var i=L.marker(o.start,{icon:L.icon(a.icons.green),draggable:o.draggable}).addTo(a.groups.route.whole).addTo(a.groups.route.icons),n=L.marker(o.end,{icon:L.icon(a.icons.green),draggable:o.draggable}).addTo(a.groups.route.whole).addTo(a.groups.route.icons);i.on("dragend",t),n.on("dragend",t),$.each(e.routes,function(n,t){a.groups.route.nodes[n]=L.featureGroup(),a.groups.route.lines[n]=L.featureGroup(),o.styles.core.color=o.colors[n]||o.colors[o.colors.length-1],o.styles.shadow.color=o.colors[n]||o.colors[o.colors.length-1],0!==n?(o.styles.core.dashArray="10 10",o.styles.shadow.dashArray="10 10"):(o.styles.core.dashArray=void 0,o.styles.shadow.dashArray=void 0),void 0!==e.waypoints&&(L.polyline([[o.start[0],o.start[1]],[e.waypoints[0].location[1],e.waypoints[0].location[0]]],o.styles.shadow).addTo(a.groups.route.whole).addTo(a.groups.route.lines[n]),L.polyline([[o.start[0],o.start[1]],[e.waypoints[0].location[1],e.waypoints[0].location[0]]],o.styles.core).addTo(a.groups.route.whole).addTo(a.groups.route.lines[n]),L.polyline([[o.end[0],o.end[1]],[e.waypoints[1].location[1],e.waypoints[1].location[0]]],o.styles.shadow).addTo(a.groups.route.whole).addTo(a.groups.route.lines[n]),L.polyline([[o.end[0],o.end[1]],[e.waypoints[1].location[1],e.waypoints[1].location[0]]],o.styles.core).addTo(a.groups.route.whole).addTo(a.groups.route.lines[n])),$.each(t.legs[0].steps,function(t,e){var i='<div class="feature-popup">'+(e.name||"")+"</div>";L.polyline(polyline.decode(e.geometry),o.styles.shadow).addTo(a.groups.route.whole).addTo(a.groups.route.lines[n]),L.polyline(polyline.decode(e.geometry),o.styles.core).addTo(a.groups.route.whole).addTo(a.groups.route.lines[n]),L.marker([e.maneuver.location[1],e.maneuver.location[0]],{icon:L.icon(a.icons.circle.white)}).addTo(a.groups.route.whole).addTo(a.groups.route.nodes[n]).bindPopup(i,a.popupOptions),r=a.groups.route.whole.getBounds()}),a.groups.route.nodes[n].addTo(a.map),a.groups.route.lines[n].addTo(a.map),s.push({featureGroups:{nodes:a.groups.route.nodes[n],lines:a.groups.route.lines[n]},distance:t.distance,duration:t.duration}),o.select.enabled&&a.groups.route.lines[n].on("click",function(t){t.originalEvent.stopPropagation(),t.originalEvent.preventDefault(),a.colorRoute(),a.groups.route.lines[n].setStyle({color:o.select.color})})}),!0===o.fit&&a.map.fitBounds(r),o.after()}}}),s}},Mapp.prototype.removeRoute=function(t){$.extend(!0,{before:function(){},after:function(){}},t);var e=this;$.each(e.groups.route.lines,function(t){e.groups.route.lines[t].clearLayers()}),$.each(e.groups.route.nodes,function(t){e.groups.route.nodes[t].clearLayers()}),e.groups.route.icons.clearLayers()},Mapp.prototype.colorRoute=function(t){var i=$.extend(!0,{colors:["#F44336","#FF9800","#607D8B"]},t);$.each(this.groups.route.lines,function(t,e){e.setStyle({color:i.colors[t]||i.colors[i.colors.length-1]})})},Mapp.prototype.addMedia=function(t){var e;$.extend(!0,{},t);this.dom.footer.triggers.right.append('<a href="#" class="trigger-media"><span class="icon"></span><span class="title" data-i18n="mapp-media"></span></a>');var i=$(this.settings.element).find(".trigger-media");e=this,i.on("click",function(t){t.preventDefault(),t.stopPropagation(),e.dom.footer.element.toggleClass("is-active")})},Mapp.prototype.icons.weather={iconSize:[20,20],iconAnchor:[10,10],popupAnchor:[0,-10]},Mapp.prototype.getWeather=function(t){var e=$.extend(!0,{before:function(){},after:function(){}},t);this.ajax({mode:this.env.mode,task:"weather",url:this.env.url.weather,type:"GET",success:function(t){e.after(t)}})},Mapp.prototype.showWeather=function(t){var l=$.extend(!0,{popups:!0,icons:"local"},t),u=this;this.groups.weather=this.groups.weather||L.layerGroup().addTo(this.map);function e(t){var e=u.icons.weather;"local"===l.icons?e.iconUrl=mappWd+"assets/images/icon-weather-"+t.properties.icon+".svg":e.iconUrl="http://openweathermap.org/img/w/"+t.properties.icon+".png";var i=[t.geometry.coordinates[1],t.geometry.coordinates[0]],n=u.groups.weather,o=L.marker(i,{icon:L.icon(e),opacity:.8}).addTo(n);if(!0===l.popups){var r=u.popupOptions,a='<div><div><span data-i18n="mapp-condition"></span>: '+t.properties.condition+'</div><div><span data-i18n="mapp-temperature"></span>: '+t.properties.temperature.current+'</div><div><span data-i18n="mapp-humidity"></span>: '+t.properties.humidity+"</div></div>",s=u.generatePopupHtml({title:{html:t.properties.city},description:{html:a}});o.bindPopup(s,r),o.on("popupopen",function(){var t=this.getPopup();$(t._container).i18n()})}}this.getWeather({after:function(t){L.geoJSON(t,{onEachFeature:e})}})},Mapp.prototype.hideWeather=function(t){$.extend(!0,{},t);this.groups.weather.clearLayers()},Mapp.prototype.addWeather=function(t){var e;$.extend(!0,{},t);$(this.settings.element).find("aside.options form").append('<div class="title has-icon small icon-weather" data-i18n="mapp-weather"></div><div class="flex-wrapper"><label class="bullet small"><input type="checkbox" name="weather" value="true"><span class="checkmark" data-i18n="mapp-weather-option"></span></label></div>'),e=this,$(this.settings.element).find('input[name="weather"]').on("change",function(){$(this).is(":checked")?e.showWeather():e.hideWeather()})};
}(jQuery))