// Generated by ReScript, PLEASE EDIT WITH CARE

import * as Mocha from "mocha";
import * as Test_utils from "./test_utils.mjs";

let u = {
  contents: 0
};

function div(children, param) {
  for (let i = 0; i <= 1; ++i) {
    u.contents = 300;
    console.log("nonline");
  }
}

function string(s) {
  for (let i = 0; i <= 1; ++i) {
    u.contents = 200;
    console.log("no");
  }
}

function fn(authState, route) {
  let onboardingRoute;
  if (typeof authState === "object") {
    let exit = 0;
    if (typeof route === "object" && route.NAME === "Onboarding") {
      onboardingRoute = route.VAL;
    } else {
      exit = 2;
    }
    if (exit === 2) {
      console.log(authState.VAL);
      div({
        hd: string("VerifyEmail"),
        tl: /* [] */0
      }, undefined);
      return 2;
    }
  } else {
    let exit$1 = 0;
    if (typeof route === "object") {
      if (route.NAME === "Onboarding") {
        onboardingRoute = route.VAL;
      } else {
        exit$1 = 2;
      }
    } else {
      if (route === "SignUp" || route === "SignIn" || route === "Invite" || route === "PasswordReset") {
        div({
          hd: string("LoggedOut"),
          tl: /* [] */0
        }, undefined);
        return 1;
      }
      exit$1 = 2;
    }
    if (exit$1 === 2) {
      div({
        hd: string("Redirect"),
        tl: /* [] */0
      }, undefined);
      return 3;
    }
  }
  console.log(onboardingRoute);
  div({
    hd: string("Onboarding"),
    tl: /* [] */0
  }, undefined);
  return 0;
}

Mocha.describe("Gpr_4280_test", () => {
  Mocha.test("fn with Unauthenticated and Invite", () => Test_utils.eq("File \"gpr_4280_test.res\", line 41, characters 54-61", fn("Unauthenticated", "Invite"), 1));
  Mocha.test("fn with Unauthenticated and Onboarding", () => Test_utils.eq("File \"gpr_4280_test.res\", line 43, characters 7-14", fn("Unauthenticated", {
    NAME: "Onboarding",
    VAL: 0
  }), 0));
  Mocha.test("fn with Unverified and Invite", () => Test_utils.eq("File \"gpr_4280_test.res\", line 45, characters 49-56", fn({
    NAME: "Unverified",
    VAL: 0
  }, "Invite"), 2));
  Mocha.test("fn with Unauthenticated and unknown route", () => Test_utils.eq("File \"gpr_4280_test.res\", line 46, characters 61-68", fn("Unauthenticated", "xx"), 3));
});

export {
  u,
  div,
  string,
  fn,
}
/*  Not a pure module */
