"use strict";(self.webpackChunkhws_app_profile=self.webpackChunkhws_app_profile||[]).push([[3],{1638:function(e,t,r){r.d(t,{r:function(){return n}});let n={GetUserDetail:{action:"HWS_APP_PROFILE_GET_USER_DETAIL",description:"Get the user detail",inputInterface:"",example:{}},GetUserMedia:{action:"HWS_APP_PROFILE_GET_USER_MEDIA",description:"Get the user media",inputInterface:"",example:{}},UpdateProfileCover:{action:"HWS_APP_PROFILE_UPDATE_PROFILE_COVER",description:"Update the profile cover",inputInterface:`interface UpdateProfileCover
    { 
      Data: any; 
    }`,example:{Data:{}}},RemoveProfileCover:{action:"HWS_APP_PROFILE_REMOVE_PROFILE_COVER",description:"Remove the profile cover",inputInterface:"",example:{}},UpdateUsername:{action:"HWS_APP_PROFILE_UPDATE_USERNAME",description:"Update the username",inputInterface:`interface UpdateUsername
    {
      Data: any;
    }`,example:{Data:{}}},UpdateProfilePicture:{action:"HWS_APP_PROFILE_UPDATE_PROFILE_PICTURE",description:"Update the profile picture",inputInterface:`interface UpdateProfilePicture
    {
      Data: any;
    }`,example:{Data:{}}},RemoveProfilePicture:{action:"HWS_APP_PROFILE_REMOVE_PROFILE_PICTURE",description:"Remove the profile picture",inputInterface:"",example:{}},UpdateUserProfile:{action:"HWS_APP_PROFILE_UPDATE_USER_PROFILE",description:"Update the user profile",inputInterface:`interface UpdateUserProfile
    {
      Data: any;
    }`,example:{Data:{}}},GetUserProfile:{action:"HWS_APP_PROFILE_GET_USER_PROFILE",description:"Get the user profile",inputInterface:"",example:{}},InsertUserProfile:{action:"HWS_APP_PROFILE_INSERT_USER_PROFILE",description:"Insert the user profile",inputInterface:`interface InsertUserProfile
    {
      Data: any;
    }`,example:{Data:{}}},ChangeEmail:{action:"HWS_APP_PROFILE_CHANGE_EMAIL",description:"Change the user email",inputInterface:`interface ChangeEmail
    {
      Email: any;
    }`,example:{Email:{}}},ChangePassword:{action:"HWS_APP_PROFILE_CHANGE_PASSWORD",description:"Change the authenticated user's password",inputInterface:`interface ChangePasswordInput {
  OldPassword: string;
  Password: string;
  ConfirmPassword: string;
}`,example:{OldPassword:"currentPassword123",Password:"StrongP@ssw0rd!",ConfirmPassword:"StrongP@ssw0rd!"}}}},2797:function(e,t,r){r.d(t,{DE:function(){return i},jL:function(){return n}});let n=()=>window?.HWS?.StoreHooks?.useAppDispatch?.(),a=e=>window?.HWS?.StoreHooks?.useAppSelector(e);function i(e,t){return a(r=>{let n=window?.HWS?.Slice,a=n?.getSlice(e)?.selectors?.[t];return a?a(r):void 0})}},5628:function(e,t,r){r.d(t,{X:function(){return a}});let n=e=>"string"==typeof e&&/^(?:[A-Z0-9+\/]{4})*(?:[A-Z0-9+\/]{2}==|[A-Z0-9+\/]{3}=)?$/i.test(e),a={IsBase64:n,DataMediaStringToBase64:e=>{if(!e||!(e.length>0))return null;{if(n(e))return e;let t=null;return t=Array.isArray(e)?e:e.split(",").map(e=>parseInt(e)),window.btoa(new Uint8Array(t).reduce((e,t)=>e+String.fromCharCode(t),""))}}}},5804:function(e,t,r){r.r(t),r.d(t,{default:function(){return v}});var n=r(1995),a=r(9262),i=r(6043),o=r(6385),s=r(3646),c=r(9434),l=r(8804),u=r(4421),p=r(8168),d=r(8587),f=r(4164),m=r(5659),h=r(6323),P=r(4052),g=r(8413),A=r(1609);function S(e){return(0,A.Ay)("MuiIcon",e)}(0,g.A)("MuiIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);let E=["baseClassName","className","color","component","fontSize"],_=e=>{let{color:t,fontSize:r,classes:n}=e,a={root:["root","inherit"!==t&&`color${(0,P.A)(t)}`,`fontSize${(0,P.A)(r)}`]};return(0,m.A)(a,S,n)},I=(0,a.Ay)("span",{name:"MuiIcon",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,"inherit"!==r.color&&t[`color${(0,P.A)(r.color)}`],t[`fontSize${(0,P.A)(r.fontSize)}`]]}})(e=>{let{theme:t,ownerState:r}=e;return{userSelect:"none",width:"1em",height:"1em",overflow:"hidden",display:"inline-block",textAlign:"center",flexShrink:0,fontSize:({inherit:"inherit",small:t.typography.pxToRem(20),medium:t.typography.pxToRem(24),large:t.typography.pxToRem(36)})[r.fontSize],color:({primary:(t.vars||t).palette.primary.main,secondary:(t.vars||t).palette.secondary.main,info:(t.vars||t).palette.info.main,success:(t.vars||t).palette.success.main,warning:(t.vars||t).palette.warning.main,action:(t.vars||t).palette.action.active,error:(t.vars||t).palette.error.main,disabled:(t.vars||t).palette.action.disabled,inherit:void 0})[r.color]}}),w=c.forwardRef(function(e,t){let r=(0,h.A)({props:e,name:"MuiIcon"}),{baseClassName:a="material-icons",className:i,color:o="inherit",component:s="span",fontSize:c="medium"}=r,l=(0,d.A)(r,E),u=(0,p.A)({},r,{baseClassName:a,color:o,component:s,fontSize:c}),m=_(u);return(0,n.jsx)(I,(0,p.A)({as:s,className:(0,f.A)(a,"notranslate",m.root,i),ownerState:u,"aria-hidden":!0,ref:t},l))});w.muiName="Icon";var y=r(2797),R=r(5628),x=r(1638),U=r(6701);(0,a.Ay)("div")(e=>{let{theme:t}=e;return{"& .username, & .email":{transition:t.transitions.create("opacity",{duration:t.transitions.duration.shortest,easing:t.transitions.easing.easeInOut})},"& .avatar":{background:(0,l.darken)(t.palette.background.default,.05),transition:t.transitions.create("all",{duration:t.transitions.duration.shortest,easing:t.transitions.easing.easeInOut}),bottom:0,"& > img":{borderRadius:"50%"}}}});var v=function(){let[e,t]=(0,c.useState)(null),[r,a]=(0,c.useState)(!1),l=(0,y.DE)("user","selectUser"),p=(0,s.useDispatch)(),d=(0,c.useRef)(null),m=async e=>{if(e.target.files&&0!==e.target.files.length){var r=new FileReader;r.onload=function(){let e=new Uint8Array(this.result);t(e?.toString())},r.readAsArrayBuffer(e.target.files[0])}};return(0,c.useEffect)(()=>{(async()=>{if(null!=e){let t=e.split(",").map(e=>parseInt(e)),r={...l},n={...l?.data};n.photo=t,r.data=n;let a=window?.HWS?.Slice,i=window?.HWS?.StoreHooks;if(!a||!i?.useAppDispatch)return;let o=a.getSlice?.("user");if(o?.actions?.updateUser){p(o.actions.updateUser(r));try{await (0,U.XE)(x.r.UpdateProfilePicture.action,{Data:{Photo:t}})}catch(e){console.error("Error updating user photo:",e)}}}})()},[e,l,p]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"mb-24 flex items-center justify-center",children:(0,n.jsx)("div",{onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:(0,n.jsxs)(i.A,{style:{border:"1px solid white",width:"150px",height:"150px",objectFit:"cover",background:r?"rgba(0, 0, 0, 0.7)":"rgba(0, 0, 0, 0)"},className:"avatar uppercase h-96 w-96 text-32 font-bold",children:[(l?.data?.photo!=null||null!=e)&&(0,n.jsx)("img",{src:(()=>{let e=l?.data?.photo;if(null!=e){if("string"==typeof e&&R.X.IsBase64(e))return"data:image/jpg;base64,"+e;if(e instanceof Uint8Array||e instanceof Array)return"data:image/jpg;base64,"+R.X.DataMediaStringToBase64(e)}return null})()??"",style:{width:"150px",height:"150px",alignItems:"center",justifyContent:"center",objectFit:"cover"}}),(0,n.jsxs)(u.A,{className:(0,f.A)("w-40 h-40"),"aria-controls":"font-size-menu","aria-haspopup":"true",onClick:()=>d.current?.click(),size:"large",style:{height:"150px",alignItems:"center",justifyContent:"center",borderRadius:"100%",position:"absolute",width:"150px",textAlign:"center",opacity:r||l?.data?.photo==null?"1":"0"},children:[(0,n.jsx)("input",{type:"file",accept:"image/*",onChange:m,ref:d,style:{display:"none"}}),(0,n.jsx)(w,{children:"local_see"})]})]})})}),(0,n.jsx)(o.A,{className:"username whitespace-nowrap text-14 font-medium",children:l?.data?.displayName}),(0,n.jsx)(o.A,{className:"email whitespace-nowrap text-13 font-medium",color:"text.secondary",children:l?.data?.email})]})}},6701:function(e,t,r){function n(e){let t=window;if(!t.core||!t.core[e]){console.warn(`[coreExports] window.core.${String(e)} not ready`);return}return t.core[e]}r.d(t,{Eb:function(){return i},L5:function(){return s},Ow:function(){return a},XE:function(){return c},ri:function(){return o}}),n("Error404Page");let a=n("FusePageCarded"),i=n("FuseLoading");n("FuseDialog");let o=n("FuseSvgIcon"),s=n("FusePageSimple");n("FuseSplashScreen"),n("NavLinkAdapter"),n("Store"),n("UnAuthorized"),n("useThemeMediaQuery"),n("ErrorBoundary"),n("FuseLayout"),n("FuseTheme"),n("ThemeLayouts"),n("BrowserRouter"),n("FuseUtils"),n("WithRouter"),n("History"),n("HUIDynamic"),n("HWSRoutes"),n("HWSContext"),n("HorizechWorkspaceProvider"),n("useHorizechWorkspace"),n("RunAction"),n("RunFormAction");let c=n("InvokeAction");n("APIResult")}}]);