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,EAAG,EAAO,KAC5B,EAAO,UAEN,GAAe,EAAY,SAAS,EAAO,SAC9C,EAAM,EAAG,IAAI,EAAK,4BAA4B,MAE9C,GAAG,WACF,EAAc,EAAO,SACpB,IACI,GACH,KAAK,KAAK,QAAS,IAAI,YAAY,YAAa,wBAAwB,KACzE,IAKL,CAAE,MAAO,GACR,KAAK,KAAK,QAAS,IAAI,YAAY,YAAa,GACjD,CAEA,EAAG,KAAM,EACV,GACD","file":"/npm/gulp-fontfacegen-mod@1.0.7/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/gulp-fontfacegen-mod@1.0.7/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\";\r\nconst PluginError = require(\"plugin-error\");\r\nconst through = require(\"through2\");\r\nconst fs = require(\"fs\");\r\nconst chalk = require(\"chalk\");\r\n\r\nconst fontFaceGenResult = require(\"./facegen\");\r\n\r\nconst PLUGIN_NAME = \"gulp-fontfacegen-mod\";\r\n\r\nmodule.exports = function (options = {}) {\r\n\r\n\tlet {\r\n\t\tfilepath = \"./src/css/partial\",\r\n\t\tfilename = \"fonts.css\",\r\n\t\tdestpath = \"../fonts\",\r\n\t\trewrite = \"add\" //del, add, sqip\r\n\t} = options,\r\n\t\tfontFaceFile = `${filepath}/${filename}`,\r\n\t\tfileExist = fs.existsSync(fontFaceFile), fileContent = null;\r\n\r\n\tif (!fs.existsSync(filepath)) {\r\n\t\tfs.mkdirSync(filepath, { recursive: true });\r\n\t}\r\n\r\n\tfunction print(stat, msg) {\r\n\t\tswitch (stat) {\r\n\t\t\tcase 1: //Error\r\n\t\t\t\tconsole.log(chalk.red(\"❌\", msg));\r\n\r\n\t\t\t\tbreak;\r\n\t\t\tcase 2: //Warning\r\n\t\t\t\tconsole.log(chalk.hex(\"#FFA500\")(\"⚠\", msg));\r\n\t\t\t\tbreak;\r\n\t\t\tcase 3: //Pass\r\n\t\t\tdefault:\r\n\t\t\t\tconsole.log(chalk.green(\"✔\", msg));\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tif (fileExist) {\r\n\t\tconsole.log(chalk.cyan(`✔ File ${fontFaceFile} already exists.`));\r\n\t\tswitch (options.rewrite) {\r\n\t\t\tcase \"del\":\r\n\t\t\t\tprint(1, `File \"${filename}\" will be deleted.`);\r\n\t\t\t\tfs.unlink(fontFaceFile,\r\n\t\t\t\t\t(err) => {\r\n\t\t\t\t\t\tif (err) print(1, err);\r\n\t\t\t\t\t});\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"skip\":\r\n\t\t\t\tprint(2, `File \"${filename}\" SKIP, will not be processed.`);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"add\":\r\n\t\t\tdefault:\r\n\t\t\t\tprint(3, `File \"${filename}\" will be appended.`);\r\n\t\t\t\tfileContent = fs.readFileSync(fontFaceFile, \"utf8\");\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\treturn through.obj(function (file, enc, cb) {\r\n\t\tif (file.isNull()) return cb(null, file);\r\n\r\n\t\tif (file.isStream()) {\r\n\t\t\tthis.emit(\"error\", new PluginError(PLUGIN_NAME, \"Streams not supported!\"));\r\n\t\t\treturn cb(null);\r\n\t\t}\r\n\t\t// check CSS file existance && options rewrite.\r\n\t\tif (fileExist && options.rewrite === \"skip\") return cb(null, file);\r\n\r\n\t\ttry {\r\n\t\t\tlet result = fontFaceGenResult(file, destpath);\r\n\t\t\tif (result.msg) print(3, result.msg);\r\n\t\t\tif (result.dataApp) {\r\n\r\n\t\t\t\tif (fileContent && fileContent.includes(result.dataApp)) {\r\n\t\t\t\t\tprint(2, `\"${file.stem}\" is already in the \"${filename}\"`);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tfs.appendFile(\r\n\t\t\t\t\t\tfontFaceFile, result.dataApp,\r\n\t\t\t\t\t\t(err) => {\r\n\t\t\t\t\t\t\tif (err) {\r\n\t\t\t\t\t\t\t\tthis.emit(\"error\", new PluginError(PLUGIN_NAME, `Error while creating ${fontFaceFile}`));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tthis.emit(\"error\", new PluginError(PLUGIN_NAME, err));\r\n\t\t}\r\n\r\n\t\tcb(null, file);\r\n\t});\r\n};\r\n"]}