3 lines
11 KiB
JavaScript
3 lines
11 KiB
JavaScript
module.exports=[98205,a=>{"use strict";let b=(0,a.i(29892).default)("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"}]]);a.s(["Save",()=>b],98205)},56704,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},20635,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/action-async-storage.external.js",()=>require("next/dist/server/app-render/action-async-storage.external.js"))},97442,(a,b,c)=>{"use strict";b.exports=a.r(23642).vendored.contexts.AppRouterContext},42481,(a,b,c)=>{"use strict";b.exports=a.r(23642).vendored.contexts.HooksClientContext},70676,(a,b,c)=>{"use strict";b.exports=a.r(23642).vendored.contexts.ServerInsertedHtml},29892,a=>{"use strict";var b=a.i(28091);let c=(...a)=>a.filter((a,b,c)=>!!a&&""!==a.trim()&&c.indexOf(a)===b).join(" ").trim(),d=a=>{let b=a.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,b,c)=>c?c.toUpperCase():b.toLowerCase());return b.charAt(0).toUpperCase()+b.slice(1)};var e={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let f=(0,b.forwardRef)(({color:a="currentColor",size:d=24,strokeWidth:f=2,absoluteStrokeWidth:g,className:h="",children:i,iconNode:j,...k},l)=>(0,b.createElement)("svg",{ref:l,...e,width:d,height:d,stroke:a,strokeWidth:g?24*Number(f)/Number(d):f,className:c("lucide",h),...!i&&!(a=>{for(let b in a)if(b.startsWith("aria-")||"role"===b||"title"===b)return!0;return!1})(k)&&{"aria-hidden":"true"},...k},[...j.map(([a,c])=>(0,b.createElement)(a,c)),...Array.isArray(i)?i:[i]])),g=(a,e)=>{let g=(0,b.forwardRef)(({className:g,...h},i)=>(0,b.createElement)(f,{ref:i,iconNode:e,className:c(`lucide-${d(a).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${a}`,g),...h}));return g.displayName=d(a),g};a.s(["default",()=>g],29892)},82772,a=>{"use strict";let b=(0,a.i(29892).default)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);a.s(["User",()=>b],82772)},75108,a=>{"use strict";let b=(0,a.i(29892).default)("panels-top-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]]);a.s(["Layout",()=>b],75108)},89657,a=>{"use strict";let b=(0,a.i(29892).default)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);a.s(["Shield",()=>b],89657)},45285,a=>{"use strict";let b=(0,a.i(29892).default)("target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);a.s(["Target",()=>b],45285)},93216,a=>{"use strict";let b=(0,a.i(29892).default)("flame",[["path",{d:"M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4",key:"1slcih"}]]);a.s(["Flame",()=>b],93216)},98220,a=>{"use strict";var b=a.i(78352),c=a.i(34896),d=a.i(95121),e=a.i(28091),f=a.i(82772),g=a.i(89657),h=a.i(98205);let i=(0,a.i(29892).default)("camera",[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);var j=a.i(45285),k=a.i(93216),l=a.i(75108);let m=({user:a,onUpdate:c,onBack:d})=>{console.log("[UserProfileSettings DEBUG] PROPS RECEIVED:",{user:a,userId:a?.id,hasOnUpdate:!!c,hasOnBack:!!d});let[m,n]=(0,e.useState)("profile"),[o,p]=(0,e.useState)({name:a.name,bio:a.bio||"",email:a.email,theme:a.preferences.theme,dailyWordGoal:a.preferences.dailyWordGoal});return(0,b.jsx)("div",{className:"h-full bg-slate-50 overflow-y-auto p-8 font-sans",children:(0,b.jsxs)("div",{className:"max-w-4xl mx-auto",children:[(0,b.jsxs)("div",{className:"flex justify-between items-center mb-10",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h1",{className:"text-3xl font-black text-slate-900",children:"Mon Compte"}),(0,b.jsx)("p",{className:"text-slate-500",children:"Gérez vos informations personnelles et préférences d'écriture."})]}),(0,b.jsx)("button",{onClick:d,className:"bg-white border border-slate-200 px-4 py-2 rounded-lg text-sm font-bold hover:bg-slate-50 transition-colors",children:"Fermer"})]}),(0,b.jsxs)("div",{className:"flex flex-col md:flex-row gap-8",children:[(0,b.jsxs)("div",{className:"w-full md:w-64 space-y-1",children:[(0,b.jsxs)("button",{onClick:()=>n("profile"),className:`w-full flex items-center gap-3 px-4 py-3 rounded-xl text-sm font-bold transition-all ${"profile"===m?"bg-slate-900 text-white shadow-lg":"text-slate-500 hover:bg-white hover:text-slate-900"}`,children:[(0,b.jsx)(f.User,{size:18})," Profil Public"]}),(0,b.jsxs)("button",{onClick:()=>n("preferences"),className:`w-full flex items-center gap-3 px-4 py-3 rounded-xl text-sm font-bold transition-all ${"preferences"===m?"bg-slate-900 text-white shadow-lg":"text-slate-500 hover:bg-white hover:text-slate-900"}`,children:[(0,b.jsx)(l.Layout,{size:18})," Interface & Écriture"]}),(0,b.jsxs)("button",{onClick:()=>n("account"),className:`w-full flex items-center gap-3 px-4 py-3 rounded-xl text-sm font-bold transition-all ${"account"===m?"bg-slate-900 text-white shadow-lg":"text-slate-500 hover:bg-white hover:text-slate-900"}`,children:[(0,b.jsx)(g.Shield,{size:18})," Sécurité & Plan"]})]}),(0,b.jsxs)("div",{className:"flex-1 bg-white rounded-2xl shadow-sm border border-slate-200 p-8",children:["profile"===m&&(0,b.jsxs)("div",{className:"space-y-8 animate-in fade-in slide-in-from-bottom-4 duration-300",children:[(0,b.jsxs)("div",{className:"flex items-center gap-6 pb-8 border-b border-slate-100",children:[(0,b.jsxs)("div",{className:"relative group",children:[(0,b.jsx)("img",{src:a.avatar,className:"w-24 h-24 rounded-full object-cover border-4 border-slate-50 shadow-md",alt:"Avatar"}),(0,b.jsx)("button",{className:"absolute inset-0 bg-black/40 text-white rounded-full opacity-0 group-hover:opacity-100 flex items-center justify-center transition-opacity",children:(0,b.jsx)(i,{size:20})})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"font-bold text-slate-900 text-lg",children:a.name}),(0,b.jsx)("p",{className:"text-slate-400 text-sm",children:"Membre depuis Janvier 2024"}),(0,b.jsx)("div",{className:"mt-2 flex gap-4",children:(0,b.jsxs)("div",{className:"flex items-center gap-1.5 text-xs font-bold text-orange-500",children:[(0,b.jsx)(k.Flame,{size:14,fill:"currentColor"})," ",a.stats.writingStreak," jours de streak"]})})]})]}),(0,b.jsxs)("div",{className:"grid grid-cols-1 gap-6",children:[(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("label",{className:"text-xs font-black text-slate-400 uppercase tracking-widest",children:"Nom affiché"}),(0,b.jsx)("input",{type:"text",value:o.name,onChange:a=>p({...o,name:a.target.value}),className:"w-full p-3 bg-slate-50 border border-slate-200 rounded-xl outline-none focus:ring-2 focus:ring-blue-500"})]}),(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("label",{className:"text-xs font-black text-slate-400 uppercase tracking-widest",children:"Bio / Citation inspirante"}),(0,b.jsx)("textarea",{value:o.bio,onChange:a=>p({...o,bio:a.target.value}),className:"w-full p-3 bg-slate-50 border border-slate-200 rounded-xl outline-none focus:ring-2 focus:ring-blue-500 h-24 resize-none",placeholder:"Partagez quelques mots sur votre style..."})]})]})]}),"preferences"===m&&(0,b.jsx)("div",{className:"space-y-8 animate-in fade-in slide-in-from-bottom-4 duration-300",children:(0,b.jsxs)("div",{className:"grid grid-cols-1 gap-8",children:[(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsxs)("label",{className:"text-xs font-black text-slate-400 uppercase tracking-widest flex items-center gap-2",children:[(0,b.jsx)(j.Target,{size:14})," Objectif quotidien de mots"]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsx)("input",{type:"range",min:"0",max:"5000",step:"100",value:o.dailyWordGoal,onChange:a=>p({...o,dailyWordGoal:parseInt(a.target.value)}),className:"flex-1 accent-blue-600"}),(0,b.jsx)("span",{className:"font-mono font-bold text-blue-600 bg-blue-50 px-3 py-1 rounded-lg",children:o.dailyWordGoal})]})]}),(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsx)("label",{className:"text-xs font-black text-slate-400 uppercase tracking-widest flex items-center gap-2",children:"Thème de l'éditeur"}),(0,b.jsx)("div",{className:"grid grid-cols-3 gap-3",children:["light","sepia","dark"].map(a=>(0,b.jsxs)("button",{onClick:()=>p({...o,theme:a}),className:`p-4 rounded-xl border-2 transition-all flex flex-col items-center gap-2 ${o.theme===a?"border-blue-500 bg-blue-50 text-blue-700":"border-slate-100 hover:border-slate-200 text-slate-500"}`,children:[(0,b.jsx)("div",{className:`w-8 h-8 rounded-full border border-slate-200 ${"light"===a?"bg-white":"sepia"===a?"bg-[#f4ecd8]":"bg-slate-900"}`}),(0,b.jsx)("span",{className:"text-[10px] font-bold uppercase",children:a})]},a))})]})]})}),"account"===m&&(0,b.jsxs)("div",{className:"space-y-8 animate-in fade-in slide-in-from-bottom-4 duration-300",children:[(0,b.jsxs)("div",{className:"p-4 bg-blue-50 border border-blue-100 rounded-xl flex justify-between items-center",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("h4",{className:"font-bold text-blue-900",children:["Plan ",a.subscription.plan.toUpperCase()]}),(0,b.jsx)("p",{className:"text-xs text-blue-700",children:"Prochaine facturation le 15 Mars 2024"})]}),(0,b.jsx)("button",{className:"bg-blue-600 text-white px-4 py-2 rounded-lg text-xs font-bold hover:bg-blue-700 shadow-md shadow-blue-200",children:"Gérer"})]}),(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("label",{className:"text-xs font-black text-slate-400 uppercase tracking-widest",children:"Email du compte"}),(0,b.jsx)("input",{type:"email",value:o.email,onChange:a=>p({...o,email:a.target.value}),className:"w-full p-3 bg-slate-50 border border-slate-200 rounded-xl outline-none focus:ring-2 focus:ring-blue-500"})]}),(0,b.jsx)("div",{className:"pt-4",children:(0,b.jsx)("button",{className:"text-red-500 text-sm font-bold hover:underline",children:"Supprimer mon compte définitivement"})})]}),(0,b.jsx)("div",{className:"mt-12 pt-8 border-t border-slate-100 flex justify-end",children:(0,b.jsxs)("button",{onClick:()=>{c({name:o.name,bio:o.bio,email:o.email,preferences:{...a.preferences,theme:o.theme,dailyWordGoal:o.dailyWordGoal}}),alert("Profil mis à jour !")},className:"bg-slate-900 text-white px-8 py-3 rounded-xl font-bold flex items-center gap-2 hover:bg-blue-600 transition-all shadow-xl hover:shadow-blue-200",children:[(0,b.jsx)(h.Save,{size:18})," Sauvegarder les modifications"]})})]})]})]})})};function n(){let a=(0,c.useRouter)(),{user:f,loading:g}=(0,d.useAuthContext)();return((0,e.useEffect)(()=>{g||f||a.replace("/login")},[f,g,a]),g||!f)?null:(0,b.jsx)(m,{user:f,onUpdate:a=>console.log("Profile update:",a),onBack:()=>a.push("/dashboard")})}a.s(["default",()=>n],98220)}];
|
|
|
|
//# sourceMappingURL=%5Broot-of-the-server%5D__614a5f92._.js.map
|