1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4942],{32455:(e,r,n)=>{"use strict";n.d(r,{A:()=>a});var t=n(485e3),i=n(765777),l=n(604555),s=n(559399);let o=(0,i.U)("\n mutation UploadImageInline($imageBytes: String!) {\n uploadImage(imageBytes: $imageBytes) {\n url\n height\n width\n public_cloudinary_id: publicCloudinaryId\n }\n }\n");function a(e){let r=(0,l.n_)(o);return(0,t.A)(async e=>{let{data:n,error:t}=await r.execute({imageBytes:e});if(t){var i;throw Error((null==(i=t.networkError)?void 0:i.message)||(0,s.Z)(t)[0]||t.message)}if(!n)throw Error("Failed to upload image");return{public_cloudinary_id:n.uploadImage.public_cloudinary_id,url:n.uploadImage.url,__typename:"Image",height:n.uploadImage.height,width:n.uploadImage.width}},e)}},179215:(e,r,n)=>{"use strict";n.d(r,{M:()=>o});var t=n(455729),i=n(583873),l=n(839607),s=n(406029);let o=(0,l.S)((0,t.memo)(function(e){let{color:r="black",size:n=24,...t}=e;return(0,s.jsxs)(i.BS,{viewBox:"0 0 256 256",width:n,height:n,fill:"currentColor",...t,children:[(0,s.jsx)(i.rw,{width:"256",height:"256",fill:"none"}),(0,s.jsx)(i.N1,{x1:"40",y1:"128",x2:"216",y2:"128",fill:"none",stroke:r,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"24"}),(0,s.jsx)(i.N1,{x1:"128",y1:"40",x2:"128",y2:"216",fill:"none",stroke:r,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"24"})]})}))},241443:(e,r,n)=>{"use strict";n.d(r,{Z:()=>k});var t=n(406029),i=n(365692),l=n(200420),s=n(638609),o=n(128783),a=n(860285),d=n(939924),c=n(902566),u=n(975941),h=n(771196),x=n(765777),g=n(604555),m=n(659647),b=n(164939),f=n(455729),p=n(334823),j=n(247246),v=n(665292),y=n(4088),S=n(930355);let $=e=>{let{onPress:r}=e;return(0,t.jsx)(i.$n,{size:"$3.5",square:!0,br:3,bg:"$neutral600",hoverStyle:{scale:1,bg:"$neutral500"},accessibilityLabel:"Close",onPress:r,children:(0,t.jsx)(i.$n.Icon,{icon:l.X})})},A=(0,x.U)("\n query ContactInfoByUserId($id: String!) {\n contactInfoByUserId(id: $id) {\n id\n firebaseId\n slug\n firstName\n lastName\n email\n phoneNumber\n profileImage {\n publicCloudinaryId\n }\n isEmailVerified\n }\n }\n"),w=(0,f.createContext)({user:null,setUser:()=>{}}),I=()=>(0,f.useContext)(w),C=e=>{let{children:r}=e,[n,i]=(0,f.useState)(null);return(0,t.jsx)(w.Provider,{value:{user:n,setUser:i},children:r})},E=()=>{var e,r;let n=I(),l=null==n?void 0:n.user,{onRequestClose:x}=m.A.Portaled.useContext(),{toast:b}=(0,h.A)(),{makeCall:f}={makeCall:e=>{let r="tel:".concat(e);v.qL(r).then(e=>{if(e)return v.KN(r);y.A.alert("Error","Unable to make calls on this device")}).catch(e=>{console.error("Error making call:",e),y.A.alert("Error","Unable to make the call")})}},{data:p,fetching:w}=(0,g.IT)(A,{variables:{id:null==l?void 0:l.id},pause:!(null==l?void 0:l.id)});if(!l)return(0,t.jsx)(s.S,{p:30,f:1,ai:"center",jc:"center",h:174,children:(0,t.jsx)(o.E,{fontSize:14,fontWeight:"400",children:"Unable to access contact info"})});let C=null==p?void 0:p.contactInfoByUserId,E=C?"".concat(C.firstName," ").concat(C.lastName):l.name,k=null==C?void 0:C.email,F=null==C?void 0:C.phoneNumber,z=null!=(r=null==C||null==(e=C.profileImage)?void 0:e.publicCloudinaryId)?r:l.profile_image_id,L=e=>{j.eN(e).then(()=>{b({title:"Copied!",severity:"success"})}).catch(()=>{b({title:"Failed to copy",severity:"error"})})};return w||!l?(0,t.jsx)(s.S,{p:30,f:1,ai:"center",jc:"center",h:174,children:(0,t.jsx)(u.k,{})}):(0,t.jsxs)(s.S,{f:1,position:"relative",minHeight:174,children:[(0,t.jsx)(s.S,{position:"absolute",top:30,right:30,zIndex:1,children:(0,t.jsx)($,{onPress:()=>{x()}})}),(0,t.jsx)(s.S,{p:30,f:1,$md:{fd:"row",gap:60},jc:"space-between",children:(0,t.jsxs)(s.S,{$md:{fd:"row"},fd:"column",gap:"$4",children:[(0,t.jsx)(s.S,{fd:"row",ai:"center",children:(0,t.jsx)(a.e,{size:34,round:!0,children:(0,t.jsx)(a.e.ImageOrInitials,{name:E,publicCloudinaryId:z,sizes:"50px",quality:100})})}),(0,t.jsxs)(s.S,{gap:"$4",children:[(0,t.jsx)(o.E,{fontSize:20,bold:!0,lineHeight:30,children:E}),(0,t.jsxs)(s.S,{gap:"$5",$md:{gap:"$2"},children:[F&&(0,t.jsxs)(s.S,{fd:"row",ai:"center",gap:"$4",children:[(0,t.jsx)(o.E,{fontSize:14,fontWeight:"400",children:F.startsWith("+1")?"+1 ".concat((0,S.n)(F)):(0,S.n)(F)}),(0,t.jsx)(i.$n,{w:34,h:34,square:!0,br:"$full",bg:"$neutral600",hoverStyle:{scale:1,bg:"$neutral400"},accessibilityLabel:"Call ".concat(E),onPress:()=>f(F),children:(0,t.jsx)(i.$n.Icon,{icon:d.b,size:16})}),(0,t.jsx)(i.$n,{w:34,h:34,square:!0,br:"$full",bg:"$neutral600",hoverStyle:{scale:1,bg:"$neutral400"},accessibilityLabel:"Copy ".concat(E,"'s phone number"),onPress:()=>L(F),children:(0,t.jsx)(i.$n.Icon,{icon:c.L,size:16})})]}
1),k&&(0,t.jsxs)(s.S,{fd:"row",ai:"center",gap:"$4",children:[(0,t.jsx)(o.E,{fontSize:14,fontWeight:"400",children:k}),(0,t.jsx)(i.$n,{w:34,h:34,square:!0,br:"$full",bg:"$neutral600",hoverStyle:{scale:1,bg:"$neutral400"},accessibilityLabel:"Copy ".concat(E,"'s e-mail"),onPress:()=>L(k),children:(0,t.jsx)(i.$n.Icon,{icon:c.L,size:16})})]}),!w&&!k&&!F&&(0,t.jsx)(o.E,{fontSize:12,color:"$color10",children:"Contact info not available."})]})]})]})})]})},k=(0,b.u)(function(e){let{children:r}=e;return(0,t.jsx)(C,{children:(0,t.jsx)(m.A.Portaled,{children:r})})},{Trigger:function(e){let{children:r}=e,n=I();return(0,t.jsx)(m.A.Portaled.Trigger,{children:e=>{let{onOpen:t}=e;return r({onOpen:e=>{null==n||n.setUser(e),t()}})}})},Content:()=>(0,t.jsx)(m.A.Portaled.Content,{portalToDashboardLayout:!0,header:!1,maxHeight:174,autoHeight:!0,padded:!1,maxWidthWhenExpanded:500,dangerouslyDisableNativeScroll:!0,scrollable:!1,isFullMobileScreen:"web"!==p.A.OS,children:(0,t.jsx)(E,{})}),Portaled:m.A.Portaled})},246745:(e,r,n)=>{"use strict";n.d(r,{K:()=>p});var t=n(406029),i=n(685044),l=n(164939),s=n(128783),o=n(638609),a=n(365692),d=n(664736),c=n(455729),u=n(659647),h=n(334823),x=n(281994);let g=(0,i.I)(a.$n,{name:"ConfirmationDialogButton",size:"$3",height:43,px:"$2.5",br:3,variants:{variant:{default:{bg:"#2E2E2F",hoverStyle:{scale:1,bg:"#525252"},pressStyle:{scale:1,bg:"#525252"}},destructive:{bg:"#DB565B",hoverStyle:{scale:1,bg:"#E54248"},pressStyle:{scale:1,bg:"#E54248"}},confirm:{bg:"#FFFA8340",hoverStyle:{scale:1,bg:"#FFFA8330"},pressStyle:{scale:1,bg:"#FFFA8330"}},cancel:{bg:"#2E2E2F",hoverStyle:{scale:1,bg:"#525252"},pressStyle:{scale:1,bg:"#525252"}}}},defaultVariants:{variant:"default"}}),m=(0,c.memo)(function(e){let{children:r}=e;return(0,t.jsx)(o.S,{jc:"center",fd:"row",gap:20,mt:30,children:r})}),b=e=>{let{children:r,onAction:n,variant:i="default",icon:l,loading:s,disabled:o,closeOnPress:d=!0,accessibilityLabel:h,textColor:x,...m}=e,{onRequestClose:b}=u.A.Portaled.useContext(),f=(0,c.useCallback)(()=>{d&&b(),null==n||n()},[n,d,b]);return(0,t.jsxs)(g,{accessibilityLabel:h||("string"==typeof r?r:"Action"),variant:i,onPress:f,loading:s,disabled:o,...m,children:[(0,t.jsx)(a.$n.Text,{fontSize:14,fontWeight:"500",color:x||"#fff",children:r}),l&&(0,t.jsx)(a.$n.Icon,{icon:l,size:16,color:x||"#fff"})]})},f=e=>{let{children:r,onCancel:n,accessibilityLabel:i,textColor:l,...s}=e,{onRequestClose:o}=u.A.Portaled.useContext(),d=(0,c.useCallback)(()=>{null==n||n(),o()},[n,o]),h=i||("string"==typeof r?r:"Cancel");return(0,t.jsx)(g,{variant:"cancel",accessibilityLabel:h,onPress:d,...s,children:(0,t.jsx)(a.$n.Text,{fontSize:14,fontWeight:"500",color:l||"#fff",children:r})})},p=(0,l.u)(e=>{let{children:r,...n}=e;return(0,t.jsx)(u.A.Portaled,{..."open"in n?n:{},children:r})},{Trigger:e=>{let{children:r}=e;return(0,t.jsx)(u.A.Portaled.Trigger,{children:r})},Content:e=>{let{children:r,title:n,description:i,maxWidth:l=446,confirmationTitle:a,confirmationDescription:g,header:m,footer:b}=e,f=n||a,p=i||g,j=(0,x.A)(),v=(0,c.useMemo)(()=>(f||p)&&(0,t.jsxs)(o.S,{ai:"center",gap:12,children:[f&&(0,t.jsx)(s.E,{fontSize:24,fontWeight:700,lh:36,textAlign:"center",children:f}),p&&(0,t.jsx)(s.E,{fontSize:15,lh:22.5,color:"rgba(255, 255, 255, 0.5)",textAlign:"center",children:p})]}),[f,p]);return(0,t.jsx)(u.A.Portaled.Content,{portalToDashboardLayout:!0,header:!1,padded:!1,maxWidthWhenExpanded:l,autoHeight:!0,disableBackdropClick:!1,overlayBackground:"#09090A",overlayOpacity:.8,backgroundColor:"#1B1B1B",borderRadius:10,scrollable:!1,isFullMobileScreen:"web"!==h.A.OS,dangerouslyDisableNativeScroll:!0,
1children:(0,t.jsx)(d.M,{children:(0,t.jsxs)(o.S,{maxWidth:l,f:1,w:"100%",p:40,br:10,bg:"#1B1B1B",children:[null!=m?m:v,(0,t.jsx)(o.S,{f:1,minHeight:0,children:r}),!!b&&(0,t.jsx)(o.S,{pb:null==j?void 0:j.bottom,pt:30,children:b})]})})})},Header:e=>{let{children:r}=e;return(0,t.jsx)(o.S,{ai:"center",gap:12,children:r})},Title:e=>{let{children:r}=e;return(0,t.jsx)(s.E,{fontSize:20,fontWeight:600,lh:30,fontFamily:"$body",textAlign:"center",children:r})},Description:e=>{let{children:r}=e;return(0,t.jsx)(s.E,{fontSize:14,lh:21,color:"#B3B3B3",fontFamily:"$body",textAlign:"center",children:r})},Footer:m,Action:b,Cancel:f,ActionButton:function(e){return(0,t.jsx)(b,{variant:"delete"===e.type?"destructive":"confirm"===e.type?"confirm":"default",icon:e.actionIcon,loading:e.loading,disabled:e.disabled,onAction:e.onAction,closeOnPress:e.closeOnPress,accessibilityLabel:e.actionAccessibilityLabel,children:e.actionText})},CancelButton:function(e){return(0,t.jsx)(f,{onCancel:e.onCancel,accessibilityLabel:e.cancelAccessibilityLabel,children:e.cancelText})},Button:g})},337351:(e,r,n)=>{"use strict";n.r(r),n.d(r,{default:()=>t});let t={src:"/_next/static/media/bg.04773898.png",height:2048,width:946,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAICAMAAADp7a43AAAABlBMVEUDAwIdHAeit4HnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAD0lEQVR4nGNgYGBgZCAMAABMAAIFZOp6AAAAAElFTkSuQmCC",blurWidth:4,blurHeight:8}},361314:(e,r,n)=>{"use strict";n.d(r,{n:()=>o});var t=n(455729),i=n(583873),l=n(839607),s=n(406029);let o=(0,l.S)((0,t.memo)(function(e){let{color:r="black",size:n=24,...t}=e;return(0,s.jsxs)(i.BS,{viewBox:"0 0 256 256",width:n,height:n,fill:"currentColor",...t,children:[(0,s.jsx)(i.rw,{width:"256",height:"256",fill:"none"}),(0,s.jsx)(i.wA,{d:"M92.69,216H48a8,8,0,0,1-8-8V163.31a8,8,0,0,1,2.34-5.65L165.66,34.34a8,8,0,0,1,11.31,0L221.66,79a8,8,0,0,1,0,11.31L98.34,213.66A8,8,0,0,1,92.69,216Z",fill:"none",stroke:r,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"24"}),(0,s.jsx)(i.N1,{x1:"136",y1:"64",x2:"192",y2:"120",fill:"none",stroke:r,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"24"})]})}))},367345:(e,r,n)=>{"use strict";n.d(r,{i:()=>o});var t=n(455729),i=n(583873),l=n(839607),s=n(406029);let o=(0,l.S)((0,t.memo)(function(e){let{color:r="black",size:n=24,...t}=e;return(0,s.jsxs)(i.BS,{viewBox:"0 0 256 256",width:n,height:n,fill:"currentColor",...t,children:[(0,s.jsx)(i.rw,{width:"256",height:"256",fill:"none"}),(0,s.jsx)(i.jl,{cx:"128",cy:"128",r:"16"}),(0,s.jsx)(i.jl,{cx:"60",cy:"128",r:"16"}),(0,s.jsx)(i.jl,{cx:"196",cy:"128",r:"16"})]})}))},485e3:(e,r,n)=>{"use strict";n.d(r,{A:()=>s});var t=n(255348),i=n(204765),l=n(455729);function s(e,r){let{set:n,result:s,loading:o,status:a,...d}=(0,t.V$)(async function(){let r;for(var n=arguments.length,t=Array(n),l=0;l<n;l++)t[l]=arguments[l];try{r=await e(...t)}catch(e){throw i.r({message:"POST error.",extra:{error:e}}),e}return r},{...r}),c=(0,l.useCallback)(e=>{n({error:e,result:s,loading:o,status:a})},[o,s,n,a]);return{...d,set:n,result:s,loading:o,setError:c}}},539096:(e,r,n)=>{"use strict";n.r(r),n.d(r,{default:()=>eN});var t=n(406029),i=n(334823),l=n(490125),s=n(750976),o=n(638609),a=n(365692),d=n(367345),c=n(690963),u=n(932395),h=n(474094),x=n(734677),g=n(731091),m=n(611379),b=n(596597),f=n(787311),p=n(128783),j=n(843573),v=n(172676),y=n(144365),S=n(684981),$=n(175356),A=n(771196),w=n(32455),I=n(836044),C=n(455729),E=n(860285),k=n(772811),F=n(321784),z=n(361314),L=n(460687),P=n(980417),_=n(45923),B=n(645249),O=n(664991),M=n(975941),T=n(387601);let R=(0,C.memo)(function(e){let{onPress:r}=e;return(0,t.jsx)(a.$n,{size:"$2.5",gap:"$2",br:"$full",bg:"$neutral600",square:!0,accessibilityLabel:"Edit Chat Info",hoverStyle:{bg:"$neutral500"},transition:"quick",onPress:r,children:(0,t.jsx)(a.$n.Icon,{icon:z.n,size:16})})}),H=(0,C.memo)(function(e){let{room:r,myAuthId:n,isBuyer:l,isSeller:s,isAdmin:d,editingField:c,setEditingField:h,uploadImage:x,patchRoom:g,updatedChatRoomName:m,setUpdatedChatRoomName:b,updateRoomNameExecute:f}=e,j=(0,u.jq)(r,n,l,s),v=(0,C.useCallback)(()=>{var e;(null!=m?m:"")!==(null!=(e=null==r?void 0:r.name)?e:"")?f():h(null)},[null==r?void 0:r.name,m,f,h]);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.S,{fd:"row",gap:"$3",w:"100%",children:"image"===c?(0,t.jsx)(T.S,{from:{opacity:0}
1,animate:{opacity:1},transition:{type:"timing",duration:200},style:{flexDirection:"row",alignItems:"center"},children:(0,t.jsx)(O.m,{onPickImage:x.execute,children:e=>(0,t.jsxs)(o.S,{pos:"relative",w:48,h:48,children:[x.loading&&(0,t.jsx)(o.S,{stretch:!0,bg:"$backgroundStrong",o:.7,ai:"center",jc:"center",br:"$full",pos:"absolute",zi:2,children:(0,t.jsx)(M.k,{})}),(null==e?void 0:e.imageUrl)&&!x.loading&&(0,t.jsx)(E.e,{size:48,round:!0,children:(0,t.jsx)(k._,{fill:!0,unoptimized:!0,contentFit:"cover",src:e.imageUrl,alt:"Preview"})}),!(null==e?void 0:e.imageUrl)&&!x.loading&&(0,t.jsx)(o.S,{br:"$full",p:"$4",w:48,h:48,bg:"$color5",ai:"center",jc:"center",borderWidth:1,borderColor:"$color7",children:(0,t.jsx)(L.I,{size:24,color:"$color11"})}),(null==e?void 0:e.isDragActive)&&!x.loading&&(0,t.jsx)(o.S,{stretch:!0,bg:"$brand",o:.3,ai:"center",jc:"center",br:"$full",pos:"absolute",zi:1,children:(0,t.jsx)(P._,{size:24,color:"$color1"})})]})})}):i.A.select({web:(0,t.jsxs)(o.S,{fd:"row",gap:"$3",group:"card",children:[j?(0,t.jsx)(E.e,{size:48,round:!0,children:(0,t.jsx)(E.e.ImageOrInitials,{name:r?r.name||(0,u.Hk)(r,n,l,s,d):"",publicCloudinaryId:j,sizes:"100px"})}):(0,t.jsx)(o.S,{br:"$full",p:"$4",w:48,h:48,bg:"#FFFA8426",ai:"center",jc:"center",children:(0,t.jsx)(_.c,{size:20,color:"$yellow500"})}),!s&&(0,t.jsx)(o.S,{"$group-card-hover":{opacity:1},o:0,transition:"quick",children:(0,t.jsx)(R,{onPress:()=>h("image")})})]}),default:(0,t.jsx)(o.S,{fd:"row",gap:"$3",onPress:()=>h("image"),children:j?(0,t.jsx)(E.e,{size:48,round:!0,children:(0,t.jsx)(E.e.ImageOrInitials,{name:r?r.name||(0,u.Hk)(r,n,l,s,d):"",publicCloudinaryId:j,sizes:"100px"})}):(0,t.jsx)(t.Fragment,{children:!s&&(0,t.jsx)(o.S,{br:"$full",p:"$4",w:48,h:48,bg:"#FFFA8426",ai:"center",jc:"center",children:(0,t.jsx)(_.c,{size:20,color:"$yellow500"})})})})})}),(0,t.jsx)(o.S,{h:16}),(0,t.jsx)(o.S,{fd:"row",w:"100%",children:"name"===c?(0,t.jsxs)(T.S,{from:{opacity:0}
1,animate:{opacity:1},transition:{type:"timing",duration:200},style:{flexDirection:"row",width:"100%"},children:[(0,t.jsx)(F.pd,{placeholder:(null==r?void 0:r.name)||r&&(0,u.Hk)(r,n,l,s,d)||"Chat Name",f:1,value:null!=m?m:"",onChangeText:b,disabled:g.isPending||x.loading,onSubmitEditing:v,accessibilityLabel:"Chat Name",textAlign:"center",fontSize:14,fontWeight:"400",h:40,bg:"$neutral750",py:"$4",px:"$4",autoFocus:!0,borderWidth:1,borderColor:"$neutral600",borderRightWidth:0,borderTopLeftRadius:7,borderBottomLeftRadius:7,borderTopRightRadius:0,borderBottomRightRadius:0}),(0,t.jsx)(a.$n,{onPress:v,accessibilityLabel:"Save Chat Name",loading:g.isPending,disabled:x.loading,size:"$3.5",bg:"$neutral600",py:"$4",borderWidth:1,borderColor:"$neutral600",borderLeftWidth:0,borderTopRightRadius:7,borderBottomRightRadius:7,borderTopLeftRadius:0,borderBottomLeftRadius:0,children:(0,t.jsx)(a.$n.Icon,{icon:B.Q,size:16})})]}):i.A.select({web:(0,t.jsxs)(o.S,{fd:"row",gap:"$3",group:"card",w:"100%",children:[(0,t.jsx)(o.S,{maxWidth:250,children:(0,t.jsx)(p.E,{bold:!0,fontSize:20,lineHeight:20,numberOfLines:2,children:r&&n?(0,u.Hk)(r,n,l,s,d):"Loading..."})}),!s&&(0,t.jsx)(o.S,{o:0,"$group-card-hover":{opacity:1},transition:"quick",children:(0,t.jsx)(R,{onPress:()=>{var e;b(null!=(e=null==r?void 0:r.name)?e:""),h("name")}})})]}),default:(0,t.jsx)(o.S,{fd:"row",gap:"$3",w:"100%",onPress:()=>{var e;s||(b(null!=(e=null==r?void 0:r.name)?e:""),h("name"))},children:(0,t.jsx)(o.S,{maxWidth:250,children:(0,t.jsx)(p.E,{bold:!0,fontSize:20,lineHeight:20,numberOfLines:2,children:r&&n?(0,u.Hk)(r,n,l,s,d):"Loading..."})})})})})]})});var N=n(839136),W=n(519806),U=n(506419);let q={ONLINE:{theme:"green",title:"Online"},OFFLINE:{theme:"gray",title:"Offline"},IDLE:{theme:"yellow",title:"Idle"}},K=(0,C.memo)(function(e){let{user:r,presence:n,onPressContactInfo:i}=e,l=(0,b.A)().data,s=f.K.isSeller(l),d=q[(null==n?void 0:n.status)||"OFFLINE"];return(0,t.jsxs)(o.S,{gap:"$4",fd:"row",ai:"center",children:[(0,t.jsx)(E.e,{size:34,round:!0,children:(0,t.jsx)(E.e.ImageOrInitials,{initialsFontSize:14,name:r.name,publicCloudinaryId:r.profile_image_id,sizes:"50px",quality:100})}),(0,t.jsxs)(o.S,{f:1,fd:"row",ai:"center",jc:"space-between",gap:"$4",children:[(0,t.jsx)(p.E,{fontSize:14,fontWeight:"500",numberOfLines:1,children:r.name}),!s&&(0,t.jsx)(a.$n,{w:34,h:34,square:!0,br:"$full",bg:"$neutral600",hoverStyle:{scale:1,bg:"$neutral400"},accessibilityLabel:"View ".concat(r.name,"'s profile"),onPress:i,children:(0,t.jsx)(a.$n.Icon,{icon:N.R,size:16})}),n&&(0,t.jsxs)(o.S,{fd:"row",ai:"center",gap:"$2",theme:d.theme,bg:"$color3",px:"$2",br:"$full",als:"flex-start",children:[(0,t.jsx)(o.S,{bg:"$color11",w:8,h:8,radiu
1s:"$full"}),(0,t.jsx)(p.E,{color:"$color11",children:(0,U.L)(n.status,{IDLE:(0,W.v)(n.last_seen_at).fromNow(),OFFLINE:(0,W.v)(n.last_seen_at).fromNow(),ONLINE:"Online"})})]})]})]})});var D=n(232833),V=n(246745),Z=n(241443),G=n(659647),Y=n(4088),Q=n(281994);let X=e=>{let{onPress:r}=e;return(0,t.jsxs)(a.$n,{gap:"$3",px:"$6",h:46,br:"$full",bg:"rgba(255, 99, 82, 0.10)",hoverStyle:{bg:"rgba(255, 99, 82, 0.20)"},accessibilityLabel:"Exit Group",onPress:r,children:[(0,t.jsx)(a.$n.Icon,{icon:y.M,size:16,color:"$red400"}),(0,t.jsx)(a.$n.Text,{fontSize:14,fontWeight:"500",color:"$red400",children:"Exit Group"})]})},J=e=>{var r,n;let{roomId:l,onEditMembers:s}=e,d=(0,I.nb)({id:l}).data,c=null==(r=(0,h.A)().user)?void 0:r.uid,u=f.K.isBuyer((0,b.A)().data),x=f.K.isSeller((0,b.A)().data),v=new Map(null==d?void 0:d.users_presence.map(e=>[e.auth_id,e])),S=f.K.isAdmin((0,b.A)().data),E=null==d?void 0:d.users,k=(0,Q.A)(),F=null==E?void 0:E.filter(e=>e.id!==c);S&&(null==d?void 0:d.users.length)!==1||(E=F);let{toast:z}=(0,A.A)(),L=(0,I.oi)(),P=(0,m.r)(),_=(0,C.useCallback)(async(e,r)=>{try{let n=await L.mutateAsync({roomId:l,userId:e});if(null==n?void 0:n.id){if(e===c){z({severity:"success",title:"You left the chat"}),P.push(g.y.dashboard.chat.$url());return}z({severity:"success",title:"Removed ".concat(r)})}else z({severity:"error",title:"Failed to remove ".concat(r," (API Error)")})}catch(e){z({severity:"error",title:"Failed to remove ".concat(r),message:e instanceof Error?e.message:"Unknown error"})}},[L,l,c,z,P]),B=(0,I.h9)(),O=(0,w.A)({onSuccess(e){z({title:"Room image updated",severity:"success"}),B.mutate({id:l,requestBody:{image_id:e.public_cloudinary_id}})},onError(e){z({title:"Image upload failed",message:e.message,severity:"error"})}}),[M,T]=(0,C.useState)(),[R,N]=(0,C.useState)(null),W=()=>{if(c){var e,r;let n=null!=(r=null==d||null==(e=d.users.find(e=>e.id===c))?void 0:e.name)?r:"";_(c,n)}};return(0,t.jsxs)(o.S,{pb:30,pt:i.A.select({android:Math.max(k.top+20,30),default:30}),f:1,gap:30,bg:"$neutral800",shadowColor:"#00000040",shadowOffset:{width:0,height:10},shadowRadius:28,shadowOpacity:.25,elevation:15,children:[(0,t.jsxs)(o.S,{px:30,gap:30,children:[(0,t.jsx)(o.S,{gap:"$5",ai:"flex-start",children:(0,t.jsx)($.A,{radius:"round",show:!d,width:"100%",children:(0,t.jsx)(H,{room:d,myAuthId:c,isBuyer:u,isSeller:x,isAdmin:S,editingField:R,setEditingField:N,uploadImage:O,patchRoom:B,updatedChatRoomName:M,setUpdatedChatRoomName:T,updateRoomNameExecute:()=>B.mutate({id:l,requestBody:{name:M}},{onSuccess(){T(void 0),N(null),z({title:"Chat name updated",severity:"success"})},onError(){z({title:"Chat name update failed",severity:"error"})}})})})}),(0,t.jsxs)(o.S,{fd:"row",gap:"$4",children:[(0,t.jsx)(a.$n,{h:46,accessibilityLabel:"Edit Members",br:"$full",gap:"$3",bg:"$neutral600",hoverStyle:{bg:"$neutral500",scale:1},transition:"quick",onPress:()=>{null==s||s()},f:1,children:(0,t.jsx)(a.$n.Text,{fontSize:14,fontWeight:"500",children:"Edit Members"})}),(null!=(n=null==F?void 0:F.length)?n:0)>0&&i.A.select({web:(0,t.jsxs)(V.K,{children:[(0,t.jsx)(V.K.Trigger,{asChild:!0,children:(0,t.jsx)(X,{})}),(0,t.jsx)(V.K.Content,{title:"Are you sure you want to leave\nthis group?",description:"You will lose access to new messages, but your chat history\nwill remain visible.",children:(0,t.jsxs)(V.K.Footer,{children:[(0,t.jsx)(V.K.Action,{variant:"destructive",onAction:W,icon:y.M,accessibilityLabel:"Exit Group",children:"Exit Group"}),(0,t.jsx)(V.K.Cancel,{accessibilityLabel:"Cancel",children:"Cancel"})]})})]}),default:(0,t.jsx)(X,{onPress:()=>{Y.A.alert("Are you sure you want to leave this group?","You will lose access to new messages, but your chat history will remain visible.",[{text:"Exit Group",onPress:W,style:"destructive"},{text:"Cancel",style:"cancel"}])}})})]})]}),(0,t.jsxs)(o.S,{f:1,gap:"$6",children:[F&&F.length>=1&&(0,t.jsxs)(p.E,{fontSize:14,px:30,fontWeight:"500",children:[null==E?void 0:E.length," ",(null==E?void 0:E.length)===1?"Member":"Members"]}),(0,t.jsx)(j.O,{showsVerticalScrollIndicator:!0,children:(0,t.jsxs)(Z.Z,{children:[(0,t.jsx)(Z.Z.Trigger,{children:e=>{let{onOpen:r}=e;return(0,t.jsx)(o.S,{"$platform-web":{maxHeight:200},px:30,gap:"$4",children:null==E?void 0:E.map(e=>{let n=v.get(e.id);return(0,t.jsx)(K,{user:e,presence:n,onPressContactInfo:()=>{r(e)}},e.id)})})}}),(0,t.jsx)(Z.Z.Content,{})]})})]})]})};J.NativeModal=(0,v.u)(function(e){return(0,t.jsx)(G.A.Portaled,{...e})},{Trigger:G.A.Portaled.Trigger,Content:function(e){let{isUserInfoOpen:r,onEditMembers:n,...l}=e,{onRequestClose:s}=G.A.Portaled.useContext(),o=(0,Q.A)();return(0,t.jsxs)(G.A.Portaled.Content,{header:!1,padded:!1,maxHeight:400,dangerouslyDisableNativeScroll:!0,
1children:[(0,t.jsx)(J,{...l,onEditMembers:()=>{s(),setTimeout(()=>{null==n||n()},500)},isUserInfoOpen:r}),(0,t.jsx)(a.$n,{size:"$3.5",br:3,bg:"$neutral600",p:"$4",hoverStyle:{bg:"$neutral500",scale:1},onPress:()=>{s()},accessibilityLabel:"Close Chat Room",pos:"absolute",top:i.A.select({android:Math.max(o.top+20,32),default:32}),right:20,children:(0,t.jsx)(a.$n.Icon,{icon:S.e,size:16})})]})}}),J.Popover=(0,v.u)(function(e){return(0,t.jsx)(D.A,{placement:"bottom-end",...e})},{Trigger:D.A.Trigger,Content:function(e){let{isUserInfoOpen:r,onRequestClose:n,...l}=e;return(0,t.jsx)(D.A.Content,{unstyled:!0,p:"$0",alignItems:"stretch",width:i.A.select({web:"min(80vh, 350px)"}),style:{transformOrigin:"top right"},bg:"$colorTransparent",br:10,ov:"hidden",trapFocus:!1,onOpenAutoFocus:e=>e.preventDefault(),children:(0,t.jsx)(J,{...l,isUserInfoOpen:r,onRequestClose:n})})}});let ee=(0,C.createContext)(void 0),er=e=>{let{children:r}=e,[n,i]=(0,C.useState)(!1),[l,s]=(0,C.useState)(null),[o,a]=(0,C.useState)(null),[d,c]=(0,C.useState)(null),u=(0,C.useCallback)((e,r,n)=>{s(e),a(r),c(()=>n),i(!0)},[]),h=(0,C.useCallback)(()=>{i(!1),s(null),a(null),c(null),"groupInfo"===o&&d&&d()},[o,d]),x=(0,C.useMemo)(()=>({isUserInfoOpen:n,userInfoTargetUser:l,triggerSourceId:o,openUserInfoModal:u,closeUserInfoModal:h}),[n,l,o,u,h]);return(0,t.jsx)(ee.Provider,{value:x,children:r})},en=(0,C.createContext)(void 0),et=e=>{var r;let{children:n}=e,[i,l]=(0,C.useState)(null),s=(0,I.oi)(),o=(0,I.nb)({id:null!=i?i:"",enabled:!!i}),a=o.data,d=(0,C.useMemo)(()=>{var e;return null!=(e=null==a?void 0:a.users)?e:[]},[null==a?void 0:a.users]),{toast:c}=(0,A.A)(),u=(0,m.r)(),x=null==(r=(0,h.A)().user)?void 0:r.uid,b=(0,C.useCallback)(e=>{l(e)},[]),f=(0,C.useCallback)(()=>{l(null)},[]),p=(0,C.useCallback)((e,r)=>{i&&s.mutate({roomId:i,userId:e},{onSuccess:n=>{(null==n?void 0:n.id)?e===x?(c({severity:"success",title:"You left the chat"}),f(),u.push(g.y.dashboard.chat.$url())):(c({severity:"success",title:"Removed ".concat(r)}),o.refetch()):c({severity:"error",title:"Failed to remove ".concat(r," (API Error)")})},onError:e=>{c({severity:"error",title:"Failed to remove ".concat(r),message:e instanceof Error?e.message:"Unknown error"})}})},[i,s,x,c,f,u,o]),j=(0,C.useMemo)(()=>({openEditModal:b,closeEditModal:f,roomData:a,roomUsers:d,handleRemoveUserInModal:p,removeUserMutationState:s}),[b,f,a,d,p,s]);return(0,t.jsx)(en.Provider,{value:j,children:n})},ei=()=>{let e=(0,C.useContext)(en);if(void 0===e)throw Error("useUserEditModal must be used within a UserEditModalProvider");return e};var el=n(200420),es=n(87345),eo=n(179215),ea=n(516734),ed=n(885966),ec=n(594120),eu=n(250197),eh=n(772301);function ex(){let e=(0,ed._)(["\n query UserEditModal_MyContacts {\n myOrganizations {\n id\n slug\n name\n owners: employees {\n id\n firebaseId\n name\n profileImage {\n publicCloudinaryId\n }\n }\n }\n myArtists {\n id\n slug\n name\n sellers {\n id\n firebaseId\n name\n profileImage {\n publicCloudinaryId\n }\n }\n }\n }\n"]);return ex=function(){return e},e}function eg(){let e=(0,ed._)(["\n query UserEditModal_AdminContacts($artistIds: [String!]!, $venueIds: [String!]!) {\n artistsByFilter: artistsByFilterAdmin(\n filter: { id: { in: $artistIds } }\n limit: 40\n offset: 0\n ) {\n id\n slug\n name\n sellers {\n id\n firebaseId\n name\n profileImage {\n publicCloudinaryId\n }\n }\n }\n venues: organizationsByFilter(filter: { id: { in: $venueIds } }, limit: 40, offset: 0) {\n id\n slug\n name\n owners: employees {\n id\n firebaseId\n name\n profileImage {\n publicCloudinaryId\n }\n }\n }\n }\n"]);return eg=function(){return e},e}let em=(0,ec.J1)(ex()),eb=(0,ec.J1)(eg()),ef=(0,C.memo)(function(e){var r,n;let{userToAdd:i,addUserMutation:l,roomId:s,onAdded:a}=e,{toast:d}=(0,A.A)();return(0,t.jsxs)(o.S,{fd:"row",ai:"center",gap:"$4",p:"$3",hoverStyle:{bg:"$neutral600"},onPress:()=>{s&&l.mutate({roomId:s,userId:i.authId},{onSuccess(e){e.id?(a(),d({severity:"success",title:"Added ".concat(i.name," to chat")}
1)):d({severity:"error",title:"Failed to add ".concat(i.name)})},onError(e){d({severity:"error",title:"Error adding ".concat(i.name),message:e.message})}})},transition:"quick",cursor:"pointer",opacity:l.isPending&&(null==(r=l.variables)?void 0:r.userId)===i.authId?.5:1,children:[(0,t.jsx)(E.e,{size:36,round:!0,children:(0,t.jsx)(E.e.ImageOrInitials,{name:i.name,publicCloudinaryId:i.publicCloudinaryId,sizes:"36px"})}),(0,t.jsxs)(o.S,{f:1,children:[(0,t.jsx)(p.E,{fontSize:14,fontWeight:"500",numberOfLines:1,children:i.name}),!!i.subtitle&&(0,t.jsx)(p.E,{fontSize:12,color:"$neutral200",numberOfLines:1,children:i.subtitle})]}),l.isPending&&(null==(n=l.variables)?void 0:n.userId)===i.authId&&(0,t.jsx)(o.S,{children:(0,t.jsx)(M.k,{size:"small"})})]})}),ep=(0,C.forwardRef)(function(){return null});var ej=n(748363);let ev=e=>{let{searchQuery:r,setSearchQuery:n}=e,i=r.length>0;return(0,t.jsxs)(o.S,{f:1,pos:"relative","$platform-web":{maxWidth:200},children:[(0,t.jsx)(ej.A,{value:r,onChangeText:n,placeholder:"Search...",rightIcon:i?(0,t.jsx)(el.X,{color:"$neutral0",size:16}):(0,t.jsx)(es.e,{color:"$neutral200",size:16})}),i&&(0,t.jsx)(o.S,{pos:"absolute",top:0,bottom:0,right:0,width:40,ai:"center",jc:"center",cursor:"pointer",onPress:()=>n("")})]})},ey=e=>{let{roomId:r,myAuthId:n,isAdmin:i,isBuyer:l,isSeller:s,usersInRoom:a,onClose:d,searchQuery:c}=e,u=(0,I.GM)(),h=function(e){var r,n,t,i;let{roomId:l,myAuthId:s,isAdmin:o,isBuyer:a,isSeller:d,usersInRoom:c,searchQuery:u}=e,h=(0,I.nb)({id:null!=l?l:""}),x=null!=(t=null==(r=h.data)?void 0:r.organization_tags.map(e=>e.id))?t:[],g=null!=(i=null==(n=h.data)?void 0:n.artist_tags.map(e=>e.id))?i:[],m=(0,I.mP)(),[b]=(0,eu.IT)({query:em,pause:o}),f=b.data,[p]=(0,eu.IT)({query:eb,variables:{artistIds:a?[]:g,venueIds:d?[]:x},pause:!o}),j=p.data,v=(0,eh.A)({query:u}),y=(0,C.useMemo)(()=>new Set(c.map(e=>e.id)),[c]),S=u.toLowerCase().trim();return(0,C.useMemo)(()=>{var e,r,n,t,i,l;if(!s)return[];let a=[],d=new Set;return(o&&(null==(r=v.data)||r.forEach(e=>{let r=null==e?void 0:e.document;if(r&&!y.has(r.id)&&S){var n;d.add(r.id),a.push({id:r.id,authId:r.id,name:r.name,publicCloudinaryId:null==(n=r.profile_image)?void 0:n.public_cloudinary_id,subtitle:[r.category,r.email,r.phone_number].filter(Boolean).join(" | ")})}})),[...o&&null!=(n=null==j?void 0:j.artistsByFilter)?n:[],...o?[]:null!=(t=null==f?void 0:f.myArtists)?t:[]].forEach(e=>{e.sellers.forEach(e=>{if(e.firebaseId!==s&&!y.has(e.id)&&!d.has(e.id)){var r;d.add(e.id),a.push({id:e.id,authId:e.firebaseId,name:e.name,publicCloudinaryId:null==(r=e.profileImage)?void 0:r.publicCloudinaryId})}})}),[...o&&null!=(i=null==j?void 0:j.venues)?i:[],...o?[]:null!=(l=null==f?void 0:f.myOrganizations)?l:[]].forEach(e=>{e.owners.forEach(e=>{if(e.firebaseId!==s&&!y.has(e.id)&&!d.has(e.id)){var r;d.add(e.id),a.push({id:e.id,authId:e.firebaseId,name:e.name,publicCloudinaryId:null==(r=e.profileImage)?void 0:r.publicCloudinaryId})}})}),null==(e=m.data)||e.forEach(e=>{if(e.id!==s&&!y.has(e.id)&&!d.has(e.id)){var r;d.add(e.id),a.push({id:e.id,authId:e.id,name:e.name,publicCloudinaryId:null!=(r=e.profile_image_id)?r:void 0})}}),S||o)?a.filter(e=>!S||e.name.toLowerCase().includes(S)):[]},[S,y,v.data,f,j,m.data,o,s])}({roomId:r,myAuthId:n,isAdmin:i,isBuyer:l,isSeller:s,usersInRoom:a,searchQuery:c});return(0,t.jsxs)(o.S,{maxHeight:250,style:{overflowY:"auto",boxShadow:"0px 10px 28px 0px rgba(0, 0, 0, 0.25)"},bg:"$neutral750",position:"absolute",top:70,br:3,elevation:5,"$platform-web":{width:200,right:0},"$platform-native":{left:0,right:0},ml:30,mr:80,children:[c.length>0&&h.length>0&&(0,t.jsx)(j.O,{children:(0,t.jsx)(o.S,{children:h.map(e=>(0,t.jsx)(ef,{userToAdd:e,addUserMutation:u,roomId:r,onAdded:d},e.id))})}),c.length>0&&0===h.length&&(0,t.jsx)(o.S,{py:"$6",children:(0,t.jsx)(p.E,{color:"$color10",textAlign:"center",children:"No users found"})})]})};function eS(e){var r;let{onClose:n,onRemoveUser:l}=e,s=null==(r=(0,h.A)().user)?void 0:r.uid,d=(0,b.A)().data,c=f.K.isAdmin(d),u=f.K.isBuyer(d),x=f.K.isSeller(d),{onRequestClose:g}=G.A.Portaled.useContext();(0,C.useMemo)(()=>{var e,r;
1return new Set(d&&"User"===d.__typename&&null!=(r=null==(e=d.organizations)?void 0:e.map(e=>e.id))?r:[])},[d]),(0,C.useMemo)(()=>{var e,r;return new Set(d&&"User"===d.__typename&&null!=(r=null==(e=d.artists)?void 0:e.map(e=>e.id))?r:[])},[d]);let m=(0,I.oi)(),[v,y]=(0,C.useState)(!1),S=(0,C.useCallback)(()=>{g(),n()},[g,n]),{roomData:$,roomUsers:A}=ei(),w=null==$?void 0:$.id,k=A.filter(e=>e.id!==s),[F,z]=(0,C.useState)(""),L=(0,Q.A)(),P=(0,C.useRef)(null),_=(0,C.useCallback)(()=>{if("web"===i.A.OS)y(!0);else{var e;null==(e=P.current)||e.present()}},[]);return(0,t.jsxs)(o.S,{bg:"$neutral800",br:10,overflow:"hidden",pb:30,pt:i.A.select({android:Math.max(L.top+20,30),default:30}),$md:{gap:40},gap:"$6",f:1,children:[(0,t.jsxs)(o.S,{fd:"row",gap:"$4",px:30,ai:"center",jc:"space-between",fw:"wrap",children:[(0,t.jsx)(p.E,{fontSize:20,bold:!0,lineHeight:30,children:"Edit Members"}),(0,t.jsxs)(o.S,{fd:"row",ai:"center",f:1,jc:"flex-end",gap:"$4",children:[v?(0,t.jsx)(ev,{searchQuery:F,setSearchQuery:z}):(0,t.jsxs)(a.$n,{size:"$3.5",gap:"$2",br:3,bg:"$neutral600",hoverStyle:{scale:1,bg:"$neutral500"},accessibilityLabel:"Add Member",onPress:_,children:[(0,t.jsx)(a.$n.Text,{fontWeight:"500",fontSize:14,children:"Add Member"}),(0,t.jsx)(a.$n.Icon,{icon:eo.M})]}),(0,t.jsx)(a.$n,{size:"$3.5",square:!0,br:3,bg:"$neutral600",hoverStyle:{scale:1,bg:"$neutral500"},accessibilityLabel:"Close",onPress:v?()=>y(!1):S,children:(0,t.jsx)(a.$n.Icon,{icon:el.X})})]})]}),(0,t.jsxs)(Z.Z,{children:[(0,t.jsx)(Z.Z.Trigger,{children:e=>{let{onOpen:r}=e;return(0,t.jsx)(j.O,{style:{flex:1},children:(0,t.jsx)(o.S,{gap:"$4",px:30,children:k.map(e=>{var n;let s=(null==(n=m.variables)?void 0:n.userId)===e.id&&m.isPending,d=A.length>2&&(c||e.can_i_delete);return(0,t.jsxs)(o.S,{fd:"row",ai:"center",gap:"$4",p:"$2",br:3,hoverStyle:{bg:"#FFFFFF0D"},transition:"quick",o:s?.5:1,f:1,children:[(0,t.jsxs)(o.S,{fd:"row",ai:"center",f:1,gap:"$4",children:[(0,t.jsx)(E.e,{size:34,round:!0,children:(0,t.jsx)(E.e.ImageOrInitials,{name:e.name,publicCloudinaryId:e.profile_image_id,sizes:"34px",quality:100})}),(0,t.jsx)(p.E,{fontSize:14,f:1,lineHeight:14,fontWeight:"500",numberOfLines:1,children:e.name})]}),(0,t.jsxs)(o.S,{fd:"row",ai:"center",gap:"$4",children:[d&&i.A.select({web:(0,t.jsxs)(V.K,{children:[(0,t.jsx)(V.K.Trigger,{asChild:!0,children:(0,t.jsx)(V.K.Button,{accessibilityLabel:"Remove ".concat(e.name),children:(0,t.jsx)(a.$n.Text,{children:"Remove"})})}),(0,t.jsx)(V.K.Content,{title:"Are you sure you want to remove\nthis member?",description:"This member will be removed from the group and will no\nlonger receive new messages.",children:(0,t.jsxs)(V.K.Footer,{children:[(0,t.jsx)(V.K.Action,{variant:"destructive",onAction:()=>l(e.id,e.name),icon:ea.l,accessibilityLabel:"Remove member",children:"Remove member"}),(0,t.jsx)(V.K.Cancel,{accessibilityLabel:"Cancel",children:"Cancel"})]})})]}),default:(0,t.jsx)(V.K.Button,{accessibilityLabel:"Remove ".concat(e.name),onPress:()=>{Y.A.alert("Are you sure you want to remove this member?","This member will be removed from the group and will no longer receive new messages.",[{text:"Cancel",style:"cancel"},{text:"Remove",onPress:()=>l(e.id,e.name),style:"destructive"}])},children:(0,t.jsx)(a.$n.Text,{children:"Remove"})})}),!x&&(0,t.jsx)(a.$n,{w:34,h:34,square:!0,br:"$full",bg:"$neutral600",hoverStyle:{scale:1,bg:"$neutral400"},accessibilityLabel:"View ".concat(e.name,"'s profile"),onPress:()=>r(e),children:(0,t.jsx)(a.$n.Icon,{icon:N.R,size:16})})]})]},e.id)})})})}}),(0,t.jsx)(Z.Z.Content,{})]}),v&&(0,t.jsx)(ey,{roomId:w,myAuthId:s,isAdmin:c,isBuyer:u,isSeller:x,usersInRoom:A,onClose:()=>y(!1),searchQuery:F}),(0,t.jsx)(ep,{ref:P,roomId:w,myAuthId:s,isAdmin:c,isBuyer:u,isSeller:x,usersInRoom:A})]})}let e$=(0,v.u)(function(e){return(0,t.jsx)(G.A.Portaled,{...e})},{Trigger(e){let{children:r}=e,{openEditModal:n}=ei();return(0,t.jsx)(G.A.Portaled.Trigger,{children:e=>{let{onOpen:t}=e;return r({onOpen:e=>{n(e),t()}})}})},Close:G.A.Portaled.Close,Content:e=>(0,t.jsx)(G.A.Portaled.Content,{portalToDashboardLayout:!0,padded:!1,maxWidthWhenExpanded:514,header:!1,dangerouslyDisableNativeScroll:!0,scrollable:!1,
1children:(0,t.jsx)(eS,{...e})})});var eA=n(609745);let ew={mobile:1,desktop:3};function eI(e){let{users:r,layout:n}=e,i=r.length;if(i<2)return(0,t.jsx)(o.S,{});let l=ew[n],s=r.slice(0,l),a=Math.max(0,i-l);return(0,t.jsxs)(o.S,{fd:"row",ai:"center",gap:"$3",accessibilityLabel:"".concat(i," members in this chat"),children:[s.map(e=>(0,t.jsx)(E.e,{round:!0,size:24,children:(0,t.jsx)(E.e.ImageOrInitials,{name:e.name||"",publicCloudinaryId:e.profile_image_id,sizes:"24px"})},e.id)),a>0?(0,t.jsx)(o.S,{w:24,h:24,br:"$full",bg:"$color5",ai:"center",jc:"center",accessibilityLabel:"".concat(a," more members not shown as avatars"),children:(0,t.jsxs)(p.E,{fontSize:12,lineHeight:22,fontWeight:"500",children:["+",a]})}):null]})}function eC(e){let{room:r,name:n,imageId:i,isSeller:l,onPressTitle:s,isPressable:a}=e,d=null!=r&&r.users.length<=2||l||!!i;return(0,t.jsxs)(o.S,{fd:"row",ai:"center",gap:"$5",f:1,cursor:a?"pointer":"default",onPress:a?s:void 0,children:[d?(0,t.jsx)(E.e,{round:!0,size:36,children:(0,t.jsx)(E.e.ImageOrInitials,{name:n,publicCloudinaryId:i,sizes:"36px"})}):(0,t.jsx)($.A,{radius:"round",children:(0,t.jsx)(o.S,{br:"$full",p:"$4",w:36,h:36,bg:"#FFFA8426",ai:"center",jc:"center",children:(0,t.jsx)(_.c,{size:16,color:"$yellow500"})})}),(0,t.jsx)(o.S,{f:1,children:(0,t.jsx)($.A,{width:200,height:22,children:(0,t.jsx)(p.E,{bold:!0,fontSize:20,lineHeight:22,numberOfLines:1,children:n})})})]})}let eE=e=>(0,t.jsx)(er,{children:(0,t.jsx)(et,{children:(0,t.jsx)(ek,{...e})})}),ek=e=>{var r,n,p,j,v;let{room:y,safeArea:S}=e,w=null!=(j=null==y?void 0:y.id)?j:"",E=(0,m.r)(),k=null==(r=(0,h.A)().user)?void 0:r.uid,F=(0,b.A)().data,z=f.K.isBuyer(F),L=f.K.isSeller(F),P=f.K.isAdmin(F),_=(0,c.o)(),B=(0,x.Q)().ltSm,[O,M]=(0,C.useState)(!1),{isUserInfoOpen:T}=(()=>{let e=(0,C.useContext)(ee);if(void 0===e)throw Error("useUserInfoModal must be used within a UserInfoModalProvider");return e})(),R=(0,u.jq)(y,k,z,L),H=(0,I.oi)(),{toast:N}=(0,A.A)(),W=(0,C.useCallback)(async(e,r)=>{try{let n=await H.mutateAsync({roomId:w,userId:e});if(null==n?void 0:n.id){if(e===k){N({severity:"success",title:"You left the chat"}),E.push(g.y.dashboard.chat.$url());return}N({severity:"success",title:"Removed ".concat(r)})}else N({severity:"error",title:"Failed to remove ".concat(r," (API Error)")})}catch(e){N({severity:"error",title:"Failed to remove ".concat(r),message:e instanceof Error?e.message:"Unknown error"})}},[H,w,k,N,E]);if(!k)return null;let U=y&&(0,u.Hk)(y,k,z,L,P),q=null!=(v=null==y?void 0:y.users)?v:[],K=null==y||null==(n=y.artist_tags[0])?void 0:n.slug,V=(0,u.H_)(y,k,L)?null==y||null==(p=y.organization_tags[0])?void 0:p.slug:void 0,Z=!!((z||P)&&K||L&&V);return(0,t.jsx)($.A.Group,{show:!y,children:(0,t.jsxs)(l.Y,{height:S?void 0:_,bg:"android"===i.A.OS?"#09090A":"#09090A80",fd:"row",px:"$4",pb:"$4",pt:S||"$2.5",ai:"center",pos:"absolute",w:"100%",gap:"$5",children:[(0,t.jsx)(eA.m,{stretch:!0}),(0,t.jsx)($.A,{children:(0,t.jsx)(a.$n,{onPress:()=>E.back(),filling:"plain",square:!0,accessibilityLabel:"Go back","$group-page-sm":{dsp:"none"},h:40,p:0,w:40,children:(0,t.jsx)(a.$n.Icon,{icon:s.J,size:24})})}),B?null:(0,t.jsx)(eC,{room:y,name:null!=U?U:"",imageId:R,isSeller:L,isPressable:Z,onPressTitle:()=>{if((z||P)&&K)return void E.push(g.y.dashboard.artist_discovery._artistSlug(K).$url());L&&V&&E.push(g.y.venues._slug(V).$url({query:{}}))}}),(0,t.jsxs)(o.S,{fd:"row",f:1,$sm:{flexShrink:0,flexGrow:0,jc:"flex-start"},jc:"space-between",ai:"center",gap:"$4",children:[(0,t.jsx)(eI,{users:q,layout:B?"mobile":"desktop"}),(0,t.jsx)($.A,{radius:3,children:(0,t.jsxs)(e$,{children:[(0,t.jsx)(e$.Trigger,{children:e=>{let{onOpen:r}=e;return i.A.select({web:(0,t.jsxs)(J.Popover,{open:O,onOpenChange:M,placement:"bottom-end",children:[(0,t.jsx)(D.A.Trigger,{children:(0,t.jsx)(a.$n,{accessibilityLabel:"Chat Room Info",filling:"plain",square:!0,transition:"quick",hoverStyle:{scale:1,bg:"$neutral600"},pressStyle:{scale:1},br:3,h:40,onPress:()=>M(!O),children:(0,t.jsx)(a.$n.Icon,{icon:d.i})})}),(0,t.jsx)(J.Popover.Content,{roomId:w,isUserInfoOpen:T,onEditMembers:()=>{r(w),M(!1)}})]}),default:(0,t.jsxs)(J.NativeModal,{children:[(0,t.jsx)(J.NativeModal.Trigger,{children:(0,t.jsx)(a.$n,{accessibilityLabel:"Chat Room Info",filling:"plain",square:!0,transition:"quick",hoverStyle:{scale:1,bg:"$neutral600"},pressStyle:{scale:1,bg:"$neutral600"},br:3,h:40,onPress:()=>M(!O),children:(0,t.jsx)(a.$n.Icon,{icon:d.i,size:24})})}),(0,t.jsx)(J.NativeModal.Content,{roomId:w,isUserInfoOpen:T,onEditMembers:()=>{r(w)}})]})})}}),(0,t.jsx)(e$.Content,{onClose:()=>{},onRemoveUser:(e,r)=>{W(e,r)}})]})})]})]})})};var eF=n(623976),ez=n(785598),eL=n(960750),eP=n(721582),e_=n(712724),eB=n(990086),eO=n(968407),eM=n(935263),eT=n(21861),eR=n(433343),eH=n(117616);let eN=(0,eL.x)(function(){let{roomId:e,messageId:r}=(0,ez.D)();return(0,eT.J)("chat_viewed",{room_id:e}),(0,t.jsx)(eU,{roomId:e,messageId:r})}),eW=e=>{let{children:r}=e;return"web"===i.A.OS?(0,t.jsx)(o.S,{f:1,backgroundImage:"radial-gradient(33.16% 39.03% at 84.05% 0%, rgba(255, 247, 55, 0.20) 0%, rgba(9, 9, 10, 0.20))",children:r}):(0,t.jsxs)(o.S,{f:1,pb:"$4",children:[(0,t.jsx)(eR._,{source:n(337351),style:eH.A.absoluteFill,contentFit:"cover",cachePolicy:"memory-disk"}),r]})};function eU(e){let{roomId:r,messageId:n}=e,l=(0,I.nb)({id:r}).data,s=(0,Q.A)();return(0,t.jsx)(eM.qe,{children:(0,t.jsxs)(eW,{children:[(0,t.jsx)(eB.X$,{bottomOffset:"safe-area-bottom",children:(0,t.jsx)(e_.m,{roomId:r,children:(0,t.jsxs)(eO.I,{children:[(0,t.jsx)(o.S,{f:1,children:(0,t.jsx)(eF.k,{roomId:r,initialScrollToMessageId:n},"message-".concat(r))}),(0,t.jsx)(eP.H,{roomId:r},"composer-".concat(r)),(0,t.jsx)(eB.Ku,{})]})})}),(0,t.jsx)(eE,{safeArea:i.A.select({android:s.top+12,default:s.top}),room:l})]})})}},560196:(e,r,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/dashboard/chat/[roomId]",function(){return n(539096)}])},748363:(e,r,n)=>{"use strict";n.d(r,{A:()=>a});var t=n(406029),i=n(321784),l=n(638609),s=n(334823),o=n(455729);let a=(0,o.forwardRef)(function(e,r){let{leftIcon:n,rightIcon:a,error:d,disabled:c,preserveVisualWhenDisabled:u,type:h,value:x,defaultValue:g,onFocus:m,onBlur:b,secureTextEntry:f,keyboardType:p,editable:j,multilineHeight:v,suppressInnerInset:y,...S}=e,[$,A]=(0,o.useState)(!1),w=(0,o.useRef)(null);(0,o.useImperativeHandle)(r,()=>w.current);
1let I=("string"==typeof x?x:"string"==typeof g?g:null!=x?String(x):"").length>0,C=null!=c?c:!1===j,E=null!=d&&d,k=!!(C&&u),F="rgba(202, 202, 208, 0.15)",z="#FFFFFF80",L="#FFFFFF26",P=C&&!k?F:E?"#E43F3F":$?"rgba(202, 202, 208, 0.75)":F,_=!E&&!$&&(!C||k),B=!!S.multiline,O="web"===s.A.OS&&B,M=O?i.e5:i.pd,T=C&&!k?L:E||$||I?"#FFFFFF":z,R=C&&!k?L:z;return(0,t.jsx)(l.S,{h:B&&v?v:50,br:10,bw:1,borderColor:P,bg:"rgba(255, 255, 255, 0.02)",opacity:C&&!k?.7:1,hoverStyle:C||E?void 0:{borderColor:"rgba(202, 202, 208, 0.75)",bg:"rgba(255, 255, 255, 0.02)"},children:(0,t.jsxs)(l.S,{flex:1,fd:"row",ai:B?"flex-start":"center",px:14,...B?{py:12}:{},onPress:()=>{if(!C&&w.current)try{"function"==typeof w.current.focus?w.current.focus():"focus"in w.current&&w.current.focus()}catch(e){}},cursor:C&&!k?"not-allowed":C&&k?"default":"text",..._&&!y?{..."web"===s.A.OS?{boxShadow:"inset 0 0 0 0.125px rgba(202, 202, 208, 0.15)"}:{}}:{},children:[n&&(0,t.jsx)(l.S,{mr:8,pointerEvents:"none",children:n}),(0,t.jsx)(M,{ref:w,flex:1,h:"100%",bg:"transparent",borderWidth:0,color:T,placeholderTextColor:R,fontSize:15,fontWeight:400,editable:!C,secureTextEntry:"password"===h||null!=f&&f,keyboardType:null!=p?p:"number"===h?"numeric":"email"===h?"email-address":"default",onFocus:e=>{A(!0),null==m||m(e)},onBlur:e=>{A(!1),null==b||b(e)},value:x,defaultValue:g,px:0,py:0,unset:!0,..."web"!==s.A.OS&&B?{textAlignVertical:"top"}:{},...O?{style:{resize:"none"}}:{},..."web"===s.A.OS&&h&&!O?{type:h}:null,...S}),a&&(0,t.jsx)(l.S,{ml:8,pointerEvents:"none",children:a})]})})})},839136:(e,r,n)=>{"use strict";n.d(r,{R:()=>o});var t=n(455729),i=n(583873),l=n(839607),s=n(406029);let o=(0,l.S)((0,t.memo)(function(e){let{color:r="black",size:n=24,...t}=e;return(0,s.jsxs)(i.BS,{viewBox:"0 0 256 256",width:n,height:n,fill:"currentColor",...t,children:[(0,s.jsx)(i.rw,{width:"256",height:"256",fill:"none"}),(0,s.jsx)(i.wA,{d:"M160,112a24,24,0,1,1-24-24A24,24,0,0,1,160,112Zm64-72V216a16,16,0,0,1-16,16H64a16,16,0,0,1-16-16V192H32a8,8,0,0,1,0-16H48V136H32a8,8,0,0,1,0-16H48V80H32a8,8,0,0,1,0-16H48V40A16,16,0,0,1,64,24H208A16,16,0,0,1,224,40ZM190.4,163.2A67.88,67.88,0,0,0,163,141.51a40,40,0,1,0-53.94,0A67.88,67.88,0,0,0,81.6,163.2a8,8,0,1,0,12.8,9.6,52,52,0,0,1,83.2,0,8,8,0,1,0,12.8-9.6Z"})]})}))},902566:(e,r,n)=>{"use strict";n.d(r,{L:()=>o});var t=n(455729),i=n(583873),l=n(839607),s=n(406029);let o=(0,l.S)((0,t.memo)(function(e){let{color:r="black",size:n=24,...t}=e;return(0,s.jsxs)(i.BS,{viewBox:"0 0 256 256",width:n,height:n,fill:"currentColor",...t,children:[(0,s.jsx)(i.rw,{width:"256",height:"256",fill:"none"}),(0,s.jsx)(i.wA,{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32Zm-8,128H176V88a8,8,0,0,0-8-8H96V48H208Z"})]})}))},930355:(e,r,n)=>{"use strict";function t(e){let r=(""+(e=e.replace("+1",""))).replace(/\D/g,"");if(10!==r.length)return e;let n=r.substring(0,3),t=r.substring(3,6),i=r.substring(6);return"(".concat(n,") ").concat(t,"-").concat(i)}n.d(r,{n:()=>t})},980417:(e,r,n)=>{"use strict";n.d(r,{_:()=>o});var t=n(455729),i=n(583873),l=n(839607),s=n(406029);let o=(0,l.S)((0,t.memo)(function(e){let{color:r="black",size:n=24,...t}=e;return(0,s.jsxs)(i.BS,{viewBox:"0 0 256 256",width:n,height:n,fill:"currentColor",...t,children:[(0,s.jsx)(i.rw,{width:"256",height:"256",fill:"none"}),(0,s.jsx)(i.wA,{d:"M176,128h48a8,8,0,0,1,8,8v64a8,8,0,0,1-8,8H32a8,8,0,0,1-8-8V136a8,8,0,0,1,8-8H80",fill:"none",stroke:r,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),(0,s.jsx)(i.N1,{x1:"128",y1:"128",x2:"128",y2:"24",fill:"none",stroke:r,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),(0,s.jsx)(i.Ro,{points:"80 72 128 24 176 72",fill:"none",stroke:r,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),(0,s.jsx)(i.jl,{cx:"188",cy:"168",r:"12"})]})}))}},e=>{e.O(0,[3580,3343,8065,636,6593,8792],()=>e(e.s=560196)),_N_E=e.O()}]);
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.