'use strict';

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

const index = require('./index-22fd9091.js');
const core = require('./core-787915c4.js');
require('./_commonjsHelpers-5cfcba41.js');
require('./index-a20d8492.js');
require('./runStore-bfd81991.js');
const index$1 = require('./index-66ca60fa.js');
const Mutations = require('./Mutations-7f7eb38b.js');

var roles;
(function (roles) {
  roles["ADMIN"] = "admin";
  roles["USER"] = "user";
})(roles || (roles = {}));
var STATUS;
(function (STATUS) {
  STATUS["PENDING"] = "PENDING";
  STATUS["VERIFIED"] = "VERIFIED";
})(STATUS || (STATUS = {}));

const VerifyComponent = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    this.verifyState = false;
  }
  async componentDidLoad() {
    const params = new URLSearchParams(location.search);
    const request = await core.coreState.client.mutate({
      mutation: index$1.src(Mutations.verifyEmailGQL),
      variables: {
        email: params.get("email"),
        token: params.get("token"),
      },
    });
    if (request.data.userVerify.status === STATUS.VERIFIED) {
      this.verifyState = true;
    }
  }
  render() {
    return (index.h(index.Host, null, index.h("corejam-box", { flex: true }, this.verifyState ? (index.h("corejam-box", { mx: "auto", flex: true, my: 50 }, index.h("corejam-base-link", { href: "/" }, index.h("corejam-type", null, "Click here to continue")), index.h("corejam-modal", { message: "Verified", type: "success" }))) : ("waiting"))));
  }
};

exports.auth_verify = VerifyComponent;
