import{r as e,j as t,V as i,z as s}from"./react-B_SyE9nW.js";import{j as o,o as r,m as n,B as l,N as a,n as x,G as c,aq as d,aL as m,x as p,s as h,aM as u}from"./index-Flm6m8Wj.js";import{G as f,E as g,a as j}from"./index-26ReLSp7.js";import{B as w,T as y,M as v,a as b,I as C,f as _}from"./index-C6Ujt1Uk.js";import{N as S}from"./NoFound-BgX2Vk3k.js";import{P as F}from"./PictureBox-DPAYvVY_.js";import{U as k,I as M}from"./ItemLoading-wir9MCjq.js";import{S as L,L as I}from"./RatingReviewTitle-Bqj_kx7V.js";import{U as B}from"./Url-C83vkALQ.js";import{B as T}from"./BtnSReply-ZToqTKfd.js";import{a as $}from"./UserListDetails--ukoLbPw.js";import{S as W}from"./Stack-CZ7Wid7r.js";import{B as P,S as E}from"./BtnSort-CbB_qjyl.js";import{R,F as z,B as D}from"./FldRadio-CJdXMDqh.js";import{F as A}from"./FldRadioSort-BW-wZt3R.js";import{A as U,U as N}from"./EditSuccessModal-B8mH-U4R.js";import{A as G}from"./ActivityBody-BbxtH-ez.js";import{B as O}from"./BtnFilter-CxjGcJB3.js";import{G as H}from"./Grid-DM22V-x0.js";import{T as Y,L as V}from"./Address-CoPTZTJZ.js";import{B as q}from"./BlogIco-DkSMegry.js";import{F as K}from"./FacebookIco-CKxniypy.js";import{I as Q}from"./InstagramIco-FM2l5CxY.js";import{T as X}from"./TwitterIco-PdpxZu2n.js";import{B as Z}from"./BtnChip-B3dT-p2i.js";import{b as J,E as ee,A as te}from"./Statistics-BfLJVsft.js";import{I as ie}from"./ImageIco-Y8PzbnMz.js";import{M as se}from"./MessageIco-DcDXaapk.js";import{P as oe}from"./ProfileIco-DxJkB7_v.js";import{S as re}from"./SearchIco-DT1PnKLK.js";import{T as ne}from"./styles-BKX5ijFq.js";import{D as le}from"./Divider-CSB2hYD2.js";const ae="--cnt-user-list-h",xe="--w-user-list-h",ce={overflow:"hidden",overflowY:"auto",height:`var(${ae})`,"& .enj-cnt-list-review":{height:`var(${xe})`}},de={position:"sticky",top:"0",height:"100%"},me={display:"flex",alignItems:"flex-start",p:"25px 0 20px",width:"100%",justifyContent:"flex-start"},pe={...me,borderTop:`1px solid ${o.lightGray}4d`},he=e.createContext({}),ue=r((()=>{const{store:i,style:s}=e.useContext(he);return i.isLoading||n.isLoading?null:t.jsx(l,{sx:ce,style:s,children:t.jsxs(W,{sx:de,children:[t.jsx(a,{size:"mini",margin:"15px auto",children:x("noListResult")}),t.jsx(S,{height:"180px"})]})})})),fe=r((()=>{const{mainListStr:i}=e.useContext(k);return i.hasMore&&i.isLoading?t.jsx(M,{}):t.jsx(t.Fragment,{})})),ge={DESKTOP:175,TABLET:133,MOBILE:117};const je=r((function(){const s=c.height,o=e.useContext(k),r=e.useMemo((()=>o.isMyProfile||o.isMyList),[o.isMyProfile,o.isMyList]),n=e.useMemo((()=>c.isMobile),[c.device]),{mainListStr:a}=o,m=e.useCallback((()=>a.loadData()),[]),p=e.useMemo((()=>({[ae]:s-269+"px",[xe]:s-172+"px"})),[s]);return t.jsx(he.Provider,{value:{store:a,style:p},children:t.jsx(l,{sx:ce,style:p,children:t.jsx(l,{sx:de,children:t.jsx(i,{style:{height:"100%",width:"100%"},data:a.getElements,endReached:m,overscan:1.25*c.height,itemContent:(e,{item_identifier:i,name:s,front_picture:a,updated_at:m,is_bookmarked:p,description:h,visibility:u,is_editable:f,num_elements:g,main_city:j,slug:v})=>t.jsxs(l,{sx:{position:"relative",maxWidth:"calc(100% - 20px)",mx:"auto"},children:[t.jsx(B,{route:d("route.list.build",{slug:v})}),t.jsxs(w,{sx:e?pe:me,onClick:()=>o.onClickUserList(v),children:[t.jsx(F,{src:a,alt:x("alt.top.list"+(j?".city":""),{name:s,city:j}),width:n?65.5:168,height:n?65.5:114,mid:n,radius:n?"8px":"20px"}),t.jsxs(W,{sx:{alignItems:"flex-start",ml:"14px",pr:"20px","& > p":{pr:"5px"},"@media(min-width:768px)":{py:"0",minHeight:"114px",justifyContent:"space-between"}},children:[t.jsxs(W,{sx:{mb:"10px","& > h3":{mt:"-2px",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":"2",overflow:"hidden","@media(min-width:1366px)":{"-webkit-line-clamp":"1"}}},children:[t.jsx(y,{text:s,size:c.isDesktop?"small":"micro",align:"start",margin:"0",variant:"h3"}),t.jsx($,{updated_at:m,num_elements:g,visibility:u,isList:r})]}),n||!h?t.jsx(t.Fragment,{}):t.jsx(L,{margin:"0",align:"start",size:"micro",baseReadMore:ge,children:h})]})]}),r&&f||!r?t.jsx(T,{is_bookmarked:p,listType:I.TYPE_LIST,name:s,src:a,description:h,visibility:u,item_identifier:i,fromMyProfile:r,cb:o.onBookmarkCb}):t.jsx(t.Fragment,{})]}),rangeChanged:a.hasMore?({endIndex:e})=>{e>=a.offset&&!a.isLoading&&a.loadData()}:void 0,components:{Footer:fe,EmptyPlaceholder:ue}})})})})}));const we=r((function(){const{mainListStr:i}=e.useContext(k),{onCloseSort:s,onChangeSortDirection:o,onChangeSortBy:r,onClickApplySort:l}=i;return t.jsxs(v,{open:n.isSortUserLists,onClose:s,children:[t.jsx(y,{text:`${x("sortListsBy")}:`,margin:"8px 0 20px"}),t.jsx(A,{value:i.getSortDirection,onChange:o}),t.jsxs(R,{"aria-label":"sort-lists-order",defaultValue:m.CREATED,value:i.getSortBy,onChange:r,style:{marginTop:20,marginBottom:40},children:[t.jsx(z,{value:m.CREATED,label:x("creationDate")}),t.jsx(z,{value:m.UPDATED,label:x("updatedDate")})]}),t.jsx(D,{style:{marginBottom:18},onClick:l})]})})),ye={textAlign:"end",m:"1px 0 10px","@media(min-width:768px)":{m:"16px 0 20px"}};const ve=r((function(){const{mainListStr:i}=e.useContext(k);return i.getSize||n.isLoading?t.jsxs(l,{sx:ye,children:[t.jsx(P,{onClick:i.onClickSort}),t.jsx(we,{})]}):t.jsx(t.Fragment,{})})),be={position:"sticky",top:0,bgcolor:o.white,pb:"10px",mt:0,justifyContent:"space-evenly","@media(min-width:768px)":{mx:"auto",justifyContent:"center","& > .MuiButtonBase-root:last-of-type":{ml:"12px"}}};const Ce=r((function(){const i=e.useContext(U),{onClickFilter:s,onClickSort:o}=i;return i.getActivities.length||i.hasFilters?t.jsxs(H,{container:!0,sx:be,children:[t.jsx(O,{onClick:s,count:i.getFilterCount}),t.jsx(P,{onClick:o})]}):t.jsx(t.Fragment,{})})),_e="--cnt-user-act-h",Se="--w-user-act-h",Fe={overflow:"hidden",overflowY:"auto",height:`var(${_e})`,"& .enj-cnt-list-review":{height:`var(${Se})`}},ke={position:"sticky",top:0,"& .enj-activity-list":{height:c.height-264+"px",m:"auto"}};const Me=r((function(){const i=c.height,s=e.useContext(k),o=e.useMemo((()=>({[_e]:i-222+"px",[Se]:i-172+"px"})),[i]);return t.jsx(l,{sx:Fe,style:o,children:t.jsx(l,{sx:ke,children:t.jsxs(U.Provider,{value:s.getActivityStr,children:[t.jsx(Ce,{}),t.jsx(G,{})]})})})})),Le={"@media(min-width:768px)":{maxWidth:"608px",mx:"auto",pb:"4px"},"@media(min-width:1366px)":{maxWidth:"720px"}};const Ie=r((function(){const{tab:i,username:o}=s(),r=e.useMemo((()=>[{name:"activity",children:t.jsx(Me,{})},{name:"gallery",children:t.jsx(f,{})},{name:"lists",children:t.jsxs(t.Fragment,{children:[t.jsx(ve,{}),t.jsx(je,{})]})}]),[]),n=e.useMemo((()=>{const e=r.findIndex((e=>x(e.name).toLowerCase()===i));return-1!==e?e:1}),[i]);return t.jsx(l,{sx:Le,children:t.jsx(g,{draggable:!c.isDesktop,tabs:r.map(((e,i)=>t.jsx(Y,{label:t.jsx(b,{weight:500,color:"white",size:"micro",text:x(e.name),variant:"h2"}),"data-test":`enj-users-${i}`,onClick:()=>{return t=e.name,history.replaceState("","",`/${p.language}${x(o?"route.profile.build.nav":"route.my.profile.build",{tab:x(t),username:o}).toLowerCase()}`);var t}},`enj-usr-tab-${i}`))),tabItems:r.map(((e,i)=>t.jsx(j,{children:e.children},`enj-usr-tab-${i}`))),defaultTab:n,jump:!0})})})),{white:Be,grayLighter:Te,black:$e,yellowLight:We,yellow:Pe,brown:Ee,darkRed:Re}=o,ze=h(H)`
  flex-direction: column;

  & .MuiSvgIcon-root {
    width: 18px;
    height: 18px;
    color: ${Te};
    position: relative;
    bottom: 1px;
  }

  & .MuiChip-root {
    max-height: 22px;
    padding: 0 !important;
    text-transform: uppercase;
    min-width: unset !important;
    color: ${({color:e})=>e===Ee||e===Re?Be:$e};
    border: 1px solid ${Te};
    border-radius: 8px;
    margin-left: 5px;
    position: relative;
    top: -2px;
    background-color: ${({color:e})=>e};
    letter-spacing: 0.5px;

    & span {
      font-size: 10px;
      font-weight: 600;
      padding: 0 4px;
    }
  }

  & span {
    font-size: 12px;
  }
`,De=[Be,Be,We,We,Pe,Pe,Ee,Ee,Re,Re],Ae={display:"inline-flex",width:"100%",justifyContent:"flex-start",mt:"4px",alignSelf:"self-start","@media(min-width:768px)":{mt:"9px"}};const Ue=r((function(){const i=e.useContext(k),{activity_level:s,activity_level_str:o,num_of_images:r,num_of_reviews:n,foodie_level:c,foodie_level_str:d,username:m,city:p,country:h}=i.getProfile;return t.jsxs(ze,{alignItems:"center",container:!0,color:De[Number(c)],children:[t.jsxs(l,{sx:{"& > span":{position:"relative",top:"-2px"},alignSelf:"self-start",display:"flex",alignItems:"center"},className:"enj-foodie-lvl",children:[t.jsx(a,{margin:"0",sx:{textWrap:"nowrap"},children:x("foodieLevel")}),d?t.jsx(Z,{label:d,size:"small"}):t.jsx(t.Fragment,{})]}),t.jsxs(l,{sx:Ae,children:[t.jsx(se,{}),t.jsx(J,{value:n}),t.jsx(ie,{}),t.jsx(J,{value:r}),t.jsx(ee,{title:String(o),children:t.jsx(te,{level:s||0})})]}),t.jsxs(l,{sx:{...Ae,"& span.enj-users-username":{cursor:"text",userSelect:"text"}},children:[t.jsx(oe,{sx:{bottom:"-1px",marginRight:"5px"}}),t.jsxs(a,{className:"enj-users-username",fontStyle:"italic",margin:"0",children:["@",m]})]}),t.jsxs(l,{sx:Ae,children:[t.jsx(V,{sx:{bottom:"-1px",marginRight:"5px"}}),t.jsxs(a,{fontStyle:"italic",margin:"0",align:"start",children:[p,", ",h]})]})]})})),Ne={display:"grid",gridTemplateColumns:"1fr",columnGap:"2em",rowGap:"8px",height:"fit-content","& > .MuiBox-root > .MuiSvgIcon-root":{width:"auto",height:"16px","@media(min-width:768px)":{height:"18px"},"@media(min-width:1366px)":{height:"20px"}},"& picture":{background:"unset",width:"14px",height:"14px",minWidth:"14px",overflow:"hidden","& > img":{height:"auto"}},"& span":{ml:"5px",fontSize:"13px"},maxWidth:"calc((100vw - 40px) / 2)","& > .MuiBox-root":{cursor:"pointer",maxWidth:"inherit",display:"flex",alignItems:"center",justifySelf:"flex-start","& > span":{overflow:"hidden",textOverflow:"ellipsis"},"& img":{minWidth:"14px",objectFit:"contain"}}},Ge={display:"grid",gridTemplateColumns:"1fr 1fr",columnGap:"5px",mt:"10px",mb:"15px",pl:"5px",maxWidth:"calc(100vw - 40px)"},Oe={Instagram:Q,Facebook:K,Twitter:X},He=r((function(){var i;const s=e.useContext(k),{web_url:o,profile_name:r,...n}=s.getProfile;return t.jsxs(l,{sx:Ne,className:"enj-social-container",children:[null==(i=n.social_networks)?void 0:i.map((({uuid:e,url:i,username:s,social_network:{name:o}})=>{const n=Oe[o]||q;return t.jsxs(l,{onClick:()=>window.open(i),children:[t.jsx(B,{route:i,origin:!1}),t.jsx(n,{}),t.jsx(a,{color:"red",children:/id=/.test(s)?r:s})]},e)})),o?t.jsxs(l,{onClick:()=>window.open(o),children:[t.jsx(B,{route:o,origin:!1}),t.jsx(q,{}),t.jsx(a,{color:"red",children:o.replace(/https?:\/\//gi,"")})]}):t.jsx(t.Fragment,{})]})}));const Ye=r((function(){return t.jsxs(l,{sx:Ge,children:[t.jsx(Ue,{}),t.jsx(He,{})]})})),Ve={"&":{position:"relative",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",width:"102px",height:"102px",top:"-18px",border:"5px solid white",zIndex:3,overflow:"hidden",bgcolor:o.grayMap,"& > .MuiBox-root":{width:"100%",height:"100%",minWidth:"unset",minHeight:"unset"},"@media(min-width:768px)":{width:"144px",height:"144px"}}};const qe=r((function({src:i,profile_name:s,city:o=""}){const r=e.useRef({}),n=e.useRef({}),a=e.useMemo((()=>c.isMobile?102:144),[c.device]),d=e.useCallback((()=>{const e=r.current.scrollTop;let t=0;e<=50&&(t=1-(e-5)/50),n.current.style.opacity=String(t)}),[]);return e.useLayoutEffect((()=>{r.current=document.getElementById("enj-user-profile-id")}),[]),e.useEffect((()=>(r.current.addEventListener("scroll",d),()=>{r.current.removeEventListener("scroll",d)})),[]),t.jsx(l,{ref:n,sx:Ve,children:t.jsx(F,{src:i,width:a,height:a,alt:x("alt.user",{profile_name:s,city:o}),radius:"50%"})})})),Ke={display:"grid",gridTemplateColumns:"1fr 1fr",columnGap:"5px",bgcolor:o.white,maxWidth:"calc(100vw - 40px)"},Qe={display:"grid",gridTemplateColumns:"1fr 1fr",pt:"15px","& .MuiButtonBase-root":{display:"flex",flexDirection:"column","& > span":{color:o.red,"&.number-cls":{fontWeight:"bold!important"}}}},Xe=r((function({isMyProfile:i}){const s=e.useContext(k),r=s.getProfile;return t.jsxs(l,{sx:Qe,children:[t.jsxs(w,{onClick:s.onClickFollowed,disabled:!r.num_of_followed,children:[t.jsx(a,{className:"number-cls",children:r.num_of_followed}),t.jsx(a,{size:"mini",children:x("followed")})]}),t.jsxs(w,{onClick:s.onClickFollowers,disabled:!r.num_of_followers,children:[t.jsx(a,{className:"number-cls",children:r.num_of_followers}),t.jsx(a,{size:"mini",children:x("followers")})]}),t.jsx(w,{onClick:s[i?"onClickEditMyProfile":"onClickFollowState"],sx:{"&":{gridColumn:"1/3",bgcolor:o[r.following?"yellowLight":"red"],color:o[r.following?"red":"white"],borderRadius:1,height:"34px",fontSize:"16px",fontWeight:500,mt:"20px"}},children:x(i?"editProfile":r.following?"following":"follow")})]})}));const Ze=r((function({isMyProfile:i}){const s=e.useContext(k).getProfile;return t.jsxs(l,{sx:Ke,children:[t.jsxs(l,{"data-test":"enj-users-profilename",children:[t.jsx(qe,{src:s.picture,profile_name:s.profile_name,city:s.city}),t.jsx(y,{"data-test":"enj-users-profilename",text:`${s.profile_name||""}`,align:"start",margin:"-10px 0 0 5px",variant:"h1",sx:{cursor:"text",userSelect:"text"}})]}),t.jsx(Xe,{isMyProfile:i})]})})),Je={display:"grid",gridTemplateColumns:"auto 1fr 1fr",maxWidth:"608px",m:"0 auto 28px",gap:"0 25px","@media(min-width:1366px)":{gap:"0 18px",maxWidth:"720px",gridTemplateColumns:"auto 1fr 1fr 1fr"}},et={pt:"55px","& .enj-foodie-lvl":{mb:"10px"},"@media (min-width:1366px)":{pt:"26px",maxWidth:"175px"}},tt={maxWidth:"219.5px","@media (min-width:1366px)":{maxWidth:"175px"},"& .enj-social-container":{maxWidth:"inherit","& > .MuiBox-root":{maxWidth:"inherit"}}},it={...tt,pt:"100px"},st={"& > .MuiBox-root:first-of-type":{mb:"20px"},...tt,"@media (min-width:1366px)":{pt:"15px"}};const ot=r((function({isMyProfile:i}){const s=e.useContext(k).getProfile;return t.jsxs(l,{sx:Je,"data-test":"enj-users-profilename",children:[t.jsx(qe,{src:s.picture,profile_name:s.profile_name,city:s.city}),t.jsxs(W,{sx:et,children:[t.jsx(y,{text:`${s.profile_name||""}`,align:"start",margin:"0 0 5px",size:"medium",variant:"h1",dataTest:"enj-users-profilename",sx:{cursor:"text",userSelect:"text"}}),t.jsx(Ue,{})]}),c.isDesktop?t.jsx(W,{sx:it,children:t.jsx(He,{})}):t.jsx(t.Fragment,{}),t.jsxs(W,{sx:st,children:[t.jsx(Xe,{isMyProfile:i}),c.isDesktop?t.jsx(t.Fragment,{}):t.jsx(He,{})]})]})}));const rt=r((function(){const i=e.useContext(k);return t.jsxs(v,{open:i.isFollow,onClose:()=>{i.setFollow(),i.getSortFollowSearch.onChange("")},children:[t.jsxs(l,{sx:{maxWidth:"274px",m:"auto"},children:[t.jsxs(l,{sx:{position:"relative",background:o.red,width:"100%",mx:"auto",borderRadius:"30px",height:"41px",display:"flex",justifyContent:"space-between",alignItems:"center","& .MuiButtonBase-root":{height:"41px",border:`1px solid ${o.red}`,width:"fit-content",minWidth:"137px",borderRadius:"30px",fontSize:"12px",color:o.white,opacity:.8,"&.enj-active":{opacity:1,background:o.white,color:o.red},"&.Mui-disabled":{color:o.white,fontWeight:"normal",opacity:.4,background:"transparent"}}},children:[t.jsx(w,{className:i.isFollowed?"enj-active":"",onClick:()=>i.setFollow(u.FOLLOWED),disabled:!i.hasFollowing,children:`${x("followed")} (${i.getFollowing.length})`}),t.jsx(w,{className:i.isFollowers?"enj-active":"",onClick:()=>i.setFollow(u.FOLLOWERS),disabled:!i.hasFollowers,children:`${x("followers")} (${i.getFollowers.length})`})]}),t.jsxs(l,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",fontSize:"12px",fontWeight:500,mt:"12px",pl:"10px"},children:[`${x("sortBy")}: ${x(i.isFollowRecent?"newest":"oldest")}`,t.jsx(C,{onClick:i.onClickSortFollow,sx:{border:`1px solid ${o.red}`,width:"31px",height:"31px","& .MuiSvgIcon-root":{width:"auto",height:"18px"}},children:t.jsx(E,{})})]}),t.jsx(ne,{onChange:e=>{const t=e.target.value;i.getSortFollowSearch.onChange(t),i.onFilterSearchFollow()},value:i.getSortFollowSearch.value,placeholder:x("search"),sx:{"& fieldset":{inset:0}},InputProps:{startAdornment:t.jsx(re,{}),endAdornment:i.getSortFollowSearch.value?t.jsx(C,{sx:{position:"relative",right:"-12px"},onClick:()=>{i.getSortFollowSearch.onChange(""),i.onFilterSearchFollow()},children:t.jsx(_,{})}):t.jsx(t.Fragment,{})}})]}),t.jsxs(l,{sx:{position:"relative",maxHeight:"89%",height:"384px",overflow:"hidden",overflowY:"auto"},children:[t.jsx(l,{sx:{position:"absolute",width:"100%",top:0,left:0,visibility:i.isFollowed?"visible":"hidden",zIndex:i.isFollowed?2:0},children:i.getFollowing.map((({username:s,profile_name:o,activity_level_str:r,num_of_images:n,num_of_reviews:l,activity_level:a,picture:c,city:d})=>t.jsxs(e.Fragment,{children:[t.jsx(N,{onClickToUser:i.onClickToUser,src:c,name:String(o||`@${s}`),username:s,alt:x("alt.user",{city:null==d?void 0:d.name,profile_name:o}),statics:{images:n,messages:l,activity_level:a,activity_level_str:r}}),t.jsx(le,{})]},`following_${s}`)))}),t.jsx(l,{sx:{position:"absolute",width:"100%",top:0,left:0,visibility:i.isFollowers?"visible":"hidden",zIndex:i.isFollowers?2:0},children:i.getFollowers.map((({username:s,profile_name:o,activity_level_str:r,num_of_images:n,num_of_reviews:l,activity_level:a,picture:c,city:d})=>t.jsxs(e.Fragment,{children:[t.jsx(N,{onClickToUser:i.onClickToUser,src:c,name:String(o||`@${s}`),username:s,alt:x("alt.user",{city:null==d?void 0:d.name,profile_name:o}),statics:{images:n,messages:l,activity_level:a,activity_level_str:r}}),t.jsx(le,{})]},`followers_${s}`)))})]})]})}));export{rt as F,Ze as H,Ie as U,Ye as a,ot as b};