PageSourceSearch

https://app.updately.ai/assets/index-BIEzwnj8.js

js updately.ai collected 2026-10-05 14:16:15 UTC 10,230 bytes, 11 lines download raw bytes

1import{h as U,o as k,t as D,r as i,v as f,E as g,x as d,j as s,g as n,a7 as x,I as h,s as F,aj as H,bo as T,L as Y,q as u}from"./index-BNIUXFGR.js";import{P as $}from"./PageHeader-D-Wu6-OD.js";import{u as I}from"./useSuspenseQuery-D49Zv99D.js";import{C as N,a as S,d as A,c as M,b as z}from"./card-CbdnxEcK.js";import{S as G}from"./separator-dCkY31KD.js";import{h as L}from"./hashPassword-DPmm3k5l.js";import{A as J,a as O}from"./avatar-Dat1VscY.js";import{C as R}from"./calendar-Co0E113F.js";import{C as K}from"./clock-DVUN6WJX.js";import{M as V}from"./mail-6VsdgcmO.js";import{E as y}from"./eye-DFOiLVLD.js";import{E as P}from"./eye-off-CvBboQ60.js";import{M as W,r as X}from"./index-DOg0vyE0.js";/**
2 * @license lucide-react v0.539.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 Z=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],ss=U("credit-card",Z);/**
7 * @license lucide-react v0.539.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 es=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],as=U("pen-line",es),rs=()=>{const{data:t}=I(k.account()),B=D(),[e,o]=i.useState({email:t.data.email,newEmail:"",username:t.data.username,password:"",newPassword:"",confirmPassword:""}),[v,w]=i.useState(!1),[C,l]=i.useState(""),[E,c]=i.useState({emptyEmail:!1,sameEmail:!1}),[a,p]=i.useState({showCurrentPass:!1,showNewPass:!1,showConfirmPass:!1}),b=f({...g.updateEmail,onSuccess:()=>{d.success("Your email address has been successfully updated."),B.invalidateQueries(k.account()),w(!1),o({...e,email:e.newEmail,newEmail:""})},onError:()=>{d.error("Sorry, Failed to update email")}}),m=f({...g.checkCurrentPassword,onSuccess:async r=>{if(r.success===!1){l("Incorrect current password");return}try{const _=await L(e.newPassword);j.mutate(_)}catch{d.error("Failed to process password")}},onError:()=>{d.error("Sorry, Failed to check current password")}}),j=f({...g.updatePassword,onSuccess:()=>{d.success("Your password has been successfully updated."),o({...e,password:e.newPassword,newPassword:"",confirmPassword:""})},onError:()=>{d.error("Sorry, Failed to update password")}}),Q=()=>{if(!e.newEmail){c({emptyEmail:!0,sameEmail:!1});return}if(e.newEmail===e.email){c({emptyEmail:!1,sameEmail:!0});return}c({emptyEmail:!1,sameEmail:!1}),b.mutate(e.newEmail)},q=i.useCallback(async()=>{if(!e.password||!e.newPassword||!e.confirmPassword){l("Please fill in all password fields");return}if(e.newPassword.length<8){l("New password must be at least 8 characters");return}if(e.newPassword!==e.confirmPassword){l("New passwords do not match");return}l("");const r=await L(e.password);m.mutate(r)},[e.password,e.newPassword,e.confirmPassword,m]);return s.jsxs("div",{className:"space-y-6",children:[s.jsx(N,{className:"group relative overflow-hidden border-border bg-card transition-all duration-200 hover:shadow-[var(--shadow-lg)] p-0",children:s.jsx("div",{className:"relative p-4",children:s.jsxs("div",{className:"flex items-center justify-between gap-6",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx(J,{className:"h-16 w-16 transition-transform duration-200 group-hover:scale-105",children:s.jsx(O,{className:"bg-red-100 text-xl font-semibold text-red-500",children:t.data.username.charAt(0).toUpperCase()})}),s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("h2",{className:"text-xl font-bold tracking-tight text-card-foreground",children:t.data.username}),s.jsx("a",{href:`mailto:${t.data.email}`,className:"text-sm text-muted-foreground transition-colors hover:text-primary",children:t.data.email})]})]}),s.jsxs("div",{className:"flex flex-col gap-2 text-right",children:[s.jsxs("div",{className:"flex items-center justify-end gap-1.5 text-xs text-muted-foreground",children:[s.jsx(R,{className:"h-3.5 w-3.5"}),s.jsxs("span",{children:["Joined ",t.data.createdAt]})]}),s.jsxs("div",{className:"flex items-center justify-end gap-1.5 text-xs text-muted-foreground",children:[s.jsx(K,{className:"h-3.5 w-3.5"}),s.jsx("span",{children:"Active Today"})]})]})]})})}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs(N,{className:"shadow-card",children:[s.jsxs(S,{children:[s.jsxs(A,{className:"flex items-center gap-2",children:[s.jsx(V,{className:"w-5 h-5 text-primary"}),"Email Address"]}),s.jsx(M,{children:"Update your email address for account notifications"})]}),s.jsxs(z,{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between p-4 bg-muted rounded-lg",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm",children:e.email}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Current email address"})]}),s.jsxs(n,{variant:"dark",size:"sm",onClick:()=>w(!v),className:"flex items-center gap-2",children:[s.jsx(as,{className:"w-4 h-4"}),"Edit"]})]}),v&&s.jsxs("div",{className:"space-y-4 p-4 border rounded-lg bg-card",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(x,{htmlFor:"new-email",className:"required",children:"New Email Address"}),s.jsx(h,{id:"new-email",type:"email",value:e.newEmail,onChange:r=>o({...e,newEmail:r.target.value}),placeholder:"Enter new email address"}),E.emptyEmail&&s.jsx("p",{className:"text-xs text-red-500",children:"Email address is required"}),E.sameEmail&&s.jsx("p",{className:"text-xs text-red-500",children:"Same email address is not allowed"})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(n,{variant:"dark",size:"sm",onClick:Q,children:b.isPending?s.jsxs(s.Fragment,{children:[s.jsx(F,{className:"w-4 h-4 animate-spin"}),"Updating Email..."]}):"Update Email"}),s.jsx(n,{variant:"outline",size:"sm",onClick:()=>{w(!1),o({...e,newEmail:""}),c({emptyEmail:!1,sameEmail:!1})},children:"Cancel"})]})]})]})]}),s.jsxs(N,{className:"shadow-card",children:[s.jsxs(S,{children:[s.jsxs(A,{className:"flex items-center gap-2",children:[s.jsx(H,{className:"w-5 h-5 text-primary"}),"Change Password"]}),s.jsx(M,{children:"Update your password to keep your account secure"})]}),s.jsxs(z,{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(x,{htmlFor:"current-password",children:"Current Password"}),s.jsxs("div",{className:"bg-[#F7FAFC] flex items-center justify-between gap-x-2 border rounded-md",children:[s.jsx(h,{id:"current-password",type:a.showCurrentPass?"text":"password",value:e.password,onChange:r=>o({...e,password:r.target.value}),placeholder:"Enter current password",className:"border-none shadow-none"}),s.jsx(n,{variant:"ghost",size:"icon",onClick:()=>p({...a,showCurrentPass:!a.showCurrentPass}),children:a.showCurrentPass?s.jsx(y,{className:"w-4 h-4 text-muted-foreground"}):s.jsx(P,{className:"w-4 h-4 text-muted-foreground"})})]})]}),s.jsx(G,{}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(x,{htmlFor:"current-password",children:"New Password"}),s.jsxs("div",{className:"bg-[#F7FAFC] flex items-center justify-between gap-x-2 border rounded-md",children:[s.jsx(h,{id:"new-password",type:a.showNewPass?"text":"password",value:e.newPassword,onChange:r=>o({...e,newPassword:r.target.value}),placeholder:"Enter new password",className:"border-none shadow-none"}),s.jsx(n,{variant:"ghost",size:"icon",onClick:()=>p({...a,showNewPass:!a.showNewPass}),children:a.showNewPass?s.jsx(y,{className:"w-4 h-4 text-muted-foreground"}):s.jsx(P,{className:"w-4 h-4 text-muted-foreground"})})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(x,{htmlFor:"confirm-password",children:"Confirm New Password"}),s.jsxs("div",{className:"bg-[#F7FAFC] flex items-center justify-between gap-x-2 border rounded-md",children:[s.jsx(h,{id:"confirm-password",type:a.showConfirmPass?"text":"password",value:e.confirmPassword,onChange:r=>o({...e,confirmPassword:r.target.value}),placeholder:"Enter confirm password",className:"border-none shadow-none"}),s.jsx(n,{variant:"ghost",size:"icon",onClick:()=>p({...a,showConfirmPass:!a.showConfirmPass}
11),children:a.showConfirmPass?s.jsx(y,{className:"w-4 h-4 text-muted-foreground"}):s.jsx(P,{className:"w-4 h-4 text-muted-foreground"})})]})]})]}),C&&s.jsx("p",{className:"text-xs text-red-500",children:C}),s.jsx(n,{variant:"dark",size:"sm",onClick:q,disabled:m.isPending||j.isPending,children:m.isPending||j.isPending?s.jsxs(s.Fragment,{children:[s.jsx(F,{className:"w-4 h-4 animate-spin"}),"Changing Password..."]}):"Change Password"})]})]})]})]})},ts=()=>{const{data:t}=I(T.getSubInfo());return s.jsxs("div",{className:"bg-white border border-gray-200 rounded-lg p-4",children:[s.jsx("h4",{className:"text-lg font-semibold antialiased",children:"Billing & Usage"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage your subscription and usage"}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(W,{remarkPlugins:[X],className:"mt-5",children:t?.substring}),s.jsx(Y,{to:"/settings/subscription",children:s.jsxs(n,{size:"sm",children:[s.jsx(ss,{size:16})," Manage Subscription"]})})]})]})},ns=()=>s.jsxs("div",{className:"container max-w-4xl grid gap-6 md:grid-cols-3",children:[s.jsx("div",{className:"md:col-span-1",children:s.jsx(u,{className:"h-[290px]"})}),s.jsxs("div",{className:"md:col-span-2 space-y-6",children:[s.jsx(u,{className:"h-[200px]"}),s.jsx(u,{className:"h-[390px]"})]})]}),is=()=>s.jsxs("div",{children:[s.jsx("h4",{className:"text-lg font-semibold antialiased",children:"Billing & Usage"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage your subscription and usage"}),s.jsx(u,{className:"h-[200px] mt-5"})]});function Ns(){return s.jsxs("div",{children:[s.jsx($,{title:"Account",description:" Manage your account information and security settings."}),s.jsxs("div",{className:"container max-w-4xl space-y-10",children:[s.jsx(i.Suspense,{fallback:s.jsx(ns,{}),children:s.jsx(rs,{})}),s.jsx(i.Suspense,{fallback:s.jsx(is,{}),children:s.jsx(ts,{})})]})]})}export{Ns 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.