1"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[3828],{75187:(e,s,t)=>{t.d(s,{A:()=>w});var i=t(40025),n=t(17463),a=t(80150),r=t(62259),o=t(76848),l=t(91609),c=t(85129),d=t(64714),m=t(9950),u=t(60853),p=t(78674),x=t(56704),h=t(11501),v=t(44414);const g=({nameDefault:e,groupId:s})=>{const t=(0,u.wA)(),[i,n]=(0,m.useState)(""),[g,f]=(0,m.useState)(!1),[b,j]=(0,m.useState)(!1),w=()=>{j(!0),n(e||"")};return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("div",{children:(0,v.jsx)("span",{"aria-label":x.e9.EDIT_GROUP_NAME,className:"ficon ficon-pencil text-[14px] ml-2",onClick:w,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),w())},role:"button",tabIndex:0})}),(0,v.jsx)(o.aF,{ariaHideApp:!1,className:"model-confirm-delete !text-start !w-[500px]",isOpen:b,onRequestClose:()=>j(!1),children:(0,v.jsxs)("div",{className:"title-block",children:[(0,v.jsx)("button",{className:"btn-close",onClick:()=>j(!1),children:"\xd7"}),(0,v.jsxs)("div",{children:[(0,v.jsx)("p",{className:"font-base font-roboto mb-6 text-center",children:x.e9.EDIT_GROUP_NAME}),(0,v.jsxs)("div",{children:[(0,v.jsx)(c.A_,{classNameInput:"!px-5 !py-[10px] !h-auto",name:"subject",onChange:e=>{n(e.target.value)},readOnly:!1,type:"text",value:i}),(0,v.jsx)("div",{className:"text-center",children:(0,v.jsx)(l.$n,{className:"btn-dropdown",color:"NIGHT_RIDER",disabled:g||!i.trim(),loading:g,onSubmit:()=>{f(!0);t((0,r.bl)(s,{name:i},{onSuccess:()=>{f(!1),j(!1),t({type:p.Pj1,data:{id:s,name:i}})},onError:e=>{f(!1),t((0,a.ZH)((0,d.vG)(e,h.MZl)))}}))},title:"Submit"})})]})]})]})})]})};var f=t(48738),b=t.n(f),j=t(24176);const w=({details:e,classNames:s,setType:t})=>{const a=(0,u.wA)(),o=(0,u.d4)((e=>e.auth.userInfo.id)),c=e.recipient_group,d=c.thumbnail_avatar||c.avatar||"media/images/avatar-group.png",[x,f]=(0,m.useState)(!1),[w,N]=(0,m.useState)(null),[A,y]=(0,m.useState)(!1),[_,C]=(0,m.useState)(""),[I,M]=(0,m.useState)(null),[E,k]=(0,m.useState)(!1);return(0,v.jsxs)("div",{className:b()(s),children:[(0,v.jsx)("button",{className:"w-[20px] cursor-pointer",onClick:()=>f(!0),children:(0,v.jsxs)("svg",{fill:"none",height:"64",viewBox:"0 0 64 64",width:"64",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[(0,v.jsx)("rect",{fill:"url(#pattern0)",height:"64",width:"64"}),(0,v.jsxs)("defs",{children:[(0,v.jsx)("pattern",{height:"1",id:"pattern0",patternContentUnits:"objectBoundingBox",width:"1",children:(0,v.jsx)("use",{transform:"scale(0.015625)",xlinkHref:"#image0_2433_65000"})}),(0,v.jsx)("image",{height:"64",id:"image0_2433_65000",width:"64",xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAOxAAADsQBlSsOGwAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAOaSURBVHic7dpPaBxlGMfx7/POGBf/VoLa2qiEiPiPYsnBQ0x4dzZBUolaJIhQvPoXj1JQYVEQrFYEES89tlXEQqXCEsPODCY59KKC2JZSL6GmFUIq6mHdOPN4yEYCzux62Nmw9f2cwjzPPvzeJbs7886A4ziO4zgAo6Oj10xPT9+03Tl6SQCCILhbVQ8DM8AAcBH4IIqiDwFtN2B2dtZbXV19SFVvLTxtFxhj0jRNV+I4PgcgExMTd3qedxrYldH/SRRFL+UNq1QqD6RpegK4r6C8RQpV9Rnjed7bZC8e4IVyuTyaN0FVj9KfiwcIROSQAR5v0yR59SAIdqvq3kKi9c6MAW7o0JRZF5G/up+n59YN8H27DhH5Lut4vV7/RVUXConVO18YEXmH/G/6c4ODgyfyXu37/oE+fRNS4Hiz2Xx982fwFVV9DyhtdojID8D+MAx/6jStUqncLiLXFxa3yxqNxpXFxcUr0DoPAJiamrpjfX19nzFmh6qeUdWv4zi+Gj7njuM4juM4jpPB2/yjWq0aY8ze4eHh+4eGhhrLy8t/bGewXtm8GApU9Qgw3DquwKelUunFWq32W6cZ1toREbm5yKDdJCKXwzD8GUBaW16LbLkS3KIeRdEUOZfL1tp7jDGf9+POkKqeAp4zwFtkLx6gYq19LG+IiBztx8UDiMiMiLxrgIkOjZn18fHxXcAjRYTrof2GDvv+V7nUAN+06xCROOv4wsLCJeB0AaF66aRJkuRNoJFVVdX5MAzn816tqgeAb4tKV7AvVfWgAFhrrYgcAUZaxRQ41mw2X15aWvq906QgCEZUdUeBYbvK9/1L8/PzK7BlT7BarZo4jvd4nndLkiRn4zi+vH0RHcdxHMdxHKdo/5wKB0GwG9jXOqc/o6pz/4fb4wJQLpdfBQ4B126p/aiqT8VxfKHTEGvtTt/3rysoY9d5nvfr3NzcGmzsCT4JnMzpPV8qlfbUarU/s4qtByyPAWMFZS2KAp81m83nfeBgm8Z7G43G08DxzCkbzwn22+Jh4z//2YGBgVUDPNyhObNurd0JPNrtZD02a4BON0Ay68YYL+t4n/GNiHzVpkHz6q0bC/26HbbplAHeAFayqqr6cRiGuYtMkuSAiJwtKl3B6qr6mgBMTk7elSTJ+8ATbPwULgOHoyj6iP/wuPza2tqDSZLcVnjkLjDGpCJysV6vn/9X0Vrrj42N3bgNuRzHcRzH6b2/AatzN+IC05i0AAAAAElFTkSuQmCC"})]})]})}),(0,v.jsxs)("div",{className:b()("content-detail-group",{open:x}),children:[(0,v.jsxs)("div",{className:"p-5 border-gray border-solid border-b text-center flex justify-between items-center",children:[(0,v.jsx)("button",{className:"text-[26px] cursor-pointer",onClick:()=>f(!1),children:"\xd7"}),(0,v.jsx)("h3",{className:"font-roboto-bold text-[18px]",children:"Group chat details"}),(0,v.jsx)(i.A,{classNames:"w-[18px]",groupId:e.recipient_group.id,isShow:!0,userId:o})]}),(0,v.jsxs)("div",{className:"p-5 border-gray border-solid border-b",children:[(0,v.jsxs)("div",{className:"relative flex justify-center",children:[(0,v.jsx)(n.A,{avatar:d,recipients:c.members,size:70}),(0,v.jsxs)("div",{className:"w-7 h-7 absolute -bottom-3 flex items-center justify-center rounded-full bg-white cursor-pointer shadow",children:[(0,v.jsx)("input",{accept:"image/*",className:'absolute top-0 left-0 right-0 bottom-0 opacity-0 before:absolute before:bottom-0 before:top-0 before:left-0 before:right-0 before:cursor-pointer before:content-[""]',onChange:e=>{var s;const t=null===(s=e.target.files)||void 0===s?void 0:s[0];if(!t)return;const i=t.name.split(".").pop()||"";if(t.size>5242880)return void a(r.in(h.XXe));const n=new FileReader;n.onloadend=()=>{C(n.result),M(i),k(!0)},n.readAsDataURL(t)},placeholder:"Upload avatar",type:"file",value:""}),(0,v.jsx)("span",{"aria-hidden":"true",className:"ficon ficon-camera text-sm"})]})]}),(0,v.jsx)("div",{className:"mt-[15px]",children:(0,v.jsxs)("div",{className:"flex items-center justify-center",children:[(0,v.jsx)("p",{children:c.name||"Group name"}),(0,v.jsx)(g,{groupId:c.id,nameDefault:c.name})]})})]}),(0,v.jsx)("div",{className:"p-4 pb-0 overflow-y-auto max-h-[calc(100%_-_325px)] sm:max-h-[calc(100%_-_210px)]",children:c.members.map((e=>(0,v.jsxs)("div",{className:"flex items-center mb-4",children:[(0,v.jsxs)("label",{className:"flex items-center cursor-pointer mb-0",htmlFor:`member-${e.id}`,children:[(0,v.jsx)(l.OP,{avatar:e.thumbnail_avatar||e.avatar,className:"mx-[10px] shrink-0 border-[#ccc] border border-solid",id:e.id,name:e.name,size:32}),(0,v.jsx)("p",{className:"label-option",children:e.name||""})]}),(c.creator===o||e.id===o)&&(0,v.jsx)("button",{className:"border-gray border-solid border rounded-[10px] px-3 py-[6px] text-[11px] ml-auto",onClick:()=>{return s=e.id,void N(s);var s},children:o===e.id?"Leave":"Remove"})]},e.id)))})]}),(0,v.jsx)(l.rI,{error:!1,loading:A,message:w===o?h.hAs:h.piY,messageButtonConfirm:w===o?h.Ix2:h.TOi,messageError:"",modalIsOpen:!!w||!1,onCloseModal:()=>N(null),onConfirm:()=>{if(!w)return;y(!0),a(r.gt(c.id,{member_ids:[w]},{onSuccess:()=>{y(!1),N(null),w===o&&(a({type:p.TXU,data:{id:c.id}}),t("composeMessage"))},onError:()=>{y(!1)},method:"DELETE"}))}}),(0,v.jsx)(j.A,{avatarFile:_,avatarType:I,modalIsOpen:E,onCloseModal:()=>k(!1),onUploadAvatarSuccess:async function(e,s){k(!1),a({type:p.Pj1,data:{avatar:e,thumbnail_avatar:s,id:c.id}})},url:`/messages-recipients-groups/${c.id}`})]})}},36841:(e,s,t)=>{t.d(s,{A:()=>O});var i=t(17463),n=t(37458),a=t(43969),r=t(5461),o=t(48738),l=t.n(o),c=t(91609),d=t(9950),m=t(44414);const u=e=>{const{setType:s,setModalOpen:t,hasPermissionToUseDM:i}=e;return(0,m.jsxs)("div",{className:"main-interface",children:[(0,m.jsx)(c.p2,{alt:"hard covers",className:l()("img-responsive image-desktop",{"opacity-50":!i}),height:190,src:"hard-covers-7.png",type:"local",webp:"hard-covers-7.webp",width:203}),(0,m.jsx)("p",{className:l()("heading",{"opacity-50":!i}),children:"Direct Messages"}),(0,m.jsxs)("p",{className:l()("description",{"opacity-50":!i}),children:["Send private messages to friends in your book clubs."," "]}),(0,m.jsxs)("button",{className:l()("mt-[32px] font-montserrat-semibold uppercase rounded-[30px] tracking-[0.1em] text-[12px] leading-[16
1px] py-[12px] px-[25px] shadow-[0px_6px_2px_-4px_rgba(51,51,51,0.1)] inline-flex justify-center items-center",{"border-[#333] text-[#333] bg-[#ccc] opacity-50":!i,"border-[#CE4419] text-[#CE4419] bg-[#F8EEE8]":i}),onClick:()=>i?s("composeMessage"):t(!0),children:["Compose new message",(0,m.jsx)("span",{className:`ficon-diamond ${i?"text-[#f5a431]":"text-gray-900"} ml-[8px]`})]})]})};var p=t(84319),x=t(26658),h=t(80150),v=t(62259),g=t(76848),f=t(82603),b=t(73207),j=t(64714),w=t(31916),N=t(87946),A=t.n(N),y=t(86791),_=t.n(y),C=t(50416),I=t(60853),M=t(28429),E=t(78674),k=t(50663),S=t(63768),R=t(11501),L=t(6601);t(13461);const D=Object.assign({},k.A1);D.position="relative",D.lines=12,D.length=5,D.width=2,D.radius=6,D.color="#ccc";const P={...D,color:"#000"},T={...P,top:"10px",left:"10px",length:5,radius:3};const O=function(){const e=(0,d.useRef)(null),s=(0,d.useRef)(!1),t=(0,I.wA)(),o=(0,M.Zp)(),N=(0,I.d4)((e=>{var s;return null===(s=e.totalUnread)||void 0===s?void 0:s.totalUnReadDirectMessages})),y=(0,I.d4)((e=>e.directMessages)),O=y.composeMessages,B=!!y.composeMessages.next,G=(0,I.d4)((e=>e.bannersAd.data)),U=(0,f.shouldShowBannerAd)(G),F=(0,I.d4)((e=>e.auth.userInfo)),q=(0,I.d4)((e=>e.clubReducers.results)),z=(0,d.useMemo)((()=>A()(O,"isFetching",!1)),[O.isFetching]),H=(0,d.useMemo)((()=>A()(O,"isFetched",!1)),[O.isFetched]),V=(0,d.useMemo)((()=>A()(O,"results",[])),[O.results]),[K,X]=(0,d.useState)("undefined"!==typeof window&&window.innerWidth<767||Number((0,j.eA)("recipient_id"))?"mainInterface":"composeMessage"),[Y,Z]=(0,d.useState)(""),[J,Q]=(0,d.useState)(Number((0,j.eA)("recipient_id")||0)),[$,W]=(0,d.useState)(Number((0,j.eA)("recipient_group_id")||0)),[ee,se]=(0,d.useState)(k.P0.NO_CLUB),[te,ie]=(0,d.useState)(!1),[ne,ae]=(0,d.useState)(!1),[re,oe]=(0,d.useState)(null),[le,ce]=(0,d.useState)(null),[de,me]=(0,d.useState)(null),[ue,pe]=(0,d.useState)(!1),[xe,he]=(0,d.useState)(!1),[ve,ge]=(0,d.useState)(!1),[fe,be]=(0,d.useState)(null),je=()=>{Y&&Z("")},we=(e,s)=>{s.stopPropagation(),s.preventDefault(),oe(e)},Ne=(e,s)=>{s.stopPropagation(),s.preventDefault(),ce(e)},Ae=(e,s)=>{var i;s.stopPropagation(),s.preventDefault(),ge(!0),me(e);const n=(0,j.eV)(F,e),a=!e.mute_at,r=null!==(i=e.recipient_group)&&void 0!==i&&i.id?{conversationId:e.id,recipient_group_id:e.recipient_group.id,mute_at:a}:{conversationId:e.id,recipient_id:null===n||void 0===n?void 0:n.id,mute_at:a};t(v.Tk(F.id,r,{onSuccess(){ge(!1),me(null)},onError(e){t((0,h.ZH)((0,j.vG)(e,"Failed to mute conversation"))),ge(!1),me(null)}}))},ye=(0,d.useCallback)((()=>{e.current&&(clearInterval(e.current),e.current=null)}),[]),_e=(0,d.useCallback)((()=>{t(v.sU(F.id))}),[F.id,t]),Ce=(0,d.useCallback)((()=>{s.current||(s.current=!0,t(v.De(F.id,(e=>{e.isFetched&&(s.current=!1),e.isServerErrorOrCanceled&&ye()}))))}),[F.id,t,ye]),Ie=(0,d.useCallback)((()=>{ye(),e.current=setInterval((()=>{Ce()}),k.Ad)}),[Ce,ye]);(0,d.useEffect)((()=>{F.id&&(_e(),Ie())}),[F.id]),(0,d.useEffect)((()=>{const e=()=>{F.id&&Ie()},s=()=>{ye()};if("undefined"!==typeof window)return window.addEventListener("focus",e),window.addEventListener("blur",s),()=>{window.removeEventListener("focus",e),window.removeEventListener("blur",s)}}),[F.id,Ie,ye]),(0,d.useEffect)((()=>{s.current=z}),[z]),(0,d.useEffect)((()=>(w.s.removeItem("memberInfo"),t((0,h.lV)({place:"DIRECT_MESSAGE_PAGE"})),()=>{w.d.removeItem(k.xR),t({type:E.C1S}),ye()})),[]),(0,d.useEffect)((()=>{(J||$)&&X("viewMessageThread")}),[J,$]),(0,d.useEffect)((()=>("undefined"!==typeof window&&window.addEventListener("click",je),()=>{window.removeEventListener("click",je)})),[Y]);const Me=(0,d.useCallback)(((e,s)=>A()(s,"id")!==A()(e,"member.id")&&!A()(e,"is_current_member_read")),[]),Ee=(0,d.useCallback)((()=>{t({type:E.Ct8,offset:(null===V||void 0===V?void 0:V.length)||k.RO}),_e()}),[V,t,_e]),ke=e=>{var s;const t=(0,j.eV)(F,e);return(null===t||void 0===t?void 0:t.id)===J||(null===(s=e.recipient_group)||void 0===s?void 0:s.id)===$},Se=(0,d.useMemo)((()=>ee===k.P0.NO_CLUB?{image:"img-no-clubs-2.svg",message:R.ueg,buttonConfirm:R.oQl,title:R.TlD,widthImage:200,handleAction:()=>o("/join-a-book-club")}:{image:"premium-signup.svg",message:(0,L.Ib)(!1,!1,k.GN.PREMIUM,F),buttonConfirm:R.QW$,title:(0,L.Lv)(!1,k.GN.PREMIUM,F),widthImage:98,handleAction:()=>t(x.P4({location:k.il.DIRECT_MESSAGE,urlRedirect:(0,b.cM)({featureKey:S.$5.DIRECT_MESSAGING})}))}),[ee]),Re=(0,d.useMemo)((()=>(()=>{switch(K){case"mainInterface":return(0,m.jsx)(u,{hasPermissionToUseDM:te,setModalOpen:ae,setType:X});case"composeMessage":return(0,m.jsx)(n.A,{hasPermissionToUseDM:te,setModalOpen:ae,setRecipientGroupId:W,setRecipientId:Q,setType:X});case"viewMessageThread":return(0,m.jsx)(p.A,{recipientGroupId:$,re
1cipientId:J,setRecipientGroupId:W,setRecipientId:Q,setType:X});default:return null}})()),[K,J,$,te]),Le=(0,d.useMemo)((()=>V.map((e=>{var s;const n=(0,j.eV)(F,e),{recipientName:o,recipients:c,avatar:d}=(0,r.i)({recipient:n,recipientGroupId:null===(s=e.recipient_group)||void 0===s?void 0:s.id,messagesItem:e,user:F});return(0,m.jsxs)("div",{className:l()("conversation-item",{unread:Me(e,F),actived:ke(e)}),children:[(0,m.jsx)("button",{className:"conversation-item-button",onClick:()=>(e=>{var s,i;const n=(0,j.eV)(F,e);if((null===n||void 0===n?void 0:n.id)===J||(null===(s=e.recipient_group)||void 0===s?void 0:s.id)===$)return;t({type:E.iy1,offset:0}),X("viewMessageThread");let a=`${A()(window,"location.pathname")}`;null!==n&&void 0!==n&&n.id?(Q(n.id),W(0),a+=`?recipient_id=${n.id}`):null!==(i=e.recipient_group)&&void 0!==i&&i.id&&(a+=`?recipient_group_id=${e.recipient_group.id}`,W(e.recipient_group.id),Q(0)),"undefined"!==typeof window&&window.history.pushState(null,"",a)})(e),type:"button",children:(0,m.jsxs)("div",{className:"item-message",children:[(0,m.jsx)(i.A,{avatar:d,id:null===n||void 0===n?void 0:n.id,name:o,recipients:c}),(0,m.jsxs)("div",{className:"info-message text-start",children:[(0,m.jsx)("p",{className:"name",children:o}),(0,m.jsx)("p",{className:"message",children:(0,r.j)((0,j.$J)(e.content||""),e.mention_members,!0,!0)||"Image ..."})]})]})}),(0,m.jsx)("div",{className:l()("message-actions",{"dropdown-open":fe===e.id}),children:(0,m.jsx)(a.A,{conversation:e,isDeleting:ue&&(null===re||void 0===re?void 0:re.id)===e.id,isLeaving:xe&&(null===le||void 0===le?void 0:le.id)===e.id,isMuting:ve&&(null===de||void 0===de?void 0:de.id)===e.id,onDeleteChat:we,onLeaveGroup:Ne,onMuteConversation:Ae,onOpenChange:(u=e.id,e=>{be(e?u:null)})})}),(0,m.jsx)("div",{className:l()("muted-indicator-container",{visible:!!e.mute_at}),children:(0,m.jsxs)("svg",{className:"muted-indicator-icon",fill:"none",height:"18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",width:"18",children:[(0,m.jsx)("path",{d:"M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"}),(0,m.jsx)("path",{d:"M13.73 21a2 2 0 0 1-3.46 0"}),(0,m.jsx)("line",{x1:"3",x2:"21",y1:"3",y2:"21"})]})})]},e.id);var u}))),[V,Y,J,$,fe,ue,re,xe,le,ve,de]);return(0,d.useEffect)((()=>{const e=(0,L.e4)(q);se(e.type),ie(e.hasPermission)}),[q]),(0,m.jsxs)("div",{className:"direct-messages",children:[(0,m.jsx)("div",{className:"mx-auto w-full sm:w-3/4 lg:w-7/12 xl:w-5/12 px-4 sm:px-0",children:U?(0,m.jsx)("div",{className:"bookclubs-banner mb-6",children:(0,m.jsx)(c.Bp,{banner:G,height:290,width:1140})}):null}),(0,m.jsxs)("div",{className:"direct-messages-container",children:[(0,m.jsx)("div",{className:l()("list-messages-container",{"hidden-block":"mainInterface"!==K}),children:(0,m.jsxs)("div",{className:"list-messages",children:[(0,m.jsxs)("div",{className:l()("new-message",{"opacity-50":!te}),children:[(0,m.jsx)("p",{className:"text",children:"Compose new message"}),(0,m.jsx)("button",{onClick:()=>{te?X("composeMessage"):ae(!0)},type:"button",children:(0,m.jsx)("img",{alt:"Compose new message",height:28,src:"media/icons/new_message.svg",width:28})})]}),z&&!H?(0,m.jsx)("div",{className:"p40 md:h-[calc(50vh_+_69px)] h-[53vh] flex items-center justify-center",children:(0,m.jsx)(g.y$,{config:P})}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("div",{className:"text-right",children:N>0&&(0,m.jsxs)("div",{className:"mark-all-as-read",children:[(null===y||void 0===y?void 0:y.fetchMarkAllAsRead)&&(0,m.jsx)(g.y$,{config:T}),(0,m.jsx)("button",{className:l()("btn-mark-all"),disabled:null===y||void 0===y?void 0:y.fetchMarkAllAsRead,onClick:e=>(e.stopPropagation(),t(v.o6(F.id))),children:"Mark all as read"})]})}),(0,m.jsx)("div",{className:"md:h-[calc(50vh_+_69px)] h-[53vh] overflow-y-auto p-[10px] flex flex-col",id:"scrollableDivForDMsList",children:(0,m.jsx)(C.A,{className:l()("relative",{"pb-[40px]":B}),dataLength:null===V||void 0===V?void 0:V.length,hasMore:B,loader:(0,m.jsx)("div",{className:"flex items-center justify-center loading absolute bottom-[20px] left-1/2 -transform-1/2",children:(0,m.jsx)(g.y$,{config:D})}),next:Ee,scrollableTarget:"scrollableDivForDMsList",children:Le})})]})]})}),(0,m.jsxs)("div",{className:l()("content-direct-message",{block:"mainInterface"!==K||_()(V)}),children:[Re,ee===k.P0.NOT_ALL_PREMIUM_PRO&&"composeMessage"!==K&&(0,m.jsxs)("p",{className:"px-[10px] pt-[10px] pb-[30px]",children:[(0,m.jsx)("span",{className:"font-roboto-medium",children:"Note:"})," Direct Messages are only available between members of Bookclubs Premium clubs. If you cannot find the person that you are trying to DM, it is likely that you are in a non-Premium club with them."," ",(0,m.jsx)("a",{className:"!text-[#CE4419]",href:(0,b.cM)({featureKey:S.$5.DIRECT_MESSAGING}),children:"Upgrade your club today!"})]})]})]}),(0,m.jsx)(c.rI,{classNameBtn:"mtr-button !text-[12px] !leading-[15px] !tracking-widest !uppercase mb-[24px]",classNameMessage:"font-roboto-light text-[14px] leading-[160%] text-[#333] mb-[24px] text-center",classNameTitle:"font-merriweather-light text-[24px] leading-[160%] text-[#333] mt-[8px] mb-[5px]",error:!1,image:Se.image,loading:!1,message:Se.message,messageButtonConfirm:Se.buttonConfirm,modalIsOpen:ne,onCloseModal:()=>ae(!1),onConfirm:Se.handleAction,title:Se.title,widthImage:Se.widthImage}),(0,m.jsx)(c.rI,{error:!1,loading:ue,message:R.KPO,messageButtonConfirm:R.qYR,modalIsOpen:!(null===re||void 0===re||!re.
1id),onCloseModal:()=>{oe(null)},onConfirm:()=>{if(re){var e;pe(!0);const s=(0,j.eV)(F,re),i=null!==(e=re.recipient_group)&&void 0!==e&&e.id?{conversationId:re.id,recipient_group_id:re.recipient_group.id}:{conversationId:re.id,recipient_id:null===s||void 0===s?void 0:s.id};t(v.ly(F.id,i,{onSuccess(){var e;const i=null!==(e=re.recipient_group)&&void 0!==e&&e.id?$===re.recipient_group.id:J===(null===s||void 0===s?void 0:s.id);if(re.is_current_member_read||t(v.f$(F.id)),i){X("mainInterface"),W(0),Q(0);const e=new URL(window.location.href);e.searchParams.delete("recipient_group_id"),e.searchParams.delete("recipient_id"),window.history.replaceState({},"",e.pathname+e.search)}pe(!1),oe(null)},onError(){t((0,h.ZH)("Failed to delete conversation. Please try again.")),pe(!1),oe(null)}}))}}}),(0,m.jsx)(c.rI,{error:!1,loading:xe,message:R.hAs,messageButtonConfirm:R.Ix2,modalIsOpen:!(null===le||void 0===le||!le.id),onCloseModal:()=>{ce(null)},onConfirm:()=>{var e;null!==le&&void 0!==le&&null!==(e=le.recipient_group)&&void 0!==e&&e.id&&(he(!0),t(v.gt(le.recipient_group.id,{member_ids:[F.id]},{method:"DELETE",onSuccess(){var e,s;if(t({type:E.TXU,data:{id:null===(e=le.recipient_group)||void 0===e?void 0:e.id}}),$===(null===(s=le.recipient_group)||void 0===s?void 0:s.id)){X("mainInterface"),W(0),Q(0);const e=new URL(window.location.href);e.searchParams.delete("recipient_group_id"),e.searchParams.delete("recipient_id"),window.history.replaceState({},"",e.pathname+e.search)}le.is_current_member_read||t(v.f$(F.id)),he(!1),ce(null)},onError(e){t((0,h.ZH)((0,j.vG)(e,""))),he(!1),ce(null)}})))}})]})}},9283:(e,s,t)=>{t.d(s,{A:()=>d});var i=t(77048),n=t(24499),a=t(64714),r=t(9950),o=t(44414);const l=(0,n.Ay)({resolved:{},chunkName:()=>"emoji-picker-react",isReady(e){const s=this.resolve(e);return!0===this.resolved[s]&&!!t.m[s]},importAsync:()=>(0,a.L5)((()=>Promise.all([t.e(12101),t.e(17661)]).then(t.bind(t,88687)))),requireAsync(e){const s=this.resolve(e);return this.resolved[s]=!1,this.importAsync(e).then((e=>(this.resolved[s]=!0,e)))},requireSync(e){const s=this.resolve(e);return t(s)},resolve(){return 88687}},{ssr:!1});function c({onClick:e,onEmojiClick:s,showEmojiPicker:t,onClickOutside:n}){const a=(0,r.useRef)(null);return(0,i.c)(a,n),(0,o.jsxs)("div",{ref:a,"aria-label":"Attach an Emoji",className:"wrap-attach-images wrap-attach-emoji",children:[(0,o.jsx)("button",{"aria-label":"Attach an Emoji Button",onClick:e,type:"button",children:(0,o.jsx)("i",{className:"ficon ficon-emoji message-actions","data-testid":"emoji-icon"})}),t?(0,o.jsx)(l,{className:"emoji-picker-react",height:365,onEmojiClick:s,width:320}):null]})}const d=c},77048:(e,s,t)=>{t.d(s,{A:()=>h,c:()=>p});var i=t(48688),n=t(48738),a=t.n(n),r=t(87946),o=t.n(r),l=t(86791),c=t.n(l),d=t(9950),m=t(44414);const u=new i.uK("M76JZqMe554IYkbyfjuENOvxQ6Znkejh");function p(e,s,t){(0,d.useEffect)((()=>{function i(i){e.current&&!e.current.contains(i.target)&&(s(!1),null===t||void 0===t||t(""))}if(!c()(e)&&"undefined"!==typeof document)return document.addEventListener("mousedown",i),()=>{"undefined"!==typeof document&&document.removeEventListener("mousedown",i)}}),[e,s,t])}function x({searchTern:e,onGifClick:s}){const i=t(76720),n=()=>(0,m.jsx)("p",{className:"no-results",children:"No results found!"});return(0,m.jsx)(i.Carousel,{fetchGifs:s=>e?u.search(e,{offset:s,limit:10}):u.trending({offset:s,limit:10}),gifHeight:200,gutter:6,noLink:!0,noResultsMessage:(0,m.jsx)(n,{}),onGifClick:e=>{s(o()(e,"images.fixed_height.url"))}})}const h=function({onChange:e,name:s,disabled:t=!1}){const[i,n]=(0,d.useState)(!1),[r,o]=(0,d.useState)(!0),[l,c]=(0,d.useState)(""),u=(0,d.useRef)(null),h=(0,d.useRef)(void 0);p(u,n,c);const v=(0,d.useCallback)((e=>{null===e||void 0===e||e.focus()}),[]);return(0,d.useEffect)((()=>(i||(clearTimeout(h.current),o(!0)),()=>{clearTimeout(h.current)})),[i]),(0,m.jsxs)("div",{ref:u,children:[(0,m.jsx)("button",{"aria-label":"Gif picker",className:a()("ficon ficon-gif message-actions overlay-button",{"!cursor-not-allowed":t}),onClick:()=>{t||n(!i)},type:"button"}),i?(0,m.jsxs)("div",{className:"wrap-gif-picker",children:[(0,m.jsx)("div",{className:"wrap-search-results",children:r?(0,m.jsx)(x,{onGifClick:t=>{e({target:{value:t,name:s}}),n(!1),c("")},searchTern:l}):null}),(0,m.jsx)("div",{className:"wrap-search-form",children:(0,m.jsx)("input",{ref:v,maxLength:50,onChange:e=>{c(e.target.value),o(!1),clearTimeout(h.current),h.current=setTimeout((()=>{o(!0)}),1e3)},placeholder:"Search a gif",type:"text",value:l})})]}):null]})}},72598:(e,s,t)=>{t.d(s,{A:()=>m});var i=t(48738),n=t.n(i),a=t(64916),r=t(5461),o=t(64714),l=t(87946),c=t.n(l),d=(t(9950),t(44414));const m=({parentMessage:e,currentUserId:s,isMyMessage:t})=>
1{const i=e.member.id===s?"You":e.member.name||"Unknown",l=(0,o.$J)(e.content||"")||"",m=(0,r.j)(l,e.mention_members,!0,!0),u=c()(e,"images",[]),p=c()(e,"gif_url")?[{image:c()(e,"gif_url"),id:"gif_url"}]:[];return(0,d.jsxs)("div",{className:n()("quoted-message-container border-l-4 pl-2 py-1 mb-2 rounded-sm",{"border-[#539FB5] bg-[#BFD7DE]":t,"border-[#D8551C] bg-[#E8D5CC]":!t}),children:[(0,d.jsx)("p",{className:n()("quoted-message__sender-name text-[12px] font-roboto-medium mb-1",{"text-[#539FB5]":t,"text-[#D8551C]":!t}),children:i}),(0,d.jsx)("p",{className:"quoted-message__content text-[13px] text-gray-600 overflow-hidden text-ellipsis line-clamp-2",children:m}),(0,d.jsx)(a.A,{data:[...u,...p],isDisabledGallery:!0})]})}},21583:(e,s,t)=>{t.d(s,{A:()=>l});var i=t(48738),n=t.n(i),a=t(5461),r=t(64714),o=(t(9950),t(44414));const l=({replyingToMessage:e,onCancel:s,currentUserId:t})=>{const i=e.member.id===t?"You":e.member.name||"Unknown",l=(0,r.$J)(e.content||"")||"Image";return(0,o.jsxs)("div",{className:n()("reply-preview-container","bg-gray-100 border-l-4 border-[#539FB5]","p-3 mb-2 flex items-start justify-between rounded"),children:[(0,o.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,o.jsx)("p",{className:n()("reply-preview__sender-name text-[12px] font-roboto-medium text-gray-700 mb-1"),children:i}),(0,o.jsx)("p",{className:"reply-preview__content text-[13px] text-gray-600 truncate",children:(0,a.j)(l,e.mention_members,!0,!0)})]}),(0,o.jsx)("button",{"aria-label":"Cancel reply",className:n()("reply-preview__cancel-button ml-3 text-gray-500 hover:text-gray-700","flex-shrink-0"),onClick:s,type:"button",children:(0,o.jsx)("svg",{className:"h-5 w-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{clipRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",fillRule:"evenodd"})})})]})}},15314:(e,s,t)=>{t.d(s,{A:()=>f});var i=t(48738),n=t.n(i),a=t(76848),r=t(91609),o=t(85129),l=t(94174),c=t(95491),d=t.n(c),m=t(86791),u=t.n(m),p=t(9950),x=t(60853),h=t(50663),v=t(44414);const g=Object.assign({},h.A1);g.lines=12,g.length=5,g.width=2,g.radius=5,g.color="#fff",g.position="relative";const f=({fetchMembers:e,userId:s,to:t,handleChangeMember:i,members:c,notifications:m,onChangeNotifications:f})=>{const[b,j]=(0,p.useState)(""),w=(0,x.d4)((e=>e.directMessages.members.count))||0,N=(0,x.d4)((e=>e.directMessages.members.offset))||0,A=d()((t=>{b!==t&&(j(t),e(s,!1,{searchTerm:t}))}),1e3);return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)("div",{className:"form-group",children:[(0,v.jsx)("label",{className:"form-label-control",htmlFor:"to_recipients",children:"To"}),(0,v.jsx)(a.l6,{classNamePrefix:"react-select",components:{Option:({innerProps:e,data:s,isSelected:t})=>{var i;const n=s?s.item.pronouns:"",a=(null===s||void 0===s?void 0:s.item.avatar)||(null===s||void 0===s?void 0:s.item.thumbnail_avatar);return(0,v.jsxs)("div",{className:"custom-options "+(t?"option-active":""),...e,children:[(0,v.jsx)(r.OP,{avatar:a,className:"avatar-option",id:(null===s||void 0===s?void 0:s.item.id)||0,name:(null===s||void 0===s?void 0:s.label)||"",size:40}),(0,v.jsxs)("div",{className:"content-option",children:[(0,v.jsxs)("p",{className:"label-option",children:[(null===s||void 0===s?void 0:s.label)||""," ",(0,v.jsx)("span",{className:"member-pronouns",children:n?`(${n})`:""})]}),s&&!u()(s.item.mutual_clubs)&&(0,v.jsx)("div",{className:"member-pronouns line-clamp-1",children:null===(i=s.item.mutual_clubs)||void 0===i?void 0:i.map((e=>e.name)).join(", ")})]})]})},IndicatorSeparator:null,LoadingIndicator:()=>(0,v.jsx)("div",{className:"relative",children:(0,v.jsx)(a.y$,{config:{...g,color:"#000",left:"-10px"}})})},filterOption:null,inputId:"toRecipients",isLoading:c.isFetching||!1,loadingMessage:()=>(0,v.jsx)("div",{className:"w-full relative",children:(0,v.jsx)(l.A,{itemConfigs:{count:3,className:"first:mt-0 mt-[12px] items-center gap-2",height:40,prefix:"circle"},lineConfigs:{className:"first:mt-0 mt-[6px]",height:14,count:2},type:"LIST"})}),name:"to",onChange:e=>{null!==m&&void 0!==m&&m.toRecipients&&f({}),j(""),i(e)},onInputChange:(e,{action:s})=>{"input-change"===s&&A(e)},onMenuScrollToBottom:()=>{if(!c.isFetching&&N+h.of<w){const t={searchTerm:b,offset:N+h.of};e(s,!0,t)}},options:c.results.filter((e=>e.id!==s)).map((e=>({label:e.name||e.email||"Anonymous",value:e.id,item:e}))),placeholder:"Search",value:null}),(0,v.jsx)("span",{className:n()("notification-message error",{show:!(null===m||void 0===m||!m.toRecipients)}),role:"alert",children:null===m||void 0===m?void 0:m.toRecipients}),(0,v.jsx)(o.Fv,{errors:m})]}),!u()(t)&&(0,v.jsx)("div",{className:"flex flex-wrap gap-2 mb-[20px]",children:t.map((e=>(0,v.jsxs)("div",{className:"flex items-center p-1 rounded-[50px] last:mr-0 border border-solid border-[#ccc] max-w-full",children:[(0,v.jsx)(r.OP,{avatar:e.item.avatar,className:"border-[#ccc] border border-solid shrink-0",i
1d:e.item.id,name:e.item.name,size:28}),(0,v.jsx)("p",{className:"line-clamp-1 font-roboto-bold text-[16px] text-[#333] ml-2",children:e.item.name||""}),(0,v.jsx)("button",{onClick:()=>i(e),type:"button",children:(0,v.jsx)("span",{className:"ficon-close ficon cursor-pointer p-1 text-[14px] ml-4 mr-2"})})]},e.value)))})]})}}}]);
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.