vendor: 4,406 bytes, lines 1-22
1import{c as w,ag as Ne,r as s,j as e,aj as L,al as je,aL as ye,az as u,aM as V,aF as Ae,aB as c,L as R,aA as De,C as A,aI as T,aJ as f}from"./index--zqtAqW9.js";import{L as P}from"./label-CoZd5c-9.js";import{c as z,b as we,O as _e,W as Se,C as Ee,T as Ce,D as Re,a as I,R as Te,P as Pe}from"./index-BJYyUQEv.js";import{A as ke}from"./AvatarSelector-BxiFpKCu.js";import{u as Oe}from"./useVibrationTVFavicon-jyD9bRFB.js";import{L as D}from"./loader-circle-KDUPudJT.js";import{A as Me}from"./arrow-left-Dl6-yLeA.js";import{U as k}from"./user-BQm0WrAs.js";import{M as Le}from"./mail-D82HdsaX.js";import{C as Ve}from"./calendar-CME2lhyc.js";import{T as O}from"./trash-2-Dj7XdXb2.js";import"./upload-DE-Q8FNy.js";/** 2 * @license lucide-react v0.462.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const ze=w("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** 7 * @license lucide-react v0.462.0 - ISC 8 * 9 * This source code is licensed under the ISC license. 10 * See the LICENSE file in the root directory of this source tree. 11 */const Ie=w("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/** 12 * @license lucide-react v0.462.0 - ISC 13 * 14 * This source code is licensed under the ISC license. 15 * See the LICENSE file in the root directory of this source tree. 16 */const M=w("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);var $="AlertDialog",[$e,ma]=Ne($,[z]),d=z(),U=r=>{const{__scopeAlertDialog:a,...t}=r,o=d(a);return e.jsx(Te,{...o,...t,modal:!0})};U.displayName=$;var Ue="AlertDialogTrigger",F=s.forwardRef((r,a)=>{const{__scopeAlertDialog:t,...o}=r,i=d(t);return e.jsx(we,{...i,...o,ref:a})});F.displayName=Ue;var Fe="AlertDialogPortal",H=r=>{const{__scopeAlertDialog:a,...t}=r,o=d(a);return e.jsx(Pe,{...o,...t})};H.displayName=Fe;var He="AlertDialogOverlay",q=s.forwardRef((r,a)=>{const{__scopeAlertDialog:t,...o}=r,i=d(t);return e.jsx(_e,{...i,...o,ref:a})});q.displayName=He;var x="AlertDialogContent",[qe,Ge]=$e(x),Be=ye("AlertDialogContent"),G=s.forwardRef((r,a)=>{const{__scopeAlertDialog:t,children:o,...i}=r,v=d(t),g=s.useRef(null),j=L(a,g),h=s.useRef(null);return e.jsx(Se,{contentName:x,titleName:B,docsSlug:"alert-dialog",children:e.jsx(qe,{scope:t,cancelRef:h,children:e.jsxs(Ee,{role:"alertdialog",...v,...i,ref:j,onOpenAutoFocus:je(i.onOpenAutoFocus,p=>{var b;p.preventDefault(),(b=h.current)==null||b.focus({preventScroll:!0})}),onPointerDownOutside:p=>p.preventDefault(),onInteractOutside:p=>p.preventDefault(),children:[e.jsx(Be,{children:o}),e.jsx(Ye,{contentRef:g})]})})})});G.displayName=x;var B="AlertDialogTitle",W=s.forwardRef((r,a)=>{const{__scopeAlertDialog:t,...o}=r,i=d(t);return e.jsx(Ce,{...i,...o,ref:a})});W.displayName=B;var Y="AlertDialogDescription",J=s.forwardRef((r,a)=>{const{__scopeAlertDialog:t,...o}=r,i=d(t);return e.jsx(Re,{...i,...o,ref:a})});J.displayName=Y;var We="AlertDialogAction",Z=s.forwardRef((r,a)=>{const{__scopeAlertDialog:t,...o}=r,i=d(t);return e.jsx(I,{...i,...o,ref:a})});Z.displayName=We;var K="AlertDialogCancel",Q=s.forwardRef((r,a)=>{const{__scopeAlertDialog:t,...o}=r,{cancelRef:i}=Ge(K,t),v=d(t),g=L(a,i);return e.jsx(I,{...v,...o,ref:g})});Q.displayName=K;var Ye=({contentRef:r})=>{const a=`\`${x}\` requires a description for the component to be accessible for screen reader users. 17 18You can add a description to the \`${x}\` by passing a \`${Y}\` component as a child, which also benefits sighted users by adding visible context to the dialog. 19 20Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${x}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. 21 22For more information, see https://radix-ui.com/primitives/docs/components/
22alert-dialog`;return s.useEffect(()=>{var o;document.getElementById((o=r.current)==null?void 0:o.getAttribute("aria-describedby"))||console.warn(a)},[a,r]),null},Je=U,Ze=F,Ke=H,X=q,ee=G,ae=Z,re=Q,te=W,se=J;const Qe=Je,Xe=Ze,ea=Ke,oe=s.forwardRef(({className:r,...a},t)=>e.jsx(X,{className:u("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",r),...a,ref:t}));oe.displayName=X.displayName;const le=s.forwardRef(({className:r,...a},t)=>e.jsxs(ea,{children:[e.jsx(oe,{}),e.jsx(ee,{ref:t,className:u("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",r),...a})]}));le.displayName=ee.displayName;const ie=({className:r,...a})=>e.jsx("div",{className:u("flex flex-col space-y-2 text-center sm:text-left",r),...a});
22ie.displayName="AlertDialogHeader";const ne=({className:r,...a})=>e.jsx("div",{className:u("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",r),...a});ne.displayName="AlertDialogFooter";const ce=s.forwardRef(({className:r,...a},t)=>e.jsx(te,{ref:t,className:u("text-lg font-semibold",r),...a}));ce.displayName=te.displayName;const de=s.forwardRef(({className:r,...a},t)=>e.jsx(se,{ref:t,className:u("text-sm text-muted-foreground",r),...a}));de.displayName=se.displayName;const pe=s.forwardRef(({className:r,...a},t)=>e.jsx(ae,{ref:t,className:u(V(),r),...a}));pe.displayName=ae.displayName;const ue=s.forwardRef(({className:r,...a},t)=>e.jsx(re,{ref:t,className:u(V({variant:"outline"}),"mt-2 sm:mt-0",r),...a}));ue.displayName=re.displayName;const fa=()=>{Oe();const r=Ae(),[a,t]=s.useState(null),[o,i]=s.useState(null),[v,g]=s.useState(!0),[j,h]=s.useState(!1),[p,b]=s.useState(!1),[me,_]=s.useState(!1),[y,S]=s.useState(""),[N,E]=s.useState(null);s.useEffect(()=>{const{data:{subscription:l}}=c.auth.onAuthStateChange((n,m)=>{m!=null&&m.user?t(m.user):r("/vibrationtv/auth")});return c.auth.getSession().then(({data:{session:n}})=>{n!=null&&n.user?t(n.user):r("/vibrationtv/auth")}),()=>l.unsubscribe()},[r]),s.useEffect(()=>{a&&fe()},[a]);const fe=async()=>{try{const{data:l,error:n}=await c.from("profiles").select("*").eq("user_id",a.id).single();n&&n.code!=="PGRST116"&&console.error("Error fetching profile:",n),l&&(i(l),S(l.display_name||""),E(l.avatar_url||null))}catch(l){console.error("Error:",l)}finally{g(!1)}},ge=async l=>{if(!a)return null;_(!0);try{const n=l.name.split(".").pop(),m=`${a.id}/${Date.now()}.${n}`,{error:C}=await c.storage.from("avatars").upload(m,l,{upsert:!0});if(C)return f.error("Erreur lors de l'upload de l'image"),console.error("Upload error:",C),null;const{data:{publicUrl:be}}=c.storage.from("avatars").getPublicUrl(m);return be}catch(n){return console.error("Error uploading avatar:",n),f.error("Erreur lors de l'upload"),null}finally{_(!1)}},xe=async()=>{if(a){h(!0);try{const{error:l}=await c.from("profiles").update({display_name:y,avatar_url:N}).eq("user_id",a.id);l?(f.error("Erreur lors de la sauvegarde"),console.error("Error saving profile:",l)):(f.success("Profil mis à jour avec succès !"),i({...o,display_name:y,avatar_url:N}))}catch(l){console.error("Error:",l),f.error("Une erreur est survenue")}finally{h(!1)}}},ve=async()=>{if(a){b(!0);try{const{error:l}=await c.from("profiles").delete().eq("user_id",a.id);l&&console.error("Error deleting profile:",l),await c.auth.signOut(),f.success("Votre compte a été fermé. Au revoir !"),r("/vibrationtv")}catch(l){console.error("Error deleting account:",l),f.error("Erreur lors de la fermeture du compte")}finally{b(!1)}}},he=async()=>{await c.auth.signOut(),r("/vibrationtv")};return v?e.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-[#0a0a1a] via-[#12122a] to-[#0a0a1a] flex items-center justify-center relative overflow-hidden",children:[e.jsxs("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[e.jsx("div",{className:"absolute top-1/4 left-1/4 w-96 h-96 bg-purple-500/10 rounded-full blur-3xl animate-pulse"}),e.jsx("div",{className:"absolute bottom-1/4 right-1/4 w-80 h-80 bg-pink-500/10 rounded-full blur-3xl animate-pulse",style:{animationDelay:"1s"}})]}),e.jsx(D,{className:"w-10 h-10 text-purple-400 animate-spin relative z-10"})]}):e.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-[#0a0a1a] via-[#12122a] to-[#0a0a1a] text-foreground relative overflow-hidden",children:[e.jsxs("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[e.jsx("div",{className:"absolute top-1/4 left-1/4 w-96 h-96 bg-purple-500/10 rounded-full blur-3xl animate-pulse"}),e.jsx("div",{className:"absolute bottom-1/4 right-1/4 w-80 h-80 bg-pink-500/10 rounded-full blur-3xl animate-pulse",style:{animationDelay:"1s"}}),e.jsx("div",{className:"absolute top-1/2 right-1/3 w-64 h-64 bg-indigo-500/10 rounded-full blur-3xl animate-pulse",style:{animationDelay:"2s"}})]}),e.jsx("header",{className:"fixed top-0 left-0 right-0 z-50 bg-[#0a0a1a]/80 backdrop-blur-xl border-b border-purple-500/20",children:e.jsxs("div",{className:"container mx-auto px-4 py-3 flex items-center justify-between",children:[e.jsxs(R,{to:"/vibrationtv",className:"flex items-center gap-2 text-purple-300 hover:text-purple-200 transition-colors",children:[e.jsx(Me,{className:"w-5 h-5"}),e.jsx("span",{className:"text-sm",children:"Retour"})]}),e.jsxs(R,{to:"/vibrationtv",className:"flex items-center gap-3",children:[e.jsx("img",{loading:"lazy",src:De,alt:"
22VibrationTV",className:"h-10 w-10 rounded-xl object-contain drop-shadow-[0_0_20px_rgba(168,85,247,0.5)]",style:{filter:"invert(1) brightness(1.2) drop-shadow(0 0 15px rgba(168, 85, 247, 0.6))"}}),e.jsx("span",{className:"text-lg font-bold tracking-wide text-transparent bg-clip-text bg-gradient-to-r from-purple-400 via-pink-400 to-purple-400 hidden sm:inline",children:"VibrationTV"})]}),e.jsxs(A,{variant:"ghost",size:"sm",onClick:he,className:"text-purple-300 hover:text-purple-200",children:[e.jsx(ze,{className:"w-4 h-4 mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Déconnexion"})]})]})}),e.jsx("main",{className:"relative z-10 pt-24 pb-12 px-4 flex items-start justify-center min-h-screen",children:e.jsxs("div",{className:"w-full max-w-lg space-y-6",children:[e.jsxs("div",{className:"bg-gradient-to-b from-purple-900/20 to-indigo-900/20 rounded-2xl border border-purple-500/30 p-8 backdrop-blur-sm",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("div",{className:"relative w-24 h-24 mx-auto mb-4",children:N?e.jsx("img",{loading:"lazy",src:N,alt:"Avatar",className:"w-full h-full rounded-full object-cover border-4 border-purple-400"}):e.jsx("div",{className:"w-full h-full rounded-full bg-gradient-to-br from-purple-500 to-indigo-600 flex items-center justify-center border-4 border-purple-400",children:e.jsx(k,{className:"w-10 h-10 text-white"})})}),e.jsx("h1",{className:"text-2xl font-bold text-transparent bg-clip-text bg-gradient-to-r from-purple-300 to-indigo-300",children:"Mon Profil"}),e.jsx("p",{className:"text-purple-200/70 text-sm mt-1",children:"Gérez vos informations personnelles"})]}),e.jsx(ke,{selectedAvatar:N,onSelect:E,onUpload:ge,isUploading:me,className:"mb-6"}),e.jsxs("div",{className:"mb-6",children:[e.jsx(P,{htmlFor:"displayName",className:"text-purple-200 text-sm mb-2 block",children:"Nom d'affichage"}),e.jsxs("div",{className:"relative",children:[e.jsx(k,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-purple-400"}),e.jsx(T,{id:"displayName",type:"text",value:y,onChange:l=>S(l.target.value),placeholder:"Votre pseudo",className:"pl-11 bg-purple-900/20 border-purple-500/30 text-purple-100 placeholder:text-purple-400/50 focus:border-purple-400 rounded-xl py-3"})]})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx(P,{className:"text-purple-200 text-sm mb-2 block",children:"Adresse email"}),e.jsxs("div",{className:"relative",children:[e.jsx(Le,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-purple-400"}),e.jsx(T,{type:"email",value:(a==null?void 0:a.email)||"",disabled:!0,className:"pl-11 bg-purple-900/10 border-purple-500/20 text-purple-300/70 rounded-xl py-3 cursor-not-allowed"})]}),e.jsx("p",{className:"text-purple-300/50 text-xs mt-1",children:"L'email ne peut pas être modifié"})]}),e.jsx("div",{className:"mb-8 p-4 bg-purple-900/10 rounded-xl border border-purple-500/20",children:e.jsxs("div",{className:"flex items-center gap-3 text-purple-300/70 text-sm",children:[e.jsx(Ve,{className:"w-4 h-4"}),e.jsxs("span",{children:["Membre depuis le ",new Date((a==null?void 0:a.created_at)||(o==null?void 0:o.created_at)).toLocaleDateString("fr-FR",{day:"numeric",month:"long",year:"numeric"})]})]})}),e.jsx(A,{onClick:xe,disabled:j,className:"w-full bg-gradient-to-r from-purple-600 to-indigo-600 hover:from-purple-500 hover:to-indigo-500 text-white font-medium py-3 rounded-xl transition-all",children:j?e.jsx(D,{className:"w-5 h-5 animate-spin mx-auto"}):e.jsxs(e.Fragment,{children:[e.jsx(Ie,{className:"w-5 h-5 mr-2"}),"Enregistrer les modifications"]})})]}),e.jsxs("div",{className:"bg-gradient-to-b from-red-900/10 to-red-900/5 rounded-2xl border border-red-500/20 p-6 backdrop-blur-sm",children:[e.jsxs("h2",{className:"text-lg font-semibold text-red-300 mb-2 flex items-center gap-2",children:[e.jsx(M,{className:"w-5 h-5"}),"Zone de danger"]}),e.jsx("p",{className:"text-red-200/60 text-sm mb-4",children:"La fermeture de votre compte est irréversible. Toutes vos données seront supprimées."}),e.jsxs(Qe,{children:[e.jsx(Xe,{asChild:!0,children:e.jsxs(A,{variant:"outline",className:"w-full border-red-500/30 text-red-300 hover:bg-red-500/10 hover:text-red-200 hover:border-red-500/50",children:[e.jsx(O,{className:"w-4 h-4 mr-2"}),"Fermer mon compte"]})}),e.jsxs(le,{className:"bg-[#0a0a1a] border-red-500/30",children:[e.jsxs(ie,{children:[e.jsxs(ce,{className:"text-red-300 flex items-center gap-2",children:[e.jsx(M,{className:"w-5 h-5"}),"Fermer votre compte ?"]}),e.jsx(de,{className:"text-purple-200/70",children:"Cette action est irréversible. Votre profil et toutes vos données seront définitivement supprimés. Vous ne pourrez pas récupérer votre compte."})]}),e.jsxs(ne,{children:[e.jsx(ue,{className:"bg-purple-900/20 border-purple-500/30 text-purple-200 hover:bg-purple-900/40",children:"Annuler"}),e.jsxs(pe,{onClick:ve,disabled:p,className:"bg-red-600 hover:bg-red-700 text-white",children:[p?e.jsx(D,{className:"w-4 h-4 animate-spin mr-2"}):e.jsx(O,{className:"w-4 h-4 mr-2"}),"Oui, fermer mon compte"]})]})]})]})]})]})})]})};export{fa as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.