UNPKG

@wtchen/gdal3.js

Version:

gdal3.js is a port of Gdal applications (**gdal_translate**, **ogr2ogr**, **gdal_rasterize**, **gdalwarp**, **gdaltransform**) to Webassembly. It allows you to convert raster and vector geospatial data to various formats and coordinate systems.

1 lines 183 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).initGdalJs=e()}(this,function(){"use strict";function e(r){if(r.__esModule)return r;var n=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(r).forEach(function(t){var e=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(n,t,e.get?e:{enumerable:!0,get:function(){return r[t]}})}),n}var qr=e(Object.freeze({__proto__:null,default:{}})),i="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0);function r(e,t){var r,n=Object.keys(e);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(e),t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)),n}function s(n){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?r(Object(a),!0).forEach(function(t){var e,r;e=n,r=a[t=t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(a)):r(Object(a)).forEach(function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(a,t))})}return n}function Hr(t){return(Hr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function M(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function k(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,a,i=[],o=!0,s=!1;try{for(r=r.call(t);!(o=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);o=!0);}catch(t){s=!0,a=t}finally{try{o||null==r.return||r.return()}finally{if(s)throw a}}return i}}(t,e)||x(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function I(t){return function(t){if(Array.isArray(t))return B(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||x(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function x(t,e){if(t){if("string"==typeof t)return B(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(r="Object"===r&&t.constructor?t.constructor.name:r)||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?B(t,e):void 0}}function B(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Xr,t={exports:{}},Qr=e(Object.freeze({__proto__:null,default:{}})),U=t;function K(){var M,k,I,x,B,U,K,u,z,W,Y=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},c=void 0!==Y?Y:{};function V(){function n(t,e){if(!t)throw e+(new Error).stack}function a(t,e,r){this.start=t,this.end=e,this.audio=r}c.FS_createPath("/","usr",!0,!0),c.FS_createPath("/usr","share",!0,!0),c.FS_createPath("/usr/share","gdal",!0,!0),c.FS_createPath("/usr/share","proj",!0,!0),a.prototype={requests:{},open:function(t,e){this.name=e,this.requests[e]=this,c.addRunDependency("fp "+this.name)},send:function(){},onload:function(){var t=this.byteArray.subarray(this.start,this.end);this.finish(t)},finish:function(t){c.FS_createDataFile(this.name,null,t,!0,!0,!0),c.removeRunDependency("fp "+this.name),this.requests[this.name]=null}};for(var t=I.files,e=0;e<t.length;++e)new a(t[e].start,t[e].end,t[e].audio||0).open("GET",t[e].filename);function r(t){n(t,"Loading data file failed."),n(t.constructor.name===ArrayBuffer.name,"bad input to processPackageData");for(var t=new Uint8Array(t),e=(a.prototype.byteArray=t,I.files),r=0;r<e.length;++r)a.prototype.requests[e[r].filename].onload();c.removeRunDependency("datafile_/home/wchen/gdal3.js/build/package/gdal3WebAssembly.data")}c.addRunDependency("datafile_/home/wchen/gdal3.js/build/package/gdal3WebAssembly.data"),c.preloadResults||(c.preloadResults={}),c.preloadResults["/home/wchen/gdal3.js/build/package/gdal3WebAssembly.data"]={fromCache:!1},W?(r(W),W=null):z=r}c.ready=new Promise(function(t,e){M=t,k=e}),c.expectedDataFileDownloads||(c.expectedDataFileDownloads=0),c.expectedDataFileDownloads++,c.ENVIRONMENT_IS_PTHREAD||c.$ww||(I={files:[{filename:"/usr/share/gdal/GDALLogoBW.svg",start:0,end:13022},{filename:"/usr/share/gdal/GDALLogoColor.svg",start:13022,end:25327},{filename:"/usr/share/gdal/GDALLogoGS.svg",start:25327,end:37632},{filename:"/usr/share/gdal/LICENSE.TXT",start:37632,end:59473},{filename:"/usr/share/gdal/bag_template.xml",start:59473,end:68493},{filename:"/usr/share/gdal/cubewerx_extra.wkt",start:68493,end:80470},{filename:"/usr/share/gdal/default.rsc",start:80470,end:544102},{filename:"/usr/share/gdal/ecw_cs.wkt",start:544102,end:907819},{filename:"/usr/share/gdal/eedaconf.json",start:907819,end:908230},{filename:"/usr/share/gdal/epsg.wkt",start:908230,end:908257},{filename:"/usr/share/gdal/esri_StatePlane_extra.wkt",start:908257,end:1240803},{filename:"/usr/share/gdal/gdalicon.png",start:1240803,end:1242824},{filename:"/usr/share/gdal/gdalmdiminfo_output.schema.json",start:1242824,end:1249367},{filename:"/usr/share/gdal/gdalvrt.xsd",start:1249367,end:1276938},{filename:"/usr/share/gdal/gml_registry.xml",start:1276938,end:1283581},{filename:"/usr/share/gdal/gmlasconf.xml",start:1283581,end:1291013},{filename:"/usr/share/gdal/gmlasconf.xsd",start:1291013,end:1339667},{filename:"/usr/share/gdal/grib2_center.csv",start:1339667,end:1343838},{filename:"/usr/share/gdal/grib2_process.csv",start:1343838,end:1348764},{filename:"/usr/share/gdal/grib2_subcenter.csv",start:1348764,end:1351092},{filename:"/usr/share/gdal/grib2_table_4_2_0_0.csv",start:1351092,end:1361455},{filename:"/usr/share/gdal/grib2_table_4_2_0_1.csv",start:1361455,end:1377192},{filename:"/usr/share/gdal/grib2_table_4_2_0_13.csv",start:1377192,end:1386788},{filename:"/usr/share/gdal/grib2_table_4_2_0_14.csv",start:1386788,end:1396339},{filename:"/usr/share/gdal/grib2_table_4_2_0_15.csv",start:1396339,end:1406185},{filename:"/usr/share/gdal/grib2_table_4_2_0_16.csv",start:1406185,end:1415856},{filename:"/usr/share/gdal/grib2_table_4_2_0_17.csv",start:1415856,end:1416712},{filename:"/usr/share/gdal/grib2_table_4_2_0_18.csv",start:1416712,end:1426936},{filename:"/usr/share/gdal/grib2_table_4_2_0_19.csv",start:1426936,end:1438810},{filename:"/usr/share/gdal/grib2_table_4_2_0_190.csv",start:1438810,end:1448317},{filename:"/usr/share/gdal/grib2_table_4_2_0_191.csv",start:1448317,end:1457937},{filename:"/usr/share/gdal/grib2_table_4_2_0_2.csv",start:1457937,end:1468740},{filename:"/usr/share/gdal/grib2_table_4_2_0_20.csv",start:1468740,end:1480866},{filename:"/usr/share/gdal/grib2_table_4_2_0_3.csv",start:1480866,end:1491200},{filename:"/usr/share/gdal/grib2_table_4_2_0_4.csv",start:1491200,end:1501511},{filename:"/usr/share/gdal/grib2_table_4_2_0_5.csv",start:1501511,end:1511337},{filename:"/usr/share/gdal/grib2_table_4_2_0_6.csv",start:1511337,end:1522979},{filename:"/usr/share/gdal/grib2_table_4_2_0_7.csv",start:1522979,end:1533470},{filename:"/usr/share/gdal/grib2_table_4_2_10_0.csv",start:1533470,end:1545243},{filename:"/usr/share/gdal/grib2_table_4_2_10_1.csv",start:1545243,end:1554841},{filename:"/usr/share/gdal/grib2_table_4_2_10_191.csv",start:1554841,end:1564475},{filename:"/usr/share/gdal/grib2_table_4_2_10_2.csv",start:1564475,end:1574355},{filename:"/usr/share/gdal/grib2_table_4_2_10_3.csv",start:1574355,end:1584131},{filename:"/usr/share/gdal/grib2_table_4_2_10_4.csv",start:1584131,end:1594324},{filename:"/usr/share/gdal/grib2_table_4_2_1_0.csv",start:1594324,end:1604466},{filename:"/usr/share/gdal/grib2_table_4_2_1_1.csv",start:1604466,end:1614121},{filename:"/usr/share/gdal/grib2_table_4_2_1_2.csv",start:1614121,end:1623919},{filename:"/usr/share/gdal/grib2_table_4_2_20_0.csv",start:1623919,end:1633465},{filename:"/usr/share/gdal/grib2_table_4_2_20_1.csv",start:1633465,end:1643319},{filename:"/usr/share/gdal/grib2_table_4_2_20_2.csv",start:1643319,end:1652825},{filename:"/usr/share/gdal/grib2_table_4_2_2_0.csv",start:1652825,end:1665026},{filename:"/usr/share/gdal/grib2_table_4_2_2_3.csv",start:1665026,end:1675660},{filename:"/usr/share/gdal/grib2_table_4_2_2_4.csv",start:1675660,end:1686888},{filename:"/usr/share/gdal/grib2_table_4_2_2_5.csv",start:1686888,end:1696401},{filename:"/usr/share/gdal/grib2_table_4_2_3_0.csv",start:1696401,end:1707352},{filename:"/usr/share/gdal/grib2_table_4_2_3_1.csv",start:1707352,end:1718015},{filename:"/usr/share/gdal/grib2_table_4_2_3_2.csv",start:1718015,end:1721848},{filename:"/usr/share/gdal/grib2_table_4_2_3_3.csv",start:1721848,end:1722632},{filename:"/usr/share/gdal/grib2_table_4_2_3_4.csv",start:1722632,end:1723683},{filename:"/usr/share/gdal/grib2_table_4_2_3_5.csv",start:1723683,end:1724603},{filename:"/usr/share/gdal/grib2_table_4_2_3_6.csv",start:1724603,end:1725422},{filename:"/usr/share/gdal/grib2_table_4_2_4_0.csv",start:1725422,end:1734975},{filename:"/usr/share/gdal/grib2_table_4_2_4_1.csv",start:1734975,end:1744661},{filename:"/usr/share/gdal/grib2_table_4_2_4_10.csv",start:1744661,end:1754362},{filename:"/usr/share/gdal/grib2_table_4_2_4_2.csv",start:1754362,end:1764022},{filename:"/usr/share/gdal/grib2_table_4_2_4_3.csv",start:1764022,end:1773744},{filename:"/usr/share/gdal/grib2_table_4_2_4_4.csv",start:1773744,end:1783433},{filename:"/usr/share/gdal/grib2_table_4_2_4_5.csv",start:1783433,end:1792929},{filename:"/usr/share/gdal/grib2_table_4_2_4_6.csv",start:1792929,end:1802563},{filename:"/usr/share/gdal/grib2_table_4_2_4_7.csv",start:1802563,end:1812119},{filename:"/usr/share/gdal/grib2_table_4_2_4_8.csv",start:1812119,end:1821805},{filename:"/usr/share/gdal/grib2_table_4_2_4_9.csv",start:1821805,end:1831341},{filename:"/usr/share/gdal/grib2_table_4_2_local_Canada.csv",start:1831341,end:1831674},{filename:"/usr/share/gdal/grib2_table_4_2_local_HPC.csv",start:1831674,end:1831761},{filename:"/usr/share/gdal/grib2_table_4_2_local_MRMS.csv",start:1831761,end:1847348},{filename:"/usr/share/gdal/grib2_table_4_2_local_NCEP.csv",start:1847348,end:1875325},{filename:"/usr/share/gdal/grib2_table_4_2_local_NDFD.csv",start:1875325,end:1877984},{filename:"/usr/share/gdal/grib2_table_4_2_local_index.csv",start:1877984,end:1878235},{filename:"/usr/share/gdal/grib2_table_4_5.csv",start:1878235,end:1888248},{filename:"/usr/share/gdal/grib2_table_versions.csv",start:1888248,end:1888288},{filename:"/usr/share/gdal/gt_datum.csv",start:1888288,end:1904092},{filename:"/usr/share/gdal/gt_ellips.csv",start:1904092,end:1905811},{filename:"/usr/share/gdal/header.dxf",start:1905811,end:1912383},{filename:"/usr/share/gdal/inspire_cp_BasicPropertyUnit.gfs",start:1912383,end:1914123},{filename:"/usr/share/gdal/inspire_cp_CadastralBoundary.gfs",start:1914123,end:1915773},{filename:"/usr/share/gdal/inspire_cp_CadastralParcel.gfs",start:1915773,end:1918223},{filename:"/usr/share/gdal/inspire_cp_CadastralZoning.gfs",start:1918223,end:1923035},{filename:"/usr/share/gdal/jpfgdgml_AdmArea.gfs",start:1923035,end:1924675},{filename:"/usr/share/gdal/jpfgdgml_AdmBdry.gfs",start:1924675,end:1926057},{filename:"/usr/share/gdal/jpfgdgml_AdmPt.gfs",start:1926057,end:1927690},{filename:"/usr/share/gdal/jpfgdgml_BldA.gfs",start:1927690,end:1929191},{filename:"/usr/share/gdal/jpfgdgml_BldL.gfs",start:1929191,end:1930694},{filename:"/usr/share/gdal/jpfgdgml_Cntr.gfs",start:1930694,end:1932195},{filename:"/usr/share/gdal/jpfgdgml_CommBdry.gfs",start:1932195,end:1933579},{filename:"/usr/share/gdal/jpfgdgml_CommPt.gfs",start:1933579,end:1935214},{filename:"/usr/share/gdal/jpfgdgml_Cstline.gfs",start:1935214,end:1936723},{filename:"/usr/share/gdal/jpfgdgml_ElevPt.gfs",start:1936723,end:1938223},{filename:"/usr/share/gdal/jpfgdgml_GCP.gfs",start:1938223,end:1940746},{filename:"/usr/share/gdal/jpfgdgml_LeveeEdge.gfs",start:1940746,end:1942132},{filename:"/usr/share/gdal/jpfgdgml_RailCL.gfs",start:1942132,end:1943639},{filename:"/usr/share/gdal/jpfgdgml_RdASL.gfs",start:1943639,end:1944890},{filename:"/usr/share/gdal/jpfgdgml_RdArea.gfs",start:1944890,end:1946405},{filename:"/usr/share/gdal/jpfgdgml_RdCompt.gfs",start:1946405,end:1948051},{filename:"/usr/share/gdal/jpfgdgml_RdEdg.gfs",start:1948051,end:1949693},{filename:"/usr/share/gdal/jpfgdgml_RdMgtBdry.gfs",start:1949693,end:1951079},{filename:"/usr/share/gdal/jpfgdgml_RdSgmtA.gfs",start:1951079,end:1952723},{filename:"/usr/share/gdal/jpfgdgml_RvrMgtBdry.gfs",start:1952723,end:1954111},{filename:"/usr/share/gdal/jpfgdgml_SBAPt.gfs",start:1954111,end:1955486},{filename:"/usr/share/gdal/jpfgdgml_SBArea.gfs",start:1955486,end:1956993},{filename:"/usr/share/gdal/jpfgdgml_SBBdry.gfs",start:1956993,end:1958246},{filename:"/usr/share/gdal/jpfgdgml_WA.gfs",start:1958246,end:1959743},{filename:"/usr/share/gdal/jpfgdgml_WL.gfs",start:1959743,end:1961242},{filename:"/usr/share/gdal/jpfgdgml_WStrA.gfs",start:1961242,end:1962745},{filename:"/usr/share/gdal/jpfgdgml_WStrL.gfs",start:1962745,end:1964250},{filename:"/usr/share/gdal/netcdf_config.xsd",start:1964250,end:1971741},{filename:"/usr/share/gdal/nitf_spec.xml",start:1971741,end:2120595},{filename:"/usr/share/gdal/nitf_spec.xsd",start:2120595,end:2128282},{filename:"/usr/share/gdal/ogrvrt.xsd",start:2128282,end:2154031},{filename:"/usr/share/gdal/osmconf.ini",start:2154031,end:2159226},{filename:"/usr/share/gdal/ozi_datum.csv",start:2159226,end:2167708},{filename:"/usr/share/gdal/ozi_ellips.csv",start:2167708,end:2169057},{filename:"/usr/share/gdal/pci_datum.txt",start:2169057,end:2204162},{filename:"/usr/share/gdal/pci_ellips.txt",start:2204162,end:2207628},{filename:"/usr/share/gdal/pdfcomposition.xsd",start:2207628,end:2241962},{filename:"/usr/share/gdal/pds4_template.xml",start:2241962,end:2245395},{filename:"/usr/share/gdal/plscenesconf.json",start:2245395,end:2286767},{filename:"/usr/share/gdal/ruian_vf_ob_v1.gfs",start:2286767,end:2333542},{filename:"/usr/share/gdal/ruian_vf_st_uvoh_v1.gfs",start:2333542,end:2336142},{filename:"/usr/share/gdal/ruian_vf_st_v1.gfs",start:2336142,end:2382114},{filename:"/usr/share/gdal/ruian_vf_v1.gfs",start:2382114,end:2449448},{filename:"/usr/share/gdal/s57agencies.csv",start:2449448,end:2462752},{filename:"/usr/share/gdal/s57attributes.csv",start:2462752,end:2482753},{filename:"/usr/share/gdal/s57expectedinput.csv",start:2482753,end:2503638},{filename:"/usr/share/gdal/s57objectclasses.csv",start:2503638,end:2557063},{filename:"/usr/share/gdal/seed_2d.dgn",start:2557063,end:2566279},{filename:"/usr/share/gdal/seed_3d.dgn",start:2566279,end:2568327},{filename:"/usr/share/gdal/stateplane.csv",start:2568327,end:2578687},{filename:"/usr/share/gdal/template_tiles.mapml",start:2578687,end:2580634},{filename:"/usr/share/gdal/tms_LINZAntarticaMapTileGrid.json",start:2580634,end:2584749},{filename:"/usr/share/gdal/tms_MapML_APSTILE.json",start:2584749,end:2591022},{filename:"/usr/share/gdal/tms_MapML_CBMTILE.json",start:2591022,end:2598814},{filename:"/usr/share/gdal/tms_NZTM2000.json",start:2598814,end:2604079},{filename:"/usr/share/gdal/trailer.dxf",start:2604079,end:2606354},{filename:"/usr/share/gdal/vdv452.xml",start:2606354,end:2632170},{filename:"/usr/share/gdal/vdv452.xsd",start:2632170,end:2635024},{filename:"/usr/share/gdal/vicar.json",start:2635024,end:2638634},{filename:"/usr/share/proj/CH",start:2638634,end:2639731},{filename:"/usr/share/proj/GL27",start:2639731,end:2640459},{filename:"/usr/share/proj/ITRF2000",start:2640459,end:2642558},{filename:"/usr/share/proj/ITRF2008",start:2642558,end:2648238},{filename:"/usr/share/proj/ITRF2014",start:2648238,end:2651727},{filename:"/usr/share/proj/deformation_model.schema.json",start:2651727,end:2669398},{filename:"/usr/share/proj/nad.lst",start:2669398,end:2675783},{filename:"/usr/share/proj/nad27",start:2675783,end:2695318},{filename:"/usr/share/proj/nad83",start:2695318,end:2711911},{filename:"/usr/share/proj/other.extra",start:2711911,end:2715826},{filename:"/usr/share/proj/proj.db",start:2715826,end:10993842},{filename:"/usr/share/proj/proj.ini",start:10993842,end:10994892},{filename:"/usr/share/proj/projjson.schema.json",start:10994892,end:11032170},{filename:"/usr/share/proj/triangulation.schema.json",start:11032170,end:11040573},{filename:"/usr/share/proj/world",start:11040573,end:11047652}],remote_package_size:11047652},"object"===("undefined"==typeof window?"undefined":Hr(window))?window.encodeURIComponent(window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/"):"undefined"==typeof process&&"undefined"!=typeof location&&encodeURIComponent(location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"),t="gdal3WebAssembly.data","function"!=typeof c.locateFilePackage||c.locateFile||(c.locateFile=c.locateFilePackage,y("warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)")),t=c.locateFile?c.locateFile(t,""):t,e=I.remote_package_size,z=null,(W=c.getPreloadedPackage?c.getPreloadedPackage(t,e):null)||(x=t,B=e,U=function(t){z?(z(t),z=null):W=t},K=function(t){console.error("package error:",t)},"object"===("undefined"==typeof process?"undefined":Hr(process))&&"object"===Hr(process.versions)&&"string"==typeof process.versions.node?qr.readFile(x,function(t,e){t?K(t):U(e.buffer)}):((u=new XMLHttpRequest).open("GET",x,!0),u.responseType="arraybuffer",u.onprogress=function(t){var e=x,r=B;if(t.total&&(r=t.total),t.loaded){u.addedTotal?c.dataFileDownloads[e].loaded=t.loaded:(u.addedTotal=!0,c.dataFileDownloads||(c.dataFileDownloads={}),c.dataFileDownloads[e]={loaded:t.loaded,total:r});var n,a=0,i=0,o=0;for(n in c.dataFileDownloads){var s=c.dataFileDownloads[n];a+=s.total,i+=s.loaded,o++}a=Math.ceil(a*c.expectedDataFileDownloads/o),c.setStatus&&c.setStatus("Downloading data... ("+i+"/"+a+")")}else c.dataFileDownloads||c.setStatus&&c.setStatus("Downloading data...")},u.onerror=function(t){throw new Error("NetworkError for: "+x)},u.onload=function(t){if(!(200==u.status||304==u.status||206==u.status||0==u.status&&u.response))throw new Error(u.statusText+" : "+u.responseURL);var e=u.response;U(e)},u.send(null))),c.calledRun?V():(c.preRun||(c.preRun=[]),c.preRun.push(V)));var i,o,H,X,q,t=Object.assign({},c),Q="./this.program",Z=function(t,e){throw e},J="object"==("undefined"==typeof window?"undefined":Hr(window)),l="function"==typeof importScripts,s="object"==("undefined"==typeof process?"undefined":Hr(process))&&"object"==Hr(process.versions)&&"string"==typeof process.versions.node,e="";s?(i=qr,o=Qr,e=l?o.dirname(e)+"/":__dirname+"/",H=function(t,e){return t=Et(t)?new URL(t):o.normalize(t),i.readFileSync(t,e?void 0:"utf8")},X=function(t){t=H(t,!0);return t=t.buffer?t:new Uint8Array(t)},q=function(t,r,n){var a=!(3<arguments.length&&void 0!==arguments[3])||arguments[3];t=Et(t)?new URL(t):o.normalize(t),i.readFile(t,a?void 0:"utf8",function(t,e){t?n(t):r(a?e.buffer:e)})},!c.thisProgram&&1<process.argv.length&&(Q=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),Z=function(t,e){throw process.exitCode=t,e},c.inspect=function(){return"[Emscripten Module object]"}):(J||l)&&(l?e=self.location.href:"undefined"!=typeof document&&document.currentScript&&(e=document.currentScript.src),e=0!==(e=Xr?Xr:e).indexOf("blob:")?e.substr(0,e.replace(/[?#].*/,"").lastIndexOf("/")+1):"",H=function(t){var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},l&&(X=function(t){var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),q=function(t,e,r){var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=function(){200==n.status||0==n.status&&n.response?e(n.response):r()},n.onerror=r,n.send(null)});var $,tt,f,d,m,g,p,et,rt,h,nt=c.print||console.log.bind(console),y=c.printErr||console.warn.bind(console),at=(Object.assign(c,t),c.arguments,c.thisProgram&&(Q=c.thisProgram),c.quit&&(Z=c.quit),c.wasmBinary&&($=c.wasmBinary),c.noExitRuntime||!0),it=("object"!=("undefined"==typeof WebAssembly?"undefined":Hr(WebAssembly))&&a("no native wasm support detected"),!1);function _(t,e){t||a(e)}function ot(){var t=tt.buffer;c.HEAP8=f=new Int8Array(t),c.HEAP16=m=new Int16Array(t),c.HEAP32=g=new Int32Array(t),c.HEAPU8=d=new Uint8Array(t),c.HEAPU16=new Uint16Array(t),c.HEAPU32=p=new Uint32Array(t),c.HEAPF32=et=new Float32Array(t),c.HEAPF64=rt=new Float64Array(t)}var st=[],ut=[],ct=[],lt=0;function ft(){if(c.preRun)for("function"==typeof c.preRun&&(c.preRun=[c.preRun]);c.preRun.length;)t=c.preRun.shift(),st.unshift(t);var t;Dt(st)}function dt(){if(c.postRun)for("function"==typeof c.postRun&&(c.postRun=[c.postRun]);c.postRun.length;)t=c.postRun.shift(),ct.unshift(t);var t;Dt(ct)}var r=0,mt=null;function pt(t){r++,c.monitorRunDependencies&&c.monitorRunDependencies(r)}function ht(t){var e;r--,c.monitorRunDependencies&&c.monitorRunDependencies(r),0==r&&mt&&(e=mt,mt=null,e())}function a(t){c.onAbort&&c.onAbort(t),y(t="Aborted("+t+")"),it=!0,t+=". Build with -sASSERTIONS for more info.";t=new WebAssembly.RuntimeError(t);throw k(t),t}var yt,E,w,gt="data:application/octet-stream;base64,";function _t(t){return t.startsWith(gt)}function Et(t){return t.startsWith("file://")}function wt(t){try{if(t==yt&&$)return new Uint8Array($);if(X)return X(t);throw"both async and sync fetching of the wasm failed"}catch(t){a(t)}}function vt(t,e,r){return function(r){if(!$&&(J||l)){if("function"==typeof fetch&&!Et(r))return fetch(r,{credentials:"same-origin"}).then(function(t){if(t.ok)return t.arrayBuffer();throw"failed to load wasm binary file at '"+r+"'"}).catch(function(){return wt(r)});if(q)return new Promise(function(e,t){q(r,function(t){return e(new Uint8Array(t))},t)})}return Promise.resolve().then(function(){return wt(r)})}(t).then(function(t){return WebAssembly.instantiate(t,e)}).then(function(t){return t}).then(r,function(t){y("failed to asynchronously prepare wasm: "+t),a(t)})}function bt(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function Dt(t){for(;0<t.length;)t.shift()(c)}_t(yt="gdal3WebAssembly.wasm")||(Nt=yt,yt=c.locateFile?c.locateFile(Nt,e):e+Nt);var At="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function v(t,e,r){for(var n=e+r,a=e;t[a]&&!(n<=a);)++a;if(16<a-e&&t.buffer&&At)return At.decode(t.subarray(e,a));for(var i="";e<a;){var o,s,u=t[e++];128&u?(s=63&t[e++],192==(224&u)?i+=String.fromCharCode((31&u)<<6|s):(o=63&t[e++],(u=224==(240&u)?(15&u)<<12|s<<6|o:(7&u)<<18|s<<12|o<<6|63&t[e++])<65536?i+=String.fromCharCode(u):(s=u-65536,i+=String.fromCharCode(55296|s>>10,56320|1023&s)))):i+=String.fromCharCode(u)}return i}function b(t,e){return t?v(d,t,e):""}var Tt=[];function L(t){var e=Tt[t];return e||(t>=Tt.length&&(Tt.length=t+1),Tt[t]=e=h.get(t)),e}var Lt=[],Ct=0,St=0;function Gt(t){this.excPtr=t,this.ptr=t-24,this.set_type=function(t){p[this.ptr+4>>2]=t},this.get_type=function(){return p[this.ptr+4>>2]},this.set_destructor=function(t){p[this.ptr+8>>2]=t},this.get_destructor=function(){return p[this.ptr+8>>2]},this.set_caught=function(t){f[this.ptr+12>>0]=t=t?1:0},this.get_caught=function(){return 0!=f[this.ptr+12>>0]},this.set_rethrown=function(t){f[this.ptr+13>>0]=t=t?1:0},this.get_rethrown=function(){return 0!=f[this.ptr+13>>0]},this.init=function(t,e){this.set_adjusted_ptr(0),this.set_type(t),this.set_destructor(e)},this.set_adjusted_ptr=function(t){p[this.ptr+16>>2]=t},this.get_adjusted_ptr=function(){return p[this.ptr+16>>2]},this.get_exception_ptr=function(){if(De(this.get_type()))return p[this.excPtr>>2];var t=this.get_adjusted_ptr();return 0!==t?t:this.excPtr}}function Ot(){var t=St;if(!t)return _e(0),0;var e=new Gt(t),r=(e.set_adjusted_ptr(t),e.get_type());if(!r)return _e(0),t;for(var n=0;n<arguments.length;n++){var a=arguments[n];if(0===a||a===r)break;var i=e.ptr+16;if(be(a,r,i))return _e(a),t}return _e(r),t}var Nt=Ot,Ft=Ot,jt=Ot,Rt="To use dlopen, you need enable dynamic linking, see https://emscripten.org/docs/compiling/Dynamic-Linking.html",D={isAbs:function(t){return"/"===t.charAt(0)},splitPath:function(t){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(t).slice(1)},normalizeArray:function(t,e){for(var r=0,n=t.length-1;0<=n;n--){var a=t[n];"."===a?t.splice(n,1):".."===a?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r;r--)t.unshift("..");return t},normalize:function(t){var e=D.isAbs(t),r="/"===t.substr(-1);return(t=(t=D.normalizeArray(t.split("/").filter(function(t){return!!t}),!e).join("/"))||e?t:".")&&r&&(t+="/"),(e?"/":"")+t},dirname:function(t){var t=D.splitPath(t),e=t[0],t=t[1];return e||t?e+(t=t&&t.substr(0,t.length-1)):"."},basename:function(t){if("/"===t)return"/";var e=(t=(t=D.normalize(t)).replace(/\/$/,"")).lastIndexOf("/");return-1===e?t:t.substr(e+1)},join:function(){var t=Array.prototype.slice.call(arguments);return D.normalize(t.join("/"))},join2:function(t,e){return D.normalize(t+"/"+e)}};function Pt(t){return(Pt=function(){if("object"==("undefined"==typeof crypto?"undefined":Hr(crypto))&&"function"==typeof crypto.getRandomValues)return function(t){return crypto.getRandomValues(t)};if(s)try{var e=void 0;if((void 0).randomFillSync)return function(t){return e.randomFillSync(t)};var r=e.randomBytes;return function(t){return t.set(r(t.byteLength)),t}}catch(t){}a("initRandomDevice")}())(t)}var A={resolve:function(){for(var t="",e=!1,r=arguments.length-1;-1<=r&&!e;r--){var n=0<=r?arguments[r]:O.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";t=n+"/"+t,e=D.isAbs(n)}return(e?"/":"")+(t=D.normalizeArray(t.split("/").filter(function(t){return!!t}),!e).join("/"))||"."},relative:function(t,e){function r(t){for(var e=0;e<t.length&&""===t[e];e++);for(var r=t.length-1;0<=r&&""===t[r];r--);return r<e?[]:t.slice(e,r-e+1)}t=A.resolve(t).substr(1),e=A.resolve(e).substr(1);for(var n=r(t.split("/")),a=r(e.split("/")),i=Math.min(n.length,a.length),o=i,s=0;s<i;s++)if(n[s]!==a[s]){o=s;break}for(var u=[],s=o;s<n.length;s++)u.push("..");return(u=u.concat(a.slice(o))).join("/")}};function T(t){for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n<=127?e++:n<=2047?e+=2:55296<=n&&n<=57343?(e+=4,++r):e+=3}return e}function Mt(t,e,r,n){if(!(0<n))return 0;for(var a=r,i=r+n-1,o=0;o<t.length;++o){var s=t.charCodeAt(o);if((s=55296<=s&&s<=57343?65536+((1023&s)<<10)|1023&t.charCodeAt(++o):s)<=127){if(i<=r)break;e[r++]=s}else if(s<=2047){if(i<=r+1)break;e[r++]=192|s>>6,e[r++]=128|63&s}else if(s<=65535){if(i<=r+2)break;e[r++]=224|s>>12,e[r++]=128|s>>6&63,e[r++]=128|63&s}else{if(i<=r+3)break;e[r++]=240|s>>18,e[r++]=128|s>>12&63,e[r++]=128|s>>6&63,e[r++]=128|63&s}}return e[r]=0,r-a}function kt(t,e,r){r=0<r?r:T(t)+1,r=new Array(r),t=Mt(t,r,0,r.length);return e&&(r.length=t),r}var n={ttys:[],init:function(){},shutdown:function(){},register:function(t,e){n.ttys[t]={input:[],output:[],ops:e},O.registerDevice(t,n.stream_ops)},stream_ops:{open:function(t){var e=n.ttys[t.node.rdev];if(!e)throw new O.ErrnoError(43);t.tty=e,t.seekable=!1},close:function(t){t.tty.ops.fsync(t.tty)},fsync:function(t){t.tty.ops.fsync(t.tty)},read:function(t,e,r,n,a){if(!t.tty||!t.tty.ops.get_char)throw new O.ErrnoError(60);for(var i,o=0,s=0;s<n;s++){try{i=t.tty.ops.get_char(t.tty)}catch(t){throw new O.ErrnoError(29)}if(void 0===i&&0===o)throw new O.ErrnoError(6);if(null==i)break;o++,e[r+s]=i}return o&&(t.node.timestamp=Date.now()),o},write:function(t,e,r,n,a){if(!t.tty||!t.tty.ops.put_char)throw new O.ErrnoError(60);try{for(var i=0;i<n;i++)t.tty.ops.put_char(t.tty,e[r+i])}catch(t){throw new O.ErrnoError(29)}return n&&(t.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(t){if(!t.input.length){var e=null;if(s){var r=Buffer.alloc(256),n=0;try{n=i.readSync(process.stdin.fd,r,0,256,-1)}catch(t){if(!t.toString().includes("EOF"))throw t;n=0}e=0<n?r.slice(0,n).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\n");if(!e)return null;t.input=kt(e,!0)}return t.input.shift()},put_char:function(t,e){null===e||10===e?(nt(v(t.output,0)),t.output=[]):0!=e&&t.output.push(e)},fsync:function(t){t.output&&0<t.output.length&&(nt(v(t.output,0)),t.output=[])}},default_tty1_ops:{put_char:function(t,e){null===e||10===e?(y(v(t.output,0)),t.output=[]):0!=e&&t.output.push(e)},fsync:function(t){t.output&&0<t.output.length&&(y(v(t.output,0)),t.output=[])}}};function It(){a()}var C={ops_table:null,mount:function(t){return C.createNode(null,"/",16895,0)},createNode:function(t,e,r,n){if(O.isBlkdev(r)||O.isFIFO(r))throw new O.ErrnoError(63);C.ops_table||(C.ops_table={dir:{node:{getattr:C.node_ops.getattr,setattr:C.node_ops.setattr,lookup:C.node_ops.lookup,mknod:C.node_ops.mknod,rename:C.node_ops.rename,unlink:C.node_ops.unlink,rmdir:C.node_ops.rmdir,readdir:C.node_ops.readdir,symlink:C.node_ops.symlink},stream:{llseek:C.stream_ops.llseek}},file:{node:{getattr:C.node_ops.getattr,setattr:C.node_ops.setattr},stream:{llseek:C.stream_ops.llseek,read:C.stream_ops.read,write:C.stream_ops.write,allocate:C.stream_ops.allocate,mmap:C.stream_ops.mmap,msync:C.stream_ops.msync}},link:{node:{getattr:C.node_ops.getattr,setattr:C.node_ops.setattr,readlink:C.node_ops.readlink},stream:{}},chrdev:{node:{getattr:C.node_ops.getattr,setattr:C.node_ops.setattr},stream:O.chrdev_stream_ops}});r=O.createNode(t,e,r,n);return O.isDir(r.mode)?(r.node_ops=C.ops_table.dir.node,r.stream_ops=C.ops_table.dir.stream,r.contents={}):O.isFile(r.mode)?(r.node_ops=C.ops_table.file.node,r.stream_ops=C.ops_table.file.stream,r.usedBytes=0,r.contents=null):O.isLink(r.mode)?(r.node_ops=C.ops_table.link.node,r.stream_ops=C.ops_table.link.stream):O.isChrdev(r.mode)&&(r.node_ops=C.ops_table.chrdev.node,r.stream_ops=C.ops_table.chrdev.stream),r.timestamp=Date.now(),t&&(t.contents[e]=r,t.timestamp=r.timestamp),r},getFileDataAsTypedArray:function(t){return t.contents?t.contents.subarray?t.contents.subarray(0,t.usedBytes):new Uint8Array(t.contents):new Uint8Array(0)},expandFileStorage:function(t,e){var r=t.contents?t.contents.length:0;e<=r||(e=Math.max(e,r*(r<1048576?2:1.125)>>>0),0!=r&&(e=Math.max(e,256)),r=t.contents,t.contents=new Uint8Array(e),0<t.usedBytes&&t.contents.set(r.subarray(0,t.usedBytes),0))},resizeFileStorage:function(t,e){var r;t.usedBytes!=e&&(0==e?(t.contents=null,t.usedBytes=0):(r=t.contents,t.contents=new Uint8Array(e),r&&t.contents.set(r.subarray(0,Math.min(e,t.usedBytes))),t.usedBytes=e))},node_ops:{getattr:function(t){var e={};return e.dev=O.isChrdev(t.mode)?t.id:1,e.ino=t.id,e.mode=t.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=t.rdev,O.isDir(t.mode)?e.size=4096:O.isFile(t.mode)?e.size=t.usedBytes:O.isLink(t.mode)?e.size=t.link.length:e.size=0,e.atime=new Date(t.timestamp),e.mtime=new Date(t.timestamp),e.ctime=new Date(t.timestamp),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},setattr:function(t,e){void 0!==e.mode&&(t.mode=e.mode),void 0!==e.timestamp&&(t.timestamp=e.timestamp),void 0!==e.size&&C.resizeFileStorage(t,e.size)},lookup:function(t,e){throw O.genericErrors[44]},mknod:function(t,e,r,n){return C.createNode(t,e,r,n)},rename:function(t,e,r){if(O.isDir(t.mode)){var n;try{n=O.lookupNode(e,r)}catch(t){}if(n)for(var a in n.contents)throw new O.ErrnoError(55)}delete t.parent.contents[t.name],t.parent.timestamp=Date.now(),t.name=r,e.contents[r]=t,e.timestamp=t.parent.timestamp,t.parent=e},unlink:function(t,e){delete t.contents[e],t.timestamp=Date.now()},rmdir:function(t,e){for(var r in O.lookupNode(t,e).contents)throw new O.ErrnoError(55);delete t.contents[e],t.timestamp=Date.now()},readdir:function(t){var e,r=[".",".."];for(e in t.contents)t.contents.hasOwnProperty(e)&&r.push(e);return r},symlink:function(t,e,r){t=C.createNode(t,e,41471,0);return t.link=r,t},readlink:function(t){if(O.isLink(t.mode))return t.link;throw new O.ErrnoError(28)}},stream_ops:{read:function(t,e,r,n,a){var i=t.node.contents;if(a>=t.node.usedBytes)return 0;var o=Math.min(t.node.usedBytes-a,n);if(8<o&&i.subarray)e.set(i.subarray(a,a+o),r);else for(var s=0;s<o;s++)e[r+s]=i[a+s];return o},write:function(t,e,r,n,a,i){if(e.buffer===f.buffer&&(i=!1),!n)return 0;var o=t.node;if(o.timestamp=Date.now(),e.subarray&&(!o.contents||o.contents.subarray)){if(i)return o.contents=e.subarray(r,r+n),o.usedBytes=n;if(0===o.usedBytes&&0===a)return o.contents=e.slice(r,r+n),o.usedBytes=n;if(a+n<=o.usedBytes)return o.contents.set(e.subarray(r,r+n),a),n}if(C.expandFileStorage(o,a+n),o.contents.subarray&&e.subarray)o.contents.set(e.subarray(r,r+n),a);else for(var s=0;s<n;s++)o.contents[a+s]=e[r+s];return o.usedBytes=Math.max(o.usedBytes,a+n),n},llseek:function(t,e,r){if(1===r?e+=t.position:2===r&&O.isFile(t.node.mode)&&(e+=t.node.usedBytes),e<0)throw new O.ErrnoError(28);return e},allocate:function(t,e,r){C.expandFileStorage(t.node,e+r),t.node.usedBytes=Math.max(t.node.usedBytes,e+r)},mmap:function(t,e,r,n,a){if(!O.isFile(t.node.mode))throw new O.ErrnoError(43);var i,o,t=t.node.contents;if(2&a||t.buffer!==f.buffer){if((0<r||r+e<t.length)&&(t=t.subarray?t.subarray(r,r+e):Array.prototype.slice.call(t,r,r+e)),o=!0,!(i=It()))throw new O.ErrnoError(48);f.set(t,i)}else o=!1,i=t.byteOffset;return{ptr:i,allocated:o}},msync:function(t,e,r,n,a){return C.stream_ops.write(t,e,0,n,r,!1),0}}},xt={},S={isWindows:!1,staticInit:function(){S.isWindows=!!process.platform.match(/^win/);var t=process.binding("constants");t.fs&&(t=t.fs),S.flagsForNodeMap={1024:t.O_APPEND,64:t.O_CREAT,128:t.O_EXCL,256:t.O_NOCTTY,0:t.O_RDONLY,2:t.O_RDWR,4096:t.O_SYNC,512:t.O_TRUNC,1:t.O_WRONLY,131072:t.O_NOFOLLOW}},convertNodeCode:function(t){t=t.code;return xt[t]},mount:function(t){return S.createNode(null,"/",S.getMode(t.opts.root),0)},createNode:function(t,e,r,n){if(!O.isDir(r)&&!O.isFile(r)&&!O.isLink(r))throw new O.ErrnoError(28);t=O.createNode(t,e,r);return t.node_ops=S.node_ops,t.stream_ops=S.stream_ops,t},getMode:function(t){var e;try{e=i.lstatSync(t),S.isWindows&&(e.mode=e.mode|(292&e.mode)>>2)}catch(t){if(t.code)throw new O.ErrnoError(S.convertNodeCode(t));throw t}return e.mode},realPath:function(t){for(var e=[];t.parent!==t;)e.push(t.name),t=t.parent;return e.push(t.mount.opts.root),e.reverse(),D.join.apply(null,e)},flagsForNode:function(t){t=-2097153&t&-2049&-32769&-524289&-65537;var e,r=0;for(e in S.flagsForNodeMap)t&e&&(r|=S.flagsForNodeMap[e],t^=e);if(t)throw new O.ErrnoError(28);return r},node_ops:{getattr:function(t){var e,t=S.realPath(t);try{e=i.lstatSync(t)}catch(t){if(t.code)throw new O.ErrnoError(S.convertNodeCode(t));throw t}return S.isWindows&&!e.blksize&&(e.blksize=4096),S.isWindows&&!e.blocks&&(e.blocks=(e.size+e.blksize-1)/e.blksize|0),{dev:e.dev,ino:e.ino,mode:e.mode,nlink:e.nlink,uid:e.uid,gid:e.gid,rdev:e.rdev,size:e.size,atime:e.atime,mtime:e.mtime,ctime:e.ctime,blksize:e.blksize,blocks:e.blocks}},setattr:function(t,e){var r,n=S.realPath(t);try{void 0!==e.mode&&(i.chmodSync(n,e.mode),t.mode=e.mode),void 0!==e.timestamp&&(r=new Date(e.timestamp),i.utimesSync(n,r,r)),void 0!==e.size&&i.truncateSync(n,e.size)}catch(t){if(t.code)throw new O.ErrnoError(S.convertNodeCode(t));throw t}},lookup:function(t,e){var r=D.join2(S.realPath(t),e),r=S.getMode(r);return S.createNode(t,e,r)},mknod:function(t,e,r,n){t=S.createNode(t,e,r,n),e=S.realPath(t);try{O.isDir(t.mode)?i.mkdirSync(e,t.mode):i.writeFileSync(e,"",{mode:t.mode})}catch(t){if(t.code)throw new O.ErrnoError(S.convertNodeCode(t));throw t}return t},rename:function(t,e,r){var n=S.realPath(t),e=D.join2(S.realPath(e),r);try{i.renameSync(n,e)}catch(t){if(t.code)throw new O.ErrnoError(S.convertNodeCode(t));throw t}t.name=r},unlink:function(t,e){t=D.join2(S.realPath(t),e);try{i.unlinkSync(t)}catch(t){if(t.code)throw new O.ErrnoError(S.convertNodeCode(t));throw t}},rmdir:function(t,e){t=D.join2(S.realPath(t),e);try{i.rmdirSync(t)}catch(t){if(t.code)throw new O.ErrnoError(S.convertNodeCode(t));throw t}},readdir:function(t){t=S.realPath(t);try{return i.readdirSync(t)}catch(t){if(t.code)throw new O.ErrnoError(S.convertNodeCode(t));throw t}},symlink:function(t,e,r){t=D.join2(S.realPath(t),e);try{i.symlinkSync(r,t)}catch(t){if(t.code)throw new O.ErrnoError(S.convertNodeCode(t));throw t}},readlink:function(t){var e=S.realPath(t);try{return e=i.readlinkSync(e),o.relative(o.resolve(t.mount.opts.root),e)}catch(t){if(!t.code)throw t;if("UNKNOWN"===t.code)throw new O.ErrnoError(28);throw new O.ErrnoError(S.convertNodeCode(t))}}},stream_ops:{open:function(t){var e=S.realPath(t.node);try{O.isFile(t.node.mode)&&(t.nfd=i.openSync(e,S.flagsForNode(t.flags)))}catch(t){if(t.code)throw new O.ErrnoError(S.convertNodeCode(t));throw t}},close:function(t){try{O.isFile(t.node.mode)&&t.nfd&&i.closeSync(t.nfd)}catch(t){if(t.code)throw new O.ErrnoError(S.convertNodeCode(t));throw t}},read:function(t,e,r,n,a){if(0===n)return 0;try{return i.readSync(t.nfd,Buffer.from(e.buffer),r,n,a)}catch(t){throw new O.ErrnoError(S.convertNodeCode(t))}},write:function(t,e,r,n,a){try{return i.writeSync(t.nfd,Buffer.from(e.buffer),r,n,a)}catch(t){throw new O.ErrnoError(S.convertNodeCode(t))}},llseek:function(t,e,r){if(1===r)e+=t.position;else if(2===r&&O.isFile(t.node.mode))try{e+=i.fstatSync(t.nfd).size}catch(t){throw new O.ErrnoError(S.convertNodeCode(t))}if(e<0)throw new O.ErrnoError(28);return e},mmap:function(t,e,r,n,a){if(!O.isFile(t.node.mode))throw new O.ErrnoError(43);It();return S.stream_ops.read(t,f,void 0,e,r),{ptr:void 0,allocated:!0}},msync:function(t,e,r,n,a){return S.stream_ops.write(t,e,0,n,r,!1),0}}},G={DIR_MODE:16895,FILE_MODE:33279,reader:null,mount:function(t){_(l),G.reader||(G.reader=new FileReaderSync);var i=G.createNode(null,"/",G.DIR_MODE,0),o={};function n(t){for(var e=t.split("/"),r=i,n=0;n<e.length-1;n++){var a=e.slice(0,n+1).join("/");o[a]||(o[a]=G.createNode(r,e[n],G.DIR_MODE,0)),r=o[a]}return r}function a(t){t=t.split("/");return t[t.length-1]}return Array.prototype.forEach.call(t.opts.files||[],function(t){G.createNode(n(t.name),a(t.name),G.FILE_MODE,0,t,t.lastModifiedDate)}),(t.opts.blobs||[]).forEach(function(t){G.createNode(n(t.name),a(t.name),G.FILE_MODE,0,t.data)}),(t.opts.packages||[]).forEach(function(r){r.metadata.files.forEach(function(t){var e=t.filename.substr(1);G.createNode(n(e),a(e),G.FILE_MODE,0,r.blob.slice(t.start,t.end))})}),i},createNode:function(t,e,r,n,a,i){var o=O.createNode(t,e,r);return o.mode=r,o.node_ops=G.node_ops,o.stream_ops=G.stream_ops,o.timestamp=(i||new Date).getTime(),_(G.FILE_MODE!==G.DIR_MODE),r===G.FILE_MODE?(o.size=a.size,o.contents=a):(o.size=4096,o.contents={}),t&&(t.contents[e]=o),o},node_ops:{getattr:function(t){return{dev:1,ino:t.id,mode:t.mode,nlink:1,uid:0,gid:0,rdev:void 0,size:t.size,atime:new Date(t.timestamp),mtime:new Date(t.timestamp),ctime:new Date(t.timestamp),blksize:4096,blocks:Math.ceil(t.size/4096)}},setattr:function(t,e){void 0!==e.mode&&(t.mode=e.mode),void 0!==e.timestamp&&(t.timestamp=e.timestamp)},lookup:function(t,e){throw new O.ErrnoError(44)},mknod:function(t,e,r,n){throw new O.ErrnoError(63)},rename:function(t,e,r){throw new O.ErrnoError(63)},unlink:function(t,e){throw new O.ErrnoError(63)},rmdir:function(t,e){throw new O.ErrnoError(63)},readdir:function(t){var e,r=[".",".."];for(e in t.contents)t.contents.hasOwnProperty(e)&&r.push(e);return r},symlink:function(t,e,r){throw new O.ErrnoError(63)}},stream_ops:{read:function(t,e,r,n,a){if(a>=t.node.size)return 0;t=t.node.contents.slice(a,a+n),a=G.reader.readAsArrayBuffer(t);return e.set(new Uint8Array(a),r),t.size},write:function(t,e,r,n,a){throw new O.ErrnoError(29)},llseek:function(t,e,r){if(1===r?e+=t.position:2===r&&O.isFile(t.node.mode)&&(e+=t.node.size),e<0)throw new O.ErrnoError(28);return e}}},O={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(!(t=A.resolve(t)))return{path:"",node:null};if(8<(e=Object.assign({follow_mount:!0,recurse_count:0},e)).recurse_count)throw new O.ErrnoError(32);for(var r=t.split("/").filter(function(t){return!!t}),n=O.root,a="/",i=0;i<r.length;i++){var o=i===r.length-1;if(o&&e.parent)break;if(n=O.lookupNode(n,r[i]),a=D.join2(a,r[i]),!O.isMountpoint(n)||o&&!e.follow_mount||(n=n.mounted.root),!o||e.follow)for(var s=0;O.isLink(n.mode);){var u=O.readlink(a),a=A.resolve(D.dirname(a),u),n=O.lookupPath(a,{recurse_count:e.recurse_count+1}).node;if(40<s++)throw new O.ErrnoError(32)}}return{path:a,node:n}},getPath:function(t){for(var e,r;;){if(O.isRoot(t))return r=t.mount.mountpoint,e?"/"!==r[r.length-1]?r+"/"+e:r+e:r;e=e?t.name+"/"+e:t.name,t=t.parent}},hashName:function(t,e){for(var r=0,n=0;n<e.length;n++)r=(r<<5)-r+e.charCodeAt(n)|0;return(t+r>>>0)%O.nameTable.length},hashAddNode:function(t){var e=O.hashName(t.parent.id,t.name);t.name_next=O.nameTable[e],O.nameTable[e]=t},hashRemoveNode:function(t){var e=O.hashName(t.parent.id,t.name);if(O.nameTable[e]===t)O.nameTable[e]=t.name_next;else for(var r=O.nameTable[e];r;){if(r.name_next===t){r.name_next=t.name_next;break}r=r.name_next}},lookupNode:function(t,e){var r=O.mayLookup(t);if(r)throw new O.ErrnoError(r,t);for(var r=O.hashName(t.id,e),n=O.nameTable[r];n;n=n.name_next){var a=n.name;if(n.parent.id===t.id&&a===e)return n}return O.lookup(t,e)},createNode:function(t,e,r,n){t=new O.FSNode(t,e,r,n);return O.hashAddNode(t),t},destroyNode:function(t){O.hashRemoveNode(t)},isRoot:function(t){return t===t.parent},isMountpoint:function(t){return!!t.mounted},isFile:function(t){return 32768==(61440&t)},isDir:function(t){return 16384==(61440&t)},isLink:function(t){return 40960==(61440&t)},isChrdev:function(t){return 8192==(61440&t)},isBlkdev:function(t){return 24576==(61440&t)},isFIFO:function(t){return 4096==(61440&t)},isSocket:function(t){return 49152==(49152&t)},flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:function(t){var e=O.flagModes[t];if(void 0===e)throw new Error("Unknown file open mode: "+t);return e},flagsToPermissionString:function(t){var e=["r","w","rw"][3&t];return 512&t&&(e+="w"),e},nodePermissions:function(t,e){return O.ignorePermissions||(!e.includes("r")||292&t.mode)&&(!e.includes("w")||146&t.mode)&&(!e.includes("x")||73&t.mode)?0:2},mayLookup:function(t){var e=O.nodePermissions(t,"x");return e||(t.node_ops.lookup?0:2)},mayCreate:function(t,e){try{O.lookupNode(t,e);return 20}catch(t){}return O.nodePermissions(t,"wx")},mayDelete:function(t,e,r){var n;try{n=O.lookupNode(t,e)}catch(t){return t.errno}e=O.nodePermissions(t,"wx");if(e)return e;if(r){if(!O.isDir(n.mode))return 54;if(O.isRoot(n)||O.getPath(n)===O.cwd())return 10}else if(O.isDir(n.mode))return 31;return 0},mayOpen:function(t,e){return t?O.isLink(t.mode)?32:O.isDir(t.mode)&&("r"!==O.flagsToPermissionString(e)||512&e)?31:O.nodePermissions(t,O.flagsToPermissionString(e)):44},MAX_OPEN_FDS:4096,nextfd:function(){for(var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:O.MAX_OPEN_FDS,r=t;r<=e;r++)if(!O.streams[r])return r;throw new O.ErrnoError(33)},getStream:function(t){return O.streams[t]},createStream:function(t,e,r){O.FSStream||(O.FSStream=function(){this.shared={}},O.FSStream.prototype={},Object.defineProperties(O.FSStream.prototype,{object:{get:function(){return this.node},set:function(t){this.node=t}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}},flags:{get:function(){return this.shared.flags},set:function(t){this.shared.flags=t}},position:{get:function(){return this.shared.position},set:function(t){this.shared.position=t}}})),t=Object.assign(new O.FSStream,t);e=O.nextfd(e,r);return t.fd=e,O.streams[e]=t},closeStream:function(t){O.streams[t]=null},chrdev_stream_ops:{open:function(t){var e=O.getDevice(t.node.rdev);t.stream_ops=e.stream_ops,t.stream_ops.open&&t.stream_ops.open(t)},llseek:function(){throw new O.ErrnoError(70)}},major:function(t){return t>>8},minor:function(t){return 255&t},makedev:function(t,e){return t<<8|e},registerDevice:function(t,e){O.devices[t]={stream_ops:e}},getDevice:function(t){return O.devices[t]},getMounts:function(t){for(var e=[],r=[t];r.length;){var n=r.pop();e.push(n),r.push.apply(r,n.mounts)}return e},syncfs:function(e,r){"function"==typeof e&&(r=e,e=!1),O.syncFSRequests++,1<O.syncFSRequests&&y("warning: "+O.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var n=O.getMounts(O.root.mount),a=0;function i(t){return O.syncFSRequests--,r(t)}function o(t){if(t)return o.errored?void 0:(o.errored=!0,i(t));++a>=n.length&&i(null)}n.forEach(function(t){if(!t.type.syncfs)return o(null);t.type.syncfs(t,e,o)})},mount:function(t,e,r){var n,a="/"===r,i=!r;if(a&&O.root)throw new O.ErrnoError(10);if(!a&&!i){i=O.lookupPath(r,{follow_mount:!1});if(r=i.path,n=i.node,O.isMountpoint(n))throw new O.ErrnoError(10);if(!O.isDir(n.mode))throw new O.ErrnoError(54)}i={type:t,opts:e,mountpoint:r,mounts:[]},e=t.mount(i);return(e.mount=i).root=e,a?O.root=e:n&&(n.mounted=i,n.mount&&n.mount.mounts.push(i)),e},unmount:function(t){t=O.lookupPath(t,{follow_mount:!1});if(!O.isMountpoint(t.node))throw new O.ErrnoError(28);var t=t.node,e=t.mounted,n=O.getMounts(e),e=(Object.keys(O.nameTable).forEach(function(t){for(var e=O.nameTable[t];e;){var r=e.name_next;n.includes(e.mount)&&O.destroyNode(e),e=r}}),t.mounted=null,t.mount.mounts.indexOf(e));t.mount.mounts.splice(e,1)},lookup:function(t,e){return t.node_ops.lookup(t,e)},mknod:function(t,e,r){var n=O.lookupPath(t,{parent:!0}).node,t=D.basename(t);if(!t||"."===t||".."===t)throw new O.ErrnoError(28);var a=O.mayCreate(n,t);if(a)throw new O.ErrnoError(a);if(n.node_ops.mknod)return n.node_ops.mknod(n,t,e,r);throw new O.ErrnoError(63)},create:function(t,e){return O.mknod(t,e=(e=void 0!==e?e:438)&4095|32768,0)},mkdir:function(t,e){return O.mknod(t,e=(e=void 0!==e?e:511)&1023|16384,0)},mkdirTree:function(t,e){for(var r=t.split("/"),n="",a=0;a<r.length;++a)if(r[a]){n+="/"+r[a];try{O.mkdir(n,e)}catch(t){if(20!=t.errno)throw t}}},mkdev:function(t,e,r){return void 0===r&&(r=e,e=438),O.mknod(t,e|=8192,r)},symlink:function(t,e){if(!A.resolve(t))throw new O.ErrnoError(44);var r=O.lookupPath(e,{parent:!0}).node;if(!r)throw new O.ErrnoError(44);var e=D.basename(e),n=O.mayCreate(r,e);if(n)throw new O.ErrnoError(n);if(r.node_ops.symlink)return r.node_ops.symlink(r,e,t);throw new O.ErrnoError(63)},rename:function(t,e){var r=D.dirname(t),n=D.dirname(e),a=D.basename(t),i=D.basename(e),o=O.lookupPath(t,{parent:!0}),o=o.node,s=O.lookupPath(e,{parent:!0}).node;if(!o||!s)throw new O.ErrnoError(44);if(o.mount!==s.mount)throw new O.ErrnoError(75);var u,c=O.lookupNode(o,a),t=A.relative(t,n);if("."!==t.charAt(0))throw new O.ErrnoError(28);if("."!==(t=A.relative(e,r)).charAt(0))throw new O.ErrnoError(55);try{u=O.lookupNode(s,i)}catch(t){}if(c!==u){n=O.isDir(c.mode),e=O.mayDelete(o,a,n);if(e)throw new O.ErrnoError(e);if(e=u?O.mayDelete(s,i,n):O.mayCreate(s,i))throw new O.ErrnoError(e);if(!o.node_ops.rename)throw new O.ErrnoError(63);if(O.isMountpoint(c)||u&&O.isMountpoint(u))throw new O.ErrnoError(10);if(s!==o&&(e=O.nodePermissions(o,"w")))throw new O.ErrnoError(e);O.hashRemoveNode(c);try{o.node_ops.rename(c,s,i)}catch(t){throw t}finally{O.hashAddNode(c)}}},rmdir:function(t){var e=O.lookupPath(t,{parent:!0}).node,t=D.basename(t),r=O.lookupNode(e,t),n=O.mayDelete(e,t,!0);if(n)throw new O.ErrnoError(n);if(!e.node_ops.rmdir)throw new O.ErrnoError(63);if(O.isMountpoint(r))throw new O.ErrnoError(10);e.node_ops.rmdir(e,t),O.destroyNode(r)},readdir:function(t){t=O.lookupPath(t,{follow:!0}).node;if(t.node_ops.readdir)return t.node_ops.readdir(t);throw new O.ErrnoError(54)},unlink:function(t){var e=O.lookupPath(t,{parent:!0}).node;if(!e)throw new O.ErrnoError(44);var t=D.basename(t),r=O.lookupNode(e,t),n=O.mayDelete(e,t,!1);if(n)throw new O.ErrnoError(n);if(!e.node_ops.unlink)throw new O.ErrnoError(63);if(O.isMountpoint(r))throw new O.ErrnoError(10);e.node_ops.unlink(e,t),O.destroyNode(r)},readlink:function(t){t=O.lookupPath(t).node;if(!t)throw new O.ErrnoError(44);if(t.node_ops.readlink)return A.resolve(O.getPath(t.parent),t.node_ops.readlink(t));throw new O.ErrnoError(28)},stat:function(t,e){t=O.lookupPath(t,{follow:!e}).node;if(!t)throw new O.ErrnoError(44);if(t.node_ops.getattr)return t.node_ops.getattr(t);throw new O.ErrnoError(63)},lstat:function(t){return O.stat(t,!0)},chmod:function(t,e,r){if(!(r="string"==typeof t?O.lookupPath(t,{follow:!r}).node:t).node_ops.setattr)throw new O.ErrnoError(63);r.node_ops.setattr(r,{mode:4095&e|-4096&r.mode,timestamp:Date.now()})},lchmod:function(t,e){O.chmod(t,e,!0)},fchmod:function(t,e){t=O.getStream(t);if(!t)throw new O.ErrnoError(8);O.chmod(t.node,e)},chown:function(t,e,r,n){if(!(n="string"==typeof t?O.lookupPath(t,{follow:!n}).node:t).node_ops.setattr)throw new O.ErrnoError(63);n.node_ops.setattr(n,{timestamp:Date.now()})},lchown:function(t,e,r){O.chown(t,e,r,!0)},fchown:function(t,e,r){t=O.getStream(t);if(!t)throw new O.ErrnoError(8);O.chown(t.node,e,r)},truncate:function(t,e){if(e<0)throw new O.ErrnoError(28);if(!(t="string"==typeof t?O.lookupPath(t,{follow:!0}).node:t).node_ops.setattr)throw new O.ErrnoError(63);if(O.isDir(t.mode))throw new O.ErrnoError(31);if(!O.isFile(t.mode))throw new O.ErrnoError(28);var r=O.nodePerm