var _a;
import { __decorate, __extends } from "tslib";
// tslint:disable-next-line: import-blacklist
import moment from 'moment';
import Vue from 'vue';
import Component from 'vue-class-component';
import { Prop } from 'vue-property-decorator';
import { i18nFilter } from '../../../filters/i18n/i18n';
import { ModulVue } from '../../../utils/vue/vue';
import { MAccordion } from '../../accordion/accordion';
import { ACCORDION_NAME, ERROR_TECHNICAL_DIFFICULTY_NAME, I18N_NAME, LINK_NAME, MESSAGE_PAGE_NAME, PANEL_NAME } from '../../component-names';
import { MI18n } from '../../i18n/i18n';
import { MLink } from '../../link/link';
import { Link, MMessagePage } from '../../message-page/message-page';
import { MMessageState } from '../../message/message';
import { MPanel } from '../../panel/panel';
import WithRender from './error-technical-difficulty.html?style=./error-technical-difficulty.scss';
var MErrorTechnicalDifficulty = /** @class */ (function (_super) {
    __extends(MErrorTechnicalDifficulty, _super);
    function MErrorTechnicalDifficulty() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.state = MMessageState.Error;
        _this.svgName = 'message-error-technical-difficulty';
        return _this;
    }
    MErrorTechnicalDifficulty.prototype.beforeCreate = function () {
        this.$svgSprite.addSvg('message-error-technical-difficulty', require('./message-error-technical-difficulty.svg'));
    };
    Object.defineProperty(MErrorTechnicalDifficulty.prototype, "formattedDate", {
        /**
         * Returns the formatted date for the value received as props (format = YYYY-MM-DD). Used to display the date when the error was generated.
         */
        get: function () {
            return this.errorDate.format('YYYY-MM-DD');
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(MErrorTechnicalDifficulty.prototype, "formattedTime", {
        /**
         * Returns the formatted time for the value received as props (format = HH:mm:ss). Used to display the time when the error was generated.
         */
        get: function () {
            return this.errorDate.format('HH:mm:ss');
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(MErrorTechnicalDifficulty.prototype, "propStacktrace", {
        /**
         * Defines if the stack trace is to be displayed based on the showStrackTrace prop and the presence of the attribute stack in the error.
         */
        get: function () {
            return this.showStackTrace && !!this.error;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(MErrorTechnicalDifficulty.prototype, "userAgent", {
        /**
         * Returns the current userAgent string.
         */
        get: function () {
            return window.navigator.userAgent;
        },
        enumerable: false,
        configurable: true
    });
    __decorate([
        Prop({
            default: function () { return (Vue.prototype).$i18n.translate('m-error-technical-difficulty:title'); }
        })
    ], MErrorTechnicalDifficulty.prototype, "title", void 0);
    __decorate([
        Prop({
            default: function () { return [
                new Link((Vue.prototype).$i18n.translate('m-error-technical-difficulty:home-label'), '\\')
            ]; }
        })
    ], MErrorTechnicalDifficulty.prototype, "links", void 0);
    __decorate([
        Prop({
            default: function () { return [
                (Vue.prototype).$i18n.translate('m-error-technical-difficulty:hint.primary'),
                (Vue.prototype).$i18n.translate('m-error-technical-difficulty:hint.secondary')
            ]; }
        })
    ], MErrorTechnicalDifficulty.prototype, "hints", void 0);
    __decorate([
        Prop({
            default: function () { return moment(); }
        })
    ], MErrorTechnicalDifficulty.prototype, "errorDate", void 0);
    __decorate([
        Prop()
    ], MErrorTechnicalDifficulty.prototype, "errorReferenceNumber", void 0);
    __decorate([
        Prop({
            default: false
        })
    ], MErrorTechnicalDifficulty.prototype, "showStackTrace", void 0);
    __decorate([
        Prop()
    ], MErrorTechnicalDifficulty.prototype, "error", void 0);
    __decorate([
        Prop()
    ], MErrorTechnicalDifficulty.prototype, "system", void 0);
    __decorate([
        Prop({
            default: false
        })
    ], MErrorTechnicalDifficulty.prototype, "openAccordion", void 0);
    MErrorTechnicalDifficulty = __decorate([
        WithRender,
        Component({
            components: (_a = {},
                _a[MESSAGE_PAGE_NAME] = MMessagePage,
                _a[I18N_NAME] = MI18n,
                _a[LINK_NAME] = MLink,
                _a[ACCORDION_NAME] = MAccordion,
                _a[PANEL_NAME] = MPanel,
                _a),
            filters: {
                'f-m-i18n': i18nFilter
            }
        })
    ], MErrorTechnicalDifficulty);
    return MErrorTechnicalDifficulty;
}(ModulVue));
export { MErrorTechnicalDifficulty };
var ErrorTechnicalDifficultyPlugin = {
    install: function (v, options) {
        v.component(ERROR_TECHNICAL_DIFFICULTY_NAME, MErrorTechnicalDifficulty);
    }
};
export default ErrorTechnicalDifficultyPlugin;
//# sourceMappingURL=error-technical-difficulty.js.map