import { r as registerInstance, h, d as Host } from './index-c0a4d8bd.js';
import { s as state } from './pn-find-service-and-price-store-0302dd23.js';
import './index-a0a6fb88.js';

const pnFindServiceAndPriceResultCss = "pn-button-dropdown .pn-button-dropdown>pn-button>.pn-button{min-height:initial}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}@media screen and (max-width: 767px){.sr-only-mobile{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}}";
const PnFindServiceAndPriceResultStyle0 = pnFindServiceAndPriceResultCss;

const PnfindServiceAndPriceResult = class {
    constructor(hostRef) {
        registerInstance(this, hostRef);
        this.item = null;
        this.shownitems = [];
        this.weightText = '';
    }
    componentWillLoad() {
        this.composeItems();
    }
    composeItems() {
        this.shownitems = [this.item];
        // this.shownitems = [];
        // if (this.item.pricestamps) {
        //   this.shownitems.push({...this.item, priceagent: null, pricesenddirect: null});
        // }
        // if (this.item.priceagent) {
        //   this.shownitems.push({...this.item, pricestamps: null, pricesenddirect: null});
        // }
        // if (this.item.pricesenddirect) {
        //   this.shownitems.push({...this.item, pricestamps: null, priceagent: null});
        // }
        // Parcels are always in KG. Letter KG must be converted from grams
        // this.weightText = (this.item.what === "parcel") ? this.item.maxweight + 'kg' :
        // (this.item.what === "letter" && this.item.maxweight > 999) ? Math.round(this.item.maxweight/1000) + " kg" : this.item.maxweight + " g";
    }
    render() {
        return (h(Host, { key: 'bf4e52c4adcba72ffeb9063b1fd30dafe6fa39eb' }, this.shownitems.map(item => (h("pn-product-card", null, h("pn-illustration", { slot: "illustration", illustration: item.illustration }), h("div", { slot: "content" }, h("div", { class: "content" }, h("h3", null, item.name), item.description ? h("div", { class: "description" }, item.description) : null, item.info ? h("div", { class: "description" }, item.info) : null)), item.maxweight ? h("pn-product-tile-info", { label: state.i18n.maxweightlabel, text: this.weightText }) : null, item.pricestamps ? (h("pn-product-tile-price", { slot: "price", label: state.i18n.stampshopcta, amount: item.pricestamps + '', currency: state.market.currency })) : null, item.pricesenddirect ? (h("pn-product-tile-price", { slot: "price", label: state.i18n.senddirectcta, amount: item.pricesenddirect + '', currency: state.market.currency, url: "https://portal.postnord.com/skickadirekt/" })) : null, item.note ? (h("small", { slot: "note" }, h("p", null, item.note))) : null)))));
    }
    static get watchers() { return {
        "item": ["composeItems"]
    }; }
};
PnfindServiceAndPriceResult.style = PnFindServiceAndPriceResultStyle0;

export { PnfindServiceAndPriceResult as pn_find_service_and_price_result };

//# sourceMappingURL=pn-find-service-and-price-result.entry.js.map