import {
  ApiKeysTable,
  sortApiKeys
} from "/build/_shared/chunk-FXDK75EI.js";
import "/build/_shared/chunk-B7SHUSBW.js";
import {
  Alert,
  AlertDescription
} from "/build/_shared/chunk-MRTBCHPK.js";
import {
  RSHTheme,
  prism_async_default
} from "/build/_shared/chunk-VUTUXWPD.js";
import "/build/_shared/chunk-5DGBJUUY.js";
import {
  PageDocLink
} from "/build/_shared/chunk-T75MUU5G.js";
import {
  Dialog,
  DialogContent,
  DialogHeader,
  DialogTitle,
  DialogTrigger
} from "/build/_shared/chunk-WUQHNDXA.js";
import "/build/_shared/chunk-SC7ILUKJ.js";
import "/build/_shared/chunk-O67VWZBP.js";
import {
  Button
} from "/build/_shared/chunk-UWBTKPLD.js";
import "/build/_shared/chunk-SMFRBP2T.js";
import {
  PageSubtitle
} from "/build/_shared/chunk-VV3RU6RL.js";
import "/build/_shared/chunk-4R7ODGQQ.js";
import "/build/_shared/chunk-A4I3UNHM.js";
import "/build/_shared/chunk-ERWYPUCA.js";
import "/build/_shared/chunk-P3C75TI5.js";
import {
  PageLayout
} from "/build/_shared/chunk-BXT5AGPN.js";
import "/build/_shared/chunk-5YPGPC4O.js";
import "/build/_shared/chunk-7K73PJIB.js";
import {
  AlertTriangle,
  BookOpen,
  KeyRound,
  LayoutDashboard
} from "/build/_shared/chunk-EJE2TVVM.js";
import "/build/_shared/chunk-LGQ4GCFK.js";
import "/build/_shared/chunk-B7TG3BDD.js";
import "/build/_shared/chunk-7NMI3PDC.js";
import "/build/_shared/chunk-AI5FD5Y6.js";
import {
  withAuth
} from "/build/_shared/chunk-NHF4CNMF.js";
import "/build/_shared/chunk-KQKP3VNY.js";
import {
  require_clerk
} from "/build/_shared/chunk-RKIEMES6.js";
import {
  Link,
  init_esm2 as init_esm,
  useFetcher,
  useParams
} from "/build/_shared/chunk-ZC2TL3GZ.js";
import {
  require_jsx_dev_runtime
} from "/build/_shared/chunk-ED7KKCRB.js";
import "/build/_shared/chunk-RYE6BCZB.js";
import "/build/_shared/chunk-PECDPABK.js";
import "/build/_shared/chunk-G7CHZRZX.js";
import "/build/_shared/chunk-TLLKLDIT.js";
import {
  Routes
} from "/build/_shared/chunk-N27UEDHN.js";
import {
  createHotContext,
  init_remix_hmr
} from "/build/_shared/chunk-G7KTOMTD.js";
import "/build/_shared/chunk-ZIPKILLR.js";
import {
  __toESM
} from "/build/_shared/chunk-PNG5AS42.js";

// app/routes/app+/project+/$projectId+/env+/$envId+/onboarding.tsx
init_remix_hmr();

// app/pages/onboarding/OnboardingPage.tsx
init_remix_hmr();
init_esm();

// app/components/dialogs/ApiKeys/ApiKeysDialogContent.tsx
init_remix_hmr();
var import_jsx_dev_runtime = __toESM(require_jsx_dev_runtime(), 1);
if (!window.$RefreshReg$ || !window.$RefreshSig$ || !window.$RefreshRuntime$) {
  console.warn("remix:hmr: React Fast Refresh only works when the Remix compiler is running in development mode.");
} else {
  prevRefreshReg = window.$RefreshReg$;
  prevRefreshSig = window.$RefreshSig$;
  window.$RefreshReg$ = (type, id) => {
    window.$RefreshRuntime$.register(type, '"app/components/dialogs/ApiKeys/ApiKeysDialogContent.tsx"' + id);
  };
  window.$RefreshSig$ = window.$RefreshRuntime$.createSignatureFunctionForTransform;
}
var prevRefreshReg;
var prevRefreshSig;
if (import.meta) {
  import.meta.hot = createHotContext(
    //@ts-expect-error
    "app/components/dialogs/ApiKeys/ApiKeysDialogContent.tsx"
  );
  import.meta.hot.lastModified = "1713199469911.649";
}
var ApiKeysDialogContent = (props) => {
  return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(DialogContent, { className: "min-w-[600px]", children: [
    /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(DialogHeader, { children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(DialogTitle, { children: "API Keys" }, void 0, false, {
      fileName: "app/components/dialogs/ApiKeys/ApiKeysDialogContent.tsx",
      lineNumber: 28,
      columnNumber: 9
    }, this) }, void 0, false, {
      fileName: "app/components/dialogs/ApiKeys/ApiKeysDialogContent.tsx",
      lineNumber: 27,
      columnNumber: 7
    }, this),
    /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { children: [
      /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(Alert, { variant: "destructive", className: "mb-4", children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(AlertDescription, { children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: "text-destructive-foreground flex flex-row items-center gap-4", children: [
        /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(AlertTriangle, {}, void 0, false, {
          fileName: "app/components/dialogs/ApiKeys/ApiKeysDialogContent.tsx",
          lineNumber: 34,
          columnNumber: 15
        }, this),
        "API keys are only revealed once and will be hidden after."
      ] }, void 0, true, {
        fileName: "app/components/dialogs/ApiKeys/ApiKeysDialogContent.tsx",
        lineNumber: 33,
        columnNumber: 13
      }, this) }, void 0, false, {
        fileName: "app/components/dialogs/ApiKeys/ApiKeysDialogContent.tsx",
        lineNumber: 32,
        columnNumber: 11
      }, this) }, void 0, false, {
        fileName: "app/components/dialogs/ApiKeys/ApiKeysDialogContent.tsx",
        lineNumber: 31,
        columnNumber: 9
      }, this),
      /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(ApiKeysTable, { ...props }, void 0, false, {
        fileName: "app/components/dialogs/ApiKeys/ApiKeysDialogContent.tsx",
        lineNumber: 39,
        columnNumber: 9
      }, this)
    ] }, void 0, true, {
      fileName: "app/components/dialogs/ApiKeys/ApiKeysDialogContent.tsx",
      lineNumber: 30,
      columnNumber: 7
    }, this)
  ] }, void 0, true, {
    fileName: "app/components/dialogs/ApiKeys/ApiKeysDialogContent.tsx",
    lineNumber: 26,
    columnNumber: 10
  }, this);
};
_c = ApiKeysDialogContent;
var _c;
$RefreshReg$(_c, "ApiKeysDialogContent");
window.$RefreshReg$ = prevRefreshReg;
window.$RefreshSig$ = prevRefreshSig;

// app/pages/onboarding/constants.ts
init_remix_hmr();
if (import.meta) {
  import.meta.hot = createHotContext(
    //@ts-expect-error
    "app/pages/onboarding/constants.ts"
  );
  import.meta.hot.lastModified = "1711510404933.6614";
}
var MONTELO_CODE_SNIPPET = `import { Montelo } from "montelo";

const montelo = new Montelo();

await montelo.openai.chat.completions.create({
    model: "gpt-4",
    messages: [
      {
        role: "system",
        content: "You are a helpful assistant.",
      },
      {
        role: "user",
        content: "What is the meaning of life?",
      },
    ]
});
`;
var ENV_SNIPPET = `MONTELO_API_KEY=your-api-key
OPENAI_API_KEY=your-openai-api-key`;

// app/pages/onboarding/OnboardingPage.tsx
var import_jsx_dev_runtime2 = __toESM(require_jsx_dev_runtime(), 1);
if (!window.$RefreshReg$ || !window.$RefreshSig$ || !window.$RefreshRuntime$) {
  console.warn("remix:hmr: React Fast Refresh only works when the Remix compiler is running in development mode.");
} else {
  prevRefreshReg = window.$RefreshReg$;
  prevRefreshSig = window.$RefreshSig$;
  window.$RefreshReg$ = (type, id) => {
    window.$RefreshRuntime$.register(type, '"app/pages/onboarding/OnboardingPage.tsx"' + id);
  };
  window.$RefreshSig$ = window.$RefreshRuntime$.createSignatureFunctionForTransform;
}
var prevRefreshReg;
var prevRefreshSig;
var _s = $RefreshSig$();
if (import.meta) {
  import.meta.hot = createHotContext(
    //@ts-expect-error
    "app/pages/onboarding/OnboardingPage.tsx"
  );
  import.meta.hot.lastModified = "1713199469914.4482";
}
var breadcrumbs = [{
  label: "Onboarding"
}];
var subtitle = () => /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(PageSubtitle, { children: [
  "Getting started with Montelo! ",
  /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(PageDocLink, { to: Routes.external.docs.quickstart, children: "Quickstart Docs." }, void 0, false, {
    fileName: "app/pages/onboarding/OnboardingPage.tsx",
    lineNumber: 39,
    columnNumber: 35
  }, this)
] }, void 0, true, {
  fileName: "app/pages/onboarding/OnboardingPage.tsx",
  lineNumber: 38,
  columnNumber: 24
}, this);
var StepComponent = ({
  step,
  children,
  isLast,
  title
}) => {
  const lastStepStyling = isLast ? "text-2xl" : "bg-slate-200 dark:bg-slate-800 text-sm";
  return /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)("div", { className: "flex min-h-10", children: [
    /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)("div", { className: "mr-4 flex max-w-6 flex-1 flex-col items-center gap-3", children: [
      /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)("div", { className: `flex h-6 w-6 items-center justify-center rounded-xl ${lastStepStyling}`, children: isLast ? "\u{1F389}" : step }, void 0, false, {
        fileName: "app/pages/onboarding/OnboardingPage.tsx",
        lineNumber: 50,
        columnNumber: 9
      }, this),
      !isLast && /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)("div", { className: "h-full w-[1px] flex-1 bg-slate-200 dark:bg-slate-800" }, void 0, false, {
        fileName: "app/pages/onboarding/OnboardingPage.tsx",
        lineNumber: 53,
        columnNumber: 21
      }, this)
    ] }, void 0, true, {
      fileName: "app/pages/onboarding/OnboardingPage.tsx",
      lineNumber: 49,
      columnNumber: 7
    }, this),
    /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)("div", { className: "-mt-[2px] flex flex-1 flex-col gap-2 pb-5", children: [
      /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)("h1", { className: "font-semibold", children: title }, void 0, false, {
        fileName: "app/pages/onboarding/OnboardingPage.tsx",
        lineNumber: 56,
        columnNumber: 9
      }, this),
      /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)("div", { className: "text-muted-foreground flex flex-col gap-1 text-sm", children }, void 0, false, {
        fileName: "app/pages/onboarding/OnboardingPage.tsx",
        lineNumber: 57,
        columnNumber: 9
      }, this)
    ] }, void 0, true, {
      fileName: "app/pages/onboarding/OnboardingPage.tsx",
      lineNumber: 55,
      columnNumber: 7
    }, this)
  ] }, void 0, true, {
    fileName: "app/pages/onboarding/OnboardingPage.tsx",
    lineNumber: 48,
    columnNumber: 10
  }, this);
};
_c2 = StepComponent;
var OnboardingPage = () => {
  _s();
  const fetcher = useFetcher();
  const params = useParams();
  const projectId = params.projectId;
  const envId = params.envId;
  const prefetchApiKeys = () => fetcher.load(Routes.app.project.env.apiKeys({
    projectId,
    envId
  }));
  const sortedEnvironments = sortApiKeys(fetcher.data || []);
  return /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(PageLayout, { breadcrumbs, subtitle, children: /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)("div", { className: "flex flex-col gap-3 p-6", children: [
    /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(StepComponent, { step: 1, title: "Get your API Keys", children: [
      /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)("p", { children: "Reveal and copy your API keys:" }, void 0, false, {
        fileName: "app/pages/onboarding/OnboardingPage.tsx",
        lineNumber: 76,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(Dialog, { children: [
        /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(DialogTrigger, { asChild: true, onMouseEnter: prefetchApiKeys, children: /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(Button, { variant: "outline", className: "my-2 flex w-40 gap-2", children: [
          /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(KeyRound, { className: "text-muted-foreground h-4 w-4" }, void 0, false, {
            fileName: "app/pages/onboarding/OnboardingPage.tsx",
            lineNumber: 81,
            columnNumber: 17
          }, this),
          "Get API Keys"
        ] }, void 0, true, {
          fileName: "app/pages/onboarding/OnboardingPage.tsx",
          lineNumber: 80,
          columnNumber: 15
        }, this) }, void 0, false, {
          fileName: "app/pages/onboarding/OnboardingPage.tsx",
          lineNumber: 79,
          columnNumber: 13
        }, this),
        /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(ApiKeysDialogContent, { sortedEnvironments, projectId }, void 0, false, {
          fileName: "app/pages/onboarding/OnboardingPage.tsx",
          lineNumber: 85,
          columnNumber: 13
        }, this)
      ] }, void 0, true, {
        fileName: "app/pages/onboarding/OnboardingPage.tsx",
        lineNumber: 78,
        columnNumber: 11
      }, this)
    ] }, void 0, true, {
      fileName: "app/pages/onboarding/OnboardingPage.tsx",
      lineNumber: 75,
      columnNumber: 9
    }, this),
    /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(StepComponent, { step: 2, title: "Install the SDK", children: [
      "Install the montelo SDK using npm in your project directory:",
      /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(prism_async_default, { style: RSHTheme, language: "shell", children: "$ npm install montelo" }, void 0, false, {
        fileName: "app/pages/onboarding/OnboardingPage.tsx",
        lineNumber: 91,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)("code", {}, void 0, false, {
        fileName: "app/pages/onboarding/OnboardingPage.tsx",
        lineNumber: 94,
        columnNumber: 11
      }, this)
    ] }, void 0, true, {
      fileName: "app/pages/onboarding/OnboardingPage.tsx",
      lineNumber: 89,
      columnNumber: 9
    }, this),
    /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(StepComponent, { step: 3, title: "Create Env File", children: [
      "Create a .env file in the root of your project:",
      /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(prism_async_default, { style: RSHTheme, language: "shell", children: ENV_SNIPPET }, void 0, false, {
        fileName: "app/pages/onboarding/OnboardingPage.tsx",
        lineNumber: 99,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)("code", {}, void 0, false, {
        fileName: "app/pages/onboarding/OnboardingPage.tsx",
        lineNumber: 102,
        columnNumber: 11
      }, this)
    ] }, void 0, true, {
      fileName: "app/pages/onboarding/OnboardingPage.tsx",
      lineNumber: 97,
      columnNumber: 9
    }, this),
    /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(StepComponent, { step: 4, isLast: true, title: "Start using Montelo!", children: /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)("p", { children: [
      "Initialise your montelo client and start logging to Montelo!",
      /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(prism_async_default, { style: RSHTheme, language: "typescript", children: MONTELO_CODE_SNIPPET }, void 0, false, {
        fileName: "app/pages/onboarding/OnboardingPage.tsx",
        lineNumber: 108,
        columnNumber: 13
      }, this)
    ] }, void 0, true, {
      fileName: "app/pages/onboarding/OnboardingPage.tsx",
      lineNumber: 106,
      columnNumber: 11
    }, this) }, void 0, false, {
      fileName: "app/pages/onboarding/OnboardingPage.tsx",
      lineNumber: 105,
      columnNumber: 9
    }, this),
    /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)("div", { className: "flex w-full justify-center gap-4", children: [
      /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(Link, { to: Routes.external.docs.quickstart, children: /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(Button, { variant: "outline", size: "lg", className: "flex h-10 w-60 gap-3", children: [
        /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(BookOpen, { size: 20 }, void 0, false, {
          fileName: "app/pages/onboarding/OnboardingPage.tsx",
          lineNumber: 117,
          columnNumber: 15
        }, this),
        "Read Documentation"
      ] }, void 0, true, {
        fileName: "app/pages/onboarding/OnboardingPage.tsx",
        lineNumber: 116,
        columnNumber: 13
      }, this) }, void 0, false, {
        fileName: "app/pages/onboarding/OnboardingPage.tsx",
        lineNumber: 115,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(Link, { to: Routes.app.project.env.dashboard({
        projectId,
        envId
      }), children: /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(Button, { variant: "default", size: "lg", className: "flex h-10 w-60 gap-3", children: [
        /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(LayoutDashboard, { size: 20 }, void 0, false, {
          fileName: "app/pages/onboarding/OnboardingPage.tsx",
          lineNumber: 126,
          columnNumber: 15
        }, this),
        "Go to Dashboard"
      ] }, void 0, true, {
        fileName: "app/pages/onboarding/OnboardingPage.tsx",
        lineNumber: 125,
        columnNumber: 13
      }, this) }, void 0, false, {
        fileName: "app/pages/onboarding/OnboardingPage.tsx",
        lineNumber: 121,
        columnNumber: 11
      }, this)
    ] }, void 0, true, {
      fileName: "app/pages/onboarding/OnboardingPage.tsx",
      lineNumber: 114,
      columnNumber: 9
    }, this)
  ] }, void 0, true, {
    fileName: "app/pages/onboarding/OnboardingPage.tsx",
    lineNumber: 74,
    columnNumber: 7
  }, this) }, void 0, false, {
    fileName: "app/pages/onboarding/OnboardingPage.tsx",
    lineNumber: 73,
    columnNumber: 10
  }, this);
};
_s(OnboardingPage, "j+Zrd270EJOh0JWbUZV/X71C+zI=", false, function() {
  return [useFetcher, useParams];
});
_c22 = OnboardingPage;
var _c2;
var _c22;
$RefreshReg$(_c2, "StepComponent");
$RefreshReg$(_c22, "OnboardingPage");
window.$RefreshReg$ = prevRefreshReg;
window.$RefreshSig$ = prevRefreshSig;

// app/routes/app+/project+/$projectId+/env+/$envId+/onboarding.tsx
var import_clerk = __toESM(require_clerk(), 1);
var import_jsx_dev_runtime3 = __toESM(require_jsx_dev_runtime(), 1);
if (!window.$RefreshReg$ || !window.$RefreshSig$ || !window.$RefreshRuntime$) {
  console.warn("remix:hmr: React Fast Refresh only works when the Remix compiler is running in development mode.");
} else {
  prevRefreshReg = window.$RefreshReg$;
  prevRefreshSig = window.$RefreshSig$;
  window.$RefreshReg$ = (type, id) => {
    window.$RefreshRuntime$.register(type, '"app/routes/app+/project+/$projectId+/env+/$envId+/onboarding.tsx"' + id);
  };
  window.$RefreshSig$ = window.$RefreshRuntime$.createSignatureFunctionForTransform;
}
var prevRefreshReg;
var prevRefreshSig;
if (import.meta) {
  import.meta.hot = createHotContext(
    //@ts-expect-error
    "app/routes/app+/project+/$projectId+/env+/$envId+/onboarding.tsx"
  );
  import.meta.hot.lastModified = "1711510404934.0525";
}
var loader = withAuth(async ({
  userId
}) => {
  await import_clerk.clerkClient.users.updateUserMetadata(userId, {
    publicMetadata: {
      hasOnboarded: true
    }
  });
  return {};
});
function OnboardingRoute() {
  return /* @__PURE__ */ (0, import_jsx_dev_runtime3.jsxDEV)(OnboardingPage, {}, void 0, false, {
    fileName: "app/routes/app+/project+/$projectId+/env+/$envId+/onboarding.tsx",
    lineNumber: 36,
    columnNumber: 10
  }, this);
}
_c3 = OnboardingRoute;
var _c3;
$RefreshReg$(_c3, "OnboardingRoute");
window.$RefreshReg$ = prevRefreshReg;
window.$RefreshSig$ = prevRefreshSig;
export {
  OnboardingRoute as default
};
//# sourceMappingURL=/build/routes/app+/project+/$projectId+/env+/$envId+/onboarding-UXBR6R4Z.js.map
