1"use strict";(self.rspackChunkvagaro_websitebuilder_consumer=self.rspackChunkvagaro_websitebuilder_consumer||[]).push([[575],{98642(e,i,n){n.r(i),n.d(i,{default:()=>A});var s=n(74848),l=n(98767),t=n(96540);let a={pageTitle:"pageTitle-Myr7KN",contentContainer:"contentContainer-McmJrL",pageDescriptionContainer:"pageDescriptionContainer-YZcQvP",listContainer:"listContainer-itQrQ1",familyAndFriendList:"familyAndFriendList-pP6P0n",listTitle:"listTitle-NlDbcq"};var r=n(42271),o=n(31476),d=n(72834),c=n(86091),m=n(75563),u=n(24708),p=n(58011),h=n(6524),y=n(92656),f=n(86435),v=n(79874);let x=["John Smith","Sarah Johnson","Mike Wilson"],g=["Spouse","Child","Friend"],b=0;function j(){let e=b%x.length,i=x[e],n=g[e],[l,t]=i.split(" ");return b++,(0,s.jsx)("div",{className:(0,v.A)(f.A.familyAndFriendCardWrapper,"stenciled"),children:(0,s.jsxs)("div",{className:(0,v.A)(f.A.familyAndFriendCard),children:[(0,s.jsx)("div",{className:f.A.avatarContainer,children:(0,s.jsx)("div",{className:"stencil-item",style:{borderRadius:"50%",width:"40px",height:"40px"}})}),(0,s.jsxs)("div",{className:f.A.infoContainer,children:[(0,s.jsxs)("div",{className:(0,v.A)(f.A.nameAndPermissionsContainer,"stencil-wrapper stencil-item"),style:{height:"16px",marginBottom:"4px",width:"50%"},children:[(0,s.jsxs)("div",{className:(0,v.A)(f.A.name,"vg-subheading-font web-subheading-font web-builder-font-color"),children:[l," ",t]}),(0,s.jsx)("div",{className:f.A.permissionIconsContainer})]}),(0,s.jsx)("div",{className:(0,v.A)("vg-caption-title web-caption-title web-builder-font-color","stencil-item"),style:{width:"25%"},children:n})]}),(0,s.jsx)("div",{className:f.A.menuContainer,children:(0,s.jsx)("div",{style:{width:"16px",height:"16px"},className:"stencil-item"})})]})})}var F=n(60458);let C=()=>{let e=(0,F.G)(),i=Array(12).fill(null);return(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)("div",{className:(0,v.A)("vg-body-font web-body-font web-builder-font-color MyaccountWrapper",a.familyAndFriendsPage,"stenciled"),children:[(0,s.jsx)("div",{className:(0,v.A)(a.pageTitle,"vg-display-large web-display-large web-builder-font-color"),children:(0,s.jsx)("span",{className:"stencil-item",children:"Family & Friends"})}),(0,s.jsxs)("div",{className:a.contentContainer,children:[(0,s.jsxs)("div",{className:(0,v.A)(a.pageDescriptionContainer,{"stencil-item":!e}),children:[(0,s.jsx)("div",{className:(0,v.A)("vg-display-small web-display-small web-builder-font-color stencil-item"),style:{width:"50%",height:"18px",marginBottom:"4px"}}),(0,s.jsx)("div",{className:(0,v.A)("vg-body-font web-body-font web-builder-font-color stencil-item"),style:{width:"75%",height:"18px",marginBottom:"4px"}}),(0,s.jsx)("div",{className:(0,v.A)("vg-body-font web-body-font web-builder-font-color stencil-item"),style:{width:"75%",height:"18px",marginBottom:"4px"}})]}),(0,s.jsxs)("div",{className:a.listContainer,children:[(0,s.jsx)("div",{className:`${a.listTitle} vg-display-small web-display-small web-builder-font-color`,children:(0,s.jsx)("span",{className:"stencil-item",children:"Family"})}),(0,s.jsx)("div",{className:a.familyAndFriendList,children:i.map((e,i)=>(0,s.jsx)(j,{},`family-skeleton-${i}`))})]}),(0,s.jsx)("div",{className:a.buttonsContainer,children:(0,s.jsx)(t.Suspense,{children:(0,s.jsx)("div",{className:"stencil-wrapper",children:(0,s.jsx)(l.YU,{ButtononClick:()=>{},ButtonVariant:"ghost",children:"Add Family & Friends"})})})})]})]})})};var N=n(80736),w=n(75538);let A=()=>{let{fullName:e,profileData:i,device:n,version:f,module:v}=(0,d.J)(),x={fullName:e,userId:i?.userId??"",countryID:i?.countryID??1,device:n,version:f,module:v},[g,b]=(0,t.useState)(!1),[j,F]=(0,t.useState)(!1),[A,I]=(0,t.useState)(null),[S,k]=(0,t.useState)(!1),[B,P]=(0,t.useState)(!1);(0,t.useEffect)(()=>{window.scrollTo(0,0)},[]);let R=()=>{b(!1),F(!1),k(!1),P(!1),I(null)},T=()=>{P(!1)},L={merchantId:(0,w.IN)()?"QX9p3jq6~mMP6js9ReeSqw==":(0,N.db)(),appNo:(0,w.IN)()?window.BrandedAppBID:null,brandedApp:(0,w.IN)()??!1},{data:D,isLoading:E,error:M}=(0,c.m5)(L),W=(0,t.useMemo)(()=>{let e=D?.find(e=>e.userId===A)??{firstName:"",lastName:""};return{...e,fullName:`${e.firstName??""} ${e.lastName??""}`.trim()}},[A,D]),{mutate:$,isPending:O}=(0,m.n)({mutationFn:e=>h.A.deleteOrResendInvitationRequest(e),meta:{mutationId:u.lH.familyAndFriends.deleteInvitation["0"]},onError:e=>{p.oR.error(e.message),T(),R()},onSuccess:(e,i)=>{if(!0===e.result){if(3===i.action){p.oR.success("Invitation sent successfully."),T();return}{let i=D?.find(i=>i.userId===e.userId);i&&i.fullName?p.oR.success(`${i.fullName} has been removed from Family & Friends Sharing.`):p.oR.success("User has been removed from Family & Friends Sharing."),u.qQ.invalidateQueries({queryKey:u.lH.familyAndFriends.getAll})}}else p.oR.error("Something Went Wrong. Please try again.");R()}}),q=(0,t.useMemo)(()=>D?.find(e=>e.userId===A),[D,A]),Q=e=>{b(!1),F(!0),I(e)},_=e=>{k(!0),I(e)},U=e=>{P(!0),I(e)};if(M)return(0,s.jsxs)("div",{children:["Error: ",M.message]});let z=(D??[]).filter(e=>"Friend"===e.relation).sort((e,i)=>e.firstName.localeCompare(i.firstName)),J=(D??[]).filter(e=>"Friend"!==e.relation).sort((e,i)=>e.firstName.localeCompare(i.firstName));return E?(0,s.jsx)(C,{}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(y.A,{isLoading:E}),(0,s.jsxs)("div",{className:`vg-body-font web-body-font web-builder
1-font-color MyaccountWrapper ${a.familyAndFriendsPage}`,children:[(0,s.jsx)("div",{className:`${a.pageTitle} vg-display-large web-display-large web-builder-font-color`,children:"Family & Friends"}),(0,s.jsxs)("div",{className:a.contentContainer,children:[(0,s.jsxs)("div",{className:a.pageDescriptionContainer,children:[(0,s.jsx)("div",{className:"vg-display-small web-display-small web-builder-font-color",children:"Share with Family and Friends"}),(0,s.jsx)("div",{className:"vg-body-font web-body-font web-builder-font-color",children:"Share memberships and packages with your family and friends. You can also book, pay and receive notifications on your family and friend's behalf."})]}),(0,s.jsxs)("div",{className:a.listContainer,children:[J&&J.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:`${a.listTitle} vg-display-small web-display-small web-builder-font-color`,children:"Family"}),(0,s.jsx)("div",{className:a.familyAndFriendList,children:J?.filter(e=>"Friend"!==e.relation).map(e=>(0,s.jsx)(r.A,{familyAndFriend:e,onEditClick:Q,onRemoveClick:_,onResendInvitationClick:U},e.userId))})]}),z&&z.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:`${a.listTitle} vg-display-small web-display-small web-builder-font-color`,children:"Friends"}),(0,s.jsx)("div",{className:a.familyAndFriendList,children:z.map(e=>(0,s.jsx)(r.A,{familyAndFriend:e,onEditClick:Q,onRemoveClick:_,onResendInvitationClick:U},e.userId))})]})]}),(0,s.jsx)("div",{className:a.buttonsContainer,children:(0,s.jsx)(t.Suspense,{children:(0,s.jsx)(l.YU,{ButtononClick:()=>{b(!0),F(!1)},ButtonVariant:"ghost",children:"Add Family & Friends"})})})]}),j&&q&&(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(t.Suspense,{fallback:(0,s.jsx)(s.Fragment,{}),children:(0,s.jsx)(o.A,{familyAndFriend:q,onClose:R,handleClosePopups:R,isEditMode:j,onResendInvitationClick:U,host:x})})}),g&&(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(t.Suspense,{fallback:(0,s.jsx)(s.Fragment,{}),children:(0,s.jsx)(o.A,{familyAndFriend:null,onClose:R,handleClosePopups:R,isEditMode:j,onResendInvitationClick:U,host:x})})}),S&&(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)(t.Suspense,{fallback:(0,s.jsx)(s.Fragment,{}),children:[(0,s.jsx)(y.A,{isLoading:O}),(0,s.jsx)(l.W_,{ButtonPrimary:"Remove",ButtonSecondary:"Cancel",ButtonThird:"Back",CloseBackTitle:"From Control",CloseButton:!0,Footer:2,FooterButton:"both",OnClickPrimary:()=>{$({merchantId:"",userFamilyFriendId:q?.userFamilyFriendId??"",action:"1",userId:q?.userId??"",onlyUpdateInOffline:!0})},OnClickSecondary:R,PopupId:"remove-family-and-friend",PopupTitle:"Remove from Family & Friends Sharing",Popupopen:!0,Size:"small",TextDescription:`Are you sure want to remove ${W?.fullName??""} from Family & Friends Sharing?`,ThirdButtonVariant:"primary",customClassName:"customPosition",onClose:R,BodyClass:"vg-popup-open"})]})}),(0,s.jsxs)(t.Suspense,{children:[(0,s.jsx)(y.A,{isLoading:O}),(0,s.jsx)(l.W_,{ButtonPrimary:"Send",ButtonSecondary:"Cancel",ButtonThird:"Back",CloseBackTitle:"From Control",CloseButton:!0,Footer:2,FooterButton:"both",OnClickPrimary:()=>{let e=D?.find(e=>e.userId===A);$({merchantId:"",userFamilyFriendId:e?.userFamilyFriendId??"",action:3,userId:e?.userId??"",onlyUpdateInOffline:!0})},OnClickSecondary:T,PopupId:"ResendInvitation",PopupTitle:"Resend Invitation",Popupopen:B,Size:"small",TextDescription:"Are you sure you want to resend invitation?",onClose:T,BodyClass:"vg-popup-open",customClassName:"customPosition"})]})]})]})}},60458(e,i,n){n.d(i,{G:()=>l});var s=n(96540);function l(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:768,[i,n]=(0,s.useState)(window.innerWidth>=e);return(0,s.useEffect)(()=>{let i=()=>{n(window.innerWidth>=e)};return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[e]),i}}}]);
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.