2 lines
2.9 KiB
JavaScript
2 lines
2.9 KiB
JavaScript
import{s as M,n as D,r as q}from"../chunks/DHedsUi_.js";import{S as z,i as B,d as v,z as w,a as V,b as c,r as x,u as d,c as h,e as I,v as N,g as C,h as m,j as E,s as H,f as L,t as O}from"../chunks/G8UKEBBn.js";import{g as A}from"../chunks/6cgBTYw-.js";import{a as F,b as G,c as J}from"../chunks/DjUyxgK6.js";function S(n){let s,e;return{c(){s=m("p"),e=O(n[2]),this.h()},l(t){s=h(t,"P",{class:!0});var l=I(s);e=L(l,n[2]),l.forEach(v),this.h()},h(){d(s,"class","text-red-500 text-sm mb-4")},m(t,l){V(t,s,l),c(s,e)},p(t,l){l&4&&H(e,t[2])},d(t){t&&v(s)}}}function K(n){let s,e,t,l="🏠 Mes Locations",g,b,i,u,k,r,T,p,U="Se connecter",P,j,a=n[2]&&S(n);return{c(){s=m("div"),e=m("div"),t=m("h1"),t.textContent=l,g=E(),a&&a.c(),b=E(),i=m("div"),u=m("input"),k=E(),r=m("input"),T=E(),p=m("button"),p.textContent=U,this.h()},l(o){s=h(o,"DIV",{class:!0});var f=I(s);e=h(f,"DIV",{class:!0});var y=I(e);t=h(y,"H1",{class:!0,"data-svelte-h":!0}),N(t)!=="svelte-b0jrt"&&(t.textContent=l),g=C(y),a&&a.l(y),b=C(y),i=h(y,"DIV",{class:!0});var _=I(i);u=h(_,"INPUT",{type:!0,placeholder:!0,class:!0}),k=C(_),r=h(_,"INPUT",{type:!0,placeholder:!0,class:!0}),T=C(_),p=h(_,"BUTTON",{class:!0,"data-svelte-h":!0}),N(p)!=="svelte-frpi80"&&(p.textContent=U),_.forEach(v),y.forEach(v),f.forEach(v),this.h()},h(){d(t,"class","text-xl font-semibold text-gray-900 dark:text-white mb-6"),d(u,"type","email"),d(u,"placeholder","Email"),d(u,"class","w-full px-4 py-2.5 rounded-lg border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-900 dark:text-white text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"),d(r,"type","password"),d(r,"placeholder","Mot de passe"),d(r,"class","w-full px-4 py-2.5 rounded-lg border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-900 dark:text-white text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"),d(p,"class","w-full py-2.5 bg-blue-600 hover:bg-blue-700 text-white rounded-lg text-sm font-medium transition-colors"),d(i,"class","space-y-4"),d(e,"class","bg-white dark:bg-gray-900 rounded-2xl p-8 w-full max-w-sm border border-gray-100 dark:border-gray-800 shadow-sm"),d(s,"class","min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-950")},m(o,f){V(o,s,f),c(s,e),c(e,t),c(e,g),a&&a.m(e,null),c(e,b),c(e,i),c(i,u),w(u,n[0]),c(i,k),c(i,r),w(r,n[1]),c(i,T),c(i,p),P||(j=[x(u,"input",n[4]),x(r,"input",n[5]),x(r,"keydown",n[6]),x(p,"click",n[3])],P=!0)},p(o,[f]){o[2]?a?a.p(o,f):(a=S(o),a.c(),a.m(e,b)):a&&(a.d(1),a=null),f&1&&u.value!==o[0]&&w(u,o[0]),f&2&&r.value!==o[1]&&w(r,o[1])},i:D,o:D,d(o){o&&v(s),a&&a.d(),P=!1,q(j)}}}function Q(n,s,e){let t="",l="",g="";async function b(){e(2,g="");try{const r=await F.auth.login(t,l);G.set(r.token),J.set(r.user),A("/")}catch(r){e(2,g=r.message)}}function i(){t=this.value,e(0,t)}function u(){l=this.value,e(1,l)}return[t,l,g,b,i,u,r=>r.key==="Enter"&&b()]}class Z extends z{constructor(s){super(),B(this,s,Q,K,M,{})}}export{Z as component};
|