Stage 1 of the GIS Analytical Tools concept — client-side spatial analysis: - src/analysis/overlay.js: vector overlays (intersect / clip / difference / union-dissolve) on Turf.js, reprojecting to WGS84 and merging attributes (intersect keeps both layers', clip keeps only A's). - src/analysis/zonal.js: vector-in-vector zonal statistics — count / sum / mean / min / max / total area per zone, with centroid-in-zone (default) or any-overlap membership. - Bounding-box pre-filtering in both: only genuinely overlapping pairs reach the expensive geometry test. 43 zones x 25,004 parcels now completes in ~106 ms; previously it was refused as too large. - src/analysis-modal.js + markup: Analysis panel with "Apply to" scoping — whole layer, current map view, selected features, or the catch of a drawn Circle/Area. Reached from a new "Analyse" dock button. - MapView.addCOGLayer() for Cloud-Optimized GeoTIFF display (WebGLTile + GeoTIFF source, imported lazily); listVectorLayers(); getSelectedFeatures(). - Circle/Area analysis popup: one "Export" button (PDF folded into the export modal as a fourth format, field-rename table hidden for it) plus an "Analyse" button that opens the panel pre-scoped to the intersecting features. - vite.config.js: code-split turf, geotiff and pako so the eager bundle is unchanged (~283 kB). Giving pako its own chunk also fixes a circular chunk between jspdf and geotiff, which share it via fast-png. Drawing-tool fixes carried in the same working tree: - Delete/Backspace key deletes the selection via the EditBar's Delete interaction (same undoable block as the button). - Multi-select: shift-click toggles, Ctrl/Cmd-drag box-selects; helper layers (vertex overlay, GPS) excluded. - Undo: split/merge/divide wrapped in undo blocks so one press reverses the whole operation; vertex-overlay churn no longer pollutes the undo stack; sources are re-scanned and the stack cleared when edit mode is entered, so deletes on sub-grouped layers are undoable. NOTE: the undo behaviour is not yet confirmed on-device. - ol-ext TouchCursor gated to touch-only devices, so hybrid touchscreen laptops keep the normal cursor. Service worker v12 -> v13. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
7 lines
167 KiB
JavaScript
7 lines
167 KiB
JavaScript
import{r as ia}from"./pako-Xa-UToif.js";var ni={},me;function ie(){if(me)return ni;me=1;var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return ni.encode=function(i,e){for(var s="",a,n,h,r,f,o,l,c=0;c<i.length;)a=i.charCodeAt(c++),n=i.charCodeAt(c++),h=i.charCodeAt(c++),r=a>>2,f=(a&3)<<4|n>>4,o=(n&15)<<2|h>>6,l=h&63,isNaN(n)?o=l=64:isNaN(h)&&(l=64),s=s+t.charAt(r)+t.charAt(f)+t.charAt(o)+t.charAt(l);return s},ni.decode=function(i,e){var s="",a,n,h,r,f,o,l,c=0;for(i=i.replace(/[^A-Za-z0-9\+\/\=]/g,"");c<i.length;)r=t.indexOf(i.charAt(c++)),f=t.indexOf(i.charAt(c++)),o=t.indexOf(i.charAt(c++)),l=t.indexOf(i.charAt(c++)),a=r<<2|f>>4,n=(f&15)<<4|o>>2,h=(o&3)<<6|l,s=s+String.fromCharCode(a),o!=64&&(s=s+String.fromCharCode(n)),l!=64&&(s=s+String.fromCharCode(h));return s},ni}var Y={},xe;function Yt(){if(xe)return Y;if(xe=1,Y.base64=!0,Y.array=!0,Y.string=!0,Y.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",Y.nodebuffer=typeof Buffer<"u",Y.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")Y.blob=!1;else{var t=new ArrayBuffer(0);try{Y.blob=new Blob([t],{type:"application/zip"}).size===0}catch{try{var i=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,e=new i;e.append(t),Y.blob=e.getBlob("application/zip").size===0}catch{Y.blob=!1}}}return Y}var Gi={},hi={},wt={},Ee;function ea(){if(Ee)return wt;Ee=1;var t=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",i=ia();return wt.uncompressInputType=t?"uint8array":"array",wt.compressInputType=t?"uint8array":"array",wt.magic="\b\0",wt.compress=function(e,s){return i.deflateRaw(e,{level:s.level||-1})},wt.uncompress=function(e){return i.inflateRaw(e)},wt}var we;function ee(){return we||(we=1,hi.STORE={magic:"\0\0",compress:function(t,i){return t},uncompress:function(t){return t},compressInputType:null,uncompressInputType:null},hi.DEFLATE=ea()),hi}var oi={exports:{}},Se;function se(){return Se||(Se=1,oi.exports=function(t,i){return new Buffer(t,i)},oi.exports.test=function(t){return Buffer.isBuffer(t)}),oi.exports}var pe;function ot(){return pe||(pe=1,(function(t){var i=Yt(),e=ee(),s=se();t.string2binary=function(o){for(var l="",c=0;c<o.length;c++)l+=String.fromCharCode(o.charCodeAt(c)&255);return l},t.arrayBuffer2Blob=function(o,l){t.checkSupport("blob"),l=l||"application/zip";try{return new Blob([o],{type:l})}catch{try{var c=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,u=new c;return u.append(o),u.getBlob(l)}catch{throw new Error("Bug : can't construct the Blob.")}}};function a(o){return o}function n(o,l){for(var c=0;c<o.length;++c)l[c]=o.charCodeAt(c)&255;return l}function h(o){var l=65536,c=[],u=o.length,d=t.getTypeOf(o),g=0,M=!0;try{switch(d){case"uint8array":String.fromCharCode.apply(null,new Uint8Array(0));break;case"nodebuffer":String.fromCharCode.apply(null,s(0));break}}catch{M=!1}if(!M){for(var v="",S=0;S<o.length;S++)v+=String.fromCharCode(o[S]);return v}for(;g<u&&l>1;)try{d==="array"||d==="nodebuffer"?c.push(String.fromCharCode.apply(null,o.slice(g,Math.min(g+l,u)))):c.push(String.fromCharCode.apply(null,o.subarray(g,Math.min(g+l,u)))),g+=l}catch{l=Math.floor(l/2)}return c.join("")}t.applyFromCharCode=h;function r(o,l){for(var c=0;c<o.length;c++)l[c]=o[c];return l}var f={};f.string={string:a,array:function(o){return n(o,new Array(o.length))},arraybuffer:function(o){return f.string.uint8array(o).buffer},uint8array:function(o){return n(o,new Uint8Array(o.length))},nodebuffer:function(o){return n(o,s(o.length))}},f.array={string:h,array:a,arraybuffer:function(o){return new Uint8Array(o).buffer},uint8array:function(o){return new Uint8Array(o)},nodebuffer:function(o){return s(o)}},f.arraybuffer={string:function(o){return h(new Uint8Array(o))},array:function(o){return r(new Uint8Array(o),new Array(o.byteLength))},arraybuffer:a,uint8array:function(o){return new Uint8Array(o)},nodebuffer:function(o){return s(new Uint8Array(o))}},f.uint8array={string:h,array:function(o){return r(o,new Array(o.length))},arraybuffer:function(o){return o.buffer},uint8array:a,nodebuffer:function(o){return s(o)}},f.nodebuffer={string:h,array:function(o){return r(o,new Array(o.length))},arraybuffer:function(o){return f.nodebuffer.uint8array(o).buffer},uint8array:function(o){return r(o,new Uint8Array(o.length))},nodebuffer:a},t.transformTo=function(o,l){if(l||(l=""),!o)return l;t.checkSupport(o);var c=t.getTypeOf(l),u=f[c][o](l);return u},t.getTypeOf=function(o){if(typeof o=="string")return"string";if(Object.prototype.toString.call(o)==="[object Array]")return"array";if(i.nodebuffer&&s.test(o))return"nodebuffer";if(i.uint8array&&o instanceof Uint8Array)return"uint8array";if(i.arraybuffer&&o instanceof ArrayBuffer)return"arraybuffer"},t.checkSupport=function(o){var l=i[o.toLowerCase()];if(!l)throw new Error(o+" is not supported by this browser")},t.MAX_VALUE_16BITS=65535,t.MAX_VALUE_32BITS=-1,t.pretty=function(o){var l="",c,u;for(u=0;u<(o||"").length;u++)c=o.charCodeAt(u),l+="\\x"+(c<16?"0":"")+c.toString(16).toUpperCase();return l},t.findCompression=function(o){for(var l in e)if(e.hasOwnProperty(l)&&e[l].magic===o)return e[l];return null},t.isRegExp=function(o){return Object.prototype.toString.call(o)==="[object RegExp]"}})(Gi)),Gi}var Ii,Pe;function sa(){if(Pe)return Ii;Pe=1;var t=ot(),i=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];return Ii=function(s,a){if(typeof s>"u"||!s.length)return 0;var n=t.getTypeOf(s)!=="string";typeof a>"u"&&(a=0);var h=0,r=0,f=0;a=a^-1;for(var o=0,l=s.length;o<l;o++)f=n?s[o]:s.charCodeAt(o),r=(a^f)&255,h=i[r],a=a>>>8^h;return a^-1},Ii}var _t={},Ae;function _s(){return Ae||(Ae=1,_t.LOCAL_FILE_HEADER="PK",_t.CENTRAL_FILE_HEADER="PK",_t.CENTRAL_DIRECTORY_END="PK",_t.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",_t.ZIP64_CENTRAL_DIRECTORY_END="PK",_t.DATA_DESCRIPTOR="PK\x07\b"),_t}var tt={},be;function vs(){return be||(be=1,tt.base64=!1,tt.binary=!1,tt.dir=!1,tt.createFolders=!1,tt.date=null,tt.compression=null,tt.compressionOptions=null,tt.comment=null,tt.unixPermissions=null,tt.dosPermissions=null),tt}var Ni,Ce;function Ms(){if(Ce)return Ni;Ce=1;function t(){this.compressedSize=0,this.uncompressedSize=0,this.crc32=0,this.compressionMethod=null,this.compressedContent=null}return t.prototype={getContent:function(){return null},getCompressedContent:function(){return null}},Ni=t,Ni}var fi={},Ge;function aa(){if(Ge)return fi;Ge=1;for(var t=ot(),i=Yt(),e=se(),s=new Array(256),a=0;a<256;a++)s[a]=a>=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;s[254]=s[254]=1;var n=function(f){var o,l,c,u,d,g=f.length,M=0;for(u=0;u<g;u++)l=f.charCodeAt(u),(l&64512)===55296&&u+1<g&&(c=f.charCodeAt(u+1),(c&64512)===56320&&(l=65536+(l-55296<<10)+(c-56320),u++)),M+=l<128?1:l<2048?2:l<65536?3:4;for(i.uint8array?o=new Uint8Array(M):o=new Array(M),d=0,u=0;d<M;u++)l=f.charCodeAt(u),(l&64512)===55296&&u+1<g&&(c=f.charCodeAt(u+1),(c&64512)===56320&&(l=65536+(l-55296<<10)+(c-56320),u++)),l<128?o[d++]=l:l<2048?(o[d++]=192|l>>>6,o[d++]=128|l&63):l<65536?(o[d++]=224|l>>>12,o[d++]=128|l>>>6&63,o[d++]=128|l&63):(o[d++]=240|l>>>18,o[d++]=128|l>>>12&63,o[d++]=128|l>>>6&63,o[d++]=128|l&63);return o},h=function(f,o){var l;for(o=o||f.length,o>f.length&&(o=f.length),l=o-1;l>=0&&(f[l]&192)===128;)l--;return l<0||l===0?o:l+s[f[l]]>o?l:o},r=function(f){var o,l,c,u,d=f.length,g=new Array(d*2);for(l=0,o=0;o<d;){if(c=f[o++],c<128){g[l++]=c;continue}if(u=s[c],u>4){g[l++]=65533,o+=u-1;continue}for(c&=u===2?31:u===3?15:7;u>1&&o<d;)c=c<<6|f[o++]&63,u--;if(u>1){g[l++]=65533;continue}c<65536?g[l++]=c:(c-=65536,g[l++]=55296|c>>10&1023,g[l++]=56320|c&1023)}return g.length!==l&&(g.subarray?g=g.subarray(0,l):g.length=l),t.applyFromCharCode(g)};return fi.utf8encode=function(o){return i.nodebuffer?e(o,"utf-8"):n(o)},fi.utf8decode=function(o){if(i.nodebuffer)return t.transformTo("nodebuffer",o).toString("utf-8");o=t.transformTo(i.uint8array?"uint8array":"array",o);for(var l=[],c=0,u=o.length,d=65536;c<u;){var g=h(o,Math.min(c+d,u));i.uint8array?l.push(r(o.subarray(c,g))):l.push(r(o.slice(c,g))),c=g}return l.join("")},fi}var Di,Ie;function ra(){if(Ie)return Di;Ie=1;var t=ot(),i=function(){this.data=[]};return i.prototype={append:function(e){e=t.transformTo("string",e),this.data.push(e)},finalize:function(){return this.data.join("")}},Di=i,Di}var Ri,Ne;function na(){if(Ne)return Ri;Ne=1;var t=ot(),i=function(e){this.data=new Uint8Array(e),this.index=0};return i.prototype={append:function(e){e.length!==0&&(e=t.transformTo("uint8array",e),this.data.set(e,this.index),this.index+=e.length)},finalize:function(){return this.data}},Ri=i,Ri}var Bi,De;function ae(){if(De)return Bi;De=1;var t=Yt(),i=ot(),e=sa(),s=_s(),a=vs(),n=ie(),h=ee(),r=Ms(),f=se(),o=aa(),l=ra(),c=na(),u=function(_){if(_._data instanceof r&&(_._data=_._data.getContent(),_.options.binary=!0,_.options.base64=!1,i.getTypeOf(_._data)==="uint8array")){var y=_._data;_._data=new Uint8Array(y.length),y.length!==0&&_._data.set(y,0)}return _._data},d=function(_){var y=u(_),E=i.getTypeOf(y);return E==="string"?!_.options.binary&&t.nodebuffer?f(y,"utf-8"):_.asBinary():y},g=function(_){var y=u(this);return y===null||typeof y>"u"?"":(this.options.base64&&(y=n.decode(y)),_&&this.options.binary?y=z.utf8decode(y):y=i.transformTo("string",y),!_&&!this.options.binary&&(y=i.transformTo("string",z.utf8encode(y))),y)},M=function(_,y,E){this.name=_,this.dir=E.dir,this.date=E.date,this.comment=E.comment,this.unixPermissions=E.unixPermissions,this.dosPermissions=E.dosPermissions,this._data=y,this.options=E,this._initialMetadata={dir:E.dir,date:E.date}};M.prototype={asText:function(){return g.call(this,!0)},asBinary:function(){return g.call(this,!1)},asNodeBuffer:function(){var _=d(this);return i.transformTo("nodebuffer",_)},asUint8Array:function(){var _=d(this);return i.transformTo("uint8array",_)},asArrayBuffer:function(){return this.asUint8Array().buffer}};var v=function(_,y){var E="",A;for(A=0;A<y;A++)E+=String.fromCharCode(_&255),_=_>>>8;return E},S=function(){var _={},y,E;for(y=0;y<arguments.length;y++)for(E in arguments[y])arguments[y].hasOwnProperty(E)&&typeof _[E]>"u"&&(_[E]=arguments[y][E]);return _},p=function(_){return _=_||{},_.base64===!0&&(_.binary===null||_.binary===void 0)&&(_.binary=!0),_=S(_,a),_.date=_.date||new Date,_.compression!==null&&(_.compression=_.compression.toUpperCase()),_},P=function(_,y,E){var A=i.getTypeOf(y),C;if(E=p(E),typeof E.unixPermissions=="string"&&(E.unixPermissions=parseInt(E.unixPermissions,8)),E.unixPermissions&&E.unixPermissions&16384&&(E.dir=!0),E.dosPermissions&&E.dosPermissions&16&&(E.dir=!0),E.dir&&(_=b(_)),E.createFolders&&(C=G(_))&&I.call(this,C,!0),E.dir||y===null||typeof y>"u")E.base64=!1,E.binary=!1,y=null,A=null;else if(A==="string")E.binary&&!E.base64&&E.optimizedBinaryString!==!0&&(y=i.string2binary(y));else{if(E.base64=!1,E.binary=!0,!A&&!(y instanceof r))throw new Error("The data of '"+_+"' is in an unsupported format !");A==="arraybuffer"&&(y=i.transformTo("uint8array",y))}var N=new M(_,y,E);return this.files[_]=N,N},G=function(_){_.slice(-1)=="/"&&(_=_.substring(0,_.length-1));var y=_.lastIndexOf("/");return y>0?_.substring(0,y):""},b=function(_){return _.slice(-1)!="/"&&(_+="/"),_},I=function(_,y){return y=typeof y<"u"?y:!1,_=b(_),this.files[_]||P.call(this,_,null,{dir:!0,createFolders:y}),this.files[_]},B=function(_,y,E){var A=new r,C;return _._data instanceof r?(A.uncompressedSize=_._data.uncompressedSize,A.crc32=_._data.crc32,A.uncompressedSize===0||_.dir?(y=h.STORE,A.compressedContent="",A.crc32=0):_._data.compressionMethod===y.magic?A.compressedContent=_._data.getCompressedContent():(C=_._data.getContent(),A.compressedContent=y.compress(i.transformTo(y.compressInputType,C),E))):(C=d(_),(!C||C.length===0||_.dir)&&(y=h.STORE,C=""),A.uncompressedSize=C.length,A.crc32=e(C),A.compressedContent=y.compress(i.transformTo(y.compressInputType,C),E)),A.compressedSize=A.compressedContent.length,A.compressionMethod=y.magic,A},q=function(_,y){var E=_;return _||(E=y?16893:33204),(E&65535)<<16},U=function(_,y){return(_||0)&63},rt=function(_,y,E,A,C){E.compressedContent;var N=i.transformTo("string",o.utf8encode(y.name)),Tt=y.comment||"",ft=i.transformTo("string",o.utf8encode(Tt)),Et=N.length!==y.name.length,Ft=ft.length!==Tt.length,Lt=y.options,K,Q,lt="",ct="",dt="",nt,gt;y._initialMetadata.dir!==y.dir?nt=y.dir:nt=Lt.dir,y._initialMetadata.date!==y.date?gt=y.date:gt=Lt.date;var ri=0,Ci=0;nt&&(ri|=16),C==="UNIX"?(Ci=798,ri|=q(y.unixPermissions,nt)):(Ci=20,ri|=U(y.dosPermissions)),K=gt.getHours(),K=K<<6,K=K|gt.getMinutes(),K=K<<5,K=K|gt.getSeconds()/2,Q=gt.getFullYear()-1980,Q=Q<<4,Q=Q|gt.getMonth()+1,Q=Q<<5,Q=Q|gt.getDate(),Et&&(ct=v(1,1)+v(e(N),4)+N,lt+="up"+v(ct.length,2)+ct),Ft&&(dt=v(1,1)+v(this.crc32(ft),4)+ft,lt+="uc"+v(dt.length,2)+dt);var J="";J+=`
|
||
\0`,J+=Et||Ft?"\0\b":"\0\0",J+=E.compressionMethod,J+=v(K,2),J+=v(Q,2),J+=v(E.crc32,4),J+=v(E.compressedSize,4),J+=v(E.uncompressedSize,4),J+=v(N.length,2),J+=v(lt.length,2);var Ys=s.LOCAL_FILE_HEADER+J+N+lt,ta=s.CENTRAL_FILE_HEADER+v(Ci,2)+J+v(ft.length,2)+"\0\0\0\0"+v(ri,4)+v(A,4)+N+lt+ft;return{fileRecord:Ys,dirRecord:ta,compressedObject:E}},z={load:function(_,y){throw new Error("Load method is not defined. Is the file jszip-load.js included ?")},filter:function(_){var y=[],E,A,C,N;for(E in this.files)this.files.hasOwnProperty(E)&&(C=this.files[E],N=new M(C.name,C._data,S(C.options)),A=E.slice(this.root.length,E.length),E.slice(0,this.root.length)===this.root&&_(A,N)&&y.push(N));return y},file:function(_,y,E){if(arguments.length===1)if(i.isRegExp(_)){var A=_;return this.filter(function(C,N){return!N.dir&&A.test(C)})}else return this.filter(function(C,N){return!N.dir&&C===_})[0]||null;else _=this.root+_,P.call(this,_,y,E);return this},folder:function(_){if(!_)return this;if(i.isRegExp(_))return this.filter(function(C,N){return N.dir&&_.test(C)});var y=this.root+_,E=I.call(this,y),A=this.clone();return A.root=E.name,A},remove:function(_){_=this.root+_;var y=this.files[_];if(y||(_.slice(-1)!="/"&&(_+="/"),y=this.files[_]),y&&!y.dir)delete this.files[_];else for(var E=this.filter(function(C,N){return N.name.slice(0,_.length)===_}),A=0;A<E.length;A++)delete this.files[E[A].name];return this},generate:function(_){_=S(_||{},{base64:!0,compression:"STORE",compressionOptions:null,type:"base64",platform:"DOS",comment:null,mimeType:"application/zip"}),i.checkSupport(_.type),(_.platform==="darwin"||_.platform==="freebsd"||_.platform==="linux"||_.platform==="sunos")&&(_.platform="UNIX"),_.platform==="win32"&&(_.platform="DOS");var y=[],E=0,A=0,C,N,Tt=i.transformTo("string",this.utf8encode(_.comment||this.comment||""));for(var ft in this.files)if(this.files.hasOwnProperty(ft)){var Et=this.files[ft],Ft=Et.options.compression||_.compression.toUpperCase(),Lt=h[Ft];if(!Lt)throw new Error(Ft+" is not a valid compression method !");var K=Et.options.compressionOptions||_.compressionOptions||{},Q=B.call(this,Et,Lt,K),lt=rt.call(this,ft,Et,Q,E,_.platform);E+=lt.fileRecord.length+Q.compressedSize,A+=lt.dirRecord.length,y.push(lt)}var ct="";ct=s.CENTRAL_DIRECTORY_END+"\0\0\0\0"+v(y.length,2)+v(y.length,2)+v(A,4)+v(E,4)+v(Tt.length,2)+Tt;var dt=_.type.toLowerCase();for(dt==="uint8array"||dt==="arraybuffer"||dt==="blob"||dt==="nodebuffer"?C=new c(E+A+ct.length):C=new l(E+A+ct.length),N=0;N<y.length;N++)C.append(y[N].fileRecord),C.append(y[N].compressedObject.compressedContent);for(N=0;N<y.length;N++)C.append(y[N].dirRecord);C.append(ct);var nt=C.finalize();switch(_.type.toLowerCase()){case"uint8array":case"arraybuffer":case"nodebuffer":return i.transformTo(_.type.toLowerCase(),nt);case"blob":return i.arrayBuffer2Blob(i.transformTo("arraybuffer",nt),_.mimeType);case"base64":return _.base64?n.encode(nt):nt;default:return nt}},crc32:function(_,y){return e(_,y)},utf8encode:function(_){return i.transformTo("string",o.utf8encode(_))},utf8decode:function(_){return o.utf8decode(_)}};return Bi=z,Bi}var Oi,Re;function ys(){if(Re)return Oi;Re=1;var t=ot();function i(e){this.data=null,this.length=0,this.index=0}return i.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length<e||e<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+e+"). Corrupted zip ?")},setIndex:function(e){this.checkIndex(e),this.index=e},skip:function(e){this.setIndex(this.index+e)},byteAt:function(e){},readInt:function(e){var s=0,a;for(this.checkOffset(e),a=this.index+e-1;a>=this.index;a--)s=(s<<8)+this.byteAt(a);return this.index+=e,s},readString:function(e){return t.transformTo("string",this.readData(e))},readData:function(e){},lastIndexOfSignature:function(e){},readDate:function(){var e=this.readInt(4);return new Date((e>>25&127)+1980,(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(e&31)<<1)}},Oi=i,Oi}var Ti,Be;function ms(){if(Be)return Ti;Be=1;var t=ys(),i=ot();function e(s,a){this.data=s,a||(this.data=i.string2binary(this.data)),this.length=this.data.length,this.index=0}return e.prototype=new t,e.prototype.byteAt=function(s){return this.data.charCodeAt(s)},e.prototype.lastIndexOfSignature=function(s){return this.data.lastIndexOf(s)},e.prototype.readData=function(s){this.checkOffset(s);var a=this.data.slice(this.index,this.index+s);return this.index+=s,a},Ti=e,Ti}var Fi,Oe;function xs(){if(Oe)return Fi;Oe=1;var t=ys();function i(e){e&&(this.data=e,this.length=this.data.length,this.index=0)}return i.prototype=new t,i.prototype.byteAt=function(e){return this.data[e]},i.prototype.lastIndexOfSignature=function(e){for(var s=e.charCodeAt(0),a=e.charCodeAt(1),n=e.charCodeAt(2),h=e.charCodeAt(3),r=this.length-4;r>=0;--r)if(this.data[r]===s&&this.data[r+1]===a&&this.data[r+2]===n&&this.data[r+3]===h)return r;return-1},i.prototype.readData=function(e){if(this.checkOffset(e),e===0)return new Uint8Array(0);var s=this.data.subarray(this.index,this.index+e);return this.index+=e,s},Fi=i,Fi}var Li,Te;function ha(){if(Te)return Li;Te=1;var t=xs();function i(e){this.data=e,this.length=this.data.length,this.index=0}return i.prototype=new t,i.prototype.readData=function(e){this.checkOffset(e);var s=this.data.slice(this.index,this.index+e);return this.index+=e,s},Li=i,Li}var Ui,Fe;function oa(){if(Fe)return Ui;Fe=1;var t=ms(),i=ot(),e=Ms(),s=ae(),a=0,n=3;function h(r,f){this.options=r,this.loadOptions=f}return h.prototype={isEncrypted:function(){return(this.bitFlag&1)===1},useUTF8:function(){return(this.bitFlag&2048)===2048},prepareCompressedContent:function(r,f,o){return function(){var l=r.index;r.setIndex(f);var c=r.readData(o);return r.setIndex(l),c}},prepareContent:function(r,f,o,l,c){return function(){var u=i.transformTo(l.uncompressInputType,this.getCompressedContent()),d=l.uncompress(u);if(d.length!==c)throw new Error("Bug : uncompressed data size mismatch");return d}},readLocalPart:function(r){var f,o;if(r.skip(22),this.fileNameLength=r.readInt(2),o=r.readInt(2),this.fileName=r.readString(this.fileNameLength),r.skip(o),this.compressedSize==-1||this.uncompressedSize==-1)throw new Error("Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize == -1 || uncompressedSize == -1)");if(f=i.findCompression(this.compressionMethod),f===null)throw new Error("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+this.fileName+")");if(this.decompressed=new e,this.decompressed.compressedSize=this.compressedSize,this.decompressed.uncompressedSize=this.uncompressedSize,this.decompressed.crc32=this.crc32,this.decompressed.compressionMethod=this.compressionMethod,this.decompressed.getCompressedContent=this.prepareCompressedContent(r,r.index,this.compressedSize,f),this.decompressed.getContent=this.prepareContent(r,r.index,this.compressedSize,f,this.uncompressedSize),this.loadOptions.checkCRC32&&(this.decompressed=i.transformTo("string",this.decompressed.getContent()),s.crc32(this.decompressed)!==this.crc32))throw new Error("Corrupted zip : CRC32 mismatch")},readCentralPart:function(r){if(this.versionMadeBy=r.readInt(2),this.versionNeeded=r.readInt(2),this.bitFlag=r.readInt(2),this.compressionMethod=r.readString(2),this.date=r.readDate(),this.crc32=r.readInt(4),this.compressedSize=r.readInt(4),this.uncompressedSize=r.readInt(4),this.fileNameLength=r.readInt(2),this.extraFieldsLength=r.readInt(2),this.fileCommentLength=r.readInt(2),this.diskNumberStart=r.readInt(2),this.internalFileAttributes=r.readInt(2),this.externalFileAttributes=r.readInt(4),this.localHeaderOffset=r.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");this.fileName=r.readString(this.fileNameLength),this.readExtraFields(r),this.parseZIP64ExtraField(r),this.fileComment=r.readString(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var r=this.versionMadeBy>>8;this.dir=!!(this.externalFileAttributes&16),r===a&&(this.dosPermissions=this.externalFileAttributes&63),r===n&&(this.unixPermissions=this.externalFileAttributes>>16&65535),!this.dir&&this.fileName.slice(-1)==="/"&&(this.dir=!0)},parseZIP64ExtraField:function(r){if(this.extraFields[1]){var f=new t(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=f.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=f.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=f.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=f.readInt(4))}},readExtraFields:function(r){var f=r.index,o,l,c;for(this.extraFields=this.extraFields||{};r.index<f+this.extraFieldsLength;)o=r.readInt(2),l=r.readInt(2),c=r.readString(l),this.extraFields[o]={id:o,length:l,value:c}},handleUTF8:function(){if(this.useUTF8())this.fileName=s.utf8decode(this.fileName),this.fileComment=s.utf8decode(this.fileComment);else{var r=this.findExtraFieldUnicodePath();r!==null&&(this.fileName=r);var f=this.findExtraFieldUnicodeComment();f!==null&&(this.fileComment=f)}},findExtraFieldUnicodePath:function(){var r=this.extraFields[28789];if(r){var f=new t(r.value);return f.readInt(1)!==1||s.crc32(this.fileName)!==f.readInt(4)?null:s.utf8decode(f.readString(r.length-5))}return null},findExtraFieldUnicodeComment:function(){var r=this.extraFields[25461];if(r){var f=new t(r.value);return f.readInt(1)!==1||s.crc32(this.fileComment)!==f.readInt(4)?null:s.utf8decode(f.readString(r.length-5))}return null}},Ui=h,Ui}var qi,Le;function fa(){if(Le)return qi;Le=1;var t=ms(),i=ha(),e=xs(),s=ot(),a=_s(),n=oa(),h=Yt(),r=ae();function f(o,l){this.files=[],this.loadOptions=l,o&&this.load(o)}return f.prototype={checkSignature:function(o){var l=this.reader.readString(4);if(l!==o)throw new Error("Corrupted zip or bug : unexpected signature ("+s.pretty(l)+", expected "+s.pretty(o)+")")},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2),this.zipComment=this.reader.readString(this.zipCommentLength),this.zipComment=r.utf8decode(this.zipComment)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.versionMadeBy=this.reader.readString(2),this.versionNeeded=this.reader.readInt(2),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var o=this.zip64EndOfCentralSize-44,l=0,c,u,d;l<o;)c=this.reader.readInt(2),u=this.reader.readInt(4),d=this.reader.readString(u),this.zip64ExtensibleData[c]={id:c,length:u,value:d}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var o,l;for(o=0;o<this.files.length;o++)l=this.files[o],this.reader.setIndex(l.localHeaderOffset),this.checkSignature(a.LOCAL_FILE_HEADER),l.readLocalPart(this.reader),l.handleUTF8(),l.processAttributes()},readCentralDir:function(){var o;for(this.reader.setIndex(this.centralDirOffset);this.reader.readString(4)===a.CENTRAL_FILE_HEADER;)o=new n({zip64:this.zip64},this.loadOptions),o.readCentralPart(this.reader),this.files.push(o)},readEndOfCentral:function(){var o=this.reader.lastIndexOfSignature(a.CENTRAL_DIRECTORY_END);if(o===-1){var l=!0;try{this.reader.setIndex(0),this.checkSignature(a.LOCAL_FILE_HEADER),l=!1}catch{}throw l?new Error("Can't find end of central directory : is this a zip file ? If it is, see http://stuk.github.io/jszip/documentation/howto/read_zip.html"):new Error("Corrupted zip : can't find end of central directory")}if(this.reader.setIndex(o),this.checkSignature(a.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===s.MAX_VALUE_16BITS||this.diskWithCentralDirStart===s.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===s.MAX_VALUE_16BITS||this.centralDirRecords===s.MAX_VALUE_16BITS||this.centralDirSize===s.MAX_VALUE_32BITS||this.centralDirOffset===s.MAX_VALUE_32BITS){if(this.zip64=!0,o=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR),o===-1)throw new Error("Corrupted zip : can't find the ZIP64 end of central directory locator");this.reader.setIndex(o),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}},prepareReader:function(o){var l=s.getTypeOf(o);l==="string"&&!h.uint8array?this.reader=new t(o,this.loadOptions.optimizedBinaryString):l==="nodebuffer"?this.reader=new i(o):this.reader=new e(s.transformTo("uint8array",o))},load:function(o){this.prepareReader(o),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},qi=f,qi}var ki,Ue;function la(){if(Ue)return ki;Ue=1;var t=ie(),i=fa();return ki=function(e,s){var a,n,h,r;for(s=s||{},s.base64&&(e=t.decode(e)),n=new i(e,s),a=n.files,h=0;h<a.length;h++)r=a[h],this.file(r.fileName,r.decompressed,{binary:!0,optimizedBinaryString:!0,date:r.date,dir:r.dir,comment:r.fileComment.length?r.fileComment:null,unixPermissions:r.unixPermissions,dosPermissions:r.dosPermissions,createFolders:s.createFolders});return n.zipComment.length&&(this.comment=n.zipComment),this},ki}var $={},qe;function ua(){if(qe)return $;qe=1;var t=ot();return $.string2binary=function(i){return t.string2binary(i)},$.string2Uint8Array=function(i){return t.transformTo("uint8array",i)},$.uint8Array2String=function(i){return t.transformTo("string",i)},$.string2Blob=function(i){var e=t.transformTo("arraybuffer",i);return t.arrayBuffer2Blob(e)},$.arrayBuffer2Blob=function(i){return t.arrayBuffer2Blob(i)},$.transformTo=function(i,e){return t.transformTo(i,e)},$.getTypeOf=function(i){return t.getTypeOf(i)},$.checkSupport=function(i){return t.checkSupport(i)},$.MAX_VALUE_16BITS=t.MAX_VALUE_16BITS,$.MAX_VALUE_32BITS=t.MAX_VALUE_32BITS,$.pretty=function(i){return t.pretty(i)},$.findCompression=function(i){return t.findCompression(i)},$.isRegExp=function(i){return t.isRegExp(i)},$}var zi,ke;function F0(){if(ke)return zi;ke=1;var t=ie();function i(e,s){if(!(this instanceof i))return new i(e,s);this.files={},this.comment=null,this.root="",e&&this.load(e,s),this.clone=function(){var a=new i;for(var n in this)typeof this[n]!="function"&&(a[n]=this[n]);return a}}return i.prototype=ae(),i.prototype.load=la(),i.support=Yt(),i.defaults=vs(),i.utils=ua(),i.base64={encode:function(e){return t.encode(e)},decode:function(e){return t.decode(e)}},i.compressions=ee(),zi=i,zi}function ca(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs");for(var i=1;i<=60;++i)t("EPSG:"+(32600+i),"+proj=utm +zone="+i+" +datum=WGS84 +units=m"),t("EPSG:"+(32700+i),"+proj=utm +zone="+i+" +south +datum=WGS84 +units=m");t("EPSG:5041","+title=WGS 84 / UPS North (E,N) +proj=stere +lat_0=90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"),t("EPSG:5042","+title=WGS 84 / UPS South (E,N) +proj=stere +lat_0=-90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}var pt=1,Pt=2,Nt=3,da=4,Xi=5,ze=6378137,ga=6356752314e-3,je=.0066943799901413165,jt=484813681109536e-20,m=Math.PI/2,_a=.16666666666666666,va=.04722222222222222,Ma=.022156084656084655,x=1e-10,T=.017453292519943295,X=57.29577951308232,D=Math.PI/4,Xt=Math.PI*2,F=3.14159265359,Z={};Z.greenwich=0;Z.lisbon=-9.131906111111;Z.paris=2.337229166667;Z.bogota=-74.080916666667;Z.madrid=-3.687938888889;Z.rome=12.452333333333;Z.bern=7.439583333333;Z.jakarta=106.807719444444;Z.ferro=-17.666666666667;Z.brussels=4.367975;Z.stockholm=18.058277777778;Z.athens=23.7163375;Z.oslo=10.722916666667;const ya={mm:{to_meter:.001},cm:{to_meter:.01},ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937},fath:{to_meter:1.8288},kmi:{to_meter:1852},"us-ch":{to_meter:20.1168402336805},"us-mi":{to_meter:1609.34721869444},km:{to_meter:1e3},"ind-ft":{to_meter:.30479841},"ind-yd":{to_meter:.91439523},mi:{to_meter:1609.344},yd:{to_meter:.9144},ch:{to_meter:20.1168},link:{to_meter:.201168},dm:{to_meter:.1},in:{to_meter:.0254},"ind-ch":{to_meter:20.11669506},"us-in":{to_meter:.025400050800101},"us-yd":{to_meter:.914401828803658}};var $e=/[\s_\-\/\(\)]/g;function yt(t,i){if(t[i])return t[i];for(var e=Object.keys(t),s=i.toLowerCase().replace($e,""),a=-1,n,h;++a<e.length;)if(n=e[a],h=n.toLowerCase().replace($e,""),h===s)return t[n]}function Zi(t){var i={},e=t.split("+").map(function(r){return r.trim()}).filter(function(r){return r}).reduce(function(r,f){var o=f.split("=");return o.push(!0),r[o[0].toLowerCase()]=o[1],r},{}),s,a,n,h={proj:"projName",datum:"datumCode",rf:function(r){i.rf=parseFloat(r)},lat_0:function(r){i.lat0=r*T},lat_1:function(r){i.lat1=r*T},lat_2:function(r){i.lat2=r*T},lat_ts:function(r){i.lat_ts=r*T},lon_0:function(r){i.long0=r*T},lon_1:function(r){i.long1=r*T},lon_2:function(r){i.long2=r*T},alpha:function(r){i.alpha=parseFloat(r)*T},gamma:function(r){i.rectified_grid_angle=parseFloat(r)*T},lonc:function(r){i.longc=r*T},x_0:function(r){i.x0=parseFloat(r)},y_0:function(r){i.y0=parseFloat(r)},k_0:function(r){i.k0=parseFloat(r)},k:function(r){i.k0=parseFloat(r)},a:function(r){i.a=parseFloat(r)},b:function(r){i.b=parseFloat(r)},r:function(r){i.a=i.b=parseFloat(r)},r_a:function(){i.R_A=!0},zone:function(r){i.zone=parseInt(r,10)},south:function(){i.utmSouth=!0},towgs84:function(r){i.datum_params=r.split(",").map(function(f){return parseFloat(f)})},to_meter:function(r){i.to_meter=parseFloat(r)},units:function(r){i.units=r;var f=yt(ya,r);f&&(i.to_meter=f.to_meter)},from_greenwich:function(r){i.from_greenwich=r*T},pm:function(r){var f=yt(Z,r);i.from_greenwich=(f||parseFloat(r))*T},nadgrids:function(r){r==="@null"?i.datumCode="none":i.nadgrids=r},axis:function(r){var f="ewnsud";r.length===3&&f.indexOf(r.substr(0,1))!==-1&&f.indexOf(r.substr(1,1))!==-1&&f.indexOf(r.substr(2,1))!==-1&&(i.axis=r)},approx:function(){i.approx=!0},over:function(){i.over=!0}};for(s in e)a=e[s],s in h?(n=h[s],typeof n=="function"?n(a):i[n]=a):i[s]=a;return typeof i.datumCode=="string"&&i.datumCode!=="WGS84"&&(i.datumCode=i.datumCode.toLowerCase()),i.projStr=t,i}class Es{static getId(i){const e=i.find(s=>Array.isArray(s)&&s[0]==="ID");return e&&e.length>=3?{authority:e[1],code:parseInt(e[2],10)}:null}static convertUnit(i,e="unit"){if(!i||i.length<3)return{type:e,name:"unknown",conversion_factor:null};const s=i[1],a=parseFloat(i[2])||null,n=i.find(r=>Array.isArray(r)&&r[0]==="ID"),h=n?{authority:n[1],code:parseInt(n[2],10)}:null;return{type:e,name:s,conversion_factor:a,id:h}}static convertAxis(i){const e=i[1]||"Unknown";let s;const a=e.match(/^\((.)\)$/);if(a){const o=a[1].toUpperCase();if(o==="E")s="east";else if(o==="N")s="north";else if(o==="U")s="up";else throw new Error(`Unknown axis abbreviation: ${o}`)}else s=i[2]?i[2].toLowerCase():"unknown";const n=i.find(o=>Array.isArray(o)&&o[0]==="ORDER"),h=n?parseInt(n[1],10):null,r=i.find(o=>Array.isArray(o)&&(o[0]==="LENGTHUNIT"||o[0]==="ANGLEUNIT"||o[0]==="SCALEUNIT")),f=this.convertUnit(r);return{name:e,direction:s,unit:f,order:h}}static extractAxes(i){return i.filter(e=>Array.isArray(e)&&e[0]==="AXIS").map(e=>this.convertAxis(e)).sort((e,s)=>(e.order||0)-(s.order||0))}static convert(i,e={}){switch(i[0]){case"PROJCRS":e.type="ProjectedCRS",e.name=i[1],e.base_crs=i.find(u=>Array.isArray(u)&&u[0]==="BASEGEOGCRS")?this.convert(i.find(u=>Array.isArray(u)&&u[0]==="BASEGEOGCRS")):null,e.conversion=i.find(u=>Array.isArray(u)&&u[0]==="CONVERSION")?this.convert(i.find(u=>Array.isArray(u)&&u[0]==="CONVERSION")):null;const s=i.find(u=>Array.isArray(u)&&u[0]==="CS");s&&(e.coordinate_system={type:s[1],axis:this.extractAxes(i)});const a=i.find(u=>Array.isArray(u)&&u[0]==="LENGTHUNIT");if(a){const u=this.convertUnit(a);e.coordinate_system.unit=u}e.id=this.getId(i);break;case"BASEGEOGCRS":case"GEOGCRS":e.type="GeographicCRS",e.name=i[1];const n=i.find(u=>Array.isArray(u)&&(u[0]==="DATUM"||u[0]==="ENSEMBLE"));if(n){const u=this.convert(n);n[0]==="ENSEMBLE"?e.datum_ensemble=u:e.datum=u;const d=i.find(g=>Array.isArray(g)&&g[0]==="PRIMEM");d&&d[1]!=="Greenwich"&&(u.prime_meridian={name:d[1],longitude:parseFloat(d[2])})}e.coordinate_system={type:"ellipsoidal",axis:this.extractAxes(i)},e.id=this.getId(i);break;case"DATUM":e.type="GeodeticReferenceFrame",e.name=i[1],e.ellipsoid=i.find(u=>Array.isArray(u)&&u[0]==="ELLIPSOID")?this.convert(i.find(u=>Array.isArray(u)&&u[0]==="ELLIPSOID")):null;break;case"ENSEMBLE":e.type="DatumEnsemble",e.name=i[1],e.members=i.filter(u=>Array.isArray(u)&&u[0]==="MEMBER").map(u=>({type:"DatumEnsembleMember",name:u[1],id:this.getId(u)}));const h=i.find(u=>Array.isArray(u)&&u[0]==="ENSEMBLEACCURACY");h&&(e.accuracy=parseFloat(h[1]));const r=i.find(u=>Array.isArray(u)&&u[0]==="ELLIPSOID");r&&(e.ellipsoid=this.convert(r)),e.id=this.getId(i);break;case"ELLIPSOID":e.type="Ellipsoid",e.name=i[1],e.semi_major_axis=parseFloat(i[2]),e.inverse_flattening=parseFloat(i[3]),i.find(u=>Array.isArray(u)&&u[0]==="LENGTHUNIT")&&this.convert(i.find(u=>Array.isArray(u)&&u[0]==="LENGTHUNIT"),e);break;case"CONVERSION":e.type="Conversion",e.name=i[1],e.method=i.find(u=>Array.isArray(u)&&u[0]==="METHOD")?this.convert(i.find(u=>Array.isArray(u)&&u[0]==="METHOD")):null,e.parameters=i.filter(u=>Array.isArray(u)&&u[0]==="PARAMETER").map(u=>this.convert(u));break;case"METHOD":e.type="Method",e.name=i[1],e.id=this.getId(i);break;case"PARAMETER":e.type="Parameter",e.name=i[1],e.value=parseFloat(i[2]),e.unit=this.convertUnit(i.find(u=>Array.isArray(u)&&(u[0]==="LENGTHUNIT"||u[0]==="ANGLEUNIT"||u[0]==="SCALEUNIT"))),e.id=this.getId(i);break;case"BOUNDCRS":e.type="BoundCRS";const f=i.find(u=>Array.isArray(u)&&u[0]==="SOURCECRS");if(f){const u=f.find(d=>Array.isArray(d));e.source_crs=u?this.convert(u):null}const o=i.find(u=>Array.isArray(u)&&u[0]==="TARGETCRS");if(o){const u=o.find(d=>Array.isArray(d));e.target_crs=u?this.convert(u):null}const l=i.find(u=>Array.isArray(u)&&u[0]==="ABRIDGEDTRANSFORMATION");l?e.transformation=this.convert(l):e.transformation=null;break;case"ABRIDGEDTRANSFORMATION":if(e.type="Transformation",e.name=i[1],e.method=i.find(u=>Array.isArray(u)&&u[0]==="METHOD")?this.convert(i.find(u=>Array.isArray(u)&&u[0]==="METHOD")):null,e.parameters=i.filter(u=>Array.isArray(u)&&(u[0]==="PARAMETER"||u[0]==="PARAMETERFILE")).map(u=>{if(u[0]==="PARAMETER")return this.convert(u);if(u[0]==="PARAMETERFILE")return{name:u[1],value:u[2],id:{authority:"EPSG",code:8656}}}),e.parameters.length===7){const u=e.parameters[6];u.name==="Scale difference"&&(u.value=Math.round((u.value-1)*1e12)/1e6)}e.id=this.getId(i);break;case"AXIS":e.coordinate_system||(e.coordinate_system={type:"unspecified",axis:[]}),e.coordinate_system.axis.push(this.convertAxis(i));break;case"LENGTHUNIT":const c=this.convertUnit(i,"LinearUnit");e.coordinate_system&&e.coordinate_system.axis&&e.coordinate_system.axis.forEach(u=>{u.unit||(u.unit=c)}),c.conversion_factor&&c.conversion_factor!==1&&e.semi_major_axis&&(e.semi_major_axis={value:e.semi_major_axis,unit:c});break;default:e.keyword=i[0];break}return e}}class ma extends Es{static convert(i,e={}){return super.convert(i,e),e.coordinate_system&&e.coordinate_system.subtype==="Cartesian"&&delete e.coordinate_system,e.usage&&delete e.usage,e}}class xa extends Es{static convert(i,e={}){super.convert(i,e);const s=i.find(n=>Array.isArray(n)&&n[0]==="CS");s&&(e.coordinate_system={subtype:s[1],axis:this.extractAxes(i)});const a=i.find(n=>Array.isArray(n)&&n[0]==="USAGE");if(a){const n=a.find(f=>Array.isArray(f)&&f[0]==="SCOPE"),h=a.find(f=>Array.isArray(f)&&f[0]==="AREA"),r=a.find(f=>Array.isArray(f)&&f[0]==="BBOX");e.usage={},n&&(e.usage.scope=n[1]),h&&(e.usage.area=h[1]),r&&(e.usage.bbox=r.slice(1))}return e}}function Ea(t){return t.find(i=>Array.isArray(i)&&i[0]==="USAGE")?"2019":(t.find(i=>Array.isArray(i)&&i[0]==="CS")||t[0]==="BOUNDCRS"||t[0]==="PROJCRS"||t[0]==="GEOGCRS","2015")}function wa(t){return(Ea(t)==="2019"?xa:ma).convert(t)}function Sa(t){const i=t.toUpperCase();return i.includes("PROJCRS")||i.includes("GEOGCRS")||i.includes("BOUNDCRS")||i.includes("VERTCRS")||i.includes("LENGTHUNIT")||i.includes("ANGLEUNIT")||i.includes("SCALEUNIT")?"WKT2":(i.includes("PROJCS")||i.includes("GEOGCS")||i.includes("LOCAL_CS")||i.includes("VERT_CS")||i.includes("UNIT"),"WKT1")}var Zt=1,ws=2,Ss=3,Mi=4,ps=5,re=-1,pa=/\s/,Pa=/[A-Za-z]/,Aa=/[A-Za-z84_]/,Pi=/[,\]]/,Ps=/[\d\.E\-\+]/;function ut(t){if(typeof t!="string")throw new Error("not a string");this.text=t.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=Zt}ut.prototype.readCharicter=function(){var t=this.text[this.place++];if(this.state!==Mi)for(;pa.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++]}switch(this.state){case Zt:return this.neutral(t);case ws:return this.keyword(t);case Mi:return this.quoted(t);case ps:return this.afterquote(t);case Ss:return this.number(t);case re:return}};ut.prototype.afterquote=function(t){if(t==='"'){this.word+='"',this.state=Mi;return}if(Pi.test(t)){this.word=this.word.trim(),this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in afterquote yet, index '+this.place)};ut.prototype.afterItem=function(t){if(t===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=Zt;return}if(t==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=Zt,this.currentObject=this.stack.pop(),this.currentObject||(this.state=re);return}};ut.prototype.number=function(t){if(Ps.test(t)){this.word+=t;return}if(Pi.test(t)){this.word=parseFloat(this.word),this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in number yet, index '+this.place)};ut.prototype.quoted=function(t){if(t==='"'){this.state=ps;return}this.word+=t};ut.prototype.keyword=function(t){if(Aa.test(t)){this.word+=t;return}if(t==="["){var i=[];i.push(this.word),this.level++,this.root===null?this.root=i:this.currentObject.push(i),this.stack.push(this.currentObject),this.currentObject=i,this.state=Zt;return}if(Pi.test(t)){this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in keyword yet, index '+this.place)};ut.prototype.neutral=function(t){if(Pa.test(t)){this.word=t,this.state=ws;return}if(t==='"'){this.word="",this.state=Mi;return}if(Ps.test(t)){this.word=t,this.state=Ss;return}if(Pi.test(t)){this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in neutral yet, index '+this.place)};ut.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===re)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function ba(t){var i=new ut(t);return i.output()}function ji(t,i,e){Array.isArray(i)&&(e.unshift(i),i=null);var s=i?{}:t,a=e.reduce(function(n,h){return bt(h,n),n},s);i&&(t[i]=a)}function bt(t,i){if(!Array.isArray(t)){i[t]=!0;return}var e=t.shift();if(e==="PARAMETER"&&(e=t.shift()),t.length===1){if(Array.isArray(t[0])){i[e]={},bt(t[0],i[e]);return}i[e]=t[0];return}if(!t.length){i[e]=!0;return}if(e==="TOWGS84"){i[e]=t;return}if(e==="AXIS"){e in i||(i[e]=[]),i[e].push(t);return}Array.isArray(e)||(i[e]={});var s;switch(e){case"UNIT":case"PRIMEM":case"VERT_DATUM":i[e]={name:t[0].toLowerCase(),convert:t[1]},t.length===3&&bt(t[2],i[e]);return;case"SPHEROID":case"ELLIPSOID":i[e]={name:t[0],a:t[1],rf:t[2]},t.length===4&&bt(t[3],i[e]);return;case"EDATUM":case"ENGINEERINGDATUM":case"LOCAL_DATUM":case"DATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":t[0]=["name",t[0]],ji(i,e,t);return;case"COMPD_CS":case"COMPOUNDCRS":case"FITTED_CS":case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"ENGCRS":case"ENGINEERINGCRS":t[0]=["name",t[0]],ji(i,e,t),i[e].type=e;return;default:for(s=-1;++s<t.length;)if(!Array.isArray(t[s]))return bt(t,i[e]);return ji(i,e,t)}}var Ca=.017453292519943295;function st(t){return t*Ca}function As(t){const i=(t.projName||"").toLowerCase().replace(/_/g," ");!t.long0&&t.longc&&(i==="albers conic equal area"||i==="lambert azimuthal equal area")&&(t.long0=t.longc),!t.lat_ts&&t.lat1&&(i==="stereographic south pole"||i==="polar stereographic (variant b)")?(t.lat0=st(t.lat1>0?90:-90),t.lat_ts=t.lat1,delete t.lat1):!t.lat_ts&&t.lat0&&(i==="polar stereographic"||i==="polar stereographic (variant a)")&&(t.lat_ts=t.lat0,t.lat0=st(t.lat0>0?90:-90),delete t.lat1)}function We(t){let i={units:null,to_meter:void 0};return typeof t=="string"?(i.units=t.toLowerCase(),i.units==="metre"&&(i.units="meter"),i.units==="meter"&&(i.to_meter=1)):t&&t.name&&(i.units=t.name.toLowerCase(),i.units==="metre"&&(i.units="meter"),i.to_meter=t.conversion_factor),i}function He(t){return typeof t=="object"?t.value*t.unit.conversion_factor:t}function Ve(t,i){t.ellipsoid.radius?(i.a=t.ellipsoid.radius,i.rf=0):(i.a=He(t.ellipsoid.semi_major_axis),t.ellipsoid.inverse_flattening!==void 0?i.rf=t.ellipsoid.inverse_flattening:t.ellipsoid.semi_major_axis!==void 0&&t.ellipsoid.semi_minor_axis!==void 0&&(i.rf=i.a/(i.a-He(t.ellipsoid.semi_minor_axis))))}function yi(t,i={}){return!t||typeof t!="object"?t:t.type==="BoundCRS"?(yi(t.source_crs,i),t.transformation&&(t.transformation.method&&t.transformation.method.name==="NTv2"?i.nadgrids=t.transformation.parameters[0].value:i.datum_params=t.transformation.parameters.map(e=>e.value)),i):(Object.keys(t).forEach(e=>{const s=t[e];if(s!==null)switch(e){case"name":if(i.srsCode)break;i.name=s,i.srsCode=s;break;case"type":s==="GeographicCRS"?i.projName="longlat":s==="ProjectedCRS"&&t.conversion&&t.conversion.method&&(i.projName=t.conversion.method.name);break;case"datum":case"datum_ensemble":s.ellipsoid&&(i.ellps=s.ellipsoid.name,Ve(s,i)),s.prime_meridian&&(i.from_greenwich=s.prime_meridian.longitude*Math.PI/180);break;case"ellipsoid":i.ellps=s.name,Ve(s,i);break;case"prime_meridian":i.long0=(s.longitude||0)*Math.PI/180;break;case"coordinate_system":if(s.axis){if(i.axis=s.axis.map(a=>{const n=a.direction;if(n==="east")return"e";if(n==="north")return"n";if(n==="west")return"w";if(n==="south")return"s";throw new Error(`Unknown axis direction: ${n}`)}).join("")+"u",s.unit){const{units:a,to_meter:n}=We(s.unit);i.units=a,i.to_meter=n}else if(s.axis[0]&&s.axis[0].unit){const{units:a,to_meter:n}=We(s.axis[0].unit);i.units=a,i.to_meter=n}}break;case"id":s.authority&&s.code&&(i.title=s.authority+":"+s.code);break;case"conversion":s.method&&s.method.name&&(i.projName=s.method.name),s.parameters&&s.parameters.forEach(a=>{const n=a.name.toLowerCase().replace(/\s+/g,"_"),h=a.value;a.unit&&a.unit.conversion_factor?i[n]=h*a.unit.conversion_factor:a.unit==="degree"?i[n]=h*Math.PI/180:i[n]=h});break;case"unit":s.name&&(i.units=s.name.toLowerCase(),i.units==="metre"&&(i.units="meter")),s.conversion_factor&&(i.to_meter=s.conversion_factor);break;case"base_crs":yi(s,i),i.datumCode=s.id?s.id.authority+"_"+s.id.code:s.name;break}}),i.latitude_of_false_origin!==void 0&&(i.lat0=i.latitude_of_false_origin),i.longitude_of_false_origin!==void 0&&(i.long0=i.longitude_of_false_origin),i.latitude_of_standard_parallel!==void 0&&(i.lat0=i.latitude_of_standard_parallel,i.lat1=i.latitude_of_standard_parallel),i.latitude_of_1st_standard_parallel!==void 0&&(i.lat1=i.latitude_of_1st_standard_parallel),i.latitude_of_2nd_standard_parallel!==void 0&&(i.lat2=i.latitude_of_2nd_standard_parallel),i.latitude_of_projection_centre!==void 0&&(i.lat0=i.latitude_of_projection_centre),i.longitude_of_projection_centre!==void 0&&(i.longc=i.longitude_of_projection_centre),i.easting_at_false_origin!==void 0&&(i.x0=i.easting_at_false_origin),i.northing_at_false_origin!==void 0&&(i.y0=i.northing_at_false_origin),i.latitude_of_natural_origin!==void 0&&(i.lat0=i.latitude_of_natural_origin),i.longitude_of_natural_origin!==void 0&&(i.long0=i.longitude_of_natural_origin),i.longitude_of_origin!==void 0&&(i.long0=i.longitude_of_origin),i.false_easting!==void 0&&(i.x0=i.false_easting),i.easting_at_projection_centre&&(i.x0=i.easting_at_projection_centre),i.false_northing!==void 0&&(i.y0=i.false_northing),i.northing_at_projection_centre&&(i.y0=i.northing_at_projection_centre),i.standard_parallel_1!==void 0&&(i.lat1=i.standard_parallel_1),i.standard_parallel_2!==void 0&&(i.lat2=i.standard_parallel_2),i.scale_factor_at_natural_origin!==void 0&&(i.k0=i.scale_factor_at_natural_origin),i.scale_factor_at_projection_centre!==void 0&&(i.k0=i.scale_factor_at_projection_centre),i.scale_factor_on_pseudo_standard_parallel!==void 0&&(i.k0=i.scale_factor_on_pseudo_standard_parallel),i.azimuth!==void 0&&(i.alpha=i.azimuth),i.azimuth_at_projection_centre!==void 0&&(i.alpha=i.azimuth_at_projection_centre),i.angle_from_rectified_to_skew_grid&&(i.rectified_grid_angle=i.angle_from_rectified_to_skew_grid),As(i),i)}var Ga=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function Ia(t,i){var e=i[0],s=i[1];!(e in t)&&s in t&&(t[e]=t[s],i.length===3&&(t[e]=i[2](t[e])))}function bs(t){for(var i=Object.keys(t),e=0,s=i.length;e<s;++e){var a=i[e];Ga.indexOf(a)!==-1&&Na(t[a]),typeof t[a]=="object"&&bs(t[a])}}function Na(t){if(t.AUTHORITY){var i=Object.keys(t.AUTHORITY)[0];i&&i in t.AUTHORITY&&(t.title=i+":"+t.AUTHORITY[i])}if(t.type==="GEOGCS"?t.projName="longlat":t.type==="LOCAL_CS"?(t.projName="identity",t.local=!0):typeof t.PROJECTION=="object"?t.projName=Object.keys(t.PROJECTION)[0]:t.projName=t.PROJECTION,t.AXIS){for(var e="",s=0,a=t.AXIS.length;s<a;++s){var n=[t.AXIS[s][0].toLowerCase(),t.AXIS[s][1].toLowerCase()];n[0].indexOf("north")!==-1||(n[0]==="y"||n[0]==="lat")&&n[1]==="north"?e+="n":n[0].indexOf("south")!==-1||(n[0]==="y"||n[0]==="lat")&&n[1]==="south"?e+="s":n[0].indexOf("east")!==-1||(n[0]==="x"||n[0]==="lon")&&n[1]==="east"?e+="e":(n[0].indexOf("west")!==-1||(n[0]==="x"||n[0]==="lon")&&n[1]==="west")&&(e+="w")}e.length===2&&(e+="u"),e.length===3&&(t.axis=e)}t.UNIT&&(t.units=t.UNIT.name.toLowerCase(),t.units==="metre"&&(t.units="meter"),t.UNIT.convert&&(t.type==="GEOGCS"?t.DATUM&&t.DATUM.SPHEROID&&(t.to_meter=t.UNIT.convert*t.DATUM.SPHEROID.a):t.to_meter=t.UNIT.convert));var h=t.GEOGCS;t.type==="GEOGCS"&&(h=t),h&&(h.DATUM?t.datumCode=h.DATUM.name.toLowerCase():t.datumCode=h.name.toLowerCase(),t.datumCode.slice(0,2)==="d_"&&(t.datumCode=t.datumCode.slice(2)),t.datumCode==="new_zealand_1949"&&(t.datumCode="nzgd49"),(t.datumCode==="wgs_1984"||t.datumCode==="world_geodetic_system_1984")&&(t.PROJECTION==="Mercator_Auxiliary_Sphere"&&(t.sphere=!0),t.datumCode="wgs84"),t.datumCode==="belge_1972"&&(t.datumCode="rnb72"),h.DATUM&&h.DATUM.SPHEROID&&(t.ellps=h.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),t.ellps.toLowerCase().slice(0,13)==="international"&&(t.ellps="intl"),t.a=h.DATUM.SPHEROID.a,t.rf=parseFloat(h.DATUM.SPHEROID.rf,10)),h.DATUM&&h.DATUM.TOWGS84&&(t.datum_params=h.DATUM.TOWGS84),~t.datumCode.indexOf("osgb_1936")&&(t.datumCode="osgb36"),~t.datumCode.indexOf("osni_1952")&&(t.datumCode="osni52"),(~t.datumCode.indexOf("tm65")||~t.datumCode.indexOf("geodetic_datum_of_1965"))&&(t.datumCode="ire65"),t.datumCode==="ch1903+"&&(t.datumCode="ch1903"),~t.datumCode.indexOf("israel")&&(t.datumCode="isr93")),t.b&&!isFinite(t.b)&&(t.b=t.a),t.rectified_grid_angle&&(t.rectified_grid_angle=st(t.rectified_grid_angle));function r(l){var c=t.to_meter||1;return l*c}var f=function(l){return Ia(t,l)},o=[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",st],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",st],["x0","false_easting",r],["y0","false_northing",r],["long0","central_meridian",st],["lat0","latitude_of_origin",st],["lat0","standard_parallel_1",st],["lat1","standard_parallel_1",st],["lat2","standard_parallel_2",st],["azimuth","Azimuth"],["alpha","azimuth",st],["srsCode","name"]];o.forEach(f),As(t)}function mi(t){if(typeof t=="object")return yi(t);const i=Sa(t);var e=ba(t);if(i==="WKT2"){const n=wa(e);return yi(n)}var s=e[0],a={};return bt(e,a),bs(a),a[s]}function k(t){var i=this;if(arguments.length===2){var e=arguments[1];typeof e=="string"?e.charAt(0)==="+"?k[t]=Zi(arguments[1]):k[t]=mi(arguments[1]):e&&typeof e=="object"&&!("projName"in e)?k[t]=mi(arguments[1]):(k[t]=e,e||delete k[t])}else if(arguments.length===1){if(Array.isArray(t))return t.map(function(s){return Array.isArray(s)?k.apply(i,s):k(s)});if(typeof t=="string"){if(t in k)return k[t]}else"EPSG"in t?k["EPSG:"+t.EPSG]=t:"ESRI"in t?k["ESRI:"+t.ESRI]=t:"IAU2000"in t?k["IAU2000:"+t.IAU2000]=t:console.log(t);return}}ca(k);function Da(t){return typeof t=="string"}function Ra(t){return t in k}function Ba(t){return t.indexOf("+")!==0&&t.indexOf("[")!==-1||typeof t=="object"&&!("srsCode"in t)}var Xe=["3857","900913","3785","102113"];function Oa(t){if(t.title)return t.title.toLowerCase().indexOf("epsg:")===0&&Xe.indexOf(t.title.substr(5))>-1;var i=yt(t,"authority");if(i){var e=yt(i,"epsg");return e&&Xe.indexOf(e)>-1}}function Ta(t){var i=yt(t,"extension");if(i)return yt(i,"proj4")}function Fa(t){return t[0]==="+"}function La(t){if(Da(t)){if(Ra(t))return k[t];if(Ba(t)){var i=mi(t);if(Oa(i))return k["EPSG:3857"];var e=Ta(i);return e?Zi(e):i}if(Fa(t))return Zi(t)}else return"projName"in t?t:mi(t)}function Ze(t,i){t=t||{};var e,s;if(!i)return t;for(s in i)e=i[s],e!==void 0&&(t[s]=e);return t}function ht(t,i,e){var s=t*i;return e/Math.sqrt(1-s*s)}function ti(t){return t<0?-1:1}function w(t,i){return i||Math.abs(t)<=F?t:t-ti(t)*Xt}function at(t,i,e){var s=t*e,a=.5*t;return s=Math.pow((1-s)/(1+s),a),Math.tan(.5*(m-i))/s}function Qt(t,i){for(var e=.5*t,s,a,n=m-2*Math.atan(i),h=0;h<=15;h++)if(s=t*Math.sin(n),a=m-2*Math.atan(i*Math.pow((1-s)/(1+s),e))-n,n+=a,Math.abs(a)<=1e-10)return n;return-9999}function Ua(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=ht(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function qa(t){var i=t.x,e=t.y;if(e*X>90&&e*X<-90&&i*X>180&&i*X<-180)return null;var s,a;if(Math.abs(Math.abs(e)-m)<=x)return null;if(this.sphere)s=this.x0+this.a*this.k0*w(i-this.long0,this.over),a=this.y0+this.a*this.k0*Math.log(Math.tan(D+.5*e));else{var n=Math.sin(e),h=at(this.e,e,n);s=this.x0+this.a*this.k0*w(i-this.long0,this.over),a=this.y0-this.a*this.k0*Math.log(h)}return t.x=s,t.y=a,t}function ka(t){var i=t.x-this.x0,e=t.y-this.y0,s,a;if(this.sphere)a=m-2*Math.atan(Math.exp(-e/(this.a*this.k0)));else{var n=Math.exp(-e/(this.a*this.k0));if(a=Qt(this.e,n),a===-9999)return null}return s=w(this.long0+i/(this.a*this.k0),this.over),t.x=s,t.y=a,t}var za=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","Mercator_Variant_A","merc"];const ja={init:Ua,forward:qa,inverse:ka,names:za};function $a(){}function Qe(t){return t}var Cs=["longlat","identity"];const Wa={init:$a,forward:Qe,inverse:Qe,names:Cs};var Ha=[ja,Wa],St={},Ct=[];function Gs(t,i){var e=Ct.length;return t.names?(Ct[e]=t,t.names.forEach(function(s){St[s.toLowerCase()]=e}),this):(console.log(i),!0)}function Is(t){return t.replace(/[-\(\)\s]+/g," ").trim().replace(/ /g,"_")}function Va(t){if(!t)return!1;var i=t.toLowerCase();if(typeof St[i]<"u"&&Ct[St[i]]||(i=Is(i),i in St&&Ct[St[i]]))return Ct[St[i]]}function Xa(){Ha.forEach(Gs)}const Za={start:Xa,add:Gs,get:Va};var Ns={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},andrae:{a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},clrk80:{a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:63558348467e-4,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"},WGS84:{a:6378137,rf:298.257223563,ellipseName:"WGS 84"},sphere:{a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}};const Qa=Ns.WGS84;function Ka(t,i,e,s){var a=t*t,n=i*i,h=(a-n)/a,r=0;s?(t*=1-h*(_a+h*(va+h*Ma)),a=t*t,h=0):r=Math.sqrt(h);var f=(a-n)/n;return{es:h,e:r,ep2:f}}function Ja(t,i,e,s,a){if(!t){var n=yt(Ns,s);n||(n=Qa),t=n.a,i=n.b,e=n.rf}return e&&!i&&(i=(1-1/e)*t),(e===0||Math.abs(t-i)<x)&&(a=!0,i=t),{a:t,b:i,rf:e,sphere:a}}var di={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},mgi:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Ordnance Survey of Great Britain 1936"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"},EPSG_5451:{towgs84:"6.41,-49.05,-11.28,1.5657,0.5242,6.9718,-5.7649"},IGNF_LURESG:{towgs84:"-192.986,13.673,-39.309,-0.4099,-2.9332,2.6881,0.43"},EPSG_4614:{towgs84:"-119.4248,-303.65872,-11.00061,1.164298,0.174458,1.096259,3.657065"},EPSG_4615:{towgs84:"-494.088,-312.129,279.877,-1.423,-1.013,1.59,-0.748"},ESRI_37241:{towgs84:"-76.822,257.457,-12.817,2.136,-0.033,-2.392,-0.031"},ESRI_37249:{towgs84:"-440.296,58.548,296.265,1.128,10.202,4.559,-0.438"},ESRI_37245:{towgs84:"-511.151,-181.269,139.609,1.05,2.703,1.798,3.071"},EPSG_4178:{towgs84:"24.9,-126.4,-93.2,-0.063,-0.247,-0.041,1.01"},EPSG_4622:{towgs84:"-472.29,-5.63,-304.12,0.4362,-0.8374,0.2563,1.8984"},EPSG_4625:{towgs84:"126.93,547.94,130.41,-2.7867,5.1612,-0.8584,13.8227"},EPSG_5252:{towgs84:"0.023,0.036,-0.068,0.00176,0.00912,-0.01136,0.00439"},EPSG_4314:{towgs84:"597.1,71.4,412.1,0.894,0.068,-1.563,7.58"},EPSG_4282:{towgs84:"-178.3,-316.7,-131.5,5.278,6.077,10.979,19.166"},EPSG_4231:{towgs84:"-83.11,-97.38,-117.22,0.0276,-0.2167,0.2147,0.1218"},EPSG_4274:{towgs84:"-230.994,102.591,25.199,0.633,-0.239,0.9,1.95"},EPSG_4134:{towgs84:"-180.624,-225.516,173.919,-0.81,-1.898,8.336,16.71006"},EPSG_4254:{towgs84:"18.38,192.45,96.82,0.056,-0.142,-0.2,-0.0013"},EPSG_4159:{towgs84:"-194.513,-63.978,-25.759,-3.4027,3.756,-3.352,-0.9175"},EPSG_4687:{towgs84:"0.072,-0.507,-0.245,0.0183,-0.0003,0.007,-0.0093"},EPSG_4227:{towgs84:"-83.58,-397.54,458.78,-17.595,-2.847,4.256,3.225"},EPSG_4746:{towgs84:"599.4,72.4,419.2,-0.062,-0.022,-2.723,6.46"},EPSG_4745:{towgs84:"612.4,77,440.2,-0.054,0.057,-2.797,2.55"},EPSG_6311:{towgs84:"8.846,-4.394,-1.122,-0.00237,-0.146528,0.130428,0.783926"},EPSG_4289:{towgs84:"565.7381,50.4018,465.2904,-1.91514,1.60363,-9.09546,4.07244"},EPSG_4230:{towgs84:"-68.863,-134.888,-111.49,-0.53,-0.14,0.57,-3.4"},EPSG_4154:{towgs84:"-123.02,-158.95,-168.47"},EPSG_4156:{towgs84:"570.8,85.7,462.8,4.998,1.587,5.261,3.56"},EPSG_4299:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4179:{towgs84:"33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84"},EPSG_4313:{towgs84:"-106.8686,52.2978,-103.7239,0.3366,-0.457,1.8422,-1.2747"},EPSG_4194:{towgs84:"163.511,127.533,-159.789"},EPSG_4195:{towgs84:"105,326,-102.5"},EPSG_4196:{towgs84:"-45,417,-3.5"},EPSG_4611:{towgs84:"-162.619,-276.959,-161.764,0.067753,-2.243649,-1.158827,-1.094246"},EPSG_4633:{towgs84:"137.092,131.66,91.475,-1.9436,-11.5993,-4.3321,-7.4824"},EPSG_4641:{towgs84:"-408.809,366.856,-412.987,1.8842,-0.5308,2.1655,-121.0993"},EPSG_4643:{towgs84:"-480.26,-438.32,-643.429,16.3119,20.1721,-4.0349,-111.7002"},EPSG_4300:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4188:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4660:{towgs84:"982.6087,552.753,-540.873,32.39344,-153.25684,-96.2266,16.805"},EPSG_4662:{towgs84:"97.295,-263.247,310.882,-1.5999,0.8386,3.1409,13.3259"},EPSG_3906:{towgs84:"577.88891,165.22205,391.18289,4.9145,-0.94729,-13.05098,7.78664"},EPSG_4307:{towgs84:"-209.3622,-87.8162,404.6198,0.0046,3.4784,0.5805,-1.4547"},EPSG_6892:{towgs84:"-76.269,-16.683,68.562,-6.275,10.536,-4.286,-13.686"},EPSG_4690:{towgs84:"221.597,152.441,176.523,2.403,1.3893,0.884,11.4648"},EPSG_4691:{towgs84:"218.769,150.75,176.75,3.5231,2.0037,1.288,10.9817"},EPSG_4629:{towgs84:"72.51,345.411,79.241,-1.5862,-0.8826,-0.5495,1.3653"},EPSG_4630:{towgs84:"165.804,216.213,180.26,-0.6251,-0.4515,-0.0721,7.4111"},EPSG_4692:{towgs84:"217.109,86.452,23.711,0.0183,-0.0003,0.007,-0.0093"},EPSG_9333:{towgs84:"0,0,0,-8.393,0.749,-10.276,0"},EPSG_9059:{towgs84:"0,0,0"},EPSG_4312:{towgs84:"601.705,84.263,485.227,4.7354,1.3145,5.393,-2.3887"},EPSG_4123:{towgs84:"-96.062,-82.428,-121.753,4.801,0.345,-1.376,1.496"},EPSG_4309:{towgs84:"-124.45,183.74,44.64,-0.4384,0.5446,-0.9706,-2.1365"},ESRI_104106:{towgs84:"-283.088,-70.693,117.445,-1.157,0.059,-0.652,-4.058"},EPSG_4281:{towgs84:"-219.247,-73.802,269.529"},EPSG_4322:{towgs84:"0,0,4.5"},EPSG_4324:{towgs84:"0,0,1.9"},EPSG_4284:{towgs84:"43.822,-108.842,-119.585,1.455,-0.761,0.737,0.549"},EPSG_4277:{towgs84:"446.448,-125.157,542.06,0.15,0.247,0.842,-20.489"},EPSG_4207:{towgs84:"-282.1,-72.2,120,-1.529,0.145,-0.89,-4.46"},EPSG_4688:{towgs84:"347.175,1077.618,2623.677,33.9058,-70.6776,9.4013,186.0647"},EPSG_4689:{towgs84:"410.793,54.542,80.501,-2.5596,-2.3517,-0.6594,17.3218"},EPSG_4720:{towgs84:"0,0,4.5"},EPSG_4273:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},EPSG_4240:{towgs84:"204.64,834.74,293.8"},EPSG_4817:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},ESRI_104131:{towgs84:"426.62,142.62,460.09,4.98,4.49,-12.42,-17.1"},EPSG_4265:{towgs84:"-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68"},EPSG_4263:{towgs84:"-111.92,-87.85,114.5,1.875,0.202,0.219,0.032"},EPSG_4298:{towgs84:"-689.5937,623.84046,-65.93566,-0.02331,1.17094,-0.80054,5.88536"},EPSG_4270:{towgs84:"-253.4392,-148.452,386.5267,0.15605,0.43,-0.1013,-0.0424"},EPSG_4229:{towgs84:"-121.8,98.1,-10.7"},EPSG_4220:{towgs84:"-55.5,-348,-229.2"},EPSG_4214:{towgs84:"12.646,-155.176,-80.863"},EPSG_4232:{towgs84:"-345,3,223"},EPSG_4238:{towgs84:"-1.977,-13.06,-9.993,0.364,0.254,0.689,-1.037"},EPSG_4168:{towgs84:"-170,33,326"},EPSG_4131:{towgs84:"199,931,318.9"},EPSG_4152:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_5228:{towgs84:"572.213,85.334,461.94,4.9732,1.529,5.2484,3.5378"},EPSG_8351:{towgs84:"485.021,169.465,483.839,7.786342,4.397554,4.102655,0"},EPSG_4683:{towgs84:"-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06"},EPSG_4133:{towgs84:"0,0,0"},EPSG_7373:{towgs84:"0.819,-0.5762,-1.6446,-0.00378,-0.03317,0.00318,0.0693"},EPSG_9075:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9072:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9294:{towgs84:"1.16835,-1.42001,-2.24431,-0.00822,-0.05508,0.01818,0.23388"},EPSG_4212:{towgs84:"-267.434,173.496,181.814,-13.4704,8.7154,7.3926,14.7492"},EPSG_4191:{towgs84:"-44.183,-0.58,-38.489,2.3867,2.7072,-3.5196,-8.2703"},EPSG_4237:{towgs84:"52.684,-71.194,-13.975,-0.312,-0.1063,-0.3729,1.0191"},EPSG_4740:{towgs84:"-1.08,-0.27,-0.9"},EPSG_4124:{towgs84:"419.3836,99.3335,591.3451,0.850389,1.817277,-7.862238,-0.99496"},EPSG_5681:{towgs84:"584.9636,107.7175,413.8067,1.1155,0.2824,-3.1384,7.9922"},EPSG_4141:{towgs84:"23.772,17.49,17.859,-0.3132,-1.85274,1.67299,-5.4262"},EPSG_4204:{towgs84:"-85.645,-273.077,-79.708,2.289,-1.421,2.532,3.194"},EPSG_4319:{towgs84:"226.702,-193.337,-35.371,-2.229,-4.391,9.238,0.9798"},EPSG_4200:{towgs84:"24.82,-131.21,-82.66"},EPSG_4130:{towgs84:"0,0,0"},EPSG_4127:{towgs84:"-82.875,-57.097,-156.768,-2.158,1.524,-0.982,-0.359"},EPSG_4149:{towgs84:"674.374,15.056,405.346"},EPSG_4617:{towgs84:"-0.991,1.9072,0.5129,1.25033e-7,4.6785e-8,5.6529e-8,0"},EPSG_4663:{towgs84:"-210.502,-66.902,-48.476,2.094,-15.067,-5.817,0.485"},EPSG_4664:{towgs84:"-211.939,137.626,58.3,-0.089,0.251,0.079,0.384"},EPSG_4665:{towgs84:"-105.854,165.589,-38.312,-0.003,-0.026,0.024,-0.048"},EPSG_4666:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},EPSG_4756:{towgs84:"-192.873,-39.382,-111.202,-0.00205,-0.0005,0.00335,0.0188"},EPSG_4723:{towgs84:"-179.483,-69.379,-27.584,-7.862,8.163,6.042,-13.925"},EPSG_4726:{towgs84:"8.853,-52.644,180.304,-0.393,-2.323,2.96,-24.081"},EPSG_4267:{towgs84:"-8.0,160.0,176.0"},EPSG_5365:{towgs84:"-0.16959,0.35312,0.51846,0.03385,-0.16325,0.03446,0.03693"},EPSG_4218:{towgs84:"304.5,306.5,-318.1"},EPSG_4242:{towgs84:"-33.722,153.789,94.959,-8.581,-4.478,4.54,8.95"},EPSG_4216:{towgs84:"-292.295,248.758,429.447,4.9971,2.99,6.6906,1.0289"},ESRI_104105:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},ESRI_104129:{towgs84:"0,0,0"},EPSG_4673:{towgs84:"174.05,-25.49,112.57"},EPSG_4202:{towgs84:"-124,-60,154"},EPSG_4203:{towgs84:"-117.763,-51.51,139.061,0.292,0.443,0.277,-0.191"},EPSG_3819:{towgs84:"595.48,121.69,515.35,4.115,-2.9383,0.853,-3.408"},EPSG_8694:{towgs84:"-93.799,-132.737,-219.073,-1.844,0.648,-6.37,-0.169"},EPSG_4145:{towgs84:"275.57,676.78,229.6"},EPSG_4283:{towgs84:"61.55,-10.87,-40.19,39.4924,32.7221,32.8979,-9.994"},EPSG_4317:{towgs84:"2.3287,-147.0425,-92.0802,-0.3092483,0.32482185,0.49729934,5.68906266"},EPSG_4272:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993"},EPSG_4248:{towgs84:"-307.7,265.3,-363.5"},EPSG_5561:{towgs84:"24,-121,-76"},EPSG_5233:{towgs84:"-0.293,766.95,87.713,0.195704,1.695068,3.473016,-0.039338"},ESRI_104130:{towgs84:"-86,-98,-119"},ESRI_104102:{towgs84:"682,-203,480"},ESRI_37207:{towgs84:"7,-10,-26"},EPSG_4675:{towgs84:"59.935,118.4,-10.871"},ESRI_104109:{towgs84:"-89.121,-348.182,260.871"},ESRI_104112:{towgs84:"-185.583,-230.096,281.361"},ESRI_104113:{towgs84:"25.1,-275.6,222.6"},IGNF_WGS72G:{towgs84:"0,12,6"},IGNF_NTFG:{towgs84:"-168,-60,320"},IGNF_EFATE57G:{towgs84:"-127,-769,472"},IGNF_PGP50G:{towgs84:"324.8,153.6,172.1"},IGNF_REUN47G:{towgs84:"94,-948,-1262"},IGNF_CSG67G:{towgs84:"-186,230,110"},IGNF_GUAD48G:{towgs84:"-467,-16,-300"},IGNF_TAHI51G:{towgs84:"162,117,154"},IGNF_TAHAAG:{towgs84:"65,342,77"},IGNF_NUKU72G:{towgs84:"84,274,65"},IGNF_PETRELS72G:{towgs84:"365,194,166"},IGNF_WALL78G:{towgs84:"253,-133,-127"},IGNF_MAYO50G:{towgs84:"-382,-59,-262"},IGNF_TANNAG:{towgs84:"-139,-967,436"},IGNF_IGN72G:{towgs84:"-13,-348,292"},IGNF_ATIGG:{towgs84:"1118,23,66"},IGNF_FANGA84G:{towgs84:"150.57,158.33,118.32"},IGNF_RUSAT84G:{towgs84:"202.13,174.6,-15.74"},IGNF_KAUE70G:{towgs84:"126.74,300.1,-75.49"},IGNF_MOP90G:{towgs84:"-10.8,-1.8,12.77"},IGNF_MHPF67G:{towgs84:"338.08,212.58,-296.17"},IGNF_TAHI79G:{towgs84:"160.61,116.05,153.69"},IGNF_ANAA92G:{towgs84:"1.5,3.84,4.81"},IGNF_MARQUI72G:{towgs84:"330.91,-13.92,58.56"},IGNF_APAT86G:{towgs84:"143.6,197.82,74.05"},IGNF_TUBU69G:{towgs84:"237.17,171.61,-77.84"},IGNF_STPM50G:{towgs84:"11.363,424.148,373.13"},EPSG_4150:{towgs84:"674.374,15.056,405.346"},EPSG_4754:{towgs84:"-208.4058,-109.8777,-2.5764"},ESRI_104101:{towgs84:"374,150,588"},EPSG_4693:{towgs84:"0,-0.15,0.68"},EPSG_6207:{towgs84:"293.17,726.18,245.36"},EPSG_4153:{towgs84:"-133.63,-157.5,-158.62"},EPSG_4132:{towgs84:"-241.54,-163.64,396.06"},EPSG_4221:{towgs84:"-154.5,150.7,100.4"},EPSG_4266:{towgs84:"-80.7,-132.5,41.1"},EPSG_4193:{towgs84:"-70.9,-151.8,-41.4"},EPSG_5340:{towgs84:"-0.41,0.46,-0.35"},EPSG_4246:{towgs84:"-294.7,-200.1,525.5"},EPSG_4318:{towgs84:"-3.2,-5.7,2.8"},EPSG_4121:{towgs84:"-199.87,74.79,246.62"},EPSG_4223:{towgs84:"-260.1,5.5,432.2"},EPSG_4158:{towgs84:"-0.465,372.095,171.736"},EPSG_4285:{towgs84:"-128.16,-282.42,21.93"},EPSG_4613:{towgs84:"-404.78,685.68,45.47"},EPSG_4607:{towgs84:"195.671,332.517,274.607"},EPSG_4475:{towgs84:"-381.788,-57.501,-256.673"},EPSG_4208:{towgs84:"-157.84,308.54,-146.6"},EPSG_4743:{towgs84:"70.995,-335.916,262.898"},EPSG_4710:{towgs84:"-323.65,551.39,-491.22"},EPSG_7881:{towgs84:"-0.077,0.079,0.086"},EPSG_4682:{towgs84:"283.729,735.942,261.143"},EPSG_4739:{towgs84:"-156,-271,-189"},EPSG_4679:{towgs84:"-80.01,253.26,291.19"},EPSG_4750:{towgs84:"-56.263,16.136,-22.856"},EPSG_4644:{towgs84:"-10.18,-350.43,291.37"},EPSG_4695:{towgs84:"-103.746,-9.614,-255.95"},EPSG_4292:{towgs84:"-355,21,72"},EPSG_4302:{towgs84:"-61.702,284.488,472.052"},EPSG_4143:{towgs84:"-124.76,53,466.79"},EPSG_4606:{towgs84:"-153,153,307"},EPSG_4699:{towgs84:"-770.1,158.4,-498.2"},EPSG_4247:{towgs84:"-273.5,110.6,-357.9"},EPSG_4160:{towgs84:"8.88,184.86,106.69"},EPSG_4161:{towgs84:"-233.43,6.65,173.64"},EPSG_9251:{towgs84:"-9.5,122.9,138.2"},EPSG_9253:{towgs84:"-78.1,101.6,133.3"},EPSG_4297:{towgs84:"-198.383,-240.517,-107.909"},EPSG_4269:{towgs84:"0,0,0"},EPSG_4301:{towgs84:"-147,506,687"},EPSG_4618:{towgs84:"-59,-11,-52"},EPSG_4612:{towgs84:"0,0,0"},EPSG_4678:{towgs84:"44.585,-131.212,-39.544"},EPSG_4250:{towgs84:"-130,29,364"},EPSG_4144:{towgs84:"214,804,268"},EPSG_4147:{towgs84:"-17.51,-108.32,-62.39"},EPSG_4259:{towgs84:"-254.1,-5.36,-100.29"},EPSG_4164:{towgs84:"-76,-138,67"},EPSG_4211:{towgs84:"-378.873,676.002,-46.255"},EPSG_4182:{towgs84:"-422.651,-172.995,84.02"},EPSG_4224:{towgs84:"-143.87,243.37,-33.52"},EPSG_4225:{towgs84:"-205.57,168.77,-4.12"},EPSG_5527:{towgs84:"-67.35,3.88,-38.22"},EPSG_4752:{towgs84:"98,390,-22"},EPSG_4310:{towgs84:"-30,190,89"},EPSG_9248:{towgs84:"-192.26,65.72,132.08"},EPSG_4680:{towgs84:"124.5,-63.5,-281"},EPSG_4701:{towgs84:"-79.9,-158,-168.9"},EPSG_4706:{towgs84:"-146.21,112.63,4.05"},EPSG_4805:{towgs84:"682,-203,480"},EPSG_4201:{towgs84:"-165,-11,206"},EPSG_4210:{towgs84:"-157,-2,-299"},EPSG_4183:{towgs84:"-104,167,-38"},EPSG_4139:{towgs84:"11,72,-101"},EPSG_4668:{towgs84:"-86,-98,-119"},EPSG_4717:{towgs84:"-2,151,181"},EPSG_4732:{towgs84:"102,52,-38"},EPSG_4280:{towgs84:"-377,681,-50"},EPSG_4209:{towgs84:"-138,-105,-289"},EPSG_4261:{towgs84:"31,146,47"},EPSG_4658:{towgs84:"-73,46,-86"},EPSG_4721:{towgs84:"265.025,384.929,-194.046"},EPSG_4222:{towgs84:"-136,-108,-292"},EPSG_4601:{towgs84:"-255,-15,71"},EPSG_4602:{towgs84:"725,685,536"},EPSG_4603:{towgs84:"72,213.7,93"},EPSG_4605:{towgs84:"9,183,236"},EPSG_4621:{towgs84:"137,248,-430"},EPSG_4657:{towgs84:"-28,199,5"},EPSG_4316:{towgs84:"103.25,-100.4,-307.19"},EPSG_4642:{towgs84:"-13,-348,292"},EPSG_4698:{towgs84:"145,-187,103"},EPSG_4192:{towgs84:"-206.1,-174.7,-87.7"},EPSG_4311:{towgs84:"-265,120,-358"},EPSG_4135:{towgs84:"58,-283,-182"},ESRI_104138:{towgs84:"198,-226,-347"},EPSG_4245:{towgs84:"-11,851,5"},EPSG_4142:{towgs84:"-125,53,467"},EPSG_4213:{towgs84:"-106,-87,188"},EPSG_4253:{towgs84:"-133,-77,-51"},EPSG_4129:{towgs84:"-132,-110,-335"},EPSG_4713:{towgs84:"-77,-128,142"},EPSG_4239:{towgs84:"217,823,299"},EPSG_4146:{towgs84:"295,736,257"},EPSG_4155:{towgs84:"-83,37,124"},EPSG_4165:{towgs84:"-173,253,27"},EPSG_4672:{towgs84:"175,-38,113"},EPSG_4236:{towgs84:"-637,-549,-203"},EPSG_4251:{towgs84:"-90,40,88"},EPSG_4271:{towgs84:"-2,374,172"},EPSG_4175:{towgs84:"-88,4,101"},EPSG_4716:{towgs84:"298,-304,-375"},EPSG_4315:{towgs84:"-23,259,-9"},EPSG_4744:{towgs84:"-242.2,-144.9,370.3"},EPSG_4244:{towgs84:"-97,787,86"},EPSG_4293:{towgs84:"616,97,-251"},EPSG_4714:{towgs84:"-127,-769,472"},EPSG_4736:{towgs84:"260,12,-147"},EPSG_6883:{towgs84:"-235,-110,393"},EPSG_6894:{towgs84:"-63,176,185"},EPSG_4205:{towgs84:"-43,-163,45"},EPSG_4256:{towgs84:"41,-220,-134"},EPSG_4262:{towgs84:"639,405,60"},EPSG_4604:{towgs84:"174,359,365"},EPSG_4169:{towgs84:"-115,118,426"},EPSG_4620:{towgs84:"-106,-129,165"},EPSG_4184:{towgs84:"-203,141,53"},EPSG_4616:{towgs84:"-289,-124,60"},EPSG_9403:{towgs84:"-307,-92,127"},EPSG_4684:{towgs84:"-133,-321,50"},EPSG_4708:{towgs84:"-491,-22,435"},EPSG_4707:{towgs84:"114,-116,-333"},EPSG_4709:{towgs84:"145,75,-272"},EPSG_4712:{towgs84:"-205,107,53"},EPSG_4711:{towgs84:"124,-234,-25"},EPSG_4718:{towgs84:"230,-199,-752"},EPSG_4719:{towgs84:"211,147,111"},EPSG_4724:{towgs84:"208,-435,-229"},EPSG_4725:{towgs84:"189,-79,-202"},EPSG_4735:{towgs84:"647,1777,-1124"},EPSG_4722:{towgs84:"-794,119,-298"},EPSG_4728:{towgs84:"-307,-92,127"},EPSG_4734:{towgs84:"-632,438,-609"},EPSG_4727:{towgs84:"912,-58,1227"},EPSG_4729:{towgs84:"185,165,42"},EPSG_4730:{towgs84:"170,42,84"},EPSG_4733:{towgs84:"276,-57,149"},ESRI_37218:{towgs84:"230,-199,-752"},ESRI_37240:{towgs84:"-7,215,225"},ESRI_37221:{towgs84:"252,-209,-751"},ESRI_4305:{towgs84:"-123,-206,219"},ESRI_104139:{towgs84:"-73,-247,227"},EPSG_4748:{towgs84:"51,391,-36"},EPSG_4219:{towgs84:"-384,664,-48"},EPSG_4255:{towgs84:"-333,-222,114"},EPSG_4257:{towgs84:"-587.8,519.75,145.76"},EPSG_4646:{towgs84:"-963,510,-359"},EPSG_6881:{towgs84:"-24,-203,268"},EPSG_6882:{towgs84:"-183,-15,273"},EPSG_4715:{towgs84:"-104,-129,239"},IGNF_RGF93GDD:{towgs84:"0,0,0"},IGNF_RGM04GDD:{towgs84:"0,0,0"},IGNF_RGSPM06GDD:{towgs84:"0,0,0"},IGNF_RGTAAF07GDD:{towgs84:"0,0,0"},IGNF_RGFG95GDD:{towgs84:"0,0,0"},IGNF_RGNCG:{towgs84:"0,0,0"},IGNF_RGPFGDD:{towgs84:"0,0,0"},IGNF_ETRS89G:{towgs84:"0,0,0"},IGNF_RGR92GDD:{towgs84:"0,0,0"},EPSG_4173:{towgs84:"0,0,0"},EPSG_4180:{towgs84:"0,0,0"},EPSG_4619:{towgs84:"0,0,0"},EPSG_4667:{towgs84:"0,0,0"},EPSG_4075:{towgs84:"0,0,0"},EPSG_6706:{towgs84:"0,0,0"},EPSG_7798:{towgs84:"0,0,0"},EPSG_4661:{towgs84:"0,0,0"},EPSG_4669:{towgs84:"0,0,0"},EPSG_8685:{towgs84:"0,0,0"},EPSG_4151:{towgs84:"0,0,0"},EPSG_9702:{towgs84:"0,0,0"},EPSG_4758:{towgs84:"0,0,0"},EPSG_4761:{towgs84:"0,0,0"},EPSG_4765:{towgs84:"0,0,0"},EPSG_8997:{towgs84:"0,0,0"},EPSG_4023:{towgs84:"0,0,0"},EPSG_4670:{towgs84:"0,0,0"},EPSG_4694:{towgs84:"0,0,0"},EPSG_4148:{towgs84:"0,0,0"},EPSG_4163:{towgs84:"0,0,0"},EPSG_4167:{towgs84:"0,0,0"},EPSG_4189:{towgs84:"0,0,0"},EPSG_4190:{towgs84:"0,0,0"},EPSG_4176:{towgs84:"0,0,0"},EPSG_4659:{towgs84:"0,0,0"},EPSG_3824:{towgs84:"0,0,0"},EPSG_3889:{towgs84:"0,0,0"},EPSG_4046:{towgs84:"0,0,0"},EPSG_4081:{towgs84:"0,0,0"},EPSG_4558:{towgs84:"0,0,0"},EPSG_4483:{towgs84:"0,0,0"},EPSG_5013:{towgs84:"0,0,0"},EPSG_5264:{towgs84:"0,0,0"},EPSG_5324:{towgs84:"0,0,0"},EPSG_5354:{towgs84:"0,0,0"},EPSG_5371:{towgs84:"0,0,0"},EPSG_5373:{towgs84:"0,0,0"},EPSG_5381:{towgs84:"0,0,0"},EPSG_5393:{towgs84:"0,0,0"},EPSG_5489:{towgs84:"0,0,0"},EPSG_5593:{towgs84:"0,0,0"},EPSG_6135:{towgs84:"0,0,0"},EPSG_6365:{towgs84:"0,0,0"},EPSG_5246:{towgs84:"0,0,0"},EPSG_7886:{towgs84:"0,0,0"},EPSG_8431:{towgs84:"0,0,0"},EPSG_8427:{towgs84:"0,0,0"},EPSG_8699:{towgs84:"0,0,0"},EPSG_8818:{towgs84:"0,0,0"},EPSG_4757:{towgs84:"0,0,0"},EPSG_9140:{towgs84:"0,0,0"},EPSG_8086:{towgs84:"0,0,0"},EPSG_4686:{towgs84:"0,0,0"},EPSG_4737:{towgs84:"0,0,0"},EPSG_4702:{towgs84:"0,0,0"},EPSG_4747:{towgs84:"0,0,0"},EPSG_4749:{towgs84:"0,0,0"},EPSG_4674:{towgs84:"0,0,0"},EPSG_4755:{towgs84:"0,0,0"},EPSG_4759:{towgs84:"0,0,0"},EPSG_4762:{towgs84:"0,0,0"},EPSG_4763:{towgs84:"0,0,0"},EPSG_4764:{towgs84:"0,0,0"},EPSG_4166:{towgs84:"0,0,0"},EPSG_4170:{towgs84:"0,0,0"},EPSG_5546:{towgs84:"0,0,0"},EPSG_7844:{towgs84:"0,0,0"},EPSG_4818:{towgs84:"589,76,480"}};for(var Ya in di){var $i=di[Ya];$i.datumName&&(di[$i.datumName]=$i)}function tr(t,i,e,s,a,n,h){var r={};return t===void 0||t==="none"?r.datum_type=Xi:r.datum_type=da,i&&(r.datum_params=i.map(parseFloat),(r.datum_params[0]!==0||r.datum_params[1]!==0||r.datum_params[2]!==0)&&(r.datum_type=pt),r.datum_params.length>3&&(r.datum_params[3]!==0||r.datum_params[4]!==0||r.datum_params[5]!==0||r.datum_params[6]!==0)&&(r.datum_type=Pt,r.datum_params[3]*=jt,r.datum_params[4]*=jt,r.datum_params[5]*=jt,r.datum_params[6]=r.datum_params[6]/1e6+1)),h&&(r.datum_type=Nt,r.grids=h),r.a=e,r.b=s,r.es=a,r.ep2=n,r}var ne={};function ir(t,i,e){return i instanceof ArrayBuffer?er(t,i,e):{ready:sr(t,i)}}function er(t,i,e){var s=!0;e!==void 0&&e.includeErrorFields===!1&&(s=!1);var a=new DataView(i),n=nr(a),h=hr(a,n),r=or(a,h,n,s),f={header:h,subgrids:r};return ne[t]=f,f}async function sr(t,i){for(var e=[],s=await i.getImageCount(),a=s-1;a>=0;a--){var n=await i.getImage(a),h=await n.readRasters(),r=h,f=[n.getWidth(),n.getHeight()],o=n.getBoundingBox().map(Ke),l=[n.fileDirectory.ModelPixelScale[0],n.fileDirectory.ModelPixelScale[1]].map(Ke),c=o[0]+(f[0]-1)*l[0],u=o[3]-(f[1]-1)*l[1],d=r[0],g=r[1],M=[];for(let p=f[1]-1;p>=0;p--)for(let P=f[0]-1;P>=0;P--){var v=p*f[0]+P;M.push([-vt(g[v]),vt(d[v])])}e.push({del:l,lim:f,ll:[-c,u],cvs:M})}var S={header:{nSubgrids:s},subgrids:e};return ne[t]=S,S}function ar(t){if(t===void 0)return null;var i=t.split(",");return i.map(rr)}function rr(t){if(t.length===0)return null;var i=t[0]==="@";return i&&(t=t.slice(1)),t==="null"?{name:"null",mandatory:!i,grid:null,isNull:!0}:{name:t,mandatory:!i,grid:ne[t]||null,isNull:!1}}function Ke(t){return t*Math.PI/180}function vt(t){return t/3600*Math.PI/180}function nr(t){var i=t.getInt32(8,!1);return i===11?!1:(i=t.getInt32(8,!0),i!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function hr(t,i){return{nFields:t.getInt32(8,i),nSubgridFields:t.getInt32(24,i),nSubgrids:t.getInt32(40,i),shiftType:Qi(t,56,64).trim(),fromSemiMajorAxis:t.getFloat64(120,i),fromSemiMinorAxis:t.getFloat64(136,i),toSemiMajorAxis:t.getFloat64(152,i),toSemiMinorAxis:t.getFloat64(168,i)}}function Qi(t,i,e){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(i,e)))}function or(t,i,e,s){for(var a=176,n=[],h=0;h<i.nSubgrids;h++){var r=lr(t,a,e),f=ur(t,a,r,e,s),o=Math.round(1+(r.upperLongitude-r.lowerLongitude)/r.longitudeInterval),l=Math.round(1+(r.upperLatitude-r.lowerLatitude)/r.latitudeInterval);n.push({ll:[vt(r.lowerLongitude),vt(r.lowerLatitude)],del:[vt(r.longitudeInterval),vt(r.latitudeInterval)],lim:[o,l],count:r.gridNodeCount,cvs:fr(f)});var c=16;s===!1&&(c=8),a+=176+r.gridNodeCount*c}return n}function fr(t){return t.map(function(i){return[vt(i.longitudeShift),vt(i.latitudeShift)]})}function lr(t,i,e){return{name:Qi(t,i+8,i+16).trim(),parent:Qi(t,i+24,i+24+8).trim(),lowerLatitude:t.getFloat64(i+72,e),upperLatitude:t.getFloat64(i+88,e),lowerLongitude:t.getFloat64(i+104,e),upperLongitude:t.getFloat64(i+120,e),latitudeInterval:t.getFloat64(i+136,e),longitudeInterval:t.getFloat64(i+152,e),gridNodeCount:t.getInt32(i+168,e)}}function ur(t,i,e,s,a){var n=i+176,h=16;a===!1&&(h=8);for(var r=[],f=0;f<e.gridNodeCount;f++){var o={latitudeShift:t.getFloat32(n+f*h,s),longitudeShift:t.getFloat32(n+f*h+4,s)};a!==!1&&(o.latitudeAccuracy=t.getFloat32(n+f*h+8,s),o.longitudeAccuracy=t.getFloat32(n+f*h+12,s)),r.push(o)}return r}function et(t,i){if(!(this instanceof et))return new et(t);this.forward=null,this.inverse=null,this.init=null,this.name,this.names=null,this.title,i=i||function(o){if(o)throw o};var e=La(t);if(typeof e!="object"){i("Could not parse to valid json: "+t);return}var s=et.projections.get(e.projName);if(!s){i("Could not get projection name from: "+t);return}if(e.datumCode&&e.datumCode!=="none"){var a=yt(di,e.datumCode);a&&(e.datum_params=e.datum_params||(a.towgs84?a.towgs84.split(","):null),e.ellps=a.ellipse,e.datumName=a.datumName?a.datumName:e.datumCode)}e.k0=e.k0||1,e.axis=e.axis||"enu",e.ellps=e.ellps||"wgs84",e.lat1=e.lat1||e.lat0;var n=Ja(e.a,e.b,e.rf,e.ellps,e.sphere),h=Ka(n.a,n.b,n.rf,e.R_A),r=ar(e.nadgrids),f=e.datum||tr(e.datumCode,e.datum_params,n.a,n.b,h.es,h.ep2,r);Ze(this,e),Ze(this,s),this.a=n.a,this.b=n.b,this.rf=n.rf,this.sphere=n.sphere,this.es=h.es,this.e=h.e,this.ep2=h.ep2,this.datum=f,"init"in this&&typeof this.init=="function"&&this.init(),i(null,this)}et.projections=Za;et.projections.start();function cr(t,i){return t.datum_type!==i.datum_type||t.a!==i.a||Math.abs(t.es-i.es)>5e-11?!1:t.datum_type===pt?t.datum_params[0]===i.datum_params[0]&&t.datum_params[1]===i.datum_params[1]&&t.datum_params[2]===i.datum_params[2]:t.datum_type===Pt?t.datum_params[0]===i.datum_params[0]&&t.datum_params[1]===i.datum_params[1]&&t.datum_params[2]===i.datum_params[2]&&t.datum_params[3]===i.datum_params[3]&&t.datum_params[4]===i.datum_params[4]&&t.datum_params[5]===i.datum_params[5]&&t.datum_params[6]===i.datum_params[6]:!0}function Ds(t,i,e){var s=t.x,a=t.y,n=t.z?t.z:0,h,r,f,o;if(a<-m&&a>-1.001*m)a=-m;else if(a>m&&a<1.001*m)a=m;else{if(a<-m)return{x:-1/0,y:-1/0,z:t.z};if(a>m)return{x:1/0,y:1/0,z:t.z}}return s>Math.PI&&(s-=2*Math.PI),r=Math.sin(a),o=Math.cos(a),f=r*r,h=e/Math.sqrt(1-i*f),{x:(h+n)*o*Math.cos(s),y:(h+n)*o*Math.sin(s),z:(h*(1-i)+n)*r}}function Rs(t,i,e,s){var a=1e-12,n=a*a,h=30,r,f,o,l,c,u,d,g,M,v,S,p,P,G=t.x,b=t.y,I=t.z?t.z:0,B,q,U;if(r=Math.sqrt(G*G+b*b),f=Math.sqrt(G*G+b*b+I*I),r/e<a){if(B=0,f/e<a)return q=m,U=-s,{x:t.x,y:t.y,z:t.z}}else B=Math.atan2(b,G);o=I/f,l=r/f,c=1/Math.sqrt(1-i*(2-i)*l*l),g=l*(1-i)*c,M=o*c,P=0;do P++,d=e/Math.sqrt(1-i*M*M),U=r*g+I*M-d*(1-i*M*M),u=i*d/(d+U),c=1/Math.sqrt(1-u*(2-u)*l*l),v=l*(1-u)*c,S=o*c,p=S*g-v*M,g=v,M=S;while(p*p>n&&P<h);return q=Math.atan(S/Math.abs(v)),{x:B,y:q,z:U}}function dr(t,i,e){if(i===pt)return{x:t.x+e[0],y:t.y+e[1],z:t.z+e[2]};if(i===Pt){var s=e[0],a=e[1],n=e[2],h=e[3],r=e[4],f=e[5],o=e[6];return{x:o*(t.x-f*t.y+r*t.z)+s,y:o*(f*t.x+t.y-h*t.z)+a,z:o*(-r*t.x+h*t.y+t.z)+n}}}function gr(t,i,e){if(i===pt)return{x:t.x-e[0],y:t.y-e[1],z:t.z-e[2]};if(i===Pt){var s=e[0],a=e[1],n=e[2],h=e[3],r=e[4],f=e[5],o=e[6],l=(t.x-s)/o,c=(t.y-a)/o,u=(t.z-n)/o;return{x:l+f*c-r*u,y:-f*l+c+h*u,z:r*l-h*c+u}}}function li(t){return t===pt||t===Pt}function _r(t,i,e){if(cr(t,i)||t.datum_type===Xi||i.datum_type===Xi)return e;var s=t.a,a=t.es;if(t.datum_type===Nt){var n=Je(t,!1,e);if(n!==0)return;s=ze,a=je}var h=i.a,r=i.b,f=i.es;if(i.datum_type===Nt&&(h=ze,r=ga,f=je),a===f&&s===h&&!li(t.datum_type)&&!li(i.datum_type))return e;if(e=Ds(e,a,s),li(t.datum_type)&&(e=dr(e,t.datum_type,t.datum_params)),li(i.datum_type)&&(e=gr(e,i.datum_type,i.datum_params)),e=Rs(e,f,h,r),i.datum_type===Nt){var o=Je(i,!0,e);if(o!==0)return}return e}function Je(t,i,e){if(t.grids===null||t.grids.length===0)return console.log("Grid shift grids not found"),-1;var s={x:-e.x,y:e.y},a={x:Number.NaN,y:Number.NaN},n=[];t:for(var h=0;h<t.grids.length;h++){var r=t.grids[h];if(n.push(r.name),r.isNull){a=s;break}if(r.grid===null){if(r.mandatory)return console.log("Unable to find mandatory grid '"+r.name+"'"),-1;continue}for(var f=r.grid.subgrids,o=0,l=f.length;o<l;o++){var c=f[o],u=(Math.abs(c.del[1])+Math.abs(c.del[0]))/1e4,d=c.ll[0]-u,g=c.ll[1]-u,M=c.ll[0]+(c.lim[0]-1)*c.del[0]+u,v=c.ll[1]+(c.lim[1]-1)*c.del[1]+u;if(!(g>s.y||d>s.x||v<s.y||M<s.x)&&(a=vr(s,i,c),!isNaN(a.x)))break t}}return isNaN(a.x)?(console.log("Failed to find a grid shift table for location '"+-s.x*X+" "+s.y*X+" tried: '"+n+"'"),-1):(e.x=-a.x,e.y=a.y,0)}function vr(t,i,e){var s={x:Number.NaN,y:Number.NaN};if(isNaN(t.x))return s;var a={x:t.x,y:t.y};a.x-=e.ll[0],a.y-=e.ll[1],a.x=w(a.x-Math.PI)+Math.PI;var n=Ye(a,e);if(i){if(isNaN(n.x))return s;n.x=a.x-n.x,n.y=a.y-n.y;var h=9,r=1e-12,f,o;do{if(o=Ye(n,e),isNaN(o.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}f={x:a.x-(o.x+n.x),y:a.y-(o.y+n.y)},n.x+=f.x,n.y+=f.y}while(h--&&Math.abs(f.x)>r&&Math.abs(f.y)>r);if(h<0)return console.log("Inverse grid shift iterator failed to converge."),s;s.x=w(n.x+e.ll[0]),s.y=n.y+e.ll[1]}else isNaN(n.x)||(s.x=t.x+n.x,s.y=t.y+n.y);return s}function Ye(t,i){var e={x:t.x/i.del[0],y:t.y/i.del[1]},s={x:Math.floor(e.x),y:Math.floor(e.y)},a={x:e.x-1*s.x,y:e.y-1*s.y},n={x:Number.NaN,y:Number.NaN},h;if(s.x<0||s.x>=i.lim[0]||s.y<0||s.y>=i.lim[1])return n;h=s.y*i.lim[0]+s.x;var r={x:i.cvs[h][0],y:i.cvs[h][1]};h++;var f={x:i.cvs[h][0],y:i.cvs[h][1]};h+=i.lim[0];var o={x:i.cvs[h][0],y:i.cvs[h][1]};h--;var l={x:i.cvs[h][0],y:i.cvs[h][1]},c=a.x*a.y,u=a.x*(1-a.y),d=(1-a.x)*(1-a.y),g=(1-a.x)*a.y;return n.x=d*r.x+u*f.x+g*l.x+c*o.x,n.y=d*r.y+u*f.y+g*l.y+c*o.y,n}function ts(t,i,e){var s=e.x,a=e.y,n=e.z||0,h,r,f,o={};for(f=0;f<3;f++)if(!(i&&f===2&&e.z===void 0))switch(f===0?(h=s,"ew".indexOf(t.axis[f])!==-1?r="x":r="y"):f===1?(h=a,"ns".indexOf(t.axis[f])!==-1?r="y":r="x"):(h=n,r="z"),t.axis[f]){case"e":o[r]=h;break;case"w":o[r]=-h;break;case"n":o[r]=h;break;case"s":o[r]=-h;break;case"u":e[r]!==void 0&&(o.z=h);break;case"d":e[r]!==void 0&&(o.z=-h);break;default:return null}return o}function Bs(t){var i={x:t[0],y:t[1]};return t.length>2&&(i.z=t[2]),t.length>3&&(i.m=t[3]),i}function Mr(t){is(t.x),is(t.y)}function is(t){if(typeof Number.isFinite=="function"){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if(typeof t!="number"||t!==t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function yr(t,i){return(t.datum.datum_type===pt||t.datum.datum_type===Pt||t.datum.datum_type===Nt)&&i.datumCode!=="WGS84"||(i.datum.datum_type===pt||i.datum.datum_type===Pt||i.datum.datum_type===Nt)&&t.datumCode!=="WGS84"}function xi(t,i,e,s){var a;Array.isArray(e)?e=Bs(e):e={x:e.x,y:e.y,z:e.z,m:e.m};var n=e.z!==void 0;if(Mr(e),t.datum&&i.datum&&yr(t,i)&&(a=new et("WGS84"),e=xi(t,a,e,s),t=a),s&&t.axis!=="enu"&&(e=ts(t,!1,e)),t.projName==="longlat")e={x:e.x*T,y:e.y*T,z:e.z||0};else if(t.to_meter&&(e={x:e.x*t.to_meter,y:e.y*t.to_meter,z:e.z||0}),e=t.inverse(e),!e)return;if(t.from_greenwich&&(e.x+=t.from_greenwich),e=_r(t.datum,i.datum,e),!!e)return e=e,i.from_greenwich&&(e={x:e.x-i.from_greenwich,y:e.y,z:e.z||0}),i.projName==="longlat"?e={x:e.x*X,y:e.y*X,z:e.z||0}:(e=i.forward(e),i.to_meter&&(e={x:e.x/i.to_meter,y:e.y/i.to_meter,z:e.z||0})),s&&i.axis!=="enu"?ts(i,!0,e):(e&&!n&&delete e.z,e)}var es=et("WGS84");function Wi(t,i,e,s){var a,n,h;return Array.isArray(e)?(a=xi(t,i,e,s)||{x:NaN,y:NaN},e.length>2?typeof t.name<"u"&&t.name==="geocent"||typeof i.name<"u"&&i.name==="geocent"?typeof a.z=="number"?[a.x,a.y,a.z].concat(e.slice(3)):[a.x,a.y,e[2]].concat(e.slice(3)):[a.x,a.y].concat(e.slice(2)):[a.x,a.y]):(n=xi(t,i,e,s),h=Object.keys(e),h.length===2||h.forEach(function(r){if(typeof t.name<"u"&&t.name==="geocent"||typeof i.name<"u"&&i.name==="geocent"){if(r==="x"||r==="y"||r==="z")return}else if(r==="x"||r==="y")return;n[r]=e[r]}),n)}function ui(t){return t instanceof et?t:typeof t=="object"&&"oProj"in t?t.oProj:et(t)}function mr(t,i,e){var s,a,n=!1,h;return typeof i>"u"?(a=ui(t),s=es,n=!0):(typeof i.x<"u"||Array.isArray(i))&&(e=i,a=ui(t),s=es,n=!0),s||(s=ui(t)),a||(a=ui(i)),e?Wi(s,a,e):(h={forward:function(r,f){return Wi(s,a,r,f)},inverse:function(r,f){return Wi(a,s,r,f)}},n&&(h.oProj=a),h)}var ss=6,Os="AJSAJS",Ts="AFAFAF",Gt=65,H=73,it=79,qt=86,kt=90;const xr={forward:Fs,inverse:Er,toPoint:Ls};function Fs(t,i){return i=i||5,pr(wr({lat:t[1],lon:t[0]}),i)}function Er(t){var i=he(qs(t.toUpperCase()));return i.lat&&i.lon?[i.lon,i.lat,i.lon,i.lat]:[i.left,i.bottom,i.right,i.top]}function Ls(t){var i=he(qs(t.toUpperCase()));return i.lat&&i.lon?[i.lon,i.lat]:[(i.left+i.right)/2,(i.top+i.bottom)/2]}function Hi(t){return t*(Math.PI/180)}function as(t){return 180*(t/Math.PI)}function wr(t){var i=t.lat,e=t.lon,s=6378137,a=.00669438,n=.9996,h,r,f,o,l,c,u,d=Hi(i),g=Hi(e),M,v;v=Math.floor((e+180)/6)+1,e===180&&(v=60),i>=56&&i<64&&e>=3&&e<12&&(v=32),i>=72&&i<84&&(e>=0&&e<9?v=31:e>=9&&e<21?v=33:e>=21&&e<33?v=35:e>=33&&e<42&&(v=37)),h=(v-1)*6-180+3,M=Hi(h),r=a/(1-a),f=s/Math.sqrt(1-a*Math.sin(d)*Math.sin(d)),o=Math.tan(d)*Math.tan(d),l=r*Math.cos(d)*Math.cos(d),c=Math.cos(d)*(g-M),u=s*((1-a/4-3*a*a/64-5*a*a*a/256)*d-(3*a/8+3*a*a/32+45*a*a*a/1024)*Math.sin(2*d)+(15*a*a/256+45*a*a*a/1024)*Math.sin(4*d)-35*a*a*a/3072*Math.sin(6*d));var S=n*f*(c+(1-o+l)*c*c*c/6+(5-18*o+o*o+72*l-58*r)*c*c*c*c*c/120)+5e5,p=n*(u+f*Math.tan(d)*(c*c/2+(5-o+9*l+4*l*l)*c*c*c*c/24+(61-58*o+o*o+600*l-330*r)*c*c*c*c*c*c/720));return i<0&&(p+=1e7),{northing:Math.round(p),easting:Math.round(S),zoneNumber:v,zoneLetter:Sr(i)}}function he(t){var i=t.northing,e=t.easting,s=t.zoneLetter,a=t.zoneNumber;if(a<0||a>60)return null;var n=.9996,h=6378137,r=.00669438,f,o=(1-Math.sqrt(1-r))/(1+Math.sqrt(1-r)),l,c,u,d,g,M,v,S,p,P=e-5e5,G=i;s<"N"&&(G-=1e7),v=(a-1)*6-180+3,f=r/(1-r),M=G/n,S=M/(h*(1-r/4-3*r*r/64-5*r*r*r/256)),p=S+(3*o/2-27*o*o*o/32)*Math.sin(2*S)+(21*o*o/16-55*o*o*o*o/32)*Math.sin(4*S)+151*o*o*o/96*Math.sin(6*S),l=h/Math.sqrt(1-r*Math.sin(p)*Math.sin(p)),c=Math.tan(p)*Math.tan(p),u=f*Math.cos(p)*Math.cos(p),d=h*(1-r)/Math.pow(1-r*Math.sin(p)*Math.sin(p),1.5),g=P/(l*n);var b=p-l*Math.tan(p)/d*(g*g/2-(5+3*c+10*u-4*u*u-9*f)*g*g*g*g/24+(61+90*c+298*u+45*c*c-252*f-3*u*u)*g*g*g*g*g*g/720);b=as(b);var I=(g-(1+2*c+u)*g*g*g/6+(5-2*u+28*c-3*u*u+8*f+24*c*c)*g*g*g*g*g/120)/Math.cos(p);I=v+as(I);var B;if(t.accuracy){var q=he({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});B={top:q.lat,right:q.lon,bottom:b,left:I}}else B={lat:b,lon:I};return B}function Sr(t){var i="Z";return 84>=t&&t>=72?i="X":72>t&&t>=64?i="W":64>t&&t>=56?i="V":56>t&&t>=48?i="U":48>t&&t>=40?i="T":40>t&&t>=32?i="S":32>t&&t>=24?i="R":24>t&&t>=16?i="Q":16>t&&t>=8?i="P":8>t&&t>=0?i="N":0>t&&t>=-8?i="M":-8>t&&t>=-16?i="L":-16>t&&t>=-24?i="K":-24>t&&t>=-32?i="J":-32>t&&t>=-40?i="H":-40>t&&t>=-48?i="G":-48>t&&t>=-56?i="F":-56>t&&t>=-64?i="E":-64>t&&t>=-72?i="D":-72>t&&t>=-80&&(i="C"),i}function pr(t,i){var e="00000"+t.easting,s="00000"+t.northing;return t.zoneNumber+t.zoneLetter+Pr(t.easting,t.northing,t.zoneNumber)+e.substr(e.length-5,i)+s.substr(s.length-5,i)}function Pr(t,i,e){var s=Us(e),a=Math.floor(t/1e5),n=Math.floor(i/1e5)%20;return Ar(a,n,s)}function Us(t){var i=t%ss;return i===0&&(i=ss),i}function Ar(t,i,e){var s=e-1,a=Os.charCodeAt(s),n=Ts.charCodeAt(s),h=a+t-1,r=n+i,f=!1;h>kt&&(h=h-kt+Gt-1,f=!0),(h===H||a<H&&h>H||(h>H||a<H)&&f)&&h++,(h===it||a<it&&h>it||(h>it||a<it)&&f)&&(h++,h===H&&h++),h>kt&&(h=h-kt+Gt-1),r>qt?(r=r-qt+Gt-1,f=!0):f=!1,(r===H||n<H&&r>H||(r>H||n<H)&&f)&&r++,(r===it||n<it&&r>it||(r>it||n<it)&&f)&&(r++,r===H&&r++),r>qt&&(r=r-qt+Gt-1);var o=String.fromCharCode(h)+String.fromCharCode(r);return o}function qs(t){if(t&&t.length===0)throw"MGRSPoint coverting from nothing";for(var i=t.length,e=null,s="",a,n=0;!/[A-Z]/.test(a=t.charAt(n));){if(n>=2)throw"MGRSPoint bad conversion from: "+t;s+=a,n++}var h=parseInt(s,10);if(n===0||n+3>i)throw"MGRSPoint bad conversion from: "+t;var r=t.charAt(n++);if(r<="A"||r==="B"||r==="Y"||r>="Z"||r==="I"||r==="O")throw"MGRSPoint zone letter "+r+" not handled: "+t;e=t.substring(n,n+=2);for(var f=Us(h),o=br(e.charAt(0),f),l=Cr(e.charAt(1),f);l<Gr(r);)l+=2e6;var c=i-n;if(c%2!==0)throw`MGRSPoint has to have an even number
|
||
of digits after the zone letter and two 100km letters - front
|
||
half for easting meters, second half for
|
||
northing meters`+t;var u=c/2,d=0,g=0,M,v,S,p,P;return u>0&&(M=1e5/Math.pow(10,u),v=t.substring(n,n+u),d=parseFloat(v)*M,S=t.substring(n+u),g=parseFloat(S)*M),p=d+o,P=g+l,{easting:p,northing:P,zoneLetter:r,zoneNumber:h,accuracy:M}}function br(t,i){for(var e=Os.charCodeAt(i-1),s=1e5,a=!1;e!==t.charCodeAt(0);){if(e++,e===H&&e++,e===it&&e++,e>kt){if(a)throw"Bad character: "+t;e=Gt,a=!0}s+=1e5}return s}function Cr(t,i){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var e=Ts.charCodeAt(i-1),s=0,a=!1;e!==t.charCodeAt(0);){if(e++,e===H&&e++,e===it&&e++,e>qt){if(a)throw"Bad character: "+t;e=Gt,a=!0}s+=1e5}return s}function Gr(t){var i;switch(t){case"C":i=11e5;break;case"D":i=2e6;break;case"E":i=28e5;break;case"F":i=37e5;break;case"G":i=46e5;break;case"H":i=55e5;break;case"J":i=64e5;break;case"K":i=73e5;break;case"L":i=82e5;break;case"M":i=91e5;break;case"N":i=0;break;case"P":i=8e5;break;case"Q":i=17e5;break;case"R":i=26e5;break;case"S":i=35e5;break;case"T":i=44e5;break;case"U":i=53e5;break;case"V":i=62e5;break;case"W":i=7e6;break;case"X":i=79e5;break;default:i=-1}if(i>=0)return i;throw"Invalid zone letter: "+t}function Rt(t,i,e){if(!(this instanceof Rt))return new Rt(t,i,e);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if(typeof t=="object")this.x=t.x,this.y=t.y,this.z=t.z||0;else if(typeof t=="string"&&typeof i>"u"){var s=t.split(",");this.x=parseFloat(s[0]),this.y=parseFloat(s[1]),this.z=parseFloat(s[2])||0}else this.x=t,this.y=i,this.z=e||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Rt.fromMGRS=function(t){return new Rt(Ls(t))};Rt.prototype.toMGRS=function(t){return Fs([this.x,this.y],t)};var Ir=1,Nr=.25,rs=.046875,ns=.01953125,hs=.01068115234375,Dr=.75,Rr=.46875,Br=.013020833333333334,Or=.007120768229166667,Tr=.3645833333333333,Fr=.005696614583333333,Lr=.3076171875;function oe(t){var i=[];i[0]=Ir-t*(Nr+t*(rs+t*(ns+t*hs))),i[1]=t*(Dr-t*(rs+t*(ns+t*hs)));var e=t*t;return i[2]=e*(Rr-t*(Br+t*Or)),e*=t,i[3]=e*(Tr-t*Fr),i[4]=e*t*Lr,i}function Ot(t,i,e,s){return e*=i,i*=i,s[0]*t-e*(s[1]+i*(s[2]+i*(s[3]+i*s[4])))}var Ur=20;function fe(t,i,e){for(var s=1/(1-i),a=t,n=Ur;n;--n){var h=Math.sin(a),r=1-i*h*h;if(r=(Ot(a,h,Math.cos(a),e)-t)*(r*Math.sqrt(r))*s,a-=r,Math.abs(r)<x)return a}return a}function qr(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.es&&(this.en=oe(this.es),this.ml0=Ot(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function kr(t){var i=t.x,e=t.y,s=w(i-this.long0,this.over),a,n,h,r=Math.sin(e),f=Math.cos(e);if(this.es){var l=f*s,c=Math.pow(l,2),u=this.ep2*Math.pow(f,2),d=Math.pow(u,2),g=Math.abs(f)>x?Math.tan(e):0,M=Math.pow(g,2),v=Math.pow(M,2);a=1-this.es*Math.pow(r,2),l=l/Math.sqrt(a);var S=Ot(e,r,f,this.en);n=this.a*(this.k0*l*(1+c/6*(1-M+u+c/20*(5-18*M+v+14*u-58*M*u+c/42*(61+179*v-v*M-479*M)))))+this.x0,h=this.a*(this.k0*(S-this.ml0+r*s*l/2*(1+c/12*(5-M+9*u+4*d+c/30*(61+v-58*M+270*u-330*M*u+c/56*(1385+543*v-v*M-3111*M))))))+this.y0}else{var o=f*Math.sin(s);if(Math.abs(Math.abs(o)-1)<x)return 93;if(n=.5*this.a*this.k0*Math.log((1+o)/(1-o))+this.x0,h=f*Math.cos(s)/Math.sqrt(1-Math.pow(o,2)),o=Math.abs(h),o>=1){if(o-1>x)return 93;h=0}else h=Math.acos(h);e<0&&(h=-h),h=this.a*this.k0*(h-this.lat0)+this.y0}return t.x=n,t.y=h,t}function zr(t){var i,e,s,a,n=(t.x-this.x0)*(1/this.a),h=(t.y-this.y0)*(1/this.a);if(this.es)if(i=this.ml0+h/this.k0,e=fe(i,this.es,this.en),Math.abs(e)<m){var c=Math.sin(e),u=Math.cos(e),d=Math.abs(u)>x?Math.tan(e):0,g=this.ep2*Math.pow(u,2),M=Math.pow(g,2),v=Math.pow(d,2),S=Math.pow(v,2);i=1-this.es*Math.pow(c,2);var p=n*Math.sqrt(i)/this.k0,P=Math.pow(p,2);i=i*d,s=e-i*P/(1-this.es)*.5*(1-P/12*(5+3*v-9*g*v+g-4*M-P/30*(61+90*v-252*g*v+45*S+46*g-P/56*(1385+3633*v+4095*S+1574*S*v)))),a=w(this.long0+p*(1-P/6*(1+2*v+g-P/20*(5+28*v+24*S+8*g*v+6*g-P/42*(61+662*v+1320*S+720*S*v))))/u,this.over)}else s=m*ti(h),a=0;else{var r=Math.exp(n/this.k0),f=.5*(r-1/r),o=this.lat0+h/this.k0,l=Math.cos(o);i=Math.sqrt((1-Math.pow(l,2))/(1+Math.pow(f,2))),s=Math.asin(i),h<0&&(s=-s),f===0&&l===0?a=0:a=w(Math.atan2(f,l)+this.long0,this.over)}return t.x=a,t.y=s,t}var jr=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const gi={init:qr,forward:kr,inverse:zr,names:jr};function ks(t){var i=Math.exp(t);return i=(i-1/i)/2,i}function V(t,i){t=Math.abs(t),i=Math.abs(i);var e=Math.max(t,i),s=Math.min(t,i)/(e||1);return e*Math.sqrt(1+Math.pow(s,2))}function $r(t){var i=1+t,e=i-1;return e===0?t:t*Math.log(i)/e}function Wr(t){var i=Math.abs(t);return i=$r(i*(1+i/(V(1,i)+1))),t<0?-i:i}function le(t,i){for(var e=2*Math.cos(2*i),s=t.length-1,a=t[s],n=0,h;--s>=0;)h=-n+e*a+t[s],n=a,a=h;return i+h*Math.sin(2*i)}function Hr(t,i){for(var e=2*Math.cos(i),s=t.length-1,a=t[s],n=0,h;--s>=0;)h=-n+e*a+t[s],n=a,a=h;return Math.sin(i)*h}function Vr(t){var i=Math.exp(t);return i=(i+1/i)/2,i}function zs(t,i,e){for(var s=Math.sin(i),a=Math.cos(i),n=ks(e),h=Vr(e),r=2*a*h,f=-2*s*n,o=t.length-1,l=t[o],c=0,u=0,d=0,g,M;--o>=0;)g=u,M=c,u=l,c=d,l=-g+r*u-f*c+t[o],d=-M+f*u+r*c;return r=s*h,f=a*n,[r*l-f*d,r*d+f*l]}function Xr(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(gi.init.apply(this),this.forward=gi.forward,this.inverse=gi.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),i=t/(2-t),e=i;this.cgb[0]=i*(2+i*(-2/3+i*(-2+i*(116/45+i*(26/45+i*(-2854/675)))))),this.cbg[0]=i*(-2+i*(2/3+i*(4/3+i*(-82/45+i*(32/45+i*(4642/4725)))))),e=e*i,this.cgb[1]=e*(7/3+i*(-8/5+i*(-227/45+i*(2704/315+i*(2323/945))))),this.cbg[1]=e*(5/3+i*(-16/15+i*(-13/9+i*(904/315+i*(-1522/945))))),e=e*i,this.cgb[2]=e*(56/15+i*(-136/35+i*(-1262/105+i*(73814/2835)))),this.cbg[2]=e*(-26/15+i*(34/21+i*(8/5+i*(-12686/2835)))),e=e*i,this.cgb[3]=e*(4279/630+i*(-332/35+i*(-399572/14175))),this.cbg[3]=e*(1237/630+i*(-12/5+i*(-24832/14175))),e=e*i,this.cgb[4]=e*(4174/315+i*(-144838/6237)),this.cbg[4]=e*(-734/315+i*(109598/31185)),e=e*i,this.cgb[5]=e*(601676/22275),this.cbg[5]=e*(444337/155925),e=Math.pow(i,2),this.Qn=this.k0/(1+i)*(1+e*(1/4+e*(1/64+e/256))),this.utg[0]=i*(-.5+i*(2/3+i*(-37/96+i*(1/360+i*(81/512+i*(-96199/604800)))))),this.gtu[0]=i*(.5+i*(-2/3+i*(5/16+i*(41/180+i*(-127/288+i*(7891/37800)))))),this.utg[1]=e*(-1/48+i*(-1/15+i*(437/1440+i*(-46/105+i*(1118711/3870720))))),this.gtu[1]=e*(13/48+i*(-3/5+i*(557/1440+i*(281/630+i*(-1983433/1935360))))),e=e*i,this.utg[2]=e*(-17/480+i*(37/840+i*(209/4480+i*(-5569/90720)))),this.gtu[2]=e*(61/240+i*(-103/140+i*(15061/26880+i*(167603/181440)))),e=e*i,this.utg[3]=e*(-4397/161280+i*(11/504+i*(830251/7257600))),this.gtu[3]=e*(49561/161280+i*(-179/168+i*(6601661/7257600))),e=e*i,this.utg[4]=e*(-4583/161280+i*(108847/3991680)),this.gtu[4]=e*(34729/80640+i*(-3418889/1995840)),e=e*i,this.utg[5]=e*(-20648693/638668800),this.gtu[5]=e*(212378941/319334400);var s=le(this.cbg,this.lat0);this.Zb=-this.Qn*(s+Hr(this.gtu,2*s))}function Zr(t){var i=w(t.x-this.long0,this.over),e=t.y;e=le(this.cbg,e);var s=Math.sin(e),a=Math.cos(e),n=Math.sin(i),h=Math.cos(i);e=Math.atan2(s,h*a),i=Math.atan2(n*a,V(s,a*h)),i=Wr(Math.tan(i));var r=zs(this.gtu,2*e,2*i);e=e+r[0],i=i+r[1];var f,o;return Math.abs(i)<=2.623395162778?(f=this.a*(this.Qn*i)+this.x0,o=this.a*(this.Qn*e+this.Zb)+this.y0):(f=1/0,o=1/0),t.x=f,t.y=o,t}function Qr(t){var i=(t.x-this.x0)*(1/this.a),e=(t.y-this.y0)*(1/this.a);e=(e-this.Zb)/this.Qn,i=i/this.Qn;var s,a;if(Math.abs(i)<=2.623395162778){var n=zs(this.utg,2*e,2*i);e=e+n[0],i=i+n[1],i=Math.atan(ks(i));var h=Math.sin(e),r=Math.cos(e),f=Math.sin(i),o=Math.cos(i);e=Math.atan2(h*o,V(f,o*r)),i=Math.atan2(f,o*r),s=w(i+this.long0,this.over),a=le(this.cgb,e)}else s=1/0,a=1/0;return t.x=s,t.y=a,t}var Kr=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const _i={init:Xr,forward:Zr,inverse:Qr,names:Kr};function Jr(t,i){if(t===void 0){if(t=Math.floor((w(i)+Math.PI)*30/Math.PI)+1,t<0)return 0;if(t>60)return 60}return t}var Yr="etmerc";function tn(){var t=Jr(this.zone,this.long0);if(t===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*T,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,_i.init.apply(this),this.forward=_i.forward,this.inverse=_i.inverse}var en=["Universal Transverse Mercator System","utm"];const sn={init:tn,names:en,dependsOn:Yr};function ue(t,i){return Math.pow((1-t)/(1+t),i)}var an=20;function rn(){var t=Math.sin(this.lat0),i=Math.cos(this.lat0);i*=i,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*i*i/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+D)/(Math.pow(Math.tan(.5*this.lat0+D),this.C)*ue(this.e*t,this.ratexp))}function nn(t){var i=t.x,e=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*e+D),this.C)*ue(this.e*Math.sin(e),this.ratexp))-m,t.x=this.C*i,t}function hn(t){for(var i=1e-14,e=t.x/this.C,s=t.y,a=Math.pow(Math.tan(.5*s+D)/this.K,1/this.C),n=an;n>0&&(s=2*Math.atan(a*ue(this.e*Math.sin(t.y),-.5*this.e))-m,!(Math.abs(s-t.y)<i));--n)t.y=s;return n?(t.x=e,t.y=s,t):null}const ce={init:rn,forward:nn,inverse:hn};function on(){ce.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))}function fn(t){var i,e,s,a;return t.x=w(t.x-this.long0,this.over),ce.forward.apply(this,[t]),i=Math.sin(t.y),e=Math.cos(t.y),s=Math.cos(t.x),a=this.k0*this.R2/(1+this.sinc0*i+this.cosc0*e*s),t.x=a*e*Math.sin(t.x),t.y=a*(this.cosc0*i-this.sinc0*e*s),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function ln(t){var i,e,s,a,n;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,n=V(t.x,t.y)){var h=2*Math.atan2(n,this.R2);i=Math.sin(h),e=Math.cos(h),a=Math.asin(e*this.sinc0+t.y*i*this.cosc0/n),s=Math.atan2(t.x*i,n*this.cosc0*e-t.y*this.sinc0*i)}else a=this.phic0,s=0;return t.x=s,t.y=a,ce.inverse.apply(this,[t]),t.x=w(t.x+this.long0,this.over),t}var un=["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"];const cn={init:on,forward:fn,inverse:ln,names:un};function de(t,i,e){return i*=e,Math.tan(.5*(m+t))*Math.pow((1-i)/(1+i),.5*e)}function dn(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=x&&(this.k0=.5*(1+ti(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=x&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=x&&Math.abs(Math.cos(this.lat_ts))>x&&(this.k0=.5*this.cons*ht(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/at(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=ht(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(de(this.lat0,this.sinlat0,this.e))-m,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function gn(t){var i=t.x,e=t.y,s=Math.sin(e),a=Math.cos(e),n,h,r,f,o,l,c=w(i-this.long0,this.over);return Math.abs(Math.abs(i-this.long0)-Math.PI)<=x&&Math.abs(e+this.lat0)<=x?(t.x=NaN,t.y=NaN,t):this.sphere?(n=2*this.k0/(1+this.sinlat0*s+this.coslat0*a*Math.cos(c)),t.x=this.a*n*a*Math.sin(c)+this.x0,t.y=this.a*n*(this.coslat0*s-this.sinlat0*a*Math.cos(c))+this.y0,t):(h=2*Math.atan(de(e,s,this.e))-m,f=Math.cos(h),r=Math.sin(h),Math.abs(this.coslat0)<=x?(o=at(this.e,e*this.con,this.con*s),l=2*this.a*this.k0*o/this.cons,t.x=this.x0+l*Math.sin(i-this.long0),t.y=this.y0-this.con*l*Math.cos(i-this.long0),t):(Math.abs(this.sinlat0)<x?(n=2*this.a*this.k0/(1+f*Math.cos(c)),t.y=n*r):(n=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*r+this.cosX0*f*Math.cos(c))),t.y=n*(this.cosX0*r-this.sinX0*f*Math.cos(c))+this.y0),t.x=n*f*Math.sin(c)+this.x0,t))}function _n(t){t.x-=this.x0,t.y-=this.y0;var i,e,s,a,n,h=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var r=2*Math.atan(h/(2*this.a*this.k0));return i=this.long0,e=this.lat0,h<=x?(t.x=i,t.y=e,t):(e=Math.asin(Math.cos(r)*this.sinlat0+t.y*Math.sin(r)*this.coslat0/h),Math.abs(this.coslat0)<x?this.lat0>0?i=w(this.long0+Math.atan2(t.x,-1*t.y),this.over):i=w(this.long0+Math.atan2(t.x,t.y),this.over):i=w(this.long0+Math.atan2(t.x*Math.sin(r),h*this.coslat0*Math.cos(r)-t.y*this.sinlat0*Math.sin(r)),this.over),t.x=i,t.y=e,t)}else if(Math.abs(this.coslat0)<=x){if(h<=x)return e=this.lat0,i=this.long0,t.x=i,t.y=e,t;t.x*=this.con,t.y*=this.con,s=h*this.cons/(2*this.a*this.k0),e=this.con*Qt(this.e,s),i=this.con*w(this.con*this.long0+Math.atan2(t.x,-1*t.y),this.over)}else a=2*Math.atan(h*this.cosX0/(2*this.a*this.k0*this.ms1)),i=this.long0,h<=x?n=this.X0:(n=Math.asin(Math.cos(a)*this.sinX0+t.y*Math.sin(a)*this.cosX0/h),i=w(this.long0+Math.atan2(t.x*Math.sin(a),h*this.cosX0*Math.cos(a)-t.y*this.sinX0*Math.sin(a)),this.over)),e=-1*Qt(this.e,Math.tan(.5*(m+n)));return t.x=i,t.y=e,t}var vn=["stere","Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"];const Mn={init:dn,forward:gn,inverse:_n,names:vn,ssfn_:de};function yn(){var t=this.lat0;this.lambda0=this.long0;var i=Math.sin(t),e=this.a,s=this.rf,a=1/s,n=2*a-Math.pow(a,2),h=this.e=Math.sqrt(n);this.R=this.k0*e*Math.sqrt(1-n)/(1-n*Math.pow(i,2)),this.alpha=Math.sqrt(1+n/(1-n)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(i/this.alpha);var r=Math.log(Math.tan(Math.PI/4+this.b0/2)),f=Math.log(Math.tan(Math.PI/4+t/2)),o=Math.log((1+h*i)/(1-h*i));this.K=r-this.alpha*f+this.alpha*h/2*o}function mn(t){var i=Math.log(Math.tan(Math.PI/4-t.y/2)),e=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),s=-this.alpha*(i+e)+this.K,a=2*(Math.atan(Math.exp(s))-Math.PI/4),n=this.alpha*(t.x-this.lambda0),h=Math.atan(Math.sin(n)/(Math.sin(this.b0)*Math.tan(a)+Math.cos(this.b0)*Math.cos(n))),r=Math.asin(Math.cos(this.b0)*Math.sin(a)-Math.sin(this.b0)*Math.cos(a)*Math.cos(n));return t.y=this.R/2*Math.log((1+Math.sin(r))/(1-Math.sin(r)))+this.y0,t.x=this.R*h+this.x0,t}function xn(t){for(var i=t.x-this.x0,e=t.y-this.y0,s=i/this.R,a=2*(Math.atan(Math.exp(e/this.R))-Math.PI/4),n=Math.asin(Math.cos(this.b0)*Math.sin(a)+Math.sin(this.b0)*Math.cos(a)*Math.cos(s)),h=Math.atan(Math.sin(s)/(Math.cos(this.b0)*Math.cos(s)-Math.sin(this.b0)*Math.tan(a))),r=this.lambda0+h/this.alpha,f=0,o=n,l=-1e3,c=0;Math.abs(o-l)>1e-7;){if(++c>20)return;f=1/this.alpha*(Math.log(Math.tan(Math.PI/4+n/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(o))/2)),l=o,o=2*Math.atan(Math.exp(f))-Math.PI/2}return t.x=r,t.y=o,t}var En=["somerc"];const wn={init:yn,forward:mn,inverse:xn,names:En};var At=1e-7;function Sn(t){var i=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],e=typeof t.projName=="object"?Object.keys(t.projName)[0]:t.projName;return"no_uoff"in t||"no_off"in t||i.indexOf(e)!==-1||i.indexOf(Is(e))!==-1}function pn(){var t,i,e,s,a,n,h,r,f,o,l=0,c,u=0,d=0,g=0,M=0,v=0,S=0;this.no_off=Sn(this),this.no_rot="no_rot"in this;var p=!1;"alpha"in this&&(p=!0);var P=!1;if("rectified_grid_angle"in this&&(P=!0),p&&(S=this.alpha),P&&(l=this.rectified_grid_angle),p||P)u=this.longc;else if(d=this.long1,M=this.lat1,g=this.long2,v=this.lat2,Math.abs(M-v)<=At||(t=Math.abs(M))<=At||Math.abs(t-m)<=At||Math.abs(Math.abs(this.lat0)-m)<=At||Math.abs(Math.abs(v)-m)<=At)throw new Error;var G=1-this.es;i=Math.sqrt(G),Math.abs(this.lat0)>x?(r=Math.sin(this.lat0),e=Math.cos(this.lat0),t=1-this.es*r*r,this.B=e*e,this.B=Math.sqrt(1+this.es*this.B*this.B/G),this.A=this.B*this.k0*i/t,s=this.B*i/(e*Math.sqrt(t)),a=s*s-1,a<=0?a=0:(a=Math.sqrt(a),this.lat0<0&&(a=-a)),this.E=a+=s,this.E*=Math.pow(at(this.e,this.lat0,r),this.B)):(this.B=1/i,this.A=this.k0,this.E=s=a=1),p||P?(p?(c=Math.asin(Math.sin(S)/s),P||(l=S)):(c=l,S=Math.asin(s*Math.sin(c))),this.lam0=u-Math.asin(.5*(a-1/a)*Math.tan(c))/this.B):(n=Math.pow(at(this.e,M,Math.sin(M)),this.B),h=Math.pow(at(this.e,v,Math.sin(v)),this.B),a=this.E/n,f=(h-n)/(h+n),o=this.E*this.E,o=(o-h*n)/(o+h*n),t=d-g,t<-Math.PI?g-=Xt:t>Math.PI&&(g+=Xt),this.lam0=w(.5*(d+g)-Math.atan(o*Math.tan(.5*this.B*(d-g))/f)/this.B,this.over),c=Math.atan(2*Math.sin(this.B*w(d-this.lam0,this.over))/(a-1/a)),l=S=Math.asin(s*Math.sin(c))),this.singam=Math.sin(c),this.cosgam=Math.cos(c),this.sinrot=Math.sin(l),this.cosrot=Math.cos(l),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(s*s-1)/Math.cos(S))),this.lat0<0&&(this.u_0=-this.u_0)),a=.5*c,this.v_pole_n=this.ArB*Math.log(Math.tan(D-a)),this.v_pole_s=this.ArB*Math.log(Math.tan(D+a))}function Pn(t){var i={},e,s,a,n,h,r,f,o;if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-m)>x){if(h=this.E/Math.pow(at(this.e,t.y,Math.sin(t.y)),this.B),r=1/h,e=.5*(h-r),s=.5*(h+r),n=Math.sin(this.B*t.x),a=(e*this.singam-n*this.cosgam)/s,Math.abs(Math.abs(a)-1)<x)throw new Error;o=.5*this.ArB*Math.log((1-a)/(1+a)),r=Math.cos(this.B*t.x),Math.abs(r)<At?f=this.A*t.x:f=this.ArB*Math.atan2(e*this.cosgam+n*this.singam,r)}else o=t.y>0?this.v_pole_n:this.v_pole_s,f=this.ArB*t.y;return this.no_rot?(i.x=f,i.y=o):(f-=this.u_0,i.x=o*this.cosrot+f*this.sinrot,i.y=f*this.cosrot-o*this.sinrot),i.x=this.a*i.x+this.x0,i.y=this.a*i.y+this.y0,i}function An(t){var i,e,s,a,n,h,r,f={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(e=t.y,i=t.x):(e=t.x*this.cosrot-t.y*this.sinrot,i=t.y*this.cosrot+t.x*this.sinrot+this.u_0),s=Math.exp(-this.BrA*e),a=.5*(s-1/s),n=.5*(s+1/s),h=Math.sin(this.BrA*i),r=(h*this.cosgam+a*this.singam)/n,Math.abs(Math.abs(r)-1)<x)f.x=0,f.y=r<0?-m:m;else{if(f.y=this.E/Math.sqrt((1+r)/(1-r)),f.y=Qt(this.e,Math.pow(f.y,1/this.B)),f.y===1/0)throw new Error;f.x=-this.rB*Math.atan2(a*this.cosgam-h*this.singam,Math.cos(this.BrA*i))}return f.x+=this.lam0,f}var bn=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Variant_B","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"];const Cn={init:pn,forward:Pn,inverse:An,names:bn};function Gn(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<x)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var i=Math.sin(this.lat1),e=Math.cos(this.lat1),s=ht(this.e,i,e),a=at(this.e,this.lat1,i),n=Math.sin(this.lat2),h=Math.cos(this.lat2),r=ht(this.e,n,h),f=at(this.e,this.lat2,n),o=Math.abs(Math.abs(this.lat0)-m)<x?0:at(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>x?this.ns=Math.log(s/r)/Math.log(a/f):this.ns=i,isNaN(this.ns)&&(this.ns=i),this.f0=s/(this.ns*Math.pow(a,this.ns)),this.rh=this.a*this.f0*Math.pow(o,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function In(t){var i=t.x,e=t.y;Math.abs(2*Math.abs(e)-Math.PI)<=x&&(e=ti(e)*(m-2*x));var s=Math.abs(Math.abs(e)-m),a,n;if(s>x)a=at(this.e,e,Math.sin(e)),n=this.a*this.f0*Math.pow(a,this.ns);else{if(s=e*this.ns,s<=0)return null;n=0}var h=this.ns*w(i-this.long0,this.over);return t.x=this.k0*(n*Math.sin(h))+this.x0,t.y=this.k0*(this.rh-n*Math.cos(h))+this.y0,t}function Nn(t){var i,e,s,a,n,h=(t.x-this.x0)/this.k0,r=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(i=Math.sqrt(h*h+r*r),e=1):(i=-Math.sqrt(h*h+r*r),e=-1);var f=0;if(i!==0&&(f=Math.atan2(e*h,e*r)),i!==0||this.ns>0){if(e=1/this.ns,s=Math.pow(i/(this.a*this.f0),e),a=Qt(this.e,s),a===-9999)return null}else a=-m;return n=w(f/this.ns+this.long0,this.over),t.x=n,t.y=a,t}var Dn=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"];const Rn={init:Gn,forward:In,inverse:Nn,names:Dn};function Bn(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function On(t){var i,e,s,a,n,h,r,f=t.x,o=t.y,l=w(f-this.long0,this.over);return i=Math.pow((1+this.e*Math.sin(o))/(1-this.e*Math.sin(o)),this.alfa*this.e/2),e=2*(Math.atan(this.k*Math.pow(Math.tan(o/2+this.s45),this.alfa)/i)-this.s45),s=-l*this.alfa,a=Math.asin(Math.cos(this.ad)*Math.sin(e)+Math.sin(this.ad)*Math.cos(e)*Math.cos(s)),n=Math.asin(Math.cos(e)*Math.sin(s)/Math.cos(a)),h=this.n*n,r=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(a/2+this.s45),this.n),t.y=r*Math.cos(h)/1,t.x=r*Math.sin(h)/1,this.czech||(t.y*=-1,t.x*=-1),t}function Tn(t){var i,e,s,a,n,h,r,f,o=t.x;t.x=t.y,t.y=o,this.czech||(t.y*=-1,t.x*=-1),h=Math.sqrt(t.x*t.x+t.y*t.y),n=Math.atan2(t.y,t.x),a=n/Math.sin(this.s0),s=2*(Math.atan(Math.pow(this.ro0/h,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),i=Math.asin(Math.cos(this.ad)*Math.sin(s)-Math.sin(this.ad)*Math.cos(s)*Math.cos(a)),e=Math.asin(Math.cos(s)*Math.sin(a)/Math.cos(i)),t.x=this.long0-e/this.alfa,r=i,f=0;var l=0;do t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(i/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(r))/(1-this.e*Math.sin(r)),this.e/2))-this.s45),Math.abs(r-t.y)<1e-10&&(f=1),r=t.y,l+=1;while(f===0&&l<15);return l>=15?null:t}var Fn=["Krovak","krovak"];const Ln={init:Bn,forward:On,inverse:Tn,names:Fn};function W(t,i,e,s,a){return t*a-i*Math.sin(2*a)+e*Math.sin(4*a)-s*Math.sin(6*a)}function ii(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function ei(t){return .375*t*(1+.25*t*(1+.46875*t))}function si(t){return .05859375*t*t*(1+.75*t)}function ai(t){return t*t*t*(35/3072)}function ge(t,i,e){var s=i*e;return t/Math.sqrt(1-s*s)}function xt(t){return Math.abs(t)<m?t:t-ti(t)*Math.PI}function Ei(t,i,e,s,a){var n,h;n=t/i;for(var r=0;r<15;r++)if(h=(t-(i*n-e*Math.sin(2*n)+s*Math.sin(4*n)-a*Math.sin(6*n)))/(i-2*e*Math.cos(2*n)+4*s*Math.cos(4*n)-6*a*Math.cos(6*n)),n+=h,Math.abs(h)<=1e-10)return n;return NaN}function Un(){this.sphere||(this.e0=ii(this.es),this.e1=ei(this.es),this.e2=si(this.es),this.e3=ai(this.es),this.ml0=this.a*W(this.e0,this.e1,this.e2,this.e3,this.lat0))}function qn(t){var i,e,s=t.x,a=t.y;if(s=w(s-this.long0,this.over),this.sphere)i=this.a*Math.asin(Math.cos(a)*Math.sin(s)),e=this.a*(Math.atan2(Math.tan(a),Math.cos(s))-this.lat0);else{var n=Math.sin(a),h=Math.cos(a),r=ge(this.a,this.e,n),f=Math.tan(a)*Math.tan(a),o=s*Math.cos(a),l=o*o,c=this.es*h*h/(1-this.es),u=this.a*W(this.e0,this.e1,this.e2,this.e3,a);i=r*o*(1-l*f*(1/6-(8-f+8*c)*l/120)),e=u-this.ml0+r*n/h*l*(.5+(5-f+6*c)*l/24)}return t.x=i+this.x0,t.y=e+this.y0,t}function kn(t){t.x-=this.x0,t.y-=this.y0;var i=t.x/this.a,e=t.y/this.a,s,a;if(this.sphere){var n=e+this.lat0;s=Math.asin(Math.sin(n)*Math.cos(i)),a=Math.atan2(Math.tan(i),Math.cos(n))}else{var h=this.ml0/this.a+e,r=Ei(h,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(r)-m)<=x)return t.x=this.long0,t.y=m,e<0&&(t.y*=-1),t;var f=ge(this.a,this.e,Math.sin(r)),o=f*f*f/this.a/this.a*(1-this.es),l=Math.pow(Math.tan(r),2),c=i*this.a/f,u=c*c;s=r-f*Math.tan(r)/o*c*c*(.5-(1+3*l)*c*c/24),a=c*(1-u*(l/3+(1+3*l)*l*u/15))/Math.cos(r)}return t.x=w(a+this.long0,this.over),t.y=xt(s),t}var zn=["Cassini","Cassini_Soldner","cass"];const jn={init:Un,forward:qn,inverse:kn,names:zn};function Mt(t,i){var e;return t>1e-7?(e=t*i,(1-t*t)*(i/(1-e*e)-.5/t*Math.log((1-e)/(1+e)))):2*i}var Ki=1,Ji=2,Yi=3,vi=4;function $n(){var t=Math.abs(this.lat0);if(Math.abs(t-m)<x?this.mode=this.lat0<0?Ki:Ji:Math.abs(t)<x?this.mode=Yi:this.mode=vi,this.es>0){var i;switch(this.qp=Mt(this.e,1),this.mmf=.5/(1-this.es),this.apa=Yn(this.es),this.mode){case Ji:this.dd=1;break;case Ki:this.dd=1;break;case Yi:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case vi:this.rq=Math.sqrt(.5*this.qp),i=Math.sin(this.lat0),this.sinb1=Mt(this.e,i)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*i*i)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===vi&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function Wn(t){var i,e,s,a,n,h,r,f,o,l,c=t.x,u=t.y;if(c=w(c-this.long0,this.over),this.sphere){if(n=Math.sin(u),l=Math.cos(u),s=Math.cos(c),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(e=this.mode===this.EQUIT?1+l*s:1+this.sinph0*n+this.cosph0*l*s,e<=x)return null;e=Math.sqrt(2/e),i=e*l*Math.sin(c),e*=this.mode===this.EQUIT?n:this.cosph0*n-this.sinph0*l*s}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(s=-s),Math.abs(u+this.lat0)<x)return null;e=D-u*.5,e=2*(this.mode===this.S_POLE?Math.cos(e):Math.sin(e)),i=e*Math.sin(c),e*=s}}else{switch(r=0,f=0,o=0,s=Math.cos(c),a=Math.sin(c),n=Math.sin(u),h=Mt(this.e,n),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(r=h/this.qp,f=Math.sqrt(1-r*r)),this.mode){case this.OBLIQ:o=1+this.sinb1*r+this.cosb1*f*s;break;case this.EQUIT:o=1+f*s;break;case this.N_POLE:o=m+u,h=this.qp-h;break;case this.S_POLE:o=u-m,h=this.qp+h;break}if(Math.abs(o)<x)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:o=Math.sqrt(2/o),this.mode===this.OBLIQ?e=this.ymf*o*(this.cosb1*r-this.sinb1*f*s):e=(o=Math.sqrt(2/(1+f*s)))*r*this.ymf,i=this.xmf*o*f*a;break;case this.N_POLE:case this.S_POLE:h>=0?(i=(o=Math.sqrt(h))*a,e=s*(this.mode===this.S_POLE?o:-o)):i=e=0;break}}return t.x=this.a*i+this.x0,t.y=this.a*e+this.y0,t}function Hn(t){t.x-=this.x0,t.y-=this.y0;var i=t.x/this.a,e=t.y/this.a,s,a,n,h,r,f,o;if(this.sphere){var l=0,c,u=0;if(c=Math.sqrt(i*i+e*e),a=c*.5,a>1)return null;switch(a=2*Math.asin(a),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(u=Math.sin(a),l=Math.cos(a)),this.mode){case this.EQUIT:a=Math.abs(c)<=x?0:Math.asin(e*u/c),i*=u,e=l*c;break;case this.OBLIQ:a=Math.abs(c)<=x?this.lat0:Math.asin(l*this.sinph0+e*u*this.cosph0/c),i*=u*this.cosph0,e=(l-Math.sin(a)*this.sinph0)*c;break;case this.N_POLE:e=-e,a=m-a;break;case this.S_POLE:a-=m;break}s=e===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(i,e)}else{if(o=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(i/=this.dd,e*=this.dd,f=Math.sqrt(i*i+e*e),f<x)return t.x=this.long0,t.y=this.lat0,t;h=2*Math.asin(.5*f/this.rq),n=Math.cos(h),i*=h=Math.sin(h),this.mode===this.OBLIQ?(o=n*this.sinb1+e*h*this.cosb1/f,r=this.qp*o,e=f*this.cosb1*n-e*this.sinb1*h):(o=e*h/f,r=this.qp*o,e=f*n)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(e=-e),r=i*i+e*e,!r)return t.x=this.long0,t.y=this.lat0,t;o=1-r/this.qp,this.mode===this.S_POLE&&(o=-o)}s=Math.atan2(i,e),a=th(Math.asin(o),this.apa)}return t.x=w(this.long0+s,this.over),t.y=a,t}var Vn=.3333333333333333,Xn=.17222222222222222,Zn=.10257936507936508,Qn=.06388888888888888,Kn=.0664021164021164,Jn=.016415012942191543;function Yn(t){var i,e=[];return e[0]=t*Vn,i=t*t,e[0]+=i*Xn,e[1]=i*Qn,i*=t,e[0]+=i*Zn,e[1]+=i*Kn,e[2]=i*Jn,e}function th(t,i){var e=t+t;return t+i[0]*Math.sin(e)+i[1]*Math.sin(e+e)+i[2]*Math.sin(e+e+e)}var ih=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"];const eh={init:$n,forward:Wn,inverse:Hn,names:ih,S_POLE:Ki,N_POLE:Ji,EQUIT:Yi,OBLIQ:vi};function mt(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)}function sh(){Math.abs(this.lat1+this.lat2)<x||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=ht(this.e3,this.sin_po,this.cos_po),this.qs1=Mt(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=ht(this.e3,this.sin_po,this.cos_po),this.qs2=Mt(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=Mt(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>x?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function ah(t){var i=t.x,e=t.y;this.sin_phi=Math.sin(e),this.cos_phi=Math.cos(e);var s=Mt(this.e3,this.sin_phi),a=this.a*Math.sqrt(this.c-this.ns0*s)/this.ns0,n=this.ns0*w(i-this.long0,this.over),h=a*Math.sin(n)+this.x0,r=this.rh-a*Math.cos(n)+this.y0;return t.x=h,t.y=r,t}function rh(t){var i,e,s,a,n,h;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(i=Math.sqrt(t.x*t.x+t.y*t.y),s=1):(i=-Math.sqrt(t.x*t.x+t.y*t.y),s=-1),a=0,i!==0&&(a=Math.atan2(s*t.x,s*t.y)),s=i*this.ns0/this.a,this.sphere?h=Math.asin((this.c-s*s)/(2*this.ns0)):(e=(this.c-s*s)/this.ns0,h=this.phi1z(this.e3,e)),n=w(a/this.ns0+this.long0,this.over),t.x=n,t.y=h,t}function nh(t,i){var e,s,a,n,h,r=mt(.5*i);if(t<x)return r;for(var f=t*t,o=1;o<=25;o++)if(e=Math.sin(r),s=Math.cos(r),a=t*e,n=1-a*a,h=.5*n*n/s*(i/(1-f)-e/n+.5/t*Math.log((1-a)/(1+a))),r=r+h,Math.abs(h)<=1e-7)return r;return null}var hh=["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers","aea"];const oh={init:sh,forward:ah,inverse:rh,names:hh,phi1z:nh};function fh(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function lh(t){var i,e,s,a,n,h,r,f,o=t.x,l=t.y;return s=w(o-this.long0,this.over),i=Math.sin(l),e=Math.cos(l),a=Math.cos(s),h=this.sin_p14*i+this.cos_p14*e*a,n=1,h>0||Math.abs(h)<=x?(r=this.x0+this.a*n*e*Math.sin(s)/h,f=this.y0+this.a*n*(this.cos_p14*i-this.sin_p14*e*a)/h):(r=this.x0+this.infinity_dist*e*Math.sin(s),f=this.y0+this.infinity_dist*(this.cos_p14*i-this.sin_p14*e*a)),t.x=r,t.y=f,t}function uh(t){var i,e,s,a,n,h;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(i=Math.sqrt(t.x*t.x+t.y*t.y))?(a=Math.atan2(i,this.rc),e=Math.sin(a),s=Math.cos(a),h=mt(s*this.sin_p14+t.y*e*this.cos_p14/i),n=Math.atan2(t.x*e,i*this.cos_p14*s-t.y*this.sin_p14*e),n=w(this.long0+n,this.over)):(h=this.phic0,n=0),t.x=n,t.y=h,t}var ch=["gnom"];const dh={init:fh,forward:lh,inverse:uh,names:ch};function gh(t,i){var e=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(i)-e)<1e-6)return i<0?-1*m:m;for(var s=Math.asin(.5*i),a,n,h,r,f=0;f<30;f++)if(n=Math.sin(s),h=Math.cos(s),r=t*n,a=Math.pow(1-r*r,2)/(2*h)*(i/(1-t*t)-n/(1-r*r)+.5/t*Math.log((1-r)/(1+r))),s+=a,Math.abs(a)<=1e-10)return s;return NaN}function _h(){this.sphere||(this.k0=ht(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function vh(t){var i=t.x,e=t.y,s,a,n=w(i-this.long0,this.over);if(this.sphere)s=this.x0+this.a*n*Math.cos(this.lat_ts),a=this.y0+this.a*Math.sin(e)/Math.cos(this.lat_ts);else{var h=Mt(this.e,Math.sin(e));s=this.x0+this.a*this.k0*n,a=this.y0+this.a*h*.5/this.k0}return t.x=s,t.y=a,t}function Mh(t){t.x-=this.x0,t.y-=this.y0;var i,e;return this.sphere?(i=w(this.long0+t.x/this.a/Math.cos(this.lat_ts),this.over),e=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(e=gh(this.e,2*t.y*this.k0/this.a),i=w(this.long0+t.x/(this.a*this.k0),this.over)),t.x=i,t.y=e,t}var yh=["cea"];const mh={init:_h,forward:vh,inverse:Mh,names:yh};function xh(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function Eh(t){var i=t.x,e=t.y,s=w(i-this.long0,this.over),a=xt(e-this.lat0);return t.x=this.x0+this.a*s*this.rc,t.y=this.y0+this.a*a,t}function wh(t){var i=t.x,e=t.y;return t.x=w(this.long0+(i-this.x0)/(this.a*this.rc),this.over),t.y=xt(this.lat0+(e-this.y0)/this.a),t}var Sh=["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical","eqc"];const ph={init:xh,forward:Eh,inverse:wh,names:Sh};var os=20;function Ph(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=ii(this.es),this.e1=ei(this.es),this.e2=si(this.es),this.e3=ai(this.es),this.ml0=this.a*W(this.e0,this.e1,this.e2,this.e3,this.lat0)}function Ah(t){var i=t.x,e=t.y,s,a,n,h=w(i-this.long0,this.over);if(n=h*Math.sin(e),this.sphere)Math.abs(e)<=x?(s=this.a*h,a=-1*this.a*this.lat0):(s=this.a*Math.sin(n)/Math.tan(e),a=this.a*(xt(e-this.lat0)+(1-Math.cos(n))/Math.tan(e)));else if(Math.abs(e)<=x)s=this.a*h,a=-1*this.ml0;else{var r=ge(this.a,this.e,Math.sin(e))/Math.tan(e);s=r*Math.sin(n),a=this.a*W(this.e0,this.e1,this.e2,this.e3,e)-this.ml0+r*(1-Math.cos(n))}return t.x=s+this.x0,t.y=a+this.y0,t}function bh(t){var i,e,s,a,n,h,r,f,o;if(s=t.x-this.x0,a=t.y-this.y0,this.sphere)if(Math.abs(a+this.a*this.lat0)<=x)i=w(s/this.a+this.long0,this.over),e=0;else{h=this.lat0+a/this.a,r=s*s/this.a/this.a+h*h,f=h;var l;for(n=os;n;--n)if(l=Math.tan(f),o=-1*(h*(f*l+1)-f-.5*(f*f+r)*l)/((f-h)/l-1),f+=o,Math.abs(o)<=x){e=f;break}i=w(this.long0+Math.asin(s*Math.tan(f)/this.a)/Math.sin(e),this.over)}else if(Math.abs(a+this.ml0)<=x)e=0,i=w(this.long0+s/this.a,this.over);else{h=(this.ml0+a)/this.a,r=s*s/this.a/this.a+h*h,f=h;var c,u,d,g,M;for(n=os;n;--n)if(M=this.e*Math.sin(f),c=Math.sqrt(1-M*M)*Math.tan(f),u=this.a*W(this.e0,this.e1,this.e2,this.e3,f),d=this.e0-2*this.e1*Math.cos(2*f)+4*this.e2*Math.cos(4*f)-6*this.e3*Math.cos(6*f),g=u/this.a,o=(h*(c*g+1)-g-.5*c*(g*g+r))/(this.es*Math.sin(2*f)*(g*g+r-2*h*g)/(4*c)+(h-g)*(c*d-2/Math.sin(2*f))-d),f-=o,Math.abs(o)<=x){e=f;break}c=Math.sqrt(1-this.es*Math.pow(Math.sin(e),2))*Math.tan(e),i=w(this.long0+Math.asin(s*c/this.a)/Math.sin(e),this.over)}return t.x=i,t.y=e,t}var Ch=["Polyconic","American_Polyconic","poly"];const Gh={init:Ph,forward:Ah,inverse:bh,names:Ch};function Ih(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function Nh(t){var i,e=t.x,s=t.y,a=s-this.lat0,n=e-this.long0,h=a/jt*1e-5,r=n,f=1,o=0;for(i=1;i<=10;i++)f=f*h,o=o+this.A[i]*f;var l=o,c=r,u=1,d=0,g,M,v=0,S=0;for(i=1;i<=6;i++)g=u*l-d*c,M=d*l+u*c,u=g,d=M,v=v+this.B_re[i]*u-this.B_im[i]*d,S=S+this.B_im[i]*u+this.B_re[i]*d;return t.x=S*this.a+this.x0,t.y=v*this.a+this.y0,t}function Dh(t){var i,e=t.x,s=t.y,a=e-this.x0,n=s-this.y0,h=n/this.a,r=a/this.a,f=1,o=0,l,c,u=0,d=0;for(i=1;i<=6;i++)l=f*h-o*r,c=o*h+f*r,f=l,o=c,u=u+this.C_re[i]*f-this.C_im[i]*o,d=d+this.C_im[i]*f+this.C_re[i]*o;for(var g=0;g<this.iterations;g++){var M=u,v=d,S,p,P=h,G=r;for(i=2;i<=6;i++)S=M*u-v*d,p=v*u+M*d,M=S,v=p,P=P+(i-1)*(this.B_re[i]*M-this.B_im[i]*v),G=G+(i-1)*(this.B_im[i]*M+this.B_re[i]*v);M=1,v=0;var b=this.B_re[1],I=this.B_im[1];for(i=2;i<=6;i++)S=M*u-v*d,p=v*u+M*d,M=S,v=p,b=b+i*(this.B_re[i]*M-this.B_im[i]*v),I=I+i*(this.B_im[i]*M+this.B_re[i]*v);var B=b*b+I*I;u=(P*b+G*I)/B,d=(G*b-P*I)/B}var q=u,U=d,rt=1,z=0;for(i=1;i<=9;i++)rt=rt*q,z=z+this.D[i]*rt;var _=this.lat0+z*jt*1e5,y=this.long0+U;return t.x=y,t.y=_,t}var Rh=["New_Zealand_Map_Grid","nzmg"];const Bh={init:Ih,forward:Nh,inverse:Dh,names:Rh};function Oh(){}function Th(t){var i=t.x,e=t.y,s=w(i-this.long0,this.over),a=this.x0+this.a*s,n=this.y0+this.a*Math.log(Math.tan(Math.PI/4+e/2.5))*1.25;return t.x=a,t.y=n,t}function Fh(t){t.x-=this.x0,t.y-=this.y0;var i=w(this.long0+t.x/this.a,this.over),e=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);return t.x=i,t.y=e,t}var Lh=["Miller_Cylindrical","mill"];const Uh={init:Oh,forward:Th,inverse:Fh,names:Lh};var qh=20;function kh(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=oe(this.es)}function zh(t){var i,e,s=t.x,a=t.y;if(s=w(s-this.long0,this.over),this.sphere){if(!this.m)a=this.n!==1?Math.asin(this.n*Math.sin(a)):a;else for(var n=this.n*Math.sin(a),h=qh;h;--h){var r=(this.m*a+Math.sin(a)-n)/(this.m+Math.cos(a));if(a-=r,Math.abs(r)<x)break}i=this.a*this.C_x*s*(this.m+Math.cos(a)),e=this.a*this.C_y*a}else{var f=Math.sin(a),o=Math.cos(a);e=this.a*Ot(a,f,o,this.en),i=this.a*s*o/Math.sqrt(1-this.es*f*f)}return t.x=i,t.y=e,t}function jh(t){var i,e,s,a;return t.x-=this.x0,s=t.x/this.a,t.y-=this.y0,i=t.y/this.a,this.sphere?(i/=this.C_y,s=s/(this.C_x*(this.m+Math.cos(i))),this.m?i=mt((this.m*i+Math.sin(i))/this.n):this.n!==1&&(i=mt(Math.sin(i)/this.n)),s=w(s+this.long0,this.over),i=xt(i)):(i=fe(t.y/this.a,this.es,this.en),a=Math.abs(i),a<m?(a=Math.sin(i),e=this.long0+t.x*Math.sqrt(1-this.es*a*a)/(this.a*Math.cos(i)),s=w(e,this.over)):a-x<m&&(s=this.long0)),t.x=s,t.y=i,t}var $h=["Sinusoidal","sinu"];const Wh={init:kh,forward:zh,inverse:jh,names:$h};function Hh(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0}function Vh(t){for(var i=t.x,e=t.y,s=w(i-this.long0,this.over),a=e,n=Math.PI*Math.sin(e);;){var h=-(a+Math.sin(a)-n)/(1+Math.cos(a));if(a+=h,Math.abs(h)<x)break}a/=2,Math.PI/2-Math.abs(e)<x&&(s=0);var r=.900316316158*this.a*s*Math.cos(a)+this.x0,f=1.4142135623731*this.a*Math.sin(a)+this.y0;return t.x=r,t.y=f,t}function Xh(t){var i,e;t.x-=this.x0,t.y-=this.y0,e=t.y/(1.4142135623731*this.a),Math.abs(e)>.999999999999&&(e=.999999999999),i=Math.asin(e);var s=w(this.long0+t.x/(.900316316158*this.a*Math.cos(i)),this.over);s<-Math.PI&&(s=-Math.PI),s>Math.PI&&(s=Math.PI),e=(2*i+Math.sin(2*i))/Math.PI,Math.abs(e)>1&&(e=1);var a=Math.asin(e);return t.x=s,t.y=a,t}var Zh=["Mollweide","moll"];const Qh={init:Hh,forward:Vh,inverse:Xh,names:Zh};function Kh(){Math.abs(this.lat1+this.lat2)<x||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=ii(this.es),this.e1=ei(this.es),this.e2=si(this.es),this.e3=ai(this.es),this.sin_phi=Math.sin(this.lat1),this.cos_phi=Math.cos(this.lat1),this.ms1=ht(this.e,this.sin_phi,this.cos_phi),this.ml1=W(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<x?this.ns=this.sin_phi:(this.sin_phi=Math.sin(this.lat2),this.cos_phi=Math.cos(this.lat2),this.ms2=ht(this.e,this.sin_phi,this.cos_phi),this.ml2=W(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=W(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function Jh(t){var i=t.x,e=t.y,s;if(this.sphere)s=this.a*(this.g-e);else{var a=W(this.e0,this.e1,this.e2,this.e3,e);s=this.a*(this.g-a)}var n=this.ns*w(i-this.long0,this.over),h=this.x0+s*Math.sin(n),r=this.y0+this.rh-s*Math.cos(n);return t.x=h,t.y=r,t}function Yh(t){t.x-=this.x0,t.y=this.rh-t.y+this.y0;var i,e,s,a;this.ns>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),i=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),i=-1);var n=0;if(e!==0&&(n=Math.atan2(i*t.x,i*t.y)),this.sphere)return a=w(this.long0+n/this.ns,this.over),s=xt(this.g-e/this.a),t.x=a,t.y=s,t;var h=this.g-e/this.a;return s=Ei(h,this.e0,this.e1,this.e2,this.e3),a=w(this.long0+n/this.ns,this.over),t.x=a,t.y=s,t}var to=["Equidistant_Conic","eqdc"];const io={init:Kh,forward:Jh,inverse:Yh,names:to};function eo(){this.R=this.a}function so(t){var i=t.x,e=t.y,s=w(i-this.long0,this.over),a,n;Math.abs(e)<=x&&(a=this.x0+this.R*s,n=this.y0);var h=mt(2*Math.abs(e/Math.PI));(Math.abs(s)<=x||Math.abs(Math.abs(e)-m)<=x)&&(a=this.x0,e>=0?n=this.y0+Math.PI*this.R*Math.tan(.5*h):n=this.y0+Math.PI*this.R*-Math.tan(.5*h));var r=.5*Math.abs(Math.PI/s-s/Math.PI),f=r*r,o=Math.sin(h),l=Math.cos(h),c=l/(o+l-1),u=c*c,d=c*(2/o-1),g=d*d,M=Math.PI*this.R*(r*(c-g)+Math.sqrt(f*(c-g)*(c-g)-(g+f)*(u-g)))/(g+f);s<0&&(M=-M),a=this.x0+M;var v=f+c;return M=Math.PI*this.R*(d*v-r*Math.sqrt((g+f)*(f+1)-v*v))/(g+f),e>=0?n=this.y0+M:n=this.y0-M,t.x=a,t.y=n,t}function ao(t){var i,e,s,a,n,h,r,f,o,l,c,u,d;return t.x-=this.x0,t.y-=this.y0,c=Math.PI*this.R,s=t.x/c,a=t.y/c,n=s*s+a*a,h=-Math.abs(a)*(1+n),r=h-2*a*a+s*s,f=-2*h+1+2*a*a+n*n,d=a*a/f+(2*r*r*r/f/f/f-9*h*r/f/f)/27,o=(h-r*r/3/f)/f,l=2*Math.sqrt(-o/3),c=3*d/o/l,Math.abs(c)>1&&(c>=0?c=1:c=-1),u=Math.acos(c)/3,t.y>=0?e=(-l*Math.cos(u+Math.PI/3)-r/3/f)*Math.PI:e=-(-l*Math.cos(u+Math.PI/3)-r/3/f)*Math.PI,Math.abs(s)<x?i=this.long0:i=w(this.long0+Math.PI*(n-1+Math.sqrt(1+2*(s*s-a*a)+n*n))/2/s,this.over),t.x=i,t.y=e,t}var ro=["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten","vandg"];const no={init:eo,forward:so,inverse:ao,names:ro};function ho(t,i,e,s,a,n){const h=s-i,r=Math.atan((1-n)*Math.tan(t)),f=Math.atan((1-n)*Math.tan(e)),o=Math.sin(r),l=Math.cos(r),c=Math.sin(f),u=Math.cos(f);let d=h,g,M=100,v,S,p,P,G,b,I,B,q,U,rt,z,_,y;do{if(v=Math.sin(d),S=Math.cos(d),p=Math.sqrt(u*v*(u*v)+(l*c-o*u*S)*(l*c-o*u*S)),p===0)return{azi1:0,s12:0};P=o*c+l*u*S,G=Math.atan2(p,P),b=l*u*v/p,I=1-b*b,B=I!==0?P-2*o*c/I:0,q=n/16*I*(4+n*(4-3*I)),g=d,d=h+(1-q)*n*b*(G+q*p*(B+q*P*(-1+2*B*B)))}while(Math.abs(d-g)>1e-12&&--M>0);return M===0?{azi1:NaN,s12:NaN}:(U=I*(a*a-a*(1-n)*(a*(1-n)))/(a*(1-n)*(a*(1-n))),rt=1+U/16384*(4096+U*(-768+U*(320-175*U))),z=U/1024*(256+U*(-128+U*(74-47*U))),_=z*p*(B+z/4*(P*(-1+2*B*B)-z/6*B*(-3+4*p*p)*(-3+4*B*B))),y=a*(1-n)*rt*(G-_),{azi1:Math.atan2(u*v,l*c-o*u*S),s12:y})}function oo(t,i,e,s,a,n){const h=Math.atan((1-n)*Math.tan(t)),r=Math.sin(h),f=Math.cos(h),o=Math.sin(e),l=Math.cos(e),c=Math.atan2(r,f*l),u=f*o,d=1-u*u,g=d*(a*a-a*(1-n)*(a*(1-n)))/(a*(1-n)*(a*(1-n))),M=1+g/16384*(4096+g*(-768+g*(320-175*g))),v=g/1024*(256+g*(-128+g*(74-47*g)));let S=s/(a*(1-n)*M),p,P=100,G,b,I,B;do G=Math.cos(2*c+S),b=Math.sin(S),I=Math.cos(S),B=v*b*(G+v/4*(I*(-1+2*G*G)-v/6*G*(-3+4*b*b)*(-3+4*G*G))),p=S,S=s/(a*(1-n)*M)+B;while(Math.abs(S-p)>1e-12&&--P>0);if(P===0)return{lat2:NaN,lon2:NaN};const q=r*b-f*I*l,U=Math.atan2(r*I+f*b*l,(1-n)*Math.sqrt(u*u+q*q)),rt=Math.atan2(b*o,f*I-r*b*l),z=n/16*d*(4+n*(4-3*d)),_=rt-(1-z)*n*u*(S+z*b*(G+z*I*(-1+2*G*G))),y=i+_;return{lat2:U,lon2:y}}function fo(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0),this.f=this.es/(1+Math.sqrt(1-this.es))}function lo(t){var i=t.x,e=t.y,s=Math.sin(t.y),a=Math.cos(t.y),n=w(i-this.long0,this.over),h,r,f,o,l,c,u,d,g,M,v;return this.sphere?Math.abs(this.sin_p12-1)<=x?(t.x=this.x0+this.a*(m-e)*Math.sin(n),t.y=this.y0-this.a*(m-e)*Math.cos(n),t):Math.abs(this.sin_p12+1)<=x?(t.x=this.x0+this.a*(m+e)*Math.sin(n),t.y=this.y0+this.a*(m+e)*Math.cos(n),t):(g=this.sin_p12*s+this.cos_p12*a*Math.cos(n),u=Math.acos(g),d=u?u/Math.sin(u):1,t.x=this.x0+this.a*d*a*Math.sin(n),t.y=this.y0+this.a*d*(this.cos_p12*s-this.sin_p12*a*Math.cos(n)),t):(h=ii(this.es),r=ei(this.es),f=si(this.es),o=ai(this.es),Math.abs(this.sin_p12-1)<=x?(l=this.a*W(h,r,f,o,m),c=this.a*W(h,r,f,o,e),t.x=this.x0+(l-c)*Math.sin(n),t.y=this.y0-(l-c)*Math.cos(n),t):Math.abs(this.sin_p12+1)<=x?(l=this.a*W(h,r,f,o,m),c=this.a*W(h,r,f,o,e),t.x=this.x0+(l+c)*Math.sin(n),t.y=this.y0+(l+c)*Math.cos(n),t):Math.abs(i)<x&&Math.abs(e-this.lat0)<x?(t.x=t.y=0,t):(M=ho(this.lat0,this.long0,e,i,this.a,this.f),v=M.azi1,t.x=M.s12*Math.sin(v),t.y=M.s12*Math.cos(v),t))}function uo(t){t.x-=this.x0,t.y-=this.y0;var i,e,s,a,n,h,r,f,o,l,c,u,d,g,M,v;return this.sphere?(i=Math.sqrt(t.x*t.x+t.y*t.y),i>2*m*this.a?void 0:(e=i/this.a,s=Math.sin(e),a=Math.cos(e),n=this.long0,Math.abs(i)<=x?h=this.lat0:(h=mt(a*this.sin_p12+t.y*s*this.cos_p12/i),r=Math.abs(this.lat0)-m,Math.abs(r)<=x?this.lat0>=0?n=w(this.long0+Math.atan2(t.x,-t.y),this.over):n=w(this.long0-Math.atan2(-t.x,t.y),this.over):n=w(this.long0+Math.atan2(t.x*s,i*this.cos_p12*a-t.y*this.sin_p12*s),this.over)),t.x=n,t.y=h,t)):(f=ii(this.es),o=ei(this.es),l=si(this.es),c=ai(this.es),Math.abs(this.sin_p12-1)<=x?(u=this.a*W(f,o,l,c,m),i=Math.sqrt(t.x*t.x+t.y*t.y),d=u-i,h=Ei(d/this.a,f,o,l,c),n=w(this.long0+Math.atan2(t.x,-1*t.y),this.over),t.x=n,t.y=h,t):Math.abs(this.sin_p12+1)<=x?(u=this.a*W(f,o,l,c,m),i=Math.sqrt(t.x*t.x+t.y*t.y),d=i-u,h=Ei(d/this.a,f,o,l,c),n=w(this.long0+Math.atan2(t.x,t.y),this.over),t.x=n,t.y=h,t):(g=Math.atan2(t.x,t.y),M=Math.sqrt(t.x*t.x+t.y*t.y),v=oo(this.lat0,this.long0,g,M,this.a,this.f),t.x=v.lon2,t.y=v.lat2,t))}var co=["Azimuthal_Equidistant","aeqd"];const go={init:fo,forward:lo,inverse:uo,names:co};function _o(){this.sin_p14=Math.sin(this.lat0||0),this.cos_p14=Math.cos(this.lat0||0)}function vo(t){var i,e,s,a,n,h,r,f,o=t.x,l=t.y;return s=w(o-(this.long0||0),this.over),i=Math.sin(l),e=Math.cos(l),a=Math.cos(s),h=this.sin_p14*i+this.cos_p14*e*a,n=1,(h>0||Math.abs(h)<=x)&&(r=this.a*n*e*Math.sin(s),f=(this.y0||0)+this.a*n*(this.cos_p14*i-this.sin_p14*e*a)),t.x=r,t.y=f,t}function Mo(t){var i,e,s,a,n,h,r,f,o;return t.x-=this.x0||0,t.y-=this.y0||0,i=Math.sqrt(t.x*t.x+t.y*t.y),e=mt(i/this.a),s=Math.sin(e),a=Math.cos(e),f=this.long0||0,o=this.lat0||0,h=f,Math.abs(i)<=x?(r=o,t.x=h,t.y=r,t):(r=mt(a*this.sin_p14+t.y*s*this.cos_p14/i),n=Math.abs(o)-m,Math.abs(n)<=x?(o>=0?h=w(f+Math.atan2(t.x,-t.y),this.over):h=w(f-Math.atan2(-t.x,t.y),this.over),t.x=h,t.y=r,t):(h=w(f+Math.atan2(t.x*s,i*this.cos_p14*a-t.y*this.sin_p14*s),this.over),t.x=h,t.y=r,t))}var yo=["ortho"];const mo={init:_o,forward:vo,inverse:Mo,names:yo};var O={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},R={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function xo(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=m-D/2?this.face=O.TOP:this.lat0<=-(m-D/2)?this.face=O.BOTTOM:Math.abs(this.long0)<=D?this.face=O.FRONT:Math.abs(this.long0)<=m+D?this.face=this.long0>0?O.RIGHT:O.LEFT:this.face=O.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function Eo(t){var i={x:0,y:0},e,s,a,n,h,r,f={value:0};if(t.x-=this.long0,this.es!==0?e=Math.atan(this.one_minus_f_squared*Math.tan(t.y)):e=t.y,s=t.x,this.face===O.TOP)n=m-e,s>=D&&s<=m+D?(f.value=R.AREA_0,a=s-m):s>m+D||s<=-(m+D)?(f.value=R.AREA_1,a=s>0?s-F:s+F):s>-(m+D)&&s<=-D?(f.value=R.AREA_2,a=s+m):(f.value=R.AREA_3,a=s);else if(this.face===O.BOTTOM)n=m+e,s>=D&&s<=m+D?(f.value=R.AREA_0,a=-s+m):s<D&&s>=-D?(f.value=R.AREA_1,a=-s):s<-D&&s>=-(m+D)?(f.value=R.AREA_2,a=-s-m):(f.value=R.AREA_3,a=s>0?-s+F:-s-F);else{var o,l,c,u,d,g,M;this.face===O.RIGHT?s=Dt(s,+m):this.face===O.BACK?s=Dt(s,+F):this.face===O.LEFT&&(s=Dt(s,-m)),u=Math.sin(e),d=Math.cos(e),g=Math.sin(s),M=Math.cos(s),o=d*M,l=d*g,c=u,this.face===O.FRONT?(n=Math.acos(o),a=ci(n,c,l,f)):this.face===O.RIGHT?(n=Math.acos(l),a=ci(n,c,-o,f)):this.face===O.BACK?(n=Math.acos(-o),a=ci(n,c,-l,f)):this.face===O.LEFT?(n=Math.acos(-l),a=ci(n,c,o,f)):(n=a=0,f.value=R.AREA_0)}return r=Math.atan(12/F*(a+Math.acos(Math.sin(a)*Math.cos(D))-m)),h=Math.sqrt((1-Math.cos(n))/(Math.cos(r)*Math.cos(r))/(1-Math.cos(Math.atan(1/Math.cos(a))))),f.value===R.AREA_1?r+=m:f.value===R.AREA_2?r+=F:f.value===R.AREA_3&&(r+=1.5*F),i.x=h*Math.cos(r),i.y=h*Math.sin(r),i.x=i.x*this.a+this.x0,i.y=i.y*this.a+this.y0,t.x=i.x,t.y=i.y,t}function wo(t){var i={lam:0,phi:0},e,s,a,n,h,r,f,o,l,c={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,s=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),e=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?c.value=R.AREA_0:t.y>=0&&t.y>=Math.abs(t.x)?(c.value=R.AREA_1,e-=m):t.x<0&&-t.x>=Math.abs(t.y)?(c.value=R.AREA_2,e=e<0?e+F:e-F):(c.value=R.AREA_3,e+=m),l=F/12*Math.tan(e),h=Math.sin(l)/(Math.cos(l)-1/Math.sqrt(2)),r=Math.atan(h),a=Math.cos(e),n=Math.tan(s),f=1-a*a*n*n*(1-Math.cos(Math.atan(1/Math.cos(r)))),f<-1?f=-1:f>1&&(f=1),this.face===O.TOP)o=Math.acos(f),i.phi=m-o,c.value===R.AREA_0?i.lam=r+m:c.value===R.AREA_1?i.lam=r<0?r+F:r-F:c.value===R.AREA_2?i.lam=r-m:i.lam=r;else if(this.face===O.BOTTOM)o=Math.acos(f),i.phi=o-m,c.value===R.AREA_0?i.lam=-r+m:c.value===R.AREA_1?i.lam=-r:c.value===R.AREA_2?i.lam=-r-m:i.lam=r<0?-r-F:-r+F;else{var u,d,g;u=f,l=u*u,l>=1?g=0:g=Math.sqrt(1-l)*Math.sin(r),l+=g*g,l>=1?d=0:d=Math.sqrt(1-l),c.value===R.AREA_1?(l=d,d=-g,g=l):c.value===R.AREA_2?(d=-d,g=-g):c.value===R.AREA_3&&(l=d,d=g,g=-l),this.face===O.RIGHT?(l=u,u=-d,d=l):this.face===O.BACK?(u=-u,d=-d):this.face===O.LEFT&&(l=u,u=d,d=-l),i.phi=Math.acos(-g)-m,i.lam=Math.atan2(d,u),this.face===O.RIGHT?i.lam=Dt(i.lam,-m):this.face===O.BACK?i.lam=Dt(i.lam,-F):this.face===O.LEFT&&(i.lam=Dt(i.lam,+m))}if(this.es!==0){var M,v,S;M=i.phi<0?1:0,v=Math.tan(i.phi),S=this.b/Math.sqrt(v*v+this.one_minus_f_squared),i.phi=Math.atan(Math.sqrt(this.a*this.a-S*S)/(this.one_minus_f*S)),M&&(i.phi=-i.phi)}return i.lam+=this.long0,t.x=i.lam,t.y=i.phi,t}function ci(t,i,e,s){var a;return t<x?(s.value=R.AREA_0,a=0):(a=Math.atan2(i,e),Math.abs(a)<=D?s.value=R.AREA_0:a>D&&a<=m+D?(s.value=R.AREA_1,a-=m):a>m+D||a<=-(m+D)?(s.value=R.AREA_2,a=a>=0?a-F:a+F):(s.value=R.AREA_3,a+=m)),a}function Dt(t,i){var e=t+i;return e<-F?e+=Xt:e>+F&&(e-=Xt),e}var So=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const po={init:xo,forward:Eo,inverse:wo,names:So};var te=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],zt=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],js=.8487,$s=1.3523,Ws=X/5,Po=1/Ws,It=18,wi=function(t,i){return t[0]+i*(t[1]+i*(t[2]+i*t[3]))},Ao=function(t,i){return t[1]+i*(2*t[2]+i*3*t[3])};function bo(t,i,e,s){for(var a=i;s;--s){var n=t(a);if(a-=n,Math.abs(n)<e)break}return a}function Co(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function Go(t){var i=w(t.x-this.long0,this.over),e=Math.abs(t.y),s=Math.floor(e*Ws);s<0?s=0:s>=It&&(s=It-1),e=X*(e-Po*s);var a={x:wi(te[s],e)*i,y:wi(zt[s],e)};return t.y<0&&(a.y=-a.y),a.x=a.x*this.a*js+this.x0,a.y=a.y*this.a*$s+this.y0,a}function Io(t){var i={x:(t.x-this.x0)/(this.a*js),y:Math.abs(t.y-this.y0)/(this.a*$s)};if(i.y>=1)i.x/=te[It][0],i.y=t.y<0?-m:m;else{var e=Math.floor(i.y*It);for(e<0?e=0:e>=It&&(e=It-1);;)if(zt[e][0]>i.y)--e;else if(zt[e+1][0]<=i.y)++e;else break;var s=zt[e],a=5*(i.y-s[0])/(zt[e+1][0]-s[0]);a=bo(function(n){return(wi(s,n)-i.y)/Ao(s,n)},a,x,100),i.x/=wi(te[e],a),i.y=(5*e+a)*T,t.y<0&&(i.y=-i.y)}return i.x=w(i.x+this.long0,this.over),i}var No=["Robinson","robin"];const Do={init:Co,forward:Go,inverse:Io,names:No};function Ro(){this.name="geocent"}function Bo(t){var i=Ds(t,this.es,this.a);return i}function Oo(t){var i=Rs(t,this.es,this.a,this.b);return i}var To=["Geocentric","geocentric","geocent","Geocent"];const Fo={init:Ro,forward:Bo,inverse:Oo,names:To};var j={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},Ut={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function Lo(){if(Object.keys(Ut).forEach(function(e){if(typeof this[e]>"u")this[e]=Ut[e].def;else{if(Ut[e].num&&isNaN(this[e]))throw new Error("Invalid parameter value, must be numeric "+e+" = "+this[e]);Ut[e].num&&(this[e]=parseFloat(this[e]))}Ut[e].degrees&&(this[e]=this[e]*T)}.bind(this)),Math.abs(Math.abs(this.lat0)-m)<x?this.mode=this.lat0<0?j.S_POLE:j.N_POLE:Math.abs(this.lat0)<x?this.mode=j.EQUIT:(this.mode=j.OBLIQ,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var t=this.tilt,i=this.azi;this.cg=Math.cos(i),this.sg=Math.sin(i),this.cw=Math.cos(t),this.sw=Math.sin(t)}function Uo(t){t.x-=this.long0;var i=Math.sin(t.y),e=Math.cos(t.y),s=Math.cos(t.x),a,n;switch(this.mode){case j.OBLIQ:n=this.sinph0*i+this.cosph0*e*s;break;case j.EQUIT:n=e*s;break;case j.S_POLE:n=-i;break;case j.N_POLE:n=i;break}switch(n=this.pn1/(this.p-n),a=n*e*Math.sin(t.x),this.mode){case j.OBLIQ:n*=this.cosph0*i-this.sinph0*e*s;break;case j.EQUIT:n*=i;break;case j.N_POLE:n*=-(e*s);break;case j.S_POLE:n*=e*s;break}var h,r;return h=n*this.cg+a*this.sg,r=1/(h*this.sw*this.h1+this.cw),a=(a*this.cg-n*this.sg)*this.cw*r,n=h*r,t.x=a*this.a,t.y=n*this.a,t}function qo(t){t.x/=this.a,t.y/=this.a;var i={x:t.x,y:t.y},e,s,a;a=1/(this.pn1-t.y*this.sw),e=this.pn1*t.x*a,s=this.pn1*t.y*this.cw*a,t.x=e*this.cg+s*this.sg,t.y=s*this.cg-e*this.sg;var n=V(t.x,t.y);if(Math.abs(n)<x)i.x=0,i.y=t.y;else{var h,r;switch(r=1-n*n*this.pfact,r=(this.p-Math.sqrt(r))/(this.pn1/n+n/this.pn1),h=Math.sqrt(1-r*r),this.mode){case j.OBLIQ:i.y=Math.asin(h*this.sinph0+t.y*r*this.cosph0/n),t.y=(h-this.sinph0*Math.sin(i.y))*n,t.x*=r*this.cosph0;break;case j.EQUIT:i.y=Math.asin(t.y*r/n),t.y=h*n,t.x*=r;break;case j.N_POLE:i.y=Math.asin(h),t.y=-t.y;break;case j.S_POLE:i.y=-Math.asin(h);break}i.x=Math.atan2(t.x,t.y)}return t.x=i.x+this.long0,t.y=i.y,t}var ko=["Tilted_Perspective","tpers"];const zo={init:Lo,forward:Uo,inverse:qo,names:ko};function jo(){if(this.flip_axis=this.sweep==="x"?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var t=1-this.es,i=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,this.radius_p_inv2=i,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")}function $o(t){var i=t.x,e=t.y,s,a,n,h;if(i=i-this.long0,this.shape==="ellipse"){e=Math.atan(this.radius_p2*Math.tan(e));var r=this.radius_p/V(this.radius_p*Math.cos(e),Math.sin(e));if(a=r*Math.cos(i)*Math.cos(e),n=r*Math.sin(i)*Math.cos(e),h=r*Math.sin(e),(this.radius_g-a)*a-n*n-h*h*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;s=this.radius_g-a,this.flip_axis?(t.x=this.radius_g_1*Math.atan(n/V(h,s)),t.y=this.radius_g_1*Math.atan(h/s)):(t.x=this.radius_g_1*Math.atan(n/s),t.y=this.radius_g_1*Math.atan(h/V(n,s)))}else this.shape==="sphere"&&(s=Math.cos(e),a=Math.cos(i)*s,n=Math.sin(i)*s,h=Math.sin(e),s=this.radius_g-a,this.flip_axis?(t.x=this.radius_g_1*Math.atan(n/V(h,s)),t.y=this.radius_g_1*Math.atan(h/s)):(t.x=this.radius_g_1*Math.atan(n/s),t.y=this.radius_g_1*Math.atan(h/V(n,s))));return t.x=t.x*this.a,t.y=t.y*this.a,t}function Wo(t){var i=-1,e=0,s=0,a,n,h,r;if(t.x=t.x/this.a,t.y=t.y/this.a,this.shape==="ellipse"){this.flip_axis?(s=Math.tan(t.y/this.radius_g_1),e=Math.tan(t.x/this.radius_g_1)*V(1,s)):(e=Math.tan(t.x/this.radius_g_1),s=Math.tan(t.y/this.radius_g_1)*V(1,e));var f=s/this.radius_p;if(a=e*e+f*f+i*i,n=2*this.radius_g*i,h=n*n-4*a*this.C,h<0)return t.x=Number.NaN,t.y=Number.NaN,t;r=(-n-Math.sqrt(h))/(2*a),i=this.radius_g+r*i,e*=r,s*=r,t.x=Math.atan2(e,i),t.y=Math.atan(s*Math.cos(t.x)/i),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if(this.shape==="sphere"){if(this.flip_axis?(s=Math.tan(t.y/this.radius_g_1),e=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+s*s)):(e=Math.tan(t.x/this.radius_g_1),s=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+e*e)),a=e*e+s*s+i*i,n=2*this.radius_g*i,h=n*n-4*a*this.C,h<0)return t.x=Number.NaN,t.y=Number.NaN,t;r=(-n-Math.sqrt(h))/(2*a),i=this.radius_g+r*i,e*=r,s*=r,t.x=Math.atan2(e,i),t.y=Math.atan(s*Math.cos(t.x)/i)}return t.x=t.x+this.long0,t}var Ho=["Geostationary Satellite View","Geostationary_Satellite","geos"];const Vo={init:jo,forward:$o,inverse:Wo,names:Ho};var $t=1.340264,Wt=-.081106,Ht=893e-6,Vt=.003796,Si=Math.sqrt(3)/2;function Xo(){this.es=0,this.long0=this.long0!==void 0?this.long0:0,this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0}function Zo(t){var i=w(t.x-this.long0,this.over),e=t.y,s=Math.asin(Si*Math.sin(e)),a=s*s,n=a*a*a;return t.x=i*Math.cos(s)/(Si*($t+3*Wt*a+n*(7*Ht+9*Vt*a))),t.y=s*($t+Wt*a+n*(Ht+Vt*a)),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function Qo(t){t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a;var i=1e-9,e=12,s=t.y,a,n,h,r,f,o;for(o=0;o<e&&(a=s*s,n=a*a*a,h=s*($t+Wt*a+n*(Ht+Vt*a))-t.y,r=$t+3*Wt*a+n*(7*Ht+9*Vt*a),s-=f=h/r,!(Math.abs(f)<i));++o);return a=s*s,n=a*a*a,t.x=Si*t.x*($t+3*Wt*a+n*(7*Ht+9*Vt*a))/Math.cos(s),t.y=Math.asin(Math.sin(s)/Si),t.x=w(t.x+this.long0,this.over),t}var Ko=["eqearth","Equal Earth","Equal_Earth"];const Jo={init:Xo,forward:Zo,inverse:Qo,names:Ko};var Kt=1e-10;function Yo(){var t;if(this.phi1=this.lat1,Math.abs(this.phi1)<Kt)throw new Error;this.es?(this.en=oe(this.es),this.m1=Ot(this.phi1,this.am1=Math.sin(this.phi1),t=Math.cos(this.phi1),this.en),this.am1=t/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=i0,this.forward=t0):(Math.abs(this.phi1)+Kt>=m?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=s0,this.forward=e0)}function t0(t){var i=w(t.x-(this.long0||0),this.over),e=t.y,s,a,n;return s=this.am1+this.m1-Ot(e,a=Math.sin(e),n=Math.cos(e),this.en),a=n*i/(s*Math.sqrt(1-this.es*a*a)),t.x=s*Math.sin(a),t.y=this.am1-s*Math.cos(a),t.x=this.a*t.x+(this.x0||0),t.y=this.a*t.y+(this.y0||0),t}function i0(t){t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a;var i,e,s,a;if(e=V(t.x,t.y=this.am1-t.y),a=fe(this.am1+this.m1-e,this.es,this.en),(i=Math.abs(a))<m)i=Math.sin(a),s=e*Math.atan2(t.x,t.y)*Math.sqrt(1-this.es*i*i)/Math.cos(a);else if(Math.abs(i-m)<=Kt)s=0;else throw new Error;return t.x=w(s+(this.long0||0),this.over),t.y=xt(a),t}function e0(t){var i=w(t.x-(this.long0||0),this.over),e=t.y,s,a;return a=this.cphi1+this.phi1-e,Math.abs(a)>Kt?(t.x=a*Math.sin(s=i*Math.cos(e)/a),t.y=this.cphi1-a*Math.cos(s)):t.x=t.y=0,t.x=this.a*t.x+(this.x0||0),t.y=this.a*t.y+(this.y0||0),t}function s0(t){t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a;var i,e,s=V(t.x,t.y=this.cphi1-t.y);if(e=this.cphi1+this.phi1-s,Math.abs(e)>m)throw new Error;return Math.abs(Math.abs(e)-m)<=Kt?i=0:i=s*Math.atan2(t.x,t.y)/Math.cos(e),t.x=w(i+(this.long0||0),this.over),t.y=xt(e),t}var a0=["bonne","Bonne (Werner lat_1=90)"];const r0={init:Yo,names:a0},fs={OBLIQUE:{forward:l0,inverse:c0},TRANSVERSE:{forward:u0,inverse:d0}},pi={ROTATE:{o_alpha:"oAlpha",o_lon_c:"oLongC",o_lat_c:"oLatC"},NEW_POLE:{o_lat_p:"oLatP",o_lon_p:"oLongP"},NEW_EQUATOR:{o_lon_1:"oLong1",o_lat_1:"oLat1",o_lon_2:"oLong2",o_lat_2:"oLat2"}};function n0(){if(this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.title=this.title||"General Oblique Transformation",this.isIdentity=Cs.includes(this.o_proj),!this.o_proj)throw new Error("Missing parameter: o_proj");if(this.o_proj==="ob_tran")throw new Error("Invalid value for o_proj: "+this.o_proj);const t=this.projStr.replace("+proj=ob_tran","").replace("+o_proj=","+proj=").trim(),i=et(t);if(!i)throw new Error("Invalid parameter: o_proj. Unknown projection "+this.o_proj);i.long0=0,this.obliqueProjection=i;let e;const s=Object.keys(pi),a=r=>{if(typeof this[r]>"u")return;const f=parseFloat(this[r])*T;if(isNaN(f))throw new Error("Invalid value for "+r+": "+this[r]);return f};for(let r=0;r<s.length;r++){const f=s[r],o=pi[f],l=Object.entries(o);if(l.some(([u])=>typeof this[u]<"u")){e=o;for(let u=0;u<l.length;u++){const[d,g]=l[u],M=a(d);if(typeof M>"u")throw new Error("Missing parameter: "+d+".");this[g]=M}break}}if(!e)throw new Error("No valid parameters provided for ob_tran projection.");const{lamp:n,phip:h}=f0(this,e);this.lamp=n,Math.abs(h)>x?(this.cphip=Math.cos(h),this.sphip=Math.sin(h),this.projectionType=fs.OBLIQUE):this.projectionType=fs.TRANSVERSE}function h0(t){return this.projectionType.forward(this,t)}function o0(t){return this.projectionType.inverse(this,t)}function f0(t,i){let e,s;if(i===pi.ROTATE){let a=t.oLongC,n=t.oLatC,h=t.oAlpha;if(Math.abs(Math.abs(n)-m)<=x)throw new Error("Invalid value for o_lat_c: "+t.o_lat_c+" should be < 90°");s=a+Math.atan2(-1*Math.cos(h),-1*Math.sin(h)*Math.sin(n)),e=Math.asin(Math.cos(n)*Math.sin(h))}else if(i===pi.NEW_POLE)s=t.oLongP,e=t.oLatP;else{let a=t.oLong1,n=t.oLat1,h=t.oLong2,r=t.oLat2,f=Math.abs(n);if(Math.abs(n)>m-x)throw new Error("Invalid value for o_lat_1: "+t.o_lat_1+" should be < 90°");if(Math.abs(r)>m-x)throw new Error("Invalid value for o_lat_2: "+t.o_lat_2+" should be < 90°");if(Math.abs(n-r)<x)throw new Error("Invalid value for o_lat_1 and o_lat_2: o_lat_1 should be different from o_lat_2");if(f<x)throw new Error("Invalid value for o_lat_1: o_lat_1 should be different from zero");s=Math.atan2(Math.cos(n)*Math.sin(r)*Math.cos(a)-Math.sin(n)*Math.cos(r)*Math.cos(h),Math.sin(n)*Math.cos(r)*Math.sin(h)-Math.cos(n)*Math.sin(r)*Math.sin(a)),e=Math.atan(-1*Math.cos(s-a)/Math.tan(n))}return{lamp:s,phip:e}}function l0(t,i){let{x:e,y:s}=i;e+=t.long0;const a=Math.cos(e),n=Math.sin(s),h=Math.cos(s);i.x=w(Math.atan2(h*Math.sin(e),t.sphip*h*a+t.cphip*n)+t.lamp),i.y=Math.asin(t.sphip*n-t.cphip*h*a);const r=t.obliqueProjection.forward(i);return t.isIdentity&&(r.x*=X,r.y*=X),r}function u0(t,i){let{x:e,y:s}=i;e+=t.long0;const a=Math.cos(s),n=Math.cos(e);i.x=w(Math.atan2(a*Math.sin(e),Math.sin(s))+t.lamp),i.y=Math.asin(-1*a*n);const h=t.obliqueProjection.forward(i);return t.isIdentity&&(h.x*=X,h.y*=X),h}function c0(t,i){t.isIdentity&&(i.x*=T,i.y*=T);const e=t.obliqueProjection.inverse(i);let{x:s,y:a}=e;if(s<Number.MAX_VALUE){s-=t.lamp;const n=Math.cos(s),h=Math.sin(a),r=Math.cos(a);i.x=Math.atan2(r*Math.sin(s),t.sphip*r*n-t.cphip*h),i.y=Math.asin(t.sphip*h+t.cphip*r*n)}return i.x=w(i.x+t.long0),i}function d0(t,i){t.isIdentity&&(i.x*=T,i.y*=T);const e=t.obliqueProjection.inverse(i);let{x:s,y:a}=e;if(s<Number.MAX_VALUE){const n=Math.cos(a);s-=t.lamp,i.x=Math.atan2(n*Math.sin(s),-1*Math.sin(a)),i.y=Math.asin(n*Math.cos(s))}return i.x=w(i.x+t.long0),i}var g0=["General Oblique Transformation","General_Oblique_Transformation","ob_tran"];const _0={init:n0,forward:h0,inverse:o0,names:g0};function v0(t){t.Proj.projections.add(gi),t.Proj.projections.add(_i),t.Proj.projections.add(sn),t.Proj.projections.add(cn),t.Proj.projections.add(Mn),t.Proj.projections.add(wn),t.Proj.projections.add(Cn),t.Proj.projections.add(Rn),t.Proj.projections.add(Ln),t.Proj.projections.add(jn),t.Proj.projections.add(eh),t.Proj.projections.add(oh),t.Proj.projections.add(dh),t.Proj.projections.add(mh),t.Proj.projections.add(ph),t.Proj.projections.add(Gh),t.Proj.projections.add(Bh),t.Proj.projections.add(Uh),t.Proj.projections.add(Wh),t.Proj.projections.add(Qh),t.Proj.projections.add(io),t.Proj.projections.add(no),t.Proj.projections.add(go),t.Proj.projections.add(mo),t.Proj.projections.add(po),t.Proj.projections.add(Do),t.Proj.projections.add(Fo),t.Proj.projections.add(zo),t.Proj.projections.add(Vo),t.Proj.projections.add(Jo),t.Proj.projections.add(r0),t.Proj.projections.add(_0)}const Ai=Object.assign(mr,{defaultDatum:"WGS84",Proj:et,WGS84:new et("WGS84"),Point:Rt,toPoint:Bs,defs:k,nadgrid:ir,transform:xi,mgrs:xr,version:"__VERSION__"});v0(Ai);try{let t=()=>new DecompressionStream("deflate-raw"),i=e=>new Response(e);t(),Hs=e=>i(i(e).body.pipeThrough(t())).arrayBuffer().then(s=>new Uint8Array(s))}catch{}var Hs,ls=new TextDecoder,Vi=t=>{throw Error("but-unzip~"+t)};function*M0(t,i=Hs){let e=t.length-21,s=e-65536,a=new DataView(t.buffer,t.byteOffset),n=f=>a.getUint16(f+e,1),h=f=>a.getUint32(f+e,1),r=(f,o)=>t.subarray(e+=f,e+=o);for(;e>s&&(e=t.lastIndexOf(80,e-1))+1&&(t[e+1]-75||t[e+2]-5||t[e+3]-6););for(e<0&&Vi(2),s=n(10),s-n(8)&&Vi(3),e=h(16);s--;){let f=n(10),o=n(28),l=n(30),c=n(32),u=h(20),d=h(42),g=ls.decode(r(46,o)),M=ls.decode(r(l,c)),v=e,S;e=d,S=r(30+n(26)+n(28),u),yield{filename:g,comment:M,read:()=>f-8?f?Vi(1):S:i(S)},e=v}}const y0=/.+\.(shp|dbf|json|prj|cpg)$/i,m0=async t=>{const i={},e=[];for(const n of M0(t))y0.test(n.filename)&&e.push(Promise.resolve(n.read()).then(h=>i[n.filename]=h));await Promise.all(e);const s={},a=new TextDecoder;for(const[n,h]of Object.entries(i))n.slice(-3).toLowerCase()==="shp"||n.slice(-3).toLowerCase()==="dbf"?s[n]=new DataView(h.buffer,h.byteOffset,h.byteLength):s[n]=a.decode(h);return s},x0=globalThis.URL,E0=(t,i)=>{if(!i)return t;const e=new x0(t);return e.pathname=`${e.pathname}.${i}`,e.href};async function Jt(t,i){const e=E0(t,i),s=i==="prj"||i==="cpg";try{const a=await fetch(e);if(a.status>399)throw new Error(a.statusText);if(s)return a.text();const n=await a.arrayBuffer();return new DataView(n)}catch(a){if(s||i==="dbf")return!1;throw a}}function w0(t){let i=0,e=1;const s=t.length;let a,n;const h=[t[0][0],t[0][1],t[0][0],t[0][1]];for(;e<s;)a=n||t[0],n=t[e],i+=(n[0]-a[0])*(n[1]+a[1]),e++,n[0]<h[0]&&(h[0]=n[0]),n[1]<h[1]&&(h[1]=n[1]),n[0]>h[2]&&(h[2]=n[0]),n[1]>h[3]&&(h[3]=n[1]);return{ring:t,clockWise:i>0,bbox:h,children:[]}}function us(t,i){return!(t.bbox[0]>i.bbox[0]||t.bbox[1]>i.bbox[1]||t.bbox[2]<i.bbox[2]||t.bbox[3]<i.bbox[3])}function Vs(t,i=!1){const e=[],s=[];for(const h of t){const r=w0(h);r.clockWise!==i?e.push(r):s.push(r)}const a=[];for(const h of s){let r;for(const f of e)us(f,h)&&(r?us(r,f)&&(r=f):r=f);r?r.children.push(h.ring):a.push(h)}if(i)return{outers:e,orphens:a};if(a.length&&!i){const h=Vs(t,!0);if(h.orphens.length===0){const r=[];for(const f of h.outers)r.push([f.ring.toReversed()].concat(f.children.map(o=>o.toReversed())));return r}}const n=[];for(const h of e)n.push([h.ring].concat(h.children));return n}L.prototype.parsePoint=function(t){return{type:"Point",coordinates:this.parseCoord(t,0)}};L.prototype.parseZPoint=function(t){const i=this.parsePoint(t);return i.coordinates.push(t.getFloat64(16,!0)),i};L.prototype.parsePointArray=function(t,i,e){const s=[];let a=0;for(;a<e;)s.push(this.parseCoord(t,i)),i+=16,a++;return s};L.prototype.parseZPointArray=function(t,i,e,s){let a=0;for(;a<e;)s[a].push(t.getFloat64(i,!0)),a++,i+=8;return s};L.prototype.parseArrayGroup=function(t,i,e,s,a){const n=[];let h=0,r,f=0,o;for(;h<s;)h++,e+=4,r=f,h===s?f=a:f=t.getInt32(e,!0),o=f-r,o&&(n.push(this.parsePointArray(t,i,o)),i+=o<<4);return n};L.prototype.parseZArrayGroup=function(t,i,e,s){let a=0;for(;a<e;)s[a]=this.parseZPointArray(t,i,s[a].length,s[a]),i+=s[a].length<<3,a++;return s};L.prototype.parseMultiPoint=function(t){const i={},e=t.getInt32(32,!0);if(!e)return null;const s=this.parseCoord(t,0),a=this.parseCoord(t,16);i.bbox=[s[0],s[1],a[0],a[1]];const n=36;return e===1?(i.type="Point",i.coordinates=this.parseCoord(t,n)):(i.type="MultiPoint",i.coordinates=this.parsePointArray(t,n,e)),i};L.prototype.parseZMultiPoint=function(t){const i=this.parseMultiPoint(t);if(!i)return null;let e;if(i.type==="Point")return i.coordinates.push(t.getFloat64(72,!0)),i;e=i.coordinates.length;const s=52+(e<<4);return i.coordinates=this.parseZPointArray(t,s,e,i.coordinates),i};L.prototype.parsePolyline=function(t){const i={},e=t.getInt32(32,!0);if(!e)return null;const s=this.parseCoord(t,0),a=this.parseCoord(t,16);i.bbox=[s[0],s[1],a[0],a[1]];const n=t.getInt32(36,!0);let h,r;return e===1?(i.type="LineString",h=44,i.coordinates=this.parsePointArray(t,h,n)):(i.type="MultiLineString",h=40+(e<<2),r=40,i.coordinates=this.parseArrayGroup(t,h,r,e,n)),i};L.prototype.parseZPolyline=function(t){const i=this.parsePolyline(t);if(!i)return null;const e=i.coordinates.length;let s;return i.type==="LineString"?(s=60+(e<<4),i.coordinates=this.parseZPointArray(t,s,e,i.coordinates),i):(s=56+(i.coordinates.reduce(function(n,h){return n+h.length},0)<<4)+(e<<2),i.coordinates=this.parseZArrayGroup(t,s,e,i.coordinates),i)};L.prototype.polyFuncs=function(t){return t&&(t.type==="LineString"?(t.type="Polygon",t.coordinates=[t.coordinates],t):(t.coordinates=Vs(t.coordinates),t.coordinates.length===1?(t.type="Polygon",t.coordinates=t.coordinates[0],t):(t.type="MultiPolygon",t)))};L.prototype.parsePolygon=function(t){return this.polyFuncs(this.parsePolyline(t))};L.prototype.parseZPolygon=function(t){return this.polyFuncs(this.parseZPolyline(t))};const cs={1:"parsePoint",3:"parsePolyline",5:"parsePolygon",8:"parseMultiPoint",11:"parseZPoint",13:"parseZPolyline",15:"parseZPolygon",18:"parseZMultiPoint"};function S0(t){return t?function(i,e){const s=[i.getFloat64(e,!0),i.getFloat64(e+8,!0)];return t.inverse(s)}:function(i,e){return[i.getFloat64(e,!0),i.getFloat64(e+8,!0)]}}function L(t,i){if(!(this instanceof L))return new L(t,i);this.buffer=t,this.headers=this.parseHeader(),this.shpFuncs(i),this.rows=this.getRows()}L.prototype.shpFuncs=function(t){let i=this.headers.shpCode;if(i>20&&(i-=20),!(i in cs))throw new Error(`I don't know shp type "${i}"`);this.parseFunc=this[cs[i]],this.parseCoord=S0(t)};L.prototype.getShpCode=function(){return this.parseHeader().shpCode};L.prototype.parseHeader=function(){const t=this.buffer;return{length:t.getInt32(24)<<1,version:t.getInt32(28,!0),shpCode:t.getInt32(32,!0),bbox:[t.getFloat64(36,!0),t.getFloat64(44,!0),t.getFloat64(52,!0),t.getFloat64(60,!0)]}};L.prototype.getRows=function(){let t=100;const i=this.buffer.byteLength-8,e=[];let s;for(;t<=i&&(s=this.getRow(t),!!s);)t+=8,t+=s.len,s.type?e.push(this.parseFunc(s.data)):e.push(null);return e};L.prototype.getRow=function(t){const i=this.buffer.getInt32(t),e=this.buffer.getInt32(t+4)<<1;if(e===0)return{id:i,len:e,type:0};if(!(t+e+8>this.buffer.byteLength))return{id:i,len:e,data:new DataView(this.buffer.buffer,this.buffer.byteOffset+t+12,e-4),type:this.buffer.getInt32(t+8,!0)}};function _e(t,i){return new L(t,i).rows}var p0=/^(?:ANSI\s)?(\d+)$/m;function Xs(t,i){if(!t)return s;try{new TextDecoder(t.trim())}catch{var e=p0.exec(t);return e&&!i?Xs("windows-"+e[1],!0):(t=void 0,s)}return s;function s(a){var n=new TextDecoder(t||void 0),h=n.decode(a,{stream:!0})+n.decode();return h.replace(/\0/g,"").trim()}}function P0(t){var i={};return i.lastUpdated=new Date(t.getUint8(1)+1900,t.getUint8(2),t.getUint8(3)),i.records=t.getUint32(4,!0),i.headerLen=t.getUint16(8,!0),i.recLen=t.getUint16(10,!0),i}function A0(t,i,e){for(var s=[],a=32;a<i&&(s.push({name:e(new Uint8Array(t.buffer.slice(t.byteOffset+a,t.byteOffset+a+11))),dataType:String.fromCharCode(t.getUint8(a+11)),len:t.getUint8(a+16),decimal:t.getUint8(a+17)}),t.getUint8(a+32)!==13);)a+=32;return s}function b0(t,i,e,s,a){const n=new Uint8Array(t.buffer.slice(t.byteOffset+i,t.byteOffset+i+e));var h=a(n);switch(s){case"N":case"F":case"O":return parseFloat(h,10);case"D":return new Date(h.slice(0,4),parseInt(h.slice(4,6),10)-1,h.slice(6,8));case"L":return h.toLowerCase()==="y"||h.toLowerCase()==="t";default:return h}}function C0(t,i,e,s){for(var a={},n=0,h=e.length,r,f;n<h;)f=e[n],r=b0(t,i,f.len,f.dataType,s),i+=f.len,typeof r<"u"&&(a[f.name]=r),n++;return a}function ve(t,i){for(var e=Xs(i),s=P0(t),a=A0(t,s.headerLen-1,e),n=(a.length+1<<5)+2,h=s.recLen,r=s.records,f=[];r;)f.push(C0(t,n,a,e)),n+=h,r--;return f}const G0=globalThis.URL,I0=t=>{if(!t)throw new Error("forgot to pass buffer");if(Bt(t))return new Uint8Array(t);if(Bt(t.buffer))return t.BYTES_PER_ELEMENT===1?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("invalid buffer like object")},N0=new TextDecoder,Zs=t=>{if(t){if(typeof t=="string")return t;if(Bt(t)||ArrayBuffer.isView(t)||Me(t))return N0.decode(t)}},Qs=t=>{if(!t)throw new Error("forgot to pass buffer");if(Me(t))return t;if(Bt(t))return new DataView(t);if(Bt(t.buffer))return new DataView(t.buffer,t.byteOffset,t.byteLength);throw new Error("invalid buffer like object")};function Bt(t){return t instanceof globalThis.ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]"}function Me(t){return t instanceof globalThis.DataView||Object.prototype.toString.call(t)==="[object DataView]"}const bi=function([t,i]){const e={};e.type="FeatureCollection",e.features=[];let s=0;const a=t.length;for(i||(i=[]);s<a;)e.features.push({type:"Feature",geometry:t[s],properties:i[s]||{}}),s++;return e},ye=async function(t,i){let e;t=I0(t);const s=await m0(t),a=[];i=i||[];for(e in s)e.indexOf("__MACOSX")===-1&&(e.slice(-4).toLowerCase()===".shp"?(a.push(e.slice(0,-4)),s[e.slice(0,-3)+e.slice(-3).toLowerCase()]=s[e]):e.slice(-4).toLowerCase()===".prj"?s[e.slice(0,-3)+e.slice(-3).toLowerCase()]=Ai(s[e]):e.slice(-5).toLowerCase()===".json"||i.indexOf(e.split(".").pop())>-1?a.push(e.slice(0,-3)+e.slice(-3).toLowerCase()):(e.slice(-4).toLowerCase()===".dbf"||e.slice(-4).toLowerCase()===".cpg")&&(s[e.slice(0,-3)+e.slice(-3).toLowerCase()]=s[e]));if(!a.length)throw new Error("no layers founds");const n=a.map(function(h){let r,f;const o=h.lastIndexOf(".");return o>-1&&h.slice(o).indexOf("json")>-1?(r=JSON.parse(s[h]),r.fileName=h.slice(0,o)):i.indexOf(h.slice(o+1))>-1?(r=s[h],r.fileName=h):(s[h+".dbf"]&&(f=ve(s[h+".dbf"],s[h+".cpg"])),r=bi([_e(s[h+".shp"],s[h+".prj"]),f]),r.fileName=h),r});return n.length===1?n[0]:n};async function D0(t,i){const e=await Jt(t);return ye(e,i)}const R0=async t=>{const i=await Promise.all([Jt(t,"shp"),Jt(t,"prj")]);let e=!1;try{i[1]&&(e=Ai(i[1]))}catch{e=!1}return _e(i[0],e)},B0=async t=>{const[i,e]=await Promise.all([Jt(t,"dbf"),Jt(t,"cpg")]);if(i)return ve(i,e)},ds=(t,i)=>new G0(t,globalThis?.document?.location).pathname.slice(-4).toLowerCase()===i,O0=({shp:t,dbf:i,cpg:e,prj:s})=>{const a=[Ks(t,s)];return i&&a.push(Js(i,e)),bi(a)},gs=async function(t,i){if(typeof t!="string"){if(Bt(t)||ArrayBuffer.isView(t)||Me(t))return ye(t);if(t.shp)return O0(t);throw new TypeError("must be a string, some sort of Buffer, or an object with at least a .shp property")}if(ds(t,".zip"))return D0(t,i);ds(t,".shp")&&(t=t.slice(0,-4));const e=await Promise.all([R0(t),B0(t)]);return bi(e)},Ks=function(t,i){if(t=Qs(t),i=Zs(i),typeof i=="string")try{i=Ai(i)}catch{i=!1}return _e(t,i)},Js=function(t,i){return t=Qs(t),i=Zs(i),ve(t,i)},L0=Object.freeze(Object.defineProperty({__proto__:null,combine:bi,default:gs,getShapefile:gs,parseDbf:Js,parseShp:Ks,parseZip:ye},Symbol.toStringTag,{value:"Module"}));export{L0 as i,F0 as r};
|
||
//# sourceMappingURL=shpjs-Doisr2ug.js.map
|