1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[21379],{861:(e,s,a)=>{a.d(s,{Qg:()=>l,bL:()=>i});var t=a(12115),r=a(97602),n=a(95155),l=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),o=t.forwardRef((e,s)=>(0,n.jsx)(r.sG.span,{...e,ref:s,style:{...l,...e.style}}));o.displayName="VisuallyHidden";var i=o},12774:(e,s,a)=>{a.d(s,{v:()=>f});var t=a(95155),r=a(13744),n=a(20865),l=a(15653);let o=l.z.object({firstName:l.z.string().min(1,"Há» l\xe0 bắt buá»c"),lastName:l.z.string().min(1,"T\xean l\xe0 bắt buá»c"),email:l.z.string().optional(),phone:l.z.string().optional(),userName:l.z.string().optional(),password:l.z.string().optional(),oldPassword:l.z.string().optional(),confirmPassword:l.z.string().optional()}).refine(e=>!e.password||!(e.password.trim().length>0)||e.oldPassword&&e.oldPassword.trim().length>0,{message:"Vui l\xf2ng nháºp máºt khẩu cÅ© khi thay Äá»i máºt khẩu",path:["oldPassword"]}).refine(e=>{if(e.password&&e.password.trim().length>0){var s;return 0===(null!=(s=e.confirmPassword)?s:"").length||e.password===e.confirmPassword}return!0},{message:"X\xe1c nháºn máºt khẩu kh\xf4ng khá»p",path:["confirmPassword"]}),i={incorrectOldPassword:"Máºt khẩu cÅ© kh\xf4ng ch\xednh x\xe1c",duplicateUserName:"T\xean ÄÄng nháºp Ä\xe3 tá»n tại",duplicateEmail:"Email Ä\xe3 ÄÆ°á»£c sá» dụng",duplicatePhone:"Sá» Äiá»n thoại Ä\xe3 ÄÆ°á»£c sá» dụng"};var d=a(66942),c=a(60919),u=a(61362),m=a(52056),h=a(96199),p=a(12115),v=a(22544),w=a(18720);function f(e){let{initialData:s,onSuccess:a}=e,{data:l}=(0,h.wV)(),[f,g]=(0,p.useState)("info"),[x,N]=(0,p.useState)(!1),j=(0,p.useMemo)(()=>{var e,a,t,r,n;return{firstName:null!=(e=null==s?void 0:s.firstName)?e:"",lastName:null!=(a=null==s?void 0:s.lastName)?a:"",email:null!=(t=null==s?void 0:s.email)?t:"",phone:null!=(r=null==s?void 0:s.phone)?r:"",userName:null!=(n=null==s?void 0:s.userName)?n:"",password:"",oldPassword:"",confirmPassword:""}},[null==s?void 0:s.firstName,null==s?void 0:s.lastName,null==s?void 0:s.email,null==s?void 0:s.phone,null==s?void 0:s.userName]),b=(0,v.mN)({resolver:(0,d.u)(o),values:j}),{formState:{isSubmitting:k}}=b;async function P(e){var s,o,d,h,p;let v=!!((null==(s=e.password)?void 0:s.trim())&&(null==(o=e.oldPassword)?void 0:o.trim()));try{let s={firstName:e.firstName,lastName:e.lastName};if(v&&(s.password=e.password,s.oldPassword=e.oldPassword),await r.A.patchApi("/api/v1/auth/me",s,null==l||null==(d=l.user)?void 0:d.accessToken),v){w.toast.success("Äá»i máºt khẩu th\xe0nh c\xf4ng. Vui l\xf2ng ÄÄng nháºp lại.",{duration:3e3,icon:(0,t.jsx)(u.A,{className:"h-4 w-4 text-green-600"})}),setTimeout(()=>(0,n.CI)({callbackUrl:"/"}),2e3);return}w.toast.success("Cáºp nháºt th\xf4ng tin th\xe0nh c\xf4ng",{duration:5e3,icon:(0,t.jsx)(u.A,{className:"h-4 w-4 text-green-600"})}),null==a||a(e)}catch(e){if(e instanceof c.pe){let s=null==(h=e.response)?void 0:h.data;(null==s?void 0:s.message)?w.toast.error("Cáºp nháºt th\xf4ng tin lá»i",{description:null!=(p=null==i?void 0:i[s.message])?p:s.message,duration:5e3,icon:(0,t.jsx)(m.A,{className:"h-4 w-4 text-red-500"})}):(null==s?void 0:s.errors)&&r.A.handleFormErrorFromResponse(b,s.errors,i)}else w.toast.error("Cáºp nháºt th\xf4ng tin lá»i",{description:"Lá»i kết ná»i Äến m\xe1y chá»§.",duration:5e3,icon:(0,t.jsx)(m.A,{className:"h-4 w-4 text-red-500"})})}}return{form:b,onSubmit:P,isSubmitting:k,activeTab:f,setActiveTab:g,openChangePassword:x,setOpenChangePassword:N}}},18794:(e,s,a)=>{a.d(s,{A:()=>l});var t=a(95155);a(12115);var r=a(86948),n=a(20243);function l(){return(0,t.jsxs)(r.Zp,{className:"mx-auto w-full",children:[(0,t.jsxs)(r.aR,{children:[(0,t.jsx)(n.E,{className:"h-8 w-48"})," "]}),(0,t.jsx)(r.Wu,{children:(0,t.jsxs)("div",{className:"space-y-8",children:[(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)(n.E,{className:"h-4 w-16"})," ",(0,t.jsx)(n.E,{className:"h-32 w-full rounded-lg"})," "]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(n.E,{className:"h-4 w-24"})," ",(0,t.jsx)(n.E,{className:"h-10 w-full"})," "]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(n.E,{className:"h-4 w-20"})," ",(0,t.jsx)(n.E,{className:"h-10 w-full"})," "]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(n.E,{className:"h-4 w-16"})," ",(0,t.jsx)(n.E,{className:"h-10 w-full"})," "]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(n.E,{className:"h-4 w-24"})," ",(0,t.jsx)(n.E,{className:"h-32 w-full"})," "]}),(0,t.jsx)(n.E,{className:"h-10 w-28"})]})})]})}},20865:(e,s,a)=>{a.d(s,{CI:()=>c,IL:()=>i,Jv:()=>d,LN:()=>o,mD:()=>l});var t=a(96199),r=a(75746),n=a(69715);function l(){return window.location.host}function o(){let e="true"===sessionStorage.getItem("preview_mode")?new URLSearchParams(window.location.search).get("previewTemplate"):null;return e?"/?previewTemplate=".concat(e):"/"}function i(){return"true"===sessionStorage.getItem("preview_mode")}function d(e,s){return i()?(r.k.getState().setUser(n._o),Promise.resolve({code:null,error:null})):(0,t.Jv)(e,s)}function c(e){return i()?(r.k.getState().clearUser(),Promise.resolve(void 0)):(0,t.CI)(e)}},24316:(e,s,a)=>{a.d(s,{s:()=>l});var t=a(13744),r=a(96199),n=a(85400);function l(){let{data:e,status:s}=(0,r.wV)(),{data:a,mutate:l}=(0,n.Ay)("authenticated"===s?"/api/v1/auth/me":null,s=>t.A.fetchApi(s,null==e?void 0:e.accessToken).then(e=>
1null!=e?e:null).catch(()=>null),{revalidateOnFocus:!1});return{user:null!=a?a:null,mutate:l}}},41052:(e,s,a)=>{a.d(s,{C5:()=>g,MJ:()=>w,Rr:()=>f,eI:()=>p,lR:()=>v,lV:()=>d,zB:()=>u});var t=a(95155),r=a(12115),n=a(32467),l=a(22544),o=a(64269),i=a(76444);let d=l.Op,c=r.createContext({}),u=e=>{let{...s}=e;return(0,t.jsx)(c.Provider,{value:{name:s.name},children:(0,t.jsx)(l.xI,{...s})})},m=()=>{let e=r.useContext(c),s=r.useContext(h),{getFieldState:a}=(0,l.xW)(),t=(0,l.lN)({name:e.name}),n=a(e.name,t);if(!e)throw Error("useFormField should be used within <FormField>");let{id:o}=s;return{id:o,name:e.name,formItemId:"".concat(o,"-form-item"),formDescriptionId:"".concat(o,"-form-item-description"),formMessageId:"".concat(o,"-form-item-message"),...n}},h=r.createContext({});function p(e){let{className:s,...a}=e,n=r.useId();return(0,t.jsx)(h.Provider,{value:{id:n},children:(0,t.jsx)("div",{"data-slot":"form-item",className:(0,o.cn)("grid gap-2",s),...a})})}function v(e){let{className:s,...a}=e,{error:r,formItemId:n}=m();return(0,t.jsx)(i.J,{"data-slot":"form-label","data-error":!!r,className:(0,o.cn)("data-[error=true]:text-destructive",s),htmlFor:n,...a})}function w(e){let{...s}=e,{error:a,formItemId:r,formDescriptionId:l,formMessageId:o}=m();return(0,t.jsx)(n.DX,{"data-slot":"form-control",id:r,"aria-describedby":a?"".concat(l," ").concat(o):"".concat(l),"aria-invalid":!!a,...s})}function f(e){let{className:s,...a}=e,{formDescriptionId:r}=m();return(0,t.jsx)("p",{"data-slot":"form-description",id:r,className:(0,o.cn)("text-muted-foreground text-sm",s),...a}
1)}function g(e){var s;let{className:a,...r}=e,{error:n,formMessageId:l}=m(),i=n?String(null!=(s=null==n?void 0:n.message)?s:""):r.children;return i?(0,t.jsx)("p",{"data-slot":"form-message",id:l,className:(0,o.cn)("text-destructive text-sm",a),...r,children:i}):null}},75746:(e,s,a)=>{a.d(s,{k:()=>t});let t=(0,a(25959).v)()(e=>({user:null,setUser:s=>e({user:s}),updateCoin:s=>e(e=>({user:e.user?{...e.user,coin:Number(e.user.coin)+s}:null})),clearUser:()=>e({user:null})}))},76444:(e,s,a)=>{a.d(s,{J:()=>l});var t=a(95155);a(12115);var r=a(10489),n=a(64269);function l(e){let{className:s,...a}=e;return(0,t.jsx)(r.b,{"data-slot":"label",className:(0,n.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",s),...a})}}}]);
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.