/**
 * Minified by jsDelivr using Terser v5.37.0.
 * Original file: /npm/ansi-html-community@0.0.8/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
"use strict";module.exports=ansiHTML;var _regANSI=/(?:(?:\u001b\[)|\u009b)(?:(?:[0-9]{1,3})?(?:(?:;[0-9]{0,3})*)?[A-M|f-m])|\u001b[A-M]/,_defColors={reset:["fff","000"],black:"000",red:"ff0000",green:"209805",yellow:"e8bf03",blue:"0000ff",magenta:"ff00ff",cyan:"00ffee",lightgrey:"f0f0f0",darkgrey:"888"},_styles={30:"black",31:"red",32:"green",33:"yellow",34:"blue",35:"magenta",36:"cyan",37:"lightgrey"},_openTags={1:"font-weight:bold",2:"opacity:0.5",3:"<i>",4:"<u>",8:"display:none",9:"<del>"},_closeTags={23:"</i>",24:"</u>",29:"</del>"};function ansiHTML(e){if(!_regANSI.test(e))return e;var r=[],o=e.replace(/\033\[(\d+)m/g,(function(e,o){var s=_openTags[o];if(s)return~r.indexOf(o)?(r.pop(),"</span>"):(r.push(o),"<"===s[0]?s:'<span style="'+s+';">');var n=_closeTags[o];return n?(r.pop(),n):""})),s=r.length;return s>0&&(o+=Array(s+1).join("</span>")),o}function _setTags(e){for(var r in _openTags[0]="font-weight:normal;opacity:1;color:#"+e.reset[0]+";background:#"+e.reset[1],_openTags[7]="color:#"+e.reset[1]+";background:#"+e.reset[0],_openTags[90]="color:#"+e.darkgrey,_styles){var o=e[_styles[r]]||"000";_openTags[r]="color:#"+o,r=parseInt(r),_openTags[(r+10).toString()]="background:#"+o}}[0,21,22,27,28,39,49].forEach((function(e){_closeTags[e]="</span>"})),ansiHTML.setColors=function(e){if("object"!=typeof e)throw new Error("`colors` parameter must be an Object.");var r={};for(var o in _defColors){var s=e.hasOwnProperty(o)?e[o]:null;if(s){if("reset"===o){if("string"==typeof s&&(s=[s]),!Array.isArray(s)||0===s.length||s.some((function(e){return"string"!=typeof e})))throw new Error("The value of `"+o+"` property must be an Array and each item could only be a hex string, e.g.: FF0000");var n=_defColors[o];s[0]||(s[0]=n[0]),1!==s.length&&s[1]||(s=[s[0]]).push(n[1]),s=s.slice(0,2)}else if("string"!=typeof s)throw new Error("The value of `"+o+"` property must be a hex string, e.g.: FF0000");r[o]=s}else r[o]=_defColors[o]}_setTags(r)},ansiHTML.reset=function(){_setTags(_defColors)},ansiHTML.tags={},Object.defineProperty?(Object.defineProperty(ansiHTML.tags,"open",{get:function(){return _openTags}}),Object.defineProperty(ansiHTML.tags,"close",{get:function(){return _closeTags}})):(ansiHTML.tags.open=_openTags,ansiHTML.tags.close=_closeTags),ansiHTML.reset();
//# sourceMappingURL=/sm/d5b6b1f2cdf25643f54d8040f2c18b0522130514ea04df7b2c4598ada5f8d7c0.map