!function(t){var o,e;if("function"==typeof define&&define.amd)define(["leaflet","proj4"],t);else if("object"==typeof module&&"object"==typeof module.exports)o=require("leaflet"),e=require("proj4"),module.exports=t(o,e);else{if("undefined"==typeof window.L||"undefined"==typeof window.proj4)throw"Leaflet and proj4 must be loaded first";t(window.L,window.proj4)}}(function(t,o){return t.Proj={},t.Proj._isProj4Obj=function(t){return"undefined"!=typeof t.inverse&&"undefined"!=typeof t.forward},t.Proj.Projection=t.Class.extend({initialize:function(o,e,i){var n=t.Proj._isProj4Obj(o);this._proj=n?o:this._projFromCodeDef(o,e),this.bounds=n?e:i},project:function(o){var e=this._proj.forward([o.lng,o.lat]);return new t.Point(e[0],e[1])},unproject:function(o,e){var i=this._proj.inverse([o.x,o.y]);return new t.LatLng(i[1],i[0],e)},_projFromCodeDef:function(t,e){if(e)o.defs(t,e);else if(void 0===o.defs[t]){var i=t.split(":");if(i.length>3&&(t=i[i.length-3]+":"+i[i.length-1]),void 0===o.defs[t])throw"No projection definition for code "+t}return o(t)}}),t.Proj.CRS=t.Class.extend({includes:t.CRS,options:{transformation:new t.Transformation(1,0,-1,0)},initialize:function(o,e,i){var n,s,r,a;if(t.Proj._isProj4Obj(o)?(s=o,n=s.srsCode,a=e||{},this.projection=new t.Proj.Projection(s,a.bounds)):(n=o,r=e,a=i||{},this.projection=new t.Proj.Projection(n,r,a.bounds)),t.Util.setOptions(this,a),this.code=n,this.transformation=this.options.transformation,this.options.origin&&(this.transformation=new t.Transformation(1,-this.options.origin[0],-1,this.options.origin[1])),this.options.scales)this._scales=this.options.scales;else if(this.options.resolutions){this._scales=[];for(var l=this.options.resolutions.length-1;l>=0;l--)this.options.resolutions[l]&&(this._scales[l]=1/this.options.resolutions[l])}this.infinite=!this.options.bounds},scale:function(t){var o,e,i,n,s=Math.floor(t);return t===s?this._scales[t]:(o=this._scales[s],e=this._scales[s+1],i=e-o,n=t-s,o+i*n)},zoom:function(t){var o,e,i,n=this._closestElement(this._scales,t),s=this._scales.indexOf(n);return t===n?s:(e=s+1,o=this._scales[e],void 0===o?1/0:(i=o-n,(t-n)/i+s))},distance:t.CRS.Earth.distance,R:t.CRS.Earth.R,_closestElement:function(t,o){for(var e,i=t.length;i--;)t[i]<=o&&(void 0===e||e