import { r as registerInstance, h, g as getElement } from './index-07845439.js';
import { P as Payment } from './index-e20749b7.js';
import { d as dist } from './index-63517df5.js';
import './index-b6cf748e.js';
import './_commonjsHelpers-8fe71198.js';
import './index-265fba1f.js';

const sv = {
  Scheme: "System",
  Number: "Nummer",
  Expires: "Giltigt t.o.m.",
  Type: "Typ",
  card: "kort",
  Method: "Metod",
  Contact: "Kontakt",
  Message: "Meddelande",
  "Open link": "Öppna länk",
  defer: "skickad",
  link: "länk",
};

function create(language) {
  return dist.create({
    sv,
  }, language);
}

const styleCss = "*.sc-ig-order-payment-h{display:-ms-flexbox;display:flex}[hidden].sc-ig-order-payment-h{display:none}.sc-ig-order-payment-h>span.sc-ig-order-payment{-ms-flex-positive:1;flex-grow:1;padding-left:0.6em;padding-right:0.6em}ul.sc-ig-order-payment{width:100%;list-style-type:none;margin-top:0;margin-bottom:0;-webkit-padding-start:0;padding-inline-start:0}summary.sc-ig-order-payment{outline:none;text-align:left}dl.sc-ig-order-payment{margin:8px;width:100%;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:wrap;flex-wrap:wrap;max-height:3em;-ms-flex-pack:start;justify-content:flex-start}dt.sc-ig-order-payment{font-weight:bold;text-align:left}dd.sc-ig-order-payment{text-align:left;margin:0}dd.icon.sc-ig-order-payment{width:-webkit-max-content;width:-moz-max-content;width:max-content;padding-top:0.5em}";

const IntergirOrderPayment = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
  }
  componentWillLoad() {
    this.t = create(this.element);
  }
  render() {
    const t = this.t;
    return (h("ul", null, h("li", null, this.order.payment.type == "card" ? (h("summary", null, h("dl", null, this.order.payment.type ? [h("dt", null, t("Type")), h("dd", null, t(this.order.payment.type))] : "", this.order.payment.scheme ? [h("dt", null, t("Scheme")), h("dd", null, this.order.payment.scheme)] : "", Payment.Card.is(this.order.payment)
      ? [
        h("dt", null, t("Number")),
        h("dd", null, this.order.payment.iin.substring(0, 4) +
          " " +
          this.order.payment.iin.substring(4) +
          "** **** " +
          this.order.payment.last4),
      ]
      : "", this.order.payment.expires
      ? [
        h("dt", null, t("Expires")),
        h("dd", null, this.order.payment.expires[0], "/", this.order.payment.expires[1]),
      ]
      : ""))) : this.order.payment.type == "defer" ? (h("summary", null, h("dl", null, this.order.payment.type ? [h("dt", null, t("Type")), h("dd", null, t(this.order.payment.type))] : "", this.order.payment.method ? [h("dt", null, t("Method")), h("dd", null, t(this.order.payment.method))] : "", this.order.payment.contact ? [h("dt", null, t("Contact")), h("dd", null, this.order.payment.contact)] : "", this.order.payment.message ? [h("dt", null, t("Message")), h("dd", null, this.order.payment.message)] : "", Payment.Defer.is(this.order.payment) && this.order.payment.link != undefined
      ? [
        h("dt", null),
        h("dd", { class: "icon" }, h("a", { target: "_blank", href: this.order.payment.link }, h("smoothly-icon", { toolTip: t("Open link"), name: "open" }))),
      ]
      : ""))) : ("No payment information available."))));
  }
  get element() { return getElement(this); }
};
IntergirOrderPayment.style = styleCss;

export { IntergirOrderPayment as ig_order_payment };
