(function (global, factory) {
    typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@wm/components/base'), require('@wm/components/basic'), require('@wm/components/dialogs'), require('@wm/components/input'), require('@wm/core')) :
    typeof define === 'function' && define.amd ? define(['exports', '@angular/core', '@angular/common', '@wm/components/base', '@wm/components/basic', '@wm/components/dialogs', '@wm/components/input', '@wm/core'], factory) :
    (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.wm = global.wm || {}, global.wm.components = global.wm.components || {}, global.wm.components.dialogs = global.wm.components.dialogs || {}, global.wm.components.dialogs.iframedialog = {}), global.ng.core, global.ng.common, global.wm.components.base, global.wm.components.basic, global.wm.components.dialogs, global.wm.components.input, global.wm.core));
})(this, (function (exports, i0, i2, base, i1, i3, i4, core) { 'use strict';

    function _interopNamespaceDefault(e) {
        var n = Object.create(null);
        if (e) {
            Object.keys(e).forEach(function (k) {
                if (k !== 'default') {
                    var d = Object.getOwnPropertyDescriptor(e, k);
                    Object.defineProperty(n, k, d.get ? d : {
                        enumerable: true,
                        get: function () { return e[k]; }
                    });
                }
            });
        }
        n.default = e;
        return Object.freeze(n);
    }

    var i0__namespace = /*#__PURE__*/_interopNamespaceDefault(i0);
    var i2__namespace = /*#__PURE__*/_interopNamespaceDefault(i2);
    var i1__namespace = /*#__PURE__*/_interopNamespaceDefault(i1);
    var i3__namespace = /*#__PURE__*/_interopNamespaceDefault(i3);
    var i4__namespace = /*#__PURE__*/_interopNamespaceDefault(i4);

    const registerProps = () => {
        base.register('wm-iframedialog', new Map([
            ['animation', base.PROP_STRING],
            ['class', base.PROP_STRING],
            ['closable', { value: true, PROP_BOOLEAN: base.PROP_BOOLEAN }],
            ['encodeurl', { value: false, ...base.PROP_BOOLEAN }],
            ['height', { value: '400px', ...base.PROP_STRING }],
            ['iconclass', { value: 'wi wi-globe', PROP_STRING: base.PROP_STRING }],
            ['iconheight', base.PROP_STRING],
            ['iconmargin', base.PROP_STRING],
            ['iconurl', base.PROP_STRING],
            ['iconwidth', base.PROP_STRING],
            ['modal', { value: false, ...base.PROP_BOOLEAN }],
            ['name', base.PROP_STRING],
            ['oktext', { value: 'OK', ...base.PROP_STRING }],
            ['showactions', { value: true, ...base.PROP_BOOLEAN }],
            ['showheader', { value: true, ...base.PROP_BOOLEAN }],
            ['tabindex', { value: 0, ...base.PROP_NUMBER }],
            ['headinglevel', { value: 'h4', ...base.PROP_STRING }],
            ['title', { value: 'External Content', ...base.PROP_STRING }],
            ['url', { value: '//www.wavemaker.com', ...base.PROP_STRING }]
        ]));
    };

    const _c0 = ["dialogTemplate"];
    const _c1 = ["wmIframeDialog", ""];
    function IframeDialogComponent_ng_template_0_div_0_Template(rf, ctx) { if (rf & 1) {
        i0__namespace.ɵɵelement(0, "div", 5);
    } if (rf & 2) {
        const ctx_r0 = i0__namespace.ɵɵnextContext(2);
        i0__namespace.ɵɵproperty("closable", ctx_r0.closable)("iconclass", ctx_r0.iconclass)("iconurl", ctx_r0.iconurl)("iconwidth", ctx_r0.iconwidth)("iconheight", ctx_r0.iconheight)("iconmargin", ctx_r0.iconmargin)("heading", ctx_r0.title)("headinglevel", ctx_r0.headinglevel)("title", ctx_r0.title)("titleid", ctx_r0.titleId);
    } }
    function IframeDialogComponent_ng_template_0_div_3_Template(rf, ctx) { if (rf & 1) {
        const _r2 = i0__namespace.ɵɵgetCurrentView();
        i0__namespace.ɵɵelementStart(0, "div", 6)(1, "button", 7);
        i0__namespace.ɵɵlistener("click", function IframeDialogComponent_ng_template_0_div_3_Template_button_click_1_listener($event) { i0__namespace.ɵɵrestoreView(_r2); const ctx_r0 = i0__namespace.ɵɵnextContext(2); return i0__namespace.ɵɵresetView(ctx_r0.onOk($event)); });
        i0__namespace.ɵɵelementEnd()();
    } if (rf & 2) {
        const ctx_r0 = i0__namespace.ɵɵnextContext(2);
        i0__namespace.ɵɵadvance();
        i0__namespace.ɵɵattribute("aria-label", ctx_r0.oktext);
    } }
    function IframeDialogComponent_ng_template_0_Template(rf, ctx) { if (rf & 1) {
        i0__namespace.ɵɵtemplate(0, IframeDialogComponent_ng_template_0_div_0_Template, 1, 10, "div", 1);
        i0__namespace.ɵɵelementStart(1, "div", 2);
        i0__namespace.ɵɵelement(2, "div", 3);
        i0__namespace.ɵɵelementEnd();
        i0__namespace.ɵɵtemplate(3, IframeDialogComponent_ng_template_0_div_3_Template, 2, 1, "div", 4);
    } if (rf & 2) {
        const ctx_r0 = i0__namespace.ɵɵnextContext();
        i0__namespace.ɵɵproperty("ngIf", ctx_r0.showheader);
        i0__namespace.ɵɵadvance(3);
        i0__namespace.ɵɵproperty("ngIf", ctx_r0.showactions);
    } }
    const DIALOG_CLS = 'app-dialog modal-dialog app-iframe-dialog';
    const WIDGET_INFO = { widgetType: 'wm-iframedialog' };
    class IframeDialogComponent extends i3.BaseDialog {
        static { this.initializeProps = registerProps(); }
        constructor(inj, dialogClass, modal, closable, explicitContext) {
            if (modal === null || modal === undefined) {
                modal = false;
            }
            // setting the backdrop to 'static' will not close the dialog on backdrop click
            const backdrop = core.toBoolean(modal) ? 'static' : true;
            super(inj, WIDGET_INFO, {
                class: `${DIALOG_CLS} ${dialogClass || ''}`,
                backdrop,
                keyboard: !core.toBoolean(modal)
            }, explicitContext);
        }
        getTemplateRef() {
            return this.dialogTemplate;
        }
        /**
         * Click event handler for the ok button
         * invokes on-ok event callback
         * @param {Event} $event
         */
        onOk($event) {
            this.invokeEventCallback('ok', { $event });
        }
        ngOnInit() {
            super.ngOnInit();
            this.register(this.viewParent);
        }
        static { this.ɵfac = function IframeDialogComponent_Factory(t) { return new (t || IframeDialogComponent)(i0__namespace.ɵɵdirectiveInject(i0__namespace.Injector), i0__namespace.ɵɵinjectAttribute('class'), i0__namespace.ɵɵinjectAttribute('modal'), i0__namespace.ɵɵinjectAttribute('closable'), i0__namespace.ɵɵdirectiveInject('EXPLICIT_CONTEXT', 8)); }; }
        static { this.ɵcmp = /*@__PURE__*/ i0__namespace.ɵɵdefineComponent({ type: IframeDialogComponent, selectors: [["div", "wmIframeDialog", ""]], viewQuery: function IframeDialogComponent_Query(rf, ctx) { if (rf & 1) {
                i0__namespace.ɵɵviewQuery(_c0, 7);
            } if (rf & 2) {
                let _t;
                i0__namespace.ɵɵqueryRefresh(_t = i0__namespace.ɵɵloadQuery()) && (ctx.dialogTemplate = _t.first);
            } }, features: [i0__namespace.ɵɵProvidersFeature([
                    base.provideAsWidgetRef(IframeDialogComponent),
                    base.provideAsDialogRef(IframeDialogComponent)
                ]), i0__namespace.ɵɵInheritDefinitionFeature], attrs: _c1, decls: 2, vars: 0, consts: [["dialogTemplate", ""], ["wmDialogHeader", "", 3, "closable", "iconclass", "iconurl", "iconwidth", "iconheight", "iconmargin", "heading", "headinglevel", "title", "titleid", 4, "ngIf"], ["wmDialogBody", ""], ["wmIframe", "", "encodeurl.bind", "encodeurl", "iframesrc.bind", "url", "height.bind", "height", "width.bind", "width", "hint.bind", "hint"], ["wmDialogFooter", "", 4, "ngIf"], ["wmDialogHeader", "", 3, "closable", "iconclass", "iconurl", "iconwidth", "iconheight", "iconmargin", "heading", "headinglevel", "title", "titleid"], ["wmDialogFooter", ""], ["caption.bind", "oktext", "wmButton", "", 1, "btn-primary", "ok-action", 3, "click"]], template: function IframeDialogComponent_Template(rf, ctx) { if (rf & 1) {
                i0__namespace.ɵɵtemplate(0, IframeDialogComponent_ng_template_0_Template, 4, 2, "ng-template", null, 0, i0__namespace.ɵɵtemplateRefExtractor);
            } }, dependencies: [i1__namespace.IframeComponent, i2__namespace.NgIf, i3__namespace.DialogBodyDirective, i3__namespace.DialogFooterDirective, i3__namespace.DialogHeaderComponent, i4__namespace.ButtonComponent], encapsulation: 2 }); }
    }
    (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(IframeDialogComponent, [{
            type: i0.Component,
            args: [{ selector: 'div[wmIframeDialog]', providers: [
                        base.provideAsWidgetRef(IframeDialogComponent),
                        base.provideAsDialogRef(IframeDialogComponent)
                    ], template: "<ng-template #dialogTemplate>\n    <div wmDialogHeader [closable]=\"closable\"\n         [iconclass]=\"iconclass\"\n         [iconurl]=\"iconurl\"\n         [iconwidth]=\"iconwidth\"\n         [iconheight]=\"iconheight\"\n         [iconmargin]=\"iconmargin\"\n         [heading]=\"title\"\n         [headinglevel]=\"headinglevel\"\n         *ngIf=\"showheader\"\n         [title]=\"title\"\n         [titleid]=\"titleId\"\n    ></div>\n    <div wmDialogBody>\n        <div wmIframe encodeurl.bind=\"encodeurl\" iframesrc.bind=\"url\" height.bind=\"height\" width.bind=\"width\" hint.bind=\"hint\"></div>\n    </div>\n    <div wmDialogFooter *ngIf=\"showactions\">\n        <button (click)=\"onOk($event)\" [attr.aria-label]=\"oktext\" caption.bind=\"oktext\" class=\"btn-primary ok-action\"\n                wmButton></button>\n    </div>\n</ng-template>\n" }]
        }], () => [{ type: i0__namespace.Injector }, { type: undefined, decorators: [{
                    type: i0.Attribute,
                    args: ['class']
                }] }, { type: undefined, decorators: [{
                    type: i0.Attribute,
                    args: ['modal']
                }] }, { type: undefined, decorators: [{
                    type: i0.Attribute,
                    args: ['closable']
                }] }, { type: undefined, decorators: [{
                    type: i0.Inject,
                    args: ['EXPLICIT_CONTEXT']
                }, {
                    type: i0.Optional
                }] }], { dialogTemplate: [{
                type: i0.ViewChild,
                args: ['dialogTemplate', { static: true }]
            }] }); })();
    (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassDebugInfo(IframeDialogComponent, { className: "IframeDialogComponent", filePath: "iframe-dialog.component.ts", lineNumber: 30 }); })();

    const components = [
        IframeDialogComponent
    ];
    class IframeDialogModule {
        static { this.ɵfac = function IframeDialogModule_Factory(t) { return new (t || IframeDialogModule)(); }; }
        static { this.ɵmod = /*@__PURE__*/ i0__namespace.ɵɵdefineNgModule({ type: IframeDialogModule }); }
        static { this.ɵinj = /*@__PURE__*/ i0__namespace.ɵɵdefineInjector({ imports: [i1.BasicModule,
                i2.CommonModule,
                i3.DialogModule,
                i4.InputModule,
                base.WmComponentsModule] }); }
    }
    (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(IframeDialogModule, [{
            type: i0.NgModule,
            args: [{
                    imports: [
                        i1.BasicModule,
                        i2.CommonModule,
                        i3.DialogModule,
                        i4.InputModule,
                        base.WmComponentsModule
                    ],
                    declarations: [...components],
                    exports: [...components]
                }]
        }], null, null); })();
    (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0__namespace.ɵɵsetNgModuleScope(IframeDialogModule, { declarations: [IframeDialogComponent], imports: [i1.BasicModule,
            i2.CommonModule,
            i3.DialogModule,
            i4.InputModule,
            base.WmComponentsModule], exports: [IframeDialogComponent] }); })();

    exports.IframeDialogComponent = IframeDialogComponent;
    exports.IframeDialogModule = IframeDialogModule;

}));
