UNPKG

@neocomplexx/ngx-neo-modal-mat

Version:
996 lines 58.4 kB
(function (global, factory) {
    typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/material/dialog'), require('@angular/common'), require('@angular/forms'), require('@angular/material/form-field'), require('@angular/material/input'), require('@angular/material/button'), require('@ngx-translate/core')) :
    typeof define === 'function' && define.amd ? define('@neocomplexx/ngx-neo-modal-mat', ['exports', '@angular/core', '@angular/material/dialog', '@angular/common', '@angular/forms', '@angular/material/form-field', '@angular/material/input', '@angular/material/button', '@ngx-translate/core'], factory) :
    (global = global || self, factory((global.neocomplexx = global.neocomplexx || {}, global.neocomplexx['ngx-neo-modal-mat'] = {}), global.ng.core, global.ng.material.dialog, global.ng.common, global.ng.forms, global.ng.material.formField, global.ng.material.input, global.ng.material.button, global.core$1));
}(this, (function (exports, core, dialog, common, forms, formField, input, button, core$1) { 'use strict';

    /*! *****************************************************************************
    Copyright (c) Microsoft Corporation.

    Permission to use, copy, modify, and/or distribute this software for any
    purpose with or without fee is hereby granted.

    THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
    REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
    AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
    INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
    LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
    OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
    PERFORMANCE OF THIS SOFTWARE.
    ***************************************************************************** */
    /* global Reflect, Promise */

    var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };

    function __extends(d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    }

    var __assign = function() {
        __assign = Object.assign || function __assign(t) {
            for (var s, i = 1, n = arguments.length; i < n; i++) {
                s = arguments[i];
                for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
            }
            return t;
        };
        return __assign.apply(this, arguments);
    };

    function __rest(s, e) {
        var t = {};
        for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
            t[p] = s[p];
        if (s != null && typeof Object.getOwnPropertySymbols === "function")
            for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
                if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                    t[p[i]] = s[p[i]];
            }
        return t;
    }

    function __decorate(decorators, target, key, desc) {
        var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
        if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
        else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
        return c > 3 && r && Object.defineProperty(target, key, r), r;
    }

    function __param(paramIndex, decorator) {
        return function (target, key) { decorator(target, key, paramIndex); }
    }

    function __metadata(metadataKey, metadataValue) {
        if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
    }

    function __awaiter(thisArg, _arguments, P, generator) {
        function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
        return new (P || (P = Promise))(function (resolve, reject) {
            function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
            function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
            function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
            step((generator = generator.apply(thisArg, _arguments || [])).next());
        });
    }

    function __generator(thisArg, body) {
        var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
        return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
        function verb(n) { return function (v) { return step([n, v]); }; }
        function step(op) {
            if (f) throw new TypeError("Generator is already executing.");
            while (_) try {
                if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
                if (y = 0, t) op = [op[0] & 2, t.value];
                switch (op[0]) {
                    case 0: case 1: t = op; break;
                    case 4: _.label++; return { value: op[1], done: false };
                    case 5: _.label++; y = op[1]; op = [0]; continue;
                    case 7: op = _.ops.pop(); _.trys.pop(); continue;
                    default:
                        if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                        if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                        if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                        if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                        if (t[2]) _.ops.pop();
                        _.trys.pop(); continue;
                }
                op = body.call(thisArg, _);
            } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
            if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
        }
    }

    function __createBinding(o, m, k, k2) {
        if (k2 === undefined) k2 = k;
        o[k2] = m[k];
    }

    function __exportStar(m, exports) {
        for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p];
    }

    function __values(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
            next: function () {
                if (o && i >= o.length) o = void 0;
                return { value: o && o[i++], done: !o };
            }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
    }

    function __read(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i = m.call(o), r, ar = [], e;
        try {
            while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
        }
        catch (error) { e = { error: error }; }
        finally {
            try {
                if (r && !r.done && (m = i["return"])) m.call(i);
            }
            finally { if (e) throw e.error; }
        }
        return ar;
    }

    function __spread() {
        for (var ar = [], i = 0; i < arguments.length; i++)
            ar = ar.concat(__read(arguments[i]));
        return ar;
    }

    function __spreadArrays() {
        for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
        for (var r = Array(s), k = 0, i = 0; i < il; i++)
            for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
                r[k] = a[j];
        return r;
    };

    function __await(v) {
        return this instanceof __await ? (this.v = v, this) : new __await(v);
    }

    function __asyncGenerator(thisArg, _arguments, generator) {
        if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
        var g = generator.apply(thisArg, _arguments || []), i, q = [];
        return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
        function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
        function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
        function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
        function fulfill(value) { resume("next", value); }
        function reject(value) { resume("throw", value); }
        function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
    }

    function __asyncDelegator(o) {
        var i, p;
        return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
        function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
    }

    function __asyncValues(o) {
        if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
        var m = o[Symbol.asyncIterator], i;
        return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
        function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
        function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
    }

    function __makeTemplateObject(cooked, raw) {
        if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
        return cooked;
    };

    function __importStar(mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
        result.default = mod;
        return result;
    }

    function __importDefault(mod) {
        return (mod && mod.__esModule) ? mod : { default: mod };
    }

    function __classPrivateFieldGet(receiver, privateMap) {
        if (!privateMap.has(receiver)) {
            throw new TypeError("attempted to get private field on non-instance");
        }
        return privateMap.get(receiver);
    }

    function __classPrivateFieldSet(receiver, privateMap, value) {
        if (!privateMap.has(receiver)) {
            throw new TypeError("attempted to set private field on non-instance");
        }
        privateMap.set(receiver, value);
        return value;
    }

    var _c0 = ["buttons"];
    var _c1 = ["myInput"];
    function NgxNeoModalMatComponent_div_2_Template(rf, ctx) { if (rf & 1) {
        core.ɵɵelementStart(0, "div", 16);
        core.ɵɵelement(1, "div", 17);
        core.ɵɵelement(2, "span", 18);
        core.ɵɵelement(3, "span", 19);
        core.ɵɵelement(4, "div", 20);
        core.ɵɵelement(5, "div", 21);
        core.ɵɵelement(6, "div", 22);
        core.ɵɵelementEnd();
    } }
    function NgxNeoModalMatComponent_div_3_Template(rf, ctx) { if (rf & 1) {
        core.ɵɵelementStart(0, "div", 23);
        core.ɵɵelementStart(1, "span", 24);
        core.ɵɵelement(2, "span", 25);
        core.ɵɵelement(3, "span", 26);
        core.ɵɵelementEnd();
        core.ɵɵelementEnd();
    } }
    function NgxNeoModalMatComponent_div_4_Template(rf, ctx) { if (rf & 1) {
        core.ɵɵelementStart(0, "div", 27);
        core.ɵɵtext(1, "!");
        core.ɵɵelementEnd();
    } }
    function NgxNeoModalMatComponent_div_5_Template(rf, ctx) { if (rf & 1) {
        core.ɵɵelementStart(0, "div", 28);
        core.ɵɵtext(1, "i");
        core.ɵɵelementEnd();
    } }
    function NgxNeoModalMatComponent_div_6_Template(rf, ctx) { if (rf & 1) {
        core.ɵɵelementStart(0, "div", 29);
        core.ɵɵtext(1, "?");
        core.ɵɵelementEnd();
    } }
    function NgxNeoModalMatComponent_h4_7_Template(rf, ctx) { if (rf & 1) {
        core.ɵɵelementStart(0, "h4");
        core.ɵɵtext(1);
        core.ɵɵelementEnd();
    } if (rf & 2) {
        var ctx_r5 = core.ɵɵnextContext();
        core.ɵɵadvance(1);
        core.ɵɵtextInterpolate(ctx_r5.config.title.text);
    } }
    function NgxNeoModalMatComponent_form_10_Template(rf, ctx) { if (rf & 1) {
        var _r15 = core.ɵɵgetCurrentView();
        core.ɵɵelementStart(0, "form", 30);
        core.ɵɵelementStart(1, "mat-form-field", 30);
        core.ɵɵelementStart(2, "input", 31, 32);
        core.ɵɵlistener("ngModelChange", function NgxNeoModalMatComponent_form_10_Template_input_ngModelChange_2_listener($event) { core.ɵɵrestoreView(_r15); var ctx_r14 = core.ɵɵnextContext(); return ctx_r14.config.input.value = $event; })("keyup.enter", function NgxNeoModalMatComponent_form_10_Template_input_keyup_enter_2_listener() { core.ɵɵrestoreView(_r15); var ctx_r16 = core.ɵɵnextContext(); return ctx_r16.setFocus(); });
        core.ɵɵelementEnd();
        core.ɵɵelementEnd();
        core.ɵɵelementEnd();
    } if (rf & 2) {
        var ctx_r6 = core.ɵɵnextContext();
        core.ɵɵadvance(2);
        core.ɵɵpropertyInterpolate("placeholder", ctx_r6.config.input.placeholder);
        core.ɵɵproperty("ngModel", ctx_r6.config.input.value);
    } }
    function NgxNeoModalMatComponent_button_13_Template(rf, ctx) { if (rf & 1) {
        var _r18 = core.ɵɵgetCurrentView();
        core.ɵɵelementStart(0, "button", 33);
        core.ɵɵlistener("click", function NgxNeoModalMatComponent_button_13_Template_button_click_0_listener() { core.ɵɵrestoreView(_r18); var ctx_r17 = core.ɵɵnextContext(); return ctx_r17.informResult("Accept"); });
        core.ɵɵtext(1);
        core.ɵɵpipe(2, "translate");
        core.ɵɵelementEnd();
    } if (rf & 2) {
        core.ɵɵadvance(1);
        core.ɵɵtextInterpolate(core.ɵɵpipeBind1(2, 1, "BTNACCEPT"));
    } }
    function NgxNeoModalMatComponent_button_14_Template(rf, ctx) { if (rf & 1) {
        var _r20 = core.ɵɵgetCurrentView();
        core.ɵɵelementStart(0, "button", 34);
        core.ɵɵlistener("click", function NgxNeoModalMatComponent_button_14_Template_button_click_0_listener() { core.ɵɵrestoreView(_r20); var ctx_r19 = core.ɵɵnextContext(); return ctx_r19.informResult("Cancel"); });
        core.ɵɵtext(1);
        core.ɵɵpipe(2, "translate");
        core.ɵɵelementEnd();
    } if (rf & 2) {
        core.ɵɵadvance(1);
        core.ɵɵtextInterpolate(core.ɵɵpipeBind1(2, 1, "BTNCANCEL"));
    } }
    function NgxNeoModalMatComponent_button_15_Template(rf, ctx) { if (rf & 1) {
        var _r22 = core.ɵɵgetCurrentView();
        core.ɵɵelementStart(0, "button", 35);
        core.ɵɵlistener("click", function NgxNeoModalMatComponent_button_15_Template_button_click_0_listener() { core.ɵɵrestoreView(_r22); var ctx_r21 = core.ɵɵnextContext(); return ctx_r21.informResult("Yes"); });
        core.ɵɵtext(1);
        core.ɵɵpipe(2, "translate");
        core.ɵɵelementEnd();
    } if (rf & 2) {
        core.ɵɵadvance(1);
        core.ɵɵtextInterpolate(core.ɵɵpipeBind1(2, 1, "BTNYES"));
    } }
    function NgxNeoModalMatComponent_button_16_Template(rf, ctx) { if (rf & 1) {
        var _r24 = core.ɵɵgetCurrentView();
        core.ɵɵelementStart(0, "button", 36);
        core.ɵɵlistener("click", function NgxNeoModalMatComponent_button_16_Template_button_click_0_listener() { core.ɵɵrestoreView(_r24); var ctx_r23 = core.ɵɵnextContext(); return ctx_r23.informResult("Retry"); });
        core.ɵɵtext(1);
        core.ɵɵpipe(2, "translate");
        core.ɵɵelementEnd();
    } if (rf & 2) {
        core.ɵɵadvance(1);
        core.ɵɵtextInterpolate(core.ɵɵpipeBind1(2, 1, "BTNRETR"));
    } }
    function NgxNeoModalMatComponent_button_17_Template(rf, ctx) { if (rf & 1) {
        var _r26 = core.ɵɵgetCurrentView();
        core.ɵɵelementStart(0, "button", 37);
        core.ɵɵlistener("click", function NgxNeoModalMatComponent_button_17_Template_button_click_0_listener() { core.ɵɵrestoreView(_r26); var ctx_r25 = core.ɵɵnextContext(); return ctx_r25.informResult("No"); });
        core.ɵɵtext(1);
        core.ɵɵpipe(2, "translate");
        core.ɵɵelementEnd();
    } if (rf & 2) {
        core.ɵɵadvance(1);
        core.ɵɵtextInterpolate(core.ɵɵpipeBind1(2, 1, "BTNO"));
    } }
    var NgxNeoModalMatComponent = /** @class */ (function () {
        function NgxNeoModalMatComponent(data, activeModal) {
            this.data = data;
            this.activeModal = activeModal;
            this.config = {
                title: {
                    visibility: true,
                    text: 'This is a title'
                },
                message: 'This is a message',
                type: null,
                input: {
                    visibility: false,
                    placeholder: 'Ingrese su texto aquí',
                    value: null,
                    autofocus: false,
                    id: 'neoInput'
                },
                button: {
                    yes: {
                        visibility: false,
                        autofocus: false,
                        text: 'Si',
                        id: 'neoBtnYes'
                    },
                    no: {
                        visibility: false,
                        autofocus: false,
                        text: 'No',
                        id: 'neoBtnNo'
                    },
                    retry: {
                        visibility: false,
                        autofocus: false,
                        text: 'Reintentar',
                        id: 'neoBtnRetry'
                    },
                    cancel: {
                        visibility: true,
                        autofocus: false,
                        text: 'Cancelar',
                        id: 'neoBtnCancel'
                    },
                    accept: {
                        visibility: true,
                        autofocus: true,
                        text: 'Aceptar',
                        id: 'neoBtnAccept'
                    },
                }
            };
            this.mergeDeep(this.config, data.config);
        }
        NgxNeoModalMatComponent.prototype.ngOnInit = function () {
        };
        NgxNeoModalMatComponent.prototype.isObject = function (item) {
            return (item && typeof item === 'object' && !Array.isArray(item));
        };
        NgxNeoModalMatComponent.prototype.mergeDeep = function (target) {
            var _a, _b;
            var sources = [];
            for (var _i = 1; _i < arguments.length; _i++) {
                sources[_i - 1] = arguments[_i];
            }
            if (!sources.length) {
                return target;
            }
            var source = sources.shift();
            if (this.isObject(target) && this.isObject(source)) {
                for (var key in source) {
                    if (this.isObject(source[key])) {
                        if (!target[key]) {
                            Object.assign(target, (_a = {}, _a[key] = {}, _a));
                        }
                        this.mergeDeep(target[key], source[key]);
                    }
                    else {
                        Object.assign(target, (_b = {}, _b[key] = source[key], _b));
                    }
                }
            }
            return this.mergeDeep.apply(this, __spread([target], sources));
        };
        NgxNeoModalMatComponent.prototype.activeFocus = function (inputModal) {
            if (inputModal === void 0) { inputModal = true; }
            var foc = this.getButtonFocus();
            var inputFocus = this.getInputFocus();
            // Find element in DOM and focus.
            if (inputFocus && inputModal && (!foc || foc === 'neoBtnAccept')) {
                this.input.nativeElement.focus();
            }
            else if (foc) {
                var button = this.btn.nativeElement.children.namedItem(foc);
                if (button) {
                    button.focus();
                }
            }
        };
        NgxNeoModalMatComponent.prototype.getButtonFocus = function () {
            var _this = this;
            var button = Object.keys(this.config.button)
                .find(function (key) { return _this.config.button[key].visibility && _this.config.button[key].autofocus; });
            if (button) {
                return this.config.button[button].id;
            }
            else {
                return null;
            }
        };
        NgxNeoModalMatComponent.prototype.getInputFocus = function () {
            if (this.config.input.visibility && this.config.input.autofocus) {
                return this.config.input.id;
            }
            else {
                return null;
            }
        };
        NgxNeoModalMatComponent.prototype.ngAfterViewInit = function () {
            var _this = this;
            setTimeout(function () { return _this.activeFocus(); }, 0);
        };
        NgxNeoModalMatComponent.prototype.informResult = function (res) {
            var button = exports.AlertButton[res];
            var respuesta = new AlertResult(button, this.config.input.value);
            this.activeModal.close(respuesta);
        };
        NgxNeoModalMatComponent.prototype.setFocus = function () {
            this.activeFocus(false);
        };
        /** @nocollapse */ NgxNeoModalMatComponent.ɵfac = function NgxNeoModalMatComponent_Factory(t) { return new (t || NgxNeoModalMatComponent)(core.ɵɵdirectiveInject(dialog.MAT_DIALOG_DATA), core.ɵɵdirectiveInject(dialog.MatDialogRef)); };
        /** @nocollapse */ NgxNeoModalMatComponent.ɵcmp = core.ɵɵdefineComponent({ type: NgxNeoModalMatComponent, selectors: [["lib-ngx-neo-modal-mat"]], viewQuery: function NgxNeoModalMatComponent_Query(rf, ctx) { if (rf & 1) {
                core.ɵɵstaticViewQuery(_c0, true);
                core.ɵɵviewQuery(_c1, true);
            } if (rf & 2) {
                var _t;
                core.ɵɵqueryRefresh(_t = core.ɵɵloadQuery()) && (ctx.btn = _t.first);
                core.ɵɵqueryRefresh(_t = core.ɵɵloadQuery()) && (ctx.input = _t.first);
            } }, decls: 18, vars: 13, consts: [["mat-dialog-content", "", 1, "text-center", "mat-modal"], [1, "icons"], ["class", "swal2-icon swal2-success swal2-animate-success-icon", 4, "ngIf"], ["class", "swal2-icon swal2-error swal2-animate-error-icon", 4, "ngIf"], ["class", "swal2-icon swal2-warning", 4, "ngIf"], ["class", "swal2-icon swal2-info", 4, "ngIf"], ["class", "swal2-icon swal2-question", 4, "ngIf"], [4, "ngIf"], ["class", "full-width", 4, "ngIf"], ["align", "end"], ["buttons", ""], ["mat-raised-button", "", "color", "primary", "id", "neoBtnAccept", "type", "button", 3, "click", 4, "ngIf"], ["mat-raised-button", "", "color", "primary", "id", "neoBtnCancel", "type", "button", 3, "click", 4, "ngIf"], ["mat-raised-button", "", "color", "primary", "id", "neoBtnYes", "type", "button", 3, "click", 4, "ngIf"], ["mat-raised-button", "", "color", "primary", "id", "neoBtnRetry", "type", "button", 3, "click", 4, "ngIf"], ["mat-raised-button", "", "color", "primary", "id", "neoBtnNo", "type", "button", 3, "click", 4, "ngIf"], [1, "swal2-icon", "swal2-success", "swal2-animate-success-icon"], [1, "swal2-success-circular-line-left"], [1, "swal2-success-line-tip", "swal2-animate-success-line-tip"], [1, "swal2-success-line-long", "swal2-animate-success-line-long"], [1, "swal2-success-ring"], [1, "swal2-success-fix"], [1, "swal2-success-circular-line-right"], [1, "swal2-icon", "swal2-error", "swal2-animate-error-icon"], [1, "swal2-x-mark", "swal2-animate-x-mark"], [1, "swal2-x-mark-line-left"], [1, "swal2-x-mark-line-right"], [1, "swal2-icon", "swal2-warning"], [1, "swal2-icon", "swal2-info"], [1, "swal2-icon", "swal2-question"], [1, "full-width"], ["name", "inputModal", "matInput", "", "id", "neoInput", "type", "text", 3, "ngModel", "placeholder", "ngModelChange", "keyup.enter"], ["myInput", ""], ["mat-raised-button", "", "color", "primary", "id", "neoBtnAccept", "type", "button", 3, "click"], ["mat-raised-button", "", "color", "primary", "id", "neoBtnCancel", "type", "button", 3, "click"], ["mat-raised-button", "", "color", "primary", "id", "neoBtnYes", "type", "button", 3, "click"], ["mat-raised-button", "", "color", "primary", "id", "neoBtnRetry", "type", "button", 3, "click"], ["mat-raised-button", "", "color", "primary", "id", "neoBtnNo", "type", "button", 3, "click"]], template: function NgxNeoModalMatComponent_Template(rf, ctx) { if (rf & 1) {
                core.ɵɵelementStart(0, "div", 0);
                core.ɵɵelementStart(1, "div", 1);
                core.ɵɵtemplate(2, NgxNeoModalMatComponent_div_2_Template, 7, 0, "div", 2);
                core.ɵɵtemplate(3, NgxNeoModalMatComponent_div_3_Template, 4, 0, "div", 3);
                core.ɵɵtemplate(4, NgxNeoModalMatComponent_div_4_Template, 2, 0, "div", 4);
                core.ɵɵtemplate(5, NgxNeoModalMatComponent_div_5_Template, 2, 0, "div", 5);
                core.ɵɵtemplate(6, NgxNeoModalMatComponent_div_6_Template, 2, 0, "div", 6);
                core.ɵɵelementEnd();
                core.ɵɵtemplate(7, NgxNeoModalMatComponent_h4_7_Template, 2, 1, "h4", 7);
                core.ɵɵelementStart(8, "p");
                core.ɵɵtext(9);
                core.ɵɵelementEnd();
                core.ɵɵtemplate(10, NgxNeoModalMatComponent_form_10_Template, 4, 2, "form", 8);
                core.ɵɵelementEnd();
                core.ɵɵelementStart(11, "mat-dialog-actions", 9, 10);
                core.ɵɵtemplate(13, NgxNeoModalMatComponent_button_13_Template, 3, 3, "button", 11);
                core.ɵɵtemplate(14, NgxNeoModalMatComponent_button_14_Template, 3, 3, "button", 12);
                core.ɵɵtemplate(15, NgxNeoModalMatComponent_button_15_Template, 3, 3, "button", 13);
                core.ɵɵtemplate(16, NgxNeoModalMatComponent_button_16_Template, 3, 3, "button", 14);
                core.ɵɵtemplate(17, NgxNeoModalMatComponent_button_17_Template, 3, 3, "button", 15);
                core.ɵɵelementEnd();
            } if (rf & 2) {
                core.ɵɵadvance(2);
                core.ɵɵproperty("ngIf", ctx.config.type === "success");
                core.ɵɵadvance(1);
                core.ɵɵproperty("ngIf", ctx.config.type === "error");
                core.ɵɵadvance(1);
                core.ɵɵproperty("ngIf", ctx.config.type === "warning");
                core.ɵɵadvance(1);
                core.ɵɵproperty("ngIf", ctx.config.type === "info");
                core.ɵɵadvance(1);
                core.ɵɵproperty("ngIf", ctx.config.type === "question");
                core.ɵɵadvance(1);
                core.ɵɵproperty("ngIf", ctx.config.title.visibility);
                core.ɵɵadvance(2);
                core.ɵɵtextInterpolate(ctx.config.message);
                core.ɵɵadvance(1);
                core.ɵɵproperty("ngIf", ctx.config.input.visibility);
                core.ɵɵadvance(3);
                core.ɵɵproperty("ngIf", ctx.config.button.accept.visibility);
                core.ɵɵadvance(1);
                core.ɵɵproperty("ngIf", ctx.config.button.cancel.visibility);
                core.ɵɵadvance(1);
                core.ɵɵproperty("ngIf", ctx.config.button.yes.visibility);
                core.ɵɵadvance(1);
                core.ɵɵproperty("ngIf", ctx.config.button.retry.visibility);
                core.ɵɵadvance(1);
                core.ɵɵproperty("ngIf", ctx.config.button.no.visibility);
            } }, directives: [dialog.MatDialogContent, common.NgIf, dialog.MatDialogActions, forms.ɵangular_packages_forms_forms_y, forms.NgControlStatusGroup, forms.NgForm, formField.MatFormField, input.MatInput, forms.DefaultValueAccessor, forms.NgControlStatus, forms.NgModel, button.MatButton], pipes: [core$1.TranslatePipe], styles: [".modal-footer[_ngcontent-%COMP%], .modal-header[_ngcontent-%COMP%]{border:0}@-webkit-keyframes showSweetAlert{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@keyframes showSweetAlert{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@-webkit-keyframes hideSweetAlert{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@keyframes hideSweetAlert{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}.swal2-show[_ngcontent-%COMP%]{-webkit-animation:.3s showSweetAlert;animation:.3s showSweetAlert}.swal2-show.swal2-noanimation[_ngcontent-%COMP%]{-webkit-animation:none;animation:none}.swal2-hide[_ngcontent-%COMP%]{-webkit-animation:.15s forwards hideSweetAlert;animation:.15s forwards hideSweetAlert}.swal2-hide.swal2-noanimation[_ngcontent-%COMP%]{-webkit-animation:none;animation:none}@-webkit-keyframes animate-success-tip{0%,54%{width:0;left:1px;top:19px}70%{width:50px;left:-8px;top:37px}84%{width:17px;left:21px;top:48px}100%{width:25px;left:14px;top:45px}}@keyframes animate-success-tip{0%,54%{width:0;left:1px;top:19px}70%{width:50px;left:-8px;top:37px}84%{width:17px;left:21px;top:48px}100%{width:25px;left:14px;top:45px}}@-webkit-keyframes animate-success-long{0%,65%{width:0;right:46px;top:54px}84%{width:55px;right:0;top:35px}100%{width:47px;right:8px;top:38px}}@keyframes animate-success-long{0%,65%{width:0;right:46px;top:54px}84%{width:55px;right:0;top:35px}100%{width:47px;right:8px;top:38px}}@-webkit-keyframes rotatePlaceholder{0%,5%{transform:rotate(-45deg)}100%,12%{transform:rotate(-405deg)}}@keyframes rotatePlaceholder{0%,5%{transform:rotate(-45deg)}100%,12%{transform:rotate(-405deg)}}.swal2-animate-success-line-tip[_ngcontent-%COMP%]{-webkit-animation:.75s animate-success-tip;animation:.75s animate-success-tip}.swal2-animate-success-line-long[_ngcontent-%COMP%]{-webkit-animation:.75s animate-success-long;animation:.75s animate-success-long}@-webkit-keyframes animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@keyframes animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}.swal2-animate-error-icon[_ngcontent-%COMP%]{-webkit-animation:.5s animate-error-icon;animation:.5s animate-error-icon}@-webkit-keyframes animate-x-mark{0%,50%{transform:scale(.4);margin-top:26px;opacity:0}80%{transform:scale(1.15);margin-top:-6px}100%{transform:scale(1);margin-top:0;opacity:1}}@keyframes animate-x-mark{0%,50%{transform:scale(.4);margin-top:26px;opacity:0}80%{transform:scale(1.15);margin-top:-6px}100%{transform:scale(1);margin-top:0;opacity:1}}.swal2-animate-x-mark[_ngcontent-%COMP%]{-webkit-animation:.5s animate-x-mark;animation:.5s animate-x-mark}@-webkit-keyframes rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.swal2-success.swal2-animate-success-icon[_ngcontent-%COMP%]   .swal2-success-circular-line-right[_ngcontent-%COMP%]{-webkit-animation:4.25s ease-in rotatePlaceholder;animation:4.25s ease-in rotatePlaceholder}.swal2-icon[_ngcontent-%COMP%]{width:80px;height:80px;border:4px solid transparent;border-radius:50%;margin:20px auto 30px;padding:0;position:relative;box-sizing:content-box;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-icon.swal2-error[_ngcontent-%COMP%]{border-color:#f27474}.swal2-icon.swal2-error[_ngcontent-%COMP%]   .swal2-x-mark[_ngcontent-%COMP%]{position:relative;display:block}.swal2-icon.swal2-error[_ngcontent-%COMP%]   [class^=swal2-x-mark-line][_ngcontent-%COMP%]{position:absolute;height:5px;width:47px;background-color:#f27474;display:block;top:37px;border-radius:2px}.swal2-icon.swal2-error[_ngcontent-%COMP%]   [class^=swal2-x-mark-line][class$=left][_ngcontent-%COMP%]{transform:rotate(45deg);left:17px}.swal2-icon.swal2-error[_ngcontent-%COMP%]   [class^=swal2-x-mark-line][class$=right][_ngcontent-%COMP%]{transform:rotate(-45deg);right:16px}.swal2-icon.swal2-warning[_ngcontent-%COMP%]{font-family:\"Helvetica Neue\",Helvetica,Arial,sans-serif;color:#f8bb86;border-color:#facea8;font-size:60px;line-height:80px;text-align:center}.swal2-icon.swal2-info[_ngcontent-%COMP%]{font-family:\"Open Sans\",sans-serif;color:#3fc3ee;border-color:#9de0f6;font-size:60px;line-height:80px;text-align:center}.swal2-icon.swal2-question[_ngcontent-%COMP%]{font-family:\"Helvetica Neue\",Helvetica,Arial,sans-serif;color:#87adbd;border-color:#c9dae1;font-size:60px;line-height:80px;text-align:center}.swal2-icon.swal2-success[_ngcontent-%COMP%]{border-color:#a5dc86}.swal2-icon.swal2-success[_ngcontent-%COMP%]   [class^=swal2-success-circular-line][_ngcontent-%COMP%]{border-radius:50%;position:absolute;width:60px;height:120px;transform:rotate(45deg)}.swal2-icon.swal2-success[_ngcontent-%COMP%]   [class^=swal2-success-circular-line][class$=left][_ngcontent-%COMP%]{border-radius:120px 0 0 120px;top:-7px;left:-33px;transform:rotate(-45deg);transform-origin:60px 60px}.swal2-icon.swal2-success[_ngcontent-%COMP%]   [class^=swal2-success-circular-line][class$=right][_ngcontent-%COMP%]{border-radius:0 120px 120px 0;top:-11px;left:30px;transform:rotate(-45deg);transform-origin:0 60px}.swal2-icon.swal2-success[_ngcontent-%COMP%]   .swal2-success-ring[_ngcontent-%COMP%]{width:80px;height:80px;border:4px solid rgba(165,220,134,.2);border-radius:50%;box-sizing:content-box;position:absolute;left:-4px;top:-4px;z-index:2}.swal2-icon.swal2-success[_ngcontent-%COMP%]   .swal2-success-fix[_ngcontent-%COMP%]{width:7px;height:90px;position:absolute;left:28px;top:8px;z-index:1;transform:rotate(-45deg)}.swal2-icon.swal2-success[_ngcontent-%COMP%]   [class^=swal2-success-line][_ngcontent-%COMP%]{height:5px;background-color:#a5dc86;display:block;border-radius:2px;position:absolute;z-index:2}.swal2-icon.swal2-success[_ngcontent-%COMP%]   [class^=swal2-success-line][class$=tip][_ngcontent-%COMP%]{width:25px;left:14px;top:46px;transform:rotate(45deg)}.swal2-icon.swal2-success[_ngcontent-%COMP%]   [class^=swal2-success-line][class$=long][_ngcontent-%COMP%]{width:47px;right:8px;top:38px;transform:rotate(-45deg)}.full-width[_ngcontent-%COMP%]{width:100%}.text-center[_ngcontent-%COMP%]{text-align:center}"] });
        return NgxNeoModalMatComponent;
    }());
    /*@__PURE__*/ (function () { core.ɵsetClassMetadata(NgxNeoModalMatComponent, [{
            type: core.Component,
            args: [{
                    selector: 'lib-ngx-neo-modal-mat',
                    templateUrl: './ngx-neo-modal-mat.component.html',
                    styleUrls: ['./ngx-neo-modal-mat.component.scss']
                }]
        }], function () { return [{ type: undefined, decorators: [{
                    type: core.Inject,
                    args: [dialog.MAT_DIALOG_DATA]
                }] }, { type: dialog.MatDialogRef }]; }, { btn: [{
                type: core.ViewChild,
                args: ['buttons', { static: true }]
            }], input: [{
                type: core.ViewChild,
                args: ['myInput', { static: false }]
            }] }); })();
    var AlertResult = /** @class */ (function () {
        function AlertResult(ButtonResponse, messageInput) {
            this.ButtonResponse = ButtonResponse;
            this.messageInput = messageInput;
        }
        return AlertResult;
    }());
    // tslint:disable:no-bitwise

    (function (AlertButton) {
        AlertButton[AlertButton["None"] = 0] = "None";
        AlertButton[AlertButton["Accept"] = 1] = "Accept";
        AlertButton[AlertButton["Cancel"] = 2] = "Cancel";
        AlertButton[AlertButton["Yes"] = 4] = "Yes";
        AlertButton[AlertButton["No"] = 8] = "No";
        AlertButton[AlertButton["Retry"] = 16] = "Retry";
    })(exports.AlertButton || (exports.AlertButton = {}));

    var NgxNeoModalMatService = /** @class */ (function () {
        function NgxNeoModalMatService(dialog, translate) {
            var _this = this;
            this.dialog = dialog;
            this.translate = translate;
            this.originalAlert = window.alert;
            window.alert = function (msg) { return __awaiter(_this, void 0, void 0, function () {
                return __generator(this, function (_a) {
                    switch (_a.label) {
                        case 0: return [4 /*yield*/, this.alert(msg)];
                        case 1:
                            _a.sent();
                            return [2 /*return*/];
                    }
                });
            }); };
        }
        NgxNeoModalMatService.prototype.openModal = function (config) {
            return __awaiter(this, void 0, void 0, function () {
                var dialogRef;
                return __generator(this, function (_a) {
                    dialogRef = this.dialog.open(NgxNeoModalMatComponent, {
                        data: { config: config }
                    });
                    return [2 /*return*/, dialogRef.afterClosed().toPromise()];
                });
            });
        };
        /**
        * Show message. Can be use as window.alert
        */
        NgxNeoModalMatService.prototype.alert = function (msg, autofocus) {
            if (autofocus === void 0) { autofocus = false; }
            return __awaiter(this, void 0, void 0, function () {
                var config;
                return __generator(this, function (_a) {
                    switch (_a.label) {
                        case 0:
                            config = {
                                title: {
                                    visibility: false
                                },
                                message: msg,
                                button: {
                                    cancel: {
                                        visibility: false
                                    },
                                    accept: {
                                        autofocus: autofocus,
                                    }
                                }
                            };
                            return [4 /*yield*/, this.openModal(config)];
                        case 1:
                            _a.sent();
                            return [2 /*return*/];
                    }
                });
            });
        };
        /**
         *
         * Show succsessfull  message
         */
        NgxNeoModalMatService.prototype.success = function (msg, autofocus) {
            if (autofocus === void 0) { autofocus = true; }
            return __awaiter(this, void 0, void 0, function () {
                var title, config;
                return __generator(this, function (_a) {
                    switch (_a.label) {
                        case 0: return [4 /*yield*/, this.translate.get('SUCCESSTITLE').toPromise()];
                        case 1:
                            title = _a.sent();
                            config = {
                                title: {
                                    text: title
                                },
                                message: msg,
                                type: 'success',
                                button: {
                                    cancel: {
                                        visibility: false
                                    },
                                    accept: {
                                        autofocus: autofocus,
                                    }
                                }
                            };
                            return [2 /*return*/, this.openModal(config)];
                    }
                });
            });
        };
        /**
        *
        * Warning message
        */
        NgxNeoModalMatService.prototype.warning = function (msg, autofocus) {
            if (autofocus === void 0) { autofocus = false; }
            return __awaiter(this, void 0, void 0, function () {
                var title, config;
                return __generator(this, function (_a) {
                    switch (_a.label) {
                        case 0: return [4 /*yield*/, this.translate.get('WARNTITLE').toPromise()];
                        case 1:
                            title = _a.sent();
                            config = {
                                title: {
                                    text: title
                                },
                                message: msg,
                                type: 'warning',
                                button: {
                                    cancel: {
                                        visibility: false
                                    },
                                    accept: {
                                        autofocus: autofocus,
                                    }
                                }
                            };
                            return [2 /*return*/, this.openModal(config)];
                    }
                });
            });
        };
        /**
       *
       * Error message
       */
        NgxNeoModalMatService.prototype.error = function (msg, autofocus) {
            if (autofocus === void 0) { autofocus = true; }
            return __awaiter(this, void 0, void 0, function () {
                var title, config;
                return __generator(this, function (_a) {
                    switch (_a.label) {
                        case 0: return [4 /*yield*/, this.translate.get('ERRORTITLE').toPromise()];
                        case 1:
                            title = _a.sent();
                            config = {
                                title: {
                                    text: title
                                },
                                message: msg,
                                type: 'error',
                                button: {
                                    cancel: {
                                        visibility: false
                                    },
                                    accept: {
                                        autofocus: autofocus,
                                    }
                                }
                            };
                            return [2 /*return*/, this.openModal(config)];
                    }
                });
            });
        };
        /**
         *
         * Information message
         */
        NgxNeoModalMatService.prototype.info = function (msg, autofocus) {
            if (autofocus === void 0) { autofocus = true; }
            return __awaiter(this, void 0, void 0, function () {
                var title, config;
                return __generator(this, function (_a) {
                    switch (_a.label) {
                        case 0: return [4 /*yield*/, this.translate.get('INFOTITLE').toPromise()];
                        case 1:
                            title = _a.sent();
                            config = {
                                title: {
                                    text: title
                                },
                                message: msg,
                                type: 'info',
                                button: {
                                    cancel: {
                                        visibility: false
                                    },
                                    accept: {
                                        autofocus: autofocus,
                                    }
                                }
                            };
                            return [2 /*return*/, this.openModal(config)];
                    }
                });
            });
        };
        /**
         *
         * Show decission modal with question and two options for accept or reject.
         */
        // tslint:disable-next-line:max-line-length
        NgxNeoModalMatService.prototype.decision = function (questionMsg, successMsg, cancelMsg, autofocus) {
            if (autofocus === void 0) { autofocus = exports.AlertButton.Cancel; }
            return __awaiter(this, void 0, void 0, function () {
                var buttonAcceptFocus, buttonCancelFocus, title, config;
                var _this = this;
                return __generator(this, function (_a) {
                    switch (_a.label) {
                        case 0:
                            buttonAcceptFocus = autofocus === exports.AlertButton.Accept;
                            buttonCancelFocus = autofocus === exports.AlertButton.Cancel;
                            return [4 /*yield*/, this.translate.get('DECISIONTITLE').toPromise()];
                        case 1:
                            title = _a.sent();
                            config = {
                                title: {
                                    text: title
                                },
                                message: questionMsg,
                                type: 'question',
                                button: {
                                    cancel: {
                                        autofocus: buttonCancelFocus
                                    },
                                    accept: {
                                        autofocus: buttonAcceptFocus
                                    }
                                }
                            };
                            return [2 /*return*/, this.openModal(config)
                                    .then(function (value) {
                                    if (value.ButtonResponse === exports.AlertButton.Accept) {
                                        if (successMsg && successMsg !== '') {
                                            _this.success(successMsg);
                                        }
                                    }
                                    else {
                                        if (cancelMsg) {
                                            _this.info(cancelMsg);
                                        }
                                    }
                                    return Promise.resolve(value);
                                })];
                    }
                });
            });
        };
        /**
         *
         * Input text message
         */
        // tslint:disable-next-line:max-line-length
        NgxNeoModalMatService.prototype.input = function (title, placeholder, successMsg, autofocus, buttonAutofocus) {
            if (autofocus === void 0) { autofocus = true; }
            if (buttonAutofocus === void 0) { buttonAutofocus = exports.AlertButton.Accept; }
            return __awaiter(this, void 0, void 0, function () {
                var buttonAcceptFocus, buttonCancelFocus, config;
                var _this = this;
                return __generator(this, function (_a) {
                    buttonAcceptFocus = buttonAutofocus === exports.AlertButton.Accept;
                    buttonCancelFocus = buttonAutofocus === exports.AlertButton.Cancel;
                    config = {
                        title: {
                            text: title
                        },
                        message: '',
                        input: {
                            placeholder: placeholder,
                            visibility: true,
                            autofocus: autofocus
                        },
                        button: {
                            accepct: {
                                autofocus: buttonAcceptFocus
                            },
                            cancel: {
                                autofocus: buttonCancelFocus
                            }
                        }
                    };
                    return [2 /*return*/, this.openModal(config)
                            .then(function (value) {
                            if (value.ButtonResponse === exports.AlertButton.Accept) {
                                if (successMsg) {
                                    _this.success(successMsg);
                                }
                            }
                            return Promise.resolve(value);
                        })];
                });
            });
        };
        // tslint:disable:no-bitwise
        NgxNeoModalMatService.prototype.yesNoCancel = function (title, message, buttonFocus) {
            return __awaiter(this, void 0, void 0, function () {
                return __generator(this, function (_a) {
                    return [2 /*return*/, this.custom(title, message, (exports.AlertButton.Yes | exports.AlertButton.No | exports.AlertButton.Cancel), buttonFocus)];
                });
            });
        };
        NgxNeoModalMatService.prototype.custom = function (title, message, buttons, buttonFocus) {
            return __awaiter(this, void 0, void 0, function () {
                var buttonAccept, buttonYes, buttonCancel, buttonNo, buttonRetry, buttonAcceptFocus, buttonYesFocus, buttonCancelFocus, buttonNoFocus, buttonRetryFocus, config;
                return __generator(this, function (_a) {
                    buttonAccept = (buttons & exports.AlertButton.Accept) > 0;
                    buttonYes = (buttons & exports.AlertButton.Yes) > 0;
                    buttonCancel = (buttons & exports.AlertButton.Cancel) > 0;
                    buttonNo = (buttons & exports.AlertButton.No) > 0;
                    buttonRetry = (buttons & exports.AlertButton.Retry) > 0;
                    buttonAcceptFocus = buttonFocus === exports.AlertButton.Accept;
                    buttonYesFocus = buttonFocus === exports.AlertButton.Yes;
                    buttonCancelFocus = buttonFocus === exports.AlertButton.Cancel;
                    buttonNoFocus = buttonFocus === exports.AlertButton.No;
                    buttonRetryFocus = buttonFocus === exports.AlertButton.Retry;
                    config = {
                        title: {
                            text: title
                        },
                        message: message,
                        button: {
                            yes: {
                                visibility: buttonYes,
                                autofocus: buttonYesFocus
                            },
                            no: {
                                visibility: buttonNo,
                                autofocus: buttonNoFocus
                            },
                            retry: {
                                visibility: buttonRetry,
                                autofocus: buttonRetryFocus
                            },
                            cancel: {
                                visibility: buttonCancel,
                                autofocus: buttonCancelFocus
                            },
                            accept: {
                                visibility: buttonAccept,
                                autofocus: buttonAcceptFocus
                            }
                        }
                    };
                    return [2 /*return*/, this.openModal(config)];
                });
            });
        };
        NgxNeoModalMatService.prototype.isObject = function (item) {
            return (item && typeof item === 'object' && !Array.isArray(item));
        };
        // this will lead to infinite recursion on circular references
        NgxNeoModalMatService.prototype.mergeDeep = function (target) {
            var _a, _b;
            var sources = [];
            for (var _i = 1; _i < arguments.length; _i++) {
                sources[_i - 1] = arguments[_i];
            }
            if (!sources.length) {
                return target;
            }
            var source = sources.shift();
            if (this.isObject(target) && this.isObject(source)) {
                for (var key in source) {
                    if (this.isObject(source[key])) {
                        if (!target[key]) {
                            Object.assign(target, (_a = {}, _a[key] = {}, _a));
                        }
                        this.mergeDeep(target[key], source[key]);
                    }
                    else {
                        Object.assign(target, (_b = {}, _b[key] = source[key], _b));
                    }
                }
            }
            return this.mergeDeep.apply(this, __spread([target], sources));
        };
        /** @nocollapse */ NgxNeoModalMatService.ɵfac = function NgxNeoModalMatService_Factory(t) { return new (t || NgxNeoModalMatService)(core.ɵɵinject(dialog.MatDialog), core.ɵɵinject(core$1.TranslateService)); };
        /** @nocollapse */ NgxNeoModalMatService.ɵprov = core.ɵɵdefineInjectable({ token: NgxNeoModalMatService, factory: NgxNeoModalMatService.ɵfac, providedIn: 'root' });
        return NgxNeoModalMatService;
    }());
    /*@__PURE__*/ (function () { core.ɵsetClassMetadata(NgxNeoModalMatService, [{
            type: core.Injectable,
            args: [{
                    providedIn: 'root'
                }]
        }], function () { return [{ type: dialog.MatDialog }, { type: core$1.TranslateService }]; }, null); })();

    var NgxNeoModalMatModule = /** @class */ (function () {
        function NgxNeoModalMatModule() {
        }
        /** @nocollapse */ NgxNeoModalMatModule.ɵmod = core.ɵɵdefineNgModule({ type: NgxNeoModalMatModule });
        /** @nocollapse */ NgxNeoModalMatModule.ɵinj = core.ɵɵdefineInjector({ factory: function NgxNeoModalMatModule_Factory(t) { return new (t || NgxNeoModalMatModule)(); }, providers: [
                { provide: dialog.MAT_DIALOG_DEFAULT_OPTIONS, useValue: { disableClose: true, hasBackdrop: true } }
            ], imports: [[
                    common.CommonModule,
                    dialog.MatDialogModule,
                    button.MatButtonModule,
                    input.MatInputModule,
                    forms.FormsModule,
                    core$1.TranslateModule.forChild({ extend: true })
                ]] });
        return NgxNeoModalMatModule;
    }());
    (function () { (typeof ngJitMode === "undefined" || ngJitMode) && core.ɵɵsetNgModuleScope(NgxNeoModalMatModule, { declarations: [NgxNeoModalMatComponent], imports: [common.CommonModule,
            dialog.MatDialogModule,
            button.MatButtonModule,
            input.MatInputModule,
            forms.FormsModule, core$1.TranslateModule], exports: [NgxNeoModalMatComponent] }); })();
    /*@__PURE__*/ (function () { core.ɵsetClassMetadata(NgxNeoModalMatModule, [{
            type: core.NgModule,
            args: [{
                    declarations: [NgxNeoModalMatComponent],
                    imports: [
                        common.CommonModule,
                        dialog.MatDialogModule,
                        button.MatButtonModule,
                        input.MatInputModule,
                        forms.FormsModule,
                        core$1.TranslateModule.forChild({ extend: true })
                    ],
                    exports: [NgxNeoModalMatComponent],
                    entryComponents: [NgxNeoModalMatComponent],
                    providers: [
                        { provide: dialog.MAT_DIALOG_DEFAULT_OPTIONS, useValue: { disableClose: true, hasBackdrop: true } }
                    ]
                }]
        }], null, null); })();

    exports.AlertResult = AlertResult;
    exports.NgxNeoModalMatComponent = NgxNeoModalMatComponent;
    exports.NgxNeoModalMatModule = NgxNeoModalMatModule;
    exports.NgxNeoModalMatService = NgxNeoModalMatService;

    Object.defineProperty(exports, '__esModule', { value: true });

})));
//# sourceMappingURL=neocomplexx-ngx-neo-modal-mat.umd.js.map