'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 = {
  created: "skapad",
  ordered: "beställd",
  cancelled: "avbruten",
  charged: "godkänd",
  paid: "betald",
  refunded: "återbetald",
  denied: "nekad",
  pending: "väntande",
  deferred: "skickad",
  active: "aktiv",
  inactive: "inaktiv",
  suspended: "avstängd",
  settled: "utbetald",
  authorized: "auktoriserad",
  failed: "misslyckad",
};

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

const styleCss = ".sc-payfunc-status-h{display:inline-block;position:relative;top:.2em;padding:.2em .3em;border-radius:.6em;overflow:hidden;text-align:center;text-overflow:ellipsis;width:100%}[hidden].sc-payfunc-status-h{display:none}[status = \"failed\"].sc-payfunc-status-h,[status = \"suspended\"].sc-payfunc-status-h,[status = \"denied\"].sc-payfunc-status-h{background-color:rgb(var(--smoothly-danger-color));color:rgb(var(--smoothly-danger-contrast))}[status = \"active\"].sc-payfunc-status-h,[status = \"ordered\"].sc-payfunc-status-h{background-color:rgb(var(--smoothly-success-color));color:rgb(var(--smoothly-success-contrast))}[status = \"inactive\"].sc-payfunc-status-h,[status = \"cancelled\"].sc-payfunc-status-h,[status = \"refunded\"].sc-payfunc-status-h{background-color:rgb(var(--smoothly-medium-color));color:rgb(var(--smoothly-medium-contrast))}[status=\"authorized\"].sc-payfunc-status-h,[status=\"created\"].sc-payfunc-status-h,[status=\"deferred\"].sc-payfunc-status-h,[status=\"pending\"].sc-payfunc-status-h{background-color:rgb(var(--smoothly-warning-color));color:rgb(var(--smoothly-warning-contrast))}[status = \"charged\"].sc-payfunc-status-h,[status = \"paid\"].sc-payfunc-status-h{background-color:rgb(var(--smoothly-tertiary-tint));color:rgb(var(--smoothly-success-contrast))}[status = \"settled\"].sc-payfunc-status-h{background-color:rgb(var(--smoothly-tertiary-color));color:rgb(var(--smoothly-tertiary-contrast))}";

const PayfuncStatus = class {
  constructor(hostRef) {
    index$1.registerInstance(this, hostRef);
  }
  componentWillLoad() {
    this.t = create(this.element);
  }
  render() {
    var _a, _b;
    const t = this.t;
    return [(_a = this.quantity) === null || _a === void 0 ? void 0 : _a.toString(), this.quantity && ((_b = this.unit) !== null && _b !== void 0 ? _b : "×"), t(this.status)].filter(e => e).join(" ");
  }
  get element() { return index$1.getElement(this); }
};
PayfuncStatus.style = styleCss;

exports.payfunc_status = PayfuncStatus;
