import{c as B,a as f,l as E}from"../chunks/cL9VaPgy.js";import{i as P}from"../chunks/Dj1UN0wv.js";import{p as S,y as d,l as o,a as s,b as L,s as n,d as g,A as N,F as i,c as h,B as k,f as q,z as A,o as M,g as u}from"../chunks/C75YQU_W.js";import{v as z}from"../chunks/D1kbsK6n.js";import{r as G}from"../chunks/CblvSmSU.js";import{F as H,I as v,B as W}from"../chunks/Wy6oXzdU.js";import{g as j}from"../chunks/BpVw-oe-.js";import{g as C}from"../chunks/Cz-4yBSw.js";import{p as D}from"../chunks/Bkiwg8SD.js";a[i]="src/routes/sign-in/+page.svelte";var _=G(()=>j),J=f(h("<!> <!> <div><!></div>",1),a[i],[[33,6]]),K=f(h('<div class="grid gap.4"><h1>Sign In</h1> <!></div>'),a[i],[[10,0,[[11,2]]]]);function a(b,$){B(new.target),S($,!1,a);const y=8;P();var e=K(),I=n(g(e),2);{const w=d(a,function(t,r=k){z(...arguments);var p=J(),m=q(p);o(()=>v(m,{label:"Email",name:"email",type:"email",required:!0}),"component",a,25,6,{componentTag:"Input"});var l=n(m,2);o(()=>v(l,{label:"Password",name:"password",type:"password",required:!0,minlength:y}),"component",a,26,6,{componentTag:"Input"});var c=n(l,2),F=g(c);o(()=>W(F,{type:"submit",get loading(){return r().isLoading},children:d(a,(T,O)=>{A();var x=M("Submit");s(T,x)}),$$slots:{default:!0}}),"component",a,33,11,{componentTag:"Button"}),u(c),s(t,p)});o(()=>H(I,{class:"d.contents",onresponse:async t=>{t.result.error&&alert(t.result.error.message);const r=D.url.searchParams.get("goto");(await N(C(r??"/dashboard")))(),_(_().user=t.result.data?.user)},content:w,$$slots:{content:!0}}),"component",a,13,2,{componentTag:"Form"})}return u(e),s(b,e),L({...E()})}export{a as component};
