PageSourceSearch

https://vedality.com/assets/_app.profile-B3Jxj0Gn.js

js vedality.com collected 2026-10-09 22:05:19 UTC 14,443 bytes, 1 lines download raw bytes

1import{c as $,g as K,f as U,a as W,d as D,e as Z,t as p,j as e,m as L,r as E,L as k,s as J}from"./index-OIRguTWT.js";import{u as M}from"./useServerFn-DTmIZFLO.js";import{u as X}from"./useQuery-CFYhQznS.js";import{u as Y}from"./useMutation-BqyOi9SV.js";import{g as ee}from"./dashboard.functions-CldvK411.js";import{u as te,a as re}from"./use-premium-BBHWdwV9.js";import{P as se}from"./PageHeader-GuJZNj_m.js";import{S as oe}from"./SoftToggle-CP_pXaSI.js";import{F as S}from"./flame-CBOUHxVx.js";import{C as ae}from"./calendar-BmdkKyDw.js";import{H as ne}from"./heart-B_7zjmqa.js";import{M as ie}from"./message-circle-heart-DCCceNdC.js";import{T as le}from"./trophy-Dxlk2Fwj.js";import{A as ce}from"./award-sdkYHsKH.js";import{S as de}from"./star-CONVlzgA.js";import{B as me}from"./bell-Cu0CIP6Y.js";import{M as ue}from"./moon-BMyGwnQi.js";import{S as fe}from"./shield-CZuLjlFJ.js";import{D as xe}from"./download-D1BOIMXb.js";import{M as pe}from"./mail-BlEESnld.js";import{C as he}from"./circle-question-mark-CfK9l8Wn.js";import{T as ge}from"./trash-2-CM64ZWGv.js";import{G as be}from"./globe-SnaMAe-A.js";import{C as ye}from"./crown-DklN4l83.js";import{S as je}from"./sparkles-CkuCXKhi.js";import{L as ve}from"./loader-circle-CB7NM_iO.js";import{C as Ne}from"./chevron-right-CHkZIaJx.js";import"./auth-middleware-B98IHj6h.js";import"./chevron-left-DSXwkzGu.js";const we=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],ke=$("key-round",we);const Se=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Ce=$("log-out",Se),b=["from-[oklch(0.82_0.1_15)] to-[oklch(0.7_0.14_330)]","from-[oklch(0.82_0.1_30)] to-[oklch(0.65_0.16_15)]","from-[oklch(0.82_0.1_320)] to-[oklch(0.65_0.14_295)]","from-[oklch(0.82_0.1_180)] to-[oklch(0.6_0.14_220)]","from-[oklch(0.82_0.1_295)] to-[oklch(0.6_0.16_270)]","from-[oklch(0.85_0.09_60)] to-[oklch(0.6_0.16_30)]"],P=[ne,S,ie,le,ce,de];function _e(s){return s.toLocaleString()}function f({label:s,children:i}){return e.jsxs("section",{className:"px-5 pt-8",children:[e.jsx("p",{className:"text-[10px] font-medium uppercase tracking-[0.22em] text-primary/70",children:s}),e.jsx("div",{className:"mt-3 space-y-2",children:i})]})}function Ae(){const{lang:s,setLang:i,t:n}=D(),l=o=>{i(o),p.success(n("toast.langSaved"))};return e.jsxs("div",{className:"flex items-center justify-between rounded-2xl border border-border/60 bg-card p-4 shadow-soft",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-xl bg-lavender-soft",children:e.jsx(be,{className:"h-4 w-4 text-primary"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:n("profile.language")}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:s==="fr"?"Français":"English (US)"})]})]}),e.jsx("div",{className:"flex gap-1 rounded-full bg-muted p-0.5",children:["en","fr"].map(o=>e.jsx("button",{onClick:()=>l(o),className:`press rounded-full px-3 py-1 text-[11px] font-medium transition ${s===o?"bg-card text-foreground shadow-soft":"text-muted-foreground"}`,children:o==="en"?"EN":"FR"},o))})]})}function x({icon:s,label:i,sub:n,to:l,href:o,right:t,danger:u,onClick:c}){const a=e.jsxs("div",{className:"flex items-center justify-between rounded-2xl border border-border/60 bg-card p-4 shadow-soft",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`flex h-10 w-10 items-center justify-center rounded-xl ${u?"bg-destructive/10":"bg-lavender-soft"}`,children:e.jsx(s,{className:`h-4 w-4 ${u?"text-destructive":"text-primary"}`})}),e.jsxs("div",{children:[e.jsx("p",{className:`text-sm font-semibold ${u?"text-destructive":"text-foreground"}`,children:i}),n&&e.jsx("p",{className:"text-xs text-muted-foreground",children:n})]})]}),t??((l||o)&&e.jsx(Ne,{className:"h-4 w-4 text-muted-foreground"}))]});return l?e.jsx(k,{to:l,children:a}):o?e.jsx("a",{href:o,className:"block",target:"_blank",rel:"noopener noreferrer",children:a}):c?e.jsx("button",{type:"button",onClick:c,className:"w-full text-left",children:a}):a}function Le(){const[s,i]=E.useState(typeof window<"u"&&document.documentElement.classList.contains("dark"));return E.useEffect(()=>{if(!(typeof window>"u")){document.documentElement.classList.toggle("dark",s),document.documentElement.style.colorScheme=s?"dark":"light";
1try{localStorage.setItem("solace-theme",s?"dark":"light")}catch{}}},[s]),[s,i]}function T(s){if(!s)return null;try{return new Date(s).toLocaleDateString("fr-FR",{day:"numeric",month:"long",year:"numeric"})}catch{return null}}function Ee({premium:s,onCancel:i,canceling:n}){const{isLoading:l,plan:o,status:t,daysLeftInTrial:u,currentPeriodEnd:c,cancelAtPeriodEnd:a}=s,y=o==="yearly"?"Vedality+ · Annuel":o==="monthly"?"Vedality+ · Mensuel":o==="lifetime"?"Vedality+ · À vie":"Gratuit",j=(()=>{if(l)return"…";if(t==="trialing"){const g=u??0;return`Essai actif · ${g} ${g===1?"jour restant":"jours restants"}`}return t==="active"?a&&c?`Se termine le ${T(c)}`:c?`Renouvellement le ${T(c)}`:"Actif":t==="past_due"?"Paiement en attente":t==="canceled"?"Annulé":"Aucun abonnement actif"})(),v=!l&&(t==="active"||t==="trialing")&&o!=="free"&&o!=="lifetime"&&!a;return e.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card p-4 shadow-soft",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-xl bg-gradient-hero shadow-glow",children:e.jsx(ye,{className:"h-4 w-4 text-white"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:y}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:j})]})]}),e.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:o==="free"||t==="canceled"?e.jsxs(k,{to:"/premium",className:"flex flex-1 items-center justify-center gap-1.5 rounded-xl bg-gradient-hero py-2.5 text-[12px] font-medium text-white shadow-glow",children:[e.jsx(je,{className:"h-3.5 w-3.5"})," Passer à Vedality+"]}):e.jsxs(e.Fragment,{children:[e.jsx(k,{to:"/subscription",className:"flex flex-1 items-center justify-center rounded-xl border border-border/60 bg-background py-2.5 text-[12px] font-medium text-foreground",children:"Gérer mon abonnement"}),v&&e.jsxs("button",{type:"button",onClick:i,disabled:n,className:"flex flex-1 items-center justify-center gap-1.5 rounded-xl border border-destructive/40 bg-destructive/5 py-2.5 text-[12px] font-medium text-destructive disabled:opacity-60",children:[n?e.jsx(ve,{className:"h-3.5 w-3.5 animate-spin"}):null,"Annuler l'abonnement"]}),a&&e.jsx("p",{className:"w-full text-center text-[11px] text-muted-foreground",children:"Annulation programmée — pas de prochain paiement."})]})})]})}function it(){const[s,i]=Le(),{user:n,signOut:l}=K(),o=U(),t=W(),{lang:u}=D(),c=M(ee),{data:a}=X({queryKey:["dashboard"],queryFn:()=>c(),staleTime:3e4,enabled:!!n}),y=te(),j=Z(),v=M(re),g=Y({mutationFn:()=>v(),onSuccess:()=>{p.success("Abonnement annulé — tu gardes l'accès jusqu'à la fin de la période."),j.invalidateQueries({queryKey:["subscription"]})},onError:r=>p.error(r?.message??"Annulation impossible.")}),F=()=>{typeof window<"u"&&!window.confirm("Annuler ton abonnement Vedality+ ? Tu gardes l'accès jusqu'à la fin de la période en cours.")||g.mutate()},N=a?.displayName??n?.email?.split("@")[0]??"Friend",H=(N?.[0]??"S").toUpperCase(),I=a?.noContactDays??0,h=Math.max(1,I),C=a?.daysSinceBreakup??null,w=a?.noContactLongest??0,_=a?.noContactStartedAt??null,A=_?Math.max(0,Math.floor((Date.now()-new Date(_).getTime())/36e5%24)):0,R=`${h} ${t(h===1?"common.day":"common.days")} · ${A} h`,V=a?.journalCount??0;a?.trendPct;const q=a?.emotionalLabel??t("profile.gentleBeginning"),B=[{icon:S,label:t("profile.currentStreak"),value:String(h),unit:t(h===1?"common.day":"common.days"),tint:b[1]},{icon:ae,label:t("profile.journalEntries"),value:_e(V),unit:"",tint:b[4]}];(a?.achievements??[]).slice(0,6).map((r,d)=>({icon:P[d%P.length],name:r.title,date:new Date(r.unlocked_at).toLocaleDateString(void 0,{month:"short",day:"numeric"}),unlocked:!0,tint:b[d%b.length]}));const O=[{label:t("profile.current"),days:h,active:!0},{label:t("profile.best"),days:Math.max(w,h),active:!1}],G=async()=>{await l(),o({to:"/auth/login"})},Q=async()=>{if(!n?.email){p.error(t("profile.crisis"));return}const{error:r}=await J.auth.resetPasswordForEmail(n.email,{redirectTo:`${window.location.origin}/auth/reset-password`});r?p.error(r.message):p.success(t("forgot.sentTitle"))},z=async()=>{const r="[email protected]";let d=!1;try{typeof navigator<"u"&&navigator.clipboard&&(await navigator.clipboard.writeText(r),d=!0)}catch{}
1if(!d&&typeof document<"u"){const m=document.createElement("textarea");m.value=r,m.setAttribute("readonly",""),m.style.position="fixed",m.style.opacity="0",document.body.appendChild(m),m.select(),d=document.execCommand("copy"),document.body.removeChild(m)}d?p.success(u==="fr"?"Adresse e-mail copiée : [email protected]":"Email copied: [email protected]"):p.info(u==="fr"?"Écrivez-nous à [email protected]":"Write to us at [email protected]")};return e.jsxs("div",{className:"pb-10",children:[e.jsx(se,{eyebrow:t("profile.eyebrow"),title:t("profile.pageTitle",{name:N}),back:!1}),e.jsx("section",{className:"px-5",children:e.jsxs(L.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},className:"relative overflow-hidden rounded-[28px] border border-border/60 bg-card p-5 shadow-soft",children:[e.jsx("div",{className:"absolute -right-10 -top-10 h-32 w-32 rounded-full bg-bloom/30 blur-3xl"}),e.jsxs("div",{className:"relative flex items-center gap-4",children:[e.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl bg-gradient-hero shadow-glow",children:e.jsx("span",{className:"font-display text-2xl font-semibold text-white",children:H})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"font-display text-lg font-medium text-foreground",children:N}),e.jsxs("p",{className:"text-xs text-muted-foreground capitalize",children:[C!=null?`${t("home.day")} ${C} · `:"",q]}),e.jsx("div",{className:"mt-2 flex items-center gap-1.5",children:e.jsx("span",{className:"rounded-full border border-border bg-background px-2 py-0.5 text-[10px] text-muted-foreground",children:a?.emotionalLabel??t("profile.beginning")})})]})]})]})}),e.jsx(f,{label:t("profile.healingInNumbers"),children:e.jsx("div",{className:"grid grid-cols-2 gap-2.5",children:B.map((r,d)=>{const m=r.icon;return e.jsxs(L.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:d*.05},className:"relative overflow-hidden rounded-2xl border border-border/60 bg-card p-4 shadow-soft",children:[e.jsx("div",{className:`mb-3 flex h-9 w-9 items-center justify-center rounded-xl bg-gradient-to-br ${r.tint} shadow-soft`,children:e.jsx(m,{className:"h-4 w-4 text-white",strokeWidth:2.2})}),e.jsxs("p",{className:"font-display text-2xl font-semibold text-foreground",children:[r.value,e.jsx("span",{className:"ml-0.5 text-sm font-normal text-muted-foreground",children:r.unit})]}),e.jsx("p",{className:"mt-0.5 text-[11px] text-muted-foreground",children:r.label})]},r.label)})})}),e.jsx(f,{label:t("profile.streakHistory"),children:e.jsxs("div",{className:"rounded-3xl border border-border/60 bg-card p-4 shadow-soft",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-2xl bg-gradient-to-br from-[oklch(0.82_0.1_30)] to-[oklch(0.65_0.16_15)] shadow-glow",children:e.jsx(S,{className:"h-6 w-6 text-white"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"font-display text-lg font-semibold text-foreground",children:R}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:w>0?t("profile.personalBest",{n:w}):t("profile.firstStreak")})]})]}),e.jsx("div",{className:"mt-4 grid grid-cols-2 gap-2",children:O.map(r=>e.jsxs("div",{className:`rounded-xl border p-2.5 text-center ${r.active?"border-primary bg-gradient-calm shadow-soft":"border-border/60 bg-background"}`,children:[e.jsxs("p",{className:"font-display text-base font-semibold text-foreground",children:[r.days,r.active?e.jsxs("span",{className:"ml-1 text-xs font-normal text-muted-foreground",children:["· ",A," h"]}):null]}),e.jsx("p",{className:"text-[9px] uppercase tracking-wider text-muted-foreground",children:r.label})]},r.label))})]})}),e.jsx(f,{label:t("profile.notifications"),children:e.jsx(x,{icon:me,label:t("profile.notifPrefs"),sub:t("profile.notifPrefsSub"),to:"/notifications"})}),e.jsxs(f,{label:t("profile.appearance"),children:[e.jsx(x,{icon:ue,label:t("profile.darkMode"),sub:t(s?"profile.darkOn":"profile.darkSystem"),right:e.jsx(oe,{checked:s,onChange:i})}),e.jsx(Ae,{})]}),e.jsxs(f,{label:t("profile.privacySafety"),children:[e.jsx(x,{icon:fe,label:t("profile.privacySettings"),sub:t("profile.privacySettingsSub"),to:"/settings/privacy"}),e.jsx(x,{icon:xe,label:t("profile.dataExport"),sub:t("profile.dataExportSub"),to:"/settings/data"})]}),e.jsxs(f,{label:t("profile.account"),children:[e.jsx(Ee,{premium:y,onCancel:F,canceling:g.isPending}),e.jsx(x,{icon:pe,label:t("profile.email"),sub:n?.email??"—"}),e.jsx(x,{icon:ke,label:t("profile.changePassword"),sub:n?.email??void 0,onClick:Q})]}),e.jsx(f,{label:t("profile.help"),children:e.jsx(x,{icon:he,label:t("profile.contactSupport"),sub:"[email protected]",onClick:z})}),e.jsx(f,{label:t("profile.dangerZone"),children:e.jsx(x,{icon:ge,label:t("profile.deleteAccount"),sub:t("profile.deleteAccountSub"),danger:!0})}),e.jsxs("section",{className:"px-5 pt-8",children:[e.jsxs("button",{onClick:G,className:"flex w-full items-center justify-center gap-2 rounded-2xl border border-border/60 bg-card p-4 text-sm font-medium text-muted-foreground shadow-soft",children:[e.jsx(Ce,{className:"h-4 w-4"})," ",t("profile.signOut")]}),e.jsxs("p",{className:"mt-6 text-center text-[10px] text-muted-foreground",children:["Vedality · v1.0 · made gently",e.jsx("br",{}),t("profile.footer")]})]})]})}export{it as component};

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.