import {
  __decorateClass
} from "../../../chunks/chunk.QU3DSPNU.js";
import { property } from "lit/decorators.js";
import { gdsCustomElement } from "../../../utils/helpers/custom-element-scoping.js";
import { GdsFormattedText } from "../formatted-text.js";
import { numberFormats } from "../formatters.js";
let GdsFormattedNumber = class extends GdsFormattedText {
  constructor() {
    super(...arguments);
    this.format = "decimalsAndThousands";
  }
  get formattedValue() {
    return numberFormats[this.format](
      this.value,
      this.locale,
      this.currency,
      this.decimals
    );
  }
  firstUpdated(_changedProperties) {
    super.firstUpdated(_changedProperties);
    if (!this.value && this.textContent) {
      this.value = this.textContent;
    }
  }
};
__decorateClass([
  property({ attribute: false })
], GdsFormattedNumber.prototype, "value", 2);
__decorateClass([
  property({ type: String })
], GdsFormattedNumber.prototype, "locale", 2);
__decorateClass([
  property({ type: String })
], GdsFormattedNumber.prototype, "currency", 2);
__decorateClass([
  property({ type: Number })
], GdsFormattedNumber.prototype, "decimals", 2);
__decorateClass([
  property({ type: String })
], GdsFormattedNumber.prototype, "format", 2);
GdsFormattedNumber = __decorateClass([
  gdsCustomElement("gds-formatted-number")
], GdsFormattedNumber);
export {
  GdsFormattedNumber
};
