import { Host, h } from "@stencil/core";
import { watchBlockNumber } from "@wagmi/core";
import state from "../../stores/wallet";
export class NKDropSupplyText {
  constructor() {
    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)));
  }
  static get is() { return "nk-drop-supply-text"; }
  static get encapsulation() { return "shadow"; }
  static get states() {
    return {
      "supply": {},
      "maxAmount": {}
    };
  }
}
//# sourceMappingURL=nk-drop-supply-text.js.map
