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,GAAA,sCAAI,EAAE,KAAK,CAAC,CAAC,sBAAe,EAAE,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,yBAAyB,CAAC;IACxG,MAAM,CAAA,GAAA,wCAAO,EAAE;IACf,QAAQ,GAAG,CAAC,CAAA,GAAA,sCAAI,EAAE,OAAO,CAAC,KAAK,CAAC;IAChC,MAAM,CAAA,GAAA,wCAAO,EAAE;AACjB;AACO,SAAS;IACd;AACF;AACO,SAAS;IACd;AACF","sources":["src/index.ts","src/helper/waittime.ts","src/pages/askQuestions.ts","src/main/question.ts","src/pages/cssDownload.ts","src/main/file-downloader.ts","src/main/dir-checker.ts","src/pages/fontsDownload.ts","src/main/font-extractor.ts","src/pages/versionCheck.ts","src/json/fonts.json","src/pages/noticeOfficial.ts"],"sourcesContent":["import chalk from \"chalk\"\r\nimport waittime from \"./helper/waittime\"\r\nimport askQuestion from \"./pages/askQuestions\"\r\nimport cssDownload from \"./pages/cssDownload\"\r\nimport { downloadFonts, readFonts } from \"./pages/fontsDownload\"\r\nimport checkVersion from \"./pages/versionCheck\"\r\nimport unofficialNotice from \"./pages/noticeOfficial\"\r\n\r\nasync function startDownloader(): Promise<void> {\r\n await waittime(100)\r\n console.clear()\r\n const { isOk } = await unofficialNotice()\r\n if (!isOk) return\r\n const { useDir } = await askQuestion()\r\n const { fontlist, useVer, baseUrl } = await checkVersion()\r\n const cssUrls: string[] = await cssDownload(useVer, useDir, fontlist)\r\n const fontUrls: string[] = await readFonts(cssUrls, useDir)\r\n await downloadFonts(fontUrls, useDir, baseUrl)\r\n await waittime(2000)\r\n console.log(\"--------\")\r\n await waittime(1000)\r\n console.log(chalk.green(`✅ Font Awesome ${useVer.split(\".\")[0]} Pro v${useVer} Downloaded Successfully!`))\r\n await waittime(1000)\r\n console.log(chalk.bgGreen.black(\" --- DONE --- \"))\r\n await waittime(2000)\r\n}\r\nexport function getFontAwesomePro(): void {\r\n startDownloader()\r\n}\r\nexport function getFapro(): void {\r\n startDownloader()\r\n}\r\n","export default function waittime(ms: number = 500, n: number = 5): Promise<void> {\r\n return new Promise((resolve) => setTimeout(resolve, ms - n))\r\n}\r\n","import chalk from \"chalk\"\r\nimport { question } from \"../main/question\"\r\nimport waittime from \"../helper/waittime\"\r\n\r\nexport default async function askQuestion(): Promise<{ useDir: string }> {\r\n console.log(\"--------\")\r\n await waittime(1000)\r\n console.log(\" \")\r\n await waittime(100)\r\n console.log(`Set the ${chalk.cyan(\"Download Path\")}!`)\r\n await waittime(100)\r\n console.log(\"--------\")\r\n await waittime(100)\r\n console.log(\"Download path can be \" + chalk.cyan(\"`path/to/your/public/folder`\") + \" or \" + chalk.cyan(\"`anything`\") + \".\")\r\n await waittime(100)\r\n console.log(\"--------\")\r\n await waittime(100)\r\n console.log(\"if the path does not exist, it will be created automatically.\")\r\n await waittime(500)\r\n console.log(\"--------\")\r\n const dir = await question(`Enter download path: ${chalk.bold.cyan(\"(fapro)\")} `)\r\n const useDir = dir ? dir : \"fapro\"\r\n console.log(chalk.bold.cyan(`${useDir}`) + `${dir ? \"\" : \" (default)\"}`)\r\n console.log(\"--------\")\r\n await waittime(750)\r\n console.log(\" \")\r\n console.log(chalk.bgYellow.black(\" -- Preparing Downloader -- \"))\r\n await waittime(2250)\r\n console.log(\" \")\r\n return { useDir }\r\n}\r\n","import readline from \"readline\"\r\n\r\nexport function question(text: string): Promise<string> {\r\n return new Promise((resolve) => {\r\n const rl = readline.createInterface({\r\n input: process.stdin,\r\n output: process.stdout\r\n })\r\n rl.question(text, (anwer) => {\r\n resolve(anwer)\r\n rl.close()\r\n })\r\n })\r\n}\r\n","import chalk from \"chalk\"\r\nimport { downloadFile, getDownloaded } from \"../main/file-downloader\"\r\nimport waittime from \"../helper/waittime\"\r\n\r\nexport default async function cssDownload(useVer: string, useDir: string, fontlist: string[]): Promise<string[]> {\r\n console.log(\"--------\")\r\n console.log(`🕗 Downloading All Stylesheets`)\r\n await waittime(2000)\r\n\r\n const dir = `${useDir}/css`\r\n\r\n for (let i = 0; i < fontlist.length; i++) {\r\n const url = fontlist[i]\r\n const progress = `[${i + 1}/${fontlist.length}]`\r\n await downloadFile(url, dir, progress)\r\n }\r\n console.log(chalk.greenBright(\"✅ Stylesheets Downloaded\"))\r\n await waittime(2000)\r\n return getDownloaded()\r\n}\r\n","import { Downloader } from \"nodejs-file-downloader\"\r\nimport { addDir } from \"./dir-checker\"\r\nimport chalk from \"chalk\"\r\n\r\nlet filesDownloaded: string[] = []\r\n\r\nexport async function downloadFile(fileurl: string, filedir: string, progress: string | null = null): Promise<void> {\r\n await addDir(`${filedir}`)\r\n const downloader = new Downloader({\r\n url: fileurl,\r\n directory: `./${filedir}`,\r\n cloneFiles: false\r\n })\r\n try {\r\n await downloader.download()\r\n const fileorigin = fileurl.split(\"/\")\r\n const filename = fileorigin[fileorigin.length - 1]\r\n console.log(`🚀 ${progress ? chalk.yellow(progress) + \" \" : \"\"}${filename}`)\r\n filesDownloaded.push(filename)\r\n } catch (_error) {\r\n throw new Error(chalk.red(\"The version you wanted to download is not available. Please use other release version.\"))\r\n }\r\n}\r\nexport function getDownloaded(): string[] {\r\n const files: string[] = [...filesDownloaded]\r\n filesDownloaded = []\r\n return files\r\n}\r\n","import fs from \"fs\"\r\nimport waittime from \"../helper/waittime\"\r\n\r\nexport async function addDir(dirpath: string): Promise<void> {\r\n let curpath = \".\"\r\n const dirs: string[] = dirpath.split(\"/\")\r\n\r\n for (const dir of dirs) {\r\n curpath += `/${dir}`\r\n if (!fs.existsSync(curpath)) {\r\n fs.mkdirSync(curpath)\r\n await waittime(100)\r\n }\r\n }\r\n}\r\n","import { addDir } from \"../main/dir-checker\"\r\nimport waittime from \"../helper/waittime\"\r\nimport { extractFont, getFonts } from \"../main/font-extractor\"\r\nimport { downloadFile } from \"../main/file-downloader\"\r\nimport chalk from \"chalk\"\r\n\r\nexport async function readFonts(sheets: string[], useDir: string): Promise<string[]> {\r\n console.log(\"--------\")\r\n console.log(\"🕗 Reading Available Webfonts\")\r\n const dir = `${useDir}/css`\r\n for (const sheet of sheets) {\r\n await extractFont(sheet, dir)\r\n }\r\n const fonts = getFonts()\r\n console.log(\"✅ Found \" + chalk.green(fonts.length.toString()) + \" Webfonts\")\r\n await waittime(2000)\r\n return fonts\r\n}\r\nexport async function downloadFonts(fonts: string[], filedir: string, baseUrl: string): Promise<void> {\r\n const dir = `${filedir}/webfonts`\r\n await addDir(dir)\r\n const fonturl = baseUrl\r\n console.log(\"--------\")\r\n console.log(\"🕗 Downloading All Webfonts\")\r\n await waittime(2000)\r\n for (let i = 0; i < fonts.length; i++) {\r\n const font = fonts[i].replace(\"..\", \"\")\r\n const url = `${fonturl}${font}`\r\n const progress = `[${i + 1}/${fonts.length}]`\r\n await downloadFile(url, dir, progress)\r\n }\r\n console.log(chalk.greenBright(\"✅ Webfonts Downloaded\"))\r\n}\r\n","import fs from \"fs\"\r\nimport postcss from \"postcss\"\r\nimport safeParser from \"postcss-safe-parser\"\r\n\r\nlet fontUrls: string[] = []\r\n\r\nexport async function extractFont(filename: string, filedir: string): Promise<void> {\r\n const css = fs.readFileSync(`./${filedir}/${filename}`, \"utf8\")\r\n postcss()\r\n .process(css, { parser: safeParser, from: undefined })\r\n .then((result) => {\r\n result.root.walkAtRules(\"font-face\", (rule) => {\r\n rule.walkDecls(\"src\", (decl) => {\r\n const matches = decl.value.match(/url\\(([^)]+)\\)/g)\r\n if (matches) {\r\n matches.forEach((url) => {\r\n const cleanUrl = url.replace(/url\\([\"']?/, \"\").replace(/[\"']?\\)/, \"\")\r\n fontUrls.push(cleanUrl)\r\n })\r\n }\r\n })\r\n })\r\n })\r\n}\r\n\r\nexport function getFonts(): string[] {\r\n const fixedFonts: string[] = [...fontUrls]\r\n fontUrls = []\r\n return fixedFonts\r\n}\r\n","import { Ver } from \"./fa.types\"\r\nimport defVer from \"../json/fonts.json\"\r\nimport waittime from \"../helper/waittime\"\r\nimport chalk from \"chalk\"\r\n\r\nasync function getVersion(): Promise<Ver> {\r\n const url = `https://raw.githubusercontent.com/devanka761/webfont-awesome-pro/refs/heads/master/src/json/fonts.json?ts=${Date.now().toString(36)}`\r\n\r\n return await fetch(url, {\r\n method: \"GET\"\r\n })\r\n .then((res) => res.json())\r\n .then((res) => {\r\n console.log(`✅ Found: v${res.version}`)\r\n return res\r\n })\r\n .catch(() => {\r\n console.log(`⛔ Error getting the latest version!`)\r\n console.log(`⛔ Forced Using v${defVer.version}`)\r\n return defVer\r\n })\r\n}\r\n\r\nexport default async function checkVersion(): Promise<{ fontlist: string[]; useVer: string; baseUrl: string }> {\r\n console.log(\"--------\")\r\n console.log(\"🕗 Checking Latest Version\")\r\n await waittime(1000)\r\n const curFonts = await getVersion()\r\n await waittime(100)\r\n console.log(\"--------\")\r\n await waittime(1000)\r\n console.log(\" \")\r\n console.log(chalk.bgGreen.black(` -- Downloading Version ${curFonts.version} of Font Awesome ${curFonts.version.split(\".\")[0]} Pro -- `))\r\n await waittime(1000)\r\n console.log(\" \")\r\n console.log(\"--------\")\r\n await waittime(100)\r\n console.log(\"🕗 Reading Available Stylesheets\")\r\n await waittime(500)\r\n const fontlist = curFonts.css.map((file) => `${curFonts.root}/css/${file}`)\r\n console.log(\"✅ Found \" + chalk.green(fontlist.length.toString()) + \" Sytlesheets\")\r\n await waittime(2000)\r\n return { fontlist, useVer: curFonts.version, baseUrl: curFonts.root }\r\n}\r\n","{ \"version\": \"7.0.0\", \"root\": \"https://site-assets.fontawesome.com/releases/v7.0.0\", \"css\": [\"fontawesome.css\", \"whiteboard-semibold.css\", \"thumbprint-light.css\", \"slab-press-regular.css\", \"slab-regular.css\", \"sharp-duotone-thin.css\", \"sharp-duotone-solid.css\", \"sharp-duotone-regular.css\", \"sharp-duotone-light.css\", \"sharp-thin.css\", \"sharp-solid.css\", \"sharp-regular.css\", \"sharp-light.css\", \"notdog-duo-solid.css\", \"notdog-solid.css\", \"jelly-fill-regular.css\", \"jelly-duo-regular.css\", \"jelly-regular.css\", \"etch-solid.css\", \"duotone-thin.css\", \"duotone.css\", \"duotone-regular.css\", \"duotone-light.css\", \"thin.css\", \"solid.css\", \"regular.css\", \"light.css\", \"brands.css\", \"chisel-regular.css\"] }\r\n","import chalk from \"chalk\"\r\nimport waittime from \"../helper/waittime\"\r\nimport { question } from \"../main/question\"\r\n\r\nexport default async function unofficialNotice(): Promise<{ isOk: boolean }> {\r\n console.log(chalk.bgCyan.black(\" -- Font Awesome Pro Downloader | Devanka761 -- \"))\r\n await waittime(500)\r\n console.log(\"\")\r\n console.log(\"--------\")\r\n console.log(`Font Awesome Pro Downloader was made for ${chalk.yellow(\"educational purposes\")} only!`)\r\n await waittime(100)\r\n console.log(\"--------\")\r\n await waittime(100)\r\n console.log(`This downloader provides ${chalk.bold.green(\"Paid version\")} for the latest Official Package. It is intended for ${chalk.yellow(\"experimental\")} and ${chalk.yellow(\"personal use\")} only. It is ${chalk.red(\"not licensed\")} for commercial use.`)\r\n await waittime(100)\r\n console.log(\"--------\")\r\n await waittime(100)\r\n console.log(`To unlock commercial use and get an official product license, please consider to go to the ${chalk.green(\"Font Awesome\")} webiste: ${chalk.green(\"https://fontawesome.com/plans\")}`)\r\n await waittime(100)\r\n console.log(\"--------\")\r\n await waittime(500)\r\n let agree = await question(`Continue to download? (${chalk.cyan(\"Y\")}/n) `)\r\n agree = agree ? agree.toLowerCase() : \"y\"\r\n const notAgrees = [\"no\", \"n\", \"nope\"]\r\n const isOk = notAgrees.find((textNo) => textNo === agree) ? false : true\r\n console.log(chalk.cyan(isOk ? \"y\" : \"n\"))\r\n if (!isOk) {\r\n console.log(\"--------\")\r\n await waittime(1000)\r\n console.log(chalk.red(\"⛔ Font Awesome Pro Downloader Canceled\"))\r\n await waittime(1000)\r\n console.log(chalk.bgRed.black(\" --- DONE --- \"))\r\n }\r\n\r\n return { isOk }\r\n}\r\n"],"names":[],"version":3,"file":"index.cjs.map","sourceRoot":"../"}