import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
import { t as watchBlockNumber } from './chunk-LAFZBYO7.js';
import { s as state } from './wallet.js';

const NKDropSupplyText = /*@__PURE__*/ proxyCustomElement(class NKDropSupplyText extends HTMLElement {
  constructor() {
    super();
    this.__registerHost();
    this.__attachShadow();
    this.supply = undefined;
    this.maxAmount = undefined;
  }
  componentWillLoad() {
    this.disconnect = watchBlockNumber({ listen: true }, async () => {
      this.supply = (await state.diamond.base.totalSupply()).toNumber();
      this.maxAmount = (await state.diamond.apps.drop.maxAmount()).toNumber();
    });
  }
  disconnectedCallback() {
    this.disconnect();
  }
  render() {
    return (h(Host, null, this.maxAmount === 0
      ? this.supply
      : `${this.supply} / ${this.maxAmount}`, h("slot", null)));
  }
}, [1, "nk-drop-supply-text", {
    "supply": [32],
    "maxAmount": [32]
  }]);
function defineCustomElement$1() {
  if (typeof customElements === "undefined") {
    return;
  }
  const components = ["nk-drop-supply-text"];
  components.forEach(tagName => { switch (tagName) {
    case "nk-drop-supply-text":
      if (!customElements.get(tagName)) {
        customElements.define(tagName, NKDropSupplyText);
      }
      break;
  } });
}

const NkDropSupplyText = NKDropSupplyText;
const defineCustomElement = defineCustomElement$1;

export { NkDropSupplyText, defineCustomElement };

//# sourceMappingURL=nk-drop-supply-text.js.map