/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/grunt-legacy-log@3.0.1/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
"use strict";var util=require("util"),hooker=require("hooker"),colors=require("colors"),_=require("lodash"),logUtils=require("grunt-legacy-log-utils");function Log(t){if(this.always=this,this.options=_.extend({},{color:!0,verbose:!1,debug:!1,outStream:process.stdout,grunt:null,maxCols:null,muted:!1},t),this.hasLogged=!1,this.verbose=new VerboseLog(this,!0),this.notverbose=new VerboseLog(this,!1),this.verbose.or=this.notverbose,this.notverbose.or=this.verbose,this.options.grunt){var o=["write","writeln","writetableln","writelns","writeflags","warn","error","ok","errorlns","oklns","success","fail","header","subhead","debug"];_.bindAll(this,o),_.bindAll(this.verbose,o),_.bindAll(this.notverbose,o)}}function VerboseLog(t,o){this.always=t,this._isVerbose=o}function makeSmartAccessor(t,o){Object.defineProperty(Log.prototype,t,{enumerable:!0,configurable:!0,get:function(){return o?this.always._options[t]:this.always["_"+t]},set:function(r){o?this.always._options[t]=r:this.always["_"+t]=r}})}exports.Log=Log,util.inherits(VerboseLog,Log),VerboseLog.prototype._write=function(){if(Boolean(this.option("verbose"))===this._isVerbose)return VerboseLog.super_.prototype._write.apply(this,arguments)},makeSmartAccessor("options"),makeSmartAccessor("hasLogged"),makeSmartAccessor("muted",!0),Log.prototype.initColors=function(){this.option("no-color")&&(colors.mode="none",hooker.hook(console,"log",(function(){var t=_.toArray(arguments);return hooker.filter(this,t.map((function(t){return"string"==typeof t?colors.stripColors(t):t})))})))},Log.prototype.option=function(t){if(this.options.grunt&&this.options.grunt.option)return this.options.grunt.option(t);var o=t.match(/^no-(.+)$/);return o?!this.options[o[1]]:this.options[t]},Log.prototype._markup=function(t){return t=(t=(t=t||"").replace(/(\s|^)_(\S|\S[\s\S]+?\S)_(?=[\s,.!?]|$)/g,"$1"+"$2".underline)).replace(/(\s|^)\*(\S|\S[\s\S]+?\S)\*(?=[\s,.!?]|$)/g,"$1"+"$2".bold)},Log.prototype._format=function(t){return(t=_.toArray(t)).length>0&&(t[0]=String(t[0])),util.format.apply(util,t)},Log.prototype._write=function(t){this.muted||(this.hasLogged=!0,t=t||"",this.option("no-color")&&(t=colors.stripColors(t)),this.options.outStream.write(this._markup(t)))},Log.prototype._writeln=function(t){this._write((t||"")+"\n")},Log.prototype.write=function(){return this._write(this._format(arguments)),this},Log.prototype.writeln=function(){return this._writeln(this._format(arguments)),this},Log.prototype.warn=function(){var t=this._format(arguments);return arguments.length>0?this._writeln(">> ".red+_.trim(t).replace(/\n/g,"\n>> ".red)):this._writeln("ERROR".red),this},Log.prototype.error=function(){return this.options.grunt&&this.options.grunt.fail&&this.options.grunt.fail.errorcount++,this.warn.apply(this,arguments),this},Log.prototype.ok=function(){var t=this._format(arguments);return arguments.length>0?this._writeln(">> ".green+_.trim(t).replace(/\n/g,"\n>> ".green)):this._writeln("OK".green),this},Log.prototype.errorlns=function(){var t=this._format(arguments);return this.error(this.wraptext(this.options.maxCols||77,t)),this},Log.prototype.oklns=function(){var t=this._format(arguments);return this.ok(this.wraptext(this.options.maxCols||77,t)),this},Log.prototype.success=function(){var t=this._format(arguments);return this._writeln(t.green),this},Log.prototype.fail=function(){var t=this._format(arguments);return this._writeln(t.red),this},Log.prototype.header=function(){var t=this._format(arguments);return this.hasLogged&&this._writeln(),this._writeln(t.underline),this},Log.prototype.subhead=function(){var t=this._format(arguments);return this.hasLogged&&this._writeln(),this._writeln(t.bold),this},Log.prototype.debug=function(){var t=this._format(arguments);return this.option("debug")&&this._writeln("[D] "+t.magenta),this},Log.prototype.writetableln=function(t,o){return this._writeln(this.table(t,o)),this},Log.prototype.writelns=function(){var t=this._format(arguments);return this._writeln(this.wraptext(this.options.maxCols||80,t)),this},Log.prototype.writeflags=function(t,o){var r;return Array.isArray(t)?r=this.wordlist(t):"object"==typeof t&&t&&(r=this.wordlist(Object.keys(t).map((function(o){var r=t[o];return o+(!0===r?"":"="+JSON.stringify(r))})))),this._writeln((o||"Flags")+": "+(r||"(none)".cyan)),this},["wordlist","uncolor","wraptext","table"].forEach((function(t){Log.prototype[t]=exports[t]=logUtils[t]}));
//# sourceMappingURL=/sm/6f6a2601cc95424e83e5f49e4af235c6ad1b5d790aca74b3d949b06400351597.map