-
Notifications
You must be signed in to change notification settings - Fork 6
/
bundle-js-1728500195727-min.js
16 lines (16 loc) ยท 179 KB
/
bundle-js-1728500195727-min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* @preserve
* Leaflet 1.7.1, a JS library for interactive maps. http://leafletjs.com
* (c) 2010-2019 Vladimir Agafonkin, (c) 2010-2011 CloudMade
*/
function isArray(t){return"[object Array]"===Object.prototype.toString.call(t)}function cel(t){if(!isArray(t))return cel.call(this,Array.prototype.slice.call(arguments));var e=t[0],i=t[1],n=document.createElement(e),o=1;if("object"==typeof i&&null!==i&&!isArray(i)){for(var s in i)n[s]=i[s];o=2}for(var a=o;a<t.length;a++)isArray(t[a])?n.appendChild(cel(t[a])):n.appendChild(document.createTextNode(t[a]));return n}function randomColor(t,e){return"hsl("+t*(360/(e<1?1:e))%360+",100%,50%)"}function randomColor2(){return randomColor(Math.floor(999*Math.random()),100)}function promiseTimeout(t){return new Promise((function(e,i){setTimeout((()=>i(new Error("timeout"))),4e3),t.then(e,i)}))}function getDistance(t,e){return Math.abs(t[0]-e[0])+Math.abs(t[1]-e[1])}function isBetweenDates(t,e,i,n){const o=new Date,s=o.getFullYear(),a=new Date(s,t-1,e,0,0,0),r=new Date(s,i-1,n,0,0,0);return o>=a&&o<r}function isHalloweenEvent(){return isBetweenDates(10,1,11,1)}!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 e(t){for(var e,i,n=1,o=arguments.length;n<o;n++)for(e in i=arguments[n])t[e]=i[e];return t}var i=Object.create||function(t){return n.prototype=t,new n};function n(){}function o(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)}}var s=0;function a(t){return t._leaflet_id=t._leaflet_id||++s,t._leaflet_id}function r(t,e,i){var n,o,s=function(){n=!1,o&&(a.apply(i,o),o=!1)},a=function(){n?o=arguments:(t.apply(i,arguments),setTimeout(s,e),n=!0)};return a}function h(t,e,i){var n=e[1],o=e[0],s=n-o;return t===n&&i?t:((t-o)%s+s)%s+o}function l(){return!1}function u(t,e){var i=Math.pow(10,void 0===e?6:e);return Math.round(t*i)/i}function c(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function _(t){return c(t).split(/\s+/)}function d(t,e){for(var n in Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?i(t.options):{}),e)t.options[n]=e[n];return t.options}function p(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("&")}var m=/\{ *([\w_-]+) *\}/g;function f(t,e){return t.replace(m,(function(t,i){var n=e[i];if(void 0===n)throw new Error("No value provided for variable "+t);return"function"==typeof n&&(n=n(e)),n}))}var g=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function v(t,e){for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1}var y="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function x(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var b=0;function w(t){var e=+new Date,i=Math.max(0,16-(e-b));return b=e+i,window.setTimeout(t,i)}var P=window.requestAnimationFrame||x("RequestAnimationFrame")||w,T=window.cancelAnimationFrame||x("CancelAnimationFrame")||x("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function M(t,e,i){if(!i||P!==w)return P.call(window,o(t,e));t.call(e)}function k(t){t&&T.call(window,t)}var z={extend:e,create:i,bind:o,lastId:s,stamp:a,throttle:r,wrapNum:h,falseFn:l,formatNum:u,trim:c,splitWords:_,setOptions:d,getParamString:p,template:f,isArray:g,indexOf:v,emptyImageUrl:y,requestFn:P,cancelFn:T,requestAnimFrame:M,cancelAnimFrame:k};function S(){}S.extend=function(t){function n(){this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()}var o=n.__super__=this.prototype,s=i(o);for(var a in(s.constructor=n).prototype=s,this)Object.prototype.hasOwnProperty.call(this,a)&&"prototype"!==a&&"__super__"!==a&&(n[a]=this[a]);return t.statics&&(e(n,t.statics),delete t.statics),t.includes&&(function(t){if("undefined"!=typeof L&&L&&L.Mixin){t=g(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),e.apply(null,[s].concat(t.includes)),delete t.includes),s.options&&(t.options=e(i(s.options),t.options)),e(s,t),s._initHooks=[],s.callInitHooks=function(){if(!this._initHooksCalled){o.callInitHooks&&o.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=s._initHooks.length;t<e;t++)s._initHooks[t].call(this)}},n},S.include=function(t){return e(this.prototype,t),this},S.mergeOptions=function(t){return e(this.prototype.options,t),this},S.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 C={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,s=(t=_(t)).length;o<s;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,s=(t=_(t)).length;o<s;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},s=n,a=0,r=s.length;a<r;a++)if(s[a].fn===e&&s[a].ctx===i)return;s.push(o)},_off:function(t,e,i){var n,o,s;if(this._events&&(n=this._events[t]))if(e){if(i===this&&(i=void 0),n)for(o=0,s=n.length;o<s;o++){var a=n[o];if(a.ctx===i&&a.fn===e)return a.fn=l,this._firingCount&&(this._events[t]=n=n.slice()),void n.splice(o,1)}}else{for(o=0,s=n.length;o<s;o++)n[o].fn=l;delete this._events[t]}},fire:function(t,i,n){if(!this.listens(t,n))return this;var o=e({},i,{type:t,target:this,sourceTarget:i&&i.sourceTarget||this});if(this._events){var s=this._events[t];if(s){this._firingCount=this._firingCount+1||1;for(var a=0,r=s.length;a<r;a++){var h=s[a];h.fn.call(h.ctx||this,o)}this._firingCount--}}return n&&this._propagateEvent(o),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 s=o((function(){this.off(t,e,i).off(t,s,i)}),this);return this.on(t,e,i).on(t,s,i)},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[a(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[a(t)],this},_propagateEvent:function(t){for(var i in this._eventParents)this._eventParents[i].fire(t.type,e({layer:t.target,propagatedFrom:t.target},t),!0)}};C.addEventListener=C.on,C.removeEventListener=C.clearAllEventListeners=C.off,C.addOneTimeEventListener=C.once,C.fireEvent=C.fire,C.hasEventListeners=C.listens;var E=S.extend(C);function Z(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e}var A=Math.trunc||function(t){return 0<t?Math.floor(t):Math.ceil(t)};function O(t,e,i){return t instanceof Z?t:g(t)?new Z(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new Z(t.x,t.y):new Z(t,e,i)}function I(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}function B(t,e){return!t||t instanceof I?t:new I(t,e)}function j(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}function R(t,e){return t instanceof j?t:new j(t,e)}function N(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 D(t,e,i){return t instanceof N?t:g(t)&&"object"!=typeof t[0]?3===t.length?new N(t[0],t[1],t[2]):2===t.length?new N(t[0],t[1]):null:null==t?t:"object"==typeof t&&"lat"in t?new N(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===e?null:new N(t,e,i)}Z.prototype={clone:function(){return new Z(this.x,this.y)},add:function(t){return this.clone()._add(O(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(O(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 Z(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new Z(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},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=A(this.x),this.y=A(this.y),this},distanceTo:function(t){var e=(t=O(t)).x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return(t=O(t)).x===this.x&&t.y===this.y},contains:function(t){return t=O(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+u(this.x)+", "+u(this.y)+")"}},I.prototype={extend:function(t){return t=O(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 Z((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new Z(this.min.x,this.max.y)},getTopRight:function(){return new Z(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 Z?O:B)(t))instanceof I?(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=B(t);var e=this.min,i=this.max,n=t.min,o=t.max,s=o.x>=e.x&&n.x<=i.x,a=o.y>=e.y&&n.y<=i.y;return s&&a},overlaps:function(t){t=B(t);var e=this.min,i=this.max,n=t.min,o=t.max,s=o.x>e.x&&n.x<i.x,a=o.y>e.y&&n.y<i.y;return s&&a},isValid:function(){return!(!this.min||!this.max)}},j.prototype={extend:function(t){var e,i,n=this._southWest,o=this._northEast;if(t instanceof N)i=e=t;else{if(!(t instanceof j))return t?this.extend(D(t)||R(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 N(e.lat,e.lng),this._northEast=new N(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 j(new N(e.lat-n,e.lng-o),new N(i.lat+n,i.lng+o))},getCenter:function(){return new N((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 N(this.getNorth(),this.getWest())},getSouthEast:function(){return new N(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 N||"lat"in t?D:R)(t);var e,i,n=this._southWest,o=this._northEast;return t instanceof j?(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=R(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>=e.lat&&n.lat<=i.lat,a=o.lng>=e.lng&&n.lng<=i.lng;return s&&a},overlaps:function(t){t=R(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>e.lat&&n.lat<i.lat,a=o.lng>e.lng&&n.lng<i.lng;return s&&a},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,e){return!!t&&(t=R(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e))},isValid:function(){return!(!this._southWest||!this._northEast)}};var F,H={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 I(this.transformation.transform(e.min,i),this.transformation.transform(e.max,i))},infinite:!(N.prototype={equals:function(t,e){return!!t&&(t=D(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("+u(this.lat,t)+", "+u(this.lng,t)+")"},distanceTo:function(t){return W.distance(this,D(t))},wrap:function(){return W.wrapLatLng(this)},toBounds:function(t){var e=180*t/40075017,i=e/Math.cos(Math.PI/180*this.lat);return R([this.lat-e,this.lng-i],[this.lat+e,this.lng+i])},clone:function(){return new N(this.lat,this.lng,this.alt)}}),wrapLatLng:function(t){var e=this.wrapLng?h(t.lng,this.wrapLng,!0):t.lng;return new N(this.wrapLat?h(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 s=t.getSouthWest(),a=t.getNorthEast();return new j(new N(s.lat-n,s.lng-o),new N(a.lat-n,a.lng-o))}},W=e({},H,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var i=Math.PI/180,n=t.lat*i,o=e.lat*i,s=Math.sin((e.lat-t.lat)*i/2),a=Math.sin((e.lng-t.lng)*i/2),r=s*s+Math.cos(n)*Math.cos(o)*a*a,h=2*Math.atan2(Math.sqrt(r),Math.sqrt(1-r));return this.R*h}}),U=6378137,$={R:U,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 Z(this.R*t.lng*e,this.R*Math.log((1+o)/(1-o))/2)},unproject:function(t){var e=180/Math.PI;return new N((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:new I([-(F=U*Math.PI),-F],[F,F])};function q(t,e,i,n){if(g(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 G(t,e,i,n){return new q(t,e,i,n)}q.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 Z((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}};var V,K=e({},W,{code:"EPSG:3857",projection:$,transformation:G(V=.5/(Math.PI*$.R),.5,-V,.5)}),Y=e({},K,{code:"EPSG:900913"});function X(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function J(t,e){for(var i,n,o,s,a="",r=0,h=t.length;r<h;r++){for(i=0,n=(o=t[r]).length;i<n;i++)a+=(i?"L":"M")+(s=o[i]).x+" "+s.y;a+=e?Ct?"z":"x":""}return a||"M0 0"}var Q=document.documentElement.style,tt="ActiveXObject"in window,et=tt&&!document.addEventListener,it="msLaunchUri"in navigator&&!("documentMode"in document),nt=Zt("webkit"),ot=Zt("android"),st=Zt("android 2")||Zt("android 3"),at=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),rt=ot&&Zt("Google")&&at<537&&!("AudioNode"in window),ht=!!window.opera,lt=!it&&Zt("chrome"),ut=Zt("gecko")&&!nt&&!ht&&!tt,ct=!lt&&Zt("safari"),_t=Zt("phantom"),dt="OTransition"in Q,pt=0===navigator.platform.indexOf("Win"),mt=tt&&"transition"in Q,ft="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!st,gt="MozPerspective"in Q,vt=!window.L_DISABLE_3D&&(mt||ft||gt)&&!dt&&!_t,yt="undefined"!=typeof orientation||Zt("mobile"),xt=yt&&nt,bt=yt&&ft,Lt=!window.PointerEvent&&window.MSPointerEvent,wt=!(!window.PointerEvent&&!Lt),Pt=!window.L_NO_TOUCH&&(wt||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),Tt=yt&&ht,Mt=yt&&ut,kt=1<(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI),zt=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",l,e),window.removeEventListener("testPassiveEventSupport",l,e)}catch(t){}return t}(),St=!!document.createElement("canvas").getContext,Ct=!(!document.createElementNS||!X("svg").createSVGRect),Et=!Ct&&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}}();function Zt(t){return 0<=navigator.userAgent.toLowerCase().indexOf(t)}var At={ie:tt,ielt9:et,edge:it,webkit:nt,android:ot,android23:st,androidStock:rt,opera:ht,chrome:lt,gecko:ut,safari:ct,phantom:_t,opera12:dt,win:pt,ie3d:mt,webkit3d:ft,gecko3d:gt,any3d:vt,mobile:yt,mobileWebkit:xt,mobileWebkit3d:bt,msPointer:Lt,pointer:wt,touch:Pt,mobileOpera:Tt,mobileGecko:Mt,retina:kt,passiveEvents:zt,canvas:St,svg:Ct,vml:Et},Ot=Lt?"MSPointerDown":"pointerdown",It=Lt?"MSPointerMove":"pointermove",Bt=Lt?"MSPointerUp":"pointerup",jt=Lt?"MSPointerCancel":"pointercancel",Rt={},Nt=!1;function Dt(t,e,i,n){function s(t){Ut(t,r)}var a,r,h,l,u,c,_,d;function p(t){t.pointerType===(t.MSPOINTER_TYPE_MOUSE||"mouse")&&0===t.buttons||Ut(t,l)}return"touchstart"===e?(u=t,c=i,_=n,d=o((function(t){t.MSPOINTER_TYPE_TOUCH&&t.pointerType===t.MSPOINTER_TYPE_TOUCH&&je(t),Ut(t,c)})),u["_leaflet_touchstart"+_]=d,u.addEventListener(Ot,d,!1),Nt||(document.addEventListener(Ot,Ft,!0),document.addEventListener(It,Ht,!0),document.addEventListener(Bt,Wt,!0),document.addEventListener(jt,Wt,!0),Nt=!0)):"touchmove"===e?(l=i,(h=t)["_leaflet_touchmove"+n]=p,h.addEventListener(It,p,!1)):"touchend"===e&&(r=i,(a=t)["_leaflet_touchend"+n]=s,a.addEventListener(Bt,s,!1),a.addEventListener(jt,s,!1)),this}function Ft(t){Rt[t.pointerId]=t}function Ht(t){Rt[t.pointerId]&&(Rt[t.pointerId]=t)}function Wt(t){delete Rt[t.pointerId]}function Ut(t,e){for(var i in t.touches=[],Rt)t.touches.push(Rt[i]);t.changedTouches=[t],e(t)}var $t,qt,Gt,Vt,Kt,Yt,Xt=Lt?"MSPointerDown":wt?"pointerdown":"touchstart",Jt=Lt?"MSPointerUp":wt?"pointerup":"touchend",Qt="_leaflet_",te=fe(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ee=fe(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),ie="webkitTransition"===ee||"OTransition"===ee?ee+"End":"transitionend";function ne(t){return"string"==typeof t?document.getElementById(t):t}function oe(t,e){var i,n=t.style[e]||t.currentStyle&&t.currentStyle[e];return n&&"auto"!==n||!document.defaultView||(n=(i=document.defaultView.getComputedStyle(t,null))?i[e]:null),"auto"===n?null:n}function se(t,e,i){var n=document.createElement(t);return n.className=e||"",i&&i.appendChild(n),n}function ae(t){var e=t.parentNode;e&&e.removeChild(t)}function re(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function he(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function le(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function ue(t,e){if(void 0!==t.classList)return t.classList.contains(e);var i=pe(t);return 0<i.length&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(i)}function ce(t,e){var i;if(void 0!==t.classList)for(var n=_(e),o=0,s=n.length;o<s;o++)t.classList.add(n[o]);else ue(t,e)||de(t,((i=pe(t))?i+" ":"")+e)}function _e(t,e){void 0!==t.classList?t.classList.remove(e):de(t,c((" "+pe(t)+" ").replace(" "+e+" "," ")))}function de(t,e){void 0===t.className.baseVal?t.className=e:t.className.baseVal=e}function pe(t){return t.correspondingElement&&(t=t.correspondingElement),void 0===t.className.baseVal?t.className:t.className.baseVal}function me(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 fe(t){for(var e=document.documentElement.style,i=0;i<t.length;i++)if(t[i]in e)return t[i];return!1}function ge(t,e,i){var n=e||new Z(0,0);t.style[te]=(mt?"translate("+n.x+"px,"+n.y+"px)":"translate3d("+n.x+"px,"+n.y+"px,0)")+(i?" scale("+i+")":"")}function ve(t,e){t._leaflet_pos=e,vt?ge(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function ye(t){return t._leaflet_pos||new Z(0,0)}function xe(){ke(window,"dragstart",je)}function be(){Se(window,"dragstart",je)}function Le(t){for(;-1===t.tabIndex;)t=t.parentNode;t.style&&(we(),Yt=(Kt=t).style.outline,t.style.outline="none",ke(window,"keydown",we))}function we(){Kt&&(Kt.style.outline=Yt,Yt=Kt=void 0,Se(window,"keydown",we))}function Pe(t){for(;!((t=t.parentNode).offsetWidth&&t.offsetHeight||t===document.body););return t}function Te(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}Vt="onselectstart"in document?(Gt=function(){ke(window,"selectstart",je)},function(){Se(window,"selectstart",je)}):(qt=fe(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]),Gt=function(){var t;qt&&(t=document.documentElement.style,$t=t[qt],t[qt]="none")},function(){qt&&(document.documentElement.style[qt]=$t,$t=void 0)});var Me={TRANSFORM:te,TRANSITION:ee,TRANSITION_END:ie,get:ne,getStyle:oe,create:se,remove:ae,empty:re,toFront:he,toBack:le,hasClass:ue,addClass:ce,removeClass:_e,setClass:de,getClass:pe,setOpacity:me,testProp:fe,setTransform:ge,setPosition:ve,getPosition:ye,disableTextSelection:Gt,enableTextSelection:Vt,disableImageDrag:xe,enableImageDrag:be,preventOutline:Le,restoreOutline:we,getSizedParentNode:Pe,getScale:Te};function ke(t,e,i,n){if("object"==typeof e)for(var o in e)Ze(t,o,e[o],i);else for(var s=0,a=(e=_(e)).length;s<a;s++)Ze(t,e[s],i,n);return this}var ze="_leaflet_events";function Se(t,e,i,n){if("object"==typeof e)for(var o in e)Ae(t,o,e[o],i);else if(e)for(var s=0,a=(e=_(e)).length;s<a;s++)Ae(t,e[s],i,n);else{for(var r in t[ze])Ae(t,r,t[ze][r]);delete t[ze]}return this}function Ce(){return wt&&!it&&!ct}var Ee={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Ze(t,e,i,n){var o=e+a(i)+(n?"_"+a(n):"");if(t[ze]&&t[ze][o])return this;var s,r,h,l,u,c,_=function(e){return i.call(n||t,e||window.event)},d=_;function p(t){if(wt){if(!t.isPrimary)return;if("mouse"===t.pointerType)return}else if(1<t.touches.length)return;var e=Date.now(),i=e-(l||e);u=t.touches?t.touches[0]:t,c=0<i&&i<=250,l=e}function m(t){if(c&&!u.cancelBubble){if(wt){if("mouse"===t.pointerType)return;var e,i,n={};for(i in u)e=u[i],n[i]=e&&e.bind?e.bind(u):e;u=n}u.type="dblclick",u.button=0,r(u),l=null}}wt&&0===e.indexOf("touch")?Dt(t,e,_,o):Pt&&"dblclick"===e&&!Ce()?(r=_,c=!1,(s=t)[Qt+Xt+(h=o)]=p,s[Qt+Jt+h]=m,s[Qt+"dblclick"+h]=r,s.addEventListener(Xt,p,!!zt&&{passive:!1}),s.addEventListener(Jt,m,!!zt&&{passive:!1}),s.addEventListener("dblclick",r,!1)):"addEventListener"in t?"touchstart"===e||"touchmove"===e||"wheel"===e||"mousewheel"===e?t.addEventListener(Ee[e]||e,_,!!zt&&{passive:!1}):"mouseenter"===e||"mouseleave"===e?(_=function(e){e=e||window.event,$e(t,e)&&d(e)},t.addEventListener(Ee[e],_,!1)):t.addEventListener(e,d,!1):"attachEvent"in t&&t.attachEvent("on"+e,_),t[ze]=t[ze]||{},t[ze][o]=_}function Ae(t,e,i,n){var o,s,r,h,l,u,c,_,d=e+a(i)+(n?"_"+a(n):""),p=t[ze]&&t[ze][d];if(!p)return this;wt&&0===e.indexOf("touch")?(_=(u=t)["_leaflet_"+(c=e)+d],"touchstart"===c?u.removeEventListener(Ot,_,!1):"touchmove"===c?u.removeEventListener(It,_,!1):"touchend"===c&&(u.removeEventListener(Bt,_,!1),u.removeEventListener(jt,_,!1))):Pt&&"dblclick"===e&&!Ce()?(r=(o=t)[Qt+Xt+(s=d)],h=o[Qt+Jt+s],l=o[Qt+"dblclick"+s],o.removeEventListener(Xt,r,!!zt&&{passive:!1}),o.removeEventListener(Jt,h,!!zt&&{passive:!1}),o.removeEventListener("dblclick",l,!1)):"removeEventListener"in t?t.removeEventListener(Ee[e]||e,p,!1):"detachEvent"in t&&t.detachEvent("on"+e,p),t[ze][d]=null}function Oe(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,Ue(t),this}function Ie(t){return Ze(t,"wheel",Oe),this}function Be(t){return ke(t,"mousedown touchstart dblclick",Oe),Ze(t,"click",We),this}function je(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function Re(t){return je(t),Oe(t),this}function Ne(t,e){if(!e)return new Z(t.clientX,t.clientY);var i=Te(e),n=i.boundingClientRect;return new Z((t.clientX-n.left)/i.x-e.clientLeft,(t.clientY-n.top)/i.y-e.clientTop)}var De=pt&<?2*window.devicePixelRatio:ut?window.devicePixelRatio:1;function Fe(t){return it?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/De: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}var He={};function We(t){He[t.type]=!0}function Ue(t){var e=He[t.type];return He[t.type]=!1,e}function $e(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}var qe={on:ke,off:Se,stopPropagation:Oe,disableScrollPropagation:Ie,disableClickPropagation:Be,preventDefault:je,stop:Re,getMousePosition:Ne,getWheelDelta:Fe,fakeStop:We,skipped:Ue,isExternalTarget:$e,addListener:ke,removeListener:Se},Ge=E.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=ye(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=M(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(),ve(this._el,i),this.fire("step")},_complete:function(){k(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),Ve=E.extend({options:{crs:K,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=d(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=o(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(D(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=ee&&vt&&!Tt&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),ke(this._proxy,ie,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,i,n){return i=void 0===i?this._zoom:this._limitZoom(i),t=this._limitCenter(D(t),i,this.options.maxBounds),n=n||{},this._stop(),this._loaded&&!n.reset&&!0!==n&&(void 0!==n.animate&&(n.zoom=e({animate:n.animate},n.zoom),n.pan=e({animate:n.animate,duration:n.duration},n.pan)),this._zoom!==i?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,i,n.zoom):this._tryAnimatedPan(t,n.pan))?(clearTimeout(this._sizeTimer),this):(this._resetView(t,i),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||(vt?this.options.zoomDelta:1),this.setZoom(this._zoom+t,e)},zoomOut:function(t,e){return t=t||(vt?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),s=(t instanceof Z?t:this.latLngToContainerPoint(t)).subtract(o).multiplyBy(1-1/n),a=this.containerPointToLatLng(o.add(s));return this.setView(a,e,{zoom:i})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():R(t);var i=O(e.paddingTopLeft||e.padding||[0,0]),n=O(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 s=n.subtract(i).divideBy(2),a=this.project(t.getSouthWest(),o),r=this.project(t.getNorthEast(),o);return{center:this.unproject(a.add(r).divideBy(2).add(s),o),zoom:o}},fitBounds:function(t,e){if(!(t=R(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){return e=e||{},(t=O(t).round()).x||t.y?(!0===e.animate||this.getSize().contains(t)?(this._panAnim||(this._panAnim=new Ge,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),!1!==e.animate?(ce(this._mapPane,"leaflet-pan-anim"),i=this._getMapPanePos().subtract(t).round(),this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)):(this._rawPanBy(t),this.fire("move").fire("moveend"))):this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this):this.fire("moveend");var i},flyTo:function(t,e,i){if(!1===(i=i||{}).animate||!vt)return this.setView(t,e,i);this._stop();var n=this.project(this.getCenter()),o=this.project(t),s=this.getSize(),a=this._zoom;t=D(t),e=void 0===e?a:e;var r=Math.max(s.x,s.y),h=r*this.getZoomScale(a,e),l=o.distanceTo(n)||1,u=1.42,c=u*u;function _(t){var e=(h*h-r*r+(t?-1:1)*c*c*l*l)/(2*(t?h:r)*c*l),i=Math.sqrt(e*e+1)-e;return i<1e-9?-18:Math.log(i)}function d(t){return(Math.exp(t)-Math.exp(-t))/2}function p(t){return(Math.exp(t)+Math.exp(-t))/2}var m=_(0);function f(t){return r*(p(m)*(d(e=m+u*t)/p(e))-d(m))/c;var e}var g=Date.now(),v=(_(1)-m)/u,y=i.duration?1e3*i.duration:1e3*v*.8;return this._moveStart(!0,i.noMoveStart),function i(){var s,h,c=(Date.now()-g)/y,_=(s=c,(1-Math.pow(1-s,1.5))*v);c<=1?(this._flyToFrame=M(i,this),this._move(this.unproject(n.add(o.subtract(n).multiplyBy(f(_)/l)),a),this.getScaleZoom(r/(h=_,r*(p(m)/p(m+u*h))),a),{flyTo:!0})):this._move(t,e)._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=R(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){var e=this.options.minZoom;return this.options.minZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this},setMaxZoom:function(t){var e=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),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,R(t));return i.equals(n)||this.panTo(n,e),this._enforcingBounds=!1,this},panInside:function(t,e){var i,n,o=O((e=e||{}).paddingTopLeft||e.padding||[0,0]),s=O(e.paddingBottomRight||e.padding||[0,0]),a=this.getCenter(),r=this.project(a),h=this.project(t),l=this.getPixelBounds(),u=l.getSize().divideBy(2),c=B([l.min.add(o),l.max.subtract(s)]);return c.contains(h)||(this._enforcingBounds=!0,i=r.subtract(h),n=O(h.x+i.x,h.y+i.y),(h.x<c.min.x||h.x>c.max.x)&&(n.x=r.x-i.x,0<i.x?n.x+=u.x-o.x:n.x-=u.x-s.x),(h.y<c.min.y||h.y>c.max.y)&&(n.y=r.y-i.y,0<i.y?n.y+=u.y-o.y:n.y-=u.y-s.y),this.panTo(this.unproject(n),e),this._enforcingBounds=!1),this},invalidateSize:function(t){if(!this._loaded)return this;t=e({animate:!1,pan:!0},!0===t?{animate:!0}:t);var i=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var n=this.getSize(),s=i.divideBy(2).round(),a=n.divideBy(2).round(),r=s.subtract(a);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(o(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:i,newSize:n})):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=e({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var i=o(this._handleGeolocationResponse,this),n=o(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(i,n,t):navigator.geolocation.getCurrentPosition(i,n,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,i=new N(t.coords.latitude,t.coords.longitude),n=i.toBounds(2*t.coords.accuracy),o=this._locateOptions;o.setView&&(e=this.getBoundsZoom(n),this.setView(i,o.maxZoom?Math.min(e,o.maxZoom):e));var s={latlng:i,bounds:n,timestamp:t.timestamp};for(var a in t.coords)"number"==typeof t.coords[a]&&(s[a]=t.coords[a]);this.fire("locationfound",s)},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.off("moveend",this._panInsideMaxBounds),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 void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),ae(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(k(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)ae(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var i=se("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 j(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=R(t),i=O(i||[0,0]);var n=this.getZoom()||0,o=this.getMinZoom(),s=this.getMaxZoom(),a=t.getNorthWest(),r=t.getSouthEast(),h=this.getSize().subtract(i),l=B(this.project(r,n),this.project(a,n)).getSize(),u=vt?this.options.zoomSnap:1,c=h.x/l.x,_=h.y/l.y,d=e?Math.max(c,_):Math.min(c,_);n=this.getScaleZoom(d,n);return u&&(n=Math.round(n/(u/100))*(u/100),n=e?Math.ceil(n/u)*u:Math.floor(n/u)*u),Math.max(o,Math.min(s,n))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new Z(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 I(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(D(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(O(t),e)},layerPointToLatLng:function(t){var e=O(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project(D(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(D(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(R(t))},distance:function(t,e){return this.options.crs.distance(D(t),D(e))},containerPointToLayerPoint:function(t){return O(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return O(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(O(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(D(t)))},mouseEventToContainerPoint:function(t){return Ne(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=ne(t);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");ke(e,"scroll",this._onScroll,this),this._containerId=a(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&vt,ce(t,"leaflet-container"+(Pt?" leaflet-touch":"")+(kt?" leaflet-retina":"")+(et?" leaflet-oldie":"")+(ct?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=oe(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),ve(this._mapPane,new Z(0,0)),this.createPane("tilePane"),this.createPane("shadowPane"),this.createPane("overlayPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(ce(t.markerPane,"leaflet-zoom-hide"),ce(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e){ve(this._mapPane,new Z(0,0));var i=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var n=this._zoom!==e;this._moveStart(n,!1)._move(t,e)._moveEnd(n),this.fire("viewreset"),i&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_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 k(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){ve(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?Se:ke;e((this._targets[a(this._container)]=this)._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),vt&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){k(this._resizeRequest),this._resizeRequest=M((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,s=t.target||t.srcElement,r=!1;s;){if((i=this._targets[a(s)])&&("click"===e||"preclick"===e)&&!t._simulated&&this._draggableMoved(i)){r=!0;break}if(i&&i.listens(e,!0)){if(o&&!$e(s,t))break;if(n.push(i),o)break}if(s===this._container)break;s=s.parentNode}return n.length||r||o||!$e(s,t)||(n=[this]),n},_handleDOMEvent:function(t){var e;this._loaded&&!Ue(t)&&("mousedown"!==(e=t.type)&&"keypress"!==e&&"keyup"!==e&&"keydown"!==e||Le(t.target||t.srcElement),this._fireDOMEvent(t,e))},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,i,n){var o;if("click"===t.type&&((o=e({},t)).type="preclick",this._fireDOMEvent(o,o.type,n)),!t._stopped&&(n=(n||[]).concat(this._findEventTargets(t,i))).length){var s=n[0];"contextmenu"===i&&s.listens(i,!0)&&je(t);var a,r={originalEvent:t};"keypress"!==t.type&&"keydown"!==t.type&&"keyup"!==t.type&&(a=s.getLatLng&&(!s._radius||s._radius<=10),r.containerPoint=a?this.latLngToContainerPoint(s.getLatLng()):this.mouseEventToContainerPoint(t),r.layerPoint=this.containerPointToLayerPoint(r.containerPoint),r.latlng=a?s.getLatLng():this.layerPointToLatLng(r.layerPoint));for(var h=0;h<n.length;h++)if(n[h].fire(i,r,!0),r.originalEvent._stopped||!1===n[h].options.bubblingMouseEvents&&-1!==v(this._mouseEvents,i))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 ye(this._mapPane)||new Z(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 B([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),s=new I(n.subtract(o),n.add(o)),a=this._getBoundsOffset(s,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 I(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(n,e))},_getBoundsOffset:function(t,e,i){var n=B(this.project(e.getNorthEast(),i),this.project(e.getSouthWest(),i)),o=n.min.subtract(t.min),s=n.max.subtract(t.max);return new Z(this._rebound(o.x,-s.x),this._rebound(o.y,-s.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=vt?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(){_e(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._trunc();return!(!0!==(e&&e.animate)&&!this.getSize().contains(i)||(this.panBy(i,e),0))},_createAnimProxy:function(){var t=this._proxy=se("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",(function(t){var e=te,i=this._proxy.style[e];ge(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",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ae(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();ge(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_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)||(M((function(){this._moveStart(!0,!1)._animateZoom(t,e,!0)}),this),0))},_animateZoom:function(t,e,i,n){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,ce(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:n}),setTimeout(o(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&_e(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),M((function(){this._moveEnd(!0)}),this))}});function Ke(t){return new Ye(t)}var Ye=S.extend({options:{position:"topright"},initialize:function(t){d(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 ce(e,"leaflet-control"),-1!==i.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map&&(ae(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null),this},_refocusOnMap:function(t){this._map&&t&&0<t.screenX&&0<t.screenY&&this._map.getContainer().focus()}});Ve.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},e="leaflet-",i=this._controlContainer=se("div",e+"control-container",this._container);function n(n,o){var s=e+n+" "+e+o;t[n+o]=se("div",s,i)}n("top","left"),n("top","right"),n("bottom","left"),n("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)ae(this._controlCorners[t]);ae(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Xe=Ye.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 d(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 Ye.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(a(t));return e&&this._layers.splice(this._layers.indexOf(e),1),this._map?this._update():this},expand:function(){ce(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._section.clientHeight?(ce(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=t+"px"):_e(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return _e(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=se("div",t),i=this.options.collapsed;e.setAttribute("aria-haspopup",!0),Be(e),Ie(e);var n=this._section=se("section",t+"-list");i&&(this._map.on("click",this.collapse,this),ot||ke(e,{mouseenter:this.expand,mouseleave:this.collapse},this));var o=this._layersLink=se("a",t+"-toggle",e);o.href="#",o.title="Layers",Pt?(ke(o,"click",Re),ke(o,"click",this.expand,this)):ke(o,"focus",this.expand,this),i||this.expand(),this._baseLayersList=se("div",t+"-base",n),this._separator=se("div",t+"-separator",n),this._overlaysList=se("div",t+"-overlays",n),e.appendChild(n)},_getLayer:function(t){for(var e=0;e<this._layers.length;e++)if(this._layers[e]&&a(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(o((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;re(this._baseLayersList),re(this._overlaysList),this._layerControlInputs=[];for(var t,e,i,n=0,o=0;o<this._layers.length;o++)i=this._layers[o],this._addItem(i),e=e||i.overlay,t=t||!i.overlay,n+=i.overlay?0:1;return this.options.hideSingleBase&&(t=t&&1<n,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(a(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_"+a(this),n),this._layerControlInputs.push(e),e.layerId=a(t.layer),ke(e,"click",this._onInputClick,this);var o=document.createElement("span");o.innerHTML=" "+t.name;var s=document.createElement("div");return i.appendChild(s),s.appendChild(e),s.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 s=i.length-1;0<=s;s--)t=i[s],e=this._getLayer(t.layerId).layer,t.checked?n.push(e):t.checked||o.push(e);for(s=0;s<o.length;s++)this._map.hasLayer(o[s])&&this._map.removeLayer(o[s]);for(s=0;s<n.length;s++)this._map.hasLayer(n[s])||this._map.addLayer(n[s]);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()}}),Je=Ye.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"−",zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=se("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 s=se("a",i,n);return s.innerHTML=t,s.href="#",s.title=e,s.setAttribute("role","button"),s.setAttribute("aria-label",e),Be(s),ke(s,"click",Re),ke(s,"click",o,this),ke(s,"click",this._refocusOnMap,this),s},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";_e(this._zoomInButton,e),_e(this._zoomOutButton,e),!this._disabled&&t._zoom!==t.getMinZoom()||ce(this._zoomOutButton,e),!this._disabled&&t._zoom!==t.getMaxZoom()||ce(this._zoomInButton,e)}});Ve.mergeOptions({zoomControl:!0}),Ve.addInitHook((function(){this.options.zoomControl&&(this.zoomControl=new Je,this.addControl(this.zoomControl))}));var Qe=Ye.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=se("div",e),n=this.options;return this._addScales(n,e+"-line",i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=se("div",e,i)),t.imperial&&(this._iScale=se("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*(10<=i?10:5<=i?5:3<=i?3:2<=i?2:1)}}),ti=Ye.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JS library for interactive maps">Leaflet</a>'},initialize:function(t){d(this,t),this._attributions={}},onAdd:function(t){for(var e in(t.attributionControl=this)._container=se("div","leaflet-control-attribution"),Be(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(" | ")}}});Ve.mergeOptions({attributionControl:!0}),Ve.addInitHook((function(){this.options.attributionControl&&(new ti).addTo(this)})),Ye.Layers=Xe,Ye.Zoom=Je,Ye.Scale=Qe,Ye.Attribution=ti,Ke.layers=function(t,e,i){return new Xe(t,e,i)},Ke.zoom=function(t){return new Je(t)},Ke.scale=function(t){return new Qe(t)},Ke.attribution=function(t){return new ti(t)};var ei=S.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}});ei.addTo=function(t,e){return t.addHandler(e,this),this};var ii,ni={Events:C},oi=Pt?"touchstart mousedown":"mousedown",si={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},ai={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},ri=E.extend({options:{clickTolerance:3},initialize:function(t,e,i,n){d(this,n),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(ke(this._dragStartTarget,oi,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(ri._dragging===this&&this.finishDrag(),Se(this._dragStartTarget,oi,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){var e,i;!t._simulated&&this._enabled&&(this._moved=!1,ue(this._element,"leaflet-zoom-anim")||ri._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||((ri._dragging=this)._preventOutline&&Le(this._element),xe(),Gt(),this._moving||(this.fire("down"),e=t.touches?t.touches[0]:t,i=Pe(this._element),this._startPoint=new Z(e.clientX,e.clientY),this._parentScale=Te(i),ke(document,ai[t.type],this._onMove,this),ke(document,si[t.type],this._onUp,this))))},_onMove:function(t){var e,i;!t._simulated&&this._enabled&&(t.touches&&1<t.touches.length?this._moved=!0:((i=new Z((e=t.touches&&1===t.touches.length?t.touches[0]:t).clientX,e.clientY)._subtract(this._startPoint)).x||i.y)&&(Math.abs(i.x)+Math.abs(i.y)<this.options.clickTolerance||(i.x/=this._parentScale.x,i.y/=this._parentScale.y,je(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=ye(this._element).subtract(i),ce(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),ce(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(i),this._moving=!0,k(this._animRequest),this._lastEvent=t,this._animRequest=M(this._updatePosition,this,!0))))},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),ve(this._element,this._newPos),this.fire("drag",t)},_onUp:function(t){!t._simulated&&this._enabled&&this.finishDrag()},finishDrag:function(){for(var t in _e(document.body,"leaflet-dragging"),this._lastTarget&&(_e(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),ai)Se(document,ai[t],this._onMove,this),Se(document,si[t],this._onUp,this);be(),Vt(),this._moved&&this._moving&&(k(this._animRequest),this.fire("dragend",{distance:this._newPos.distanceTo(this._startPos)})),this._moving=!1,ri._dragging=!1}});function hi(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,s){var a,r,h,l=0;for(r=o+1;r<=s-1;r++)l<(h=di(e[r],e[o],e[s],!0))&&(a=r,l=h);n<l&&(i[a]=1,t(e,i,n,o,a),t(e,i,n,a,s))}(t,n,e,0,i-1);var o,s=[];for(o=0;o<i;o++)n[o]&&s.push(t[o]);return s}(t=function(t,e){for(var i=[t[0]],n=1,o=0,s=t.length;n<s;n++)(function(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n})(t[n],t[o])>e&&(i.push(t[n]),o=n);return o<s-1&&i.push(t[s-1]),i}(t,i),i)}function li(t,e,i){return Math.sqrt(di(t,e,i,!0))}function ui(t,e,i,n,o){var s,a,r,h=n?ii:_i(t,i),l=_i(e,i);for(ii=l;;){if(!(h|l))return[t,e];if(h&l)return!1;r=_i(a=ci(t,e,s=h||l,i,o),i),s===h?(t=a,h=r):(e=a,l=r)}}function ci(t,e,i,n,o){var s,a,r=e.x-t.x,h=e.y-t.y,l=n.min,u=n.max;return 8&i?(s=t.x+r*(u.y-t.y)/h,a=u.y):4&i?(s=t.x+r*(l.y-t.y)/h,a=l.y):2&i?(s=u.x,a=t.y+h*(u.x-t.x)/r):1&i&&(s=l.x,a=t.y+h*(l.x-t.x)/r),new Z(s,a,o)}function _i(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 di(t,e,i,n){var o,s=e.x,a=e.y,r=i.x-s,h=i.y-a,l=r*r+h*h;return 0<l&&(1<(o=((t.x-s)*r+(t.y-a)*h)/l)?(s=i.x,a=i.y):0<o&&(s+=r*o,a+=h*o)),r=t.x-s,h=t.y-a,n?r*r+h*h:new Z(s,a)}function pi(t){return!g(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function mi(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),pi(t)}var fi={simplify:hi,pointToSegmentDistance:li,closestPointOnSegment:function(t,e,i){return di(t,e,i)},clipSegment:ui,_getEdgeIntersection:ci,_getBitCode:_i,_sqClosestPointOnSegment:di,isFlat:pi,_flat:mi};function gi(t,e,i){for(var n,o,s,a,r,h,l,u=[1,4,2,8],c=0,_=t.length;c<_;c++)t[c]._code=_i(t[c],e);for(s=0;s<4;s++){for(h=u[s],n=[],c=0,o=(_=t.length)-1;c<_;o=c++)a=t[c],r=t[o],a._code&h?r._code&h||((l=ci(r,a,h,e,i))._code=_i(l,e),n.push(l)):(r._code&h&&((l=ci(r,a,h,e,i))._code=_i(l,e),n.push(l)),n.push(a));t=n}return t}var vi,yi={clipPolygon:gi},xi={project:function(t){return new Z(t.lng,t.lat)},unproject:function(t){return new N(t.y,t.x)},bounds:new I([-180,-90],[180,90])},bi={R:6378137,R_MINOR:6356752.314245179,bounds:new I([-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,s=Math.sqrt(1-o*o),a=s*Math.sin(n),r=Math.tan(Math.PI/4-n/2)/Math.pow((1-a)/(1+a),s/2);n=-i*Math.log(Math.max(r,1e-10));return new Z(t.lng*e*i,n)},unproject:function(t){for(var e,i=180/Math.PI,n=this.R,o=this.R_MINOR/n,s=Math.sqrt(1-o*o),a=Math.exp(-t.y/n),r=Math.PI/2-2*Math.atan(a),h=0,l=.1;h<15&&1e-7<Math.abs(l);h++)e=s*Math.sin(r),e=Math.pow((1-e)/(1+e),s/2),r+=l=Math.PI/2-2*Math.atan(a*e)-r;return new N(r*i,t.x*i/n)}},Li={LonLat:xi,Mercator:bi,SphericalMercator:$},wi=e({},W,{code:"EPSG:3395",projection:bi,transformation:G(vi=.5/(Math.PI*bi.R),.5,-vi,.5)}),Pi=e({},W,{code:"EPSG:4326",projection:xi,transformation:G(1/180,1,-1/180,.5)}),Ti=e({},H,{projection:xi,transformation:G(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});H.Earth=W,H.EPSG3395=wi,H.EPSG3857=K,H.EPSG900913=Y,H.EPSG4326=Pi,H.Simple=Ti;var Mi=E.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[a(t)]=this},removeInteractiveTarget:function(t){return delete this._map._targets[a(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e,i=t.target;i.hasLayer(this)&&(this._map=i,this._zoomAnimated=i._zoomAnimated,this.getEvents&&(e=this.getEvents(),i.on(e,this),this.once("remove",(function(){i.off(e,this)}),this)),this.onAdd(i),this.getAttribution&&i.attributionControl&&i.attributionControl.addAttribution(this.getAttribution()),this.fire("add"),i.fire("layeradd",{layer:this}))}});Ve.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=a(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=a(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&&a(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?g(t)?t:[t]:[]).length;e<i;e++)this.addLayer(t[e])},_addZoomLimit:function(t){!isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[a(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){var e=a(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 ki=Mi.extend({initialize:function(t,e){var i,n;if(d(this,e),this._layers={},t)for(i=0,n=t.length;i<n;i++)this.addLayer(t[i])},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&&("number"==typeof t?t:this.getLayerId(t))in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,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){this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t)},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=[];return this.eachLayer(t.push,t),t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:a}),zi=ki.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),ki.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),ki.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 j;for(var e in this._layers){var i=this._layers[e];t.extend(i.getBounds?i.getBounds():i.getLatLng())}return t}}),Si=S.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0]},initialize:function(t){d(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=O(n),s=O("shadow"===e&&i.shadowAnchor||i.iconAnchor||o&&o.divideBy(2,!0));t.className="leaflet-marker-"+e+" "+(i.className||""),s&&(t.style.marginLeft=-s.x+"px",t.style.marginTop=-s.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 kt&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}}),Ci=Si.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 Ci.imagePath||(Ci.imagePath=this._detectIconPath()),(this.options.imagePath||Ci.imagePath)+Si.prototype._getIconUrl.call(this,t)},_detectIconPath:function(){var t=se("div","leaflet-default-icon-path",document.body),e=oe(t,"background-image")||oe(t,"backgroundImage");return document.body.removeChild(t),null===e||0!==e.indexOf("url")?"":e.replace(/^url\(["']?/,"").replace(/marker-icon\.png["']?\)$/,"")}}),Ei=ei.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new ri(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),ce(t,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&_e(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var e,i=this._marker,n=i._map,o=this._marker.options.autoPanSpeed,s=this._marker.options.autoPanPadding,a=ye(i._icon),r=n.getPixelBounds(),h=n.getPixelOrigin(),l=B(r.min._subtract(h).add(s),r.max._subtract(h).subtract(s));l.contains(a)||(e=O((Math.max(l.max.x,a.x)-l.max.x)/(r.max.x-l.max.x)-(Math.min(l.min.x,a.x)-l.min.x)/(r.min.x-l.min.x),(Math.max(l.max.y,a.y)-l.max.y)/(r.max.y-l.max.y)-(Math.min(l.min.y,a.y)-l.min.y)/(r.min.y-l.min.y)).multiplyBy(o),n.panBy(e,{animate:!1}),this._draggable._newPos._add(e),this._draggable._startPos._add(e),ve(i._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=M(this._adjustPan.bind(this,t)))},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(t){this._marker.options.autoPan&&(k(this._panRequest),this._panRequest=M(this._adjustPan.bind(this,t)))},_onDrag:function(t){var e=this._marker,i=e._shadow,n=ye(e._icon),o=e._map.layerPointToLatLng(n);i&&ve(i,n),e._latlng=o,t.latlng=o,t.oldLatLng=this._oldLatLng,e.fire("move",t).fire("drag",t)},_onDragEnd:function(t){k(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),Zi=Mi.extend({options:{icon:new Ci,interactive:!0,keyboard:!0,title:"",alt:"",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(t,e){d(this,e),this._latlng=D(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=D(t),this.update(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},getIcon:function(){return this.options.icon},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(){var t;return this._icon&&this._map&&(t=this._map.latLngToLayerPoint(this._latlng).round(),this._setPos(t)),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),"IMG"===i.tagName&&(i.alt=t.alt||"")),ce(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),s=!1;o!==this._shadow&&(this._removeShadow(),s=!0),o&&(ce(o,e),o.alt=""),this._shadow=o,t.opacity<1&&this._updateOpacity(),n&&this.getPane().appendChild(this._icon),this._initInteraction(),o&&s&&this.getPane(t.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),ae(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&ae(this._shadow),this._shadow=null},_setPos:function(t){this._icon&&ve(this._icon,t),this._shadow&&ve(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon&&(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(){var t;this.options.interactive&&(ce(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Ei&&(t=this.options.draggable,this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Ei(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;this._icon&&me(this._icon,t),this._shadow&&me(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}}),Ai=Mi.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 d(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t&&Object.prototype.hasOwnProperty.call(t,"weight")&&this._updateBounds()),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)+this._renderer.options.tolerance}}),Oi=Ai.extend({options:{fill:!0,radius:10},initialize:function(t,e){d(this,e),this._latlng=D(t),this._radius=this.options.radius},setLatLng:function(t){var e=this._latlng;return this._latlng=D(t),this.redraw(),this.fire("move",{oldLatLng:e,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 Ai.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 I(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()}}),Ii=Oi.extend({initialize:function(t,i,n){if("number"==typeof i&&(i=e({},n,{radius:i})),d(this,i),this._latlng=D(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 j(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:Ai.prototype.setStyle,_project:function(){var t,e,i,n,o,s,a,r,h=this._latlng.lng,l=this._latlng.lat,u=this._map,c=u.options.crs;c.distance===W.distance?(t=Math.PI/180,e=this._mRadius/W.R/t,i=u.project([l+e,h]),n=u.project([l-e,h]),o=i.add(n).divideBy(2),s=u.unproject(o).lat,a=Math.acos((Math.cos(e*t)-Math.sin(l*t)*Math.sin(s*t))/(Math.cos(l*t)*Math.cos(s*t)))/t,!isNaN(a)&&0!==a||(a=e/Math.cos(Math.PI/180*l)),this._point=o.subtract(u.getPixelOrigin()),this._radius=isNaN(a)?0:o.x-u.project([s,h-a]).x,this._radiusY=o.y-i.y):(r=c.unproject(c.project(this._latlng).subtract([this._mRadius,0])),this._point=u.latLngToLayerPoint(this._latlng),this._radius=this._point.x-u.latLngToLayerPoint(r).x),this._updateBounds()}}),Bi=Ai.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,e){d(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,s=di,a=0,r=this._parts.length;a<r;a++)for(var h=this._parts[a],l=1,u=h.length;l<u;l++){var c=s(t,e=h[l-1],i=h[l],!0);c<n&&(n=c,o=s(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,s,a,r=this._rings[0],h=r.length;if(!h)return null;for(e=t=0;t<h-1;t++)e+=r[t].distanceTo(r[t+1])/2;if(0===e)return this._map.layerPointToLatLng(r[0]);for(n=t=0;t<h-1;t++)if(o=r[t],s=r[t+1],e<(n+=i=o.distanceTo(s)))return a=(n-e)/i,this._map.layerPointToLatLng([s.x-a*(s.x-o.x),s.y-a*(s.y-o.y)])},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=D(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new j,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return pi(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],i=pi(t),n=0,o=t.length;n<o;n++)i?(e[n]=D(t[n]),this._bounds.extend(e[n])):e[n]=this._convertLatLngs(t[n]);return e},_project:function(){var t=new I;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t),this._bounds.isValid()&&t.isValid()&&(this._rawPxBounds=t,this._updateBounds())},_updateBounds:function(){var t=this._clickTolerance(),e=new Z(t,t);this._pxBounds=new I([this._rawPxBounds.min.subtract(e),this._rawPxBounds.max.add(e)])},_projectLatlngs:function(t,e,i){var n,o,s=t[0]instanceof N,a=t.length;if(s){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 for(var e,i,n,o,s=this._parts,a=0,r=0,h=this._rings.length;a<h;a++)for(e=0,i=(o=this._rings[a]).length;e<i-1;e++)(n=ui(o[e],o[e+1],t,e,!0))&&(s[r]=s[r]||[],s[r].push(n[0]),n[1]===o[e+1]&&e!==i-2||(s[r].push(n[1]),r++))},_simplifyPoints:function(){for(var t=this._parts,e=this.options.smoothFactor,i=0,n=t.length;i<n;i++)t[i]=hi(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,s,a,r,h=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(i=0,s=this._parts.length;i<s;i++)for(n=0,o=(a=(r=this._parts[i]).length)-1;n<a;o=n++)if((e||0!==n)&&li(t,r[o],r[n])<=h)return!0;return!1}});Bi._flat=mi;var ji=Bi.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,s,a,r,h,l=this._rings[0],u=l.length;if(!u)return null;for(t=s=a=r=0,e=u-1;t<u;e=t++)i=l[t],n=l[e],o=i.y*n.x-n.y*i.x,a+=(i.x+n.x)*o,r+=(i.y+n.y)*o,s+=3*o;return h=0===s?l[0]:[a/s,r/s],this._map.layerPointToLatLng(h)},_convertLatLngs:function(t){var e=Bi.prototype._convertLatLngs.call(this,t),i=e.length;return 2<=i&&e[0]instanceof N&&e[0].equals(e[i-1])&&e.pop(),e},_setLatLngs:function(t){Bi.prototype._setLatLngs.call(this,t),pi(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return pi(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,i=new Z(e,e);t=new I(t.min.subtract(i),t.max.add(i));if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var n,o=0,s=this._rings.length;o<s;o++)(n=gi(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,s,a,r,h,l=!1;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(o=0,r=this._parts.length;o<r;o++)for(s=0,a=(h=(e=this._parts[o]).length)-1;s<h;a=s++)i=e[s],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&&(l=!l);return l||Bi.prototype._containsPoint.call(this,t,!0)}}),Ri=zi.extend({initialize:function(t,e){d(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,n,o=g(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 s=this.options;if(s.filter&&!s.filter(t))return this;var a=Ni(t,s);return a?(a.feature=qi(t),a.defaultOptions=a.options,this.resetStyle(a),s.onEachFeature&&s.onEachFeature(t,a),this.addLayer(a)):this},resetStyle:function(t){return void 0===t?this.eachLayer(this.resetStyle,this):(t.options=e({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this)},setStyle:function(t){return this.eachLayer((function(e){this._setLayerStyle(e,t)}),this)},_setLayerStyle:function(t,e){t.setStyle&&("function"==typeof e&&(e=e(t.feature)),t.setStyle(e))}});function Ni(t,e){var i,n,o,s,a="Feature"===t.type?t.geometry:t,r=a?a.coordinates:null,h=[],l=e&&e.pointToLayer,u=e&&e.coordsToLatLng||Fi;if(!r&&!a)return null;switch(a.type){case"Point":return Di(l,t,i=u(r),e);case"MultiPoint":for(o=0,s=r.length;o<s;o++)i=u(r[o]),h.push(Di(l,t,i,e));return new zi(h);case"LineString":case"MultiLineString":return n=Hi(r,"LineString"===a.type?0:1,u),new Bi(n,e);case"Polygon":case"MultiPolygon":return n=Hi(r,"Polygon"===a.type?1:2,u),new ji(n,e);case"GeometryCollection":for(o=0,s=a.geometries.length;o<s;o++){var c=Ni({geometry:a.geometries[o],type:"Feature",properties:t.properties},e);c&&h.push(c)}return new zi(h);default:throw new Error("Invalid GeoJSON object.")}}function Di(t,e,i,n){return t?t(e,i):new Zi(i,n&&n.markersInheritOptions&&n)}function Fi(t){return new N(t[1],t[0],t[2])}function Hi(t,e,i){for(var n,o=[],s=0,a=t.length;s<a;s++)n=e?Hi(t[s],e-1,i):(i||Fi)(t[s]),o.push(n);return o}function Wi(t,e){return e="number"==typeof e?e:6,void 0!==t.alt?[u(t.lng,e),u(t.lat,e),u(t.alt,e)]:[u(t.lng,e),u(t.lat,e)]}function Ui(t,e,i,n){for(var o=[],s=0,a=t.length;s<a;s++)o.push(e?Ui(t[s],e-1,i,n):Wi(t[s],n));return!e&&i&&o.push(o[0]),o}function $i(t,i){return t.feature?e({},t.feature,{geometry:i}):qi(i)}function qi(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}var Gi={toGeoJSON:function(t){return $i(this,{type:"Point",coordinates:Wi(this.getLatLng(),t)})}};function Vi(t,e){return new Ri(t,e)}Zi.include(Gi),Ii.include(Gi),Oi.include(Gi),Bi.include({toGeoJSON:function(t){var e=!pi(this._latlngs);return $i(this,{type:(e?"Multi":"")+"LineString",coordinates:Ui(this._latlngs,e?1:0,!1,t)})}}),ji.include({toGeoJSON:function(t){var e=!pi(this._latlngs),i=e&&!pi(this._latlngs[0]),n=Ui(this._latlngs,i?2:e?1:0,!0,t);return e||(n=[n]),$i(this,{type:(i?"Multi":"")+"Polygon",coordinates:n})}}),ki.include({toMultiPoint:function(t){var e=[];return this.eachLayer((function(i){e.push(i.toGeoJSON(t).geometry.coordinates)})),$i(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(t){var e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===e)return this.toMultiPoint(t);var i="GeometryCollection"===e,n=[];return this.eachLayer((function(e){var o,s;e.toGeoJSON&&(o=e.toGeoJSON(t),i?n.push(o.geometry):"FeatureCollection"===(s=qi(o)).type?n.push.apply(n,s.features):n.push(s))})),i?$i(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}});var Ki=Vi,Yi=Mi.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,i){this._url=t,this._bounds=R(e),d(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(ce(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ae(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&&he(this._image),this},bringToBack:function(){return this._map&&le(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=R(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="IMG"===this._url.tagName,e=this._image=t?this._url:se("img");ce(e,"leaflet-image-layer"),this._zoomAnimated&&ce(e,"leaflet-zoom-animated"),this.options.className&&ce(e,this.options.className),e.onselectstart=l,e.onmousemove=l,e.onload=o(this.fire,this,"load"),e.onerror=o(this._overlayOnError,this,"error"),!this.options.crossOrigin&&""!==this.options.crossOrigin||(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=e.src:(e.src=this._url,e.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;ge(this._image,i,e)},_reset:function(){var t=this._image,e=new I(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();ve(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){me(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)}}),Xi=Yi.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1},_initImage:function(){var t="VIDEO"===this._url.tagName,e=this._image=t?this._url:se("video");if(ce(e,"leaflet-image-layer"),this._zoomAnimated&&ce(e,"leaflet-zoom-animated"),this.options.className&&ce(e,this.options.className),e.onselectstart=l,e.onmousemove=l,e.onloadeddata=o(this.fire,this,"load"),t){for(var i=e.getElementsByTagName("source"),n=[],s=0;s<i.length;s++)n.push(i[s].src);this._url=0<i.length?n:[e.src]}else{g(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted;for(var a=0;a<this._url.length;a++){var r=se("source");r.src=this._url[a],e.appendChild(r)}}}}),Ji=Yi.extend({_initImage:function(){var t=this._image=this._url;ce(t,"leaflet-image-layer"),this._zoomAnimated&&ce(t,"leaflet-zoom-animated"),this.options.className&&ce(t,this.options.className),t.onselectstart=l,t.onmousemove=l}}),Qi=Mi.extend({options:{offset:[0,7],className:"",pane:"popupPane"},initialize:function(t,e){d(this,t),this._source=e},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&me(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&me(this._container,1),this.bringToFront()},onRemove:function(t){t._fadeAnimated?(me(this._container,0),this._removeTimeout=setTimeout(o(ae,void 0,this._container),200)):ae(this._container)},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=D(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&&he(this._container),this},bringToBack:function(){return this._map&&le(this._container),this},_prepareOpen:function(t,e,i){if(e instanceof Mi||(i=e,e=t),e instanceof zi)for(var n in t._layers){e=t._layers[n];break}if(!i)if(e.getCenter)i=e.getCenter();else{if(!e.getLatLng)throw new Error("Unable to get source layer LatLng.");i=e.getLatLng()}return this._source=e,this.update(),i},_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(){var t,e,i,n,o;this._map&&(t=this._map.latLngToLayerPoint(this._latlng),e=O(this.options.offset),i=this._getAnchor(),this._zoomAnimated?ve(this._container,t.add(i)):e=e.add(t).add(i),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]}}),tn=Qi.extend({options:{maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(t){return t.openPopup(this),this},onAdd:function(t){Qi.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof Ai||this._source.on("preclick",Oe))},onRemove:function(t){Qi.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof Ai||this._source.off("preclick",Oe))},getEvents:function(){var t=Qi.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,e="leaflet-popup",i=this._container=se("div",e+" "+(this.options.className||"")+" leaflet-zoom-animated"),n=this._wrapper=se("div",e+"-content-wrapper",i);this._contentNode=se("div",e+"-content",n),Be(i),Ie(this._contentNode),ke(i,"contextmenu",Oe),this._tipContainer=se("div",e+"-tip-container",i),this._tip=se("div",e+"-tip",this._tipContainer),this.options.closeButton&&((t=this._closeButton=se("a",e+"-close-button",i)).href="#close",t.innerHTML="×",ke(t,"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,s="leaflet-popup-scrolled";o&&o<n?(e.height=o+"px",ce(t,s)):_e(t,s),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();ve(this._container,e.add(i))},_adjustPan:function(){var t,e,i,n,o,s,a,r,h,l,u,c;this.options.autoPan&&(this._map._panAnim&&this._map._panAnim.stop(),t=this._map,e=parseInt(oe(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+e,n=this._containerWidth,(o=new Z(this._containerLeft,-i-this._containerBottom))._add(ye(this._container)),s=t.layerPointToContainerPoint(o),a=O(this.options.autoPanPadding),r=O(this.options.autoPanPaddingTopLeft||a),h=O(this.options.autoPanPaddingBottomRight||a),l=t.getSize(),c=u=0,s.x+n+h.x>l.x&&(u=s.x+n-l.x+h.x),s.x-u-r.x<0&&(u=s.x-r.x),s.y+i+h.y>l.y&&(c=s.y+i-l.y+h.y),s.y-c-r.y<0&&(c=s.y-r.y),(u||c)&&t.fire("autopanstart").panBy([u,c]))},_onCloseButtonClick:function(t){this._close(),Re(t)},_getAnchor:function(){return O(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}});Ve.mergeOptions({closePopupOnClick:!0}),Ve.include({openPopup:function(t,e,i){return t instanceof tn||(t=new tn(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}}),Mi.include({bindPopup:function(t,e){return t instanceof tn?(d(t,e),(this._popup=t)._source=this):(this._popup&&!e||(this._popup=new tn(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){return this._popup&&this._map&&(e=this._popup._prepareOpen(this,t,e),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&&(Re(t),e instanceof Ai?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 en=Qi.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(t){Qi.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){Qi.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var t=Qi.prototype.getEvents.call(this);return Pt&&!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=se("div",t)},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,i=this._map,n=this._container,o=i.latLngToContainerPoint(i.getCenter()),s=i.layerPointToContainerPoint(t),a=this.options.direction,r=n.offsetWidth,h=n.offsetHeight,l=O(this.options.offset),u=this._getAnchor(),c="top"===a?(e=r/2,h):"bottom"===a?(e=r/2,0):(e="center"===a?r/2:"right"===a?0:"left"===a?r:s.x<o.x?(a="right",0):(a="left",r+2*(l.x+u.x)),h/2);t=t.subtract(O(e,c,!0)).add(l).add(u),_e(n,"leaflet-tooltip-right"),_e(n,"leaflet-tooltip-left"),_e(n,"leaflet-tooltip-top"),_e(n,"leaflet-tooltip-bottom"),ce(n,"leaflet-tooltip-"+a),ve(n,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&me(this._container,t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(e)},_getAnchor:function(){return O(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}});Ve.include({openTooltip:function(t,e,i){return t instanceof en||(t=new en(i).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:this.addLayer(t)},closeTooltip:function(t){return t&&this.removeLayer(t),this}}),Mi.include({bindTooltip:function(t,e){return t instanceof en?(d(t,e),(this._tooltip=t)._source=this):(this._tooltip&&!e||(this._tooltip=new en(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){var e,i;!t&&this._tooltipHandlersAdded||(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),Pt&&(i.click=this._openTooltip)),this[e](i),this._tooltipHandlersAdded=!t)},openTooltip:function(t,e){return this._tooltip&&this._map&&(e=this._tooltip._prepareOpen(this,t,e),this._map.openTooltip(this._tooltip,e),this._tooltip.options.interactive&&this._tooltip._container&&(ce(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&&(_e(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 nn=Si.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var e,i=t&&"DIV"===t.tagName?t:document.createElement("div"),n=this.options;return n.html instanceof Element?(re(i),i.appendChild(n.html)):i.innerHTML=!1!==n.html?n.html:"",n.bgPos&&(e=O(n.bgPos),i.style.backgroundPosition=-e.x+"px "+-e.y+"px"),this._setIconStyles(i,"icon"),i},createShadow:function(){return null}});Si.Default=Ci;var on=Mi.extend({options:{tileSize:256,opacity:1,updateWhenIdle:yt,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){d(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(),ae(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(he(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(le(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=r(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 Z?t:new Z(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,s=i.length;o<s;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&&!et){me(this._container,this.options.opacity);var t=+new Date,e=!1,i=!1;for(var n in this._tiles){var o,s=this._tiles[n];s.current&&s.loaded&&(o=Math.min(1,(t-s.loaded)/200),me(s.el,o),o<1?e=!0:(s.active?i=!0:this._onOpaqueTile(s),s.active=!0))}i&&!this._noPrune&&this._pruneTiles(),e&&(k(this._fadeFrame),this._fadeFrame=M(this._updateOpacity,this))}},_onOpaqueTile:l,_initContainer:function(){this._container||(this._container=se("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)i=Number(i),this._levels[i].el.children.length||i===t?(this._levels[i].el.style.zIndex=e-Math.abs(t-i),this._onUpdateLevel(i)):(ae(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=se("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:l,_onRemoveLevel:l,_onCreateLevel:l,_pruneTiles:function(){if(this._map){var t,e,i,n=this._map.getZoom();if(n>this.options.maxZoom||n<this.options.minZoom)this._removeAllTiles();else{for(t in this._tiles)(i=this._tiles[t]).retain=i.current;for(t in this._tiles)(i=this._tiles[t]).current&&!i.active&&(e=i.coords,this._retainParent(e.x,e.y,e.z,e.z-5)||this._retainChildren(e.x,e.y,e.z,e.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)ae(this._levels[t].el),this._onRemoveLevel(Number(t)),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(t,e,i,n){var o=Math.floor(t/2),s=Math.floor(e/2),a=i-1,r=new Z(+o,+s);r.z=+a;var h=this._tileCoordsToKey(r),l=this._tiles[h];return l&&l.active?l.retain=!0:(l&&l.loaded&&(l.retain=!0),n<a&&this._retainParent(o,s,a,n))},_retainChildren:function(t,e,i,n){for(var o=2*t;o<2*t+2;o++)for(var s=2*e;s<2*e+2;s++){var a=new Z(o,s);a.z=i+1;var r=this._tileCoordsToKey(a),h=this._tiles[r];h&&h.active?h.retain=!0:(h&&h.loaded&&(h.retain=!0),i+1<n&&this._retainChildren(o,s,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=Math.round(e),s=(o=void 0!==this.options.maxZoom&&o>this.options.maxZoom||void 0!==this.options.minZoom&&o<this.options.minZoom?void 0:this._clampZoom(o),this.options.updateWhenZooming&&o!==this._tileZoom);n&&!s||(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();vt?ge(t.el,o,n):ve(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(),s=e.getSize().divideBy(2*n);return new I(o.subtract(s),o.add(s))},_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),s=o.getCenter(),a=[],r=this.options.keepBuffer,h=new I(o.getBottomLeft().subtract([r,-r]),o.getTopRight().add([r,-r]));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 l in this._tiles){var u=this._tiles[l].coords;u.z===this._tileZoom&&h.contains(new Z(u.x,u.y))||(this._tiles[l].current=!1)}if(1<Math.abs(i-this._tileZoom))this._setView(t,i);else{for(var c=o.min.y;c<=o.max.y;c++)for(var _=o.min.x;_<=o.max.x;_++){var d,p=new Z(_,c);p.z=this._tileZoom,this._isValidTile(p)&&((d=this._tiles[this._tileCoordsToKey(p)])?d.current=!0:a.push(p))}if(a.sort((function(t,e){return t.distanceTo(s)-e.distanceTo(s)})),0!==a.length){this._loading||(this._loading=!0,this.fire("loading"));var m=document.createDocumentFragment();for(_=0;_<a.length;_++)this._addTile(a[_],m);this._level.el.appendChild(m)}}}}},_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 R(this.options.bounds).overlaps(n)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),n=t.scaleBy(i),o=n.add(i);return[e.unproject(n,t.z),e.unproject(o,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),i=new j(e[0],e[1]);return this.options.noWrap||(i=this._map.wrapLatLngBounds(i)),i},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),i=new Z(+e[0],+e[1]);return i.z=+e[2],i},_removeTile:function(t){var e=this._tiles[t];e&&(ae(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){ce(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=l,t.onmousemove=l,et&&this.options.opacity<1&&me(t,this.options.opacity),ot&&!st&&(t.style.WebkitBackfaceVisibility="hidden")},_addTile:function(t,e){var i=this._getTilePos(t),n=this._tileCoordsToKey(t),s=this.createTile(this._wrapCoords(t),o(this._tileReady,this,t));this._initTile(s),this.createTile.length<2&&M(o(this._tileReady,this,t,null,s)),ve(s,i),this._tiles[n]={el:s,coords:t,current:!0},e.appendChild(s),this.fire("tileloadstart",{tile:s,coords:t})},_tileReady:function(t,e,i){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?(me(i.el,0),k(this._fadeFrame),this._fadeFrame=M(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(ce(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),et||!this._map._fadeAnimated?M(this._pruneTiles,this):setTimeout(o(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new Z(this._wrapX?h(t.x,this._wrapX):t.x,this._wrapY?h(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new I(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}}),sn=on.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=d(this,e)).detectRetina&&kt&&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("")),ot||this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return ke(i,"load",o(this._tileOnLoad,this,e,i)),ke(i,"error",o(this._tileOnError,this,e,i)),!this.options.crossOrigin&&""!==this.options.crossOrigin||(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),i.alt="",i.setAttribute("role","presentation"),i.src=this.getTileUrl(t),i},getTileUrl:function(t){var i,n={r:kt?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};return this._map&&!this._map.options.crs.infinite&&(i=this._globalTileRange.max.y-t.y,this.options.tms&&(n.y=i),n["-y"]=i),f(this._url,e(n,this.options))},_tileOnLoad:function(t,e){et?setTimeout(o(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var n=this.options.errorTileUrl;n&&e.getAttribute("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=l,e.onerror=l,e.complete||(e.src=y,ae(e),delete this._tiles[t]))},_removeTile:function(t){var e=this._tiles[t];if(e)return rt||e.el.setAttribute("src",y),on.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(this._map&&(!i||i.getAttribute("src")!==y))return on.prototype._tileReady.call(this,t,e,i)}});function an(t,e){return new sn(t,e)}var rn=sn.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,i){this._url=t;var n=e({},this.defaultWmsParams);for(var o in i)o in this.options||(n[o]=i[o]);var s=(i=d(this,i)).detectRetina&&kt?2:1,a=this.getTileSize();n.width=a.x*s,n.height=a.y*s,this.wmsParams=n},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,sn.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,n=B(i.project(e[0]),i.project(e[1])),o=n.min,s=n.max,a=(1.3<=this._wmsVersion&&this._crs===Pi?[o.y,o.x,s.y,s.x]:[o.x,o.y,s.x,s.y]).join(","),r=sn.prototype.getTileUrl.call(this,t);return r+p(this.wmsParams,r,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+a},setParams:function(t,i){return e(this.wmsParams,t),i||this.redraw(),this}});sn.WMS=rn,an.wms=function(t,e){return new rn(t,e)};var hn=Mi.extend({options:{padding:.1,tolerance:0},initialize:function(t){d(this,t),a(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&ce(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=ye(this._container),o=this._map.getSize().multiplyBy(.5+this.options.padding),s=this._map.project(this._center,e),a=this._map.project(t,e).subtract(s),r=o.multiplyBy(-i).add(n).add(o).subtract(a);vt?ge(this._container,r,i):ve(this._container,r)},_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 I(i,i.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),ln=hn.extend({getEvents:function(){var t=hn.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){hn.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");ke(t,"mousemove",this._onMouseMove,this),ke(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),ke(t,"mouseout",this._handleMouseOut,this),this._ctx=t.getContext("2d")},_destroyContainer:function(){k(this._redrawRequest),delete this._ctx,ae(this._container),Se(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(){var t,e,i,n;this._map._animatingZoom&&this._bounds||(hn.prototype._update.call(this),t=this._bounds,e=this._container,i=t.getSize(),n=kt?2:1,ve(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",kt&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update"))},_reset:function(){hn.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t);var e=(this._layers[a(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[a(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("string"==typeof t.options.dashArray){for(var e,i=t.options.dashArray.split(/[, ]+/),n=[],o=0;o<i.length;o++){if(e=Number(i[o]),isNaN(e))return;n.push(e)}t.options._dashArray=n}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||M(this._redraw,this))},_extendRedrawBounds:function(t){var e;t._pxBounds&&(e=(t.options.weight||0)+1,this._redrawBounds=this._redrawBounds||new I,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,e=this._redrawBounds;e?(t=e.getSize(),this._ctx.clearRect(e.min.x,e.min.y,t.x,t.y)):(this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore())},_draw:function(){var t,e,i=this._redrawBounds;this._ctx.save(),i&&(e=i.getSize(),this._ctx.beginPath(),this._ctx.rect(i.min.x,i.min.y,e.x,e.y),this._ctx.clip()),this._drawing=!0;for(var n=this._drawFirst;n;n=n.next)t=n.layer,(!i||t._pxBounds&&t._pxBounds.intersects(i))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,e){if(this._drawing){var i,n,o,s,a=t._parts,r=a.length,h=this._ctx;if(r){for(h.beginPath(),i=0;i<r;i++){for(n=0,o=a[i].length;n<o;n++)s=a[i][n],h[n?"lineTo":"moveTo"](s.x,s.y);e&&h.closePath()}this._fillStroke(h,t)}}},_updateCircle:function(t){var e,i,n,o;this._drawing&&!t._empty()&&(e=t._point,i=this._ctx,n=Math.max(Math.round(t._radius),1),1!=(o=(Math.max(Math.round(t._radiusY),1)||n)/n)&&(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)&&(("click"===t.type||"preclick"!==t.type)&&this._map._draggableMoved(e)||(i=e));i&&(We(t),this._fireEvent([i],t))},_onMouseMove:function(t){var e;!this._map||this._map.dragging.moving()||this._map._animatingZoom||(e=this._map.mouseEventToLayerPoint(t),this._handleMouseHover(t,e))},_handleMouseOut:function(t){var e=this._hoveredLayer;e&&(_e(this._container,"leaflet-interactive"),this._fireEvent([e],t,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(t,e){if(!this._mouseHoverThrottled){for(var i,n,s=this._drawFirst;s;s=s.next)(i=s.layer).options.interactive&&i._containsPoint(e)&&(n=i);n!==this._hoveredLayer&&(this._handleMouseOut(t),n&&(ce(this._container,"leaflet-interactive"),this._fireEvent([n],t,"mouseover"),this._hoveredLayer=n)),this._hoveredLayer&&this._fireEvent([this._hoveredLayer],t),this._mouseHoverThrottled=!0,setTimeout(o((function(){this._mouseHoverThrottled=!1}),this),32)}},_fireEvent:function(t,e,i){this._map._fireDOMEvent(e,i||e.type,t)},_bringToFront:function(t){var e,i,n=t._order;n&&(e=n.next,i=n.prev,e&&((e.prev=i)?i.next=e:e&&(this._drawFirst=e),n.prev=this._drawLast,(this._drawLast.next=n).next=null,this._drawLast=n,this._requestRedraw(t)))},_bringToBack:function(t){var e,i,n=t._order;n&&(e=n.next,(i=n.prev)&&((i.next=e)?e.prev=i:i&&(this._drawLast=i),n.prev=null,n.next=this._drawFirst,this._drawFirst.prev=n,this._drawFirst=n,this._requestRedraw(t)))}});function un(t){return St?new ln(t):null}var cn=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">')}}}(),_n={_initContainer:function(){this._container=se("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(hn.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=cn("shape");ce(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=cn("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[a(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;ae(e),t.removeInteractiveTarget(e),delete this._layers[a(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=cn("stroke")),o.appendChild(e),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,n.dashArray?e.dashStyle=g(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=cn("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){he(t._container)},_bringToBack:function(t){le(t._container)}},dn=Et?cn:X,pn=hn.extend({getEvents:function(){var t=hn.prototype.getEvents.call(this);return t.zoomstart=this._onZoomStart,t},_initContainer:function(){this._container=dn("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=dn("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ae(this._container),Se(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_onZoomStart:function(){this._update()},_update:function(){var t,e,i;this._map._animatingZoom&&this._bounds||(hn.prototype._update.call(this),e=(t=this._bounds).getSize(),i=this._container,this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,i.setAttribute("width",e.x),i.setAttribute("height",e.y)),ve(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=dn("path");t.options.className&&ce(e,t.options.className),t.options.interactive&&ce(e,"leaflet-interactive"),this._updateStyle(t),this._layers[a(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){ae(t._path),t.removeInteractiveTarget(t._path),delete this._layers[a(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,J(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),n="a"+i+","+(Math.max(Math.round(t._radiusY),1)||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){he(t._path)},_bringToBack:function(t){le(t._path)}});function mn(t){return Ct||Et?new pn(t):null}Et&&pn.include(_n),Ve.include({getRenderer:function(t){var e=(e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer)||(this._renderer=this._createRenderer());return 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=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&un(t)||mn(t)}});var fn=ji.extend({initialize:function(t,e){ji.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=R(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});pn.create=dn,pn.pointsToPath=J,Ri.geometryToLayer=Ni,Ri.coordsToLatLng=Fi,Ri.coordsToLatLngs=Hi,Ri.latLngToCoords=Wi,Ri.latLngsToCoords=Ui,Ri.getFeature=$i,Ri.asFeature=qi,Ve.mergeOptions({boxZoom:!0});var gn=ei.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(){ke(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Se(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ae(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(),Gt(),xe(),this._startPoint=this._map.mouseEventToContainerPoint(t),ke(document,{contextmenu:Re,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=se("div","leaflet-zoom-box",this._container),ce(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new I(this._point,this._startPoint),i=e.getSize();ve(this._box,e.min),this._box.style.width=i.x+"px",this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(ae(this._box),_e(this._container,"leaflet-crosshair")),Vt(),be(),Se(document,{contextmenu:Re,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){var e;1!==t.which&&1!==t.button||(this._finish(),this._moved&&(this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(o(this._resetState,this),0),e=new j(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()}});Ve.addInitHook("addHandler","boxZoom",gn),Ve.mergeOptions({doubleClickZoom:!0});var vn=ei.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)}});Ve.addInitHook("addHandler","doubleClickZoom",vn),Ve.mergeOptions({dragging:!0,inertia:!st,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var yn=ei.extend({addHooks:function(){var t;this._draggable||(t=this._map,this._draggable=new ri(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))),ce(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){_e(this._map._container,"leaflet-grab"),_e(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,e=this._map;e._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity?(t=R(this._map.options.maxBounds),this._offsetLimit=B(this._map.latLngToContainerPoint(t.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(t.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))):this._offsetLimit=null,e.fire("movestart").fire("dragstart"),e.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){var e,i;this._map.options.inertia&&(e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos,this._positions.push(i),this._times.push(e),this._prunePositions(e)),this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;1<this._positions.length&&50<t-this._times[0];)this._positions.shift(),this._times.shift()},_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(){var t,e;this._viscosity&&this._offsetLimit&&(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,s=(n+e+i)%t-e-i,a=Math.abs(o+i)<Math.abs(s+i)?o:s;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=a},_onDragEnd:function(t){var e,i,n,o,s,a,r,h,l,u=this._map,c=u.options,_=!c.inertia||this._times.length<2;u.fire("dragend",t),_?u.fire("moveend"):(this._prunePositions(+new Date),e=this._lastPos.subtract(this._positions[0]),i=(this._lastTime-this._times[0])/1e3,n=c.easeLinearity,s=(o=e.multiplyBy(n/i)).distanceTo([0,0]),a=Math.min(c.inertiaMaxSpeed,s),r=o.multiplyBy(a/s),h=a/(c.inertiaDeceleration*n),(l=r.multiplyBy(-h/2).round()).x||l.y?(l=u._limitOffset(l,u.options.maxBounds),M((function(){u.panBy(l,{duration:h,easeLinearity:n,noMoveStart:!0,animate:!0})}))):u.fire("moveend"))}});Ve.addInitHook("addHandler","dragging",yn),Ve.mergeOptions({keyboard:!0,keyboardPanDelta:80});var xn=ei.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"),ke(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(),Se(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(){var t,e,i,n;this._focused||(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){for(var e=this._panKeys={},i=this.keyCodes,n=0,o=i.left.length;n<o;n++)e[i.left[n]]=[-1*t,0];for(n=0,o=i.right.length;n<o;n++)e[i.right[n]]=[t,0];for(n=0,o=i.down.length;n<o;n++)e[i.down[n]]=[0,t];for(n=0,o=i.up.length;n<o;n++)e[i.up[n]]=[0,-1*t]},_setZoomDelta:function(t){for(var e=this._zoomKeys={},i=this.keyCodes,n=0,o=i.zoomIn.length;n<o;n++)e[i.zoomIn[n]]=t;for(n=0,o=i.zoomOut.length;n<o;n++)e[i.zoomOut[n]]=-t},_addHooks:function(){ke(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Se(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)n._panAnim&&n._panAnim._inProgress||(e=this._panKeys[i],t.shiftKey&&(e=O(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||!n._popup.options.closeOnEscapeKey)return;n.closePopup()}Re(t)}}});Ve.addInitHook("addHandler","keyboard",xn),Ve.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var bn=ei.extend({addHooks:function(){ke(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Se(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var e=Fe(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(o(this._performZoom,this),n),Re(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,s=i?Math.ceil(o/i)*i:o,a=t._limitZoom(e+(0<this._delta?s:-s))-e;this._delta=0,this._startTime=null,a&&("center"===t.options.scrollWheelZoom?t.setZoom(e+a):t.setZoomAround(this._lastMousePos,e+a))}});Ve.addInitHook("addHandler","scrollWheelZoom",bn),Ve.mergeOptions({tap:!0,tapTolerance:15});var Ln=ei.extend({addHooks:function(){ke(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Se(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if(je(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 Z(e.clientX,e.clientY),i.tagName&&"a"===i.tagName.toLowerCase()&&ce(i,"leaflet-active"),this._holdTimeout=setTimeout(o((function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",e))}),this),1e3),this._simulateEvent("mousedown",e),ke(document,{touchmove:this._onMove,touchend:this._onUp},this)}},_onUp:function(t){var e,i;clearTimeout(this._holdTimeout),Se(document,{touchmove:this._onMove,touchend:this._onUp},this),this._fireClick&&t&&t.changedTouches&&((i=(e=t.changedTouches[0]).target)&&i.tagName&&"a"===i.tagName.toLowerCase()&&_e(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 Z(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)}});!Pt||wt&&!ct||Ve.addInitHook("addHandler","tap",Ln),Ve.mergeOptions({touchZoom:Pt&&!st,bounceAtZoomLimits:!0});var wn=ei.extend({addHooks:function(){ce(this._map._container,"leaflet-touch-zoom"),ke(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){_e(this._map._container,"leaflet-touch-zoom"),Se(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e,i,n=this._map;!t.touches||2!==t.touches.length||n._animatingZoom||this._zooming||(e=n.mouseEventToContainerPoint(t.touches[0]),i=n.mouseEventToContainerPoint(t.touches[1]),this._centerPoint=n.getSize()._divideBy(2),this._startLatLng=n.containerPointToLatLng(this._centerPoint),"center"!==n.options.touchZoom&&(this._pinchStartLatLng=n.containerPointToLatLng(e.add(i)._divideBy(2))),this._startDist=e.distanceTo(i),this._startZoom=n.getZoom(),this._moved=!1,this._zooming=!0,n._stop(),ke(document,"touchmove",this._onTouchMove,this),ke(document,"touchend",this._onTouchEnd,this),je(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]),s=i.distanceTo(n)/this._startDist;if(this._zoom=e.getScaleZoom(s,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoom<e.getMinZoom()&&s<1||this._zoom>e.getMaxZoom()&&1<s)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1==s)return}else{var a=i._add(n)._divideBy(2)._subtract(this._centerPoint);if(1==s&&0===a.x&&0===a.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(a),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),k(this._animRequest);var r=o(e._move,e,this._center,this._zoom,{pinch:!0,round:!1});this._animRequest=M(r,this,!0),je(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,k(this._animRequest),Se(document,"touchmove",this._onTouchMove,this),Se(document,"touchend",this._onTouchEnd,this),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}});Ve.addInitHook("addHandler","touchZoom",wn),Ve.BoxZoom=gn,Ve.DoubleClickZoom=vn,Ve.Drag=yn,Ve.Keyboard=xn,Ve.ScrollWheelZoom=bn,Ve.Tap=Ln,Ve.TouchZoom=wn,t.version="1.7.1",t.Control=Ye,t.control=Ke,t.Browser=At,t.Evented=E,t.Mixin=ni,t.Util=z,t.Class=S,t.Handler=ei,t.extend=e,t.bind=o,t.stamp=a,t.setOptions=d,t.DomEvent=qe,t.DomUtil=Me,t.PosAnimation=Ge,t.Draggable=ri,t.LineUtil=fi,t.PolyUtil=yi,t.Point=Z,t.point=O,t.Bounds=I,t.bounds=B,t.Transformation=q,t.transformation=G,t.Projection=Li,t.LatLng=N,t.latLng=D,t.LatLngBounds=j,t.latLngBounds=R,t.CRS=H,t.GeoJSON=Ri,t.geoJSON=Vi,t.geoJson=Ki,t.Layer=Mi,t.LayerGroup=ki,t.layerGroup=function(t,e){return new ki(t,e)},t.FeatureGroup=zi,t.featureGroup=function(t,e){return new zi(t,e)},t.ImageOverlay=Yi,t.imageOverlay=function(t,e,i){return new Yi(t,e,i)},t.VideoOverlay=Xi,t.videoOverlay=function(t,e,i){return new Xi(t,e,i)},t.SVGOverlay=Ji,t.svgOverlay=function(t,e,i){return new Ji(t,e,i)},t.DivOverlay=Qi,t.Popup=tn,t.popup=function(t,e){return new tn(t,e)},t.Tooltip=en,t.tooltip=function(t,e){return new en(t,e)},t.Icon=Si,t.icon=function(t){return new Si(t)},t.DivIcon=nn,t.divIcon=function(t){return new nn(t)},t.Marker=Zi,t.marker=function(t,e){return new Zi(t,e)},t.TileLayer=sn,t.tileLayer=an,t.GridLayer=on,t.gridLayer=function(t){return new on(t)},t.SVG=pn,t.svg=mn,t.Renderer=hn,t.Canvas=ln,t.canvas=un,t.Path=Ai,t.CircleMarker=Oi,t.circleMarker=function(t,e){return new Oi(t,e)},t.Circle=Ii,t.circle=function(t,e,i){return new Ii(t,e,i)},t.Polyline=Bi,t.polyline=function(t,e){return new Bi(t,e)},t.Polygon=ji,t.polygon=function(t,e){return new ji(t,e)},t.Rectangle=fn,t.rectangle=function(t,e){return new fn(t,e)},t.Map=Ve,t.map=function(t,e){return new Ve(t,e)};var Pn=window.L;t.noConflict=function(){return window.L=Pn,this},window.L=t})),
/* @preserve
// Fill in missing zoom levels of a tile layer with scaled previous zooms.
// Written by Ilya Zverev, licensed WTFPL
*/
L.TileLayer.mergeOptions({nativeZooms:[]}),L.TileLayer.addInitHook((function(){const t=this.options,e=t.nativeZooms;if(e&&e.length>0){let i,n=100;for(i=0;i<e.length;i++)e[i]<n&&(n=e[i]);t.minZoom=Math.max(t.minZoom,n-1)}})),L.TileLayer.include({getTileSize:function(){const t=this._map,e=L.GridLayer.prototype.getTileSize.call(this),i=this._tileZoom+this.options.zoomOffset,n=this._mapNativeZoom(i);return n==i?e:e.divideBy(t.getZoomScale(n,i)).round()},_getZoomForUrl:function(){let t=this._tileZoom,e=this.options.maxZoom;return this.options.zoomReverse&&(t=e-t),t+=this.options.zoomOffset,this._mapNativeZoom(t)},_mapNativeZoom:function(t){let e=this.options.nativeZooms,i=this.options.minNativeZoom,n=this.options.maxNativeZoom;if(e&&e.length>0){let i,n=-1,o=100;for(i=0;i<e.length;i++)e[i]<=t&&e[i]>n&&(n=e[i]),e[i]<o&&(o=e[i]);t=n<0?o:n}else null!==n&&t>n?t=n:null!==i&&t<i&&(t=i);return t}}),
/* @preserve
For license information please see leaflet.motion.min.js.LICENSE.txt
https://github.com/Igor-Vladyka/leaflet.motion
MIT
*/
L.Motion=L.Motion||{Event:{Started:"motion-started",Paused:"motion-paused",Resumed:"motion-resumed",Section:"motion-section",Ended:"motion-ended"}},L.motion=L.motion||{},L.Motion.Animate={options:{pane:"polymotionPane"},motionOptions:{auto:!1,easing:function(t){return t},speed:0,duration:0},markerOptions:void 0,initialize:function(t,e,i,n){L.Util.setOptions(this,e),i&&(this.motionOptions=L.Util.extend({},this.motionOptions,i)),n&&(this.markerOptions=L.Util.extend({},n)),this._bounds=L.latLngBounds(),this._linePoints=this._convertLatLngs(t),L.Motion.Utils.isFlat(this._linePoints)||(this._linePoints=this._linePoints[0]),this._initializeMarker(),this._latlngs=[],L.Util.stamp(this)},addLatLng:function(t,e){return t=L.Motion.Utils.toLatLng(t),this._linePoints.push(t),this._latlngs.length&&this._latlngs.push(t),this},beforeAdd:function(t){t.getPane(this.options.pane)||(t.createPane(this.options.pane).style.zIndex=599),this._renderer=t.getRenderer(this)},onAdd:function(t){return this._renderer._initPath(this),this._reset(),this._renderer._addPath(this),this.__marker&&this.markerOptions.showMarker&&(this.__marker.addTo(t),this.__marker._icon&&this.__marker._icon.children.length&&Array.from(this.__marker._icon.children).forEach((function(t){var e=t.getAttribute("motion-base");e&&(t.style.transform="rotate("+e+"deg)")}))),this.motionOptions.auto&&this.motionStart(),this},onRemove:function(t){this.motionStop(),this.__marker&&t.removeLayer(this.__marker),this._renderer._removePath(this)},_motion:function(t){var e=(new Date).getTime()-t,i=1;if(this.motionOptions.duration&&(i=e/this.motionOptions.duration),i<1){i=this.motionOptions.easing(i,e,0,1,this.motionOptions.duration);var n=L.Motion.Utils.interpolateOnLine(this._map,this._linePoints,i);this.setLatLngs(n.traveledPath),this._drawMarker(n.latLng),this.options.onTick&&this.options.onTick.bind(this)(nextPoint),this.__ellapsedTime=e,this.animation=L.Util.requestAnimFrame((function(){this._motion(t)}),this)}else this.motionStop(!0)},_drawMarker:function(t){var e=this.getMarker();if(e){var i=e.getLatLng(),n=this._linePoints[0];i.lat===n.lat&&i.lng===n.lng?(e.addTo(this._map),e.addEventParent(this)):e._icon&&e._icon.children.length&&Array.from(e._icon.children).forEach((function(e){var n=e.getAttribute("motion-base");if(n){var o=0;n&&!isNaN(+n)&&(o=+n);const s=-1*Math.round(L.Motion.Utils.getAngle(i,t)+o);e.style.transform=`rotate(${s}deg)`}})),e.setLatLng(t)}},_removeMarker:function(t){this.markerOptions&&this.__marker&&(t&&!this.markerOptions.removeOnEnd||this._map.removeLayer(this.__marker))},_initializeMarker:function(){this.markerOptions&&(this.__marker=L.marker(this._linePoints[0],this.markerOptions))},motionStart:function(){return this._map&&!this.animation&&(this.motionOptions.duration||(this.motionOptions.speed?this.motionOptions.duration=L.Motion.Utils.getDuration(this._map,this._linePoints,this.motionOptions.speed):this.motionOptions.duration=0),this.setLatLngs([]),this._motion((new Date).getTime()),this.fire(L.Motion.Event.Started,{layer:this},!1)),this},motionStop:function(t){return this.motionPause(),this.setLatLngs(this._linePoints),this.__ellapsedTime=null,this._removeMarker(t),this.fire(L.Motion.Event.Ended,{layer:this},!1),this},motionPause:function(){return this.animation&&(L.Util.cancelAnimFrame(this.animation),this.animation=null,this.fire(L.Motion.Event.Paused,{layer:this},!1)),this},motionResume:function(){return!this.animation&&this.__ellapsedTime&&(this.motionOptions.duration||(this.motionOptions.speed?this.motionOptions.duration=L.Motion.Utils.getDuration(this._map,this._linePoints,this.motionOptions.speed):this.motionOptions.duration=0),this._motion((new Date).getTime()-this.__ellapsedTime),this.fire(L.Motion.Event.Resumed,{layer:this},!1)),this},motionToggle:function(){return this.animation?this.__ellapsedTime&&this.motionPause():this.__ellapsedTime?this.motionResume():this.motionStart(),this},motionDuration:function(t){var e=this.motionSpeed.duration;return this.motionOptions.duration=t||0,this.animation&&e&&(this.motionPause(),this.__ellapsedTime=this.__ellapsedTime*(e/t),this.motionOptions.duration=t,this.motionResume()),this},motionSpeed:function(t){var e=this.motionOptions.speed;return this.motionOptions.speed=t||0,this.animation&&e&&(this.motionPause(),this.__ellapsedTime=this.__ellapsedTime*(e/t),this.motionOptions.duration=L.Motion.Utils.getDuration(this._map,this._linePoints,this.motionOptions.speed),this.motionResume()),this},getMarker:function(){return this.__marker},getMarkers:function(){return[this.getMarker()]}},L.Motion.Utils={attachDistances:function(t,e){if(e.length>1)for(var i=1;i<e.length;i++)e[i-1].distanceToNextPoint=t.distance(e[i-1],e[i]);return e},interpolateOnLine:function(t,e,i){if((e=e instanceof L.Polyline?e.getLatLngs():e).length<2)return null;for(var n=!0,o=0;o<e.length-1;o++)if(!e[o].distanceToNextPoint){n=!1;break}if(n||this.attachDistances(t,e),0===(i=Math.max(Math.min(i,1),0))){var s=e[0]instanceof L.LatLng?e[0]:L.latLng(e[0]);return{traveledPath:[s],latLng:s}}if(1==i)return{traveledPath:e,latLng:e[e.length-1]instanceof L.LatLng?e[e.length-1]:L.latLng(e[e.length-1])};for(var a=0,r=0;r<e.length-1;r++)a+=e[r].distanceToNextPoint;for(var h=a*i,l=0,u=0,c=0;u<h;c++){var _=e[c],d=e[c+1];l=u,u+=_.distanceToNextPoint}null==_&&null==d&&(_=e[0],d=e[1],c=1);var p=u-l!=0?(h-l)/(u-l):0,m=this.interpolateOnLatLngSegment(_,d,p),f=e.slice(0,c);return f.push(m),{traveledPath:f,latLng:m}},interpolateOnPointSegment:function(t,e,i){return L.point(t.x*(1-i)+i*e.x,t.y*(1-i)+i*e.y)},interpolateOnLatLngSegment:function(t,e,i){return L.latLng(t.lat*(1-i)+i*e.lat,t.lng*(1-i)+i*e.lng)},distance:function(t,e){for(var i=0,n=1;n<e.length;n++)i+=t.distance(e[n],e[n-1]);return i},getDuration:function(t,e,i){return L.Motion.Utils.distance(t,e.map((function(t){return L.Motion.Utils.toLatLng(t)})))/(i/3600)},toLatLng:function(t,e,i){return t instanceof L.LatLng?t:L.Util.isArray(t)&&"object"!=typeof t[0]?3===t.length?L.latLng(t[0],t[1],t[2]):2===t.length?L.latLng(t[0],t[1]):null:null==t?t:"object"==typeof t&&"lat"in t?L.latLng(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===e?null:L.latLng(t,e,i)},getAngle:function(t,e){var i=180*Math.atan2(e.lat-t.lat,e.lng-t.lng)/Math.PI;return i<0&&(i+=360),i},isFlat:function(t){return!L.Util.isArray(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}},L.Motion.Ease={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},easeInQuad:function(t,e,i,n,o){return n*(e/=o)*e+i},easeOutQuad:function(t,e,i,n,o){return-n*(e/=o)*(e-2)+i},easeInOutQuad:function(t,e,i,n,o){return(e/=o/2)<1?n/2*e*e+i:-n/2*(--e*(e-2)-1)+i},easeInCubic:function(t,e,i,n,o){return n*(e/=o)*e*e+i},easeOutCubic:function(t,e,i,n,o){return n*((e=e/o-1)*e*e+1)+i},easeInOutCubic:function(t,e,i,n,o){return(e/=o/2)<1?n/2*e*e*e+i:n/2*((e-=2)*e*e+2)+i},easeInQuart:function(t,e,i,n,o){return n*(e/=o)*e*e*e+i},easeOutQuart:function(t,e,i,n,o){return-n*((e=e/o-1)*e*e*e-1)+i},easeInOutQuart:function(t,e,i,n,o){return(e/=o/2)<1?n/2*e*e*e*e+i:-n/2*((e-=2)*e*e*e-2)+i},easeInQuint:function(t,e,i,n,o){return n*(e/=o)*e*e*e*e+i},easeOutQuint:function(t,e,i,n,o){return n*((e=e/o-1)*e*e*e*e+1)+i},easeInOutQuint:function(t,e,i,n,o){return(e/=o/2)<1?n/2*e*e*e*e*e+i:n/2*((e-=2)*e*e*e*e+2)+i},easeInSine:function(t,e,i,n,o){return-n*Math.cos(e/o*(Math.PI/2))+n+i},easeOutSine:function(t,e,i,n,o){return n*Math.sin(e/o*(Math.PI/2))+i},easeInOutSine:function(t,e,i,n,o){return-n/2*(Math.cos(Math.PI*e/o)-1)+i},easeInExpo:function(t,e,i,n,o){return 0==e?i:n*Math.pow(2,10*(e/o-1))+i},easeOutExpo:function(t,e,i,n,o){return e==o?i+n:n*(1-Math.pow(2,-10*e/o))+i},easeInOutExpo:function(t,e,i,n,o){return 0==e?i:e==o?i+n:(e/=o/2)<1?n/2*Math.pow(2,10*(e-1))+i:n/2*(2-Math.pow(2,-10*--e))+i},easeInCirc:function(t,e,i,n,o){return-n*(Math.sqrt(1-(e/=o)*e)-1)+i},easeOutCirc:function(t,e,i,n,o){return n*Math.sqrt(1-(e=e/o-1)*e)+i},easeInOutCirc:function(t,e,i,n,o){return(e/=o/2)<1?-n/2*(Math.sqrt(1-e*e)-1)+i:n/2*(Math.sqrt(1-(e-=2)*e)+1)+i},easeInElastic:function(t,e,i,n,o){var s=1.70158,a=0,r=n;return 0==e?i:1==(e/=o)?i+n:(a||(a=.3*o),r<Math.abs(n)?(r=n,s=a/4):s=a/(2*Math.PI)*Math.asin(n/r),-r*Math.pow(2,10*(e-=1))*Math.sin((e*o-s)*(2*Math.PI)/a)+i)},easeOutElastic:function(t,e,i,n,o){var s=1.70158,a=0,r=n;return 0==e?i:1==(e/=o)?i+n:(a||(a=.3*o),r<Math.abs(n)?(r=n,s=a/4):s=a/(2*Math.PI)*Math.asin(n/r),r*Math.pow(2,-10*e)*Math.sin((e*o-s)*(2*Math.PI)/a)+n+i)},easeInOutElastic:function(t,e,i,n,o){var s=1.70158,a=0,r=n;return 0==e?i:2==(e/=o/2)?i+n:(a||(a=o*(.3*1.5)),r<Math.abs(n)?(r=n,s=a/4):s=a/(2*Math.PI)*Math.asin(n/r),e<1?r*Math.pow(2,10*(e-=1))*Math.sin((e*o-s)*(2*Math.PI)/a)*-.5+i:r*Math.pow(2,-10*(e-=1))*Math.sin((e*o-s)*(2*Math.PI)/a)*.5+n+i)},easeInBack:function(t,e,i,n,o,s){return null==s&&(s=1.70158),n*(e/=o)*e*((s+1)*e-s)+i},easeOutBack:function(t,e,i,n,o,s){return null==s&&(s=1.70158),n*((e=e/o-1)*e*((s+1)*e+s)+1)+i},easeInOutBack:function(t,e,i,n,o,s){return null==s&&(s=1.70158),(e/=o/2)<1?n/2*(e*e*((1+(s*=1.525))*e-s))+i:n/2*((e-=2)*e*((1+(s*=1.525))*e+s)+2)+i},easeInBounce:function(t,e,i,n,o){return n-L.Motion.Ease.easeOutBounce(t,o-e,0,n,o)+i},easeOutBounce:function(t,e,i,n,o){return(e/=o)<1/2.75?n*(7.5625*e*e)+i:e<2/2.75?n*(7.5625*(e-=1.5/2.75)*e+.75)+i:e<2.5/2.75?n*(7.5625*(e-=2.25/2.75)*e+.9375)+i:n*(7.5625*(e-=2.625/2.75)*e+.984375)+i},easeInOutBounce:function(t,e,i,n,o){return e<o/2?.5*L.Motion.Ease.easeInBounce(t,2*e,0,n,o)+i:.5*L.Motion.Ease.easeOutBounce(t,2*e-o,0,n,o)+.5*n+i}},L.Motion.Polyline=L.Polyline.extend(L.Motion.Animate),L.motion.polyline=function(t,e,i,n){return new L.Motion.Polyline(t,e,i,n)},L.Motion.Polygon=L.Polygon.extend(L.Motion.Animate),L.motion.polygon=function(t,e,i,n){return new L.Motion.Polygon(t,e,i,n)},L.Motion.Group=L.FeatureGroup.extend({_started:!1,_completed:!1,options:{pane:L.Motion.Animate.options.pane,attribution:L.Motion.Animate.options.attribution},motionStart:function(){return this.invoke("motionStart"),this._started=!0,this._completed=!1,this.fire(L.Motion.Event.Started,{layer:this},!1),this},motionStop:function(){return this.invoke("motionStop"),this._completed=!0,this.fire(L.Motion.Event.Ended,{layer:this},!1),this},motionPause:function(){return this.invoke("motionPause"),this.fire(L.Motion.Event.Paused,{layer:this},!1),this},motionResume:function(){return this.invoke("motionResume"),this.fire(L.Motion.Event.Resumed,{layer:this},!1),this},motionToggle:function(){return this.invoke("motionToggle"),this},getMarkers:function(){return this.getLayers().map((function(t){return t.getMarkers()}))}}),L.motion.group=function(t,e){return new L.Motion.Group(t,e)},L.Motion.Seq=L.Motion.Group.extend({_activeLayer:null,_started:!1,_completed:!1,addLayer:function(t,e){void 0===e&&(e=!0),this.__prepareLayer(t),L.Motion.Group.prototype.addLayer.call(this,t),!this._activeLayer&&e&&this._completed&&t.motionStart()},motionStart:function(){if(!this._activeLayer){var t=this.getFirstLayer();t&&(t.motionStart(),this._started=!0,this._completed=!1,this.fire(L.Motion.Event.Started,{layer:this},!1))}return this},motionStop:function(t){return t||this.invoke("motionStop"),this._activeLayer=null,this._completed=!0,this.fire(L.Motion.Event.Ended,{layer:this},!1),this},motionPause:function(){return this._activeLayer&&(this._activeLayer.motionPause(),this.fire(L.Motion.Event.Paused,{layer:this},!1)),this},motionResume:function(){return this._activeLayer&&(this._activeLayer.motionResume(),this.fire(L.Motion.Event.Resumed,{layer:this},!1)),this},motionToggle:function(){return this._activeLayer?this.motionPause():this.motionResume(),this},getFirstLayer:function(){var t=this.getLayers();return t.length?t[0]:null},__prepareLayer:function(t){t.setLatLngs&&t.setLatLngs([]),t.off(L.Motion.Event.Ended,this.__clearActiveLayer__,this),t.on(L.Motion.Event.Ended,this.__clearActiveLayer__,this),t.off(L.Motion.Event.Started,this.__putActiveLayer__,this),t.on(L.Motion.Event.Started,this.__putActiveLayer__,this)},__clearActiveLayer__:function(t){this._activeLayer=null;var e=this.getLayers(),i=t.layer._leaflet_id,n=e.filter((function(t){return t._leaflet_id==i}))[0],o=e.indexOf(n)+1;e.length>o?e[o].motionStart():this.motionStop(!0)},__putActiveLayer__:function(t){this._activeLayer=t.layer,this.fire(L.Motion.Event.Section,{layer:this._activeLayer},!1)}}),L.motion.seq=function(t,e){return new L.Motion.Seq(t,e)};const base_folder=is_dev_environment?"../":"./",emoji_folder=base_folder+"images/openmoji/",map_folder=base_folder+"images/maps/",company_emoji_folder=base_folder+"images/companyemoji/",custom_emoji_folder=base_folder+"images/custom/",is_mobile_device=void 0!==window.orientation||-1!==navigator.userAgent.indexOf("IEMobile");let copy_link_url=window.location.protocol+"//"+window.location.host+"/";const params={hideplayers:""===new URL(location.href).searchParams.get("hideplayers"),hideicons:""===new URL(location.href).searchParams.get("hideicons"),alwaysactive:""===new URL(location.href).searchParams.get("alwaysactive"),expmap:""===new URL(location.href).searchParams.get("expmap"),coords:(()=>{const t=new URL(location.href).searchParams.get("x"),e=new URL(location.href).searchParams.get("y");return t&&e?[t,e]:void 0})()};localStorage.getItem("ttmap_options_1")&&localStorage.removeItem("ttmap_options_1"),window.lastCoords=[0,0];const max_inactivity_time_in_minutes=30,options={current_map_index:1,sidebar_open:!0,current_trail_index:4,current_animation_speed_index:0,timestamp:0,markers:{business:!0,garages:!0,self_storage:!0,houses:!0,expmap:!1,easteregg_weapons:isHalloweenEvent()}};let currentTileLayer=null;const save_options=()=>{options.timestamp=Date.now(),localStorage.setItem("ttmap_options_3",JSON.stringify(options))};try{const t=localStorage.getItem("ttmap_options_3");if(t){if(Object.assign(options,JSON.parse(t)),params.hideicons)for(const t in options.markers)options.markers[t]=!1;params.expmap&&(options.markers.expmap=!0)}save_options()}catch(t){console.error(t)}const div_map=cel("div",{id:"map"});document.body.appendChild(div_map),div_map.style.height=window.innerHeight+"px",window.onresize=()=>{div_map.style.height=window.innerHeight+"px"},L.CRS.Kebab=L.extend({},L.CRS.Simple,{projection:{project:t=>new L.Point(t.lat,t.lng),unproject:t=>new L.LatLng(t.x,t.y),bounds:new L.Bounds([-180,-90],[180,90])},transformation:new L.Transformation(.005175,34.38,-.005173,46.79355)}),window.mainMap=L.map("map",{renderer:L.canvas(),zoomControl:!1,zooms:[2,3,4,5,6,7,8],minZoom:2,maxZoom:8,fadeAnimation:!0,zoomAnimation:!0,crs:L.CRS.Kebab}).setView([0,0],5);const map_list=[{name:"Color Mode",bgcolor:"#0fa8d1",tileLayer:L.tileLayer(base_folder+"images/maps/color-mode-tiles/{z}_{x}_{y}.jpg",{tileSize:288,nativeZooms:[3,4,5,6,7],noWrap:!0,bounds:[{lat:-6566,lng:-4735},{lat:7166,lng:8906}],reuseTiles:!0})},{name:"Dark Mode",bgcolor:"#171717",tileLayer:L.tileLayer(base_folder+"images/maps/dark-mode-tiles/{z}_{x}_{y}.jpg",{tileSize:288,nativeZooms:[3,4,5,6,7],noWrap:!0,bounds:[{lat:-6566,lng:-4735},{lat:7166,lng:8906}],reuseTiles:!0})}];L.control.zoom({position:"topright"}).addTo(window.mainMap);const div_right_click_menu=cel("div",{id:"copy-menu",hidden:!0},["b",{innerText:"Copy link to this position:"}],["br"],["input",{type:"text",id:"copy-link-input-field",value:"",onclick:t=>t.target.select()}],["label",{for:"hidePlayersCheck",innerText:"Hide Players"}],["input",{type:"checkbox",id:"hidePlayersCheck",checked:!0,onclick:()=>refresh_copy_link()}],["label",{for:"hideIconsCheck",innerText:"| Hide Icons"}],["input",{type:"checkbox",id:"hideIconsCheck",checked:!1,onclick:()=>refresh_copy_link()}],["label",{for:"showEXPMap",innerText:"| EXP Map"}],["input",{type:"checkbox",id:"showEXPMap",checked:!1,onclick:()=>refresh_copy_link()}]);document.body.appendChild(div_right_click_menu);const div_credits=cel("div",{id:"credits",hidden:!0});document.body.appendChild(div_credits);const div_hud_popup=cel("div",{id:"hud-popup",hidden:!0});document.body.appendChild(div_hud_popup);let active_popup_timeout=null;function assign_hud_hover_event(t){return Object.assign(t,{onmouseover:t=>{if(!t.target._title)return;div_hud_popup.hidden=!1,div_hud_popup.innerText=t.target._title;let e=t.target.offsetTop+t.target.offsetHeight+5;e<0&&(e=0);let i=t.target.offsetLeft+.5*t.target.offsetWidth-.5*div_hud_popup.offsetWidth;i<0&&(i=0),div_hud_popup.style.top=e+"px",div_hud_popup.style.left=i+"px",is_mobile_device&&!active_popup_timeout&&(active_popup_timeout=setTimeout((()=>{div_hud_popup.hidden=!0,div_hud_popup.innerText="",active_popup_timeout=null}),1e3))},onmouseleave:t=>{div_hud_popup.hidden=!0,div_hud_popup.innerText=""}})}const div_sidebar=cel("div",{id:"sidebar"});document.body.appendChild(div_sidebar);const sidebar_toggle=t=>{"none"===div_sidebar_panel.style.display?(t.target.className="arrow-close",div_sidebar_panel.style.display="block"):(t.target.className="arrow-open",div_sidebar_panel.style.display="none")},div_sidebar_panel=cel("div",{id:"sidebar-panel"});div_sidebar.appendChild(div_sidebar_panel);const div_sidebar_arrow=cel("a",{id:"sidebar-arrow",className:"arrow-close",_title:"Toggle Sidebar",onclick:sidebar_toggle});function create_sideblock_item(t="N/A",...e){div_sidebar_panel.appendChild(cel(["div",{className:"block-item"},["span",{className:"block-item-head",innerText:t}],["div",{className:"block-item-content flx"},...e]]))}div_sidebar.appendChild(div_sidebar_arrow),create_sideblock_item("Map Mode",...map_list.map(((t,e)=>["input",assign_hud_hover_event({type:"button",className:"img-btn image-select-btn grow-item",value:t.name,_title:t.title,onclick:()=>toogle_image_quality(e)})])));let current_copy_link_url="";window.mainMap.on("contextmenu",(function(t){div_right_click_menu.style.top=t.originalEvent.y+"px",div_right_click_menu.style.left=t.originalEvent.x+"px",current_copy_link_url=`${copy_link_url}?x=${t.latlng.lat.toFixed(1)}&y=${t.latlng.lng.toFixed(1)}`,refresh_copy_link(),div_right_click_menu.hidden=!1,window.lastCoords=[Number(t.latlng.lat.toFixed(1)),Number(t.latlng.lng.toFixed(1))]}));const copy_link_input_field=document.getElementById("copy-link-input-field"),hide_players_checkbox=document.getElementById("hidePlayersCheck"),hide_icons_checkbox=document.getElementById("hideIconsCheck"),show_exp_map=document.getElementById("showEXPMap");function refresh_copy_link(){copy_link_input_field.value=current_copy_link_url+(!0===hide_players_checkbox.checked?"&hideplayers":"")+(!0===showEXPMap.checked?"&expmap":"")+(!0===hide_icons_checkbox.checked?"&hideicons":"")}function toogle_image_quality(t,e=!1){(e||t!==options.current_map_index)&&(currentTileLayer&&window.mainMap.removeLayer(currentTileLayer),options.current_map_index=t,currentTileLayer=map_list[t].tileLayer,currentTileLayer.addTo(window.mainMap),div_map.style.backgroundColor=map_list[t].bgcolor,save_options(),refresh_image_quality_button())}function refresh_image_quality_button(){let t=0;for(const e of document.querySelectorAll(".image-select-btn"))t===options.current_map_index?e.classList.add("selected"):e.classList.remove("selected"),t++}function show_credits(){div_credits.hidden=!div_credits.hidden}window.mainMap.on("click",(function(){div_right_click_menu.hidden=!0})),window.mainMap.on("drag",(function(){div_right_click_menu.hidden=!0})),toogle_image_quality(options.current_map_index,!0),fetch(base_folder+"data/credits.txt").then((t=>t.text())).then((t=>{div_credits.appendChild(cel(["p",{innerText:t}])),div_credits.appendChild(cel(["a",{href:"https://forms.gle/8HJyRxN2MWKr1vBP7",innerText:"Feedback form"}])),div_credits.appendChild(cel(["div",{innerText:"> Download the map: "},["a",{href:"https://supernovaplus.github.io/ttmap/images/maps/map.jpg",innerText:"COLOR (4608p)",target:"blank"}],["a",{href:"https://supernovaplus.github.io/ttmap/images/maps/mapdark.jpg",innerText:"DARK (4608p)",target:"blank"}],["a",{href:"https://supernovaplus.github.io/ttmap/images/maps/mobilemap.jpg",innerText:"COLOR (2304p)",target:"blank"}],["a",{href:"https://supernovaplus.github.io/ttmap/images/maps/mapdarkmobile.jpg",innerText:"DARK (2304p)",target:"blank"}]])),div_credits.appendChild(cel(["input",{type:"button",value:"Close",onclick:show_credits,style:"margin-top:5px;cursor:pointer;"}]))})),window.mainMap.attributionControl._container.prepend(cel(["a",{onclick:show_credits,innerText:"CREDITS | Download Map",className:"cursor"}])," | "),(()=>{try{const t=window.mainMap.attributionControl._container.querySelector("a[href='https://leafletjs.com']");t&&(t.innerHTML=`<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag">\n <path fill="#4C7BE1" d="M0 0h12v4H0z" style="--darkreader-inline-fill: #569ae3;" data-darkreader-inline-fill="">\n </path><path fill="#FFD500" d="M0 4h12v3H0z" style="--darkreader-inline-fill: #ffd91a;" data-darkreader-inline-fill="">\n </path><path fill="#E0BC00" d="M0 7h12v1H0z" style="--darkreader-inline-fill: #ffde2f;" data-darkreader-inline-fill=""></path></svg> ${t.innerHTML}`,t.target="_blank")}catch(t){console.log(t)}})();const job_icons={conductor:"๐",busdriver:"๐",cargopilot:"โ๏ธ",pilot:"โ๏ธ",racer:"๐๏ธ",emergency:"๐",helicopterpilot:"๐",fisher:"๐ฆ",trucker:"๐",hunter:"๐",mechanic:"๐ ๏ธ",farmer:"๐",leisurepilot:"โฑ๏ธ",miner:"โ๏ธ",garbage:"๐๏ธ",cleanup:"๐๏ธ",postop:"โ๏ธ",delivery_ups:"๐ฆ",taxi:"๐",firefighter:"๐",quarry:"๐",metermaid:"๐
ฟ๏ธ",aerialfire:"๐โ๏ธ",dockhandler:"โ",delivery_transformer:"โก",frllc_paramedic:`<img src='${company_emoji_folder}frllc_tag.png'> `,collinsco_cabbie_job:`<img src='${company_emoji_folder}coco_tag.png'> `,collinsco_plane_job:`<img src='${company_emoji_folder}coco_tag.png'> `,collinsco_train_job:`<img src='${company_emoji_folder}coco_tag.png'> `,collinsco_metro_job:`<img src='${company_emoji_folder}coco_tag.png'> `,collinsco_boat_job:`<img src='${company_emoji_folder}coco_tag.png'> `,ia_pilot:`<img src='${company_emoji_folder}ia_tag.png'> `,delivery_iaa:`<img src='${company_emoji_folder}ia_tag.png'> `,rts_job:`<img src='${company_emoji_folder}rts_tag.png'> `,rts_job_air:`<img src='${company_emoji_folder}rts_tag.png'> `,rts_professional:`<img src='${company_emoji_folder}rts_tag.png'> `,pigs_job:`<img src='${company_emoji_folder}pigs_tag.png'> `},vehicle_icons={0:emoji_folder+"1F697.png",1:emoji_folder+"1F697.png",2:emoji_folder+"1F699.png",3:emoji_folder+"1F697.png",4:emoji_folder+"1F697.png",5:emoji_folder+"1F697.png",6:emoji_folder+"1F3CE.png",7:emoji_folder+"1F3CE.png",8:emoji_folder+"1F3CD.png",9:emoji_folder+"1F699.png",10:emoji_folder+"1F697.png",11:emoji_folder+"1F69A.png",12:emoji_folder+"1F69A.png",13:emoji_folder+"1F6B2.png",14:custom_emoji_folder+"boat.png",15:emoji_folder+"1F681.png",16:emoji_folder+"1F6EB.png",17:emoji_folder+"1F697.png",18:emoji_folder+"1F693.png",19:custom_emoji_folder+"trucktrailer.png",20:custom_emoji_folder+"trucktrailer.png",21:emoji_folder+"1F682.png",101:emoji_folder+"1F6B6-200D-2642-FE0F.png",102:emoji_folder+"1F6F8.png",103:emoji_folder+"1F68C.png",104:emoji_folder+"1F69C.png",105:custom_emoji_folder+"trashtruck.png",106:custom_emoji_folder+"towtruck.png",107:emoji_folder+"1F692.png",108:emoji_folder+"1F691.png",109:custom_emoji_folder+"firefighter_airplane.png",110:custom_emoji_folder+"excavator.png",111:emoji_folder+"1F69B.png"},vehicle_classes=["Compacts","Sedans","SUVs","Coupes","Muscle","Sports","Sports","Super","Motorcycles","Off-Road","Industrial","Utility","Vans","Cycles","Boats","Helicopters","Planes","Service","Emergency","Military","Commercial","Trains"];function generate_icon(t,e,i=40){let n=vehicle_icons[t.vehicle_class]||vehicle_icons[0];return"land"===t.vehicle_type?17===t.vehicle_class?/(bus|coach|ikarus)/i.test(t.vehicle_label)?n=vehicle_icons[103]:"TRASH"===t.vehicle_label&&(n=vehicle_icons[105]):18===t.vehicle_class?"FIRETRUK"===t.vehicle_label?n=vehicle_icons[107]:/(GRANGER|emsnspeedo|AMBULAN|RETROAMBU)/i.test(t.vehicle_label)&&(n=vehicle_icons[108]):11===t.vehicle_class&&/tractor/i.test(t.vehicle_label)?n=vehicle_icons[104]:10===t.vehicle_class?"excavator"===t.vehicle_label?n=vehicle_icons[110]:/flatbed/i.test(t.vehicle_label)&&(n=vehicle_icons[106]):20===t.vehicle_class&&/mule/i.test(t.vehicle_label)&&(n=vehicle_icons[111]):n="plane"===t.vehicle_type?"aerialfire"===e.group?vehicle_icons[109]:vehicle_icons[16]:"deluxo"===t.vehicle_type?vehicle_icons[102]:"helicopter"===t.vehicle_type?vehicle_icons[15]:"train"===t.vehicle_type?vehicle_icons[21]:"boat"===t.vehicle_type?vehicle_icons[14]:vehicle_icons[101],L.icon({iconUrl:n,iconSize:[i,i],iconAnchor:[20,20],popupAnchor:[0,-20]})}const business_icons={Business:`${company_emoji_folder}22px-Business_Owned.png`,"Watercraft Garage":`${company_emoji_folder}25px-Boat_Garage.png`,"Helicopter Garage":`${company_emoji_folder}25px-Helicopter_Garage.png`,"Aircraft Garage":`${company_emoji_folder}25px-Aircraft_Garage.png`,"Vehicle Garage":`${company_emoji_folder}25px-Garage.png`,"Car Garage":`${company_emoji_folder}25px-Garage.png`,"Self Storage":`${company_emoji_folder}22px-Self_Storage.png`,House:`${company_emoji_folder}22px-House.png`,Exp:`${company_emoji_folder}22px-exp.png`,"Custom Point":`${company_emoji_folder}point22px.png`,"Weapon Easteregg":`${company_emoji_folder}radar_shootingrange_gunshop.png`},m_list=[["business","Businesses",business_icons.Business],["garages","Garages",business_icons["Vehicle Garage"]],["self_storage","Self Storages",business_icons["Self Storage"]],["houses","Houses",business_icons.House],["expmap","EXP Pickup Locations",business_icons.Exp],["easteregg_weapons","Easter Egg Weapons",business_icons["Weapon Easteregg"]]],static_markers_list=Object.fromEntries(m_list.map((([t,e,i])=>[t,{title:e,image:i,markers:[]}])));function toggle_markers(t){options.markers[t]?(static_markers_list[t].markers.forEach((t=>{window.mainMap.removeLayer(t)})),options.markers[t]=!1):(static_markers_list[t].markers.forEach((t=>{window.mainMap.addLayer(t)})),options.markers[t]=!0),save_options(),refresh_toggle_markers_buttons()}function refresh_toggle_markers_buttons(){for(const t of document.querySelectorAll(".toggle-markers"))options.markers[t._key]?t.classList.add("selected"):t.classList.remove("selected")}function create_data_marker_icon(t){return L.icon({iconUrl:business_icons[t],iconSize:[22,23],iconAnchor:[11,11.5],popupAnchor:[0,0],className:"dataicon"})}create_sideblock_item("Toggle Markers",...Object.entries(static_markers_list).map((t=>["img",assign_hud_hover_event({className:"img-btn toggle-markers",src:t[1].image,_key:t[0],_title:t[1].title,onclick:()=>toggle_markers(t[0])})]))),refresh_toggle_markers_buttons(),fetch(base_folder+"data/bizBlips.json").then((t=>t.json())).then((t=>{for(const e in t){const i=L.marker([t[e].coordinates.x,t[e].coordinates.y],{icon:create_data_marker_icon("Business")}).bindPopup(`<div class="popup-header green-bg">${t[e].name}</div>\n Type: Business<hr>\n Price: ${t[e].price}<hr>\n Perks:<br>${t[e].perks.join("<br>")}<hr>\n Payout: ${t[e].payout}<br>\n <small>(in 24 hours / 8 stacks)</small>`);static_markers_list.business.markers.push(i),options.markers.business&&window.mainMap.addLayer(i)}})),fetch(base_folder+"data/garageBlips.json").then((t=>t.json())).then((t=>{for(const e in t){const i=L.marker([t[e].coordinates.x,t[e].coordinates.y],{icon:create_data_marker_icon(t[e].type)}).bindPopup(`<div class="popup-header blue-bg">${t[e].name}</div>\n Type: ${t[e].type}<hr>\n Spawns: ${t[e].spawns}`);i._name=t[e].name,static_markers_list.garages.markers.push(i),options.markers.garages&&window.mainMap.addLayer(i)}})),fetch(base_folder+"data/ssBlips.json").then((t=>t.json())).then((t=>{for(const e in t){const i=L.marker([t[e].coordinates.x,t[e].coordinates.y],{icon:create_data_marker_icon("Self Storage")}).bindPopup(`<div class="popup-header blue-bg">${t[e].name}</div>\n Type: Self Storage Unit<hr>\n Fee: ${t[e].fee}<hr>\n Capacity: ${t[e].capacity}`);static_markers_list.self_storage.markers.push(i),options.markers.self_storage&&window.mainMap.addLayer(i)}})),fetch(base_folder+"data/houses.json").then((t=>t.json())).then((t=>{t.data.forEach((t=>{const e=L.marker([t.position.x,t.position.y],{icon:create_data_marker_icon("House")}).bindPopup(`<div class="popup-header blue-white">${t.name}</div>\n Buy Price: $${Number(t.buy_price).toLocaleString()}<br>\n Sell Price: $${Number(t.sell_price).toLocaleString()}`);static_markers_list.houses.markers.push(e),options.markers.houses&&window.mainMap.addLayer(e)}))})),fetch(base_folder+"data/eastereggWeapons.json").then((t=>t.json())).then((t=>{t.forEach((t=>{const e=L.marker([t.x,t.y],{icon:create_data_marker_icon("Weapon Easteregg")}).bindPopup(`<div class="popup-header" style="background-color:black;">${t.name}</div>\n <video muted controls preload="metadata" loop class="video-block"><source src="${t["v-thumb"]}" type="video/mp4"></video>\n <div class="video-block-links">\n <a href="${t["v-full"]}" target="_blank">HQ video</a>\n <a href="${t.img}" target="_blank">image</a>\n </div>\n </div> \n `);static_markers_list.easteregg_weapons.markers.push(e),options.markers.easteregg_weapons&&window.mainMap.addLayer(e)}))})),fetch(base_folder+"data/expmap.json").then((t=>t.json())).then((t=>{t.forEach((([t,e,i,n,o])=>{const s=L.circle([t,e],{radius:5,color:"red",fill:!1}).bindPopup(`<div class="popup-header" style="background-color: orange;">EXP Pickup</div>${n} | ${o}`);static_markers_list.expmap.markers.push(s),options.markers.expmap&&window.mainMap.addLayer(s)}))})),params.coords&&(L.marker(params.coords,{icon:create_data_marker_icon("Custom Point")}).bindTooltip("Location").addTo(window.mainMap),window.mainMap.flyTo(params.coords,6,{animate:!0,duration:.5}));const nova_servers={},trail_modes=[{name:"Infinite",title:"no limit",value:1/0},{name:"Long",title:"30 minutes",value:300},{name:"Medium",title:"15 minutes",value:150},{name:"Short",title:"5 minutes",value:50},{name:"Tiny",title:"1 minute",value:10},{name:"Tiny+",title:"30 seconds",value:5},{name:"Tiny++",title:"6 seconds",value:1},{name:"None",title:"none",value:0}],animation_speed_options=[{name:"Slow (default)",value:6250},{name:"Medium",value:3e3},{name:"Fast",value:500}];fetch(base_folder+"data/serversList.json").then((t=>t.json())).then((async t=>{create_sideblock_item("Options",["div",{className:"options-block"},["div",{innerText:"Trail length",className:"options-title"}],["select",{onchange:t=>handle_trail_mode_change(Number(t.target.value))},...trail_modes.map(((t,e)=>["option",{value:e,innerText:`${t.name} (${t.title})`,selected:e===options.current_trail_index}]))],["div",{innerText:"Animation speed",className:"options-title"}],["select",{onchange:t=>handle_animation_speed_change(Number(t.target.value))},...animation_speed_options.map(((t,e)=>["option",{value:e,innerText:`${t.name}`,selected:e===options.current_animation_speed_index}]))]]),create_sideblock_item("Find Player",["input",{type:"text",id:"find-player-input",placeholder:"enter player's id or name",onkeydown:({keyCode:t,target:e})=>{13===t&&handle_find_player_button(e.nextSibling)}}],["input",{type:"button",className:"btn img-btn",value:"Find",onclick:t=>handle_find_player_button(t.target)}]),create_sideblock_item("Servers",["div",{id:"servers"}],["input",{type:"button",className:"btn img-btn",onclick:t=>{t.target.disabled=!0,setTimeout((()=>{t.target.disabled=!1}),6e3),servers_uncheck_all()},value:"Uncheck All (Hide Players)",style:"width: -moz-available;"}]);const e=document.getElementById("servers");for(let i=0;i<t.length;i++){const n=cel(["div",{className:"servercheckbox"},["input",{type:"checkbox",checked:!1}],["span",{innerText:t[i][0]}],!1===is_mobile_device?["a",assign_hud_hover_event({href:"fivem://connect/cfx.re/join/"+t[i][1],_title:"Join: "+t[i][1],innerText:"๐ฎ"})]:[]]);e.appendChild(n),nova_servers[t[i][1]]={name:t[i][0],endpoint:t[i][1],players:{},timestamp:0,checkbox:n.firstElementChild,disabled:!0,timeout:null},nova_servers[t[i][1]].checkbox.addEventListener("change",(()=>{nova_servers[t[i][1]].disabled?enable_server(nova_servers[t[i][1]]):disable_server(nova_servers[t[i][1]])}))}params.hideplayers||enable_server(Object.values(nova_servers)[0])})).catch((t=>{console.log(t)}));let inactivity_timer_last_active_at=Date.now();function inactivity_timer_reset(){inactivity_timer_last_active_at=Date.now()}function handle_find_player_button(t){if(!t.previousSibling.value)return;const e=String(t.previousSibling.value).toLowerCase();let i;for(const t in nova_servers){if(i)break;if(!nova_servers[t].disabled)for(const n in nova_servers[t].players)if(String(nova_servers[t].players[n].gameid).toLowerCase().includes(e)){i=nova_servers[t].players[n];break}}if(i)return t.previousSibling.style.backgroundColor="lime",window.mainMap.flyTo(i.prevAnimation.__marker._latlng,7,{animate:!0,duration:.5}),setTimeout((()=>{i.prevAnimation.openPopup()}),100),!1;t.previousSibling.style.backgroundColor="red"}function handle_trail_mode_change(t){options.current_trail_index=t,get_current_trail_value()>=300&&alert("Keep in mind that the map will pause after 30 minutes if you become inactive"),save_options()}function handle_animation_speed_change(t){options.current_animation_speed_index=t,save_options()}function get_current_trail_value(){return trail_modes[options.current_trail_index].value}function get_current_animation_speed_value(){return animation_speed_options[options.current_animation_speed_index].value}function continue_scanning(t){t.timeout||(t.timeout=setTimeout((()=>{get_server_data(t),t.timeout=null}),6e3))}function get_server_data(t){!0!==t.disabled&&fetch("https://d.ttstats.eu/positions/"+t.endpoint).then((t=>t.json())).then((e=>{if(!e.data||e.error||0===e.data.players.length||!0===t.disabled)return console.log(t.name,e.error?e.error:"no res data / no players / checkbox unmarked"),void continue_scanning(t);const i=Date.now();t.timestamp=i;const n=e.data.players;for(let e=0;e<n.length;e++){const o=n[e];if(null===o[3])continue;const s=o[2];if("null"===o[0]){void 0!==t.players[s]&&clean_player(t,s);continue}void 0===t.players[s]?t.players[s]={gameid:o[0]+"#"+s,timestamp:i,vehicle:o[4],job:o[5],positions_last_index:0,color:randomColor2(),prevAnimation:null,prevLines:[],lastPos:null}:(t.players[s].timestamp=i,t.players[s].vehicle.vehicle_model!==o[4].vehicle_model&&(t.players[s].vehicle=o[4]));const a=o[6];if(a&&a.length){if(t.players[s].lastPos&&t.players[s].lastPos.x===o[3].x&&t.players[s].lastPos.y===o[3].y&&t.players[s].lastPos.z===o[3].z&&t.players[s].lastPos.h===o[3].h)continue;const e=generateRoute(a,t,o,s),i=get_offset_from_heading(o[3].h,150,"NULL"===o[4].vehicle_label?90:130),n=generatePolyline(e,t,o,s,i),r=t.players[s]?.prevAnimation;transitionAnimation(t,s,n,r)}}server_cleanup(t),continue_scanning(t)})).catch((e=>{console.log(e),continue_scanning(t)}))}function generateRoute(t,e,i,n){let o=[];for(let i=0;i<t.length;i++){const s=t[i];s[0]<e.players[n].positions_last_index||o.push({lat:s[1],lng:s[2]})}return e.players[n].lastPos={x:i[3].x,y:i[3].y,z:i[3].z,h:i[3].h},e.players[n].positions_last_index=t[t.length-1][0],o=o.concat(new Array(o.length>0?1:2).fill({lat:i[3].x,lng:i[3].y})),o}function generatePolyline(t,e,i,n,o){return L.motion.polyline(t,{color:0==get_current_trail_value()?"hsla(0, 0%, 0%, 0)":e.players[n].color,smoothFactor:.3},{},{icon:generate_icon(i[4],i[5],40),removeOnEnd:!1}).motionDuration(get_current_animation_speed_value()).addTo(window.mainMap).bindTooltip(generate_job_tag(i[5].group,e.players[n].gameid),{sticky:!0}).bindPopup(generate_popup(i,e,e.players[n].color,o[0]),{offset:o})}function transitionAnimation(t,e,i,n){for(t.players[e].prevAnimation=i.motionStart(),t.players[e].prevLines.push(i),n&&(n.isPopupOpen()&&(n.closePopup(),i.openPopup()),n.isTooltipOpen()&&(n.closeTooltip(),i.openTooltip()),n.motionStop());t.players[e].prevLines.length-1>get_current_trail_value();)t.players[e].prevLines.shift().motionStop().removeFrom(window.mainMap)}function disable_server(t){t.checkbox.checked=!1,t.disabled=!0,t.timeout&&(clearTimeout(t.timeout),t.timeout=null),server_cleanup(t,!0)}function enable_server(t){t.checkbox.checked=!0,t.disabled=!1,t.timeout||get_server_data(t)}function servers_check_all(){for(const t in nova_servers)nova_servers[t].disabled&&enable_server(nova_servers[t])}function servers_uncheck_all(){for(const t in nova_servers)nova_servers[t].disabled||disable_server(nova_servers[t])}function server_cleanup(t,e=!1){for(const i in t.players)(e||t.players[i].timestamp<Date.now()-6e4)&&clean_player(t,i)}function clean_player(t,e){for(;t.players[e].prevLines.length>0;)t.players[e].prevLines.shift().motionStop().removeFrom(window.mainMap);delete t.players[e]}function generate_popup(t,e,i,n){const o="NULL"===t[4].vehicle_label?"":String(t[4].vehicle_label).toLowerCase().replace(/ /g,"_");return` ${get_directional_arrow(n,i)}\n <div class="popup-header" ${i?`style="background-color: ${i}"`:""}>${t[0]}</div>\n <b>ID:</b> ${t[2]}<hr>\n <b>Job:</b> ${(t[5].name||"N/A")+" "+generate_job_tag(t[5].group)}<hr>\n ${"plane"===t[4].vehicle_type||"helicopter"===t[4].vehicle_type?`<b>Height</b>: ${parseInt(t[3].z)}m.<hr>`:""}\n <div class="popup-vehicle-label">\n <b>Vehicle</b>: ${"NULL"===t[4].vehicle_label?"N/A":`${t[4].vehicle_name} (${vehicle_classes[t[4].vehicle_class]})`}</div>\n ${"NULL"===t[4].vehicle_label?"":`<hr><a href="https://cdn.tycoon.community/dealership/vehicles/${t[4].vehicle_spawn}.png" target="_blank" class="car-img-link"><img src="https://ttdata.transporttycoon.eu/vehicles/veh_images_min/${t[4].vehicle_spawn}.jpg" class="veh-img" alt="${o}" onerror="this.src = 'https://ttdata.transporttycoon.eu/vehicles/veh_images_min/unk.jpg';" /></a>`}\n <hr>\n <b>${e.name}</b> ${is_mobile_device?"":`<a href="fivem://connect/cfx.re/join/${e.endpoint}" title="Join: ${e.name}" class="join-btn">JOIN</a>`}`}function on_vehicle_image_load_error(t){t.parentElement.outerHTML='<span style="color:gray;">no vehicle image found</span>'}function generate_job_tag(t,e=""){return void 0===job_icons[t]?e:job_icons[t]+e}function get_offset_from_heading(t,e,i){const n=Math.cos((t+90)*Math.PI/180),o=Math.sin((t+90)*Math.PI/180),s=Math.abs(o)>.5?.85*e:e;return n<0?[s,i]:[-s,i]}function get_directional_arrow(t,e){return`<span class="popup-directional-arrow" style="${t<0?`border-left: 10px solid ${e}; right: -10px;`:`border-right: 10px solid ${e}; left: -10px;`}"></span>`}params.alwaysactive||(setInterval((()=>{if(Date.now()-inactivity_timer_last_active_at>18e5){Object.values(nova_servers).some((t=>!t.disabled))&&(alert("Paused after 30 minutes due to inactivity... \nWasting my charges is not nice."),servers_uncheck_all()),inactivity_timer_reset()}}),6e4),document.addEventListener("click",inactivity_timer_reset),document.addEventListener("wheel",inactivity_timer_reset));