@edugis-org/webmapx 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/README.md +149 -0
  2. package/dist-lib/WMTS-DCN4zX0-.js +1169 -0
  3. package/dist-lib/alert-GeHlqlN8.js +310 -0
  4. package/dist-lib/assets/epsg-lookup.worker-J7TVnHDq.js +1 -0
  5. package/dist-lib/assets/shapefile.worker-kQfZj6G2.js +4 -0
  6. package/dist-lib/attribution-format-B4f05_u0.js +62 -0
  7. package/dist-lib/button-DFdGkRPQ.js +741 -0
  8. package/dist-lib/cesium-adapter-BHXNytkU.js +1488 -0
  9. package/dist-lib/checkbox-QoR4S8tV.js +284 -0
  10. package/dist-lib/chunk-HEgqtunE.js +20 -0
  11. package/dist-lib/chunk.36O46B5H-B6ZL7Sm1.js +77 -0
  12. package/dist-lib/chunk.3RPBFEDE-BFO1fHVm.js +138 -0
  13. package/dist-lib/chunk.5JY5FUCG-DTXsslmx.js +1090 -0
  14. package/dist-lib/chunk.6CTB5ZDJ-DjZrBd6Y.js +99 -0
  15. package/dist-lib/chunk.AJ3ENQ5C-Ci7Gm2b6.js +175 -0
  16. package/dist-lib/chunk.LD4M4QGE-CiCfhE8r.js +8 -0
  17. package/dist-lib/chunk.NYIIDP5N-BikXIStD.js +99 -0
  18. package/dist-lib/chunk.RWUUFNUL-DFztA4uV.js +43 -0
  19. package/dist-lib/chunk.SI4ACBFK-CLb9VfMG.js +61 -0
  20. package/dist-lib/chunk.YHLNUJ7P-D-kanrCf.js +503 -0
  21. package/dist-lib/core-CMAlSR68.js +22 -0
  22. package/dist-lib/decorate-CWgUV1hU.js +1139 -0
  23. package/dist-lib/decorators-B35AgiCU.js +351 -0
  24. package/dist-lib/deferred-query-service-BJDcngw6.js +386 -0
  25. package/dist-lib/dist-Dm6b7XCs.js +12318 -0
  26. package/dist-lib/dist-Ha9LQCut.js +244 -0
  27. package/dist-lib/dist-c1PlDAd1.js +2359 -0
  28. package/dist-lib/dist-kKlmcBXq.js +50 -0
  29. package/dist-lib/divider-CPm675yY.js +41 -0
  30. package/dist-lib/dropped-config-C_GyVa8o.js +17 -0
  31. package/dist-lib/dropped-layer-builder-DAaYgUPk.js +396 -0
  32. package/dist-lib/epsg-definitions-BZLZWa8Q.js +668 -0
  33. package/dist-lib/esm-CTuscnN5.js +46 -0
  34. package/dist-lib/file-sniff-Dhxj3KTF.js +251 -0
  35. package/dist-lib/geo-calculations-DbFJAUoI.js +30 -0
  36. package/dist-lib/icon-CEOgWlro.js +9 -0
  37. package/dist-lib/icon-button-Da_nBTy3.js +408 -0
  38. package/dist-lib/input-CeGntPlT.js +590 -0
  39. package/dist-lib/layer-discovery-afWzu5hY.js +2825 -0
  40. package/dist-lib/leaflet-adapter-D9djjrKv.js +1227 -0
  41. package/dist-lib/lib-CdHVicAE.js +4074 -0
  42. package/dist-lib/map-layer-registry-2cmkiRDK.js +62 -0
  43. package/dist-lib/maplibre-adapter-TFc3e0G9.js +1190 -0
  44. package/dist-lib/maplibre-expression-evaluator-DCWUcpwf.js +7233 -0
  45. package/dist-lib/marker-utils-DztWXeop.js +12 -0
  46. package/dist-lib/ol-tilegrid-9VtyxaLG.js +64 -0
  47. package/dist-lib/openlayers-adapter-DVW1KCRv.js +13307 -0
  48. package/dist-lib/option-CBxl1mZP.js +1106 -0
  49. package/dist-lib/papaparse.min-B7v3c0D7.js +501 -0
  50. package/dist-lib/rbush-C8k41T4z.js +254 -0
  51. package/dist-lib/shapefile-SawVY6xg.js +207 -0
  52. package/dist-lib/spinner-DysxdNG9.js +6 -0
  53. package/dist-lib/src-CL94RDe3.js +111 -0
  54. package/dist-lib/throttle-BeneRNYK.js +16 -0
  55. package/dist-lib/toast-Cm28o9U6.js +15 -0
  56. package/dist-lib/togeojson.es-DAgiTBvg.js +579 -0
  57. package/dist-lib/tooltip-Cucn1SiD.js +197 -0
  58. package/dist-lib/webmapx-3d-tool-D4CTD2gB.js +176 -0
  59. package/dist-lib/webmapx-base-tool-Dm9NAWLD.js +75 -0
  60. package/dist-lib/webmapx-config-edit-tool-DCTyxqTk.js +389 -0
  61. package/dist-lib/webmapx-coordinates-tool-jeWohup9.js +648 -0
  62. package/dist-lib/webmapx-core-bundle-BDImi1RE.js +8203 -0
  63. package/dist-lib/webmapx-draw-tool-DooAV8cF.js +4336 -0
  64. package/dist-lib/webmapx-geolocation-tool-Rw3-Iad1.js +788 -0
  65. package/dist-lib/webmapx-import-layer-tool-DRYviHd5.js +250 -0
  66. package/dist-lib/webmapx-info-tool-BJA157cy.js +412 -0
  67. package/dist-lib/webmapx-language-osmvector-M5y_lwOg.js +489 -0
  68. package/dist-lib/webmapx-measure-tool-BXhMJFC6.js +590 -0
  69. package/dist-lib/webmapx-modal-tool-eF6Naluv.js +84 -0
  70. package/dist-lib/webmapx-plugin-tool-D2Hghf9n.js +45 -0
  71. package/dist-lib/webmapx-print-tool-ob1bOsR5.js +348 -0
  72. package/dist-lib/webmapx-search-tool-Cv8BrYvY.js +437 -0
  73. package/dist-lib/webmapx-settings-DDEJ8aoV.js +479 -0
  74. package/dist-lib/webmapx-truearea-tool-CMB4Orm-.js +615 -0
  75. package/dist-lib/webmapx-view-mode-tool-CUpLNjOj.js +106 -0
  76. package/dist-lib/webmapx.css +2 -0
  77. package/dist-lib/webmapx.js +1321 -0
  78. package/dist-lib/wms-feature-info-C0RVMEQC.js +145 -0
  79. package/dist-lib/wms-url-builder-DIJLQ1v2.js +54 -0
  80. package/dist-lib/zip.js-DVhmtjxZ.js +3615 -0
  81. package/package.json +107 -0
  82. package/public/data/country-epsg-codes.json +297 -0
  83. package/public/data/world-countries-simplified.topojson +1 -0
  84. package/src/locales/en/core.json +20 -0
@@ -0,0 +1,4 @@
1
+ (function(){function e(e){e(`EPSG:4326`,`+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees`),e(`EPSG:4269`,`+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees`),e(`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 t=1;t<=60;++t)e(`EPSG:`+(32600+t),`+proj=utm +zone=`+t+` +datum=WGS84 +units=m`),e(`EPSG:`+(32700+t),`+proj=utm +zone=`+t+` +south +datum=WGS84 +units=m`);e(`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`),e(`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`),e.WGS84=e[`EPSG:4326`],e[`EPSG:3785`]=e[`EPSG:3857`],e.GOOGLE=e[`EPSG:3857`],e[`EPSG:900913`]=e[`EPSG:3857`],e[`EPSG:102113`]=e[`EPSG:3857`]}var t=6378137,n=6356752.314,r=.0066943799901413165,i=484813681109536e-20,a=Math.PI/2,o=.16666666666666666,s=.04722222222222222,c=.022156084656084655,l=1e-10,u=.017453292519943295,d=57.29577951308232,f=Math.PI/4,p=Math.PI*2,m=3.14159265359,h={};h.greenwich=0,h.lisbon=-9.131906111111,h.paris=2.337229166667,h.bogota=-74.080916666667,h.madrid=-3.687938888889,h.rome=12.452333333333,h.bern=7.439583333333,h.jakarta=106.807719444444,h.ferro=-17.666666666667,h.brussels=4.367975,h.stockholm=18.058277777778,h.athens=23.7163375,h.oslo=10.722916666667;var g={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}},_=/[\s_\-\/\(\)]/g;function v(e,t){if(e[t])return e[t];for(var n=Object.keys(e),r=t.toLowerCase().replace(_,``),i=-1,a,o;++i<n.length;)if(a=n[i],o=a.toLowerCase().replace(_,``),o===r)return e[a]}function y(e){var t={},n=e.split(`+`).map(function(e){return e.trim()}).filter(function(e){return e}).reduce(function(e,t){var n=t.split(`=`);return n.push(!0),e[n[0].toLowerCase()]=n[1],e},{}),r,i,a,o={proj:`projName`,datum:`datumCode`,rf:function(e){t.rf=parseFloat(e)},lat_0:function(e){t.lat0=e*u},lat_1:function(e){t.lat1=e*u},lat_2:function(e){t.lat2=e*u},lat_ts:function(e){t.lat_ts=e*u},lon_0:function(e){t.long0=e*u},lon_1:function(e){t.long1=e*u},lon_2:function(e){t.long2=e*u},alpha:function(e){t.alpha=parseFloat(e)*u},gamma:function(e){t.rectified_grid_angle=parseFloat(e)*u},lonc:function(e){t.longc=e*u},x_0:function(e){t.x0=parseFloat(e)},y_0:function(e){t.y0=parseFloat(e)},k_0:function(e){t.k0=parseFloat(e)},k:function(e){t.k0=parseFloat(e)},a:function(e){t.a=parseFloat(e)},b:function(e){t.b=parseFloat(e)},r:function(e){t.a=t.b=parseFloat(e)},r_a:function(){t.R_A=!0},zone:function(e){t.zone=parseInt(e,10)},south:function(){t.utmSouth=!0},towgs84:function(e){t.datum_params=e.split(`,`).map(function(e){return parseFloat(e)})},to_meter:function(e){t.to_meter=parseFloat(e)},units:function(e){t.units=e;var n=v(g,e);n&&(t.to_meter=n.to_meter)},from_greenwich:function(e){t.from_greenwich=e*u},pm:function(e){t.from_greenwich=(v(h,e)||parseFloat(e))*u},nadgrids:function(e){e===`@null`?t.datumCode=`none`:t.nadgrids=e},axis:function(e){var n=`ewnsud`;e.length===3&&n.indexOf(e.substr(0,1))!==-1&&n.indexOf(e.substr(1,1))!==-1&&n.indexOf(e.substr(2,1))!==-1&&(t.axis=e)},approx:function(){t.approx=!0},over:function(){t.over=!0}};for(r in n)i=n[r],r in o?(a=o[r],typeof a==`function`?a(i):t[a]=i):t[r]=i;return typeof t.datumCode==`string`&&t.datumCode!==`WGS84`&&(t.datumCode=t.datumCode.toLowerCase()),t.projStr=e,t}var b=class{static getId(e){let t=e.find(e=>Array.isArray(e)&&e[0]===`ID`);return t&&t.length>=3?{authority:t[1],code:parseInt(t[2],10)}:null}static convertUnit(e,t=`unit`){if(!e||e.length<3)return{type:t,name:`unknown`,conversion_factor:null};let n=e[1],r=parseFloat(e[2])||null,i=e.find(e=>Array.isArray(e)&&e[0]===`ID`);return{type:t,name:n,conversion_factor:r,id:i?{authority:i[1],code:parseInt(i[2],10)}:null}}static convertAxis(e){let t=e[1]||`Unknown`,n,r=t.match(/^\((.)\)$/);if(r){let e=r[1].toUpperCase();if(e===`E`)n=`east`;else if(e===`N`)n=`north`;else if(e===`U`)n=`up`;else throw Error(`Unknown axis abbreviation: ${e}`)}else n=e[2]?e[2].toLowerCase():`unknown`;let i=e.find(e=>Array.isArray(e)&&e[0]===`ORDER`),a=i?parseInt(i[1],10):null,o=e.find(e=>Array.isArray(e)&&(e[0]===`LENGTHUNIT`||e[0]===`ANGLEUNIT`||e[0]===`SCALEUNIT`)),s=this.convertUnit(o);return{name:t,direction:n,unit:s,order:a}}static extractAxes(e){return e.filter(e=>Array.isArray(e)&&e[0]===`AXIS`).map(e=>this.convertAxis(e)).sort((e,t)=>(e.order||0)-(t.order||0))}static convert(e,t={}){switch(e[0]){case`PROJCRS`:t.type=`ProjectedCRS`,t.name=e[1],t.base_crs=e.find(e=>Array.isArray(e)&&e[0]===`BASEGEOGCRS`)?this.convert(e.find(e=>Array.isArray(e)&&e[0]===`BASEGEOGCRS`)):null,t.conversion=e.find(e=>Array.isArray(e)&&e[0]===`CONVERSION`)?this.convert(e.find(e=>Array.isArray(e)&&e[0]===`CONVERSION`)):null;let n=e.find(e=>Array.isArray(e)&&e[0]===`CS`);n&&(t.coordinate_system={type:n[1],axis:this.extractAxes(e)});let r=e.find(e=>Array.isArray(e)&&e[0]===`LENGTHUNIT`);if(r){let e=this.convertUnit(r);t.coordinate_system.unit=e}t.id=this.getId(e);break;case`BASEGEOGCRS`:case`GEOGCRS`:t.type=`GeographicCRS`,t.name=e[1];let i=e.find(e=>Array.isArray(e)&&(e[0]===`DATUM`||e[0]===`ENSEMBLE`));if(i){let n=this.convert(i);i[0]===`ENSEMBLE`?t.datum_ensemble=n:t.datum=n;let r=e.find(e=>Array.isArray(e)&&e[0]===`PRIMEM`);r&&r[1]!==`Greenwich`&&(n.prime_meridian={name:r[1],longitude:parseFloat(r[2])})}t.coordinate_system={type:`ellipsoidal`,axis:this.extractAxes(e)},t.id=this.getId(e);break;case`DATUM`:t.type=`GeodeticReferenceFrame`,t.name=e[1],t.ellipsoid=e.find(e=>Array.isArray(e)&&e[0]===`ELLIPSOID`)?this.convert(e.find(e=>Array.isArray(e)&&e[0]===`ELLIPSOID`)):null;break;case`ENSEMBLE`:t.type=`DatumEnsemble`,t.name=e[1],t.members=e.filter(e=>Array.isArray(e)&&e[0]===`MEMBER`).map(e=>({type:`DatumEnsembleMember`,name:e[1],id:this.getId(e)}));let a=e.find(e=>Array.isArray(e)&&e[0]===`ENSEMBLEACCURACY`);a&&(t.accuracy=parseFloat(a[1]));let o=e.find(e=>Array.isArray(e)&&e[0]===`ELLIPSOID`);o&&(t.ellipsoid=this.convert(o)),t.id=this.getId(e);break;case`ELLIPSOID`:t.type=`Ellipsoid`,t.name=e[1],t.semi_major_axis=parseFloat(e[2]),t.inverse_flattening=parseFloat(e[3]),e.find(e=>Array.isArray(e)&&e[0]===`LENGTHUNIT`)&&this.convert(e.find(e=>Array.isArray(e)&&e[0]===`LENGTHUNIT`),t);break;case`CONVERSION`:t.type=`Conversion`,t.name=e[1],t.method=e.find(e=>Array.isArray(e)&&e[0]===`METHOD`)?this.convert(e.find(e=>Array.isArray(e)&&e[0]===`METHOD`)):null,t.parameters=e.filter(e=>Array.isArray(e)&&e[0]===`PARAMETER`).map(e=>this.convert(e));break;case`METHOD`:t.type=`Method`,t.name=e[1],t.id=this.getId(e);break;case`PARAMETER`:t.type=`Parameter`,t.name=e[1],t.value=parseFloat(e[2]),t.unit=this.convertUnit(e.find(e=>Array.isArray(e)&&(e[0]===`LENGTHUNIT`||e[0]===`ANGLEUNIT`||e[0]===`SCALEUNIT`))),t.id=this.getId(e);break;case`BOUNDCRS`:t.type=`BoundCRS`;let s=e.find(e=>Array.isArray(e)&&e[0]===`SOURCECRS`);if(s){let e=s.find(e=>Array.isArray(e));t.source_crs=e?this.convert(e):null}let c=e.find(e=>Array.isArray(e)&&e[0]===`TARGETCRS`);if(c){let e=c.find(e=>Array.isArray(e));t.target_crs=e?this.convert(e):null}let l=e.find(e=>Array.isArray(e)&&e[0]===`ABRIDGEDTRANSFORMATION`);l?t.transformation=this.convert(l):t.transformation=null;break;case`ABRIDGEDTRANSFORMATION`:if(t.type=`Transformation`,t.name=e[1],t.method=e.find(e=>Array.isArray(e)&&e[0]===`METHOD`)?this.convert(e.find(e=>Array.isArray(e)&&e[0]===`METHOD`)):null,t.parameters=e.filter(e=>Array.isArray(e)&&(e[0]===`PARAMETER`||e[0]===`PARAMETERFILE`)).map(e=>{if(e[0]===`PARAMETER`)return this.convert(e);if(e[0]===`PARAMETERFILE`)return{name:e[1],value:e[2],id:{authority:`EPSG`,code:8656}}}),t.parameters.length===7){let e=t.parameters[6];e.name===`Scale difference`&&(e.value=Math.round((e.value-1)*0xe8d4a51000)/1e6)}t.id=this.getId(e);break;case`AXIS`:t.coordinate_system||={type:`unspecified`,axis:[]},t.coordinate_system.axis.push(this.convertAxis(e));break;case`LENGTHUNIT`:let u=this.convertUnit(e,`LinearUnit`);t.coordinate_system&&t.coordinate_system.axis&&t.coordinate_system.axis.forEach(e=>{e.unit||=u}),u.conversion_factor&&u.conversion_factor!==1&&(t.semi_major_axis&&={value:t.semi_major_axis,unit:u});break;default:t.keyword=e[0];break}return t}},x=class extends b{static convert(e,t={}){return super.convert(e,t),t.coordinate_system&&t.coordinate_system.subtype===`Cartesian`&&delete t.coordinate_system,t.usage&&delete t.usage,t}},S=class extends b{static convert(e,t={}){super.convert(e,t);let n=e.find(e=>Array.isArray(e)&&e[0]===`CS`);n&&(t.coordinate_system={subtype:n[1],axis:this.extractAxes(e)});let r=e.find(e=>Array.isArray(e)&&e[0]===`USAGE`);if(r){let e=r.find(e=>Array.isArray(e)&&e[0]===`SCOPE`),n=r.find(e=>Array.isArray(e)&&e[0]===`AREA`),i=r.find(e=>Array.isArray(e)&&e[0]===`BBOX`);t.usage={},e&&(t.usage.scope=e[1]),n&&(t.usage.area=n[1]),i&&(t.usage.bbox=i.slice(1))}return t}};function C(e){return e.find(e=>Array.isArray(e)&&e[0]===`USAGE`)?`2019`:(e.find(e=>Array.isArray(e)&&e[0]===`CS`)||e[0]===`BOUNDCRS`||e[0]===`PROJCRS`||e[0],`2015`)}function w(e){return(C(e)===`2019`?S:x).convert(e)}function T(e){let t=e.toUpperCase();return t.includes(`PROJCRS`)||t.includes(`GEOGCRS`)||t.includes(`BOUNDCRS`)||t.includes(`VERTCRS`)||t.includes(`LENGTHUNIT`)||t.includes(`ANGLEUNIT`)||t.includes(`SCALEUNIT`)?`WKT2`:(t.includes(`PROJCS`)||t.includes(`GEOGCS`)||t.includes(`LOCAL_CS`)||t.includes(`VERT_CS`)||t.includes(`UNIT`),`WKT1`)}var E=ue,D=1,ee=2,te=3,ne=4,re=5,ie=-1,ae=/\s/,oe=/[A-Za-z]/,se=/[A-Za-z84_]/,ce=/[,\]]/,le=/[\d\.E\-\+]/;function O(e){if(typeof e!=`string`)throw Error(`not a string`);this.text=e.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=D}O.prototype.readCharicter=function(){var e=this.text[this.place++];if(this.state!==ne)for(;ae.test(e);){if(this.place>=this.text.length)return;e=this.text[this.place++]}switch(this.state){case D:return this.neutral(e);case ee:return this.keyword(e);case ne:return this.quoted(e);case re:return this.afterquote(e);case te:return this.number(e);case ie:return}},O.prototype.afterquote=function(e){if(e===`"`){this.word+=`"`,this.state=ne;return}if(ce.test(e)){this.word=this.word.trim(),this.afterItem(e);return}throw Error(`havn't handled "`+e+`" in afterquote yet, index `+this.place)},O.prototype.afterItem=function(e){if(e===`,`){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=D;return}if(e===`]`){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=D,this.currentObject=this.stack.pop(),this.currentObject||(this.state=ie);return}},O.prototype.number=function(e){if(le.test(e)){this.word+=e;return}if(ce.test(e)){this.word=parseFloat(this.word),this.afterItem(e);return}throw Error(`havn't handled "`+e+`" in number yet, index `+this.place)},O.prototype.quoted=function(e){if(e===`"`){this.state=re;return}this.word+=e},O.prototype.keyword=function(e){if(se.test(e)){this.word+=e;return}if(e===`[`){var t=[];t.push(this.word),this.level++,this.root===null?this.root=t:this.currentObject.push(t),this.stack.push(this.currentObject),this.currentObject=t,this.state=D;return}if(ce.test(e)){this.afterItem(e);return}throw Error(`havn't handled "`+e+`" in keyword yet, index `+this.place)},O.prototype.neutral=function(e){if(oe.test(e)){this.word=e,this.state=ee;return}if(e===`"`){this.word=``,this.state=ne;return}if(le.test(e)){this.word=e,this.state=te;return}if(ce.test(e)){this.afterItem(e);return}throw Error(`havn't handled "`+e+`" in neutral yet, index `+this.place)},O.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===ie)return this.root;throw Error(`unable to parse string "`+this.text+`". State is `+this.state)};function ue(e){return new O(e).output()}function de(e,t,n){Array.isArray(t)&&(n.unshift(t),t=null);var r=t?{}:e,i=n.reduce(function(e,t){return k(t,e),e},r);t&&(e[t]=i)}function k(e,t){if(!Array.isArray(e)){t[e]=!0;return}var n=e.shift();if(n===`PARAMETER`&&(n=e.shift()),e.length===1){if(Array.isArray(e[0])){t[n]={},k(e[0],t[n]);return}t[n]=e[0];return}if(!e.length){t[n]=!0;return}if(n===`TOWGS84`){t[n]=e;return}if(n===`AXIS`){n in t||(t[n]=[]),t[n].push(e);return}Array.isArray(n)||(t[n]={});var r;switch(n){case`UNIT`:case`PRIMEM`:case`VERT_DATUM`:t[n]={name:e[0].toLowerCase(),convert:e[1]},e.length===3&&k(e[2],t[n]);return;case`SPHEROID`:case`ELLIPSOID`:t[n]={name:e[0],a:e[1],rf:e[2]},e.length===4&&k(e[3],t[n]);return;case`EDATUM`:case`ENGINEERINGDATUM`:case`LOCAL_DATUM`:case`DATUM`:case`VERT_CS`:case`VERTCRS`:case`VERTICALCRS`:e[0]=[`name`,e[0]],de(t,n,e);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`:e[0]=[`name`,e[0]],de(t,n,e),t[n].type=n;return;default:for(r=-1;++r<e.length;)if(!Array.isArray(e[r]))return k(e,t[n]);return de(t,n,e)}}var fe=.017453292519943295;function A(e){return e*fe}function pe(e){let t=(e.projName||``).toLowerCase().replace(/_/g,` `);!e.long0&&e.longc&&(t===`albers conic equal area`||t===`lambert azimuthal equal area`)&&(e.long0=e.longc),!e.lat_ts&&e.lat1&&(t===`stereographic south pole`||t===`polar stereographic (variant b)`)?(e.lat0=A(e.lat1>0?90:-90),e.lat_ts=e.lat1,delete e.lat1):!e.lat_ts&&e.lat0&&(t===`polar stereographic`||t===`polar stereographic (variant a)`)&&(e.lat_ts=e.lat0,e.lat0=A(e.lat0>0?90:-90),delete e.lat1)}function me(e){let t={units:null,to_meter:void 0};return typeof e==`string`?(t.units=e.toLowerCase(),t.units===`metre`&&(t.units=`meter`),t.units===`meter`&&(t.to_meter=1)):e&&e.name&&(t.units=e.name.toLowerCase(),t.units===`metre`&&(t.units=`meter`),t.to_meter=e.conversion_factor),t}function he(e){return typeof e==`object`?e.value*e.unit.conversion_factor:e}function ge(e,t){e.ellipsoid.radius?(t.a=e.ellipsoid.radius,t.rf=0):(t.a=he(e.ellipsoid.semi_major_axis),e.ellipsoid.inverse_flattening===void 0?e.ellipsoid.semi_major_axis!==void 0&&e.ellipsoid.semi_minor_axis!==void 0&&(t.rf=t.a/(t.a-he(e.ellipsoid.semi_minor_axis))):t.rf=e.ellipsoid.inverse_flattening)}function _e(e,t={}){return!e||typeof e!=`object`?e:e.type===`BoundCRS`?(_e(e.source_crs,t),e.transformation&&(e.transformation.method&&e.transformation.method.name===`NTv2`?t.nadgrids=e.transformation.parameters[0].value:t.datum_params=e.transformation.parameters.map(e=>e.value)),t):(Object.keys(e).forEach(n=>{let r=e[n];if(r!==null)switch(n){case`name`:if(t.srsCode)break;t.name=r,t.srsCode=r;break;case`type`:r===`GeographicCRS`?t.projName=`longlat`:r===`ProjectedCRS`&&e.conversion&&e.conversion.method&&(t.projName=e.conversion.method.name);break;case`datum`:case`datum_ensemble`:r.ellipsoid&&(t.ellps=r.ellipsoid.name,ge(r,t)),r.prime_meridian&&(t.from_greenwich=r.prime_meridian.longitude*Math.PI/180);break;case`ellipsoid`:t.ellps=r.name,ge(r,t);break;case`prime_meridian`:t.long0=(r.longitude||0)*Math.PI/180;break;case`coordinate_system`:if(r.axis){if(t.axis=r.axis.map(e=>{let t=e.direction;if(t===`east`)return`e`;if(t===`north`)return`n`;if(t===`west`)return`w`;if(t===`south`)return`s`;throw Error(`Unknown axis direction: ${t}`)}).join(``)+`u`,r.unit){let{units:e,to_meter:n}=me(r.unit);t.units=e,t.to_meter=n}else if(r.axis[0]&&r.axis[0].unit){let{units:e,to_meter:n}=me(r.axis[0].unit);t.units=e,t.to_meter=n}}break;case`id`:r.authority&&r.code&&(t.title=r.authority+`:`+r.code);break;case`conversion`:r.method&&r.method.name&&(t.projName=r.method.name),r.parameters&&r.parameters.forEach(e=>{let n=e.name.toLowerCase().replace(/\s+/g,`_`),r=e.value;e.unit&&e.unit.conversion_factor?t[n]=r*e.unit.conversion_factor:e.unit===`degree`?t[n]=r*Math.PI/180:t[n]=r});break;case`unit`:r.name&&(t.units=r.name.toLowerCase(),t.units===`metre`&&(t.units=`meter`)),r.conversion_factor&&(t.to_meter=r.conversion_factor);break;case`base_crs`:_e(r,t),t.datumCode=r.id?r.id.authority+`_`+r.id.code:r.name;break;default:break}}),t.latitude_of_false_origin!==void 0&&(t.lat0=t.latitude_of_false_origin),t.longitude_of_false_origin!==void 0&&(t.long0=t.longitude_of_false_origin),t.latitude_of_standard_parallel!==void 0&&(t.lat0=t.latitude_of_standard_parallel,t.lat1=t.latitude_of_standard_parallel),t.latitude_of_1st_standard_parallel!==void 0&&(t.lat1=t.latitude_of_1st_standard_parallel),t.latitude_of_2nd_standard_parallel!==void 0&&(t.lat2=t.latitude_of_2nd_standard_parallel),t.latitude_of_projection_centre!==void 0&&(t.lat0=t.latitude_of_projection_centre),t.longitude_of_projection_centre!==void 0&&(t.longc=t.longitude_of_projection_centre),t.easting_at_false_origin!==void 0&&(t.x0=t.easting_at_false_origin),t.northing_at_false_origin!==void 0&&(t.y0=t.northing_at_false_origin),t.latitude_of_natural_origin!==void 0&&(t.lat0=t.latitude_of_natural_origin),t.longitude_of_natural_origin!==void 0&&(t.long0=t.longitude_of_natural_origin),t.longitude_of_origin!==void 0&&(t.long0=t.longitude_of_origin),t.false_easting!==void 0&&(t.x0=t.false_easting),t.easting_at_projection_centre&&(t.x0=t.easting_at_projection_centre),t.false_northing!==void 0&&(t.y0=t.false_northing),t.northing_at_projection_centre&&(t.y0=t.northing_at_projection_centre),t.standard_parallel_1!==void 0&&(t.lat1=t.standard_parallel_1),t.standard_parallel_2!==void 0&&(t.lat2=t.standard_parallel_2),t.scale_factor_at_natural_origin!==void 0&&(t.k0=t.scale_factor_at_natural_origin),t.scale_factor_at_projection_centre!==void 0&&(t.k0=t.scale_factor_at_projection_centre),t.scale_factor_on_pseudo_standard_parallel!==void 0&&(t.k0=t.scale_factor_on_pseudo_standard_parallel),t.azimuth!==void 0&&(t.alpha=t.azimuth),t.azimuth_at_projection_centre!==void 0&&(t.alpha=t.azimuth_at_projection_centre),t.angle_from_rectified_to_skew_grid&&(t.rectified_grid_angle=t.angle_from_rectified_to_skew_grid),pe(t),t)}var ve=[`PROJECTEDCRS`,`PROJCRS`,`GEOGCS`,`GEOCCS`,`PROJCS`,`LOCAL_CS`,`GEODCRS`,`GEODETICCRS`,`GEODETICDATUM`,`ENGCRS`,`ENGINEERINGCRS`];function ye(e,t){var n=t[0],r=t[1];!(n in e)&&r in e&&(e[n]=e[r],t.length===3&&(e[n]=t[2](e[n])))}function be(e){for(var t=Object.keys(e),n=0,r=t.length;n<r;++n){var i=t[n];ve.indexOf(i)!==-1&&xe(e[i]),typeof e[i]==`object`&&be(e[i])}}function xe(e){if(e.AUTHORITY){var t=Object.keys(e.AUTHORITY)[0];t&&t in e.AUTHORITY&&(e.title=t+`:`+e.AUTHORITY[t])}if(e.type===`GEOGCS`?e.projName=`longlat`:e.type===`LOCAL_CS`?(e.projName=`identity`,e.local=!0):typeof e.PROJECTION==`object`?e.projName=Object.keys(e.PROJECTION)[0]:e.projName=e.PROJECTION,e.AXIS){for(var n=``,r=0,i=e.AXIS.length;r<i;++r){var a=[e.AXIS[r][0].toLowerCase(),e.AXIS[r][1].toLowerCase()];a[0].indexOf(`north`)!==-1||(a[0]===`y`||a[0]===`lat`)&&a[1]===`north`?n+=`n`:a[0].indexOf(`south`)!==-1||(a[0]===`y`||a[0]===`lat`)&&a[1]===`south`?n+=`s`:a[0].indexOf(`east`)!==-1||(a[0]===`x`||a[0]===`lon`)&&a[1]===`east`?n+=`e`:(a[0].indexOf(`west`)!==-1||(a[0]===`x`||a[0]===`lon`)&&a[1]===`west`)&&(n+=`w`)}n.length===2&&(n+=`u`),n.length===3&&(e.axis=n)}e.UNIT&&(e.units=e.UNIT.name.toLowerCase(),e.units===`metre`&&(e.units=`meter`),e.UNIT.convert&&(e.type===`GEOGCS`?e.DATUM&&e.DATUM.SPHEROID&&(e.to_meter=e.UNIT.convert*e.DATUM.SPHEROID.a):e.to_meter=e.UNIT.convert));var o=e.GEOGCS;e.type===`GEOGCS`&&(o=e),o&&(o.DATUM?e.datumCode=o.DATUM.name.toLowerCase():e.datumCode=o.name.toLowerCase(),e.datumCode.slice(0,2)===`d_`&&(e.datumCode=e.datumCode.slice(2)),e.datumCode===`new_zealand_1949`&&(e.datumCode=`nzgd49`),(e.datumCode===`wgs_1984`||e.datumCode===`world_geodetic_system_1984`)&&(e.PROJECTION===`Mercator_Auxiliary_Sphere`&&(e.sphere=!0),e.datumCode=`wgs84`),e.datumCode===`belge_1972`&&(e.datumCode=`rnb72`),o.DATUM&&o.DATUM.SPHEROID&&(e.ellps=o.DATUM.SPHEROID.name.replace(`_19`,``).replace(/[Cc]larke\_18/,`clrk`),e.ellps.toLowerCase().slice(0,13)===`international`&&(e.ellps=`intl`),e.a=o.DATUM.SPHEROID.a,e.rf=parseFloat(o.DATUM.SPHEROID.rf,10)),o.DATUM&&o.DATUM.TOWGS84&&(e.datum_params=o.DATUM.TOWGS84),~e.datumCode.indexOf(`osgb_1936`)&&(e.datumCode=`osgb36`),~e.datumCode.indexOf(`osni_1952`)&&(e.datumCode=`osni52`),(~e.datumCode.indexOf(`tm65`)||~e.datumCode.indexOf(`geodetic_datum_of_1965`))&&(e.datumCode=`ire65`),e.datumCode===`ch1903+`&&(e.datumCode=`ch1903`),~e.datumCode.indexOf(`israel`)&&(e.datumCode=`isr93`)),e.b&&!isFinite(e.b)&&(e.b=e.a),e.rectified_grid_angle&&=A(e.rectified_grid_angle);function s(t){return t*(e.to_meter||1)}[[`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`,A],[`longitude_of_center`,`Longitude_Of_Center`],[`longitude_of_center`,`Longitude_of_center`],[`longc`,`longitude_of_center`,A],[`x0`,`false_easting`,s],[`y0`,`false_northing`,s],[`long0`,`central_meridian`,A],[`lat0`,`latitude_of_origin`,A],[`lat0`,`standard_parallel_1`,A],[`lat1`,`standard_parallel_1`,A],[`lat2`,`standard_parallel_2`,A],[`azimuth`,`Azimuth`],[`alpha`,`azimuth`,A],[`srsCode`,`name`]].forEach(function(t){return ye(e,t)}),pe(e)}function Se(e){if(typeof e==`object`)return _e(e);let t=T(e);var n=E(e);if(t===`WKT2`)return _e(w(n));var r=n[0],i={};return k(n,i),be(i),i[r]}function j(e){var t=this;if(arguments.length===2){var n=arguments[1];typeof n==`string`?n.charAt(0)===`+`?j[e]=y(arguments[1]):j[e]=Se(arguments[1]):n&&typeof n==`object`&&!(`projName`in n)?j[e]=Se(arguments[1]):(j[e]=n,n||delete j[e])}else if(arguments.length===1){if(Array.isArray(e))return e.map(function(e){return Array.isArray(e)?j.apply(t,e):j(e)});if(typeof e==`string`){if(e in j)return j[e]}else `EPSG`in e?j[`EPSG:`+e.EPSG]=e:`ESRI`in e?j[`ESRI:`+e.ESRI]=e:`IAU2000`in e?j[`IAU2000:`+e.IAU2000]=e:console.log(e);return}}e(j);function Ce(e){return typeof e==`string`}function we(e){return e in j}function Te(e){return e.indexOf(`+`)!==0&&e.indexOf(`[`)!==-1||typeof e==`object`&&!(`srsCode`in e)}var Ee=[`3857`,`900913`,`3785`,`102113`];function De(e){var t=v(e,`authority`);if(t){var n=v(t,`epsg`);return n&&Ee.indexOf(n)>-1}}function Oe(e){var t=v(e,`extension`);if(t)return v(t,`proj4`)}function ke(e){return e[0]===`+`}function Ae(e){if(Ce(e)){if(we(e))return j[e];if(Te(e)){var t=Se(e);if(De(t))return j[`EPSG:3857`];var n=Oe(t);return n?y(n):t}if(ke(e))return y(e)}else if(`projName`in e)return e;else return Se(e)}function je(e,t){e||={};var n,r;if(!t)return e;for(r in t)n=t[r],n!==void 0&&(e[r]=n);return e}function M(e,t,n){var r=e*t;return n/Math.sqrt(1-r*r)}function Me(e){return e<0?-1:1}function N(e,t){return t||Math.abs(e)<=3.14159265359?e:e-Me(e)*p}function P(e,t,n){var r=e*n,i=.5*e;return r=((1-r)/(1+r))**i,Math.tan(.5*(a-t))/r}function Ne(e,t){for(var n=.5*e,r,i,o=a-2*Math.atan(t),s=0;s<=15;s++)if(r=e*Math.sin(o),i=a-2*Math.atan(t*((1-r)/(1+r))**n)-o,o+=i,Math.abs(i)<=1e-10)return o;return-9999}function Pe(){var e=this.b/this.a;this.es=1-e*e,`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=M(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function Fe(e){var t=e.x,n=e.y;if(n*57.29577951308232>90&&n*57.29577951308232<-90&&t*57.29577951308232>180&&t*57.29577951308232<-180)return null;var r,i;if(Math.abs(Math.abs(n)-a)<=1e-10)return null;if(this.sphere)r=this.x0+this.a*this.k0*N(t-this.long0,this.over),i=this.y0+this.a*this.k0*Math.log(Math.tan(f+.5*n));else{var o=Math.sin(n),s=P(this.e,n,o);r=this.x0+this.a*this.k0*N(t-this.long0,this.over),i=this.y0-this.a*this.k0*Math.log(s)}return e.x=r,e.y=i,e}function Ie(e){var t=e.x-this.x0,n=e.y-this.y0,r,i;if(this.sphere)i=a-2*Math.atan(Math.exp(-n/(this.a*this.k0)));else{var o=Math.exp(-n/(this.a*this.k0));if(i=Ne(this.e,o),i===-9999)return null}return r=N(this.long0+t/(this.a*this.k0),this.over),e.x=r,e.y=i,e}var Le={init:Pe,forward:Fe,inverse:Ie,names:[`Mercator`,`Popular Visualisation Pseudo Mercator`,`Mercator_1SP`,`Mercator_Auxiliary_Sphere`,`Mercator_Variant_A`,`merc`]};function Re(){}function ze(e){return e}var Be=[`longlat`,`identity`],Ve=[Le,{init:Re,forward:ze,inverse:ze,names:Be}],F={},He=[];function Ue(e,t){var n=He.length;return e.names?(He[n]=e,e.names.forEach(function(e){F[e.toLowerCase()]=n}),this):(console.log(t),!0)}function We(e){return e.replace(/[-\(\)\s]+/g,` `).trim().replace(/ /g,`_`)}function Ge(e){if(!e)return!1;var t=e.toLowerCase();if(F[t]!==void 0&&He[F[t]]||(t=We(t),t in F&&He[F[t]]))return He[F[t]]}function Ke(){Ve.forEach(Ue)}var qe={start:Ke,add:Ue,get:Ge},Je={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:6377563.396,b:6356256.91,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:6377340.189,b:6356034.446,ellipseName:`Modified Airy`},andrae:{a:6377104.43,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:6377397.155,rf:299.1528128,ellipseName:`Bessel 1841`},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:`Bessel 1841 (Namibia)`},clrk66:{a:6378206.4,b:6356583.8,ellipseName:`Clarke 1866`},clrk80:{a:6378249.145,rf:293.4663,ellipseName:`Clarke 1880 mod.`},clrk80ign:{a:6378249.2,b:6356515,rf:293.4660213,ellipseName:`Clarke 1880 (IGN)`},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:`Clarke 1858`},CPM:{a:6375738.7,rf:334.29,ellipseName:`Comm. des Poids et Mesures 1799`},delmbr:{a:6376428,rf:311.5,ellipseName:`Delambre 1810 (Belgium)`},engelis:{a:6378136.05,rf:298.2566,ellipseName:`Engelis 1985`},evrst30:{a:6377276.345,rf:300.8017,ellipseName:`Everest 1830`},evrst48:{a:6377304.063,rf:300.8017,ellipseName:`Everest 1948`},evrst56:{a:6377301.243,rf:300.8017,ellipseName:`Everest 1956`},evrst69:{a:6377295.664,rf:300.8017,ellipseName:`Everest 1969`},evrstSS:{a:6377298.556,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:6378157.5,b:6356772.2,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:6356773.3205,ellipseName:`Southeast Asia`},walbeck:{a:6376896,b:6355834.8467,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)`}};let Ye=Je.WGS84;function Xe(e,t,n,r){var i=e*e,a=t*t,l=(i-a)/i,u=0;r?(e*=1-l*(o+l*(s+l*c)),i=e*e,l=0):u=Math.sqrt(l);var d=(i-a)/a;return{es:l,e:u,ep2:d}}function Ze(e,t,n,r,i){if(!e){var a=v(Je,r);a||=Ye,e=a.a,t=a.b,n=a.rf}return n&&!t&&(t=(1-1/n)*e),(n===0||Math.abs(e-t)<1e-10)&&(i=!0,t=e),{a:e,b:t,rf:n,sphere:i}}var Qe={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 $e in Qe){var et=Qe[$e];et.datumName&&(Qe[et.datumName]=et)}function tt(e,t,n,r,a,o,s){var c={};return e===void 0||e===`none`?c.datum_type=5:c.datum_type=4,t&&(c.datum_params=t.map(parseFloat),(c.datum_params[0]!==0||c.datum_params[1]!==0||c.datum_params[2]!==0)&&(c.datum_type=1),c.datum_params.length>3&&(c.datum_params[3]!==0||c.datum_params[4]!==0||c.datum_params[5]!==0||c.datum_params[6]!==0)&&(c.datum_type=2,c.datum_params[3]*=i,c.datum_params[4]*=i,c.datum_params[5]*=i,c.datum_params[6]=c.datum_params[6]/1e6+1)),s&&(c.datum_type=3,c.grids=s),c.a=n,c.b=r,c.es=a,c.ep2=o,c}var nt={};function rt(e,t,n){return t instanceof ArrayBuffer?it(e,t,n):{ready:at(e,t)}}function it(e,t,n){var r=!0;n!==void 0&&n.includeErrorFields===!1&&(r=!1);var i=new DataView(t),a=lt(i),o=ut(i,a),s={header:o,subgrids:ft(i,o,a,r)};return nt[e]=s,s}async function at(e,t){for(var n=[],r=await t.getImageCount(),i=r-1;i>=0;i--){var a=await t.getImage(i),o=await a.readRasters(),s=[a.getWidth(),a.getHeight()],c=a.getBoundingBox().map(ct),l=[a.fileDirectory.ModelPixelScale[0],a.fileDirectory.ModelPixelScale[1]].map(ct),u=c[0]+(s[0]-1)*l[0],d=c[3]-(s[1]-1)*l[1],f=o[0],p=o[1],m=[];for(let e=s[1]-1;e>=0;e--)for(let t=s[0]-1;t>=0;t--){var h=e*s[0]+t;m.push([-I(p[h]),I(f[h])])}n.push({del:l,lim:s,ll:[-u,d],cvs:m})}var g={header:{nSubgrids:r},subgrids:n};return nt[e]=g,g}function ot(e){return e===void 0?null:e.split(`,`).map(st)}function st(e){if(e.length===0)return null;var t=e[0]===`@`;return t&&(e=e.slice(1)),e===`null`?{name:`null`,mandatory:!t,grid:null,isNull:!0}:{name:e,mandatory:!t,grid:nt[e]||null,isNull:!1}}function ct(e){return e*Math.PI/180}function I(e){return e/3600*Math.PI/180}function lt(e){var t=e.getInt32(8,!1);return t===11?!1:(t=e.getInt32(8,!0),t!==11&&console.warn(`Failed to detect nadgrid endian-ness, defaulting to little-endian`),!0)}function ut(e,t){return{nFields:e.getInt32(8,t),nSubgridFields:e.getInt32(24,t),nSubgrids:e.getInt32(40,t),shiftType:dt(e,56,64).trim(),fromSemiMajorAxis:e.getFloat64(120,t),fromSemiMinorAxis:e.getFloat64(136,t),toSemiMajorAxis:e.getFloat64(152,t),toSemiMinorAxis:e.getFloat64(168,t)}}function dt(e,t,n){return String.fromCharCode.apply(null,new Uint8Array(e.buffer.slice(t,n)))}function ft(e,t,n,r){for(var i=176,a=[],o=0;o<t.nSubgrids;o++){var s=mt(e,i,n),c=ht(e,i,s,n,r),l=Math.round(1+(s.upperLongitude-s.lowerLongitude)/s.longitudeInterval),u=Math.round(1+(s.upperLatitude-s.lowerLatitude)/s.latitudeInterval);a.push({ll:[I(s.lowerLongitude),I(s.lowerLatitude)],del:[I(s.longitudeInterval),I(s.latitudeInterval)],lim:[l,u],count:s.gridNodeCount,cvs:pt(c)});var d=16;r===!1&&(d=8),i+=176+s.gridNodeCount*d}return a}function pt(e){return e.map(function(e){return[I(e.longitudeShift),I(e.latitudeShift)]})}function mt(e,t,n){return{name:dt(e,t+8,t+16).trim(),parent:dt(e,t+24,t+24+8).trim(),lowerLatitude:e.getFloat64(t+72,n),upperLatitude:e.getFloat64(t+88,n),lowerLongitude:e.getFloat64(t+104,n),upperLongitude:e.getFloat64(t+120,n),latitudeInterval:e.getFloat64(t+136,n),longitudeInterval:e.getFloat64(t+152,n),gridNodeCount:e.getInt32(t+168,n)}}function ht(e,t,n,r,i){var a=t+176,o=16;i===!1&&(o=8);for(var s=[],c=0;c<n.gridNodeCount;c++){var l={latitudeShift:e.getFloat32(a+c*o,r),longitudeShift:e.getFloat32(a+c*o+4,r)};i!==!1&&(l.latitudeAccuracy=e.getFloat32(a+c*o+8,r),l.longitudeAccuracy=e.getFloat32(a+c*o+12,r)),s.push(l)}return s}function L(e,t){if(!(this instanceof L))return new L(e);this.forward=null,this.inverse=null,this.init=null,this.name,this.names=null,this.title,t||=function(e){if(e)throw e};var n=Ae(e);if(typeof n!=`object`){t(`Could not parse to valid json: `+e);return}var r=L.projections.get(n.projName);if(!r){t(`Could not get projection name from: `+e);return}if(n.datumCode&&n.datumCode!==`none`){var i=v(Qe,n.datumCode);i&&(n.datum_params=n.datum_params||(i.towgs84?i.towgs84.split(`,`):null),n.ellps=i.ellipse,n.datumName=i.datumName?i.datumName:n.datumCode)}n.k0=n.k0||1,n.axis=n.axis||`enu`,n.ellps=n.ellps||`wgs84`,n.lat1=n.lat1||n.lat0;var a=Ze(n.a,n.b,n.rf,n.ellps,n.sphere),o=Xe(a.a,a.b,a.rf,n.R_A),s=ot(n.nadgrids),c=n.datum||tt(n.datumCode,n.datum_params,a.a,a.b,o.es,o.ep2,s);je(this,n),je(this,r),this.a=a.a,this.b=a.b,this.rf=a.rf,this.sphere=a.sphere,this.es=o.es,this.e=o.e,this.ep2=o.ep2,this.datum=c,`init`in this&&typeof this.init==`function`&&this.init(),t(null,this)}L.projections=qe,L.projections.start();function gt(e,t){return e.datum_type===t.datum_type?e.a!==t.a||Math.abs(e.es-t.es)>5e-11?!1:e.datum_type===1?e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]:e.datum_type===2?e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]&&e.datum_params[3]===t.datum_params[3]&&e.datum_params[4]===t.datum_params[4]&&e.datum_params[5]===t.datum_params[5]&&e.datum_params[6]===t.datum_params[6]:!0:!1}function _t(e,t,n){var r=e.x,i=e.y,o=e.z?e.z:0,s,c,l,u;if(i<-a&&i>-1.001*a)i=-a;else if(i>a&&i<1.001*a)i=a;else if(i<-a)return{x:-1/0,y:-1/0,z:e.z};else if(i>a)return{x:1/0,y:1/0,z:e.z};return r>Math.PI&&(r-=2*Math.PI),c=Math.sin(i),u=Math.cos(i),l=c*c,s=n/Math.sqrt(1-t*l),{x:(s+o)*u*Math.cos(r),y:(s+o)*u*Math.sin(r),z:(s*(1-t)+o)*c}}function vt(e,t,n,r){var i=1e-12,o=i*i,s=30,c,l,u,d,f,p,m,h,g,_,v,y,b,x=e.x,S=e.y,C=e.z?e.z:0,w,T,E;if(c=Math.sqrt(x*x+S*S),l=Math.sqrt(x*x+S*S+C*C),c/n<i){if(w=0,l/n<i)return T=a,E=-r,{x:e.x,y:e.y,z:e.z}}else w=Math.atan2(S,x);u=C/l,d=c/l,f=1/Math.sqrt(1-t*(2-t)*d*d),h=d*(1-t)*f,g=u*f,b=0;do b++,m=n/Math.sqrt(1-t*g*g),E=c*h+C*g-m*(1-t*g*g),p=t*m/(m+E),f=1/Math.sqrt(1-p*(2-p)*d*d),_=d*(1-p)*f,v=u*f,y=v*h-_*g,h=_,g=v;while(y*y>o&&b<s);return T=Math.atan(v/Math.abs(_)),{x:w,y:T,z:E}}function yt(e,t,n){if(t===1)return{x:e.x+n[0],y:e.y+n[1],z:e.z+n[2]};if(t===2){var r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],c=n[5],l=n[6];return{x:l*(e.x-c*e.y+s*e.z)+r,y:l*(c*e.x+e.y-o*e.z)+i,z:l*(-s*e.x+o*e.y+e.z)+a}}}function bt(e,t,n){if(t===1)return{x:e.x-n[0],y:e.y-n[1],z:e.z-n[2]};if(t===2){var r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],c=n[5],l=n[6],u=(e.x-r)/l,d=(e.y-i)/l,f=(e.z-a)/l;return{x:u+c*d-s*f,y:-c*u+d+o*f,z:s*u-o*d+f}}}function xt(e){return e===1||e===2}function St(e,i,a){if(gt(e,i)||e.datum_type===5||i.datum_type===5)return a;var o=e.a,s=e.es;if(e.datum_type===3){if(Ct(e,!1,a)!==0)return;o=t,s=r}var c=i.a,l=i.b,u=i.es;if(i.datum_type===3&&(c=t,l=n,u=r),s===u&&o===c&&!xt(e.datum_type)&&!xt(i.datum_type)||(a=_t(a,s,o),xt(e.datum_type)&&(a=yt(a,e.datum_type,e.datum_params)),xt(i.datum_type)&&(a=bt(a,i.datum_type,i.datum_params)),a=vt(a,u,c,l),!(i.datum_type===3&&Ct(i,!0,a)!==0)))return a}function Ct(e,t,n){if(e.grids===null||e.grids.length===0)return console.log(`Grid shift grids not found`),-1;var r={x:-n.x,y:n.y},i={x:NaN,y:NaN},a=[];outer:for(var o=0;o<e.grids.length;o++){var s=e.grids[o];if(a.push(s.name),s.isNull){i=r;break}if(s.grid===null){if(s.mandatory)return console.log(`Unable to find mandatory grid '`+s.name+`'`),-1;continue}for(var c=s.grid.subgrids,l=0,u=c.length;l<u;l++){var f=c[l],p=(Math.abs(f.del[1])+Math.abs(f.del[0]))/1e4,m=f.ll[0]-p,h=f.ll[1]-p,g=f.ll[0]+(f.lim[0]-1)*f.del[0]+p,_=f.ll[1]+(f.lim[1]-1)*f.del[1]+p;if(!(h>r.y||m>r.x||_<r.y||g<r.x)&&(i=wt(r,t,f),!isNaN(i.x)))break outer}}return isNaN(i.x)?(console.log(`Failed to find a grid shift table for location '`+-r.x*d+` `+r.y*d+` tried: '`+a+`'`),-1):(n.x=-i.x,n.y=i.y,0)}function wt(e,t,n){var r={x:NaN,y:NaN};if(isNaN(e.x))return r;var i={x:e.x,y:e.y};i.x-=n.ll[0],i.y-=n.ll[1],i.x=N(i.x-Math.PI)+Math.PI;var a=Tt(i,n);if(t){if(isNaN(a.x))return r;a.x=i.x-a.x,a.y=i.y-a.y;var o=9,s=1e-12,c,l;do{if(l=Tt(a,n),isNaN(l.x)){console.log(`Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.`);break}c={x:i.x-(l.x+a.x),y:i.y-(l.y+a.y)},a.x+=c.x,a.y+=c.y}while(o--&&Math.abs(c.x)>s&&Math.abs(c.y)>s);if(o<0)return console.log(`Inverse grid shift iterator failed to converge.`),r;r.x=N(a.x+n.ll[0]),r.y=a.y+n.ll[1]}else isNaN(a.x)||(r.x=e.x+a.x,r.y=e.y+a.y);return r}function Tt(e,t){var n={x:e.x/t.del[0],y:e.y/t.del[1]},r={x:Math.floor(n.x),y:Math.floor(n.y)},i={x:n.x-1*r.x,y:n.y-1*r.y},a={x:NaN,y:NaN},o;if(r.x<0||r.x>=t.lim[0]||r.y<0||r.y>=t.lim[1])return a;o=r.y*t.lim[0]+r.x;var s={x:t.cvs[o][0],y:t.cvs[o][1]};o++;var c={x:t.cvs[o][0],y:t.cvs[o][1]};o+=t.lim[0];var l={x:t.cvs[o][0],y:t.cvs[o][1]};o--;var u={x:t.cvs[o][0],y:t.cvs[o][1]},d=i.x*i.y,f=i.x*(1-i.y),p=(1-i.x)*(1-i.y),m=(1-i.x)*i.y;return a.x=p*s.x+f*c.x+m*u.x+d*l.x,a.y=p*s.y+f*c.y+m*u.y+d*l.y,a}function Et(e,t,n){var r=n.x,i=n.y,a=n.z||0,o,s,c,l={};for(c=0;c<3;c++)if(!(t&&c===2&&n.z===void 0))switch(c===0?(o=r,s=`ew`.indexOf(e.axis[c])===-1?`y`:`x`):c===1?(o=i,s=`ns`.indexOf(e.axis[c])===-1?`x`:`y`):(o=a,s=`z`),e.axis[c]){case`e`:l[s]=o;break;case`w`:l[s]=-o;break;case`n`:l[s]=o;break;case`s`:l[s]=-o;break;case`u`:n[s]!==void 0&&(l.z=o);break;case`d`:n[s]!==void 0&&(l.z=-o);break;default:return null}return l}function Dt(e){var t={x:e[0],y:e[1]};return e.length>2&&(t.z=e[2]),e.length>3&&(t.m=e[3]),t}function Ot(e){kt(e.x),kt(e.y)}function kt(e){if(typeof Number.isFinite==`function`){if(Number.isFinite(e))return;throw TypeError(`coordinates must be finite numbers`)}if(typeof e!=`number`||e!==e||!isFinite(e))throw TypeError(`coordinates must be finite numbers`)}function At(e,t){return(e.datum.datum_type===1||e.datum.datum_type===2||e.datum.datum_type===3)&&t.datumCode!==`WGS84`||(t.datum.datum_type===1||t.datum.datum_type===2||t.datum.datum_type===3)&&e.datumCode!==`WGS84`}function jt(e,t,n,r){var i;n=Array.isArray(n)?Dt(n):{x:n.x,y:n.y,z:n.z,m:n.m};var a=n.z!==void 0;if(Ot(n),e.datum&&t.datum&&At(e,t)&&(i=new L(`WGS84`),n=jt(e,i,n,r),e=i),r&&e.axis!==`enu`&&(n=Et(e,!1,n)),e.projName===`longlat`)n={x:n.x*u,y:n.y*u,z:n.z||0};else if(e.to_meter&&(n={x:n.x*e.to_meter,y:n.y*e.to_meter,z:n.z||0}),n=e.inverse(n),!n)return;if(e.from_greenwich&&(n.x+=e.from_greenwich),n=St(e.datum,t.datum,n),n)return n=n,t.from_greenwich&&(n={x:n.x-t.from_greenwich,y:n.y,z:n.z||0}),t.projName===`longlat`?n={x:n.x*d,y:n.y*d,z:n.z||0}:(n=t.forward(n),t.to_meter&&(n={x:n.x/t.to_meter,y:n.y/t.to_meter,z:n.z||0})),r&&t.axis!==`enu`?Et(t,!0,n):(n&&!a&&delete n.z,n)}var Mt=L(`WGS84`);function Nt(e,t,n,r){var i,a,o;return Array.isArray(n)?(i=jt(e,t,n,r)||{x:NaN,y:NaN},n.length>2?e.name!==void 0&&e.name===`geocent`||t.name!==void 0&&t.name===`geocent`?typeof i.z==`number`?[i.x,i.y,i.z].concat(n.slice(3)):[i.x,i.y,n[2]].concat(n.slice(3)):[i.x,i.y].concat(n.slice(2)):[i.x,i.y]):(a=jt(e,t,n,r),o=Object.keys(n),o.length===2||o.forEach(function(r){if(e.name!==void 0&&e.name===`geocent`||t.name!==void 0&&t.name===`geocent`){if(r===`x`||r===`y`||r===`z`)return}else if(r===`x`||r===`y`)return;a[r]=n[r]}),a)}function Pt(e){return e instanceof L?e:typeof e==`object`&&`oProj`in e?e.oProj:L(e)}function Ft(e,t,n){var r,i,a=!1,o;return t===void 0?(i=Pt(e),r=Mt,a=!0):(t.x!==void 0||Array.isArray(t))&&(n=t,i=Pt(e),r=Mt,a=!0),r||=Pt(e),i||=Pt(t),n?Nt(r,i,n):(o={forward:function(e,t){return Nt(r,i,e,t)},inverse:function(e,t){return Nt(i,r,e,t)}},a&&(o.oProj=i),o)}var It=6,Lt=`AJSAJS`,Rt=`AFAFAF`,R=65,z=73,B=79,zt=86,Bt=90,Vt={forward:Ht,inverse:Ut,toPoint:Wt};function Ht(e,t){return t||=5,Xt(qt({lat:e[1],lon:e[0]}),t)}function Ut(e){var t=Jt(en(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat,t.lon,t.lat]:[t.left,t.bottom,t.right,t.top]}function Wt(e){var t=Jt(en(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function Gt(e){return Math.PI/180*e}function Kt(e){return e/Math.PI*180}function qt(e){var t=e.lat,n=e.lon,r=6378137,i=.00669438,a=.9996,o,s,c,l,u,d,f,p=Gt(t),m=Gt(n),h,g=Math.floor((n+180)/6)+1;n===180&&(g=60),t>=56&&t<64&&n>=3&&n<12&&(g=32),t>=72&&t<84&&(n>=0&&n<9?g=31:n>=9&&n<21?g=33:n>=21&&n<33?g=35:n>=33&&n<42&&(g=37)),o=(g-1)*6-180+3,h=Gt(o),s=i/(1-i),c=r/Math.sqrt(1-i*Math.sin(p)*Math.sin(p)),l=Math.tan(p)*Math.tan(p),u=s*Math.cos(p)*Math.cos(p),d=Math.cos(p)*(m-h),f=r*((1-i/4-3*i*i/64-5*i*i*i/256)*p-(3*i/8+3*i*i/32+45*i*i*i/1024)*Math.sin(2*p)+(15*i*i/256+45*i*i*i/1024)*Math.sin(4*p)-35*i*i*i/3072*Math.sin(6*p));var _=a*c*(d+(1-l+u)*d*d*d/6+(5-18*l+l*l+72*u-58*s)*d*d*d*d*d/120)+5e5,v=a*(f+c*Math.tan(p)*(d*d/2+(5-l+9*u+4*u*u)*d*d*d*d/24+(61-58*l+l*l+600*u-330*s)*d*d*d*d*d*d/720));return t<0&&(v+=1e7),{northing:Math.round(v),easting:Math.round(_),zoneNumber:g,zoneLetter:Yt(t)}}function Jt(e){var t=e.northing,n=e.easting,r=e.zoneLetter,i=e.zoneNumber;if(i<0||i>60)return null;var a=.9996,o=6378137,s=.00669438,c,l=(1-Math.sqrt(1-s))/(1+Math.sqrt(1-s)),u,d,f,p,m,h,g,_,v,y=n-5e5,b=t;r<`N`&&(b-=1e7),g=(i-1)*6-180+3,c=s/(1-s),h=b/a,_=h/(o*(1-s/4-3*s*s/64-5*s*s*s/256)),v=_+(3*l/2-27*l*l*l/32)*Math.sin(2*_)+(21*l*l/16-55*l*l*l*l/32)*Math.sin(4*_)+151*l*l*l/96*Math.sin(6*_),u=o/Math.sqrt(1-s*Math.sin(v)*Math.sin(v)),d=Math.tan(v)*Math.tan(v),f=c*Math.cos(v)*Math.cos(v),p=o*(1-s)/(1-s*Math.sin(v)*Math.sin(v))**1.5,m=y/(u*a);var x=v-u*Math.tan(v)/p*(m*m/2-(5+3*d+10*f-4*f*f-9*c)*m*m*m*m/24+(61+90*d+298*f+45*d*d-252*c-3*f*f)*m*m*m*m*m*m/720);x=Kt(x);var S=(m-(1+2*d+f)*m*m*m/6+(5-2*f+28*d-3*f*f+8*c+24*d*d)*m*m*m*m*m/120)/Math.cos(v);S=g+Kt(S);var C;if(e.accuracy){var w=Jt({northing:e.northing+e.accuracy,easting:e.easting+e.accuracy,zoneLetter:e.zoneLetter,zoneNumber:e.zoneNumber});C={top:w.lat,right:w.lon,bottom:x,left:S}}else C={lat:x,lon:S};return C}function Yt(e){var t=`Z`;return 84>=e&&e>=72?t=`X`:72>e&&e>=64?t=`W`:64>e&&e>=56?t=`V`:56>e&&e>=48?t=`U`:48>e&&e>=40?t=`T`:40>e&&e>=32?t=`S`:32>e&&e>=24?t=`R`:24>e&&e>=16?t=`Q`:16>e&&e>=8?t=`P`:8>e&&e>=0?t=`N`:0>e&&e>=-8?t=`M`:-8>e&&e>=-16?t=`L`:-16>e&&e>=-24?t=`K`:-24>e&&e>=-32?t=`J`:-32>e&&e>=-40?t=`H`:-40>e&&e>=-48?t=`G`:-48>e&&e>=-56?t=`F`:-56>e&&e>=-64?t=`E`:-64>e&&e>=-72?t=`D`:-72>e&&e>=-80&&(t=`C`),t}function Xt(e,t){var n=`00000`+e.easting,r=`00000`+e.northing;return e.zoneNumber+e.zoneLetter+Zt(e.easting,e.northing,e.zoneNumber)+n.substr(n.length-5,t)+r.substr(r.length-5,t)}function Zt(e,t,n){var r=Qt(n);return $t(Math.floor(e/1e5),Math.floor(t/1e5)%20,r)}function Qt(e){var t=e%It;return t===0&&(t=It),t}function $t(e,t,n){var r=n-1,i=Lt.charCodeAt(r),a=Rt.charCodeAt(r),o=i+e-1,s=a+t,c=!1;return o>Bt&&(o=o-Bt+R-1,c=!0),(o===z||i<z&&o>z||(o>z||i<z)&&c)&&o++,(o===B||i<B&&o>B||(o>B||i<B)&&c)&&(o++,o===z&&o++),o>Bt&&(o=o-Bt+R-1),s>zt?(s=s-zt+R-1,c=!0):c=!1,(s===z||a<z&&s>z||(s>z||a<z)&&c)&&s++,(s===B||a<B&&s>B||(s>B||a<B)&&c)&&(s++,s===z&&s++),s>zt&&(s=s-zt+R-1),String.fromCharCode(o)+String.fromCharCode(s)}function en(e){if(e&&e.length===0)throw`MGRSPoint coverting from nothing`;for(var t=e.length,n=null,r=``,i,a=0;!/[A-Z]/.test(i=e.charAt(a));){if(a>=2)throw`MGRSPoint bad conversion from: `+e;r+=i,a++}var o=parseInt(r,10);if(a===0||a+3>t)throw`MGRSPoint bad conversion from: `+e;var s=e.charAt(a++);if(s<=`A`||s===`B`||s===`Y`||s>=`Z`||s===`I`||s===`O`)throw`MGRSPoint zone letter `+s+` not handled: `+e;n=e.substring(a,a+=2);for(var c=Qt(o),l=tn(n.charAt(0),c),u=nn(n.charAt(1),c);u<rn(s);)u+=2e6;var d=t-a;if(d%2!=0)throw`MGRSPoint has to have an even number
2
+ of digits after the zone letter and two 100km letters - front
3
+ half for easting meters, second half for
4
+ northing meters`+e;var f=d/2,p=0,m=0,h,g,_,v,y;return f>0&&(h=1e5/10**f,g=e.substring(a,a+f),p=parseFloat(g)*h,_=e.substring(a+f),m=parseFloat(_)*h),v=p+l,y=m+u,{easting:v,northing:y,zoneLetter:s,zoneNumber:o,accuracy:h}}function tn(e,t){for(var n=Lt.charCodeAt(t-1),r=1e5,i=!1;n!==e.charCodeAt(0);){if(n++,n===z&&n++,n===B&&n++,n>Bt){if(i)throw`Bad character: `+e;n=R,i=!0}r+=1e5}return r}function nn(e,t){if(e>`V`)throw`MGRSPoint given invalid Northing `+e;for(var n=Rt.charCodeAt(t-1),r=0,i=!1;n!==e.charCodeAt(0);){if(n++,n===z&&n++,n===B&&n++,n>zt){if(i)throw`Bad character: `+e;n=R,i=!0}r+=1e5}return r}function rn(e){var t;switch(e){case`C`:t=11e5;break;case`D`:t=2e6;break;case`E`:t=28e5;break;case`F`:t=37e5;break;case`G`:t=46e5;break;case`H`:t=55e5;break;case`J`:t=64e5;break;case`K`:t=73e5;break;case`L`:t=82e5;break;case`M`:t=91e5;break;case`N`:t=0;break;case`P`:t=8e5;break;case`Q`:t=17e5;break;case`R`:t=26e5;break;case`S`:t=35e5;break;case`T`:t=44e5;break;case`U`:t=53e5;break;case`V`:t=62e5;break;case`W`:t=7e6;break;case`X`:t=79e5;break;default:t=-1}if(t>=0)return t;throw`Invalid zone letter: `+e}function V(e,t,n){if(!(this instanceof V))return new V(e,t,n);if(Array.isArray(e))this.x=e[0],this.y=e[1],this.z=e[2]||0;else if(typeof e==`object`)this.x=e.x,this.y=e.y,this.z=e.z||0;else if(typeof e==`string`&&t===void 0){var r=e.split(`,`);this.x=parseFloat(r[0]),this.y=parseFloat(r[1]),this.z=parseFloat(r[2])||0}else this.x=e,this.y=t,this.z=n||0;console.warn(`proj4.Point will be removed in version 3, use proj4.toPoint`)}V.fromMGRS=function(e){return new V(Wt(e))},V.prototype.toMGRS=function(e){return Ht([this.x,this.y],e)};var an=1,on=.25,sn=.046875,cn=.01953125,ln=.01068115234375,un=.75,dn=.46875,fn=.013020833333333334,pn=.007120768229166667,mn=.3645833333333333,hn=.005696614583333333,gn=.3076171875;function _n(e){var t=[];t[0]=an-e*(on+e*(sn+e*(cn+e*ln))),t[1]=e*(un-e*(sn+e*(cn+e*ln)));var n=e*e;return t[2]=n*(dn-e*(fn+e*pn)),n*=e,t[3]=n*(mn-e*hn),t[4]=n*e*gn,t}function vn(e,t,n,r){return n*=t,t*=t,r[0]*e-n*(r[1]+t*(r[2]+t*(r[3]+t*r[4])))}var yn=20;function bn(e,t,n){for(var r=1/(1-t),i=e,a=yn;a;--a){var o=Math.sin(i),s=1-t*o*o;if(s=(vn(i,o,Math.cos(i),n)-e)*(s*Math.sqrt(s))*r,i-=s,Math.abs(s)<1e-10)return i}return i}function xn(){this.x0=this.x0===void 0?0:this.x0,this.y0=this.y0===void 0?0:this.y0,this.long0=this.long0===void 0?0:this.long0,this.lat0=this.lat0===void 0?0:this.lat0,this.es&&(this.en=_n(this.es),this.ml0=vn(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function Sn(e){var t=e.x,n=e.y,r=N(t-this.long0,this.over),i,a,o,s=Math.sin(n),c=Math.cos(n);if(this.es){var l=c*r,u=l**2,d=this.ep2*c**2,f=d**2,p=(Math.abs(c)>1e-10?Math.tan(n):0)**2,m=p**2;i=1-this.es*s**2,l/=Math.sqrt(i);var h=vn(n,s,c,this.en);a=this.a*(this.k0*l*(1+u/6*(1-p+d+u/20*(5-18*p+m+14*d-58*p*d+u/42*(61+179*m-m*p-479*p)))))+this.x0,o=this.a*(this.k0*(h-this.ml0+s*r*l/2*(1+u/12*(5-p+9*d+4*f+u/30*(61+m-58*p+270*d-330*p*d+u/56*(1385+543*m-m*p-3111*p))))))+this.y0}else{var g=c*Math.sin(r);if(Math.abs(Math.abs(g)-1)<1e-10)return 93;if(a=.5*this.a*this.k0*Math.log((1+g)/(1-g))+this.x0,o=c*Math.cos(r)/Math.sqrt(1-g**2),g=Math.abs(o),g>=1){if(g-1>1e-10)return 93;o=0}else o=Math.acos(o);n<0&&(o=-o),o=this.a*this.k0*(o-this.lat0)+this.y0}return e.x=a,e.y=o,e}function Cn(e){var t,n,r,i,o=(e.x-this.x0)*(1/this.a),s=(e.y-this.y0)*(1/this.a);if(!this.es){var c=Math.exp(o/this.k0),l=.5*(c-1/c),u=this.lat0+s/this.k0,d=Math.cos(u);t=Math.sqrt((1-d**2)/(1+l**2)),r=Math.asin(t),s<0&&(r=-r),i=l===0&&d===0?0:N(Math.atan2(l,d)+this.long0,this.over)}else if(t=this.ml0+s/this.k0,n=bn(t,this.es,this.en),Math.abs(n)<a){var f=Math.sin(n),p=Math.cos(n),m=Math.abs(p)>1e-10?Math.tan(n):0,h=this.ep2*p**2,g=h**2,_=m**2,v=_**2;t=1-this.es*f**2;var y=o*Math.sqrt(t)/this.k0,b=y**2;t*=m,r=n-t*b/(1-this.es)*.5*(1-b/12*(5+3*_-9*h*_+h-4*g-b/30*(61+90*_-252*h*_+45*v+46*h-b/56*(1385+3633*_+4095*v+1574*v*_)))),i=N(this.long0+y*(1-b/6*(1+2*_+h-b/20*(5+28*_+24*v+8*h*_+6*h-b/42*(61+662*_+1320*v+720*v*_))))/p,this.over)}else r=a*Me(s),i=0;return e.x=i,e.y=r,e}var wn={init:xn,forward:Sn,inverse:Cn,names:[`Fast_Transverse_Mercator`,`Fast Transverse Mercator`]};function Tn(e){var t=Math.exp(e);return t=(t-1/t)/2,t}function H(e,t){e=Math.abs(e),t=Math.abs(t);var n=Math.max(e,t),r=Math.min(e,t)/(n||1);return n*Math.sqrt(1+r**2)}function En(e){var t=1+e,n=t-1;return n===0?e:e*Math.log(t)/n}function Dn(e){var t=Math.abs(e);return t=En(t*(1+t/(H(1,t)+1))),e<0?-t:t}function On(e,t){for(var n=2*Math.cos(2*t),r=e.length-1,i=e[r],a=0,o;--r>=0;)o=-a+n*i+e[r],a=i,i=o;return t+o*Math.sin(2*t)}function kn(e,t){for(var n=2*Math.cos(t),r=e.length-1,i=e[r],a=0,o;--r>=0;)o=-a+n*i+e[r],a=i,i=o;return Math.sin(t)*o}function An(e){var t=Math.exp(e);return t=(t+1/t)/2,t}function jn(e,t,n){for(var r=Math.sin(t),i=Math.cos(t),a=Tn(n),o=An(n),s=2*i*o,c=-2*r*a,l=e.length-1,u=e[l],d=0,f=0,p=0,m,h;--l>=0;)m=f,h=d,f=u,d=p,u=-m+s*f-c*d+e[l],p=-h+c*f+s*d;return s=r*o,c=i*a,[s*u-c*p,s*p+c*u]}function Mn(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw Error(`Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.`);this.approx&&(wn.init.apply(this),this.forward=wn.forward,this.inverse=wn.inverse),this.x0=this.x0===void 0?0:this.x0,this.y0=this.y0===void 0?0:this.y0,this.long0=this.long0===void 0?0:this.long0,this.lat0=this.lat0===void 0?0:this.lat0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var e=this.es/(1+Math.sqrt(1-this.es)),t=e/(2-e),n=t;this.cgb[0]=t*(2+t*(-2/3+t*(-2+t*(116/45+t*(26/45+-2854/675*t))))),this.cbg[0]=t*(-2+t*(2/3+t*(4/3+t*(-82/45+t*(32/45+4642/4725*t))))),n*=t,this.cgb[1]=n*(7/3+t*(-8/5+t*(-227/45+t*(2704/315+2323/945*t)))),this.cbg[1]=n*(5/3+t*(-16/15+t*(-13/9+t*(904/315+-1522/945*t)))),n*=t,this.cgb[2]=n*(56/15+t*(-136/35+t*(-1262/105+73814/2835*t))),this.cbg[2]=n*(-26/15+t*(34/21+t*(8/5+-12686/2835*t))),n*=t,this.cgb[3]=n*(4279/630+t*(-332/35+-399572/14175*t)),this.cbg[3]=n*(1237/630+t*(-12/5+-24832/14175*t)),n*=t,this.cgb[4]=n*(4174/315+-144838/6237*t),this.cbg[4]=n*(-734/315+109598/31185*t),n*=t,this.cgb[5]=601676/22275*n,this.cbg[5]=444337/155925*n,n=t**2,this.Qn=this.k0/(1+t)*(1+n*(1/4+n*(1/64+n/256))),this.utg[0]=t*(-.5+t*(2/3+t*(-37/96+t*(1/360+t*(81/512+-96199/604800*t))))),this.gtu[0]=t*(.5+t*(-2/3+t*(5/16+t*(41/180+t*(-127/288+7891/37800*t))))),this.utg[1]=n*(-1/48+t*(-1/15+t*(437/1440+t*(-46/105+1118711/3870720*t)))),this.gtu[1]=n*(13/48+t*(-3/5+t*(557/1440+t*(281/630+-1983433/1935360*t)))),n*=t,this.utg[2]=n*(-17/480+t*(37/840+t*(209/4480+-5569/90720*t))),this.gtu[2]=n*(61/240+t*(-103/140+t*(15061/26880+167603/181440*t))),n*=t,this.utg[3]=n*(-4397/161280+t*(11/504+830251/7257600*t)),this.gtu[3]=n*(49561/161280+t*(-179/168+6601661/7257600*t)),n*=t,this.utg[4]=n*(-4583/161280+108847/3991680*t),this.gtu[4]=n*(34729/80640+-3418889/1995840*t),n*=t,this.utg[5]=-20648693/638668800*n,this.gtu[5]=212378941/319334400*n;var r=On(this.cbg,this.lat0);this.Zb=-this.Qn*(r+kn(this.gtu,2*r))}function Nn(e){var t=N(e.x-this.long0,this.over),n=e.y;n=On(this.cbg,n);var r=Math.sin(n),i=Math.cos(n),a=Math.sin(t),o=Math.cos(t);n=Math.atan2(r,o*i),t=Math.atan2(a*i,H(r,i*o)),t=Dn(Math.tan(t));var s=jn(this.gtu,2*n,2*t);n+=s[0],t+=s[1];var c,l;return Math.abs(t)<=2.623395162778?(c=this.a*(this.Qn*t)+this.x0,l=this.a*(this.Qn*n+this.Zb)+this.y0):(c=1/0,l=1/0),e.x=c,e.y=l,e}function Pn(e){var t=(e.x-this.x0)*(1/this.a),n=(e.y-this.y0)*(1/this.a);n=(n-this.Zb)/this.Qn,t/=this.Qn;var r,i;if(Math.abs(t)<=2.623395162778){var a=jn(this.utg,2*n,2*t);n+=a[0],t+=a[1],t=Math.atan(Tn(t));var o=Math.sin(n),s=Math.cos(n),c=Math.sin(t),l=Math.cos(t);n=Math.atan2(o*l,H(c,l*s)),t=Math.atan2(c,l*s),r=N(t+this.long0,this.over),i=On(this.cgb,n)}else r=1/0,i=1/0;return e.x=r,e.y=i,e}var Fn={init:Mn,forward:Nn,inverse:Pn,names:[`Extended_Transverse_Mercator`,`Extended Transverse Mercator`,`etmerc`,`Transverse_Mercator`,`Transverse Mercator`,`Gauss Kruger`,`Gauss_Kruger`,`tmerc`]};function In(e,t){if(e===void 0){if(e=Math.floor((N(t)+Math.PI)*30/Math.PI)+1,e<0)return 0;if(e>60)return 60}return e}var Ln=`etmerc`;function Rn(){var e=In(this.zone,this.long0);if(e===void 0)throw Error(`unknown utm zone`);this.lat0=0,this.long0=(6*Math.abs(e)-183)*u,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Fn.init.apply(this),this.forward=Fn.forward,this.inverse=Fn.inverse}var zn={init:Rn,names:[`Universal Transverse Mercator System`,`utm`],dependsOn:Ln};function Bn(e,t){return((1-e)/(1+e))**t}var Vn=20;function Hn(){var e=Math.sin(this.lat0),t=Math.cos(this.lat0);t*=t,this.rc=Math.sqrt(1-this.es)/(1-this.es*e*e),this.C=Math.sqrt(1+this.es*t*t/(1-this.es)),this.phic0=Math.asin(e/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+f)/(Math.tan(.5*this.lat0+f)**+this.C*Bn(this.e*e,this.ratexp))}function Un(e){var t=e.x,n=e.y;return e.y=2*Math.atan(this.K*Math.tan(.5*n+f)**+this.C*Bn(this.e*Math.sin(n),this.ratexp))-a,e.x=this.C*t,e}function Wn(e){for(var t=1e-14,n=e.x/this.C,r=e.y,i=(Math.tan(.5*r+f)/this.K)**(1/this.C),o=Vn;o>0&&(r=2*Math.atan(i*Bn(this.e*Math.sin(e.y),-.5*this.e))-a,!(Math.abs(r-e.y)<t));--o)e.y=r;return o?(e.x=n,e.y=r,e):null}var Gn={init:Hn,forward:Un,inverse:Wn,names:[`gauss`]};function Kn(){Gn.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||=`Oblique Stereographic Alternative`)}function qn(e){var t,n,r,i;return e.x=N(e.x-this.long0,this.over),Gn.forward.apply(this,[e]),t=Math.sin(e.y),n=Math.cos(e.y),r=Math.cos(e.x),i=this.k0*this.R2/(1+this.sinc0*t+this.cosc0*n*r),e.x=i*n*Math.sin(e.x),e.y=i*(this.cosc0*t-this.sinc0*n*r),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function Jn(e){var t,n,r,i,a;if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,a=H(e.x,e.y)){var o=2*Math.atan2(a,this.R2);t=Math.sin(o),n=Math.cos(o),i=Math.asin(n*this.sinc0+e.y*t*this.cosc0/a),r=Math.atan2(e.x*t,a*this.cosc0*n-e.y*this.sinc0*t)}else i=this.phic0,r=0;return e.x=r,e.y=i,Gn.inverse.apply(this,[e]),e.x=N(e.x+this.long0,this.over),e}var Yn={init:Kn,forward:qn,inverse:Jn,names:[`Stereographic_North_Pole`,`Oblique_Stereographic`,`sterea`,`Oblique Stereographic Alternative`,`Double_Stereographic`]};function Xn(e,t,n){return t*=n,Math.tan(.5*(a+e))*((1-t)/(1+t))**(.5*n)}function Zn(){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)<=1e-10&&(this.k0=.5*(1+Me(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=1e-10&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt((1+this.e)**+(1+this.e)*(1-this.e)**(1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=1e-10&&Math.abs(Math.cos(this.lat_ts))>1e-10&&(this.k0=.5*this.cons*M(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/P(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=M(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(Xn(this.lat0,this.sinlat0,this.e))-a,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function Qn(e){var t=e.x,n=e.y,r=Math.sin(n),i=Math.cos(n),o,s,c,l,u,d,f=N(t-this.long0,this.over);return Math.abs(Math.abs(t-this.long0)-Math.PI)<=1e-10&&Math.abs(n+this.lat0)<=1e-10?(e.x=NaN,e.y=NaN,e):this.sphere?(o=2*this.k0/(1+this.sinlat0*r+this.coslat0*i*Math.cos(f)),e.x=this.a*o*i*Math.sin(f)+this.x0,e.y=this.a*o*(this.coslat0*r-this.sinlat0*i*Math.cos(f))+this.y0,e):(s=2*Math.atan(Xn(n,r,this.e))-a,l=Math.cos(s),c=Math.sin(s),Math.abs(this.coslat0)<=1e-10?(u=P(this.e,n*this.con,this.con*r),d=2*this.a*this.k0*u/this.cons,e.x=this.x0+d*Math.sin(t-this.long0),e.y=this.y0-this.con*d*Math.cos(t-this.long0),e):(Math.abs(this.sinlat0)<1e-10?(o=2*this.a*this.k0/(1+l*Math.cos(f)),e.y=o*c):(o=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*c+this.cosX0*l*Math.cos(f))),e.y=o*(this.cosX0*c-this.sinX0*l*Math.cos(f))+this.y0),e.x=o*l*Math.sin(f)+this.x0,e))}function $n(e){e.x-=this.x0,e.y-=this.y0;var t,n,r,i,o,s=Math.sqrt(e.x*e.x+e.y*e.y);if(this.sphere){var c=2*Math.atan(s/(2*this.a*this.k0));return t=this.long0,n=this.lat0,s<=1e-10?(e.x=t,e.y=n,e):(n=Math.asin(Math.cos(c)*this.sinlat0+e.y*Math.sin(c)*this.coslat0/s),t=Math.abs(this.coslat0)<1e-10?this.lat0>0?N(this.long0+Math.atan2(e.x,-1*e.y),this.over):N(this.long0+Math.atan2(e.x,e.y),this.over):N(this.long0+Math.atan2(e.x*Math.sin(c),s*this.coslat0*Math.cos(c)-e.y*this.sinlat0*Math.sin(c)),this.over),e.x=t,e.y=n,e)}else if(Math.abs(this.coslat0)<=1e-10){if(s<=1e-10)return n=this.lat0,t=this.long0,e.x=t,e.y=n,e;e.x*=this.con,e.y*=this.con,r=s*this.cons/(2*this.a*this.k0),n=this.con*Ne(this.e,r),t=this.con*N(this.con*this.long0+Math.atan2(e.x,-1*e.y),this.over)}else i=2*Math.atan(s*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,s<=1e-10?o=this.X0:(o=Math.asin(Math.cos(i)*this.sinX0+e.y*Math.sin(i)*this.cosX0/s),t=N(this.long0+Math.atan2(e.x*Math.sin(i),s*this.cosX0*Math.cos(i)-e.y*this.sinX0*Math.sin(i)),this.over)),n=-1*Ne(this.e,Math.tan(.5*(a+o)));return e.x=t,e.y=n,e}var er={init:Zn,forward:Qn,inverse:$n,names:[`stere`,`Stereographic_South_Pole`,`Polar_Stereographic_variant_A`,`Polar_Stereographic_variant_B`,`Polar_Stereographic`],ssfn_:Xn};function tr(){var e=this.lat0;this.lambda0=this.long0;var t=Math.sin(e),n=this.a,r=1/this.rf,i=2*r-r**2,a=this.e=Math.sqrt(i);this.R=this.k0*n*Math.sqrt(1-i)/(1-i*t**2),this.alpha=Math.sqrt(1+i/(1-i)*Math.cos(e)**4),this.b0=Math.asin(t/this.alpha);var o=Math.log(Math.tan(Math.PI/4+this.b0/2)),s=Math.log(Math.tan(Math.PI/4+e/2)),c=Math.log((1+a*t)/(1-a*t));this.K=o-this.alpha*s+this.alpha*a/2*c}function nr(e){var t=Math.log(Math.tan(Math.PI/4-e.y/2)),n=this.e/2*Math.log((1+this.e*Math.sin(e.y))/(1-this.e*Math.sin(e.y))),r=-this.alpha*(t+n)+this.K,i=2*(Math.atan(Math.exp(r))-Math.PI/4),a=this.alpha*(e.x-this.lambda0),o=Math.atan(Math.sin(a)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(a))),s=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(a));return e.y=this.R/2*Math.log((1+Math.sin(s))/(1-Math.sin(s)))+this.y0,e.x=this.R*o+this.x0,e}function rr(e){for(var t=e.x-this.x0,n=e.y-this.y0,r=t/this.R,i=2*(Math.atan(Math.exp(n/this.R))-Math.PI/4),a=Math.asin(Math.cos(this.b0)*Math.sin(i)+Math.sin(this.b0)*Math.cos(i)*Math.cos(r)),o=Math.atan(Math.sin(r)/(Math.cos(this.b0)*Math.cos(r)-Math.sin(this.b0)*Math.tan(i))),s=this.lambda0+o/this.alpha,c=0,l=a,u=-1e3,d=0;Math.abs(l-u)>1e-7;){if(++d>20)return;c=1/this.alpha*(Math.log(Math.tan(Math.PI/4+a/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(l))/2)),u=l,l=2*Math.atan(Math.exp(c))-Math.PI/2}return e.x=s,e.y=l,e}var ir={init:tr,forward:nr,inverse:rr,names:[`somerc`]},U=1e-7;function ar(e){var t=[`Hotine_Oblique_Mercator`,`Hotine_Oblique_Mercator_variant_A`,`Hotine_Oblique_Mercator_Azimuth_Natural_Origin`],n=typeof e.projName==`object`?Object.keys(e.projName)[0]:e.projName;return`no_uoff`in e||`no_off`in e||t.indexOf(n)!==-1||t.indexOf(We(n))!==-1}function or(){var e,t,n,r,i,o,s,c,l,u,d=0,m,h=0,g=0,_=0,v=0,y=0,b=0;this.no_off=ar(this),this.no_rot=`no_rot`in this;var x=!1;`alpha`in this&&(x=!0);var S=!1;if(`rectified_grid_angle`in this&&(S=!0),x&&(b=this.alpha),S&&(d=this.rectified_grid_angle),x||S)h=this.longc;else if(g=this.long1,v=this.lat1,_=this.long2,y=this.lat2,Math.abs(v-y)<=U||(e=Math.abs(v))<=U||Math.abs(e-a)<=U||Math.abs(Math.abs(this.lat0)-a)<=U||Math.abs(Math.abs(y)-a)<=U)throw Error();var C=1-this.es;t=Math.sqrt(C),Math.abs(this.lat0)>1e-10?(c=Math.sin(this.lat0),n=Math.cos(this.lat0),e=1-this.es*c*c,this.B=n*n,this.B=Math.sqrt(1+this.es*this.B*this.B/C),this.A=this.B*this.k0*t/e,r=this.B*t/(n*Math.sqrt(e)),i=r*r-1,i<=0?i=0:(i=Math.sqrt(i),this.lat0<0&&(i=-i)),this.E=i+=r,this.E*=P(this.e,this.lat0,c)**+this.B):(this.B=1/t,this.A=this.k0,this.E=r=i=1),x||S?(x?(m=Math.asin(Math.sin(b)/r),S||(d=b)):(m=d,b=Math.asin(r*Math.sin(m))),this.lam0=h-Math.asin(.5*(i-1/i)*Math.tan(m))/this.B):(o=P(this.e,v,Math.sin(v))**+this.B,s=P(this.e,y,Math.sin(y))**+this.B,i=this.E/o,l=(s-o)/(s+o),u=this.E*this.E,u=(u-s*o)/(u+s*o),e=g-_,e<-Math.PI?_-=p:e>Math.PI&&(_+=p),this.lam0=N(.5*(g+_)-Math.atan(u*Math.tan(.5*this.B*(g-_))/l)/this.B,this.over),m=Math.atan(2*Math.sin(this.B*N(g-this.lam0,this.over))/(i-1/i)),d=b=Math.asin(r*Math.sin(m))),this.singam=Math.sin(m),this.cosgam=Math.cos(m),this.sinrot=Math.sin(d),this.cosrot=Math.cos(d),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(r*r-1)/Math.cos(b))),this.lat0<0&&(this.u_0=-this.u_0)),i=.5*m,this.v_pole_n=this.ArB*Math.log(Math.tan(f-i)),this.v_pole_s=this.ArB*Math.log(Math.tan(f+i))}function sr(e){var t={},n,r,i,o,s,c,l,u;if(e.x-=this.lam0,Math.abs(Math.abs(e.y)-a)>1e-10){if(s=this.E/P(this.e,e.y,Math.sin(e.y))**+this.B,c=1/s,n=.5*(s-c),r=.5*(s+c),o=Math.sin(this.B*e.x),i=(n*this.singam-o*this.cosgam)/r,Math.abs(Math.abs(i)-1)<1e-10)throw Error();u=.5*this.ArB*Math.log((1-i)/(1+i)),c=Math.cos(this.B*e.x),l=Math.abs(c)<U?this.A*e.x:this.ArB*Math.atan2(n*this.cosgam+o*this.singam,c)}else u=e.y>0?this.v_pole_n:this.v_pole_s,l=this.ArB*e.y;return this.no_rot?(t.x=l,t.y=u):(l-=this.u_0,t.x=u*this.cosrot+l*this.sinrot,t.y=l*this.cosrot-u*this.sinrot),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function cr(e){var t,n,r,i,o,s,c,l={};if(e.x=(e.x-this.x0)*(1/this.a),e.y=(e.y-this.y0)*(1/this.a),this.no_rot?(n=e.y,t=e.x):(n=e.x*this.cosrot-e.y*this.sinrot,t=e.y*this.cosrot+e.x*this.sinrot+this.u_0),r=Math.exp(-this.BrA*n),i=.5*(r-1/r),o=.5*(r+1/r),s=Math.sin(this.BrA*t),c=(s*this.cosgam+i*this.singam)/o,Math.abs(Math.abs(c)-1)<1e-10)l.x=0,l.y=c<0?-a:a;else{if(l.y=this.E/Math.sqrt((1+c)/(1-c)),l.y=Ne(this.e,l.y**(1/this.B)),l.y===1/0)throw Error();l.x=-this.rB*Math.atan2(i*this.cosgam-s*this.singam,Math.cos(this.BrA*t))}return l.x+=this.lam0,l}var lr={init:or,forward:sr,inverse:cr,names:[`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`]};function ur(){if(this.lat2||=this.lat1,this.k0||=1,this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<1e-10)){var e=this.b/this.a;this.e=Math.sqrt(1-e*e);var t=Math.sin(this.lat1),n=Math.cos(this.lat1),r=M(this.e,t,n),i=P(this.e,this.lat1,t),o=Math.sin(this.lat2),s=Math.cos(this.lat2),c=M(this.e,o,s),l=P(this.e,this.lat2,o),u=Math.abs(Math.abs(this.lat0)-a)<1e-10?0:P(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>1e-10?this.ns=Math.log(r/c)/Math.log(i/l):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=r/(this.ns*i**+this.ns),this.rh=this.a*this.f0*u**+this.ns,this.title||=`Lambert Conformal Conic`}}function dr(e){var t=e.x,n=e.y;Math.abs(2*Math.abs(n)-Math.PI)<=1e-10&&(n=Me(n)*(a-2*l));var r=Math.abs(Math.abs(n)-a),i,o;if(r>1e-10)i=P(this.e,n,Math.sin(n)),o=this.a*this.f0*i**+this.ns;else{if(r=n*this.ns,r<=0)return null;o=0}var s=this.ns*N(t-this.long0,this.over);return e.x=this.k0*(o*Math.sin(s))+this.x0,e.y=this.k0*(this.rh-o*Math.cos(s))+this.y0,e}function fr(e){var t,n,r,i,o,s=(e.x-this.x0)/this.k0,c=this.rh-(e.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(s*s+c*c),n=1):(t=-Math.sqrt(s*s+c*c),n=-1);var l=0;if(t!==0&&(l=Math.atan2(n*s,n*c)),t!==0||this.ns>0){if(n=1/this.ns,r=(t/(this.a*this.f0))**+n,i=Ne(this.e,r),i===-9999)return null}else i=-a;return o=N(l/this.ns+this.long0,this.over),e.x=o,e.y=i,e}var pr={init:ur,forward:dr,inverse:fr,names:[`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)`]};function mr(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||=.863937979737193,this.long0||=.4334234309119251,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.cos(this.fi0)**4/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=((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.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.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 hr(e){var t,n,r,i,a,o,s,c=e.x,l=e.y,u=N(c-this.long0,this.over);return t=((1+this.e*Math.sin(l))/(1-this.e*Math.sin(l)))**(this.alfa*this.e/2),n=2*(Math.atan(this.k*Math.tan(l/2+this.s45)**+this.alfa/t)-this.s45),r=-u*this.alfa,i=Math.asin(Math.cos(this.ad)*Math.sin(n)+Math.sin(this.ad)*Math.cos(n)*Math.cos(r)),a=Math.asin(Math.cos(n)*Math.sin(r)/Math.cos(i)),o=this.n*a,s=this.ro0*Math.tan(this.s0/2+this.s45)**+this.n/Math.tan(i/2+this.s45)**+this.n,e.y=s*Math.cos(o)/1,e.x=s*Math.sin(o)/1,this.czech||(e.y*=-1,e.x*=-1),e}function gr(e){var t,n,r,i,a,o,s,c,l=e.x;e.x=e.y,e.y=l,this.czech||(e.y*=-1,e.x*=-1),o=Math.sqrt(e.x*e.x+e.y*e.y),a=Math.atan2(e.y,e.x),i=a/Math.sin(this.s0),r=2*(Math.atan((this.ro0/o)**(1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),t=Math.asin(Math.cos(this.ad)*Math.sin(r)-Math.sin(this.ad)*Math.cos(r)*Math.cos(i)),n=Math.asin(Math.cos(r)*Math.sin(i)/Math.cos(t)),e.x=this.long0-n/this.alfa,s=t,c=0;var u=0;do e.y=2*(Math.atan(this.k**(-1/this.alfa)*Math.tan(t/2+this.s45)**(1/this.alfa)*((1+this.e*Math.sin(s))/(1-this.e*Math.sin(s)))**(this.e/2))-this.s45),Math.abs(s-e.y)<1e-10&&(c=1),s=e.y,u+=1;while(c===0&&u<15);return u>=15?null:e}var _r={init:mr,forward:hr,inverse:gr,names:[`Krovak`,`krovak`]};function W(e,t,n,r,i){return e*i-t*Math.sin(2*i)+n*Math.sin(4*i)-r*Math.sin(6*i)}function vr(e){return 1-.25*e*(1+e/16*(3+1.25*e))}function yr(e){return .375*e*(1+.25*e*(1+.46875*e))}function br(e){return .05859375*e*e*(1+.75*e)}function xr(e){return e*e*e*(35/3072)}function Sr(e,t,n){var r=t*n;return e/Math.sqrt(1-r*r)}function G(e){return Math.abs(e)<a?e:e-Me(e)*Math.PI}function Cr(e,t,n,r,i){for(var a=e/t,o,s=0;s<15;s++)if(o=(e-(t*a-n*Math.sin(2*a)+r*Math.sin(4*a)-i*Math.sin(6*a)))/(t-2*n*Math.cos(2*a)+4*r*Math.cos(4*a)-6*i*Math.cos(6*a)),a+=o,Math.abs(o)<=1e-10)return a;return NaN}function wr(){this.sphere||(this.e0=vr(this.es),this.e1=yr(this.es),this.e2=br(this.es),this.e3=xr(this.es),this.ml0=this.a*W(this.e0,this.e1,this.e2,this.e3,this.lat0))}function Tr(e){var t,n,r=e.x,i=e.y;if(r=N(r-this.long0,this.over),this.sphere)t=this.a*Math.asin(Math.cos(i)*Math.sin(r)),n=this.a*(Math.atan2(Math.tan(i),Math.cos(r))-this.lat0);else{var a=Math.sin(i),o=Math.cos(i),s=Sr(this.a,this.e,a),c=Math.tan(i)*Math.tan(i),l=r*Math.cos(i),u=l*l,d=this.es*o*o/(1-this.es),f=this.a*W(this.e0,this.e1,this.e2,this.e3,i);t=s*l*(1-u*c*(1/6-(8-c+8*d)*u/120)),n=f-this.ml0+s*a/o*u*(.5+(5-c+6*d)*u/24)}return e.x=t+this.x0,e.y=n+this.y0,e}function Er(e){e.x-=this.x0,e.y-=this.y0;var t=e.x/this.a,n=e.y/this.a,r,i;if(this.sphere){var o=n+this.lat0;r=Math.asin(Math.sin(o)*Math.cos(t)),i=Math.atan2(Math.tan(t),Math.cos(o))}else{var s=Cr(this.ml0/this.a+n,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(s)-a)<=1e-10)return e.x=this.long0,e.y=a,n<0&&(e.y*=-1),e;var c=Sr(this.a,this.e,Math.sin(s)),l=c*c*c/this.a/this.a*(1-this.es),u=Math.tan(s)**2,d=t*this.a/c,f=d*d;r=s-c*Math.tan(s)/l*d*d*(.5-(1+3*u)*d*d/24),i=d*(1-f*(u/3+(1+3*u)*u*f/15))/Math.cos(s)}return e.x=N(i+this.long0,this.over),e.y=G(r),e}var Dr={init:wr,forward:Tr,inverse:Er,names:[`Cassini`,`Cassini_Soldner`,`cass`]};function K(e,t){var n;return e>1e-7?(n=e*t,(1-e*e)*(t/(1-n*n)-.5/e*Math.log((1-n)/(1+n)))):2*t}function Or(){var e=Math.abs(this.lat0);if(Math.abs(e-a)<1e-10?this.mode=this.lat0<0?1:2:Math.abs(e)<1e-10?this.mode=3:this.mode=4,this.es>0){var t;switch(this.qp=K(this.e,1),this.mmf=.5/(1-this.es),this.apa=Lr(this.es),this.mode){case 2:this.dd=1;break;case 1:this.dd=1;break;case 3:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case 4:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=K(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===4&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function kr(e){var t,n,r,i,o,s,c,l,u,d,p=e.x,m=e.y;if(p=N(p-this.long0,this.over),this.sphere){if(o=Math.sin(m),d=Math.cos(m),r=Math.cos(p),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(n=this.mode===this.EQUIT?1+d*r:1+this.sinph0*o+this.cosph0*d*r,n<=1e-10)return null;n=Math.sqrt(2/n),t=n*d*Math.sin(p),n*=this.mode===this.EQUIT?o:this.cosph0*o-this.sinph0*d*r}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),Math.abs(m+this.lat0)<1e-10)return null;n=f-m*.5,n=2*(this.mode===this.S_POLE?Math.cos(n):Math.sin(n)),t=n*Math.sin(p),n*=r}}else{switch(c=0,l=0,u=0,r=Math.cos(p),i=Math.sin(p),o=Math.sin(m),s=K(this.e,o),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(c=s/this.qp,l=Math.sqrt(1-c*c)),this.mode){case this.OBLIQ:u=1+this.sinb1*c+this.cosb1*l*r;break;case this.EQUIT:u=1+l*r;break;case this.N_POLE:u=a+m,s=this.qp-s;break;case this.S_POLE:u=m-a,s=this.qp+s;break}if(Math.abs(u)<1e-10)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:u=Math.sqrt(2/u),n=this.mode===this.OBLIQ?this.ymf*u*(this.cosb1*c-this.sinb1*l*r):(u=Math.sqrt(2/(1+l*r)))*c*this.ymf,t=this.xmf*u*l*i;break;case this.N_POLE:case this.S_POLE:s>=0?(t=(u=Math.sqrt(s))*i,n=r*(this.mode===this.S_POLE?u:-u)):t=n=0;break}}return e.x=this.a*t+this.x0,e.y=this.a*n+this.y0,e}function Ar(e){e.x-=this.x0,e.y-=this.y0;var t=e.x/this.a,n=e.y/this.a,r,i,o,s,c,l,u;if(this.sphere){var d=0,f,p=0;if(f=Math.sqrt(t*t+n*n),i=f*.5,i>1)return null;switch(i=2*Math.asin(i),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(p=Math.sin(i),d=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(f)<=1e-10?0:Math.asin(n*p/f),t*=p,n=d*f;break;case this.OBLIQ:i=Math.abs(f)<=1e-10?this.lat0:Math.asin(d*this.sinph0+n*p*this.cosph0/f),t*=p*this.cosph0,n=(d-Math.sin(i)*this.sinph0)*f;break;case this.N_POLE:n=-n,i=a-i;break;case this.S_POLE:i-=a;break}r=n===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(t,n)}else{if(u=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(t/=this.dd,n*=this.dd,l=Math.sqrt(t*t+n*n),l<1e-10)return e.x=this.long0,e.y=this.lat0,e;s=2*Math.asin(.5*l/this.rq),o=Math.cos(s),t*=s=Math.sin(s),this.mode===this.OBLIQ?(u=o*this.sinb1+n*s*this.cosb1/l,c=this.qp*u,n=l*this.cosb1*o-n*this.sinb1*s):(u=n*s/l,c=this.qp*u,n=l*o)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(n=-n),c=t*t+n*n,!c)return e.x=this.long0,e.y=this.lat0,e;u=1-c/this.qp,this.mode===this.S_POLE&&(u=-u)}r=Math.atan2(t,n),i=Rr(Math.asin(u),this.apa)}return e.x=N(this.long0+r,this.over),e.y=i,e}var jr=.3333333333333333,Mr=.17222222222222222,Nr=.10257936507936508,Pr=.06388888888888888,Fr=.0664021164021164,Ir=.016415012942191543;function Lr(e){var t,n=[];return n[0]=e*jr,t=e*e,n[0]+=t*Mr,n[1]=t*Pr,t*=e,n[0]+=t*Nr,n[1]+=t*Fr,n[2]=t*Ir,n}function Rr(e,t){var n=e+e;return e+t[0]*Math.sin(n)+t[1]*Math.sin(n+n)+t[2]*Math.sin(n+n+n)}var zr={init:Or,forward:kr,inverse:Ar,names:[`Lambert Azimuthal Equal Area`,`Lambert_Azimuthal_Equal_Area`,`laea`],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4};function q(e){return Math.abs(e)>1&&(e=e>1?1:-1),Math.asin(e)}function Br(){Math.abs(this.lat1+this.lat2)<1e-10||(this.temp=this.b/this.a,this.es=1-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=M(this.e3,this.sin_po,this.cos_po),this.qs1=K(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=M(this.e3,this.sin_po,this.cos_po),this.qs2=K(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=K(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>1e-10?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 Vr(e){var t=e.x,n=e.y;this.sin_phi=Math.sin(n),this.cos_phi=Math.cos(n);var r=K(this.e3,this.sin_phi),i=this.a*Math.sqrt(this.c-this.ns0*r)/this.ns0,a=this.ns0*N(t-this.long0,this.over),o=i*Math.sin(a)+this.x0,s=this.rh-i*Math.cos(a)+this.y0;return e.x=o,e.y=s,e}function Hr(e){var t,n,r,i,a,o;return e.x-=this.x0,e.y=this.rh-e.y+this.y0,this.ns0>=0?(t=Math.sqrt(e.x*e.x+e.y*e.y),r=1):(t=-Math.sqrt(e.x*e.x+e.y*e.y),r=-1),i=0,t!==0&&(i=Math.atan2(r*e.x,r*e.y)),r=t*this.ns0/this.a,this.sphere?o=Math.asin((this.c-r*r)/(2*this.ns0)):(n=(this.c-r*r)/this.ns0,o=this.phi1z(this.e3,n)),a=N(i/this.ns0+this.long0,this.over),e.x=a,e.y=o,e}function Ur(e,t){var n,r,i,a,o,s=q(.5*t);if(e<1e-10)return s;for(var c=e*e,l=1;l<=25;l++)if(n=Math.sin(s),r=Math.cos(s),i=e*n,a=1-i*i,o=.5*a*a/r*(t/(1-c)-n/a+.5/e*Math.log((1-i)/(1+i))),s+=o,Math.abs(o)<=1e-7)return s;return null}var Wr={init:Br,forward:Vr,inverse:Hr,names:[`Albers_Conic_Equal_Area`,`Albers_Equal_Area`,`Albers`,`aea`],phi1z:Ur};function Gr(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function Kr(e){var t,n,r,i,a,o,s,c,l=e.x,u=e.y;return r=N(l-this.long0,this.over),t=Math.sin(u),n=Math.cos(u),i=Math.cos(r),o=this.sin_p14*t+this.cos_p14*n*i,a=1,o>0||Math.abs(o)<=1e-10?(s=this.x0+this.a*a*n*Math.sin(r)/o,c=this.y0+this.a*a*(this.cos_p14*t-this.sin_p14*n*i)/o):(s=this.x0+this.infinity_dist*n*Math.sin(r),c=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*n*i)),e.x=s,e.y=c,e}function qr(e){var t,n,r,i,a,o;return e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,(t=Math.sqrt(e.x*e.x+e.y*e.y))?(i=Math.atan2(t,this.rc),n=Math.sin(i),r=Math.cos(i),o=q(r*this.sin_p14+e.y*n*this.cos_p14/t),a=Math.atan2(e.x*n,t*this.cos_p14*r-e.y*this.sin_p14*n),a=N(this.long0+a,this.over)):(o=this.phic0,a=0),e.x=a,e.y=o,e}var Jr={init:Gr,forward:Kr,inverse:qr,names:[`gnom`]};function Yr(e,t){var n=1-(1-e*e)/(2*e)*Math.log((1-e)/(1+e));if(Math.abs(Math.abs(t)-n)<1e-6)return t<0?-1*a:a;for(var r=Math.asin(.5*t),i,o,s,c,l=0;l<30;l++)if(o=Math.sin(r),s=Math.cos(r),c=e*o,i=(1-c*c)**2/(2*s)*(t/(1-e*e)-o/(1-c*c)+.5/e*Math.log((1-c)/(1+c))),r+=i,Math.abs(i)<=1e-10)return r;return NaN}function Xr(){this.sphere||(this.k0=M(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function Zr(e){var t=e.x,n=e.y,r,i,a=N(t-this.long0,this.over);if(this.sphere)r=this.x0+this.a*a*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(n)/Math.cos(this.lat_ts);else{var o=K(this.e,Math.sin(n));r=this.x0+this.a*this.k0*a,i=this.y0+this.a*o*.5/this.k0}return e.x=r,e.y=i,e}function Qr(e){e.x-=this.x0,e.y-=this.y0;var t,n;return this.sphere?(t=N(this.long0+e.x/this.a/Math.cos(this.lat_ts),this.over),n=Math.asin(e.y/this.a*Math.cos(this.lat_ts))):(n=Yr(this.e,2*e.y*this.k0/this.a),t=N(this.long0+e.x/(this.a*this.k0),this.over)),e.x=t,e.y=n,e}var $r={init:Xr,forward:Zr,inverse:Qr,names:[`cea`]};function ei(){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 ti(e){var t=e.x,n=e.y,r=N(t-this.long0,this.over),i=G(n-this.lat0);return e.x=this.x0+this.a*r*this.rc,e.y=this.y0+this.a*i,e}function ni(e){var t=e.x,n=e.y;return e.x=N(this.long0+(t-this.x0)/(this.a*this.rc),this.over),e.y=G(this.lat0+(n-this.y0)/this.a),e}var ri={init:ei,forward:ti,inverse:ni,names:[`Equirectangular`,`Equidistant_Cylindrical`,`Equidistant_Cylindrical_Spherical`,`eqc`]},ii=20;function ai(){this.temp=this.b/this.a,this.es=1-this.temp**2,this.e=Math.sqrt(this.es),this.e0=vr(this.es),this.e1=yr(this.es),this.e2=br(this.es),this.e3=xr(this.es),this.ml0=this.a*W(this.e0,this.e1,this.e2,this.e3,this.lat0)}function oi(e){var t=e.x,n=e.y,r,i,a,o=N(t-this.long0,this.over);if(a=o*Math.sin(n),this.sphere)Math.abs(n)<=1e-10?(r=this.a*o,i=-1*this.a*this.lat0):(r=this.a*Math.sin(a)/Math.tan(n),i=this.a*(G(n-this.lat0)+(1-Math.cos(a))/Math.tan(n)));else if(Math.abs(n)<=1e-10)r=this.a*o,i=-1*this.ml0;else{var s=Sr(this.a,this.e,Math.sin(n))/Math.tan(n);r=s*Math.sin(a),i=this.a*W(this.e0,this.e1,this.e2,this.e3,n)-this.ml0+s*(1-Math.cos(a))}return e.x=r+this.x0,e.y=i+this.y0,e}function si(e){var t,n,r=e.x-this.x0,i=e.y-this.y0,a,o,s,c,l;if(this.sphere)if(Math.abs(i+this.a*this.lat0)<=1e-10)t=N(r/this.a+this.long0,this.over),n=0;else{o=this.lat0+i/this.a,s=r*r/this.a/this.a+o*o,c=o;var u;for(a=ii;a;--a)if(u=Math.tan(c),l=-1*(o*(c*u+1)-c-.5*(c*c+s)*u)/((c-o)/u-1),c+=l,Math.abs(l)<=1e-10){n=c;break}t=N(this.long0+Math.asin(r*Math.tan(c)/this.a)/Math.sin(n),this.over)}else if(Math.abs(i+this.ml0)<=1e-10)n=0,t=N(this.long0+r/this.a,this.over);else{o=(this.ml0+i)/this.a,s=r*r/this.a/this.a+o*o,c=o;var d,f,p,m,h;for(a=ii;a;--a)if(h=this.e*Math.sin(c),d=Math.sqrt(1-h*h)*Math.tan(c),f=this.a*W(this.e0,this.e1,this.e2,this.e3,c),p=this.e0-2*this.e1*Math.cos(2*c)+4*this.e2*Math.cos(4*c)-6*this.e3*Math.cos(6*c),m=f/this.a,l=(o*(d*m+1)-m-.5*d*(m*m+s))/(this.es*Math.sin(2*c)*(m*m+s-2*o*m)/(4*d)+(o-m)*(d*p-2/Math.sin(2*c))-p),c-=l,Math.abs(l)<=1e-10){n=c;break}d=Math.sqrt(1-this.es*Math.sin(n)**2)*Math.tan(n),t=N(this.long0+Math.asin(r*d/this.a)/Math.sin(n),this.over)}return e.x=t,e.y=n,e}var ci={init:ai,forward:oi,inverse:si,names:[`Polyconic`,`American_Polyconic`,`poly`]};function li(){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 ui(e){var t,n=e.x,r=e.y-this.lat0,a=n-this.long0,o=r/i*1e-5,s=a,c=1,l=0;for(t=1;t<=10;t++)c*=o,l+=this.A[t]*c;var u=l,d=s,f=1,p=0,m,h,g=0,_=0;for(t=1;t<=6;t++)m=f*u-p*d,h=p*u+f*d,f=m,p=h,g=g+this.B_re[t]*f-this.B_im[t]*p,_=_+this.B_im[t]*f+this.B_re[t]*p;return e.x=_*this.a+this.x0,e.y=g*this.a+this.y0,e}function di(e){var t,n=e.x,r=e.y,a=n-this.x0,o=(r-this.y0)/this.a,s=a/this.a,c=1,l=0,u,d,f=0,p=0;for(t=1;t<=6;t++)u=c*o-l*s,d=l*o+c*s,c=u,l=d,f=f+this.C_re[t]*c-this.C_im[t]*l,p=p+this.C_im[t]*c+this.C_re[t]*l;for(var m=0;m<this.iterations;m++){var h=f,g=p,_,v,y=o,b=s;for(t=2;t<=6;t++)_=h*f-g*p,v=g*f+h*p,h=_,g=v,y+=(t-1)*(this.B_re[t]*h-this.B_im[t]*g),b+=(t-1)*(this.B_im[t]*h+this.B_re[t]*g);h=1,g=0;var x=this.B_re[1],S=this.B_im[1];for(t=2;t<=6;t++)_=h*f-g*p,v=g*f+h*p,h=_,g=v,x+=t*(this.B_re[t]*h-this.B_im[t]*g),S+=t*(this.B_im[t]*h+this.B_re[t]*g);var C=x*x+S*S;f=(y*x+b*S)/C,p=(b*x-y*S)/C}var w=f,T=p,E=1,D=0;for(t=1;t<=9;t++)E*=w,D+=this.D[t]*E;var ee=this.lat0+D*i*1e5;return e.x=this.long0+T,e.y=ee,e}var fi={init:li,forward:ui,inverse:di,names:[`New_Zealand_Map_Grid`,`nzmg`]};function pi(){}function mi(e){var t=e.x,n=e.y,r=N(t-this.long0,this.over),i=this.x0+this.a*r,a=this.y0+this.a*Math.log(Math.tan(Math.PI/4+n/2.5))*1.25;return e.x=i,e.y=a,e}function hi(e){e.x-=this.x0,e.y-=this.y0;var t=N(this.long0+e.x/this.a,this.over),n=2.5*(Math.atan(Math.exp(.8*e.y/this.a))-Math.PI/4);return e.x=t,e.y=n,e}var gi={init:pi,forward:mi,inverse:hi,names:[`Miller_Cylindrical`,`mill`]},_i=20;function vi(){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=_n(this.es)}function yi(e){var t,n,r=e.x,i=e.y;if(r=N(r-this.long0,this.over),this.sphere){if(!this.m)i=this.n===1?i:Math.asin(this.n*Math.sin(i));else for(var a=this.n*Math.sin(i),o=_i;o;--o){var s=(this.m*i+Math.sin(i)-a)/(this.m+Math.cos(i));if(i-=s,Math.abs(s)<1e-10)break}t=this.a*this.C_x*r*(this.m+Math.cos(i)),n=this.a*this.C_y*i}else{var c=Math.sin(i),l=Math.cos(i);n=this.a*vn(i,c,l,this.en),t=this.a*r*l/Math.sqrt(1-this.es*c*c)}return e.x=t,e.y=n,e}function bi(e){var t,n,r,i;return e.x-=this.x0,r=e.x/this.a,e.y-=this.y0,t=e.y/this.a,this.sphere?(t/=this.C_y,r/=this.C_x*(this.m+Math.cos(t)),this.m?t=q((this.m*t+Math.sin(t))/this.n):this.n!==1&&(t=q(Math.sin(t)/this.n)),r=N(r+this.long0,this.over),t=G(t)):(t=bn(e.y/this.a,this.es,this.en),i=Math.abs(t),i<a?(i=Math.sin(t),n=this.long0+e.x*Math.sqrt(1-this.es*i*i)/(this.a*Math.cos(t)),r=N(n,this.over)):i-1e-10<a&&(r=this.long0)),e.x=r,e.y=t,e}var xi={init:vi,forward:yi,inverse:bi,names:[`Sinusoidal`,`sinu`]};function Si(){this.x0=this.x0===void 0?0:this.x0,this.y0=this.y0===void 0?0:this.y0,this.long0=this.long0===void 0?0:this.long0}function Ci(e){for(var t=e.x,n=e.y,r=N(t-this.long0,this.over),i=n,a=Math.PI*Math.sin(n);;){var o=-(i+Math.sin(i)-a)/(1+Math.cos(i));if(i+=o,Math.abs(o)<1e-10)break}i/=2,Math.PI/2-Math.abs(n)<1e-10&&(r=0);var s=.900316316158*this.a*r*Math.cos(i)+this.x0,c=1.4142135623731*this.a*Math.sin(i)+this.y0;return e.x=s,e.y=c,e}function wi(e){var t,n;e.x-=this.x0,e.y-=this.y0,n=e.y/(1.4142135623731*this.a),Math.abs(n)>.999999999999&&(n=.999999999999),t=Math.asin(n);var r=N(this.long0+e.x/(.900316316158*this.a*Math.cos(t)),this.over);r<-Math.PI&&(r=-Math.PI),r>Math.PI&&(r=Math.PI),n=(2*t+Math.sin(2*t))/Math.PI,Math.abs(n)>1&&(n=1);var i=Math.asin(n);return e.x=r,e.y=i,e}var Ti={init:Si,forward:Ci,inverse:wi,names:[`Mollweide`,`moll`]};function Ei(){Math.abs(this.lat1+this.lat2)<1e-10||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-this.temp**2,this.e=Math.sqrt(this.es),this.e0=vr(this.es),this.e1=yr(this.es),this.e2=br(this.es),this.e3=xr(this.es),this.sin_phi=Math.sin(this.lat1),this.cos_phi=Math.cos(this.lat1),this.ms1=M(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)<1e-10?this.ns=this.sin_phi:(this.sin_phi=Math.sin(this.lat2),this.cos_phi=Math.cos(this.lat2),this.ms2=M(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 Di(e){var t=e.x,n=e.y,r;if(this.sphere)r=this.a*(this.g-n);else{var i=W(this.e0,this.e1,this.e2,this.e3,n);r=this.a*(this.g-i)}var a=this.ns*N(t-this.long0,this.over),o=this.x0+r*Math.sin(a),s=this.y0+this.rh-r*Math.cos(a);return e.x=o,e.y=s,e}function Oi(e){e.x-=this.x0,e.y=this.rh-e.y+this.y0;var t,n,r,i;this.ns>=0?(n=Math.sqrt(e.x*e.x+e.y*e.y),t=1):(n=-Math.sqrt(e.x*e.x+e.y*e.y),t=-1);var a=0;return n!==0&&(a=Math.atan2(t*e.x,t*e.y)),this.sphere?(i=N(this.long0+a/this.ns,this.over),r=G(this.g-n/this.a),e.x=i,e.y=r,e):(r=Cr(this.g-n/this.a,this.e0,this.e1,this.e2,this.e3),i=N(this.long0+a/this.ns,this.over),e.x=i,e.y=r,e)}var ki={init:Ei,forward:Di,inverse:Oi,names:[`Equidistant_Conic`,`eqdc`]};function Ai(){this.R=this.a}function ji(e){var t=e.x,n=e.y,r=N(t-this.long0,this.over),i,o;Math.abs(n)<=1e-10&&(i=this.x0+this.R*r,o=this.y0);var s=q(2*Math.abs(n/Math.PI));(Math.abs(r)<=1e-10||Math.abs(Math.abs(n)-a)<=1e-10)&&(i=this.x0,o=n>=0?this.y0+Math.PI*this.R*Math.tan(.5*s):this.y0+Math.PI*this.R*-Math.tan(.5*s));var c=.5*Math.abs(Math.PI/r-r/Math.PI),l=c*c,u=Math.sin(s),d=Math.cos(s),f=d/(u+d-1),p=f*f,m=f*(2/u-1),h=m*m,g=Math.PI*this.R*(c*(f-h)+Math.sqrt(l*(f-h)*(f-h)-(h+l)*(p-h)))/(h+l);r<0&&(g=-g),i=this.x0+g;var _=l+f;return g=Math.PI*this.R*(m*_-c*Math.sqrt((h+l)*(l+1)-_*_))/(h+l),o=n>=0?this.y0+g:this.y0-g,e.x=i,e.y=o,e}function Mi(e){var t,n,r,i,a,o,s,c,l,u,d,f,p;return e.x-=this.x0,e.y-=this.y0,d=Math.PI*this.R,r=e.x/d,i=e.y/d,a=r*r+i*i,o=-Math.abs(i)*(1+a),s=o-2*i*i+r*r,c=-2*o+1+2*i*i+a*a,p=i*i/c+(2*s*s*s/c/c/c-9*o*s/c/c)/27,l=(o-s*s/3/c)/c,u=2*Math.sqrt(-l/3),d=3*p/l/u,Math.abs(d)>1&&(d=d>=0?1:-1),f=Math.acos(d)/3,n=e.y>=0?(-u*Math.cos(f+Math.PI/3)-s/3/c)*Math.PI:-(-u*Math.cos(f+Math.PI/3)-s/3/c)*Math.PI,t=Math.abs(r)<1e-10?this.long0:N(this.long0+Math.PI*(a-1+Math.sqrt(1+2*(r*r-i*i)+a*a))/2/r,this.over),e.x=t,e.y=n,e}var Ni={init:Ai,forward:ji,inverse:Mi,names:[`Van_der_Grinten_I`,`VanDerGrinten`,`Van_der_Grinten`,`vandg`]};function Pi(e,t,n,r,i,a){let o=r-t,s=Math.atan((1-a)*Math.tan(e)),c=Math.atan((1-a)*Math.tan(n)),l=Math.sin(s),u=Math.cos(s),d=Math.sin(c),f=Math.cos(c),p=o,m,h=100,g,_,v,y,b,x,S,C,w,T,E,D,ee,te;do{if(g=Math.sin(p),_=Math.cos(p),v=Math.sqrt(f*g*(f*g)+(u*d-l*f*_)*(u*d-l*f*_)),v===0)return{azi1:0,s12:0};y=l*d+u*f*_,b=Math.atan2(v,y),x=u*f*g/v,S=1-x*x,C=S===0?0:y-2*l*d/S,w=a/16*S*(4+a*(4-3*S)),m=p,p=o+(1-w)*a*x*(b+w*v*(C+w*y*(-1+2*C*C)))}while(Math.abs(p-m)>1e-12&&--h>0);return h===0?{azi1:NaN,s12:NaN}:(T=S*(i*i-i*(1-a)*(i*(1-a)))/(i*(1-a)*(i*(1-a))),E=1+T/16384*(4096+T*(-768+T*(320-175*T))),D=T/1024*(256+T*(-128+T*(74-47*T))),ee=D*v*(C+D/4*(y*(-1+2*C*C)-D/6*C*(-3+4*v*v)*(-3+4*C*C))),te=i*(1-a)*E*(b-ee),{azi1:Math.atan2(f*g,u*d-l*f*_),s12:te})}function Fi(e,t,n,r,i,a){let o=Math.atan((1-a)*Math.tan(e)),s=Math.sin(o),c=Math.cos(o),l=Math.sin(n),u=Math.cos(n),d=Math.atan2(s,c*u),f=c*l,p=1-f*f,m=p*(i*i-i*(1-a)*(i*(1-a)))/(i*(1-a)*(i*(1-a))),h=1+m/16384*(4096+m*(-768+m*(320-175*m))),g=m/1024*(256+m*(-128+m*(74-47*m))),_=r/(i*(1-a)*h),v,y=100,b,x,S,C;do b=Math.cos(2*d+_),x=Math.sin(_),S=Math.cos(_),C=g*x*(b+g/4*(S*(-1+2*b*b)-g/6*b*(-3+4*x*x)*(-3+4*b*b))),v=_,_=r/(i*(1-a)*h)+C;while(Math.abs(_-v)>1e-12&&--y>0);if(y===0)return{lat2:NaN,lon2:NaN};let w=s*x-c*S*u,T=Math.atan2(s*S+c*x*u,(1-a)*Math.sqrt(f*f+w*w)),E=Math.atan2(x*l,c*S-s*x*u),D=a/16*p*(4+a*(4-3*p));return{lat2:T,lon2:t+(E-(1-D)*a*f*(_+D*x*(b+D*S*(-1+2*b*b))))}}function Ii(){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 Li(e){var t=e.x,n=e.y,r=Math.sin(e.y),i=Math.cos(e.y),o=N(t-this.long0,this.over),s,c,l,u,d,f,p,m,h,g,_;return this.sphere?Math.abs(this.sin_p12-1)<=1e-10?(e.x=this.x0+this.a*(a-n)*Math.sin(o),e.y=this.y0-this.a*(a-n)*Math.cos(o),e):Math.abs(this.sin_p12+1)<=1e-10?(e.x=this.x0+this.a*(a+n)*Math.sin(o),e.y=this.y0+this.a*(a+n)*Math.cos(o),e):(h=this.sin_p12*r+this.cos_p12*i*Math.cos(o),p=Math.acos(h),m=p?p/Math.sin(p):1,e.x=this.x0+this.a*m*i*Math.sin(o),e.y=this.y0+this.a*m*(this.cos_p12*r-this.sin_p12*i*Math.cos(o)),e):(s=vr(this.es),c=yr(this.es),l=br(this.es),u=xr(this.es),Math.abs(this.sin_p12-1)<=1e-10?(d=this.a*W(s,c,l,u,a),f=this.a*W(s,c,l,u,n),e.x=this.x0+(d-f)*Math.sin(o),e.y=this.y0-(d-f)*Math.cos(o),e):Math.abs(this.sin_p12+1)<=1e-10?(d=this.a*W(s,c,l,u,a),f=this.a*W(s,c,l,u,n),e.x=this.x0+(d+f)*Math.sin(o),e.y=this.y0+(d+f)*Math.cos(o),e):Math.abs(t)<1e-10&&Math.abs(n-this.lat0)<1e-10?(e.x=e.y=0,e):(g=Pi(this.lat0,this.long0,n,t,this.a,this.f),_=g.azi1,e.x=g.s12*Math.sin(_),e.y=g.s12*Math.cos(_),e))}function Ri(e){e.x-=this.x0,e.y-=this.y0;var t,n,r,i,o,s,c,l,u,d,f,p,m,h,g,_;return this.sphere?(t=Math.sqrt(e.x*e.x+e.y*e.y),t>2*a*this.a?void 0:(n=t/this.a,r=Math.sin(n),i=Math.cos(n),o=this.long0,Math.abs(t)<=1e-10?s=this.lat0:(s=q(i*this.sin_p12+e.y*r*this.cos_p12/t),c=Math.abs(this.lat0)-a,o=Math.abs(c)<=1e-10?this.lat0>=0?N(this.long0+Math.atan2(e.x,-e.y),this.over):N(this.long0-Math.atan2(-e.x,e.y),this.over):N(this.long0+Math.atan2(e.x*r,t*this.cos_p12*i-e.y*this.sin_p12*r),this.over)),e.x=o,e.y=s,e)):(l=vr(this.es),u=yr(this.es),d=br(this.es),f=xr(this.es),Math.abs(this.sin_p12-1)<=1e-10?(p=this.a*W(l,u,d,f,a),t=Math.sqrt(e.x*e.x+e.y*e.y),m=p-t,s=Cr(m/this.a,l,u,d,f),o=N(this.long0+Math.atan2(e.x,-1*e.y),this.over),e.x=o,e.y=s,e):Math.abs(this.sin_p12+1)<=1e-10?(p=this.a*W(l,u,d,f,a),t=Math.sqrt(e.x*e.x+e.y*e.y),m=t-p,s=Cr(m/this.a,l,u,d,f),o=N(this.long0+Math.atan2(e.x,e.y),this.over),e.x=o,e.y=s,e):(h=Math.atan2(e.x,e.y),g=Math.sqrt(e.x*e.x+e.y*e.y),_=Fi(this.lat0,this.long0,h,g,this.a,this.f),e.x=_.lon2,e.y=_.lat2,e))}var zi={init:Ii,forward:Li,inverse:Ri,names:[`Azimuthal_Equidistant`,`aeqd`]};function Bi(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function Vi(e){var t,n,r,i,a,o,s,c,l=e.x,u=e.y;return r=N(l-this.long0,this.over),t=Math.sin(u),n=Math.cos(u),i=Math.cos(r),o=this.sin_p14*t+this.cos_p14*n*i,a=1,(o>0||Math.abs(o)<=1e-10)&&(s=this.a*a*n*Math.sin(r),c=this.y0+this.a*a*(this.cos_p14*t-this.sin_p14*n*i)),e.x=s,e.y=c,e}function Hi(e){var t,n,r,i,o,s,c;return e.x-=this.x0,e.y-=this.y0,t=Math.sqrt(e.x*e.x+e.y*e.y),n=q(t/this.a),r=Math.sin(n),i=Math.cos(n),s=this.long0,Math.abs(t)<=1e-10?(c=this.lat0,e.x=s,e.y=c,e):(c=q(i*this.sin_p14+e.y*r*this.cos_p14/t),o=Math.abs(this.lat0)-a,Math.abs(o)<=1e-10?(s=this.lat0>=0?N(this.long0+Math.atan2(e.x,-e.y),this.over):N(this.long0-Math.atan2(-e.x,e.y),this.over),e.x=s,e.y=c,e):(s=N(this.long0+Math.atan2(e.x*r,t*this.cos_p14*i-e.y*this.sin_p14*r),this.over),e.x=s,e.y=c,e))}var Ui={init:Bi,forward:Vi,inverse:Hi,names:[`ortho`]},J={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},Y={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function Wi(){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>=a-f/2?this.face=J.TOP:this.lat0<=-(a-f/2)?this.face=J.BOTTOM:Math.abs(this.long0)<=f?this.face=J.FRONT:Math.abs(this.long0)<=a+f?this.face=this.long0>0?J.RIGHT:J.LEFT:this.face=J.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 Gi(e){var t={x:0,y:0},n,r,i,o,s,c,l={value:0};if(e.x-=this.long0,n=this.es===0?e.y:Math.atan(this.one_minus_f_squared*Math.tan(e.y)),r=e.x,this.face===J.TOP)o=a-n,r>=f&&r<=a+f?(l.value=Y.AREA_0,i=r-a):r>a+f||r<=-(a+f)?(l.value=Y.AREA_1,i=r>0?r-m:r+m):r>-(a+f)&&r<=-f?(l.value=Y.AREA_2,i=r+a):(l.value=Y.AREA_3,i=r);else if(this.face===J.BOTTOM)o=a+n,r>=f&&r<=a+f?(l.value=Y.AREA_0,i=-r+a):r<f&&r>=-f?(l.value=Y.AREA_1,i=-r):r<-f&&r>=-(a+f)?(l.value=Y.AREA_2,i=-r-a):(l.value=Y.AREA_3,i=r>0?-r+m:-r-m);else{var u,d,p,h,g,_,v;this.face===J.RIGHT?r=X(r,+a):this.face===J.BACK?r=X(r,+m):this.face===J.LEFT&&(r=X(r,-a)),h=Math.sin(n),g=Math.cos(n),_=Math.sin(r),v=Math.cos(r),u=g*v,d=g*_,p=h,this.face===J.FRONT?(o=Math.acos(u),i=qi(o,p,d,l)):this.face===J.RIGHT?(o=Math.acos(d),i=qi(o,p,-u,l)):this.face===J.BACK?(o=Math.acos(-u),i=qi(o,p,-d,l)):this.face===J.LEFT?(o=Math.acos(-d),i=qi(o,p,u,l)):(o=i=0,l.value=Y.AREA_0)}return c=Math.atan(12/m*(i+Math.acos(Math.sin(i)*Math.cos(f))-a)),s=Math.sqrt((1-Math.cos(o))/(Math.cos(c)*Math.cos(c))/(1-Math.cos(Math.atan(1/Math.cos(i))))),l.value===Y.AREA_1?c+=a:l.value===Y.AREA_2?c+=m:l.value===Y.AREA_3&&(c+=1.5*m),t.x=s*Math.cos(c),t.y=s*Math.sin(c),t.x=t.x*this.a+this.x0,t.y=t.y*this.a+this.y0,e.x=t.x,e.y=t.y,e}function Ki(e){var t={lam:0,phi:0},n,r,i,o,s,c,l,u,d,f={value:0};if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,r=Math.atan(Math.sqrt(e.x*e.x+e.y*e.y)),n=Math.atan2(e.y,e.x),e.x>=0&&e.x>=Math.abs(e.y)?f.value=Y.AREA_0:e.y>=0&&e.y>=Math.abs(e.x)?(f.value=Y.AREA_1,n-=a):e.x<0&&-e.x>=Math.abs(e.y)?(f.value=Y.AREA_2,n=n<0?n+m:n-m):(f.value=Y.AREA_3,n+=a),d=m/12*Math.tan(n),s=Math.sin(d)/(Math.cos(d)-1/Math.sqrt(2)),c=Math.atan(s),i=Math.cos(n),o=Math.tan(r),l=1-i*i*o*o*(1-Math.cos(Math.atan(1/Math.cos(c)))),l<-1?l=-1:l>1&&(l=1),this.face===J.TOP)u=Math.acos(l),t.phi=a-u,f.value===Y.AREA_0?t.lam=c+a:f.value===Y.AREA_1?t.lam=c<0?c+m:c-m:f.value===Y.AREA_2?t.lam=c-a:t.lam=c;else if(this.face===J.BOTTOM)u=Math.acos(l),t.phi=u-a,f.value===Y.AREA_0?t.lam=-c+a:f.value===Y.AREA_1?t.lam=-c:f.value===Y.AREA_2?t.lam=-c-a:t.lam=c<0?-c-m:-c+m;else{var p=l,h,g;d=p*p,g=d>=1?0:Math.sqrt(1-d)*Math.sin(c),d+=g*g,h=d>=1?0:Math.sqrt(1-d),f.value===Y.AREA_1?(d=h,h=-g,g=d):f.value===Y.AREA_2?(h=-h,g=-g):f.value===Y.AREA_3&&(d=h,h=g,g=-d),this.face===J.RIGHT?(d=p,p=-h,h=d):this.face===J.BACK?(p=-p,h=-h):this.face===J.LEFT&&(d=p,p=h,h=-d),t.phi=Math.acos(-g)-a,t.lam=Math.atan2(h,p),this.face===J.RIGHT?t.lam=X(t.lam,-a):this.face===J.BACK?t.lam=X(t.lam,-m):this.face===J.LEFT&&(t.lam=X(t.lam,+a))}if(this.es!==0){var _=+(t.phi<0),v=Math.tan(t.phi),y=this.b/Math.sqrt(v*v+this.one_minus_f_squared);t.phi=Math.atan(Math.sqrt(this.a*this.a-y*y)/(this.one_minus_f*y)),_&&(t.phi=-t.phi)}return t.lam+=this.long0,e.x=t.lam,e.y=t.phi,e}function qi(e,t,n,r){var i;return e<1e-10?(r.value=Y.AREA_0,i=0):(i=Math.atan2(t,n),Math.abs(i)<=f?r.value=Y.AREA_0:i>f&&i<=a+f?(r.value=Y.AREA_1,i-=a):i>a+f||i<=-(a+f)?(r.value=Y.AREA_2,i=i>=0?i-m:i+m):(r.value=Y.AREA_3,i+=a)),i}function X(e,t){var n=e+t;return n<-3.14159265359?n+=p:n>3.14159265359&&(n-=p),n}var Ji={init:Wi,forward:Gi,inverse:Ki,names:[`Quadrilateralized Spherical Cube`,`Quadrilateralized_Spherical_Cube`,`qsc`]},Yi=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.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,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.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]],Xi=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,422642e-15],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],Zi=.8487,Qi=1.3523,$i=d/5,ea=1/$i,Z=18,ta=function(e,t){return e[0]+t*(e[1]+t*(e[2]+t*e[3]))},na=function(e,t){return e[1]+t*(2*e[2]+t*3*e[3])};function ra(e,t,n,r){for(var i=t;r;--r){var a=e(i);if(i-=a,Math.abs(a)<n)break}return i}function ia(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||`Robinson`}function aa(e){var t=N(e.x-this.long0,this.over),n=Math.abs(e.y),r=Math.floor(n*$i);r<0?r=0:r>=Z&&(r=Z-1),n=d*(n-ea*r);var i={x:ta(Yi[r],n)*t,y:ta(Xi[r],n)};return e.y<0&&(i.y=-i.y),i.x=i.x*this.a*Zi+this.x0,i.y=i.y*this.a*Qi+this.y0,i}function oa(e){var t={x:(e.x-this.x0)/(this.a*Zi),y:Math.abs(e.y-this.y0)/(this.a*Qi)};if(t.y>=1)t.x/=Yi[Z][0],t.y=e.y<0?-a:a;else{var n=Math.floor(t.y*Z);for(n<0?n=0:n>=Z&&(n=Z-1);;)if(Xi[n][0]>t.y)--n;else if(Xi[n+1][0]<=t.y)++n;else break;var r=Xi[n],i=5*(t.y-r[0])/(Xi[n+1][0]-r[0]);i=ra(function(e){return(ta(r,e)-t.y)/na(r,e)},i,l,100),t.x/=ta(Yi[n],i),t.y=(5*n+i)*u,e.y<0&&(t.y=-t.y)}return t.x=N(t.x+this.long0,this.over),t}var sa={init:ia,forward:aa,inverse:oa,names:[`Robinson`,`robin`]};function ca(){this.name=`geocent`}function la(e){return _t(e,this.es,this.a)}function ua(e){return vt(e,this.es,this.a,this.b)}var da={init:ca,forward:la,inverse:ua,names:[`Geocentric`,`geocentric`,`geocent`,`Geocent`]},Q={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},fa={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 pa(){if(Object.keys(fa).forEach(function(e){if(this[e]===void 0)this[e]=fa[e].def;else if(fa[e].num&&isNaN(this[e]))throw Error(`Invalid parameter value, must be numeric `+e+` = `+this[e]);else fa[e].num&&(this[e]=parseFloat(this[e]));fa[e].degrees&&(this[e]=this[e]*u)}.bind(this)),Math.abs(Math.abs(this.lat0)-a)<1e-10?this.mode=this.lat0<0?Q.S_POLE:Q.N_POLE:Math.abs(this.lat0)<1e-10?this.mode=Q.EQUIT:(this.mode=Q.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 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 e=this.tilt,t=this.azi;this.cg=Math.cos(t),this.sg=Math.sin(t),this.cw=Math.cos(e),this.sw=Math.sin(e)}function ma(e){e.x-=this.long0;var t=Math.sin(e.y),n=Math.cos(e.y),r=Math.cos(e.x),i,a;switch(this.mode){case Q.OBLIQ:a=this.sinph0*t+this.cosph0*n*r;break;case Q.EQUIT:a=n*r;break;case Q.S_POLE:a=-t;break;case Q.N_POLE:a=t;break}switch(a=this.pn1/(this.p-a),i=a*n*Math.sin(e.x),this.mode){case Q.OBLIQ:a*=this.cosph0*t-this.sinph0*n*r;break;case Q.EQUIT:a*=t;break;case Q.N_POLE:a*=-(n*r);break;case Q.S_POLE:a*=n*r;break}var o=a*this.cg+i*this.sg,s=1/(o*this.sw*this.h1+this.cw);return i=(i*this.cg-a*this.sg)*this.cw*s,a=o*s,e.x=i*this.a,e.y=a*this.a,e}function ha(e){e.x/=this.a,e.y/=this.a;var t={x:e.x,y:e.y},n,r,i=1/(this.pn1-e.y*this.sw);n=this.pn1*e.x*i,r=this.pn1*e.y*this.cw*i,e.x=n*this.cg+r*this.sg,e.y=r*this.cg-n*this.sg;var a=H(e.x,e.y);if(Math.abs(a)<1e-10)t.x=0,t.y=e.y;else{var o,s=1-a*a*this.pfact;switch(s=(this.p-Math.sqrt(s))/(this.pn1/a+a/this.pn1),o=Math.sqrt(1-s*s),this.mode){case Q.OBLIQ:t.y=Math.asin(o*this.sinph0+e.y*s*this.cosph0/a),e.y=(o-this.sinph0*Math.sin(t.y))*a,e.x*=s*this.cosph0;break;case Q.EQUIT:t.y=Math.asin(e.y*s/a),e.y=o*a,e.x*=s;break;case Q.N_POLE:t.y=Math.asin(o),e.y=-e.y;break;case Q.S_POLE:t.y=-Math.asin(o);break}t.x=Math.atan2(e.x,e.y)}return e.x=t.x+this.long0,e.y=t.y,e}var ga={init:pa,forward:ma,inverse:ha,names:[`Tilted_Perspective`,`tpers`]};function _a(){if(this.flip_axis=+(this.sweep===`x`),this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw Error();if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var e=1-this.es,t=1/e;this.radius_p=Math.sqrt(e),this.radius_p2=e,this.radius_p_inv2=t,this.shape=`ellipse`}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape=`sphere`;this.title||=`Geostationary Satellite View`}function va(e){var t=e.x,n=e.y,r,i,a,o;if(t-=this.long0,this.shape===`ellipse`){n=Math.atan(this.radius_p2*Math.tan(n));var s=this.radius_p/H(this.radius_p*Math.cos(n),Math.sin(n));if(i=s*Math.cos(t)*Math.cos(n),a=s*Math.sin(t)*Math.cos(n),o=s*Math.sin(n),(this.radius_g-i)*i-a*a-o*o*this.radius_p_inv2<0)return e.x=NaN,e.y=NaN,e;r=this.radius_g-i,this.flip_axis?(e.x=this.radius_g_1*Math.atan(a/H(o,r)),e.y=this.radius_g_1*Math.atan(o/r)):(e.x=this.radius_g_1*Math.atan(a/r),e.y=this.radius_g_1*Math.atan(o/H(a,r)))}else this.shape===`sphere`&&(r=Math.cos(n),i=Math.cos(t)*r,a=Math.sin(t)*r,o=Math.sin(n),r=this.radius_g-i,this.flip_axis?(e.x=this.radius_g_1*Math.atan(a/H(o,r)),e.y=this.radius_g_1*Math.atan(o/r)):(e.x=this.radius_g_1*Math.atan(a/r),e.y=this.radius_g_1*Math.atan(o/H(a,r))));return e.x*=this.a,e.y*=this.a,e}function ya(e){var t=-1,n=0,r=0,i,a,o,s;if(e.x/=this.a,e.y/=this.a,this.shape===`ellipse`){this.flip_axis?(r=Math.tan(e.y/this.radius_g_1),n=Math.tan(e.x/this.radius_g_1)*H(1,r)):(n=Math.tan(e.x/this.radius_g_1),r=Math.tan(e.y/this.radius_g_1)*H(1,n));var c=r/this.radius_p;if(i=n*n+c*c+t*t,a=2*this.radius_g*t,o=a*a-4*i*this.C,o<0)return e.x=NaN,e.y=NaN,e;s=(-a-Math.sqrt(o))/(2*i),t=this.radius_g+s*t,n*=s,r*=s,e.x=Math.atan2(n,t),e.y=Math.atan(r*Math.cos(e.x)/t),e.y=Math.atan(this.radius_p_inv2*Math.tan(e.y))}else if(this.shape===`sphere`){if(this.flip_axis?(r=Math.tan(e.y/this.radius_g_1),n=Math.tan(e.x/this.radius_g_1)*Math.sqrt(1+r*r)):(n=Math.tan(e.x/this.radius_g_1),r=Math.tan(e.y/this.radius_g_1)*Math.sqrt(1+n*n)),i=n*n+r*r+t*t,a=2*this.radius_g*t,o=a*a-4*i*this.C,o<0)return e.x=NaN,e.y=NaN,e;s=(-a-Math.sqrt(o))/(2*i),t=this.radius_g+s*t,n*=s,r*=s,e.x=Math.atan2(n,t),e.y=Math.atan(r*Math.cos(e.x)/t)}return e.x+=this.long0,e}var ba={init:_a,forward:va,inverse:ya,names:[`Geostationary Satellite View`,`Geostationary_Satellite`,`geos`]},xa=1.340264,Sa=-.081106,Ca=893e-6,wa=.003796,Ta=Math.sqrt(3)/2;function Ea(){this.es=0,this.long0=this.long0===void 0?0:this.long0,this.x0=this.x0===void 0?0:this.x0,this.y0=this.y0===void 0?0:this.y0}function Da(e){var t=N(e.x-this.long0,this.over),n=e.y,r=Math.asin(Ta*Math.sin(n)),i=r*r,a=i*i*i;return e.x=t*Math.cos(r)/(Ta*(xa+3*Sa*i+a*(7*Ca+9*wa*i))),e.y=r*(xa+Sa*i+a*(Ca+wa*i)),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function Oa(e){e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a;var t=1e-9,n=12,r=e.y,i,a,o,s,c,l;for(l=0;l<n&&(i=r*r,a=i*i*i,o=r*(xa+Sa*i+a*(Ca+wa*i))-e.y,s=xa+3*Sa*i+a*(7*Ca+9*wa*i),r-=c=o/s,!(Math.abs(c)<t));++l);return i=r*r,a=i*i*i,e.x=Ta*e.x*(xa+3*Sa*i+a*(7*Ca+9*wa*i))/Math.cos(r),e.y=Math.asin(Math.sin(r)/Ta),e.x=N(e.x+this.long0,this.over),e}var ka={init:Ea,forward:Da,inverse:Oa,names:[`eqearth`,`Equal Earth`,`Equal_Earth`]},Aa=1e-10;function ja(){var e;if(this.phi1=this.lat1,Math.abs(this.phi1)<Aa)throw Error();this.es?(this.en=_n(this.es),this.m1=vn(this.phi1,this.am1=Math.sin(this.phi1),e=Math.cos(this.phi1),this.en),this.am1=e/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=Na,this.forward=Ma):(Math.abs(this.phi1)+Aa>=a?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=Fa,this.forward=Pa)}function Ma(e){var t=N(e.x-(this.long0||0),this.over),n=e.y,r=this.am1+this.m1-vn(n,i=Math.sin(n),a=Math.cos(n),this.en),i=a*t/(r*Math.sqrt(1-this.es*i*i)),a;return e.x=r*Math.sin(i),e.y=this.am1-r*Math.cos(i),e.x=this.a*e.x+(this.x0||0),e.y=this.a*e.y+(this.y0||0),e}function Na(e){e.x=(e.x-(this.x0||0))/this.a,e.y=(e.y-(this.y0||0))/this.a;var t,n=H(e.x,e.y=this.am1-e.y),r,i=bn(this.am1+this.m1-n,this.es,this.en);if((t=Math.abs(i))<a)t=Math.sin(i),r=n*Math.atan2(e.x,e.y)*Math.sqrt(1-this.es*t*t)/Math.cos(i);else if(Math.abs(t-a)<=Aa)r=0;else throw Error();return e.x=N(r+(this.long0||0),this.over),e.y=G(i),e}function Pa(e){var t=N(e.x-(this.long0||0),this.over),n=e.y,r,i=this.cphi1+this.phi1-n;return Math.abs(i)>Aa?(e.x=i*Math.sin(r=t*Math.cos(n)/i),e.y=this.cphi1-i*Math.cos(r)):e.x=e.y=0,e.x=this.a*e.x+(this.x0||0),e.y=this.a*e.y+(this.y0||0),e}function Fa(e){e.x=(e.x-(this.x0||0))/this.a,e.y=(e.y-(this.y0||0))/this.a;var t,n,r=H(e.x,e.y=this.cphi1-e.y);if(n=this.cphi1+this.phi1-r,Math.abs(n)>a)throw Error();return t=Math.abs(Math.abs(n)-a)<=Aa?0:r*Math.atan2(e.x,e.y)/Math.cos(n),e.x=N(t+(this.long0||0),this.over),e.y=G(n),e}var Ia={init:ja,names:[`bonne`,`Bonne (Werner lat_1=90)`]};let La={OBLIQUE:{forward:Ua,inverse:Ga},TRANSVERSE:{forward:Wa,inverse:Ka}},Ra={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 za(){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=Be.includes(this.o_proj),!this.o_proj)throw Error(`Missing parameter: o_proj`);if(this.o_proj===`ob_tran`)throw Error(`Invalid value for o_proj: `+this.o_proj);let e=L(this.projStr.replace(`+proj=ob_tran`,``).replace(`+o_proj=`,`+proj=`).trim());if(!e)throw Error(`Invalid parameter: o_proj. Unknown projection `+this.o_proj);e.long0=0,this.obliqueProjection=e;let t,n=Object.keys(Ra),r=e=>{if(this[e]===void 0)return;let t=parseFloat(this[e])*u;if(isNaN(t))throw Error(`Invalid value for `+e+`: `+this[e]);return t};for(let e=0;e<n.length;e++){let i=Ra[n[e]],a=Object.entries(i);if(a.some(([e])=>this[e]!==void 0)){t=i;for(let e=0;e<a.length;e++){let[t,n]=a[e],i=r(t);if(i===void 0)throw Error(`Missing parameter: `+t+`.`);this[n]=i}break}}if(!t)throw Error(`No valid parameters provided for ob_tran projection.`);let{lamp:i,phip:a}=Ha(this,t);this.lamp=i,Math.abs(a)>1e-10?(this.cphip=Math.cos(a),this.sphip=Math.sin(a),this.projectionType=La.OBLIQUE):this.projectionType=La.TRANSVERSE}function Ba(e){return this.projectionType.forward(this,e)}function Va(e){return this.projectionType.inverse(this,e)}function Ha(e,t){let n,r;if(t===Ra.ROTATE){let t=e.oLongC,i=e.oLatC,o=e.oAlpha;if(Math.abs(Math.abs(i)-a)<=1e-10)throw Error(`Invalid value for o_lat_c: `+e.o_lat_c+` should be < 90°`);r=t+Math.atan2(-1*Math.cos(o),-1*Math.sin(o)*Math.sin(i)),n=Math.asin(Math.cos(i)*Math.sin(o))}else if(t===Ra.NEW_POLE)r=e.oLongP,n=e.oLatP;else{let t=e.oLong1,i=e.oLat1,o=e.oLong2,s=e.oLat2,c=Math.abs(i);if(Math.abs(i)>a-1e-10)throw Error(`Invalid value for o_lat_1: `+e.o_lat_1+` should be < 90°`);if(Math.abs(s)>a-1e-10)throw Error(`Invalid value for o_lat_2: `+e.o_lat_2+` should be < 90°`);if(Math.abs(i-s)<1e-10)throw Error(`Invalid value for o_lat_1 and o_lat_2: o_lat_1 should be different from o_lat_2`);if(c<1e-10)throw Error(`Invalid value for o_lat_1: o_lat_1 should be different from zero`);r=Math.atan2(Math.cos(i)*Math.sin(s)*Math.cos(t)-Math.sin(i)*Math.cos(s)*Math.cos(o),Math.sin(i)*Math.cos(s)*Math.sin(o)-Math.cos(i)*Math.sin(s)*Math.sin(t)),n=Math.atan(-1*Math.cos(r-t)/Math.tan(i))}return{lamp:r,phip:n}}function Ua(e,t){let{x:n,y:r}=t;n+=e.long0;let i=Math.cos(n),a=Math.sin(r),o=Math.cos(r);t.x=N(Math.atan2(o*Math.sin(n),e.sphip*o*i+e.cphip*a)+e.lamp),t.y=Math.asin(e.sphip*a-e.cphip*o*i);let s=e.obliqueProjection.forward(t);return e.isIdentity&&(s.x*=d,s.y*=d),s}function Wa(e,t){let{x:n,y:r}=t;n+=e.long0;let i=Math.cos(r),a=Math.cos(n);t.x=N(Math.atan2(i*Math.sin(n),Math.sin(r))+e.lamp),t.y=Math.asin(-1*i*a);let o=e.obliqueProjection.forward(t);return e.isIdentity&&(o.x*=d,o.y*=d),o}function Ga(e,t){e.isIdentity&&(t.x*=u,t.y*=u);let{x:n,y:r}=e.obliqueProjection.inverse(t);if(n<Number.MAX_VALUE){n-=e.lamp;let i=Math.cos(n),a=Math.sin(r),o=Math.cos(r);t.x=Math.atan2(o*Math.sin(n),e.sphip*o*i-e.cphip*a),t.y=Math.asin(e.sphip*a+e.cphip*o*i)}return t.x=N(t.x+e.long0),t}function Ka(e,t){e.isIdentity&&(t.x*=u,t.y*=u);let{x:n,y:r}=e.obliqueProjection.inverse(t);if(n<Number.MAX_VALUE){let i=Math.cos(r);n-=e.lamp,t.x=Math.atan2(i*Math.sin(n),-1*Math.sin(r)),t.y=Math.asin(i*Math.cos(n))}return t.x=N(t.x+e.long0),t}var qa={init:za,forward:Ba,inverse:Va,names:[`General Oblique Transformation`,`General_Oblique_Transformation`,`ob_tran`]};function Ja(e){e.Proj.projections.add(wn),e.Proj.projections.add(Fn),e.Proj.projections.add(zn),e.Proj.projections.add(Yn),e.Proj.projections.add(er),e.Proj.projections.add(ir),e.Proj.projections.add(lr),e.Proj.projections.add(pr),e.Proj.projections.add(_r),e.Proj.projections.add(Dr),e.Proj.projections.add(zr),e.Proj.projections.add(Wr),e.Proj.projections.add(Jr),e.Proj.projections.add($r),e.Proj.projections.add(ri),e.Proj.projections.add(ci),e.Proj.projections.add(fi),e.Proj.projections.add(gi),e.Proj.projections.add(xi),e.Proj.projections.add(Ti),e.Proj.projections.add(ki),e.Proj.projections.add(Ni),e.Proj.projections.add(zi),e.Proj.projections.add(Ui),e.Proj.projections.add(Ji),e.Proj.projections.add(sa),e.Proj.projections.add(da),e.Proj.projections.add(ga),e.Proj.projections.add(ba),e.Proj.projections.add(ka),e.Proj.projections.add(Ia),e.Proj.projections.add(qa)}let Ya=Object.assign(Ft,{defaultDatum:`WGS84`,Proj:L,WGS84:new L(`WGS84`),Point:V,toPoint:Dt,defs:j,nadgrid:rt,transform:jt,mgrs:Vt,version:`__VERSION__`});Ja(Ya);try{let e=()=>new DecompressionStream(`deflate-raw`),t=e=>new Response(e);e(),Xa=n=>t(t(n).body.pipeThrough(e())).arrayBuffer().then(e=>new Uint8Array(e))}catch{}var Xa;new TextDecoder,globalThis.URL;function Za(e){let t=0,n=1,r=e.length,i,a,o=[e[0][0],e[0][1],e[0][0],e[0][1]];for(;n<r;)i=a||e[0],a=e[n],t+=(a[0]-i[0])*(a[1]+i[1]),n++,a[0]<o[0]&&(o[0]=a[0]),a[1]<o[1]&&(o[1]=a[1]),a[0]>o[2]&&(o[2]=a[0]),a[1]>o[3]&&(o[3]=a[1]);return{ring:e,clockWise:t>0,bbox:o,children:[]}}function Qa(e,t){return!(e.bbox[0]>t.bbox[0]||e.bbox[1]>t.bbox[1]||e.bbox[2]<t.bbox[2]||e.bbox[3]<t.bbox[3])}function $a(e,t=!1){let n=[],r=[];for(let i of e){let e=Za(i);e.clockWise===t?r.push(e):n.push(e)}let i=[];for(let e of r){let t;for(let r of n)Qa(r,e)&&(t?Qa(t,r)&&(t=r):t=r);t?t.children.push(e.ring):i.push(e)}if(t)return{outers:n,orphens:i};if(i.length&&!t){let t=$a(e,!0);if(t.orphens.length===0){let e=[];for(let n of t.outers)e.push([n.ring.toReversed()].concat(n.children.map(e=>e.toReversed())));return e}}let a=[];for(let e of n)a.push([e.ring].concat(e.children));return a}$.prototype.parsePoint=function(e){return{type:`Point`,coordinates:this.parseCoord(e,0)}},$.prototype.parseZPoint=function(e){let t=this.parsePoint(e);return t.coordinates.push(e.getFloat64(16,!0)),t},$.prototype.parsePointArray=function(e,t,n){let r=[],i=0;for(;i<n;)r.push(this.parseCoord(e,t)),t+=16,i++;return r},$.prototype.parseZPointArray=function(e,t,n,r){let i=0;for(;i<n;)r[i].push(e.getFloat64(t,!0)),i++,t+=8;return r},$.prototype.parseArrayGroup=function(e,t,n,r,i){let a=[],o=0,s,c=0,l;for(;o<r;)o++,n+=4,s=c,c=o===r?i:e.getInt32(n,!0),l=c-s,l&&(a.push(this.parsePointArray(e,t,l)),t+=l<<4);return a},$.prototype.parseZArrayGroup=function(e,t,n,r){let i=0;for(;i<n;)r[i]=this.parseZPointArray(e,t,r[i].length,r[i]),t+=r[i].length<<3,i++;return r},$.prototype.parseMultiPoint=function(e){let t={},n=e.getInt32(32,!0);if(!n)return null;let r=this.parseCoord(e,0),i=this.parseCoord(e,16);return t.bbox=[r[0],r[1],i[0],i[1]],n===1?(t.type=`Point`,t.coordinates=this.parseCoord(e,36)):(t.type=`MultiPoint`,t.coordinates=this.parsePointArray(e,36,n)),t},$.prototype.parseZMultiPoint=function(e){let t=this.parseMultiPoint(e);if(!t)return null;let n;if(t.type===`Point`)return t.coordinates.push(e.getFloat64(72,!0)),t;n=t.coordinates.length;let r=52+(n<<4);return t.coordinates=this.parseZPointArray(e,r,n,t.coordinates),t},$.prototype.parsePolyline=function(e){let t={},n=e.getInt32(32,!0);if(!n)return null;let r=this.parseCoord(e,0),i=this.parseCoord(e,16);t.bbox=[r[0],r[1],i[0],i[1]];let a=e.getInt32(36,!0),o,s;return n===1?(t.type=`LineString`,o=44,t.coordinates=this.parsePointArray(e,o,a)):(t.type=`MultiLineString`,o=40+(n<<2),s=40,t.coordinates=this.parseArrayGroup(e,o,s,n,a)),t},$.prototype.parseZPolyline=function(e){let t=this.parsePolyline(e);if(!t)return null;let n=t.coordinates.length,r;return t.type===`LineString`?(r=60+(n<<4),t.coordinates=this.parseZPointArray(e,r,n,t.coordinates),t):(r=56+(t.coordinates.reduce(function(e,t){return e+t.length},0)<<4)+(n<<2),t.coordinates=this.parseZArrayGroup(e,r,n,t.coordinates),t)},$.prototype.polyFuncs=function(e){return e&&(e.type===`LineString`?(e.type=`Polygon`,e.coordinates=[e.coordinates],e):(e.coordinates=$a(e.coordinates),e.coordinates.length===1?(e.type=`Polygon`,e.coordinates=e.coordinates[0],e):(e.type=`MultiPolygon`,e)))},$.prototype.parsePolygon=function(e){return this.polyFuncs(this.parsePolyline(e))},$.prototype.parseZPolygon=function(e){return this.polyFuncs(this.parseZPolyline(e))};let eo={1:`parsePoint`,3:`parsePolyline`,5:`parsePolygon`,8:`parseMultiPoint`,11:`parseZPoint`,13:`parseZPolyline`,15:`parseZPolygon`,18:`parseZMultiPoint`};function to(e){return e?function(t,n){let r=[t.getFloat64(n,!0),t.getFloat64(n+8,!0)];return e.inverse(r)}:function(e,t){return[e.getFloat64(t,!0),e.getFloat64(t+8,!0)]}}function $(e,t){if(!(this instanceof $))return new $(e,t);this.buffer=e,this.headers=this.parseHeader(),this.shpFuncs(t),this.rows=this.getRows()}$.prototype.shpFuncs=function(e){let t=this.headers.shpCode;if(t>20&&(t-=20),!(t in eo))throw Error(`I don't know shp type "${t}"`);this.parseFunc=this[eo[t]],this.parseCoord=to(e)},$.prototype.getShpCode=function(){return this.parseHeader().shpCode},$.prototype.parseHeader=function(){let e=this.buffer;return{length:e.getInt32(24)<<1,version:e.getInt32(28,!0),shpCode:e.getInt32(32,!0),bbox:[e.getFloat64(36,!0),e.getFloat64(44,!0),e.getFloat64(52,!0),e.getFloat64(60,!0)]}},$.prototype.getRows=function(){let e=100,t=this.buffer.byteLength-8,n=[],r;for(;e<=t&&(r=this.getRow(e),r);)e+=8,e+=r.len,r.type?n.push(this.parseFunc(r.data)):n.push(null);return n},$.prototype.getRow=function(e){let t=this.buffer.getInt32(e),n=this.buffer.getInt32(e+4)<<1;if(n===0)return{id:t,len:n,type:0};if(!(e+n+8>this.buffer.byteLength))return{id:t,len:n,data:new DataView(this.buffer.buffer,this.buffer.byteOffset+e+12,n-4),type:this.buffer.getInt32(e+8,!0)}};function no(e,t){return new $(e,t).rows}var ro=/^(?:ANSI\s)?(\d+)$/m;function io(e,t){if(!e)return r;try{new TextDecoder(e.trim())}catch{var n=ro.exec(e);return n&&!t?io(`windows-`+n[1],!0):(e=void 0,r)}return r;function r(t){var n=new TextDecoder(e||void 0);return(n.decode(t,{stream:!0})+n.decode()).replace(/\0/g,``).trim()}}function ao(e){var t={};return t.lastUpdated=new Date(e.getUint8(1)+1900,e.getUint8(2),e.getUint8(3)),t.records=e.getUint32(4,!0),t.headerLen=e.getUint16(8,!0),t.recLen=e.getUint16(10,!0),t}function oo(e,t,n){for(var r=[],i=32;i<t&&(r.push({name:n(new Uint8Array(e.buffer.slice(e.byteOffset+i,e.byteOffset+i+11))),dataType:String.fromCharCode(e.getUint8(i+11)),len:e.getUint8(i+16),decimal:e.getUint8(i+17)}),e.getUint8(i+32)!==13);)i+=32;return r}function so(e,t,n,r,i){var a=i(new Uint8Array(e.buffer.slice(e.byteOffset+t,e.byteOffset+t+n)));switch(r){case`N`:case`F`:case`O`:return parseFloat(a,10);case`D`:return new Date(a.slice(0,4),parseInt(a.slice(4,6),10)-1,a.slice(6,8));case`L`:return a.toLowerCase()===`y`||a.toLowerCase()===`t`;default:return a}}function co(e,t,n,r){for(var i={},a=0,o=n.length,s,c;a<o;)c=n[a],s=so(e,t,c.len,c.dataType,r),t+=c.len,s!==void 0&&(i[c.name]=s),a++;return i}function lo(e,t){for(var n=io(t),r=ao(e),i=oo(e,r.headerLen-1,n),a=(i.length+1<<5)+2,o=r.recLen,s=r.records,c=[];s;)c.push(co(e,a,i,n)),a+=o,s--;return c}globalThis.URL;let uo=new TextDecoder,fo=e=>{if(e){if(typeof e==`string`)return e;if(mo(e)||ArrayBuffer.isView(e)||ho(e))return uo.decode(e)}},po=e=>{if(!e)throw Error(`forgot to pass buffer`);if(ho(e))return e;if(mo(e))return new DataView(e);if(mo(e.buffer))return new DataView(e.buffer,e.byteOffset,e.byteLength);throw Error(`invalid buffer like object`)};function mo(e){return e instanceof globalThis.ArrayBuffer||Object.prototype.toString.call(e)===`[object ArrayBuffer]`}function ho(e){return e instanceof globalThis.DataView||Object.prototype.toString.call(e)===`[object DataView]`}let go=function(e,t){if(e=po(e),t=fo(t),typeof t==`string`)try{t=Ya(t)}catch{t=!1}return no(e,t)},_o=function(e,t){return e=po(e),t=fo(t),lo(e,t)};function vo(e,t){let n=e=>{let r=e;if(typeof r[0]==`number`){let[e,n]=t(r);r[0]=e,r[1]=n;return}for(let e of r)n(e)};e.type===`GeometryCollection`?e.geometries.forEach(e=>vo(e,t)):n(e.coordinates)}function yo(e){return/GEOGCS\["[^"]*WGS[ _]?84/i.test(e)||/AUTHORITY\["EPSG","4326"\]\s*\]\s*$/i.test(e.trim())}function bo(e,t,n){console.log(`reading shp data`);let r=go(e),i=t?_o(t,void 0):[],a=n&&!yo(n)?Ya(n,`EPSG:4326`):null,o=a?e=>a.forward(e):null;o&&console.log(`projecting...`),console.log(`converting to geojson`);let s=Array(r.length),c=0;for(let e=0;e<r.length;e++){let t=r[e];r[e]=null,t&&(o&&vo(t,o),s[c++]={type:`Feature`,geometry:t,properties:i[e]??{}},i[e]=void 0)}return s.length=c,{type:`FeatureCollection`,features:s}}self.onmessage=e=>{let{shpBuffer:t,dbfBuffer:n,prjText:r}=e.data;try{let e=bo(t,n,r);self.postMessage({success:!0,data:e})}catch(e){self.postMessage({success:!1,error:String(e)})}}})();
@@ -0,0 +1,62 @@
1
+ import { html as e } from "lit";
2
+ //#region src/utils/attribution-format.ts
3
+ var t = /(https?:\/\/[^\s<"]+)/g, n = /<a\s[^>]*href=["']([^"']+)["'][^>]*>([\s\S]*?)<\/a>/gi;
4
+ function r(e, t) {
5
+ if (!e) return;
6
+ if (e.type === "style") {
7
+ let t = e.attribution;
8
+ if (typeof t == "string") return t;
9
+ }
10
+ let n = e.type === "style" ? e.layers ?? [] : [e];
11
+ for (let e of n) {
12
+ let n = e.source;
13
+ if (!n) continue;
14
+ let r = t.get(n);
15
+ if (r && typeof r.attribution == "string") return r.attribution;
16
+ }
17
+ }
18
+ function i(e) {
19
+ return e.replace(/<[^>]+>/g, "");
20
+ }
21
+ function a(e) {
22
+ return e.replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, "\"").replace(/&#39;/g, "'").replace(/&copy;/g, "©").replace(/&reg;/g, "®").replace(/&trade;/g, "™").replace(/&#(\d+);/g, (e, t) => String.fromCharCode(Number(t))).replace(/&#x([0-9a-f]+);/gi, (e, t) => String.fromCharCode(parseInt(t, 16)));
23
+ }
24
+ function o(e) {
25
+ try {
26
+ let { hostname: t } = new URL(e);
27
+ return `_attr_${t.replace(/[^a-z0-9]/gi, "_")}`;
28
+ } catch {
29
+ return "_attr_link";
30
+ }
31
+ }
32
+ function s(r) {
33
+ let s = [], c = 0;
34
+ n.lastIndex = 0;
35
+ for (let e of r.matchAll(n)) {
36
+ let t = e.index ?? 0;
37
+ t > c && s.push(i(a(r.slice(c, t)))), s.push({
38
+ href: e[1],
39
+ label: i(a(e[2]))
40
+ }), c = t + e[0].length;
41
+ }
42
+ let l = r.slice(c);
43
+ t.lastIndex = 0;
44
+ let u = 0;
45
+ for (let e of l.matchAll(t)) {
46
+ let t = e.index ?? 0;
47
+ t > u && s.push(i(a(l.slice(u, t))));
48
+ let n = e[0];
49
+ try {
50
+ n = new URL(e[0]).hostname.replace(/^www\./, "");
51
+ } catch {}
52
+ s.push({
53
+ href: e[0],
54
+ label: n
55
+ }), u = t + e[0].length;
56
+ }
57
+ return u < l.length && s.push(i(a(l.slice(u)))), e`<span class="attribution-item">
58
+ ${s.map((t) => typeof t == "string" ? e`${t}` : e`<a href=${t.href} target=${o(t.href)} rel="noopener noreferrer">${t.label}</a>`)}
59
+ </span>`;
60
+ }
61
+ //#endregion
62
+ export { i, s as n, r, a as t };