'use strict';

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

const index = require('./index-cd6fab62.js');
const defaultI18n = require('./default-i18n-072e75d7.js');
require('./index-20b57ec7.js');
require('./_commonjsHelpers-537d719a.js');

const scOrderStatusBadgeCss = ":host{display:inline-block}";

const ScOrderStatusBadge = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    /** The tag's size. */
    this.size = 'medium';
    /** Draws a pill-style tag with rounded edges. */
    this.pill = false;
    /** Makes the tag clearable. */
    this.clearable = false;
  }
  getType() {
    switch (this.status) {
      case 'draft':
        return 'info';
      case 'requires_approval':
      case 'finalized':
        return 'warning';
      case 'paid':
        return 'success';
      case 'payment_intent_canceled':
      case 'payment_failed':
        return 'danger';
    }
  }
  getText() {
    switch (this.status) {
      case 'draft':
        return defaultI18n.__('Draft', 'surecart');
      case 'finalized':
        return defaultI18n.__('Pending Payment', 'surecart');
      case 'paid':
        return defaultI18n.__('Paid', 'surecart');
      case 'payment_intent_canceled':
        return defaultI18n.__('Cancelled', 'surecart');
      case 'payment_failed':
        return defaultI18n.__('Failed', 'surecart');
      case 'requires_approval':
        return defaultI18n.__('Requires Approval', 'surecart');
      default:
        return this.status;
    }
  }
  render() {
    return index.h("sc-tag", { type: this.getType() }, this.getText());
  }
};
ScOrderStatusBadge.style = scOrderStatusBadgeCss;

exports.sc_order_status_badge = ScOrderStatusBadge;
