/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/r2-utils-js@1.0.43/dist/es6-es2015/src/_utils/perf-cli.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const tslib_1=require("tslib"),fs=require("fs"),path=require("path"),BufferUtils_1=require("./stream/BufferUtils"),zip_ex_1=require("./zip/zip-ex"),zip1_1=require("./zip/zip1"),zip2_1=require("./zip/zip2"),zip3_1=require("./zip/zip3");console.log("process.cwd():"),console.log(process.cwd()),console.log("__dirname:"),console.log(__dirname);const args=process.argv.slice(2);console.log("args:"),console.log(args),args[0]||(console.log("FILEPATH ARGUMENT IS MISSING."),process.exit(1));const argPath=args[0].trim();let filePath=argPath;console.log(filePath),fs.existsSync(filePath)||(filePath=path.join(__dirname,argPath),console.log(filePath),fs.existsSync(filePath)||(filePath=path.join(process.cwd(),argPath),console.log(filePath),fs.existsSync(filePath)||(console.log("FILEPATH DOES NOT EXIST."),process.exit(1))));const stats=fs.lstatSync(filePath);stats.isFile()||stats.isDirectory()||(console.log("FILEPATH MUST BE FILE OR DIRECTORY."),process.exit(1));const fileName=path.basename(filePath),ext=path.extname(fileName);stats.isDirectory()?tslib_1.__awaiter(void 0,void 0,void 0,(function*(){const e=yield zip_ex_1.ZipExploded.loadPromise(filePath),s=yield e.getEntries();for(const o of s){let s;console.log("############## "+o);try{s=yield e.entryStreamPromise(o)}catch(e){return void console.log(e)}const i=s.stream;let t;try{t=yield(0,BufferUtils_1.streamToBufferPromise)(i)}catch(e){return void console.log(e)}if(/\.css$/i.test(o)){const e=t.toString("utf8");console.log(e)}}})):/((\.epub3?)|(\.cbz)|(\.zip))$/i.test(ext)&&tslib_1.__awaiter(void 0,void 0,void 0,(function*(){const e=process.hrtime(),s=yield zip3_1.Zip3.loadPromise(filePath),o=process.hrtime(e);console.log(`Zip 3 (${s.entriesCount()}): ${o[0]} seconds + ${o[1]} nanoseconds`);const i=process.hrtime(),t=yield zip2_1.Zip2.loadPromise(filePath),r=process.hrtime(i);console.log(`Zip 2 (${t.entriesCount()}): ${r[0]} seconds + ${r[1]} nanoseconds`);const l=process.hrtime(),c=yield zip1_1.Zip1.loadPromise(filePath),n=process.hrtime(l);console.log(`Zip 1 (${c.entriesCount()}): ${n[0]} seconds + ${n[1]} nanoseconds`)}));
//# sourceMappingURL=/sm/6cf482cdec9b3e806b6fa622d1159fd5ae943fcaff30be2c2dc4ef151b593605.map