/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/template-tango@1.0.8/dist/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
"use strict";var fs=require("fs-extra"),inquirer=require("inquirer"),os=require("os"),chalk=require("chalk"),slash=require("slash"),utils_1=require("./utils"),NS="TemplateTango",B2F="backToFront/",F2B="frontToBack/",suppressWarnings=!1,Questions=function(){function e(e,n){this.opts=e,this.questions().then(n)}return e.prototype.questions=function(){var e=this.opts,n=[];return e.skipBCConfirm||n.push({type:"confirm",name:"beyondCompare",message:chalk.magenta("Have you got Beyond Compare installed on the command-line? You will need it to run this task. See README.md for setup guide"),default:!0}),n.push({when:function(n){return e.skipBCConfirm?(n.beyondCompare=!0,!0):(n.beyondCompare||console.warn(chalk.red("Sorry, but you must have Beyond Compare installed on the command-line to run this app. Stopping early.")),n.beyondCompare)},type:"confirm",name:"backToFront",message:chalk.cyan('\nOk to clone "back to front" into ')+chalk.bgCyan.white('"'+this.opts.cloneDest+B2F+'"')+chalk.cyan("?"),default:!0},{when:function(n){return n.backToFront&&n.beyondCompare?utils_1.default.copyBackToFront(e.cloneDest+B2F,e.backEnd,e.frontEnd.extension,e.frontEnd.subDir,e.frontEnd.pagesDir,e.frontEnd.modulesDir,e.nameMap).then((function(n){return n.errList.length?(console.warn(chalk.red("Some files could not be found. Stopping early."),n.errList),!1):(utils_1.default.launchBC(e.beyondComparePath,e.cloneDest+B2F,e.frontEnd.rootDir),console.log(utils_1.default.getBeyondCompareMessage("Back to front","magenta","bgMagenta")),!0)})):(n.beyondCompare?n.backToFront||console.warn(chalk.red("You answered 'No' to merging 'back to front'. Skipping step.")):console.warn(chalk.red("You answered 'No' having Beyond Compare installed on the command-line. Skipping step.")),!0)},type:"confirm",name:"frontToBack",message:chalk.cyan('Ok to clone "front to back" into ')+chalk.bgCyan.white('"'+this.opts.cloneDest+F2B+'"')+chalk.cyan("?"),default:!0},{when:function(n){return n.frontToBack&&n.beyondCompare?utils_1.default.copyFrontToBack(e.cloneDest+F2B,e.frontEnd,e.backEnd.extension,e.backEnd.subDir,e.backEnd.pagesDir,e.backEnd.modulesDir,e.nameMap).then((function(n){return n.errList.length?(console.warn(chalk.red("Some files could not be found. Stopping early."),n.errList),!1):(utils_1.default.launchBC(e.beyondComparePath,e.cloneDest+F2B,e.backEnd.rootDir),console.log(utils_1.default.getBeyondCompareMessage("Front to back","cyan","bgCyan")),!0)})):(n.beyondCompare?n.frontToBack||console.warn(chalk.red("You answered 'No' to merging 'front to back'. Skipping step.")):console.warn(chalk.red("You answered 'No' having Beyond Compare installed on the command-line. Skipping step.")),!0)},type:"confirm",name:"frontToBack",message:chalk.magenta("When you're done with forwards merge, press enter to run final step."),default:!0}),inquirer.prompt(n)},e}();function startQuestions(e,n){e.beyondComparePath||(e.beyondComparePath="C:/Program Files/Beyond Compare 4/BCompare.exe"),e.cloneDest||(e.cloneDest=utils_1.default.ensureTrainlingSlash(slash(os.tmpdir()))+"template-tango/"),fs.remove(e.cloneDest,(function(o){o?console.warn(NS,"startQuestions","Couldn't clear the 'cloneDest' directory",e.cloneDest):new Questions(e,n)}))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default={startQuestions:startQuestions,testable:{suppressWarnings:function(e){suppressWarnings=e,utils_1.default.testable.suppressWarnings(e)}}};
//# sourceMappingURL=/sm/189a1806a2072c375aa9c472039657c9a3a2559105ea2bbd92ec490ddd77036b.map