{"version":3,"sources":["jsdelivr-header.js","/npm/pocketbase-installer@0.1.10/dist/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,aACA,IAAI,gBAAmB,MAAQ,KAAK,iBAAoB,SAAU,GAC9D,OAAQ,GAAO,EAAI,WAAc,EAAM,CAAE,QAAW,EACxD,EACA,OAAO,eAAe,QAAS,aAAc,CAAE,OAAO,IACtD,QAAQ,kBAAoB,kBAC5B,MAAM,OAAS,gBAAgB,QAAQ,SACjC,WAAa,QAAQ,cACrB,WAAa,QAAQ,cACrB,QAAU,QAAQ,WACxB,eAAe,mBAAkB,QAAE,EAAU,SAAQ,YAAE,EAAc,OAAO,QAAQ,KAAK,QAAQ,MAAO,MAAK,cAAE,EAAgB,8DAAkE,CAAC,GAC9L,KAEI,EAAI,WAAW,uBAAuB,GAEtC,MAAM,YAAE,IAAgB,EAAI,WAAW,iBAAiB,GAClD,EAAc,GAAG,MAAkB,KAAW,IAC9C,EAAU,OAAO,QAAQ,KAAK,EAAa,GAC3C,EAAc,OAAO,QAAQ,KAAK,EAAa,eAErD,EAAI,WAAW,uBAAuB,SAEhC,EAAI,WAAW,cAAc,CAC/B,IAAK,EACL,WAAY,KAGhB,EAAI,QAAQ,cAAc,EAAS,GACnC,QAAQ,IAAI,eAAe,6BAC3B,QAAQ,IAAI,iBAAiB,KAE7B,MAAM,GAAuB,EAAI,WAAW,mBAAmB,IAC/D,EAAI,QAAQ,eAAe,EAC/B,CACA,MAAO,GACH,QAAQ,MAAM,uBAAwB,GACtC,QAAQ,KAAK,EACjB,CACJ,CACA,QAAQ,QAAU","file":"/npm/pocketbase-installer@0.1.10/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/pocketbase-installer@0.1.10/dist/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n    return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.installPocketBase = installPocketBase;\nconst path_1 = __importDefault(require(\"path\"));\nconst platform_1 = require(\"./platform\");\nconst download_1 = require(\"./download\");\nconst unzip_1 = require(\"./unzip\");\nasync function installPocketBase({ version = \"0.23.5\", downloadDir = path_1.default.join(process.cwd(), \"./\"), githubBaseUrl = \"https://github.com/pocketbase/pocketbase/releases/download\", } = {}) {\n    try {\n        // Ensure download directory exists\n        (0, download_1.ensureDirectoryExists)(downloadDir);\n        // Get appropriate package details\n        const { packageName } = (0, platform_1.getPlatformInfo)(version);\n        const downloadUrl = `${githubBaseUrl}/v${version}/${packageName}`;\n        const zipPath = path_1.default.join(downloadDir, packageName);\n        const extractPath = path_1.default.join(downloadDir, \"pocketbase\");\n        // Ensure extraction directory exists\n        (0, download_1.ensureDirectoryExists)(extractPath);\n        // Download the package\n        await (0, download_1.downloadFile)({\n            url: downloadUrl,\n            outputPath: zipPath,\n        });\n        // Unzip the package\n        (0, unzip_1.unzipPackage)(zipPath, extractPath);\n        console.log(`PocketBase v${version} installed successfully!`);\n        console.log(`Installed to: ${extractPath}`);\n        // Get executable path and run server\n        const pocketbaseExecutable = (0, platform_1.getExecutablePath)(extractPath);\n        (0, unzip_1.runPocketBase)(pocketbaseExecutable);\n    }\n    catch (error) {\n        console.error(\"Installation failed:\", error);\n        process.exit(1);\n    }\n}\nexports.default = installPocketBase;\n"]}