UNPKG

manifest

Version:

Self-hosted Manifest LLM router with embedded server, SQLite database, and dashboard

2 lines (1 loc) 3.33 kB
import{a as n,D as A,e as F,g as r,T as q,M as W,S as f,i,m,h as d,A as R,t as s,d as B}from"./vendor-C-Y5oNOq.js";import{S as U}from"./SocialButtons-DudwEJ6b.js";import{u as j,s as x}from"./index-C4Qw7vZo.js";import"./auth-CU91cd7V.js";var z=s("<div class=auth-header><h1 class=auth-header__title>Connecting...</h1><p class=auth-header__subtitle>Setting up your local session"),G=s("<div class=auth-header><h1 class=auth-header__title>Welcome back</h1><p class=auth-header__subtitle>Take control of your OpenClaw costs"),H=s("<div class=auth-divider><span class=auth-divider__text>or"),J=s("<button type=button class=auth-form__link-btn>"),K=s('<form class=auth-form><label class=auth-form__label>Email<input class=auth-form__input type=email placeholder=you@example.com required></label><label class=auth-form__label>Password<input class=auth-form__input type=password placeholder="Enter your password"required></label><div class=auth-form__actions></div><button class=auth-form__submit type=submit>'),Q=s("<div class=auth-footer><span>Don't have an account? "),X=s("<div class=auth-form__error role=alert>"),Y=s("<span class=spinner>");const Z=60,se=()=>{const[h,I]=n(""),[_,D]=n(""),[p,l]=n(""),[g,v]=n(!1),[M,$]=n(!1),[o,b]=n(0),[w,S]=n(!1),[O]=A();F(async()=>{if(O.error&&l("Login failed. Please try again or use a different method."),await j()){S(!0);try{if((await fetch("/api/auth/local-session",{credentials:"include"})).ok){window.location.href="/";return}}catch{}S(!1)}});const P=()=>{b(Z);const e=setInterval(()=>{b(t=>t<=1?(clearInterval(e),0):t-1)},1e3)},T=async e=>{e.preventDefault(),l(""),$(!1),v(!0);const{error:t}=await x.signIn.email({email:h(),password:_()});if(v(!1),t){const c=t.message??"";if(c.toLowerCase().includes("email is not verified")||t.code==="EMAIL_NOT_VERIFIED"){$(!0),l("Please verify your email before signing in.");return}l(c||"Invalid email or password");return}window.location.href="/"},V=async()=>{if(o()>0)return;const{error:e}=await x.sendVerificationEmail({email:h(),callbackURL:"/"});if(e){l(e.message??"Failed to resend verification email");return}P(),l("Verification email sent! Check your inbox.")};return[r(q,{children:"Sign In - Manifest"}),r(W,{name:"description",content:"Sign in to Manifest to monitor your AI agents."}),r(f,{get when(){return w()},get children(){return z()}}),r(f,{get when(){return!w()},get children(){return[G(),r(U,{}),H(),(()=>{var e=K(),t=e.firstChild,c=t.firstChild,y=c.nextSibling,E=t.nextSibling,N=E.firstChild,C=N.nextSibling,k=E.nextSibling,L=k.nextSibling;return e.addEventListener("submit",T),i(e,(()=>{var a=m(()=>!!p());return()=>a()&&(()=>{var u=X();return i(u,p),u})()})(),t),i(e,r(f,{get when(){return M()},get children(){var a=J();return a.$$click=V,i(a,(()=>{var u=m(()=>o()>0);return()=>u()?`Resend in ${o()}s`:"Resend verification email"})()),d(()=>a.disabled=o()>0),a}}),t),y.$$input=a=>I(a.currentTarget.value),C.$$input=a=>D(a.currentTarget.value),i(k,r(R,{href:"/reset-password",class:"auth-form__forgot",children:"Forgot password?"})),i(L,(()=>{var a=m(()=>!!g());return()=>a()?Y():"Sign in"})()),d(()=>L.disabled=g()),d(()=>y.value=h()),d(()=>C.value=_()),e})(),(()=>{var e=Q();return e.firstChild,i(e,r(R,{href:"/register",class:"auth-footer__link",children:"Sign up"}),null),e})()]}})]};B(["click","input"]);export{se as default};