'use strict';Object.defineProperty(exports,Symbol.toStringTag,{value:'Module'});const base=require('../../../_virtual/base2.cjs'),createFile=require('../create-file.cjs');var hasRequiredBase; function requireBase () { if (hasRequiredBase) return base.__exports; hasRequiredBase = 1; (function (exports) { Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "BaseWriteStrategy", { enumerable: true, get: function() { return BaseWriteStrategy; } }); const _createfile = /*@__PURE__*/ createFile.__require(); class BaseWriteStrategy { outputDir; /** * Sometimes a ruleset will create extra files (e.g. reject-url-regex w/ mitm.sgmodule), * and doesn't share the same filename and id. This property is used to overwrite the filename. */ overwriteFilename; withFilename(filename) { this.overwriteFilename = filename; return this; } constructor(outputDir){ this.outputDir = outputDir; this.overwriteFilename = null; } static domainWildCardToRegex = (domain)=>{ let result = '^'; for(let i = 0, len = domain.length; i < len; i++){ switch(domain[i]){ case '.': result += String.raw`\.`; break; case '*': result += String.raw`[\w.-]*?`; break; case '?': result += String.raw`[\w.-]`; break; default: result += domain[i]; } } result += '$'; return result; }; output(span, title, description, date, filePath) { if (!this.result) { return; } return (0, _createfile.compareAndWriteFile)(span, this.withPadding(title, description, date, this.result), filePath); } get content() { return this.result; } } } (base.__exports)); return base.__exports; }exports.__require=requireBase;