/*! leaflet.geodesic 2.7.1 - (c) Henry Thasler - https://github.com/henrythasler/Leaflet.Geodesic#readme */ !function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("leaflet")):"function"==typeof define&&define.amd?define(["exports","leaflet"],n):n(((t="undefined"!=typeof globalThis?globalThis:t||self).L=t.L||{},t.L.geodesic={}),t.L)}(this,(function(t,n){"use strict";function e(t){var n=Object.create(null);return t&&Object.keys(t).forEach((function(e){if("default"!==e){var i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,i.get?i:{enumerable:!0,get:function(){return t[e]}})}})),n.default=t,Object.freeze(n)}var i=e(n),a=function(t,n){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},a(t,n)};function o(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}a(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}var s=function(){return s=Object.assign||function(t){for(var n,e=1,i=arguments.length;el&&++x=i)throw new EvalError("Direct vincenty formula failed to converge after ".concat(i," iterations \n (start=").concat(t.lat,"/").concat(t.lng,"; bearing=").concat(n,"; distance=").concat(e,")"));var G=M*D-L*E*f,j=Math.atan2(M*E+L*D*f,(1-u)*Math.sqrt(v*v+G*G)),N=u/16*w*(4+u*(4-3*w)),A=o+(Math.atan2(D*g,L*E-M*D*f)-(1-N)*u*v*(S+N*D*(P+N*E*(2*P*P-1)))),T=Math.atan2(v,-G);return{lat:this.toDegrees(j),lng:this.toDegrees(A),bearing:this.wrap360(this.toDegrees(T))}},t.prototype.inverse=function(t,n,e,a){void 0===e&&(e=100),void 0===a&&(a=!0);var o=t,s=n,r=this.toRadians(o.lat),l=this.toRadians(o.lng),c=this.toRadians(s.lat),h=this.toRadians(s.lng),p=Math.PI,u=Number.EPSILON,g=this.ellipsoid,f=g.a,d=g.b,L=g.f,M=h-l,y=(1-L)*Math.tan(r),v=1/Math.sqrt(1+y*y),w=y*v,m=(1-L)*Math.tan(c),b=1/Math.sqrt(1+m*m),O=m*b,S=Math.abs(M)>p/2||Math.abs(c-r)>p/2,D=M,E=null,P=null,R=S?p:0,x=0,G=S?-1:1,j=null,N=1,A=null,T=1,q=null,C=null,I=0;do{if(j=b*(E=Math.sin(D))*(b*E)+(v*O-w*b*(P=Math.cos(D)))*(v*O-w*b*P),Math.abs(j)p)throw new EvalError("λ > π")}while(Math.abs(D-C)>1e-12&&++I=e){if(a)return this.inverse(t,new i.LatLng(n.lat,n.lng-.01),e,a);throw new EvalError("Inverse vincenty formula failed to converge after ".concat(e," iterations \n (start=").concat(t.lat,"/").concat(t.lng,"; dest=").concat(n.lat,"/").concat(n.lng,")"))}var _=T*(f*f-d*d)/(d*d),k=_/1024*(256+_*(_*(74-47*_)-128)),B=d*(1+_/16384*(4096+_*(_*(320-175*_)-768)))*(R-k*x*(N+k/4*(G*(2*N*N-1)-k/6*N*(4*x*x-3)*(4*N*N-3)))),J=Math.abs(j)0?y:2*g-y),m=(Math.sin(l-s)>0?2*g-v:v)-h;if(0===Math.sin(w)&&0===Math.sin(m))return null;if(Math.sin(w)*Math.sin(m)<0)return null;var b=-Math.cos(w)*Math.cos(m)+Math.sin(w)*Math.sin(m)*Math.cos(d),O=Math.atan2(Math.sin(d)*Math.sin(w)*Math.sin(m),Math.cos(m)+Math.cos(w)*b),S=Math.asin(Math.min(Math.max(Math.sin(o)*Math.cos(O)+Math.cos(o)*Math.sin(O)*Math.cos(c),-1),1)),D=s+Math.atan2(Math.sin(c)*Math.sin(O)*Math.cos(o),Math.cos(O)-Math.sin(o)*Math.sin(S));return new i.LatLng(this.toDegrees(S),this.toDegrees(D))},t.prototype.midpoint=function(t,n){var e=this.toRadians(t.lat),a=this.toRadians(t.lng),o=this.toRadians(n.lat),s=this.toRadians(n.lng-t.lng),r=Math.cos(e),l=0,c=Math.sin(e),h={x:r+Math.cos(o)*Math.cos(s),y:l+Math.cos(o)*Math.sin(s),z:c+Math.sin(o)},p=Math.atan2(h.z,Math.sqrt(h.x*h.x+h.y*h.y)),u=a+Math.atan2(h.y,h.x);return new i.LatLng(this.toDegrees(p),this.toDegrees(u))},t}(),c=function(){function t(t){var n;this.geodesic=new l,this.steps=null!==(n=null==t?void 0:t.steps)&&void 0!==n?n:3}return t.prototype.recursiveMidpoint=function(t,n,e){var i=[t,n],a=this.geodesic.midpoint(t,n);return e>0?(i.splice.apply(i,r([0,1],this.recursiveMidpoint(t,a,e-1),!1)),i.splice.apply(i,r([i.length-2,2],this.recursiveMidpoint(a,n,e-1),!1))):i.splice(1,0,a),i},t.prototype.line=function(t,n){return this.recursiveMidpoint(t,n,Math.min(8,this.steps))},t.prototype.multiLineString=function(t){for(var n=[],e=0,i=t;e180?s.lng=s.lng-360:s.lng-o.lng<-180&&(s.lng=s.lng+360);var r=[[new i.LatLng(o.lat,this.geodesic.wrap(o.lng,180),o.alt),new i.LatLng(s.lat,this.geodesic.wrap(s.lng,180),s.alt)]];if(o.lng>=-180&&o.lng<=180){if(s.lng<-180){var l=this.geodesic.inverse(o,s).initialBearing;(c=this.geodesic.intersection(o,l,e.point,e.bearing))&&(r=[[o,c],[new i.LatLng(c.lat,c.lng+360),new i.LatLng(s.lat,s.lng+360,s.alt)]])}else if(s.lng>180){l=this.geodesic.inverse(o,s).initialBearing;(c=this.geodesic.intersection(o,l,a.point,a.bearing))&&(r=[[o,c],[new i.LatLng(c.lat,c.lng-360),new i.LatLng(s.lat,s.lng-360,s.alt)]])}}else if(s.lng>=-180&&s.lng<=180)if(o.lng<-180){l=this.geodesic.inverse(o,s).initialBearing;(c=this.geodesic.intersection(o,l,e.point,e.bearing))&&(r=[[new i.LatLng(o.lat,o.lng+360,o.alt),new i.LatLng(c.lat,c.lng+360)],[c,s]])}else if(o.lng>180){var c;l=this.geodesic.inverse(o,s).initialBearing;(c=this.geodesic.intersection(o,l,e.point,e.bearing))&&(r=[[new i.LatLng(o.lat,o.lng-360,o.alt),new i.LatLng(c.lat,c.lng-360)],[c,s]])}return r},t.prototype.splitMultiLineString=function(t){for(var n=[],e=0,i=t;e1&&(n.push(o),o=r[1])}n.push(o)}else n.push(a)}return n},t.prototype.wrapMultiLineString=function(t){for(var n=[],e=0,a=t;e