'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index$1 = require('./index-0b1e2673.js');
require('./_commonjsHelpers-937cd5b3.js');
const index = require('./index-36cf3884.js');

const sv = {
  Amount: "Summa",
  "Add item": "Lägg till artikel",
};

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

const styleCss = ".sc-payfunc-total-amount-h{display:flex}[hidden].sc-payfunc-total-amount-h{display:none}.sc-payfunc-total-amount-h>*.sc-payfunc-total-amount:first-child{flex-grow:1}smoothly-select.sc-payfunc-total-amount{margin-top:.25em}";

const PayfuncTotalAmount = class {
  constructor(hostRef) {
    index$1.registerInstance(this, hostRef);
    this.addItem = index$1.createEvent(this, "addItem", 7);
    this.currencies = [
      "SEK",
      "EUR",
      "USD",
      "DKK",
      "GBP",
      "ISK",
      "NOK",
      "AUD",
      "CAD",
      "JPY",
      "NZD",
      "CHF",
      "TRY",
      "PLN",
      "RUB",
    ];
    this.currency = "SEK";
    this.itemsvisible = false;
  }
  componentWillLoad() {
    this.t = create(this.element);
  }
  add(e) {
    this.addItem.emit(e);
  }
  render() {
    return [
      index$1.h("smoothly-input", { disabled: this.itemsvisible, type: "price", value: this.price, name: "price" }, this.t("Amount")),
      index$1.h("smoothly-select", { identifier: "currency", background: "transparent" }, this.currencies.map(option => this.currency == option ? (index$1.h("option", { value: option, selected: true }, option)) : (index$1.h("option", { value: option }, option)))),
      index$1.h("button", { type: "button", tabindex: "-1", onClick: e => this.add(e) }, index$1.h("smoothly-icon", { toolTip: this.t("Add item"), name: "add-circle-outline", fill: "clear", size: "medium", color: "medium" })),
    ];
  }
  get element() { return index$1.getElement(this); }
};
PayfuncTotalAmount.style = styleCss;

exports.payfunc_total_amount = PayfuncTotalAmount;
