1import{j as e}from"./ui-vendor-7ksmbWQe.js";import{c as W,l as X,P as w,B as g,X as O,j as y,s as ae,t as re,D as F,v as te,E as ie,q as le}from"./index-DWFe9eMF.js";import{L as u}from"./label-BcuwxRqT.js";import{S as A}from"./switch-CJCZf25B.js";import{T as oe,a as ne,b as C,c as P}from"./tabs-BERL4pnv.js";import{S as ce}from"./separator-064dhCHm.js";import{B as de}from"./badge-DRLeqBN9.js";import{S as B}from"./skeleton-Dk-mLo5I.js";import{r as d,u as me}from"./react-vendor-LSUMIZ7H.js";import{u as K}from"./i18n-vendor-Cq4PMOpV.js";import{S as pe}from"./SkillsDisplay-DtUBwPbg.js";import{A as xe}from"./AvailabilityStatus-bD4Z016g.js";import{S as ue}from"./settings-DAKFZkot.js";import{B as Q}from"./briefcase-DGXOJ95V.js";import{U}from"./user-BKshlMor.js";import{S as E}from"./shield-D6rHpS6p.js";import{A as he}from"./activity-BF8Zc7ed.js";import{F as fe}from"./file-text-Bm2ldZIp.js";import{S as G}from"./save-BEHqKiTh.js";import{M as ge}from"./map-pin-CXHMlyj9.js";import{T as je}from"./trending-up-72Bi6jOb.js";const be=W("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);const R=W("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);async function ve(m,l,p=.85){return new Promise((j,x)=>{const f=new FileReader;f.onload=s=>{const a=new window.Image;a.onload=()=>{const o=document.createElement("canvas");let n=a.width,i=a.height;n>l&&(i=i*l/n,n=l),o.width=n,o.height=i;const b=o.getContext("2d");if(!b){x(new Error("Failed to get canvas context"));return}b.drawImage(a,0,0,n,i),j(o.toDataURL("image/jpeg",p))},a.onerror=()=>x(new Error("Failed to load image")),a.src=s.target?.result},f.onerror=()=>x(new Error("Failed to read file")),f.readAsDataURL(m)})}function J({currentImage:m,type:l,onUploadComplete:p,className:j}){const[x,f]=d.useState(!1),[s,a]=d.useState(null),o=d.useRef(null),{toast:n}=X(),{t:i}=K(),b=async h=>{const v=h.target.files?.[0];if(v){if(!v.type.startsWith("image/")){n({title:i("imageUpload.invalidFile"),description:i("imageUpload.selectImageFile"),variant:"destructive"});return}if(v.size>10*1024*1024){n({title:i("imageUpload.fileTooLarge"),description:i("imageUpload.fileTooLargeDesc"),variant:"destructive"});return}f(!0);try{const k=await ve(v,l==="avatar"?400:1200);a(k);const S=await y.uploadProfileImage(k,l);p(S.url),n({title:i("imageUpload.success"),description:i(l==="avatar"?"imageUpload.profilePictureUpdated":"imageUpload.coverPhotoUpdated")})}catch(_){console.error("Upload error:",_),a(null),n({title:i("imageUpload.uploadFailed"),description:i("imageUpload.uploadFailedDesc"),variant:"destructive"})}finally{f(!1)}}},N=async()=>{f(!0);try{await y.deleteProfileImage(l),a(null),p(null),n({title:i("imageUpload.success"),description:i(l==="avatar"?"imageUpload.profilePictureRemoved":"imageUpload.coverPhotoRemoved")})}catch(h){console.error("Delete error:",h),n({title:i("common.error"),description:i("imageUpload.removeFailed"),variant:"destructive"})}finally{f(!1)}},c=s||m;return l==="avatar"?e.jsxs("div",{className:`relative group ${j}`,children:[e.jsx("input",{ref:o,type:"file",accept:"image/*",onChange:b,className:"hidden"}),e.jsxs("div",{onClick:()=>!x&&o.current?.click(),className:"w-20 h-20 sm:w-24 sm:h-24 rounded-2xl cursor-pointer overflow-hidden border-4 border-card shadow-lg transition-transform hover:scale-105",children:[c?e.jsx("img",{src:c,alt:"Profile",className:"w-full h-full object-cover"}):e.jsx("div",{className:"w-full h-full bg-gradient-to-br from-primary to-primary/60 flex items-center justify-center",children:e.jsx(R,{className:"h-6 w-6 text-primary-foreground opacity-80"})}),e.jsx("div",{className:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center rounded-2xl",children:x?e.jsx(w,{size:24,speed:1.6}):e.jsx(R,{className:"h-6 w-6 text-white"})})]}),c&&!x&&e.jsx(g,{size:"icon",variant:"destructive",className:"absolute -top-2 -right-2 h-6 w-6 rounded-full opacity-0 group-hover:opacity-100 transition-opacity",onClick:h=>{h.stopPropagation(),N()},children:e.jsx(O,{className:"h-3 w-3"})})]}):e.jsxs("div",{className:`relative group ${j}`,children:[e.jsx("input",{ref:o,type:"file",accept:"image/*",onChange:b,className:"hidden"}),e.jsxs("div",{onClick:()=>!x&&o.current?.click(),className:"h-32 sm:h-40 w-full cursor-pointer overflow-hidden relative",children:[c?e.jsx("img",{src:c,alt:"Cover",className:"w-full h-full object-cover"}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-primary/25 via-primary/15 to-accent/10"}),e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(ellipse_at_top_right,_rgba(255,255,255,0.15),_transparent_50%)]"})]}),e.jsx("div",{className:"absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:x?e.jsxs("div",{className:"flex items-center gap-2 text-white",children:[e.jsx(w,{size:20,speed:1.6}),e.jsx("span",{className:"text-sm font-medium",children:i("imageUpload.uploading")})]}):e.jsxs("div",{className:"flex items-center gap-2 text-white",children:[e.jsx(R,{className:"h-5 w-5"}),e.jsx("span",{className:"text-sm font-medium",children:i("imageUpload.changeCover")})]})}),e.jsx("svg",{className:"absolute bottom-0 left-0 right-0 text-card",viewBox:"0 0 1440 60",preserveAspectRatio:"none",children:e.jsx("path",{fill:"currentColor",d:"M0,60 L0,20 Q720,60 1440,20 L1440,60 Z"})})]}),c&&!x&&e.jsxs(g,{size:"sm",variant:"destructive",className:"absolute top-2 right-2 h-8 gap-1 opacity-0 group-hover:opacity-100 transition-opacity",onClick:h=>{h.stopPropagation(),N()},children:[e.jsx(O,{className:"h-3 w-3"}),i("imageUpload.remove")]})]})}function Ne(m){return null}function we(m){return null}function qe(){const{toggleMode:m,isEmployerMode:l}=ae(),p=me(),{toast:j}=X(),{logout:x,user:f}=re(),{t:s}
1=K(),[a,o]=d.useState({name:"",email:"",phone_number:"",country:"",state:"",city:"",bio:"",payable_balance:0,pending_balance:0,total_earned:0,tasks_completed:0,tasks_pending:0,success_rate:0,referral_code:"",display_id:"",show_location:!0,show_earnings:!0,created_at:"",avatar_url:null,cover_url:null,twitter_url:"",linkedin_url:"",github_url:"",website_url:"",skills:[],availability_status:"available",date_of_birth:"",nationality:"",zip_code:"",address_line:"",gender:"",occupation:""}),[n,i]=d.useState([]),[b,N]=d.useState(!1),[c,h]=d.useState(!1),[v,_]=d.useState(!0),[k,S]=d.useState(!1),[Y,I]=d.useState({twitter_url:"",linkedin_url:"",github_url:"",website_url:""}),[$,V]=d.useState([]);d.useEffect(()=>{(async()=>{try{const r=await y.getProfile();r&&(o({name:r.name||"",email:r.email||"",phone_number:r.phone_number||"",country:r.country||"",state:r.state||"",city:r.city||"",bio:r.bio||"",payable_balance:Number(r.payable_balance)||0,pending_balance:Number(r.pending_balance)||0,total_earned:Number(r.total_earned)||0,tasks_completed:Number(r.tasks_completed)||0,tasks_pending:Number(r.tasks_pending)||0,success_rate:Number(r.success_rate)||0,referral_code:r.referral_code||"",display_id:r.display_id||"",show_location:r.show_location!==!1,show_earnings:r.show_earnings!==!1,created_at:r.created_at||"",avatar_url:r.avatar_url||null,cover_url:r.cover_url||null,twitter_url:r.twitter_url||"",linkedin_url:r.linkedin_url||"",github_url:r.github_url||"",website_url:r.website_url||"",skills:r.skills||[],availability_status:r.availability_status||"available",date_of_birth:r.date_of_birth?String(r.date_of_birth).slice(0,10):"",nationality:r.nationality||"",zip_code:r.zip_code||"",address_line:r.address_line||"",gender:r.gender||"",occupation:r.occupation||""}),I({twitter_url:r.twitter_url||"",linkedin_url:r.linkedin_url||"",github_url:r.github_url||"",website_url:r.website_url||""}),V(r.skills||[]))}catch(r){console.error("Error fetching profile:",r)}finally{_(!1)}})()},[]);const ee=async()=>{if(!(n.length>0)){N(!0);try{const t=await y.getTransactions();i(t||[])}catch(t){console.error("Error fetching transactions:",t)}finally{N(!1)}}},H=async()=>{h(!0);try{await y.updateProfile({bio:a.bio,show_location:a.show_location,show_earnings:a.show_earnings}),j({title:s("common.success"),description:s("profile.profileUpdated")})}catch{j({title:s("common.error"),description:s("profile.profileUpdateFailed"),variant:"destructive"})}finally{h(!1)}},se=t=>{if(!t)return s("profile.never","Never");const r=new Date(t),z=new Date().getTime()-r.getTime(),M=Math.floor(z/6e4),Z=Math.floor(z/36e5),q=Math.floor(z/864e5);return M<1?s("profile.justNow","Just now"):M<60?`${M}${s("profile.mAgo","m ago")}`:Z<24?`${Z}${s("profile.hAgo","h ago")}`:q<7?`${q}${s("profile.dAgo","d ago")}`:r.toLocaleDateString()},D=t=>t?new Date(t).toLocaleDateString(void 0,{month:"long",year:"numeric"}):s("profile.notAvailable","N/A");if(v)return e.jsxs("div",{className:"min-h-screen bg-background pb-20 md:pb-6",children:[e.jsx(F,{payableBalance:0,pendingBalance:0}),e.jsx("main",{className:"container max-w-4xl mx-auto px-4 pt-24 md:pt-6 pb-8",children:e.jsxs("div",{className:"space-y-6",children:[e.jsx(B,{className:"h-52 w-full rounded-2xl"}),e.jsx(B,{className:"h-12 w-full rounded-xl"}),e.jsx(B,{className:"h-64 w-full rounded-xl"})]})})]});if(k){const t=[a.city,a.state,a.country].filter(Boolean);return e.jsxs("div",{className:"min-h-screen bg-background pb-20 md:pb-6",children:[e.jsx(F,{payableBalance:a.payable_balance,pendingBalance:a.pending_balance}),e.jsxs("main",{className:"container max-w-3xl mx-auto px-4 pt-24 md:pt-6 pb-8",children:[e.jsxs(g,{variant:"outline",onClick:()=>S(!1),className:"mb-6 gap-2",children:[e.jsx(te,{className:"h-4 w-4 rotate-180"}),s("profile.backToEdit")]}),e.jsxs("div",{className:"bg-card border border-border rounded-2xl overflow-hidden shadow-sm animate-fade-in",children:[e.jsxs("div",{className:"h-32 relative overflow-hidden",children:[a.cover_url?e.jsx("img",{src:a.cover_url,alt:"Cover",className:"w-full h-full object-cover"}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-primary/25 via-primary/15 to-accent/10"}),e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(ellipse_at_top_right,_rgba(255,255,255,0.15),_transparent_50%)]"})]}),e.jsx("svg",{className:"absolute bottom-0 left-0 right-0 text-card",viewBox:"0 0 1440 60",preserveAspectRatio:"none",children:e.jsx("path",{fill:"currentColor",d:"M0,60 L0,20 Q720,60 1440,20 L1440,60 Z"})})]}),e.jsxs("div",{className:"px-6 pb-6 -mt-14 relative",children:[e.jsx("div",{className:"w-28 h-28 rounded-2xl overflow-hidden border-4 border-card shadow-xl mb-4",children:a.avatar_url?e.jsx("img",{src:a.avatar_url,alt:"Profile",className:"w-full h-full object-cover"}):e.jsx("div",{className:"w-full h-full bg-gradient-to-br from-primary to-primary/60 flex items-center justify-center",children:e.jsx("span",{className:"text-4xl font-bold text-primary-foreground font-serif",children:a.display_id?.substring(0,2)||"U"})})}),e.jsx("div",{className:"flex items-start justify-between flex-wrap gap-4",children:e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold font-serif text-foreground",children:a.display_id}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 mt-2 text-sm text-muted-foreground",children:[a.show_location&&t.length>0&&e.jsx("span",{children:t.join(", ")}),a.show_location&&t.length>0&&e.jsx("span",{className:"h-1 w-1 rounded-full bg-muted-foreground
1/40","aria-hidden":!0}),e.jsxs("span",{children:[s("profile.joined")," ",D(a.created_at)]})]})]})}),a.bio&&e.jsx("div",{className:"mt-5 p-4 bg-muted/40 rounded-xl border border-border/50",children:e.jsx("p",{className:"text-foreground leading-relaxed",children:a.bio})}),e.jsx(pe,{skills:$,className:"mt-5"})]})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mt-6",children:[a.show_earnings&&e.jsx(L,{label:s("profile.earned"),value:`⥠${a.total_earned.toLocaleString()}`}),e.jsx(L,{label:s("tasks.title"),value:String(a.tasks_completed)}),e.jsx(L,{label:s("leaderboard.accuracy"),value:`${a.success_rate.toFixed(0)}%`}),e.jsx(L,{label:s("profile.memberSince"),value:D(a.created_at),small:!0})]}),e.jsx("p",{className:"text-center text-sm text-muted-foreground mt-8",children:s("profile.publicViewNote")})]})]})}return e.jsxs("div",{className:"min-h-screen bg-background pb-20 md:pb-6",children:[e.jsx(F,{payableBalance:a.payable_balance,pendingBalance:a.pending_balance}),e.jsxs("main",{className:"container max-w-4xl mx-auto px-4 pt-24 md:pt-6 pb-8 space-y-6",children:[e.jsxs("div",{className:"bg-card border border-border rounded-2xl overflow-hidden shadow-sm",children:[e.jsx(J,{currentImage:a.cover_url,type:"cover",onUploadComplete:t=>o(r=>({...r,cover_url:t}))}),e.jsxs("div",{className:"px-6 pb-6 -mt-10 relative",children:[e.jsxs("div",{className:"flex items-end justify-between gap-4 flex-wrap",children:[e.jsx(J,{currentImage:a.avatar_url,type:"avatar",onUploadComplete:t=>o(r=>({...r,avatar_url:t}))}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(g,{variant:"outline",size:"sm",onClick:()=>S(!0),className:"gap-2",children:[e.jsx(ie,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:s("profile.viewPublic")})]}),e.jsx(g,{variant:"ghost",size:"icon",onClick:()=>p("/settings"),children:e.jsx(ue,{className:"h-5 w-5"})})]})]}),e.jsxs("div",{className:"mt-3 flex items-center justify-between flex-wrap gap-2",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-bold font-serif text-foreground",children:a.display_id}),e.jsx("p",{className:"text-sm text-muted-foreground",children:a.email})]}),e.jsx(xe,{status:a.availability_status,onStatusChange:t=>o(r=>({...r,availability_status:t})),editable:!0})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 mt-5",children:[e.jsxs("div",{className:"bg-success/10 border border-success/20 rounded-xl p-4",children:[e.jsx("span",{className:"text-[10px] text-muted-foreground uppercase tracking-[0.12em] font-semibold",children:s("profile.available")}),e.jsxs("p",{className:"text-2xl font-serif font-bold text-success dark:text-success mt-1.5",children:["⥠",a.payable_balance.toLocaleString()]})]}),e.jsxs("div",{className:"bg-primary/10 border border-primary/20 rounded-xl p-4",children:[e.jsx("span",{className:"text-[10px] text-muted-foreground uppercase tracking-[0.12em] font-semibold",children:s("profile.pen
1ding")}),e.jsxs("p",{className:"text-2xl font-serif font-bold text-primary dark:text-primary mt-1.5",children:["⥠",a.pending_balance.toLocaleString()]})]})]}),e.jsxs(g,{onClick:()=>p("/withdraw"),className:"w-full mt-4 gap-2",size:"lg",children:[e.jsx(be,{className:"h-4 w-4"}),s("profile.withdrawFunds")]})]})]}),e.jsx("div",{className:"bg-card border-2 border-primary/20 rounded-xl p-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`p-2.5 rounded-xl ${l?"bg-primary/10":"bg-success/10"}`,children:l?e.jsx(Q,{className:"h-5 w-5 text-primary"}):e.jsx(U,{className:"h-5 w-5 text-success dark:text-success"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold",children:s(l?"profile.employerMode":"profile.workerMode")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s(l?"profile.employerModeDesc":"profile.workerModeDesc")})]})]}),e.jsx(A,{checked:l,onCheckedChange:m})]})}),e.jsxs(oe,{defaultValue:"account",className:"space-y-6",children:[e.jsxs(ne,{className:"grid w-full grid-cols-4 bg-muted/50 p-1 rounded-xl h-auto",children:[e.jsxs(C,{value:"account",className:"rounded-lg gap-2 py-2.5 text-xs sm:text-sm",children:[e.jsx(U,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:s("profile.account")}
1)]}),e.jsxs(C,{value:"privacy",className:"rounded-lg gap-2 py-2.5 text-xs sm:text-sm",children:[e.jsx(E,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:s("profile.privacy")})]}),e.jsxs(C,{value:"stats",className:"rounded-lg gap-2 py-2.5 text-xs sm:text-sm",children:[e.jsx(he,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:s("profile.stats")})]}),e.jsxs(C,{value:"history",className:"rounded-lg gap-2 py-2.5 text-xs sm:text-sm",onClick:ee,children:[e.jsx(fe,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:s("profile.history")})]})]}),e.jsxs(P,{value:"account",className:"space-y-8 animate-fade-in",children:[e.jsxs("section",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 px-1",children:[e.jsx(U,{className:"h-3.5 w-3.5 text-primary"}),e.jsx("h2",{className:"text-[11px] font-semibold uppercase tracking-[0.12em] text-muted-foreground",children:s("profile.identity","Identity")})]}),e.jsxs("div",{className:"bg-card border border-border rounded-2xl p-5 space-y-5 shadow-sm",children:[e.jsxs("div",{className:"flex items-start gap-3 pb-4 border-b border-border/60",children:[e.jsx("div",{className:"p-2 rounded-xl bg-primary/10",children:e.jsx(U,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:"font-semibold",children:s("profile.accountInfo")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("profile.manageDetails")})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[e.jsx(u,{htmlFor:"bio",className:"text-sm font-medium",children:s("profile.bio")}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[a.bio.length,"/500"]})]}),e.jsx(le,{id:"bio",value:a.bio,onChange:t=>o({...a,bio:t.target.value.slice(0,500)}),placeholder:s("profile.bioPlaceholder"),className:"resize-none",rows:3})]}),e.jsx(ce,{}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(u,{className:"text-sm text-muted-foreground",children:s("profile.fullName","Name")}),e.jsx("p",{className:"font-medium mt-1 truncate",children:a.name||s("common.notSet")})]}),e.jsxs("div",{children:[e.jsx(u,{className:"text-sm text-muted-foreground",children:s("profile.email")}),e.jsx("p",{className:"font-medium mt-1 truncate",children:a.email})]}),e.jsxs("div",{children:[e.jsx(u,{className:"text-sm text-muted-foreground",children:s("profile.phone","Phone")}),e.jsx("p",{className:"font-medium mt-1 truncate",children:a.phone_number||s("common.notSet")})]}),e.jsxs("div",{children:[e.jsx(u,{className:"text-sm text-muted-foreground",children:s("profile.dateOfBirth","Date of birth")}),e.jsx("p",{className:"font-medium mt-1",children:a.date_of_birth||s("common.notSet")})]}),e.jsxs("div",{children:[e.jsx(u,{className:"text-sm text-muted-foreground",children:s("profile.gender","Gender")}),e.jsx("p",{className:"font-medium mt-1 capitalize",children:a.gender||s("common.notSet")})]}),e.jsxs("div",{children:[e.jsx(u,{className:"text-sm text-muted-foreground",children:s("profile.nationality","Nationality")}),e.jsx("p",{className:"font-medium mt-1",children:a.nationality||s("common.notSet")})]}),e.jsxs("div",{children:[e.jsx(u,{className:"text-sm text-muted-foreground",children:s("profile.occupation","Occupation")}),e.jsx("p",{className:"font-medium mt-1",children:a.occupation||s("common.notSet")})]}),e.jsxs("div",{children:[e.jsx(u,{className:"text-sm text-muted-foreground",children:s("profile.location")}),e.jsx("p",{className:"font-medium mt-1",children:[a.city,a.state,a.country].filter(Boolean).join(", ")||s("common.notSet")})]}),e.jsxs("div",{children:[e.jsx(u,{className:"text-sm text-muted-foreground",children:s("profile.zipCode","ZIP / Postal code")}),e.jsx("p",{className:"font-medium mt-1",children:a.zip_code||s("common.notSet")})]}),e.jsxs("div",{className:"sm:col-span-2",children:[e.jsx(u,{className:"text-sm text-muted-foreground",children:s("profile.address","Address")}
1),e.jsx("p",{className:"font-medium mt-1 break-words",children:a.address_line||s("common.notSet")})]})]}),e.jsxs(g,{onClick:H,disabled:c,className:"w-full gap-2",children:[c?e.jsx(w,{size:16,speed:1}):e.jsx(G,{className:"h-4 w-4"}),s(c?"profile.saving":"profile.saveChanges")]})]})]})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 px-1",children:[e.jsx(Q,{className:"h-3.5 w-3.5 text-primary"}),e.jsx("h2",{className:"text-[11px] font-semibold uppercase tracking-[0.12em] text-muted-foreground",children:s("profile.showcase","Showcase")})]}),e.jsx("div",{className:"bg-card border border-border rounded-2xl p-5 shadow-sm",children:e.jsx(we,{skills:$,onSkillsChange:V})}),e.jsx("div",{className:"bg-card border border-border rounded-2xl p-5 shadow-sm",children:e.jsx(Ne,{links:Y,onLinksChange:I})})]})]}),e.jsxs(P,{value:"privacy",className:"space-y-4 animate-fade-in",children:[e.jsxs("div",{className:"bg-card border border-border rounded-xl overflow-hidden",children:[e.jsx("div",{className:"p-5 border-b border-border",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 rounded-lg bg-primary/10",children:e.jsx(E,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold",children:s("profile.privacySettings")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("profile.controlVisibility")})]})]})}),e.jsxs("div",{className:"divide-y divide-border",children:[e.jsxs("div",{className:"p-4 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ge,{className:"h-5 w-5 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:s("profile.showLocation")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("profile.showLocationDesc")})]})]}),e.jsx(A,{checked:a.show_location,onCheckedChange:t=>o({...a,show_location:t})})]}),e.jsxs("div",{className:"p-4 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(je,{className:"h-5 w-5 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:s("profile.showEarnings")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("profile.showEarningsDesc")})]})]}),e.jsx(A,{checked:a.show_earnings,onCheckedChange:t=>o({...a,show_earnings:t})})]})]}),e.jsx("div",{className:"p-4 bg-muted/30",children:e.jsxs(g,{onClick:H,disabled:c,className:"w-full gap-2",children:[c?e.jsx(w,{size:16,speed:1}):e.jsx(G,{className:"h-4 w-4"}),s(c?"profile.saving":"profile.savePrivacy")]})})]}),e.jsx("div",{className:"bg-muted/30 border border-border rounded-xl p-4",children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx(E,{className:"h-5 w-5 text-muted-foreground shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-sm",children:s("profile.privacyProtected")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("profile.privacyProtectedDesc")})]})]})})]}),e.jsxs(P,{value:"stats",className:"animate-fade-in space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(T,{label:s("profile.completed"),value:String(a.tasks_completed),caption:s("tasks.title").toLowerCase()}),e.jsx(T,{label:s("leaderboard.accuracy"),value:`${a.success_rate.toFixed(1)}%`,caption:s("profile.successRate")}),e.jsx(T,{label:s("profile.earned"),value:`⥠${a.total_earned.toLocaleString()}`,caption:s("profile.total")}
1),e.jsx(T,{label:s("profile.pending"),value:String(a.tasks_pending),caption:s("tasks.title").toLowerCase()})]}),e.jsxs("div",{className:"bg-card border border-border rounded-xl p-5",children:[e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-[0.12em] text-muted-foreground",children:s("profile.memberSince")}),e.jsx("p",{className:"text-xl font-semibold font-serif mt-1.5",children:D(a.created_at)})]})]}),e.jsx(P,{value:"history",className:"animate-fade-in",children:e.jsx("div",{className:"bg-card border border-border rounded-xl overflow-hidden",children:b?e.jsx("div",{className:"p-8 flex justify-center",children:e.jsx(w,{size:32,speed:1.6})}):n.length===0?e.jsx("div",{className:"p-10 text-center",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:s("profile.noTransactions")})}):e.jsx("div",{className:"divide-y divide-border",children:n.slice(0,15).map(t=>e.jsxs("div",{className:"p-4 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium capitalize",children:s(`transactionType.${t.type}`,t.type.replace(/_/g," "))}),e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-1",children:t.description||s("common.noDescription")}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:se(t.created_at)})]}),e.jsxs(de,{variant:t.amount>=0?"default":"secondary",className:"font-mono shrink-0",children:[t.amount>=0?"+":"","⥠",t.amount]})]},t.id))})})})]})]})]})}function L({label:m,value:l,small:p}){return e.jsxs("div",{className:"bg-card border border-border rounded-xl p-4",children:[e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-[0.12em] text-muted-foreground",children:m}),e.jsx("p",{className:`font-serif font-bold text-foreground mt-2 ${p?"text-sm":"text-xl"}`,children:l})]})}function T({label:m,value:l,caption:p}){return e.jsxs("div",{className:"bg-card border border-border rounded-xl p-5",children:[e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-[0.12em] text-muted-foreground",children:m}),e.jsx("p",{className:"text-3xl font-serif font-bold mt-2",children:l}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:p})]})}export{qe 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.