@naivemap/mapbox-gl-image-layer 0.6.0-alpha.0 → 0.6.0-alpha.2
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.
- package/dist/index.d.ts +2 -2
- package/dist/index.es.js +6723 -0
- package/dist/index.umd.js +78 -0
- package/dist/mapbox-gl-image-layer/src/ImageLayer.d.ts +2 -2
- package/dist/mapbox-gl-image-layer/src/index.d.ts +2 -2
- package/package.json +7 -7
- package/dist/index.cjs +0 -1
- package/dist/index.js +0 -61
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
(function(Dt,J){typeof exports=="object"&&typeof module<"u"?module.exports=J():typeof define=="function"&&define.amd?define(J):(Dt=typeof globalThis<"u"?globalThis:Dt||self,Dt.ImageLayer=J())})(this,function(){"use strict";function Dt(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs");for(var e=1;e<=60;++e)t("EPSG:"+(32600+e),"+proj=utm +zone="+e+" +datum=WGS84 +units=m"),t("EPSG:"+(32700+e),"+proj=utm +zone="+e+" +south +datum=WGS84 +units=m");t("EPSG:5041","+title=WGS 84 / UPS North (E,N) +proj=stere +lat_0=90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"),t("EPSG:5042","+title=WGS 84 / UPS South (E,N) +proj=stere +lat_0=-90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}var J=1,dt=2,pt=3,cr=4,Ye=5,Yi=6378137,gr=6356752314e-3,ts=.0066943799901413165,Bt=484813681109536e-20,v=Math.PI/2,mr=.16666666666666666,_r=.04722222222222222,dr=.022156084656084655,x=1e-10,F=.017453292519943295,W=57.29577951308232,A=Math.PI/4,$t=Math.PI*2,O=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;const vr={mm:{to_meter:.001},cm:{to_meter:.01},ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937},fath:{to_meter:1.8288},kmi:{to_meter:1852},"us-ch":{to_meter:20.1168402336805},"us-mi":{to_meter:1609.34721869444},km:{to_meter:1e3},"ind-ft":{to_meter:.30479841},"ind-yd":{to_meter:.91439523},mi:{to_meter:1609.344},yd:{to_meter:.9144},ch:{to_meter:20.1168},link:{to_meter:.201168},dm:{to_meter:.1},in:{to_meter:.0254},"ind-ch":{to_meter:20.11669506},"us-in":{to_meter:.025400050800101},"us-yd":{to_meter:.914401828803658}};var es=/[\s_\-\/\(\)]/g;function rt(t,e){if(t[e])return t[e];for(var i=Object.keys(t),s=e.toLowerCase().replace(es,""),a=-1,r,o;++a<i.length;)if(r=i[a],o=r.toLowerCase().replace(es,""),o===s)return t[r]}function ti(t){var e={},i=t.split("+").map(function(n){return n.trim()}).filter(function(n){return n}).reduce(function(n,h){var l=h.split("=");return l.push(!0),n[l[0].toLowerCase()]=l[1],n},{}),s,a,r,o={proj:"projName",datum:"datumCode",rf:function(n){e.rf=parseFloat(n)},lat_0:function(n){e.lat0=n*F},lat_1:function(n){e.lat1=n*F},lat_2:function(n){e.lat2=n*F},lat_ts:function(n){e.lat_ts=n*F},lon_0:function(n){e.long0=n*F},lon_1:function(n){e.long1=n*F},lon_2:function(n){e.long2=n*F},alpha:function(n){e.alpha=parseFloat(n)*F},gamma:function(n){e.rectified_grid_angle=parseFloat(n)*F},lonc:function(n){e.longc=n*F},x_0:function(n){e.x0=parseFloat(n)},y_0:function(n){e.y0=parseFloat(n)},k_0:function(n){e.k0=parseFloat(n)},k:function(n){e.k0=parseFloat(n)},a:function(n){e.a=parseFloat(n)},b:function(n){e.b=parseFloat(n)},r:function(n){e.a=e.b=parseFloat(n)},r_a:function(){e.R_A=!0},zone:function(n){e.zone=parseInt(n,10)},south:function(){e.utmSouth=!0},towgs84:function(n){e.datum_params=n.split(",").map(function(h){return parseFloat(h)})},to_meter:function(n){e.to_meter=parseFloat(n)},units:function(n){e.units=n;var h=rt(vr,n);h&&(e.to_meter=h.to_meter)},from_greenwich:function(n){e.from_greenwich=n*F},pm:function(n){var h=rt(H,n);e.from_greenwich=(h||parseFloat(n))*F},nadgrids:function(n){n==="@null"?e.datumCode="none":e.nadgrids=n},axis:function(n){var h="ewnsud";n.length===3&&h.indexOf(n.substr(0,1))!==-1&&h.indexOf(n.substr(1,1))!==-1&&h.indexOf(n.substr(2,1))!==-1&&(e.axis=n)},approx:function(){e.approx=!0},over:function(){e.over=!0}};for(s in i)a=i[s],s in o?(r=o[s],typeof r=="function"?r(a):e[r]=a):e[s]=a;return typeof e.datumCode=="string"&&e.datumCode!=="WGS84"&&(e.datumCode=e.datumCode.toLowerCase()),e.projStr=t,e}class is{static getId(e){const i=e.find(s=>Array.isArray(s)&&s[0]==="ID");return i&&i.length>=3?{authority:i[1],code:parseInt(i[2],10)}:null}static convertUnit(e,i="unit"){if(!e||e.length<3)return{type:i,name:"unknown",conversion_factor:null};const s=e[1],a=parseFloat(e[2])||null,r=e.find(n=>Array.isArray(n)&&n[0]==="ID"),o=r?{authority:r[1],code:parseInt(r[2],10)}:null;return{type:i,name:s,conversion_factor:a,id:o}}static convertAxis(e){const i=e[1]||"Unknown";let s;const a=i.match(/^\((.)\)$/);if(a){const l=a[1].toUpperCase();if(l==="E")s="east";else if(l==="N")s="north";else if(l==="U")s="up";else if(e[2])s=e[2];else throw new Error(`Unknown axis abbreviation: ${l}`)}else s=e[2]||"unknown";const r=e.find(l=>Array.isArray(l)&&l[0]==="ORDER"),o=r?parseInt(r[1],10):null,n=e.find(l=>Array.isArray(l)&&(l[0]==="LENGTHUNIT"||l[0]==="ANGLEUNIT"||l[0]==="SCALEUNIT")),h=this.convertUnit(n);return{name:i,direction:s,unit:h,order:o}}static extractAxes(e){return e.filter(i=>Array.isArray(i)&&i[0]==="AXIS").map(i=>this.convertAxis(i)).sort((i,s)=>(i.order||0)-(s.order||0))}static convert(e,i={}){switch(e[0]){case"PROJCRS":i.type="ProjectedCRS",i.name=e[1],i.base_crs=e.find(f=>Array.isArray(f)&&f[0]==="BASEGEOGCRS")?this.convert(e.find(f=>Array.isArray(f)&&f[0]==="BASEGEOGCRS")):null,i.conversion=e.find(f=>Array.isArray(f)&&f[0]==="CONVERSION")?this.convert(e.find(f=>Array.isArray(f)&&f[0]==="CONVERSION")):null;const s=e.find(f=>Array.isArray(f)&&f[0]==="CS");s&&(i.coordinate_system={type:s[1],axis:this.extractAxes(e)});const a=e.find(f=>Array.isArray(f)&&f[0]==="LENGTHUNIT");if(a){const f=this.convertUnit(a);i.coordinate_system.unit=f}i.id=this.getId(e);break;case"BASEGEOGCRS":case"GEOGCRS":case"GEODCRS":i.type=e[0]==="GEODCRS"?"GeodeticCRS":"GeographicCRS",i.name=e[1];const r=e.find(f=>Array.isArray(f)&&(f[0]==="DATUM"||f[0]==="ENSEMBLE"));if(r){const f=this.convert(r);r[0]==="ENSEMBLE"?i.datum_ensemble=f:i.datum=f;const m=e.find(g=>Array.isArray(g)&&g[0]==="PRIMEM");m&&m[1]!=="Greenwich"&&(f.prime_meridian={name:m[1],longitude:parseFloat(m[2])})}i.coordinate_system={type:"ellipsoidal",axis:this.extractAxes(e)},i.id=this.getId(e);break;case"DATUM":i.type="GeodeticReferenceFrame",i.name=e[1],i.ellipsoid=e.find(f=>Array.isArray(f)&&f[0]==="ELLIPSOID")?this.convert(e.find(f=>Array.isArray(f)&&f[0]==="ELLIPSOID")):null;break;case"ENSEMBLE":i.type="DatumEnsemble",i.name=e[1],i.members=e.filter(f=>Array.isArray(f)&&f[0]==="MEMBER").map(f=>({type:"DatumEnsembleMember",name:f[1],id:this.getId(f)}));const o=e.find(f=>Array.isArray(f)&&f[0]==="ENSEMBLEACCURACY");o&&(i.accuracy=parseFloat(o[1]));const n=e.find(f=>Array.isArray(f)&&f[0]==="ELLIPSOID");n&&(i.ellipsoid=this.convert(n)),i.id=this.getId(e);break;case"ELLIPSOID":i.type="Ellipsoid",i.name=e[1],i.semi_major_axis=parseFloat(e[2]),i.inverse_flattening=parseFloat(e[3]),e.find(f=>Array.isArray(f)&&f[0]==="LENGTHUNIT")&&this.convert(e.find(f=>Array.isArray(f)&&f[0]==="LENGTHUNIT"),i);break;case"CONVERSION":i.type="Conversion",i.name=e[1],i.method=e.find(f=>Array.isArray(f)&&f[0]==="METHOD")?this.convert(e.find(f=>Array.isArray(f)&&f[0]==="METHOD")):null,i.parameters=e.filter(f=>Array.isArray(f)&&f[0]==="PARAMETER").map(f=>this.convert(f));break;case"METHOD":i.type="Method",i.name=e[1],i.id=this.getId(e);break;case"PARAMETER":i.type="Parameter",i.name=e[1],i.value=parseFloat(e[2]),i.unit=this.convertUnit(e.find(f=>Array.isArray(f)&&(f[0]==="LENGTHUNIT"||f[0]==="ANGLEUNIT"||f[0]==="SCALEUNIT"))),i.id=this.getId(e);break;case"BOUNDCRS":i.type="BoundCRS";const h=e.find(f=>Array.isArray(f)&&f[0]==="SOURCECRS");if(h){const f=h.find(m=>Array.isArray(m));i.source_crs=f?this.convert(f):null}const l=e.find(f=>Array.isArray(f)&&f[0]==="TARGETCRS");if(l){const f=l.find(m=>Array.isArray(m));i.target_crs=f?this.convert(f):null}const c=e.find(f=>Array.isArray(f)&&f[0]==="ABRIDGEDTRANSFORMATION");c?i.transformation=this.convert(c):i.transformation=null;break;case"ABRIDGEDTRANSFORMATION":if(i.type="Transformation",i.name=e[1],i.method=e.find(f=>Array.isArray(f)&&f[0]==="METHOD")?this.convert(e.find(f=>Array.isArray(f)&&f[0]==="METHOD")):null,i.parameters=e.filter(f=>Array.isArray(f)&&(f[0]==="PARAMETER"||f[0]==="PARAMETERFILE")).map(f=>{if(f[0]==="PARAMETER")return this.convert(f);if(f[0]==="PARAMETERFILE")return{name:f[1],value:f[2],id:{authority:"EPSG",code:8656}}}),i.parameters.length===7){const f=i.parameters[6];f.name==="Scale difference"&&(f.value=Math.round((f.value-1)*1e12)/1e6)}i.id=this.getId(e);break;case"AXIS":i.coordinate_system||(i.coordinate_system={type:"unspecified",axis:[]}),i.coordinate_system.axis.push(this.convertAxis(e));break;case"LENGTHUNIT":const u=this.convertUnit(e,"LinearUnit");i.coordinate_system&&i.coordinate_system.axis&&i.coordinate_system.axis.forEach(f=>{f.unit||(f.unit=u)}),u.conversion_factor&&u.conversion_factor!==1&&i.semi_major_axis&&(i.semi_major_axis={value:i.semi_major_axis,unit:u});break;default:i.keyword=e[0];break}return i}}class yr extends is{static convert(e,i={}){return super.convert(e,i),i.coordinate_system&&i.coordinate_system.subtype==="Cartesian"&&delete i.coordinate_system,i.usage&&delete i.usage,i}}class Mr extends is{static convert(e,i={}){super.convert(e,i);const s=e.find(r=>Array.isArray(r)&&r[0]==="CS");s&&(i.coordinate_system={subtype:s[1],axis:this.extractAxes(e)});const a=e.find(r=>Array.isArray(r)&&r[0]==="USAGE");if(a){const r=a.find(h=>Array.isArray(h)&&h[0]==="SCOPE"),o=a.find(h=>Array.isArray(h)&&h[0]==="AREA"),n=a.find(h=>Array.isArray(h)&&h[0]==="BBOX");i.usage={},r&&(i.usage.scope=r[1]),o&&(i.usage.area=o[1]),n&&(i.usage.bbox=n.slice(1))}return i}}function xr(t){return t.find(e=>Array.isArray(e)&&e[0]==="USAGE")?"2019":(t.find(e=>Array.isArray(e)&&e[0]==="CS")||t[0]==="BOUNDCRS"||t[0]==="PROJCRS"||t[0]==="GEOGCRS","2015")}function Er(t){return(xr(t)==="2019"?Mr:yr).convert(t)}function br(t){const e=t.toUpperCase();return e.includes("PROJCRS")||e.includes("GEOGCRS")||e.includes("BOUNDCRS")||e.includes("VERTCRS")||e.includes("LENGTHUNIT")||e.includes("ANGLEUNIT")||e.includes("SCALEUNIT")?"WKT2":(e.includes("PROJCS")||e.includes("GEOGCS")||e.includes("LOCAL_CS")||e.includes("VERT_CS")||e.includes("UNIT"),"WKT1")}var jt=1,ss=2,as=3,ve=4,rs=5,ei=-1,Sr=/\s/,pr=/[A-Za-z]/,wr=/[A-Za-z84_]/,ye=/[,\]]/,ns=/[\d\.E\-\+]/;function at(t){if(typeof t!="string")throw new Error("not a string");this.text=t.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=jt}at.prototype.readCharicter=function(){var t=this.text[this.place++];if(this.state!==ve)for(;Sr.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++]}switch(this.state){case jt:return this.neutral(t);case ss:return this.keyword(t);case ve:return this.quoted(t);case rs:return this.afterquote(t);case as:return this.number(t);case ei:return}},at.prototype.afterquote=function(t){if(t==='"'){this.word+='"',this.state=ve;return}if(ye.test(t)){this.word=this.word.trim(),this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in afterquote yet, index '+this.place)},at.prototype.afterItem=function(t){if(t===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=jt;return}if(t==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=jt,this.currentObject=this.stack.pop(),this.currentObject||(this.state=ei);return}},at.prototype.number=function(t){if(ns.test(t)){this.word+=t;return}if(ye.test(t)){this.word=parseFloat(this.word),this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in number yet, index '+this.place)},at.prototype.quoted=function(t){if(t==='"'){this.state=rs;return}this.word+=t},at.prototype.keyword=function(t){if(wr.test(t)){this.word+=t;return}if(t==="["){var e=[];e.push(this.word),this.level++,this.root===null?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,this.state=jt;return}if(ye.test(t)){this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in keyword yet, index '+this.place)},at.prototype.neutral=function(t){if(pr.test(t)){this.word=t,this.state=ss;return}if(t==='"'){this.word="",this.state=ve;return}if(ns.test(t)){this.word=t,this.state=as;return}if(ye.test(t)){this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in neutral yet, index '+this.place)},at.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===ei)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function Pr(t){var e=new at(t);return e.output()}function ii(t,e,i){Array.isArray(e)&&(i.unshift(e),e=null);var s=e?{}:t,a=i.reduce(function(r,o){return wt(o,r),r},s);e&&(t[e]=a)}function wt(t,e){if(!Array.isArray(t)){e[t]=!0;return}var i=t.shift();if(i==="PARAMETER"&&(i=t.shift()),t.length===1){if(Array.isArray(t[0])){e[i]={},wt(t[0],e[i]);return}e[i]=t[0];return}if(!t.length){e[i]=!0;return}if(i==="TOWGS84"){e[i]=t;return}if(i==="AXIS"){i in e||(e[i]=[]),e[i].push(t);return}Array.isArray(i)||(e[i]={});var s;switch(i){case"UNIT":case"PRIMEM":case"VERT_DATUM":e[i]={name:t[0].toLowerCase(),convert:t[1]},t.length===3&&wt(t[2],e[i]);return;case"SPHEROID":case"ELLIPSOID":e[i]={name:t[0],a:t[1],rf:t[2]},t.length===4&&wt(t[3],e[i]);return;case"EDATUM":case"ENGINEERINGDATUM":case"LOCAL_DATUM":case"DATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":t[0]=["name",t[0]],ii(e,i,t);return;case"COMPD_CS":case"COMPOUNDCRS":case"FITTED_CS":case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"ENGCRS":case"ENGINEERINGCRS":t[0]=["name",t[0]],ii(e,i,t),e[i].type=i;return;default:for(s=-1;++s<t.length;)if(!Array.isArray(t[s]))return wt(t,e[i]);return ii(e,i,t)}}var Gr=.017453292519943295;function Y(t){return t*Gr}function os(t){const e=(t.projName||"").toLowerCase().replace(/_/g," ");!t.long0&&t.longc&&(e==="albers conic equal area"||e==="lambert azimuthal equal area")&&(t.long0=t.longc),!t.lat_ts&&t.lat1&&(e==="stereographic south pole"||e==="polar stereographic (variant b)")?(t.lat0=Y(t.lat1>0?90:-90),t.lat_ts=t.lat1,delete t.lat1):!t.lat_ts&&t.lat0&&(e==="polar stereographic"||e==="polar stereographic (variant a)")&&(t.lat_ts=t.lat0,t.lat0=Y(t.lat0>0?90:-90),delete t.lat1)}function hs(t){let e={units:null,to_meter:void 0};return typeof t=="string"?(e.units=t.toLowerCase(),e.units==="metre"&&(e.units="meter"),e.units==="meter"&&(e.to_meter=1)):t&&t.name&&(e.units=t.name.toLowerCase(),e.units==="metre"&&(e.units="meter"),e.to_meter=t.conversion_factor),e}function ls(t){return typeof t=="object"?t.value*t.unit.conversion_factor:t}function fs(t,e){t.ellipsoid.radius?(e.a=t.ellipsoid.radius,e.rf=0):(e.a=ls(t.ellipsoid.semi_major_axis),t.ellipsoid.inverse_flattening!==void 0?e.rf=t.ellipsoid.inverse_flattening:t.ellipsoid.semi_major_axis!==void 0&&t.ellipsoid.semi_minor_axis!==void 0&&(e.rf=e.a/(e.a-ls(t.ellipsoid.semi_minor_axis))))}function Me(t,e={}){return!t||typeof t!="object"?t:t.type==="BoundCRS"?(Me(t.source_crs,e),t.transformation&&(t.transformation.method&&t.transformation.method.name==="NTv2"?e.nadgrids=t.transformation.parameters[0].value:e.datum_params=t.transformation.parameters.map(i=>i.value)),e):(Object.keys(t).forEach(i=>{const s=t[i];if(s!==null)switch(i){case"name":if(e.srsCode)break;e.name=s,e.srsCode=s;break;case"type":s==="GeographicCRS"?e.projName="longlat":s==="GeodeticCRS"?t.coordinate_system&&t.coordinate_system.subtype==="Cartesian"?e.projName="geocent":e.projName="longlat":s==="ProjectedCRS"&&t.conversion&&t.conversion.method&&(e.projName=t.conversion.method.name);break;case"datum":case"datum_ensemble":s.ellipsoid&&(e.ellps=s.ellipsoid.name,fs(s,e)),s.prime_meridian&&(e.from_greenwich=s.prime_meridian.longitude*Math.PI/180);break;case"ellipsoid":e.ellps=s.name,fs(s,e);break;case"prime_meridian":e.long0=(s.longitude||0)*Math.PI/180;break;case"coordinate_system":if(s.axis){const a={east:"e",north:"n",west:"w",south:"s",up:"u",down:"d",geocentricx:"e",geocentricy:"n",geocentricz:"u"},r=s.axis.map(o=>a[o.direction.toLowerCase()]);if(r.every(Boolean)&&(e.axis=r.join(""),e.axis.length===2&&(e.axis+="u")),s.unit){const{units:o,to_meter:n}=hs(s.unit);e.units=o,e.to_meter=n}else if(s.axis[0]&&s.axis[0].unit){const{units:o,to_meter:n}=hs(s.axis[0].unit);e.units=o,e.to_meter=n}}break;case"id":s.authority&&s.code&&(e.title=s.authority+":"+s.code);break;case"conversion":s.method&&s.method.name&&(e.projName=s.method.name),s.parameters&&s.parameters.forEach(a=>{const r=a.name.toLowerCase().replace(/\s+/g,"_"),o=a.value;a.unit&&a.unit.conversion_factor?e[r]=o*a.unit.conversion_factor:a.unit==="degree"?e[r]=o*Math.PI/180:e[r]=o});break;case"unit":s.name&&(e.units=s.name.toLowerCase(),e.units==="metre"&&(e.units="meter")),s.conversion_factor&&(e.to_meter=s.conversion_factor);break;case"base_crs":Me(s,e),e.datumCode=s.id?s.id.authority+"_"+s.id.code:s.name;break}}),e.latitude_of_false_origin!==void 0&&(e.lat0=e.latitude_of_false_origin),e.longitude_of_false_origin!==void 0&&(e.long0=e.longitude_of_false_origin),e.latitude_of_standard_parallel!==void 0&&(e.lat0=e.latitude_of_standard_parallel,e.lat1=e.latitude_of_standard_parallel),e.latitude_of_1st_standard_parallel!==void 0&&(e.lat1=e.latitude_of_1st_standard_parallel),e.latitude_of_2nd_standard_parallel!==void 0&&(e.lat2=e.latitude_of_2nd_standard_parallel),e.latitude_of_projection_centre!==void 0&&(e.lat0=e.latitude_of_projection_centre),e.longitude_of_projection_centre!==void 0&&(e.longc=e.longitude_of_projection_centre),e.easting_at_false_origin!==void 0&&(e.x0=e.easting_at_false_origin),e.northing_at_false_origin!==void 0&&(e.y0=e.northing_at_false_origin),e.latitude_of_natural_origin!==void 0&&(e.lat0=e.latitude_of_natural_origin),e.longitude_of_natural_origin!==void 0&&(e.long0=e.longitude_of_natural_origin),e.longitude_of_origin!==void 0&&(e.long0=e.longitude_of_origin),e.false_easting!==void 0&&(e.x0=e.false_easting),e.easting_at_projection_centre&&(e.x0=e.easting_at_projection_centre),e.false_northing!==void 0&&(e.y0=e.false_northing),e.northing_at_projection_centre&&(e.y0=e.northing_at_projection_centre),e.standard_parallel_1!==void 0&&(e.lat1=e.standard_parallel_1),e.standard_parallel_2!==void 0&&(e.lat2=e.standard_parallel_2),e.scale_factor_at_natural_origin!==void 0&&(e.k0=e.scale_factor_at_natural_origin),e.scale_factor_at_projection_centre!==void 0&&(e.k0=e.scale_factor_at_projection_centre),e.scale_factor_on_pseudo_standard_parallel!==void 0&&(e.k0=e.scale_factor_on_pseudo_standard_parallel),e.azimuth!==void 0&&(e.alpha=e.azimuth),e.azimuth_at_projection_centre!==void 0&&(e.alpha=e.azimuth_at_projection_centre),e.angle_from_rectified_to_skew_grid&&(e.rectified_grid_angle=e.angle_from_rectified_to_skew_grid),os(e),e)}var Ar=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function Ir(t,e){var i=e[0],s=e[1];!(i in t)&&s in t&&(t[i]=t[s],e.length===3&&(t[i]=e[2](t[i])))}function us(t){for(var e=Object.keys(t),i=0,s=e.length;i<s;++i){var a=e[i];Ar.indexOf(a)!==-1&&Nr(t[a]),typeof t[a]=="object"&&us(t[a])}}function Nr(t){if(t.AUTHORITY){var e=Object.keys(t.AUTHORITY)[0];e&&e in t.AUTHORITY&&(t.title=e+":"+t.AUTHORITY[e])}if(t.type==="GEOGCS"?t.projName="longlat":t.type==="LOCAL_CS"?(t.projName="identity",t.local=!0):typeof t.PROJECTION=="object"?t.projName=Object.keys(t.PROJECTION)[0]:t.projName=t.PROJECTION,t.AXIS){for(var i="",s=0,a=t.AXIS.length;s<a;++s){var r=[t.AXIS[s][0].toLowerCase(),t.AXIS[s][1].toLowerCase()];r[0].indexOf("north")!==-1||(r[0]==="y"||r[0]==="lat")&&r[1]==="north"?i+="n":r[0].indexOf("south")!==-1||(r[0]==="y"||r[0]==="lat")&&r[1]==="south"?i+="s":r[0].indexOf("east")!==-1||(r[0]==="x"||r[0]==="lon")&&r[1]==="east"?i+="e":(r[0].indexOf("west")!==-1||(r[0]==="x"||r[0]==="lon")&&r[1]==="west")&&(i+="w")}i.length===2&&(i+="u"),i.length===3&&(t.axis=i)}t.UNIT&&(t.units=t.UNIT.name.toLowerCase(),t.units==="metre"&&(t.units="meter"),t.UNIT.convert&&(t.type==="GEOGCS"?t.DATUM&&t.DATUM.SPHEROID&&(t.to_meter=t.UNIT.convert*t.DATUM.SPHEROID.a):t.to_meter=t.UNIT.convert));var o=t.GEOGCS;t.type==="GEOGCS"&&(o=t),o&&(o.DATUM?t.datumCode=o.DATUM.name.toLowerCase():t.datumCode=o.name.toLowerCase(),t.datumCode.slice(0,2)==="d_"&&(t.datumCode=t.datumCode.slice(2)),t.datumCode==="new_zealand_1949"&&(t.datumCode="nzgd49"),(t.datumCode==="wgs_1984"||t.datumCode==="world_geodetic_system_1984")&&(t.PROJECTION==="Mercator_Auxiliary_Sphere"&&(t.sphere=!0),t.datumCode="wgs84"),t.datumCode==="belge_1972"&&(t.datumCode="rnb72"),o.DATUM&&o.DATUM.SPHEROID&&(t.ellps=o.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),t.ellps.toLowerCase().slice(0,13)==="international"&&(t.ellps="intl"),t.a=o.DATUM.SPHEROID.a,t.rf=parseFloat(o.DATUM.SPHEROID.rf)),o.DATUM&&o.DATUM.TOWGS84&&(t.datum_params=o.DATUM.TOWGS84),~t.datumCode.indexOf("osgb_1936")&&(t.datumCode="osgb36"),~t.datumCode.indexOf("osni_1952")&&(t.datumCode="osni52"),(~t.datumCode.indexOf("tm65")||~t.datumCode.indexOf("geodetic_datum_of_1965"))&&(t.datumCode="ire65"),t.datumCode==="ch1903+"&&(t.datumCode="ch1903"),~t.datumCode.indexOf("israel")&&(t.datumCode="isr93")),t.b&&!isFinite(t.b)&&(t.b=t.a),t.rectified_grid_angle&&(t.rectified_grid_angle=Y(t.rectified_grid_angle));function n(c){var u=t.to_meter||1;return c*u}var h=function(c){return Ir(t,c)},l=[["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",Y],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",Y],["x0","false_easting",n],["y0","false_northing",n],["long0","central_meridian",Y],["lat0","latitude_of_origin",Y],["lat0","standard_parallel_1",Y],["lat1","standard_parallel_1",Y],["lat2","standard_parallel_2",Y],["azimuth","Azimuth"],["alpha","azimuth",Y],["srsCode","name"]];l.forEach(h),os(t)}function xe(t){if(typeof t=="object")return Me(t);const e=br(t);var i=Pr(t);if(e==="WKT2"){const r=Er(i);return Me(r)}var s=i[0],a={};return wt(i,a),us(a),a[s]}function U(t){var e=this;if(arguments.length===2){var i=arguments[1];typeof i=="string"?i.charAt(0)==="+"?U[t]=ti(arguments[1]):U[t]=xe(arguments[1]):i&&typeof i=="object"&&!("projName"in i)?U[t]=xe(arguments[1]):(U[t]=i,i||delete U[t])}else if(arguments.length===1){if(Array.isArray(t))return t.map(function(s){return Array.isArray(s)?U.apply(e,s):U(s)});if(typeof t=="string"){if(t in U)return U[t]}else"EPSG"in t?U["EPSG:"+t.EPSG]=t:"ESRI"in t?U["ESRI:"+t.ESRI]=t:"IAU2000"in t?U["IAU2000:"+t.IAU2000]=t:console.log(t);return}}Dt(U);function Tr(t){return typeof t=="string"}function Rr(t){return t in U}function Cr(t){return t.indexOf("+")!==0&&t.indexOf("[")!==-1||typeof t=="object"&&!("srsCode"in t)}var cs=["3857","900913","3785","102113"];function Fr(t){if(t.title)return t.title.toLowerCase().indexOf("epsg:")===0&&cs.indexOf(t.title.substr(5))>-1;var e=rt(t,"authority");if(e){var i=rt(e,"epsg");return i&&cs.indexOf(i)>-1}}function Or(t){var e=rt(t,"extension");if(e)return rt(e,"proj4")}function Lr(t){return t[0]==="+"}function kr(t){let e;if(Tr(t))if(Rr(t))e=U[t];else if(Cr(t)){e=xe(t);var i=Or(e);i&&(e=ti(i))}else Lr(t)&&(e=ti(t));else"projName"in t?e=t:e=xe(t);return e&&Fr(e)?U["EPSG:3857"]:e}function gs(t,e){t=t||{};var i,s;if(!e)return t;for(s in e)i=e[s],i!==void 0&&(t[s]=i);return t}function it(t,e,i){var s=t*e;return i/Math.sqrt(1-s*s)}function Wt(t){return t<0?-1:1}function E(t,e){return e||Math.abs(t)<=O?t:t-Wt(t)*$t}function tt(t,e,i){var s=t*i,a=.5*t;return s=Math.pow((1-s)/(1+s),a),Math.tan(.5*(v-e))/s}function Ht(t,e){for(var i=.5*t,s,a,r=v-2*Math.atan(e),o=0;o<=15;o++)if(s=t*Math.sin(r),a=v-2*Math.atan(e*Math.pow((1-s)/(1+s),i))-r,r+=a,Math.abs(a)<=1e-10)return r;return-9999}function Ur(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=it(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function zr(t){var e=t.x,i=t.y;if(i*W>90&&i*W<-90&&e*W>180&&e*W<-180)return null;var s,a;if(Math.abs(Math.abs(i)-v)<=x)return null;if(this.sphere)s=this.x0+this.a*this.k0*E(e-this.long0,this.over),a=this.y0+this.a*this.k0*Math.log(Math.tan(A+.5*i));else{var r=Math.sin(i),o=tt(this.e,i,r);s=this.x0+this.a*this.k0*E(e-this.long0,this.over),a=this.y0-this.a*this.k0*Math.log(o)}return t.x=s,t.y=a,t}function qr(t){var e=t.x-this.x0,i=t.y-this.y0,s,a;if(this.sphere)a=v-2*Math.atan(Math.exp(-i/(this.a*this.k0)));else{var r=Math.exp(-i/(this.a*this.k0));if(a=Ht(this.e,r),a===-9999)return null}return s=E(this.long0+e/(this.a*this.k0),this.over),t.x=s,t.y=a,t}var Dr=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","Mercator_Variant_A","merc"];const Br={init:Ur,forward:zr,inverse:qr,names:Dr};function $r(){}function ms(t){return t}var _s=["longlat","identity"],jr=[Br,{init:$r,forward:ms,inverse:ms,names:_s}],vt={},Pt=[];function ds(t,e){var i=Pt.length;return t.names?(Pt[i]=t,t.names.forEach(function(s){vt[s.toLowerCase()]=i}),this):(console.log(e),!0)}function vs(t){return t.replace(/[-\(\)\s]+/g," ").trim().replace(/ /g,"_")}function Wr(t){if(!t)return!1;var e=t.toLowerCase();if(typeof vt[e]<"u"&&Pt[vt[e]]||(e=vs(e),e in vt&&Pt[vt[e]]))return Pt[vt[e]]}function Hr(){jr.forEach(ds)}const Vr={start:Hr,add:ds,get:Wr};var ys={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},andrae:{a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},clrk80:{a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:63558348467e-4,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"},WGS84:{a:6378137,rf:298.257223563,ellipseName:"WGS 84"},sphere:{a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}};const Qr=ys.WGS84;function Xr(t,e,i,s){var a=t*t,r=e*e,o=(a-r)/a,n=0;s?(t*=1-o*(mr+o*(_r+o*dr)),a=t*t,o=0):n=Math.sqrt(o);var h=(a-r)/r;return{es:o,e:n,ep2:h}}function Kr(t,e,i,s,a){if(!t){var r=rt(ys,s);r||(r=Qr),t=r.a,e=r.b,i=r.rf}return i&&!e&&(e=(1-1/i)*t),(i===0||Math.abs(t-e)<x)&&(a=!0,e=t),{a:t,b:e,rf:i,sphere:a}}var Ee={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.005693,-0.044698,0.044285,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,-0.395026,0.330772,-1.876073,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.243648,-1.158828,-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,6.681627,-31.611492,-19.848161,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,-0.008393,0.000749,-0.010276,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,0.02579,0.00965,0.01166,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:"0.06155,-0.01087,-0.04019,0.039492,0.032722,0.032898,-0.009994"},EPSG_4317:{towgs84:"2.3287,-147.0425,-92.0802,-0.309248,0.324822,0.497299,5.689063"},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:"372.87,149.23,585.29"},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"},EPSG_10328:{towgs84:"0,0,0"},EPSG_9782:{towgs84:"0,0,0"},EPSG_9777:{towgs84:"0,0,0"},EPSG_10690:{towgs84:"0,0,0"},EPSG_10639:{towgs84:"0,0,0"},EPSG_10739:{towgs84:"0,0,0"},EPSG_7686:{towgs84:"0,0,0"},EPSG_8900:{towgs84:"0,0,0"},EPSG_5886:{towgs84:"0,0,0"},EPSG_7683:{towgs84:"0,0,0"},EPSG_6668:{towgs84:"0,0,0"},EPSG_20046:{towgs84:"0,0,0"},EPSG_10299:{towgs84:"0,0,0"},EPSG_10310:{towgs84:"0,0,0"},EPSG_10475:{towgs84:"0,0,0"},EPSG_4742:{towgs84:"0,0,0"},EPSG_10671:{towgs84:"0,0,0"},EPSG_10762:{towgs84:"0,0,0"},EPSG_10725:{towgs84:"0,0,0"},EPSG_10791:{towgs84:"0,0,0"},EPSG_10800:{towgs84:"0,0,0"},EPSG_10305:{towgs84:"0,0,0"},EPSG_10941:{towgs84:"0,0,0"},EPSG_10968:{towgs84:"0,0,0"},EPSG_10875:{towgs84:"0,0,0"},EPSG_6318:{towgs84:"0,0,0"},EPSG_10910:{towgs84:"0,0,0"}};for(var Zr in Ee){var si=Ee[Zr];si.datumName&&(Ee[si.datumName]=si)}function Jr(t,e,i,s,a,r,o){var n={};return t===void 0||t==="none"?n.datum_type=Ye:n.datum_type=cr,e&&(n.datum_params=e.map(parseFloat),(n.datum_params[0]!==0||n.datum_params[1]!==0||n.datum_params[2]!==0)&&(n.datum_type=J),n.datum_params.length>3&&(n.datum_params[3]!==0||n.datum_params[4]!==0||n.datum_params[5]!==0||n.datum_params[6]!==0)&&(n.datum_type=dt,n.datum_params[3]*=Bt,n.datum_params[4]*=Bt,n.datum_params[5]*=Bt,n.datum_params[6]=n.datum_params[6]/1e6+1)),o&&(n.datum_type=pt,n.grids=o),n.a=i,n.b=s,n.es=a,n.ep2=r,n}var ai={};function Yr(t,e,i){return e instanceof ArrayBuffer?tn(t,e,i):{ready:en(t,e)}}function tn(t,e,i){var s=!0;i!==void 0&&i.includeErrorFields===!1&&(s=!1);var a=new DataView(e),r=rn(a),o=nn(a,r),n=on(a,o,r,s),h={header:o,subgrids:n};return ai[t]=h,h}async function en(t,e){for(var i=[],s=await e.getImageCount(),a=s-1;a>=0;a--){var r=await e.getImage(a),o=await r.readRasters(),n=o,h=[r.getWidth(),r.getHeight()],l=r.getBoundingBox().map(Ms),c=[r.fileDirectory.ModelPixelScale[0],r.fileDirectory.ModelPixelScale[1]].map(Ms),u=l[0]+(h[0]-1)*c[0],f=l[3]-(h[1]-1)*c[1],m=n[0],g=n[1],_=[];for(let b=h[1]-1;b>=0;b--)for(let M=h[0]-1;M>=0;M--){var d=b*h[0]+M;_.push([-nt(g[d]),nt(m[d])])}i.push({del:c,lim:h,ll:[-u,f],cvs:_})}var y={header:{nSubgrids:s},subgrids:i};return ai[t]=y,y}function sn(t){if(t===void 0)return null;var e=t.split(",");return e.map(an)}function an(t){if(t.length===0)return null;var e=t[0]==="@";return e&&(t=t.slice(1)),t==="null"?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:t,mandatory:!e,grid:ai[t]||null,isNull:!1}}function Ms(t){return t*Math.PI/180}function nt(t){return t/3600*Math.PI/180}function rn(t){var e=t.getInt32(8,!1);return e===11?!1:(e=t.getInt32(8,!0),e!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function nn(t,e){return{nFields:t.getInt32(8,e),nSubgridFields:t.getInt32(24,e),nSubgrids:t.getInt32(40,e),shiftType:ri(t,56,64).trim(),fromSemiMajorAxis:t.getFloat64(120,e),fromSemiMinorAxis:t.getFloat64(136,e),toSemiMajorAxis:t.getFloat64(152,e),toSemiMinorAxis:t.getFloat64(168,e)}}function ri(t,e,i){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(e,i)))}function on(t,e,i,s){for(var a=176,r=[],o=0;o<e.nSubgrids;o++){var n=ln(t,a,i),h=fn(t,a,n,i,s),l=Math.round(1+(n.upperLongitude-n.lowerLongitude)/n.longitudeInterval),c=Math.round(1+(n.upperLatitude-n.lowerLatitude)/n.latitudeInterval);r.push({ll:[nt(n.lowerLongitude),nt(n.lowerLatitude)],del:[nt(n.longitudeInterval),nt(n.latitudeInterval)],lim:[l,c],count:n.gridNodeCount,cvs:hn(h)});var u=16;s===!1&&(u=8),a+=176+n.gridNodeCount*u}return r}function hn(t){return t.map(function(e){return[nt(e.longitudeShift),nt(e.latitudeShift)]})}function ln(t,e,i){return{name:ri(t,e+8,e+16).trim(),parent:ri(t,e+24,e+24+8).trim(),lowerLatitude:t.getFloat64(e+72,i),upperLatitude:t.getFloat64(e+88,i),lowerLongitude:t.getFloat64(e+104,i),upperLongitude:t.getFloat64(e+120,i),latitudeInterval:t.getFloat64(e+136,i),longitudeInterval:t.getFloat64(e+152,i),gridNodeCount:t.getInt32(e+168,i)}}function fn(t,e,i,s,a){var r=e+176,o=16;a===!1&&(o=8);for(var n=[],h=0;h<i.gridNodeCount;h++){var l={latitudeShift:t.getFloat32(r+h*o,s),longitudeShift:t.getFloat32(r+h*o+4,s)};a!==!1&&(l.latitudeAccuracy=t.getFloat32(r+h*o+8,s),l.longitudeAccuracy=t.getFloat32(r+h*o+12,s)),n.push(l)}return n}function X(t,e){if(!(this instanceof X))return new X(t);this.forward=null,this.inverse=null,this.init=null,this.name,this.names=null,this.title,e=e||function(l){if(l)throw l};var i=kr(t);if(typeof i!="object"){e("Could not parse to valid json: "+t);return}var s=X.projections.get(i.projName);if(!s){e("Could not get projection name from: "+t);return}if(i.datumCode&&i.datumCode!=="none"){var a=rt(Ee,i.datumCode);a&&(i.datum_params=i.datum_params||(a.towgs84?a.towgs84.split(","):null),i.ellps=a.ellipse,i.datumName=a.datumName?a.datumName:i.datumCode)}i.k0=i.k0||1,i.axis=i.axis||"enu",i.ellps=i.ellps||"wgs84",i.lat1=i.lat1||i.lat0;var r=Kr(i.a,i.b,i.rf,i.ellps,i.sphere),o=Xr(r.a,r.b,r.rf,i.R_A),n=sn(i.nadgrids),h=i.datum||Jr(i.datumCode,i.datum_params,r.a,r.b,o.es,o.ep2,n);gs(this,i),gs(this,s),this.a=r.a,this.b=r.b,this.rf=r.rf,this.sphere=r.sphere,this.es=o.es,this.e=o.e,this.ep2=o.ep2,this.datum=h,"init"in this&&typeof this.init=="function"&&this.init(),e(null,this)}X.projections=Vr,X.projections.start();function un(t,e){return t.datum_type!==e.datum_type||t.a!==e.a||Math.abs(t.es-e.es)>5e-11?!1:t.datum_type===J?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:t.datum_type===dt?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6]:!0}function xs(t,e,i){var s=t.x,a=t.y,r=t.z?t.z:0,o,n,h,l;if(a<-v&&a>-1.001*v)a=-v;else if(a>v&&a<1.001*v)a=v;else{if(a<-v)return{x:-1/0,y:-1/0,z:t.z};if(a>v)return{x:1/0,y:1/0,z:t.z}}return s>Math.PI&&(s-=2*Math.PI),n=Math.sin(a),l=Math.cos(a),h=n*n,o=i/Math.sqrt(1-e*h),{x:(o+r)*l*Math.cos(s),y:(o+r)*l*Math.sin(s),z:(o*(1-e)+r)*n}}function Es(t,e,i,s){var a=1e-12,r=a*a,o=30,n,h,l,c,u,f,m,g,_,d,y,b,M,S=t.x,w=t.y,P=t.z?t.z:0,G,D,k;if(n=Math.sqrt(S*S+w*w),h=Math.sqrt(S*S+w*w+P*P),n/i<a){if(G=0,h/i<a)return D=v,k=-s,{x:t.x,y:t.y,z:t.z}}else G=Math.atan2(w,S);l=P/h,c=n/h,u=1/Math.sqrt(1-e*(2-e)*c*c),g=c*(1-e)*u,_=l*u,M=0;do M++,m=i/Math.sqrt(1-e*_*_),k=n*g+P*_-m*(1-e*_*_),f=e*m/(m+k),u=1/Math.sqrt(1-f*(2-f)*c*c),d=c*(1-f)*u,y=l*u,b=y*g-d*_,g=d,_=y;while(b*b>r&&M<o);return D=Math.atan(y/Math.abs(d)),{x:G,y:D,z:k}}function cn(t,e,i){if(e===J)return{x:t.x+i[0],y:t.y+i[1],z:t.z+i[2]};if(e===dt){var s=i[0],a=i[1],r=i[2],o=i[3],n=i[4],h=i[5],l=i[6];return{x:l*(t.x-h*t.y+n*t.z)+s,y:l*(h*t.x+t.y-o*t.z)+a,z:l*(-n*t.x+o*t.y+t.z)+r}}}function gn(t,e,i){if(e===J)return{x:t.x-i[0],y:t.y-i[1],z:t.z-i[2]};if(e===dt){var s=i[0],a=i[1],r=i[2],o=i[3],n=i[4],h=i[5],l=i[6],c=(t.x-s)/l,u=(t.y-a)/l,f=(t.z-r)/l;return{x:c+h*u-n*f,y:-h*c+u+o*f,z:n*c-o*u+f}}}function be(t){return t===J||t===dt}function mn(t,e,i){if(un(t,e)||t.datum_type===Ye||e.datum_type===Ye)return i;var s=t.a,a=t.es;if(t.datum_type===pt){var r=bs(t,!1,i);if(r!==0)return;s=Yi,a=ts}var o=e.a,n=e.b,h=e.es;if(e.datum_type===pt&&(o=Yi,n=gr,h=ts),a===h&&s===o&&!be(t.datum_type)&&!be(e.datum_type))return i;if(i=xs(i,a,s),be(t.datum_type)&&(i=cn(i,t.datum_type,t.datum_params)),be(e.datum_type)&&(i=gn(i,e.datum_type,e.datum_params)),i=Es(i,h,o,n),e.datum_type===pt){var l=bs(e,!0,i);if(l!==0)return}return i}function bs(t,e,i){if(t.grids===null||t.grids.length===0)return console.log("Grid shift grids not found"),-1;var s={x:-i.x,y:i.y},a={x:Number.NaN,y:Number.NaN},r=[];t:for(var o=0;o<t.grids.length;o++){var n=t.grids[o];if(r.push(n.name),n.isNull){a=s;break}if(n.grid===null){if(n.mandatory)return console.log("Unable to find mandatory grid '"+n.name+"'"),-1;continue}for(var h=n.grid.subgrids,l=0,c=h.length;l<c;l++){var u=h[l],f=(Math.abs(u.del[1])+Math.abs(u.del[0]))/1e4,m=u.ll[0]-f,g=u.ll[1]-f,_=u.ll[0]+(u.lim[0]-1)*u.del[0]+f,d=u.ll[1]+(u.lim[1]-1)*u.del[1]+f;if(!(g>s.y||m>s.x||d<s.y||_<s.x)&&(a=_n(s,e,u),!isNaN(a.x)))break t}}return isNaN(a.x)?(console.log("Failed to find a grid shift table for location '"+-s.x*W+" "+s.y*W+" tried: '"+r+"'"),-1):(i.x=-a.x,i.y=a.y,0)}function _n(t,e,i){var s={x:Number.NaN,y:Number.NaN};if(isNaN(t.x))return s;var a={x:t.x,y:t.y};a.x-=i.ll[0],a.y-=i.ll[1],a.x=E(a.x-Math.PI)+Math.PI;var r=Ss(a,i);if(e){if(isNaN(r.x))return s;r.x=a.x-r.x,r.y=a.y-r.y;var o=9,n=1e-12,h,l;do{if(l=Ss(r,i),isNaN(l.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}h={x:a.x-(l.x+r.x),y:a.y-(l.y+r.y)},r.x+=h.x,r.y+=h.y}while(o--&&Math.abs(h.x)>n&&Math.abs(h.y)>n);if(o<0)return console.log("Inverse grid shift iterator failed to converge."),s;s.x=E(r.x+i.ll[0]),s.y=r.y+i.ll[1]}else isNaN(r.x)||(s.x=t.x+r.x,s.y=t.y+r.y);return s}function Ss(t,e){var i={x:t.x/e.del[0],y:t.y/e.del[1]},s={x:Math.floor(i.x),y:Math.floor(i.y)},a={x:i.x-1*s.x,y:i.y-1*s.y},r={x:Number.NaN,y:Number.NaN},o;if(s.x<0||s.x>=e.lim[0]||s.y<0||s.y>=e.lim[1])return r;o=s.y*e.lim[0]+s.x;var n={x:e.cvs[o][0],y:e.cvs[o][1]};o++;var h={x:e.cvs[o][0],y:e.cvs[o][1]};o+=e.lim[0];var l={x:e.cvs[o][0],y:e.cvs[o][1]};o--;var c={x:e.cvs[o][0],y:e.cvs[o][1]},u=a.x*a.y,f=a.x*(1-a.y),m=(1-a.x)*(1-a.y),g=(1-a.x)*a.y;return r.x=m*n.x+f*h.x+g*c.x+u*l.x,r.y=m*n.y+f*h.y+g*c.y+u*l.y,r}function ps(t,e,i){var s=i.x,a=i.y,r=i.z||0,o,n,h,l={};for(h=0;h<3;h++)if(!(e&&h===2&&i.z===void 0))switch(h===0?(o=s,"ew".indexOf(t.axis[h])!==-1?n="x":n="y"):h===1?(o=a,"ns".indexOf(t.axis[h])!==-1?n="y":n="x"):(o=r,n="z"),t.axis[h]){case"e":l[n]=o;break;case"w":l[n]=-o;break;case"n":l[n]=o;break;case"s":l[n]=-o;break;case"u":i[n]!==void 0&&(l.z=o);break;case"d":i[n]!==void 0&&(l.z=-o);break;default:return null}return l}function ws(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e}function dn(t){Ps(t.x),Ps(t.y)}function Ps(t){if(typeof Number.isFinite=="function"){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if(typeof t!="number"||t!==t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function vn(t,e){return(t.datum.datum_type===J||t.datum.datum_type===dt||t.datum.datum_type===pt)&&e.datumCode!=="WGS84"||(e.datum.datum_type===J||e.datum.datum_type===dt||e.datum.datum_type===pt)&&t.datumCode!=="WGS84"}function Se(t,e,i,s){var a;Array.isArray(i)?i=ws(i):i={x:i.x,y:i.y,z:i.z,m:i.m};var r=i.z!==void 0;if(dn(i),t.datum&&e.datum&&vn(t,e)&&(a=new X("WGS84"),i=Se(t,a,i,s),t=a),s&&t.axis!=="enu"&&(i=ps(t,!1,i)),t.projName==="longlat")i={x:i.x*F,y:i.y*F,z:i.z||0};else if(t.to_meter&&(i={x:i.x*t.to_meter,y:i.y*t.to_meter,z:i.z||0}),i=t.inverse(i),!i)return;if(t.from_greenwich&&(i.x+=t.from_greenwich),i=mn(t.datum,e.datum,i),!!i)return i=i,e.from_greenwich&&(i={x:i.x-e.from_greenwich,y:i.y,z:i.z||0}),e.projName==="longlat"?i={x:i.x*W,y:i.y*W,z:i.z||0}:(i=e.forward(i),e.to_meter&&(i={x:i.x/e.to_meter,y:i.y/e.to_meter,z:i.z||0})),s&&e.axis!=="enu"?ps(e,!0,i):(i&&!r&&delete i.z,i)}var Gs=X("WGS84");function ni(t,e,i,s){var a,r,o;return Array.isArray(i)?(a=Se(t,e,i,s)||{x:NaN,y:NaN},i.length>2?typeof t.name<"u"&&t.name==="geocent"||typeof e.name<"u"&&e.name==="geocent"?typeof a.z=="number"?[a.x,a.y,a.z].concat(i.slice(3)):[a.x,a.y,i[2]].concat(i.slice(3)):[a.x,a.y].concat(i.slice(2)):[a.x,a.y]):(r=Se(t,e,i,s),o=Object.keys(i),o.length===2||o.forEach(function(n){if(typeof t.name<"u"&&t.name==="geocent"||typeof e.name<"u"&&e.name==="geocent"){if(n==="x"||n==="y"||n==="z")return}else if(n==="x"||n==="y")return;r[n]=i[n]}),r)}function pe(t){return t instanceof X?t:typeof t=="object"&&"oProj"in t?t.oProj:X(t)}function yn(t,e,i){var s,a,r=!1,o;return typeof e>"u"?(a=pe(t),s=Gs,r=!0):(typeof e.x<"u"||Array.isArray(e))&&(i=e,a=pe(t),s=Gs,r=!0),s||(s=pe(t)),a||(a=pe(e)),i?ni(s,a,i):(o={forward:function(n,h){return ni(s,a,n,h)},inverse:function(n,h){return ni(a,s,n,h)}},r&&(o.oProj=a),o)}var As=6,Is="AJSAJS",Ns="AFAFAF",Gt=65,V=73,K=79,Vt=86,Qt=90;const Mn={forward:Ts,inverse:xn,toPoint:Rs};function Ts(t,e){return e=e||5,Sn(En({lat:t[1],lon:t[0]}),e)}function xn(t){var e=hi(Os(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat,e.lon,e.lat]:[e.left,e.bottom,e.right,e.top]}function Rs(t){var e=hi(Os(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function oi(t){return t*(Math.PI/180)}function Cs(t){return 180*(t/Math.PI)}function En(t){var e=t.lat,i=t.lon,s=6378137,a=.00669438,r=.9996,o,n,h,l,c,u,f,m=oi(e),g=oi(i),_,d;d=Math.floor((i+180)/6)+1,i===180&&(d=60),e>=56&&e<64&&i>=3&&i<12&&(d=32),e>=72&&e<84&&(i>=0&&i<9?d=31:i>=9&&i<21?d=33:i>=21&&i<33?d=35:i>=33&&i<42&&(d=37)),o=(d-1)*6-180+3,_=oi(o),n=a/(1-a),h=s/Math.sqrt(1-a*Math.sin(m)*Math.sin(m)),l=Math.tan(m)*Math.tan(m),c=n*Math.cos(m)*Math.cos(m),u=Math.cos(m)*(g-_),f=s*((1-a/4-3*a*a/64-5*a*a*a/256)*m-(3*a/8+3*a*a/32+45*a*a*a/1024)*Math.sin(2*m)+(15*a*a/256+45*a*a*a/1024)*Math.sin(4*m)-35*a*a*a/3072*Math.sin(6*m));var y=r*h*(u+(1-l+c)*u*u*u/6+(5-18*l+l*l+72*c-58*n)*u*u*u*u*u/120)+5e5,b=r*(f+h*Math.tan(m)*(u*u/2+(5-l+9*c+4*c*c)*u*u*u*u/24+(61-58*l+l*l+600*c-330*n)*u*u*u*u*u*u/720));return e<0&&(b+=1e7),{northing:Math.round(b),easting:Math.round(y),zoneNumber:d,zoneLetter:bn(e)}}function hi(t){var e=t.northing,i=t.easting,s=t.zoneLetter,a=t.zoneNumber;if(a<0||a>60)return null;var r=.9996,o=6378137,n=.00669438,h,l=(1-Math.sqrt(1-n))/(1+Math.sqrt(1-n)),c,u,f,m,g,_,d,y,b,M=i-5e5,S=e;s<"N"&&(S-=1e7),d=(a-1)*6-180+3,h=n/(1-n),_=S/r,y=_/(o*(1-n/4-3*n*n/64-5*n*n*n/256)),b=y+(3*l/2-27*l*l*l/32)*Math.sin(2*y)+(21*l*l/16-55*l*l*l*l/32)*Math.sin(4*y)+151*l*l*l/96*Math.sin(6*y),c=o/Math.sqrt(1-n*Math.sin(b)*Math.sin(b)),u=Math.tan(b)*Math.tan(b),f=h*Math.cos(b)*Math.cos(b),m=o*(1-n)/Math.pow(1-n*Math.sin(b)*Math.sin(b),1.5),g=M/(c*r);var w=b-c*Math.tan(b)/m*(g*g/2-(5+3*u+10*f-4*f*f-9*h)*g*g*g*g/24+(61+90*u+298*f+45*u*u-252*h-3*f*f)*g*g*g*g*g*g/720);w=Cs(w);var P=(g-(1+2*u+f)*g*g*g/6+(5-2*f+28*u-3*f*f+8*h+24*u*u)*g*g*g*g*g/120)/Math.cos(b);P=d+Cs(P);var G;if(t.accuracy){var D=hi({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});G={top:D.lat,right:D.lon,bottom:w,left:P}}else G={lat:w,lon:P};return G}function bn(t){var e="Z";return 84>=t&&t>=72?e="X":72>t&&t>=64?e="W":64>t&&t>=56?e="V":56>t&&t>=48?e="U":48>t&&t>=40?e="T":40>t&&t>=32?e="S":32>t&&t>=24?e="R":24>t&&t>=16?e="Q":16>t&&t>=8?e="P":8>t&&t>=0?e="N":0>t&&t>=-8?e="M":-8>t&&t>=-16?e="L":-16>t&&t>=-24?e="K":-24>t&&t>=-32?e="J":-32>t&&t>=-40?e="H":-40>t&&t>=-48?e="G":-48>t&&t>=-56?e="F":-56>t&&t>=-64?e="E":-64>t&&t>=-72?e="D":-72>t&&t>=-80&&(e="C"),e}function Sn(t,e){var i="00000"+t.easting,s="00000"+t.northing;return t.zoneNumber+t.zoneLetter+pn(t.easting,t.northing,t.zoneNumber)+i.substr(i.length-5,e)+s.substr(s.length-5,e)}function pn(t,e,i){var s=Fs(i),a=Math.floor(t/1e5),r=Math.floor(e/1e5)%20;return wn(a,r,s)}function Fs(t){var e=t%As;return e===0&&(e=As),e}function wn(t,e,i){var s=i-1,a=Is.charCodeAt(s),r=Ns.charCodeAt(s),o=a+t-1,n=r+e,h=!1;o>Qt&&(o=o-Qt+Gt-1,h=!0),(o===V||a<V&&o>V||(o>V||a<V)&&h)&&o++,(o===K||a<K&&o>K||(o>K||a<K)&&h)&&(o++,o===V&&o++),o>Qt&&(o=o-Qt+Gt-1),n>Vt?(n=n-Vt+Gt-1,h=!0):h=!1,(n===V||r<V&&n>V||(n>V||r<V)&&h)&&n++,(n===K||r<K&&n>K||(n>K||r<K)&&h)&&(n++,n===V&&n++),n>Vt&&(n=n-Vt+Gt-1);var l=String.fromCharCode(o)+String.fromCharCode(n);return l}function Os(t){if(t&&t.length===0)throw"MGRSPoint coverting from nothing";for(var e=t.length,i=null,s="",a,r=0;!/[A-Z]/.test(a=t.charAt(r));){if(r>=2)throw"MGRSPoint bad conversion from: "+t;s+=a,r++}var o=parseInt(s,10);if(r===0||r+3>e)throw"MGRSPoint bad conversion from: "+t;var n=t.charAt(r++);if(n<="A"||n==="B"||n==="Y"||n>="Z"||n==="I"||n==="O")throw"MGRSPoint zone letter "+n+" not handled: "+t;i=t.substring(r,r+=2);for(var h=Fs(o),l=Pn(i.charAt(0),h),c=Gn(i.charAt(1),h);c<An(n);)c+=2e6;var u=e-r;if(u%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`+t;var f=u/2,m=0,g=0,_,d,y,b,M;return f>0&&(_=1e5/Math.pow(10,f),d=t.substring(r,r+f),m=parseFloat(d)*_,y=t.substring(r+f),g=parseFloat(y)*_),b=m+l,M=g+c,{easting:b,northing:M,zoneLetter:n,zoneNumber:o,accuracy:_}}function Pn(t,e){for(var i=Is.charCodeAt(e-1),s=1e5,a=!1;i!==t.charCodeAt(0);){if(i++,i===V&&i++,i===K&&i++,i>Qt){if(a)throw"Bad character: "+t;i=Gt,a=!0}s+=1e5}return s}function Gn(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var i=Ns.charCodeAt(e-1),s=0,a=!1;i!==t.charCodeAt(0);){if(i++,i===V&&i++,i===K&&i++,i>Vt){if(a)throw"Bad character: "+t;i=Gt,a=!0}s+=1e5}return s}function An(t){var e;switch(t){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+t}function At(t,e,i){if(!(this instanceof At))return new At(t,e,i);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if(typeof t=="object")this.x=t.x,this.y=t.y,this.z=t.z||0;else if(typeof t=="string"&&typeof e>"u"){var s=t.split(",");this.x=parseFloat(s[0]),this.y=parseFloat(s[1]),this.z=parseFloat(s[2])||0}else this.x=t,this.y=e,this.z=i||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}At.fromMGRS=function(t){return new At(Rs(t))},At.prototype.toMGRS=function(t){return Ts([this.x,this.y],t)};var In=1,Nn=.25,Ls=.046875,ks=.01953125,Us=.01068115234375,Tn=.75,Rn=.46875,Cn=.013020833333333334,Fn=.007120768229166667,On=.3645833333333333,Ln=.005696614583333333,kn=.3076171875;function li(t){var e=[];e[0]=In-t*(Nn+t*(Ls+t*(ks+t*Us))),e[1]=t*(Tn-t*(Ls+t*(ks+t*Us)));var i=t*t;return e[2]=i*(Rn-t*(Cn+t*Fn)),i*=t,e[3]=i*(On-t*Ln),e[4]=i*t*kn,e}function It(t,e,i,s){return i*=e,e*=e,s[0]*t-i*(s[1]+e*(s[2]+e*(s[3]+e*s[4])))}var Un=20;function fi(t,e,i){for(var s=1/(1-e),a=t,r=Un;r;--r){var o=Math.sin(a),n=1-e*o*o;if(n=(It(a,o,Math.cos(a),i)-t)*(n*Math.sqrt(n))*s,a-=n,Math.abs(n)<x)return a}return a}function zn(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.es&&(this.en=li(this.es),this.ml0=It(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function qn(t){var e=t.x,i=t.y,s=E(e-this.long0,this.over),a,r,o,n=Math.sin(i),h=Math.cos(i);if(this.es){var c=h*s,u=Math.pow(c,2),f=this.ep2*Math.pow(h,2),m=Math.pow(f,2),g=Math.abs(h)>x?Math.tan(i):0,_=Math.pow(g,2),d=Math.pow(_,2);a=1-this.es*Math.pow(n,2),c=c/Math.sqrt(a);var y=It(i,n,h,this.en);r=this.a*(this.k0*c*(1+u/6*(1-_+f+u/20*(5-18*_+d+14*f-58*_*f+u/42*(61+179*d-d*_-479*_)))))+this.x0,o=this.a*(this.k0*(y-this.ml0+n*s*c/2*(1+u/12*(5-_+9*f+4*m+u/30*(61+d-58*_+270*f-330*_*f+u/56*(1385+543*d-d*_-3111*_))))))+this.y0}else{var l=h*Math.sin(s);if(Math.abs(Math.abs(l)-1)<x)return 93;if(r=.5*this.a*this.k0*Math.log((1+l)/(1-l))+this.x0,o=h*Math.cos(s)/Math.sqrt(1-Math.pow(l,2)),l=Math.abs(o),l>=1){if(l-1>x)return 93;o=0}else o=Math.acos(o);i<0&&(o=-o),o=this.a*this.k0*(o-this.lat0)+this.y0}return t.x=r,t.y=o,t}function Dn(t){var e,i,s,a,r=(t.x-this.x0)*(1/this.a),o=(t.y-this.y0)*(1/this.a);if(this.es)if(e=this.ml0+o/this.k0,i=fi(e,this.es,this.en),Math.abs(i)<v){var u=Math.sin(i),f=Math.cos(i),m=Math.abs(f)>x?Math.tan(i):0,g=this.ep2*Math.pow(f,2),_=Math.pow(g,2),d=Math.pow(m,2),y=Math.pow(d,2);e=1-this.es*Math.pow(u,2);var b=r*Math.sqrt(e)/this.k0,M=Math.pow(b,2);e=e*m,s=i-e*M/(1-this.es)*.5*(1-M/12*(5+3*d-9*g*d+g-4*_-M/30*(61+90*d-252*g*d+45*y+46*g-M/56*(1385+3633*d+4095*y+1574*y*d)))),a=E(this.long0+b*(1-M/6*(1+2*d+g-M/20*(5+28*d+24*y+8*g*d+6*g-M/42*(61+662*d+1320*y+720*y*d))))/f,this.over)}else s=v*Wt(o),a=0;else{var n=Math.exp(r/this.k0),h=.5*(n-1/n),l=this.lat0+o/this.k0,c=Math.cos(l);e=Math.sqrt((1-Math.pow(c,2))/(1+Math.pow(h,2))),s=Math.asin(e),o<0&&(s=-s),h===0&&c===0?a=0:a=E(Math.atan2(h,c)+this.long0,this.over)}return t.x=a,t.y=s,t}var Bn=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const we={init:zn,forward:qn,inverse:Dn,names:Bn};function zs(t){var e=Math.exp(t);return e=(e-1/e)/2,e}function Q(t,e){t=Math.abs(t),e=Math.abs(e);var i=Math.max(t,e),s=Math.min(t,e)/(i||1);return i*Math.sqrt(1+Math.pow(s,2))}function $n(t){var e=1+t,i=e-1;return i===0?t:t*Math.log(e)/i}function jn(t){var e=Math.abs(t);return e=$n(e*(1+e/(Q(1,e)+1))),t<0?-e:e}function ui(t,e){for(var i=2*Math.cos(2*e),s=t.length-1,a=t[s],r=0,o;--s>=0;)o=-r+i*a+t[s],r=a,a=o;return e+o*Math.sin(2*e)}function Wn(t,e){for(var i=2*Math.cos(e),s=t.length-1,a=t[s],r=0,o;--s>=0;)o=-r+i*a+t[s],r=a,a=o;return Math.sin(e)*o}function Hn(t){var e=Math.exp(t);return e=(e+1/e)/2,e}function qs(t,e,i){for(var s=Math.sin(e),a=Math.cos(e),r=zs(i),o=Hn(i),n=2*a*o,h=-2*s*r,l=t.length-1,c=t[l],u=0,f=0,m=0,g,_;--l>=0;)g=f,_=u,f=c,u=m,c=-g+n*f-h*u+t[l],m=-_+h*f+n*u;return n=s*o,h=a*r,[n*c-h*m,n*m+h*c]}function Vn(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(we.init.apply(this),this.forward=we.forward,this.inverse=we.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),e=t/(2-t),i=e;this.cgb[0]=e*(2+e*(-2/3+e*(-2+e*(116/45+e*(26/45+e*(-2854/675)))))),this.cbg[0]=e*(-2+e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))),i=i*e,this.cgb[1]=i*(7/3+e*(-8/5+e*(-227/45+e*(2704/315+e*(2323/945))))),this.cbg[1]=i*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),i=i*e,this.cgb[2]=i*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=i*(-26/15+e*(34/21+e*(8/5+e*(-12686/2835)))),i=i*e,this.cgb[3]=i*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=i*(1237/630+e*(-12/5+e*(-24832/14175))),i=i*e,this.cgb[4]=i*(4174/315+e*(-144838/6237)),this.cbg[4]=i*(-734/315+e*(109598/31185)),i=i*e,this.cgb[5]=i*(601676/22275),this.cbg[5]=i*(444337/155925),i=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+i*(1/4+i*(1/64+i/256))),this.utg[0]=e*(-.5+e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=i*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=i*(13/48+e*(-3/5+e*(557/1440+e*(281/630+e*(-1983433/1935360))))),i=i*e,this.utg[2]=i*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=i*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),i=i*e,this.utg[3]=i*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=i*(49561/161280+e*(-179/168+e*(6601661/7257600))),i=i*e,this.utg[4]=i*(-4583/161280+e*(108847/3991680)),this.gtu[4]=i*(34729/80640+e*(-3418889/1995840)),i=i*e,this.utg[5]=i*(-20648693/638668800),this.gtu[5]=i*(212378941/319334400);var s=ui(this.cbg,this.lat0);this.Zb=-this.Qn*(s+Wn(this.gtu,2*s))}function Qn(t){var e=E(t.x-this.long0,this.over),i=t.y;i=ui(this.cbg,i);var s=Math.sin(i),a=Math.cos(i),r=Math.sin(e),o=Math.cos(e);i=Math.atan2(s,o*a),e=Math.atan2(r*a,Q(s,a*o)),e=jn(Math.tan(e));var n=qs(this.gtu,2*i,2*e);i=i+n[0],e=e+n[1];var h,l;return Math.abs(e)<=2.623395162778?(h=this.a*(this.Qn*e)+this.x0,l=this.a*(this.Qn*i+this.Zb)+this.y0):(h=1/0,l=1/0),t.x=h,t.y=l,t}function Xn(t){var e=(t.x-this.x0)*(1/this.a),i=(t.y-this.y0)*(1/this.a);i=(i-this.Zb)/this.Qn,e=e/this.Qn;var s,a;if(Math.abs(e)<=2.623395162778){var r=qs(this.utg,2*i,2*e);i=i+r[0],e=e+r[1],e=Math.atan(zs(e));var o=Math.sin(i),n=Math.cos(i),h=Math.sin(e),l=Math.cos(e);i=Math.atan2(o*l,Q(h,l*n)),e=Math.atan2(h,l*n),s=E(e+this.long0,this.over),a=ui(this.cgb,i)}else s=1/0,a=1/0;return t.x=s,t.y=a,t}var Kn=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const Pe={init:Vn,forward:Qn,inverse:Xn,names:Kn};function Zn(t,e){if(t===void 0){if(t=Math.floor((E(e)+Math.PI)*30/Math.PI)+1,t<0)return 0;if(t>60)return 60}return t}var Jn="etmerc";function Yn(){var t=Zn(this.zone,this.long0);if(t===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*F,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Pe.init.apply(this),this.forward=Pe.forward,this.inverse=Pe.inverse}var to=["Universal Transverse Mercator System","utm"];const eo={init:Yn,names:to,dependsOn:Jn};function ci(t,e){return Math.pow((1-t)/(1+t),e)}var io=20;function so(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+A)/(Math.pow(Math.tan(.5*this.lat0+A),this.C)*ci(this.e*t,this.ratexp))}function ao(t){var e=t.x,i=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*i+A),this.C)*ci(this.e*Math.sin(i),this.ratexp))-v,t.x=this.C*e,t}function ro(t){for(var e=1e-14,i=t.x/this.C,s=t.y,a=Math.pow(Math.tan(.5*s+A)/this.K,1/this.C),r=io;r>0&&(s=2*Math.atan(a*ci(this.e*Math.sin(t.y),-.5*this.e))-v,!(Math.abs(s-t.y)<e));--r)t.y=s;return r?(t.x=i,t.y=s,t):null}const gi={init:so,forward:ao,inverse:ro};function no(){gi.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))}function oo(t){var e,i,s,a;return t.x=E(t.x-this.long0,this.over),gi.forward.apply(this,[t]),e=Math.sin(t.y),i=Math.cos(t.y),s=Math.cos(t.x),a=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*i*s),t.x=a*i*Math.sin(t.x),t.y=a*(this.cosc0*e-this.sinc0*i*s),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function ho(t){var e,i,s,a,r;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,r=Q(t.x,t.y)){var o=2*Math.atan2(r,this.R2);e=Math.sin(o),i=Math.cos(o),a=Math.asin(i*this.sinc0+t.y*e*this.cosc0/r),s=Math.atan2(t.x*e,r*this.cosc0*i-t.y*this.sinc0*e)}else a=this.phic0,s=0;return t.x=s,t.y=a,gi.inverse.apply(this,[t]),t.x=E(t.x+this.long0,this.over),t}var lo=["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"];const fo={init:no,forward:oo,inverse:ho,names:lo};function mi(t,e,i){return e*=i,Math.tan(.5*(v+t))*Math.pow((1-e)/(1+e),.5*i)}function uo(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=x&&(this.k0=.5*(1+Wt(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=x&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=x&&Math.abs(Math.cos(this.lat_ts))>x&&(this.k0=.5*this.cons*it(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/tt(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=it(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(mi(this.lat0,this.sinlat0,this.e))-v,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function co(t){var e=t.x,i=t.y,s=Math.sin(i),a=Math.cos(i),r,o,n,h,l,c,u=E(e-this.long0,this.over);return Math.abs(Math.abs(e-this.long0)-Math.PI)<=x&&Math.abs(i+this.lat0)<=x?(t.x=NaN,t.y=NaN,t):this.sphere?(r=2*this.k0/(1+this.sinlat0*s+this.coslat0*a*Math.cos(u)),t.x=this.a*r*a*Math.sin(u)+this.x0,t.y=this.a*r*(this.coslat0*s-this.sinlat0*a*Math.cos(u))+this.y0,t):(o=2*Math.atan(mi(i,s,this.e))-v,h=Math.cos(o),n=Math.sin(o),Math.abs(this.coslat0)<=x?(l=tt(this.e,i*this.con,this.con*s),c=2*this.a*this.k0*l/this.cons,t.x=this.x0+c*Math.sin(e-this.long0),t.y=this.y0-this.con*c*Math.cos(e-this.long0),t):(Math.abs(this.sinlat0)<x?(r=2*this.a*this.k0/(1+h*Math.cos(u)),t.y=r*n):(r=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*n+this.cosX0*h*Math.cos(u))),t.y=r*(this.cosX0*n-this.sinX0*h*Math.cos(u))+this.y0),t.x=r*h*Math.sin(u)+this.x0,t))}function go(t){t.x-=this.x0,t.y-=this.y0;var e,i,s,a,r,o=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var n=2*Math.atan(o/(2*this.a*this.k0));return e=this.long0,i=this.lat0,o<=x?(t.x=e,t.y=i,t):(i=Math.asin(Math.cos(n)*this.sinlat0+t.y*Math.sin(n)*this.coslat0/o),Math.abs(this.coslat0)<x?this.lat0>0?e=E(this.long0+Math.atan2(t.x,-1*t.y),this.over):e=E(this.long0+Math.atan2(t.x,t.y),this.over):e=E(this.long0+Math.atan2(t.x*Math.sin(n),o*this.coslat0*Math.cos(n)-t.y*this.sinlat0*Math.sin(n)),this.over),t.x=e,t.y=i,t)}else if(Math.abs(this.coslat0)<=x){if(o<=x)return i=this.lat0,e=this.long0,t.x=e,t.y=i,t;t.x*=this.con,t.y*=this.con,s=o*this.cons/(2*this.a*this.k0),i=this.con*Ht(this.e,s),e=this.con*E(this.con*this.long0+Math.atan2(t.x,-1*t.y),this.over)}else a=2*Math.atan(o*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,o<=x?r=this.X0:(r=Math.asin(Math.cos(a)*this.sinX0+t.y*Math.sin(a)*this.cosX0/o),e=E(this.long0+Math.atan2(t.x*Math.sin(a),o*this.cosX0*Math.cos(a)-t.y*this.sinX0*Math.sin(a)),this.over)),i=-1*Ht(this.e,Math.tan(.5*(v+r)));return t.x=e,t.y=i,t}var mo=["stere","Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"];const _o={init:uo,forward:co,inverse:go,names:mo,ssfn_:mi};function vo(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),i=this.a,s=this.rf,a=1/s,r=2*a-Math.pow(a,2),o=this.e=Math.sqrt(r);this.R=this.k0*i*Math.sqrt(1-r)/(1-r*Math.pow(e,2)),this.alpha=Math.sqrt(1+r/(1-r)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var n=Math.log(Math.tan(Math.PI/4+this.b0/2)),h=Math.log(Math.tan(Math.PI/4+t/2)),l=Math.log((1+o*e)/(1-o*e));this.K=n-this.alpha*h+this.alpha*o/2*l}function yo(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),i=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),s=-this.alpha*(e+i)+this.K,a=2*(Math.atan(Math.exp(s))-Math.PI/4),r=this.alpha*(t.x-this.lambda0),o=Math.atan(Math.sin(r)/(Math.sin(this.b0)*Math.tan(a)+Math.cos(this.b0)*Math.cos(r))),n=Math.asin(Math.cos(this.b0)*Math.sin(a)-Math.sin(this.b0)*Math.cos(a)*Math.cos(r));return t.y=this.R/2*Math.log((1+Math.sin(n))/(1-Math.sin(n)))+this.y0,t.x=this.R*o+this.x0,t}function Mo(t){for(var e=t.x-this.x0,i=t.y-this.y0,s=e/this.R,a=2*(Math.atan(Math.exp(i/this.R))-Math.PI/4),r=Math.asin(Math.cos(this.b0)*Math.sin(a)+Math.sin(this.b0)*Math.cos(a)*Math.cos(s)),o=Math.atan(Math.sin(s)/(Math.cos(this.b0)*Math.cos(s)-Math.sin(this.b0)*Math.tan(a))),n=this.lambda0+o/this.alpha,h=0,l=r,c=-1e3,u=0;Math.abs(l-c)>1e-7;){if(++u>20)return;h=1/this.alpha*(Math.log(Math.tan(Math.PI/4+r/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(l))/2)),c=l,l=2*Math.atan(Math.exp(h))-Math.PI/2}return t.x=n,t.y=l,t}var xo=["somerc"];const Eo={init:vo,forward:yo,inverse:Mo,names:xo};var Nt=1e-7;function bo(t){var e=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],i=typeof t.projName=="object"?Object.keys(t.projName)[0]:t.projName;return"no_uoff"in t||"no_off"in t||e.indexOf(i)!==-1||e.indexOf(vs(i))!==-1}function So(){var t,e,i,s,a,r,o,n,h,l,c=0,u,f=0,m=0,g=0,_=0,d=0,y=0;this.no_off=bo(this),this.no_rot="no_rot"in this;var b=!1;"alpha"in this&&(b=!0);var M=!1;if("rectified_grid_angle"in this&&(M=!0),b&&(y=this.alpha),M&&(c=this.rectified_grid_angle),b||M)f=this.longc;else if(m=this.long1,_=this.lat1,g=this.long2,d=this.lat2,Math.abs(_-d)<=Nt||(t=Math.abs(_))<=Nt||Math.abs(t-v)<=Nt||Math.abs(Math.abs(this.lat0)-v)<=Nt||Math.abs(Math.abs(d)-v)<=Nt)throw new Error;var S=1-this.es;e=Math.sqrt(S),Math.abs(this.lat0)>x?(n=Math.sin(this.lat0),i=Math.cos(this.lat0),t=1-this.es*n*n,this.B=i*i,this.B=Math.sqrt(1+this.es*this.B*this.B/S),this.A=this.B*this.k0*e/t,s=this.B*e/(i*Math.sqrt(t)),a=s*s-1,a<=0?a=0:(a=Math.sqrt(a),this.lat0<0&&(a=-a)),this.E=a+=s,this.E*=Math.pow(tt(this.e,this.lat0,n),this.B)):(this.B=1/e,this.A=this.k0,this.E=s=a=1),b||M?(b?(u=Math.asin(Math.sin(y)/s),M||(c=y)):(u=c,y=Math.asin(s*Math.sin(u))),this.lam0=f-Math.asin(.5*(a-1/a)*Math.tan(u))/this.B):(r=Math.pow(tt(this.e,_,Math.sin(_)),this.B),o=Math.pow(tt(this.e,d,Math.sin(d)),this.B),a=this.E/r,h=(o-r)/(o+r),l=this.E*this.E,l=(l-o*r)/(l+o*r),t=m-g,t<-Math.PI?g-=$t:t>Math.PI&&(g+=$t),this.lam0=E(.5*(m+g)-Math.atan(l*Math.tan(.5*this.B*(m-g))/h)/this.B,this.over),u=Math.atan(2*Math.sin(this.B*E(m-this.lam0,this.over))/(a-1/a)),c=y=Math.asin(s*Math.sin(u))),this.singam=Math.sin(u),this.cosgam=Math.cos(u),this.sinrot=Math.sin(c),this.cosrot=Math.cos(c),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(s*s-1)/Math.cos(y))),this.lat0<0&&(this.u_0=-this.u_0)),a=.5*u,this.v_pole_n=this.ArB*Math.log(Math.tan(A-a)),this.v_pole_s=this.ArB*Math.log(Math.tan(A+a))}function po(t){var e={},i,s,a,r,o,n,h,l;if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-v)>x){if(o=this.E/Math.pow(tt(this.e,t.y,Math.sin(t.y)),this.B),n=1/o,i=.5*(o-n),s=.5*(o+n),r=Math.sin(this.B*t.x),a=(i*this.singam-r*this.cosgam)/s,Math.abs(Math.abs(a)-1)<x)throw new Error;l=.5*this.ArB*Math.log((1-a)/(1+a)),n=Math.cos(this.B*t.x),Math.abs(n)<Nt?h=this.A*t.x:h=this.ArB*Math.atan2(i*this.cosgam+r*this.singam,n)}else l=t.y>0?this.v_pole_n:this.v_pole_s,h=this.ArB*t.y;return this.no_rot?(e.x=h,e.y=l):(h-=this.u_0,e.x=l*this.cosrot+h*this.sinrot,e.y=h*this.cosrot-l*this.sinrot),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function wo(t){var e,i,s,a,r,o,n,h={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(i=t.y,e=t.x):(i=t.x*this.cosrot-t.y*this.sinrot,e=t.y*this.cosrot+t.x*this.sinrot+this.u_0),s=Math.exp(-this.BrA*i),a=.5*(s-1/s),r=.5*(s+1/s),o=Math.sin(this.BrA*e),n=(o*this.cosgam+a*this.singam)/r,Math.abs(Math.abs(n)-1)<x)h.x=0,h.y=n<0?-v:v;else{if(h.y=this.E/Math.sqrt((1+n)/(1-n)),h.y=Ht(this.e,Math.pow(h.y,1/this.B)),h.y===1/0)throw new Error;h.x=-this.rB*Math.atan2(a*this.cosgam-o*this.singam,Math.cos(this.BrA*e))}return h.x+=this.lam0,h}var Po=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Variant_B","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"];const Go={init:So,forward:po,inverse:wo,names:Po};function Ao(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<x)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var e=Math.sin(this.lat1),i=Math.cos(this.lat1),s=it(this.e,e,i),a=tt(this.e,this.lat1,e),r=Math.sin(this.lat2),o=Math.cos(this.lat2),n=it(this.e,r,o),h=tt(this.e,this.lat2,r),l=Math.abs(Math.abs(this.lat0)-v)<x?0:tt(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>x?this.ns=Math.log(s/n)/Math.log(a/h):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=s/(this.ns*Math.pow(a,this.ns)),this.rh=this.a*this.f0*Math.pow(l,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function Io(t){var e=t.x,i=t.y;Math.abs(2*Math.abs(i)-Math.PI)<=x&&(i=Wt(i)*(v-2*x));var s=Math.abs(Math.abs(i)-v),a,r;if(s>x)a=tt(this.e,i,Math.sin(i)),r=this.a*this.f0*Math.pow(a,this.ns);else{if(s=i*this.ns,s<=0)return null;r=0}var o=this.ns*E(e-this.long0,this.over);return t.x=this.k0*(r*Math.sin(o))+this.x0,t.y=this.k0*(this.rh-r*Math.cos(o))+this.y0,t}function No(t){var e,i,s,a,r,o=(t.x-this.x0)/this.k0,n=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(o*o+n*n),i=1):(e=-Math.sqrt(o*o+n*n),i=-1);var h=0;if(e!==0&&(h=Math.atan2(i*o,i*n)),e!==0||this.ns>0){if(i=1/this.ns,s=Math.pow(e/(this.a*this.f0),i),a=Ht(this.e,s),a===-9999)return null}else a=-v;return r=E(h/this.ns+this.long0,this.over),t.x=r,t.y=a,t}var To=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"];const Ro={init:Ao,forward:Io,inverse:No,names:To};function Co(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function Fo(t){var e,i,s,a,r,o,n,h=t.x,l=t.y,c=E(h-this.long0,this.over);return e=Math.pow((1+this.e*Math.sin(l))/(1-this.e*Math.sin(l)),this.alfa*this.e/2),i=2*(Math.atan(this.k*Math.pow(Math.tan(l/2+this.s45),this.alfa)/e)-this.s45),s=-c*this.alfa,a=Math.asin(Math.cos(this.ad)*Math.sin(i)+Math.sin(this.ad)*Math.cos(i)*Math.cos(s)),r=Math.asin(Math.cos(i)*Math.sin(s)/Math.cos(a)),o=this.n*r,n=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(a/2+this.s45),this.n),t.y=n*Math.cos(o)/1,t.x=n*Math.sin(o)/1,this.czech||(t.y*=-1,t.x*=-1),t}function Oo(t){var e,i,s,a,r,o,n,h,l=t.x;t.x=t.y,t.y=l,this.czech||(t.y*=-1,t.x*=-1),o=Math.sqrt(t.x*t.x+t.y*t.y),r=Math.atan2(t.y,t.x),a=r/Math.sin(this.s0),s=2*(Math.atan(Math.pow(this.ro0/o,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(s)-Math.sin(this.ad)*Math.cos(s)*Math.cos(a)),i=Math.asin(Math.cos(s)*Math.sin(a)/Math.cos(e)),t.x=this.long0-i/this.alfa,n=e,h=0;var c=0;do t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(n))/(1-this.e*Math.sin(n)),this.e/2))-this.s45),Math.abs(n-t.y)<1e-10&&(h=1),n=t.y,c+=1;while(h===0&&c<15);return c>=15?null:t}var Lo=["Krovak","Krovak Modified","Krovak (North Orientated)","Krovak Modified (North Orientated)","krovak"];const ko={init:Co,forward:Fo,inverse:Oo,names:Lo};function B(t,e,i,s,a){return t*a-e*Math.sin(2*a)+i*Math.sin(4*a)-s*Math.sin(6*a)}function Xt(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function Kt(t){return .375*t*(1+.25*t*(1+.46875*t))}function Zt(t){return .05859375*t*t*(1+.75*t)}function Jt(t){return t*t*t*(35/3072)}function _i(t,e,i){var s=e*i;return t/Math.sqrt(1-s*s)}function ot(t){return Math.abs(t)<v?t:t-Wt(t)*Math.PI}function Ge(t,e,i,s,a){var r,o;r=t/e;for(var n=0;n<15;n++)if(o=(t-(e*r-i*Math.sin(2*r)+s*Math.sin(4*r)-a*Math.sin(6*r)))/(e-2*i*Math.cos(2*r)+4*s*Math.cos(4*r)-6*a*Math.cos(6*r)),r+=o,Math.abs(o)<=1e-10)return r;return NaN}function Uo(){this.sphere||(this.e0=Xt(this.es),this.e1=Kt(this.es),this.e2=Zt(this.es),this.e3=Jt(this.es),this.ml0=this.a*B(this.e0,this.e1,this.e2,this.e3,this.lat0))}function zo(t){var e,i,s=t.x,a=t.y;if(s=E(s-this.long0,this.over),this.sphere)e=this.a*Math.asin(Math.cos(a)*Math.sin(s)),i=this.a*(Math.atan2(Math.tan(a),Math.cos(s))-this.lat0);else{var r=Math.sin(a),o=Math.cos(a),n=_i(this.a,this.e,r),h=Math.tan(a)*Math.tan(a),l=s*Math.cos(a),c=l*l,u=this.es*o*o/(1-this.es),f=this.a*B(this.e0,this.e1,this.e2,this.e3,a);e=n*l*(1-c*h*(1/6-(8-h+8*u)*c/120)),i=f-this.ml0+n*r/o*c*(.5+(5-h+6*u)*c/24)}return t.x=e+this.x0,t.y=i+this.y0,t}function qo(t){t.x-=this.x0,t.y-=this.y0;var e=t.x/this.a,i=t.y/this.a,s,a;if(this.sphere){var r=i+this.lat0;s=Math.asin(Math.sin(r)*Math.cos(e)),a=Math.atan2(Math.tan(e),Math.cos(r))}else{var o=this.ml0/this.a+i,n=Ge(o,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(n)-v)<=x)return t.x=this.long0,t.y=v,i<0&&(t.y*=-1),t;var h=_i(this.a,this.e,Math.sin(n)),l=h*h*h/this.a/this.a*(1-this.es),c=Math.pow(Math.tan(n),2),u=e*this.a/h,f=u*u;s=n-h*Math.tan(n)/l*u*u*(.5-(1+3*c)*u*u/24),a=u*(1-f*(c/3+(1+3*c)*c*f/15))/Math.cos(n)}return t.x=E(a+this.long0,this.over),t.y=ot(s),t}var Do=["Cassini","Cassini_Soldner","cass"];const Bo={init:Uo,forward:zo,inverse:qo,names:Do};function ht(t,e){var i;return t>1e-7?(i=t*e,(1-t*t)*(e/(1-i*i)-.5/t*Math.log((1-i)/(1+i)))):2*e}var di=1,vi=2,yi=3,Ae=4;function $o(){var t=Math.abs(this.lat0);if(Math.abs(t-v)<x?this.mode=this.lat0<0?di:vi:Math.abs(t)<x?this.mode=yi:this.mode=Ae,this.es>0){var e;switch(this.qp=ht(this.e,1),this.mmf=.5/(1-this.es),this.apa=Jo(this.es),this.mode){case vi:this.dd=1;break;case di:this.dd=1;break;case yi:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case Ae:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=ht(this.e,e)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*e*e)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===Ae&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function jo(t){var e,i,s,a,r,o,n,h,l,c,u=t.x,f=t.y;if(u=E(u-this.long0,this.over),this.sphere){if(r=Math.sin(f),c=Math.cos(f),s=Math.cos(u),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(i=this.mode===this.EQUIT?1+c*s:1+this.sinph0*r+this.cosph0*c*s,i<=x)return null;i=Math.sqrt(2/i),e=i*c*Math.sin(u),i*=this.mode===this.EQUIT?r:this.cosph0*r-this.sinph0*c*s}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(s=-s),Math.abs(f+this.lat0)<x)return null;i=A-f*.5,i=2*(this.mode===this.S_POLE?Math.cos(i):Math.sin(i)),e=i*Math.sin(u),i*=s}}else{switch(n=0,h=0,l=0,s=Math.cos(u),a=Math.sin(u),r=Math.sin(f),o=ht(this.e,r),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(n=o/this.qp,h=Math.sqrt(1-n*n)),this.mode){case this.OBLIQ:l=1+this.sinb1*n+this.cosb1*h*s;break;case this.EQUIT:l=1+h*s;break;case this.N_POLE:l=v+f,o=this.qp-o;break;case this.S_POLE:l=f-v,o=this.qp+o;break}if(Math.abs(l)<x)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:l=Math.sqrt(2/l),this.mode===this.OBLIQ?i=this.ymf*l*(this.cosb1*n-this.sinb1*h*s):i=(l=Math.sqrt(2/(1+h*s)))*n*this.ymf,e=this.xmf*l*h*a;break;case this.N_POLE:case this.S_POLE:o>=0?(e=(l=Math.sqrt(o))*a,i=s*(this.mode===this.S_POLE?l:-l)):e=i=0;break}}return t.x=this.a*e+this.x0,t.y=this.a*i+this.y0,t}function Wo(t){t.x-=this.x0,t.y-=this.y0;var e=t.x/this.a,i=t.y/this.a,s,a,r,o,n,h,l;if(this.sphere){var c=0,u,f=0;if(u=Math.sqrt(e*e+i*i),a=u*.5,a>1)return null;switch(a=2*Math.asin(a),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(f=Math.sin(a),c=Math.cos(a)),this.mode){case this.EQUIT:a=Math.abs(u)<=x?0:Math.asin(i*f/u),e*=f,i=c*u;break;case this.OBLIQ:a=Math.abs(u)<=x?this.lat0:Math.asin(c*this.sinph0+i*f*this.cosph0/u),e*=f*this.cosph0,i=(c-Math.sin(a)*this.sinph0)*u;break;case this.N_POLE:i=-i,a=v-a;break;case this.S_POLE:a-=v;break}s=i===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(e,i)}else{if(l=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(e/=this.dd,i*=this.dd,h=Math.sqrt(e*e+i*i),h<x)return t.x=this.long0,t.y=this.lat0,t;o=2*Math.asin(.5*h/this.rq),r=Math.cos(o),e*=o=Math.sin(o),this.mode===this.OBLIQ?(l=r*this.sinb1+i*o*this.cosb1/h,n=this.qp*l,i=h*this.cosb1*r-i*this.sinb1*o):(l=i*o/h,n=this.qp*l,i=h*r)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(i=-i),n=e*e+i*i,!n)return t.x=this.long0,t.y=this.lat0,t;l=1-n/this.qp,this.mode===this.S_POLE&&(l=-l)}s=Math.atan2(e,i),a=Yo(Math.asin(l),this.apa)}return t.x=E(this.long0+s,this.over),t.y=a,t}var Ho=.3333333333333333,Vo=.17222222222222222,Qo=.10257936507936508,Xo=.06388888888888888,Ko=.0664021164021164,Zo=.016415012942191543;function Jo(t){var e,i=[];return i[0]=t*Ho,e=t*t,i[0]+=e*Vo,i[1]=e*Xo,e*=t,i[0]+=e*Qo,i[1]+=e*Ko,i[2]=e*Zo,i}function Yo(t,e){var i=t+t;return t+e[0]*Math.sin(i)+e[1]*Math.sin(i+i)+e[2]*Math.sin(i+i+i)}var th=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"];const eh={init:$o,forward:jo,inverse:Wo,names:th,S_POLE:di,N_POLE:vi,EQUIT:yi,OBLIQ:Ae};function lt(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)}function ih(){Math.abs(this.lat1+this.lat2)<x||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=it(this.e3,this.sin_po,this.cos_po),this.qs1=ht(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=it(this.e3,this.sin_po,this.cos_po),this.qs2=ht(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=ht(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>x?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function sh(t){var e=t.x,i=t.y;this.sin_phi=Math.sin(i),this.cos_phi=Math.cos(i);var s=ht(this.e3,this.sin_phi),a=this.a*Math.sqrt(this.c-this.ns0*s)/this.ns0,r=this.ns0*E(e-this.long0,this.over),o=a*Math.sin(r)+this.x0,n=this.rh-a*Math.cos(r)+this.y0;return t.x=o,t.y=n,t}function ah(t){var e,i,s,a,r,o;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),s=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),s=-1),a=0,e!==0&&(a=Math.atan2(s*t.x,s*t.y)),s=e*this.ns0/this.a,this.sphere?o=Math.asin((this.c-s*s)/(2*this.ns0)):(i=(this.c-s*s)/this.ns0,o=this.phi1z(this.e3,i)),r=E(a/this.ns0+this.long0,this.over),t.x=r,t.y=o,t}function rh(t,e){var i,s,a,r,o,n=lt(.5*e);if(t<x)return n;for(var h=t*t,l=1;l<=25;l++)if(i=Math.sin(n),s=Math.cos(n),a=t*i,r=1-a*a,o=.5*r*r/s*(e/(1-h)-i/r+.5/t*Math.log((1-a)/(1+a))),n=n+o,Math.abs(o)<=1e-7)return n;return null}var nh=["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers","aea"];const oh={init:ih,forward:sh,inverse:ah,names:nh,phi1z:rh};function hh(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function lh(t){var e,i,s,a,r,o,n,h,l=t.x,c=t.y;return s=E(l-this.long0,this.over),e=Math.sin(c),i=Math.cos(c),a=Math.cos(s),o=this.sin_p14*e+this.cos_p14*i*a,r=1,o>0||Math.abs(o)<=x?(n=this.x0+this.a*r*i*Math.sin(s)/o,h=this.y0+this.a*r*(this.cos_p14*e-this.sin_p14*i*a)/o):(n=this.x0+this.infinity_dist*i*Math.sin(s),h=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*i*a)),t.x=n,t.y=h,t}function fh(t){var e,i,s,a,r,o;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(a=Math.atan2(e,this.rc),i=Math.sin(a),s=Math.cos(a),o=lt(s*this.sin_p14+t.y*i*this.cos_p14/e),r=Math.atan2(t.x*i,e*this.cos_p14*s-t.y*this.sin_p14*i),r=E(this.long0+r,this.over)):(o=this.phic0,r=0),t.x=r,t.y=o,t}var uh=["gnom"];const ch={init:hh,forward:lh,inverse:fh,names:uh};function gh(t,e){var i=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-i)<1e-6)return e<0?-1*v:v;for(var s=Math.asin(.5*e),a,r,o,n,h=0;h<30;h++)if(r=Math.sin(s),o=Math.cos(s),n=t*r,a=Math.pow(1-n*n,2)/(2*o)*(e/(1-t*t)-r/(1-n*n)+.5/t*Math.log((1-n)/(1+n))),s+=a,Math.abs(a)<=1e-10)return s;return NaN}function mh(){this.sphere||(this.k0=it(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function _h(t){var e=t.x,i=t.y,s,a,r=E(e-this.long0,this.over);if(this.sphere)s=this.x0+this.a*r*Math.cos(this.lat_ts),a=this.y0+this.a*Math.sin(i)/Math.cos(this.lat_ts);else{var o=ht(this.e,Math.sin(i));s=this.x0+this.a*this.k0*r,a=this.y0+this.a*o*.5/this.k0}return t.x=s,t.y=a,t}function dh(t){t.x-=this.x0,t.y-=this.y0;var e,i;return this.sphere?(e=E(this.long0+t.x/this.a/Math.cos(this.lat_ts),this.over),i=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(i=gh(this.e,2*t.y*this.k0/this.a),e=E(this.long0+t.x/(this.a*this.k0),this.over)),t.x=e,t.y=i,t}var vh=["cea"];const yh={init:mh,forward:_h,inverse:dh,names:vh};function Mh(){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 xh(t){var e=t.x,i=t.y,s=E(e-this.long0,this.over),a=ot(i-this.lat0);return t.x=this.x0+this.a*s*this.rc,t.y=this.y0+this.a*a,t}function Eh(t){var e=t.x,i=t.y;return t.x=E(this.long0+(e-this.x0)/(this.a*this.rc),this.over),t.y=ot(this.lat0+(i-this.y0)/this.a),t}var bh=["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical","eqc"];const Sh={init:Mh,forward:xh,inverse:Eh,names:bh};var Ds=20;function ph(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Xt(this.es),this.e1=Kt(this.es),this.e2=Zt(this.es),this.e3=Jt(this.es),this.ml0=this.a*B(this.e0,this.e1,this.e2,this.e3,this.lat0)}function wh(t){var e=t.x,i=t.y,s,a,r,o=E(e-this.long0,this.over);if(r=o*Math.sin(i),this.sphere)Math.abs(i)<=x?(s=this.a*o,a=-1*this.a*this.lat0):(s=this.a*Math.sin(r)/Math.tan(i),a=this.a*(ot(i-this.lat0)+(1-Math.cos(r))/Math.tan(i)));else if(Math.abs(i)<=x)s=this.a*o,a=-1*this.ml0;else{var n=_i(this.a,this.e,Math.sin(i))/Math.tan(i);s=n*Math.sin(r),a=this.a*B(this.e0,this.e1,this.e2,this.e3,i)-this.ml0+n*(1-Math.cos(r))}return t.x=s+this.x0,t.y=a+this.y0,t}function Ph(t){var e,i,s,a,r,o,n,h,l;if(s=t.x-this.x0,a=t.y-this.y0,this.sphere)if(Math.abs(a+this.a*this.lat0)<=x)e=E(s/this.a+this.long0,this.over),i=0;else{o=this.lat0+a/this.a,n=s*s/this.a/this.a+o*o,h=o;var c;for(r=Ds;r;--r)if(c=Math.tan(h),l=-1*(o*(h*c+1)-h-.5*(h*h+n)*c)/((h-o)/c-1),h+=l,Math.abs(l)<=x){i=h;break}e=E(this.long0+Math.asin(s*Math.tan(h)/this.a)/Math.sin(i),this.over)}else if(Math.abs(a+this.ml0)<=x)i=0,e=E(this.long0+s/this.a,this.over);else{o=(this.ml0+a)/this.a,n=s*s/this.a/this.a+o*o,h=o;var u,f,m,g,_;for(r=Ds;r;--r)if(_=this.e*Math.sin(h),u=Math.sqrt(1-_*_)*Math.tan(h),f=this.a*B(this.e0,this.e1,this.e2,this.e3,h),m=this.e0-2*this.e1*Math.cos(2*h)+4*this.e2*Math.cos(4*h)-6*this.e3*Math.cos(6*h),g=f/this.a,l=(o*(u*g+1)-g-.5*u*(g*g+n))/(this.es*Math.sin(2*h)*(g*g+n-2*o*g)/(4*u)+(o-g)*(u*m-2/Math.sin(2*h))-m),h-=l,Math.abs(l)<=x){i=h;break}u=Math.sqrt(1-this.es*Math.pow(Math.sin(i),2))*Math.tan(i),e=E(this.long0+Math.asin(s*u/this.a)/Math.sin(i),this.over)}return t.x=e,t.y=i,t}var Gh=["Polyconic","American_Polyconic","poly"];const Ah={init:ph,forward:wh,inverse:Ph,names:Gh};function Ih(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function Nh(t){var e,i=t.x,s=t.y,a=s-this.lat0,r=i-this.long0,o=a/Bt*1e-5,n=r,h=1,l=0;for(e=1;e<=10;e++)h=h*o,l=l+this.A[e]*h;var c=l,u=n,f=1,m=0,g,_,d=0,y=0;for(e=1;e<=6;e++)g=f*c-m*u,_=m*c+f*u,f=g,m=_,d=d+this.B_re[e]*f-this.B_im[e]*m,y=y+this.B_im[e]*f+this.B_re[e]*m;return t.x=y*this.a+this.x0,t.y=d*this.a+this.y0,t}function Th(t){var e,i=t.x,s=t.y,a=i-this.x0,r=s-this.y0,o=r/this.a,n=a/this.a,h=1,l=0,c,u,f=0,m=0;for(e=1;e<=6;e++)c=h*o-l*n,u=l*o+h*n,h=c,l=u,f=f+this.C_re[e]*h-this.C_im[e]*l,m=m+this.C_im[e]*h+this.C_re[e]*l;for(var g=0;g<this.iterations;g++){var _=f,d=m,y,b,M=o,S=n;for(e=2;e<=6;e++)y=_*f-d*m,b=d*f+_*m,_=y,d=b,M=M+(e-1)*(this.B_re[e]*_-this.B_im[e]*d),S=S+(e-1)*(this.B_im[e]*_+this.B_re[e]*d);_=1,d=0;var w=this.B_re[1],P=this.B_im[1];for(e=2;e<=6;e++)y=_*f-d*m,b=d*f+_*m,_=y,d=b,w=w+e*(this.B_re[e]*_-this.B_im[e]*d),P=P+e*(this.B_im[e]*_+this.B_re[e]*d);var G=w*w+P*P;f=(M*w+S*P)/G,m=(S*w-M*P)/G}var D=f,k=m,_t=1,Z=0;for(e=1;e<=9;e++)_t=_t*D,Z=Z+this.D[e]*_t;var zt=this.lat0+Z*Bt*1e5,qt=this.long0+k;return t.x=qt,t.y=zt,t}var Rh=["New_Zealand_Map_Grid","nzmg"];const Ch={init:Ih,forward:Nh,inverse:Th,names:Rh};function Fh(){}function Oh(t){var e=t.x,i=t.y,s=E(e-this.long0,this.over),a=this.x0+this.a*s,r=this.y0+this.a*Math.log(Math.tan(Math.PI/4+i/2.5))*1.25;return t.x=a,t.y=r,t}function Lh(t){t.x-=this.x0,t.y-=this.y0;var e=E(this.long0+t.x/this.a,this.over),i=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);return t.x=e,t.y=i,t}var kh=["Miller_Cylindrical","mill"];const Uh={init:Fh,forward:Oh,inverse:Lh,names:kh};var zh=20;function qh(){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=li(this.es)}function Dh(t){var e,i,s=t.x,a=t.y;if(s=E(s-this.long0,this.over),this.sphere){if(!this.m)a=this.n!==1?Math.asin(this.n*Math.sin(a)):a;else for(var r=this.n*Math.sin(a),o=zh;o;--o){var n=(this.m*a+Math.sin(a)-r)/(this.m+Math.cos(a));if(a-=n,Math.abs(n)<x)break}e=this.a*this.C_x*s*(this.m+Math.cos(a)),i=this.a*this.C_y*a}else{var h=Math.sin(a),l=Math.cos(a);i=this.a*It(a,h,l,this.en),e=this.a*s*l/Math.sqrt(1-this.es*h*h)}return t.x=e,t.y=i,t}function Bh(t){var e,i,s,a;return t.x-=this.x0,s=t.x/this.a,t.y-=this.y0,e=t.y/this.a,this.sphere?(e/=this.C_y,s=s/(this.C_x*(this.m+Math.cos(e))),this.m?e=lt((this.m*e+Math.sin(e))/this.n):this.n!==1&&(e=lt(Math.sin(e)/this.n)),s=E(s+this.long0,this.over),e=ot(e)):(e=fi(t.y/this.a,this.es,this.en),a=Math.abs(e),a<v?(a=Math.sin(e),i=this.long0+t.x*Math.sqrt(1-this.es*a*a)/(this.a*Math.cos(e)),s=E(i,this.over)):a-x<v&&(s=this.long0)),t.x=s,t.y=e,t}var $h=["Sinusoidal","sinu"];const jh={init:qh,forward:Dh,inverse:Bh,names:$h};function Wh(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0}function Hh(t){for(var e=t.x,i=t.y,s=E(e-this.long0,this.over),a=i,r=Math.PI*Math.sin(i);;){var o=-(a+Math.sin(a)-r)/(1+Math.cos(a));if(a+=o,Math.abs(o)<x)break}a/=2,Math.PI/2-Math.abs(i)<x&&(s=0);var n=.900316316158*this.a*s*Math.cos(a)+this.x0,h=1.4142135623731*this.a*Math.sin(a)+this.y0;return t.x=n,t.y=h,t}function Vh(t){var e,i;t.x-=this.x0,t.y-=this.y0,i=t.y/(1.4142135623731*this.a),Math.abs(i)>.999999999999&&(i=.999999999999),e=Math.asin(i);var s=E(this.long0+t.x/(.900316316158*this.a*Math.cos(e)),this.over);s<-Math.PI&&(s=-Math.PI),s>Math.PI&&(s=Math.PI),i=(2*e+Math.sin(2*e))/Math.PI,Math.abs(i)>1&&(i=1);var a=Math.asin(i);return t.x=s,t.y=a,t}var Qh=["Mollweide","moll"];const Xh={init:Wh,forward:Hh,inverse:Vh,names:Qh};function Kh(){Math.abs(this.lat1+this.lat2)<x||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Xt(this.es),this.e1=Kt(this.es),this.e2=Zt(this.es),this.e3=Jt(this.es),this.sin_phi=Math.sin(this.lat1),this.cos_phi=Math.cos(this.lat1),this.ms1=it(this.e,this.sin_phi,this.cos_phi),this.ml1=B(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<x?this.ns=this.sin_phi:(this.sin_phi=Math.sin(this.lat2),this.cos_phi=Math.cos(this.lat2),this.ms2=it(this.e,this.sin_phi,this.cos_phi),this.ml2=B(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=B(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function Zh(t){var e=t.x,i=t.y,s;if(this.sphere)s=this.a*(this.g-i);else{var a=B(this.e0,this.e1,this.e2,this.e3,i);s=this.a*(this.g-a)}var r=this.ns*E(e-this.long0,this.over),o=this.x0+s*Math.sin(r),n=this.y0+this.rh-s*Math.cos(r);return t.x=o,t.y=n,t}function Jh(t){t.x-=this.x0,t.y=this.rh-t.y+this.y0;var e,i,s,a;this.ns>=0?(i=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(i=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var r=0;if(i!==0&&(r=Math.atan2(e*t.x,e*t.y)),this.sphere)return a=E(this.long0+r/this.ns,this.over),s=ot(this.g-i/this.a),t.x=a,t.y=s,t;var o=this.g-i/this.a;return s=Ge(o,this.e0,this.e1,this.e2,this.e3),a=E(this.long0+r/this.ns,this.over),t.x=a,t.y=s,t}var Yh=["Equidistant_Conic","eqdc"];const t0={init:Kh,forward:Zh,inverse:Jh,names:Yh};function e0(){this.R=this.a}function i0(t){var e=t.x,i=t.y,s=E(e-this.long0,this.over),a,r;Math.abs(i)<=x&&(a=this.x0+this.R*s,r=this.y0);var o=lt(2*Math.abs(i/Math.PI));(Math.abs(s)<=x||Math.abs(Math.abs(i)-v)<=x)&&(a=this.x0,i>=0?r=this.y0+Math.PI*this.R*Math.tan(.5*o):r=this.y0+Math.PI*this.R*-Math.tan(.5*o));var n=.5*Math.abs(Math.PI/s-s/Math.PI),h=n*n,l=Math.sin(o),c=Math.cos(o),u=c/(l+c-1),f=u*u,m=u*(2/l-1),g=m*m,_=Math.PI*this.R*(n*(u-g)+Math.sqrt(h*(u-g)*(u-g)-(g+h)*(f-g)))/(g+h);s<0&&(_=-_),a=this.x0+_;var d=h+u;return _=Math.PI*this.R*(m*d-n*Math.sqrt((g+h)*(h+1)-d*d))/(g+h),i>=0?r=this.y0+_:r=this.y0-_,t.x=a,t.y=r,t}function s0(t){var e,i,s,a,r,o,n,h,l,c,u,f,m;return t.x-=this.x0,t.y-=this.y0,u=Math.PI*this.R,s=t.x/u,a=t.y/u,r=s*s+a*a,o=-Math.abs(a)*(1+r),n=o-2*a*a+s*s,h=-2*o+1+2*a*a+r*r,m=a*a/h+(2*n*n*n/h/h/h-9*o*n/h/h)/27,l=(o-n*n/3/h)/h,c=2*Math.sqrt(-l/3),u=3*m/l/c,Math.abs(u)>1&&(u>=0?u=1:u=-1),f=Math.acos(u)/3,t.y>=0?i=(-c*Math.cos(f+Math.PI/3)-n/3/h)*Math.PI:i=-(-c*Math.cos(f+Math.PI/3)-n/3/h)*Math.PI,Math.abs(s)<x?e=this.long0:e=E(this.long0+Math.PI*(r-1+Math.sqrt(1+2*(s*s-a*a)+r*r))/2/s,this.over),t.x=e,t.y=i,t}var a0=["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten","vandg"];const r0={init:e0,forward:i0,inverse:s0,names:a0};function n0(t,e,i,s,a,r){const o=s-e,n=Math.atan((1-r)*Math.tan(t)),h=Math.atan((1-r)*Math.tan(i)),l=Math.sin(n),c=Math.cos(n),u=Math.sin(h),f=Math.cos(h);let m=o,g,_=100,d,y,b,M,S,w,P,G,D,k,_t,Z,zt,qt;do{if(d=Math.sin(m),y=Math.cos(m),b=Math.sqrt(f*d*(f*d)+(c*u-l*f*y)*(c*u-l*f*y)),b===0)return{azi1:0,s12:0};M=l*u+c*f*y,S=Math.atan2(b,M),w=c*f*d/b,P=1-w*w,G=P!==0?M-2*l*u/P:0,D=r/16*P*(4+r*(4-3*P)),g=m,m=o+(1-D)*r*w*(S+D*b*(G+D*M*(-1+2*G*G)))}while(Math.abs(m-g)>1e-12&&--_>0);return _===0?{azi1:NaN,s12:NaN}:(k=P*(a*a-a*(1-r)*(a*(1-r)))/(a*(1-r)*(a*(1-r))),_t=1+k/16384*(4096+k*(-768+k*(320-175*k))),Z=k/1024*(256+k*(-128+k*(74-47*k))),zt=Z*b*(G+Z/4*(M*(-1+2*G*G)-Z/6*G*(-3+4*b*b)*(-3+4*G*G))),qt=a*(1-r)*_t*(S-zt),{azi1:Math.atan2(f*d,c*u-l*f*y),s12:qt})}function o0(t,e,i,s,a,r){const o=Math.atan((1-r)*Math.tan(t)),n=Math.sin(o),h=Math.cos(o),l=Math.sin(i),c=Math.cos(i),u=Math.atan2(n,h*c),f=h*l,m=1-f*f,g=m*(a*a-a*(1-r)*(a*(1-r)))/(a*(1-r)*(a*(1-r))),_=1+g/16384*(4096+g*(-768+g*(320-175*g))),d=g/1024*(256+g*(-128+g*(74-47*g)));let y=s/(a*(1-r)*_),b,M=100,S,w,P,G;do S=Math.cos(2*u+y),w=Math.sin(y),P=Math.cos(y),G=d*w*(S+d/4*(P*(-1+2*S*S)-d/6*S*(-3+4*w*w)*(-3+4*S*S))),b=y,y=s/(a*(1-r)*_)+G;while(Math.abs(y-b)>1e-12&&--M>0);if(M===0)return{lat2:NaN,lon2:NaN};const D=n*w-h*P*c,k=Math.atan2(n*P+h*w*c,(1-r)*Math.sqrt(f*f+D*D)),_t=Math.atan2(w*l,h*P-n*w*c),Z=r/16*m*(4+r*(4-3*m)),zt=_t-(1-Z)*r*f*(y+Z*w*(S+Z*P*(-1+2*S*S))),qt=e+zt;return{lat2:k,lon2:qt}}function h0(){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 l0(t){var e=t.x,i=t.y,s=Math.sin(t.y),a=Math.cos(t.y),r=E(e-this.long0,this.over),o,n,h,l,c,u,f,m,g,_,d;return this.sphere?Math.abs(this.sin_p12-1)<=x?(t.x=this.x0+this.a*(v-i)*Math.sin(r),t.y=this.y0-this.a*(v-i)*Math.cos(r),t):Math.abs(this.sin_p12+1)<=x?(t.x=this.x0+this.a*(v+i)*Math.sin(r),t.y=this.y0+this.a*(v+i)*Math.cos(r),t):(g=this.sin_p12*s+this.cos_p12*a*Math.cos(r),f=Math.acos(g),m=f?f/Math.sin(f):1,t.x=this.x0+this.a*m*a*Math.sin(r),t.y=this.y0+this.a*m*(this.cos_p12*s-this.sin_p12*a*Math.cos(r)),t):(o=Xt(this.es),n=Kt(this.es),h=Zt(this.es),l=Jt(this.es),Math.abs(this.sin_p12-1)<=x?(c=this.a*B(o,n,h,l,v),u=this.a*B(o,n,h,l,i),t.x=this.x0+(c-u)*Math.sin(r),t.y=this.y0-(c-u)*Math.cos(r),t):Math.abs(this.sin_p12+1)<=x?(c=this.a*B(o,n,h,l,v),u=this.a*B(o,n,h,l,i),t.x=this.x0+(c+u)*Math.sin(r),t.y=this.y0+(c+u)*Math.cos(r),t):Math.abs(e)<x&&Math.abs(i-this.lat0)<x?(t.x=t.y=0,t):(_=n0(this.lat0,this.long0,i,e,this.a,this.f),d=_.azi1,t.x=_.s12*Math.sin(d),t.y=_.s12*Math.cos(d),t))}function f0(t){t.x-=this.x0,t.y-=this.y0;var e,i,s,a,r,o,n,h,l,c,u,f,m,g,_,d;return this.sphere?(e=Math.sqrt(t.x*t.x+t.y*t.y),e>2*v*this.a?void 0:(i=e/this.a,s=Math.sin(i),a=Math.cos(i),r=this.long0,Math.abs(e)<=x?o=this.lat0:(o=lt(a*this.sin_p12+t.y*s*this.cos_p12/e),n=Math.abs(this.lat0)-v,Math.abs(n)<=x?this.lat0>=0?r=E(this.long0+Math.atan2(t.x,-t.y),this.over):r=E(this.long0-Math.atan2(-t.x,t.y),this.over):r=E(this.long0+Math.atan2(t.x*s,e*this.cos_p12*a-t.y*this.sin_p12*s),this.over)),t.x=r,t.y=o,t)):(h=Xt(this.es),l=Kt(this.es),c=Zt(this.es),u=Jt(this.es),Math.abs(this.sin_p12-1)<=x?(f=this.a*B(h,l,c,u,v),e=Math.sqrt(t.x*t.x+t.y*t.y),m=f-e,o=Ge(m/this.a,h,l,c,u),r=E(this.long0+Math.atan2(t.x,-1*t.y),this.over),t.x=r,t.y=o,t):Math.abs(this.sin_p12+1)<=x?(f=this.a*B(h,l,c,u,v),e=Math.sqrt(t.x*t.x+t.y*t.y),m=e-f,o=Ge(m/this.a,h,l,c,u),r=E(this.long0+Math.atan2(t.x,t.y),this.over),t.x=r,t.y=o,t):(g=Math.atan2(t.x,t.y),_=Math.sqrt(t.x*t.x+t.y*t.y),d=o0(this.lat0,this.long0,g,_,this.a,this.f),t.x=d.lon2,t.y=d.lat2,t))}var u0=["Azimuthal_Equidistant","aeqd"];const c0={init:h0,forward:l0,inverse:f0,names:u0};function g0(){this.sin_p14=Math.sin(this.lat0||0),this.cos_p14=Math.cos(this.lat0||0)}function m0(t){var e,i,s,a,r,o,n,h,l=t.x,c=t.y;return s=E(l-(this.long0||0),this.over),e=Math.sin(c),i=Math.cos(c),a=Math.cos(s),o=this.sin_p14*e+this.cos_p14*i*a,r=1,(o>0||Math.abs(o)<=x)&&(n=this.a*r*i*Math.sin(s),h=(this.y0||0)+this.a*r*(this.cos_p14*e-this.sin_p14*i*a)),t.x=n,t.y=h,t}function _0(t){var e,i,s,a,r,o,n,h,l;return t.x-=this.x0||0,t.y-=this.y0||0,e=Math.sqrt(t.x*t.x+t.y*t.y),i=lt(e/this.a),s=Math.sin(i),a=Math.cos(i),h=this.long0||0,l=this.lat0||0,o=h,Math.abs(e)<=x?(n=l,t.x=o,t.y=n,t):(n=lt(a*this.sin_p14+t.y*s*this.cos_p14/e),r=Math.abs(l)-v,Math.abs(r)<=x?(l>=0?o=E(h+Math.atan2(t.x,-t.y),this.over):o=E(h-Math.atan2(-t.x,t.y),this.over),t.x=o,t.y=n,t):(o=E(h+Math.atan2(t.x*s,e*this.cos_p14*a-t.y*this.sin_p14*s),this.over),t.x=o,t.y=n,t))}var d0=["ortho"];const v0={init:g0,forward:m0,inverse:_0,names:d0};var T={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},I={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function y0(){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>=v-A/2?this.face=T.TOP:this.lat0<=-(v-A/2)?this.face=T.BOTTOM:Math.abs(this.long0)<=A?this.face=T.FRONT:Math.abs(this.long0)<=v+A?this.face=this.long0>0?T.RIGHT:T.LEFT:this.face=T.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 M0(t){var e={x:0,y:0},i,s,a,r,o,n,h={value:0};if(t.x-=this.long0,this.es!==0?i=Math.atan(this.one_minus_f_squared*Math.tan(t.y)):i=t.y,s=t.x,this.face===T.TOP)r=v-i,s>=A&&s<=v+A?(h.value=I.AREA_0,a=s-v):s>v+A||s<=-(v+A)?(h.value=I.AREA_1,a=s>0?s-O:s+O):s>-(v+A)&&s<=-A?(h.value=I.AREA_2,a=s+v):(h.value=I.AREA_3,a=s);else if(this.face===T.BOTTOM)r=v+i,s>=A&&s<=v+A?(h.value=I.AREA_0,a=-s+v):s<A&&s>=-A?(h.value=I.AREA_1,a=-s):s<-A&&s>=-(v+A)?(h.value=I.AREA_2,a=-s-v):(h.value=I.AREA_3,a=s>0?-s+O:-s-O);else{var l,c,u,f,m,g,_;this.face===T.RIGHT?s=Tt(s,+v):this.face===T.BACK?s=Tt(s,+O):this.face===T.LEFT&&(s=Tt(s,-v)),f=Math.sin(i),m=Math.cos(i),g=Math.sin(s),_=Math.cos(s),l=m*_,c=m*g,u=f,this.face===T.FRONT?(r=Math.acos(l),a=Ie(r,u,c,h)):this.face===T.RIGHT?(r=Math.acos(c),a=Ie(r,u,-l,h)):this.face===T.BACK?(r=Math.acos(-l),a=Ie(r,u,-c,h)):this.face===T.LEFT?(r=Math.acos(-c),a=Ie(r,u,l,h)):(r=a=0,h.value=I.AREA_0)}return n=Math.atan(12/O*(a+Math.acos(Math.sin(a)*Math.cos(A))-v)),o=Math.sqrt((1-Math.cos(r))/(Math.cos(n)*Math.cos(n))/(1-Math.cos(Math.atan(1/Math.cos(a))))),h.value===I.AREA_1?n+=v:h.value===I.AREA_2?n+=O:h.value===I.AREA_3&&(n+=1.5*O),e.x=o*Math.cos(n),e.y=o*Math.sin(n),e.x=e.x*this.a+this.x0,e.y=e.y*this.a+this.y0,t.x=e.x,t.y=e.y,t}function x0(t){var e={lam:0,phi:0},i,s,a,r,o,n,h,l,c,u={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,s=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),i=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?u.value=I.AREA_0:t.y>=0&&t.y>=Math.abs(t.x)?(u.value=I.AREA_1,i-=v):t.x<0&&-t.x>=Math.abs(t.y)?(u.value=I.AREA_2,i=i<0?i+O:i-O):(u.value=I.AREA_3,i+=v),c=O/12*Math.tan(i),o=Math.sin(c)/(Math.cos(c)-1/Math.sqrt(2)),n=Math.atan(o),a=Math.cos(i),r=Math.tan(s),h=1-a*a*r*r*(1-Math.cos(Math.atan(1/Math.cos(n)))),h<-1?h=-1:h>1&&(h=1),this.face===T.TOP)l=Math.acos(h),e.phi=v-l,u.value===I.AREA_0?e.lam=n+v:u.value===I.AREA_1?e.lam=n<0?n+O:n-O:u.value===I.AREA_2?e.lam=n-v:e.lam=n;else if(this.face===T.BOTTOM)l=Math.acos(h),e.phi=l-v,u.value===I.AREA_0?e.lam=-n+v:u.value===I.AREA_1?e.lam=-n:u.value===I.AREA_2?e.lam=-n-v:e.lam=n<0?-n-O:-n+O;else{var f,m,g;f=h,c=f*f,c>=1?g=0:g=Math.sqrt(1-c)*Math.sin(n),c+=g*g,c>=1?m=0:m=Math.sqrt(1-c),u.value===I.AREA_1?(c=m,m=-g,g=c):u.value===I.AREA_2?(m=-m,g=-g):u.value===I.AREA_3&&(c=m,m=g,g=-c),this.face===T.RIGHT?(c=f,f=-m,m=c):this.face===T.BACK?(f=-f,m=-m):this.face===T.LEFT&&(c=f,f=m,m=-c),e.phi=Math.acos(-g)-v,e.lam=Math.atan2(m,f),this.face===T.RIGHT?e.lam=Tt(e.lam,-v):this.face===T.BACK?e.lam=Tt(e.lam,-O):this.face===T.LEFT&&(e.lam=Tt(e.lam,+v))}if(this.es!==0){var _,d,y;_=e.phi<0?1:0,d=Math.tan(e.phi),y=this.b/Math.sqrt(d*d+this.one_minus_f_squared),e.phi=Math.atan(Math.sqrt(this.a*this.a-y*y)/(this.one_minus_f*y)),_&&(e.phi=-e.phi)}return e.lam+=this.long0,t.x=e.lam,t.y=e.phi,t}function Ie(t,e,i,s){var a;return t<x?(s.value=I.AREA_0,a=0):(a=Math.atan2(e,i),Math.abs(a)<=A?s.value=I.AREA_0:a>A&&a<=v+A?(s.value=I.AREA_1,a-=v):a>v+A||a<=-(v+A)?(s.value=I.AREA_2,a=a>=0?a-O:a+O):(s.value=I.AREA_3,a+=v)),a}function Tt(t,e){var i=t+e;return i<-O?i+=$t:i>+O&&(i-=$t),i}var E0=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const b0={init:y0,forward:M0,inverse:x0,names:E0};var Mi=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Yt=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],Bs=.8487,$s=1.3523,js=W/5,S0=1/js,Rt=18,Ne=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))},p0=function(t,e){return t[1]+e*(2*t[2]+e*3*t[3])};function w0(t,e,i,s){for(var a=e;s;--s){var r=t(a);if(a-=r,Math.abs(r)<i)break}return a}function P0(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function G0(t){var e=E(t.x-this.long0,this.over),i=Math.abs(t.y),s=Math.floor(i*js);s<0?s=0:s>=Rt&&(s=Rt-1),i=W*(i-S0*s);var a={x:Ne(Mi[s],i)*e,y:Ne(Yt[s],i)};return t.y<0&&(a.y=-a.y),a.x=a.x*this.a*Bs+this.x0,a.y=a.y*this.a*$s+this.y0,a}function A0(t){var e={x:(t.x-this.x0)/(this.a*Bs),y:Math.abs(t.y-this.y0)/(this.a*$s)};if(e.y>=1)e.x/=Mi[Rt][0],e.y=t.y<0?-v:v;else{var i=Math.floor(e.y*Rt);for(i<0?i=0:i>=Rt&&(i=Rt-1);;)if(Yt[i][0]>e.y)--i;else if(Yt[i+1][0]<=e.y)++i;else break;var s=Yt[i],a=5*(e.y-s[0])/(Yt[i+1][0]-s[0]);a=w0(function(r){return(Ne(s,r)-e.y)/p0(s,r)},a,x,100),e.x/=Ne(Mi[i],a),e.y=(5*i+a)*F,t.y<0&&(e.y=-e.y)}return e.x=E(e.x+this.long0,this.over),e}var I0=["Robinson","robin"];const N0={init:P0,forward:G0,inverse:A0,names:I0};function T0(){this.name="geocent"}function R0(t){var e=xs(t,this.es,this.a);return e}function C0(t){var e=Es(t,this.es,this.a,this.b);return e}var F0=["Geocentric","geocentric","geocent","Geocent"];const O0={init:T0,forward:R0,inverse:C0,names:F0};var z={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},te={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 L0(){if(Object.keys(te).forEach((function(i){if(typeof this[i]>"u")this[i]=te[i].def;else{if(te[i].num&&isNaN(this[i]))throw new Error("Invalid parameter value, must be numeric "+i+" = "+this[i]);te[i].num&&(this[i]=parseFloat(this[i]))}te[i].degrees&&(this[i]=this[i]*F)}).bind(this)),Math.abs(Math.abs(this.lat0)-v)<x?this.mode=this.lat0<0?z.S_POLE:z.N_POLE:Math.abs(this.lat0)<x?this.mode=z.EQUIT:(this.mode=z.OBLIQ,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var t=this.tilt,e=this.azi;this.cg=Math.cos(e),this.sg=Math.sin(e),this.cw=Math.cos(t),this.sw=Math.sin(t)}function k0(t){t.x-=this.long0;var e=Math.sin(t.y),i=Math.cos(t.y),s=Math.cos(t.x),a,r;switch(this.mode){case z.OBLIQ:r=this.sinph0*e+this.cosph0*i*s;break;case z.EQUIT:r=i*s;break;case z.S_POLE:r=-e;break;case z.N_POLE:r=e;break}switch(r=this.pn1/(this.p-r),a=r*i*Math.sin(t.x),this.mode){case z.OBLIQ:r*=this.cosph0*e-this.sinph0*i*s;break;case z.EQUIT:r*=e;break;case z.N_POLE:r*=-(i*s);break;case z.S_POLE:r*=i*s;break}var o,n;return o=r*this.cg+a*this.sg,n=1/(o*this.sw*this.h1+this.cw),a=(a*this.cg-r*this.sg)*this.cw*n,r=o*n,t.x=a*this.a,t.y=r*this.a,t}function U0(t){t.x/=this.a,t.y/=this.a;var e={x:t.x,y:t.y},i,s,a;a=1/(this.pn1-t.y*this.sw),i=this.pn1*t.x*a,s=this.pn1*t.y*this.cw*a,t.x=i*this.cg+s*this.sg,t.y=s*this.cg-i*this.sg;var r=Q(t.x,t.y);if(Math.abs(r)<x)e.x=0,e.y=t.y;else{var o,n;switch(n=1-r*r*this.pfact,n=(this.p-Math.sqrt(n))/(this.pn1/r+r/this.pn1),o=Math.sqrt(1-n*n),this.mode){case z.OBLIQ:e.y=Math.asin(o*this.sinph0+t.y*n*this.cosph0/r),t.y=(o-this.sinph0*Math.sin(e.y))*r,t.x*=n*this.cosph0;break;case z.EQUIT:e.y=Math.asin(t.y*n/r),t.y=o*r,t.x*=n;break;case z.N_POLE:e.y=Math.asin(o),t.y=-t.y;break;case z.S_POLE:e.y=-Math.asin(o);break}e.x=Math.atan2(t.x,t.y)}return t.x=e.x+this.long0,t.y=e.y,t}var z0=["Tilted_Perspective","tpers"];const q0={init:L0,forward:k0,inverse:U0,names:z0};function D0(){if(this.flip_axis=this.sweep==="x"?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var t=1-this.es,e=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,this.radius_p_inv2=e,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")}function B0(t){var e=t.x,i=t.y,s,a,r,o;if(e=e-this.long0,this.shape==="ellipse"){i=Math.atan(this.radius_p2*Math.tan(i));var n=this.radius_p/Q(this.radius_p*Math.cos(i),Math.sin(i));if(a=n*Math.cos(e)*Math.cos(i),r=n*Math.sin(e)*Math.cos(i),o=n*Math.sin(i),(this.radius_g-a)*a-r*r-o*o*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;s=this.radius_g-a,this.flip_axis?(t.x=this.radius_g_1*Math.atan(r/Q(o,s)),t.y=this.radius_g_1*Math.atan(o/s)):(t.x=this.radius_g_1*Math.atan(r/s),t.y=this.radius_g_1*Math.atan(o/Q(r,s)))}else this.shape==="sphere"&&(s=Math.cos(i),a=Math.cos(e)*s,r=Math.sin(e)*s,o=Math.sin(i),s=this.radius_g-a,this.flip_axis?(t.x=this.radius_g_1*Math.atan(r/Q(o,s)),t.y=this.radius_g_1*Math.atan(o/s)):(t.x=this.radius_g_1*Math.atan(r/s),t.y=this.radius_g_1*Math.atan(o/Q(r,s))));return t.x=t.x*this.a,t.y=t.y*this.a,t}function $0(t){var e=-1,i=0,s=0,a,r,o,n;if(t.x=t.x/this.a,t.y=t.y/this.a,this.shape==="ellipse"){this.flip_axis?(s=Math.tan(t.y/this.radius_g_1),i=Math.tan(t.x/this.radius_g_1)*Q(1,s)):(i=Math.tan(t.x/this.radius_g_1),s=Math.tan(t.y/this.radius_g_1)*Q(1,i));var h=s/this.radius_p;if(a=i*i+h*h+e*e,r=2*this.radius_g*e,o=r*r-4*a*this.C,o<0)return t.x=Number.NaN,t.y=Number.NaN,t;n=(-r-Math.sqrt(o))/(2*a),e=this.radius_g+n*e,i*=n,s*=n,t.x=Math.atan2(i,e),t.y=Math.atan(s*Math.cos(t.x)/e),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if(this.shape==="sphere"){if(this.flip_axis?(s=Math.tan(t.y/this.radius_g_1),i=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+s*s)):(i=Math.tan(t.x/this.radius_g_1),s=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+i*i)),a=i*i+s*s+e*e,r=2*this.radius_g*e,o=r*r-4*a*this.C,o<0)return t.x=Number.NaN,t.y=Number.NaN,t;n=(-r-Math.sqrt(o))/(2*a),e=this.radius_g+n*e,i*=n,s*=n,t.x=Math.atan2(i,e),t.y=Math.atan(s*Math.cos(t.x)/e)}return t.x=t.x+this.long0,t}var j0=["Geostationary Satellite View","Geostationary_Satellite","geos"];const W0={init:D0,forward:B0,inverse:$0,names:j0};var ee=1.340264,ie=-.081106,se=893e-6,ae=.003796,Te=Math.sqrt(3)/2;function H0(){this.es=0,this.long0=this.long0!==void 0?this.long0:0,this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0}function V0(t){var e=E(t.x-this.long0,this.over),i=t.y,s=Math.asin(Te*Math.sin(i)),a=s*s,r=a*a*a;return t.x=e*Math.cos(s)/(Te*(ee+3*ie*a+r*(7*se+9*ae*a))),t.y=s*(ee+ie*a+r*(se+ae*a)),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function Q0(t){t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a;var e=1e-9,i=12,s=t.y,a,r,o,n,h,l;for(l=0;l<i&&(a=s*s,r=a*a*a,o=s*(ee+ie*a+r*(se+ae*a))-t.y,n=ee+3*ie*a+r*(7*se+9*ae*a),s-=h=o/n,!(Math.abs(h)<e));++l);return a=s*s,r=a*a*a,t.x=Te*t.x*(ee+3*ie*a+r*(7*se+9*ae*a))/Math.cos(s),t.y=Math.asin(Math.sin(s)/Te),t.x=E(t.x+this.long0,this.over),t}var X0=["eqearth","Equal Earth","Equal_Earth"];const K0={init:H0,forward:V0,inverse:Q0,names:X0};var re=1e-10;function Z0(){var t;if(this.phi1=this.lat1,Math.abs(this.phi1)<re)throw new Error;this.es?(this.en=li(this.es),this.m1=It(this.phi1,this.am1=Math.sin(this.phi1),t=Math.cos(this.phi1),this.en),this.am1=t/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=Y0,this.forward=J0):(Math.abs(this.phi1)+re>=v?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=el,this.forward=tl)}function J0(t){var e=E(t.x-(this.long0||0),this.over),i=t.y,s,a,r;return s=this.am1+this.m1-It(i,a=Math.sin(i),r=Math.cos(i),this.en),a=r*e/(s*Math.sqrt(1-this.es*a*a)),t.x=s*Math.sin(a),t.y=this.am1-s*Math.cos(a),t.x=this.a*t.x+(this.x0||0),t.y=this.a*t.y+(this.y0||0),t}function Y0(t){t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a;var e,i,s,a;if(i=Q(t.x,t.y=this.am1-t.y),a=fi(this.am1+this.m1-i,this.es,this.en),(e=Math.abs(a))<v)e=Math.sin(a),s=i*Math.atan2(t.x,t.y)*Math.sqrt(1-this.es*e*e)/Math.cos(a);else if(Math.abs(e-v)<=re)s=0;else throw new Error;return t.x=E(s+(this.long0||0),this.over),t.y=ot(a),t}function tl(t){var e=E(t.x-(this.long0||0),this.over),i=t.y,s,a;return a=this.cphi1+this.phi1-i,Math.abs(a)>re?(t.x=a*Math.sin(s=e*Math.cos(i)/a),t.y=this.cphi1-a*Math.cos(s)):t.x=t.y=0,t.x=this.a*t.x+(this.x0||0),t.y=this.a*t.y+(this.y0||0),t}function el(t){t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a;var e,i,s=Q(t.x,t.y=this.cphi1-t.y);if(i=this.cphi1+this.phi1-s,Math.abs(i)>v)throw new Error;return Math.abs(Math.abs(i)-v)<=re?e=0:e=s*Math.atan2(t.x,t.y)/Math.cos(i),t.x=E(e+(this.long0||0),this.over),t.y=ot(i),t}var il=["bonne","Bonne (Werner lat_1=90)"];const sl={init:Z0,names:il},Ws={OBLIQUE:{forward:hl,inverse:fl},TRANSVERSE:{forward:ll,inverse:ul}},Re={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 al(){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=_s.includes(this.o_proj),!this.o_proj)throw new Error("Missing parameter: o_proj");if(this.o_proj==="ob_tran")throw new Error("Invalid value for o_proj: "+this.o_proj);const t=this.projStr.replace("+proj=ob_tran","").replace("+o_proj=","+proj=").trim(),e=X(t);if(!e)throw new Error("Invalid parameter: o_proj. Unknown projection "+this.o_proj);e.long0=0,this.obliqueProjection=e;let i;const s=Object.keys(Re),a=n=>{if(typeof this[n]>"u")return;const h=parseFloat(this[n])*F;if(isNaN(h))throw new Error("Invalid value for "+n+": "+this[n]);return h};for(let n=0;n<s.length;n++){const h=s[n],l=Re[h],c=Object.entries(l);if(c.some(([f])=>typeof this[f]<"u")){i=l;for(let f=0;f<c.length;f++){const[m,g]=c[f],_=a(m);if(typeof _>"u")throw new Error("Missing parameter: "+m+".");this[g]=_}break}}if(!i)throw new Error("No valid parameters provided for ob_tran projection.");const{lamp:r,phip:o}=ol(this,i);this.lamp=r,Math.abs(o)>x?(this.cphip=Math.cos(o),this.sphip=Math.sin(o),this.projectionType=Ws.OBLIQUE):this.projectionType=Ws.TRANSVERSE}function rl(t){return this.projectionType.forward(this,t)}function nl(t){return this.projectionType.inverse(this,t)}function ol(t,e){let i,s;if(e===Re.ROTATE){let a=t.oLongC,r=t.oLatC,o=t.oAlpha;if(Math.abs(Math.abs(r)-v)<=x)throw new Error("Invalid value for o_lat_c: "+t.o_lat_c+" should be < 90°");s=a+Math.atan2(-1*Math.cos(o),-1*Math.sin(o)*Math.sin(r)),i=Math.asin(Math.cos(r)*Math.sin(o))}else if(e===Re.NEW_POLE)s=t.oLongP,i=t.oLatP;else{let a=t.oLong1,r=t.oLat1,o=t.oLong2,n=t.oLat2,h=Math.abs(r);if(Math.abs(r)>v-x)throw new Error("Invalid value for o_lat_1: "+t.o_lat_1+" should be < 90°");if(Math.abs(n)>v-x)throw new Error("Invalid value for o_lat_2: "+t.o_lat_2+" should be < 90°");if(Math.abs(r-n)<x)throw new Error("Invalid value for o_lat_1 and o_lat_2: o_lat_1 should be different from o_lat_2");if(h<x)throw new Error("Invalid value for o_lat_1: o_lat_1 should be different from zero");s=Math.atan2(Math.cos(r)*Math.sin(n)*Math.cos(a)-Math.sin(r)*Math.cos(n)*Math.cos(o),Math.sin(r)*Math.cos(n)*Math.sin(o)-Math.cos(r)*Math.sin(n)*Math.sin(a)),i=Math.atan(-1*Math.cos(s-a)/Math.tan(r))}return{lamp:s,phip:i}}function hl(t,e){let{x:i,y:s}=e;i+=t.long0;const a=Math.cos(i),r=Math.sin(s),o=Math.cos(s);e.x=E(Math.atan2(o*Math.sin(i),t.sphip*o*a+t.cphip*r)+t.lamp),e.y=Math.asin(t.sphip*r-t.cphip*o*a);const n=t.obliqueProjection.forward(e);return t.isIdentity&&(n.x*=W,n.y*=W),n}function ll(t,e){let{x:i,y:s}=e;i+=t.long0;const a=Math.cos(s),r=Math.cos(i);e.x=E(Math.atan2(a*Math.sin(i),Math.sin(s))+t.lamp),e.y=Math.asin(-1*a*r);const o=t.obliqueProjection.forward(e);return t.isIdentity&&(o.x*=W,o.y*=W),o}function fl(t,e){t.isIdentity&&(e.x*=F,e.y*=F);const i=t.obliqueProjection.inverse(e);let{x:s,y:a}=i;if(s<Number.MAX_VALUE){s-=t.lamp;const r=Math.cos(s),o=Math.sin(a),n=Math.cos(a);e.x=Math.atan2(n*Math.sin(s),t.sphip*n*r-t.cphip*o),e.y=Math.asin(t.sphip*o+t.cphip*n*r)}return e.x=E(e.x+t.long0),e}function ul(t,e){t.isIdentity&&(e.x*=F,e.y*=F);const i=t.obliqueProjection.inverse(e);let{x:s,y:a}=i;if(s<Number.MAX_VALUE){const r=Math.cos(a);s-=t.lamp,e.x=Math.atan2(r*Math.sin(s),-1*Math.sin(a)),e.y=Math.asin(r*Math.cos(s))}return e.x=E(e.x+t.long0),e}var cl=["General Oblique Transformation","General_Oblique_Transformation","ob_tran"];const gl={init:al,forward:rl,inverse:nl,names:cl};function ml(t){t.Proj.projections.add(we),t.Proj.projections.add(Pe),t.Proj.projections.add(eo),t.Proj.projections.add(fo),t.Proj.projections.add(_o),t.Proj.projections.add(Eo),t.Proj.projections.add(Go),t.Proj.projections.add(Ro),t.Proj.projections.add(ko),t.Proj.projections.add(Bo),t.Proj.projections.add(eh),t.Proj.projections.add(oh),t.Proj.projections.add(ch),t.Proj.projections.add(yh),t.Proj.projections.add(Sh),t.Proj.projections.add(Ah),t.Proj.projections.add(Ch),t.Proj.projections.add(Uh),t.Proj.projections.add(jh),t.Proj.projections.add(Xh),t.Proj.projections.add(t0),t.Proj.projections.add(r0),t.Proj.projections.add(c0),t.Proj.projections.add(v0),t.Proj.projections.add(b0),t.Proj.projections.add(N0),t.Proj.projections.add(O0),t.Proj.projections.add(q0),t.Proj.projections.add(W0),t.Proj.projections.add(K0),t.Proj.projections.add(sl),t.Proj.projections.add(gl)}const Hs=Object.assign(yn,{defaultDatum:"WGS84",Proj:X,WGS84:new X("WGS84"),Point:At,toPoint:ws,defs:U,nadgrid:Yr,transform:Se,mgrs:Mn,version:"__VERSION__"});ml(Hs);/* @license twgl.js 5.5.4 Copyright (c) 2015, Gregg Tavares All Rights Reserved.
|
|
5
|
+
Available via the MIT license.
|
|
6
|
+
see: http://github.com/greggman/twgl.js for details */const xi=5120,Ei=5121,bi=5122,Si=5123,pi=5124,wi=5125,Pi=5126,_l=32819,dl=32820,vl=33635,yl=5131,Ml=33640,xl=35899,El=35902,bl=36269,Sl=34042,Vs={};{const t=Vs;t[xi]=Int8Array,t[Ei]=Uint8Array,t[bi]=Int16Array,t[Si]=Uint16Array,t[pi]=Int32Array,t[wi]=Uint32Array,t[Pi]=Float32Array,t[_l]=Uint16Array,t[dl]=Uint16Array,t[vl]=Uint16Array,t[yl]=Uint16Array,t[Ml]=Uint32Array,t[xl]=Uint32Array,t[El]=Uint32Array,t[bl]=Uint32Array,t[Sl]=Uint32Array}function Gi(t){if(t instanceof Int8Array)return xi;if(t instanceof Uint8Array||t instanceof Uint8ClampedArray)return Ei;if(t instanceof Int16Array)return bi;if(t instanceof Uint16Array)return Si;if(t instanceof Int32Array)return pi;if(t instanceof Uint32Array)return wi;if(t instanceof Float32Array)return Pi;throw new Error("unsupported typed array type")}function Qs(t){if(t===Int8Array)return xi;if(t===Uint8Array||t===Uint8ClampedArray)return Ei;if(t===Int16Array)return bi;if(t===Uint16Array)return Si;if(t===Int32Array)return pi;if(t===Uint32Array)return wi;if(t===Float32Array)return Pi;throw new Error("unsupported typed array type")}function Xs(t){const e=Vs[t];if(!e)throw new Error("unknown gl type");return e}const Ce=typeof SharedArrayBuffer<"u"?function(t){return t&&t.buffer&&(t.buffer instanceof ArrayBuffer||t.buffer instanceof SharedArrayBuffer)}:function(t){return t&&t.buffer&&t.buffer instanceof ArrayBuffer};function Ks(...t){console.error(...t)}const Zs=new Map;function Ai(t,e){if(!t||typeof t!="object")return!1;let i=Zs.get(e);i||(i=new WeakMap,Zs.set(e,i));let s=i.get(t);if(s===void 0){const a=Object.prototype.toString.call(t);s=a.substring(8,a.length-1)===e,i.set(t,s)}return s}function pl(t,e){return typeof WebGLBuffer<"u"&&Ai(e,"WebGLBuffer")}function Js(t,e){return typeof WebGLTexture<"u"&&Ai(e,"WebGLTexture")}function wl(t,e){return typeof WebGLSampler<"u"&&Ai(e,"WebGLSampler")}const Ys=35044,yt=34962,Pl=34963,Gl=34660,Al=5120,Il=5121,Nl=5122,Tl=5123,Rl=5124,Cl=5125,ta=5126,ea={attribPrefix:""};function Fl(t,e,i,s,a){t.bindBuffer(e,i),t.bufferData(e,s,a||Ys)}function ia(t,e,i,s){if(pl(t,e))return e;i=i||yt;const a=t.createBuffer();return Fl(t,i,a,e,s),a}function sa(t){return t==="indices"}function Ol(t){return t===Int8Array||t===Uint8Array}function Ll(t){return t.length?t:t.data}const kl=/coord|texture/i,Ul=/color|colour/i;function zl(t,e){let i;if(kl.test(t)?i=2:Ul.test(t)?i=4:i=3,e%i>0)throw new Error(`Can not guess numComponents for attribute '${t}'. Tried ${i} but ${e} values is not evenly divisible by ${i}. You should specify it.`);return i}function ql(t,e,i){return t.numComponents||t.size||zl(e,i||Ll(t).length)}function aa(t,e){if(Ce(t))return t;if(Ce(t.data))return t.data;Array.isArray(t)&&(t={data:t});let i=t.type?Ii(t.type):void 0;return i||(sa(e)?i=Uint16Array:i=Float32Array),new i(t.data)}function Dl(t){return typeof t=="number"?t:t?Qs(t):ta}function Ii(t){return typeof t=="number"?Xs(t):t||Float32Array}function Bl(t,e){return{buffer:e.buffer,numValues:2*3*4,type:Dl(e.type),arrayType:Ii(e.type)}}function $l(t,e){const i=e.data||e,s=Ii(e.type),a=i*s.BYTES_PER_ELEMENT,r=t.createBuffer();return t.bindBuffer(yt,r),t.bufferData(yt,a,e.drawType||Ys),{buffer:r,numValues:i,type:Qs(s),arrayType:s}}function jl(t,e,i){const s=aa(e,i);return{arrayType:s.constructor,buffer:ia(t,s,void 0,e.drawType),type:Gi(s),numValues:0}}function Wl(t,e){const i={};return Object.keys(e).forEach(function(s){if(!sa(s)){const a=e[s],r=a.attrib||a.name||a.attribName||ea.attribPrefix+s;if(a.value){if(!Array.isArray(a.value)&&!Ce(a.value))throw new Error("array.value is not array or typedarray");i[r]={value:a.value}}else{let o;a.buffer&&a.buffer instanceof WebGLBuffer?o=Bl:typeof a=="number"||typeof a.data=="number"?o=$l:o=jl;const{buffer:n,type:h,numValues:l,arrayType:c}=o(t,a,s),u=a.normalize!==void 0?a.normalize:Ol(c),f=ql(a,s,l);i[r]={buffer:n,numComponents:f,type:h,normalize:u,stride:a.stride||0,offset:a.offset||0,divisor:a.divisor===void 0?void 0:a.divisor,drawType:a.drawType}}}}),t.bindBuffer(yt,null),i}function Hl(t,e){return e===Al||e===Il?1:e===Nl||e===Tl?2:e===Rl||e===Cl||e===ta?4:0}const Ni=["position","positions","a_position"];function Vl(t,e){let i,s;for(s=0;s<Ni.length&&(i=Ni[s],!(i in e||(i=ea.attribPrefix+i,i in e)));++s);s===Ni.length&&(i=Object.keys(e)[0]);const a=e[i];if(!a.buffer)return 1;t.bindBuffer(yt,a.buffer);const r=t.getBufferParameter(yt,Gl);t.bindBuffer(yt,null);const o=Hl(t,a.type),n=r/o,h=a.numComponents||a.size,l=n/h;if(l%1!==0)throw new Error(`numComponents ${h} not correct for length ${length}`);return l}function Ti(t,e,i){const s=Wl(t,e),a=Object.assign({},{});a.attribs=Object.assign({},{},s);const r=e.indices;if(r){const o=aa(r,"indices");a.indices=ia(t,o,Pl),a.numElements=o.length,a.elementType=Gi(o)}else a.numElements||(a.numElements=Vl(t,a.attribs));return a}function ne(t){return!!t.texStorage2D}const ra=function(){const t={},e={};function i(s){const a=s.constructor.name;if(!t[a]){for(const r in s)if(typeof s[r]=="number"){const o=e[s[r]];e[s[r]]=o?`${o} | ${r}`:r}t[a]=!0}}return function(s,a){return i(s),e[a]||(typeof a=="number"?`0x${a.toString(16)}`:a)}}(),ft={textureColor:new Uint8Array([128,192,255,255]),textureOptions:{},crossOrigin:void 0},oe=Ce,na=function(){let t;return function(){return t=t||(typeof document<"u"&&document.createElement?document.createElement("canvas").getContext("2d"):null),t}}(),oa=6406,st=6407,R=6408,ha=6409,la=6410,he=6402,fa=34041,Fe=33071,Ql=9728,Xl=9729,ut=3553,ct=34067,Mt=32879,xt=35866,Ri=34069,Kl=34070,Zl=34071,Jl=34072,Yl=34073,t1=34074,Ci=10241,Fi=10240,Oe=10242,Le=10243,ua=32882,e1=33082,i1=33083,s1=33084,a1=33085,r1=34892,n1=34893,Oi=3317,ca=3314,ga=32878,ma=3316,_a=3315,da=32877,o1=37443,h1=37441,l1=37440,f1=33321,u1=36756,c1=33325,g1=33326,m1=33330,_1=33329,d1=33338,v1=33337,y1=33340,M1=33339,x1=33323,E1=36757,b1=33327,S1=33328,p1=33336,w1=33335,P1=33332,G1=33331,A1=33334,I1=33333,N1=32849,T1=35905,R1=36194,C1=36758,F1=35898,O1=35901,L1=34843,k1=34837,U1=36221,z1=36239,q1=36215,D1=36233,B1=36209,$1=36227,j1=32856,W1=35907,H1=36759,V1=32855,Q1=32854,X1=32857,K1=34842,Z1=34836,J1=36220,Y1=36238,tf=36975,ef=36214,sf=36232,af=36226,rf=36208,nf=33189,of=33190,hf=36012,lf=36013,ff=35056,gt=5120,N=5121,ke=5122,Ct=5123,Ue=5124,Et=5125,q=5126,va=32819,ya=32820,Ma=33635,et=5131,le=36193,Li=33640,uf=35899,cf=35902,gf=36269,mf=34042,ze=33319,Ft=33320,qe=6403,Ot=36244,Lt=36248,bt=36249;let ki;function De(t){if(!ki){const e={};e[oa]={textureFormat:oa,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1,2,2,4],type:[N,et,le,q]},e[ha]={textureFormat:ha,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1,2,2,4],type:[N,et,le,q]},e[la]={textureFormat:la,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[2,4,4,8],type:[N,et,le,q]},e[st]={textureFormat:st,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3,6,6,12,2],type:[N,et,le,q,Ma]},e[R]={textureFormat:R,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,8,8,16,2,2],type:[N,et,le,q,va,ya]},e[he]={textureFormat:he,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2,4],type:[Et,Ct]},e[f1]={textureFormat:qe,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1],type:[N]},e[u1]={textureFormat:qe,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[1],type:[gt]},e[c1]={textureFormat:qe,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[4,2],type:[q,et]},e[g1]={textureFormat:qe,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[4],type:[q]},e[m1]={textureFormat:Ot,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[1],type:[N]},e[_1]={textureFormat:Ot,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[1],type:[gt]},e[P1]={textureFormat:Ot,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[Ct]},e[G1]={textureFormat:Ot,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[ke]},e[A1]={textureFormat:Ot,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Et]},e[I1]={textureFormat:Ot,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Ue]},e[x1]={textureFormat:ze,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[2],type:[N]},e[E1]={textureFormat:ze,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[2],type:[gt]},e[b1]={textureFormat:ze,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[8,4],type:[q,et]},e[S1]={textureFormat:ze,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[8],type:[q]},e[p1]={textureFormat:Ft,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[N]},e[w1]={textureFormat:Ft,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[gt]},e[d1]={textureFormat:Ft,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Ct]},e[v1]={textureFormat:Ft,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[ke]},e[y1]={textureFormat:Ft,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[Et]},e[M1]={textureFormat:Ft,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[Ue]},e[N1]={textureFormat:st,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3],type:[N]},e[T1]={textureFormat:st,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[3],type:[N]},e[R1]={textureFormat:st,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3,2],type:[N,Ma]},e[C1]={textureFormat:st,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[3],type:[gt]},e[F1]={textureFormat:st,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6,4],type:[q,et,uf]},e[O1]={textureFormat:st,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6,4],type:[q,et,cf]},e[L1]={textureFormat:st,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6],type:[q,et]},e[k1]={textureFormat:st,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[12],type:[q]},e[U1]={textureFormat:Lt,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[3],type:[N]},e[z1]={textureFormat:Lt,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[3],type:[gt]},e[q1]={textureFormat:Lt,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[6],type:[Ct]},e[D1]={textureFormat:Lt,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[6],type:[ke]},e[B1]={textureFormat:Lt,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[12],type:[Et]},e[$1]={textureFormat:Lt,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[12],type:[Ue]},e[j1]={textureFormat:R,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4],type:[N]},e[W1]={textureFormat:R,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4],type:[N]},e[H1]={textureFormat:R,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[4],type:[gt]},e[V1]={textureFormat:R,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,2,4],type:[N,ya,Li]},e[Q1]={textureFormat:R,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,2],type:[N,va]},e[X1]={textureFormat:R,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4],type:[Li]},e[K1]={textureFormat:R,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[16,8],type:[q,et]},e[Z1]={textureFormat:R,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[16],type:[q]},e[J1]={textureFormat:bt,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[N]},e[Y1]={textureFormat:bt,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[gt]},e[tf]={textureFormat:bt,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Li]},e[ef]={textureFormat:bt,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[Ct]},e[sf]={textureFormat:bt,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[ke]},e[af]={textureFormat:bt,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[16],type:[Ue]},e[rf]={textureFormat:bt,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[16],type:[Et]},e[nf]={textureFormat:he,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2,4],type:[Ct,Et]},e[of]={textureFormat:he,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Et]},e[hf]={textureFormat:he,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[q]},e[ff]={textureFormat:fa,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[mf]},e[lf]={textureFormat:fa,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[gf]},Object.keys(e).forEach(function(i){const s=e[i];s.bytesPerElementMap={},s.bytesPerElement.forEach(function(a,r){const o=s.type[r];s.bytesPerElementMap[o]=a})}),ki=e}return ki[t]}function _f(t,e){const i=De(t);if(!i)throw"unknown internal format";const s=i.bytesPerElementMap[e];if(s===void 0)throw"unknown internal format";return s}function fe(t){const e=De(t);if(!e)throw"unknown internal format";return{format:e.textureFormat,type:e.type[0]}}function xa(t){return(t&t-1)===0}function df(t,e,i,s){if(!ne(t))return xa(e)&&xa(i);const a=De(s);if(!a)throw"unknown internal format";return a.colorRenderable&&a.textureFilterable}function vf(t){const e=De(t);if(!e)throw"unknown internal format";return e.textureFilterable}function yf(t,e,i){return oe(e)?Gi(e):i||N}function Be(t,e,i,s,a){if(a%1!==0)throw"can't guess dimensions";if(!i&&!s){const r=Math.sqrt(a/(e===ct?6:1));r%1===0?(i=r,s=r):(i=a,s=1)}else if(s){if(!i&&(i=a/s,i%1))throw"can't guess dimensions"}else if(s=a/i,s%1)throw"can't guess dimensions";return{width:i,height:s}}function kt(t,e){e.colorspaceConversion!==void 0&&t.pixelStorei(o1,e.colorspaceConversion),e.premultiplyAlpha!==void 0&&t.pixelStorei(h1,e.premultiplyAlpha),e.flipY!==void 0&&t.pixelStorei(l1,e.flipY)}function Ea(t){t.pixelStorei(Oi,4),ne(t)&&(t.pixelStorei(ca,0),t.pixelStorei(ga,0),t.pixelStorei(ma,0),t.pixelStorei(_a,0),t.pixelStorei(da,0))}function Mf(t,e,i,s){s.minMag&&(i.call(t,e,Ci,s.minMag),i.call(t,e,Fi,s.minMag)),s.min&&i.call(t,e,Ci,s.min),s.mag&&i.call(t,e,Fi,s.mag),s.wrap&&(i.call(t,e,Oe,s.wrap),i.call(t,e,Le,s.wrap),(e===Mt||wl(t,e))&&i.call(t,e,ua,s.wrap)),s.wrapR&&i.call(t,e,ua,s.wrapR),s.wrapS&&i.call(t,e,Oe,s.wrapS),s.wrapT&&i.call(t,e,Le,s.wrapT),s.minLod!==void 0&&i.call(t,e,e1,s.minLod),s.maxLod!==void 0&&i.call(t,e,i1,s.maxLod),s.baseLevel!==void 0&&i.call(t,e,s1,s.baseLevel),s.maxLevel!==void 0&&i.call(t,e,a1,s.maxLevel),s.compareFunc!==void 0&&i.call(t,e,n1,s.compareFunc),s.compareMode!==void 0&&i.call(t,e,r1,s.compareMode)}function ba(t,e,i){const s=i.target||ut;t.bindTexture(s,e),Mf(t,s,t.texParameteri,i)}function xf(t){return t=t||ft.textureColor,oe(t)?t:new Uint8Array([t[0]*255,t[1]*255,t[2]*255,t[3]*255])}function Ui(t,e,i,s,a,r){i=i||ft.textureOptions,r=r||R;const o=i.target||ut;if(s=s||i.width,a=a||i.height,t.bindTexture(o,e),df(t,s,a,r))t.generateMipmap(o);else{const n=vf(r)?Xl:Ql;t.texParameteri(o,Ci,n),t.texParameteri(o,Fi,n),t.texParameteri(o,Oe,Fe),t.texParameteri(o,Le,Fe)}}function ue(t){return t.auto===!0||t.auto===void 0&&t.level===void 0}function zi(t,e){return e=e||{},e.cubeFaceOrder||[Ri,Kl,Zl,Jl,Yl,t1]}function qi(t,e){const i=zi(t,e).map(function(s,a){return{face:s,ndx:a}});return i.sort(function(s,a){return s.face-a.face}),i}function Sa(t,e,i,s){s=s||ft.textureOptions;const a=s.target||ut,r=s.level||0;let o=i.width,n=i.height;const h=s.internalFormat||s.format||R,l=fe(h),c=s.format||l.format,u=s.type||l.type;if(kt(t,s),t.bindTexture(a,e),a===ct){const f=i.width,m=i.height;let g,_;if(f/6===m)g=m,_=[0,0,1,0,2,0,3,0,4,0,5,0];else if(m/6===f)g=f,_=[0,0,0,1,0,2,0,3,0,4,0,5];else if(f/3===m/2)g=f/3,_=[0,0,1,0,2,0,0,1,1,1,2,1];else if(f/2===m/3)g=f/2,_=[0,0,1,0,0,1,1,1,0,2,1,2];else throw"can't figure out cube map from element: "+(i.src?i.src:i.nodeName);const d=na();d?(d.canvas.width=g,d.canvas.height=g,o=g,n=g,qi(t,s).forEach(function(y){const b=_[y.ndx*2+0]*g,M=_[y.ndx*2+1]*g;d.drawImage(i,b,M,g,g,0,0,g,g),t.texImage2D(y.face,r,h,c,u,d.canvas)}),d.canvas.width=1,d.canvas.height=1):typeof createImageBitmap<"u"&&(o=g,n=g,qi(t,s).forEach(function(y){const b=_[y.ndx*2+0]*g,M=_[y.ndx*2+1]*g;t.texImage2D(y.face,r,h,g,g,0,c,u,null),createImageBitmap(i,b,M,g,g,{premultiplyAlpha:"none",colorSpaceConversion:"none"}).then(function(S){kt(t,s),t.bindTexture(a,e),t.texImage2D(y.face,r,h,c,u,S),ue(s)&&Ui(t,e,s,o,n,h)})}))}else if(a===Mt||a===xt){const f=Math.min(i.width,i.height),m=Math.max(i.width,i.height),g=m/f;if(g%1!==0)throw"can not compute 3D dimensions of element";const _=i.width===m?1:0,d=i.height===m?1:0;t.pixelStorei(Oi,1),t.pixelStorei(ca,i.width),t.pixelStorei(ga,0),t.pixelStorei(da,0),t.texImage3D(a,r,h,f,f,f,0,c,u,null);for(let y=0;y<g;++y){const b=y*f*_,M=y*f*d;t.pixelStorei(ma,b),t.pixelStorei(_a,M),t.texSubImage3D(a,r,0,0,y,f,f,1,c,u,i)}Ea(t)}else t.texImage2D(a,r,h,c,u,i);ue(s)&&Ui(t,e,s,o,n,h),ba(t,e,s)}function ce(){}function Ef(t){if(typeof document<"u"){const e=document.createElement("a");return e.href=t,e.hostname===location.hostname&&e.port===location.port&&e.protocol===location.protocol}else{const e=new URL(location.href).origin;return new URL(t,location.href).origin===e}}function bf(t,e){return e===void 0&&!Ef(t)?"anonymous":e}function Sf(t,e,i){i=i||ce;let s;if(e=e!==void 0?e:ft.crossOrigin,e=bf(t,e),typeof Image<"u"){s=new Image,e!==void 0&&(s.crossOrigin=e);const a=function(){s.removeEventListener("error",r),s.removeEventListener("load",o),s=null},r=function(){const n="couldn't load image: "+t;Ks(n),i(n,s),a()},o=function(){i(null,s),a()};return s.addEventListener("error",r),s.addEventListener("load",o),s.src=t,s}else if(typeof ImageBitmap<"u"){let a,r;const o=function(){i(a,r)},n={};e&&(n.mode="cors"),fetch(t,n).then(function(h){if(!h.ok)throw h;return h.blob()}).then(function(h){return createImageBitmap(h,{premultiplyAlpha:"none",colorSpaceConversion:"none"})}).then(function(h){r=h,setTimeout(o)}).catch(function(h){a=h,setTimeout(o)}),s=null}return s}function pa(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap||typeof ImageData<"u"&&t instanceof ImageData||typeof HTMLElement<"u"&&t instanceof HTMLElement}function Di(t,e,i){return pa(t)?(setTimeout(function(){i(null,t)}),t):Sf(t,e,i)}function Bi(t,e,i){i=i||ft.textureOptions;const s=i.target||ut;if(t.bindTexture(s,e),i.color===!1)return;const a=xf(i.color);if(s===ct)for(let r=0;r<6;++r)t.texImage2D(Ri+r,0,R,1,1,0,R,N,a);else s===Mt||s===xt?t.texImage3D(s,0,R,1,1,1,0,R,N,a):t.texImage2D(s,0,R,1,1,0,R,N,a)}function pf(t,e,i,s){return s=s||ce,i=i||ft.textureOptions,Bi(t,e,i),i=Object.assign({},i),Di(i.src,i.crossOrigin,function(a,r){a?s(a,e,r):(Sa(t,e,r,i),s(null,e,r))})}function wf(t,e,i,s){s=s||ce;const a=i.src;if(a.length!==6)throw"there must be 6 urls for a cubemap";const r=i.level||0,o=i.internalFormat||i.format||R,n=fe(o),h=i.format||n.format,l=i.type||N,c=i.target||ut;if(c!==ct)throw"target must be TEXTURE_CUBE_MAP";Bi(t,e,i),i=Object.assign({},i);let u=6;const f=[],m=zi(t,i);let g;function _(d){return function(y,b){--u,y?f.push(y):b.width!==b.height?f.push("cubemap face img is not a square: "+b.src):(kt(t,i),t.bindTexture(c,e),u===5?zi().forEach(function(M){t.texImage2D(M,r,o,h,l,b)}):t.texImage2D(d,r,o,h,l,b),ue(i)&&t.generateMipmap(c)),u===0&&s(f.length?f:void 0,e,g)}}g=a.map(function(d,y){return Di(d,i.crossOrigin,_(m[y]))})}function Pf(t,e,i,s){s=s||ce;const a=i.src,r=i.internalFormat||i.format||R,o=fe(r),n=i.format||o.format,h=i.type||N,l=i.target||xt;if(l!==Mt&&l!==xt)throw"target must be TEXTURE_3D or TEXTURE_2D_ARRAY";Bi(t,e,i),i=Object.assign({},i);let c=a.length;const u=[];let f;const m=i.level||0;let g=i.width,_=i.height;const d=a.length;let y=!0;function b(M){return function(S,w){if(--c,S)u.push(S);else{if(kt(t,i),t.bindTexture(l,e),y){y=!1,g=i.width||w.width,_=i.height||w.height,t.texImage3D(l,m,r,g,_,d,0,n,h,null);for(let P=0;P<d;++P)t.texSubImage3D(l,m,0,0,P,g,_,1,n,h,w)}else{let P=w,G;(w.width!==g||w.height!==_)&&(G=na(),P=G.canvas,G.canvas.width=g,G.canvas.height=_,G.drawImage(w,0,0,g,_)),t.texSubImage3D(l,m,0,0,M,g,_,1,n,h,P),G&&P===G.canvas&&(G.canvas.width=0,G.canvas.height=0)}ue(i)&&t.generateMipmap(l)}c===0&&s(u.length?u:void 0,e,f)}}f=a.map(function(M,S){return Di(M,i.crossOrigin,b(S))})}function Gf(t,e,i,s){s=s||ft.textureOptions;const a=s.target||ut;t.bindTexture(a,e);let r=s.width,o=s.height,n=s.depth;const h=s.level||0,l=s.internalFormat||s.format||R,c=fe(l),u=s.format||c.format,f=s.type||yf(t,i,c.type);if(oe(i))i instanceof Uint8ClampedArray&&(i=new Uint8Array(i.buffer));else{const d=Xs(f);i=new d(i)}const m=_f(l,f),g=i.byteLength/m;if(g%1)throw"length wrong size for format: "+ra(t,u);let _;if(a===Mt||a===xt)if(!r&&!o&&!n){const d=Math.cbrt(g);if(d%1!==0)throw"can't guess cube size of array of numElements: "+g;r=d,o=d,n=d}else r&&(!o||!n)?(_=Be(t,a,o,n,g/r),o=_.width,n=_.height):o&&(!r||!n)?(_=Be(t,a,r,n,g/o),r=_.width,n=_.height):(_=Be(t,a,r,o,g/n),r=_.width,o=_.height);else _=Be(t,a,r,o,g),r=_.width,o=_.height;if(Ea(t),t.pixelStorei(Oi,s.unpackAlignment||1),kt(t,s),a===ct){const d=m/i.BYTES_PER_ELEMENT,y=g/6*d;qi(t,s).forEach(b=>{const M=y*b.ndx,S=i.subarray(M,M+y);t.texImage2D(b.face,h,l,r,o,0,u,f,S)})}else a===Mt||a===xt?t.texImage3D(a,h,l,r,o,n,0,u,f,i):t.texImage2D(a,h,l,r,o,0,u,f,i);return{width:r,height:o,depth:n,type:f}}function Af(t,e,i){const s=i.target||ut;t.bindTexture(s,e);const a=i.level||0,r=i.internalFormat||i.format||R,o=fe(r),n=i.format||o.format,h=i.type||o.type;if(kt(t,i),s===ct)for(let l=0;l<6;++l)t.texImage2D(Ri+l,a,r,i.width,i.height,0,n,h,null);else s===Mt||s===xt?t.texImage3D(s,a,r,i.width,i.height,i.depth,0,n,h,null):t.texImage2D(s,a,r,i.width,i.height,0,n,h,null)}function If(t,e,i){i=i||ce,e=e||ft.textureOptions;const s=t.createTexture(),a=e.target||ut;let r=e.width||1,o=e.height||1;const n=e.internalFormat||R;t.bindTexture(a,s),a===ct&&(t.texParameteri(a,Oe,Fe),t.texParameteri(a,Le,Fe));let h=e.src;if(h)if(typeof h=="function"&&(h=h(t,e)),typeof h=="string")pf(t,s,e,i);else if(oe(h)||Array.isArray(h)&&(typeof h[0]=="number"||Array.isArray(h[0])||oe(h[0]))){const l=Gf(t,s,h,e);r=l.width,o=l.height}else Array.isArray(h)&&(typeof h[0]=="string"||pa(h[0]))?a===ct?wf(t,s,e,i):Pf(t,s,e,i):(Sa(t,s,h,e),r=h.width,o=h.height);else Af(t,s,e);return ue(e)&&Ui(t,s,e,r,o,n),ba(t,s,e),s}const $i=Ks;function wa(t){return typeof document<"u"&&document.getElementById?document.getElementById(t):null}const $e=33984,je=34962,Nf=34963,Tf=35713,Rf=35714,Cf=35632,Ff=35633,Of=35981,Pa=35718,Lf=35721,kf=35971,Uf=35382,zf=35396,qf=35398,Df=35392,Bf=35395,We=5126,Ga=35664,Aa=35665,Ia=35666,ji=5124,Na=35667,Ta=35668,Ra=35669,Ca=35670,Fa=35671,Oa=35672,La=35673,ka=35674,Ua=35675,za=35676,$f=35678,jf=35680,Wf=35679,Hf=35682,Vf=35685,Qf=35686,Xf=35687,Kf=35688,Zf=35689,Jf=35690,Yf=36289,tu=36292,eu=36293,Wi=5125,qa=36294,Da=36295,Ba=36296,iu=36298,su=36299,au=36300,ru=36303,nu=36306,ou=36307,hu=36308,lu=36311,He=3553,Ve=34067,Hi=32879,Qe=35866,p={};function $a(t,e){return p[e].bindPoint}function fu(t,e){return function(i){t.uniform1f(e,i)}}function uu(t,e){return function(i){t.uniform1fv(e,i)}}function cu(t,e){return function(i){t.uniform2fv(e,i)}}function gu(t,e){return function(i){t.uniform3fv(e,i)}}function mu(t,e){return function(i){t.uniform4fv(e,i)}}function ja(t,e){return function(i){t.uniform1i(e,i)}}function Wa(t,e){return function(i){t.uniform1iv(e,i)}}function Ha(t,e){return function(i){t.uniform2iv(e,i)}}function Va(t,e){return function(i){t.uniform3iv(e,i)}}function Qa(t,e){return function(i){t.uniform4iv(e,i)}}function _u(t,e){return function(i){t.uniform1ui(e,i)}}function du(t,e){return function(i){t.uniform1uiv(e,i)}}function vu(t,e){return function(i){t.uniform2uiv(e,i)}}function yu(t,e){return function(i){t.uniform3uiv(e,i)}}function Mu(t,e){return function(i){t.uniform4uiv(e,i)}}function xu(t,e){return function(i){t.uniformMatrix2fv(e,!1,i)}}function Eu(t,e){return function(i){t.uniformMatrix3fv(e,!1,i)}}function bu(t,e){return function(i){t.uniformMatrix4fv(e,!1,i)}}function Su(t,e){return function(i){t.uniformMatrix2x3fv(e,!1,i)}}function pu(t,e){return function(i){t.uniformMatrix3x2fv(e,!1,i)}}function wu(t,e){return function(i){t.uniformMatrix2x4fv(e,!1,i)}}function Pu(t,e){return function(i){t.uniformMatrix4x2fv(e,!1,i)}}function Gu(t,e){return function(i){t.uniformMatrix3x4fv(e,!1,i)}}function Au(t,e){return function(i){t.uniformMatrix4x3fv(e,!1,i)}}function $(t,e,i,s){const a=$a(t,e);return ne(t)?function(r){let o,n;!r||Js(t,r)?(o=r,n=null):(o=r.texture,n=r.sampler),t.uniform1i(s,i),t.activeTexture($e+i),t.bindTexture(a,o),t.bindSampler(i,n)}:function(r){t.uniform1i(s,i),t.activeTexture($e+i),t.bindTexture(a,r)}}function j(t,e,i,s,a){const r=$a(t,e),o=new Int32Array(a);for(let n=0;n<a;++n)o[n]=i+n;return ne(t)?function(n){t.uniform1iv(s,o),n.forEach(function(h,l){t.activeTexture($e+o[l]);let c,u;!h||Js(t,h)?(c=h,u=null):(c=h.texture,u=h.sampler),t.bindSampler(i,u),t.bindTexture(r,c)})}:function(n){t.uniform1iv(s,o),n.forEach(function(h,l){t.activeTexture($e+o[l]),t.bindTexture(r,h)})}}p[We]={Type:Float32Array,size:4,setter:fu,arraySetter:uu},p[Ga]={Type:Float32Array,size:8,setter:cu,cols:2},p[Aa]={Type:Float32Array,size:12,setter:gu,cols:3},p[Ia]={Type:Float32Array,size:16,setter:mu,cols:4},p[ji]={Type:Int32Array,size:4,setter:ja,arraySetter:Wa},p[Na]={Type:Int32Array,size:8,setter:Ha,cols:2},p[Ta]={Type:Int32Array,size:12,setter:Va,cols:3},p[Ra]={Type:Int32Array,size:16,setter:Qa,cols:4},p[Wi]={Type:Uint32Array,size:4,setter:_u,arraySetter:du},p[qa]={Type:Uint32Array,size:8,setter:vu,cols:2},p[Da]={Type:Uint32Array,size:12,setter:yu,cols:3},p[Ba]={Type:Uint32Array,size:16,setter:Mu,cols:4},p[Ca]={Type:Uint32Array,size:4,setter:ja,arraySetter:Wa},p[Fa]={Type:Uint32Array,size:8,setter:Ha,cols:2},p[Oa]={Type:Uint32Array,size:12,setter:Va,cols:3},p[La]={Type:Uint32Array,size:16,setter:Qa,cols:4},p[ka]={Type:Float32Array,size:32,setter:xu,rows:2,cols:2},p[Ua]={Type:Float32Array,size:48,setter:Eu,rows:3,cols:3},p[za]={Type:Float32Array,size:64,setter:bu,rows:4,cols:4},p[Vf]={Type:Float32Array,size:32,setter:Su,rows:2,cols:3},p[Qf]={Type:Float32Array,size:32,setter:wu,rows:2,cols:4},p[Xf]={Type:Float32Array,size:48,setter:pu,rows:3,cols:2},p[Kf]={Type:Float32Array,size:48,setter:Gu,rows:3,cols:4},p[Zf]={Type:Float32Array,size:64,setter:Pu,rows:4,cols:2},p[Jf]={Type:Float32Array,size:64,setter:Au,rows:4,cols:3},p[$f]={Type:null,size:0,setter:$,arraySetter:j,bindPoint:He},p[jf]={Type:null,size:0,setter:$,arraySetter:j,bindPoint:Ve},p[Wf]={Type:null,size:0,setter:$,arraySetter:j,bindPoint:Hi},p[Hf]={Type:null,size:0,setter:$,arraySetter:j,bindPoint:He},p[Yf]={Type:null,size:0,setter:$,arraySetter:j,bindPoint:Qe},p[tu]={Type:null,size:0,setter:$,arraySetter:j,bindPoint:Qe},p[eu]={Type:null,size:0,setter:$,arraySetter:j,bindPoint:Ve},p[iu]={Type:null,size:0,setter:$,arraySetter:j,bindPoint:He},p[su]={Type:null,size:0,setter:$,arraySetter:j,bindPoint:Hi},p[au]={Type:null,size:0,setter:$,arraySetter:j,bindPoint:Ve},p[ru]={Type:null,size:0,setter:$,arraySetter:j,bindPoint:Qe},p[nu]={Type:null,size:0,setter:$,arraySetter:j,bindPoint:He},p[ou]={Type:null,size:0,setter:$,arraySetter:j,bindPoint:Hi},p[hu]={Type:null,size:0,setter:$,arraySetter:j,bindPoint:Ve},p[lu]={Type:null,size:0,setter:$,arraySetter:j,bindPoint:Qe};function Xe(t,e){return function(i){if(i.value)switch(t.disableVertexAttribArray(e),i.value.length){case 4:t.vertexAttrib4fv(e,i.value);break;case 3:t.vertexAttrib3fv(e,i.value);break;case 2:t.vertexAttrib2fv(e,i.value);break;case 1:t.vertexAttrib1fv(e,i.value);break;default:throw new Error("the length of a float constant value must be between 1 and 4!")}else t.bindBuffer(je,i.buffer),t.enableVertexAttribArray(e),t.vertexAttribPointer(e,i.numComponents||i.size,i.type||We,i.normalize||!1,i.stride||0,i.offset||0),t.vertexAttribDivisor&&t.vertexAttribDivisor(e,i.divisor||0)}}function mt(t,e){return function(i){if(i.value)if(t.disableVertexAttribArray(e),i.value.length===4)t.vertexAttrib4iv(e,i.value);else throw new Error("The length of an integer constant value must be 4!");else t.bindBuffer(je,i.buffer),t.enableVertexAttribArray(e),t.vertexAttribIPointer(e,i.numComponents||i.size,i.type||ji,i.stride||0,i.offset||0),t.vertexAttribDivisor&&t.vertexAttribDivisor(e,i.divisor||0)}}function Ke(t,e){return function(i){if(i.value)if(t.disableVertexAttribArray(e),i.value.length===4)t.vertexAttrib4uiv(e,i.value);else throw new Error("The length of an unsigned integer constant value must be 4!");else t.bindBuffer(je,i.buffer),t.enableVertexAttribArray(e),t.vertexAttribIPointer(e,i.numComponents||i.size,i.type||Wi,i.stride||0,i.offset||0),t.vertexAttribDivisor&&t.vertexAttribDivisor(e,i.divisor||0)}}function Vi(t,e,i){const s=i.size,a=i.count;return function(r){t.bindBuffer(je,r.buffer);const o=r.size||r.numComponents||s,n=o/a,h=r.type||We,l=p[h].size*o,c=r.normalize||!1,u=r.offset||0,f=l/a;for(let m=0;m<a;++m)t.enableVertexAttribArray(e+m),t.vertexAttribPointer(e+m,n,h,c,l,u+f*m),t.vertexAttribDivisor&&t.vertexAttribDivisor(e+m,r.divisor||0)}}const L={};L[We]={size:4,setter:Xe},L[Ga]={size:8,setter:Xe},L[Aa]={size:12,setter:Xe},L[Ia]={size:16,setter:Xe},L[ji]={size:4,setter:mt},L[Na]={size:8,setter:mt},L[Ta]={size:12,setter:mt},L[Ra]={size:16,setter:mt},L[Wi]={size:4,setter:Ke},L[qa]={size:8,setter:Ke},L[Da]={size:12,setter:Ke},L[Ba]={size:16,setter:Ke},L[Ca]={size:4,setter:mt},L[Fa]={size:8,setter:mt},L[Oa]={size:12,setter:mt},L[La]={size:16,setter:mt},L[ka]={size:4,setter:Vi,count:2},L[Ua]={size:9,setter:Vi,count:3},L[za]={size:16,setter:Vi,count:4};const Iu=/ERROR:\s*\d+:(\d+)/gi;function Nu(t,e="",i=0){const s=[...e.matchAll(Iu)],a=new Map(s.map((r,o)=>{const n=parseInt(r[1]),h=s[o+1],l=h?h.index:e.length,c=e.substring(r.index,l);return[n-1,c]}));return t.split(`
|
|
7
|
+
`).map((r,o)=>{const n=a.get(o);return`${o+1+i}: ${r}${n?`
|
|
8
|
+
|
|
9
|
+
^^^ ${n}`:""}`}).join(`
|
|
10
|
+
`)}const Xa=/^[ \t]*\n/;function Ka(t){let e=0;return Xa.test(t)&&(e=1,t=t.replace(Xa,"")),{lineOffset:e,shaderSource:t}}function Tu(t,e){return t.errorCallback(e),t.callback&&setTimeout(()=>{t.callback(`${e}
|
|
11
|
+
${t.errors.join(`
|
|
12
|
+
`)}`)}),null}function Ru(t,e,i,s){if(s=s||$i,!t.getShaderParameter(i,Tf)){const a=t.getShaderInfoLog(i),{lineOffset:r,shaderSource:o}=Ka(t.getShaderSource(i)),n=`${Nu(o,a,r)}
|
|
13
|
+
Error compiling ${ra(t,e)}: ${a}`;return s(n),n}return""}function Qi(t,e,i){let s,a,r;if(typeof t=="function")i=t,t=void 0;else if(t&&!Array.isArray(t)){const l=t;i=l.errorCallback,t=l.attribLocations,s=l.transformFeedbackVaryings,a=l.transformFeedbackMode,r=l.callback}const o=i||$i,n=[],h={errorCallback(l,...c){n.push(l),o(l,...c)},transformFeedbackVaryings:s,transformFeedbackMode:a,callback:r,errors:n};{let l={};Array.isArray(t)?t.forEach(function(c,u){l[c]=u}):l=t||{},h.attribLocations=l}return h}const Cu=["VERTEX_SHADER","FRAGMENT_SHADER"];function Fu(t,e){if(e.indexOf("frag")>=0)return Cf;if(e.indexOf("vert")>=0)return Ff}function Ou(t,e,i){const s=t.getAttachedShaders(e);for(const a of s)i.has(a)&&t.deleteShader(a);t.deleteProgram(e)}const Lu=(t=0)=>new Promise(e=>setTimeout(e,t));function ku(t,e,i){const s=t.createProgram(),{attribLocations:a,transformFeedbackVaryings:r,transformFeedbackMode:o}=Qi(i);for(let n=0;n<e.length;++n){let h=e[n];if(typeof h=="string"){const l=wa(h),c=l?l.text:h;let u=t[Cu[n]];l&&l.type&&(u=Fu(t,l.type)||u),h=t.createShader(u),t.shaderSource(h,Ka(c).shaderSource),t.compileShader(h),t.attachShader(s,h)}}Object.entries(a).forEach(([n,h])=>t.bindAttribLocation(s,h,n));{let n=r;n&&(n.attribs&&(n=n.attribs),Array.isArray(n)||(n=Object.keys(n)),t.transformFeedbackVaryings(s,n,o||Of))}return t.linkProgram(s),s}function Uu(t,e,i,s,a){const r=Qi(i,s,a),o=new Set(e),n=ku(t,e,r);function h(l,c){const u=qu(l,c,r.errorCallback);return u&&Ou(l,c,o),u}if(r.callback){zu(t,n).then(()=>{const l=h(t,n);r.callback(l,l?void 0:n)});return}return h(t,n)?void 0:n}async function zu(t,e){const i=t.getExtension("KHR_parallel_shader_compile"),s=i?(r,o)=>r.getProgramParameter(o,i.COMPLETION_STATUS_KHR):()=>!0;let a=0;do await Lu(a),a=1e3/60;while(!s(t,e))}function qu(t,e,i){if(i=i||$i,!t.getProgramParameter(e,Rf)){const s=t.getProgramInfoLog(e);i(`Error in program linking: ${s}`);const a=t.getAttachedShaders(e).map(r=>Ru(t,t.getShaderParameter(r,t.SHADER_TYPE),r,i));return`${s}
|
|
14
|
+
${a.filter(r=>r).join(`
|
|
15
|
+
`)}`}}function Du(t,e,i,s,a){return Uu(t,e,i,s,a)}function Za(t){const e=t.name;return e.startsWith("gl_")||e.startsWith("webgl_")}const Bu=/(\.|\[|]|\w+)/g,$u=t=>t>="0"&&t<="9";function ju(t,e,i,s){const a=t.split(Bu).filter(n=>n!=="");let r=0,o="";for(;;){const n=a[r++];o+=n;const h=$u(n[0]),l=h?parseInt(n):n;if(h&&(o+=a[r++]),r===a.length){i[l]=e;break}else{const c=a[r++],u=c==="[",f=i[l]||(u?[]:{});i[l]=f,i=f,s[o]=s[o]||function(m){return function(g){Ja(m,g)}}(f),o+=c}}}function Wu(t,e){let i=0;function s(n,h,l){const c=h.name.endsWith("[0]"),u=h.type,f=p[u];if(!f)throw new Error(`unknown type: 0x${u.toString(16)}`);let m;if(f.bindPoint){const g=i;i+=h.size,c?m=f.arraySetter(t,u,g,l,h.size):m=f.setter(t,u,g,l,h.size)}else f.arraySetter&&c?m=f.arraySetter(t,l):m=f.setter(t,l);return m.location=l,m}const a={},r={},o=t.getProgramParameter(e,Pa);for(let n=0;n<o;++n){const h=t.getActiveUniform(e,n);if(Za(h))continue;let l=h.name;l.endsWith("[0]")&&(l=l.substr(0,l.length-3));const c=t.getUniformLocation(e,h.name);if(c){const u=s(e,h,c);a[l]=u,ju(l,u,r,a)}}return a}function Hu(t,e){const i={},s=t.getProgramParameter(e,kf);for(let a=0;a<s;++a){const r=t.getTransformFeedbackVarying(e,a);i[r.name]={index:a,type:r.type,size:r.size}}return i}function Vu(t,e){const i=t.getProgramParameter(e,Pa),s=[],a=[];for(let n=0;n<i;++n){a.push(n),s.push({});const h=t.getActiveUniform(e,n);s[n].name=h.name}[["UNIFORM_TYPE","type"],["UNIFORM_SIZE","size"],["UNIFORM_BLOCK_INDEX","blockNdx"],["UNIFORM_OFFSET","offset"]].forEach(function(n){const h=n[0],l=n[1];t.getActiveUniforms(e,a,t[h]).forEach(function(c,u){s[u][l]=c})});const r={},o=t.getProgramParameter(e,Uf);for(let n=0;n<o;++n){const h=t.getActiveUniformBlockName(e,n),l={index:t.getUniformBlockIndex(e,h),usedByVertexShader:t.getActiveUniformBlockParameter(e,n,zf),usedByFragmentShader:t.getActiveUniformBlockParameter(e,n,qf),size:t.getActiveUniformBlockParameter(e,n,Df),uniformIndices:t.getActiveUniformBlockParameter(e,n,Bf)};l.used=l.usedByVertexShader||l.usedByFragmentShader,r[h]=l}return{blockSpecs:r,uniformData:s}}function Ja(t,e){for(const i in e){const s=t[i];typeof s=="function"?s(e[i]):Ja(t[i],e[i])}}function Xi(t,...e){const i=t.uniformSetters||t,s=e.length;for(let a=0;a<s;++a){const r=e[a];if(Array.isArray(r)){const o=r.length;for(let n=0;n<o;++n)Xi(i,r[n])}else for(const o in r){const n=i[o];n&&n(r[o])}}}function Qu(t,e){const i={},s=t.getProgramParameter(e,Lf);for(let a=0;a<s;++a){const r=t.getActiveAttrib(e,a);if(Za(r))continue;const o=t.getAttribLocation(e,r.name),n=L[r.type],h=n.setter(t,o,n);h.location=o,i[r.name]=h}return i}function Xu(t,e){for(const i in e){const s=t[i];s&&s(e[i])}}function Ya(t,e,i){i.vertexArrayObject?t.bindVertexArray(i.vertexArrayObject):(Xu(e.attribSetters||e,i.attribs),i.indices&&t.bindBuffer(Nf,i.indices))}function tr(t,e){const i=Wu(t,e),s=Qu(t,e),a={program:e,uniformSetters:i,attribSetters:s};return ne(t)&&(a.uniformBlockSpec=Vu(t,e),a.transformFeedbackInfo=Hu(t,e)),a}const Ku=/\s|{|}|;/;function Ki(t,e,i,s,a){const r=Qi(i,s,a),o=[];if(e=e.map(function(l){if(!Ku.test(l)){const c=wa(l);if(c)l=c.text;else{const u=`no element with id: ${l}`;r.errorCallback(u),o.push(u)}}return l}),o.length)return Tu(r,"");const n=r.callback;n&&(r.callback=(l,c)=>{n(l,l?void 0:tr(t,c))});const h=Du(t,e,r);return h?tr(t,h):null}class Zu{constructor(e=[],i=(s,a)=>s<a?-1:s>a?1:0){if(this.data=e,this.length=this.data.length,this.compare=i,this.length>0)for(let s=(this.length>>1)-1;s>=0;s--)this._down(s)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;const e=this.data[0],i=this.data.pop();return--this.length>0&&(this.data[0]=i,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:i,compare:s}=this,a=i[e];for(;e>0;){const r=e-1>>1,o=i[r];if(s(a,o)>=0)break;i[e]=o,e=r}i[e]=a}_down(e){const{data:i,compare:s}=this,a=this.length>>1,r=i[e];for(;e<a;){let o=(e<<1)+1;const n=o+1;if(n<this.length&&s(i[n],i[o])<0&&(o=n),s(i[o],r)>=0)break;i[e]=i[o],e=o}i[e]=r}}class Ju{constructor(e,i,s,a){this._projector=e,this._verts=i,this._uv=s,this._projVerts=i.map(e),this._trigs=a,this._segs=[],this._segCount=0,this._segTrigs=[],this._queue=new Zu([],function(r,o){return o.epsilon-r.epsilon}),this._vertToSeg=new Array(i.length);for(const r in this._verts)this._vertToSeg[r]=[];for(const r in this._trigs){const o=this._trigs[r],n=o[0],h=o[1],l=o[2];this._segment(n,h,r),this._segment(h,l,r),this._segment(l,n,r)}}_segment(e,i,s,a=1/0){if(this._vertToSeg[e]&&this._vertToSeg[e][i]!==void 0){const c=this._vertToSeg[e][i];return this._segTrigs[c].includes(s)||this._segTrigs[c].push(s),c}const r=this._segCount++;this._segs[r]=[e,i],this._vertToSeg[e][i]=r,this._vertToSeg[i][e]=r,this._segTrigs[r]=[s];const o=[(this._verts[e][0]+this._verts[i][0])/2,(this._verts[e][1]+this._verts[i][1])/2],n=this._projector(o),h=[(this._projVerts[e][0]+this._projVerts[i][0])/2,(this._projVerts[e][1]+this._projVerts[i][1])/2],l=(n[0]-h[0])**2+(n[1]-h[1])**2;return Number.isFinite(l)&&l<a&&this._queue.push({v1:e,v2:i,epsilon:l,midpoint:o,projectedMid:n}),r}output(){return{unprojected:Array.from(this._verts),projected:Array.from(this._projVerts),uv:Array.from(this._uv),trigs:Array.from(this._trigs)}}_stepsWithSameEpsilon=0;lowerEpsilon(e){let i=this._queue.peek().epsilon,s=i;for(;i>=e;)if(this.step(),i=this._queue.peek().epsilon,i===s){if(this._stepsWithSameEpsilon++,this._stepsWithSameEpsilon<500){console.warn("Arrugator stopped due to epsilon stall. Raster may need hints for proper arrugation.");break}}else this._stepsWithSameEpsilon=0,s=i}get epsilon(){return this._queue.peek().epsilon}set epsilon(e){return this.lowerEpsilon(e)}step(){const e=this._queue.pop();return this._splitSegment(e,e.epsilon)}force(){const e=this._queue.data;this._queue.data=[],this._queue.length=0,e.forEach(i=>this._splitSegment(i,1/0))}_splitSegment(e,i){const s=e.v1,a=e.v2,r=this._vertToSeg[s]&&this._vertToSeg[s][a],o=this._segTrigs[r];if(o.length>=3)throw new Error("Somehow a segment is shared by three triangles");delete this._segTrigs[r],delete this._segs[r],delete this._vertToSeg[s][a],delete this._vertToSeg[a][s];const n=this._verts.length;this._projVerts[n]=e.projectedMid,this._verts[n]=e.midpoint,this._vertToSeg[n]=[],this._uv[n]=[(this._uv[s][0]+this._uv[a][0])/2,(this._uv[s][1]+this._uv[a][1])/2];for(const h of o)this._splitTriangle(s,a,n,h,i)}_splitTriangle(e,i,s,a,r=1/0){const o=this._trigs[a];let n,h=!1;if(o[0]===e&&o[1]===i)n=o[2],h=!0;else if(o[1]===e&&o[2]===i)n=o[0],h=!0;else if(o[2]===e&&o[0]===i)n=o[1],h=!0;else if(o[1]===e&&o[0]===i)n=o[2],h=!1;else if(o[2]===e&&o[1]===i)n=o[0],h=!1;else if(o[0]===e&&o[2]===i)n=o[1],h=!1;else throw new Error("Data structure mishap: could not fetch 3rd vertex used in triangle");const l=this._trigs.length;h?(this._trigs[a]=[e,s,n],this._trigs[l]=[s,i,n]):(this._trigs[a]=[s,e,n],this._trigs[l]=[i,s,n]);const c=this._vertToSeg[e]&&this._vertToSeg[e][i],u=this._vertToSeg[i]&&this._vertToSeg[i][n],f=this._vertToSeg[n]&&this._vertToSeg[n][e];function m(g){return g!==a}c!==void 0&&(this._segTrigs[c]=this._segTrigs[c].filter(m)),u!==void 0&&(this._segTrigs[u]=this._segTrigs[u].filter(m)),f!==void 0&&(this._segTrigs[f]=this._segTrigs[f].filter(m)),this._segment(e,s,a,r),this._segment(s,n,a,r),this._segment(n,e,a,r),this._segment(i,s,l,r),this._segment(s,n,l,r),this._segment(n,i,l,r)}}function er(t,e,i=100){const s=[-20037508342789244e-9,20037508342789244e-9],a=[e[0],e[3],e[1],e[2]],r=Hs(t,"EPSG:3857").forward;function o(c){const u=r(c),f=Math.abs((u[0]-s[0])/(20037508342789244e-9*2)),m=Math.abs((u[1]-s[1])/(20037508342789244e-9*2));return[f,m]}const n=[[0,0],[0,1],[1,0],[1,1]],h=new Ju(o,a,n,[[0,1,3],[0,3,2]]);if(i>0){h.force();for(let c=0;c<i;c++)h.step()}const l=h.output();return{pos:l.projected.flat(),uv:l.uv.flat(),trigs:l.trigs.flat()}}function ir(t,e,i=2){const s=e&&e.length,a=s?e[0]*i:t.length;let r=sr(t,0,a,i,!0);const o=[];if(!r||r.next===r.prev)return o;let n,h,l;if(s&&(r=sc(t,e,r,i)),t.length>80*i){n=1/0,h=1/0;let c=-1/0,u=-1/0;for(let f=i;f<a;f+=i){const m=t[f],g=t[f+1];m<n&&(n=m),g<h&&(h=g),m>c&&(c=m),g>u&&(u=g)}l=Math.max(c-n,u-h),l=l!==0?32767/l:0}return ge(r,o,i,n,h,l,0),o}function sr(t,e,i,s,a){let r;if(a===mc(t,e,i,s)>0)for(let o=e;o<i;o+=s)r=or(o/s|0,t[o],t[o+1],r);else for(let o=i-s;o>=e;o-=s)r=or(o/s|0,t[o],t[o+1],r);return r&&Ut(r,r.next)&&(de(r),r=r.next),r}function St(t,e){if(!t)return t;e||(e=t);let i=t,s;do if(s=!1,!i.steiner&&(Ut(i,i.next)||C(i.prev,i,i.next)===0)){if(de(i),i=e=i.prev,i===i.next)break;s=!0}else i=i.next;while(s||i!==e);return e}function ge(t,e,i,s,a,r,o){if(!t)return;!o&&r&&hc(t,s,a,r);let n=t;for(;t.prev!==t.next;){const h=t.prev,l=t.next;if(r?tc(t,s,a,r):Yu(t)){e.push(h.i,t.i,l.i),de(t),t=l.next,n=l.next;continue}if(t=l,t===n){o?o===1?(t=ec(St(t),e),ge(t,e,i,s,a,r,2)):o===2&&ic(t,e,i,s,a,r):ge(St(t),e,i,s,a,r,1);break}}}function Yu(t){const e=t.prev,i=t,s=t.next;if(C(e,i,s)>=0)return!1;const a=e.x,r=i.x,o=s.x,n=e.y,h=i.y,l=s.y,c=Math.min(a,r,o),u=Math.min(n,h,l),f=Math.max(a,r,o),m=Math.max(n,h,l);let g=s.next;for(;g!==e;){if(g.x>=c&&g.x<=f&&g.y>=u&&g.y<=m&&me(a,n,r,h,o,l,g.x,g.y)&&C(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function tc(t,e,i,s){const a=t.prev,r=t,o=t.next;if(C(a,r,o)>=0)return!1;const n=a.x,h=r.x,l=o.x,c=a.y,u=r.y,f=o.y,m=Math.min(n,h,l),g=Math.min(c,u,f),_=Math.max(n,h,l),d=Math.max(c,u,f),y=Zi(m,g,e,i,s),b=Zi(_,d,e,i,s);let M=t.prevZ,S=t.nextZ;for(;M&&M.z>=y&&S&&S.z<=b;){if(M.x>=m&&M.x<=_&&M.y>=g&&M.y<=d&&M!==a&&M!==o&&me(n,c,h,u,l,f,M.x,M.y)&&C(M.prev,M,M.next)>=0||(M=M.prevZ,S.x>=m&&S.x<=_&&S.y>=g&&S.y<=d&&S!==a&&S!==o&&me(n,c,h,u,l,f,S.x,S.y)&&C(S.prev,S,S.next)>=0))return!1;S=S.nextZ}for(;M&&M.z>=y;){if(M.x>=m&&M.x<=_&&M.y>=g&&M.y<=d&&M!==a&&M!==o&&me(n,c,h,u,l,f,M.x,M.y)&&C(M.prev,M,M.next)>=0)return!1;M=M.prevZ}for(;S&&S.z<=b;){if(S.x>=m&&S.x<=_&&S.y>=g&&S.y<=d&&S!==a&&S!==o&&me(n,c,h,u,l,f,S.x,S.y)&&C(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}function ec(t,e){let i=t;do{const s=i.prev,a=i.next.next;!Ut(s,a)&&rr(s,i,i.next,a)&&_e(s,a)&&_e(a,s)&&(e.push(s.i,i.i,a.i),de(i),de(i.next),i=t=a),i=i.next}while(i!==t);return St(i)}function ic(t,e,i,s,a,r){let o=t;do{let n=o.next.next;for(;n!==o.prev;){if(o.i!==n.i&&uc(o,n)){let h=nr(o,n);o=St(o,o.next),h=St(h,h.next),ge(o,e,i,s,a,r,0),ge(h,e,i,s,a,r,0);return}n=n.next}o=o.next}while(o!==t)}function sc(t,e,i,s){const a=[];for(let r=0,o=e.length;r<o;r++){const n=e[r]*s,h=r<o-1?e[r+1]*s:t.length,l=sr(t,n,h,s,!1);l===l.next&&(l.steiner=!0),a.push(fc(l))}a.sort(ac);for(let r=0;r<a.length;r++)i=rc(a[r],i);return i}function ac(t,e){let i=t.x-e.x;if(i===0&&(i=t.y-e.y,i===0)){const s=(t.next.y-t.y)/(t.next.x-t.x),a=(e.next.y-e.y)/(e.next.x-e.x);i=s-a}return i}function rc(t,e){const i=nc(t,e);if(!i)return e;const s=nr(i,t);return St(s,s.next),St(i,i.next)}function nc(t,e){let i=e;const s=t.x,a=t.y;let r=-1/0,o;if(Ut(t,i))return i;do{if(Ut(t,i.next))return i.next;if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){const u=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(u<=s&&u>r&&(r=u,o=i.x<i.next.x?i:i.next,u===s))return o}i=i.next}while(i!==e);if(!o)return null;const n=o,h=o.x,l=o.y;let c=1/0;i=o;do{if(s>=i.x&&i.x>=h&&s!==i.x&&ar(a<l?s:r,a,h,l,a<l?r:s,a,i.x,i.y)){const u=Math.abs(a-i.y)/(s-i.x);_e(i,t)&&(u<c||u===c&&(i.x>o.x||i.x===o.x&&oc(o,i)))&&(o=i,c=u)}i=i.next}while(i!==n);return o}function oc(t,e){return C(t.prev,t,e.prev)<0&&C(e.next,t,t.next)<0}function hc(t,e,i,s){let a=t;do a.z===0&&(a.z=Zi(a.x,a.y,e,i,s)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==t);a.prevZ.nextZ=null,a.prevZ=null,lc(a)}function lc(t){let e,i=1;do{let s=t,a;t=null;let r=null;for(e=0;s;){e++;let o=s,n=0;for(let l=0;l<i&&(n++,o=o.nextZ,!!o);l++);let h=i;for(;n>0||h>0&&o;)n!==0&&(h===0||!o||s.z<=o.z)?(a=s,s=s.nextZ,n--):(a=o,o=o.nextZ,h--),r?r.nextZ=a:t=a,a.prevZ=r,r=a;s=o}r.nextZ=null,i*=2}while(e>1);return t}function Zi(t,e,i,s,a){return t=(t-i)*a|0,e=(e-s)*a|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function fc(t){let e=t,i=t;do(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next;while(e!==t);return i}function ar(t,e,i,s,a,r,o,n){return(a-o)*(e-n)>=(t-o)*(r-n)&&(t-o)*(s-n)>=(i-o)*(e-n)&&(i-o)*(r-n)>=(a-o)*(s-n)}function me(t,e,i,s,a,r,o,n){return!(t===o&&e===n)&&ar(t,e,i,s,a,r,o,n)}function uc(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!cc(t,e)&&(_e(t,e)&&_e(e,t)&&gc(t,e)&&(C(t.prev,t,e.prev)||C(t,e.prev,e))||Ut(t,e)&&C(t.prev,t,t.next)>0&&C(e.prev,e,e.next)>0)}function C(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function Ut(t,e){return t.x===e.x&&t.y===e.y}function rr(t,e,i,s){const a=Je(C(t,e,i)),r=Je(C(t,e,s)),o=Je(C(i,s,t)),n=Je(C(i,s,e));return!!(a!==r&&o!==n||a===0&&Ze(t,i,e)||r===0&&Ze(t,s,e)||o===0&&Ze(i,t,s)||n===0&&Ze(i,e,s))}function Ze(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function Je(t){return t>0?1:t<0?-1:0}function cc(t,e){let i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&rr(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}function _e(t,e){return C(t.prev,t,t.next)<0?C(t,e,t.next)>=0&&C(t,t.prev,e)>=0:C(t,e,t.prev)<0||C(t,t.next,e)<0}function gc(t,e){let i=t,s=!1;const a=(t.x+e.x)/2,r=(t.y+e.y)/2;do i.y>r!=i.next.y>r&&i.next.y!==i.y&&a<(i.next.x-i.x)*(r-i.y)/(i.next.y-i.y)+i.x&&(s=!s),i=i.next;while(i!==t);return s}function nr(t,e){const i=Ji(t.i,t.x,t.y),s=Ji(e.i,e.x,e.y),a=t.next,r=e.prev;return t.next=e,e.prev=t,i.next=a,a.prev=i,s.next=i,i.prev=s,r.next=s,s.prev=r,s}function or(t,e,i,s){const a=Ji(t,e,i);return s?(a.next=s.next,a.prev=s,s.next.prev=a,s.next=a):(a.prev=a,a.next=a),a}function de(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Ji(t,e,i){return{i:t,x:e,y:i,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function mc(t,e,i,s){let a=0;for(let r=e,o=i-s;r<i;r+=s)a+=(t[o]-t[r])*(t[r+1]+t[o+1]),o=r;return a}function hr(t){const e=[],i=[],s=t[0][0].length;let a=0,r=0;for(const o of t){for(const n of o)for(let h=0;h<s;h++)e.push(n[h]);r&&(a+=r,i.push(a)),r=o.length}return{vertices:e,holes:i,dimensions:s}}function lr(t){if(Object.prototype.hasOwnProperty.call(t,"type")){const e=t.type;if(e==="Polygon"||e==="MultiPolygon")return t;if(e==="Feature"&&(t.geometry.type==="Polygon"||t.geometry.type==="MultiPolygon"))return t.geometry;if(e==="FeatureCollection"){const i=t.features.filter(s=>s.geometry.type==="Polygon"||s.geometry.type==="MultiPolygon");if(i.length===1)return i[0].geometry;if(i.length>1){const s=[];for(const a of i){const r=a.geometry;if(r.type==="MultiPolygon")for(const o of r.coordinates)s.push(o);else s.push(r.coordinates)}return{type:"MultiPolygon",coordinates:s}}else throw new Error("No valid Polygon or MultiPolygon features found")}else throw new Error("Invalid GeoJSON format, only support Polygon, MultiPolygon, Feature, FeatureCollection")}else throw new Error("Invalid GeoJSON format")}function _c(t){return typeof t=="string"?fetch(t).then(e=>e.json()).then(e=>lr(e)):Promise.resolve(lr(t))}function dc(t){let e=[],i=[];if(t.type==="MultiPolygon"){const s=t.coordinates.length;let a=0;for(let r=0;r<s;r++){const o=t.coordinates[r],n=hr(o),{vertices:h,holes:l,dimensions:c}=n,u=ir(h,l,c).map(f=>f+a);a+=h.length/2;for(let f=0;f<h.length;f++)e.push(h[f]);for(let f=0;f<u.length;f++)i.push(u[f])}}else{const s=hr(t.coordinates),{vertices:a,holes:r,dimensions:o}=s;e=a,i=ir(a,r,o)}return{vertices:e,indices:i}}const vc=`
|
|
16
|
+
#ifdef GL_ES
|
|
17
|
+
precision highp int;
|
|
18
|
+
precision mediump float;
|
|
19
|
+
#endif
|
|
20
|
+
uniform sampler2D u_sampler;
|
|
21
|
+
uniform float u_opacity;
|
|
22
|
+
varying vec2 v_uv;
|
|
23
|
+
void main() {
|
|
24
|
+
vec4 color = texture2D(u_sampler, v_uv);
|
|
25
|
+
gl_FragColor = color * u_opacity;
|
|
26
|
+
}
|
|
27
|
+
`,yc=`
|
|
28
|
+
uniform mat4 u_matrix;
|
|
29
|
+
attribute vec2 a_pos;
|
|
30
|
+
attribute vec2 a_uv;
|
|
31
|
+
varying vec2 v_uv;
|
|
32
|
+
void main() {
|
|
33
|
+
gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0);
|
|
34
|
+
v_uv = a_uv;
|
|
35
|
+
}
|
|
36
|
+
`,fr=`
|
|
37
|
+
#ifdef GL_ES
|
|
38
|
+
precision highp int;
|
|
39
|
+
precision mediump float;
|
|
40
|
+
#endif
|
|
41
|
+
|
|
42
|
+
void main() {
|
|
43
|
+
gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
|
|
44
|
+
}
|
|
45
|
+
`,ur=`
|
|
46
|
+
uniform mat4 u_matrix;
|
|
47
|
+
uniform float u_alt;
|
|
48
|
+
attribute vec2 a_pos;
|
|
49
|
+
|
|
50
|
+
const float PI = 3.1415926536;
|
|
51
|
+
const float earthRadius = 6371008.8;
|
|
52
|
+
const float earthCircumference = 2.0 * PI * earthRadius;
|
|
53
|
+
|
|
54
|
+
float circumferenceAtLatitude(float latitude) {
|
|
55
|
+
return earthCircumference * cos(latitude * PI / 180.0);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
float mercatorXfromLng(float lng) {
|
|
59
|
+
return (180.0 + lng) / 360.0;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
float mercatorYfromLat(float lat) {
|
|
63
|
+
return (180.0 - (180.0 / PI * log(tan(PI / 4.0 + lat * PI / 360.0)))) / 360.0;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
float mercatorZfromAltitude(float altitude, float lat) {
|
|
67
|
+
return altitude / circumferenceAtLatitude(lat);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
vec3 mercatorfromLngLat(vec2 lnglat, float alt) {
|
|
71
|
+
return vec3(mercatorXfromLng(lnglat.x), mercatorYfromLat(lnglat.y), mercatorZfromAltitude(alt, lnglat.y));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
void main() {
|
|
75
|
+
vec3 mercator = mercatorfromLngLat(a_pos, 0.0);
|
|
76
|
+
gl_Position = u_matrix * vec4(mercator, 1.0);
|
|
77
|
+
}
|
|
78
|
+
`;class Mc{option;map;gl;loaded;arrugado;programInfo;bufferInfo;texture;maskProperty;maskProgramInfo;maskBufferInfo;constructor(e){this.option=e,this.loaded=!1,this.maskProperty=Object.assign({type:"in"},e.mask);const{projection:i,coordinates:s}=e;this.arrugado=er(i,s,e.arrugatorStep)}onAdd(e,i){if(!i)throw new Error("ImageLayerCore requires a WebGL rendering context during onAdd.");this.map=e,this.gl=i,this.programInfo=Ki(i,[yc,vc]),this.loadTexture(e,i),this.bufferInfo=Ti(i,{a_pos:{numComponents:2,data:this.arrugado.pos},a_uv:{numComponents:2,data:this.arrugado.uv},indices:this.arrugado.trigs}),this.maskProperty.data&&this.getMaskBufferInfo(i,this.maskProperty.data).then(s=>{this.maskProgramInfo=Ki(i,[ur,fr]),this.maskBufferInfo=s})}onRemove(e,i){i&&(this.programInfo&&i.deleteProgram(this.programInfo.program),this.maskProgramInfo&&i.deleteProgram(this.maskProgramInfo.program),this.texture&&(i.deleteTexture(this.texture),this.texture=void 0))}render(e){if(this.maskProperty.data&&!this.maskBufferInfo)return;const i=e.gl;if(this.loaded&&this.programInfo&&this.bufferInfo){if(i.enable(i.BLEND),i.blendFunc(i.ONE,i.ONE_MINUS_SRC_ALPHA),this.maskProgramInfo&&this.maskBufferInfo){e.prepareStencilMask?.(),i.useProgram(this.maskProgramInfo.program),i.enable(i.STENCIL_TEST),i.stencilFunc(i.ALWAYS,1,255),i.stencilOp(i.REPLACE,i.REPLACE,i.REPLACE),i.stencilMask(255),i.clear(i.STENCIL_BUFFER_BIT),Xi(this.maskProgramInfo,{u_matrix:e.matrix}),Ya(i,this.maskProgramInfo,this.maskBufferInfo);let s=i.UNSIGNED_SHORT;this.maskBufferInfo.numElements/3>65535&&(i.getExtension("OES_element_index_uint"),s=i.UNSIGNED_INT),i.drawElements(i.TRIANGLES,this.maskBufferInfo.numElements,s,0)}if(i.useProgram(this.programInfo.program),this.maskProgramInfo?.program){const s=this.maskProperty.type==="out"?0:1;i.stencilFunc(i.EQUAL,s,255),i.stencilOp(i.KEEP,i.KEEP,i.KEEP)}Xi(this.programInfo,{u_matrix:e.matrix,u_opacity:this.option.opacity??1,u_sampler:this.texture}),Ya(i,this.programInfo,this.bufferInfo),i.drawElements(i.TRIANGLES,this.arrugado.trigs.length,i.UNSIGNED_SHORT,0)}}updateImage(e){return!this.map||!this.gl?this:(this.option.opacity=e.opacity??this.option.opacity,this.option.crossOrigin=e.crossOrigin??this.option.crossOrigin,(e.projection||e.coordinates||e.arrugatorStep)&&(this.option.projection=e.projection??this.option.projection,this.option.coordinates=e.coordinates??this.option.coordinates,this.option.arrugatorStep=e.arrugatorStep??this.option.arrugatorStep,this.arrugado=er(this.option.projection,this.option.coordinates,this.option.arrugatorStep),this.bufferInfo=Ti(this.gl,{a_pos:{numComponents:2,data:this.arrugado.pos},a_uv:{numComponents:2,data:this.arrugado.uv},indices:this.arrugado.trigs})),e.url||e.resampling?(this.loaded=!1,this.option.url=e.url??this.option.url,this.option.resampling=e.resampling??this.option.resampling,this.loadTexture(this.map,this.gl)):this.map.triggerRepaint(),this)}updateMask(e){return!this.map||!this.gl?this:(this.maskProperty=Object.assign(this.maskProperty,e),e.data?this.getMaskBufferInfo(this.gl,e.data).then(i=>{this.maskProgramInfo||(this.maskProgramInfo=Ki(this.gl,[ur,fr])),this.maskBufferInfo=i,this.map?.triggerRepaint()}):Object.prototype.hasOwnProperty.call(e,"data")&&e.data===void 0?(this.maskBufferInfo=void 0,this.map?.triggerRepaint()):this.map?.triggerRepaint(),this)}loadTexture(e,i){this.texture&&(i.deleteTexture(this.texture),this.texture=void 0);const s=this.option.resampling==="nearest"?i.NEAREST:i.LINEAR;If(i,{src:this.option.url,crossOrigin:this.option.crossOrigin,minMag:s,flipY:0,premultiplyAlpha:1},(a,r,o)=>{if(a)throw a;const n=i.getParameter(i.MAX_TEXTURE_SIZE),{width:h,height:l}=o;if(h>n||l>n)throw new Error(`The texture size exceeds the maximum supported size: ${n}x${n}`);this.texture=r,this.loaded=!0,e.triggerRepaint()})}getMaskBufferInfo(e,i){return _c(i).then(s=>{const{vertices:a,indices:r}=dc(s);return Ti(e,{a_pos:{numComponents:2,data:a},indices:r.length/3>65535?new Uint32Array(r):new Uint16Array(r)})})}}function xc(t){if(Array.isArray(t))return t;const e=t?.defaultProjectionData?.mainMatrix;if(e)return e;throw new Error("Unable to resolve projection matrix from render arguments.")}function Ec(t){const e=t?.painter;!e||e.terrain||(e.currentStencilSource=void 0,e._tileClippingMaskIDs={})}function bc(t,e){let i;return{id:e.id,type:"custom",renderingMode:e.renderingMode??"2d",onAdd(s,a){i=s,t.onAdd(s,a)},onRemove(s,a){t.onRemove(s,a),i=void 0},render(s,a){if(!i)throw new Error("Layer adaptor render invoked before onAdd.");t.render({map:i,gl:s,matrix:(e.resolveMatrix??xc)(a),rawArgs:a,prepareStencilMask:e.prepareStencilMask?()=>e.prepareStencilMask(i):void 0})}}}const Sc=bc;class pc{id;type="custom";renderingMode="2d";core;adaptor;constructor(e,i){this.id=e,this.core=new Mc(i),this.adaptor=Sc(this.core,{id:e,renderingMode:this.renderingMode,prepareStencilMask:s=>Ec(s)})}onAdd(e,i){this.adaptor.onAdd(e,i)}onRemove(e,i){this.adaptor.onRemove(e,i)}render(e,i){this.adaptor.render(e,i)}updateImage(e){return this.core.updateImage(e)}updateMask(e){return this.core.updateMask(e)}}return pc});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { default as ImageLayerCore, ImageLayerOption, MaskProperty } from '
|
|
1
|
+
import { default as ImageLayerCore, ImageLayerOption, MaskProperty } from '@naivemap/image-layer-core';
|
|
2
2
|
import { CustomLayerInterface, Map } from 'mapbox-gl';
|
|
3
|
-
export type { ImageLayerOption } from '
|
|
3
|
+
export type { ImageLayerOption } from '@naivemap/image-layer-core';
|
|
4
4
|
/**
|
|
5
5
|
* A custom Mapbox GL JS layer for rendering georeferenced images with arbitrary projections.
|
|
6
6
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { default as ImageLayer } from './ImageLayer';
|
|
2
|
-
export type { ImageLayerOption } from '
|
|
2
|
+
export type { ImageLayerOption } from '@naivemap/image-layer-core';
|
|
3
3
|
export default ImageLayer;
|
|
4
|
-
export type { MaskProperty } from '
|
|
4
|
+
export type { MaskProperty } from '@naivemap/image-layer-core';
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naivemap/mapbox-gl-image-layer",
|
|
3
|
-
"version": "0.6.0-alpha.
|
|
3
|
+
"version": "0.6.0-alpha.2",
|
|
4
4
|
"description": "Load a static image of any projection via Arrugator and Proj4js for Mapbox GL JS.",
|
|
5
|
-
"main": "./dist/index.
|
|
6
|
-
"module": "./dist/index.js",
|
|
5
|
+
"main": "./dist/index.umd.js",
|
|
6
|
+
"module": "./dist/index.es.js",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
|
-
"import": "./dist/index.js",
|
|
12
|
-
"require": "./dist/index.
|
|
11
|
+
"import": "./dist/index.es.js",
|
|
12
|
+
"require": "./dist/index.umd.js"
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"files": [
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
},
|
|
31
31
|
"sideEffects": false,
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@naivemap/map-gl-layer-adaptor": "0.
|
|
34
|
-
"@naivemap/image-layer-core": "0.
|
|
33
|
+
"@naivemap/map-gl-layer-adaptor": "0.2.0-alpha.1",
|
|
34
|
+
"@naivemap/image-layer-core": "0.2.0-alpha.1"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"mapbox-gl": "^2.0.0 || ^3.0.0",
|
package/dist/index.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const o=require("@naivemap/image-layer-core"),a=require("@naivemap/map-gl-layer-adaptor");class d{id;type="custom";renderingMode="2d";core;adaptor;constructor(e,r){this.id=e,this.core=new o(r),this.adaptor=a.createMapboxLayerAdaptor(this.core,{id:e,renderingMode:this.renderingMode,prepareStencilMask:t=>a.clearTileClippingMask(t)})}onAdd(e,r){this.adaptor.onAdd(e,r)}onRemove(e,r){this.adaptor.onRemove(e,r)}render(e,r){this.adaptor.render(e,r)}updateImage(e){return this.core.updateImage(e)}updateMask(e){return this.core.updateMask(e)}}module.exports=d;
|