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,KAAR,IAAiB,UAAjB,IAA+B,GAAG,KAAK,MAA3C,EAAmD;AACjD,MAAA,QAAQ,GAAG,MAAX;AACD,KAFD,MAGK,IAAI,GAAG,KAAK,QAAR,IAAoB,GAAG,KAAK,KAAhC,EAAuC;AAC1C,MAAA,QAAQ,GAAG,MAAX;AACD;AACF,GAPI,MAQA,IAAI,IAAI,KAAK,IAAI,CAAC,MAAlB,EAA0B;AAC7B,QAAI,GAAG,KAAK,MAAZ,EAAoB;AAClB,MAAA,QAAQ,GAAG,OAAX;AACD;AACF,GAJI,MAKA,IAAI,IAAI,KAAK,IAAI,CAAC,KAAlB,EAAyB;AAC5B,QAAI,GAAG,KAAK,QAAR,IAAoB,GAAG,KAAK,KAAhC,EAAuC;AACrC,MAAA,QAAQ,GAAG,SAAX;AACD;AACF;;AACD,SAAO,QAAP;AACD,C","sourcesContent":["export enum Arch {\n ia32, x64, armv7l, arm64, universal\n}\n\nexport type ArchType = \"x64\" | \"ia32\" | \"armv7l\" | \"arm64\" | \"universal\"\n\nexport function toLinuxArchString(arch: Arch, targetName: string): string {\n switch (arch) {\n case Arch.x64:\n return \"amd64\"\n case Arch.ia32:\n return targetName === \"pacman\" ? \"i686\" : \"i386\"\n case Arch.armv7l:\n return targetName === \"snap\" || targetName === \"deb\" ? \"armhf\" : \"armv7l\"\n case Arch.arm64:\n return targetName === \"pacman\" ? \"aarch64\" : \"arm64\"\n\n default:\n throw new Error(`Unsupported arch ${arch}`)\n }\n}\n\nexport function getArchCliNames(): Array<string> {\n return [Arch[Arch.ia32], Arch[Arch.x64], Arch[Arch.armv7l], Arch[Arch.arm64]]\n}\n\nexport function getArchSuffix(arch: Arch, defaultArch?: string): string {\n return arch === defaultArchFromString(defaultArch) ? \"\" : `-${Arch[arch]}`\n}\n\nexport function archFromString(name: string): Arch {\n switch (name) {\n case \"x64\":\n return Arch.x64\n case \"ia32\":\n return Arch.ia32\n case \"arm64\":\n return Arch.arm64\n case \"armv7l\":\n return Arch.armv7l\n case \"universal\":\n return Arch.universal\n default:\n throw new Error(`Unsupported arch ${name}`)\n }\n}\n\nexport function defaultArchFromString(name?: string): Arch {\n return name ? archFromString(name) : Arch.x64;\n}\n\nexport function getArtifactArchName(arch: Arch, ext: string): string {\n let archName = Arch[arch]\n const isAppImage = ext === \"AppImage\" || ext === \"appimage\"\n if (arch === Arch.x64) {\n if (isAppImage || ext === \"rpm\") {\n archName = \"x86_64\"\n }\n else if (ext === \"deb\" || ext === \"snap\") {\n archName = \"amd64\"\n }\n }\n else if (arch === Arch.ia32) {\n if (ext === \"deb\" || isAppImage || ext === \"snap\") {\n archName = \"i386\"\n }\n else if (ext === \"pacman\" || ext === \"rpm\") {\n archName = \"i686\"\n }\n }\n else if (arch === Arch.armv7l) {\n if (ext === \"snap\") {\n archName = \"armhf\"\n }\n }\n else if (arch === Arch.arm64) {\n if (ext === \"pacman\" || ext === \"rpm\") {\n archName = \"aarch64\"\n }\n }\n return archName\n}"],"sourceRoot":""}