import * as i0 from '@angular/core';
import { SecurityContext, Pipe, NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import * as i1 from '@angular/platform-browser';

class BsBoldPipe {
    constructor(domSanitizer) {
        this.domSanitizer = domSanitizer;
    }
    transform(value, numberOfStars = 2, classList = []) {
        const txt = `\\*{${numberOfStars}}\\b(?<boldtext>[^\\*]+)\\b\\*{${numberOfStars}}`;
        const rgx = new RegExp(txt, "gm");
        const safeValue = this.domSanitizer.sanitize(SecurityContext.HTML, value);
        if (!safeValue) {
            return null;
        }
        const classString = classList.length === 0 ? '' : ` class="${classList.join(' ')}"`;
        const result = safeValue.replace(rgx, `<b${classString}>$<boldtext></b>`);
        const safeResult = this.domSanitizer.bypassSecurityTrustHtml(result);
        return safeResult;
    }
}
BsBoldPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BsBoldPipe, deps: [{ token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
BsBoldPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.0.4", ngImport: i0, type: BsBoldPipe, name: "bsBold" });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BsBoldPipe, decorators: [{
            type: Pipe,
            args: [{
                    name: 'bsBold'
                }]
        }], ctorParameters: function () { return [{ type: i1.DomSanitizer }]; } });

class BsItalicPipe {
    constructor(domSanitizer) {
        this.domSanitizer = domSanitizer;
    }
    transform(value, numberOfStars = 1, classList = []) {
        const txt = `\\*{${numberOfStars}}\\b(?<italictext>[^\\*]+)\\b\\*{${numberOfStars}}`;
        const rgx = new RegExp(txt, "gm");
        const safeValue = this.domSanitizer.sanitize(SecurityContext.HTML, value);
        if (!safeValue) {
            return null;
        }
        const classString = classList.length === 0 ? '' : ` class="${classList.join(' ')}"`;
        const result = safeValue.replace(rgx, `<i${classString}>$<italictext></i>`);
        const safeResult = this.domSanitizer.bypassSecurityTrustHtml(result);
        return safeResult;
    }
}
BsItalicPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BsItalicPipe, deps: [{ token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
BsItalicPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.0.4", ngImport: i0, type: BsItalicPipe, name: "bsItalic" });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BsItalicPipe, decorators: [{
            type: Pipe,
            args: [{
                    name: 'bsItalic'
                }]
        }], ctorParameters: function () { return [{ type: i1.DomSanitizer }]; } });

class BsUnderlinePipe {
    constructor(domSanitizer) {
        this.domSanitizer = domSanitizer;
    }
    transform(value, classList = []) {
        const txt = `\\<ins\\>\\b(?<underlinedtext>.+?)\\b\\<\\/ins\\>`;
        const rgx = new RegExp(txt, "gm");
        const safeValue = this.domSanitizer.sanitize(SecurityContext.HTML, value);
        if (!safeValue) {
            return null;
        }
        const classString = classList.length === 0 ? '' : ` class="${classList.join(' ')}"`;
        const result = safeValue.replace(rgx, `<u${classString}>$<underlinedtext></u>`);
        const safeResult = this.domSanitizer.bypassSecurityTrustHtml(result);
        return safeResult;
    }
}
BsUnderlinePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BsUnderlinePipe, deps: [{ token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
BsUnderlinePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.0.4", ngImport: i0, type: BsUnderlinePipe, name: "bsUnderline" });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BsUnderlinePipe, decorators: [{
            type: Pipe,
            args: [{
                    name: 'bsUnderline'
                }]
        }], ctorParameters: function () { return [{ type: i1.DomSanitizer }]; } });

class BsStrikethroughPipe {
    constructor(domSanitizer) {
        this.domSanitizer = domSanitizer;
    }
    transform(value, numberOfTildes = 2, classList = []) {
        const txt = `\\~{${numberOfTildes}}\\b(?<strikethroughtext>[^\\~]+)\\b\\~{${numberOfTildes}}`;
        const rgx = new RegExp(txt, "gm");
        const safeValue = this.domSanitizer.sanitize(SecurityContext.HTML, value);
        if (!safeValue) {
            return null;
        }
        const classString = classList.length === 0 ? '' : ` class="${classList.join(' ')}"`;
        const result = safeValue.replace(rgx, `<strike${classString}>$<strikethroughtext></strike>`);
        const safeResult = this.domSanitizer.bypassSecurityTrustHtml(result);
        return safeResult;
    }
}
BsStrikethroughPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BsStrikethroughPipe, deps: [{ token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
BsStrikethroughPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.0.4", ngImport: i0, type: BsStrikethroughPipe, name: "bsStrikethrough" });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BsStrikethroughPipe, decorators: [{
            type: Pipe,
            args: [{
                    name: 'bsStrikethrough'
                }]
        }], ctorParameters: function () { return [{ type: i1.DomSanitizer }]; } });

class BsMarkdownModule {
}
BsMarkdownModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BsMarkdownModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
BsMarkdownModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.4", ngImport: i0, type: BsMarkdownModule, declarations: [BsBoldPipe,
        BsItalicPipe,
        BsUnderlinePipe,
        BsStrikethroughPipe], imports: [CommonModule], exports: [BsBoldPipe,
        BsItalicPipe,
        BsUnderlinePipe,
        BsStrikethroughPipe] });
BsMarkdownModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BsMarkdownModule, imports: [CommonModule] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BsMarkdownModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [
                        BsBoldPipe,
                        BsItalicPipe,
                        BsUnderlinePipe,
                        BsStrikethroughPipe,
                    ],
                    imports: [
                        CommonModule
                    ],
                    exports: [
                        BsBoldPipe,
                        BsItalicPipe,
                        BsUnderlinePipe,
                        BsStrikethroughPipe,
                    ]
                }]
        }] });

/**
 * Generated bundle index. Do not edit.
 */

export { BsBoldPipe, BsItalicPipe, BsMarkdownModule, BsStrikethroughPipe, BsUnderlinePipe };
//# sourceMappingURL=mintplayer-ng-bootstrap-markdown.mjs.map
