import { __decorate, __metadata } from "tslib";
import { Component, EventEmitter, Input, Output } from '@angular/core';
import { Product } from '../shared/product';
import { Addon } from '@vendasta/core/shared';
let AddonDetailsComponent = class AddonDetailsComponent {
    constructor() {
        this.hasVerifiedContract = false;
        this.loaded = true;
        this.showPricing = true;
        this.showEnableAddon = false;
        this.actionEnabled = false;
        this.prerequisiteSelected = new EventEmitter();
        this.actionSelected = new EventEmitter();
    }
    onPrerequisiteSelected() {
        this.prerequisiteSelected.emit();
    }
    onActionSelected() {
        this.actionSelected.emit();
    }
    getPricing(product, addon) {
        return {
            currency: product.currency,
            prices: [
                {
                    price: addon.price,
                    frequency: addon.billingFrequency ? addon.billingFrequency : 'Monthly'
                }
            ]
        };
    }
    get pricingLabel() {
        return this.reseller ? 'Wholesale Pricing' : 'Pricing';
    }
};
__decorate([
    Input(),
    __metadata("design:type", Product)
], AddonDetailsComponent.prototype, "product", void 0);
__decorate([
    Input(),
    __metadata("design:type", Addon)
], AddonDetailsComponent.prototype, "addon", void 0);
__decorate([
    Input(),
    __metadata("design:type", Boolean)
], AddonDetailsComponent.prototype, "reseller", void 0);
__decorate([
    Input(),
    __metadata("design:type", Object)
], AddonDetailsComponent.prototype, "billedProduct", void 0);
__decorate([
    Input(),
    __metadata("design:type", Object)
], AddonDetailsComponent.prototype, "hasVerifiedContract", void 0);
__decorate([
    Input(),
    __metadata("design:type", Object)
], AddonDetailsComponent.prototype, "loaded", void 0);
__decorate([
    Input(),
    __metadata("design:type", Object)
], AddonDetailsComponent.prototype, "showPricing", void 0);
__decorate([
    Input(),
    __metadata("design:type", Object)
], AddonDetailsComponent.prototype, "showEnableAddon", void 0);
__decorate([
    Input(),
    __metadata("design:type", Object)
], AddonDetailsComponent.prototype, "actionEnabled", void 0);
__decorate([
    Output(),
    __metadata("design:type", Object)
], AddonDetailsComponent.prototype, "prerequisiteSelected", void 0);
__decorate([
    Output(),
    __metadata("design:type", Object)
], AddonDetailsComponent.prototype, "actionSelected", void 0);
AddonDetailsComponent = __decorate([
    Component({
        selector: 'addon-details',
        template: "<div class=\"addon-page\">\n  <va-header-container [iconUrl]=\"addon.icon\"\n                       [title]=\"addon.title\"\n                       [tagline]=\"addon.tagline\"\n                       [chipLabels]=\"product.getLmiCategoryNames()\"\n                       [pricing]=\"getPricing(product, addon)\"\n                       [pricingLabel]=\"pricingLabel\"\n                       [prerequisiteLabel]=\"product.name\"\n                       [billedProduct]=\"billedProduct\"\n                       [hasVerifiedContract]=\"hasVerifiedContract\"\n                       [loaded]=\"loaded\"\n                       [showPricing]=\"showPricing\"\n                       [actionLabel]=\"'Enable Add-on'\"\n                       [showEnableAddon]=\"showEnableAddon\"\n                       (actionSelected)=\"onActionSelected()\"\n                       (prerequisiteSelected)=\"onPrerequisiteSelected()\">\n  </va-header-container>\n\n  <div class=\"addon-details addon-content\">\n    <ng-container *ngIf=\"reseller\">\n      <div class=\"left-column\">\n        <div *ngIf=\"addon.resellerMarketing?.description || addon.resellerMarketing?.keySellingPoints\">\n          <va-selling-info [description]=\"addon.resellerMarketing?.description\"\n                           [keySellingPoints]=\"addon.resellerMarketing?.keySellingPoints\"></va-selling-info>\n        </div>\n        <section *ngIf=\"addon.resellerMarketing?.faqs?.length > 0 && addon.resellerMarketing?.faqs[0].question\">\n          <h2 class=\"va-addon-title\">FAQs</h2>\n          <va-faqs [faqs]=\"addon.resellerMarketing?.faqs\"></va-faqs>\n        </section>\n      </div>\n      <div class=\"right-column\">\n        <section *ngIf=\"addon.restrictions?.country?.whitelist\">\n          <supported-countries [countryCodes]=\"addon.restrictions.country.whitelist\"></supported-countries>\n        </section>\n        <section *ngIf=\"addon.screenshots?.length > 0\">\n          <h2 class=\"va-addon-title\">Gallery</h2>\n          <va-image-gallery [imageUrls]=\"addon.screenshots\"></va-image-gallery>\n        </section>\n        <section *ngIf=\"addon.resellerMarketing?.files?.length > 0\">\n        <h2 class=\"va-addon-title\">Files</h2>\n        <va-files [files]=\"addon.resellerMarketingFiles\"></va-files>\n        </section>\n      </div>\n    </ng-container>\n\n    <ng-container *ngIf=\"!reseller\">\n      <div class=\"left-column\">\n        <div *ngIf=\"addon.endUserMarketing?.description || addon.endUserMarketing?.keySellingPoints\">\n          <va-selling-info [description]=\"addon.endUserMarketing?.description\"\n                           [keySellingPoints]=\"addon.endUserMarketing?.keySellingPoints\"></va-selling-info>\n        </div>\n        <section *ngIf=\"addon.endUserMarketing?.faqs?.length > 0 && addon.endUserMarketing?.faqs[0].question\">\n          <h2 class=\"va-addon-title\">FAQs</h2>\n          <va-faqs [faqs]=\"addon.endUserMarketing?.faqs\"></va-faqs>\n        </section>\n      </div>\n\n      <div class=\"right-column\">\n        <section *ngIf=\"addon.restrictions?.country?.whitelist?.length > 0\">\n          <supported-countries [countryCodes]=\"addon.restrictions.country.whitelist\"></supported-countries>\n        </section>\n        <section *ngIf=\"addon.screenshots?.length > 0\">\n          <h2 class=\"va-addon-title\">Gallery</h2>\n          <va-image-gallery [imageUrls]=\"addon.screenshots\"></va-image-gallery>\n        </section>\n        <section *ngIf=\"addon.endUserMarketing?.files?.length > 0\">\n        <h2 class=\"va-addon-title\">Files</h2>\n        <va-files [files]=\"addon.endUserMarketingFiles\"></va-files>\n        </section>\n      </div>\n    </ng-container>\n  </div>\n\n</div>\n",
        styles: [":host{display:block;font-size:14px;line-height:1.4}:host *{box-sizing:border-box}.va-addon-title{font-size:32px;font-weight:300;margin-top:0;color:#212121}@media screen and (min-width:600px){.va-addon-title{font-size:32px}}img{max-width:100%}va-icon{display:inline-block}.addon-page{position:relative;margin:0 auto 20px;background:#fff;box-shadow:0 3px 10px rgba(33,33,33,.3);overflow:hidden;font-size:16px;color:#212121}.addon-page .item-amount{color:#999;font-size:14px;text-align:right;margin:0 24px 8px}section{padding:24px}.left-column{width:66%}@media screen and (max-width:600px){.left-column{width:100%}}.right-column{width:34%}.addon-content{display:flex}@media screen and (max-width:600px){.right-column{width:100%}.addon-content{flex-direction:column}}"]
    })
], AddonDetailsComponent);
export { AddonDetailsComponent };
//# sour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