(function (global, factory) {
    typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('ngx-bootstrap/dropdown'), require('@wm/components/base'), require('@wm/components/basic'), require('@wm/components/navigation/menu'), require('@wm/core')) :
    typeof define === 'function' && define.amd ? define(['exports', '@angular/core', '@angular/common', 'ngx-bootstrap/dropdown', '@wm/components/base', '@wm/components/basic', '@wm/components/navigation/menu', '@wm/core'], factory) :
    (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.wm = global.wm || {}, global.wm.components = global.wm.components || {}, global.wm.components.data = global.wm.components.data || {}, global.wm.components.data.card = {}), global.ng.core, global.ng.common, global.dropdown, global.wm.components.base, global.wm.components.basic, global.wm.components.navigation.menu, global.wm.core));
})(this, (function (exports, i0, i3, i2, i5, i1, 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 i3__namespace = /*#__PURE__*/_interopNamespaceDefault(i3);
    var i2__namespace = /*#__PURE__*/_interopNamespaceDefault(i2);
    var i5__namespace = /*#__PURE__*/_interopNamespaceDefault(i5);
    var i1__namespace = /*#__PURE__*/_interopNamespaceDefault(i1);
    var i4__namespace = /*#__PURE__*/_interopNamespaceDefault(i4);

    const registerProps$3 = () => {
        i5.register('wm-card', new Map([
            ['actions', i5.PROP_STRING],
            ['animation', i5.PROP_STRING],
            ['class', i5.PROP_STRING],
            ['iconclass', i5.PROP_STRING],
            ['iconurl', i5.PROP_STRING],
            ['imageheight', { value: '200px', ...i5.PROP_STRING }],
            ['itemaction', i5.PROP_STRING],
            ['itemchildren', i5.PROP_STRING],
            ['itemicon', i5.PROP_STRING],
            ['itemlabel', i5.PROP_STRING],
            ['itemlink', i5.PROP_STRING],
            ['name', i5.PROP_STRING],
            ['picturesource', i5.PROP_STRING],
            ['picturetitle', { value: '', ...i5.PROP_STRING }],
            ['show', { value: true, ...i5.PROP_BOOLEAN }],
            ['subheading', i5.PROP_STRING],
            ['title', i5.PROP_STRING],
            ['userrole', i5.PROP_STRING]
        ]));
    };

    const _c0$1 = ["cardContainerWrapper"];
    const _c1$1 = ["wmCard", ""];
    const _c2$1 = ["*", "*", "*"];
    const _c3 = a0 => ({ "max-height": a0 });
    function CardComponent_div_0_div_1_i_1_Template(rf, ctx) { if (rf & 1) {
        i0__namespace.ɵɵelement(0, "i", 12);
    } if (rf & 2) {
        const ctx_r0 = i0__namespace.ɵɵnextContext(3);
        i0__namespace.ɵɵproperty("ngClass", ctx_r0.iconclass);
    } }
    function CardComponent_div_0_div_1_img_2_Template(rf, ctx) { if (rf & 1) {
        i0__namespace.ɵɵelement(0, "img", 13);
    } if (rf & 2) {
        const ctx_r0 = i0__namespace.ɵɵnextContext(3);
        i0__namespace.ɵɵproperty("src", ctx_r0.iconurl, i0__namespace.ɵɵsanitizeUrl);
    } }
    function CardComponent_div_0_div_1_Template(rf, ctx) { if (rf & 1) {
        i0__namespace.ɵɵelementStart(0, "div", 9);
        i0__namespace.ɵɵtemplate(1, CardComponent_div_0_div_1_i_1_Template, 1, 1, "i", 10)(2, CardComponent_div_0_div_1_img_2_Template, 1, 1, "img", 11);
        i0__namespace.ɵɵelementEnd();
    } if (rf & 2) {
        const ctx_r0 = i0__namespace.ɵɵnextContext(2);
        i0__namespace.ɵɵadvance();
        i0__namespace.ɵɵproperty("ngIf", ctx_r0.iconclass && !ctx_r0.iconurl);
        i0__namespace.ɵɵadvance();
        i0__namespace.ɵɵproperty("ngIf", ctx_r0.iconurl);
    } }
    function CardComponent_div_0_div_5_Template(rf, ctx) { if (rf & 1) {
        i0__namespace.ɵɵelementStart(0, "div", 14);
        i0__namespace.ɵɵelement(1, "div", 15);
        i0__namespace.ɵɵelementEnd();
    } if (rf & 2) {
        const ctx_r0 = i0__namespace.ɵɵnextContext(2);
        i0__namespace.ɵɵadvance();
        i0__namespace.ɵɵproperty("autoClose", ctx_r0.autoclose !== "disabled");
    } }
    function CardComponent_div_0_Template(rf, ctx) { if (rf & 1) {
        i0__namespace.ɵɵelementStart(0, "div", 3);
        i0__namespace.ɵɵtemplate(1, CardComponent_div_0_div_1_Template, 3, 2, "div", 4);
        i0__namespace.ɵɵelementStart(2, "div", 5);
        i0__namespace.ɵɵelement(3, "h4", 6)(4, "h5", 7);
        i0__namespace.ɵɵelementEnd();
        i0__namespace.ɵɵtemplate(5, CardComponent_div_0_div_5_Template, 2, 1, "div", 8);
        i0__namespace.ɵɵelementEnd();
    } if (rf & 2) {
        const ctx_r0 = i0__namespace.ɵɵnextContext();
        i0__namespace.ɵɵadvance();
        i0__namespace.ɵɵproperty("ngIf", ctx_r0.iconclass || ctx_r0.iconurl);
        i0__namespace.ɵɵadvance(2);
        i0__namespace.ɵɵproperty("textContent", ctx_r0.title);
        i0__namespace.ɵɵadvance();
        i0__namespace.ɵɵproperty("textContent", ctx_r0.subheading);
        i0__namespace.ɵɵadvance();
        i0__namespace.ɵɵproperty("ngIf", ctx_r0.actions);
    } }
    function CardComponent_div_1_Template(rf, ctx) { if (rf & 1) {
        i0__namespace.ɵɵelementStart(0, "div", 16);
        i0__namespace.ɵɵelement(1, "img", 17);
        i0__namespace.ɵɵelementEnd();
    } if (rf & 2) {
        const ctx_r0 = i0__namespace.ɵɵnextContext();
        i0__namespace.ɵɵproperty("ngStyle", i0__namespace.ɵɵpureFunction1(1, _c3, ctx_r0.imageheight));
    } }
    const DEFAULT_CLS$3 = 'app-card card app-panel';
    const WIDGET_CONFIG$3 = {
        widgetType: 'wm-card',
        hostClass: DEFAULT_CLS$3
    };
    class CardComponent extends i4.MenuAdapterComponent {
        static { this.initializeProps = registerProps$3(); }
        constructor(inj, render2, explicitContext) {
            super(inj, WIDGET_CONFIG$3, explicitContext);
            this.render2 = render2;
            i5.styler(this.nativeElement, this, i5.APPLY_STYLES_TYPE.SHELL);
        }
        ngAfterViewInit() {
            super.ngAfterViewInit();
            i5.styler(this.cardContainerElRef.nativeElement, this, i5.APPLY_STYLES_TYPE.INNER_SHELL);
        }
        ngOnInit() {
            super.ngOnInit();
            core.removeAttr(this.nativeElement.parentElement, 'tabindex');
            core.setAttr(this.nativeElement, 'tabindex', 0);
            this.render2.listen(this.nativeElement, 'keydown.Enter', (e) => {
                e.preventDefault();
                this.nativeElement.click();
            });
        }
        onPropertyChange(key, nv, ov) {
            if (key === 'title' || key === 'subheading' || key === 'iconclass' || key === 'iconurl' || key === 'actions') {
                this.showHeader = !!(this.title || this.subheading || this.iconclass || this.iconurl || this.actions);
            }
            else {
                super.onPropertyChange(key, nv, ov);
            }
        }
        static { this.ɵfac = function CardComponent_Factory(t) { return new (t || CardComponent)(i0__namespace.ɵɵdirectiveInject(i0__namespace.Injector), i0__namespace.ɵɵdirectiveInject(i0__namespace.Renderer2), i0__namespace.ɵɵdirectiveInject('EXPLICIT_CONTEXT', 8)); }; }
        static { this.ɵcmp = /*@__PURE__*/ i0__namespace.ɵɵdefineComponent({ type: CardComponent, selectors: [["", "wmCard", ""]], viewQuery: function CardComponent_Query(rf, ctx) { if (rf & 1) {
                i0__namespace.ɵɵviewQuery(_c0$1, 7);
            } if (rf & 2) {
                let _t;
                i0__namespace.ɵɵqueryRefresh(_t = i0__namespace.ɵɵloadQuery()) && (ctx.cardContainerElRef = _t.first);
            } }, features: [i0__namespace.ɵɵProvidersFeature([
                    i5.provideAsWidgetRef(CardComponent)
                ]), i0__namespace.ɵɵInheritDefinitionFeature], attrs: _c1$1, ngContentSelectors: _c2$1, decls: 9, vars: 2, consts: [["cardContainerWrapper", ""], ["class", "app-card-header panel-heading", 4, "ngIf"], ["class", "app-card-image", 3, "ngStyle", 4, "ngIf"], [1, "app-card-header", "panel-heading"], ["class", "app-card-avatar", 4, "ngIf"], [1, "app-card-header-text"], [1, "card-heading", 3, "textContent"], [1, "card-subheading", "text-muted", 3, "textContent"], ["class", "panel-actions", 4, "ngIf"], [1, "app-card-avatar"], ["class", "app-icon", 3, "ngClass", 4, "ngIf"], ["class", "img-circle", 3, "src", 4, "ngIf"], [1, "app-icon", 3, "ngClass"], [1, "img-circle", 3, "src"], [1, "panel-actions"], ["wmMenu", "", "dropdown", "", "type", "anchor", "iconclass", "wm-sl-l sl-more-menu-vertical", "menuposition", "down,left", "hint", "Actions", "caption", "", "dataset.bind", "actions", 1, "panel-action", 3, "autoClose"], [1, "app-card-image", 3, "ngStyle"], ["wmPicture", "", "picturesource.bind", "picturesource", "hint.bind", "picturetitle", 1, "card-image"]], template: function CardComponent_Template(rf, ctx) { if (rf & 1) {
                i0__namespace.ɵɵprojectionDef(_c2$1);
                i0__namespace.ɵɵtemplate(0, CardComponent_div_0_Template, 6, 4, "div", 1)(1, CardComponent_div_1_Template, 2, 3, "div", 2);
                i0__namespace.ɵɵelementStart(2, "div", null, 0);
                i0__namespace.ɵɵprojection(4, 0, ["ngProjectAs", "[wmCardContent]", 5, ["", "wmCardContent", ""]]);
                i0__namespace.ɵɵelementEnd();
                i0__namespace.ɵɵelementStart(5, "div");
                i0__namespace.ɵɵprojection(6, 1, ["ngProjectAs", "[wmCardActions]", 5, ["", "wmCardActions", ""]]);
                i0__namespace.ɵɵelementEnd();
                i0__namespace.ɵɵelementStart(7, "div");
                i0__namespace.ɵɵprojection(8, 2, ["ngProjectAs", "[wmCardFooter]", 5, ["", "wmCardFooter", ""]]);
                i0__namespace.ɵɵelementEnd();
            } if (rf & 2) {
                i0__namespace.ɵɵproperty("ngIf", ctx.showHeader);
                i0__namespace.ɵɵadvance();
                i0__namespace.ɵɵproperty("ngIf", ctx.picturesource);
            } }, dependencies: [i1__namespace.PictureDirective, i2__namespace.BsDropdownDirective, i3__namespace.NgClass, i3__namespace.NgIf, i3__namespace.NgStyle, i4__namespace.MenuComponent, i5__namespace.TextContentDirective], encapsulation: 2 }); }
    }
    (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(CardComponent, [{
            type: i0.Component,
            args: [{ selector: '[wmCard]', providers: [
                        i5.provideAsWidgetRef(CardComponent)
                    ], template: "<div class=\"app-card-header panel-heading\" *ngIf=\"showHeader\">\n    <div class=\"app-card-avatar\" *ngIf=\"iconclass || iconurl\">\n        <i class=\"app-icon\" [ngClass]=\"iconclass\" *ngIf=\"iconclass && !iconurl\"></i>\n        <img class=\"img-circle\" [src]=\"iconurl\" *ngIf=\"iconurl\" />\n    </div>\n    <div class=\"app-card-header-text\">\n        <h4 class=\"card-heading\" [textContent]=\"title\"></h4>\n        <h5 class=\"card-subheading text-muted\" [textContent]=\"subheading\"></h5>\n    </div>\n    <div class=\"panel-actions\" *ngIf=\"actions\">\n        <!-- TODO(punith) need to bind autoclose-->\n        <div wmMenu dropdown\n             [autoClose]=\"autoclose !== 'disabled'\"\n             class=\"panel-action\"\n             type=\"anchor\"\n             iconclass=\"wm-sl-l sl-more-menu-vertical\"\n             menuposition=\"down,left\"\n             hint=\"Actions\"\n             caption=\"\"\n             dataset.bind=\"actions\">\n        </div>\n    </div>\n</div>\n<div class=\"app-card-image\" *ngIf=\"picturesource\"  [ngStyle]=\"{'max-height':imageheight}\">\n   <img wmPicture class=\"card-image\" picturesource.bind=\"picturesource\" hint.bind=\"picturetitle\" />\n</div>\n<div #cardContainerWrapper>\n    <ng-content ngProjectAs=\"[wmCardContent]\"></ng-content>\n</div>\n<div>\n    <ng-content ngProjectAs=\"[wmCardActions]\"></ng-content>\n</div>\n<div>\n    <ng-content ngProjectAs=\"[wmCardFooter]\"></ng-content>\n</div>\n" }]
        }], () => [{ type: i0__namespace.Injector }, { type: i0__namespace.Renderer2 }, { type: undefined, decorators: [{
                    type: i0.Inject,
                    args: ['EXPLICIT_CONTEXT']
                }, {
                    type: i0.Optional
                }] }], { cardContainerElRef: [{
                type: i0.ViewChild,
                args: ['cardContainerWrapper', { static: true }]
            }] }); })();
    (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassDebugInfo(CardComponent, { className: "CardComponent", filePath: "card.component.ts", lineNumber: 33 }); })();

    const registerProps$2 = () => {
        i5.register('wm-card-actions', new Map([
            ['class', i5.PROP_STRING],
            ['name', i5.PROP_STRING],
            ['show', { value: true, ...i5.PROP_BOOLEAN }],
        ]));
    };

    const DEFAULT_CLS$2 = 'app-card-actions';
    const WIDGET_CONFIG$2 = {
        widgetType: 'wm-card-actions',
        hostClass: DEFAULT_CLS$2
    };
    class CardActionsDirective extends i5.StylableComponent {
        static { this.initializeProps = registerProps$2(); }
        constructor(inj, explicitContext) {
            super(inj, WIDGET_CONFIG$2, explicitContext);
            i5.styler(this.nativeElement, this, i5.APPLY_STYLES_TYPE.CONTAINER);
        }
        static { this.ɵfac = function CardActionsDirective_Factory(t) { return new (t || CardActionsDirective)(i0__namespace.ɵɵdirectiveInject(i0__namespace.Injector), i0__namespace.ɵɵdirectiveInject('EXPLICIT_CONTEXT', 8)); }; }
        static { this.ɵdir = /*@__PURE__*/ i0__namespace.ɵɵdefineDirective({ type: CardActionsDirective, selectors: [["", "wmCardActions", ""]], features: [i0__namespace.ɵɵInheritDefinitionFeature] }); }
    }
    (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(CardActionsDirective, [{
            type: i0.Directive,
            args: [{
                    selector: '[wmCardActions]'
                }]
        }], () => [{ type: i0__namespace.Injector }, { type: undefined, decorators: [{
                    type: i0.Inject,
                    args: ['EXPLICIT_CONTEXT']
                }, {
                    type: i0.Optional
                }] }], null); })();

    const registerProps$1 = () => {
        i5.register('wm-card-content', new Map([
            ['class', i5.PROP_STRING],
            ['content', i5.PROP_STRING],
            ['name', i5.PROP_STRING],
            ['show', { value: true, ...i5.PROP_BOOLEAN }]
        ]));
    };

    const _c0 = ["cardContentContainer"];
    const _c1 = ["wmCardContent", ""];
    const _c2 = ["*"];
    const DEFAULT_CLS$1 = 'app-card-content card-body card-block';
    const WIDGET_CONFIG$1 = {
        widgetType: 'wm-card-content',
        hostClass: DEFAULT_CLS$1
    };
    class CardContentComponent extends i5.StylableComponent {
        static { this.initializeProps = registerProps$1(); }
        constructor(inj, explicitContext) {
            super(inj, WIDGET_CONFIG$1, explicitContext);
        }
        ngAfterViewInit() {
            super.ngAfterViewInit();
            i5.styler(this.cardContentContainerElRef.nativeElement, this, i5.APPLY_STYLES_TYPE.CONTAINER);
        }
        static { this.ɵfac = function CardContentComponent_Factory(t) { return new (t || CardContentComponent)(i0__namespace.ɵɵdirectiveInject(i0__namespace.Injector), i0__namespace.ɵɵdirectiveInject('EXPLICIT_CONTEXT', 8)); }; }
        static { this.ɵcmp = /*@__PURE__*/ i0__namespace.ɵɵdefineComponent({ type: CardContentComponent, selectors: [["div", "wmCardContent", ""]], viewQuery: function CardContentComponent_Query(rf, ctx) { if (rf & 1) {
                i0__namespace.ɵɵviewQuery(_c0, 5);
            } if (rf & 2) {
                let _t;
                i0__namespace.ɵɵqueryRefresh(_t = i0__namespace.ɵɵloadQuery()) && (ctx.cardContentContainerElRef = _t.first);
            } }, features: [i0__namespace.ɵɵProvidersFeature([
                    i5.provideAsWidgetRef(CardContentComponent)
                ]), i0__namespace.ɵɵInheritDefinitionFeature], attrs: _c1, ngContentSelectors: _c2, decls: 3, vars: 0, consts: [["cardContentContainer", ""], ["partial-container-target", ""]], template: function CardContentComponent_Template(rf, ctx) { if (rf & 1) {
                i0__namespace.ɵɵprojectionDef();
                i0__namespace.ɵɵelementStart(0, "div", 1, 0);
                i0__namespace.ɵɵprojection(2);
                i0__namespace.ɵɵelementEnd();
            } }, encapsulation: 2 }); }
    }
    (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(CardContentComponent, [{
            type: i0.Component,
            args: [{ selector: 'div[wmCardContent]', providers: [
                        i5.provideAsWidgetRef(CardContentComponent)
                    ], template: "<div partial-container-target #cardContentContainer>\n    <ng-content></ng-content>\n</div>" }]
        }], () => [{ type: i0__namespace.Injector }, { type: undefined, decorators: [{
                    type: i0.Inject,
                    args: ['EXPLICIT_CONTEXT']
                }, {
                    type: i0.Optional
                }] }], { cardContentContainerElRef: [{
                type: i0.ViewChild,
                args: ['cardContentContainer']
            }] }); })();
    (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassDebugInfo(CardContentComponent, { className: "CardContentComponent", filePath: "card-content/card-content.component.ts", lineNumber: 19 }); })();

    const registerProps = () => {
        i5.register('wm-card-footer', new Map([
            ['class', i5.PROP_STRING],
            ['name', i5.PROP_STRING],
            ['show', { value: true, ...i5.PROP_BOOLEAN }],
        ]));
    };

    const DEFAULT_CLS = 'app-card-footer text-muted card-footer';
    const WIDGET_CONFIG = {
        widgetType: 'wm-card-footer',
        hostClass: DEFAULT_CLS
    };
    class CardFooterDirective extends i5.StylableComponent {
        static { this.initializeProps = registerProps(); }
        constructor(inj, explicitContext) {
            super(inj, WIDGET_CONFIG, explicitContext);
            i5.styler(this.nativeElement, this, i5.APPLY_STYLES_TYPE.CONTAINER);
        }
        static { this.ɵfac = function CardFooterDirective_Factory(t) { return new (t || CardFooterDirective)(i0__namespace.ɵɵdirectiveInject(i0__namespace.Injector), i0__namespace.ɵɵdirectiveInject('EXPLICIT_CONTEXT', 8)); }; }
        static { this.ɵdir = /*@__PURE__*/ i0__namespace.ɵɵdefineDirective({ type: CardFooterDirective, selectors: [["", "wmCardFooter", ""]], features: [i0__namespace.ɵɵInheritDefinitionFeature] }); }
    }
    (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(CardFooterDirective, [{
            type: i0.Directive,
            args: [{
                    selector: '[wmCardFooter]'
                }]
        }], () => [{ type: i0__namespace.Injector }, { type: undefined, decorators: [{
                    type: i0.Inject,
                    args: ['EXPLICIT_CONTEXT']
                }, {
                    type: i0.Optional
                }] }], null); })();

    const components = [
        CardComponent,
        CardActionsDirective,
        CardContentComponent,
        CardFooterDirective
    ];
    class CardModule {
        static { this.ɵfac = function CardModule_Factory(t) { return new (t || CardModule)(); }; }
        static { this.ɵmod = /*@__PURE__*/ i0__namespace.ɵɵdefineNgModule({ type: CardModule }); }
        static { this.ɵinj = /*@__PURE__*/ i0__namespace.ɵɵdefineInjector({ imports: [i1.BasicModule,
                i2.BsDropdownModule,
                i3.CommonModule,
                i4.MenuModule,
                i5.WmComponentsModule] }); }
    }
    (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(CardModule, [{
            type: i0.NgModule,
            args: [{
                    imports: [
                        i1.BasicModule,
                        i2.BsDropdownModule,
                        i3.CommonModule,
                        i4.MenuModule,
                        i5.WmComponentsModule
                    ],
                    declarations: [...components],
                    exports: [...components]
                }]
        }], null, null); })();
    (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0__namespace.ɵɵsetNgModuleScope(CardModule, { declarations: [CardComponent,
            CardActionsDirective,
            CardContentComponent,
            CardFooterDirective], imports: [i1.BasicModule,
            i2.BsDropdownModule,
            i3.CommonModule,
            i4.MenuModule,
            i5.WmComponentsModule], exports: [CardComponent,
            CardActionsDirective,
            CardContentComponent,
            CardFooterDirective] }); })();

    exports.CardActionsDirective = CardActionsDirective;
    exports.CardComponent = CardComponent;
    exports.CardContentComponent = CardContentComponent;
    exports.CardFooterDirective = CardFooterDirective;
    exports.CardModule = CardModule;

}));
